@salla.sa/twilight-components 2.12.72 → 2.12.73

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.
@@ -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 _y;
2
2
  /*!
3
3
  * Crafted with ❤ by Salla
4
- */import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-e6c3f002.js";import{a as anime}from"./anime.es-6b92d9cd.js";import{C as CheckCircleIcon,a as CameraIcon}from"./camera-a379486d.js";import{H as Helper}from"./Helper-a7076e76.js";import{a as createCommonjsModule,c as commonjsGlobal,g as getDefaultExportFromCjs}from"./_commonjsHelpers-1415ffd3.js";import{e as email}from"./mail-25533e3f.js";import{f as facebook,t as twitter}from"./twitter-4aa505e4.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 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;salla.onReady((function(){t.showQuickBuy=t.quickBuy&&!!salla.config.get("store.settings.buy_now")&&t.productStatus=="sale"&&t.productType!=="booking"}))}e.prototype.getLabel=function(){if(this.productStatus==="sale"&&this.supportStickyBar&&window.innerWidth<=768&&this.showQuickBuy){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.componentWillLoad=function(){var e=this;var t;this.passedLabel=this.host.innerHTML.replace("\x3c!----\x3e","").trim();if(!!this.passedLabel&&window.innerWidth>=768){(t=this.btn)===null||t===void 0?void 0:t.setText(this.passedLabel);return}if(this.host.hasAttribute("type")&&this.host.getAttribute("type")==="submit"&&this.supportStickyBar){window.addEventListener("resize",(function(){var t,i;if(window.innerWidth>=768&&!!e.passedLabel){(t=e.btn)===null||t===void 0?void 0:t.setText(e.passedLabel)}else{(i=e.btn)===null||i===void 0?void 0:i.setText(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}},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?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.get("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")}))}))}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;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:typeof this.template=="object"&&Object.keys(this.template).length?h("span",null,this.getDefaultMessage()," ",h("span",{class:"s-bottom-alert-message-highlight"},this.template.developer&&this.template.developer.name?this.template.developer.name: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.actionLabel:this.defaultActionLabel)):null,this.type==="popup"?this.popup():null))};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$1='\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){var t=this;registerInstance(this,e);var i,n;this.items=undefined;this.breadcrumbs=undefined;this.currentPage=salla.config.get("page");this.isRtl=salla.config.get("theme.is_rtl",true);salla.onReady((function(){t.isRtl=salla.config.get("theme.is_rtl",true);t.currentPage=salla.config.get("page")}));this.itemSlot=((i=this.host.querySelector('[slot="item"]'))===null||i===void 0?void 0:i.outerHTML)||'<li class="s-breadcrumb-item"><a href={url}>{title}</a></li>';this.iconSlot=(n=this.host.querySelector('[slot="icon"]'))===null||n===void 0?void 0:n.outerHTML}e.prototype.isLast=function(e){return e===this.breadcrumbs.length-1};e.prototype.getBreadcrumbs=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i;return __generator(this,(function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);e={id:this.currentPage.id,page:this.currentPage.slug};if(this.currentPage.slug=="product.single"){e["parent_id"]=this.currentPage.product_id}return[4,salla.api.landing.fetchBreadcrumbs(e)];case 1:t=n.sent();this.breadcrumbs=t.data[0];return[3,3];case 2:i=n.sent();salla.error("Error fetching breadcrumbs");this.breadcrumbs=[];return[3,3];case 3:return[2]}}))}))};e.prototype.render=function(){var e=this;return h("ol",{class:"s-breadcrumb-wrapper"},!!this.breadcrumbs?this.breadcrumbs.map((function(t,i){return!e.isLast(i)?[h("div",{id:"breadcrumb-slot",innerHTML:e.itemSlot.replace(/\{url\}/g,t.url).replace(/\{title\}/g,t.title)}),h("li",{class:"s-breadcrumb-arrow"},h("div",{id:"breadcrumb-icon-slot",class:{"s-breadcrumb-default-icon":!e.iconSlot},innerHTML:e.iconSlot?e.iconSlot:e.isRtl?ArrowLeftIcon:ArrowRightIcon$1}))]:h("div",{id:"breadcrumb-slot",innerHTML:e.itemSlot.replace(/\{url\}/g,t.url).replace(/\{title\}/g,t.title)})})):"")};e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,this.getBreadcrumbs()];case 1:e.sent();return[2]}}))}))};e.prototype.componentDidRender=function(){var e=this;var t,i;this.host.querySelectorAll("#breadcrumb-slot").forEach((function(e){return e.replaceWith(e.firstChild)}));this.host.querySelectorAll("#breadcrumb-icon-slot.s-breadcrumb-default-icon").forEach((function(e){return e.replaceWith(e.querySelector("svg"))}));(t=this.host.querySelector('[slot="item"]'))===null||t===void 0?void 0:t.remove();(i=this.host.querySelector('[slot="icon"]'))===null||i===void 0?void 0:i.remove();this.host.querySelectorAll(".s-breadcrumb-item").forEach((function(t,i){if(i===e.breadcrumbs.length-1){t.querySelector("a").replaceWith(t.querySelector("a").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.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}from"./index-e6c3f002.js";import{a as anime}from"./anime.es-6b92d9cd.js";import{C as CheckCircleIcon,a as CameraIcon}from"./camera-a379486d.js";import{H as Helper}from"./Helper-a7076e76.js";import{a as createCommonjsModule,c as commonjsGlobal,g as getDefaultExportFromCjs}from"./_commonjsHelpers-1415ffd3.js";import{e as email}from"./mail-25533e3f.js";import{f as facebook,t as twitter}from"./twitter-4aa505e4.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 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;salla.onReady((function(){t.showQuickBuy=t.quickBuy&&!!salla.config.get("store.settings.buy_now")&&t.productStatus=="sale"&&t.productType!=="booking"}))}e.prototype.getLabel=function(){if(this.productStatus==="sale"&&this.supportStickyBar&&window.innerWidth<=768&&this.showQuickBuy){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.componentWillLoad=function(){var e=this;var t;this.passedLabel=this.host.innerHTML.replace("\x3c!----\x3e","").trim();if(!!this.passedLabel&&window.innerWidth>=768){(t=this.btn)===null||t===void 0?void 0:t.setText(this.passedLabel);return}if(this.host.hasAttribute("type")&&this.host.getAttribute("type")==="submit"&&this.supportStickyBar){window.addEventListener("resize",(function(){var t,i;if(window.innerWidth>=768&&!!e.passedLabel){(t=e.btn)===null||t===void 0?void 0:t.setText(e.passedLabel)}else{(i=e.btn)===null||i===void 0?void 0:i.setText(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}},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?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.get("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")}))}))}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.name;var r=n&&i.url;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:r?r:"javascript:void(0);",class:{"s-bottom-alert-message-highlight":true,"s-bottom-alert-message-link":r},target:r?"_blank":"","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$1='\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){var t=this;registerInstance(this,e);var i,n;this.items=undefined;this.breadcrumbs=undefined;this.currentPage=salla.config.get("page");this.isRtl=salla.config.get("theme.is_rtl",true);salla.onReady((function(){t.isRtl=salla.config.get("theme.is_rtl",true);t.currentPage=salla.config.get("page")}));this.itemSlot=((i=this.host.querySelector('[slot="item"]'))===null||i===void 0?void 0:i.outerHTML)||'<li class="s-breadcrumb-item"><a href={url}>{title}</a></li>';this.iconSlot=(n=this.host.querySelector('[slot="icon"]'))===null||n===void 0?void 0:n.outerHTML}e.prototype.isLast=function(e){return e===this.breadcrumbs.length-1};e.prototype.getBreadcrumbs=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i;return __generator(this,(function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);e={id:this.currentPage.id,page:this.currentPage.slug};if(this.currentPage.slug=="product.single"){e["parent_id"]=this.currentPage.product_id}return[4,salla.api.landing.fetchBreadcrumbs(e)];case 1:t=n.sent();this.breadcrumbs=t.data[0];return[3,3];case 2:i=n.sent();salla.error("Error fetching breadcrumbs");this.breadcrumbs=[];return[3,3];case 3:return[2]}}))}))};e.prototype.render=function(){var e=this;return h("ol",{class:"s-breadcrumb-wrapper"},!!this.breadcrumbs?this.breadcrumbs.map((function(t,i){return!e.isLast(i)?[h("div",{id:"breadcrumb-slot",innerHTML:e.itemSlot.replace(/\{url\}/g,t.url).replace(/\{title\}/g,t.title)}),h("li",{class:"s-breadcrumb-arrow"},h("div",{id:"breadcrumb-icon-slot",class:{"s-breadcrumb-default-icon":!e.iconSlot},innerHTML:e.iconSlot?e.iconSlot:e.isRtl?ArrowLeftIcon:ArrowRightIcon$1}))]:h("div",{id:"breadcrumb-slot",innerHTML:e.itemSlot.replace(/\{url\}/g,t.url).replace(/\{title\}/g,t.title)})})):"")};e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,this.getBreadcrumbs()];case 1:e.sent();return[2]}}))}))};e.prototype.componentDidRender=function(){var e=this;var t,i;this.host.querySelectorAll("#breadcrumb-slot").forEach((function(e){return e.replaceWith(e.firstChild)}));this.host.querySelectorAll("#breadcrumb-icon-slot.s-breadcrumb-default-icon").forEach((function(e){return e.replaceWith(e.querySelector("svg"))}));(t=this.host.querySelector('[slot="item"]'))===null||t===void 0?void 0:t.remove();(i=this.host.querySelector('[slot="icon"]'))===null||i===void 0?void 0:i.remove();this.host.querySelectorAll(".s-breadcrumb-item").forEach((function(t,i){if(i===e.breadcrumbs.length-1){t.querySelector("a").replaceWith(t.querySelector("a").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.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