(()=>{var e={18(){!function(e,t,n){const o={l10n:wpcode,isAjaxInProgress:!1,init:function(){o.should_init()&&(o.init_status_toggle(),o.move_screen_options(),o.init_copy(),o.init_type_filter(),o.init_pagination(),o.init_code_type_mobile())},init_type_filter:function(){n("#wpcode-snippet-type-buttons a").click(function(e){if(n(this).hasClass("active")||n(this).hasClass("wpcode_pro_type_lite"))return;e.preventDefault();const t=n(this).data("type");n(this).closest("ul").find("a").removeClass("active"),n(this).addClass("active"),o.show_loader(),o.update_url_and_filter(t)}),n("#wpcode-snippet-type-buttons a.wpcode_pro_type_lite").click(function(e){e.preventDefault(),"blocks"===n(this).data("type")?WPCodeAdminNotices.show_pro_notice(o.l10n.blocks_title,o.l10n.blocks_description,o.l10n.blocks_snippet_upgrade_url,o.l10n.button_text):WPCodeAdminNotices.show_pro_notice(o.l10n.scss_title,o.l10n.scss_description,o.l10n.scss_snippet_upgrade_url,o.l10n.button_text)})},show_loader(){try{const e=n("#wpcode-code-snippets-table .wp-list-table");if(0===e.length)throw new Error("Table element not found");const t=e.offset().top-n("#wpadminbar").outerHeight(),o=e.outerHeight();n("#wpcode-loader .wpcode-loader-overlay").css({top:t,height:o}),n("#wpcode-loader").show()}catch(e){console.error("Failed to show loader:",e.message)}},init_pagination:function(){n(e).on("click",".pagination-links a",function(e){e.preventDefault();const t=n(this).attr("href").split("paged=")[1];o.changePage(t)}),n(e).on("blur","#current-page-selector",function(){const e=parseInt(n(this).val(),10);isNaN(e)||o.changePage(e)}),n(e).on("keypress","#current-page-selector",function(e){"Enter"===e.key&&(e.preventDefault(),n(this).blur())})},changePage:function(e){const n=new URLSearchParams(t.location.search).get("type")||"",i=new URLSearchParams(t.location.search).get("location")||"",s=new URLSearchParams(t.location.search).get("s")||"";o.show_loader(),o.filter_by_type(n,i,s,e).done(function(n){if(n.success){const n=new URL(t.location);n.searchParams.set("paged",e),history.replaceState({},"",n)}})},update_url_and_filter:function(e){const i=new URL(t.location),s=new URLSearchParams(t.location.search),r=n("#total_pages").val(),a=s.get("s")||"",c=s.get("location")||"",l=s.get("view")||"all",d=s.get("filter_action")||"Filter";e?i.searchParams.set("type",e):i.searchParams.delete("type"),parseInt(r)>1?i.searchParams.set("paged",s.get("paged")||"1"):i.searchParams.delete("paged"),i.searchParams.delete("action"),i.searchParams.delete("action2"),i.searchParams.set("page","wpcode"),i.searchParams.set("view",l),i.searchParams.set("filter_action",d),i.searchParams.set("s",a),i.searchParams.set("location",c),history.pushState({},"",i),o.filter_by_type(e,c,a)},show_button_spinner(e){t.WPCodeSpinner.show_button_spinner(e)},filter_by_type:function(e,t,i,s="1"){if(!o.isAjaxInProgress)return o.isAjaxInProgress=!0,n.post(ajaxurl,{_wpnonce:wpcode.nonce,action:"wpcode_filter_snippets_by_type",snippet_type:e,location:t,s:i,paged:s}).done(function(e){n("#wpcode-loader").hide(),e.success?(n("#wpbody-content #wpcode-code-snippets-table").html(e.data.html),n("#wpbody-content .wpcode-content > table").remove()):console.error("Failed to update snippets:",e.data)}).fail(function(e,t,o){n("#wpcode-loader").hide(),console.error("AJAX request failed:",t,o)}).always(function(){o.isAjaxInProgress=!1})},should_init:function(){return null!==e.getElementById("wpcode-code-snippets-table")},init_status_toggle:function(){n("#wpbody-content").on("change",".wpcode-status-toggle",function(){const e=n(this),t=e.is(":checked"),i=e.data("id");o.update_status(t,i).fail(function(){e.prop("checked",!1)}).done(function(n){!1===n.success&&(e.prop("checked",!t),n.data.message&&WPCodeAdminNotices.add_notice(n.data.message,"error"))}).fail(function(e){e.responseText&&WPCodeAdminNotices.add_notice(e.responseText,"error")})})},update_status:function(e,t){return n.post(ajaxurl,{_wpnonce:o.l10n.nonce,action:"wpcode_update_snippet_status",snippet_id:t,active:e,multisite:o.l10n.multisite})},move_screen_options:function(){n("#screen-meta-links, #screen-meta").prependTo("#wpcode-header-between").show()},init_copy:function(){n("#wpbody-content").on("click",".wpcode-copy",function(e){e.preventDefault();const t=n(this).data("copy-value"),o=n(this);t&&(navigator.clipboard.writeText(t),o.addClass("wpcode-show-success-icon"),setTimeout(function(){o.removeClass("wpcode-show-success-icon")},500))})},init_code_type_mobile:function(){n(".wpcode-mobile-dropdown-toggle").on("click",function(){const e=n(this).data("target");n(e).toggleClass("wpcode-open"),n(e).one("click","a",function(){n(e).removeClass("wpcode-open")})})}};t.WPCodeSnippetsTable=o,o.init()}(document,window,jQuery)},47(){(window.WPCodeLivePreviewEditor||function(e,t,n){const o={l10n:wpcode,editor:null,iframe:null,iframeWindow:null,hasChanges:!1,debounceTimer:null,storeDebounceTimer:null,previewReady:!1,currentDevice:"desktop",init:function(){o.init_live_preview_button(),"undefined"!=typeof wpcode&&void 0!==wpcode.livePreview&&(o.config=wpcode.livePreview,o.find_elements(),o.init_editor(),o.init_iframe(),o.init_device_toggles(),o.init_save_button(),o.init_discard_button(),o.init_message_listener(),o.prevent_unload())},find_elements:function(){o.iframeEl=n(e.getElementById(o.config.iframeId)),o.saveButtonEl=n(e.getElementById("wpcode-live-preview-save")),o.discardButtonEl=n(e.getElementById("wpcode-live-preview-discard")),o.deviceTogglesEl=n(e.getElementsByClassName("wpcode-device-toggle")),o.iframeWrapperEl=n(e.getElementsByClassName("wpcode-live-preview-iframe-wrapper")),o.loadingEl=n(e.getElementsByClassName("wpcode-live-preview-loading"))},init_editor:function(){if(!e.getElementById(o.config.editorId))return;const n=function(e){if(e="number"==typeof e?e:0,void 0!==t.WPCodeAdminCodeEditor){const e=t.WPCodeAdminCodeEditor.get_editor(o.config.editorId);if(e)return o.editor=e,o.editor.on("change",function(){o.mark_as_changed(),o.send_css_to_preview(),o.schedule_store_preview_css()}),void o.send_css_to_preview()}e<100&&setTimeout(function(){n(e+1)},50)};n(0)},init_iframe:function(){0!==o.iframeEl.length&&(o.iframe=o.iframeEl[0],o.iframeEl.on("load",function(){o.iframeWindow=o.iframe.contentWindow,o.loadingEl.fadeOut()}))},init_device_toggles:function(){o.deviceTogglesEl.on("click",function(){const e=n(this).data("device");o.switch_device(e)})},switch_device:function(e){o.currentDevice!==e&&(o.currentDevice=e,o.deviceTogglesEl.removeClass("wpcode-active"),o.deviceTogglesEl.filter('[data-device="'+e+'"]').addClass("wpcode-active"),o.iframeWrapperEl.removeClass("wpcode-device-desktop wpcode-device-tablet wpcode-device-mobile"),o.iframeWrapperEl.addClass("wpcode-device-"+e))},send_css_to_preview:function(){o.previewReady&&(o.debounceTimer&&clearTimeout(o.debounceTimer),o.debounceTimer=setTimeout(function(){const e=o.get_editor_value();o.is_scss()&&"function"==typeof o.compile_scss?o.compile_scss(e,function(e){o.post_css_to_iframe(e)}):o.post_css_to_iframe(e)},300))},post_css_to_iframe:function(e){o.iframeWindow&&o.iframeWindow.postMessage({action:"updateCSS",css:e},t.location.origin)},schedule_store_preview_css:function(){o.storeDebounceTimer&&clearTimeout(o.storeDebounceTimer),o.storeDebounceTimer=setTimeout(function(){const e=o.get_editor_value();o.is_scss()&&"function"==typeof o.compile_scss?o.compile_scss(e,function(t){o.store_preview_css(t,e,"scss")}):o.store_preview_css(e,"","")},1e3)},store_preview_css:function(e,t,i){const s={action:"wpcode_set_preview_css",nonce:wpcode.nonce,snippet_id:o.config.snippetId,css:e};"scss"===i&&(s.source_code=t,s.code_type="scss"),n.ajax({url:ajaxurl,type:"POST",data:s})},init_message_listener:function(){t.addEventListener("message",function(e){if(e.origin!==t.location.origin)return;const n=e.data;if("previewReady"===n.action&&String(n.snippetId)===String(o.config.snippetId))return o.previewReady=!0,void o.send_css_to_preview();"cssNotFound"!==n.action||String(n.snippetId)!==String(o.config.snippetId)?"cssFound"!==n.action||String(n.snippetId)!==String(o.config.snippetId)||o.hide_missing_css_notice():o.show_missing_css_notice()})},show_missing_css_notice:function(){if(e.getElementById("wpcode-live-preview-missing-css"))return;const t=e.getElementById("wpcode-live-preview-discard"),n=e.getElementsByClassName("wpcode-live-preview-actions")[0];if(!n)return;const i=e.createElement("div");i.id="wpcode-live-preview-missing-css",i.className="wpcode-live-preview-notice";const s=e.createElement("div");s.className="excl-mark",s.textContent="!";const r=e.createElement("span");r.className="wpcode-live-preview-notice-text",r.textContent=o.l10n&&o.l10n.live_preview_not_loaded?o.l10n.live_preview_not_loaded:"This CSS snippet is not loaded on this page. Navigate to a page where it should load based on its location and conditional logic.",i.appendChild(s),i.appendChild(r),n.insertBefore(i,t)},hide_missing_css_notice:function(){const t=e.getElementById("wpcode-live-preview-missing-css");t&&t.parentNode&&t.parentNode.removeChild(t)},get_editor_value:function(){return o.editor?o.editor.getValue():""},is_scss:function(){return!1},mark_as_changed:function(){o.hasChanges||(o.hasChanges=!0,o.config.hasChanges=!0)},init_save_button:function(){o.saveButtonEl.on("click",function(e){e.preventDefault(),o.save_changes()})},save_changes:function(){const e=o.get_editor_value();o.show_button_spinner(o.saveButtonEl);const i=function(e,i,s){const r={action:"wpcode_save_preview_css",nonce:wpcode.nonce,snippet_id:o.config.snippetId,css:e};"scss"===s&&(r.source_code=i,r.code_type="scss"),n.ajax({url:ajaxurl,type:"POST",data:r,success:function(e){e.success?(o.hasChanges=!1,o.config.hasChanges=!1,t.location.href=o.config.snippetUrl):(o.hide_button_spinner(o.saveButtonEl),alert(e.data.message||wpcode.please_wait))},error:function(){o.hide_button_spinner(o.saveButtonEl),alert(wpcode.please_wait)}})};o.is_scss()&&"function"==typeof o.compile_scss?o.compile_scss(e,function(t){i(t,e,"scss")}):i(e,"","")},init_discard_button:function(){o.discardButtonEl.on("click",function(e){e.preventDefault(),o.discard_changes()})},discard_changes:function(){o.hasChanges&&!confirm(o.config.exitConfirm)||n.ajax({url:ajaxurl,type:"POST",data:{action:"wpcode_clear_preview_css",nonce:wpcode.nonce,snippet_id:o.config.snippetId},complete:function(){o.hasChanges=!1,o.config.hasChanges=!1,t.location.href=o.config.snippetUrl}})},prevent_unload:function(){n(t).on("beforeunload",function(e){if(o.hasChanges)return e.preventDefault(),o.config.exitConfirm})},show_button_spinner:function(e){void 0!==t.WPCodeSpinner?t.WPCodeSpinner.show_button_spinner(e):e.prop("disabled",!0)},init_live_preview_button:function(){const i=n(e.getElementById("wpcode-live-preview-button"));0!==i.length&&i.on("click",function(s){s.preventDefault();const r=i.attr("href"),a=1===i.data("is-new")||"1"===i.data("is-new"),c=(i.data("allowed-locations")||"").toString(),l=c?c.split(","):[];let d=n('input[name="wpcode_auto_insert_location"]:checked').val();if(d||(d=(i.data("current-location")||"").toString()),a){const t=wpcode.live_preview_save_title,o=wpcode.live_preview_save_text;if("function"==typeof n.confirm)n.confirm({title:t,content:o,type:"blue",backgroundDismiss:!0,buttons:{save:{text:wpcode.live_preview_save_button||"Save Snippet",btnClass:"wpcode-btn-confirm",action:function(){const t=e.getElementById("wpcode-snippet-manager-form");t&&t.submit()}},cancel:{text:wpcode.cancel||"Cancel"}}});else if(confirm(o)){const t=e.getElementById("wpcode-snippet-manager-form");t&&t.submit()}return!1}if(l.length&&d&&-1===l.indexOf(d)){const e=wpcode.live_preview_block_title,t=wpcode.live_preview_block_text;return"function"==typeof n.confirm?n.confirm({title:e,content:t,type:"blue",backgroundDismiss:!0,buttons:{ok:{btnClass:"wpcode-btn-confirm"}}}):alert(t),!1}let u="";u=void 0!==t.WPCodeAdminCodeEditor?t.WPCodeAdminCodeEditor.get_value("wpcode_snippet_code"):n(e.getElementById("wpcode_snippet_code")).val()||"";let p=0;p=void 0!==t.wpcode&&void 0!==t.wpcode.snippet_id?t.wpcode.snippet_id:parseInt(n(e.getElementsByName("id")[0]).val(),10)||0;let h="css";const f=e.getElementById("wpcode_snippet_type");f&&(h=f.value);const m=function(e,o,i){const s={action:"wpcode_set_preview_css",nonce:t.wpcode&&t.wpcode.nonce?t.wpcode.nonce:"",snippet_id:p,css:e};"scss"===i&&(s.source_code=o,s.code_type="scss"),n.post(ajaxurl,s).always(function(){t.location.href=r})};"scss"===h&&"function"==typeof o.load_sass_library&&"function"==typeof o.compile_scss?o.load_sass_library(function(){o.compile_scss(u,function(e){m(e,u,"scss")})}):m(u,"","")})},hide_button_spinner:function(e){void 0!==t.WPCodeSpinner?t.WPCodeSpinner.hide_button_spinner(e):e.prop("disabled",!1)}};return o}(document,window,jQuery)).init()},75(){jconfirm.defaults={closeIcon:!1,backgroundDismiss:!1,escapeKey:!0,animationBounce:1,useBootstrap:!1,theme:"modern",boxWidth:"560px",type:"blue",animateFromElement:!1,scrollToPreviousElement:!1}},132(){(window.WPCodeLibraryTabs||function(e,t,n){const o={init:function(){o.find_elements(),o.should_init()&&o.add_events()},find_elements:function(){o.tabs=n(".wpcode-library-tab"),o.buttons=n(".wpcode-library-tab-button")},should_init:function(){return o.tabs.length>0},add_events:function(){o.buttons.on("click",function(e){e.preventDefault(),o.switch_tab(n(this))})},switch_tab:function(e){const t=e.data("tab");o.buttons.removeClass("wpcode-library-tab-button-active"),e.addClass("wpcode-library-tab-button-active"),o.tabs.removeClass("wpcode-library-tab-active"),o.tabs.filter('[data-tab="'+t+'"]').addClass("wpcode-library-tab-active")}};return o}(document,window,jQuery)).init()},145(){(window.WPCodeAdminCodeEditor||function(e,t,n){const o={l18n:wpcode,init(){t.WPCodeAdminCodeEditor=o},switch_code_mode(e,t){const n=o.get_editor(e);if(void 0===n)return!1;n.setOption("mode",o.get_mime_for_code_type(t)),n.setOption("lint",o.get_lint_for_code_type(t)),jQuery(n.getTextArea()).closest(".wpcode-code-textarea").attr("data-code-type",t)},get_editor(e){if("undefined"!=typeof wpcode_editor)return wpcode_editor[e]?wpcode_editor[e].codemirror:void 0},set_value(e,t){const n=o.get_editor(e);if(void 0===n)return!1;n.getDoc().setValue(t)},get_mime_for_code_type:e=>o.l18n.code_type_options[e].mime,get_lint_for_code_type:e=>o.l18n.code_type_options[e].lint,refresh(e){"undefined"!=typeof wpcode_editor&&o.get_editor(e).refresh()},get_value:e=>void 0===o.get_editor(e)?n("#"+e).val():o.get_editor(e).getValue(),refresh_all(){"undefined"!=typeof wpcode_editor&&n.each(wpcode_editor,function(e,t){t.codemirror.refresh()})}};return o}(document,window,jQuery)).init()},197(){window.WPCodeItemsList||function(e,t,n){const o=function(e){this.container=n(e),this.category="*",this.search_term="",this.categories_list=this.container.find(".wpcode-items-filters"),this.search_input=this.container.find(".wpcode-items-search-input"),this.items=this.container.find(".wpcode-list-item"),this.banner=null,this.init()};o.prototype={init:function(){this.should_init()&&(this.init_category_switch(),this.init_search(),this.show_connect_banner(),this.init_custom_event_handlers())},init_custom_event_handlers(){this.container.on("wpcode_reset_items",()=>{this.reset_items()}),this.container.on("wpcode_select_item",(e,t)=>{this.set_item(t)})},set_item(e){this.reset_items();const t=this.items.filter(function(){return n(this).data("id")===e});this.items.removeClass("wpcode-list-item-selected"),t.addClass("wpcode-list-item-selected");const o=t.data("categories"),i=o.length>0?o[0]:"*";this.switch_to_category(i);const s=this.categories_list.find(`button[data-category="${i}"]`);this.switch_category_button(s);const r=t.find('input[type="radio"]');r.length>0&&r.prop("checked",!0)},reset_items(){this.search_input.val(""),this.search_term="";const e=this.categories_list.find("button").first();this.switch_to_category(e.data("category")),this.switch_category_button(e)},should_init:function(){return this.categories_list.length>0},init_category_switch:function(){const e=this;this.categories_list.on("click","button",function(){const t=n(this);t.hasClass("wpcode-active")||(e.switch_to_category(t.data("category")),e.switch_category_button(t))})},switch_category_button:function(e){this.categories_list.find("button").removeClass("wpcode-active"),e.addClass("wpcode-active")},switch_to_category:function(e){this.category=e,this.filter_items()},filter_items:function(){let e;const t=this,o=this.items.filter(function(){return"*"===t.category||n(this).data("categories").indexOf(t.category)>-1});if(t.search_term.length>2){const o=t.search_term.toLowerCase();e=this.items.filter(function(){return n(this).text().toLowerCase().indexOf(o)>-1})}else e=o;t.items.hide(),e.show(),this.update_banner_position()},init_search:function(){const e=this;this.search_input.on("keyup change search",function(){const t=n(this).val();e.search_term=t.length<3?"":t,e.filter_items()})},show_connect_banner:function(){const e=n("#tmpl-wpcode-library-connect-banner");if(!e.length)return;const t=this.container.find(".wpcode-items-list-category .wpcode-list-item:visible");t.length>5?t.eq(5).after(e.html()):t.last().after(e.html()),this.banner=this.container.find("#wpcode-library-connect-banner")},update_banner_position:function(){const e=this.container.find(".wpcode-items-list-category .wpcode-list-item:visible");this.banner&&this.banner.length>0&&(e.length>5?this.banner.insertAfter(e.eq(5)):this.banner.insertAfter(e.last()))}},n(e).ready(function(){n(".wpcode-items-metabox").each(function(){new o(this)})})}(document,window,jQuery)},209(){(window.WPCodeAdminNotices||function(e,t,n){const o={l10n:wpcode,init:function(){t.WPCodeAdminNotices=o,o.notice_holder=n(e.getElementById("wpcode-notice-area")),o.document=n(e)},add_notice(e,t="updated"){const n=o.get_notice(e,t);o.notice_holder.append(n),o.document.trigger("wp-updates-notice-added"),n.find("button").focus()},get_notice(e,t){const o=n("
"),i=n("

");return i.html(e),o.addClass("fade notice is-dismissible"),o.addClass(t),o.append(i),o},show_pro_notice(e,i,s,r){const a=s.startsWith("wpcode-"),c=WPCodeSVG.WPCodeIcon("lock",22,28,"0 0 22 28","iconId");n.confirm({title:c+e,content:i,boxWidth:"560px",theme:"modern upsell-box",onOpenBefore(){this.$btnc.after('

'),o.l10n.purchased&&this.$btnc.after('
'+o.l10n.purchased+"
"),o.l10n.wpcode_lite_users&&(this.$btnc.after('
'+o.l10n.bonus+": "+o.l10n.wpcode_lite_users+" "+o.l10n.price+" "+o.l10n.regular_price+"
"),this.$body.find(".jconfirm-content").addClass("wpcode-lite-upgrade"))},buttons:{confirm:{text:r||o.l10n.upgrade_button,btnClass:"wpcode-btn-orange",action:function(){a?a&&WPCodeAddons&&n.confirm({title:o.l10n.please_wait,content:function(){this.showLoading(),WPCodeAddons.install_addon(n("").data("addon",s))}}):t.open(s,"_blank","noopener noreferrer")}}},closeIcon:!0,backgroundDismiss:!0,useBootstrap:!1})}};return o}(document,window,jQuery)).init()},327(){(window.WPCodeHeader||function(e,t,n){const o={init(){o.should_init()&&n(e).ready(function(){o.init_sticky_header()})},should_init:()=>n("#wpcode_snippet_code").length>0||n("#ihaf_insert_header").length>0,init_sticky_header(){const e=n(".wpcode-header-bottom"),o=e.height(),i=e.offset().top,s=e.parent();n(t).scroll(function(){const r=n(t).scrollTop();i(o.$drawer=n("#wpcode-notifications-drawer"),o.$drawer.length>0),find_elements(){o.$open_button=n("#wpcode-notifications-button"),o.$count=o.$drawer.find("#wpcode-notifications-count"),o.$dismissed_count=o.$drawer.find("#wpcode-notifications-dismissed-count"),o.active_count=o.$open_button.data("count")?o.$open_button.data("count"):0,o.dismissed_count=o.$open_button.data("dismissed"),o.$body=n("body"),o.$dismissed_button=n("#wpcode-notifications-show-dismissed"),o.$active_button=n("#wpcode-notifications-show-active"),o.$active_list=n(".wpcode-notifications-list .wpcode-notifications-active"),o.$dismissed_list=n(".wpcode-notifications-list .wpcode-notifications-dismissed"),o.$dismiss_all=n("#wpcode-dismiss-all")},update_count(e){o.$open_button.data("count",e).attr("data-count",e),0===e&&o.$open_button.removeAttr("data-count"),o.$count.text(e),o.dismissed_count+=Math.abs(e-o.active_count),o.active_count=e,o.$dismissed_count.text(o.dismissed_count),0===o.active_count&&o.$dismiss_all.hide()},init_open(){o.$open_button.on("click",function(e){e.preventDefault(),o.$body.addClass("wpcode-notifications-open")})},init_close(){o.$body.on("click",".wpcode-notifications-close, .wpcode-notifications-overlay",function(e){e.preventDefault(),o.$body.removeClass("wpcode-notifications-open")})},init_dismiss(){o.$drawer.on("click",".wpcode-notification-dismiss",function(e){e.preventDefault();const t=n(this).data("id");if(o.dismiss_notification(t),"all"===t)return o.move_to_dismissed(o.$active_list.find("li")),void o.update_count(0);o.move_to_dismissed(n(this).closest("li")),o.update_count(o.active_count-1)})},move_to_dismissed(e){e.slideUp(function(){n(this).prependTo(o.$dismissed_list).show()})},dismiss_notification:e=>n.post(ajaxurl,{action:"wpcode_notification_dismiss",nonce:wpcode.nonce,id:e}),init_view_switch(){o.$dismissed_button.on("click",function(e){e.preventDefault(),o.$drawer.addClass("show-dismissed")}),o.$active_button.on("click",function(e){e.preventDefault(),o.$drawer.removeClass("show-dismissed")})}};return o}(document,window,jQuery)).init()},343(){(window.WPCodeSnippetUpdate||function(e,t,n){const o={l10n:wpcode,is_single_sync_request_in_progress:!1,is_archive_sync_request_in_progress:!1,init(){o.init_archive_sync_button(),o.init_single_sync_button(),o.init_check_updates_button()},init_archive_sync_button(){o.sync_button=n(".wpcode-sync-snippet-lite"),o.sync_button.on("click",function(e){e.preventDefault();const t=n(this),i=t.data("id"),s=t.data("library-id");if(0===n(this).data("has-auth"))return o.prompt_auth(t);const r=t.data("current-version"),a=t.data("latest-version");let c="";r&&a&&(c='
'+o.l10n.your_version+" "+r+" "+o.l10n.library_version+" "+a+"
"),n.confirm({title:o.l10n.confirm_sync_title,content:o.l10n.confirm_sync_text+"

"+c,closeIcon:!1,backgroundDismiss:!0,boxWidth:"600px",type:"blue",buttons:{confirm:{text:o.l10n.confirm_sync_button,btnClass:"wpcode-btn-confirm",action:function(){if(o.is_archive_sync_request_in_progress)return;o.is_archive_sync_request_in_progress=!0,t.addClass("wpcode-loading");const e=o.show_loading_modal(),r={action:"wpcode_sync_snippet",snippet_id:i,library_id:s||!1,nonce:o.l10n.nonce};n.ajax({url:ajaxurl,type:"POST",data:r,success:function(e){e.success?t.remove():console.error("Snippet sync failed:",e.data)},error:function(e,t,n){console.error("AJAX request failed for snippet sync:",{status:t,error:n,response:e.responseText,snippetId:i,libraryId:s})},complete:function(){t.removeClass("wpcode-loading"),o.is_archive_sync_request_in_progress=!1,e.close()}})}},cancel:{text:o.l10n.cancel}}})})},init_single_sync_button(){o.sync_single_button=n(".sync-snippet"),o.sync_single_button.on("click",function(e){e.preventDefault();const i=n(this).data("has-auth"),s=n(this);if(0===i)return o.prompt_auth(s);const r=s.data("current-version"),a=s.data("latest-version");let c="";r&&a&&(c='
'+o.l10n.old_version+" "+r+" "+o.l10n.new_version+" "+a+"
"),n.confirm({title:o.l10n.confirm_sync_title,content:o.l10n.confirm_sync_text+"

"+c,closeIcon:!1,backgroundDismiss:!0,boxWidth:"600px",type:"blue",buttons:{confirm:{text:o.l10n.confirm_sync_button,btnClass:"wpcode-btn-confirm",action:function(){o.is_single_sync_request_in_progress||(o.is_single_sync_request_in_progress=!0,s.addClass("wpcode-loading"),o.show_loading_modal(),t.location.href=s.attr("href"))}},cancel:{text:o.l10n.cancel}}})})},show_loading_modal:()=>n.confirm({title:o.l10n.please_wait,closeIcon:!1,content:'
',boxWidth:"600px",theme:"modern loader-spinner",backgroundDismiss:!1,buttons:{close:{isHidden:!0}},onOpenBefore:function(){this.buttons.close.hide(),this.$content.parent().addClass("jconfirm-loading")},onClose:function(){this.$content.parent().removeClass("jconfirm-loading")}}),prompt_auth(e){n.confirm({title:o.l10n.auth_needed_title_sync,content:o.l10n.auth_needed_text_sync,closeIcon:!1,backgroundDismiss:!0,boxWidth:"600px",type:"blue",buttons:{confirm:{text:o.l10n.auth_needed_confirm,btnClass:"wpcode-btn-confirm",action:function(){WPCodeLibraryAuth.start_auth(e)}}}})},init_check_updates_button(){n(".wpcode-lite-version #wpcode-check-for-updates").on("click",function(e){e.preventDefault(),n(this);const i=WPCodeSVG.WPCodeIcon("lock",22,28,"0 0 22 28","iconId");n.confirm({title:i+o.l10n.check_for_updates_title,content:o.l10n.check_for_updates_text,closeIcon:!0,boxWidth:"560px",backgroundDismiss:!0,theme:"modern upsell-box-alert width560px",buttons:{confirm:{text:o.l10n.upgrade_button,btnClass:"wpcode-btn-orange wpcode-button-large",action:function(){t.open(o.l10n.upgrade_url||"https://wpcode.com/lite/","_blank","noopener noreferrer")}}},onContentReady:function(){this.$content.parent().parent().append('")},onClose:function(){}})})}};return o}(document,window,jQuery)).init()},350(e,t,n){var o,i,s;i=[n(428)],void 0===(s="function"==typeof(o=function(e){var t=window;e.fn.confirm=function(n,o){return void 0===n&&(n={}),"string"==typeof n&&(n={content:n,title:o||!1}),e(this).each(function(){var o=e(this);o.attr("jc-attached")?console.warn("jConfirm has already been attached to this element ",o[0]):(o.on("click",function(i){i.preventDefault();var s=e.extend({},n);if(o.attr("data-title")&&(s.title=o.attr("data-title")),o.attr("data-content")&&(s.content=o.attr("data-content")),void 0===s.buttons&&(s.buttons={}),s.$target=o,o.attr("href")&&0===Object.keys(s.buttons).length){var r=e.extend(!0,{},t.jconfirm.pluginDefaults.defaultButtons,(t.jconfirm.defaults||{}).defaultButtons||{}),a=Object.keys(r)[0];s.buttons=r,s.buttons[a].action=function(){location.href=o.attr("href")}}s.closeIcon=!1,e.confirm(s)}),o.attr("jc-attached",!0))}),e(this)},e.confirm=function(n,o){void 0===n&&(n={}),"string"==typeof n&&(n={content:n,title:o||!1});var i=!(!1===n.buttons);if("object"!=typeof n.buttons&&(n.buttons={}),0===Object.keys(n.buttons).length&&i){var s=e.extend(!0,{},t.jconfirm.pluginDefaults.defaultButtons,(t.jconfirm.defaults||{}).defaultButtons||{});n.buttons=s}return t.jconfirm(n)},e.alert=function(n,o){void 0===n&&(n={}),"string"==typeof n&&(n={content:n,title:o||!1});var i=!(!1===n.buttons);if("object"!=typeof n.buttons&&(n.buttons={}),0===Object.keys(n.buttons).length&&i){var s=e.extend(!0,{},t.jconfirm.pluginDefaults.defaultButtons,(t.jconfirm.defaults||{}).defaultButtons||{}),r=Object.keys(s)[0];n.buttons[r]=s[r]}return t.jconfirm(n)},e.dialog=function(e,n){return void 0===e&&(e={}),"string"==typeof e&&(e={content:e,title:n||!1,closeIcon:function(){}}),e.buttons={},void 0===e.closeIcon&&(e.closeIcon=function(){}),e.confirmKeys=[13],t.jconfirm(e)},t.jconfirm=function(n){void 0===n&&(n={});var o=e.extend(!0,{},t.jconfirm.pluginDefaults);t.jconfirm.defaults&&(o=e.extend(!0,o,t.jconfirm.defaults)),o=e.extend(!0,{},o,n);var i=new t.Jconfirm(o);return t.jconfirm.instances.push(i),i},t.Jconfirm=function(t){e.extend(this,t),this._init()},t.Jconfirm.prototype={_init:function(){var n=this;t.jconfirm.instances.length||(t.jconfirm.lastFocused=e("body").find(":focus")),this._id=Math.round(99999*Math.random()),this.contentParsed=e(document.createElement("div")),this.lazyOpen||setTimeout(function(){n.open()},0)},_buildHTML:function(){var t=this;this._parseAnimation(this.animation,"o"),this._parseAnimation(this.closeAnimation,"c"),this._parseBgDismissAnimation(this.backgroundDismissAnimation),this._parseColumnClass(this.columnClass),this._parseTheme(this.theme),this._parseType(this.type);var n=e(this.template);n.find(".jconfirm-box").addClass(this.animationParsed).addClass(this.backgroundDismissAnimationParsed).addClass(this.typeParsed),this.typeAnimated&&n.find(".jconfirm-box").addClass("jconfirm-type-animated"),this.useBootstrap?(n.find(".jc-bs3-row").addClass(this.bootstrapClasses.row),n.find(".jc-bs3-row").addClass("justify-content-md-center justify-content-sm-center justify-content-xs-center justify-content-lg-center"),n.find(".jconfirm-box-container").addClass(this.columnClassParsed),this.containerFluid?n.find(".jc-bs3-container").addClass(this.bootstrapClasses.containerFluid):n.find(".jc-bs3-container").addClass(this.bootstrapClasses.container)):n.find(".jconfirm-box").css("width",this.boxWidth),this.titleClass&&n.find(".jconfirm-title-c").addClass(this.titleClass),n.addClass(this.themeParsed);var o="jconfirm-box"+this._id;n.find(".jconfirm-box").attr("aria-labelledby",o).attr("tabindex",-1),n.find(".jconfirm-content").attr("id",o),null!==this.bgOpacity&&n.find(".jconfirm-bg").css("opacity",this.bgOpacity),this.rtl&&n.addClass("jconfirm-rtl"),this.$el=n.appendTo(this.container),this.$jconfirmBoxContainer=this.$el.find(".jconfirm-box-container"),this.$jconfirmBox=this.$body=this.$el.find(".jconfirm-box"),this.$jconfirmBg=this.$el.find(".jconfirm-bg"),this.$title=this.$el.find(".jconfirm-title"),this.$titleContainer=this.$el.find(".jconfirm-title-c"),this.$content=this.$el.find("div.jconfirm-content"),this.$contentPane=this.$el.find(".jconfirm-content-pane"),this.$icon=this.$el.find(".jconfirm-icon-c"),this.$closeIcon=this.$el.find(".jconfirm-closeIcon"),this.$holder=this.$el.find(".jconfirm-holder"),this.$btnc=this.$el.find(".jconfirm-buttons"),this.$scrollPane=this.$el.find(".jconfirm-scrollpane"),t.setStartingPoint(),this._contentReady=e.Deferred(),this._modalReady=e.Deferred(),this.$holder.css({"padding-top":this.offsetTop,"padding-bottom":this.offsetBottom}),this.setTitle(),this.setIcon(),this._setButtons(),this._parseContent(),this.initDraggable(),this.isAjax&&this.showLoading(!1),e.when(this._contentReady,this._modalReady).then(function(){t.isAjaxLoading?setTimeout(function(){t.isAjaxLoading=!1,t.setContent(),t.setTitle(),t.setIcon(),setTimeout(function(){t.hideLoading(!1),t._updateContentMaxHeight()},100),"function"==typeof t.onContentReady&&t.onContentReady()},50):(t._updateContentMaxHeight(),t.setTitle(),t.setIcon(),"function"==typeof t.onContentReady&&t.onContentReady()),t.autoClose&&t._startCountDown()}).then(function(){t._watchContent()}),"none"===this.animation&&(this.animationSpeed=1,this.animationBounce=1),this.$body.css(this._getCSS(this.animationSpeed,this.animationBounce)),this.$contentPane.css(this._getCSS(this.animationSpeed,1)),this.$jconfirmBg.css(this._getCSS(this.animationSpeed,1)),this.$jconfirmBoxContainer.css(this._getCSS(this.animationSpeed,1))},_typePrefix:"jconfirm-type-",typeParsed:"",_parseType:function(e){this.typeParsed=this._typePrefix+e},setType:function(e){var t=this.typeParsed;this._parseType(e),this.$jconfirmBox.removeClass(t).addClass(this.typeParsed)},themeParsed:"",_themePrefix:"jconfirm-",setTheme:function(e){var t=this.theme;this.theme=e||this.theme,this._parseTheme(this.theme),t&&this.$el.removeClass(t),this.$el.addClass(this.themeParsed),this.theme=e},_parseTheme:function(t){var n=this;t=t.split(","),e.each(t,function(o,i){-1===i.indexOf(n._themePrefix)&&(t[o]=n._themePrefix+e.trim(i))}),this.themeParsed=t.join(" ").toLowerCase()},backgroundDismissAnimationParsed:"",_bgDismissPrefix:"jconfirm-hilight-",_parseBgDismissAnimation:function(t){var n=t.split(","),o=this;e.each(n,function(t,i){-1===i.indexOf(o._bgDismissPrefix)&&(n[t]=o._bgDismissPrefix+e.trim(i))}),this.backgroundDismissAnimationParsed=n.join(" ").toLowerCase()},animationParsed:"",closeAnimationParsed:"",_animationPrefix:"jconfirm-animation-",setAnimation:function(e){this.animation=e||this.animation,this._parseAnimation(this.animation,"o")},_parseAnimation:function(t,n){n=n||"o";var o=t.split(","),i=this;e.each(o,function(t,n){-1===n.indexOf(i._animationPrefix)&&(o[t]=i._animationPrefix+e.trim(n))});var s=o.join(" ").toLowerCase();return"o"===n?this.animationParsed=s:this.closeAnimationParsed=s,s},setCloseAnimation:function(e){this.closeAnimation=e||this.closeAnimation,this._parseAnimation(this.closeAnimation,"c")},setAnimationSpeed:function(e){this.animationSpeed=e||this.animationSpeed},columnClassParsed:"",setColumnClass:function(e){this.useBootstrap?(this.columnClass=e||this.columnClass,this._parseColumnClass(this.columnClass),this.$jconfirmBoxContainer.addClass(this.columnClassParsed)):console.warn("cannot set columnClass, useBootstrap is set to false")},_updateContentMaxHeight:function(){var t=e(window).height()-(this.$jconfirmBox.outerHeight()-this.$contentPane.outerHeight())-(this.offsetTop+this.offsetBottom);this.$contentPane.css({"max-height":t+"px"})},setBoxWidth:function(e){this.useBootstrap?console.warn("cannot set boxWidth, useBootstrap is set to true"):(this.boxWidth=e,this.$jconfirmBox.css("width",e))},_parseColumnClass:function(e){var t;switch(e=e.toLowerCase()){case"xl":case"xlarge":t="col-md-12";break;case"l":case"large":t="col-md-8 col-md-offset-2";break;case"m":case"medium":t="col-md-6 col-md-offset-3";break;case"s":case"small":t="col-md-4 col-md-offset-4";break;case"xs":case"xsmall":t="col-md-2 col-md-offset-5";break;default:t=e}this.columnClassParsed=t},initDraggable:function(){var t=this,n=this.$titleContainer;this.resetDrag(),this.draggable&&(n.on("mousedown",function(e){n.addClass("jconfirm-hand"),t.mouseX=e.clientX,t.mouseY=e.clientY,t.isDrag=!0}),e(window).on("mousemove."+this._id,function(e){t.isDrag&&(t.movingX=e.clientX-t.mouseX+t.initialX,t.movingY=e.clientY-t.mouseY+t.initialY,t.setDrag())}),e(window).on("mouseup."+this._id,function(){n.removeClass("jconfirm-hand"),t.isDrag&&(t.isDrag=!1,t.initialX=t.movingX,t.initialY=t.movingY)}))},resetDrag:function(){this.isDrag=!1,this.initialX=0,this.initialY=0,this.movingX=0,this.movingY=0,this.mouseX=0,this.mouseY=0,this.$jconfirmBoxContainer.css("transform","translate(0px, 0px)")},setDrag:function(){if(this.draggable){this.alignMiddle=!1;var t=this.$jconfirmBox.outerWidth(),n=this.$jconfirmBox.outerHeight(),o=e(window).width(),i=e(window).height(),s=this;if(s.movingX%1==0||s.movingY%1==0){if(s.dragWindowBorder){var r=o/2-t/2,a=i/2-n/2;a-=s.dragWindowGap,(r-=s.dragWindowGap)+s.movingX<0?s.movingX=-r:r-s.movingX<0&&(s.movingX=r),a+s.movingY<0?s.movingY=-a:a-s.movingY<0&&(s.movingY=a)}s.$jconfirmBoxContainer.css("transform","translate("+s.movingX+"px, "+s.movingY+"px)")}}},_scrollTop:function(){if("undefined"!=typeof pageYOffset)return pageYOffset;var e=document.body,t=document.documentElement;return(t=t.clientHeight?t:e).scrollTop},_watchContent:function(){var t=this;this._timer&&clearInterval(this._timer);var n=0;this._timer=setInterval(function(){if(t.smoothContent){var o=t.$content.outerHeight()||0;o!==n&&(n=o);var i=e(window).height();t.offsetTop+t.offsetBottom+t.$jconfirmBox.height()-t.$contentPane.height()+t.$content.height()').html(t.buttons[o].text).addClass(t.buttons[o].btnClass).prop("disabled",t.buttons[o].isDisabled).css("display",t.buttons[o].isHidden?"none":"").click(function(e){e.preventDefault();var n=t.buttons[o].action.apply(t,[t.buttons[o]]);t.onAction.apply(t,[o,t.buttons[o]]),t._stopCountDown(),(void 0===n||n)&&t.close()});t.buttons[o].el=s,t.buttons[o].setText=function(e){s.html(e)},t.buttons[o].addClass=function(e){s.addClass(e)},t.buttons[o].removeClass=function(e){s.removeClass(e)},t.buttons[o].disable=function(){t.buttons[o].isDisabled=!0,s.prop("disabled",!0)},t.buttons[o].enable=function(){t.buttons[o].isDisabled=!1,s.prop("disabled",!1)},t.buttons[o].show=function(){t.buttons[o].isHidden=!1,s.css("display","")},t.buttons[o].hide=function(){t.buttons[o].isHidden=!0,s.css("display","none")},t["$_"+o]=t["$$"+o]=s,t.$btnc.append(s)}),0===n&&this.$btnc.hide(),null===this.closeIcon&&0===n&&(this.closeIcon=!0),this.closeIcon){if(this.closeIconClass){var o='';this.$closeIcon.html(o)}this.$closeIcon.click(function(e){e.preventDefault();var n,o=!1,i=!1;if("string"==typeof(n="function"==typeof t.closeIcon?t.closeIcon():t.closeIcon)&&void 0!==t.buttons[n]?(o=n,i=!1):i=void 0===n||1==!!n,o){var s=t.buttons[o].action.apply(t);i=void 0===s||!!s}i&&t.close()}),this.$closeIcon.show()}else this.$closeIcon.hide()},setTitle:function(e,t){if(t=t||!1,void 0!==e)if("string"==typeof e)this.title=e;else if("function"==typeof e){"function"==typeof e.promise&&console.error("Promise was returned from title function, this is not supported.");var n=e();this.title="string"==typeof n&&n}else this.title=!1;this.isAjaxLoading&&!t||(this.$title.html(this.title||""),this.updateTitleContainer())},setIcon:function(e,t){if(t=t||!1,void 0!==e)if("string"==typeof e)this.icon=e;else if("function"==typeof e){var n=e();this.icon="string"==typeof n&&n}else this.icon=!1;this.isAjaxLoading&&!t||(this.$icon.html(this.icon?'':""),this.updateTitleContainer())},updateTitleContainer:function(){this.title||this.icon?this.$titleContainer.show():this.$titleContainer.hide()},setContentPrepend:function(e,t){e&&this.contentParsed.prepend(e)},setContentAppend:function(e){e&&this.contentParsed.append(e)},setContent:function(e,t){t=!!t;var n=this;e&&this.contentParsed.html("").append(e),this.isAjaxLoading&&!t||(this.$content.html(""),this.$content.append(this.contentParsed),setTimeout(function(){n.$body.find("input[autofocus]:visible:first").focus()},100))},loadingSpinner:!1,showLoading:function(e){this.loadingSpinner=!0,this.$jconfirmBox.addClass("loading"),e&&this.$btnc.find("button").prop("disabled",!0)},hideLoading:function(e){this.loadingSpinner=!1,this.$jconfirmBox.removeClass("loading"),e&&this.$btnc.find("button").prop("disabled",!1)},ajaxResponse:!1,contentParsed:"",isAjax:!1,isAjaxLoading:!1,_parseContent:function(){var t=this,n=" ";if("function"==typeof this.content){var o=this.content.apply(this);"string"==typeof o?this.content=o:"object"==typeof o&&"function"==typeof o.always?(this.isAjax=!0,this.isAjaxLoading=!0,o.always(function(e,n,o){t.ajaxResponse={data:e,status:n,xhr:o},t._contentReady.resolve(e,n,o),"function"==typeof t.contentLoaded&&t.contentLoaded(e,n,o)}),this.content=n):this.content=n}if("string"==typeof this.content&&"url:"===this.content.substr(0,4).toLowerCase()){this.isAjax=!0,this.isAjaxLoading=!0;var i=this.content.substring(4,this.content.length);e.get(i).done(function(e){t.contentParsed.html(e)}).always(function(e,n,o){t.ajaxResponse={data:e,status:n,xhr:o},t._contentReady.resolve(e,n,o),"function"==typeof t.contentLoaded&&t.contentLoaded(e,n,o)})}this.content||(this.content=n),this.isAjax||(this.contentParsed.html(this.content),this.setContent(),t._contentReady.resolve())},_stopCountDown:function(){clearInterval(this.autoCloseInterval),this.$cd&&this.$cd.remove()},_startCountDown:function(){var t=this,n=this.autoClose.split("|");if(2!==n.length)return console.error("Invalid option for autoClose. example 'close|10000'"),!1;var o=n[0],i=parseInt(n[1]);if(void 0===this.buttons[o])return console.error("Invalid button key '"+o+"' for autoClose"),!1;var s=Math.ceil(i/1e3);this.$cd=e(' ('+s+")").appendTo(this["$_"+o]),this.autoCloseInterval=setInterval(function(){t.$cd.html(" ("+(s-=1)+") "),s<=0&&(t["$$"+o].trigger("click"),t._stopCountDown())},1e3)},_getKey:function(e){switch(e){case 192:return"tilde";case 13:return"enter";case 16:return"shift";case 9:return"tab";case 20:return"capslock";case 17:return"ctrl";case 91:return"win";case 18:return"alt";case 27:return"esc";case 32:return"space"}var t=String.fromCharCode(e);return!!/^[A-z0-9]+$/.test(t)&&t.toLowerCase()},reactOnKey:function(t){var n=this,o=e(".jconfirm");if(o.eq(o.length-1)[0]!==this.$el[0])return!1;var i=t.which;if(this.$content.find(":input").is(":focus")&&/13|32/.test(i))return!1;var s,r=this._getKey(i);"esc"===r&&this.escapeKey&&(!0===this.escapeKey?this.$scrollPane.trigger("click"):"string"!=typeof this.escapeKey&&"function"!=typeof this.escapeKey||(s="function"==typeof this.escapeKey?this.escapeKey():this.escapeKey)&&(void 0===this.buttons[s]?console.warn("Invalid escapeKey, no buttons found with key "+s):this["$_"+s].trigger("click"))),e.each(this.buttons,function(e,t){-1!==t.keys.indexOf(r)&&n["$_"+e].trigger("click")})},setDialogCenter:function(){console.info("setDialogCenter is deprecated, dialogs are centered with CSS3 tables")},_unwatchContent:function(){clearInterval(this._timer)},close:function(n){var o=this;return"function"==typeof this.onClose&&this.onClose(n),this._unwatchContent(),e(window).unbind("resize."+this._id),e(window).unbind("keyup."+this._id),e(window).unbind("jcKeyDown."+this._id),this.draggable&&(e(window).unbind("mousemove."+this._id),e(window).unbind("mouseup."+this._id),this.$titleContainer.unbind("mousedown")),o.$el.removeClass(o.loadedClass),e("body").removeClass("jconfirm-no-scroll-"+o._id),o.$jconfirmBoxContainer.removeClass("jconfirm-no-transition"),setTimeout(function(){o.$body.addClass(o.closeAnimationParsed),o.$jconfirmBg.addClass("jconfirm-bg-h");var n="none"===o.closeAnimation?1:o.animationSpeed;setTimeout(function(){o.$el.remove(),t.jconfirm.instances;for(var n=t.jconfirm.instances.length-1;n>=0;n--)t.jconfirm.instances[n]._id===o._id&&t.jconfirm.instances.splice(n,1);if(!t.jconfirm.instances.length&&o.scrollToPreviousElement&&t.jconfirm.lastFocused&&t.jconfirm.lastFocused.length&&e.contains(document,t.jconfirm.lastFocused[0])){var i=t.jconfirm.lastFocused;if(o.scrollToPreviousElementAnimate){var s=e(window).scrollTop(),r=t.jconfirm.lastFocused.offset().top,a=e(window).height();if(r>s&&rc||Math.abs(a)>l)return!1;this.$jconfirmBoxContainer.css("transform","translate("+a+"px, "+r+"px)")},_open:function(){var e=this;"function"==typeof e.onOpenBefore&&e.onOpenBefore(),this.$body.removeClass(this.animationParsed),this.$jconfirmBg.removeClass("jconfirm-bg-h"),this.$body.focus(),e.$jconfirmBoxContainer.css("transform","translate(0px, 0px)"),setTimeout(function(){e.$body.css(e._getCSS(e.animationSpeed,1)),e.$body.css({"transition-property":e.$body.css("transition-property")+", margin"}),e.$jconfirmBoxContainer.addClass("jconfirm-no-transition"),e._modalReady.resolve(),"function"==typeof e.onOpen&&e.onOpen(),e.$el.addClass(e.loadedClass)},this.animationSpeed)},loadedClass:"jconfirm-open",isClosed:function(){return!this.$el||0===this.$el.parent().length},isOpen:function(){return!this.isClosed()},toggle:function(){this.isOpen()?this.close():this.open()}},t.jconfirm.instances=[],t.jconfirm.lastFocused=!1,t.jconfirm.pluginDefaults={template:'
',title:"Hello",titleClass:"",type:"default",typeAnimated:!0,draggable:!0,dragWindowGap:15,dragWindowBorder:!0,animateFromElement:!0,alignMiddle:!0,smoothContent:!0,content:"Are you sure to continue?",buttons:{},defaultButtons:{ok:{action:function(){}},close:{action:function(){}}},contentLoaded:function(){},icon:"",lazyOpen:!1,bgOpacity:null,theme:"light",animation:"scale",closeAnimation:"scale",animationSpeed:400,animationBounce:1,escapeKey:!0,rtl:!1,container:"body",containerFluid:!1,backgroundDismiss:!1,backgroundDismissAnimation:"shake",autoClose:!1,closeIcon:null,closeIconClass:!1,watchInterval:100,columnClass:"col-md-4 col-md-offset-4 col-sm-6 col-sm-offset-3 col-xs-10 col-xs-offset-1",boxWidth:"50%",scrollToPreviousElement:!0,scrollToPreviousElementAnimate:!0,useBootstrap:!0,offsetTop:40,offsetBottom:40,bootstrapClasses:{container:"container",containerFluid:"container-fluid",row:"row"},onContentReady:function(){},onOpenBefore:function(){},onOpen:function(){},onClose:function(){},onDestroy:function(){},onAction:function(){}};var n=!1;e(window).on("keydown",function(t){if(!n){var o=!1;e(t.target).closest(".jconfirm-box").length&&(o=!0),o&&e(window).trigger("jcKeyDown"),n=!0}}),e(window).on("keyup",function(){n=!1}),t.jconfirm.lastClicked=!1,e(document).on("mousedown","button, a, [jc-source]",function(){t.jconfirm.lastClicked=e(this)})})?o.apply(t,i):o)||(e.exports=s)},405(){(window.WPCodeHelp||function(e,t,n){const o={init:function(){o.should_init()&&(o.find_elements(),o.init_show(),o.init_close_button(),o.init_search(),o.init_accordion())},should_init:()=>(o.$overlay=n("#wpcode-docs-overlay"),o.$overlay.length>0),find_elements(){o.$close_button=n("#wpcode-help-close"),o.$search=n("#wpcode-help-search"),o.$no_result=n("#wpcode-help-no-result"),o.$search_results=n("#wpcode-help-result ul"),o.$categories=n("#wpcode-help-categories")},init_close_button(){o.$close_button.on("click",function(e){e.preventDefault(),o.$overlay.fadeOut(200)})},init_show(){n(e).on("click",".wpcode-show-help",function(e){e.preventDefault(),o.$overlay.fadeIn(200)})},init_accordion(){o.$categories.on("click",".wpcode-help-category header",function(){const e=n(this).closest(".wpcode-help-category");o.toggle_category(e)}),o.$categories.on("click",".viewall",function(e){e.preventDefault(),n(this).closest(".wpcode-help-docs").find("div").slideDown(),n(this).hide()})},toggle_category(e){e.toggleClass("open"),e.find(".wpcode-help-docs").slideToggle()},init_search(){o.$search.on("keyup","input",o.input_search),o.$search.on("click","#wpcode-help-search-clear",o.clear_search)},input_search(){o.$search_results.html("");const e=n(this).val().toLowerCase(),t=n("#wpcode-help-categories .wpcode-help-docs li").filter(function(){return n(this).text().toLowerCase().indexOf(""+e)>-1});e.length>2&&t.clone().appendTo(o.$search_results),0===t.length?o.$no_result.show():o.$no_result.hide(),o.$search.toggleClass("wpcode-search-empty",!e)},clear_search(){o.$search.find("input").val("").trigger("keyup")}};return o}(document,window,jQuery)).init()},428(e){"use strict";e.exports=window.jQuery},429(){(window.WPCodeAdminGenerator||function(e,t,n){const o={doing_ajax_call:!1,ajax_snippet_update:!1,editor_id:"wpcode_generator_code_preview",init:function(){o.should_init()&&(o.find_elements(),o.init_generator_form(),o.init_code_editor(),o.init_tabs(),o.init_use_snippet(),o.init_copy_editor(),o.init_repeater(),o.do_spacer(),n(e).ready(function(){o.init_autocomplete()}))},should_init:()=>(o.generator_form=n("#wpcode_generator_form"),o.generator_form.length>0),find_elements(){o.tabs_buttons=n(".wpcode-items-tabs"),o.tabs_content=n(".wpcode-items-list .wpcode-form-tab"),o.use_snippet=n("#wpcode-generator-use-snippet"),o.update_button=n("#wpcode-generator-update-code"),o.repeater_row=n("#wpcode-generator-repeater-row").html()},init_generator_form(){o.generator_form.on("submit",function(e){e.preventDefault(),o.update_snippet()}),o.generator_form.on("change","input, select",function(){o.update_snippet()}),o.update_snippet()},update_snippet(){o.doing_ajax_call||(o.ajax_snippet_update&&o.ajax_snippet_update.abort(),o.show_button_spinner(o.update_button),o.ajax_snippet_update=n.post(ajaxurl,n(o.generator_form).serialize()).done(function(e){o.ajax_snippet_update=!1,WPCodeAdminCodeEditor.set_value(o.editor_id,e),o.hide_button_spinner(o.update_button)}))},init_tabs(){o.tabs_buttons.on("click","button",function(e){e.preventDefault(),o.switch_active_tab(n(this))})},switch_active_tab(e){o.tabs_buttons.find("button").removeClass("wpcode-active"),e.addClass("wpcode-active");const t=e.data("category");o.tabs_content.hide(),o.tabs_content.filter(function(){return n(this).data("tab")===t}).show(),o.do_spacer(),WPCodeAdminCodeEditor.refresh(o.editor_id)},init_use_snippet(){o.use_snippet.on("click",function(e){if(e.preventDefault(),o.doing_ajax_call)return;o.doing_ajax_call=!0;const i=o.generator_form.serializeArray(),s=n(this);n.each(i,function(e,t){"action"===t.name&&(i[e].value="wpcode_save_generated_snippet")}),o.show_button_spinner(s),n.post(ajaxurl,n.param(i)).done(function(e){o.doing_ajax_call=!1,o.hide_button_spinner(s),e.success&&e.data.url&&(t.location=e.data.url)})})},show_button_spinner(e){t.WPCodeSpinner.show_button_spinner(e)},hide_button_spinner(e){t.WPCodeSpinner.hide_button_spinner(e)},init_copy_editor:function(){n(".wpcode-copy-target").on("click",function(e){e.preventDefault();const t=n(this),i=WPCodeAdminCodeEditor.get_value(o.editor_id);i&&(navigator.clipboard.writeText(i),t.addClass("wpcode-show-success-icon"),setTimeout(function(){t.removeClass("wpcode-show-success-icon")},500))})},init_repeater(){o.row_id=0,o.tabs_content.on("click",".wpcode-repeater-button",function(){const e=n(this).data("target"),t=n(n('.wpcode-generator-column > [data-repeater="'+e+'"]').get().reverse());let i,s,r=0;o.row_id++,t.each(function(){const e=n(this).closest(".wpcode-generator-column");e.is(i)||(r++,i=e,s=n(o.repeater_row),r>1?s.find("button").remove():s.find("button").data("target",o.row_id),s.attr("data-id",o.row_id),e.append(s)),n(this).clone().attr("data-repeater",null).prependTo(s).find("input").val(null)});let a=0,c=n('.wpcode-repeater-group[data-id="'+o.row_id+'"]');c.each(function(){const e=n(this).height();e>a&&(a=e)}),c.height(a),c.first().find("input").first().focus()}),o.tabs_content.on("click",".wpcode-remove-row",function(){const e=n(this).data("target");n('.wpcode-repeater-group[data-id="'+e+'"]').remove()})},do_spacer(){n(".wpcode-generator-field-spacer").each(function(){const e=n(this).closest(".wpcode-generator-column"),t=n(this).closest(".wpcode-generator-column").outerHeight();let o=0;e.siblings(".wpcode-generator-column").each(function(){const e=n(this).height();e>o&&(o=e)}),o>t&&n(this).height(o-t+3)})},init_autocomplete(){n(".wpcode-generator-field-autocomplete").each(function(){const e=n(this).find('input[type="text"]'),t=n(this).find(".wpcode-field-autocomplete").text();e.autocomplete({source:JSON.parse(t)})})},init_code_editor(){const e=n(".wpcode-generator-code");if(0===e.length)return;const t=wp.codeEditor.initialize(e);o.CodeMirror=t.codemirror,o.CodeMirror.setOption("readOnly",!1),o.CodeMirror.refresh(),o.CodeMirror.on("change",function(e){clearTimeout(o.editor_change_handler),o.editor_change_handler=setTimeout(function(){jQuery(e.getTextArea()).val(e.getValue()).change(),o.update_snippet()},300)})}};return o}(document,window,jQuery)).init()},474(){(window.WPCodeSVG||function(e,t){const n={l18n:wpcode,init(){t.WPCodeSVG=n},sanitizeSvg(e,t){const n=(new DOMParser).parseFromString(e,"image/svg+xml");return n.querySelector("parsererror")?(console.error("Error parsing SVG:",n.querySelector("parsererror").textContent),""):(n.querySelectorAll("*").forEach(e=>{const n=e.tagName.toLowerCase();if(t[n])for(let o of[...e.attributes])t[n][o.name.toLowerCase()]||e.removeAttribute(o.name);else e.parentNode.removeChild(e)}),"svg"===n.documentElement.nodeName?n.documentElement.outerHTML:"")},WPCodeIcon(e,t=20,o=20,i="",s="",r=""){const a=n.wpcodeIcons();if(!a.hasOwnProperty(e))return"";i||(i=`0 0 ${t} ${o}`);const c=` ${a[e]} `;return this.sanitizeSvg(c,{svg:{class:!0,"aria-hidden":!0,"aria-labelledby":!0,role:!0,xmlns:!0,width:!0,height:!0,viewbox:!0,id:!0},g:{fill:!0,"clip-path":!0},title:{title:!0},path:{d:!0,fill:!0,"fill-rule":!0,"clip-rule":!0,"data-name":!0},circle:{cx:!0,cy:!0,r:!0,stroke:!0,"stroke-width":!0,fill:!0},rect:{x:!0,y:!0,width:!0,height:!0,fill:!0},polyline:{points:!0,fill:!0,stroke:!0,"stroke-width":!0,"stroke-linecap":!0,"stroke-miterlimit":!0},clipPath:{id:!0},defs:{}})},wpcodeIcons:()=>({logo:'',checkmark:'',lock:''})};return n}(document,window,jQuery)).init()},481(){(window.WPCodeSchemaGenerator||function(e,t,n){const o={l18n:t.wpcode,init(){o.bindEvents(),console.log("Schema Generator with Smart Tags initialized!")},bindEvents(){n(e).on("click",".wpcode-media-library-button",o.openMediaLibrary),n(e).on("focus",".wpcode-input-text, .wpcode-input-textarea",function(){o.currentInputField=this}),n(e).on("click",".wpcode-insert-smart-tag",function(e){const t=n(this).closest(".wpcode-smart-tags").find(".wpcode-smart-tags-dropdown"),o=t.data("upgrade-title");if(o)return e.preventDefault(),e.stopImmediatePropagation(),WPCodeAdminNotices.show_pro_notice(o,t.data("upgrade-text"),t.data("upgrade-link"),t.data("upgrade-button")),!1})},openMediaLibrary(e){e.preventDefault();const t=n(this),i=n("#"+t.data("target")),s=wp.media({title:o.l18n.select_image||"Select Image",button:{text:o.l18n.use_image||"Use Image"},multiple:!1});s.on("select",function(){const e=s.state().get("selection").first().toJSON();i.val(e.url).trigger("change")}),s.open()},insertAtCursor(e,t){if(e.selectionStart||0===e.selectionStart){const n=e.selectionStart,o=e.selectionEnd;e.value=e.value.substring(0,n)+t+e.value.substring(o,e.value.length),e.selectionStart=n+t.length,e.selectionEnd=n+t.length}else e.value+=t;n(e).trigger("change"),e.focus()}};return o}(document,window,jQuery)).init()},512(){(window.WPCodeAdminWelcome||function(e,t,n){const o={init:function(){o.add_listener()},add_listener(){n("#wpbody-content").on("click",".wpcode-scroll-to",function(e){e.preventDefault();const t=n(this).attr("href"),o=n(t);n("html, body").animate({scrollTop:o.offset().top},700)})}};return o}(document,window,jQuery)).init()},535(){(window.WPCodeFileBasedLoading||function(e,t,n){const o={l18n:t.wpcode,init:function(){o.should_init()&&o.init_events()},should_init:()=>(o.$toggle=n(".wpcode-lite-version #wpcode-php-load-as-file"),o.$row=o.$toggle.closest(".wpcode-metabox-form-row"),o.$toggle.length>0),init_events(){o.$toggle.on("change",o.toggle),o.$row.on("click","label, .wpcode-metabox-form-row-label",o.toggle)},toggle(e){e.preventDefault(),e.stopPropagation();const i=WPCodeSVG.WPCodeIcon("lock",22,28,"0 0 22 28","iconId");n.confirm({title:i+o.l18n.file_based_loading.title,content:o.l18n.file_based_loading.text,closeIcon:!0,boxWidth:"560px",backgroundDismiss:!0,theme:"modern upsell-box-alert width560px",buttons:{confirm:{text:o.l18n.file_based_loading.button_text,btnClass:"wpcode-btn-orange wpcode-button-large",action:function(){o.$toggle.prop("checked",!1),t.open(o.l18n.file_based_loading.link,"_blank","noopener noreferrer")}}},onClose:function(){o.$toggle.prop("checked",!1)}})}};return o}(document,window,jQuery)).init()},596(e,t,n){var o,i;!function(s){o=[n(428)],i=function(e){return function(e,t){"use strict";var n=e.document,o=t(e),i=t.Deferred,s=t("html"),r=[],a="aria-hidden",c="lity-"+a,l='a[href],area[href],input:not([disabled]),select:not([disabled]),textarea:not([disabled]),button:not([disabled]),iframe,object,embed,[contenteditable],[tabindex]:not([tabindex^="-"])',d={esc:!0,handler:null,handlers:{image:C,inline:function(e,n){var o,i,s;try{o=t(e)}catch(e){return!1}return!!o.length&&(i=t(''),s=o.hasClass("lity-hide"),n.element().one("lity:remove",function(){i.before(o).remove(),s&&!o.closest(".lity-content").length&&o.addClass("lity-hide")}),o.removeClass("lity-hide").after(i))},youtube:function(e){var n=p.exec(e);return!!n&&x(b(e,y("https://www.youtube"+(n[2]||"")+".com/embed/"+n[4],t.extend({autoplay:1},w(n[5]||"")))))},vimeo:function(e){var n=h.exec(e);return!!n&&x(b(e,y("https://player.vimeo.com/video/"+n[3],t.extend({autoplay:1},w(n[4]||"")))))},googlemaps:function(e){var t=f.exec(e);return!!t&&x(b(e,y("https://www.google."+t[3]+"/maps?"+t[6],{output:t[6].indexOf("layer=c")>0?"svembed":"embed"})))},facebookvideo:function(e){var n=m.exec(e);return!!n&&(0!==e.indexOf("http")&&(e="https:"+e),x(b(e,y("https://www.facebook.com/plugins/video.php?href="+e,t.extend({autoplay:1},w(n[4]||""))))))},iframe:x},template:''},u=/(^data:image\/)|(\.(png|jpe?g|gif|svg|webp|bmp|ico|tiff?)(\?\S*)?$)/i,p=/(youtube(-nocookie)?\.com|youtu\.be)\/(watch\?v=|v\/|u\/|embed\/?)?([\w-]{11})(.*)?/i,h=/(vimeo(pro)?.com)\/(?:[^\d]+)?(\d+)\??(.*)?$/,f=/((maps|www)\.)?google\.([^\/\?]+)\/?((maps\/?)?\?)(.*)/i,m=/(facebook\.com)\/([a-z0-9_-]*)\/videos\/([0-9]*)(.*)?$/i,g=function(){var e=n.createElement("div"),t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var o in t)if(void 0!==e.style[o])return t[o];return!1}();function _(e){var t=i();return g&&e.length?(e.one(g,t.resolve),setTimeout(t.resolve,500)):t.resolve(),t.promise()}function v(e,n,o){if(1===arguments.length)return t.extend({},e);if("string"==typeof n){if(void 0===o)return void 0===e[n]?null:e[n];e[n]=o}else t.extend(e,n);return this}function w(e){for(var t,n=decodeURI(e.split("#")[0]).split("&"),o={},i=0,s=n.length;i-1?"&":"?")+t.param(n)}function b(e,t){var n=e.indexOf("#");return-1===n?t:(n>0&&(e=e.substr(n)),t+e)}function C(e,n){var o=n.opener()&&n.opener().data("lity-desc")||"Image with no description",s=t(''+o+''),r=i(),a=function(){var e;r.reject((e="Failed loading image",t('').append(e)))};return s.on("load",function(){if(0===this.naturalWidth)return a();r.resolve(s)}).on("error",a),r.promise()}function x(e){return'