wp_back/wp-content/plugins/wp-smushit/app/assets/js/smush-admin.min.js
2024-05-20 15:37:46 +03:00

2 lines
255 KiB
JavaScript

!function(){var e={8283:function(e,t,n){"use strict";n.d(t,{O:function(){return s},h:function(){return i}});var s={maybeShowCDNActivationNotice:function(){wp_smush_msgs.smush_cdn_activation_notice&&WP_Smush.helpers.renderActivationCDNNotice(wp_smush_msgs.smush_cdn_activation_notice)},maybeShowCDNUpsellForPreSiteOnStart:function(){var e=document.querySelector(".wp-smush-upsell-cdn");e&&(e.querySelector("p").innerHTML=wp_smush_msgs.processing_cdn_for_free,e.classList.remove("sui-hidden"))},maybeShowCDNUpsellForPreSiteOnCompleted:function(){var e=document.querySelector(".wp-smush-upsell-cdn");e&&(e.querySelector("p").innerHTML=wp_smush_msgs.processed_cdn_for_free,e.classList.remove("sui-hidden"))}},i=function(){var e=document.querySelector.bind(document),t=e(".sui-summary-smush-metabox");if(!t)return{};var n=window.wp_smushit_data.bo_stats,i={count_images:0,count_total:0,count_resize:0,count_skipped:0,count_smushed:0,savings_bytes:0,savings_resize:0,size_after:0,size_before:0,savings_percent:0,percent_grade:"sui-grade-dismissed",percent_metric:0,percent_optimized:0,remaining_count:0,human_bytes:"",savings_conversion_human:"",savings_conversion:0},r=e("#smush-image-score"),o=e(".smush-final-log .smush-bulk-errors"),a=e("#wp-smush-bulk-content"),u={},c=function(e){window.wp_smushit_data=Object.assign(window.wp_smushit_data,e||{}),i=Object.keys(i).reduce((function(e,t){return t in window.wp_smushit_data&&(e[t]=window.wp_smushit_data[t]),e}),{})};return c(window.wp_smushit_data),{isChangedStats:function(e){return["total_items","processed_items","failed_items","is_cancelled","is_completed"].some((function(t){return e[t]!==n[t]}))},setBoStats:function(e){return n=Object.assign(n,e||{}),this},getBoStats:function(){return n},setGlobalStats:function(e){return i=Object.assign(i,e||{}),this},getGlobalStats:function(){return i},renderScoreProgress:function(){r.className=r.className.replace(/(^|\s)sui-grade-\S+/g,""),r.classList.add(i.percent_grade),r.dataset.score=i.percent_optimized,r.querySelector(".sui-circle-score-label").innerHTML=i.percent_optimized,r.querySelector("circle:last-child").setAttribute("style","--metric-array:"+2.63893782902*i.percent_metric+" "+(263.893782902-i.percent_metric))},renderSummaryDetail:function(){this.renderTotalStats(),this.renderResizedStats(),this.renderConversionSavings()},renderTotalStats:function(){t.querySelector(".sui-summary-large.wp-smush-stats-human").innerHTML=i.human_bytes,t.querySelector(".wp-smush-savings .wp-smush-stats-percent").innerHTML=i.savings_percent,t.querySelector(".wp-smush-count-total .wp-smush-total-optimised").innerHTML=i.count_images},renderResizedStats:function(){var e=t.querySelector(".wp-smush-count-resize-total");e&&(i.count_resize>0?e.classList.remove("sui-hidden"):e.classList.add("sui-hidden"),e.querySelector(".wp-smush-total-optimised").innerHTML=i.count_resize)},renderConversionSavings:function(){var e=t.querySelector(".smush-conversion-savings .wp-smush-stats");e&&(e.innerHTML=i.savings_conversion_human,i.savings_conversion>0?e.parentElement.classList.remove("sui-hidden"):e.parentElement.classList.add("sui-hidden"))},renderBoxSummary:function(){this.renderScoreProgress(),this.renderSummaryDetail()},setErrors:function(e){u=e||{}},getErrors:function(){return u},renderErrors:function(){if(Object.keys(u).length&&n.is_completed){var t=[],i=Object.keys(u),r=!1;i.map((function(e,n){var s=u[e].error_code;n<5&&"animated"===s&&(r=!0),t.push(WP_Smush.helpers.prepareBulkSmushErrorRow(u[e].error_message,u[e].file_name,u[e].thumbnail,e,"media",u[e].error_code))})),o.innerHTML=t.join(""),o.parentElement.classList.remove("sui-hidden"),o.parentElement.style.display=null,i.length>1&&e(".smush-bulk-errors-actions").classList.remove("sui-hidden"),r&&s.maybeShowCDNActivationNotice()}},resetAndHideBulkErrors:function(){o&&(this.resetErrors(),o.parentElement.classList.add("sui-hidden"),o.innerHTML="")},resetErrors:function(){u={}},renderStats:function(){this.renderBoxSummary(),this.renderErrors()},maybeUpdateBulkSmushCountContent:function(e){e&&a&&(a.innerHTML=e)},updateGlobalStatsFromSmushScriptData:function(e){return this.maybeUpdateBulkSmushCountContent(null==e?void 0:e.content),c(e),this}}}()},6033:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return c}});var s=n(4218),i=n(5565),r=n(8283);function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function a(e,t){for(var n=0;n<t.length;n++){var s=t[n];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,(i=s.key,r=void 0,r=function(e,t){if("object"!==o(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var s=n.call(e,t||"default");if("object"!==o(s))return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(i,"string"),"symbol"===o(r)?r:String(r)),s)}var i,r}var u=wp.i18n.__,c=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.autoSyncDuration=1500,this.progressTimeoutId=0,this.scanProgress=(0,i.I)(this.autoSyncDuration)}var t,n,o;return t=e,n=[{key:"startScan",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this.onStart(),s.Z.scanMediaLibrary.start(t).then((function(t){null!=t&&t.success?e.showProgressBar().autoSyncStatus():e.onStartFailure(t)}))}},{key:"onStart",value:function(){}},{key:"onStartFailure",value:function(e){WP_Smush.helpers.showNotice(e,{showdismiss:!0,autoclose:!1})}},{key:"showProgressBar",value:function(){return this.onShowProgressBar(),this.scanProgress.reset().setOnCancelCallback(this.showStopScanningModal.bind(this)).open(),this}},{key:"onShowProgressBar",value:function(){}},{key:"showStopScanningModal",value:function(){window.SUI&&(this.onShowStopScanningModal(),window.SUI.openModal("smush-stop-scanning-dialog","wpbody-content",void 0,!1))}},{key:"onShowStopScanningModal",value:function(){this.registerCancelProcessEvent()}},{key:"registerCancelProcessEvent",value:function(){var e=document.querySelector(".smush-stop-scanning-dialog-button");e&&e.addEventListener("click",this.cancelProgress.bind(this))}},{key:"closeStopScanningModal",value:function(){if(window.SUI){var e=document.querySelector("#smush-stop-scanning-dialog");!e||!e.classList.contains("sui-content-fade-in")||window.SUI.closeModal("smush-stop-scanning-dialog")}}},{key:"closeProgressBar",value:function(){this.onCloseProgressBar(),this.scanProgress.close()}},{key:"onCloseProgressBar",value:function(){}},{key:"updateProgress",value:function(e){var t=this.getTotalItems(e),n=this.getProcessedItems(e);return this.scanProgress.update(n,t)}},{key:"getProcessedItems",value:function(e){return(null==e?void 0:e.processed_items)||0}},{key:"getTotalItems",value:function(e){return(null==e?void 0:e.total_items)||0}},{key:"cancelProgress",value:function(){var e=this;return this.scanProgress.setCancelButtonOnCancelling(),s.Z.scanMediaLibrary.cancel().then((function(t){null!=t&&t.success?e.onCancelled(t.data):e.onCancelFailure(t)}))}},{key:"onCancelFailure",value:function(e){WP_Smush.helpers.showNotice(e,{showdismiss:!0,autoclose:!1}),this.scanProgress.resetCancelButtonOnFailure()}},{key:"getErrorProgressMessage",value:function(){return u("Unfortunately the scan hit an error due to limited resources on your site, we have adjusted the scan to use fewer resources the next time.","wp-smushit")}},{key:"onDead",value:function(e){this.clearProgressTimeout(),this.closeProgressBar(),this.closeStopScanningModal(),this.showRetryScanModal()}},{key:"showRetryScanModal",value:function(){var e=document.getElementById("smush-retry-scan-notice");window.SUI&&e&&(e.querySelector(".smush-retry-scan-notice-button").onclick=function(e){window.SUI.closeModal("smush-retry-scan-notice");var t=document.querySelector(".wp-smush-scan");t&&(e.preventDefault(),t.click())},window.SUI.openModal("smush-retry-scan-notice","wpbody-content",void 0,!1))}},{key:"onCompleted",value:function(e){this.onFinish(e)}},{key:"onCancelled",value:function(e){this.onFinish(e)}},{key:"onFinish",value:function(e){this.clearProgressTimeout();var t=null==e?void 0:e.global_stats;this.updateGlobalStatsAndBulkContent(t),this.closeProgressBar(),this.closeStopScanningModal()}},{key:"clearProgressTimeout",value:function(){this.progressTimeoutId&&clearTimeout(this.progressTimeoutId)}},{key:"updateGlobalStatsAndBulkContent",value:function(e){e&&(r.h.updateGlobalStatsFromSmushScriptData(e),r.h.renderStats())}},{key:"getStatus",value:function(){return s.Z.scanMediaLibrary.getScanStatus()}},{key:"autoSyncStatus",value:function(){var e=this,t=(new Date).getTime();this.getStatus().then((function(n){if(null!=n&&n.success){var s=n.data;s.is_dead?e.onDead(n.data):(e.beforeUpdateStatus(s),e.updateProgress(s).then((function(){e.scanProgress.increaseDurationToHaveChangeOnProgress((new Date).getTime()-t),(null==s?void 0:s.is_completed)?e.onCompleted(s):(null==s?void 0:s.is_cancelled)?e.onCancelled(s):e.progressTimeoutId=setTimeout((function(){return e.autoSyncStatus()}),e.autoSyncDuration)})))}}))}},{key:"beforeUpdateStatus",value:function(){}},{key:"setInnerText",value:function(e,t){e&&(e.dataset.originalText=e.dataset.originalText||e.innerText.trim(),e.innerText=t)}},{key:"revertInnerText",value:function(e){e&&e.dataset.originalText&&(e.innerText=e.dataset.originalText.trim())}},{key:"hideAnElement",value:function(e){e&&e.classList.add("sui-hidden")}},{key:"showAnElement",value:function(e){e&&e.classList.remove("sui-hidden")}}],n&&a(t.prototype,n),o&&a(t,o),Object.defineProperty(t,"prototype",{writable:!1}),e}()},5565:function(e,t,n){"use strict";n.d(t,{I:function(){return s}});var s=function(e){var t,n=wp.i18n,s=n.__,i=n._n,r=document.querySelector(".wp-smush-scan-progress-bar-wrapper"),o=r.querySelector(".wp-smush-progress-percent"),a=r.querySelector(".wp-smush-progress-inner"),u=r.querySelector(".wp-smush-remaining-time"),c=r.querySelector(".wp-smush-cancel-scan-progress-btn"),l=r.querySelector(".wp-smush-scan-hold-on-notice"),d=function(){},h=0,p=e-300;r.style.setProperty("--progress-transition-duration",p/1e3+"s");var f=(null===(t=window.wp_smushit_data)||void 0===t||null===(t=t.media_library_scan)||void 0===t?void 0:t.processed_items)||0,m=[],_=e,g=10*e;return{update:function(e,t){this.updateRemainingTime(e,t);var n=t&&Math.floor(e/t*100)||0;n=Math.min(n,100);var s=a.style.width;return s=s&&s.replace("%","")||0,a.style.width=n+"%",this.animateProgressBar(s,n)},animateProgressBar:function(e,t){return h&&clearInterval(h),new Promise((function(n){h=setInterval((function(){o.innerHTML=e+"%",++e>t&&(n(),clearInterval(h))}),p/(t-e))}))},updateRemainingTime:function(e,t){if(u){var n=(this.calcProcessTimePerItem(e)||500)*(t-e);u.innerText=this.formatTime(n)}},calcProcessTimePerItem:function(t){if(t){if((f=f<=t?f:0)!=t){var n=Math.floor(_/(t-f));f=t,m.push(n),this.resetDurationToHaveChangeOnProgress()}else this.increaseDurationToHaveChangeOnProgress(e);if(m.length)return m.reduce((function(e,t){return e+t}),0)/m.length}},increaseDurationToHaveChangeOnProgress:function(e){(_+=e)>g&&this.showHoldOnNotice()},showHoldOnNotice:function(){l.classList.remove("sui-hidden"),g=1e8},resetHoldOnNoticeVisibility:function(){l.classList.add("sui-hidden")},resetDurationToHaveChangeOnProgress:function(){_=e},formatTime:function(e){var t=Math.floor((e+p)/1e3),n=t%60,s=Math.floor(t/60),r="";return s&&(r+=s+" "+i("minute","minutes",s,"wp-smushit")),(r+=" "+n+" "+i("second","seconds",n,"wp-smushit")).trim()},reset:function(){return a.style.width="0%",o.innerHTML="0%",this.resetCancelButton(),this.resetHoldOnNoticeVisibility(),this},open:function(){c.onclick=d,r.classList.remove("sui-hidden")},close:function(){r.classList.add("sui-hidden"),this.reset()},setOnCancelCallback:function(e){if("function"==typeof e)return d=e,this},setCancelButtonLabel:function(e){return c.textContent=e,this},setCancelButtonOnCancelling:function(){this.setCancelButtonLabel(wp_smush_msgs.cancelling),this.setOnCancelCallback((function(){return!1})),c.setAttribute("disabled",!0)},resetCancelButton:function(){this.setOnCancelCallback((function(){})),this.resetCancelButtonLabel(),c.removeAttribute("disabled")},resetCancelButtonLabel:function(){this.setCancelButtonLabel(s("Cancel Scan","wp-smushit"))},resetCancelButtonOnFailure:function(){this.resetCancelButtonLabel(),c.removeAttribute("disabled")}}};t.Z=new function(){var e=document.querySelector(".wp-smush-bulk-progress-bar-wrapper");if(!e)return{isEmptyObject:!0};var t=e.querySelector(".wp-smush-cancel-btn"),n=document.querySelector(".wp-smush-bulk-wrapper"),s=e.querySelector("#wp-smush-running-notice"),i=document.querySelector(".wp-smush-all-done"),r=!1,o=function(){};return{update:function(t,n){var s=n&&Math.floor(t/n*100)||0;s=Math.min(s,100),e.querySelector(".wp-smush-images-percent").innerHTML=s+"%",e.querySelector(".wp-smush-progress-inner").style.width=s+"%";var i=e.querySelector(".sui-progress-state-text");return i.firstElementChild.innerHTML=t,i.lastElementChild.innerHTML=n,this},close:function(){return e.classList.add("sui-hidden"),this.setCancelButtonLabel(window.wp_smush_msgs.cancel).setOnCancelCallback((function(){})).update(0,0),this.resetOriginalNotice(),this},show:function(){t.onclick=o,e.classList.remove("sui-hidden"),this.hideBulkSmushDescription(),this.hideBulkSmushAllDone(),this.hideRecheckImagesNotice()},setCancelButtonLabel:function(e){return t.textContent=e,this},showBulkSmushDescription:function(){n.classList.remove("sui-hidden")},hideBulkSmushDescription:function(){n.classList.add("sui-hidden")},showBulkSmushAllDone:function(){i.classList.remove("sui-hidden")},hideBulkSmushAllDone:function(){i.classList.add("sui-hidden")},hideState:function(){return r||(r=!0,e.querySelector(".sui-progress-state").classList.add("sui-hidden")),this},showState:function(){return r?(r=!1,e.querySelector(".sui-progress-state").classList.remove("sui-hidden"),this):this},setNotice:function(e){var t=s.querySelector(".sui-notice-message p");return this.cacheOriginalNotice(t),t.innerHTML=e,this},cacheOriginalNotice:function(e){s.dataset.progressMessage||(s.dataset.progressMessage=e.innerHTML)},resetOriginalNotice:function(){s.dataset.progressMessage&&(s.querySelector(".sui-notice-message p").innerHTML=s.dataset.progressMessage)},hideBulkProcessingNotice:function(){return s.classList.add("sui-hidden"),this},showBulkProcessingNotice:function(){return s.classList.remove("sui-hidden"),this},setCountUnitText:function(t){e.querySelector(".sui-progress-state-unit").innerHTML=t},setOnCancelCallback:function(e){if("function"==typeof e)return o=e,this},disableExceedLimitMode:function(){e.classList.remove("wp-smush-exceed-limit"),e.querySelector("#bulk-smush-resume-button").classList.add("sui-hidden")},hideRecheckImagesNotice:function(){var e=document.querySelector(".wp-smush-recheck-images-notice-box");e&&e.classList.add("sui-hidden")}}}},9576:function(e,t,n){"use strict";var s=n(8891),i=n.n(s);function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(e,t){for(var n=0;n<t.length;n++){var s=t[n];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,(i=s.key,o=void 0,o=function(e,t){if("object"!==r(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var s=n.call(e,t||"default");if("object"!==r(s))return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(i,"string"),"symbol"===r(o)?o:String(o)),s)}var i,o}var a,u=function(){function e(){var t=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.mixpanelInstance=this.allowToTrack()&&i().init(wp_smush_mixpanel.token,{opt_out_tracking_by_default:!this.allowToTrack(),loaded:function(e){e.identify(wp_smush_mixpanel.unique_id),e.register(wp_smush_mixpanel.super_properties),e.has_opted_in_tracking()!==t.allowToTrack()&&e.clear_opt_in_out_tracking()}},"smush")}var t,n,s;return t=e,n=[{key:"allowToTrack",value:function(){return!!wp_smush_mixpanel.opt_in}},{key:"track",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};wp_smush_mixpanel.debug&&console.log("Event:",e,t),this.mixpanelInstance&&this.mixpanelInstance.track(e,t)}},{key:"trackBulkSmushCompleted",value:function(e){var t=e.savings_bytes,n=e.count_images,s=e.percent_optimized,i=e.savings_percent,r=e.count_resize,o=e.savings_resize;this.track("Bulk Smush Completed",{"Total Savings":this.convertToMegabytes(t),"Total Images":n,"Media Optimization Percentage":parseFloat(s),"Percentage of Savings":parseFloat(i),"Images Resized":r,"Resize Savings":this.convertToMegabytes(o)})}},{key:"trackBulkSmushCancel",value:function(){this.track("Bulk Smush Cancelled")}},{key:"convertToMegabytes",value:function(e){var t=e/Math.pow(1024,2);return t&&parseFloat(t.toFixed(2))||0}}],n&&o(t.prototype,n),s&&o(t,s),Object.defineProperty(t,"prototype",{writable:!1}),e}();t.Z={getInstance:function(){return a||(a=new u),a}}},9478:function(){jQuery((function(e){"use strict";e("body").on("click","a.smush-stats-details",(function(t){if(e(this).prop("disabled"))return!1;t.preventDefault();var n=e(this).find(".stats-toggle");e(this).parents().eq(1).find(".smush-stats-wrapper").slideToggle(),n.text("+"==n.text()?"-":"+")}))}))},6111:function(e,t,n){"use strict";n.r(t);var s=n(9446),i=n(8283),r=n(5565),o=function(e,t){void 0===t&&(t=100),e.fadeTo(t,0,(function(){e.slideUp(t,(function(){e.remove()}))}))};jQuery((function(e){var t=function(t,n,i,r){if(t.preventDefault(),!n.attr("disabled")){e(".wp-smush-error").remove(),e(".smush-stats-wrapper").hide();var o="grid";"smush_restore_image"===i&&(o=e(document).find("div.media-modal.wp-core-ui").length>0||window.location.search.indexOf("item")>-1?"grid":"list");var a={action:i,attachment_id:n.data("id"),mode:o,_nonce:n.data("nonce")};!function(e){var t=e.parent();t.css({opacity:"0.5"}),t.find("a").prop("disabled",!0)}(n);var u=n.html();n.html('<span class="spinner wp-smush-progress">'+wp_smush_msgs[r]+"</span>"),e.post(ajaxurl,a,(function(e){if(function(e){var t=e.parent();t.css({opacity:"1"}),t.find("a").prop("disabled",!1)}(n),e.success&&void 0!==e.data){if(void 0!==this.data&&this.data.indexOf("nextgen")>-1)n.parents().eq(1).html(e.data.stats);else if("restore"===r)n.parents().eq(1).html(e.data.stats);else{var t=n.parents().eq(1);wp_smush_msgs.failed_item_smushed&&t.hasClass("smush-failed-processing")?(t.html('<p class="smush-status smush-success">'+wp_smush_msgs.failed_item_smushed+"</p>"),setTimeout((function(){t.html(e.data)}),2e3)):t.html(e.data)}void 0!==e.data&&"restore"===r&&s.Z.updateImageStats(e.data.new_size)}else e.data&&e.data.error_msg&&(-1===this.data.indexOf("nextgen")?n.closest(".smushit").find(".smush-status").addClass("smush-warning").html(e.data.error_msg):n.parent().append(e.data.error_msg),n.attr("disabled",!0),n.html(u))}))}},n=function(e){if(e.notice){var t="success";void 0!==e.noticeType&&(t=e.noticeType),window.SUI.openNotice("wp-smush-ajax-notice","<p>"+e.notice+"</p>",{type:t,icon:"check-tick"})}},a=function(e){r.Z.isEmptyObject||(r.Z.update(0,e.remaining_count),e.remaining_count<1?(r.Z.hideBulkSmushDescription(),r.Z.showBulkSmushAllDone()):(r.Z.showBulkSmushDescription(),r.Z.hideBulkSmushAllDone()))},u=function(t){e(t).length>0&&e("html, body").animate({scrollTop:e(t).offset().top-100},"slow")};if(e("#all-image-sizes").on("change",(function(){e('input[name^="wp-smush-image_sizes"]').prop("checked",!0)})),e(".sui-mobile-nav").on("change",(function(t){window.location.assign(e(t.currentTarget).val())})),e("#update-api-status").on("click",(function(t){t.preventDefault(),e(this).addClass("sui-button-onload"),e.post(ajaxurl,{action:"recheck_api_status"},(function(){location.reload()}))})),e("body").on("click",".wp-smush-send:not(.wp-smush-resmush)",(function(t){t.preventDefault(),new s.Z(e(this),!1)})),e("body").on("click",".wp-smush-remove-skipped",(function(t){t.preventDefault();var n=e(this);e.post(ajaxurl,{action:"remove_from_skip_list",id:n.attr("data-id"),_ajax_nonce:n.attr("data-nonce")}).done((function(e){e.success&&void 0!==e.data.html&&n.parent().parent().html(e.data.html)}))})),e("body").on("click",".wp-smush-action.wp-smush-restore",(function(n){var s=e(this);t(n,s,"smush_restore_image","restore")})),e("body").on("click",".wp-smush-action.wp-smush-resmush",(function(n){t(n,e(this),"smush_resmush_image","smushing")})),e("body").on("click",".wp-smush-action.wp-smush-nextgen-restore",(function(n){t(n,e(this),"smush_restore_nextgen_image","restore")})),e("body").on("click",".wp-smush-action.wp-smush-nextgen-resmush",(function(n){t(n,e(this),"smush_resmush_nextgen_image","smushing")})),e(".wp-smush-scan").on("click",(function(t){t.preventDefault(),e(this).hasClass("wp-smush-background-scan")||function(t){var s=e(".wp-smush-scan");s.addClass("sui-button-onload");var r=s.data("type");r=void 0===r?"media":r,e(".wp-smush-all").removeAttr("data-smush"),e(".wp-smush-all").prop("disabled",!0),e(".wp-smush-settings-changed").hide();var o={action:"scan_for_resmush",type:r,get_ui:!0,process_settings:t,wp_smush_options_nonce:jQuery("#wp_smush_options_nonce").val()};e.get(ajaxurl,o,(function(e){if(null!=e&&e.success){var t=e.data;n(t),i.h.updateGlobalStatsFromSmushScriptData(t),i.h.renderStats(),a(t)}else WP_Smush.helpers.showNotice(e,{showdismiss:!0,autoclose:!1})})).always((function(){jQuery(".bulk-smush-wrapper .wp-smush-bulk-progress-bar-wrapper").addClass("sui-hidden"),s.removeClass("sui-button-onload").addClass("smush-button-check-success");var t=s.find(".wp-smush-default-text"),n=s.find(".wp-smush-completed-text");t.addClass("sui-hidden-important"),n.removeClass("sui-hidden"),setTimeout((function(){s.removeClass("smush-button-check-success"),t.removeClass("sui-hidden-important"),n.addClass("sui-hidden")}),2e3),e(".wp-smush-all").prop("disabled",!1)}))}(!1)})),e("body").on("click",".wp-smush-notice .icon-fi-close",(function(t){t.preventDefault();var n=e(this).parent();o(n)})),e("body").on("click",".wp-smush-skip-resmush",(function(t){t.preventDefault();var n=jQuery(this),i=n.parents().eq(1),r=n.parent();o(r),i.find(".wp-smush-all").attr("data-smush","skip_resmush"),wp_smushit_data.count_smushed=parseInt(wp_smushit_data.count_smushed)+wp_smushit_data.resmush.length,wp_smushit_data.count_supersmushed=parseInt(wp_smushit_data.count_supersmushed)+wp_smushit_data.resmush.length,wp_smushit_data.count_smushed===wp_smushit_data.count_total&&(e(".wp-smush-notice.wp-smush-all-done").removeClass("sui-hidden"),e(".wp-smush-bulk-wrapper ").addClass("sui-hidden")),e(".wp-smush-resmush-notice").remove();var a=e(".wp-smush-scan").data("type");a=void 0===a?"media":a;var u=(void 0!==wp_smushit_data.count_smushed?wp_smushit_data.count_smushed:0)/wp_smushit_data.count_total*100;u=WP_Smush.helpers.precise_round(u,1),e(".wp-smush-images-percent").html(u);var c=jQuery(".bulk-smush-wrapper .wp-smush-progress-inner");if(!(c.length<1)){c.css("width",u+"%"),e(".wp-smush-bulk-wrapper").removeClass("sui-hidden"),e(".wp-smush-bulk-wrapper .sui-notice").removeClass("sui-hidden");var l={action:"delete_resmush_list",type:a};e.post(ajaxurl,l,(function(t){if(t.success&&void 0!==t.data.stats){var n=t.data.stats;"undefined"!=typeof wp_smushit_data&&(wp_smushit_data.count_images=void 0!==n.count_images?parseInt(wp_smushit_data.count_images)+n.count_images:wp_smushit_data.count_images,wp_smushit_data.size_before=void 0!==n.size_before?parseInt(wp_smushit_data.size_before)+n.size_before:wp_smushit_data.size_before,wp_smushit_data.size_after=void 0!==n.size_after?parseInt(wp_smushit_data.size_after)+n.size_after:wp_smushit_data.size_after,wp_smushit_data.savings_resize=void 0!==n.savings_resize?parseInt(wp_smushit_data.savings_resize)+n.savings_resize:wp_smushit_data.savings_resize,wp_smushit_data.savings_conversion=void 0!==n.savings_conversion?parseInt(wp_smushit_data.savings_conversion)+n.savings_conversion:wp_smushit_data.savings_conversion,void 0!==wp_smushit_data.savings_dir_smush&&void 0!==wp_smushit_data.savings_dir_smush.orig_size&&(wp_smushit_data.size_before=void 0!==wp_smushit_data.savings_dir_smush?parseInt(wp_smushit_data.size_before)+parseInt(wp_smushit_data.savings_dir_smush.orig_size):wp_smushit_data.size_before,wp_smushit_data.size_after=void 0!==wp_smushit_data.savings_dir_smush?parseInt(wp_smushit_data.size_after)+parseInt(wp_smushit_data.savings_dir_smush.image_size):wp_smushit_data.size_after),wp_smushit_data.count_resize=void 0!==n.count_resize?parseInt(wp_smushit_data.count_resize)+n.count_resize:wp_smushit_data.count_resize),void 0===wp_smushit_data.unsmushed&&0!==wp_smushit_data.unsmushed.length||(e(".wp-smush-bulk-wrapper .sui-notice").removeClass("sui-hidden"),e(".sui-notice-success.wp-smush-all-done").addClass("sui-hidden")),s.Z.updateStats()}}))}})),e("a.wp-smush-lossy-enable").on("click",(function(e){e.preventDefault(),u("#column-lossy")})),e(".wp-smush-resize-enable").on("click",(function(e){e.preventDefault(),u("#column-resize")})),window.location.hash){var c="";switch(window.location.hash.substring(1)){case"enable-resize":c="#column-resize";break;case"backup-label":c="#backup";break;case"original-label":c="#original";break;case"enable-lossy":c="#column-lossy"}""!==c&&(u(c),document.getElementById(c.replace("#","")).focus())}if(e("body").on("click",".wp-smush-trigger-bulk",(function(t){t.preventDefault(),void 0!==t.target.dataset.type&&"nextgen"===t.target.dataset.type?e(".wp-smush-nextgen-bulk").trigger("click"):e(".wp-smush-all").trigger("click"),e("span.sui-notice-dismiss").trigger("click")})),e("body").on("click","#bulk-smush-top-notice-close",(function(t){t.preventDefault(),e(this).parent().parent().slideUp("slow")})),e(".wp-smush-setting-row .toggle-checkbox").on("focus",(function(){e(this).keypress((function(t){32==t.keyCode&&(t.preventDefault(),e(this).find(".toggle-checkbox").trigger("click"))}))})),e("body").on("blur",".wp-smush-resize-input",(function(){!function(e,t,n){var s=e.find("#resize");if(!n)var i=e.find("#wp-smush-resize_width"),r=e.find(".sui-notice-info.wp-smush-update-width");if(!t)var o=e.find("#wp-smush-resize_height"),a=e.find(".sui-notice-info.wp-smush-update-height");var u=!1,c=!1;!s.is(":checked")||void 0===wp_smushit_data.resize_sizes||void 0===wp_smushit_data.resize_sizes.width||(!n&&void 0!==i&&parseInt(wp_smushit_data.resize_sizes.width)>parseInt(i.val())?(i.parent().addClass("sui-form-field-error"),r.show("slow"),u=!0):(i.parent().removeClass("sui-form-field-error"),r.hide(),o.hasClass("error")&&a.show("slow")),!t&&void 0!==o&&parseInt(wp_smushit_data.resize_sizes.height)>parseInt(o.val())?(o.parent().addClass("sui-form-field-error"),u||a.show("slow"),c=!0):(o.parent().removeClass("sui-form-field-error"),a.hide(),i.hasClass("error")&&r.show("slow")))}(e(this).parents().eq(4),!1,!1)})),e("body").on("click","#resize",(function(){var t=e(this),n=e("#smush-resize-settings-wrap");t.is(":checked")?n.show():n.hide()})),e("#wp-smush-revalidate-member").on("click",(function(t){t.preventDefault();var n={action:"smush_show_warning",_ajax_nonce:window.wp_smush_msgs.nonce},s=e(this).parents().eq(1);s.addClass("loading-notice"),e.get(ajaxurl,n,(function(e){s.removeClass("loading-notice").addClass("loaded-notice"),0==e?(s.attr("data-message",wp_smush_msgs.membership_valid),o(s,1e3)):(s.attr("data-message",wp_smush_msgs.membership_invalid),setTimeout((function(){s.removeClass("loaded-notice")}),1e3))}))})),e("li.smush-dir-savings").length>0){var l={action:"get_dir_smush_stats",_ajax_nonce:window.wp_smush_msgs.nonce};e.get(ajaxurl,l,(function(t){e("li.smush-dir-savings .sui-icon-loader").hide(),t.success||void 0===t.data.message?void 0===t.data||void 0===t.data.dir_smush?(e("li.smush-dir-savings span.wp-smush-stats").append(wp_smush_msgs.ajax_error),e("li.smush-dir-savings span.wp-smush-stats span").hide()):function(t){if(void 0!==t.dir_smush){var n=e("li.smush-dir-savings span.wp-smush-stats span.wp-smush-stats-human"),s=e("li.smush-dir-savings span.wp-smush-stats span.wp-smush-stats-percent");t.dir_smush.bytes>0?(e(".wp-smush-dir-link").addClass("sui-hidden"),e("li.smush-dir-savings .wp-smush-stats-label-message").hide(),n.length>0&&n.html(t.dir_smush.human),t.dir_smush.percent>0&&(e("li.smush-dir-savings span.wp-smush-stats span.wp-smush-stats-sep").removeClass("sui-hidden"),s.length>0&&s.html(t.dir_smush.percent+"%"))):e(".wp-smush-dir-link").removeClass("sui-hidden")}if(void 0!==t.combined_stats&&t.combined_stats.length>0){var i=t.combined_stats,r=i.smushed/i.total_count*100;(r=WP_Smush.helpers.precise_round(r,1))&&e("div.wp-smush-count-total span.wp-smush-images-percent").html(r),i.total_count&&e("span.wp-smush-count-total span.wp-smush-total-optimised").html(i.total_count),i.savings&&e("span.wp-smush-savings span.wp-smush-stats-human").html(i.savings),i.percent&&e("span.wp-smush-savings span.wp-smush-stats-percent").html(i.percent)}}(t.data):e("div.wp-smush-scan-result div.content").prepend(t.data.message)}))}e("#smush-updated-dialog").length&&window.SUI.openModal("smush-updated-dialog","wpbody-content",void 0,!1),e("input#original").on("change",(function(){e("#backup-notice").toggleClass("sui-hidden",e(this).is(":checked"))}));!function(){var e=document.querySelector(".wp-smush-compression-type");if(e){var t=e.querySelector(".wp-smush-compression-type_note p");t&&e.querySelector(".wp-smush-compression-type_slider").addEventListener("change",(function(e){var n,s;if("INPUT"===(null==e||null===(n=e.target)||void 0===n?void 0:n.nodeName)){var i=null===(s=e.target.dataset)||void 0===s?void 0:s.note;i&&(t.innerHTML=i.trim())}}))}}(),e(".wp-smush-modal-link-close").on("click",(function(t){t.preventDefault(),SUI.closeModal();var n=e(this).attr("href"),s="_blank"===e(this).attr("target");n&&(s?window.open(n,"_blank"):window.location.href=n)}));document.addEventListener("onSavedSmushSettings",(function(e){var t;null!=e&&null!==(t=e.detail)&&void 0!==t&&t.is_outdated_stats&&function(){var e=document.querySelector(".wp-smush-current-compression-level"),t=document.querySelector(".wp-smush-lossy-level-tabs button.active");if(e&&t){e.innerText=t.innerText.trim();var n=e.nextElementSibling;n&&(t.id.includes("ultra")?n.classList.add("sui-hidden"):n.classList.remove("sui-hidden"))}}()}))}))},9867:function(e,t,n){"use strict";n.r(t);var s=n(4218),i=n(9576),r=n(5565),o=n(8283),a=["global_stats","errors"];function u(e,t){if(null==e)return{};var n,s,i=function(e,t){if(null==e)return{};var n,s,i={},r=Object.keys(e);for(s=0;s<r.length;s++)n=r[s],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(s=0;s<r.length;s++)n=r[s],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}!function(){if(window.wp_smush_msgs){var e=document.querySelector.bind(document),t=function(){return{handle:function(e){return s.Z.background[e]()},initState:function(){return s.Z.background.initState()}}},n=function(){var n=window.wp_smushit_data&&window.wp_smushit_data.bo_stats&&e(".wp-smush-bo-start");if(n){var s=i.Z.getInstance(),c=new t,l=e(".bulk-smush-wrapper"),d=e(".wp-smush-scan"),h=0,p=!1;return{hookStatusChecks:function(){var e=this;if(!h){var t=0,n=!1,s=!1;h=setInterval((function(){if(!n){n=!0,t++;var i=e.syncBackgroundStatus();t%3==0&&i.then((function(){s||(e.syncStats().then((function(){s=!1})),s=!0)})),i.finally((function(){n=!1}))}}),3e3)}},resetBOStatsOnStart:function(){o.h.setBoStats({is_cancelled:!1,is_completed:!1,processed_items:0,failed_items:0})},start:function(){var e=this;this.resetBOStatsOnStart(),this.onStart(),c.handle("start").then((function(t){if(t.success){var n=e.updateStats(t.data,!1);e.showProgressBar(),e.hookStatusChecks(),n&&o.h.renderStats()}else WP_Smush.helpers.showNotice(t,{showdismiss:!0,autoclose:!1}),e.cancelBulk()}))},initState:function(){var e=this;o.h.getBoStats().in_processing&&(this.onStart(),c.initState().then((function(t){t.success?(e.updateStats(t.data,!1),e.showProgressBar(),e.hookStatusChecks(),t.data.errors&&!Object.keys(o.h.getErrors()).length&&o.h.setErrors(t.data.errors),o.h.renderStats()):WP_Smush.helpers.showNotice(t)})))},cancel:function(){var e=this;p=!0,this.setCancelButtonStateToStarted(),c.handle("cancel").then((function(t){t.success?e.cancelBulk():WP_Smush.helpers.showNotice(t)}))},hideProgressBar:function(){r.Z.close().update(0,o.h.getBoStats().total_items)},showProgressBar:function(){r.Z.update(o.h.getBoStats().processed_items,o.h.getBoStats().total_items),r.Z.show()},updateStats:function(e,t){e.global_stats=e.global_stats||{},e.errors=e.errors||{};var n=e.global_stats,s=e.errors,i=u(e,a);return!!o.h.isChangedStats(i)&&(o.h.setBoStats(i),t&&o.h.setGlobalStats(n),o.h.setErrors(s),!0)},cancelBulk:function(){var e=this;this.syncStats((function(){100===o.h.getGlobalStats().percent_optimized?(o.h.setBoStats({is_completed:!0}),e.onCompletedBulk()):(o.h.setBoStats({is_cancelled:!0}),e.onFinish(),r.Z.showBulkSmushDescription()),s.trackBulkSmushCancel(),p=!1}))},showCompletedMessage:function(){var e=l.querySelector(".wp-smush-all-done");if(o.h.getBoStats().failed_items){var t=wp_smush_msgs.all_failed;this.isFailedAllItems()||(t=wp_smush_msgs.error_in_bulk.replace("{{smushed}}",o.h.getBoStats().total_items-o.h.getBoStats().failed_items).replace("{{total}}",o.h.getBoStats().total_items).replace("{{errors}}",o.h.getBoStats().failed_items)),e.querySelector("p").innerHTML=t,e.classList.remove("sui-notice-success","sui-notice-warning");var n=this.getNoticeType(),s="warning"===n?"info":"check-tick",i=e.querySelector(".sui-notice-icon");e.classList.add("sui-notice-"+n),i.classList.remove("sui-icon-check-tick","sui-icon-info"),i.classList.add("sui-icon-"+s)}else e.querySelector("p").innerHTML=wp_smush_msgs.all_smushed;e.classList.remove("sui-hidden")},isFailedAllItems:function(){return o.h.getBoStats().failed_items===o.h.getBoStats().total_items},getNoticeType:function(){return this.isFailedAllItems()?"warning":"success"},onCompletedBulk:function(){this.onFinish(),r.Z.hideBulkSmushDescription(),this.showCompletedMessage(),r.Z.update(0,o.h.getBoStats().total_items)},completeBulk:function(){var e=this;this.syncStats((function(){return e.onCompletedBulk()}))},syncStats:function(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){return!1};return c.handle("getStats").then((function(s){if(s.success){var i=s.data.errors||{};t.updateStats({global_stats:s.data,errors:i},!0),o.h.renderStats(),s.data.content&&(e("#wp-smush-bulk-content").innerHTML=s.data.content),n()}else WP_Smush.helpers.showNotice(s)})).catch((function(e){return console.log("error",e)}))},syncBackgroundStatus:function(){var e=this;return c.handle("getStatus").then((function(t){(t.data||{}).in_process_notice&&r.Z.setNotice(t.data.in_process_notice),t.success?(e.updateStats(t.data,!1)&&(r.Z.update(o.h.getBoStats().processed_items,o.h.getBoStats().total_items),o.h.getBoStats().is_cancelled||o.h.getBoStats().is_completed||o.h.renderStats()),o.h.getBoStats().is_cancelled&&!p?e.cancelBulk():o.h.getBoStats().is_completed&&e.completeBulk()):WP_Smush.helpers.showNotice(t)}))},onStart:function(){n.setAttribute("disabled",""),d&&d.setAttribute("disabled",""),e(".wp-smush-restore").setAttribute("disabled",""),o.O.maybeShowCDNUpsellForPreSiteOnStart(),this.setCancelButtonStateToInitial()},onFinish:function(){h&&(clearInterval(h),h=0),n.removeAttribute("disabled"),this.hideProgressBar(),d&&d.removeAttribute("disabled",""),e(".wp-smush-restore").removeAttribute("disabled",""),o.O.maybeShowCDNUpsellForPreSiteOnCompleted()},init:function(){var e=this;n&&(n.onclick=function(){n.classList.contains("wp-smush-scan-and-bulk-smush")||e.start()},this.initState())},setCancelButtonStateToInitial:function(){r.Z.setCancelButtonLabel(wp_smush_msgs.cancel),r.Z.setOnCancelCallback(this.cancel.bind(this))},setCancelButtonStateToStarted:function(){r.Z.setCancelButtonLabel(wp_smush_msgs.cancelling),r.Z.setOnCancelCallback((function(){return!1}))}}}}();n&&n.init(),document.addEventListener("wpSmushAfterRecheckImages",(function(){o.h.updateGlobalStatsFromSmushScriptData()})),document.addEventListener("backgroundBulkSmushOnScanCompleted",(function(){n&&(o.h.setBoStats({in_processing:!0}),n.initState())}))}}()},7447:function(e,t,n){"use strict";n.r(t);var s=n(9576);WP_Smush.restore={modal:document.getElementById("smush-restore-images-dialog"),contentContainer:document.getElementById("smush-bulk-restore-content"),settings:{slide:"start",success:0,errors:[]},items:[],success:[],errors:[],currentStep:0,totalSteps:0,init:function(){this.modal&&(this.settings={slide:"start",success:0,errors:[]},this.mixPanel=s.Z.getInstance(),this.resetModalWidth(),this.renderTemplate(),window.SUI.openModal("smush-restore-images-dialog","wpbody-content",void 0,!1))},renderTemplate:function(){var e=WP_Smush.onboarding.template("smush-bulk-restore")(this.settings);e&&(this.contentContainer.innerHTML=e),this.bindSubmit()},resetModalWidth:function(){this.modal.style.maxWidth="460px",this.modal.querySelector(".sui-box").style.maxWidth="460px"},bindSubmit:function(){var e=this.modal.querySelector('button[id="smush-bulk-restore-button"]'),t=this;e&&e.addEventListener("click",(function(e){e.preventDefault(),t.resetModalWidth(),t.settings={slide:"progress"},t.errors=[],t.renderTemplate(),t.initScan(),t.mixPanel.track("Bulk Restore Triggered")}))},cancel:function(){"start"===this.settings.slide||"finish"===this.settings.slide?window.SUI.closeModal():(this.updateProgressBar(!0),window.location.reload())},updateProgressBar:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=0;0<this.currentStep&&(t=Math.min(Math.round(100*this.currentStep/this.totalSteps),99)),t>100&&(t=100),this.modal.querySelector(".sui-progress-text span").innerHTML=t+"%",this.modal.querySelector(".sui-progress-bar span").style.width=t+"%";var n=this.modal.querySelector(".sui-progress-state-text");n.innerHTML=t>=90?"Finalizing...":e?"Cancelling...":this.currentStep+"/"+this.totalSteps+" images restored"},initScan:function(){var e=this,t=document.getElementById("_wpnonce"),n=new XMLHttpRequest;n.open("POST",ajaxurl+"?action=get_image_count",!0),n.setRequestHeader("Content-type","application/x-www-form-urlencoded"),n.onload=function(){if(200===n.status){var t=JSON.parse(n.response);void 0!==t.data.items&&(e.items=t.data.items,e.totalSteps=t.data.items.length,e.step())}else window.console.log("Request failed. Returned status of "+n.status)},n.send("_ajax_nonce="+t.value)},step:function(){var e=this,t=this,n=document.getElementById("_wpnonce");if(0<this.items.length){var s=this.items.pop(),i=new XMLHttpRequest;i.open("POST",ajaxurl+"?action=restore_step",!0),i.setRequestHeader("Content-type","application/x-www-form-urlencoded"),i.onload=function(){if(e.currentStep++,200===i.status){var n=(JSON.parse(i.response)||{}).data||{};n.success?t.success.push(s):t.errors.push({id:s,src:n.src||"Error",thumb:n.thumb,link:n.link})}t.updateProgressBar(),t.step()},i.send("item="+s+"&_ajax_nonce="+n.value)}else this.settings={slide:"finish",success:this.success.length,errors:this.errors,total:this.totalSteps},t.renderTemplate(),0<this.errors.length&&(this.modal.style.maxWidth="660px",this.modal.querySelector(".sui-box").style.maxWidth="660px")}},WP_Smush.restore.template=_.memoize((function(e){var t,n={evaluate:/<#([\s\S]+?)#>/g,interpolate:/{{{([\s\S]+?)}}}/g,escape:/{{([^}]+?)}}(?!})/g,variable:"data"};return function(s){return _.templateSettings=n,(t=t||_.template(document.getElementById(e).innerHTML))(s)}}))},7413:function(e,t,n){"use strict";n.r(t);var s,i=n(9446),r=n(4218),o=n(5565);s=jQuery,WP_Smush.bulk={init:function(){this.onClickBulkSmushNow(),this.onClickIgnoreImage(),this.onClickIgnoreAllImages(),this.onScanCompleted()},onClickBulkSmushNow:function(){s(".wp-smush-all").on("click",(function(e){var t=s(this);t.hasClass("wp-smush-scan-and-bulk-smush")||(e.preventDefault(),WP_Smush.bulk.ajaxBulkSmushStart(t))}))},ajaxBulkSmushStart:function(e){var t=this;if(e=e||s("#wp-smush-bulk-content .wp-smush-all"),void 0===window.wp_smushit_data||0===window.wp_smushit_data.unsmushed.length&&0===window.wp_smushit_data.resmush.length)return!1;s(".wp-resmush.wp-smush-action, .wp-smush-scan, .wp-smush-all:not(.sui-progress-close), a.wp-smush-lossy-enable, button.wp-smush-resize-enable, button#save-settings-button").prop("disabled",!0),e.hasClass("wp-smush-resume-bulk-smush")&&this.bulkSmush?this.resumeBulkSmush():(this.bulkSmush=new i.Z(e,!0),o.Z.setOnCancelCallback((function(){t.bulkSmush.cancelAjax()})).update(0,this.bulkSmush.ids.length).show(),this.maybeShowCDNUpsellForPreSiteOnStart(),this.bulkSmush.run())},resumeBulkSmush:function(){o.Z.disableExceedLimitMode(),o.Z.hideBulkSmushDescription(),this.bulkSmush.onStart(),this.bulkSmush.callAjax()},onClickIgnoreImage:function(){s("body").on("click",".smush-ignore-image",(function(e){e.preventDefault();var t=s(this);t.prop("disabled",!0),t.attr("data-tooltip"),t.removeClass("sui-tooltip"),s.post(ajaxurl,{action:"ignore_bulk_image",id:t.attr("data-id"),_ajax_nonce:wp_smush_msgs.nonce}).done((function(n){t.is("a")&&n.success&&void 0!==n.data.html&&(t.closest(".smush-status-links")?t.closest(".smush-status-links").parent().html(n.data.html):e.target.closest(".smush-bulk-error-row")&&(t.addClass("disabled"),e.target.closest(".smush-bulk-error-row").style.opacity=.5))}))}))},onClickIgnoreAllImages:function(){var e=document.querySelector(".wp_smush_ignore_all_failed_items");e&&(e.onclick=function(e){e.preventDefault(),e.target.setAttribute("disabled",""),e.target.style.cursor="progress";var t=e.target.dataset.type||null;e.target.classList.remove("sui-tooltip"),r.Z.smush.ignoreAll(t).then((function(t){t.success?window.location.reload():(e.target.style.cursor="pointer",e.target.removeAttribute("disabled"),WP_Smush.helpers.showNotice(t))}))})},onScanCompleted:function(){var e=this;document.addEventListener("ajaxBulkSmushOnScanCompleted",(function(t){e.ajaxBulkSmushStart()}))},maybeShowCDNUpsellForPreSiteOnStart:function(){var e=document.querySelector(".wp-smush-upsell-cdn");e&&e.classList.remove("sui-hidden")}},WP_Smush.bulk.init()},2140:function(e,t,n){"use strict";n.r(t);var s,i=n(1414),r=function(e,t){e=parseInt(e),t=parseInt(t);var n=!1,s=0,i=0,r={scan:function(){var n=this,s=e-t;0!==t?o(s).fail(this.showScanError):jQuery.post(ajaxurl,{action:"directory_smush_start",_ajax_nonce:window.wp_smush_msgs.nonce},(function(){return o(s).fail(n.showScanError)})).fail(this.showScanError)},cancel:function(){return n=!0,jQuery.post(ajaxurl,{action:"directory_smush_cancel",_ajax_nonce:window.wp_smush_msgs.nonce})},getProgress:function(){if(n)return 0;var s=e-t;return Math.min(Math.round(100*parseInt(e-s)/e),99)},onFinishStep:function(n){jQuery(".wp-smush-progress-dialog .sui-progress-state-text").html(t-s+"/"+e+" "+window.wp_smush_msgs.progress_smushed),WP_Smush.directory.updateProgressBar(n)},onFinish:function(){WP_Smush.directory.updateProgressBar(100),window.location.href=window.wp_smush_msgs.directory_url+"&scan=done"},showScanError:function(e){var t=jQuery("#wp-smush-progress-dialog");t.removeClass("wp-smush-exceed-limit").addClass("wp-smush-scan-error"),t.find("#smush-scan-error").text("".concat(e.status," ").concat(e.statusText));var n=t.find(".smush-403-error-message");403!==e.status?n.addClass("sui-hidden"):n.removeClass("sui-hidden")},limitReached:function(){var e=jQuery("#wp-smush-progress-dialog");e.addClass("wp-smush-exceed-limit"),e.find("#cancel-directory-smush").attr("data-tooltip",window.wp_smush_msgs.bulk_resume),e.find(".sui-box-body .sui-icon-close").removeClass("sui-icon-close").addClass("sui-icon-play"),e.find("#cancel-directory-smush").attr("id","cancel-directory-smush-disabled")},resume:function(){var e=jQuery("#wp-smush-progress-dialog"),t=e.find("#cancel-directory-smush-disabled");e.removeClass("wp-smush-exceed-limit"),e.find(".sui-box-body .sui-icon-play").removeClass("sui-icon-play").addClass("sui-icon-close"),t.attr("data-tooltip","Cancel"),t.attr("id","cancel-directory-smush"),r.scan()}},o=function n(o){return o>=0?(t=e-o,jQuery.post(ajaxurl,{action:"directory_smush_check_step",_ajax_nonce:window.wp_smush_msgs.nonce,step:t},(function(e){void 0!==e.success&&e.success?(void 0!==e.data&&void 0!==e.data.skipped&&!0===e.data.skipped&&i++,t++,o-=1,r.onFinishStep(r.getProgress()),n(o).fail(r.showScanError)):void 0!==e.data.error&&"dir_smush_limit_exceeded"===e.data.error?r.limitReached():(s++,t++,o-=1,r.onFinishStep(r.getProgress()),n(o).fail(r.showScanError))}))):jQuery.post(ajaxurl,{action:"directory_smush_finish",_ajax_nonce:window.wp_smush_msgs.nonce,items:e-(s+i),failed:s,skipped:i},(function(e){return r.onFinish(e)}))};return r};s=jQuery,WP_Smush.directory={selected:[],tree:[],wp_smush_msgs:[],triggered:!1,init:function(){var e=this,t=s("#wp-smush-progress-dialog"),n=0,i=0;void 0!==window.wp_smushit_data.dir_smush&&(n=window.wp_smushit_data.dir_smush.totalSteps,i=window.wp_smushit_data.dir_smush.currentScanStep),this.scanner=new r(n,i),this.wp_smush_msgs=window.wp_smush_msgs||{},s("button.wp-smush-browse, a#smush-directory-open-modal").on("click",(function(t){t.preventDefault(),s(t.currentTarget).hasClass("wp-smush-browse")&&(s("div.wp-smush-scan-result div.wp-smush-notice").hide(),s("div.wp-smush-info").remove()),window.SUI.openModal("wp-smush-list-dialog",t.currentTarget,s("#wp-smush-list-dialog .sui-box-header [data-modal-close]")[0],!0),e.initFileTree()})),s("#wp-smush-select-dir").on("click",(function(t){t.preventDefault(),s("div.wp-smush-list-dialog div.sui-box-body").css({opacity:"0.8"}),s("div.wp-smush-list-dialog div.sui-box-body a").off("click");var n=s(this);n.addClass("sui-button-onload");var i=e.tree.getSelectedNodes(),o=[];i.forEach((function(e){o.push(e.key)}));var a={action:"image_list",smush_path:o,image_list_nonce:s('input[name="image_list_nonce"]').val()};s.post(ajaxurl,a,(function(t){t.success?(window.SUI.closeModal(),e.scanner=new r(t.data,0),e.showProgressDialog(t.data),e.scanner.scan()):(n.removeClass("sui-button-onload"),window.SUI.openNotice("wp-smush-ajax-notice",t.data.message,{type:"warning"}))}))})),t.on("click","#cancel-directory-smush, #dialog-close-div, .wp-smush-cancel-dir",(function(t){t.preventDefault(),s(".wp-smush-cancel-dir").addClass("sui-button-onload"),e.scanner.cancel().done((function(){return window.location.href=e.wp_smush_msgs.directory_url}))})),t.on("click",".sui-icon-play, .wp-smush-resume-scan",(function(t){t.preventDefault(),e.scanner.resume()}));var o=window.location.search;new URLSearchParams(o).has("start")&&!this.triggered&&(this.triggered=!0,s("button.wp-smush-browse").trigger("click"))},initFileTree:function(){var e=this,t=s("button#wp-smush-select-dir"),n={type:"GET",url:ajaxurl,data:{action:"smush_get_directory_list",list_nonce:s('input[name="list_nonce"]').val()},cache:!1};Object.entries(e.tree).length>0||(e.tree=(0,i.createTree)(".wp-smush-list-dialog .content",{autoCollapse:!0,clickFolderMode:3,checkbox:!0,debugLevel:0,selectMode:3,tabindex:"0",keyboard:!0,quicksearch:!0,source:n,lazyLoad:function(e,t){t.result=new Promise((function(e,i){n.data.dir=t.node.key,s.ajax(n).done((function(t){return e(t)})).fail(i)}))},loadChildren:function(e,t){return t.node.fixSelection3AfterClick()},select:function(){return t.prop("disabled",!+e.tree.getSelectedNodes().length)},init:function(){return t.prop("disabled",!0)}}))},showProgressDialog:function(e){s(".wp-smush-progress-dialog .sui-progress-state-text").html("0/"+e+" "+self.wp_smush_msgs.progress_smushed),window.SUI.openModal("wp-smush-progress-dialog","dialog-close-div",void 0,!1)},updateProgressBar:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];e>100&&(e=100),s(".sui-progress-block .sui-progress-text span").text(e+"%"),s(".sui-progress-block .sui-progress-bar span").width(e+"%"),e>=90&&s(".sui-progress-state .sui-progress-state-text").text("Finalizing..."),t&&s(".sui-progress-state .sui-progress-state-text").text("Cancelling...")}},WP_Smush.directory.init()},3065:function(){function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}!function(){"use strict";WP_Smush.helpers={init:function(){},cacheUpsellErrorCodes:[],formatBytes:function(e,t){var n=1024,s=["KB","MB","GB","TB","PB"];if(Math.abs(e)<n)return e+" B";var i=-1;do{e/=n,++i}while(Math.abs(e)>=n&&i<s.length-1);return e.toFixed(t)+" "+s[i]},getSizeFromString:function(e){return e.replace(/[a-zA-Z]/g,"").trim()},getFormatFromString:function(e){return e.replace(/[0-9.]/g,"").trim()},precise_round:function(e,t){var n=e>=0?1:-1;return e=e>100?100:e,Math.round(e*Math.pow(10,t)+.001*n)/Math.pow(10,t)},showErrorNotice:function(e){if(void 0!==e){var t="<p>".concat(e,"</p>");SUI.openNotice("wp-smush-ajax-notice",t,{type:"error",icon:"info"});var n=document.querySelector(".sui-button-onload");n&&n.classList.remove("sui-button-onload")}},resetSettings:function(){var e=document.getElementById("wp_smush_reset"),t=new XMLHttpRequest;t.open("POST",ajaxurl+"?action=reset_settings",!0),t.setRequestHeader("Content-type","application/x-www-form-urlencoded"),t.onload=function(){if(200===t.status){var e=JSON.parse(t.response);void 0!==e.success&&e.success&&(window.location.href=wp_smush_msgs.smush_url)}else window.console.log("Request failed. Returned status of "+t.status)},t.send("_ajax_nonce="+e.value)},prepareBulkSmushErrorRow:function(e,t,n,s,i,r){var o=n&&void 0!==n?'<img class="attachment-thumbnail" src="'.concat(n,'" />'):'<i class="sui-icon-photo-picture" aria-hidden="true"></i>',a=window.wp_smush_msgs.edit_link.replace("{{id}}",s);t="undefined"===t||void 0===t?"undefined":t;var u='<div class="smush-bulk-error-row" data-error-code="'.concat(r,'">\n\t\t\t\t\t<div class="smush-bulk-image-data">\n\t\t\t\t\t\t<div class="smush-bulk-image-title">\n\t\t\t\t\t\t\t').concat(o,'\n\t\t\t\t\t\t\t<span class="smush-image-name">\n\t\t\t\t\t\t\t\t<a href="').concat(a,'">').concat(t,'</a>\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t<div class="smush-image-error">\n\t\t\t\t\t\t').concat(e,"\n\t\t\t\t\t</div>\n\t\t\t\t</div>");return"media"===i&&(u+='<div class="smush-bulk-image-actions">\n\t\t\t\t\t\t<a href="javascript:void(0)" class="sui-tooltip sui-tooltip-constrained sui-tooltip-left smush-ignore-image" data-tooltip="'.concat(window.wp_smush_msgs.error_ignore,'" data-id="').concat(s,'">\n\t\t\t\t\t\t\t').concat(window.wp_smush_msgs.btn_ignore,'\n\t\t\t\t\t\t</a>\n\t\t\t\t\t\t<a class="smush-link-detail" href="').concat(a,'">\n\t\t\t\t\t\t\t').concat(window.wp_smush_msgs.view_detail,"\n\t\t\t\t\t\t</a>\n\t\t\t\t\t</div>")),u+="</div>",u+=WP_Smush.helpers.upsellWithError(r)},cacheUpsellErrorCode:function(e){this.cacheUpsellErrorCodes.push(e)},upsellWithError:function(e){return e&&window.wp_smush_msgs["error_"+e]&&!this.isUpsellRendered(e)?(this.cacheRenderedUpsell(e),'<div class="smush-bulk-error-row smush-error-upsell"><div class="smush-bulk-image-title"><span class="smush-image-error">'+window.wp_smush_msgs["error_"+e]+"</span></div></div>"):""},isUpsellRendered:function(e){return this.cacheUpsellErrorCodes.includes(e)},cacheRenderedUpsell:function(e){this.cacheUpsellErrorCodes.push(e)},getErrorMessage:function(e){return e.message||e.data&&e.data.message||e.responseJSON&&e.responseJSON.data&&e.responseJSON.data.message||window.wp_smush_msgs.generic_ajax_error||e.status&&"Request failed. Returned status of "+e.status},showNotice:function(t,n){var s;if(s="object"===e(t)?this.getErrorMessage(t):t){n=n||{},n={type:(n=Object.assign({showdismiss:!1,autoclose:!0},n)).type||"error",icon:n.icon||("success"===n.type?"check-tick":"info"),dismiss:{show:n.showdismiss,label:window.wp_smush_msgs.noticeDismiss,tooltip:window.wp_smush_msgs.noticeDismissTooltip},autoclose:{show:n.autoclose}};var i="<p>".concat(s,"</p>");return SUI.openNotice("wp-smush-ajax-notice",i,n),Promise.resolve("#wp-smush-ajax-notice")}},closeNotice:function(){window.SUI.closeNotice("wp-smush-ajax-notice")},renderActivationCDNNotice:function(e){if(!document.getElementById("wp-smush-animated-upsell-notice")){var t='<div class="sui-notice sui-notice-info sui-margin-top" id="wp-smush-animated-upsell-notice">\n\t\t\t\t\t\t\t\t\t<div class="sui-notice-content">\n\t\t\t\t\t\t\t\t\t\t<div class="sui-notice-message">\n\t\t\t\t\t\t\t\t\t\t\t<i class="sui-notice-icon sui-icon-info" aria-hidden="true"></i>\n\t\t\t\t\t\t\t\t\t\t\t<p>'.concat(e,"</p>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>");document.querySelector("#smush-box-bulk .wp-smush-bulk-wrapper").outerHTML+=t}}},WP_Smush.helpers.init()}()},5445:function(e,t,n){"use strict";n.r(t);var s=n(5565),i=n(6033),r=n(8283);function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function a(e,t){for(var n=0;n<t.length;n++){var s=t[n];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,(i=s.key,r=void 0,r=function(e,t){if("object"!==o(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var s=n.call(e,t||"default");if("object"!==o(s))return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(i,"string"),"symbol"===o(r)?r:String(r)),s)}var i,r}function u(){return u="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var s=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=d(e)););return e}(e,t);if(s){var i=Object.getOwnPropertyDescriptor(s,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},u.apply(this,arguments)}function c(e,t){return c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},c(e,t)}function l(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,s=d(e);if(t){var i=d(this).constructor;n=Reflect.construct(s,arguments,i)}else n=s.apply(this,arguments);return function(e,t){if(t&&("object"===o(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,n)}}function d(e){return d=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},d(e)}!function(){if(window.wp_smush_msgs){var e=document.querySelector.bind(document);if(e(".wp-smush-scan-progress-bar-wrapper")){var t=e(".wp-smush-scan");if(t){var n=e(".wp-smush-bo-start")||e(".wp-smush-bulk-wrapper .wp-smush-all"),o=wp.i18n.__,h=new(function(i){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&c(e,t)}(_,i);var h,p,f,m=l(_);function _(){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,_),(t=m.call(this)).runBulkSmushOnComplete=!1,t.restoreButton=e(".wp-smush-restore"),t.autoBulkSmushNotification=e(".wp-smush-auto-bulk-smush-notification"),t}return h=_,(p=[{key:"startScanThenBulkSmushOnComplete",value:function(){return this.runBulkSmushOnComplete=!0,this.startScan(!0)}},{key:"onStart",value:function(){return this.hideRecheckNotice(),this.disableRelatedButtons(),this.setRecheckImagesButtonOnLoad(),this.toggleBulkSmushBoxContent(),this}},{key:"onStartFailure",value:function(e){u(d(_.prototype),"onStartFailure",this).call(this,e),this.revertRelatedButtons()}},{key:"onCloseProgressBar",value:function(){this.maybeHideAutoBulkSmushNotification()}},{key:"disableRelatedButtons",value:function(){this.restoreButton.setAttribute("disabled",!0),n&&(n.setAttribute("disabled",!0),this.setInnerText(n,o("Waiting for Re-check to finish","wp-smushit")))}},{key:"revertRelatedButtons",value:function(){return n&&(n.removeAttribute("disabled"),this.revertInnerText(n)),this.restoreButton.removeAttribute("disabled"),this.revertRecheckImagesButton(),this}},{key:"setRecheckImagesButtonOnLoad",value:function(){this.disableRecheckImagesButton(),this.setInnerText(t.querySelector(".wp-smush-inner-text"),o("Checking Images","wp-smushit"))}},{key:"disableRecheckImagesButton",value:function(){t.setAttribute("disabled",!0)}},{key:"revertRecheckImagesButton",value:function(){t.removeAttribute("disabled"),this.revertInnerText(t.querySelector(".wp-smush-inner-text"))}},{key:"beforeUpdateStatus",value:function(e){this.runBulkSmushOnComplete=null==e?void 0:e.optimize_on_scan_completed,this.maybeShowAutoBulkSmushNotification()}},{key:"onDead",value:function(e){u(d(_.prototype),"onDead",this).call(this,e),this.revertRelatedButtons(),this.setRequiredScanForBulkSmushButton()}},{key:"onFinish",value:function(e){var t=e.global_stats;u(d(_.prototype),"onFinish",this).call(this,e),this.revertRelatedButtons(),this.toggleBulkSmushDescription(t),t.is_outdated?this.setRequiredScanForBulkSmushButton():this.removeScanEventFromBulkSmushButton(),this.revertRecheckWarning()}},{key:"onCompleted",value:function(e){n?(this.onFinish(e),e.global_stats.remaining_count<1||(this.runBulkSmushOnComplete?(this.runBulkSmushOnComplete=!1,this.triggerBulkSmushEvent(e)):this.showRecheckNoticeSuccess())):window.location.reload()}},{key:"showNotice",value:function(e){if(e.notice){var t="success";void 0!==e.noticeType&&(t=e.noticeType),window.SUI.openNotice("wp-smush-ajax-notice","<p>"+e.notice+"</p>",{type:t,icon:"check-tick"})}}},{key:"showRecheckNoticeSuccess",value:function(){var t=e(".wp-smush-recheck-images-notice-box");t&&(this.showAnElement(t),this.hideAnElement(t.querySelector(".wp-smush-recheck-images-notice-warning")),this.showAnElement(t.querySelector(".wp-smush-recheck-images-notice-success")))}},{key:"showRecheckNoticeWarning",value:function(){var t=e(".wp-smush-recheck-images-notice-box");t&&(this.showAnElement(t),this.hideAnElement(t.querySelector(".wp-smush-recheck-images-notice-success")),this.showAnElement(t.querySelector(".wp-smush-recheck-images-notice-warning")))}},{key:"hideRecheckNotice",value:function(){this.hideAnElement(e(".wp-smush-recheck-images-notice-box"))}},{key:"showProgressErrorNoticeOnRecheckNotice",value:function(){var t=e(".wp-smush-recheck-images-notice-box .wp-smush-recheck-images-notice-warning");t&&(t.classList.add("sui-notice-error"),t.classList.remove("sui-notice-warning"),this.setInnerText(t.querySelector("span"),this.getErrorProgressMessage()),this.showRecheckNoticeWarning())}},{key:"revertRecheckWarning",value:function(){var t=e(".wp-smush-recheck-images-notice-box .wp-smush-recheck-images-notice-warning");t&&(t.classList.add("sui-notice-warning"),t.classList.remove("sui-notice-error"),this.revertInnerText(t.querySelector("span")))}},{key:"triggerBulkSmushEvent",value:function(e){this.disableRecheckImagesButton(),e.enabled_background_process?this.triggerBackgroundBulkSmushEvent(e.global_stats):this.triggerAjaxBulkSmushEvent(e.global_stats)}},{key:"toggleBulkSmushDescription",value:function(e){s.Z.isEmptyObject||(e.remaining_count<1?(s.Z.hideBulkSmushDescription(),s.Z.showBulkSmushAllDone()):(s.Z.showBulkSmushDescription(),s.Z.hideBulkSmushAllDone()))}},{key:"setRequiredScanForBulkSmushButton",value:function(){n&&n.classList.add("wp-smush-scan-and-bulk-smush")}},{key:"removeScanEventFromBulkSmushButton",value:function(){n&&n.classList.remove("wp-smush-scan-and-bulk-smush")}},{key:"triggerBackgroundBulkSmushEvent",value:function(e){document.dispatchEvent(new CustomEvent("backgroundBulkSmushOnScanCompleted",{detail:e}))}},{key:"triggerAjaxBulkSmushEvent",value:function(e){document.dispatchEvent(new CustomEvent("ajaxBulkSmushOnScanCompleted",{detail:e}))}},{key:"onCancelled",value:function(e){this.onFinish(e),this.runBulkSmushOnComplete=!1,this.setRequiredScanForBulkSmushButton()}},{key:"maybeShowAutoBulkSmushNotification",value:function(){this.runBulkSmushOnComplete&&this.showAnElement(this.autoBulkSmushNotification)}},{key:"maybeHideAutoBulkSmushNotification",value:function(){this.runBulkSmushOnComplete&&this.hideAnElement(this.autoBulkSmushNotification)}},{key:"toggleBulkSmushBoxContent",value:function(){r.h.resetAndHideBulkErrors(),this.toggleBulkSmushDescription(r.h.getGlobalStats())}}])&&a(h.prototype,p),f&&a(h,f),Object.defineProperty(h,"prototype",{writable:!1}),_}(i.default));!function(){var e,n;if(t&&t.classList.contains("wp-smush-background-scan"))if(t.addEventListener("click",(function(){return h.startScan()})),null!==(e=window.wp_smushit_data.media_library_scan)&&void 0!==e&&e.in_processing)h.onStart().showProgressBar().autoSyncStatus();else if(window.location.search.includes("smush-action=start-scan-media")){t.click();n=window.location.href.replace("&smush-action=start-scan-media",""),window.history.pushState(null,null,n)}}();!function(){var s=e(".wp-smush-recheck-images-notice-box");if(s&&t){var i,r=s.querySelector(".wp-smush-trigger-background-scan");if(r)r.onclick=function(e){e.preventDefault(),t.click()},null!==(i=window.wp_smushit_data.media_library_scan)&&void 0!==i&&i.is_dead?h.showProgressErrorNoticeOnRecheckNotice():window.wp_smushit_data.is_outdated&&h.showRecheckNoticeWarning();var o=s.querySelector(".wp-smush-trigger-bulk-smush");o&&n&&(o.onclick=function(e){e.preventDefault(),s.classList.add("sui-hidden"),n.click()});var a=s.querySelectorAll("button.sui-button-icon");a&&a.forEach((function(e){e.onclick=function(t){e.closest(".sui-recheck-images-notice").classList.add("sui-hidden")}})),document.addEventListener("onSavedSmushSettings",(function(e){var t;null!=e&&null!==(t=e.detail)&&void 0!==t&&t.is_outdated_stats&&(h.setRequiredScanForBulkSmushButton(),s.classList.remove("sui-hidden"),s.querySelector(".wp-smush-recheck-images-notice-success").classList.add("sui-hidden"),s.querySelector(".wp-smush-recheck-images-notice-warning").classList.remove("sui-hidden"))}))}}();!function(){if(n){n.addEventListener("click",(function(e){n.classList.contains("wp-smush-scan-and-bulk-smush")&&(e.preventDefault(),h.startScanThenBulkSmushOnComplete())}))}}()}}}}()},4471:function(e,t,n){"use strict";n.r(t);var s=n(6033);function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function r(e,t){for(var n=0;n<t.length;n++){var s=t[n];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,(r=s.key,o=void 0,o=function(e,t){if("object"!==i(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var s=n.call(e,t||"default");if("object"!==i(s))return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(r,"string"),"symbol"===i(o)?o:String(o)),s)}var r,o}function o(e,t){return o=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},o(e,t)}function a(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,s=u(e);if(t){var r=u(this).constructor;n=Reflect.construct(s,arguments,r)}else n=s.apply(this,arguments);return function(e,t){if(t&&("object"===i(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,n)}}function u(e){return u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},u(e)}!function(e){if(window.wp_smush_msgs){var t=document.querySelector.bind(document);if(t(".wp-smush-scan-progress-bar-wrapper"))if(!t(".wp-smush-scan"))if(null===(e=window.wp_smushit_data.media_library_scan)||void 0===e?void 0:e.in_processing){var n=wp.i18n.__;(new(function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&o(e,t)}(l,e);var s,i,u,c=a(l);function l(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l),(e=c.call(this)).bulkSmushLink=t(".wp-smush-bulk-smush-link"),e}return s=l,(i=[{key:"onShowProgressBar",value:function(){this.disableBulkSmushLink()}},{key:"onCloseProgressBar",value:function(){this.revertBulkSmushLink()}},{key:"disableBulkSmushLink",value:function(){this.bulkSmushLink&&(this.bulkSmushLink.setAttribute("disabled",!0),this.setInnerText(this.bulkSmushLink,n("Waiting for Re-check to finish","wp-smushit")))}},{key:"revertBulkSmushLink",value:function(){this.bulkSmushLink&&(this.bulkSmushLink.removeAttribute("disabled"),this.revertInnerText(this.bulkSmushLink))}}])&&r(s.prototype,i),u&&r(s,u),Object.defineProperty(s,"prototype",{writable:!1}),l}(s.default))).showProgressBar().autoSyncStatus()}}}()},6453:function(e,t,n){"use strict";n.r(t);var s,i=n(9446),r=n(5565);(s=window.jQuery)((function(){s("body").on("click",".wp-smush-nextgen-send",(function(e){e.preventDefault(),new i.Z(s(this),!1,"nextgen")})),s("body").on("click",".wp-smush-nextgen-bulk",(function(e){if(e.preventDefault(),s(".wp-smush-resmush-notice").remove(),"undefined"==typeof wp_smushit_data||0===wp_smushit_data.unsmushed.length&&0===wp_smushit_data.resmush.length)return!1;var t=new i.Z(s(this),!0,"nextgen");r.Z.setOnCancelCallback((function(){t.cancelAjax()})).update(0,t.ids.length).show(),jQuery(".wp-smush-all, .wp-smush-scan").prop("disabled",!0),s(".wp-smush-notice.wp-smush-remaining").hide(),t.run()})).on("click",".wp-smush-trigger-nextgen-bulk",(function(e){e.preventDefault();var t=s(".wp-smush-nextgen-bulk");t.length&&(t.trigger("click"),SUI.closeNotice("wp-smush-ajax-notice"))}))}))},206:function(){!function(e){"use strict";var t=e("#wp-smush-s3support-alert");if(t.length){var n={type:"warning",icon:"info",dismiss:{show:!0,label:wp_smush_msgs.noticeDismiss,tooltip:wp_smush_msgs.noticeDismissTooltip}};window.SUI.openNotice("wp-smush-s3support-alert",t.data("message"),n)}function s(t){var n=e(t.currentTarget).closest(".smush-notice");n.fadeTo(100,0,(function(){return n.slideUp(100,(function(){return n.remove()}))}))}t.on("click","button",(function(){e.post(ajaxurl,{action:"dismiss_s3support_alert",_ajax_nonce:window.wp_smush_msgs.nonce})})),e("#wp-smush-api-message button.sui-button-icon").on("click",(function(t){t.preventDefault();var n=e("#wp-smush-api-message");n.slideUp("slow",(function(){n.remove()})),e.post(ajaxurl,{action:"hide_api_message",_ajax_nonce:window.wp_smush_msgs.nonce})})),e(".smush-notice .smush-notice-act").on("click",(function(e){s(e)})),e(".wp-smush-update-info").on("click",".notice-dismiss",(function(t){t.preventDefault(),s(t),e.post(ajaxurl,{action:"dismiss_update_info",_ajax_nonce:window.wp_smush_msgs.nonce})}))}(jQuery)},3579:function(){!function(){"use strict";WP_Smush.onboarding={membership:"free",onboardingModal:document.getElementById("smush-onboarding-dialog"),first_slide:"usage",settings:{first:!0,last:!1,slide:"usage",value:!1},selection:{usage:!1,auto:!0,lossy:!0,strip_exif:!0,original:!1,lazy_load:!0},contentContainer:document.getElementById("smush-onboarding-content"),onboardingSlides:["usage","auto","lossy","strip_exif","original","lazy_load"],touchX:null,touchY:null,recheckImagesLink:"",init:function(){if(this.onboardingModal){var e=document.getElementById("smush-onboarding");this.membership=e.dataset.type,this.recheckImagesLink=e.dataset.ctaUrl,"pro"!==this.membership&&(this.onboardingSlides=["usage","auto","lossy","strip_exif","lazy_load"]),"false"===e.dataset.tracking&&this.onboardingSlides.pop(),this.renderTemplate();var t=this.onboardingModal.querySelector(".smush-onboarding-skip-link");t&&t.addEventListener("click",this.skipSetup.bind(this)),window.SUI.openModal("smush-onboarding-dialog","wpcontent",void 0,!1)}},handleTouchStart:function(e){var t=e.touches[0];this.touchX=t.clientX,this.touchY=t.clientY},handleTouchMove:function(e){if(this.touchX&&this.touchY){var t=e.touches[0].clientX,n=e.touches[0].clientY,s=this.touchX-t,i=this.touchY-n;Math.abs(s)>Math.abs(i)&&(s>0?!1===WP_Smush.onboarding.settings.last&&WP_Smush.onboarding.next(null,"next"):!1===WP_Smush.onboarding.settings.first&&WP_Smush.onboarding.next(null,"prev")),this.touchX=null,this.touchY=null}},renderTemplate:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"none",n=this.onboardingModal.querySelector('input[type="checkbox"]');n&&(this.selection[n.id]=n.checked);var s=WP_Smush.onboarding.template("smush-onboarding")(this.settings);s&&(this.contentContainer.innerHTML=s,"none"===t?this.contentContainer.classList.add("loaded"):(this.contentContainer.classList.remove("loaded"),this.contentContainer.classList.add(t),setTimeout((function(){e.contentContainer.classList.add("loaded"),e.contentContainer.classList.remove(t)}),600))),this.onboardingModal.addEventListener("touchstart",this.handleTouchStart,!1),this.onboardingModal.addEventListener("touchmove",this.handleTouchMove,!1),this.bindSubmit()},bindSubmit:function(){var e=this.onboardingModal.querySelector('button[type="submit"]'),t=this;e&&e.addEventListener("click",(function(e){e.preventDefault();var n=t.onboardingModal.querySelector('input[type="checkbox"]');n&&(t.selection[n.id]=n.checked);var s=document.getElementById("smush_quick_setup_nonce"),i=new XMLHttpRequest;i.open("POST",ajaxurl+"?action=smush_setup",!0),i.setRequestHeader("Content-type","application/x-www-form-urlencoded"),i.onload=function(){200===i.status?t.onFinishingSetup():window.console.log("Request failed. Returned status of "+i.status)},i.send("smush_settings="+JSON.stringify(t.selection)+"&_ajax_nonce="+s.value)}))},onFinishingSetup:function(){this.onFinish(),this.startRecheckImages()},onFinish:function(){window.SUI.closeModal()},startRecheckImages:function(){this.recheckImagesLink&&(window.location.href=this.recheckImagesLink)},next:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=this.onboardingSlides.indexOf(this.settings.slide),s=0;s=t?"next"===t?n+1:n-1:null!==e&&e.classList.contains("next")?n+1:n-1;var i=null!==e&&e.classList.contains("next")?"fadeInRight":"fadeInLeft";this.settings={first:0===s,last:s+1===this.onboardingSlides.length,slide:this.onboardingSlides[s],value:this.selection[this.onboardingSlides[s]]},this.renderTemplate(i)},goTo:function(e){var t=this.onboardingSlides.indexOf(e);this.settings={first:0===t,last:t+1===this.onboardingSlides.length,slide:e,value:this.selection[e]},this.renderTemplate()},skipSetup:function(){var e=this,t=document.getElementById("smush_quick_setup_nonce"),n=new XMLHttpRequest;n.open("POST",ajaxurl+"?action=skip_smush_setup&_ajax_nonce="+t.value),n.onload=function(){200===n.status?e.onSkipSetup():window.console.log("Request failed. Returned status of "+n.status)},n.send()},onSkipSetup:function(){this.onFinish()},hideUpgradeModal:function(e,t){e.preventDefault(),t.classList.add("wp-smush-link-in-progress");var n=null==t?void 0:t.href,s=new XMLHttpRequest;s.open("POST",ajaxurl+"?action=hide_new_features&_ajax_nonce="+window.wp_smush_msgs.nonce),s.onload=function(){window.SUI.closeModal(),t.classList.remove("wp-smush-link-in-progress"),200===s.status?n&&(window.location.href=n):window.console.log("Request failed. Returned status of "+s.status)},s.send()}},WP_Smush.onboarding.template=_.memoize((function(e){var t,n={evaluate:/<#([\s\S]+?)#>/g,interpolate:/{{{([\s\S]+?)}}}/g,escape:/{{([^}]+?)}}(?!})/g,variable:"data"};return function(s){return _.templateSettings=n,t=t||_.template(document.getElementById(e).innerHTML),s.first_slide=WP_Smush.onboarding.first_slide,t(s)}})),window.addEventListener("load",(function(){return WP_Smush.onboarding.init()}))}()},1110:function(){!function(){"use strict";WP_Smush.CDN={cdnEnableButton:document.getElementById("smush-enable-cdn"),cdnDisableButton:document.getElementById("smush-cancel-cdn"),cdnStatsBox:document.querySelector(".smush-cdn-stats"),init:function(){var e=this;this.cdnEnableButton&&this.cdnEnableButton.addEventListener("click",(function(t){t.preventDefault(),t.currentTarget.classList.add("sui-button-onload"),e.toggle_cdn(!0)})),this.cdnDisableButton&&this.cdnDisableButton.addEventListener("click",(function(t){t.preventDefault(),t.currentTarget.classList.add("sui-button-onload"),e.toggle_cdn(!1)})),this.updateStatsBox()},toggle_cdn:function(e){var t=document.getElementsByName("wp_smush_options_nonce"),n=new XMLHttpRequest;n.open("POST",ajaxurl+"?action=smush_toggle_cdn",!0),n.setRequestHeader("Content-type","application/x-www-form-urlencoded"),n.onload=function(){if(200===n.status){var e=JSON.parse(n.response);void 0!==e.success&&e.success?window.location.search="page=smush-cdn":void 0!==e.data.message&&WP_Smush.helpers.showErrorNotice(e.data.message)}else WP_Smush.helpers.showErrorNotice("Request failed. Returned status of "+n.status)},n.send("param="+e+"&_ajax_nonce="+t[0].value)},updateStatsBox:function(){var e=this;if(void 0!==this.cdnStatsBox&&this.cdnStatsBox&&window.location.search.includes("page=smush-cdn")){this.toggleElements();var t=new XMLHttpRequest;t.open("POST",ajaxurl+"?action=get_cdn_stats",!0),t.onload=function(){if(200===t.status){var n=JSON.parse(t.response);void 0!==n.success&&n.success?e.toggleElements():void 0!==n.data.message&&WP_Smush.helpers.showErrorNotice(n.data.message)}else WP_Smush.helpers.showErrorNotice("Request failed. Returned status of "+t.status)},t.send()}},toggleElements:function(){for(var e=this.cdnStatsBox.querySelector(".sui-icon-loader"),t=this.cdnStatsBox.querySelectorAll(".wp-smush-stats > :not(.sui-icon-loader)"),n=0;n<t.length;n++)t[n].classList.toggle("sui-hidden");e.classList.toggle("sui-hidden")}},WP_Smush.CDN.init()}()},5972:function(){!function(){"use strict";WP_Smush.Lazyload={lazyloadEnableButton:document.getElementById("smush-enable-lazyload"),lazyloadDisableButton:document.getElementById("smush-cancel-lazyload"),init:function(){var e=this,t=this;this.lazyloadEnableButton&&this.lazyloadEnableButton.addEventListener("click",(function(t){t.preventDefault(),t.currentTarget.classList.add("sui-button-onload"),e.toggle_lazy_load(!0)})),this.lazyloadDisableButton&&this.lazyloadDisableButton.addEventListener("click",(function(t){t.preventDefault(),t.currentTarget.classList.add("sui-button-onload"),e.toggle_lazy_load(!1)}));var n=document.getElementById("smush-remove-spinner");n&&n.addEventListener("click",(function(t){t.preventDefault(),e.removeLoaderIcon()}));var s=document.getElementById("smush-remove-placeholder");s&&s.addEventListener("click",(function(t){t.preventDefault(),e.removeLoaderIcon("placeholder")}));var i=document.querySelectorAll(".smush-ll-remove");i&&0<i.length&&i.forEach((function(e){e.addEventListener("click",(function(e){e.preventDefault(),e.target.closest("li").style.display="none",t.remove(e.target.dataset.id,e.target.dataset.type)}))})),this.handlePredefinedPlaceholders()},handlePredefinedPlaceholders:function(){var e=this,t=document.getElementById("placeholder-icon-1");t&&t.addEventListener("click",(function(){return e.changeColor("#F3F3F3")}));var n=document.getElementById("placeholder-icon-2");n&&n.addEventListener("click",(function(){return e.changeColor("#333333")}))},changeColor:function(e){document.getElementById("smush-color-picker").value=e,document.querySelector(".sui-colorpicker-hex .sui-colorpicker-value > span > span").style.backgroundColor=e,document.querySelector(".sui-colorpicker-hex .sui-colorpicker-value > input").value=e},toggle_lazy_load:function(e){var t=document.getElementsByName("wp_smush_options_nonce"),n=new XMLHttpRequest;n.open("POST",ajaxurl+"?action=smush_toggle_lazy_load",!0),n.setRequestHeader("Content-type","application/x-www-form-urlencoded"),n.onload=function(){if(200===n.status){var e=JSON.parse(n.response);void 0!==e.success&&e.success?window.location.search="page=smush-lazy-load":void 0!==e.data.message&&(WP_Smush.helpers.showErrorNotice(e.data.message),document.querySelector(".sui-button-onload").classList.remove("sui-button-onload"))}else WP_Smush.helpers.showErrorNotice("Request failed. Returned status of "+n.status),document.querySelector(".sui-button-onload").classList.remove("sui-button-onload")},n.send("param="+e+"&_ajax_nonce="+t[0].value)},addLoaderIcon:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"spinner";e||(e=wp.media({title:"Select or upload an icon",button:{text:"Select icon"},multiple:!1})).on("select",(function(){var n=e.state().get("selection").first().toJSON(),s=document.getElementById("smush-"+t+"-icon-preview");s.style.backgroundImage='url("'+n.url+'")',s.style.display="block",document.getElementById("smush-"+t+"-icon-file").setAttribute("value",n.id),document.getElementById("smush-upload-"+t).style.display="none";var i=document.getElementById("smush-remove-"+t);i.querySelector("span").innerHTML=n.filename,i.style.display="block"})),e.open()},removeLoaderIcon:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"spinner",t=document.getElementById("smush-"+e+"-icon-preview");t.style.backgroundImage="",t.style.display="none",document.getElementById("smush-upload-"+e).style.display="block",document.getElementById("smush-remove-"+e).style.display="none",document.getElementById("smush-"+e+"-icon-file").setAttribute("value","")},remove:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"spinner",n=document.getElementsByName("wp_smush_options_nonce"),s=new XMLHttpRequest;s.open("POST",ajaxurl+"?action=smush_remove_icon",!0),s.setRequestHeader("Content-type","application/x-www-form-urlencoded"),s.send("id="+e+"&type="+t+"&_ajax_nonce="+n[0].value)}},WP_Smush.Lazyload.init()}()},4334:function(e,t,n){"use strict";n.r(t);var s=n(9576);function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function r(e,t){for(var n=0;n<t.length;n++){var s=t[n];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,(r=s.key,o=void 0,o=function(e,t){if("object"!==i(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var s=n.call(e,t||"default");if("object"!==i(s))return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(r,"string"),"symbol"===i(o)?o:String(o)),s)}var r,o}(new(function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n,i;return t=e,(n=[{key:"init",value:function(){this.trackUltraLinks()}},{key:"trackUltraLinks",value:function(){var e=this,t=document.querySelectorAll(".wp-smush-upsell-ultra-compression");if(t){var n=function(t){return{settings:"bulksmush_settings",dashboard:"dash_summary",bulk:"bulksmush_summary",directory:"directory_summary","lazy-load":"lazy_summary",cdn:"cdn_summary",webp:"webp_summary"}[t.classList.contains("wp-smush-ultra-compression-link")?"settings":e.getCurrentPageSlug()]||"bulksmush_settings"};t.forEach((function(e){e.addEventListener("click",(function(e){s.Z.getInstance().track("ultra_upsell_modal",{Location:n(e.target),"Modal Action":"direct_cta"})}))}))}}},{key:"getCurrentPageSlug",value:function(){var e=new URLSearchParams(document.location.search).get("page");return"smush"===e?"dashboard":e.replace("smush-","")}}])&&r(t.prototype,n),i&&r(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}())).init()},4933:function(){!function(e){"use strict";function t(t,n){var s=new XMLHttpRequest;s.open("POST",ajaxurl+"?action=smush_save_settings",!0),s.setRequestHeader("Content-type","application/x-www-form-urlencoded"),s.onload=function(){if(e("#save-settings-button").removeClass("sui-button-onload-text sui-button-onload"),200===s.status){var t=JSON.parse(s.response);void 0!==t.success&&t.success?(!function(e){var t="<p>".concat(e,"</p>"),n={type:"success",icon:"check"};SUI.openNotice("wp-smush-ajax-notice",t,n);var s=document.querySelector(".sui-button-onload");s&&s.classList.remove("sui-button-onload")}(wp_smush_msgs.settingsUpdated),n=t.data,document.dispatchEvent(new CustomEvent("onSavedSmushSettings",{detail:n}))):t.data&&t.data.message?WP_Smush.helpers.showErrorNotice(t.data.message):WP_Smush.helpers.showErrorNotice("Request failed.")}else WP_Smush.helpers.showErrorNotice("Request failed. Returned status of "+s.status);var n},s.send("page="+n+"&"+t+"&_ajax_nonce="+wp_smush_msgs.nonce)}e("form#smush-bulk-form").on("submit",(function(n){n.preventDefault(),e("#save-settings-button").addClass("sui-button-onload"),t(e(this).serialize(),"bulk")})),e("form#smush-lazy-load-form").on("submit",(function(n){n.preventDefault(),e("#save-settings-button").addClass("sui-button-onload-text"),t(e(this).serialize(),"lazy-load")})),e("form#smush-cdn-form").on("submit",(function(n){n.preventDefault(),e("#save-settings-button").addClass("sui-button-onload-text"),t(e(this).serialize(),"cdn")})),e("form#smush-integrations-form").on("submit",(function(n){n.preventDefault(),e("#save-settings-button").addClass("sui-button-onload-text"),t(e(this).serialize(),"integrations")})),e("form#smush-settings-form").on("submit",(function(n){n.preventDefault(),e("#save-settings-button").addClass("sui-button-onload-text"),t(e(this).serialize(),"settings")})),e("input[name=keep_data]").on("change",(function(e){var t="keep_data-true"===e.target.id?"keep_data-false":"keep_data-true";e.target.parentNode.classList.add("active"),document.getElementById(t).parentNode.classList.remove("active")})),e("input#detection").on("click",(function(){var t=e(".smush-highlighting-notice"),n=e(".smush-highlighting-warning");e(this).is(":checked")?t.length>0?t.show():n.show():(t.hide(),n.hide())}))}(jQuery)},9446:function(e,t,n){"use strict";var s=n(8283),i=n(5565),r=n(9576);function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function a(e,t){for(var n=0;n<t.length;n++){var s=t[n];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,(i=s.key,r=void 0,r=function(e,t){if("object"!==o(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var s=n.call(e,t||"default");if("object"!==o(s))return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(i,"string"),"symbol"===o(r)?r:String(r)),s)}var i,r}var u=0,c=function(){function e(t,n){var s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"media";return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.onStart(),this.skip_resmush=!(void 0===t.data("smush")||!t.data("smush")),this.button=jQuery(t[0]),this.is_bulk=!!o(n)&&n,this.url=ajaxurl,this.log=jQuery(".smush-final-log"),this.setIds(),this.mixPanel=r.Z.getInstance(),this.is_bulk_resmush=0<wp_smushit_data.resmush.length&&!this.skip_resmush,this.status=this.button.parent().prev(".smush-status"),this.smush_type=s,this.single_ajax_suffix="nextgen"===this.smush_type?"smush_manual_nextgen":"wp_smushit_manual",this.bulk_ajax_suffix="nextgen"===this.smush_type?"wp_smushit_nextgen_bulk":"wp_smushit_bulk",this.get_stats_action="nextgen"===this.smush_type?"nextgen_get_stats":"get_stats",this.url=this.is_bulk?e.smushAddParams(this.url,{action:this.bulk_ajax_suffix}):e.smushAddParams(this.url,{action:this.single_ajax_suffix}),this.start(),!this.is_bulk&&this.run(),this.bindDeferredEvents(),this}var t,n,c;return t=e,n=[{key:"setIds",value:function(){var e=[];"object"===o(e=0<wp_smushit_data.resmush.length&&!this.skip_resmush?0<wp_smushit_data.unsmushed.length?wp_smushit_data.resmush.concat(wp_smushit_data.unsmushed):wp_smushit_data.resmush:wp_smushit_data.unsmushed)?this.ids=e.filter((function(e,t,n){return t===n.indexOf(e)})):this.ids=e}},{key:"start",value:function(){this.button.prop("disabled",!0),this.button.addClass("wp-smush-started"),this.bulkStart(),this.singleStart()}},{key:"bulkStart",value:function(){this.is_bulk&&(jQuery(".wp-smush-bulk-wrapper").addClass("sui-hidden"),jQuery(".wp-smush-bulk-progress-bar-wrapper .sui-notice-warning:first-of-type").hide(),0>=jQuery("div.smush-final-log .smush-bulk-error-row").length&&jQuery("div.smush-final-log").addClass("sui-hidden"),jQuery(".bulk-smush-wrapper .wp-smush-bulk-progress-bar-wrapper, #wp-smush-running-notice").removeClass("sui-hidden"))}},{key:"singleStart",value:function(){this.is_bulk||(this.button.html('<span class="spinner wp-smush-progress">'+window.wp_smush_msgs.smushing+"</span>"),this.status.removeClass("error"))}},{key:"enableButton",value:function(){this.button.prop("disabled",!1),jQuery(".wp-smush-all").prop("disabled",!1),jQuery(".wp-smush-restore").prop("disabled",!1),jQuery("a.wp-smush-lossy-enable, button.wp-smush-resize-enable, button#save-settings-button").prop("disabled",!1)}},{key:"singleDone",value:function(){if(!this.is_bulk){var t=this;this.request.done((function(n){if(void 0!==n.data){var s=t.status.parent();e.membershipValidity(n.data),n.success?(s.html(n.data),t.button.html(window.wp_smush_msgs.all_done)):n.data.html_stats?s.html(n.data.html_stats):(t.status.addClass("smush-warning"),t.status.html(n.data.error_msg),t.button.html(window.smush_vars.strings.stats_label)),e.updateImageStats(n.data.new_size)}})).fail((function(e){t.status.html(e.data),t.status.addClass("smush-warning"),t.enableButton()}))}}},{key:"syncStats",value:function(){var e=jQuery("div.wp-smush-bulk-progress-bar-wrapper div.wp-smush-count.tc"),t=e.html();e.html(window.wp_smush_msgs.sync_stats);var n=this;return jQuery.ajax({type:"GET",url:ajaxurl,data:{action:this.get_stats_action,_ajax_nonce:window.wp_smush_msgs.nonce},success:function(e){null!=e&&e.success?(s.h.updateGlobalStatsFromSmushScriptData(e.data),s.h.renderStats(),i.Z.update(0,e.data.remaining_count),jQuery(".wp-smush-scan").prop("disabled",!1),n.hideBulkFreeLimitReachedNotice()):WP_Smush.helpers.showNotice(e,{showdismiss:!0,autoclose:!1})}}).always((function(){return e.html(t)}))}},{key:"bulkDone",value:function(){if(this.is_bulk){if(this.enableButton(),0===this.ids.length)jQuery(".bulk-smush-wrapper .wp-smush-all-done").removeClass("sui-hidden"),jQuery(".wp-smush-bulk-wrapper").addClass("sui-hidden"),jQuery(".wp-smush-bulk-progress-bar-wrapper").addClass("sui-hidden"),this._updateProgress(0,0);else{var e=jQuery(".bulk-smush-wrapper .wp-smush-resmush-notice");e.length>0?e.show():jQuery(".bulk-smush-wrapper .wp-smush-remaining").removeClass("sui-hidden")}jQuery(".wp-resmush.wp-smush-action").removeProp("disabled")}}},{key:"showAnimatedUpsellNotice",value:function(){if(this.errors.length){var e=document.querySelector(".smush-bulk-errors");if(e){var t=e.querySelector('[data-error-code="animated"]');if(t)return Array.prototype.slice.call(e.childNodes,0,5).includes(t)}}}},{key:"maybeShowCDNActivationNotice",value:function(){wp_smush_msgs.smush_cdn_activation_notice&&this.showAnimatedUpsellNotice()&&WP_Smush.helpers.renderActivationCDNNotice(wp_smush_msgs.smush_cdn_activation_notice)}},{key:"maybeShowUnlimitedUpsellNotice",value:function(){var e=document.querySelector(".wp-smush-global-upsell");e&&e.classList.remove("sui-hidden")}},{key:"maybeShowBulkErrorActions",value:function(){if(this.errors.length){var e=document.querySelector(".smush-bulk-errors-actions");e&&e.classList.remove("sui-hidden")}}},{key:"freeExceeded",value:function(){var e=jQuery(".wp-smush-bulk-progress-bar-wrapper");e.addClass("wp-smush-exceed-limit").removeClass("sui-hidden"),e.find(".sui-progress-block .wp-smush-cancel-bulk").removeClass("sui-hidden"),e.find(".sui-progress-block .wp-smush-all").addClass("sui-hidden"),e.find("i.sui-icon-loader").addClass("sui-icon-info").removeClass("sui-icon-loader").removeClass("sui-loading"),document.getElementById("bulk-smush-resume-button").classList.remove("sui-hidden"),this.showBulkFreeLimitReachedNotice()}},{key:"showBulkFreeLimitReachedNotice",value:function(){var e=document.getElementById("smush-limit-reached-notice");e&&e.classList.remove("sui-hidden")}},{key:"hideBulkFreeLimitReachedNotice",value:function(){var e=document.getElementById("smush-limit-reached-notice");e&&e.classList.add("sui-hidden")}},{key:"updateProgress",value:function(t){if(this.is_bulk_resmush||this.is_bulk){var n=0;t&&void 0!==t.data&&void 0!==t.data.stats&&e.updateLocalizedStats(t.data.stats,this.smush_type),this.is_bulk_resmush?(t.success&&(wp_smushit_data.resmush.length>0?jQuery(".wp-smush-images-remaining").html(wp_smushit_data.resmush.length):0===wp_smushit_data.resmush.length&&0===this.ids.length&&(jQuery(".bulk-resmush-wrapper .wp-smush-all-done").removeClass("sui-hidden"),jQuery(".wp-smush-resmush-wrap, .wp-smush-bulk-progress-bar-wrapper").addClass("sui-hidden"))),void 0!==this.ids&&void 0!==this.total&&this.total>0&&(n=(this.smushed+this.errors.length)/this.total*100)):n=(this.smushed+this.errors.length)/this.total*100,"nextgen"===this.smush_type&&wp_smushit_data.resmush.length>0&&this.smushed+this.errors.length<=1&&(wp_smushit_data.count_images-=wp_smushit_data.resmush.length+1),0===this.ids.length&&(jQuery(".bulk-smush-wrapper .wp-smush-all-done").removeClass("sui-hidden"),jQuery(".wp-smush-bulk-wrapper").addClass("sui-hidden")),this._updateProgress(this.smushed+this.errors.length,WP_Smush.helpers.precise_round(n,1)),0===this.ids.length&&"nextgen"!==this.smush_type||e.updateStats(this.smush_type)}}},{key:"_updateProgress",value:function(e,t){(this.is_bulk||this.is_bulk_resmush)&&(jQuery("span.wp-smush-images-percent").html(t+"%"),jQuery(".bulk-smush-wrapper .wp-smush-progress-inner").css("width",t+"%"),jQuery(".bulk-smush-wrapper .sui-progress-state-text").find("span:first-child").html(e).find("span:last-child").html(this.total))}},{key:"continue",value:function(){return this.continueSmush&&this.ids.length>0&&this.is_bulk}},{key:"onStart",value:function(){this.deferred=jQuery.Deferred(),this.deferred.errors=[],this.continueSmush=!0,this.errors=[];var e=jQuery(".bulk-smush-wrapper .sui-progress-state-text");this.smushed=parseInt(e.find("span:first-child").html()),this.total=parseInt(e.find("span:last-child").html()),jQuery(".wp-smush-restore").prop("disabled",!0)}},{key:"callAjax",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(0!==u&&void 0!==u&&10>performance.now()-u)return this.freeExceeded(),this.deferred;var n=window.wp_smush_msgs.nonce;this.current_id=this.is_bulk?this.ids.shift():this.button.data("id"),e.updateSmushIds(this.current_id);var s=this.button.parent().find("#_wp_smush_nonce");s.length>0&&(n=s.val());var i=this;return this.request=e.ajax(this.is_bulk_resmush,this.current_id,this.url,n,t).done((function(t){if(void 0===t.success||void 0!==t.success&&!1===t.success&&void 0!==t.data&&"limit_exceeded"!==t.data.error){i.errors.push(i.current_id);var n=t.data.error,s=WP_Smush.helpers.prepareBulkSmushErrorRow(n.error_message,n.file_name,n.thumbnail,i.current_id,i.smush_type,n.error_code);i.log.removeClass("sui-hidden"),i.log.find(".smush-bulk-errors").append(s),i.errors.length>4&&(i.log.find(".smush-bulk-errors").addClass("overflow-box"),jQuery(".smush-bulk-errors-actions").removeClass("sui-hidden"))}else void 0!==t.success&&t.success&&i.smushed++;e.membershipValidity(t.data),void 0!==t.data&&"limit_exceeded"===t.data.error&&"resolved"!==i.deferred.state()?(document.getElementById("wp-smush-running-notice").classList.add("sui-hidden"),i.continueSmush=!1,wp_smushit_data.unsmushed.unshift(i.current_id),i.ids.unshift(i.current_id),u=performance.now(),i.freeExceeded()):i.is_bulk&&(i.updateProgress(t),e.updateScoreProgress()),0===i.ids.length&&i.is_bulk&&i.onBulkSmushCompleted(),i.singleDone()})).always((function(){i.continue()&&i.is_bulk?i.callAjax(!1):i.deferred.resolve()})),this.deferred.errors=this.errors,this.deferred}},{key:"maybeShowCDNUpsellForPreSiteOnCompleted",value:function(){var e=document.querySelector(".wp-smush-upsell-cdn");e&&(e.querySelector("p").innerHTML=wp_smush_msgs.processed_cdn_for_free,e.classList.remove("sui-hidden"))}},{key:"onBulkSmushCompleted",value:function(){var e=this;this.maybeShowUnlimitedUpsellNotice(),this.maybeShowCDNActivationNotice(),this.maybeShowCDNUpsellForPreSiteOnCompleted(),this.maybeShowBulkErrorActions();var t=this.is_bulk?function(){return e.trackBulkSmushCompleted()}:function(){return!1};this.syncStats().done(t)}},{key:"getPercentOptimized",value:function(e,t){return e===t||e<=0?100:Math.floor(100*(e-t)/e)}},{key:"trackBulkSmushCompleted",value:function(){this.mixPanel.trackBulkSmushCompleted(s.h.getGlobalStats())}},{key:"run",value:function(){this.is_bulk&&this.ids.length>0&&this.callAjax(!0),this.is_bulk||this.callAjax()}},{key:"bindDeferredEvents",value:function(){var e=this;this.deferred.done((function(){if(e.continueSmush=!0,e.errors.length){var t=e.errors.length===e.total?window.wp_smush_msgs.all_failed:window.wp_smush_msgs.error_in_bulk.replace("{{errors}}",e.errors.length).replace("{{total}}",e.total).replace("{{smushed}}",e.smushed);jQuery(".wp-smush-all-done").addClass("sui-notice-warning").removeClass("sui-notice-success").find("p").html(t)}e.bulkDone(),jQuery(".wp-smush-all:not(.wp-smush-finished)").prop("disabled",!1)}))}},{key:"cancelAjax",value:function(){this.continueSmush=!1,this.syncStats(),this.request.abort(),this.enableButton(),this.button.removeClass("wp-smush-started"),wp_smushit_data.unsmushed.unshift(this.current_id),jQuery(".wp-smush-bulk-wrapper").removeClass("sui-hidden"),jQuery(".wp-smush-bulk-progress-bar-wrapper").addClass("sui-hidden"),this.mixPanel.trackBulkSmushCancel(),this.hideBulkFreeLimitReachedNotice()}}],c=[{key:"smushAddParams",value:function(e,t){return jQuery.isEmptyObject(t)||(e+=(e.indexOf("?")>=0?"&":"?")+jQuery.param(t)),e}},{key:"membershipValidity",value:function(e){var t=jQuery("#wp-smush-invalid-member");void 0!==e&&void 0!==e.show_warning&&t.length>0&&(e.show_warning?t.show():t.hide())}},{key:"ajax",value:function(e,t,n,s){var i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],r=jQuery.param({is_bulk_resmush:e,attachment_id:t,_nonce:s,new_bulk_smush_started:i});return jQuery.ajax({type:"GET",data:r,url:n,timeout:wp_smushit_data.timeout,dataType:"json"})}},{key:"getTotalImagesToSmush",value:function(){var e=wp_smushit_data.resmush.length,t=wp_smushit_data.count_total-wp_smushit_data.count_smushed;return t>0?e+t:e}},{key:"updateScoreProgress",value:function(){var t="sui-grade-dismissed",n=0,s=0,i=e.getTotalImagesToSmush(),r=parseInt(wp_smushit_data.count_total);r===i?(r>0&&(t="sui-grade-f"),s=100):0<r&&(s=n=Math.floor(100*(r-i)/r),t="sui-grade-f",n>=60&&n<90?t="sui-grade-c":n>=90&&(t="sui-grade-a"));var o=jQuery("#smush-image-score");o.removeClass((function(e,t){return(t.match(/(^|\s)sui-grade-\S+/g)||[]).join(" ")})).addClass(t).attr("data-score",n).find(".sui-circle-score-label").html(n),o.find("circle:last-child").attr("style","--metric-array:"+2.63893782902*s+" "+(263.893782902-s))}},{key:"updateStats",value:function(e){var t=void 0!==e&&"nextgen"===e;wp_smushit_data.savings_bytes=parseInt(wp_smushit_data.size_before)-parseInt(wp_smushit_data.size_after);var n=WP_Smush.helpers.formatBytes(wp_smushit_data.savings_bytes,0),s=jQuery(".wp-smush-savings .wp-smush-stats-human");t?s.html(n):(s.html(WP_Smush.helpers.getFormatFromString(n)),jQuery(".sui-summary-large.wp-smush-stats-human").html(WP_Smush.helpers.getSizeFromString(n))),wp_smushit_data.savings_percent=WP_Smush.helpers.precise_round(parseInt(wp_smushit_data.savings_bytes)/parseInt(wp_smushit_data.size_before)*100,1),isNaN(wp_smushit_data.savings_percent)||jQuery(".wp-smush-savings .wp-smush-stats-percent").html(wp_smushit_data.savings_percent),t?jQuery(".sui-summary-details span.wp-smush-total-optimised").html(wp_smushit_data.count_images):jQuery("span.smushed-items-count span.wp-smush-count-total span.wp-smush-total-optimised").html(wp_smushit_data.count_images),wp_smushit_data.count_resize>0&&(jQuery("span.smushed-items-count span.wp-smush-count-resize-total").removeClass("sui-hidden"),jQuery("span.smushed-items-count span.wp-smush-count-resize-total span.wp-smush-total-optimised").html(wp_smushit_data.count_resize));var i=jQuery("li.super-smush-attachments .smushed-count");i.length&&void 0!==wp_smushit_data.count_supersmushed&&i.html(wp_smushit_data.count_supersmushed);var r=jQuery(".smush-conversion-savings");if(r.length>0&&void 0!==wp_smushit_data.savings_conversion&&""!==wp_smushit_data.savings_conversion){var o=r.find(".wp-smush-stats");o.length>0&&o.html(WP_Smush.helpers.formatBytes(wp_smushit_data.savings_conversion,1))}}},{key:"updateImageStats",value:function(e){if(0!==e){var t=jQuery(".attachment-info .file-size");if(t.contents().filter((function(){return 3===this.nodeType})).text()!==" "+e){var n=t.contents().filter((function(){return 1===this.nodeType})).text();t.html("<strong>"+n+"</strong> "+e)}}}},{key:"updateLocalizedStats",value:function(e,t){void 0!==window.wp_smushit_data&&("media"===t?(wp_smushit_data.count_smushed=parseInt(wp_smushit_data.count_smushed)+1,wp_smushit_data.count_images=parseInt(wp_smushit_data.count_images)+parseInt(e.count),e.is_lossy&&(wp_smushit_data.count_supersmushed=parseInt(wp_smushit_data.count_supersmushed)+1),wp_smushit_data.savings_resize=void 0!==e.savings_resize.bytes?parseInt(wp_smushit_data.savings_resize)+parseInt(e.savings_resize.bytes):parseInt(wp_smushit_data.savings_resize),wp_smushit_data.count_resize=void 0!==e.savings_resize.bytes?parseInt(wp_smushit_data.count_resize)+1:wp_smushit_data.count_resize,wp_smushit_data.savings_conversion=void 0!==e.savings_conversion&&void 0!==e.savings_conversion.bytes?parseInt(wp_smushit_data.savings_conversion)+parseInt(e.savings_conversion.bytes):parseInt(wp_smushit_data.savings_conversion)):"directory_smush"===t?wp_smushit_data.count_images=parseInt(wp_smushit_data.count_images)+1:"nextgen"===t&&(wp_smushit_data.count_smushed=parseInt(wp_smushit_data.count_smushed)+1,wp_smushit_data.count_supersmushed=parseInt(wp_smushit_data.count_supersmushed)+1,wp_smushit_data.count_images=parseInt(wp_smushit_data.count_images)+parseInt(e.count)),e.size_before>e.size_after&&(wp_smushit_data.size_before=void 0!==e.size_before?parseInt(wp_smushit_data.size_before)+parseInt(e.size_before):parseInt(wp_smushit_data.size_before),wp_smushit_data.size_after=void 0!==e.size_after?parseInt(wp_smushit_data.size_after)+parseInt(e.size_after):parseInt(wp_smushit_data.size_after)),void 0!==e.savings_resize&&(wp_smushit_data.size_before=void 0!==e.savings_resize.size_before?parseInt(wp_smushit_data.size_before)+parseInt(e.savings_resize.size_before):parseInt(wp_smushit_data.size_before),wp_smushit_data.size_after=void 0!==e.savings_resize.size_after?parseInt(wp_smushit_data.size_after)+parseInt(e.savings_resize.size_after):parseInt(wp_smushit_data.size_after)),void 0!==e.savings_conversion&&(wp_smushit_data.size_before=void 0!==e.savings_conversion.size_before?parseInt(wp_smushit_data.size_before)+parseInt(e.savings_conversion.size_before):parseInt(wp_smushit_data.size_before),wp_smushit_data.size_after=void 0!==e.savings_conversion.size_after?parseInt(wp_smushit_data.size_after)+parseInt(e.savings_conversion.size_after):parseInt(wp_smushit_data.size_after)))}},{key:"prepareErrorRow",value:function(e,t,n,s,i){var r='<div class="smush-bulk-error-row"><div class="smush-bulk-image-data">'+(void 0===n?'<i class="sui-icon-photo-picture" aria-hidden="true"></i>':n)+'<span class="smush-image-name">'+("undefined"===t||void 0===t?"undefined":t)+'</span><span class="smush-image-error">'+e+"</span></div>";return"media"===i&&(r=r+'<div class="smush-bulk-image-actions"><button type="button" class="sui-button-icon sui-tooltip sui-tooltip-constrained sui-tooltip-left smush-ignore-image" data-tooltip="'+window.wp_smush_msgs.error_ignore+'" data-id="'+s+'"><i class="sui-icon-eye-hide" aria-hidden="true"></i></button></div>'),r+="</div>"}},{key:"updateSmushIds",value:function(e){if(void 0!==wp_smushit_data.unsmushed&&wp_smushit_data.unsmushed.length>0){var t=wp_smushit_data.unsmushed.indexOf(e);t>-1&&wp_smushit_data.unsmushed.splice(t,1)}if(void 0!==wp_smushit_data.resmush&&wp_smushit_data.resmush.length>0){var n=wp_smushit_data.resmush.indexOf(e);n>-1&&wp_smushit_data.resmush.splice(n,1)}}}],n&&a(t.prototype,n),c&&a(t,c),Object.defineProperty(t,"prototype",{writable:!1}),e}();t.Z=c},1442:function(){!function(){"use strict";WP_Smush.WebP={nonceField:document.getElementsByName("wp_smush_options_nonce"),toggleModuleButton:document.getElementById("smush-toggle-webp-button"),recheckStatusButton:document.getElementById("smush-webp-recheck"),recheckStatusLink:document.getElementById("smush-webp-recheck-link"),showWizardButton:document.getElementById("smush-webp-toggle-wizard"),init:function(){var e=this;this.maybeShowDeleteAllSuccessNotice(),this.toggleModuleButton&&this.toggleModuleButton.addEventListener("click",(function(t){return e.toggleWebp(t)})),this.recheckStatusButton&&this.recheckStatusButton.addEventListener("click",(function(t){t.preventDefault(),e.recheckStatus()})),this.recheckStatusLink&&this.recheckStatusLink.addEventListener("click",(function(t){t.preventDefault(),e.recheckStatus()})),document.getElementById("wp-smush-webp-delete-all")&&document.getElementById("wp-smush-webp-delete-all").addEventListener("click",(function(t){return e.deleteAll(t)})),this.showWizardButton&&this.showWizardButton.addEventListener("click",this.toggleWizard)},toggleWebp:function(e){var t=this;e.preventDefault();var n=e.currentTarget,s="enable"===n.dataset.action;n.classList.add("sui-button-onload");var i=new XMLHttpRequest;i.open("POST",ajaxurl+"?action=smush_webp_toggle",!0),i.setRequestHeader("Content-type","application/x-www-form-urlencoded"),i.onload=function(){var e=JSON.parse(i.response);if(200===i.status){if(void 0!==e.success&&e.success)t.runScan().onload=function(){window.location.href=window.wp_smush_msgs.localWebpURL};else void 0!==e.data.message&&(t.showNotice(e.data.message),n.classList.remove("sui-button-onload"))}else{var s=window.wp_smush_msgs.generic_ajax_error;e&&void 0!==e.data.message&&(s=e.data.message),t.showNotice(s),n.classList.remove("sui-button-onload")}},i.send("param="+s+"&_ajax_nonce="+this.nonceField[0].value)},recheckStatus:function(){var e=this;this.recheckStatusButton.classList.add("sui-button-onload");var t=new XMLHttpRequest;t.open("POST",ajaxurl+"?action=smush_webp_get_status",!0),t.setRequestHeader("Content-type","application/x-www-form-urlencoded"),t.onload=function(){e.recheckStatusButton.classList.remove("sui-button-onload");var n=!1,s=JSON.parse(t.response);200===t.status?(s.success?"1":"0")!==e.recheckStatusButton.dataset.isConfigured&&location.reload():n=window.wp_smush_msgs.generic_ajax_error;s&&s.data&&(n=s.data),n&&e.showNotice(n)},t.send("_ajax_nonce="+window.wp_smush_msgs.webp_nonce)},deleteAll:function(e){var t=this,n=e.currentTarget;n.classList.add("sui-button-onload");var s=!1,i=new XMLHttpRequest;i.open("POST",ajaxurl+"?action=smush_webp_delete_all",!0),i.setRequestHeader("Content-type","application/x-www-form-urlencoded"),i.onload=function(){var e=JSON.parse(i.response);200===i.status?void 0!==e.success&&e.success?t.runScan().onload=function(){location.search=location.search+"&notice=webp-deleted"}:s=window.wp_smush_msgs.generic_ajax_error:s=window.wp_smush_msgs.generic_ajax_error;if(e&&e.data&&e.data.message&&(s=e.data.message),s){n.classList.remove("sui-button-onload");var r='<p style="text-align: left;">'.concat(s,"</p>");window.SUI.openNotice("wp-smush-webp-delete-all-error-notice",r,{type:"error",icon:"info",autoclose:{show:!1}})}},i.send("_ajax_nonce="+this.nonceField[0].value)},toggleWizard:function(e){e.currentTarget.classList.add("sui-button-onload");var t=new XMLHttpRequest;t.open("GET",ajaxurl+"?action=smush_toggle_webp_wizard&_ajax_nonce="+window.wp_smush_msgs.webp_nonce,!0),t.onload=function(){return location.reload()},t.send()},runScan:function(){var e=new XMLHttpRequest,t=document.getElementsByName("wp_smush_options_nonce");return e.open("POST",ajaxurl+"?action=scan_for_resmush",!0),e.setRequestHeader("Content-type","application/x-www-form-urlencoded"),e.send("_ajax_nonce="+t[0].value),e},showNotice:function(e,t){if(void 0!==e){var n="<p>".concat(e,"</p>"),s={type:t||"error",icon:"info",dismiss:{show:!0,label:window.wp_smush_msgs.noticeDismiss,tooltip:window.wp_smush_msgs.noticeDismissTooltip},autoclose:{show:!1}};window.SUI.openNotice("wp-smush-ajax-notice",n,s)}},maybeShowDeleteAllSuccessNotice:function(){if(document.getElementById("wp-smush-webp-delete-all-notice")){var e="<p>".concat(document.getElementById("wp-smush-webp-delete-all-notice").dataset.message,"</p>");window.SUI.openNotice("wp-smush-webp-delete-all-notice",e,{type:"success",icon:"check-tick",dismiss:{show:!0}})}}},WP_Smush.WebP.init()}()},4218:function(e,t,n){"use strict";var s=n(8583),i=n.n(s);function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}var o=new function(){function e(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={url:ajaxurl,method:arguments.length>2&&void 0!==arguments[2]?arguments[2]:"POST",cache:!1};return t instanceof FormData?(t.append("action",e),t.append("_ajax_nonce",window.wp_smush_msgs.nonce),n.contentType=!1,n.processData=!1):(t._ajax_nonce=t._ajax_nonce||window.wp_smush_msgs.nonce,t.action=e),n.data=t,new Promise((function(e,t){jQuery.ajax(n).done(e).fail(t)})).then((function(e){return"object"!==r(e)&&(e=JSON.parse(e)),e})).catch((function(e){console.error("Error:",e)}))}var t={background:{start:function(){return e("bulk_smush_start")},cancel:function(){return e("bulk_smush_cancel")},initState:function(){return e("bulk_smush_get_status")},getStatus:function(){return e("bulk_smush_get_status")},getStats:function(){return e("bulk_smush_get_global_stats")}},smush:{syncStats:function(t){return e("get_stats",t=t||{})},ignoreAll:function(t){return e("wp_smush_ignore_all_failed_items",{type:t})}},common:{dismissNotice:function(t){return e("smush_dismiss_notice",{key:t})},hideModal:function(t){return e("hide_modal",{modal_id:t})},request:function(t){return t.action&&e(t.action,t)}},scanMediaLibrary:{start:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return e("wp_smush_start_background_scan",{optimize_on_scan_completed:t=t?1:0,_ajax_nonce:window.wp_smushit_data.media_library_scan.nonce})},cancel:function(){return e("wp_smush_cancel_background_scan",{_ajax_nonce:window.wp_smushit_data.media_library_scan.nonce})},getScanStatus:function(){return e("wp_smush_get_background_scan_status",{_ajax_nonce:window.wp_smushit_data.media_library_scan.nonce})}}};i()(this,t)};t.Z=o},1414:function(e,t,n){var s,i,r;i=[n(5311),n(3860)],s=function(e){"use strict";if(!e.ui||!e.ui.fancytree){var t,n,s=null,i=new RegExp(/\.|\//),r=/[&<>"'/]/g,o=/[<>"'/]/g,a="$recursive_request",u="$request_target_invalid",c={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"},l={16:!0,17:!0,18:!0},d={8:"backspace",9:"tab",10:"return",13:"return",19:"pause",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"insert",46:"del",59:";",61:"=",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12",144:"numlock",145:"scroll",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},h={16:"shift",17:"ctrl",18:"alt",91:"meta",93:"meta"},p={0:"",1:"left",2:"middle",3:"right"},f="active expanded focus folder lazy radiogroup selected unselectable unselectableIgnore".split(" "),m={},_="columns types".split(" "),g="checkbox expanded extraClasses folder icon iconTooltip key lazy partsel radiogroup refKey selected statusNodeType title tooltip type unselectable unselectableIgnore unselectableStatus".split(" "),v={},y={},b={active:!0,children:!0,data:!0,focus:!0};for(t=0;t<f.length;t++)m[f[t]]=!0;for(t=0;t<g.length;t++)n=g[t],v[n]=!0,n!==n.toLowerCase()&&(y[n.toLowerCase()]=n);var w=Array.isArray;return k(e.ui,"Fancytree requires jQuery UI (http://jqueryui.com)"),Date.now||(Date.now=function(){return(new Date).getTime()}),R.prototype={_findDirectChild:function(e){var t,n,s=this.children;if(s)if("string"==typeof e){for(t=0,n=s.length;t<n;t++)if(s[t].key===e)return s[t]}else{if("number"==typeof e)return this.children[e];if(e.parent===this)return e}return null},_setChildren:function(e){k(e&&(!this.children||0===this.children.length),"only init supported"),this.children=[];for(var t=0,n=e.length;t<n;t++)this.children.push(new R(this,e[t]));this.tree._callHook("treeStructureChanged",this.tree,"setChildren")},addChildren:function(t,n){var s,i,r,o=this.getFirstChild(),a=this.getLastChild(),u=null,c=[];for(e.isPlainObject(t)&&(t=[t]),this.children||(this.children=[]),s=0,i=t.length;s<i;s++)c.push(new R(this,t[s]));if(u=c[0],null==n?this.children=this.children.concat(c):(n=this._findDirectChild(n),k((r=e.inArray(n,this.children))>=0,"insertBefore must be an existing child"),this.children.splice.apply(this.children,[r,0].concat(c))),o&&!n){for(s=0,i=c.length;s<i;s++)c[s].render();o!==this.getFirstChild()&&o.renderStatus(),a!==this.getLastChild()&&a.renderStatus()}else(!this.parent||this.parent.ul||this.tr)&&this.render();return 3===this.tree.options.selectMode&&this.fixSelection3FromEndNodes(),this.triggerModifyChild("add",1===c.length?c[0]:null),u},addClass:function(e){return this.toggleClass(e,!0)},addNode:function(e,t){switch(void 0!==t&&"over"!==t||(t="child"),t){case"after":return this.getParent().addChildren(e,this.getNextSibling());case"before":return this.getParent().addChildren(e,this);case"firstChild":var n=this.children?this.children[0]:null;return this.addChildren(e,n);case"child":case"over":return this.addChildren(e)}k(!1,"Invalid mode: "+t)},addPagingNode:function(t,n){var s,i;if(n=n||"child",!1!==t)return t=e.extend({title:this.tree.options.strings.moreData,statusNodeType:"paging",icon:!1},t),this.partload=!0,this.addNode(t,n);for(s=this.children.length-1;s>=0;s--)"paging"===(i=this.children[s]).statusNodeType&&this.removeChild(i);this.partload=!1},appendSibling:function(e){return this.addNode(e,"after")},applyCommand:function(e,t){return this.tree.applyCommand(e,this,t)},applyPatch:function(e){if(null===e)return this.remove(),B(this);var t,n,s={children:!0,expanded:!0,parent:!0};for(t in e)S(e,t)&&(n=e[t],s[t]||x(n)||(v[t]?this[t]=n:this.data[t]=n));return S(e,"children")&&(this.removeChildren(),e.children&&this._setChildren(e.children)),this.isVisible()&&(this.renderTitle(),this.renderStatus()),S(e,"expanded")?this.setExpanded(e.expanded):B(this)},collapseSiblings:function(){return this.tree._callHook("nodeCollapseSiblings",this)},copyTo:function(e,t,n){return e.addNode(this.toDict(!0,n),t)},countChildren:function(e){var t,n,s,i=this.children;if(!i)return 0;if(s=i.length,!1!==e)for(t=0,n=s;t<n;t++)s+=i[t].countChildren();return s},debug:function(e){this.tree.options.debugLevel>=4&&(Array.prototype.unshift.call(arguments,this.toString()),E("log",arguments))},discard:function(){return this.warn("FancytreeNode.discard() is deprecated since 2014-02-16. Use .resetLazy() instead."),this.resetLazy()},discardMarkup:function(e){var t=e?"nodeRemoveMarkup":"nodeRemoveChildMarkup";this.tree._callHook(t,this)},error:function(e){this.tree.options.debugLevel>=1&&(Array.prototype.unshift.call(arguments,this.toString()),E("error",arguments))},findAll:function(e){e=x(e)?e:A(e);var t=[];return this.visit((function(n){e(n)&&t.push(n)})),t},findFirst:function(e){e=x(e)?e:A(e);var t=null;return this.visit((function(n){if(e(n))return t=n,!1})),t},findRelatedNode:function(e,t){return this.tree.findRelatedNode(this,e,t)},_changeSelectStatusAttrs:function(e){var t=!1,n=this.tree.options,i=s.evalOption("unselectable",this,this,n,!1),r=s.evalOption("unselectableStatus",this,this,n,void 0);switch(i&&null!=r&&(e=r),e){case!1:t=this.selected||this.partsel,this.selected=!1,this.partsel=!1;break;case!0:t=!this.selected||!this.partsel,this.selected=!0,this.partsel=!0;break;case void 0:t=this.selected||!this.partsel,this.selected=!1,this.partsel=!0;break;default:k(!1,"invalid state: "+e)}return t&&this.renderStatus(),t},fixSelection3AfterClick:function(e){var t=this.isSelected();this.visit((function(e){if(e._changeSelectStatusAttrs(t),e.radiogroup)return"skip"})),this.fixSelection3FromEndNodes(e)},fixSelection3FromEndNodes:function(e){var t=this.tree.options;function n(e){var i,r,o,a,u,c,l,d,h=e.children;if(h&&h.length){for(c=!0,l=!1,i=0,r=h.length;i<r;i++)a=n(o=h[i]),s.evalOption("unselectableIgnore",o,o,t,!1)||(!1!==a&&(l=!0),!0!==a&&(c=!1));u=!!c||!!l&&void 0}else u=null==(d=s.evalOption("unselectableStatus",e,e,t,void 0))?!!e.selected:!!d;return e.partsel&&!e.selected&&e.lazy&&null==e.children&&(u=void 0),e._changeSelectStatusAttrs(u),u}k(3===t.selectMode,"expected selectMode 3"),n(this),this.visitParents((function(e){var n,i,r,o,a,u=e.children,c=!0,l=!1;for(n=0,i=u.length;n<i;n++)r=u[n],s.evalOption("unselectableIgnore",r,r,t,!1)||(((o=null==(a=s.evalOption("unselectableStatus",r,r,t,void 0))?!!r.selected:!!a)||r.partsel)&&(l=!0),o||(c=!1));o=!!c||!!l&&void 0,e._changeSelectStatusAttrs(o)}))},fromDict:function(t){for(var n in t)v[n]?this[n]=t[n]:"data"===n?e.extend(this.data,t.data):x(t[n])||b[n]||(this.data[n]=t[n]);t.children&&(this.removeChildren(),this.addChildren(t.children)),this.renderTitle()},getChildren:function(){if(void 0!==this.hasChildren())return this.children},getFirstChild:function(){return this.children?this.children[0]:null},getIndex:function(){return e.inArray(this,this.parent.children)},getIndexHier:function(t,n){t=t||".";var s,i=[];return e.each(this.getParentList(!1,!0),(function(e,t){s=""+(t.getIndex()+1),n&&(s=("0000000"+s).substr(-n)),i.push(s)})),i.join(t)},getKeyPath:function(e){var t=this.tree.options.keyPathSeparator;return t+this.getPath(!e,"key",t)},getLastChild:function(){return this.children?this.children[this.children.length-1]:null},getLevel:function(){for(var e=0,t=this.parent;t;)e++,t=t.parent;return e},getNextSibling:function(){if(this.parent){var e,t,n=this.parent.children;for(e=0,t=n.length-1;e<t;e++)if(n[e]===this)return n[e+1]}return null},getParent:function(){return this.parent},getParentList:function(e,t){for(var n=[],s=t?this:this.parent;s;)(e||s.parent)&&n.unshift(s),s=s.parent;return n},getPath:function(e,t,n){e=!1!==e,n=n||"/";var s,i=[],r=x(t=t||"title");return this.visitParents((function(e){e.parent&&(s=r?t(e):e[t],i.unshift(s))}),e),i.join(n)},getPrevSibling:function(){if(this.parent){var e,t,n=this.parent.children;for(e=1,t=n.length;e<t;e++)if(n[e]===this)return n[e-1]}return null},getSelectedNodes:function(e){var t=[];return this.visit((function(n){if(n.selected&&(t.push(n),!0===e))return"skip"})),t},hasChildren:function(){if(this.lazy){if(null==this.children)return;if(0===this.children.length)return!1;if(1===this.children.length&&this.children[0].isStatusNode())return;return!0}return!(!this.children||!this.children.length)},hasClass:function(e){return(" "+(this.extraClasses||"")+" ").indexOf(" "+e+" ")>=0},hasFocus:function(){return this.tree.hasFocus()&&this.tree.focusNode===this},info:function(e){this.tree.options.debugLevel>=3&&(Array.prototype.unshift.call(arguments,this.toString()),E("info",arguments))},isActive:function(){return this.tree.activeNode===this},isBelowOf:function(e){return this.getIndexHier(".",5)>e.getIndexHier(".",5)},isChildOf:function(e){return this.parent&&this.parent===e},isDescendantOf:function(t){if(!t||t.tree!==this.tree)return!1;for(var n=this.parent;n;){if(n===t)return!0;n===n.parent&&e.error("Recursive parent link: "+n),n=n.parent}return!1},isExpanded:function(){return!!this.expanded},isFirstSibling:function(){var e=this.parent;return!e||e.children[0]===this},isFolder:function(){return!!this.folder},isLastSibling:function(){var e=this.parent;return!e||e.children[e.children.length-1]===this},isLazy:function(){return!!this.lazy},isLoaded:function(){return!this.lazy||void 0!==this.hasChildren()},isLoading:function(){return!!this._isLoading},isRoot:function(){return this.isRootNode()},isPartsel:function(){return!this.selected&&!!this.partsel},isPartload:function(){return!!this.partload},isRootNode:function(){return this.tree.rootNode===this},isSelected:function(){return!!this.selected},isStatusNode:function(){return!!this.statusNodeType},isPagingNode:function(){return"paging"===this.statusNodeType},isTopLevel:function(){return this.tree.rootNode===this.parent},isUndefined:function(){return void 0===this.hasChildren()},isVisible:function(){var e,t,n=this.tree.enableFilter,s=this.getParentList(!1,!1);if(n&&!this.match&&!this.subMatchCount)return!1;for(e=0,t=s.length;e<t;e++)if(!s[e].expanded)return!1;return!0},lazyLoad:function(t){e.error("FancytreeNode.lazyLoad() is deprecated since 2014-02-16. Use .load() instead.")},load:function(e){var t,n,s=this,i=this.isExpanded();return k(this.isLazy(),"load() requires a lazy node"),e||this.isUndefined()?(this.isLoaded()&&this.resetLazy(),!1===(n=this.tree._triggerNodeEvent("lazyLoad",this))?B(this):(k("boolean"!=typeof n,"lazyLoad event must return source in data.result"),t=this.tree._callHook("nodeLoadChildren",this,n),i?(this.expanded=!0,t.always((function(){s.render()}))):t.always((function(){s.renderStatus()})),t)):B(this)},makeVisible:function(t){var n,s=this,i=[],r=new e.Deferred,o=this.getParentList(!1,!1),a=o.length,u=!(t&&!0===t.noAnimation),c=!(t&&!1===t.scrollIntoView);for(n=a-1;n>=0;n--)i.push(o[n].setExpanded(!0,t));return e.when.apply(e,i).done((function(){c?s.scrollIntoView(u).done((function(){r.resolve()})):r.resolve()})),r.promise()},moveTo:function(t,n,s){void 0===n||"over"===n?n="child":"firstChild"===n&&(t.children&&t.children.length?(n="before",t=t.children[0]):n="child");var i,r=this.tree,o=this.parent,a="child"===n?t:t.parent;if(this!==t){if(this.parent?a.isDescendantOf(this)&&e.error("Cannot move a node to its own descendant"):e.error("Cannot move system root"),a!==o&&o.triggerModifyChild("remove",this),1===this.parent.children.length){if(this.parent===a)return;this.parent.children=this.parent.lazy?[]:null,this.parent.expanded=!1}else k((i=e.inArray(this,this.parent.children))>=0,"invalid source parent"),this.parent.children.splice(i,1);if(this.parent=a,a.hasChildren())switch(n){case"child":a.children.push(this);break;case"before":k((i=e.inArray(t,a.children))>=0,"invalid target parent"),a.children.splice(i,0,this);break;case"after":k((i=e.inArray(t,a.children))>=0,"invalid target parent"),a.children.splice(i+1,0,this);break;default:e.error("Invalid mode "+n)}else a.children=[this];s&&t.visit(s,!0),a===o?a.triggerModifyChild("move",this):a.triggerModifyChild("add",this),r!==t.tree&&(this.warn("Cross-tree moveTo is experimental!"),this.visit((function(e){e.tree=t.tree}),!0)),r._callHook("treeStructureChanged",r,"moveTo"),o.isDescendantOf(a)||o.render(),a.isDescendantOf(o)||a===o||a.render()}},navigate:function(t,n){var s,i=e.ui.keyCode;switch(t){case"left":case i.LEFT:if(this.expanded)return this.setExpanded(!1);break;case"right":case i.RIGHT:if(!this.expanded&&(this.children||this.lazy))return this.setExpanded()}if(s=this.findRelatedNode(t)){try{s.makeVisible({scrollIntoView:!1})}catch(e){}return!1===n?(s.setFocus(),B()):s.setActive()}return this.warn("Could not find related node '"+t+"'."),B()},remove:function(){return this.parent.removeChild(this)},removeChild:function(e){return this.tree._callHook("nodeRemoveChild",this,e)},removeChildren:function(){return this.tree._callHook("nodeRemoveChildren",this)},removeClass:function(e){return this.toggleClass(e,!1)},render:function(e,t){return this.tree._callHook("nodeRender",this,e,t)},renderTitle:function(){return this.tree._callHook("nodeRenderTitle",this)},renderStatus:function(){return this.tree._callHook("nodeRenderStatus",this)},replaceWith:function(n){var s,i=this.parent,r=e.inArray(this,i.children),o=this;return k(this.isPagingNode(),"replaceWith() currently requires a paging status node"),(s=this.tree._callHook("nodeLoadChildren",this,n)).done((function(e){var n=o.children;for(t=0;t<n.length;t++)n[t].parent=i;i.children.splice.apply(i.children,[r+1,0].concat(n)),o.children=null,o.remove(),i.render()})).fail((function(){o.setExpanded()})),s},resetLazy:function(){this.removeChildren(),this.expanded=!1,this.lazy=!0,this.children=void 0,this.renderStatus()},scheduleAction:function(t,n){this.tree.timer&&(clearTimeout(this.tree.timer),this.tree.debug("clearTimeout(%o)",this.tree.timer)),this.tree.timer=null;var s=this;switch(t){case"cancel":break;case"expand":this.tree.timer=setTimeout((function(){s.tree.debug("setTimeout: trigger expand"),s.setExpanded(!0)}),n);break;case"activate":this.tree.timer=setTimeout((function(){s.tree.debug("setTimeout: trigger activate"),s.setActive(!0)}),n);break;default:e.error("Invalid mode "+t)}},scrollIntoView:function(t,n){if(void 0!==n&&N(n))throw Error("scrollIntoView() with 'topNode' option is deprecated since 2014-05-08. Use 'options.topNode' instead.");var s=e.extend({effects:!0===t?{duration:200,queue:!1}:t,scrollOfs:this.tree.options.scrollOfs,scrollParent:this.tree.options.scrollParent,topNode:null},n),i=s.scrollParent,r=this.tree.$container,o=r.css("overflow-y");i?i.jquery||(i=e(i)):i=this.tree.tbody?r.scrollParent():"scroll"===o||"auto"===o?r:r.scrollParent(),i[0]!==document&&i[0]!==document.body||(this.debug("scrollIntoView(): normalizing scrollParent to 'window':",i[0]),i=e(window));var a,u,c,l=new e.Deferred,d=this,h=e(this.span).height(),p=s.scrollOfs.top||0,f=s.scrollOfs.bottom||0,m=i.height(),_=i.scrollTop(),g=i,v=i[0]===window,y=s.topNode||null,b=null;return this.isRootNode()||!this.isVisible()?(this.info("scrollIntoView(): node is invisible."),B()):(v?(u=e(this.span).offset().top,a=y&&y.span?e(y.span).offset().top:0,g=e("html,body")):(k(i[0]!==document&&i[0]!==document.body,"scrollParent should be a simple element or `window`, not document or body."),c=i.offset().top,u=e(this.span).offset().top-c+_,a=y?e(y.span).offset().top-c+_:0,m-=Math.max(0,i.innerHeight()-i[0].clientHeight)),u<_+p?b=u-p:u+h>_+m-f&&(b=u+h-m+f,y&&(k(y.isRootNode()||y.isVisible(),"topNode must be visible"),a<b&&(b=a-p))),null===b?l.resolveWith(this):s.effects?(s.effects.complete=function(){l.resolveWith(d)},g.stop(!0).animate({scrollTop:b},s.effects)):(g[0].scrollTop=b,l.resolveWith(this)),l.promise())},setActive:function(e,t){return this.tree._callHook("nodeSetActive",this,e,t)},setExpanded:function(e,t){return this.tree._callHook("nodeSetExpanded",this,e,t)},setFocus:function(e){return this.tree._callHook("nodeSetFocus",this,e)},setSelected:function(e,t){return this.tree._callHook("nodeSetSelected",this,e,t)},setStatus:function(e,t,n){return this.tree._callHook("nodeSetStatus",this,e,t,n)},setTitle:function(e){this.title=e,this.renderTitle(),this.triggerModify("rename")},sortChildren:function(e,t){var n,s,i=this.children;if(i){if(e=e||function(e,t){var n=e.title.toLowerCase(),s=t.title.toLowerCase();return n===s?0:n>s?1:-1},i.sort(e),t)for(n=0,s=i.length;n<s;n++)i[n].children&&i[n].sortChildren(e,"$norender$");"$norender$"!==t&&this.render(),this.triggerModifyChild("sort")}},toDict:function(t,n){var s,i,r,o,a={},u=this;if(e.each(g,(function(e,t){(u[t]||!1===u[t])&&(a[t]=u[t])})),e.isEmptyObject(this.data)||(a.data=e.extend({},this.data),e.isEmptyObject(a.data)&&delete a.data),n){if(!1===(o=n(a,u)))return!1;"skip"===o&&(t=!1)}if(t&&w(this.children))for(a.children=[],s=0,i=this.children.length;s<i;s++)(r=this.children[s]).isStatusNode()||!1!==(o=r.toDict(!0,n))&&a.children.push(o);return a},toggleClass:function(t,n){var s,i,r=/\S+/g,o=t.match(r)||[],a=0,u=!1,c=this[this.tree.statusClassPropName],l=" "+(this.extraClasses||"")+" ";for(c&&e(c).toggleClass(t,n);s=o[a++];)if(i=l.indexOf(" "+s+" ")>=0,n=void 0===n?!i:!!n)i||(l+=s+" ",u=!0);else for(;l.indexOf(" "+s+" ")>-1;)l=l.replace(" "+s+" "," ");return this.extraClasses=C(l),u},toggleExpanded:function(){return this.tree._callHook("nodeToggleExpanded",this)},toggleSelected:function(){return this.tree._callHook("nodeToggleSelected",this)},toString:function(){return"FancytreeNode@"+this.key+"[title='"+this.title+"']"},triggerModifyChild:function(t,n,s){var i,r=this.tree.options.modifyChild;r&&(n&&n.parent!==this&&e.error("childNode "+n+" is not a child of "+this),i={node:this,tree:this.tree,operation:t,childNode:n||null},s&&e.extend(i,s),r({type:"modifyChild"},i))},triggerModify:function(e,t){this.parent.triggerModifyChild(e,this,t)},visit:function(e,t){var n,s,i=!0,r=this.children;if(!0===t&&(!1===(i=e(this))||"skip"===i))return i;if(r)for(n=0,s=r.length;n<s&&!1!==(i=r[n].visit(e,!0));n++);return i},visitAndLoad:function(t,n,s){var i,r,o,a=this;return!t||!0!==n||!1!==(r=t(a))&&"skip"!==r?a.children||a.lazy?(i=new e.Deferred,o=[],a.load().done((function(){for(var n=0,s=a.children.length;n<s;n++){if(!1===(r=a.children[n].visitAndLoad(t,!0,!0))){i.reject();break}"skip"!==r&&o.push(r)}e.when.apply(this,o).then((function(){i.resolve()}))})),i.promise()):B():s?r:B()},visitParents:function(e,t){if(t&&!1===e(this))return!1;for(var n=this.parent;n;){if(!1===e(n))return!1;n=n.parent}return!0},visitSiblings:function(e,t){var n,s,i,r=this.parent.children;for(n=0,s=r.length;n<s;n++)if(i=r[n],(t||i!==this)&&!1===e(i))return!1;return!0},warn:function(e){this.tree.options.debugLevel>=2&&(Array.prototype.unshift.call(arguments,this.toString()),E("warn",arguments))}},z.prototype={_makeHookContext:function(t,n,s){var i,r;return void 0!==t.node?(n&&t.originalEvent!==n&&e.error("invalid args"),i=t):t.tree?i={node:t,tree:r=t.tree,widget:r.widget,options:r.widget.options,originalEvent:n,typeInfo:r.types[t.type]||{}}:t.widget?i={node:null,tree:t,widget:t.widget,options:t.widget.options,originalEvent:n}:e.error("invalid args"),s&&e.extend(i,s),i},_callHook:function(t,n,s){var i=this._makeHookContext(n),r=this[t],o=Array.prototype.slice.call(arguments,2);return x(r)||e.error("_callHook('"+t+"') is not a function"),o.unshift(i),r.apply(this,o)},_setExpiringValue:function(e,t,n){this._tempCache[e]={value:t,expire:Date.now()+(+n||50)}},_getExpiringValue:function(e){var t=this._tempCache[e];return t&&t.expire>Date.now()?t.value:(delete this._tempCache[e],null)},_usesExtension:function(t){return e.inArray(t,this.options.extensions)>=0},_requireExtension:function(t,n,s,i){null!=s&&(s=!!s);var r=this._local.name,o=this.options.extensions,a=e.inArray(t,o)<e.inArray(r,o),u=n&&null==this.ext[t],c=!u&&null!=s&&s!==a;return k(r&&r!==t,"invalid or same name '"+r+"' (require yourself?)"),!u&&!c||(i||(u||n?(i="'"+r+"' extension requires '"+t+"'",c&&(i+=" to be registered "+(s?"before":"after")+" itself")):i="If used together, `"+t+"` must be registered "+(s?"before":"after")+" `"+r+"`"),e.error(i),!1)},activateKey:function(e,t){var n=this.getNodeByKey(e);return n?n.setActive(!0,t):this.activeNode&&this.activeNode.setActive(!1,t),n},addPagingNode:function(e,t){return this.rootNode.addPagingNode(e,t)},applyCommand:function(t,n,s){var i;switch(n=n||this.getActiveNode(),t){case"moveUp":(i=n.getPrevSibling())&&(n.moveTo(i,"before"),n.setActive());break;case"moveDown":(i=n.getNextSibling())&&(n.moveTo(i,"after"),n.setActive());break;case"indent":(i=n.getPrevSibling())&&(n.moveTo(i,"child"),i.setExpanded(),n.setActive());break;case"outdent":n.isTopLevel()||(n.moveTo(n.getParent(),"after"),n.setActive());break;case"remove":i=n.getPrevSibling()||n.getParent(),n.remove(),i&&i.setActive();break;case"addChild":n.editCreateNode("child","");break;case"addSibling":n.editCreateNode("after","");break;case"rename":n.editStart();break;case"down":case"first":case"last":case"left":case"parent":case"right":case"up":return n.navigate(t);default:e.error("Unhandled command: '"+t+"'")}},applyPatch:function(t){var n,s,i,r,o,a,u=t.length,c=[];for(s=0;s<u;s++)k(2===(i=t[s]).length,"patchList must be an array of length-2-arrays"),r=i[0],o=i[1],(a=null===r?this.rootNode:this.getNodeByKey(r))?(n=new e.Deferred,c.push(n),a.applyPatch(o).always(L(n,a))):this.warn("could not find node with key '"+r+"'");return e.when.apply(e,c).promise()},clear:function(e){this._callHook("treeClear",this)},count:function(){return this.rootNode.countChildren()},debug:function(e){this.options.debugLevel>=4&&(Array.prototype.unshift.call(arguments,this.toString()),E("log",arguments))},destroy:function(){this.widget.destroy()},enable:function(e){!1===e?this.widget.disable():this.widget.enable()},enableUpdate:function(e){return e=!1!==e,!!this._enableUpdate==!!e?e:(this._enableUpdate=e,e?(this.debug("enableUpdate(true): redraw "),this._callHook("treeStructureChanged",this,"enableUpdate"),this.render()):this.debug("enableUpdate(false)..."),!e)},error:function(e){this.options.debugLevel>=1&&(Array.prototype.unshift.call(arguments,this.toString()),E("error",arguments))},expandAll:function(e,t){var n=this.enableUpdate(!1);e=!1!==e,this.visit((function(n){!1!==n.hasChildren()&&n.isExpanded()!==e&&n.setExpanded(e,t)})),this.enableUpdate(n)},findAll:function(e){return this.rootNode.findAll(e)},findFirst:function(e){return this.rootNode.findFirst(e)},findNextNode:function(e,t){var n=null,s=this.getFirstChild();function i(s){if(e(s)&&(n=s),n||s===t)return!1}return e="string"==typeof e?M(e):e,t=t||s,this.visitRows(i,{start:t,includeSelf:!1}),n||t===s||this.visitRows(i,{start:s,includeSelf:!0}),n},findRelatedNode:function(t,n,s){var i=null,r=e.ui.keyCode;switch(n){case"parent":case r.BACKSPACE:t.parent&&t.parent.parent&&(i=t.parent);break;case"first":case r.HOME:this.visit((function(e){if(e.isVisible())return i=e,!1}));break;case"last":case r.END:this.visit((function(e){e.isVisible()&&(i=e)}));break;case"left":case r.LEFT:t.expanded?t.setExpanded(!1):t.parent&&t.parent.parent&&(i=t.parent);break;case"right":case r.RIGHT:t.expanded||!t.children&&!t.lazy?t.children&&t.children.length&&(i=t.children[0]):(t.setExpanded(),i=t);break;case"up":case r.UP:this.visitRows((function(e){return i=e,!1}),{start:t,reverse:!0,includeSelf:!1});break;case"down":case r.DOWN:this.visitRows((function(e){return i=e,!1}),{start:t,includeSelf:!1});break;default:this.tree.warn("Unknown relation '"+n+"'.")}return i},generateFormElements:function(t,n,s){s=s||{};var i,r="string"==typeof t?t:"ft_"+this._id+"[]",o="string"==typeof n?n:"ft_"+this._id+"_active",a="fancytree_result_"+this._id,u=e("#"+a),c=3===this.options.selectMode&&!1!==s.stopOnParents;function l(t){u.append(e("<input>",{type:"checkbox",name:r,value:t.key,checked:!0}))}u.length?u.empty():u=e("<div>",{id:a}).hide().insertAfter(this.$container),!1!==n&&this.activeNode&&u.append(e("<input>",{type:"radio",name:o,value:this.activeNode.key,checked:!0})),s.filter?this.visit((function(e){var t=s.filter(e);if("skip"===t)return t;!1!==t&&l(e)})):!1!==t&&(i=this.getSelectedNodes(c),e.each(i,(function(e,t){l(t)})))},getActiveNode:function(){return this.activeNode},getFirstChild:function(){return this.rootNode.getFirstChild()},getFocusNode:function(){return this.focusNode},getOption:function(e){return this.widget.option(e)},getNodeByKey:function(e,t){var n,s;return!t&&(n=document.getElementById(this.options.idPrefix+e))?n.ftnode?n.ftnode:null:(t=t||this.rootNode,s=null,e=""+e,t.visit((function(t){if(t.key===e)return s=t,!1}),!0),s)},getRootNode:function(){return this.rootNode},getSelectedNodes:function(e){return this.rootNode.getSelectedNodes(e)},hasFocus:function(){return!!this._hasFocus},info:function(e){this.options.debugLevel>=3&&(Array.prototype.unshift.call(arguments,this.toString()),E("info",arguments))},isLoading:function(){var e=!1;return this.rootNode.visit((function(t){if(t._isLoading||t._requestId)return e=!0,!1}),!0),e},loadKeyPath:function(t,n){var s,i,r,o=this,a=new e.Deferred,u=this.getRootNode(),c=this.options.keyPathSeparator,l=[],d=e.extend({},n);for("function"==typeof n?s=n:n&&n.callback&&(s=n.callback),d.callback=function(e,t,n){s&&s.call(e,t,n),a.notifyWith(e,[{node:t,status:n}])},null==d.matchKey&&(d.matchKey=function(e,t){return e.key===t}),w(t)||(t=[t]),i=0;i<t.length;i++)(r=t[i]).charAt(0)===c&&(r=r.substr(1)),l.push(r.split(c));return setTimeout((function(){o._loadKeyPathImpl(a,d,u,l).done((function(){a.resolve()}))}),0),a.promise()},_loadKeyPathImpl:function(t,n,s,i){var r,o,a,u,c,l,d,h,p,f,m=this;function _(e,t){var s,i,r=e.children;if(r)for(s=0,i=r.length;s<i;s++)if(n.matchKey(r[s],t))return r[s];return null}for(d={},o=0;o<i.length;o++)for(p=i[o],h=s;p.length;){if(a=p.shift(),!(u=_(h,a))){this.warn("loadKeyPath: key not found: "+a+" (parent: "+h+")"),n.callback(this,a,"error");break}if(0===p.length){n.callback(this,u,"ok");break}if(u.lazy&&void 0===u.hasChildren()){n.callback(this,u,"loaded"),d[a=u.key]?d[a].pathSegList.push(p):d[a]={parent:u,pathSegList:[p]};break}n.callback(this,u,"loaded"),h=u}function g(e,t,s){n.callback(m,t,"loading"),t.load().done((function(){m._loadKeyPathImpl.call(m,e,n,t,s).always(L(e,m))})).fail((function(s){m.warn("loadKeyPath: error loading lazy "+t),n.callback(m,u,"error"),e.rejectWith(m)}))}for(c in r=[],d)S(d,c)&&(l=d[c],f=new e.Deferred,r.push(f),g(f,l.parent,l.pathSegList));return e.when.apply(e,r).promise()},reactivate:function(e){var t,n=this.activeNode;return n?(this.activeNode=null,t=n.setActive(!0,{noFocus:!0}),e&&n.setFocus(),t):B()},reload:function(e){return this._callHook("treeClear",this),this._callHook("treeLoad",this,e)},render:function(e,t){return this.rootNode.render(e,t)},selectAll:function(e){this.visit((function(t){t.setSelected(e)}))},setFocus:function(e){return this._callHook("treeSetFocus",this,e)},setOption:function(e,t){return this.widget.option(e,t)},debugTime:function(e){this.options.debugLevel>=4&&window.console.time(this+" - "+e)},debugTimeEnd:function(e){this.options.debugLevel>=4&&window.console.timeEnd(this+" - "+e)},toDict:function(e,t){var n=this.rootNode.toDict(!0,t);return e?n:n.children},toString:function(){return"Fancytree@"+this._id},_triggerNodeEvent:function(e,t,n,s){var i=this._makeHookContext(t,n,s),r=this.widget._trigger(e,n,i);return!1!==r&&void 0!==i.result?i.result:r},_triggerTreeEvent:function(e,t,n){var s=this._makeHookContext(this,t,n),i=this.widget._trigger(e,t,s);return!1!==i&&void 0!==s.result?s.result:i},visit:function(e){return this.rootNode.visit(e,!1)},visitRows:function(e,t){if(!this.rootNode.hasChildren())return!1;if(t&&t.reverse)return delete t.reverse,this._visitRowsUp(e,t);var n,s,i,r,o=0,a=!1===(t=t||{}).includeSelf,u=!!t.includeHidden,c=!u&&this.enableFilter,l=t.start||this.rootNode.children[0];for(i=l.parent;i;){for(k((s=(r=i.children).indexOf(l)+o)>=0,"Could not find "+l+" in parent's children: "+i),n=s;n<r.length;n++)if(l=r[n],!c||l.match||l.subMatchCount){if(!a&&!1===e(l))return!1;if(a=!1,l.children&&l.children.length&&(u||l.expanded)&&!1===l.visit((function(t){return!c||t.match||t.subMatchCount?!1!==e(t)&&(u||!t.children||t.expanded?void 0:"skip"):"skip"}),!1))return!1}l=i,i=i.parent,o=1}return!0},_visitRowsUp:function(e,t){for(var n,s,i,r=!!t.includeHidden,o=t.start||this.rootNode.children[0];;){if((n=(i=o.parent).children)[0]===o){if(!(o=i).parent)break;n=i.children}else for(s=n.indexOf(o),o=n[s-1];(r||o.expanded)&&o.children&&o.children.length;)i=o,o=(n=o.children)[n.length-1];if((r||o.isVisible())&&!1===e(o))return!1}},warn:function(e){this.options.debugLevel>=2&&(Array.prototype.unshift.call(arguments,this.toString()),E("warn",arguments))}},e.extend(z.prototype,{nodeClick:function(e){var t,n,s=e.targetType,i=e.node;if("expander"===s){if(i.isLoading())return void i.debug("Got 2nd click while loading: ignored");this._callHook("nodeToggleExpanded",e)}else if("checkbox"===s)this._callHook("nodeToggleSelected",e),e.options.focusOnSelect&&this._callHook("nodeSetFocus",e,!0);else{if(n=!1,t=!0,i.folder)switch(e.options.clickFolderMode){case 2:n=!0,t=!1;break;case 3:t=!0,n=!0}t&&(this.nodeSetFocus(e),this._callHook("nodeSetActive",e,!0)),n&&this._callHook("nodeToggleExpanded",e)}},nodeCollapseSiblings:function(e,t){var n,s,i,r=e.node;if(r.parent)for(s=0,i=(n=r.parent.children).length;s<i;s++)n[s]!==r&&n[s].expanded&&this._callHook("nodeSetExpanded",n[s],!1,t)},nodeDblclick:function(e){"title"===e.targetType&&4===e.options.clickFolderMode&&this._callHook("nodeToggleExpanded",e),"title"===e.targetType&&e.originalEvent.preventDefault()},nodeKeydown:function(t){var n,i,r,o=t.originalEvent,a=t.node,u=t.tree,c=t.options,l=o.which,p=o.key||String.fromCharCode(l),f=!!(o.altKey||o.ctrlKey||o.metaKey),m=!h[l]&&!d[l]&&!f,_=e(o.target),g=!0,v=!(o.ctrlKey||!c.autoActivate);if(a||(r=this.getActiveNode()||this.getFirstChild())&&(r.setFocus(),(a=t.node=this.focusNode).debug("Keydown force focus on active node")),c.quicksearch&&m&&!_.is(":input:enabled"))return(i=Date.now())-u.lastQuicksearchTime>500&&(u.lastQuicksearchTerm=""),u.lastQuicksearchTime=i,u.lastQuicksearchTerm+=p,(n=u.findNextNode(u.lastQuicksearchTerm,u.getActiveNode()))&&n.setActive(),void o.preventDefault();switch(s.eventToString(o)){case"+":case"=":u.nodeSetExpanded(t,!0);break;case"-":u.nodeSetExpanded(t,!1);break;case"space":a.isPagingNode()?u._triggerNodeEvent("clickPaging",t,o):s.evalOption("checkbox",a,a,c,!1)?u.nodeToggleSelected(t):u.nodeSetActive(t,!0);break;case"return":u.nodeSetActive(t,!0);break;case"home":case"end":case"backspace":case"left":case"right":case"up":case"down":a.navigate(o.which,v);break;default:g=!1}g&&o.preventDefault()},nodeLoadChildren:function(t,n){var s,i,r,o=null,c=!0,l=t.tree,d=t.node,h=d.parent,p="nodeLoadChildren",f=Date.now();return x(n)&&k(!x(n=n.call(l,{type:"source"},t)),"source callback must not return another function"),x(n.then)?o=n:n.url?(s=e.extend({},t.options.ajax,n)).debugDelay?(i=s.debugDelay,delete s.debugDelay,w(i)&&(i=i[0]+Math.random()*(i[1]-i[0])),d.warn("nodeLoadChildren waiting debugDelay "+Math.round(i)+" ms ..."),o=e.Deferred((function(t){setTimeout((function(){e.ajax(s).done((function(){t.resolveWith(this,arguments)})).fail((function(){t.rejectWith(this,arguments)}))}),i)}))):o=e.ajax(s):e.isPlainObject(n)||w(n)?(o={then:function(e,t){e(n,null,null)}},c=!1):e.error("Invalid source type: "+n),d._requestId&&(d.warn("Recursive load request #"+f+" while #"+d._requestId+" is pending."),d._requestId=f),c&&(l.debugTime(p),l.nodeSetStatus(t,"loading")),r=new e.Deferred,o.then((function(s,i,o){var c,p;if("json"!==n.dataType&&"jsonp"!==n.dataType||"string"!=typeof s||e.error("Ajax request returned a string (did you get the JSON dataType wrong?)."),d._requestId&&d._requestId>f)r.rejectWith(this,[a]);else if(null!==d.parent||null===h){if(t.options.postProcess){try{(p=l._triggerNodeEvent("postProcess",t,t.originalEvent,{response:s,error:null,dataType:n.dataType})).error&&l.warn("postProcess returned error:",p)}catch(e){p={error:e,message:""+e,details:"postProcess failed"}}if(p.error)return c=e.isPlainObject(p.error)?p.error:{message:p.error},c=l._makeHookContext(d,null,c),void r.rejectWith(this,[c]);(w(p)||e.isPlainObject(p)&&w(p.children))&&(s=p)}else s&&S(s,"d")&&t.options.enableAspx&&(42===t.options.enableAspx&&l.warn("The default for enableAspx will change to `false` in the fututure. Pass `enableAspx: true` or implement postProcess to silence this warning."),s="string"==typeof s.d?e.parseJSON(s.d):s.d);r.resolveWith(this,[s])}else r.rejectWith(this,[u])}),(function(e,t,n){var s=l._makeHookContext(d,null,{error:e,args:Array.prototype.slice.call(arguments),message:n,details:e.status+": "+n});r.rejectWith(this,[s])})),r.done((function(n){var s,i,r;l.nodeSetStatus(t,"ok"),e.isPlainObject(n)?(k(d.isRootNode(),"source may only be an object for root nodes (expecting an array of child objects otherwise)"),k(w(n.children),"if an object is passed as source, it must contain a 'children' array (all other properties are added to 'tree.data')"),i=n,s=n.children,delete i.children,e.each(_,(function(e,t){void 0!==i[t]&&(l[t]=i[t],delete i[t])})),e.extend(l.data,i)):s=n,k(w(s),"expected array of children"),d._setChildren(s),l.options.nodata&&0===s.length&&(x(l.options.nodata)?r=l.options.nodata.call(l,{type:"nodata"},t):!0===l.options.nodata&&d.isRootNode()?r=l.options.strings.noData:"string"==typeof l.options.nodata&&d.isRootNode()&&(r=l.options.nodata),r&&d.setStatus("nodata",r)),l._triggerNodeEvent("loadChildren",d)})).fail((function(e){var n;e!==a?e!==u?(e.node&&e.error&&e.message?n=e:"[object Object]"===(n=l._makeHookContext(d,null,{error:e,args:Array.prototype.slice.call(arguments),message:e?e.message||e.toString():""})).message&&(n.message=""),d.warn("Load children failed ("+n.message+")",n),!1!==l._triggerNodeEvent("loadError",n,null)&&l.nodeSetStatus(t,"error",n.message,n.details)):d.warn("Lazy parent node was removed while loading: discarding response."):d.warn("Ignored response for obsolete load request #"+f+" (expected #"+d._requestId+")")})).always((function(){d._requestId=null,c&&l.debugTimeEnd(p)})),r.promise()},nodeLoadKeyPath:function(e,t){},nodeRemoveChild:function(t,n){var s,i=t.node,r=e.extend({},t,{node:n}),o=i.children;if(1===o.length)return k(n===o[0],"invalid single child"),this.nodeRemoveChildren(t);this.activeNode&&(n===this.activeNode||this.activeNode.isDescendantOf(n))&&this.activeNode.setActive(!1),this.focusNode&&(n===this.focusNode||this.focusNode.isDescendantOf(n))&&(this.focusNode=null),this.nodeRemoveMarkup(r),this.nodeRemoveChildren(r),k((s=e.inArray(n,o))>=0,"invalid child"),i.triggerModifyChild("remove",n),n.visit((function(e){e.parent=null}),!0),this._callHook("treeRegisterNode",this,!1,n),o.splice(s,1)},nodeRemoveChildMarkup:function(t){var n=t.node;n.ul&&(n.isRootNode()?e(n.ul).empty():(e(n.ul).remove(),n.ul=null),n.visit((function(e){e.li=e.ul=null})))},nodeRemoveChildren:function(e){var t=e.tree,n=e.node;n.children&&(this.activeNode&&this.activeNode.isDescendantOf(n)&&this.activeNode.setActive(!1),this.focusNode&&this.focusNode.isDescendantOf(n)&&(this.focusNode=null),this.nodeRemoveChildMarkup(e),n.triggerModifyChild("remove",null),n.visit((function(e){e.parent=null,t._callHook("treeRegisterNode",t,!1,e)})),n.lazy?n.children=[]:n.children=null,n.isRootNode()||(n.expanded=!1),this.nodeRenderStatus(e))},nodeRemoveMarkup:function(t){var n=t.node;n.li&&(e(n.li).remove(),n.li=null),this.nodeRemoveChildMarkup(t)},nodeRender:function(t,n,s,i,r){var o,a,u,c,l,d,h,p=t.node,f=t.tree,m=t.options,_=m.aria,g=!1,v=p.parent,y=!v,b=p.children,w=null;if(!1!==f._enableUpdate&&(y||v.ul)){if(k(y||v.ul,"parent UL must exist"),y||(p.li&&(n||p.li.parentNode!==p.parent.ul)&&(p.li.parentNode===p.parent.ul?w=p.li.nextSibling:this.debug("Unlinking "+p+" (must be child of "+p.parent+")"),this.nodeRemoveMarkup(t)),p.li?this.nodeRenderStatus(t):(g=!0,p.li=document.createElement("li"),p.li.ftnode=p,p.key&&m.generateIds&&(p.li.id=m.idPrefix+p.key),p.span=document.createElement("span"),p.span.className="fancytree-node",_&&!p.tr&&e(p.li).attr("role","treeitem"),p.li.appendChild(p.span),this.nodeRenderTitle(t),m.createNode&&m.createNode.call(f,{type:"createNode"},t)),m.renderNode&&m.renderNode.call(f,{type:"renderNode"},t)),b){if(y||p.expanded||!0===s){for(p.ul||(p.ul=document.createElement("ul"),(!0!==i||r)&&p.expanded||(p.ul.style.display="none"),_&&e(p.ul).attr("role","group"),p.li?p.li.appendChild(p.ul):p.tree.$div.append(p.ul)),c=0,l=b.length;c<l;c++)h=e.extend({},t,{node:b[c]}),this.nodeRender(h,n,s,!1,!0);for(o=p.ul.firstChild;o;)(u=o.ftnode)&&u.parent!==p?(p.debug("_fixParent: remove missing "+u,o),d=o.nextSibling,o.parentNode.removeChild(o),o=d):o=o.nextSibling;for(o=p.ul.firstChild,c=0,l=b.length-1;c<l;c++)(a=b[c])===(u=o.ftnode)?o=o.nextSibling:p.ul.insertBefore(a.li,u.li)}}else p.ul&&(this.warn("remove child markup for "+p),this.nodeRemoveChildMarkup(t));y||g&&v.ul.insertBefore(p.li,w)}},nodeRenderTitle:function(t,n){var r,o,a,u,c,l,d,h=t.node,p=t.tree,f=t.options,m=f.aria,_=h.getLevel(),g=[];void 0!==n&&(h.title=n),h.span&&!1!==p._enableUpdate&&(c=m&&!1!==h.hasChildren()?" role='button'":"",_<f.minExpandLevel?(h.lazy||(h.expanded=!0),_>1&&g.push("<span "+c+" class='fancytree-expander fancytree-expander-fixed'></span>")):g.push("<span "+c+" class='fancytree-expander'></span>"),(r=s.evalOption("checkbox",h,h,f,!1))&&!h.isStatusNode()&&(c=m?" role='checkbox'":"",o="fancytree-checkbox",("radio"===r||h.parent&&h.parent.radiogroup)&&(o+=" fancytree-radio"),g.push("<span "+c+" class='"+o+"'></span>")),void 0!==h.data.iconClass&&(h.icon?e.error("'iconClass' node option is deprecated since v2.14.0: use 'icon' only instead"):(h.warn("'iconClass' node option is deprecated since v2.14.0: use 'icon' instead"),h.icon=h.data.iconClass)),!1!==(a=s.evalOption("icon",h,h,f,!0))&&(c=m?" role='presentation'":"",d=(d=s.evalOption("iconTooltip",h,h,f,null))?" title='"+D(d)+"'":"","string"==typeof a?i.test(a)?(a="/"===a.charAt(0)?a:(f.imagePath||"")+a,g.push("<img src='"+a+"' class='fancytree-icon'"+d+" alt='' />")):g.push("<span "+c+" class='fancytree-custom-icon "+a+"'"+d+"></span>"):a.text?g.push("<span "+c+" class='fancytree-custom-icon "+(a.addClass||"")+"'"+d+">"+s.escapeHtml(a.text)+"</span>"):a.html?g.push("<span "+c+" class='fancytree-custom-icon "+(a.addClass||"")+"'"+d+">"+a.html+"</span>"):g.push("<span "+c+" class='fancytree-icon'"+d+"></span>")),u="",f.renderTitle&&(u=f.renderTitle.call(p,{type:"renderTitle"},t)||""),u||(!0===(l=s.evalOption("tooltip",h,h,f,null))&&(l=h.title),u="<span class='fancytree-title'"+(l=l?" title='"+D(l)+"'":"")+(f.titlesTabbable?" tabindex='0'":"")+">"+(f.escapeTitles?s.escapeHtml(h.title):h.title)+"</span>"),g.push(u),h.span.innerHTML=g.join(""),this.nodeRenderStatus(t),f.enhanceTitle&&(t.$title=e(">span.fancytree-title",h.span),u=f.enhanceTitle.call(p,{type:"enhanceTitle"},t)||""))},nodeRenderStatus:function(t){var n,i=t.node,r=t.tree,o=t.options,a=i.hasChildren(),u=i.isLastSibling(),c=o.aria,l=o._classNames,d=[],h=i[r.statusClassPropName];h&&!1!==r._enableUpdate&&(c&&(n=e(i.tr||i.li)),d.push(l.node),r.activeNode===i&&d.push(l.active),r.focusNode===i&&d.push(l.focused),i.expanded&&d.push(l.expanded),c&&(!1===a?n.removeAttr("aria-expanded"):n.attr("aria-expanded",Boolean(i.expanded))),i.folder&&d.push(l.folder),!1!==a&&d.push(l.hasChildren),u&&d.push(l.lastsib),i.lazy&&null==i.children&&d.push(l.lazy),i.partload&&d.push(l.partload),i.partsel&&d.push(l.partsel),s.evalOption("unselectable",i,i,o,!1)&&d.push(l.unselectable),i._isLoading&&d.push(l.loading),i._error&&d.push(l.error),i.statusNodeType&&d.push(l.statusNodePrefix+i.statusNodeType),i.selected?(d.push(l.selected),c&&n.attr("aria-selected",!0)):c&&n.attr("aria-selected",!1),i.extraClasses&&d.push(i.extraClasses),!1===a?d.push(l.combinedExpanderPrefix+"n"+(u?"l":"")):d.push(l.combinedExpanderPrefix+(i.expanded?"e":"c")+(i.lazy&&null==i.children?"d":"")+(u?"l":"")),d.push(l.combinedIconPrefix+(i.expanded?"e":"c")+(i.folder?"f":"")),h.className=d.join(" "),i.li&&e(i.li).toggleClass(l.lastsib,u))},nodeSetActive:function(t,n,s){s=s||{};var i,r=t.node,o=t.tree,a=t.options,u=!0===s.noEvents,c=!0===s.noFocus,l=!1!==s.scrollIntoView;return r===o.activeNode==(n=!1!==n)?B(r):(l&&t.originalEvent&&e(t.originalEvent.target).is("a,:checkbox")&&(r.info("Not scrolling while clicking an embedded link."),l=!1),n&&!u&&!1===this._triggerNodeEvent("beforeActivate",r,t.originalEvent)?O(r,["rejected"]):(n?(o.activeNode&&(k(o.activeNode!==r,"node was active (inconsistency)"),i=e.extend({},t,{node:o.activeNode}),o.nodeSetActive(i,!1),k(null===o.activeNode,"deactivate was out of sync?")),a.activeVisible&&r.makeVisible({scrollIntoView:l}),o.activeNode=r,o.nodeRenderStatus(t),c||o.nodeSetFocus(t),u||o._triggerNodeEvent("activate",r,t.originalEvent)):(k(o.activeNode===r,"node was not active (inconsistency)"),o.activeNode=null,this.nodeRenderStatus(t),u||t.tree._triggerNodeEvent("deactivate",r,t.originalEvent)),B(r)))},nodeSetExpanded:function(t,n,s){s=s||{};var i,r,o,a,u,c,l=t.node,d=t.tree,h=t.options,p=!0===s.noAnimation,f=!0===s.noEvents;if(n=!1!==n,e(l.li).hasClass(h._classNames.animating))return l.warn("setExpanded("+n+") while animating: ignored."),O(l,["recursion"]);if(l.expanded&&n||!l.expanded&&!n)return B(l);if(n&&!l.lazy&&!l.hasChildren())return B(l);if(!n&&l.getLevel()<h.minExpandLevel)return O(l,["locked"]);if(!f&&!1===this._triggerNodeEvent("beforeExpand",l,t.originalEvent))return O(l,["rejected"]);if(p||l.isVisible()||(p=s.noAnimation=!0),r=new e.Deferred,n&&!l.expanded&&h.autoCollapse){u=l.getParentList(!1,!0),c=h.autoCollapse;try{for(h.autoCollapse=!1,o=0,a=u.length;o<a;o++)this._callHook("nodeCollapseSiblings",u[o],s)}finally{h.autoCollapse=c}}return r.done((function(){var e=l.getLastChild();n&&h.autoScroll&&!p&&e&&d._enableUpdate?e.scrollIntoView(!0,{topNode:l}).always((function(){f||t.tree._triggerNodeEvent(n?"expand":"collapse",t)})):f||t.tree._triggerNodeEvent(n?"expand":"collapse",t)})),i=function(s){var i=h._classNames,r=h.toggleEffect;if(l.expanded=n,d._callHook("treeStructureChanged",t,n?"expand":"collapse"),d._callHook("nodeRender",t,!1,!1,!0),l.ul)if("none"!==l.ul.style.display==!!l.expanded)l.warn("nodeSetExpanded: UL.style.display already set");else{if(r&&!p)return e(l.li).addClass(i.animating),void(x(e(l.ul)[r.effect])?e(l.ul)[r.effect]({duration:r.duration,always:function(){e(this).removeClass(i.animating),e(l.li).removeClass(i.animating),s()}}):(e(l.ul).stop(!0,!0),e(l.ul).parent().find(".ui-effects-placeholder").remove(),e(l.ul).toggle(r.effect,r.options,r.duration,(function(){e(this).removeClass(i.animating),e(l.li).removeClass(i.animating),s()}))));l.ul.style.display=l.expanded||!parent?"":"none"}s()},n&&l.lazy&&void 0===l.hasChildren()?l.load().done((function(){r.notifyWith&&r.notifyWith(l,["loaded"]),i((function(){r.resolveWith(l)}))})).fail((function(e){i((function(){r.rejectWith(l,["load failed ("+e+")"])}))})):i((function(){r.resolveWith(l)})),r.promise()},nodeSetFocus:function(t,n){var s,i=t.tree,r=t.node,o=i.options,a=!!t.originalEvent&&e(t.originalEvent.target).is(":input");if(n=!1!==n,i.focusNode){if(i.focusNode===r&&n)return;s=e.extend({},t,{node:i.focusNode}),i.focusNode=null,this._triggerNodeEvent("blur",s),this._callHook("nodeRenderStatus",s)}n&&(this.hasFocus()||(r.debug("nodeSetFocus: forcing container focus"),this._callHook("treeSetFocus",t,!0,{calledByNode:!0})),r.makeVisible({scrollIntoView:!1}),i.focusNode=r,o.titlesTabbable&&(a||e(r.span).find(".fancytree-title").focus()),o.aria&&e(i.$container).attr("aria-activedescendant",e(r.tr||r.li).uniqueId().attr("id")),this._triggerNodeEvent("focus",t),document.activeElement===i.$container.get(0)||e(document.activeElement,i.$container).length>=1||e(i.$container).focus(),o.autoScroll&&r.scrollIntoView(),this._callHook("nodeRenderStatus",t))},nodeSetSelected:function(e,t,n){n=n||{};var i=e.node,r=e.tree,o=e.options,a=!0===n.noEvents,u=i.parent;if(t=!1!==t,!s.evalOption("unselectable",i,i,o,!1)){if(i._lastSelectIntent=t,!!i.selected===t&&(3!==o.selectMode||!i.partsel||t))return t;if(!a&&!1===this._triggerNodeEvent("beforeSelect",i,e.originalEvent))return!!i.selected;t&&1===o.selectMode?(r.lastSelectedNode&&r.lastSelectedNode.setSelected(!1),i.selected=t):3!==o.selectMode||!u||u.radiogroup||i.radiogroup?u&&u.radiogroup?i.visitSiblings((function(e){e._changeSelectStatusAttrs(t&&e===i)}),!0):i.selected=t:(i.selected=t,i.fixSelection3AfterClick(n)),this.nodeRenderStatus(e),r.lastSelectedNode=t?i:null,a||r._triggerNodeEvent("select",e)}},nodeSetStatus:function(t,n,s,i){var r=t.node,o=t.tree;function a(){var e=r.children?r.children[0]:null;if(e&&e.isStatusNode()){try{r.ul&&(r.ul.removeChild(e.li),e.li=null)}catch(e){}1===r.children.length?r.children=[]:r.children.shift(),o._callHook("treeStructureChanged",t,"clearStatusNode")}}function u(n,s){var i=r.children?r.children[0]:null;return i&&i.isStatusNode()?(e.extend(i,n),i.statusNodeType=s,o._callHook("nodeRenderTitle",i)):(r._setChildren([n]),o._callHook("treeStructureChanged",t,"setStatusNode"),r.children[0].statusNodeType=s,o.render()),r.children[0]}switch(n){case"ok":a(),r._isLoading=!1,r._error=null,r.renderStatus();break;case"loading":r.parent||u({title:o.options.strings.loading+(s?" ("+s+")":""),checkbox:!1,tooltip:i},n),r._isLoading=!0,r._error=null,r.renderStatus();break;case"error":u({title:o.options.strings.loadError+(s?" ("+s+")":""),checkbox:!1,tooltip:i},n),r._isLoading=!1,r._error={message:s,details:i},r.renderStatus();break;case"nodata":u({title:s||o.options.strings.noData,checkbox:!1,tooltip:i},n),r._isLoading=!1,r._error=null,r.renderStatus();break;default:e.error("invalid node status "+n)}},nodeToggleExpanded:function(e){return this.nodeSetExpanded(e,!e.node.expanded)},nodeToggleSelected:function(e){var t=e.node,n=!t.selected;return t.partsel&&!t.selected&&!0===t._lastSelectIntent&&(n=!1,t.selected=!0),t._lastSelectIntent=n,this.nodeSetSelected(e,n)},treeClear:function(e){var t=e.tree;t.activeNode=null,t.focusNode=null,t.$div.find(">ul.fancytree-container").empty(),t.rootNode.children=null,t._callHook("treeStructureChanged",e,"clear")},treeCreate:function(e){},treeDestroy:function(e){this.$div.find(">ul.fancytree-container").remove(),this.$source&&this.$source.removeClass("fancytree-helper-hidden")},treeInit:function(t){var n=t.tree,s=n.options;n.$container.attr("tabindex",s.tabindex),e.each(_,(function(e,t){void 0!==s[t]&&(n.info("Move option "+t+" to tree"),n[t]=s[t],delete s[t])})),s.checkboxAutoHide&&n.$container.addClass("fancytree-checkbox-auto-hide"),s.rtl?n.$container.attr("DIR","RTL").addClass("fancytree-rtl"):n.$container.removeAttr("DIR").removeClass("fancytree-rtl"),s.aria&&(n.$container.attr("role","tree"),1!==s.selectMode&&n.$container.attr("aria-multiselectable",!0)),this.treeLoad(t)},treeLoad:function(t,n){var i,r,o,a=t.tree,u=t.widget.element,c=e.extend({},t,{node:this.rootNode});if(a.rootNode.children&&this.treeClear(t),n=n||this.options.source)"string"==typeof n&&e.error("Not implemented");else switch(r=u.data("type")||"html"){case"html":(o=u.find(">ul").not(".fancytree-container").first()).length?(o.addClass("ui-fancytree-source fancytree-helper-hidden"),n=e.ui.fancytree.parseHtml(o),this.data=e.extend(this.data,q(o))):(s.warn("No `source` option was passed and container does not contain `<ul>`: assuming `source: []`."),n=[]);break;case"json":n=e.parseJSON(u.text()),u.contents().filter((function(){return 3===this.nodeType})).remove(),e.isPlainObject(n)&&(k(w(n.children),"if an object is passed as source, it must contain a 'children' array (all other properties are added to 'tree.data')"),i=n,n=n.children,delete i.children,e.each(_,(function(e,t){void 0!==i[t]&&(a[t]=i[t],delete i[t])})),e.extend(a.data,i));break;default:e.error("Invalid data-type: "+r)}return a._triggerTreeEvent("preInit",null),this.nodeLoadChildren(c,n).done((function(){a._callHook("treeStructureChanged",t,"loadChildren"),a.render(),3===t.options.selectMode&&a.rootNode.fixSelection3FromEndNodes(),a.activeNode&&a.options.activeVisible&&a.activeNode.makeVisible(),a._triggerTreeEvent("init",null,{status:!0})})).fail((function(){a.render(),a._triggerTreeEvent("init",null,{status:!1})}))},treeRegisterNode:function(e,t,n){e.tree._callHook("treeStructureChanged",e,t?"addNode":"removeNode")},treeSetFocus:function(t,n,s){var i;(n=!1!==n)!==this.hasFocus()&&(this._hasFocus=n,!n&&this.focusNode?this.focusNode.setFocus(!1):!n||s&&s.calledByNode||e(this.$container).focus(),this.$container.toggleClass("fancytree-treefocus",n),this._triggerTreeEvent(n?"focusTree":"blurTree"),n&&!this.activeNode&&(i=this._lastMousedownNode||this.getFirstChild())&&i.setFocus())},treeSetOption:function(t,n,s){var i=t.tree,r=!0,o=!1,a=!1;switch(n){case"aria":case"checkbox":case"icon":case"minExpandLevel":case"tabindex":o=!0,a=!0;break;case"checkboxAutoHide":i.$container.toggleClass("fancytree-checkbox-auto-hide",!!s);break;case"escapeTitles":case"tooltip":a=!0;break;case"rtl":!1===s?i.$container.removeAttr("DIR").removeClass("fancytree-rtl"):i.$container.attr("DIR","RTL").addClass("fancytree-rtl"),a=!0;break;case"source":r=!1,i._callHook("treeLoad",i,s),a=!0}i.debug("set option "+n+"="+s+" <"+typeof s+">"),r&&(this.widget._super?this.widget._super.call(this.widget,n,s):e.Widget.prototype._setOption.call(this.widget,n,s)),o&&i._callHook("treeCreate",i),a&&i.render(!0,!1)},treeStructureChanged:function(e,t){}}),e.widget("ui.fancytree",{options:{activeVisible:!0,ajax:{type:"GET",cache:!1,dataType:"json"},aria:!0,autoActivate:!0,autoCollapse:!1,autoScroll:!1,checkbox:!1,clickFolderMode:4,copyFunctionsToData:!1,debugLevel:null,disabled:!1,enableAspx:42,escapeTitles:!1,extensions:[],focusOnSelect:!1,generateIds:!1,icon:!0,idPrefix:"ft_",keyboard:!0,keyPathSeparator:"/",minExpandLevel:1,nodata:!0,quicksearch:!1,rtl:!1,scrollOfs:{top:0,bottom:0},scrollParent:null,selectMode:2,strings:{loading:"Loading...",loadError:"Load error!",moreData:"More...",noData:"No data."},tabindex:"0",titlesTabbable:!1,toggleEffect:{effect:"slideToggle",duration:200},tooltip:!1,treeId:null,_classNames:{active:"fancytree-active",animating:"fancytree-animating",combinedExpanderPrefix:"fancytree-exp-",combinedIconPrefix:"fancytree-ico-",error:"fancytree-error",expanded:"fancytree-expanded",focused:"fancytree-focused",folder:"fancytree-folder",hasChildren:"fancytree-has-children",lastsib:"fancytree-lastsib",lazy:"fancytree-lazy",loading:"fancytree-loading",node:"fancytree-node",partload:"fancytree-partload",partsel:"fancytree-partsel",radio:"fancytree-radio",selected:"fancytree-selected",statusNodePrefix:"fancytree-statusnode-",unselectable:"fancytree-unselectable"},lazyLoad:null,postProcess:null},_deprecationWarning:function(e){var t=this.tree;t&&t.options.debugLevel>=3&&t.warn("$().fancytree('"+e+"') is deprecated (see https://wwwendt.de/tech/fancytree/doc/jsdoc/Fancytree_Widget.html")},_create:function(){this.tree=new z(this),this.$source=this.source||"json"===this.element.data("type")?this.element:this.element.find(">ul").first();var t,n,s,i=this.options,r=i.extensions,o=this.tree;for(s=0;s<r.length;s++)n=r[s],(t=e.ui.fancytree._extensions[n])||e.error("Could not apply extension '"+n+"' (it is not registered, did you forget to include it?)"),this.tree.options[n]=j({},t.options,this.tree.options[n]),k(void 0===this.tree.ext[n],"Extension name must not exist as Fancytree.ext attribute: '"+n+"'"),this.tree.ext[n]={},I(this.tree,o,t,n),o=t;void 0!==i.icons&&(!0===i.icon?(this.tree.warn("'icons' tree option is deprecated since v2.14.0: use 'icon' instead"),i.icon=i.icons):e.error("'icons' tree option is deprecated since v2.14.0: use 'icon' only instead")),void 0!==i.iconClass&&(i.icon?e.error("'iconClass' tree option is deprecated since v2.14.0: use 'icon' only instead"):(this.tree.warn("'iconClass' tree option is deprecated since v2.14.0: use 'icon' instead"),i.icon=i.iconClass)),void 0!==i.tabbable&&(i.tabindex=i.tabbable?"0":"-1",this.tree.warn("'tabbable' tree option is deprecated since v2.17.0: use 'tabindex='"+i.tabindex+"' instead")),this.tree._callHook("treeCreate",this.tree)},_init:function(){this.tree._callHook("treeInit",this.tree),this._bind()},_setOption:function(e,t){return this.tree._callHook("treeSetOption",this.tree,e,t)},_destroy:function(){this._unbind(),this.tree._callHook("treeDestroy",this.tree)},_unbind:function(){var t=this.tree._ns;this.element.off(t),this.tree.$container.off(t),e(document).off(t)},_bind:function(){var t=this,n=this.options,i=this.tree,r=i._ns;this._unbind(),i.$container.on("focusin"+r+" focusout"+r,(function(t){var n=s.getNode(t),r="focusin"===t.type;if(!r&&n&&e(t.target).is("a"))n.debug("Ignored focusout on embedded <a> element.");else{if(r){if(i._getExpiringValue("focusin"))return void i.debug("Ignored double focusin.");i._setExpiringValue("focusin",!0,50),n||(n=i._getExpiringValue("mouseDownNode"))&&i.debug("Reconstruct mouse target for focusin from recent event.")}n?i._callHook("nodeSetFocus",i._makeHookContext(n,t),r):i.tbody&&e(t.target).parents("table.fancytree-container > thead").length?i.debug("Ignore focus event outside table body.",t):i._callHook("treeSetFocus",i,r)}})).on("selectstart"+r,"span.fancytree-title",(function(e){e.preventDefault()})).on("keydown"+r,(function(e){if(n.disabled||!1===n.keyboard)return!0;var t,s=i.focusNode,r=i._makeHookContext(s||i,e),o=i.phase;try{return i.phase="userEvent","preventNav"===(t=s?i._triggerNodeEvent("keydown",s,e):i._triggerTreeEvent("keydown",e))?t=!0:!1!==t&&(t=i._callHook("nodeKeydown",r)),t}finally{i.phase=o}})).on("mousedown"+r,(function(e){var t=s.getEventTarget(e);i._lastMousedownNode=t?t.node:null,i._setExpiringValue("mouseDownNode",i._lastMousedownNode)})).on("click"+r+" dblclick"+r,(function(e){if(n.disabled)return!0;var i,r=s.getEventTarget(e),o=r.node,a=t.tree,u=a.phase;if(!o)return!0;i=a._makeHookContext(o,e);try{switch(a.phase="userEvent",e.type){case"click":return i.targetType=r.type,o.isPagingNode()?!0===a._triggerNodeEvent("clickPaging",i,e):!1!==a._triggerNodeEvent("click",i,e)&&a._callHook("nodeClick",i);case"dblclick":return i.targetType=r.type,!1!==a._triggerNodeEvent("dblclick",i,e)&&a._callHook("nodeDblclick",i)}}finally{a.phase=u}}))},getActiveNode:function(){return this._deprecationWarning("getActiveNode"),this.tree.activeNode},getNodeByKey:function(e){return this._deprecationWarning("getNodeByKey"),this.tree.getNodeByKey(e)},getRootNode:function(){return this._deprecationWarning("getRootNode"),this.tree.rootNode},getTree:function(){return this._deprecationWarning("getTree"),this.tree}}),s=e.ui.fancytree,e.extend(e.ui.fancytree,{version:"2.38.1-0",buildType:"production",debugLevel:3,_nextId:1,_nextNodeKey:1,_extensions:{},_FancytreeClass:z,_FancytreeNodeClass:R,jquerySupports:{positionMyOfs:T(e.ui.version,1,9)},assert:function(e,t){return k(e,t)},createTree:function(t,n){var i=e(t).fancytree(n);return s.getTree(i)},debounce:function(e,t,n,s){var i;return 3===arguments.length&&"boolean"!=typeof n&&(s=n,n=!1),function(){var r=arguments;s=s||this,n&&!i&&t.apply(s,r),clearTimeout(i),i=setTimeout((function(){n||t.apply(s,r),i=null}),e)}},debug:function(t){e.ui.fancytree.debugLevel>=4&&E("log",arguments)},error:function(t){e.ui.fancytree.debugLevel>=1&&E("error",arguments)},escapeHtml:function(e){return(""+e).replace(r,(function(e){return c[e]}))},fixPositionOptions:function(t){if((t.offset||(""+t.my+t.at).indexOf("%")>=0)&&e.error("expected new position syntax (but '%' is not supported)"),!e.ui.fancytree.jquerySupports.positionMyOfs){var n=/(\w+)([+-]?\d+)?\s+(\w+)([+-]?\d+)?/.exec(t.my),s=/(\w+)([+-]?\d+)?\s+(\w+)([+-]?\d+)?/.exec(t.at),i=(n[2]?+n[2]:0)+(s[2]?+s[2]:0),r=(n[4]?+n[4]:0)+(s[4]?+s[4]:0);t=e.extend({},t,{my:n[1]+" "+n[3],at:s[1]+" "+s[3]}),(i||r)&&(t.offset=i+" "+r)}return t},getEventTarget:function(t){var n,i=t&&t.target?t.target.className:"",r={node:this.getNode(t.target),type:void 0};return/\bfancytree-title\b/.test(i)?r.type="title":/\bfancytree-expander\b/.test(i)?r.type=!1===r.node.hasChildren()?"prefix":"expander":/\bfancytree-checkbox\b/.test(i)?r.type="checkbox":/\bfancytree(-custom)?-icon\b/.test(i)?r.type="icon":/\bfancytree-node\b/.test(i)?r.type="title":t&&t.target&&((n=e(t.target)).is("ul[role=group]")?((r.node&&r.node.tree||s).debug("Ignoring click on outer UL."),r.node=null):n.closest(".fancytree-title").length?r.type="title":n.closest(".fancytree-checkbox").length?r.type="checkbox":n.closest(".fancytree-expander").length&&(r.type="expander")),r},getEventTargetType:function(e){return this.getEventTarget(e).type},getNode:function(t){if(t instanceof R)return t;for(t instanceof e?t=t[0]:void 0!==t.originalEvent&&(t=t.target);t;){if(t.ftnode)return t.ftnode;t=t.parentNode}return null},getTree:function(t){var n,s=t;return t instanceof z?t:(void 0===t&&(t=0),"number"==typeof t?t=e(".fancytree-container").eq(t):"string"==typeof t?(t=e("#ft-id-"+s).eq(0)).length||(t=e(s).eq(0)):t instanceof Element||t instanceof HTMLDocument?t=e(t):t instanceof e?t=t.eq(0):void 0!==t.originalEvent&&(t=e(t.target)),(n=(t=t.closest(":ui-fancytree")).data("ui-fancytree")||t.data("fancytree"))?n.tree:null)},evalOption:function(e,t,n,s,i){var r,o,a=t.tree,u=s[e],c=n[e];return x(u)?(r={node:t,tree:a,widget:a.widget,options:a.widget.options,typeInfo:a.types[t.type]||{}},null==(o=u.call(a,{type:e},r))&&(o=c)):o=null==c?u:c,null==o&&(o=i),o},setSpanIcon:function(t,n,s){var i=e(t);"string"==typeof s?i.attr("class",n+" "+s):(s.text?i.text(""+s.text):s.html&&(t.innerHTML=s.html),i.attr("class",n+" "+(s.addClass||"")))},eventToString:function(e){var t=e.which,n=e.type,s=[];return e.altKey&&s.push("alt"),e.ctrlKey&&s.push("ctrl"),e.metaKey&&s.push("meta"),e.shiftKey&&s.push("shift"),"click"===n||"dblclick"===n?s.push(p[e.button]+n):"wheel"===n?s.push(n):l[t]||s.push(d[t]||String.fromCharCode(t).toLowerCase()),s.join("+")},info:function(t){e.ui.fancytree.debugLevel>=3&&E("info",arguments)},keyEventToString:function(e){return this.warn("keyEventToString() is deprecated: use eventToString()"),this.eventToString(e)},overrideMethod:function(t,n,s,i){var r,o=t[n]||e.noop;t[n]=function(){var e=i||this;try{return r=e._super,e._super=o,s.apply(e,arguments)}finally{e._super=r}}},parseHtml:function(t){var n,s,i,r,o,a,u,c,l=t.find(">li"),d=[];return l.each((function(){var l,h,p=e(this),_=p.find(">span",this).first(),v=_.length?null:p.find(">a").first(),b={tooltip:null,data:{}};for(_.length?b.title=_.html():v&&v.length?(b.title=v.html(),b.data.href=v.attr("href"),b.data.target=v.attr("target"),b.tooltip=v.attr("title")):(b.title=p.html(),(o=b.title.search(/<ul/i))>=0&&(b.title=b.title.substring(0,o))),b.title=C(b.title),r=0,a=f.length;r<a;r++)b[f[r]]=void 0;for(n=this.className.split(" "),i=[],r=0,a=n.length;r<a;r++)s=n[r],m[s]?b[s]=!0:i.push(s);if(b.extraClasses=i.join(" "),(u=p.attr("title"))&&(b.tooltip=u),(u=p.attr("id"))&&(b.key=u),p.attr("hideCheckbox")&&(b.checkbox=!1),(l=q(p))&&!e.isEmptyObject(l)){for(h in y)S(l,h)&&(l[y[h]]=l[h],delete l[h]);for(r=0,a=g.length;r<a;r++)u=g[r],null!=(c=l[u])&&(delete l[u],b[u]=c);e.extend(b.data,l)}(t=p.find(">ul").first()).length?b.children=e.ui.fancytree.parseHtml(t):b.children=b.lazy?void 0:null,d.push(b)})),d},registerExtension:function(t){k(null!=t.name,"extensions must have a `name` property."),k(null!=t.version,"extensions must have a `version` property."),e.ui.fancytree._extensions[t.name]=t},trim:C,unescapeHtml:function(e){var t=document.createElement("div");return t.innerHTML=e,0===t.childNodes.length?"":t.childNodes[0].nodeValue},warn:function(t){e.ui.fancytree.debugLevel>=2&&E("warn",arguments)}}),e.ui.fancytree}function k(t,n){t||(n="Fancytree assertion failed"+(n=n?": "+n:""),e.ui.fancytree.error(n),e.error(n))}function S(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function x(e){return"function"==typeof e}function C(e){return null==e?"":e.trim()}function E(e,t){var n,s,i=window.console?window.console[e]:null;if(i)try{i.apply(window.console,t)}catch(e){for(s="",n=0;n<t.length;n++)s+=t[n];i(s)}}function N(e){return!(!e.tree||void 0===e.statusNodeType)}function T(t,n,s,i){var r,o,a,u=e.map(C(t).split("."),(function(e){return parseInt(e,10)})),c=e.map(Array.prototype.slice.call(arguments,1),(function(e){return parseInt(e,10)}));for(r=0;r<c.length;r++)if((o=u[r]||0)!==(a=c[r]||0))return o>a;return!0}function j(){var t,n,s,i,r,o=arguments[0]||{},a=1,u=arguments.length;if("object"==typeof o||x(o)||(o={}),a===u)throw Error("need at least two args");for(;a<u;a++)if(null!=(t=arguments[a]))for(n in t)if(S(t,n)){if(s=o[n],o===(i=t[n]))continue;i&&e.isPlainObject(i)?(r=s&&e.isPlainObject(s)?s:{},o[n]=j(r,i)):void 0!==i&&(o[n]=i)}return o}function P(e,t,n,s,i){var r,o,a,u,c,l=(r=t[e],o=s[e],a=t.ext[i],u=function(){return r.apply(t,arguments)},c=function(e){return r.apply(t,e)},function(){var e=t._local,n=t._super,s=t._superApply;try{return t._local=a,t._super=u,t._superApply=c,o.apply(t,arguments)}finally{t._local=e,t._super=n,t._superApply=s}});return l}function I(t,n,s,i){for(var r in s)"function"==typeof s[r]?"function"==typeof t[r]?t[r]=P(r,t,n,s,i):"_"===r.charAt(0)?t.ext[i][r]=P(r,t,n,s,i):e.error("Could not override tree."+r+". Use prefix '_' to create tree."+i+"._"+r):"options"!==r&&(t.ext[i][r]=s[r])}function B(t,n){return void 0===t?e.Deferred((function(){this.resolve()})).promise():e.Deferred((function(){this.resolveWith(t,n)})).promise()}function O(t,n){return void 0===t?e.Deferred((function(){this.reject()})).promise():e.Deferred((function(){this.rejectWith(t,n)})).promise()}function L(e,t){return function(){e.resolveWith(t)}}function q(t){var n=e.extend({},t.data()),s=n.json;return delete n.fancytree,delete n.uiFancytree,s&&(delete n.json,n=e.extend(n,s)),n}function D(e){return(""+e).replace(o,(function(e){return c[e]}))}function A(e){return e=e.toLowerCase(),function(t){return t.title.toLowerCase().indexOf(e)>=0}}function M(e){var t=new RegExp("^"+e,"i");return function(e){return t.test(e.title)}}function R(t,n){var i,r,o,a;for(this.parent=t,this.tree=t.tree,this.ul=null,this.li=null,this.statusNodeType=null,this._isLoading=!1,this._error=null,this.data={},i=0,r=g.length;i<r;i++)this[o=g[i]]=n[o];for(o in null==this.unselectableIgnore&&null==this.unselectableStatus||(this.unselectable=!0),n.hideCheckbox&&e.error("'hideCheckbox' node option was removed in v2.23.0: use 'checkbox: false'"),n.data&&e.extend(this.data,n.data),n)v[o]||!this.tree.options.copyFunctionsToData&&x(n[o])||b[o]||(this.data[o]=n[o]);null==this.key?this.tree.options.defaultKey?(this.key=""+this.tree.options.defaultKey(this),k(this.key,"defaultKey() must return a unique key")):this.key="_"+s._nextNodeKey++:this.key=""+this.key,n.active&&(k(null===this.tree.activeNode,"only one active node allowed"),this.tree.activeNode=this),n.selected&&(this.tree.lastSelectedNode=this),(a=n.children)?a.length?this._setChildren(a):this.children=this.lazy?[]:null:this.children=null,this.tree._callHook("treeRegisterNode",this.tree,!0,this)}function z(t){this.widget=t,this.$div=t.element,this.options=t.options,this.options&&(void 0!==this.options.lazyload&&e.error("The 'lazyload' event is deprecated since 2014-02-25. Use 'lazyLoad' (with uppercase L) instead."),void 0!==this.options.loaderror&&e.error("The 'loaderror' event was renamed since 2014-07-03. Use 'loadError' (with uppercase E) instead."),void 0!==this.options.fx&&e.error("The 'fx' option was replaced by 'toggleEffect' since 2014-11-30."),void 0!==this.options.removeNode&&e.error("The 'removeNode' event was replaced by 'modifyChild' since 2.20 (2016-09-10).")),this.ext={},this.types={},this.columns={},this.data=q(this.$div),this._id=""+(this.options.treeId||e.ui.fancytree._nextId++),this._ns=".fancytree-"+this._id,this.activeNode=null,this.focusNode=null,this._hasFocus=null,this._tempCache={},this._lastMousedownNode=null,this._enableUpdate=!0,this.lastSelectedNode=null,this.systemFocusElement=null,this.lastQuicksearchTerm="",this.lastQuicksearchTime=0,this.viewport=null,this.statusClassPropName="span",this.ariaPropName="li",this.nodeContainerAttrName="li",this.$div.find(">ul.fancytree-container").remove();var n,i={tree:this};this.rootNode=new R(i,{title:"root",key:"root_"+this._id,children:null,expanded:!0}),this.rootNode.parent=null,n=e("<ul>",{id:"ft-id-"+this._id,class:"ui-fancytree fancytree-container fancytree-plain"}).appendTo(this.$div),this.$container=n,this.rootNode.ul=n[0],null==this.options.debugLevel&&(this.options.debugLevel=s.debugLevel)}e.ui.fancytree.warn("Fancytree: ignored duplicate include")},void 0===(r="function"==typeof s?s.apply(t,i):s)||(e.exports=r)},3860:function(e,t,n){var s,i,r;i=[n(5311)],s=function(e){e.ui=e.ui||{},e.ui.version="1.12.1";var t,n,s=0,i=Array.prototype.slice;e.cleanData=e.cleanData||(t=e.cleanData,function(n){var s,i,r;for(r=0;null!=(i=n[r]);r++)try{(s=e._data(i,"events"))&&s.remove&&e(i).triggerHandler("remove")}catch(e){}t(n)}),e.widget=e.widget||function(t,n,s){var i,r,o,a={},u=t.split(".")[0],c=u+"-"+(t=t.split(".")[1]);return s||(s=n,n=e.Widget),e.isArray(s)&&(s=e.extend.apply(null,[{}].concat(s))),e.expr[":"][c.toLowerCase()]=function(t){return!!e.data(t,c)},e[u]=e[u]||{},i=e[u][t],r=e[u][t]=function(e,t){if(!this._createWidget)return new r(e,t);arguments.length&&this._createWidget(e,t)},e.extend(r,i,{version:s.version,_proto:e.extend({},s),_childConstructors:[]}),(o=new n).options=e.widget.extend({},o.options),e.each(s,(function(t,s){e.isFunction(s)?a[t]=function(){function e(){return n.prototype[t].apply(this,arguments)}function i(e){return n.prototype[t].apply(this,e)}return function(){var t,n=this._super,r=this._superApply;return this._super=e,this._superApply=i,t=s.apply(this,arguments),this._super=n,this._superApply=r,t}}():a[t]=s})),r.prototype=e.widget.extend(o,{widgetEventPrefix:i&&o.widgetEventPrefix||t},a,{constructor:r,namespace:u,widgetName:t,widgetFullName:c}),i?(e.each(i._childConstructors,(function(t,n){var s=n.prototype;e.widget(s.namespace+"."+s.widgetName,r,n._proto)})),delete i._childConstructors):n._childConstructors.push(r),e.widget.bridge(t,r),r},e.widget.extend=function(t){for(var n,s,r=i.call(arguments,1),o=0,a=r.length;o<a;o++)for(n in r[o])s=r[o][n],r[o].hasOwnProperty(n)&&void 0!==s&&(e.isPlainObject(s)?t[n]=e.isPlainObject(t[n])?e.widget.extend({},t[n],s):e.widget.extend({},s):t[n]=s);return t},e.widget.bridge=function(t,n){var s=n.prototype.widgetFullName||t;e.fn[t]=function(r){var o="string"==typeof r,a=i.call(arguments,1),u=this;return o?this.length||"instance"!==r?this.each((function(){var n,i=e.data(this,s);return"instance"===r?(u=i,!1):i?e.isFunction(i[r])&&"_"!==r.charAt(0)?(n=i[r].apply(i,a))!==i&&void 0!==n?(u=n&&n.jquery?u.pushStack(n.get()):n,!1):void 0:e.error("no such method '"+r+"' for "+t+" widget instance"):e.error("cannot call methods on "+t+" prior to initialization; attempted to call method '"+r+"'")})):u=void 0:(a.length&&(r=e.widget.extend.apply(null,[r].concat(a))),this.each((function(){var t=e.data(this,s);t?(t.option(r||{}),t._init&&t._init()):e.data(this,s,new n(r,this))}))),u}},e.Widget=e.Widget||function(){},e.Widget._childConstructors=[],e.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{classes:{},disabled:!1,create:null},_createWidget:function(t,n){n=e(n||this.defaultElement||this)[0],this.element=e(n),this.uuid=s++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=e(),this.hoverable=e(),this.focusable=e(),this.classesElementLookup={},n!==this&&(e.data(n,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===n&&this.destroy()}}),this.document=e(n.style?n.ownerDocument:n.document||n),this.window=e(this.document[0].defaultView||this.document[0].parentWindow)),this.options=e.widget.extend({},this.options,this._getCreateOptions(),t),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:e.noop,_create:e.noop,_init:e.noop,destroy:function(){var t=this;this._destroy(),e.each(this.classesElementLookup,(function(e,n){t._removeClass(n,e)})),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:e.noop,widget:function(){return this.element},option:function(t,n){var s,i,r,o=t;if(0===arguments.length)return e.widget.extend({},this.options);if("string"==typeof t)if(o={},s=t.split("."),t=s.shift(),s.length){for(i=o[t]=e.widget.extend({},this.options[t]),r=0;r<s.length-1;r++)i[s[r]]=i[s[r]]||{},i=i[s[r]];if(t=s.pop(),1===arguments.length)return void 0===i[t]?null:i[t];i[t]=n}else{if(1===arguments.length)return void 0===this.options[t]?null:this.options[t];o[t]=n}return this._setOptions(o),this},_setOptions:function(e){var t;for(t in e)this._setOption(t,e[t]);return this},_setOption:function(e,t){return"classes"===e&&this._setOptionClasses(t),this.options[e]=t,"disabled"===e&&this._setOptionDisabled(t),this},_setOptionClasses:function(t){var n,s,i;for(n in t)i=this.classesElementLookup[n],t[n]!==this.options.classes[n]&&i&&i.length&&(s=e(i.get()),this._removeClass(i,n),s.addClass(this._classes({element:s,keys:n,classes:t,add:!0})))},_setOptionDisabled:function(e){this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!!e),e&&(this._removeClass(this.hoverable,null,"ui-state-hover"),this._removeClass(this.focusable,null,"ui-state-focus"))},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_classes:function(t){var n=[],s=this;function i(i,r){var o,a;for(a=0;a<i.length;a++)o=s.classesElementLookup[i[a]]||e(),o=t.add?e(e.unique(o.get().concat(t.element.get()))):e(o.not(t.element).get()),s.classesElementLookup[i[a]]=o,n.push(i[a]),r&&t.classes[i[a]]&&n.push(t.classes[i[a]])}return t=e.extend({element:this.element,classes:this.options.classes||{}},t),this._on(t.element,{remove:"_untrackClassesElement"}),t.keys&&i(t.keys.match(/\S+/g)||[],!0),t.extra&&i(t.extra.match(/\S+/g)||[]),n.join(" ")},_untrackClassesElement:function(t){var n=this;e.each(n.classesElementLookup,(function(s,i){-1!==e.inArray(t.target,i)&&(n.classesElementLookup[s]=e(i.not(t.target).get()))}))},_removeClass:function(e,t,n){return this._toggleClass(e,t,n,!1)},_addClass:function(e,t,n){return this._toggleClass(e,t,n,!0)},_toggleClass:function(e,t,n,s){s="boolean"==typeof s?s:n;var i="string"==typeof e||null===e,r={extra:i?t:n,keys:i?e:t,element:i?this.element:e,add:s};return r.element.toggleClass(this._classes(r),s),this},_on:function(t,n,s){var i,r=this;"boolean"!=typeof t&&(s=n,n=t,t=!1),s?(n=i=e(n),this.bindings=this.bindings.add(n)):(s=n,n=this.element,i=this.widget()),e.each(s,(function(s,o){function a(){if(t||!0!==r.options.disabled&&!e(this).hasClass("ui-state-disabled"))return("string"==typeof o?r[o]:o).apply(r,arguments)}"string"!=typeof o&&(a.guid=o.guid=o.guid||a.guid||e.guid++);var u=s.match(/^([\w:-]*)\s*(.*)$/),c=u[1]+r.eventNamespace,l=u[2];l?i.on(c,l,a):n.on(c,a)}))},_off:function(t,n){n=(n||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,t.off(n).off(n),this.bindings=e(this.bindings.not(t).get()),this.focusable=e(this.focusable.not(t).get()),this.hoverable=e(this.hoverable.not(t).get())},_delay:function(e,t){function n(){return("string"==typeof e?s[e]:e).apply(s,arguments)}var s=this;return setTimeout(n,t||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){this._addClass(e(t.currentTarget),null,"ui-state-hover")},mouseleave:function(t){this._removeClass(e(t.currentTarget),null,"ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){this._addClass(e(t.currentTarget),null,"ui-state-focus")},focusout:function(t){this._removeClass(e(t.currentTarget),null,"ui-state-focus")}})},_trigger:function(t,n,s){var i,r,o=this.options[t];if(s=s||{},(n=e.Event(n)).type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),n.target=this.element[0],r=n.originalEvent)for(i in r)i in n||(n[i]=r[i]);return this.element.trigger(n,s),!(e.isFunction(o)&&!1===o.apply(this.element[0],[n].concat(s))||n.isDefaultPrevented())}},e.each({show:"fadeIn",hide:"fadeOut"},(function(t,n){e.Widget.prototype["_"+t]=function(s,i,r){var o;"string"==typeof i&&(i={effect:i});var a=i?!0===i||"number"==typeof i?n:i.effect||n:t;"number"==typeof(i=i||{})&&(i={duration:i}),o=!e.isEmptyObject(i),i.complete=r,i.delay&&s.delay(i.delay),o&&e.effects&&e.effects.effect[a]?s[t](i):a!==t&&s[a]?s[a](i.duration,i.easing,r):s.queue((function(n){e(this)[t](),r&&r.call(s[0]),n()}))}})),e.widget,function(){var t,n=Math.max,s=Math.abs,i=/left|center|right/,r=/top|center|bottom/,o=/[\+\-]\d+(\.[\d]+)?%?/,a=/^\w+/,u=/%$/,c=e.fn.position;function l(e,t,n){return[parseFloat(e[0])*(u.test(e[0])?t/100:1),parseFloat(e[1])*(u.test(e[1])?n/100:1)]}function d(t,n){return parseInt(e.css(t,n),10)||0}function h(t){var n=t[0];return 9===n.nodeType?{width:t.width(),height:t.height(),offset:{top:0,left:0}}:e.isWindow(n)?{width:t.width(),height:t.height(),offset:{top:t.scrollTop(),left:t.scrollLeft()}}:n.preventDefault?{width:0,height:0,offset:{top:n.pageY,left:n.pageX}}:{width:t.outerWidth(),height:t.outerHeight(),offset:t.offset()}}e.position=e.position||{scrollbarWidth:function(){if(void 0!==t)return t;var n,s,i=e("<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),r=i.children()[0];return e("body").append(i),n=r.offsetWidth,i.css("overflow","scroll"),n===(s=r.offsetWidth)&&(s=i[0].clientWidth),i.remove(),t=n-s},getScrollInfo:function(t){var n=t.isWindow||t.isDocument?"":t.element.css("overflow-x"),s=t.isWindow||t.isDocument?"":t.element.css("overflow-y"),i="scroll"===n||"auto"===n&&t.width<t.element[0].scrollWidth;return{width:"scroll"===s||"auto"===s&&t.height<t.element[0].scrollHeight?e.position.scrollbarWidth():0,height:i?e.position.scrollbarWidth():0}},getWithinInfo:function(t){var n=e(t||window),s=e.isWindow(n[0]),i=!!n[0]&&9===n[0].nodeType;return{element:n,isWindow:s,isDocument:i,offset:s||i?{left:0,top:0}:e(t).offset(),scrollLeft:n.scrollLeft(),scrollTop:n.scrollTop(),width:n.outerWidth(),height:n.outerHeight()}}},e.fn.position=function(t){if(!t||!t.of)return c.apply(this,arguments);t=e.extend({},t);var u,p,f,m,_,g,v=e(t.of),y=e.position.getWithinInfo(t.within),b=e.position.getScrollInfo(y),w=(t.collision||"flip").split(" "),k={};return g=h(v),v[0].preventDefault&&(t.at="left top"),p=g.width,f=g.height,m=g.offset,_=e.extend({},m),e.each(["my","at"],(function(){var e,n,s=(t[this]||"").split(" ");1===s.length&&(s=i.test(s[0])?s.concat(["center"]):r.test(s[0])?["center"].concat(s):["center","center"]),s[0]=i.test(s[0])?s[0]:"center",s[1]=r.test(s[1])?s[1]:"center",e=o.exec(s[0]),n=o.exec(s[1]),k[this]=[e?e[0]:0,n?n[0]:0],t[this]=[a.exec(s[0])[0],a.exec(s[1])[0]]})),1===w.length&&(w[1]=w[0]),"right"===t.at[0]?_.left+=p:"center"===t.at[0]&&(_.left+=p/2),"bottom"===t.at[1]?_.top+=f:"center"===t.at[1]&&(_.top+=f/2),u=l(k.at,p,f),_.left+=u[0],_.top+=u[1],this.each((function(){var i,r,o=e(this),a=o.outerWidth(),c=o.outerHeight(),h=d(this,"marginLeft"),g=d(this,"marginTop"),S=a+h+d(this,"marginRight")+b.width,x=c+g+d(this,"marginBottom")+b.height,C=e.extend({},_),E=l(k.my,o.outerWidth(),o.outerHeight());"right"===t.my[0]?C.left-=a:"center"===t.my[0]&&(C.left-=a/2),"bottom"===t.my[1]?C.top-=c:"center"===t.my[1]&&(C.top-=c/2),C.left+=E[0],C.top+=E[1],i={marginLeft:h,marginTop:g},e.each(["left","top"],(function(n,s){e.ui.position[w[n]]&&e.ui.position[w[n]][s](C,{targetWidth:p,targetHeight:f,elemWidth:a,elemHeight:c,collisionPosition:i,collisionWidth:S,collisionHeight:x,offset:[u[0]+E[0],u[1]+E[1]],my:t.my,at:t.at,within:y,elem:o})})),t.using&&(r=function(e){var i=m.left-C.left,r=i+p-a,u=m.top-C.top,l=u+f-c,d={target:{element:v,left:m.left,top:m.top,width:p,height:f},element:{element:o,left:C.left,top:C.top,width:a,height:c},horizontal:r<0?"left":i>0?"right":"center",vertical:l<0?"top":u>0?"bottom":"middle"};p<a&&s(i+r)<p&&(d.horizontal="center"),f<c&&s(u+l)<f&&(d.vertical="middle"),n(s(i),s(r))>n(s(u),s(l))?d.important="horizontal":d.important="vertical",t.using.call(this,e,d)}),o.offset(e.extend(C,{using:r}))}))},e.ui.position={fit:{left:function(e,t){var s,i=t.within,r=i.isWindow?i.scrollLeft:i.offset.left,o=i.width,a=e.left-t.collisionPosition.marginLeft,u=r-a,c=a+t.collisionWidth-o-r;t.collisionWidth>o?u>0&&c<=0?(s=e.left+u+t.collisionWidth-o-r,e.left+=u-s):e.left=c>0&&u<=0?r:u>c?r+o-t.collisionWidth:r:u>0?e.left+=u:c>0?e.left-=c:e.left=n(e.left-a,e.left)},top:function(e,t){var s,i=t.within,r=i.isWindow?i.scrollTop:i.offset.top,o=t.within.height,a=e.top-t.collisionPosition.marginTop,u=r-a,c=a+t.collisionHeight-o-r;t.collisionHeight>o?u>0&&c<=0?(s=e.top+u+t.collisionHeight-o-r,e.top+=u-s):e.top=c>0&&u<=0?r:u>c?r+o-t.collisionHeight:r:u>0?e.top+=u:c>0?e.top-=c:e.top=n(e.top-a,e.top)}},flip:{left:function(e,t){var n,i,r=t.within,o=r.offset.left+r.scrollLeft,a=r.width,u=r.isWindow?r.scrollLeft:r.offset.left,c=e.left-t.collisionPosition.marginLeft,l=c-u,d=c+t.collisionWidth-a-u,h="left"===t.my[0]?-t.elemWidth:"right"===t.my[0]?t.elemWidth:0,p="left"===t.at[0]?t.targetWidth:"right"===t.at[0]?-t.targetWidth:0,f=-2*t.offset[0];l<0?((n=e.left+h+p+f+t.collisionWidth-a-o)<0||n<s(l))&&(e.left+=h+p+f):d>0&&((i=e.left-t.collisionPosition.marginLeft+h+p+f-u)>0||s(i)<d)&&(e.left+=h+p+f)},top:function(e,t){var n,i,r=t.within,o=r.offset.top+r.scrollTop,a=r.height,u=r.isWindow?r.scrollTop:r.offset.top,c=e.top-t.collisionPosition.marginTop,l=c-u,d=c+t.collisionHeight-a-u,h="top"===t.my[1]?-t.elemHeight:"bottom"===t.my[1]?t.elemHeight:0,p="top"===t.at[1]?t.targetHeight:"bottom"===t.at[1]?-t.targetHeight:0,f=-2*t.offset[1];l<0?((i=e.top+h+p+f+t.collisionHeight-a-o)<0||i<s(l))&&(e.top+=h+p+f):d>0&&((n=e.top-t.collisionPosition.marginTop+h+p+f-u)>0||s(n)<d)&&(e.top+=h+p+f)}},flipfit:{left:function(){e.ui.position.flip.left.apply(this,arguments),e.ui.position.fit.left.apply(this,arguments)},top:function(){e.ui.position.flip.top.apply(this,arguments),e.ui.position.fit.top.apply(this,arguments)}}}}(),e.ui.position,e.ui.keyCode={BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38},e.fn.scrollParent=function(t){var n=this.css("position"),s="absolute"===n,i=t?/(auto|scroll|hidden)/:/(auto|scroll)/,r=this.parents().filter((function(){var t=e(this);return(!s||"static"!==t.css("position"))&&i.test(t.css("overflow")+t.css("overflow-y")+t.css("overflow-x"))})).eq(0);return"fixed"!==n&&r.length?r:e(this[0].ownerDocument||document)},e.fn.extend({uniqueId:(n=0,function(){return this.each((function(){this.id||(this.id="ui-id-"+ ++n)}))}),removeUniqueId:function(){return this.each((function(){/^ui-id-\d+$/.test(this.id)&&e(this).removeAttr("id")}))}})},void 0===(r="function"==typeof s?s.apply(t,i):s)||(e.exports=r)},2705:function(e,t,n){var s=n(5639).Symbol;e.exports=s},6874:function(e){e.exports=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}},4636:function(e,t,n){var s=n(2545),i=n(5694),r=n(1469),o=n(4144),a=n(5776),u=n(6719),c=Object.prototype.hasOwnProperty;e.exports=function(e,t){var n=r(e),l=!n&&i(e),d=!n&&!l&&o(e),h=!n&&!l&&!d&&u(e),p=n||l||d||h,f=p?s(e.length,String):[],m=f.length;for(var _ in e)!t&&!c.call(e,_)||p&&("length"==_||d&&("offset"==_||"parent"==_)||h&&("buffer"==_||"byteLength"==_||"byteOffset"==_)||a(_,m))||f.push(_);return f}},4865:function(e,t,n){var s=n(9465),i=n(7813),r=Object.prototype.hasOwnProperty;e.exports=function(e,t,n){var o=e[t];r.call(e,t)&&i(o,n)&&(void 0!==n||t in e)||s(e,t,n)}},9465:function(e,t,n){var s=n(8777);e.exports=function(e,t,n){"__proto__"==t&&s?s(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}},4239:function(e,t,n){var s=n(2705),i=n(9607),r=n(2333),o=s?s.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":o&&o in Object(e)?i(e):r(e)}},9454:function(e,t,n){var s=n(4239),i=n(7005);e.exports=function(e){return i(e)&&"[object Arguments]"==s(e)}},8458:function(e,t,n){var s=n(3560),i=n(5346),r=n(3218),o=n(346),a=/^\[object .+?Constructor\]$/,u=Function.prototype,c=Object.prototype,l=u.toString,d=c.hasOwnProperty,h=RegExp("^"+l.call(d).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!r(e)||i(e))&&(s(e)?h:a).test(o(e))}},8749:function(e,t,n){var s=n(4239),i=n(1780),r=n(7005),o={};o["[object Float32Array]"]=o["[object Float64Array]"]=o["[object Int8Array]"]=o["[object Int16Array]"]=o["[object Int32Array]"]=o["[object Uint8Array]"]=o["[object Uint8ClampedArray]"]=o["[object Uint16Array]"]=o["[object Uint32Array]"]=!0,o["[object Arguments]"]=o["[object Array]"]=o["[object ArrayBuffer]"]=o["[object Boolean]"]=o["[object DataView]"]=o["[object Date]"]=o["[object Error]"]=o["[object Function]"]=o["[object Map]"]=o["[object Number]"]=o["[object Object]"]=o["[object RegExp]"]=o["[object Set]"]=o["[object String]"]=o["[object WeakMap]"]=!1,e.exports=function(e){return r(e)&&i(e.length)&&!!o[s(e)]}},280:function(e,t,n){var s=n(5726),i=n(6916),r=Object.prototype.hasOwnProperty;e.exports=function(e){if(!s(e))return i(e);var t=[];for(var n in Object(e))r.call(e,n)&&"constructor"!=n&&t.push(n);return t}},5976:function(e,t,n){var s=n(6557),i=n(5357),r=n(61);e.exports=function(e,t){return r(i(e,t,s),e+"")}},6560:function(e,t,n){var s=n(5703),i=n(8777),r=n(6557),o=i?function(e,t){return i(e,"toString",{configurable:!0,enumerable:!1,value:s(t),writable:!0})}:r;e.exports=o},2545:function(e){e.exports=function(e,t){for(var n=-1,s=Array(e);++n<e;)s[n]=t(n);return s}},7518:function(e){e.exports=function(e){return function(t){return e(t)}}},8363:function(e,t,n){var s=n(4865),i=n(9465);e.exports=function(e,t,n,r){var o=!n;n||(n={});for(var a=-1,u=t.length;++a<u;){var c=t[a],l=r?r(n[c],e[c],c,n,e):void 0;void 0===l&&(l=e[c]),o?i(n,c,l):s(n,c,l)}return n}},4429:function(e,t,n){var s=n(5639)["__core-js_shared__"];e.exports=s},1463:function(e,t,n){var s=n(5976),i=n(6612);e.exports=function(e){return s((function(t,n){var s=-1,r=n.length,o=r>1?n[r-1]:void 0,a=r>2?n[2]:void 0;for(o=e.length>3&&"function"==typeof o?(r--,o):void 0,a&&i(n[0],n[1],a)&&(o=r<3?void 0:o,r=1),t=Object(t);++s<r;){var u=n[s];u&&e(t,u,s,o)}return t}))}},8777:function(e,t,n){var s=n(852),i=function(){try{var e=s(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=i},1957:function(e,t,n){var s="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;e.exports=s},852:function(e,t,n){var s=n(8458),i=n(7801);e.exports=function(e,t){var n=i(e,t);return s(n)?n:void 0}},9607:function(e,t,n){var s=n(2705),i=Object.prototype,r=i.hasOwnProperty,o=i.toString,a=s?s.toStringTag:void 0;e.exports=function(e){var t=r.call(e,a),n=e[a];try{e[a]=void 0;var s=!0}catch(e){}var i=o.call(e);return s&&(t?e[a]=n:delete e[a]),i}},7801:function(e){e.exports=function(e,t){return null==e?void 0:e[t]}},5776:function(e){var t=/^(?:0|[1-9]\d*)$/;e.exports=function(e,n){var s=typeof e;return!!(n=null==n?9007199254740991:n)&&("number"==s||"symbol"!=s&&t.test(e))&&e>-1&&e%1==0&&e<n}},6612:function(e,t,n){var s=n(7813),i=n(8612),r=n(5776),o=n(3218);e.exports=function(e,t,n){if(!o(n))return!1;var a=typeof t;return!!("number"==a?i(n)&&r(t,n.length):"string"==a&&t in n)&&s(n[t],e)}},5346:function(e,t,n){var s,i=n(4429),r=(s=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||""))?"Symbol(src)_1."+s:"";e.exports=function(e){return!!r&&r in e}},5726:function(e){var t=Object.prototype;e.exports=function(e){var n=e&&e.constructor;return e===("function"==typeof n&&n.prototype||t)}},6916:function(e,t,n){var s=n(5569)(Object.keys,Object);e.exports=s},1167:function(e,t,n){e=n.nmd(e);var s=n(1957),i=t&&!t.nodeType&&t,r=i&&e&&!e.nodeType&&e,o=r&&r.exports===i&&s.process,a=function(){try{var e=r&&r.require&&r.require("util").types;return e||o&&o.binding&&o.binding("util")}catch(e){}}();e.exports=a},2333:function(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},5569:function(e){e.exports=function(e,t){return function(n){return e(t(n))}}},5357:function(e,t,n){var s=n(6874),i=Math.max;e.exports=function(e,t,n){return t=i(void 0===t?e.length-1:t,0),function(){for(var r=arguments,o=-1,a=i(r.length-t,0),u=Array(a);++o<a;)u[o]=r[t+o];o=-1;for(var c=Array(t+1);++o<t;)c[o]=r[o];return c[t]=n(u),s(e,this,c)}}},5639:function(e,t,n){var s=n(1957),i="object"==typeof self&&self&&self.Object===Object&&self,r=s||i||Function("return this")();e.exports=r},61:function(e,t,n){var s=n(6560),i=n(1275)(s);e.exports=i},1275:function(e){var t=Date.now;e.exports=function(e){var n=0,s=0;return function(){var i=t(),r=16-(i-s);if(s=i,r>0){if(++n>=800)return arguments[0]}else n=0;return e.apply(void 0,arguments)}}},346:function(e){var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},8583:function(e,t,n){var s=n(4865),i=n(8363),r=n(1463),o=n(8612),a=n(5726),u=n(3674),c=Object.prototype.hasOwnProperty,l=r((function(e,t){if(a(t)||o(t))i(t,u(t),e);else for(var n in t)c.call(t,n)&&s(e,n,t[n])}));e.exports=l},5703:function(e){e.exports=function(e){return function(){return e}}},7813:function(e){e.exports=function(e,t){return e===t||e!=e&&t!=t}},6557:function(e){e.exports=function(e){return e}},5694:function(e,t,n){var s=n(9454),i=n(7005),r=Object.prototype,o=r.hasOwnProperty,a=r.propertyIsEnumerable,u=s(function(){return arguments}())?s:function(e){return i(e)&&o.call(e,"callee")&&!a.call(e,"callee")};e.exports=u},1469:function(e){var t=Array.isArray;e.exports=t},8612:function(e,t,n){var s=n(3560),i=n(1780);e.exports=function(e){return null!=e&&i(e.length)&&!s(e)}},4144:function(e,t,n){e=n.nmd(e);var s=n(5639),i=n(5062),r=t&&!t.nodeType&&t,o=r&&e&&!e.nodeType&&e,a=o&&o.exports===r?s.Buffer:void 0,u=(a?a.isBuffer:void 0)||i;e.exports=u},3560:function(e,t,n){var s=n(4239),i=n(3218);e.exports=function(e){if(!i(e))return!1;var t=s(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},1780:function(e){e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},3218:function(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},7005:function(e){e.exports=function(e){return null!=e&&"object"==typeof e}},6719:function(e,t,n){var s=n(8749),i=n(7518),r=n(1167),o=r&&r.isTypedArray,a=o?i(o):s;e.exports=a},3674:function(e,t,n){var s=n(4636),i=n(280),r=n(8612);e.exports=function(e){return r(e)?s(e):i(e)}},5062:function(e){e.exports=function(){return!1}},8891:function(e){"use strict";var t,n={DEBUG:!1,LIB_VERSION:"2.47.0"};if("undefined"==typeof window){var s={hostname:""};t={navigator:{userAgent:""},document:{location:s,referrer:""},screen:{width:0,height:0},location:s}}else t=window;var i,r,o,a,u,c,l,d,h,p,f,m=Array.prototype,_=Function.prototype,g=Object.prototype,v=m.slice,y=g.toString,b=g.hasOwnProperty,w=t.console,k=t.navigator,S=t.document,x=t.opera,C=t.screen,E=k.userAgent,N=_.bind,T=m.forEach,j=m.indexOf,P=m.map,I=Array.isArray,B={},O={trim:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},L={log:function(){if(n.DEBUG&&!O.isUndefined(w)&&w)try{w.log.apply(w,arguments)}catch(e){O.each(arguments,(function(e){w.log(e)}))}},warn:function(){if(n.DEBUG&&!O.isUndefined(w)&&w){var e=["Mixpanel warning:"].concat(O.toArray(arguments));try{w.warn.apply(w,e)}catch(t){O.each(e,(function(e){w.warn(e)}))}}},error:function(){if(n.DEBUG&&!O.isUndefined(w)&&w){var e=["Mixpanel error:"].concat(O.toArray(arguments));try{w.error.apply(w,e)}catch(t){O.each(e,(function(e){w.error(e)}))}}},critical:function(){if(!O.isUndefined(w)&&w){var e=["Mixpanel error:"].concat(O.toArray(arguments));try{w.error.apply(w,e)}catch(t){O.each(e,(function(e){w.error(e)}))}}}},q=function(e,t){return function(){return arguments[0]="["+t+"] "+arguments[0],e.apply(L,arguments)}},D=function(e){return{log:q(L.log,e),error:q(L.error,e),critical:q(L.critical,e)}};O.bind=function(e,t){var n,s;if(N&&e.bind===N)return N.apply(e,v.call(arguments,1));if(!O.isFunction(e))throw new TypeError;return n=v.call(arguments,2),s=function(){if(!(this instanceof s))return e.apply(t,n.concat(v.call(arguments)));var i={};i.prototype=e.prototype;var r=new i;i.prototype=null;var o=e.apply(r,n.concat(v.call(arguments)));return Object(o)===o?o:r},s},O.each=function(e,t,n){if(null!=e)if(T&&e.forEach===T)e.forEach(t,n);else if(e.length===+e.length){for(var s=0,i=e.length;s<i;s++)if(s in e&&t.call(n,e[s],s,e)===B)return}else for(var r in e)if(b.call(e,r)&&t.call(n,e[r],r,e)===B)return},O.extend=function(e){return O.each(v.call(arguments,1),(function(t){for(var n in t)void 0!==t[n]&&(e[n]=t[n])})),e},O.isArray=I||function(e){return"[object Array]"===y.call(e)},O.isFunction=function(e){try{return/^\s*\bfunction\b/.test(e)}catch(e){return!1}},O.isArguments=function(e){return!(!e||!b.call(e,"callee"))},O.toArray=function(e){return e?e.toArray?e.toArray():O.isArray(e)||O.isArguments(e)?v.call(e):O.values(e):[]},O.map=function(e,t,n){if(P&&e.map===P)return e.map(t,n);var s=[];return O.each(e,(function(e){s.push(t.call(n,e))})),s},O.keys=function(e){var t=[];return null===e||O.each(e,(function(e,n){t[t.length]=n})),t},O.values=function(e){var t=[];return null===e||O.each(e,(function(e){t[t.length]=e})),t},O.include=function(e,t){var n=!1;return null===e?n:j&&e.indexOf===j?-1!=e.indexOf(t):(O.each(e,(function(e){if(n||(n=e===t))return B})),n)},O.includes=function(e,t){return-1!==e.indexOf(t)},O.inherit=function(e,t){return e.prototype=new t,e.prototype.constructor=e,e.superclass=t.prototype,e},O.isObject=function(e){return e===Object(e)&&!O.isArray(e)},O.isEmptyObject=function(e){if(O.isObject(e)){for(var t in e)if(b.call(e,t))return!1;return!0}return!1},O.isUndefined=function(e){return void 0===e},O.isString=function(e){return"[object String]"==y.call(e)},O.isDate=function(e){return"[object Date]"==y.call(e)},O.isNumber=function(e){return"[object Number]"==y.call(e)},O.isElement=function(e){return!(!e||1!==e.nodeType)},O.encodeDates=function(e){return O.each(e,(function(t,n){O.isDate(t)?e[n]=O.formatDate(t):O.isObject(t)&&(e[n]=O.encodeDates(t))})),e},O.timestamp=function(){return Date.now=Date.now||function(){return+new Date},Date.now()},O.formatDate=function(e){function t(e){return e<10?"0"+e:e}return e.getUTCFullYear()+"-"+t(e.getUTCMonth()+1)+"-"+t(e.getUTCDate())+"T"+t(e.getUTCHours())+":"+t(e.getUTCMinutes())+":"+t(e.getUTCSeconds())},O.strip_empty_properties=function(e){var t={};return O.each(e,(function(e,n){O.isString(e)&&e.length>0&&(t[n]=e)})),t},O.truncate=function(e,t){var n;return"string"==typeof e?n=e.slice(0,t):O.isArray(e)?(n=[],O.each(e,(function(e){n.push(O.truncate(e,t))}))):O.isObject(e)?(n={},O.each(e,(function(e,s){n[s]=O.truncate(e,t)}))):n=e,n},O.JSONEncode=function(e){var t=function(e){var t=/[\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,n={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};return t.lastIndex=0,t.test(e)?'"'+e.replace(t,(function(e){var t=n[e];return"string"==typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)}))+'"':'"'+e+'"'},n=function(e,s){var i="",r=0,o="",a="",u=0,c=i,l=[],d=s[e];switch(d&&"object"==typeof d&&"function"==typeof d.toJSON&&(d=d.toJSON(e)),typeof d){case"string":return t(d);case"number":return isFinite(d)?String(d):"null";case"boolean":case"null":return String(d);case"object":if(!d)return"null";if(i+=" ",l=[],"[object Array]"===y.apply(d)){for(u=d.length,r=0;r<u;r+=1)l[r]=n(r,d)||"null";return a=0===l.length?"[]":i?"[\n"+i+l.join(",\n"+i)+"\n"+c+"]":"["+l.join(",")+"]",i=c,a}for(o in d)b.call(d,o)&&(a=n(o,d))&&l.push(t(o)+(i?": ":":")+a);return a=0===l.length?"{}":i?"{"+l.join(",")+c+"}":"{"+l.join(",")+"}",i=c,a}};return n("",{"":e})},O.JSONDecode=(u={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"},c=function(e){var t=new SyntaxError(e);throw t.at=i,t.text=o,t},l=function(e){return e&&e!==r&&c("Expected '"+e+"' instead of '"+r+"'"),r=o.charAt(i),i+=1,r},d=function(){var e,t="";for("-"===r&&(t="-",l("-"));r>="0"&&r<="9";)t+=r,l();if("."===r)for(t+=".";l()&&r>="0"&&r<="9";)t+=r;if("e"===r||"E"===r)for(t+=r,l(),"-"!==r&&"+"!==r||(t+=r,l());r>="0"&&r<="9";)t+=r,l();if(e=+t,isFinite(e))return e;c("Bad number")},h=function(){var e,t,n,s="";if('"'===r)for(;l();){if('"'===r)return l(),s;if("\\"===r)if(l(),"u"===r){for(n=0,t=0;t<4&&(e=parseInt(l(),16),isFinite(e));t+=1)n=16*n+e;s+=String.fromCharCode(n)}else{if("string"!=typeof u[r])break;s+=u[r]}else s+=r}c("Bad string")},p=function(){for(;r&&r<=" ";)l()},a=function(){switch(p(),r){case"{":return function(){var e,t={};if("{"===r){if(l("{"),p(),"}"===r)return l("}"),t;for(;r;){if(e=h(),p(),l(":"),Object.hasOwnProperty.call(t,e)&&c('Duplicate key "'+e+'"'),t[e]=a(),p(),"}"===r)return l("}"),t;l(","),p()}}c("Bad object")}();case"[":return function(){var e=[];if("["===r){if(l("["),p(),"]"===r)return l("]"),e;for(;r;){if(e.push(a()),p(),"]"===r)return l("]"),e;l(","),p()}}c("Bad array")}();case'"':return h();case"-":return d();default:return r>="0"&&r<="9"?d():function(){switch(r){case"t":return l("t"),l("r"),l("u"),l("e"),!0;case"f":return l("f"),l("a"),l("l"),l("s"),l("e"),!1;case"n":return l("n"),l("u"),l("l"),l("l"),null}c('Unexpected "'+r+'"')}()}},function(e){var t;return o=e,i=0,r=" ",t=a(),p(),r&&c("Syntax error"),t}),O.base64Encode=function(e){var t,n,s,i,r,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",a=0,u=0,c="",l=[];if(!e)return e;e=O.utf8Encode(e);do{t=(r=e.charCodeAt(a++)<<16|e.charCodeAt(a++)<<8|e.charCodeAt(a++))>>18&63,n=r>>12&63,s=r>>6&63,i=63&r,l[u++]=o.charAt(t)+o.charAt(n)+o.charAt(s)+o.charAt(i)}while(a<e.length);switch(c=l.join(""),e.length%3){case 1:c=c.slice(0,-2)+"==";break;case 2:c=c.slice(0,-1)+"="}return c},O.utf8Encode=function(e){var t,n,s,i,r="";for(t=n=0,s=(e=(e+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n")).length,i=0;i<s;i++){var o=e.charCodeAt(i),a=null;o<128?n++:a=o>127&&o<2048?String.fromCharCode(o>>6|192,63&o|128):String.fromCharCode(o>>12|224,o>>6&63|128,63&o|128),null!==a&&(n>t&&(r+=e.substring(t,n)),r+=a,t=n=i+1)}return n>t&&(r+=e.substring(t,e.length)),r},O.UUID=(f=function(){var e,n=1*new Date;if(t.performance&&t.performance.now)e=t.performance.now();else for(e=0;n==1*new Date;)e++;return n.toString(16)+Math.floor(e).toString(16)},function(){var e=(C.height*C.width).toString(16);return f()+"-"+Math.random().toString(16).replace(".","")+"-"+function(){var e,t,n=E,s=[],i=0;function r(e,t){var n,i=0;for(n=0;n<t.length;n++)i|=s[n]<<8*n;return e^i}for(e=0;e<n.length;e++)t=n.charCodeAt(e),s.unshift(255&t),s.length>=4&&(i=r(i,s),s=[]);return s.length>0&&(i=r(i,s)),i.toString(16)}()+"-"+e+"-"+f()});var A=["ahrefsbot","baiduspider","bingbot","bingpreview","facebookexternal","petalbot","pinterest","screaming frog","yahoo! slurp","yandexbot","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleweblight","mediapartners-google","storebot-google"];O.isBlockedUA=function(e){var t;for(e=e.toLowerCase(),t=0;t<A.length;t++)if(-1!==e.indexOf(A[t]))return!0;return!1},O.HTTPBuildQuery=function(e,t){var n,s,i=[];return O.isUndefined(t)&&(t="&"),O.each(e,(function(e,t){n=encodeURIComponent(e.toString()),s=encodeURIComponent(t),i[i.length]=s+"="+n})),i.join(t)},O.getQueryParam=function(e,t){t=t.replace(/[[]/,"\\[").replace(/[\]]/,"\\]");var n=new RegExp("[\\?&]"+t+"=([^&#]*)").exec(e);if(null===n||n&&"string"!=typeof n[1]&&n[1].length)return"";var s=n[1];try{s=decodeURIComponent(s)}catch(e){L.error("Skipping decoding for malformed query param: "+s)}return s.replace(/\+/g," ")},O.cookie={get:function(e){for(var t=e+"=",n=S.cookie.split(";"),s=0;s<n.length;s++){for(var i=n[s];" "==i.charAt(0);)i=i.substring(1,i.length);if(0===i.indexOf(t))return decodeURIComponent(i.substring(t.length,i.length))}return null},parse:function(e){var t;try{t=O.JSONDecode(O.cookie.get(e))||{}}catch(e){}return t},set_seconds:function(e,t,n,s,i,r,o){var a="",u="",c="";if(o)a="; domain="+o;else if(s){var l=Q(S.location.hostname);a=l?"; domain=."+l:""}if(n){var d=new Date;d.setTime(d.getTime()+1e3*n),u="; expires="+d.toGMTString()}r&&(i=!0,c="; SameSite=None"),i&&(c+="; secure"),S.cookie=e+"="+encodeURIComponent(t)+u+"; path=/"+a+c},set:function(e,t,n,s,i,r,o){var a="",u="",c="";if(o)a="; domain="+o;else if(s){var l=Q(S.location.hostname);a=l?"; domain=."+l:""}if(n){var d=new Date;d.setTime(d.getTime()+24*n*60*60*1e3),u="; expires="+d.toGMTString()}r&&(i=!0,c="; SameSite=None"),i&&(c+="; secure");var h=e+"="+encodeURIComponent(t)+u+"; path=/"+a+c;return S.cookie=h,h},remove:function(e,t,n){O.cookie.set(e,"",-1,t,!1,!1,n)}};var M=null,R=function(e,t){if(null!==M&&!t)return M;var n=!0;try{e=e||window.localStorage;var s="__mplss_"+U(8);e.setItem(s,"xyz"),"xyz"!==e.getItem(s)&&(n=!1),e.removeItem(s)}catch(e){n=!1}return M=n,n};O.localStorage={is_supported:function(e){var t=R(null,e);return t||L.error("localStorage unsupported; falling back to cookie store"),t},error:function(e){L.error("localStorage error: "+e)},get:function(e){try{return window.localStorage.getItem(e)}catch(e){O.localStorage.error(e)}return null},parse:function(e){try{return O.JSONDecode(O.localStorage.get(e))||{}}catch(e){}return null},set:function(e,t){try{window.localStorage.setItem(e,t)}catch(e){O.localStorage.error(e)}},remove:function(e){try{window.localStorage.removeItem(e)}catch(e){O.localStorage.error(e)}}},O.register_event=function(){function e(t){return t&&(t.preventDefault=e.preventDefault,t.stopPropagation=e.stopPropagation),t}return e.preventDefault=function(){this.returnValue=!1},e.stopPropagation=function(){this.cancelBubble=!0},function(t,n,s,i,r){if(t)if(t.addEventListener&&!i)t.addEventListener(n,s,!!r);else{var o="on"+n,a=t[o];t[o]=function(t,n,s){var i=function(i){if(i=i||e(window.event)){var r,o,a=!0;return O.isFunction(s)&&(r=s(i)),o=n.call(t,i),!1!==r&&!1!==o||(a=!1),a}};return i}(t,s,a)}else L.error("No valid element provided to register_event")}}();var z=new RegExp('^(\\w*)\\[(\\w+)([=~\\|\\^\\$\\*]?)=?"?([^\\]"]*)"?\\]$');O.dom_query=function(){function e(e){return e.all?e.all:e.getElementsByTagName("*")}var t=/[\t\r\n]/g;function n(e,n){var s=" "+n+" ";return(" "+e.className+" ").replace(t," ").indexOf(s)>=0}function s(t){if(!S.getElementsByTagName)return[];var s,i,r,o,a,u,c,l,d,h,p=t.split(" "),f=[S];for(u=0;u<p.length;u++)if((s=p[u].replace(/^\s+/,"").replace(/\s+$/,"")).indexOf("#")>-1){r=(i=s.split("#"))[0];var m=i[1],_=S.getElementById(m);if(!_||r&&_.nodeName.toLowerCase()!=r)return[];f=[_]}else if(s.indexOf(".")>-1){r=(i=s.split("."))[0];var g=i[1];for(r||(r="*"),o=[],a=0,c=0;c<f.length;c++)for(d="*"==r?e(f[c]):f[c].getElementsByTagName(r),l=0;l<d.length;l++)o[a++]=d[l];for(f=[],h=0,c=0;c<o.length;c++)o[c].className&&O.isString(o[c].className)&&n(o[c],g)&&(f[h++]=o[c])}else{var v=s.match(z);if(v){r=v[1];var y,b=v[2],w=v[3],k=v[4];for(r||(r="*"),o=[],a=0,c=0;c<f.length;c++)for(d="*"==r?e(f[c]):f[c].getElementsByTagName(r),l=0;l<d.length;l++)o[a++]=d[l];switch(f=[],h=0,w){case"=":y=function(e){return e.getAttribute(b)==k};break;case"~":y=function(e){return e.getAttribute(b).match(new RegExp("\\b"+k+"\\b"))};break;case"|":y=function(e){return e.getAttribute(b).match(new RegExp("^"+k+"-?"))};break;case"^":y=function(e){return 0===e.getAttribute(b).indexOf(k)};break;case"$":y=function(e){return e.getAttribute(b).lastIndexOf(k)==e.getAttribute(b).length-k.length};break;case"*":y=function(e){return e.getAttribute(b).indexOf(k)>-1};break;default:y=function(e){return e.getAttribute(b)}}for(f=[],h=0,c=0;c<o.length;c++)y(o[c])&&(f[h++]=o[c])}else{for(r=s,o=[],a=0,c=0;c<f.length;c++)for(d=f[c].getElementsByTagName(r),l=0;l<d.length;l++)o[a++]=d[l];f=o}}return f}return function(e){return O.isElement(e)?[e]:O.isObject(e)&&!O.isUndefined(e.length)?e:s.call(this,e)}}();var F=["utm_source","utm_medium","utm_campaign","utm_content","utm_term"],H=["dclid","fbclid","gclid","ko_click_id","li_fat_id","msclkid","ttclid","twclid","wbraid"];O.info={campaignParams:function(e){var t="",n={};return O.each(F,(function(s){(t=O.getQueryParam(S.URL,s)).length?n[s]=t:void 0!==e&&(n[s]=e)})),n},clickParams:function(){var e="",t={};return O.each(H,(function(n){(e=O.getQueryParam(S.URL,n)).length&&(t[n]=e)})),t},marketingParams:function(){return O.extend(O.info.campaignParams(),O.info.clickParams())},searchEngine:function(e){return 0===e.search("https?://(.*)google.([^/?]*)")?"google":0===e.search("https?://(.*)bing.com")?"bing":0===e.search("https?://(.*)yahoo.com")?"yahoo":0===e.search("https?://(.*)duckduckgo.com")?"duckduckgo":null},searchInfo:function(e){var t=O.info.searchEngine(e),n="yahoo"!=t?"q":"p",s={};if(null!==t){s.$search_engine=t;var i=O.getQueryParam(e,n);i.length&&(s.mp_keyword=i)}return s},browser:function(e,t,n){return t=t||"",n||O.includes(e," OPR/")?O.includes(e,"Mini")?"Opera Mini":"Opera":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":O.includes(e,"IEMobile")||O.includes(e,"WPDesktop")?"Internet Explorer Mobile":O.includes(e,"SamsungBrowser/")?"Samsung Internet":O.includes(e,"Edge")||O.includes(e,"Edg/")?"Microsoft Edge":O.includes(e,"FBIOS")?"Facebook Mobile":O.includes(e,"Chrome")?"Chrome":O.includes(e,"CriOS")?"Chrome iOS":O.includes(e,"UCWEB")||O.includes(e,"UCBrowser")?"UC Browser":O.includes(e,"FxiOS")?"Firefox iOS":O.includes(t,"Apple")?O.includes(e,"Mobile")?"Mobile Safari":"Safari":O.includes(e,"Android")?"Android Mobile":O.includes(e,"Konqueror")?"Konqueror":O.includes(e,"Firefox")?"Firefox":O.includes(e,"MSIE")||O.includes(e,"Trident/")?"Internet Explorer":O.includes(e,"Gecko")?"Mozilla":""},browserVersion:function(e,t,n){var s={"Internet Explorer Mobile":/rv:(\d+(\.\d+)?)/,"Microsoft Edge":/Edge?\/(\d+(\.\d+)?)/,Chrome:/Chrome\/(\d+(\.\d+)?)/,"Chrome iOS":/CriOS\/(\d+(\.\d+)?)/,"UC Browser":/(UCBrowser|UCWEB)\/(\d+(\.\d+)?)/,Safari:/Version\/(\d+(\.\d+)?)/,"Mobile Safari":/Version\/(\d+(\.\d+)?)/,Opera:/(Opera|OPR)\/(\d+(\.\d+)?)/,Firefox:/Firefox\/(\d+(\.\d+)?)/,"Firefox iOS":/FxiOS\/(\d+(\.\d+)?)/,Konqueror:/Konqueror:(\d+(\.\d+)?)/,BlackBerry:/BlackBerry (\d+(\.\d+)?)/,"Android Mobile":/android\s(\d+(\.\d+)?)/,"Samsung Internet":/SamsungBrowser\/(\d+(\.\d+)?)/,"Internet Explorer":/(rv:|MSIE )(\d+(\.\d+)?)/,Mozilla:/rv:(\d+(\.\d+)?)/}[O.info.browser(e,t,n)];if(void 0===s)return null;var i=e.match(s);return i?parseFloat(i[i.length-2]):null},os:function(){var e=E;return/Windows/i.test(e)?/Phone/.test(e)||/WPDesktop/.test(e)?"Windows Phone":"Windows":/(iPhone|iPad|iPod)/.test(e)?"iOS":/Android/.test(e)?"Android":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":/Mac/i.test(e)?"Mac OS X":/Linux/.test(e)?"Linux":/CrOS/.test(e)?"Chrome OS":""},device:function(e){return/Windows Phone/i.test(e)||/WPDesktop/.test(e)?"Windows Phone":/iPad/.test(e)?"iPad":/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":/Android/.test(e)?"Android":""},referringDomain:function(e){var t=e.split("/");return t.length>=3?t[2]:""},properties:function(){return O.extend(O.strip_empty_properties({$os:O.info.os(),$browser:O.info.browser(E,k.vendor,x),$referrer:S.referrer,$referring_domain:O.info.referringDomain(S.referrer),$device:O.info.device(E)}),{$current_url:t.location.href,$browser_version:O.info.browserVersion(E,k.vendor,x),$screen_height:C.height,$screen_width:C.width,mp_lib:"web",$lib_version:n.LIB_VERSION,$insert_id:U(),time:O.timestamp()/1e3})},people_properties:function(){return O.extend(O.strip_empty_properties({$os:O.info.os(),$browser:O.info.browser(E,k.vendor,x)}),{$browser_version:O.info.browserVersion(E,k.vendor,x)})},mpPageViewProperties:function(){return O.strip_empty_properties({current_page_title:S.title,current_domain:t.location.hostname,current_url_path:t.location.pathname,current_url_protocol:t.location.protocol,current_url_search:t.location.search})}};var U=function(e){var t=Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10);return e?t.substring(0,e):t},W=/[a-z0-9][a-z0-9-]*\.[a-z]+$/i,$=/[a-z0-9][a-z0-9-]+\.[a-z.]{2,6}$/i,Q=function(e){var t=$,n=e.split("."),s=n[n.length-1];(s.length>4||"com"===s||"org"===s)&&(t=W);var i=e.match(t);return i?i[0]:""},V=null,K=null;"undefined"!=typeof JSON&&(V=JSON.stringify,K=JSON.parse),V=V||O.JSONEncode,K=K||O.JSONDecode,O.toArray=O.toArray,O.isObject=O.isObject,O.JSONEncode=O.JSONEncode,O.JSONDecode=O.JSONDecode,O.isBlockedUA=O.isBlockedUA,O.isEmptyObject=O.isEmptyObject,O.info=O.info,O.info.device=O.info.device,O.info.browser=O.info.browser,O.info.browserVersion=O.info.browserVersion,O.info.properties=O.info.properties;var Z=function(){};Z.prototype.create_properties=function(){},Z.prototype.event_handler=function(){},Z.prototype.after_track_handler=function(){},Z.prototype.init=function(e){return this.mp=e,this},Z.prototype.track=function(e,t,n,s){var i=this,r=O.dom_query(e);if(0!==r.length)return O.each(r,(function(e){O.register_event(e,this.override_event,(function(e){var r={},o=i.create_properties(n,this),a=i.mp.get_config("track_links_timeout");i.event_handler(e,this,r),window.setTimeout(i.track_callback(s,o,r,!0),a),i.mp.track(t,o,i.track_callback(s,o,r))}))}),this),!0;L.error("The DOM query ("+e+") returned 0 elements")},Z.prototype.track_callback=function(e,t,n,s){s=s||!1;var i=this;return function(){n.callback_fired||(n.callback_fired=!0,e&&!1===e(s,t)||i.after_track_handler(t,n,s))}},Z.prototype.create_properties=function(e,t){return"function"==typeof e?e(t):O.extend({},e)};var G=function(){this.override_event="click"};O.inherit(G,Z),G.prototype.create_properties=function(e,t){var n=G.superclass.create_properties.apply(this,arguments);return t.href&&(n.url=t.href),n},G.prototype.event_handler=function(e,t,n){n.new_tab=2===e.which||e.metaKey||e.ctrlKey||"_blank"===t.target,n.href=t.href,n.new_tab||e.preventDefault()},G.prototype.after_track_handler=function(e,t){t.new_tab||setTimeout((function(){window.location=t.href}),0)};var J=function(){this.override_event="submit"};O.inherit(J,Z),J.prototype.event_handler=function(e,t,n){n.element=t,e.preventDefault()},J.prototype.after_track_handler=function(e,t){setTimeout((function(){t.element.submit()}),0)};var X=D("lock"),Y=function(e,t){t=t||{},this.storageKey=e,this.storage=t.storage||window.localStorage,this.pollIntervalMS=t.pollIntervalMS||100,this.timeoutMS=t.timeoutMS||2e3};Y.prototype.withLock=function(e,t,n){n||"function"==typeof t||(n=t,t=null);var s=n||(new Date).getTime()+"|"+Math.random(),i=(new Date).getTime(),r=this.storageKey,o=this.pollIntervalMS,a=this.timeoutMS,u=this.storage,c=r+":X",l=r+":Y",d=r+":Z",h=function(e){t&&t(e)},p=function(e){if((new Date).getTime()-i>a)return X.error("Timeout waiting for mutex on "+r+"; clearing lock. ["+s+"]"),u.removeItem(d),u.removeItem(l),void _();setTimeout((function(){try{e()}catch(e){h(e)}}),o*(Math.random()+.1))},f=function(e,t){e()?t():p((function(){f(e,t)}))},m=function(){var e=u.getItem(l);if(e&&e!==s)return!1;if(u.setItem(l,s),u.getItem(l)===s)return!0;if(!R(u,!0))throw new Error("localStorage support dropped while acquiring lock");return!1},_=function(){u.setItem(c,s),f(m,(function(){u.getItem(c)!==s?p((function(){u.getItem(l)===s?f((function(){return!u.getItem(d)}),g):_()})):g()}))},g=function(){u.setItem(d,"1");try{e()}finally{u.removeItem(d),u.getItem(l)===s&&u.removeItem(l),u.getItem(c)===s&&u.removeItem(c)}};try{if(!R(u,!0))throw new Error("localStorage support check failed");_()}catch(e){h(e)}};var ee=D("batch"),te=function(e,t){t=t||{},this.storageKey=e,this.storage=t.storage||window.localStorage,this.reportError=t.errorReporter||O.bind(ee.error,ee),this.lock=new Y(e,{storage:this.storage}),this.pid=t.pid||null,this.memQueue=[]};te.prototype.enqueue=function(e,t,n){var s={id:U(),flushAfter:(new Date).getTime()+2*t,payload:e};this.lock.withLock(O.bind((function(){var t;try{var i=this.readFromStorage();i.push(s),(t=this.saveToStorage(i))&&this.memQueue.push(s)}catch(n){this.reportError("Error enqueueing item",e),t=!1}n&&n(t)}),this),O.bind((function(e){this.reportError("Error acquiring storage lock",e),n&&n(!1)}),this),this.pid)},te.prototype.fillBatch=function(e){var t=this.memQueue.slice(0,e);if(t.length<e){var n=this.readFromStorage();if(n.length){var s={};O.each(t,(function(e){s[e.id]=!0}));for(var i=0;i<n.length;i++){var r=n[i];if((new Date).getTime()>r.flushAfter&&!s[r.id]&&(r.orphaned=!0,t.push(r),t.length>=e))break}}}return t};var ne=function(e,t){var n=[];return O.each(e,(function(e){e.id&&!t[e.id]&&n.push(e)})),n};te.prototype.removeItemsByID=function(e,t){var n={};O.each(e,(function(e){n[e]=!0})),this.memQueue=ne(this.memQueue,n);var s=O.bind((function(){var t;try{var s=this.readFromStorage();if(s=ne(s,n),t=this.saveToStorage(s)){s=this.readFromStorage();for(var i=0;i<s.length;i++){var r=s[i];if(r.id&&n[r.id])return this.reportError("Item not removed from storage"),!1}}}catch(n){this.reportError("Error removing items",e),t=!1}return t}),this);this.lock.withLock((function(){var e=s();t&&t(e)}),O.bind((function(e){var n=!1;if(this.reportError("Error acquiring storage lock",e),!R(this.storage,!0)&&!(n=s()))try{this.storage.removeItem(this.storageKey)}catch(e){this.reportError("Error clearing queue",e)}t&&t(n)}),this),this.pid)};var se=function(e,t){var n=[];return O.each(e,(function(e){var s=e.id;if(s in t){var i=t[s];null!==i&&(e.payload=i,n.push(e))}else n.push(e)})),n};te.prototype.updatePayloads=function(e,t){this.memQueue=se(this.memQueue,e),this.lock.withLock(O.bind((function(){var n;try{var s=this.readFromStorage();s=se(s,e),n=this.saveToStorage(s)}catch(t){this.reportError("Error updating items",e),n=!1}t&&t(n)}),this),O.bind((function(e){this.reportError("Error acquiring storage lock",e),t&&t(!1)}),this),this.pid)},te.prototype.readFromStorage=function(){var e;try{(e=this.storage.getItem(this.storageKey))&&(e=K(e),O.isArray(e)||(this.reportError("Invalid storage entry:",e),e=null))}catch(t){this.reportError("Error retrieving queue",t),e=null}return e||[]},te.prototype.saveToStorage=function(e){try{return this.storage.setItem(this.storageKey,V(e)),!0}catch(e){return this.reportError("Error saving queue",e),!1}},te.prototype.clear=function(){this.memQueue=[],this.storage.removeItem(this.storageKey)};var ie=D("batch"),re=function(e,t){this.errorReporter=t.errorReporter,this.queue=new te(e,{errorReporter:O.bind(this.reportError,this),storage:t.storage}),this.libConfig=t.libConfig,this.sendRequest=t.sendRequestFunc,this.beforeSendHook=t.beforeSendHook,this.stopAllBatching=t.stopAllBatchingFunc,this.batchSize=this.libConfig.batch_size,this.flushInterval=this.libConfig.batch_flush_interval_ms,this.stopped=!this.libConfig.batch_autostart,this.consecutiveRemovalFailures=0,this.itemIdsSentSuccessfully={}};re.prototype.enqueue=function(e,t){this.queue.enqueue(e,this.flushInterval,t)},re.prototype.start=function(){this.stopped=!1,this.consecutiveRemovalFailures=0,this.flush()},re.prototype.stop=function(){this.stopped=!0,this.timeoutID&&(clearTimeout(this.timeoutID),this.timeoutID=null)},re.prototype.clear=function(){this.queue.clear()},re.prototype.resetBatchSize=function(){this.batchSize=this.libConfig.batch_size},re.prototype.resetFlush=function(){this.scheduleFlush(this.libConfig.batch_flush_interval_ms)},re.prototype.scheduleFlush=function(e){this.flushInterval=e,this.stopped||(this.timeoutID=setTimeout(O.bind(this.flush,this),this.flushInterval))},re.prototype.flush=function(e){try{if(this.requestInProgress)return void ie.log("Flush: Request already in progress");e=e||{};var t=this.libConfig.batch_request_timeout_ms,s=(new Date).getTime(),i=this.batchSize,r=this.queue.fillBatch(i),o=[],a={};if(O.each(r,(function(e){var t=e.payload;if(this.beforeSendHook&&!e.orphaned&&(t=this.beforeSendHook(t)),t){t.event&&t.properties&&(t.properties=O.extend({},t.properties,{mp_sent_by_lib_version:n.LIB_VERSION}));var s=!0,i=e.id;i?(this.itemIdsSentSuccessfully[i]||0)>5&&(this.reportError("[dupe] item ID sent too many times, not sending",{item:e,batchSize:r.length,timesSent:this.itemIdsSentSuccessfully[i]}),s=!1):this.reportError("[dupe] found item with no ID",{item:e}),s&&o.push(t)}a[e.id]=t}),this),o.length<1)return void this.resetFlush();this.requestInProgress=!0;var u=O.bind((function(n){this.requestInProgress=!1;try{var o=!1;if(e.unloading)this.queue.updatePayloads(a);else if(O.isObject(n)&&"timeout"===n.error&&(new Date).getTime()-s>=t)this.reportError("Network timeout; retrying"),this.flush();else if(O.isObject(n)&&n.xhr_req&&(n.xhr_req.status>=500||429===n.xhr_req.status||"timeout"===n.error)){var u=2*this.flushInterval,c=n.xhr_req.responseHeaders;if(c){var l=c["Retry-After"];l&&(u=1e3*parseInt(l,10)||u)}u=Math.min(6e5,u),this.reportError("Error; retry in "+u+" ms"),this.scheduleFlush(u)}else if(O.isObject(n)&&n.xhr_req&&413===n.xhr_req.status)if(r.length>1){var d=Math.max(1,Math.floor(i/2));this.batchSize=Math.min(this.batchSize,d,r.length-1),this.reportError("413 response; reducing batch size to "+this.batchSize),this.resetFlush()}else this.reportError("Single-event request too large; dropping",r),this.resetBatchSize(),o=!0;else o=!0;o&&(this.queue.removeItemsByID(O.map(r,(function(e){return e.id})),O.bind((function(e){e?(this.consecutiveRemovalFailures=0,this.flush()):(this.reportError("Failed to remove items from queue"),++this.consecutiveRemovalFailures>5?(this.reportError("Too many queue failures; disabling batching system."),this.stopAllBatching()):this.resetFlush())}),this)),O.each(r,O.bind((function(e){var t=e.id;t?(this.itemIdsSentSuccessfully[t]=this.itemIdsSentSuccessfully[t]||0,this.itemIdsSentSuccessfully[t]++,this.itemIdsSentSuccessfully[t]>5&&this.reportError("[dupe] item ID sent too many times",{item:e,batchSize:r.length,timesSent:this.itemIdsSentSuccessfully[t]})):this.reportError("[dupe] found item with no ID while removing",{item:e})}),this)))}catch(e){this.reportError("Error handling API response",e),this.resetFlush()}}),this),c={method:"POST",verbose:!0,ignore_json_errors:!0,timeout_ms:t};e.unloading&&(c.transport="sendBeacon"),ie.log("MIXPANEL REQUEST:",o),this.sendRequest(o,c,u)}catch(e){this.reportError("Error flushing request queue",e),this.resetFlush()}},re.prototype.reportError=function(e,t){if(ie.error.apply(ie.error,arguments),this.errorReporter)try{t instanceof Error||(t=new Error(e)),this.errorReporter(e,t)}catch(t){ie.error(t)}};var oe="__mp_opt_in_out_";function ae(e,t){ve(!0,e,t)}function ue(e,t){ve(!1,e,t)}function ce(e,t){return"1"===ge(e,t)}function le(e,n){if(function(e){if(e&&e.ignoreDnt)return!1;var n=e&&e.window||t,s=n.navigator||{},i=!1;return O.each([s.doNotTrack,s.msDoNotTrack,n.doNotTrack],(function(e){O.includes([!0,1,"1","yes"],e)&&(i=!0)})),i}(n))return L.warn('This browser has "Do Not Track" enabled. This will prevent the Mixpanel SDK from sending any data. To ignore the "Do Not Track" browser setting, initialize the Mixpanel instance with the config "ignore_dnt: true"'),!0;var s="0"===ge(e,n);return s&&L.warn("You are opted out of Mixpanel tracking. This will prevent the Mixpanel SDK from sending any data."),s}function de(e){return ye(e,(function(e){return this.get_config(e)}))}function he(e){return ye(e,(function(e){return this._get_config(e)}))}function pe(e){return ye(e,(function(e){return this._get_config(e)}))}function fe(e,t){me(t=t||{}).remove(_e(e,t),!!t.crossSubdomainCookie,t.cookieDomain)}function me(e){return"localStorage"===(e=e||{}).persistenceType?O.localStorage:O.cookie}function _e(e,t){return((t=t||{}).persistencePrefix||oe)+e}function ge(e,t){return me(t).get(_e(e,t))}function ve(e,t,n){O.isString(t)&&t.length?(me(n=n||{}).set(_e(t,n),e?1:0,O.isNumber(n.cookieExpiration)?n.cookieExpiration:null,!!n.crossSubdomainCookie,!!n.secureCookie,!!n.crossSiteCookie,n.cookieDomain),n.track&&e&&n.track(n.trackEventName||"$opt_in",n.trackProperties,{send_immediately:!0})):L.error("gdpr."+(e?"optIn":"optOut")+" called with an invalid token")}function ye(e,t){return function(){var n=!1;try{var s=t.call(this,"token"),i=t.call(this,"ignore_dnt"),r=t.call(this,"opt_out_tracking_persistence_type"),o=t.call(this,"opt_out_tracking_cookie_prefix"),a=t.call(this,"window");s&&(n=le(s,{ignoreDnt:i,persistenceType:r,persistencePrefix:o,window:a}))}catch(e){L.error("Unexpected error when checking tracking opt-out status: "+e)}if(!n)return e.apply(this,arguments);var u=arguments[arguments.length-1];"function"==typeof u&&u(0)}}var be="$set",we="$set_once",ke="$unset",Se="$add",xe="$append",Ce="$union",Ee="$remove",Ne={set_action:function(e,t){var n={},s={};return O.isObject(e)?O.each(e,(function(e,t){this._is_reserved_property(t)||(s[t]=e)}),this):s[e]=t,n[be]=s,n},unset_action:function(e){var t={},n=[];return O.isArray(e)||(e=[e]),O.each(e,(function(e){this._is_reserved_property(e)||n.push(e)}),this),t[ke]=n,t},set_once_action:function(e,t){var n={},s={};return O.isObject(e)?O.each(e,(function(e,t){this._is_reserved_property(t)||(s[t]=e)}),this):s[e]=t,n[we]=s,n},union_action:function(e,t){var n={},s={};return O.isObject(e)?O.each(e,(function(e,t){this._is_reserved_property(t)||(s[t]=O.isArray(e)?e:[e])}),this):s[e]=O.isArray(t)?t:[t],n[Ce]=s,n},append_action:function(e,t){var n={},s={};return O.isObject(e)?O.each(e,(function(e,t){this._is_reserved_property(t)||(s[t]=e)}),this):s[e]=t,n[xe]=s,n},remove_action:function(e,t){var n={},s={};return O.isObject(e)?O.each(e,(function(e,t){this._is_reserved_property(t)||(s[t]=e)}),this):s[e]=t,n[Ee]=s,n},delete_action:function(){var e={$delete:""};return e}},Te=function(){};O.extend(Te.prototype,Ne),Te.prototype._init=function(e,t,n){this._mixpanel=e,this._group_key=t,this._group_id=n},Te.prototype.set=pe((function(e,t,n){var s=this.set_action(e,t);return O.isObject(e)&&(n=t),this._send_request(s,n)})),Te.prototype.set_once=pe((function(e,t,n){var s=this.set_once_action(e,t);return O.isObject(e)&&(n=t),this._send_request(s,n)})),Te.prototype.unset=pe((function(e,t){var n=this.unset_action(e);return this._send_request(n,t)})),Te.prototype.union=pe((function(e,t,n){O.isObject(e)&&(n=t);var s=this.union_action(e,t);return this._send_request(s,n)})),Te.prototype.delete=pe((function(e){var t=this.delete_action();return this._send_request(t,e)})),Te.prototype.remove=pe((function(e,t,n){var s=this.remove_action(e,t);return this._send_request(s,n)})),Te.prototype._send_request=function(e,t){e.$group_key=this._group_key,e.$group_id=this._group_id,e.$token=this._get_config("token");var n=O.encodeDates(e);return this._mixpanel._track_or_batch({type:"groups",data:n,endpoint:this._get_config("api_host")+"/groups/",batcher:this._mixpanel.request_batchers.groups},t)},Te.prototype._is_reserved_property=function(e){return"$group_key"===e||"$group_id"===e},Te.prototype._get_config=function(e){return this._mixpanel.get_config(e)},Te.prototype.toString=function(){return this._mixpanel.toString()+".group."+this._group_key+"."+this._group_id},Te.prototype.remove=Te.prototype.remove,Te.prototype.set=Te.prototype.set,Te.prototype.set_once=Te.prototype.set_once,Te.prototype.union=Te.prototype.union,Te.prototype.unset=Te.prototype.unset,Te.prototype.toString=Te.prototype.toString;var je=function(){};O.extend(je.prototype,Ne),je.prototype._init=function(e){this._mixpanel=e},je.prototype.set=he((function(e,t,n){var s=this.set_action(e,t);return O.isObject(e)&&(n=t),this._get_config("save_referrer")&&this._mixpanel.persistence.update_referrer_info(document.referrer),s[be]=O.extend({},O.info.people_properties(),this._mixpanel.persistence.get_referrer_info(),s[be]),this._send_request(s,n)})),je.prototype.set_once=he((function(e,t,n){var s=this.set_once_action(e,t);return O.isObject(e)&&(n=t),this._send_request(s,n)})),je.prototype.unset=he((function(e,t){var n=this.unset_action(e);return this._send_request(n,t)})),je.prototype.increment=he((function(e,t,n){var s={},i={};return O.isObject(e)?(O.each(e,(function(e,t){if(!this._is_reserved_property(t)){if(isNaN(parseFloat(e)))return void L.error("Invalid increment value passed to mixpanel.people.increment - must be a number");i[t]=e}}),this),n=t):(O.isUndefined(t)&&(t=1),i[e]=t),s[Se]=i,this._send_request(s,n)})),je.prototype.append=he((function(e,t,n){O.isObject(e)&&(n=t);var s=this.append_action(e,t);return this._send_request(s,n)})),je.prototype.remove=he((function(e,t,n){O.isObject(e)&&(n=t);var s=this.remove_action(e,t);return this._send_request(s,n)})),je.prototype.union=he((function(e,t,n){O.isObject(e)&&(n=t);var s=this.union_action(e,t);return this._send_request(s,n)})),je.prototype.track_charge=he((function(e,t,n){if(O.isNumber(e)||(e=parseFloat(e),!isNaN(e)))return this.append("$transactions",O.extend({$amount:e},t),n);L.error("Invalid value passed to mixpanel.people.track_charge - must be a number")})),je.prototype.clear_charges=function(e){return this.set("$transactions",[],e)},je.prototype.delete_user=function(){if(this._identify_called()){var e={$delete:this._mixpanel.get_distinct_id()};return this._send_request(e)}L.error("mixpanel.people.delete_user() requires you to call identify() first")},je.prototype.toString=function(){return this._mixpanel.toString()+".people"},je.prototype._send_request=function(e,t){e.$token=this._get_config("token"),e.$distinct_id=this._mixpanel.get_distinct_id();var n=this._mixpanel.get_property("$device_id"),s=this._mixpanel.get_property("$user_id"),i=this._mixpanel.get_property("$had_persisted_distinct_id");n&&(e.$device_id=n),s&&(e.$user_id=s),i&&(e.$had_persisted_distinct_id=i);var r=O.encodeDates(e);return this._identify_called()?this._mixpanel._track_or_batch({type:"people",data:r,endpoint:this._get_config("api_host")+"/engage/",batcher:this._mixpanel.request_batchers.people},t):(this._enqueue(e),O.isUndefined(t)||(this._get_config("verbose")?t({status:-1,error:null}):t(-1)),O.truncate(r,255))},je.prototype._get_config=function(e){return this._mixpanel.get_config(e)},je.prototype._identify_called=function(){return!0===this._mixpanel._flags.identify_called},je.prototype._enqueue=function(e){be in e?this._mixpanel.persistence._add_to_people_queue(be,e):we in e?this._mixpanel.persistence._add_to_people_queue(we,e):ke in e?this._mixpanel.persistence._add_to_people_queue(ke,e):Se in e?this._mixpanel.persistence._add_to_people_queue(Se,e):xe in e?this._mixpanel.persistence._add_to_people_queue(xe,e):Ee in e?this._mixpanel.persistence._add_to_people_queue(Ee,e):Ce in e?this._mixpanel.persistence._add_to_people_queue(Ce,e):L.error("Invalid call to _enqueue():",e)},je.prototype._flush_one_queue=function(e,t,n,s){var i=this,r=O.extend({},this._mixpanel.persistence._get_queue(e)),o=r;O.isUndefined(r)||!O.isObject(r)||O.isEmptyObject(r)||(i._mixpanel.persistence._pop_from_people_queue(e,r),s&&(o=s(r)),t.call(i,o,(function(t,s){0===t&&i._mixpanel.persistence._add_to_people_queue(e,r),O.isUndefined(n)||n(t,s)})))},je.prototype._flush=function(e,t,n,s,i,r,o){var a=this,u=this._mixpanel.persistence._get_queue(xe),c=this._mixpanel.persistence._get_queue(Ee);if(this._flush_one_queue(be,this.set,e),this._flush_one_queue(we,this.set_once,s),this._flush_one_queue(ke,this.unset,r,(function(e){return O.keys(e)})),this._flush_one_queue(Se,this.increment,t),this._flush_one_queue(Ce,this.union,i),!O.isUndefined(u)&&O.isArray(u)&&u.length){for(var l,d=function(e,t){0===e&&a._mixpanel.persistence._add_to_people_queue(xe,l),O.isUndefined(n)||n(e,t)},h=u.length-1;h>=0;h--)l=u.pop(),O.isEmptyObject(l)||a.append(l,d);a._mixpanel.persistence.save()}if(!O.isUndefined(c)&&O.isArray(c)&&c.length){for(var p,f=function(e,t){0===e&&a._mixpanel.persistence._add_to_people_queue(Ee,p),O.isUndefined(o)||o(e,t)},m=c.length-1;m>=0;m--)p=c.pop(),O.isEmptyObject(p)||a.remove(p,f);a._mixpanel.persistence.save()}},je.prototype._is_reserved_property=function(e){return"$distinct_id"===e||"$token"===e||"$device_id"===e||"$user_id"===e||"$had_persisted_distinct_id"===e},je.prototype.set=je.prototype.set,je.prototype.set_once=je.prototype.set_once,je.prototype.unset=je.prototype.unset,je.prototype.increment=je.prototype.increment,je.prototype.append=je.prototype.append,je.prototype.remove=je.prototype.remove,je.prototype.union=je.prototype.union,je.prototype.track_charge=je.prototype.track_charge,je.prototype.clear_charges=je.prototype.clear_charges,je.prototype.delete_user=je.prototype.delete_user,je.prototype.toString=je.prototype.toString;var Pe,Ie,Be="__mps",Oe="__mpso",Le="__mpus",qe="__mpa",De="__mpap",Ae="__mpr",Me="__mpu",Re="$people_distinct_id",ze="__alias",Fe="__timers",He=[Be,Oe,Le,qe,De,Ae,Me,Re,ze,Fe],Ue=function(e){this.props={},this.campaign_params_saved=!1,e.persistence_name?this.name="mp_"+e.persistence_name:this.name="mp_"+e.token+"_mixpanel";var t=e.persistence;"cookie"!==t&&"localStorage"!==t&&(L.critical("Unknown persistence type "+t+"; falling back to cookie"),t=e.persistence="cookie"),"localStorage"===t&&O.localStorage.is_supported()?this.storage=O.localStorage:this.storage=O.cookie,this.load(),this.update_config(e),this.upgrade(e),this.save()};Ue.prototype.properties=function(){var e={};return O.each(this.props,(function(t,n){O.include(He,n)||(e[n]=t)})),e},Ue.prototype.load=function(){if(!this.disabled){var e=this.storage.parse(this.name);e&&(this.props=O.extend({},e))}},Ue.prototype.upgrade=function(e){var t,n,s=e.upgrade;s&&(t="mp_super_properties","string"==typeof s&&(t=s),n=this.storage.parse(t),this.storage.remove(t),this.storage.remove(t,!0),n&&(this.props=O.extend(this.props,n.all,n.events))),e.cookie_name||"mixpanel"===e.name||(t="mp_"+e.token+"_"+e.name,(n=this.storage.parse(t))&&(this.storage.remove(t),this.storage.remove(t,!0),this.register_once(n))),this.storage===O.localStorage&&(n=O.cookie.parse(this.name),O.cookie.remove(this.name),O.cookie.remove(this.name,!0),n&&this.register_once(n))},Ue.prototype.save=function(){this.disabled||this.storage.set(this.name,O.JSONEncode(this.props),this.expire_days,this.cross_subdomain,this.secure,this.cross_site,this.cookie_domain)},Ue.prototype.remove=function(){this.storage.remove(this.name,!1,this.cookie_domain),this.storage.remove(this.name,!0,this.cookie_domain)},Ue.prototype.clear=function(){this.remove(),this.props={}},Ue.prototype.register_once=function(e,t,n){return!!O.isObject(e)&&(void 0===t&&(t="None"),this.expire_days=void 0===n?this.default_expiry:n,O.each(e,(function(e,n){this.props.hasOwnProperty(n)&&this.props[n]!==t||(this.props[n]=e)}),this),this.save(),!0)},Ue.prototype.register=function(e,t){return!!O.isObject(e)&&(this.expire_days=void 0===t?this.default_expiry:t,O.extend(this.props,e),this.save(),!0)},Ue.prototype.unregister=function(e){e in this.props&&(delete this.props[e],this.save())},Ue.prototype.update_search_keyword=function(e){this.register(O.info.searchInfo(e))},Ue.prototype.update_referrer_info=function(e){this.register_once({$initial_referrer:e||"$direct",$initial_referring_domain:O.info.referringDomain(e)||"$direct"},"")},Ue.prototype.get_referrer_info=function(){return O.strip_empty_properties({$initial_referrer:this.props.$initial_referrer,$initial_referring_domain:this.props.$initial_referring_domain})},Ue.prototype.safe_merge=function(e){return O.each(this.props,(function(t,n){n in e||(e[n]=t)})),e},Ue.prototype.update_config=function(e){this.default_expiry=this.expire_days=e.cookie_expiration,this.set_disabled(e.disable_persistence),this.set_cookie_domain(e.cookie_domain),this.set_cross_site(e.cross_site_cookie),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie)},Ue.prototype.set_disabled=function(e){this.disabled=e,this.disabled?this.remove():this.save()},Ue.prototype.set_cookie_domain=function(e){e!==this.cookie_domain&&(this.remove(),this.cookie_domain=e,this.save())},Ue.prototype.set_cross_site=function(e){e!==this.cross_site&&(this.cross_site=e,this.remove(),this.save())},Ue.prototype.set_cross_subdomain=function(e){e!==this.cross_subdomain&&(this.cross_subdomain=e,this.remove(),this.save())},Ue.prototype.get_cross_subdomain=function(){return this.cross_subdomain},Ue.prototype.set_secure=function(e){e!==this.secure&&(this.secure=!!e,this.remove(),this.save())},Ue.prototype._add_to_people_queue=function(e,t){var n=this._get_queue_key(e),s=t[e],i=this._get_or_create_queue(be),r=this._get_or_create_queue(we),o=this._get_or_create_queue(ke),a=this._get_or_create_queue(Se),u=this._get_or_create_queue(Ce),c=this._get_or_create_queue(Ee,[]),l=this._get_or_create_queue(xe,[]);n===Be?(O.extend(i,s),this._pop_from_people_queue(Se,s),this._pop_from_people_queue(Ce,s),this._pop_from_people_queue(ke,s)):n===Oe?(O.each(s,(function(e,t){t in r||(r[t]=e)})),this._pop_from_people_queue(ke,s)):n===Le?O.each(s,(function(e){O.each([i,r,a,u],(function(t){e in t&&delete t[e]})),O.each(l,(function(t){e in t&&delete t[e]})),o[e]=!0})):n===qe?(O.each(s,(function(e,t){t in i?i[t]+=e:(t in a||(a[t]=0),a[t]+=e)}),this),this._pop_from_people_queue(ke,s)):n===Me?(O.each(s,(function(e,t){O.isArray(e)&&(t in u||(u[t]=[]),u[t]=u[t].concat(e))})),this._pop_from_people_queue(ke,s)):n===Ae?(c.push(s),this._pop_from_people_queue(xe,s)):n===De&&(l.push(s),this._pop_from_people_queue(ke,s)),L.log("MIXPANEL PEOPLE REQUEST (QUEUED, PENDING IDENTIFY):"),L.log(t),this.save()},Ue.prototype._pop_from_people_queue=function(e,t){var n=this._get_queue(e);O.isUndefined(n)||(O.each(t,(function(t,s){e===xe||e===Ee?O.each(n,(function(e){e[s]===t&&delete e[s]})):delete n[s]}),this),this.save())},Ue.prototype._get_queue_key=function(e){return e===be?Be:e===we?Oe:e===ke?Le:e===Se?qe:e===xe?De:e===Ee?Ae:e===Ce?Me:void L.error("Invalid queue:",e)},Ue.prototype._get_queue=function(e){return this.props[this._get_queue_key(e)]},Ue.prototype._get_or_create_queue=function(e,t){var n=this._get_queue_key(e);return t=O.isUndefined(t)?{}:t,this.props[n]||(this.props[n]=t)},Ue.prototype.set_event_timer=function(e,t){var n=this.props[Fe]||{};n[e]=t,this.props[Fe]=n,this.save()},Ue.prototype.remove_event_timer=function(e){var t=(this.props[Fe]||{})[e];return O.isUndefined(t)||(delete this.props[Fe][e],this.save()),t};var We=function(e){return e},$e=function(){},Qe="mixpanel",Ve="base64",Ke="$device:",Ze=t.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest,Ge=!Ze&&-1===E.indexOf("MSIE")&&-1===E.indexOf("Mozilla"),Je=null;k.sendBeacon&&(Je=function(){return k.sendBeacon.apply(k,arguments)});var Xe={api_host:"https://api-js.mixpanel.com",api_method:"POST",api_transport:"XHR",api_payload_format:Ve,app_host:"https://mixpanel.com",cdn:"https://cdn.mxpnl.com",cross_site_cookie:!1,cross_subdomain_cookie:!0,error_reporter:$e,persistence:"cookie",persistence_name:"",cookie_domain:"",cookie_name:"",loaded:$e,track_marketing:!0,track_pageview:!1,skip_first_touch_marketing:!1,store_google:!0,save_referrer:!0,test:!1,verbose:!1,img:!1,debug:!1,track_links_timeout:300,cookie_expiration:365,upgrade:!1,disable_persistence:!1,disable_cookie:!1,secure_cookie:!1,ip:!0,opt_out_tracking_by_default:!1,opt_out_persistence_by_default:!1,opt_out_tracking_persistence_type:"localStorage",opt_out_tracking_cookie_prefix:null,property_blacklist:[],xhr_headers:{},ignore_dnt:!1,batch_requests:!0,batch_size:50,batch_flush_interval_ms:5e3,batch_request_timeout_ms:9e4,batch_autostart:!0,hooks:{}},Ye=!1,et=function(){},tt=function(e,t,s){var i,r=s===Qe?Ie:Ie[s];if(r&&0===Pe)i=r;else{if(r&&!O.isArray(r))return void L.error("You have already initialized "+s);i=new et}if(i._cached_groups={},i._init(e,t,s),i.people=new je,i.people._init(i),!i.get_config("skip_first_touch_marketing")){var o=O.info.campaignParams(null),a={},u=!1;O.each(o,(function(e,t){a["initial_"+t]=e,e&&(u=!0)})),u&&i.people.set_once(a)}return n.DEBUG=n.DEBUG||i.get_config("debug"),!O.isUndefined(r)&&O.isArray(r)&&(i._execute_array.call(i.people,r.people),i._execute_array(r)),i};et.prototype.init=function(e,t,n){if(O.isUndefined(n))this.report_error("You must name your new library: init(token, config, name)");else{if(n!==Qe){var s=tt(e,t,n);return Ie[n]=s,s._loaded(),s}this.report_error("You must initialize the main mixpanel object right after you include the Mixpanel js snippet")}},et.prototype._init=function(e,n,s){n=n||{},this.__loaded=!0,this.config={};var i={};"api_payload_format"in n||(n.api_host||Xe.api_host).match(/\.mixpanel\.com/)&&(i.api_payload_format="json");if(this.set_config(O.extend({},Xe,i,n,{name:s,token:e,callback_fn:(s===Qe?s:Qe+"."+s)+"._jsc"})),this._jsc=$e,this.__dom_loaded_queue=[],this.__request_queue=[],this.__disabled_events=[],this._flags={disable_all_events:!1,identify_called:!1},this.request_batchers={},this._batch_requests=this.get_config("batch_requests"),this._batch_requests)if(O.localStorage.is_supported(!0)&&Ze){if(this.init_batchers(),Je&&t.addEventListener){var r=O.bind((function(){this.request_batchers.events.stopped||this.request_batchers.events.flush({unloading:!0})}),this);t.addEventListener("pagehide",(function(e){e.persisted&&r()})),t.addEventListener("visibilitychange",(function(){"hidden"===S.visibilityState&&r()}))}}else this._batch_requests=!1,L.log("Turning off Mixpanel request-queueing; needs XHR and localStorage support");this.persistence=this.cookie=new Ue(this.config),this.unpersisted_superprops={},this._gdpr_init();var o=O.UUID();this.get_distinct_id()||this.register_once({distinct_id:Ke+o,$device_id:o},""),this.get_config("track_pageview")&&this.track_pageview()},et.prototype._loaded=function(){this.get_config("loaded")(this),this._set_default_superprops()},et.prototype._set_default_superprops=function(){this.persistence.update_search_keyword(S.referrer),this.get_config("store_google")&&this.register(O.info.campaignParams(),{persistent:!1}),this.get_config("save_referrer")&&this.persistence.update_referrer_info(S.referrer)},et.prototype._dom_loaded=function(){O.each(this.__dom_loaded_queue,(function(e){this._track_dom.apply(this,e)}),this),this.has_opted_out_tracking()||O.each(this.__request_queue,(function(e){this._send_request.apply(this,e)}),this),delete this.__dom_loaded_queue,delete this.__request_queue},et.prototype._track_dom=function(e,t){if(this.get_config("img"))return this.report_error("You can't use DOM tracking functions with img = true."),!1;if(!Ye)return this.__dom_loaded_queue.push([e,t]),!1;var n=(new e).init(this);return n.track.apply(n,t)},et.prototype._prepare_callback=function(e,t){if(O.isUndefined(e))return null;if(Ze){return function(n){e(n,t)}}var n=this._jsc,s=""+Math.floor(1e8*Math.random()),i=this.get_config("callback_fn")+"["+s+"]";return n[s]=function(i){delete n[s],e(i,t)},i},et.prototype._send_request=function(e,t,n,s){var i=!0;if(Ge)return this.__request_queue.push(arguments),i;var r={method:this.get_config("api_method"),transport:this.get_config("api_transport"),verbose:this.get_config("verbose")},o=null;s||!O.isFunction(n)&&"string"!=typeof n||(s=n,n=null),n=O.extend(r,n||{}),Ze||(n.method="GET");var a="POST"===n.method,u=Je&&a&&"sendbeacon"===n.transport.toLowerCase(),c=n.verbose;t.verbose&&(c=!0),this.get_config("test")&&(t.test=1),c&&(t.verbose=1),this.get_config("img")&&(t.img=1),Ze||(s?t.callback=s:(c||this.get_config("test"))&&(t.callback="(function(){})")),t.ip=this.get_config("ip")?1:0,t._=(new Date).getTime().toString(),a&&(o="data="+encodeURIComponent(t.data),delete t.data),e+="?"+O.HTTPBuildQuery(t);var l=this;if("img"in t){var d=S.createElement("img");d.src=e,S.body.appendChild(d)}else if(u){try{i=Je(e,o)}catch(e){l.report_error(e),i=!1}try{s&&s(i?1:0)}catch(e){l.report_error(e)}}else if(Ze)try{var h=new XMLHttpRequest;h.open(n.method,e,!0);var p=this.get_config("xhr_headers");if(a&&(p["Content-Type"]="application/x-www-form-urlencoded"),O.each(p,(function(e,t){h.setRequestHeader(t,e)})),n.timeout_ms&&void 0!==h.timeout){h.timeout=n.timeout_ms;var f=(new Date).getTime()}h.withCredentials=!0,h.onreadystatechange=function(){var e;if(4===h.readyState)if(200===h.status){if(s)if(c){var t;try{t=O.JSONDecode(h.responseText)}catch(e){if(l.report_error(e),!n.ignore_json_errors)return;t=h.responseText}s(t)}else s(Number(h.responseText))}else e=h.timeout&&!h.status&&(new Date).getTime()-f>=h.timeout?"timeout":"Bad HTTP status: "+h.status+" "+h.statusText,l.report_error(e),s&&s(c?{status:0,error:e,xhr_req:h}:0)},h.send(o)}catch(e){l.report_error(e),i=!1}else{var m=S.createElement("script");m.type="text/javascript",m.async=!0,m.defer=!0,m.src=e;var _=S.getElementsByTagName("script")[0];_.parentNode.insertBefore(m,_)}return i},et.prototype._execute_array=function(e){var t,n=[],s=[],i=[];O.each(e,(function(e){e&&(t=e[0],O.isArray(t)?i.push(e):"function"==typeof e?e.call(this):O.isArray(e)&&"alias"===t?n.push(e):O.isArray(e)&&-1!==t.indexOf("track")&&"function"==typeof this[t]?i.push(e):s.push(e))}),this);var r=function(e,t){O.each(e,(function(e){if(O.isArray(e[0])){var n=t;O.each(e,(function(e){n=n[e[0]].apply(n,e.slice(1))}))}else this[e[0]].apply(this,e.slice(1))}),t)};r(n,this),r(s,this),r(i,this)},et.prototype.are_batchers_initialized=function(){return!!this.request_batchers.events},et.prototype.init_batchers=function(){var e=this.get_config("token");if(!this.are_batchers_initialized()){var t=O.bind((function(t){return new re("__mpq_"+e+t.queue_suffix,{libConfig:this.config,sendRequestFunc:O.bind((function(e,n,s){this._send_request(this.get_config("api_host")+t.endpoint,this._encode_data_for_request(e),n,this._prepare_callback(s,e))}),this),beforeSendHook:O.bind((function(e){return this._run_hook("before_send_"+t.type,e)}),this),errorReporter:this.get_config("error_reporter"),stopAllBatchingFunc:O.bind(this.stop_batch_senders,this)})}),this);this.request_batchers={events:t({type:"events",endpoint:"/track/",queue_suffix:"_ev"}),people:t({type:"people",endpoint:"/engage/",queue_suffix:"_pp"}),groups:t({type:"groups",endpoint:"/groups/",queue_suffix:"_gr"})}}this.get_config("batch_autostart")&&this.start_batch_senders()},et.prototype.start_batch_senders=function(){this.are_batchers_initialized()&&(this._batch_requests=!0,O.each(this.request_batchers,(function(e){e.start()})))},et.prototype.stop_batch_senders=function(){this._batch_requests=!1,O.each(this.request_batchers,(function(e){e.stop(),e.clear()}))},et.prototype.push=function(e){this._execute_array([e])},et.prototype.disable=function(e){void 0===e?this._flags.disable_all_events=!0:this.__disabled_events=this.__disabled_events.concat(e)},et.prototype._encode_data_for_request=function(e){var t=O.JSONEncode(e);return this.get_config("api_payload_format")===Ve&&(t=O.base64Encode(t)),{data:t}},et.prototype._track_or_batch=function(e,t){var n=O.truncate(e.data,255),s=e.endpoint,i=e.batcher,r=e.should_send_immediately,o=e.send_request_options||{};t=t||$e;var a=!0,u=O.bind((function(){return o.skip_hooks||(n=this._run_hook("before_send_"+e.type,n)),n?(L.log("MIXPANEL REQUEST:"),L.log(n),this._send_request(s,this._encode_data_for_request(n),o,this._prepare_callback(t,n))):null}),this);return this._batch_requests&&!r?i.enqueue(n,(function(e){e?t(1,n):u()})):a=u(),a&&n},et.prototype.track=de((function(e,t,n,s){s||"function"!=typeof n||(s=n,n=null);var i=(n=n||{}).transport;i&&(n.transport=i);var r=n.send_immediately;if("function"!=typeof s&&(s=$e),O.isUndefined(e))this.report_error("No event name provided to mixpanel.track");else{if(!this._event_is_disabled(e)){(t=t||{}).token=this.get_config("token");var o=this.persistence.remove_event_timer(e);if(!O.isUndefined(o)){var a=(new Date).getTime()-o;t.$duration=parseFloat((a/1e3).toFixed(3))}this._set_default_superprops();var u=this.get_config("track_marketing")?O.info.marketingParams():{};t=O.extend({},O.info.properties(),u,this.persistence.properties(),this.unpersisted_superprops,t);var c=this.get_config("property_blacklist");O.isArray(c)?O.each(c,(function(e){delete t[e]})):this.report_error("Invalid value for property_blacklist config: "+c);var l={event:e,properties:t};return this._track_or_batch({type:"events",data:l,endpoint:this.get_config("api_host")+"/track/",batcher:this.request_batchers.events,should_send_immediately:r,send_request_options:n},s)}s(0)}})),et.prototype.set_group=de((function(e,t,n){O.isArray(t)||(t=[t]);var s={};return s[e]=t,this.register(s),this.people.set(e,t,n)})),et.prototype.add_group=de((function(e,t,n){var s=this.get_property(e);if(void 0===s){var i={};i[e]=[t],this.register(i)}else-1===s.indexOf(t)&&(s.push(t),this.register(i));return this.people.union(e,t,n)})),et.prototype.remove_group=de((function(e,t,n){var s=this.get_property(e);if(void 0!==s){var i=s.indexOf(t);i>-1&&(s.splice(i,1),this.register({group_key:s})),0===s.length&&this.unregister(e)}return this.people.remove(e,t,n)})),et.prototype.track_with_groups=de((function(e,t,n,s){var i=O.extend({},t||{});return O.each(n,(function(e,t){null!=e&&(i[t]=e)})),this.track(e,i,s)})),et.prototype._create_map_key=function(e,t){return e+"_"+JSON.stringify(t)},et.prototype._remove_group_from_cache=function(e,t){delete this._cached_groups[this._create_map_key(e,t)]},et.prototype.get_group=function(e,t){var n=this._create_map_key(e,t),s=this._cached_groups[n];return void 0!==s&&s._group_key===e&&s._group_id===t||((s=new Te)._init(this,e,t),this._cached_groups[n]=s),s},et.prototype.track_pageview=de((function(e,t){"object"!=typeof e&&(e={});var n=(t=t||{}).event_name||"$mp_web_page_view",s=O.extend(O.info.mpPageViewProperties(),O.info.campaignParams(),O.info.clickParams()),i=O.extend({},s,e);return this.track(n,i)})),et.prototype.track_links=function(){return this._track_dom.call(this,G,arguments)},et.prototype.track_forms=function(){return this._track_dom.call(this,J,arguments)},et.prototype.time_event=function(e){O.isUndefined(e)?this.report_error("No event name provided to mixpanel.time_event"):this._event_is_disabled(e)||this.persistence.set_event_timer(e,(new Date).getTime())};var nt={persistent:!0},st=function(e){var t;return t=O.isObject(e)?e:O.isUndefined(e)?{}:{days:e},O.extend({},nt,t)};et.prototype.register=function(e,t){var n=st(t);n.persistent?this.persistence.register(e,n.days):O.extend(this.unpersisted_superprops,e)},et.prototype.register_once=function(e,t,n){var s=st(n);s.persistent?this.persistence.register_once(e,t,s.days):(void 0===t&&(t="None"),O.each(e,(function(e,n){this.unpersisted_superprops.hasOwnProperty(n)&&this.unpersisted_superprops[n]!==t||(this.unpersisted_superprops[n]=e)}),this))},et.prototype.unregister=function(e,t){(t=st(t)).persistent?this.persistence.unregister(e):delete this.unpersisted_superprops[e]},et.prototype._register_single=function(e,t){var n={};n[e]=t,this.register(n)},et.prototype.identify=function(e,t,n,s,i,r,o,a){var u=this.get_distinct_id();if(e&&u!==e){if("string"==typeof e&&0===e.indexOf(Ke))return this.report_error("distinct_id cannot have $device: prefix"),-1;this.register({$user_id:e})}if(!this.get_property("$device_id")){var c=u;this.register_once({$had_persisted_distinct_id:!0,$device_id:c},"")}e!==u&&e!==this.get_property(ze)&&(this.unregister(ze),this.register({distinct_id:e})),this._flags.identify_called=!0,this.people._flush(t,n,s,i,r,o,a),e!==u&&this.track("$identify",{distinct_id:e,$anon_distinct_id:u},{skip_hooks:!0})},et.prototype.reset=function(){this.persistence.clear(),this._flags.identify_called=!1;var e=O.UUID();this.register_once({distinct_id:Ke+e,$device_id:e},"")},et.prototype.get_distinct_id=function(){return this.get_property("distinct_id")},et.prototype.alias=function(e,t){if(e===this.get_property(Re))return this.report_error("Attempting to create alias for existing People user - aborting."),-2;var n=this;return O.isUndefined(t)&&(t=this.get_distinct_id()),e!==t?(this._register_single(ze,e),this.track("$create_alias",{alias:e,distinct_id:t},{skip_hooks:!0},(function(){n.identify(e)}))):(this.report_error("alias matches current distinct_id - skipping api call."),this.identify(e),-1)},et.prototype.name_tag=function(e){this._register_single("mp_name_tag",e)},et.prototype.set_config=function(e){O.isObject(e)&&(O.extend(this.config,e),e.batch_size&&O.each(this.request_batchers,(function(e){e.resetBatchSize()})),this.get_config("persistence_name")||(this.config.persistence_name=this.config.cookie_name),this.get_config("disable_persistence")||(this.config.disable_persistence=this.config.disable_cookie),this.persistence&&this.persistence.update_config(this.config),n.DEBUG=n.DEBUG||this.get_config("debug"))},et.prototype.get_config=function(e){return this.config[e]},et.prototype._run_hook=function(e){var t=(this.config.hooks[e]||We).apply(this,v.call(arguments,1));return void 0===t&&(this.report_error(e+" hook did not return a value"),t=null),t},et.prototype.get_property=function(e){return this.persistence.props[e]},et.prototype.toString=function(){var e=this.get_config("name");return e!==Qe&&(e=Qe+"."+e),e},et.prototype._event_is_disabled=function(e){return O.isBlockedUA(E)||this._flags.disable_all_events||O.include(this.__disabled_events,e)},et.prototype._gdpr_init=function(){"localStorage"===this.get_config("opt_out_tracking_persistence_type")&&O.localStorage.is_supported()&&(!this.has_opted_in_tracking()&&this.has_opted_in_tracking({persistence_type:"cookie"})&&this.opt_in_tracking({enable_persistence:!1}),!this.has_opted_out_tracking()&&this.has_opted_out_tracking({persistence_type:"cookie"})&&this.opt_out_tracking({clear_persistence:!1}),this.clear_opt_in_out_tracking({persistence_type:"cookie",enable_persistence:!1})),this.has_opted_out_tracking()?this._gdpr_update_persistence({clear_persistence:!0}):this.has_opted_in_tracking()||!this.get_config("opt_out_tracking_by_default")&&!O.cookie.get("mp_optout")||(O.cookie.remove("mp_optout"),this.opt_out_tracking({clear_persistence:this.get_config("opt_out_persistence_by_default")}))},et.prototype._gdpr_update_persistence=function(e){var t;if(e&&e.clear_persistence)t=!0;else{if(!e||!e.enable_persistence)return;t=!1}this.get_config("disable_persistence")||this.persistence.disabled===t||this.persistence.set_disabled(t),t&&O.each(this.request_batchers,(function(e){e.clear()}))},et.prototype._gdpr_call_func=function(e,t){return t=O.extend({track:O.bind(this.track,this),persistence_type:this.get_config("opt_out_tracking_persistence_type"),cookie_prefix:this.get_config("opt_out_tracking_cookie_prefix"),cookie_expiration:this.get_config("cookie_expiration"),cross_site_cookie:this.get_config("cross_site_cookie"),cross_subdomain_cookie:this.get_config("cross_subdomain_cookie"),cookie_domain:this.get_config("cookie_domain"),secure_cookie:this.get_config("secure_cookie"),ignore_dnt:this.get_config("ignore_dnt")},t),O.localStorage.is_supported()||(t.persistence_type="cookie"),e(this.get_config("token"),{track:t.track,trackEventName:t.track_event_name,trackProperties:t.track_properties,persistenceType:t.persistence_type,persistencePrefix:t.cookie_prefix,cookieDomain:t.cookie_domain,cookieExpiration:t.cookie_expiration,crossSiteCookie:t.cross_site_cookie,crossSubdomainCookie:t.cross_subdomain_cookie,secureCookie:t.secure_cookie,ignoreDnt:t.ignore_dnt})},et.prototype.opt_in_tracking=function(e){e=O.extend({enable_persistence:!0},e),this._gdpr_call_func(ae,e),this._gdpr_update_persistence(e)},et.prototype.opt_out_tracking=function(e){(e=O.extend({clear_persistence:!0,delete_user:!0},e)).delete_user&&this.people&&this.people._identify_called()&&(this.people.delete_user(),this.people.clear_charges()),this._gdpr_call_func(ue,e),this._gdpr_update_persistence(e)},et.prototype.has_opted_in_tracking=function(e){return this._gdpr_call_func(ce,e)},et.prototype.has_opted_out_tracking=function(e){return this._gdpr_call_func(le,e)},et.prototype.clear_opt_in_out_tracking=function(e){e=O.extend({enable_persistence:!0},e),this._gdpr_call_func(fe,e),this._gdpr_update_persistence(e)},et.prototype.report_error=function(e,t){L.error.apply(L.error,arguments);try{t||e instanceof Error||(e=new Error(e)),this.get_config("error_reporter")(e,t)}catch(t){L.error(t)}},et.prototype.init=et.prototype.init,et.prototype.reset=et.prototype.reset,et.prototype.disable=et.prototype.disable,et.prototype.time_event=et.prototype.time_event,et.prototype.track=et.prototype.track,et.prototype.track_links=et.prototype.track_links,et.prototype.track_forms=et.prototype.track_forms,et.prototype.track_pageview=et.prototype.track_pageview,et.prototype.register=et.prototype.register,et.prototype.register_once=et.prototype.register_once,et.prototype.unregister=et.prototype.unregister,et.prototype.identify=et.prototype.identify,et.prototype.alias=et.prototype.alias,et.prototype.name_tag=et.prototype.name_tag,et.prototype.set_config=et.prototype.set_config,et.prototype.get_config=et.prototype.get_config,et.prototype.get_property=et.prototype.get_property,et.prototype.get_distinct_id=et.prototype.get_distinct_id,et.prototype.toString=et.prototype.toString,et.prototype.opt_out_tracking=et.prototype.opt_out_tracking,et.prototype.opt_in_tracking=et.prototype.opt_in_tracking,et.prototype.has_opted_out_tracking=et.prototype.has_opted_out_tracking,et.prototype.has_opted_in_tracking=et.prototype.has_opted_in_tracking,et.prototype.clear_opt_in_out_tracking=et.prototype.clear_opt_in_out_tracking,et.prototype.get_group=et.prototype.get_group,et.prototype.set_group=et.prototype.set_group,et.prototype.add_group=et.prototype.add_group,et.prototype.remove_group=et.prototype.remove_group,et.prototype.track_with_groups=et.prototype.track_with_groups,et.prototype.start_batch_senders=et.prototype.start_batch_senders,et.prototype.stop_batch_senders=et.prototype.stop_batch_senders,Ue.prototype.properties=Ue.prototype.properties,Ue.prototype.update_search_keyword=Ue.prototype.update_search_keyword,Ue.prototype.update_referrer_info=Ue.prototype.update_referrer_info,Ue.prototype.get_cross_subdomain=Ue.prototype.get_cross_subdomain,Ue.prototype.clear=Ue.prototype.clear;var it={},rt=function(){Ie.init=function(e,n,s){if(s)return Ie[s]||(Ie[s]=it[s]=tt(e,n,s),Ie[s]._loaded()),Ie[s];var i=Ie;it[Qe]?i=it[Qe]:e&&((i=tt(e,n,Qe))._loaded(),it[Qe]=i),Ie=i,1===Pe&&(t[Qe]=Ie),O.each(it,(function(e,t){t!==Qe&&(Ie[t]=e)})),Ie._=O}};var ot=(Pe=0,Ie=new et,rt(),Ie.init(),function(){function e(){e.done||(e.done=!0,Ye=!0,Ge=!1,O.each(it,(function(e){e._dom_loaded()})))}if(S.addEventListener)"complete"===S.readyState?e():S.addEventListener("DOMContentLoaded",e,!1);else if(S.attachEvent){S.attachEvent("onreadystatechange",e);var n=!1;try{n=null===t.frameElement}catch(e){}S.documentElement.doScroll&&n&&function t(){try{S.documentElement.doScroll("left")}catch(e){return void setTimeout(t,1)}e()}()}O.register_event(t,"load",e,!0)}(),Ie);e.exports=ot},5311:function(e){"use strict";e.exports=jQuery}},t={};function n(s){var i=t[s];if(void 0!==i)return i.exports;var r=t[s]={id:s,loaded:!1,exports:{}};return e[s](r,r.exports,n),r.loaded=!0,r.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var s in t)n.o(t,s)&&!n.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e},function(){"use strict";var e=e||{};window.WP_Smush=e,String.prototype.includes||(String.prototype.includes=function(e,t){return"number"!=typeof t&&(t=0),!(t+e.length>this.length)&&-1!==this.indexOf(e,t)}),n(3065),n(6111),n(9478),n(7413),n(6453),n(9867),n(6033),n(5445),n(4471),n(3579),n(2140),n(1110),n(1442),n(5972),n(7447),n(4933),n(4334),n(206)}()}();
//# sourceMappingURL=smush-admin.min.js.map