(()=>{"use strict";var e={428:e=>{e.exports=window.jQuery}},t={};function o(n){var i=t[n];if(void 0!==i)return i.exports;var r=t[n]={exports:{}};return e[n](r,r.exports,o),r.exports}o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}();var n=o(428),i=Object.defineProperty,r=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable,a=(e,t,o)=>t in e?i(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,d=(e,t)=>{for(var o in t||(t={}))s.call(t,o)&&a(e,o,t[o]);if(r)for(var o of r(t))l.call(t,o)&&a(e,o,t[o]);return e};
/**
 * Copyright since 2007 PrestaShop SA and Contributors
 * PrestaShop is an International Registered Trademark & Property of PrestaShop SA
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Open Software License (OSL 3.0)
 * that is bundled with this package in the file LICENSE.md.
 * It is also available through the world-wide-web at this URL:
 * https://opensource.org/licenses/OSL-3.0
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@prestashop.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade PrestaShop to newer
 * versions in the future. If you wish to customize PrestaShop for your
 * needs please refer to https://devdocs.prestashop.com/ for more information.
 *
 * @author    PrestaShop SA and Contributors <contact@prestashop.com>
 * @copyright Since 2007 PrestaShop SA and Contributors
 * @license   https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
 */
class c{constructor(e){const t=d({id:"confirm-modal",closable:!1},e);this.buildModalContainer(t)}buildModalContainer(e){this.container=document.createElement("div"),this.container.classList.add("modal","fade"),this.container.id=e.id,this.dialog=document.createElement("div"),this.dialog.classList.add("modal-dialog"),e.dialogStyle&&Object.keys(e.dialogStyle).forEach((t=>{this.dialog.style[t]=e.dialogStyle[t]})),this.content=document.createElement("div"),this.content.classList.add("modal-content"),this.message=document.createElement("p"),this.message.classList.add("modal-message"),this.header=document.createElement("div"),this.header.classList.add("modal-header"),e.modalTitle&&(this.title=document.createElement("h4"),this.title.classList.add("modal-title"),this.title.innerHTML=e.modalTitle),this.closeIcon=document.createElement("button"),this.closeIcon.classList.add("close"),this.closeIcon.setAttribute("type","button"),this.closeIcon.dataset.dismiss="modal",this.closeIcon.innerHTML="×",this.body=document.createElement("div"),this.body.classList.add("modal-body","text-left","font-weight-normal"),this.title&&this.header.appendChild(this.title),this.header.appendChild(this.closeIcon),this.content.append(this.header,this.body),this.body.appendChild(this.message),this.dialog.appendChild(this.content),this.container.appendChild(this.dialog)}}class u{constructor(e){const t=d({id:"confirm-modal",closable:!1,dialogStyle:{}},e);this.initContainer(t)}initContainer(e){this.modal||(this.modal=new c(e)),this.$modal=n(this.modal.container);const{id:t,closable:o}=e;this.$modal.modal({backdrop:!!o||"static",keyboard:void 0===o||o}),this.$modal.modal("hide"),this.$modal.on("hidden.bs.modal",(()=>{const o=document.querySelector(`#${t}`);o&&o.remove(),e.closeCallback&&e.closeCallback()})),document.body.appendChild(this.modal.container)}setTitle(e){return this.modal.title||(this.modal.title=document.createElement("h4"),this.modal.title.classList.add("modal-title"),this.modal.closeIcon?this.modal.header.insertBefore(this.modal.title,this.modal.closeIcon):this.modal.header.appendChild(this.modal.title)),this.modal.title.innerHTML=e,this}render(e){return this.modal.message.innerHTML=e,this}show(){return this.$modal.modal("show"),this}hide(){return this.$modal.modal("hide"),this.$modal.on("shown.bs.modal",(()=>{this.$modal.modal("hide"),this.$modal.off("shown.bs.modal")})),this}}
/**
 * Copyright since 2007 PrestaShop SA and Contributors
 * PrestaShop is an International Registered Trademark & Property of PrestaShop SA
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Open Software License (OSL 3.0)
 * that is bundled with this package in the file LICENSE.md.
 * It is also available through the world-wide-web at this URL:
 * https://opensource.org/licenses/OSL-3.0
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@prestashop.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade PrestaShop to newer
 * versions in the future. If you wish to customize PrestaShop for your
 * needs please refer to https://devdocs.prestashop.com/ for more information.
 *
 * @author    PrestaShop SA and Contributors <contact@prestashop.com>
 * @copyright Since 2007 PrestaShop SA and Contributors
 * @license   https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
 */
function m(e){return void 0===e}var h=Object.defineProperty,p=Object.getOwnPropertySymbols,f=Object.prototype.hasOwnProperty,b=Object.prototype.propertyIsEnumerable,g=(e,t,o)=>t in e?h(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o;
/**
 * Copyright since 2007 PrestaShop SA and Contributors
 * PrestaShop is an International Registered Trademark & Property of PrestaShop SA
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Open Software License (OSL 3.0)
 * that is bundled with this package in the file LICENSE.md.
 * It is also available through the world-wide-web at this URL:
 * https://opensource.org/licenses/OSL-3.0
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@prestashop.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade PrestaShop to newer
 * versions in the future. If you wish to customize PrestaShop for your
 * needs please refer to https://devdocs.prestashop.com/ for more information.
 *
 * @author    PrestaShop SA and Contributors <contact@prestashop.com>
 * @copyright Since 2007 PrestaShop SA and Contributors
 * @license   https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
 */
class v extends c{constructor(e){super(e)}buildModalContainer(e){super.buildModalContainer(e),this.message.classList.add("confirm-message"),this.message.innerHTML=e.confirmMessage,this.footer=document.createElement("div"),this.footer.classList.add("modal-footer"),this.closeButton=document.createElement("button"),this.closeButton.setAttribute("type","button"),this.closeButton.classList.add("btn","btn-outline-secondary","btn-lg"),this.closeButton.dataset.dismiss="modal",this.closeButton.innerHTML=e.closeButtonLabel,this.confirmButton=document.createElement("button"),this.confirmButton.setAttribute("type","button"),this.confirmButton.classList.add("btn",e.confirmButtonClass,"btn-lg","btn-confirm-submit"),this.confirmButton.dataset.dismiss="modal",this.confirmButton.innerHTML=e.confirmButtonLabel,this.footer.append(this.closeButton,...e.customButtons,this.confirmButton),this.content.append(this.footer)}}class S extends u{constructor(e,t,o){var n;let i;i=m(e.confirmCallback)?m(t)?()=>{console.error("No confirm callback provided for ConfirmModal component.")}:t:e.confirmCallback;super(((e,t)=>{for(var o in t||(t={}))f.call(t,o)&&g(e,o,t[o]);if(p)for(var o of p(t))b.call(t,o)&&g(e,o,t[o]);return e})({id:"confirm-modal",confirmMessage:"Are you sure?",closeButtonLabel:"Close",confirmButtonLabel:"Accept",confirmButtonClass:"btn-primary",customButtons:[],closable:!1,modalTitle:e.confirmTitle,dialogStyle:{},confirmCallback:i,closeCallback:null!=(n=e.closeCallback)?n:o},e))}initContainer(e){this.modal=new v(e),this.modal.confirmButton.addEventListener("click",e.confirmCallback),super.initContainer(e)}}var y=function(){if("undefined"!=typeof Map)return Map;function e(e,t){var o=-1;return e.some((function(e,n){return e[0]===t&&(o=n,!0)})),o}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(t){var o=e(this.__entries__,t),n=this.__entries__[o];return n&&n[1]},t.prototype.set=function(t,o){var n=e(this.__entries__,t);~n?this.__entries__[n][1]=o:this.__entries__.push([t,o])},t.prototype.delete=function(t){var o=this.__entries__,n=e(o,t);~n&&o.splice(n,1)},t.prototype.has=function(t){return!!~e(this.__entries__,t)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(e,t){void 0===t&&(t=null);for(var o=0,n=this.__entries__;o<n.length;o++){var i=n[o];e.call(t,i[1],i[0])}},t}()}(),w="undefined"!=typeof window&&"undefined"!=typeof document&&window.document===document,_=void 0!==o.g&&o.g.Math===Math?o.g:"undefined"!=typeof self&&self.Math===Math?self:"undefined"!=typeof window&&window.Math===Math?window:Function("return this")(),M="function"==typeof requestAnimationFrame?requestAnimationFrame.bind(_):function(e){return setTimeout((function(){return e(Date.now())}),1e3/60)};var C=["top","right","bottom","left","width","height","size","weight"],k="undefined"!=typeof MutationObserver,L=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=function(e,t){var o=!1,n=!1,i=0;function r(){o&&(o=!1,e()),n&&l()}function s(){M(r)}function l(){var e=Date.now();if(o){if(e-i<2)return;n=!0}else o=!0,n=!1,setTimeout(s,t);i=e}return l}(this.refresh.bind(this),20)}return e.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_()},e.prototype.removeObserver=function(e){var t=this.observers_,o=t.indexOf(e);~o&&t.splice(o,1),!t.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},e.prototype.updateObservers_=function(){var e=this.observers_.filter((function(e){return e.gatherActive(),e.hasActive()}));return e.forEach((function(e){return e.broadcastActive()})),e.length>0},e.prototype.connect_=function(){w&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),k?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){w&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(e){var t=e.propertyName,o=void 0===t?"":t;C.some((function(e){return!!~o.indexOf(e)}))&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),E=function(e,t){for(var o=0,n=Object.keys(t);o<n.length;o++){var i=n[o];Object.defineProperty(e,i,{value:t[i],enumerable:!1,writable:!1,configurable:!0})}return e},A=function(e){return e&&e.ownerDocument&&e.ownerDocument.defaultView||_},I=x(0,0,0,0);function T(e){return parseFloat(e)||0}function O(e){for(var t=[],o=1;o<arguments.length;o++)t[o-1]=arguments[o];return t.reduce((function(t,o){return t+T(e["border-"+o+"-width"])}),0)}function B(e){var t=e.clientWidth,o=e.clientHeight;if(!t&&!o)return I;var n=A(e).getComputedStyle(e),i=function(e){for(var t={},o=0,n=["top","right","bottom","left"];o<n.length;o++){var i=n[o],r=e["padding-"+i];t[i]=T(r)}return t}(n),r=i.left+i.right,s=i.top+i.bottom,l=T(n.width),a=T(n.height);if("border-box"===n.boxSizing&&(Math.round(l+r)!==t&&(l-=O(n,"left","right")+r),Math.round(a+s)!==o&&(a-=O(n,"top","bottom")+s)),!function(e){return e===A(e).document.documentElement}(e)){var d=Math.round(l+r)-t,c=Math.round(a+s)-o;1!==Math.abs(d)&&(l-=d),1!==Math.abs(c)&&(a-=c)}return x(i.left,i.top,l,a)}var D="undefined"!=typeof SVGGraphicsElement?function(e){return e instanceof A(e).SVGGraphicsElement}:function(e){return e instanceof A(e).SVGElement&&"function"==typeof e.getBBox};function R(e){return w?D(e)?function(e){var t=e.getBBox();return x(0,0,t.width,t.height)}(e):B(e):I}function x(e,t,o,n){return{x:e,y:t,width:o,height:n}}var U=function(){function e(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=x(0,0,0,0),this.target=e}return e.prototype.isActive=function(){var e=R(this.target);return this.contentRect_=e,e.width!==this.broadcastWidth||e.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var e=this.contentRect_;return this.broadcastWidth=e.width,this.broadcastHeight=e.height,e},e}(),F=function(e,t){var o,n,i,r,s,l,a,d=(n=(o=t).x,i=o.y,r=o.width,s=o.height,l="undefined"!=typeof DOMRectReadOnly?DOMRectReadOnly:Object,a=Object.create(l.prototype),E(a,{x:n,y:i,width:r,height:s,top:i,right:n+r,bottom:s+i,left:n}),a);E(this,{target:e,contentRect:d})},P=function(){function e(e,t,o){if(this.activeObservations_=[],this.observations_=new y,"function"!=typeof e)throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=e,this.controller_=t,this.callbackCtx_=o}return e.prototype.observe=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(e instanceof A(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)||(t.set(e,new U(e)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(e instanceof A(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)&&(t.delete(e),t.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach((function(t){t.isActive()&&e.activeObservations_.push(t)}))},e.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,t=this.activeObservations_.map((function(e){return new F(e.target,e.broadcastRect())}));this.callback_.call(e,t,e),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),j="undefined"!=typeof WeakMap?new WeakMap:new y,$=function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var o=L.getInstance(),n=new P(t,o,this);j.set(this,n)};["observe","unobserve","disconnect"].forEach((function(e){$.prototype[e]=function(){var t;return(t=j.get(this))[e].apply(t,arguments)}}));void 0!==_.ResizeObserver&&_.ResizeObserver;const N=class extends Event{constructor(e,t={}){super(N.parentWindowEvent),this.eventName=e,this.eventParameters=t}get name(){return this.eventName}get parameters(){return this.eventParameters}};let q=N;q.parentWindowEvent="IframeClientEvent";Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;
/**
 * Copyright since 2007 PrestaShop SA and Contributors
 * PrestaShop is an International Registered Trademark & Property of PrestaShop SA
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Open Software License (OSL 3.0)
 * that is bundled with this package in the file LICENSE.md.
 * It is also available through the world-wide-web at this URL:
 * https://opensource.org/licenses/OSL-3.0
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@prestashop.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade PrestaShop to newer
 * versions in the future. If you wish to customize PrestaShop for your
 * needs please refer to https://devdocs.prestashop.com/ for more information.
 *
 * @author    PrestaShop SA and Contributors <contact@prestashop.com>
 * @copyright Since 2007 PrestaShop SA and Contributors
 * @license   https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
 */const G=S,z={moduleItemList:e=>`div.module-item-list[data-tech-name='${e}']`,moduleItem:e=>`.module-item[data-tech-name='${e}']`},Y=e=>`#${e}`;var H=o(428);
/**
 * Copyright since 2007 PrestaShop SA and Contributors
 * PrestaShop is an International Registered Trademark & Property of PrestaShop SA
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Open Software License (OSL 3.0)
 * that is bundled with this package in the file LICENSE.md.
 * It is also available through the world-wide-web at this URL:
 * https://opensource.org/licenses/OSL-3.0
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@prestashop.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade PrestaShop to newer
 * versions in the future. If you wish to customize PrestaShop for your
 * needs please refer to https://devdocs.prestashop.com/ for more information.
 *
 * @author    PrestaShop SA and Contributors <contact@prestashop.com>
 * @copyright Since 2007 PrestaShop SA and Contributors
 * @license   https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
 */const V=z,{$:Z}=window;class W{constructor(){this.pendingRequest=!1,this.moduleActionMenuLinkSelector="button.module_action_menu_",this.moduleActionMenuInstallLinkSelector="button.module_action_menu_install",this.moduleActionMenuEnableLinkSelector="button.module_action_menu_enable",this.moduleActionMenuUninstallLinkSelector="button.module_action_menu_uninstall",this.moduleActionMenuDisableLinkSelector="button.module_action_menu_disable",this.moduleActionMenuResetLinkSelector="button.module_action_menu_reset",this.moduleActionMenuUpdateLinkSelector="button.module_action_menu_upgrade",this.moduleActionMenuDeleteLinkSelector="button.module_action_menu_delete",this.moduleItemListSelector=".module-item-list",this.moduleItemActionsSelector=".module-actions",this.moduleActionModalDisableLinkSelector="a.module_action_modal_disable",this.moduleActionModalResetLinkSelector="a.module_action_modal_reset",this.moduleActionModalUninstallLinkSelector="a.module_action_modal_uninstall",this.forceDeletionOption="#force_deletion",this.eventEmitter=window.prestashop.component.EventEmitter,this.initActionButtons()}initActionButtons(){const e=this;Z(document).on("click",this.forceDeletionOption,(function(){const t=Z(e.moduleActionModalUninstallLinkSelector,Z(V.moduleItemList(Z(this).attr("data-tech-name"))));!0===Z(this).prop("checked")?t.attr("data-deletion","true"):t.removeAttr("data-deletion")})),Z(document).on("click",this.moduleActionMenuInstallLinkSelector,(function(){return e.dispatchPreEvent("install",this)&&e.confirmAction("install",this)&&e.requestToController("install",Z(this))})),Z(document).on("click",this.moduleActionMenuEnableLinkSelector,(function(){return e.dispatchPreEvent("enable",this)&&e.confirmAction("enable",this)&&e.requestToController("enable",Z(this))})),Z(document).on("click",this.moduleActionMenuUninstallLinkSelector,(function(){return e.dispatchPreEvent("uninstall",this)&&e.confirmAction("uninstall",this)&&e.requestToController("uninstall",Z(this))})),Z(document).on("click",this.moduleActionMenuDeleteLinkSelector,(function(){return e.dispatchPreEvent("delete",this)&&e.confirmAction("delete",this)&&e.requestToController("delete",Z(this))})),Z(document).on("click",this.moduleActionMenuDisableLinkSelector,(function(){return e.dispatchPreEvent("disable",this)&&e.confirmAction("disable",this)&&e.requestToController("disable",Z(this))})),Z(document).on("click",this.moduleActionMenuResetLinkSelector,(function(){return e.dispatchPreEvent("reset",this)&&e.confirmAction("reset",this)&&e.requestToController("reset",Z(this))})),Z(document).on("click",this.moduleActionMenuUpdateLinkSelector,(function(t){t.preventDefault();const o=Z(`#${Z(this).data("confirm_modal")}`),n=window.isShopMaintenance;if(1===o.length)return e.dispatchPreEvent("update",this)&&e.confirmAction("update",this)&&e.requestToController("update",Z(this));{const t=document.createElement("a");t.classList.add("btn","btn-primary","btn-lg"),t.setAttribute("href",window.moduleURLs.maintenancePage),t.innerHTML=window.moduleTranslations.moduleModalUpdateMaintenance;new G({id:"confirm-module-update-modal",confirmTitle:window.moduleTranslations.singleModuleModalUpdateTitle,closeButtonLabel:window.moduleTranslations.moduleModalUpdateCancel,confirmButtonLabel:n?window.moduleTranslations.moduleModalUpdateUpgrade:window.moduleTranslations.upgradeAnywayButtonText,confirmButtonClass:n?"btn-primary":"btn-secondary",confirmMessage:n?"":window.moduleTranslations.moduleModalUpdateConfirmMessage,closable:!0,customButtons:n?[]:[t]},(()=>e.dispatchPreEvent("update",this)&&e.confirmAction("update",this)&&e.requestToController("update",Z(this)))).show()}return!1})),Z(document).on("click",this.moduleActionModalDisableLinkSelector,(function(){return e.requestToController("disable",Z(e.moduleActionMenuDisableLinkSelector,Z(V.moduleItemList(Z(this).attr("data-tech-name")))))})),Z(document).on("click",this.moduleActionModalResetLinkSelector,(function(){return e.requestToController("reset",Z(e.moduleActionMenuResetLinkSelector,Z(V.moduleItemList(Z(this).attr("data-tech-name")))))})),Z(document).on("click",this.moduleActionModalUninstallLinkSelector,(t=>{Z(t.target).parents(".modal").on("hidden.bs.modal",(()=>e.requestToController("uninstall",Z(e.moduleActionMenuUninstallLinkSelector,Z(V.moduleItemList(Z(t.target).attr("data-tech-name")))),Z(t.target).attr("data-deletion"))))}))}confirmAction(e,t){const o=Z(Y(Z(t).data("confirm_modal")));return 1!==o.length||(o.first().modal("show"),!1)}dispatchPreEvent(e,t){const o=H.Event("module_card_action_event");return Z(t).trigger(o,[e]),!1===o.isPropagationStopped()&&!1===o.isImmediatePropagationStopped()&&!1!==o.result}hasPendingRequest(){return this.pendingRequest}requestToController(e,t,o=!1,n=()=>!0){if(this.pendingRequest)return Z.growl.warning({message:window.translate_javascripts["An action is already in progress. Please wait for it to finish."]}),!1;this.pendingRequest=!0;let i=t.closest(this.moduleItemActionsSelector);const r=t.closest("form"),s=Z('<button class="btn-primary-reverse onclick unbind spinner "></button>'),l=`//${window.location.host}${r.attr("action")}`,a=r.serializeArray();let d=!1;return"true"!==o&&!0!==o||a.push({name:"actionParams[deletion]",value:"true"}),Z.ajax({url:l,dataType:"json",method:"POST",data:a,beforeSend(){i.hide(),i.after(s)}}).done((t=>{if(void 0===t)return void Z.growl.error({message:"No answer received from server",fixed:!0});if(void 0!==t.status&&!1===t.status)return void Z.growl.error({message:t.msg,fixed:!0});const n=Object.keys(t)[0];if(!1===t[n].status)return void Z.growl.error({message:t[n].msg,fixed:!0});if(Z.growl({message:t[n].msg,duration:6e3}),!0===t[n].refresh_needed)return void(d=!0);const r=this.moduleItemListSelector.replace(".","");let s=null;"delete"!==e||t[n].has_download_url?"uninstall"===e?(s=i.closest(`.${r}`),s.attr("data-installed","0"),s.attr("data-active","0"),"true"!==o&&!0!==o||t[n].has_download_url?this.eventEmitter.emit("Module Uninstalled",s):this.eventEmitter.emit("Module Delete",s)):"disable"===e?(s=i.closest(`.${r}`),s.addClass(`${r}-isNotActive`),s.attr("data-active","0"),this.eventEmitter.emit("Module Disabled",s)):"enable"===e?(s=i.closest(`.${r}`),s.removeClass(`${r}-isNotActive`),s.attr("data-active","1"),this.eventEmitter.emit("Module Enabled",s)):"install"===e?(s=i.closest(`.${r}`),s.attr("data-installed","1"),s.attr("data-active","1"),s.removeClass(`${r}-isNotActive`),this.eventEmitter.emit("Module Installed",s)):"update"!==e&&"upgrade"!==e||(s=i.closest(`.${r}`),this.eventEmitter.emit("Module Upgraded",s)):(s=i.closest(`.${r}`),this.eventEmitter.emit("Module Delete",s)),i=Z(t[n].action_menu_html).replaceAll(i),i.hide()})).fail((()=>{const t=i.closest("module-item-list").data("techName");Z.growl.error({message:`Could not perform action ${e} for module ${t}`,fixed:!0})})).always((()=>{d?document.location.reload():(i.fadeIn(),s.remove(),this.pendingRequest=!1,n&&n())})),!1}}
/**
 * Copyright since 2007 PrestaShop SA and Contributors
 * PrestaShop is an International Registered Trademark & Property of PrestaShop SA
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Open Software License (OSL 3.0)
 * that is bundled with this package in the file LICENSE.md.
 * It is also available through the world-wide-web at this URL:
 * https://opensource.org/licenses/OSL-3.0
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@prestashop.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade PrestaShop to newer
 * versions in the future. If you wish to customize PrestaShop for your
 * needs please refer to https://devdocs.prestashop.com/ for more information.
 *
 * @author    PrestaShop SA and Contributors <contact@prestashop.com>
 * @copyright Since 2007 PrestaShop SA and Contributors
 * @license   https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
 */
const{$:J}=window;const X=class{constructor(e){this.eventEmitter=window.prestashop.component.EventEmitter,this.moduleCardController=e,this.DEFAULT_MAX_RECENTLY_USED=10,this.DISPLAY_LIST="list",this.CATEGORY_RECENTLY_USED="recently-used",this.currentDisplay=this.DISPLAY_LIST,this.isCategoryGridDisplayed=!1,this.currentTagsList=[],this.currentCategoryFilter=null,this.currentModuleStatusFilter=null,this.pstaggerInput=null,this.lastBulkAction=null,this.isUploadStarted=!1,this.findModuleUsed=!1,this.recentlyUsedSelector="#module-recently-used-list .modules-list",this.modulesList=[],this.moduleShortList=".module-short-list",this.moduleItemListSelector=".module-item-list",this.categorySelectorLabelSelector=".module-category-selector-label",this.categorySelector=".module-category-selector",this.categoryItemSelector=".module-category-menu",this.categoryResetBtnSelector=".module-category-reset",this.moduleInstallBtnSelector="input.module-install-btn",this.upgradeAllSource=".module_action_menu_upgrade_all",this.upgradeContainer="#modules-list-container-update",this.upgradeAllTargets=`${this.upgradeContainer} .module_action_menu_upgrade:visible`,this.notificationContainer="#modules-list-container-notification",this.bulkActionDropDownSelector=".module-bulk-actions",this.bulkItemSelector=".module-bulk-menu",this.bulkActionCheckboxListSelector=".module-checkbox-bulk-list input",this.checkedBulkActionListSelector=`${this.bulkActionCheckboxListSelector}:checked`,this.bulkActionCheckboxSelector="#module-modal-bulk-checkbox",this.bulkConfirmModalSelector="#module-modal-bulk-confirm",this.bulkConfirmModalActionNameSelector="#module-modal-bulk-confirm-action-name",this.bulkConfirmModalListSelector="#module-modal-bulk-confirm-list",this.bulkConfirmModalAckBtnSelector="#module-modal-confirm-bulk-ack",this.statusSelectorLabelSelector=".module-status-selector-label",this.statusItemSelector=".module-status-menu",this.statusResetBtnSelector=".module-status-reset",this.importModalBtnSelector="#page-header-desc-configuration-add_module",this.dropZoneModalSelector="#module-modal-import",this.dropZoneModalFooterSelector="#module-modal-import .modal-footer",this.dropZoneImportZoneSelector="#importDropzone",this.moduleImportModalCloseBtn="#module-modal-import-closing-cross",this.moduleImportStartSelector=".module-import-start",this.moduleImportProcessingSelector=".module-import-processing",this.moduleImportSuccessSelector=".module-import-success",this.moduleImportSuccessConfigureBtnSelector=".module-import-success-configure",this.moduleImportFailureSelector=".module-import-failure",this.moduleImportFailureRetrySelector=".module-import-failure-retry",this.moduleImportFailureDetailsBtnSelector=".module-import-failure-details-action",this.moduleImportSelectFileManualSelector=".module-import-start-select-manual",this.moduleImportFailureMsgDetailsSelector=".module-import-failure-details",this.moduleImportConfirmSelector=".module-import-confirm",this.initBOEventRegistering(),this.initBulkDropdown(),this.initSearchBlock(),this.initCategorySelect(),this.initActionButtons(),this.initAddModuleAction(),this.initDropzone(),this.initPageChangeProtection(),this.initFilterStatusDropdown(),this.fetchModulesList(),this.getNotificationsCount()}initFilterStatusDropdown(){const e=this,t=J("body");t.on("click",e.statusItemSelector,(function(){e.currentModuleStatusFilter=parseInt(J(this).data("status-ref"),10),J(e.statusSelectorLabelSelector).text(J(this).text()),J(e.statusResetBtnSelector).show(),e.updateModuleVisibility()})),t.on("click",e.statusResetBtnSelector,(function(){J(e.statusSelectorLabelSelector).text(J(this).text()),J(this).hide(),e.currentModuleStatusFilter=null,e.updateModuleVisibility()}))}initBulkDropdown(){const e=this,t=J("body");t.on("click",this.bulkActionCheckboxListSelector,(()=>{const t=J(e.bulkActionDropDownSelector);J(e.checkedBulkActionListSelector).length>0?t.closest(".module-top-menu-item").removeClass("disabled"):t.closest(".module-top-menu-item").addClass("disabled")})),t.on("click",e.bulkItemSelector,(function(){if(0===J(e.checkedBulkActionListSelector).length)return void J.growl.warning({message:window.translate_javascripts["Bulk Action - One module minimum"]});e.lastBulkAction=J(this).data("ref");const t=e.buildBulkActionModuleList(),o=J(this).data("display-name").toLowerCase();J(e.bulkConfirmModalListSelector).html(t),J(e.bulkConfirmModalActionNameSelector).text(o),"bulk-uninstall"===e.lastBulkAction?J(e.bulkActionCheckboxSelector).show():J(e.bulkActionCheckboxSelector).hide(),J(e.bulkConfirmModalSelector).modal("show")})),t.on("click",this.bulkConfirmModalAckBtnSelector,(t=>{t.preventDefault(),t.stopPropagation(),J(e.bulkConfirmModalSelector).modal("hide"),e.doBulkAction(e.lastBulkAction)}))}initBOEventRegistering(){this.eventEmitter.on("Module Enabled",(e=>this.onModuleDisabled(e))),this.eventEmitter.on("Module Disabled",(e=>this.onModuleDisabled(e))),this.eventEmitter.on("Module Uninstalled",(e=>this.installHandler(e))),this.eventEmitter.on("Module Delete",(e=>this.onModuleDelete(e))),this.eventEmitter.on("Module Installed",(e=>this.installHandler(e)))}installHandler(e){this.updateModuleStatus(e),this.updateModuleVisibility()}updateModuleStatus(e){this.modulesList=this.modulesList.map((t=>{const o=J(e);if(o.data("tech-name")===t.techName&&void 0!==o.data("version")){return{domObject:o,id:o.data("id"),name:o.data("name").toLowerCase(),scoring:parseFloat(o.data("scoring")),logo:o.data("logo"),author:o.data("author").toLowerCase(),version:o.data("version"),description:o.data("description").toLowerCase(),techName:o.data("tech-name").toLowerCase(),childCategories:o.data("child-categories"),categories:String(o.data("categories")).toLowerCase(),type:o.data("type"),price:parseFloat(o.data("price")),active:parseInt(o.data("active"),10),installed:1===o.data("installed"),access:o.data("last-access"),display:this.DISPLAY_LIST,container:t.container}}return t}))}onModuleDisabled(e){const t=this;t.updateModuleStatus(e),J(".modules-list").each((()=>{t.updateModuleVisibility()}))}onModuleDelete(e){this.modulesList=this.modulesList.filter((t=>t.techName!==J(e).data("tech-name"))),this.installHandler(e)}initPlaceholderMechanism(){const e=this;J(e.placeholderGlobalSelector).length&&e.ajaxLoadPage(),J("body").on("click",e.placeholderFailureRetryBtnSelector,(()=>{J(e.placeholderFailureGlobalSelector).fadeOut(),J(e.placeholderGlobalSelector).fadeIn(),e.ajaxLoadPage()}))}ajaxLoadPage(){const e=this;J.ajax({method:"GET",url:window.moduleURLs.catalogRefresh}).done((t=>{if(!0===t.status){void 0===t.domElements&&(t.domElements=null),void 0===t.msg&&(t.msg=null);const o=document.styleSheets[0],n="{display: none}",i=".modules-list",r=".module-sorting-menu",s=`${i},${r}`;o.insertRule?o.insertRule(s+n,o.cssRules.length):o.addRule&&o.addRule(s,n,-1),J(e.placeholderGlobalSelector).fadeOut(800,(()=>{J.each(t.domElements,((e,t)=>{J(t.selector).append(t.content)})),J(i).fadeIn(800).css("display","flex"),J(r).fadeIn(800),J('[data-toggle="popover"]').popover(),e.initCurrentDisplay(),e.fetchModulesList()}))}else J(e.placeholderGlobalSelector).fadeOut(800,(()=>{J(e.placeholderFailureMsgSelector).text(t.msg),J(e.placeholderFailureGlobalSelector).fadeIn(800)}))})).fail((t=>{J(e.placeholderGlobalSelector).fadeOut(800,(()=>{J(e.placeholderFailureMsgSelector).text(t.statusText),J(e.placeholderFailureGlobalSelector).fadeIn(800)}))}))}fetchModulesList(){const e=this;let t,o;e.modulesList=[],J(".modules-list").each((function(){t=J(this),t.find(".module-item").each((function(){o=J(this),e.modulesList.push({domObject:o,id:o.data("id"),name:o.data("name").toLowerCase(),scoring:parseFloat(o.data("scoring")),logo:o.data("logo"),author:o.data("author").toLowerCase(),version:o.data("version"),description:o.data("description").toLowerCase(),techName:o.data("tech-name").toLowerCase(),childCategories:o.data("child-categories"),categories:String(o.data("categories")).toLowerCase(),type:o.data("type"),price:parseFloat(o.data("price")),active:parseInt(o.data("active"),10),installed:1===o.data("installed"),access:o.data("last-access"),display:e.DISPLAY_LIST,container:t}),e.isModulesPage()&&o.remove()}))})),e.updateModuleVisibility()}updateModuleContainerDisplay(){const e=this;J(".module-short-list").each((function(){const t=J(this),o=t.find(".module-item").length;e.currentCategoryFilter&&e.currentCategoryFilter!==String(t.find(".modules-list").data("name"))||null!==e.currentModuleStatusFilter&&0===o||0===o&&String(t.find(".modules-list").data("name"))===e.CATEGORY_RECENTLY_USED||e.currentTagsList.length>0&&0===o?t.hide():t.show()}))}updateModuleVisibility(){const e=this;let t,o,n,i,r;e.isModulesPage()&&!e.isReadMoreModalOpened()&&(J(e.recentlyUsedSelector).find(".module-item").remove(),J(".modules-list").find(".module-item").remove());const s=new URL(document.location).searchParams.get("find");s&&!0!==e.findModuleUsed?(e.currentTagsList.push(s),e.findModuleUsed=!0):s&&e.currentTagsList.pop(s);const l=e.modulesList.length;let a=0;const d=(e,t)=>{r=t.toLowerCase(),i|=-1!==o.name.indexOf(r)||-1!==o.description.indexOf(r)||-1!==o.author.indexOf(r)||-1!==o.techName.indexOf(r)};for(let r=0;r<l;r+=1)o=e.modulesList[r],t=!0,n=e.currentCategoryFilter===e.CATEGORY_RECENTLY_USED?e.CATEGORY_RECENTLY_USED:o.categories,null!==e.currentCategoryFilter&&(t&=n===e.currentCategoryFilter),null!==e.currentModuleStatusFilter&&(t&=o.active===e.currentModuleStatusFilter&&!0===o.installed||!1===o.installed&&2===e.currentModuleStatusFilter||!0===o.installed&&3===e.currentModuleStatusFilter),e.currentTagsList.length&&(i=!1,J.each(e.currentTagsList,d),t&=i),!e.currentTagsList.length&&n===e.CATEGORY_RECENTLY_USED&&a>=e.DEFAULT_MAX_RECENTLY_USED&&(t=!1),t&&(a+=1,e.currentCategoryFilter===e.CATEGORY_RECENTLY_USED?J(e.recentlyUsedSelector).append(o.domObject):o.container.append(o.domObject));e.updateModuleContainerDisplay(),e.updateTotalResults()}initPageChangeProtection(){const e=this;J(window).on("beforeunload",(()=>{if(!0===e.isUploadStarted)return"It seems some critical operation are running, are you sure you want to change page? It might cause some unexepcted behaviors."}))}buildBulkActionModuleList(){const e=this.checkedBulkActionListSelector,t=this.moduleItemListSelector;let o,n=0,i="";return J(e).each((function(){return 10===n?(i+="- ...",!1):(o=J(this).closest(t),i+=`- ${o.data("name")}<br/>`,n+=1,!0)})),i}initAddModuleAction(){const e=this,t=J(`${e.importModalBtnSelector}, ${e.importModalBtnSelectorMobile}`);t.length&&(t.attr("data-toggle","modal"),t.attr("data-target",e.dropZoneModalSelector))}initDropzone(){const e=this,t=J("body"),o=J(".dropzone");t.on("click",this.moduleImportFailureRetrySelector,(()=>{J(`${e.moduleImportSuccessSelector},${e.moduleImportFailureSelector},${e.moduleImportProcessingSelector}`).fadeOut((()=>{setTimeout((()=>{J(e.moduleImportStartSelector).fadeIn((()=>{J(e.moduleImportFailureMsgDetailsSelector).hide(),J(e.moduleImportSuccessConfigureBtnSelector).hide(),o.removeAttr("style")}))}),550)}))})),t.on("hidden.bs.modal",this.dropZoneModalSelector,(()=>{J(`${e.moduleImportSuccessSelector}, ${e.moduleImportFailureSelector}`).hide(),J(e.moduleImportStartSelector).show(),o.removeAttr("style"),J(e.moduleImportFailureMsgDetailsSelector).hide(),J(e.moduleImportSuccessConfigureBtnSelector).hide(),J(e.dropZoneModalFooterSelector).html(""),J(e.moduleImportConfirmSelector).hide()})),t.on("click",`.dropzone:not(${this.moduleImportSelectFileManualSelector}, ${this.moduleImportSuccessConfigureBtnSelector})`,((e,t)=>{void 0===t&&(e.stopPropagation(),e.preventDefault())})),t.on("click",this.moduleImportSelectFileManualSelector,(e=>{e.stopPropagation(),e.preventDefault(),J(".dz-hidden-input").trigger("click",["manual_select"])})),t.on("click",this.moduleImportModalCloseBtn,(()=>{!0!==e.isUploadStarted&&J(e.dropZoneModalSelector).modal("hide")})),t.on("click",this.moduleImportSuccessConfigureBtnSelector,(function(e){e.stopPropagation(),e.preventDefault(),window.location=J(this).attr("href")})),t.on("click",this.moduleImportFailureDetailsBtnSelector,(()=>{J(e.moduleImportFailureMsgDetailsSelector).slideDown()}));const n={url:window.moduleURLs.moduleImport,acceptedFiles:".zip, .tar",paramName:"file_uploaded",uploadMultiple:!1,addRemoveLinks:!0,dictDefaultMessage:"",hiddenInputContainer:e.dropZoneImportZoneSelector,timeout:0,addedfile:()=>{J(`${e.moduleImportSuccessSelector}, ${e.moduleImportFailureSelector}`).hide(),e.animateStartUpload()},processing:()=>{},error:(t,o)=>{e.displayOnUploadError(o)},complete:t=>{if("error"!==t.status){const o=J.parseJSON(t.xhr.response);void 0===o.is_configurable&&(o.is_configurable=null),void 0===o.module_name&&(o.module_name=null),e.displayOnUploadDone(o);const n=J(`<div data-tech-name="${o.module_name}"></div>`);this.eventEmitter.emit(o.upgraded?"Module Upgraded":"Module Installed",n)}e.isUploadStarted=!1}};o.dropzone(J.extend(n))}animateStartUpload(){const e=this,t=J(".dropzone");e.isUploadStarted=!0,J(e.moduleImportStartSelector).hide(0),t.css("border","none"),J(e.moduleImportProcessingSelector).fadeIn()}animateEndUpload(e){J(this.moduleImportProcessingSelector).finish().fadeOut(e)}displayOnUploadDone(e){const t=this;t.animateEndUpload((()=>{if(!0===e.status){if(!0===e.is_configurable){const o=window.moduleURLs.configurationPage.replace(/:number:/,e.module_name);J(t.moduleImportSuccessConfigureBtnSelector).attr("href",o),J(t.moduleImportSuccessConfigureBtnSelector).show()}J(t.moduleImportSuccessSelector).fadeIn()}else J(t.moduleImportFailureMsgDetailsSelector).html(e.msg),J(t.moduleImportFailureSelector).fadeIn()}))}displayOnUploadError(e){const t=this;t.animateEndUpload((()=>{J(t.moduleImportFailureMsgDetailsSelector).html(e),J(t.moduleImportFailureSelector).fadeIn()}))}getNotificationsCount(){J.getJSON(window.moduleURLs.notificationsCount,this.updateNotificationsCount).fail((()=>{console.error("Could not retrieve module notifications count.")}))}updateNotificationsCount(e){const t={to_configure:J("#subtab-AdminModulesNotifications"),to_update:J("#subtab-AdminModulesUpdates")};Object.keys(t).forEach((o=>{0!==t[o].length&&t[o].find(".notification-counter").text(e[o])}))}doBulkAction(e){const t=J("#force_bulk_deletion").prop("checked"),o={"bulk-install":"install","bulk-uninstall":"uninstall","bulk-disable":"disable","bulk-enable":"enable","bulk-reset":"reset","bulk-delete":"delete"};if(void 0===o[e])return J.growl.error({message:window.translate_javascripts["Bulk Action - Request not found"].replace("[1]",e)}),!1;const n=this.checkedBulkActionListSelector,i=o[e];if(J(n).length<=0)return console.warn(window.translate_javascripts["Bulk Action - One module minimum"]),!1;const r=[];let s;return J(n).each((function(){s=J(this).data("tech-name"),r.push({techName:s,actionMenuObj:J(this).closest(".module-checkbox-bulk-list").next()})})),this.performModulesAction(r,i,t),!0}performModulesAction(e,t,o){const n=this;if(void 0===n.moduleCardController)return;const i=function(e){const o=[];let i;return J.each(e,((e,r)=>{i=J(n.moduleCardController.moduleActionMenuLinkSelector+t,r.actionMenuObj),i.length>0?o.push(i):J.growl.error({message:window.translate_javascripts["Bulk Action - Request not available for module"].replace("[1]",t).replace("[2]",r.techName)})})),o}(e);function r(){if(i.length<=0)return;!function(e){n.moduleCardController.hasPendingRequest()?i.push(e):n.moduleCardController.requestToController(t,e,o,r)}(i.shift())}i.length&&r()}initActionButtons(){const e=this;J("body").on("click",e.moduleInstallBtnSelector,(function(e){const t=J(this),o=J(t.next());e.preventDefault(),t.hide(),o.show(),J.ajax({url:t.data("url"),dataType:"json"}).done((()=>{o.fadeOut()}))})),J("body").on("click",e.upgradeAllSource,(t=>{t.preventDefault();const o=window.isShopMaintenance,n=document.createElement("a");n.classList.add("btn","btn-primary","btn-lg"),n.setAttribute("href",window.moduleURLs.maintenancePage),n.innerHTML=window.moduleTranslations.moduleModalUpdateMaintenance;return new G({id:"confirm-module-update-modal",confirmTitle:window.moduleTranslations.singleModuleModalUpdateTitle,closeButtonLabel:window.moduleTranslations.moduleModalUpdateCancel,confirmButtonLabel:o?window.moduleTranslations.moduleModalUpdateUpgrade:window.moduleTranslations.upgradeAnywayButtonText,confirmButtonClass:o?"btn-primary":"btn-secondary",confirmMessage:o?"":window.moduleTranslations.moduleModalUpdateConfirmMessage,closable:!0,customButtons:o?[]:[n]},(()=>{if(J(e.upgradeAllTargets).length<=0)return console.warn(window.translate_javascripts["Upgrade All Action - One module minimum"]),!1;const t=[];let o;return J(e.upgradeAllTargets).each((function(){const e=J(this).closest(".module-item-list");o=e.data("tech-name"),t.push({techName:o,actionMenuObj:J(".module-actions",e)})})),this.performModulesAction(t,"upgrade"),!0})).show(),!0}))}initCategorySelect(){const e=this,t=J("body");t.on("click",e.categoryItemSelector,(function(){e.currentCategoryFilter=J(this).data("category-ref"),e.currentCategoryFilter=e.currentCategoryFilter?String(e.currentCategoryFilter).toLowerCase():null,J(e.categorySelectorLabelSelector).text(J(this).data("category-display-name")),J(e.categoryResetBtnSelector).show(),e.updateModuleVisibility()})),t.on("click",e.categoryResetBtnSelector,(function(){const t=J(e.categorySelector).attr("aria-labelledby"),o=t.charAt(0).toUpperCase()+t.slice(1);J(e.categorySelectorLabelSelector).text(o),J(this).hide(),e.currentCategoryFilter=null,e.updateModuleVisibility()}))}initSearchBlock(){const e=this;e.pstaggerInput=J("#module-search-bar").pstagger({onTagsChanged:t=>{e.currentTagsList=t,e.updateModuleVisibility()},onResetTags:()=>{e.currentTagsList=[],e.updateModuleVisibility()},inputPlaceholder:window.translate_javascripts["Search - placeholder"],closingCross:!0,context:e})}updateTotalResults(){const e=(e,t)=>{const o=e.text().split(" ");o[0]=t,e.text(o.join(" "))},t=J(".module-short-list");if(t.length>0)t.each((function(){const t=J(this);e(t.find(".module-search-result-wording"),t.next(".modules-list").find(".module-item").length)}));else{const t=J(".modules-list").find(".module-item").length;e(J(".module-search-result-wording"),t),J(this.addonItemListSelector).toggle(t!==this.modulesList.length/2)}}isModulesPage(){return 0===J(this.upgradeContainer).length&&0===J(this.notificationContainer).length}isReadMoreModalOpened(){return J(".modal-read-more").is(":visible")}},{$:Q}=window;class K{constructor(){K.handleImport()}static handleImport(){const e=Q("#module-import");function t(){setTimeout((()=>{e.removeClass("onclick"),e.addClass("validate",450,o)}),2250)}function o(){setTimeout((()=>{e.removeClass("validate")}),1250)}e.on("click",(()=>{e.addClass("onclick",250,t)}))}}const ee=K,{$:te}=window;te((()=>{const e=new W;new ee,new X(e)})),window.module={}})();