@salla.sa/twilight-components 2.13.98 → 2.13.99

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. package/dist/cjs/app-globals-c5340b59.js.map +1 -1
  2. package/dist/cjs/salla-add-product-button_48.cjs.entry.js +1 -1
  3. package/dist/cjs/salla-add-product-button_48.cjs.entry.js.map +1 -1
  4. package/dist/collection/components/salla-add-product-button/salla-add-product-button.js +1 -1
  5. package/dist/collection/components/salla-add-product-button/salla-add-product-button.js.map +1 -1
  6. package/dist/components/index.js.map +1 -1
  7. package/dist/components/salla-add-product-button2.js +1 -1
  8. package/dist/components/salla-add-product-button2.js.map +1 -1
  9. package/dist/components/salla-quick-buy2.js.map +1 -1
  10. package/dist/esm/app-globals-0280e1d0.js.map +1 -1
  11. package/dist/esm/salla-add-product-button_48.entry.js +1 -1
  12. package/dist/esm/salla-add-product-button_48.entry.js.map +1 -1
  13. package/dist/esm-es5/app-globals-0280e1d0.js.map +1 -1
  14. package/dist/esm-es5/salla-add-product-button_48.entry.js +1 -1
  15. package/dist/esm-es5/salla-add-product-button_48.entry.js.map +1 -1
  16. package/dist/twilight/{p-8b0dbb9b.entry.js → p-2d07a366.entry.js} +2 -2
  17. package/dist/twilight/p-2d07a366.entry.js.map +1 -0
  18. package/dist/twilight/p-4a9df09e.js.map +1 -1
  19. package/dist/twilight/p-4c2194e3.system.js.map +1 -1
  20. package/dist/twilight/p-54e1a882.system.js +1 -1
  21. package/dist/twilight/{p-20adfb95.system.entry.js → p-a33e6fb2.system.entry.js} +2 -2
  22. package/dist/twilight/p-a33e6fb2.system.entry.js.map +1 -0
  23. package/dist/twilight/twilight.esm.js +1 -1
  24. package/dist/types/global.d.ts +20 -0
  25. package/package.json +5 -5
  26. package/dist/twilight/p-20adfb95.system.entry.js.map +0 -1
  27. package/dist/twilight/p-8b0dbb9b.entry.js.map +0 -1
@@ -1,7 +1,7 @@
1
1
  var __awaiter=this&&this.__awaiter||function(e,t,i,n){function a(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,r){function o(e){try{l(n.next(e))}catch(e){r(e)}}function s(e){try{l(n["throw"](e))}catch(e){r(e)}}function l(e){e.done?i(e.value):a(e.value).then(o,s)}l((n=n.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var i={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},n,a,r,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(e){return function(t){return l([e,t])}}function l(s){if(n)throw new TypeError("Generator is already executing.");while(o&&(o=0,s[0]&&(i=0)),i)try{if(n=1,a&&(r=s[0]&2?a["return"]:s[0]?a["throw"]||((r=a["return"])&&r.call(a),0):a.next)&&!(r=r.call(a,s[1])).done)return r;if(a=0,r)s=[s[0]&2,r.value];switch(s[0]){case 0:case 1:r=s;break;case 4:i.label++;return{value:s[1],done:false};case 5:i.label++;a=s[1];s=[0];continue;case 7:s=i.ops.pop();i.trys.pop();continue;default:if(!(r=i.trys,r=r.length>0&&r[r.length-1])&&(s[0]===6||s[0]===2)){i=0;continue}if(s[0]===3&&(!r||s[1]>r[0]&&s[1]<r[3])){i.label=s[1];break}if(s[0]===6&&i.label<r[1]){i.label=r[1];r=s;break}if(r&&i.label<r[2]){i.label=r[2];i.ops.push(s);break}if(r[2])i.ops.pop();i.trys.pop();continue}s=t.call(e,i)}catch(e){s=[6,e];a=0}finally{n=r=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,t,i){if(i||arguments.length===2)for(var n=0,a=t.length,r;n<a;n++){if(r||!(n in t)){if(!r)r=Array.prototype.slice.call(t,0,n);r[n]=t[n]}}return e.concat(r||Array.prototype.slice.call(t))};var _0;
2
2
  /*!
3
3
  * Crafted with ❤ by Salla
4
- */import{r as registerInstance,c as createEvent,h,H as Host,g as getElement,F as Fragment}from"./index-114c614f.js";import{a as anime}from"./anime.es-6b92d9cd.js";import{C as CheckCircleIcon}from"./check-838f37a7.js";import{H as Helper}from"./Helper-bf538e34.js";import{a as createCommonjsModule,c as commonjsGlobal,g as getDefaultExportFromCjs}from"./_commonjsHelpers-1415ffd3.js";import{a as arrowLeft}from"./arrow-left-3ba30fe6.js";import{C as CameraIcon}from"./camera-d0a93c12.js";import{a as arrowRight}from"./arrow-right-d925a796.js";import{e as email}from"./mail-25533e3f.js";import{f as facebook,t as twitter}from"./twitter-0da90a1e.js";var PendingOrdersIcon='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="30" height="32" viewBox="0 0 30 32">\n<title>cart</title>\n<path d="M15.426 28.084c0-1.412-0.85-2.684-2.156-3.226-1.305-0.54-2.807-0.241-3.805 0.758-0.999 0.998-1.298 2.5-0.758 3.805 0.54 1.303 1.815 2.155 3.226 2.155 1.928-0.003 3.49-1.564 3.492-3.492h0.001zM10.597 28.084h0.001c0-0.54 0.326-1.027 0.825-1.235 0.498-0.206 1.074-0.091 1.455 0.29 0.383 0.382 0.497 0.957 0.29 1.456-0.208 0.5-0.695 0.825-1.235 0.825-0.355 0-0.695-0.142-0.944-0.391-0.251-0.251-0.392-0.591-0.392-0.946h-0.001l0.001 0.001zM28.23 28.084c0-1.412-0.85-2.684-2.155-3.226-1.305-0.54-2.807-0.241-3.806 0.758s-1.297 2.5-0.756 3.805c0.54 1.303 1.813 2.155 3.226 2.155 1.927-0.003 3.49-1.564 3.491-3.492zM23.401 28.084c0-0.54 0.326-1.027 0.825-1.235 0.5-0.206 1.075-0.091 1.457 0.29s0.497 0.957 0.289 1.456c-0.206 0.5-0.693 0.825-1.233 0.825-0.738 0-1.337-0.599-1.337-1.337l-0.001 0.001zM1.953 0.234l-0.342-0.059c-0.29-0.064-0.594-0.004-0.839 0.166-0.247 0.169-0.414 0.436-0.463 0.734-0.050 0.3 0.023 0.607 0.201 0.85s0.444 0.402 0.738 0.44l0.341 0.059c1.825 0.324 3.248 1.794 3.548 3.662l1.981 12.369h-0.001c0.218 1.387 0.913 2.651 1.96 3.563s2.379 1.412 3.754 1.41h14.242c0.601 0 1.088-0.498 1.088-1.112s-0.487-1.112-1.088-1.112h-14.242c-1.679-0.001-3.139-1.183-3.525-2.854h11.463c1.614 0.004 3.188-0.518 4.493-1.49 1.305-0.973 2.271-2.346 2.762-3.918l1.298-4.136c0.145-0.455 0.065-0.953-0.213-1.336-0.278-0.385-0.72-0.608-1.187-0.602h-20.467l-0.181-1.141c-0.218-1.367-0.849-2.631-1.802-3.615-0.954-0.983-2.184-1.64-3.518-1.878h-0.001zM26.946 9.096l-0.993 3.169v-0.001c-0.353 1.122-1.044 2.101-1.975 2.796s-2.056 1.067-3.208 1.067h-11.833l-1.125-7.042 19.134 0.011z"></path>\n</svg>\n';var WalletIcon='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>full-wallet</title>\n<path d="M29 12h-26c-0.668-0.008-1.284-0.226-1.787-0.59l0.009 0.006c-0.744-0.552-1.222-1.428-1.222-2.416 0-1.657 1.343-3 2.999-3h6c0.552 0 1 0.448 1 1s-0.448 1-1 1v0h-6c-0.552 0-1 0.448-1 1 0 0.326 0.156 0.616 0.397 0.798l0.002 0.002c0.167 0.12 0.374 0.194 0.599 0.2l0.001 0h26c0.552 0 1 0.448 1 1s-0.448 1-1 1v0zM27 12c-0.552 0-1-0.448-1-1v0-3h-3c-0.552 0-1-0.448-1-1s0.448-1 1-1v0h4c0.552 0 1 0.448 1 1v0 4c0 0.552-0.448 1-1 1v0zM29 30h-26c-1.657 0-3-1.343-3-3v0-18c0-0.552 0.448-1 1-1s1 0.448 1 1v0 18c0 0.552 0.448 1 1 1v0h25v-5c0-0.552 0.448-1 1-1s1 0.448 1 1v0 6c0 0.552-0.448 1-1 1v0zM29 18c-0.552 0-1-0.448-1-1v0-6c0-0.552 0.448-1 1-1s1 0.448 1 1v0 6c0 0.552-0.448 1-1 1v0zM31 24h-7c-2.209 0-4-1.791-4-4s1.791-4 4-4v0h7c0.552 0 1 0.448 1 1v0 6c0 0.552-0.448 1-1 1v0zM24 18c-1.105 0-2 0.895-2 2s0.895 2 2 2v0h6v-4zM25 12c-0.001 0-0.001 0-0.002 0-0.389 0-0.726-0.222-0.891-0.546l-0.003-0.006-3.552-7.106-2.306 1.152c-0.13 0.066-0.284 0.105-0.447 0.105-0.552 0-1-0.448-1-1 0-0.39 0.223-0.727 0.548-0.892l0.006-0.003 3.2-1.6c0.13-0.067 0.284-0.106 0.447-0.106 0.39 0 0.727 0.223 0.892 0.548l0.003 0.006 4 8c0.067 0.13 0.106 0.285 0.106 0.448 0 0.552-0.448 1-1 1v0zM21 12c-0.001 0-0.001 0-0.002 0-0.389 0-0.726-0.222-0.891-0.546l-0.003-0.006-3.552-7.106-15.104 7.552c-0.13 0.066-0.284 0.105-0.447 0.105-0.552 0-1-0.448-1-1 0-0.39 0.223-0.727 0.548-0.892l0.006-0.003 16-8c0.13-0.067 0.284-0.106 0.447-0.106 0.39 0 0.727 0.223 0.892 0.548l0.003 0.006 4 8c0.067 0.13 0.106 0.285 0.106 0.448 0 0.552-0.448 1-1 1-0.001 0-0.001 0-0.002 0h0z"></path>\n</svg>\n';var sallaAddProductButtonCss=":host{display:block}salla-add-product-button[width=wide]{width:100%}";var SallaAddProductButton=function(){function e(e){var t=this;registerInstance(this,e);this.success=createEvent(this,"success",7);this.failed=createEvent(this,"failed",7);this.hostAttributes={};this.channels=undefined;this.subscribedOptions=undefined;this.quickBuy=undefined;this.quantity=undefined;this.donatingAmount=undefined;this.notifyOptionsAvailability=undefined;this.productId=undefined;this.supportStickyBar=undefined;this.productStatus="sale";this.productType="product";this.hasOutOfStockOption=undefined;this.hasSubscribedOptions=undefined;this.selectedOptions=[];this.showQuickBuy=undefined;this.isApplePayActive=undefined;this.buyNowText=salla.lang.get("pages.products.buy_now");salla.lang.onLoaded((function(){t.buyNowText=salla.lang.get("pages.products.buy_now")}))}e.prototype.getLabel=function(){if(this.productStatus==="sale"&&this.supportStickyBar&&window.innerWidth<=768&&this.showQuickBuy&&this.isApplePayActive){return PendingOrdersIcon}if(this.productStatus==="sale"&&this.productType==="booking"){return salla.lang.get("pages.cart.book_now")}if(this.productStatus==="sale"){return salla.lang.get("pages.cart.add_to_cart")}if(this.productType!=="donating"){return salla.lang.get("pages.products.out_of_stock")}return salla.lang.get("pages.products.donation_exceed")};e.prototype.addProductToCart=function(e){var t=this;var i;if(this.productType==="booking"){e.preventDefault();return this.addBookingProduct()}if(this.hostAttributes.type==="submit"){return false}e.preventDefault();(i=this.btn)===null||i===void 0?void 0:i.disable();var n=Object.entries({id:this.productId,donation_amount:this.donatingAmount,quantity:this.quantity,endpoint:"quickAdd"}).reduce((function(e,t){var i=t[0],n=t[1];return n?(e[i]=n,e):e}),{});return salla.cart.addItem(n).then((function(e){var i;t.selectedOptions=[];(i=t.btn)===null||i===void 0?void 0:i.enable();t.success.emit(e)})).catch((function(e){var i;t.failed.emit(e);(i=t.btn)===null||i===void 0?void 0:i.enable()}))};e.prototype.addBookingProduct=function(){var e=this;if(salla.config.isGuest()){salla.auth.api.setAfterLoginEvent("booking::add",this.productId);salla.event.dispatch("login::open");return}return salla.booking.add(this.productId).then((function(t){return e.success.emit(t)})).catch((function(t){return e.failed.emit(t)}))};e.prototype.getBtnAttributes=function(){for(var e=0;e<this.host.attributes.length;e++){if(!["id","class"].includes(this.host.attributes[e].name)){this.hostAttributes[this.host.attributes[e].name]=this.host.attributes[e].value}}return this.hostAttributes};e.prototype.getQuickBuyBtnAttributes=function(){return Object.assign(Object.assign({},this.getBtnAttributes()),{type:this.supportStickyBar&&window.innerWidth<=768?"plain":this.productType=="donating"?"donate":"buy"})};e.prototype.miniCheckoutWidget=function(){var e=salla.config.get("store.id");if(!e){return}return h("salla-mini-checkout-widget",{language:salla.lang.locale,"store-id":e,config:{user:salla.config.get("user")},products:[this.productId],api:salla.config.get("store.api"),outline:true,"form-selector":"form.product-form",class:"s-add-product-button-mini-checkout"},h("div",{slot:"widget-label",class:"s-add-product-button-mini-checkout-content"},h("span",{innerHTML:WalletIcon}),this.buyNowText))};e.prototype.componentWillLoad=function(){var e=this;return salla.onReady().then((function(){var t,i,n;e.showQuickBuy=e.quickBuy&&salla.config.get("store.settings.buy_now")&&e.productStatus=="sale"&&e.productType!=="booking";e.isApplePayActive=((t=window.ApplePaySession)===null||t===void 0?void 0:t.canMakePayments())&&((i=salla.config.get("store.settings.payments"))===null||i===void 0?void 0:i.includes("apple_pay"))&&salla.config.get("store.settings.is_salla_gateway",false);e.passedLabel=e.host.innerHTML.replace("\x3c!----\x3e","").trim();if(!!e.passedLabel&&window.innerWidth>=768){return(n=e.btn)===null||n===void 0?void 0:n.setText(e.passedLabel)}if(e.host.getAttribute("type")==="submit"&&e.supportStickyBar){window.addEventListener("resize",(function(){var t;return(t=e.btn)===null||t===void 0?void 0:t.setText(window.innerWidth>=768&&!!e.passedLabel?e.passedLabel:e.getLabel())}))}}))};e.prototype.render=function(){var e=this;var t;if((t=this.host.closest(".swiper-slide"))===null||t===void 0?void 0:t.classList.contains("swiper-slide-duplicate")){return""}if(this.hasSubscribedOptions){return h(Host,null,h("salla-product-availability",Object.assign({},this.getBtnAttributes(),{"is-subscribed":true}),h("span",{class:"s-hidden"},h("slot",null))))}if(this.productStatus==="out-and-notify"&&this.channels||this.hasOutOfStockOption){return h(Host,null,h("salla-product-availability",Object.assign({},this.getBtnAttributes()),h("span",{class:"s-hidden"},h("slot",null))))}return h(Host,{class:{"s-add-product-button-with-quick-buy":this.showQuickBuy,"s-add-product-button-with-sticky-bar":this.supportStickyBar,"s-add-product-button-with-apple-pay":this.showQuickBuy&&this.isApplePayActive}},h("div",{class:{"s-add-product-button-main":this.showQuickBuy,"w-full":!document.getElementById("fast-checkout-js")||["financial_support","donating"].includes(this.productType)}},h("salla-button",Object.assign({color:this.productStatus==="sale"?"primary":"light",type:"button",fill:this.productStatus==="sale"?"solid":"outline",ref:function(t){return e.btn=t},onClick:function(t){return e.addProductToCart(t)},disabled:this.productStatus!=="sale"},this.getBtnAttributes(),{"loader-position":"center"}),h("slot",null)),this.showQuickBuy&&!!document.getElementById("fast-checkout-js")&&["financial_support","donating"].includes(this.productType)?this.miniCheckoutWidget():""),this.showQuickBuy&&this.isApplePayActive?h("salla-quick-buy",Object.assign({},this.getQuickBuyBtnAttributes())):"")};e.prototype.componentDidLoad=function(){var e=this;if(!this.notifyOptionsAvailability){return}salla.event.on("product-options::change",(function(t){return __awaiter(e,void 0,void 0,(function(){var e,i,n,a,r,o;var s=this;return __generator(this,(function(l){switch(l.label){case 0:if(!["thumbnail","color","single-option"].includes(t.option.type)){return[2]}this.hasSubscribedOptions=false;n=this;return[4,(e=document.querySelector('salla-product-options[product-id="'.concat(this.productId,'"]')))===null||e===void 0?void 0:e.getSelectedOptions()];case 1:n.selectedOptions=l.sent();a=this;return[4,(i=document.querySelector('salla-product-options[product-id="'.concat(this.productId,'"]')))===null||i===void 0?void 0:i.hasOutOfStockOption()];case 2:a.hasOutOfStockOption=l.sent();r=salla.storage.get("product-".concat(this.productId,"-subscribed-options"));if(!r&&!this.subscribedOptions||!this.hasOutOfStockOption){return[2]}if(salla.config.isGuest()){o=r?r.map((function(e){return e.split(",").map((function(e){return parseInt(e)}))})):[];this.hasSubscribedOptions=o.length>0&&o.some((function(e){return e.every((function(e){return s.selectedOptions.some((function(t){return t.id===e}))}))}))}else{this.hasSubscribedOptions=this.subscribedOptions&&this.subscribedOptions!=="null"&&this.subscribedOptions!=="[]"?JSON.parse(this.subscribedOptions).some((function(e){return e.every((function(e){return s.selectedOptions.some((function(t){return t.id===e}))}))})):false}return[2]}}))}))}))};e.prototype.componentDidRender=function(){var e=this;var t,i;if(!!this.passedLabel&&(!this.supportStickyBar||window.innerWidth>=768)){(t=this.btn)===null||t===void 0?void 0:t.setText(this.passedLabel);return}(i=this.btn)===null||i===void 0?void 0:i.setText(this.getLabel());salla.lang.onLoaded((function(){var t;return(t=e.btn)===null||t===void 0?void 0:t.setText(e.getLabel())}))};Object.defineProperty(e.prototype,"host",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();SallaAddProductButton.style=sallaAddProductButtonCss;var infoIcon='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>info</title>\n<path d="M16 13.333c-0.737 0-1.333 0.596-1.333 1.333v9.333c0 0.737 0.596 1.333 1.333 1.333s1.333-0.596 1.333-1.333v-9.333c0-0.737-0.596-1.333-1.333-1.333zM16 7.987c-0.737 0-1.333 0.596-1.333 1.333v0.013c0 0.737 0.596 1.327 1.333 1.327s1.333-0.603 1.333-1.34-0.596-1.333-1.333-1.333zM16 0c-8.823 0-16 7.177-16 16s7.177 16 16 16 16-7.177 16-16-7.177-16-16-16zM16 29.333c-7.352 0-13.333-5.981-13.333-13.333s5.981-13.333 13.333-13.333 13.333 5.981 13.333 13.333-5.981 13.333-13.333 13.333z"></path>\n</svg>\n';var shoppingBag='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>shopping-bag2</title>\n<path d="M29.2 8.133c0 0 0-0.133-0.133-0.133 0 0 0-0.133-0.133-0.133l-4-5.333c-0.133-0.4-0.533-0.533-0.933-0.533h-16c-0.4 0-0.8 0.133-1.067 0.533l-4 5.333c0 0 0 0.133-0.133 0.133 0 0 0 0.133-0.133 0.133 0 0.267 0 0.4 0 0.533v18.667c0 2.267 1.733 4 4 4h18.667c2.267 0 4-1.733 4-4v-18.667c0-0.133 0-0.267-0.133-0.533zM8.667 4.667h14.667l2 2.667h-18.667l2-2.667zM25.333 28.667h-18.667c-0.8 0-1.333-0.533-1.333-1.333v-17.333h21.333v17.333c0 0.8-0.533 1.333-1.333 1.333zM21.333 12.667c-0.8 0-1.333 0.533-1.333 1.333 0 2.267-1.733 4-4 4s-4-1.733-4-4c0-0.8-0.533-1.333-1.333-1.333s-1.333 0.533-1.333 1.333c0 3.733 2.933 6.667 6.667 6.667s6.667-2.933 6.667-6.667c0-0.8-0.533-1.333-1.333-1.333z"></path>\n</svg>\n';var sallaBottomAlertCss=":host{display:block}";var SallaBottomAlert=function(){function e(e){var t=this;registerInstance(this,e);this.storeId=salla.config.get("store.id");this.template=salla.config.get("store.template");this.loading=false;this.templateData={};this.defaultMessage=salla.lang.get("common.elements.experimental_and_available_store");this.defaultActionLabel=salla.lang.get("common.elements.know_more");this.storeFeatures=salla.lang.get("common.elements.store_features");this.storeDetails=salla.lang.get("common.elements.store_details");this.storePrice=salla.lang.getWithDefault("common.elements.store_price","سعر المتجر");this.theDeveloper=salla.lang.get("common.elements.the_developer");this.templateInformation=salla.lang.get("common.elements.template_information");this.buyTheTemplate=salla.lang.get("common.elements.buy_the_template");this.isRtl=salla.config.get("theme.is_rtl",true);this.type="popup";this.icon=undefined;this.message=undefined;this.actionUrl=undefined;this.actionLabel=undefined;salla.lang.onLoaded((function(){t.defaultMessage=salla.lang.get("common.elements.experimental_and_available_store");t.defaultActionLabel=salla.lang.get("common.elements.know_more");t.storeFeatures=salla.lang.get("common.elements.store_features");t.storeDetails=salla.lang.get("common.elements.store_details");t.templateInformation=salla.lang.get("common.elements.template_information");t.buyTheTemplate=salla.lang.get("common.elements.buy_the_template");salla.helpers.setNested(salla.lang.messages["ar.trans"],"common.elements.store_price","سعر المتجر");salla.helpers.setNested(salla.lang.messages["en.trans"],"common.elements.store_price","Store Price");salla.helpers.setNested(salla.lang.messages["ar.trans"],"common.elements.the_developer","المطور");salla.helpers.setNested(salla.lang.messages["en.trans"],"common.elements.the_developer","the developer");setTimeout((function(){t.storePrice=salla.lang.get("common.elements.store_price");t.theDeveloper=salla.lang.get("common.elements.the_developer")}),100)}))}e.prototype.open=function(){var e=this;return this.modal.open().then((function(){return e.handleTemplateRequest()}))};e.prototype.getDefaultMessage=function(){return this.isRtl?this.defaultMessage.substring(0,this.defaultMessage.lastIndexOf(" ")):this.defaultMessage.split(" ").slice(0,-2).join(" ")};e.prototype.handleTemplateRequest=function(){var e=this;if(Object.keys(this.templateData).length){return}this.modal.loading();return salla.api.request("/store/template",{},"get",{"Store-Identifier":this.storeId}).then((function(t){e.modal.setTitle(e.templateInformation);e.templateData=t.data;e.modal.stopLoading()})).catch((function(){e.modal.close()}))};e.prototype.handleAction=function(){if(this.type==="link"){window.location.href=this.actionUrl}if(this.type==="popup"){this.open()}};e.prototype.popup=function(){var e=this;var t,i,n,a,r,o,s,l,c,u,d,p,f,g,m,v,_;return h("salla-modal",{class:"s-bottom-alert-modal",ref:function(t){return e.modal=t},"no-padding":true},Object.keys(this.templateData).length?[h("div",{class:"s-bottom-alert-modal-inner s-scrollbar"},Array.isArray((t=this.templateData)===null||t===void 0?void 0:t.screenshots)&&((n=(i=this.templateData)===null||i===void 0?void 0:i.screenshots)===null||n===void 0?void 0:n.length)?h("div",{class:"s-bottom-alert-modal-cover"},h("img",{src:(a=this.templateData)===null||a===void 0?void 0:a.screenshots[0],alt:""})):"",h("div",{class:{"s-bottom-alert-modal-content":true,"s-bottom-alert-modal-content-extra-padding":this.templateData.price}},((r=this.templateData)===null||r===void 0?void 0:r.description)?[h("div",{class:"s-bottom-alert-modal-content-title"},this.storeDetails),h("div",{class:"s-bottom-alert-modal-content-description",innerHTML:(o=this.templateData)===null||o===void 0?void 0:o.description}),h("hr",null)]:"",((s=this.templateData)===null||s===void 0?void 0:s.features)?[h("div",{class:"s-bottom-alert-modal-content-title"},this.storeFeatures),h("div",{class:"s-bottom-alert-modal-content-features",innerHTML:(l=this.templateData)===null||l===void 0?void 0:l.features})]:"",Array.isArray((c=this.templateData)===null||c===void 0?void 0:c.screenshots)&&((d=(u=this.templateData)===null||u===void 0?void 0:u.screenshots)===null||d===void 0?void 0:d.length)>1?h("salla-slider",{id:"template-screenshots",type:"carousel",class:"s-bottom-alert-modal-content-screenshots"},h("div",{slot:"items"},(p=this.templateData)===null||p===void 0?void 0:p.screenshots.map((function(e){return h("div",{class:"s-bottom-alert-modal-content-screenshot"},h("img",{src:e,alt:""}))})))):"",((f=this.templateData)===null||f===void 0?void 0:f.extra_info)?h("div",{class:"s-bottom-alert-modal-content-description",innerHTML:(g=this.templateData)===null||g===void 0?void 0:g.description}):""),((m=this.templateData)===null||m===void 0?void 0:m.link)?h("div",{class:"s-bottom-alert-modal-content-footer"},this.templateData.price&&h("div",{class:"s-bottom-alert-modal-price-wrapper"},h("div",null,this.storePrice),h("div",{class:"s-bottom-alert-modal-price-wrapper-amount"},salla.money((v=this.templateData)===null||v===void 0?void 0:v.price))),h("salla-button",{color:"primary",size:"medium",width:"wide",href:(_=this.templateData)===null||_===void 0?void 0:_.link},h("i",{innerHTML:shoppingBag}),this.buyTheTemplate)):"")]:"")};e.prototype.render=function(){var e=this;var t=this.template&&typeof this.template==="object"&&Object.keys(this.template).length>0;var i=t&&this.template.developer;var n=i!==undefined;var a=n&&(i===null||i===void 0?void 0:i.name);var r=null;return h(Host,{class:"s-bottom-alert-wrapper"},h("div",{class:"s-bottom-alert-content"},h("div",{class:"s-bottom-alert-icon"},this.icon?h("i",{class:this.icon}):h("i",{innerHTML:infoIcon})),h("div",{class:"s-bottom-alert-message"},this.message?this.message:t?h("span",null,this.getDefaultMessage()," ",h("a",{href:"#",class:{"s-bottom-alert-message-highlight":true,"s-bottom-alert-message-link":r},target:"","aria-label":"Developer"},a?a:this.theDeveloper)," ",h("span",{class:"s-bottom-alert-message-splitter"},"|")," ",this.storePrice,":"," ",h("span",{class:"s-bottom-alert-message-highlight"},salla.money(this.template.price))):this.defaultMessage),this.type!=="banner"&&h("div",{class:"s-bottom-alert-action"},h("salla-button",{href:this.actionUrl,size:"medium",onClick:function(){return e.handleAction()},width:"normal"},this.actionLabel||this.defaultActionLabel)),this.type==="popup"&&this.popup()))};Object.defineProperty(e.prototype,"host",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();SallaBottomAlert.style=sallaBottomAlertCss;var ArrowLeftIcon='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>keyboard_arrow_left</title>\n<path d="M20.563 22.104l-1.875 1.875-8-8 8-8 1.875 1.875-6.125 6.125z"></path>\n</svg>\n';var ArrowRightIcon='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>keyboard_arrow_right</title>\n<path d="M11.438 22.479l6.125-6.125-6.125-6.125 1.875-1.875 8 8-8 8z"></path>\n</svg>\n';var sallaBreadcrumbCss=":host{display:block}";var SallaBreadcrumb=function(){function e(e){registerInstance(this,e);var t,i;this.breadcrumbs=undefined;this.itemSlot=((t=this.host.querySelector('[slot="item"]'))===null||t===void 0?void 0:t.outerHTML)||'<li class="s-breadcrumb-item"><a href={url}>{title}</a></li>';this.iconSlot=(i=this.host.querySelector('[slot="icon"]'))===null||i===void 0?void 0:i.outerHTML}e.prototype.componentWillLoad=function(){var e=this;return new Promise((function(e){return salla.onReady((function(){return salla.lang.onLoaded(e)}))})).then((function(){if(salla.url.is_page("index")){throw new Error("salla-breadcrumb:: breadcrumb not supported on home page")}})).then((function(){if(!salla.config.get("theme.settings.is_breadcrumbs_enabled",true)){throw new Error("salla-breadcrumb:: merchant disabled the feature")}})).then((function(){var t=salla.config.get("page");if(!t||!t.slug){salla.logger.error('salla-breadcrumbs:: page object not existed on salla.config.get("page")!');return[]}if(["product.single","product.index"].includes(t.slug)){return salla.api.navigation.fetchBreadcrumbs({page:t.slug,id:t.id,referrer:document.referrer}).then((function(t){return e.breadcrumbs=t.data}))}e.breadcrumbs=[{title:salla.lang.get("common.titles.home"),url:salla.url.get("")}];if(t.slug.includes("customer")){e.breadcrumbs.push({title:salla.lang.get("common.titles.profile"),url:salla.url.get("profile")})}if(t.slug.includes("blog")){e.breadcrumbs.push({title:salla.lang.get("blocks.footer.blog"),url:salla.url.get("blog")})}if(t.slug=="brands.single"){e.breadcrumbs.push({title:salla.lang.get("common.titles.brands"),url:salla.url.get("brands")})}if(!t.title&&t.slug=="loyalty"){e.breadcrumbs.push({title:salla.lang.get("common.titles.loyalty_program"),url:salla.url.get("loyalty")})}if(t.title&&!["customer.profile","brands.index","blog.index"].includes(t.slug)){e.breadcrumbs.push({title:t.title})}return e.breadcrumbs})).then((function(){return e.breadcrumbs.length&&(e.breadcrumbs[e.breadcrumbs.length-1].is_last=true)})).catch((function(t){salla.logger.error("salla-breadcrumb:: unexpected error!",t);e.breadcrumbs=[]}))};e.prototype.render=function(){var e=this;if(this.breadcrumbs.length<=1){salla.log("salla-breadcrumb:: There is no breadcrumbs!");return}return h("ol",{class:{"s-breadcrumb-wrapper":true,"s-breadcrumb-dark":salla.url.is_page("loyalty"),"s-breadcrumb-primary-reverse":salla.config.get("page.slug").includes("customer")}},this.breadcrumbs.map((function(t){return[h("div",{class:"s-breadcrumb-slot",innerHTML:e.itemSlot.replace(/\{url\}/g,t.url).replace(/\{title\}/g,t.title)}),e.getArrowDomForItem(t)]})))};e.prototype.getArrowDomForItem=function(e){if(e.is_last){return""}var t=this.iconSlot||(salla.config.get("theme.is_rtl",true)?ArrowLeftIcon:ArrowRightIcon);return h("li",{class:"s-breadcrumb-arrow"},h("div",{class:{"s-breadcrumb-icon-slot":true,"s-breadcrumb-default-icon":!this.iconSlot},innerHTML:t}))};e.prototype.componentDidRender=function(){var e,t,i;this.host.querySelectorAll(".s-breadcrumb-slot").forEach((function(e){return e.replaceWith(e.firstChild)}));this.host.querySelectorAll(".s-breadcrumb-icon-slot.s-breadcrumb-default-icon").forEach((function(e){return e.replaceWith(e.querySelector("svg"))}));(e=this.host.querySelector('[slot="item"]'))===null||e===void 0?void 0:e.remove();(t=this.host.querySelector('[slot="icon"]'))===null||t===void 0?void 0:t.remove();var n=(i=this.host.querySelectorAll(".s-breadcrumb-item")[this.breadcrumbs.length-1])===null||i===void 0?void 0:i.querySelector("a");n&&n.replaceWith(n.firstChild)};Object.defineProperty(e.prototype,"host",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();SallaBreadcrumb.style=sallaBreadcrumbCss;var sallaButtonCss="";var SallaButton=function(){function e(e){registerInstance(this,e);this.hostAttributes={};this.shape="btn";this.color="primary";this.fill="solid";this.size="medium";this.width="normal";this.loading=false;this.disabled=false;this.loaderPosition="after";this.href=undefined;this.type="button"}e.prototype.load=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){if(this.loaderPosition=="center")this.text.classList.add("s-button-hide");this.host.setAttribute("loading","");return[2,this.host]}))}))};e.prototype.stop=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.host.removeAttribute("loading");this.host.querySelector("button").removeAttribute("loading");if(this.loaderPosition=="center")this.text.classList.remove("s-button-hide");return[2,this.host]}))}))};e.prototype.setText=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.text.innerHTML=e;return[2,this.host]}))}))};e.prototype.disable=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.host.setAttribute("disabled","");return[2,this.host]}))}))};e.prototype.enable=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.host.removeAttribute("disabled");return[2,this.host]}))}))};e.prototype.getBtnAttributes=function(){for(var e=0;e<this.host.attributes.length;e++){if(!["color","fill","size","width","id"].includes(this.host.attributes[e].name)){this.hostAttributes[this.host.attributes[e].name]=this.host.attributes[e].value}}this.hostAttributes.type=this.hostAttributes.type||this.type;this.hostAttributes.class+=" s-button-element s-button-"+this.shape+" s-button-"+(this.fill=="none"?"fill-none":this.fill)+(this.size!="medium"?" s-button-"+this.size:"")+(this.width!="normal"?" s-button-"+this.width:"")+(this.shape=="link"?" s-button-"+this.color+"-link":"")+(this.shape!="link"&&this.fill!="outline"?" s-button-"+this.color:"")+(this.fill=="outline"?" s-button-"+this.color+"-outline":"")+(this.disabled?" s-button-disabled ":"")+(this.shape=="icon"?" s-button-loader-center":" s-button-loader-"+this.loaderPosition);return this.hostAttributes};e.prototype.button=function(){var e=this;return h("button",Object.assign({},this.getBtnAttributes(),{disabled:this.disabled}),h("span",{class:"s-button-text",ref:function(t){return e.text=t}},h("slot",null)),this.loading?h("span",{class:"s-button-loader"}):"")};e.prototype.render=function(){var e;return((e=this.host.closest(".swiper-slide"))===null||e===void 0?void 0:e.classList.contains("swiper-slide-duplicate"))?"":h(Host,{class:"s-button-wrap"},this.href?h("a",{href:this.href},this.button()):this.button())};Object.defineProperty(e.prototype,"host",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();SallaButton.style=sallaButtonCss;var sallaCartSummaryCss="";var SallaCartSummary=function(){function e(e){var t=this;registerInstance(this,e);this.cartSummaryCount=salla.storage.get("cart.summary.count")||0;this.cartSummaryTotal=salla.storage.get("cart.summary.total")||0;this.cartLabel=salla.config.get("user.language_code")==="ar"?"السلة":"Cart";this.showCartLabel=undefined;salla.cart.event.onUpdated((function(e){t.cartSummaryCount=e.count||0;t.cartSummaryTotal=e.total||0}))}e.prototype.animateToCart=function(e){return __awaiter(this,void 0,void 0,(function(){var t,i,n,a,r,o,s,l,c,u,d,p;return __generator(this,(function(h){document.querySelectorAll(".s-cart-thumb").forEach((function(e){return e.remove()}));if(!(e===null||e===void 0?void 0:e.src)){salla.log("Failed to get the img element");return[2]}t=this.host.querySelector("#s-cart-icon"),i=t.getBoundingClientRect(),n=i.top+window.scrollY,a=i.left+window.scrollX;r=e.getBoundingClientRect(),o=e.offsetWidth+"px",s=e.offsetHeight+"px",l=r.top,c=r.left;u=document.createElement("img");u.src=e.getAttribute("src");u.className="s-cart-thumb";u.setAttribute("style","object-fit:cover; width:"+o+"; height:"+s+"; top:"+l+"px; left:"+c+"px;z-index:99999999; ");document.body.append(u);d=document.querySelector(".s-cart-thumb");t.classList.remove("animated","rubberBand");p=new anime.timeline;p.add({targets:d,width:[150,30],height:[150,30],top:[l,window.scrollY>0?n-window.scrollY-40:n-40],left:[c,a],borderRadius:["20%","50%"],easing:"easeOutExpo",duration:1200},"+=200").add({targets:d,width:[30,0],height:[30,0],opacity:[1,0],easing:"easeOutExpo",top:[window.scrollY>0?n-window.scrollY-40:n-40,window.scrollY>0?n-window.scrollY+10:n+10],left:[a,a+10]},"-=500").add({complete:function(){t.classList.add("animated","rubberBand");d.remove()}},"-=1700");return[2]}))}))};e.prototype.componentWillLoad=function(){return new Promise((function(e){return salla.onReady(e)}))};e.prototype.render=function(){return h(Host,null,h("a",{class:"s-cart-summary-wrapper",href:salla.url.get("cart")},h("div",{id:"s-cart-icon"},h("slot",{name:"icon"},h("i",{class:"s-cart-summary-icon",innerHTML:PendingOrdersIcon}))),h("span",{class:"s-cart-summary-count"},salla.helpers.number(this.cartSummaryCount)),h("p",{class:"s-cart-summary-content"},this.showCartLabel&&h("span",{class:"s-cart-summary-label"},this.cartLabel),h("b",{class:"s-cart-summary-total"},salla.money(this.cartSummaryTotal)))))};Object.defineProperty(e.prototype,"host",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();SallaCartSummary.style=sallaCartSummaryCss;
4
+ */import{r as registerInstance,c as createEvent,h,H as Host,g as getElement,F as Fragment}from"./index-114c614f.js";import{a as anime}from"./anime.es-6b92d9cd.js";import{C as CheckCircleIcon}from"./check-838f37a7.js";import{H as Helper}from"./Helper-bf538e34.js";import{a as createCommonjsModule,c as commonjsGlobal,g as getDefaultExportFromCjs}from"./_commonjsHelpers-1415ffd3.js";import{a as arrowLeft}from"./arrow-left-3ba30fe6.js";import{C as CameraIcon}from"./camera-d0a93c12.js";import{a as arrowRight}from"./arrow-right-d925a796.js";import{e as email}from"./mail-25533e3f.js";import{f as facebook,t as twitter}from"./twitter-0da90a1e.js";var PendingOrdersIcon='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="30" height="32" viewBox="0 0 30 32">\n<title>cart</title>\n<path d="M15.426 28.084c0-1.412-0.85-2.684-2.156-3.226-1.305-0.54-2.807-0.241-3.805 0.758-0.999 0.998-1.298 2.5-0.758 3.805 0.54 1.303 1.815 2.155 3.226 2.155 1.928-0.003 3.49-1.564 3.492-3.492h0.001zM10.597 28.084h0.001c0-0.54 0.326-1.027 0.825-1.235 0.498-0.206 1.074-0.091 1.455 0.29 0.383 0.382 0.497 0.957 0.29 1.456-0.208 0.5-0.695 0.825-1.235 0.825-0.355 0-0.695-0.142-0.944-0.391-0.251-0.251-0.392-0.591-0.392-0.946h-0.001l0.001 0.001zM28.23 28.084c0-1.412-0.85-2.684-2.155-3.226-1.305-0.54-2.807-0.241-3.806 0.758s-1.297 2.5-0.756 3.805c0.54 1.303 1.813 2.155 3.226 2.155 1.927-0.003 3.49-1.564 3.491-3.492zM23.401 28.084c0-0.54 0.326-1.027 0.825-1.235 0.5-0.206 1.075-0.091 1.457 0.29s0.497 0.957 0.289 1.456c-0.206 0.5-0.693 0.825-1.233 0.825-0.738 0-1.337-0.599-1.337-1.337l-0.001 0.001zM1.953 0.234l-0.342-0.059c-0.29-0.064-0.594-0.004-0.839 0.166-0.247 0.169-0.414 0.436-0.463 0.734-0.050 0.3 0.023 0.607 0.201 0.85s0.444 0.402 0.738 0.44l0.341 0.059c1.825 0.324 3.248 1.794 3.548 3.662l1.981 12.369h-0.001c0.218 1.387 0.913 2.651 1.96 3.563s2.379 1.412 3.754 1.41h14.242c0.601 0 1.088-0.498 1.088-1.112s-0.487-1.112-1.088-1.112h-14.242c-1.679-0.001-3.139-1.183-3.525-2.854h11.463c1.614 0.004 3.188-0.518 4.493-1.49 1.305-0.973 2.271-2.346 2.762-3.918l1.298-4.136c0.145-0.455 0.065-0.953-0.213-1.336-0.278-0.385-0.72-0.608-1.187-0.602h-20.467l-0.181-1.141c-0.218-1.367-0.849-2.631-1.802-3.615-0.954-0.983-2.184-1.64-3.518-1.878h-0.001zM26.946 9.096l-0.993 3.169v-0.001c-0.353 1.122-1.044 2.101-1.975 2.796s-2.056 1.067-3.208 1.067h-11.833l-1.125-7.042 19.134 0.011z"></path>\n</svg>\n';var WalletIcon='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>full-wallet</title>\n<path d="M29 12h-26c-0.668-0.008-1.284-0.226-1.787-0.59l0.009 0.006c-0.744-0.552-1.222-1.428-1.222-2.416 0-1.657 1.343-3 2.999-3h6c0.552 0 1 0.448 1 1s-0.448 1-1 1v0h-6c-0.552 0-1 0.448-1 1 0 0.326 0.156 0.616 0.397 0.798l0.002 0.002c0.167 0.12 0.374 0.194 0.599 0.2l0.001 0h26c0.552 0 1 0.448 1 1s-0.448 1-1 1v0zM27 12c-0.552 0-1-0.448-1-1v0-3h-3c-0.552 0-1-0.448-1-1s0.448-1 1-1v0h4c0.552 0 1 0.448 1 1v0 4c0 0.552-0.448 1-1 1v0zM29 30h-26c-1.657 0-3-1.343-3-3v0-18c0-0.552 0.448-1 1-1s1 0.448 1 1v0 18c0 0.552 0.448 1 1 1v0h25v-5c0-0.552 0.448-1 1-1s1 0.448 1 1v0 6c0 0.552-0.448 1-1 1v0zM29 18c-0.552 0-1-0.448-1-1v0-6c0-0.552 0.448-1 1-1s1 0.448 1 1v0 6c0 0.552-0.448 1-1 1v0zM31 24h-7c-2.209 0-4-1.791-4-4s1.791-4 4-4v0h7c0.552 0 1 0.448 1 1v0 6c0 0.552-0.448 1-1 1v0zM24 18c-1.105 0-2 0.895-2 2s0.895 2 2 2v0h6v-4zM25 12c-0.001 0-0.001 0-0.002 0-0.389 0-0.726-0.222-0.891-0.546l-0.003-0.006-3.552-7.106-2.306 1.152c-0.13 0.066-0.284 0.105-0.447 0.105-0.552 0-1-0.448-1-1 0-0.39 0.223-0.727 0.548-0.892l0.006-0.003 3.2-1.6c0.13-0.067 0.284-0.106 0.447-0.106 0.39 0 0.727 0.223 0.892 0.548l0.003 0.006 4 8c0.067 0.13 0.106 0.285 0.106 0.448 0 0.552-0.448 1-1 1v0zM21 12c-0.001 0-0.001 0-0.002 0-0.389 0-0.726-0.222-0.891-0.546l-0.003-0.006-3.552-7.106-15.104 7.552c-0.13 0.066-0.284 0.105-0.447 0.105-0.552 0-1-0.448-1-1 0-0.39 0.223-0.727 0.548-0.892l0.006-0.003 16-8c0.13-0.067 0.284-0.106 0.447-0.106 0.39 0 0.727 0.223 0.892 0.548l0.003 0.006 4 8c0.067 0.13 0.106 0.285 0.106 0.448 0 0.552-0.448 1-1 1-0.001 0-0.001 0-0.002 0h0z"></path>\n</svg>\n';var sallaAddProductButtonCss=":host{display:block}salla-add-product-button[width=wide]{width:100%}";var SallaAddProductButton=function(){function e(e){var t=this;registerInstance(this,e);this.success=createEvent(this,"success",7);this.failed=createEvent(this,"failed",7);this.hostAttributes={};this.channels=undefined;this.subscribedOptions=undefined;this.quickBuy=undefined;this.quantity=undefined;this.donatingAmount=undefined;this.notifyOptionsAvailability=undefined;this.productId=undefined;this.supportStickyBar=undefined;this.productStatus="sale";this.productType="product";this.hasOutOfStockOption=undefined;this.hasSubscribedOptions=undefined;this.selectedOptions=[];this.showQuickBuy=undefined;this.isApplePayActive=undefined;this.buyNowText=salla.lang.get("pages.products.buy_now");salla.lang.onLoaded((function(){t.buyNowText=salla.lang.get("pages.products.buy_now")}))}e.prototype.getLabel=function(){if(this.productStatus==="sale"&&this.supportStickyBar&&window.innerWidth<=768&&this.showQuickBuy&&this.isApplePayActive){return PendingOrdersIcon}if(this.productStatus==="sale"&&this.productType==="booking"){return salla.lang.get("pages.cart.book_now")}if(this.productStatus==="sale"){return salla.lang.get("pages.cart.add_to_cart")}if(this.productType!=="donating"){return salla.lang.get("pages.products.out_of_stock")}return salla.lang.get("pages.products.donation_exceed")};e.prototype.addProductToCart=function(e){var t=this;var i;if(this.productType==="booking"){e.preventDefault();return this.addBookingProduct()}if(this.hostAttributes.type==="submit"){return false}e.preventDefault();(i=this.btn)===null||i===void 0?void 0:i.disable();var n=Object.entries({id:this.productId,donation_amount:this.donatingAmount,quantity:this.quantity,endpoint:"quickAdd"}).reduce((function(e,t){var i=t[0],n=t[1];return n?(e[i]=n,e):e}),{});return salla.cart.addItem(n).then((function(e){var i;t.selectedOptions=[];(i=t.btn)===null||i===void 0?void 0:i.enable();t.success.emit(e)})).catch((function(e){var i;t.failed.emit(e);(i=t.btn)===null||i===void 0?void 0:i.enable()}))};e.prototype.addBookingProduct=function(){var e=this;if(salla.config.isGuest()){salla.auth.api.setAfterLoginEvent("booking::add",this.productId);salla.event.dispatch("login::open");return}return salla.booking.add(this.productId).then((function(t){return e.success.emit(t)})).catch((function(t){return e.failed.emit(t)}))};e.prototype.getBtnAttributes=function(){for(var e=0;e<this.host.attributes.length;e++){if(!["id","class"].includes(this.host.attributes[e].name)){this.hostAttributes[this.host.attributes[e].name]=this.host.attributes[e].value}}return this.hostAttributes};e.prototype.getQuickBuyBtnAttributes=function(){return Object.assign(Object.assign({},this.getBtnAttributes()),{type:this.supportStickyBar&&window.innerWidth<=768?"plain":this.productType=="donating"?"donate":"buy"})};e.prototype.miniCheckoutWidget=function(){var e=salla.config.get("store.id");if(!e){return}return h("salla-mini-checkout-widget",{language:salla.lang.locale,"store-id":e,config:{user:salla.config.get("user")},products:[this.productId],api:salla.config.get("store.api"),outline:true,"form-selector":"form.product-form",class:"s-add-product-button-mini-checkout"},h("div",{slot:"widget-label",class:"s-add-product-button-mini-checkout-content"},h("span",{innerHTML:WalletIcon}),this.buyNowText))};e.prototype.componentWillLoad=function(){var e=this;return salla.onReady().then((function(){var t,i,n;e.showQuickBuy=e.quickBuy&&salla.config.get("store.settings.buy_now")&&e.productStatus=="sale"&&e.productType!=="booking";e.isApplePayActive=((t=window.ApplePaySession)===null||t===void 0?void 0:t.canMakePayments())&&((i=salla.config.get("store.settings.payments"))===null||i===void 0?void 0:i.includes("apple_pay"))&&salla.config.get("store.settings.is_salla_gateway",false);e.passedLabel=e.host.innerHTML.replace("\x3c!----\x3e","").trim();if(!!e.passedLabel&&window.innerWidth>=768){return(n=e.btn)===null||n===void 0?void 0:n.setText(e.passedLabel)}if(e.host.getAttribute("type")==="submit"&&e.supportStickyBar){window.addEventListener("resize",(function(){var t;return(t=e.btn)===null||t===void 0?void 0:t.setText(window.innerWidth>=768&&!!e.passedLabel?e.passedLabel:e.getLabel())}))}}))};e.prototype.render=function(){var e=this;var t;if((t=this.host.closest(".swiper-slide"))===null||t===void 0?void 0:t.classList.contains("swiper-slide-duplicate")){return""}if(this.hasSubscribedOptions){return h(Host,null,h("salla-product-availability",Object.assign({},this.getBtnAttributes(),{"is-subscribed":true}),h("span",{class:"s-hidden"},h("slot",null))))}if(this.productStatus==="out-and-notify"&&this.channels||this.hasOutOfStockOption){return h(Host,null,h("salla-product-availability",Object.assign({},this.getBtnAttributes()),h("span",{class:"s-hidden"},h("slot",null))))}return h(Host,{class:{"s-add-product-button-with-quick-buy":this.showQuickBuy,"s-add-product-button-with-sticky-bar":this.supportStickyBar,"s-add-product-button-with-apple-pay":this.showQuickBuy&&this.isApplePayActive}},h("div",{class:{"s-add-product-button-main":this.showQuickBuy,"w-full":!document.getElementById("fast-checkout-js")||["financial_support","donating"].includes(this.productType)}},h("salla-button",Object.assign({color:this.productStatus==="sale"?"primary":"light",type:"button",fill:this.productStatus==="sale"?"solid":"outline",ref:function(t){return e.btn=t},onClick:function(t){return e.addProductToCart(t)},disabled:this.productStatus!=="sale"},this.getBtnAttributes(),{"loader-position":"center"}),h("slot",null)),this.showQuickBuy&&!!document.getElementById("fast-checkout-js")&&!["financial_support","donating"].includes(this.productType)?this.miniCheckoutWidget():""),this.showQuickBuy&&this.isApplePayActive?h("salla-quick-buy",Object.assign({},this.getQuickBuyBtnAttributes())):"")};e.prototype.componentDidLoad=function(){var e=this;if(!this.notifyOptionsAvailability){return}salla.event.on("product-options::change",(function(t){return __awaiter(e,void 0,void 0,(function(){var e,i,n,a,r,o;var s=this;return __generator(this,(function(l){switch(l.label){case 0:if(!["thumbnail","color","single-option"].includes(t.option.type)){return[2]}this.hasSubscribedOptions=false;n=this;return[4,(e=document.querySelector('salla-product-options[product-id="'.concat(this.productId,'"]')))===null||e===void 0?void 0:e.getSelectedOptions()];case 1:n.selectedOptions=l.sent();a=this;return[4,(i=document.querySelector('salla-product-options[product-id="'.concat(this.productId,'"]')))===null||i===void 0?void 0:i.hasOutOfStockOption()];case 2:a.hasOutOfStockOption=l.sent();r=salla.storage.get("product-".concat(this.productId,"-subscribed-options"));if(!r&&!this.subscribedOptions||!this.hasOutOfStockOption){return[2]}if(salla.config.isGuest()){o=r?r.map((function(e){return e.split(",").map((function(e){return parseInt(e)}))})):[];this.hasSubscribedOptions=o.length>0&&o.some((function(e){return e.every((function(e){return s.selectedOptions.some((function(t){return t.id===e}))}))}))}else{this.hasSubscribedOptions=this.subscribedOptions&&this.subscribedOptions!=="null"&&this.subscribedOptions!=="[]"?JSON.parse(this.subscribedOptions).some((function(e){return e.every((function(e){return s.selectedOptions.some((function(t){return t.id===e}))}))})):false}return[2]}}))}))}))};e.prototype.componentDidRender=function(){var e=this;var t,i;if(!!this.passedLabel&&(!this.supportStickyBar||window.innerWidth>=768)){(t=this.btn)===null||t===void 0?void 0:t.setText(this.passedLabel);return}(i=this.btn)===null||i===void 0?void 0:i.setText(this.getLabel());salla.lang.onLoaded((function(){var t;return(t=e.btn)===null||t===void 0?void 0:t.setText(e.getLabel())}))};Object.defineProperty(e.prototype,"host",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();SallaAddProductButton.style=sallaAddProductButtonCss;var infoIcon='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>info</title>\n<path d="M16 13.333c-0.737 0-1.333 0.596-1.333 1.333v9.333c0 0.737 0.596 1.333 1.333 1.333s1.333-0.596 1.333-1.333v-9.333c0-0.737-0.596-1.333-1.333-1.333zM16 7.987c-0.737 0-1.333 0.596-1.333 1.333v0.013c0 0.737 0.596 1.327 1.333 1.327s1.333-0.603 1.333-1.34-0.596-1.333-1.333-1.333zM16 0c-8.823 0-16 7.177-16 16s7.177 16 16 16 16-7.177 16-16-7.177-16-16-16zM16 29.333c-7.352 0-13.333-5.981-13.333-13.333s5.981-13.333 13.333-13.333 13.333 5.981 13.333 13.333-5.981 13.333-13.333 13.333z"></path>\n</svg>\n';var shoppingBag='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>shopping-bag2</title>\n<path d="M29.2 8.133c0 0 0-0.133-0.133-0.133 0 0 0-0.133-0.133-0.133l-4-5.333c-0.133-0.4-0.533-0.533-0.933-0.533h-16c-0.4 0-0.8 0.133-1.067 0.533l-4 5.333c0 0 0 0.133-0.133 0.133 0 0 0 0.133-0.133 0.133 0 0.267 0 0.4 0 0.533v18.667c0 2.267 1.733 4 4 4h18.667c2.267 0 4-1.733 4-4v-18.667c0-0.133 0-0.267-0.133-0.533zM8.667 4.667h14.667l2 2.667h-18.667l2-2.667zM25.333 28.667h-18.667c-0.8 0-1.333-0.533-1.333-1.333v-17.333h21.333v17.333c0 0.8-0.533 1.333-1.333 1.333zM21.333 12.667c-0.8 0-1.333 0.533-1.333 1.333 0 2.267-1.733 4-4 4s-4-1.733-4-4c0-0.8-0.533-1.333-1.333-1.333s-1.333 0.533-1.333 1.333c0 3.733 2.933 6.667 6.667 6.667s6.667-2.933 6.667-6.667c0-0.8-0.533-1.333-1.333-1.333z"></path>\n</svg>\n';var sallaBottomAlertCss=":host{display:block}";var SallaBottomAlert=function(){function e(e){var t=this;registerInstance(this,e);this.storeId=salla.config.get("store.id");this.template=salla.config.get("store.template");this.loading=false;this.templateData={};this.defaultMessage=salla.lang.get("common.elements.experimental_and_available_store");this.defaultActionLabel=salla.lang.get("common.elements.know_more");this.storeFeatures=salla.lang.get("common.elements.store_features");this.storeDetails=salla.lang.get("common.elements.store_details");this.storePrice=salla.lang.getWithDefault("common.elements.store_price","سعر المتجر");this.theDeveloper=salla.lang.get("common.elements.the_developer");this.templateInformation=salla.lang.get("common.elements.template_information");this.buyTheTemplate=salla.lang.get("common.elements.buy_the_template");this.isRtl=salla.config.get("theme.is_rtl",true);this.type="popup";this.icon=undefined;this.message=undefined;this.actionUrl=undefined;this.actionLabel=undefined;salla.lang.onLoaded((function(){t.defaultMessage=salla.lang.get("common.elements.experimental_and_available_store");t.defaultActionLabel=salla.lang.get("common.elements.know_more");t.storeFeatures=salla.lang.get("common.elements.store_features");t.storeDetails=salla.lang.get("common.elements.store_details");t.templateInformation=salla.lang.get("common.elements.template_information");t.buyTheTemplate=salla.lang.get("common.elements.buy_the_template");salla.helpers.setNested(salla.lang.messages["ar.trans"],"common.elements.store_price","سعر المتجر");salla.helpers.setNested(salla.lang.messages["en.trans"],"common.elements.store_price","Store Price");salla.helpers.setNested(salla.lang.messages["ar.trans"],"common.elements.the_developer","المطور");salla.helpers.setNested(salla.lang.messages["en.trans"],"common.elements.the_developer","the developer");setTimeout((function(){t.storePrice=salla.lang.get("common.elements.store_price");t.theDeveloper=salla.lang.get("common.elements.the_developer")}),100)}))}e.prototype.open=function(){var e=this;return this.modal.open().then((function(){return e.handleTemplateRequest()}))};e.prototype.getDefaultMessage=function(){return this.isRtl?this.defaultMessage.substring(0,this.defaultMessage.lastIndexOf(" ")):this.defaultMessage.split(" ").slice(0,-2).join(" ")};e.prototype.handleTemplateRequest=function(){var e=this;if(Object.keys(this.templateData).length){return}this.modal.loading();return salla.api.request("/store/template",{},"get",{"Store-Identifier":this.storeId}).then((function(t){e.modal.setTitle(e.templateInformation);e.templateData=t.data;e.modal.stopLoading()})).catch((function(){e.modal.close()}))};e.prototype.handleAction=function(){if(this.type==="link"){window.location.href=this.actionUrl}if(this.type==="popup"){this.open()}};e.prototype.popup=function(){var e=this;var t,i,n,a,r,o,s,l,c,u,d,p,f,g,m,v,_;return h("salla-modal",{class:"s-bottom-alert-modal",ref:function(t){return e.modal=t},"no-padding":true},Object.keys(this.templateData).length?[h("div",{class:"s-bottom-alert-modal-inner s-scrollbar"},Array.isArray((t=this.templateData)===null||t===void 0?void 0:t.screenshots)&&((n=(i=this.templateData)===null||i===void 0?void 0:i.screenshots)===null||n===void 0?void 0:n.length)?h("div",{class:"s-bottom-alert-modal-cover"},h("img",{src:(a=this.templateData)===null||a===void 0?void 0:a.screenshots[0],alt:""})):"",h("div",{class:{"s-bottom-alert-modal-content":true,"s-bottom-alert-modal-content-extra-padding":this.templateData.price}},((r=this.templateData)===null||r===void 0?void 0:r.description)?[h("div",{class:"s-bottom-alert-modal-content-title"},this.storeDetails),h("div",{class:"s-bottom-alert-modal-content-description",innerHTML:(o=this.templateData)===null||o===void 0?void 0:o.description}),h("hr",null)]:"",((s=this.templateData)===null||s===void 0?void 0:s.features)?[h("div",{class:"s-bottom-alert-modal-content-title"},this.storeFeatures),h("div",{class:"s-bottom-alert-modal-content-features",innerHTML:(l=this.templateData)===null||l===void 0?void 0:l.features})]:"",Array.isArray((c=this.templateData)===null||c===void 0?void 0:c.screenshots)&&((d=(u=this.templateData)===null||u===void 0?void 0:u.screenshots)===null||d===void 0?void 0:d.length)>1?h("salla-slider",{id:"template-screenshots",type:"carousel",class:"s-bottom-alert-modal-content-screenshots"},h("div",{slot:"items"},(p=this.templateData)===null||p===void 0?void 0:p.screenshots.map((function(e){return h("div",{class:"s-bottom-alert-modal-content-screenshot"},h("img",{src:e,alt:""}))})))):"",((f=this.templateData)===null||f===void 0?void 0:f.extra_info)?h("div",{class:"s-bottom-alert-modal-content-description",innerHTML:(g=this.templateData)===null||g===void 0?void 0:g.description}):""),((m=this.templateData)===null||m===void 0?void 0:m.link)?h("div",{class:"s-bottom-alert-modal-content-footer"},this.templateData.price&&h("div",{class:"s-bottom-alert-modal-price-wrapper"},h("div",null,this.storePrice),h("div",{class:"s-bottom-alert-modal-price-wrapper-amount"},salla.money((v=this.templateData)===null||v===void 0?void 0:v.price))),h("salla-button",{color:"primary",size:"medium",width:"wide",href:(_=this.templateData)===null||_===void 0?void 0:_.link},h("i",{innerHTML:shoppingBag}),this.buyTheTemplate)):"")]:"")};e.prototype.render=function(){var e=this;var t=this.template&&typeof this.template==="object"&&Object.keys(this.template).length>0;var i=t&&this.template.developer;var n=i!==undefined;var a=n&&(i===null||i===void 0?void 0:i.name);var r=null;return h(Host,{class:"s-bottom-alert-wrapper"},h("div",{class:"s-bottom-alert-content"},h("div",{class:"s-bottom-alert-icon"},this.icon?h("i",{class:this.icon}):h("i",{innerHTML:infoIcon})),h("div",{class:"s-bottom-alert-message"},this.message?this.message:t?h("span",null,this.getDefaultMessage()," ",h("a",{href:"#",class:{"s-bottom-alert-message-highlight":true,"s-bottom-alert-message-link":r},target:"","aria-label":"Developer"},a?a:this.theDeveloper)," ",h("span",{class:"s-bottom-alert-message-splitter"},"|")," ",this.storePrice,":"," ",h("span",{class:"s-bottom-alert-message-highlight"},salla.money(this.template.price))):this.defaultMessage),this.type!=="banner"&&h("div",{class:"s-bottom-alert-action"},h("salla-button",{href:this.actionUrl,size:"medium",onClick:function(){return e.handleAction()},width:"normal"},this.actionLabel||this.defaultActionLabel)),this.type==="popup"&&this.popup()))};Object.defineProperty(e.prototype,"host",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();SallaBottomAlert.style=sallaBottomAlertCss;var ArrowLeftIcon='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>keyboard_arrow_left</title>\n<path d="M20.563 22.104l-1.875 1.875-8-8 8-8 1.875 1.875-6.125 6.125z"></path>\n</svg>\n';var ArrowRightIcon='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>keyboard_arrow_right</title>\n<path d="M11.438 22.479l6.125-6.125-6.125-6.125 1.875-1.875 8 8-8 8z"></path>\n</svg>\n';var sallaBreadcrumbCss=":host{display:block}";var SallaBreadcrumb=function(){function e(e){registerInstance(this,e);var t,i;this.breadcrumbs=undefined;this.itemSlot=((t=this.host.querySelector('[slot="item"]'))===null||t===void 0?void 0:t.outerHTML)||'<li class="s-breadcrumb-item"><a href={url}>{title}</a></li>';this.iconSlot=(i=this.host.querySelector('[slot="icon"]'))===null||i===void 0?void 0:i.outerHTML}e.prototype.componentWillLoad=function(){var e=this;return new Promise((function(e){return salla.onReady((function(){return salla.lang.onLoaded(e)}))})).then((function(){if(salla.url.is_page("index")){throw new Error("salla-breadcrumb:: breadcrumb not supported on home page")}})).then((function(){if(!salla.config.get("theme.settings.is_breadcrumbs_enabled",true)){throw new Error("salla-breadcrumb:: merchant disabled the feature")}})).then((function(){var t=salla.config.get("page");if(!t||!t.slug){salla.logger.error('salla-breadcrumbs:: page object not existed on salla.config.get("page")!');return[]}if(["product.single","product.index"].includes(t.slug)){return salla.api.navigation.fetchBreadcrumbs({page:t.slug,id:t.id,referrer:document.referrer}).then((function(t){return e.breadcrumbs=t.data}))}e.breadcrumbs=[{title:salla.lang.get("common.titles.home"),url:salla.url.get("")}];if(t.slug.includes("customer")){e.breadcrumbs.push({title:salla.lang.get("common.titles.profile"),url:salla.url.get("profile")})}if(t.slug.includes("blog")){e.breadcrumbs.push({title:salla.lang.get("blocks.footer.blog"),url:salla.url.get("blog")})}if(t.slug=="brands.single"){e.breadcrumbs.push({title:salla.lang.get("common.titles.brands"),url:salla.url.get("brands")})}if(!t.title&&t.slug=="loyalty"){e.breadcrumbs.push({title:salla.lang.get("common.titles.loyalty_program"),url:salla.url.get("loyalty")})}if(t.title&&!["customer.profile","brands.index","blog.index"].includes(t.slug)){e.breadcrumbs.push({title:t.title})}return e.breadcrumbs})).then((function(){return e.breadcrumbs.length&&(e.breadcrumbs[e.breadcrumbs.length-1].is_last=true)})).catch((function(t){salla.logger.error("salla-breadcrumb:: unexpected error!",t);e.breadcrumbs=[]}))};e.prototype.render=function(){var e=this;if(this.breadcrumbs.length<=1){salla.log("salla-breadcrumb:: There is no breadcrumbs!");return}return h("ol",{class:{"s-breadcrumb-wrapper":true,"s-breadcrumb-dark":salla.url.is_page("loyalty"),"s-breadcrumb-primary-reverse":salla.config.get("page.slug").includes("customer")}},this.breadcrumbs.map((function(t){return[h("div",{class:"s-breadcrumb-slot",innerHTML:e.itemSlot.replace(/\{url\}/g,t.url).replace(/\{title\}/g,t.title)}),e.getArrowDomForItem(t)]})))};e.prototype.getArrowDomForItem=function(e){if(e.is_last){return""}var t=this.iconSlot||(salla.config.get("theme.is_rtl",true)?ArrowLeftIcon:ArrowRightIcon);return h("li",{class:"s-breadcrumb-arrow"},h("div",{class:{"s-breadcrumb-icon-slot":true,"s-breadcrumb-default-icon":!this.iconSlot},innerHTML:t}))};e.prototype.componentDidRender=function(){var e,t,i;this.host.querySelectorAll(".s-breadcrumb-slot").forEach((function(e){return e.replaceWith(e.firstChild)}));this.host.querySelectorAll(".s-breadcrumb-icon-slot.s-breadcrumb-default-icon").forEach((function(e){return e.replaceWith(e.querySelector("svg"))}));(e=this.host.querySelector('[slot="item"]'))===null||e===void 0?void 0:e.remove();(t=this.host.querySelector('[slot="icon"]'))===null||t===void 0?void 0:t.remove();var n=(i=this.host.querySelectorAll(".s-breadcrumb-item")[this.breadcrumbs.length-1])===null||i===void 0?void 0:i.querySelector("a");n&&n.replaceWith(n.firstChild)};Object.defineProperty(e.prototype,"host",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();SallaBreadcrumb.style=sallaBreadcrumbCss;var sallaButtonCss="";var SallaButton=function(){function e(e){registerInstance(this,e);this.hostAttributes={};this.shape="btn";this.color="primary";this.fill="solid";this.size="medium";this.width="normal";this.loading=false;this.disabled=false;this.loaderPosition="after";this.href=undefined;this.type="button"}e.prototype.load=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){if(this.loaderPosition=="center")this.text.classList.add("s-button-hide");this.host.setAttribute("loading","");return[2,this.host]}))}))};e.prototype.stop=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.host.removeAttribute("loading");this.host.querySelector("button").removeAttribute("loading");if(this.loaderPosition=="center")this.text.classList.remove("s-button-hide");return[2,this.host]}))}))};e.prototype.setText=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.text.innerHTML=e;return[2,this.host]}))}))};e.prototype.disable=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.host.setAttribute("disabled","");return[2,this.host]}))}))};e.prototype.enable=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.host.removeAttribute("disabled");return[2,this.host]}))}))};e.prototype.getBtnAttributes=function(){for(var e=0;e<this.host.attributes.length;e++){if(!["color","fill","size","width","id"].includes(this.host.attributes[e].name)){this.hostAttributes[this.host.attributes[e].name]=this.host.attributes[e].value}}this.hostAttributes.type=this.hostAttributes.type||this.type;this.hostAttributes.class+=" s-button-element s-button-"+this.shape+" s-button-"+(this.fill=="none"?"fill-none":this.fill)+(this.size!="medium"?" s-button-"+this.size:"")+(this.width!="normal"?" s-button-"+this.width:"")+(this.shape=="link"?" s-button-"+this.color+"-link":"")+(this.shape!="link"&&this.fill!="outline"?" s-button-"+this.color:"")+(this.fill=="outline"?" s-button-"+this.color+"-outline":"")+(this.disabled?" s-button-disabled ":"")+(this.shape=="icon"?" s-button-loader-center":" s-button-loader-"+this.loaderPosition);return this.hostAttributes};e.prototype.button=function(){var e=this;return h("button",Object.assign({},this.getBtnAttributes(),{disabled:this.disabled}),h("span",{class:"s-button-text",ref:function(t){return e.text=t}},h("slot",null)),this.loading?h("span",{class:"s-button-loader"}):"")};e.prototype.render=function(){var e;return((e=this.host.closest(".swiper-slide"))===null||e===void 0?void 0:e.classList.contains("swiper-slide-duplicate"))?"":h(Host,{class:"s-button-wrap"},this.href?h("a",{href:this.href},this.button()):this.button())};Object.defineProperty(e.prototype,"host",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();SallaButton.style=sallaButtonCss;var sallaCartSummaryCss="";var SallaCartSummary=function(){function e(e){var t=this;registerInstance(this,e);this.cartSummaryCount=salla.storage.get("cart.summary.count")||0;this.cartSummaryTotal=salla.storage.get("cart.summary.total")||0;this.cartLabel=salla.config.get("user.language_code")==="ar"?"السلة":"Cart";this.showCartLabel=undefined;salla.cart.event.onUpdated((function(e){t.cartSummaryCount=e.count||0;t.cartSummaryTotal=e.total||0}))}e.prototype.animateToCart=function(e){return __awaiter(this,void 0,void 0,(function(){var t,i,n,a,r,o,s,l,c,u,d,p;return __generator(this,(function(h){document.querySelectorAll(".s-cart-thumb").forEach((function(e){return e.remove()}));if(!(e===null||e===void 0?void 0:e.src)){salla.log("Failed to get the img element");return[2]}t=this.host.querySelector("#s-cart-icon"),i=t.getBoundingClientRect(),n=i.top+window.scrollY,a=i.left+window.scrollX;r=e.getBoundingClientRect(),o=e.offsetWidth+"px",s=e.offsetHeight+"px",l=r.top,c=r.left;u=document.createElement("img");u.src=e.getAttribute("src");u.className="s-cart-thumb";u.setAttribute("style","object-fit:cover; width:"+o+"; height:"+s+"; top:"+l+"px; left:"+c+"px;z-index:99999999; ");document.body.append(u);d=document.querySelector(".s-cart-thumb");t.classList.remove("animated","rubberBand");p=new anime.timeline;p.add({targets:d,width:[150,30],height:[150,30],top:[l,window.scrollY>0?n-window.scrollY-40:n-40],left:[c,a],borderRadius:["20%","50%"],easing:"easeOutExpo",duration:1200},"+=200").add({targets:d,width:[30,0],height:[30,0],opacity:[1,0],easing:"easeOutExpo",top:[window.scrollY>0?n-window.scrollY-40:n-40,window.scrollY>0?n-window.scrollY+10:n+10],left:[a,a+10]},"-=500").add({complete:function(){t.classList.add("animated","rubberBand");d.remove()}},"-=1700");return[2]}))}))};e.prototype.componentWillLoad=function(){return new Promise((function(e){return salla.onReady(e)}))};e.prototype.render=function(){return h(Host,null,h("a",{class:"s-cart-summary-wrapper",href:salla.url.get("cart")},h("div",{id:"s-cart-icon"},h("slot",{name:"icon"},h("i",{class:"s-cart-summary-icon",innerHTML:PendingOrdersIcon}))),h("span",{class:"s-cart-summary-count"},salla.helpers.number(this.cartSummaryCount)),h("p",{class:"s-cart-summary-content"},this.showCartLabel&&h("span",{class:"s-cart-summary-label"},this.cartLabel),h("b",{class:"s-cart-summary-total"},salla.money(this.cartSummaryTotal)))))};Object.defineProperty(e.prototype,"host",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();SallaCartSummary.style=sallaCartSummaryCss;
5
5
  /*!
6
6
  * vanilla-picker v2.12.1
7
7
  * https://vanilla-picker.js.org