!function(t){var e={};function n(a){if(e[a])return e[a].exports;var i=e[a]={i:a,l:!1,exports:{}};return t[a].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=t,n.c=e,n.d=function(t,e,a){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:a})},n.r=function(t){Object.defineProperty(t,"__esModule",{value:!0})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=12)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:null;this.copyTemplateUI(),this.setLanguages(t)}},{key:"copyTemplateUI",value:function(){var t=this;this.UI=this.content.find(".js-select-languages:last").clone().show(),this.UI.appendTo(this.pairsUI),this.fromLanguageSelect=this.UI.find(".js-from-language-select"),this.fromLanguageSelect.on("change",function(e){return t.fromLanguageChanged()}),this.toLanguageCheckboxes=this.UI.find(":checkbox"),this.toLanguageCheckboxes.on("change",function(e){t.toLangChangeCallback()}),this.trashIcon=this.UI.find(".js-delete-language-pair")}},{key:"setLanguages",value:function(t){var e=this;t&&t.includes(this.fromLang)&&(this.fromLang=null),this.fromLang&&this.fromLanguageSelect.val(this.fromLang),this.disableFromLanguages(t),this.UI.find(".js-to-languages").show(),this.toLangs.forEach(function(t){return e.UI.find(":checkbox[value="+t+"]").prop("checked",!0)}),this.hideToLanguage(this.fromLang)}},{key:"disableFromLanguages",value:function(t){var e=this;this.fromLanguageSelect.find("option").prop("disabled",!1),t&&t.forEach(function(t){return e.fromLanguageSelect.find("option[value="+t+"]").prop("disabled",t!==e.fromLang)})}},{key:"disableFromLanguageSelect",value:function(t){this.fromLanguageSelect.prop("disabled",t)}},{key:"hideToLanguage",value:function(t){this.toLanguageCheckboxes.closest("label").show(),t&&this.UI.find(":checkbox[value="+t+"]").prop("checked",!1).closest("label").hide()}},{key:"getFromLanguage",value:function(){return this.fromLanguageSelect.val()}},{key:"getToLanguages",value:function(){var t=[];return this.UI.find(":checkbox:checked").each(function(e,n){return t.push(n.value)}),t}},{key:"fromLanguageChanged",value:function(){this.fromLang=this.getFromLanguage(),this.hideToLanguage(this.getFromLanguage()),this.fromLangChangeCallback()}},{key:"hideTrashIcon",value:function(t){t?this.trashIcon.hide():this.trashIcon.show()}},{key:"addTrashHook",value:function(t){var e=this;this.trashIcon.off("click").on("click",function(n){return e.onTrash(t)})}},{key:"onTrash",value:function(t){t(this),this.UI.remove()}}]),t}();e.default=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var n=0;n0)}},{key:"toLanguageChanged",value:function(){this.isAnyLanguagePairOKCallback(Object.keys(this.getLanguagePairs()).length>0)}}]),t}();e.default=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var n=0;n0}return a(t,[{key:"init",value:function(t){var e=this;this.content.find(".js-remove-translator").off("click").on("click",function(){return e.removeTranslator()}),this.observer=t}},{key:"isActive",value:function(){return this.active}},{key:"removeTranslator",value:function(){var t=this,e=this.content.data("user-id");this.$.ajax({type:"POST",url:ajaxurl,dataType:"json",data:{action:"wpml_remove_translation_translator",nonce:this.nonce,user_id:e},success:function(){return t.translatorRemoved()}})}},{key:"translatorRemoved",value:function(){this.content.remove(),this.active=!1,this.observer.onTranslatorsChange()}}]),t}();e.default=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var n=0;n tr").length}},{key:"addObserver",value:function(t){this.observers.push(t)}},{key:"notifyObservers",value:function(){for(var t=0;t0&&void 0!==arguments[0]&&arguments[0],n=this.content.data("nonce");this.translatorsOnlyI=new r.default(this.$,this.content.find(".js-translator-only-i"),n),this.translatorsOnlyI.init(this),this.addTranslatorButton=this.content.find(".js-add-translator"),this.addTranslatorButton.on("click",function(e){return t.addNewTranslator()}),this.translatorsTable=new s.default(this.$,this.content.find(".js-translators-table"),n,new o.default(this.$,this.content,n)),this.translatorsTable.init(),this.translatorsTable.addObserver(this),this.onTranslatorsChange(),e&&(this.hideHeading(),this.content.find("#ate-controls").hide(),this.translatorsTable.hideATESubscriptions())}},{key:"addNewTranslator",value:function(){var t=this;this.addNewTranslatorDialog||(this.addNewTranslatorDialog=new i.default(this.$,this.content,function(e){return t.translatorAdded(e)})),this.addNewTranslatorDialog.open()}},{key:"translatorAdded",value:function(t){this.addNewTranslatorDialog.close(),this.translatorsTable.addRow(t)}},{key:"hideHeading",value:function(){this.content.find("h2").hide()}},{key:"addObserver",value:function(t){this.translatorsTable.addObserver(t)}},{key:"getNumberOfTranslators",value:function(){return this.translatorsTable.getNumberOfTranslators()}},{key:"onTranslatorsChange",value:function(){this.getNumberOfTranslators()||this.translatorsOnlyI.isActive()?this.addTranslatorButton.addClass("alignright button-secondary").removeClass("button-primary"):this.addTranslatorButton.addClass("button-primary").removeClass("alignright button-secondary")}}]),t}();e.default=l},function(t,e,n){"use strict";var a=function(t){return t&&t.__esModule?t:{default:t}}(n(10));jQuery(function(){new a.default(jQuery,jQuery(".js-translators")).init()})},function(t,e,n){t.exports=n(11)}]);