/*!*
 **                 _     _                         
 ** __      ___ __ | |   (_)_ __   __ _ _   _  __ _ 
 ** \ \ /\ / / '_ \| |   | | '_ \ / _` | | | |/ _` |
 **  \ V  V /| |_) | |___| | | | | (_| | |_| | (_| |
 **   \_/\_/ | .__/|_____|_|_| |_|\__, |\__,_|\__,_|
 **          |_|                  |___/             
 **
 **        -- wpLingua | WordPress plugin --
 **   Translate and make your website multilingual
 **
 **     https://github.com/julien-jacob/wplingua
 **      https://wordpress.org/plugins/wplingua/
 **              https://wplingua.com/
 **
 **/
jQuery(document).ready(function(i){let r=JSON.parse(i("#wplng_dictionary_entries").val());function t(e){e.height(0),e.height(e[0].scrollHeight)}i("#wplng-new-rule-button").click(function(){i("#wplng-section-entries-all").hide(),i("#wplng-section-entry-new").show(),t(i("#wplng-dictionary-entry-new .wplng-adaptive-textarea")),window.scrollTo(0,0)}),i("#wplng-new-never-translate").change(function(){this.checked?i("#wplng-new-rules").slideUp("fast"):i("#wplng-new-rules").slideDown("fast")}),i("#wplng-new-add-button").click(function(){var e=i("#wplng-new-source").val();let t={};null!=e&&""!=e.trim()&&(i("#wplng-edit-never-translate").prop("checked")||i(".wplng-new-rule").each(function(){var e=i(this).attr("wplng-rule"),n=i("textarea",this).val();null!=n&&""!=n.trim()&&(t[e]=n.trim())}),0==Object.keys(t).length?r.push({source:e}):r.push({source:e,rules:t}),i("#wplng_dictionary_entries").val(JSON.stringify(r)),i("#submit").click())}),i("#wplng-new-cancel-button").click(function(){i("#wplng-section-entries-all").show(),i("#wplng-section-entry-new").hide(),window.scrollTo(0,0)}),i(".wplng-rule-link-remove").click(function(){let n=i(this).attr("wplng-rule"),t=[],l=0;r.forEach(e=>{l!=n&&t.push(e),l++}),i("#wplng_dictionary_entries").val(JSON.stringify(t)),i("#submit").click()}),i(".wplng-rule-link-edit").click(function(){var e=i(this).attr("wplng-rule"),n=r[e];i("#wplng-section-entries-all").hide(),i("#wplng-section-entry-edit").show(),t(i("#wplng-dictionary-entry-edit .wplng-adaptive-textarea")),i("#wplng-edit-source").val(n.source),i("#wplng-edit-save-button").prop("wplng-rule",e),null==n.rules?(i("#wplng-edit-never-translate").prop("checked",!0),i("#wplng-edit-rules").hide()):(i("#wplng-edit-never-translate").prop("checked",!1),i("#wplng-edit-rules").show(),i("#wplng-edit-rules textarea").val(""),i.each(n.rules,function(e,n){i("#wplng-edit-always-translate-"+e).val(n)})),window.scrollTo(0,0)}),i("#wplng-edit-never-translate").change(function(){this.checked?i("#wplng-edit-rules").slideUp("fast"):i("#wplng-edit-rules").slideDown("fast")}),i("#wplng-edit-save-button").click(function(){var e=i("#wplng-edit-source").val();let t={};var n=i(this).prop("wplng-rule");null!=e&&""!=e.trim()&&(i("#wplng-edit-never-translate").prop("checked")||i(".wplng-edit-rule").each(function(){var e=i(this).attr("wplng-rule"),n=i("textarea",this).val();null!=n&&""!=n.trim()&&(t[e]=n.trim())}),r.splice(n,1),0==Object.keys(t).length?r.push({source:e}):r.push({source:e,rules:t}),i("#wplng_dictionary_entries").val(JSON.stringify(r)),i("#submit").click())}),i("#wplng-edit-cancel-button").click(function(){i("#wplng-section-entries-all").show(),i("#wplng-section-entry-edit").hide(),window.scrollTo(0,0)});let e=i("textarea.wplng-adaptive-textarea");e.off("keyup.textarea").on("keyup.textarea",function(){t(i(this))}),i(window).resize(function(){e.each(function(){t(i(this))})}),e.each(function(){t(i(this))})});//# sourceMappingURL=option-page-dictionary.js.map
