@salla.sa/twilight-components 2.14.228 → 2.14.229

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 (313) hide show
  1. package/dist/cjs/{app-globals-CywMIIRz.js → app-globals-BpIPTuWk.js} +3 -3
  2. package/dist/cjs/{app-globals-CywMIIRz.js.map → app-globals-BpIPTuWk.js.map} +1 -1
  3. package/dist/cjs/{index-0hx4qRUA.js → index-KccCEykN.js} +4 -4
  4. package/dist/cjs/{index-0hx4qRUA.js.map → index-KccCEykN.js.map} +1 -1
  5. package/dist/cjs/loader.cjs.js +2 -2
  6. package/dist/cjs/salla-accordion-body.cjs.entry.js +1 -1
  7. package/dist/cjs/salla-accordion-head.cjs.entry.js +1 -1
  8. package/dist/cjs/salla-accordion.cjs.entry.js +1 -1
  9. package/dist/cjs/salla-add-product-button_51.cjs.entry.js +1 -1
  10. package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
  11. package/dist/cjs/salla-app-install-alert.cjs.entry.js +1 -1
  12. package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
  13. package/dist/cjs/salla-booking-field_2.cjs.entry.js +1 -1
  14. package/dist/cjs/salla-cart-item-offers.cjs.entry.js +1 -1
  15. package/dist/cjs/salla-conditional-offer.cjs.entry.js +4 -4
  16. package/dist/cjs/salla-conditional-offer.cjs.entry.js.map +1 -1
  17. package/dist/cjs/salla-conditional-offer.entry.cjs.js.map +1 -1
  18. package/dist/cjs/salla-contacts.cjs.entry.js +1 -1
  19. package/dist/cjs/salla-filters-widget.cjs.entry.js +1 -1
  20. package/dist/cjs/salla-filters.cjs.entry.js +1 -1
  21. package/dist/cjs/salla-installment.cjs.entry.js +1 -1
  22. package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
  23. package/dist/cjs/salla-loyalty-program.cjs.entry.js +1 -1
  24. package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
  25. package/dist/cjs/salla-notification-item.cjs.entry.js +1 -1
  26. package/dist/cjs/salla-notifications.cjs.entry.js +1 -1
  27. package/dist/cjs/salla-offer.cjs.entry.js +1 -1
  28. package/dist/cjs/salla-order-summary.cjs.entry.js +1 -1
  29. package/dist/cjs/salla-orders.cjs.entry.js +1 -1
  30. package/dist/cjs/salla-payments.cjs.entry.js +1 -1
  31. package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
  32. package/dist/cjs/salla-product-options.cjs.entry.js +1 -1
  33. package/dist/cjs/salla-review-card.cjs.entry.js +1 -1
  34. package/dist/cjs/salla-reviews-page.cjs.entry.js +1 -1
  35. package/dist/cjs/salla-reviews.cjs.entry.js +1 -1
  36. package/dist/cjs/salla-social.cjs.entry.js +1 -1
  37. package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
  38. package/dist/cjs/salla-tooltip.cjs.entry.js +1 -1
  39. package/dist/cjs/salla-verify.cjs.entry.js +1 -1
  40. package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
  41. package/dist/cjs/twilight.cjs.js +2 -2
  42. package/dist/collection/components/salla-conditional-offer/salla-conditional-offer.js +3 -3
  43. package/dist/collection/components/salla-conditional-offer/salla-conditional-offer.js.map +1 -1
  44. package/dist/components/index.js +2 -2
  45. package/dist/components/index.js.map +1 -1
  46. package/dist/components/salla-conditional-offer.js +3 -3
  47. package/dist/components/salla-conditional-offer.js.map +1 -1
  48. package/dist/esm/{app-globals-CUKRDLAx.js → app-globals-BZCILndm.js} +3 -3
  49. package/dist/esm/{app-globals-CUKRDLAx.js.map → app-globals-BZCILndm.js.map} +1 -1
  50. package/dist/esm/{index-CNDQzdP7.js → index-uTwIMGTZ.js} +4 -4
  51. package/dist/esm/{index-CNDQzdP7.js.map → index-uTwIMGTZ.js.map} +1 -1
  52. package/dist/esm/loader.js +3 -3
  53. package/dist/esm/salla-accordion-body.entry.js +1 -1
  54. package/dist/esm/salla-accordion-head.entry.js +1 -1
  55. package/dist/esm/salla-accordion.entry.js +1 -1
  56. package/dist/esm/salla-add-product-button_51.entry.js +1 -1
  57. package/dist/esm/salla-advertisement.entry.js +1 -1
  58. package/dist/esm/salla-app-install-alert.entry.js +1 -1
  59. package/dist/esm/salla-apps-icons.entry.js +1 -1
  60. package/dist/esm/salla-booking-field_2.entry.js +1 -1
  61. package/dist/esm/salla-cart-item-offers.entry.js +1 -1
  62. package/dist/esm/salla-conditional-offer.entry.js +4 -4
  63. package/dist/esm/salla-conditional-offer.entry.js.map +1 -1
  64. package/dist/esm/salla-contacts.entry.js +1 -1
  65. package/dist/esm/salla-filters-widget.entry.js +1 -1
  66. package/dist/esm/salla-filters.entry.js +1 -1
  67. package/dist/esm/salla-installment.entry.js +1 -1
  68. package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
  69. package/dist/esm/salla-loyalty-program.entry.js +1 -1
  70. package/dist/esm/salla-metadata.entry.js +1 -1
  71. package/dist/esm/salla-notification-item.entry.js +1 -1
  72. package/dist/esm/salla-notifications.entry.js +1 -1
  73. package/dist/esm/salla-offer.entry.js +1 -1
  74. package/dist/esm/salla-order-summary.entry.js +1 -1
  75. package/dist/esm/salla-orders.entry.js +1 -1
  76. package/dist/esm/salla-payments.entry.js +1 -1
  77. package/dist/esm/salla-price-range.entry.js +1 -1
  78. package/dist/esm/salla-product-options.entry.js +1 -1
  79. package/dist/esm/salla-review-card.entry.js +1 -1
  80. package/dist/esm/salla-reviews-page.entry.js +1 -1
  81. package/dist/esm/salla-reviews.entry.js +1 -1
  82. package/dist/esm/salla-social.entry.js +1 -1
  83. package/dist/esm/salla-tiered-offer.entry.js +1 -1
  84. package/dist/esm/salla-tooltip.entry.js +1 -1
  85. package/dist/esm/salla-verify.entry.js +1 -1
  86. package/dist/esm/salla-wallet.entry.js +1 -1
  87. package/dist/esm/twilight.js +3 -3
  88. package/dist/esm-es5/{app-globals-CUKRDLAx.js → app-globals-BZCILndm.js} +2 -2
  89. package/dist/esm-es5/{app-globals-CUKRDLAx.js.map → app-globals-BZCILndm.js.map} +1 -1
  90. package/dist/esm-es5/{index-CNDQzdP7.js → index-uTwIMGTZ.js} +3 -3
  91. package/dist/esm-es5/{index-CNDQzdP7.js.map → index-uTwIMGTZ.js.map} +1 -1
  92. package/dist/esm-es5/loader.js +1 -1
  93. package/dist/esm-es5/salla-accordion-body.entry.js +1 -1
  94. package/dist/esm-es5/salla-accordion-head.entry.js +1 -1
  95. package/dist/esm-es5/salla-accordion.entry.js +1 -1
  96. package/dist/esm-es5/salla-add-product-button_51.entry.js +1 -1
  97. package/dist/esm-es5/salla-advertisement.entry.js +1 -1
  98. package/dist/esm-es5/salla-app-install-alert.entry.js +1 -1
  99. package/dist/esm-es5/salla-apps-icons.entry.js +1 -1
  100. package/dist/esm-es5/salla-booking-field_2.entry.js +1 -1
  101. package/dist/esm-es5/salla-cart-item-offers.entry.js +1 -1
  102. package/dist/esm-es5/salla-conditional-offer.entry.js +1 -1
  103. package/dist/esm-es5/salla-conditional-offer.entry.js.map +1 -1
  104. package/dist/esm-es5/salla-contacts.entry.js +1 -1
  105. package/dist/esm-es5/salla-filters-widget.entry.js +1 -1
  106. package/dist/esm-es5/salla-filters.entry.js +1 -1
  107. package/dist/esm-es5/salla-installment.entry.js +1 -1
  108. package/dist/esm-es5/salla-loyalty-prize-item.entry.js +1 -1
  109. package/dist/esm-es5/salla-loyalty-program.entry.js +1 -1
  110. package/dist/esm-es5/salla-metadata.entry.js +1 -1
  111. package/dist/esm-es5/salla-notification-item.entry.js +1 -1
  112. package/dist/esm-es5/salla-notifications.entry.js +1 -1
  113. package/dist/esm-es5/salla-offer.entry.js +1 -1
  114. package/dist/esm-es5/salla-order-summary.entry.js +1 -1
  115. package/dist/esm-es5/salla-orders.entry.js +1 -1
  116. package/dist/esm-es5/salla-payments.entry.js +1 -1
  117. package/dist/esm-es5/salla-price-range.entry.js +1 -1
  118. package/dist/esm-es5/salla-product-options.entry.js +1 -1
  119. package/dist/esm-es5/salla-review-card.entry.js +1 -1
  120. package/dist/esm-es5/salla-reviews-page.entry.js +1 -1
  121. package/dist/esm-es5/salla-reviews.entry.js +1 -1
  122. package/dist/esm-es5/salla-social.entry.js +1 -1
  123. package/dist/esm-es5/salla-tiered-offer.entry.js +1 -1
  124. package/dist/esm-es5/salla-tooltip.entry.js +1 -1
  125. package/dist/esm-es5/salla-verify.entry.js +1 -1
  126. package/dist/esm-es5/salla-wallet.entry.js +1 -1
  127. package/dist/esm-es5/twilight.js +1 -1
  128. package/dist/twilight/{p-66c7a2e8.system.entry.js → p-06121f61.system.entry.js} +2 -2
  129. package/dist/twilight/{p-f2645988.entry.js → p-064991bd.entry.js} +2 -2
  130. package/dist/twilight/{p-0f3534fc.system.entry.js → p-08ae39fd.system.entry.js} +2 -2
  131. package/dist/twilight/{p-11d8de98.system.entry.js → p-0cf232d4.system.entry.js} +2 -2
  132. package/dist/twilight/{p-beac6d8e.entry.js → p-0ed72423.entry.js} +2 -2
  133. package/dist/twilight/{p-4f256783.entry.js → p-13ef30ff.entry.js} +2 -2
  134. package/dist/twilight/{p-fb61d02c.entry.js → p-160cef1c.entry.js} +2 -2
  135. package/dist/twilight/{p-c991e16b.entry.js → p-1c1f2e96.entry.js} +6 -6
  136. package/dist/twilight/{p-3e3ec5b5.entry.js → p-2147132d.entry.js} +2 -2
  137. package/dist/twilight/{p-e34c37d6.system.entry.js → p-230824bf.system.entry.js} +2 -2
  138. package/dist/twilight/{p-1a000178.system.entry.js → p-2539d9a9.system.entry.js} +2 -2
  139. package/dist/twilight/{p-c25ee5db.entry.js → p-258fdfe8.entry.js} +2 -2
  140. package/dist/twilight/{p-7e11444f.entry.js → p-29984c80.entry.js} +2 -2
  141. package/dist/twilight/{p-9a1eac46.entry.js → p-2f83207c.entry.js} +2 -2
  142. package/dist/twilight/{p-5704f84e.system.entry.js → p-36c7e6d7.system.entry.js} +2 -2
  143. package/dist/twilight/{p-71d4f300.system.entry.js → p-3862ded8.system.entry.js} +2 -2
  144. package/dist/twilight/{p-8b35c143.system.entry.js → p-3fbc0740.system.entry.js} +2 -2
  145. package/dist/twilight/{p-0169eec4.entry.js → p-45620cb5.entry.js} +2 -2
  146. package/dist/twilight/{p-850cc43e.system.entry.js → p-45af6d5f.system.entry.js} +2 -2
  147. package/dist/twilight/{p-e6efb7f9.system.entry.js → p-481b6bcf.system.entry.js} +2 -2
  148. package/dist/twilight/{p-bc48d7b8.system.entry.js → p-48ab4e24.system.entry.js} +2 -2
  149. package/dist/twilight/{p-9165a64d.entry.js → p-4befb128.entry.js} +2 -2
  150. package/dist/twilight/{p-b39543c1.system.entry.js → p-4f852631.system.entry.js} +2 -2
  151. package/dist/twilight/{p-39f531cc.entry.js → p-51f461f3.entry.js} +2 -2
  152. package/dist/twilight/{p-e23170f9.system.entry.js → p-550cae04.system.entry.js} +2 -2
  153. package/dist/twilight/{p-b5bb38a8.entry.js → p-560b9ba3.entry.js} +2 -2
  154. package/dist/twilight/{p-c7692780.entry.js → p-56a2f2ce.entry.js} +2 -2
  155. package/dist/twilight/{p-6957616a.entry.js → p-58e3f07b.entry.js} +2 -2
  156. package/dist/twilight/{p-331e6845.system.entry.js → p-5d544da2.system.entry.js} +2 -2
  157. package/dist/twilight/p-600fc4be.system.entry.js +5 -0
  158. package/dist/twilight/p-600fc4be.system.entry.js.map +1 -0
  159. package/dist/twilight/{p-8446830b.system.entry.js → p-6899a6f6.system.entry.js} +2 -2
  160. package/dist/twilight/p-70db2d4e.system.entry.js +5 -0
  161. package/dist/twilight/{p-149de98d.entry.js → p-751d4aad.entry.js} +2 -2
  162. package/dist/twilight/{p-590216eb.entry.js → p-7bd3640b.entry.js} +2 -2
  163. package/dist/twilight/{p-0b2cb090.entry.js → p-80700df9.entry.js} +2 -2
  164. package/dist/twilight/{p-8dc7bd7e.entry.js → p-80bc850c.entry.js} +2 -2
  165. package/dist/twilight/{p-08e57dc8.entry.js → p-80ce5698.entry.js} +2 -2
  166. package/dist/twilight/{p-43f297d3.entry.js → p-81b86d4b.entry.js} +2 -2
  167. package/dist/twilight/{p-73ea40c2.system.entry.js → p-845bfe77.system.entry.js} +2 -2
  168. package/dist/twilight/{p-4489393c.system.entry.js → p-8504d011.system.entry.js} +2 -2
  169. package/dist/twilight/{p-5621e1a0.entry.js → p-8645f64f.entry.js} +2 -2
  170. package/dist/twilight/{p-ERYBUQyA.system.js.map → p-886vx98h.system.js.map} +1 -1
  171. package/dist/twilight/{p-e160c850.system.entry.js → p-88d35160.system.entry.js} +2 -2
  172. package/dist/twilight/{p-BcWqsmX2.system.js.map → p-8Rer7EXu.system.js.map} +1 -1
  173. package/dist/twilight/{p-D0A3U0he.system.js.map → p-8nixWS15.system.js.map} +1 -1
  174. package/dist/twilight/{p-973b4a3b.system.entry.js → p-9d658a72.system.entry.js} +2 -2
  175. package/dist/twilight/p-9d8cb3df.entry.js +5 -0
  176. package/dist/twilight/p-9d8cb3df.entry.js.map +1 -0
  177. package/dist/twilight/{p-b32a3ff9.entry.js → p-9f2daf11.entry.js} +2 -2
  178. package/dist/twilight/{p-A5LotHFs.system.js.map → p-B0xOcfR4.system.js.map} +1 -1
  179. package/dist/twilight/{p-DUTAFn8C.system.js.map → p-B6NDuIUg.system.js.map} +1 -1
  180. package/dist/twilight/{p-CBqzu3xn.system.js.map → p-BURJU68j.system.js.map} +1 -1
  181. package/dist/twilight/{p-sDk273rP.system.js.map → p-BVO7DM0I.system.js.map} +1 -1
  182. package/dist/twilight/{p-DDibL7s9.system.js.map → p-Bm9P2AqL.system.js.map} +1 -1
  183. package/dist/twilight/{p-BdjxDTWq.system.js → p-BoX1YoZL.system.js} +2 -2
  184. package/dist/twilight/{p-BdjxDTWq.system.js.map → p-BoX1YoZL.system.js.map} +1 -1
  185. package/dist/twilight/{p-DZw1UYox.system.js.map → p-Bq5_nH5K.system.js.map} +1 -1
  186. package/dist/twilight/{p-7RKo2TrS.system.js.map → p-BsiQgjhg.system.js.map} +1 -1
  187. package/dist/twilight/{p-Bw-w1vO5.system.js.map → p-BxD1RjlT.system.js.map} +1 -1
  188. package/dist/twilight/{p-zeaQ7puS.system.js.map → p-C3kspn6z.system.js.map} +1 -1
  189. package/dist/twilight/{p-CFLu8Qr5.system.js.map → p-CEnEuqvr.system.js.map} +1 -1
  190. package/dist/twilight/{p-vBTXOrr5.system.js → p-CO2c0tFL.system.js} +2 -2
  191. package/dist/twilight/{p-vBTXOrr5.system.js.map → p-CO2c0tFL.system.js.map} +1 -1
  192. package/dist/twilight/{p-BkrCg4Tl.system.js.map → p-CQIP-F6y.system.js.map} +1 -1
  193. package/dist/twilight/{p-BqcDdYxx.system.js.map → p-CT5QEbCs.system.js.map} +1 -1
  194. package/dist/twilight/{p-BpTGIHt8.system.js.map → p-C_c7nRps.system.js.map} +1 -1
  195. package/dist/twilight/{p-DcDP1ooH.system.js → p-Chzz_LDL.system.js} +3 -3
  196. package/dist/twilight/{p-DcDP1ooH.system.js.map → p-Chzz_LDL.system.js.map} +1 -1
  197. package/dist/twilight/{p-Bizi6Y8w.system.js.map → p-ClUIbKLz.system.js.map} +1 -1
  198. package/dist/twilight/{p-C6ZcRXfC.js → p-Cpv-H9QO.js} +2 -2
  199. package/dist/twilight/{p-C6ZcRXfC.js.map → p-Cpv-H9QO.js.map} +1 -1
  200. package/dist/twilight/{p-CFI-2rTe.system.js.map → p-CsOXnUlA.system.js.map} +1 -1
  201. package/dist/twilight/{p-BhGLFial.system.js.map → p-CtfG8vJk.system.js.map} +1 -1
  202. package/dist/twilight/{p-DFmdxLJn.system.js.map → p-CuRphQ2O.system.js.map} +1 -1
  203. package/dist/twilight/{p-CJcCCRXC.system.js.map → p-D2UsHEOo.system.js.map} +1 -1
  204. package/dist/twilight/{p-CVgn2oKO.system.js.map → p-D9djE3u9.system.js.map} +1 -1
  205. package/dist/twilight/{p-tG6tZrRA.system.js.map → p-DPvbVDUB.system.js.map} +1 -1
  206. package/dist/twilight/p-DXIQmqRW.system.js.map +1 -0
  207. package/dist/twilight/{p-BFDx-9R3.system.js.map → p-DlrkegKC.system.js.map} +1 -1
  208. package/dist/twilight/{p-CIokohPT.system.js.map → p-Dm3YFK8c.system.js.map} +1 -1
  209. package/dist/twilight/{p-DRquBHEo.system.js.map → p-DpcgwSax.system.js.map} +1 -1
  210. package/dist/twilight/{p-DUS17Zz-.system.js.map → p-Ow-kOnfX.system.js.map} +1 -1
  211. package/dist/twilight/{p-CQw6hbqN.system.js.map → p-Q3qz1aQg.system.js.map} +1 -1
  212. package/dist/twilight/{p-CMpqjkGm.system.js.map → p-UXdSmY3n.system.js.map} +1 -1
  213. package/dist/twilight/{p-1mI1fhai.system.js.map → p-a0EYQzL3.system.js.map} +1 -1
  214. package/dist/twilight/{p-c3552207.entry.js → p-a16ecc9d.entry.js} +2 -2
  215. package/dist/twilight/{p-4d553bba.system.entry.js → p-a222ad24.system.entry.js} +2 -2
  216. package/dist/twilight/{p-a7654fed.system.entry.js → p-aaab96da.system.entry.js} +2 -2
  217. package/dist/twilight/{p-00b8c002.entry.js → p-afbbbb73.entry.js} +2 -2
  218. package/dist/twilight/{p-2fdc2aec.system.entry.js → p-b112893e.system.entry.js} +2 -2
  219. package/dist/twilight/{p-c6df4072.system.entry.js → p-b30f4481.system.entry.js} +2 -2
  220. package/dist/twilight/{p-78e79386.system.entry.js → p-b5bbcf1a.system.entry.js} +2 -2
  221. package/dist/twilight/{p-43a00683.system.entry.js → p-bac69caa.system.entry.js} +2 -2
  222. package/dist/twilight/{p-8940c4cc.entry.js → p-bc947447.entry.js} +2 -2
  223. package/dist/twilight/{p-7f010a1f.system.entry.js → p-bf5d5375.system.entry.js} +2 -2
  224. package/dist/twilight/{p-a5ab889e.system.entry.js → p-c2319979.system.entry.js} +2 -2
  225. package/dist/twilight/{p-cffc4a47.entry.js → p-c6b5fa5c.entry.js} +2 -2
  226. package/dist/twilight/{p-fd2c4c29.entry.js → p-cb577695.entry.js} +2 -2
  227. package/dist/twilight/{p-12865797.entry.js → p-cf16c5b6.entry.js} +2 -2
  228. package/dist/twilight/{p-6674ff60.entry.js → p-d6d158ac.entry.js} +2 -2
  229. package/dist/twilight/{p-33caa5c9.system.entry.js → p-db051ac6.system.entry.js} +2 -2
  230. package/dist/twilight/{p-6ae8297d.system.entry.js → p-ea313a20.system.entry.js} +2 -2
  231. package/dist/twilight/{p-0fb4368c.entry.js → p-eee1b538.entry.js} +2 -2
  232. package/dist/twilight/{p-0acc337d.system.entry.js → p-f134bc31.system.entry.js} +2 -2
  233. package/dist/twilight/{p-38fc8939.system.entry.js → p-f718fce5.system.entry.js} +2 -2
  234. package/dist/twilight/{p-06721e7c.entry.js → p-fb6a0296.entry.js} +2 -2
  235. package/dist/twilight/{p-C5YV0HRP.system.js.map → p-jFQLtU7n.system.js.map} +1 -1
  236. package/dist/twilight/{p-DNTy-aSU.system.js.map → p-nx-q5kJr.system.js.map} +1 -1
  237. package/dist/twilight/{p-CNDQzdP7.js → p-uTwIMGTZ.js} +3 -3
  238. package/dist/twilight/{p-CNDQzdP7.js.map → p-uTwIMGTZ.js.map} +1 -1
  239. package/dist/twilight/{p-7mw7ykXE.system.js.map → p-uqDS_0s2.system.js.map} +1 -1
  240. package/dist/twilight/salla-conditional-offer.entry.esm.js.map +1 -1
  241. package/dist/twilight/twilight.esm.js +1 -1
  242. package/dist/twilight/twilight.js +1 -1
  243. package/package.json +5 -5
  244. package/dist/twilight/p-22e25d12.entry.js +0 -5
  245. package/dist/twilight/p-22e25d12.entry.js.map +0 -1
  246. package/dist/twilight/p-Cz_wOczc.system.js.map +0 -1
  247. package/dist/twilight/p-c9907836.system.entry.js +0 -5
  248. package/dist/twilight/p-c9907836.system.entry.js.map +0 -1
  249. package/dist/twilight/p-d5780002.system.entry.js +0 -5
  250. /package/dist/twilight/{p-66c7a2e8.system.entry.js.map → p-06121f61.system.entry.js.map} +0 -0
  251. /package/dist/twilight/{p-f2645988.entry.js.map → p-064991bd.entry.js.map} +0 -0
  252. /package/dist/twilight/{p-0f3534fc.system.entry.js.map → p-08ae39fd.system.entry.js.map} +0 -0
  253. /package/dist/twilight/{p-11d8de98.system.entry.js.map → p-0cf232d4.system.entry.js.map} +0 -0
  254. /package/dist/twilight/{p-beac6d8e.entry.js.map → p-0ed72423.entry.js.map} +0 -0
  255. /package/dist/twilight/{p-4f256783.entry.js.map → p-13ef30ff.entry.js.map} +0 -0
  256. /package/dist/twilight/{p-fb61d02c.entry.js.map → p-160cef1c.entry.js.map} +0 -0
  257. /package/dist/twilight/{p-c991e16b.entry.js.map → p-1c1f2e96.entry.js.map} +0 -0
  258. /package/dist/twilight/{p-3e3ec5b5.entry.js.map → p-2147132d.entry.js.map} +0 -0
  259. /package/dist/twilight/{p-e34c37d6.system.entry.js.map → p-230824bf.system.entry.js.map} +0 -0
  260. /package/dist/twilight/{p-1a000178.system.entry.js.map → p-2539d9a9.system.entry.js.map} +0 -0
  261. /package/dist/twilight/{p-c25ee5db.entry.js.map → p-258fdfe8.entry.js.map} +0 -0
  262. /package/dist/twilight/{p-7e11444f.entry.js.map → p-29984c80.entry.js.map} +0 -0
  263. /package/dist/twilight/{p-9a1eac46.entry.js.map → p-2f83207c.entry.js.map} +0 -0
  264. /package/dist/twilight/{p-5704f84e.system.entry.js.map → p-36c7e6d7.system.entry.js.map} +0 -0
  265. /package/dist/twilight/{p-71d4f300.system.entry.js.map → p-3862ded8.system.entry.js.map} +0 -0
  266. /package/dist/twilight/{p-8b35c143.system.entry.js.map → p-3fbc0740.system.entry.js.map} +0 -0
  267. /package/dist/twilight/{p-0169eec4.entry.js.map → p-45620cb5.entry.js.map} +0 -0
  268. /package/dist/twilight/{p-850cc43e.system.entry.js.map → p-45af6d5f.system.entry.js.map} +0 -0
  269. /package/dist/twilight/{p-e6efb7f9.system.entry.js.map → p-481b6bcf.system.entry.js.map} +0 -0
  270. /package/dist/twilight/{p-bc48d7b8.system.entry.js.map → p-48ab4e24.system.entry.js.map} +0 -0
  271. /package/dist/twilight/{p-9165a64d.entry.js.map → p-4befb128.entry.js.map} +0 -0
  272. /package/dist/twilight/{p-b39543c1.system.entry.js.map → p-4f852631.system.entry.js.map} +0 -0
  273. /package/dist/twilight/{p-39f531cc.entry.js.map → p-51f461f3.entry.js.map} +0 -0
  274. /package/dist/twilight/{p-e23170f9.system.entry.js.map → p-550cae04.system.entry.js.map} +0 -0
  275. /package/dist/twilight/{p-b5bb38a8.entry.js.map → p-560b9ba3.entry.js.map} +0 -0
  276. /package/dist/twilight/{p-c7692780.entry.js.map → p-56a2f2ce.entry.js.map} +0 -0
  277. /package/dist/twilight/{p-6957616a.entry.js.map → p-58e3f07b.entry.js.map} +0 -0
  278. /package/dist/twilight/{p-331e6845.system.entry.js.map → p-5d544da2.system.entry.js.map} +0 -0
  279. /package/dist/twilight/{p-8446830b.system.entry.js.map → p-6899a6f6.system.entry.js.map} +0 -0
  280. /package/dist/twilight/{p-d5780002.system.entry.js.map → p-70db2d4e.system.entry.js.map} +0 -0
  281. /package/dist/twilight/{p-149de98d.entry.js.map → p-751d4aad.entry.js.map} +0 -0
  282. /package/dist/twilight/{p-590216eb.entry.js.map → p-7bd3640b.entry.js.map} +0 -0
  283. /package/dist/twilight/{p-0b2cb090.entry.js.map → p-80700df9.entry.js.map} +0 -0
  284. /package/dist/twilight/{p-8dc7bd7e.entry.js.map → p-80bc850c.entry.js.map} +0 -0
  285. /package/dist/twilight/{p-08e57dc8.entry.js.map → p-80ce5698.entry.js.map} +0 -0
  286. /package/dist/twilight/{p-43f297d3.entry.js.map → p-81b86d4b.entry.js.map} +0 -0
  287. /package/dist/twilight/{p-73ea40c2.system.entry.js.map → p-845bfe77.system.entry.js.map} +0 -0
  288. /package/dist/twilight/{p-4489393c.system.entry.js.map → p-8504d011.system.entry.js.map} +0 -0
  289. /package/dist/twilight/{p-5621e1a0.entry.js.map → p-8645f64f.entry.js.map} +0 -0
  290. /package/dist/twilight/{p-e160c850.system.entry.js.map → p-88d35160.system.entry.js.map} +0 -0
  291. /package/dist/twilight/{p-973b4a3b.system.entry.js.map → p-9d658a72.system.entry.js.map} +0 -0
  292. /package/dist/twilight/{p-b32a3ff9.entry.js.map → p-9f2daf11.entry.js.map} +0 -0
  293. /package/dist/twilight/{p-c3552207.entry.js.map → p-a16ecc9d.entry.js.map} +0 -0
  294. /package/dist/twilight/{p-4d553bba.system.entry.js.map → p-a222ad24.system.entry.js.map} +0 -0
  295. /package/dist/twilight/{p-a7654fed.system.entry.js.map → p-aaab96da.system.entry.js.map} +0 -0
  296. /package/dist/twilight/{p-00b8c002.entry.js.map → p-afbbbb73.entry.js.map} +0 -0
  297. /package/dist/twilight/{p-2fdc2aec.system.entry.js.map → p-b112893e.system.entry.js.map} +0 -0
  298. /package/dist/twilight/{p-c6df4072.system.entry.js.map → p-b30f4481.system.entry.js.map} +0 -0
  299. /package/dist/twilight/{p-78e79386.system.entry.js.map → p-b5bbcf1a.system.entry.js.map} +0 -0
  300. /package/dist/twilight/{p-43a00683.system.entry.js.map → p-bac69caa.system.entry.js.map} +0 -0
  301. /package/dist/twilight/{p-8940c4cc.entry.js.map → p-bc947447.entry.js.map} +0 -0
  302. /package/dist/twilight/{p-7f010a1f.system.entry.js.map → p-bf5d5375.system.entry.js.map} +0 -0
  303. /package/dist/twilight/{p-a5ab889e.system.entry.js.map → p-c2319979.system.entry.js.map} +0 -0
  304. /package/dist/twilight/{p-cffc4a47.entry.js.map → p-c6b5fa5c.entry.js.map} +0 -0
  305. /package/dist/twilight/{p-fd2c4c29.entry.js.map → p-cb577695.entry.js.map} +0 -0
  306. /package/dist/twilight/{p-12865797.entry.js.map → p-cf16c5b6.entry.js.map} +0 -0
  307. /package/dist/twilight/{p-6674ff60.entry.js.map → p-d6d158ac.entry.js.map} +0 -0
  308. /package/dist/twilight/{p-33caa5c9.system.entry.js.map → p-db051ac6.system.entry.js.map} +0 -0
  309. /package/dist/twilight/{p-6ae8297d.system.entry.js.map → p-ea313a20.system.entry.js.map} +0 -0
  310. /package/dist/twilight/{p-0fb4368c.entry.js.map → p-eee1b538.entry.js.map} +0 -0
  311. /package/dist/twilight/{p-0acc337d.system.entry.js.map → p-f134bc31.system.entry.js.map} +0 -0
  312. /package/dist/twilight/{p-38fc8939.system.entry.js.map → p-f718fce5.system.entry.js.map} +0 -0
  313. /package/dist/twilight/{p-06721e7c.entry.js.map → p-fb6a0296.entry.js.map} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"p-7mw7ykXE.system.js","sources":["src/components/salla-loyalty-program/salla-loyalty-program.scss?tag=salla-loyalty-program","src/components/salla-loyalty-program/salla-loyalty-program.tsx"],"sourcesContent":["","import { Component, Host, h, State } from '@stencil/core';\nimport { LoyaltyItem } from './interfaces';\nimport GiftIcon from '../../assets/svg/gift.svg';\n\nconst formatDate = (timestamp?: number | string) => {\n if (!timestamp) return '';\n return new Date(Number(timestamp)).toLocaleDateString(salla.lang.locale, {\n weekday: 'long',\n year: 'numeric',\n month: 'long',\n day: 'numeric',\n hour: 'numeric',\n });\n};\n\nconst translateKey = (key?: string) => {\n if (!key) return '';\n try {\n const k = key.toLowerCase();\n const translation = salla.lang.get(`pages.loyalty_program.${k}`);\n return translation === `pages.loyalty_program.${k}` ? key : translation;\n } catch {\n return key;\n }\n};\n\n@Component({\n tag: 'salla-loyalty-program',\n styleUrl: 'salla-loyalty-program.scss',\n})\nexport class SallaWalletTable {\n @State() loyaltyPointsArray: Array<LoyaltyItem> = [];\n @State() isLoadingLoyalty: boolean = false;\n @State() nextPageUrlLoyalty: string = '';\n\n componentWillLoad() {\n return salla.onReady().then(() => {\n this.loadLoyaltyPoints();\n });\n }\n\n private handleClick = () => {\n this.loadMoreLoyaltyPoints();\n };\n\n private async loadLoyaltyPoints() {\n this.isLoadingLoyalty = true;\n try {\n let url = `/balance/points?page=1`;\n let resp = await salla.api.request(url);\n \n this.loyaltyPointsArray = resp.data;\n this.nextPageUrlLoyalty = resp.cursor.next; \n \n } catch (error) {\n console.error('Error loading loyalty points transactions', error);\n } finally {\n this.isLoadingLoyalty = false;\n }\n }\n\n private async loadMoreLoyaltyPoints() {\n if (!this.nextPageUrlLoyalty) return;\n this.isLoadingLoyalty = true;\n try {\n let resp = await salla.api.request(this.nextPageUrlLoyalty);\n \n this.loyaltyPointsArray = [...this.loyaltyPointsArray, ...resp.data]; \n this.nextPageUrlLoyalty = resp.cursor?.next || '';\n \n } catch (error) {\n console.error('Error loading more loyalty points', error);\n } finally {\n this.isLoadingLoyalty = false;\n }\n }\n\n render() {\n return (\n <Host>\n <div>\n {this.isLoadingLoyalty ? (\n <salla-loading></salla-loading>\n ) : (\n <div>\n {this.loyaltyPointsArray.length > 0 ? (\n <div>\n <table class=\"s-loyalty-program-table\">\n <thead class=\"s-loyalty-program-table-head\">\n <tr class=\"s-loyalty-program-table-head-tr\">\n <th scope=\"col\" class=\"s-loyalty-program-table-head-tr-th\">{salla.lang.get('pages.wallet.points')}</th>\n <th scope=\"col\" class=\"s-loyalty-program-table-head-tr-th\">{salla.lang.get('pages.wallet.date')}</th>\n <th scope=\"col\" class=\"s-loyalty-program-table-head-tr-th\">{salla.lang.get('pages.wallet.expiry_date')}</th>\n <th scope=\"col\" class=\"s-loyalty-program-table-head-tr-th\">{salla.lang.get('common.elements.note')}</th>\n <th scope=\"col\" class=\"s-loyalty-program-table-head-tr-th\">{salla.lang.get('common.elements.status')}</th>\n </tr>\n </thead>\n <tbody class=\"s-loyalty-program-table-tbody\">\n {this.loyaltyPointsArray.map(point => (\n <tr class=\"s-loyalty-program-table-tbody-tr\">\n <td class=\"s-loyalty-program-table-tbody-tr-td\">\n {point?.type === 'plus' ? '+' : ''}\n {point?.points || ''} {salla.lang.get('pages.loyalty_program.point')}\n </td>\n <td class=\"s-loyalty-program-table-tbody-tr-td\">\n {formatDate(point?.created_at ? Number(point.created_at) * 1000 : undefined)}\n </td>\n <td class=\"s-loyalty-program-table-tbody-tr-td\">\n {formatDate(point?.points_expire_date)}\n </td>\n <td class=\"s-loyalty-program-table-tbody-tr-td\">\n {translateKey(point?.key)}\n </td>\n <td class=\"s-loyalty-program-table-tbody-tr-td\">\n {translateKey(point?.status_key)}\n </td>\n </tr>\n ))}\n </tbody>\n </table>\n <div class=\"s-infinite-scroll-wrapper\">\n {!!this.nextPageUrlLoyalty && (\n <salla-button onClick={this.handleClick} loading={this.isLoadingLoyalty}>\n {salla.lang.get('common.elements.load_more')}\n </salla-button>\n )}\n </div>\n </div>\n ) : (\n <div>\n <div class=\"s-loyalty-program-table-empty-state\">\n <span innerHTML={GiftIcon}></span>\n <div class=\"s-loyalty-program-table-placeholder-title\">\n {salla.lang.get('pages.loyalty_program.no_loyality_points_title')}\n </div>\n <div class=\"s-loyalty-program-table-placeholder-sub-title\">\n {salla.lang.get('pages.loyalty_program.no_loyality_points_sub_title')}\n </div>\n </div>\n </div>\n )}\n </div>\n )}\n </div>\n </Host>\n );\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;YAAA,MAAM,sBAAsB,GAAG,EAAE;;YCIjC,MAAM,UAAU,GAAG,CAAC,SAA2B,KAAI;YACjD,IAAA,IAAI,CAAC,SAAS;YAAE,QAAA,OAAO,EAAE;YACzB,IAAA,OAAO,IAAI,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,kBAAkB,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE;YACvE,QAAA,OAAO,EAAE,MAAM;YACf,QAAA,IAAI,EAAE,SAAS;YACf,QAAA,KAAK,EAAE,MAAM;YACb,QAAA,GAAG,EAAE,SAAS;YACd,QAAA,IAAI,EAAE,SAAS;YAChB,KAAA,CAAC;YACJ,CAAC;YAED,MAAM,YAAY,GAAG,CAAC,GAAY,KAAI;YACpC,IAAA,IAAI,CAAC,GAAG;YAAE,QAAA,OAAO,EAAE;YACnB,IAAA,IAAI;YACF,QAAA,MAAM,CAAC,GAAG,GAAG,CAAC,WAAW,EAAE;YAC3B,QAAA,MAAM,WAAW,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAyB,sBAAA,EAAA,CAAC,CAAE,CAAA,CAAC;YAChE,QAAA,OAAO,WAAW,KAAK,CAAyB,sBAAA,EAAA,CAAC,CAAE,CAAA,GAAG,GAAG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;;;;;;;"}
1
+ {"version":3,"file":"p-uqDS_0s2.system.js","sources":["src/components/salla-loyalty-program/salla-loyalty-program.scss?tag=salla-loyalty-program","src/components/salla-loyalty-program/salla-loyalty-program.tsx"],"sourcesContent":["","import { Component, Host, h, State } from '@stencil/core';\nimport { LoyaltyItem } from './interfaces';\nimport GiftIcon from '../../assets/svg/gift.svg';\n\nconst formatDate = (timestamp?: number | string) => {\n if (!timestamp) return '';\n return new Date(Number(timestamp)).toLocaleDateString(salla.lang.locale, {\n weekday: 'long',\n year: 'numeric',\n month: 'long',\n day: 'numeric',\n hour: 'numeric',\n });\n};\n\nconst translateKey = (key?: string) => {\n if (!key) return '';\n try {\n const k = key.toLowerCase();\n const translation = salla.lang.get(`pages.loyalty_program.${k}`);\n return translation === `pages.loyalty_program.${k}` ? key : translation;\n } catch {\n return key;\n }\n};\n\n@Component({\n tag: 'salla-loyalty-program',\n styleUrl: 'salla-loyalty-program.scss',\n})\nexport class SallaWalletTable {\n @State() loyaltyPointsArray: Array<LoyaltyItem> = [];\n @State() isLoadingLoyalty: boolean = false;\n @State() nextPageUrlLoyalty: string = '';\n\n componentWillLoad() {\n return salla.onReady().then(() => {\n this.loadLoyaltyPoints();\n });\n }\n\n private handleClick = () => {\n this.loadMoreLoyaltyPoints();\n };\n\n private async loadLoyaltyPoints() {\n this.isLoadingLoyalty = true;\n try {\n let url = `/balance/points?page=1`;\n let resp = await salla.api.request(url);\n \n this.loyaltyPointsArray = resp.data;\n this.nextPageUrlLoyalty = resp.cursor.next; \n \n } catch (error) {\n console.error('Error loading loyalty points transactions', error);\n } finally {\n this.isLoadingLoyalty = false;\n }\n }\n\n private async loadMoreLoyaltyPoints() {\n if (!this.nextPageUrlLoyalty) return;\n this.isLoadingLoyalty = true;\n try {\n let resp = await salla.api.request(this.nextPageUrlLoyalty);\n \n this.loyaltyPointsArray = [...this.loyaltyPointsArray, ...resp.data]; \n this.nextPageUrlLoyalty = resp.cursor?.next || '';\n \n } catch (error) {\n console.error('Error loading more loyalty points', error);\n } finally {\n this.isLoadingLoyalty = false;\n }\n }\n\n render() {\n return (\n <Host>\n <div>\n {this.isLoadingLoyalty ? (\n <salla-loading></salla-loading>\n ) : (\n <div>\n {this.loyaltyPointsArray.length > 0 ? (\n <div>\n <table class=\"s-loyalty-program-table\">\n <thead class=\"s-loyalty-program-table-head\">\n <tr class=\"s-loyalty-program-table-head-tr\">\n <th scope=\"col\" class=\"s-loyalty-program-table-head-tr-th\">{salla.lang.get('pages.wallet.points')}</th>\n <th scope=\"col\" class=\"s-loyalty-program-table-head-tr-th\">{salla.lang.get('pages.wallet.date')}</th>\n <th scope=\"col\" class=\"s-loyalty-program-table-head-tr-th\">{salla.lang.get('pages.wallet.expiry_date')}</th>\n <th scope=\"col\" class=\"s-loyalty-program-table-head-tr-th\">{salla.lang.get('common.elements.note')}</th>\n <th scope=\"col\" class=\"s-loyalty-program-table-head-tr-th\">{salla.lang.get('common.elements.status')}</th>\n </tr>\n </thead>\n <tbody class=\"s-loyalty-program-table-tbody\">\n {this.loyaltyPointsArray.map(point => (\n <tr class=\"s-loyalty-program-table-tbody-tr\">\n <td class=\"s-loyalty-program-table-tbody-tr-td\">\n {point?.type === 'plus' ? '+' : ''}\n {point?.points || ''} {salla.lang.get('pages.loyalty_program.point')}\n </td>\n <td class=\"s-loyalty-program-table-tbody-tr-td\">\n {formatDate(point?.created_at ? Number(point.created_at) * 1000 : undefined)}\n </td>\n <td class=\"s-loyalty-program-table-tbody-tr-td\">\n {formatDate(point?.points_expire_date)}\n </td>\n <td class=\"s-loyalty-program-table-tbody-tr-td\">\n {translateKey(point?.key)}\n </td>\n <td class=\"s-loyalty-program-table-tbody-tr-td\">\n {translateKey(point?.status_key)}\n </td>\n </tr>\n ))}\n </tbody>\n </table>\n <div class=\"s-infinite-scroll-wrapper\">\n {!!this.nextPageUrlLoyalty && (\n <salla-button onClick={this.handleClick} loading={this.isLoadingLoyalty}>\n {salla.lang.get('common.elements.load_more')}\n </salla-button>\n )}\n </div>\n </div>\n ) : (\n <div>\n <div class=\"s-loyalty-program-table-empty-state\">\n <span innerHTML={GiftIcon}></span>\n <div class=\"s-loyalty-program-table-placeholder-title\">\n {salla.lang.get('pages.loyalty_program.no_loyality_points_title')}\n </div>\n <div class=\"s-loyalty-program-table-placeholder-sub-title\">\n {salla.lang.get('pages.loyalty_program.no_loyality_points_sub_title')}\n </div>\n </div>\n </div>\n )}\n </div>\n )}\n </div>\n </Host>\n );\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;YAAA,MAAM,sBAAsB,GAAG,EAAE;;YCIjC,MAAM,UAAU,GAAG,CAAC,SAA2B,KAAI;YACjD,IAAA,IAAI,CAAC,SAAS;YAAE,QAAA,OAAO,EAAE;YACzB,IAAA,OAAO,IAAI,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,kBAAkB,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE;YACvE,QAAA,OAAO,EAAE,MAAM;YACf,QAAA,IAAI,EAAE,SAAS;YACf,QAAA,KAAK,EAAE,MAAM;YACb,QAAA,GAAG,EAAE,SAAS;YACd,QAAA,IAAI,EAAE,SAAS;YAChB,KAAA,CAAC;YACJ,CAAC;YAED,MAAM,YAAY,GAAG,CAAC,GAAY,KAAI;YACpC,IAAA,IAAI,CAAC,GAAG;YAAE,QAAA,OAAO,EAAE;YACnB,IAAA,IAAI;YACF,QAAA,MAAM,CAAC,GAAG,GAAG,CAAC,WAAW,EAAE;YAC3B,QAAA,MAAM,WAAW,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAyB,sBAAA,EAAA,CAAC,CAAE,CAAA,CAAC;YAChE,QAAA,OAAO,WAAW,KAAK,CAAyB,sBAAA,EAAA,CAAC,CAAE,CAAA,GAAG,GAAG,GAAG,WAAW;;gBACvE,OAAA,EAAA,EAAM;YACN,QAAA,OAAO,GAAG;;YAEd,CAAC;kBAMY,gBAAgB,oCAAA,MAAA;YAJ7B,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K,KAAL,MAAA,GAAA,MAAA,GAAA,KAAK,CAAE,kBAAkB,CAAC,CACnC,EACL,CAAA,CAAA,IAAA,EAAA,EAAI,KAAK,EAAC,qCAAqC,EAAA,EAC5C,YAAY,CAAC,KAAK,KAAL,IAAA,IAAA,KAAK,KAAL,MAAA,GAAA,MAAA,GAAA,KAAK,CAAE,GAAG,CAAC,CACtB,EACL,CAAA,CAAA,IAAA,EAAA,EAAI,KAAK,EAAC,qCAAqC,IAC5C,YAAY,CAAC,KAAK,KAAL,IAAA,IAAA,KAAK,uBAAL,KAAK,CAAE,UAAU,CAAC,CAC7B,CACF,CACN,CAAC,CACI,CACF,EACR,CAAA,CAAA,KAAA,EAAA,EAAK,KAAK,EAAC,2BAA2B,IACnC,CAAC,CAAC,IAAI,CAAC,kBAAkB,KACxB,oBAAc,OAAO,EAAE,IAAI,CAAC,WAAW,EAAE,OAAO,EAAE,IAAI,CAAC,gBAAgB,EACpE,EAAA,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,2BAA2B,CAAC,CAC/B,CAChB,CACG,CACF,KAEN,CAAA,CAAA,KAAA,EAAA,IAAA,EACE,CAAK,CAAA,KAAA,EAAA,EAAA,KAAK,EAAC,qCAAqC,EAAA,EAC9C,CAAM,CAAA,MAAA,EAAA,EAAA,SAAS,EAAE,QAAQ,EAAS,CAAA,EAClC,CAAA,CAAA,KAAA,EAAA,EAAK,KAAK,EAAC,2CAA2C,EAAA,EACnD,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,gDAAgD,CAAC,CAC7D,EACN,CAAK,CAAA,KAAA,EAAA,EAAA,KAAK,EAAC,+CAA+C,EAAA,EACvD,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,oDAAoD,CAAC,CACjE,CACF,CACF,CACP,CACG,CACP,CACG,CACD;;;;;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"salla-conditional-offer.entry.esm.js","sources":["src/components/salla-conditional-offer/interfaces.ts","src/components/salla-conditional-offer/salla-conditional-offer.scss?tag=salla-conditional-offer","src/components/salla-conditional-offer/salla-conditional-offer.tsx"],"sourcesContent":["import type { Product } from \"@salla.sa/twilight/types/common\";\n\nexport enum DiscountType {\n PERCENTAGE = \"percentage\",\n FIXED = \"fixed\",\n FREE_PRODUCT = \"free_product\",\n}\n\nexport enum OfferType {\n PRODUCT_COUNT = \"products_count\",\n PRODUCT_PURCHASE = \"order_amount\",\n}\n\nexport interface Discount {\n type?: DiscountType;\n value?: number;\n min_spend?: number;\n max_discount?: number;\n}\n\nexport interface OfferDetails {\n based_on?: OfferType;\n ends_at?: number;\n start_value?: number;\n end_value?: number;\n current_value?: number;\n discounts?: Discount[];\n}\n\nexport interface Offer {\n id?: number;\n type?: string;\n title?: string;\n description?: string;\n details?: OfferDetails | null;\n}\n\n\nexport interface ProductDetail {\n id?: number;\n sku?: string;\n name?: string;\n description?: string;\n url?: string;\n promotion_title?: null;\n subtitle?: null;\n type?: string;\n status?: string;\n price?: number;\n base_currency_price?: BaseCurrencyPrice;\n sale_price?: number;\n regular_price?: number;\n starting_price?: null;\n quantity?: null;\n max_quantity?: number;\n discount_ends?: null;\n is_taxable?: boolean;\n has_read_more?: boolean;\n can_add_note?: boolean;\n can_show_remained_quantity?: boolean;\n can_upload_file?: boolean;\n has_custom_form?: boolean;\n has_metadata?: boolean;\n is_on_sale?: boolean;\n is_hidden_quantity?: boolean;\n is_available?: boolean;\n is_out_of_stock?: boolean;\n is_require_shipping?: boolean;\n weight?: null;\n calories?: null;\n image?: Image;\n currency?: string;\n}\n\nexport interface BaseCurrencyPrice {\n currency?: string;\n amount?: number;\n}\n\nexport interface Image {\n url?: string;\n alt?: string;\n}\n\nexport interface UpdatedCart {\n items: Array<Product>;\n sub_total: number;\n}\n",":host {\n display: block;\n}","import { Component, Host, State, h } from \"@stencil/core\";\nimport {\n type Discount,\n DiscountType,\n type Offer,\n OfferType,\n type UpdatedCart,\n} from \"./interfaces\";\nimport type { Product } from \"@salla.sa/twilight/types/common\";\n\n@Component({\n tag: \"salla-conditional-offer\",\n styleUrl: \"salla-conditional-offer.scss\",\n})\nexport class SallaConditionalOffer {\n\n @State() offer: Offer = null;\n @State() products: Record<string, Pick<Product, 'image' | 'url'>> = {}\n @State() isLoading = false\n @State() canRender = true\n\n componentWillLoad() {\n salla.onReady().then(() => {\n if (!salla.config.get('store.features')?.includes('conditional-offer') || (salla.storage.get(\"cart\") !== '' && !salla.storage.get(\"cart\")?.summary?.count)) {\n throw new Error('feature or cart object does not existed');\n }\n })\n .then(() => salla.api.cart.offers())\n .then(({ data }: { data: Offer[] }) => {\n this.offer = data.find(offer => offer.type === \"conditional\")\n\n if (!this.offer) {\n this.canRender = false\n return;\n }\n\n this.isLoading = true\n this.offer.details.discounts.unshift(({ value: 0, min_spend: 0 }))\n return this.updateInitialOfferValue()\n }).then(() => {\n if (!this.offer) return;\n return this.getProducts()\n }).then(() => {\n if (!this.offer) return;\n salla.event.on(\"cart::updated\", (updatedCart: UpdatedCart) => this.updateOfferValues(updatedCart))\n })\n .catch(error => {\n this.canRender = false\n salla.logger.warn('salla-conditional-offer:: ', error)\n }).finally(() => {\n this.isLoading = false\n })\n\n }\n\n private getProducts() {\n const freeProductIDs = this.offer.details.discounts.filter(({ type }) => type === DiscountType.FREE_PRODUCT).map(({ value }) => value)\n if (freeProductIDs.length > 0) {\n return salla.product.fetch({ source: 'selected', source_value: freeProductIDs }).then(({ data }: { data: Array<Product> }) => {\n data.forEach(({ id, url, image }) => {\n this.products[id] = { url, image }\n })\n })\n }\n }\n\n private updateInitialOfferValue() {\n return salla.api.cart.details().then(({ data: { cart } }: { data: { cart: UpdatedCart } }) => this.updateOfferValues(cart))\n }\n\n private updateOfferValues({ items, sub_total }: UpdatedCart) {\n const current_value = this.offer.details.based_on === OfferType.PRODUCT_COUNT ? items.reduce((count: number, { quantity }) => count + quantity, 0,) : sub_total\n //we need to assign the offer object a new reference to trigger re-rendering\n this.offer = {\n ...this.offer, details: {\n ...this.offer?.details, current_value,\n }\n }\n return this.offer\n }\n\n private getCheckpointContent(discount: Discount) {\n\n if (discount.type === DiscountType.PERCENTAGE) return `${discount.value}%`\n\n if (discount.type === DiscountType.FIXED) return salla.money(discount.value)\n\n if (discount.type !== DiscountType.FREE_PRODUCT) {\n salla.logger.error(`salla-conditional-offer:: unexpected type (${discount.type})!`);\n return \"\";\n }\n\n const productItem = this.products[discount.value]\n\n if (!productItem) {\n salla.logger.error(`salla-conditional-offer:: there is no product with id (${discount.value})!`);\n return \"\";\n }\n\n return <a class=\"s-conditional-offer-product-link\" href={productItem.url} >\n <img\n class=\"s-conditional-offer-checkpoint-image-content\"\n loading=\"lazy\"\n decoding=\"async\"\n alt={productItem?.image?.alt || \"\"}\n src={productItem?.image?.url} />\n </a>\n }\n\n private getOfferType(discount: Discount): string {\n const basedOn = this.offer.details?.based_on;\n if (basedOn === OfferType.PRODUCT_COUNT) return salla.lang.choice(\"blocks.header.products_count\", discount.min_spend);\n if (basedOn === OfferType.PRODUCT_PURCHASE) return salla.money(discount.min_spend);\n\n salla.logger.warn(`salla-conditional-offer:: Unexpected offer detail's based_on value: ${basedOn}`);\n return `${discount.min_spend}`;\n }\n\n private clamp(value: number, min: number, max: number) {\n return Math.max(min, Math.min(value, max));\n }\n\n private mapValueRanges(value: number, initialMinRange: number, initialMaxRange: number, newMinRange: number, newMaxRange: number) {\n\n const newRange = ((value - initialMinRange) * (newMaxRange - newMinRange)) / (initialMaxRange - initialMinRange) + newMinRange;\n\n if (newRange === Number.POSITIVE_INFINITY) return 100\n\n if (newRange === Number.NEGATIVE_INFINITY) return 0\n\n return this.clamp(newRange, 0, 100)\n }\n\n private getCheckPointView(discount: Discount, index: number) {\n const checkpointIndex = this.offer.details.discounts.findIndex(({ min_spend }) => min_spend === discount.min_spend);\n const previousCheckpointValue = this.offer.details.discounts[checkpointIndex - 1]?.min_spend ?? 0;\n const progressPercentage = this.mapValueRanges(this.offer.details.current_value, previousCheckpointValue, discount.min_spend, 0, 100);\n const isActive = discount.min_spend <= this.offer.details.current_value;\n\n return (\n <div class=\"s-conditional-offer-checkpoint-container\">\n {index > 0 ? [\n <div key=\"progress-line\" class=\"s-conditional-offer-progress-line-container\">\n <div class=\"s-conditional-offer-progress-line-inactive\" />\n <div class=\"s-conditional-offer-progress-line-active\" style={{ width: `${progressPercentage}%` }} />\n </div>,\n <div key=\"checkpoint\" class={`s-conditional-offer-checkpoint ${isActive ? \"s-conditional-offer-active-checkpoint\" : \"\"}`} >\n <div class={`s-conditional-offer-item-avatar-content ${isActive ? \"active\" : \"\"}`} innerHTML={this.products && this.getCheckpointContent(discount)}>\n </div>\n <div class={`s-conditional-offer-checkpoint-label ${isActive ? \"active\" : \"\"}`} innerHTML={this.getOfferType(discount)} />\n\n </div>\n ] :\n <div key=\"label\" class={{ \"s-conditional-offer-checkpoint-label\": true, \"first-checkpoint\": index === 0, active: isActive }} innerHTML={this.getOfferType(discount)} />\n }\n </div>\n );\n }\n\n private getLoadingSkeletonView() {\n return <Host class=\"s-conditional-offer-container\" >\n <div class=\"s-conditional-offer-skeleton-inner-container\">\n <div class=\"s-conditional-offer-skeleton-subtitle\">\n <salla-skeleton height=\"16px\" width=\"30%\" />\n </div>\n\n <div class=\"s-conditional-offer-skeleton-subtitle\">\n <salla-skeleton height=\"16px\" width=\"35%\" />\n </div>\n <div class=\"s-conditional-offer-skeleton-checkpoints-wrapper\">\n {Array(3).fill(null).map(() => (\n [<salla-skeleton key=\"checkpoint-line\" height=\"8px\" />,\n <div key=\"checkpoint\">\n <salla-skeleton height=\"60px\" width=\"60px\" type=\"circle\" />\n </div>]\n ))}\n </div>\n\n </div>\n </Host>\n }\n\n render() {\n if (!this.canRender) return null\n if (this.isLoading) return this.getLoadingSkeletonView()\n if (!this.offer) return null\n\n return <Host class=\"s-conditional-offer-container\">\n <div class=\"s-conditional-offer-title-wrapper\">\n <div class=\"s-conditional-offer-title\">{this.offer.title}</div>\n {this.offer.description ? <div class=\"s-conditional-offer-subtitle\">\n {this.offer.description} <i class=\"sicon-information\" />\n </div> : null}\n </div>\n <div class=\"s-conditional-offer-progress-container\">\n {this.offer.details.discounts.map((discount, index) => (\n <div class={{ \"flex-1\": index > 0 }} key={discount.min_spend}>\n {this.getCheckPointView(discount, index)}\n </div>\n ))}\n </div>\n </Host>\n }\n}\n"],"names":[],"mappings":";;;;;AAEA,IAAY,YAIX;AAJD,CAAA,UAAY,YAAY,EAAA;AACpB,IAAA,YAAA,CAAA,YAAA,CAAA,GAAA,YAAyB;AACzB,IAAA,YAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACf,IAAA,YAAA,CAAA,cAAA,CAAA,GAAA,cAA6B;AACjC,CAAC,EAJW,YAAY,KAAZ,YAAY,GAIvB,EAAA,CAAA,CAAA;AAED,IAAY,SAGX;AAHD,CAAA,UAAY,SAAS,EAAA;AACjB,IAAA,SAAA,CAAA,eAAA,CAAA,GAAA,gBAAgC;AAChC,IAAA,SAAA,CAAA,kBAAA,CAAA,GAAA,cAAiC;AACrC,CAAC,EAHW,SAAS,KAAT,SAAS,GAGpB,EAAA,CAAA,CAAA;;ACXD,MAAM,wBAAwB,GAAG,sBAAsB;;MCc1C,qBAAqB,GAAA,MAAA;AAJlC,IAAA,WAAA,CAAA,OAAA,EAAA;;AAMa,QAAA,IAAK,CAAA,KAAA,GAAU,IAAI;AACnB,QAAA,IAAQ,CAAA,QAAA,GAAmD,EAAE;AAC7D,QAAA,IAAS,CAAA,SAAA,GAAG,KAAK;AACjB,QAAA,IAAS,CAAA,SAAA,GAAG,IAAI;AAwL5B;IAtLG,iBAAiB,GAAA;AACb,QAAA,KAAK,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,MAAK;;YACtB,IAAI,EAAC,CAAA,EAAA,GAAA,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,gBAAgB,CAAC,0CAAE,QAAQ,CAAC,mBAAmB,CAAC,CAAA,KAAK,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,IAA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KAAA,EAAA,EAAK,KAAK,EAAC,8BAA8B,EAAA,EAC9D,IAAI,CAAC,KAAK,CAAC,WAAW,OAAE,CAAG,CAAA,GAAA,EAAA,EAAA,KAAK,EAAC,mBAAmB,EAAA,CAAG,CACtD,GAAG,IAAI,CACX,EACN,CAAK,CAAA,KAAA,EAAA,EAAA,KAAK,EAAC,wCAAwC,EAC9C,EAAA,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,KAAK,MAC9C,CAAK,CAAA,KAAA,EAAA,EAAA,KAAK,EAAE,EAAE,QAAQ,EAAE,KAAK,GAAG,CAAC,EAAE,EAAE,GAAG,EAAE,QAAQ,CAAC,SAAS,EACvD,EAAA,IAAI,CAAC,iBAAiB,CAAC,QAAQ,EAAE,KAAK,CAAC,CACtC,CACT,CAAC,CACA,CACH;;;;;;;"}
1
+ {"version":3,"file":"salla-conditional-offer.entry.esm.js","sources":["src/components/salla-conditional-offer/interfaces.ts","src/components/salla-conditional-offer/salla-conditional-offer.scss?tag=salla-conditional-offer","src/components/salla-conditional-offer/salla-conditional-offer.tsx"],"sourcesContent":["import type { Product } from \"@salla.sa/twilight/types/common\";\n\nexport enum DiscountType {\n PERCENTAGE = \"percentage\",\n FIXED = \"fixed\",\n FREE_PRODUCT = \"free_product\",\n}\n\nexport enum OfferType {\n PRODUCT_COUNT = \"products_count\",\n PRODUCT_PURCHASE = \"order_amount\",\n}\n\nexport interface Discount {\n type?: DiscountType;\n value?: number;\n min_spend?: number;\n max_discount?: number;\n}\n\nexport interface OfferDetails {\n based_on?: OfferType;\n ends_at?: number;\n start_value?: number;\n end_value?: number;\n current_value?: number;\n discounts?: Discount[];\n}\n\nexport interface Offer {\n id?: number;\n type?: string;\n title?: string;\n description?: string;\n details?: OfferDetails | null;\n}\n\n\nexport interface ProductDetail {\n id?: number;\n sku?: string;\n name?: string;\n description?: string;\n url?: string;\n promotion_title?: null;\n subtitle?: null;\n type?: string;\n status?: string;\n price?: number;\n base_currency_price?: BaseCurrencyPrice;\n sale_price?: number;\n regular_price?: number;\n starting_price?: null;\n quantity?: null;\n max_quantity?: number;\n discount_ends?: null;\n is_taxable?: boolean;\n has_read_more?: boolean;\n can_add_note?: boolean;\n can_show_remained_quantity?: boolean;\n can_upload_file?: boolean;\n has_custom_form?: boolean;\n has_metadata?: boolean;\n is_on_sale?: boolean;\n is_hidden_quantity?: boolean;\n is_available?: boolean;\n is_out_of_stock?: boolean;\n is_require_shipping?: boolean;\n weight?: null;\n calories?: null;\n image?: Image;\n currency?: string;\n}\n\nexport interface BaseCurrencyPrice {\n currency?: string;\n amount?: number;\n}\n\nexport interface Image {\n url?: string;\n alt?: string;\n}\n\nexport interface UpdatedCart {\n items: Array<Product>;\n sub_total: number;\n}\n",":host {\n display: block;\n}","import { Component, Host, State, h } from \"@stencil/core\";\nimport {\n type Discount,\n DiscountType,\n type Offer,\n OfferType,\n type UpdatedCart,\n} from \"./interfaces\";\nimport type { Product } from \"@salla.sa/twilight/types/common\";\n\n@Component({\n tag: \"salla-conditional-offer\",\n styleUrl: \"salla-conditional-offer.scss\",\n})\nexport class SallaConditionalOffer {\n\n @State() offer: Offer = null;\n @State() products: Record<string, Pick<Product, 'image' | 'url'>> = {}\n @State() isLoading = false\n @State() canRender = true\n\n componentWillLoad() {\n salla.onReady().then(() => {\n if (!salla.config.get('store.features')?.includes('conditional-offer') || (salla.storage.get(\"cart\") !== '' && !salla.storage.get(\"cart\")?.summary?.count)) {\n throw new Error('feature or cart object does not existed');\n }\n })\n .then(() => salla.api.cart.offers())\n .then(({ data }: { data: Offer[] }) => {\n this.offer = data.find(offer => offer.type === \"conditional\")\n\n if (!this.offer) {\n this.canRender = false\n return;\n }\n\n this.isLoading = true\n this.offer.details.discounts.unshift(({ value: 0, min_spend: 0 }))\n return this.updateInitialOfferValue()\n }).then(() => {\n if (!this.offer) return;\n return this.getProducts()\n }).then(() => {\n if (!this.offer) return;\n salla.event.on(\"cart::updated\", (updatedCart: UpdatedCart) => this.updateOfferValues(updatedCart))\n })\n .catch(error => {\n this.canRender = false\n salla.logger.warn('salla-conditional-offer:: ', error)\n }).finally(() => {\n this.isLoading = false\n })\n\n }\n\n private getProducts() {\n const freeProductIDs = this.offer.details.discounts.filter(({ type }) => type === DiscountType.FREE_PRODUCT).map(({ value }) => value)\n if (freeProductIDs.length > 0) {\n return salla.product.fetch({ source: 'selected', source_value: freeProductIDs }).then(({ data }: { data: Array<Product> }) => {\n data.forEach(({ id, url, image }) => {\n this.products[id] = { url, image }\n })\n })\n }\n }\n\n private updateInitialOfferValue() {\n return salla.api.cart.details().then(({ data: { cart } }: { data: { cart: UpdatedCart } }) => this.updateOfferValues(cart))\n }\n\n private updateOfferValues({ items, sub_total }: UpdatedCart) {\n const current_value = this.offer.details.based_on === OfferType.PRODUCT_COUNT ? items?.reduce((count: number, { quantity }) => count + quantity, 0) ?? 0 : sub_total\n //we need to assign the offer object a new reference to trigger re-rendering\n this.offer = {\n ...this.offer, details: {\n ...this.offer?.details, current_value,\n }\n }\n return this.offer\n }\n\n private getCheckpointContent(discount: Discount) {\n\n if (discount.type === DiscountType.PERCENTAGE) return `${discount.value}%`\n\n if (discount.type === DiscountType.FIXED) return salla.money(discount.value)\n\n if (discount.type !== DiscountType.FREE_PRODUCT) {\n salla.logger.error(`salla-conditional-offer:: unexpected type (${discount.type})!`);\n return \"\";\n }\n\n const productItem = this.products[discount.value]\n\n if (!productItem) {\n salla.logger.error(`salla-conditional-offer:: there is no product with id (${discount.value})!`);\n return \"\";\n }\n\n return <a class=\"s-conditional-offer-product-link\" href={productItem.url} >\n <img\n class=\"s-conditional-offer-checkpoint-image-content\"\n loading=\"lazy\"\n decoding=\"async\"\n alt={productItem?.image?.alt || \"\"}\n src={productItem?.image?.url} />\n </a>\n }\n\n private getOfferType(discount: Discount): string {\n const basedOn = this.offer.details?.based_on;\n if (basedOn === OfferType.PRODUCT_COUNT) return salla.lang.choice(\"blocks.header.products_count\", discount.min_spend);\n if (basedOn === OfferType.PRODUCT_PURCHASE) return salla.money(discount.min_spend);\n\n salla.logger.warn(`salla-conditional-offer:: Unexpected offer detail's based_on value: ${basedOn}`);\n return `${discount.min_spend}`;\n }\n\n private clamp(value: number, min: number, max: number) {\n return Math.max(min, Math.min(value, max));\n }\n\n private mapValueRanges(value: number, initialMinRange: number, initialMaxRange: number, newMinRange: number, newMaxRange: number) {\n\n const newRange = ((value - initialMinRange) * (newMaxRange - newMinRange)) / (initialMaxRange - initialMinRange) + newMinRange;\n\n if (newRange === Number.POSITIVE_INFINITY) return 100\n\n if (newRange === Number.NEGATIVE_INFINITY) return 0\n\n return this.clamp(newRange, 0, 100)\n }\n\n private getCheckPointView(discount: Discount, index: number) {\n const checkpointIndex = this.offer.details.discounts.findIndex(({ min_spend }) => min_spend === discount.min_spend);\n const previousCheckpointValue = this.offer.details.discounts[checkpointIndex - 1]?.min_spend ?? 0;\n const progressPercentage = this.mapValueRanges(this.offer.details.current_value, previousCheckpointValue, discount.min_spend, 0, 100);\n const isActive = discount.min_spend <= this.offer.details.current_value;\n\n return (\n <div class=\"s-conditional-offer-checkpoint-container\">\n {index > 0 ? [\n <div key=\"progress-line\" class=\"s-conditional-offer-progress-line-container\">\n <div class=\"s-conditional-offer-progress-line-inactive\" />\n <div class=\"s-conditional-offer-progress-line-active\" style={{ width: `${progressPercentage}%` }} />\n </div>,\n <div key=\"checkpoint\" class={`s-conditional-offer-checkpoint ${isActive ? \"s-conditional-offer-active-checkpoint\" : \"\"}`} >\n <div class={`s-conditional-offer-item-avatar-content ${isActive ? \"active\" : \"\"}`} innerHTML={this.products && this.getCheckpointContent(discount)}>\n </div>\n <div class={`s-conditional-offer-checkpoint-label ${isActive ? \"active\" : \"\"}`} innerHTML={this.getOfferType(discount)} />\n\n </div>\n ] :\n <div key=\"label\" class={{ \"s-conditional-offer-checkpoint-label\": true, \"first-checkpoint\": index === 0, active: isActive }} innerHTML={this.getOfferType(discount)} />\n }\n </div>\n );\n }\n\n private getLoadingSkeletonView() {\n return <Host class=\"s-conditional-offer-container\" >\n <div class=\"s-conditional-offer-skeleton-inner-container\">\n <div class=\"s-conditional-offer-skeleton-subtitle\">\n <salla-skeleton height=\"16px\" width=\"30%\" />\n </div>\n\n <div class=\"s-conditional-offer-skeleton-subtitle\">\n <salla-skeleton height=\"16px\" width=\"35%\" />\n </div>\n <div class=\"s-conditional-offer-skeleton-checkpoints-wrapper\">\n {Array(3).fill(null).map(() => (\n [<salla-skeleton key=\"checkpoint-line\" height=\"8px\" />,\n <div key=\"checkpoint\">\n <salla-skeleton height=\"60px\" width=\"60px\" type=\"circle\" />\n </div>]\n ))}\n </div>\n\n </div>\n </Host>\n }\n\n render() {\n if (!this.canRender) return null\n if (this.isLoading) return this.getLoadingSkeletonView()\n if (!this.offer) return null\n\n return <Host class=\"s-conditional-offer-container\">\n <div class=\"s-conditional-offer-title-wrapper\">\n <div class=\"s-conditional-offer-title\">{this.offer.title}</div>\n {this.offer.description ? <div class=\"s-conditional-offer-subtitle\">\n {this.offer.description} <i class=\"sicon-information\" />\n </div> : null}\n </div>\n <div class=\"s-conditional-offer-progress-container\">\n {this.offer.details.discounts.map((discount, index) => (\n <div class={{ \"flex-1\": index > 0 }} key={discount.min_spend}>\n {this.getCheckPointView(discount, index)}\n </div>\n ))}\n </div>\n </Host>\n }\n}\n"],"names":[],"mappings":";;;;;AAEA,IAAY,YAIX;AAJD,CAAA,UAAY,YAAY,EAAA;AACpB,IAAA,YAAA,CAAA,YAAA,CAAA,GAAA,YAAyB;AACzB,IAAA,YAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACf,IAAA,YAAA,CAAA,cAAA,CAAA,GAAA,cAA6B;AACjC,CAAC,EAJW,YAAY,KAAZ,YAAY,GAIvB,EAAA,CAAA,CAAA;AAED,IAAY,SAGX;AAHD,CAAA,UAAY,SAAS,EAAA;AACjB,IAAA,SAAA,CAAA,eAAA,CAAA,GAAA,gBAAgC;AAChC,IAAA,SAAA,CAA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AAS,EACvD,EAAA,IAAI,CAAC,iBAAiB,CAAC,QAAQ,EAAE,KAAK,CAAC,CACtC,CACT,CAAC,CACA,CACH;;;;;;;"}
@@ -1,5 +1,5 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{p as e,b as a}from"./p-CNDQzdP7.js";export{s as setNonce}from"./p-CNDQzdP7.js";import{g as t}from"./p-C6ZcRXfC.js";var l=()=>{const a=import.meta.url;const t={};if(a!==""){t.resourcesUrl=new URL(".",a).href}return e(t)};l().then((async e=>{await t();return a(JSON.parse('[["p-8940c4cc",[[0,"salla-offer",{"productCardComponent":[1,"product-card-component"],"offersList":[32],"userCurrency":[32],"isMultipleBank":[32],"title":[32],"currentPage":[32],"hasCustomComponent":[32],"isBankOffer":[32],"canRender":[32],"showOffer":[32],"offer_with_price_text":[32],"with_discount_text":[32],"product_discount_text":[32],"special_offer_text":[32],"multipleBankOfferTitleText":[32],"multipleBankOfferTitleDescription":[32],"buy_quantity_text":[32]}]]],["p-0b2cb090",[[0,"salla-product-options",{"productId":[2,"product-id"],"options":[1],"hideOutLabel":[1,"hide-out-label"],"uniqueKey":[1,"unique-key"],"config":[1],"optionsData":[32],"outOfStockText":[32],"donationAmount":[32],"selectDonationAmount":[32],"selectAmount":[32],"isCustomDonation":[32],"selectedOptions":[32],"canDisabled":[32],"selectedSkus":[32],"selectedOutSkus":[32],"disableCardValue":[32],"availableDigitalCardValues":[32],"setOptionsData":[64],"getSelectedOptionsData":[64],"reportValidity":[64],"hasOutOfStockOption":[64],"getSelectedOptions":[64],"getOption":[64]}]]],["p-9a1eac46",[[0,"salla-filters",{"filters":[1040],"isSidebarOpen":[32],"filtersData":[32],"apply":[32],"reset":[32],"getFilters":[64],"applyFilters":[64],"resetFilters":[64]}]]],["p-06721e7c",[[4,"salla-verify",{"display":[1],"type":[1025],"autoReload":[4,"auto-reload"],"supportWebAuth":[4,"support-web-auth"],"translationLoaded":[32],"title":[32],"resendAfter":[32],"hasError":[32],"errorMessage":[32],"isProfileVerify":[32],"getCode":[64],"open":[64]}]]],["p-f2645988",[[0,"salla-loyalty-program",{"loyaltyPointsArray":[32],"isLoadingLoyalty":[32],"nextPageUrlLoyalty":[32]}]]],["p-39f531cc",[[0,"salla-notifications",{"loadMoreText":[1,"load-more-text"],"itemPerPage":[2,"item-per-page"],"pagination":[32],"total":[32],"showPlaceholder":[32],"nextPage":[32],"no_notifications_trans":[32],"load_more_text_trans":[32]}]]],["p-b32a3ff9",[[0,"salla-order-summary",{"orderId":[514,"order-id"],"codeCopied":[32],"noItemFound":[32],"order_items":[32]}]]],["p-4f256783",[[0,"salla-reviews",{"displayAllLink":[516,"display-all-link"],"source":[513],"sourceValue":[513,"source-value"],"limit":[514],"type":[1],"sort":[1],"hideCustomerInfo":[4,"hide-customer-info"],"reviews":[32],"isRTL":[32],"showReviews":[32],"testimonialText":[32],"displayAllLinkText":[32]}]]],["p-5621e1a0",[[0,"salla-reviews-page",{"reviews":[32],"isLoading":[32],"pagination":[32],"sort":[32]}]]],["p-beac6d8e",[[0,"salla-wallet",{"transactionsArray":[32],"balance":[32],"isLoading":[32],"nextPageUrl":[32]}]]],["p-22e25d12",[[0,"salla-conditional-offer",{"offer":[32],"products":[32],"isLoading":[32],"canRender":[32]}]]],["p-6957616a",[[0,"salla-orders",{"params":[16],"loadMoreText":[1,"load-more-text"],"orderNumberText":[32],"totalOrderText":[32],"orderDateText":[32],"orderStatusText":[32],"noOrderText":[32],"load_more_text_trans":[32],"languageCode":[32],"orders":[32],"pagination":[32],"hasInfiniteScroll":[32],"total":[32],"nextPage":[32],"showPlaceholder":[32]}]]],["p-149de98d",[[0,"salla-tiered-offer",{"tieredOfferData":[32],"apiOfferData":[32],"currentTierIndex":[32],"currentTier":[32],"activeTabTier":[32],"canRender":[32],"isLoading":[32],"loyaltyProgramText":[32],"currentTierText":[32],"discountText":[32],"benefitText":[32]}]]],["p-3e3ec5b5",[[4,"salla-accordion",{"collapsible":[4],"collapsed":[1540],"dir":[32]},[[4,"salla::language.change","directionChangedHandler"],[0,"accordionToggle","handleCollapse"]]]]],["p-c3552207",[[4,"salla-accordion-body"]]],["p-590216eb",[[4,"salla-accordion-head",{"collapsible":[4],"collapsed":[1540]}]]],["p-fd2c4c29",[[0,"salla-advertisement",{"position":[32],"advertisements":[32],"advertIcon":[32],"currentSlug":[32]}]]],["p-43f297d3",[[0,"salla-app-install-alert",{"data":[32],"ctaLink":[32],"open":[32],"closing":[32]}]]],["p-08e57dc8",[[0,"salla-apps-icons",{"hideTitle":[4,"hide-title"],"appsTitle":[1,"apps-title"],"vertical":[4],"apps":[32]}]]],["p-b5bb38a8",[[0,"salla-cart-item-offers",{"quantity":[2],"offers":[1],"itemId":[2,"item-id"],"productPrice":[2,"product-price"],"internalQuantity":[32],"internalOffers":[32],"internalProductPrice":[32],"showAll":[32],"freeLabel":[32],"receivedOffer":[32],"discountAmountLabel":[32],"showMoreOffers":[32]}]]],["p-fb61d02c",[[0,"salla-contacts",{"contactsTitle":[1025,"contacts-title"],"hideTitle":[4,"hide-title"],"isHeader":[4,"is-header"],"horizontal":[4],"iconsOnly":[4,"icons-only"],"contacts":[32],"iconsList":[32]}]]],["p-00b8c002",[[0,"salla-installment",{"price":[1],"language":[1],"currency":[1],"country":[1],"tabbyIsActive":[32],"spotiiIsActive":[32],"tamaraIsActive":[32],"mispayActive":[32],"emkanIsActive":[32],"madfuActive":[32],"rajehiIsActive":[32],"installment_sheria_text":[32]}]]],["p-9165a64d",[[0,"salla-loyalty-prize-item",{"item":[16]}]]],["p-c7692780",[[0,"salla-metadata",{"entity":[1],"entityId":[8,"entity-id"],"specs":[32],"download":[32]}]]],["p-7e11444f",[[0,"salla-payments",{"exclude":[1040]}]]],["p-c25ee5db",[[0,"salla-social",{"links":[32],"iconsList":[32]}]]],["p-0169eec4",[[4,"salla-filters-widget",{"withLoadMore":[1028,"with-load-more"],"filtersData":[16,"filters-data"],"option":[16],"isOpen":[32],"isShowMore":[32],"showMoreLabel":[32],"showLessLabel":[32],"page":[32],"setWidgetHeight":[64],"reset":[64],"showMore":[64],"toggleWidget":[64]}]]],["p-8dc7bd7e",[[0,"salla-notification-item",{"notification":[16]}]]],["p-0fb4368c",[[0,"salla-review-card",{"review":[16],"currentSlide":[32],"purchasedCount":[32],"showPurchaseCount":[32]}]]],["p-12865797",[[4,"salla-tooltip",{"text":[1],"targetId":[1,"target-id"],"show":[32]},[[9,"mouseover","handleMouseOver"],[9,"mouseout","handleMouseOut"]]]]],["p-c991e16b",[[0,"salla-offer-modal",{"offer":[32],"offer_name":[32],"offer_message":[32],"hasError":[32],"errorMessage":[32],"productID":[32],"offer_type":[32],"translationLoaded":[32],"addToCartLabel":[32],"open":[64],"showOffer":[64]}],[4,"salla-gifting",{"productId":[2,"product-id"],"widgetTitle":[1,"widget-title"],"widgetSubtitle":[1,"widget-subtitle"],"physicalProducts":[4,"physical-products"],"vertical":[4],"formSelector":[1025,"form-selector"],"sectionTitle":[32],"sectionSubtitle":[32],"sectionBtnText":[32],"giftDetails":[32],"selectImageForYourGift":[32],"selectImageOrUpload":[32],"selectGiftMessage":[32],"giftCustomText":[32],"textId":[32],"incorrectGiftText":[32],"nextStep":[32],"senderNameLabel":[32],"receiverNameFieldLabel":[32],"receiverMobileFieldLabel":[32],"receiverCountryFieldLabel":[32],"ksa":[32],"selectCountry":[32],"selectCity":[32],"selectCityInfo":[32],"receiverCityFieldLabel":[32],"receiverEmailFieldLabel":[32],"emailPlaceholder":[32],"sendLater":[32],"selectSendDateAndTime":[32],"canNotEditOrderAfterSelectDate":[32],"sendGift":[32],"donationRequired":[32],"currentStep":[32],"showCalendar":[32],"showGiftText":[32],"currentLang":[32],"parentClass":[32],"errors":[32],"gift":[32],"selectedGiftTextOption":[32],"selectedCountryId":[32],"selectedCountryCode":[32],"loadingCities":[32],"parsedFormData":[32],"showTextArea":[32],"selectedImage":[32],"uploadedImage":[32],"selectedText":[32],"senderName":[32],"errorMessage":[32],"hasError":[32],"quantity":[32],"deliveryDate":[32],"timeZone":[32],"receiverName":[32],"receiverMobile":[32],"receiverCountryCode":[32],"receiverEmail":[32],"hostId":[32],"receiverCity":[32],"open":[64],"close":[64],"goToStep2":[64]}],[4,"salla-loyalty",{"prizePoints":[1544,"prize-points"],"customerPoints":[1538,"customer-points"],"prizeTitle":[1537,"prize-title"],"allowEmail":[4,"allow-email"],"allowMobile":[4,"allow-mobile"],"requireEmail":[4,"require-email"],"guestMessage":[1025,"guest-message"],"loyaltyProgram":[32],"buttonLoading":[32],"selectedItem":[32],"askConfirmation":[32],"is_loggedin":[32],"hasError":[32],"errorMessage":[32],"translationLoaded":[32],"open":[64],"close":[64],"resetExchange":[64],"exchangeLoyaltyPoint":[64]}],[0,"salla-comments",{"itemId":[2,"item-id"],"loadMoreText":[1,"load-more-text"],"hideForm":[4,"hide-form"],"blockTitle":[1,"block-title"],"hideTitle":[4,"hide-title"],"type":[1],"showFormAvatar":[4,"show-form-avatar"],"hideBought":[4,"hide-bought"],"sort":[1],"testimonials":[4],"comments":[32],"pagination":[32],"total":[32],"showPlaceholder":[32],"nextPage":[32],"mostHelpfulLabel":[32],"noComments":[32],"comment_title":[32],"comment_name":[32],"placeholder_text":[32],"showRatingSummary":[32],"allowLikes":[32],"reload":[64]}],[4,"salla-product-size-guide",{"guides":[32],"productId":[32],"placeholder_title":[32],"placeholder_description":[32],"modal_title":[32],"hasError":[32],"open":[64],"close":[64]}],[0,"salla-rating-modal",{"orderId":[2,"order-id"],"order":[32],"hasError":[32],"showContactWidget":[32],"errorMessage":[32],"dragAndDropFilesLabel":[32],"contactSubjectLabel":[32],"editReviewLabel":[32],"allowedImagesTypesLabel":[32],"addImagesLabel":[32],"editImagesLabel":[32],"threeImagesMax":[32],"areYouSureLabel":[32],"confirmDeletionLabel":[32],"cancelLabel":[32],"confirmDeleteBtn":[32],"updatedSuccessfullyLabel":[32],"deletedSuccessfullyLabel":[32],"allowAttachImages":[32],"allowContactSupport":[32],"contactUsLabel":[32],"images":[32],"productImages":[32],"editItemImages":[32],"contact_body":[32],"editMode":[32],"defaultMode":[32],"deleteMode":[32],"shouldOpenDeleteModal":[32],"editType":[32],"editFeedbackId":[32],"deleteFeedbackId":[32],"editItem":[32],"open":[64],"close":[64]}],[4,"salla-scopes",{"selection":[1],"searchDisplayLimit":[2,"search-display-limit"],"translationLoaded":[32],"mode":[32],"current_scope":[32],"scopes":[32],"originalScopesList":[32],"selected_scope":[32],"isOpenedBefore":[32],"hasError":[32],"loading":[32],"close":[64],"open":[64],"handleSubmit":[64]}],[0,"salla-localization-modal",{"language":[1537],"currency":[1537],"translationLoaded":[32],"languages":[32],"currencies":[32],"hasError":[32],"errorMessage":[32],"open":[64],"close":[64],"submit":[64]}],[0,"salla-user-profile",{"customFields":[1,"custom-fields"],"minAge":[2,"min-age"],"userData":[32],"isEditable":[32],"userDefinedFields":[32],"disableAction":[32],"isLoading":[32],"first_name_trans":[32],"last_name_trans":[32],"birthday_trans":[32],"birthday_placeholder_trans":[32],"gender_trans":[32],"gender_placeholder_trans":[32],"male_trans":[32],"female_trans":[32],"email_trans":[32],"mobile_trans":[32],"save_btn_trans":[32],"drag_and_drop_trans":[32],"browse_trans":[32],"email_required_trans":[32],"invalid_email_trans":[32],"setCustomFields":[64]}],[0,"salla-quick-order",{"quickOrderTitle":[1025,"quick-order-title"],"subTitle":[1025,"sub-title"],"payButtonTitle":[1025,"pay-button-title"],"confirmPayButtonTitle":[1025,"confirm-pay-button-title"],"agreementText":[1025,"agreement-text"],"isEmailRequired":[1028,"is-email-required"],"productId":[1025,"product-id"],"thanksMessage":[1025,"thanks-message"],"quickOrderStyle":[1025,"quick-order-style"],"user":[32],"isAvailable":[32],"oneClick":[32],"expanded":[32],"isTermsRequired":[32],"countryCode":[32],"submitSucess":[32],"placeHolderEmail":[32],"emailOptional":[32],"agreementShowText":[32],"agreementModalHead":[32],"userNameLabel":[32],"termsChecked":[32]}],[0,"salla-user-settings",{"deactivateAccount":[32],"promotionalMsgs":[32],"hideMyName":[32],"hideMyNameDesc":[32],"deactivateDesc":[32],"promotionalMsgsDesc":[32],"sorryForLeavingText":[32],"warningText":[32],"keepAccount":[32],"buttonLoading":[32],"canHideName":[32],"isHiddenName":[32],"isNotifiable":[32]}],[0,"salla-bottom-alert",{"type":[513],"icon":[513],"message":[513],"actionUrl":[513,"action-url"],"actionLabel":[513,"action-label"],"storeId":[32],"template":[32],"loading":[32],"templateData":[32],"defaultMessage":[32],"defaultActionLabel":[32],"storeFeatures":[32],"storeDetails":[32],"storePrice":[32],"storePriceDetails":[32],"theDeveloper":[32],"templateInformation":[32],"buyTheTemplate":[32],"isRtl":[32],"storeName":[32]}],[0,"salla-search",{"inline":[4],"oval":[4],"height":[2],"maxWords":[2,"max-words"],"showAction":[4,"show-action"],"translationLoaded":[32],"results":[32],"loading":[32],"typing":[32],"debounce":[32],"search_term":[32]},[[0,"keydown","handleKeyDown"]],{"search_term":["handleSearch"]}],[0,"salla-login-modal",{"isEmailAllowed":[1028,"is-email-allowed"],"isMobileAllowed":[1028,"is-mobile-allowed"],"isEmailRequired":[1028,"is-email-required"],"supportWebAuth":[516,"support-web-auth"],"inline":[516],"storeId":[1032,"store-id"],"api":[1],"headers":[1025],"withoutReload":[1028,"without-reload"],"messages":[32],"isClosable":[32],"iframeLoaded":[32],"scrolling":[32],"direction":[32],"canRenderIframe":[32],"open":[64]}],[0,"salla-menu",{"source":[1],"sourceValue":[1,"source-value"],"topnav":[4],"useReactLink":[4,"use-react-link"],"limit":[2],"menus":[32]}],[4,"salla-social-share",{"url":[513],"urlName":[513,"url-name"],"platforms":[513],"opened":[32],"allPlatforms":[32],"platformIcons":[32],"convertedPlatforms":[32],"open":[64],"refresh":[64]}],[4,"salla-alert",{"message":[1],"variant":[1],"icon":[1]}],[0,"salla-breadcrumb",{"breadcrumbs":[32]}],[4,"salla-cart-summary",{"showCartLabel":[4,"show-cart-label"],"cartSummaryCount":[32],"cartSummaryTotal":[32],"cartLabel":[32],"animateToCart":[64]}],[4,"salla-infinite-scroll",{"nextPage":[1,"next-page"],"autoload":[1028],"container":[1],"loadMoreText":[1,"load-more-text"],"item":[1],"loadMore":[32],"noMore":[32],"failedToLoad":[32]}],[0,"salla-maintenance-alert",{"title":[32],"message":[32],"buttonTitle":[32]}],[4,"salla-quantity-input",{"cartItemId":[8,"cart-item-id"],"quantity":[32],"fireChangeEvent":[32],"decrease":[64],"increase":[64],"setValue":[64]},null,{"quantity":["watchPropHandler"]}],[4,"salla-user-menu",{"inline":[516],"avatarOnly":[516,"avatar-only"],"showHeader":[516,"show-header"],"relativeDropdown":[516,"relative-dropdown"],"accountLoading":[32],"opened":[32],"notifications":[32],"orders":[32],"pending_orders":[32],"wishlist":[32],"profile":[32],"rating":[32],"wallet":[32],"loyalty_program":[32],"logout":[32],"hello":[32],"first_name":[32],"last_name":[32],"avatar":[32],"is_loggedIn":[32],"badges":[32],"hasBadges":[32],"OrderUpdate":[32]}],[0,"salla-products-slider",{"blockTitle":[1,"block-title"],"subTitle":[1,"sub-title"],"sliderId":[1,"slider-id"],"displayAllUrl":[1,"display-all-url"],"autoplay":[1028],"source":[1537],"sourceValue":[1,"source-value"],"limit":[1026],"sliderConfig":[520,"slider-config"],"productCardComponent":[1,"product-card-component"],"includes":[1040],"productsData":[32],"isReady":[32],"sourceValueIsValid":[32],"hasCustomComponent":[32],"apiUrl":[32],"parsedSourceValue":[32]}],[4,"salla-map",{"name":[1],"required":[4],"readonly":[4],"searchable":[1028],"lat":[1026],"lng":[1026],"apiKey":[1025,"api-key"],"modalTitle":[1,"modal-title"],"zoom":[1026],"theme":[1025],"modalActivityTitle":[32],"confirmButtonTitle":[32],"locateButtonTitle":[32],"locateButtonEdit":[32],"searchPlaceholder":[32],"searchInputValue":[32],"formattedAddress":[32],"geolocationError":[32],"searchInput":[32],"mapInput":[32],"mapElement":[32],"selectedLat":[32],"selectedLng":[32],"open":[64]}],[0,"salla-reviews-summary",{"itemId":[2,"item-id"],"data":[32],"canRender":[32],"basedOnLabel":[32],"recommendedLabel":[32],"showRatingSummary":[32],"recommendationOnly":[32],"showRecommendation":[32]}],[0,"salla-comment-form",{"type":[1537],"showAvatar":[4,"show-avatar"],"itemId":[1544,"item-id"],"placeholder":[32],"submitText":[32],"canComment":[32]}],[4,"salla-drawer",{"isClosable":[1028,"is-closable"],"width":[513],"position":[513],"visible":[516],"hasSkeleton":[516,"has-skeleton"],"isLoading":[1540,"is-loading"],"subTitleFirst":[4,"sub-title-first"],"noPadding":[4,"no-padding"],"subTitle":[1,"sub-title"],"centered":[4],"iconStyle":[1,"icon-style"],"drawerTitle":[32],"open":[64],"close":[64],"setTitle":[64],"loading":[64],"stopLoading":[64]},[[0,"keyup","handleKeyUp"]],{"visible":["handleVisible"]}],[4,"salla-color-picker",{"name":[1],"required":[4],"color":[1537],"format":[1],"showCancelButton":[4,"show-cancel-button"],"showTextField":[4,"show-text-field"],"enableAlpha":[4,"enable-alpha"],"widgetColor":[32],"setPickerOption":[64],"movePopUp":[64],"setColorValue":[64],"openPicker":[64],"closePicker":[64],"destroyPicker":[64]}],[0,"salla-products-list",{"source":[1537],"sourceValue":[1032,"source-value"],"limit":[1026],"sortBy":[1025,"sort-by"],"filtersResults":[1540,"filters-results"],"horizontalCards":[516,"horizontal-cards"],"rowCards":[516,"row-cards"],"autoload":[1028],"loadMoreText":[1,"load-more-text"],"productCardComponent":[1,"product-card-component"],"includes":[1040],"page":[32],"nextPage":[32],"hasInfiniteScroll":[32],"hasCustomComponent":[32],"sourceValueIsValid":[32],"placeholderText":[32],"endOfText":[32],"failedLoadMore":[32],"currentPage":[32],"currentCategoryIdFilter":[32],"isReady":[32],"showPlaceholder":[32],"switchToNormalBehavior":[32],"parsedFilters":[32],"filtersSnapshot":[32],"setFilters":[64],"reload":[64]}],[0,"salla-comment-item",{"comment":[16],"hideBought":[16,"hide-bought"],"has_bought_trans":[32],"rated_trans":[32],"waiting_approval_trans":[32],"has_order_trans":[32],"allowLikes":[32],"allowAttachImages":[32],"helpfulLabel":[32],"likesCount":[32],"likedComments":[32]}],[4,"salla-tab-content",{"name":[1],"isSelected":[32],"getChild":[64]}],[4,"salla-tab-header",{"name":[1],"activeClass":[1,"active-class"],"height":[8],"centered":[4],"isSelected":[32],"getChild":[64]}],[4,"salla-tabs",{"backgroundColor":[1,"background-color"],"vertical":[4]},[[0,"tabSelected","onSelectedTab"]]],[4,"salla-product-card",{"product":[1],"horizontal":[4],"shadowOnHover":[4,"shadow-on-hover"],"hideAddBtn":[4,"hide-add-btn"],"fullImage":[4,"full-image"],"minimal":[4],"isSpecial":[4,"is-special"],"showQuantity":[4,"show-quantity"],"productData":[32],"fitImageHeight":[32],"remained":[32],"outOfStock":[32],"donationAmount":[32],"startingPrice":[32],"addToCart":[32],"placeholder":[32]}],[0,"salla-datetime-picker",{"value":[1537],"required":[4],"name":[513],"placeholder":[1],"allowInput":[4,"allow-input"],"allowInvalidPreload":[4,"allow-invalid-preload"],"altFormat":[1,"alt-format"],"altInput":[4,"alt-input"],"altInputClass":[1,"alt-input-class"],"appendTo":[16,"append-to"],"ariaDateFormat":[1,"aria-date-format"],"autoFillDefaultTime":[4,"auto-fill-default-time"],"clickOpens":[4,"click-opens"],"closeOnSelect":[4,"close-on-select"],"conjunction":[1],"dateFormat":[1,"date-format"],"defaultDate":[8,"default-date"],"defaultHour":[2,"default-hour"],"defaultMinute":[2,"default-minute"],"defaultSeconds":[2,"default-seconds"],"disable":[16],"disableMobile":[4,"disable-mobile"],"enable":[16],"enableSeconds":[4,"enable-seconds"],"enableTime":[4,"enable-time"],"formatDate":[16,"format-date"],"hourIncrement":[2,"hour-increment"],"inline":[4],"locale":[1],"maxDate":[8,"max-date"],"maxTime":[8,"max-time"],"minDate":[8,"min-date"],"minTime":[8,"min-time"],"minuteIncrement":[2,"minute-increment"],"mode":[1],"monthSelectorType":[1,"month-selector-type"],"nextArrow":[1,"next-arrow"],"noCalendar":[4,"no-calendar"],"dateParser":[16,"date-parser"],"position":[1],"positionElement":[16,"position-element"],"prevArrow":[1,"prev-arrow"],"shorthandCurrentMonth":[4,"shorthand-current-month"],"static":[4],"showMonths":[2,"show-months"],"time_24hr":[4,"time_-2-4hr"],"weekNumbers":[4,"week-numbers"],"wrap":[4],"disabled":[4]}],[4,"salla-add-product-button",{"channels":[513],"subscribedOptions":[1,"subscribed-options"],"quickBuy":[1540,"quick-buy"],"quantity":[514],"donatingAmount":[514,"donating-amount"],"notifyOptionsAvailability":[516,"notify-options-availability"],"productId":[520,"product-id"],"supportStickyBar":[516,"support-sticky-bar"],"productStatus":[513,"product-status"],"productType":[513,"product-type"],"hasOutOfStockOption":[32],"hasSubscribedOptions":[32],"selectedOptions":[32],"showQuickBuy":[32],"isApplePayActive":[32],"buyNowText":[32]}],[0,"salla-count-down",{"date":[1],"preOrder":[1,"pre-order"],"boxed":[4],"size":[1],"color":[1],"labeled":[4],"endText":[1,"end-text"],"digits":[1],"endOfDay":[4,"end-of-day"],"daysLabel":[32],"hoursLabel":[32],"minutesLabel":[32],"secondsLabel":[32],"endLabel":[32],"invalidDate":[32],"offerEnded":[32],"countInterval":[32],"days":[32],"hours":[32],"minutes":[32],"seconds":[32],"endCountDown":[64]}],[0,"salla-file-upload",{"value":[1544],"files":[513],"height":[513],"cartItemId":[1,"cart-item-id"],"profileImage":[516,"profile-image"],"name":[1537],"payloadName":[1,"payload-name"],"type":[1],"accept":[1537],"fileId":[2,"file-id"],"url":[1025],"method":[1],"formData":[1,"form-data"],"required":[4],"maxFileSize":[1,"max-file-size"],"disabled":[4],"allowDrop":[4,"allow-drop"],"allowBrowse":[4,"allow-browse"],"allowPaste":[4,"allow-paste"],"allowMultiple":[4,"allow-multiple"],"allowReplace":[4,"allow-replace"],"allowRevert":[4,"allow-revert"],"allowRemove":[4,"allow-remove"],"allowProcess":[4,"allow-process"],"allowReorder":[4,"allow-reorder"],"allowImagePreview":[4,"allow-image-preview"],"imagePreviewHeight":[2,"image-preview-height"],"filePosterHeight":[2,"file-poster-height"],"storeAsFile":[4,"store-as-file"],"forceRevert":[4,"force-revert"],"maxFilesCount":[2,"max-files-count"],"maxParallelUploads":[2,"max-parallel-uploads"],"checkValidity":[4,"check-validity"],"itemInsertLocation":[1,"item-insert-location"],"itemInsertInterval":[2,"item-insert-interval"],"credits":[4],"dropOnPage":[4,"drop-on-page"],"dropOnElement":[4,"drop-on-element"],"dropValidation":[4,"drop-validation"],"ignoredFiles":[16,"ignored-files"],"instantUpload":[1028,"instant-upload"],"chunkUploads":[4,"chunk-uploads"],"chunkForce":[4,"chunk-force"],"chunkSize":[2,"chunk-size"],"chunkRetryDelays":[16,"chunk-retry-delays"],"labelDecimalSeparator":[1,"label-decimal-separator"],"labelThousandsSeparator":[1,"label-thousands-separator"],"labelIdle":[1025,"label-idle"],"iconRemove":[1,"icon-remove"],"iconProcess":[1,"icon-process"],"iconRetry":[1,"icon-retry"],"iconUndo":[1,"icon-undo"],"max_images_count":[32],"max_count_hint":[32],"uploadedFiles":[32],"isListScrollerListenerAdded":[32],"showMaxCountHint":[32],"setOption":[64]}],[4,"salla-list-tile",{"href":[1],"target":[1]}],[0,"salla-product-availability",{"channels":[1],"notifyOptionsAvailability":[4,"notify-options-availability"],"productId":[2,"product-id"],"isSubscribed":[1028,"is-subscribed"],"translationLoaded":[32],"title_":[32],"isVisitorSubscribed":[32]},null,{"channels":["channelsWatcher"]}],[0,"salla-quick-buy",{"type":[1025],"productId":[1025,"product-id"],"cartId":[1025,"cart-id"],"amount":[1538],"currency":[1025],"options":[16],"isRequireShipping":[1028,"is-require-shipping"],"applePayOnly":[1028,"apple-pay-only"],"isApplePayActive":[32],"quickBuy":[32]}],[0,"salla-progress-bar",{"donation":[1],"target":[1026],"value":[1026],"height":[1025],"header":[1025],"stripped":[1028],"message":[1025],"unit":[1025],"color":[1025],"hideUnits":[4,"hide-units"]}],[0,"salla-rating-stars",{"name":[1],"size":[1],"value":[2],"reviews":[2],"withLabel":[4,"with-label"],"editable":[4],"translationsLoaded":[32],"labels":[32],"reviewLabel":[32],"selectedStar":[32]}],[4,"salla-slider",{"blockTitle":[513,"block-title"],"listenToThumbnailsOption":[516,"listen-to-thumbnails-option"],"blockSubtitle":[513,"block-subtitle"],"displayAllUrl":[513,"display-all-url"],"arrowsCentered":[516,"arrows-centered"],"verticalThumbs":[516,"vertical-thumbs"],"gridThumbs":[516,"grid-thumbs"],"vertical":[516],"autoHeight":[516,"auto-height"],"showControls":[516,"show-controls"],"controlsOuter":[516,"controls-outer"],"showThumbsControls":[4,"show-thumbs-controls"],"autoPlay":[4,"auto-play"],"slidesPerView":[1,"slides-per-view"],"pagination":[4],"centered":[4],"loop":[4],"direction":[1537],"type":[1],"sliderConfig":[520,"slider-config"],"thumbsConfig":[520,"thumbs-config"],"currentIndex":[32],"isEnd":[32],"isBeginning":[32],"swiperScript":[32],"displayAllTitle":[32],"windowWidth":[32],"sliderInstance":[64],"slideTo":[64],"slideNext":[64],"slidePrev":[64],"slideToLoop":[64],"slideNextLoop":[64],"slidePrevLoop":[64],"slideReset":[64],"slideToClosest":[64],"update":[64],"updateAutoHeight":[64],"updateSlides":[64],"updateProgress":[64],"updateSlidesClasses":[64],"getSlides":[64],"updateSize":[64],"sliderInit":[64],"thumbsSliderInstance":[64],"thumbsSliderInit":[64],"thumbsSliderUpdate":[64],"thumbsSliderUpdateSlides":[64],"getThumbsUpdateSize":[64],"thumbsSlideTo":[64],"getThumbsSlides":[64]}],[4,"salla-placeholder",{"icon":[1],"alignment":[1],"iconSize":[1,"icon-size"],"translationLoaded":[32]}],[0,"salla-tel-input",{"phone":[1025],"autofocus":[516],"name":[1],"disabled":[4],"countryCode":[1025,"country-code"],"mobileRequired":[32],"countryCodeLabel":[32],"mobileLabel":[32],"tooShort":[32],"tooLong":[32],"invalidCountryCode":[32],"invalidNumber":[32],"errorMap":[32],"getValues":[64],"isValid":[64]}],[0,"salla-skeleton",{"type":[1],"width":[1],"height":[1]}],[4,"salla-modal",{"isClosable":[1028,"is-closable"],"width":[513],"position":[513],"visible":[516],"hasSkeleton":[516,"has-skeleton"],"isLoading":[1540,"is-loading"],"subTitleFirst":[4,"sub-title-first"],"noPadding":[4,"no-padding"],"subTitle":[1,"sub-title"],"centered":[4],"iconStyle":[1,"icon-style"],"modalTitle":[32],"open":[64],"close":[64],"setTitle":[64],"loading":[64],"stopLoading":[64]},[[0,"keyup","handleKeyUp"]],{"visible":["handleVisible"]}],[0,"salla-loading",{"size":[8],"width":[8],"color":[1],"bgColor":[1,"bg-color"]}],[4,"salla-button",{"shape":[513],"color":[513],"fill":[513],"size":[513],"width":[513],"loading":[516],"disabled":[516],"loaderPosition":[1,"loader-position"],"href":[1],"type":[513],"load":[64],"stop":[64],"setText":[64],"disable":[64],"enable":[64]}]]],["p-cffc4a47",[[0,"salla-booking-field",{"option":[16],"productId":[2,"product-id"],"bookNowLabel":[32],"editLabel":[32],"bookedLabel":[32],"selectDate":[32],"bookingUrl":[32],"iframeReady":[32],"reservations":[32],"reservationsInput":[32]}],[4,"salla-conditional-fields",null,[[0,"change","changeHandler"]]]]],["p-6674ff60",[[0,"salla-price-range",{"minPrice":[1032,"min-price"],"maxPrice":[1032,"max-price"],"option":[16],"filtersData":[520,"filters-data"],"min":[32],"max":[32],"priceOptions":[32],"moreThanLabel":[32],"lessThanLabel":[32],"toLabel":[32],"fromLabel":[32],"typing":[32],"isMin":[32],"isRTL":[32],"reset":[64]}]]]]'),e)}));
4
+ import{p as e,b as a}from"./p-uTwIMGTZ.js";export{s as setNonce}from"./p-uTwIMGTZ.js";import{g as t}from"./p-Cpv-H9QO.js";var l=()=>{const a=import.meta.url;const t={};if(a!==""){t.resourcesUrl=new URL(".",a).href}return e(t)};l().then((async e=>{await t();return a(JSON.parse('[["p-bc947447",[[0,"salla-offer",{"productCardComponent":[1,"product-card-component"],"offersList":[32],"userCurrency":[32],"isMultipleBank":[32],"title":[32],"currentPage":[32],"hasCustomComponent":[32],"isBankOffer":[32],"canRender":[32],"showOffer":[32],"offer_with_price_text":[32],"with_discount_text":[32],"product_discount_text":[32],"special_offer_text":[32],"multipleBankOfferTitleText":[32],"multipleBankOfferTitleDescription":[32],"buy_quantity_text":[32]}]]],["p-80700df9",[[0,"salla-product-options",{"productId":[2,"product-id"],"options":[1],"hideOutLabel":[1,"hide-out-label"],"uniqueKey":[1,"unique-key"],"config":[1],"optionsData":[32],"outOfStockText":[32],"donationAmount":[32],"selectDonationAmount":[32],"selectAmount":[32],"isCustomDonation":[32],"selectedOptions":[32],"canDisabled":[32],"selectedSkus":[32],"selectedOutSkus":[32],"disableCardValue":[32],"availableDigitalCardValues":[32],"setOptionsData":[64],"getSelectedOptionsData":[64],"reportValidity":[64],"hasOutOfStockOption":[64],"getSelectedOptions":[64],"getOption":[64]}]]],["p-2f83207c",[[0,"salla-filters",{"filters":[1040],"isSidebarOpen":[32],"filtersData":[32],"apply":[32],"reset":[32],"getFilters":[64],"applyFilters":[64],"resetFilters":[64]}]]],["p-fb6a0296",[[4,"salla-verify",{"display":[1],"type":[1025],"autoReload":[4,"auto-reload"],"supportWebAuth":[4,"support-web-auth"],"translationLoaded":[32],"title":[32],"resendAfter":[32],"hasError":[32],"errorMessage":[32],"isProfileVerify":[32],"getCode":[64],"open":[64]}]]],["p-064991bd",[[0,"salla-loyalty-program",{"loyaltyPointsArray":[32],"isLoadingLoyalty":[32],"nextPageUrlLoyalty":[32]}]]],["p-51f461f3",[[0,"salla-notifications",{"loadMoreText":[1,"load-more-text"],"itemPerPage":[2,"item-per-page"],"pagination":[32],"total":[32],"showPlaceholder":[32],"nextPage":[32],"no_notifications_trans":[32],"load_more_text_trans":[32]}]]],["p-9f2daf11",[[0,"salla-order-summary",{"orderId":[514,"order-id"],"codeCopied":[32],"noItemFound":[32],"order_items":[32]}]]],["p-13ef30ff",[[0,"salla-reviews",{"displayAllLink":[516,"display-all-link"],"source":[513],"sourceValue":[513,"source-value"],"limit":[514],"type":[1],"sort":[1],"hideCustomerInfo":[4,"hide-customer-info"],"reviews":[32],"isRTL":[32],"showReviews":[32],"testimonialText":[32],"displayAllLinkText":[32]}]]],["p-8645f64f",[[0,"salla-reviews-page",{"reviews":[32],"isLoading":[32],"pagination":[32],"sort":[32]}]]],["p-0ed72423",[[0,"salla-wallet",{"transactionsArray":[32],"balance":[32],"isLoading":[32],"nextPageUrl":[32]}]]],["p-9d8cb3df",[[0,"salla-conditional-offer",{"offer":[32],"products":[32],"isLoading":[32],"canRender":[32]}]]],["p-58e3f07b",[[0,"salla-orders",{"params":[16],"loadMoreText":[1,"load-more-text"],"orderNumberText":[32],"totalOrderText":[32],"orderDateText":[32],"orderStatusText":[32],"noOrderText":[32],"load_more_text_trans":[32],"languageCode":[32],"orders":[32],"pagination":[32],"hasInfiniteScroll":[32],"total":[32],"nextPage":[32],"showPlaceholder":[32]}]]],["p-751d4aad",[[0,"salla-tiered-offer",{"tieredOfferData":[32],"apiOfferData":[32],"currentTierIndex":[32],"currentTier":[32],"activeTabTier":[32],"canRender":[32],"isLoading":[32],"loyaltyProgramText":[32],"currentTierText":[32],"discountText":[32],"benefitText":[32]}]]],["p-2147132d",[[4,"salla-accordion",{"collapsible":[4],"collapsed":[1540],"dir":[32]},[[4,"salla::language.change","directionChangedHandler"],[0,"accordionToggle","handleCollapse"]]]]],["p-a16ecc9d",[[4,"salla-accordion-body"]]],["p-7bd3640b",[[4,"salla-accordion-head",{"collapsible":[4],"collapsed":[1540]}]]],["p-cb577695",[[0,"salla-advertisement",{"position":[32],"advertisements":[32],"advertIcon":[32],"currentSlug":[32]}]]],["p-81b86d4b",[[0,"salla-app-install-alert",{"data":[32],"ctaLink":[32],"open":[32],"closing":[32]}]]],["p-80ce5698",[[0,"salla-apps-icons",{"hideTitle":[4,"hide-title"],"appsTitle":[1,"apps-title"],"vertical":[4],"apps":[32]}]]],["p-560b9ba3",[[0,"salla-cart-item-offers",{"quantity":[2],"offers":[1],"itemId":[2,"item-id"],"productPrice":[2,"product-price"],"internalQuantity":[32],"internalOffers":[32],"internalProductPrice":[32],"showAll":[32],"freeLabel":[32],"receivedOffer":[32],"discountAmountLabel":[32],"showMoreOffers":[32]}]]],["p-160cef1c",[[0,"salla-contacts",{"contactsTitle":[1025,"contacts-title"],"hideTitle":[4,"hide-title"],"isHeader":[4,"is-header"],"horizontal":[4],"iconsOnly":[4,"icons-only"],"contacts":[32],"iconsList":[32]}]]],["p-afbbbb73",[[0,"salla-installment",{"price":[1],"language":[1],"currency":[1],"country":[1],"tabbyIsActive":[32],"spotiiIsActive":[32],"tamaraIsActive":[32],"mispayActive":[32],"emkanIsActive":[32],"madfuActive":[32],"rajehiIsActive":[32],"installment_sheria_text":[32]}]]],["p-4befb128",[[0,"salla-loyalty-prize-item",{"item":[16]}]]],["p-56a2f2ce",[[0,"salla-metadata",{"entity":[1],"entityId":[8,"entity-id"],"specs":[32],"download":[32]}]]],["p-29984c80",[[0,"salla-payments",{"exclude":[1040]}]]],["p-258fdfe8",[[0,"salla-social",{"links":[32],"iconsList":[32]}]]],["p-45620cb5",[[4,"salla-filters-widget",{"withLoadMore":[1028,"with-load-more"],"filtersData":[16,"filters-data"],"option":[16],"isOpen":[32],"isShowMore":[32],"showMoreLabel":[32],"showLessLabel":[32],"page":[32],"setWidgetHeight":[64],"reset":[64],"showMore":[64],"toggleWidget":[64]}]]],["p-80bc850c",[[0,"salla-notification-item",{"notification":[16]}]]],["p-eee1b538",[[0,"salla-review-card",{"review":[16],"currentSlide":[32],"purchasedCount":[32],"showPurchaseCount":[32]}]]],["p-cf16c5b6",[[4,"salla-tooltip",{"text":[1],"targetId":[1,"target-id"],"show":[32]},[[9,"mouseover","handleMouseOver"],[9,"mouseout","handleMouseOut"]]]]],["p-1c1f2e96",[[0,"salla-offer-modal",{"offer":[32],"offer_name":[32],"offer_message":[32],"hasError":[32],"errorMessage":[32],"productID":[32],"offer_type":[32],"translationLoaded":[32],"addToCartLabel":[32],"open":[64],"showOffer":[64]}],[4,"salla-gifting",{"productId":[2,"product-id"],"widgetTitle":[1,"widget-title"],"widgetSubtitle":[1,"widget-subtitle"],"physicalProducts":[4,"physical-products"],"vertical":[4],"formSelector":[1025,"form-selector"],"sectionTitle":[32],"sectionSubtitle":[32],"sectionBtnText":[32],"giftDetails":[32],"selectImageForYourGift":[32],"selectImageOrUpload":[32],"selectGiftMessage":[32],"giftCustomText":[32],"textId":[32],"incorrectGiftText":[32],"nextStep":[32],"senderNameLabel":[32],"receiverNameFieldLabel":[32],"receiverMobileFieldLabel":[32],"receiverCountryFieldLabel":[32],"ksa":[32],"selectCountry":[32],"selectCity":[32],"selectCityInfo":[32],"receiverCityFieldLabel":[32],"receiverEmailFieldLabel":[32],"emailPlaceholder":[32],"sendLater":[32],"selectSendDateAndTime":[32],"canNotEditOrderAfterSelectDate":[32],"sendGift":[32],"donationRequired":[32],"currentStep":[32],"showCalendar":[32],"showGiftText":[32],"currentLang":[32],"parentClass":[32],"errors":[32],"gift":[32],"selectedGiftTextOption":[32],"selectedCountryId":[32],"selectedCountryCode":[32],"loadingCities":[32],"parsedFormData":[32],"showTextArea":[32],"selectedImage":[32],"uploadedImage":[32],"selectedText":[32],"senderName":[32],"errorMessage":[32],"hasError":[32],"quantity":[32],"deliveryDate":[32],"timeZone":[32],"receiverName":[32],"receiverMobile":[32],"receiverCountryCode":[32],"receiverEmail":[32],"hostId":[32],"receiverCity":[32],"open":[64],"close":[64],"goToStep2":[64]}],[4,"salla-loyalty",{"prizePoints":[1544,"prize-points"],"customerPoints":[1538,"customer-points"],"prizeTitle":[1537,"prize-title"],"allowEmail":[4,"allow-email"],"allowMobile":[4,"allow-mobile"],"requireEmail":[4,"require-email"],"guestMessage":[1025,"guest-message"],"loyaltyProgram":[32],"buttonLoading":[32],"selectedItem":[32],"askConfirmation":[32],"is_loggedin":[32],"hasError":[32],"errorMessage":[32],"translationLoaded":[32],"open":[64],"close":[64],"resetExchange":[64],"exchangeLoyaltyPoint":[64]}],[0,"salla-comments",{"itemId":[2,"item-id"],"loadMoreText":[1,"load-more-text"],"hideForm":[4,"hide-form"],"blockTitle":[1,"block-title"],"hideTitle":[4,"hide-title"],"type":[1],"showFormAvatar":[4,"show-form-avatar"],"hideBought":[4,"hide-bought"],"sort":[1],"testimonials":[4],"comments":[32],"pagination":[32],"total":[32],"showPlaceholder":[32],"nextPage":[32],"mostHelpfulLabel":[32],"noComments":[32],"comment_title":[32],"comment_name":[32],"placeholder_text":[32],"showRatingSummary":[32],"allowLikes":[32],"reload":[64]}],[4,"salla-product-size-guide",{"guides":[32],"productId":[32],"placeholder_title":[32],"placeholder_description":[32],"modal_title":[32],"hasError":[32],"open":[64],"close":[64]}],[0,"salla-rating-modal",{"orderId":[2,"order-id"],"order":[32],"hasError":[32],"showContactWidget":[32],"errorMessage":[32],"dragAndDropFilesLabel":[32],"contactSubjectLabel":[32],"editReviewLabel":[32],"allowedImagesTypesLabel":[32],"addImagesLabel":[32],"editImagesLabel":[32],"threeImagesMax":[32],"areYouSureLabel":[32],"confirmDeletionLabel":[32],"cancelLabel":[32],"confirmDeleteBtn":[32],"updatedSuccessfullyLabel":[32],"deletedSuccessfullyLabel":[32],"allowAttachImages":[32],"allowContactSupport":[32],"contactUsLabel":[32],"images":[32],"productImages":[32],"editItemImages":[32],"contact_body":[32],"editMode":[32],"defaultMode":[32],"deleteMode":[32],"shouldOpenDeleteModal":[32],"editType":[32],"editFeedbackId":[32],"deleteFeedbackId":[32],"editItem":[32],"open":[64],"close":[64]}],[4,"salla-scopes",{"selection":[1],"searchDisplayLimit":[2,"search-display-limit"],"translationLoaded":[32],"mode":[32],"current_scope":[32],"scopes":[32],"originalScopesList":[32],"selected_scope":[32],"isOpenedBefore":[32],"hasError":[32],"loading":[32],"close":[64],"open":[64],"handleSubmit":[64]}],[0,"salla-localization-modal",{"language":[1537],"currency":[1537],"translationLoaded":[32],"languages":[32],"currencies":[32],"hasError":[32],"errorMessage":[32],"open":[64],"close":[64],"submit":[64]}],[0,"salla-user-profile",{"customFields":[1,"custom-fields"],"minAge":[2,"min-age"],"userData":[32],"isEditable":[32],"userDefinedFields":[32],"disableAction":[32],"isLoading":[32],"first_name_trans":[32],"last_name_trans":[32],"birthday_trans":[32],"birthday_placeholder_trans":[32],"gender_trans":[32],"gender_placeholder_trans":[32],"male_trans":[32],"female_trans":[32],"email_trans":[32],"mobile_trans":[32],"save_btn_trans":[32],"drag_and_drop_trans":[32],"browse_trans":[32],"email_required_trans":[32],"invalid_email_trans":[32],"setCustomFields":[64]}],[0,"salla-quick-order",{"quickOrderTitle":[1025,"quick-order-title"],"subTitle":[1025,"sub-title"],"payButtonTitle":[1025,"pay-button-title"],"confirmPayButtonTitle":[1025,"confirm-pay-button-title"],"agreementText":[1025,"agreement-text"],"isEmailRequired":[1028,"is-email-required"],"productId":[1025,"product-id"],"thanksMessage":[1025,"thanks-message"],"quickOrderStyle":[1025,"quick-order-style"],"user":[32],"isAvailable":[32],"oneClick":[32],"expanded":[32],"isTermsRequired":[32],"countryCode":[32],"submitSucess":[32],"placeHolderEmail":[32],"emailOptional":[32],"agreementShowText":[32],"agreementModalHead":[32],"userNameLabel":[32],"termsChecked":[32]}],[0,"salla-user-settings",{"deactivateAccount":[32],"promotionalMsgs":[32],"hideMyName":[32],"hideMyNameDesc":[32],"deactivateDesc":[32],"promotionalMsgsDesc":[32],"sorryForLeavingText":[32],"warningText":[32],"keepAccount":[32],"buttonLoading":[32],"canHideName":[32],"isHiddenName":[32],"isNotifiable":[32]}],[0,"salla-bottom-alert",{"type":[513],"icon":[513],"message":[513],"actionUrl":[513,"action-url"],"actionLabel":[513,"action-label"],"storeId":[32],"template":[32],"loading":[32],"templateData":[32],"defaultMessage":[32],"defaultActionLabel":[32],"storeFeatures":[32],"storeDetails":[32],"storePrice":[32],"storePriceDetails":[32],"theDeveloper":[32],"templateInformation":[32],"buyTheTemplate":[32],"isRtl":[32],"storeName":[32]}],[0,"salla-search",{"inline":[4],"oval":[4],"height":[2],"maxWords":[2,"max-words"],"showAction":[4,"show-action"],"translationLoaded":[32],"results":[32],"loading":[32],"typing":[32],"debounce":[32],"search_term":[32]},[[0,"keydown","handleKeyDown"]],{"search_term":["handleSearch"]}],[0,"salla-login-modal",{"isEmailAllowed":[1028,"is-email-allowed"],"isMobileAllowed":[1028,"is-mobile-allowed"],"isEmailRequired":[1028,"is-email-required"],"supportWebAuth":[516,"support-web-auth"],"inline":[516],"storeId":[1032,"store-id"],"api":[1],"headers":[1025],"withoutReload":[1028,"without-reload"],"messages":[32],"isClosable":[32],"iframeLoaded":[32],"scrolling":[32],"direction":[32],"canRenderIframe":[32],"open":[64]}],[0,"salla-menu",{"source":[1],"sourceValue":[1,"source-value"],"topnav":[4],"useReactLink":[4,"use-react-link"],"limit":[2],"menus":[32]}],[4,"salla-social-share",{"url":[513],"urlName":[513,"url-name"],"platforms":[513],"opened":[32],"allPlatforms":[32],"platformIcons":[32],"convertedPlatforms":[32],"open":[64],"refresh":[64]}],[4,"salla-alert",{"message":[1],"variant":[1],"icon":[1]}],[0,"salla-breadcrumb",{"breadcrumbs":[32]}],[4,"salla-cart-summary",{"showCartLabel":[4,"show-cart-label"],"cartSummaryCount":[32],"cartSummaryTotal":[32],"cartLabel":[32],"animateToCart":[64]}],[4,"salla-infinite-scroll",{"nextPage":[1,"next-page"],"autoload":[1028],"container":[1],"loadMoreText":[1,"load-more-text"],"item":[1],"loadMore":[32],"noMore":[32],"failedToLoad":[32]}],[0,"salla-maintenance-alert",{"title":[32],"message":[32],"buttonTitle":[32]}],[4,"salla-quantity-input",{"cartItemId":[8,"cart-item-id"],"quantity":[32],"fireChangeEvent":[32],"decrease":[64],"increase":[64],"setValue":[64]},null,{"quantity":["watchPropHandler"]}],[4,"salla-user-menu",{"inline":[516],"avatarOnly":[516,"avatar-only"],"showHeader":[516,"show-header"],"relativeDropdown":[516,"relative-dropdown"],"accountLoading":[32],"opened":[32],"notifications":[32],"orders":[32],"pending_orders":[32],"wishlist":[32],"profile":[32],"rating":[32],"wallet":[32],"loyalty_program":[32],"logout":[32],"hello":[32],"first_name":[32],"last_name":[32],"avatar":[32],"is_loggedIn":[32],"badges":[32],"hasBadges":[32],"OrderUpdate":[32]}],[0,"salla-products-slider",{"blockTitle":[1,"block-title"],"subTitle":[1,"sub-title"],"sliderId":[1,"slider-id"],"displayAllUrl":[1,"display-all-url"],"autoplay":[1028],"source":[1537],"sourceValue":[1,"source-value"],"limit":[1026],"sliderConfig":[520,"slider-config"],"productCardComponent":[1,"product-card-component"],"includes":[1040],"productsData":[32],"isReady":[32],"sourceValueIsValid":[32],"hasCustomComponent":[32],"apiUrl":[32],"parsedSourceValue":[32]}],[4,"salla-map",{"name":[1],"required":[4],"readonly":[4],"searchable":[1028],"lat":[1026],"lng":[1026],"apiKey":[1025,"api-key"],"modalTitle":[1,"modal-title"],"zoom":[1026],"theme":[1025],"modalActivityTitle":[32],"confirmButtonTitle":[32],"locateButtonTitle":[32],"locateButtonEdit":[32],"searchPlaceholder":[32],"searchInputValue":[32],"formattedAddress":[32],"geolocationError":[32],"searchInput":[32],"mapInput":[32],"mapElement":[32],"selectedLat":[32],"selectedLng":[32],"open":[64]}],[0,"salla-reviews-summary",{"itemId":[2,"item-id"],"data":[32],"canRender":[32],"basedOnLabel":[32],"recommendedLabel":[32],"showRatingSummary":[32],"recommendationOnly":[32],"showRecommendation":[32]}],[0,"salla-comment-form",{"type":[1537],"showAvatar":[4,"show-avatar"],"itemId":[1544,"item-id"],"placeholder":[32],"submitText":[32],"canComment":[32]}],[4,"salla-drawer",{"isClosable":[1028,"is-closable"],"width":[513],"position":[513],"visible":[516],"hasSkeleton":[516,"has-skeleton"],"isLoading":[1540,"is-loading"],"subTitleFirst":[4,"sub-title-first"],"noPadding":[4,"no-padding"],"subTitle":[1,"sub-title"],"centered":[4],"iconStyle":[1,"icon-style"],"drawerTitle":[32],"open":[64],"close":[64],"setTitle":[64],"loading":[64],"stopLoading":[64]},[[0,"keyup","handleKeyUp"]],{"visible":["handleVisible"]}],[4,"salla-color-picker",{"name":[1],"required":[4],"color":[1537],"format":[1],"showCancelButton":[4,"show-cancel-button"],"showTextField":[4,"show-text-field"],"enableAlpha":[4,"enable-alpha"],"widgetColor":[32],"setPickerOption":[64],"movePopUp":[64],"setColorValue":[64],"openPicker":[64],"closePicker":[64],"destroyPicker":[64]}],[0,"salla-products-list",{"source":[1537],"sourceValue":[1032,"source-value"],"limit":[1026],"sortBy":[1025,"sort-by"],"filtersResults":[1540,"filters-results"],"horizontalCards":[516,"horizontal-cards"],"rowCards":[516,"row-cards"],"autoload":[1028],"loadMoreText":[1,"load-more-text"],"productCardComponent":[1,"product-card-component"],"includes":[1040],"page":[32],"nextPage":[32],"hasInfiniteScroll":[32],"hasCustomComponent":[32],"sourceValueIsValid":[32],"placeholderText":[32],"endOfText":[32],"failedLoadMore":[32],"currentPage":[32],"currentCategoryIdFilter":[32],"isReady":[32],"showPlaceholder":[32],"switchToNormalBehavior":[32],"parsedFilters":[32],"filtersSnapshot":[32],"setFilters":[64],"reload":[64]}],[0,"salla-comment-item",{"comment":[16],"hideBought":[16,"hide-bought"],"has_bought_trans":[32],"rated_trans":[32],"waiting_approval_trans":[32],"has_order_trans":[32],"allowLikes":[32],"allowAttachImages":[32],"helpfulLabel":[32],"likesCount":[32],"likedComments":[32]}],[4,"salla-tab-content",{"name":[1],"isSelected":[32],"getChild":[64]}],[4,"salla-tab-header",{"name":[1],"activeClass":[1,"active-class"],"height":[8],"centered":[4],"isSelected":[32],"getChild":[64]}],[4,"salla-tabs",{"backgroundColor":[1,"background-color"],"vertical":[4]},[[0,"tabSelected","onSelectedTab"]]],[4,"salla-product-card",{"product":[1],"horizontal":[4],"shadowOnHover":[4,"shadow-on-hover"],"hideAddBtn":[4,"hide-add-btn"],"fullImage":[4,"full-image"],"minimal":[4],"isSpecial":[4,"is-special"],"showQuantity":[4,"show-quantity"],"productData":[32],"fitImageHeight":[32],"remained":[32],"outOfStock":[32],"donationAmount":[32],"startingPrice":[32],"addToCart":[32],"placeholder":[32]}],[0,"salla-datetime-picker",{"value":[1537],"required":[4],"name":[513],"placeholder":[1],"allowInput":[4,"allow-input"],"allowInvalidPreload":[4,"allow-invalid-preload"],"altFormat":[1,"alt-format"],"altInput":[4,"alt-input"],"altInputClass":[1,"alt-input-class"],"appendTo":[16,"append-to"],"ariaDateFormat":[1,"aria-date-format"],"autoFillDefaultTime":[4,"auto-fill-default-time"],"clickOpens":[4,"click-opens"],"closeOnSelect":[4,"close-on-select"],"conjunction":[1],"dateFormat":[1,"date-format"],"defaultDate":[8,"default-date"],"defaultHour":[2,"default-hour"],"defaultMinute":[2,"default-minute"],"defaultSeconds":[2,"default-seconds"],"disable":[16],"disableMobile":[4,"disable-mobile"],"enable":[16],"enableSeconds":[4,"enable-seconds"],"enableTime":[4,"enable-time"],"formatDate":[16,"format-date"],"hourIncrement":[2,"hour-increment"],"inline":[4],"locale":[1],"maxDate":[8,"max-date"],"maxTime":[8,"max-time"],"minDate":[8,"min-date"],"minTime":[8,"min-time"],"minuteIncrement":[2,"minute-increment"],"mode":[1],"monthSelectorType":[1,"month-selector-type"],"nextArrow":[1,"next-arrow"],"noCalendar":[4,"no-calendar"],"dateParser":[16,"date-parser"],"position":[1],"positionElement":[16,"position-element"],"prevArrow":[1,"prev-arrow"],"shorthandCurrentMonth":[4,"shorthand-current-month"],"static":[4],"showMonths":[2,"show-months"],"time_24hr":[4,"time_-2-4hr"],"weekNumbers":[4,"week-numbers"],"wrap":[4],"disabled":[4]}],[4,"salla-add-product-button",{"channels":[513],"subscribedOptions":[1,"subscribed-options"],"quickBuy":[1540,"quick-buy"],"quantity":[514],"donatingAmount":[514,"donating-amount"],"notifyOptionsAvailability":[516,"notify-options-availability"],"productId":[520,"product-id"],"supportStickyBar":[516,"support-sticky-bar"],"productStatus":[513,"product-status"],"productType":[513,"product-type"],"hasOutOfStockOption":[32],"hasSubscribedOptions":[32],"selectedOptions":[32],"showQuickBuy":[32],"isApplePayActive":[32],"buyNowText":[32]}],[0,"salla-count-down",{"date":[1],"preOrder":[1,"pre-order"],"boxed":[4],"size":[1],"color":[1],"labeled":[4],"endText":[1,"end-text"],"digits":[1],"endOfDay":[4,"end-of-day"],"daysLabel":[32],"hoursLabel":[32],"minutesLabel":[32],"secondsLabel":[32],"endLabel":[32],"invalidDate":[32],"offerEnded":[32],"countInterval":[32],"days":[32],"hours":[32],"minutes":[32],"seconds":[32],"endCountDown":[64]}],[0,"salla-file-upload",{"value":[1544],"files":[513],"height":[513],"cartItemId":[1,"cart-item-id"],"profileImage":[516,"profile-image"],"name":[1537],"payloadName":[1,"payload-name"],"type":[1],"accept":[1537],"fileId":[2,"file-id"],"url":[1025],"method":[1],"formData":[1,"form-data"],"required":[4],"maxFileSize":[1,"max-file-size"],"disabled":[4],"allowDrop":[4,"allow-drop"],"allowBrowse":[4,"allow-browse"],"allowPaste":[4,"allow-paste"],"allowMultiple":[4,"allow-multiple"],"allowReplace":[4,"allow-replace"],"allowRevert":[4,"allow-revert"],"allowRemove":[4,"allow-remove"],"allowProcess":[4,"allow-process"],"allowReorder":[4,"allow-reorder"],"allowImagePreview":[4,"allow-image-preview"],"imagePreviewHeight":[2,"image-preview-height"],"filePosterHeight":[2,"file-poster-height"],"storeAsFile":[4,"store-as-file"],"forceRevert":[4,"force-revert"],"maxFilesCount":[2,"max-files-count"],"maxParallelUploads":[2,"max-parallel-uploads"],"checkValidity":[4,"check-validity"],"itemInsertLocation":[1,"item-insert-location"],"itemInsertInterval":[2,"item-insert-interval"],"credits":[4],"dropOnPage":[4,"drop-on-page"],"dropOnElement":[4,"drop-on-element"],"dropValidation":[4,"drop-validation"],"ignoredFiles":[16,"ignored-files"],"instantUpload":[1028,"instant-upload"],"chunkUploads":[4,"chunk-uploads"],"chunkForce":[4,"chunk-force"],"chunkSize":[2,"chunk-size"],"chunkRetryDelays":[16,"chunk-retry-delays"],"labelDecimalSeparator":[1,"label-decimal-separator"],"labelThousandsSeparator":[1,"label-thousands-separator"],"labelIdle":[1025,"label-idle"],"iconRemove":[1,"icon-remove"],"iconProcess":[1,"icon-process"],"iconRetry":[1,"icon-retry"],"iconUndo":[1,"icon-undo"],"max_images_count":[32],"max_count_hint":[32],"uploadedFiles":[32],"isListScrollerListenerAdded":[32],"showMaxCountHint":[32],"setOption":[64]}],[4,"salla-list-tile",{"href":[1],"target":[1]}],[0,"salla-product-availability",{"channels":[1],"notifyOptionsAvailability":[4,"notify-options-availability"],"productId":[2,"product-id"],"isSubscribed":[1028,"is-subscribed"],"translationLoaded":[32],"title_":[32],"isVisitorSubscribed":[32]},null,{"channels":["channelsWatcher"]}],[0,"salla-quick-buy",{"type":[1025],"productId":[1025,"product-id"],"cartId":[1025,"cart-id"],"amount":[1538],"currency":[1025],"options":[16],"isRequireShipping":[1028,"is-require-shipping"],"applePayOnly":[1028,"apple-pay-only"],"isApplePayActive":[32],"quickBuy":[32]}],[0,"salla-progress-bar",{"donation":[1],"target":[1026],"value":[1026],"height":[1025],"header":[1025],"stripped":[1028],"message":[1025],"unit":[1025],"color":[1025],"hideUnits":[4,"hide-units"]}],[0,"salla-rating-stars",{"name":[1],"size":[1],"value":[2],"reviews":[2],"withLabel":[4,"with-label"],"editable":[4],"translationsLoaded":[32],"labels":[32],"reviewLabel":[32],"selectedStar":[32]}],[4,"salla-slider",{"blockTitle":[513,"block-title"],"listenToThumbnailsOption":[516,"listen-to-thumbnails-option"],"blockSubtitle":[513,"block-subtitle"],"displayAllUrl":[513,"display-all-url"],"arrowsCentered":[516,"arrows-centered"],"verticalThumbs":[516,"vertical-thumbs"],"gridThumbs":[516,"grid-thumbs"],"vertical":[516],"autoHeight":[516,"auto-height"],"showControls":[516,"show-controls"],"controlsOuter":[516,"controls-outer"],"showThumbsControls":[4,"show-thumbs-controls"],"autoPlay":[4,"auto-play"],"slidesPerView":[1,"slides-per-view"],"pagination":[4],"centered":[4],"loop":[4],"direction":[1537],"type":[1],"sliderConfig":[520,"slider-config"],"thumbsConfig":[520,"thumbs-config"],"currentIndex":[32],"isEnd":[32],"isBeginning":[32],"swiperScript":[32],"displayAllTitle":[32],"windowWidth":[32],"sliderInstance":[64],"slideTo":[64],"slideNext":[64],"slidePrev":[64],"slideToLoop":[64],"slideNextLoop":[64],"slidePrevLoop":[64],"slideReset":[64],"slideToClosest":[64],"update":[64],"updateAutoHeight":[64],"updateSlides":[64],"updateProgress":[64],"updateSlidesClasses":[64],"getSlides":[64],"updateSize":[64],"sliderInit":[64],"thumbsSliderInstance":[64],"thumbsSliderInit":[64],"thumbsSliderUpdate":[64],"thumbsSliderUpdateSlides":[64],"getThumbsUpdateSize":[64],"thumbsSlideTo":[64],"getThumbsSlides":[64]}],[4,"salla-placeholder",{"icon":[1],"alignment":[1],"iconSize":[1,"icon-size"],"translationLoaded":[32]}],[0,"salla-tel-input",{"phone":[1025],"autofocus":[516],"name":[1],"disabled":[4],"countryCode":[1025,"country-code"],"mobileRequired":[32],"countryCodeLabel":[32],"mobileLabel":[32],"tooShort":[32],"tooLong":[32],"invalidCountryCode":[32],"invalidNumber":[32],"errorMap":[32],"getValues":[64],"isValid":[64]}],[0,"salla-skeleton",{"type":[1],"width":[1],"height":[1]}],[4,"salla-modal",{"isClosable":[1028,"is-closable"],"width":[513],"position":[513],"visible":[516],"hasSkeleton":[516,"has-skeleton"],"isLoading":[1540,"is-loading"],"subTitleFirst":[4,"sub-title-first"],"noPadding":[4,"no-padding"],"subTitle":[1,"sub-title"],"centered":[4],"iconStyle":[1,"icon-style"],"modalTitle":[32],"open":[64],"close":[64],"setTitle":[64],"loading":[64],"stopLoading":[64]},[[0,"keyup","handleKeyUp"]],{"visible":["handleVisible"]}],[0,"salla-loading",{"size":[8],"width":[8],"color":[1],"bgColor":[1,"bg-color"]}],[4,"salla-button",{"shape":[513],"color":[513],"fill":[513],"size":[513],"width":[513],"loading":[516],"disabled":[516],"loaderPosition":[1,"loader-position"],"href":[1],"type":[513],"load":[64],"stop":[64],"setText":[64],"disable":[64],"enable":[64]}]]],["p-c6b5fa5c",[[0,"salla-booking-field",{"option":[16],"productId":[2,"product-id"],"bookNowLabel":[32],"editLabel":[32],"bookedLabel":[32],"selectDate":[32],"bookingUrl":[32],"iframeReady":[32],"reservations":[32],"reservationsInput":[32]}],[4,"salla-conditional-fields",null,[[0,"change","changeHandler"]]]]],["p-d6d158ac",[[0,"salla-price-range",{"minPrice":[1032,"min-price"],"maxPrice":[1032,"max-price"],"option":[16],"filtersData":[520,"filters-data"],"min":[32],"max":[32],"priceOptions":[32],"moreThanLabel":[32],"lessThanLabel":[32],"toLabel":[32],"fromLabel":[32],"typing":[32],"isMin":[32],"isRTL":[32],"reset":[64]}]]]]'),e)}));
5
5
  //# sourceMappingURL=twilight.esm.js.map
@@ -115,7 +115,7 @@ DOMTokenList
115
115
  var resourcesUrl = scriptElm ? scriptElm.getAttribute('data-resources-url') || scriptElm.src : '';
116
116
  var start = function() {
117
117
  // if src is not present then origin is "null", and new URL() throws TypeError: Failed to construct 'URL': Invalid base URL
118
- var url = new URL('./p-vBTXOrr5.system.js', new URL(resourcesUrl, window.location.origin !== 'null' ? window.location.origin : undefined));
118
+ var url = new URL('./p-CO2c0tFL.system.js', new URL(resourcesUrl, window.location.origin !== 'null' ? window.location.origin : undefined));
119
119
  System.import(url.href);
120
120
  };
121
121
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salla.sa/twilight-components",
3
- "version": "2.14.228",
3
+ "version": "2.14.229",
4
4
  "license": "GPL-3.0",
5
5
  "author": "Salla Team <support@salla.dev> (https://salla.dev)",
6
6
  "bugs": {
@@ -80,9 +80,9 @@
80
80
  "typescript": "^5.4.5"
81
81
  },
82
82
  "dependencies": {
83
- "@salla.sa/applepay": "2.14.228",
84
- "@salla.sa/twilight": "2.14.228",
85
- "@salla.sa/twilight-tailwind-theme": "2.14.228",
83
+ "@salla.sa/applepay": "2.14.229",
84
+ "@salla.sa/twilight": "2.14.229",
85
+ "@salla.sa/twilight-tailwind-theme": "2.14.229",
86
86
  "@types/node": "^20.4.8",
87
87
  "animejs": "^3.2.2",
88
88
  "filepond": "^4.30.6",
@@ -100,5 +100,5 @@
100
100
  "vanilla-lazyload": "^17.8.5",
101
101
  "vanilla-picker": "^2.12.2"
102
102
  },
103
- "gitHead": "df1fb8d89f40b31a7f3db672338f7dea6aa470f1"
103
+ "gitHead": "218fc668187b0b3725a6f5f6ea1d8238c4eb8932"
104
104
  }
@@ -1,5 +0,0 @@
1
- /*!
2
- * Crafted with ❤ by Salla
3
- */
4
- import{r as t,h as i,H as e}from"./p-CNDQzdP7.js";var s;(function(t){t["PERCENTAGE"]="percentage";t["FIXED"]="fixed";t["FREE_PRODUCT"]="free_product"})(s||(s={}));var n;(function(t){t["PRODUCT_COUNT"]="products_count";t["PRODUCT_PURCHASE"]="order_amount"})(n||(n={}));const o=":host{display:block}";const l=class{constructor(i){t(this,i);this.offer=null;this.products={};this.isLoading=false;this.canRender=true}componentWillLoad(){salla.onReady().then((()=>{var t,i,e;if(!((t=salla.config.get("store.features"))===null||t===void 0?void 0:t.includes("conditional-offer"))||salla.storage.get("cart")!==""&&!((e=(i=salla.storage.get("cart"))===null||i===void 0?void 0:i.summary)===null||e===void 0?void 0:e.count)){throw new Error("feature or cart object does not existed")}})).then((()=>salla.api.cart.offers())).then((({data:t})=>{this.offer=t.find((t=>t.type==="conditional"));if(!this.offer){this.canRender=false;return}this.isLoading=true;this.offer.details.discounts.unshift({value:0,min_spend:0});return this.updateInitialOfferValue()})).then((()=>{if(!this.offer)return;return this.getProducts()})).then((()=>{if(!this.offer)return;salla.event.on("cart::updated",(t=>this.updateOfferValues(t)))})).catch((t=>{this.canRender=false;salla.logger.warn("salla-conditional-offer:: ",t)})).finally((()=>{this.isLoading=false}))}getProducts(){const t=this.offer.details.discounts.filter((({type:t})=>t===s.FREE_PRODUCT)).map((({value:t})=>t));if(t.length>0){return salla.product.fetch({source:"selected",source_value:t}).then((({data:t})=>{t.forEach((({id:t,url:i,image:e})=>{this.products[t]={url:i,image:e}}))}))}}updateInitialOfferValue(){return salla.api.cart.details().then((({data:{cart:t}})=>this.updateOfferValues(t)))}updateOfferValues({items:t,sub_total:i}){var e;const s=this.offer.details.based_on===n.PRODUCT_COUNT?t.reduce(((t,{quantity:i})=>t+i),0):i;this.offer=Object.assign(Object.assign({},this.offer),{details:Object.assign(Object.assign({},(e=this.offer)===null||e===void 0?void 0:e.details),{current_value:s})});return this.offer}getCheckpointContent(t){var e,n;if(t.type===s.PERCENTAGE)return`${t.value}%`;if(t.type===s.FIXED)return salla.money(t.value);if(t.type!==s.FREE_PRODUCT){salla.logger.error(`salla-conditional-offer:: unexpected type (${t.type})!`);return""}const o=this.products[t.value];if(!o){salla.logger.error(`salla-conditional-offer:: there is no product with id (${t.value})!`);return""}return i("a",{class:"s-conditional-offer-product-link",href:o.url},i("img",{class:"s-conditional-offer-checkpoint-image-content",loading:"lazy",decoding:"async",alt:((e=o===null||o===void 0?void 0:o.image)===null||e===void 0?void 0:e.alt)||"",src:(n=o===null||o===void 0?void 0:o.image)===null||n===void 0?void 0:n.url}))}getOfferType(t){var i;const e=(i=this.offer.details)===null||i===void 0?void 0:i.based_on;if(e===n.PRODUCT_COUNT)return salla.lang.choice("blocks.header.products_count",t.min_spend);if(e===n.PRODUCT_PURCHASE)return salla.money(t.min_spend);salla.logger.warn(`salla-conditional-offer:: Unexpected offer detail's based_on value: ${e}`);return`${t.min_spend}`}clamp(t,i,e){return Math.max(i,Math.min(t,e))}mapValueRanges(t,i,e,s,n){const o=(t-i)*(n-s)/(e-i)+s;if(o===Number.POSITIVE_INFINITY)return 100;if(o===Number.NEGATIVE_INFINITY)return 0;return this.clamp(o,0,100)}getCheckPointView(t,e){var s,n;const o=this.offer.details.discounts.findIndex((({min_spend:i})=>i===t.min_spend));const l=(n=(s=this.offer.details.discounts[o-1])===null||s===void 0?void 0:s.min_spend)!==null&&n!==void 0?n:0;const a=this.mapValueRanges(this.offer.details.current_value,l,t.min_spend,0,100);const r=t.min_spend<=this.offer.details.current_value;return i("div",{class:"s-conditional-offer-checkpoint-container"},e>0?[i("div",{key:"progress-line",class:"s-conditional-offer-progress-line-container"},i("div",{class:"s-conditional-offer-progress-line-inactive"}),i("div",{class:"s-conditional-offer-progress-line-active",style:{width:`${a}%`}})),i("div",{key:"checkpoint",class:`s-conditional-offer-checkpoint ${r?"s-conditional-offer-active-checkpoint":""}`},i("div",{class:`s-conditional-offer-item-avatar-content ${r?"active":""}`,innerHTML:this.products&&this.getCheckpointContent(t)}),i("div",{class:`s-conditional-offer-checkpoint-label ${r?"active":""}`,innerHTML:this.getOfferType(t)}))]:i("div",{key:"label",class:{"s-conditional-offer-checkpoint-label":true,"first-checkpoint":e===0,active:r},innerHTML:this.getOfferType(t)}))}getLoadingSkeletonView(){return i(e,{class:"s-conditional-offer-container"},i("div",{class:"s-conditional-offer-skeleton-inner-container"},i("div",{class:"s-conditional-offer-skeleton-subtitle"},i("salla-skeleton",{height:"16px",width:"30%"})),i("div",{class:"s-conditional-offer-skeleton-subtitle"},i("salla-skeleton",{height:"16px",width:"35%"})),i("div",{class:"s-conditional-offer-skeleton-checkpoints-wrapper"},Array(3).fill(null).map((()=>[i("salla-skeleton",{key:"checkpoint-line",height:"8px"}),i("div",{key:"checkpoint"},i("salla-skeleton",{height:"60px",width:"60px",type:"circle"}))])))))}render(){if(!this.canRender)return null;if(this.isLoading)return this.getLoadingSkeletonView();if(!this.offer)return null;return i(e,{class:"s-conditional-offer-container"},i("div",{class:"s-conditional-offer-title-wrapper"},i("div",{class:"s-conditional-offer-title"},this.offer.title),this.offer.description?i("div",{class:"s-conditional-offer-subtitle"},this.offer.description," ",i("i",{class:"sicon-information"})):null),i("div",{class:"s-conditional-offer-progress-container"},this.offer.details.discounts.map(((t,e)=>i("div",{class:{"flex-1":e>0},key:t.min_spend},this.getCheckPointView(t,e))))))}};l.style=o;export{l as salla_conditional_offer};
5
- //# sourceMappingURL=p-22e25d12.entry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["DiscountType","OfferType","sallaConditionalOfferCss","SallaConditionalOffer","constructor","hostRef","this","offer","products","isLoading","canRender","componentWillLoad","salla","onReady","then","_a","config","get","includes","storage","_c","_b","summary","count","Error","api","cart","offers","data","find","type","details","discounts","unshift","value","min_spend","updateInitialOfferValue","getProducts","event","on","updatedCart","updateOfferValues","catch","error","logger","warn","finally","freeProductIDs","filter","FREE_PRODUCT","map","length","product","fetch","source","source_value","forEach","id","url","image","items","sub_total","current_value","based_on","PRODUCT_COUNT","reduce","quantity","Object","assign","getCheckpointContent","discount","PERCENTAGE","FIXED","money","productItem","h","class","href","loading","decoding","alt","src","getOfferType","basedOn","lang","choice","PRODUCT_PURCHASE","clamp","min","max","Math","mapValueRanges","initialMinRange","initialMaxRange","newMinRange","newMaxRange","newRange","Number","POSITIVE_INFINITY","NEGATIVE_INFINITY","getCheckPointView","index","checkpointIndex","findIndex","previousCheckpointValue","progressPercentage","isActive","key","style","width","innerHTML","active","getLoadingSkeletonView","Host","height","Array","fill","render","title","description"],"sources":["src/components/salla-conditional-offer/interfaces.ts","src/components/salla-conditional-offer/salla-conditional-offer.scss?tag=salla-conditional-offer","src/components/salla-conditional-offer/salla-conditional-offer.tsx"],"sourcesContent":["import type { Product } from \"@salla.sa/twilight/types/common\";\n\nexport enum DiscountType {\n PERCENTAGE = \"percentage\",\n FIXED = \"fixed\",\n FREE_PRODUCT = \"free_product\",\n}\n\nexport enum OfferType {\n PRODUCT_COUNT = \"products_count\",\n PRODUCT_PURCHASE = \"order_amount\",\n}\n\nexport interface Discount {\n type?: DiscountType;\n value?: number;\n min_spend?: number;\n max_discount?: number;\n}\n\nexport interface OfferDetails {\n based_on?: OfferType;\n ends_at?: number;\n start_value?: number;\n end_value?: number;\n current_value?: number;\n discounts?: Discount[];\n}\n\nexport interface Offer {\n id?: number;\n type?: string;\n title?: string;\n description?: string;\n details?: OfferDetails | null;\n}\n\n\nexport interface ProductDetail {\n id?: number;\n sku?: string;\n name?: string;\n description?: string;\n url?: string;\n promotion_title?: null;\n subtitle?: null;\n type?: string;\n status?: string;\n price?: number;\n base_currency_price?: BaseCurrencyPrice;\n sale_price?: number;\n regular_price?: number;\n starting_price?: null;\n quantity?: null;\n max_quantity?: number;\n discount_ends?: null;\n is_taxable?: boolean;\n has_read_more?: boolean;\n can_add_note?: boolean;\n can_show_remained_quantity?: boolean;\n can_upload_file?: boolean;\n has_custom_form?: boolean;\n has_metadata?: boolean;\n is_on_sale?: boolean;\n is_hidden_quantity?: boolean;\n is_available?: boolean;\n is_out_of_stock?: boolean;\n is_require_shipping?: boolean;\n weight?: null;\n calories?: null;\n image?: Image;\n currency?: string;\n}\n\nexport interface BaseCurrencyPrice {\n currency?: string;\n amount?: number;\n}\n\nexport interface Image {\n url?: string;\n alt?: string;\n}\n\nexport interface UpdatedCart {\n items: Array<Product>;\n sub_total: number;\n}\n",":host {\n display: block;\n}","import { Component, Host, State, h } from \"@stencil/core\";\nimport {\n type Discount,\n DiscountType,\n type Offer,\n OfferType,\n type UpdatedCart,\n} from \"./interfaces\";\nimport type { Product } from \"@salla.sa/twilight/types/common\";\n\n@Component({\n tag: \"salla-conditional-offer\",\n styleUrl: \"salla-conditional-offer.scss\",\n})\nexport class SallaConditionalOffer {\n\n @State() offer: Offer = null;\n @State() products: Record<string, Pick<Product, 'image' | 'url'>> = {}\n @State() isLoading = false\n @State() canRender = true\n\n componentWillLoad() {\n salla.onReady().then(() => {\n if (!salla.config.get('store.features')?.includes('conditional-offer') || (salla.storage.get(\"cart\") !== '' && !salla.storage.get(\"cart\")?.summary?.count)) {\n throw new Error('feature or cart object does not existed');\n }\n })\n .then(() => salla.api.cart.offers())\n .then(({ data }: { data: Offer[] }) => {\n this.offer = data.find(offer => offer.type === \"conditional\")\n\n if (!this.offer) {\n this.canRender = false\n return;\n }\n\n this.isLoading = true\n this.offer.details.discounts.unshift(({ value: 0, min_spend: 0 }))\n return this.updateInitialOfferValue()\n }).then(() => {\n if (!this.offer) return;\n return this.getProducts()\n }).then(() => {\n if (!this.offer) return;\n salla.event.on(\"cart::updated\", (updatedCart: UpdatedCart) => this.updateOfferValues(updatedCart))\n })\n .catch(error => {\n this.canRender = false\n salla.logger.warn('salla-conditional-offer:: ', error)\n }).finally(() => {\n this.isLoading = false\n })\n\n }\n\n private getProducts() {\n const freeProductIDs = this.offer.details.discounts.filter(({ type }) => type === DiscountType.FREE_PRODUCT).map(({ value }) => value)\n if (freeProductIDs.length > 0) {\n return salla.product.fetch({ source: 'selected', source_value: freeProductIDs }).then(({ data }: { data: Array<Product> }) => {\n data.forEach(({ id, url, image }) => {\n this.products[id] = { url, image }\n })\n })\n }\n }\n\n private updateInitialOfferValue() {\n return salla.api.cart.details().then(({ data: { cart } }: { data: { cart: UpdatedCart } }) => this.updateOfferValues(cart))\n }\n\n private updateOfferValues({ items, sub_total }: UpdatedCart) {\n const current_value = this.offer.details.based_on === OfferType.PRODUCT_COUNT ? items.reduce((count: number, { quantity }) => count + quantity, 0,) : sub_total\n //we need to assign the offer object a new reference to trigger re-rendering\n this.offer = {\n ...this.offer, details: {\n ...this.offer?.details, current_value,\n }\n }\n return this.offer\n }\n\n private getCheckpointContent(discount: Discount) {\n\n if (discount.type === DiscountType.PERCENTAGE) return `${discount.value}%`\n\n if (discount.type === DiscountType.FIXED) return salla.money(discount.value)\n\n if (discount.type !== DiscountType.FREE_PRODUCT) {\n salla.logger.error(`salla-conditional-offer:: unexpected type (${discount.type})!`);\n return \"\";\n }\n\n const productItem = this.products[discount.value]\n\n if (!productItem) {\n salla.logger.error(`salla-conditional-offer:: there is no product with id (${discount.value})!`);\n return \"\";\n }\n\n return <a class=\"s-conditional-offer-product-link\" href={productItem.url} >\n <img\n class=\"s-conditional-offer-checkpoint-image-content\"\n loading=\"lazy\"\n decoding=\"async\"\n alt={productItem?.image?.alt || \"\"}\n src={productItem?.image?.url} />\n </a>\n }\n\n private getOfferType(discount: Discount): string {\n const basedOn = this.offer.details?.based_on;\n if (basedOn === OfferType.PRODUCT_COUNT) return salla.lang.choice(\"blocks.header.products_count\", discount.min_spend);\n if (basedOn === OfferType.PRODUCT_PURCHASE) return salla.money(discount.min_spend);\n\n salla.logger.warn(`salla-conditional-offer:: Unexpected offer detail's based_on value: ${basedOn}`);\n return `${discount.min_spend}`;\n }\n\n private clamp(value: number, min: number, max: number) {\n return Math.max(min, Math.min(value, max));\n }\n\n private mapValueRanges(value: number, initialMinRange: number, initialMaxRange: number, newMinRange: number, newMaxRange: number) {\n\n const newRange = ((value - initialMinRange) * (newMaxRange - newMinRange)) / (initialMaxRange - initialMinRange) + newMinRange;\n\n if (newRange === Number.POSITIVE_INFINITY) return 100\n\n if (newRange === Number.NEGATIVE_INFINITY) return 0\n\n return this.clamp(newRange, 0, 100)\n }\n\n private getCheckPointView(discount: Discount, index: number) {\n const checkpointIndex = this.offer.details.discounts.findIndex(({ min_spend }) => min_spend === discount.min_spend);\n const previousCheckpointValue = this.offer.details.discounts[checkpointIndex - 1]?.min_spend ?? 0;\n const progressPercentage = this.mapValueRanges(this.offer.details.current_value, previousCheckpointValue, discount.min_spend, 0, 100);\n const isActive = discount.min_spend <= this.offer.details.current_value;\n\n return (\n <div class=\"s-conditional-offer-checkpoint-container\">\n {index > 0 ? [\n <div key=\"progress-line\" class=\"s-conditional-offer-progress-line-container\">\n <div class=\"s-conditional-offer-progress-line-inactive\" />\n <div class=\"s-conditional-offer-progress-line-active\" style={{ width: `${progressPercentage}%` }} />\n </div>,\n <div key=\"checkpoint\" class={`s-conditional-offer-checkpoint ${isActive ? \"s-conditional-offer-active-checkpoint\" : \"\"}`} >\n <div class={`s-conditional-offer-item-avatar-content ${isActive ? \"active\" : \"\"}`} innerHTML={this.products && this.getCheckpointContent(discount)}>\n </div>\n <div class={`s-conditional-offer-checkpoint-label ${isActive ? \"active\" : \"\"}`} innerHTML={this.getOfferType(discount)} />\n\n </div>\n ] :\n <div key=\"label\" class={{ \"s-conditional-offer-checkpoint-label\": true, \"first-checkpoint\": index === 0, active: isActive }} innerHTML={this.getOfferType(discount)} />\n }\n </div>\n );\n }\n\n private getLoadingSkeletonView() {\n return <Host class=\"s-conditional-offer-container\" >\n <div class=\"s-conditional-offer-skeleton-inner-container\">\n <div class=\"s-conditional-offer-skeleton-subtitle\">\n <salla-skeleton height=\"16px\" width=\"30%\" />\n </div>\n\n <div class=\"s-conditional-offer-skeleton-subtitle\">\n <salla-skeleton height=\"16px\" width=\"35%\" />\n </div>\n <div class=\"s-conditional-offer-skeleton-checkpoints-wrapper\">\n {Array(3).fill(null).map(() => (\n [<salla-skeleton key=\"checkpoint-line\" height=\"8px\" />,\n <div key=\"checkpoint\">\n <salla-skeleton height=\"60px\" width=\"60px\" type=\"circle\" />\n </div>]\n ))}\n </div>\n\n </div>\n </Host>\n }\n\n render() {\n if (!this.canRender) return null\n if (this.isLoading) return this.getLoadingSkeletonView()\n if (!this.offer) return null\n\n return <Host class=\"s-conditional-offer-container\">\n <div class=\"s-conditional-offer-title-wrapper\">\n <div class=\"s-conditional-offer-title\">{this.offer.title}</div>\n {this.offer.description ? <div class=\"s-conditional-offer-subtitle\">\n {this.offer.description} <i class=\"sicon-information\" />\n </div> : null}\n </div>\n <div class=\"s-conditional-offer-progress-container\">\n {this.offer.details.discounts.map((discount, index) => (\n <div class={{ \"flex-1\": index > 0 }} key={discount.min_spend}>\n {this.getCheckPointView(discount, index)}\n </div>\n ))}\n </div>\n </Host>\n }\n}\n"],"mappings":";;;kDAEA,IAAYA,GAAZ,SAAYA,GACRA,EAAA,2BACAA,EAAA,iBACAA,EAAA,8BACH,EAJD,CAAYA,MAIX,KAED,IAAYC,GAAZ,SAAYA,GACRA,EAAA,kCACAA,EAAA,kCACH,EAHD,CAAYA,MAGX,KCXD,MAAMC,EAA2B,uB,MCcpBC,EAAqB,MAJlC,WAAAC,CAAAC,G,UAMaC,KAAKC,MAAU,KACfD,KAAQE,SAAmD,GAC3DF,KAASG,UAAG,MACZH,KAASI,UAAG,IAwLxB,CAtLG,iBAAAC,GACIC,MAAMC,UAAUC,MAAK,K,UACjB,MAAKC,EAAAH,MAAMI,OAAOC,IAAI,qBAAiB,MAAAF,SAAA,SAAAA,EAAEG,SAAS,uBAAyBN,MAAMO,QAAQF,IAAI,UAAY,OAAO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IACzC1B,EAAK,OAAAC,MAAO,CAAE,SAAUyB,EAAQ,GAAKM,IAAKrC,EAASnC,WAC9C7B,KAAK8F,kBAAkB9B,EAAU+B,O","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"p-Cz_wOczc.system.js","sources":["src/components/salla-conditional-offer/interfaces.ts","src/components/salla-conditional-offer/salla-conditional-offer.scss?tag=salla-conditional-offer","src/components/salla-conditional-offer/salla-conditional-offer.tsx"],"sourcesContent":["import type { Product } from \"@salla.sa/twilight/types/common\";\n\nexport enum DiscountType {\n PERCENTAGE = \"percentage\",\n FIXED = \"fixed\",\n FREE_PRODUCT = \"free_product\",\n}\n\nexport enum OfferType {\n PRODUCT_COUNT = \"products_count\",\n PRODUCT_PURCHASE = \"order_amount\",\n}\n\nexport interface Discount {\n type?: DiscountType;\n value?: number;\n min_spend?: number;\n max_discount?: number;\n}\n\nexport interface OfferDetails {\n based_on?: OfferType;\n ends_at?: number;\n start_value?: number;\n end_value?: number;\n current_value?: number;\n discounts?: Discount[];\n}\n\nexport interface Offer {\n id?: number;\n type?: string;\n title?: string;\n description?: string;\n details?: OfferDetails | null;\n}\n\n\nexport interface ProductDetail {\n id?: number;\n sku?: string;\n name?: string;\n description?: string;\n url?: string;\n promotion_title?: null;\n subtitle?: null;\n type?: string;\n status?: string;\n price?: number;\n base_currency_price?: BaseCurrencyPrice;\n sale_price?: number;\n regular_price?: number;\n starting_price?: null;\n quantity?: null;\n max_quantity?: number;\n discount_ends?: null;\n is_taxable?: boolean;\n has_read_more?: boolean;\n can_add_note?: boolean;\n can_show_remained_quantity?: boolean;\n can_upload_file?: boolean;\n has_custom_form?: boolean;\n has_metadata?: boolean;\n is_on_sale?: boolean;\n is_hidden_quantity?: boolean;\n is_available?: boolean;\n is_out_of_stock?: boolean;\n is_require_shipping?: boolean;\n weight?: null;\n calories?: null;\n image?: Image;\n currency?: string;\n}\n\nexport interface BaseCurrencyPrice {\n currency?: string;\n amount?: number;\n}\n\nexport interface Image {\n url?: string;\n alt?: string;\n}\n\nexport interface UpdatedCart {\n items: Array<Product>;\n sub_total: number;\n}\n",":host {\n display: block;\n}","import { Component, Host, State, h } from \"@stencil/core\";\nimport {\n type Discount,\n DiscountType,\n type Offer,\n OfferType,\n type UpdatedCart,\n} from \"./interfaces\";\nimport type { Product } from \"@salla.sa/twilight/types/common\";\n\n@Component({\n tag: \"salla-conditional-offer\",\n styleUrl: \"salla-conditional-offer.scss\",\n})\nexport class SallaConditionalOffer {\n\n @State() offer: Offer = null;\n @State() products: Record<string, Pick<Product, 'image' | 'url'>> = {}\n @State() isLoading = false\n @State() canRender = true\n\n componentWillLoad() {\n salla.onReady().then(() => {\n if (!salla.config.get('store.features')?.includes('conditional-offer') || (salla.storage.get(\"cart\") !== '' && !salla.storage.get(\"cart\")?.summary?.count)) {\n throw new Error('feature or cart object does not existed');\n }\n })\n .then(() => salla.api.cart.offers())\n .then(({ data }: { data: Offer[] }) => {\n this.offer = data.find(offer => offer.type === \"conditional\")\n\n if (!this.offer) {\n this.canRender = false\n return;\n }\n\n this.isLoading = true\n this.offer.details.discounts.unshift(({ value: 0, min_spend: 0 }))\n return this.updateInitialOfferValue()\n }).then(() => {\n if (!this.offer) return;\n return this.getProducts()\n }).then(() => {\n if (!this.offer) return;\n salla.event.on(\"cart::updated\", (updatedCart: UpdatedCart) => this.updateOfferValues(updatedCart))\n })\n .catch(error => {\n this.canRender = false\n salla.logger.warn('salla-conditional-offer:: ', error)\n }).finally(() => {\n this.isLoading = false\n })\n\n }\n\n private getProducts() {\n const freeProductIDs = this.offer.details.discounts.filter(({ type }) => type === DiscountType.FREE_PRODUCT).map(({ value }) => value)\n if (freeProductIDs.length > 0) {\n return salla.product.fetch({ source: 'selected', source_value: freeProductIDs }).then(({ data }: { data: Array<Product> }) => {\n data.forEach(({ id, url, image }) => {\n this.products[id] = { url, image }\n })\n })\n }\n }\n\n private updateInitialOfferValue() {\n return salla.api.cart.details().then(({ data: { cart } }: { data: { cart: UpdatedCart } }) => this.updateOfferValues(cart))\n }\n\n private updateOfferValues({ items, sub_total }: UpdatedCart) {\n const current_value = this.offer.details.based_on === OfferType.PRODUCT_COUNT ? items.reduce((count: number, { quantity }) => count + quantity, 0,) : sub_total\n //we need to assign the offer object a new reference to trigger re-rendering\n this.offer = {\n ...this.offer, details: {\n ...this.offer?.details, current_value,\n }\n }\n return this.offer\n }\n\n private getCheckpointContent(discount: Discount) {\n\n if (discount.type === DiscountType.PERCENTAGE) return `${discount.value}%`\n\n if (discount.type === DiscountType.FIXED) return salla.money(discount.value)\n\n if (discount.type !== DiscountType.FREE_PRODUCT) {\n salla.logger.error(`salla-conditional-offer:: unexpected type (${discount.type})!`);\n return \"\";\n }\n\n const productItem = this.products[discount.value]\n\n if (!productItem) {\n salla.logger.error(`salla-conditional-offer:: there is no product with id (${discount.value})!`);\n return \"\";\n }\n\n return <a class=\"s-conditional-offer-product-link\" href={productItem.url} >\n <img\n class=\"s-conditional-offer-checkpoint-image-content\"\n loading=\"lazy\"\n decoding=\"async\"\n alt={productItem?.image?.alt || \"\"}\n src={productItem?.image?.url} />\n </a>\n }\n\n private getOfferType(discount: Discount): string {\n const basedOn = this.offer.details?.based_on;\n if (basedOn === OfferType.PRODUCT_COUNT) return salla.lang.choice(\"blocks.header.products_count\", discount.min_spend);\n if (basedOn === OfferType.PRODUCT_PURCHASE) return salla.money(discount.min_spend);\n\n salla.logger.warn(`salla-conditional-offer:: Unexpected offer detail's based_on value: ${basedOn}`);\n return `${discount.min_spend}`;\n }\n\n private clamp(value: number, min: number, max: number) {\n return Math.max(min, Math.min(value, max));\n }\n\n private mapValueRanges(value: number, initialMinRange: number, initialMaxRange: number, newMinRange: number, newMaxRange: number) {\n\n const newRange = ((value - initialMinRange) * (newMaxRange - newMinRange)) / (initialMaxRange - initialMinRange) + newMinRange;\n\n if (newRange === Number.POSITIVE_INFINITY) return 100\n\n if (newRange === Number.NEGATIVE_INFINITY) return 0\n\n return this.clamp(newRange, 0, 100)\n }\n\n private getCheckPointView(discount: Discount, index: number) {\n const checkpointIndex = this.offer.details.discounts.findIndex(({ min_spend }) => min_spend === discount.min_spend);\n const previousCheckpointValue = this.offer.details.discounts[checkpointIndex - 1]?.min_spend ?? 0;\n const progressPercentage = this.mapValueRanges(this.offer.details.current_value, previousCheckpointValue, discount.min_spend, 0, 100);\n const isActive = discount.min_spend <= this.offer.details.current_value;\n\n return (\n <div class=\"s-conditional-offer-checkpoint-container\">\n {index > 0 ? [\n <div key=\"progress-line\" class=\"s-conditional-offer-progress-line-container\">\n <div class=\"s-conditional-offer-progress-line-inactive\" />\n <div class=\"s-conditional-offer-progress-line-active\" style={{ width: `${progressPercentage}%` }} />\n </div>,\n <div key=\"checkpoint\" class={`s-conditional-offer-checkpoint ${isActive ? \"s-conditional-offer-active-checkpoint\" : \"\"}`} >\n <div class={`s-conditional-offer-item-avatar-content ${isActive ? \"active\" : \"\"}`} innerHTML={this.products && this.getCheckpointContent(discount)}>\n </div>\n <div class={`s-conditional-offer-checkpoint-label ${isActive ? \"active\" : \"\"}`} innerHTML={this.getOfferType(discount)} />\n\n </div>\n ] :\n <div key=\"label\" class={{ \"s-conditional-offer-checkpoint-label\": true, \"first-checkpoint\": index === 0, active: isActive }} innerHTML={this.getOfferType(discount)} />\n }\n </div>\n );\n }\n\n private getLoadingSkeletonView() {\n return <Host class=\"s-conditional-offer-container\" >\n <div class=\"s-conditional-offer-skeleton-inner-container\">\n <div class=\"s-conditional-offer-skeleton-subtitle\">\n <salla-skeleton height=\"16px\" width=\"30%\" />\n </div>\n\n <div class=\"s-conditional-offer-skeleton-subtitle\">\n <salla-skeleton height=\"16px\" width=\"35%\" />\n </div>\n <div class=\"s-conditional-offer-skeleton-checkpoints-wrapper\">\n {Array(3).fill(null).map(() => (\n [<salla-skeleton key=\"checkpoint-line\" height=\"8px\" />,\n <div key=\"checkpoint\">\n <salla-skeleton height=\"60px\" width=\"60px\" type=\"circle\" />\n </div>]\n ))}\n </div>\n\n </div>\n </Host>\n }\n\n render() {\n if (!this.canRender) return null\n if (this.isLoading) return this.getLoadingSkeletonView()\n if (!this.offer) return null\n\n return <Host class=\"s-conditional-offer-container\">\n <div class=\"s-conditional-offer-title-wrapper\">\n <div class=\"s-conditional-offer-title\">{this.offer.title}</div>\n {this.offer.description ? <div class=\"s-conditional-offer-subtitle\">\n {this.offer.description} <i class=\"sicon-information\" />\n </div> : null}\n </div>\n <div class=\"s-conditional-offer-progress-container\">\n {this.offer.details.discounts.map((discount, index) => (\n <div class={{ \"flex-1\": index > 0 }} key={discount.min_spend}>\n {this.getCheckPointView(discount, index)}\n </div>\n ))}\n </div>\n </Host>\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;YAEA,IAAY,YAIX;YAJD,CAAA,UAAY,YAAY,EAAA;YACpB,IAAA,YAAA,CAAA,YAAA,CAAA,GAAA,YAAyB;YACzB,IAAA,YAAA,CAAA,OAAA,CAAA,GAAA,OAAe;YACf,IAAA,YAAA,CAAA,cAAA,CAAA,GAAA,cAA6B;YACjC,CAAC,EAJW,YAAY,KAAZ,YAAY,GAIvB,EAAA,CAAA,CAAA;YAED,IAAY,SAGX;YAHD,CAAA,UAAY,SAAS,EAAA;YACjB,IAAA,SAAA,CAAA,eAAA,CAAA,GAAA,gBAAgC;YAChC,IAAA,SAAA,CAAA,kBAAA,CAAA,GAAA,cAAiC;YACrC,CAAC,EAHW,SAAS,KAAT,SAAS,GAGpB,EAAA,CAAA,CAAA;;YCXD,MAAM,wBAAwB,GAAG,sBAAsB;;kBCc1C,qBAAqB,sCAAA,MAAA;YAJlC,IAAA,WAAA,CAAA,OAAA,EAAA;;YAMa,QAAA,IAAK,CAAA,KAAA,GAAU,IAAI;YACnB,QAAA,IAAQ,CAAA,QAAA,GAAmD,EAAE;YAC7D,QAAA,IAAS,CAAA,SAAA,GAAG,KAAK;YACjB,QAAA,IAAS,CAAA,SAAA,GAAG,IAAI;YAwL5B;gBAtLG,iBAAiB,GAAA;YACb,QAAA,KAAK,CA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CAAA,IAAI,EAAC,EAAA,KAAK,EAAC,+BAA+B,EAAA,EAC9C,CAAK,CAAA,KAAA,EAAA,EAAA,KAAK,EAAC,mCAAmC,EAAA,EAC1C,CAAK,CAAA,KAAA,EAAA,EAAA,KAAK,EAAC,2BAA2B,EAAA,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,CAAO,EAC9D,IAAI,CAAC,KAAK,CAAC,WAAW,GAAG,CAAA,CAAA,KAAA,EAAA,EAAK,KAAK,EAAC,8BAA8B,EAAA,EAC9D,IAAI,CAAC,KAAK,CAAC,WAAW,OAAE,CAAG,CAAA,GAAA,EAAA,EAAA,KAAK,EAAC,mBAAmB,EAAA,CAAG,CACtD,GAAG,IAAI,CACX,EACN,CAAK,CAAA,KAAA,EAAA,EAAA,KAAK,EAAC,wCAAwC,EAC9C,EAAA,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,KAAK,MAC9C,CAAK,CAAA,KAAA,EAAA,EAAA,KAAK,EAAE,EAAE,QAAQ,EAAE,KAAK,GAAG,CAAC,EAAE,EAAE,GAAG,EAAE,QAAQ,CAAC,SAAS,EACvD,EAAA,IAAI,CAAC,iBAAiB,CAAC,QAAQ,EAAE,KAAK,CAAC,CACtC,CACT,CAAC,CACA,CACH;;;;;;;;;;;"}
@@ -1,5 +0,0 @@
1
- /*!
2
- * Crafted with ❤ by Salla
3
- */
4
- System.register(["./p-DcDP1ooH.system.js"],(function(i){"use strict";var n,t,e;return{setters:[function(i){n=i.r;t=i.h;e=i.H}],execute:function(){var o;(function(i){i["PERCENTAGE"]="percentage";i["FIXED"]="fixed";i["FREE_PRODUCT"]="free_product"})(o||(o={}));var r;(function(i){i["PRODUCT_COUNT"]="products_count";i["PRODUCT_PURCHASE"]="order_amount"})(r||(r={}));var a=":host{display:block}";var s=i("salla_conditional_offer",function(){function i(i){n(this,i);this.offer=null;this.products={};this.isLoading=false;this.canRender=true}i.prototype.componentWillLoad=function(){var i=this;salla.onReady().then((function(){var i,n,t;if(!((i=salla.config.get("store.features"))===null||i===void 0?void 0:i.includes("conditional-offer"))||salla.storage.get("cart")!==""&&!((t=(n=salla.storage.get("cart"))===null||n===void 0?void 0:n.summary)===null||t===void 0?void 0:t.count)){throw new Error("feature or cart object does not existed")}})).then((function(){return salla.api.cart.offers()})).then((function(n){var t=n.data;i.offer=t.find((function(i){return i.type==="conditional"}));if(!i.offer){i.canRender=false;return}i.isLoading=true;i.offer.details.discounts.unshift({value:0,min_spend:0});return i.updateInitialOfferValue()})).then((function(){if(!i.offer)return;return i.getProducts()})).then((function(){if(!i.offer)return;salla.event.on("cart::updated",(function(n){return i.updateOfferValues(n)}))})).catch((function(n){i.canRender=false;salla.logger.warn("salla-conditional-offer:: ",n)})).finally((function(){i.isLoading=false}))};i.prototype.getProducts=function(){var i=this;var n=this.offer.details.discounts.filter((function(i){var n=i.type;return n===o.FREE_PRODUCT})).map((function(i){var n=i.value;return n}));if(n.length>0){return salla.product.fetch({source:"selected",source_value:n}).then((function(n){var t=n.data;t.forEach((function(n){var t=n.id,e=n.url,o=n.image;i.products[t]={url:e,image:o}}))}))}};i.prototype.updateInitialOfferValue=function(){var i=this;return salla.api.cart.details().then((function(n){var t=n.data.cart;return i.updateOfferValues(t)}))};i.prototype.updateOfferValues=function(i){var n=i.items,t=i.sub_total;var e;var o=this.offer.details.based_on===r.PRODUCT_COUNT?n.reduce((function(i,n){var t=n.quantity;return i+t}),0):t;this.offer=Object.assign(Object.assign({},this.offer),{details:Object.assign(Object.assign({},(e=this.offer)===null||e===void 0?void 0:e.details),{current_value:o})});return this.offer};i.prototype.getCheckpointContent=function(i){var n,e;if(i.type===o.PERCENTAGE)return"".concat(i.value,"%");if(i.type===o.FIXED)return salla.money(i.value);if(i.type!==o.FREE_PRODUCT){salla.logger.error("salla-conditional-offer:: unexpected type (".concat(i.type,")!"));return""}var r=this.products[i.value];if(!r){salla.logger.error("salla-conditional-offer:: there is no product with id (".concat(i.value,")!"));return""}return t("a",{class:"s-conditional-offer-product-link",href:r.url},t("img",{class:"s-conditional-offer-checkpoint-image-content",loading:"lazy",decoding:"async",alt:((n=r===null||r===void 0?void 0:r.image)===null||n===void 0?void 0:n.alt)||"",src:(e=r===null||r===void 0?void 0:r.image)===null||e===void 0?void 0:e.url}))};i.prototype.getOfferType=function(i){var n;var t=(n=this.offer.details)===null||n===void 0?void 0:n.based_on;if(t===r.PRODUCT_COUNT)return salla.lang.choice("blocks.header.products_count",i.min_spend);if(t===r.PRODUCT_PURCHASE)return salla.money(i.min_spend);salla.logger.warn("salla-conditional-offer:: Unexpected offer detail's based_on value: ".concat(t));return"".concat(i.min_spend)};i.prototype.clamp=function(i,n,t){return Math.max(n,Math.min(i,t))};i.prototype.mapValueRanges=function(i,n,t,e,o){var r=(i-n)*(o-e)/(t-n)+e;if(r===Number.POSITIVE_INFINITY)return 100;if(r===Number.NEGATIVE_INFINITY)return 0;return this.clamp(r,0,100)};i.prototype.getCheckPointView=function(i,n){var e,o;var r=this.offer.details.discounts.findIndex((function(n){var t=n.min_spend;return t===i.min_spend}));var a=(o=(e=this.offer.details.discounts[r-1])===null||e===void 0?void 0:e.min_spend)!==null&&o!==void 0?o:0;var s=this.mapValueRanges(this.offer.details.current_value,a,i.min_spend,0,100);var l=i.min_spend<=this.offer.details.current_value;return t("div",{class:"s-conditional-offer-checkpoint-container"},n>0?[t("div",{key:"progress-line",class:"s-conditional-offer-progress-line-container"},t("div",{class:"s-conditional-offer-progress-line-inactive"}),t("div",{class:"s-conditional-offer-progress-line-active",style:{width:"".concat(s,"%")}})),t("div",{key:"checkpoint",class:"s-conditional-offer-checkpoint ".concat(l?"s-conditional-offer-active-checkpoint":"")},t("div",{class:"s-conditional-offer-item-avatar-content ".concat(l?"active":""),innerHTML:this.products&&this.getCheckpointContent(i)}),t("div",{class:"s-conditional-offer-checkpoint-label ".concat(l?"active":""),innerHTML:this.getOfferType(i)}))]:t("div",{key:"label",class:{"s-conditional-offer-checkpoint-label":true,"first-checkpoint":n===0,active:l},innerHTML:this.getOfferType(i)}))};i.prototype.getLoadingSkeletonView=function(){return t(e,{class:"s-conditional-offer-container"},t("div",{class:"s-conditional-offer-skeleton-inner-container"},t("div",{class:"s-conditional-offer-skeleton-subtitle"},t("salla-skeleton",{height:"16px",width:"30%"})),t("div",{class:"s-conditional-offer-skeleton-subtitle"},t("salla-skeleton",{height:"16px",width:"35%"})),t("div",{class:"s-conditional-offer-skeleton-checkpoints-wrapper"},Array(3).fill(null).map((function(){return[t("salla-skeleton",{key:"checkpoint-line",height:"8px"}),t("div",{key:"checkpoint"},t("salla-skeleton",{height:"60px",width:"60px",type:"circle"}))]})))))};i.prototype.render=function(){var i=this;if(!this.canRender)return null;if(this.isLoading)return this.getLoadingSkeletonView();if(!this.offer)return null;return t(e,{class:"s-conditional-offer-container"},t("div",{class:"s-conditional-offer-title-wrapper"},t("div",{class:"s-conditional-offer-title"},this.offer.title),this.offer.description?t("div",{class:"s-conditional-offer-subtitle"},this.offer.description," ",t("i",{class:"sicon-information"})):null),t("div",{class:"s-conditional-offer-progress-container"},this.offer.details.discounts.map((function(n,e){return t("div",{class:{"flex-1":e>0},key:n.min_spend},i.getCheckPointView(n,e))}))))};return i}());s.style=a}}}));
5
- //# sourceMappingURL=p-c9907836.system.entry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["DiscountType","OfferType","sallaConditionalOfferCss","SallaConditionalOffer","exports","class_1","hostRef","this","offer","products","isLoading","canRender","prototype","componentWillLoad","_this","salla","onReady","then","_a","config","get","includes","storage","_c","_b","summary","count","Error","api","cart","offers","_d","data","find","type","details","discounts","unshift","value","min_spend","updateInitialOfferValue","getProducts","event","on","updatedCart","updateOfferValues","catch","error","logger","warn","finally","freeProductIDs","filter","FREE_PRODUCT","map","length","product","fetch","source","source_value","forEach","id","url","image","items","sub_total","current_value","based_on","PRODUCT_COUNT","reduce","quantity","Object","assign","getCheckpointContent","discount","PERCENTAGE","concat","FIXED","money","productItem","h","class","href","loading","decoding","alt","src","getOfferType","basedOn","lang","choice","PRODUCT_PURCHASE","clamp","min","max","Math","mapValueRanges","initialMinRange","initialMaxRange","newMinRange","newMaxRange","newRange","Number","POSITIVE_INFINITY","NEGATIVE_INFINITY","getCheckPointView","index","checkpointIndex","findIndex","previousCheckpointValue","progressPercentage","isActive","key","style","width","innerHTML","active","getLoadingSkeletonView","Host","height","Array","fill","render","title","description"],"sources":["src/components/salla-conditional-offer/interfaces.ts","src/components/salla-conditional-offer/salla-conditional-offer.scss?tag=salla-conditional-offer","src/components/salla-conditional-offer/salla-conditional-offer.tsx"],"sourcesContent":["import type { Product } from \"@salla.sa/twilight/types/common\";\n\nexport enum DiscountType {\n PERCENTAGE = \"percentage\",\n FIXED = \"fixed\",\n FREE_PRODUCT = \"free_product\",\n}\n\nexport enum OfferType {\n PRODUCT_COUNT = \"products_count\",\n PRODUCT_PURCHASE = \"order_amount\",\n}\n\nexport interface Discount {\n type?: DiscountType;\n value?: number;\n min_spend?: number;\n max_discount?: number;\n}\n\nexport interface OfferDetails {\n based_on?: OfferType;\n ends_at?: number;\n start_value?: number;\n end_value?: number;\n current_value?: number;\n discounts?: Discount[];\n}\n\nexport interface Offer {\n id?: number;\n type?: string;\n title?: string;\n description?: string;\n details?: OfferDetails | null;\n}\n\n\nexport interface ProductDetail {\n id?: number;\n sku?: string;\n name?: string;\n description?: string;\n url?: string;\n promotion_title?: null;\n subtitle?: null;\n type?: string;\n status?: string;\n price?: number;\n base_currency_price?: BaseCurrencyPrice;\n sale_price?: number;\n regular_price?: number;\n starting_price?: null;\n quantity?: null;\n max_quantity?: number;\n discount_ends?: null;\n is_taxable?: boolean;\n has_read_more?: boolean;\n can_add_note?: boolean;\n can_show_remained_quantity?: boolean;\n can_upload_file?: boolean;\n has_custom_form?: boolean;\n has_metadata?: boolean;\n is_on_sale?: boolean;\n is_hidden_quantity?: boolean;\n is_available?: boolean;\n is_out_of_stock?: boolean;\n is_require_shipping?: boolean;\n weight?: null;\n calories?: null;\n image?: Image;\n currency?: string;\n}\n\nexport interface BaseCurrencyPrice {\n currency?: string;\n amount?: number;\n}\n\nexport interface Image {\n url?: string;\n alt?: string;\n}\n\nexport interface UpdatedCart {\n items: Array<Product>;\n sub_total: number;\n}\n",":host {\n display: block;\n}","import { Component, Host, State, h } from \"@stencil/core\";\nimport {\n type Discount,\n DiscountType,\n type Offer,\n OfferType,\n type UpdatedCart,\n} from \"./interfaces\";\nimport type { Product } from \"@salla.sa/twilight/types/common\";\n\n@Component({\n tag: \"salla-conditional-offer\",\n styleUrl: \"salla-conditional-offer.scss\",\n})\nexport class SallaConditionalOffer {\n\n @State() offer: Offer = null;\n @State() products: Record<string, Pick<Product, 'image' | 'url'>> = {}\n @State() isLoading = false\n @State() canRender = true\n\n componentWillLoad() {\n salla.onReady().then(() => {\n if (!salla.config.get('store.features')?.includes('conditional-offer') || (salla.storage.get(\"cart\") !== '' && !salla.storage.get(\"cart\")?.summary?.count)) {\n throw new Error('feature or cart object does not existed');\n }\n })\n .then(() => salla.api.cart.offers())\n .then(({ data }: { data: Offer[] }) => {\n this.offer = data.find(offer => offer.type === \"conditional\")\n\n if (!this.offer) {\n this.canRender = false\n return;\n }\n\n this.isLoading = true\n this.offer.details.discounts.unshift(({ value: 0, min_spend: 0 }))\n return this.updateInitialOfferValue()\n }).then(() => {\n if (!this.offer) return;\n return this.getProducts()\n }).then(() => {\n if (!this.offer) return;\n salla.event.on(\"cart::updated\", (updatedCart: UpdatedCart) => this.updateOfferValues(updatedCart))\n })\n .catch(error => {\n this.canRender = false\n salla.logger.warn('salla-conditional-offer:: ', error)\n }).finally(() => {\n this.isLoading = false\n })\n\n }\n\n private getProducts() {\n const freeProductIDs = this.offer.details.discounts.filter(({ type }) => type === DiscountType.FREE_PRODUCT).map(({ value }) => value)\n if (freeProductIDs.length > 0) {\n return salla.product.fetch({ source: 'selected', source_value: freeProductIDs }).then(({ data }: { data: Array<Product> }) => {\n data.forEach(({ id, url, image }) => {\n this.products[id] = { url, image }\n })\n })\n }\n }\n\n private updateInitialOfferValue() {\n return salla.api.cart.details().then(({ data: { cart } }: { data: { cart: UpdatedCart } }) => this.updateOfferValues(cart))\n }\n\n private updateOfferValues({ items, sub_total }: UpdatedCart) {\n const current_value = this.offer.details.based_on === OfferType.PRODUCT_COUNT ? items.reduce((count: number, { quantity }) => count + quantity, 0,) : sub_total\n //we need to assign the offer object a new reference to trigger re-rendering\n this.offer = {\n ...this.offer, details: {\n ...this.offer?.details, current_value,\n }\n }\n return this.offer\n }\n\n private getCheckpointContent(discount: Discount) {\n\n if (discount.type === DiscountType.PERCENTAGE) return `${discount.value}%`\n\n if (discount.type === DiscountType.FIXED) return salla.money(discount.value)\n\n if (discount.type !== DiscountType.FREE_PRODUCT) {\n salla.logger.error(`salla-conditional-offer:: unexpected type (${discount.type})!`);\n return \"\";\n }\n\n const productItem = this.products[discount.value]\n\n if (!productItem) {\n salla.logger.error(`salla-conditional-offer:: there is no product with id (${discount.value})!`);\n return \"\";\n }\n\n return <a class=\"s-conditional-offer-product-link\" href={productItem.url} >\n <img\n class=\"s-conditional-offer-checkpoint-image-content\"\n loading=\"lazy\"\n decoding=\"async\"\n alt={productItem?.image?.alt || \"\"}\n src={productItem?.image?.url} />\n </a>\n }\n\n private getOfferType(discount: Discount): string {\n const basedOn = this.offer.details?.based_on;\n if (basedOn === OfferType.PRODUCT_COUNT) return salla.lang.choice(\"blocks.header.products_count\", discount.min_spend);\n if (basedOn === OfferType.PRODUCT_PURCHASE) return salla.money(discount.min_spend);\n\n salla.logger.warn(`salla-conditional-offer:: Unexpected offer detail's based_on value: ${basedOn}`);\n return `${discount.min_spend}`;\n }\n\n private clamp(value: number, min: number, max: number) {\n return Math.max(min, Math.min(value, max));\n }\n\n private mapValueRanges(value: number, initialMinRange: number, initialMaxRange: number, newMinRange: number, newMaxRange: number) {\n\n const newRange = ((value - initialMinRange) * (newMaxRange - newMinRange)) / (initialMaxRange - initialMinRange) + newMinRange;\n\n if (newRange === Number.POSITIVE_INFINITY) return 100\n\n if (newRange === Number.NEGATIVE_INFINITY) return 0\n\n return this.clamp(newRange, 0, 100)\n }\n\n private getCheckPointView(discount: Discount, index: number) {\n const checkpointIndex = this.offer.details.discounts.findIndex(({ min_spend }) => min_spend === discount.min_spend);\n const previousCheckpointValue = this.offer.details.discounts[checkpointIndex - 1]?.min_spend ?? 0;\n const progressPercentage = this.mapValueRanges(this.offer.details.current_value, previousCheckpointValue, discount.min_spend, 0, 100);\n const isActive = discount.min_spend <= this.offer.details.current_value;\n\n return (\n <div class=\"s-conditional-offer-checkpoint-container\">\n {index > 0 ? [\n <div key=\"progress-line\" class=\"s-conditional-offer-progress-line-container\">\n <div class=\"s-conditional-offer-progress-line-inactive\" />\n <div class=\"s-conditional-offer-progress-line-active\" style={{ width: `${progressPercentage}%` }} />\n </div>,\n <div key=\"checkpoint\" class={`s-conditional-offer-checkpoint ${isActive ? \"s-conditional-offer-active-checkpoint\" : \"\"}`} >\n <div class={`s-conditional-offer-item-avatar-content ${isActive ? \"active\" : \"\"}`} innerHTML={this.products && this.getCheckpointContent(discount)}>\n </div>\n <div class={`s-conditional-offer-checkpoint-label ${isActive ? \"active\" : \"\"}`} innerHTML={this.getOfferType(discount)} />\n\n </div>\n ] :\n <div key=\"label\" class={{ \"s-conditional-offer-checkpoint-label\": true, \"first-checkpoint\": index === 0, active: isActive }} innerHTML={this.getOfferType(discount)} />\n }\n </div>\n );\n }\n\n private getLoadingSkeletonView() {\n return <Host class=\"s-conditional-offer-container\" >\n <div class=\"s-conditional-offer-skeleton-inner-container\">\n <div class=\"s-conditional-offer-skeleton-subtitle\">\n <salla-skeleton height=\"16px\" width=\"30%\" />\n </div>\n\n <div class=\"s-conditional-offer-skeleton-subtitle\">\n <salla-skeleton height=\"16px\" width=\"35%\" />\n </div>\n <div class=\"s-conditional-offer-skeleton-checkpoints-wrapper\">\n {Array(3).fill(null).map(() => (\n [<salla-skeleton key=\"checkpoint-line\" height=\"8px\" />,\n <div key=\"checkpoint\">\n <salla-skeleton height=\"60px\" width=\"60px\" type=\"circle\" />\n </div>]\n ))}\n </div>\n\n </div>\n </Host>\n }\n\n render() {\n if (!this.canRender) return null\n if (this.isLoading) return this.getLoadingSkeletonView()\n if (!this.offer) return null\n\n return <Host class=\"s-conditional-offer-container\">\n <div class=\"s-conditional-offer-title-wrapper\">\n <div class=\"s-conditional-offer-title\">{this.offer.title}</div>\n {this.offer.description ? <div class=\"s-conditional-offer-subtitle\">\n {this.offer.description} <i class=\"sicon-information\" />\n </div> : null}\n </div>\n <div class=\"s-conditional-offer-progress-container\">\n {this.offer.details.discounts.map((discount, index) => (\n <div class={{ \"flex-1\": index > 0 }} key={discount.min_spend}>\n {this.getCheckPointView(discount, index)}\n </div>\n ))}\n </div>\n </Host>\n }\n}\n"],"mappings":";;;kJAEA,IAAYA,GAAZ,SAAYA,GACRA,EAAA,2BACAA,EAAA,iBACAA,EAAA,8BACH,EAJD,CAAYA,MAIX,KAED,IAAYC,GAAZ,SAAYA,GACRA,EAAA,kCACAA,EAAA,kCACH,EAHD,CAAYA,MAGX,KCXD,IAAMC,EAA2B,uB,ICcpBC,EAAqBC,EAAA,qCAJlC,SAAAC,EAAAC,G,UAMaC,KAAKC,MAAU,KACfD,KAAQE,SAAmD,GAC3DF,KAASG,UAAG,MACZH,KAASI,UAAG,IAwLxB,CAtLGN,EAAAO,UAAAC,kBAAA,eAAAC,EAAAP,KACIQ,MAAMC,UAAUC,MAAK,W,UACjB,MAAKC,EAAAH,MAAMI,OAAOC,IAAI,qBAAiB,MAAAF,SAAA,SAAAA,EAAEG,SAAS,uBAAyBN,MAAMO,QAAQF,IAAI,UAAY,OAAOG,GAAAC,EAAAT,MAAMO,QAAQF,IAAI,WAAS,MAAAI,SAAA,SAAAA,EAAAC,WAAO,MAAAF,SAAA,SAAAA,EAAEG,OAAQ,CACxJ,MAAM,IAAIC,MAAM,0C,CAExB,IACKV,MAAK,WAAM,OAAAF,MAAMa,IAAIC,KA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