HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: /var/www/html/delstar/wp-content/plugins/essential-grid/admin/assets/js/modules/grid-editor.min.js
!function(e){"use strict";var t;window.ESG??={},ESG.F??={},ESG.E??={},ESG.V??={},ESG.S??={},ESG.SC??={},ESG.C??={},ESG.LIB=void 0===ESG.LIB?{nav_skins:[],item_skins:{},nav_originals:{}}:ESG.LIB,ESG.CM=void 0===ESG.CM?{apiJS:null,ajaxCSS:null,navCSS:null}:ESG.CM,ESG.WIN??=jQuery(window),ESG.DOC??=jQuery(document),ESG.C.gridEditorInputs=void 0===ESG.C.gridEditorInputs?{}:ESG.C.gridEditorInputs,ESG.F.trim=void 0===ESG.F.trim?function(e){return null!=e&&"string"==typeof e?e.trim():e}:ESG.F.trim,window.GridEditorEssentials=new function(){var n,i=this,r=null,a={},s={},o=[],l={},u=!1,d=[],c=[],p=[];i.initDraggable=function(){jQuery(".eg-draggable").draggable({handle:".dragme"})},i.setInitLayersJson=function(e){for(var t in a=void 0!==e&&e.length>0?JSON.parse(e):{})if("string"!=typeof a[t]&&null!==a[t]){void 0===a[t].settings&&(a[t].settings={});var n=a[t].settings;n.hasOwnProperty("min-height")||(a[t].settings["min-height"]=0),n.hasOwnProperty("max-height")||(a[t].settings["max-height"]="none"),n.hasOwnProperty("duration")||(a[t].settings.duration="default"),n.hasOwnProperty("letter-spacing")||(a[t].settings["letter-spacing"]="normal"),n.hasOwnProperty("letter-spacing-hover")||(a[t].settings["letter-spacing-hover"]="normal")}},i.setInitElementsJson=function(e){for(var t in s=void 0!==e&&e.length>0?JSON.parse(e):{})void 0!==s[t].settings["font-family"]&&(s[t].settings["font-family"]=AdminEssentials.stripslashes(s[t].settings["font-family"]))},i.setInitFontsJson=function(e){c=void 0!==e&&e.length>0?JSON.parse(e):{}},i.refreshInitElements=function(e){for(var t in s=e)void 0!==s[t].settings["font-family"]&&(s[t].settings["font-family"]=AdminEssentials.stripslashes(s[t].settings["font-family"]))},i.setInitMetaKeysJson=function(e){p=void 0!==e&&e.length>0?JSON.parse(e):{}},i.setInitAllAttributesJson=function(e){l=void 0!==e&&e.length>0?JSON.parse(e):{}},i.update_layers=function(){if(null==r)return!1;null!=r.data("id")?i.update_layer_sorting():i.add_layer(),i.redraw_container_height()},i.updateInput=function(e,t,n,i){if(t=t.replace("#",""),ESG.C.gridEditorInputs[t]=void 0===ESG.C.gridEditorInputs[t]?"name"===e?jQuery(n+'[name="'+t+'"]'):jQuery("#"+t):ESG.C.gridEditorInputs[t],void 0!==ESG.C.gridEditorInputs[t]&&0!==ESG.C.gridEditorInputs[t].length)return void 0===i?ESG.C.gridEditorInputs[t].val():void("input"===n||"textarea"==n?ESG.C.gridEditorInputs[t].val(i):"select"===n&&ESG.C.gridEditorInputs[t].find('option[value="'+i+'"]').prop("selected","selected"))},ESG.DOC.on("click",".esg-pinme",(function(){var e=jQuery(this).closest(".eg-pbox.esg-box");e.hasClass("pinned")?e.removeClass("pinned"):e.addClass("pinned")})),ESG.C.pinneables=jQuery(".pinneable"),ESG.S.lsatPinnStates=void 0,ESG.WIN.on("scroll",(function(){this.scrollY<115?(1!==ESG.S.lsatPinnStates&&ESG.C.pinneables.addClass("inunpinneablerange"),ESG.S.lsatPinnStates=1):(0!==ESG.S.lsatPinnStates&&ESG.C.pinneables.removeClass("inunpinneablerange"),ESG.S.lsatPinnStates=0)})),ESG.WIN.scrollTop()<115?(1!==ESG.S.lsatPinnStates&&ESG.C.pinneables.addClass("inunpinneablerange"),ESG.S.lsatPinnStates=1):(0!==ESG.S.lsatPinnStates&&ESG.C.pinneables.removeClass("inunpinneablerange"),ESG.S.lsatPinnStates=0),i.add_layer=function(){new Date;if(null==r)return!1;var e=i.get_latest_id()+1;i.updateInput("name","eg-item-skin-element-last-id","input",e),r.data("id",e),r.attr("data-id",e);var t=new Object,n=r.data("handle");t.id=e.toString(),t.handle=r.data("handle"),t.settings=jQuery.extend({},s[r.data("handle")].settings),o.push(t),i.update_layer_sorting(),i.set_default_values(),i.select_layer(e.toString()),i.setting_has_changed(),i.propagate_element_selector(),o[o.length-1].handle=ESG_LANG.new_element_sanitize+"-"+e,r.data("handle",ESG_LANG.new_element_sanitize+"-"+e),r.attr("data-handle",r.data("handle")),r.data("orighandle",n),r.attr("orighandle",n)},i.update_layer_sorting=function(){var e=jQuery("#skin-dz-tl").sortable("toArray",{attribute:"data-id"}),t=jQuery("#skin-dz-br").sortable("toArray",{attribute:"data-id"}),n=jQuery("#skin-dz-c").sortable("toArray",{attribute:"data-id"}),r=jQuery("#skin-dz-m").sortable("toArray",{attribute:"data-id"});i.update_sorting(e,"tl"),i.update_sorting(t,"br"),i.update_sorting(n,"c"),i.update_sorting(r,"m")},i.update_sorting=function(e,t){var n=0;for(var i in e)for(var r in o)if(e[i]==o[r].id){o[r].order=n,o[r].container=t,n++;break}},i.initFieldReferences=function(){ESG.C.gridEditorInputs["element-source-event"]=void 0===ESG.C.gridEditorInputs["element-source-event"]?jQuery("#element-source-event"):ESG.C.gridEditorInputs["element-source-event"],ESG.C.gridEditorInputs["element-source-woocommerce"]=void 0===ESG.C.gridEditorInputs["element-source-woocommerce"]?jQuery("#element-source-woocommerce"):ESG.C.gridEditorInputs["element-source-woocommerce"],ESG.C.gridEditorInputs["eg-source-icon-wrap"]=void 0===ESG.C.gridEditorInputs["eg-source-icon-wrap"]?jQuery("#eg-source-icon-wrap"):ESG.C.gridEditorInputs["eg-source-icon-wrap"],ESG.C.gridEditorInputs["eg-source-text-style-disable-wrap"]=void 0===ESG.C.gridEditorInputs["eg-source-text-style-disable-wrap"]?jQuery("#eg-source-text-style-disable-wrap"):ESG.C.gridEditorInputs["eg-source-text-style-disable-wrap"],ESG.C.gridEditorInputs["eg-source-text-wrap"]=void 0===ESG.C.gridEditorInputs["eg-source-text-wrap"]?jQuery("#eg-source-text-wrap"):ESG.C.gridEditorInputs["eg-source-text-wrap"],ESG.C.gridEditorInputs["eg-source-limit-wrap"]=void 0===ESG.C.gridEditorInputs["eg-source-limit-wrap"]?jQuery("#eg-source-limit-wrap"):ESG.C.gridEditorInputs["eg-source-limit-wrap"],ESG.C.gridEditorInputs["eg-source-functonality-wrap"]=void 0===ESG.C.gridEditorInputs["eg-source-functonality-wrap"]?jQuery("#eg-source-functonality-wrap"):ESG.C.gridEditorInputs["eg-source-functonality-wrap"],ESG.C.gridEditorInputs["esg-cat-tag-settings"]=void 0===ESG.C.gridEditorInputs["esg-cat-tag-settings"]?jQuery(".esg-cat-tag-settings"):ESG.C.gridEditorInputs["esg-cat-tag-settings"],ESG.C.gridEditorInputs["eg-source-meta-wrap"]=void 0===ESG.C.gridEditorInputs["eg-source-meta-wrap"]?jQuery("#eg-source-meta-wrap"):ESG.C.gridEditorInputs["eg-source-meta-wrap"],ESG.C.gridEditorInputs["eg-element-post-url-wrap"]=void 0===ESG.C.gridEditorInputs["eg-element-post-url-wrap"]?jQuery("#eg-element-post-url-wrap"):ESG.C.gridEditorInputs["eg-element-post-url-wrap"],ESG.C.gridEditorInputs["eg-element-post-meta-wrap"]=void 0===ESG.C.gridEditorInputs["eg-element-post-meta-wrap"]?jQuery("#eg-element-post-meta-wrap"):ESG.C.gridEditorInputs["eg-element-post-meta-wrap"],ESG.C.gridEditorInputs["eg-element-post-javascript-wrap"]=void 0===ESG.C.gridEditorInputs["eg-element-post-javascript-wrap"]?jQuery("#eg-element-post-javascript-wrap"):ESG.C.gridEditorInputs["eg-element-post-javascript-wrap"],ESG.C.gridEditorInputs["background-size-percent-wrap"]=void 0===ESG.C.gridEditorInputs["background-size-percent-wrap"]?jQuery("#background-size-percent-wrap"):ESG.C.gridEditorInputs["background-size-percent-wrap"],ESG.C.gridEditorInputs["eg-t_b_align"]=void 0===ESG.C.gridEditorInputs["eg-t_b_align"]?jQuery("#eg-t_b_align"):ESG.C.gridEditorInputs["eg-t_b_align"],ESG.C.gridEditorInputs["eg-l_r_align"]=void 0===ESG.C.gridEditorInputs["eg-l_r_align"]?jQuery("#eg-l_r_align"):ESG.C.gridEditorInputs["eg-l_r_align"],ESG.C.gridEditorInputs["eg-element-gplus_link_custom"]=void 0===ESG.C.gridEditorInputs["eg-element-gplus_link_custom"]?jQuery(".eg-element-gplus_link_custom"):ESG.C.gridEditorInputs["eg-element-gplus_link_custom"],ESG.C.gridEditorInputs["eg-element-facebook_link_custom"]=void 0===ESG.C.gridEditorInputs["eg-element-facebook_link_custom"]?jQuery(".eg-element-facebook_link_custom"):ESG.C.gridEditorInputs["eg-element-facebook_link_custom"],ESG.C.gridEditorInputs["eg-element-pinterest_link_custom"]=void 0===ESG.C.gridEditorInputs["eg-element-pinterest_link_custom"]?jQuery(".eg-element-pinterest_link_custom"):ESG.C.gridEditorInputs["eg-element-pinterest_link_custom"],ESG.C.gridEditorInputs["eg-element-twitter_link_custom"]=void 0===ESG.C.gridEditorInputs["eg-element-twitter_link_custom"]?jQuery(".eg-element-twitter_link_custom"):ESG.C.gridEditorInputs["eg-element-twitter_link_custom"],ESG.C.gridEditorInputs["eg-element-link-details-wrap"]=void 0===ESG.C.gridEditorInputs["eg-element-link-details-wrap"]?jQuery("#eg-element-link-details-wrap"):ESG.C.gridEditorInputs["eg-element-link-details-wrap"],ESG.C.gridEditorInputs["eg-element-facebook-wrap"]=void 0===ESG.C.gridEditorInputs["eg-element-facebook-wrap"]?jQuery("#eg-element-facebook-wrap"):ESG.C.gridEditorInputs["eg-element-facebook-wrap"],ESG.C.gridEditorInputs["eg-element-gplus-wrap"]=void 0===ESG.C.gridEditorInputs["eg-element-gplus-wrap"]?jQuery("#eg-element-gplus-wrap"):ESG.C.gridEditorInputs["eg-element-gplus-wrap"],ESG.C.gridEditorInputs["eg-element-pinterest-wrap"]=void 0===ESG.C.gridEditorInputs["eg-element-pinterest-wrap"]?jQuery("#eg-element-pinterest-wrap"):ESG.C.gridEditorInputs["eg-element-pinterest-wrap"],ESG.C.gridEditorInputs["eg-element-twitter-wrap"]=void 0===ESG.C.gridEditorInputs["eg-element-twitter-wrap"]?jQuery("#eg-element-twitter-wrap"):ESG.C.gridEditorInputs["eg-element-twitter-wrap"]},i.set_default_values=function(e){for(var t in l){switch(l[t].type){case"colorpicker":i.updateInput("name","element-"+t,"input",l[t].values.default),ESG.C.gridEditorInputs["element-"+t].esgColorPicker({init:function(e,t,n,i){},onRefresh:function(e,t,n,i){e.val(t)},change:function(e,t,n,i,r){e.val(t)},cancel:function(e,t,n,i,r){e.val(t)}});break;case"select":i.updateInput("name","element-"+t,"select",l[t].values.default),"source"==t?(i.updateInput("name","element-source-post","select","title"),i.updateInput("name","element-source-event","select","event_start_date"),i.updateInput("name","element-source-woocommerce","select","wc_regular_price_from"),i.updateInput("name","element-source-icon","input",""),ESG.C.gridEditorInputs["eg-preview-icon"]=void 0===ESG.C.gridEditorInputs["eg-preview-icon"]?jQuery("#eg-preview-icon"):ESG.C.gridEditorInputs["eg-preview-icon"],ESG.C.gridEditorInputs["eg-preview-icon"].html(""),jQuery('input[name="element-source-text-style-disable"]').prop("checked",!1),i.updateInput("name","element-source-text","textarea",""),i.updateInput("name","element-source-meta","input",""),i.updateInput("name","element-source-taxonomy","select","post_tag"),ESG.C.gridEditorInputs["element-source-event"].hide(),ESG.C.gridEditorInputs["element-source-woocommerce"].hide(),ESG.C.gridEditorInputs["eg-source-icon-wrap"].hide(),ESG.C.gridEditorInputs["eg-source-text-style-disable-wrap"].hide(),ESG.C.gridEditorInputs["eg-source-text-wrap"].hide(),ESG.C.gridEditorInputs["eg-source-limit-wrap"].hide(),ESG.C.gridEditorInputs["esg-cat-tag-settings"].hide(),ESG.C.gridEditorInputs["eg-source-functonality-wrap"].hide(),ESG.C.gridEditorInputs["eg-source-meta-wrap"].hide()):"link-type"==t?(i.updateInput("name","element-url-link","input",""),i.updateInput("name","element-javascript-link","input",""),ESG.C.gridEditorInputs["eg-element-post-url-wrap"].hide(),ESG.C.gridEditorInputs["eg-element-post-meta-wrap"].hide(),ESG.C.gridEditorInputs["eg-element-post-javascript-wrap"].hide()):"background-size"==t?(i.updateInput("name","element-background-size-x","input","100"),i.updateInput("name","element-background-size-y","input","100"),ESG.C.gridEditorInputs["background-size-percent-wrap"].css("display","none")):"align"==t&&(i.updateInput("name","element-absolute-unit","select","px"),ESG.C.gridEditorInputs["eg-t_b_align"].text(ESG_LANG.top),ESG.C.gridEditorInputs["eg-l_r_align"].text(ESG_LANG.left));break;case"checkbox":jQuery('input[name="element-'+t+'"]').prop("checked",l[t].values.default);break;case"multi-text":jQuery('input[name="element-'+t+'[]"]').each((function(){jQuery(this).val(l[t].values.default)}));break;default:i.updateInput("name","element-"+t,"input",l[t].values.default)}i.updateInput("name","element-"+t+"-unit","select","px")}if(void 0!==e&&"object"==typeof o[e]&&"undefined"!==o[e].handle){var n=o[e].settings;for(var t in l)if(void 0!==n[t]){switch(l[t].type){case"colorpicker":if("bg-alpha"==t)continue;i.updateInput("name","element-"+t,"input",n[t]),ESG.C.gridEditorInputs["element-"+t].esgColorPicker({init:function(e,t,n,i){},onRefresh:function(e,t,n,i){e.val(t)},change:function(e,t,n,i,r){e.val(t)},cancel:function(e,t,n,i,r){e.val(t)}});break;case"select":if(i.updateInput("name","element-"+t,"select",n[t]),"source"==t){"post"==n[t]?void 0!==n["source-post"]&&(i.updateInput("name","element-source-post","select",n["source-post"]),"cat_list"!=n["source-post"]&&"tag_list"!=n["source-post"]&&"taxonomy"!=n["source-post"]||(ESG.C.gridEditorInputs["esg-cat-tag-settings"].show(),ESG.C.gridEditorInputs["eg-source-limit-wrap"].hide(),ESG.C.gridEditorInputs["eg-source-functonality-wrap"].show()),"meta"==n["source-post"]&&(jQuery("#eg-source-meta-wrap").show(),void 0!==n["source-meta"]&&i.updateInput("name","element-source-meta","input",n["source-meta"]))):"event"==n[t]?void 0!==n["source-event"]&&i.updateInput("name","element-source-event","select",n["source-event"]):"woocommerce"==n[t]?void 0!==n["source-woocommerce"]&&(i.updateInput("name","element-source-woocommerce","select",n["source-woocommerce"]),"wc_categories"==n["source-woocommerce"]&&(ESG.C.gridEditorInputs["esg-cat-tag-settings"].show(),ESG.C.gridEditorInputs["eg-source-limit-wrap"].hide(),ESG.C.gridEditorInputs["eg-source-functonality-wrap"].show())):"icon"==n[t]?void 0!==n["source-icon"]&&(i.updateInput("name","element-source-icon","input",n["source-icon"]),jQuery("#eg-preview-icon").html('<i class="'+n["source-icon"]+'"></i>')):"text"==n[t]&&void 0!==n["source-text"]&&i.updateInput("name","element-source-text","textarea",n["source-text"])}else if("link-type"==t)void 0!==n["link-type-url"]&&i.updateInput("name","element-url-link","input",n["link-type-url"]),void 0!==n["link-type-meta"]&&i.updateInput("name","element-url-link","input",n["link-type-meta"]),void 0!==n["link-type-javascript"]&&i.updateInput("name","element-javascript-link","input",n["link-type-javascript"]),void 0!==n["link-type-sharefacebook"]&&(i.updateInput("name","element-facebook-sharing-link","select",n["link-type-sharefacebook"]),i.updateInput("name","element-facebook-link-url","input",n["element-facebook-link-url"])),void 0!==n["link-type-sharegplus"]&&(i.updateInput("name","element-gplus-sharing-link","select",n["link-type-sharegplus"]),i.updateInput("name","element-gplus-link-url","input",n["element-gplus-link-url"])),void 0!==n["link-type-sharepinterest"]&&(i.updateInput("name","element-pinterest-sharing-link","select",n["link-type-sharepinterest"]),i.updateInput("name","element-pinterest-link-url","input",n["element-pinterest-link-url"]),i.updateInput("name","element-pinterest-description","textarea",n["link-type-sharepinterest-description"])),void 0!==n["link-type-sharetwitter"]&&(i.updateInput("name","element-twitter-sharing-link","select",n["link-type-sharetwitter"]),i.updateInput("name","element-twitter-link-url","input",n["element-twitter-link-url"]),i.updateInput("name","element-twitter-text-before","input",n["link-type-sharetwitter-text-before"]),i.updateInput("name","element-twitter-text-after","input",n["link-type-sharetwitter-text-after"]));else if("text-align"==t||"float"==t)"block"==jQuery('input[name="element-display"]').val()?"float"==t&&i.updateInput("name","element-"+t,"select","none"):"text-align"==t&&i.updateInput("name","element-"+t,"select","center");else if("background-size"==t)void 0!==n["background-size-x"]&&i.updateInput("name","element-background-size-x","input",n["background-size-x"]),void 0!==n["background-size-y"]&&i.updateInput("name","element-background-size-y","input",n["background-size-y"]),"%"==n["background-size"]&&jQuery("#background-size-percent-wrap").css("display","inline-block");else if("align"==t&&(void 0!==n["absolute-unit"]&&i.updateInput("name","element-absolute-unit","select",n["absolute-unit"]),void 0!==n.align))switch(n.align){case"t_l":ESG.C.gridEditorInputs["eg-t_b_align"].text(ESG_LANG.top),ESG.C.gridEditorInputs["eg-l_r_align"].text(ESG_LANG.left);break;case"t_r":ESG.C.gridEditorInputs["eg-t_b_align"].text(ESG_LANG.top),ESG.C.gridEditorInputs["eg-l_r_align"].text(ESG_LANG.right);break;case"b_l":ESG.C.gridEditorInputs["eg-t_b_align"].text(ESG_LANG.bottom),ESG.C.gridEditorInputs["eg-l_r_align"].text(ESG_LANG.left);break;case"b_r":ESG.C.gridEditorInputs["eg-t_b_align"].text(ESG_LANG.bottom),ESG.C.gridEditorInputs["eg-l_r_align"].text(ESG_LANG.right)}break;case"checkbox":n[t]==i.updateInput("name","element-"+t,"input")?ESG.C.gridEditorInputs["element-"+t].prop("checked",!0):ESG.C.gridEditorInputs["element-"+t].prop("checked",!1);break;case"multi-text":var r=0;jQuery('input[name="element-'+t+'[]"]').each((function(){jQuery(this).val(n[t][r]),r++}));break;default:i.updateInput("name","element-"+t,"input",n[t])}i.updateInput("name","element-"+t+"-unit","select",n[t+"-unit"])}}!0!==ESG.S.socSharingGridEditor&&(jQuery('select[name="element-facebook-sharing-link"]').on("change",(function(){"custom"==jQuery('select[name="element-facebook-sharing-link"]').val()?ESG.C.gridEditorInputs["eg-element-facebook_link_custom"].show():ESG.C.gridEditorInputs["eg-element-facebook_link_custom"].hide()})),jQuery('select[name="element-gplus-sharing-link"]').on("change",(function(){"custom"==jQuery('select[name="element-gplus-sharing-link"]').val()?ESG.C.gridEditorInputs["eg-element-gplus_link_custom"].show():ESG.C.gridEditorInputs["eg-element-gplus_link_custom"].hide()})),jQuery('select[name="element-pinterest-sharing-link"]').on("change",(function(){"custom"==jQuery('select[name="element-pinterest-sharing-link"]').val()?ESG.C.gridEditorInputs["eg-element-pinterest_link_custom"].show():ESG.C.gridEditorInputs["eg-element-pinterest_link_custom"].hide()})),jQuery('select[name="element-twitter-sharing-link"]').on("change",(function(){"custom"==jQuery('select[name="element-twitter-sharing-link"]').val()?ESG.C.gridEditorInputs["eg-element-twitter_link_custom"].show():ESG.C.gridEditorInputs["eg-element-twitter_link_custom"].hide()})))},i.reset_style_by_position=function(){var e=i.updateInput("name","element-position","select");if(ESG.C.gridEditorInputs["eg-show-on-absolute"]=void 0===ESG.C.gridEditorInputs["eg-show-on-absolute"]?jQuery("#eg-show-on-absolute"):ESG.C.gridEditorInputs["eg-show-on-absolute"],ESG.C.gridEditorInputs["eg-show-on-relative"]=void 0===ESG.C.gridEditorInputs["eg-show-on-relative"]?jQuery("#eg-show-on-relative"):ESG.C.gridEditorInputs["eg-show-on-relative"],"absolute"==e)ESG.C.gridEditorInputs["eg-show-on-absolute"].css("display","block"),ESG.C.gridEditorInputs["eg-show-on-relative"].css("display","none"),r.hasClass("ui-draggable")||(jQuery(r).appendTo("#skin-dz-wrapper"),i.set_absolute_positioning());else{var t=r.data("id");for(var n in o)if(o[n].id==t){r.hasClass("ui-draggable")&&(r.appendTo("#skin-dz-"+o[n].container),r.removeClass("ui-draggable"),r.css("top","auto"),r.css("right","auto"),r.css("bottom","auto"),r.css("left","auto"),r.draggable("destroy"),i.update_layer_sorting());break}ESG.C.gridEditorInputs["eg-show-on-absolute"].css("display","none"),ESG.C.gridEditorInputs["eg-show-on-relative"].css("display","block")}},i.get_setting_values=function(){if(null==r)return!1;var e=r.data("id");for(var t in i.reset_style_by_position(),o)if(o[t].id==e){for(var n in l){var a=o[t].settings[n];if("checkbox"==l[n].type)o[t].settings[n]=jQuery('input[name="element-'+n+'"]').is(":checked")?jQuery('input[name="element-'+n+'"]').val():"";else if("select"==l[n].type)if(o[t].settings[n]=i.updateInput("name","element-"+n,"select"),"source"==n)switch(delete o[t].settings["source-event"],delete o[t].settings["source-woocommerce"],delete o[t].settings["source-icon"],delete o[t].settings["source-text"],delete o[t].settings["source-post"],delete o[t].settings["source-meta"],o[t].settings[n]){case"event":o[t].settings["source-event"]=i.updateInput("name","element-source-event","select");break;case"woocommerce":o[t].settings["source-woocommerce"]=i.updateInput("name","element-source-woocommerce","select");break;case"icon":o[t].settings["source-icon"]=i.updateInput("name","element-source-icon","input");break;case"text":o[t].settings["source-text"]=i.updateInput("name","element-source-text","textarea");break;default:o[t].settings["source-taxonomy"]=i.updateInput("name","element-source-taxonomy","select"),o[t].settings["source-post"]=i.updateInput("name","element-source-post","select"),"meta"==o[t].settings["source-post"]&&(o[t].settings["source-meta"]=i.updateInput("name","element-source-meta","input"))}else if("link-type"==n)switch(delete o[t].settings["link-type-url"],delete o[t].settings["link-type-meta"],delete o[t].settings["link-type-javascript"],delete o[t].settings["link-type-sharefacebook"],delete o[t].settings["link-type-sharegplus"],delete o[t].settings["link-type-sharepinterest"],delete o[t].settings["link-type-sharetwitter"],o[t].settings[n]){case"post":case"lightbox":case"embedded_media":break;case"url":o[t].settings["link-type-url"]=i.updateInput("name","element-url-link","input");break;case"meta":o[t].settings["link-type-meta"]=i.updateInput("name","element-meta-link","input");break;case"javascript":o[t].settings["link-type-javascript"]=i.updateInput("name","element-javascript-link","input");break;case"sharefacebook":o[t].settings["link-type-sharefacebook"]=i.updateInput("name","element-facebook-sharing-link","select"),o[t].settings["link-type-sharefacebook-custom-url"]=i.updateInput("name","element-facebook-link-url","input");break;case"sharegplus":o[t].settings["link-type-sharegplus"]=i.updateInput("name","element-gplus-sharing-link","select"),o[t].settings["link-type-sharegplus-custom-url"]=i.updateInput("name","element-gplus-link-url","input");break;case"sharepinterest":o[t].settings["link-type-sharepinterest"]=i.updateInput("name","element-pinterest-sharing-link","select"),o[t].settings["link-type-sharepinterest-custom-url"]=i.updateInput("name","element-pinterest-link-url","input"),o[t].settings["link-type-sharepinterest-description"]=i.updateInput("name","element-pinterest-description","input");break;case"sharetwitter":o[t].settings["link-type-sharetwitter"]=i.updateInput("name","element-twitter-sharing-link","select"),o[t].settings["link-type-sharetwitter-custom-url"]=i.updateInput("name","element-twitter-link-url","input"),o[t].settings["link-type-sharetwitter-text-before"]=i.updateInput("name","element-twitter-text-before","input"),o[t].settings["link-type-sharetwitter-text-after"]=i.updateInput("name","element-twitter-text-after","input")}else"background-size"==n?(delete o[t].settings["background-size-x"],delete o[t].settings["background-size-y"],"%"==o[t].settings[n]&&(o[t].settings["background-size-x"]=i.updateInput("name","element-background-size-x","input"),o[t].settings["background-size-y"]=i.updateInput("name","element-background-size-y","input"))):"align"==n&&(o[t].settings["absolute-unit"]=i.updateInput("name","element-absolute-unit","select"));else if("multi-text"==l[n].type){var s={},d=0;jQuery('input[name="element-'+n+'[]"]').each((function(){s[d]=jQuery(this).val(),d++})),o[t].settings[n]=s}else o[t].settings[n]=i.updateInput("name","element-"+n,"input");if(o[t].settings[n+"-unit"]=i.updateInput("name","element-"+n+"-unit","select"),a!==o[t].settings[n]&&void 0!==a)if("multi-text"==l[n].type){var c="",p="",g=!0,m=!0;for(var h in o[t].settings[n])g||(c+=","),c+=o[t].settings[n][h],g=!1;for(var h in a)m||(p+=","),p+=a[h],m=!1;p!=c&&(u=!0)}else u=!0;"transition"==n&&i.check_no_transition(o[t].settings[n])}break}},i.set_setting_values=function(){if(null==r)return!1;var e=r.data("id");for(var t in o)if(o[t].id==e){for(var n in l)if(void 0!==o[t].settings&&void 0!==o[t].settings[n]){if("checkbox"==l[n].type)o[t].settings[n]==jQuery('input[name="element-'+n+'"]').val()||"true"==o[t].settings[n]&&"on"==jQuery('input[name="element-'+n+'"]').val()?jQuery('input[name="element-'+n+'"]').prop("checked",!0):jQuery('input[name="element-'+n+'"]').prop("checked",!1);else if("colorpicker"==l[n].type)i.updateInput("name","element-"+n,"input",o[t].settings[n]),ESG.C.gridEditorInputs["element-"+n].esgColorPicker({init:function(e,t,n,i){},onRefresh:function(e,t,n,i){e.val(t)},change:function(e,t,n,i,r){e.val(t)},cancel:function(e,t,n,i,r){e.val(t)}});else if("slider"==l[n].type||"text-slider"==l[n].type)jQuery('input[name="element-'+n+'"]').val(o[t].settings[n]),jQuery("#element-"+n).slider({value:jQuery('input[name="element-'+n+'"]').val()}),jQuery("body").trigger("esgslide",jQuery("#element-"+n));else if("select"==l[n].type)if(i.updateInput("name","element-"+n,"select",o[t].settings[n]),"source"==n)switch(jQuery(".elements-select-wrap").hide(),o[t].settings[n]){case"event":ESG.C.gridEditorInputs["eg-source-limit-wrap"].show(),ESG.C.gridEditorInputs["element-source-event"].show(),i.updateInput("name","element-source-event","select",o[t].settings["source-event"]);break;case"woocommerce":ESG.C.gridEditorInputs["eg-source-limit-wrap"].show(),ESG.C.gridEditorInputs["element-source-woocommerce"].show(),i.updateInput("name","element-source-woocommerce","select",o[t].settings["source-woocommerce"]);break;case"icon":ESG.C.gridEditorInputs["eg-source-icon-wrap"].show(),i.updateInput("name","element-source-icon","input",o[t].settings["source-icon"]),jQuery("#eg-preview-icon").html('<i class="'+o[t].settings["source-icon"]+'"></i>');break;case"text":void 0!==typeof o[t].settings.special&&"true"==o[t].settings.special&&void 0!==typeof o[t].settings["special-type"]&&"blank-element"==o[t].settings["special-type"]?jQuery("#eg-source-text-style-disable-wrap").hide():jQuery("#eg-source-text-style-disable-wrap").show(),jQuery("#eg-source-text-wrap").show(),i.updateInput("name","element-source-text","textarea",o[t].settings["source-text"]);break;default:ESG.C.gridEditorInputs["eg-source-limit-wrap"].show(),jQuery('select[name="element-source-post"]').show(),"source-taxonomy"in o[t].settings&&i.updateInput("name","element-source-taxonomy","select",o[t].settings["source-taxonomy"]),jQuery('select[name="element-source-post"] option[value="'+o[t].settings["source-post"]+'"]').prop("selected","selected"),"meta"==o[t].settings["source-post"]&&i.updateInput("name","element-source-meta","input",o[t].settings["source-meta"])}else if("link-type"==n)switch(ESG.C.gridEditorInputs["eg-element-post-url-wrap"].hide(),ESG.C.gridEditorInputs["eg-element-post-meta-wrap"].hide(),ESG.C.gridEditorInputs["eg-element-post-javascript-wrap"].hide(),ESG.C.gridEditorInputs["eg-element-link-details-wrap"].show(),ESG.C.gridEditorInputs["eg-element-facebook-wrap"].hide(),ESG.C.gridEditorInputs["eg-element-gplus-wrap"].hide(),ESG.C.gridEditorInputs["eg-element-pinterest-wrap"].hide(),ESG.C.gridEditorInputs["eg-element-twitter-wrap"].hide(),o[t].settings[n]){case"post":case"lightbox":case"embedded_media":break;case"url":ESG.C.gridEditorInputs["eg-element-post-url-wrap"].show(),i.updateInput("name","element-url-link","input",o[t].settings["link-type-url"]);break;case"meta":ESG.C.gridEditorInputs["eg-element-post-meta-wrap"].show(),i.updateInput("name","element-meta-link","input",o[t].settings["link-type-meta"]);break;case"javascript":ESG.C.gridEditorInputs["eg-element-post-javascript-wrap"].show(),i.updateInput("name","element-javascript-link","input",o[t].settings["link-type-javascript"]);break;case"sharefacebook":ESG.C.gridEditorInputs["eg-element-link-details-wrap"].hide(),ESG.C.gridEditorInputs["eg-element-facebook-wrap"].show(),i.updateInput("name","element-facebook-sharing-link","select",o[t].settings["link-type-sharefacebook"]),i.updateInput("name","element-facebook-link-link","input",o[t].settings["link-type-sharefacebook-custom-url"]),"custom"==i.updateInput("name","element-facebook-sharing-link","select")?ESG.C.gridEditorInputs["eg-element-facebook_link_custom"].show():ESG.C.gridEditorInputs["eg-element-facebook_link_custom"].hide();break;case"sharegplus":ESG.C.gridEditorInputs["eg-element-link-details-wrap"].hide(),ESG.C.gridEditorInputs["eg-element-gplus-wrap"].show(),i.updateInput("name","element-gplus-sharing-link","select",o[t].settings["link-type-sharegplus"]),i.updateInput("name","element-gplus-link-url","input",o[t].settings["link-type-sharegplus-custom-url"]),"custom"==i.updateInput("name","element-gplus-sharing-link","select")?ESG.C.gridEditorInputs["eg-element-gplus_link_custom"].show():ESG.C.gridEditorInputs["eg-element-gplus_link_custom"].hide();break;case"sharepinterest":ESG.C.gridEditorInputs["eg-element-link-details-wrap"].hide(),ESG.C.gridEditorInputs["eg-element-pinterest-wrap"].show(),i.updateInput("name","element-pinterest-sharing-link","select",o[t].settings["link-type-sharepinterest"]),i.updateInput("name","element-pinterest-link-url","input",o[t].settings["link-type-sharepinterest-custom-url"]),i.updateInput("name","element-pinterest-description","textarea",o[t].settings["link-type-sharepinterest-description"]),"custom"==i.updateInput("name","element-pinterest-sharing-link","select")?ESG.C.gridEditorInputs["eg-element-pinterest_link_custom"].show():ESG.C.gridEditorInputs["eg-element-pinterest_link_custom"].hide();break;case"sharetwitter":ESG.C.gridEditorInputs["eg-element-link-details-wrap"].hide(),ESG.C.gridEditorInputs["eg-element-twitter-wrap"].show(),i.updateInput("name","element-twitter-sharing-link","select",o[t].settings["link-type-sharetwitter"]),i.updateInput("name","element-twitter-link-url","input",o[t].settings["link-type-sharetwitter-custom-url"]),i.updateInput("name","element-twitter-text-before","input",o[t].settings["link-type-sharetwitter-text-before"]),i.updateInput("name","element-twitter-text-after","input",o[t].settings["link-type-sharetwitter-text-after"]),"custom"==i.updateInput("name","element-twitter-sharing-link","select")?ESG.C.gridEditorInputs["eg-element-twitter_link_custom"].show():ESG.C.gridEditorInputs["eg-element-twitter_link_custom"].hide()}else if("display"==n)switch(jQuery("#element-text-align-wrap").hide(),jQuery("#element-float-wrap").hide(),o[t].settings[n]){case"block":jQuery("#element-text-align-wrap").show();break;case"inline-block":jQuery("#element-float-wrap").show()}else"background-size"==n?"%"==o[t][n]&&(jQuery("#background-size-percent-wrap").css("display","inline-block"),i.updateInput("name","element-background-size-x","input",o[t].settings["background-size-x"]),i.updateInput("name","element-background-size-y","input",o[t].settings["background-size-y"])):"align"==n&&i.updateInput("name","element-absolute-unit","select",o[t].settings["absolute-unit"]);else if("multi-text"==l[n].type){var a=0;jQuery('input[name="element-'+n+'[]"]').each((function(){jQuery(this).val(o[t].settings[n][a]),a++}))}else i.updateInput("name","element-"+n,"input",o[t].settings[n]);i.updateInput("name","element-"+n+"-unit","input",o[t].settings[n+"-unit"])}break}jQuery('#eg-element-hide [name="element-always-visible-desktop"]').trigger("change")},i.set_setting_styles=function(){if(null==r)return!1;var e=r.data("id");for(var t in o)if(o[t].id==e){i.set_inline_styles(r,o[t].settings);break}},i.set_inline_styles=function(e,t,n){var i=jQuery("#eg-inline-style-wrapper");if("eg-line-break"==e.data("handle")||"eg-blank-element"==e.data("handle"))return!0;var r=[],a=[];if("text"==t.source&&void 0!==t["source-text-style-disable"]&&"on"==t["source-text-style-disable"]);else{var s="",o=!1;for(var u in"true"==t["force-important"]&&(s=" !important"),"on"==t["enable-hover"]&&(o=!0),l){if(void 0!==n){if("margin"==u)continue;if("position"==u)continue}var d=l[u].style;if("hover"==d)switch(u){case"display":case"text-align":case"float":case"clear":case"margin":case"padding":break;default:if(l[u].style!=d)continue}if(("idle"==l[u].style||"hover"==l[u].style)&&((o||"hover"!=l[u].style)&&void 0!==t[u])){var c="idle"==d?u:u.replace("-hover","");if("multi-text"==l[u].type){void 0===t[u+"-unit"]&&(t[u+"-unit"]="px");var p=t[u+"-unit"];if("border-radius"==c)"idle"==d?(r.push("border-top-left-radius: "+t[u][0]+p+s+";"),r.push("border-top-right-radius: "+t[u][1]+p+s+";"),r.push("border-bottom-right-radius: "+t[u][2]+p+s+";"),r.push("border-bottom-left-radius: "+t[u][3]+p+s+";")):(a.push("border-top-left-radius: "+t[u][0]+p+s+";"),a.push("border-top-right-radius: "+t[u][1]+p+s+";"),a.push("border-bottom-right-radius: "+t[u][2]+p+s+";"),a.push("border-bottom-left-radius: "+t[u][3]+p+s+";"));else if("border"==c)"idle"==d?(r.push("border-top: "+t[u][0]+p+s+";"),r.push("border-right: "+t[u][1]+p+s+";"),r.push("border-bottom: "+t[u][2]+p+s+";"),r.push("border-left: "+t[u][3]+p+s+";")):(a.push("border-top: "+t[u][0]+p+s+";"),a.push("border-right: "+t[u][1]+p+s+";"),a.push("border-bottom: "+t[u][2]+p+s+";"),a.push("border-left: "+t[u][3]+p+s+";"));else if("box-shadow"==c||"background-color"==c){var g="";for(var m in t[u])g+=t[u][m]+p+" ";g+=" "+("idle"==d?t["shadow-color"]:t["shadow-color-hover"]),"idle"==d?(r.push("-moz-"+c+": "+g+s+";"),r.push("-webkit-"+c+": "+g+s+";"),r.push(c+": "+g+s+";")):(a.push("-moz-"+c+": "+g+s+";"),a.push("-webkit-"+c+": "+g+s+";"),a.push(c+": "+g+s+";"))}else{g="";for(var m in t[u])g+=t[u][m]+p+" ";"idle"==d?r.push(c+": "+g+s+";"):a.push(c+": "+g+s+";")}}else if("background-color"==c){var h=t[u];h=ESGColor.get(h),"idle"==d?r.push("background: "+h+s+";"):a.push("background: "+h+s+";")}else{if("border"==c&&("idle"==d?r.push("border-style: solid"+s+";"):a.push("border-style: solid"+s+";")),"font-style"==c&&"true"==t[u]&&(t[u]="italic"+s+";"),null==(p=l[u].unit)&&(p=""),""==t[u])continue;if("idle"==d){if("display"==c?r.push(c+": "+t[u]+p+" !important;"):r.push(c+": "+t[u]+p+s+";"),"position"==c&&"absolute"==t[u]){r.push("height: auto"+s+";"),r.push("width: auto"+s+";"),r.push("white-space: nowrap"+s+";");var y="NaN"==t["left-right"]?0:t["left-right"],v="NaN"==t["top-bottom"]?0:t["top-bottom"];switch(t.align){case"t_l":r.push("top: "+v+t["absolute-unit"]+";"),r.push("left: "+y+t["absolute-unit"]+";"),r.push("bottom:auto;"),r.push("right:auto;");break;case"t_r":r.push("top: "+v+t["absolute-unit"]+";"),r.push("right: "+y+t["absolute-unit"]+";"),r.push("bottom:auto;"),r.push("left:auto;");break;case"b_l":r.push("bottom: "+v+t["absolute-unit"]+";"),r.push("left: "+y+t["absolute-unit"]+";"),r.push("top:auto;"),r.push("right:auto;");break;case"b_r":r.push("bottom: "+v+t["absolute-unit"]+";"),r.push("right: "+y+t["absolute-unit"]+";"),r.push("top:auto;"),r.push("left:auto;")}}}else a.push(c+": "+t[u]+p+s+";")}}}}var f='<style type="text/css" id="eg-element-style-'+e.data("handle")+'">\n';if(r.length>0){for(var j in f+='.skin-dz-elements[data-handle="'+e.data("handle")+'"] {\n',r)f+=r[j]+"\n";f+="}\n"}if(a.length>0){for(var _ in f+='.skin-dz-elements[data-handle="'+e.data("handle")+'"]:hover {\n',a)f+=a[_]+"\n";f+="}\n"}f+="</style>\n",jQuery("#eg-element-style-"+e.data("handle")).length>0&&jQuery("#eg-element-style-"+e.data("handle")).remove(),i.append(f)},i.set_global_inline_styles=function(){var e,n=jQuery("#eg-inline-style-wrapper");jQuery("#eg-global-inline-styles").length>0&&jQuery("#eg-global-inline-styles").remove(),e='<style type="text/css" id="eg-global-inline-styles">\n',e+=t.getValue(),e+="</style>\n",u=!0,n.append(e)},i.set_setting_attributes=function(){if(null==r)return!1;var e=r.data("id");for(var t in o)if(o[t].id==e)for(var n in l)if("attribute"===l[n].style)if("delay"==n){var i=o[t].settings[n];i>0&&(i/=100),r.data("delay",i)}else if("duration"==n){var a=o[t].settings[n];r.data("duration",a)}else if("transition"==n){var s=r.attr("class").split(" ");for(var u in s)-1!==s[u].indexOf("esg-")&&r.removeClass(s[u]);void 0===o[t].settings["transition-type"]&&(o[t].settings["transition-type"]=""),r.addClass("esg-"+o[t].settings[n]+o[t].settings["transition-type"])}},i.set_setting_caption=function(){if(null==r)return!1;var e=r.data("id"),t="";for(var n in o)if(o[n].id==e){if(void 0!==typeof o[n].settings.special&&"true"==o[n].settings.special&&void 0!==typeof o[n].settings["special-type"]&&"blank-element"==o[n].settings["special-type"])return r.html("&nbsp;"),!0;switch(o[n].settings.source){case"icon":if(void 0!==o[n].settings["source-icon"])t='<i class="'+o[n].settings["source-icon"]+'"></i>';break;case"text":if(void 0!==o[n].settings["source-text"])t=o[n].settings["source-text"];break;case"event":if(void 0!==o[n].settings["source-event"])t=o[n].settings["source-event"];break;case"woocommerce":if(void 0!==o[n].settings["source-woocommerce"])t=o[n].settings["source-woocommerce"];break;default:if(void 0!==o[n].settings["source-post"])t=o[n].settings["source-post"]}if("post"==o[n].settings.source||"event"==o[n].settings.source||"woocommerce"==o[n].settings.source)switch(""==t&&(t="title",o[n].settings.source="post"),t){case"wc_full_price":t=ESG_LANG.full_price;break;case"wc_price":t=ESG_LANG.regular_price;break;case"wc_price_no_cur":t=ESG_LANG.regular_price_no_cur;break;default:t=jQuery('select[name="element-source-'+o[n].settings.source+'"] option[value="'+t+'"]').text()}r.html(t);break}},i.propagate_layer_styles=function(e,t){if(void 0===s[e])return!1;for(var n in s[e].settings)o[t].settings[n]=s[e].settings[n]},i.propagate_element_selector=function(){for(var e in jQuery("#element-settings-current-name").html(""),o){var t="";switch(o[e].settings.source){case"icon":t=o[e].settings["source-icon"];break;case"post":t=jQuery('select[name="element-source-post"] option[value="'+o[e].settings["source-post"]+'"]').text();break;case"event":t=jQuery('select[name="element-source-event"] option[value="'+o[e].settings["source-event"]+'"]').text();break;case"woocommerce":t=jQuery('select[name="element-source-woocommerce"] option[value="'+o[e].settings["source-woocommerce"]+'"]').text();break;case"text":t=o[e].settings["source-text"].replace(/(<([^>]+)>)/gi,"")}jQuery("#element-settings-current-name").append(jQuery("<option>",{value:o[e].id,text:t}))}if(jQuery("#element-settings-current-name option").each((function(){jQuery(this).prop("selected",!1)})),null!==r){jQuery('#element-settings-current-name option[value="'+r.data("id")+'"]').prop("selected","selected"),jQuery("#element-settings-current-name").parent().show();var n="text"==jQuery('select[name="element-source"] option:selected').val()&&"checked"==jQuery('input[name="element-source-text-style-disable"]').prop("checked")?"-nostyle":"";jQuery(".eg-element-class-setter").text(ESG_LANG.class_name+" .eg-"+jQuery("#eg-item-skin-slug").text()+n+"-element-"+r.data("id"))}else jQuery(".eg-element-class-setter").text("");var i=!0;for(var a in o)if(null!=o[a]){i=!1;break}i&&jQuery("#element-settings-current-name").parent().hide()},i.propagate_default_element_styles=function(){for(var e in s)if(void 0!==s[e].settings){var t=jQuery('.skin-dz-elements[data-handle="'+e+'"]');jQuery.isEmptyObject(t)||t.each((function(){i.set_inline_styles(jQuery(this),s[e].settings,!0)}))}i.init_elements_grid(),jQuery("body").on("essentialready",(function(e,t){"eg-elements-container-grid"===t&&i.set_default_elements_draggable()}))},i.select_layer=function(e){jQuery("#eg-dz-hover-wrap .skin-dz-elements").removeClass("selected"),jQuery(".skin-dz-elements").each((function(t){var n=jQuery(this);if(null!=n&&null!=n.data("id")&&n.data("id").toString()===e.toString())return 0!==(r=n)[0].style.width&&"0px"!==r[0].style.width||(r[0].style.width="auto"),0!==r[0].style.height&&"0px"!==r[0].style.height||(r[0].style.height="auto"),"relative"===r[0].style.position&&(0!==r[0].style.top&&"0px"!==r[0].style.top||(r[0].style.top="auto"),0!==r[0].style.left&&"0px"!==r[0].style.left||(r[0].style.left="auto")),!0}));var t=document.getElementById("always-visible-options");if(t){var n=r.closest("#skin-dz-m-wrap").length?"none":"block";t.style.display=n}r.addClass("selected"),i.set_default_values(e),i.set_setting_values(),i.show_toolbar(),i.select_element_editor_name(),jQuery('select[name="element-source"]').trigger("change")},i.delete_layer=function(e){jQuery("#eg-dz-hover-wrap .skin-dz-elements").removeClass("selected"),"object"!=typeof e&&(e=jQuery('.skin-dz-elements[data-id="'+e+'"]'));var t=e.data("id");for(var n in e.remove(),o)if(o[n].id==t){delete o[n];break}r=null;if(o.length>0)for(var n in o)if(null!=typeof o[n].id){i.select_layer(o[n].id);break}null==r&&i.show_empty_toolbar(),i.change_bg_color(),i.propagate_element_selector(),i.redraw_container_height(),AdminEssentials.adjustDropHeights()},i.show_toolbar=function(){if(null==r)return!1;var e=!1;for(var t in jQuery("#settings-dz-elements-wrapper").show(),jQuery(".eg-hide-on-special").show(),jQuery("#element-save-as-button").show(),o)if(o[t].handle==r.data("handle")){if(void 0!==typeof o[t].settings.special&&"true"==o[t].settings.special){if(void 0!==typeof o[t].settings["special-type"])if("blank-element"===o[t].settings["special-type"])jQuery(".eg-hide-on-blank-element").hide(),jQuery("#element-save-as-button").hide(),jQuery(".eg-source-li>a").trigger("click");else jQuery("#settings-dz-elements-wrapper").hide(),jQuery("#element-save-as-button").hide()}else jQuery("#settings-dz-elements-wrapper").show(),jQuery(".eg-hide-on-special").show(),jQuery("#element-save-as-button").show();i.hide_empty_toolbar(),e=!0;break}e||i.show_empty_toolbar()},i.show_empty_toolbar=function(){jQuery("#element-setting-wrap-alternative").css("display","block"),jQuery("#element-setting-wrap-top").css("display","none")},i.hide_empty_toolbar=function(){jQuery("#element-setting-wrap-alternative").css("display","none"),jQuery("#element-setting-wrap-top").css("display","block")},i.select_element_editor_name=function(){if(null==r)return!1;var e=r.data("id");jQuery("#element-settings-current-name option").each((function(){jQuery(this).prop("selected",!1)})),jQuery('#element-settings-current-name option[value="'+e+'"]').prop("selected","selected")},i.get_latest_id=function(){var e=-1;for(var t in o)parseInt(o[t].id)>e&&(e=parseInt(o[t].id));return parseInt(jQuery('input[name="eg-item-skin-element-last-id"]').val())>parseInt(e)&&(e=jQuery('input[name="eg-item-skin-element-last-id"]').val()),parseInt(e)},i.output_setting_data=function(){var e=[];for(var t in o)""!=o[t]&&(null==o[t].order&&(o[t].order="0"),e[t]={},e[t].id=o[t].id,e[t].order=o[t].order,e[t].container=o[t].container,e[t].settings=o[t].settings);return e},i.create_elements_by_data=function(e){var t=0,n=[];if(void 0===e&&(e=a),null==e)return!1;for(var l in e)"string"!=typeof e[l]&&null!==e[l]&&(null==e[l].order&&(e[l].order="0"),null==e[l].container&&(e[l].container="c"),n[l]=jQuery.extend({},e[l]));for(var l in jQuery.isEmptyObject(n)||n.sort(i.sortByOrder),n){var u=!1;for(var d in s)if(d==n[l].handle){u=d;break}if(!1!==u)var c=n[l].handle,p=s[u].name;else{c=ESG_LANG.new_element_sanitize+"-"+t,p=ESG_LANG.new_element+" "+t;for(var g in a)"string"!=typeof a[g]&&null!==a[g]&&a[g].id==n[l].id&&a[g].handle==n[l].handle&&(a[g].handle=c);n[l].handle=c,t++}var m=n[l].id,h="";if(void 0!==typeof n[l].settings.special&&"true"==n[l].settings.special)if(void 0!==typeof n[l].settings["special-type"])if("blank-element"===n[l].settings["special-type"])h=" eg-special-blank-element";else h=" eg-special-element";else h=" eg-special-element";var y='<div class="skin-dz-elements'+h+'" data-id="'+m+'" data-handle="'+c+'">'+p+"</div>";jQuery("#skin-dz-"+n[l].container).append(y)}for(var v in o=n)r=jQuery('.skin-dz-elements[data-id="'+o[v].id+'"]'),i.set_setting_styles(),i.set_setting_caption(),i.set_setting_attributes(),void 0!==o[v].settings.position&&"absolute"==o[v].settings.position&&(jQuery(r).appendTo("#skin-dz-wrapper"),i.set_absolute_positioning());i.propagate_element_selector(),r=null,i.change_bg_color(),i.selet_first_layer(),i.redraw_container_height()},i.selet_first_layer=function(){var e=!1;for(var t in o)if(null!=o[t]){i.select_layer(o[t].id),e=!0;break}e||i.show_empty_toolbar()},i.add_animation_classes=function(){var e=jQuery("#skin-dz-c-wrap .eg-element-cover"),t=jQuery("#skin-dz-tl-wrap .eg-element-cover"),n=jQuery("#skin-dz-br-wrap .eg-element-cover");e.removeClass().addClass("eg-element-cover"),t.removeClass().addClass("eg-element-cover"),n.removeClass().addClass("eg-element-cover"),e.removeAttr("data-delay"),t.removeAttr("data-delay"),n.removeAttr("data-delay"),e.data("delay",null),t.data("delay",null),n.data("delay",null),e.removeAttr("data-duration"),t.removeAttr("data-duration"),n.removeAttr("data-duration"),e.data("duration",null),t.data("duration",null),n.data("duration",null),jQuery("#skin-dz-wrapper").removeClass().addClass("esg-"+jQuery('select[name="cover-group-animation"] option:selected').val()),jQuery("#skin-dz-media-bg").removeClass().addClass("esg-"+jQuery('select[name="media-animation"] option:selected').val()),jQuery("#skin-dz-wrapper").attr("data-delay",parseInt(jQuery('input[name="cover-group-animation-delay"]').val())/100),jQuery("#skin-dz-wrapper").attr("data-duration",jQuery('input[name="cover-group-animation-duration"]').val()),jQuery("#skin-dz-media-bg").attr("data-delay",parseInt(jQuery('input[name="media-animation-delay"]').val())/100),jQuery("#skin-dz-media-bg").attr("data-duration",jQuery('input[name="media-animation-duration"]').val()),jQuery("#skin-dz-wrapper").data("delay",parseInt(jQuery('input[name="cover-group-animation-delay"]').val())/100),jQuery("#skin-dz-media-bg").data("delay",parseInt(jQuery('input[name="media-animation-delay"]').val())/100),jQuery("#skin-dz-wrapper").data("duration",jQuery('input[name="cover-group-animation-duration"]').val()),jQuery("#skin-dz-media-bg").data("duration",jQuery('input[name="media-animation-duration"]').val()),"full"==jQuery('select[name="cover-type"] option:selected').val()?(e.addClass("esg-"+jQuery('select[name="cover-animation-center"] option:selected').val()+jQuery('select[name="cover-animation-center-type"] option:selected').val()),e.attr("data-delay",parseInt(jQuery('input[name="cover-animation-delay-center"]').val())/100),e.data("delay",parseInt(jQuery('input[name="cover-animation-delay-center"]').val())/100),e.attr("data-duration",jQuery('input[name="cover-animation-duration-center"]').val()),e.data("duration",jQuery('input[name="cover-animation-duration-center"]').val())):(t.addClass("esg-"+jQuery('select[name="cover-animation-top"] option:selected').val()+jQuery('select[name="cover-animation-top-type"] option:selected').val()),e.addClass("esg-"+jQuery('select[name="cover-animation-center"] option:selected').val()+jQuery('select[name="cover-animation-center-type"] option:selected').val()),n.addClass("esg-"+jQuery('select[name="cover-animation-bottom"] option:selected').val()+jQuery('select[name="cover-animation-bottom-type"] option:selected').val()),t.attr("data-delay",parseInt(jQuery('input[name="cover-animation-delay-top"]').val())/100),e.attr("data-delay",parseInt(jQuery('input[name="cover-animation-delay-center"]').val())/100),n.attr("data-delay",parseInt(jQuery('input[name="cover-animation-delay-bottom"]').val())/100),t.data("delay",parseInt(jQuery('input[name="cover-animation-delay-top"]').val())/100),e.data("delay",parseInt(jQuery('input[name="cover-animation-delay-center"]').val())/100),n.data("delay",parseInt(jQuery('input[name="cover-animation-delay-bottom"]').val())/100),t.attr("data-duration",jQuery('input[name="cover-animation-duration-top"]').val()),e.attr("data-duration",jQuery('input[name="cover-animation-duration-center"]').val()),n.attr("data-duration",jQuery('input[name="cover-animation-duration-bottom"]').val()),t.data("duration",jQuery('input[name="cover-animation-duration-top"]').val()),e.data("duration",jQuery('input[name="cover-animation-duration-center"]').val()),n.data("duration",jQuery('input[name="cover-animation-duration-bottom"]').val()))},i.refresh_predefined_elements=function(e){if(void 0===e)AdminEssentials.ajaxRequest("get_predefined_elements",{},"",(function(e){i.refreshInitElements(e.data.elements),i.refresh_item_layout_elements(e.data.html),i.propagate_default_element_styles(),i.propagate_element_selector()}));else{for(var t in s)if(e==t){delete s.handle;break}n.esredraw()}},i.refresh_item_layout_elements=function(e){jQuery(".mainul").html(""),jQuery(".mainul").html(e)},i.check_content_position=function(){var e=jQuery('select[name="show-content"] option:selected').val();jQuery("#skin-dz-m-wrap").show(),"none"==e?jQuery("#skin-dz-m-wrap").hide():"bottom"==e?jQuery("#skin-dz-m-wrap").appendTo(jQuery("#eg-dz-hover-wrap")):"top"==e&&jQuery("#skin-dz-m-wrap").prependTo(jQuery("#eg-dz-hover-wrap"))},i.set_absolute_positioning=function(){jQuery("#skin-dz-wrapper>.skin-dz-elements").draggable({containment:".eg-editor-inside-wrapper",drag:function(){jQuery(this).css({bottom:"auto",right:"auto"})}}),jQuery("#skin-dz-wrapper>.skin-dz-elements").on("dragstop",(function(e,t){r.data("id")!==jQuery(this).data("id")&&i.select_layer(jQuery(this).data("id")),i.calculate_absolute_positioning(jQuery(this))}))},i.calculate_absolute_positioning=function(e){var t=jQuery('input[name="element-top-bottom"]'),n=jQuery('input[name="element-left-right"]'),r=jQuery('select[name="element-absolute-unit"] option:selected').val(),a=(jQuery("#eg-dz-padding-wrapper").width(),jQuery("#eg-dz-padding-wrapper").height(),jQuery('select[name="element-align"] option:selected').val()),s=jQuery("#skin-dz-media-bg"),o=s.width(),l=s.height(),u=e.position().top,d=e.position().left,c=o-e.position().left-e.outerWidth(!0),p=l-e.position().top-e.outerHeight(!0);switch("%"==r&&(u=u/l*100,d=d/o*100,c=c/o*100,p=p/l*100),a){case"t_l":t.val(u),n.val(d);break;case"t_r":t.val(u),n.val(c);break;case"b_l":t.val(p),n.val(d);break;case"b_r":t.val(p),n.val(c)}i.setting_has_changed()},i.set_default_elements_draggable=function(){jQuery("#skin-dz-tl, #skin-dz-br, #skin-dz-c, #skin-dz-m, .skin-dz-elements, .eg-special-element, .eg-additional-element").disableSelection(),jQuery(".mainul .skin-dz-elements, .eg-special .eg-special-element, .eg-additional-element").draggable({connectToSortable:"#skin-dz-tl,#skin-dz-br,#skin-dz-c,#skin-dz-m",helper:"clone",revert:!1,appendTo:"#eg-wrap",drag:function(){AdminEssentials.whileDropOrSort(".skin-dz-elements.ui-draggable-dragging")},stop:function(){AdminEssentials.atDropStop()}}),jQuery(".eg-trashdropzone").droppable({accept:".mainul .skin-dz-elements",hoverClass:"eg-trashdropzone-hover",drop:function(e,t){if(confirm(ESG_LANG.really_delete_element_permanently)){var n={handle:t.draggable.data("handle")};AdminEssentials.ajaxRequest("delete_predefined_elements",n,".eg-trashdropzone",(function(e){jQuery(t.draggable).closest("li").remove(),i.refresh_predefined_elements(t.draggable.data("handle"))}))}}}),i.set_absolute_positioning(),jQuery(".drop-to-stylechange").droppable({accept:".mainul .skin-dz-elements",hoverClass:"eg-trashdropzone-hover",drop:function(e,t){if(null==r)return!1;var n={},a=t.draggable.data("handle");for(var u in s)if(u==a){n=jQuery.extend({},s[u].settings);break}var d=r.data("id");if(!jQuery.isEmptyObject(n))for(var c in o)if(o[c].id==d){for(var u in l)"idle"==l[u].style&&void 0!==n[u]&&(o[c].settings[u]=n[u],"multi-text"==l[u].type&&(void 0===n[u+"-unit"]&&(n[u+"-unit"]="px"),o[c].settings[u+"-unit"]=n[u+"-unit"]));i.select_layer(d),i.setting_has_changed();break}}})},i.redraw_container_height=function(){var e=jQuery("#eg-element-centerme-c"),t=jQuery("#skin-dz-wrapper");e.css({top:Math.round((t.height()-e.height())/2)+"px"})},i.redraw_container_width=function(){var e=jQuery("#eg-dz-hover-wrap"),t=400-parseInt(e.css("paddingLeft"),0)-parseInt(e.css("paddingRight"),0)-parseInt(e.css("borderLeftWidth"),0)-parseInt(e.css("borderRightWidth"),0);e.css("width",t),jQuery("#skin-dz-wrapper, #skin-dz-video-wrapper, #skin-dz-music-wrapper, #skin-dz-media-bg-wrapper").css("width",t)},i.change_bg_color=function(e){var t=jQuery("#container-background-color"),n=void 0!==e?e:t.attr("data-color")||t.val(),i=jQuery('select[name="cover-background-size"] option:selected').val(),r=jQuery('select[name="cover-background-repeat"] option:selected').val(),a="0"!=jQuery('input[name="cover-background-image"]').val()?jQuery('input[name="cover-background-image-url"]').val():"";jQuery(".esg-cc .eg-element-cover").css("background-color","transparent"),jQuery(".esg-tc .eg-element-cover").css("background-color","transparent"),jQuery(".esg-bc .eg-element-cover").css("background-color","transparent"),jQuery(".esg-cc .eg-element-cover").css("background-image",""),jQuery(".esg-tc .eg-element-cover").css("background-image",""),jQuery(".esg-bc .eg-element-cover").css("background-image",""),null==n&&(n="transparent"),"full"==jQuery('select[name="cover-type"] option:selected').val()?(jQuery(".esg-cc .eg-element-cover").css("background",n),""!==a&&jQuery(".esg-cc .eg-element-cover").css("background-image","url("+a+")"),jQuery(".esg-cc .eg-element-cover").css("background-size",i),jQuery(".esg-cc .eg-element-cover").css("background-repeat",r)):(ESG.F.trim(jQuery("#skin-dz-c").html())&&(jQuery(".esg-cc .eg-element-cover").css("background",n),""!==a&&jQuery(".esg-cc .eg-element-cover").css("background-image","url("+a+")"),jQuery(".esg-cc .eg-element-cover").css("background-size",i),jQuery(".esg-cc .eg-element-cover").css("background-repeat",r)),ESG.F.trim(jQuery("#skin-dz-tl").html())&&(jQuery(".esg-tc .eg-element-cover").css("background",n),""!==a&&jQuery(".esg-tc .eg-element-cover").css("background-image","url("+a+")"),jQuery(".esg-tc .eg-element-cover").css("background-size",i),jQuery(".esg-tc .eg-element-cover").css("background-repeat",r)),ESG.F.trim(jQuery("#skin-dz-br").html())&&(""!==a?(jQuery(".esg-bc .eg-element-cover").css("background-image","url("+a+")"),jQuery(".esg-bc .eg-element-cover").css("background-size",i),jQuery(".esg-bc .eg-element-cover").css("background-repeat",r)):jQuery(".esg-bc .eg-element-cover").css("background",n))),jQuery(".eg-pa-coverring").css("background",n)},jQuery(".drop-to-stylereset").on("click",(function(){if(null==r)return!1;var e=r.data("id");for(var t in o)if(o[t].id==e){for(var n in l){var a=n.replace("-hover","");"hover"==l[n].style&&("checkbox"==l[n].type?o[t].settings[n]=o[t].settings[a]:"select"==l[n].type?(o[t].settings[n]=o[t].settings[a],"background-size"==n&&(delete o[t].settings["background-size-x-hover"],delete o[t].settings["background-size-y-hover"],"%"==o[t].settings[a]&&(o[t].settings["background-size-x-hover"]=o[t].settings["element-background-size-x"],o[t].settings["background-size-y-hover"]=o[t].settings["element-background-size-y"]))):(l[n].type,o[t].settings[n]=o[t].settings[a]),void 0!==o[t].settings[a+"-unit"]&&(o[t].settings[a+"-unit-hover"]=o[t].settings[a+"-unit"]))}i.set_default_values(e),i.set_setting_values(),i.setting_has_changed();break}})),i.initGridEditor=function(n){var a;window.onbeforeunload=function(e){if(u){var t=ESG_LANG.leave_not_saved;return(e=e||window.event)&&(e.returnValue=t),t}},jQuery('input[name="element-font-family"]').autocomplete({source:d,minLength:0}),jQuery('input[name="element-font-family-hover"]').autocomplete({source:d,minLength:0}),jQuery('input[name="element-source-meta"]').autocomplete({source:p,minLength:0}),jQuery(".ar-meta-field").autocomplete({source:p,minLength:0}),jQuery('input[name="element-meta-link"]').autocomplete({source:p,minLength:0}),jQuery('input[name="link-meta-link"]').autocomplete({source:p,minLength:0}),jQuery('input[name="element-font-family"]').on("autocompleteopen",(function(){jQuery(this).data("is_open",!0)})),jQuery('input[name="element-font-family"]').on("autocompleteclose",(function(){jQuery(this).data("is_open",!1)})),jQuery('input[name="element-font-family"]').on("autocompletechange",(function(){i.setting_has_changed()})),jQuery('input[name="element-font-family-hover"]').on("autocompleteopen",(function(){jQuery(this).data("is_open",!0)})),jQuery('input[name="element-font-family-hover"]').on("autocompleteclose",(function(){jQuery(this).data("is_open",!1)})),jQuery('input[name="element-font-family-hover"]').on("autocompletechange",(function(){i.setting_has_changed()})),jQuery(".ar-meta-field").on("autocompleteopen",(function(){jQuery(this).data("is_open",!0)})),jQuery(".ar-meta-field").on("autocompleteclose",(function(){jQuery(this).data("is_open",!1)})),jQuery('input[name="element-source-meta"]').on("autocompleteopen",(function(){jQuery(this).data("is_open",!0)})),jQuery('input[name="element-source-meta"]').on("autocompleteclose",(function(){jQuery(this).data("is_open",!1)})),jQuery('input[name="element-source-meta"]').on("autocompletechange",(function(){i.setting_has_changed()})),jQuery('input[name="element-meta-link"]').on("autocompleteopen",(function(){jQuery(this).data("is_open",!0)})),jQuery('input[name="element-meta-link"]').on("autocompleteclose",(function(){jQuery(this).data("is_open",!1)})),jQuery('input[name="element-meta-link"]').on("autocompletechange",(function(){i.setting_has_changed()})),jQuery('input[name="link-meta-link"]').on("autocompleteopen",(function(){jQuery(this).data("is_open",!0)})),jQuery('input[name="link-meta-link"]').on("autocompleteclose",(function(){jQuery(this).data("is_open",!1)})),jQuery('input[name="link-meta-link"]').on("autocompletechange",(function(){i.setting_has_changed()})),jQuery("#button-open-font-family").on("click",(function(e){e.stopPropagation(),1==jQuery('input[name="element-font-family"]').data("is_open")?jQuery('input[name="element-font-family"]').autocomplete("close"):jQuery('input[name="element-font-family"]').autocomplete("search","").data("ui-autocomplete")})),jQuery("#button-open-font-family-hover").on("click",(function(e){e.stopPropagation(),1==jQuery('input[name="element-font-family-hover"]').data("is_open")?jQuery('input[name="element-font-family-hover"]').autocomplete("close"):jQuery('input[name="element-font-family-hover"]').autocomplete("search","").data("ui-autocomplete")})),jQuery("#button-open-meta-key").on("click",(function(t){t.stopPropagation(),p.length?1==jQuery('input[name="element-source-meta"]').data("is_open")?jQuery('input[name="element-source-meta"]').autocomplete("close"):jQuery('input[name="element-source-meta"]').autocomplete("search","").data("ui-autocomplete"):e(this).next().show()})),jQuery("#button-open-link-meta-key").on("click",(function(t){t.stopPropagation(),p.length?1==jQuery('input[name="element-meta-link"]').data("is_open")?jQuery('input[name="element-meta-link"]').autocomplete("close"):jQuery('input[name="element-meta-link"]').autocomplete("search","").data("ui-autocomplete"):e(this).next().show()})),jQuery(".ar-open-meta").on("click",(function(e){if("disabled"!=jQuery(this).prop("disabled")){e.stopPropagation(),1==jQuery(this).closest("tr").find(".ar-meta-field").data("is_open")?jQuery(this).closest("tr").find(".ar-meta-field").autocomplete("close"):jQuery(this).closest("tr").find(".ar-meta-field").autocomplete("search","").data("ui-autocomplete");var t=jQuery(".ui-autocomplete");for(var n in t)t.hasOwnProperty(n)&&"object"==typeof t[n]&&"style"in t[n]&&t[n].style.setProperty("z-index","999999","important")}})),jQuery("#button-open-link-link-meta-key").on("click",(function(t){t.stopPropagation(),p.length?1==jQuery('input[name="link-meta-link"]').data("is_open")?jQuery('input[name="link-meta-link"]').autocomplete("close"):jQuery('input[name="link-meta-link"]').autocomplete("search","").data("ui-autocomplete"):e(this).next().show()})),jQuery("body").on("click",(function(){jQuery('input[name="element-font-family"]').autocomplete("close"),jQuery('input[name="element-font-family-hover"]').autocomplete("close"),jQuery('input[name="element-source-meta"]').autocomplete("close"),jQuery('input[name="element-meta-link"]').autocomplete("close"),jQuery('input[name="link-meta-link"]').autocomplete("close"),jQuery(".ar-meta-field").autocomplete("close")})),jQuery(document).on("click",".eg-icon-chooser",(function(){jQuery("#eg-fontello-icons-dialog-wrap").dialog("close");var e=this.className.replace("eg-icon-chooser ","");jQuery('input[name="element-source-icon"]').val(e),jQuery("#eg-preview-icon").html('<i class="'+e+'"></i>')})),jQuery(document).on("mouseenter",".eg-icon-chooser",(function(){_tpt.gsap.to(this,.2,{zIndex:1e3,scale:1.5,transformPerspective:600,transformOrigin:"50% 50%"})})),jQuery(document).on("mouseleave",".eg-icon-chooser",(function(){_tpt.gsap.to(this,.2,{zIndex:10,scale:1,transformPerspective:600,transformOrigin:"50% 50%"})})),jQuery(".eg-add-meta-to-textarea").on("click",(function(){jQuery("#meta-dialog-wrap").dialog("close");var e=jQuery(this).find("td:first-child").text();jQuery('textarea[name="element-source-text"]').val(jQuery('textarea[name="element-source-text"]').val()+e)})),jQuery("#show-fontello-dialog").on("click",(function(){jQuery("#eg-fontello-icons-dialog-wrap").css("overflow","overflow:hidden").dialog({modal:!0,draggable:!1,resizable:!1,width:700,height:580,title:ESG_LANG.fontello_icons,closeOnEscape:!0,dialogClass:"wp-dialog esg_dialog"})})),jQuery("#eg-show-meta-keys-dialog").on("click",(function(){jQuery("#meta-dialog-wrap").dialog({modal:!0,draggable:!1,resizable:!1,width:632,height:565,closeOnEscape:!0,dialogClass:"wp-dialog esg_dialog"})})),jQuery("#esg-advanced-rules-edit").on("click",(function(){if(null==r)return!1;jQuery("#advanced-rules-dialog-wrap").dialog({modal:!0,draggable:!1,resizable:!1,width:686,height:565,closeOnEscape:!1,buttons:[{text:ESG_LANG.save_rules,id:"adv_rules_save_btn",click:function(){var e=AdminEssentials.getFormParams("ar-form-wrap"),t=r.data("id");for(var n in o)if(o[n].id==t){o[n].settings["adv-rules"]=e;break}jQuery(this).dialog("close")}},{text:ESG_LANG.reset_fields,id:"adv_rules_reset_btn",click:function(){confirm(ESG_LANG.really_reset_fields)&&(document.getElementById("ar-form-wrap").reset(),jQuery(".ar-type-field").each((function(){jQuery(this).trigger("change")})),jQuery(".ar-operator-field").each((function(){jQuery(this).trigger("change")})))}},{text:ESG_LANG.discard_changes,id:"adv_rules_disc_btn",click:function(){confirm(ESG_LANG.really_discard_changes)&&jQuery(this).dialog("close")}}],dialogClass:"wp-dialog esg_dialog"}),document.getElementById("ar-form-wrap").reset(),jQuery(".ar-type-field").each((function(){jQuery(this).trigger("change")})),jQuery(".ar-operator-field").each((function(){jQuery(this).trigger("change")}));var e=r.data("id");for(var t in jQuery('.ar-show-field[value="show"]').prop("checked","checked"),o)if(o[t].id==e){if(void 0!==o[t].settings["adv-rules"])for(var n in o[t].settings["adv-rules"])if("ar-show"==n)jQuery("."+n+'-field[value="'+o[t].settings["adv-rules"][n]+'"]').prop("checked","checked");else{var i=0;jQuery("."+n+"-field").each((function(){jQuery(this).val(o[t].settings["adv-rules"][n][i]),i++}))}break}jQuery(".ar-type-field").each((function(){jQuery(this).trigger("change")})),jQuery(".ar-operator-field").each((function(){jQuery(this).trigger("change")}))})),jQuery("body").on("change",".ar-type-field",(function(){if("meta"==jQuery(this).val())jQuery(this).closest("tr").find(".ar-meta-field").prop("disabled",!1),jQuery(this).closest("tr").find(".ar-open-meta").prop("disabled",!1),jQuery(this).closest("tr").find(".ar-value-field").prop("disabled",!1),jQuery(this).closest("tr").find(".ar-opt-meta").each((function(){jQuery(this).prop("disabled",!1)}));else{jQuery(this).closest("tr").find(".ar-meta-field").prop("disabled","disabled"),jQuery(this).closest("tr").find(".ar-open-meta").prop("disabled","disabled"),jQuery(this).closest("tr").find(".ar-value-field").prop("disabled","disabled"),jQuery(this).closest("tr").find(".ar-opt-meta").each((function(){jQuery(this).prop("disabled","disabled")}));var e=jQuery(this).closest("tr").find(".ar-operator-field option:selected").val();"isset"!==e&&"empty"!==e&&jQuery(this).closest("tr").find('.ar-operator-field option[value="isset"]').prop("selected","selected")}var t=jQuery(this).attr("id");"off"==jQuery(this).val()?jQuery("#"+t+"-logic").prop("disabled","disabled"):jQuery("#"+t+"-logic").prop("disabled",!1)})),jQuery("body").on("change",".ar-operator-field",(function(){"between"==jQuery(this).val()?jQuery(this).closest("tr").find('input[name="ar-value-2[]"]').prop("disabled",!1):jQuery(this).closest("tr").find('input[name="ar-value-2[]"]').prop("disabled","disabled")})),jQuery("#eg-global-css-dialog").on("click",(function(){jQuery("#global-css-edit-dialog-wrap").dialog({modal:!0,draggable:!1,resizable:!1,width:632,height:565,closeOnEscape:!0,buttons:[{text:ESG_LANG.apply_changes,click:function(){var e={global_css:t.getValue()};AdminEssentials.ajaxRequest("update_custom_css",e,".ui-button",(function(e){i.set_global_inline_styles(),jQuery("#global-css-edit-dialog-wrap").dialog("close")}))}}],dialogClass:"wp-dialog"}),void 0===t&&(t=ESGMirror.fromTextArea(document.getElementById("eg-global-css-editor"),{mode:"css",theme:"base16-light",lineWrapping:!1,lineNumbers:!0,scrollbarStyle:"native"})),t.setSize(632,467),t.refresh()})),i.change_font_list=function(){var e=[];if(e.push("Georgia, serif"),e.push('"Palatino Linotype", "Book Antiqua", Palatino, serif'),e.push('"Times New Roman", Times, serif'),e.push("Arial, Helvetica, sans-serif"),e.push('"Arial Black", Gadget, sans-serif'),e.push('"Comic Sans MS", cursive, sans-serif'),e.push("Impact, Charcoal, sans-serif"),e.push('"Lucida Sans Unicode", "Lucida Grande", sans-serif'),e.push("Tahoma, Geneva, sans-serif"),e.push('"Trebuchet MS", Helvetica, sans-serif'),e.push("Verdana, Geneva, sans-serif"),e.push('"Courier New", Courier, monospace'),e.push('"Lucida Console", Monaco, monospace'),jQuery(".eg-google-font-link").remove(),c&&(c.length>0||!jQuery.isEmptyObject(c)))for(var t in c){var n=c[t].url;void 0!==n&&(n=(n=n.split("+").join(" ")).split(":"),e.push('"'+n[0]+'"'))}d=e,jQuery('input[name="element-font-family"]').autocomplete("option","source",d),jQuery('input[name="element-font-family-hover"]').autocomplete("option","source",d)},i.change_font_list(),jQuery('input[name="choose-layout"]').on("change",(function(){"even"==jQuery(this).val()?(jQuery("#eg-show-ratio").show(),jQuery("#skin-dz-m-wrap").hide(),jQuery('select[name="show-content"] option').each((function(){"bottom"==jQuery(this).val()&&jQuery(this).text(ESG_LANG.bottom_on_hover),"top"==jQuery(this).val()&&jQuery(this).text(ESG_LANG.top_on_hover),"none"==jQuery(this).val()&&jQuery(this).text(ESG_LANG.hidden)}))):(jQuery("#eg-show-ratio").hide(),jQuery("#skin-dz-m-wrap").show(),jQuery('select[name="show-content"] option').each((function(){"bottom"==jQuery(this).val()&&jQuery(this).text(ESG_LANG.bottom),"top"==jQuery(this).val()&&jQuery(this).text(ESG_LANG.top),"none"==jQuery(this).val()&&jQuery(this).text(ESG_LANG.hide)}))),i.check_content_position(),i.resize_item_skin_preview()})),jQuery('select[name="show-content"]').on("change",(function(){i.check_content_position()})),jQuery('select[name="show-content"] option:selected').trigger("change"),jQuery('select[name="content-align"]').on("change",(function(){jQuery("#skin-dz-m").css("textAlign",jQuery(this).val())})),jQuery('select[name="content-align"] option:selected').trigger("change"),jQuery('input[name="choose-layout"]:checked').trigger("change"),jQuery("#element-settings-current-name").on("change",(function(){var e=jQuery(this).val();i.select_layer(e)})),jQuery('select[name="cover-animation-top"], select[name="cover-animation-bottom"], select[name="cover-animation-center"], select[name="cover-group-animation"], select[name="media-animation"], select[name="cover-animation-top-type"], select[name="cover-animation-bottom-type"], select[name="cover-animation-center-type"]').on("change",(function(){i.add_animation_classes()})),jQuery('select[name="cover-type"]').on("change",(function(){"full"==jQuery(this).val()?(jQuery("#eg-cover-animation-top").css("display","none"),jQuery("#eg-cover-animation-bottom").css("display","none"),jQuery("#eg-dz-hover-wrap").addClass("eg-full-layout"),jQuery("#skin-dz-c-wrap .eg-element-cover").prependTo("#skin-dz-c-wrap")):(jQuery("#eg-cover-animation-top").css("display","inline-block"),jQuery("#eg-cover-animation-bottom").css("display","inline-block"),jQuery("#eg-dz-hover-wrap").removeClass("eg-full-layout"),jQuery("#skin-dz-c-wrap .eg-element-cover").prependTo("#eg-element-centerme-c")),i.add_animation_classes(),i.change_bg_color()})),jQuery('select[name="cover-type"] option:selected').trigger("change"),i.add_animation_classes(),jQuery('select[name="element-transition"]').on("change",(function(){i.check_no_transition(this.options[this.selectedIndex].value)})),i.check_no_transition=function(e){var t="none"!==e?"show":"hide";jQuery(".eg-hideable-no-transition")[t]()},ESG.C.gridEditorInputs["eg-t_b_align"]=void 0===ESG.C.gridEditorInputs["eg-t_b_align"]?jQuery("#eg-t_b_align"):ESG.C.gridEditorInputs["eg-t_b_align"],ESG.C.gridEditorInputs["eg-l_r_align"]=void 0===ESG.C.gridEditorInputs["eg-l_r_align"]?jQuery("#eg-l_r_align"):ESG.C.gridEditorInputs["eg-l_r_align"],jQuery('select[name="element-align"]').on("change",(function(){switch(jQuery('select[name="element-align"] option:selected').val()){case"t_l":ESG.C.gridEditorInputs["eg-t_b_align"].text(ESG_LANG.top),ESG.C.gridEditorInputs["eg-l_r_align"].text(ESG_LANG.left);break;case"t_r":ESG.C.gridEditorInputs["eg-t_b_align"].text(ESG_LANG.top),ESG.C.gridEditorInputs["eg-l_r_align"].text(ESG_LANG.right);break;case"b_l":ESG.C.gridEditorInputs["eg-t_b_align"].text(ESG_LANG.bottom),ESG.C.gridEditorInputs["eg-l_r_align"].text(ESG_LANG.left);break;case"b_r":ESG.C.gridEditorInputs["eg-t_b_align"].text(ESG_LANG.bottom),ESG.C.gridEditorInputs["eg-l_r_align"].text(ESG_LANG.right)}i.calculate_absolute_positioning(r)})),jQuery('select[name="element-absolute-unit"]').on("change",(function(){i.calculate_absolute_positioning(r)})),jQuery("#skin-dz-tl, #skin-dz-br, #skin-dz-c, #skin-dz-m").sortable({connectWith:"#skin-dz-tl,#skin-dz-br,#skin-dz-c,#skin-dz-m",revert:!0,tolerance:"pointer",distance:15,grid:[2,2],placeholder:"eg-state-highlight",stack:"#eg-dz-hover-wrap",cancel:".dropzonetext, .eg-element-cover",opacity:1,zIndex:1e4,sort:function(){AdminEssentials.whileDropOrSort(".skin-dz-elements.ui-sortable-helper"),i.redraw_container_height(),AdminEssentials.atDropStop(1)},update:function(e,t){},beforeStop:function(e,t){},stop:function(e,t){AdminEssentials.atDropStop(),void 0!==t.item.data("id")?i.select_layer(t.item.data("id")):r=t.item,r.removeClass("ui-draggable"),i.update_layers(),i.change_bg_color(),i.redraw_container_height(),i.setting_has_changed()}}),jQuery("body").on("click","#layertotop",(function(){var e=jQuery(".skin-dz-elements.selected");e.prev().hasClass("eg-element-cover")||e.insertBefore(e.prev()),i.update_layers(),i.change_bg_color(),i.redraw_container_height(),i.setting_has_changed()})),jQuery("body").on("click","#layertobottom",(function(){var e=jQuery(".skin-dz-elements.selected");e.insertAfter(e.next()),i.update_layers(),i.change_bg_color(),i.redraw_container_height(),i.setting_has_changed()})),i.set_default_elements_draggable(),jQuery("body").on("click","#eg-dz-hover-wrap .skin-dz-elements",(function(){if(null!=r){if(r.data("id")==jQuery(this).data("id"))return!0;i.setting_has_changed()}i.select_layer(jQuery(this).data("id"))})),jQuery("#settings-dz-elements-wrapper").tabs();var s={onRefresh:function(e,t,n,r){e.val(t),clearTimeout(a),a=setTimeout((function(){i.setting_has_changed()}),10)},change:function(e,t,n,r,s){e.val(t),clearTimeout(a),a=setTimeout((function(){i.setting_has_changed()}),10)},onEdit:function(e,t,n,r){e.val(t),e.data("color",t),clearTimeout(a),a=setTimeout((function(){i.setting_has_changed()}),10)},cancel:function(e,t,n,r,s){e.val(t),clearTimeout(a),a=setTimeout((function(){i.setting_has_changed()}),10)}},l={onRefresh:function(e,t,n,r){e.val(t),clearTimeout(a),a=setTimeout((function(){i.container_setting_has_changed()}),10)},change:function(e,t,n,r,s){e.val(t),clearTimeout(a),a=setTimeout((function(){i.container_setting_has_changed()}),10)},onEdit:function(e,t,n,r){e.val(t),e.data("color",t),e.attr("data-color",t),clearTimeout(a),a=setTimeout((function(){i.container_setting_has_changed(t)}),10)},cancel:function(e,t,n,r,s){e.val(t),clearTimeout(a),a=setTimeout((function(){i.container_setting_has_changed()}),10)}},g=jQuery.extend(!0,{},l);g.wrapper='<span class="cover-animation-color-wrap"></span>';var m="esgColorPicker";jQuery("#element-background-color")[m](s),jQuery("#element-color")[m](s),jQuery("#element-border-color")[m](s),jQuery("#element-shadow-color")[m](s),jQuery("#element-background-color-hover")[m](s),jQuery("#element-color-hover")[m](s),jQuery("#element-border-color-hover")[m](s),jQuery("#element-shadow-color-hover")[m](s),jQuery("#full-border-color")[m](l),jQuery("#full-bg-color")[m](l),jQuery("#content-border-color")[m](l),jQuery("#content-shadow-color")[m](l),jQuery("#content-bg-color")[m](l),jQuery(".cover-animation-color")[m](g),jQuery("#container-background-color")[m]({onRefresh:function(e,t,n,r){e.val(t),i.change_bg_color()},onEdit:function(e,t,n,r){e.val(t),i.change_bg_color(t)},change:function(e,t,n,r,a){e.val(t),i.change_bg_color()},cancel:function(e,t,n,r,a){e.val(t),i.change_bg_color()}}),jQuery('#container-background-color, input[name="container-background-color-into"]').on("change",(function(){i.change_bg_color()})),jQuery("#container-background-color").trigger("change"),i.init_slider_elements(),i.setting_has_changed=function(){i.get_setting_values(),i.set_setting_styles(),i.set_setting_caption(),i.set_setting_attributes(),i.change_bg_color(),i.propagate_element_selector(),i.redraw_container_height(),AdminEssentials.atDropStop()},i.container_setting_has_changed=function(){i.set_full_styles(),i.set_content_styles(),i.redraw_container_height(),i.redraw_container_width(),AdminEssentials.atDropStop(),i.set_shadow_on_container(),i.change_bg_color()},i.set_full_styles=function(){var e=jQuery("#eg-dz-hover-wrap"),t=[],n=[],i="";jQuery('input[name="full-border[]"]').each((function(){t.push(parseInt(jQuery(this).val()))})),jQuery('input[name="full-border-radius[]"]').each((function(){n.push(parseInt(jQuery(this).val()))})),jQuery('input[name="full-padding[]"]').each((function(){i+=jQuery(this).val()+"px "})),e.css("borderTopWidth",t[0]+"px"),e.css("borderRightWidth",t[1]+"px"),e.css("borderBottomWidth",t[2]+"px"),e.css("borderLeftWidth",t[3]+"px");var r=jQuery('select[name="full-border-radius-type"] option:selected').val();e.css("borderTopLeftRadius",n[0]+r),e.css("borderTopRightRadius",n[1]+r),e.css("borderBottomRightRadius",n[2]+r),e.css("borderBottomLeftRadius",n[3]+r),e.css("padding",i);var a=jQuery("#full-bg-color"),s=jQuery("#full-border-color");e.css("background",a.attr("data-color")||a.val()),e.css("borderColor",s.attr("data-color")||s.val()),e.css("borderStyle",jQuery('select[name="full-border-style"] option:selected').val())},i.set_shadow_on_container=function(){var e=jQuery('select[name="all-shadow-used"] option:selected').val(),t=jQuery("#eg-dz-hover-wrap"),n=jQuery("#skin-dz-m-wrap"),i=jQuery("#skin-dz-wrapper"),r=jQuery(".eg-element-cover"),a="";if(t.css("-moz-box-shadow","").css("-webkit-box-shadow","").css("box-shadow",""),n.css("-moz-box-shadow","").css("-webkit-box-shadow","").css("box-shadow",""),i.css("-moz-box-shadow","").css("-webkit-box-shadow","").css("box-shadow",""),r.css("-moz-box-shadow","").css("-webkit-box-shadow","").css("box-shadow",""),"none"==e)return!0;"full"===jQuery('select[name="cover-type"]').val()&&(r=r.filter((function(){return"skin-dz-c-wrap"===jQuery(this).parent().attr("id")}))),("cover"===e||jQuery("#content-shadow-inset:checked").length)&&(a+="inset "),jQuery('input[name="content-box-shadow[]"]').each((function(){a+=jQuery(this).val()+"px "}));var s=jQuery("#content-shadow-color");s=s.attr("data-color")||s.val(),a+=s,"both"==e?t.css("-moz-box-shadow",a).css("-webkit-box-shadow",a).css("box-shadow",a):"content"==e?n.css("-moz-box-shadow",a).css("-webkit-box-shadow",a).css("box-shadow",a):"media"==e?i.css("-moz-box-shadow",a).css("-webkit-box-shadow",a).css("box-shadow",a):"cover"==e&&r.css("-moz-box-shadow",a).css("-webkit-box-shadow",a).css("box-shadow",a)},i.set_content_styles=function(){var e=jQuery("#skin-dz-m"),t=[],n=[],i="";jQuery('input[name="content-border[]"]').each((function(){t.push(parseInt(jQuery(this).val()))})),jQuery('input[name="content-border-radius[]"]').each((function(){n.push(parseInt(jQuery(this).val()))})),jQuery('input[name="content-padding[]"]').each((function(){i+=jQuery(this).val()+"px "})),e.css("borderTopWidth",t[0]+"px"),e.css("borderRightWidth",t[1]+"px"),e.css("borderBottomWidth",t[2]+"px"),e.css("borderLeftWidth",t[3]+"px");var r=jQuery('select[name="content-border-radius-type"] option:selected').val();e.css("borderTopLeftRadius",n[0]+r),e.css("borderTopRightRadius",n[1]+r),e.css("borderBottomRightRadius",n[2]+r),e.css("borderBottomLeftRadius",n[3]+r),e.css("padding",i);var a=jQuery("#content-bg-color"),s=jQuery("#content-border-color");e.css("background",a.attr("data-color")||a.val()),e.css("borderColor",s.attr("data-color")||s.val()),e.css("borderStyle",jQuery('select[name="content-border-style"] option:selected').val())},jQuery("body").on("click","#element-delete-button",(function(){if(null==r)return!1;confirm(ESG_LANG.delete_this_element)&&i.delete_layer(r)})),jQuery('select[name="element-source"]').on("change",(function(){switch(jQuery(".elements-select-wrap").hide(),jQuery(".esg-cat-tag-settings").hide(),jQuery("#eg-source-functonality-wrap").hide(),jQuery("#eg-source-meta-wrap").hide(),jQuery("#eg-source-taxonomy-wrap").hide(),jQuery(this).val()){case"event":jQuery("#eg-source-element-drops").show(),ESG.C.gridEditorInputs["element-source-event"].show(),ESG.C.gridEditorInputs["eg-source-limit-wrap"].show();break;case"woocommerce":jQuery("#eg-source-element-drops").show(),ESG.C.gridEditorInputs["element-source-woocommerce"].show(),ESG.C.gridEditorInputs["eg-source-limit-wrap"].show(),ESG.C.gridEditorInputs["element-source-woocommerce"].trigger("change");break;case"icon":jQuery("#eg-source-element-drops").hide(),ESG.C.gridEditorInputs["eg-source-icon-wrap"].show();break;case"text":jQuery("#eg-source-element-drops").hide();var e=!1;for(var t in o)if(o[t].id==r.data("id")){e=!0;var n=o[t];void 0!==typeof n&&null!==n&&void 0!==typeof n.settings.special&&"true"==n.settings.special&&void 0!==typeof n.settings["special-type"]&&"blank-element"==n.settings["special-type"]?jQuery("#eg-source-text-style-disable-wrap").hide():jQuery("#eg-source-text-style-disable-wrap").show()}!1===e&&jQuery("#eg-source-text-style-disable-wrap").show(),jQuery("#eg-source-text-wrap").show();break;default:jQuery("#eg-source-element-drops").show();var i=jQuery('select[name="element-source-post"]').val();-1===i.search(/cat_list|tag_list/)?ESG.C.gridEditorInputs["eg-source-limit-wrap"].show():ESG.C.gridEditorInputs["eg-source-limit-wrap"].hide(),"taxonomy"==i&&jQuery("#eg-source-taxonomy-wrap").show(),jQuery("#eg-source-functonality-wrap").show(),jQuery('select[name="element-source-post"]').show(),jQuery('select[name="element-source-function"]').show(),jQuery('select[name="element-source-post"]').trigger("change")}})),jQuery('select[name="element-source-post"]').on("change",(function(){var e=jQuery(this).val();"cat_list"==e||"tag_list"==e||"taxonomy"==e?(jQuery(".esg-cat-tag-settings").show(),ESG.C.gridEditorInputs["eg-source-limit-wrap"].hide(),jQuery("#eg-source-functonality-wrap").show()):(jQuery(".esg-cat-tag-settings").hide(),ESG.C.gridEditorInputs["eg-source-limit-wrap"].show(),jQuery("#eg-source-functonality-wrap").hide()),"meta"==e?jQuery("#eg-source-meta-wrap").show():jQuery("#eg-source-meta-wrap").hide(),"taxonomy"==e?jQuery("#eg-source-taxonomy-wrap").show():jQuery("#eg-source-taxonomy-wrap").hide()})),ESG.C.gridEditorInputs["element-source-woocommerce"].on("change",(function(){"wc_categories"==jQuery(this).val()?(jQuery(".esg-cat-tag-settings").show(),jQuery("#eg-source-functonality-wrap").show()):(jQuery(".esg-cat-tag-settings").hide(),jQuery("#eg-source-functonality-wrap").hide())})),jQuery('select[name="element-link-type"]').on("change",(function(){switch(ESG.C.gridEditorInputs["eg-element-post-url-wrap"].hide(),ESG.C.gridEditorInputs["eg-element-post-meta-wrap"].hide(),ESG.C.gridEditorInputs["eg-element-post-javascript-wrap"].hide(),ESG.C.gridEditorInputs["eg-element-link-details-wrap"].show(),ESG.C.gridEditorInputs["eg-element-facebook-wrap"].hide(),ESG.C.gridEditorInputs["eg-element-gplus-wrap"].hide(),ESG.C.gridEditorInputs["eg-element-pinterest-wrap"].hide(),ESG.C.gridEditorInputs["eg-element-twitter-wrap"].hide(),jQuery(this).val()){case"post":case"lightbox":case"embedded_media":default:break;case"url":ESG.C.gridEditorInputs["eg-element-post-url-wrap"].show();break;case"meta":ESG.C.gridEditorInputs["eg-element-post-meta-wrap"].show();break;case"javascript":ESG.C.gridEditorInputs["eg-element-post-javascript-wrap"].show();break;case"sharefacebook":ESG.C.gridEditorInputs["eg-element-link-details-wrap"].hide(),ESG.C.gridEditorInputs["eg-element-facebook-wrap"].show(),"custom"==jQuery('select[name="element-facebook-sharing-link"]').val()?ESG.C.gridEditorInputs["eg-element-facebook_link_custom"].show():ESG.C.gridEditorInputs["eg-element-facebook_link_custom"].hide();break;case"sharegplus":ESG.C.gridEditorInputs["eg-element-link-details-wrap"].hide(),ESG.C.gridEditorInputs["eg-element-gplus-wrap"].show(),"custom"==jQuery('select[name="element-gplus-sharing-link"]').val()?ESG.C.gridEditorInputs["eg-element-gplus_link_custom"].show():ESG.C.gridEditorInputs["eg-element-gplus_link_custom"].hide();break;case"sharepinterest":ESG.C.gridEditorInputs["eg-element-link-details-wrap"].hide(),ESG.C.gridEditorInputs["eg-element-pinterest-wrap"].show(),"custom"==jQuery('select[name="element-pinterest-sharing-link"]').val()?ESG.C.gridEditorInputs["eg-element-pinterest_link_custom"].show():ESG.C.gridEditorInputs["eg-element-pinterest_link_custom"].hide();break;case"sharetwitter":ESG.C.gridEditorInputs["eg-element-link-details-wrap"].hide(),ESG.C.gridEditorInputs["eg-element-twitter-wrap"].show(),"custom"==jQuery('select[name="element-twitter-sharing-link"]').val()?ESG.C.gridEditorInputs["eg-element-twitter_link_custom"].show():ESG.C.gridEditorInputs["eg-element-twitter_link_custom"].hide()}})),jQuery('select[name="link-link-type"]').on("change",(function(){switch(jQuery("#eg-link-post-url-wrap").hide(),jQuery("#eg-link-post-meta-wrap").hide(),jQuery("#eg-link-post-javascript-wrap").hide(),jQuery("#eg-link-target-wrap").hide(),jQuery(this).val()){case"lightbox":case"embedded_media":default:break;case"post":jQuery("#eg-link-target-wrap").show();break;case"url":jQuery("#eg-link-post-url-wrap").show(),jQuery("#eg-link-target-wrap").show();break;case"meta":jQuery("#eg-link-post-meta-wrap").show(),jQuery("#eg-link-target-wrap").show();break;case"javascript":jQuery("#eg-link-post-javascript-wrap").show()}})),jQuery('select[name="link-link-type"] option:selected').trigger("change"),jQuery('select[name="link-set-to"]').on("change",(function(){"none"!==jQuery(this).val()?jQuery(".add-link-to-wrapper").show():jQuery(".add-link-to-wrapper").hide()})),jQuery('select[name="link-set-to"] option:selected').trigger("change"),jQuery('select[name="element-background-size"]').on("change",(function(){jQuery("#background-size-percent-wrap").hide(),"%"==jQuery(this).val()&&jQuery("#background-size-percent-wrap").css("display","inline-block")})),jQuery('select[name="element-background-size"] option:selected').trigger("click"),jQuery('input[name="choose-layout"]:checked').trigger("change"),jQuery('select[name="element-display"]').on("change",(function(){switch(jQuery("#element-text-align-wrap").hide(),jQuery("#element-float-wrap").hide(),jQuery(this).val()){case"block":jQuery("#element-text-align-wrap").show(),jQuery('#element-float-wrap option[value="none"]').prop("selected","selected");break;case"inline-block":jQuery("#element-float-wrap").show(),jQuery('#element-text-align-wrap option[value="center"]').prop("selected","selected")}})),jQuery('input[name="element-display"]:checked').trigger("change"),jQuery("#eg-styling-idle-hover-tab .eg-submenu li").on("click",(function(){var e=jQuery("#eg-style-idle"),t=jQuery("#eg-style-hover"),n=jQuery(this).data("toshow");e.hide(),t.hide(),jQuery("#"+n).show(),jQuery("#"+n+" .eg-small-vertical-menu li:first-child").trigger("click"),jQuery("#eg-styling-idle-hover-tab .eg-submenu li").removeClass("selected-submenu-setting"),jQuery(this).addClass("selected-submenu-setting")})),jQuery("#eg-lc-spaces .eg-submenu li").on("click",(function(){var e=jQuery("#eg-style-full"),t=jQuery("#eg-style-content"),n=jQuery(this).data("toshow");e.hide(),t.hide(),jQuery("#"+n).show(),jQuery("#eg-lc-spaces .eg-submenu li").removeClass("selected-submenu-setting"),jQuery(this).addClass("selected-submenu-setting")})),jQuery("#eg-btn-save-grid-editor, #eg-global-change").on("click",(function(){var e=jQuery('input[name="item-skin-name"]').val();if(e.length<2)return alert(ESG_LANG.item_name_too_short),!1;var t=i.output_setting_data();t=JSON.stringify(t);var r={name:ESG.F.trim(e),params:AdminEssentials.getFormParams("eg-form-item-skin-layout-settings"),layers:t};"update_item_skin"==n&&(r.id=jQuery('input[name="eg-item-skin-id"]').val()),AdminEssentials.ajaxRequest("update_create_item_skin",r,"#eg-btn-save-grid-editor, #eg-global-change"),u=!1})),jQuery('input[name="item-skin-name"]').keyup((function(){if(jQuery("#eg-item-skin-slug").text(AdminEssentials.sanitize_input(jQuery(this).val())),null!==r){var e="text"==jQuery('select[name="element-source"] option:selected').val()&&"checked"==jQuery('input[name="element-source-text-style-disable"]').prop("checked")?"-nostyle":"";jQuery(".eg-element-class-setter").text(ESG_LANG.class_name+" .eg-"+jQuery("#eg-item-skin-slug").text()+e+"-element-"+r.data("id"))}})),jQuery('input[name="item-skin-name"]').keyup(),jQuery("#element-save-as-button").on("click",(function(){var e=void 0!==jQuery(".skin-dz-elements.selected").data("orighandle")?jQuery(".skin-dz-elements.selected").data("orighandle"):jQuery(".skin-dz-elements.selected").data("handle"),t=prompt(ESG_LANG.please_enter_unique_element_name,e);return null!=t&&(t.length<2?(alert(ESG_LANG.item_name_too_short),!1):void AdminEssentials.ajaxRequest("check_item_element_existence",{name:ESG.F.trim(t)},".save-wrap-settings, #dz-delete",(function(e){var n=!1;if(void 0!==typeof e.data.existence&&("true"==e.data.existence?confirm(ESG_LANG.element_name_exists_do_overwrite)&&(n=!0):"false"==e.data.existence?n=!0:AdminEssentials.showErrorMessage(e.data.existence,"")),n){var r={settings:AdminEssentials.getFormParams("eg-item-element-settings-wrap"),name:ESG.F.trim(t)};AdminEssentials.ajaxRequest("update_create_item_element",r,".save-wrap-settings, #dz-delete",(function(e){i.refresh_predefined_elements(),AdminEssentials.showWaitAMinute({fadeOut:300})}))}else AdminEssentials.showInfoMessage(ESG_LANG.element_was_not_changed),AdminEssentials.showWaitAMinute({fadeOut:300})})))})),i.resize_item_skin_preview(),i.propagate_default_element_styles(),jQuery("#eg-preview-item-skin").on("click",(function(){AdminEssentials.playElementAnimation()})),jQuery("#eg-preview-stop-item-skin").on("click",(function(){AdminEssentials.stopElementAnimation()})),AdminEssentials.atDropStop(),AdminEssentials.callOnChange("#settings-dz-elements-wrapper",i.setting_has_changed,0),AdminEssentials.callOnChange(".eg-lc-menu-wrapper",i.container_setting_has_changed,0),i.container_setting_has_changed(),AdminEssentials.callOnChange("#eg-curname-event-wrap"),jQuery("#cover-background-image-wrap").on("click",(function(e){e.preventDefault();var t=wp.media({title:ESG_LANG.choose_image,multiple:!1,library:{type:"image"},button:{text:ESG_LANG.choose_image}});t.on("select",(function(){var e=t.state().get("selection").first().toJSON();t.state().get("selection");i.select_cover_image(e.url,e.id)})),t.open()})),jQuery("#remove-cover-background-image-wrap").on("click",(function(){jQuery('input[name="cover-background-image"]').val("0"),jQuery('input[name="cover-background-image-url"]').val(""),jQuery("#cover-background-image-wrap").css("background-image",""),i.change_bg_color()})),i.select_cover_image=function(e,t){jQuery('input[name="cover-background-image"]').val(t),jQuery('input[name="cover-background-image-url"]').val(e),jQuery("#cover-background-image-wrap").css("background-image","url("+e+")"),i.change_bg_color()},jQuery("#element-hover-image").on("change",(function(){var e=this.checked?"block":"none",t=document.getElementById("eg-hover-img-animation");t&&(t.style.display=e)})),jQuery(document).on("keydown",(function(e){if((e.ctrlKey||e.metaKey)&&"s"===String.fromCharCode(e.which).toLowerCase()){var t=jQuery("#eg-global-change");t.length&&(e.preventDefault(),t.trigger("click"))}})),jQuery(".cover-animation-select").on("change",(function(){var e=this.name.replace("cover-animation-",""),t=-1===this.value.search(/line|spiral|circle/)?"addClass":"removeClass";jQuery("#cover-animation-color-"+e).closest(".cover-animation-color-wrap")[t]("cover-animation-color-hide")})).trigger("change"),jQuery("#cover-type").on("change",(function(){jQuery("#all-shadow-used").trigger("change")})),jQuery("#all-shadow-used").on("change",(function(){var e="cover"===this.value,t=e?"full"===jQuery("#cover-type").val()?"removeClass":"addClass":"removeClass";jQuery("#content-box-shadow-hover")[t]("esg-hide-option"),t=e?"addClass":"removeClass",jQuery("#content-box-shadow-inset")[t]("esg-hide-option")})).trigger("change");var h=jQuery(".letter-spacing").on("change.letterspacing",(function e(){h.off(".letterspacing");var t=this.value.replace("px","");isNaN(t)?"normal"!==t&&"inherit"!==t&&"initial"!==t&&(this.value="normal",jQuery(this).trigger("change")):(this.value=t+"px",jQuery(this).trigger("change")),h.on("change.letterspacing",e)}));jQuery("#media-animation").on("change",(function(){var e=-1===this.value.search("blur")?"addClass":"removeClass";jQuery("#media-animation-blur")[e]("esg-hide-option")})).trigger("change"),jQuery('#eg-element-hide [name="element-always-visible-desktop"]').on("change",i.checkHideUnderShowWithout),jQuery('#eg-element-hide [name="element-always-visible-mobile"]').on("change",i.checkHideUnderShowWithout),jQuery('#eg-element-hide [name="element-hideunder"]').on("change keyup",i.checkHideUnderShowWithout),jQuery('#eg-element-hide [name="element-hideunderheight"]').on("change keyup",i.checkHideUnderShowWithout)},i.checkHideUnderShowWithout=function(){var e=jQuery('#eg-element-hide [name="element-always-visible-desktop"]').is(":checked"),t=jQuery('#eg-element-hide [name="element-always-visible-mobile"]').is(":checked"),n=jQuery('#eg-element-hide [name="element-hideunder"]').val(),i=jQuery('#eg-element-hide [name="element-hideunderheight"]').val();jQuery("#eg-element-hide .esg-warning-element-hideunder").toggle((e||t)&&n.length&&"0"!=n),jQuery("#eg-element-hide .esg-warning-element-hideunderheight").toggle((e||t)&&i.length&&"0"!=i)},i.init_elements_grid=function(){n=jQuery("#eg-elements-container-grid").tpessential({layout:"masonry",row:4,column:3,space:25,aspectratio:"4:3",startAnimation:"none",startAnimationSpeed:0,startAnimationDelay:0,pageAnimation:"fade",overflowoffset:20,animSpeed:500,animDelay:"on",delayBasic:1,responsiveEntries:[{width:400,amount:3},{width:480,amount:3},{width:620,amount:3},{width:768,amount:3},{width:992,amount:3},{width:1200,amount:3},{width:1400,amount:3}]})},i.sortByOrder=function(e,t){return(e=parseInt(e.order.toString().toLowerCase()))<(t=parseInt(t.order.toString().toLowerCase()))?-1:e>t?1:0},i.resize_item_skin_preview=function(){var e=jQuery("#skin-dz-wrapper").width();if("even"==jQuery('input[name="choose-layout"]:checked').val())var t=jQuery('input[name="element-x-ratio"]').val(),n=jQuery('input[name="element-y-ratio"]').val();else t=1,n=1;jQuery("#skin-dz-wrapper").css("height",e/t*n),jQuery("#skin-dz-media-bg").css("height",e/t*n),jQuery("#skin-dz-media-bg-wrapper").css("height",e/t*n)},i.init_slider_elements=function(){for(var e in l)switch(l[e].type){case"text-slider":case"slider":if("shadow"==e)continue;parseInt(l[e].values.default),jQuery("#element-"+e).slider({value:isNaN(parseInt(l[e].values.default))?0:parseInt(l[e].values.default),min:parseInt(l[e].values.min),max:parseInt(l[e].values.max),step:parseInt(l[e].values.step),slide:function(e,t){jQuery('input[name="'+jQuery(this).attr("id")+'"]').val(t.value),jQuery("body").trigger("esgslide",jQuery(this))}});var t=parseInt(jQuery("#element-"+e+" .ui-slider-handle").css("left"),0);jQuery("#element-"+e).prepend('<span class="eg-pre-slider"></span>'),jQuery("#element-"+e+" .eg-pre-slider").css({width:t})}var n=[{name:"x-ratio",value:-1,min:1,max:16},{name:"y-ratio",value:-1,min:1,max:16}];for(var r in n){var a=1;null!=n[r].step&&(a=n[r].step),-1==n[r].value&&(n[r].value=jQuery('input[name="element-'+n[r].name+'"]').val()),jQuery("#element-"+n[r].name).slider({value:n[r].value,min:n[r].min,max:n[r].max,step:a,slide:function(e,t){jQuery('input[name="'+jQuery(this).attr("id")+'"]').val(t.value),jQuery("body").trigger("esgslide",jQuery(this)),"element-x-ratio"!=jQuery(this).attr("id")&&"element-y-ratio"!=jQuery(this).attr("id")||i.resize_item_skin_preview()}});t=parseInt(jQuery("#element-"+n[r].name+" .ui-slider-handle").css("left"),0);jQuery("#element-"+n[r].name).prepend('<span class="eg-pre-slider"></span>'),jQuery("#element-"+n[r].name+" .eg-pre-slider").css({width:t})}jQuery("body").on("esgslide",(function(e,t){var n=jQuery(t);setTimeout((function(){var e=parseInt(n.find(".ui-slider-handle").css("left"),0);n.find(".eg-pre-slider").css({width:e})}),10)})),jQuery("#element-item-skin-width-check").slider({value:400,min:100,max:1170,step:1,slide:function(e,t){jQuery("#currently-at-pixel").text(t.value+"px"),jQuery("body").trigger("esgslide",jQuery(this)),jQuery("#skin-dz-wrapper").css("width",t.value),jQuery("#skin-dz-media-bg").css("width",t.value),i.resize_item_skin_preview()}});t=parseInt(jQuery("#element-item-skin-width-check .ui-slider-handle").css("left"),0);jQuery("#element-item-skin-width-check").prepend('<span class="eg-pre-slider"></span>'),jQuery("#element-item-skin-width-check .eg-pre-slider").css({width:t}),jQuery("#content-shadow-alpha").slider({value:jQuery('input[name="content-shadow-alpha"]').val(),min:0,max:100,step:1,slide:function(e,t){jQuery('input[name="content-shadow-alpha"]').val(t.value),jQuery("body").trigger("esgslide",jQuery(this))}});t=parseInt(jQuery("#content-shadow-alpha .ui-slider-handle").css("left"),0);jQuery("#content-shadow-alpha").prepend('<span class="eg-pre-slider"></span>'),jQuery("#content-shadow-alpha .eg-pre-slider").css({width:t});n=[];for(var r in n){n[r].value=jQuery('input[name="'+n[r].name+'"]').val(),jQuery("#"+n[r].name).slider({value:n[r].value,min:n[r].min,max:n[r].max,step:1,slide:function(e,t){jQuery('input[name="'+jQuery(this).attr("id")+'"]').val(t.value),jQuery("body").trigger("esgslide",jQuery(this)),i.add_animation_classes()}});t=parseInt(jQuery("#"+n[r].name+" .ui-slider-handle").css("left"),0);jQuery("#"+n[r].name).prepend('<span class="eg-pre-slider"></span>'),jQuery("#"+n[r].name+" .eg-pre-slider").css({width:t})}i.reinitSliderPosition(),jQuery("#settings-dz-elements-wrapper>ul>li>a, #layer-settings-header").on("click",(function(){setTimeout((function(){i.reinitSliderPosition()}),20)}))},i.reinitSliderPosition=function(){jQuery(".eg-pre-slider").each((function(){var e=jQuery(this),t=parseInt(e.parent().find(".ui-slider-handle").css("left"),0);NaN!=t&&null!=t&&e.css({width:t})}))},i.initOverviewItemSkin=function(){jQuery(".eg-btn-delete-item-skin").on("click",(function(){var e=jQuery(this).attr("id").replace("eg-delete-",""),t={id:e};confirm(ESG_LANG.delete_item_skin)&&AdminEssentials.ajaxRequest("delete_item_skin",t,".btn-wrap-item-skin-overview-"+e,(function(t){t.success,1==t.success&&jQuery("#eg-delete-"+e).closest("li").remove()}))})),jQuery(".eg-btn-duplicate-item-skin").on("click",(function(){var e={id:jQuery(this).attr("id").replace("eg-duplicate-","")};AdminEssentials.ajaxRequest("duplicate_item_skin",e,"")})),jQuery(".eg-btn-star-item-skin").on("click",(function(){var e=jQuery(this).attr("id").replace("eg-star-",""),t={id:e};AdminEssentials.ajaxRequest("star_item_skin",t,"#waitaminute",(function(t){var n=jQuery("#eg-star-"+e).children("i");n.hasClass("eg-icon-star-empty")?(n.removeClass("eg-icon-star-empty").addClass("eg-icon-star"),n.closest("li").addClass("filter-favorite")):(n.removeClass("eg-icon-star").addClass("eg-icon-star-empty"),n.closest("li").removeClass("filter-favorite"))}))}))}}}(jQuery);