@salla.sa/twilight-components 2.13.115 → 2.13.116

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 (29) hide show
  1. package/dist/cjs/app-globals-858037ca.js.map +1 -1
  2. package/dist/cjs/salla-add-product-button_49.cjs.entry.js.map +1 -1
  3. package/dist/cjs/salla-booking-field_2.cjs.entry.js +1 -1
  4. package/dist/cjs/salla-booking-field_2.cjs.entry.js.map +1 -1
  5. package/dist/collection/components/salla-booking-field/salla-booking-field.js +1 -1
  6. package/dist/collection/components/salla-booking-field/salla-booking-field.js.map +1 -1
  7. package/dist/components/index.js.map +1 -1
  8. package/dist/components/salla-booking-field2.js +1 -1
  9. package/dist/components/salla-booking-field2.js.map +1 -1
  10. package/dist/components/salla-quick-buy2.js.map +1 -1
  11. package/dist/esm/app-globals-18a3586b.js.map +1 -1
  12. package/dist/esm/salla-add-product-button_49.entry.js.map +1 -1
  13. package/dist/esm/salla-booking-field_2.entry.js +1 -1
  14. package/dist/esm/salla-booking-field_2.entry.js.map +1 -1
  15. package/dist/esm-es5/app-globals-18a3586b.js.map +1 -1
  16. package/dist/esm-es5/salla-add-product-button_49.entry.js.map +1 -1
  17. package/dist/esm-es5/salla-booking-field_2.entry.js +1 -1
  18. package/dist/esm-es5/salla-booking-field_2.entry.js.map +1 -1
  19. package/dist/twilight/p-2a04525b.system.js.map +1 -1
  20. package/dist/twilight/p-466a720a.entry.js.map +1 -1
  21. package/dist/twilight/p-680a2e1e.system.entry.js.map +1 -1
  22. package/dist/twilight/p-9aaf78ff.js.map +1 -1
  23. package/dist/twilight/{p-095dac8c.entry.js → p-a69f32dc.entry.js} +2 -2
  24. package/dist/twilight/{p-095dac8c.entry.js.map → p-a69f32dc.entry.js.map} +1 -1
  25. package/dist/twilight/p-daf1aa98.system.js +1 -1
  26. package/dist/twilight/{p-49fbd428.system.entry.js → p-ee43190e.system.entry.js} +2 -2
  27. package/dist/twilight/{p-49fbd428.system.entry.js.map → p-ee43190e.system.entry.js.map} +1 -1
  28. package/dist/twilight/twilight.esm.js +1 -1
  29. package/package.json +5 -5
@@ -1,5 +1,5 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as e,c as t,h as s,H as i,g as a}from"./p-bdd00808.js";const n=`\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>calendar-time</title>\n<path d="M22.667 17.333c-0.737 0-1.333 0.596-1.333 1.333v2.667h-2.667c-0.737 0-1.333 0.596-1.333 1.333s0.596 1.333 1.333 1.333h4c0.737 0 1.333-0.596 1.333-1.333v-4c0-0.737-0.596-1.333-1.333-1.333zM28 2.667h-2.667v-1.333c0-0.736-0.596-1.333-1.333-1.333s-1.333 0.597-1.333 1.333v1.333h-13.333v-1.333c0-0.736-0.596-1.333-1.333-1.333s-1.333 0.597-1.333 1.333v1.333h-2.667c-2.205 0-4 1.795-4 4v21.333c0 2.205 1.795 4 4 4h5.363c0.737 0 1.333-0.596 1.333-1.333s-0.596-1.333-1.333-1.333h-5.363c-0.736 0-1.333-0.597-1.333-1.333v-21.333c0-0.736 0.597-1.333 1.333-1.333h2.667v2.667c0 0.736 0.596 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-2.667h13.333v2.667c0 0.736 0.596 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-2.667h2.667c0.736 0 1.333 0.599 1.333 1.333v2.696c0 0.736 0.596 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-2.696c0-2.205-1.795-4-4-4zM22 12c-5.515 0-10 4.485-10 10s4.485 10 10 10 10-4.485 10-10-4.485-10-10-10zM22 29.333c-4.043 0-7.333-3.291-7.333-7.333s3.291-7.333 7.333-7.333 7.333 3.291 7.333 7.333-3.291 7.333-7.333 7.333z"></path>\n</svg>\n`;const o=`\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>calendar</title>\n<path d="M28 2.667h-2.667v-1.333c0-0.736-0.597-1.333-1.333-1.333s-1.333 0.597-1.333 1.333v1.333h-13.333v-1.333c0-0.736-0.597-1.333-1.333-1.333s-1.333 0.597-1.333 1.333v1.333h-2.667c-2.205 0-4 1.795-4 4v21.333c0 2.205 1.795 4 4 4h24c2.205 0 4-1.795 4-4v-21.333c0-2.205-1.795-4-4-4zM29.333 28c0 0.736-0.599 1.333-1.333 1.333h-24c-0.736 0-1.333-0.599-1.333-1.333v-13.333h26.667zM29.333 12h-26.667v-5.333c0-0.736 0.599-1.333 1.333-1.333h2.667v2.667c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-2.667h13.333v2.667c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-2.667h2.667c0.736 0 1.333 0.599 1.333 1.333z"></path>\n</svg>\n`;const l=`\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>time</title>\n<path d="M16 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.333zM16 8c-0.736 0-1.333 0.596-1.333 1.333v6.667h-4c-0.736 0-1.333 0.596-1.333 1.333s0.597 1.333 1.333 1.333h5.333c0.736 0 1.333-0.596 1.333-1.333v-8c0-0.737-0.597-1.333-1.333-1.333z"></path>\n</svg>\n`;const r=":host{display:block}";const c=class{constructor(s){e(this,s);this.invalidInput=t(this,"invalidInput",7);this.option=undefined;this.productId=undefined;this.bookNowLabel=salla.lang.get("pages.cart.book_an_appointment","حجز موعد");this.editLabel=salla.lang.get("pages.cart.edit_an_appointment","تعديل الموعد");this.bookedLabel=salla.lang.get("pages.cart.booked_successfully","تمت اضافة الموعد بنجاح");this.selectDate=salla.lang.get("pages.cart.select_appointment_date","حدد تاريخ الموعد");this.bookingUrl="";this.iframeReady=false;this.reservations=[];this.reservationsInput=undefined;salla.lang.onLoaded((()=>this.setTranslations()));Salla.event.on("booking::open",(e=>this.handleBookingOpen(e)))}async setTranslations(){const e=(e,t,s)=>new Promise((i=>{salla.helpers.setNested(salla.lang.messages[e],t,s);i(true)}));await e("ar.trans","pages.cart.book_an_appointment","حجز موعد");await e("en.trans","pages.cart.book_an_appointment","Book an Appointment");await e("ar.trans","pages.cart.edit_an_appointment","تعديل الموعد");await e("en.trans","pages.cart.edit_an_appointment","Edit an Appointment");await e("ar.trans","pages.cart.booked_successfully","تمت اضافة الموعد بنجاح");await e("en.trans","pages.cart.booked_successfully","Booked Successfully");await e("ar.trans","pages.cart.select_appointment_date","حدد تاريخ الموعد");await e("en.trans","pages.cart.select_appointment_date","Select appointment date");this.bookNowLabel=salla.lang.get("pages.cart.book_an_appointment");this.editLabel=salla.lang.get("pages.cart.edit_an_appointment");this.bookedLabel=salla.lang.get("pages.cart.booked_successfully");this.selectDate=salla.lang.get("pages.cart.select_appointment_date")}openBookingModal(e,t=false){if(t&&(!e.detail||typeof e.detail!=="number"||e.detail!==this.productId)){return}if(salla.config.isGuest()){this.setAfterReloadEvent("booking::open-after-reload",this.productId);salla.event.dispatch("login::open");return}salla.booking.add(this.productId,false).then((e=>{if(e.data.redirect.to!=="booking"){throw new Error("Unexpected redirect!")}salla.event.dispatch("booking::open",{url:e.data.redirect.url,id:this.productId})})).catch((e=>{salla.error(salla.lang.get("common.errors.error_occurred"));salla.logger.error(e.response||e)}))}handleBookingOpen(e){if(e.id!==this.productId)return;this.bookingUrl=salla.url.addParamToUrl("product_id",e.id,e.url);this.iframeReady=true;setTimeout((()=>{this.modal.setTitle(this.selectDate);this.modal.open()}),100)}setAfterReloadEvent(e,t){salla.storage.set("afterReloadEvent",{event:e,payload:t})}emitAfterReloadEvent(){const e=salla.storage.get("afterReloadEvent");if(e&&e.event){const t=new CustomEvent(e.event,{detail:e.payload});window.dispatchEvent(t);salla.storage.remove("afterReloadEvent")}}componentWillLoad(){if(this.option&&this.option.details.length){this.reservations=this.option.details}}componentDidLoad(){window.addEventListener("booking::open-after-reload",(e=>this.openBookingModal(e,true)));this.emitAfterReloadEvent();window.addEventListener("message",this.handleMessageEvent.bind(this));this.reservationsInput.addEventListener("invalid",(e=>this.invalidInput.emit(e)));this.reservationsInput.addEventListener("input",(()=>{this.reservationsInput.setCustomValidity("");this.reservationsInput.reportValidity()}))}handleMessageEvent(e){var t,s;if(e.data.source!=="booking")return;const i=e.data.type;const a=e.data.message;if(localStorage.getItem("debug"))console.log(`Received an action:${i}`,e.data);if(i==="error"){if((t=a.fields)===null||t===void 0?void 0:t.reservation){salla.notify.error(a.fields.reservation[0]);return}const e=Object.values(a.fields).flat().map((e=>`<li>${e}</li>`)).join("");salla.notify.error(`<ul>${e}</ul>`)}if(i==="success"){if(Number(a.productId)!==Number(this.productId))return;this.reservations=a.data.reservations.map((e=>{if(e.time&&e.time.length>0){const t=e.time[0];return{date:e.date,day:e.day,from_timestamp:t.from,to_timestamp:t.to}}return null})).filter((e=>e!==null));salla.notify.success(this.bookedLabel);(s=this.modal)===null||s===void 0?void 0:s.close();setTimeout((()=>window.location.reload()))}if(i==="height"){this.iframe.height=(a===null||a===void 0?void 0:a.height)+"px"}}bookingModal(){return s("salla-modal",{class:"s-booking-field-modal",ref:e=>this.modal=e,width:"md",position:"middle",noPadding:true},s("iframe",{ref:e=>this.iframe=e,src:this.bookingUrl,frameborder:"0"}))}renderReservationDate(e){return s("span",{class:e.from_timestamp?"s-booking-field-reservations-has-time":""},s("i",{class:"s-booking-field-reservations-icon",innerHTML:o}),e.date)}renderReservationTime(e){if(!e.from_timestamp)return"";return s("span",{class:"s-booking-field-reservations-time"},s("i",{class:"s-booking-field-reservations-icon",innerHTML:l}),s("span",null,e.from_timestamp," - ",e.to_timestamp))}render(){return s(i,null,s("div",{class:"s-booking-field-main"},this.option.required&&this.reservations.length>0?s("div",{class:"s-booking-field-price"},s("span",null,salla.money(this.option.price))):"",s("salla-button",{class:"s-booking-field-book-now",size:"small",loaderPosition:"center",fill:"outline",onClick:e=>this.openBookingModal(e,false)},s("span",{class:"s-booking-field-book-now-content"},s("span",{innerHTML:n}),this.reservations.length?this.editLabel:this.bookNowLabel))),this.reservations.length>0&&s("div",{class:"s-booking-field-reservations"},this.reservations.map(((e,t)=>s("div",{key:t,class:"s-booking-field-reservations-item"},this.renderReservationDate(e),this.renderReservationTime(e))))),s("input",{class:"s-hidden",name:this.option.name,required:this.option.required,value:JSON.stringify(this.reservations)==="[]"?"":JSON.stringify(this.reservations),ref:e=>this.reservationsInput=e}),this.iframeReady&&this.bookingModal())}get host(){return a(this)}};c.style=r;const h=class{constructor(t){e(this,t)}hideAllOptions(e){this.host.querySelectorAll(`[data-show-when^="options[${e}"]`).forEach((e=>{e.classList.add("hidden");this.hideAllOptions(e.dataset.optionId);this.disableInputs(e)}))}disableInputs(e){e.querySelectorAll("[name]").forEach((e=>{var t;e.setAttribute("disabled","");e.removeAttribute("required");if(((t=e===null||e===void 0?void 0:e.tagName)===null||t===void 0?void 0:t.toLowerCase())==="select"){e.value=""}if(["checkbox"].includes(e.getAttribute("type"))&&e.hasOwnProperty("checked")){e.checked=false}}))}changeHandler(e){var t;salla.event.emit("salla-onditional-fields::change",e);salla.log("Received the change event: ",e);if(!e.target||!["SELECT"].includes(e.target.tagName)&&!["checkbox"].includes(e.target.getAttribute("type"))){salla.log("Ignore the change because is not support input: "+(((t=e===null||e===void 0?void 0:e.target)===null||t===void 0?void 0:t.tagName)||"N/A"));return}let s=e.target.name.replace("[]","");let i=e.target.getAttribute("type")==="checkbox";salla.log("Trying to find all the element with condition:",`[data-show-when^="${s}"]`);this.host.querySelectorAll(`[data-show-when^="${s}"]`).forEach((t=>{let s=!(t===null||t===void 0?void 0:t.dataset.showWhen.includes("!="));let a=t===null||t===void 0?void 0:t.dataset.showWhen.replace(/(.*)(=|!=)(.*)/gm,"$3").trim();let n;if(i){let t=Array.from(this.host.querySelectorAll(`input[name="${e.target.name}"]:checked`),(e=>e===null||e===void 0?void 0:e.value));n=t.includes(a.toString())}else{n=a===e.target.value}salla.log("The input is ",i?"Multiple":"Single"," value:",n);let o=s&&n||!s&&!n;if(o){t.classList.remove("hidden");t.querySelectorAll("[name]").forEach((e=>{e.removeAttribute("disabled");const s=e.closest(".s-product-options-option");if(s.dataset.optionRequired==="true"){e.setAttribute("required","")}if(e.getAttribute("type")==="checkbox"){const t=Array.from(document.querySelectorAll(`input[type="checkbox"][name="${e.getAttribute("name")}"]`));const s=t.some((e=>e.checked));if(s){t.forEach((e=>{e.removeAttribute("required")}))}}if(!["checkbox"].includes(e.getAttribute("type"))&&t.getElementsByClassName("required").length){e.setAttribute("required","")}}))}else{this.hideAllOptions(t.dataset.optionId);t.classList.add("hidden");this.disableInputs(t)}}))}componentDidRender(){this.host.querySelectorAll(`[data-show-when]`).forEach((e=>{var t;let s=(t=e===null||e===void 0?void 0:e.dataset)===null||t===void 0?void 0:t.showWhen.replace(/(.*)(=|!=)(.*)/gm,"$1").trim();if(!s){return}this.changeHandler({target:this.host.querySelector('[name^="'+s+'"]')})}))}render(){return s(i,null,s("slot",null))}get host(){return a(this)}};export{c as salla_booking_field,h as salla_conditional_fields};
5
- //# sourceMappingURL=p-095dac8c.entry.js.map
4
+ import{r as e,c as t,h as s,H as i,g as a}from"./p-bdd00808.js";const n=`\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>calendar-time</title>\n<path d="M22.667 17.333c-0.737 0-1.333 0.596-1.333 1.333v2.667h-2.667c-0.737 0-1.333 0.596-1.333 1.333s0.596 1.333 1.333 1.333h4c0.737 0 1.333-0.596 1.333-1.333v-4c0-0.737-0.596-1.333-1.333-1.333zM28 2.667h-2.667v-1.333c0-0.736-0.596-1.333-1.333-1.333s-1.333 0.597-1.333 1.333v1.333h-13.333v-1.333c0-0.736-0.596-1.333-1.333-1.333s-1.333 0.597-1.333 1.333v1.333h-2.667c-2.205 0-4 1.795-4 4v21.333c0 2.205 1.795 4 4 4h5.363c0.737 0 1.333-0.596 1.333-1.333s-0.596-1.333-1.333-1.333h-5.363c-0.736 0-1.333-0.597-1.333-1.333v-21.333c0-0.736 0.597-1.333 1.333-1.333h2.667v2.667c0 0.736 0.596 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-2.667h13.333v2.667c0 0.736 0.596 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-2.667h2.667c0.736 0 1.333 0.599 1.333 1.333v2.696c0 0.736 0.596 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-2.696c0-2.205-1.795-4-4-4zM22 12c-5.515 0-10 4.485-10 10s4.485 10 10 10 10-4.485 10-10-4.485-10-10-10zM22 29.333c-4.043 0-7.333-3.291-7.333-7.333s3.291-7.333 7.333-7.333 7.333 3.291 7.333 7.333-3.291 7.333-7.333 7.333z"></path>\n</svg>\n`;const o=`\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>calendar</title>\n<path d="M28 2.667h-2.667v-1.333c0-0.736-0.597-1.333-1.333-1.333s-1.333 0.597-1.333 1.333v1.333h-13.333v-1.333c0-0.736-0.597-1.333-1.333-1.333s-1.333 0.597-1.333 1.333v1.333h-2.667c-2.205 0-4 1.795-4 4v21.333c0 2.205 1.795 4 4 4h24c2.205 0 4-1.795 4-4v-21.333c0-2.205-1.795-4-4-4zM29.333 28c0 0.736-0.599 1.333-1.333 1.333h-24c-0.736 0-1.333-0.599-1.333-1.333v-13.333h26.667zM29.333 12h-26.667v-5.333c0-0.736 0.599-1.333 1.333-1.333h2.667v2.667c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-2.667h13.333v2.667c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-2.667h2.667c0.736 0 1.333 0.599 1.333 1.333z"></path>\n</svg>\n`;const l=`\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>time</title>\n<path d="M16 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.333zM16 8c-0.736 0-1.333 0.596-1.333 1.333v6.667h-4c-0.736 0-1.333 0.596-1.333 1.333s0.597 1.333 1.333 1.333h5.333c0.736 0 1.333-0.596 1.333-1.333v-8c0-0.737-0.597-1.333-1.333-1.333z"></path>\n</svg>\n`;const r=":host{display:block}";const c=class{constructor(s){e(this,s);this.invalidInput=t(this,"invalidInput",7);this.option=undefined;this.productId=undefined;this.bookNowLabel=salla.lang.get("pages.cart.book_an_appointment","حجز موعد");this.editLabel=salla.lang.get("pages.cart.edit_an_appointment","تعديل الموعد");this.bookedLabel=salla.lang.get("pages.cart.booked_successfully","تمت اضافة الموعد بنجاح");this.selectDate=salla.lang.get("pages.cart.select_appointment_date","حدد تاريخ الموعد");this.bookingUrl="";this.iframeReady=false;this.reservations=[];this.reservationsInput=undefined;salla.lang.onLoaded((()=>this.setTranslations()));Salla.event.on("booking::open",(e=>this.handleBookingOpen(e)))}async setTranslations(){const e=(e,t,s)=>new Promise((i=>{salla.helpers.setNested(salla.lang.messages[e],t,s);i(true)}));await e("ar.trans","pages.cart.book_an_appointment","حجز موعد");await e("en.trans","pages.cart.book_an_appointment","Book an Appointment");await e("ar.trans","pages.cart.edit_an_appointment","تعديل الموعد");await e("en.trans","pages.cart.edit_an_appointment","Edit an Appointment");await e("ar.trans","pages.cart.booked_successfully","تمت اضافة الموعد بنجاح");await e("en.trans","pages.cart.booked_successfully","Booked Successfully");await e("ar.trans","pages.cart.select_appointment_date","حدد تاريخ الموعد");await e("en.trans","pages.cart.select_appointment_date","Select appointment date");this.bookNowLabel=salla.lang.get("pages.cart.book_an_appointment");this.editLabel=salla.lang.get("pages.cart.edit_an_appointment");this.bookedLabel=salla.lang.get("pages.cart.booked_successfully");this.selectDate=salla.lang.get("pages.cart.select_appointment_date")}openBookingModal(e,t=false){if(t&&(!e.detail||typeof e.detail!=="number"||e.detail!==this.productId)){return}if(salla.config.isGuest()){this.setAfterReloadEvent("booking::open-after-reload",this.productId);salla.event.dispatch("login::open");return}salla.booking.add(this.productId,false).then((e=>{if(e.data.redirect.to!=="booking"){throw new Error("Unexpected redirect!")}salla.event.dispatch("booking::open",{url:e.data.redirect.url,id:this.productId})})).catch((e=>{salla.error(salla.lang.get("common.errors.error_occurred"));salla.logger.error(e.response||e)}))}handleBookingOpen(e){if(e.id!==this.productId)return;this.bookingUrl=salla.url.addParamToUrl("product_id",e.id,e.url);this.iframeReady=true;setTimeout((()=>{this.modal.setTitle(this.selectDate);this.modal.open()}),100)}setAfterReloadEvent(e,t){salla.storage.set("afterReloadEvent",{event:e,payload:t})}emitAfterReloadEvent(){const e=salla.storage.get("afterReloadEvent");if(e&&e.event){const t=new CustomEvent(e.event,{detail:e.payload});window.dispatchEvent(t);salla.storage.remove("afterReloadEvent")}}componentWillLoad(){if(this.option&&this.option.details.length){this.reservations=this.option.details}}componentDidLoad(){window.addEventListener("booking::open-after-reload",(e=>this.openBookingModal(e,true)));this.emitAfterReloadEvent();window.addEventListener("message",this.handleMessageEvent.bind(this));this.reservationsInput.addEventListener("invalid",(e=>this.invalidInput.emit(e)));this.reservationsInput.addEventListener("input",(()=>{this.reservationsInput.setCustomValidity("");this.reservationsInput.reportValidity()}))}handleMessageEvent(e){var t,s;if(e.data.source!=="booking")return;const i=e.data.type;const a=e.data.message;if(localStorage.getItem("debug"))console.log(`Received an action:${i}`,e.data);if(i==="error"){if((t=a.fields)===null||t===void 0?void 0:t.reservation){salla.notify.error(a.fields.reservation[0]);return}const e=Object.values(a.fields).flat().map((e=>`<li>${e}</li>`)).join("");salla.notify.error(`<ul>${e}</ul>`)}if(i==="success"){if(Number(a.productId)!==Number(this.productId))return;this.reservations=a.data.reservations.map((e=>{if(e.time&&e.time.length>0){const t=e.time[0];return{date:e.date,day:e.day,from_timestamp:t.from,to_timestamp:t.to}}return null})).filter((e=>e!==null));salla.notify.success(this.bookedLabel);(s=this.modal)===null||s===void 0?void 0:s.close();setTimeout((()=>window.location.reload()))}if(i==="height"){this.iframe.height=(a===null||a===void 0?void 0:a.height)+"px"}}bookingModal(){return s("salla-modal",{class:"s-booking-field-modal",ref:e=>this.modal=e,width:"md",position:"middle",noPadding:true},s("iframe",{ref:e=>this.iframe=e,src:this.bookingUrl,frameborder:"0"}))}renderReservationDate(e){return s("span",{class:e.from_timestamp?"s-booking-field-reservations-has-time":""},s("i",{class:"s-booking-field-reservations-icon",innerHTML:o}),e.date)}renderReservationTime(e){if(!e.from_timestamp)return"";return s("span",{class:"s-booking-field-reservations-time"},s("i",{class:"s-booking-field-reservations-icon",innerHTML:l}),s("span",null,e.from_timestamp," - ",e.to_timestamp))}render(){return s(i,null,s("div",{class:"s-booking-field-main"},this.option.required||this.reservations.length>0?s("div",{class:"s-booking-field-price"},s("span",null,salla.money(this.option.price))):"",s("salla-button",{class:"s-booking-field-book-now",size:"small",loaderPosition:"center",fill:"outline",onClick:e=>this.openBookingModal(e,false)},s("span",{class:"s-booking-field-book-now-content"},s("span",{innerHTML:n}),this.reservations.length?this.editLabel:this.bookNowLabel))),this.reservations.length>0&&s("div",{class:"s-booking-field-reservations"},this.reservations.map(((e,t)=>s("div",{key:t,class:"s-booking-field-reservations-item"},this.renderReservationDate(e),this.renderReservationTime(e))))),s("input",{class:"s-hidden",name:this.option.name,required:this.option.required,value:JSON.stringify(this.reservations)==="[]"?"":JSON.stringify(this.reservations),ref:e=>this.reservationsInput=e}),this.iframeReady&&this.bookingModal())}get host(){return a(this)}};c.style=r;const h=class{constructor(t){e(this,t)}hideAllOptions(e){this.host.querySelectorAll(`[data-show-when^="options[${e}"]`).forEach((e=>{e.classList.add("hidden");this.hideAllOptions(e.dataset.optionId);this.disableInputs(e)}))}disableInputs(e){e.querySelectorAll("[name]").forEach((e=>{var t;e.setAttribute("disabled","");e.removeAttribute("required");if(((t=e===null||e===void 0?void 0:e.tagName)===null||t===void 0?void 0:t.toLowerCase())==="select"){e.value=""}if(["checkbox"].includes(e.getAttribute("type"))&&e.hasOwnProperty("checked")){e.checked=false}}))}changeHandler(e){var t;salla.event.emit("salla-onditional-fields::change",e);salla.log("Received the change event: ",e);if(!e.target||!["SELECT"].includes(e.target.tagName)&&!["checkbox"].includes(e.target.getAttribute("type"))){salla.log("Ignore the change because is not support input: "+(((t=e===null||e===void 0?void 0:e.target)===null||t===void 0?void 0:t.tagName)||"N/A"));return}let s=e.target.name.replace("[]","");let i=e.target.getAttribute("type")==="checkbox";salla.log("Trying to find all the element with condition:",`[data-show-when^="${s}"]`);this.host.querySelectorAll(`[data-show-when^="${s}"]`).forEach((t=>{let s=!(t===null||t===void 0?void 0:t.dataset.showWhen.includes("!="));let a=t===null||t===void 0?void 0:t.dataset.showWhen.replace(/(.*)(=|!=)(.*)/gm,"$3").trim();let n;if(i){let t=Array.from(this.host.querySelectorAll(`input[name="${e.target.name}"]:checked`),(e=>e===null||e===void 0?void 0:e.value));n=t.includes(a.toString())}else{n=a===e.target.value}salla.log("The input is ",i?"Multiple":"Single"," value:",n);let o=s&&n||!s&&!n;if(o){t.classList.remove("hidden");t.querySelectorAll("[name]").forEach((e=>{e.removeAttribute("disabled");const s=e.closest(".s-product-options-option");if(s.dataset.optionRequired==="true"){e.setAttribute("required","")}if(e.getAttribute("type")==="checkbox"){const t=Array.from(document.querySelectorAll(`input[type="checkbox"][name="${e.getAttribute("name")}"]`));const s=t.some((e=>e.checked));if(s){t.forEach((e=>{e.removeAttribute("required")}))}}if(!["checkbox"].includes(e.getAttribute("type"))&&t.getElementsByClassName("required").length){e.setAttribute("required","")}}))}else{this.hideAllOptions(t.dataset.optionId);t.classList.add("hidden");this.disableInputs(t)}}))}componentDidRender(){this.host.querySelectorAll(`[data-show-when]`).forEach((e=>{var t;let s=(t=e===null||e===void 0?void 0:e.dataset)===null||t===void 0?void 0:t.showWhen.replace(/(.*)(=|!=)(.*)/gm,"$1").trim();if(!s){return}this.changeHandler({target:this.host.querySelector('[name^="'+s+'"]')})}))}render(){return s(i,null,s("slot",null))}get host(){return a(this)}};export{c as salla_booking_field,h as salla_conditional_fields};
5
+ //# sourceMappingURL=p-a69f32dc.entry.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["sallaBookingFieldCss","SallaBookingField","constructor","hostRef","salla","lang","get","onLoaded","this","setTranslations","Salla","event","on","data","handleBookingOpen","setNestedAsync","key","value","Promise","resolve","helpers","setNested","messages","bookNowLabel","editLabel","bookedLabel","selectDate","openBookingModal","afterReload","detail","productId","config","isGuest","setAfterReloadEvent","dispatch","booking","add","then","resp","redirect","to","Error","url","id","catch","error","logger","response","bookingUrl","addParamToUrl","iframeReady","setTimeout","modal","setTitle","open","payload","storage","set","emitAfterReloadEvent","eventDetails","customEvent","CustomEvent","window","dispatchEvent","remove","componentWillLoad","option","details","length","reservations","componentDidLoad","addEventListener","handleMessageEvent","bind","reservationsInput","e","invalidInput","emit","setCustomValidity","reportValidity","source","action","type","message","localStorage","getItem","console","log","_a","fields","reservation","notify","errorList","Object","values","flat","map","join","Number","schedule","time","timeSlot","date","day","from_timestamp","from","to_timestamp","filter","item","success","_b","close","location","reload","iframe","height","bookingModal","h","class","ref","width","position","noPadding","src","frameborder","renderReservationDate","innerHTML","Calendar","renderReservationTime","TimeIcon","render","Host","required","money","price","size","loaderPosition","fill","onClick","BookingTime","index","name","JSON","stringify","SallaConditionalFields","hideAllOptions","optionId","host","querySelectorAll","forEach","field","classList","dataset","disableInputs","input","setAttribute","removeAttribute","tagName","toLowerCase","includes","getAttribute","hasOwnProperty","checked","changeHandler","target","replace","isMultiple","isEqual","showWhen","trim","isSelected","selectedValues","Array","toString","showTheInput","closestProductOption","closest","optionRequired","checkboxes","document","isAnyChecked","some","checkbox","getElementsByClassName","componentDidRender","optionName","querySelector"],"sources":["src/components/salla-booking-field/salla-booking-field.scss?tag=salla-booking-field","src/components/salla-booking-field/salla-booking-field.tsx","src/components/salla-conditional-fields/salla-conditional-fields.tsx"],"sourcesContent":[":host {\n display: block;\n}\n","import { Component, Host, Prop, h, Element, State, Event, EventEmitter } from '@stencil/core';\nimport { Option, Reservation } from './interfaces';\nimport BookingTime from '../../assets/svg/calendar-time.svg';\nimport Calendar from '../../assets/svg/calendar.svg';\nimport TimeIcon from '../../assets/svg/time.svg';\n\n@Component({\n tag: 'salla-booking-field',\n styleUrl: 'salla-booking-field.scss',\n})\nexport class SallaBookingField {\n @Prop() option: Option;\n @Prop() productId: number;\n @Element() host: HTMLElement;\n @State() bookNowLabel: string = salla.lang.get('pages.cart.book_an_appointment', 'حجز موعد');\n @State() editLabel: string = salla.lang.get('pages.cart.edit_an_appointment', 'تعديل الموعد');\n @State() bookedLabel: string = salla.lang.get('pages.cart.booked_successfully', 'تمت اضافة الموعد بنجاح');\n @State() selectDate: string = salla.lang.get('pages.cart.select_appointment_date', 'حدد تاريخ الموعد');\n @State() bookingUrl: string = '';\n @State() iframeReady: boolean = false;\n @State() reservations: Reservation[] = [];\n @State() reservationsInput: HTMLInputElement;\n\n /**\n * Event emitted when the input is invalid.\n */\n @Event() invalidInput: EventEmitter<any>;\n\n private modal: HTMLSallaModalElement;\n private iframe: HTMLIFrameElement;\n\n constructor() {\n // Load translations\n salla.lang.onLoaded(() => this.setTranslations());\n // Register event listeners\n Salla.event.on('booking::open', (data) => this.handleBookingOpen(data));\n }\n\n private async setTranslations() {\n const setNestedAsync = (lang, key, value) => {\n return new Promise((resolve) => {\n salla.helpers.setNested(salla.lang.messages[lang], key, value);\n resolve(true);\n });\n };\n\n await setNestedAsync('ar.trans', 'pages.cart.book_an_appointment', 'حجز موعد');\n await setNestedAsync('en.trans', 'pages.cart.book_an_appointment', 'Book an Appointment');\n await setNestedAsync('ar.trans', 'pages.cart.edit_an_appointment', 'تعديل الموعد');\n await setNestedAsync('en.trans', 'pages.cart.edit_an_appointment', 'Edit an Appointment');\n await setNestedAsync('ar.trans', 'pages.cart.booked_successfully', 'تمت اضافة الموعد بنجاح');\n await setNestedAsync('en.trans', 'pages.cart.booked_successfully', 'Booked Successfully');\n await setNestedAsync('ar.trans', 'pages.cart.select_appointment_date', 'حدد تاريخ الموعد');\n await setNestedAsync('en.trans', 'pages.cart.select_appointment_date', 'Select appointment date');\n\n this.bookNowLabel = salla.lang.get('pages.cart.book_an_appointment');\n this.editLabel = salla.lang.get('pages.cart.edit_an_appointment');\n this.bookedLabel = salla.lang.get('pages.cart.booked_successfully');\n this.selectDate = salla.lang.get('pages.cart.select_appointment_date');\n }\n\n private openBookingModal(event: any, afterReload = false) {\n if (afterReload && (!event.detail || typeof event.detail !== 'number' || event.detail !== this.productId)) {\n return;\n }\n if (salla.config.isGuest()) {\n this.setAfterReloadEvent('booking::open-after-reload', this.productId);\n salla.event.dispatch('login::open');\n return;\n }\n salla.booking.add(this.productId, false)\n .then((resp) => {\n if (resp.data.redirect.to !== 'booking') {\n throw new Error('Unexpected redirect!');\n }\n salla.event.dispatch('booking::open', { url: resp.data.redirect.url, id: this.productId });\n })\n .catch((error) => {\n salla.error(salla.lang.get('common.errors.error_occurred'));\n salla.logger.error(error.response || error);\n });\n }\n\n private handleBookingOpen(data) {\n if (data.id !== this.productId) return;\n this.bookingUrl = salla.url.addParamToUrl('product_id', data.id, data.url);\n this.iframeReady = true;\n setTimeout(() => {\n this.modal.setTitle(this.selectDate);\n this.modal.open();\n }, 100);\n }\n\n private setAfterReloadEvent(event, payload) {\n salla.storage.set('afterReloadEvent', { event, payload });\n }\n\n private emitAfterReloadEvent() {\n const eventDetails = salla.storage.get('afterReloadEvent');\n if (eventDetails && eventDetails.event) {\n const customEvent = new CustomEvent(eventDetails.event, {\n detail: eventDetails.payload\n });\n window.dispatchEvent(customEvent)\n salla.storage.remove('afterReloadEvent');\n }\n }\n\n componentWillLoad() {\n if (this.option && this.option.details.length) {\n this.reservations = this.option.details;\n }\n }\n\n componentDidLoad() {\n window.addEventListener('booking::open-after-reload', (event) => this.openBookingModal(event, true));\n this.emitAfterReloadEvent();\n window.addEventListener('message', this.handleMessageEvent.bind(this));\n this.reservationsInput.addEventListener('invalid', e => this.invalidInput.emit(e));\n this.reservationsInput.addEventListener('input', () => {\n this.reservationsInput.setCustomValidity('');\n this.reservationsInput.reportValidity();\n });\n }\n\n private handleMessageEvent(event) {\n if (event.data.source !== 'booking') return;\n const action = event.data.type;\n const value = event.data.message;\n if (localStorage.getItem('debug')) console.log(`Received an action:${action}`, event.data);\n\n if (action === 'error') {\n if (value.fields?.reservation) {\n salla.notify.error(value.fields.reservation[0]);\n return;\n }\n const errorList = Object.values(value.fields).flat().map(error => `<li>${error}</li>`).join('');\n salla.notify.error(`<ul>${errorList}</ul>`);\n }\n\n if (action === 'success') {\n if (Number(value.productId) !== Number(this.productId)) return;\n this.reservations = value.data.reservations.map(schedule => {\n if (schedule.time && schedule.time.length > 0) {\n const timeSlot = schedule.time[0];\n return {\n date: schedule.date,\n day: schedule.day,\n from_timestamp: timeSlot.from,\n to_timestamp: timeSlot.to,\n };\n }\n return null;\n }).filter(item => item !== null);\n\n salla.notify.success(this.bookedLabel);\n this.modal?.close();\n setTimeout(() => window.location.reload());\n }\n\n if (action === 'height') {\n this.iframe.height = value?.height + 'px';\n }\n }\n\n private bookingModal() {\n return (\n <salla-modal class=\"s-booking-field-modal\" ref={modal => (this.modal = modal)} width=\"md\" position=\"middle\" noPadding>\n <iframe ref={iframe => (this.iframe = iframe)} src={this.bookingUrl} frameborder=\"0\"></iframe>\n </salla-modal>\n );\n }\n\n renderReservationDate(reservation: Reservation) {\n return (\n <span class={reservation.from_timestamp ? 's-booking-field-reservations-has-time' : ''}>\n <i class=\"s-booking-field-reservations-icon\" innerHTML={Calendar}></i>\n {reservation.date}\n </span>\n );\n }\n\n renderReservationTime(reservation: Reservation) {\n if (!reservation.from_timestamp) return '';\n return (\n <span class=\"s-booking-field-reservations-time\">\n <i class=\"s-booking-field-reservations-icon\" innerHTML={TimeIcon}></i>\n <span>\n {reservation.from_timestamp} - {reservation.to_timestamp}\n </span>\n </span>\n );\n }\n\n render() {\n return (\n <Host>\n <div class=\"s-booking-field-main\">\n {this.option.required && this.reservations.length > 0 ? <div class=\"s-booking-field-price\">\n <span>{salla.money(this.option.price)}</span>\n </div> : ''}\n <salla-button class=\"s-booking-field-book-now\" size=\"small\" loaderPosition=\"center\" fill=\"outline\" onClick={event => this.openBookingModal(event, false)}>\n <span class=\"s-booking-field-book-now-content\">\n <span innerHTML={BookingTime}></span>\n {this.reservations.length ? this.editLabel : this.bookNowLabel}\n </span>\n </salla-button>\n </div>\n {this.reservations.length > 0 && (\n <div class=\"s-booking-field-reservations\">\n {this.reservations.map((reservation, index) => (\n <div key={index} class=\"s-booking-field-reservations-item\">\n {this.renderReservationDate(reservation)}\n {this.renderReservationTime(reservation)}\n </div>\n ))}\n </div>\n )}\n <input \n class=\"s-hidden\" \n name={this.option.name} \n required={this.option.required} \n value={JSON.stringify(this.reservations) === '[]' ? '' : JSON.stringify(this.reservations)}\n ref={reservations => this.reservationsInput = reservations} \n />\n {this.iframeReady && this.bookingModal()}\n </Host>\n );\n }\n}\n","import { Component, Element, Host, Listen, h } from '@stencil/core';\n\n/**\n * its to easy to use, currenlty its support select & checkbox input as trigger for show/hide the dom\n * the dom you can put it like this data-show-when=\"{name of the field} {= or !=} {value of the field}\"\n */\n@Component({\n tag: 'salla-conditional-fields'\n})\nexport class SallaConditionalFields {\n\n @Element() host: HTMLElement;\n\n private hideAllOptions(optionId) {\n this.host.querySelectorAll(`[data-show-when^=\"options[${optionId}\"]`).forEach((field: HTMLElement) => {\n field.classList.add('hidden');\n this.hideAllOptions(field.dataset.optionId);\n this.disableInputs(field);\n });\n }\n\n private disableInputs(field) {\n field.querySelectorAll('[name]').forEach((input) => {\n\n input.setAttribute('disabled', '');\n input.removeAttribute('required');\n if (input?.tagName?.toLowerCase() === 'select') {\n input.value = ''\n }\n if (['checkbox'].includes(input.getAttribute('type')) && input.hasOwnProperty('checked')) {\n // @ts-ignore\n input.checked = false;\n }\n });\n }\n \n @Listen('change')\n changeHandler(event) {\n salla.event.emit('salla-onditional-fields::change', event);\n salla.log('Received the change event: ', event);\n\n if (!event.target || !['SELECT'].includes(event.target.tagName) && !['checkbox'].includes(event.target.getAttribute('type'))) {\n salla.log('Ignore the change because is not support input: ' + (event?.target?.tagName || 'N/A'));\n return;\n }\n\n // to extract the option id from the input name, the supported names are name[*] and name[*][]\n let optionId = event.target.name.replace('[]', '');\n let isMultiple = event.target.getAttribute('type') === 'checkbox';\n\n\n salla.log('Trying to find all the element with condition:', `[data-show-when^=\"${optionId}\"]`);\n\n this.host.querySelectorAll(`[data-show-when^=\"${optionId}\"]`)\n .forEach((field: HTMLElement) => {\n let isEqual = !field?.dataset.showWhen.includes('!=');\n let value = field?.dataset.showWhen.replace(/(.*)(=|!=)(.*)/gm, '$3').trim();\n // let isSelected = isMultiple ? event.target?.checked : value === event.target.value;\n let isSelected;\n\n if (isMultiple) {\n // @ts-ignore\n let selectedValues = Array.from(this.host.querySelectorAll(`input[name=\"${event.target.name}\"]:checked`), e => e?.value);\n isSelected = selectedValues.includes(value.toString());\n } else {\n isSelected = value === event.target.value;\n }\n\n salla.log('The input is ', (isMultiple ? 'Multiple' : 'Single'), ' value:', isSelected);\n\n let showTheInput = (isEqual && isSelected) || (!isEqual && !isSelected);\n if (showTheInput) {\n field.classList.remove('hidden');\n field.querySelectorAll('[name]').forEach((input) => {\n input.removeAttribute('disabled');\n\n\n // Return required attribute to the input if the option is required\n const closestProductOption = (input as HTMLInputElement).closest('.s-product-options-option') as HTMLElement;\n if (closestProductOption.dataset.optionRequired === 'true') {\n input.setAttribute('required', '');\n }\n\n\n // Handle multiple checkboxes with same name and required attribute \n if (input.getAttribute('type') === 'checkbox') {\n const checkboxes = Array.from(document.querySelectorAll(`input[type=\"checkbox\"][name=\"${input.getAttribute('name')}\"]`)) as HTMLInputElement[];\n const isAnyChecked = checkboxes.some((checkbox) => checkbox.checked); \n if (isAnyChecked) {\n checkboxes.forEach((checkbox) => {\n checkbox.removeAttribute('required');\n });\n }\n }\n //To handle focus on hidden input error\n if (!['checkbox'].includes(input.getAttribute('type')) && field.getElementsByClassName('required').length) {\n input.setAttribute('required', '');\n }\n });\n } else {\n this.hideAllOptions(field.dataset.optionId);\n field.classList.add('hidden');\n this.disableInputs(field);\n }\n });\n }\n\n componentDidRender() {\n this.host.querySelectorAll(`[data-show-when]`).forEach((field) => {\n // @ts-ignore\n let optionName = field?.dataset?.showWhen.replace(/(.*)(=|!=)(.*)/gm, '$1').trim();\n if (!optionName) {\n return;\n }\n\n this.changeHandler({\n target: this.host.querySelector('[name^=\"' + optionName + '\"]')\n })\n });\n }\n\n render() {\n return (\n <Host>\n <slot></slot>\n </Host>\n );\n }\n}\n"],"mappings":";;;goFAAA,MAAMA,EAAuB,uB,MCUhBC,EAAiB,MAqB5B,WAAAC,CAAAC,G,sHAjBgCC,MAAMC,KAAKC,IAAI,iCAAkC,Y,eACpDF,MAAMC,KAAKC,IAAI,iCAAkC,gB,iBAC/CF,MAAMC,KAAKC,IAAI,iCAAkC,0B,gBAClDF,MAAMC,KAAKC,IAAI,qCAAsC,oB,gBACrD,G,iBACE,M,kBACO,G,iCAarCF,MAAMC,KAAKE,UAAS,IAAMC,KAAKC,oBAE/BC,MAAMC,MAAMC,GAAG,iBAAkBC,GAASL,KAAKM,kBAAkBD,I,CAG3D,qBAAMJ,GACZ,MAAMM,EAAiB,CAACV,EAAMW,EAAKC,IAC1B,IAAIC,SAASC,IAClBf,MAAMgB,QAAQC,UAAUjB,MAAMC,KAAKiB,SAASjB,GAAOW,EAAKC,GACxDE,EAAQ,KAAK,UAIXJ,EAAe,WAA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BookingField","constructor","hostRef","salla","lang","get","onLoaded","this","setTranslations","Salla","event","on","data","handleBookingOpen","setNestedAsync","key","value","Promise","resolve","helpers","setNested","messages","bookNowLabel","editLabel","bookedLabel","selectDate","openBookingModal","afterReload","detail","productId","config","isGuest","setAfterReloadEvent","dispatch","booking","add","then","resp","redirect","to","Error","url","id","catch","error","logger","response","bookingUrl","addParamToUrl","iframeReady","setTimeout","modal","setTitle","open","payload","storage","set","emitAfterReloadEvent","eventDetails","customEvent","CustomEvent","window","dispatchEvent","remove","componentWillLoad","option","details","length","reservations","componentDidLoad","addEventListener","handleMessageEvent","bind","reservationsInput","e","invalidInput","emit","setCustomValidity","reportValidity","source","action","type","message","localStorage","getItem","console","log","_a","fields","reservation","notify","errorList","Object","values","flat","map","join","Number","schedule","time","timeSlot","date","day","from_timestamp","from","to_timestamp","filter","item","success","_b","close","location","reload","iframe","height","bookingModal","h","class","ref","width","position","noPadding","src","frameborder","renderReservationDate","innerHTML","Calendar","renderReservationTime","TimeIcon","render","Host","required","money","price","size","loaderPosition","fill","onClick","BookingTime","index","name","JSON","stringify","SallaConditionalFields","hideAllOptions","optionId","host","querySelectorAll","forEach","field","classList","dataset","disableInputs","input","setAttribute","removeAttribute","tagName","toLowerCase","includes","getAttribute","hasOwnProperty","checked","changeHandler","target","replace","isMultiple","isEqual","showWhen","trim","isSelected","selectedValues","Array","toString","showTheInput","closestProductOption","closest","optionRequired","checkboxes","document","isAnyChecked","some","checkbox","getElementsByClassName","componentDidRender","optionName","querySelector"],"sources":["src/components/salla-booking-field/salla-booking-field.scss?tag=salla-booking-field","src/components/salla-booking-field/salla-booking-field.tsx","src/components/salla-conditional-fields/salla-conditional-fields.tsx"],"sourcesContent":[":host {\n display: block;\n}\n","import { Component, Host, Prop, h, Element, State, Event, EventEmitter } from '@stencil/core';\nimport { Option, Reservation } from './interfaces';\nimport BookingTime from '../../assets/svg/calendar-time.svg';\nimport Calendar from '../../assets/svg/calendar.svg';\nimport TimeIcon from '../../assets/svg/time.svg';\n\n@Component({\n tag: 'salla-booking-field',\n styleUrl: 'salla-booking-field.scss',\n})\nexport class SallaBookingField {\n @Prop() option: Option;\n @Prop() productId: number;\n @Element() host: HTMLElement;\n @State() bookNowLabel: string = salla.lang.get('pages.cart.book_an_appointment', 'حجز موعد');\n @State() editLabel: string = salla.lang.get('pages.cart.edit_an_appointment', 'تعديل الموعد');\n @State() bookedLabel: string = salla.lang.get('pages.cart.booked_successfully', 'تمت اضافة الموعد بنجاح');\n @State() selectDate: string = salla.lang.get('pages.cart.select_appointment_date', 'حدد تاريخ الموعد');\n @State() bookingUrl: string = '';\n @State() iframeReady: boolean = false;\n @State() reservations: Reservation[] = [];\n @State() reservationsInput: HTMLInputElement;\n\n /**\n * Event emitted when the input is invalid.\n */\n @Event() invalidInput: EventEmitter<any>;\n\n private modal: HTMLSallaModalElement;\n private iframe: HTMLIFrameElement;\n\n constructor() {\n // Load translations\n salla.lang.onLoaded(() => this.setTranslations());\n // Register event listeners\n Salla.event.on('booking::open', (data) => this.handleBookingOpen(data));\n }\n\n private async setTranslations() {\n const setNestedAsync = (lang, key, value) => {\n return new Promise((resolve) => {\n salla.helpers.setNested(salla.lang.messages[lang], key, value);\n resolve(true);\n });\n };\n\n await setNestedAsync('ar.trans', 'pages.cart.book_an_appointment', 'حجز موعد');\n await setNestedAsync('en.trans', 'pages.cart.book_an_appointment', 'Book an Appointment');\n await setNestedAsync('ar.trans', 'pages.cart.edit_an_appointment', 'تعديل الموعد');\n await setNestedAsync('en.trans', 'pages.cart.edit_an_appointment', 'Edit an Appointment');\n await setNestedAsync('ar.trans', 'pages.cart.booked_successfully', 'تمت اضافة الموعد بنجاح');\n await setNestedAsync('en.trans', 'pages.cart.booked_successfully', 'Booked Successfully');\n await setNestedAsync('ar.trans', 'pages.cart.select_appointment_date', 'حدد تاريخ الموعد');\n await setNestedAsync('en.trans', 'pages.cart.select_appointment_date', 'Select appointment date');\n\n this.bookNowLabel = salla.lang.get('pages.cart.book_an_appointment');\n this.editLabel = salla.lang.get('pages.cart.edit_an_appointment');\n this.bookedLabel = salla.lang.get('pages.cart.booked_successfully');\n this.selectDate = salla.lang.get('pages.cart.select_appointment_date');\n }\n\n private openBookingModal(event: any, afterReload = false) {\n if (afterReload && (!event.detail || typeof event.detail !== 'number' || event.detail !== this.productId)) {\n return;\n }\n if (salla.config.isGuest()) {\n this.setAfterReloadEvent('booking::open-after-reload', this.productId);\n salla.event.dispatch('login::open');\n return;\n }\n salla.booking.add(this.productId, false)\n .then((resp) => {\n if (resp.data.redirect.to !== 'booking') {\n throw new Error('Unexpected redirect!');\n }\n salla.event.dispatch('booking::open', { url: resp.data.redirect.url, id: this.productId });\n })\n .catch((error) => {\n salla.error(salla.lang.get('common.errors.error_occurred'));\n salla.logger.error(error.response || error);\n });\n }\n\n private handleBookingOpen(data) {\n if (data.id !== this.productId) return;\n this.bookingUrl = salla.url.addParamToUrl('product_id', data.id, data.url);\n this.iframeReady = true;\n setTimeout(() => {\n this.modal.setTitle(this.selectDate);\n this.modal.open();\n }, 100);\n }\n\n private setAfterReloadEvent(event, payload) {\n salla.storage.set('afterReloadEvent', { event, payload });\n }\n\n private emitAfterReloadEvent() {\n const eventDetails = salla.storage.get('afterReloadEvent');\n if (eventDetails && eventDetails.event) {\n const customEvent = new CustomEvent(eventDetails.event, {\n detail: eventDetails.payload\n });\n window.dispatchEvent(customEvent)\n salla.storage.remove('afterReloadEvent');\n }\n }\n\n componentWillLoad() {\n if (this.option && this.option.details.length) {\n this.reservations = this.option.details;\n }\n }\n\n componentDidLoad() {\n window.addEventListener('booking::open-after-reload', (event) => this.openBookingModal(event, true));\n this.emitAfterReloadEvent();\n window.addEventListener('message', this.handleMessageEvent.bind(this));\n this.reservationsInput.addEventListener('invalid', e => this.invalidInput.emit(e));\n this.reservationsInput.addEventListener('input', () => {\n this.reservationsInput.setCustomValidity('');\n this.reservationsInput.reportValidity();\n });\n }\n\n private handleMessageEvent(event) {\n if (event.data.source !== 'booking') return;\n const action = event.data.type;\n const value = event.data.message;\n if (localStorage.getItem('debug')) console.log(`Received an action:${action}`, event.data);\n\n if (action === 'error') {\n if (value.fields?.reservation) {\n salla.notify.error(value.fields.reservation[0]);\n return;\n }\n const errorList = Object.values(value.fields).flat().map(error => `<li>${error}</li>`).join('');\n salla.notify.error(`<ul>${errorList}</ul>`);\n }\n\n if (action === 'success') {\n if (Number(value.productId) !== Number(this.productId)) return;\n this.reservations = value.data.reservations.map(schedule => {\n if (schedule.time && schedule.time.length > 0) {\n const timeSlot = schedule.time[0];\n return {\n date: schedule.date,\n day: schedule.day,\n from_timestamp: timeSlot.from,\n to_timestamp: timeSlot.to,\n };\n }\n return null;\n }).filter(item => item !== null);\n\n salla.notify.success(this.bookedLabel);\n this.modal?.close();\n setTimeout(() => window.location.reload());\n }\n\n if (action === 'height') {\n this.iframe.height = value?.height + 'px';\n }\n }\n\n private bookingModal() {\n return (\n <salla-modal class=\"s-booking-field-modal\" ref={modal => (this.modal = modal)} width=\"md\" position=\"middle\" noPadding>\n <iframe ref={iframe => (this.iframe = iframe)} src={this.bookingUrl} frameborder=\"0\"></iframe>\n </salla-modal>\n );\n }\n\n renderReservationDate(reservation: Reservation) {\n return (\n <span class={reservation.from_timestamp ? 's-booking-field-reservations-has-time' : ''}>\n <i class=\"s-booking-field-reservations-icon\" innerHTML={Calendar}></i>\n {reservation.date}\n </span>\n );\n }\n\n renderReservationTime(reservation: Reservation) {\n if (!reservation.from_timestamp) return '';\n return (\n <span class=\"s-booking-field-reservations-time\">\n <i class=\"s-booking-field-reservations-icon\" innerHTML={TimeIcon}></i>\n <span>\n {reservation.from_timestamp} - {reservation.to_timestamp}\n </span>\n </span>\n );\n }\n\n render() {\n return (\n <Host>\n <div class=\"s-booking-field-main\">\n {this.option.required || this.reservations.length > 0 ? <div class=\"s-booking-field-price\">\n <span>{salla.money(this.option.price)}</span>\n </div> : ''}\n <salla-button class=\"s-booking-field-book-now\" size=\"small\" loaderPosition=\"center\" fill=\"outline\" onClick={event => this.openBookingModal(event, false)}>\n <span class=\"s-booking-field-book-now-content\">\n <span innerHTML={BookingTime}></span>\n {this.reservations.length ? this.editLabel : this.bookNowLabel}\n </span>\n </salla-button>\n </div>\n {this.reservations.length > 0 && (\n <div class=\"s-booking-field-reservations\">\n {this.reservations.map((reservation, index) => (\n <div key={index} class=\"s-booking-field-reservations-item\">\n {this.renderReservationDate(reservation)}\n {this.renderReservationTime(reservation)}\n </div>\n ))}\n </div>\n )}\n <input \n class=\"s-hidden\" \n name={this.option.name} \n required={this.option.required} \n value={JSON.stringify(this.reservations) === '[]' ? '' : JSON.stringify(this.reservations)}\n ref={reservations => this.reservationsInput = reservations} \n />\n {this.iframeReady && this.bookingModal()}\n </Host>\n );\n }\n}\n","import { Component, Element, Host, Listen, h } from '@stencil/core';\n\n/**\n * its to easy to use, currenlty its support select & checkbox input as trigger for show/hide the dom\n * the dom you can put it like this data-show-when=\"{name of the field} {= or !=} {value of the field}\"\n */\n@Component({\n tag: 'salla-conditional-fields'\n})\nexport class SallaConditionalFields {\n\n @Element() host: HTMLElement;\n\n private hideAllOptions(optionId) {\n this.host.querySelectorAll(`[data-show-when^=\"options[${optionId}\"]`).forEach((field: HTMLElement) => {\n field.classList.add('hidden');\n this.hideAllOptions(field.dataset.optionId);\n this.disableInputs(field);\n });\n }\n\n private disableInputs(field) {\n field.querySelectorAll('[name]').forEach((input) => {\n\n input.setAttribute('disabled', '');\n input.removeAttribute('required');\n if (input?.tagName?.toLowerCase() === 'select') {\n input.value = ''\n }\n if (['checkbox'].includes(input.getAttribute('type')) && input.hasOwnProperty('checked')) {\n // @ts-ignore\n input.checked = false;\n }\n });\n }\n \n @Listen('change')\n changeHandler(event) {\n salla.event.emit('salla-onditional-fields::change', event);\n salla.log('Received the change event: ', event);\n\n if (!event.target || !['SELECT'].includes(event.target.tagName) && !['checkbox'].includes(event.target.getAttribute('type'))) {\n salla.log('Ignore the change because is not support input: ' + (event?.target?.tagName || 'N/A'));\n return;\n }\n\n // to extract the option id from the input name, the supported names are name[*] and name[*][]\n let optionId = event.target.name.replace('[]', '');\n let isMultiple = event.target.getAttribute('type') === 'checkbox';\n\n\n salla.log('Trying to find all the element with condition:', `[data-show-when^=\"${optionId}\"]`);\n\n this.host.querySelectorAll(`[data-show-when^=\"${optionId}\"]`)\n .forEach((field: HTMLElement) => {\n let isEqual = !field?.dataset.showWhen.includes('!=');\n let value = field?.dataset.showWhen.replace(/(.*)(=|!=)(.*)/gm, '$3').trim();\n // let isSelected = isMultiple ? event.target?.checked : value === event.target.value;\n let isSelected;\n\n if (isMultiple) {\n // @ts-ignore\n let selectedValues = Array.from(this.host.querySelectorAll(`input[name=\"${event.target.name}\"]:checked`), e => e?.value);\n isSelected = selectedValues.includes(value.toString());\n } else {\n isSelected = value === event.target.value;\n }\n\n salla.log('The input is ', (isMultiple ? 'Multiple' : 'Single'), ' value:', isSelected);\n\n let showTheInput = (isEqual && isSelected) || (!isEqual && !isSelected);\n if (showTheInput) {\n field.classList.remove('hidden');\n field.querySelectorAll('[name]').forEach((input) => {\n input.removeAttribute('disabled');\n\n\n // Return required attribute to the input if the option is required\n const closestProductOption = (input as HTMLInputElement).closest('.s-product-options-option') as HTMLElement;\n if (closestProductOption.dataset.optionRequired === 'true') {\n input.setAttribute('required', '');\n }\n\n\n // Handle multiple checkboxes with same name and required attribute \n if (input.getAttribute('type') === 'checkbox') {\n const checkboxes = Array.from(document.querySelectorAll(`input[type=\"checkbox\"][name=\"${input.getAttribute('name')}\"]`)) as HTMLInputElement[];\n const isAnyChecked = checkboxes.some((checkbox) => checkbox.checked); \n if (isAnyChecked) {\n checkboxes.forEach((checkbox) => {\n checkbox.removeAttribute('required');\n });\n }\n }\n //To handle focus on hidden input error\n if (!['checkbox'].includes(input.getAttribute('type')) && field.getElementsByClassName('required').length) {\n input.setAttribute('required', '');\n }\n });\n } else {\n this.hideAllOptions(field.dataset.optionId);\n field.classList.add('hidden');\n this.disableInputs(field);\n }\n });\n }\n\n componentDidRender() {\n this.host.querySelectorAll(`[data-show-when]`).forEach((field) => {\n // @ts-ignore\n let optionName = field?.dataset?.showWhen.replace(/(.*)(=|!=)(.*)/gm, '$1').trim();\n if (!optionName) {\n return;\n }\n\n this.changeHandler({\n target: this.host.querySelector('[name^=\"' + optionName + '\"]')\n })\n });\n }\n\n render() {\n return (\n <Host>\n <slot></slot>\n </Host>\n );\n }\n}\n"],"mappings":";;;goFAAA,MAAMA,EAAuB,uB,MCUhBC,EAAiB,MAqB5B,WAAAC,CAAAC,G,sHAjBgCC,MAAMC,KAAKC,IAAI,iCAAkC,Y,eACpDF,MAAMC,KAAKC,IAAI,iCAAkC,gB,iBAC/CF,MAAMC,KAAKC,IAAI,iCAAkC,0B,gBAClDF,MAAMC,KAAKC,IAAI,qCAAsC,oB,gBACrD,G,iBACE,M,kBACO,G,iCAarCF,MAAMC,KAAKE,UAAS,IAAMC,KAAKC,oBAE/BC,MAAMC,MAAMC,GAAG,iBAAkBC,GAASL,KAAKM,kBAAkBD,I,CAG3D,qBAAMJ,GACZ,MAAMM,EAAiB,CAACV,EAAMW,EAAKC,IAC1B,IAAIC,SAASC,IAClBf,MAAMgB,QAAQC,UAAUjB,MAAMC,KAAKiB,SAASjB,GAAOW,EAAKC,GACxDE,EAAQ,KAAK,UAIXJ,EAAe,WAAY,iCAAkC,kBAC7DA,EAAe,WAAY,iCAAkC,6BAC7DA,EAAe,WAAY,iCAAkC,sBAC7DA,EAAe,WAAY,iCAAkC,6BAC7DA,EAAe,WAAY,iCAAkC,gCAC7DA,EAAe,WAAY,iCAAkC,6BAC7DA,EAAe,WAAY,qCAAsC,0BACjEA,EAAe,WAAY,qCAAsC,2BAEvEP,KAAKe,aAAenB,MAAMC,KAAKC,IAAI,kCACnCE,KAAKgB,UAAYpB,MAAMC,KAAKC,IAAI,kCAChCE,KAAKiB,YAAcrB,MAAMC,KAAKC,IAAI,kCAClCE,KAAKkB,WAAatB,MAAMC,KAAKC,IAAI,qC,CAG3B,gBAAAqB,CAA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B,EAAaN,MAAMnE,KAAK0E,SAAS/B,iBAAiB,gCAAgCM,EAAMM,aAAa,cAC3G,MAAMoB,EAAeF,EAAWG,MAAMC,GAAaA,EAASpB,UAC5D,GAAIkB,EAAc,CAChBF,EAAW7B,SAASiC,IAClBA,EAAS1B,gBAAgB,WAAW,G,EAK1C,IAAK,CAAC,YAAYG,SAASL,EAAMM,aAAa,UAAYV,EAAMiC,uBAAuB,YAAYnH,OAAQ,CACzGsF,EAAMC,aAAa,WAAY,G,SAG9B,CACLnJ,KAAKyI,eAAeK,EAAME,QAAQN,UAClCI,EAAMC,UAAUnH,IAAI,UACpB5B,KAAKiJ,cAAcH,E,KAK3B,kBAAAkC,GACEhL,KAAK2I,KAAKC,iBAAiB,oBAAoBC,SAASC,I,MAEtD,IAAImC,GAAajG,EAAA8D,IAAK,MAALA,SAAK,SAALA,EAAOE,WAAO,MAAAhE,SAAA,SAAAA,EAAEgF,SAASH,QAAQ,mBAAoB,MAAMI,OAC5E,IAAKgB,EAAY,CACf,M,CAGFjL,KAAK2J,cAAc,CACjBC,OAAQ5J,KAAK2I,KAAKuC,cAAc,WAAaD,EAAa,OAC1D,G,CAIN,MAAAvD,GACE,OACEb,EAACc,EAAI,KACHd,EAAA,a"}
@@ -1,5 +1,5 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- System.register(["./p-f422bbf9.system.js","./p-2a04525b.system.js","./p-9beb6b7b.system.js"],(function(e,t){"use strict";var a,l,o;return{setters:[function(t){a=t.p;l=t.b;e("setNonce",t.s)},function(e){o=e.g},function(){}],execute:function(){var e=function(){var e=t.meta.url;var l={};if(e!==""){l.resourcesUrl=new URL(".",e).href}return a(l)};e().then((function(e){o();return l(JSON.parse('[["p-8b6f641f.system",[[0,"salla-offer",{"productCardComponent":[1,"product-card-component"],"offersList":[32],"userCurrency":[32],"isMultipleBank":[32],"title":[32],"currentPage":[32],"hasCustomComponent":[32],"isBankOffer":[32],"canRender":[32],"showOffer":[32],"offer_with_price_text":[32],"with_discount_text":[32],"product_discount_text":[32],"special_offer_text":[32],"multipleBankOfferTitleText":[32],"multipleBankOfferTitleDescription":[32],"buy_quantity_text":[32]}]]],["p-bacd1629.system",[[0,"salla-products-slider",{"blockTitle":[1,"block-title"],"subTitle":[1,"sub-title"],"sliderId":[1,"slider-id"],"displayAllUrl":[1,"display-all-url"],"autoplay":[1028],"source":[1537],"sourceValue":[1,"source-value"],"limit":[1026],"sliderConfig":[520,"slider-config"],"productCardComponent":[1,"product-card-component"],"includes":[1025],"productsData":[32],"isReady":[32],"sourceValueIsValid":[32],"hasCustomComponent":[32],"apiUrl":[32],"parsedSourceValue":[32]}]]],["p-438ff239.system",[[0,"salla-product-options",{"productId":[2,"product-id"],"options":[1],"optionsData":[32],"outOfStockText":[32],"donationAmount":[32],"selectDonationAmount":[32],"selectAmount":[32],"isCustomDonation":[32],"selectedOptions":[32],"canDisabled":[32],"selectedSkus":[32],"selectedOutSkus":[32],"disableCardValue":[32],"availableDigitalCardValues":[32],"getSelectedOptionsData":[64],"reportValidity":[64],"hasOutOfStockOption":[64],"getSelectedOptions":[64],"getOption":[64]}]]],["p-9a4e9353.system",[[0,"salla-filters",{"filters":[1040],"isSidebarOpen":[32],"filtersData":[32],"apply":[32],"reset":[32],"getFilters":[64],"applyFilters":[64],"resetFilters":[64]}]]],["p-58a14772.system",[[0,"salla-notifications",{"loadMoreText":[1,"load-more-text"],"itemPerPage":[2,"item-per-page"],"pagination":[32],"total":[32],"showPlaceholder":[32],"nextPage":[32],"no_notifications_trans":[32],"load_more_text_trans":[32]}]]],["p-a2f66161.system",[[0,"salla-order-summary",{"orderId":[514,"order-id"],"codeCopied":[32],"noItemFound":[32],"order_items":[32]}]]],["p-289fecde.system",[[0,"salla-reviews",{"displayAllLink":[516,"display-all-link"],"source":[513],"sourceValue":[513,"source-value"],"limit":[514],"type":[1],"sort":[1],"hideCustomerInfo":[4,"hide-customer-info"],"reviews":[32],"isRTL":[32],"showReviews":[32],"testimonialText":[32],"displayAllLinkText":[32]}]]],["p-5e82c351.system",[[0,"salla-conditional-offer",{"offer":[32],"products":[32],"isLoading":[32],"canRender":[32]}]]],["p-a9ca0985.system",[[0,"salla-orders",{"params":[16],"loadMoreText":[1,"load-more-text"],"orderNumberText":[32],"totalOrderText":[32],"orderDateText":[32],"orderStatusText":[32],"noOrderText":[32],"load_more_text_trans":[32],"languageCode":[32],"orders":[32],"pagination":[32],"hasInfiniteScroll":[32],"total":[32],"nextPage":[32],"showPlaceholder":[32]}]]],["p-2e845bd2.system",[[0,"salla-advertisement",{"position":[32],"advertisements":[32],"advertIcon":[32],"currentSlug":[32]}]]],["p-eeec75e7.system",[[0,"salla-app-install-alert",{"data":[32],"ctaLink":[32],"open":[32],"closing":[32]}]]],["p-4924939b.system",[[0,"salla-apps-icons",{"hideTitle":[4,"hide-title"],"appsTitle":[1,"apps-title"],"vertical":[4],"apps":[32]}]]],["p-bbdf4ca3.system",[[0,"salla-contacts",{"contactsTitle":[1025,"contacts-title"],"hideTitle":[4,"hide-title"],"isHeader":[4,"is-header"],"horizontal":[4],"iconsOnly":[4,"icons-only"],"contacts":[32],"iconsList":[32]}]]],["p-7da8b73b.system",[[0,"salla-installment",{"price":[1],"language":[1],"currency":[1],"tamaraIsActive":[32],"tabbyIsActive":[32],"spotiiIsActive":[32],"mispayActive":[32],"installment_sheria_text":[32]}]]],["p-b4006070.system",[[0,"salla-loyalty-prize-item",{"item":[16]}]]],["p-b0473c73.system",[[0,"salla-metadata",{"entity":[1],"entityId":[8,"entity-id"],"specs":[32],"download":[32]}]]],["p-718fb6da.system",[[0,"salla-payments",{"exclude":[1040]}]]],["p-817fe6ad.system",[[0,"salla-social",{"links":[32],"iconsList":[32]}]]],["p-680a2e1e.system",[[4,"salla-gifting",{"productId":[2,"product-id"],"widgetTitle":[1,"widget-title"],"widgetSubtitle":[1,"widget-subtitle"],"sectionTitle":[32],"sectionSubtitle":[32],"sectionBtnText":[32],"giftDetails":[32],"selectImageForYourGift":[32],"selectImageOrUpload":[32],"selectGiftMessage":[32],"giftCustomText":[32],"textId":[32],"incorrectGiftText":[32],"nextStep":[32],"senderNameLabel":[32],"receiverNameFieldLabel":[32],"receiverMobileFieldLabel":[32],"receiverEmailFieldLabel":[32],"emailPlaceholder":[32],"sendLater":[32],"selectSendDateAndTime":[32],"canNotEditOrderAfterSelectDate":[32],"sendGift":[32],"donationRequired":[32],"currentStep":[32],"showCalendar":[32],"showGiftText":[32],"currentLang":[32],"parentClass":[32],"errors":[32],"gift":[32],"selectedGiftTextOption":[32],"showTextArea":[32],"selectedImage":[32],"uploadedImage":[32],"selectedText":[32],"senderName":[32],"errorMessage":[32],"hasError":[32],"quantity":[32],"deliveryDate":[32],"timeZone":[32],"receiverName":[32],"receiverMobile":[32],"receiverCountryCode":[32],"receiverEmail":[32],"open":[64],"close":[64],"goToStep2":[64]}],[4,"salla-loyalty",{"prizePoints":[1544,"prize-points"],"customerPoints":[1538,"customer-points"],"prizeTitle":[1537,"prize-title"],"allowEmail":[4,"allow-email"],"allowMobile":[4,"allow-mobile"],"requireEmail":[4,"require-email"],"guestMessage":[1025,"guest-message"],"loyaltyProgram":[32],"buttonLoading":[32],"selectedItem":[32],"askConfirmation":[32],"is_loggedin":[32],"hasError":[32],"errorMessage":[32],"translationLoaded":[32],"open":[64],"close":[64],"resetExchange":[64],"exchangeLoyaltyPoint":[64]}],[0,"salla-comments",{"itemId":[2,"item-id"],"loadMoreText":[1,"load-more-text"],"hideForm":[4,"hide-form"],"blockTitle":[1,"block-title"],"hideTitle":[4,"hide-title"],"type":[1],"showFormAvatar":[4,"show-form-avatar"],"hideBought":[4,"hide-bought"],"sort":[1],"testimonials":[4],"comments":[32],"pagination":[32],"total":[32],"showPlaceholder":[32],"nextPage":[32],"mostHelpfulLabel":[32],"noComments":[32],"comment_title":[32],"comment_name":[32],"placeholder_text":[32],"showRatingSummary":[32],"allowLikes":[32],"reload":[64]}],[4,"salla-product-size-guide",{"guides":[32],"productId":[32],"placeholder_title":[32],"placeholder_description":[32],"modal_title":[32],"hasError":[32],"open":[64],"close":[64]}],[0,"salla-rating-modal",{"orderId":[2,"order-id"],"order":[32],"hasError":[32],"showContactWidget":[32],"errorMessage":[32],"dragAndDropFilesLabel":[32],"contactSubjectLabel":[32],"editReviewLabel":[32],"allowedImagesTypesLabel":[32],"addImagesLabel":[32],"editImagesLabel":[32],"threeImagesMax":[32],"areYouSureLabel":[32],"confirmDeletionLabel":[32],"cancelLabel":[32],"confirmDeleteBtn":[32],"updatedSuccessfullyLabel":[32],"deletedSuccessfullyLabel":[32],"allowAttachImages":[32],"allowContactSupport":[32],"contactUsLabel":[32],"images":[32],"productImages":[32],"editItemImages":[32],"contact_body":[32],"editMode":[32],"defaultMode":[32],"deleteMode":[32],"shouldOpenDeleteModal":[32],"editType":[32],"editFeedbackId":[32],"deleteFeedbackId":[32],"editItem":[32],"open":[64],"close":[64]}],[4,"salla-login-modal",{"isEmailAllowed":[1028,"is-email-allowed"],"isMobileAllowed":[1028,"is-mobile-allowed"],"isEmailRequired":[1028,"is-email-required"],"supportWebAuth":[516,"support-web-auth"],"inline":[516],"withoutReload":[4,"without-reload"],"currentTabName":[32],"regType":[32],"translationLoaded":[32],"isModalOpen":[32],"currentPhone":[32],"currentEmail":[32],"title":[32],"emailErrorMsg":[32],"firstNameErrorMsg":[32],"lastNameErrorMsg":[32],"hasError":[32],"errorMessage":[32],"dragAndDrop":[32],"browseFromFiles":[32],"customFields":[32],"uploadedImage":[32],"open":[64]},[[8,"verified","onVerified"]]],[0,"salla-offer-modal",{"offer":[32],"offer_name":[32],"offer_message":[32],"hasError":[32],"errorMessage":[32],"productID":[32],"offer_type":[32],"translationLoaded":[32],"addToCartLabel":[32],"open":[64],"showOffer":[64]}],[4,"salla-scopes",{"selection":[1],"searchDisplayLimit":[2,"search-display-limit"],"translationLoaded":[32],"mode":[32],"current_scope":[32],"scopes":[32],"originalScopesList":[32],"selected_scope":[32],"isOpenedBefore":[32],"hasError":[32],"loading":[32],"close":[64],"open":[64],"handleSubmit":[64]}],[0,"salla-localization-modal",{"language":[1537],"currency":[1537],"translationLoaded":[32],"languages":[32],"currencies":[32],"hasError":[32],"errorMessage":[32],"open":[64],"close":[64],"submit":[64]}],[0,"salla-user-profile",{"customFields":[1,"custom-fields"],"minAge":[2,"min-age"],"userData":[32],"userDefinedFields":[32],"disableAction":[32],"isLoading":[32],"first_name_trans":[32],"last_name_trans":[32],"birthday_trans":[32],"birthday_placeholder_trans":[32],"gender_trans":[32],"gender_placeholder_trans":[32],"male_trans":[32],"female_trans":[32],"email_trans":[32],"mobile_trans":[32],"save_btn_trans":[32],"drag_and_drop_trans":[32],"browse_trans":[32],"email_required_trans":[32],"invalid_email_trans":[32],"setCustomFields":[64]}],[0,"salla-bottom-alert",{"type":[513],"icon":[513],"message":[513],"actionUrl":[513,"action-url"],"actionLabel":[513,"action-label"],"storeId":[32],"template":[32],"loading":[32],"templateData":[32],"defaultMessage":[32],"defaultActionLabel":[32],"storeFeatures":[32],"storeDetails":[32],"storePrice":[32],"theDeveloper":[32],"templateInformation":[32],"buyTheTemplate":[32],"isRtl":[32]}],[0,"salla-quick-order",{"quickOrderTitle":[1025,"quick-order-title"],"subTitle":[1025,"sub-title"],"payButtonTitle":[1025,"pay-button-title"],"confirmPayButtonTitle":[1025,"confirm-pay-button-title"],"agreementText":[1025,"agreement-text"],"isEmailRequired":[1028,"is-email-required"],"productId":[1025,"product-id"],"thanksMessage":[1025,"thanks-message"],"quickOrderStyle":[1025,"quick-order-style"],"user":[32],"isAvailable":[32],"oneClick":[32],"expanded":[32],"isTermsRequired":[32],"countryCode":[32],"submitSucess":[32],"placeHolderEmail":[32],"emailOptional":[32],"agreementShowText":[32],"agreementModalHead":[32],"userNameLabel":[32],"termsChecked":[32]}],[0,"salla-user-settings",{"isNotifiable":[516,"is-notifiable"],"deactivateAccount":[32],"promotionalMsgs":[32],"deactivateDesc":[32],"promotionalMsgsDesc":[32],"sorryForLeavingText":[32],"warningText":[32],"keepAccount":[32],"buttonLoading":[32]}],[0,"salla-search",{"inline":[4],"oval":[4],"height":[2],"maxWords":[2,"max-words"],"showAction":[4,"show-action"],"translationLoaded":[32],"results":[32],"loading":[32],"typing":[32],"debounce":[32],"search_term":[32]},[[0,"keydown","handleKeyDown"]]],[0,"salla-menu",{"source":[1],"sourceValue":[1,"source-value"],"topnav":[4],"useReactLink":[4,"use-react-link"],"limit":[2],"menus":[32]}],[4,"salla-social-share",{"url":[513],"urlName":[513,"url-name"],"platforms":[513],"opened":[32],"allPlatforms":[32],"platformIcons":[32],"convertedPlatforms":[32],"open":[64],"refresh":[64]}],[0,"salla-breadcrumb",{"breadcrumbs":[32]}],[4,"salla-cart-summary",{"showCartLabel":[4,"show-cart-label"],"cartSummaryCount":[32],"cartSummaryTotal":[32],"cartLabel":[32],"animateToCart":[64]}],[4,"salla-infinite-scroll",{"nextPage":[1,"next-page"],"autoload":[1028],"container":[1],"loadMoreText":[1,"load-more-text"],"item":[1],"loadMore":[32],"noMore":[32],"failedToLoad":[32]}],[0,"salla-maintenance-alert",{"title":[32],"message":[32],"buttonTitle":[32]}],[4,"salla-quantity-input",{"cartItemId":[8,"cart-item-id"],"quantity":[32],"fireChangeEvent":[32],"decrease":[64],"increase":[64],"setValue":[64]}],[4,"salla-user-menu",{"inline":[516],"avatarOnly":[516,"avatar-only"],"showHeader":[516,"show-header"],"relativeDropdown":[516,"relative-dropdown"],"accountLoading":[32],"opened":[32],"notifications":[32],"orders":[32],"pending_orders":[32],"wishlist":[32],"profile":[32],"rating":[32],"logout":[32],"hello":[32],"first_name":[32],"last_name":[32],"avatar":[32],"is_loggedIn":[32],"badges":[32],"hasBadges":[32],"OrderUpdate":[32]}],[4,"salla-map",{"name":[1],"required":[4],"readonly":[4],"searchable":[1028],"lat":[1026],"lng":[1026],"apiKey":[1025,"api-key"],"modalTitle":[1,"modal-title"],"zoom":[1026],"theme":[1025],"modalActivityTitle":[32],"confirmButtonTitle":[32],"locateButtonTitle":[32],"locateButtonEdit":[32],"searchPlaceholder":[32],"searchInputValue":[32],"formattedAddress":[32],"geolocationError":[32],"searchInput":[32],"mapInput":[32],"mapElement":[32],"selectedLat":[32],"selectedLng":[32],"open":[64]}],[4,"salla-verify",{"display":[1],"type":[1025],"autoReload":[4,"auto-reload"],"supportWebAuth":[4,"support-web-auth"],"translationLoaded":[32],"title":[32],"resendAfter":[32],"hasError":[32],"errorMessage":[32],"isProfileVerify":[32],"getCode":[64],"open":[64]}],[0,"salla-reviews-summary",{"itemId":[2,"item-id"],"canRender":[32],"data":[32],"basedOnLabel":[32]}],[0,"salla-comment-form",{"type":[1537],"showAvatar":[4,"show-avatar"],"itemId":[1544,"item-id"],"placeholder":[32],"submitText":[32],"canComment":[32]}],[4,"salla-color-picker",{"name":[1],"required":[4],"color":[1537],"format":[1],"showCancelButton":[4,"show-cancel-button"],"showTextField":[4,"show-text-field"],"enableAlpha":[4,"enable-alpha"],"widgetColor":[32],"setPickerOption":[64],"movePopUp":[64],"setColorValue":[64],"openPicker":[64],"closePicker":[64],"destroyPicker":[64]}],[0,"salla-products-list",{"source":[1537],"sourceValue":[1032,"source-value"],"limit":[1026],"sortBy":[1025,"sort-by"],"filtersResults":[1540,"filters-results"],"horizontalCards":[516,"horizontal-cards"],"rowCards":[516,"row-cards"],"autoload":[1028],"loadMoreText":[1,"load-more-text"],"productCardComponent":[1,"product-card-component"],"includes":[1025],"page":[32],"nextPage":[32],"hasInfiniteScroll":[32],"hasCustomComponent":[32],"sourceValueIsValid":[32],"placeholderText":[32],"endOfText":[32],"failedLoadMore":[32],"currentPage":[32],"currentCategoryIdFilter":[32],"isReady":[32],"showPlaceholder":[32],"parsedFilters":[32],"setFilters":[64],"reload":[64]}],[4,"salla-product-card",{"product":[1],"horizontal":[4],"shadowOnHover":[4,"shadow-on-hover"],"hideAddBtn":[4,"hide-add-btn"],"fullImage":[4,"full-image"],"minimal":[4],"isSpecial":[4,"is-special"],"showQuantity":[4,"show-quantity"],"productData":[32],"fitImageHeight":[32],"remained":[32],"outOfStock":[32],"donationAmount":[32],"startingPrice":[32],"addToCart":[32],"placeholder":[32]}],[0,"salla-comment-item",{"comment":[16],"hideBought":[16],"has_bought_trans":[32],"rated_trans":[32],"waiting_approval_trans":[32],"has_order_trans":[32],"allowLikes":[32],"allowAttachImages":[32],"helpfulLabel":[32],"likesCount":[32],"likedComments":[32]}],[4,"salla-tab-content",{"name":[1],"isSelected":[32],"getChild":[64]}],[4,"salla-tab-header",{"name":[1],"activeClass":[1,"active-class"],"height":[8],"centered":[4],"isSelected":[32],"getChild":[64]}],[4,"salla-tabs",{"backgroundColor":[1,"background-color"],"vertical":[4]},[[0,"tabSelected","onSelectedTab"]]],[4,"salla-add-product-button",{"channels":[513],"subscribedOptions":[1,"subscribed-options"],"quickBuy":[1540,"quick-buy"],"quantity":[514],"donatingAmount":[514,"donating-amount"],"notifyOptionsAvailability":[516,"notify-options-availability"],"productId":[520,"product-id"],"supportStickyBar":[516,"support-sticky-bar"],"productStatus":[513,"product-status"],"productType":[513,"product-type"],"hasOutOfStockOption":[32],"hasSubscribedOptions":[32],"selectedOptions":[32],"showQuickBuy":[32],"isApplePayActive":[32],"buyNowText":[32]}],[0,"salla-count-down",{"date":[1],"boxed":[4],"size":[1],"color":[1],"labeled":[4],"endText":[1,"end-text"],"digits":[1],"endOfDay":[4,"end-of-day"],"daysLabel":[32],"hoursLabel":[32],"minutesLabel":[32],"secondsLabel":[32],"endLabel":[32],"invalidDate":[32],"offerEnded":[32],"countInterval":[32],"days":[32],"hours":[32],"minutes":[32],"seconds":[32],"endCountDown":[64]}],[0,"salla-datetime-picker",{"value":[1537],"required":[4],"name":[513],"placeholder":[1],"allowInput":[4,"allow-input"],"allowInvalidPreload":[4,"allow-invalid-preload"],"altFormat":[1,"alt-format"],"altInput":[4,"alt-input"],"altInputClass":[1,"alt-input-class"],"appendTo":[16],"ariaDateFormat":[1,"aria-date-format"],"autoFillDefaultTime":[4,"auto-fill-default-time"],"clickOpens":[4,"click-opens"],"closeOnSelect":[4,"close-on-select"],"conjunction":[1],"dateFormat":[1,"date-format"],"defaultDate":[8,"default-date"],"defaultHour":[2,"default-hour"],"defaultMinute":[2,"default-minute"],"defaultSeconds":[2,"default-seconds"],"disable":[16],"disableMobile":[4,"disable-mobile"],"enable":[16],"enableSeconds":[4,"enable-seconds"],"enableTime":[4,"enable-time"],"formatDate":[16],"hourIncrement":[2,"hour-increment"],"inline":[4],"locale":[1],"maxDate":[8,"max-date"],"maxTime":[8,"max-time"],"minDate":[8,"min-date"],"minTime":[8,"min-time"],"minuteIncrement":[2,"minute-increment"],"mode":[1],"monthSelectorType":[1,"month-selector-type"],"nextArrow":[1,"next-arrow"],"noCalendar":[4,"no-calendar"],"dateParser":[16],"position":[1],"positionElement":[16],"prevArrow":[1,"prev-arrow"],"shorthandCurrentMonth":[4,"shorthand-current-month"],"static":[4],"showMonths":[2,"show-months"],"time_24hr":[4,"time_-2-4hr"],"weekNumbers":[4,"week-numbers"],"wrap":[4]}],[0,"salla-product-availability",{"channels":[1],"notifyOptionsAvailability":[4,"notify-options-availability"],"productId":[2,"product-id"],"isSubscribed":[1028,"is-subscribed"],"translationLoaded":[32],"title_":[32],"isVisitorSubscribed":[32]}],[4,"salla-list-tile",{"href":[1],"target":[1]}],[0,"salla-quick-buy",{"type":[1025],"productId":[1025,"product-id"],"cartId":[1025,"cart-id"],"amount":[1538],"currency":[1025],"options":[16],"isRequireShipping":[1028,"is-require-shipping"],"applePayOnly":[1028,"apple-pay-only"],"isApplePayActive":[32],"quickBuy":[32]}],[0,"salla-file-upload",{"value":[1544],"files":[513],"height":[513],"cartItemId":[1,"cart-item-id"],"profileImage":[516,"profile-image"],"name":[1537],"payloadName":[1,"payload-name"],"type":[1],"accept":[1537],"fileId":[2,"file-id"],"url":[1025],"method":[1],"formData":[1,"form-data"],"required":[4],"maxFileSize":[1,"max-file-size"],"disabled":[4],"allowDrop":[4,"allow-drop"],"allowBrowse":[4,"allow-browse"],"allowPaste":[4,"allow-paste"],"allowMultiple":[4,"allow-multiple"],"allowReplace":[4,"allow-replace"],"allowRevert":[4,"allow-revert"],"allowRemove":[4,"allow-remove"],"allowProcess":[4,"allow-process"],"allowReorder":[4,"allow-reorder"],"allowImagePreview":[4,"allow-image-preview"],"imagePreviewHeight":[2,"image-preview-height"],"filePosterHeight":[2,"file-poster-height"],"storeAsFile":[4,"store-as-file"],"forceRevert":[4,"force-revert"],"maxFilesCount":[2,"max-files-count"],"maxParallelUploads":[2,"max-parallel-uploads"],"checkValidity":[4,"check-validity"],"itemInsertLocation":[1,"item-insert-location"],"itemInsertInterval":[2,"item-insert-interval"],"credits":[4],"dropOnPage":[4,"drop-on-page"],"dropOnElement":[4,"drop-on-element"],"dropValidation":[4,"drop-validation"],"ignoredFiles":[16],"instantUpload":[1028,"instant-upload"],"chunkUploads":[4,"chunk-uploads"],"chunkForce":[4,"chunk-force"],"chunkSize":[2,"chunk-size"],"chunkRetryDelays":[16],"labelDecimalSeparator":[1,"label-decimal-separator"],"labelThousandsSeparator":[1,"label-thousands-separator"],"labelIdle":[1025,"label-idle"],"iconRemove":[1,"icon-remove"],"iconProcess":[1,"icon-process"],"iconRetry":[1,"icon-retry"],"iconUndo":[1,"icon-undo"],"max_images_count":[32],"max_count_hint":[32],"uploadedFiles":[32],"isListScrollerListenerAdded":[32],"showMaxCountHint":[32],"setOption":[64]}],[0,"salla-progress-bar",{"donation":[1],"target":[1026],"value":[1026],"height":[1025],"header":[1025],"stripped":[1028],"message":[1025],"unit":[1025],"color":[1025],"hideUnits":[4,"hide-units"]}],[0,"salla-rating-stars",{"name":[1],"size":[1],"value":[2],"reviews":[2],"withLabel":[4,"with-label"],"editable":[4],"translationsLoaded":[32],"labels":[32],"reviewLabel":[32],"selectedStar":[32]}],[4,"salla-placeholder",{"icon":[1],"alignment":[1],"iconSize":[1,"icon-size"],"translationLoaded":[32]}],[0,"salla-skeleton",{"type":[1],"width":[1],"height":[1]}],[4,"salla-slider",{"blockTitle":[513,"block-title"],"listenToThumbnailsOption":[516,"listen-to-thumbnails-option"],"blockSubtitle":[513,"block-subtitle"],"displayAllUrl":[513,"display-all-url"],"arrowsCentered":[516,"arrows-centered"],"verticalThumbs":[516,"vertical-thumbs"],"gridThumbs":[516,"grid-thumbs"],"vertical":[516],"autoHeight":[516,"auto-height"],"showControls":[516,"show-controls"],"controlsOuter":[516,"controls-outer"],"showThumbsControls":[4,"show-thumbs-controls"],"autoPlay":[4,"auto-play"],"slidesPerView":[1,"slides-per-view"],"pagination":[4],"centered":[4],"loop":[4],"direction":[1537],"type":[1],"sliderConfig":[520,"slider-config"],"thumbsConfig":[520,"thumbs-config"],"currentIndex":[32],"isEnd":[32],"isBeginning":[32],"swiperScript":[32],"displayAllTitle":[32],"windowWidth":[32],"slideTo":[64],"slideNext":[64],"slidePrev":[64],"slideToLoop":[64],"slideNextLoop":[64],"slidePrevLoop":[64],"slideReset":[64],"slideToClosest":[64],"update":[64],"updateAutoHeight":[64],"updateSlides":[64],"updateProgress":[64],"updateSlidesClasses":[64],"getSlides":[64]}],[0,"salla-tel-input",{"phone":[1025],"autofocus":[516],"name":[1],"countryCode":[1025,"country-code"],"mobileRequired":[32],"countryCodeLabel":[32],"mobileLabel":[32],"tooShort":[32],"tooLong":[32],"invalidCountryCode":[32],"invalidNumber":[32],"errorMap":[32],"getValues":[64],"isValid":[64]}],[4,"salla-modal",{"isClosable":[1028,"is-closable"],"width":[513],"position":[513],"visible":[516],"hasSkeleton":[516,"has-skeleton"],"isLoading":[1540,"is-loading"],"subTitleFirst":[4,"sub-title-first"],"noPadding":[4,"no-padding"],"subTitle":[1,"sub-title"],"centered":[4],"iconStyle":[1,"icon-style"],"modalTitle":[32],"open":[64],"close":[64],"setTitle":[64],"loading":[64],"stopLoading":[64]},[[0,"keyup","handleKeyUp"]]],[0,"salla-loading",{"size":[8],"width":[8],"color":[1],"bgColor":[1,"bg-color"]}],[4,"salla-button",{"shape":[513],"color":[513],"fill":[513],"size":[513],"width":[513],"loading":[516],"disabled":[516],"loaderPosition":[1,"loader-position"],"href":[1],"type":[513],"load":[64],"stop":[64],"setText":[64],"disable":[64],"enable":[64]}]]],["p-1b730cf7.system",[[4,"salla-filters-widget",{"withLoadMore":[1028,"with-load-more"],"filtersData":[16],"option":[16],"isOpen":[32],"isShowMore":[32],"showMoreLabel":[32],"showLessLabel":[32],"page":[32],"setWidgetHeight":[64],"reset":[64],"showMore":[64],"toggleWidget":[64]}]]],["p-96611fdf.system",[[0,"salla-notification-item",{"notification":[16]}]]],["p-49fbd428.system",[[0,"salla-booking-field",{"option":[16],"productId":[2,"product-id"],"bookNowLabel":[32],"editLabel":[32],"bookedLabel":[32],"selectDate":[32],"bookingUrl":[32],"iframeReady":[32],"reservations":[32],"reservationsInput":[32]}],[4,"salla-conditional-fields",null,[[0,"change","changeHandler"]]]]],["p-35a7fdab.system",[[0,"salla-price-range",{"minPrice":[1032,"min-price"],"maxPrice":[1032,"max-price"],"option":[16],"filtersData":[520,"filters-data"],"min":[32],"max":[32],"priceOptions":[32],"moreThanLabel":[32],"lessThanLabel":[32],"toLabel":[32],"fromLabel":[32],"typing":[32],"isMin":[32],"isRTL":[32],"reset":[64]}]]]]'),e)}))}}}));
4
+ System.register(["./p-f422bbf9.system.js","./p-2a04525b.system.js","./p-9beb6b7b.system.js"],(function(e,t){"use strict";var a,l,o;return{setters:[function(t){a=t.p;l=t.b;e("setNonce",t.s)},function(e){o=e.g},function(){}],execute:function(){var e=function(){var e=t.meta.url;var l={};if(e!==""){l.resourcesUrl=new URL(".",e).href}return a(l)};e().then((function(e){o();return l(JSON.parse('[["p-8b6f641f.system",[[0,"salla-offer",{"productCardComponent":[1,"product-card-component"],"offersList":[32],"userCurrency":[32],"isMultipleBank":[32],"title":[32],"currentPage":[32],"hasCustomComponent":[32],"isBankOffer":[32],"canRender":[32],"showOffer":[32],"offer_with_price_text":[32],"with_discount_text":[32],"product_discount_text":[32],"special_offer_text":[32],"multipleBankOfferTitleText":[32],"multipleBankOfferTitleDescription":[32],"buy_quantity_text":[32]}]]],["p-bacd1629.system",[[0,"salla-products-slider",{"blockTitle":[1,"block-title"],"subTitle":[1,"sub-title"],"sliderId":[1,"slider-id"],"displayAllUrl":[1,"display-all-url"],"autoplay":[1028],"source":[1537],"sourceValue":[1,"source-value"],"limit":[1026],"sliderConfig":[520,"slider-config"],"productCardComponent":[1,"product-card-component"],"includes":[1025],"productsData":[32],"isReady":[32],"sourceValueIsValid":[32],"hasCustomComponent":[32],"apiUrl":[32],"parsedSourceValue":[32]}]]],["p-438ff239.system",[[0,"salla-product-options",{"productId":[2,"product-id"],"options":[1],"optionsData":[32],"outOfStockText":[32],"donationAmount":[32],"selectDonationAmount":[32],"selectAmount":[32],"isCustomDonation":[32],"selectedOptions":[32],"canDisabled":[32],"selectedSkus":[32],"selectedOutSkus":[32],"disableCardValue":[32],"availableDigitalCardValues":[32],"getSelectedOptionsData":[64],"reportValidity":[64],"hasOutOfStockOption":[64],"getSelectedOptions":[64],"getOption":[64]}]]],["p-9a4e9353.system",[[0,"salla-filters",{"filters":[1040],"isSidebarOpen":[32],"filtersData":[32],"apply":[32],"reset":[32],"getFilters":[64],"applyFilters":[64],"resetFilters":[64]}]]],["p-58a14772.system",[[0,"salla-notifications",{"loadMoreText":[1,"load-more-text"],"itemPerPage":[2,"item-per-page"],"pagination":[32],"total":[32],"showPlaceholder":[32],"nextPage":[32],"no_notifications_trans":[32],"load_more_text_trans":[32]}]]],["p-a2f66161.system",[[0,"salla-order-summary",{"orderId":[514,"order-id"],"codeCopied":[32],"noItemFound":[32],"order_items":[32]}]]],["p-289fecde.system",[[0,"salla-reviews",{"displayAllLink":[516,"display-all-link"],"source":[513],"sourceValue":[513,"source-value"],"limit":[514],"type":[1],"sort":[1],"hideCustomerInfo":[4,"hide-customer-info"],"reviews":[32],"isRTL":[32],"showReviews":[32],"testimonialText":[32],"displayAllLinkText":[32]}]]],["p-5e82c351.system",[[0,"salla-conditional-offer",{"offer":[32],"products":[32],"isLoading":[32],"canRender":[32]}]]],["p-a9ca0985.system",[[0,"salla-orders",{"params":[16],"loadMoreText":[1,"load-more-text"],"orderNumberText":[32],"totalOrderText":[32],"orderDateText":[32],"orderStatusText":[32],"noOrderText":[32],"load_more_text_trans":[32],"languageCode":[32],"orders":[32],"pagination":[32],"hasInfiniteScroll":[32],"total":[32],"nextPage":[32],"showPlaceholder":[32]}]]],["p-2e845bd2.system",[[0,"salla-advertisement",{"position":[32],"advertisements":[32],"advertIcon":[32],"currentSlug":[32]}]]],["p-eeec75e7.system",[[0,"salla-app-install-alert",{"data":[32],"ctaLink":[32],"open":[32],"closing":[32]}]]],["p-4924939b.system",[[0,"salla-apps-icons",{"hideTitle":[4,"hide-title"],"appsTitle":[1,"apps-title"],"vertical":[4],"apps":[32]}]]],["p-bbdf4ca3.system",[[0,"salla-contacts",{"contactsTitle":[1025,"contacts-title"],"hideTitle":[4,"hide-title"],"isHeader":[4,"is-header"],"horizontal":[4],"iconsOnly":[4,"icons-only"],"contacts":[32],"iconsList":[32]}]]],["p-7da8b73b.system",[[0,"salla-installment",{"price":[1],"language":[1],"currency":[1],"tamaraIsActive":[32],"tabbyIsActive":[32],"spotiiIsActive":[32],"mispayActive":[32],"installment_sheria_text":[32]}]]],["p-b4006070.system",[[0,"salla-loyalty-prize-item",{"item":[16]}]]],["p-b0473c73.system",[[0,"salla-metadata",{"entity":[1],"entityId":[8,"entity-id"],"specs":[32],"download":[32]}]]],["p-718fb6da.system",[[0,"salla-payments",{"exclude":[1040]}]]],["p-817fe6ad.system",[[0,"salla-social",{"links":[32],"iconsList":[32]}]]],["p-680a2e1e.system",[[4,"salla-gifting",{"productId":[2,"product-id"],"widgetTitle":[1,"widget-title"],"widgetSubtitle":[1,"widget-subtitle"],"sectionTitle":[32],"sectionSubtitle":[32],"sectionBtnText":[32],"giftDetails":[32],"selectImageForYourGift":[32],"selectImageOrUpload":[32],"selectGiftMessage":[32],"giftCustomText":[32],"textId":[32],"incorrectGiftText":[32],"nextStep":[32],"senderNameLabel":[32],"receiverNameFieldLabel":[32],"receiverMobileFieldLabel":[32],"receiverEmailFieldLabel":[32],"emailPlaceholder":[32],"sendLater":[32],"selectSendDateAndTime":[32],"canNotEditOrderAfterSelectDate":[32],"sendGift":[32],"donationRequired":[32],"currentStep":[32],"showCalendar":[32],"showGiftText":[32],"currentLang":[32],"parentClass":[32],"errors":[32],"gift":[32],"selectedGiftTextOption":[32],"showTextArea":[32],"selectedImage":[32],"uploadedImage":[32],"selectedText":[32],"senderName":[32],"errorMessage":[32],"hasError":[32],"quantity":[32],"deliveryDate":[32],"timeZone":[32],"receiverName":[32],"receiverMobile":[32],"receiverCountryCode":[32],"receiverEmail":[32],"open":[64],"close":[64],"goToStep2":[64]}],[4,"salla-loyalty",{"prizePoints":[1544,"prize-points"],"customerPoints":[1538,"customer-points"],"prizeTitle":[1537,"prize-title"],"allowEmail":[4,"allow-email"],"allowMobile":[4,"allow-mobile"],"requireEmail":[4,"require-email"],"guestMessage":[1025,"guest-message"],"loyaltyProgram":[32],"buttonLoading":[32],"selectedItem":[32],"askConfirmation":[32],"is_loggedin":[32],"hasError":[32],"errorMessage":[32],"translationLoaded":[32],"open":[64],"close":[64],"resetExchange":[64],"exchangeLoyaltyPoint":[64]}],[0,"salla-comments",{"itemId":[2,"item-id"],"loadMoreText":[1,"load-more-text"],"hideForm":[4,"hide-form"],"blockTitle":[1,"block-title"],"hideTitle":[4,"hide-title"],"type":[1],"showFormAvatar":[4,"show-form-avatar"],"hideBought":[4,"hide-bought"],"sort":[1],"testimonials":[4],"comments":[32],"pagination":[32],"total":[32],"showPlaceholder":[32],"nextPage":[32],"mostHelpfulLabel":[32],"noComments":[32],"comment_title":[32],"comment_name":[32],"placeholder_text":[32],"showRatingSummary":[32],"allowLikes":[32],"reload":[64]}],[4,"salla-product-size-guide",{"guides":[32],"productId":[32],"placeholder_title":[32],"placeholder_description":[32],"modal_title":[32],"hasError":[32],"open":[64],"close":[64]}],[0,"salla-rating-modal",{"orderId":[2,"order-id"],"order":[32],"hasError":[32],"showContactWidget":[32],"errorMessage":[32],"dragAndDropFilesLabel":[32],"contactSubjectLabel":[32],"editReviewLabel":[32],"allowedImagesTypesLabel":[32],"addImagesLabel":[32],"editImagesLabel":[32],"threeImagesMax":[32],"areYouSureLabel":[32],"confirmDeletionLabel":[32],"cancelLabel":[32],"confirmDeleteBtn":[32],"updatedSuccessfullyLabel":[32],"deletedSuccessfullyLabel":[32],"allowAttachImages":[32],"allowContactSupport":[32],"contactUsLabel":[32],"images":[32],"productImages":[32],"editItemImages":[32],"contact_body":[32],"editMode":[32],"defaultMode":[32],"deleteMode":[32],"shouldOpenDeleteModal":[32],"editType":[32],"editFeedbackId":[32],"deleteFeedbackId":[32],"editItem":[32],"open":[64],"close":[64]}],[4,"salla-login-modal",{"isEmailAllowed":[1028,"is-email-allowed"],"isMobileAllowed":[1028,"is-mobile-allowed"],"isEmailRequired":[1028,"is-email-required"],"supportWebAuth":[516,"support-web-auth"],"inline":[516],"withoutReload":[4,"without-reload"],"currentTabName":[32],"regType":[32],"translationLoaded":[32],"isModalOpen":[32],"currentPhone":[32],"currentEmail":[32],"title":[32],"emailErrorMsg":[32],"firstNameErrorMsg":[32],"lastNameErrorMsg":[32],"hasError":[32],"errorMessage":[32],"dragAndDrop":[32],"browseFromFiles":[32],"customFields":[32],"uploadedImage":[32],"open":[64]},[[8,"verified","onVerified"]]],[0,"salla-offer-modal",{"offer":[32],"offer_name":[32],"offer_message":[32],"hasError":[32],"errorMessage":[32],"productID":[32],"offer_type":[32],"translationLoaded":[32],"addToCartLabel":[32],"open":[64],"showOffer":[64]}],[4,"salla-scopes",{"selection":[1],"searchDisplayLimit":[2,"search-display-limit"],"translationLoaded":[32],"mode":[32],"current_scope":[32],"scopes":[32],"originalScopesList":[32],"selected_scope":[32],"isOpenedBefore":[32],"hasError":[32],"loading":[32],"close":[64],"open":[64],"handleSubmit":[64]}],[0,"salla-localization-modal",{"language":[1537],"currency":[1537],"translationLoaded":[32],"languages":[32],"currencies":[32],"hasError":[32],"errorMessage":[32],"open":[64],"close":[64],"submit":[64]}],[0,"salla-user-profile",{"customFields":[1,"custom-fields"],"minAge":[2,"min-age"],"userData":[32],"userDefinedFields":[32],"disableAction":[32],"isLoading":[32],"first_name_trans":[32],"last_name_trans":[32],"birthday_trans":[32],"birthday_placeholder_trans":[32],"gender_trans":[32],"gender_placeholder_trans":[32],"male_trans":[32],"female_trans":[32],"email_trans":[32],"mobile_trans":[32],"save_btn_trans":[32],"drag_and_drop_trans":[32],"browse_trans":[32],"email_required_trans":[32],"invalid_email_trans":[32],"setCustomFields":[64]}],[0,"salla-bottom-alert",{"type":[513],"icon":[513],"message":[513],"actionUrl":[513,"action-url"],"actionLabel":[513,"action-label"],"storeId":[32],"template":[32],"loading":[32],"templateData":[32],"defaultMessage":[32],"defaultActionLabel":[32],"storeFeatures":[32],"storeDetails":[32],"storePrice":[32],"theDeveloper":[32],"templateInformation":[32],"buyTheTemplate":[32],"isRtl":[32]}],[0,"salla-quick-order",{"quickOrderTitle":[1025,"quick-order-title"],"subTitle":[1025,"sub-title"],"payButtonTitle":[1025,"pay-button-title"],"confirmPayButtonTitle":[1025,"confirm-pay-button-title"],"agreementText":[1025,"agreement-text"],"isEmailRequired":[1028,"is-email-required"],"productId":[1025,"product-id"],"thanksMessage":[1025,"thanks-message"],"quickOrderStyle":[1025,"quick-order-style"],"user":[32],"isAvailable":[32],"oneClick":[32],"expanded":[32],"isTermsRequired":[32],"countryCode":[32],"submitSucess":[32],"placeHolderEmail":[32],"emailOptional":[32],"agreementShowText":[32],"agreementModalHead":[32],"userNameLabel":[32],"termsChecked":[32]}],[0,"salla-user-settings",{"isNotifiable":[516,"is-notifiable"],"deactivateAccount":[32],"promotionalMsgs":[32],"deactivateDesc":[32],"promotionalMsgsDesc":[32],"sorryForLeavingText":[32],"warningText":[32],"keepAccount":[32],"buttonLoading":[32]}],[0,"salla-search",{"inline":[4],"oval":[4],"height":[2],"maxWords":[2,"max-words"],"showAction":[4,"show-action"],"translationLoaded":[32],"results":[32],"loading":[32],"typing":[32],"debounce":[32],"search_term":[32]},[[0,"keydown","handleKeyDown"]]],[0,"salla-menu",{"source":[1],"sourceValue":[1,"source-value"],"topnav":[4],"useReactLink":[4,"use-react-link"],"limit":[2],"menus":[32]}],[4,"salla-social-share",{"url":[513],"urlName":[513,"url-name"],"platforms":[513],"opened":[32],"allPlatforms":[32],"platformIcons":[32],"convertedPlatforms":[32],"open":[64],"refresh":[64]}],[0,"salla-breadcrumb",{"breadcrumbs":[32]}],[4,"salla-cart-summary",{"showCartLabel":[4,"show-cart-label"],"cartSummaryCount":[32],"cartSummaryTotal":[32],"cartLabel":[32],"animateToCart":[64]}],[4,"salla-infinite-scroll",{"nextPage":[1,"next-page"],"autoload":[1028],"container":[1],"loadMoreText":[1,"load-more-text"],"item":[1],"loadMore":[32],"noMore":[32],"failedToLoad":[32]}],[0,"salla-maintenance-alert",{"title":[32],"message":[32],"buttonTitle":[32]}],[4,"salla-quantity-input",{"cartItemId":[8,"cart-item-id"],"quantity":[32],"fireChangeEvent":[32],"decrease":[64],"increase":[64],"setValue":[64]}],[4,"salla-user-menu",{"inline":[516],"avatarOnly":[516,"avatar-only"],"showHeader":[516,"show-header"],"relativeDropdown":[516,"relative-dropdown"],"accountLoading":[32],"opened":[32],"notifications":[32],"orders":[32],"pending_orders":[32],"wishlist":[32],"profile":[32],"rating":[32],"logout":[32],"hello":[32],"first_name":[32],"last_name":[32],"avatar":[32],"is_loggedIn":[32],"badges":[32],"hasBadges":[32],"OrderUpdate":[32]}],[4,"salla-map",{"name":[1],"required":[4],"readonly":[4],"searchable":[1028],"lat":[1026],"lng":[1026],"apiKey":[1025,"api-key"],"modalTitle":[1,"modal-title"],"zoom":[1026],"theme":[1025],"modalActivityTitle":[32],"confirmButtonTitle":[32],"locateButtonTitle":[32],"locateButtonEdit":[32],"searchPlaceholder":[32],"searchInputValue":[32],"formattedAddress":[32],"geolocationError":[32],"searchInput":[32],"mapInput":[32],"mapElement":[32],"selectedLat":[32],"selectedLng":[32],"open":[64]}],[4,"salla-verify",{"display":[1],"type":[1025],"autoReload":[4,"auto-reload"],"supportWebAuth":[4,"support-web-auth"],"translationLoaded":[32],"title":[32],"resendAfter":[32],"hasError":[32],"errorMessage":[32],"isProfileVerify":[32],"getCode":[64],"open":[64]}],[0,"salla-reviews-summary",{"itemId":[2,"item-id"],"canRender":[32],"data":[32],"basedOnLabel":[32]}],[0,"salla-comment-form",{"type":[1537],"showAvatar":[4,"show-avatar"],"itemId":[1544,"item-id"],"placeholder":[32],"submitText":[32],"canComment":[32]}],[4,"salla-color-picker",{"name":[1],"required":[4],"color":[1537],"format":[1],"showCancelButton":[4,"show-cancel-button"],"showTextField":[4,"show-text-field"],"enableAlpha":[4,"enable-alpha"],"widgetColor":[32],"setPickerOption":[64],"movePopUp":[64],"setColorValue":[64],"openPicker":[64],"closePicker":[64],"destroyPicker":[64]}],[0,"salla-products-list",{"source":[1537],"sourceValue":[1032,"source-value"],"limit":[1026],"sortBy":[1025,"sort-by"],"filtersResults":[1540,"filters-results"],"horizontalCards":[516,"horizontal-cards"],"rowCards":[516,"row-cards"],"autoload":[1028],"loadMoreText":[1,"load-more-text"],"productCardComponent":[1,"product-card-component"],"includes":[1025],"page":[32],"nextPage":[32],"hasInfiniteScroll":[32],"hasCustomComponent":[32],"sourceValueIsValid":[32],"placeholderText":[32],"endOfText":[32],"failedLoadMore":[32],"currentPage":[32],"currentCategoryIdFilter":[32],"isReady":[32],"showPlaceholder":[32],"parsedFilters":[32],"setFilters":[64],"reload":[64]}],[4,"salla-product-card",{"product":[1],"horizontal":[4],"shadowOnHover":[4,"shadow-on-hover"],"hideAddBtn":[4,"hide-add-btn"],"fullImage":[4,"full-image"],"minimal":[4],"isSpecial":[4,"is-special"],"showQuantity":[4,"show-quantity"],"productData":[32],"fitImageHeight":[32],"remained":[32],"outOfStock":[32],"donationAmount":[32],"startingPrice":[32],"addToCart":[32],"placeholder":[32]}],[0,"salla-comment-item",{"comment":[16],"hideBought":[16],"has_bought_trans":[32],"rated_trans":[32],"waiting_approval_trans":[32],"has_order_trans":[32],"allowLikes":[32],"allowAttachImages":[32],"helpfulLabel":[32],"likesCount":[32],"likedComments":[32]}],[4,"salla-tab-content",{"name":[1],"isSelected":[32],"getChild":[64]}],[4,"salla-tab-header",{"name":[1],"activeClass":[1,"active-class"],"height":[8],"centered":[4],"isSelected":[32],"getChild":[64]}],[4,"salla-tabs",{"backgroundColor":[1,"background-color"],"vertical":[4]},[[0,"tabSelected","onSelectedTab"]]],[4,"salla-add-product-button",{"channels":[513],"subscribedOptions":[1,"subscribed-options"],"quickBuy":[1540,"quick-buy"],"quantity":[514],"donatingAmount":[514,"donating-amount"],"notifyOptionsAvailability":[516,"notify-options-availability"],"productId":[520,"product-id"],"supportStickyBar":[516,"support-sticky-bar"],"productStatus":[513,"product-status"],"productType":[513,"product-type"],"hasOutOfStockOption":[32],"hasSubscribedOptions":[32],"selectedOptions":[32],"showQuickBuy":[32],"isApplePayActive":[32],"buyNowText":[32]}],[0,"salla-count-down",{"date":[1],"boxed":[4],"size":[1],"color":[1],"labeled":[4],"endText":[1,"end-text"],"digits":[1],"endOfDay":[4,"end-of-day"],"daysLabel":[32],"hoursLabel":[32],"minutesLabel":[32],"secondsLabel":[32],"endLabel":[32],"invalidDate":[32],"offerEnded":[32],"countInterval":[32],"days":[32],"hours":[32],"minutes":[32],"seconds":[32],"endCountDown":[64]}],[0,"salla-datetime-picker",{"value":[1537],"required":[4],"name":[513],"placeholder":[1],"allowInput":[4,"allow-input"],"allowInvalidPreload":[4,"allow-invalid-preload"],"altFormat":[1,"alt-format"],"altInput":[4,"alt-input"],"altInputClass":[1,"alt-input-class"],"appendTo":[16],"ariaDateFormat":[1,"aria-date-format"],"autoFillDefaultTime":[4,"auto-fill-default-time"],"clickOpens":[4,"click-opens"],"closeOnSelect":[4,"close-on-select"],"conjunction":[1],"dateFormat":[1,"date-format"],"defaultDate":[8,"default-date"],"defaultHour":[2,"default-hour"],"defaultMinute":[2,"default-minute"],"defaultSeconds":[2,"default-seconds"],"disable":[16],"disableMobile":[4,"disable-mobile"],"enable":[16],"enableSeconds":[4,"enable-seconds"],"enableTime":[4,"enable-time"],"formatDate":[16],"hourIncrement":[2,"hour-increment"],"inline":[4],"locale":[1],"maxDate":[8,"max-date"],"maxTime":[8,"max-time"],"minDate":[8,"min-date"],"minTime":[8,"min-time"],"minuteIncrement":[2,"minute-increment"],"mode":[1],"monthSelectorType":[1,"month-selector-type"],"nextArrow":[1,"next-arrow"],"noCalendar":[4,"no-calendar"],"dateParser":[16],"position":[1],"positionElement":[16],"prevArrow":[1,"prev-arrow"],"shorthandCurrentMonth":[4,"shorthand-current-month"],"static":[4],"showMonths":[2,"show-months"],"time_24hr":[4,"time_-2-4hr"],"weekNumbers":[4,"week-numbers"],"wrap":[4]}],[0,"salla-product-availability",{"channels":[1],"notifyOptionsAvailability":[4,"notify-options-availability"],"productId":[2,"product-id"],"isSubscribed":[1028,"is-subscribed"],"translationLoaded":[32],"title_":[32],"isVisitorSubscribed":[32]}],[4,"salla-list-tile",{"href":[1],"target":[1]}],[0,"salla-quick-buy",{"type":[1025],"productId":[1025,"product-id"],"cartId":[1025,"cart-id"],"amount":[1538],"currency":[1025],"options":[16],"isRequireShipping":[1028,"is-require-shipping"],"applePayOnly":[1028,"apple-pay-only"],"isApplePayActive":[32],"quickBuy":[32]}],[0,"salla-file-upload",{"value":[1544],"files":[513],"height":[513],"cartItemId":[1,"cart-item-id"],"profileImage":[516,"profile-image"],"name":[1537],"payloadName":[1,"payload-name"],"type":[1],"accept":[1537],"fileId":[2,"file-id"],"url":[1025],"method":[1],"formData":[1,"form-data"],"required":[4],"maxFileSize":[1,"max-file-size"],"disabled":[4],"allowDrop":[4,"allow-drop"],"allowBrowse":[4,"allow-browse"],"allowPaste":[4,"allow-paste"],"allowMultiple":[4,"allow-multiple"],"allowReplace":[4,"allow-replace"],"allowRevert":[4,"allow-revert"],"allowRemove":[4,"allow-remove"],"allowProcess":[4,"allow-process"],"allowReorder":[4,"allow-reorder"],"allowImagePreview":[4,"allow-image-preview"],"imagePreviewHeight":[2,"image-preview-height"],"filePosterHeight":[2,"file-poster-height"],"storeAsFile":[4,"store-as-file"],"forceRevert":[4,"force-revert"],"maxFilesCount":[2,"max-files-count"],"maxParallelUploads":[2,"max-parallel-uploads"],"checkValidity":[4,"check-validity"],"itemInsertLocation":[1,"item-insert-location"],"itemInsertInterval":[2,"item-insert-interval"],"credits":[4],"dropOnPage":[4,"drop-on-page"],"dropOnElement":[4,"drop-on-element"],"dropValidation":[4,"drop-validation"],"ignoredFiles":[16],"instantUpload":[1028,"instant-upload"],"chunkUploads":[4,"chunk-uploads"],"chunkForce":[4,"chunk-force"],"chunkSize":[2,"chunk-size"],"chunkRetryDelays":[16],"labelDecimalSeparator":[1,"label-decimal-separator"],"labelThousandsSeparator":[1,"label-thousands-separator"],"labelIdle":[1025,"label-idle"],"iconRemove":[1,"icon-remove"],"iconProcess":[1,"icon-process"],"iconRetry":[1,"icon-retry"],"iconUndo":[1,"icon-undo"],"max_images_count":[32],"max_count_hint":[32],"uploadedFiles":[32],"isListScrollerListenerAdded":[32],"showMaxCountHint":[32],"setOption":[64]}],[0,"salla-progress-bar",{"donation":[1],"target":[1026],"value":[1026],"height":[1025],"header":[1025],"stripped":[1028],"message":[1025],"unit":[1025],"color":[1025],"hideUnits":[4,"hide-units"]}],[0,"salla-rating-stars",{"name":[1],"size":[1],"value":[2],"reviews":[2],"withLabel":[4,"with-label"],"editable":[4],"translationsLoaded":[32],"labels":[32],"reviewLabel":[32],"selectedStar":[32]}],[4,"salla-placeholder",{"icon":[1],"alignment":[1],"iconSize":[1,"icon-size"],"translationLoaded":[32]}],[0,"salla-skeleton",{"type":[1],"width":[1],"height":[1]}],[4,"salla-slider",{"blockTitle":[513,"block-title"],"listenToThumbnailsOption":[516,"listen-to-thumbnails-option"],"blockSubtitle":[513,"block-subtitle"],"displayAllUrl":[513,"display-all-url"],"arrowsCentered":[516,"arrows-centered"],"verticalThumbs":[516,"vertical-thumbs"],"gridThumbs":[516,"grid-thumbs"],"vertical":[516],"autoHeight":[516,"auto-height"],"showControls":[516,"show-controls"],"controlsOuter":[516,"controls-outer"],"showThumbsControls":[4,"show-thumbs-controls"],"autoPlay":[4,"auto-play"],"slidesPerView":[1,"slides-per-view"],"pagination":[4],"centered":[4],"loop":[4],"direction":[1537],"type":[1],"sliderConfig":[520,"slider-config"],"thumbsConfig":[520,"thumbs-config"],"currentIndex":[32],"isEnd":[32],"isBeginning":[32],"swiperScript":[32],"displayAllTitle":[32],"windowWidth":[32],"slideTo":[64],"slideNext":[64],"slidePrev":[64],"slideToLoop":[64],"slideNextLoop":[64],"slidePrevLoop":[64],"slideReset":[64],"slideToClosest":[64],"update":[64],"updateAutoHeight":[64],"updateSlides":[64],"updateProgress":[64],"updateSlidesClasses":[64],"getSlides":[64]}],[0,"salla-tel-input",{"phone":[1025],"autofocus":[516],"name":[1],"countryCode":[1025,"country-code"],"mobileRequired":[32],"countryCodeLabel":[32],"mobileLabel":[32],"tooShort":[32],"tooLong":[32],"invalidCountryCode":[32],"invalidNumber":[32],"errorMap":[32],"getValues":[64],"isValid":[64]}],[4,"salla-modal",{"isClosable":[1028,"is-closable"],"width":[513],"position":[513],"visible":[516],"hasSkeleton":[516,"has-skeleton"],"isLoading":[1540,"is-loading"],"subTitleFirst":[4,"sub-title-first"],"noPadding":[4,"no-padding"],"subTitle":[1,"sub-title"],"centered":[4],"iconStyle":[1,"icon-style"],"modalTitle":[32],"open":[64],"close":[64],"setTitle":[64],"loading":[64],"stopLoading":[64]},[[0,"keyup","handleKeyUp"]]],[0,"salla-loading",{"size":[8],"width":[8],"color":[1],"bgColor":[1,"bg-color"]}],[4,"salla-button",{"shape":[513],"color":[513],"fill":[513],"size":[513],"width":[513],"loading":[516],"disabled":[516],"loaderPosition":[1,"loader-position"],"href":[1],"type":[513],"load":[64],"stop":[64],"setText":[64],"disable":[64],"enable":[64]}]]],["p-1b730cf7.system",[[4,"salla-filters-widget",{"withLoadMore":[1028,"with-load-more"],"filtersData":[16],"option":[16],"isOpen":[32],"isShowMore":[32],"showMoreLabel":[32],"showLessLabel":[32],"page":[32],"setWidgetHeight":[64],"reset":[64],"showMore":[64],"toggleWidget":[64]}]]],["p-96611fdf.system",[[0,"salla-notification-item",{"notification":[16]}]]],["p-ee43190e.system",[[0,"salla-booking-field",{"option":[16],"productId":[2,"product-id"],"bookNowLabel":[32],"editLabel":[32],"bookedLabel":[32],"selectDate":[32],"bookingUrl":[32],"iframeReady":[32],"reservations":[32],"reservationsInput":[32]}],[4,"salla-conditional-fields",null,[[0,"change","changeHandler"]]]]],["p-35a7fdab.system",[[0,"salla-price-range",{"minPrice":[1032,"min-price"],"maxPrice":[1032,"max-price"],"option":[16],"filtersData":[520,"filters-data"],"min":[32],"max":[32],"priceOptions":[32],"moreThanLabel":[32],"lessThanLabel":[32],"toLabel":[32],"fromLabel":[32],"typing":[32],"isMin":[32],"isRTL":[32],"reset":[64]}]]]]'),e)}))}}}));
5
5
  //# sourceMappingURL=p-daf1aa98.system.js.map
@@ -1,5 +1,5 @@
1
1
  var __awaiter=this&&this.__awaiter||function(e,t,n,o){function a(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,i){function r(e){try{l(o.next(e))}catch(e){i(e)}}function s(e){try{l(o["throw"](e))}catch(e){i(e)}}function l(e){e.done?n(e.value):a(e.value).then(r,s)}l((o=o.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var n={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},o,a,i,r;return r={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(r[Symbol.iterator]=function(){return this}),r;function s(e){return function(t){return l([e,t])}}function l(s){if(o)throw new TypeError("Generator is already executing.");while(r&&(r=0,s[0]&&(n=0)),n)try{if(o=1,a&&(i=s[0]&2?a["return"]:s[0]?a["throw"]||((i=a["return"])&&i.call(a),0):a.next)&&!(i=i.call(a,s[1])).done)return i;if(a=0,i)s=[s[0]&2,i.value];switch(s[0]){case 0:case 1:i=s;break;case 4:n.label++;return{value:s[1],done:false};case 5:n.label++;a=s[1];s=[0];continue;case 7:s=n.ops.pop();n.trys.pop();continue;default:if(!(i=n.trys,i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){n=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){n.label=s[1];break}if(s[0]===6&&n.label<i[1]){n.label=i[1];i=s;break}if(i&&n.label<i[2]){n.label=i[2];n.ops.push(s);break}if(i[2])n.ops.pop();n.trys.pop();continue}s=t.call(e,n)}catch(e){s=[6,e];a=0}finally{o=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};
2
2
  /*!
3
3
  * Crafted with ❤ by Salla
4
- */System.register(["./p-f422bbf9.system.js"],(function(e){"use strict";var t,n,o,a,i;return{setters:[function(e){t=e.r;n=e.c;o=e.h;a=e.H;i=e.g}],execute:function(){var r='\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>calendar-time</title>\n<path d="M22.667 17.333c-0.737 0-1.333 0.596-1.333 1.333v2.667h-2.667c-0.737 0-1.333 0.596-1.333 1.333s0.596 1.333 1.333 1.333h4c0.737 0 1.333-0.596 1.333-1.333v-4c0-0.737-0.596-1.333-1.333-1.333zM28 2.667h-2.667v-1.333c0-0.736-0.596-1.333-1.333-1.333s-1.333 0.597-1.333 1.333v1.333h-13.333v-1.333c0-0.736-0.596-1.333-1.333-1.333s-1.333 0.597-1.333 1.333v1.333h-2.667c-2.205 0-4 1.795-4 4v21.333c0 2.205 1.795 4 4 4h5.363c0.737 0 1.333-0.596 1.333-1.333s-0.596-1.333-1.333-1.333h-5.363c-0.736 0-1.333-0.597-1.333-1.333v-21.333c0-0.736 0.597-1.333 1.333-1.333h2.667v2.667c0 0.736 0.596 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-2.667h13.333v2.667c0 0.736 0.596 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-2.667h2.667c0.736 0 1.333 0.599 1.333 1.333v2.696c0 0.736 0.596 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-2.696c0-2.205-1.795-4-4-4zM22 12c-5.515 0-10 4.485-10 10s4.485 10 10 10 10-4.485 10-10-4.485-10-10-10zM22 29.333c-4.043 0-7.333-3.291-7.333-7.333s3.291-7.333 7.333-7.333 7.333 3.291 7.333 7.333-3.291 7.333-7.333 7.333z"></path>\n</svg>\n';var s='\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>calendar</title>\n<path d="M28 2.667h-2.667v-1.333c0-0.736-0.597-1.333-1.333-1.333s-1.333 0.597-1.333 1.333v1.333h-13.333v-1.333c0-0.736-0.597-1.333-1.333-1.333s-1.333 0.597-1.333 1.333v1.333h-2.667c-2.205 0-4 1.795-4 4v21.333c0 2.205 1.795 4 4 4h24c2.205 0 4-1.795 4-4v-21.333c0-2.205-1.795-4-4-4zM29.333 28c0 0.736-0.599 1.333-1.333 1.333h-24c-0.736 0-1.333-0.599-1.333-1.333v-13.333h26.667zM29.333 12h-26.667v-5.333c0-0.736 0.599-1.333 1.333-1.333h2.667v2.667c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-2.667h13.333v2.667c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-2.667h2.667c0.736 0 1.333 0.599 1.333 1.333z"></path>\n</svg>\n';var l='\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>time</title>\n<path d="M16 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.333zM16 8c-0.736 0-1.333 0.596-1.333 1.333v6.667h-4c-0.736 0-1.333 0.596-1.333 1.333s0.597 1.333 1.333 1.333h5.333c0.736 0 1.333-0.596 1.333-1.333v-8c0-0.737-0.597-1.333-1.333-1.333z"></path>\n</svg>\n';var c=":host{display:block}";var d=e("salla_booking_field",function(){function e(e){var o=this;t(this,e);this.invalidInput=n(this,"invalidInput",7);this.option=undefined;this.productId=undefined;this.bookNowLabel=salla.lang.get("pages.cart.book_an_appointment","حجز موعد");this.editLabel=salla.lang.get("pages.cart.edit_an_appointment","تعديل الموعد");this.bookedLabel=salla.lang.get("pages.cart.booked_successfully","تمت اضافة الموعد بنجاح");this.selectDate=salla.lang.get("pages.cart.select_appointment_date","حدد تاريخ الموعد");this.bookingUrl="";this.iframeReady=false;this.reservations=[];this.reservationsInput=undefined;salla.lang.onLoaded((function(){return o.setTranslations()}));Salla.event.on("booking::open",(function(e){return o.handleBookingOpen(e)}))}e.prototype.setTranslations=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:e=function(e,t,n){return new Promise((function(o){salla.helpers.setNested(salla.lang.messages[e],t,n);o(true)}))};return[4,e("ar.trans","pages.cart.book_an_appointment","حجز موعد")];case 1:t.sent();return[4,e("en.trans","pages.cart.book_an_appointment","Book an Appointment")];case 2:t.sent();return[4,e("ar.trans","pages.cart.edit_an_appointment","تعديل الموعد")];case 3:t.sent();return[4,e("en.trans","pages.cart.edit_an_appointment","Edit an Appointment")];case 4:t.sent();return[4,e("ar.trans","pages.cart.booked_successfully","تمت اضافة الموعد بنجاح")];case 5:t.sent();return[4,e("en.trans","pages.cart.booked_successfully","Booked Successfully")];case 6:t.sent();return[4,e("ar.trans","pages.cart.select_appointment_date","حدد تاريخ الموعد")];case 7:t.sent();return[4,e("en.trans","pages.cart.select_appointment_date","Select appointment date")];case 8:t.sent();this.bookNowLabel=salla.lang.get("pages.cart.book_an_appointment");this.editLabel=salla.lang.get("pages.cart.edit_an_appointment");this.bookedLabel=salla.lang.get("pages.cart.booked_successfully");this.selectDate=salla.lang.get("pages.cart.select_appointment_date");return[2]}}))}))};e.prototype.openBookingModal=function(e,t){var n=this;if(t===void 0){t=false}if(t&&(!e.detail||typeof e.detail!=="number"||e.detail!==this.productId)){return}if(salla.config.isGuest()){this.setAfterReloadEvent("booking::open-after-reload",this.productId);salla.event.dispatch("login::open");return}salla.booking.add(this.productId,false).then((function(e){if(e.data.redirect.to!=="booking"){throw new Error("Unexpected redirect!")}salla.event.dispatch("booking::open",{url:e.data.redirect.url,id:n.productId})})).catch((function(e){salla.error(salla.lang.get("common.errors.error_occurred"));salla.logger.error(e.response||e)}))};e.prototype.handleBookingOpen=function(e){var t=this;if(e.id!==this.productId)return;this.bookingUrl=salla.url.addParamToUrl("product_id",e.id,e.url);this.iframeReady=true;setTimeout((function(){t.modal.setTitle(t.selectDate);t.modal.open()}),100)};e.prototype.setAfterReloadEvent=function(e,t){salla.storage.set("afterReloadEvent",{event:e,payload:t})};e.prototype.emitAfterReloadEvent=function(){var e=salla.storage.get("afterReloadEvent");if(e&&e.event){var t=new CustomEvent(e.event,{detail:e.payload});window.dispatchEvent(t);salla.storage.remove("afterReloadEvent")}};e.prototype.componentWillLoad=function(){if(this.option&&this.option.details.length){this.reservations=this.option.details}};e.prototype.componentDidLoad=function(){var e=this;window.addEventListener("booking::open-after-reload",(function(t){return e.openBookingModal(t,true)}));this.emitAfterReloadEvent();window.addEventListener("message",this.handleMessageEvent.bind(this));this.reservationsInput.addEventListener("invalid",(function(t){return e.invalidInput.emit(t)}));this.reservationsInput.addEventListener("input",(function(){e.reservationsInput.setCustomValidity("");e.reservationsInput.reportValidity()}))};e.prototype.handleMessageEvent=function(e){var t,n;if(e.data.source!=="booking")return;var o=e.data.type;var a=e.data.message;if(localStorage.getItem("debug"))console.log("Received an action:".concat(o),e.data);if(o==="error"){if((t=a.fields)===null||t===void 0?void 0:t.reservation){salla.notify.error(a.fields.reservation[0]);return}var i=Object.values(a.fields).flat().map((function(e){return"<li>".concat(e,"</li>")})).join("");salla.notify.error("<ul>".concat(i,"</ul>"))}if(o==="success"){if(Number(a.productId)!==Number(this.productId))return;this.reservations=a.data.reservations.map((function(e){if(e.time&&e.time.length>0){var t=e.time[0];return{date:e.date,day:e.day,from_timestamp:t.from,to_timestamp:t.to}}return null})).filter((function(e){return e!==null}));salla.notify.success(this.bookedLabel);(n=this.modal)===null||n===void 0?void 0:n.close();setTimeout((function(){return window.location.reload()}))}if(o==="height"){this.iframe.height=(a===null||a===void 0?void 0:a.height)+"px"}};e.prototype.bookingModal=function(){var e=this;return o("salla-modal",{class:"s-booking-field-modal",ref:function(t){return e.modal=t},width:"md",position:"middle",noPadding:true},o("iframe",{ref:function(t){return e.iframe=t},src:this.bookingUrl,frameborder:"0"}))};e.prototype.renderReservationDate=function(e){return o("span",{class:e.from_timestamp?"s-booking-field-reservations-has-time":""},o("i",{class:"s-booking-field-reservations-icon",innerHTML:s}),e.date)};e.prototype.renderReservationTime=function(e){if(!e.from_timestamp)return"";return o("span",{class:"s-booking-field-reservations-time"},o("i",{class:"s-booking-field-reservations-icon",innerHTML:l}),o("span",null,e.from_timestamp," - ",e.to_timestamp))};e.prototype.render=function(){var e=this;return o(a,null,o("div",{class:"s-booking-field-main"},this.option.required&&this.reservations.length>0?o("div",{class:"s-booking-field-price"},o("span",null,salla.money(this.option.price))):"",o("salla-button",{class:"s-booking-field-book-now",size:"small",loaderPosition:"center",fill:"outline",onClick:function(t){return e.openBookingModal(t,false)}},o("span",{class:"s-booking-field-book-now-content"},o("span",{innerHTML:r}),this.reservations.length?this.editLabel:this.bookNowLabel))),this.reservations.length>0&&o("div",{class:"s-booking-field-reservations"},this.reservations.map((function(t,n){return o("div",{key:n,class:"s-booking-field-reservations-item"},e.renderReservationDate(t),e.renderReservationTime(t))}))),o("input",{class:"s-hidden",name:this.option.name,required:this.option.required,value:JSON.stringify(this.reservations)==="[]"?"":JSON.stringify(this.reservations),ref:function(t){return e.reservationsInput=t}}),this.iframeReady&&this.bookingModal())};Object.defineProperty(e.prototype,"host",{get:function(){return i(this)},enumerable:false,configurable:true});return e}());d.style=c;var u=e("salla_conditional_fields",function(){function e(e){t(this,e)}e.prototype.hideAllOptions=function(e){var t=this;this.host.querySelectorAll('[data-show-when^="options['.concat(e,'"]')).forEach((function(e){e.classList.add("hidden");t.hideAllOptions(e.dataset.optionId);t.disableInputs(e)}))};e.prototype.disableInputs=function(e){e.querySelectorAll("[name]").forEach((function(e){var t;e.setAttribute("disabled","");e.removeAttribute("required");if(((t=e===null||e===void 0?void 0:e.tagName)===null||t===void 0?void 0:t.toLowerCase())==="select"){e.value=""}if(["checkbox"].includes(e.getAttribute("type"))&&e.hasOwnProperty("checked")){e.checked=false}}))};e.prototype.changeHandler=function(e){var t=this;var n;salla.event.emit("salla-onditional-fields::change",e);salla.log("Received the change event: ",e);if(!e.target||!["SELECT"].includes(e.target.tagName)&&!["checkbox"].includes(e.target.getAttribute("type"))){salla.log("Ignore the change because is not support input: "+(((n=e===null||e===void 0?void 0:e.target)===null||n===void 0?void 0:n.tagName)||"N/A"));return}var o=e.target.name.replace("[]","");var a=e.target.getAttribute("type")==="checkbox";salla.log("Trying to find all the element with condition:",'[data-show-when^="'.concat(o,'"]'));this.host.querySelectorAll('[data-show-when^="'.concat(o,'"]')).forEach((function(n){var o=!(n===null||n===void 0?void 0:n.dataset.showWhen.includes("!="));var i=n===null||n===void 0?void 0:n.dataset.showWhen.replace(/(.*)(=|!=)(.*)/gm,"$3").trim();var r;if(a){var s=Array.from(t.host.querySelectorAll('input[name="'.concat(e.target.name,'"]:checked')),(function(e){return e===null||e===void 0?void 0:e.value}));r=s.includes(i.toString())}else{r=i===e.target.value}salla.log("The input is ",a?"Multiple":"Single"," value:",r);var l=o&&r||!o&&!r;if(l){n.classList.remove("hidden");n.querySelectorAll("[name]").forEach((function(e){e.removeAttribute("disabled");var t=e.closest(".s-product-options-option");if(t.dataset.optionRequired==="true"){e.setAttribute("required","")}if(e.getAttribute("type")==="checkbox"){var o=Array.from(document.querySelectorAll('input[type="checkbox"][name="'.concat(e.getAttribute("name"),'"]')));var a=o.some((function(e){return e.checked}));if(a){o.forEach((function(e){e.removeAttribute("required")}))}}if(!["checkbox"].includes(e.getAttribute("type"))&&n.getElementsByClassName("required").length){e.setAttribute("required","")}}))}else{t.hideAllOptions(n.dataset.optionId);n.classList.add("hidden");t.disableInputs(n)}}))};e.prototype.componentDidRender=function(){var e=this;this.host.querySelectorAll("[data-show-when]").forEach((function(t){var n;var o=(n=t===null||t===void 0?void 0:t.dataset)===null||n===void 0?void 0:n.showWhen.replace(/(.*)(=|!=)(.*)/gm,"$1").trim();if(!o){return}e.changeHandler({target:e.host.querySelector('[name^="'+o+'"]')})}))};e.prototype.render=function(){return o(a,null,o("slot",null))};Object.defineProperty(e.prototype,"host",{get:function(){return i(this)},enumerable:false,configurable:true});return e}())}}}));
5
- //# sourceMappingURL=p-49fbd428.system.entry.js.map
4
+ */System.register(["./p-f422bbf9.system.js"],(function(e){"use strict";var t,n,o,a,i;return{setters:[function(e){t=e.r;n=e.c;o=e.h;a=e.H;i=e.g}],execute:function(){var r='\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>calendar-time</title>\n<path d="M22.667 17.333c-0.737 0-1.333 0.596-1.333 1.333v2.667h-2.667c-0.737 0-1.333 0.596-1.333 1.333s0.596 1.333 1.333 1.333h4c0.737 0 1.333-0.596 1.333-1.333v-4c0-0.737-0.596-1.333-1.333-1.333zM28 2.667h-2.667v-1.333c0-0.736-0.596-1.333-1.333-1.333s-1.333 0.597-1.333 1.333v1.333h-13.333v-1.333c0-0.736-0.596-1.333-1.333-1.333s-1.333 0.597-1.333 1.333v1.333h-2.667c-2.205 0-4 1.795-4 4v21.333c0 2.205 1.795 4 4 4h5.363c0.737 0 1.333-0.596 1.333-1.333s-0.596-1.333-1.333-1.333h-5.363c-0.736 0-1.333-0.597-1.333-1.333v-21.333c0-0.736 0.597-1.333 1.333-1.333h2.667v2.667c0 0.736 0.596 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-2.667h13.333v2.667c0 0.736 0.596 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-2.667h2.667c0.736 0 1.333 0.599 1.333 1.333v2.696c0 0.736 0.596 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-2.696c0-2.205-1.795-4-4-4zM22 12c-5.515 0-10 4.485-10 10s4.485 10 10 10 10-4.485 10-10-4.485-10-10-10zM22 29.333c-4.043 0-7.333-3.291-7.333-7.333s3.291-7.333 7.333-7.333 7.333 3.291 7.333 7.333-3.291 7.333-7.333 7.333z"></path>\n</svg>\n';var s='\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>calendar</title>\n<path d="M28 2.667h-2.667v-1.333c0-0.736-0.597-1.333-1.333-1.333s-1.333 0.597-1.333 1.333v1.333h-13.333v-1.333c0-0.736-0.597-1.333-1.333-1.333s-1.333 0.597-1.333 1.333v1.333h-2.667c-2.205 0-4 1.795-4 4v21.333c0 2.205 1.795 4 4 4h24c2.205 0 4-1.795 4-4v-21.333c0-2.205-1.795-4-4-4zM29.333 28c0 0.736-0.599 1.333-1.333 1.333h-24c-0.736 0-1.333-0.599-1.333-1.333v-13.333h26.667zM29.333 12h-26.667v-5.333c0-0.736 0.599-1.333 1.333-1.333h2.667v2.667c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-2.667h13.333v2.667c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-2.667h2.667c0.736 0 1.333 0.599 1.333 1.333z"></path>\n</svg>\n';var l='\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>time</title>\n<path d="M16 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.333zM16 8c-0.736 0-1.333 0.596-1.333 1.333v6.667h-4c-0.736 0-1.333 0.596-1.333 1.333s0.597 1.333 1.333 1.333h5.333c0.736 0 1.333-0.596 1.333-1.333v-8c0-0.737-0.597-1.333-1.333-1.333z"></path>\n</svg>\n';var c=":host{display:block}";var d=e("salla_booking_field",function(){function e(e){var o=this;t(this,e);this.invalidInput=n(this,"invalidInput",7);this.option=undefined;this.productId=undefined;this.bookNowLabel=salla.lang.get("pages.cart.book_an_appointment","حجز موعد");this.editLabel=salla.lang.get("pages.cart.edit_an_appointment","تعديل الموعد");this.bookedLabel=salla.lang.get("pages.cart.booked_successfully","تمت اضافة الموعد بنجاح");this.selectDate=salla.lang.get("pages.cart.select_appointment_date","حدد تاريخ الموعد");this.bookingUrl="";this.iframeReady=false;this.reservations=[];this.reservationsInput=undefined;salla.lang.onLoaded((function(){return o.setTranslations()}));Salla.event.on("booking::open",(function(e){return o.handleBookingOpen(e)}))}e.prototype.setTranslations=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:e=function(e,t,n){return new Promise((function(o){salla.helpers.setNested(salla.lang.messages[e],t,n);o(true)}))};return[4,e("ar.trans","pages.cart.book_an_appointment","حجز موعد")];case 1:t.sent();return[4,e("en.trans","pages.cart.book_an_appointment","Book an Appointment")];case 2:t.sent();return[4,e("ar.trans","pages.cart.edit_an_appointment","تعديل الموعد")];case 3:t.sent();return[4,e("en.trans","pages.cart.edit_an_appointment","Edit an Appointment")];case 4:t.sent();return[4,e("ar.trans","pages.cart.booked_successfully","تمت اضافة الموعد بنجاح")];case 5:t.sent();return[4,e("en.trans","pages.cart.booked_successfully","Booked Successfully")];case 6:t.sent();return[4,e("ar.trans","pages.cart.select_appointment_date","حدد تاريخ الموعد")];case 7:t.sent();return[4,e("en.trans","pages.cart.select_appointment_date","Select appointment date")];case 8:t.sent();this.bookNowLabel=salla.lang.get("pages.cart.book_an_appointment");this.editLabel=salla.lang.get("pages.cart.edit_an_appointment");this.bookedLabel=salla.lang.get("pages.cart.booked_successfully");this.selectDate=salla.lang.get("pages.cart.select_appointment_date");return[2]}}))}))};e.prototype.openBookingModal=function(e,t){var n=this;if(t===void 0){t=false}if(t&&(!e.detail||typeof e.detail!=="number"||e.detail!==this.productId)){return}if(salla.config.isGuest()){this.setAfterReloadEvent("booking::open-after-reload",this.productId);salla.event.dispatch("login::open");return}salla.booking.add(this.productId,false).then((function(e){if(e.data.redirect.to!=="booking"){throw new Error("Unexpected redirect!")}salla.event.dispatch("booking::open",{url:e.data.redirect.url,id:n.productId})})).catch((function(e){salla.error(salla.lang.get("common.errors.error_occurred"));salla.logger.error(e.response||e)}))};e.prototype.handleBookingOpen=function(e){var t=this;if(e.id!==this.productId)return;this.bookingUrl=salla.url.addParamToUrl("product_id",e.id,e.url);this.iframeReady=true;setTimeout((function(){t.modal.setTitle(t.selectDate);t.modal.open()}),100)};e.prototype.setAfterReloadEvent=function(e,t){salla.storage.set("afterReloadEvent",{event:e,payload:t})};e.prototype.emitAfterReloadEvent=function(){var e=salla.storage.get("afterReloadEvent");if(e&&e.event){var t=new CustomEvent(e.event,{detail:e.payload});window.dispatchEvent(t);salla.storage.remove("afterReloadEvent")}};e.prototype.componentWillLoad=function(){if(this.option&&this.option.details.length){this.reservations=this.option.details}};e.prototype.componentDidLoad=function(){var e=this;window.addEventListener("booking::open-after-reload",(function(t){return e.openBookingModal(t,true)}));this.emitAfterReloadEvent();window.addEventListener("message",this.handleMessageEvent.bind(this));this.reservationsInput.addEventListener("invalid",(function(t){return e.invalidInput.emit(t)}));this.reservationsInput.addEventListener("input",(function(){e.reservationsInput.setCustomValidity("");e.reservationsInput.reportValidity()}))};e.prototype.handleMessageEvent=function(e){var t,n;if(e.data.source!=="booking")return;var o=e.data.type;var a=e.data.message;if(localStorage.getItem("debug"))console.log("Received an action:".concat(o),e.data);if(o==="error"){if((t=a.fields)===null||t===void 0?void 0:t.reservation){salla.notify.error(a.fields.reservation[0]);return}var i=Object.values(a.fields).flat().map((function(e){return"<li>".concat(e,"</li>")})).join("");salla.notify.error("<ul>".concat(i,"</ul>"))}if(o==="success"){if(Number(a.productId)!==Number(this.productId))return;this.reservations=a.data.reservations.map((function(e){if(e.time&&e.time.length>0){var t=e.time[0];return{date:e.date,day:e.day,from_timestamp:t.from,to_timestamp:t.to}}return null})).filter((function(e){return e!==null}));salla.notify.success(this.bookedLabel);(n=this.modal)===null||n===void 0?void 0:n.close();setTimeout((function(){return window.location.reload()}))}if(o==="height"){this.iframe.height=(a===null||a===void 0?void 0:a.height)+"px"}};e.prototype.bookingModal=function(){var e=this;return o("salla-modal",{class:"s-booking-field-modal",ref:function(t){return e.modal=t},width:"md",position:"middle",noPadding:true},o("iframe",{ref:function(t){return e.iframe=t},src:this.bookingUrl,frameborder:"0"}))};e.prototype.renderReservationDate=function(e){return o("span",{class:e.from_timestamp?"s-booking-field-reservations-has-time":""},o("i",{class:"s-booking-field-reservations-icon",innerHTML:s}),e.date)};e.prototype.renderReservationTime=function(e){if(!e.from_timestamp)return"";return o("span",{class:"s-booking-field-reservations-time"},o("i",{class:"s-booking-field-reservations-icon",innerHTML:l}),o("span",null,e.from_timestamp," - ",e.to_timestamp))};e.prototype.render=function(){var e=this;return o(a,null,o("div",{class:"s-booking-field-main"},this.option.required||this.reservations.length>0?o("div",{class:"s-booking-field-price"},o("span",null,salla.money(this.option.price))):"",o("salla-button",{class:"s-booking-field-book-now",size:"small",loaderPosition:"center",fill:"outline",onClick:function(t){return e.openBookingModal(t,false)}},o("span",{class:"s-booking-field-book-now-content"},o("span",{innerHTML:r}),this.reservations.length?this.editLabel:this.bookNowLabel))),this.reservations.length>0&&o("div",{class:"s-booking-field-reservations"},this.reservations.map((function(t,n){return o("div",{key:n,class:"s-booking-field-reservations-item"},e.renderReservationDate(t),e.renderReservationTime(t))}))),o("input",{class:"s-hidden",name:this.option.name,required:this.option.required,value:JSON.stringify(this.reservations)==="[]"?"":JSON.stringify(this.reservations),ref:function(t){return e.reservationsInput=t}}),this.iframeReady&&this.bookingModal())};Object.defineProperty(e.prototype,"host",{get:function(){return i(this)},enumerable:false,configurable:true});return e}());d.style=c;var u=e("salla_conditional_fields",function(){function e(e){t(this,e)}e.prototype.hideAllOptions=function(e){var t=this;this.host.querySelectorAll('[data-show-when^="options['.concat(e,'"]')).forEach((function(e){e.classList.add("hidden");t.hideAllOptions(e.dataset.optionId);t.disableInputs(e)}))};e.prototype.disableInputs=function(e){e.querySelectorAll("[name]").forEach((function(e){var t;e.setAttribute("disabled","");e.removeAttribute("required");if(((t=e===null||e===void 0?void 0:e.tagName)===null||t===void 0?void 0:t.toLowerCase())==="select"){e.value=""}if(["checkbox"].includes(e.getAttribute("type"))&&e.hasOwnProperty("checked")){e.checked=false}}))};e.prototype.changeHandler=function(e){var t=this;var n;salla.event.emit("salla-onditional-fields::change",e);salla.log("Received the change event: ",e);if(!e.target||!["SELECT"].includes(e.target.tagName)&&!["checkbox"].includes(e.target.getAttribute("type"))){salla.log("Ignore the change because is not support input: "+(((n=e===null||e===void 0?void 0:e.target)===null||n===void 0?void 0:n.tagName)||"N/A"));return}var o=e.target.name.replace("[]","");var a=e.target.getAttribute("type")==="checkbox";salla.log("Trying to find all the element with condition:",'[data-show-when^="'.concat(o,'"]'));this.host.querySelectorAll('[data-show-when^="'.concat(o,'"]')).forEach((function(n){var o=!(n===null||n===void 0?void 0:n.dataset.showWhen.includes("!="));var i=n===null||n===void 0?void 0:n.dataset.showWhen.replace(/(.*)(=|!=)(.*)/gm,"$3").trim();var r;if(a){var s=Array.from(t.host.querySelectorAll('input[name="'.concat(e.target.name,'"]:checked')),(function(e){return e===null||e===void 0?void 0:e.value}));r=s.includes(i.toString())}else{r=i===e.target.value}salla.log("The input is ",a?"Multiple":"Single"," value:",r);var l=o&&r||!o&&!r;if(l){n.classList.remove("hidden");n.querySelectorAll("[name]").forEach((function(e){e.removeAttribute("disabled");var t=e.closest(".s-product-options-option");if(t.dataset.optionRequired==="true"){e.setAttribute("required","")}if(e.getAttribute("type")==="checkbox"){var o=Array.from(document.querySelectorAll('input[type="checkbox"][name="'.concat(e.getAttribute("name"),'"]')));var a=o.some((function(e){return e.checked}));if(a){o.forEach((function(e){e.removeAttribute("required")}))}}if(!["checkbox"].includes(e.getAttribute("type"))&&n.getElementsByClassName("required").length){e.setAttribute("required","")}}))}else{t.hideAllOptions(n.dataset.optionId);n.classList.add("hidden");t.disableInputs(n)}}))};e.prototype.componentDidRender=function(){var e=this;this.host.querySelectorAll("[data-show-when]").forEach((function(t){var n;var o=(n=t===null||t===void 0?void 0:t.dataset)===null||n===void 0?void 0:n.showWhen.replace(/(.*)(=|!=)(.*)/gm,"$1").trim();if(!o){return}e.changeHandler({target:e.host.querySelector('[name^="'+o+'"]')})}))};e.prototype.render=function(){return o(a,null,o("slot",null))};Object.defineProperty(e.prototype,"host",{get:function(){return i(this)},enumerable:false,configurable:true});return e}())}}}));
5
+ //# sourceMappingURL=p-ee43190e.system.entry.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["sallaBookingFieldCss","SallaBookingField","exports","class_1","hostRef","_this","this","salla","lang","get","onLoaded","setTranslations","Salla","event","on","data","handleBookingOpen","prototype","setNestedAsync","key","value","Promise","resolve","helpers","setNested","messages","_c","sent","bookNowLabel","editLabel","bookedLabel","selectDate","openBookingModal","afterReload","detail","productId","config","isGuest","setAfterReloadEvent","dispatch","booking","add","then","resp","redirect","to","Error","url","id","catch","error","logger","response","bookingUrl","addParamToUrl","iframeReady","setTimeout","modal","setTitle","open","payload","storage","set","emitAfterReloadEvent","eventDetails","customEvent","CustomEvent","window","dispatchEvent","remove","componentWillLoad","option","details","length","reservations","componentDidLoad","addEventListener","handleMessageEvent","bind","reservationsInput","e","invalidInput","emit","setCustomValidity","reportValidity","source","action","type","message","localStorage","getItem","console","log","concat","_a","fields","reservation","notify","errorList","Object","values","flat","map","join","Number","schedule","time","timeSlot","date","day","from_timestamp","from","to_timestamp","filter","item","success","_b","close","location","reload","iframe","height","bookingModal","h","class","ref","width","position","noPadding","src","frameborder","renderReservationDate","innerHTML","Calendar","renderReservationTime","TimeIcon","render","Host","required","money","price","size","loaderPosition","fill","onClick","BookingTime","index","name","JSON","stringify","SallaConditionalFields","class_2","hideAllOptions","optionId","host","querySelectorAll","forEach","field","classList","dataset","disableInputs","input","setAttribute","removeAttribute","tagName","toLowerCase","includes","getAttribute","hasOwnProperty","checked","changeHandler","target","replace","isMultiple","isEqual","showWhen","trim","isSelected","selectedValues","Array","toString","showTheInput","closestProductOption","closest","optionRequired","checkboxes","document","isAnyChecked","some","checkbox","getElementsByClassName","componentDidRender","optionName","querySelector"],"sources":["src/components/salla-booking-field/salla-booking-field.scss?tag=salla-booking-field","src/components/salla-booking-field/salla-booking-field.tsx","src/components/salla-conditional-fields/salla-conditional-fields.tsx"],"sourcesContent":[":host {\n display: block;\n}\n","import { Component, Host, Prop, h, Element, State, Event, EventEmitter } from '@stencil/core';\nimport { Option, Reservation } from './interfaces';\nimport BookingTime from '../../assets/svg/calendar-time.svg';\nimport Calendar from '../../assets/svg/calendar.svg';\nimport TimeIcon from '../../assets/svg/time.svg';\n\n@Component({\n tag: 'salla-booking-field',\n styleUrl: 'salla-booking-field.scss',\n})\nexport class SallaBookingField {\n @Prop() option: Option;\n @Prop() productId: number;\n @Element() host: HTMLElement;\n @State() bookNowLabel: string = salla.lang.get('pages.cart.book_an_appointment', 'حجز موعد');\n @State() editLabel: string = salla.lang.get('pages.cart.edit_an_appointment', 'تعديل الموعد');\n @State() bookedLabel: string = salla.lang.get('pages.cart.booked_successfully', 'تمت اضافة الموعد بنجاح');\n @State() selectDate: string = salla.lang.get('pages.cart.select_appointment_date', 'حدد تاريخ الموعد');\n @State() bookingUrl: string = '';\n @State() iframeReady: boolean = false;\n @State() reservations: Reservation[] = [];\n @State() reservationsInput: HTMLInputElement;\n\n /**\n * Event emitted when the input is invalid.\n */\n @Event() invalidInput: EventEmitter<any>;\n\n private modal: HTMLSallaModalElement;\n private iframe: HTMLIFrameElement;\n\n constructor() {\n // Load translations\n salla.lang.onLoaded(() => this.setTranslations());\n // Register event listeners\n Salla.event.on('booking::open', (data) => this.handleBookingOpen(data));\n }\n\n private async setTranslations() {\n const setNestedAsync = (lang, key, value) => {\n return new Promise((resolve) => {\n salla.helpers.setNested(salla.lang.messages[lang], key, value);\n resolve(true);\n });\n };\n\n await setNestedAsync('ar.trans', 'pages.cart.book_an_appointment', 'حجز موعد');\n await setNestedAsync('en.trans', 'pages.cart.book_an_appointment', 'Book an Appointment');\n await setNestedAsync('ar.trans', 'pages.cart.edit_an_appointment', 'تعديل الموعد');\n await setNestedAsync('en.trans', 'pages.cart.edit_an_appointment', 'Edit an Appointment');\n await setNestedAsync('ar.trans', 'pages.cart.booked_successfully', 'تمت اضافة الموعد بنجاح');\n await setNestedAsync('en.trans', 'pages.cart.booked_successfully', 'Booked Successfully');\n await setNestedAsync('ar.trans', 'pages.cart.select_appointment_date', 'حدد تاريخ الموعد');\n await setNestedAsync('en.trans', 'pages.cart.select_appointment_date', 'Select appointment date');\n\n this.bookNowLabel = salla.lang.get('pages.cart.book_an_appointment');\n this.editLabel = salla.lang.get('pages.cart.edit_an_appointment');\n this.bookedLabel = salla.lang.get('pages.cart.booked_successfully');\n this.selectDate = salla.lang.get('pages.cart.select_appointment_date');\n }\n\n private openBookingModal(event: any, afterReload = false) {\n if (afterReload && (!event.detail || typeof event.detail !== 'number' || event.detail !== this.productId)) {\n return;\n }\n if (salla.config.isGuest()) {\n this.setAfterReloadEvent('booking::open-after-reload', this.productId);\n salla.event.dispatch('login::open');\n return;\n }\n salla.booking.add(this.productId, false)\n .then((resp) => {\n if (resp.data.redirect.to !== 'booking') {\n throw new Error('Unexpected redirect!');\n }\n salla.event.dispatch('booking::open', { url: resp.data.redirect.url, id: this.productId });\n })\n .catch((error) => {\n salla.error(salla.lang.get('common.errors.error_occurred'));\n salla.logger.error(error.response || error);\n });\n }\n\n private handleBookingOpen(data) {\n if (data.id !== this.productId) return;\n this.bookingUrl = salla.url.addParamToUrl('product_id', data.id, data.url);\n this.iframeReady = true;\n setTimeout(() => {\n this.modal.setTitle(this.selectDate);\n this.modal.open();\n }, 100);\n }\n\n private setAfterReloadEvent(event, payload) {\n salla.storage.set('afterReloadEvent', { event, payload });\n }\n\n private emitAfterReloadEvent() {\n const eventDetails = salla.storage.get('afterReloadEvent');\n if (eventDetails && eventDetails.event) {\n const customEvent = new CustomEvent(eventDetails.event, {\n detail: eventDetails.payload\n });\n window.dispatchEvent(customEvent)\n salla.storage.remove('afterReloadEvent');\n }\n }\n\n componentWillLoad() {\n if (this.option && this.option.details.length) {\n this.reservations = this.option.details;\n }\n }\n\n componentDidLoad() {\n window.addEventListener('booking::open-after-reload', (event) => this.openBookingModal(event, true));\n this.emitAfterReloadEvent();\n window.addEventListener('message', this.handleMessageEvent.bind(this));\n this.reservationsInput.addEventListener('invalid', e => this.invalidInput.emit(e));\n this.reservationsInput.addEventListener('input', () => {\n this.reservationsInput.setCustomValidity('');\n this.reservationsInput.reportValidity();\n });\n }\n\n private handleMessageEvent(event) {\n if (event.data.source !== 'booking') return;\n const action = event.data.type;\n const value = event.data.message;\n if (localStorage.getItem('debug')) console.log(`Received an action:${action}`, event.data);\n\n if (action === 'error') {\n if (value.fields?.reservation) {\n salla.notify.error(value.fields.reservation[0]);\n return;\n }\n const errorList = Object.values(value.fields).flat().map(error => `<li>${error}</li>`).join('');\n salla.notify.error(`<ul>${errorList}</ul>`);\n }\n\n if (action === 'success') {\n if (Number(value.productId) !== Number(this.productId)) return;\n this.reservations = value.data.reservations.map(schedule => {\n if (schedule.time && schedule.time.length > 0) {\n const timeSlot = schedule.time[0];\n return {\n date: schedule.date,\n day: schedule.day,\n from_timestamp: timeSlot.from,\n to_timestamp: timeSlot.to,\n };\n }\n return null;\n }).filter(item => item !== null);\n\n salla.notify.success(this.bookedLabel);\n this.modal?.close();\n setTimeout(() => window.location.reload());\n }\n\n if (action === 'height') {\n this.iframe.height = value?.height + 'px';\n }\n }\n\n private bookingModal() {\n return (\n <salla-modal class=\"s-booking-field-modal\" ref={modal => (this.modal = modal)} width=\"md\" position=\"middle\" noPadding>\n <iframe ref={iframe => (this.iframe = iframe)} src={this.bookingUrl} frameborder=\"0\"></iframe>\n </salla-modal>\n );\n }\n\n renderReservationDate(reservation: Reservation) {\n return (\n <span class={reservation.from_timestamp ? 's-booking-field-reservations-has-time' : ''}>\n <i class=\"s-booking-field-reservations-icon\" innerHTML={Calendar}></i>\n {reservation.date}\n </span>\n );\n }\n\n renderReservationTime(reservation: Reservation) {\n if (!reservation.from_timestamp) return '';\n return (\n <span class=\"s-booking-field-reservations-time\">\n <i class=\"s-booking-field-reservations-icon\" innerHTML={TimeIcon}></i>\n <span>\n {reservation.from_timestamp} - {reservation.to_timestamp}\n </span>\n </span>\n );\n }\n\n render() {\n return (\n <Host>\n <div class=\"s-booking-field-main\">\n {this.option.required && this.reservations.length > 0 ? <div class=\"s-booking-field-price\">\n <span>{salla.money(this.option.price)}</span>\n </div> : ''}\n <salla-button class=\"s-booking-field-book-now\" size=\"small\" loaderPosition=\"center\" fill=\"outline\" onClick={event => this.openBookingModal(event, false)}>\n <span class=\"s-booking-field-book-now-content\">\n <span innerHTML={BookingTime}></span>\n {this.reservations.length ? this.editLabel : this.bookNowLabel}\n </span>\n </salla-button>\n </div>\n {this.reservations.length > 0 && (\n <div class=\"s-booking-field-reservations\">\n {this.reservations.map((reservation, index) => (\n <div key={index} class=\"s-booking-field-reservations-item\">\n {this.renderReservationDate(reservation)}\n {this.renderReservationTime(reservation)}\n </div>\n ))}\n </div>\n )}\n <input \n class=\"s-hidden\" \n name={this.option.name} \n required={this.option.required} \n value={JSON.stringify(this.reservations) === '[]' ? '' : JSON.stringify(this.reservations)}\n ref={reservations => this.reservationsInput = reservations} \n />\n {this.iframeReady && this.bookingModal()}\n </Host>\n );\n }\n}\n","import { Component, Element, Host, Listen, h } from '@stencil/core';\n\n/**\n * its to easy to use, currenlty its support select & checkbox input as trigger for show/hide the dom\n * the dom you can put it like this data-show-when=\"{name of the field} {= or !=} {value of the field}\"\n */\n@Component({\n tag: 'salla-conditional-fields'\n})\nexport class SallaConditionalFields {\n\n @Element() host: HTMLElement;\n\n private hideAllOptions(optionId) {\n this.host.querySelectorAll(`[data-show-when^=\"options[${optionId}\"]`).forEach((field: HTMLElement) => {\n field.classList.add('hidden');\n this.hideAllOptions(field.dataset.optionId);\n this.disableInputs(field);\n });\n }\n\n private disableInputs(field) {\n field.querySelectorAll('[name]').forEach((input) => {\n\n input.setAttribute('disabled', '');\n input.removeAttribute('required');\n if (input?.tagName?.toLowerCase() === 'select') {\n input.value = ''\n }\n if (['checkbox'].includes(input.getAttribute('type')) && input.hasOwnProperty('checked')) {\n // @ts-ignore\n input.checked = false;\n }\n });\n }\n \n @Listen('change')\n changeHandler(event) {\n salla.event.emit('salla-onditional-fields::change', event);\n salla.log('Received the change event: ', event);\n\n if (!event.target || !['SELECT'].includes(event.target.tagName) && !['checkbox'].includes(event.target.getAttribute('type'))) {\n salla.log('Ignore the change because is not support input: ' + (event?.target?.tagName || 'N/A'));\n return;\n }\n\n // to extract the option id from the input name, the supported names are name[*] and name[*][]\n let optionId = event.target.name.replace('[]', '');\n let isMultiple = event.target.getAttribute('type') === 'checkbox';\n\n\n salla.log('Trying to find all the element with condition:', `[data-show-when^=\"${optionId}\"]`);\n\n this.host.querySelectorAll(`[data-show-when^=\"${optionId}\"]`)\n .forEach((field: HTMLElement) => {\n let isEqual = !field?.dataset.showWhen.includes('!=');\n let value = field?.dataset.showWhen.replace(/(.*)(=|!=)(.*)/gm, '$3').trim();\n // let isSelected = isMultiple ? event.target?.checked : value === event.target.value;\n let isSelected;\n\n if (isMultiple) {\n // @ts-ignore\n let selectedValues = Array.from(this.host.querySelectorAll(`input[name=\"${event.target.name}\"]:checked`), e => e?.value);\n isSelected = selectedValues.includes(value.toString());\n } else {\n isSelected = value === event.target.value;\n }\n\n salla.log('The input is ', (isMultiple ? 'Multiple' : 'Single'), ' value:', isSelected);\n\n let showTheInput = (isEqual && isSelected) || (!isEqual && !isSelected);\n if (showTheInput) {\n field.classList.remove('hidden');\n field.querySelectorAll('[name]').forEach((input) => {\n input.removeAttribute('disabled');\n\n\n // Return required attribute to the input if the option is required\n const closestProductOption = (input as HTMLInputElement).closest('.s-product-options-option') as HTMLElement;\n if (closestProductOption.dataset.optionRequired === 'true') {\n input.setAttribute('required', '');\n }\n\n\n // Handle multiple checkboxes with same name and required attribute \n if (input.getAttribute('type') === 'checkbox') {\n const checkboxes = Array.from(document.querySelectorAll(`input[type=\"checkbox\"][name=\"${input.getAttribute('name')}\"]`)) as HTMLInputElement[];\n const isAnyChecked = checkboxes.some((checkbox) => checkbox.checked); \n if (isAnyChecked) {\n checkboxes.forEach((checkbox) => {\n checkbox.removeAttribute('required');\n });\n }\n }\n //To handle focus on hidden input error\n if (!['checkbox'].includes(input.getAttribute('type')) && field.getElementsByClassName('required').length) {\n input.setAttribute('required', '');\n }\n });\n } else {\n this.hideAllOptions(field.dataset.optionId);\n field.classList.add('hidden');\n this.disableInputs(field);\n }\n });\n }\n\n componentDidRender() {\n this.host.querySelectorAll(`[data-show-when]`).forEach((field) => {\n // @ts-ignore\n let optionName = field?.dataset?.showWhen.replace(/(.*)(=|!=)(.*)/gm, '$1').trim();\n if (!optionName) {\n return;\n }\n\n this.changeHandler({\n target: this.host.querySelector('[name^=\"' + optionName + '\"]')\n })\n });\n }\n\n render() {\n return (\n <Host>\n <slot></slot>\n </Host>\n );\n }\n}\n"],"mappings":";;;+tFAAA,IAAMA,EAAuB,uB,ICUhBC,EAAiBC,EAAA,iCAqB5B,SAAAC,EAAAC,GAA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GAAalG,EAAA+D,IAAK,MAALA,SAAK,SAALA,EAAOE,WAAO,MAAAjE,SAAA,SAAAA,EAAEiF,SAASH,QAAQ,mBAAoB,MAAMI,OAC5E,IAAKgB,EAAY,CACf,M,CAGF3L,EAAKqK,cAAc,CACjBC,OAAQtK,EAAKqJ,KAAKuC,cAAc,WAAaD,EAAa,O,KAKhEzC,EAAAtI,UAAAuH,OAAA,WACE,OACEb,EAACc,EAAI,KACHd,EAAA,a,yHAnH2B,G"}
1
+ {"version":3,"names":["sallaBookingFieldCss","SallaBookingField","exports","class_1","hostRef","_this","this","salla","lang","get","onLoaded","setTranslations","Salla","event","on","data","handleBookingOpen","prototype","setNestedAsync","key","value","Promise","resolve","helpers","setNested","messages","_c","sent","bookNowLabel","editLabel","bookedLabel","selectDate","openBookingModal","afterReload","detail","productId","config","isGuest","setAfterReloadEvent","dispatch","booking","add","then","resp","redirect","to","Error","url","id","catch","error","logger","response","bookingUrl","addParamToUrl","iframeReady","setTimeout","modal","setTitle","open","payload","storage","set","emitAfterReloadEvent","eventDetails","customEvent","CustomEvent","window","dispatchEvent","remove","componentWillLoad","option","details","length","reservations","componentDidLoad","addEventListener","handleMessageEvent","bind","reservationsInput","e","invalidInput","emit","setCustomValidity","reportValidity","source","action","type","message","localStorage","getItem","console","log","concat","_a","fields","reservation","notify","errorList","Object","values","flat","map","join","Number","schedule","time","timeSlot","date","day","from_timestamp","from","to_timestamp","filter","item","success","_b","close","location","reload","iframe","height","bookingModal","h","class","ref","width","position","noPadding","src","frameborder","renderReservationDate","innerHTML","Calendar","renderReservationTime","TimeIcon","render","Host","required","money","price","size","loaderPosition","fill","onClick","BookingTime","index","name","JSON","stringify","SallaConditionalFields","class_2","hideAllOptions","optionId","host","querySelectorAll","forEach","field","classList","dataset","disableInputs","input","setAttribute","removeAttribute","tagName","toLowerCase","includes","getAttribute","hasOwnProperty","checked","changeHandler","target","replace","isMultiple","isEqual","showWhen","trim","isSelected","selectedValues","Array","toString","showTheInput","closestProductOption","closest","optionRequired","checkboxes","document","isAnyChecked","some","checkbox","getElementsByClassName","componentDidRender","optionName","querySelector"],"sources":["src/components/salla-booking-field/salla-booking-field.scss?tag=salla-booking-field","src/components/salla-booking-field/salla-booking-field.tsx","src/components/salla-conditional-fields/salla-conditional-fields.tsx"],"sourcesContent":[":host {\n display: block;\n}\n","import { Component, Host, Prop, h, Element, State, Event, EventEmitter } from '@stencil/core';\nimport { Option, Reservation } from './interfaces';\nimport BookingTime from '../../assets/svg/calendar-time.svg';\nimport Calendar from '../../assets/svg/calendar.svg';\nimport TimeIcon from '../../assets/svg/time.svg';\n\n@Component({\n tag: 'salla-booking-field',\n styleUrl: 'salla-booking-field.scss',\n})\nexport class SallaBookingField {\n @Prop() option: Option;\n @Prop() productId: number;\n @Element() host: HTMLElement;\n @State() bookNowLabel: string = salla.lang.get('pages.cart.book_an_appointment', 'حجز موعد');\n @State() editLabel: string = salla.lang.get('pages.cart.edit_an_appointment', 'تعديل الموعد');\n @State() bookedLabel: string = salla.lang.get('pages.cart.booked_successfully', 'تمت اضافة الموعد بنجاح');\n @State() selectDate: string = salla.lang.get('pages.cart.select_appointment_date', 'حدد تاريخ الموعد');\n @State() bookingUrl: string = '';\n @State() iframeReady: boolean = false;\n @State() reservations: Reservation[] = [];\n @State() reservationsInput: HTMLInputElement;\n\n /**\n * Event emitted when the input is invalid.\n */\n @Event() invalidInput: EventEmitter<any>;\n\n private modal: HTMLSallaModalElement;\n private iframe: HTMLIFrameElement;\n\n constructor() {\n // Load translations\n salla.lang.onLoaded(() => this.setTranslations());\n // Register event listeners\n Salla.event.on('booking::open', (data) => this.handleBookingOpen(data));\n }\n\n private async setTranslations() {\n const setNestedAsync = (lang, key, value) => {\n return new Promise((resolve) => {\n salla.helpers.setNested(salla.lang.messages[lang], key, value);\n resolve(true);\n });\n };\n\n await setNestedAsync('ar.trans', 'pages.cart.book_an_appointment', 'حجز موعد');\n await setNestedAsync('en.trans', 'pages.cart.book_an_appointment', 'Book an Appointment');\n await setNestedAsync('ar.trans', 'pages.cart.edit_an_appointment', 'تعديل الموعد');\n await setNestedAsync('en.trans', 'pages.cart.edit_an_appointment', 'Edit an Appointment');\n await setNestedAsync('ar.trans', 'pages.cart.booked_successfully', 'تمت اضافة الموعد بنجاح');\n await setNestedAsync('en.trans', 'pages.cart.booked_successfully', 'Booked Successfully');\n await setNestedAsync('ar.trans', 'pages.cart.select_appointment_date', 'حدد تاريخ الموعد');\n await setNestedAsync('en.trans', 'pages.cart.select_appointment_date', 'Select appointment date');\n\n this.bookNowLabel = salla.lang.get('pages.cart.book_an_appointment');\n this.editLabel = salla.lang.get('pages.cart.edit_an_appointment');\n this.bookedLabel = salla.lang.get('pages.cart.booked_successfully');\n this.selectDate = salla.lang.get('pages.cart.select_appointment_date');\n }\n\n private openBookingModal(event: any, afterReload = false) {\n if (afterReload && (!event.detail || typeof event.detail !== 'number' || event.detail !== this.productId)) {\n return;\n }\n if (salla.config.isGuest()) {\n this.setAfterReloadEvent('booking::open-after-reload', this.productId);\n salla.event.dispatch('login::open');\n return;\n }\n salla.booking.add(this.productId, false)\n .then((resp) => {\n if (resp.data.redirect.to !== 'booking') {\n throw new Error('Unexpected redirect!');\n }\n salla.event.dispatch('booking::open', { url: resp.data.redirect.url, id: this.productId });\n })\n .catch((error) => {\n salla.error(salla.lang.get('common.errors.error_occurred'));\n salla.logger.error(error.response || error);\n });\n }\n\n private handleBookingOpen(data) {\n if (data.id !== this.productId) return;\n this.bookingUrl = salla.url.addParamToUrl('product_id', data.id, data.url);\n this.iframeReady = true;\n setTimeout(() => {\n this.modal.setTitle(this.selectDate);\n this.modal.open();\n }, 100);\n }\n\n private setAfterReloadEvent(event, payload) {\n salla.storage.set('afterReloadEvent', { event, payload });\n }\n\n private emitAfterReloadEvent() {\n const eventDetails = salla.storage.get('afterReloadEvent');\n if (eventDetails && eventDetails.event) {\n const customEvent = new CustomEvent(eventDetails.event, {\n detail: eventDetails.payload\n });\n window.dispatchEvent(customEvent)\n salla.storage.remove('afterReloadEvent');\n }\n }\n\n componentWillLoad() {\n if (this.option && this.option.details.length) {\n this.reservations = this.option.details;\n }\n }\n\n componentDidLoad() {\n window.addEventListener('booking::open-after-reload', (event) => this.openBookingModal(event, true));\n this.emitAfterReloadEvent();\n window.addEventListener('message', this.handleMessageEvent.bind(this));\n this.reservationsInput.addEventListener('invalid', e => this.invalidInput.emit(e));\n this.reservationsInput.addEventListener('input', () => {\n this.reservationsInput.setCustomValidity('');\n this.reservationsInput.reportValidity();\n });\n }\n\n private handleMessageEvent(event) {\n if (event.data.source !== 'booking') return;\n const action = event.data.type;\n const value = event.data.message;\n if (localStorage.getItem('debug')) console.log(`Received an action:${action}`, event.data);\n\n if (action === 'error') {\n if (value.fields?.reservation) {\n salla.notify.error(value.fields.reservation[0]);\n return;\n }\n const errorList = Object.values(value.fields).flat().map(error => `<li>${error}</li>`).join('');\n salla.notify.error(`<ul>${errorList}</ul>`);\n }\n\n if (action === 'success') {\n if (Number(value.productId) !== Number(this.productId)) return;\n this.reservations = value.data.reservations.map(schedule => {\n if (schedule.time && schedule.time.length > 0) {\n const timeSlot = schedule.time[0];\n return {\n date: schedule.date,\n day: schedule.day,\n from_timestamp: timeSlot.from,\n to_timestamp: timeSlot.to,\n };\n }\n return null;\n }).filter(item => item !== null);\n\n salla.notify.success(this.bookedLabel);\n this.modal?.close();\n setTimeout(() => window.location.reload());\n }\n\n if (action === 'height') {\n this.iframe.height = value?.height + 'px';\n }\n }\n\n private bookingModal() {\n return (\n <salla-modal class=\"s-booking-field-modal\" ref={modal => (this.modal = modal)} width=\"md\" position=\"middle\" noPadding>\n <iframe ref={iframe => (this.iframe = iframe)} src={this.bookingUrl} frameborder=\"0\"></iframe>\n </salla-modal>\n );\n }\n\n renderReservationDate(reservation: Reservation) {\n return (\n <span class={reservation.from_timestamp ? 's-booking-field-reservations-has-time' : ''}>\n <i class=\"s-booking-field-reservations-icon\" innerHTML={Calendar}></i>\n {reservation.date}\n </span>\n );\n }\n\n renderReservationTime(reservation: Reservation) {\n if (!reservation.from_timestamp) return '';\n return (\n <span class=\"s-booking-field-reservations-time\">\n <i class=\"s-booking-field-reservations-icon\" innerHTML={TimeIcon}></i>\n <span>\n {reservation.from_timestamp} - {reservation.to_timestamp}\n </span>\n </span>\n );\n }\n\n render() {\n return (\n <Host>\n <div class=\"s-booking-field-main\">\n {this.option.required || this.reservations.length > 0 ? <div class=\"s-booking-field-price\">\n <span>{salla.money(this.option.price)}</span>\n </div> : ''}\n <salla-button class=\"s-booking-field-book-now\" size=\"small\" loaderPosition=\"center\" fill=\"outline\" onClick={event => this.openBookingModal(event, false)}>\n <span class=\"s-booking-field-book-now-content\">\n <span innerHTML={BookingTime}></span>\n {this.reservations.length ? this.editLabel : this.bookNowLabel}\n </span>\n </salla-button>\n </div>\n {this.reservations.length > 0 && (\n <div class=\"s-booking-field-reservations\">\n {this.reservations.map((reservation, index) => (\n <div key={index} class=\"s-booking-field-reservations-item\">\n {this.renderReservationDate(reservation)}\n {this.renderReservationTime(reservation)}\n </div>\n ))}\n </div>\n )}\n <input \n class=\"s-hidden\" \n name={this.option.name} \n required={this.option.required} \n value={JSON.stringify(this.reservations) === '[]' ? '' : JSON.stringify(this.reservations)}\n ref={reservations => this.reservationsInput = reservations} \n />\n {this.iframeReady && this.bookingModal()}\n </Host>\n );\n }\n}\n","import { Component, Element, Host, Listen, h } from '@stencil/core';\n\n/**\n * its to easy to use, currenlty its support select & checkbox input as trigger for show/hide the dom\n * the dom you can put it like this data-show-when=\"{name of the field} {= or !=} {value of the field}\"\n */\n@Component({\n tag: 'salla-conditional-fields'\n})\nexport class SallaConditionalFields {\n\n @Element() host: HTMLElement;\n\n private hideAllOptions(optionId) {\n this.host.querySelectorAll(`[data-show-when^=\"options[${optionId}\"]`).forEach((field: HTMLElement) => {\n field.classList.add('hidden');\n this.hideAllOptions(field.dataset.optionId);\n this.disableInputs(field);\n });\n }\n\n private disableInputs(field) {\n field.querySelectorAll('[name]').forEach((input) => {\n\n input.setAttribute('disabled', '');\n input.removeAttribute('required');\n if (input?.tagName?.toLowerCase() === 'select') {\n input.value = ''\n }\n if (['checkbox'].includes(input.getAttribute('type')) && input.hasOwnProperty('checked')) {\n // @ts-ignore\n input.checked = false;\n }\n });\n }\n \n @Listen('change')\n changeHandler(event) {\n salla.event.emit('salla-onditional-fields::change', event);\n salla.log('Received the change event: ', event);\n\n if (!event.target || !['SELECT'].includes(event.target.tagName) && !['checkbox'].includes(event.target.getAttribute('type'))) {\n salla.log('Ignore the change because is not support input: ' + (event?.target?.tagName || 'N/A'));\n return;\n }\n\n // to extract the option id from the input name, the supported names are name[*] and name[*][]\n let optionId = event.target.name.replace('[]', '');\n let isMultiple = event.target.getAttribute('type') === 'checkbox';\n\n\n salla.log('Trying to find all the element with condition:', `[data-show-when^=\"${optionId}\"]`);\n\n this.host.querySelectorAll(`[data-show-when^=\"${optionId}\"]`)\n .forEach((field: HTMLElement) => {\n let isEqual = !field?.dataset.showWhen.includes('!=');\n let value = field?.dataset.showWhen.replace(/(.*)(=|!=)(.*)/gm, '$3').trim();\n // let isSelected = isMultiple ? event.target?.checked : value === event.target.value;\n let isSelected;\n\n if (isMultiple) {\n // @ts-ignore\n let selectedValues = Array.from(this.host.querySelectorAll(`input[name=\"${event.target.name}\"]:checked`), e => e?.value);\n isSelected = selectedValues.includes(value.toString());\n } else {\n isSelected = value === event.target.value;\n }\n\n salla.log('The input is ', (isMultiple ? 'Multiple' : 'Single'), ' value:', isSelected);\n\n let showTheInput = (isEqual && isSelected) || (!isEqual && !isSelected);\n if (showTheInput) {\n field.classList.remove('hidden');\n field.querySelectorAll('[name]').forEach((input) => {\n input.removeAttribute('disabled');\n\n\n // Return required attribute to the input if the option is required\n const closestProductOption = (input as HTMLInputElement).closest('.s-product-options-option') as HTMLElement;\n if (closestProductOption.dataset.optionRequired === 'true') {\n input.setAttribute('required', '');\n }\n\n\n // Handle multiple checkboxes with same name and required attribute \n if (input.getAttribute('type') === 'checkbox') {\n const checkboxes = Array.from(document.querySelectorAll(`input[type=\"checkbox\"][name=\"${input.getAttribute('name')}\"]`)) as HTMLInputElement[];\n const isAnyChecked = checkboxes.some((checkbox) => checkbox.checked); \n if (isAnyChecked) {\n checkboxes.forEach((checkbox) => {\n checkbox.removeAttribute('required');\n });\n }\n }\n //To handle focus on hidden input error\n if (!['checkbox'].includes(input.getAttribute('type')) && field.getElementsByClassName('required').length) {\n input.setAttribute('required', '');\n }\n });\n } else {\n this.hideAllOptions(field.dataset.optionId);\n field.classList.add('hidden');\n this.disableInputs(field);\n }\n });\n }\n\n componentDidRender() {\n this.host.querySelectorAll(`[data-show-when]`).forEach((field) => {\n // @ts-ignore\n let optionName = field?.dataset?.showWhen.replace(/(.*)(=|!=)(.*)/gm, '$1').trim();\n if (!optionName) {\n return;\n }\n\n this.changeHandler({\n target: this.host.querySelector('[name^=\"' + optionName + '\"]')\n })\n });\n }\n\n render() {\n return (\n <Host>\n <slot></slot>\n </Host>\n );\n }\n}\n"],"mappings":";;;+tFAAA,IAAMA,EAAuB,uB,ICUhBC,EAAiBC,EAAA,iCAqB5B,SAAAC,EAAAC,GAAA,IAAAC,EAAAC,K,sHAjBgCC,MAAMC,KAAKC,IAAI,iCAAkC,Y,eACpDF,MAAMC,KAAKC,IAAI,iCAAkC,gB,iBAC/CF,MAAMC,KAAKC,IAAI,iCAAkC,0B,gBAClDF,MAAMC,KAAKC,IAAI,qCAAsC,oB,gBACrD,G,iBACE,M,kBACO,G,iCAarCF,MAAMC,KAAKE,UAAS,WAAM,OAAAL,EAAKM,iBAAL,IAE1BC,MAAMC,MAAMC,GAAG,iBAAiB,SAACC,GAAS,OAAAV,EAAKW,kBAAkBD,EAAvB,G,CAG9BZ,EAAAc,UAAAN,gBAAN,W,kHACAO,EAAiB,SAACV,EAAMW,EAAKC,GACjC,OAAO,IAAIC,SAAQ,SAACC,GAClBf,MAAMgB,QAAQC,UAAUjB,MAAMC,KAAKiB,SAASjB,GAAOW,EAAKC,GACxDE,EAAQ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