@salla.sa/twilight-components 2.14.408 → 2.14.409

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 (290) hide show
  1. package/dist/cjs/{filepond-BgbvcZf8.js → filepond-_YUCqjZz.js} +1 -1
  2. package/dist/cjs/{filepond-plugin-file-poster-BCC8Dm4r.js → filepond-plugin-file-poster-DETXDGSa.js} +1 -1
  3. package/dist/cjs/{filepond-plugin-file-validate-size-DkwN69Tq.js → filepond-plugin-file-validate-size-DI4aQsrT.js} +1 -1
  4. package/dist/cjs/{filepond-plugin-file-validate-type-DQKecNaO.js → filepond-plugin-file-validate-type-wP_qhQ5Z.js} +1 -1
  5. package/dist/cjs/{filepond-plugin-image-edit-CoIzB2gm.js → filepond-plugin-image-edit-pumLkq4m.js} +1 -1
  6. package/dist/cjs/{filepond-plugin-image-exif-orientation-CzqeLFMH.js → filepond-plugin-image-exif-orientation-Df4RWDaf.js} +1 -1
  7. package/dist/cjs/{filepond-plugin-image-preview-SpqwlIbB.js → filepond-plugin-image-preview-CiISL9NZ.js} +1 -1
  8. package/dist/cjs/{functions-B60h_CmR.js → functions-C8UUG2MA.js} +1 -1
  9. package/dist/cjs/{index-ORfw11TF.js → index-DJN7HwcX.js} +2 -2
  10. package/dist/cjs/{index-Bivy6Ywp.js → index-Db0Qrz4u.js} +1 -1
  11. package/dist/cjs/loader.cjs.js +1 -1
  12. package/dist/cjs/salla-accordion-body_2.cjs.entry.js +1 -1
  13. package/dist/cjs/salla-accordion_6.cjs.entry.js +1 -1
  14. package/dist/cjs/salla-add-product-button_4.cjs.entry.js +1 -1
  15. package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
  16. package/dist/cjs/salla-alert_2.cjs.entry.js +1 -1
  17. package/dist/cjs/salla-app-install-alert.cjs.entry.js +1 -1
  18. package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
  19. package/dist/cjs/salla-badge.cjs.entry.js +1 -1
  20. package/dist/cjs/salla-booking-field_7.cjs.entry.js +11 -11
  21. package/dist/cjs/salla-bullet-delivery.cjs.entry.js +1 -1
  22. package/dist/cjs/salla-cart-coupons.cjs.entry.js +1 -1
  23. package/dist/cjs/salla-cart-item-offers_2.cjs.entry.js +1 -1
  24. package/dist/cjs/salla-comment-form_8.cjs.entry.js +1 -1
  25. package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
  26. package/dist/cjs/salla-contacts.cjs.entry.js +1 -1
  27. package/dist/cjs/salla-cookies-bar.cjs.entry.js +1 -1
  28. package/dist/cjs/salla-count-down.cjs.entry.js +1 -1
  29. package/dist/cjs/salla-custom-fields.cjs.entry.js +1 -1
  30. package/dist/cjs/salla-delivery-promise.cjs.entry.js +1 -1
  31. package/dist/cjs/salla-edit-order-button.cjs.entry.js +1 -1
  32. package/dist/cjs/salla-filters-widget.cjs.entry.js +1 -1
  33. package/dist/cjs/salla-filters.cjs.entry.js +1 -1
  34. package/dist/cjs/salla-fulfillment-methods.cjs.entry.js +1 -1
  35. package/dist/cjs/salla-gifting.cjs.entry.js +1 -1
  36. package/dist/cjs/salla-hook.cjs.entry.js +1 -1
  37. package/dist/cjs/salla-infinite-scroll.cjs.entry.js +1 -1
  38. package/dist/cjs/salla-installment.cjs.entry.js +1 -1
  39. package/dist/cjs/salla-list-tile.cjs.entry.js +1 -1
  40. package/dist/cjs/salla-localization-modal.cjs.entry.js +1 -1
  41. package/dist/cjs/salla-login-modal.cjs.entry.js +1 -1
  42. package/dist/cjs/salla-loyalty-banner.cjs.entry.js +2 -2
  43. package/dist/cjs/salla-loyalty-hero_2.cjs.entry.js +2 -2
  44. package/dist/cjs/salla-loyalty-panel.cjs.entry.js +3 -3
  45. package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
  46. package/dist/cjs/salla-loyalty-program.cjs.entry.js +3 -3
  47. package/dist/cjs/salla-loyalty-reward.cjs.entry.js +2 -2
  48. package/dist/cjs/salla-loyalty.cjs.entry.js +1 -1
  49. package/dist/cjs/salla-maintenance-alert.cjs.entry.js +1 -1
  50. package/dist/cjs/salla-map.cjs.entry.js +1 -1
  51. package/dist/cjs/salla-menu.cjs.entry.js +1 -1
  52. package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
  53. package/dist/cjs/salla-multiple-bundle-product-cart_2.cjs.entry.js +1 -1
  54. package/dist/cjs/salla-multiple-bundle-product-options-modal_2.cjs.entry.js +1 -1
  55. package/dist/cjs/salla-multiple-bundle-product.cjs.entry.js +1 -1
  56. package/dist/cjs/salla-notification-item.cjs.entry.js +1 -1
  57. package/dist/cjs/salla-notifications.cjs.entry.js +1 -1
  58. package/dist/cjs/salla-offer-modal.cjs.entry.js +1 -1
  59. package/dist/cjs/salla-offer.cjs.entry.js +1 -1
  60. package/dist/cjs/salla-order-details-multiple-bundle-product.cjs.entry.js +1 -1
  61. package/dist/cjs/salla-order-details-options.cjs.entry.js +1 -1
  62. package/dist/cjs/salla-order-details.cjs.entry.js +1 -1
  63. package/dist/cjs/salla-order-edit-item.cjs.entry.js +1 -1
  64. package/dist/cjs/salla-order-edit.cjs.entry.js +1 -1
  65. package/dist/cjs/salla-order-summary.cjs.entry.js +1 -1
  66. package/dist/cjs/salla-order-totals-card.cjs.entry.js +1 -1
  67. package/dist/cjs/salla-orders.cjs.entry.js +1 -1
  68. package/dist/cjs/salla-payments.cjs.entry.js +1 -1
  69. package/dist/cjs/salla-placeholder.cjs.entry.js +1 -1
  70. package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
  71. package/dist/cjs/salla-product-card_2.cjs.entry.js +1 -1
  72. package/dist/cjs/salla-product-size-guide.cjs.entry.js +1 -1
  73. package/dist/cjs/salla-products-list.cjs.entry.js +1 -1
  74. package/dist/cjs/salla-progress-bar.cjs.entry.js +1 -1
  75. package/dist/cjs/salla-quick-order.cjs.entry.js +1 -1
  76. package/dist/cjs/salla-rating-modal.cjs.entry.js +1 -1
  77. package/dist/cjs/salla-reward-action_4.cjs.entry.js +3 -3
  78. package/dist/cjs/salla-scopes.cjs.entry.js +1 -1
  79. package/dist/cjs/salla-search.cjs.entry.js +1 -1
  80. package/dist/cjs/salla-skeleton.cjs.entry.js +1 -1
  81. package/dist/cjs/salla-slider.cjs.entry.js +1 -1
  82. package/dist/cjs/salla-social-share.cjs.entry.js +1 -1
  83. package/dist/cjs/salla-social.cjs.entry.js +1 -1
  84. package/dist/cjs/salla-tab-content_3.cjs.entry.js +1 -1
  85. package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
  86. package/dist/cjs/salla-tooltip.cjs.entry.js +1 -1
  87. package/dist/cjs/salla-trust-badges.cjs.entry.js +1 -1
  88. package/dist/cjs/salla-user-menu.cjs.entry.js +1 -1
  89. package/dist/cjs/salla-user-profile.cjs.entry.js +1 -1
  90. package/dist/cjs/salla-user-settings.cjs.entry.js +1 -1
  91. package/dist/cjs/salla-verify.cjs.entry.js +1 -1
  92. package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
  93. package/dist/cjs/{tracked-promise-DQoIXwgk.js → tracked-promise-NByRrgen.js} +1 -1
  94. package/dist/cjs/twilight.cjs.js +1 -1
  95. package/dist/cjs/{vanilla-picker-BfNETymu.js → vanilla-picker-2VN_UkJg.js} +1 -1
  96. package/dist/collection/components/salla-file-upload/salla-file-upload.js +1 -1
  97. package/dist/components/index.js +2 -2
  98. package/dist/components/salla-file-upload2.js +1 -1
  99. package/dist/esm/{filepond-OobiJ1kA.js → filepond-C_gsIK2H.js} +1 -1
  100. package/dist/esm/{filepond-plugin-file-poster-Co_4AjXP.js → filepond-plugin-file-poster-BBBLzUWp.js} +1 -1
  101. package/dist/esm/{filepond-plugin-file-validate-size-yNk1KGs1.js → filepond-plugin-file-validate-size-hafSzBsP.js} +1 -1
  102. package/dist/esm/{filepond-plugin-file-validate-type-RioarR9b.js → filepond-plugin-file-validate-type-DEKO_1D3.js} +1 -1
  103. package/dist/esm/{filepond-plugin-image-edit-DGiT0Jze.js → filepond-plugin-image-edit-DfPaLALg.js} +1 -1
  104. package/dist/esm/{filepond-plugin-image-exif-orientation-tZJ24If7.js → filepond-plugin-image-exif-orientation-CjK9SG2x.js} +1 -1
  105. package/dist/esm/{filepond-plugin-image-preview-BPKr8A6L.js → filepond-plugin-image-preview-BEbkyXKY.js} +1 -1
  106. package/dist/esm/{functions-OSSsgsmb.js → functions-DUlq3N7K.js} +1 -1
  107. package/dist/esm/{index-B_Rg7VI5.js → index-CNVLmZO5.js} +2 -2
  108. package/dist/esm/{index-DppDkGKF.js → index-DgbtFfph.js} +1 -1
  109. package/dist/esm/loader.js +2 -2
  110. package/dist/esm/salla-accordion-body_2.entry.js +1 -1
  111. package/dist/esm/salla-accordion_6.entry.js +1 -1
  112. package/dist/esm/salla-add-product-button_4.entry.js +1 -1
  113. package/dist/esm/salla-advertisement.entry.js +1 -1
  114. package/dist/esm/salla-alert_2.entry.js +1 -1
  115. package/dist/esm/salla-app-install-alert.entry.js +1 -1
  116. package/dist/esm/salla-apps-icons.entry.js +1 -1
  117. package/dist/esm/salla-badge.entry.js +1 -1
  118. package/dist/esm/salla-booking-field_7.entry.js +11 -11
  119. package/dist/esm/salla-bullet-delivery.entry.js +1 -1
  120. package/dist/esm/salla-cart-coupons.entry.js +1 -1
  121. package/dist/esm/salla-cart-item-offers_2.entry.js +1 -1
  122. package/dist/esm/salla-comment-form_8.entry.js +1 -1
  123. package/dist/esm/salla-conditional-offer.entry.js +1 -1
  124. package/dist/esm/salla-contacts.entry.js +1 -1
  125. package/dist/esm/salla-cookies-bar.entry.js +1 -1
  126. package/dist/esm/salla-count-down.entry.js +1 -1
  127. package/dist/esm/salla-custom-fields.entry.js +1 -1
  128. package/dist/esm/salla-delivery-promise.entry.js +1 -1
  129. package/dist/esm/salla-edit-order-button.entry.js +1 -1
  130. package/dist/esm/salla-filters-widget.entry.js +1 -1
  131. package/dist/esm/salla-filters.entry.js +1 -1
  132. package/dist/esm/salla-fulfillment-methods.entry.js +1 -1
  133. package/dist/esm/salla-gifting.entry.js +1 -1
  134. package/dist/esm/salla-hook.entry.js +1 -1
  135. package/dist/esm/salla-infinite-scroll.entry.js +1 -1
  136. package/dist/esm/salla-installment.entry.js +1 -1
  137. package/dist/esm/salla-list-tile.entry.js +1 -1
  138. package/dist/esm/salla-localization-modal.entry.js +1 -1
  139. package/dist/esm/salla-login-modal.entry.js +1 -1
  140. package/dist/esm/salla-loyalty-banner.entry.js +2 -2
  141. package/dist/esm/salla-loyalty-hero_2.entry.js +2 -2
  142. package/dist/esm/salla-loyalty-panel.entry.js +3 -3
  143. package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
  144. package/dist/esm/salla-loyalty-program.entry.js +3 -3
  145. package/dist/esm/salla-loyalty-reward.entry.js +2 -2
  146. package/dist/esm/salla-loyalty.entry.js +1 -1
  147. package/dist/esm/salla-maintenance-alert.entry.js +1 -1
  148. package/dist/esm/salla-map.entry.js +1 -1
  149. package/dist/esm/salla-menu.entry.js +1 -1
  150. package/dist/esm/salla-metadata.entry.js +1 -1
  151. package/dist/esm/salla-multiple-bundle-product-cart_2.entry.js +1 -1
  152. package/dist/esm/salla-multiple-bundle-product-options-modal_2.entry.js +1 -1
  153. package/dist/esm/salla-multiple-bundle-product.entry.js +1 -1
  154. package/dist/esm/salla-notification-item.entry.js +1 -1
  155. package/dist/esm/salla-notifications.entry.js +1 -1
  156. package/dist/esm/salla-offer-modal.entry.js +1 -1
  157. package/dist/esm/salla-offer.entry.js +1 -1
  158. package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +1 -1
  159. package/dist/esm/salla-order-details-options.entry.js +1 -1
  160. package/dist/esm/salla-order-details.entry.js +1 -1
  161. package/dist/esm/salla-order-edit-item.entry.js +1 -1
  162. package/dist/esm/salla-order-edit.entry.js +1 -1
  163. package/dist/esm/salla-order-summary.entry.js +1 -1
  164. package/dist/esm/salla-order-totals-card.entry.js +1 -1
  165. package/dist/esm/salla-orders.entry.js +1 -1
  166. package/dist/esm/salla-payments.entry.js +1 -1
  167. package/dist/esm/salla-placeholder.entry.js +1 -1
  168. package/dist/esm/salla-price-range.entry.js +1 -1
  169. package/dist/esm/salla-product-card_2.entry.js +1 -1
  170. package/dist/esm/salla-product-size-guide.entry.js +1 -1
  171. package/dist/esm/salla-products-list.entry.js +1 -1
  172. package/dist/esm/salla-progress-bar.entry.js +1 -1
  173. package/dist/esm/salla-quick-order.entry.js +1 -1
  174. package/dist/esm/salla-rating-modal.entry.js +1 -1
  175. package/dist/esm/salla-reward-action_4.entry.js +3 -3
  176. package/dist/esm/salla-scopes.entry.js +1 -1
  177. package/dist/esm/salla-search.entry.js +1 -1
  178. package/dist/esm/salla-skeleton.entry.js +1 -1
  179. package/dist/esm/salla-slider.entry.js +1 -1
  180. package/dist/esm/salla-social-share.entry.js +1 -1
  181. package/dist/esm/salla-social.entry.js +1 -1
  182. package/dist/esm/salla-tab-content_3.entry.js +1 -1
  183. package/dist/esm/salla-tiered-offer.entry.js +1 -1
  184. package/dist/esm/salla-tooltip.entry.js +1 -1
  185. package/dist/esm/salla-trust-badges.entry.js +1 -1
  186. package/dist/esm/salla-user-menu.entry.js +1 -1
  187. package/dist/esm/salla-user-profile.entry.js +1 -1
  188. package/dist/esm/salla-user-settings.entry.js +1 -1
  189. package/dist/esm/salla-verify.entry.js +1 -1
  190. package/dist/esm/salla-wallet.entry.js +1 -1
  191. package/dist/esm/{tracked-promise-96a7mm1I.js → tracked-promise-XIu_8oOZ.js} +1 -1
  192. package/dist/esm/twilight.js +2 -2
  193. package/dist/esm/{vanilla-picker-epnJk2Gy.js → vanilla-picker-BQQSG79j.js} +1 -1
  194. package/dist/twilight/{p-a8af4601.entry.js → p-0039bfa0.entry.js} +1 -1
  195. package/dist/twilight/{p-cde16f86.entry.js → p-008d5700.entry.js} +1 -1
  196. package/dist/twilight/{p-7154bae2.entry.js → p-0dd8797a.entry.js} +1 -1
  197. package/dist/twilight/{p-5981e878.entry.js → p-0f233258.entry.js} +1 -1
  198. package/dist/twilight/{p-ac486016.entry.js → p-107fb612.entry.js} +1 -1
  199. package/dist/twilight/{p-60c50fd3.entry.js → p-110474f8.entry.js} +1 -1
  200. package/dist/twilight/{p-57011022.entry.js → p-11702812.entry.js} +1 -1
  201. package/dist/twilight/p-14e6815f.entry.js +4 -0
  202. package/dist/twilight/{p-32f3a8db.entry.js → p-18725939.entry.js} +1 -1
  203. package/dist/twilight/{p-f09039ab.entry.js → p-19a87a29.entry.js} +1 -1
  204. package/dist/twilight/{p-3eba3bd7.entry.js → p-1ed43874.entry.js} +1 -1
  205. package/dist/twilight/{p-034a386e.entry.js → p-1f73b5f3.entry.js} +1 -1
  206. package/dist/twilight/{p-d806e831.entry.js → p-20ac2718.entry.js} +1 -1
  207. package/dist/twilight/{p-5369c623.entry.js → p-20e35224.entry.js} +1 -1
  208. package/dist/twilight/{p-4f1aeac8.entry.js → p-25332ded.entry.js} +1 -1
  209. package/dist/twilight/{p-4d99367a.entry.js → p-263a896f.entry.js} +1 -1
  210. package/dist/twilight/{p-0051865b.entry.js → p-2706d0ec.entry.js} +1 -1
  211. package/dist/twilight/{p-01442260.entry.js → p-306e7b36.entry.js} +1 -1
  212. package/dist/twilight/{p-69bfb6b0.entry.js → p-31794b61.entry.js} +1 -1
  213. package/dist/twilight/{p-7fdc3315.entry.js → p-3477d272.entry.js} +1 -1
  214. package/dist/twilight/{p-da3f77eb.entry.js → p-34e6f981.entry.js} +1 -1
  215. package/dist/twilight/{p-a6b1f381.entry.js → p-34ea3d80.entry.js} +1 -1
  216. package/dist/twilight/{p-35be4711.entry.js → p-3a1b2bef.entry.js} +1 -1
  217. package/dist/twilight/{p-f0a26526.entry.js → p-3c4026ad.entry.js} +1 -1
  218. package/dist/twilight/{p-703ebbb9.entry.js → p-410569ac.entry.js} +1 -1
  219. package/dist/twilight/{p-dfab1670.entry.js → p-41e6423e.entry.js} +1 -1
  220. package/dist/twilight/{p-02b2736b.entry.js → p-4bb7bbbe.entry.js} +1 -1
  221. package/dist/twilight/{p-c4034323.entry.js → p-53a239b8.entry.js} +1 -1
  222. package/dist/twilight/{p-553016db.entry.js → p-57eea6b7.entry.js} +1 -1
  223. package/dist/twilight/{p-94d65a71.entry.js → p-5a19f60e.entry.js} +1 -1
  224. package/dist/twilight/{p-4b910c6e.entry.js → p-6032aa21.entry.js} +1 -1
  225. package/dist/twilight/{p-7b419916.entry.js → p-6d305158.entry.js} +1 -1
  226. package/dist/twilight/{p-a6a0d0cf.entry.js → p-7bdce00d.entry.js} +1 -1
  227. package/dist/twilight/{p-a5ad5743.entry.js → p-7c8dcb34.entry.js} +1 -1
  228. package/dist/twilight/{p-f79b109c.entry.js → p-7d16d5b8.entry.js} +1 -1
  229. package/dist/twilight/{p-78dc6343.entry.js → p-7ddaeea0.entry.js} +1 -1
  230. package/dist/twilight/{p-d1aa11c0.entry.js → p-8374dc0e.entry.js} +1 -1
  231. package/dist/twilight/{p-2ef12774.entry.js → p-85604eb3.entry.js} +1 -1
  232. package/dist/twilight/{p-cdfd9e14.entry.js → p-88e3d40c.entry.js} +1 -1
  233. package/dist/twilight/{p-920cb16d.entry.js → p-8c2279bc.entry.js} +1 -1
  234. package/dist/twilight/{p-b1d11fe6.entry.js → p-8dcdc70a.entry.js} +1 -1
  235. package/dist/twilight/{p-b4e17ccc.entry.js → p-92bac59b.entry.js} +1 -1
  236. package/dist/twilight/{p-7ae5951d.entry.js → p-92cfb983.entry.js} +1 -1
  237. package/dist/twilight/{p-dcee1925.entry.js → p-96cab303.entry.js} +1 -1
  238. package/dist/twilight/{p-a0da56a8.entry.js → p-9904bede.entry.js} +1 -1
  239. package/dist/twilight/{p-383f35c7.entry.js → p-9b745575.entry.js} +1 -1
  240. package/dist/twilight/{p-BG0DqGhQ.js → p-B2zrudLY.js} +1 -1
  241. package/dist/twilight/{p-BcWKSbJ7.js → p-BtX1c92T.js} +1 -1
  242. package/dist/twilight/{p-pbspU7B6.js → p-BwITjP3T.js} +1 -1
  243. package/dist/twilight/{p-B_Rg7VI5.js → p-CNVLmZO5.js} +1 -1
  244. package/dist/twilight/{p-DheMhgnP.js → p-D0Ft2F4m.js} +1 -1
  245. package/dist/twilight/{p-DJBbRd7-.js → p-DPY7gSSB.js} +1 -1
  246. package/dist/twilight/{p-CatNV3lm.js → p-DzkWqggv.js} +1 -1
  247. package/dist/twilight/{p-D7VtKOly.js → p-ZcLtdl4h.js} +1 -1
  248. package/dist/twilight/{p-BIjK6wkW.js → p-ZtftOSrB.js} +1 -1
  249. package/dist/twilight/{p-e8151643.entry.js → p-a22dc765.entry.js} +1 -1
  250. package/dist/twilight/{p-8a35406c.entry.js → p-a38d4343.entry.js} +1 -1
  251. package/dist/twilight/{p-386f7684.entry.js → p-a413523f.entry.js} +1 -1
  252. package/dist/twilight/{p-2524c628.entry.js → p-aa4ba8d7.entry.js} +1 -1
  253. package/dist/twilight/{p-2011aaa8.entry.js → p-aae40c4f.entry.js} +1 -1
  254. package/dist/twilight/{p-f89d590e.entry.js → p-abaea280.entry.js} +1 -1
  255. package/dist/twilight/{p-b5df7b84.entry.js → p-ad5791fe.entry.js} +1 -1
  256. package/dist/twilight/{p-e90ed257.entry.js → p-b6deb4a4.entry.js} +1 -1
  257. package/dist/twilight/{p-7a23211f.entry.js → p-b8320f71.entry.js} +1 -1
  258. package/dist/twilight/{p-edd74e8e.entry.js → p-b9e80f97.entry.js} +1 -1
  259. package/dist/twilight/{p-92721180.entry.js → p-bcff0988.entry.js} +1 -1
  260. package/dist/twilight/{p-449fd099.entry.js → p-bd70bbb8.entry.js} +1 -1
  261. package/dist/twilight/{p-b1e50292.entry.js → p-bfbae3a8.entry.js} +1 -1
  262. package/dist/twilight/{p-5ee37db8.entry.js → p-c04b664d.entry.js} +1 -1
  263. package/dist/twilight/{p-48dc7b15.entry.js → p-c4ab3a40.entry.js} +1 -1
  264. package/dist/twilight/{p-96d3c590.entry.js → p-c705cacb.entry.js} +1 -1
  265. package/dist/twilight/{p-b3375d03.entry.js → p-c7c54f82.entry.js} +1 -1
  266. package/dist/twilight/{p-eb2ab6ab.entry.js → p-cb6cb968.entry.js} +1 -1
  267. package/dist/twilight/{p-66539ee9.entry.js → p-cc83a6ac.entry.js} +1 -1
  268. package/dist/twilight/p-cdb79b26.entry.js +4 -0
  269. package/dist/twilight/{p-a59a5d0e.entry.js → p-ceeb2973.entry.js} +1 -1
  270. package/dist/twilight/{p-Cd2c43eo.js → p-cvi2AidY.js} +1 -1
  271. package/dist/twilight/{p-d9979e0c.entry.js → p-d0f3a488.entry.js} +1 -1
  272. package/dist/twilight/{p-b102ad4d.entry.js → p-d114b843.entry.js} +1 -1
  273. package/dist/twilight/{p-74a00742.entry.js → p-d12388a3.entry.js} +1 -1
  274. package/dist/twilight/{p-14ad1e17.entry.js → p-d2b898e8.entry.js} +1 -1
  275. package/dist/twilight/{p-7688db57.entry.js → p-d872a471.entry.js} +1 -1
  276. package/dist/twilight/{p-44fe0527.entry.js → p-d8a26e22.entry.js} +1 -1
  277. package/dist/twilight/{p-06f88267.entry.js → p-dbd3f746.entry.js} +1 -1
  278. package/dist/twilight/{p-f5629f97.entry.js → p-ef601fe4.entry.js} +1 -1
  279. package/dist/twilight/{p-b601a730.entry.js → p-f0e920fb.entry.js} +1 -1
  280. package/dist/twilight/{p-63edebbf.entry.js → p-f15653a8.entry.js} +1 -1
  281. package/dist/twilight/{p-fa459e59.entry.js → p-f27157cd.entry.js} +1 -1
  282. package/dist/twilight/{p-9d93ea09.entry.js → p-f878fb20.entry.js} +1 -1
  283. package/dist/twilight/{p-201e9b99.entry.js → p-f8f6c6dc.entry.js} +1 -1
  284. package/dist/twilight/{p-a73f9f3b.entry.js → p-fa9ef9b1.entry.js} +1 -1
  285. package/dist/twilight/{p-BYQqS3Gr.js → p-vyrufVPp.js} +2 -2
  286. package/dist/twilight/{p-BKvBIYLD.js → p-yGPVu3Cw.js} +1 -1
  287. package/dist/twilight/twilight.esm.js +1 -1
  288. package/package.json +5 -5
  289. package/dist/twilight/p-2d458ae7.entry.js +0 -4
  290. package/dist/twilight/p-ae9a3bcf.entry.js +0 -4
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as s,h as t,H as e,a as l}from"./p-B_Rg7VI5.js";import{A as i}from"./p-DCZbpt2a.js";import{B as a}from"./p-D3mWkc-3.js";import{P as o}from"./p-DY4LZmNP.js";import{W as n}from"./p-ZT7ehBBk.js";import{S as r}from"./p-8Tsmrwno.js";import{S as h}from"./p-D4oPi1Ov.js";import{S as c}from"./p-CXRKXFgT.js";var m='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>user-circle</title>\n<path d="M16 22.964c-4.525 0-8.447 1.713-9.993 4.365-0.371 0.636-0.156 1.452 0.48 1.823s1.453 0.156 1.823-0.48c0.855-1.465 3.624-3.041 7.689-3.041s6.835 1.576 7.689 3.041c0.249 0.424 0.696 0.661 1.155 0.661 0.228 0 0.459-0.059 0.669-0.181 0.637-0.371 0.852-1.187 0.48-1.823-1.545-2.652-5.467-4.365-9.992-4.365zM22.667 13.631c0-3.676-2.991-6.667-6.667-6.667s-6.667 2.991-6.667 6.667 2.991 6.667 6.667 6.667 6.667-2.992 6.667-6.667zM12 13.631c0-2.205 1.795-4 4-4s4 1.795 4 4-1.795 4-4 4-4-1.795-4-4zM16 0.297c-8.823 0-16 7.177-16 16 0 2.941 0.821 5.831 2.373 8.357 0.252 0.411 0.689 0.636 1.137 0.636 0.239 0 0.479-0.064 0.696-0.197 0.628-0.385 0.824-1.207 0.439-1.833-1.295-2.108-1.979-4.516-1.979-6.963 0-7.352 5.981-13.333 13.333-13.333s13.333 5.981 13.333 13.333c0 2.448-0.684 4.856-1.979 6.961-0.385 0.628-0.189 1.448 0.437 1.835 0.627 0.384 1.448 0.189 1.835-0.437 1.553-2.527 2.373-5.416 2.373-8.359 0-8.823-7.177-16-16-16z"></path>\n</svg>\n';const u=class{constructor(t){s(this,t),this.accountLoading=!1,this.opened=!1,this.notifications=salla.lang.get("common.titles.notifications"),this.orders=salla.lang.get("common.titles.orders"),this.pending_orders=salla.lang.get("common.titles.pending_orders"),this.wishlist=salla.lang.get("common.titles.wishlist"),this.profile=salla.lang.get("common.titles.profile"),this.rating=salla.lang.get("common.titles.rating"),this.wallet=salla.lang.get("common.titles.wallet"),this.settings=salla.lang.get("common.titles.settings"),this.loyalty_program=salla.lang.get("pages.loyalty_program.loyalty_points"),this.logout=salla.lang.get("blocks.header.logout"),this.hello=salla.lang.get("pages.checkout.hello"),this.first_name=salla.storage.get("user.first_name")||"",this.last_name=salla.storage.get("user.last_name")||"",this.avatar=salla.storage.get("user.avatar")||salla.url.cdn("images/avatar.png",40,40),this.badges={notifications:salla.helpers.number(salla.storage.get("user.notifications")||0),pending_orders:salla.helpers.number(salla.storage.get("user.pending_orders")||0)},this.sallaAccountEnabled=!1,this.hasBadges=Number(salla.storage.get("user.pending_orders"))>0||Number(salla.storage.get("user.notifications"))>0,this.inline=!1,this.avatarOnly=!1,this.showHeader=!1,this.relativeDropdown=!1,this.showTrigger=!1,this.onClickOutside=()=>{this.opened=!1},this.OrderUpdate=0,this.items={notifications:a,orders:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>box-bankers</title>\n<path d="M28 1.333h-24c-2.205 0-4 1.795-4 4v5.333c0 0.736 0.597 1.333 1.333 1.333v14.667c0 2.205 1.795 4 4 4h21.333c2.205 0 4-1.795 4-4v-14.667c0.736 0 1.333-0.597 1.333-1.333v-5.333c0-2.205-1.795-4-4-4zM28 26.667c0 0.735-0.599 1.333-1.333 1.333h-21.333c-0.735 0-1.333-0.599-1.333-1.333v-14.667h5.333v2.667c0 1.471 1.196 2.667 2.667 2.667h8c1.471 0 2.667-1.196 2.667-2.667v-2.667h5.333zM12 14.667v-2.667h8v2.667zM29.333 9.333h-26.667v-4c0-0.735 0.599-1.333 1.333-1.333h24c0.735 0 1.333 0.599 1.333 1.333z"></path>\n</svg>\n',pending_orders:o,wishlist:n,wallet:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>wallet</title>\n<path d="M28 6.667h-24c-0.736 0-1.333-0.597-1.333-1.333s0.597-1.333 1.333-1.333h24c0.737 0 1.333-0.596 1.333-1.333s-0.596-1.333-1.333-1.333h-24c-2.204 0-3.999 1.793-4 3.997v18.669c0 3.676 2.991 6.667 6.667 6.667h21.333c2.205 0 4-1.795 4-4v-16c0-2.205-1.795-4-4-4zM29.333 26.667c0 0.736-0.597 1.333-1.333 1.333h-21.333c-2.205 0-4-1.795-4-4v-14.895c0.416 0.147 0.865 0.228 1.333 0.228h24c0.736 0 1.333 0.597 1.333 1.333zM22.667 14.667c-2.205 0-4 1.795-4 4s1.795 4 4 4 4-1.795 4-4-1.795-4-4-4zM22.667 20c-0.736 0-1.333-0.597-1.333-1.333s0.597-1.333 1.333-1.333 1.333 0.597 1.333 1.333-0.597 1.333-1.333 1.333z"></path>\n</svg>\n',loyalty_program:c,profile:m}}async componentWillLoad(){await salla.onReady(),await salla.lang.onLoaded(),this.loadTranslations(),this.initiate(),Salla.event.on("api::token.injected",(s=>this.profileUrl=this.buildProfileUrl(s))),this.sallaAccountEnabled=Salla.config.get("store.features")?.includes("salla-account"),this.items=this.sallaAccountEnabled?{...this.items,settings:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>settings</title>\n<path d="M29.717 19.037l-1.817-1.499c0.067-0.512 0.1-1.028 0.1-1.539s-0.033-1.027-0.1-1.54l1.817-1.499c1.177-0.969 1.479-2.633 0.716-3.956l-1.159-2.009c-0.761-1.324-2.349-1.895-3.784-1.359l-2.212 0.829c-0.817-0.627-1.704-1.139-2.649-1.535l-0.388-2.332c-0.251-1.507-1.54-2.6-3.067-2.6h-2.319c-1.525 0-2.815 1.093-3.065 2.6l-0.388 2.332c-0.945 0.396-1.833 0.909-2.649 1.535l-2.212-0.829c-1.428-0.533-3.021 0.036-3.783 1.359l-1.16 2.011c-0.763 1.323-0.46 2.985 0.716 3.955l1.817 1.499c-0.067 0.513-0.1 1.029-0.1 1.54s0.033 1.027 0.1 1.539l-1.819 1.5c-1.176 0.971-1.476 2.635-0.715 3.955l1.159 2.011c0.763 1.324 2.356 1.899 3.784 1.36l2.212-0.831c0.816 0.625 1.703 1.139 2.649 1.535l0.388 2.332c0.251 1.507 1.54 2.6 3.067 2.6h2.319c1.527 0 2.816-1.093 3.065-2.6l0.389-2.332c0.947-0.396 1.833-0.909 2.649-1.535l2.212 0.831c1.432 0.539 3.023-0.035 3.783-1.36l1.16-2.011c0.76-1.32 0.459-2.984-0.717-3.956zM28.123 21.663l-1.16 2.011c-0.108 0.188-0.336 0.267-0.536 0.193l-2.931-1.1c-0.459-0.173-0.979-0.079-1.349 0.248-0.923 0.811-1.979 1.423-3.139 1.819-0.464 0.157-0.804 0.559-0.885 1.043l-0.515 3.087c-0.033 0.215-0.216 0.371-0.433 0.371h-2.319c-0.217 0-0.4-0.156-0.436-0.371l-0.513-3.087c-0.080-0.484-0.42-0.884-0.885-1.043-1.16-0.396-2.216-1.008-3.139-1.819-0.248-0.217-0.561-0.332-0.88-0.332-0.157 0-0.316 0.028-0.469 0.084l-2.931 1.1c-0.199 0.079-0.428-0.004-0.537-0.193l-1.159-2.011c-0.109-0.191-0.067-0.428 0.101-0.568l2.409-1.985c0.379-0.312 0.555-0.807 0.46-1.288-0.119-0.605-0.179-1.219-0.179-1.821 0-0.604 0.060-1.217 0.181-1.823 0.095-0.481-0.081-0.976-0.46-1.288l-2.409-1.985c-0.168-0.139-0.211-0.376-0.101-0.567l1.16-2.011c0.107-0.188 0.332-0.268 0.536-0.193l2.931 1.1c0.459 0.172 0.979 0.079 1.348-0.247 0.924-0.812 1.98-1.424 3.139-1.817 0.465-0.159 0.805-0.559 0.885-1.044l0.513-3.088c0.036-0.215 0.219-0.371 0.436-0.371h2.319c0.217 0 0.4 0.156 0.436 0.371l0.515 3.088c0.081 0.484 0.42 0.885 0.885 1.044 1.157 0.393 2.213 1.005 3.139 1.817 0.371 0.325 0.889 0.42 1.349 0.247l2.929-1.099c0.203-0.076 0.428 0.005 0.537 0.193l1.159 2.009c0.109 0.191 0.067 0.428-0.101 0.567l-2.409 1.985c-0.379 0.312-0.555 0.807-0.46 1.288 0.119 0.605 0.179 1.219 0.179 1.823 0 0.603-0.060 1.216-0.181 1.821-0.095 0.48 0.081 0.975 0.46 1.288l2.408 1.984c0.169 0.141 0.212 0.379 0.103 0.569zM16.016 10.667c-2.941 0-5.333 2.392-5.333 5.333s2.392 5.333 5.333 5.333 5.333-2.392 5.333-5.333-2.392-5.333-5.333-5.333zM16.016 18.667c-1.471 0-2.667-1.196-2.667-2.667s1.196-2.667 2.667-2.667 2.667 1.196 2.667 2.667-1.196 2.667-2.667 2.667z"></path>\n</svg>\n'}:this.items,this.host.hasAttribute("with-rating")&&(this.items.rating=h),this.items.logout='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>send-out</title>\n<path d="M16 26.667h-9.333c-0.736 0-1.333-0.597-1.333-1.333v-18.667c0-0.736 0.597-1.333 1.333-1.333h9.333c0.737 0 1.333-0.596 1.333-1.333s-0.596-1.333-1.333-1.333h-9.333c-2.205 0-4 1.795-4 4v18.667c0 2.205 1.795 4 4 4h9.333c0.737 0 1.333-0.596 1.333-1.333s-0.596-1.333-1.333-1.333zM29.231 15.491c-0.068-0.164-0.167-0.312-0.289-0.436l-5.332-5.332c-0.521-0.521-1.364-0.521-1.885 0s-0.521 1.364 0 1.885l3.057 3.059h-12.781c-0.737 0-1.333 0.596-1.333 1.333s0.596 1.333 1.333 1.333h12.781l-3.057 3.057c-0.521 0.521-0.521 1.364 0 1.885 0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391l5.332-5.332c0.124-0.123 0.221-0.271 0.289-0.435 0.135-0.325 0.135-0.693 0-1.019z"></path>\n</svg>\n';let s=Salla.storage.get("token");s||(s=""),this.profileUrl=this.buildProfileUrl(s);const t=this.host.querySelector('[slot="trigger"]');this.triggerSlot='<div class="s-user-menu-trigger"><div class="s-user-menu-avatar-wrap"><img class="s-user-menu-trigger-avatar" src="{avatar}" alt="{first_name}{last_name}" /></div><div class="s-user-menu-trigger-content"><span class="s-user-menu-trigger-hello">{hello}</span><p class="s-user-menu-trigger-name">{first_name} {last_name}</p></div> <i class="s-user-menu-trigger-icon">{icon}</i></div>',t&&(this.triggerSlot=t.innerHTML,t.innerHTML=this.replaceParams(t.innerHTML))}loadTranslations(){this.notifications=Salla.lang.get("common.titles.notifications"),this.orders=Salla.lang.get("common.titles.orders"),this.pending_orders=Salla.lang.get("common.titles.pending_orders"),this.wishlist=Salla.lang.get("common.titles.wishlist"),this.profile=Salla.lang.get("common.titles.profile"),this.hello=Salla.lang.get("pages.checkout.hello"),this.rating=Salla.lang.get("common.titles.rating"),this.wallet=Salla.lang.get("common.titles.wallet"),this.settings=Salla.lang.get("common.titles.settings"),this.loyalty_program=Salla.lang.get("pages.loyalty_program.loyalty_points"),this.logout=Salla.lang.get("blocks.header.logout")}initiate(){return Salla.config.isGuest()?this.autoMountLoginModal():(this.is_loggedIn=!0,!this.inline&&(salla.url.is_page("customer.notifications")||salla.url.is_page("customer.orders.index.pending")||salla.url.is_page("customer.profile")||(Date.now()-(salla.storage.get("user.fetched_at")||0))/1e3/60>30)?this.fetchFreshProfile():void salla.event.on("profile::info.fetched",(s=>{this.updateProfileState(s)})))}autoMountLoginModal(){this.showTrigger&&(document.querySelector("salla-login-modal")||Salla.hooks.mount("body:end",document.createElement("salla-login-modal")))}fetchFreshProfile(){salla.api.token?salla.profile.api.info().then((s=>{this.updateProfileState(s)})):salla.log("trying to fetchFreshProfile before injected the token!!")}updateProfileState(s){this.badges={notifications:salla.helpers.number(s.data.notifications||0),pending_orders:salla.helpers.number(s.data.pending_orders||0)},this.hasBadges=Number(s.data.pending_orders)>0||Number(s.data.notifications)>0,this.first_name=s.data.first_name,this.last_name=s.data.last_name,this.avatar=s.data.avatar||salla.url.cdn("images/avatar.png",40,40)}async open(s){this.opened=!this.opened,s.stopPropagation(),this.opened&&window.addEventListener("click",this.onClickOutside)}menuItemClicked(s,t){"logout"===t&&(s.preventDefault(),salla.auth.logout("sall-user-menu"))}replaceParams(s){return s.replace(/\{hello\}/g,this.hello).replace(/\{first_name\}/g,this.first_name).replace(/\{last_name\}/g,this.last_name).replace(/\{avatar\}/g,this.avatar).replace(/\{icon\}/g,i)}getTheHeader(){return t("div",{class:{"s-user-menu-trigger-slot":!0,"s-user-menu-red-dot":this.hasBadges,"s-user-menu-trigger-avatar-only":this.avatarOnly},id:"trigger-slot",onClick:s=>this.open(s),onKeyUp:s=>this.open(s),innerHTML:this.replaceParams(this.triggerSlot)})}getItemAnchorLinkAttrs(s){return"profile"===s&&this.profileUrl&&this.sallaAccountEnabled?{href:this.profileUrl,target:"_blank",rel:"noopener noreferrer"}:{href:Salla.url.get("loyalty_program"===s?"loyalty":s)}}getMenuItem([s,e],l){if(("wallet"!==s||window.can_access_wallet)&&("loyalty_program"!==s||Salla.config.get("store.features").includes("loyalty-system")))return t("li",{class:{"s-user-menu-dropdown-item":!0,"s-user-menu-dropdown-item-logout":l+1===Object.entries(this.items).length}},t("a",{...this.getItemAnchorLinkAttrs(s),class:"s-user-menu-dropdown-item-link",onClick:t=>this.menuItemClicked(t,s)},t("i",{class:"s-user-menu-dropdown-item-prefix",innerHTML:e}),t("span",{class:"s-user-menu-dropdown-item-title"},this[s]),["٠","0",void 0].includes(this.badges[s])?"":t("span",{class:"s-user-menu-dropdown-item-badge"},this.badges[s])))}componentShouldUpdate(){this.opened||window.removeEventListener("click",this.onClickOutside)}render(){return t(e,null,this.is_loggedIn?this.inline?t("ul",{class:"s-user-menu-inline"},Object.entries(this.items).map(((s,t)=>this.getMenuItem(s,t)))):t("div",{class:{"s-user-menu-wrapper":!0,"s-user-menu-relative-dropdown":this.relativeDropdown}},this.getTheHeader(),t("div",{class:{"s-user-menu-toggler":!0,opened:this.opened}},t("div",{class:"s-user-menu-dropdown",onClick:s=>s.stopPropagation(),onKeyUp:s=>s.stopPropagation()},this.showHeader?t("div",{class:"s-user-menu-dropdown-header"},t("img",{src:this.avatar,alt:`${this.first_name} ${this.last_name}`}),t("div",{class:"s-user-menu-dropdown-header-content"},t("span",null,this.hello),t("p",null,this.first_name," ",this.last_name)),t("button",{type:"button",class:"s-user-menu-dropdown-header-close",innerHTML:r,onClick:()=>{this.opened=!1}})):"",t("ul",{class:"s-user-menu-dropdown-list"},Object.entries(this.items).map(((s,t)=>this.getMenuItem(s,t))))))):t("slot",{name:"login-btn"},t("button",{type:"button",class:"s-user-menu-login-btn",onClick:()=>salla.event.dispatch("login::open"),innerHTML:m})))}async componentDidLoad(){await Salla.hooks.registerComponent("salla-user-menu",this),document.lazyLoadInstance?.update(this.host.querySelectorAll(".lazy"))}buildProfileUrl(s){return`${Salla.config.get("account.url","https://accounts.salla.com")}/${salla.config.get("user.language_code")}/user?store=${Salla.config.get("store.id")}&info=${encodeURIComponent(s)}`}get host(){return l(this)}};u.style="";export{u as salla_user_menu}
4
+ import{r as s,h as t,H as e,a as l}from"./p-CNVLmZO5.js";import{A as i}from"./p-DCZbpt2a.js";import{B as a}from"./p-D3mWkc-3.js";import{P as o}from"./p-DY4LZmNP.js";import{W as n}from"./p-ZT7ehBBk.js";import{S as r}from"./p-8Tsmrwno.js";import{S as h}from"./p-D4oPi1Ov.js";import{S as c}from"./p-CXRKXFgT.js";var m='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>user-circle</title>\n<path d="M16 22.964c-4.525 0-8.447 1.713-9.993 4.365-0.371 0.636-0.156 1.452 0.48 1.823s1.453 0.156 1.823-0.48c0.855-1.465 3.624-3.041 7.689-3.041s6.835 1.576 7.689 3.041c0.249 0.424 0.696 0.661 1.155 0.661 0.228 0 0.459-0.059 0.669-0.181 0.637-0.371 0.852-1.187 0.48-1.823-1.545-2.652-5.467-4.365-9.992-4.365zM22.667 13.631c0-3.676-2.991-6.667-6.667-6.667s-6.667 2.991-6.667 6.667 2.991 6.667 6.667 6.667 6.667-2.992 6.667-6.667zM12 13.631c0-2.205 1.795-4 4-4s4 1.795 4 4-1.795 4-4 4-4-1.795-4-4zM16 0.297c-8.823 0-16 7.177-16 16 0 2.941 0.821 5.831 2.373 8.357 0.252 0.411 0.689 0.636 1.137 0.636 0.239 0 0.479-0.064 0.696-0.197 0.628-0.385 0.824-1.207 0.439-1.833-1.295-2.108-1.979-4.516-1.979-6.963 0-7.352 5.981-13.333 13.333-13.333s13.333 5.981 13.333 13.333c0 2.448-0.684 4.856-1.979 6.961-0.385 0.628-0.189 1.448 0.437 1.835 0.627 0.384 1.448 0.189 1.835-0.437 1.553-2.527 2.373-5.416 2.373-8.359 0-8.823-7.177-16-16-16z"></path>\n</svg>\n';const u=class{constructor(t){s(this,t),this.accountLoading=!1,this.opened=!1,this.notifications=salla.lang.get("common.titles.notifications"),this.orders=salla.lang.get("common.titles.orders"),this.pending_orders=salla.lang.get("common.titles.pending_orders"),this.wishlist=salla.lang.get("common.titles.wishlist"),this.profile=salla.lang.get("common.titles.profile"),this.rating=salla.lang.get("common.titles.rating"),this.wallet=salla.lang.get("common.titles.wallet"),this.settings=salla.lang.get("common.titles.settings"),this.loyalty_program=salla.lang.get("pages.loyalty_program.loyalty_points"),this.logout=salla.lang.get("blocks.header.logout"),this.hello=salla.lang.get("pages.checkout.hello"),this.first_name=salla.storage.get("user.first_name")||"",this.last_name=salla.storage.get("user.last_name")||"",this.avatar=salla.storage.get("user.avatar")||salla.url.cdn("images/avatar.png",40,40),this.badges={notifications:salla.helpers.number(salla.storage.get("user.notifications")||0),pending_orders:salla.helpers.number(salla.storage.get("user.pending_orders")||0)},this.sallaAccountEnabled=!1,this.hasBadges=Number(salla.storage.get("user.pending_orders"))>0||Number(salla.storage.get("user.notifications"))>0,this.inline=!1,this.avatarOnly=!1,this.showHeader=!1,this.relativeDropdown=!1,this.showTrigger=!1,this.onClickOutside=()=>{this.opened=!1},this.OrderUpdate=0,this.items={notifications:a,orders:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>box-bankers</title>\n<path d="M28 1.333h-24c-2.205 0-4 1.795-4 4v5.333c0 0.736 0.597 1.333 1.333 1.333v14.667c0 2.205 1.795 4 4 4h21.333c2.205 0 4-1.795 4-4v-14.667c0.736 0 1.333-0.597 1.333-1.333v-5.333c0-2.205-1.795-4-4-4zM28 26.667c0 0.735-0.599 1.333-1.333 1.333h-21.333c-0.735 0-1.333-0.599-1.333-1.333v-14.667h5.333v2.667c0 1.471 1.196 2.667 2.667 2.667h8c1.471 0 2.667-1.196 2.667-2.667v-2.667h5.333zM12 14.667v-2.667h8v2.667zM29.333 9.333h-26.667v-4c0-0.735 0.599-1.333 1.333-1.333h24c0.735 0 1.333 0.599 1.333 1.333z"></path>\n</svg>\n',pending_orders:o,wishlist:n,wallet:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>wallet</title>\n<path d="M28 6.667h-24c-0.736 0-1.333-0.597-1.333-1.333s0.597-1.333 1.333-1.333h24c0.737 0 1.333-0.596 1.333-1.333s-0.596-1.333-1.333-1.333h-24c-2.204 0-3.999 1.793-4 3.997v18.669c0 3.676 2.991 6.667 6.667 6.667h21.333c2.205 0 4-1.795 4-4v-16c0-2.205-1.795-4-4-4zM29.333 26.667c0 0.736-0.597 1.333-1.333 1.333h-21.333c-2.205 0-4-1.795-4-4v-14.895c0.416 0.147 0.865 0.228 1.333 0.228h24c0.736 0 1.333 0.597 1.333 1.333zM22.667 14.667c-2.205 0-4 1.795-4 4s1.795 4 4 4 4-1.795 4-4-1.795-4-4-4zM22.667 20c-0.736 0-1.333-0.597-1.333-1.333s0.597-1.333 1.333-1.333 1.333 0.597 1.333 1.333-0.597 1.333-1.333 1.333z"></path>\n</svg>\n',loyalty_program:c,profile:m}}async componentWillLoad(){await salla.onReady(),await salla.lang.onLoaded(),this.loadTranslations(),this.initiate(),Salla.event.on("api::token.injected",(s=>this.profileUrl=this.buildProfileUrl(s))),this.sallaAccountEnabled=Salla.config.get("store.features")?.includes("salla-account"),this.items=this.sallaAccountEnabled?{...this.items,settings:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>settings</title>\n<path d="M29.717 19.037l-1.817-1.499c0.067-0.512 0.1-1.028 0.1-1.539s-0.033-1.027-0.1-1.54l1.817-1.499c1.177-0.969 1.479-2.633 0.716-3.956l-1.159-2.009c-0.761-1.324-2.349-1.895-3.784-1.359l-2.212 0.829c-0.817-0.627-1.704-1.139-2.649-1.535l-0.388-2.332c-0.251-1.507-1.54-2.6-3.067-2.6h-2.319c-1.525 0-2.815 1.093-3.065 2.6l-0.388 2.332c-0.945 0.396-1.833 0.909-2.649 1.535l-2.212-0.829c-1.428-0.533-3.021 0.036-3.783 1.359l-1.16 2.011c-0.763 1.323-0.46 2.985 0.716 3.955l1.817 1.499c-0.067 0.513-0.1 1.029-0.1 1.54s0.033 1.027 0.1 1.539l-1.819 1.5c-1.176 0.971-1.476 2.635-0.715 3.955l1.159 2.011c0.763 1.324 2.356 1.899 3.784 1.36l2.212-0.831c0.816 0.625 1.703 1.139 2.649 1.535l0.388 2.332c0.251 1.507 1.54 2.6 3.067 2.6h2.319c1.527 0 2.816-1.093 3.065-2.6l0.389-2.332c0.947-0.396 1.833-0.909 2.649-1.535l2.212 0.831c1.432 0.539 3.023-0.035 3.783-1.36l1.16-2.011c0.76-1.32 0.459-2.984-0.717-3.956zM28.123 21.663l-1.16 2.011c-0.108 0.188-0.336 0.267-0.536 0.193l-2.931-1.1c-0.459-0.173-0.979-0.079-1.349 0.248-0.923 0.811-1.979 1.423-3.139 1.819-0.464 0.157-0.804 0.559-0.885 1.043l-0.515 3.087c-0.033 0.215-0.216 0.371-0.433 0.371h-2.319c-0.217 0-0.4-0.156-0.436-0.371l-0.513-3.087c-0.080-0.484-0.42-0.884-0.885-1.043-1.16-0.396-2.216-1.008-3.139-1.819-0.248-0.217-0.561-0.332-0.88-0.332-0.157 0-0.316 0.028-0.469 0.084l-2.931 1.1c-0.199 0.079-0.428-0.004-0.537-0.193l-1.159-2.011c-0.109-0.191-0.067-0.428 0.101-0.568l2.409-1.985c0.379-0.312 0.555-0.807 0.46-1.288-0.119-0.605-0.179-1.219-0.179-1.821 0-0.604 0.060-1.217 0.181-1.823 0.095-0.481-0.081-0.976-0.46-1.288l-2.409-1.985c-0.168-0.139-0.211-0.376-0.101-0.567l1.16-2.011c0.107-0.188 0.332-0.268 0.536-0.193l2.931 1.1c0.459 0.172 0.979 0.079 1.348-0.247 0.924-0.812 1.98-1.424 3.139-1.817 0.465-0.159 0.805-0.559 0.885-1.044l0.513-3.088c0.036-0.215 0.219-0.371 0.436-0.371h2.319c0.217 0 0.4 0.156 0.436 0.371l0.515 3.088c0.081 0.484 0.42 0.885 0.885 1.044 1.157 0.393 2.213 1.005 3.139 1.817 0.371 0.325 0.889 0.42 1.349 0.247l2.929-1.099c0.203-0.076 0.428 0.005 0.537 0.193l1.159 2.009c0.109 0.191 0.067 0.428-0.101 0.567l-2.409 1.985c-0.379 0.312-0.555 0.807-0.46 1.288 0.119 0.605 0.179 1.219 0.179 1.823 0 0.603-0.060 1.216-0.181 1.821-0.095 0.48 0.081 0.975 0.46 1.288l2.408 1.984c0.169 0.141 0.212 0.379 0.103 0.569zM16.016 10.667c-2.941 0-5.333 2.392-5.333 5.333s2.392 5.333 5.333 5.333 5.333-2.392 5.333-5.333-2.392-5.333-5.333-5.333zM16.016 18.667c-1.471 0-2.667-1.196-2.667-2.667s1.196-2.667 2.667-2.667 2.667 1.196 2.667 2.667-1.196 2.667-2.667 2.667z"></path>\n</svg>\n'}:this.items,this.host.hasAttribute("with-rating")&&(this.items.rating=h),this.items.logout='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>send-out</title>\n<path d="M16 26.667h-9.333c-0.736 0-1.333-0.597-1.333-1.333v-18.667c0-0.736 0.597-1.333 1.333-1.333h9.333c0.737 0 1.333-0.596 1.333-1.333s-0.596-1.333-1.333-1.333h-9.333c-2.205 0-4 1.795-4 4v18.667c0 2.205 1.795 4 4 4h9.333c0.737 0 1.333-0.596 1.333-1.333s-0.596-1.333-1.333-1.333zM29.231 15.491c-0.068-0.164-0.167-0.312-0.289-0.436l-5.332-5.332c-0.521-0.521-1.364-0.521-1.885 0s-0.521 1.364 0 1.885l3.057 3.059h-12.781c-0.737 0-1.333 0.596-1.333 1.333s0.596 1.333 1.333 1.333h12.781l-3.057 3.057c-0.521 0.521-0.521 1.364 0 1.885 0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391l5.332-5.332c0.124-0.123 0.221-0.271 0.289-0.435 0.135-0.325 0.135-0.693 0-1.019z"></path>\n</svg>\n';let s=Salla.storage.get("token");s||(s=""),this.profileUrl=this.buildProfileUrl(s);const t=this.host.querySelector('[slot="trigger"]');this.triggerSlot='<div class="s-user-menu-trigger"><div class="s-user-menu-avatar-wrap"><img class="s-user-menu-trigger-avatar" src="{avatar}" alt="{first_name}{last_name}" /></div><div class="s-user-menu-trigger-content"><span class="s-user-menu-trigger-hello">{hello}</span><p class="s-user-menu-trigger-name">{first_name} {last_name}</p></div> <i class="s-user-menu-trigger-icon">{icon}</i></div>',t&&(this.triggerSlot=t.innerHTML,t.innerHTML=this.replaceParams(t.innerHTML))}loadTranslations(){this.notifications=Salla.lang.get("common.titles.notifications"),this.orders=Salla.lang.get("common.titles.orders"),this.pending_orders=Salla.lang.get("common.titles.pending_orders"),this.wishlist=Salla.lang.get("common.titles.wishlist"),this.profile=Salla.lang.get("common.titles.profile"),this.hello=Salla.lang.get("pages.checkout.hello"),this.rating=Salla.lang.get("common.titles.rating"),this.wallet=Salla.lang.get("common.titles.wallet"),this.settings=Salla.lang.get("common.titles.settings"),this.loyalty_program=Salla.lang.get("pages.loyalty_program.loyalty_points"),this.logout=Salla.lang.get("blocks.header.logout")}initiate(){return Salla.config.isGuest()?this.autoMountLoginModal():(this.is_loggedIn=!0,!this.inline&&(salla.url.is_page("customer.notifications")||salla.url.is_page("customer.orders.index.pending")||salla.url.is_page("customer.profile")||(Date.now()-(salla.storage.get("user.fetched_at")||0))/1e3/60>30)?this.fetchFreshProfile():void salla.event.on("profile::info.fetched",(s=>{this.updateProfileState(s)})))}autoMountLoginModal(){this.showTrigger&&(document.querySelector("salla-login-modal")||Salla.hooks.mount("body:end",document.createElement("salla-login-modal")))}fetchFreshProfile(){salla.api.token?salla.profile.api.info().then((s=>{this.updateProfileState(s)})):salla.log("trying to fetchFreshProfile before injected the token!!")}updateProfileState(s){this.badges={notifications:salla.helpers.number(s.data.notifications||0),pending_orders:salla.helpers.number(s.data.pending_orders||0)},this.hasBadges=Number(s.data.pending_orders)>0||Number(s.data.notifications)>0,this.first_name=s.data.first_name,this.last_name=s.data.last_name,this.avatar=s.data.avatar||salla.url.cdn("images/avatar.png",40,40)}async open(s){this.opened=!this.opened,s.stopPropagation(),this.opened&&window.addEventListener("click",this.onClickOutside)}menuItemClicked(s,t){"logout"===t&&(s.preventDefault(),salla.auth.logout("sall-user-menu"))}replaceParams(s){return s.replace(/\{hello\}/g,this.hello).replace(/\{first_name\}/g,this.first_name).replace(/\{last_name\}/g,this.last_name).replace(/\{avatar\}/g,this.avatar).replace(/\{icon\}/g,i)}getTheHeader(){return t("div",{class:{"s-user-menu-trigger-slot":!0,"s-user-menu-red-dot":this.hasBadges,"s-user-menu-trigger-avatar-only":this.avatarOnly},id:"trigger-slot",onClick:s=>this.open(s),onKeyUp:s=>this.open(s),innerHTML:this.replaceParams(this.triggerSlot)})}getItemAnchorLinkAttrs(s){return"profile"===s&&this.profileUrl&&this.sallaAccountEnabled?{href:this.profileUrl,target:"_blank",rel:"noopener noreferrer"}:{href:Salla.url.get("loyalty_program"===s?"loyalty":s)}}getMenuItem([s,e],l){if(("wallet"!==s||window.can_access_wallet)&&("loyalty_program"!==s||Salla.config.get("store.features").includes("loyalty-system")))return t("li",{class:{"s-user-menu-dropdown-item":!0,"s-user-menu-dropdown-item-logout":l+1===Object.entries(this.items).length}},t("a",{...this.getItemAnchorLinkAttrs(s),class:"s-user-menu-dropdown-item-link",onClick:t=>this.menuItemClicked(t,s)},t("i",{class:"s-user-menu-dropdown-item-prefix",innerHTML:e}),t("span",{class:"s-user-menu-dropdown-item-title"},this[s]),["٠","0",void 0].includes(this.badges[s])?"":t("span",{class:"s-user-menu-dropdown-item-badge"},this.badges[s])))}componentShouldUpdate(){this.opened||window.removeEventListener("click",this.onClickOutside)}render(){return t(e,null,this.is_loggedIn?this.inline?t("ul",{class:"s-user-menu-inline"},Object.entries(this.items).map(((s,t)=>this.getMenuItem(s,t)))):t("div",{class:{"s-user-menu-wrapper":!0,"s-user-menu-relative-dropdown":this.relativeDropdown}},this.getTheHeader(),t("div",{class:{"s-user-menu-toggler":!0,opened:this.opened}},t("div",{class:"s-user-menu-dropdown",onClick:s=>s.stopPropagation(),onKeyUp:s=>s.stopPropagation()},this.showHeader?t("div",{class:"s-user-menu-dropdown-header"},t("img",{src:this.avatar,alt:`${this.first_name} ${this.last_name}`}),t("div",{class:"s-user-menu-dropdown-header-content"},t("span",null,this.hello),t("p",null,this.first_name," ",this.last_name)),t("button",{type:"button",class:"s-user-menu-dropdown-header-close",innerHTML:r,onClick:()=>{this.opened=!1}})):"",t("ul",{class:"s-user-menu-dropdown-list"},Object.entries(this.items).map(((s,t)=>this.getMenuItem(s,t))))))):t("slot",{name:"login-btn"},t("button",{type:"button",class:"s-user-menu-login-btn",onClick:()=>salla.event.dispatch("login::open"),innerHTML:m})))}async componentDidLoad(){await Salla.hooks.registerComponent("salla-user-menu",this),document.lazyLoadInstance?.update(this.host.querySelectorAll(".lazy"))}buildProfileUrl(s){return`${Salla.config.get("account.url","https://accounts.salla.com")}/${salla.config.get("user.language_code")}/user?store=${Salla.config.get("store.id")}&info=${encodeURIComponent(s)}`}get host(){return l(this)}};u.style="";export{u as salla_user_menu}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as a,c as e,h as s,H as l}from"./p-B_Rg7VI5.js";import{c as r,b as t,f as o}from"./p-pbspU7B6.js";import{S as c}from"./p-CXRKXFgT.js";import{S as d}from"./p-cgSL_BIo.js";import{S as i}from"./p-BZp0rKEO.js";import{S as n}from"./p-8Tsmrwno.js";import{T as y}from"./p-Cd2c43eo.js";const p=class{constructor(s){a(this,s),this.actionClick=e(this,"actionClick"),this.isShopNow=a=>!!(salla.config.get("store.features")||[]).includes("loyalty-system-v2")&&"free_product"===a.key?.toLowerCase(),this.handleClick=a=>{salla.config.isGuest()?r((()=>salla.event.dispatch("login::open"))):this.actionClick.emit(a)}}render(){return s("div",{key:"0d02cecaae79cf166555514890fbf6192e1cd438",class:"s-loyalty-program-rewards-modal-action"},this.isShopNow(this.prize)?s("a",{href:this.prize.prize_url||salla.url.get(""),class:{"s-loyalty-program-rewards-action-base":!0,"s-loyalty-program-rewards-action-on":!0}},salla.lang.get("pages.loyalty_program.shop_now")):s("button",{onClick:this.handleClick,class:{"s-loyalty-program-rewards-action-base":!0,"s-loyalty-program-rewards-action-on":!0}},salla.lang.get("pages.loyalty_program.redeem_reward")))}};p.style="";const m=class{constructor(s){a(this,s),this.areaClick=e(this,"areaClick"),this.actionClick=e(this,"actionClick")}render(){return s(l,{key:"0bd68f7cab478d78db8b083ea11c2090d02aab59",class:"s-loyalty-program-reward-host"},s("div",{key:"ef4e857bc55a12e50434c1dda2160674ead3b4e6",class:"s-loyalty-program-reward-container"},s("div",{key:"a6a7ccdf50ee296b48c05a01f241192c0f77f30c",onClick:a=>this.areaClick.emit(a),role:"button"},s("div",{key:"e4f55cda0d9f36af95ce101c987819d30b9ad143",class:"s-loyalty-program-reward-img"},s("img",{key:"450fe8914dcf809005d4707074cb305a59990e81",alt:"",src:this.prize.image||salla.url.cdn("images/s-empty.png"),class:"s-loyalty-program-rewards-img"})),s("div",{key:"7828210caf948e057055c53dc64af45426d7977d",class:"s-loyalty-program-reward-content"},s("div",{key:"2f39695bd03884f6988b44de68964cdfdb75e0bb",class:"s-loyalty-program-reward-points"},s("salla-badge",{key:"e9e1dda91aa414d58caaff52a4bb667a1fc1b96f",size:"xs"},s("span",{key:"7baa15af74cde5a6e744667566377417233d0848",innerHTML:c}),s("span",{key:"6bd7f77ec736a6f0fd9de0c69907cc05e87829b0",class:"s-loyalty-program-rewards-points"},this.prize.cost_points," ",salla.lang.get("pages.loyalty_program.points")))),s("div",{key:"269da0571a6533ca6621792a3891f4b9d132d337",class:"s-loyalty-program-reward-title"},s("span",{key:"06c40cc994031777565d43c5259eefb3311dea98"},this.prize.group_title)),s("div",{key:"e81936c993e83f96f4143278ec82391135778383",class:"s-loyalty-program-reward-name"},s("div",{key:"752e5e6fbc5de60f7047913d6b8bf79e597fd407",class:"s-loyalty-program-rewards-name",id:`prize-${this.prize.id}`},this.prize.name,this.prize.description?`: ${this.prize.description}`:"")))),s("div",{key:"a83282f66ab42ee0fa055cf9bf7802af1615e8f0",class:"p-4"},s("slot",{key:"7186f03318c907b3e8ec15e30322d8bf787d74f8",name:"action"},s("button",{key:"7b1a13734d2c230dd32d744a42e82fdb1c148660",onClick:a=>this.actionClick.emit(a.detail),class:"s-loyalty-program-rewards-action-base s-loyalty-program-rewards-action-on"},salla.lang.get("pages.loyalty_program.show_reward"))))))}};m.style="";var f=function(a,e,s,l){var r,t=arguments.length,o=t<3?e:null===l?l=Object.getOwnPropertyDescriptor(e,s):l;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(a,e,s,l);else for(var c=a.length-1;c>=0;c--)(r=a[c])&&(o=(t<3?r(o):t>3?r(e,s,o):r(e,s))||o);return t>3&&o&&Object.defineProperty(e,s,o),o};const g=(...a)=>a.map((a=>"s-loyalty-program-"+a)).join(" "),b=class{constructor(s){a(this,s),this.actionClick=e(this,"actionClick"),this.refreshKey=Date.now()}handlePrizeChange(){this.refreshKey=Date.now()}componentWillLoad(){"idle"===this.category.status&&this.category(),"idle"===this.brand.status&&this.brand()}getTermsAndConditions(){const a=Number((this.prize.order_minimum_amount||"0").split(".")[0])||0,e=Number((this.prize.coupon_maximum_amount||"0").split(".")[0])||0,s=[];return a&&s.push([salla.lang.get("pages.loyalty_program.order_minimum_amount"),`${a} ${salla.lang.get(`currency.${(salla.config.get("user.currency_code")||"").toLowerCase()}`)}`]),e&&s.push([salla.lang.get("pages.loyalty_program.coupon_maximum_amount"),`${e} ${salla.lang.get(`currency.${(salla.config.get("user.currency_code")||"").toLowerCase()}`)}`]),s}findItems(a){return a?.length?this.brand.data.concat(this.category.data).filter((e=>a.includes(e.id))):[]}getIncludedItems(a,e){return a?.length?a:this.findItems(e)}getProductIds(a){return a||[]}getItemsMarkers(a){return"both"===a?this.getItemsMarkers("included")+this.getItemsMarkers("excluded"):[this.prize[`${a}_product_ids`]?.length||0,this.prize[`${a}_brand_ids`]?.length||0,this.prize[`${a}_category_ids`]?.length||0].map(Boolean).map(Number).join("")}getItemsMarkersText(){if("FREE_SHIPPING"===this.prize.key)return salla.lang.get("pages.loyalty_program.redeem_for_free_shipping");switch(this.getItemsMarkers("included")){case"001":default:return salla.lang.get("pages.loyalty_program.redeem_on_specific_products");case"010":return salla.lang.get("pages.loyalty_program.redeem_on_specific_brands");case"100":return salla.lang.get("pages.loyalty_program.redeem_on_specific_categories");case"000":return salla.lang.get("pages.loyalty_program.redeem_on_all_products")}}getCategoriesJsx(a,e){return a.length?s("div",{class:g("reward-details-categories-wrapper")},s("div",{class:g("reward-details-categories")},s("h2",{class:g("reward-details-categories-heading")},e),s("ul",{class:g("reward-details-categories-list")},a.map((a=>s("li",null,s("a",{href:a.url||a.lingual_urls?.[0],class:g("reward-details-categories-item")},s("span",{innerHTML:d}),s("span",{class:g("reward-details-categories-item-content")},a.name)))))))):""}getBrandsJsx(a,e){return a.length?s("div",{class:g("reward-details-items-brands","slider-arrows-edges")},s("div",null,s("h2",null,e),s("salla-slider",{id:`brands-${a.map((({id:a})=>a)).join("-")}`,"slider-config":'{"loop":false,"slidesPerView":"auto","spaceBetween":10}'},s("div",{slot:"items"},a.map((a=>s("a",{href:salla.url.get(t(a)),class:g("reward-brand-item")},s("img",{src:a.logo||salla.url.cdn("images/s-empty.png"),alt:""})))))))):""}getProductsJsx(a,e){return a?.length?s("div",{class:"s-loyalty-program-reward-details-items-products s-loyalty-program-slider-arrows-edges"},s("h2",null,e),s("salla-products-slider",{source:"selected",sourceValue:JSON.stringify(a),"slider-config":'{"loop":false,"slidesPerView":"auto","freeMode":true,"spaceBetween":0,"breakpoints":{"768":{"slidesPerView":3,"freeMode":false,"speed":300}}}'})):""}render(){const a=this.getTermsAndConditions();return s("div",{key:"3140551c4bcc64429a2f820ae9f915f19f6d3a77",class:"s-loyalty-program-reward-modal"},s("div",{key:"b193833caee8153c71b6c9f6af95358503afa103",class:"s-loyalty-program-points-modal-header"},s("h1",{key:"0567985c10193a8eba6570bda8abf4aefa75657a",class:"s-loyalty-program-points-modal-info"},salla.url.is_page("cart")?s("button",{class:"s-loyalty-program-back-btn",onClick:()=>r((()=>salla.event.dispatch("modal::open","loyalty-rewards-modal")))},s("span",{class:{"sicon-arrow-right":"rtl"===document.documentElement.getAttribute("dir"),"sicon-arrow-left":"ltr"===document.documentElement.getAttribute("dir")}})):"",this.prize.name)),s("div",{key:"66bb25eadb6c640b4c661b6b3e227b4b8ef4f40d",class:"s-loyalty-program-modal-scrollable-content"},s("div",{key:"1cc1c1c121240fab3ccd32bce176deec378ef3fd",class:"s-loyalty-program-reward-details-header"},s("div",{key:"81f43a0c61ed0889810efa2cf4447477c2b08094",class:"s-loyalty-program-aspect-container"},s("img",{key:"eb09214a175e8484dfc6c870492e49e3e28cbe42",src:this.prize.image,alt:this.prize.name})),s("salla-badge",{key:"2ce3001371ab69c73453957f6dfb066710d88edd",size:"sm",bg:"light"},s("span",{key:"459b58a09e6f59314c83f7d1a5baf6c559f02bd1",innerHTML:c}),s("span",{key:"1cd0a85c1d2b9cdf1430e90bd12bbe83f1b05813",class:"s-loyalty-program-points-badge-points"},o(this.prize.cost_points)))),a.length?s("div",{class:"s-loyalty-program-terms-and-conditions"},s("h1",{class:"s-loyalty-program-terms-and-conditions-heading"},salla.lang.get("pages.loyalty_program.terms_and_conditions")),s("ul",{class:"s-loyalty-program-terms-and-conditions-list"},a.map((([a,e])=>s("li",{class:"s-loyalty-program-terms-and-conditions-item"},s("span",{class:"s-loyalty-program-terms-and-conditions-content"},a),s("span",{class:"s-loyalty-program-terms-and-conditions-content"},e)))))):"",s("div",{key:"a25d46f6a961844efd8f920bf5e4e1fd836cb460",class:"s-loyalty-program-reward-info-message"},s("h1",{key:"4cf3e9e123993f6be8fb67df243156996b2a6fdd",class:"s-loyalty-program-reward-info-message-heading"},salla.lang.get("pages.loyalty_program.how_to_benefit_from_this_reward")),s("p",{key:"d658e9aea4384bc89a7a4cae956e90844092894a",class:"s-loyalty-program-reward-info-message-content"},this.getItemsMarkersText())),"FREE_SHIPPING"===this.prize.key||"000000"===this.getItemsMarkers("both")?"":s("div",{class:"s-loyalty-program-reward-details"},s("salla-tabs",{key:this.refreshKey},"000"===this.getItemsMarkers("included")?"":[s("salla-tab-header",{slot:"header",name:"included",style:{display:"000"===this.getItemsMarkers("excluded")?"none":"block"}},s("span",{class:"s-loyalty-program-reward-details-tab-icon",innerHTML:i}),s("span",null,salla.lang.get("pages.loyalty_program.included"))),s("salla-tab-content",{slot:"content",name:"included"},s("div",{class:"s-loyalty-program-reward-details-items-wrapper"},this.getCategoriesJsx(this.getIncludedItems(this.prize.categories,this.prize.included_category_ids),salla.lang.get("pages.loyalty_program.included_categories")),this.getBrandsJsx(this.getIncludedItems(this.prize.brands,this.prize.included_brand_ids),salla.lang.get("pages.loyalty_program.included_brands")),this.getProductsJsx(this.getProductIds(this.prize.included_product_ids),salla.lang.get("pages.loyalty_program.included_products"))))],"000"===this.getItemsMarkers("excluded")?"":[s("salla-tab-header",{slot:"header",name:"excluded",style:{display:"000"===this.getItemsMarkers("included")?"none":"block"}},s("span",{class:"s-loyalty-program-reward-details-tab-icon",innerHTML:n}),s("span",null,salla.lang.get("pages.loyalty_program.excluded"))),s("salla-tab-content",{slot:"content",name:"excluded"},s("div",{class:"s-loyalty-program-reward-details-items-wrapper"},this.getCategoriesJsx(this.getIncludedItems(this.prize.excludedCategories,this.prize.excluded_category_ids),salla.lang.get("pages.loyalty_program.excluded_categories")),this.getBrandsJsx(this.getIncludedItems(this.prize.excludedBrands,this.prize.excluded_brand_ids),salla.lang.get("pages.loyalty_program.excluded_brands")),this.getProductsJsx(this.getProductIds(this.prize.excluded_product_ids),salla.lang.get("pages.loyalty_program.excluded_products"))))]))),s("salla-reward-action",{key:"3b355609aa30f12d0fae5a95681d19b62193113d",onActionClick:a=>this.actionClick.emit(a.detail),prize:this.prize}))}static get watchers(){return{prize:["handlePrizeChange"]}}};f([y((async()=>(await salla.product.api.categories()).data),{initialData:[]})],b.prototype,"category",void 0),f([y((async()=>(await salla.api.request("/brands")).data),{initialData:[]})],b.prototype,"brand",void 0),b.style="";const h=class{constructor(e){a(this,e),this.productId=null}reset(a=0){setTimeout((()=>{r()}),a)}async handleConfirm(){try{await this.exchange(this.prize.id,null,this.productId),this.reset(300)}catch(a){salla.logger.error(a)}}handleCancel(){this.reset(0)}render(){return s(l,{key:"b5b9a966f28520c30917887621e2358fdb9530be"},s("div",{key:"4e87e3d0530a7fca6db1bf09fd1b059b85e56f10",class:"s-loyalty-program-exchange-heading"},s("div",{key:"73b9aa3106336e8cdc81ce78371b3efc47b5c569",class:"s-loyalty-program-circle-base s-loyalty-program-circle-size-xl s-loyalty-program-circle-variant-fill"},s("span",{key:"0e6c488afa39784a40bfed2f1d180fc48664a81a",innerHTML:c})),s("h2",{key:"7740e27318379264905ff695e0c0cf13b54800d0"},salla.lang.get("pages.loyalty_program.redeem_reward")),s("p",{key:"81a7ba841e3e26c7c9fc1054745ad163cc347db7"},salla.lang.get("pages.loyalty_program.redeem_confirmation")," ",s("span",{key:"0f5d68dbe2de661c2aad02d237d3098349e94120"},"(",this.prize.cost_points," ",salla.lang.get("pages.loyalty_program.point"),")")," ",salla.lang.get("pages.loyalty_program.for")," ",s("span",{key:"1daa10a1843938166c6834d0369edfe7e06dd54e"},"(",this.prize.name,")"))),s("div",{key:"42384b2df2cbb3775ccc6f7a017d9ef9f770baf5",class:"s-loyalty-program-exchange-btns"},s("button",{key:"b90b95adae80a9bcb47c0d039ea8bd9399ee5bc5",class:"s-loyalty-program-rewards-action-base s-loyalty-program-rewards-action-confirm",onClick:()=>this.handleConfirm()},s("span",{key:"c108973d9729265fb35a0d0fa781d525388a4c12",style:{opacity:"pending"!==this.exchange.status?"1":"0"}},salla.lang.get("common.elements.confirm")),s("span",{key:"302a31b9095d153b4662ada13d45cdb6b15664ad",class:"s-loyalty-program-exchange-loading",style:{opacity:"pending"===this.exchange.status?"1":"0"}},s("salla-loading",{key:"3e305da32d469f6ec874c128a1fd68356280dc69",color:"primary",size:24}))),s("button",{key:"466f8cfea3e370bce9466e9571f4567fb5a7966d",class:"s-loyalty-program-rewards-action-base s-loyalty-program-rewards-action-cancel",onClick:()=>this.handleCancel()},salla.lang.get("common.elements.cancel"))))}};(function(a,e,s,l){var r,t=arguments.length,o=t<3?e:null===l?l=Object.getOwnPropertyDescriptor(e,s):l;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(a,e,s,l);else for(var c=a.length-1;c>=0;c--)(r=a[c])&&(o=(t<3?r(o):t>3?r(e,s,o):r(e,s))||o);t>3&&o&&Object.defineProperty(e,s,o)})([y((async(...a)=>await salla.loyalty.exchange(...a)))],h.prototype,"exchange",void 0),h.style="";export{p as salla_reward_action,m as salla_reward_card,b as salla_reward_details,h as salla_reward_exchange}
4
+ import{r as a,c as e,h as s,H as l}from"./p-CNVLmZO5.js";import{c as r,b as t,f as o}from"./p-BwITjP3T.js";import{S as c}from"./p-CXRKXFgT.js";import{S as d}from"./p-cgSL_BIo.js";import{S as i}from"./p-BZp0rKEO.js";import{S as n}from"./p-8Tsmrwno.js";import{T as y}from"./p-cvi2AidY.js";const p=class{constructor(s){a(this,s),this.actionClick=e(this,"actionClick"),this.isShopNow=a=>!!(salla.config.get("store.features")||[]).includes("loyalty-system-v2")&&"free_product"===a.key?.toLowerCase(),this.handleClick=a=>{salla.config.isGuest()?r((()=>salla.event.dispatch("login::open"))):this.actionClick.emit(a)}}render(){return s("div",{key:"0d02cecaae79cf166555514890fbf6192e1cd438",class:"s-loyalty-program-rewards-modal-action"},this.isShopNow(this.prize)?s("a",{href:this.prize.prize_url||salla.url.get(""),class:{"s-loyalty-program-rewards-action-base":!0,"s-loyalty-program-rewards-action-on":!0}},salla.lang.get("pages.loyalty_program.shop_now")):s("button",{onClick:this.handleClick,class:{"s-loyalty-program-rewards-action-base":!0,"s-loyalty-program-rewards-action-on":!0}},salla.lang.get("pages.loyalty_program.redeem_reward")))}};p.style="";const m=class{constructor(s){a(this,s),this.areaClick=e(this,"areaClick"),this.actionClick=e(this,"actionClick")}render(){return s(l,{key:"0bd68f7cab478d78db8b083ea11c2090d02aab59",class:"s-loyalty-program-reward-host"},s("div",{key:"ef4e857bc55a12e50434c1dda2160674ead3b4e6",class:"s-loyalty-program-reward-container"},s("div",{key:"a6a7ccdf50ee296b48c05a01f241192c0f77f30c",onClick:a=>this.areaClick.emit(a),role:"button"},s("div",{key:"e4f55cda0d9f36af95ce101c987819d30b9ad143",class:"s-loyalty-program-reward-img"},s("img",{key:"450fe8914dcf809005d4707074cb305a59990e81",alt:"",src:this.prize.image||salla.url.cdn("images/s-empty.png"),class:"s-loyalty-program-rewards-img"})),s("div",{key:"7828210caf948e057055c53dc64af45426d7977d",class:"s-loyalty-program-reward-content"},s("div",{key:"2f39695bd03884f6988b44de68964cdfdb75e0bb",class:"s-loyalty-program-reward-points"},s("salla-badge",{key:"e9e1dda91aa414d58caaff52a4bb667a1fc1b96f",size:"xs"},s("span",{key:"7baa15af74cde5a6e744667566377417233d0848",innerHTML:c}),s("span",{key:"6bd7f77ec736a6f0fd9de0c69907cc05e87829b0",class:"s-loyalty-program-rewards-points"},this.prize.cost_points," ",salla.lang.get("pages.loyalty_program.points")))),s("div",{key:"269da0571a6533ca6621792a3891f4b9d132d337",class:"s-loyalty-program-reward-title"},s("span",{key:"06c40cc994031777565d43c5259eefb3311dea98"},this.prize.group_title)),s("div",{key:"e81936c993e83f96f4143278ec82391135778383",class:"s-loyalty-program-reward-name"},s("div",{key:"752e5e6fbc5de60f7047913d6b8bf79e597fd407",class:"s-loyalty-program-rewards-name",id:`prize-${this.prize.id}`},this.prize.name,this.prize.description?`: ${this.prize.description}`:"")))),s("div",{key:"a83282f66ab42ee0fa055cf9bf7802af1615e8f0",class:"p-4"},s("slot",{key:"7186f03318c907b3e8ec15e30322d8bf787d74f8",name:"action"},s("button",{key:"7b1a13734d2c230dd32d744a42e82fdb1c148660",onClick:a=>this.actionClick.emit(a.detail),class:"s-loyalty-program-rewards-action-base s-loyalty-program-rewards-action-on"},salla.lang.get("pages.loyalty_program.show_reward"))))))}};m.style="";var f=function(a,e,s,l){var r,t=arguments.length,o=t<3?e:null===l?l=Object.getOwnPropertyDescriptor(e,s):l;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(a,e,s,l);else for(var c=a.length-1;c>=0;c--)(r=a[c])&&(o=(t<3?r(o):t>3?r(e,s,o):r(e,s))||o);return t>3&&o&&Object.defineProperty(e,s,o),o};const g=(...a)=>a.map((a=>"s-loyalty-program-"+a)).join(" "),b=class{constructor(s){a(this,s),this.actionClick=e(this,"actionClick"),this.refreshKey=Date.now()}handlePrizeChange(){this.refreshKey=Date.now()}componentWillLoad(){"idle"===this.category.status&&this.category(),"idle"===this.brand.status&&this.brand()}getTermsAndConditions(){const a=Number((this.prize.order_minimum_amount||"0").split(".")[0])||0,e=Number((this.prize.coupon_maximum_amount||"0").split(".")[0])||0,s=[];return a&&s.push([salla.lang.get("pages.loyalty_program.order_minimum_amount"),`${a} ${salla.lang.get(`currency.${(salla.config.get("user.currency_code")||"").toLowerCase()}`)}`]),e&&s.push([salla.lang.get("pages.loyalty_program.coupon_maximum_amount"),`${e} ${salla.lang.get(`currency.${(salla.config.get("user.currency_code")||"").toLowerCase()}`)}`]),s}findItems(a){return a?.length?this.brand.data.concat(this.category.data).filter((e=>a.includes(e.id))):[]}getIncludedItems(a,e){return a?.length?a:this.findItems(e)}getProductIds(a){return a||[]}getItemsMarkers(a){return"both"===a?this.getItemsMarkers("included")+this.getItemsMarkers("excluded"):[this.prize[`${a}_product_ids`]?.length||0,this.prize[`${a}_brand_ids`]?.length||0,this.prize[`${a}_category_ids`]?.length||0].map(Boolean).map(Number).join("")}getItemsMarkersText(){if("FREE_SHIPPING"===this.prize.key)return salla.lang.get("pages.loyalty_program.redeem_for_free_shipping");switch(this.getItemsMarkers("included")){case"001":default:return salla.lang.get("pages.loyalty_program.redeem_on_specific_products");case"010":return salla.lang.get("pages.loyalty_program.redeem_on_specific_brands");case"100":return salla.lang.get("pages.loyalty_program.redeem_on_specific_categories");case"000":return salla.lang.get("pages.loyalty_program.redeem_on_all_products")}}getCategoriesJsx(a,e){return a.length?s("div",{class:g("reward-details-categories-wrapper")},s("div",{class:g("reward-details-categories")},s("h2",{class:g("reward-details-categories-heading")},e),s("ul",{class:g("reward-details-categories-list")},a.map((a=>s("li",null,s("a",{href:a.url||a.lingual_urls?.[0],class:g("reward-details-categories-item")},s("span",{innerHTML:d}),s("span",{class:g("reward-details-categories-item-content")},a.name)))))))):""}getBrandsJsx(a,e){return a.length?s("div",{class:g("reward-details-items-brands","slider-arrows-edges")},s("div",null,s("h2",null,e),s("salla-slider",{id:`brands-${a.map((({id:a})=>a)).join("-")}`,"slider-config":'{"loop":false,"slidesPerView":"auto","spaceBetween":10}'},s("div",{slot:"items"},a.map((a=>s("a",{href:salla.url.get(t(a)),class:g("reward-brand-item")},s("img",{src:a.logo||salla.url.cdn("images/s-empty.png"),alt:""})))))))):""}getProductsJsx(a,e){return a?.length?s("div",{class:"s-loyalty-program-reward-details-items-products s-loyalty-program-slider-arrows-edges"},s("h2",null,e),s("salla-products-slider",{source:"selected",sourceValue:JSON.stringify(a),"slider-config":'{"loop":false,"slidesPerView":"auto","freeMode":true,"spaceBetween":0,"breakpoints":{"768":{"slidesPerView":3,"freeMode":false,"speed":300}}}'})):""}render(){const a=this.getTermsAndConditions();return s("div",{key:"3140551c4bcc64429a2f820ae9f915f19f6d3a77",class:"s-loyalty-program-reward-modal"},s("div",{key:"b193833caee8153c71b6c9f6af95358503afa103",class:"s-loyalty-program-points-modal-header"},s("h1",{key:"0567985c10193a8eba6570bda8abf4aefa75657a",class:"s-loyalty-program-points-modal-info"},salla.url.is_page("cart")?s("button",{class:"s-loyalty-program-back-btn",onClick:()=>r((()=>salla.event.dispatch("modal::open","loyalty-rewards-modal")))},s("span",{class:{"sicon-arrow-right":"rtl"===document.documentElement.getAttribute("dir"),"sicon-arrow-left":"ltr"===document.documentElement.getAttribute("dir")}})):"",this.prize.name)),s("div",{key:"66bb25eadb6c640b4c661b6b3e227b4b8ef4f40d",class:"s-loyalty-program-modal-scrollable-content"},s("div",{key:"1cc1c1c121240fab3ccd32bce176deec378ef3fd",class:"s-loyalty-program-reward-details-header"},s("div",{key:"81f43a0c61ed0889810efa2cf4447477c2b08094",class:"s-loyalty-program-aspect-container"},s("img",{key:"eb09214a175e8484dfc6c870492e49e3e28cbe42",src:this.prize.image,alt:this.prize.name})),s("salla-badge",{key:"2ce3001371ab69c73453957f6dfb066710d88edd",size:"sm",bg:"light"},s("span",{key:"459b58a09e6f59314c83f7d1a5baf6c559f02bd1",innerHTML:c}),s("span",{key:"1cd0a85c1d2b9cdf1430e90bd12bbe83f1b05813",class:"s-loyalty-program-points-badge-points"},o(this.prize.cost_points)))),a.length?s("div",{class:"s-loyalty-program-terms-and-conditions"},s("h1",{class:"s-loyalty-program-terms-and-conditions-heading"},salla.lang.get("pages.loyalty_program.terms_and_conditions")),s("ul",{class:"s-loyalty-program-terms-and-conditions-list"},a.map((([a,e])=>s("li",{class:"s-loyalty-program-terms-and-conditions-item"},s("span",{class:"s-loyalty-program-terms-and-conditions-content"},a),s("span",{class:"s-loyalty-program-terms-and-conditions-content"},e)))))):"",s("div",{key:"a25d46f6a961844efd8f920bf5e4e1fd836cb460",class:"s-loyalty-program-reward-info-message"},s("h1",{key:"4cf3e9e123993f6be8fb67df243156996b2a6fdd",class:"s-loyalty-program-reward-info-message-heading"},salla.lang.get("pages.loyalty_program.how_to_benefit_from_this_reward")),s("p",{key:"d658e9aea4384bc89a7a4cae956e90844092894a",class:"s-loyalty-program-reward-info-message-content"},this.getItemsMarkersText())),"FREE_SHIPPING"===this.prize.key||"000000"===this.getItemsMarkers("both")?"":s("div",{class:"s-loyalty-program-reward-details"},s("salla-tabs",{key:this.refreshKey},"000"===this.getItemsMarkers("included")?"":[s("salla-tab-header",{slot:"header",name:"included",style:{display:"000"===this.getItemsMarkers("excluded")?"none":"block"}},s("span",{class:"s-loyalty-program-reward-details-tab-icon",innerHTML:i}),s("span",null,salla.lang.get("pages.loyalty_program.included"))),s("salla-tab-content",{slot:"content",name:"included"},s("div",{class:"s-loyalty-program-reward-details-items-wrapper"},this.getCategoriesJsx(this.getIncludedItems(this.prize.categories,this.prize.included_category_ids),salla.lang.get("pages.loyalty_program.included_categories")),this.getBrandsJsx(this.getIncludedItems(this.prize.brands,this.prize.included_brand_ids),salla.lang.get("pages.loyalty_program.included_brands")),this.getProductsJsx(this.getProductIds(this.prize.included_product_ids),salla.lang.get("pages.loyalty_program.included_products"))))],"000"===this.getItemsMarkers("excluded")?"":[s("salla-tab-header",{slot:"header",name:"excluded",style:{display:"000"===this.getItemsMarkers("included")?"none":"block"}},s("span",{class:"s-loyalty-program-reward-details-tab-icon",innerHTML:n}),s("span",null,salla.lang.get("pages.loyalty_program.excluded"))),s("salla-tab-content",{slot:"content",name:"excluded"},s("div",{class:"s-loyalty-program-reward-details-items-wrapper"},this.getCategoriesJsx(this.getIncludedItems(this.prize.excludedCategories,this.prize.excluded_category_ids),salla.lang.get("pages.loyalty_program.excluded_categories")),this.getBrandsJsx(this.getIncludedItems(this.prize.excludedBrands,this.prize.excluded_brand_ids),salla.lang.get("pages.loyalty_program.excluded_brands")),this.getProductsJsx(this.getProductIds(this.prize.excluded_product_ids),salla.lang.get("pages.loyalty_program.excluded_products"))))]))),s("salla-reward-action",{key:"3b355609aa30f12d0fae5a95681d19b62193113d",onActionClick:a=>this.actionClick.emit(a.detail),prize:this.prize}))}static get watchers(){return{prize:["handlePrizeChange"]}}};f([y((async()=>(await salla.product.api.categories()).data),{initialData:[]})],b.prototype,"category",void 0),f([y((async()=>(await salla.api.request("/brands")).data),{initialData:[]})],b.prototype,"brand",void 0),b.style="";const h=class{constructor(e){a(this,e),this.productId=null}reset(a=0){setTimeout((()=>{r()}),a)}async handleConfirm(){try{await this.exchange(this.prize.id,null,this.productId),this.reset(300)}catch(a){salla.logger.error(a)}}handleCancel(){this.reset(0)}render(){return s(l,{key:"b5b9a966f28520c30917887621e2358fdb9530be"},s("div",{key:"4e87e3d0530a7fca6db1bf09fd1b059b85e56f10",class:"s-loyalty-program-exchange-heading"},s("div",{key:"73b9aa3106336e8cdc81ce78371b3efc47b5c569",class:"s-loyalty-program-circle-base s-loyalty-program-circle-size-xl s-loyalty-program-circle-variant-fill"},s("span",{key:"0e6c488afa39784a40bfed2f1d180fc48664a81a",innerHTML:c})),s("h2",{key:"7740e27318379264905ff695e0c0cf13b54800d0"},salla.lang.get("pages.loyalty_program.redeem_reward")),s("p",{key:"81a7ba841e3e26c7c9fc1054745ad163cc347db7"},salla.lang.get("pages.loyalty_program.redeem_confirmation")," ",s("span",{key:"0f5d68dbe2de661c2aad02d237d3098349e94120"},"(",this.prize.cost_points," ",salla.lang.get("pages.loyalty_program.point"),")")," ",salla.lang.get("pages.loyalty_program.for")," ",s("span",{key:"1daa10a1843938166c6834d0369edfe7e06dd54e"},"(",this.prize.name,")"))),s("div",{key:"42384b2df2cbb3775ccc6f7a017d9ef9f770baf5",class:"s-loyalty-program-exchange-btns"},s("button",{key:"b90b95adae80a9bcb47c0d039ea8bd9399ee5bc5",class:"s-loyalty-program-rewards-action-base s-loyalty-program-rewards-action-confirm",onClick:()=>this.handleConfirm()},s("span",{key:"c108973d9729265fb35a0d0fa781d525388a4c12",style:{opacity:"pending"!==this.exchange.status?"1":"0"}},salla.lang.get("common.elements.confirm")),s("span",{key:"302a31b9095d153b4662ada13d45cdb6b15664ad",class:"s-loyalty-program-exchange-loading",style:{opacity:"pending"===this.exchange.status?"1":"0"}},s("salla-loading",{key:"3e305da32d469f6ec874c128a1fd68356280dc69",color:"primary",size:24}))),s("button",{key:"466f8cfea3e370bce9466e9571f4567fb5a7966d",class:"s-loyalty-program-rewards-action-base s-loyalty-program-rewards-action-cancel",onClick:()=>this.handleCancel()},salla.lang.get("common.elements.cancel"))))}};(function(a,e,s,l){var r,t=arguments.length,o=t<3?e:null===l?l=Object.getOwnPropertyDescriptor(e,s):l;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(a,e,s,l);else for(var c=a.length-1;c>=0;c--)(r=a[c])&&(o=(t<3?r(o):t>3?r(e,s,o):r(e,s))||o);t>3&&o&&Object.defineProperty(e,s,o)})([y((async(...a)=>await salla.loyalty.exchange(...a)))],h.prototype,"exchange",void 0),h.style="";export{p as salla_reward_action,m as salla_reward_card,b as salla_reward_details,h as salla_reward_exchange}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as s,h as t,H as o}from"./p-B_Rg7VI5.js";const e=class{constructor(t){s(this,t),this.bordered=!0,this.placeholderImage="images/placeholder.png",this.optionsData=[]}componentWillLoad(){this.parseOptionsData()}componentWillUpdate(){this.parseOptionsData()}parseOptionsData(){if(this.options)if("string"==typeof this.options)try{this.optionsData=JSON.parse(this.options)}catch(s){this.optionsData=[]}else this.optionsData=Array.isArray(this.options)?this.options:[];else this.optionsData=[]}renderOptionValue(s){return s.is_image?t("div",{class:"s-order-details-option-image-container"},t("a",{href:s.value,target:"_blank"},t("img",{class:"s-order-details-option-image",src:s.value||this.placeholderImage,alt:s.name}))):s.color?t("span",{title:s.value,class:"s-order-details-option-color-swatch",style:{backgroundColor:s.color}}):s.is_file?t("a",{href:s.value,target:"_blank",class:"s-order-details-option-file-link"},salla.lang.get("common.elements.attachments")):s.is_color_picker?t("div",{class:"s-order-details-option-color-picker"},t("div",{class:"s-order-details-option-color-picker-content"},t("span",{class:"s-order-details-option-color-picker-text"},s.value),t("span",{class:"s-order-details-option-color-picker-swatch",style:{backgroundColor:s.value,width:"1rem"}})),t("salla-button",{onClick:t=>this.copyToClipboard(t,s.value),shape:"link",class:"s-order-details-option-color-picker-button"},t("span",{class:"s-order-details-option-color-copy-icon",innerHTML:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>swap-fill</title>\n<path d="M28 10.667h-2.667c-0.736 0-1.333 0.596-1.333 1.333s0.597 1.333 1.333 1.333h2.667c0.735 0 1.333 0.597 1.333 1.333v13.333c0 0.736-0.599 1.333-1.333 1.333h-13.333c-0.735 0-1.333-0.597-1.333-1.333v-2.667c0-0.737-0.597-1.333-1.333-1.333s-1.333 0.596-1.333 1.333v2.667c0 2.205 1.795 4 4 4h13.333c2.205 0 4-1.795 4-4v-13.333c0-2.205-1.795-4-4-4zM21.333 17.333v-13.333c0-2.205-1.795-4-4-4h-13.333c-2.205 0-4 1.795-4 4v13.333c0 2.205 1.795 4 4 4h13.333c2.205 0 4-1.795 4-4zM2.667 17.333v-13.333c0-0.736 0.599-1.333 1.333-1.333h13.333c0.735 0 1.333 0.597 1.333 1.333v13.333c0 0.736-0.599 1.333-1.333 1.333h-13.333c-0.735 0-1.333-0.597-1.333-1.333z"></path>\n</svg>\n'}))):s.is_map&&s.latitude&&s.longitude?t("salla-map",{id:`location_map_${s.id}`,class:`map_${s.id}`,zoom:15,readonly:!0,lat:s.latitude,lng:s.longitude},t("div",{slot:"button"},t("button",{type:"button",class:"s-order-details-option-map-button",onClick:()=>this.openMap(s.id)},salla.lang.get("common.elements.show_location")))):t("span",{class:"s-order-details-option-default-text"},s.display_value||s.value)}copyToClipboard(s,t){s.preventDefault(),navigator.clipboard&&navigator.clipboard.writeText(t)}openMap(s){const t=document.querySelector(`salla-map.map_${s}`);t&&t.open&&t.open()}render(){if(!this.optionsData.length)return null;const s=this.bordered?"s-order-details-options-container":"s-order-details-options-container-borderless";return t(o,{class:"s-order-details-options-wrapper"},t("h2",{class:"s-order-details-options-title"},salla.lang.get("pages.cart.item_options")),t("div",{class:s},t("dl",{class:"s-order-details-options-list"},this.optionsData.map((s=>t("div",{key:s.id,class:"s-order-details-options-item"},t("dt",{class:"s-order-details-options-item-name"},s.name,":"),t("dd",{class:s.is_image?"s-order-details-options-item-value-image":"s-order-details-options-item-value-text"},this.renderOptionValue(s))))))))}};e.style="";export{e as salla_order_details_options}
4
+ import{r as s,h as t,H as o}from"./p-CNVLmZO5.js";const e=class{constructor(t){s(this,t),this.bordered=!0,this.placeholderImage="images/placeholder.png",this.optionsData=[]}componentWillLoad(){this.parseOptionsData()}componentWillUpdate(){this.parseOptionsData()}parseOptionsData(){if(this.options)if("string"==typeof this.options)try{this.optionsData=JSON.parse(this.options)}catch(s){this.optionsData=[]}else this.optionsData=Array.isArray(this.options)?this.options:[];else this.optionsData=[]}renderOptionValue(s){return s.is_image?t("div",{class:"s-order-details-option-image-container"},t("a",{href:s.value,target:"_blank"},t("img",{class:"s-order-details-option-image",src:s.value||this.placeholderImage,alt:s.name}))):s.color?t("span",{title:s.value,class:"s-order-details-option-color-swatch",style:{backgroundColor:s.color}}):s.is_file?t("a",{href:s.value,target:"_blank",class:"s-order-details-option-file-link"},salla.lang.get("common.elements.attachments")):s.is_color_picker?t("div",{class:"s-order-details-option-color-picker"},t("div",{class:"s-order-details-option-color-picker-content"},t("span",{class:"s-order-details-option-color-picker-text"},s.value),t("span",{class:"s-order-details-option-color-picker-swatch",style:{backgroundColor:s.value,width:"1rem"}})),t("salla-button",{onClick:t=>this.copyToClipboard(t,s.value),shape:"link",class:"s-order-details-option-color-picker-button"},t("span",{class:"s-order-details-option-color-copy-icon",innerHTML:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>swap-fill</title>\n<path d="M28 10.667h-2.667c-0.736 0-1.333 0.596-1.333 1.333s0.597 1.333 1.333 1.333h2.667c0.735 0 1.333 0.597 1.333 1.333v13.333c0 0.736-0.599 1.333-1.333 1.333h-13.333c-0.735 0-1.333-0.597-1.333-1.333v-2.667c0-0.737-0.597-1.333-1.333-1.333s-1.333 0.596-1.333 1.333v2.667c0 2.205 1.795 4 4 4h13.333c2.205 0 4-1.795 4-4v-13.333c0-2.205-1.795-4-4-4zM21.333 17.333v-13.333c0-2.205-1.795-4-4-4h-13.333c-2.205 0-4 1.795-4 4v13.333c0 2.205 1.795 4 4 4h13.333c2.205 0 4-1.795 4-4zM2.667 17.333v-13.333c0-0.736 0.599-1.333 1.333-1.333h13.333c0.735 0 1.333 0.597 1.333 1.333v13.333c0 0.736-0.599 1.333-1.333 1.333h-13.333c-0.735 0-1.333-0.597-1.333-1.333z"></path>\n</svg>\n'}))):s.is_map&&s.latitude&&s.longitude?t("salla-map",{id:`location_map_${s.id}`,class:`map_${s.id}`,zoom:15,readonly:!0,lat:s.latitude,lng:s.longitude},t("div",{slot:"button"},t("button",{type:"button",class:"s-order-details-option-map-button",onClick:()=>this.openMap(s.id)},salla.lang.get("common.elements.show_location")))):t("span",{class:"s-order-details-option-default-text"},s.display_value||s.value)}copyToClipboard(s,t){s.preventDefault(),navigator.clipboard&&navigator.clipboard.writeText(t)}openMap(s){const t=document.querySelector(`salla-map.map_${s}`);t&&t.open&&t.open()}render(){if(!this.optionsData.length)return null;const s=this.bordered?"s-order-details-options-container":"s-order-details-options-container-borderless";return t(o,{class:"s-order-details-options-wrapper"},t("h2",{class:"s-order-details-options-title"},salla.lang.get("pages.cart.item_options")),t("div",{class:s},t("dl",{class:"s-order-details-options-list"},this.optionsData.map((s=>t("div",{key:s.id,class:"s-order-details-options-item"},t("dt",{class:"s-order-details-options-item-name"},s.name,":"),t("dd",{class:s.is_image?"s-order-details-options-item-value-image":"s-order-details-options-item-value-text"},this.renderOptionValue(s))))))))}};e.style="";export{e as salla_order_details_options}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as t,c as s,h as i,H as e,a}from"./p-B_Rg7VI5.js";const o=class{constructor(i){t(this,i),this.orderItemUpdated=s(this,"orderItemUpdated"),this.orderItemRemoved=s(this,"orderItemRemoved"),this.handleQuantityChange=t=>{const s=t.detail,i=s?.quantity??parseInt(t.target.value,10);isNaN(i)||i<1||i!==this.quantity&&(this.quantity=i,this.emitUpdate(i))},this.handleOptionsChange=()=>{this.emitUpdate(this.quantity)}}componentWillLoad(){this.quantity=this.item?.quantity||1}componentDidLoad(){const t=this.host.querySelector("salla-quantity-input");t&&t.addEventListener("change",this.handleQuantityChange);const s=this.host.querySelector("salla-product-options");s&&s.addEventListener("change",this.handleOptionsChange)}disconnectedCallback(){const t=this.host.querySelector("salla-quantity-input");t&&t.removeEventListener("change",this.handleQuantityChange);const s=this.host.querySelector("salla-product-options");s&&s.removeEventListener("change",this.handleOptionsChange)}get hasOptions(){const t=this.item.product?.options;return t&&t.length>0}async getSelectedOptions(){const t=this.host.querySelector(`salla-product-options[product-id="${this.item.product?.id}"]`);return await(t?.getSelectedOptionsData())||{}}async emitUpdate(t){const s={itemId:this.item?.id,quantity:t};this.hasOptions&&(s.options=await this.getSelectedOptions()),this.orderItemUpdated.emit(s)}removeItem(){const t=this.item?.id;null!=t&&this.orderItemRemoved.emit({itemId:t})}render(){if(!this.item)return null;const t=this.item.product,s=this.item.name||t?.name||"",a=t?.image?.url||"",o=t?.image?.alt||s,n=t?.url||"#",l=t?.price,r=t?.max_quantity,d=t?.weight_label,c=this.item.product?.options,h={value:this.quantity};return r&&(h.max=r),i(e,null,i("div",null,i("div",{class:"s-order-edit-item-header"},i("div",{class:"s-order-edit-item-media"},a&&i("a",{href:n},i("img",{src:a,alt:o,class:"s-order-edit-item-image"})),i("div",{class:"s-order-edit-item-details"},i("h2",{class:"s-order-edit-item-name"},i("a",{href:n,class:"s-order-edit-item-link"},s)),null!=l&&i("span",{class:"s-order-edit-item-price",innerHTML:salla.money(l)}),d&&i("p",{class:"s-order-edit-item-weight"},salla.lang.getWithDefault("pages.products.weight","الوزن")," ",d))),i("salla-button",{type:"button",shape:"icon",size:"small",color:"danger","aria-label":salla.lang.getWithDefault("common.elements.delete","حذف"),onClick:()=>this.removeItem()},i("i",{class:"sicon-cancel"}))),i("div",{class:"s-order-edit-item-quantity"},i("h3",{class:"s-order-edit-item-quantity-label"},salla.lang.getWithDefault("common.elements.quantity","الكمية")),i("div",{class:"s-order-edit-item-quantity-input"},i("salla-quantity-input",{...h}))),this.hasOptions&&i("form",{onSubmit:t=>t.preventDefault()},i("salla-product-options",{"product-id":t.id,options:JSON.stringify(c),key:`${t.id}-order-edit-item-options`}))))}get host(){return a(this)}};o.style="";export{o as salla_order_edit_item}
4
+ import{r as t,c as s,h as i,H as e,a}from"./p-CNVLmZO5.js";const o=class{constructor(i){t(this,i),this.orderItemUpdated=s(this,"orderItemUpdated"),this.orderItemRemoved=s(this,"orderItemRemoved"),this.handleQuantityChange=t=>{const s=t.detail,i=s?.quantity??parseInt(t.target.value,10);isNaN(i)||i<1||i!==this.quantity&&(this.quantity=i,this.emitUpdate(i))},this.handleOptionsChange=()=>{this.emitUpdate(this.quantity)}}componentWillLoad(){this.quantity=this.item?.quantity||1}componentDidLoad(){const t=this.host.querySelector("salla-quantity-input");t&&t.addEventListener("change",this.handleQuantityChange);const s=this.host.querySelector("salla-product-options");s&&s.addEventListener("change",this.handleOptionsChange)}disconnectedCallback(){const t=this.host.querySelector("salla-quantity-input");t&&t.removeEventListener("change",this.handleQuantityChange);const s=this.host.querySelector("salla-product-options");s&&s.removeEventListener("change",this.handleOptionsChange)}get hasOptions(){const t=this.item.product?.options;return t&&t.length>0}async getSelectedOptions(){const t=this.host.querySelector(`salla-product-options[product-id="${this.item.product?.id}"]`);return await(t?.getSelectedOptionsData())||{}}async emitUpdate(t){const s={itemId:this.item?.id,quantity:t};this.hasOptions&&(s.options=await this.getSelectedOptions()),this.orderItemUpdated.emit(s)}removeItem(){const t=this.item?.id;null!=t&&this.orderItemRemoved.emit({itemId:t})}render(){if(!this.item)return null;const t=this.item.product,s=this.item.name||t?.name||"",a=t?.image?.url||"",o=t?.image?.alt||s,n=t?.url||"#",l=t?.price,r=t?.max_quantity,d=t?.weight_label,c=this.item.product?.options,h={value:this.quantity};return r&&(h.max=r),i(e,null,i("div",null,i("div",{class:"s-order-edit-item-header"},i("div",{class:"s-order-edit-item-media"},a&&i("a",{href:n},i("img",{src:a,alt:o,class:"s-order-edit-item-image"})),i("div",{class:"s-order-edit-item-details"},i("h2",{class:"s-order-edit-item-name"},i("a",{href:n,class:"s-order-edit-item-link"},s)),null!=l&&i("span",{class:"s-order-edit-item-price",innerHTML:salla.money(l)}),d&&i("p",{class:"s-order-edit-item-weight"},salla.lang.getWithDefault("pages.products.weight","الوزن")," ",d))),i("salla-button",{type:"button",shape:"icon",size:"small",color:"danger","aria-label":salla.lang.getWithDefault("common.elements.delete","حذف"),onClick:()=>this.removeItem()},i("i",{class:"sicon-cancel"}))),i("div",{class:"s-order-edit-item-quantity"},i("h3",{class:"s-order-edit-item-quantity-label"},salla.lang.getWithDefault("common.elements.quantity","الكمية")),i("div",{class:"s-order-edit-item-quantity-input"},i("salla-quantity-input",{...h}))),this.hasOptions&&i("form",{onSubmit:t=>t.preventDefault()},i("salla-product-options",{"product-id":t.id,options:JSON.stringify(c),key:`${t.id}-order-edit-item-options`}))))}get host(){return a(this)}};o.style="";export{o as salla_order_edit_item}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r,h as e}from"./p-B_Rg7VI5.js";function t(r){var e,s,a="";if("string"==typeof r||"number"==typeof r)a+=r;else if("object"==typeof r)if(Array.isArray(r))for(e=0;e<r.length;e++)r[e]&&(s=t(r[e]))&&(a&&(a+=" "),a+=s);else for(e in r)r[e]&&(a&&(a+=" "),a+=e);return a}const s=r=>"boolean"==typeof r?"".concat(r):0===r?"0":r,a=function(){for(var r,e,s=0,a="";s<arguments.length;)(r=arguments[s++])&&(e=t(r))&&(a&&(a+=" "),a+=e);return a},l=(n="s-badge-base",i={variants:{size:{xs:"s-badge-xs",sm:"s-badge-sm",md:"s-badge-md"},bg:{transparent:"s-badge-transparent",light:"s-badge-light","primary-100":"s-badge-primary-100"},color:{black:"s-badge-black","primary-900":"s-badge-color-primary-900"}}},r=>{var e;if(null==(null==i?void 0:i.variants))return a(n,null==r?void 0:r.class,null==r?void 0:r.className);const{variants:t,defaultVariants:l}=i,o=Object.keys(t).map((e=>{const a=null==r?void 0:r[e],n=null==l?void 0:l[e];if(null===a)return null;const i=s(a)||s(n);return t[e][i]})),d=r&&Object.entries(r).reduce(((r,e)=>{let[t,s]=e;return void 0===s||(r[t]=s),r}),{}),c=null==i||null===(e=i.compoundVariants)||void 0===e?void 0:e.reduce(((r,e)=>{let{class:t,className:s,...a}=e;return Object.entries(a).every((r=>{let[e,t]=r;return Array.isArray(t)?t.includes({...l,...d}[e]):{...l,...d}[e]===t}))?[...r,t,s]:r}),[]);return a(n,o,c,null==r?void 0:r.class,null==r?void 0:r.className)});var n,i;const o=class{constructor(e){r(this,e),this.size="sm",this.color="black",this.bg="light"}render(){return e("div",{key:"9d81a7c592a57a533e2b8a48f015e2f9e796be51",class:l({size:this.size,bg:this.bg,color:this.color})},e("slot",{key:"999e75ec14a8346d84dbfc5122c448999d4fc481"}))}};o.style="";export{o as salla_badge}
4
+ import{r,h as e}from"./p-CNVLmZO5.js";function t(r){var e,s,a="";if("string"==typeof r||"number"==typeof r)a+=r;else if("object"==typeof r)if(Array.isArray(r))for(e=0;e<r.length;e++)r[e]&&(s=t(r[e]))&&(a&&(a+=" "),a+=s);else for(e in r)r[e]&&(a&&(a+=" "),a+=e);return a}const s=r=>"boolean"==typeof r?"".concat(r):0===r?"0":r,a=function(){for(var r,e,s=0,a="";s<arguments.length;)(r=arguments[s++])&&(e=t(r))&&(a&&(a+=" "),a+=e);return a},l=(n="s-badge-base",i={variants:{size:{xs:"s-badge-xs",sm:"s-badge-sm",md:"s-badge-md"},bg:{transparent:"s-badge-transparent",light:"s-badge-light","primary-100":"s-badge-primary-100"},color:{black:"s-badge-black","primary-900":"s-badge-color-primary-900"}}},r=>{var e;if(null==(null==i?void 0:i.variants))return a(n,null==r?void 0:r.class,null==r?void 0:r.className);const{variants:t,defaultVariants:l}=i,o=Object.keys(t).map((e=>{const a=null==r?void 0:r[e],n=null==l?void 0:l[e];if(null===a)return null;const i=s(a)||s(n);return t[e][i]})),d=r&&Object.entries(r).reduce(((r,e)=>{let[t,s]=e;return void 0===s||(r[t]=s),r}),{}),c=null==i||null===(e=i.compoundVariants)||void 0===e?void 0:e.reduce(((r,e)=>{let{class:t,className:s,...a}=e;return Object.entries(a).every((r=>{let[e,t]=r;return Array.isArray(t)?t.includes({...l,...d}[e]):{...l,...d}[e]===t}))?[...r,t,s]:r}),[]);return a(n,o,c,null==r?void 0:r.class,null==r?void 0:r.className)});var n,i;const o=class{constructor(e){r(this,e),this.size="sm",this.color="black",this.bg="light"}render(){return e("div",{key:"9d81a7c592a57a533e2b8a48f015e2f9e796be51",class:l({size:this.size,bg:this.bg,color:this.color})},e("slot",{key:"999e75ec14a8346d84dbfc5122c448999d4fc481"}))}};o.style="";export{o as salla_badge}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as s,h as t,F as e,H as r}from"./p-B_Rg7VI5.js";const a=class{constructor(t){s(this,t)}parseOrderDetailsData(s){this.parsedOrderDetailsData=s,this.parsedOrderDetailsData="string"==typeof this.orderDetails?JSON.parse(s):s}componentWillLoad(){this.parseOrderDetailsData(this.orderDetails),console.log("Parent componentWillLoad - parsedOrderDetailsData:",this.parsedOrderDetailsData)}renderOrderDetailsContent(){return this.parsedOrderDetailsData?[this.parsedOrderDetailsData.options&&this.parsedOrderDetailsData.options.length>0&&t("salla-order-details-options",{options:this.parsedOrderDetailsData.options}),this.parsedOrderDetailsData.sub_products&&this.parsedOrderDetailsData.sub_products.length>0&&t(e,null,t("h2",{class:"s-order-details-bundle-title"},salla.lang.get("pages.orders.sub_products")),t("div",{class:"s-order-details-bundle-content"},this.parsedOrderDetailsData.sub_products.map((s=>t("salla-order-details-multiple-bundle-product",{key:s?.id,productDetails:s})))))]:(console.warn("No parsedOrderDetailsData available"),null)}render(){return t(r,{key:"41599687bddf4d4b9eda3572ce39b93a0d8f596d",class:"s-order-details-wrapper"},this.renderOrderDetailsContent())}static get watchers(){return{orderDetails:["parseOrderDetailsData"]}}};a.style="";export{a as salla_order_details}
4
+ import{r as s,h as t,F as e,H as r}from"./p-CNVLmZO5.js";const a=class{constructor(t){s(this,t)}parseOrderDetailsData(s){this.parsedOrderDetailsData=s,this.parsedOrderDetailsData="string"==typeof this.orderDetails?JSON.parse(s):s}componentWillLoad(){this.parseOrderDetailsData(this.orderDetails),console.log("Parent componentWillLoad - parsedOrderDetailsData:",this.parsedOrderDetailsData)}renderOrderDetailsContent(){return this.parsedOrderDetailsData?[this.parsedOrderDetailsData.options&&this.parsedOrderDetailsData.options.length>0&&t("salla-order-details-options",{options:this.parsedOrderDetailsData.options}),this.parsedOrderDetailsData.sub_products&&this.parsedOrderDetailsData.sub_products.length>0&&t(e,null,t("h2",{class:"s-order-details-bundle-title"},salla.lang.get("pages.orders.sub_products")),t("div",{class:"s-order-details-bundle-content"},this.parsedOrderDetailsData.sub_products.map((s=>t("salla-order-details-multiple-bundle-product",{key:s?.id,productDetails:s})))))]:(console.warn("No parsedOrderDetailsData available"),null)}render(){return t(r,{key:"41599687bddf4d4b9eda3572ce39b93a0d8f596d",class:"s-order-details-wrapper"},this.renderOrderDetailsContent())}static get watchers(){return{orderDetails:["parseOrderDetailsData"]}}};a.style="";export{a as salla_order_details}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as s,h as t,c as e,a}from"./p-B_Rg7VI5.js";const c=class{constructor(t){s(this,t),this.isSelected=!1}async getChild(){return{selected:this.selected.bind(this),unselect:this.unselect.bind(this),name:this.name}}unselect(){this.isSelected=!1}selected(){this.isSelected=!0}render(){return t("div",{key:"f2deb9c1508aafe3aff5352094cccc97bdcd42ef",class:{"s-tabs-content":!0,"s-tabs-content-selected":this.isSelected}},t("slot",{key:"460588864047444acdb06e757a7124d28935c24b"}))}};c.style="";const i=class{constructor(t){s(this,t),this.tabSelected=e(this,"tabSelected"),this.id=Math.random().toString(36).slice(2,10),this.activeClass=void 0,this.height=void 0,this.centered=!1,this.isSelected=!1}async getChild(){return{selected:this.selected.bind(this),unselect:this.unselect.bind(this),name:this.name,id:this.id}}unselect(){this.isSelected=!1}selected(){this.isSelected=!0}onClick(){this.getChild().then((s=>{this.tabSelected.emit(s)}))}render(){return[t("div",{key:"153247ab5a7c73819ccc506a45e60b9c084c391c",class:{"s-tabs-header-item":!0,"s-tabs-bg-normal":!0,"s-tabs-active":this.isSelected},onClick:this.onClick.bind(this)},t("slot",{key:"417a3ae0c0aec8a965b5d3be9a4f917f290d2109"}))]}};i.style="";const h=class{constructor(t){s(this,t),this.backgroundColor=void 0,this.vertical=!1}componentWillLoad(){this.createGroup().then((()=>{const[s]=this.tabGroup;this.selectGroup(s)}))}onSelectedTab(s){const t=this.tabGroup.find((t=>t.header.id===s.detail.id));this.selectGroup(t)}async createGroup(){const s=Array.from(this.host.querySelectorAll("salla-tab-header"));this.tabsHeader=await Promise.all(s.map((async s=>await s.getChild())));const t=Array.from(this.host.querySelectorAll("salla-tab-content"));this.tabsContent=await Promise.all(t.map((async s=>await s.getChild()))),this.tabGroup=this.tabsHeader.map((s=>{const t=this.tabsContent.find((t=>t.name===s.name));return{header:s,content:t}}))}selectGroup(s){this.tabGroup.map((s=>{s.header.unselect(),s.content.unselect()})),s.header.selected(),s.content.selected()}render(){return[t("div",{key:"ae50836f68ee92459720fa9bf00d73848d849627",class:"s-tabs"},t("div",{key:"55e8186e80381902269f9bad5738d9a555f71d37",class:"s-tabs-header"},t("slot",{key:"46ce3e1ea75f92165b3d5ee7c16f19f8693f6d31",name:"header"})),t("div",{key:"3669e643abb37ed2edca73fc0577822a3f7fbb90",class:"s-tabs-content-wrapper"},t("slot",{key:"2cf8b79f44630e21103991325ceff2cd3a4019ba",name:"content"})))]}get host(){return a(this)}};h.style=".s-tabs-header{-ms-overflow-style:none;scrollbar-width:none;}.s-tabs-header::-webkit-scrollbar{display:none}";export{c as salla_tab_content,i as salla_tab_header,h as salla_tabs}
4
+ import{r as s,h as t,c as e,a}from"./p-CNVLmZO5.js";const c=class{constructor(t){s(this,t),this.isSelected=!1}async getChild(){return{selected:this.selected.bind(this),unselect:this.unselect.bind(this),name:this.name}}unselect(){this.isSelected=!1}selected(){this.isSelected=!0}render(){return t("div",{key:"f2deb9c1508aafe3aff5352094cccc97bdcd42ef",class:{"s-tabs-content":!0,"s-tabs-content-selected":this.isSelected}},t("slot",{key:"460588864047444acdb06e757a7124d28935c24b"}))}};c.style="";const i=class{constructor(t){s(this,t),this.tabSelected=e(this,"tabSelected"),this.id=Math.random().toString(36).slice(2,10),this.activeClass=void 0,this.height=void 0,this.centered=!1,this.isSelected=!1}async getChild(){return{selected:this.selected.bind(this),unselect:this.unselect.bind(this),name:this.name,id:this.id}}unselect(){this.isSelected=!1}selected(){this.isSelected=!0}onClick(){this.getChild().then((s=>{this.tabSelected.emit(s)}))}render(){return[t("div",{key:"153247ab5a7c73819ccc506a45e60b9c084c391c",class:{"s-tabs-header-item":!0,"s-tabs-bg-normal":!0,"s-tabs-active":this.isSelected},onClick:this.onClick.bind(this)},t("slot",{key:"417a3ae0c0aec8a965b5d3be9a4f917f290d2109"}))]}};i.style="";const h=class{constructor(t){s(this,t),this.backgroundColor=void 0,this.vertical=!1}componentWillLoad(){this.createGroup().then((()=>{const[s]=this.tabGroup;this.selectGroup(s)}))}onSelectedTab(s){const t=this.tabGroup.find((t=>t.header.id===s.detail.id));this.selectGroup(t)}async createGroup(){const s=Array.from(this.host.querySelectorAll("salla-tab-header"));this.tabsHeader=await Promise.all(s.map((async s=>await s.getChild())));const t=Array.from(this.host.querySelectorAll("salla-tab-content"));this.tabsContent=await Promise.all(t.map((async s=>await s.getChild()))),this.tabGroup=this.tabsHeader.map((s=>{const t=this.tabsContent.find((t=>t.name===s.name));return{header:s,content:t}}))}selectGroup(s){this.tabGroup.map((s=>{s.header.unselect(),s.content.unselect()})),s.header.selected(),s.content.selected()}render(){return[t("div",{key:"ae50836f68ee92459720fa9bf00d73848d849627",class:"s-tabs"},t("div",{key:"55e8186e80381902269f9bad5738d9a555f71d37",class:"s-tabs-header"},t("slot",{key:"46ce3e1ea75f92165b3d5ee7c16f19f8693f6d31",name:"header"})),t("div",{key:"3669e643abb37ed2edca73fc0577822a3f7fbb90",class:"s-tabs-content-wrapper"},t("slot",{key:"2cf8b79f44630e21103991325ceff2cd3a4019ba",name:"content"})))]}get host(){return a(this)}};h.style=".s-tabs-header{-ms-overflow-style:none;scrollbar-width:none;}.s-tabs-header::-webkit-scrollbar{display:none}";export{c as salla_tab_content,i as salla_tab_header,h as salla_tabs}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as s,c as t,h as i,H as e,a as h}from"./p-B_Rg7VI5.js";import{H as a}from"./p-CHf8XdiS.js";import{F as l}from"./p-DL4h2bc3.js";import"./p-CgtvEd63.js";const r=class{constructor(i){s(this,i),this.changed=t(this,"changed"),this.initialItemCount=10,this.expandedItemCount=15,this.calculatedInitialHeight=0,this.calculatedExpandedHeight=0,this.isOpen=!0,this.isShowMore=!1,this.showMoreLabel="عرض المزيد",this.showLessLabel="عرض أقل",this.page=salla.config.get("page"),this.searchQuery="",this.filteredCount=0}connectedCallback(){this.withLoadMore="price"!=this.option.key&&Array.isArray(this.option.values)&&this.option.values.length>this.initialItemCount,salla.onReady((()=>{this.page=salla.config.get("page")})),salla.lang.onLoaded((()=>{this.showMoreLabel=salla.lang.getWithDefault("common.titles.more",this.showMoreLabel),this.showLessLabel=salla.lang.getWithDefault("common.elements.show_less",this.showLessLabel)}))}componentDidLoad(){const s=this.widgetValues.querySelectorAll(".s-filters-label");if(s.length>0){const t=Math.min(this.initialItemCount,s.length);this.calculatedInitialHeight=35*this.initialItemCount,this.calculatedExpandedHeight=s.length>this.initialItemCount?35*this.expandedItemCount:35*t}this.widgetValues.scrollHeight<this.calculatedInitialHeight&&(this.withLoadMore=!1),this.withLoadMore&&this.widgetValues&&(this.widgetValues.style.maxHeight=`${this.calculatedInitialHeight}px`),this.widgetContent.style.height=`${this.widgetContent.scrollHeight}px`}async setWidgetHeight(s=250){this.widgetContent.removeAttribute("style"),setTimeout((()=>{this.widgetContent.style.height=this.widgetContent.scrollHeight+"px"}),s)}async reset(){this.option.type===l.RANGE&&this.priceRange.reset(),Array.from(this.host.querySelectorAll("input")).forEach((s=>s.checked=!1))}async showMore(){this.isShowMore=!this.isShowMore,this.widgetContent.style.height="auto",this.isShowMore||(this.widgetValues.scrollTop=0);const s=this.isShowMore?this.calculatedExpandedHeight:this.calculatedInitialHeight,t=this.searchQuery?this.filteredCount:Array.isArray(this.option.values)?this.option.values.length:0;this.widgetValues.style.maxHeight=`${s}px`,this.widgetValues.style.overflowY=this.isShowMore&&t>this.expandedItemCount?"auto":"hidden",setTimeout((()=>{this.widgetContent.style.height=`${this.widgetContent.scrollHeight}px`}),400)}async toggleWidget(){this.isOpen=!this.isOpen,a.toggleElementClassIf(this.widgetContent,"s-filters-widget-opened","s-filters-widget-closed",(()=>this.isOpen))}renderFilterOption(s){if(![l.VALUES,l.MINIMUM,l.VARIANTS].includes(s.type))return"";const t=s.values.filter((s=>{if(!this.searchQuery)return!0;const t="number"==typeof s?String(s):s?.value||s?.key||"";return String(t).toLowerCase().includes(this.searchQuery.toLowerCase())}));return this.filteredCount=t.length,0===t.length?i("div",{class:"s-filters-widget-empty-state"},salla.lang.get("common.elements.no_options")||"لا توجد نتائج"):t.map((t=>{let e="number"==typeof t?t:t.key||t.value;return i("label",{class:"s-filters-label",htmlFor:`${s.key}-option-${e}`,key:`${s.key}-option-${e}`},i("input",{id:`${s.key}-option-${e}`,name:s.key,type:"radio",checked:this.isSelectedOption(s,e),class:"s-filters-radio",onChange:t=>this.changed.emit({event:t,option:s,value:e})}),this.getOptionLabel(s,t))}))}isSelectedOption(s,t){return s.type===l.MINIMUM?this.filtersData[s.key]==t:s.type===l.VARIANTS?this.filtersData[s.type]&&this.filtersData[s.type][Object.keys(this.filtersData[s.type])[0]]==t:s.type===l.RANGE?this.filtersData[s.key]&&this.filtersData[s.key].min==t.min&&this.filtersData[s.key].max==t.max:s.type===l.VALUES&&this.filtersData[s.key]&&Number(this.filtersData[s.key])==Number(t)}getOptionLabel(s,t){return"rating"==s.key?i("salla-rating-stars",{size:"small",value:t}):i("span",{class:"s-filters-option-name"},t.value||"null")}render(){return i(e,{key:"033902f6f4ac283b8b501a175b6fdec7c585d68a",class:"s-filters-widget-container"},i("h3",{key:"3f50c5d20c5563d291979dea0db9f69c72750d3f",class:"s-filters-widget-title",onClick:()=>this.toggleWidget()},i("span",{key:"4e7f263fc35260f641fb9d0291b26c09f9743a36"},this.option.label),i("span",{key:"6658e86d8a637ac537f285a210d3d8f0e9279f9f",class:"s-filters-widget-plusminus "+(this.isOpen?"s-filters-widget-plusminus-active":"")})),i("div",{key:"3a172b737bb88d2db6b43391cce2b02198fce61e",class:"s-filters-widget-content",ref:s=>this.widgetContent=s},Array.isArray(this.option.values)&&this.option.values.length>5&&i("div",{key:"91f8f4a00dfd05086ed8a385117dfc1d8eabea4c",class:"s-filters-widget-search-wrapper",style:{padding:"8px 0",marginBottom:"8px"}},i("input",{key:"87a25343561917b823b3b258aa9b8c8a1cb2a71a",type:"text",class:"s-filters-widget-search-input",placeholder:salla.lang.get("blocks.header.search_placeholder")||"بحث...",value:this.searchQuery,onInput:s=>this.searchQuery=s.target.value})),i("div",{key:"282b6b78bd7659134151aad4ec94c4cc2838c01c",class:"s-filters-widget-values",ref:s=>this.widgetValues=s},i("slot",{key:"fae3cf9b337d658bb6a9bee553cb487ecbd1be5f"}),this.option.type!==l.RANGE?this.renderFilterOption(this.option):i("salla-price-range",{onChanged:s=>{this.changed.emit(s.detail)},ref:s=>this.priceRange=s,filtersData:this.filtersData,option:this.option})),this.withLoadMore&&(!this.searchQuery||this.filteredCount>this.initialItemCount)&&i("a",{key:"005eedbbf498d86eb735231b754a8abf0aca77b5",class:"s-filters-widget-more",onClick:()=>this.showMore()},this.isShowMore?this.showLessLabel:this.showMoreLabel)))}get host(){return h(this)}};r.style=":host{display:block}";export{r as salla_filters_widget}
4
+ import{r as s,c as t,h as i,H as e,a as h}from"./p-CNVLmZO5.js";import{H as a}from"./p-CHf8XdiS.js";import{F as l}from"./p-DL4h2bc3.js";import"./p-CgtvEd63.js";const r=class{constructor(i){s(this,i),this.changed=t(this,"changed"),this.initialItemCount=10,this.expandedItemCount=15,this.calculatedInitialHeight=0,this.calculatedExpandedHeight=0,this.isOpen=!0,this.isShowMore=!1,this.showMoreLabel="عرض المزيد",this.showLessLabel="عرض أقل",this.page=salla.config.get("page"),this.searchQuery="",this.filteredCount=0}connectedCallback(){this.withLoadMore="price"!=this.option.key&&Array.isArray(this.option.values)&&this.option.values.length>this.initialItemCount,salla.onReady((()=>{this.page=salla.config.get("page")})),salla.lang.onLoaded((()=>{this.showMoreLabel=salla.lang.getWithDefault("common.titles.more",this.showMoreLabel),this.showLessLabel=salla.lang.getWithDefault("common.elements.show_less",this.showLessLabel)}))}componentDidLoad(){const s=this.widgetValues.querySelectorAll(".s-filters-label");if(s.length>0){const t=Math.min(this.initialItemCount,s.length);this.calculatedInitialHeight=35*this.initialItemCount,this.calculatedExpandedHeight=s.length>this.initialItemCount?35*this.expandedItemCount:35*t}this.widgetValues.scrollHeight<this.calculatedInitialHeight&&(this.withLoadMore=!1),this.withLoadMore&&this.widgetValues&&(this.widgetValues.style.maxHeight=`${this.calculatedInitialHeight}px`),this.widgetContent.style.height=`${this.widgetContent.scrollHeight}px`}async setWidgetHeight(s=250){this.widgetContent.removeAttribute("style"),setTimeout((()=>{this.widgetContent.style.height=this.widgetContent.scrollHeight+"px"}),s)}async reset(){this.option.type===l.RANGE&&this.priceRange.reset(),Array.from(this.host.querySelectorAll("input")).forEach((s=>s.checked=!1))}async showMore(){this.isShowMore=!this.isShowMore,this.widgetContent.style.height="auto",this.isShowMore||(this.widgetValues.scrollTop=0);const s=this.isShowMore?this.calculatedExpandedHeight:this.calculatedInitialHeight,t=this.searchQuery?this.filteredCount:Array.isArray(this.option.values)?this.option.values.length:0;this.widgetValues.style.maxHeight=`${s}px`,this.widgetValues.style.overflowY=this.isShowMore&&t>this.expandedItemCount?"auto":"hidden",setTimeout((()=>{this.widgetContent.style.height=`${this.widgetContent.scrollHeight}px`}),400)}async toggleWidget(){this.isOpen=!this.isOpen,a.toggleElementClassIf(this.widgetContent,"s-filters-widget-opened","s-filters-widget-closed",(()=>this.isOpen))}renderFilterOption(s){if(![l.VALUES,l.MINIMUM,l.VARIANTS].includes(s.type))return"";const t=s.values.filter((s=>{if(!this.searchQuery)return!0;const t="number"==typeof s?String(s):s?.value||s?.key||"";return String(t).toLowerCase().includes(this.searchQuery.toLowerCase())}));return this.filteredCount=t.length,0===t.length?i("div",{class:"s-filters-widget-empty-state"},salla.lang.get("common.elements.no_options")||"لا توجد نتائج"):t.map((t=>{let e="number"==typeof t?t:t.key||t.value;return i("label",{class:"s-filters-label",htmlFor:`${s.key}-option-${e}`,key:`${s.key}-option-${e}`},i("input",{id:`${s.key}-option-${e}`,name:s.key,type:"radio",checked:this.isSelectedOption(s,e),class:"s-filters-radio",onChange:t=>this.changed.emit({event:t,option:s,value:e})}),this.getOptionLabel(s,t))}))}isSelectedOption(s,t){return s.type===l.MINIMUM?this.filtersData[s.key]==t:s.type===l.VARIANTS?this.filtersData[s.type]&&this.filtersData[s.type][Object.keys(this.filtersData[s.type])[0]]==t:s.type===l.RANGE?this.filtersData[s.key]&&this.filtersData[s.key].min==t.min&&this.filtersData[s.key].max==t.max:s.type===l.VALUES&&this.filtersData[s.key]&&Number(this.filtersData[s.key])==Number(t)}getOptionLabel(s,t){return"rating"==s.key?i("salla-rating-stars",{size:"small",value:t}):i("span",{class:"s-filters-option-name"},t.value||"null")}render(){return i(e,{key:"033902f6f4ac283b8b501a175b6fdec7c585d68a",class:"s-filters-widget-container"},i("h3",{key:"3f50c5d20c5563d291979dea0db9f69c72750d3f",class:"s-filters-widget-title",onClick:()=>this.toggleWidget()},i("span",{key:"4e7f263fc35260f641fb9d0291b26c09f9743a36"},this.option.label),i("span",{key:"6658e86d8a637ac537f285a210d3d8f0e9279f9f",class:"s-filters-widget-plusminus "+(this.isOpen?"s-filters-widget-plusminus-active":"")})),i("div",{key:"3a172b737bb88d2db6b43391cce2b02198fce61e",class:"s-filters-widget-content",ref:s=>this.widgetContent=s},Array.isArray(this.option.values)&&this.option.values.length>5&&i("div",{key:"91f8f4a00dfd05086ed8a385117dfc1d8eabea4c",class:"s-filters-widget-search-wrapper",style:{padding:"8px 0",marginBottom:"8px"}},i("input",{key:"87a25343561917b823b3b258aa9b8c8a1cb2a71a",type:"text",class:"s-filters-widget-search-input",placeholder:salla.lang.get("blocks.header.search_placeholder")||"بحث...",value:this.searchQuery,onInput:s=>this.searchQuery=s.target.value})),i("div",{key:"282b6b78bd7659134151aad4ec94c4cc2838c01c",class:"s-filters-widget-values",ref:s=>this.widgetValues=s},i("slot",{key:"fae3cf9b337d658bb6a9bee553cb487ecbd1be5f"}),this.option.type!==l.RANGE?this.renderFilterOption(this.option):i("salla-price-range",{onChanged:s=>{this.changed.emit(s.detail)},ref:s=>this.priceRange=s,filtersData:this.filtersData,option:this.option})),this.withLoadMore&&(!this.searchQuery||this.filteredCount>this.initialItemCount)&&i("a",{key:"005eedbbf498d86eb735231b754a8abf0aca77b5",class:"s-filters-widget-more",onClick:()=>this.showMore()},this.isShowMore?this.showLessLabel:this.showMoreLabel)))}get host(){return h(this)}};r.style=":host{display:block}";export{r as salla_filters_widget}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as e,h as a,H as s}from"./p-B_Rg7VI5.js";const c=class{constructor(a){e(this,a),this.translationLoaded=!1,this.icon='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>inbox</title>\n<path d="M31.984 19.797l-2.667-17.333c-0.1-0.651-0.659-1.131-1.317-1.131h-24c-0.659 0-1.217 0.48-1.317 1.131l-2.667 17.333c-0.011 0.067-0.016 0.135-0.016 0.203v6.667c0 2.205 1.795 4 4 4h24c2.205 0 4-1.795 4-4v-6.667c0-0.068-0.005-0.136-0.016-0.203zM5.144 4h21.712l2.256 14.667h-9.112c-0.736 0-1.333 0.596-1.333 1.333 0 1.471-1.196 2.667-2.667 2.667s-2.667-1.196-2.667-2.667c0-0.737-0.597-1.333-1.333-1.333h-9.112zM29.333 26.667c0 0.736-0.599 1.333-1.333 1.333h-24c-0.735 0-1.333-0.597-1.333-1.333v-5.333h8.168c0.593 2.299 2.684 4 5.165 4s4.571-1.701 5.165-4h8.168z"></path>\n</svg>\n',this.alignment="left",this.iconSize="md",salla.lang.onLoaded((()=>{this.translationLoaded=!0}))}alignmentClass(){return{"s-placeholder-wrapper":!0,"s-placeholder-align-left":"left"==this.alignment,"s-placeholder-align-center":"center"==this.alignment,"s-placeholder-align-right":"right"==this.alignment}}render(){return a(s,{key:"85a52f39cc2012ca1a3c6d143d06b81981d761aa",class:this.alignmentClass()},a("div",{key:"35be844bc3883f3451344bbeedb4b24f9c218f7a",class:`s-placeholder-icon s-placeholder-icon-${this.iconSize}`,innerHTML:this.icon}),a("div",{key:"58152da7774e79fdb09465087b741212a3982cf2",class:"s-placeholder-title"},a("slot",{key:"f9953085b498043920fd03ae44a082e0fb1a02d2",name:"title"},a("span",{key:"989633e3165d187c6d3b36e0cdfa2cb10466c6da"},salla.lang.get("common.elements.no_options")))),a("div",{key:"bfbcbb5a2f9561292e5a6850eb43f5bfea8bd040",class:"s-placeholder-description"},a("slot",{key:"4592587daaaa41c67cd7670eea7d5e7e3d8635d7",name:"description"},a("span",{key:"4b1e3c4a453b8dbc5139b40ebddb94d8c2d1c465"},salla.lang.get("common.errors.empty_results")))))}};c.style="";export{c as salla_placeholder}
4
+ import{r as e,h as a,H as s}from"./p-CNVLmZO5.js";const c=class{constructor(a){e(this,a),this.translationLoaded=!1,this.icon='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>inbox</title>\n<path d="M31.984 19.797l-2.667-17.333c-0.1-0.651-0.659-1.131-1.317-1.131h-24c-0.659 0-1.217 0.48-1.317 1.131l-2.667 17.333c-0.011 0.067-0.016 0.135-0.016 0.203v6.667c0 2.205 1.795 4 4 4h24c2.205 0 4-1.795 4-4v-6.667c0-0.068-0.005-0.136-0.016-0.203zM5.144 4h21.712l2.256 14.667h-9.112c-0.736 0-1.333 0.596-1.333 1.333 0 1.471-1.196 2.667-2.667 2.667s-2.667-1.196-2.667-2.667c0-0.737-0.597-1.333-1.333-1.333h-9.112zM29.333 26.667c0 0.736-0.599 1.333-1.333 1.333h-24c-0.735 0-1.333-0.597-1.333-1.333v-5.333h8.168c0.593 2.299 2.684 4 5.165 4s4.571-1.701 5.165-4h8.168z"></path>\n</svg>\n',this.alignment="left",this.iconSize="md",salla.lang.onLoaded((()=>{this.translationLoaded=!0}))}alignmentClass(){return{"s-placeholder-wrapper":!0,"s-placeholder-align-left":"left"==this.alignment,"s-placeholder-align-center":"center"==this.alignment,"s-placeholder-align-right":"right"==this.alignment}}render(){return a(s,{key:"85a52f39cc2012ca1a3c6d143d06b81981d761aa",class:this.alignmentClass()},a("div",{key:"35be844bc3883f3451344bbeedb4b24f9c218f7a",class:`s-placeholder-icon s-placeholder-icon-${this.iconSize}`,innerHTML:this.icon}),a("div",{key:"58152da7774e79fdb09465087b741212a3982cf2",class:"s-placeholder-title"},a("slot",{key:"f9953085b498043920fd03ae44a082e0fb1a02d2",name:"title"},a("span",{key:"989633e3165d187c6d3b36e0cdfa2cb10466c6da"},salla.lang.get("common.elements.no_options")))),a("div",{key:"bfbcbb5a2f9561292e5a6850eb43f5bfea8bd040",class:"s-placeholder-description"},a("slot",{key:"4592587daaaa41c67cd7670eea7d5e7e3d8635d7",name:"description"},a("span",{key:"4b1e3c4a453b8dbc5139b40ebddb94d8c2d1c465"},salla.lang.get("common.errors.empty_results")))))}};c.style="";export{c as salla_placeholder}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as t,h as s,H as i}from"./p-B_Rg7VI5.js";const e=class{constructor(s){t(this,s),this.size="md",this.color="dark",this.digits="auto",this.autoSegments=!1,this.daysLabel=salla.lang.getWithDefault("pages.checkout.day","يوم"),this.hoursLabel=salla.lang.getWithDefault("pages.checkout.hour","ساعة"),this.minutesLabel=salla.lang.getWithDefault("pages.checkout.minute","دقيقة"),this.secondsLabel=salla.lang.getWithDefault("pages.checkout.second","ثانية"),this.endLabel=salla.lang.getWithDefault("pages.checkout.offer_ended","انتهت مدة العرض"),this.invalidDate=salla.lang.getWithDefault("blocks.buy_as_gift.incorrect_date","الرجاء إدخال الموعد بشكل صحيح"),this.offerEnded=!1,this.parseFailed=!1,this.showDays=!0,this.showHours=!0,this.days=this.number(0),this.hours=this.number(0),this.minutes=this.number(0),this.seconds=this.number(0),salla.lang.onLoaded((()=>{this.daysLabel=salla.lang.getWithDefault("pages.checkout.day","يوم"),this.hoursLabel=salla.lang.getWithDefault("pages.checkout.hour","ساعة"),this.minutesLabel=salla.lang.getWithDefault("pages.checkout.minute","دقيقة"),this.invalidDate=salla.lang.getWithDefault("blocks.buy_as_gift.incorrect_date","الرجاء إدخال الموعد بشكل صحيح"),this.secondsLabel=salla.lang.getWithDefault("pages.checkout.second","ثانية"),this.endLabel=salla.lang.getWithDefault("pages.checkout.offer_ended","انتهت مدة العرض")})),this.date&&this.isValidDate(this.date)&&this.startCountDown()}async endCountDown(){clearInterval(this.countInterval),this.offerEnded=!0,this.days=this.number(0),this.hours=this.number(0),this.minutes=this.number(0),this.seconds=this.number(0)}componentWillLoad(){if("string"==typeof this.preOrder)try{this.normalizedPreOrder=JSON.parse(this.preOrder)}catch{this.normalizedPreOrder=void 0}else this.normalizedPreOrder=this.preOrder;this.normalizedPreOrder?.end_date&&(this.date=this.normalizedPreOrder.end_date),this.date&&this.isValidDate(this.date)&&this.startCountDown()}normalizeDate(t){const s=t.match(/^(\d{1,2})-(\d{1,2})-(\d{4}),(\d{1,2}):(\d{2}):(\d{2})\s*(am|pm)$/i);if(s){const[,t,i,e,n,h,o,a]=s;let r=parseInt(n,10);"pm"===a.toLowerCase()&&r<12&&(r+=12),"am"===a.toLowerCase()&&12===r&&(r=0);const l=String(r).padStart(2,"0");return`${e}-${String(t).padStart(2,"0")}-${String(i).padStart(2,"0")} ${l}:${h}:${o}`}const i=t.match(/^(\d{1,2})-(\d{1,2})-(\d{4})$/);if(i){const[,t,s,e]=i;return`${e}-${String(t).padStart(2,"0")}-${String(s).padStart(2,"0")}`}const e=t.match(/^(\d{4})-(\d{1,2})-(\d{1,2})(?:[ T](\d{1,2}:\d{2}:\d{2}))?$/);if(e){const[,t,s,i,n]=e,h=String(s).padStart(2,"0"),o=String(i).padStart(2,"0");return n?`${t}-${h}-${o} ${n}`:`${t}-${h}-${o}`}return t}isValidDate(t){const s=this.normalizeDate(t);let i,e=s.includes("-"),n=s.split(" ");return i=e?n[0].replace(/-/g,"/"):n[0],!isNaN(Date.parse(i))}number(t){return salla.helpers.number(t,"en"===this.digits)}startCountDown(){const t=this.normalizeDate(this.date),s=t.includes("-"),i=this.endOfDay||1===t.split(" ").length;let e;if(s){const s=i?`${t.split(" ")[0]}T23:59:59+03:00`:`${t.replace(" ","T")}+03:00`;e=new Date(s).getTime()}else{const s=new Date(t);i&&s.setHours(23,59,59,999),e=s.getTime()}if(Number.isNaN(e))return salla.logger.warn(`[salla-count-down] unable to parse date: "${this.date}"`),void(this.parseFailed=!0);const n=()=>{const t=e-Date.now(),s=Math.floor(t/864e5),i=Math.floor(t%864e5/36e5);this.days=this.number(s),this.hours=this.number(i),this.minutes=this.number(Math.floor(t%36e5/6e4)),this.seconds=this.number(Math.floor(t%6e4/1e3)),this.autoSegments&&(this.showDays=s>0,this.showHours=s>0||i>0),t<0&&this.endCountDown()};this.countInterval=setInterval(n,1e3),n()}renderCountDown(){const t=this.boxTheme?`var(--color-${this.boxTheme})`:this.boxColor,i=this.boxed&&t?{backgroundColor:t}:void 0;return s("ul",{class:`s-count-down-list ${this.boxed?"s-count-down-boxed":""} ${this.offerEnded?"s-count-down-ended":""} s-count-down-${this.size} s-count-down-${this.color}`,style:this.listPadding?{paddingLeft:this.listPadding,paddingRight:this.listPadding}:void 0},s("li",{class:"s-count-down-item",style:i},s("div",{class:"s-count-down-item-value"},this.seconds),this.labeled&&s("div",{class:"s-count-down-item-label"},this.secondsLabel)),s("li",{class:"s-count-down-item",style:i},s("div",{class:"s-count-down-item-value"},this.minutes),this.labeled&&s("div",{class:"s-count-down-item-label"},this.minutesLabel)),(!this.autoSegments||this.showHours)&&s("li",{class:"s-count-down-item",style:i},s("div",{class:"s-count-down-item-value"},this.hours),this.labeled&&s("div",{class:"s-count-down-item-label"},this.hoursLabel)),(!this.autoSegments||this.showDays)&&s("li",{class:"s-count-down-item",style:i},s("div",{class:"s-count-down-item-value"},this.days),this.labeled&&s("div",{class:"s-count-down-item-label"},this.daysLabel)))}renderInvalidDate(){return s("div",{class:"s-count-down-text-center"},this.invalidDate)}renderOfferEnded(){return s("div",{class:"s-count-down-end-text"},this.endText?this.endText:this.endLabel)}renderPreOrderToBeAvailableOn(){return this.normalizedPreOrder?.availability_date&&this.isValidDate(this.normalizedPreOrder?.availability_date)?s("div",{class:"s-count-down-info-message"},s("i",{class:"sicon-info"}),s("span",null,salla.lang.getWithDefault("pages.products.expected_to_be","متوقَّع توفُّره بتاريخ:")),s("span",null,new Date(this.normalizedPreOrder?.availability_date).toLocaleDateString(salla.lang.locale,{weekday:"long",year:"numeric",month:"long",day:"numeric"}))):null}renderPreOrderCountDown(){return this.normalizedPreOrder?.activate_countdown?s("div",{class:"s-count-down-pre-order-container"},s("p",{class:"text-sm "},salla.lang.getWithDefault("pages.products.pre_order_ends_in","ينتهي الطلب المسبق خلال:")),this.renderCountDown()):null}renderPreOrder(){return s("div",null,"object"==typeof this.normalizedPreOrder&&this.normalizedPreOrder?.availability_date&&this.renderPreOrderToBeAvailableOn(),this.renderPreOrderCountDown())}renderPrefixText(){return this.prefixText?s("span",{class:"s-count-down-prefix-text"},this.prefixText):null}renderButton(){return this.withButton&&this.buttonText?s("salla-button",{color:"primary",size:"medium",href:this.buttonHref},this.buttonIcon?s("i",{class:this.buttonIcon}):null,s("span",null,this.buttonText)):null}renderContent(){return this.date?!this.isValidDate(this.date)||this.parseFailed?this.renderInvalidDate():this.preOrder?this.renderPreOrder():this.renderCountDown():null}render(){return s(i,{key:"16f2244e2e1b828cd80a186528726a089146acff",class:`s-count-down-wrapper ${this.preOrder&&this.isValidDate(this.date)?"s-count-down-pre-order":""} ${this.horizontal?"s-count-down-horizontal":""} ${this.withButton?"s-count-down-with-button":""} ${this.offerEnded?"s-count-down-ended":""}`},this.renderPrefixText(),this.renderContent(),this.offerEnded&&this.renderOfferEnded(),this.renderButton())}};e.style=".s-count-down-horizontal{background-color:rgba(0, 0, 0, 0.06);background-color:color-mix(in srgb, var(--color-primary) 10%, transparent)}";export{e as salla_count_down}
4
+ import{r as t,h as s,H as i}from"./p-CNVLmZO5.js";const e=class{constructor(s){t(this,s),this.size="md",this.color="dark",this.digits="auto",this.autoSegments=!1,this.daysLabel=salla.lang.getWithDefault("pages.checkout.day","يوم"),this.hoursLabel=salla.lang.getWithDefault("pages.checkout.hour","ساعة"),this.minutesLabel=salla.lang.getWithDefault("pages.checkout.minute","دقيقة"),this.secondsLabel=salla.lang.getWithDefault("pages.checkout.second","ثانية"),this.endLabel=salla.lang.getWithDefault("pages.checkout.offer_ended","انتهت مدة العرض"),this.invalidDate=salla.lang.getWithDefault("blocks.buy_as_gift.incorrect_date","الرجاء إدخال الموعد بشكل صحيح"),this.offerEnded=!1,this.parseFailed=!1,this.showDays=!0,this.showHours=!0,this.days=this.number(0),this.hours=this.number(0),this.minutes=this.number(0),this.seconds=this.number(0),salla.lang.onLoaded((()=>{this.daysLabel=salla.lang.getWithDefault("pages.checkout.day","يوم"),this.hoursLabel=salla.lang.getWithDefault("pages.checkout.hour","ساعة"),this.minutesLabel=salla.lang.getWithDefault("pages.checkout.minute","دقيقة"),this.invalidDate=salla.lang.getWithDefault("blocks.buy_as_gift.incorrect_date","الرجاء إدخال الموعد بشكل صحيح"),this.secondsLabel=salla.lang.getWithDefault("pages.checkout.second","ثانية"),this.endLabel=salla.lang.getWithDefault("pages.checkout.offer_ended","انتهت مدة العرض")})),this.date&&this.isValidDate(this.date)&&this.startCountDown()}async endCountDown(){clearInterval(this.countInterval),this.offerEnded=!0,this.days=this.number(0),this.hours=this.number(0),this.minutes=this.number(0),this.seconds=this.number(0)}componentWillLoad(){if("string"==typeof this.preOrder)try{this.normalizedPreOrder=JSON.parse(this.preOrder)}catch{this.normalizedPreOrder=void 0}else this.normalizedPreOrder=this.preOrder;this.normalizedPreOrder?.end_date&&(this.date=this.normalizedPreOrder.end_date),this.date&&this.isValidDate(this.date)&&this.startCountDown()}normalizeDate(t){const s=t.match(/^(\d{1,2})-(\d{1,2})-(\d{4}),(\d{1,2}):(\d{2}):(\d{2})\s*(am|pm)$/i);if(s){const[,t,i,e,n,h,o,a]=s;let r=parseInt(n,10);"pm"===a.toLowerCase()&&r<12&&(r+=12),"am"===a.toLowerCase()&&12===r&&(r=0);const l=String(r).padStart(2,"0");return`${e}-${String(t).padStart(2,"0")}-${String(i).padStart(2,"0")} ${l}:${h}:${o}`}const i=t.match(/^(\d{1,2})-(\d{1,2})-(\d{4})$/);if(i){const[,t,s,e]=i;return`${e}-${String(t).padStart(2,"0")}-${String(s).padStart(2,"0")}`}const e=t.match(/^(\d{4})-(\d{1,2})-(\d{1,2})(?:[ T](\d{1,2}:\d{2}:\d{2}))?$/);if(e){const[,t,s,i,n]=e,h=String(s).padStart(2,"0"),o=String(i).padStart(2,"0");return n?`${t}-${h}-${o} ${n}`:`${t}-${h}-${o}`}return t}isValidDate(t){const s=this.normalizeDate(t);let i,e=s.includes("-"),n=s.split(" ");return i=e?n[0].replace(/-/g,"/"):n[0],!isNaN(Date.parse(i))}number(t){return salla.helpers.number(t,"en"===this.digits)}startCountDown(){const t=this.normalizeDate(this.date),s=t.includes("-"),i=this.endOfDay||1===t.split(" ").length;let e;if(s){const s=i?`${t.split(" ")[0]}T23:59:59+03:00`:`${t.replace(" ","T")}+03:00`;e=new Date(s).getTime()}else{const s=new Date(t);i&&s.setHours(23,59,59,999),e=s.getTime()}if(Number.isNaN(e))return salla.logger.warn(`[salla-count-down] unable to parse date: "${this.date}"`),void(this.parseFailed=!0);const n=()=>{const t=e-Date.now(),s=Math.floor(t/864e5),i=Math.floor(t%864e5/36e5);this.days=this.number(s),this.hours=this.number(i),this.minutes=this.number(Math.floor(t%36e5/6e4)),this.seconds=this.number(Math.floor(t%6e4/1e3)),this.autoSegments&&(this.showDays=s>0,this.showHours=s>0||i>0),t<0&&this.endCountDown()};this.countInterval=setInterval(n,1e3),n()}renderCountDown(){const t=this.boxTheme?`var(--color-${this.boxTheme})`:this.boxColor,i=this.boxed&&t?{backgroundColor:t}:void 0;return s("ul",{class:`s-count-down-list ${this.boxed?"s-count-down-boxed":""} ${this.offerEnded?"s-count-down-ended":""} s-count-down-${this.size} s-count-down-${this.color}`,style:this.listPadding?{paddingLeft:this.listPadding,paddingRight:this.listPadding}:void 0},s("li",{class:"s-count-down-item",style:i},s("div",{class:"s-count-down-item-value"},this.seconds),this.labeled&&s("div",{class:"s-count-down-item-label"},this.secondsLabel)),s("li",{class:"s-count-down-item",style:i},s("div",{class:"s-count-down-item-value"},this.minutes),this.labeled&&s("div",{class:"s-count-down-item-label"},this.minutesLabel)),(!this.autoSegments||this.showHours)&&s("li",{class:"s-count-down-item",style:i},s("div",{class:"s-count-down-item-value"},this.hours),this.labeled&&s("div",{class:"s-count-down-item-label"},this.hoursLabel)),(!this.autoSegments||this.showDays)&&s("li",{class:"s-count-down-item",style:i},s("div",{class:"s-count-down-item-value"},this.days),this.labeled&&s("div",{class:"s-count-down-item-label"},this.daysLabel)))}renderInvalidDate(){return s("div",{class:"s-count-down-text-center"},this.invalidDate)}renderOfferEnded(){return s("div",{class:"s-count-down-end-text"},this.endText?this.endText:this.endLabel)}renderPreOrderToBeAvailableOn(){return this.normalizedPreOrder?.availability_date&&this.isValidDate(this.normalizedPreOrder?.availability_date)?s("div",{class:"s-count-down-info-message"},s("i",{class:"sicon-info"}),s("span",null,salla.lang.getWithDefault("pages.products.expected_to_be","متوقَّع توفُّره بتاريخ:")),s("span",null,new Date(this.normalizedPreOrder?.availability_date).toLocaleDateString(salla.lang.locale,{weekday:"long",year:"numeric",month:"long",day:"numeric"}))):null}renderPreOrderCountDown(){return this.normalizedPreOrder?.activate_countdown?s("div",{class:"s-count-down-pre-order-container"},s("p",{class:"text-sm "},salla.lang.getWithDefault("pages.products.pre_order_ends_in","ينتهي الطلب المسبق خلال:")),this.renderCountDown()):null}renderPreOrder(){return s("div",null,"object"==typeof this.normalizedPreOrder&&this.normalizedPreOrder?.availability_date&&this.renderPreOrderToBeAvailableOn(),this.renderPreOrderCountDown())}renderPrefixText(){return this.prefixText?s("span",{class:"s-count-down-prefix-text"},this.prefixText):null}renderButton(){return this.withButton&&this.buttonText?s("salla-button",{color:"primary",size:"medium",href:this.buttonHref},this.buttonIcon?s("i",{class:this.buttonIcon}):null,s("span",null,this.buttonText)):null}renderContent(){return this.date?!this.isValidDate(this.date)||this.parseFailed?this.renderInvalidDate():this.preOrder?this.renderPreOrder():this.renderCountDown():null}render(){return s(i,{key:"16f2244e2e1b828cd80a186528726a089146acff",class:`s-count-down-wrapper ${this.preOrder&&this.isValidDate(this.date)?"s-count-down-pre-order":""} ${this.horizontal?"s-count-down-horizontal":""} ${this.withButton?"s-count-down-with-button":""} ${this.offerEnded?"s-count-down-ended":""}`},this.renderPrefixText(),this.renderContent(),this.offerEnded&&this.renderOfferEnded(),this.renderButton())}};e.style=".s-count-down-horizontal{background-color:rgba(0, 0, 0, 0.06);background-color:color-mix(in srgb, var(--color-primary) 10%, transparent)}";export{e as salla_count_down}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as s,h as t,F as e}from"./p-B_Rg7VI5.js";const l=class{constructor(t){s(this,t),this.source="header",this.useReactLink=!1,this.menus=[]}async componentWillLoad(){return salla.onReady((()=>{if(this.displayAllText=salla.lang.get("blocks.home.display_all"),!this.sourceValue||"json"!==this.source)return this.getMenuItems();this.menus="string"==typeof this.sourceValue?JSON.parse(this.sourceValue):this.sourceValue||[]}))}getMenuItems(){return salla.api.component.getMenus(this.source).then((({data:s})=>{this.menus=s})).catch((s=>{salla.logger.error("salla-menu::Error fetching menus",s)}))}hasChildren(s){return s?.children?.length>0}hasProducts(s){return s?.products?.length>0}getDesktopClasses(s,t){return`!hidden lg:!block ${t?"root-level lg:!inline-block":"relative"} ${s.products?" mega-menu":""}\n ${this.hasChildren(s)?"has-children":""}`}getAttributes(s){return s.trim().split(" ").reduce(((s,t)=>{let[e,l]=t.split("=");return s[e]=l.replace(/"/g,""),s}),{})}getMobileMenu(s,l){const i=s.image?t("img",{src:s.image,class:"rounded-full",width:"48",height:"48",alt:s.title}):null;return t("li",{class:"lg:hidden text-sm font-bold",...this.getAttributes(s.attrs)},this.hasChildren(s)?t(e,null,t("span",{class:s.image?"!py-3":""},i,s.title),t("ul",null,t("li",{class:"text-sm font-bold"},t("a",{href:s.url,class:"text-gray-500"},l)),s.children.map((s=>this.getMobileMenu(s,l))))):t("a",{href:s.url,"aria-label":s.title||"category",class:"text-gray-500 "+(s.image?"!py-3":""),...this.getAttributes(s.link_attrs)},i,t("span",null,s.title||"")))}getDesktopMenu(s,e){return t("li",{class:this.getDesktopClasses(s,e),...this.getAttributes(s.attrs)},t("a",{href:s.url,"aria-label":s.title||"category",...this.getAttributes(s.link_attrs)},t("span",null,s.title)),this.hasChildren(s)?t("div",{class:"sub-menu shadow-default "+(this.hasProducts(s)?"w-full left-0 flex":"w-56")},t("ul",{class:this.hasProducts(s)?"w-56 shrink-0 m-8 rtl:ml-0 ltr:mr-0":""},s.children.map((s=>this.getDesktopMenu(s,!1)))),this.hasProducts(s)?t("salla-products-list",{source:"selected","shadow-on-hover":!0,"source-value":`[${s.products}]`}):null):null)}getFooterMenu(s){const e=this.topnav||this.limit?s.slice(0,this.limit||3):s;return t("div",null,t("div",{class:{"s-menu-footer-list":!this.topnav,"s-menu-topnav-list":this.topnav}},e.map((s=>t("a",{key:s.id,href:s.url,target:s.target,class:{"s-menu-footer-item":!this.topnav,"s-menu-topnav-item topnav-link-item right-side":this.topnav}},s.title)))))}getHeaderMenu(s){return s.map((s=>[this.getMobileMenu(s,this.displayAllText),this.getDesktopMenu(s,!0)]))}render(){return"footer"===this.source?this.getFooterMenu(this.menus):[t("nav",{key:"main-nav",id:"mobile-menu",class:"mobile-menu"},t("ul",{class:"main-menu"},this.getHeaderMenu(this.menus)),t("button",{class:"btn--close close-mobile-menu sicon-cancel lg:hidden"})),t("button",{key:"close-btn",class:"btn--close-sm close-mobile-menu sicon-cancel hidden"})]}};l.style=":host{display:block}";export{l as salla_menu}
4
+ import{r as s,h as t,F as e}from"./p-CNVLmZO5.js";const l=class{constructor(t){s(this,t),this.source="header",this.useReactLink=!1,this.menus=[]}async componentWillLoad(){return salla.onReady((()=>{if(this.displayAllText=salla.lang.get("blocks.home.display_all"),!this.sourceValue||"json"!==this.source)return this.getMenuItems();this.menus="string"==typeof this.sourceValue?JSON.parse(this.sourceValue):this.sourceValue||[]}))}getMenuItems(){return salla.api.component.getMenus(this.source).then((({data:s})=>{this.menus=s})).catch((s=>{salla.logger.error("salla-menu::Error fetching menus",s)}))}hasChildren(s){return s?.children?.length>0}hasProducts(s){return s?.products?.length>0}getDesktopClasses(s,t){return`!hidden lg:!block ${t?"root-level lg:!inline-block":"relative"} ${s.products?" mega-menu":""}\n ${this.hasChildren(s)?"has-children":""}`}getAttributes(s){return s.trim().split(" ").reduce(((s,t)=>{let[e,l]=t.split("=");return s[e]=l.replace(/"/g,""),s}),{})}getMobileMenu(s,l){const i=s.image?t("img",{src:s.image,class:"rounded-full",width:"48",height:"48",alt:s.title}):null;return t("li",{class:"lg:hidden text-sm font-bold",...this.getAttributes(s.attrs)},this.hasChildren(s)?t(e,null,t("span",{class:s.image?"!py-3":""},i,s.title),t("ul",null,t("li",{class:"text-sm font-bold"},t("a",{href:s.url,class:"text-gray-500"},l)),s.children.map((s=>this.getMobileMenu(s,l))))):t("a",{href:s.url,"aria-label":s.title||"category",class:"text-gray-500 "+(s.image?"!py-3":""),...this.getAttributes(s.link_attrs)},i,t("span",null,s.title||"")))}getDesktopMenu(s,e){return t("li",{class:this.getDesktopClasses(s,e),...this.getAttributes(s.attrs)},t("a",{href:s.url,"aria-label":s.title||"category",...this.getAttributes(s.link_attrs)},t("span",null,s.title)),this.hasChildren(s)?t("div",{class:"sub-menu shadow-default "+(this.hasProducts(s)?"w-full left-0 flex":"w-56")},t("ul",{class:this.hasProducts(s)?"w-56 shrink-0 m-8 rtl:ml-0 ltr:mr-0":""},s.children.map((s=>this.getDesktopMenu(s,!1)))),this.hasProducts(s)?t("salla-products-list",{source:"selected","shadow-on-hover":!0,"source-value":`[${s.products}]`}):null):null)}getFooterMenu(s){const e=this.topnav||this.limit?s.slice(0,this.limit||3):s;return t("div",null,t("div",{class:{"s-menu-footer-list":!this.topnav,"s-menu-topnav-list":this.topnav}},e.map((s=>t("a",{key:s.id,href:s.url,target:s.target,class:{"s-menu-footer-item":!this.topnav,"s-menu-topnav-item topnav-link-item right-side":this.topnav}},s.title)))))}getHeaderMenu(s){return s.map((s=>[this.getMobileMenu(s,this.displayAllText),this.getDesktopMenu(s,!0)]))}render(){return"footer"===this.source?this.getFooterMenu(this.menus):[t("nav",{key:"main-nav",id:"mobile-menu",class:"mobile-menu"},t("ul",{class:"main-menu"},this.getHeaderMenu(this.menus)),t("button",{class:"btn--close close-mobile-menu sicon-cancel lg:hidden"})),t("button",{key:"close-btn",class:"btn--close-sm close-mobile-menu sicon-cancel hidden"})]}};l.style=":host{display:block}";export{l as salla_menu}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as s,h as t}from"./p-B_Rg7VI5.js";import{S as a}from"./p-BZp0rKEO.js";const e=class{constructor(t){s(this,t),this.codeCopied=null,this.noItemFound=!0,this.order_items=[],this.isDigitalCard=s=>"codes"===s.product.type,this.isDigitalProduct=s=>"digital"===s.product.type}async componentWillLoad(){return salla.lang.onLoaded((()=>{this.codes_text=salla.lang.get("pages.thank_you.codes"),this.copy_text=salla.lang.get("common.elements.copy"),this.files_text=salla.lang.get("pages.thank_you.files"),this.download_text=salla.lang.get("pages.thank_you.download")})),await this.getOrderItems()}copyToClipboardHandler(s){if(navigator&&"clipboard"in navigator)try{navigator.clipboard.writeText(s).then((()=>{this.codeCopied=s,this.copyCodeButtonTimeout=setTimeout((()=>{this.codeCopied=null}),3e3)}))}catch(s){salla.loggers.error("copy functionality is not supported by the browser")}}async getOrderItems(){const s=this.orderId||salla.config.get("page.id"),t="Failed to fetch order items";if(!s)throw salla.logger.error(t),new Error(t);try{const{data:{items:t=[]}}=await salla.api.request(`orders/${s}`);t.some((s=>this.isDigitalCard(s)||this.isDigitalProduct(s)))&&(this.order_items=t,this.noItemFound=!1)}catch(s){salla.logger.error(t)}}disconnectedCallback(){this.copyCodeButtonTimeout&&clearTimeout(this.copyCodeButtonTimeout)}render(){return t("ul",{key:"bb8c8e2c3a44f0922012789efc9a73d71fd213d5",class:"s-order-summary-wrapper"},this.noItemFound?t("salla-placeholder",{alignment:"center"},t("span",{slot:"title"})):this.order_items.map((s=>this.isDigitalCard(s)?t("li",{key:s.product.id,class:"s-order-summary-item"},t("h2",{class:"s-order-summary-item-title"},this.codes_text," (",s.name,")"),s.codes.map((s=>t("div",{key:s.code,class:"s-order-summary-code-item-wrapper"},t("p",null,t("span",{innerHTML:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>debit-card-back</title>\n<path d="M30 28h-28c-1.105 0-2-0.895-2-2v0-18c0-1.105 0.895-2 2-2v0h28c1.105 0 2 0.895 2 2v0 18c0 1.105-0.895 2-2 2v0zM30 26v0zM2 8v18h28v-18zM31 14h-30c-0.552 0-1-0.448-1-1s0.448-1 1-1v0h30c0.552 0 1 0.448 1 1s-0.448 1-1 1v0zM11 22h-6c-0.552 0-1-0.448-1-1s0.448-1 1-1v0h6c0.552 0 1 0.448 1 1s-0.448 1-1 1v0zM24 24c-2.209 0-4-1.791-4-4s1.791-4 4-4c2.209 0 4 1.791 4 4v0c0 2.209-1.791 4-4 4v0zM24 18c-1.105 0-2 0.895-2 2s0.895 2 2 2c1.105 0 2-0.895 2-2v0c0-1.105-0.895-2-2-2v0zM20 24c-2.209 0-4-1.791-4-4s1.791-4 4-4v0c0.002 0 0.005 0 0.007 0 1.032 0 1.972 0.398 2.673 1.048l-0.003-0.002c0.191 0.183 0.311 0.439 0.311 0.724 0 0.552-0.448 1-1 1-0.257 0-0.492-0.097-0.669-0.257l0.001 0.001c-0.345-0.319-0.807-0.514-1.315-0.514-0.002 0-0.003 0-0.005 0h0c-1.105 0-2 0.895-2 2s0.895 2 2 2v0c0.002 0 0.004 0 0.007 0 0.508 0 0.971-0.195 1.317-0.515l-0.001 0.001c0.179-0.171 0.422-0.276 0.689-0.276 0.552 0 1 0.448 1 1 0 0.295-0.128 0.56-0.331 0.743l-0.001 0.001c-0.699 0.648-1.638 1.046-2.671 1.046-0.003 0-0.007 0-0.010 0h0.001z"></path>\n</svg>\n'}),t("span",null,s.code)),t("salla-button",{class:"s-order-summary-item-copy-button "+(this.codeCopied===s.code?"copied":""),onClick:()=>this.copyToClipboardHandler(s.code),shape:"link"},t("span",{innerHTML:this.codeCopied===s.code?a:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>swap-stroke</title>\n<path d="M6.667 18.667h-2.667c-0.736 0-1.333-0.597-1.333-1.333v-13.333c0-0.736 0.597-1.333 1.333-1.333h13.333c0.736 0 1.333 0.597 1.333 1.333v2.667c0 0.737 0.596 1.333 1.333 1.333s1.333-0.596 1.333-1.333v-2.667c0-2.205-1.795-4-4-4h-13.333c-2.205 0-4 1.795-4 4v13.333c0 2.205 1.795 4 4 4h2.667c0.737 0 1.333-0.596 1.333-1.333s-0.596-1.333-1.333-1.333zM28 10.667h-13.333c-2.205 0-4 1.795-4 4v13.333c0 2.205 1.795 4 4 4h13.333c2.205 0 4-1.795 4-4v-13.333c0-2.205-1.795-4-4-4zM29.333 28c0 0.736-0.597 1.333-1.333 1.333h-13.333c-0.736 0-1.333-0.597-1.333-1.333v-13.333c0-0.736 0.597-1.333 1.333-1.333h13.333c0.736 0 1.333 0.597 1.333 1.333z"></path>\n</svg>\n'}),t("span",null,this.copy_text)))))):this.isDigitalProduct(s)?t("li",{key:s.product.id,class:"s-order-summary-item"},t("h2",{class:"s-order-summary-item-title"},this.files_text," (",s.name,")"),t("ul",null,s.files.map((s=>t("li",{class:"s-order-summary-digital-item-wrapper"},t("div",null,t("span",{innerHTML:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>file-archive</title>\n<path d="M17.333 16h-5.333c-0.737 0-1.333 0.597-1.333 1.333v2.667c0 2.205 1.795 4 4 4s4-1.795 4-4v-2.667c0-0.736-0.596-1.333-1.333-1.333zM16 20c0 0.735-0.597 1.333-1.333 1.333s-1.333-0.599-1.333-1.333v-1.333h2.667zM17.333 12h-5.333c-0.737 0-1.333 0.597-1.333 1.333s0.596 1.333 1.333 1.333h5.333c0.737 0 1.333-0.597 1.333-1.333s-0.596-1.333-1.333-1.333zM28.943 8.391l-8-8c-0.249-0.251-0.588-0.391-0.943-0.391h-13.333c-2.205 0-4 1.795-4 4v24c0 2.205 1.795 4 4 4h18.667c2.205 0 4-1.795 4-4v-18.667c0-0.353-0.14-0.693-0.391-0.943zM26.667 28c0 0.735-0.597 1.333-1.333 1.333h-18.667c-0.736 0-1.333-0.599-1.333-1.333v-24c0-0.735 0.597-1.333 1.333-1.333h12.781l7.219 7.219zM17.333 8h-5.333c-0.737 0-1.333 0.597-1.333 1.333s0.596 1.333 1.333 1.333h5.333c0.737 0 1.333-0.597 1.333-1.333s-0.596-1.333-1.333-1.333zM17.333 4h-5.333c-0.737 0-1.333 0.597-1.333 1.333s0.596 1.333 1.333 1.333h5.333c0.737 0 1.333-0.597 1.333-1.333s-0.596-1.333-1.333-1.333z"></path>\n</svg>\n'}),t("span",null,s.name)),t("a",{href:s.url,target:"_blank",class:"s-order-summary-item-download"},t("span",{innerHTML:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>download</title>\n<path d="M15.056 20.941c0.123 0.124 0.271 0.221 0.435 0.289 0.163 0.067 0.336 0.103 0.509 0.103s0.347-0.036 0.509-0.103c0.164-0.068 0.311-0.165 0.435-0.289l5.332-5.332c0.521-0.521 0.521-1.364 0-1.885s-1.364-0.521-1.885 0l-3.057 3.057v-12.781c0-0.737-0.597-1.333-1.333-1.333s-1.333 0.596-1.333 1.333v12.781l-3.057-3.057c-0.521-0.521-1.364-0.521-1.885 0s-0.521 1.364 0 1.885zM25.333 26.667h-18.667c-0.736 0-1.333 0.596-1.333 1.333s0.597 1.333 1.333 1.333h18.667c0.736 0 1.333-0.596 1.333-1.333s-0.597-1.333-1.333-1.333z"></path>\n</svg>\n'}),t("span",null,this.download_text))))))):null)))}};e.style=":host{display:block}";export{e as salla_order_summary}
4
+ import{r as s,h as t}from"./p-CNVLmZO5.js";import{S as a}from"./p-BZp0rKEO.js";const e=class{constructor(t){s(this,t),this.codeCopied=null,this.noItemFound=!0,this.order_items=[],this.isDigitalCard=s=>"codes"===s.product.type,this.isDigitalProduct=s=>"digital"===s.product.type}async componentWillLoad(){return salla.lang.onLoaded((()=>{this.codes_text=salla.lang.get("pages.thank_you.codes"),this.copy_text=salla.lang.get("common.elements.copy"),this.files_text=salla.lang.get("pages.thank_you.files"),this.download_text=salla.lang.get("pages.thank_you.download")})),await this.getOrderItems()}copyToClipboardHandler(s){if(navigator&&"clipboard"in navigator)try{navigator.clipboard.writeText(s).then((()=>{this.codeCopied=s,this.copyCodeButtonTimeout=setTimeout((()=>{this.codeCopied=null}),3e3)}))}catch(s){salla.loggers.error("copy functionality is not supported by the browser")}}async getOrderItems(){const s=this.orderId||salla.config.get("page.id"),t="Failed to fetch order items";if(!s)throw salla.logger.error(t),new Error(t);try{const{data:{items:t=[]}}=await salla.api.request(`orders/${s}`);t.some((s=>this.isDigitalCard(s)||this.isDigitalProduct(s)))&&(this.order_items=t,this.noItemFound=!1)}catch(s){salla.logger.error(t)}}disconnectedCallback(){this.copyCodeButtonTimeout&&clearTimeout(this.copyCodeButtonTimeout)}render(){return t("ul",{key:"bb8c8e2c3a44f0922012789efc9a73d71fd213d5",class:"s-order-summary-wrapper"},this.noItemFound?t("salla-placeholder",{alignment:"center"},t("span",{slot:"title"})):this.order_items.map((s=>this.isDigitalCard(s)?t("li",{key:s.product.id,class:"s-order-summary-item"},t("h2",{class:"s-order-summary-item-title"},this.codes_text," (",s.name,")"),s.codes.map((s=>t("div",{key:s.code,class:"s-order-summary-code-item-wrapper"},t("p",null,t("span",{innerHTML:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>debit-card-back</title>\n<path d="M30 28h-28c-1.105 0-2-0.895-2-2v0-18c0-1.105 0.895-2 2-2v0h28c1.105 0 2 0.895 2 2v0 18c0 1.105-0.895 2-2 2v0zM30 26v0zM2 8v18h28v-18zM31 14h-30c-0.552 0-1-0.448-1-1s0.448-1 1-1v0h30c0.552 0 1 0.448 1 1s-0.448 1-1 1v0zM11 22h-6c-0.552 0-1-0.448-1-1s0.448-1 1-1v0h6c0.552 0 1 0.448 1 1s-0.448 1-1 1v0zM24 24c-2.209 0-4-1.791-4-4s1.791-4 4-4c2.209 0 4 1.791 4 4v0c0 2.209-1.791 4-4 4v0zM24 18c-1.105 0-2 0.895-2 2s0.895 2 2 2c1.105 0 2-0.895 2-2v0c0-1.105-0.895-2-2-2v0zM20 24c-2.209 0-4-1.791-4-4s1.791-4 4-4v0c0.002 0 0.005 0 0.007 0 1.032 0 1.972 0.398 2.673 1.048l-0.003-0.002c0.191 0.183 0.311 0.439 0.311 0.724 0 0.552-0.448 1-1 1-0.257 0-0.492-0.097-0.669-0.257l0.001 0.001c-0.345-0.319-0.807-0.514-1.315-0.514-0.002 0-0.003 0-0.005 0h0c-1.105 0-2 0.895-2 2s0.895 2 2 2v0c0.002 0 0.004 0 0.007 0 0.508 0 0.971-0.195 1.317-0.515l-0.001 0.001c0.179-0.171 0.422-0.276 0.689-0.276 0.552 0 1 0.448 1 1 0 0.295-0.128 0.56-0.331 0.743l-0.001 0.001c-0.699 0.648-1.638 1.046-2.671 1.046-0.003 0-0.007 0-0.010 0h0.001z"></path>\n</svg>\n'}),t("span",null,s.code)),t("salla-button",{class:"s-order-summary-item-copy-button "+(this.codeCopied===s.code?"copied":""),onClick:()=>this.copyToClipboardHandler(s.code),shape:"link"},t("span",{innerHTML:this.codeCopied===s.code?a:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>swap-stroke</title>\n<path d="M6.667 18.667h-2.667c-0.736 0-1.333-0.597-1.333-1.333v-13.333c0-0.736 0.597-1.333 1.333-1.333h13.333c0.736 0 1.333 0.597 1.333 1.333v2.667c0 0.737 0.596 1.333 1.333 1.333s1.333-0.596 1.333-1.333v-2.667c0-2.205-1.795-4-4-4h-13.333c-2.205 0-4 1.795-4 4v13.333c0 2.205 1.795 4 4 4h2.667c0.737 0 1.333-0.596 1.333-1.333s-0.596-1.333-1.333-1.333zM28 10.667h-13.333c-2.205 0-4 1.795-4 4v13.333c0 2.205 1.795 4 4 4h13.333c2.205 0 4-1.795 4-4v-13.333c0-2.205-1.795-4-4-4zM29.333 28c0 0.736-0.597 1.333-1.333 1.333h-13.333c-0.736 0-1.333-0.597-1.333-1.333v-13.333c0-0.736 0.597-1.333 1.333-1.333h13.333c0.736 0 1.333 0.597 1.333 1.333z"></path>\n</svg>\n'}),t("span",null,this.copy_text)))))):this.isDigitalProduct(s)?t("li",{key:s.product.id,class:"s-order-summary-item"},t("h2",{class:"s-order-summary-item-title"},this.files_text," (",s.name,")"),t("ul",null,s.files.map((s=>t("li",{class:"s-order-summary-digital-item-wrapper"},t("div",null,t("span",{innerHTML:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>file-archive</title>\n<path d="M17.333 16h-5.333c-0.737 0-1.333 0.597-1.333 1.333v2.667c0 2.205 1.795 4 4 4s4-1.795 4-4v-2.667c0-0.736-0.596-1.333-1.333-1.333zM16 20c0 0.735-0.597 1.333-1.333 1.333s-1.333-0.599-1.333-1.333v-1.333h2.667zM17.333 12h-5.333c-0.737 0-1.333 0.597-1.333 1.333s0.596 1.333 1.333 1.333h5.333c0.737 0 1.333-0.597 1.333-1.333s-0.596-1.333-1.333-1.333zM28.943 8.391l-8-8c-0.249-0.251-0.588-0.391-0.943-0.391h-13.333c-2.205 0-4 1.795-4 4v24c0 2.205 1.795 4 4 4h18.667c2.205 0 4-1.795 4-4v-18.667c0-0.353-0.14-0.693-0.391-0.943zM26.667 28c0 0.735-0.597 1.333-1.333 1.333h-18.667c-0.736 0-1.333-0.599-1.333-1.333v-24c0-0.735 0.597-1.333 1.333-1.333h12.781l7.219 7.219zM17.333 8h-5.333c-0.737 0-1.333 0.597-1.333 1.333s0.596 1.333 1.333 1.333h5.333c0.737 0 1.333-0.597 1.333-1.333s-0.596-1.333-1.333-1.333zM17.333 4h-5.333c-0.737 0-1.333 0.597-1.333 1.333s0.596 1.333 1.333 1.333h5.333c0.737 0 1.333-0.597 1.333-1.333s-0.596-1.333-1.333-1.333z"></path>\n</svg>\n'}),t("span",null,s.name)),t("a",{href:s.url,target:"_blank",class:"s-order-summary-item-download"},t("span",{innerHTML:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>download</title>\n<path d="M15.056 20.941c0.123 0.124 0.271 0.221 0.435 0.289 0.163 0.067 0.336 0.103 0.509 0.103s0.347-0.036 0.509-0.103c0.164-0.068 0.311-0.165 0.435-0.289l5.332-5.332c0.521-0.521 0.521-1.364 0-1.885s-1.364-0.521-1.885 0l-3.057 3.057v-12.781c0-0.737-0.597-1.333-1.333-1.333s-1.333 0.596-1.333 1.333v12.781l-3.057-3.057c-0.521-0.521-1.364-0.521-1.885 0s-0.521 1.364 0 1.885zM25.333 26.667h-18.667c-0.736 0-1.333 0.596-1.333 1.333s0.597 1.333 1.333 1.333h18.667c0.736 0 1.333-0.596 1.333-1.333s-0.597-1.333-1.333-1.333z"></path>\n</svg>\n'}),t("span",null,this.download_text))))))):null)))}};e.style=":host{display:block}";export{e as salla_order_summary}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as s,h as t,H as i,a as e,c as a}from"./p-B_Rg7VI5.js";import{A as r,a as l}from"./p-Vqpj4CWE.js";import{S as o}from"./p-8Tsmrwno.js";import{C as n}from"./p-BV4kqbdL.js";import{H as d}from"./p-CHf8XdiS.js";import"./p-CgtvEd63.js";const h=class{constructor(t){s(this,t),this.collapsible=!0,this.bordered=!1,this.size="md",this.collapsed=!0,this.dir=document.dir||"rtl"}directionChangedHandler(s){this.dir=s.detail.dir}handleCollapse(s){this.collapsed=s.detail.payload.collapsed}setcollapsibleProp(){const s=this.host.querySelector("salla-accordion-head");this.collapsible&&s&&(s.setAttribute("collapsible","true"),s.setAttribute("collapsed",this.collapsed.toString()))}componentDidRender(){this.setcollapsibleProp();const s=this.host.querySelector("salla-accordion-body");this.collapsible&&(this.host.setAttribute("data-collapsed",this.collapsed.toString()),s?.setAttribute("data-collapsed",this.collapsed.toString()))}render(){return t(i,{key:"fb12197f13d8836304bfebb14400c79c8c4d31f0",class:`s-accordion-wrapper ${this.dir} ${this.bordered?"s-accordion-wrapper-bordered":""} ${this.size?`size-${this.size}`:""}`,"data-collapsed":this.collapsed.toString()},t("slot",{key:"460e8d7238bf9f014fe0bbb6c0da592c8cb3e15e"}))}get host(){return e(this)}};h.style="";const c=class{constructor(t){s(this,t),this.sessionStorageKey="breadcrumb_snapshot",this.itemSlot=this.host.querySelector('[slot="item"]')?.outerHTML||'<li class="s-breadcrumb-item"><a href={url}>{title}</a></li>',this.iconSlot=this.host.querySelector('[slot="icon"]')?.outerHTML}componentWillLoad(){return new Promise((s=>salla.onReady((()=>salla.lang.onLoaded(s))))).then((()=>{if(salla.url.is_page("index"))throw new Error("salla-breadcrumb:: breadcrumb not supported on home page")})).then((()=>{if(!salla.config.get("theme.settings.is_breadcrumbs_enabled",!0))throw new Error("salla-breadcrumb:: merchant disabled the feature")})).then((()=>{const s=salla.config.get("page");if(!s||!s.slug)return salla.logger.error('salla-breadcrumbs:: page object not existed on salla.config.get("page")!'),void(this.breadcrumbs=[]);let t=this.getSessionBreadcrumbs(),i=t[t.length-1];return"product.single"===s.slug&&t&&t.length>0&&i?.url&&s.parent?.url&&i.url===s.parent.url?(t.push({title:s.title,url:s.url}),this.breadcrumbs=this.setBreadcrumbsFromArray(t),this.storeBreadcrumbSnapshot()):t&&t.length>0?this.isNewPage(s,t)?(this.breadcrumbs=this.generateBreadcrumbs(s),this.storeBreadcrumbSnapshot()):this.breadcrumbs=this.setBreadcrumbsFromArray(t):(this.breadcrumbs=this.generateBreadcrumbs(s),this.storeBreadcrumbSnapshot()),this.breadcrumbs?.length&&(this.breadcrumbs[this.breadcrumbs.length-1].is_last=!0),this.breadcrumbs})).catch((s=>{salla.logger.error("salla-breadcrumb:: unexpected error!",s),this.breadcrumbs=[]}))}getSessionBreadcrumbs(){return"search-bar"===new URLSearchParams(window.location.search).get("from")?[]:JSON.parse(sessionStorage.getItem(this.sessionStorageKey)||"[]")}isNewPage(s,t){const i=t[t.length-1];return i?.url!==s.url}setBreadcrumbsFromArray(s){return s.map(((t,i)=>({...t,is_last:i===s.length-1})))}sanitizeBreadcrumbTitle(s,t=1){return s.includes("|")?s.split("|").map((s=>s.trim()))[t]:s.trim()}generateBreadcrumbs(s){let t=[];if("product.single"===s.slug){const t=this.getSessionBreadcrumbs(),i=t[t.length-1];if(t.length>0&&i?.url&&s.parent?.url&&i.url===s.parent.url)return this.setBreadcrumbsFromArray([...t,{title:s.title,url:s.url}])}let i=s;for(;i;)i.title&&t.unshift({title:i.title,url:i.url}),i=i.parent;return s.slug.includes("customer")&&"customer.profile"!==s.slug&&t.unshift({title:salla.lang.get("common.titles.profile"),url:salla.url.get("profile")}),s.slug.includes("blog")&&t.unshift({title:salla.lang.get("blocks.footer.blog"),url:salla.url.get("blog")}),"brands.single"===s.slug&&t.unshift({title:salla.lang.get("common.titles.brands"),url:salla.url.get("brands")}),s.title||"loyalty"!==s.slug||t.unshift({title:salla.lang.get("common.titles.loyalty_program"),url:salla.url.get("loyalty")}),t.unshift({title:salla.lang.get("common.titles.home"),url:salla.url.get("")}),t}storeBreadcrumbSnapshot(){try{const s=salla.config.get("page");if("product.single"===s?.slug)return;const t=[...this.breadcrumbs],i=t.length-1;i>=0&&(t[i].url=window.location.href);const e=JSON.stringify(t);sessionStorage.setItem(this.sessionStorageKey,e)}catch(s){salla.logger.error("salla-breadcrumb:: Failed to store breadcrumb snapshot in sessionStorage.",s)}}render(){return this.breadcrumbs.length<=1?(salla.log("salla-breadcrumb:: There is no breadcrumbs!"),null):t("ol",{class:{"s-breadcrumb-wrapper":!0,"s-breadcrumb-dark":salla.url.is_page("loyalty"),"s-breadcrumb-primary-reverse":salla.config.get("page.slug").includes("customer")}},this.breadcrumbs.map((s=>{const i="product.single"===salla.config.get("page.slug")&&s.is_last?s.title:this.sanitizeBreadcrumbTitle(s.title),e=this.itemSlot.replace(/\{url\}/g,s.url).replace(/\{title\}/g,i);return[t("div",{class:"s-breadcrumb-slot",innerHTML:e}),this.getArrowDomForItem(s)]})))}getArrowDomForItem(s){if(s.is_last)return"";let i=this.iconSlot||(salla.config.get("theme.is_rtl",!0)?r:l);return t("li",{class:"s-breadcrumb-arrow"},t("div",{class:{"s-breadcrumb-icon-slot":!0,"s-breadcrumb-default-icon":!this.iconSlot},innerHTML:i}))}componentDidRender(){this.host.querySelectorAll(".s-breadcrumb-slot").forEach((s=>s.replaceWith(s.firstChild))),this.host.querySelectorAll(".s-breadcrumb-icon-slot.s-breadcrumb-default-icon").forEach((s=>s.replaceWith(s.querySelector("svg")))),this.host.querySelector('[slot="item"]')?.remove(),this.host.querySelector('[slot="icon"]')?.remove();let s=this.host.querySelectorAll(".s-breadcrumb-item")[this.breadcrumbs.length-1]?.querySelector("a");s&&s.replaceWith(s.firstChild)}get host(){return e(this)}};c.style=":host{display:block}";const u=class{constructor(t){s(this,t),this.shape="btn",this.color="primary",this.fill="solid",this.size="medium",this.width="normal",this.loading=!1,this.disabled=!1,this.loaderPosition="after",this.type="button"}async load(){return"center"==this.loaderPosition&&this.text.classList.add("s-button-hide"),this.host.setAttribute("loading",""),this.host}async stop(){return this.host.removeAttribute("loading"),this.host.querySelector("button").removeAttribute("loading"),"center"==this.loaderPosition&&this.text.classList.remove("s-button-hide"),this.host}async setText(s){return this.text.innerHTML=s,this.host}async disable(){return this.host.setAttribute("disabled",""),this.host}async enable(){return this.host.removeAttribute("disabled"),this.host}getBtnAttributes(){const s={};for(let t=0;t<this.host.attributes.length;t++)["color","fill","size","width","id"].includes(this.host.attributes[t].name)||(s[this.host.attributes[t].name]=this.host.attributes[t].value);s.type=s.type||this.type;const t=s.class||"";return s.class=t+" s-button-element s-button-"+this.shape+" s-button-"+("none"==this.fill?"fill-none":this.fill)+("medium"!=this.size?" s-button-"+this.size:"")+("normal"!=this.width?" s-button-"+this.width:"")+("link"==this.shape?" s-button-"+this.color+"-link":"")+("link"!=this.shape&&"outline"!=this.fill?" s-button-"+this.color:"")+("outline"==this.fill?" s-button-"+this.color+"-outline":"")+(this.disabled?" s-button-disabled ":"")+("icon"==this.shape?" s-button-loader-center":" s-button-loader-"+this.loaderPosition),s["aria-label"]||s["aria-labelledby"]||(this.host.textContent||"").trim()||(t.includes("btn--wishlist")||t.includes("wishlist")?s["aria-label"]=salla.lang.getWithDefault("pages.products.add_to_wishlist","Add or remove to wishlist"):"icon"===this.shape&&console.warn("Icon button is missing aria-label attribute")),s}button(){return t("button",{...this.getBtnAttributes(),disabled:this.disabled},t("span",{class:"s-button-text",ref:s=>this.text=s},t("slot",null)),this.loading?t("span",{class:"s-button-loader"}):"")}render(){return this.host.closest(".swiper-slide")?.classList.contains("swiper-slide-duplicate")?"":t(i,{class:"s-button-wrap"},this.href?t("a",{href:this.href},this.button()):this.button())}get host(){return e(this)}};u.style="";var m='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>alert-engine</title>\n<path d="M16 18.673c-0.736 0-1.333 0.604-1.333 1.34s0.597 1.333 1.333 1.333 1.333-0.597 1.333-1.333v-0.013c0-0.736-0.597-1.327-1.333-1.327zM2.667 16c0-3.092 1.083-6.105 3.047-8.484 0.469-0.568 0.389-1.408-0.179-1.877-0.568-0.468-1.408-0.388-1.877 0.179-2.359 2.857-3.657 6.473-3.657 10.183s1.299 7.325 3.657 10.183c0.264 0.319 0.645 0.484 1.029 0.484 0.299 0 0.6-0.1 0.848-0.305 0.568-0.469 0.648-1.309 0.179-1.877-1.964-2.379-3.047-5.392-3.047-8.484zM16 10.667c-0.736 0-1.333 0.597-1.333 1.333v4c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-4c0-0.736-0.597-1.333-1.333-1.333zM16 5.333c-5.881 0-10.667 4.785-10.667 10.667s4.785 10.667 10.667 10.667 10.667-4.785 10.667-10.667-4.785-10.667-10.667-10.667zM16 24c-4.412 0-8-3.588-8-8s3.588-8 8-8 8 3.588 8 8-3.588 8-8 8zM28.343 5.817c-0.469-0.567-1.307-0.647-1.877-0.179-0.568 0.469-0.648 1.309-0.179 1.877 1.964 2.379 3.047 5.392 3.047 8.484s-1.083 6.105-3.047 8.484c-0.469 0.568-0.389 1.408 0.179 1.877 0.249 0.205 0.549 0.305 0.848 0.305 0.384 0 0.765-0.165 1.028-0.484 2.36-2.857 3.659-6.473 3.659-10.183s-1.299-7.325-3.657-10.183z"></path>\n</svg>\n';const b=class{constructor(t){s(this,t),this.drawerVisibilityChanged=a(this,"drawerVisibilityChanged"),this.isClosable=!0,this.width="md",this.position="right",this.visible=!1,this.hasSkeleton=!1,this.isLoading=!1,this.subTitleFirst=!1,this.noPadding=!1,this.subTitle="",this.centered=!1,this.iconStyle=void 0,salla.event.on("drawer::open",(s=>s==this.host.id&&this.open())),salla.event.on("drawer::close",(s=>s==this.host.id&&this.close())),this.drawerTitle=this.host.getAttribute("drawer-title")}handleVisible(s){if(!s)return this.drawerVisibilityChanged.emit(!1),void this.toggleDrawer(!1);this.drawerVisibilityChanged.emit(!0),this.host.classList.remove("s-hidden"),setTimeout((()=>this.toggleDrawer(!0)))}handleKeyUp(s){"Escape"===s.key&&this.closeDrawer()}async open(){return this.host.setAttribute("visible",""),this.handleAutoFocus(),this.host}async close(){return this.host.removeAttribute("visible"),this.host}async setTitle(s){return this.drawerTitle=s,this.host}async loading(){return this.isLoading=!0,this.host}async stopLoading(){return this.isLoading=!1,this.host}handleAutoFocus(){const s=this.host.querySelector("input, textarea, select");s&&setTimeout((()=>{s.focus()}),100)}toggleDrawer(s){const t=this.host.querySelector(".s-drawer-body");d.toggleElementClassIf(t,"s-drawer-entering","s-drawer-leaving",(()=>s)).toggleElementClassIf(this.overlay,"s-drawer-entering","s-drawer-overlay-leaving",(()=>s)).toggleElementClassIf(document.body,"drawer-is-open","drawer-is-closed",(()=>s)),s||setTimeout((()=>this.host.classList.add("s-hidden")),350)}closeDrawer(s){this.isClosable&&(salla.event.dispatch("drawer::close",{reason:s}),this.host.removeAttribute("visible"))}iconBlockClasses(){return{"s-drawer-icon":!0,"s-drawer-bg-error":"error"==this.iconStyle,"s-drawer-bg-success":"success"==this.iconStyle,"s-drawer-bg-normal":!this.iconStyle,"s-drawer-bg-primary":"primary"==this.iconStyle}}getWidth(){return this.isLoading?this.hasSkeleton?"md":"xs":this.width}render(){return this.host.id=this.host.id||"salla-drawer",this.isLoading?t(i,{class:"salla-drawer s-drawer s-drawer-container s-hidden","aria-modal":"true",role:"dialog",onKeyUp:s=>this.handleKeyUp(s)},t("div",{class:"s-drawer-overlay s-drawer-overlay-leaving",ref:s=>this.overlay=s,onClick:()=>this.closeDrawer("backdropClick")}),t("div",{class:"s-drawer-wrapper s-drawer-wrapper-"+this.position},t("div",{class:"s-drawer-body flex justify-center s-drawer-leaving s-drawer-"+this.position+" s-drawer-"+this.getWidth()+(this.noPadding?" s-drawer-nopadding":" s-drawer-padding")},t("slot",{name:"loading"},t("salla-loading",null)),t("div",{class:"s-hidden"},t("slot",null))))):t(i,{class:"salla-drawer s-drawer s-drawer-container s-hidden","aria-modal":"true",role:"dialog"},t("div",{class:"s-drawer-overlay s-drawer-overlay-leaving",ref:s=>this.overlay=s,onClick:()=>this.closeDrawer("backdropClick")}),t("div",{class:"s-drawer-wrapper s-drawer-wrapper-"+this.position},t("div",{class:"s-drawer-body s-drawer-leaving s-drawer-"+this.position+" s-drawer-"+this.getWidth()+(this.noPadding?" s-drawer-nopadding":" s-drawer-padding")},t("div",{class:{"s-drawer-header":!0,"s-drawer-is-center":this.centered}},this.isClosable?t("button",{class:"s-drawer-close",onClick:()=>this.closeDrawer("closeButtonClick"),type:"button"},t("span",{innerHTML:o})):"",this.drawerTitle||this.subTitle?t("div",{class:"s-drawer-header-inner"},t("slot",{name:"icon"},this.iconStyle?t("div",{class:this.iconBlockClasses(),innerHTML:"error"==this.iconStyle?m:n}):""),t("div",{class:"s-drawer-header-content"},this.drawerTitle?t("div",{class:{"s-drawer-title":!0,"s-drawer-title-below":this.subTitleFirst},innerHTML:this.drawerTitle}):"",this.subTitle?t("p",{class:{"s-drawer-sub-title":!0},innerHTML:this.subTitle}):"")):""),t("slot",null),t("slot",{name:"footer"}))))}componentDidLoad(){document.body.append(this.host)}get host(){return e(this)}static get watchers(){return{visible:["handleVisible"]}}};b.style="";const p=class{constructor(t){s(this,t),this.size=32,this.width=2,this.color=void 0,this.bgColor="#e5e7eb"}render(){return t(i,{key:"bd9a1150a24f8a62d42437c669613ffa4e67b14f",class:"s-loading-container"},t("svg",{key:"460c614d5d205ed9283d63f5ebebdb5639b8246e","aria-hidden":"true",style:{width:`${this.size}px`,height:`${this.size}px`,fill:this.color,color:this.bgColor},class:"s-loading",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t("path",{key:"13c50eee8a0f2342cc876e9dbbcc84d418e314bc",d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),t("path",{key:"08888ea6c15d6be5d4225ec22bb2586e410793e8",d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})))}};p.style=".s-loading{animation:spin 1s linear infinite;fill:var(--color-primary)}.s-loading-container{display:flex;justify-content:center;align-items:center}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}";const g=class{constructor(t){s(this,t),this.modalVisibilityChanged=a(this,"modalVisibilityChanged"),this.isClosable=!0,this.width="md",this.position="middle",this.visible=!1,this.hasSkeleton=!1,this.isLoading=!1,this.subTitleFirst=!1,this.noPadding=!1,this.subTitle="",this.centered=!1,this.iconStyle=void 0,salla.event.on("modal::open",(s=>s==this.host.id&&this.open())),salla.event.on("modal::close",(s=>s==this.host.id&&this.close())),this.modalTitle=this.host.getAttribute("modal-title")}handleVisible(s){if(!s)return this.modalVisibilityChanged.emit(!1),void this.toggleModal(!1);this.modalVisibilityChanged.emit(!0),this.host.classList.remove("s-hidden"),setTimeout((()=>this.toggleModal(!0)))}handleKeyUp(s){"KeyUp"===s.key&&this.closeModal()}async open(){return this.host.setAttribute("visible",""),this.handleAutoFocus(),this.host}async close(){return this.host.removeAttribute("visible"),this.host}async setTitle(s){return this.modalTitle=s,this.host}async loading(){return this.isLoading=!0,this.host}async stopLoading(){return this.isLoading=!1,this.host}handleAutoFocus(){const s=this.host.querySelector("input, textarea, select");s&&setTimeout((()=>{s.focus()}),100)}toggleModal(s){const t=this.host.querySelector(".s-modal-body");d.toggleElementClassIf(t,"s-modal-entering","s-modal-leaving",(()=>s)).toggleElementClassIf(this.overlay,"s-modal-entering","s-modal-overlay-leaving",(()=>s)).toggleElementClassIf(document.body,"modal-is-open","modal-is-closed",(()=>s)),s||setTimeout((()=>this.host.classList.add("s-hidden")),350)}closeModal(s){this.isClosable&&(salla.event.dispatch("modal::close",{reason:s}),this.host.removeAttribute("visible"))}iconBlockClasses(){return{"s-modal-icon":!0,"s-modal-bg-error":"error"==this.iconStyle,"s-modal-bg-success":"success"==this.iconStyle,"s-modal-bg-normal":!this.iconStyle,"s-modal-bg-primary":"primary"==this.iconStyle}}getWidth(){return this.isLoading?this.hasSkeleton?"md":"xs":this.width}render(){return this.host.id=this.host.id||"salla-modal",this.isLoading?t(i,{class:"salla-modal s-modal s-modal-container s-hidden","aria-modal":"true",role:"dialog",onKeyUp:s=>this.handleKeyUp(s)},t("div",{class:"s-modal-overlay",ref:s=>this.overlay=s,onClick:()=>this.closeModal("backdropClick")}),t("div",{class:"s-modal-wrapper"},t("span",{class:"s-modal-spacer s-modal-align-"+this.position},"​"),t("div",{class:"s-modal-body s-modal-align-"+this.position+" s-modal-"+this.getWidth()+(this.noPadding?" s-modal-nopadding":" s-modal-padding")},t("slot",{name:"loading"},t("salla-loading",null)),t("div",{class:"s-hidden"},t("slot",null))))):t(i,{class:"salla-modal s-modal s-modal-container s-hidden","aria-modal":"true",role:"dialog"},t("div",{class:"s-modal-overlay",ref:s=>this.overlay=s,onClick:()=>this.closeModal("backdropClick")}),t("div",{class:"s-modal-wrapper"},t("span",{class:"s-modal-spacer s-modal-align-"+this.position},"​"),t("div",{class:"s-modal-body s-modal-align-"+this.position+" s-modal-"+this.getWidth()+(this.noPadding?" s-modal-nopadding":" s-modal-padding")},t("div",{class:{"s-modal-header":!0,"s-modal-is-center":this.centered}},this.isClosable?t("button",{class:"s-modal-close",onClick:()=>this.closeModal("closeButtonClick"),type:"button"},t("span",{innerHTML:o})):"",this.modalTitle||this.subTitle?t("div",{class:"s-modal-header-inner"},t("slot",{name:"icon"},this.iconStyle?t("div",{class:this.iconBlockClasses(),innerHTML:"error"==this.iconStyle?m:n}):""),t("div",{class:"s-modal-header-content"},this.modalTitle?t("div",{class:{"s-modal-title":!0,"s-modal-title-below":this.subTitleFirst},innerHTML:this.modalTitle}):"",this.subTitle?t("p",{class:{"s-modal-sub-title":!0},innerHTML:this.subTitle}):"")):""),t("slot",null),t("slot",{name:"footer"}))))}componentDidLoad(){document.body.append(this.host)}get host(){return e(this)}static get watchers(){return{visible:["handleVisible"]}}};g.style="@media screen and (max-width: 470px){.modal-is-open{position:fixed;width:100%}}";export{h as salla_accordion,c as salla_breadcrumb,u as salla_button,b as salla_drawer,p as salla_loading,g as salla_modal}
4
+ import{r as s,h as t,H as i,a as e,c as a}from"./p-CNVLmZO5.js";import{A as r,a as l}from"./p-Vqpj4CWE.js";import{S as o}from"./p-8Tsmrwno.js";import{C as n}from"./p-BV4kqbdL.js";import{H as d}from"./p-CHf8XdiS.js";import"./p-CgtvEd63.js";const h=class{constructor(t){s(this,t),this.collapsible=!0,this.bordered=!1,this.size="md",this.collapsed=!0,this.dir=document.dir||"rtl"}directionChangedHandler(s){this.dir=s.detail.dir}handleCollapse(s){this.collapsed=s.detail.payload.collapsed}setcollapsibleProp(){const s=this.host.querySelector("salla-accordion-head");this.collapsible&&s&&(s.setAttribute("collapsible","true"),s.setAttribute("collapsed",this.collapsed.toString()))}componentDidRender(){this.setcollapsibleProp();const s=this.host.querySelector("salla-accordion-body");this.collapsible&&(this.host.setAttribute("data-collapsed",this.collapsed.toString()),s?.setAttribute("data-collapsed",this.collapsed.toString()))}render(){return t(i,{key:"fb12197f13d8836304bfebb14400c79c8c4d31f0",class:`s-accordion-wrapper ${this.dir} ${this.bordered?"s-accordion-wrapper-bordered":""} ${this.size?`size-${this.size}`:""}`,"data-collapsed":this.collapsed.toString()},t("slot",{key:"460e8d7238bf9f014fe0bbb6c0da592c8cb3e15e"}))}get host(){return e(this)}};h.style="";const c=class{constructor(t){s(this,t),this.sessionStorageKey="breadcrumb_snapshot",this.itemSlot=this.host.querySelector('[slot="item"]')?.outerHTML||'<li class="s-breadcrumb-item"><a href={url}>{title}</a></li>',this.iconSlot=this.host.querySelector('[slot="icon"]')?.outerHTML}componentWillLoad(){return new Promise((s=>salla.onReady((()=>salla.lang.onLoaded(s))))).then((()=>{if(salla.url.is_page("index"))throw new Error("salla-breadcrumb:: breadcrumb not supported on home page")})).then((()=>{if(!salla.config.get("theme.settings.is_breadcrumbs_enabled",!0))throw new Error("salla-breadcrumb:: merchant disabled the feature")})).then((()=>{const s=salla.config.get("page");if(!s||!s.slug)return salla.logger.error('salla-breadcrumbs:: page object not existed on salla.config.get("page")!'),void(this.breadcrumbs=[]);let t=this.getSessionBreadcrumbs(),i=t[t.length-1];return"product.single"===s.slug&&t&&t.length>0&&i?.url&&s.parent?.url&&i.url===s.parent.url?(t.push({title:s.title,url:s.url}),this.breadcrumbs=this.setBreadcrumbsFromArray(t),this.storeBreadcrumbSnapshot()):t&&t.length>0?this.isNewPage(s,t)?(this.breadcrumbs=this.generateBreadcrumbs(s),this.storeBreadcrumbSnapshot()):this.breadcrumbs=this.setBreadcrumbsFromArray(t):(this.breadcrumbs=this.generateBreadcrumbs(s),this.storeBreadcrumbSnapshot()),this.breadcrumbs?.length&&(this.breadcrumbs[this.breadcrumbs.length-1].is_last=!0),this.breadcrumbs})).catch((s=>{salla.logger.error("salla-breadcrumb:: unexpected error!",s),this.breadcrumbs=[]}))}getSessionBreadcrumbs(){return"search-bar"===new URLSearchParams(window.location.search).get("from")?[]:JSON.parse(sessionStorage.getItem(this.sessionStorageKey)||"[]")}isNewPage(s,t){const i=t[t.length-1];return i?.url!==s.url}setBreadcrumbsFromArray(s){return s.map(((t,i)=>({...t,is_last:i===s.length-1})))}sanitizeBreadcrumbTitle(s,t=1){return s.includes("|")?s.split("|").map((s=>s.trim()))[t]:s.trim()}generateBreadcrumbs(s){let t=[];if("product.single"===s.slug){const t=this.getSessionBreadcrumbs(),i=t[t.length-1];if(t.length>0&&i?.url&&s.parent?.url&&i.url===s.parent.url)return this.setBreadcrumbsFromArray([...t,{title:s.title,url:s.url}])}let i=s;for(;i;)i.title&&t.unshift({title:i.title,url:i.url}),i=i.parent;return s.slug.includes("customer")&&"customer.profile"!==s.slug&&t.unshift({title:salla.lang.get("common.titles.profile"),url:salla.url.get("profile")}),s.slug.includes("blog")&&t.unshift({title:salla.lang.get("blocks.footer.blog"),url:salla.url.get("blog")}),"brands.single"===s.slug&&t.unshift({title:salla.lang.get("common.titles.brands"),url:salla.url.get("brands")}),s.title||"loyalty"!==s.slug||t.unshift({title:salla.lang.get("common.titles.loyalty_program"),url:salla.url.get("loyalty")}),t.unshift({title:salla.lang.get("common.titles.home"),url:salla.url.get("")}),t}storeBreadcrumbSnapshot(){try{const s=salla.config.get("page");if("product.single"===s?.slug)return;const t=[...this.breadcrumbs],i=t.length-1;i>=0&&(t[i].url=window.location.href);const e=JSON.stringify(t);sessionStorage.setItem(this.sessionStorageKey,e)}catch(s){salla.logger.error("salla-breadcrumb:: Failed to store breadcrumb snapshot in sessionStorage.",s)}}render(){return this.breadcrumbs.length<=1?(salla.log("salla-breadcrumb:: There is no breadcrumbs!"),null):t("ol",{class:{"s-breadcrumb-wrapper":!0,"s-breadcrumb-dark":salla.url.is_page("loyalty"),"s-breadcrumb-primary-reverse":salla.config.get("page.slug").includes("customer")}},this.breadcrumbs.map((s=>{const i="product.single"===salla.config.get("page.slug")&&s.is_last?s.title:this.sanitizeBreadcrumbTitle(s.title),e=this.itemSlot.replace(/\{url\}/g,s.url).replace(/\{title\}/g,i);return[t("div",{class:"s-breadcrumb-slot",innerHTML:e}),this.getArrowDomForItem(s)]})))}getArrowDomForItem(s){if(s.is_last)return"";let i=this.iconSlot||(salla.config.get("theme.is_rtl",!0)?r:l);return t("li",{class:"s-breadcrumb-arrow"},t("div",{class:{"s-breadcrumb-icon-slot":!0,"s-breadcrumb-default-icon":!this.iconSlot},innerHTML:i}))}componentDidRender(){this.host.querySelectorAll(".s-breadcrumb-slot").forEach((s=>s.replaceWith(s.firstChild))),this.host.querySelectorAll(".s-breadcrumb-icon-slot.s-breadcrumb-default-icon").forEach((s=>s.replaceWith(s.querySelector("svg")))),this.host.querySelector('[slot="item"]')?.remove(),this.host.querySelector('[slot="icon"]')?.remove();let s=this.host.querySelectorAll(".s-breadcrumb-item")[this.breadcrumbs.length-1]?.querySelector("a");s&&s.replaceWith(s.firstChild)}get host(){return e(this)}};c.style=":host{display:block}";const u=class{constructor(t){s(this,t),this.shape="btn",this.color="primary",this.fill="solid",this.size="medium",this.width="normal",this.loading=!1,this.disabled=!1,this.loaderPosition="after",this.type="button"}async load(){return"center"==this.loaderPosition&&this.text.classList.add("s-button-hide"),this.host.setAttribute("loading",""),this.host}async stop(){return this.host.removeAttribute("loading"),this.host.querySelector("button").removeAttribute("loading"),"center"==this.loaderPosition&&this.text.classList.remove("s-button-hide"),this.host}async setText(s){return this.text.innerHTML=s,this.host}async disable(){return this.host.setAttribute("disabled",""),this.host}async enable(){return this.host.removeAttribute("disabled"),this.host}getBtnAttributes(){const s={};for(let t=0;t<this.host.attributes.length;t++)["color","fill","size","width","id"].includes(this.host.attributes[t].name)||(s[this.host.attributes[t].name]=this.host.attributes[t].value);s.type=s.type||this.type;const t=s.class||"";return s.class=t+" s-button-element s-button-"+this.shape+" s-button-"+("none"==this.fill?"fill-none":this.fill)+("medium"!=this.size?" s-button-"+this.size:"")+("normal"!=this.width?" s-button-"+this.width:"")+("link"==this.shape?" s-button-"+this.color+"-link":"")+("link"!=this.shape&&"outline"!=this.fill?" s-button-"+this.color:"")+("outline"==this.fill?" s-button-"+this.color+"-outline":"")+(this.disabled?" s-button-disabled ":"")+("icon"==this.shape?" s-button-loader-center":" s-button-loader-"+this.loaderPosition),s["aria-label"]||s["aria-labelledby"]||(this.host.textContent||"").trim()||(t.includes("btn--wishlist")||t.includes("wishlist")?s["aria-label"]=salla.lang.getWithDefault("pages.products.add_to_wishlist","Add or remove to wishlist"):"icon"===this.shape&&console.warn("Icon button is missing aria-label attribute")),s}button(){return t("button",{...this.getBtnAttributes(),disabled:this.disabled},t("span",{class:"s-button-text",ref:s=>this.text=s},t("slot",null)),this.loading?t("span",{class:"s-button-loader"}):"")}render(){return this.host.closest(".swiper-slide")?.classList.contains("swiper-slide-duplicate")?"":t(i,{class:"s-button-wrap"},this.href?t("a",{href:this.href},this.button()):this.button())}get host(){return e(this)}};u.style="";var m='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>alert-engine</title>\n<path d="M16 18.673c-0.736 0-1.333 0.604-1.333 1.34s0.597 1.333 1.333 1.333 1.333-0.597 1.333-1.333v-0.013c0-0.736-0.597-1.327-1.333-1.327zM2.667 16c0-3.092 1.083-6.105 3.047-8.484 0.469-0.568 0.389-1.408-0.179-1.877-0.568-0.468-1.408-0.388-1.877 0.179-2.359 2.857-3.657 6.473-3.657 10.183s1.299 7.325 3.657 10.183c0.264 0.319 0.645 0.484 1.029 0.484 0.299 0 0.6-0.1 0.848-0.305 0.568-0.469 0.648-1.309 0.179-1.877-1.964-2.379-3.047-5.392-3.047-8.484zM16 10.667c-0.736 0-1.333 0.597-1.333 1.333v4c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-4c0-0.736-0.597-1.333-1.333-1.333zM16 5.333c-5.881 0-10.667 4.785-10.667 10.667s4.785 10.667 10.667 10.667 10.667-4.785 10.667-10.667-4.785-10.667-10.667-10.667zM16 24c-4.412 0-8-3.588-8-8s3.588-8 8-8 8 3.588 8 8-3.588 8-8 8zM28.343 5.817c-0.469-0.567-1.307-0.647-1.877-0.179-0.568 0.469-0.648 1.309-0.179 1.877 1.964 2.379 3.047 5.392 3.047 8.484s-1.083 6.105-3.047 8.484c-0.469 0.568-0.389 1.408 0.179 1.877 0.249 0.205 0.549 0.305 0.848 0.305 0.384 0 0.765-0.165 1.028-0.484 2.36-2.857 3.659-6.473 3.659-10.183s-1.299-7.325-3.657-10.183z"></path>\n</svg>\n';const b=class{constructor(t){s(this,t),this.drawerVisibilityChanged=a(this,"drawerVisibilityChanged"),this.isClosable=!0,this.width="md",this.position="right",this.visible=!1,this.hasSkeleton=!1,this.isLoading=!1,this.subTitleFirst=!1,this.noPadding=!1,this.subTitle="",this.centered=!1,this.iconStyle=void 0,salla.event.on("drawer::open",(s=>s==this.host.id&&this.open())),salla.event.on("drawer::close",(s=>s==this.host.id&&this.close())),this.drawerTitle=this.host.getAttribute("drawer-title")}handleVisible(s){if(!s)return this.drawerVisibilityChanged.emit(!1),void this.toggleDrawer(!1);this.drawerVisibilityChanged.emit(!0),this.host.classList.remove("s-hidden"),setTimeout((()=>this.toggleDrawer(!0)))}handleKeyUp(s){"Escape"===s.key&&this.closeDrawer()}async open(){return this.host.setAttribute("visible",""),this.handleAutoFocus(),this.host}async close(){return this.host.removeAttribute("visible"),this.host}async setTitle(s){return this.drawerTitle=s,this.host}async loading(){return this.isLoading=!0,this.host}async stopLoading(){return this.isLoading=!1,this.host}handleAutoFocus(){const s=this.host.querySelector("input, textarea, select");s&&setTimeout((()=>{s.focus()}),100)}toggleDrawer(s){const t=this.host.querySelector(".s-drawer-body");d.toggleElementClassIf(t,"s-drawer-entering","s-drawer-leaving",(()=>s)).toggleElementClassIf(this.overlay,"s-drawer-entering","s-drawer-overlay-leaving",(()=>s)).toggleElementClassIf(document.body,"drawer-is-open","drawer-is-closed",(()=>s)),s||setTimeout((()=>this.host.classList.add("s-hidden")),350)}closeDrawer(s){this.isClosable&&(salla.event.dispatch("drawer::close",{reason:s}),this.host.removeAttribute("visible"))}iconBlockClasses(){return{"s-drawer-icon":!0,"s-drawer-bg-error":"error"==this.iconStyle,"s-drawer-bg-success":"success"==this.iconStyle,"s-drawer-bg-normal":!this.iconStyle,"s-drawer-bg-primary":"primary"==this.iconStyle}}getWidth(){return this.isLoading?this.hasSkeleton?"md":"xs":this.width}render(){return this.host.id=this.host.id||"salla-drawer",this.isLoading?t(i,{class:"salla-drawer s-drawer s-drawer-container s-hidden","aria-modal":"true",role:"dialog",onKeyUp:s=>this.handleKeyUp(s)},t("div",{class:"s-drawer-overlay s-drawer-overlay-leaving",ref:s=>this.overlay=s,onClick:()=>this.closeDrawer("backdropClick")}),t("div",{class:"s-drawer-wrapper s-drawer-wrapper-"+this.position},t("div",{class:"s-drawer-body flex justify-center s-drawer-leaving s-drawer-"+this.position+" s-drawer-"+this.getWidth()+(this.noPadding?" s-drawer-nopadding":" s-drawer-padding")},t("slot",{name:"loading"},t("salla-loading",null)),t("div",{class:"s-hidden"},t("slot",null))))):t(i,{class:"salla-drawer s-drawer s-drawer-container s-hidden","aria-modal":"true",role:"dialog"},t("div",{class:"s-drawer-overlay s-drawer-overlay-leaving",ref:s=>this.overlay=s,onClick:()=>this.closeDrawer("backdropClick")}),t("div",{class:"s-drawer-wrapper s-drawer-wrapper-"+this.position},t("div",{class:"s-drawer-body s-drawer-leaving s-drawer-"+this.position+" s-drawer-"+this.getWidth()+(this.noPadding?" s-drawer-nopadding":" s-drawer-padding")},t("div",{class:{"s-drawer-header":!0,"s-drawer-is-center":this.centered}},this.isClosable?t("button",{class:"s-drawer-close",onClick:()=>this.closeDrawer("closeButtonClick"),type:"button"},t("span",{innerHTML:o})):"",this.drawerTitle||this.subTitle?t("div",{class:"s-drawer-header-inner"},t("slot",{name:"icon"},this.iconStyle?t("div",{class:this.iconBlockClasses(),innerHTML:"error"==this.iconStyle?m:n}):""),t("div",{class:"s-drawer-header-content"},this.drawerTitle?t("div",{class:{"s-drawer-title":!0,"s-drawer-title-below":this.subTitleFirst},innerHTML:this.drawerTitle}):"",this.subTitle?t("p",{class:{"s-drawer-sub-title":!0},innerHTML:this.subTitle}):"")):""),t("slot",null),t("slot",{name:"footer"}))))}componentDidLoad(){document.body.append(this.host)}get host(){return e(this)}static get watchers(){return{visible:["handleVisible"]}}};b.style="";const p=class{constructor(t){s(this,t),this.size=32,this.width=2,this.color=void 0,this.bgColor="#e5e7eb"}render(){return t(i,{key:"bd9a1150a24f8a62d42437c669613ffa4e67b14f",class:"s-loading-container"},t("svg",{key:"460c614d5d205ed9283d63f5ebebdb5639b8246e","aria-hidden":"true",style:{width:`${this.size}px`,height:`${this.size}px`,fill:this.color,color:this.bgColor},class:"s-loading",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t("path",{key:"13c50eee8a0f2342cc876e9dbbcc84d418e314bc",d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),t("path",{key:"08888ea6c15d6be5d4225ec22bb2586e410793e8",d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})))}};p.style=".s-loading{animation:spin 1s linear infinite;fill:var(--color-primary)}.s-loading-container{display:flex;justify-content:center;align-items:center}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}";const g=class{constructor(t){s(this,t),this.modalVisibilityChanged=a(this,"modalVisibilityChanged"),this.isClosable=!0,this.width="md",this.position="middle",this.visible=!1,this.hasSkeleton=!1,this.isLoading=!1,this.subTitleFirst=!1,this.noPadding=!1,this.subTitle="",this.centered=!1,this.iconStyle=void 0,salla.event.on("modal::open",(s=>s==this.host.id&&this.open())),salla.event.on("modal::close",(s=>s==this.host.id&&this.close())),this.modalTitle=this.host.getAttribute("modal-title")}handleVisible(s){if(!s)return this.modalVisibilityChanged.emit(!1),void this.toggleModal(!1);this.modalVisibilityChanged.emit(!0),this.host.classList.remove("s-hidden"),setTimeout((()=>this.toggleModal(!0)))}handleKeyUp(s){"KeyUp"===s.key&&this.closeModal()}async open(){return this.host.setAttribute("visible",""),this.handleAutoFocus(),this.host}async close(){return this.host.removeAttribute("visible"),this.host}async setTitle(s){return this.modalTitle=s,this.host}async loading(){return this.isLoading=!0,this.host}async stopLoading(){return this.isLoading=!1,this.host}handleAutoFocus(){const s=this.host.querySelector("input, textarea, select");s&&setTimeout((()=>{s.focus()}),100)}toggleModal(s){const t=this.host.querySelector(".s-modal-body");d.toggleElementClassIf(t,"s-modal-entering","s-modal-leaving",(()=>s)).toggleElementClassIf(this.overlay,"s-modal-entering","s-modal-overlay-leaving",(()=>s)).toggleElementClassIf(document.body,"modal-is-open","modal-is-closed",(()=>s)),s||setTimeout((()=>this.host.classList.add("s-hidden")),350)}closeModal(s){this.isClosable&&(salla.event.dispatch("modal::close",{reason:s}),this.host.removeAttribute("visible"))}iconBlockClasses(){return{"s-modal-icon":!0,"s-modal-bg-error":"error"==this.iconStyle,"s-modal-bg-success":"success"==this.iconStyle,"s-modal-bg-normal":!this.iconStyle,"s-modal-bg-primary":"primary"==this.iconStyle}}getWidth(){return this.isLoading?this.hasSkeleton?"md":"xs":this.width}render(){return this.host.id=this.host.id||"salla-modal",this.isLoading?t(i,{class:"salla-modal s-modal s-modal-container s-hidden","aria-modal":"true",role:"dialog",onKeyUp:s=>this.handleKeyUp(s)},t("div",{class:"s-modal-overlay",ref:s=>this.overlay=s,onClick:()=>this.closeModal("backdropClick")}),t("div",{class:"s-modal-wrapper"},t("span",{class:"s-modal-spacer s-modal-align-"+this.position},"​"),t("div",{class:"s-modal-body s-modal-align-"+this.position+" s-modal-"+this.getWidth()+(this.noPadding?" s-modal-nopadding":" s-modal-padding")},t("slot",{name:"loading"},t("salla-loading",null)),t("div",{class:"s-hidden"},t("slot",null))))):t(i,{class:"salla-modal s-modal s-modal-container s-hidden","aria-modal":"true",role:"dialog"},t("div",{class:"s-modal-overlay",ref:s=>this.overlay=s,onClick:()=>this.closeModal("backdropClick")}),t("div",{class:"s-modal-wrapper"},t("span",{class:"s-modal-spacer s-modal-align-"+this.position},"​"),t("div",{class:"s-modal-body s-modal-align-"+this.position+" s-modal-"+this.getWidth()+(this.noPadding?" s-modal-nopadding":" s-modal-padding")},t("div",{class:{"s-modal-header":!0,"s-modal-is-center":this.centered}},this.isClosable?t("button",{class:"s-modal-close",onClick:()=>this.closeModal("closeButtonClick"),type:"button"},t("span",{innerHTML:o})):"",this.modalTitle||this.subTitle?t("div",{class:"s-modal-header-inner"},t("slot",{name:"icon"},this.iconStyle?t("div",{class:this.iconBlockClasses(),innerHTML:"error"==this.iconStyle?m:n}):""),t("div",{class:"s-modal-header-content"},this.modalTitle?t("div",{class:{"s-modal-title":!0,"s-modal-title-below":this.subTitleFirst},innerHTML:this.modalTitle}):"",this.subTitle?t("p",{class:{"s-modal-sub-title":!0},innerHTML:this.subTitle}):"")):""),t("slot",null),t("slot",{name:"footer"}))))}componentDidLoad(){document.body.append(this.host)}get host(){return e(this)}static get watchers(){return{visible:["handleVisible"]}}};g.style="@media screen and (max-width: 470px){.modal-is-open{position:fixed;width:100%}}";export{h as salla_accordion,c as salla_breadcrumb,u as salla_button,b as salla_drawer,p as salla_loading,g as salla_modal}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as e,h as a,H as t}from"./p-B_Rg7VI5.js";const s=class{constructor(a){e(this,a),this.href=void 0,this.target="_self"}generateClass(){return{"s-list-tile-item":!0,"s-list-tile-item-href":!!this.href}}render(){return a(t,{key:"1f5e8a06d1c1aa0df00b09eec0c0a1efbf590748"},a("a",{key:"f9b772a03f745b07e2456cd74c73ab695f3754ff",class:this.generateClass(),href:this.href||"#",target:this.target,"aria-label":"List Tile Link"},a("div",{key:"e90d46a29df8ea298489deba9b88bc6f84ebd5aa",class:"s-list-tile-item-icon"},a("slot",{key:"a5c40e495d05b5d45bae8ed133eca034f439368d",name:"icon"})),a("div",{key:"2ded5a53f567c8eddb05d24a5f59875d3a7ac1ac",class:"s-list-tile-item-content"},a("div",{key:"80e6962e698223c893b40a4a62d8ce67aa3ab27c",class:"s-list-tile-item-title"},a("slot",{key:"87f95d3ae826904a55e0e4724340f55344371789",name:"title"})),a("div",{key:"7fc838f33b9e65ca8c9f11bce4b506aad7d7ecb1",class:"s-list-tile-item-subtitle"},a("slot",{key:"f936a3770d59d3b56287927a447df9c8fa697310",name:"subtitle"}))),a("div",{key:"e974fd4591921468f4a882370303709718ef6e64",class:"s-list-tile-item-action"},a("slot",{key:"9d2adb70f0c75b18474f0f05c99000327e081ce8",name:"action"}))))}};s.style="";export{s as salla_list_tile}
4
+ import{r as e,h as a,H as t}from"./p-CNVLmZO5.js";const s=class{constructor(a){e(this,a),this.href=void 0,this.target="_self"}generateClass(){return{"s-list-tile-item":!0,"s-list-tile-item-href":!!this.href}}render(){return a(t,{key:"1f5e8a06d1c1aa0df00b09eec0c0a1efbf590748"},a("a",{key:"f9b772a03f745b07e2456cd74c73ab695f3754ff",class:this.generateClass(),href:this.href||"#",target:this.target,"aria-label":"List Tile Link"},a("div",{key:"e90d46a29df8ea298489deba9b88bc6f84ebd5aa",class:"s-list-tile-item-icon"},a("slot",{key:"a5c40e495d05b5d45bae8ed133eca034f439368d",name:"icon"})),a("div",{key:"2ded5a53f567c8eddb05d24a5f59875d3a7ac1ac",class:"s-list-tile-item-content"},a("div",{key:"80e6962e698223c893b40a4a62d8ce67aa3ab27c",class:"s-list-tile-item-title"},a("slot",{key:"87f95d3ae826904a55e0e4724340f55344371789",name:"title"})),a("div",{key:"7fc838f33b9e65ca8c9f11bce4b506aad7d7ecb1",class:"s-list-tile-item-subtitle"},a("slot",{key:"f936a3770d59d3b56287927a447df9c8fa697310",name:"subtitle"}))),a("div",{key:"e974fd4591921468f4a882370303709718ef6e64",class:"s-list-tile-item-action"},a("slot",{key:"9d2adb70f0c75b18474f0f05c99000327e081ce8",name:"action"}))))}};s.style="";export{s as salla_list_tile}