@salla.sa/twilight-components 2.14.439 → 2.14.441

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 (329) hide show
  1. package/dist/cjs/{filepond-DdDLuiM5.js → filepond-CR18WANU.js} +1 -1
  2. package/dist/cjs/{filepond-plugin-file-poster-yMQqced-.js → filepond-plugin-file-poster-BgJLk2xE.js} +1 -1
  3. package/dist/cjs/{filepond-plugin-file-validate-size-ySnuQivZ.js → filepond-plugin-file-validate-size-DdhORRaG.js} +1 -1
  4. package/dist/cjs/{filepond-plugin-file-validate-type-DZR1JS8f.js → filepond-plugin-file-validate-type-Cub0X5ah.js} +1 -1
  5. package/dist/cjs/{filepond-plugin-image-edit-D1I8S80L.js → filepond-plugin-image-edit-DgEsDjWT.js} +1 -1
  6. package/dist/cjs/{filepond-plugin-image-exif-orientation-C9XMlwy1.js → filepond-plugin-image-exif-orientation-BTfUfEsw.js} +1 -1
  7. package/dist/cjs/{filepond-plugin-image-preview-Bb0GALoo.js → filepond-plugin-image-preview-HZ3u1SlT.js} +1 -1
  8. package/dist/cjs/{functions-wi2J1iyx.js → functions-D9RJmmeE.js} +1 -1
  9. package/dist/cjs/{index-gyLHvjDh.js → index-BTssS-W3.js} +1 -1
  10. package/dist/cjs/{index-CzYs-dhm.js → index-ChjKTah1.js} +6 -6
  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 +1 -1
  14. package/dist/cjs/salla-add-product-button_5.cjs.entry.js +1 -1
  15. package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
  16. package/dist/cjs/salla-alert_2.cjs.entry.js +1 -1
  17. package/dist/cjs/salla-app-install-alert.cjs.entry.js +1 -1
  18. package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
  19. package/dist/cjs/salla-badge.cjs.entry.js +1 -1
  20. package/dist/cjs/salla-booking-field_7.cjs.entry.js +10 -10
  21. package/dist/cjs/salla-bullet-delivery_2.cjs.entry.js +1 -1
  22. package/dist/cjs/salla-cart-coupons.cjs.entry.js +1 -1
  23. package/dist/cjs/salla-cart-item-offers_2.cjs.entry.js +1 -1
  24. package/dist/cjs/salla-cashback-banner.cjs.entry.js +1 -1
  25. package/dist/cjs/salla-comment-form_8.cjs.entry.js +1 -1
  26. package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
  27. package/dist/cjs/salla-contacts.cjs.entry.js +1 -1
  28. package/dist/cjs/salla-cookies-bar.cjs.entry.js +1 -1
  29. package/dist/cjs/salla-count-down.cjs.entry.js +1 -1
  30. package/dist/cjs/salla-custom-fields.cjs.entry.js +1 -1
  31. package/dist/cjs/salla-delivery-promise.cjs.entry.js +41 -35
  32. package/dist/cjs/salla-edit-order-button.cjs.entry.js +1 -1
  33. package/dist/cjs/salla-filters-widget.cjs.entry.js +1 -1
  34. package/dist/cjs/salla-filters.cjs.entry.js +1 -1
  35. package/dist/cjs/salla-fulfillment-methods.cjs.entry.js +1 -1
  36. package/dist/cjs/salla-gifting.cjs.entry.js +1 -1
  37. package/dist/cjs/salla-hook.cjs.entry.js +1 -1
  38. package/dist/cjs/salla-infinite-scroll.cjs.entry.js +1 -1
  39. package/dist/cjs/salla-installment.cjs.entry.js +1 -1
  40. package/dist/cjs/salla-list-tile.cjs.entry.js +1 -1
  41. package/dist/cjs/salla-localization-modal.cjs.entry.js +1 -1
  42. package/dist/cjs/salla-login-modal.cjs.entry.js +1 -1
  43. package/dist/cjs/salla-loyalty-banner.cjs.entry.js +2 -2
  44. package/dist/cjs/salla-loyalty-hero_2.cjs.entry.js +2 -2
  45. package/dist/cjs/salla-loyalty-panel.cjs.entry.js +3 -3
  46. package/dist/cjs/salla-loyalty-points-banner.cjs.entry.js +1 -1
  47. package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
  48. package/dist/cjs/salla-loyalty-program.cjs.entry.js +3 -3
  49. package/dist/cjs/salla-loyalty-reward.cjs.entry.js +2 -2
  50. package/dist/cjs/salla-loyalty.cjs.entry.js +1 -1
  51. package/dist/cjs/salla-maintenance-alert.cjs.entry.js +1 -1
  52. package/dist/cjs/salla-map.cjs.entry.js +1 -1
  53. package/dist/cjs/salla-menu.cjs.entry.js +1 -1
  54. package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
  55. package/dist/cjs/salla-multiple-bundle-product-cart_2.cjs.entry.js +247 -42
  56. package/dist/cjs/salla-multiple-bundle-product-options-modal_2.cjs.entry.js +86 -25
  57. package/dist/cjs/salla-multiple-bundle-product.cjs.entry.js +1 -1
  58. package/dist/cjs/salla-next-order-coupon.cjs.entry.js +1 -1
  59. package/dist/cjs/salla-notification-item.cjs.entry.js +1 -1
  60. package/dist/cjs/salla-notifications.cjs.entry.js +1 -1
  61. package/dist/cjs/salla-offer-modal.cjs.entry.js +1 -1
  62. package/dist/cjs/salla-offer.cjs.entry.js +1 -1
  63. package/dist/cjs/salla-order-details-multiple-bundle-product.cjs.entry.js +1 -1
  64. package/dist/cjs/salla-order-details-options.cjs.entry.js +1 -1
  65. package/dist/cjs/salla-order-details.cjs.entry.js +1 -1
  66. package/dist/cjs/salla-order-edit-item.cjs.entry.js +1 -1
  67. package/dist/cjs/salla-order-edit-product-card.cjs.entry.js +1 -1
  68. package/dist/cjs/salla-order-edit.cjs.entry.js +1 -1
  69. package/dist/cjs/salla-order-summary.cjs.entry.js +1 -1
  70. package/dist/cjs/salla-order-totals-card.cjs.entry.js +1 -1
  71. package/dist/cjs/salla-orders.cjs.entry.js +1 -1
  72. package/dist/cjs/salla-payments.cjs.entry.js +1 -1
  73. package/dist/cjs/salla-placeholder.cjs.entry.js +1 -1
  74. package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
  75. package/dist/cjs/salla-product-card-embed.cjs.entry.js +2 -2
  76. package/dist/cjs/salla-product-card_2.cjs.entry.js +1 -1
  77. package/dist/cjs/salla-product-size-guide.cjs.entry.js +1 -1
  78. package/dist/cjs/salla-products-list.cjs.entry.js +1 -1
  79. package/dist/cjs/salla-progress-bar.cjs.entry.js +1 -1
  80. package/dist/cjs/salla-quick-order.cjs.entry.js +1 -1
  81. package/dist/cjs/salla-rating-modal.cjs.entry.js +1 -1
  82. package/dist/cjs/salla-reward-action_4.cjs.entry.js +3 -3
  83. package/dist/cjs/salla-scopes.cjs.entry.js +1 -1
  84. package/dist/cjs/salla-search.cjs.entry.js +1 -1
  85. package/dist/cjs/salla-skeleton.cjs.entry.js +1 -1
  86. package/dist/cjs/salla-slider.cjs.entry.js +1 -1
  87. package/dist/cjs/salla-social-share.cjs.entry.js +1 -1
  88. package/dist/cjs/salla-social.cjs.entry.js +1 -1
  89. package/dist/cjs/salla-tab-content_3.cjs.entry.js +1 -1
  90. package/dist/cjs/salla-tiered-offer.cjs.entry.js +48 -31
  91. package/dist/cjs/salla-tooltip.cjs.entry.js +1 -1
  92. package/dist/cjs/salla-trust-badges.cjs.entry.js +1 -1
  93. package/dist/cjs/salla-user-menu.cjs.entry.js +1 -1
  94. package/dist/cjs/salla-user-profile.cjs.entry.js +1 -1
  95. package/dist/cjs/salla-user-settings.cjs.entry.js +1 -1
  96. package/dist/cjs/salla-verify.cjs.entry.js +1 -1
  97. package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
  98. package/dist/cjs/{tracked-promise-DT3W4yYx.js → tracked-promise-kKXrk2xR.js} +1 -1
  99. package/dist/cjs/twilight.cjs.js +2 -2
  100. package/dist/cjs/{vanilla-picker-BdKuUhUF.js → vanilla-picker-DchwguNU.js} +1 -1
  101. package/dist/collection/components/salla-delivery-promise/delivery-promise-api.js +4 -3
  102. package/dist/collection/components/salla-delivery-promise/salla-delivery-promise.js +38 -25
  103. package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-details.js +278 -41
  104. package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-options-modal.js +18 -4
  105. package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-slider.js +107 -20
  106. package/dist/collection/components/salla-product-card-embed/salla-product-card-embed.css +32 -0
  107. package/dist/collection/components/salla-tiered-offer/salla-tiered-offer.js +47 -30
  108. package/dist/components/index.js +2 -2
  109. package/dist/components/salla-delivery-promise.js +54 -42
  110. package/dist/components/salla-multiple-bundle-product-details2.js +250 -42
  111. package/dist/components/salla-multiple-bundle-product-options-modal2.js +18 -4
  112. package/dist/components/salla-multiple-bundle-product-slider2.js +69 -20
  113. package/dist/components/salla-product-card-embed.js +1 -1
  114. package/dist/components/salla-tiered-offer.js +47 -30
  115. package/dist/esm/{filepond-CuxNx4T_.js → filepond-DKQDCbwV.js} +1 -1
  116. package/dist/esm/{filepond-plugin-file-poster-B0bm9HVP.js → filepond-plugin-file-poster-SawqMYzR.js} +1 -1
  117. package/dist/esm/{filepond-plugin-file-validate-size-Ndd8bi5G.js → filepond-plugin-file-validate-size-BmxmtaD4.js} +1 -1
  118. package/dist/esm/{filepond-plugin-file-validate-type-DrPPjEtZ.js → filepond-plugin-file-validate-type-CCuZxfqE.js} +1 -1
  119. package/dist/esm/{filepond-plugin-image-edit-C96YLlHm.js → filepond-plugin-image-edit-BW1mzub6.js} +1 -1
  120. package/dist/esm/{filepond-plugin-image-exif-orientation-BufhQyn4.js → filepond-plugin-image-exif-orientation-CN08NQm5.js} +1 -1
  121. package/dist/esm/{filepond-plugin-image-preview-xyGt-4PS.js → filepond-plugin-image-preview-HKD_HLA1.js} +1 -1
  122. package/dist/esm/{functions-BXvEy71U.js → functions-hYdCF4RE.js} +1 -1
  123. package/dist/esm/{index-D0jpoyIT.js → index-DMcU-3GG.js} +6 -6
  124. package/dist/esm/{index-BVmIkaqr.js → index-VfKYpHVb.js} +1 -1
  125. package/dist/esm/loader.js +3 -3
  126. package/dist/esm/salla-accordion-body_2.entry.js +1 -1
  127. package/dist/esm/salla-accordion_6.entry.js +1 -1
  128. package/dist/esm/salla-add-product-button_5.entry.js +1 -1
  129. package/dist/esm/salla-advertisement.entry.js +1 -1
  130. package/dist/esm/salla-alert_2.entry.js +1 -1
  131. package/dist/esm/salla-app-install-alert.entry.js +1 -1
  132. package/dist/esm/salla-apps-icons.entry.js +1 -1
  133. package/dist/esm/salla-badge.entry.js +1 -1
  134. package/dist/esm/salla-booking-field_7.entry.js +10 -10
  135. package/dist/esm/salla-bullet-delivery_2.entry.js +1 -1
  136. package/dist/esm/salla-cart-coupons.entry.js +1 -1
  137. package/dist/esm/salla-cart-item-offers_2.entry.js +1 -1
  138. package/dist/esm/salla-cashback-banner.entry.js +1 -1
  139. package/dist/esm/salla-comment-form_8.entry.js +1 -1
  140. package/dist/esm/salla-conditional-offer.entry.js +1 -1
  141. package/dist/esm/salla-contacts.entry.js +1 -1
  142. package/dist/esm/salla-cookies-bar.entry.js +1 -1
  143. package/dist/esm/salla-count-down.entry.js +1 -1
  144. package/dist/esm/salla-custom-fields.entry.js +1 -1
  145. package/dist/esm/salla-delivery-promise.entry.js +41 -35
  146. package/dist/esm/salla-edit-order-button.entry.js +1 -1
  147. package/dist/esm/salla-filters-widget.entry.js +1 -1
  148. package/dist/esm/salla-filters.entry.js +1 -1
  149. package/dist/esm/salla-fulfillment-methods.entry.js +1 -1
  150. package/dist/esm/salla-gifting.entry.js +1 -1
  151. package/dist/esm/salla-hook.entry.js +1 -1
  152. package/dist/esm/salla-infinite-scroll.entry.js +1 -1
  153. package/dist/esm/salla-installment.entry.js +1 -1
  154. package/dist/esm/salla-list-tile.entry.js +1 -1
  155. package/dist/esm/salla-localization-modal.entry.js +1 -1
  156. package/dist/esm/salla-login-modal.entry.js +1 -1
  157. package/dist/esm/salla-loyalty-banner.entry.js +2 -2
  158. package/dist/esm/salla-loyalty-hero_2.entry.js +2 -2
  159. package/dist/esm/salla-loyalty-panel.entry.js +3 -3
  160. package/dist/esm/salla-loyalty-points-banner.entry.js +1 -1
  161. package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
  162. package/dist/esm/salla-loyalty-program.entry.js +3 -3
  163. package/dist/esm/salla-loyalty-reward.entry.js +2 -2
  164. package/dist/esm/salla-loyalty.entry.js +1 -1
  165. package/dist/esm/salla-maintenance-alert.entry.js +1 -1
  166. package/dist/esm/salla-map.entry.js +1 -1
  167. package/dist/esm/salla-menu.entry.js +1 -1
  168. package/dist/esm/salla-metadata.entry.js +1 -1
  169. package/dist/esm/salla-multiple-bundle-product-cart_2.entry.js +247 -42
  170. package/dist/esm/salla-multiple-bundle-product-options-modal_2.entry.js +86 -25
  171. package/dist/esm/salla-multiple-bundle-product.entry.js +1 -1
  172. package/dist/esm/salla-next-order-coupon.entry.js +1 -1
  173. package/dist/esm/salla-notification-item.entry.js +1 -1
  174. package/dist/esm/salla-notifications.entry.js +1 -1
  175. package/dist/esm/salla-offer-modal.entry.js +1 -1
  176. package/dist/esm/salla-offer.entry.js +1 -1
  177. package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +1 -1
  178. package/dist/esm/salla-order-details-options.entry.js +1 -1
  179. package/dist/esm/salla-order-details.entry.js +1 -1
  180. package/dist/esm/salla-order-edit-item.entry.js +1 -1
  181. package/dist/esm/salla-order-edit-product-card.entry.js +1 -1
  182. package/dist/esm/salla-order-edit.entry.js +1 -1
  183. package/dist/esm/salla-order-summary.entry.js +1 -1
  184. package/dist/esm/salla-order-totals-card.entry.js +1 -1
  185. package/dist/esm/salla-orders.entry.js +1 -1
  186. package/dist/esm/salla-payments.entry.js +1 -1
  187. package/dist/esm/salla-placeholder.entry.js +1 -1
  188. package/dist/esm/salla-price-range.entry.js +1 -1
  189. package/dist/esm/salla-product-card-embed.entry.js +2 -2
  190. package/dist/esm/salla-product-card_2.entry.js +1 -1
  191. package/dist/esm/salla-product-size-guide.entry.js +1 -1
  192. package/dist/esm/salla-products-list.entry.js +1 -1
  193. package/dist/esm/salla-progress-bar.entry.js +1 -1
  194. package/dist/esm/salla-quick-order.entry.js +1 -1
  195. package/dist/esm/salla-rating-modal.entry.js +1 -1
  196. package/dist/esm/salla-reward-action_4.entry.js +3 -3
  197. package/dist/esm/salla-scopes.entry.js +1 -1
  198. package/dist/esm/salla-search.entry.js +1 -1
  199. package/dist/esm/salla-skeleton.entry.js +1 -1
  200. package/dist/esm/salla-slider.entry.js +1 -1
  201. package/dist/esm/salla-social-share.entry.js +1 -1
  202. package/dist/esm/salla-social.entry.js +1 -1
  203. package/dist/esm/salla-tab-content_3.entry.js +1 -1
  204. package/dist/esm/salla-tiered-offer.entry.js +48 -31
  205. package/dist/esm/salla-tooltip.entry.js +1 -1
  206. package/dist/esm/salla-trust-badges.entry.js +1 -1
  207. package/dist/esm/salla-user-menu.entry.js +1 -1
  208. package/dist/esm/salla-user-profile.entry.js +1 -1
  209. package/dist/esm/salla-user-settings.entry.js +1 -1
  210. package/dist/esm/salla-verify.entry.js +1 -1
  211. package/dist/esm/salla-wallet.entry.js +1 -1
  212. package/dist/esm/{tracked-promise-2BTc0cKI.js → tracked-promise-BSIJGUDO.js} +1 -1
  213. package/dist/esm/twilight.js +3 -3
  214. package/dist/esm/{vanilla-picker-DN-pQ4Fw.js → vanilla-picker-DKFizE1R.js} +1 -1
  215. package/dist/twilight/{p-eb352a06.entry.js → p-057303fc.entry.js} +1 -1
  216. package/dist/twilight/{p-bfe0be2b.entry.js → p-0da228bd.entry.js} +1 -1
  217. package/dist/twilight/{p-2ab53408.entry.js → p-0e7eded5.entry.js} +1 -1
  218. package/dist/twilight/p-1344cda3.entry.js +4 -0
  219. package/dist/twilight/{p-c207c587.entry.js → p-1694c751.entry.js} +1 -1
  220. package/dist/twilight/{p-5f7466cf.entry.js → p-169f09fe.entry.js} +1 -1
  221. package/dist/twilight/{p-228413fa.entry.js → p-180ecec6.entry.js} +1 -1
  222. package/dist/twilight/{p-f81452e9.entry.js → p-18788bb9.entry.js} +1 -1
  223. package/dist/twilight/{p-81985743.entry.js → p-21d225b0.entry.js} +1 -1
  224. package/dist/twilight/{p-fc3e6684.entry.js → p-255c1c94.entry.js} +1 -1
  225. package/dist/twilight/{p-378a7e72.entry.js → p-2813f52f.entry.js} +1 -1
  226. package/dist/twilight/{p-0fd165b9.entry.js → p-28312faf.entry.js} +1 -1
  227. package/dist/twilight/p-2a820928.entry.js +4 -0
  228. package/dist/twilight/{p-ef5d5f2a.entry.js → p-2da4174e.entry.js} +1 -1
  229. package/dist/twilight/{p-4a9379a1.entry.js → p-2fb7fda6.entry.js} +1 -1
  230. package/dist/twilight/{p-3c5b9e45.entry.js → p-31b6ab69.entry.js} +1 -1
  231. package/dist/twilight/{p-e2ebc898.entry.js → p-329e0ccf.entry.js} +1 -1
  232. package/dist/twilight/{p-3918f93c.entry.js → p-32b4986d.entry.js} +1 -1
  233. package/dist/twilight/{p-1567d3b0.entry.js → p-373ab9bb.entry.js} +1 -1
  234. package/dist/twilight/{p-c1823790.entry.js → p-37571489.entry.js} +1 -1
  235. package/dist/twilight/{p-79197700.entry.js → p-37871613.entry.js} +1 -1
  236. package/dist/twilight/p-399f5ab8.entry.js +4 -0
  237. package/dist/twilight/{p-adc138bc.entry.js → p-3f65d67b.entry.js} +1 -1
  238. package/dist/twilight/{p-4b6e6fb8.entry.js → p-4b837a59.entry.js} +1 -1
  239. package/dist/twilight/{p-083e5039.entry.js → p-52566485.entry.js} +1 -1
  240. package/dist/twilight/{p-ced32f4a.entry.js → p-53ff0bad.entry.js} +1 -1
  241. package/dist/twilight/{p-d9569632.entry.js → p-5afc64f0.entry.js} +1 -1
  242. package/dist/twilight/{p-0597375e.entry.js → p-5ee27511.entry.js} +1 -1
  243. package/dist/twilight/{p-3e5dbd96.entry.js → p-5f417c00.entry.js} +1 -1
  244. package/dist/twilight/{p-0831e5fc.entry.js → p-608cc0c1.entry.js} +1 -1
  245. package/dist/twilight/{p-0c174f16.entry.js → p-6bc527ce.entry.js} +1 -1
  246. package/dist/twilight/{p-078450b0.entry.js → p-6c3c2930.entry.js} +1 -1
  247. package/dist/twilight/{p-e59b3e07.entry.js → p-745a99a6.entry.js} +1 -1
  248. package/dist/twilight/{p-e58b7d20.entry.js → p-797fb657.entry.js} +1 -1
  249. package/dist/twilight/{p-12a6d03b.entry.js → p-81bc0869.entry.js} +1 -1
  250. package/dist/twilight/{p-5bd8ffe5.entry.js → p-85de11d2.entry.js} +1 -1
  251. package/dist/twilight/{p-3f52dc98.entry.js → p-8ad1aba2.entry.js} +1 -1
  252. package/dist/twilight/{p-68bcb0ba.entry.js → p-8d723a8b.entry.js} +1 -1
  253. package/dist/twilight/{p-631191d2.entry.js → p-8feebf4d.entry.js} +1 -1
  254. package/dist/twilight/{p-77f85461.entry.js → p-90e5db90.entry.js} +1 -1
  255. package/dist/twilight/{p-b73471d3.entry.js → p-939d986e.entry.js} +1 -1
  256. package/dist/twilight/{p-5b106fd4.entry.js → p-93f4a2b4.entry.js} +1 -1
  257. package/dist/twilight/{p-5eec5519.entry.js → p-94539039.entry.js} +1 -1
  258. package/dist/twilight/{p-567ba930.entry.js → p-9581bcc7.entry.js} +1 -1
  259. package/dist/twilight/{p-45708652.entry.js → p-9b3549cd.entry.js} +1 -1
  260. package/dist/twilight/{p-DIsyGRAw.js → p-B4668CGH.js} +1 -1
  261. package/dist/twilight/{p-B3k6Ab4H.js → p-BQ05LMoe.js} +1 -1
  262. package/dist/twilight/{p-DwV68ec-.js → p-BmFzQ6g-.js} +1 -1
  263. package/dist/twilight/{p-OK5pMKD1.js → p-BrqihLUh.js} +1 -1
  264. package/dist/twilight/{p-NBF3VaTJ.js → p-ByYVb96L.js} +1 -1
  265. package/dist/twilight/{p-KmhadCpx.js → p-CCQCS6cn.js} +1 -1
  266. package/dist/twilight/{p-xuGEmDhH.js → p-CI4TbxNl.js} +1 -1
  267. package/dist/twilight/{p-D0jpoyIT.js → p-DMcU-3GG.js} +1 -1
  268. package/dist/twilight/{p-DvcNoEfM.js → p-DwT-8WBr.js} +1 -1
  269. package/dist/twilight/{p-Cq8arVRH.js → p-Dz1v02Mc.js} +2 -2
  270. package/dist/twilight/{p-2dabb075.entry.js → p-a30cbec7.entry.js} +1 -1
  271. package/dist/twilight/{p-1ba82c7d.entry.js → p-abed2dbc.entry.js} +1 -1
  272. package/dist/twilight/{p-9c6752e6.entry.js → p-aca35083.entry.js} +1 -1
  273. package/dist/twilight/{p-d18400bb.entry.js → p-ad2a24ee.entry.js} +1 -1
  274. package/dist/twilight/{p-637168d2.entry.js → p-ad3e6082.entry.js} +1 -1
  275. package/dist/twilight/p-ad3ed8de.entry.js +4 -0
  276. package/dist/twilight/{p-b05ce2ee.entry.js → p-b0882f69.entry.js} +1 -1
  277. package/dist/twilight/{p-03718a72.entry.js → p-b0923292.entry.js} +1 -1
  278. package/dist/twilight/{p-2a511b8a.entry.js → p-b36b9c00.entry.js} +1 -1
  279. package/dist/twilight/{p-04e8106c.entry.js → p-b7aa5687.entry.js} +1 -1
  280. package/dist/twilight/{p-f42fa303.entry.js → p-b9064a54.entry.js} +1 -1
  281. package/dist/twilight/{p-e2ad8bc7.entry.js → p-b9fb7536.entry.js} +1 -1
  282. package/dist/twilight/{p-62c791c6.entry.js → p-bab4e280.entry.js} +1 -1
  283. package/dist/twilight/{p-eec8bdb1.entry.js → p-bd4140b1.entry.js} +1 -1
  284. package/dist/twilight/{p-d60ed03c.entry.js → p-bf500346.entry.js} +1 -1
  285. package/dist/twilight/{p-90afbf42.entry.js → p-c1ce3f7a.entry.js} +1 -1
  286. package/dist/twilight/{p-c05648b2.entry.js → p-c1e5b2f2.entry.js} +1 -1
  287. package/dist/twilight/{p-7bdb6aca.entry.js → p-c3c0ff5b.entry.js} +1 -1
  288. package/dist/twilight/{p-ebc0b840.entry.js → p-c7389707.entry.js} +1 -1
  289. package/dist/twilight/{p-1c53d114.entry.js → p-cbc8df12.entry.js} +1 -1
  290. package/dist/twilight/{p-fd7f2211.entry.js → p-d10bab5b.entry.js} +1 -1
  291. package/dist/twilight/{p-fadab0ac.entry.js → p-d65e45a0.entry.js} +1 -1
  292. package/dist/twilight/{p-ea80046d.entry.js → p-d7d262c3.entry.js} +1 -1
  293. package/dist/twilight/{p-33a52238.entry.js → p-da2f8e8b.entry.js} +1 -1
  294. package/dist/twilight/{p-b7e861b2.entry.js → p-da884485.entry.js} +1 -1
  295. package/dist/twilight/{p-5131149c.entry.js → p-db394617.entry.js} +1 -1
  296. package/dist/twilight/{p-2404e668.entry.js → p-dc2b82cb.entry.js} +1 -1
  297. package/dist/twilight/{p-afdddba9.entry.js → p-dd21610f.entry.js} +1 -1
  298. package/dist/twilight/{p-D-wessdE.js → p-dewEo579.js} +1 -1
  299. package/dist/twilight/{p-6073673e.entry.js → p-e1292b60.entry.js} +1 -1
  300. package/dist/twilight/{p-19ab0abc.entry.js → p-e3a7f1c8.entry.js} +1 -1
  301. package/dist/twilight/{p-9dc45b4d.entry.js → p-e7b5028b.entry.js} +1 -1
  302. package/dist/twilight/{p-baed03c3.entry.js → p-ec33a2ea.entry.js} +1 -1
  303. package/dist/twilight/{p-d44c5dcc.entry.js → p-ec8ddb7f.entry.js} +1 -1
  304. package/dist/twilight/{p-cd47fec2.entry.js → p-f0739410.entry.js} +1 -1
  305. package/dist/twilight/p-f39d6efd.entry.js +4 -0
  306. package/dist/twilight/{p-0adb148a.entry.js → p-f470779e.entry.js} +1 -1
  307. package/dist/twilight/{p-0bbf0061.entry.js → p-f4a6bf88.entry.js} +1 -1
  308. package/dist/twilight/{p-b0f25824.entry.js → p-f5019168.entry.js} +1 -1
  309. package/dist/twilight/{p-133aea32.entry.js → p-f59f94de.entry.js} +1 -1
  310. package/dist/twilight/{p-fa049325.entry.js → p-fc98c574.entry.js} +1 -1
  311. package/dist/twilight/{p-b44d2016.entry.js → p-fdf306f6.entry.js} +1 -1
  312. package/dist/twilight/p-ohGq8vKD.js +4 -0
  313. package/dist/twilight/twilight.esm.js +1 -1
  314. package/dist/types/components/salla-delivery-promise/delivery-promise-api.d.ts +1 -1
  315. package/dist/types/components/salla-delivery-promise/salla-delivery-promise.d.ts +6 -5
  316. package/dist/types/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-details.d.ts +20 -0
  317. package/dist/types/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-options-modal.d.ts +1 -0
  318. package/dist/types/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-slider.d.ts +9 -0
  319. package/dist/types/components/salla-multiple-bundle-product/interfaces.d.ts +1 -0
  320. package/dist/types/components/salla-tiered-offer/interfaces.d.ts +1 -0
  321. package/dist/types/components/salla-tiered-offer/salla-tiered-offer.d.ts +3 -0
  322. package/dist/types/components.d.ts +21 -0
  323. package/package.json +5 -5
  324. package/dist/twilight/p-4d21d259.entry.js +0 -4
  325. package/dist/twilight/p-COQaiMGv.js +0 -4
  326. package/dist/twilight/p-a0471050.entry.js +0 -4
  327. package/dist/twilight/p-b33c50dc.entry.js +0 -4
  328. package/dist/twilight/p-e4bb0633.entry.js +0 -4
  329. package/dist/twilight/p-eb53ef20.entry.js +0 -4
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { r as registerInstance, h, H as Host, a as getElement, F as Fragment } from './index-D0jpoyIT.js';
4
+ import { r as registerInstance, h, H as Host, a as getElement, F as Fragment } from './index-DMcU-3GG.js';
5
5
 
6
6
  const sallaMultipleBundleProductCartCss = "";
7
7
 
@@ -62,22 +62,37 @@ const SallaMultipleBundleProductDetails = class {
62
62
  this.productSelectedHandler = null;
63
63
  // handle selecting a product (toggle)
64
64
  this.onSelectProduct = (sectionId, product) => {
65
+ const productId = product.id;
66
+ const wasSelected = this.selectedProducts[sectionId]?.has(productId) ?? false;
67
+ const section = this.sections.find(s => s.id == sectionId);
68
+ if (wasSelected && section && this.isProductSelectionLocked(section)) {
69
+ return;
70
+ }
71
+ if (!wasSelected) {
72
+ if (!section) {
73
+ return;
74
+ }
75
+ if (this.getEffectiveMax(section) !== 1 && this.isAtSelectionLimit(section)) {
76
+ return;
77
+ }
78
+ }
65
79
  this.selectedProducts = {
66
80
  ...this.selectedProducts,
67
81
  [sectionId]: new Set(this.selectedProducts[sectionId] || []),
68
82
  };
69
- const productId = product.id;
70
- const wasSelected = this.selectedProducts[sectionId].has(productId);
71
83
  if (wasSelected) {
72
- // Product is being deselected
73
84
  this.selectedProducts[sectionId].delete(productId);
74
- // Clear form data and modal options for this product in this specific section
75
85
  this.clearProductFormData(productId, sectionId);
76
86
  this.clearProductModalOptions(productId, sectionId);
77
87
  }
78
88
  else {
79
- // Product is being selected
80
- this.selectedProducts[sectionId].add(productId);
89
+ const effectiveMax = this.getEffectiveMax(section);
90
+ if (effectiveMax === 1) {
91
+ this.syncSectionSelection(sectionId, productId);
92
+ }
93
+ else {
94
+ this.selectedProducts[sectionId].add(productId);
95
+ }
81
96
  }
82
97
  // force re-render
83
98
  this.selectedProducts = { ...this.selectedProducts };
@@ -97,31 +112,45 @@ const SallaMultipleBundleProductDetails = class {
97
112
  [sectionId]: new Set(this.selectedProducts[sectionId] || []),
98
113
  };
99
114
  const productId = product.id;
100
- // Only add if not already selected
101
- if (!this.selectedProducts[sectionId].has(productId)) {
115
+ if (this.selectedProducts[sectionId].has(productId)) {
116
+ return;
117
+ }
118
+ const section = this.sections.find(s => s.id == sectionId);
119
+ if (!section) {
120
+ return;
121
+ }
122
+ const effectiveMax = this.getEffectiveMax(section);
123
+ if (effectiveMax === 1) {
124
+ this.syncSectionSelection(sectionId, productId);
125
+ }
126
+ else if (effectiveMax > 1 && this.isAtSelectionLimit(section)) {
127
+ return;
128
+ }
129
+ else {
102
130
  this.selectedProducts[sectionId].add(productId);
103
- // force re-render
104
- this.selectedProducts = { ...this.selectedProducts };
105
- // dispatch event
106
- salla.event.dispatch('on-bundle-product-selected', {
107
- id: product.id,
108
- name: product.name,
109
- options: product.options,
110
- });
111
131
  }
132
+ this.selectedProducts = { ...this.selectedProducts };
133
+ salla.event.dispatch('on-bundle-product-selected', {
134
+ id: product.id,
135
+ name: product.name,
136
+ options: product.options,
137
+ });
112
138
  };
113
139
  // open product options modal
114
140
  this.onSelectProductOptions = (product, sectionId) => {
115
- // Find the section index from the sectionId
116
- const sectionIndex = this.sections.findIndex(section => section.id == sectionId);
117
- // Find the product index within the section
118
- const section = this.sections.find(section => section.id == sectionId);
119
- const productIndex = section?.products?.findIndex(p => p.id == product.id) ?? 0;
141
+ const section = this.sections.find(s => s.id == sectionId);
142
+ if (!section || !this.canSelectProductInSection(section, product.id)) {
143
+ return;
144
+ }
145
+ const sectionIndex = this.sections.findIndex(s => s.id == sectionId);
146
+ const productIndex = section.products?.findIndex(p => p.id == product.id) ?? 0;
147
+ const isProductAlreadySelected = this.selectedProducts[sectionId]?.has(product.id) ?? false;
120
148
  salla.event.dispatch('multiple-bundle-product-modal::open', {
121
149
  product,
122
150
  sectionId,
123
151
  sectionIndex,
124
152
  productIndex,
153
+ isProductAlreadySelected,
125
154
  });
126
155
  };
127
156
  // Event handlers for bundle slider component
@@ -134,22 +163,164 @@ const SallaMultipleBundleProductDetails = class {
134
163
  this.onSelectProductOptions(product, sectionId);
135
164
  };
136
165
  }
166
+ isSingleProductSection(section) {
167
+ return (section.products?.length ?? 0) === 1;
168
+ }
169
+ getObligatoryMin(section) {
170
+ const min = section.obligatory_products;
171
+ if (min == null) {
172
+ return 0;
173
+ }
174
+ const numericMin = Number(min);
175
+ return Number.isNaN(numericMin) ? 0 : numericMin;
176
+ }
177
+ isProductSelectionLocked(section) {
178
+ return this.isSingleProductSection(section) && this.getObligatoryMin(section) === 1;
179
+ }
180
+ /** Empty max → cap is the number of products in the section. */
181
+ getEffectiveMax(section) {
182
+ const productCount = section.products?.length ?? 0;
183
+ const max = section.max_obligatory_products;
184
+ if (max != null && max > 0) {
185
+ return Math.min(max, productCount);
186
+ }
187
+ return productCount;
188
+ }
189
+ getSelectedCount(sectionId) {
190
+ return this.selectedProducts[sectionId]?.size ?? 0;
191
+ }
192
+ isAtSelectionLimit(section) {
193
+ return this.getSelectedCount(section.id) >= this.getEffectiveMax(section);
194
+ }
195
+ canSelectProductInSection(section, productId) {
196
+ if (this.selectedProducts[section.id]?.has(productId)) {
197
+ return true;
198
+ }
199
+ if (this.getEffectiveMax(section) === 1) {
200
+ return true;
201
+ }
202
+ return !this.isAtSelectionLimit(section);
203
+ }
204
+ async canSelectBundleProduct(sectionId, productId) {
205
+ const section = this.sections.find(s => s.id == sectionId);
206
+ if (!section) {
207
+ return false;
208
+ }
209
+ return this.canSelectProductInSection(section, productId);
210
+ }
211
+ queryProductCheckbox(sectionId, productIndex) {
212
+ const selector = `input.s-multiple-bundle-product-checkbox[name="bundle[${sectionId}][${productIndex}][id]"]`;
213
+ const form = this.host.closest('form');
214
+ const fromForm = form?.querySelector(selector);
215
+ if (fromForm) {
216
+ return fromForm;
217
+ }
218
+ for (const slider of this.host.querySelectorAll('salla-multiple-bundle-product-slider')) {
219
+ const root = slider.shadowRoot ?? slider;
220
+ const input = root.querySelector(selector);
221
+ if (input) {
222
+ return input;
223
+ }
224
+ }
225
+ return null;
226
+ }
227
+ dispatchBubblingChange(target) {
228
+ requestAnimationFrame(() => {
229
+ target.dispatchEvent(new window.Event('change', { bubbles: true }));
230
+ });
231
+ }
232
+ /** Uncheck checkbox, remove form inputs, and reset modal state for one product slot. */
233
+ clearSectionProductSlot(sectionId, productId, productIndex) {
234
+ const checkbox = this.queryProductCheckbox(sectionId, productIndex);
235
+ if (checkbox) {
236
+ checkbox.checked = false;
237
+ }
238
+ const form = this.host.closest('form');
239
+ if (form) {
240
+ const slotPrefix = `bundle[${sectionId}][${productIndex}]`;
241
+ Array.from(form.querySelectorAll('input')).forEach((input) => {
242
+ const inSlot = input.name?.startsWith(slotPrefix) ?? false;
243
+ if (!inSlot) {
244
+ return;
245
+ }
246
+ if (input.type === 'checkbox' && input.name?.endsWith('][id]')) {
247
+ input.checked = false;
248
+ return;
249
+ }
250
+ input.remove();
251
+ });
252
+ }
253
+ this.clearProductModalOptions(productId, sectionId);
254
+ }
255
+ /** max=1: replace section selection and keep DOM/form in sync. */
256
+ syncSectionSelection(sectionId, productId) {
257
+ const section = this.sections.find(s => s.id == sectionId);
258
+ section?.products?.forEach((product, productIndex) => {
259
+ if (product.id != productId) {
260
+ this.clearSectionProductSlot(sectionId, product.id, productIndex);
261
+ }
262
+ });
263
+ this.selectedProducts[sectionId] = new Set([productId]);
264
+ const selectedIndex = section?.products?.findIndex(p => p.id == productId) ?? -1;
265
+ const checkbox = selectedIndex >= 0 ? this.queryProductCheckbox(sectionId, selectedIndex) : null;
266
+ if (checkbox) {
267
+ checkbox.checked = true;
268
+ this.dispatchBubblingChange(checkbox);
269
+ }
270
+ }
271
+ autoSelectSingleProductSections() {
272
+ if (!this.sections?.length) {
273
+ return;
274
+ }
275
+ const newSelectedProducts = { ...this.selectedProducts };
276
+ let updated = false;
277
+ const selectedEvents = [];
278
+ for (const section of this.sections) {
279
+ if (!this.isProductSelectionLocked(section)) {
280
+ continue;
281
+ }
282
+ const product = section.products?.[0];
283
+ if (!product || (!product.unlimited_quantity && (product.quantity ?? 0) <= 0)) {
284
+ continue;
285
+ }
286
+ const sectionId = section.id;
287
+ const currentSet = new Set(newSelectedProducts[sectionId] || []);
288
+ if (currentSet.has(product.id)) {
289
+ continue;
290
+ }
291
+ currentSet.add(product.id);
292
+ newSelectedProducts[sectionId] = currentSet;
293
+ updated = true;
294
+ selectedEvents.push({ product });
295
+ }
296
+ if (!updated) {
297
+ return;
298
+ }
299
+ this.selectedProducts = newSelectedProducts;
300
+ selectedEvents.forEach(({ product }) => {
301
+ salla.event.dispatch('on-bundle-product-selected', {
302
+ id: product.id,
303
+ name: product.name,
304
+ options: product.options,
305
+ });
306
+ });
307
+ }
137
308
  // Clear form data for a specific product in specific section
138
309
  clearProductFormData(productId, sectionId) {
139
- const form = this.host.closest('form');
140
- if (sectionId) {
141
- // Remove inputs for specific section/productIndex combination
142
- const productInputPattern = `bundle[${sectionId}][`;
143
- const inputsToRemove = Array.from(form.querySelectorAll('input')).filter((input) => input.getAttribute('data-product-id') === String(productId) &&
144
- input.name &&
145
- input.name.startsWith(productInputPattern));
146
- inputsToRemove.forEach(input => input.remove());
310
+ if (sectionId != null) {
311
+ const section = this.sections.find(s => s.id == sectionId);
312
+ const productIndex = section?.products?.findIndex(product => product.id == productId) ?? -1;
313
+ if (productIndex >= 0) {
314
+ this.clearSectionProductSlot(sectionId, productId, productIndex);
315
+ return;
316
+ }
147
317
  }
148
- else {
149
- // Fallback: Remove all hidden inputs related to this product (legacy behavior)
150
- const inputsToRemove = form.querySelectorAll(`[data-product-id="${productId}"]`);
151
- inputsToRemove.forEach(input => input.remove());
318
+ const form = this.host.closest('form');
319
+ if (!form) {
320
+ return;
152
321
  }
322
+ const inputsToRemove = form.querySelectorAll(`[data-product-id="${productId}"]`);
323
+ inputsToRemove.forEach(input => input.remove());
153
324
  }
154
325
  // Clear modal options state for a specific product
155
326
  clearProductModalOptions(productId, sectionId) {
@@ -173,10 +344,42 @@ const SallaMultipleBundleProductDetails = class {
173
344
  productIndex,
174
345
  });
175
346
  }
176
- renderAccordionHeader(section, selectedCount) {
177
- return (h(Fragment, null, h("h2", { slot: "title" }, section?.name), section?.obligatory_products ? (h("span", { slot: "note" }, salla.lang.get('pages.products.obligatory_products', {
178
- count: section?.obligatory_products || 0,
179
- }))) : '', h("span", { slot: "progress" }, selectedCount, "/", section?.products?.length || 0)));
347
+ getProgressStatus(section) {
348
+ const selectedCount = this.getSelectedCount(section.id);
349
+ const effectiveMax = this.getEffectiveMax(section);
350
+ if (effectiveMax > 0) {
351
+ return `${selectedCount}/${effectiveMax}`;
352
+ }
353
+ return '0';
354
+ }
355
+ getSectionSelectionNote(section) {
356
+ const min = this.getObligatoryMin(section);
357
+ const max = Number(section.max_obligatory_products) || 0;
358
+ const hasMin = min > 0;
359
+ const hasMax = max > 0;
360
+ if (!hasMin && !hasMax) {
361
+ return null;
362
+ }
363
+ if (hasMin && hasMax) {
364
+ if (min === max) {
365
+ return salla.lang.getWithDefault('pages.products.bundle_select_exact', `اختر ${min} منتجات`, { count: min });
366
+ }
367
+ return salla.lang.getWithDefault('pages.products.bundle_select_range', `اختر من ${min} إلى ${max} منتجات`, { min, max });
368
+ }
369
+ if (hasMin) {
370
+ return salla.lang.getWithDefault('pages.products.bundle_select_min', `اختر على الأقل ${min} منتجات`, { min });
371
+ }
372
+ return salla.lang.getWithDefault('pages.products.bundle_select_max', `اختر حتى ${max} منتجات`, { max });
373
+ }
374
+ handleSectionsChange() {
375
+ this.autoSelectSingleProductSections();
376
+ }
377
+ componentWillLoad() {
378
+ this.autoSelectSingleProductSections();
379
+ }
380
+ renderAccordionHeader(section) {
381
+ const selectionNote = this.getSectionSelectionNote(section);
382
+ return (h(Fragment, null, h("h2", { slot: "title" }, section?.name), selectionNote ? h("span", { slot: "note" }, selectionNote) : null, h("span", { slot: "progress" }, this.getProgressStatus(section))));
180
383
  }
181
384
  componentDidLoad() {
182
385
  // Listen for product selected event from modal
@@ -207,12 +410,14 @@ const SallaMultipleBundleProductDetails = class {
207
410
  }
208
411
  }
209
412
  render() {
210
- return (h(Host, { key: '27a3d6baa97585e983db19522ab2981ecc9e50f1', class: "s-multiple-bundle-product-wrapper" }, h("div", { key: 'c96cf52dfaee161a03a6bf97de267d9942a47a49', class: "s-multiple-bundle-product-wrapper-sections" }, this.sections.map((section, index) => {
211
- const selectedCount = this.selectedProducts[section.id]?.size || 0;
212
- return (h("salla-accordion", { key: section.id, collapsed: index === 0 ? false : true }, h("salla-accordion-head", null, this.renderAccordionHeader(section, selectedCount)), h("salla-accordion-body", null, h("salla-multiple-bundle-product-slider", { section: section, sectionIndex: index, selectedProducts: this.selectedProducts, onProductSelected: this.handleBundleSliderProductSelected, onProductOptionsSelected: this.handleBundleSliderProductOptionsSelected }))));
213
- })), h("salla-multiple-bundle-product-options-modal", { key: '6627ee4f67bcd775b16e470dd4735848e6087fd4' })));
413
+ return (h(Host, { key: '74b123c432e77263cf0ddcf20ab742885c54d5f4', class: "s-multiple-bundle-product-wrapper" }, h("div", { key: '24bef0958a2a7d29bb4485eac08c7e6b8614a00d', class: "s-multiple-bundle-product-wrapper-sections" }, this.sections.map((section, index) => {
414
+ return (h("salla-accordion", { key: section.id, collapsed: index === 0 ? false : true }, h("salla-accordion-head", null, this.renderAccordionHeader(section)), h("salla-accordion-body", null, h("salla-multiple-bundle-product-slider", { section: section, sectionIndex: index, selectedProducts: this.selectedProducts, selectionLimit: this.getEffectiveMax(section), isSelectionLocked: this.isProductSelectionLocked(section), onProductSelected: this.handleBundleSliderProductSelected, onProductOptionsSelected: this.handleBundleSliderProductOptionsSelected }))));
415
+ })), h("salla-multiple-bundle-product-options-modal", { key: '556b4e51a4b79dfc00371a07296556fb74111524' })));
214
416
  }
215
417
  get host() { return getElement(this); }
418
+ static get watchers() { return {
419
+ "sections": ["handleSectionsChange"]
420
+ }; }
216
421
  };
217
422
  SallaMultipleBundleProductDetails.style = sallaMultipleBundleProductDetailsCss;
218
423
 
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { r as registerInstance, c as createEvent, h, H as Host, a as getElement } from './index-D0jpoyIT.js';
4
+ import { r as registerInstance, c as createEvent, h, H as Host, a as getElement } from './index-DMcU-3GG.js';
5
5
  import { A as ArrowLeftIcon, a as ArrowRightIcon } from './keyboard_arrow_right-Vqpj4CWE.js';
6
6
 
7
7
  const sallaMultipleBundleProductOptionsModalCss = ":host{display:block}";
@@ -20,6 +20,7 @@ const SallaMultipleBundleProductOptionsModal = class {
20
20
  this.isLoading = false;
21
21
  this.hasUnsavedChanges = false;
22
22
  this.validationErrors = [];
23
+ this.isProductAlreadySelected = false;
23
24
  }
24
25
  /**
25
26
  * Generate a unique cache key for selected options using section ID, product index, and product ID
@@ -81,6 +82,7 @@ const SallaMultipleBundleProductOptionsModal = class {
81
82
  this.sectionId = data.sectionId || null;
82
83
  this.sectionIndex = data.sectionIndex || 0;
83
84
  this.productIndex = data.productIndex || 0;
85
+ this.isProductAlreadySelected = !!data.isProductAlreadySelected;
84
86
  this.open();
85
87
  };
86
88
  salla.event.on('multiple-bundle-product-modal::open', this.modalOpenListener);
@@ -111,6 +113,10 @@ const SallaMultipleBundleProductOptionsModal = class {
111
113
  // Extract section info from the checkbox name: bundle[sectionId][productIndex][id]
112
114
  const nameMatch = target.name.match(/^bundle\[([^\]]+)\]\[([^\]]+)\]\[id\]$/);
113
115
  if (nameMatch && !target.checked) {
116
+ if (target.getAttribute('data-selection-locked') === 'true') {
117
+ target.checked = true;
118
+ return;
119
+ }
114
120
  const [, sectionId, productIndex] = nameMatch;
115
121
  const productId = target.value;
116
122
  const form = this.host.closest('form');
@@ -349,6 +355,14 @@ const SallaMultipleBundleProductOptionsModal = class {
349
355
  salla.notify.error(this.validationErrors.join(', '));
350
356
  return;
351
357
  }
358
+ if (!this.isProductAlreadySelected && this.sectionId != null) {
359
+ const details = this.host.closest('salla-multiple-bundle-product-details');
360
+ const canSelect = await details?.canSelectBundleProduct(this.sectionId, productId);
361
+ if (!canSelect) {
362
+ salla.notify.error(salla.lang.getWithDefault('pages.products.bundle_selection_limit_reached', 'لا يمكنك اختيار المزيد من المنتجات في هذا القسم'));
363
+ return;
364
+ }
365
+ }
352
366
  this.isLoading = true;
353
367
  try {
354
368
  // please don't change this with this.host.querySelector it will return null
@@ -465,7 +479,7 @@ const SallaMultipleBundleProductOptionsModal = class {
465
479
  const cacheKey = this.generateCacheKey(this.sectionId, this.productIndex, productId);
466
480
  const resetToken = this.optionsResetTokens[cacheKey] || 0;
467
481
  const isDisabled = this.isLoading || optionsWithSelectedState.some(opt => opt.details.some(d => d.is_selected && d.is_out === true));
468
- return (h(Host, { key: 'd9dc4018798fe902048f3e3e37fcb2edf84713b0' }, h("salla-modal", { key: 'af3cc56a9c2c969dc0cbb2b4caba14fd270a11bb', isLoading: this.isLoading, ref: el => (this.modal = el), width: "md", centered: false, id: `s-multiple-bundle-product-options-modal-options-${productId}`, class: "s-multiple-bundle-product-options-modal-wrapper" }, h("div", { key: '10fcc08be35bfd4231f9cf48501614ae49a985a3', slot: "loading" }, h("salla-skeleton", { key: '1aee9616e4f05188067708506352b0d97d504696', height: "100%", width: "100%" })), this.product?.images && this.product?.images.length > 0 && (h("salla-slider", { key: 'a7d7a459d383c353b5ef716365ba0a0ac5d3a0b7', id: `details-slider-${this.product?.id}`, type: "thumbs", loop: false, "auto-height": true, "listen-to-thumbnails-option": true, showThumbsControls: false, controlsOuter: false, showControls: false, class: "s-multiple-bundle-product-options-modal-slider", verticalThumbs: true, thumbsConfig: {
482
+ return (h(Host, { key: '6c1d1d3911867e30240676f3e2b7353e9ecf76c3' }, h("salla-modal", { key: 'b02110d80cd422d64962d78812ae0b0637c56237', isLoading: this.isLoading, ref: el => (this.modal = el), width: "md", centered: false, id: `s-multiple-bundle-product-options-modal-options-${productId}`, class: "s-multiple-bundle-product-options-modal-wrapper" }, h("div", { key: '20a52bbc732c6edfffde86577e99bbe300a1a4c8', slot: "loading" }, h("salla-skeleton", { key: '3a69fc75939d8b8f8639983d0f2f8dd8bf961152', height: "100%", width: "100%" })), this.product?.images && this.product?.images.length > 0 && (h("salla-slider", { key: '185639c54f79188093df98ac1cece1958879f71d', id: `details-slider-${this.product?.id}`, type: "thumbs", loop: false, "auto-height": true, "listen-to-thumbnails-option": true, showThumbsControls: false, controlsOuter: false, showControls: false, class: "s-multiple-bundle-product-options-modal-slider", verticalThumbs: true, thumbsConfig: {
469
483
  centeredSlides: true,
470
484
  centeredSlidesBounds: true,
471
485
  slidesPerView: Math.min(5, Math.max(1, this.product?.images.length)),
@@ -473,13 +487,13 @@ const SallaMultipleBundleProductOptionsModal = class {
473
487
  watchSlidesProgress: true,
474
488
  direction: 'vertical',
475
489
  spaceBetween: 10,
476
- } }, h("div", { key: '11970032bdc37e5d20d6737e3109fcec9b4de4cb', slot: "items" }, this.product?.images &&
490
+ } }, h("div", { key: '3b6a88fe3862870d674dadc31967df6cc8fac365', slot: "items" }, this.product?.images &&
477
491
  this.product?.images.map((image, index) => (h("div", { key: index, class: "swiper-slide" }, h("img", { src: image.url, alt: image.alt || `${this.product?.name} - Image ${index + 1}`, loading: "lazy", onError: e => {
478
492
  e.target.style.display = 'none';
479
- } }))))), this.product?.images && this.product?.images.length > 1 && (h("div", { key: 'c7d0fd432d8449e4742f0686ddecb7e87bebf159', slot: "thumbs" }, this.product?.images &&
493
+ } }))))), this.product?.images && this.product?.images.length > 1 && (h("div", { key: '6fce48b5b035cc61866aaf6c339866fa2314be87', slot: "thumbs" }, this.product?.images &&
480
494
  this.product?.images.map((image, index) => (h("div", { key: index, "data-caption": `${this.product?.name} - Image ${index + 1}` }, h("img", { src: image.url, loading: "eager", class: "s-multiple-bundle-product-options-modal-slider-thumb", title: `${this.product?.name} - ${index + 1}`, alt: image.alt || `${this.product?.name} - ${index + 1}`, onError: e => {
481
495
  e.target.style.display = 'none';
482
- } })))))))), h("salla-product-options", { options: JSON.stringify(optionsWithSelectedState), key: `${cacheKey}-reset-${resetToken}`, "product-id": productId, "unique-key": `${cacheKey}-reset-${resetToken}` }), h("div", { key: 'c9b5f53696d9f8800e3a6be31ec78b51f0cb9bb1', slot: "footer" }, h("div", { key: 'e972370006feae6c17797f54c415ef0d2aaa3f57', class: "s-multiple-bundle-product-options-modal-footer" }, h("salla-button", { key: '7a3787936eec6c0c8a69a64799af5595f51909f9', onClick: e => this.onSave(e), loading: this.isLoading, disabled: isDisabled }, this.isLoading
496
+ } })))))))), h("salla-product-options", { options: JSON.stringify(optionsWithSelectedState), key: `${cacheKey}-reset-${resetToken}`, "product-id": productId, "unique-key": `${cacheKey}-reset-${resetToken}` }), h("div", { key: '3d555ea40fe5d9f3685fc6dafa4b6fad16732091', slot: "footer" }, h("div", { key: '1b4c6834899efbd09f3ea1db251999f50ec655b2', class: "s-multiple-bundle-product-options-modal-footer" }, h("salla-button", { key: '0818a75a444cca510c7f0cfea2ec53414c12db53', onClick: e => this.onSave(e), loading: this.isLoading, disabled: isDisabled }, this.isLoading
483
497
  ? salla.lang.get('common.elements.saving')
484
498
  : salla.lang.get('common.elements.save')))))));
485
499
  }
@@ -499,39 +513,71 @@ const SallaMultipleBundleProductSlider = class {
499
513
  this.productOptionsSelected = createEvent(this, "productOptionsSelected");
500
514
  /** A dictionary tracking which product IDs are currently selected per section. */
501
515
  this.selectedProducts = {};
516
+ /** When true, the selected product cannot be deselected (single-product section with min = 1). */
517
+ this.isSelectionLocked = false;
518
+ /** Maximum selectable products for this section (empty max → all products in section). */
519
+ this.selectionLimit = 0;
502
520
  this.savedOptionsByInstance = {};
503
521
  this.handleProductClick = (product, productIndex) => {
504
- // Find the checkbox input for this product
505
- const checkboxId = this.generateEventName(this.section.id, productIndex);
506
- const checkbox = document.getElementById(checkboxId);
507
- if (!checkbox)
508
- return;
509
- if (checkbox) {
510
- const willBeChecked = !checkbox.checked;
511
- if (!willBeChecked) {
512
- this.dispatchClearOptionsEvent(product, productIndex);
513
- this.clearSavedOptionsState(this.section.id, productIndex);
522
+ const isChecked = this.selectedProducts[this.section.id]?.has(product.id) || false;
523
+ const checkbox = this.getCheckbox(this.section.id, productIndex);
524
+ if (isChecked && this.isSelectionLocked) {
525
+ if (checkbox) {
526
+ checkbox.checked = true;
514
527
  }
515
- // Toggle the checkbox state
516
- checkbox.checked = willBeChecked;
517
- // Dispatch a change event to trigger form validation/submission
518
- requestAnimationFrame(() => {
519
- const changeEvent = new window.Event('change', { bubbles: true });
520
- checkbox.dispatchEvent(changeEvent);
528
+ return;
529
+ }
530
+ if (!isChecked && this.isMaxSelectionReached() && this.selectionLimit !== 1) {
531
+ return;
532
+ }
533
+ // max = 1: parent replaces selection and syncs all checkboxes in the section
534
+ if (this.selectionLimit === 1 && !isChecked) {
535
+ this.productSelected.emit({
536
+ product,
537
+ sectionId: this.section.id,
521
538
  });
539
+ return;
540
+ }
541
+ if (!checkbox)
542
+ return;
543
+ const willBeChecked = !checkbox.checked;
544
+ if (!willBeChecked) {
545
+ this.dispatchClearOptionsEvent(product, productIndex);
546
+ this.clearSavedOptionsState(this.section.id, productIndex);
522
547
  }
548
+ checkbox.checked = willBeChecked;
549
+ requestAnimationFrame(() => {
550
+ const changeEvent = new window.Event('change', { bubbles: true });
551
+ checkbox.dispatchEvent(changeEvent);
552
+ });
523
553
  this.productSelected.emit({
524
554
  product,
525
555
  sectionId: this.section.id,
526
556
  });
527
557
  };
528
558
  this.handleOptionsClick = (product) => {
559
+ const isChecked = this.selectedProducts[this.section.id]?.has(product.id) || false;
560
+ if (!isChecked && this.isMaxSelectionReached() && this.selectionLimit !== 1) {
561
+ return;
562
+ }
529
563
  this.productOptionsSelected.emit({
530
564
  product,
531
565
  sectionId: this.section.id,
532
566
  });
533
567
  };
534
568
  }
569
+ getSelectedCount() {
570
+ return this.selectedProducts[this.section?.id]?.size ?? 0;
571
+ }
572
+ isMaxSelectionReached() {
573
+ return this.selectionLimit > 1 && this.getSelectedCount() >= this.selectionLimit;
574
+ }
575
+ isProductSelectionDisabled(product, isChecked) {
576
+ if (product.quantity === 0) {
577
+ return true;
578
+ }
579
+ return !isChecked && this.isMaxSelectionReached();
580
+ }
535
581
  getProductInstanceKey(sectionId, productIndex) {
536
582
  return `${sectionId}::${productIndex}`;
537
583
  }
@@ -577,9 +623,26 @@ const SallaMultipleBundleProductSlider = class {
577
623
  generateEventName(sectionId, productIndex) {
578
624
  return `bundle[${sectionId}][${productIndex}][id]`;
579
625
  }
626
+ getCheckbox(sectionId, productIndex) {
627
+ const name = this.generateEventName(sectionId, productIndex);
628
+ return this.host.querySelector(`input.s-multiple-bundle-product-checkbox[name="${name}"]`);
629
+ }
630
+ preventLockedDeselect(event, isChecked) {
631
+ if (!this.isSelectionLocked || !isChecked) {
632
+ return;
633
+ }
634
+ event.preventDefault();
635
+ event.stopPropagation();
636
+ const checkbox = event.target;
637
+ if (checkbox?.type === 'checkbox') {
638
+ checkbox.checked = true;
639
+ }
640
+ }
580
641
  render() {
581
- return (h(Host, { key: 'ecdac4638007d9435ec8b06f32114a0dada03b86' }, h("salla-slider", { key: 'c245e7dcfd157908063fd5ec13c6d49f8862dd18', type: "carousel", controlsOuter: false, showControls: false, id: `accordion-multiple-bundle-product-${this.section.id}`, pagination: true, class: "s-multiple-bundle-product-wrapper-slider", sliderConfig: { spaceBetween: 0 } }, h("div", { key: '17bdd6def2ff6f1d2ad22fa8b5299fc0000b1e82', slot: "items" }, this?.section?.products?.map((product, productIndex) => {
642
+ return (h(Host, { key: 'd52eb26454606df2526fa4c086110a54f7466644' }, h("salla-slider", { key: '1aa1fce5943c3721a8e4f762171c864d9097bb28', type: "carousel", controlsOuter: false, showControls: false, id: `accordion-multiple-bundle-product-${this.section.id}`, pagination: true, class: "s-multiple-bundle-product-wrapper-slider", sliderConfig: { spaceBetween: 0 } }, h("div", { key: '9342381bc43389bae48b906a1ab23a4f3cf8d00a', slot: "items" }, this?.section?.products?.map((product, productIndex) => {
582
643
  const isChecked = this.selectedProducts[this.section.id]?.has(product.id) || false;
644
+ const isLocked = isChecked && this.isSelectionLocked;
645
+ const isDisabled = this.isProductSelectionDisabled(product, isChecked);
583
646
  const hasSavedOptions = this.savedOptionsByInstance[this.getProductInstanceKey(this.section.id, productIndex)];
584
647
  const optionsButtonLabel = hasSavedOptions
585
648
  ? salla.lang.getWithDefault('pages.products.edit_selected_options', 'تعديل الخيارات')
@@ -587,9 +650,7 @@ const SallaMultipleBundleProductSlider = class {
587
650
  let optionsArrowIcon = salla.config.get('theme.is_rtl', true)
588
651
  ? ArrowLeftIcon
589
652
  : ArrowRightIcon;
590
- return (h("div", { class: `s-multiple-bundle-product-slide-one-third ${product.quantity == 0
591
- ? 's-multiple-bundle-product-slide-one-third-disabled'
592
- : ''}`, key: product.id }, h("div", { class: "s-multiple-bundle-product-card" }, h("div", { class: "s-multiple-bundle-product-image-wrapper", onClick: () => this.handleProductClick(product, productIndex) }, h("input", { id: this.generateEventName(this.section.id, productIndex), type: "checkbox", class: "s-multiple-bundle-product-checkbox", checked: isChecked, name: this.generateEventName(this.section.id, productIndex), value: product.id }), h("img", { src: product.image.url || salla.url.cdn('images/s-empty.png'), loading: "lazy", alt: product.image.alt || product.name, class: "s-multiple-bundle-product-image" })), h("div", { class: "s-multiple-bundle-product-content-wrapper" }, h("div", { class: "s-multiple-bundle-product-content" }, h("div", { class: "s-multiple-bundle-product-details" }, h("div", { class: "s-multiple-bundle-product-title-wrapper" }, h("h2", { class: "s-multiple-bundle-product-title" }, h("a", { href: product?.url || '#', target: "_blank", rel: "noopener noreferrer" }, product.name))), h("div", { class: "s-multiple-bundle-product-price-wrapper" }, h("span", { class: "s-multiple-bundle-product-price" }, h("span", { innerHTML: salla.money(product.price) })), product.sale_price > 0 && (h("span", { class: "s-multiple-bundle-product-price-discount" }, h("span", { innerHTML: salla.money(product.regular_price) }))))), product.quantity_in_group > 0 && product.quantity !== 0 && (h("span", { class: "s-multiple-bundle-product-badge" }, salla.lang.get('pages.products.pieces'), h("span", null, product.quantity_in_group))), product.quantity === 0 && (h("span", { class: "s-multiple-bundle-product-badge" }, salla.lang.get('pages.products.quantity_in_group_finished')))), product.options?.length > 0 && (h("button", { class: "s-multiple-bundle-product-button", onClick: () => this.handleOptionsClick(product), type: "button" }, optionsButtonLabel, h("span", { class: "s-multiple-bundle-product-button-icon", innerHTML: optionsArrowIcon })))))));
653
+ return (h("div", { class: `s-multiple-bundle-product-slide-one-third${isDisabled ? ' s-multiple-bundle-product-slide-one-third-disabled' : ''}`, key: product.id }, h("div", { class: "s-multiple-bundle-product-card" }, h("div", { class: "s-multiple-bundle-product-image-wrapper", onClick: () => this.handleProductClick(product, productIndex) }, h("input", { id: this.generateEventName(this.section.id, productIndex), type: "checkbox", class: "s-multiple-bundle-product-checkbox", checked: isChecked, "data-selection-locked": isLocked ? 'true' : undefined, name: this.generateEventName(this.section.id, productIndex), value: product.id, onClick: event => this.preventLockedDeselect(event, isChecked), onChange: event => this.preventLockedDeselect(event, isChecked) }), h("img", { src: product.image.url || salla.url.cdn('images/s-empty.png'), loading: "lazy", alt: product.image.alt || product.name, class: "s-multiple-bundle-product-image" })), h("div", { class: "s-multiple-bundle-product-content-wrapper" }, h("div", { class: "s-multiple-bundle-product-content" }, h("div", { class: "s-multiple-bundle-product-details" }, h("div", { class: "s-multiple-bundle-product-title-wrapper" }, h("h2", { class: "s-multiple-bundle-product-title" }, h("a", { href: product?.url || '#', target: "_blank", rel: "noopener noreferrer" }, product.name))), h("div", { class: "s-multiple-bundle-product-price-wrapper" }, h("span", { class: "s-multiple-bundle-product-price" }, h("span", { innerHTML: salla.money(product.price) })), product.sale_price > 0 && (h("span", { class: "s-multiple-bundle-product-price-discount" }, h("span", { innerHTML: salla.money(product.regular_price) }))))), product.quantity_in_group > 0 && product.quantity !== 0 && (h("span", { class: "s-multiple-bundle-product-badge" }, salla.lang.get('pages.products.pieces'), h("span", null, product.quantity_in_group))), product.quantity === 0 && (h("span", { class: "s-multiple-bundle-product-badge" }, salla.lang.get('pages.products.quantity_in_group_finished')))), product.options?.length > 0 && (h("button", { class: "s-multiple-bundle-product-button", onClick: () => this.handleOptionsClick(product), type: "button" }, optionsButtonLabel, h("span", { class: "s-multiple-bundle-product-button-icon", innerHTML: optionsArrowIcon })))))));
593
654
  })))));
594
655
  }
595
656
  get host() { return getElement(this); }
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { r as registerInstance, h, H as Host } from './index-D0jpoyIT.js';
4
+ import { r as registerInstance, h, H as Host } from './index-DMcU-3GG.js';
5
5
 
6
6
  const sallaMultipleBundleProductCss = ":host{display:block}";
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { r as registerInstance, h } from './index-D0jpoyIT.js';
4
+ import { r as registerInstance, h } from './index-DMcU-3GG.js';
5
5
  import { T as TagMoneyIcon } from './tag-money-CJUR4sUM.js';
6
6
  import { i as iconCopy } from './swap-stroke-DqDX5na4.js';
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { r as registerInstance, h } from './index-D0jpoyIT.js';
4
+ import { r as registerInstance, h } from './index-DMcU-3GG.js';
5
5
 
6
6
  const sallaNotificationsCss = "";
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { r as registerInstance, h, a as getElement } from './index-D0jpoyIT.js';
4
+ import { r as registerInstance, h, a as getElement } from './index-DMcU-3GG.js';
5
5
  import { H as Helper } from './Helper-DFMXF2_h.js';
6
6
  import './anime.es-CgtvEd63.js';
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { r as registerInstance, h, a as getElement } from './index-D0jpoyIT.js';
4
+ import { r as registerInstance, h, a as getElement } from './index-DMcU-3GG.js';
5
5
  import { S as SpecialDiscountIcon } from './special-discount-Ctkfc4K-.js';
6
6
  import { S as SITag } from './tag-cgSL_BIo.js';
7
7
  import { S as SICart2 } from './cart2-D1s2kXqL.js';
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { r as registerInstance, h, a as getElement } from './index-D0jpoyIT.js';
4
+ import { r as registerInstance, h, a as getElement } from './index-DMcU-3GG.js';
5
5
 
6
6
  var PageType;
7
7
  (function (PageType) {
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { r as registerInstance, h, H as Host } from './index-D0jpoyIT.js';
4
+ import { r as registerInstance, h, H as Host } from './index-DMcU-3GG.js';
5
5
 
6
6
  const sallaOrderDetailsMultipleBundleProductCss = "";
7
7