@salla.sa/twilight-components 2.14.418 → 2.14.420

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 (383) hide show
  1. package/dist/cjs/{filepond-C1_8U7ht.js → filepond-CTL5dLDP.js} +1 -1
  2. package/dist/cjs/{filepond-plugin-file-poster-C2QZkcu0.js → filepond-plugin-file-poster-B-C_VVcX.js} +1 -1
  3. package/dist/cjs/{filepond-plugin-file-validate-size-CbVRd24w.js → filepond-plugin-file-validate-size-CzKg3e_q.js} +1 -1
  4. package/dist/cjs/{filepond-plugin-file-validate-type-63RP4vcL.js → filepond-plugin-file-validate-type-vnM88Tws.js} +1 -1
  5. package/dist/cjs/{filepond-plugin-image-edit-CjWMhhkZ.js → filepond-plugin-image-edit-DI2Woa_n.js} +1 -1
  6. package/dist/cjs/{filepond-plugin-image-exif-orientation-CJxStqYG.js → filepond-plugin-image-exif-orientation-DfOieqsR.js} +1 -1
  7. package/dist/cjs/{filepond-plugin-image-preview--RTa59Q8.js → filepond-plugin-image-preview-BnoA6sXp.js} +1 -1
  8. package/dist/cjs/{functions-T48FHZw8.js → functions-DlISHrKx.js} +1 -1
  9. package/dist/cjs/helpers-BJ2rnhxz.js +197 -0
  10. package/dist/cjs/{index-CQ4zjhzH.js → index-tOrYNNsf.js} +1 -1
  11. package/dist/cjs/{index-DO_QXaSt.js → index-vstkdqRz.js} +10 -6
  12. package/dist/cjs/interfaces-Bh7W0bEU.js +33 -0
  13. package/dist/cjs/loader.cjs.js +2 -2
  14. package/dist/cjs/salla-accordion-body_2.cjs.entry.js +1 -1
  15. package/dist/cjs/salla-accordion_6.cjs.entry.js +1 -1
  16. package/dist/cjs/salla-add-product-button_5.cjs.entry.js +36 -58
  17. package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
  18. package/dist/cjs/salla-alert_2.cjs.entry.js +1 -1
  19. package/dist/cjs/salla-app-install-alert.cjs.entry.js +1 -1
  20. package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
  21. package/dist/cjs/salla-badge.cjs.entry.js +1 -1
  22. package/dist/cjs/salla-booking-field_7.cjs.entry.js +12 -12
  23. package/dist/cjs/salla-bullet-delivery.cjs.entry.js +1 -1
  24. package/dist/cjs/salla-cart-coupons.cjs.entry.js +1 -1
  25. package/dist/cjs/salla-cart-item-offers_2.cjs.entry.js +1 -1
  26. package/dist/cjs/salla-comment-form_8.cjs.entry.js +4 -4
  27. package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
  28. package/dist/cjs/salla-contacts.cjs.entry.js +1 -1
  29. package/dist/cjs/salla-cookies-bar.cjs.entry.js +1 -1
  30. package/dist/cjs/salla-count-down.cjs.entry.js +1 -1
  31. package/dist/cjs/salla-custom-fields.cjs.entry.js +1 -1
  32. package/dist/cjs/salla-delivery-promise.cjs.entry.js +1 -1
  33. package/dist/cjs/salla-edit-order-button.cjs.entry.js +1 -1
  34. package/dist/cjs/salla-filters-widget.cjs.entry.js +1 -1
  35. package/dist/cjs/salla-filters.cjs.entry.js +1 -1
  36. package/dist/cjs/salla-fulfillment-methods.cjs.entry.js +1 -1
  37. package/dist/cjs/salla-gifting.cjs.entry.js +1 -1
  38. package/dist/cjs/salla-hook.cjs.entry.js +1 -1
  39. package/dist/cjs/salla-infinite-scroll.cjs.entry.js +1 -1
  40. package/dist/cjs/salla-installment.cjs.entry.js +1 -1
  41. package/dist/cjs/salla-list-tile.cjs.entry.js +1 -1
  42. package/dist/cjs/salla-localization-modal.cjs.entry.js +1 -1
  43. package/dist/cjs/salla-login-modal.cjs.entry.js +1 -1
  44. package/dist/cjs/salla-loyalty-banner.cjs.entry.js +2 -2
  45. package/dist/cjs/salla-loyalty-hero_2.cjs.entry.js +2 -2
  46. package/dist/cjs/salla-loyalty-panel.cjs.entry.js +8 -6
  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 +14 -3
  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 +1 -1
  56. package/dist/cjs/salla-multiple-bundle-product-options-modal_2.cjs.entry.js +1 -1
  57. package/dist/cjs/salla-multiple-bundle-product.cjs.entry.js +1 -1
  58. package/dist/cjs/salla-notification-item.cjs.entry.js +1 -1
  59. package/dist/cjs/salla-notifications.cjs.entry.js +1 -1
  60. package/dist/cjs/salla-offer-modal.cjs.entry.js +1 -1
  61. package/dist/cjs/salla-offer.cjs.entry.js +1 -1
  62. package/dist/cjs/salla-order-details-multiple-bundle-product.cjs.entry.js +1 -1
  63. package/dist/cjs/salla-order-details-options.cjs.entry.js +1 -1
  64. package/dist/cjs/salla-order-details.cjs.entry.js +1 -1
  65. package/dist/cjs/salla-order-edit-item.cjs.entry.js +28 -29
  66. package/dist/cjs/salla-order-edit-product-card.cjs.entry.js +41 -0
  67. package/dist/cjs/salla-order-edit.cjs.entry.js +339 -40
  68. package/dist/cjs/salla-order-summary.cjs.entry.js +2 -2
  69. package/dist/cjs/salla-order-totals-card.cjs.entry.js +1 -1
  70. package/dist/cjs/salla-orders.cjs.entry.js +1 -1
  71. package/dist/cjs/salla-payments.cjs.entry.js +3 -3
  72. package/dist/cjs/salla-placeholder.cjs.entry.js +2 -2
  73. package/dist/cjs/salla-price-range.cjs.entry.js +3 -3
  74. package/dist/cjs/salla-product-card_2.cjs.entry.js +6 -6
  75. package/dist/cjs/salla-product-size-guide.cjs.entry.js +3 -3
  76. package/dist/cjs/salla-products-list.cjs.entry.js +38 -15
  77. package/dist/cjs/salla-progress-bar.cjs.entry.js +1 -1
  78. package/dist/cjs/salla-quick-order.cjs.entry.js +1 -1
  79. package/dist/cjs/salla-rating-modal.cjs.entry.js +1 -1
  80. package/dist/cjs/salla-reward-action_4.cjs.entry.js +15 -8
  81. package/dist/cjs/salla-scopes.cjs.entry.js +2 -2
  82. package/dist/cjs/salla-search.cjs.entry.js +6 -6
  83. package/dist/cjs/salla-skeleton.cjs.entry.js +2 -2
  84. package/dist/cjs/salla-slider.cjs.entry.js +1 -1
  85. package/dist/cjs/salla-social-share.cjs.entry.js +2 -2
  86. package/dist/cjs/salla-social.cjs.entry.js +2 -2
  87. package/dist/cjs/salla-tab-content_3.cjs.entry.js +4 -4
  88. package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
  89. package/dist/cjs/salla-tooltip.cjs.entry.js +2 -2
  90. package/dist/cjs/salla-trust-badges.cjs.entry.js +1 -1
  91. package/dist/cjs/salla-user-menu.cjs.entry.js +1 -1
  92. package/dist/cjs/salla-user-profile.cjs.entry.js +1 -1
  93. package/dist/cjs/salla-user-settings.cjs.entry.js +2 -2
  94. package/dist/cjs/salla-verify.cjs.entry.js +1 -1
  95. package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
  96. package/dist/cjs/{tracked-promise-BnNAgCN_.js → tracked-promise-BJe1J-1V.js} +1 -1
  97. package/dist/cjs/twilight.cjs.js +2 -2
  98. package/dist/cjs/{vanilla-picker-wbE79zwn.js → vanilla-picker-nnRs4Y1U.js} +1 -1
  99. package/dist/collection/collection-manifest.json +1 -0
  100. package/dist/collection/components/salla-loyalty/salla-loyalty.js +24 -2
  101. package/dist/collection/components/salla-loyalty-program/salla-loyalty-panel.js +5 -3
  102. package/dist/collection/components/salla-loyalty-program/salla-reward-details.js +12 -5
  103. package/dist/collection/components/salla-order-edit/helpers.js +181 -0
  104. package/dist/collection/components/salla-order-edit/salla-order-edit-item.css +3 -0
  105. package/dist/collection/components/salla-order-edit/salla-order-edit-item.js +42 -30
  106. package/dist/collection/components/salla-order-edit/salla-order-edit-product-card.css +4 -0
  107. package/dist/collection/components/salla-order-edit/salla-order-edit-product-card.js +93 -0
  108. package/dist/collection/components/salla-order-edit/salla-order-edit.css +3 -0
  109. package/dist/collection/components/salla-order-edit/salla-order-edit.js +353 -39
  110. package/dist/collection/components/salla-order-summary/salla-order-summary.js +1 -1
  111. package/dist/collection/components/salla-payments/salla-payments.js +2 -2
  112. package/dist/collection/components/salla-placeholder/salla-placeholder.js +1 -1
  113. package/dist/collection/components/salla-price-range/salla-price-range.js +2 -2
  114. package/dist/collection/components/salla-product-availability/salla-product-availability.js +1 -1
  115. package/dist/collection/components/salla-product-card/salla-product-card.js +5 -5
  116. package/dist/collection/components/salla-product-options/salla-product-options.js +28 -0
  117. package/dist/collection/components/salla-product-size-guide/salla-product-size-guide.js +2 -2
  118. package/dist/collection/components/salla-products-list/salla-products-list.js +54 -14
  119. package/dist/collection/components/salla-quantity-input/salla-quantity-input.js +1 -1
  120. package/dist/collection/components/salla-quick-buy/salla-quick-buy.js +1 -1
  121. package/dist/collection/components/salla-review-card/salla-review-card.js +1 -1
  122. package/dist/collection/components/salla-reviews/salla-reviews.js +1 -1
  123. package/dist/collection/components/salla-reviews-page/salla-reviews-page.js +1 -1
  124. package/dist/collection/components/salla-scopes/salla-scopes.js +1 -1
  125. package/dist/collection/components/salla-search/salla-search.js +5 -5
  126. package/dist/collection/components/salla-skeleton/salla-skeleton.js +1 -1
  127. package/dist/collection/components/salla-social/salla-social.js +1 -1
  128. package/dist/collection/components/salla-social-share/salla-social-share.js +1 -1
  129. package/dist/collection/components/salla-tabs/salla-tab-content.js +1 -1
  130. package/dist/collection/components/salla-tabs/salla-tab-header.js +1 -1
  131. package/dist/collection/components/salla-tabs/salla-tabs.js +1 -1
  132. package/dist/collection/components/salla-tel-input/salla-tel-input.js +1 -1
  133. package/dist/collection/components/salla-tooltip/salla-tooltip.js +1 -1
  134. package/dist/collection/components/salla-user-settings/salla-user-settings.js +1 -1
  135. package/dist/components/index.js +2 -2
  136. package/dist/components/salla-loyalty-panel.js +5 -3
  137. package/dist/components/salla-loyalty.js +16 -3
  138. package/dist/components/salla-order-edit-item2.js +207 -30
  139. package/dist/components/salla-order-edit-product-card.d.ts +11 -0
  140. package/dist/components/salla-order-edit-product-card.js +59 -0
  141. package/dist/components/salla-order-edit.js +378 -65
  142. package/dist/components/salla-order-summary.js +1 -1
  143. package/dist/components/salla-payments.js +2 -2
  144. package/dist/components/salla-placeholder2.js +1 -1
  145. package/dist/components/salla-price-range2.js +2 -2
  146. package/dist/components/salla-product-availability2.js +1 -1
  147. package/dist/components/salla-product-card2.js +5 -5
  148. package/dist/components/salla-product-options2.js +8 -1
  149. package/dist/components/salla-product-size-guide.js +2 -2
  150. package/dist/components/salla-products-list2.js +39 -15
  151. package/dist/components/salla-quantity-input2.js +1 -1
  152. package/dist/components/salla-quick-buy2.js +1 -1
  153. package/dist/components/salla-review-card2.js +1 -1
  154. package/dist/components/salla-reviews-page.js +1 -1
  155. package/dist/components/salla-reviews.js +1 -1
  156. package/dist/components/salla-reward-details2.js +12 -5
  157. package/dist/components/salla-scopes.js +1 -1
  158. package/dist/components/salla-search.js +5 -5
  159. package/dist/components/salla-skeleton2.js +1 -1
  160. package/dist/components/salla-social-share.js +1 -1
  161. package/dist/components/salla-social.js +1 -1
  162. package/dist/components/salla-tab-content2.js +1 -1
  163. package/dist/components/salla-tab-header2.js +1 -1
  164. package/dist/components/salla-tabs2.js +1 -1
  165. package/dist/components/salla-tel-input2.js +1 -1
  166. package/dist/components/salla-tooltip2.js +1 -1
  167. package/dist/components/salla-user-settings.js +1 -1
  168. package/dist/esm/{filepond-BaqNYv3C.js → filepond-DcrhDD5e.js} +1 -1
  169. package/dist/esm/{filepond-plugin-file-poster-nENZqIRv.js → filepond-plugin-file-poster-meDD1pU1.js} +1 -1
  170. package/dist/esm/{filepond-plugin-file-validate-size-DGOq4RG8.js → filepond-plugin-file-validate-size-Ta6h96xm.js} +1 -1
  171. package/dist/esm/{filepond-plugin-file-validate-type-DwM-3UO7.js → filepond-plugin-file-validate-type-PVDX_x_z.js} +1 -1
  172. package/dist/esm/{filepond-plugin-image-edit-BCqDiFWK.js → filepond-plugin-image-edit-BR1HO3-K.js} +1 -1
  173. package/dist/esm/{filepond-plugin-image-exif-orientation-DiuxhjrQ.js → filepond-plugin-image-exif-orientation-CEWqrOc9.js} +1 -1
  174. package/dist/esm/{filepond-plugin-image-preview-DbFvPPQQ.js → filepond-plugin-image-preview-6ACW1Nfe.js} +1 -1
  175. package/dist/esm/{functions-JPNAXx4d.js → functions-DqpTrGHa.js} +1 -1
  176. package/dist/esm/helpers-DR_vlSvU.js +184 -0
  177. package/dist/esm/{index-DElBWCVR.js → index-COvJOSNr.js} +1 -1
  178. package/dist/esm/{index-BwsreBbG.js → index-Cb4NFvMH.js} +10 -6
  179. package/dist/esm/interfaces-CoQJOPRz.js +33 -0
  180. package/dist/esm/loader.js +3 -3
  181. package/dist/esm/salla-accordion-body_2.entry.js +1 -1
  182. package/dist/esm/salla-accordion_6.entry.js +1 -1
  183. package/dist/esm/salla-add-product-button_5.entry.js +10 -32
  184. package/dist/esm/salla-advertisement.entry.js +1 -1
  185. package/dist/esm/salla-alert_2.entry.js +1 -1
  186. package/dist/esm/salla-app-install-alert.entry.js +1 -1
  187. package/dist/esm/salla-apps-icons.entry.js +1 -1
  188. package/dist/esm/salla-badge.entry.js +1 -1
  189. package/dist/esm/salla-booking-field_7.entry.js +12 -12
  190. package/dist/esm/salla-bullet-delivery.entry.js +1 -1
  191. package/dist/esm/salla-cart-coupons.entry.js +1 -1
  192. package/dist/esm/salla-cart-item-offers_2.entry.js +1 -1
  193. package/dist/esm/salla-comment-form_8.entry.js +4 -4
  194. package/dist/esm/salla-conditional-offer.entry.js +1 -1
  195. package/dist/esm/salla-contacts.entry.js +1 -1
  196. package/dist/esm/salla-cookies-bar.entry.js +1 -1
  197. package/dist/esm/salla-count-down.entry.js +1 -1
  198. package/dist/esm/salla-custom-fields.entry.js +1 -1
  199. package/dist/esm/salla-delivery-promise.entry.js +1 -1
  200. package/dist/esm/salla-edit-order-button.entry.js +1 -1
  201. package/dist/esm/salla-filters-widget.entry.js +1 -1
  202. package/dist/esm/salla-filters.entry.js +1 -1
  203. package/dist/esm/salla-fulfillment-methods.entry.js +1 -1
  204. package/dist/esm/salla-gifting.entry.js +1 -1
  205. package/dist/esm/salla-hook.entry.js +1 -1
  206. package/dist/esm/salla-infinite-scroll.entry.js +1 -1
  207. package/dist/esm/salla-installment.entry.js +1 -1
  208. package/dist/esm/salla-list-tile.entry.js +1 -1
  209. package/dist/esm/salla-localization-modal.entry.js +1 -1
  210. package/dist/esm/salla-login-modal.entry.js +1 -1
  211. package/dist/esm/salla-loyalty-banner.entry.js +2 -2
  212. package/dist/esm/salla-loyalty-hero_2.entry.js +2 -2
  213. package/dist/esm/salla-loyalty-panel.entry.js +8 -6
  214. package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
  215. package/dist/esm/salla-loyalty-program.entry.js +3 -3
  216. package/dist/esm/salla-loyalty-reward.entry.js +2 -2
  217. package/dist/esm/salla-loyalty.entry.js +14 -3
  218. package/dist/esm/salla-maintenance-alert.entry.js +1 -1
  219. package/dist/esm/salla-map.entry.js +1 -1
  220. package/dist/esm/salla-menu.entry.js +1 -1
  221. package/dist/esm/salla-metadata.entry.js +1 -1
  222. package/dist/esm/salla-multiple-bundle-product-cart_2.entry.js +1 -1
  223. package/dist/esm/salla-multiple-bundle-product-options-modal_2.entry.js +1 -1
  224. package/dist/esm/salla-multiple-bundle-product.entry.js +1 -1
  225. package/dist/esm/salla-notification-item.entry.js +1 -1
  226. package/dist/esm/salla-notifications.entry.js +1 -1
  227. package/dist/esm/salla-offer-modal.entry.js +1 -1
  228. package/dist/esm/salla-offer.entry.js +1 -1
  229. package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +1 -1
  230. package/dist/esm/salla-order-details-options.entry.js +1 -1
  231. package/dist/esm/salla-order-details.entry.js +1 -1
  232. package/dist/esm/salla-order-edit-item.entry.js +28 -29
  233. package/dist/esm/salla-order-edit-product-card.entry.js +39 -0
  234. package/dist/esm/salla-order-edit.entry.js +339 -40
  235. package/dist/esm/salla-order-summary.entry.js +2 -2
  236. package/dist/esm/salla-order-totals-card.entry.js +1 -1
  237. package/dist/esm/salla-orders.entry.js +1 -1
  238. package/dist/esm/salla-payments.entry.js +3 -3
  239. package/dist/esm/salla-placeholder.entry.js +2 -2
  240. package/dist/esm/salla-price-range.entry.js +3 -3
  241. package/dist/esm/salla-product-card_2.entry.js +6 -6
  242. package/dist/esm/salla-product-size-guide.entry.js +3 -3
  243. package/dist/esm/salla-products-list.entry.js +38 -15
  244. package/dist/esm/salla-progress-bar.entry.js +1 -1
  245. package/dist/esm/salla-quick-order.entry.js +1 -1
  246. package/dist/esm/salla-rating-modal.entry.js +1 -1
  247. package/dist/esm/salla-reward-action_4.entry.js +15 -8
  248. package/dist/esm/salla-scopes.entry.js +2 -2
  249. package/dist/esm/salla-search.entry.js +6 -6
  250. package/dist/esm/salla-skeleton.entry.js +2 -2
  251. package/dist/esm/salla-slider.entry.js +1 -1
  252. package/dist/esm/salla-social-share.entry.js +2 -2
  253. package/dist/esm/salla-social.entry.js +2 -2
  254. package/dist/esm/salla-tab-content_3.entry.js +4 -4
  255. package/dist/esm/salla-tiered-offer.entry.js +1 -1
  256. package/dist/esm/salla-tooltip.entry.js +2 -2
  257. package/dist/esm/salla-trust-badges.entry.js +1 -1
  258. package/dist/esm/salla-user-menu.entry.js +1 -1
  259. package/dist/esm/salla-user-profile.entry.js +1 -1
  260. package/dist/esm/salla-user-settings.entry.js +2 -2
  261. package/dist/esm/salla-verify.entry.js +1 -1
  262. package/dist/esm/salla-wallet.entry.js +1 -1
  263. package/dist/esm/{tracked-promise-BD-FZk2P.js → tracked-promise-Dl5Y2VO1.js} +1 -1
  264. package/dist/esm/twilight.js +3 -3
  265. package/dist/esm/{vanilla-picker-CqoFxJJE.js → vanilla-picker-CuBrX87l.js} +1 -1
  266. package/dist/twilight/p-03c91b77.entry.js +4 -0
  267. package/dist/twilight/{p-af84c7b8.entry.js → p-0bb36191.entry.js} +1 -1
  268. package/dist/twilight/{p-a3a0bafa.entry.js → p-0c0df6f7.entry.js} +1 -1
  269. package/dist/twilight/p-142ed3d7.entry.js +4 -0
  270. package/dist/twilight/{p-CbukOCNI.js → p-14uV0Dqq.js} +1 -1
  271. package/dist/twilight/{p-46088f51.entry.js → p-15c3ec6b.entry.js} +1 -1
  272. package/dist/twilight/{p-7d3722ad.entry.js → p-15f015b1.entry.js} +1 -1
  273. package/dist/twilight/{p-ce588635.entry.js → p-213cee5f.entry.js} +1 -1
  274. package/dist/twilight/{p-c5e18341.entry.js → p-2726ea01.entry.js} +1 -1
  275. package/dist/twilight/{p-57451f00.entry.js → p-28208f79.entry.js} +1 -1
  276. package/dist/twilight/{p-b6dce61a.entry.js → p-293fa7ae.entry.js} +1 -1
  277. package/dist/twilight/{p-993bdcbe.entry.js → p-29f8baaa.entry.js} +1 -1
  278. package/dist/twilight/{p-60878c2e.entry.js → p-324dc99a.entry.js} +1 -1
  279. package/dist/twilight/p-3383da76.entry.js +4 -0
  280. package/dist/twilight/{p-d9c4d2ed.entry.js → p-38ae0da1.entry.js} +1 -1
  281. package/dist/twilight/{p-0a786447.entry.js → p-3bd864fe.entry.js} +1 -1
  282. package/dist/twilight/p-3e6f7773.entry.js +4 -0
  283. package/dist/twilight/p-408ed55f.entry.js +4 -0
  284. package/dist/twilight/{p-695e3211.entry.js → p-40a41577.entry.js} +1 -1
  285. package/dist/twilight/{p-aaff5603.entry.js → p-4105a9cd.entry.js} +1 -1
  286. package/dist/twilight/{p-91d74168.entry.js → p-45f138dd.entry.js} +1 -1
  287. package/dist/twilight/{p-0654ccca.entry.js → p-4a788634.entry.js} +1 -1
  288. package/dist/twilight/{p-ad762138.entry.js → p-4c3d17a1.entry.js} +1 -1
  289. package/dist/twilight/{p-4c57de7b.entry.js → p-52f5ccfe.entry.js} +1 -1
  290. package/dist/twilight/p-59a083e4.entry.js +4 -0
  291. package/dist/twilight/{p-1c1ac203.entry.js → p-5b7970ef.entry.js} +1 -1
  292. package/dist/twilight/{p-ab5e0aef.entry.js → p-5e62a40f.entry.js} +1 -1
  293. package/dist/twilight/{p-b9c9c487.entry.js → p-5fbf4640.entry.js} +1 -1
  294. package/dist/twilight/{p-9c73e42a.entry.js → p-6135ad16.entry.js} +1 -1
  295. package/dist/twilight/{p-2f833767.entry.js → p-628a8e24.entry.js} +1 -1
  296. package/dist/twilight/{p-167f5262.entry.js → p-65c18d39.entry.js} +1 -1
  297. package/dist/twilight/{p-ff90dbf0.entry.js → p-686eecd6.entry.js} +1 -1
  298. package/dist/twilight/{p-fec6b08b.entry.js → p-68f21f26.entry.js} +1 -1
  299. package/dist/twilight/{p-3f50a52d.entry.js → p-691c3a17.entry.js} +1 -1
  300. package/dist/twilight/{p-9134d94d.entry.js → p-6cb4a60b.entry.js} +1 -1
  301. package/dist/twilight/{p-44db7163.entry.js → p-6f2edfae.entry.js} +1 -1
  302. package/dist/twilight/{p-edaba475.entry.js → p-6fb7d4f8.entry.js} +1 -1
  303. package/dist/twilight/{p-dcc65eb2.entry.js → p-72e169bd.entry.js} +1 -1
  304. package/dist/twilight/{p-681953ef.entry.js → p-73ba81cc.entry.js} +1 -1
  305. package/dist/twilight/{p-f88806d7.entry.js → p-7444a1ed.entry.js} +1 -1
  306. package/dist/twilight/{p-10884e6e.entry.js → p-752f162a.entry.js} +1 -1
  307. package/dist/twilight/{p-b737dbcb.entry.js → p-772b766c.entry.js} +1 -1
  308. package/dist/twilight/{p-03c39b2d.entry.js → p-774461b2.entry.js} +1 -1
  309. package/dist/twilight/p-7cba634a.entry.js +4 -0
  310. package/dist/twilight/p-7d37007a.entry.js +4 -0
  311. package/dist/twilight/{p-2bd83486.entry.js → p-7e47c403.entry.js} +1 -1
  312. package/dist/twilight/{p-ac008da7.entry.js → p-7ec0ac91.entry.js} +1 -1
  313. package/dist/twilight/{p-57e0b11b.entry.js → p-825cc1f7.entry.js} +1 -1
  314. package/dist/twilight/{p-f73c7b43.entry.js → p-85a15cc1.entry.js} +1 -1
  315. package/dist/twilight/p-8e96221d.entry.js +4 -0
  316. package/dist/twilight/{p-5ac81ffe.entry.js → p-95f3620c.entry.js} +1 -1
  317. package/dist/twilight/{p-29fc145b.entry.js → p-95ff1eb1.entry.js} +1 -1
  318. package/dist/twilight/{p-cd6fc43c.entry.js → p-96343e93.entry.js} +1 -1
  319. package/dist/twilight/{p-a00015ec.entry.js → p-96b64fd6.entry.js} +1 -1
  320. package/dist/twilight/{p-580441f5.entry.js → p-9a6dfcde.entry.js} +1 -1
  321. package/dist/twilight/{p-f653f2bb.entry.js → p-9b865b2c.entry.js} +1 -1
  322. package/dist/twilight/{p-5b371b1f.entry.js → p-9ba89557.entry.js} +1 -1
  323. package/dist/twilight/{p-Dw7mGaHj.js → p-B9znPMU0.js} +1 -1
  324. package/dist/twilight/{p-Cw0Ky-u0.js → p-BCTUg3S2.js} +1 -1
  325. package/dist/twilight/{p-LWKLIOwS.js → p-BII4XUuF.js} +1 -1
  326. package/dist/twilight/{p-GgHo6Cr_.js → p-BIai7zYt.js} +1 -1
  327. package/dist/twilight/p-C8xwacGT.js +4 -0
  328. package/dist/twilight/{p-DPgASjJ8.js → p-CBJQc5Lg.js} +1 -1
  329. package/dist/twilight/{p-BwsreBbG.js → p-Cb4NFvMH.js} +1 -1
  330. package/dist/twilight/{p-BuNOvMeU.js → p-Ch9nMk63.js} +1 -1
  331. package/dist/twilight/p-CoQJOPRz.js +4 -0
  332. package/dist/twilight/{p-CEuTw3-D.js → p-DQjeyM6u.js} +1 -1
  333. package/dist/twilight/{p-DlGhggDp.js → p-DXTkDRjS.js} +1 -1
  334. package/dist/twilight/{p-f-qXMnue.js → p-DvkL8Ozv.js} +1 -1
  335. package/dist/twilight/{p-4807586a.entry.js → p-acf5c683.entry.js} +1 -1
  336. package/dist/twilight/{p-9d8e4e7c.entry.js → p-aec7b53d.entry.js} +1 -1
  337. package/dist/twilight/{p-e5325563.entry.js → p-b495fd3a.entry.js} +1 -1
  338. package/dist/twilight/{p-d739ae41.entry.js → p-b5b0d57a.entry.js} +1 -1
  339. package/dist/twilight/{p-d0cf9b68.entry.js → p-b8d87ece.entry.js} +1 -1
  340. package/dist/twilight/{p-af1474dd.entry.js → p-bc8070a0.entry.js} +1 -1
  341. package/dist/twilight/{p-19e82de2.entry.js → p-befbbd96.entry.js} +1 -1
  342. package/dist/twilight/{p-b9062150.entry.js → p-c4c7efc7.entry.js} +1 -1
  343. package/dist/twilight/{p-7d492d3c.entry.js → p-c4f7d697.entry.js} +1 -1
  344. package/dist/twilight/{p-b6ac7a22.entry.js → p-cb70fe7f.entry.js} +1 -1
  345. package/dist/twilight/{p-0bf11f89.entry.js → p-d4b7ef45.entry.js} +1 -1
  346. package/dist/twilight/{p-fbe07d2d.entry.js → p-d4d61e9d.entry.js} +1 -1
  347. package/dist/twilight/{p-59657a19.entry.js → p-d6cfb7cf.entry.js} +1 -1
  348. package/dist/twilight/p-dfad4e49.entry.js +4 -0
  349. package/dist/twilight/{p-4edf67be.entry.js → p-e30f5be9.entry.js} +1 -1
  350. package/dist/twilight/{p-d469525b.entry.js → p-e64af075.entry.js} +1 -1
  351. package/dist/twilight/{p-c1d4db6f.entry.js → p-e7fd1dab.entry.js} +1 -1
  352. package/dist/twilight/{p-ceb9458e.entry.js → p-e85f1f4a.entry.js} +1 -1
  353. package/dist/twilight/{p-201926a3.entry.js → p-e9251839.entry.js} +1 -1
  354. package/dist/twilight/{p-1c3e0dbc.entry.js → p-e94f7e62.entry.js} +1 -1
  355. package/dist/twilight/p-ebc19788.entry.js +4 -0
  356. package/dist/twilight/{p-b4fd50ef.entry.js → p-f6bc9645.entry.js} +1 -1
  357. package/dist/twilight/p-f6da3fad.entry.js +4 -0
  358. package/dist/twilight/{p-a96ec635.entry.js → p-fbfa12cf.entry.js} +1 -1
  359. package/dist/twilight/{p-069485ec.entry.js → p-fca860eb.entry.js} +1 -1
  360. package/dist/twilight/{p-61215f22.entry.js → p-fd4eec62.entry.js} +1 -1
  361. package/dist/twilight/{p-CTyl0UJE.js → p-pyjmoRFm.js} +1 -1
  362. package/dist/twilight/twilight.esm.js +1 -1
  363. package/dist/types/components/salla-loyalty/salla-loyalty.d.ts +3 -0
  364. package/dist/types/components/salla-order-edit/helpers.d.ts +25 -0
  365. package/dist/types/components/salla-order-edit/interfaces.d.ts +22 -25
  366. package/dist/types/components/salla-order-edit/salla-order-edit-item.d.ts +7 -5
  367. package/dist/types/components/salla-order-edit/salla-order-edit-product-card.d.ts +11 -0
  368. package/dist/types/components/salla-order-edit/salla-order-edit.d.ts +56 -4
  369. package/dist/types/components/salla-product-options/salla-product-options.d.ts +4 -0
  370. package/dist/types/components/salla-products-list/salla-products-list.d.ts +5 -0
  371. package/dist/types/components.d.ts +51 -4
  372. package/package.json +5 -5
  373. package/dist/twilight/p-25104b13.entry.js +0 -4
  374. package/dist/twilight/p-36048354.entry.js +0 -4
  375. package/dist/twilight/p-4110e600.entry.js +0 -4
  376. package/dist/twilight/p-60d875cc.entry.js +0 -4
  377. package/dist/twilight/p-7a33e83b.entry.js +0 -4
  378. package/dist/twilight/p-86cfa253.entry.js +0 -4
  379. package/dist/twilight/p-c0b690b2.entry.js +0 -4
  380. package/dist/twilight/p-c968dab0.entry.js +0 -4
  381. package/dist/twilight/p-e07f938a.entry.js +0 -4
  382. package/dist/twilight/p-f2815da9.entry.js +0 -4
  383. package/dist/twilight/p-f7b21078.entry.js +0 -4
@@ -3,27 +3,84 @@
3
3
  */
4
4
  'use strict';
5
5
 
6
- var index = require('./index-DO_QXaSt.js');
6
+ var index = require('./index-vstkdqRz.js');
7
+ var helpers = require('./helpers-BJ2rnhxz.js');
8
+ require('./interfaces-Bh7W0bEU.js');
7
9
 
8
- const sallaOrderEditCss = "";
10
+ const sallaOrderEditCss = ":host{display:block}";
9
11
 
10
12
  const SallaOrderEdit = class {
11
13
  constructor(hostRef) {
12
14
  index.registerInstance(this, hostRef);
13
15
  this.loading = true;
14
16
  this.saveLoading = false;
15
- this.payload = { items: { update: [], remove: [] } };
17
+ this.payload = { items: { update: [], remove: [], add: [] } };
16
18
  this.expired = false;
17
19
  this.editPreview = null;
20
+ this.productSearchQuery = '';
21
+ this.productsListKey = 0;
22
+ this.productsListSource = 'latest';
23
+ this.productsListSourceValue = '';
24
+ this.selectedProductToAdd = null;
25
+ this.addProductQuantity = 1;
26
+ this.addProductLoading = false;
27
+ this.addProductConfirmLoading = false;
28
+ this.mobileProductsModalMounted = false;
29
+ this.isMobileViewport = false;
30
+ // Plain field (not @State): scroll-loading guard never affects rendering, so avoid re-render churn.
31
+ this.mobileProductsListLoading = false;
18
32
  this.confirming = false;
33
+ this.handleMobileProductSelected = (event) => {
34
+ event.stopPropagation();
35
+ void this.handleProductSelected(event);
36
+ };
37
+ this.productsPanelMobileQuery = '(max-width: 768px)';
38
+ this.handleProductsPanelViewportChange = (event) => {
39
+ this.isMobileViewport = event.matches;
40
+ };
41
+ this.hasProductTypeFilter = (url) => {
42
+ const queryStart = url.indexOf('?');
43
+ const query = (queryStart >= 0 ? url.slice(queryStart + 1) : url).split('#')[0];
44
+ return Array.from(new URLSearchParams(query)).some(([key, value]) => (value === 'product' &&
45
+ /^filters\[types\](?:\[(?:\d*)\])?$/.test(key)));
46
+ };
47
+ this.normalizeProductsListArrayParams = (url) => {
48
+ return url.replace(/(^|[?&])(includes|source_value|filters(?:\[|%5B)[^&=\]%]+?(?:\]|%5D))(\[|%5B)\d+(\]|%5D)(?==)/gi, (_, sep, name, open, close) => `${sep}${name}${open}${close}`);
49
+ };
50
+ this.handleBeforeBuildListUrl = (ctx) => {
51
+ if (ctx.component?.productCardComponent !== 'salla-order-edit-product-card' ||
52
+ typeof ctx.url !== 'string') {
53
+ return;
54
+ }
55
+ ctx.url = this.normalizeProductsListArrayParams(ctx.url);
56
+ if (this.hasProductTypeFilter(ctx.url)) {
57
+ return;
58
+ }
59
+ ctx.url += `${ctx.url.includes('?') ? '&' : '?'}filters[types][]=product`;
60
+ };
61
+ this.defaultProductsListSource = 'latest';
62
+ this.debouncedProductSearch = salla.helpers.debounce((query) => this.applyProductSearch(query), 500);
19
63
  }
20
64
  async componentWillLoad() {
65
+ this.setupProductsPanelViewportQuery();
21
66
  await salla.onReady();
67
+ this.unregisterBeforeBuildListUrlHook = salla.hooks.registerHook('salla-products-list', 'beforeBuildListUrl', this.handleBeforeBuildListUrl);
22
68
  this.loadFromProp();
23
69
  this.startExpiryCheck();
24
70
  }
25
71
  disconnectedCallback() {
26
72
  clearInterval(this.expiryInterval);
73
+ this.unregisterBeforeBuildListUrlHook?.();
74
+ this.productsPanelViewportQuery?.removeEventListener('change', this.handleProductsPanelViewportChange);
75
+ this.mobileProductsModal?.removeEventListener('orderEditProductSelected', this.handleMobileProductSelected);
76
+ }
77
+ setupProductsPanelViewportQuery() {
78
+ if (typeof window === 'undefined' || typeof window.matchMedia !== 'function') {
79
+ return;
80
+ }
81
+ this.productsPanelViewportQuery = window.matchMedia(this.productsPanelMobileQuery);
82
+ this.isMobileViewport = this.productsPanelViewportQuery.matches;
83
+ this.productsPanelViewportQuery.addEventListener('change', this.handleProductsPanelViewportChange);
27
84
  }
28
85
  startExpiryCheck() {
29
86
  const endsAt = this.order?.customer_editing_session?.ends_at;
@@ -48,7 +105,13 @@ const SallaOrderEdit = class {
48
105
  return;
49
106
  }
50
107
  const data = typeof this.orderData === 'string' ? JSON.parse(this.orderData) : this.orderData;
51
- this.order = data;
108
+ this.order = {
109
+ ...data,
110
+ items: data.items.map(item => ({
111
+ ...item,
112
+ selectedOptions: helpers.getOrderItemSelectedOptions(item),
113
+ })),
114
+ };
52
115
  }
53
116
  catch (e) {
54
117
  this.error = salla.lang.getWithDefault('pages.orders.order_not_found', 'الطلب غير موجود');
@@ -57,22 +120,223 @@ const SallaOrderEdit = class {
57
120
  this.loading = false;
58
121
  }
59
122
  }
60
- handleItemUpdated(event) {
61
- if (!this.order)
123
+ applyProductSearch(query) {
124
+ const normalizedQuery = query?.trim() || '';
125
+ const nextSource = normalizedQuery ? 'search' : this.defaultProductsListSource;
126
+ const nextSourceValue = nextSource === 'search' ? JSON.stringify(normalizedQuery) : '';
127
+ if (this.productsListSource === nextSource &&
128
+ this.productsListSourceValue === nextSourceValue) {
62
129
  return;
63
- const { itemId, quantity, options } = event.detail;
64
- const updateList = this.payload.items.update.filter(u => u.id !== itemId);
65
- const updateEntry = { id: itemId, quantity, options: options ?? [] };
66
- updateList.push(updateEntry);
67
- this.payload = {
68
- ...this.payload,
69
- items: { ...this.payload.items, update: updateList },
130
+ }
131
+ this.productsListSource = nextSource;
132
+ this.productsListSourceValue = nextSourceValue;
133
+ this.productsListKey += 1;
134
+ }
135
+ handleProductSearch(event) {
136
+ const value = event.target?.value || '';
137
+ this.productSearchQuery = value;
138
+ this.debouncedProductSearch(value);
139
+ }
140
+ getProductsListKey(scope) {
141
+ return `${scope}-${this.productsListSource}-${this.productsListSourceValue}-${this.productsListKey}`;
142
+ }
143
+ handleMobileProductsScroll(event) {
144
+ const container = event.currentTarget;
145
+ const distanceToBottom = container.scrollHeight - container.scrollTop - container.clientHeight;
146
+ if (distanceToBottom > 200 || this.mobileProductsListLoading) {
147
+ return;
148
+ }
149
+ const productsList = container.querySelector('salla-products-list');
150
+ if (!productsList) {
151
+ return;
152
+ }
153
+ this.mobileProductsListLoading = true;
154
+ void productsList.loadMore().finally(() => {
155
+ this.mobileProductsListLoading = false;
156
+ });
157
+ }
158
+ waitForNextFrame() {
159
+ return new Promise(resolve => requestAnimationFrame(() => resolve(undefined)));
160
+ }
161
+ async openMobileProductsModal() {
162
+ if (!this.mobileProductsModalMounted) {
163
+ this.mobileProductsModalMounted = true;
164
+ await this.waitForNextFrame();
165
+ }
166
+ await this.mobileProductsModal?.open?.();
167
+ }
168
+ setMobileProductsModal(modal) {
169
+ if (this.mobileProductsModal === modal) {
170
+ return;
171
+ }
172
+ this.mobileProductsModal?.removeEventListener('orderEditProductSelected', this.handleMobileProductSelected);
173
+ this.mobileProductsModal = modal;
174
+ this.mobileProductsModal?.addEventListener('orderEditProductSelected', this.handleMobileProductSelected);
175
+ }
176
+ resetAddProductDrawer() {
177
+ this.selectedProductToAdd = null;
178
+ this.addProductQuantity = 1;
179
+ this.addProductLoading = false;
180
+ this.addProductConfirmLoading = false;
181
+ this.addProductOptions = null;
182
+ }
183
+ getAddProductMaxQuantity(product = this.selectedProductToAdd) {
184
+ return helpers.getOrderEditProductMaxQuantity(product);
185
+ }
186
+ clampAddProductQuantity(quantity, product = this.selectedProductToAdd) {
187
+ return helpers.clampOrderEditQuantity(quantity, this.getAddProductMaxQuantity(product));
188
+ }
189
+ getApiErrorMessage(error) {
190
+ return error?.response?.data?.error?.message || error?.response?.data?.message;
191
+ }
192
+ notifyApiError(error) {
193
+ const message = this.getApiErrorMessage(error);
194
+ if (message) {
195
+ salla.notify.error(message);
196
+ }
197
+ }
198
+ async validateAddProductOptions() {
199
+ if (!this.selectedProductToAdd?.options?.length) {
200
+ return true;
201
+ }
202
+ if (!this.addProductOptions) {
203
+ return false;
204
+ }
205
+ return ((await this.addProductOptions.validateAndScroll?.()) ??
206
+ (await this.addProductOptions.reportValidity?.()) ??
207
+ false);
208
+ }
209
+ updateLocalOrderItem(itemId, quantity, optionDefinitions, selectedOptions) {
210
+ this.order = {
211
+ ...this.order,
212
+ items: helpers.updateOrderItems(this.order.items, itemId, quantity, optionDefinitions, selectedOptions),
70
213
  };
214
+ }
215
+ removeLocalOrderItem(itemId) {
71
216
  this.order = {
72
217
  ...this.order,
73
- items: this.order.items.map(item => item.id === itemId ? { ...item, quantity } : item),
218
+ items: helpers.removeOrderItems(this.order.items, itemId),
74
219
  };
75
220
  }
221
+ setPayloadItems(patch) {
222
+ this.payload = {
223
+ ...this.payload,
224
+ items: helpers.mergePayloadItems(this.payload.items, patch),
225
+ };
226
+ }
227
+ handleAddProductQuantityChange(event) {
228
+ const detail = event.detail;
229
+ const newQuantity = detail?.quantity ?? parseInt(event.target?.value, 10);
230
+ if (isNaN(newQuantity) || newQuantity < 1) {
231
+ return;
232
+ }
233
+ this.addProductQuantity = this.clampAddProductQuantity(newQuantity);
234
+ }
235
+ async handleProductSelected(event) {
236
+ const product = event.detail?.product;
237
+ if (!product?.id || this.addProductLoading) {
238
+ return;
239
+ }
240
+ this.addProductLoading = true;
241
+ try {
242
+ this.selectedProductToAdd = helpers.cloneOrderEditProduct(product);
243
+ this.addProductQuantity = 1;
244
+ await this.mobileProductsModal?.close?.();
245
+ await this.waitForNextFrame();
246
+ await this.addProductDrawer?.open?.();
247
+ }
248
+ catch (error) {
249
+ this.notifyApiError(error);
250
+ }
251
+ finally {
252
+ this.addProductLoading = false;
253
+ }
254
+ }
255
+ async confirmAddProduct() {
256
+ if (!this.selectedProductToAdd?.id) {
257
+ return;
258
+ }
259
+ if (this.addProductConfirmLoading) {
260
+ return;
261
+ }
262
+ this.addProductConfirmLoading = true;
263
+ try {
264
+ const maxQuantity = this.getAddProductMaxQuantity();
265
+ const normalizedQuantity = this.clampAddProductQuantity(this.addProductQuantity);
266
+ if (normalizedQuantity !== this.addProductQuantity) {
267
+ this.addProductQuantity = normalizedQuantity;
268
+ }
269
+ const productOptions = this.addProductOptions;
270
+ const optionsAreValid = await this.validateAddProductOptions();
271
+ if (!optionsAreValid) {
272
+ salla.notify.error(salla.lang.getWithDefault('common.messages.required_fields', 'يرجى تعبئة الحقول المطلوبة'));
273
+ return;
274
+ }
275
+ const selectedOptionsPayload = (await productOptions?.getSelectedOptionsData?.()) || {};
276
+ const optionDefinitions = (await productOptions?.getOptionsData?.()) ||
277
+ this.selectedProductToAdd.options ||
278
+ [];
279
+ const existingItem = helpers.findMergeableItem(this.order?.items, this.selectedProductToAdd.id, selectedOptionsPayload);
280
+ if (existingItem) {
281
+ const mergedQuantity = helpers.clampOrderEditQuantity(existingItem.quantity + normalizedQuantity, maxQuantity);
282
+ this.updateLocalOrderItem(existingItem.id, mergedQuantity, optionDefinitions, selectedOptionsPayload);
283
+ if (existingItem.isNew) {
284
+ this.setPayloadItems({
285
+ add: helpers.updateAddedPayloadList(this.payload.items.add, existingItem.id, mergedQuantity, selectedOptionsPayload),
286
+ });
287
+ }
288
+ else {
289
+ this.setPayloadItems({
290
+ update: helpers.upsertPayloadUpdateList(this.payload.items.update, existingItem.id, mergedQuantity, selectedOptionsPayload),
291
+ });
292
+ }
293
+ await this.addProductDrawer?.close?.();
294
+ return;
295
+ }
296
+ const newItem = helpers.createAddedOrderItem(this.selectedProductToAdd, normalizedQuantity, optionDefinitions, selectedOptionsPayload);
297
+ const addEntry = {
298
+ itemId: newItem.id,
299
+ product_id: this.selectedProductToAdd.id,
300
+ quantity: normalizedQuantity,
301
+ options: selectedOptionsPayload,
302
+ };
303
+ this.order = {
304
+ ...this.order,
305
+ items: [...this.order.items, newItem],
306
+ };
307
+ this.setPayloadItems({
308
+ add: [...this.payload.items.add, addEntry],
309
+ });
310
+ await this.addProductDrawer?.close?.();
311
+ }
312
+ catch (error) {
313
+ this.notifyApiError(error);
314
+ }
315
+ finally {
316
+ this.addProductConfirmLoading = false;
317
+ }
318
+ }
319
+ handleItemUpdated(event) {
320
+ if (!this.order)
321
+ return;
322
+ const { itemId, quantity, options, optionDefinitions } = event.detail;
323
+ const currentItem = this.order.items.find(item => item.id === itemId);
324
+ if (!currentItem) {
325
+ return;
326
+ }
327
+ const safeQuantity = helpers.clampOrderEditQuantity(quantity, helpers.getOrderEditProductMaxQuantity(currentItem.product));
328
+ if (currentItem.isNew) {
329
+ this.setPayloadItems({
330
+ add: helpers.updateAddedPayloadList(this.payload.items.add, itemId, safeQuantity, options),
331
+ });
332
+ this.updateLocalOrderItem(itemId, safeQuantity, optionDefinitions, options);
333
+ return;
334
+ }
335
+ this.setPayloadItems({
336
+ update: helpers.upsertPayloadUpdateList(this.payload.items.update, itemId, safeQuantity, options ?? {}),
337
+ });
338
+ this.updateLocalOrderItem(itemId, safeQuantity, optionDefinitions, options);
339
+ }
76
340
  handleItemRemoved(event) {
77
341
  if (!this.order)
78
342
  return;
@@ -81,35 +345,39 @@ const SallaOrderEdit = class {
81
345
  return;
82
346
  }
83
347
  const { itemId } = event.detail;
84
- this.payload = {
85
- ...this.payload,
86
- items: {
87
- update: this.payload.items.update.filter(u => u.id !== itemId),
88
- remove: [...this.payload.items.remove, itemId],
89
- },
90
- };
91
- this.order = {
92
- ...this.order,
93
- items: this.order.items.filter(item => item.id !== itemId),
94
- };
348
+ const currentItem = this.order.items.find(item => item.id === itemId);
349
+ if (!currentItem) {
350
+ return;
351
+ }
352
+ if (currentItem.isNew) {
353
+ this.setPayloadItems({
354
+ add: this.payload.items.add.filter(item => item.itemId !== itemId),
355
+ });
356
+ this.removeLocalOrderItem(itemId);
357
+ return;
358
+ }
359
+ this.setPayloadItems({
360
+ update: this.payload.items.update.filter(u => u.id !== itemId),
361
+ remove: [...this.payload.items.remove, itemId],
362
+ });
363
+ this.removeLocalOrderItem(itemId);
95
364
  }
96
365
  get hasChanges() {
97
- return this.payload.items.update.length > 0 || this.payload.items.remove.length > 0;
366
+ return (this.payload.items.update.length > 0 ||
367
+ this.payload.items.remove.length > 0 ||
368
+ this.payload.items.add.length > 0);
98
369
  }
99
370
  async saveOrder() {
100
371
  if (!this.hasChanges)
101
372
  return;
102
373
  this.saveLoading = true;
103
374
  try {
104
- const response = await salla.order.api.editOrder(this.orderId, this.payload);
375
+ const response = await salla.order.api.editOrder(this.orderId, helpers.buildSavePayload(this.payload));
105
376
  this.editPreview = response?.data?.data || response?.data;
106
- await this.saveModal?.open();
377
+ await this.saveModal?.open?.();
107
378
  }
108
379
  catch (error) {
109
- const message = error?.response?.data?.error?.message || error?.response?.data?.message;
110
- if (message) {
111
- salla.notify.error(message);
112
- }
380
+ this.notifyApiError(error);
113
381
  }
114
382
  finally {
115
383
  this.saveLoading = false;
@@ -136,12 +404,44 @@ const SallaOrderEdit = class {
136
404
  this.navigateToOrder();
137
405
  }
138
406
  catch (error) {
139
- const message = error?.response?.data?.error?.message || error?.response?.data?.message;
140
- if (message) {
141
- salla.notify.error(message);
142
- }
407
+ this.notifyApiError(error);
143
408
  }
144
409
  }
410
+ renderProductsPanel() {
411
+ const addProductTitle = salla.lang.getWithDefault('pages.orders.add_product_to_order', 'أضف منتج للطلب');
412
+ return (index.h("section", { class: "s-order-edit-products-panel" }, index.h("div", { class: "s-order-edit-products-header" }, index.h("h2", { class: "s-order-edit-products-title" }, addProductTitle)), this.renderProductsPickerContent('panel')));
413
+ }
414
+ renderProductsPickerContent(scope) {
415
+ return (index.h("div", { class: {
416
+ 's-order-edit-products-picker': true,
417
+ 's-order-edit-products-modal-content': scope === 'modal',
418
+ } }, index.h("label", { class: "s-order-edit-products-search" }, index.h("i", { class: "sicon-search" }), index.h("input", { type: "search", class: "s-order-edit-products-search-input", placeholder: salla.lang.getWithDefault('pages.products.search_for_product', 'ابحث عن منتج'), value: this.productSearchQuery, onInput: event => this.handleProductSearch(event) })), index.h("div", { class: "s-order-edit-products-list", onScroll: scope === 'modal' ? event => this.handleMobileProductsScroll(event) : undefined }, index.h("salla-products-list", { key: this.getProductsListKey(scope), includes: ['options'], source: this.productsListSource, "source-value": this.productsListSourceValue, autoload: true, "product-card-component": "salla-order-edit-product-card" }))));
419
+ }
420
+ renderMobileProductsModal() {
421
+ return (index.h("salla-modal", { ref: modal => this.setMobileProductsModal(modal), width: "md", class: "s-order-edit-mobile-products-modal", "modal-title": salla.lang.getWithDefault('pages.orders.add_product_to_order', 'أضف منتج للطلب'), onModalVisibilityChanged: (e) => {
422
+ if (!e.detail) {
423
+ this.mobileProductsModalMounted = false;
424
+ }
425
+ } }, this.mobileProductsModalMounted ? this.renderProductsPickerContent('modal') : null));
426
+ }
427
+ renderAddProductDrawer() {
428
+ const product = this.selectedProductToAdd;
429
+ const productName = product?.name || salla.lang.getWithDefault('common.elements.product', 'منتج');
430
+ const price = product?.price;
431
+ const maxQuantity = this.getAddProductMaxQuantity(product);
432
+ const optionsInstanceKey = product ? `order-edit-add-${product.id}` : 'order-edit-add';
433
+ const quantityAttrs = {
434
+ value: this.clampAddProductQuantity(this.addProductQuantity, product),
435
+ };
436
+ if (maxQuantity) {
437
+ quantityAttrs.max = maxQuantity;
438
+ }
439
+ return (index.h("salla-modal", { ref: drawer => (this.addProductDrawer = drawer), width: "md", "modal-title": salla.lang.getWithDefault('pages.orders.add_product_to_order', 'أضف منتج للطلب'), onModalVisibilityChanged: (e) => {
440
+ if (!e.detail) {
441
+ this.resetAddProductDrawer();
442
+ }
443
+ } }, index.h("div", { class: "s-order-edit-add-modal" }, this.addProductLoading ? (index.h("div", { class: "s-order-edit-add-modal-loading" }, index.h("salla-loading", null))) : product ? (index.h("div", { class: "s-order-edit-add-modal-content" }, index.h("div", { class: "s-order-edit-add-modal-header" }, index.h("div", { class: "s-order-edit-add-modal-media" }, product.image?.url && (index.h("img", { src: product.image.url, alt: product.image.alt || productName, class: "s-order-edit-add-modal-image" })), index.h("div", { class: "s-order-edit-add-modal-details" }, index.h("h3", { class: "s-order-edit-add-modal-name" }, productName), price != null && (index.h("span", { class: "s-order-edit-add-modal-price", innerHTML: salla.money(price) }))))), index.h("div", { class: "s-order-edit-add-modal-quantity" }, index.h("h3", { class: "s-order-edit-add-modal-section-title" }, salla.lang.getWithDefault('common.elements.quantity', 'الكمية')), index.h("div", { class: "s-order-edit-add-modal-quantity-input" }, index.h("salla-quantity-input", { ...quantityAttrs, onChange: event => this.handleAddProductQuantityChange(event) }))), product.options?.length > 0 && (index.h("form", { onSubmit: e => e.preventDefault() }, index.h("salla-product-options", { ref: el => (this.addProductOptions = el), "product-id": product.id, "unique-key": optionsInstanceKey, options: JSON.stringify(product.options), key: `${optionsInstanceKey}-options` }))), index.h("div", { class: "s-order-edit-add-modal-actions" }, index.h("salla-button", { onClick: () => this.confirmAddProduct(), loading: this.addProductConfirmLoading }, salla.lang.getWithDefault('common.elements.confirm', 'تأكيد')), index.h("salla-button", { color: "gray", fill: "outline", onClick: () => this.addProductDrawer?.close?.() }, salla.lang.getWithDefault('common.elements.cancel', 'الغاء'))))) : null)));
444
+ }
145
445
  renderSaveModal() {
146
446
  const preview = this.editPreview;
147
447
  const hasRemainingAmount = preview?.totals?.remaining_amount?.amount > 0;
@@ -174,16 +474,15 @@ const SallaOrderEdit = class {
174
474
  return (index.h(index.Host, null, index.h("div", { class: "s-order-edit-expired" }, index.h("p", null, salla.lang.getWithDefault('pages.orders.edit_session_expired', 'انتهت مدة التعديل المتاحة')), index.h("salla-button", { onClick: () => this.navigateToOrder() }, salla.lang.getWithDefault('pages.orders.back_to_order', 'العودة إلى تفاصيل الطلب')))));
175
475
  }
176
476
  if (this.error || !this.order) {
177
- return (index.h(index.Host, null, index.h("div", { class: "no-content-placeholder" }, index.h("i", { class: "sicon-shopping-bag icon" }), index.h("p", null, this.error))));
477
+ return (index.h(index.Host, null, index.h("div", { class: "s-order-edit-no-content-placeholder" }, index.h("i", { class: "sicon-shopping-bag icon" }), index.h("p", null, this.error))));
178
478
  }
179
479
  const hasItems = this.order.items && this.order.items.length > 0;
180
480
  const endsAt = this.order.customer_editing_session?.ends_at;
181
- return (index.h(index.Host, null, endsAt && (index.h("div", { class: "s-order-edit-timer-wrapper" }, index.h("salla-count-down", { prefixText: salla.lang.getWithDefault('pages.orders.edit_within', 'يمكنك التعديل خلال'), date: endsAt, horizontal: true, withButton: true, autoSegments: true, labeled: false, size: "sm", color: "primary" }))), index.h("div", { class: "s-order-edit-items-wrapper" }, index.h("h2", { class: "s-order-edit-items-title" }, salla.lang.getWithDefault('pages.orders.order_products', 'منتجات الطلب')), hasItems ? (this.order.items.map((item, index$1) => [
481
+ return (index.h(index.Host, null, endsAt && (index.h("div", { class: "s-order-edit-timer-wrapper" }, index.h("salla-count-down", { prefixText: salla.lang.getWithDefault('pages.orders.edit_within', 'يمكنك التعديل خلال'), date: endsAt, horizontal: true, withButton: true, autoSegments: true, labeled: false, size: "sm", color: "primary" }))), index.h("div", { class: "s-order-edit-layout" }, !this.isMobileViewport ? this.renderProductsPanel() : null, index.h("section", { class: "s-order-edit-order-panel" }, index.h("div", { class: "s-order-edit-items-wrapper" }, index.h("h2", { class: "s-order-edit-items-title" }, salla.lang.getWithDefault('pages.orders.order_products', 'منتجات الطلب')), hasItems ? (this.order.items.map((item, index$1) => [
182
482
  index.h("salla-order-edit-item", { key: item.id, item: item, orderId: this.orderId }),
183
483
  index$1 < this.order.items.length - 1 ? (index.h("div", { class: "s-order-edit-items-divider" })) : null,
184
- ])) : (index.h("div", { class: "no-content-placeholder" }, index.h("i", { class: "sicon-shopping-bag icon" }), index.h("p", null, salla.lang.getWithDefault('common.elements.no_items', 'لا توجد عناصر'))))), index.h("div", { class: "s-order-edit-actions" }, index.h("salla-button", { onClick: () => this.saveOrder(), loading: this.saveLoading, disabled: !this.hasChanges }, salla.lang.getWithDefault('pages.orders.save_changes', 'حفظ التعديلات')), index.h("salla-button", { color: "gray", fill: "outline", onClick: () => this.cancelEditSession() }, salla.lang.getWithDefault('common.elements.cancel', 'الغاء'))), this.renderSaveModal()));
484
+ ])) : (index.h("div", { class: "s-order-edit-no-content-placeholder" }, index.h("i", { class: "sicon-shopping-bag icon" }), index.h("p", null, salla.lang.getWithDefault('common.elements.no_items', 'لا توجد عناصر'))))), index.h("div", { class: "s-order-edit-actions" }, index.h("salla-button", { class: "s-order-edit-mobile-products-trigger", color: "gray", size: "small", fill: "outline", onClick: () => this.openMobileProductsModal() }, index.h("i", { class: "sicon-add s-order-edit-mobile-products-trigger-icon" }), salla.lang.getWithDefault('pages.orders.add_product', 'إضافة منتج')), index.h("salla-button", { onClick: () => this.saveOrder(), loading: this.saveLoading, size: "small", disabled: !this.hasChanges }, salla.lang.getWithDefault('pages.orders.save_changes', 'حفظ التعديلات')), index.h("salla-button", { size: "small", color: "gray", fill: "outline", onClick: () => this.cancelEditSession() }, salla.lang.getWithDefault('common.elements.cancel', 'الغاء'))))), this.renderMobileProductsModal(), this.renderAddProductDrawer(), this.renderSaveModal()));
185
485
  }
186
- get host() { return index.getElement(this); }
187
486
  };
188
487
  SallaOrderEdit.style = sallaOrderEditCss;
189
488
 
@@ -3,7 +3,7 @@
3
3
  */
4
4
  'use strict';
5
5
 
6
- var index = require('./index-DO_QXaSt.js');
6
+ var index = require('./index-vstkdqRz.js');
7
7
  var check = require('./check-BnVBPQNp.js');
8
8
 
9
9
  var iconFileArchive = `<!-- Generated by IcoMoon.io -->
@@ -92,7 +92,7 @@ const SallaOrderSummary = class {
92
92
  this.copyCodeButtonTimeout && clearTimeout(this.copyCodeButtonTimeout);
93
93
  }
94
94
  render() {
95
- return (index.h("ul", { key: 'bb8c8e2c3a44f0922012789efc9a73d71fd213d5', class: "s-order-summary-wrapper" }, this.noItemFound ? index.h("salla-placeholder", { alignment: "center" }, index.h("span", { slot: "title" })) :
95
+ return (index.h("ul", { key: '20b8d793a83306a203cd0f7eadededf3ce224181', class: "s-order-summary-wrapper" }, this.noItemFound ? index.h("salla-placeholder", { alignment: "center" }, index.h("span", { slot: "title" })) :
96
96
  this.order_items.map((item) => (this.isDigitalCard(item) ? (index.h("li", { key: item.product.id, class: "s-order-summary-item" }, index.h("h2", { class: "s-order-summary-item-title" }, this.codes_text, " (", item.name, ")"), item.codes.map((code) => (index.h("div", { key: code.code, class: "s-order-summary-code-item-wrapper" }, index.h("p", null, index.h("span", { innerHTML: iconCreditCard }), index.h("span", null, code.code)), index.h("salla-button", { class: `s-order-summary-item-copy-button ${this.codeCopied === code.code ? 'copied' : ''}`, onClick: () => this.copyToClipboardHandler(code.code), shape: "link" }, index.h("span", { innerHTML: this.codeCopied === code.code ? check.SICheck : iconCopy }), index.h("span", null, this.copy_text))))))) :
97
97
  this.isDigitalProduct(item) ? (index.h("li", { key: item.product.id, class: "s-order-summary-item" }, index.h("h2", { class: "s-order-summary-item-title" }, this.files_text, " (", item.name, ")"), index.h("ul", null, item.files.map((file) => (index.h("li", { class: "s-order-summary-digital-item-wrapper" }, index.h("div", null, index.h("span", { innerHTML: iconFileArchive }), index.h("span", null, file.name)), index.h("a", { href: file.url, target: "_blank", class: "s-order-summary-item-download" }, index.h("span", { innerHTML: iconDownload }), index.h("span", null, this.download_text)))))))) : null))));
98
98
  }
@@ -3,7 +3,7 @@
3
3
  */
4
4
  'use strict';
5
5
 
6
- var index = require('./index-DO_QXaSt.js');
6
+ var index = require('./index-vstkdqRz.js');
7
7
 
8
8
  const sallaOrderTotalsCardCss = ":host{display:block}";
9
9
 
@@ -3,7 +3,7 @@
3
3
  */
4
4
  'use strict';
5
5
 
6
- var index = require('./index-DO_QXaSt.js');
6
+ var index = require('./index-vstkdqRz.js');
7
7
  var Helper = require('./Helper-CU4Xuiki.js');
8
8
  require('./anime.es-BqW8JHZi.js');
9
9
 
@@ -3,7 +3,7 @@
3
3
  */
4
4
  'use strict';
5
5
 
6
- var index = require('./index-DO_QXaSt.js');
6
+ var index = require('./index-vstkdqRz.js');
7
7
 
8
8
  const sallaPaymentsCss = ":host{display:block}";
9
9
 
@@ -36,12 +36,12 @@ const SallaPayments = class {
36
36
  render() {
37
37
  const madeInKSA = !this.exclude.includes('made-in-ksa') && salla.config.get('store.settings.made_in_ksa');
38
38
  const sbcId = this.exclude.includes('sbc') ? null : salla.config.get('store.settings.certificate.id');
39
- return (index.h(index.Host, { key: '3e44396c845375f9147a4dd036fe63f299787a6f', class: "s-payments-list-wrap" }, index.h("ul", { key: '476cc234749bb57898769d1089d718995da9ae12', class: "s-payments-list" }, madeInKSA && index.h("li", { key: '2bbe346520331ca8bff96a5fb8f4628093422e61', class: "s-payments-list-item" }, index.h("img", { key: 'a281cc6e6bf4cdfc8fa4948c86a9b1b024bca8b8', width: "100%", height: "100%", decoding: "async", loading: "lazy", src: salla.url.cdn(`images/made-in-ksa.svg`, 58, 58), alt: "made in KSA certified" })), this.payments.map((payment) => (payment == "cod" ?
39
+ return (index.h(index.Host, { key: '94af8ddf97dca63ba7c1a19f65a1d872b8d565c6', class: "s-payments-list-wrap" }, index.h("ul", { key: '8e1425d89a60290b92042f82edbd2c0505da2904', class: "s-payments-list" }, madeInKSA && index.h("li", { key: '4ca6642fc2ef1cf1505b37127cf93cf48805e454', class: "s-payments-list-item" }, index.h("img", { key: 'f704728b2fade2d27f2109d47bc7e7381f3efe8b', width: "100%", height: "100%", decoding: "async", loading: "lazy", src: salla.url.cdn(`images/made-in-ksa.svg`, 58, 58), alt: "made in KSA certified" })), this.payments.map((payment) => (payment == "cod" ?
40
40
  index.h("div", { id: "cod-slot", innerHTML: this.codSlot
41
41
  .replace(/\{image\}/g, salla.url.cdn(`images/payment/cod_mini.png`, 58, 58)) }) :
42
42
  index.h("div", { id: "payment-slot", innerHTML: this.paymentSlot
43
43
  .replace(/\{image\}/g, salla.url.cdn(`images/payment/${payment}_mini.png`, 58, 58))
44
- .replace(/\{payment\}/g, payment) }))), sbcId && index.h("div", { key: 'ef5bbf9934a50015e2eb588f41ec9b5f86341dea', id: "sbc-slot", innerHTML: this.sbcSlot
44
+ .replace(/\{payment\}/g, payment) }))), sbcId && index.h("div", { key: '5071bb1e003ff36b445fd15948b7612f6a1ecde4', id: "sbc-slot", innerHTML: this.sbcSlot
45
45
  .replace(/\{image\}/g, salla.url.cdn(`images/sbc.png`, 58, 58))
46
46
  .replace(/\{link\}/g, `https://eauthenticate.saudibusiness.gov.sa/certificate-details/${sbcId}`) }))));
47
47
  }
@@ -3,7 +3,7 @@
3
3
  */
4
4
  'use strict';
5
5
 
6
- var index = require('./index-DO_QXaSt.js');
6
+ var index = require('./index-vstkdqRz.js');
7
7
 
8
8
  var Inbox = `<!-- Generated by IcoMoon.io -->
9
9
  <svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
@@ -43,7 +43,7 @@ const SallaPlaceholder = class {
43
43
  };
44
44
  }
45
45
  render() {
46
- return (index.h(index.Host, { key: '85a52f39cc2012ca1a3c6d143d06b81981d761aa', class: this.alignmentClass() }, index.h("div", { key: '35be844bc3883f3451344bbeedb4b24f9c218f7a', class: `s-placeholder-icon s-placeholder-icon-${this.iconSize}`, innerHTML: this.icon }), index.h("div", { key: '58152da7774e79fdb09465087b741212a3982cf2', class: "s-placeholder-title" }, index.h("slot", { key: 'f9953085b498043920fd03ae44a082e0fb1a02d2', name: 'title' }, index.h("span", { key: '989633e3165d187c6d3b36e0cdfa2cb10466c6da' }, salla.lang.get('common.elements.no_options')))), index.h("div", { key: 'bfbcbb5a2f9561292e5a6850eb43f5bfea8bd040', class: "s-placeholder-description" }, index.h("slot", { key: '4592587daaaa41c67cd7670eea7d5e7e3d8635d7', name: 'description' }, index.h("span", { key: '4b1e3c4a453b8dbc5139b40ebddb94d8c2d1c465' }, salla.lang.get('common.errors.empty_results'))))));
46
+ return (index.h(index.Host, { key: 'c036c6655683dd28dc1fe108a0c9f18c41d4dab2', class: this.alignmentClass() }, index.h("div", { key: '8a344197473899bfce235707a0a4b586b09f7586', class: `s-placeholder-icon s-placeholder-icon-${this.iconSize}`, innerHTML: this.icon }), index.h("div", { key: '84c667eedacea750f761c0c650615c63812875ca', class: "s-placeholder-title" }, index.h("slot", { key: '4b59c67b550d5b4fb818007f0061b7648984c13c', name: 'title' }, index.h("span", { key: 'aec395c1624cc78932d4bddc2aaf936d6c300143' }, salla.lang.get('common.elements.no_options')))), index.h("div", { key: 'de0e5e440393992977e73d457df7c537cb2c1c8a', class: "s-placeholder-description" }, index.h("slot", { key: '4e85b215cd7255ee2ec7bd18913ea9f4709adaef', name: 'description' }, index.h("span", { key: '2c6746373095d09ef5cd19c2015cb240545d4ef9' }, salla.lang.get('common.errors.empty_results'))))));
47
47
  }
48
48
  };
49
49
  SallaPlaceholder.style = sallaPlaceholderCss;
@@ -3,7 +3,7 @@
3
3
  */
4
4
  'use strict';
5
5
 
6
- var index = require('./index-DO_QXaSt.js');
6
+ var index = require('./index-vstkdqRz.js');
7
7
  var arrowLeft = require('./arrow-left-xSEmRpp6.js');
8
8
 
9
9
  var arrowRight = `<!-- Generated by IcoMoon.io -->
@@ -159,9 +159,9 @@ const SallaPriceRange = class {
159
159
  this.maxPrice = value === undefined ? '' : value;
160
160
  }
161
161
  render() {
162
- return (index.h(index.Host, { key: '996f527f5a36ea273b0d8c195e35dc3efbdf62f2' }, this.filterValues.map((filterValue, index$1) => {
162
+ return (index.h(index.Host, { key: '343fd7a54f3a7d32c6709019fb168c7a8a1ca5f1' }, this.filterValues.map((filterValue, index$1) => {
163
163
  return index.h("label", { class: "s-filters-label", htmlFor: `${this.option.key}-${index$1}`, key: index$1 }, index.h("input", { id: `${this.option.key}-${index$1}`, name: "price", type: "radio", checked: this.isChecked(filterValue), class: "s-filters-radio", onChange: e => this.handleMinMaxPrice(e, filterValue) }), index.h("span", { innerHTML: this.getPriceLabel(filterValue) }));
164
- }), index.h("div", { key: 'bfa8f970eb1e9c5d2b9678e5271aa04208b39289', class: "flex justify-center items-center" }, index.h("div", { key: '59cd51f388f36a38e2bd036d27b7abe001fed9d0', class: "relative max-w-xl w-full" }, index.h("div", { key: '226bd18705572502c7da11022a8ce02dc08d4d21', class: "s-price-range-inputs" }, index.h("div", { key: '0ebfdced114308e82075cd153bef0020daa15bf6', class: "s-price-range-relative" }, index.h("div", { key: 'c3dacef6133e2b05eca8d643d1c8ce3f5b991548', class: "s-price-range-currency" }, " ", salla.config.currency().symbol), index.h("input", { key: 'b2451e091d93f85f268fc80e30e24f5f71c2628c', type: "number", maxlength: "5", ref: el => this.minInput = el, onBlur: (e) => this.handleMinPrice(e), value: this.minPrice, placeholder: this.fromLabel, class: "s-price-range-number-input" })), index.h("div", { key: '00c07380972b65eac5fac5688b99d21277f65d39', class: "s-price-range-gray-text" }, " -"), index.h("div", { key: '403e98ad682f08946ccd191715ff37401a376722', class: "s-price-range-relative" }, index.h("div", { key: 'a1b0729fc40c17b9be68dd2c76a3afa1e99d8a62', class: "s-price-range-currency" }, " ", salla.config.currency().symbol), index.h("input", { key: '5f5e5a202f4b11cde88ae954fa352b71886fe30e', type: "number", maxlength: "5", ref: el => this.maxInput = el, onBlur: (e) => this.handleMaxPrice(e), value: this.maxPrice, placeholder: this.toLabel, class: "s-price-range-number-input", "aria-describedby": "price-currency" })), index.h("salla-button", { key: 'dd4899512e03f10c18e74f4d2434406dc6922a50', color: 'gray', shape: 'icon', size: 'small', fill: 'outline', onClick: (event) => this.changedEventHandler(event) }, index.h("span", { key: '98d023ccfe7e26278259bf690a1d7a4323a704fc', innerHTML: this.isRTL ? arrowLeft.arrowLeft : arrowRight })))))));
164
+ }), index.h("div", { key: '99b72a90eb7c99fd0a061f3ae6fdb7a16f4a6cb5', class: "flex justify-center items-center" }, index.h("div", { key: '90234fcadbfd931e1ccbd8006f47219196b7d958', class: "relative max-w-xl w-full" }, index.h("div", { key: 'eb284df7b56929fa0b6b31f029024a48ba0528b5', class: "s-price-range-inputs" }, index.h("div", { key: '43adbda7a9dd480690a678e0efc7aeed889fb81f', class: "s-price-range-relative" }, index.h("div", { key: '16277456eb7fc08357ff91daef4af1944e79b762', class: "s-price-range-currency" }, " ", salla.config.currency().symbol), index.h("input", { key: '9af2548117afe8389b786621d9e26e8f441c9fa6', type: "number", maxlength: "5", ref: el => this.minInput = el, onBlur: (e) => this.handleMinPrice(e), value: this.minPrice, placeholder: this.fromLabel, class: "s-price-range-number-input" })), index.h("div", { key: '5f5a45e86632b6183e0b85a5c1489d311b72c9b1', class: "s-price-range-gray-text" }, " -"), index.h("div", { key: '80198c67b69613cd09f0aa03faaf7f162a432478', class: "s-price-range-relative" }, index.h("div", { key: '5b84faee68142be3f18215b6f916eb1cd245c74c', class: "s-price-range-currency" }, " ", salla.config.currency().symbol), index.h("input", { key: 'a813df6ce1645b5e3d414a13879f9c4172bb6f4f', type: "number", maxlength: "5", ref: el => this.maxInput = el, onBlur: (e) => this.handleMaxPrice(e), value: this.maxPrice, placeholder: this.toLabel, class: "s-price-range-number-input", "aria-describedby": "price-currency" })), index.h("salla-button", { key: '34644f25fbd11238f27f3de0343ef5b65d192c16', color: 'gray', shape: 'icon', size: 'small', fill: 'outline', onClick: (event) => this.changedEventHandler(event) }, index.h("span", { key: '07f5f1d7faad2ad05ea8538076b73b14a8f3137c', innerHTML: this.isRTL ? arrowLeft.arrowLeft : arrowRight })))))));
165
165
  }
166
166
  componentDidLoad() {
167
167
  this.isReady = true;
@@ -3,7 +3,7 @@
3
3
  */
4
4
  'use strict';
5
5
 
6
- var index = require('./index-DO_QXaSt.js');
6
+ var index = require('./index-vstkdqRz.js');
7
7
  var star2 = require('./star2-R146a27p.js');
8
8
  var Helper = require('./Helper-CU4Xuiki.js');
9
9
  require('./anime.es-BqW8JHZi.js');
@@ -116,14 +116,14 @@ const SallaProductCard = class {
116
116
  's-product-card-out-of-stock': this.productData?.is_out_of_stock,
117
117
  };
118
118
  const hrefProp = this.productData?.url ? { href: this.productData.url, title: `Learn more about ${this.productData?.name}` } : {};
119
- return (index.h(index.Host, { key: 'e0981508ab81f2a0bed4b763829d25792e55a692', id: `product-${this.productData?.id}`, class: classes }, index.h("div", { key: '8ed3f18aa60f4c63fcd8a5603683f76c6ec247a8', class: !this.fullImage ? 's-product-card-image' : 's-product-card-image-full' }, index.h("a", { key: 'e412236f624d180312a7361c0bb43f4af05ac868', ...hrefProp }, index.h("img", { key: 'a8517f1f3c5c2d15489aa5509bb667fb3ce98ca6', class: `s-product-card-image-${salla.url.is_placeholder(this.productData?.image?.url)
119
+ return (index.h(index.Host, { key: '9587bcb7fa6abdf1ec9cea621004e7e7077c2fd6', id: `product-${this.productData?.id}`, class: classes }, index.h("div", { key: 'f2d3c72f55d302e85a2da4e478d294f1ff7a155b', class: !this.fullImage ? 's-product-card-image' : 's-product-card-image-full' }, index.h("a", { key: '932e6defeeec23cda564e80a55f90260d51a1996', ...hrefProp }, index.h("img", { key: 'f1a82c5dab197fff512d5ab220a34acea82fd6d0', class: `s-product-card-image-${salla.url.is_placeholder(this.productData?.image?.url)
120
120
  ? 'contain'
121
121
  : this.fitImageHeight
122
122
  ? this.fitImageHeight
123
- : 'cover'} lazy`, src: this.placeholder, alt: this.productData?.image?.alt || this.productData?.name, "data-src": this.productData?.image?.url || this.productData?.thumbnail }), !this.fullImage && !this.minimal ? this.getProductBadge() : ''), this.fullImage && index.h("a", { key: '9b0841267856eeaf8fd3f44df9e11a2e82ea2554', ...hrefProp, class: "s-product-card-overlay" }), !this.horizontal && !this.fullImage ?
124
- index.h("salla-button", { shape: "icon", fill: "none", color: "light", loading: false, "aria-label": "Add or remove to wishlist", ref: el => this.wishlistBtn = el, class: "s-product-card-wishlist-btn animated", onClick: () => this.handleWishlistClick() }, index.h("span", { innerHTML: Heart })) : ''), index.h("div", { key: 'f027bc5aa8d3e46eeff5e0c2f22c33f06298884c', class: "s-product-card-content" }, this.isSpecial && this.productData?.quantity ?
123
+ : 'cover'} lazy`, src: this.placeholder, alt: this.productData?.image?.alt || this.productData?.name, "data-src": this.productData?.image?.url || this.productData?.thumbnail }), !this.fullImage && !this.minimal ? this.getProductBadge() : ''), this.fullImage && index.h("a", { key: '40eb012054592e5c65309a4fcbe6fd4f3512197e', ...hrefProp, class: "s-product-card-overlay" }), !this.horizontal && !this.fullImage ?
124
+ index.h("salla-button", { shape: "icon", fill: "none", color: "light", loading: false, "aria-label": "Add or remove to wishlist", ref: el => this.wishlistBtn = el, class: "s-product-card-wishlist-btn animated", onClick: () => this.handleWishlistClick() }, index.h("span", { innerHTML: Heart })) : ''), index.h("div", { key: '91c99ae52ff1da64dfe69812ccfb26e91590f105', class: "s-product-card-content" }, this.isSpecial && this.productData?.quantity ?
125
125
  index.h("div", { class: "s-product-card-content-pie", ref: pie => this.pie = pie }, index.h("span", null, index.h("b", null, salla.helpers.number(this.productData?.quantity)), this.remained), index.h("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "-2 -1 36 34", class: "s-product-card-content-pie-svg" }, index.h("circle", { cx: "16", cy: "16", r: "15.9155", class: "s-product-card-content-pie-svg-base" }), index.h("circle", { cx: "16", cy: "16", r: "15.9155", class: "s-product-card-content-pie-svg-bar" })))
126
- : '', index.h("div", { key: '942aed0114c9155a7b397261032ec3d5f3bbf983', class: { 's-product-card-content-main': true, 's-product-card-content-extra-padding': this.isSpecial } }, index.h("h3", { key: '82e874903e2391cbda7df6cdbb41422341f66476', class: "s-product-card-content-title" }, index.h("a", { key: 'be7e564d2341c97d8431fa49e6a176548183929c', ...hrefProp }, this.productData?.name)), this.productData?.subtitle && !this.minimal ?
126
+ : '', index.h("div", { key: '630f6fdafccb0a6d5db2eb9399f5ba7c02ffde4b', class: { 's-product-card-content-main': true, 's-product-card-content-extra-padding': this.isSpecial } }, index.h("h3", { key: '0c366496893811cec16c67b4c28c8ac6a40bd191', class: "s-product-card-content-title" }, index.h("a", { key: 'f9ba0a3655e8058b3a10c16016e7e5f3d85a6e8a', ...hrefProp }, this.productData?.name)), this.productData?.subtitle && !this.minimal ?
127
127
  index.h("p", { class: "s-product-card-content-subtitle" }, this.productData?.subtitle)
128
128
  : ''), this.productData?.donation && !this.minimal && !this.fullImage ?
129
129
  [index.h("salla-progress-bar", { donation: this.productData?.donation }), index.h("div", { class: "s-product-card-donation-input" }, this.productData?.donation?.can_donate ?
@@ -132,7 +132,7 @@ const SallaProductCard = class {
132
132
  this.addBtn.donatingAmount = e.target.value;
133
133
  }, id: "donation-amount", name: "donating_amount", class: "s-form-control", placeholder: this.donationAmount })]
134
134
  : '')]
135
- : '', index.h("div", { key: 'f565ee76394a00c047cdf3abacacdc351565ba1d', class: { 's-product-card-content-sub': true, 's-product-card-content-extra-padding': this.isSpecial } }, this.getProductPrice(), this.productData?.rating?.stars && !this.minimal ?
135
+ : '', index.h("div", { key: 'd67416c75a6fb7daa507e2d578c11f5dc1ecff2f', class: { 's-product-card-content-sub': true, 's-product-card-content-extra-padding': this.isSpecial } }, this.getProductPrice(), this.productData?.rating?.stars && !this.minimal ?
136
136
  index.h("div", { class: "s-product-card-rating" }, index.h("span", { innerHTML: star2.Star }), index.h("span", null, this.productData.rating.stars))
137
137
  : ''), this.isSpecial && this.productData.discount_ends
138
138
  ? index.h("salla-count-down", { date: this.formatDate(this.productData.discount_ends), "end-of-day": true, boxed: true, labeled: true })