jQuery(document).ready(function(a){a(document).on("keydown",function(b){27===b.keyCode&&"none"!=a("#sl-ei-menu-modal").css("display")&&a("#sl-ei-menu-modal").css("display","none")}),a(document).on("click",".sl-ei-menu-insert",function(){let b={};const c=a(this).parent().find(".sl-ei-menu-code").val();att=c.match(/dataicon[^=]*=[^\"]*"([^\"]*)/i),att&&(b=JSON.parse(atob(att[1]))),SLEImceIcons.menu(document.getElementById("sl-ei-menu-body"),b,{hideLink:!0,menuIcon:!0}),a("#sl-ei-menu-body").attr("menu-helper-id",a(this).parent().attr("id")),a("#sl-ei-menu-modal").css("display","block")}),a(document).on("click",".sl-ei-menu-remove",function(b){b.preventDefault();let c=confirm("Are you sure you want to delete this Icon?");c&&(a(this).parent().find(".sl-ei-menu-icon-container").html(""),a(this).parent().find(".sl-ei-menu-insert").html("Insert Icon"),a(this).parent().find(".sl-ei-menu-code").val(""))}),a("#sl-ei-menu-submit").click(function(b){b.preventDefault();const c=SLEImceIcons.att;icon=`<span dataicon="${btoa(JSON.stringify(c))}" iconpos="${c.iconPos}" icongap="${c.iconGap}" class="safelayout-ei-menu-${c.blockId}${c.classes?' '+c.classes:''}"><style type="text/css" data-no-optimize="1" data-no-minify="1" id="safelayout-menu-css-${c.blockId}">.safelayout-ei-menu-${c.blockId} { ${SLEImceIcons.seMenuStyle(c)} ;vertical-align: middle;}</style></span>`,a("#sl-ei-menu-modal").css("display","none");let d=a("#"+a("#sl-ei-menu-body").attr("menu-helper-id"));d.find(".sl-ei-menu-icon-container").html(icon),d.find(".sl-ei-menu-insert").html("Edit Icon"),d.find(".sl-ei-menu-code").val(icon)}),a("#sl-ei-menu-cancel").click(function(b){b.preventDefault(),a("#sl-ei-menu-modal").css("display","none")})});