window.attachment=function(e){function t(o){if(n[o])return n[o].exports;var r=n[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,o){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:o})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=470)}({0:function(e,t,n){"use strict";t.__esModule=!0,t.default=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},1:function(e,t,n){"use strict";t.__esModule=!0;var o=n(19),r=function(e){return e&&e.__esModule?e:{default:e}}(o);t.default=function(){function e(e,t){for(var n=0;n * @copyright Since 2007 PrestaShop SA and Contributors * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) */ t.default=l},26:function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),i=o(r),u=n(1),a=o(u),c=function(){function e(){(0,i.default)(this,e)}return(0,a.default)(e,[{key:"extend",value:function(e){e.getHeaderContainer().on("click",".js-common_refresh_list-grid-action",function(){location.reload()})}}]),e}();t.default=c},28:function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),i=o(r),u=n(1),a=o(u),c=window.$,s=function(){function e(){(0,i.default)(this,e)}return(0,a.default)(e,[{key:"extend",value:function(e){var t=this;e.getHeaderContainer().on("click",".js-common_show_query-grid-action",function(){return t._onShowSqlQueryClick(e)}),e.getHeaderContainer().on("click",".js-common_export_sql_manager-grid-action",function(){return t._onExportSqlManagerClick(e)})}},{key:"_onShowSqlQueryClick",value:function(e){var t=c("#"+e.getId()+"_common_show_query_modal_form");this._fillExportForm(t,e);var n=c("#"+e.getId()+"_grid_common_show_query_modal");n.modal("show"),n.on("click",".btn-sql-submit",function(){return t.submit()})}},{key:"_onExportSqlManagerClick",value:function(e){var t=c("#"+e.getId()+"_common_show_query_modal_form");this._fillExportForm(t,e),t.submit()}},{key:"_fillExportForm",value:function(e,t){var n=t.getContainer().find(".js-grid-table").data("query");e.find('textarea[name="sql"]').val(n),e.find('input[name="name"]').val(this._getNameFromBreadcrumb())}},{key:"_getNameFromBreadcrumb",value:function(){var e=c(".header-toolbar").find(".breadcrumb-item"),t="";return e.each(function(e,n){var o=c(n),r=0 ")),t=t.concat(r)}),t}}]),e}();t.default=s},3:function(e,t){var n=e.exports={version:"2.4.0"};"number"==typeof __e&&(__e=n)},31:function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),i=o(r),u=n(1),a=o(u),c=window.$,s=function(){function e(){(0,i.default)(this,e)}return(0,a.default)(e,[{key:"extend",value:function(e){this._handleBulkActionCheckboxSelect(e),this._handleBulkActionSelectAllCheckbox(e)}},{key:"_handleBulkActionSelectAllCheckbox",value:function(e){var t=this;e.getContainer().on("change",".js-bulk-action-select-all",function(n){var o=c(n.currentTarget),r=o.is(":checked");r?t._enableBulkActionsBtn(e):t._disableBulkActionsBtn(e),e.getContainer().find(".js-bulk-action-checkbox").prop("checked",r)})}},{key:"_handleBulkActionCheckboxSelect",value:function(e){var t=this;e.getContainer().on("change",".js-bulk-action-checkbox",function(){e.getContainer().find(".js-bulk-action-checkbox:checked").length>0?t._enableBulkActionsBtn(e):t._disableBulkActionsBtn(e)})}},{key:"_enableBulkActionsBtn",value:function(e){e.getContainer().find(".js-bulk-actions-btn").prop("disabled",!1)}},{key:"_disableBulkActionsBtn",value:function(e){e.getContainer().find(".js-bulk-actions-btn").prop("disabled",!0)}}]),e}();t.default=s},32:function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),i=o(r),u=n(1),a=o(u),c=n(45),s=o(c),l=window.$,f=function(){function e(){var t=this;return(0,i.default)(this,e),{extend:function(e){return t.extend(e)}}}return(0,a.default)(e,[{key:"extend",value:function(e){var t=this;e.getContainer().on("click",".js-bulk-action-submit-btn",function(n){t.submit(n,e)})}},{key:"submit",value:function(e,t){var n=l(e.currentTarget),o=n.data("confirm-message"),r=n.data("confirmTitle");void 0!==o&&0",{action:t.data("url"),method:r?o:"POST"}).appendTo("body");r||i.append(c("",{type:"_hidden",name:"_method",value:o})),i.submit()}})}}]),e}();t.default=s},36:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EventEmitter=void 0;var o=n(53),r=function(e){return e&&e.__esModule?e:{default:e}}(o);t.EventEmitter=new r.default},4:function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},40:function(e,t,n){"use strict";(function(e){function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),i=o(r),u=n(1),a=o(u),c=e.$,s=function(){function e(t){(0,i.default)(this,e),this.selector=".ps-sortable-column",this.columns=c(t).find(this.selector)}return(0,a.default)(e,[{key:"attach",value:function(){var e=this;this.columns.on("click",function(t){var n=c(t.delegateTarget);e._sortByColumn(n,e._getToggledSortDirection(n))})}},{key:"sortBy",value:function(e,t){var n=this.columns.is('[data-sort-col-name="'+e+'"]');if(!n)throw new Error('Cannot sort by "'+e+'": invalid column');this._sortByColumn(n,t)}},{key:"_sortByColumn",value:function(e,t){window.location=this._getUrl(e.data("sortColName"),"desc"===t?"desc":"asc",e.data("sortPrefix"))}},{key:"_getToggledSortDirection",value:function(e){return"asc"===e.data("sortDirection")?"desc":"asc"}},{key:"_getUrl",value:function(e,t,n){var o=new URL(window.location.href),r=o.searchParams;return n?(r.set(n+"[orderBy]",e),r.set(n+"[sortOrder]",t)):(r.set("orderBy",e),r.set("sortOrder",t)),o.toString()}}]),e}();t.default=s}).call(t,n(9))},42:function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});/** * 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 * @copyright Since 2007 PrestaShop SA and Contributors * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) */ var n=e.$,o=function(e,t){n.post(e).then(function(){return window.location.assign(t)})};t.default=o}).call(t,n(9))},44:function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),i=o(r),u=n(1),a=o(u),c=n(36),s=window.$,l=function(){function e(t){(0,i.default)(this,e),t=t||{},this.localeItemSelector=t.localeItemSelector||".js-locale-item",this.localeButtonSelector=t.localeButtonSelector||".js-locale-btn",this.localeInputSelector=t.localeInputSelector||".js-locale-input",s("body").on("click",this.localeItemSelector,this.toggleLanguage.bind(this)),c.EventEmitter.on("languageSelected",this.toggleInputs.bind(this))}return(0,a.default)(e,[{key:"toggleLanguage",value:function(e){var t=s(e.target),n=t.closest("form");c.EventEmitter.emit("languageSelected",{selectedLocale:t.data("locale"),form:n})}},{key:"toggleInputs",value:function(e){var t=e.form,n=e.selectedLocale,o=t.find(this.localeButtonSelector),r=o.data("change-language-url");o.text(n),t.find(this.localeInputSelector).addClass("d-none"),t.find(this.localeInputSelector+".js-locale-"+n).removeClass("d-none"),r&&this._saveSelectedLanguage(r,n)}},{key:"_saveSelectedLanguage",value:function(e,t){s.post({url:e,data:{language_iso_code:t}})}}]),e}();t.default=l},45:function(e,t,n){"use strict";function o(e,t){var n=this,o=e.id,u=e.closable;this.modal=r(e),this.$modal=i(this.modal.container),this.show=function(){n.$modal.modal()},this.modal.confirmButton.addEventListener("click",t),this.$modal.modal({backdrop:!!u||"static",keyboard:void 0===u||u,closable:void 0===u||u,show:!1}),this.$modal.on("hidden.bs.modal",function(){document.querySelector("#"+o).remove()}),document.body.appendChild(this.modal.container)}function r(e){var t=e.id,n=void 0===t?"confirm_modal":t,o=e.confirmTitle,r=e.confirmMessage,i=void 0===r?"":r,u=e.closeButtonLabel,a=void 0===u?"Close":u,c=e.confirmButtonLabel,s=void 0===c?"Accept":c,l=e.confirmButtonClass,f=void 0===l?"btn-primary":l,d={};return d.container=document.createElement("div"),d.container.classList.add("modal","fade"),d.container.id=n,d.dialog=document.createElement("div"),d.dialog.classList.add("modal-dialog"),d.content=document.createElement("div"),d.content.classList.add("modal-content"),d.header=document.createElement("div"),d.header.classList.add("modal-header"),o&&(d.title=document.createElement("h4"),d.title.classList.add("modal-title"),d.title.innerHTML=o),d.closeIcon=document.createElement("button"),d.closeIcon.classList.add("close"),d.closeIcon.setAttribute("type","button"),d.closeIcon.dataset.dismiss="modal",d.closeIcon.innerHTML="×",d.body=document.createElement("div"),d.body.classList.add("modal-body","text-left","font-weight-normal"),d.message=document.createElement("p"),d.message.classList.add("confirm-message"),d.message.innerHTML=i,d.footer=document.createElement("div"),d.footer.classList.add("modal-footer"),d.closeButton=document.createElement("button"),d.closeButton.setAttribute("type","button"),d.closeButton.classList.add("btn","btn-outline-secondary","btn-lg"),d.closeButton.dataset.dismiss="modal",d.closeButton.innerHTML=a,d.confirmButton=document.createElement("button"),d.confirmButton.setAttribute("type","button"),d.confirmButton.classList.add("btn",f,"btn-lg","btn-confirm-submit"),d.confirmButton.dataset.dismiss="modal",d.confirmButton.innerHTML=s,o?d.header.append(d.title,d.closeIcon):d.header.appendChild(d.closeIcon),d.body.appendChild(d.message),d.footer.append(d.closeButton,d.confirmButton),d.content.append(d.header,d.body,d.footer),d.dialog.appendChild(d.content),d.container.appendChild(d.dialog),d}Object.defineProperty(t,"__esModule",{value:!0}),t.default=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 * @copyright Since 2007 PrestaShop SA and Contributors * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) */ var i=window.$},470:function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}var r=n(23),i=o(r),u=n(24),a=o(u),c=n(25),s=o(c),l=n(28),f=o(l),d=n(26),v=o(d),h=n(31),m=o(h),p=n(32),y=o(p),_=n(35),g=o(_),b=n(33),w=o(b),k=n(44),x=o(k);(0,window.$)(function(){var e=new i.default("attachment");e.addExtension(new a.default),e.addExtension(new s.default),e.addExtension(new f.default),e.addExtension(new v.default),e.addExtension(new m.default),e.addExtension(new y.default),e.addExtension(new g.default),e.addExtension(new w.default),new x.default})},5:function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},53:function(e,t,n){"use strict";function o(e){console&&console.warn&&console.warn(e)}function r(){r.init.call(this)}function i(e){return void 0===e._maxListeners?r.defaultMaxListeners:e._maxListeners}function u(e,t,n,r){var u,a,c;if("function"!=typeof n)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof n);if(a=e._events,void 0===a?(a=e._events=Object.create(null),e._eventsCount=0):(void 0!==a.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),a=e._events),c=a[t]),void 0===c)c=a[t]=n,++e._eventsCount;else if("function"==typeof c?c=a[t]=r?[n,c]:[c,n]:r?c.unshift(n):c.push(n),(u=i(e))>0&&c.length>u&&!c.warned){c.warned=!0;var s=new Error("Possible EventEmitter memory leak detected. "+c.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");s.name="MaxListenersExceededWarning",s.emitter=e,s.type=t,s.count=c.length,o(s)}return e}function a(){for(var e=[],t=0;t0&&(i=t[0]),i instanceof Error)throw i;var u=new Error("Unhandled error."+(i?" ("+i.message+")":""));throw u.context=i,u}var a=r[e];if(void 0===a)return!1;if("function"==typeof a)p(a,this,t);else for(var c=a.length,s=f(a,c),n=0;n=0;i--)if(n[i]===t||n[i].listener===t){u=n[i].listener,r=i;break}if(r<0)return this;0===r?n.shift():d(n,r),1===n.length&&(o[e]=n[0]),void 0!==o.removeListener&&this.emit("removeListener",e,u||t)}return this},r.prototype.off=r.prototype.removeListener,r.prototype.removeAllListeners=function(e){var t,n,o;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var r,i=Object.keys(n);for(o=0;o=0;o--)this.removeListener(e,t[o]);return this},r.prototype.listeners=function(e){return s(this,e,!0)},r.prototype.rawListeners=function(e){return s(this,e,!1)},r.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):l.call(e,t)},r.prototype.listenerCount=l,r.prototype.eventNames=function(){return this._eventsCount>0?h(this._events):[]}},6:function(e,t,n){var o=n(11),r=n(17),i=n(13),u=Object.defineProperty;t.f=n(2)?Object.defineProperty:function(e,t,n){if(o(e),t=i(t,!0),o(n),r)try{return u(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},7:function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},8:function(e,t,n){var o=n(5),r=n(3),i=n(15),u=n(10),a=function(e,t,n){var c,s,l,f=e&a.F,d=e&a.G,v=e&a.S,h=e&a.P,m=e&a.B,p=e&a.W,y=d?r:r[t]||(r[t]={}),_=y.prototype,g=d?o:v?o[t]:(o[t]||{}).prototype;d&&(n=t);for(c in n)(s=!f&&g&&void 0!==g[c])&&c in y||(l=s?g[c]:n[c],y[c]=d&&"function"!=typeof g[c]?n[c]:m&&s?i(l,o):p&&g[c]==l?function(e){var t=function(t,n,o){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,o)}return e.apply(this,arguments)};return t.prototype=e.prototype,t}(l):h&&"function"==typeof l?i(Function.call,l):l,h&&((y.virtual||(y.virtual={}))[c]=l,e&a.R&&_&&!_[c]&&u(_,c,l)))};a.F=1,a.G=2,a.S=4,a.P=8,a.B=16,a.W=32,a.U=64,a.R=128,e.exports=a},9:function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(n=window)}e.exports=n}});