@salla.sa/twilight-components 2.14.172 → 2.14.174

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 (281) hide show
  1. package/dist/cjs/{app-globals-Bk9IDSPX.js → app-globals-CD_BaQp-.js} +3 -3
  2. package/dist/cjs/{app-globals-Bk9IDSPX.js.map → app-globals-CD_BaQp-.js.map} +1 -1
  3. package/dist/cjs/{index-B1jJnKON.js → index-C3GqoGli.js} +4 -4
  4. package/dist/cjs/index-C3GqoGli.js.map +1 -0
  5. package/dist/cjs/loader.cjs.js +2 -2
  6. package/dist/cjs/salla-add-product-button_49.cjs.entry.js +1 -1
  7. package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
  8. package/dist/cjs/salla-app-install-alert.cjs.entry.js +1 -1
  9. package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
  10. package/dist/cjs/salla-booking-field_2.cjs.entry.js +1 -1
  11. package/dist/cjs/salla-cart-item-offers.cjs.entry.js +1 -1
  12. package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
  13. package/dist/cjs/salla-contacts.cjs.entry.js +1 -1
  14. package/dist/cjs/salla-filters-widget.cjs.entry.js +1 -1
  15. package/dist/cjs/salla-filters.cjs.entry.js +1 -1
  16. package/dist/cjs/salla-installment.cjs.entry.js +1 -1
  17. package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
  18. package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
  19. package/dist/cjs/salla-notification-item.cjs.entry.js +1 -1
  20. package/dist/cjs/salla-notifications.cjs.entry.js +1 -1
  21. package/dist/cjs/salla-offer.cjs.entry.js +38 -2
  22. package/dist/cjs/salla-offer.cjs.entry.js.map +1 -1
  23. package/dist/cjs/salla-offer.entry.cjs.js.map +1 -1
  24. package/dist/cjs/salla-order-summary.cjs.entry.js +1 -1
  25. package/dist/cjs/salla-orders.cjs.entry.js +1 -1
  26. package/dist/cjs/salla-payments.cjs.entry.js +1 -1
  27. package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
  28. package/dist/cjs/salla-product-options.cjs.entry.js +1 -1
  29. package/dist/cjs/salla-review-card.cjs.entry.js +1 -1
  30. package/dist/cjs/salla-reviews-page.cjs.entry.js +1 -1
  31. package/dist/cjs/salla-reviews.cjs.entry.js +1 -1
  32. package/dist/cjs/salla-social.cjs.entry.js +1 -1
  33. package/dist/cjs/salla-tooltip.cjs.entry.js +1 -1
  34. package/dist/cjs/salla-verify.cjs.entry.js +1 -1
  35. package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
  36. package/dist/cjs/twilight.cjs.js +2 -2
  37. package/dist/collection/components/salla-offer/interfaces.js +1 -0
  38. package/dist/collection/components/salla-offer/interfaces.js.map +1 -1
  39. package/dist/collection/components/salla-offer/salla-offer.js +37 -1
  40. package/dist/collection/components/salla-offer/salla-offer.js.map +1 -1
  41. package/dist/components/index.js +2 -2
  42. package/dist/components/index.js.map +1 -1
  43. package/dist/components/salla-offer.js +37 -1
  44. package/dist/components/salla-offer.js.map +1 -1
  45. package/dist/esm/{app-globals-BlWInTtE.js → app-globals-BBJcPpgl.js} +3 -3
  46. package/dist/esm/{app-globals-BlWInTtE.js.map → app-globals-BBJcPpgl.js.map} +1 -1
  47. package/dist/esm/{index-CayW-agT.js → index-CX0uBHuY.js} +4 -4
  48. package/dist/esm/index-CX0uBHuY.js.map +1 -0
  49. package/dist/esm/loader.js +3 -3
  50. package/dist/esm/salla-add-product-button_49.entry.js +1 -1
  51. package/dist/esm/salla-advertisement.entry.js +1 -1
  52. package/dist/esm/salla-app-install-alert.entry.js +1 -1
  53. package/dist/esm/salla-apps-icons.entry.js +1 -1
  54. package/dist/esm/salla-booking-field_2.entry.js +1 -1
  55. package/dist/esm/salla-cart-item-offers.entry.js +1 -1
  56. package/dist/esm/salla-conditional-offer.entry.js +1 -1
  57. package/dist/esm/salla-contacts.entry.js +1 -1
  58. package/dist/esm/salla-filters-widget.entry.js +1 -1
  59. package/dist/esm/salla-filters.entry.js +1 -1
  60. package/dist/esm/salla-installment.entry.js +1 -1
  61. package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
  62. package/dist/esm/salla-metadata.entry.js +1 -1
  63. package/dist/esm/salla-notification-item.entry.js +1 -1
  64. package/dist/esm/salla-notifications.entry.js +1 -1
  65. package/dist/esm/salla-offer.entry.js +38 -2
  66. package/dist/esm/salla-offer.entry.js.map +1 -1
  67. package/dist/esm/salla-order-summary.entry.js +1 -1
  68. package/dist/esm/salla-orders.entry.js +1 -1
  69. package/dist/esm/salla-payments.entry.js +1 -1
  70. package/dist/esm/salla-price-range.entry.js +1 -1
  71. package/dist/esm/salla-product-options.entry.js +1 -1
  72. package/dist/esm/salla-review-card.entry.js +1 -1
  73. package/dist/esm/salla-reviews-page.entry.js +1 -1
  74. package/dist/esm/salla-reviews.entry.js +1 -1
  75. package/dist/esm/salla-social.entry.js +1 -1
  76. package/dist/esm/salla-tooltip.entry.js +1 -1
  77. package/dist/esm/salla-verify.entry.js +1 -1
  78. package/dist/esm/salla-wallet.entry.js +1 -1
  79. package/dist/esm/twilight.js +3 -3
  80. package/dist/esm-es5/{app-globals-BlWInTtE.js → app-globals-BBJcPpgl.js} +2 -2
  81. package/dist/esm-es5/{app-globals-BlWInTtE.js.map → app-globals-BBJcPpgl.js.map} +1 -1
  82. package/dist/esm-es5/{index-CayW-agT.js → index-CX0uBHuY.js} +3 -3
  83. package/dist/{cjs/index-B1jJnKON.js.map → esm-es5/index-CX0uBHuY.js.map} +1 -1
  84. package/dist/esm-es5/loader.js +1 -1
  85. package/dist/esm-es5/salla-add-product-button_49.entry.js +1 -1
  86. package/dist/esm-es5/salla-advertisement.entry.js +1 -1
  87. package/dist/esm-es5/salla-app-install-alert.entry.js +1 -1
  88. package/dist/esm-es5/salla-apps-icons.entry.js +1 -1
  89. package/dist/esm-es5/salla-booking-field_2.entry.js +1 -1
  90. package/dist/esm-es5/salla-cart-item-offers.entry.js +1 -1
  91. package/dist/esm-es5/salla-conditional-offer.entry.js +1 -1
  92. package/dist/esm-es5/salla-contacts.entry.js +1 -1
  93. package/dist/esm-es5/salla-filters-widget.entry.js +2 -2
  94. package/dist/esm-es5/salla-filters.entry.js +1 -1
  95. package/dist/esm-es5/salla-installment.entry.js +1 -1
  96. package/dist/esm-es5/salla-loyalty-prize-item.entry.js +1 -1
  97. package/dist/esm-es5/salla-metadata.entry.js +1 -1
  98. package/dist/esm-es5/salla-notification-item.entry.js +1 -1
  99. package/dist/esm-es5/salla-notifications.entry.js +1 -1
  100. package/dist/esm-es5/salla-offer.entry.js +1 -1
  101. package/dist/esm-es5/salla-offer.entry.js.map +1 -1
  102. package/dist/esm-es5/salla-order-summary.entry.js +1 -1
  103. package/dist/esm-es5/salla-orders.entry.js +1 -1
  104. package/dist/esm-es5/salla-payments.entry.js +1 -1
  105. package/dist/esm-es5/salla-price-range.entry.js +1 -1
  106. package/dist/esm-es5/salla-product-options.entry.js +1 -1
  107. package/dist/esm-es5/salla-review-card.entry.js +1 -1
  108. package/dist/esm-es5/salla-reviews-page.entry.js +1 -1
  109. package/dist/esm-es5/salla-reviews.entry.js +1 -1
  110. package/dist/esm-es5/salla-social.entry.js +1 -1
  111. package/dist/esm-es5/salla-tooltip.entry.js +1 -1
  112. package/dist/esm-es5/salla-verify.entry.js +1 -1
  113. package/dist/esm-es5/salla-wallet.entry.js +1 -1
  114. package/dist/esm-es5/twilight.js +1 -1
  115. package/dist/twilight/{p-41480e7b.entry.js → p-01758264.entry.js} +2 -2
  116. package/dist/twilight/{p-2a10bff2.system.entry.js → p-0e30d2ab.system.entry.js} +2 -2
  117. package/dist/twilight/{p-740b39fc.system.entry.js → p-1051476a.system.entry.js} +2 -2
  118. package/dist/twilight/p-18dbde81.entry.js +5 -0
  119. package/dist/twilight/{p-67fe618e.system.entry.js → p-239eb0b2.system.entry.js} +2 -2
  120. package/dist/twilight/{p-f5ce1227.system.entry.js → p-23a1656f.system.entry.js} +2 -2
  121. package/dist/twilight/{p-1696a245.system.entry.js → p-26be4656.system.entry.js} +2 -2
  122. package/dist/twilight/{p-d600f506.entry.js → p-2871c4ed.entry.js} +2 -2
  123. package/dist/twilight/{p-2d0c2877.entry.js → p-2f617403.entry.js} +2 -2
  124. package/dist/twilight/p-33f15762.system.entry.js +5 -0
  125. package/dist/twilight/p-33f15762.system.entry.js.map +1 -0
  126. package/dist/twilight/{p-29e96484.entry.js → p-3e4a70ae.entry.js} +2 -2
  127. package/dist/twilight/{p-db68e58b.system.entry.js → p-41d3c422.system.entry.js} +2 -2
  128. package/dist/twilight/{p-aa6a0113.entry.js → p-45bb9ebb.entry.js} +2 -2
  129. package/dist/twilight/{p-0649d076.entry.js → p-54aa62f6.entry.js} +2 -2
  130. package/dist/twilight/{p-fb9cd621.system.entry.js → p-5b225162.system.entry.js} +2 -2
  131. package/dist/twilight/{p-d56a7bd9.system.entry.js → p-60a339b2.system.entry.js} +2 -2
  132. package/dist/twilight/{p-UOO6uSKD.system.js.map → p-6Z51fW5V.system.js.map} +1 -1
  133. package/dist/twilight/{p-d2c834be.system.entry.js → p-705f4e7c.system.entry.js} +2 -2
  134. package/dist/twilight/{p-37a3c661.entry.js → p-707dc2da.entry.js} +2 -2
  135. package/dist/twilight/{p-c70ed29b.system.entry.js → p-718cf9c2.system.entry.js} +2 -2
  136. package/dist/twilight/{p-756fe45d.entry.js → p-71e5c489.entry.js} +2 -2
  137. package/dist/twilight/{p-8e242779.system.entry.js → p-74868f2f.system.entry.js} +2 -2
  138. package/dist/twilight/{p-ad02a471.system.entry.js → p-7d79f24e.system.entry.js} +2 -2
  139. package/dist/twilight/{p-e084e3c4.entry.js → p-7f649627.entry.js} +2 -2
  140. package/dist/twilight/{p-2da442c2.system.entry.js → p-85e1b079.system.entry.js} +2 -2
  141. package/dist/twilight/{p-69ec9ac8.system.entry.js → p-861e4acb.system.entry.js} +2 -2
  142. package/dist/twilight/{p-269ebd5d.entry.js → p-864db8ef.entry.js} +2 -2
  143. package/dist/twilight/{p-9361e7a2.entry.js → p-86862ab0.entry.js} +2 -2
  144. package/dist/twilight/{p-316e3ea9.entry.js → p-8de36749.entry.js} +2 -2
  145. package/dist/twilight/p-97b354fc.entry.js +5 -0
  146. package/dist/twilight/p-97b354fc.entry.js.map +1 -0
  147. package/dist/twilight/{p-DEOECcHf.system.js.map → p-B3d1A_no.system.js.map} +1 -1
  148. package/dist/twilight/{p-BuezmX1t.system.js → p-BLvmEwO6.system.js} +2 -2
  149. package/dist/twilight/{p-BuezmX1t.system.js.map → p-BLvmEwO6.system.js.map} +1 -1
  150. package/dist/twilight/{p-D4ot6EsS.system.js.map → p-BUuDJl4A.system.js.map} +1 -1
  151. package/dist/twilight/{p-Ccj3kuAD.system.js.map → p-BYmWNjXa.system.js.map} +1 -1
  152. package/dist/twilight/{p-CPIDPWPd.system.js.map → p-BYpq9P24.system.js.map} +1 -1
  153. package/dist/twilight/{p-Dg8Ywiaf.system.js.map → p-BbMtIVz6.system.js.map} +1 -1
  154. package/dist/twilight/{p-BeVJFUxX.system.js.map → p-BdwJQyF9.system.js.map} +1 -1
  155. package/dist/twilight/{p-W3JU15BC.system.js.map → p-BfTudTlU.system.js.map} +1 -1
  156. package/dist/twilight/{p-C4gOv56I.system.js.map → p-C7XOlGYs.system.js.map} +1 -1
  157. package/dist/twilight/{p-CECjqlBg.system.js.map → p-C7kuUNJ9.system.js.map} +1 -1
  158. package/dist/twilight/{p-CjXAM86c.system.js.map → p-CFQbVLkx.system.js.map} +1 -1
  159. package/dist/twilight/{p-CT7GoHDG.system.js.map → p-CM2_m-81.system.js.map} +1 -1
  160. package/dist/twilight/{p-BYBYDro2.system.js.map → p-CQiyOX1V.system.js.map} +1 -1
  161. package/dist/twilight/{p-hIDulQlu.system.js.map → p-CUzMCcle.system.js.map} +1 -1
  162. package/dist/twilight/{p-B3wutB2s.system.js.map → p-CVmHibBr.system.js.map} +1 -1
  163. package/dist/twilight/{p-CayW-agT.js → p-CX0uBHuY.js} +3 -3
  164. package/dist/twilight/p-CX0uBHuY.js.map +1 -0
  165. package/dist/twilight/{p-FxRE-bWf.system.js → p-CtSOOlDj.system.js} +2 -2
  166. package/dist/twilight/{p-FxRE-bWf.system.js.map → p-CtSOOlDj.system.js.map} +1 -1
  167. package/dist/twilight/{p-CmumtzEL.system.js → p-Cu2Id4O_.system.js} +5 -5
  168. package/dist/twilight/p-Cu2Id4O_.system.js.map +1 -0
  169. package/dist/twilight/{p-DraNKP6B.system.js.map → p-D-XXtzuS.system.js.map} +1 -1
  170. package/dist/twilight/{p-PnQHllOh.js → p-D0mJZ4Ks.js} +2 -2
  171. package/dist/twilight/{p-PnQHllOh.js.map → p-D0mJZ4Ks.js.map} +1 -1
  172. package/dist/twilight/{p-C7B9pjwv.system.js.map → p-DJYJQNBM.system.js.map} +1 -1
  173. package/dist/twilight/{p-DzJCsxNk.system.js.map → p-DWXoZRgY.system.js.map} +1 -1
  174. package/dist/twilight/p-DZNDJNsm.system.js.map +1 -0
  175. package/dist/twilight/{p-C2OoabIm.system.js.map → p-Dgv9KloL.system.js.map} +1 -1
  176. package/dist/twilight/{p-CT4XUl4u.system.js.map → p-DoDgrbUh.system.js.map} +1 -1
  177. package/dist/twilight/{p-y427D1HL.system.js.map → p-DqYY_MOh.system.js.map} +1 -1
  178. package/dist/twilight/{p-BmwlZkRw.system.js.map → p-DyVcaWJ1.system.js.map} +1 -1
  179. package/dist/twilight/{p-CCr4sv_K.system.js.map → p-F3zRr1u-.system.js.map} +1 -1
  180. package/dist/twilight/{p-CeyDIaJF.system.js.map → p-M6Ed3i_n.system.js.map} +1 -1
  181. package/dist/twilight/{p-Dmm2RXZq.system.js.map → p-Y_liGs3J.system.js.map} +1 -1
  182. package/dist/twilight/{p-54bd7e18.system.entry.js → p-a040ce17.system.entry.js} +2 -2
  183. package/dist/twilight/{p-b63bc4db.entry.js → p-a3c65a59.entry.js} +2 -2
  184. package/dist/twilight/{p-9ca8c6b6.entry.js → p-a48d4e48.entry.js} +2 -2
  185. package/dist/twilight/{p-611b6013.system.entry.js → p-a6704180.system.entry.js} +2 -2
  186. package/dist/twilight/{p-679bb855.system.entry.js → p-a7cd65cc.system.entry.js} +2 -2
  187. package/dist/twilight/{p-e061a1f5.system.entry.js → p-ad901f4c.system.entry.js} +2 -2
  188. package/dist/twilight/{p-41ecc4f7.entry.js → p-afa167be.entry.js} +2 -2
  189. package/dist/twilight/{p-20bdcd53.entry.js → p-afc6a140.entry.js} +2 -2
  190. package/dist/twilight/{p-1dd178a2.entry.js → p-b1590e9b.entry.js} +2 -2
  191. package/dist/twilight/{p-19f533ec.entry.js → p-b29d7c75.entry.js} +2 -2
  192. package/dist/twilight/{p-9d750b3d.system.entry.js → p-c228b2aa.system.entry.js} +2 -2
  193. package/dist/twilight/{p-8c9ae8bd.entry.js → p-c36b58cf.entry.js} +2 -2
  194. package/dist/twilight/{p-3093ea8e.system.entry.js → p-c6f235c7.system.entry.js} +2 -2
  195. package/dist/twilight/{p-cdc147d2.system.entry.js → p-c7a36a2f.system.entry.js} +2 -2
  196. package/dist/twilight/{p-fdd3788a.entry.js → p-c991e7a9.entry.js} +2 -2
  197. package/dist/twilight/{p-a78387e7.system.entry.js → p-cbf5d10b.system.entry.js} +2 -2
  198. package/dist/twilight/{p-51195e76.entry.js → p-d1169fdb.entry.js} +2 -2
  199. package/dist/twilight/{p-b72f268b.entry.js → p-d2fd1396.entry.js} +2 -2
  200. package/dist/twilight/{p-e9ca7e7c.entry.js → p-d4d9b899.entry.js} +2 -2
  201. package/dist/twilight/{p-86dd7e02.system.entry.js → p-d5c8db3c.system.entry.js} +2 -2
  202. package/dist/twilight/{p-33963e7d.entry.js → p-d7dc410a.entry.js} +2 -2
  203. package/dist/twilight/{p-7ddf00a9.system.entry.js → p-e250a54f.system.entry.js} +2 -2
  204. package/dist/twilight/{p-d14e40fe.system.entry.js → p-ec4917ea.system.entry.js} +2 -2
  205. package/dist/twilight/{p-247636ef.entry.js → p-ee3d9cfa.entry.js} +2 -2
  206. package/dist/twilight/{p-ee97bc7b.system.entry.js → p-ee99372c.system.entry.js} +2 -2
  207. package/dist/twilight/{p-44a213de.system.entry.js → p-f7509c22.system.entry.js} +2 -2
  208. package/dist/twilight/{p-952a8078.entry.js → p-fdd7c18c.entry.js} +2 -2
  209. package/dist/twilight/{p-Bxsqm2ye.system.js.map → p-yDI_0zwM.system.js.map} +1 -1
  210. package/dist/twilight/{p-BuxFmGAL.system.js.map → p-zeGtPtUH.system.js.map} +1 -1
  211. package/dist/twilight/{p-DUKloBXK.system.js.map → p-zsSwLdpB.system.js.map} +1 -1
  212. package/dist/twilight/salla-offer.entry.esm.js.map +1 -1
  213. package/dist/twilight/twilight.esm.js +1 -1
  214. package/dist/twilight/twilight.js +1 -1
  215. package/dist/types/components/salla-offer/interfaces.d.ts +13 -2
  216. package/dist/types/components/salla-offer/salla-offer.d.ts +1 -0
  217. package/package.json +5 -5
  218. package/dist/esm/index-CayW-agT.js.map +0 -1
  219. package/dist/esm-es5/index-CayW-agT.js.map +0 -1
  220. package/dist/twilight/p-4ced9aab.entry.js +0 -5
  221. package/dist/twilight/p-4fb112e6.system.entry.js +0 -5
  222. package/dist/twilight/p-4fb112e6.system.entry.js.map +0 -1
  223. package/dist/twilight/p-CayW-agT.js.map +0 -1
  224. package/dist/twilight/p-CmumtzEL.system.js.map +0 -1
  225. package/dist/twilight/p-d0912efd.entry.js +0 -5
  226. package/dist/twilight/p-d0912efd.entry.js.map +0 -1
  227. package/dist/twilight/p-qziIzWVk.system.js.map +0 -1
  228. /package/dist/twilight/{p-41480e7b.entry.js.map → p-01758264.entry.js.map} +0 -0
  229. /package/dist/twilight/{p-2a10bff2.system.entry.js.map → p-0e30d2ab.system.entry.js.map} +0 -0
  230. /package/dist/twilight/{p-740b39fc.system.entry.js.map → p-1051476a.system.entry.js.map} +0 -0
  231. /package/dist/twilight/{p-4ced9aab.entry.js.map → p-18dbde81.entry.js.map} +0 -0
  232. /package/dist/twilight/{p-67fe618e.system.entry.js.map → p-239eb0b2.system.entry.js.map} +0 -0
  233. /package/dist/twilight/{p-f5ce1227.system.entry.js.map → p-23a1656f.system.entry.js.map} +0 -0
  234. /package/dist/twilight/{p-1696a245.system.entry.js.map → p-26be4656.system.entry.js.map} +0 -0
  235. /package/dist/twilight/{p-d600f506.entry.js.map → p-2871c4ed.entry.js.map} +0 -0
  236. /package/dist/twilight/{p-2d0c2877.entry.js.map → p-2f617403.entry.js.map} +0 -0
  237. /package/dist/twilight/{p-29e96484.entry.js.map → p-3e4a70ae.entry.js.map} +0 -0
  238. /package/dist/twilight/{p-db68e58b.system.entry.js.map → p-41d3c422.system.entry.js.map} +0 -0
  239. /package/dist/twilight/{p-aa6a0113.entry.js.map → p-45bb9ebb.entry.js.map} +0 -0
  240. /package/dist/twilight/{p-0649d076.entry.js.map → p-54aa62f6.entry.js.map} +0 -0
  241. /package/dist/twilight/{p-fb9cd621.system.entry.js.map → p-5b225162.system.entry.js.map} +0 -0
  242. /package/dist/twilight/{p-d56a7bd9.system.entry.js.map → p-60a339b2.system.entry.js.map} +0 -0
  243. /package/dist/twilight/{p-d2c834be.system.entry.js.map → p-705f4e7c.system.entry.js.map} +0 -0
  244. /package/dist/twilight/{p-37a3c661.entry.js.map → p-707dc2da.entry.js.map} +0 -0
  245. /package/dist/twilight/{p-c70ed29b.system.entry.js.map → p-718cf9c2.system.entry.js.map} +0 -0
  246. /package/dist/twilight/{p-756fe45d.entry.js.map → p-71e5c489.entry.js.map} +0 -0
  247. /package/dist/twilight/{p-8e242779.system.entry.js.map → p-74868f2f.system.entry.js.map} +0 -0
  248. /package/dist/twilight/{p-ad02a471.system.entry.js.map → p-7d79f24e.system.entry.js.map} +0 -0
  249. /package/dist/twilight/{p-e084e3c4.entry.js.map → p-7f649627.entry.js.map} +0 -0
  250. /package/dist/twilight/{p-2da442c2.system.entry.js.map → p-85e1b079.system.entry.js.map} +0 -0
  251. /package/dist/twilight/{p-69ec9ac8.system.entry.js.map → p-861e4acb.system.entry.js.map} +0 -0
  252. /package/dist/twilight/{p-269ebd5d.entry.js.map → p-864db8ef.entry.js.map} +0 -0
  253. /package/dist/twilight/{p-9361e7a2.entry.js.map → p-86862ab0.entry.js.map} +0 -0
  254. /package/dist/twilight/{p-316e3ea9.entry.js.map → p-8de36749.entry.js.map} +0 -0
  255. /package/dist/twilight/{p-54bd7e18.system.entry.js.map → p-a040ce17.system.entry.js.map} +0 -0
  256. /package/dist/twilight/{p-b63bc4db.entry.js.map → p-a3c65a59.entry.js.map} +0 -0
  257. /package/dist/twilight/{p-9ca8c6b6.entry.js.map → p-a48d4e48.entry.js.map} +0 -0
  258. /package/dist/twilight/{p-611b6013.system.entry.js.map → p-a6704180.system.entry.js.map} +0 -0
  259. /package/dist/twilight/{p-679bb855.system.entry.js.map → p-a7cd65cc.system.entry.js.map} +0 -0
  260. /package/dist/twilight/{p-e061a1f5.system.entry.js.map → p-ad901f4c.system.entry.js.map} +0 -0
  261. /package/dist/twilight/{p-41ecc4f7.entry.js.map → p-afa167be.entry.js.map} +0 -0
  262. /package/dist/twilight/{p-20bdcd53.entry.js.map → p-afc6a140.entry.js.map} +0 -0
  263. /package/dist/twilight/{p-1dd178a2.entry.js.map → p-b1590e9b.entry.js.map} +0 -0
  264. /package/dist/twilight/{p-19f533ec.entry.js.map → p-b29d7c75.entry.js.map} +0 -0
  265. /package/dist/twilight/{p-9d750b3d.system.entry.js.map → p-c228b2aa.system.entry.js.map} +0 -0
  266. /package/dist/twilight/{p-8c9ae8bd.entry.js.map → p-c36b58cf.entry.js.map} +0 -0
  267. /package/dist/twilight/{p-3093ea8e.system.entry.js.map → p-c6f235c7.system.entry.js.map} +0 -0
  268. /package/dist/twilight/{p-cdc147d2.system.entry.js.map → p-c7a36a2f.system.entry.js.map} +0 -0
  269. /package/dist/twilight/{p-fdd3788a.entry.js.map → p-c991e7a9.entry.js.map} +0 -0
  270. /package/dist/twilight/{p-a78387e7.system.entry.js.map → p-cbf5d10b.system.entry.js.map} +0 -0
  271. /package/dist/twilight/{p-51195e76.entry.js.map → p-d1169fdb.entry.js.map} +0 -0
  272. /package/dist/twilight/{p-b72f268b.entry.js.map → p-d2fd1396.entry.js.map} +0 -0
  273. /package/dist/twilight/{p-e9ca7e7c.entry.js.map → p-d4d9b899.entry.js.map} +0 -0
  274. /package/dist/twilight/{p-86dd7e02.system.entry.js.map → p-d5c8db3c.system.entry.js.map} +0 -0
  275. /package/dist/twilight/{p-33963e7d.entry.js.map → p-d7dc410a.entry.js.map} +0 -0
  276. /package/dist/twilight/{p-7ddf00a9.system.entry.js.map → p-e250a54f.system.entry.js.map} +0 -0
  277. /package/dist/twilight/{p-d14e40fe.system.entry.js.map → p-ec4917ea.system.entry.js.map} +0 -0
  278. /package/dist/twilight/{p-247636ef.entry.js.map → p-ee3d9cfa.entry.js.map} +0 -0
  279. /package/dist/twilight/{p-ee97bc7b.system.entry.js.map → p-ee99372c.system.entry.js.map} +0 -0
  280. /package/dist/twilight/{p-44a213de.system.entry.js.map → p-f7509c22.system.entry.js.map} +0 -0
  281. /package/dist/twilight/{p-952a8078.entry.js.map → p-fdd7c18c.entry.js.map} +0 -0
@@ -3,7 +3,7 @@
3
3
  */
4
4
  'use strict';
5
5
 
6
- var index = require('./index-B1jJnKON.js');
6
+ var index = require('./index-C3GqoGli.js');
7
7
 
8
8
  const sallaPaymentsCss = ":host{display:block}";
9
9
 
@@ -3,7 +3,7 @@
3
3
  */
4
4
  'use strict';
5
5
 
6
- var index = require('./index-B1jJnKON.js');
6
+ var index = require('./index-C3GqoGli.js');
7
7
  var arrowLeft = require('./arrow-left-xSEmRpp6.js');
8
8
 
9
9
  var arrowRight = `<!-- Generated by IcoMoon.io -->
@@ -3,7 +3,7 @@
3
3
  */
4
4
  'use strict';
5
5
 
6
- var index = require('./index-B1jJnKON.js');
6
+ var index = require('./index-C3GqoGli.js');
7
7
  var check = require('./check-CLRvuniI.js');
8
8
  var camera = require('./camera-DytepEoK.js');
9
9
 
@@ -3,7 +3,7 @@
3
3
  */
4
4
  'use strict';
5
5
 
6
- var index = require('./index-B1jJnKON.js');
6
+ var index = require('./index-C3GqoGli.js');
7
7
  var check = require('./check-CLRvuniI.js');
8
8
 
9
9
  var IconStar2 = ` <svg width="18" height="17" view-box="0 0 18 17" fill="none" xmlns="http://www.w3.org/2000/svg">
@@ -3,7 +3,7 @@
3
3
  */
4
4
  'use strict';
5
5
 
6
- var index = require('./index-B1jJnKON.js');
6
+ var index = require('./index-C3GqoGli.js');
7
7
  var shoppingBag = require('./shopping-bag-C1gvTVHr.js');
8
8
  var Helper = require('./Helper-RxjfQWAX.js');
9
9
  require('./anime.es-BqW8JHZi.js');
@@ -3,7 +3,7 @@
3
3
  */
4
4
  'use strict';
5
5
 
6
- var index = require('./index-B1jJnKON.js');
6
+ var index = require('./index-C3GqoGli.js');
7
7
  var arrowLeft = require('./arrow-left-xSEmRpp6.js');
8
8
  var Helper = require('./Helper-RxjfQWAX.js');
9
9
  require('./anime.es-BqW8JHZi.js');
@@ -3,7 +3,7 @@
3
3
  */
4
4
  'use strict';
5
5
 
6
- var index = require('./index-B1jJnKON.js');
6
+ var index = require('./index-C3GqoGli.js');
7
7
  var twitter = require('./twitter-pOrUNjXi.js');
8
8
 
9
9
  var instagram = `<!-- Generated by IcoMoon.io -->
@@ -3,7 +3,7 @@
3
3
  */
4
4
  'use strict';
5
5
 
6
- var index = require('./index-B1jJnKON.js');
6
+ var index = require('./index-C3GqoGli.js');
7
7
 
8
8
  const sallaTooltipCss = ".s-tooltip-container{position:relative;display:inline-block}.s-tooltip-item{position:absolute;-webkit-transform:translateX(-39%);transform:translateX(-39%);background-color:#baf3e6;color:#004d5a;bottom:100%;left:50%;text-align:center;border-radius:5px;z-index:1;white-space:nowrap;opacity:0;-webkit-transition:opacity 0.3s;transition:opacity 0.3s;pointer-events:none;margin:0 0 16px 8px;padding:12px;max-width:150px;width:190px;white-space:normal;opacity:1}.s-tooltip-item::after{content:\"\";position:absolute;bottom:-10px;left:50%;margin-left:-5px;border-width:5px;border-style:solid;border-color:#baf3e6 transparent transparent transparent}.s-tooltip-item:dir(ltr){-webkit-transform:translateX(-72%);transform:translateX(-72%)}";
9
9
 
@@ -3,7 +3,7 @@
3
3
  */
4
4
  'use strict';
5
5
 
6
- var index = require('./index-B1jJnKON.js');
6
+ var index = require('./index-C3GqoGli.js');
7
7
  var mail = require('./mail-CO8cFZH7.js');
8
8
 
9
9
  var AndroidPhoneIcon = `<!-- Generated by IcoMoon.io -->
@@ -3,7 +3,7 @@
3
3
  */
4
4
  'use strict';
5
5
 
6
- var index = require('./index-B1jJnKON.js');
6
+ var index = require('./index-C3GqoGli.js');
7
7
 
8
8
  const sallaWalletCss = ".s-wallet-table{min-width:100%}.s-wallet-table-balance-container{display:-ms-flexbox !important;display:flex !important;-ms-flex-align:center !important;align-items:center !important;-ms-flex-pack:start !important;justify-content:flex-start !important;gap:1rem}.s-wallet-table-balance-icon{border-radius:50%;width:52px;height:52px;font-size:25px;padding:16px 13px;background:var(--color-primary-reverse);color:var(--color-primary)}.s-wallet-table-empty-state{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center}.s-wallet-table-empty-state i{font-size:80px;margin:4rem 0 2rem;color:var(--infinte-color)}.s-wallet-table-transaction-status{padding:6px 19px !important;border-radius:20px;width:-webkit-max-content;width:-moz-max-content;width:max-content;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.s-wallet-table-transaction-status-default{background:#fff6eb;color:#a46f29}.s-wallet-table-transaction-status-cashback{background:#effbf6;color:#00af6c}.s-wallet-table-transaction-status-refund{background:#ecf3fe;color:#5196f3}.s-wallet-table-transaction-status-purchase{background:#feecec;color:#f55157}.s-wallet-table-transaction-status-icons-success{color:#00af6c}";
9
9
 
@@ -3,8 +3,8 @@
3
3
  */
4
4
  'use strict';
5
5
 
6
- var index = require('./index-B1jJnKON.js');
7
- var appGlobals = require('./app-globals-Bk9IDSPX.js');
6
+ var index = require('./index-C3GqoGli.js');
7
+ var appGlobals = require('./app-globals-CD_BaQp-.js');
8
8
 
9
9
  var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
10
10
  /*
@@ -13,5 +13,6 @@ export var OfferType;
13
13
  OfferType["DiscountsTable"] = "discounts_table";
14
14
  OfferType["Bank"] = "bank";
15
15
  OfferType["BuyXGetY"] = "buy_x_get_y";
16
+ OfferType["SpecialPrice"] = "special_price";
16
17
  })(OfferType || (OfferType = {}));
17
18
  //# sourceMappingURL=interfaces.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/components/salla-offer/interfaces.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,QAGX;AAHD,WAAY,QAAQ;IAClB,4CAAgC,CAAA;IAChC,yBAAa,CAAA;AACf,CAAC,EAHW,QAAQ,KAAR,QAAQ,QAGnB;AAED,MAAM,CAAN,IAAY,SAMX;AAND,WAAY,SAAS;IACnB,wCAA2B,CAAA;IAC3B,wCAA2B,CAAA;IAC3B,+CAAkC,CAAA;IAClC,0BAAa,CAAA;IACb,qCAAwB,CAAA;AAC1B,CAAC,EANW,SAAS,KAAT,SAAS,QAMpB","sourcesContent":["export enum PageType {\n ProductDetail = \"product.single\",\n Cart = \"cart\"\n}\n\nexport enum OfferType {\n Conditional = \"conditional\",\n PercentageOrFixed = \"fixed\",\n DiscountsTable = \"discounts_table\",\n Bank = \"bank\",\n BuyXGetY = \"buy_x_get_y\"\n}\n\n\nexport interface DiscountDetailFixed {\n discount_type: \"fixed\";\n min_spend: number;\n discount_value: number;\n}\n\nexport interface DiscountDetailFreeProduct {\n discount_type: \"free_product\";\n min_spend: number;\n discount_value: number;\n}\n\nexport interface DiscountDetailConditional extends Array<DiscountDetailFixed | DiscountDetailFreeProduct> {}\n\nexport interface DiscountDetailPercentageFixed {\n apply_to: \"all\" | \"products\" | \"categories\" | \"payment_methods\";\n targets: Array<string | number>;\n ends_at: number;\n min_spend: number;\n discount_value: number;\n}\n\nexport interface Discount {\n discounted_amount: any;\n quantity: number;\n percentage: number;\n}\n\nexport interface DiscountDetailTable {\n apply_to: \"all\" | \"products\" | \"categories\" | \"payment_methods\" | \"order\";\n discount_value: number;\n ends_at: string;\n min_items: number;\n min_spend: number;\n show_price_after_discount: boolean;\n discounts: Discount[];\n}\n\nexport interface BankOffer {\n logo: string;\n discount_value: number;\n discount_type: string;\n minimum_spend: number;\n payments: string[];\n}\n\nexport interface BuyXGetYDetail {\n ends_at: number;\n buy: {\n source: \"product\" | \"category\";\n source_value: number[];\n quantity: number;\n };\n get: {\n source: \"products\" | \"category\";\n source_value: number[];\n type: \"free_product\" | \"percentage\" | \"fixed\";\n value: number;\n products?: Product[];//we will set this dynamically\n categories?: Category[];//we will set this dynamically\n };\n}\n\nexport interface Offer {\n id: number;\n title: string;\n description: string;\n type: OfferType | \"conditional\" | \"fixed\" | \"discounts_table\" | \"bank\" | \"buy_x_get_y\";\n details: DiscountDetailConditional | DiscountDetailPercentageFixed | DiscountDetailTable | BankOffer | BuyXGetYDetail;\n}\n\nexport interface Product {\n id: number;\n type: string;\n status: string;\n is_available: boolean;\n sku: string;\n name: string;\n price: { amount: number; currency: string; };\n promotion: { title: string; sub_title: string; };\n sale_price: { amount: number; currency: string; };\n regular_price: { amount: number; currency: string; };\n currency: string;\n url: string;\n thumbnail: string;\n has_special_price: boolean;\n favorite?: any;\n}\n\nexport interface Category {\n id?: string;\n id_?: number;\n name?: string;\n url?: string;\n icon?: string;\n sub_categories?: Category[];\n items?: any[] | null;\n}\n\nexport interface Currency {\n code: string | 'SAR';\n name: string;\n symbol: string;\n amount?: number;\n country_code?: string;\n}\n"]}
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/components/salla-offer/interfaces.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,QAGX;AAHD,WAAY,QAAQ;IAClB,4CAAgC,CAAA;IAChC,yBAAa,CAAA;AACf,CAAC,EAHW,QAAQ,KAAR,QAAQ,QAGnB;AAED,MAAM,CAAN,IAAY,SAOX;AAPD,WAAY,SAAS;IACnB,wCAA2B,CAAA;IAC3B,wCAA2B,CAAA;IAC3B,+CAAkC,CAAA;IAClC,0BAAa,CAAA;IACb,qCAAwB,CAAA;IACxB,2CAA8B,CAAA;AAChC,CAAC,EAPW,SAAS,KAAT,SAAS,QAOpB","sourcesContent":["export enum PageType {\n ProductDetail = \"product.single\",\n Cart = \"cart\"\n}\n\nexport enum OfferType {\n Conditional = \"conditional\",\n PercentageOrFixed = \"fixed\",\n DiscountsTable = \"discounts_table\",\n Bank = \"bank\",\n BuyXGetY = \"buy_x_get_y\",\n SpecialPrice = \"special_price\",\n}\n\n\nexport interface DiscountDetailFixed {\n discount_type: \"fixed\";\n min_spend: number;\n discount_value: number;\n}\n\nexport interface DiscountDetailFreeProduct {\n discount_type: \"free_product\";\n min_spend: number;\n discount_value: number;\n}\n\nexport interface DiscountDetailConditional extends Array<DiscountDetailFixed | DiscountDetailFreeProduct> {}\n\nexport interface DiscountDetailPercentageFixed {\n apply_to: \"all\" | \"products\" | \"categories\" | \"payment_methods\";\n targets: Array<string | number>;\n ends_at: number;\n min_spend: number;\n discount_value: number;\n}\n\nexport interface Discount {\n discounted_amount: any;\n quantity: number;\n percentage: number;\n}\n\nexport interface DiscountDetailTable {\n apply_to: \"all\" | \"products\" | \"categories\" | \"payment_methods\" | \"order\";\n discount_value: number;\n ends_at: string;\n min_items: number;\n min_spend: number;\n show_price_after_discount: boolean;\n discounts: Discount[];\n}\n\nexport interface BankOffer {\n logo: string;\n discount_value: number;\n discount_type: string;\n minimum_spend: number;\n payments: string[];\n}\n\nexport interface SpecialPriceDetail {\n apply_to: \"product\" | \"category\";\n discount_value: number;\n ends_at: number;\n min_items: number; \n min_spend: number;\n targets: Array<string | number>;\n products?: Product[];//we will set this dynamically\n categories?: Category[];//we will set this dynamically\n\n}\n\nexport interface BuyXGetYDetail {\n ends_at: number;\n buy: {\n source: \"product\" | \"category\";\n source_value: number[];\n quantity: number;\n };\n get: {\n source: \"products\" | \"category\";\n source_value: number[];\n type: \"free_product\" | \"percentage\" | \"fixed\";\n value: number;\n products?: Product[];//we will set this dynamically\n categories?: Category[];//we will set this dynamically\n };\n}\n\nexport interface Offer {\n id: number;\n title: string;\n description: string;\n type: OfferType | \"conditional\" | \"fixed\" | \"discounts_table\" | \"bank\" | \"buy_x_get_y\";\n details: DiscountDetailConditional | DiscountDetailPercentageFixed | DiscountDetailTable | BankOffer | BuyXGetYDetail | SpecialPriceDetail;\n}\n\nexport interface Product {\n id: number;\n type: string;\n status: string;\n is_available: boolean;\n sku: string;\n name: string;\n price: { amount: number; currency: string; };\n promotion: { title: string; sub_title: string; };\n sale_price: { amount: number; currency: string; };\n regular_price: { amount: number; currency: string; };\n currency: string;\n url: string;\n thumbnail: string;\n has_special_price: boolean;\n favorite?: any;\n}\n\nexport interface Category {\n id?: string;\n id_?: number;\n name?: string;\n url?: string;\n icon?: string;\n sub_categories?: Category[];\n items?: any[] | null;\n}\n\nexport interface Currency {\n code: string | 'SAR';\n name: string;\n symbol: string;\n amount?: number;\n country_code?: string;\n}\n"]}
@@ -87,7 +87,7 @@ export class SallaOffer {
87
87
  throw new Error('salla-offers:: There is no offers!');
88
88
  }
89
89
  //we support these offers only
90
- const offer = this.offersList.find(offer => [OfferType.Bank, OfferType.BuyXGetY, OfferType.DiscountsTable].includes(offer.type));
90
+ const offer = this.offersList.find(offer => [OfferType.SpecialPrice, OfferType.Bank, OfferType.BuyXGetY, OfferType.DiscountsTable].includes(offer.type));
91
91
  if (!offer) {
92
92
  throw new Error('salla-offers:: Offer type not supported yet!');
93
93
  }
@@ -101,6 +101,23 @@ export class SallaOffer {
101
101
  this.isMultipleBank = this.offersList.length > 1;
102
102
  return this.offersList;
103
103
  }
104
+ //if it's special price offer
105
+ if (offer.type === OfferType.SpecialPrice) {
106
+ const details = offer.details;
107
+ return details.apply_to === 'product'
108
+ // Avoid additional requests; use `salla-products-slider` and pass the custom card
109
+ ? salla.product.api.fetch({ source: "selected", source_value: details.targets })
110
+ .then((response) => {
111
+ offer.details.products = response.data; // Set the fetched products
112
+ return this.offersList = [offer];
113
+ })
114
+ : salla.product.api.categories() // Fetch all categories in one query
115
+ .then((res) => {
116
+ const categoriesToRender = this.findCategories(res.data, details.targets); // Extract only the selected categories
117
+ offer.details.categories = categoriesToRender;
118
+ return this.offersList = [offer];
119
+ });
120
+ }
104
121
  //BuyXGetY offers
105
122
  const getY = offer.details.get;
106
123
  return getY.source === 'products'
@@ -119,6 +136,7 @@ export class SallaOffer {
119
136
  });
120
137
  })
121
138
  .then((offers) => {
139
+ ;
122
140
  salla.storage.set(this.getStorageKey(), { offers, stored_at: new Date().getTime() });
123
141
  this.canRender = true;
124
142
  })
@@ -171,6 +189,7 @@ export class SallaOffer {
171
189
  return Promise.resolve(storageOffers.offers);
172
190
  }
173
191
  render() {
192
+ // Check if the offers list is empty or if the component is not ready to render
174
193
  if (!this.offersList.length || !this.canRender || !this.showOffer)
175
194
  return null;
176
195
  const offer = this.offersList[0];
@@ -187,6 +206,9 @@ export class SallaOffer {
187
206
  if (this.isBankOffer) {
188
207
  return this.renderBankSection();
189
208
  }
209
+ if (offerType == OfferType.SpecialPrice) {
210
+ return this.renderSpecialPriceSection();
211
+ }
190
212
  if (offerType == OfferType.BuyXGetY) {
191
213
  return this.renderBuyXGetYSection();
192
214
  }
@@ -251,6 +273,20 @@ export class SallaOffer {
251
273
  return (_a = this.offersList[0].details.discounts) === null || _a === void 0 ? void 0 : _a.map((discount) => h("div", { class: "s-offer-slide-one-fourth" }, h("div", { class: "s-offer-slide-offer-entry" }, h("div", { class: "s-offer-slide-offer-entry-price-quantity-container" }, h("p", { class: "s-offer-slide-offer-entry-quantity" }, this.buy_quantity_text(discount.quantity)), show_discounted_price ?
252
274
  h("div", { class: "s-offer-slide-offer-entry-price" }, h("span", null, this.offer_with_price_text), h("span", { class: "s-offer-slide-offer-entry-price-amount" }, discount.discounted_amount), " ", h("span", null, this.userCurrency)) : ""), h("p", { class: "s-offer-slide-offer-entry-price-amount-percent" }, this.with_discount_text, "(", h("span", null, discount.percentage, !!discount.percentage && '%'), ")"))));
253
275
  }
276
+ renderSpecialPriceSection() {
277
+ var _a, _b;
278
+ const details = this.offersList[0].details;
279
+ return [
280
+ // Render products if `apply_to` is "product"
281
+ details.apply_to === "product" &&
282
+ ((_a = details.products) === null || _a === void 0 ? void 0 : _a.map((product) => (h("div", { class: "s-offer-slide-one-fourth" }, this.hasCustomComponent
283
+ ? h(this.productCardComponent, { product: product })
284
+ : h("salla-product-card", { "shadow-on-hover": true, product: product }))))),
285
+ // Render categories if `apply_to` is "category"
286
+ details.apply_to === "category" &&
287
+ ((_b = details.categories) === null || _b === void 0 ? void 0 : _b.map((category) => this.getCategoriesSection(category))),
288
+ ];
289
+ }
254
290
  static get is() { return "salla-offer"; }
255
291
  static get originalStyleUrls() {
256
292
  return {
@@ -1 +1 @@
1
- {"version":3,"file":"salla-offer.js","sourceRoot":"","sources":["../../../src/components/salla-offer/salla-offer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AACnE,OAAO,EAAgE,QAAQ,EAAE,SAAS,EAAkC,MAAM,cAAc,CAAC;AAGjJ;;;;;;;;;;GAUG;AAKH,MAAM,OAAO,UAAU;IAErB;;QAoBA;;;;;;;;WAQG;QACK,yBAAoB,GAAW,2BAA2B,CAAC;QAEnE,oCAAoC;QAC3B,eAAU,GAAY,EAAE,CAAC;QAEzB,mBAAc,GAAY,KAAK,CAAC;QAKhC,gBAAW,GAAY,KAAK,CAAC;QAC7B,cAAS,GAAY,KAAK,CAAC;QAC3B,cAAS,GAAY,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,4CAA4C,CAAC,CAAC;QAE7F,2BAA2B;QAClB,0BAAqB,GAAW,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,wBAAwB,EAAE,EAAE,KAAK,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AO,IAAI,CAAC,OAAO,CAAC,IAAI,MAAM,CAAC,GAAG,KAAK,IAAI,CAAC,EAAE,6CAA6C,KAAK,WAAW,CAAC,CAAA;IAC9G,CAAC;IAED;;;;;OAKG;IACK,0BAA0B;;QAChC,MAAM,KAAK,GAAU,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;QACxC,IAAI,qBAAqB,GAAI,KAAK,CAAC,OAA+B,CAAC,yBAAyB,CAAC;QAC7F,OAAO,MAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,OAA+B,CAAC,SAAS,0CAAE,GAAG,CAAC,CAAC,QAAkB,EAAE,EAAE,CAAC,WAAK,KAAK,EAAC,0BAA0B;YACrI,WAAK,KAAK,EAAC,2BAA2B;gBACpC,WAAK,KAAK,EAAC,oDAAoD;oBAC7D,SAAG,KAAK,EAAC,oCAAoC,IAAE,IAAI,CAAC,iBAAiB,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAK;oBAC5F,qBAAqB,CAAC,CAAC;wBACtB,WAAK,KAAK,EAAC,iCAAiC;4BAC1C,gBAAO,IAAI,CAAC,qBAAqB,CAAQ;4BACzC,YAAM,KAAK,EAAC,wCAAwC,IAAE,QAAQ,CAAC,iBAAiB,CAAQ;;4BAAC,gBAAO,IAAI,CAAC,YAAY,CAAQ,CACrH,CAAC,CAAC,CAAC,EAAE,CACT;gBACN,SAAG,KAAK,EAAC,gDAAgD;oBAAE,IAAI,CAAC,kBAAkB;;oBAC/E;wBAAO,QAAQ,CAAC,UAAU;wBAAE,CAAC,CAAC,QAAQ,CAAC,UAAU,IAAI,GAAG,CAAQ;wBAAK,CACpE,CACF,CACL,CAAA;IACH,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAEF","sourcesContent":["import { Component, Element, Prop, State, h } from '@stencil/core';\nimport { Offer, Category, Product, Discount, Currency, BuyXGetYDetail, PageType, OfferType, BankOffer, DiscountDetailTable } from './interfaces';\n\n\n/**\n * `salla-offer` is a StencilJS component that displays offers, categories, products, banks, and discount information.\n * It uses the `salla-slider` component for carousel functionality.\n *\n * @slot category - The slot for customizing the category entry layout.\n * \n * @csspart custom - Custom CSS part to target specific elements in the component.\n *\n * @example\n * <salla-offer product-id=\"123\"></salla-offer>\n */\n@Component({\n tag: 'salla-offer',\n styleUrl: 'salla-offer.scss',\n})\nexport class SallaOffer {\n\n constructor() {\n // Language\n salla.lang.onLoaded(() => {\n this.offer_with_price_text = salla.lang.get('pages.offer.with_price');\n this.with_discount_text = salla.lang.get('pages.products.with_a_discount');\n this.product_discount_text = salla.lang.get('pages.products.discount');\n this.special_offer_text = salla.lang.get('pages.products.special_offer');\n this.multipleBankOfferTitleText = salla.lang.get('pages.offer.multiple_bank_offers_title');\n this.multipleBankOfferTitleDescription = salla.lang.get('pages.offer.multiple_bank_offers_message');\n this.buy_quantity_text(0);\n })\n\n salla.onReady(() => {\n this.currentPage = salla.config.get('page.slug')\n this.userCurrency = salla.config.get('currencies')[salla.config.get('user.currency_code')].symbol\n });\n\n this.categorySlot = this.host.querySelector('[slot=\"category\"]')?.innerHTML || '<a href={url} class=\"s-offer-slide-cat-entry\"><i class={icon}></i><h4>{name}</h4></a>';\n }\n\n /**\n * Custom Card Component for the Salla Products List.\n *\n * This component allows you to customize the appearance of individual product cards within a Salla Products List.\n *\n * @example\n * <salla-products-list product-card-component=\"my-custom-card-style1\" ...\n * <salla-products-list product-card-component=\"my-custom-card-style2\" ...\n */\n @Prop() productCardComponent: string = 'custom-salla-product-card';\n\n // Declare component state variables\n @State() offersList: Offer[] = [];\n @State() userCurrency: Currency;\n @State() isMultipleBank: boolean = false;\n @State() title?: string;\n @State() currentPage: string;\n @State() hasCustomComponent: boolean;\n\n @State() isBankOffer: boolean = false;\n @State() canRender: boolean = false;\n @State() showOffer: boolean = salla.config.get('store.settings.product.show_special_offers');\n\n // Default translated texts\n @State() offer_with_price_text: string = salla.lang.get('pages.offer.with_price', { price: '' });\n @State() with_discount_text: string = salla.lang.get('pages.products.with_a_discount')\n @State() product_discount_text: string = salla.lang.get('pages.products.discount')\n @State() special_offer_text: string = salla.lang.get('pages.products.special_offer')\n @State() multipleBankOfferTitleText: string = salla.lang.get('pages.offer.multiple_bank_offers_title')\n @State() multipleBankOfferTitleDescription: string = salla.lang.get('pages.offer.multiple_bank_offers_message')\n @State() buy_quantity_text: (quantity: number) => string = (quantity) => salla.lang.get('pages.offer.buy_quantity', { quantity })\n\n // Reference to the host element\n @Element() host: HTMLElement;\n\n private categorySlot: string;\n\n private async getEndpointByPageName(): Promise<string> {\n if (this.currentPage == PageType.Cart) {\n const cartId = await Salla.cart.getCurrentCartId();\n return `offers/cart/${cartId}`;\n }\n\n if (this.currentPage == PageType.ProductDetail) {\n return `offers/product/${salla.config.get('page.id')}`;\n }\n\n return \"offers\";\n }\n\n componentWillLoad() {\n this.hasCustomComponent = !!customElements.get(this.productCardComponent);\n // let offers = this.getOffersFromStorage();\n // if (offers) {\n // return offers.then(offersFromStorage => this.offersList = offersFromStorage);\n // }\n\n return (new Promise(resolve => salla.onReady(resolve)))\n .then(() => {\n this.showOffer = !salla.url.is_page('product.single') || salla.config.get('store.settings.product.show_special_offers')\n if (this.showOffer) {\n return;\n }\n throw new Error(\"Merchant disabled showing the offers on product page\");\n }\n )\n .then(async () => salla.api.request(await this.getEndpointByPageName()))\n .then((res) => {\n if (!(this.offersList = res.data).length) {\n throw new Error('salla-offers:: There is no offers!');\n }\n //we support these offers only\n const offer = this.offersList.find(offer => [OfferType.Bank, OfferType.BuyXGetY, OfferType.DiscountsTable].includes(offer.type as any));\n if (!offer) {\n throw new Error('salla-offers:: Offer type not supported yet!');\n }\n //because there is no need for special handling for discounts table, just skip the other cases\n if (offer.type === OfferType.DiscountsTable) {\n return this.offersList = [offer];\n }\n\n //if it's banks offer, we need to include the other banks overs\n if ((this.isBankOffer = offer.type === OfferType.Bank)) {\n this.offersList = this.offersList.filter(offer => offer.type === OfferType.Bank);\n this.isMultipleBank = this.offersList.length > 1;\n return this.offersList;\n }\n //BuyXGetY offers\n const getY = (offer.details as BuyXGetYDetail).get;\n\n return getY.source === 'products'\n //todo:: avoid this request, and the handling for the products, just use `salla-products-slider` and don't forget to pass the customcard\n ? salla.product.api.fetch({ source: \"selected\", source_value: getY.source_value })\n .then((response: any) => {\n getY.products = response.data;\n (offer.details as any).get = getY;\n return this.offersList = [offer];\n })//set the products\n : salla.product.api.categories()//get all categories in one query, then extract only the selected one, instead of sending multi requests\n .then((res) => {\n getY.categories = this.findCategories(res.data, getY.source_value);\n (offer.details as any).get = getY;\n return this.offersList = [offer];\n });\n })\n .then((offers: Offer[]) => {\n salla.storage.set(this.getStorageKey(), { offers, stored_at: new Date().getTime() });\n this.canRender = true;\n })\n .catch((error) => {\n salla.logger.warn(error)\n });\n }\n\n componentDidLoad() {\n let nav = this.host.querySelector('.s-slider-block__title-nav');\n nav?.classList.add(\"s-offer-bank-payment-nav\")\n }\n\n\n findCategories(categories: Category[], ids: any[]): Category[] {\n let found: Category[] = [];\n\n for (const category of categories) {\n if (ids.includes(category.id_ || category.id)) { //here we are using || because we are planning to drop `id_`\n found.push(category);\n }\n if (category.sub_categories?.length > 0) {\n found = found.concat(this.findCategories(category.sub_categories, ids));\n }\n }\n\n return found;\n }\n\n //todo::add to the key params, to make sure it will support multi offers in the same page if it's wanted\n getStorageKey(): string {\n try {\n const pageSlug = salla.config.get('page.slug').replace('.', '_');\n const locale = salla.lang.getLocale();\n const currencyCode = salla.config.currency().code;\n\n if (!pageSlug || !locale || !currencyCode) {\n throw new Error('Unable to get the storage key.');\n }\n\n return `s-offers-${pageSlug}-${salla.config.get('page.id')}-${locale}-${currencyCode}`;\n } catch (error) {\n return '';\n }\n }\n\n //@ts-ignore\n getOffersFromStorage(): null | Promise<Offer[]> {\n let storageOffers = salla.storage.get(this.getStorageKey());\n //if the offers not existed, or it has been stored before 10 minutes from now, ignore it;\n if (!storageOffers || storageOffers.stored_at < (new Date().getTime() - 10 * 60 * 1000)) {\n salla.storage.remove(this.getStorageKey());\n return null;\n }\n this.canRender = true;\n\n //return it as resolve to support .then\n return Promise.resolve(storageOffers.offers);\n }\n\n render() {\n if (!this.offersList.length || !this.canRender || !this.showOffer) return null;\n const offer: Offer = this.offersList[0];\n\n const blockTitle = this.isBankOffer ? (this.isMultipleBank ? this.multipleBankOfferTitleText : null) : offer.title;\n const blockSubTitle = this.isBankOffer ? (this.isMultipleBank ? this.multipleBankOfferTitleDescription : null) : offer.description;\n\n const titles = {\n 'block-title': blockTitle,\n 'block-subTitle': blockSubTitle,\n 'show-controls': this.isMultipleBank\n };\n\n return (\n <div class=\"s-offer-wrapper\">\n {<p class=\"s-offer-corner-badge\">{this.special_offer_text}</p>}\n {/* discounts table is not a slider, it's a table🤔 */}\n {/* single bank offer is not a slider, it's a dom without slider🤔 */}\n <salla-slider type=\"carousel\" id=\"offer-slider\" {...titles}>\n <div slot='items'>\n {this.renderSectionForOfferType(offer.type)}\n </div>\n </salla-slider>\n </div>\n );\n }\n\n private renderSectionForOfferType(offerType: OfferType | string) {\n if (this.isBankOffer) {\n return this.renderBankSection();\n }\n if (offerType == OfferType.BuyXGetY) {\n return this.renderBuyXGetYSection();\n }\n\n return this.renderDiscountTableSection();\n }\n\n /**\n * Generates content for the categories section.\n *\n * @param offeredCategories - An array of Category objects.\n * @returns An array of HTML elements representing categories.\n */\n private getCategoriesSection(category: Category) {\n return <div class=\"s-offer-slide-one-sixth swiper-slide\" innerHTML={this.categorySlot\n .replace(/\\{url\\}/g, category.url)\n .replace(/\\{icon\\}/g, category.icon || \"sicon-store\")\n .replace(/\\{name\\}/g, category.name)}></div>\n }\n\n private renderBuyXGetYSection() {\n const details = (this.offersList[0].details as BuyXGetYDetail)\n return [\n details.get.products?.map((product: Product) => (\n <div class=\"s-offer-slide-one-fourth\">\n {this.hasCustomComponent\n ? <this.productCardComponent product={product}></this.productCardComponent>\n : <salla-product-card shadow-on-hover product={product}></salla-product-card>}\n </div>\n )),\n details.get.categories?.map((category: Category) => this.getCategoriesSection(category))\n ];\n }\n\n /**\n * Generates content for the bank section.\n *\n * @param offeredBank - An array of Bank objects.\n * @param name - The title of the current offer.\n * @param description - The description of the current offer.\n * @returns An array of HTML elements representing banks.\n * \n * TODO: loop over the list and filter bank types and pass it to this function\n */\n private renderBankSection() {\n return this.offersList.map((bankOffer: Offer) => {\n return <div class={{ \"s-offer-slide-one-sixth\": this.isMultipleBank, \"s-offer-bank-wrapper-sinlge-item\": !this.isMultipleBank }}>\n <div class={{ \"s-offer-bank-wrapper\": true, \"s-offer-slide-one-sixth\": !this.isMultipleBank, \"s-offer-bank-wrapper-multi-spacer\": this.isMultipleBank }}>\n <div class=\"s-offer-bank-logo\">\n <img src={(bankOffer.details as BankOffer).logo || salla.url.cdn('images/s-empty.png')} data-src={(bankOffer.details as BankOffer).logo} alt={bankOffer.title + \" offer\"} />\n </div>\n <ul class=\"s-offer-bank-payment-wrapper\">\n {(bankOffer.details as BankOffer).payments.map((payment: string) => {\n return <li class=\"s-offer-bank-payment-single\">\n <img\n src={salla.url.cdn('images/payment/' + payment + '.png') || salla.url.cdn('images/s-empty.png')}\n data-src={salla.url.cdn('images/payment/' + payment + '.png')}\n alt=\"payment\" />\n </li>\n })}\n </ul>\n {this.isMultipleBank ?\n <p class=\"s-offer-bank-payment-discount-percent\">\n {`${this.product_discount_text} ${(bankOffer.details as BankOffer).discount_value}${(bankOffer.details as BankOffer).discount_type === \"percentage\" && '%'}`}\n </p>\n : \"\"}\n </div>\n {!this.isMultipleBank ?\n <div class=\"s-offer-bank-message s-offer-slide-one-fourth\">\n <h2>{this.offersList[0].title}</h2>\n <p innerHTML={this.generateBankDescription(this.offersList[0].description, (bankOffer.details as BankOffer).discount_value)}></p>\n </div>\n : \"\"}\n </div>\n })\n }\n\n private generateBankDescription(desc: string, value): string {\n return desc.replace(new RegExp(`${value} %`), `<span class=\"s-offer-bank-message-amount\">${value} %</span>`)\n }\n\n /**\n * Generates content for the discount table section.\n *\n * @param discountTable - An array of Discount objects.\n * @returns An array of HTML elements representing discounts_table.\n */\n private renderDiscountTableSection() {\n const offer: Offer = this.offersList[0];\n let show_discounted_price = (offer.details as DiscountDetailTable).show_price_after_discount;\n return (this.offersList[0].details as DiscountDetailTable).discounts?.map((discount: Discount) => <div class=\"s-offer-slide-one-fourth\">\n <div class=\"s-offer-slide-offer-entry\">\n <div class=\"s-offer-slide-offer-entry-price-quantity-container\">\n <p class=\"s-offer-slide-offer-entry-quantity\">{this.buy_quantity_text(discount.quantity)}</p>\n {show_discounted_price ?\n <div class=\"s-offer-slide-offer-entry-price\">\n <span>{this.offer_with_price_text}</span>\n <span class=\"s-offer-slide-offer-entry-price-amount\">{discount.discounted_amount}</span> <span>{this.userCurrency}</span>\n </div> : \"\"}\n </div>\n <p class=\"s-offer-slide-offer-entry-price-amount-percent\">{this.with_discount_text}\n (<span>{discount.percentage}{!!discount.percentage && '%'}</span>)</p>\n </div>\n </div>\n )\n }\n\n}\n"]}
1
+ {"version":3,"file":"salla-offer.js","sourceRoot":"","sources":["../../../src/components/salla-offer/salla-offer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AACnE,OAAO,EAAgE,QAAQ,EAAE,SAAS,EAAqD,MAAM,cAAc,CAAC;AAGpK;;;;;;;;;;GAUG;AAKH,MAAM,OAAO,UAAU;IAErB;;QAoBA;;;;;;;;WAQG;QACK,yBAAoB,GAAW,2BAA2B,CAAC;QAEnE,oCAAoC;QAC3B,eAAU,GAAY,EAAE,CAAC;QAEzB,mBAAc,GAAY,KAAK,CAAC;QAKhC,gBAAW,GAAY,KAAK,CAAC;QAC7B,cAAS,GAAY,KAAK,CAAC;QAC3B,cAAS,GAAY,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,4CAA4C,CAAC,CAAC;QAE7F,2BAA2B;QAClB,0BAAqB,GAAW,KAAK,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C,WAAK,KAAK,EAAC,0BAA0B,IAClC,IAAI,CAAC,kBAAkB;oBACtB,CAAC,CAAC,EAAC,IAAI,CAAC,oBAAoB,IAAC,OAAO,EAAE,OAAO,GAA8B;oBAC3E,CAAC,CAAC,mDAAoC,OAAO,EAAE,OAAO,GAAuB,CAC3E,CACP,CAAC,CAAA;YAEF,gDAAgD;YAChD,OAAO,CAAC,QAAQ,KAAK,UAAU;iBAC/B,MAAA,OAAO,CAAC,UAAU,0CAAE,GAAG,CAAC,CAAC,QAAkB,EAAE,EAAE,CAAC,IAAI,CAAC,oBAAoB,CAAC,QAAQ,CAAC,CAAC,CAAA;SACrF,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Prop, State, h } from '@stencil/core';\nimport { Offer, Category, Product, Discount, Currency, BuyXGetYDetail, PageType, OfferType, BankOffer,SpecialPriceDetail, DiscountDetailTable } from './interfaces';\n\n\n/**\n * `salla-offer` is a StencilJS component that displays offers, categories, products, banks, and discount information.\n * It uses the `salla-slider` component for carousel functionality.\n *\n * @slot category - The slot for customizing the category entry layout.\n * \n * @csspart custom - Custom CSS part to target specific elements in the component.\n *\n * @example\n * <salla-offer product-id=\"123\"></salla-offer>\n */\n@Component({\n tag: 'salla-offer',\n styleUrl: 'salla-offer.scss',\n})\nexport class SallaOffer {\n\n constructor() {\n // Language\n salla.lang.onLoaded(() => {\n this.offer_with_price_text = salla.lang.get('pages.offer.with_price');\n this.with_discount_text = salla.lang.get('pages.products.with_a_discount');\n this.product_discount_text = salla.lang.get('pages.products.discount');\n this.special_offer_text = salla.lang.get('pages.products.special_offer');\n this.multipleBankOfferTitleText = salla.lang.get('pages.offer.multiple_bank_offers_title');\n this.multipleBankOfferTitleDescription = salla.lang.get('pages.offer.multiple_bank_offers_message');\n this.buy_quantity_text(0);\n })\n\n salla.onReady(() => {\n this.currentPage = salla.config.get('page.slug')\n this.userCurrency = salla.config.get('currencies')[salla.config.get('user.currency_code')].symbol\n });\n\n this.categorySlot = this.host.querySelector('[slot=\"category\"]')?.innerHTML || '<a href={url} class=\"s-offer-slide-cat-entry\"><i class={icon}></i><h4>{name}</h4></a>';\n }\n\n /**\n * Custom Card Component for the Salla Products List.\n *\n * This component allows you to customize the appearance of individual product cards within a Salla Products List.\n *\n * @example\n * <salla-products-list product-card-component=\"my-custom-card-style1\" ...\n * <salla-products-list product-card-component=\"my-custom-card-style2\" ...\n */\n @Prop() productCardComponent: string = 'custom-salla-product-card';\n\n // Declare component state variables\n @State() offersList: Offer[] = [];\n @State() userCurrency: Currency;\n @State() isMultipleBank: boolean = false;\n @State() title?: string;\n @State() currentPage: string;\n @State() hasCustomComponent: boolean;\n\n @State() isBankOffer: boolean = false;\n @State() canRender: boolean = false;\n @State() showOffer: boolean = salla.config.get('store.settings.product.show_special_offers');\n\n // Default translated texts\n @State() offer_with_price_text: string = salla.lang.get('pages.offer.with_price', { price: '' });\n @State() with_discount_text: string = salla.lang.get('pages.products.with_a_discount')\n @State() product_discount_text: string = salla.lang.get('pages.products.discount')\n @State() special_offer_text: string = salla.lang.get('pages.products.special_offer')\n @State() multipleBankOfferTitleText: string = salla.lang.get('pages.offer.multiple_bank_offers_title')\n @State() multipleBankOfferTitleDescription: string = salla.lang.get('pages.offer.multiple_bank_offers_message')\n @State() buy_quantity_text: (quantity: number) => string = (quantity) => salla.lang.get('pages.offer.buy_quantity', { quantity })\n\n // Reference to the host element\n @Element() host: HTMLElement;\n\n private categorySlot: string;\n\n private async getEndpointByPageName(): Promise<string> {\n if (this.currentPage == PageType.Cart) {\n const cartId = await Salla.cart.getCurrentCartId();\n return `offers/cart/${cartId}`;\n }\n\n if (this.currentPage == PageType.ProductDetail) {\n return `offers/product/${salla.config.get('page.id')}`;\n }\n\n return \"offers\";\n }\n\n componentWillLoad() {\n this.hasCustomComponent = !!customElements.get(this.productCardComponent);\n // let offers = this.getOffersFromStorage();\n // if (offers) {\n // return offers.then(offersFromStorage => this.offersList = offersFromStorage);\n // }\n\n return (new Promise(resolve => salla.onReady(resolve)))\n .then(() => {\n this.showOffer = !salla.url.is_page('product.single') || salla.config.get('store.settings.product.show_special_offers')\n if (this.showOffer) {\n return;\n }\n throw new Error(\"Merchant disabled showing the offers on product page\");\n }\n )\n .then(async () => salla.api.request(await this.getEndpointByPageName()))\n .then((res) => {\n if (!(this.offersList = res.data).length) {\n throw new Error('salla-offers:: There is no offers!');\n }\n //we support these offers only\n const offer = this.offersList.find(offer => [OfferType.SpecialPrice,OfferType.Bank, OfferType.BuyXGetY, OfferType.DiscountsTable].includes(offer.type as any));\n if (!offer) {\n throw new Error('salla-offers:: Offer type not supported yet!');\n }\n //because there is no need for special handling for discounts table, just skip the other cases\n if (offer.type === OfferType.DiscountsTable) {\n return this.offersList = [offer];\n }\n\n //if it's banks offer, we need to include the other banks overs\n if ((this.isBankOffer = offer.type === OfferType.Bank)) {\n this.offersList = this.offersList.filter(offer => offer.type === OfferType.Bank);\n this.isMultipleBank = this.offersList.length > 1;\n return this.offersList;\n }\n\n //if it's special price offer\n if (offer.type === OfferType.SpecialPrice) {\n const details = offer.details as SpecialPriceDetail;\n\n return details.apply_to === 'product'\n // Avoid additional requests; use `salla-products-slider` and pass the custom card\n ? salla.product.api.fetch({ source: \"selected\", source_value: details.targets})\n .then((response: any) => {\n (offer.details as any).products = response.data; // Set the fetched products\n return this.offersList = [offer];\n })\n : salla.product.api.categories() // Fetch all categories in one query\n .then((res) => {\n const categoriesToRender = this.findCategories(res.data, details.targets); // Extract only the selected categories\n (offer.details as any).categories = categoriesToRender;\n return this.offersList = [offer];\n });\n }\n\n //BuyXGetY offers\n const getY = (offer.details as BuyXGetYDetail).get;\n return getY.source === 'products'\n //todo:: avoid this request, and the handling for the products, just use `salla-products-slider` and don't forget to pass the customcard\n ? salla.product.api.fetch({ source: \"selected\", source_value: getY.source_value })\n .then((response: any) => {\n getY.products = response.data;\n (offer.details as any).get = getY;\n return this.offersList = [offer];\n })//set the products\n : salla.product.api.categories()//get all categories in one query, then extract only the selected one, instead of sending multi requests\n .then((res) => {\n getY.categories = this.findCategories(res.data, getY.source_value);\n (offer.details as any).get = getY;\n return this.offersList = [offer];\n });\n })\n .then((offers: Offer[]) => {;\n salla.storage.set(this.getStorageKey(), { offers, stored_at: new Date().getTime() });\n this.canRender = true;\n })\n .catch((error) => {\n salla.logger.warn(error)\n });\n }\n\n componentDidLoad() {\n let nav = this.host.querySelector('.s-slider-block__title-nav');\n nav?.classList.add(\"s-offer-bank-payment-nav\")\n }\n\n\n findCategories(categories: Category[], ids: any[]): Category[] {\n let found: Category[] = [];\n for (const category of categories) {\n if (ids.includes(category.id_ || category.id)) { //here we are using || because we are planning to drop `id_`\n found.push(category);\n }\n if (category.sub_categories?.length > 0) {\n found = found.concat(this.findCategories(category.sub_categories, ids));\n }\n }\n\n return found;\n }\n\n //todo::add to the key params, to make sure it will support multi offers in the same page if it's wanted\n getStorageKey(): string {\n try {\n const pageSlug = salla.config.get('page.slug').replace('.', '_');\n const locale = salla.lang.getLocale();\n const currencyCode = salla.config.currency().code;\n\n if (!pageSlug || !locale || !currencyCode) {\n throw new Error('Unable to get the storage key.');\n }\n\n return `s-offers-${pageSlug}-${salla.config.get('page.id')}-${locale}-${currencyCode}`;\n } catch (error) {\n return '';\n }\n }\n\n //@ts-ignore\n getOffersFromStorage(): null | Promise<Offer[]> {\n let storageOffers = salla.storage.get(this.getStorageKey());\n //if the offers not existed, or it has been stored before 10 minutes from now, ignore it;\n if (!storageOffers || storageOffers.stored_at < (new Date().getTime() - 10 * 60 * 1000)) {\n salla.storage.remove(this.getStorageKey());\n return null;\n }\n this.canRender = true;\n\n //return it as resolve to support .then\n return Promise.resolve(storageOffers.offers);\n }\n\n render() {\n // Check if the offers list is empty or if the component is not ready to render\n if (!this.offersList.length || !this.canRender || !this.showOffer) return null;\n const offer: Offer = this.offersList[0];\n\n const blockTitle = this.isBankOffer ? (this.isMultipleBank ? this.multipleBankOfferTitleText : null) : offer.title;\n const blockSubTitle = this.isBankOffer ? (this.isMultipleBank ? this.multipleBankOfferTitleDescription : null) : offer.description;\n\n const titles = {\n 'block-title': blockTitle,\n 'block-subTitle': blockSubTitle,\n 'show-controls': this.isMultipleBank\n };\n\n return (\n <div class=\"s-offer-wrapper\">\n {<p class=\"s-offer-corner-badge\">{this.special_offer_text}</p>}\n {/* discounts table is not a slider, it's a table🤔 */}\n {/* single bank offer is not a slider, it's a dom without slider🤔 */}\n <salla-slider type=\"carousel\" id=\"offer-slider\" {...titles}>\n <div slot='items'>\n {this.renderSectionForOfferType(offer.type)}\n </div>\n </salla-slider>\n </div>\n );\n }\n\n private renderSectionForOfferType(offerType: OfferType | string) {\n if (this.isBankOffer) {\n return this.renderBankSection();\n }\n if (offerType == OfferType.SpecialPrice) {\n return this.renderSpecialPriceSection();\n }\n if (offerType == OfferType.BuyXGetY) {\n return this.renderBuyXGetYSection();\n }\n\n return this.renderDiscountTableSection();\n }\n\n /**\n * Generates content for the categories section.\n *\n * @param offeredCategories - An array of Category objects.\n * @returns An array of HTML elements representing categories.\n */\n private getCategoriesSection(category: Category) {\n return <div class=\"s-offer-slide-one-sixth swiper-slide\" innerHTML={this.categorySlot\n .replace(/\\{url\\}/g, category.url)\n .replace(/\\{icon\\}/g, category.icon || \"sicon-store\")\n .replace(/\\{name\\}/g, category.name)}></div>\n }\n\n private renderBuyXGetYSection() {\n const details = (this.offersList[0].details as BuyXGetYDetail)\n return [\n details.get.products?.map((product: Product) => (\n <div class=\"s-offer-slide-one-fourth\">\n {this.hasCustomComponent\n ? <this.productCardComponent product={product}></this.productCardComponent>\n : <salla-product-card shadow-on-hover product={product}></salla-product-card>}\n </div>\n )),\n details.get.categories?.map((category: Category) => this.getCategoriesSection(category))\n ];\n }\n\n /**\n * Generates content for the bank section.\n *\n * @param offeredBank - An array of Bank objects.\n * @param name - The title of the current offer.\n * @param description - The description of the current offer.\n * @returns An array of HTML elements representing banks.\n * \n * TODO: loop over the list and filter bank types and pass it to this function\n */\n private renderBankSection() {\n return this.offersList.map((bankOffer: Offer) => {\n return <div class={{ \"s-offer-slide-one-sixth\": this.isMultipleBank, \"s-offer-bank-wrapper-sinlge-item\": !this.isMultipleBank }}>\n <div class={{ \"s-offer-bank-wrapper\": true, \"s-offer-slide-one-sixth\": !this.isMultipleBank, \"s-offer-bank-wrapper-multi-spacer\": this.isMultipleBank }}>\n <div class=\"s-offer-bank-logo\">\n <img src={(bankOffer.details as BankOffer).logo || salla.url.cdn('images/s-empty.png')} data-src={(bankOffer.details as BankOffer).logo} alt={bankOffer.title + \" offer\"} />\n </div>\n <ul class=\"s-offer-bank-payment-wrapper\">\n {(bankOffer.details as BankOffer).payments.map((payment: string) => {\n return <li class=\"s-offer-bank-payment-single\">\n <img\n src={salla.url.cdn('images/payment/' + payment + '.png') || salla.url.cdn('images/s-empty.png')}\n data-src={salla.url.cdn('images/payment/' + payment + '.png')}\n alt=\"payment\" />\n </li>\n })}\n </ul>\n {this.isMultipleBank ?\n <p class=\"s-offer-bank-payment-discount-percent\">\n {`${this.product_discount_text} ${(bankOffer.details as BankOffer).discount_value}${(bankOffer.details as BankOffer).discount_type === \"percentage\" && '%'}`}\n </p>\n : \"\"}\n </div>\n {!this.isMultipleBank ?\n <div class=\"s-offer-bank-message s-offer-slide-one-fourth\">\n <h2>{this.offersList[0].title}</h2>\n <p innerHTML={this.generateBankDescription(this.offersList[0].description, (bankOffer.details as BankOffer).discount_value)}></p>\n </div>\n : \"\"}\n </div>\n })\n }\n\n private generateBankDescription(desc: string, value): string {\n return desc.replace(new RegExp(`${value} %`), `<span class=\"s-offer-bank-message-amount\">${value} %</span>`)\n }\n\n /**\n * Generates content for the discount table section.\n *\n * @param discountTable - An array of Discount objects.\n * @returns An array of HTML elements representing discounts_table.\n */\n private renderDiscountTableSection() {\n const offer: Offer = this.offersList[0];\n let show_discounted_price = (offer.details as DiscountDetailTable).show_price_after_discount;\n return (this.offersList[0].details as DiscountDetailTable).discounts?.map((discount: Discount) => <div class=\"s-offer-slide-one-fourth\">\n <div class=\"s-offer-slide-offer-entry\">\n <div class=\"s-offer-slide-offer-entry-price-quantity-container\">\n <p class=\"s-offer-slide-offer-entry-quantity\">{this.buy_quantity_text(discount.quantity)}</p>\n {show_discounted_price ?\n <div class=\"s-offer-slide-offer-entry-price\">\n <span>{this.offer_with_price_text}</span>\n <span class=\"s-offer-slide-offer-entry-price-amount\">{discount.discounted_amount}</span> <span>{this.userCurrency}</span>\n </div> : \"\"}\n </div>\n <p class=\"s-offer-slide-offer-entry-price-amount-percent\">{this.with_discount_text}\n (<span>{discount.percentage}{!!discount.percentage && '%'}</span>)</p>\n </div>\n </div>\n )\n }\n\n private renderSpecialPriceSection() {\n const details = this.offersList[0].details as SpecialPriceDetail;\n\n return [\n // Render products if `apply_to` is \"product\"\n details.apply_to === \"product\" &&\n details.products?.map((product:Product) => (\n <div class=\"s-offer-slide-one-fourth\">\n {this.hasCustomComponent\n ? <this.productCardComponent product={product}></this.productCardComponent>\n : <salla-product-card shadow-on-hover product={product}></salla-product-card>}\n </div>\n )),\n\n // Render categories if `apply_to` is \"category\"\n details.apply_to === \"category\" &&\n details.categories?.map((category: Category) => this.getCategoriesSection(category)),\n ];\n }\n}\n"]}