(()=>{var t={43284:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=c(n(99663)),i=c(n(22600)),o=c(n(72100)),a=n(76544),s=c(n(25121));function c(t){return t&&t.__esModule?t:{default:t}}var u=window.$,l=function(){function t(e,n){if((0,r.default)(this,t),0!==u(e.container).length){if(this.originalUrl=n,this.useMultiLang=void 0!==e.multiLanguageInput||void 0!==e.multiLanguageField,this.useMultiLang){var i=[];e.multiLanguageInput&&i.push(e.multiLanguageInput),e.multiLanguageField&&i.push(e.multiLanguageField),this.multiLangSelector=i.join(","),this.attachMultiLangEvents()}this.data={url:n,title:"",description:""},this.vm=new o.default({el:e.container,template:'',components:{serp:s.default},data:this.data}),this.initializeSelectors(e),this.attachInputEvents()}}return(0,i.default)(t,[{key:"attachMultiLangEvents",value:function(t){var e=this;u("body").on("click",t,(function(){e.checkTitle(),e.checkDesc(),e.checkUrl()})),a.EventEmitter.on("languageSelected",(function(){e.checkTitle(),e.checkDesc(),e.checkUrl()}))}},{key:"initializeSelectors",value:function(t){this.defaultTitle=u(t.defaultTitle),this.watchedTitle=u(t.watchedTitle),this.defaultDescription=u(t.defaultDescription),this.watchedDescription=u(t.watchedDescription),this.watchedMetaUrl=u(t.watchedMetaUrl)}},{key:"attachInputEvents",value:function(){var t=this;u(this.defaultTitle).on("keyup change",(function(){return t.checkTitle()})),u(this.watchedTitle).on("keyup change",(function(){return t.checkTitle()})),u(this.defaultDescription).on("keyup change",(function(){return t.checkDesc()})),u(this.watchedDescription).on("keyup change",(function(){return t.checkDesc()})),this.watchedMetaUrl.on("keyup change",(function(){return t.checkUrl()})),this.checkTitle(),this.checkDesc(),this.checkUrl()}},{key:"setTitle",value:function(t){this.data.title=t}},{key:"setDescription",value:function(t){this.data.description=t}},{key:"setUrl",value:function(t){this.data.url=this.originalUrl.replace("{friendy-url}",t),this.data.url=this.data.url.replace("{friendly-url}",t)}},{key:"checkTitle",value:function(){var t=this.defaultTitle,e=this.watchedTitle;this.useMultiLang&&(e=e.closest(this.multiLangSelector).find("input"),t=t.closest(this.multiLangSelector).find("input"));var n=e.length?e.val():"",r=t.length?t.val():"";this.setTitle(""===n?r:n),this.checkUrl()}},{key:"checkDesc",value:function(){var t=this.watchedDescription,e=this.defaultDescription;this.useMultiLang&&(t=t.closest(this.multiLangSelector).find(this.watchedDescription.is("input")?"input":"textarea"),e=e.closest(this.multiLangSelector).find(this.defaultDescription.is("input")?"input":"textarea"));var n=t.length?t.val().innerText||t.val():"",r=e.length?u(e.val()).text()||e.val():"";this.setDescription(""===n?r:n)}},{key:"checkUrl",value:function(){var t=this.watchedMetaUrl;this.useMultiLang&&(t=t.closest(this.multiLangSelector).find("input")),this.setUrl(t.val())}}]),t}();
/**
* 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)
*/e.default=l},76544:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.EventEmitter=void 0;var r,i=n(17187),o=(r=i)&&r.__esModule?r:{default:r};var a=e.EventEmitter=new o.default;
/**
* 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)
*/e.default=a},36183:(t,e,n)=>{"use strict";var r=n(73609);Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(){r(document).ready((function(){r(".js-attribute-checkbox").change((function(t){r(t.target).is(":checked")?0===r('.token[data-value="'+r(t.target).data("value")+'"] .close').length&&r("#form_step3_attributes").tokenfield("createToken",{value:r(t.target).data("value"),label:r(t.target).data("label")}):r('.token[data-value="'+r(t.target).data("value")+'"] .close').click()}))})),r("#form_step3_attributes").on("tokenfield:createdtoken",(function(t){r('.js-attribute-checkbox[data-value="'+t.attrs.value+'"]').is(":checked")||r('.js-attribute-checkbox[data-value="'+t.attrs.value+'"]').prop("checked",!0)})).on("tokenfield:removedtoken",(function(t){r('.js-attribute-checkbox[data-value="'+t.attrs.value+'"]').is(":checked")&&r('.js-attribute-checkbox[data-value="'+t.attrs.value+'"]').prop("checked",!1)})),r("input.form-control[counter], textarea.form-control:not(.autoload_rte)[counter]").each((function(){var t=r(this).attr("counter");function e(t){var e=r(t).attr("counter"),n=r(t).attr("counterType"),i=r(t).val().length;r(t).parent().find("span.currentLength").text(i),"recommended"!==n&&i>e?r(t).parent().find("span.maxLength").addClass("text-danger"):r(t).parent().find("span.maxLength").removeClass("text-danger")}void 0!==t&&!1!==t&&(e(r(this)),r(this).on("input",(function(){e(r(this))})))}))}},13471:(t,e,n)=>{"use strict";var r=n(73609);Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(){var t=function(){var t=r(".category-tree-overflow"),e=t.width();t.animate({scrollLeft:e},200)},e=function(e){"expand"===e?(r(".js-categories-tree ul").show(),r(".more").toggleClass("less"),t()):(r(".js-categories-tree ul:not(.category-tree)").hide(),r(".less").toggleClass("more"))};r("#categories-tree-expand").on("click",(function(){e("expand"),r("#categories-tree-expand").hide(),r("#categories-tree-reduce").show()})),r("#categories-tree-reduce").on("click",(function(){e("collapse"),r("#categories-tree-reduce").hide(),r("#categories-tree-expand").show()})),r(".category-tree-overflow .checkbox").on("click",(function(e){r(e.target).is("input")||t()})),r(".category-tree-overflow .checkbox label").on("click",(function(e){r(e.target).is("input")||t()}))}},28747:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(){n(document).ready((function(){var o=n(".js-combinations-list");if(0!==o.length){var a=o.data("ids-product-attribute").toString().split(","),s=o.attr("data-action-refresh-images").replace(/form-images\/\d+/,"form-images/"+o.data("id-product")),c=a.length,u=0;n.get(s).then((function(t){0!==c&&l(t)})),n("#create-combinations").click((function(t){t.preventDefault(),window.form.send(!1,!1,i)}));window.Dropzone.forElement("#product-images-dropzone").on("success",(function(){var t=n.map(n(".js-combinations-list .combination"),(function(t){return n(t).data("index")}));n.get(s).then((function(n){e(n,t)}))})),n(document).on("click","#form .product-combination-image",(function(){var t=n(this).find("input"),e=t.prop("checked");t.prop("checked",!e),n(this).toggleClass("img-highlight",!e),r()})),n("#product_combination_bulk_impact_on_price_ti, #product_combination_bulk_impact_on_price_te").keyup((function(){var t=n(this),e=window.priceCalculation.normalizePrice(t.val());"product_combination_bulk_impact_on_price_ti"===t.attr("id")?n("#product_combination_bulk_impact_on_price_te").val(window.priceCalculation.removeCurrentTax(e)).change():n("#product_combination_bulk_impact_on_price_ti").val(window.priceCalculation.addCurrentTax(e)).change()}));var l=function r(i){var o=n("#combinations-bulk-form");o.hasClass("inactive")||o.addClass("inactive");var s=f();!1!==s&&n.get(s).then((function(o){n("#loading-attribute").before(o),e(i,a.slice(u,u+50)),(u+=50)\n \n \n '})),a.html(s),i.fadeIn(1e3)})),r()},r=function(){var t=n("#product-images-dropzone").find(".iscover"),e=null;if(1===t.length){var r=t.parent().find(".dz-image");e=r.find("img").length?r.find("img").attr("src"):r.css("background-image").replace(/^url\(["']?/,"").replace(/["']?\)$/,"")}n.each(n("#form .combination-form"),(function(t,r){var i=e,o=n(r).find(".product-combination-image input:checked:first");if(1===o.length&&(i=o.parent().find("img").attr("src")),i){var a='';n("#attribute_"+n(r).attr("data")).find("td.img").html(a)}}))},i=function(){n.ajax({type:"POST",url:n("#form_step3_attributes").attr("data-action"),data:n("#attributes-generator input.attribute-generator, #form_id_product").serialize(),beforeSend:function(){n("#create-combinations, #submit, .btn-submit").attr("disabled","disabled")},success:function(t){window.refreshTotalCombinations(1,n(t.form).filter(".combination.loaded").length),n("#accordion_combinations").append(t.form),window.displayFieldsManager.refresh();var r=n(".js-combinations-list").attr("data-action-refresh-images").replace(/form-images\/\d+/,"form-images/"+n(".js-combinations-list").data("id-product"));n.get(r).then((function(n){e(n,t.ids_product_attribute)})),n("input.attribute-generator").remove(),n("#attributes-generator div.token").remove(),n(".js-attribute-checkbox:checked").each((function(){n(this).prop("checked",!1)})),n("#combinations_thead").fadeIn()},complete:function(){n("#create-combinations, #submit, .btn-submit").removeAttr("disabled"),t(),window.supplierCombinations.refresh(),window.warehouseCombinations.refresh()}})}};var n=window.$},66013:(t,e,n)=>{"use strict";var r=n(73609);Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(){var t=r("#form_step1_categories");return{init:function(){0!==t.length&&(t.categorytree(),this.removeDefaultIfNeeded(),t.on("change","input.default-category",(function(){var e=r(this).val(),n=t.find('input[value="'+e+'"].category'),i=t.find('input[value="'+e+'"].default-category');!1===n.is(":checked")&&!0===i.is(":checked")&&n.trigger("click"),window.defaultCategory.check(e)})))},removeDefaultIfNeeded:function(){t.on("change","input.category",(function(){var e=r(this).val(),n=t.find('input[value="'+e+'"].category'),i=t.find('input[value="'+e+'"].default-category');if(t.find('input[type="checkbox"]').filter(":checked").length<1)n.prop("checked",!0);else if(!1===n.is(":checked")&&!0===i.is(":checked")){var o=function e(n){var r=n.closest("ul").parent(),i=r.find("> div > label > input");return r.is("li")?i.prop("checked")?i:e(r):t.find('input[type="checkbox"]:checked').first()}(n);window.defaultCategory.check(o.val()),window.productCategoriesTags.checkDefaultCategory(o.val())}}))}}}},14982:(t,e,n)=>{"use strict";var r=n(73609),i=n(73609);Object.defineProperty(e,"__esModule",{value:!0});var o=c(n(99663)),a=c(n(22600)),s=c(n(24043));function c(t){return t&&t.__esModule?t:{default:t}}e.default=function(){var t=r("#bulk-combinations-container"),e=r("#delete-combinations"),n=r("#apply-on-combinations"),o=r("[data-uniqid]"),a=r("#form_step2_price"),c=r("#form_step2_price_ttc"),l=r("#form_step1_price_shortcut"),f=r("#form_step1_price_ttc_shortcut"),d=r("#form_step2_ecotax");return{init:function(){var t=this,i=this;e.on("click",(function(t){t.preventDefault(),i.deleteCombinations()})),n.on("click",(function(t){t.preventDefault(),i.applyChangesOnCombinations().hideForm().resetForm().unselectCombinations().submitUpdate()})),a.on("blur",(function(){t.syncToPricingTab()})),c.on("blur",(function(){t.syncToPricingTab()})),l.on("blur",(function(){t.syncToPricingTab()})),f.on("blur",(function(){t.syncToPricingTab()})),d.on("blur",(function(){t.syncToPricingTab()})),o.on("DOMSubtreeModified",(function(t){var e=t.target.getAttribute("data-uniqid"),n=t.target.innerText;r('[data-uniqid="'+e+'"]').each((function(){r(this).text()!==n&&r(this).text(n)}))})),r("#toggle-all-combinations").on("change",(function(t){r('#accordion_combinations td:first-child input[type="checkbox"]').each((function(){r(this).prop("checked",r(t.currentTarget).prop("checked"))}))})),r(document).on("change",".js-combination",(function(){"false"!==r(".bulk-action").attr("aria-expanded")&&r(".js-combination").is(":checked")||r(".js-collapse").collapse("toggle"),r("span.js-bulk-combinations").text(r("input.js-combination:checked").length)}))},getSelectedCombinations:function(){var t=[];return(0,s.default)(r('#accordion_combinations td:first-child input[type="checkbox"]:checked')).forEach((function(e){var n=e.getAttribute("data-id"),r=e.getAttribute("data-index");t.push(new u(n,r))})),t},applyChangesOnCombinations:function(){var t=this.getFormValues();return this.getSelectedCombinations().forEach((function(e){e.updateForm(t),e.syncValues(t)})),this},deleteCombinations:function(){var t=this.getSelectedCombinations(),n=[];t.forEach((function(t){n.push(t.domId)})),window.modalConfirmation.create(window.translate_javascripts["Are you sure you want to delete the selected item(s)?"],null,{onContinue:function(){var t=r(e).attr("data");r.ajax({type:"DELETE",data:{"attribute-ids":n},url:t,beforeSend:function(){r("#create-combinations, #apply-on-combinations, #submit, .btn-submit").attr("disabled","disabled")},success:function(t){window.showSuccessMessage(t.message),window.refreshTotalCombinations(-1,n.length),r("span.js-bulk-combinations").text("0"),n.forEach((function(t){new u(t).removeFromDOM()})),window.displayFieldsManager.refresh()},error:function(t){window.showErrorMessage(i.parseJSON(t.responseText).message)},complete:function(){r("#create-combinations, #apply-on-combinations, #submit, .btn-submit").removeAttr("disabled")}})}}).show()},getFormValues:function(){var e=[];return r(t).find("input").each((function(){""!==r(this).val()&&"product_combination_bulk__token"!==r(this).attr("id")&&e.push({id:r(this).attr("id"),value:r(this).val()})})),e},resetForm:function(){return t.find("input").val(""),this},unselectCombinations:function(){return r("#toggle-all-combinations").prop("checked",!1),this},hideForm:function(){return t.collapse("hide"),this},submitUpdate:function(){r("#form").submit()},syncToPricingTab:function(){r("tr.combination").toArray().forEach((function(t){var e=r("#"+t.id),n=e.attr("data"),i=window.priceCalculation.getCombinationFinalPriceTaxExcludedById(n);e.find(".attribute-finalprice span.final-price").html(i);var o=window.priceCalculation.getCombinationEcotaxTaxIncludedById(n);0===o&&(o=window.priceCalculation.getProductEcotaxTaxIncluded()),e.find(".attribute-finalprice span.attribute-ecotax").html(Number(window.ps_round(o,2)).toFixed(2)),e.find(".attribute-finalprice .attribute-ecotax-preview").toggleClass("d-none",0===Number(o))}))}}};var u=function(){function t(e,n){(0,o.default)(this,t),this.inputBulkPattern="product_combination_bulk_",this.inputPattern="combination_"+n+"_",this.domId=e,this.appId="attribute_"+this.domId,this.element=r("#"+this.appId),this.form=r("#combination_form_"+this.domId)}return(0,a.default)(t,[{key:"isSelected",value:function(){return this.element.checked}},{key:"removeFromDOM",value:function(){r(this.element).remove()}},{key:"updateForm",value:function(t){var e=this;return t.forEach((function(t){var n=t.id.substr(e.inputBulkPattern.length),i=r("#"+e.convertInput(n));i.is(":checkbox")?i.prop("checked",!!t.value):i.val(t.value)})),this.form}},{key:"convertInput",value:function(t){var e="";switch(t){case"quantity":case"reference":case"minimal_quantity":case"low_stock_threshold":case"low_stock_alert":e=this.inputPattern+"attribute_"+t;break;case"cost_price":e=this.inputPattern+"attribute_wholesale_price";break;case"date_availability":e=this.inputPattern+"available_date_attribute";break;case"impact_on_weight":e=this.inputPattern+"attribute_weight";break;case"impact_on_price_te":e=this.inputPattern+"attribute_price";break;case"impact_on_price_ti":e=this.inputPattern+"attribute_priceTI"}return e}},{key:"syncValues",value:function(t){var e=this;return t.forEach((function(t){var n=t.id.substr(e.inputBulkPattern.length),i=t.value;if(-1!==["quantity","impact_on_price_te"].indexOf(n)){n="quantity"===n?"quantity":"price";var o=r("#attribute_"+e.domId+" .attribute-"+n+" input");o.val(i),o.change()}})),!0}}]),t}()},78256:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(){var t,e=n(".js-arrow"),r=n(".js-tabs"),i=n(".js-nav-tabs"),o=void 0,a=0,s=0,c=35;i.find("li").each((function(t,e){c+=n(e).width()})),t=c+70,i.width(t),i.find('[data-toggle="tab"]').on("click",(function(t){n(t.target).hasClass("active")||n("#form_content > .form-contenttab").removeClass("active")})),e.on("click",(function(t){e.is(":visible")&&(s=r.width(),o=i.position(),a="-=0",n(t.currentTarget).hasClass("right-arrow")?s-o.left
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
*/
var n=window.$},12887:(t,e,n)=>{"use strict";var r=n(73609);Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(){function t(t,e){var n=r(t),i=n.attr("data-formid"),o="#"+i+"-data .delete",s=i+"_source";!0===e&&r("#"+i).typeahead("destroy"),r(document).on("click",o,(function(t){t.preventDefault(),window.modalConfirmation.create(window.translate_javascripts["Are you sure you want to delete this item?"],null,{onContinue:function(){r(t.target).parents(".media").remove(),r("#submit").click()}}).show()})),document[s]=new a.default({datumTokenizer:a.default.tokenizers.whitespace,queryTokenizer:a.default.tokenizers.whitespace,identify:function(t){return t[n.attr("data-mappingvalue")]},remote:{url:n.attr("data-remoteurl"),cache:!1,wildcard:"%QUERY",transform:function(t){return t||[]}}}),r("#"+i).typeahead({limit:20,minLength:2,highlight:!0,cache:!1,hint:!1},{display:n.attr("data-mappingname"),source:document[i+"_source"],limit:30,templates:{suggestion:function(t){return'