@salla.sa/twilight-components 2.13.33 → 2.13.34

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 (45) hide show
  1. package/dist/cjs/loader.cjs.js +1 -1
  2. package/dist/cjs/salla-add-product-button_47.cjs.entry.js +2 -1
  3. package/dist/cjs/salla-add-product-button_47.cjs.entry.js.map +1 -1
  4. package/dist/cjs/salla-payments.cjs.entry.js +6 -4
  5. package/dist/cjs/salla-payments.cjs.entry.js.map +1 -1
  6. package/dist/cjs/twilight.cjs.js +1 -1
  7. package/dist/collection/components/salla-menu/salla-menu.js +19 -1
  8. package/dist/collection/components/salla-menu/salla-menu.js.map +1 -1
  9. package/dist/collection/components/salla-payments/salla-payments.js +6 -4
  10. package/dist/collection/components/salla-payments/salla-payments.js.map +1 -1
  11. package/dist/components/salla-menu.js +3 -1
  12. package/dist/components/salla-menu.js.map +1 -1
  13. package/dist/components/salla-payments.js +6 -4
  14. package/dist/components/salla-payments.js.map +1 -1
  15. package/dist/esm/loader.js +1 -1
  16. package/dist/esm/salla-add-product-button_47.entry.js +2 -1
  17. package/dist/esm/salla-add-product-button_47.entry.js.map +1 -1
  18. package/dist/esm/salla-payments.entry.js +6 -4
  19. package/dist/esm/salla-payments.entry.js.map +1 -1
  20. package/dist/esm/twilight.js +1 -1
  21. package/dist/esm-es5/loader.js +1 -1
  22. package/dist/esm-es5/loader.js.map +1 -1
  23. package/dist/esm-es5/salla-add-product-button_47.entry.js +1 -1
  24. package/dist/esm-es5/salla-add-product-button_47.entry.js.map +1 -1
  25. package/dist/esm-es5/salla-payments.entry.js +1 -1
  26. package/dist/esm-es5/salla-payments.entry.js.map +1 -1
  27. package/dist/esm-es5/twilight.js +1 -1
  28. package/dist/esm-es5/twilight.js.map +1 -1
  29. package/dist/twilight/{p-c51afb0e.entry.js → p-008228a1.entry.js} +2 -2
  30. package/dist/twilight/p-008228a1.entry.js.map +1 -0
  31. package/dist/twilight/{p-d3986c26.entry.js → p-19f298e9.entry.js} +2 -2
  32. package/dist/twilight/{p-d3986c26.entry.js.map → p-19f298e9.entry.js.map} +1 -1
  33. package/dist/twilight/{p-c2566189.system.entry.js → p-2830c714.system.entry.js} +2 -2
  34. package/dist/twilight/p-2830c714.system.entry.js.map +1 -0
  35. package/dist/twilight/{p-ac4405da.system.entry.js → p-35541777.system.entry.js} +2 -2
  36. package/dist/twilight/{p-ac4405da.system.entry.js.map → p-35541777.system.entry.js.map} +1 -1
  37. package/dist/twilight/p-64707107.system.js +1 -1
  38. package/dist/twilight/p-64707107.system.js.map +1 -1
  39. package/dist/twilight/twilight.esm.js +1 -1
  40. package/dist/twilight/twilight.esm.js.map +1 -1
  41. package/dist/types/components/salla-menu/salla-menu.d.ts +4 -0
  42. package/dist/types/components.d.ts +8 -0
  43. package/package.json +5 -5
  44. package/dist/twilight/p-c2566189.system.entry.js.map +0 -1
  45. package/dist/twilight/p-c51afb0e.entry.js.map +0 -1
@@ -27,10 +27,12 @@ const SallaPayments = class {
27
27
  });
28
28
  }
29
29
  render() {
30
- return (index.h(index.Host, { class: "s-payments-list" }, this.withMadeInKsa && index.h("li", { class: "s-payments-list-item" }, index.h("img", { class: "lazy", width: "100%", height: "100%", decoding: "async", loading: "lazy", "data-src": salla.url.cdn(`images/made-in-ksa.svg`), alt: "made in KSA certified" })), this.payments.map((payment) => (index.h("div", { id: "payment-slot", innerHTML: this.paymentSlot
31
- .replace(/\{image\}/g, salla.url.cdn(`images/payment/${payment}_mini.png`, 40, 40))
32
- .replace(/\{payment\}/g, payment) }))), index.h("div", { id: "cod-slot", innerHTML: this.codSlot
33
- .replace(/\{image\}/g, salla.url.cdn(`images/payment/cod_mini.png`, 40, 40)) }), this.withSbc && this.sbcId && index.h("div", { id: "sbc-slot", innerHTML: this.sbcSlot
30
+ return (index.h(index.Host, { class: "s-payments-list" }, this.withMadeInKsa && index.h("li", { class: "s-payments-list-item" }, index.h("img", { class: "lazy", width: "100%", height: "100%", decoding: "async", loading: "lazy", "data-src": salla.url.cdn(`images/made-in-ksa.svg`), alt: "made in KSA certified" })), this.payments.map((payment) => (payment == "cod" ?
31
+ index.h("div", { id: "cod-slot", innerHTML: this.codSlot
32
+ .replace(/\{image\}/g, salla.url.cdn(`images/payment/cod_mini.png`, 40, 40)) }) :
33
+ index.h("div", { id: "payment-slot", innerHTML: this.paymentSlot
34
+ .replace(/\{image\}/g, salla.url.cdn(`images/payment/${payment}_mini.png`, 40, 40))
35
+ .replace(/\{payment\}/g, payment) }))), this.withSbc && this.sbcId && index.h("div", { id: "sbc-slot", innerHTML: this.sbcSlot
34
36
  .replace(/\{image\}/g, salla.url.cdn(`images/sbc.png`, 40, 40))
35
37
  .replace(/\{link\}/g, `https://eauthenticate.saudibusiness.gov.sa/certificate-details/${this.sbcId}`) })));
36
38
  }
@@ -1 +1 @@
1
- {"file":"salla-payments.entry.cjs.js","mappings":";;;;;;;;;AAAA,MAAM,gBAAgB,GAAG,sBAAsB;;MCWlC,aAAa;EACxB;;;oBAcoB,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,yBAAyB,CAAC;4BACnC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,oBAAoB,CAAC;;;;IAd7D,IAAI,CAAC,WAAW,GAAG,CAAA,MAAA,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,kBAAkB,CAAC,0CAAE,SAAS,KAAI,sFAAsF,IAAI,CAAC,gBAAgB,wCAAwC,CAAC;IACjO,IAAI,CAAC,OAAO,GAAG,CAAA,MAAA,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,cAAc,CAAC,0CAAE,SAAS,KAAI,2GAA2G,IAAI,CAAC,gBAAgB,0EAA0E,CAAC;IAChR,IAAI,CAAC,OAAO,GAAG,CAAA,MAAA,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,cAAc,CAAC,0CAAE,SAAS,KAAI,0EAA0E,IAAI,CAAC,gBAAgB,iDAAiD,CAAC;IAEtN,KAAK,CAAC,OA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C,aAAa,CAAC,cAAc,CAAC,0CAAE,MAAM,EAAE,CAAC;GACnD;;;;;;;","names":["h","Host"],"sources":["src/components/salla-payments/salla-payments.scss?tag=salla-payments","src/components/salla-payments/salla-payments.tsx"],"sourcesContent":[":host {\n display: block;\n}\n","import { Component, Host, Prop, State, h, Element } from '@stencil/core';\n/**\n * @slot payment - Replaces payment item, has replaceable props `{image}`, `{name}`.\n * @slot sbc - Replaces SBC certificate item, has replaceable props `{image}`.\n * @slot cod - Replaces COD item, has replaceable props `{image}`.\n */\n@Component({\n tag: 'salla-payments',\n styleUrl: 'salla-payments.scss'\n})\n\nexport class SallaPayments {\n constructor() {\n this.paymentSlot = this.host.querySelector('[slot=\"payment\"]')?.innerHTML || `<li class=\"s-payments-list-item\"><img class=\"lazy\" width=\"100%\" height=\"100%\" src=\"${this.placeholderImage}\" data-src=\"{image}\" alt={name} /><li>`;\n this.sbcSlot = this.host.querySelector('[slot=\"sbc\"]')?.innerHTML || `<li class=\"s-payments-list-item\"><a target=\"_blank\" href=\"{link}\"> <img width=\"100%\" height=\"100%\" src=\"${this.placeholderImage}\" data-src={image} class=\"lazy s-payments-sbc-image\" alt=\"SBC\"/></a><li>`;\n this.codSlot = this.host.querySelector('[slot=\"cod\"]')?.innerHTML || `<li class=\"s-payments-list-item\"> <img width=\"100%\" height=\"100%\" src=\"${this.placeholderImage}\" data-src={image} class=\"lazy\" alt=\"COD\"/><li>`;\n\n salla.onReady(() => {\n this.payments = salla.config.get('store.settings.payments');\n this.placeholderImage = salla.url.cdn(`images/s-empty.png`);\n });\n }\n private readonly paymentSlot: string;\n private readonly sbcSlot: string;\n private readonly codSlot: string;\n @Element() host: HTMLElement;\n @State() payments = salla.config.get('store.settings.payments');\n @State() placeholderImage = salla.url.cdn(`images/s-empty.png`);\n\n /**\n * Boolean indicating whether to include the SBC (Saudi Business Council) certificate.\n */\n @Prop() withSbc: boolean;\n \n /**\n * The SBC (Saudi Business Council) certificate ID.\n */\n @Prop() sbcId: string;\n\n /**\n * Boolean indicating whether to include the \"Made in KSA\" certification.\n */\n @Prop() withMadeInKsa: boolean;\n\n render() {\n return (\n <Host class=\"s-payments-list\">\n\n {/* Made in KSA */}\n {this.withMadeInKsa && <li class=\"s-payments-list-item\">\n <img class=\"lazy\" width=\"100%\" height=\"100%\" decoding=\"async\" loading=\"lazy\" data-src={salla.url.cdn(`images/made-in-ksa.svg`)} alt=\"made in KSA certified\" />\n </li>}\n\n {/* Dynamic methods */}\n {this.payments.map((payment) => (\n <div id=\"payment-slot\" innerHTML={this.paymentSlot\n .replace(/\\{image\\}/g, salla.url.cdn(`images/payment/${payment}_mini.png`, 40, 40))\n .replace(/\\{payment\\}/g, payment)}>\n </div>\n ))}\n\n {/* COD method - Static in all stores */}\n <div id=\"cod-slot\" innerHTML={this.codSlot\n .replace(/\\{image\\}/g, salla.url.cdn(`images/payment/cod_mini.png`, 40, 40))}>\n </div>\n\n {/* SBC certificate */}\n {this.withSbc && this.sbcId && <div id=\"sbc-slot\" innerHTML={this.sbcSlot\n .replace(/\\{image\\}/g, salla.url.cdn(`images/sbc.png`, 40, 40))\n .replace(/\\{link\\}/g, `https://eauthenticate.saudibusiness.gov.sa/certificate-details/${this.sbcId}`)}>\n </div>}\n </Host>\n );\n }\n componentDidLoad() {\n document.lazyLoadInstance?.update(this.host.querySelectorAll('.lazy'));\n // fix lazy loaded images that have 100% width and height\n this.host.querySelectorAll('.lazy').forEach((img) => {\n img.addEventListener('load', () => {\n img.setAttribute('width', \"100%\");\n img.setAttribute('height', \"100%\");\n });\n });\n }\n componentDidRender() {\n this.host.querySelectorAll('#payment-slot').forEach(el => el.replaceWith(el.firstChild));\n this.host.querySelectorAll('#sbc-slot').forEach(el => el.replaceWith(el.firstChild));\n this.host.querySelectorAll('#cod-slot').forEach(el => el.replaceWith(el.firstChild));\n this.host.querySelector('[slot=\"payment\"]')?.remove();\n this.host.querySelector('[slot=\"sbc\"]')?.remove();\n this.host.querySelector('[slot=\"cod\"]')?.remove();\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AY,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;OACpC,CAAC,CAAC;KACJ,CAAC,CAAC;GACJ;EACD,kBAAkB;;IAChB,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,eAAe,CAAC,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,CAAC,WAAW,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;IACzF,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,CAAC,WAAW,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;IACrF,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,CAAC,WAAW,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;IACrF,MAAA,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,kBAAkB,CAAC,0CAAE,MAAM,EAAE,CAAC;IACtD,MAAA,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,cAAc,CAAC,0CAAE,MAAM,EAAE,CAAC;IAClD,MAAA,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,cAAc,CAAC,0CAAE,MAAM,EAAE,CAAC;GACnD;;;;;;;","names":["h","Host"],"sources":["src/components/salla-payments/salla-payments.scss?tag=salla-payments","src/components/salla-payments/salla-payments.tsx"],"sourcesContent":[":host {\n display: block;\n}\n","import { Component, Host, Prop, State, h, Element } from '@stencil/core';\n/**\n * @slot payment - Replaces payment item, has replaceable props `{image}`, `{name}`.\n * @slot sbc - Replaces SBC certificate item, has replaceable props `{image}`.\n * @slot cod - Replaces COD item, has replaceable props `{image}`.\n */\n@Component({\n tag: 'salla-payments',\n styleUrl: 'salla-payments.scss'\n})\n\nexport class SallaPayments {\n constructor() {\n this.paymentSlot = this.host.querySelector('[slot=\"payment\"]')?.innerHTML || `<li class=\"s-payments-list-item\"><img class=\"lazy\" width=\"100%\" height=\"100%\" src=\"${this.placeholderImage}\" data-src=\"{image}\" alt={name} /><li>`;\n this.sbcSlot = this.host.querySelector('[slot=\"sbc\"]')?.innerHTML || `<li class=\"s-payments-list-item\"><a target=\"_blank\" href=\"{link}\"> <img width=\"100%\" height=\"100%\" src=\"${this.placeholderImage}\" data-src={image} class=\"lazy s-payments-sbc-image\" alt=\"SBC\"/></a><li>`;\n this.codSlot = this.host.querySelector('[slot=\"cod\"]')?.innerHTML || `<li class=\"s-payments-list-item\"> <img width=\"100%\" height=\"100%\" src=\"${this.placeholderImage}\" data-src={image} class=\"lazy\" alt=\"COD\"/><li>`;\n\n salla.onReady(() => {\n this.payments = salla.config.get('store.settings.payments');\n this.placeholderImage = salla.url.cdn(`images/s-empty.png`);\n });\n }\n private readonly paymentSlot: string;\n private readonly sbcSlot: string;\n private readonly codSlot: string;\n @Element() host: HTMLElement;\n @State() payments = salla.config.get('store.settings.payments');\n @State() placeholderImage = salla.url.cdn(`images/s-empty.png`);\n\n /**\n * Boolean indicating whether to include the SBC (Saudi Business Council) certificate.\n */\n @Prop() withSbc: boolean;\n\n /**\n * The SBC (Saudi Business Council) certificate ID.\n */\n @Prop() sbcId: string;\n\n /**\n * Boolean indicating whether to include the \"Made in KSA\" certification.\n */\n @Prop() withMadeInKsa: boolean;\n\n render() {\n return (\n <Host class=\"s-payments-list\">\n\n {/* Made in KSA */}\n {this.withMadeInKsa && <li class=\"s-payments-list-item\">\n <img class=\"lazy\" width=\"100%\" height=\"100%\" decoding=\"async\" loading=\"lazy\" data-src={salla.url.cdn(`images/made-in-ksa.svg`)} alt=\"made in KSA certified\" />\n </li>}\n\n {/* Dynamic methods */}\n {this.payments.map((payment) => (\n payment == \"cod\" ?\n <div id=\"cod-slot\" innerHTML={this.codSlot\n .replace(/\\{image\\}/g, salla.url.cdn(`images/payment/cod_mini.png`, 40, 40))}>\n </div> :\n <div id=\"payment-slot\" innerHTML={this.paymentSlot\n .replace(/\\{image\\}/g, salla.url.cdn(`images/payment/${payment}_mini.png`, 40, 40))\n .replace(/\\{payment\\}/g, payment)}>\n </div>\n ))}\n\n\n {/* SBC certificate */}\n {this.withSbc && this.sbcId && <div id=\"sbc-slot\" innerHTML={this.sbcSlot\n .replace(/\\{image\\}/g, salla.url.cdn(`images/sbc.png`, 40, 40))\n .replace(/\\{link\\}/g, `https://eauthenticate.saudibusiness.gov.sa/certificate-details/${this.sbcId}`)}>\n </div>}\n </Host>\n );\n }\n componentDidLoad() {\n document.lazyLoadInstance?.update(this.host.querySelectorAll('.lazy'));\n // fix lazy loaded images that have 100% width and height\n this.host.querySelectorAll('.lazy').forEach((img) => {\n img.addEventListener('load', () => {\n img.setAttribute('width', \"100%\");\n img.setAttribute('height', \"100%\");\n });\n });\n }\n componentDidRender() {\n this.host.querySelectorAll('#payment-slot').forEach(el => el.replaceWith(el.firstChild));\n this.host.querySelectorAll('#sbc-slot').forEach(el => el.replaceWith(el.firstChild));\n this.host.querySelectorAll('#cod-slot').forEach(el => el.replaceWith(el.firstChild));\n this.host.querySelector('[slot=\"payment\"]')?.remove();\n this.host.querySelector('[slot=\"sbc\"]')?.remove();\n this.host.querySelector('[slot=\"cod\"]')?.remove();\n }\n}\n"],"version":3}
@@ -23,7 +23,7 @@ const patchBrowser = () => {
23
23
 
24
24
  patchBrowser().then(options => {
25
25
  appGlobals.globalScripts();
26
- return index.bootstrapLazy(JSON.parse("[[\"salla-offer.cjs\",[[0,\"salla-offer\",{\"productCardComponent\":[1,\"product-card-component\"],\"offersList\":[32],\"userCurrency\":[32],\"isMultipleBank\":[32],\"title\":[32],\"currentPage\":[32],\"hasCustomComponent\":[32],\"isBankOffer\":[32],\"canRender\":[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]}]]],[\"salla-products-slider.cjs\",[[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\"],\"productsData\":[32],\"isReady\":[32],\"sourceValueIsValid\":[32],\"hasCustomComponent\":[32],\"apiUrl\":[32],\"parsedSourceValue\":[32]}]]],[\"salla-product-options.cjs\",[[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],\"getSelectedOptionsData\":[64],\"reportValidity\":[64],\"hasOutOfStockOption\":[64],\"getSelectedOptions\":[64],\"getOption\":[64]}]]],[\"salla-filters.cjs\",[[0,\"salla-filters\",{\"filters\":[1040],\"isSidebarOpen\":[32],\"filtersData\":[32],\"apply\":[32],\"reset\":[32],\"getFilters\":[64],\"applyFilters\":[64],\"resetFilters\":[64]}]]],[\"salla-notifications.cjs\",[[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]}]]],[\"salla-order-summary.cjs\",[[0,\"salla-order-summary\",{\"orderId\":[514,\"order-id\"],\"codeCopied\":[32],\"noItemFound\":[32],\"order_items\":[32]}]]],[\"salla-advertisement.cjs\",[[0,\"salla-advertisement\",{\"position\":[32],\"advertisements\":[32],\"advertIcon\":[32],\"currentSlug\":[32]}]]],[\"salla-app-install-alert.cjs\",[[0,\"salla-app-install-alert\",{\"data\":[32],\"ctaLink\":[32],\"open\":[32],\"closing\":[32]}]]],[\"salla-apps-icons.cjs\",[[0,\"salla-apps-icons\",{\"hideTitle\":[4,\"hide-title\"],\"appsTitle\":[1,\"apps-title\"],\"vertical\":[4],\"apps\":[32]}]]],[\"salla-contacts.cjs\",[[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]}]]],[\"salla-installment.cjs\",[[0,\"salla-installment\",{\"price\":[1],\"language\":[1],\"currency\":[1],\"tamaraIsActive\":[32],\"tabbyIsActive\":[32],\"spotiiIsActive\":[32],\"mispayActive\":[32],\"installment_sheria_text\":[32]}]]],[\"salla-loyalty-prize-item.cjs\",[[0,\"salla-loyalty-prize-item\",{\"item\":[16]}]]],[\"salla-metadata.cjs\",[[0,\"salla-metadata\",{\"entity\":[1],\"entityId\":[2,\"entity-id\"],\"specs\":[32],\"download\":[32]}]]],[\"salla-payments.cjs\",[[0,\"salla-payments\",{\"withSbc\":[4,\"with-sbc\"],\"sbcId\":[1,\"sbc-id\"],\"withMadeInKsa\":[4,\"with-made-in-ksa\"],\"payments\":[32],\"placeholderImage\":[32]}]]],[\"salla-products-list.cjs\",[[0,\"salla-products-list\",{\"source\":[1537],\"sourceValue\":[1032,\"source-value\"],\"limit\":[1026],\"sortBy\":[1025,\"sort-by\"],\"filtersResults\":[1540,\"filters-results\"],\"horizontalCards\":[516,\"horizontal-cards\"],\"autoload\":[1028],\"loadMoreText\":[1,\"load-more-text\"],\"productCardComponent\":[1,\"product-card-component\"],\"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]}]]],[\"salla-social.cjs\",[[0,\"salla-social\",{\"links\":[32],\"iconsList\":[32]}]]],[\"salla-filters-widget.cjs\",[[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]}]]],[\"salla-conditional-fields.cjs\",[[4,\"salla-conditional-fields\",null,[[0,\"change\",\"changeHandler\"]]]]],[\"salla-notification-item.cjs\",[[0,\"salla-notification-item\",{\"notification\":[16]}]]],[\"salla-price-range.cjs\",[[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],\"debounce\":[32],\"reset\":[64]}]]],[\"salla-add-product-button_47.cjs\",[[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-menu\",{\"source\":[1],\"sourceValue\":[1,\"source-value\"],\"topnav\":[4],\"useReactLink\":[4,\"use-react-link\"],\"menus\":[32],\"hasCustomComponent\":[32],\"setMenuContent\":[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]}],[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]}],[0,\"salla-rating-modal\",{\"orderId\":[2,\"order-id\"],\"order\":[32],\"hasError\":[32],\"errorMessage\":[32],\"translationLoaded\":[32],\"open\":[64],\"close\":[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-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-comments\",{\"itemId\":[2,\"item-id\"],\"loadMoreText\":[1,\"load-more-text\"],\"hideForm\":[4,\"hide-form\"],\"type\":[1],\"comments\":[32],\"pagination\":[32],\"total\":[32],\"showPlaceholder\":[32],\"nextPage\":[32],\"noComments\":[32],\"comment_title\":[32],\"comment_name\":[32],\"placeholder_text\":[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-profile\",{\"customFields\":[1,\"custom-fields\"],\"userData\":[32],\"userDefinedFields\":[32],\"disableAction\":[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-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\"]]],[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\",{\"items\":[1],\"breadcrumbs\":[32],\"currentPage\":[32],\"isRtl\":[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-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-comment-item\",{\"comment\":[16],\"has_bought_trans\":[32],\"rated_trans\":[32],\"waiting_approval_trans\":[32],\"has_order_trans\":[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-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-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]}],[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]}],[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-file-upload\",{\"value\":[1537],\"files\":[513],\"height\":[513],\"cartItemId\":[1,\"cart-item-id\"],\"profileImage\":[516,\"profile-image\"],\"name\":[1537],\"payloadName\":[1,\"payload-name\"],\"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\"],\"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\"],\"setOption\":[64]}],[4,\"salla-list-tile\",{\"href\":[1],\"target\":[1]}],[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]}],[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-progress-bar\",{\"donation\":[1],\"target\":[1026],\"value\":[1026],\"height\":[1025],\"header\":[1025],\"stripped\":[1028],\"message\":[1025],\"unit\":[1025],\"color\":[1025]}],[0,\"salla-rating-stars\",{\"name\":[1],\"size\":[1],\"value\":[2],\"reviews\":[2]}],[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-skeleton\",{\"type\":[1],\"width\":[1],\"height\":[1]}],[4,\"salla-placeholder\",{\"icon\":[1],\"alignment\":[1],\"iconSize\":[1,\"icon-size\"],\"translationLoaded\":[32]}],[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]}]]]]"), options);
26
+ return index.bootstrapLazy(JSON.parse("[[\"salla-offer.cjs\",[[0,\"salla-offer\",{\"productCardComponent\":[1,\"product-card-component\"],\"offersList\":[32],\"userCurrency\":[32],\"isMultipleBank\":[32],\"title\":[32],\"currentPage\":[32],\"hasCustomComponent\":[32],\"isBankOffer\":[32],\"canRender\":[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]}]]],[\"salla-products-slider.cjs\",[[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\"],\"productsData\":[32],\"isReady\":[32],\"sourceValueIsValid\":[32],\"hasCustomComponent\":[32],\"apiUrl\":[32],\"parsedSourceValue\":[32]}]]],[\"salla-product-options.cjs\",[[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],\"getSelectedOptionsData\":[64],\"reportValidity\":[64],\"hasOutOfStockOption\":[64],\"getSelectedOptions\":[64],\"getOption\":[64]}]]],[\"salla-filters.cjs\",[[0,\"salla-filters\",{\"filters\":[1040],\"isSidebarOpen\":[32],\"filtersData\":[32],\"apply\":[32],\"reset\":[32],\"getFilters\":[64],\"applyFilters\":[64],\"resetFilters\":[64]}]]],[\"salla-notifications.cjs\",[[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]}]]],[\"salla-order-summary.cjs\",[[0,\"salla-order-summary\",{\"orderId\":[514,\"order-id\"],\"codeCopied\":[32],\"noItemFound\":[32],\"order_items\":[32]}]]],[\"salla-advertisement.cjs\",[[0,\"salla-advertisement\",{\"position\":[32],\"advertisements\":[32],\"advertIcon\":[32],\"currentSlug\":[32]}]]],[\"salla-app-install-alert.cjs\",[[0,\"salla-app-install-alert\",{\"data\":[32],\"ctaLink\":[32],\"open\":[32],\"closing\":[32]}]]],[\"salla-apps-icons.cjs\",[[0,\"salla-apps-icons\",{\"hideTitle\":[4,\"hide-title\"],\"appsTitle\":[1,\"apps-title\"],\"vertical\":[4],\"apps\":[32]}]]],[\"salla-contacts.cjs\",[[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]}]]],[\"salla-installment.cjs\",[[0,\"salla-installment\",{\"price\":[1],\"language\":[1],\"currency\":[1],\"tamaraIsActive\":[32],\"tabbyIsActive\":[32],\"spotiiIsActive\":[32],\"mispayActive\":[32],\"installment_sheria_text\":[32]}]]],[\"salla-loyalty-prize-item.cjs\",[[0,\"salla-loyalty-prize-item\",{\"item\":[16]}]]],[\"salla-metadata.cjs\",[[0,\"salla-metadata\",{\"entity\":[1],\"entityId\":[2,\"entity-id\"],\"specs\":[32],\"download\":[32]}]]],[\"salla-payments.cjs\",[[0,\"salla-payments\",{\"withSbc\":[4,\"with-sbc\"],\"sbcId\":[1,\"sbc-id\"],\"withMadeInKsa\":[4,\"with-made-in-ksa\"],\"payments\":[32],\"placeholderImage\":[32]}]]],[\"salla-products-list.cjs\",[[0,\"salla-products-list\",{\"source\":[1537],\"sourceValue\":[1032,\"source-value\"],\"limit\":[1026],\"sortBy\":[1025,\"sort-by\"],\"filtersResults\":[1540,\"filters-results\"],\"horizontalCards\":[516,\"horizontal-cards\"],\"autoload\":[1028],\"loadMoreText\":[1,\"load-more-text\"],\"productCardComponent\":[1,\"product-card-component\"],\"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]}]]],[\"salla-social.cjs\",[[0,\"salla-social\",{\"links\":[32],\"iconsList\":[32]}]]],[\"salla-filters-widget.cjs\",[[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]}]]],[\"salla-conditional-fields.cjs\",[[4,\"salla-conditional-fields\",null,[[0,\"change\",\"changeHandler\"]]]]],[\"salla-notification-item.cjs\",[[0,\"salla-notification-item\",{\"notification\":[16]}]]],[\"salla-price-range.cjs\",[[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],\"debounce\":[32],\"reset\":[64]}]]],[\"salla-add-product-button_47.cjs\",[[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-menu\",{\"source\":[1],\"sourceValue\":[1,\"source-value\"],\"topnav\":[4],\"useReactLink\":[4,\"use-react-link\"],\"limit\":[2],\"menus\":[32],\"hasCustomComponent\":[32],\"setMenuContent\":[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]}],[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]}],[0,\"salla-rating-modal\",{\"orderId\":[2,\"order-id\"],\"order\":[32],\"hasError\":[32],\"errorMessage\":[32],\"translationLoaded\":[32],\"open\":[64],\"close\":[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-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-comments\",{\"itemId\":[2,\"item-id\"],\"loadMoreText\":[1,\"load-more-text\"],\"hideForm\":[4,\"hide-form\"],\"type\":[1],\"comments\":[32],\"pagination\":[32],\"total\":[32],\"showPlaceholder\":[32],\"nextPage\":[32],\"noComments\":[32],\"comment_title\":[32],\"comment_name\":[32],\"placeholder_text\":[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-profile\",{\"customFields\":[1,\"custom-fields\"],\"userData\":[32],\"userDefinedFields\":[32],\"disableAction\":[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-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\"]]],[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\",{\"items\":[1],\"breadcrumbs\":[32],\"currentPage\":[32],\"isRtl\":[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-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-comment-item\",{\"comment\":[16],\"has_bought_trans\":[32],\"rated_trans\":[32],\"waiting_approval_trans\":[32],\"has_order_trans\":[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-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-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]}],[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]}],[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-file-upload\",{\"value\":[1537],\"files\":[513],\"height\":[513],\"cartItemId\":[1,\"cart-item-id\"],\"profileImage\":[516,\"profile-image\"],\"name\":[1537],\"payloadName\":[1,\"payload-name\"],\"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\"],\"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\"],\"setOption\":[64]}],[4,\"salla-list-tile\",{\"href\":[1],\"target\":[1]}],[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]}],[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-progress-bar\",{\"donation\":[1],\"target\":[1026],\"value\":[1026],\"height\":[1025],\"header\":[1025],\"stripped\":[1028],\"message\":[1025],\"unit\":[1025],\"color\":[1025]}],[0,\"salla-rating-stars\",{\"name\":[1],\"size\":[1],\"value\":[2],\"reviews\":[2]}],[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-skeleton\",{\"type\":[1],\"width\":[1],\"height\":[1]}],[4,\"salla-placeholder\",{\"icon\":[1],\"alignment\":[1],\"iconSize\":[1,\"icon-size\"],\"translationLoaded\":[32]}],[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]}]]]]"), options);
27
27
  });
28
28
 
29
29
  exports.setNonce = index.setNonce;
@@ -10,6 +10,7 @@ export class SallaMenu {
10
10
  this.sourceValue = undefined;
11
11
  this.topnav = undefined;
12
12
  this.useReactLink = false;
13
+ this.limit = undefined;
13
14
  this.menus = [];
14
15
  this.hasCustomComponent = undefined;
15
16
  if (!!this.sourceValue) {
@@ -99,7 +100,7 @@ export class SallaMenu {
99
100
  return h("div", null, h("div", { class: {
100
101
  "s-menu-footer-list": !this.topnav,
101
102
  "s-menu-topnav-list": this.topnav
102
- } }, items.slice(0, 3).map((menu) => {
103
+ } }, ((this.topnav || this.limit) ? items.slice(0, this.limit || 3) : items).map((menu) => {
103
104
  return h("a", { href: menu.url, target: menu.target, class: {
104
105
  "s-menu-footer-item": !this.topnav,
105
106
  "s-menu-topnav-item topnav-link-item right-side": this.topnav
@@ -202,6 +203,23 @@ export class SallaMenu {
202
203
  "attribute": "use-react-link",
203
204
  "reflect": false,
204
205
  "defaultValue": "false"
206
+ },
207
+ "limit": {
208
+ "type": "number",
209
+ "mutable": false,
210
+ "complexType": {
211
+ "original": "number",
212
+ "resolved": "number",
213
+ "references": {}
214
+ },
215
+ "required": false,
216
+ "optional": false,
217
+ "docs": {
218
+ "tags": [],
219
+ "text": "Limiting the number of menu items"
220
+ },
221
+ "attribute": "limit",
222
+ "reflect": false
205
223
  }
206
224
  };
207
225
  }
@@ -1 +1 @@
1
- {"version":3,"file":"salla-menu.js","sourceRoot":"","sources":["../../../src/components/salla-menu/salla-menu.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAClE,OAAO,EAAkB,OAAO,EAAE,MAAM,cAAc,CAAC;AAGvD,OAAO,MAAM,MAAM,sBAAsB,CAAC;AAM1C,MAAM,OAAO,SAAS;EAEpB;kBAoB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R,CAAC;EAED,MAAM;IAEJ,IAAI,IAAI,CAAC,MAAM,KAAK,OAAO,CAAC,MAAM,EAAE;MAClC,OAAO,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;KACzC;IACD,OAAO,cACJ,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAoB,EAAE,EAAE;MACvC,OAAO,IAAI,CAAC,gBAAgB,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;IAC1C,CAAC,CAAC,CAEC,CAAA;EACP,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, h, Method, Prop, State } from '@stencil/core';\nimport { MenuContentDTO, Sources } from './interfaces';\nimport { Product } from \"@salla.sa/twilight/types/common\"\nimport { FooterMenu } from '../../../../twilight/types/api/component';\nimport Helper from '../../Helpers/Helper';\n\n@Component({\n tag: 'salla-menu',\n styleUrl: 'salla-menu.scss',\n})\nexport class SallaMenu {\n\n constructor() {\n if (!!this.sourceValue) {\n this.setMenuContent(JSON.parse(this.sourceValue));\n } else {\n this.getMenuItems();\n }\n // salla.lang.onLoaded(() => {\n // this.pageLinkLabel = salla.lang.getWithDefault(\"blocks.footer.pages_links\", this.pageLinkLabel)\n // })\n }\n componentWillLoad() {\n return Helper.onSallaReadyPromise((resolve) => {\n this.hasCustomComponent = !!customElements.get('custom-salla-product-card');\n resolve();\n })\n }\n\n /**\n * The source of the menu, specifying whether it is a header or footer menu.\n */\n @Prop() source: Sources.Header | Sources.Footer | Sources.Footer = Sources.Header\n\n /**\n * The source value, a stringified JSON representation of the menu content.\n */\n @Prop() sourceValue?: string;\n\n /**\n * Boolean indicating whether the menu is a top navigation menu.\n */\n @Prop() topnav: boolean;\n\n /**\n * Boolean indicating whether to use React Link elements for menu links.\n */\n @Prop() useReactLink: boolean = false;\n\n\n // States \n @State() menus: MenuContentDTO[] = [];\n @State() hasCustomComponent: boolean;\n // @State() pageLinkLabel: string;\n\n private getMenuItems() {\n salla.api.component.getMenus(this.source).then(resp => {\n // TODO: this has to be removed after the the api's consistency issue is fixed\n // FROM HERE\n let menusData = resp.data;\n if (!Array.isArray(menusData)) {\n let menusArray = Object.keys(menusData).map((key: string) => {\n return menusData[key]\n })\n return this.setMenuContent(menusArray)\n }\n // TILL HERE\n return this.setMenuContent(resp.data)\n });\n }\n\n private getAttributes(attrs: string) {\n return attrs.trim().split(' ').reduce((result, attr) => {\n let [key, value] = attr.split('=');\n result[key] = value.replace(/\"/g, '');\n return result;\n }, {});\n }\n\n private getLinkTag(menu: MenuContentDTO, additionalClass: string = \"\") {\n if (this.useReactLink) {\n let link = document.createElement(\"Link\")\n let attributes = this.getAttributes(menu.link_attrs)\n Object.keys(attributes).forEach(attr => {\n link.setAttribute(attr, attributes[attr]);\n });\n link.innerHTML = menu.title;\n link.classList.add(additionalClass)\n return link;\n }\n return <a {...this.getAttributes(menu.link_attrs)} class={additionalClass} href={menu.url}>\n <span>{menu.title}</span>\n </a>\n }\n\n /**\n * Updates the internal state of the component with the provided menu data.\n *\n * @param {MenuContentDTO[]} menus - An array of MenuContentDTO objects representing the new menu content.\n */\n @Method()\n async setMenuContent(menus: MenuContentDTO[]): Promise<void> {\n this.menus = menus\n }\n\n private getListItemClass(menu: MenuContentDTO, isRootMenu: boolean = false) {\n return {\n \"s-menu-item\": true,\n \"s-menu-root-level\": isRootMenu,\n \"s-menu-non-root-level\": !isRootMenu,\n \"s-menu-has-children\": !!menu.has_children,\n \"s-menu-mega-menu\": !!menu.products\n }\n }\n\n private _get_header_menu(menu: MenuContentDTO, isRootMenu: boolean = false) {\n return [<li class={this.getListItemClass(menu, isRootMenu)}\n {...this.getAttributes(menu.attrs)}>\n {\n this.getLinkTag(menu)\n }\n {\n menu.has_children ?\n <div class={`s-menu-submenu ${!!menu.products ? 's-menu-submenu-with-product' : 's-menu-submenu-without-product'}}`}>\n <ul class={`${!!menu.products ? 's-menu-submenu-unordered-list' : ''}`}>\n {\n menu.children.map((submenu: MenuContentDTO) =>\n this._get_header_menu(submenu)\n )\n }\n </ul>\n\n {\n !!menu.products ?\n <div class=\"s-menu-products-wrapper\">\n <div class=\"s-menu-products-container\">\n {\n menu.products.slice(0, 4).map((product: Product) => {\n if (this.hasCustomComponent) {\n return <custom-salla-product-card product={JSON.stringify(product)}></custom-salla-product-card>\n }\n <salla-product-card shadow-on-hover product={JSON.stringify(product)}></salla-product-card>\n })\n }\n </div>\n </div>\n : \"\"\n }\n\n </div>\n : ''\n }\n </li>,\n\n <li class=\"lg:hidden text-sm font-bold\" {...this.getAttributes(menu.attrs)}>\n {!menu.has_children ?\n this.getLinkTag(menu, \"text-gray-500\")\n :\n [<span>{menu.title}</span>,\n <ul>\n <li class=\"text-sm font-bold\">\n {this.getLinkTag(menu, \"text-gray-500\")}\n </li>\n {\n menu.children.map((submenu: MenuContentDTO) =>\n this._get_header_menu(submenu)\n )\n }\n </ul>]\n }\n </li>\n ];\n }\n\n private _get_footer_menu(menus: FooterMenu[]) {\n let items = this.topnav ? menus.slice(0, 3) : menus\n return <div>\n <div class={{\n \"s-menu-footer-list\": !this.topnav,\n \"s-menu-topnav-list\": this.topnav\n }}\n >\n {items.slice(0, 3).map((menu: FooterMenu) => {\n return <a href={menu.url} target={menu.target} class={{\n \"s-menu-footer-item\": !this.topnav,\n \"s-menu-topnav-item topnav-link-item right-side\": this.topnav\n }}>{menu.title}</a>\n })}\n </div>\n </div>\n }\n\n render() {\n\n if (this.source === Sources.Footer) {\n return this._get_footer_menu(this.menus)\n }\n return <ul>\n {this.menus.map((menu: MenuContentDTO) => {\n return this._get_header_menu(menu, true)\n })\n }\n </ul>\n }\n}\n"]}
1
+ {"version":3,"file":"salla-menu.js","sourceRoot":"","sources":["../../../src/components/salla-menu/salla-menu.tsx"],"names":[],"mappings":"AAAA,OA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C,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,IAAgB,EAAE,EAAE;QAC9F,OAAO,SAAG,IAAI,EAAE,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,KAAK,EAAE;YACpD,oBAAoB,EAAE,CAAC,IAAI,CAAC,MAAM;YAClC,gDAAgD,EAAE,IAAI,CAAC,MAAM;WAC9D,IAAG,IAAI,CAAC,KAAK,CAAK,CAAA;MACrB,CAAC,CAAC,CACE,CACF,CAAA;EACR,CAAC;EAED,MAAM;IAEJ,IAAI,IAAI,CAAC,MAAM,KAAK,OAAO,CAAC,MAAM,EAAE;MAClC,OAAO,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;KACzC;IACD,OAAO,cACJ,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAoB,EAAE,EAAE;MACvC,OAAO,IAAI,CAAC,gBAAgB,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;IAC1C,CAAC,CAAC,CAEC,CAAA;EACP,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, h, Method, Prop, State } from '@stencil/core';\nimport { MenuContentDTO, Sources } from './interfaces';\nimport { Product } from \"@salla.sa/twilight/types/common\"\nimport { FooterMenu } from '../../../../twilight/types/api/component';\nimport Helper from '../../Helpers/Helper';\n\n@Component({\n tag: 'salla-menu',\n styleUrl: 'salla-menu.scss',\n})\nexport class SallaMenu {\n\n constructor() {\n if (!!this.sourceValue) {\n this.setMenuContent(JSON.parse(this.sourceValue));\n } else {\n this.getMenuItems();\n }\n // salla.lang.onLoaded(() => {\n // this.pageLinkLabel = salla.lang.getWithDefault(\"blocks.footer.pages_links\", this.pageLinkLabel)\n // })\n }\n componentWillLoad() {\n return Helper.onSallaReadyPromise((resolve) => {\n this.hasCustomComponent = !!customElements.get('custom-salla-product-card');\n resolve();\n })\n }\n\n /**\n * The source of the menu, specifying whether it is a header or footer menu.\n */\n @Prop() source: Sources.Header | Sources.Footer | Sources.Footer = Sources.Header\n\n /**\n * The source value, a stringified JSON representation of the menu content.\n */\n @Prop() sourceValue?: string;\n\n /**\n * Boolean indicating whether the menu is a top navigation menu.\n */\n @Prop() topnav: boolean;\n\n /**\n * Boolean indicating whether to use React Link elements for menu links.\n */\n @Prop() useReactLink: boolean = false;\n\n /**\n * Limiting the number of menu items\n */\n @Prop() limit: number;\n\n\n // States \n @State() menus: MenuContentDTO[] = [];\n @State() hasCustomComponent: boolean;\n // @State() pageLinkLabel: string;\n\n private getMenuItems() {\n salla.api.component.getMenus(this.source).then(resp => {\n // TODO: this has to be removed after the the api's consistency issue is fixed\n // FROM HERE\n let menusData = resp.data;\n if (!Array.isArray(menusData)) {\n let menusArray = Object.keys(menusData).map((key: string) => {\n return menusData[key]\n })\n return this.setMenuContent(menusArray)\n }\n // TILL HERE\n return this.setMenuContent(resp.data)\n });\n }\n\n private getAttributes(attrs: string) {\n return attrs.trim().split(' ').reduce((result, attr) => {\n let [key, value] = attr.split('=');\n result[key] = value.replace(/\"/g, '');\n return result;\n }, {});\n }\n\n private getLinkTag(menu: MenuContentDTO, additionalClass: string = \"\") {\n if (this.useReactLink) {\n let link = document.createElement(\"Link\")\n let attributes = this.getAttributes(menu.link_attrs)\n Object.keys(attributes).forEach(attr => {\n link.setAttribute(attr, attributes[attr]);\n });\n link.innerHTML = menu.title;\n link.classList.add(additionalClass)\n return link;\n }\n return <a {...this.getAttributes(menu.link_attrs)} class={additionalClass} href={menu.url}>\n <span>{menu.title}</span>\n </a>\n }\n\n /**\n * Updates the internal state of the component with the provided menu data.\n *\n * @param {MenuContentDTO[]} menus - An array of MenuContentDTO objects representing the new menu content.\n */\n @Method()\n async setMenuContent(menus: MenuContentDTO[]): Promise<void> {\n this.menus = menus\n }\n\n private getListItemClass(menu: MenuContentDTO, isRootMenu: boolean = false) {\n return {\n \"s-menu-item\": true,\n \"s-menu-root-level\": isRootMenu,\n \"s-menu-non-root-level\": !isRootMenu,\n \"s-menu-has-children\": !!menu.has_children,\n \"s-menu-mega-menu\": !!menu.products\n }\n }\n\n private _get_header_menu(menu: MenuContentDTO, isRootMenu: boolean = false) {\n return [<li class={this.getListItemClass(menu, isRootMenu)}\n {...this.getAttributes(menu.attrs)}>\n {\n this.getLinkTag(menu)\n }\n {\n menu.has_children ?\n <div class={`s-menu-submenu ${!!menu.products ? 's-menu-submenu-with-product' : 's-menu-submenu-without-product'}}`}>\n <ul class={`${!!menu.products ? 's-menu-submenu-unordered-list' : ''}`}>\n {\n menu.children.map((submenu: MenuContentDTO) =>\n this._get_header_menu(submenu)\n )\n }\n </ul>\n\n {\n !!menu.products ?\n <div class=\"s-menu-products-wrapper\">\n <div class=\"s-menu-products-container\">\n {\n menu.products.slice(0, 4).map((product: Product) => {\n if (this.hasCustomComponent) {\n return <custom-salla-product-card product={JSON.stringify(product)}></custom-salla-product-card>\n }\n <salla-product-card shadow-on-hover product={JSON.stringify(product)}></salla-product-card>\n })\n }\n </div>\n </div>\n : \"\"\n }\n\n </div>\n : ''\n }\n </li>,\n\n <li class=\"lg:hidden text-sm font-bold\" {...this.getAttributes(menu.attrs)}>\n {!menu.has_children ?\n this.getLinkTag(menu, \"text-gray-500\")\n :\n [<span>{menu.title}</span>,\n <ul>\n <li class=\"text-sm font-bold\">\n {this.getLinkTag(menu, \"text-gray-500\")}\n </li>\n {\n menu.children.map((submenu: MenuContentDTO) =>\n this._get_header_menu(submenu)\n )\n }\n </ul>]\n }\n </li>\n ];\n }\n\n private _get_footer_menu(menus: FooterMenu[]) {\n let items = this.topnav ? menus.slice(0, 3) : menus\n return <div>\n <div class={{\n \"s-menu-footer-list\": !this.topnav,\n \"s-menu-topnav-list\": this.topnav\n }}\n >\n {((this.topnav || this.limit) ? items.slice(0, this.limit||3) : items).map((menu: FooterMenu) => {\n return <a href={menu.url} target={menu.target} class={{\n \"s-menu-footer-item\": !this.topnav,\n \"s-menu-topnav-item topnav-link-item right-side\": this.topnav\n }}>{menu.title}</a>\n })}\n </div>\n </div>\n }\n\n render() {\n\n if (this.source === Sources.Footer) {\n return this._get_footer_menu(this.menus)\n }\n return <ul>\n {this.menus.map((menu: MenuContentDTO) => {\n return this._get_header_menu(menu, true)\n })\n }\n </ul>\n }\n}\n"]}
@@ -24,10 +24,12 @@ export class SallaPayments {
24
24
  });
25
25
  }
26
26
  render() {
27
- return (h(Host, { class: "s-payments-list" }, this.withMadeInKsa && h("li", { class: "s-payments-list-item" }, h("img", { class: "lazy", width: "100%", height: "100%", decoding: "async", loading: "lazy", "data-src": salla.url.cdn(`images/made-in-ksa.svg`), alt: "made in KSA certified" })), this.payments.map((payment) => (h("div", { id: "payment-slot", innerHTML: this.paymentSlot
28
- .replace(/\{image\}/g, salla.url.cdn(`images/payment/${payment}_mini.png`, 40, 40))
29
- .replace(/\{payment\}/g, payment) }))), h("div", { id: "cod-slot", innerHTML: this.codSlot
30
- .replace(/\{image\}/g, salla.url.cdn(`images/payment/cod_mini.png`, 40, 40)) }), this.withSbc && this.sbcId && h("div", { id: "sbc-slot", innerHTML: this.sbcSlot
27
+ return (h(Host, { class: "s-payments-list" }, this.withMadeInKsa && h("li", { class: "s-payments-list-item" }, h("img", { class: "lazy", width: "100%", height: "100%", decoding: "async", loading: "lazy", "data-src": salla.url.cdn(`images/made-in-ksa.svg`), alt: "made in KSA certified" })), this.payments.map((payment) => (payment == "cod" ?
28
+ h("div", { id: "cod-slot", innerHTML: this.codSlot
29
+ .replace(/\{image\}/g, salla.url.cdn(`images/payment/cod_mini.png`, 40, 40)) }) :
30
+ h("div", { id: "payment-slot", innerHTML: this.paymentSlot
31
+ .replace(/\{image\}/g, salla.url.cdn(`images/payment/${payment}_mini.png`, 40, 40))
32
+ .replace(/\{payment\}/g, payment) }))), this.withSbc && this.sbcId && h("div", { id: "sbc-slot", innerHTML: this.sbcSlot
31
33
  .replace(/\{image\}/g, salla.url.cdn(`images/sbc.png`, 40, 40))
32
34
  .replace(/\{link\}/g, `https://eauthenticate.saudibusiness.gov.sa/certificate-details/${this.sbcId}`) })));
33
35
  }
@@ -1 +1 @@
1
- {"version":3,"file":"salla-payments.js","sourceRoot":"","sources":["../../../src/components/salla-payments/salla-payments.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACzE;;;;GAIG;AAMH,MAAM,OAAO,aAAa;EACxB;;oBAcoB,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,yBAAyB,CAAC;4BACnC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,oBAAoB,CAAC;;;;IAd7D,IAAI,CAAC,WAAW,GAAG,CAAA,MAAA,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,kBAAkB,CAAC,0CAAE,SAAS,KAAI,sFAAsF,IAAI,CAAC,gBAAgB,wCAAwC,CAAC;IACjO,IAAI,CAAC,OAAO,GAAG,CAAA,MAAA,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,cAAc,CAAC,0CAAE,SAAS,KAAI,2GAA2G,IAAI,CAAC,gBAAgB,0EAA0E,CAAC;IAChR,IAAI,CAAC,OAAO,GAAG,CAAA,MAAA,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,cAAc,CAAC,0CAAE,SAAS,KAAI,0EAA0E,IAAI,CAAC,gBAAgB,iDAAiD,CAAC;IAEtN,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE;MACjB,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAC;MAC5D,IAAI,CAAC,gBAAgB,GAAG,KAAK,CAAC,GAA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AAE,MAAM,EAAE,CAAC;EACpD,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, Prop, State, h, Element } from '@stencil/core';\n/**\n * @slot payment - Replaces payment item, has replaceable props `{image}`, `{name}`.\n * @slot sbc - Replaces SBC certificate item, has replaceable props `{image}`.\n * @slot cod - Replaces COD item, has replaceable props `{image}`.\n */\n@Component({\n tag: 'salla-payments',\n styleUrl: 'salla-payments.scss'\n})\n\nexport class SallaPayments {\n constructor() {\n this.paymentSlot = this.host.querySelector('[slot=\"payment\"]')?.innerHTML || `<li class=\"s-payments-list-item\"><img class=\"lazy\" width=\"100%\" height=\"100%\" src=\"${this.placeholderImage}\" data-src=\"{image}\" alt={name} /><li>`;\n this.sbcSlot = this.host.querySelector('[slot=\"sbc\"]')?.innerHTML || `<li class=\"s-payments-list-item\"><a target=\"_blank\" href=\"{link}\"> <img width=\"100%\" height=\"100%\" src=\"${this.placeholderImage}\" data-src={image} class=\"lazy s-payments-sbc-image\" alt=\"SBC\"/></a><li>`;\n this.codSlot = this.host.querySelector('[slot=\"cod\"]')?.innerHTML || `<li class=\"s-payments-list-item\"> <img width=\"100%\" height=\"100%\" src=\"${this.placeholderImage}\" data-src={image} class=\"lazy\" alt=\"COD\"/><li>`;\n\n salla.onReady(() => {\n this.payments = salla.config.get('store.settings.payments');\n this.placeholderImage = salla.url.cdn(`images/s-empty.png`);\n });\n }\n private readonly paymentSlot: string;\n private readonly sbcSlot: string;\n private readonly codSlot: string;\n @Element() host: HTMLElement;\n @State() payments = salla.config.get('store.settings.payments');\n @State() placeholderImage = salla.url.cdn(`images/s-empty.png`);\n\n /**\n * Boolean indicating whether to include the SBC (Saudi Business Council) certificate.\n */\n @Prop() withSbc: boolean;\n \n /**\n * The SBC (Saudi Business Council) certificate ID.\n */\n @Prop() sbcId: string;\n\n /**\n * Boolean indicating whether to include the \"Made in KSA\" certification.\n */\n @Prop() withMadeInKsa: boolean;\n\n render() {\n return (\n <Host class=\"s-payments-list\">\n\n {/* Made in KSA */}\n {this.withMadeInKsa && <li class=\"s-payments-list-item\">\n <img class=\"lazy\" width=\"100%\" height=\"100%\" decoding=\"async\" loading=\"lazy\" data-src={salla.url.cdn(`images/made-in-ksa.svg`)} alt=\"made in KSA certified\" />\n </li>}\n\n {/* Dynamic methods */}\n {this.payments.map((payment) => (\n <div id=\"payment-slot\" innerHTML={this.paymentSlot\n .replace(/\\{image\\}/g, salla.url.cdn(`images/payment/${payment}_mini.png`, 40, 40))\n .replace(/\\{payment\\}/g, payment)}>\n </div>\n ))}\n\n {/* COD method - Static in all stores */}\n <div id=\"cod-slot\" innerHTML={this.codSlot\n .replace(/\\{image\\}/g, salla.url.cdn(`images/payment/cod_mini.png`, 40, 40))}>\n </div>\n\n {/* SBC certificate */}\n {this.withSbc && this.sbcId && <div id=\"sbc-slot\" innerHTML={this.sbcSlot\n .replace(/\\{image\\}/g, salla.url.cdn(`images/sbc.png`, 40, 40))\n .replace(/\\{link\\}/g, `https://eauthenticate.saudibusiness.gov.sa/certificate-details/${this.sbcId}`)}>\n </div>}\n </Host>\n );\n }\n componentDidLoad() {\n document.lazyLoadInstance?.update(this.host.querySelectorAll('.lazy'));\n // fix lazy loaded images that have 100% width and height\n this.host.querySelectorAll('.lazy').forEach((img) => {\n img.addEventListener('load', () => {\n img.setAttribute('width', \"100%\");\n img.setAttribute('height', \"100%\");\n });\n });\n }\n componentDidRender() {\n this.host.querySelectorAll('#payment-slot').forEach(el => el.replaceWith(el.firstChild));\n this.host.querySelectorAll('#sbc-slot').forEach(el => el.replaceWith(el.firstChild));\n this.host.querySelectorAll('#cod-slot').forEach(el => el.replaceWith(el.firstChild));\n this.host.querySelector('[slot=\"payment\"]')?.remove();\n this.host.querySelector('[slot=\"sbc\"]')?.remove();\n this.host.querySelector('[slot=\"cod\"]')?.remove();\n }\n}\n"]}
1
+ {"version":3,"file":"salla-payments.js","source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,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;MAClD,GAAG,CAAC,gBAAgB,CAAC,MAAM,EAAE,GAAG,EAAE;QAChC,GAAG,CAAC,YAAY,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QAClC,GAAG,CAAC,YAAY,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;MACrC,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;EACL,CAAC;EACD,kBAAkB;;IAChB,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,eAAe,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,WAAW,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;IACzF,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,WAAW,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;IACrF,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,WAAW,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;IACrF,MAAA,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,kBAAkB,CAAC,0CAAE,MAAM,EAAE,CAAC;IACtD,MAAA,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,cAAc,CAAC,0CAAE,MAAM,EAAE,CAAC;IAClD,MAAA,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,cAAc,CAAC,0CAAE,MAAM,EAAE,CAAC;EACpD,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, Prop, State, h, Element } from '@stencil/core';\n/**\n * @slot payment - Replaces payment item, has replaceable props `{image}`, `{name}`.\n * @slot sbc - Replaces SBC certificate item, has replaceable props `{image}`.\n * @slot cod - Replaces COD item, has replaceable props `{image}`.\n */\n@Component({\n tag: 'salla-payments',\n styleUrl: 'salla-payments.scss'\n})\n\nexport class SallaPayments {\n constructor() {\n this.paymentSlot = this.host.querySelector('[slot=\"payment\"]')?.innerHTML || `<li class=\"s-payments-list-item\"><img class=\"lazy\" width=\"100%\" height=\"100%\" src=\"${this.placeholderImage}\" data-src=\"{image}\" alt={name} /><li>`;\n this.sbcSlot = this.host.querySelector('[slot=\"sbc\"]')?.innerHTML || `<li class=\"s-payments-list-item\"><a target=\"_blank\" href=\"{link}\"> <img width=\"100%\" height=\"100%\" src=\"${this.placeholderImage}\" data-src={image} class=\"lazy s-payments-sbc-image\" alt=\"SBC\"/></a><li>`;\n this.codSlot = this.host.querySelector('[slot=\"cod\"]')?.innerHTML || `<li class=\"s-payments-list-item\"> <img width=\"100%\" height=\"100%\" src=\"${this.placeholderImage}\" data-src={image} class=\"lazy\" alt=\"COD\"/><li>`;\n\n salla.onReady(() => {\n this.payments = salla.config.get('store.settings.payments');\n this.placeholderImage = salla.url.cdn(`images/s-empty.png`);\n });\n }\n private readonly paymentSlot: string;\n private readonly sbcSlot: string;\n private readonly codSlot: string;\n @Element() host: HTMLElement;\n @State() payments = salla.config.get('store.settings.payments');\n @State() placeholderImage = salla.url.cdn(`images/s-empty.png`);\n\n /**\n * Boolean indicating whether to include the SBC (Saudi Business Council) certificate.\n */\n @Prop() withSbc: boolean;\n\n /**\n * The SBC (Saudi Business Council) certificate ID.\n */\n @Prop() sbcId: string;\n\n /**\n * Boolean indicating whether to include the \"Made in KSA\" certification.\n */\n @Prop() withMadeInKsa: boolean;\n\n render() {\n return (\n <Host class=\"s-payments-list\">\n\n {/* Made in KSA */}\n {this.withMadeInKsa && <li class=\"s-payments-list-item\">\n <img class=\"lazy\" width=\"100%\" height=\"100%\" decoding=\"async\" loading=\"lazy\" data-src={salla.url.cdn(`images/made-in-ksa.svg`)} alt=\"made in KSA certified\" />\n </li>}\n\n {/* Dynamic methods */}\n {this.payments.map((payment) => (\n payment == \"cod\" ?\n <div id=\"cod-slot\" innerHTML={this.codSlot\n .replace(/\\{image\\}/g, salla.url.cdn(`images/payment/cod_mini.png`, 40, 40))}>\n </div> :\n <div id=\"payment-slot\" innerHTML={this.paymentSlot\n .replace(/\\{image\\}/g, salla.url.cdn(`images/payment/${payment}_mini.png`, 40, 40))\n .replace(/\\{payment\\}/g, payment)}>\n </div>\n ))}\n\n\n {/* SBC certificate */}\n {this.withSbc && this.sbcId && <div id=\"sbc-slot\" innerHTML={this.sbcSlot\n .replace(/\\{image\\}/g, salla.url.cdn(`images/sbc.png`, 40, 40))\n .replace(/\\{link\\}/g, `https://eauthenticate.saudibusiness.gov.sa/certificate-details/${this.sbcId}`)}>\n </div>}\n </Host>\n );\n }\n componentDidLoad() {\n document.lazyLoadInstance?.update(this.host.querySelectorAll('.lazy'));\n // fix lazy loaded images that have 100% width and height\n this.host.querySelectorAll('.lazy').forEach((img) => {\n img.addEventListener('load', () => {\n img.setAttribute('width', \"100%\");\n img.setAttribute('height', \"100%\");\n });\n });\n }\n componentDidRender() {\n this.host.querySelectorAll('#payment-slot').forEach(el => el.replaceWith(el.firstChild));\n this.host.querySelectorAll('#sbc-slot').forEach(el => el.replaceWith(el.firstChild));\n this.host.querySelectorAll('#cod-slot').forEach(el => el.replaceWith(el.firstChild));\n this.host.querySelector('[slot=\"payment\"]')?.remove();\n this.host.querySelector('[slot=\"sbc\"]')?.remove();\n this.host.querySelector('[slot=\"cod\"]')?.remove();\n }\n}\n"]}
@@ -31,6 +31,7 @@ const SallaMenu$1 = /*@__PURE__*/ proxyCustomElement(class SallaMenu extends HTM
31
31
  this.sourceValue = undefined;
32
32
  this.topnav = undefined;
33
33
  this.useReactLink = false;
34
+ this.limit = undefined;
34
35
  this.menus = [];
35
36
  this.hasCustomComponent = undefined;
36
37
  if (!!this.sourceValue) {
@@ -120,7 +121,7 @@ const SallaMenu$1 = /*@__PURE__*/ proxyCustomElement(class SallaMenu extends HTM
120
121
  return h("div", null, h("div", { class: {
121
122
  "s-menu-footer-list": !this.topnav,
122
123
  "s-menu-topnav-list": this.topnav
123
- } }, items.slice(0, 3).map((menu) => {
124
+ } }, ((this.topnav || this.limit) ? items.slice(0, this.limit || 3) : items).map((menu) => {
124
125
  return h("a", { href: menu.url, target: menu.target, class: {
125
126
  "s-menu-footer-item": !this.topnav,
126
127
  "s-menu-topnav-item topnav-link-item right-side": this.topnav
@@ -141,6 +142,7 @@ const SallaMenu$1 = /*@__PURE__*/ proxyCustomElement(class SallaMenu extends HTM
141
142
  "sourceValue": [1, "source-value"],
142
143
  "topnav": [4],
143
144
  "useReactLink": [4, "use-react-link"],
145
+ "limit": [2],
144
146
  "menus": [32],
145
147
  "hasCustomComponent": [32],
146
148
  "setMenuContent": [64]
@@ -1 +1 @@
1
- {"file":"salla-menu.js","mappings":";;;;;;;;;;;;;;;;AAEA,IAAY,OAIX;AAJD,WAAY,OAAO;EACf,4BAAiB,CAAA;EACjB,4BAAiB,CAAA;EACjB,wBAAa,CAAA;AACjB,CAAC,EAJW,OAAO,KAAP,OAAO;;ACFnB,MAAM,YAAY,GAAG,sBAAsB;;MCU9BA,WAAS;EAEpB;;;kBAoBmE,OAAO,CAAC,MAAM;;;wBAejD,KAAK;iBAIF,EAAE;;IAtCnC,IAAI,CAAC,CAAC,IAAI,CAAC,WAAW,EAAE;MACtB,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;KACnD;SAAM;MACL,IAAI,CAAC,YAAY,EAAE,CAAC;KACrB;GAIF;EACD,iBAAiB;IACf,OAAO,MAAM,CAAC,mBAAmB,CAAC,CAAC,OAAO;MACxC,IAAI,CAAC,kBAAkB,GAAG,CAAC,CAAC,cAAc,CAAC,GAAG,CAAC,2BAA2B,CAAC,CAAC;MAC5E,OAAO,EAAE,CAAC;KACX,CAAC,CAAA;GACH;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E,IAAI,CAAC,MAAM;OAClC,IAEE,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,IAAgB;MACtC,OAAO,SAAG,IAAI,EAAE,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,KAAK,EAAE;UACpD,oBAAoB,EAAE,CAAC,IAAI,CAAC,MAAM;UAClC,gDAAgD,EAAE,IAAI,CAAC,MAAM;SAC9D,IAAG,IAAI,CAAC,KAAK,CAAK,CAAA;KACpB,CAAC,CACE,CACF,CAAA;GACP;EAED,MAAM;IAEJ,IAAI,IAAI,CAAC,MAAM,KAAK,OAAO,CAAC,MAAM,EAAE;MAClC,OAAO,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;KACzC;IACD,OAAO,cACJ,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAoB;MACnC,OAAO,IAAI,CAAC,gBAAgB,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;KACzC,CAAC,CAEC,CAAA;GACN;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["SallaMenu"],"sources":["src/components/salla-menu/interfaces.ts","src/components/salla-menu/salla-menu.scss?tag=salla-menu","src/components/salla-menu/salla-menu.tsx"],"sourcesContent":["import {Product} from \"@salla.sa/twilight/types/common\"\n\nexport enum Sources {\n Header = \"header\",\n Footer = \"footer\",\n Json = \"json\",\n}\n\nexport interface MenuContentDTO {\n id?: number;\n order?: number;\n title?: string;\n url?: string;\n products?: Product[];\n is_by_form_builder?: boolean;\n attrs?: string;\n link_attrs?: string;\n target?: string;\n has_children?: boolean;\n children?: MenuContentDTO[];\n}",":host {\n display: block;\n}\n","import { Component, h, Method, Prop, State } from '@stencil/core';\nimport { MenuContentDTO, Sources } from './interfaces';\nimport { Product } from \"@salla.sa/twilight/types/common\"\nimport { FooterMenu } from '../../../../twilight/types/api/component';\nimport Helper from '../../Helpers/Helper';\n\n@Component({\n tag: 'salla-menu',\n styleUrl: 'salla-menu.scss',\n})\nexport class SallaMenu {\n\n constructor() {\n if (!!this.sourceValue) {\n this.setMenuContent(JSON.parse(this.sourceValue));\n } else {\n this.getMenuItems();\n }\n // salla.lang.onLoaded(() => {\n // this.pageLinkLabel = salla.lang.getWithDefault(\"blocks.footer.pages_links\", this.pageLinkLabel)\n // })\n }\n componentWillLoad() {\n return Helper.onSallaReadyPromise((resolve) => {\n this.hasCustomComponent = !!customElements.get('custom-salla-product-card');\n resolve();\n })\n }\n\n /**\n * The source of the menu, specifying whether it is a header or footer menu.\n */\n @Prop() source: Sources.Header | Sources.Footer | Sources.Footer = Sources.Header\n\n /**\n * The source value, a stringified JSON representation of the menu content.\n */\n @Prop() sourceValue?: string;\n\n /**\n * Boolean indicating whether the menu is a top navigation menu.\n */\n @Prop() topnav: boolean;\n\n /**\n * Boolean indicating whether to use React Link elements for menu links.\n */\n @Prop() useReactLink: boolean = false;\n\n\n // States \n @State() menus: MenuContentDTO[] = [];\n @State() hasCustomComponent: boolean;\n // @State() pageLinkLabel: string;\n\n private getMenuItems() {\n salla.api.component.getMenus(this.source).then(resp => {\n // TODO: this has to be removed after the the api's consistency issue is fixed\n // FROM HERE\n let menusData = resp.data;\n if (!Array.isArray(menusData)) {\n let menusArray = Object.keys(menusData).map((key: string) => {\n return menusData[key]\n })\n return this.setMenuContent(menusArray)\n }\n // TILL HERE\n return this.setMenuContent(resp.data)\n });\n }\n\n private getAttributes(attrs: string) {\n return attrs.trim().split(' ').reduce((result, attr) => {\n let [key, value] = attr.split('=');\n result[key] = value.replace(/\"/g, '');\n return result;\n }, {});\n }\n\n private getLinkTag(menu: MenuContentDTO, additionalClass: string = \"\") {\n if (this.useReactLink) {\n let link = document.createElement(\"Link\")\n let attributes = this.getAttributes(menu.link_attrs)\n Object.keys(attributes).forEach(attr => {\n link.setAttribute(attr, attributes[attr]);\n });\n link.innerHTML = menu.title;\n link.classList.add(additionalClass)\n return link;\n }\n return <a {...this.getAttributes(menu.link_attrs)} class={additionalClass} href={menu.url}>\n <span>{menu.title}</span>\n </a>\n }\n\n /**\n * Updates the internal state of the component with the provided menu data.\n *\n * @param {MenuContentDTO[]} menus - An array of MenuContentDTO objects representing the new menu content.\n */\n @Method()\n async setMenuContent(menus: MenuContentDTO[]): Promise<void> {\n this.menus = menus\n }\n\n private getListItemClass(menu: MenuContentDTO, isRootMenu: boolean = false) {\n return {\n \"s-menu-item\": true,\n \"s-menu-root-level\": isRootMenu,\n \"s-menu-non-root-level\": !isRootMenu,\n \"s-menu-has-children\": !!menu.has_children,\n \"s-menu-mega-menu\": !!menu.products\n }\n }\n\n private _get_header_menu(menu: MenuContentDTO, isRootMenu: boolean = false) {\n return [<li class={this.getListItemClass(menu, isRootMenu)}\n {...this.getAttributes(menu.attrs)}>\n {\n this.getLinkTag(menu)\n }\n {\n menu.has_children ?\n <div class={`s-menu-submenu ${!!menu.products ? 's-menu-submenu-with-product' : 's-menu-submenu-without-product'}}`}>\n <ul class={`${!!menu.products ? 's-menu-submenu-unordered-list' : ''}`}>\n {\n menu.children.map((submenu: MenuContentDTO) =>\n this._get_header_menu(submenu)\n )\n }\n </ul>\n\n {\n !!menu.products ?\n <div class=\"s-menu-products-wrapper\">\n <div class=\"s-menu-products-container\">\n {\n menu.products.slice(0, 4).map((product: Product) => {\n if (this.hasCustomComponent) {\n return <custom-salla-product-card product={JSON.stringify(product)}></custom-salla-product-card>\n }\n <salla-product-card shadow-on-hover product={JSON.stringify(product)}></salla-product-card>\n })\n }\n </div>\n </div>\n : \"\"\n }\n\n </div>\n : ''\n }\n </li>,\n\n <li class=\"lg:hidden text-sm font-bold\" {...this.getAttributes(menu.attrs)}>\n {!menu.has_children ?\n this.getLinkTag(menu, \"text-gray-500\")\n :\n [<span>{menu.title}</span>,\n <ul>\n <li class=\"text-sm font-bold\">\n {this.getLinkTag(menu, \"text-gray-500\")}\n </li>\n {\n menu.children.map((submenu: MenuContentDTO) =>\n this._get_header_menu(submenu)\n )\n }\n </ul>]\n }\n </li>\n ];\n }\n\n private _get_footer_menu(menus: FooterMenu[]) {\n let items = this.topnav ? menus.slice(0, 3) : menus\n return <div>\n <div class={{\n \"s-menu-footer-list\": !this.topnav,\n \"s-menu-topnav-list\": this.topnav\n }}\n >\n {items.slice(0, 3).map((menu: FooterMenu) => {\n return <a href={menu.url} target={menu.target} class={{\n \"s-menu-footer-item\": !this.topnav,\n \"s-menu-topnav-item topnav-link-item right-side\": this.topnav\n }}>{menu.title}</a>\n })}\n </div>\n </div>\n }\n\n render() {\n\n if (this.source === Sources.Footer) {\n return this._get_footer_menu(this.menus)\n }\n return <ul>\n {this.menus.map((menu: MenuContentDTO) => {\n return this._get_header_menu(menu, true)\n })\n }\n </ul>\n }\n}\n"],"version":3}
1
+ {"file":"salla-menu.js","mappings":";;;;;;;;;;;;;;;;AAEA,IAAY,OAIX;AAJD,WAAY,OAAO;EACf,4BAAiB,CAAA;EACjB,4BAAiB,CAAA;EACjB,wBAAa,CAAA;AACjB,CAAC,EAJW,OAAO,KAAP,OAAO;;ACFnB,MAAM,YAAY,GAAG,sBAAsB;;MCU9BA,WAAS;EAEpB;;;kBAoBmE,OAAO,CAAC,MAAM;;;wBAejD,KAAK;;iBASF,EAAE;;IA3CnC,IAAI,CAAC,CAAC,IAAI,CAAC,WAAW,EAAE;MACtB,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;KACnD;SAAM;MACL,IAAI,CAAC,YAAY,EAAE,CAAC;KACrB;GAIF;EACD,iBAAiB;IACf,OAAO,MAAM,CAAC,mBAAmB,CAAC,CAAC,OAAO;MACxC,IAAI,CAAC,kBAAkB,GAAG,CAAC,CAAC,cAAc,CAAC,GAAG,CAAC,2BAA2B,CAAC,CAAC;MAC5E,OAAO,EAAE,CAAC;KACX,CAA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,oBAAoB,EAAE,IAAI,CAAC,MAAM;OAClC,IAEE,CAAC,CAAC,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,IAAE,CAAC,CAAC,GAAG,KAAK,EAAE,GAAG,CAAC,CAAC,IAAgB;MAC1F,OAAO,SAAG,IAAI,EAAE,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,KAAK,EAAE;UACpD,oBAAoB,EAAE,CAAC,IAAI,CAAC,MAAM;UAClC,gDAAgD,EAAE,IAAI,CAAC,MAAM;SAC9D,IAAG,IAAI,CAAC,KAAK,CAAK,CAAA;KACpB,CAAC,CACE,CACF,CAAA;GACP;EAED,MAAM;IAEJ,IAAI,IAAI,CAAC,MAAM,KAAK,OAAO,CAAC,MAAM,EAAE;MAClC,OAAO,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;KACzC;IACD,OAAO,cACJ,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAoB;MACnC,OAAO,IAAI,CAAC,gBAAgB,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;KACzC,CAAC,CAEC,CAAA;GACN;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["SallaMenu"],"sources":["src/components/salla-menu/interfaces.ts","src/components/salla-menu/salla-menu.scss?tag=salla-menu","src/components/salla-menu/salla-menu.tsx"],"sourcesContent":["import {Product} from \"@salla.sa/twilight/types/common\"\n\nexport enum Sources {\n Header = \"header\",\n Footer = \"footer\",\n Json = \"json\",\n}\n\nexport interface MenuContentDTO {\n id?: number;\n order?: number;\n title?: string;\n url?: string;\n products?: Product[];\n is_by_form_builder?: boolean;\n attrs?: string;\n link_attrs?: string;\n target?: string;\n has_children?: boolean;\n children?: MenuContentDTO[];\n}",":host {\n display: block;\n}\n","import { Component, h, Method, Prop, State } from '@stencil/core';\nimport { MenuContentDTO, Sources } from './interfaces';\nimport { Product } from \"@salla.sa/twilight/types/common\"\nimport { FooterMenu } from '../../../../twilight/types/api/component';\nimport Helper from '../../Helpers/Helper';\n\n@Component({\n tag: 'salla-menu',\n styleUrl: 'salla-menu.scss',\n})\nexport class SallaMenu {\n\n constructor() {\n if (!!this.sourceValue) {\n this.setMenuContent(JSON.parse(this.sourceValue));\n } else {\n this.getMenuItems();\n }\n // salla.lang.onLoaded(() => {\n // this.pageLinkLabel = salla.lang.getWithDefault(\"blocks.footer.pages_links\", this.pageLinkLabel)\n // })\n }\n componentWillLoad() {\n return Helper.onSallaReadyPromise((resolve) => {\n this.hasCustomComponent = !!customElements.get('custom-salla-product-card');\n resolve();\n })\n }\n\n /**\n * The source of the menu, specifying whether it is a header or footer menu.\n */\n @Prop() source: Sources.Header | Sources.Footer | Sources.Footer = Sources.Header\n\n /**\n * The source value, a stringified JSON representation of the menu content.\n */\n @Prop() sourceValue?: string;\n\n /**\n * Boolean indicating whether the menu is a top navigation menu.\n */\n @Prop() topnav: boolean;\n\n /**\n * Boolean indicating whether to use React Link elements for menu links.\n */\n @Prop() useReactLink: boolean = false;\n\n /**\n * Limiting the number of menu items\n */\n @Prop() limit: number;\n\n\n // States \n @State() menus: MenuContentDTO[] = [];\n @State() hasCustomComponent: boolean;\n // @State() pageLinkLabel: string;\n\n private getMenuItems() {\n salla.api.component.getMenus(this.source).then(resp => {\n // TODO: this has to be removed after the the api's consistency issue is fixed\n // FROM HERE\n let menusData = resp.data;\n if (!Array.isArray(menusData)) {\n let menusArray = Object.keys(menusData).map((key: string) => {\n return menusData[key]\n })\n return this.setMenuContent(menusArray)\n }\n // TILL HERE\n return this.setMenuContent(resp.data)\n });\n }\n\n private getAttributes(attrs: string) {\n return attrs.trim().split(' ').reduce((result, attr) => {\n let [key, value] = attr.split('=');\n result[key] = value.replace(/\"/g, '');\n return result;\n }, {});\n }\n\n private getLinkTag(menu: MenuContentDTO, additionalClass: string = \"\") {\n if (this.useReactLink) {\n let link = document.createElement(\"Link\")\n let attributes = this.getAttributes(menu.link_attrs)\n Object.keys(attributes).forEach(attr => {\n link.setAttribute(attr, attributes[attr]);\n });\n link.innerHTML = menu.title;\n link.classList.add(additionalClass)\n return link;\n }\n return <a {...this.getAttributes(menu.link_attrs)} class={additionalClass} href={menu.url}>\n <span>{menu.title}</span>\n </a>\n }\n\n /**\n * Updates the internal state of the component with the provided menu data.\n *\n * @param {MenuContentDTO[]} menus - An array of MenuContentDTO objects representing the new menu content.\n */\n @Method()\n async setMenuContent(menus: MenuContentDTO[]): Promise<void> {\n this.menus = menus\n }\n\n private getListItemClass(menu: MenuContentDTO, isRootMenu: boolean = false) {\n return {\n \"s-menu-item\": true,\n \"s-menu-root-level\": isRootMenu,\n \"s-menu-non-root-level\": !isRootMenu,\n \"s-menu-has-children\": !!menu.has_children,\n \"s-menu-mega-menu\": !!menu.products\n }\n }\n\n private _get_header_menu(menu: MenuContentDTO, isRootMenu: boolean = false) {\n return [<li class={this.getListItemClass(menu, isRootMenu)}\n {...this.getAttributes(menu.attrs)}>\n {\n this.getLinkTag(menu)\n }\n {\n menu.has_children ?\n <div class={`s-menu-submenu ${!!menu.products ? 's-menu-submenu-with-product' : 's-menu-submenu-without-product'}}`}>\n <ul class={`${!!menu.products ? 's-menu-submenu-unordered-list' : ''}`}>\n {\n menu.children.map((submenu: MenuContentDTO) =>\n this._get_header_menu(submenu)\n )\n }\n </ul>\n\n {\n !!menu.products ?\n <div class=\"s-menu-products-wrapper\">\n <div class=\"s-menu-products-container\">\n {\n menu.products.slice(0, 4).map((product: Product) => {\n if (this.hasCustomComponent) {\n return <custom-salla-product-card product={JSON.stringify(product)}></custom-salla-product-card>\n }\n <salla-product-card shadow-on-hover product={JSON.stringify(product)}></salla-product-card>\n })\n }\n </div>\n </div>\n : \"\"\n }\n\n </div>\n : ''\n }\n </li>,\n\n <li class=\"lg:hidden text-sm font-bold\" {...this.getAttributes(menu.attrs)}>\n {!menu.has_children ?\n this.getLinkTag(menu, \"text-gray-500\")\n :\n [<span>{menu.title}</span>,\n <ul>\n <li class=\"text-sm font-bold\">\n {this.getLinkTag(menu, \"text-gray-500\")}\n </li>\n {\n menu.children.map((submenu: MenuContentDTO) =>\n this._get_header_menu(submenu)\n )\n }\n </ul>]\n }\n </li>\n ];\n }\n\n private _get_footer_menu(menus: FooterMenu[]) {\n let items = this.topnav ? menus.slice(0, 3) : menus\n return <div>\n <div class={{\n \"s-menu-footer-list\": !this.topnav,\n \"s-menu-topnav-list\": this.topnav\n }}\n >\n {((this.topnav || this.limit) ? items.slice(0, this.limit||3) : items).map((menu: FooterMenu) => {\n return <a href={menu.url} target={menu.target} class={{\n \"s-menu-footer-item\": !this.topnav,\n \"s-menu-topnav-item topnav-link-item right-side\": this.topnav\n }}>{menu.title}</a>\n })}\n </div>\n </div>\n }\n\n render() {\n\n if (this.source === Sources.Footer) {\n return this._get_footer_menu(this.menus)\n }\n return <ul>\n {this.menus.map((menu: MenuContentDTO) => {\n return this._get_header_menu(menu, true)\n })\n }\n </ul>\n }\n}\n"],"version":3}
@@ -24,10 +24,12 @@ const SallaPayments$1 = /*@__PURE__*/ proxyCustomElement(class SallaPayments ext
24
24
  });
25
25
  }
26
26
  render() {
27
- return (h(Host, { class: "s-payments-list" }, this.withMadeInKsa && h("li", { class: "s-payments-list-item" }, h("img", { class: "lazy", width: "100%", height: "100%", decoding: "async", loading: "lazy", "data-src": salla.url.cdn(`images/made-in-ksa.svg`), alt: "made in KSA certified" })), this.payments.map((payment) => (h("div", { id: "payment-slot", innerHTML: this.paymentSlot
28
- .replace(/\{image\}/g, salla.url.cdn(`images/payment/${payment}_mini.png`, 40, 40))
29
- .replace(/\{payment\}/g, payment) }))), h("div", { id: "cod-slot", innerHTML: this.codSlot
30
- .replace(/\{image\}/g, salla.url.cdn(`images/payment/cod_mini.png`, 40, 40)) }), this.withSbc && this.sbcId && h("div", { id: "sbc-slot", innerHTML: this.sbcSlot
27
+ return (h(Host, { class: "s-payments-list" }, this.withMadeInKsa && h("li", { class: "s-payments-list-item" }, h("img", { class: "lazy", width: "100%", height: "100%", decoding: "async", loading: "lazy", "data-src": salla.url.cdn(`images/made-in-ksa.svg`), alt: "made in KSA certified" })), this.payments.map((payment) => (payment == "cod" ?
28
+ h("div", { id: "cod-slot", innerHTML: this.codSlot
29
+ .replace(/\{image\}/g, salla.url.cdn(`images/payment/cod_mini.png`, 40, 40)) }) :
30
+ h("div", { id: "payment-slot", innerHTML: this.paymentSlot
31
+ .replace(/\{image\}/g, salla.url.cdn(`images/payment/${payment}_mini.png`, 40, 40))
32
+ .replace(/\{payment\}/g, payment) }))), this.withSbc && this.sbcId && h("div", { id: "sbc-slot", innerHTML: this.sbcSlot
31
33
  .replace(/\{image\}/g, salla.url.cdn(`images/sbc.png`, 40, 40))
32
34
  .replace(/\{link\}/g, `https://eauthenticate.saudibusiness.gov.sa/certificate-details/${this.sbcId}`) })));
33
35
  }
@@ -1 +1 @@
1
- {"file":"salla-payments.js","mappings":";;;;;AAAA,MAAM,gBAAgB,GAAG,sBAAsB;;MCWlCA,eAAa;EACxB;;;;oBAcoB,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,yBAAyB,CAAC;4BACnC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,oBAAoB,CAAC;;;;IAd7D,IAAI,CAAC,WAAW,GAAG,CAAA,MAAA,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,kBAAkB,CAAC,0CAAE,SAAS,KAAI,sFAAsF,IAAI,CAAC,gBAAgB,wCAAwC,CAAC;IACjO,IAAI,CAAC,OAAO,GAAG,CAAA,MAAA,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,cAAc,CAAC,0CAAE,SAAS,KAAI,2GAA2G,IAAI,CAAC,gBAAgB,0EAA0E,CAAC;IAChR,IAAI,CAAC,OAAO,GAAG,CAAA,MAAA,IAAI,CAAC,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,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,cAAc,CAAC,0CAAE,MAAM,EAAE,CAAC;IAClD,MAAA,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,cAAc,CAAC,0CAAE,MAAM,EAAE,CAAC;GACnD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["SallaPayments"],"sources":["src/components/salla-payments/salla-payments.scss?tag=salla-payments","src/components/salla-payments/salla-payments.tsx"],"sourcesContent":[":host {\n display: block;\n}\n","import { Component, Host, Prop, State, h, Element } from '@stencil/core';\n/**\n * @slot payment - Replaces payment item, has replaceable props `{image}`, `{name}`.\n * @slot sbc - Replaces SBC certificate item, has replaceable props `{image}`.\n * @slot cod - Replaces COD item, has replaceable props `{image}`.\n */\n@Component({\n tag: 'salla-payments',\n styleUrl: 'salla-payments.scss'\n})\n\nexport class SallaPayments {\n constructor() {\n this.paymentSlot = this.host.querySelector('[slot=\"payment\"]')?.innerHTML || `<li class=\"s-payments-list-item\"><img class=\"lazy\" width=\"100%\" height=\"100%\" src=\"${this.placeholderImage}\" data-src=\"{image}\" alt={name} /><li>`;\n this.sbcSlot = this.host.querySelector('[slot=\"sbc\"]')?.innerHTML || `<li class=\"s-payments-list-item\"><a target=\"_blank\" href=\"{link}\"> <img width=\"100%\" height=\"100%\" src=\"${this.placeholderImage}\" data-src={image} class=\"lazy s-payments-sbc-image\" alt=\"SBC\"/></a><li>`;\n this.codSlot = this.host.querySelector('[slot=\"cod\"]')?.innerHTML || `<li class=\"s-payments-list-item\"> <img width=\"100%\" height=\"100%\" src=\"${this.placeholderImage}\" data-src={image} class=\"lazy\" alt=\"COD\"/><li>`;\n\n salla.onReady(() => {\n this.payments = salla.config.get('store.settings.payments');\n this.placeholderImage = salla.url.cdn(`images/s-empty.png`);\n });\n }\n private readonly paymentSlot: string;\n private readonly sbcSlot: string;\n private readonly codSlot: string;\n @Element() host: HTMLElement;\n @State() payments = salla.config.get('store.settings.payments');\n @State() placeholderImage = salla.url.cdn(`images/s-empty.png`);\n\n /**\n * Boolean indicating whether to include the SBC (Saudi Business Council) certificate.\n */\n @Prop() withSbc: boolean;\n \n /**\n * The SBC (Saudi Business Council) certificate ID.\n */\n @Prop() sbcId: string;\n\n /**\n * Boolean indicating whether to include the \"Made in KSA\" certification.\n */\n @Prop() withMadeInKsa: boolean;\n\n render() {\n return (\n <Host class=\"s-payments-list\">\n\n {/* Made in KSA */}\n {this.withMadeInKsa && <li class=\"s-payments-list-item\">\n <img class=\"lazy\" width=\"100%\" height=\"100%\" decoding=\"async\" loading=\"lazy\" data-src={salla.url.cdn(`images/made-in-ksa.svg`)} alt=\"made in KSA certified\" />\n </li>}\n\n {/* Dynamic methods */}\n {this.payments.map((payment) => (\n <div id=\"payment-slot\" innerHTML={this.paymentSlot\n .replace(/\\{image\\}/g, salla.url.cdn(`images/payment/${payment}_mini.png`, 40, 40))\n .replace(/\\{payment\\}/g, payment)}>\n </div>\n ))}\n\n {/* COD method - Static in all stores */}\n <div id=\"cod-slot\" innerHTML={this.codSlot\n .replace(/\\{image\\}/g, salla.url.cdn(`images/payment/cod_mini.png`, 40, 40))}>\n </div>\n\n {/* SBC certificate */}\n {this.withSbc && this.sbcId && <div id=\"sbc-slot\" innerHTML={this.sbcSlot\n .replace(/\\{image\\}/g, salla.url.cdn(`images/sbc.png`, 40, 40))\n .replace(/\\{link\\}/g, `https://eauthenticate.saudibusiness.gov.sa/certificate-details/${this.sbcId}`)}>\n </div>}\n </Host>\n );\n }\n componentDidLoad() {\n document.lazyLoadInstance?.update(this.host.querySelectorAll('.lazy'));\n // fix lazy loaded images that have 100% width and height\n this.host.querySelectorAll('.lazy').forEach((img) => {\n img.addEventListener('load', () => {\n img.setAttribute('width', \"100%\");\n img.setAttribute('height', \"100%\");\n });\n });\n }\n componentDidRender() {\n this.host.querySelectorAll('#payment-slot').forEach(el => el.replaceWith(el.firstChild));\n this.host.querySelectorAll('#sbc-slot').forEach(el => el.replaceWith(el.firstChild));\n this.host.querySelectorAll('#cod-slot').forEach(el => el.replaceWith(el.firstChild));\n this.host.querySelector('[slot=\"payment\"]')?.remove();\n this.host.querySelector('[slot=\"sbc\"]')?.remove();\n this.host.querySelector('[slot=\"cod\"]')?.remove();\n }\n}\n"],"version":3}
1
+ {"file":"salla-payments.js","mappings":";;;;;AAAA,MAAM,gBAAgB,GAAG,sBAAsB;;MCWlCA,eAAa;EACxB;;;;oBAcoB,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,yBAAyB,CAAC;4BACnC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,oBAAoB,CAAC;;;;IAd7D,IAAI,CAAC,WAAW,GAAG,CAAA,MAAA,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,kBAAkB,CAAC,0CAAE,SAAS,KAAI,sFAAsF,IAAI,CAAC,gBAAgB,wCAAwC,CAAC;IACjO,IAAI,CAAC,OAAO,GAAG,CAAA,MAAA,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,cAAc,CAAC,0CAAE,SAAS,KAAI,2GAA2G,IAAI,CAAC,gBAAgB,0EAA0E,CAAC;IAChR,IAAI,CAAC,OAAO,GAAG,CAAA,MAAA,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,cAAc,CAAC,0CAAE,SAAS,KAAI,0EAA0E,IAAI,CAAC,gBAAgB,iDAAiD,CAAC;IAEtN,KAAK,CAAC,OAAO,CAAC;MACZ,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAC;MAC5D,IAAI,CAAC,gBAAgB,GAAG,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;KAC7D,CAAC,CAAC;GACJ;EAuBD,MAAM;IACJ,QACE,EAAC,IAAI,IAAC,KAAK,EAAC,iBAAiB,IAG1B,IAAI,CAAC,aAAa,IAAI,UAAI,KAAK,EAAC,sBAAsB,IACrD,WAAK,KAAK,EAAC,MAAM,EAAC,KAAK,EAAC,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CAAC,gBAAgB,CAAC,MAAM,EAAE;QAC3B,GAAG,CAAC,YAAY,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QAClC,GAAG,CAAC,YAAY,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;OACpC,CAAC,CAAC;KACJ,CAAC,CAAC;GACJ;EACD,kBAAkB;;IAChB,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,eAAe,CAAC,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,CAAC,WAAW,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;IACzF,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,CAAC,WAAW,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;IACrF,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,CAAC,WAAW,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;IACrF,MAAA,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,kBAAkB,CAAC,0CAAE,MAAM,EAAE,CAAC;IACtD,MAAA,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,cAAc,CAAC,0CAAE,MAAM,EAAE,CAAC;IAClD,MAAA,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,cAAc,CAAC,0CAAE,MAAM,EAAE,CAAC;GACnD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["SallaPayments"],"sources":["src/components/salla-payments/salla-payments.scss?tag=salla-payments","src/components/salla-payments/salla-payments.tsx"],"sourcesContent":[":host {\n display: block;\n}\n","import { Component, Host, Prop, State, h, Element } from '@stencil/core';\n/**\n * @slot payment - Replaces payment item, has replaceable props `{image}`, `{name}`.\n * @slot sbc - Replaces SBC certificate item, has replaceable props `{image}`.\n * @slot cod - Replaces COD item, has replaceable props `{image}`.\n */\n@Component({\n tag: 'salla-payments',\n styleUrl: 'salla-payments.scss'\n})\n\nexport class SallaPayments {\n constructor() {\n this.paymentSlot = this.host.querySelector('[slot=\"payment\"]')?.innerHTML || `<li class=\"s-payments-list-item\"><img class=\"lazy\" width=\"100%\" height=\"100%\" src=\"${this.placeholderImage}\" data-src=\"{image}\" alt={name} /><li>`;\n this.sbcSlot = this.host.querySelector('[slot=\"sbc\"]')?.innerHTML || `<li class=\"s-payments-list-item\"><a target=\"_blank\" href=\"{link}\"> <img width=\"100%\" height=\"100%\" src=\"${this.placeholderImage}\" data-src={image} class=\"lazy s-payments-sbc-image\" alt=\"SBC\"/></a><li>`;\n this.codSlot = this.host.querySelector('[slot=\"cod\"]')?.innerHTML || `<li class=\"s-payments-list-item\"> <img width=\"100%\" height=\"100%\" src=\"${this.placeholderImage}\" data-src={image} class=\"lazy\" alt=\"COD\"/><li>`;\n\n salla.onReady(() => {\n this.payments = salla.config.get('store.settings.payments');\n this.placeholderImage = salla.url.cdn(`images/s-empty.png`);\n });\n }\n private readonly paymentSlot: string;\n private readonly sbcSlot: string;\n private readonly codSlot: string;\n @Element() host: HTMLElement;\n @State() payments = salla.config.get('store.settings.payments');\n @State() placeholderImage = salla.url.cdn(`images/s-empty.png`);\n\n /**\n * Boolean indicating whether to include the SBC (Saudi Business Council) certificate.\n */\n @Prop() withSbc: boolean;\n\n /**\n * The SBC (Saudi Business Council) certificate ID.\n */\n @Prop() sbcId: string;\n\n /**\n * Boolean indicating whether to include the \"Made in KSA\" certification.\n */\n @Prop() withMadeInKsa: boolean;\n\n render() {\n return (\n <Host class=\"s-payments-list\">\n\n {/* Made in KSA */}\n {this.withMadeInKsa && <li class=\"s-payments-list-item\">\n <img class=\"lazy\" width=\"100%\" height=\"100%\" decoding=\"async\" loading=\"lazy\" data-src={salla.url.cdn(`images/made-in-ksa.svg`)} alt=\"made in KSA certified\" />\n </li>}\n\n {/* Dynamic methods */}\n {this.payments.map((payment) => (\n payment == \"cod\" ?\n <div id=\"cod-slot\" innerHTML={this.codSlot\n .replace(/\\{image\\}/g, salla.url.cdn(`images/payment/cod_mini.png`, 40, 40))}>\n </div> :\n <div id=\"payment-slot\" innerHTML={this.paymentSlot\n .replace(/\\{image\\}/g, salla.url.cdn(`images/payment/${payment}_mini.png`, 40, 40))\n .replace(/\\{payment\\}/g, payment)}>\n </div>\n ))}\n\n\n {/* SBC certificate */}\n {this.withSbc && this.sbcId && <div id=\"sbc-slot\" innerHTML={this.sbcSlot\n .replace(/\\{image\\}/g, salla.url.cdn(`images/sbc.png`, 40, 40))\n .replace(/\\{link\\}/g, `https://eauthenticate.saudibusiness.gov.sa/certificate-details/${this.sbcId}`)}>\n </div>}\n </Host>\n );\n }\n componentDidLoad() {\n document.lazyLoadInstance?.update(this.host.querySelectorAll('.lazy'));\n // fix lazy loaded images that have 100% width and height\n this.host.querySelectorAll('.lazy').forEach((img) => {\n img.addEventListener('load', () => {\n img.setAttribute('width', \"100%\");\n img.setAttribute('height', \"100%\");\n });\n });\n }\n componentDidRender() {\n this.host.querySelectorAll('#payment-slot').forEach(el => el.replaceWith(el.firstChild));\n this.host.querySelectorAll('#sbc-slot').forEach(el => el.replaceWith(el.firstChild));\n this.host.querySelectorAll('#cod-slot').forEach(el => el.replaceWith(el.firstChild));\n this.host.querySelector('[slot=\"payment\"]')?.remove();\n this.host.querySelector('[slot=\"sbc\"]')?.remove();\n this.host.querySelector('[slot=\"cod\"]')?.remove();\n }\n}\n"],"version":3}