"use strict";define(["app","handlebars","View","text!/v2/webapps/FirstAccess/CommonControls/Localization/Templates/LanguageButtonsTemplate.html","../Model/SetCurrentLanguageModel","utils"],function(e,g,f,d,c,a){var b=f.extend({languageButtonsTemplate:g.compile(d),events:{"click #btn-language":"selectLanguage"},selectLanguage:function(i){var h=$(i.target).data("langcd");this.onChangeLanguage(h);},onChangeLanguage:function(i){e.instance().Cache.LanguageSettings.CurrentLanguage=i;var h=this.options.parentView;e.instance().resetLanguage(function(){var j=new c();j.fetch({data:{language:i},success:function(){h.onLanguageSelected();}});});},initialize:function(h){f.prototype.initialize.apply(this,arguments);this.options=h||{};},render:function(k){if(k.length>1){var i=k.sort();var j=$.map(i,function(l){return{text:a.getLanguageName(l),langCd:l};});var h={languages:j};this.$el.html(this.languageButtonsTemplate(h));}else{$("#btns-language").hide();}return this;}});return b;});