@salla.sa/twilight-components 3.0.22 → 3.0.24

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 (360) hide show
  1. package/dist/cjs/{Helper-CAuzGdeJ.js → Helper-sq6ztayx.js} +1 -1
  2. package/dist/cjs/{filepond-DV6O0i7Z.js → filepond-BMxlEH8M.js} +1 -1
  3. package/dist/cjs/{filepond-plugin-file-poster-DV6-NSU_.js → filepond-plugin-file-poster-DVSz4StJ.js} +1 -1
  4. package/dist/cjs/{filepond-plugin-file-validate-size-Db166u1S.js → filepond-plugin-file-validate-size-CXJiLSzt.js} +1 -1
  5. package/dist/cjs/{filepond-plugin-file-validate-type-BYB3PzOs.js → filepond-plugin-file-validate-type-DWK85msl.js} +1 -1
  6. package/dist/cjs/{filepond-plugin-image-edit-B6QXk344.js → filepond-plugin-image-edit-BHttJI5X.js} +1 -1
  7. package/dist/cjs/{filepond-plugin-image-exif-orientation-Ca5k1F5m.js → filepond-plugin-image-exif-orientation-DTKIO2zE.js} +1 -1
  8. package/dist/cjs/{filepond-plugin-image-preview-C4j2Udlc.js → filepond-plugin-image-preview-BaRxwhFa.js} +1 -1
  9. package/dist/cjs/{index-CHCpMa_m.js → index-BJ3-fFSF.js} +7 -7
  10. package/dist/cjs/{intlTelInput-BNBzSLpY.js → intlTelInput-DNoOb73M.js} +1 -1
  11. package/dist/cjs/loader.cjs.js +2 -2
  12. package/dist/cjs/salla-accordion-body_2.cjs.entry.js +1 -1
  13. package/dist/cjs/salla-accordion_6.cjs.entry.js +2 -2
  14. package/dist/cjs/salla-add-product-button_5.cjs.entry.js +2 -2
  15. package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
  16. package/dist/cjs/salla-alert_2.cjs.entry.js +1 -1
  17. package/dist/cjs/salla-app-install-alert.cjs.entry.js +1 -1
  18. package/dist/cjs/salla-applied-filters.cjs.entry.js +2 -2
  19. package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
  20. package/dist/cjs/salla-attachment-view_9.cjs.entry.js +11 -11
  21. package/dist/cjs/salla-badge.cjs.entry.js +1 -1
  22. package/dist/cjs/salla-basket-gap.cjs.entry.js +1 -1
  23. package/dist/cjs/salla-bullet-delivery_3.cjs.entry.js +1 -1
  24. package/dist/cjs/salla-cart-coupons.cjs.entry.js +89 -7
  25. package/dist/cjs/salla-cart-item-offers_2.cjs.entry.js +1 -1
  26. package/dist/cjs/salla-cart-summary-card.cjs.entry.js +1 -1
  27. package/dist/cjs/salla-cashback-banner.cjs.entry.js +1 -1
  28. package/dist/cjs/salla-comment-factors.cjs.entry.js +1 -1
  29. package/dist/cjs/salla-comment-form_9.cjs.entry.js +2 -2
  30. package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
  31. package/dist/cjs/salla-contacts.cjs.entry.js +1 -1
  32. package/dist/cjs/salla-cookies-bar.cjs.entry.js +1 -1
  33. package/dist/cjs/salla-count-down.cjs.entry.js +1 -1
  34. package/dist/cjs/salla-custom-fields.cjs.entry.js +1 -1
  35. package/dist/cjs/salla-delivery-promise.cjs.entry.js +1 -1
  36. package/dist/cjs/salla-edit-order-button.cjs.entry.js +1 -1
  37. package/dist/cjs/salla-filters-widget.cjs.entry.js +2 -2
  38. package/dist/cjs/salla-filters.cjs.entry.js +2 -2
  39. package/dist/cjs/salla-free-shipping-banner.cjs.entry.js +1 -1
  40. package/dist/cjs/salla-free-shipping-tag.cjs.entry.js +1 -1
  41. package/dist/cjs/salla-fulfillment-methods.cjs.entry.js +1 -1
  42. package/dist/cjs/salla-gift-card-redeem_2.cjs.entry.js +1 -1
  43. package/dist/cjs/salla-gifting.cjs.entry.js +1 -1
  44. package/dist/cjs/salla-hook.cjs.entry.js +1 -1
  45. package/dist/cjs/salla-infinite-scroll.cjs.entry.js +2 -2
  46. package/dist/cjs/salla-installment.cjs.entry.js +1 -1
  47. package/dist/cjs/salla-list-tile.cjs.entry.js +1 -1
  48. package/dist/cjs/salla-localization-modal.cjs.entry.js +1 -1
  49. package/dist/cjs/salla-login-modal.cjs.entry.js +1 -1
  50. package/dist/cjs/salla-loyalty-banner_10.cjs.entry.js +1 -1
  51. package/dist/cjs/salla-loyalty-exchange-product-card.cjs.entry.js +1 -1
  52. package/dist/cjs/salla-loyalty-points-banner.cjs.entry.js +1 -1
  53. package/dist/cjs/salla-loyalty-points-history.cjs.entry.js +1 -1
  54. package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
  55. package/dist/cjs/salla-loyalty.cjs.entry.js +1 -1
  56. package/dist/cjs/salla-maintenance-alert.cjs.entry.js +1 -1
  57. package/dist/cjs/salla-map_3.cjs.entry.js +1 -1
  58. package/dist/cjs/salla-menu.cjs.entry.js +1 -1
  59. package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
  60. package/dist/cjs/salla-mobile-update-modal.cjs.entry.js +1 -1
  61. package/dist/cjs/salla-multiple-bundle-product-cart_2.cjs.entry.js +1 -1
  62. package/dist/cjs/salla-multiple-bundle-product-options-modal_2.cjs.entry.js +1 -1
  63. package/dist/cjs/salla-multiple-bundle-product.cjs.entry.js +1 -1
  64. package/dist/cjs/salla-next-order-coupon.cjs.entry.js +1 -1
  65. package/dist/cjs/salla-notification-item_2.cjs.entry.js +2 -2
  66. package/dist/cjs/salla-offer-modal.cjs.entry.js +1 -1
  67. package/dist/cjs/salla-offer.cjs.entry.js +1 -1
  68. package/dist/cjs/salla-order-branch.cjs.entry.js +1 -1
  69. package/dist/cjs/salla-order-cancel.cjs.entry.js +1 -1
  70. package/dist/cjs/salla-order-details-multiple-bundle-product.cjs.entry.js +1 -1
  71. package/dist/cjs/salla-order-details-options.cjs.entry.js +1 -1
  72. package/dist/cjs/salla-order-details.cjs.entry.js +1 -1
  73. package/dist/cjs/salla-order-edit-item.cjs.entry.js +1 -1
  74. package/dist/cjs/salla-order-edit-product-card.cjs.entry.js +1 -1
  75. package/dist/cjs/salla-order-edit.cjs.entry.js +1 -1
  76. package/dist/cjs/salla-order-items.cjs.entry.js +1 -1
  77. package/dist/cjs/salla-order-options-modal.cjs.entry.js +1 -1
  78. package/dist/cjs/salla-order-payment.cjs.entry.js +1 -1
  79. package/dist/cjs/salla-order-rewards.cjs.entry.js +1 -1
  80. package/dist/cjs/salla-order-shipments.cjs.entry.js +1 -1
  81. package/dist/cjs/salla-order-summary.cjs.entry.js +1 -1
  82. package/dist/cjs/salla-order-totals-card.cjs.entry.js +1 -1
  83. package/dist/cjs/salla-orders.cjs.entry.js +2 -2
  84. package/dist/cjs/salla-payments.cjs.entry.js +1 -1
  85. package/dist/cjs/salla-placeholder.cjs.entry.js +1 -1
  86. package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
  87. package/dist/cjs/salla-product-card-embed.cjs.entry.js +1 -1
  88. package/dist/cjs/salla-product-card.cjs.entry.js +1 -1
  89. package/dist/cjs/salla-product-size-guide.cjs.entry.js +1 -1
  90. package/dist/cjs/salla-products-list.cjs.entry.js +2 -2
  91. package/dist/cjs/salla-products-slider.cjs.entry.js +2 -2
  92. package/dist/cjs/salla-quick-order.cjs.entry.js +1 -1
  93. package/dist/cjs/salla-rating-modal-v2.cjs.entry.js +2 -2
  94. package/dist/cjs/salla-rating-modal.cjs.entry.js +2 -2
  95. package/dist/cjs/salla-review-factors-tags.cjs.entry.js +1 -1
  96. package/dist/cjs/salla-review-order-item.cjs.entry.js +1 -1
  97. package/dist/cjs/salla-scopes.cjs.entry.js +1 -1
  98. package/dist/cjs/salla-search-product-card.cjs.entry.js +1 -1
  99. package/dist/cjs/salla-search.cjs.entry.js +2 -2
  100. package/dist/cjs/salla-skeleton.cjs.entry.js +1 -1
  101. package/dist/cjs/salla-social-share.cjs.entry.js +1 -1
  102. package/dist/cjs/salla-social.cjs.entry.js +1 -1
  103. package/dist/cjs/salla-tab-content_3.cjs.entry.js +1 -1
  104. package/dist/cjs/salla-thank-you-header.cjs.entry.js +1 -1
  105. package/dist/cjs/salla-thank-you-page.cjs.entry.js +1 -1
  106. package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
  107. package/dist/cjs/salla-trust-badges.cjs.entry.js +1 -1
  108. package/dist/cjs/salla-user-menu.cjs.entry.js +1 -1
  109. package/dist/cjs/salla-user-profile.cjs.entry.js +1 -1
  110. package/dist/cjs/salla-user-settings.cjs.entry.js +1 -1
  111. package/dist/cjs/salla-verify.cjs.entry.js +1 -1
  112. package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
  113. package/dist/cjs/salla-wishlist-actions.cjs.entry.js +1 -1
  114. package/dist/cjs/salla-wishlist-summary.cjs.entry.js +2 -2
  115. package/dist/cjs/twilight.cjs.js +2 -2
  116. package/dist/cjs/{vanilla-picker-Chebtfev.js → vanilla-picker-CceY3g8c.js} +1 -1
  117. package/dist/collection/components/salla-cart-coupons/salla-cart-coupons.js +44 -6
  118. package/dist/collection/shared/coupons-request.js +47 -0
  119. package/dist/components/index.js +3 -3
  120. package/dist/components/salla-cart-coupons.js +88 -6
  121. package/dist/docs.json +1 -1
  122. package/dist/esm/{Helper-DfW8RE8Z.js → Helper-BwzPfwZJ.js} +1 -1
  123. package/dist/esm/{filepond-Bc6CLtnG.js → filepond-JNV-1zqR.js} +1 -1
  124. package/dist/esm/{filepond-plugin-file-poster-Bl_fLsTQ.js → filepond-plugin-file-poster-nFqNHCag.js} +1 -1
  125. package/dist/esm/{filepond-plugin-file-validate-size-IuRpnxuB.js → filepond-plugin-file-validate-size-P3KmOTH8.js} +1 -1
  126. package/dist/esm/{filepond-plugin-file-validate-type-Bo7Ab1TY.js → filepond-plugin-file-validate-type-BV0Ctr7U.js} +1 -1
  127. package/dist/esm/{filepond-plugin-image-edit-DgnQoIV9.js → filepond-plugin-image-edit-D62rKlfH.js} +1 -1
  128. package/dist/esm/{filepond-plugin-image-exif-orientation-DsTifPGw.js → filepond-plugin-image-exif-orientation-DerapxIk.js} +1 -1
  129. package/dist/esm/{filepond-plugin-image-preview-cv3hlMNi.js → filepond-plugin-image-preview-BlRd2Ble.js} +1 -1
  130. package/dist/esm/{index-BNekvDFW.js → index-CtoXzf1y.js} +7 -7
  131. package/dist/esm/{intlTelInput-Dz8xcV83.js → intlTelInput-BZz-u5_w.js} +1 -1
  132. package/dist/esm/loader.js +3 -3
  133. package/dist/esm/salla-accordion-body_2.entry.js +1 -1
  134. package/dist/esm/salla-accordion_6.entry.js +2 -2
  135. package/dist/esm/salla-add-product-button_5.entry.js +2 -2
  136. package/dist/esm/salla-advertisement.entry.js +1 -1
  137. package/dist/esm/salla-alert_2.entry.js +1 -1
  138. package/dist/esm/salla-app-install-alert.entry.js +1 -1
  139. package/dist/esm/salla-applied-filters.entry.js +2 -2
  140. package/dist/esm/salla-apps-icons.entry.js +1 -1
  141. package/dist/esm/salla-attachment-view_9.entry.js +11 -11
  142. package/dist/esm/salla-badge.entry.js +1 -1
  143. package/dist/esm/salla-basket-gap.entry.js +1 -1
  144. package/dist/esm/salla-bullet-delivery_3.entry.js +1 -1
  145. package/dist/esm/salla-cart-coupons.entry.js +89 -7
  146. package/dist/esm/salla-cart-item-offers_2.entry.js +1 -1
  147. package/dist/esm/salla-cart-summary-card.entry.js +1 -1
  148. package/dist/esm/salla-cashback-banner.entry.js +1 -1
  149. package/dist/esm/salla-comment-factors.entry.js +1 -1
  150. package/dist/esm/salla-comment-form_9.entry.js +2 -2
  151. package/dist/esm/salla-conditional-offer.entry.js +1 -1
  152. package/dist/esm/salla-contacts.entry.js +1 -1
  153. package/dist/esm/salla-cookies-bar.entry.js +1 -1
  154. package/dist/esm/salla-count-down.entry.js +1 -1
  155. package/dist/esm/salla-custom-fields.entry.js +1 -1
  156. package/dist/esm/salla-delivery-promise.entry.js +1 -1
  157. package/dist/esm/salla-edit-order-button.entry.js +1 -1
  158. package/dist/esm/salla-filters-widget.entry.js +2 -2
  159. package/dist/esm/salla-filters.entry.js +2 -2
  160. package/dist/esm/salla-free-shipping-banner.entry.js +1 -1
  161. package/dist/esm/salla-free-shipping-tag.entry.js +1 -1
  162. package/dist/esm/salla-fulfillment-methods.entry.js +1 -1
  163. package/dist/esm/salla-gift-card-redeem_2.entry.js +1 -1
  164. package/dist/esm/salla-gifting.entry.js +1 -1
  165. package/dist/esm/salla-hook.entry.js +1 -1
  166. package/dist/esm/salla-infinite-scroll.entry.js +2 -2
  167. package/dist/esm/salla-installment.entry.js +1 -1
  168. package/dist/esm/salla-list-tile.entry.js +1 -1
  169. package/dist/esm/salla-localization-modal.entry.js +1 -1
  170. package/dist/esm/salla-login-modal.entry.js +1 -1
  171. package/dist/esm/salla-loyalty-banner_10.entry.js +1 -1
  172. package/dist/esm/salla-loyalty-exchange-product-card.entry.js +1 -1
  173. package/dist/esm/salla-loyalty-points-banner.entry.js +1 -1
  174. package/dist/esm/salla-loyalty-points-history.entry.js +1 -1
  175. package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
  176. package/dist/esm/salla-loyalty.entry.js +1 -1
  177. package/dist/esm/salla-maintenance-alert.entry.js +1 -1
  178. package/dist/esm/salla-map_3.entry.js +1 -1
  179. package/dist/esm/salla-menu.entry.js +1 -1
  180. package/dist/esm/salla-metadata.entry.js +1 -1
  181. package/dist/esm/salla-mobile-update-modal.entry.js +1 -1
  182. package/dist/esm/salla-multiple-bundle-product-cart_2.entry.js +1 -1
  183. package/dist/esm/salla-multiple-bundle-product-options-modal_2.entry.js +1 -1
  184. package/dist/esm/salla-multiple-bundle-product.entry.js +1 -1
  185. package/dist/esm/salla-next-order-coupon.entry.js +1 -1
  186. package/dist/esm/salla-notification-item_2.entry.js +2 -2
  187. package/dist/esm/salla-offer-modal.entry.js +1 -1
  188. package/dist/esm/salla-offer.entry.js +1 -1
  189. package/dist/esm/salla-order-branch.entry.js +1 -1
  190. package/dist/esm/salla-order-cancel.entry.js +1 -1
  191. package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +1 -1
  192. package/dist/esm/salla-order-details-options.entry.js +1 -1
  193. package/dist/esm/salla-order-details.entry.js +1 -1
  194. package/dist/esm/salla-order-edit-item.entry.js +1 -1
  195. package/dist/esm/salla-order-edit-product-card.entry.js +1 -1
  196. package/dist/esm/salla-order-edit.entry.js +1 -1
  197. package/dist/esm/salla-order-items.entry.js +1 -1
  198. package/dist/esm/salla-order-options-modal.entry.js +1 -1
  199. package/dist/esm/salla-order-payment.entry.js +1 -1
  200. package/dist/esm/salla-order-rewards.entry.js +1 -1
  201. package/dist/esm/salla-order-shipments.entry.js +1 -1
  202. package/dist/esm/salla-order-summary.entry.js +1 -1
  203. package/dist/esm/salla-order-totals-card.entry.js +1 -1
  204. package/dist/esm/salla-orders.entry.js +2 -2
  205. package/dist/esm/salla-payments.entry.js +1 -1
  206. package/dist/esm/salla-placeholder.entry.js +1 -1
  207. package/dist/esm/salla-price-range.entry.js +1 -1
  208. package/dist/esm/salla-product-card-embed.entry.js +1 -1
  209. package/dist/esm/salla-product-card.entry.js +1 -1
  210. package/dist/esm/salla-product-size-guide.entry.js +1 -1
  211. package/dist/esm/salla-products-list.entry.js +2 -2
  212. package/dist/esm/salla-products-slider.entry.js +2 -2
  213. package/dist/esm/salla-quick-order.entry.js +1 -1
  214. package/dist/esm/salla-rating-modal-v2.entry.js +2 -2
  215. package/dist/esm/salla-rating-modal.entry.js +2 -2
  216. package/dist/esm/salla-review-factors-tags.entry.js +1 -1
  217. package/dist/esm/salla-review-order-item.entry.js +1 -1
  218. package/dist/esm/salla-scopes.entry.js +1 -1
  219. package/dist/esm/salla-search-product-card.entry.js +1 -1
  220. package/dist/esm/salla-search.entry.js +2 -2
  221. package/dist/esm/salla-skeleton.entry.js +1 -1
  222. package/dist/esm/salla-social-share.entry.js +1 -1
  223. package/dist/esm/salla-social.entry.js +1 -1
  224. package/dist/esm/salla-tab-content_3.entry.js +1 -1
  225. package/dist/esm/salla-thank-you-header.entry.js +1 -1
  226. package/dist/esm/salla-thank-you-page.entry.js +1 -1
  227. package/dist/esm/salla-tiered-offer.entry.js +1 -1
  228. package/dist/esm/salla-trust-badges.entry.js +1 -1
  229. package/dist/esm/salla-user-menu.entry.js +1 -1
  230. package/dist/esm/salla-user-profile.entry.js +1 -1
  231. package/dist/esm/salla-user-settings.entry.js +1 -1
  232. package/dist/esm/salla-verify.entry.js +1 -1
  233. package/dist/esm/salla-wallet.entry.js +1 -1
  234. package/dist/esm/salla-wishlist-actions.entry.js +1 -1
  235. package/dist/esm/salla-wishlist-summary.entry.js +2 -2
  236. package/dist/esm/twilight.js +3 -3
  237. package/dist/esm/{vanilla-picker-Cjh-Ze_A.js → vanilla-picker-BfmpXY4G.js} +1 -1
  238. package/dist/twilight/{p-57f318e8.entry.js → p-00a1ec4e.entry.js} +1 -1
  239. package/dist/twilight/{p-8429392a.entry.js → p-02ddd64c.entry.js} +1 -1
  240. package/dist/twilight/{p-f3e1b753.entry.js → p-034b80ad.entry.js} +1 -1
  241. package/dist/twilight/{p-f6b30072.entry.js → p-055bf228.entry.js} +1 -1
  242. package/dist/twilight/{p-fdae9cfe.entry.js → p-061216d4.entry.js} +1 -1
  243. package/dist/twilight/{p-45fe04fd.entry.js → p-0b583810.entry.js} +1 -1
  244. package/dist/twilight/{p-1c2e5260.entry.js → p-0cb60522.entry.js} +1 -1
  245. package/dist/twilight/{p-04e6af9e.entry.js → p-0ce0cdb0.entry.js} +1 -1
  246. package/dist/twilight/{p-125f2ee0.entry.js → p-0d1b8490.entry.js} +1 -1
  247. package/dist/twilight/{p-d6b354e5.entry.js → p-0fb390fb.entry.js} +1 -1
  248. package/dist/twilight/{p-deae85d1.entry.js → p-117e714b.entry.js} +1 -1
  249. package/dist/twilight/{p-1bf191eb.entry.js → p-118aa92e.entry.js} +1 -1
  250. package/dist/twilight/{p-d25b4ee3.entry.js → p-17be7967.entry.js} +1 -1
  251. package/dist/twilight/{p-e07aaa9a.entry.js → p-1af75625.entry.js} +1 -1
  252. package/dist/twilight/{p-5c976451.entry.js → p-1b4c3b85.entry.js} +1 -1
  253. package/dist/twilight/{p-f0399559.entry.js → p-1d105a57.entry.js} +1 -1
  254. package/dist/twilight/{p-e0435187.entry.js → p-1f39ca4f.entry.js} +1 -1
  255. package/dist/twilight/{p-625bdbb6.entry.js → p-213368ef.entry.js} +1 -1
  256. package/dist/twilight/{p-2e24994d.entry.js → p-2140be84.entry.js} +1 -1
  257. package/dist/twilight/{p-bc842250.entry.js → p-2401f0d7.entry.js} +1 -1
  258. package/dist/twilight/{p-ee9aeeac.entry.js → p-2566f688.entry.js} +1 -1
  259. package/dist/twilight/{p-4468ac98.entry.js → p-2882d626.entry.js} +1 -1
  260. package/dist/twilight/{p-9f50ac84.entry.js → p-2afc4658.entry.js} +1 -1
  261. package/dist/twilight/{p-4f098545.entry.js → p-2c04bba3.entry.js} +1 -1
  262. package/dist/twilight/{p-33fba2cf.entry.js → p-2e1dd9cf.entry.js} +1 -1
  263. package/dist/twilight/{p-fb60a276.entry.js → p-3356638d.entry.js} +1 -1
  264. package/dist/twilight/{p-049dea32.entry.js → p-36167cbe.entry.js} +1 -1
  265. package/dist/twilight/{p-f1400765.entry.js → p-365ff361.entry.js} +1 -1
  266. package/dist/twilight/{p-7bf85dae.entry.js → p-36a7344c.entry.js} +1 -1
  267. package/dist/twilight/{p-7838a5fd.entry.js → p-374d9f0c.entry.js} +1 -1
  268. package/dist/twilight/{p-f2d56ad1.entry.js → p-3845e427.entry.js} +1 -1
  269. package/dist/twilight/{p-0b56e95f.entry.js → p-38b70281.entry.js} +1 -1
  270. package/dist/twilight/p-3d3eda0f.entry.js +4 -0
  271. package/dist/twilight/{p-201104da.entry.js → p-3da2e3f3.entry.js} +1 -1
  272. package/dist/twilight/{p-2bab06c3.entry.js → p-3e285056.entry.js} +1 -1
  273. package/dist/twilight/{p-f7886e77.entry.js → p-4008e164.entry.js} +1 -1
  274. package/dist/twilight/{p-cd2174f2.entry.js → p-4080fdc9.entry.js} +1 -1
  275. package/dist/twilight/{p-671ac08f.entry.js → p-40e651ac.entry.js} +1 -1
  276. package/dist/twilight/{p-62fcec73.entry.js → p-4254e9c2.entry.js} +1 -1
  277. package/dist/twilight/{p-4b88f596.entry.js → p-4adaee32.entry.js} +1 -1
  278. package/dist/twilight/{p-81d878de.entry.js → p-4c5a7ffc.entry.js} +1 -1
  279. package/dist/twilight/{p-a956472d.entry.js → p-4f4933f8.entry.js} +1 -1
  280. package/dist/twilight/{p-0ee1dadf.entry.js → p-5bc2190a.entry.js} +1 -1
  281. package/dist/twilight/{p-cf8ecf55.entry.js → p-5dea6c09.entry.js} +1 -1
  282. package/dist/twilight/{p-bbf58048.entry.js → p-60ae422e.entry.js} +1 -1
  283. package/dist/twilight/{p-91ad0bac.entry.js → p-6495383e.entry.js} +1 -1
  284. package/dist/twilight/{p-MZn39yer.js → p-6KZIgnh6.js} +1 -1
  285. package/dist/twilight/{p-41202dbb.entry.js → p-6ffbf505.entry.js} +1 -1
  286. package/dist/twilight/{p-fe4ff3bd.entry.js → p-7169ba9a.entry.js} +1 -1
  287. package/dist/twilight/{p-ec6496db.entry.js → p-71b5546b.entry.js} +1 -1
  288. package/dist/twilight/{p-a95c0a09.entry.js → p-72b0724c.entry.js} +1 -1
  289. package/dist/twilight/{p-a209a2e4.entry.js → p-7303ebd1.entry.js} +1 -1
  290. package/dist/twilight/{p-e6fad08f.entry.js → p-77deaa00.entry.js} +1 -1
  291. package/dist/twilight/{p-lTAe1vb6.js → p-78r0jdyY.js} +1 -1
  292. package/dist/twilight/{p-da315a25.entry.js → p-79b743eb.entry.js} +1 -1
  293. package/dist/twilight/{p-b36fe22d.entry.js → p-7a8fde62.entry.js} +1 -1
  294. package/dist/twilight/p-7c684782.entry.js +4 -0
  295. package/dist/twilight/{p-f0d42626.entry.js → p-8413d52b.entry.js} +1 -1
  296. package/dist/twilight/p-8b9c44c8.entry.js +4 -0
  297. package/dist/twilight/{p-7908a58c.entry.js → p-8cbf3bc2.entry.js} +1 -1
  298. package/dist/twilight/{p-46fa33ae.entry.js → p-8ea3a265.entry.js} +1 -1
  299. package/dist/twilight/{p-e54ae4d1.entry.js → p-8fd6ed52.entry.js} +1 -1
  300. package/dist/twilight/{p-d5dad2cb.entry.js → p-8fe950e8.entry.js} +1 -1
  301. package/dist/twilight/{p-9c9379e6.entry.js → p-919650b7.entry.js} +1 -1
  302. package/dist/twilight/{p-4c5bd7c1.entry.js → p-94d5b080.entry.js} +1 -1
  303. package/dist/twilight/{p-5764788d.entry.js → p-95e7c2e1.entry.js} +1 -1
  304. package/dist/twilight/{p-86ab1578.entry.js → p-97065b4f.entry.js} +1 -1
  305. package/dist/twilight/{p-377cdf1f.entry.js → p-974c100d.entry.js} +1 -1
  306. package/dist/twilight/{p-9a73ca9e.entry.js → p-9c1b0978.entry.js} +1 -1
  307. package/dist/twilight/{p-3c03d14a.entry.js → p-9e50f29c.entry.js} +1 -1
  308. package/dist/twilight/{p-CCPdEfoe.js → p-BeC8AhMn.js} +1 -1
  309. package/dist/twilight/{p-BXKSGzKV.js → p-BwUX8dew.js} +1 -1
  310. package/dist/twilight/{p-LtS3HRdN.js → p-CC-KFXD9.js} +1 -1
  311. package/dist/twilight/p-CtoXzf1y.js +5 -0
  312. package/dist/twilight/{p-lxIDn6jP.js → p-D5DrmlyQ.js} +1 -1
  313. package/dist/twilight/{p-COwkTkvn.js → p-DT73iyFr.js} +1 -1
  314. package/dist/twilight/p-DYAn-F48.js +9 -0
  315. package/dist/twilight/{p-Co_-mXfS.js → p-F1Erq7GR.js} +1 -1
  316. package/dist/twilight/{p-0bbcc35f.entry.js → p-a236dd3b.entry.js} +1 -1
  317. package/dist/twilight/{p-8cf35d34.entry.js → p-a260f35e.entry.js} +1 -1
  318. package/dist/twilight/{p-00d667e8.entry.js → p-a4fee391.entry.js} +1 -1
  319. package/dist/twilight/{p-1e6fa8b3.entry.js → p-a8102290.entry.js} +1 -1
  320. package/dist/twilight/{p-1d2102ad.entry.js → p-a9ae6ab9.entry.js} +1 -1
  321. package/dist/twilight/{p-b02baa8a.entry.js → p-aac9d2fe.entry.js} +1 -1
  322. package/dist/twilight/{p-104bca40.entry.js → p-aca2717e.entry.js} +1 -1
  323. package/dist/twilight/{p-0b5d1aa5.entry.js → p-ae1efde9.entry.js} +1 -1
  324. package/dist/twilight/{p-beec9469.entry.js → p-b1bc70af.entry.js} +1 -1
  325. package/dist/twilight/{p-e6fcad0c.entry.js → p-b2cbdaa0.entry.js} +1 -1
  326. package/dist/twilight/{p-06b6f446.entry.js → p-b3472096.entry.js} +1 -1
  327. package/dist/twilight/{p-ba2c5b59.entry.js → p-b3c9ab0e.entry.js} +1 -1
  328. package/dist/twilight/{p-c44f5313.entry.js → p-c18fe9e5.entry.js} +1 -1
  329. package/dist/twilight/{p-ee9de13c.entry.js → p-c1ab1b40.entry.js} +1 -1
  330. package/dist/twilight/{p-418ad88e.entry.js → p-c4264e87.entry.js} +1 -1
  331. package/dist/twilight/{p-a2488682.entry.js → p-cbff6c68.entry.js} +1 -1
  332. package/dist/twilight/{p-a8fd0442.entry.js → p-cd55369c.entry.js} +1 -1
  333. package/dist/twilight/{p-ce2bf246.entry.js → p-d6a3b2d8.entry.js} +1 -1
  334. package/dist/twilight/{p-b43ef0e9.entry.js → p-d76b7564.entry.js} +1 -1
  335. package/dist/twilight/{p-38f2bd9b.entry.js → p-dc2be7b8.entry.js} +1 -1
  336. package/dist/twilight/{p-bc1f5fe2.entry.js → p-e2cb5c49.entry.js} +1 -1
  337. package/dist/twilight/{p-b4972389.entry.js → p-e5dc1d27.entry.js} +1 -1
  338. package/dist/twilight/{p-a89e40aa.entry.js → p-e8198efc.entry.js} +1 -1
  339. package/dist/twilight/{p-e56faeba.entry.js → p-e89daada.entry.js} +1 -1
  340. package/dist/twilight/{p-9638738f.entry.js → p-e8ebb2fe.entry.js} +1 -1
  341. package/dist/twilight/{p-a19a5611.entry.js → p-ebe45961.entry.js} +1 -1
  342. package/dist/twilight/{p-beab90d6.entry.js → p-ebed682b.entry.js} +1 -1
  343. package/dist/twilight/{p-c11c6c01.entry.js → p-ed37e702.entry.js} +1 -1
  344. package/dist/twilight/{p-c5efb28f.entry.js → p-f310b923.entry.js} +1 -1
  345. package/dist/twilight/{p-f07810d9.entry.js → p-f3455825.entry.js} +1 -1
  346. package/dist/twilight/{p-0dff2fee.entry.js → p-f51f31df.entry.js} +1 -1
  347. package/dist/twilight/{p-f8fb6c94.entry.js → p-f664fa69.entry.js} +1 -1
  348. package/dist/twilight/{p-8d0fb329.entry.js → p-f67d03fb.entry.js} +1 -1
  349. package/dist/twilight/{p-6149030c.entry.js → p-f738f492.entry.js} +1 -1
  350. package/dist/twilight/{p-94f85fa6.entry.js → p-fbce8a18.entry.js} +1 -1
  351. package/dist/twilight/{p-DR0WZviU.js → p-x4_Sxqd_.js} +1 -1
  352. package/dist/twilight/twilight.esm.js +1 -1
  353. package/dist/types/components/salla-cart-coupons/salla-cart-coupons.d.ts +11 -0
  354. package/dist/types/shared/coupons-request.d.ts +3 -0
  355. package/package.json +5 -5
  356. package/dist/twilight/p-586d675b.entry.js +0 -4
  357. package/dist/twilight/p-7f6f9d0e.entry.js +0 -4
  358. package/dist/twilight/p-9914bb99.entry.js +0 -4
  359. package/dist/twilight/p-BNekvDFW.js +0 -5
  360. package/dist/twilight/p-D5FQ0WRe.js +0 -9
@@ -5,6 +5,51 @@ import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal
5
5
  import { d as defineCustomElement$3 } from './salla-button2.js';
6
6
  import { d as defineCustomElement$2 } from './salla-slider2.js';
7
7
 
8
+ /**
9
+ * One shared GET /coupons per page view (CHKM-594).
10
+ *
11
+ * Every `salla-cart-coupons` instance (a re-created drawer, a second mount) used to hit the
12
+ * endpoint on its own. They now share one in-flight/settled promise, keyed by everything the
13
+ * response varies on, so a currency / language / scope change automatically misses the cache.
14
+ */
15
+ const requests = new Map();
16
+ // Same source the request layer uses to send the scope (lib/request.js): config first, then storage.
17
+ const requestKey = () => {
18
+ const scope = salla.config.get('store.scope', salla.storage.get('scope'));
19
+ return [
20
+ ...['store.id', 'user.currency_code', 'user.language_code'].map(key => String(salla.config.get(key, ''))),
21
+ String(scope?.id ?? ''),
22
+ ].join('|');
23
+ };
24
+ /** Drop every cached request, so the next load refetches. */
25
+ const resetCouponsRequest = () => {
26
+ requests.clear();
27
+ };
28
+ // A coupon added or removed changes what the endpoint returns (and what is still applicable).
29
+ // off-then-on keeps the subscription single however often (or after whatever reset) this runs.
30
+ const invalidateOnCouponChange = () => {
31
+ ['cart::coupon.added', 'cart::coupon.deleted'].forEach(eventName => {
32
+ salla.event.off(eventName, resetCouponsRequest);
33
+ salla.event.on(eventName, resetCouponsRequest);
34
+ });
35
+ };
36
+ const getCouponsRequest = () => {
37
+ invalidateOnCouponChange();
38
+ const key = requestKey();
39
+ let request = requests.get(key);
40
+ if (!request) {
41
+ request = salla.api.request('coupons');
42
+ requests.set(key, request);
43
+ const failed = request;
44
+ // A failed request must never stick: let the next caller retry.
45
+ failed.catch(() => {
46
+ if (requests.get(key) === failed)
47
+ requests.delete(key);
48
+ });
49
+ }
50
+ return request;
51
+ };
52
+
8
53
  const sallaCartCouponsCss = "/*!twlt*/@charset \"UTF-8\";.s-cart-coupons-card--applied{cursor:default}.s-cart-coupons-card--applied:hover{transform:none}.s-cart-coupons-card--applied .s-cart-coupons-top-section,.s-cart-coupons-card--applied .s-cart-coupons-bottom-section,.s-cart-coupons-card--applied .s-cart-coupons-divider{border-color:#d1d5db;border-color:color-mix(in srgb, var(--color-primary, #004d5a) 40%, transparent)}.s-cart-coupons-card--applied .s-cart-coupons-bottom-section{background:rgba(0, 0, 0, 0.04);background:color-mix(in srgb, var(--color-primary, #004d5a) 8%, transparent)}.s-cart-coupons-card--applied::before,.s-cart-coupons-card--applied::after{border-color:#d1d5db;border-color:color-mix(in srgb, var(--color-primary, #004d5a) 40%, transparent)}.s-cart-coupons-card--applied .s-cart-coupons-action{display:inline-flex;align-items:center;gap:10px}.s-cart-coupons-card--applied .s-cart-coupons-action{font-size:10px;font-weight:600;color:#4b5563}.s-cart-coupons-card-applied-label{color:#4b5563;color:var(--color-primary-dark, var(--color-primary, #4b5563))}.s-cart-coupons-card--applied .s-cart-coupons-action{min-width:0;max-width:100%}.s-cart-coupons-card-applied-label,.s-cart-coupons-card-remove{overflow:hidden;text-overflow:ellipsis}.s-cart-coupons-card--applied .s-cart-coupons-action,.s-cart-coupons-card--applied .s-cart-coupons-card-remove{pointer-events:auto}.s-cart-coupons-card-remove{flex:none;font-size:inherit;font-weight:inherit;color:#6b7280;background:transparent;border:0;padding:0;cursor:pointer;transition:color 0.15s ease}.s-cart-coupons-card-remove:hover{color:var(--color-danger, #ef4444)}.s-cart-coupons-card-remove:disabled{opacity:0.5;cursor:not-allowed}.s-cart-coupons-card--minimal .s-cart-coupons-bottom-section{justify-content:flex-end}.visible{visibility:visible}.fixed{position:fixed}.shrink{flex-shrink:1}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.form-input{height:2.5rem;width:100%;border-radius:0.375rem;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.form-input:focus{border-color:var(--color-primary);--tw-ring-color:transparent}.form-input:is(.dark *){--tw-border-opacity:1;border-color:rgb(75 85 99 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(75 85 99 / var(--tw-bg-opacity, 1))}.form-input:focus:is(.dark *){border-color:var(--color-primary)}@media (min-width: 640px){.form-input{font-size:0.875rem;line-height:1.25rem}}.s-cart-coupons-wrapper{display:block;width:100%;padding-top:1.25rem;padding-bottom:1.25rem}.s-cart-coupons-input-section{margin-bottom:0.625rem}.s-cart-coupons-coupon-label{margin-bottom:0.625rem;display:block;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.s-cart-coupons-coupon-input-container{position:relative;display:flex;align-items:stretch}.s-cart-coupons-coupon-input-container .form-input{height:auto;flex:1 1 0%}.s-cart-coupons-coupon-input-container .form-input:where([dir=\"ltr\"],[dir=\"ltr\"] *){border-top-left-radius:0.5rem;border-bottom-left-radius:0.5rem;border-top-right-radius:0px !important;border-bottom-right-radius:0px !important;border-right-width:0px}.s-cart-coupons-coupon-input-container .form-input:where([dir=\"rtl\"],[dir=\"rtl\"] *){border-top-right-radius:0.5rem;border-bottom-right-radius:0.5rem;border-top-left-radius:0px !important;border-bottom-left-radius:0px !important;border-left-width:0px}.s-cart-coupons-coupon-input-container .form-input:focus{position:relative;z-index:10}.s-cart-coupons-coupon-button:where([dir=\"ltr\"],[dir=\"ltr\"] *){border-top-right-radius:0.5rem;border-bottom-right-radius:0.5rem;border-top-left-radius:0px;border-bottom-left-radius:0px}.s-cart-coupons-coupon-button:where([dir=\"rtl\"],[dir=\"rtl\"] *){border-top-left-radius:0.5rem;border-bottom-left-radius:0.5rem;border-top-right-radius:0px;border-bottom-right-radius:0px}.s-cart-coupons-coupon-button-remove:where([dir=\"ltr\"],[dir=\"ltr\"] *){border-top-right-radius:0.5rem;border-bottom-right-radius:0.5rem;border-top-left-radius:0px !important;border-bottom-left-radius:0px !important}.s-cart-coupons-coupon-button-remove:where([dir=\"rtl\"],[dir=\"rtl\"] *){border-top-left-radius:0.5rem;border-bottom-left-radius:0.5rem;border-top-right-radius:0px !important;border-bottom-right-radius:0px !important}.s-cart-coupons-coupon-button-apply:where([dir=\"ltr\"],[dir=\"ltr\"] *){border-top-right-radius:0.5rem !important;border-bottom-right-radius:0.5rem !important;border-top-left-radius:0px !important;border-bottom-left-radius:0px !important}.s-cart-coupons-coupon-button-apply:where([dir=\"rtl\"],[dir=\"rtl\"] *){border-top-left-radius:0.5rem !important;border-bottom-left-radius:0.5rem !important;border-top-right-radius:0px !important;border-bottom-right-radius:0px !important}.s-cart-coupons-coupon-error{margin-top:0.5rem;display:block;font-size:10px;line-height:1rem;--tw-text-opacity:1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.s-cart-coupons-slider{width:100%;overflow:hidden;padding-left:0.375rem;padding-right:0.375rem}.s-cart-coupons-card{position:relative;cursor:pointer;overflow:hidden;--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));transition-property:all;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-cart-coupons-card:is(.dark *){--tw-bg-opacity:1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.s-cart-coupons-card:hover{--tw-translate-y:-0.125rem;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.s-cart-coupons-disabled{cursor:not-allowed;opacity:0.5}.s-cart-coupons-disabled:hover{transform:none;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.s-cart-coupons-top-section{display:flex;height:60px;flex-direction:row;align-items:center;justify-content:space-between;border-top-left-radius:0.75rem;border-top-right-radius:0.75rem;border-width:1px;border-bottom-width:0px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));padding-top:1rem;padding-bottom:1rem;padding-left:0.75rem;padding-right:0.75rem}.s-cart-coupons-discount-values{display:flex;flex-direction:column;align-items:flex-start}.s-cart-coupons-discount-values .s-cart-coupons-main-amount{display:flex;align-items:center;gap:0.25rem;white-space:nowrap;font-size:1.25rem;line-height:1.75rem;font-weight:900;line-height:1;--tw-text-opacity:1;color:rgb(0 0 0 / var(--tw-text-opacity, 1))}.s-cart-coupons-discount-values .s-cart-coupons-secondary-info{margin:0px;font-size:10px;line-height:1rem}.s-cart-coupons-code{font-size:10px;font-weight:700;--tw-text-opacity:1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.s-cart-coupons-divider{position:relative;z-index:10;margin:0px;border-bottom-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.s-cart-coupons-bottom-section{display:flex;min-height:44px;flex-direction:row;align-items:center;justify-content:space-between;border-bottom-right-radius:0.75rem;border-bottom-left-radius:0.75rem;border-width:1px;border-top-width:0px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1));padding-top:0.25rem;padding-bottom:0.25rem;padding-left:0.75rem;padding-right:0.75rem}.s-cart-coupons-terms{display:flex;flex-direction:column;align-items:flex-start}.s-cart-coupons-terms .s-cart-coupons-expiry{margin:0px;font-size:10px;line-height:16px;--tw-text-opacity:1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.s-cart-coupons-terms .s-cart-coupons-minimum{margin:0px;font-size:10px;line-height:16px;--tw-text-opacity:1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.s-cart-coupons-terms .s-cart-coupons-expiry.s-cart-coupons-expiry-warning{font-weight:500;--tw-text-opacity:1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.s-cart-coupons-action{cursor:pointer;white-space:nowrap;border-width:0px;background-color:transparent;padding:0px;font-size:9px;font-weight:700;--tw-text-opacity:1;color:rgb(17 24 39 / var(--tw-text-opacity, 1));transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}.s-cart-coupons-action:hover{--tw-text-opacity:1;color:rgb(59 130 246 / var(--tw-text-opacity, 1))}.s-cart-coupons-slide-one-fourth{width:calc(75% - 10px);min-width:200px !important;padding-left:5px !important;padding-right:5px !important;padding-top:2px !important}@media (min-width: 1024px){.s-cart-coupons-slide-one-fourth{width:calc(40% - 10px) !important}}.s-cart-coupons-card:before{pointer-events:none;position:absolute;right:-10px;top:60px;z-index:20;height:1.25rem;width:1.25rem;--tw-translate-y:-50%;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));border-radius:9999px;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));--tw-content:'';content:var(--tw-content)}.s-cart-coupons-card:is(.dark *):before{--tw-bg-opacity:1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.s-cart-coupons-card:after{pointer-events:none;position:absolute;left:-10px;top:60px;z-index:20;height:1.25rem;width:1.25rem;--tw-translate-y:-50%;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));border-radius:9999px;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));--tw-content:'';content:var(--tw-content)}.s-cart-coupons-card:is(.dark *):after{--tw-bg-opacity:1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.s-cart-coupons-coupon-input-container .form-input.s-coupon-input-error{--tw-shadow:0 0 0 3px rgba(239,68,68,0.1) !important;--tw-shadow-colored:0 0 0 3px var(--tw-shadow-color) !important;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow) !important}";
9
54
 
10
55
  const SallaCartCoupons$1 = /*@__PURE__*/ proxyCustomElement(class SallaCartCoupons extends HTMLElement {
@@ -42,6 +87,8 @@ const SallaCartCoupons$1 = /*@__PURE__*/ proxyCustomElement(class SallaCartCoupo
42
87
  // (Salla.config.get('store.settings.cart.multi_coupon')) — a stable store-level setting,
43
88
  // exactly like cart.apply_coupon_enabled — not from the per-cart payload or localStorage.
44
89
  this.multiCoupon = false;
90
+ // True from scheduling until the first (visible) load starts.
91
+ this.awaitingVisibility = false;
45
92
  this.isHandlingInternalError = false;
46
93
  // Store cart event listener references for cleanup
47
94
  this.cartUpdatedHandler = (cartData) => {
@@ -136,7 +183,7 @@ const SallaCartCoupons$1 = /*@__PURE__*/ proxyCustomElement(class SallaCartCoupo
136
183
  // apply_coupon_enabled), so it never depends on the per-cart payload or localStorage.
137
184
  this.multiCoupon = !!salla.config.get('store.settings.cart.multi_coupon');
138
185
  //then set your logic here to avoid any race condition
139
- this.loadCouponsData(); // Load async without blocking render - shows empty until loaded
186
+ this.scheduleCouponsLoad(); // Load async without blocking render - shows empty until loaded
140
187
  // Synchronous first-paint seed from the storage cart so an applied coupon shows on the very
141
188
  // first render instead of flashing empty → applied while the async server fetch is in flight
142
189
  // (the old loadCartTotal read storage synchronously). loadCartTotal() then reconciles with the
@@ -155,6 +202,7 @@ const SallaCartCoupons$1 = /*@__PURE__*/ proxyCustomElement(class SallaCartCoupo
155
202
  salla.event.on('cart::coupon.deleted', this.couponDeletedHandler);
156
203
  }
157
204
  disconnectedCallback() {
205
+ this.stopObservingVisibility();
158
206
  // Input events are bound via JSX (onInput/onKeyUp) — Stencil cleans those up. Only the
159
207
  // global cart event listeners need explicit teardown here.
160
208
  salla.event.off('cart::updated', this.cartUpdatedHandler);
@@ -188,10 +236,44 @@ const SallaCartCoupons$1 = /*@__PURE__*/ proxyCustomElement(class SallaCartCoupo
188
236
  }
189
237
  return selectedCoupon;
190
238
  }
239
+ /**
240
+ * CHKM-594: the cart page needs the coupons straight away; anywhere else (a theme's cart
241
+ * drawer, often display:none until opened) wait until the host is first visible, so a page
242
+ * the shopper never opens the cart on makes no request. No IntersectionObserver → fetch now.
243
+ */
244
+ scheduleCouponsLoad() {
245
+ if (salla.url.is_page('cart') || typeof IntersectionObserver === 'undefined') {
246
+ this.loadCouponsData();
247
+ return;
248
+ }
249
+ this.awaitingVisibility = true;
250
+ this.observeVisibility();
251
+ }
252
+ observeVisibility() {
253
+ this.visibilityObserver = new IntersectionObserver(entries => {
254
+ if (entries.some(entry => entry.isIntersecting)) {
255
+ this.awaitingVisibility = false;
256
+ this.stopObservingVisibility();
257
+ this.loadCouponsData();
258
+ }
259
+ });
260
+ this.visibilityObserver.observe(this.host);
261
+ }
262
+ stopObservingVisibility() {
263
+ this.visibilityObserver?.disconnect();
264
+ this.visibilityObserver = undefined;
265
+ }
266
+ // A host that was removed and re-attached before it was first visible must resume watching:
267
+ // componentWillLoad (the only scheduler) does not run again for the same element.
268
+ connectedCallback() {
269
+ if (this.awaitingVisibility && !this.visibilityObserver) {
270
+ this.observeVisibility();
271
+ }
272
+ }
191
273
  async loadCouponsData() {
192
274
  try {
193
- // Load coupons from API
194
- const response = await salla.api.request('coupons');
275
+ // Load coupons from API (shared across instances, see coupons-request.ts)
276
+ const response = await getCouponsRequest();
195
277
  const raw = response?.data;
196
278
  const coupons = Array.isArray(raw) ? raw : (Array.isArray(raw?.data) ? raw.data : []);
197
279
  this.availableCoupons = coupons;
@@ -628,7 +710,7 @@ const SallaCartCoupons$1 = /*@__PURE__*/ proxyCustomElement(class SallaCartCoupo
628
710
  }
629
711
  render() {
630
712
  const couponRow = this.couponRow();
631
- return (h(Host, { key: 'edf77b08d11d50a1083e1b2c2970cc4af4163d80' }, h("div", { key: 'a5e3ed9302fe64136f572c9a89df529ac139cca4', class: "s-cart-coupons-wrapper" }, h("div", { key: 'f09279d5ccd96b1ffec3fa1a4fe280e322c624a8', class: "s-cart-coupons-input-section" }, h("label", { key: 'fa0b750c99686ad2e196f720de6f27c0f84eb41b', htmlFor: "coupon-input", class: "s-cart-coupons-coupon-label" }, salla.lang.get('pages.cart.have_coupon')), h("div", { key: '96e892d3f6685dbd9fd901a6e5602a520eea7ecc', class: "s-cart-coupons-coupon-input-container" }, this.multiCoupon ? [
713
+ return (h(Host, { key: '59daca187b980f5ea675aea6d3617bf891bff32f' }, h("div", { key: '0e27f04a648ef5d4b4a9f0273e128a4658d5e97d', class: "s-cart-coupons-wrapper" }, h("div", { key: '3090b6c9e39069382ca517162d1861788b642e33', class: "s-cart-coupons-input-section" }, h("label", { key: 'fac50b4ab6835519849b1a5b00fcb190eabf20dd', htmlFor: "coupon-input", class: "s-cart-coupons-coupon-label" }, salla.lang.get('pages.cart.have_coupon')), h("div", { key: 'cd96cc8bdbb32b14dc1dfaa166a87aa0c2a37372', class: "s-cart-coupons-coupon-input-container" }, this.multiCoupon ? [
632
714
  // Multi-coupon: input stays active to append more codes; applied coupons render
633
715
  // as removable chips below.
634
716
  h("input", { type: "text", id: "coupon-input", name: "coupon", class: `form-input ${this.couponError ? 's-coupon-input-error' : ''}`, placeholder: salla.lang.get('pages.cart.coupon_placeholder'), value: this.couponInputValue, disabled: this.isApplying, onInput: this.onInput, onKeyUp: this.onKeyUp, "aria-label": salla.lang.get('pages.cart.apply_coupon'), key: "coupon-input" }),
@@ -639,7 +721,7 @@ const SallaCartCoupons$1 = /*@__PURE__*/ proxyCustomElement(class SallaCartCoupo
639
721
  // a new code can only be entered after removing. Reuses the existing master classes.
640
722
  h("input", { type: "text", id: "coupon-input", name: "coupon", class: `form-input ${this.couponError ? 's-coupon-input-error' : ''}`, placeholder: salla.lang.get('pages.cart.coupon_placeholder'), value: this.couponInputValue, disabled: !!this.currentCoupon || this.isApplying, onInput: this.onInput, onKeyUp: this.onKeyUp, "aria-label": salla.lang.get('pages.cart.apply_coupon'), key: "coupon-input" }),
641
723
  h("salla-button", { ref: el => this.couponButtonRef = el, class: `s-cart-coupons-coupon-button ${this.currentCoupon ? 's-cart-coupons-coupon-button-remove' : 's-cart-coupons-coupon-button-apply'}`, color: this.currentCoupon ? 'danger' : 'primary', loading: this.isApplying, "loader-position": "center", onClick: () => this.handleCouponButtonClick(), key: "apply-button" }, this.currentCoupon ? (h("i", { class: "sicon-cancel" })) : (h("span", null, salla.lang.get('pages.cart.save_coupon')))),
642
- ]), this.couponError && (h("span", { key: '1e2bb51904486fe5e0cb3f842965a7b330ef7e91', class: "s-cart-coupons-coupon-error" }, this.couponError))), couponRow.length > 0 && (h("salla-slider", { type: "carousel", showControls: false, class: "s-cart-coupons-slider",
724
+ ]), this.couponError && (h("span", { key: 'eeb7bc0ad60797930af60fd476c74af748f91f72', class: "s-cart-coupons-coupon-error" }, this.couponError))), couponRow.length > 0 && (h("salla-slider", { type: "carousel", showControls: false, class: "s-cart-coupons-slider",
643
725
  /* salla-slider hands its slot children to Swiper, which MOVES them out of the
644
726
  `slot="items"` div into its own .swiper-wrapper. Stencil then patches against a
645
727
  tree that no longer exists where it expects, so a slide added to a list that
@@ -648,7 +730,7 @@ const SallaCartCoupons$1 = /*@__PURE__*/ proxyCustomElement(class SallaCartCoupo
648
730
  against dynamic custom components inside it. Keying on the exact code list
649
731
  makes Stencil discard and remount the slider whenever the set changes, so
650
732
  Swiper re-initialises over the full, correct set of slides. */
651
- key: couponRow.map(entry => entry.code).join('|') }, h("div", { key: 'c83306bce90ca9a62b13b39718d9941dcc6da498', slot: "items" }, couponRow.map(entry => this.renderCouponCard(entry))))))));
733
+ key: couponRow.map(entry => entry.code).join('|') }, h("div", { key: 'f095c16d9e93a19087a0125600286f3c75527671', slot: "items" }, couponRow.map(entry => this.renderCouponCard(entry))))))));
652
734
  }
653
735
  get host() { return this; }
654
736
  static get style() { return sallaCartCouponsCss; }
package/dist/docs.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "timestamp": "2026-11-02T10:20:18",
2
+ "timestamp": "2026-11-03T05:50:40",
3
3
  "compiler": {
4
4
  "name": "@stencil/core",
5
5
  "version": "4.35.1",
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import './index-BNekvDFW.js';
4
+ import './index-CtoXzf1y.js';
5
5
 
6
6
  var FilterOptionTypes;
7
7
  (function (FilterOptionTypes) {
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { d as getDefaultExportFromCjs } from './index-BNekvDFW.js';
4
+ import { d as getDefaultExportFromCjs } from './index-CtoXzf1y.js';
5
5
 
6
6
  function _mergeNamespaces(n, m) {
7
7
  m.forEach(function (e) {
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { d as getDefaultExportFromCjs } from './index-BNekvDFW.js';
4
+ import { d as getDefaultExportFromCjs } from './index-CtoXzf1y.js';
5
5
 
6
6
  function _mergeNamespaces(n, m) {
7
7
  m.forEach(function (e) {
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { d as getDefaultExportFromCjs } from './index-BNekvDFW.js';
4
+ import { d as getDefaultExportFromCjs } from './index-CtoXzf1y.js';
5
5
 
6
6
  function _mergeNamespaces(n, m) {
7
7
  m.forEach(function (e) {
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { d as getDefaultExportFromCjs } from './index-BNekvDFW.js';
4
+ import { d as getDefaultExportFromCjs } from './index-CtoXzf1y.js';
5
5
 
6
6
  function _mergeNamespaces(n, m) {
7
7
  m.forEach(function (e) {
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { d as getDefaultExportFromCjs } from './index-BNekvDFW.js';
4
+ import { d as getDefaultExportFromCjs } from './index-CtoXzf1y.js';
5
5
 
6
6
  function _mergeNamespaces(n, m) {
7
7
  m.forEach(function (e) {
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { d as getDefaultExportFromCjs } from './index-BNekvDFW.js';
4
+ import { d as getDefaultExportFromCjs } from './index-CtoXzf1y.js';
5
5
 
6
6
  function _mergeNamespaces(n, m) {
7
7
  m.forEach(function (e) {
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { d as getDefaultExportFromCjs } from './index-BNekvDFW.js';
4
+ import { d as getDefaultExportFromCjs } from './index-CtoXzf1y.js';
5
5
 
6
6
  function _mergeNamespaces(n, m) {
7
7
  m.forEach(function (e) {