@salla.sa/twilight-components 2.14.470 → 2.14.472

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 (494) hide show
  1. package/dist/cjs/{filepond-jdX95qxM.js → filepond-Cy1e6Ro5.js} +1 -1
  2. package/dist/cjs/{filepond-plugin-file-poster-DC9ozntr.js → filepond-plugin-file-poster-CLtWPKuV.js} +1 -1
  3. package/dist/cjs/{filepond-plugin-file-validate-size-DxUUyj2Z.js → filepond-plugin-file-validate-size-VaxUnQB7.js} +1 -1
  4. package/dist/cjs/{filepond-plugin-file-validate-type-DB4YCfw-.js → filepond-plugin-file-validate-type-qjNEM_4Q.js} +1 -1
  5. package/dist/cjs/{filepond-plugin-image-edit-QlnXOcNf.js → filepond-plugin-image-edit-DZdFIpzD.js} +1 -1
  6. package/dist/cjs/{filepond-plugin-image-exif-orientation-D6HJ47N2.js → filepond-plugin-image-exif-orientation-CMDdMoTf.js} +1 -1
  7. package/dist/cjs/{filepond-plugin-image-preview-DCaj9jNI.js → filepond-plugin-image-preview-CckneKBe.js} +1 -1
  8. package/dist/cjs/{functions-C_kzehHT.js → functions-DDLs9J1M.js} +1 -1
  9. package/dist/cjs/{index-CmPl0fIy.js → index-BLZPuy15.js} +10 -14
  10. package/dist/cjs/{index-SIy6bIWx.js → index-MGCYfYcr.js} +1 -1
  11. package/dist/cjs/loader.cjs.js +2 -2
  12. package/dist/cjs/salla-accordion-body_2.cjs.entry.js +4 -4
  13. package/dist/cjs/salla-accordion_6.cjs.entry.js +24 -8
  14. package/dist/cjs/salla-add-product-button_5.cjs.entry.js +422 -49
  15. package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
  16. package/dist/cjs/salla-alert_2.cjs.entry.js +4 -4
  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 +2 -2
  20. package/dist/cjs/salla-booking-field_7.cjs.entry.js +18 -18
  21. package/dist/cjs/salla-bullet-delivery_2.cjs.entry.js +5 -5
  22. package/dist/cjs/salla-cart-coupons.cjs.entry.js +2 -2
  23. package/dist/cjs/salla-cart-item-offers_2.cjs.entry.js +2 -2
  24. package/dist/cjs/salla-cashback-banner.cjs.entry.js +1 -1
  25. package/dist/cjs/salla-comment-form_8.cjs.entry.js +5 -5
  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 +2 -2
  30. package/dist/cjs/salla-custom-fields.cjs.entry.js +1 -1
  31. package/dist/cjs/salla-delivery-promise.cjs.entry.js +1 -1
  32. package/dist/cjs/salla-edit-order-button.cjs.entry.js +1 -1
  33. package/dist/cjs/salla-filters-widget.cjs.entry.js +3 -3
  34. package/dist/cjs/salla-filters.cjs.entry.js +2 -2
  35. package/dist/cjs/salla-fulfillment-methods.cjs.entry.js +1 -1
  36. package/dist/cjs/salla-gifting.cjs.entry.js +3 -3
  37. package/dist/cjs/salla-hook.cjs.entry.js +2 -2
  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 +2 -2
  41. package/dist/cjs/salla-localization-modal.cjs.entry.js +2 -2
  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 +9 -9
  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-points-history.cjs.entry.js +2 -2
  48. package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +2 -2
  49. package/dist/cjs/salla-loyalty-program.cjs.entry.js +3 -3
  50. package/dist/cjs/salla-loyalty-reward.cjs.entry.js +4 -4
  51. package/dist/cjs/salla-loyalty.cjs.entry.js +1 -1
  52. package/dist/cjs/salla-maintenance-alert.cjs.entry.js +2 -2
  53. package/dist/cjs/{salla-map.cjs.entry.js → salla-map_2.cjs.entry.js} +70 -4
  54. package/dist/cjs/salla-menu.cjs.entry.js +1 -1
  55. package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
  56. package/dist/cjs/salla-multiple-bundle-product-cart_2.cjs.entry.js +4 -4
  57. package/dist/cjs/salla-multiple-bundle-product-options-modal_2.cjs.entry.js +6 -6
  58. package/dist/cjs/salla-multiple-bundle-product.cjs.entry.js +2 -2
  59. package/dist/cjs/salla-next-order-coupon.cjs.entry.js +1 -1
  60. package/dist/cjs/salla-notification-item.cjs.entry.js +2 -2
  61. package/dist/cjs/salla-notifications.cjs.entry.js +1 -1
  62. package/dist/cjs/salla-offer-modal.cjs.entry.js +2 -2
  63. package/dist/cjs/salla-offer.cjs.entry.js +1 -1
  64. package/dist/cjs/salla-order-branch.cjs.entry.js +1 -1
  65. package/dist/cjs/salla-order-details-multiple-bundle-product.cjs.entry.js +1 -1
  66. package/dist/cjs/salla-order-details-options.cjs.entry.js +1 -1
  67. package/dist/cjs/salla-order-details.cjs.entry.js +2 -2
  68. package/dist/cjs/salla-order-edit-item.cjs.entry.js +1 -1
  69. package/dist/cjs/salla-order-edit-product-card.cjs.entry.js +2 -2
  70. package/dist/cjs/salla-order-edit.cjs.entry.js +1 -1
  71. package/dist/cjs/{salla-product-card_2.cjs.entry.js → salla-order-options-modal_3.cjs.entry.js} +209 -6
  72. package/dist/cjs/salla-order-summary.cjs.entry.js +2 -2
  73. package/dist/cjs/salla-order-totals-card.cjs.entry.js +1 -1
  74. package/dist/cjs/salla-orders.cjs.entry.js +1 -1
  75. package/dist/cjs/salla-payments.cjs.entry.js +3 -3
  76. package/dist/cjs/salla-placeholder.cjs.entry.js +2 -2
  77. package/dist/cjs/salla-price-range.cjs.entry.js +3 -3
  78. package/dist/cjs/salla-product-card-embed.cjs.entry.js +2 -2
  79. package/dist/cjs/salla-product-size-guide.cjs.entry.js +3 -3
  80. package/dist/cjs/salla-products-list.cjs.entry.js +1 -1
  81. package/dist/cjs/salla-quick-order.cjs.entry.js +1 -1
  82. package/dist/cjs/salla-rating-modal.cjs.entry.js +1 -1
  83. package/dist/cjs/salla-reward-action_4.cjs.entry.js +10 -10
  84. package/dist/cjs/salla-scopes.cjs.entry.js +2 -2
  85. package/dist/cjs/salla-search.cjs.entry.js +6 -6
  86. package/dist/cjs/salla-skeleton.cjs.entry.js +2 -2
  87. package/dist/cjs/salla-slider.cjs.entry.js +1 -1
  88. package/dist/cjs/salla-social-share.cjs.entry.js +2 -2
  89. package/dist/cjs/salla-social.cjs.entry.js +2 -2
  90. package/dist/cjs/salla-tab-content_3.cjs.entry.js +4 -4
  91. package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
  92. package/dist/cjs/salla-tooltip.cjs.entry.js +2 -2
  93. package/dist/cjs/salla-trust-badges.cjs.entry.js +1 -1
  94. package/dist/cjs/salla-user-menu.cjs.entry.js +1 -1
  95. package/dist/cjs/salla-user-profile.cjs.entry.js +1 -1
  96. package/dist/cjs/salla-user-settings.cjs.entry.js +2 -2
  97. package/dist/cjs/salla-verify.cjs.entry.js +1 -1
  98. package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
  99. package/dist/cjs/salla-wishlist-actions.cjs.entry.js +2 -2
  100. package/dist/cjs/{tracked-promise-D-gQXgPZ.js → tracked-promise-B-bFT1y-.js} +1 -1
  101. package/dist/cjs/twilight.cjs.js +2 -2
  102. package/dist/cjs/{vanilla-picker-CZ_8m6i_.js → vanilla-picker-CP29RTHf.js} +1 -1
  103. package/dist/collection/collection-manifest.json +1 -0
  104. package/dist/collection/components/salla-accordion/salla-accordion-body.js +1 -1
  105. package/dist/collection/components/salla-accordion/salla-accordion-head.js +2 -2
  106. package/dist/collection/components/salla-accordion/salla-accordion.js +1 -1
  107. package/dist/collection/components/salla-add-product-button/salla-add-product-button.js +10 -0
  108. package/dist/collection/components/salla-alert/salla-alert.js +1 -1
  109. package/dist/collection/components/salla-badge/salla-badge.js +1 -1
  110. package/dist/collection/components/salla-booking-field/salla-booking-field.js +1 -1
  111. package/dist/collection/components/salla-bottom-alert/salla-bottom-alert.js +2 -2
  112. package/dist/collection/components/salla-breadcrumb/salla-breadcrumb.js +21 -5
  113. package/dist/collection/components/salla-cart-coupons/salla-cart-coupons.js +1 -1
  114. package/dist/collection/components/salla-cart-summary/salla-cart-summary.js +1 -1
  115. package/dist/collection/components/salla-color-picker/salla-color-picker.js +1 -1
  116. package/dist/collection/components/salla-comment-form/salla-comment-form.js +1 -1
  117. package/dist/collection/components/salla-conditional-fields/salla-conditional-fields.js +1 -1
  118. package/dist/collection/components/salla-count-down/salla-count-down.js +1 -1
  119. package/dist/collection/components/salla-datetime-picker/salla-datetime-picker.js +1 -1
  120. package/dist/collection/components/salla-file-upload/salla-file-upload.js +2 -2
  121. package/dist/collection/components/salla-filters/salla-filters.js +1 -1
  122. package/dist/collection/components/salla-filters-widget/salla-filters-widget.js +2 -2
  123. package/dist/collection/components/salla-gifting/salla-gifting.js +2 -2
  124. package/dist/collection/components/salla-hook/salla-hook.js +1 -1
  125. package/dist/collection/components/salla-list-tile/salla-list-tile.js +1 -1
  126. package/dist/collection/components/salla-loading/salla-loading.js +1 -1
  127. package/dist/collection/components/salla-localization-modal/salla-localization-modal.js +1 -1
  128. package/dist/collection/components/salla-loyalty/salla-loyalty-prize-item.js +1 -1
  129. package/dist/collection/components/salla-loyalty-points-history/salla-loyalty-points-history.js +1 -1
  130. package/dist/collection/components/salla-loyalty-program/salla-loyalty-hero.js +3 -3
  131. package/dist/collection/components/salla-loyalty-program/salla-loyalty-point.js +4 -4
  132. package/dist/collection/components/salla-loyalty-program/salla-loyalty-reward.js +2 -2
  133. package/dist/collection/components/salla-loyalty-program/salla-reward-card.js +1 -1
  134. package/dist/collection/components/salla-loyalty-program/salla-reward-details.js +3 -3
  135. package/dist/collection/components/salla-loyalty-program/salla-reward-exchange.js +3 -3
  136. package/dist/collection/components/salla-maintenance-alert/salla-maintenance-alert.js +1 -1
  137. package/dist/collection/components/salla-map/salla-map.js +3 -3
  138. package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-cart.js +1 -1
  139. package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-details.js +2 -2
  140. package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-options-modal.js +4 -4
  141. package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-slider.js +1 -1
  142. package/dist/collection/components/salla-multiple-bundle-product/salla-multiple-bundle-product.js +1 -1
  143. package/dist/collection/components/salla-notifications/salla-notification-item.js +1 -1
  144. package/dist/collection/components/salla-offer-modal/salla-offer-modal.js +1 -1
  145. package/dist/collection/components/salla-order-details/salla-order-details.js +1 -1
  146. package/dist/collection/components/salla-order-edit/salla-order-edit-product-card.js +1 -1
  147. package/dist/collection/components/salla-order-options-modal/apple-pay-order-options.js +84 -0
  148. package/dist/collection/components/salla-order-options-modal/order-options-gate.js +136 -0
  149. package/dist/collection/components/salla-order-options-modal/salla-order-options-modal.css +35 -0
  150. package/dist/collection/components/salla-order-options-modal/salla-order-options-modal.js +282 -0
  151. package/dist/collection/components/salla-order-summary/salla-order-summary.js +1 -1
  152. package/dist/collection/components/salla-payments/salla-payments.js +2 -2
  153. package/dist/collection/components/salla-placeholder/salla-placeholder.js +1 -1
  154. package/dist/collection/components/salla-price-range/salla-price-range.js +2 -2
  155. package/dist/collection/components/salla-product-availability/salla-product-availability.js +1 -1
  156. package/dist/collection/components/salla-product-card/salla-product-card.js +5 -5
  157. package/dist/collection/components/salla-product-card-embed/salla-product-card-embed.js +1 -1
  158. package/dist/collection/components/salla-product-options/availability-utils.js +54 -0
  159. package/dist/collection/components/salla-product-options/salla-product-options.js +105 -31
  160. package/dist/collection/components/salla-product-size-guide/salla-product-size-guide.js +2 -2
  161. package/dist/collection/components/salla-quantity-input/salla-quantity-input.js +1 -1
  162. package/dist/collection/components/salla-quick-buy/salla-quick-buy.js +70 -16
  163. package/dist/collection/components/salla-review-card/salla-review-card.js +1 -1
  164. package/dist/collection/components/salla-reviews/salla-reviews.js +1 -1
  165. package/dist/collection/components/salla-reviews-page/salla-reviews-page.js +1 -1
  166. package/dist/collection/components/salla-scopes/salla-scopes.js +1 -1
  167. package/dist/collection/components/salla-search/salla-search.js +5 -5
  168. package/dist/collection/components/salla-searchable-dropdown/salla-searchable-dropdown.js +4 -4
  169. package/dist/collection/components/salla-skeleton/salla-skeleton.js +1 -1
  170. package/dist/collection/components/salla-social/salla-social.js +1 -1
  171. package/dist/collection/components/salla-social-share/salla-social-share.js +1 -1
  172. package/dist/collection/components/salla-tabs/salla-tab-content.js +1 -1
  173. package/dist/collection/components/salla-tabs/salla-tab-header.js +1 -1
  174. package/dist/collection/components/salla-tabs/salla-tabs.js +1 -1
  175. package/dist/collection/components/salla-tel-input/salla-tel-input.js +1 -1
  176. package/dist/collection/components/salla-tooltip/salla-tooltip.js +1 -1
  177. package/dist/collection/components/salla-user-settings/salla-user-settings.js +1 -1
  178. package/dist/collection/components/salla-wishlist-actions/salla-wishlist-actions.js +1 -1
  179. package/dist/components/index.js +2 -2
  180. package/dist/components/index2.js +2540 -1699
  181. package/dist/components/index3.js +1699 -2540
  182. package/dist/components/location.js +2 -2
  183. package/dist/components/salla-accordion-body2.js +1 -1
  184. package/dist/components/salla-accordion-head2.js +2 -2
  185. package/dist/components/salla-accordion2.js +1 -1
  186. package/dist/components/salla-add-product-button2.js +205 -8
  187. package/dist/components/salla-alert.js +1 -1
  188. package/dist/components/salla-badge2.js +1 -1
  189. package/dist/components/salla-booking-field2.js +1 -1
  190. package/dist/components/salla-bottom-alert.js +2 -2
  191. package/dist/components/salla-breadcrumb.js +21 -5
  192. package/dist/components/salla-bullet-delivery.js +3 -3
  193. package/dist/components/salla-cart-coupons.js +1 -1
  194. package/dist/components/salla-cart-summary.js +1 -1
  195. package/dist/components/salla-color-picker2.js +1 -1
  196. package/dist/components/salla-comment-form2.js +1 -1
  197. package/dist/components/salla-conditional-fields2.js +1 -1
  198. package/dist/components/salla-count-down2.js +1 -1
  199. package/dist/components/salla-datetime-picker2.js +2 -2
  200. package/dist/components/salla-file-upload2.js +2 -2
  201. package/dist/components/salla-filters-widget2.js +2 -2
  202. package/dist/components/salla-filters.js +1 -1
  203. package/dist/components/salla-gifting.js +2 -2
  204. package/dist/components/salla-hook.js +1 -1
  205. package/dist/components/salla-list-tile2.js +1 -1
  206. package/dist/components/salla-loading2.js +1 -1
  207. package/dist/components/salla-localization-modal.js +1 -1
  208. package/dist/components/salla-loyalty-hero2.js +3 -3
  209. package/dist/components/salla-loyalty-panel.js +66 -18
  210. package/dist/components/salla-loyalty-point2.js +6 -6
  211. package/dist/components/salla-loyalty-points-history.js +1 -1
  212. package/dist/components/salla-loyalty-prize-item.js +1 -1
  213. package/dist/components/salla-loyalty-program.js +68 -20
  214. package/dist/components/salla-loyalty-reward.js +2 -2
  215. package/dist/components/salla-maintenance-alert.js +1 -1
  216. package/dist/components/salla-map2.js +4 -4
  217. package/dist/components/salla-multiple-bundle-product-cart2.js +1 -1
  218. package/dist/components/salla-multiple-bundle-product-details2.js +2 -2
  219. package/dist/components/salla-multiple-bundle-product-options-modal2.js +4 -4
  220. package/dist/components/salla-multiple-bundle-product-slider2.js +1 -1
  221. package/dist/components/salla-multiple-bundle-product.js +1 -1
  222. package/dist/components/salla-notification-item2.js +1 -1
  223. package/dist/components/salla-offer-modal.js +65 -17
  224. package/dist/components/salla-order-details.js +1 -1
  225. package/dist/components/salla-order-edit-product-card.js +1 -1
  226. package/dist/components/salla-order-options-modal.d.ts +11 -0
  227. package/dist/components/salla-order-options-modal.js +9 -0
  228. package/dist/components/salla-order-options-modal2.js +303 -0
  229. package/dist/components/salla-order-summary.js +1 -1
  230. package/dist/components/salla-payments.js +2 -2
  231. package/dist/components/salla-placeholder2.js +1 -1
  232. package/dist/components/salla-price-range2.js +2 -2
  233. package/dist/components/salla-product-availability2.js +1 -1
  234. package/dist/components/salla-product-card-embed.js +1 -1
  235. package/dist/components/salla-product-card2.js +65 -17
  236. package/dist/components/salla-product-options2.js +120 -30
  237. package/dist/components/salla-product-size-guide.js +2 -2
  238. package/dist/components/salla-products-slider2.js +62 -14
  239. package/dist/components/salla-quantity-input2.js +1 -1
  240. package/dist/components/salla-quick-buy2.js +233 -18
  241. package/dist/components/salla-review-card2.js +1 -1
  242. package/dist/components/salla-reviews-page.js +1 -1
  243. package/dist/components/salla-reviews.js +1 -1
  244. package/dist/components/salla-reward-card2.js +1 -1
  245. package/dist/components/salla-reward-details2.js +67 -19
  246. package/dist/components/salla-reward-exchange2.js +3 -3
  247. package/dist/components/salla-scopes.js +1 -1
  248. package/dist/components/salla-search.js +5 -5
  249. package/dist/components/salla-searchable-dropdown2.js +4 -4
  250. package/dist/components/salla-skeleton2.js +1 -1
  251. package/dist/components/salla-social-share2.js +1 -1
  252. package/dist/components/salla-social.js +1 -1
  253. package/dist/components/salla-tab-content2.js +1 -1
  254. package/dist/components/salla-tab-header2.js +1 -1
  255. package/dist/components/salla-tabs2.js +1 -1
  256. package/dist/components/salla-tel-input2.js +2 -2
  257. package/dist/components/salla-tooltip2.js +1 -1
  258. package/dist/components/salla-user-settings.js +1 -1
  259. package/dist/components/salla-wishlist-actions.js +1 -1
  260. package/dist/esm/{filepond-DLJR7kqO.js → filepond-BOdFx-k4.js} +1 -1
  261. package/dist/esm/{filepond-plugin-file-poster-BPPxfj_a.js → filepond-plugin-file-poster-B0plGjbP.js} +1 -1
  262. package/dist/esm/{filepond-plugin-file-validate-size-CCqZAz2o.js → filepond-plugin-file-validate-size-BFnLP4vL.js} +1 -1
  263. package/dist/esm/{filepond-plugin-file-validate-type-YEjyqpU3.js → filepond-plugin-file-validate-type-CKf0Z8YX.js} +1 -1
  264. package/dist/esm/{filepond-plugin-image-edit-tiyoM7iJ.js → filepond-plugin-image-edit-lPLGnaWD.js} +1 -1
  265. package/dist/esm/{filepond-plugin-image-exif-orientation-CESSG4q3.js → filepond-plugin-image-exif-orientation-ad7mrSt5.js} +1 -1
  266. package/dist/esm/{filepond-plugin-image-preview-CTrGLHaX.js → filepond-plugin-image-preview-D5dtrQjv.js} +1 -1
  267. package/dist/esm/{functions-iGPmc3ui.js → functions-nnPBSJY6.js} +1 -1
  268. package/dist/esm/{index-pj-XyI3U.js → index-BtIvUNme.js} +1 -1
  269. package/dist/esm/{index-Dckjjczv.js → index-CjnbnAFU.js} +10 -14
  270. package/dist/esm/loader.js +3 -3
  271. package/dist/esm/salla-accordion-body_2.entry.js +4 -4
  272. package/dist/esm/salla-accordion_6.entry.js +24 -8
  273. package/dist/esm/salla-add-product-button_5.entry.js +422 -49
  274. package/dist/esm/salla-advertisement.entry.js +1 -1
  275. package/dist/esm/salla-alert_2.entry.js +4 -4
  276. package/dist/esm/salla-app-install-alert.entry.js +1 -1
  277. package/dist/esm/salla-apps-icons.entry.js +1 -1
  278. package/dist/esm/salla-badge.entry.js +2 -2
  279. package/dist/esm/salla-booking-field_7.entry.js +18 -18
  280. package/dist/esm/salla-bullet-delivery_2.entry.js +5 -5
  281. package/dist/esm/salla-cart-coupons.entry.js +2 -2
  282. package/dist/esm/salla-cart-item-offers_2.entry.js +2 -2
  283. package/dist/esm/salla-cashback-banner.entry.js +1 -1
  284. package/dist/esm/salla-comment-form_8.entry.js +5 -5
  285. package/dist/esm/salla-conditional-offer.entry.js +1 -1
  286. package/dist/esm/salla-contacts.entry.js +1 -1
  287. package/dist/esm/salla-cookies-bar.entry.js +1 -1
  288. package/dist/esm/salla-count-down.entry.js +2 -2
  289. package/dist/esm/salla-custom-fields.entry.js +1 -1
  290. package/dist/esm/salla-delivery-promise.entry.js +1 -1
  291. package/dist/esm/salla-edit-order-button.entry.js +1 -1
  292. package/dist/esm/salla-filters-widget.entry.js +3 -3
  293. package/dist/esm/salla-filters.entry.js +2 -2
  294. package/dist/esm/salla-fulfillment-methods.entry.js +1 -1
  295. package/dist/esm/salla-gifting.entry.js +3 -3
  296. package/dist/esm/salla-hook.entry.js +2 -2
  297. package/dist/esm/salla-infinite-scroll.entry.js +1 -1
  298. package/dist/esm/salla-installment.entry.js +1 -1
  299. package/dist/esm/salla-list-tile.entry.js +2 -2
  300. package/dist/esm/salla-localization-modal.entry.js +2 -2
  301. package/dist/esm/salla-login-modal.entry.js +1 -1
  302. package/dist/esm/salla-loyalty-banner.entry.js +2 -2
  303. package/dist/esm/salla-loyalty-hero_2.entry.js +9 -9
  304. package/dist/esm/salla-loyalty-panel.entry.js +3 -3
  305. package/dist/esm/salla-loyalty-points-banner.entry.js +1 -1
  306. package/dist/esm/salla-loyalty-points-history.entry.js +2 -2
  307. package/dist/esm/salla-loyalty-prize-item.entry.js +2 -2
  308. package/dist/esm/salla-loyalty-program.entry.js +3 -3
  309. package/dist/esm/salla-loyalty-reward.entry.js +4 -4
  310. package/dist/esm/salla-loyalty.entry.js +1 -1
  311. package/dist/esm/salla-maintenance-alert.entry.js +2 -2
  312. package/dist/esm/{salla-map.entry.js → salla-map_2.entry.js} +70 -5
  313. package/dist/esm/salla-menu.entry.js +1 -1
  314. package/dist/esm/salla-metadata.entry.js +1 -1
  315. package/dist/esm/salla-multiple-bundle-product-cart_2.entry.js +4 -4
  316. package/dist/esm/salla-multiple-bundle-product-options-modal_2.entry.js +6 -6
  317. package/dist/esm/salla-multiple-bundle-product.entry.js +2 -2
  318. package/dist/esm/salla-next-order-coupon.entry.js +1 -1
  319. package/dist/esm/salla-notification-item.entry.js +2 -2
  320. package/dist/esm/salla-notifications.entry.js +1 -1
  321. package/dist/esm/salla-offer-modal.entry.js +2 -2
  322. package/dist/esm/salla-offer.entry.js +1 -1
  323. package/dist/esm/salla-order-branch.entry.js +1 -1
  324. package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +1 -1
  325. package/dist/esm/salla-order-details-options.entry.js +1 -1
  326. package/dist/esm/salla-order-details.entry.js +2 -2
  327. package/dist/esm/salla-order-edit-item.entry.js +1 -1
  328. package/dist/esm/salla-order-edit-product-card.entry.js +2 -2
  329. package/dist/esm/salla-order-edit.entry.js +1 -1
  330. package/dist/esm/{salla-product-card_2.entry.js → salla-order-options-modal_3.entry.js} +209 -7
  331. package/dist/esm/salla-order-summary.entry.js +2 -2
  332. package/dist/esm/salla-order-totals-card.entry.js +1 -1
  333. package/dist/esm/salla-orders.entry.js +1 -1
  334. package/dist/esm/salla-payments.entry.js +3 -3
  335. package/dist/esm/salla-placeholder.entry.js +2 -2
  336. package/dist/esm/salla-price-range.entry.js +3 -3
  337. package/dist/esm/salla-product-card-embed.entry.js +2 -2
  338. package/dist/esm/salla-product-size-guide.entry.js +3 -3
  339. package/dist/esm/salla-products-list.entry.js +1 -1
  340. package/dist/esm/salla-quick-order.entry.js +1 -1
  341. package/dist/esm/salla-rating-modal.entry.js +1 -1
  342. package/dist/esm/salla-reward-action_4.entry.js +10 -10
  343. package/dist/esm/salla-scopes.entry.js +2 -2
  344. package/dist/esm/salla-search.entry.js +6 -6
  345. package/dist/esm/salla-skeleton.entry.js +2 -2
  346. package/dist/esm/salla-slider.entry.js +1 -1
  347. package/dist/esm/salla-social-share.entry.js +2 -2
  348. package/dist/esm/salla-social.entry.js +2 -2
  349. package/dist/esm/salla-tab-content_3.entry.js +4 -4
  350. package/dist/esm/salla-tiered-offer.entry.js +1 -1
  351. package/dist/esm/salla-tooltip.entry.js +2 -2
  352. package/dist/esm/salla-trust-badges.entry.js +1 -1
  353. package/dist/esm/salla-user-menu.entry.js +1 -1
  354. package/dist/esm/salla-user-profile.entry.js +1 -1
  355. package/dist/esm/salla-user-settings.entry.js +2 -2
  356. package/dist/esm/salla-verify.entry.js +1 -1
  357. package/dist/esm/salla-wallet.entry.js +1 -1
  358. package/dist/esm/salla-wishlist-actions.entry.js +2 -2
  359. package/dist/esm/{tracked-promise-CfOFv_ZQ.js → tracked-promise-DxK5ancc.js} +1 -1
  360. package/dist/esm/twilight.js +3 -3
  361. package/dist/esm/{vanilla-picker-BwAhzkb2.js → vanilla-picker-BNKvceoq.js} +1 -1
  362. package/dist/twilight/{p-193f4672.entry.js → p-01995780.entry.js} +1 -1
  363. package/dist/twilight/{p-46b75509.entry.js → p-02822e9f.entry.js} +1 -1
  364. package/dist/twilight/p-080444bb.entry.js +4 -0
  365. package/dist/twilight/{p-e573c23d.entry.js → p-0d01c327.entry.js} +1 -1
  366. package/dist/twilight/{p-9ac3d874.entry.js → p-0dcb8111.entry.js} +1 -1
  367. package/dist/twilight/p-129c20ed.entry.js +4 -0
  368. package/dist/twilight/{p-e2e38f7d.entry.js → p-15541ca3.entry.js} +1 -1
  369. package/dist/twilight/p-155d4693.entry.js +4 -0
  370. package/dist/twilight/{p-85d1767d.entry.js → p-1982cd13.entry.js} +1 -1
  371. package/dist/twilight/{p-b1d439e7.entry.js → p-1b8c59cf.entry.js} +1 -1
  372. package/dist/twilight/{p-3100186f.entry.js → p-1dc58168.entry.js} +1 -1
  373. package/dist/twilight/{p-768b4a83.entry.js → p-1f3480ba.entry.js} +1 -1
  374. package/dist/twilight/p-241b94a6.entry.js +4 -0
  375. package/dist/twilight/{p-69e7eb15.entry.js → p-2b75426a.entry.js} +1 -1
  376. package/dist/twilight/{p-6e2c05e8.entry.js → p-2dc46abc.entry.js} +1 -1
  377. package/dist/twilight/p-2eaf114e.entry.js +4 -0
  378. package/dist/twilight/{p-780abf03.entry.js → p-304f3de9.entry.js} +1 -1
  379. package/dist/twilight/p-35f30553.entry.js +4 -0
  380. package/dist/twilight/{p-d059046e.entry.js → p-3adacc75.entry.js} +1 -1
  381. package/dist/twilight/p-3e9f8d3c.entry.js +4 -0
  382. package/dist/twilight/{p-6543c5eb.entry.js → p-407a0c14.entry.js} +1 -1
  383. package/dist/twilight/{p-61bcbf9a.entry.js → p-43affbdd.entry.js} +1 -1
  384. package/dist/twilight/{p-a8a9b151.entry.js → p-456cfec5.entry.js} +1 -1
  385. package/dist/twilight/{p-3995c76e.entry.js → p-46c8b2d4.entry.js} +1 -1
  386. package/dist/twilight/{p-badfd153.entry.js → p-474b22b8.entry.js} +1 -1
  387. package/dist/twilight/{p-9f8a065c.entry.js → p-49c42118.entry.js} +1 -1
  388. package/dist/twilight/p-5089b72f.entry.js +4 -0
  389. package/dist/twilight/{p-c907509d.entry.js → p-5229c8aa.entry.js} +1 -1
  390. package/dist/twilight/{p-5f989a35.entry.js → p-550a91fe.entry.js} +1 -1
  391. package/dist/twilight/{p-463cf5ea.entry.js → p-594694e9.entry.js} +1 -1
  392. package/dist/twilight/{p-6ee5c24d.entry.js → p-5a18c6cc.entry.js} +1 -1
  393. package/dist/twilight/{p-38b5829a.entry.js → p-5aa08192.entry.js} +1 -1
  394. package/dist/twilight/p-5bda616b.entry.js +4 -0
  395. package/dist/twilight/p-5d9b57c8.entry.js +4 -0
  396. package/dist/twilight/{p-c4c3e16f.entry.js → p-6030f1fd.entry.js} +1 -1
  397. package/dist/twilight/{p-a756b0a4.entry.js → p-62010e29.entry.js} +1 -1
  398. package/dist/twilight/{p-df72e6a9.entry.js → p-63f1acc7.entry.js} +1 -1
  399. package/dist/twilight/p-6790943b.entry.js +4 -0
  400. package/dist/twilight/{p-fe2a4d07.entry.js → p-67d41cbb.entry.js} +1 -1
  401. package/dist/twilight/{p-9668a8aa.entry.js → p-6c39606a.entry.js} +1 -1
  402. package/dist/twilight/{p-fca82074.entry.js → p-6d6184c0.entry.js} +1 -1
  403. package/dist/twilight/{p-f145dc81.entry.js → p-6eab2444.entry.js} +1 -1
  404. package/dist/twilight/{p-dcc34752.entry.js → p-72a1b702.entry.js} +1 -1
  405. package/dist/twilight/{p-30fe7a02.entry.js → p-7442c41a.entry.js} +1 -1
  406. package/dist/twilight/{p-51b4ab80.entry.js → p-7f4d4e3c.entry.js} +1 -1
  407. package/dist/twilight/{p-be077285.entry.js → p-7fdeec2b.entry.js} +1 -1
  408. package/dist/twilight/{p-f4f47286.entry.js → p-83cb6915.entry.js} +1 -1
  409. package/dist/twilight/{p-017500f8.entry.js → p-88bed460.entry.js} +1 -1
  410. package/dist/twilight/{p-623b0c48.entry.js → p-8d1c4f93.entry.js} +1 -1
  411. package/dist/twilight/{p-4d2f0573.entry.js → p-8d427c53.entry.js} +1 -1
  412. package/dist/twilight/p-929e5aed.entry.js +4 -0
  413. package/dist/twilight/p-956d6683.entry.js +4 -0
  414. package/dist/twilight/{p-BPasfwVf.js → p-BKKN_hn3.js} +1 -1
  415. package/dist/twilight/{p-DVCS8qoq.js → p-BT5S72c8.js} +1 -1
  416. package/dist/twilight/{p-D2W2ygY1.js → p-ByL3FHQ6.js} +1 -1
  417. package/dist/twilight/p-CBwG3dWv.js +9 -0
  418. package/dist/twilight/{p-Dckjjczv.js → p-CjnbnAFU.js} +1 -1
  419. package/dist/twilight/{p-DNU1AEuR.js → p-ClNJhnhN.js} +1 -1
  420. package/dist/twilight/{p-DzHsJ03K.js → p-Cq2cbPYZ.js} +1 -1
  421. package/dist/twilight/p-Czf4a8gg.js +9 -0
  422. package/dist/twilight/{p--Jfvyk1f.js → p-D6Z2cDb0.js} +1 -1
  423. package/dist/twilight/{p-BgFqaLNN.js → p-DBxZFsVz.js} +1 -1
  424. package/dist/twilight/{p-BxhAwisc.js → p-DXVmi29t.js} +1 -1
  425. package/dist/twilight/{p-CHsBLTlN.js → p-DY6O-SiT.js} +1 -1
  426. package/dist/twilight/{p-1fa5c385.entry.js → p-a1e520d5.entry.js} +1 -1
  427. package/dist/twilight/{p-0052df8e.entry.js → p-a26fe1e5.entry.js} +1 -1
  428. package/dist/twilight/{p-0fa958a8.entry.js → p-a30cfade.entry.js} +1 -1
  429. package/dist/twilight/{p-eaf8f509.entry.js → p-a9090afd.entry.js} +1 -1
  430. package/dist/twilight/{p-89dae763.entry.js → p-ae2c963f.entry.js} +1 -1
  431. package/dist/twilight/{p-0a8fdddc.entry.js → p-b18a446a.entry.js} +1 -1
  432. package/dist/twilight/{p-9196d137.entry.js → p-b1c97472.entry.js} +1 -1
  433. package/dist/twilight/{p-bc1725dd.entry.js → p-bc6c4c1c.entry.js} +1 -1
  434. package/dist/twilight/{p-31fca96b.entry.js → p-be10a9c3.entry.js} +1 -1
  435. package/dist/twilight/p-c26cf3fa.entry.js +4 -0
  436. package/dist/twilight/{p-092318cc.entry.js → p-c4655810.entry.js} +1 -1
  437. package/dist/twilight/{p-ba55e58f.entry.js → p-c5211eca.entry.js} +1 -1
  438. package/dist/twilight/{p-6ce0ab6e.entry.js → p-cbd793c8.entry.js} +1 -1
  439. package/dist/twilight/{p-052922a0.entry.js → p-cfb9665f.entry.js} +2 -2
  440. package/dist/twilight/p-d46fb24a.entry.js +4 -0
  441. package/dist/twilight/{p-a2ff9abd.entry.js → p-d6cb423a.entry.js} +1 -1
  442. package/dist/twilight/{p-721ae2c4.entry.js → p-d7a2e982.entry.js} +1 -1
  443. package/dist/twilight/{p-77db23d2.entry.js → p-d9868f07.entry.js} +1 -1
  444. package/dist/twilight/{p-ba5d1170.entry.js → p-dbe3a5bb.entry.js} +1 -1
  445. package/dist/twilight/{p-66d2b9e3.entry.js → p-e041fe56.entry.js} +1 -1
  446. package/dist/twilight/{p-37299c40.entry.js → p-e058b62c.entry.js} +1 -1
  447. package/dist/twilight/{p-6f63f391.entry.js → p-e07c9a85.entry.js} +1 -1
  448. package/dist/twilight/{p-ddbffad3.entry.js → p-e1275bf7.entry.js} +1 -1
  449. package/dist/twilight/{p-7a75c505.entry.js → p-e5d5a6b3.entry.js} +1 -1
  450. package/dist/twilight/p-e5e6ea75.entry.js +4 -0
  451. package/dist/twilight/{p-9a6ea758.entry.js → p-e7a255a3.entry.js} +1 -1
  452. package/dist/twilight/{p-de70e0f6.entry.js → p-ebebcd55.entry.js} +1 -1
  453. package/dist/twilight/{p-6f86922a.entry.js → p-f0d7247d.entry.js} +1 -1
  454. package/dist/twilight/{p-3d65f310.entry.js → p-f222bf9f.entry.js} +1 -1
  455. package/dist/twilight/{p-1da95f6f.entry.js → p-f2594407.entry.js} +1 -1
  456. package/dist/twilight/{p-21e43f89.entry.js → p-f4235325.entry.js} +1 -1
  457. package/dist/twilight/p-fafdeea7.entry.js +4 -0
  458. package/dist/twilight/{p-ef26e3be.entry.js → p-fb7de7c4.entry.js} +1 -1
  459. package/dist/twilight/{p-1eadcac5.entry.js → p-fc1e3854.entry.js} +1 -1
  460. package/dist/twilight/{p-7288ff02.entry.js → p-fc72b631.entry.js} +1 -1
  461. package/dist/twilight/{p-681a053f.entry.js → p-fce2579c.entry.js} +1 -1
  462. package/dist/twilight/twilight.esm.js +1 -1
  463. package/dist/types/components/salla-add-product-button/salla-add-product-button.d.ts +2 -0
  464. package/dist/types/components/salla-breadcrumb/salla-breadcrumb.d.ts +1 -0
  465. package/dist/types/components/salla-order-options-modal/apple-pay-order-options.d.ts +26 -0
  466. package/dist/types/components/salla-order-options-modal/order-options-gate.d.ts +23 -0
  467. package/dist/types/components/salla-order-options-modal/salla-order-options-modal.d.ts +66 -0
  468. package/dist/types/components/salla-product-options/availability-utils.d.ts +19 -0
  469. package/dist/types/components/salla-product-options/salla-product-options.d.ts +14 -0
  470. package/dist/types/components/salla-quick-buy/salla-quick-buy.d.ts +14 -0
  471. package/dist/types/components.d.ts +62 -0
  472. package/package.json +5 -5
  473. package/dist/cjs/salla-progress-bar.cjs.entry.js +0 -73
  474. package/dist/esm/salla-progress-bar.entry.js +0 -71
  475. package/dist/twilight/p-05ffde56.entry.js +0 -4
  476. package/dist/twilight/p-0bf6b9ad.entry.js +0 -4
  477. package/dist/twilight/p-294a3248.entry.js +0 -4
  478. package/dist/twilight/p-2b2af618.entry.js +0 -4
  479. package/dist/twilight/p-45a786cd.entry.js +0 -4
  480. package/dist/twilight/p-476463ea.entry.js +0 -4
  481. package/dist/twilight/p-56f4d005.entry.js +0 -4
  482. package/dist/twilight/p-58bcae28.entry.js +0 -4
  483. package/dist/twilight/p-5d19859e.entry.js +0 -4
  484. package/dist/twilight/p-63f20aa0.entry.js +0 -4
  485. package/dist/twilight/p-83222f33.entry.js +0 -4
  486. package/dist/twilight/p-84dc489a.entry.js +0 -4
  487. package/dist/twilight/p-869773d3.entry.js +0 -4
  488. package/dist/twilight/p-97b74b76.entry.js +0 -4
  489. package/dist/twilight/p-9dca7f59.entry.js +0 -4
  490. package/dist/twilight/p-BFEfBkEW.js +0 -9
  491. package/dist/twilight/p-DWcI2hUr.js +0 -9
  492. package/dist/twilight/p-ad60969e.entry.js +0 -4
  493. package/dist/twilight/p-dc9b7a8e.entry.js +0 -4
  494. package/dist/twilight/p-fc7a1f2f.entry.js +0 -4
@@ -79,7 +79,7 @@ export class SallaProductCardEmbed {
79
79
  's-product-card-embed-card-align-right': this.align === 'right',
80
80
  's-product-card-embed-card-align-center': this.align === 'center',
81
81
  };
82
- return (h(Host, { key: 'a742a11dc2926fb941f44d1b3fd5cc3b4a207822' }, this.hasError && h("span", { key: 'c554a3b1971fa0b646611d24b7000bed921114d8', class: "s-product-card-embed-fallback" }), h("div", { key: 'cb0551a374e4ed68496bfa436adf6424febbd681', class: cardClasses, ref: (el) => {
82
+ return (h(Host, { key: '61c3e673a103e5d13217bac208611bf4978d20a4' }, this.hasError && h("span", { key: '8f013953f9eed502307823825e573281f481fd19', class: "s-product-card-embed-fallback" }), h("div", { key: '150d4080de0dbf21a2abaa00eca4c8ffae604546', class: cardClasses, ref: (el) => {
83
83
  this.cardContainer = el;
84
84
  } })));
85
85
  }
@@ -0,0 +1,54 @@
1
+ /*!
2
+ * Crafted with ❤ by Salla
3
+ */
4
+ /**
5
+ * Builds a per-detail availability map from SKU-level data.
6
+ *
7
+ * Exported as a pure function so it can be unit-tested independently of the
8
+ * Stencil component (the @State availabilityMap backing-store is not accessible
9
+ * via page.rootInstance in the Stencil mock-doc test environment).
10
+ *
11
+ * Status values:
12
+ * 'available' – at least one in-stock SKU for this detail + current selections
13
+ * 'out_of_stock' – all matching SKUs are out of stock
14
+ * 'impossible' – no SKU intersection exists for this combination
15
+ *
16
+ * skus_availability is always the authoritative source when present; is_out is
17
+ * consulted only as a last resort when a detail has no SKU data at all.
18
+ */
19
+ export function computeAvailabilityMap(optionsData, selectedOptions) {
20
+ const map = {};
21
+ if (!optionsData?.length)
22
+ return map;
23
+ const variantGroups = optionsData.filter(opt => opt.details?.some(d => d.skus_availability && Object.keys(d.skus_availability).length > 0));
24
+ const isSingleGroup = variantGroups.length <= 1;
25
+ for (const optionGroup of variantGroups) {
26
+ const otherSelected = selectedOptions.filter(s => s.option_id !== optionGroup.id);
27
+ for (const detail of optionGroup.details) {
28
+ const skusAvail = detail.skus_availability;
29
+ // No skus_availability data — fall back to is_out as last resort only.
30
+ if (!skusAvail || !Object.keys(skusAvail).length) {
31
+ map[detail.id] = detail.is_out ? 'out_of_stock' : 'available';
32
+ continue;
33
+ }
34
+ const detailSkus = Object.keys(skusAvail).map(Number);
35
+ // No cross-group context yet — evaluate this detail's own SKUs directly.
36
+ if (isSingleGroup || otherSelected.length === 0) {
37
+ map[detail.id] = detailSkus.some(sku => skusAvail[sku]) ? 'available' : 'out_of_stock';
38
+ continue;
39
+ }
40
+ // Intersect this detail's SKUs with those of each other selected detail.
41
+ let candidates = detailSkus;
42
+ for (const other of otherSelected) {
43
+ const otherSkus = new Set(Object.keys(other.skus_availability || {}).map(Number));
44
+ candidates = candidates.filter(sku => otherSkus.has(sku));
45
+ }
46
+ if (!candidates.length) {
47
+ map[detail.id] = 'impossible';
48
+ continue;
49
+ }
50
+ map[detail.id] = candidates.some(sku => skusAvail[sku]) ? 'available' : 'out_of_stock';
51
+ }
52
+ }
53
+ return map;
54
+ }
@@ -3,6 +3,7 @@
3
3
  */
4
4
  import { h, Host } from "@stencil/core";
5
5
  import { DisplayType } from "./interfaces";
6
+ import { computeAvailabilityMap } from "./availability-utils";
6
7
  import CheckCircleIcon from "../../assets/svg/check.svg";
7
8
  import CameraIcon from "../../assets/svg/camera.svg";
8
9
  import FileIcon from "../../assets/svg/file-upload.svg";
@@ -27,6 +28,7 @@ export class SallaProductOptions {
27
28
  this.availableDigitalCardValues = [];
28
29
  this.userInitiatedValidation = false;
29
30
  this.isCartMode = false;
31
+ this.availabilityMap = {};
30
32
  this.outSkus = [];
31
33
  /**
32
34
  * Avoid selection of previous default or selected card value option
@@ -37,6 +39,11 @@ export class SallaProductOptions {
37
39
  * The id of the product to which the options are going to be fetched for.
38
40
  */
39
41
  this.productId = salla.config.get('page.id');
42
+ /**
43
+ * Strip the wrapper's padding (keeps the background, rounded corners, margin).
44
+ * Used by callers that need the options to sit flush inside their own surface.
45
+ */
46
+ this.noPadding = false;
40
47
  this.handleDonationOptions = (event, detail, type, _option) => {
41
48
  // Donating-amount input only: onInput updates price and dispatches native change for form price watcher.
42
49
  if (detail === 'custom' && type === 'input') {
@@ -117,12 +124,14 @@ export class SallaProductOptions {
117
124
  */
118
125
  async setOptionsData(optionsData) {
119
126
  this.optionsData = optionsData;
120
- const that = this;
121
- this.optionsData[0]?.details?.forEach(function (detail) {
127
+ this.outSkus = [];
128
+ this.optionsData[0]?.details?.forEach(detail => {
122
129
  Object.entries(detail.skus_availability || {})
123
- .filter(sku => !sku[1])
124
- .map(sku => that.outSkus.push(Number(sku[0])));
130
+ .filter(([, available]) => !available)
131
+ .forEach(([sku]) => this.outSkus.push(Number(sku)));
125
132
  });
133
+ this.fillSelectedOptions();
134
+ this.computeAvailability();
126
135
  }
127
136
  /**
128
137
  * Get the current options state, including selected values/details.
@@ -308,8 +317,9 @@ export class SallaProductOptions {
308
317
  */
309
318
  setSelectedSkus() {
310
319
  this.selectedSkus = this.selectedOptions.map(detail => Object.keys(detail.skus_availability || {}))
311
- .reduce((p, c) => p.filter(e => c.includes(e)), []) // Initialize accumulator as an empty array
320
+ .reduce((p, c) => p.filter(e => c.includes(e)), [])
312
321
  .map(sku => Number(sku));
322
+ this.computeAvailability();
313
323
  }
314
324
  handleRequiredMultipleOptions(option) {
315
325
  if (option.type !== DisplayType.MULTIPLE_OPTIONS || !option.required) {
@@ -513,7 +523,7 @@ export class SallaProductOptions {
513
523
  if (this.optionsData?.length === 0) {
514
524
  return;
515
525
  }
516
- return (h(Host, { class: "s-product-options-wrapper" }, h("salla-conditional-fields", null, this.optionsData.map((option) => h("div", { key: option.id, class: `s-product-options-option-container${option.visibility_condition || this.hideDigitalCardsOptions(option) ? ' hidden' : ''}`, "data-option-id": option.id, ...this.getOptionShownWhen(option) }, option.name === 'splitter' ?
526
+ return (h(Host, { class: { 's-product-options-wrapper': true, 's-product-options-no-padding': this.noPadding } }, h("salla-conditional-fields", null, this.optionsData.map((option) => h("div", { key: option.id, class: `s-product-options-option-container${option.visibility_condition || this.hideDigitalCardsOptions(option) ? ' hidden' : ''}`, "data-option-id": option.id, ...this.getOptionShownWhen(option) }, option.name === 'splitter' ?
517
527
  this.splitterOption()
518
528
  : h("div", { class: { "s-product-options-option": true, "s-product-options-option-booking": option.type === DisplayType.BOOKING && salla.url.is_page("cart") }, "data-option-type": option.type, "data-option-required": `${option.required}` }, h("label", { htmlFor: this.generateInputId(option.id), class: `s-product-options-option-label ${this.hideLabel(option) ? 's-product-options-option-label-hidden' : ''}` }, h("b", null, option.name, option.required && h("span", null, " * "), " "), h("small", null, option.placeholder)), h("div", { class: `s-product-options-option-content ${this.hideLabel(option) || (option.type === DisplayType.BOOKING && salla.url.is_page("cart")) ? 's-product-options-option-content-full-width' : ''}` }, this.getDisplayForType(option))))))));
519
529
  }
@@ -568,7 +578,9 @@ export class SallaProductOptions {
568
578
  }
569
579
  fillSelectedOptions() {
570
580
  this.selectedOptions = this.optionsData.reduce((acc, opt) => {
571
- const selectedDetails = opt.details.filter(detail => detail.is_selected);
581
+ // `details` is optional on the Option interface — input-type options
582
+ // (text/number/date/file) carry no choice list, so guard before filtering.
583
+ const selectedDetails = (opt.details ?? []).filter(detail => detail.is_selected);
572
584
  const mappedDetails = selectedDetails.map(detail => ({
573
585
  ...detail,
574
586
  option_id: opt.id
@@ -576,6 +588,25 @@ export class SallaProductOptions {
576
588
  return acc.concat(mappedDetails);
577
589
  }, []);
578
590
  }
591
+ /**
592
+ * Seed `selectedOptions` from API defaults (`is_selected: true`).
593
+ * componentWillLoad does this only on the cart page; non-cart callers
594
+ * (e.g. order-options modal) call this after mount to avoid the first
595
+ * multi-select toggle wiping the pre-selected defaults.
596
+ * */
597
+ async seedSelectedOptions() {
598
+ this.fillSelectedOptions();
599
+ // A required multi-select renders every checkbox `required`; handleRequiredMultipleOptions
600
+ // clears that once one is checked, but it only fires on user `change`. After seeding a
601
+ // pre-selected default we run it for the initial DOM so a defaulted-but-untouched required
602
+ // multi-select doesn't fail validation and block checkout. Defer to rAF so the seeded
603
+ // `checked` state is painted before we count it (matches the change-handler pattern above).
604
+ requestAnimationFrame(() => {
605
+ this.optionsData
606
+ ?.filter(o => o.type === DisplayType.MULTIPLE_OPTIONS && o.required)
607
+ .forEach(o => this.handleRequiredMultipleOptions(o));
608
+ });
609
+ }
579
610
  async componentDidLoad() {
580
611
  if (!this.optionsData?.length) {
581
612
  return;
@@ -638,6 +669,7 @@ export class SallaProductOptions {
638
669
  this.disableCardValue = false;
639
670
  this.canDisabled = true;
640
671
  this.fillSelectedOptions();
672
+ this.computeAvailability();
641
673
  }
642
674
  /**
643
675
  * Enable user-initiated validation mode so invalid fields will scroll into view
@@ -748,22 +780,14 @@ export class SallaProductOptions {
748
780
  //and because we are using this inside select option, we need to replace the html currency symbol with the store currency symbol
749
781
  return detailName.replace('<i class=sicon-sar></i>', salla.config.currency()?.symbol || 'ر.س');
750
782
  }
783
+ computeAvailability() {
784
+ this.availabilityMap = computeAvailabilityMap(this.optionsData || [], this.selectedOptions || []);
785
+ }
751
786
  isOptionDetailOut(detail) {
752
- if (detail.is_out || !detail.skus_availability || !this.selectedSkus?.length) {
753
- return detail.is_out;
754
- }
755
- const isDetailSelected = this.selectedOptions.filter(option => option.id === detail.id).length;
756
- //if the current options is the only selected option, so we are sure that it's not out, because there is no other options selected yet
757
- if (isDetailSelected && this.selectedOptions.length === 1) {
758
- return false;
759
- }
760
- //if current details has sku in the possible outSkus it's out for sure
761
- if (isDetailSelected) {
762
- //here we will get the possible outSkus for current selected options
763
- const outSelectableSkus = this.selectedSkus.filter(sku => this.outSkus.includes(sku));
764
- return Object.keys(detail.skus_availability).some(sku => outSelectableSkus.includes(Number(sku)));
765
- }
766
- return this.selectedOptions.some(option => option.is_out && option.option_id !== detail.option_id);
787
+ const status = this.availabilityMap[detail.id];
788
+ // !!detail.is_out guards against TypeScript optimising away `?? false`
789
+ // for the non-nullable `is_out: boolean` field when the value is actually undefined at runtime.
790
+ return status !== undefined ? status !== 'available' : !!detail.is_out;
767
791
  }
768
792
  /**
769
793
  * Renders a single input element (radio or checkbox) for an option detail.
@@ -776,10 +800,14 @@ export class SallaProductOptions {
776
800
  */
777
801
  renderInput(type, detail, option, isRequired, name, buttonStyle) {
778
802
  const id = this.generateUniqueKey(`${type}-${option.id}-${detail.id}`);
779
- const isDisabled = this.isOptionDetailOut(detail);
803
+ const isOutOfStock = this.isOptionDetailOut(detail);
780
804
  return (h("label", { class: {
781
- "s-product-options-disabled": isDisabled,
782
- } }, h("input", { id: id, type: type, name: name, value: detail.id, disabled: isDisabled, required: isRequired, checked: detail.is_selected, onInvalid: (e) => this.invalidHandler(e, option), onChange: (e) => this.changedHandler(e, option) }), h("div", { class: { "s-product-options-grid-mode-span": buttonStyle, "s-product-options-disabled": isDisabled } }, this.getOptionDetailName(detail))));
805
+ "s-product-options-disabled": this.canDisabled && isOutOfStock,
806
+ "s-product-options-option-stock-out": isOutOfStock,
807
+ } }, h("input", { id: id, type: type, name: name, value: detail.id, disabled: this.canDisabled && isOutOfStock, required: isRequired, checked: detail.is_selected, onInvalid: (e) => this.invalidHandler(e, option), onChange: (e) => this.changedHandler(e, option) }), h("div", { class: {
808
+ "s-product-options-grid-mode-span": buttonStyle,
809
+ "s-product-options-disabled": this.canDisabled && isOutOfStock,
810
+ } }, this.getOptionDetailName(detail))));
783
811
  }
784
812
  /**
785
813
  * Renders a collection of input elements for all details of an option.
@@ -852,15 +880,22 @@ export class SallaProductOptions {
852
880
  }
853
881
  //@ts-ignore
854
882
  colorOption(option) {
855
- return (h("fieldset", { class: "s-product-options-colors-wrapper" }, option?.details.map((detail) => (h("div", { class: "s-product-options-colors-item", key: detail.id }, h("input", { type: "radio", value: detail.id, required: !option.visibility_condition && option.required, checked: detail.is_selected, name: this.generateInputName(option.id), disabled: this.canDisabled && this.isOptionDetailOut(detail), id: this.generateUniqueKey(`color-${this.productId}-${option.id}-${detail.id}`), onInvalid: (e) => this.invalidHandler(e, option), onChange: (e) => this.changedHandler(e, option), "data-img-id": detail.option_value }), h("label", { htmlFor: this.generateUniqueKey(`color-${this.productId}-${option.id}-${detail.id}`), "data-img-id": detail.option_value }, h("span", { style: { backgroundColor: detail.color } }), h("div", { innerHTML: this.getOptionDetailName(detail, true, option.type) })))))));
883
+ return (h("fieldset", { class: "s-product-options-colors-wrapper" }, option?.details.map((detail) => {
884
+ const isOutOfStock = this.isOptionDetailOut(detail);
885
+ return (h("div", { class: {
886
+ "s-product-options-colors-item": true,
887
+ "s-product-options-option-stock-out": isOutOfStock,
888
+ }, key: detail.id }, h("input", { type: "radio", value: detail.id, required: !option.visibility_condition && option.required, checked: detail.is_selected, name: this.generateInputName(option.id), disabled: this.canDisabled && isOutOfStock, id: this.generateUniqueKey(`color-${this.productId}-${option.id}-${detail.id}`), onInvalid: (e) => this.invalidHandler(e, option), onChange: (e) => this.changedHandler(e, option), "data-img-id": detail.option_value }), h("label", { htmlFor: this.generateUniqueKey(`color-${this.productId}-${option.id}-${detail.id}`), "data-img-id": detail.option_value }, h("span", { style: { backgroundColor: detail.color } }), h("div", { innerHTML: this.getOptionDetailName(detail, true, option.type) }))));
889
+ })));
856
890
  }
857
891
  //@ts-ignore
858
892
  thumbnailOption(option) {
859
893
  return h("div", { class: "s-product-options-thumbnails-wrapper" }, option.details.map((detail) => {
860
- return h("div", { key: detail.id }, h("input", { type: "radio", value: detail.id, "data-itemid": detail.id, required: !option.visibility_condition && option.required, checked: detail.is_selected, name: this.generateInputName(option.id), "data-img-id": detail.option_value, disabled: this.canDisabled && this.isOptionDetailOut(detail), id: this.generateUniqueKey(`option_${this.productId}-${option.id}_${detail.id}`), onInvalid: (e) => this.invalidHandler(e, option), onChange: (e) => this.changedHandler(e, option) }), h("label", { htmlFor: this.generateUniqueKey(`option_${this.productId}-${option.id}_${detail.id}`), "data-img-id": detail.option_value, class: "go-to-slide" }, h("img", { "data-src": detail.image, src: detail.image, title: detail.name, alt: detail.name }), h("span", { innerHTML: CheckCircleIcon, class: "s-product-options-thumbnails-icon" }), this.isOptionDetailOut(detail) ?
894
+ const isOutOfStock = this.isOptionDetailOut(detail);
895
+ return h("div", { key: detail.id, class: { "s-product-options-option-stock-out": isOutOfStock } }, h("input", { type: "radio", value: detail.id, "data-itemid": detail.id, required: !option.visibility_condition && option.required, checked: detail.is_selected, name: this.generateInputName(option.id), "data-img-id": detail.option_value, disabled: this.canDisabled && isOutOfStock, id: this.generateUniqueKey(`option_${this.productId}-${option.id}_${detail.id}`), onInvalid: (e) => this.invalidHandler(e, option), onChange: (e) => this.changedHandler(e, option) }), h("label", { htmlFor: this.generateUniqueKey(`option_${this.productId}-${option.id}_${detail.id}`), "data-img-id": detail.option_value, class: "go-to-slide" }, h("img", { "data-src": detail.image, src: detail.image, title: detail.name, alt: detail.name }), h("span", { innerHTML: CheckCircleIcon, class: "s-product-options-thumbnails-icon" }), isOutOfStock ?
861
896
  [
862
- h("small", { key: detail.id, class: "s-product-options-thumbnails-stock-badge" }, this.outOfStockText),
863
- this.canDisabled ? h("div", { key: detail.id, class: "s-product-options-thumbnails-badge-overlay" }) : '',
897
+ h("small", { key: `badge-${detail.id}`, class: "s-product-options-thumbnails-stock-badge" }, this.outOfStockText),
898
+ this.canDisabled ? h("div", { key: `overlay-${detail.id}`, class: "s-product-options-thumbnails-badge-overlay" }) : '',
864
899
  ]
865
900
  : ''), h("p", null, this.getOptionDetailName(detail, false), " "));
866
901
  }));
@@ -875,7 +910,8 @@ export class SallaProductOptions {
875
910
  }
876
911
  countryOption(option) {
877
912
  return h("div", { class: "s-product-options-digital-card-wrapper" }, option.details.map((detail) => {
878
- return h("label", { htmlFor: this.generateUniqueKey(detail.id.toString()), key: detail.id, class: { "s-product-options-digital-card-option": true, "s-product-options-digital-card-option-stock-out": detail.is_out } }, h("input", { id: this.generateUniqueKey(detail.id.toString()), type: "radio", class: "s-form-control s-product-options-digital-card-input", value: detail.id, name: this.generateInputName(option.id), disabled: detail.is_out, required: !option.visibility_condition && option.required, onInvalid: (e) => this.invalidHandler(e, option), onChange: e => this.changedHandler(e, option), onClick: () => { this.disableCardValue = false; }, ...(salla.url.is_page("cart") ? { defaultChecked: this.getSelectedDigitalCardOptions(option)?.id === detail.id } : {}) }), h("img", { loading: "lazy", alt: detail.code, height: 24, width: 24, class: "s-product-options-country-flag", src: `https://cdn.assets.salla.network/prod/admin/cp/assets/flags/1x1/${String(detail.code).toLocaleLowerCase()}.svg`, onError: e => {
913
+ const isOutOfStock = this.isOptionDetailOut(detail);
914
+ return h("label", { htmlFor: this.generateUniqueKey(detail.id.toString()), key: detail.id, class: { "s-product-options-digital-card-option": true, "s-product-options-digital-card-option-stock-out": isOutOfStock, "s-product-options-option-stock-out": isOutOfStock } }, h("input", { id: this.generateUniqueKey(detail.id.toString()), type: "radio", class: "s-form-control s-product-options-digital-card-input", value: detail.id, name: this.generateInputName(option.id), disabled: this.canDisabled && isOutOfStock, required: !option.visibility_condition && option.required, onInvalid: (e) => this.invalidHandler(e, option), onChange: e => this.changedHandler(e, option), onClick: () => { this.disableCardValue = false; }, ...(salla.url.is_page("cart") ? { defaultChecked: this.getSelectedDigitalCardOptions(option)?.id === detail.id } : {}) }), h("img", { loading: "lazy", alt: detail.code, height: 24, width: 24, class: "s-product-options-country-flag", src: `https://cdn.assets.salla.network/prod/admin/cp/assets/flags/1x1/${String(detail.code).toLocaleLowerCase()}.svg`, onError: e => {
879
915
  e.currentTarget.onerror = null;
880
916
  e.currentTarget.src =
881
917
  salla.url.cdn('images/globe.svg');
@@ -1009,6 +1045,26 @@ export class SallaProductOptions {
1009
1045
  "getter": false,
1010
1046
  "setter": false,
1011
1047
  "reflect": false
1048
+ },
1049
+ "noPadding": {
1050
+ "type": "boolean",
1051
+ "attribute": "no-padding",
1052
+ "mutable": false,
1053
+ "complexType": {
1054
+ "original": "boolean",
1055
+ "resolved": "boolean",
1056
+ "references": {}
1057
+ },
1058
+ "required": false,
1059
+ "optional": false,
1060
+ "docs": {
1061
+ "tags": [],
1062
+ "text": "Strip the wrapper's padding (keeps the background, rounded corners, margin).\nUsed by callers that need the options to sit flush inside their own surface."
1063
+ },
1064
+ "getter": false,
1065
+ "setter": false,
1066
+ "reflect": false,
1067
+ "defaultValue": "false"
1012
1068
  }
1013
1069
  };
1014
1070
  }
@@ -1027,7 +1083,8 @@ export class SallaProductOptions {
1027
1083
  "disableCardValue": {},
1028
1084
  "availableDigitalCardValues": {},
1029
1085
  "userInitiatedValidation": {},
1030
- "isCartMode": {}
1086
+ "isCartMode": {},
1087
+ "availabilityMap": {}
1031
1088
  };
1032
1089
  }
1033
1090
  static get events() {
@@ -1211,6 +1268,23 @@ export class SallaProductOptions {
1211
1268
  "tags": []
1212
1269
  }
1213
1270
  },
1271
+ "seedSelectedOptions": {
1272
+ "complexType": {
1273
+ "signature": "() => Promise<void>",
1274
+ "parameters": [],
1275
+ "references": {
1276
+ "Promise": {
1277
+ "location": "global",
1278
+ "id": "global::Promise"
1279
+ }
1280
+ },
1281
+ "return": "Promise<void>"
1282
+ },
1283
+ "docs": {
1284
+ "text": "Seed `selectedOptions` from API defaults (`is_selected: true`).\ncomponentWillLoad does this only on the cart page; non-cart callers\n(e.g. order-options modal) call this after mount to avoid the first\nmulti-select toggle wiping the pre-selected defaults.",
1285
+ "tags": []
1286
+ }
1287
+ },
1214
1288
  "enterCartMode": {
1215
1289
  "complexType": {
1216
1290
  "signature": "() => Promise<void>",
@@ -45,11 +45,11 @@ export class SallaProductSizeGuide {
45
45
  return h("salla-placeholder", { alignment: "center", iconSize: "xl" }, h("div", { slot: "title" }, this.placeholder_title), h("div", { slot: "description" }, this.placeholder_description));
46
46
  }
47
47
  render() {
48
- return (h("salla-modal", { key: 'de368aff05a19d87eb4e99f4e1d7eee36155f435', class: "s-product-size-guide-wrapper", id: 'salla-product-size-guide-modal', isLoading: true, "has-skeleton": true, width: "md", ref: modal => this.modal = modal }, h("span", { key: 'c4ab31b3e6ef2751761ca2db27554f7f5bf057fc', slot: 'icon', class: "s-product-size-guide-header-icon", innerHTML: PencilRuler }), h("div", { key: '17cfceb5ccb0546928f87f956267e9d0c11017ac', slot: "loading" }, h("div", { key: '4f4e20a62396d7825315203ffd22a72030e821b1', class: "s-product-size-guide-skeleton" }, h("salla-skeleton", { key: 'd9132b26634ae1997dad9f1229b248c2cd76fff0', height: '15px', width: '25%' }), h("div", { key: '1b6a236851eef6e7caf7b7a0e84e591824b4e4ef', class: "s-product-size-guide-skeleton-header" }, h("salla-skeleton", { key: 'bae06741881b57b4eb853f1256a22f9393d9cea4', height: '40px' }), h("salla-skeleton", { key: 'fdeb75a853f89df154b69dbd48fc8e233561af59', height: '40px' }), h("salla-skeleton", { key: 'd0be70bc141f04fd24adc86c56eec3a5e896f2d4', height: '40px' }), h("salla-skeleton", { key: 'c5146addbf2d5b9bda05170a9743cad0e08d8674', height: '40px' })), h("div", { key: '04dbbffe2de708c984c5d0966aa2b86c0051bd14', class: "s-product-size-guide-skeleton-content" }, h("salla-skeleton", { key: '320fb33a2e5d9ee1f4b87c18b3f3dd13de180d4f', height: '15px', width: '25%' }), h("salla-skeleton", { key: 'f06aeac8e2f8ea86ec9b1c5c6f2b31172f23209f', height: '10px', width: '75%' }), h("salla-skeleton", { key: '1accf852a34edcac77a77151ebf67ba8e05cc729', height: '10px', width: '50%' }), h("salla-skeleton", { key: '42d4c3364779a6ee130339e37affe2e0c590e6a7', height: '10px', width: '75%' }), h("salla-skeleton", { key: '13064a231460414b4a0abd19dda41b01ac1ee04f', height: '10px', width: '100%' }), h("salla-skeleton", { key: 'd5a50f96ca3bab125503f836cd883cfb98ca135d', height: '10px', width: '25%' }), h("salla-skeleton", { key: '11cd2ed36d9754c32173f14cd7d5ea99fc2b5577', height: '10px', width: '60%' }), h("salla-skeleton", { key: 'a5b3a192d0e38dc13a025b8b8e0aba767f35611b', height: '10px', width: '45%' }), h("salla-skeleton", { key: 'dddcb26038e180fb5b686b29d286316d4314909f', height: '10px', width: '30%' })))), h("slot", { key: '43a08b9b6e64955b726b832f0849617ac31d4c25', name: "header" }), !this.hasError && !!this.guides ?
48
+ return (h("salla-modal", { key: '750cca54e5286fc1b77942cc4a9784970b8569ec', class: "s-product-size-guide-wrapper", id: 'salla-product-size-guide-modal', isLoading: true, "has-skeleton": true, width: "md", ref: modal => this.modal = modal }, h("span", { key: '0aecc3b447a0ef8f92183c1c785c2a8bbf139c17', slot: 'icon', class: "s-product-size-guide-header-icon", innerHTML: PencilRuler }), h("div", { key: '1720d30460d99d578365cae9d6a0e92790f834a2', slot: "loading" }, h("div", { key: '0bf85ba5de7db72b7e4f4d94e592dc951c1d3801', class: "s-product-size-guide-skeleton" }, h("salla-skeleton", { key: '3635e6c238400762f5c70266bb8359cf3c1c0527', height: '15px', width: '25%' }), h("div", { key: '0adfa776efbf9e7d988d08a3dce69900d6d3d737', class: "s-product-size-guide-skeleton-header" }, h("salla-skeleton", { key: '53799c8bd0f495ec723d0cf4be0ab0e978351c23', height: '40px' }), h("salla-skeleton", { key: 'a825da569d6453a5e3b6cac9cf5848f941af22ae', height: '40px' }), h("salla-skeleton", { key: 'd2091d09ca662aef1f2d6b3cddb4bf86ccc77c0f', height: '40px' }), h("salla-skeleton", { key: '5974a5b7227d03979ea5a65f2f1481f59ca6e0fe', height: '40px' })), h("div", { key: '6e12dc1b703488433f5e8047efe16d70ebaec8c3', class: "s-product-size-guide-skeleton-content" }, h("salla-skeleton", { key: '9d54f957ba7e4c78fff9ed693179d5f7faa55a25', height: '15px', width: '25%' }), h("salla-skeleton", { key: '946eedae2371d7df9d1b9cf8cf1b0f7800554eed', height: '10px', width: '75%' }), h("salla-skeleton", { key: '35d38d23f73bb4bbd4dc5372b70cd34f09cec2ea', height: '10px', width: '50%' }), h("salla-skeleton", { key: '8f13518e172127af747f50773f7a7f0d64d2c0ba', height: '10px', width: '75%' }), h("salla-skeleton", { key: '759708410b562babb733f401cdf8ee310761b110', height: '10px', width: '100%' }), h("salla-skeleton", { key: 'ad8d12dcefe5fbbd8dfa4060a028a3387186ffa1', height: '10px', width: '25%' }), h("salla-skeleton", { key: '63c5864943ec23a3a42761c90ca019acd7118f8c', height: '10px', width: '60%' }), h("salla-skeleton", { key: '490d6078c8d382740eb92c825a08e2aad203c4af', height: '10px', width: '45%' }), h("salla-skeleton", { key: '10b0d73e6a34990a2d23554faec6bce24dcc234e', height: '10px', width: '30%' })))), h("slot", { key: '3d0a3e42eba7cc521e8df1fbb2e7323962bff5a8', name: "header" }), !this.hasError && !!this.guides ?
49
49
  [
50
50
  h("salla-tabs", null, this.guides.map((guide) => h("salla-tab-header", { slot: "header", name: guide.name }, h("span", null, guide.name))), this.guides.map((guide) => h("salla-tab-content", { slot: "content", name: guide.name }, h("div", { innerHTML: guide.description }))))
51
51
  ]
52
- : this.showPlaceholder(), h("slot", { key: '5ae0956ca1f9313b5ef3d01dbdcab32f2e975e05', name: "footer" })));
52
+ : this.showPlaceholder(), h("slot", { key: 'd1fc7cdbbd52a1c3c2b08f45a647e7ea1586cc9d', name: "footer" })));
53
53
  }
54
54
  static get is() { return "salla-product-size-guide"; }
55
55
  static get originalStyleUrls() {
@@ -91,7 +91,7 @@ export class SallaQuantityInput {
91
91
  if (!inputAttributes['aria-label'] && !inputAttributes['aria-labelledby']) {
92
92
  inputAttributes['aria-label'] = salla.lang.getWithDefault('common.elements.quantity', 'Quantity');
93
93
  }
94
- return (h(Host, { key: '4829904a6c2ed7710214caf1b2888e2a58b38eed', class: "s-quantity-input" }, h("div", { key: '8dd2592d3aed1dda990a9c818b78514540612a60', class: "s-quantity-input-container" }, h("button", { key: 'ea93501ee59066cbfb11ea8bf239073b33fa9eff', onClick: () => this.increase(), class: "s-quantity-input-increase-button s-quantity-input-button", type: "button", "aria-label": salla.lang.getWithDefault('common.elements.increase_quantity', 'Increase quantity') }, !this.hasIncrementSlot ? h("span", { innerHTML: Add }) : '', h("slot", { key: '61c70812d9cdb7c8c66b70d5c3a1f0522fccb542', name: "increment-button" })), h("input", { key: '02793b5365470afd59481ff987fe8d3da658bd48', class: "s-quantity-input-input", ...inputAttributes, ref: (el) => this.textInput = el, onInput: (event) => this.setValue(event.target.value), inputMode: "numeric", pattern: "[0-9]*", min: "1", readOnly: this.disableInput, value: this.quantity }), h("button", { key: '920f9020926a7d4cf77b2b971e35eb1586132c72', class: "s-quantity-input-decrease-button s-quantity-input-button", onClick: () => this.decrease(), type: "button", "aria-label": salla.lang.getWithDefault('common.elements.decrease_quantity', 'Decrease quantity') }, !this.hasDecrementSlot ? h("span", { innerHTML: Minus }) : '', h("slot", { key: '105487e60b1b5e7d0cf092f3b17fd085f61a8f1d', name: "decrement-button" })))));
94
+ return (h(Host, { key: 'ada66e864b927a5a1ec496c528b0f35121cb0e3e', class: "s-quantity-input" }, h("div", { key: '55601a364982154960a0513b507bfd7e349eea3f', class: "s-quantity-input-container" }, h("button", { key: 'e4f652ee5aa01e9be701f375c1d6c67821624b1d', onClick: () => this.increase(), class: "s-quantity-input-increase-button s-quantity-input-button", type: "button", "aria-label": salla.lang.getWithDefault('common.elements.increase_quantity', 'Increase quantity') }, !this.hasIncrementSlot ? h("span", { innerHTML: Add }) : '', h("slot", { key: '811f80ce4faa3ae783070ee18df09024dc157016', name: "increment-button" })), h("input", { key: '6f5db2fb1f02a7f3a80d9ac769608c0956942df1', class: "s-quantity-input-input", ...inputAttributes, ref: (el) => this.textInput = el, onInput: (event) => this.setValue(event.target.value), inputMode: "numeric", pattern: "[0-9]*", min: "1", readOnly: this.disableInput, value: this.quantity }), h("button", { key: '835ad4fc21b7926de520972fb0c550009b143c26', class: "s-quantity-input-decrease-button s-quantity-input-button", onClick: () => this.decrease(), type: "button", "aria-label": salla.lang.getWithDefault('common.elements.decrease_quantity', 'Decrease quantity') }, !this.hasDecrementSlot ? h("span", { innerHTML: Minus }) : '', h("slot", { key: 'c03fec4e1736df09bd555a04ded8941a50244eb2', name: "decrement-button" })))));
95
95
  }
96
96
  static get is() { return "salla-quantity-input"; }
97
97
  static get originalStyleUrls() {
@@ -3,6 +3,7 @@
3
3
  */
4
4
  import { Host, h } from "@stencil/core";
5
5
  import "@salla.sa/applepay/src/index";
6
+ import { resolveApplePayOrderOptions, appendOrderOptionsToPayload, reportProductOptionsValiditySync, } from "../salla-order-options-modal/apple-pay-order-options";
6
7
  export class SallaQuickBuy {
7
8
  constructor() {
8
9
  /**
@@ -25,32 +26,82 @@ export class SallaQuickBuy {
25
26
  * @default {}
26
27
  */
27
28
  this.options = {};
29
+ /** Modal selections, merged into the quick-purchase payload. */
30
+ this.collectedOrderOptions = [];
31
+ /** Flips true after the first onStartedSession so the second dispatch begins. */
32
+ this.optionsResolved = false;
33
+ /** PDP price + selected order-option prices (from the modal). */
34
+ this.applePayAmount = 0;
35
+ /** Session from the initial gesture; begun later when there are no order options. */
36
+ this.pendingApplePaySession = null;
28
37
  this.quickBuy = salla.lang.get('pages.products.buy_now');
38
+ /** Apple Pay onStartedSession: first call defers begin() to run the OO check; second (resolved) begins. */
39
+ this.handleApplePaySessionStarted = (session) => {
40
+ // Order options disabled → let Apple Pay begin normally, as if the feature didn't exist.
41
+ if (!salla.config.get('store.settings.order_options.mandatory', false))
42
+ return false;
43
+ if (this.optionsResolved)
44
+ return false;
45
+ this.optionsResolved = true;
46
+ this.pendingApplePaySession = session;
47
+ resolveApplePayOrderOptions({
48
+ productId: this.productId,
49
+ amount: Number(this.amount),
50
+ quantity: this.getSelectedQuantity(),
51
+ beginPendingSession: () => {
52
+ this.pendingApplePaySession?.begin();
53
+ this.pendingApplePaySession = null;
54
+ },
55
+ discardPendingSession: () => { this.pendingApplePaySession = null; },
56
+ onSubmit: (selections, total) => {
57
+ this.collectedOrderOptions = selections;
58
+ this.applePayAmount = total;
59
+ this.settlePayment();
60
+ },
61
+ });
62
+ return true;
63
+ };
29
64
  salla.lang.onLoaded(() => {
30
65
  this.quickBuy = salla.lang.get('pages.products.buy_now');
31
66
  });
32
67
  }
33
- async quickBuyHandler() {
34
- // user guest and guest-checkout not enabled
68
+ quickBuyHandler() {
35
69
  if (salla.config.isGuest() && !this.isGuestCheckout()) {
36
70
  this.requireLogin.emit({ productId: this.productId });
37
- // todo (low) :: find a way to re-fire the method after success
38
- let afterLoginEvent = "salla-quick-buy::user.logged-in";
39
- salla.event.on(afterLoginEvent, () => this.settlePayment());
40
- salla.api.auth.setAfterLoginEvent(afterLoginEvent);
41
- return salla.auth.event.dispatch('login::open', { withoutReload: true });
71
+ salla.api.auth.requireLoginThen('salla-quick-buy::user.logged-in', () => this.quickBuyHandler());
72
+ return;
42
73
  }
43
- await this.settlePayment();
74
+ // Sync validate — AP needs the gesture preserved for new ApplePaySession().
75
+ if (!this.validatePdpOptionsSync())
76
+ return;
77
+ this.optionsResolved = false;
78
+ this.collectedOrderOptions = [];
79
+ this.applePayAmount = 0;
80
+ this.settlePayment();
44
81
  }
45
- async settlePayment() {
46
- let optionsElement = document.querySelector(`salla-product-options[product-id="${this.productId}"]`);
47
- //make sure all the required options are selected
48
- if (optionsElement && !await optionsElement.reportValidity()) {
49
- this.validationFailed.emit({ productId: this.productId });
50
- return salla.error(salla.lang.get('common.messages.required_fields'));
82
+ /** Sync PDP-option validity (preserves the AP gesture); emits + notifies on failure. */
83
+ validatePdpOptionsSync() {
84
+ if (reportProductOptionsValiditySync(this.productId))
85
+ return true;
86
+ this.validationFailed.emit({ productId: this.productId });
87
+ salla.error(salla.lang.get('common.messages.required_fields'));
88
+ return false;
89
+ }
90
+ /** Read the live PDP quantity from the form so order-options match the real cart line. */
91
+ getSelectedQuantity() {
92
+ try {
93
+ const data = this.host.getElementSallaData?.();
94
+ const qty = Number(data instanceof FormData ? data.get('quantity') : data?.quantity);
95
+ return Number.isFinite(qty) && qty > 0 ? qty : 1;
96
+ }
97
+ catch {
98
+ return 1;
51
99
  }
100
+ }
101
+ async settlePayment() {
52
102
  //use this way to get quantity too
53
103
  let data = this.host.getElementSallaData();
104
+ appendOrderOptionsToPayload(data, this.collectedOrderOptions);
54
105
  // if the store doesn't have Apple Pay , just create a cart and then redirect to check out page
55
106
  if (!this.isApplePayActive) {
56
107
  // return salla.product.buyNow(this.productId, data);
@@ -68,13 +119,16 @@ export class SallaQuickBuy {
68
119
  }
69
120
  // noinspection TypeScriptValidateJSTypes
70
121
  salla.event.dispatch('payments::apple-pay.start-transaction', {
71
- amount: this.amount, // 1000
122
+ // Prefer the modal's collected total (PDP price + selected OO additional_prices).
123
+ // Falls back to PDP live amount when no OO modal ran.
124
+ amount: this.applePayAmount > 0 ? this.applePayAmount : this.amount,
72
125
  currency: this.currency || 'SAR', // SAR
73
126
  requiredShippingContactFields: this.getRequiredShippingContactFields(),
74
127
  shippingMethods: this.isRequireShipping ? [] : undefined,
75
128
  supportedNetworks: salla.config.get('store.settings.buy_now.networks'),
76
129
  supportedCountries: salla.config.get('store.settings.buy_now.countries'),
77
130
  countryCode: salla.config.get('store.store_country') || 'SA',
131
+ onStartedSession: this.handleApplePaySessionStarted,
78
132
  validateMerchant: {
79
133
  url: this.validateHost ? `${this.validateHost}/checkout/applepay/validate` : salla.url.get('checkout/applepay/validate'),
80
134
  onSuccess: (response) => {
@@ -205,7 +259,7 @@ export class SallaQuickBuy {
205
259
  });
206
260
  }
207
261
  render() {
208
- return h(Host, { key: '078fa17510403612cf8204899fee395f057b88bd' }, this.quickBuyButton());
262
+ return h(Host, { key: 'fb1bdf862d9b9cea58df14862f7ec9c4be388585' }, this.quickBuyButton());
209
263
  }
210
264
  quickBuyButton() {
211
265
  return h("apple-pay-button", { locale: salla?.config?.get?.('user.language_code') || 'ar', onClick: () => this.quickBuyHandler(), "data-quick-purchase": "applepay", class: "s-quick-buy-apple-pay", "data-is-applepay": "1", buttonstyle: "black", type: this.type });
@@ -158,7 +158,7 @@ export class SallaReviewCard {
158
158
  return (h("a", { href: this.review?.product?.url, class: "s-review-card-product-container" }, h("img", { alt: product.image?.alt || "Product", src: product.image?.url, class: "s-review-card-product-image", width: 60, height: 60, loading: "lazy", decoding: "async", draggable: false }), h("div", { class: "s-review-card-product-details" }, h("p", { class: "s-review-card-product-details-name" }, product.name), this.showPurchaseCount ? h("p", { class: "s-review-card-product-details-purchase-count" }, h("span", { innerHTML: IconFire2 }), this.purchasedCount) : null)));
159
159
  }
160
160
  render() {
161
- return h("div", { key: '7e833e08405a9153759b958e9c6979fd83c5aec1', class: "s-review-card-container" }, this.renderSlider(), this.renderSingleImage(), renderDivider(), h("div", { key: '85e33a2160a62e2fb3e376f6e20d223d53ced8fe', class: "s-review-card-content" }, this.renderHeader(), h("p", { key: '8b21485de56e57dceb9facb044bd6bad1ad866f3', class: "s-review-card-review-content", innerHTML: this.review?.content }), renderDivider(), this.renderProductInfo()));
161
+ return h("div", { key: '0772f783fe893c4d03a6d698909a09ecedb69fa6', class: "s-review-card-container" }, this.renderSlider(), this.renderSingleImage(), renderDivider(), h("div", { key: '5780bb57a79c04cef6cede906ce086f6811dad3c', class: "s-review-card-content" }, this.renderHeader(), h("p", { key: '7889fe4dfaf52d2e54adb667f21fc2fced195dd6', class: "s-review-card-review-content", innerHTML: this.review?.content }), renderDivider(), this.renderProductInfo()));
162
162
  }
163
163
  static get is() { return "salla-review-card"; }
164
164
  static get originalStyleUrls() {
@@ -85,7 +85,7 @@ export class SallaReviews {
85
85
  });
86
86
  }
87
87
  render() {
88
- return (h("div", { key: 'ab076b54664048719052cff15877bc5325c36393', class: "s-reviews-container" }, h("div", { key: 'da56343050cd2e9fe7ac7cf08b348b1d6c6af5c2', class: "s-reviews-header-wrapper" }, h("h1", { key: '64e0fb721d9c6e4763de4e116d43f3d4206452dc', class: "s-reviews-header" }, this.testimonialText), !!this.displayAllLink ? (h("a", { href: this.displayAllURL, class: "s-reviews-display-all" }, this.displayAllLinkText, h("span", { class: "s-reviews-display-all-icon", innerHTML: IconArrowLeft }))) : null), h("salla-slider", { key: 'c1ccfde9f4a4a617a0a6f12f841469f953114c4a', centered: true, "slides-per-view": 1, type: "testimonials", class: "s-reviews-testimonials-slider", "controls-outer": true, "auto-play": true, id: `testimonials-${this.source}-slider` }, h("div", { key: 'c3c7ca7d611b20618d336e16e57b20e479bbbbee', slot: "items" }, this.reviews.map((item, index) => (h("div", { key: index, class: "s-reviews-swiper-slide" }, h("div", { class: "s-reviews-testimonial" }, h("div", { class: "s-reviews-testimonial__inner" }, h("div", { class: "s-reviews-testimonial__avatar" }, h("img", { src: 'images/s-empty.png', "data-src": item.avatar, alt: item.name ? item.name : 'testimonial-' + index, class: "lazy" })), h("div", { class: "s-reviews-testimonial__text" }, h("p", { innerHTML: item.content }), h("div", { class: "s-reviews-testimonial__name_wrapper" }, h("div", { class: "s-reviews-testimonial__info" }, item.name && h("h2", null, `${item.name}`)), h("div", { class: "s-reviews-testimonial__rating" }, h("salla-rating-stars", { size: "small", value: item.stars })))), h("span", { class: "s-reviews-testimonial__icon", innerHTML: IconQuoteOpen }))))))))));
88
+ return (h("div", { key: '24e50ca2634208ad3ffcb9ca503aa7e18331b3a1', class: "s-reviews-container" }, h("div", { key: 'a1632306fc1a92051d030707aab075c825537e01', class: "s-reviews-header-wrapper" }, h("h1", { key: 'e2a4df75011da111e89c1b732e7741ddf452b9d5', class: "s-reviews-header" }, this.testimonialText), !!this.displayAllLink ? (h("a", { href: this.displayAllURL, class: "s-reviews-display-all" }, this.displayAllLinkText, h("span", { class: "s-reviews-display-all-icon", innerHTML: IconArrowLeft }))) : null), h("salla-slider", { key: '89009e55e3a5121c241295efd510405b623f45c3', centered: true, "slides-per-view": 1, type: "testimonials", class: "s-reviews-testimonials-slider", "controls-outer": true, "auto-play": true, id: `testimonials-${this.source}-slider` }, h("div", { key: '8b6b8df42043c8ecdb05dbbc30ecacde297f0dda', slot: "items" }, this.reviews.map((item, index) => (h("div", { key: index, class: "s-reviews-swiper-slide" }, h("div", { class: "s-reviews-testimonial" }, h("div", { class: "s-reviews-testimonial__inner" }, h("div", { class: "s-reviews-testimonial__avatar" }, h("img", { src: 'images/s-empty.png', "data-src": item.avatar, alt: item.name ? item.name : 'testimonial-' + index, class: "lazy" })), h("div", { class: "s-reviews-testimonial__text" }, h("p", { innerHTML: item.content }), h("div", { class: "s-reviews-testimonial__name_wrapper" }, h("div", { class: "s-reviews-testimonial__info" }, item.name && h("h2", null, `${item.name}`)), h("div", { class: "s-reviews-testimonial__rating" }, h("salla-rating-stars", { size: "small", value: item.stars })))), h("span", { class: "s-reviews-testimonial__icon", innerHTML: IconQuoteOpen }))))))))));
89
89
  }
90
90
  static get is() { return "salla-reviews"; }
91
91
  static get originalStyleUrls() {
@@ -142,7 +142,7 @@ export class SallaReviewsPage {
142
142
  return options.map(option => (h("option", { key: option.value, value: option.value, selected: option.value === this.sort }, option.label)));
143
143
  }
144
144
  render() {
145
- return (h("host", { key: '1ca6e12aafb0b83953a887286003dce5f47c9374' }, h("div", { key: '9a353471f58a1fe67800f9d0ac38b3f94095b107', class: "s-reviews-page-header-wrapper" }, h("h2", { key: '0fc9c963af765108e42f341ac7d70c8758e4677a', class: "s-reviews-page-title" }, this.langTitlesReviews, h("span", { key: '13f2b001680a39440d3e5557bcfee46a92592ea4', class: "s-reviews-page-count" }, "(", this.langRatingReviews, ")")), h("div", { key: 'fcb5e88a598d342d4cdeff4cfba0a85ea94b911e', class: "s-reviews-page-filter-wrapper" }, h("label", { key: 'e2c23398b1024647c1cfdc283392b94e3ce0e44c', class: "s-reviews-page-filter-label", htmlFor: "testimonials-filter" }, this.langSorting), h("select", { key: '67f5f7748db13b7c6bdf3bbbb104d9f4b001df69', onChange: (e) => this.handleSorting(e), disabled: !this.reviews.length, class: "s-reviews-page-filter" }, this.renderSortingOptions()))), this.reviews.length ? h("main", { class: "s-reviews-page-grid", ref: el => {
145
+ return (h("host", { key: 'b82b491ae189f825367881b7b4f03ad64e471aae' }, h("div", { key: 'd124f10806cfabd1c1f85044786541011edff3ff', class: "s-reviews-page-header-wrapper" }, h("h2", { key: '30c58bb14bea27da968e874a0c1454a35e8db207', class: "s-reviews-page-title" }, this.langTitlesReviews, h("span", { key: '8850771469ae20d1b07efcb45be58738de377e6d', class: "s-reviews-page-count" }, "(", this.langRatingReviews, ")")), h("div", { key: '5a0060c5bdbfe4d37003b04d4c6368460be8cd38', class: "s-reviews-page-filter-wrapper" }, h("label", { key: '637d1aeec005ae662c6019c423ef3f1c3a6ff264', class: "s-reviews-page-filter-label", htmlFor: "testimonials-filter" }, this.langSorting), h("select", { key: '5b68b9441d4647f12583c71da61958c30c0dcda6', onChange: (e) => this.handleSorting(e), disabled: !this.reviews.length, class: "s-reviews-page-filter" }, this.renderSortingOptions()))), this.reviews.length ? h("main", { class: "s-reviews-page-grid", ref: el => {
146
146
  this.wrapper = el;
147
147
  } }, this.reviews.map(review => (h("salla-review-card", { key: review.id, review: review }))))
148
148
  : h("div", { class: "s-products-list-placeholder" }, h("span", { innerHTML: ShoppingBag }), h("p", null, this.placeholderText)), this.pagination?.links?.next && this.reviews.length ? (h("div", { class: "s-reviews-page-load-more-container" }, h("salla-button", { class: "s-reviews-page-load-more-btn", loading: this.isLoading, onClick: () => this.infiniteScroll?.loadNextPage(), onKeyUp: () => this.infiniteScroll?.loadNextPage() }, this.langLoadMore))) : null));
@@ -146,7 +146,7 @@ export class SallaScopees {
146
146
  return salla.onReady();
147
147
  }
148
148
  render() {
149
- return (h(Host, { key: 'bbf0b48e47cf334cc844cedc59ef5d430ce9cebe' }, h("salla-modal", { key: '20f8f0edb267c2a1e7cc23e930d06060916d5c64', ref: modal => this.modal = modal, isClosable: !!(this.isOpenedBefore || (this.selection == 'optional')), class: "s-scopes-modal", isLoading: this.loading, "has-skeleton": true }, this.loading ?
149
+ return (h(Host, { key: 'a7571c852749d4449b42e2c12d5597f6aded1f7f' }, h("salla-modal", { key: '48846fbac890e05c0deabe74138ad929a14796fb', ref: modal => this.modal = modal, isClosable: !!(this.isOpenedBefore || (this.selection == 'optional')), class: "s-scopes-modal", isLoading: this.loading, "has-skeleton": true }, this.loading ?
150
150
  h("div", { slot: "loading" }, h("div", { class: "s-scopes-skeleton" }, h("salla-list-tile", { class: "s-scopes-header" }, h("div", { slot: "icon", class: "s-scopes-header-icon" }, h("salla-skeleton", { type: "circle" })), h("div", { slot: "title", class: "s-scopes-header-title mb-5" }, h("salla-skeleton", { height: '15px', width: '50%' })), h("div", { slot: "subtitle", class: "s-scopes-header-subtitle" }, h("salla-skeleton", { height: '10px' }), h("salla-skeleton", { height: '10px', width: '75%' }))), h("div", { class: "s-scopes-skeleton-search" }, h("salla-skeleton", { height: '10px', width: '50%' }), h("salla-skeleton", { height: '30px', width: '100%' })), h("div", { class: "s-scopes-skeleton-scopes" }, h("salla-skeleton", { height: '10px', width: '30%' }), h("salla-skeleton", { height: '10px', width: '25%' }), h("salla-skeleton", { height: '10px', width: '30%' }), h("salla-skeleton", { height: '10px', width: '25%' }), h("salla-skeleton", { height: '10px', width: '30%' }), h("salla-skeleton", { height: '10px', width: '25%' }), h("salla-skeleton", { height: '10px', width: '30%' }), h("salla-skeleton", { height: '10px', width: '25%' })), h("div", { class: "s-scopes-skeleton-btn" }, h("salla-skeleton", { height: '40px', width: '100%' }))))
151
151
  :
152
152
  [h("salla-list-tile", { class: this.originalScopesList?.length ? "s-scopes-header block" : "s-hidden" }, h("div", { slot: "icon", class: "s-scopes-header-icon", innerHTML: StoreAlt }), h("div", { slot: "title", class: "s-scopes-header-title" }, salla.lang.get('blocks.scope.you_are_browse_store_from')), h("div", { slot: "subtitle", class: "s-scopes-header-subtitle" }, !!this.selected_scope ? this.selected_scope.name : "")), h("div", { class: "s-scopes-wrap" }, !!this.originalScopesList?.length && h("h4", { class: "s-scopes-title" }, this.getFormTitle()), this.originalScopesList?.length > this.searchDisplayLimit ?
@@ -127,10 +127,10 @@ export class SallaSearch {
127
127
  this.inputValue.length < 3 ? this.container.classList.remove('s-search-no-results') : '';
128
128
  }
129
129
  render() {
130
- const searchContent = (h("div", { key: '25c930505262a83f8a8385aa0ca665ecad2cacd1', class: { 's-search-container': true, 's-search-inline': this.inline }, ref: container => (this.container = container) }, h("div", { key: '09d705b9da70c128584891672ba84d660f3c6d6a', class: "s-search-input-wrapper" }, h("span", { key: '5749d0cf3ad58bf845ef116e4ee377c577a770e8', class: "s-search-icon-wrap" }, h("span", { key: 'b1acaab31a15f447fb3de27e34a0a0833620456e', class: "s-search-icon", innerHTML: this.loading ? '<i class="s-search-spinner-loader"/>' : Search })), h("input", { key: '14bbab4ab1e8be11f25e229fb8ea0e9c982f2df7', type: "search", enterkeyhint: "search", autocomplete: "off", class: "s-search-input", placeholder: salla.lang.get('blocks.header.search_placeholder'), onInput: (e) => this.limitWordsAndSearch(e), onKeyDown: e => this.handleKeyDown(e), ref: input => (this.searchInput = input), style: {
130
+ const searchContent = (h("div", { key: 'd7668846b013b4e8c9617193cd7457a585733960', class: { 's-search-container': true, 's-search-inline': this.inline }, ref: container => (this.container = container) }, h("div", { key: '7850ee638ab8dbe416be4fa7bd5601d821802776', class: "s-search-input-wrapper" }, h("span", { key: '09bfde1658f27487458076cb91954e530f91c8be', class: "s-search-icon-wrap" }, h("span", { key: '547eb4e1efba4bc1e46ce9a28816f4d39b26f638', class: "s-search-icon", innerHTML: this.loading ? '<i class="s-search-spinner-loader"/>' : Search })), h("input", { key: '2be7d24d980cbb37ee50c389ab03e8fa67eb3973', type: "search", enterkeyhint: "search", autocomplete: "off", class: "s-search-input", placeholder: salla.lang.get('blocks.header.search_placeholder'), onInput: (e) => this.limitWordsAndSearch(e), onKeyDown: e => this.handleKeyDown(e), ref: input => (this.searchInput = input), style: {
131
131
  height: this.height + 'px',
132
132
  borderRadius: this.oval ? this.height / 2 + 'px' : '',
133
- } }), this.showAction ? (h("salla-button", { loading: this.loading, class: { 's-search-action': true, 's-search-action-oval': this.oval }, onClick: () => this.handleActionClick() }, !this.loading && h("span", { innerHTML: Search }))) : null), h("div", { key: '9f3fe2a8b952ad3db8775eb3645cf837ad50acb2', class: "s-search-results" }, this.results?.data.map(product => (h("a", { href: product.url + '?from=search-bar', class: {
133
+ } }), this.showAction ? (h("salla-button", { loading: this.loading, class: { 's-search-action': true, 's-search-action-oval': this.oval }, onClick: () => this.handleActionClick() }, !this.loading && h("span", { innerHTML: Search }))) : null), h("div", { key: 'fb09f6adaf9c4d9b798a6c10e45c446c306f0d37', class: "s-search-results" }, this.results?.data.map(product => (h("a", { href: product.url + '?from=search-bar', class: {
134
134
  's-search-product': true,
135
135
  's-search-product-not-available': !product.is_available,
136
136
  }, innerHTML: this.productSlot
@@ -139,9 +139,9 @@ export class SallaSearch {
139
139
  .replace(/\{regular_price\}/g, product.is_on_sale && product.regular_price
140
140
  ? salla.money(product.regular_price)
141
141
  : '')
142
- .replace(/\{image\}/g, product.image.url) }))), h("p", { key: '641e4165e6538523792f33694118c618818b91c9', ref: el => (this.noResults = el), class: "s-search-no-results-placeholder" }, salla.lang.get('common.elements.no_options')))));
143
- const modalContent = (h("salla-modal", { key: '043edf7878b91643b3590bb9789a44df0a558af9', position: "top", class: "s-search-modal", ref: modal => (this.modal = modal) }, searchContent));
144
- const placeholderContent = (h("div", { key: 'f5a08dc2ced47954b5a3bb87d4bc66a59e5f2660', class: "s-search-placeholder-wrapper s-search-inline" }, h("div", { key: '94c66a1a7016718348a50e8b5bf07659f4dd97c7', class: "s-search-input-wrapper" }, h("span", { key: '9f7bd3e92af9abaf6a852437883d6485885273e8', class: "s-search-icon-wrap" }, h("span", { key: 'd907342a757eb19ef404c4dfccc273bc1341bac8', class: "s-search-icon", innerHTML: Search })), h("button", { key: 'dcc3fb071542009d706de08a23138ab46683aa6a', type: "button", class: "s-search-input s-search-placeholder-trigger", onClick: () => this.open(), style: {
142
+ .replace(/\{image\}/g, product.image.url) }))), h("p", { key: '7f81403f86aeddca49b39ca84750a7f148416e51', ref: el => (this.noResults = el), class: "s-search-no-results-placeholder" }, salla.lang.get('common.elements.no_options')))));
143
+ const modalContent = (h("salla-modal", { key: '75909547a855ed368527746c0d342309b6b1b656', position: "top", class: "s-search-modal", ref: modal => (this.modal = modal) }, searchContent));
144
+ const placeholderContent = (h("div", { key: '480110779039e31eb43a5cfb321ca3a53d36d986', class: "s-search-placeholder-wrapper s-search-inline" }, h("div", { key: 'ef5e5f05279cb5324f9981e6a73a926f36a28317', class: "s-search-input-wrapper" }, h("span", { key: 'def894edb583c66b66abde7b54602da821fe10ee', class: "s-search-icon-wrap" }, h("span", { key: '6d38ace3c0cc4bc98d9a87b0b558187ba82f57e3', class: "s-search-icon", innerHTML: Search })), h("button", { key: 'ff4ebaeb0eb6315121cd5927784783f34ee174fc', type: "button", class: "s-search-input s-search-placeholder-trigger", onClick: () => this.open(), style: {
145
145
  height: this.height + 'px',
146
146
  borderRadius: this.oval ? this.height / 2 + 'px' : '',
147
147
  } }, salla.lang.get('blocks.header.search_placeholder'))), modalContent));