@salla.sa/twilight-components 2.14.486 → 2.14.488

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 (353) hide show
  1. package/dist/cjs/{Helper-DvyEpCgx.js → Helper-B2B-kxAI.js} +7 -2
  2. package/dist/cjs/{filepond-BtDP9OW9.js → filepond-05NO31dc.js} +1 -1
  3. package/dist/cjs/{filepond-plugin-file-poster-CTf1Ej_n.js → filepond-plugin-file-poster-BSzyn1DL.js} +1 -1
  4. package/dist/cjs/{filepond-plugin-file-validate-size-_wVJpYXF.js → filepond-plugin-file-validate-size-DJKsosMa.js} +1 -1
  5. package/dist/cjs/{filepond-plugin-file-validate-type-DWoo5Lcs.js → filepond-plugin-file-validate-type-C0xLud1P.js} +1 -1
  6. package/dist/cjs/{filepond-plugin-image-edit-DBb_5aN9.js → filepond-plugin-image-edit-Dq1zXDYS.js} +1 -1
  7. package/dist/cjs/{filepond-plugin-image-exif-orientation-Nnwt-m9k.js → filepond-plugin-image-exif-orientation-B84Q7JSN.js} +1 -1
  8. package/dist/cjs/{filepond-plugin-image-preview-CjBwZm3E.js → filepond-plugin-image-preview-BaE9P79l.js} +1 -1
  9. package/dist/cjs/{functions-DkS9Jmao.js → functions-B-_Pnqnt.js} +1 -1
  10. package/dist/cjs/{index-C0yFagl6.js → index-BsvV4QQg.js} +1 -1
  11. package/dist/cjs/{index-C_WIlgE2.js → index-f6loD1zL.js} +10 -2
  12. package/dist/cjs/loader.cjs.js +2 -2
  13. package/dist/cjs/salla-accordion-body_2.cjs.entry.js +1 -1
  14. package/dist/cjs/salla-accordion_6.cjs.entry.js +4 -3
  15. package/dist/cjs/salla-add-product-button_5.cjs.entry.js +2 -2
  16. package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
  17. package/dist/cjs/salla-alert_2.cjs.entry.js +1 -1
  18. package/dist/cjs/salla-app-install-alert.cjs.entry.js +1 -1
  19. package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
  20. package/dist/cjs/salla-badge.cjs.entry.js +1 -1
  21. package/dist/cjs/salla-booking-field_7.cjs.entry.js +11 -11
  22. package/dist/cjs/salla-bullet-delivery_2.cjs.entry.js +21 -13
  23. package/dist/cjs/salla-cart-coupons.cjs.entry.js +1 -1
  24. package/dist/cjs/salla-cart-item-offers_2.cjs.entry.js +1 -1
  25. package/dist/cjs/salla-cart-summary-card.cjs.entry.js +349 -0
  26. package/dist/cjs/salla-cashback-banner.cjs.entry.js +1 -1
  27. package/dist/cjs/salla-comment-form_8.cjs.entry.js +2 -2
  28. package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
  29. package/dist/cjs/salla-contacts.cjs.entry.js +1 -1
  30. package/dist/cjs/salla-cookies-bar.cjs.entry.js +1 -1
  31. package/dist/cjs/salla-count-down.cjs.entry.js +1 -1
  32. package/dist/cjs/salla-custom-fields.cjs.entry.js +1 -1
  33. package/dist/cjs/salla-delivery-promise.cjs.entry.js +1 -1
  34. package/dist/cjs/salla-edit-order-button.cjs.entry.js +1 -1
  35. package/dist/cjs/salla-filters-widget.cjs.entry.js +15 -8
  36. package/dist/cjs/salla-filters.cjs.entry.js +101 -13
  37. package/dist/cjs/salla-fulfillment-methods.cjs.entry.js +1 -1
  38. package/dist/cjs/salla-gifting.cjs.entry.js +1 -1
  39. package/dist/cjs/salla-hook.cjs.entry.js +1 -1
  40. package/dist/cjs/salla-infinite-scroll.cjs.entry.js +2 -2
  41. package/dist/cjs/salla-installment.cjs.entry.js +1 -1
  42. package/dist/cjs/salla-list-tile.cjs.entry.js +1 -1
  43. package/dist/cjs/salla-localization-modal.cjs.entry.js +1 -1
  44. package/dist/cjs/salla-login-modal.cjs.entry.js +1 -1
  45. package/dist/cjs/salla-loyalty-banner.cjs.entry.js +2 -2
  46. package/dist/cjs/salla-loyalty-hero_2.cjs.entry.js +2 -2
  47. package/dist/cjs/salla-loyalty-panel.cjs.entry.js +3 -3
  48. package/dist/cjs/salla-loyalty-points-banner.cjs.entry.js +1 -1
  49. package/dist/cjs/salla-loyalty-points-history.cjs.entry.js +1 -1
  50. package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
  51. package/dist/cjs/salla-loyalty-program.cjs.entry.js +3 -3
  52. package/dist/cjs/salla-loyalty-reward.cjs.entry.js +2 -2
  53. package/dist/cjs/salla-loyalty.cjs.entry.js +1 -1
  54. package/dist/cjs/salla-maintenance-alert.cjs.entry.js +1 -1
  55. package/dist/cjs/salla-map_2.cjs.entry.js +1 -1
  56. package/dist/cjs/salla-menu.cjs.entry.js +1 -1
  57. package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
  58. package/dist/cjs/salla-multiple-bundle-product-cart_2.cjs.entry.js +1 -1
  59. package/dist/cjs/salla-multiple-bundle-product-options-modal_2.cjs.entry.js +1 -1
  60. package/dist/cjs/salla-multiple-bundle-product.cjs.entry.js +1 -1
  61. package/dist/cjs/salla-next-order-coupon.cjs.entry.js +1 -1
  62. package/dist/cjs/salla-notification-item.cjs.entry.js +1 -1
  63. package/dist/cjs/salla-notifications.cjs.entry.js +2 -2
  64. package/dist/cjs/salla-offer-modal.cjs.entry.js +1 -1
  65. package/dist/cjs/salla-offer.cjs.entry.js +1 -1
  66. package/dist/cjs/salla-order-branch.cjs.entry.js +1 -1
  67. package/dist/cjs/salla-order-cancel.cjs.entry.js +296 -0
  68. package/dist/cjs/salla-order-details-multiple-bundle-product.cjs.entry.js +1 -1
  69. package/dist/cjs/salla-order-details-options.cjs.entry.js +1 -1
  70. package/dist/cjs/salla-order-details.cjs.entry.js +1 -1
  71. package/dist/cjs/salla-order-edit-item.cjs.entry.js +1 -1
  72. package/dist/cjs/salla-order-edit-product-card.cjs.entry.js +1 -1
  73. package/dist/cjs/salla-order-edit.cjs.entry.js +1 -1
  74. package/dist/cjs/salla-order-options-modal_3.cjs.entry.js +2 -2
  75. package/dist/cjs/salla-order-summary.cjs.entry.js +1 -1
  76. package/dist/cjs/salla-order-totals-card.cjs.entry.js +1 -1
  77. package/dist/cjs/salla-orders.cjs.entry.js +2 -2
  78. package/dist/cjs/salla-payments.cjs.entry.js +1 -1
  79. package/dist/cjs/salla-placeholder.cjs.entry.js +1 -1
  80. package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
  81. package/dist/cjs/salla-product-card-embed.cjs.entry.js +1 -1
  82. package/dist/cjs/salla-product-size-guide.cjs.entry.js +1 -1
  83. package/dist/cjs/salla-products-list.cjs.entry.js +21 -9
  84. package/dist/cjs/salla-quick-order.cjs.entry.js +1 -1
  85. package/dist/cjs/salla-rating-modal.cjs.entry.js +2 -2
  86. package/dist/cjs/salla-reward-action_4.cjs.entry.js +3 -3
  87. package/dist/cjs/salla-scopes.cjs.entry.js +1 -1
  88. package/dist/cjs/salla-search.cjs.entry.js +2 -2
  89. package/dist/cjs/salla-skeleton.cjs.entry.js +1 -1
  90. package/dist/cjs/salla-slider.cjs.entry.js +1 -1
  91. package/dist/cjs/salla-social-share.cjs.entry.js +1 -1
  92. package/dist/cjs/salla-social.cjs.entry.js +1 -1
  93. package/dist/cjs/salla-tab-content_3.cjs.entry.js +1 -1
  94. package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
  95. package/dist/cjs/salla-tooltip.cjs.entry.js +1 -1
  96. package/dist/cjs/salla-trust-badges.cjs.entry.js +1 -1
  97. package/dist/cjs/salla-user-menu.cjs.entry.js +5 -2
  98. package/dist/cjs/salla-user-profile.cjs.entry.js +1 -1
  99. package/dist/cjs/salla-user-settings.cjs.entry.js +1 -1
  100. package/dist/cjs/salla-verify.cjs.entry.js +1 -1
  101. package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
  102. package/dist/cjs/salla-wishlist-actions.cjs.entry.js +1 -1
  103. package/dist/cjs/{tracked-promise-TyxTPR6e.js → tracked-promise-We1h_qB4.js} +1 -1
  104. package/dist/cjs/twilight.cjs.js +2 -2
  105. package/dist/cjs/{vanilla-picker-DyJFw96R.js → vanilla-picker-Ck8OFt14.js} +1 -1
  106. package/dist/collection/Helpers/Helper.js +7 -2
  107. package/dist/collection/collection-manifest.json +2 -0
  108. package/dist/collection/components/salla-breadcrumb/salla-breadcrumb.js +2 -1
  109. package/dist/collection/components/salla-bullet-delivery/salla-bullet-delivery.js +20 -12
  110. package/dist/collection/components/salla-cart-summary-card/salla-cart-summary-card.js +401 -0
  111. package/dist/collection/components/salla-filters/salla-filters.css +5 -0
  112. package/dist/collection/components/salla-filters/salla-filters.js +101 -11
  113. package/dist/collection/components/salla-filters-widget/salla-filters-widget.js +13 -6
  114. package/dist/collection/components/salla-order-cancel/interfaces.js +1 -0
  115. package/dist/collection/components/salla-order-cancel/salla-order-cancel.css +17 -0
  116. package/dist/collection/components/salla-order-cancel/salla-order-cancel.js +366 -0
  117. package/dist/collection/components/salla-products-list/salla-products-list.js +19 -7
  118. package/dist/collection/components/salla-user-menu/salla-user-menu.js +4 -1
  119. package/dist/components/Helper.js +7 -2
  120. package/dist/components/index.js +2 -2
  121. package/dist/components/salla-breadcrumb.js +2 -1
  122. package/dist/components/salla-bullet-delivery.js +20 -12
  123. package/dist/components/salla-cart-summary-card.d.ts +11 -0
  124. package/dist/components/salla-cart-summary-card.js +404 -0
  125. package/dist/components/salla-filters-widget2.js +13 -6
  126. package/dist/components/salla-filters.js +101 -11
  127. package/dist/components/salla-order-cancel.d.ts +11 -0
  128. package/dist/components/salla-order-cancel.js +347 -0
  129. package/dist/components/salla-products-list2.js +19 -7
  130. package/dist/components/salla-user-menu.js +4 -1
  131. package/dist/esm/{Helper-CD8d-Brd.js → Helper-BQ9mvrt9.js} +7 -2
  132. package/dist/esm/{filepond-ZiatSU0Y.js → filepond-2lHD_yVt.js} +1 -1
  133. package/dist/esm/{filepond-plugin-file-poster-2WAWdRm2.js → filepond-plugin-file-poster-DIjVVIwh.js} +1 -1
  134. package/dist/esm/{filepond-plugin-file-validate-size-DhLjP7aF.js → filepond-plugin-file-validate-size-CfcICNJA.js} +1 -1
  135. package/dist/esm/{filepond-plugin-file-validate-type-HH8AZXAq.js → filepond-plugin-file-validate-type-DsvYMiJr.js} +1 -1
  136. package/dist/esm/{filepond-plugin-image-edit-BWBtBfk1.js → filepond-plugin-image-edit-B7K5Ib7q.js} +1 -1
  137. package/dist/esm/{filepond-plugin-image-exif-orientation-CQyPB3lV.js → filepond-plugin-image-exif-orientation-9iz6i-up.js} +1 -1
  138. package/dist/esm/{filepond-plugin-image-preview-D6MiVWr1.js → filepond-plugin-image-preview-C89IBH1s.js} +1 -1
  139. package/dist/esm/{functions-DflaFDbL.js → functions-CJdqLH4P.js} +1 -1
  140. package/dist/esm/{index-Co2lT5R8.js → index-D1YskPUH.js} +1 -1
  141. package/dist/esm/{index-BF901xIc.js → index-K0OclOPO.js} +10 -2
  142. package/dist/esm/loader.js +3 -3
  143. package/dist/esm/salla-accordion-body_2.entry.js +1 -1
  144. package/dist/esm/salla-accordion_6.entry.js +4 -3
  145. package/dist/esm/salla-add-product-button_5.entry.js +2 -2
  146. package/dist/esm/salla-advertisement.entry.js +1 -1
  147. package/dist/esm/salla-alert_2.entry.js +1 -1
  148. package/dist/esm/salla-app-install-alert.entry.js +1 -1
  149. package/dist/esm/salla-apps-icons.entry.js +1 -1
  150. package/dist/esm/salla-badge.entry.js +1 -1
  151. package/dist/esm/salla-booking-field_7.entry.js +11 -11
  152. package/dist/esm/salla-bullet-delivery_2.entry.js +21 -13
  153. package/dist/esm/salla-cart-coupons.entry.js +1 -1
  154. package/dist/esm/salla-cart-item-offers_2.entry.js +1 -1
  155. package/dist/esm/salla-cart-summary-card.entry.js +347 -0
  156. package/dist/esm/salla-cashback-banner.entry.js +1 -1
  157. package/dist/esm/salla-comment-form_8.entry.js +2 -2
  158. package/dist/esm/salla-conditional-offer.entry.js +1 -1
  159. package/dist/esm/salla-contacts.entry.js +1 -1
  160. package/dist/esm/salla-cookies-bar.entry.js +1 -1
  161. package/dist/esm/salla-count-down.entry.js +1 -1
  162. package/dist/esm/salla-custom-fields.entry.js +1 -1
  163. package/dist/esm/salla-delivery-promise.entry.js +1 -1
  164. package/dist/esm/salla-edit-order-button.entry.js +1 -1
  165. package/dist/esm/salla-filters-widget.entry.js +15 -8
  166. package/dist/esm/salla-filters.entry.js +101 -13
  167. package/dist/esm/salla-fulfillment-methods.entry.js +1 -1
  168. package/dist/esm/salla-gifting.entry.js +1 -1
  169. package/dist/esm/salla-hook.entry.js +1 -1
  170. package/dist/esm/salla-infinite-scroll.entry.js +2 -2
  171. package/dist/esm/salla-installment.entry.js +1 -1
  172. package/dist/esm/salla-list-tile.entry.js +1 -1
  173. package/dist/esm/salla-localization-modal.entry.js +1 -1
  174. package/dist/esm/salla-login-modal.entry.js +1 -1
  175. package/dist/esm/salla-loyalty-banner.entry.js +2 -2
  176. package/dist/esm/salla-loyalty-hero_2.entry.js +2 -2
  177. package/dist/esm/salla-loyalty-panel.entry.js +3 -3
  178. package/dist/esm/salla-loyalty-points-banner.entry.js +1 -1
  179. package/dist/esm/salla-loyalty-points-history.entry.js +1 -1
  180. package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
  181. package/dist/esm/salla-loyalty-program.entry.js +3 -3
  182. package/dist/esm/salla-loyalty-reward.entry.js +2 -2
  183. package/dist/esm/salla-loyalty.entry.js +1 -1
  184. package/dist/esm/salla-maintenance-alert.entry.js +1 -1
  185. package/dist/esm/salla-map_2.entry.js +1 -1
  186. package/dist/esm/salla-menu.entry.js +1 -1
  187. package/dist/esm/salla-metadata.entry.js +1 -1
  188. package/dist/esm/salla-multiple-bundle-product-cart_2.entry.js +1 -1
  189. package/dist/esm/salla-multiple-bundle-product-options-modal_2.entry.js +1 -1
  190. package/dist/esm/salla-multiple-bundle-product.entry.js +1 -1
  191. package/dist/esm/salla-next-order-coupon.entry.js +1 -1
  192. package/dist/esm/salla-notification-item.entry.js +1 -1
  193. package/dist/esm/salla-notifications.entry.js +2 -2
  194. package/dist/esm/salla-offer-modal.entry.js +1 -1
  195. package/dist/esm/salla-offer.entry.js +1 -1
  196. package/dist/esm/salla-order-branch.entry.js +1 -1
  197. package/dist/esm/salla-order-cancel.entry.js +294 -0
  198. package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +1 -1
  199. package/dist/esm/salla-order-details-options.entry.js +1 -1
  200. package/dist/esm/salla-order-details.entry.js +1 -1
  201. package/dist/esm/salla-order-edit-item.entry.js +1 -1
  202. package/dist/esm/salla-order-edit-product-card.entry.js +1 -1
  203. package/dist/esm/salla-order-edit.entry.js +1 -1
  204. package/dist/esm/salla-order-options-modal_3.entry.js +2 -2
  205. package/dist/esm/salla-order-summary.entry.js +1 -1
  206. package/dist/esm/salla-order-totals-card.entry.js +1 -1
  207. package/dist/esm/salla-orders.entry.js +2 -2
  208. package/dist/esm/salla-payments.entry.js +1 -1
  209. package/dist/esm/salla-placeholder.entry.js +1 -1
  210. package/dist/esm/salla-price-range.entry.js +1 -1
  211. package/dist/esm/salla-product-card-embed.entry.js +1 -1
  212. package/dist/esm/salla-product-size-guide.entry.js +1 -1
  213. package/dist/esm/salla-products-list.entry.js +21 -9
  214. package/dist/esm/salla-quick-order.entry.js +1 -1
  215. package/dist/esm/salla-rating-modal.entry.js +2 -2
  216. package/dist/esm/salla-reward-action_4.entry.js +3 -3
  217. package/dist/esm/salla-scopes.entry.js +1 -1
  218. package/dist/esm/salla-search.entry.js +2 -2
  219. package/dist/esm/salla-skeleton.entry.js +1 -1
  220. package/dist/esm/salla-slider.entry.js +1 -1
  221. package/dist/esm/salla-social-share.entry.js +1 -1
  222. package/dist/esm/salla-social.entry.js +1 -1
  223. package/dist/esm/salla-tab-content_3.entry.js +1 -1
  224. package/dist/esm/salla-tiered-offer.entry.js +1 -1
  225. package/dist/esm/salla-tooltip.entry.js +1 -1
  226. package/dist/esm/salla-trust-badges.entry.js +1 -1
  227. package/dist/esm/salla-user-menu.entry.js +5 -2
  228. package/dist/esm/salla-user-profile.entry.js +1 -1
  229. package/dist/esm/salla-user-settings.entry.js +1 -1
  230. package/dist/esm/salla-verify.entry.js +1 -1
  231. package/dist/esm/salla-wallet.entry.js +1 -1
  232. package/dist/esm/salla-wishlist-actions.entry.js +1 -1
  233. package/dist/esm/{tracked-promise-CNdO8SSl.js → tracked-promise-yWzlErXb.js} +1 -1
  234. package/dist/esm/twilight.js +3 -3
  235. package/dist/esm/{vanilla-picker-YVpipuL-.js → vanilla-picker-Bwq5IBwq.js} +1 -1
  236. package/dist/twilight/{p-6976c445.entry.js → p-04612ed4.entry.js} +1 -1
  237. package/dist/twilight/{p-7ce2c5ca.entry.js → p-0be72b27.entry.js} +1 -1
  238. package/dist/twilight/{p-e692322c.entry.js → p-0f6a9e5e.entry.js} +1 -1
  239. package/dist/twilight/{p-9f6a0804.entry.js → p-12d485db.entry.js} +1 -1
  240. package/dist/twilight/{p-4b0aa371.entry.js → p-168bfefc.entry.js} +1 -1
  241. package/dist/twilight/{p-f4564fdc.entry.js → p-1695dd23.entry.js} +1 -1
  242. package/dist/twilight/p-18c99d79.entry.js +4 -0
  243. package/dist/twilight/{p-d4eeed4b.entry.js → p-1abccd80.entry.js} +1 -1
  244. package/dist/twilight/{p-fe69512c.entry.js → p-1ec309ad.entry.js} +1 -1
  245. package/dist/twilight/{p-f5e943bb.entry.js → p-2368ab21.entry.js} +1 -1
  246. package/dist/twilight/{p-b7b29da3.entry.js → p-24eb59ac.entry.js} +1 -1
  247. package/dist/twilight/{p-9b2f674f.entry.js → p-283b7a09.entry.js} +1 -1
  248. package/dist/twilight/{p-c5050e10.entry.js → p-28eea468.entry.js} +1 -1
  249. package/dist/twilight/{p-cd4b2301.entry.js → p-2ea6c5c6.entry.js} +1 -1
  250. package/dist/twilight/{p-f71a7a24.entry.js → p-30796ada.entry.js} +1 -1
  251. package/dist/twilight/{p-18ad7499.entry.js → p-327d33c2.entry.js} +1 -1
  252. package/dist/twilight/{p-0c36ee7c.entry.js → p-363417b6.entry.js} +1 -1
  253. package/dist/twilight/{p-bd0075c9.entry.js → p-387e06ce.entry.js} +1 -1
  254. package/dist/twilight/{p-67b225d5.entry.js → p-38c82b5b.entry.js} +1 -1
  255. package/dist/twilight/{p-DwHaUky6.js → p-3Yh5uCQZ.js} +1 -1
  256. package/dist/twilight/{p-02350ded.entry.js → p-3cee41e1.entry.js} +1 -1
  257. package/dist/twilight/p-3e9bba4f.entry.js +4 -0
  258. package/dist/twilight/{p-3eb54d75.entry.js → p-3f1913e0.entry.js} +1 -1
  259. package/dist/twilight/{p-a853a50f.entry.js → p-416e7ea9.entry.js} +1 -1
  260. package/dist/twilight/{p-beb2df03.entry.js → p-44819d23.entry.js} +1 -1
  261. package/dist/twilight/{p-a4107435.entry.js → p-44ed9315.entry.js} +1 -1
  262. package/dist/twilight/{p-DVM0Orh8.js → p-4Xs3NevL.js} +1 -1
  263. package/dist/twilight/{p-0e2a2a9a.entry.js → p-4bdd0eab.entry.js} +1 -1
  264. package/dist/twilight/{p-77b6fbf2.entry.js → p-4df90b34.entry.js} +1 -1
  265. package/dist/twilight/{p-ce8571e3.entry.js → p-4e16be16.entry.js} +1 -1
  266. package/dist/twilight/{p-134988db.entry.js → p-507e04b3.entry.js} +1 -1
  267. package/dist/twilight/{p-4544ca7d.entry.js → p-52df99a3.entry.js} +1 -1
  268. package/dist/twilight/{p-0fcc3b26.entry.js → p-54047fdd.entry.js} +1 -1
  269. package/dist/twilight/p-5dbdf0e7.entry.js +4 -0
  270. package/dist/twilight/{p-a7d99355.entry.js → p-5dc0f3c0.entry.js} +1 -1
  271. package/dist/twilight/{p-22405eaa.entry.js → p-5effd85b.entry.js} +2 -2
  272. package/dist/twilight/{p-8f9e0a7a.entry.js → p-62e99802.entry.js} +1 -1
  273. package/dist/twilight/{p-c590dcf0.entry.js → p-680e0dca.entry.js} +1 -1
  274. package/dist/twilight/{p-f32df318.entry.js → p-6e6f4879.entry.js} +1 -1
  275. package/dist/twilight/{p-KNG8mGcV.js → p-6iwUgroX.js} +1 -1
  276. package/dist/twilight/{p-f5e55c13.entry.js → p-72bc40b3.entry.js} +1 -1
  277. package/dist/twilight/{p-d3f904d0.entry.js → p-75345728.entry.js} +1 -1
  278. package/dist/twilight/{p-d2cc8587.entry.js → p-76f06b0a.entry.js} +1 -1
  279. package/dist/twilight/{p-43ab561c.entry.js → p-7a738892.entry.js} +1 -1
  280. package/dist/twilight/{p-e304cb5e.entry.js → p-7ab11977.entry.js} +1 -1
  281. package/dist/twilight/p-7cfe5dbf.entry.js +4 -0
  282. package/dist/twilight/{p-1d3efd00.entry.js → p-868b6dcc.entry.js} +1 -1
  283. package/dist/twilight/{p-a6afc8ab.entry.js → p-8878ec9e.entry.js} +1 -1
  284. package/dist/twilight/{p-9db7e318.entry.js → p-8a274920.entry.js} +1 -1
  285. package/dist/twilight/{p-2192d7c2.entry.js → p-8b2fb172.entry.js} +1 -1
  286. package/dist/twilight/{p-368d3b26.entry.js → p-8b45c13a.entry.js} +1 -1
  287. package/dist/twilight/{p-d1048676.entry.js → p-8ba7b32d.entry.js} +1 -1
  288. package/dist/twilight/{p-6b9780be.entry.js → p-8f204414.entry.js} +1 -1
  289. package/dist/twilight/{p-bcfe04fa.entry.js → p-906dfda7.entry.js} +1 -1
  290. package/dist/twilight/{p-4427e994.entry.js → p-90976775.entry.js} +1 -1
  291. package/dist/twilight/{p-4288893b.entry.js → p-917bae25.entry.js} +1 -1
  292. package/dist/twilight/{p-b8d180fe.entry.js → p-95c6ca83.entry.js} +1 -1
  293. package/dist/twilight/{p-b32e5ad7.entry.js → p-997a1fdf.entry.js} +1 -1
  294. package/dist/twilight/{p-dc093d27.entry.js → p-9cb07624.entry.js} +1 -1
  295. package/dist/twilight/{p-d6da8710.entry.js → p-9d51f43d.entry.js} +1 -1
  296. package/dist/twilight/{p-aa928350.entry.js → p-9dc6f28e.entry.js} +1 -1
  297. package/dist/twilight/{p-c01e3f1d.entry.js → p-9efc4b59.entry.js} +1 -1
  298. package/dist/twilight/{p-CMmiX5T8.js → p-BF7QVpUp.js} +1 -1
  299. package/dist/twilight/{p-gacShRe2.js → p-BHY6Sj5y.js} +1 -1
  300. package/dist/twilight/{p-BPGtYFVu.js → p-BZ24UYWJ.js} +1 -1
  301. package/dist/twilight/{p-BuOjsqYX.js → p-BgI56yKL.js} +1 -1
  302. package/dist/twilight/{p-CwLXCdYY.js → p-Bnnviqjp.js} +1 -1
  303. package/dist/twilight/{p-BrcsejOr.js → p-CJRTPVPy.js} +1 -1
  304. package/dist/twilight/{p-BEb9UIZ7.js → p-DTwxTvVu.js} +1 -1
  305. package/dist/twilight/{p-Bmy5YF6e.js → p-DZu6rifA.js} +1 -1
  306. package/dist/twilight/{p-BF901xIc.js → p-K0OclOPO.js} +1 -1
  307. package/dist/twilight/p-XnA1YTjA.js +4 -0
  308. package/dist/twilight/{p-1a8525af.entry.js → p-b2a12062.entry.js} +1 -1
  309. package/dist/twilight/{p-4b558e37.entry.js → p-b69cc47d.entry.js} +1 -1
  310. package/dist/twilight/{p-be632d40.entry.js → p-bb7d240f.entry.js} +1 -1
  311. package/dist/twilight/{p-5476bd33.entry.js → p-bd50d1c4.entry.js} +1 -1
  312. package/dist/twilight/{p-1c4e7c18.entry.js → p-c01100d0.entry.js} +1 -1
  313. package/dist/twilight/{p-04f5d67b.entry.js → p-c19cdf96.entry.js} +1 -1
  314. package/dist/twilight/{p-a5895e0f.entry.js → p-c1b56f08.entry.js} +1 -1
  315. package/dist/twilight/{p-2eb78125.entry.js → p-c1e7fe98.entry.js} +1 -1
  316. package/dist/twilight/{p-ce633fa0.entry.js → p-c497fa37.entry.js} +1 -1
  317. package/dist/twilight/p-c6026f2e.entry.js +4 -0
  318. package/dist/twilight/{p-4e2f144a.entry.js → p-cb475d27.entry.js} +1 -1
  319. package/dist/twilight/{p-ed1e0c2e.entry.js → p-cb9501dc.entry.js} +1 -1
  320. package/dist/twilight/{p-5c37420e.entry.js → p-ccbf4eea.entry.js} +1 -1
  321. package/dist/twilight/{p-a445225d.entry.js → p-cd11cafc.entry.js} +1 -1
  322. package/dist/twilight/{p-f3b24cce.entry.js → p-cdfe32c9.entry.js} +1 -1
  323. package/dist/twilight/{p-d92a7d91.entry.js → p-d1b3e98b.entry.js} +1 -1
  324. package/dist/twilight/{p-8f006eca.entry.js → p-d5bbdd47.entry.js} +1 -1
  325. package/dist/twilight/{p-518bab79.entry.js → p-d6ace1e8.entry.js} +1 -1
  326. package/dist/twilight/{p-85b235dc.entry.js → p-db3da75c.entry.js} +1 -1
  327. package/dist/twilight/p-df6739de.entry.js +4 -0
  328. package/dist/twilight/{p-ad5c8d34.entry.js → p-e10eed6e.entry.js} +1 -1
  329. package/dist/twilight/{p-2b58b700.entry.js → p-e30f415c.entry.js} +1 -1
  330. package/dist/twilight/{p-b2a11170.entry.js → p-e52bbc5f.entry.js} +1 -1
  331. package/dist/twilight/{p-a047ed06.entry.js → p-e9439252.entry.js} +1 -1
  332. package/dist/twilight/p-eeb0e354.entry.js +4 -0
  333. package/dist/twilight/{p-0d94f890.entry.js → p-f4b040f0.entry.js} +1 -1
  334. package/dist/twilight/{p-90c58cc5.entry.js → p-f5242092.entry.js} +1 -1
  335. package/dist/twilight/{p-506a2720.entry.js → p-f6c20f25.entry.js} +1 -1
  336. package/dist/twilight/{p-2e4fe427.entry.js → p-f97717b9.entry.js} +1 -1
  337. package/dist/twilight/{p-ce38e5a1.entry.js → p-fb9f7001.entry.js} +1 -1
  338. package/dist/twilight/{p-c92915e0.entry.js → p-fe6e676c.entry.js} +1 -1
  339. package/dist/twilight/twilight.esm.js +1 -1
  340. package/dist/types/components/salla-cart-summary-card/salla-cart-summary-card.d.ts +67 -0
  341. package/dist/types/components/salla-filters/salla-filters.d.ts +14 -0
  342. package/dist/types/components/salla-order-cancel/interfaces.d.ts +20 -0
  343. package/dist/types/components/salla-order-cancel/salla-order-cancel.d.ts +42 -0
  344. package/dist/types/components/salla-products-list/salla-products-list.d.ts +1 -0
  345. package/dist/types/components/salla-user-menu/salla-user-menu.d.ts +1 -0
  346. package/dist/types/components.d.ts +68 -0
  347. package/package.json +5 -5
  348. package/dist/twilight/p-2cc32d1f.entry.js +0 -4
  349. package/dist/twilight/p-3d732135.entry.js +0 -4
  350. package/dist/twilight/p-632766e3.entry.js +0 -4
  351. package/dist/twilight/p-C-3GuKNW.js +0 -4
  352. package/dist/twilight/p-a3a1bf15.entry.js +0 -4
  353. package/dist/twilight/p-d2cdd923.entry.js +0 -4
@@ -8,7 +8,7 @@ import { d as defineCustomElement$5 } from './salla-button2.js';
8
8
  import { d as defineCustomElement$3 } from './salla-price-range2.js';
9
9
  import { d as defineCustomElement$2 } from './salla-rating-stars2.js';
10
10
 
11
- const sallaFiltersCss = ":host{display:block}.s-rating-stars-small{line-height:12px}.s-filters-radio{background-image:none !important}";
11
+ const sallaFiltersCss = ":host{display:block}.s-rating-stars-small{line-height:12px}.s-filters-radio{background-image:none !important}.s-filters-applied-remove{pointer-events:auto !important;cursor:pointer}";
12
12
 
13
13
  const SallaFilters$1 = /*@__PURE__*/ proxyCustomElement(class SallaFilters extends HTMLElement {
14
14
  constructor() {
@@ -16,11 +16,14 @@ const SallaFilters$1 = /*@__PURE__*/ proxyCustomElement(class SallaFilters exten
16
16
  this.__registerHost();
17
17
  this.changed = createEvent(this, "changed", 7);
18
18
  this.isReady = false; //to avoid triggering the changed event
19
+ this.isInitialFetch = true; //the base-category auto-append may only run on the first filters::fetched
19
20
  this.filtersData = {};
21
+ this.appliedOpen = true;
20
22
  salla.event.on('filters::hidden', () => this.host.style.display = 'none');
21
23
  salla.lang.onLoaded(() => {
22
24
  this.apply = salla.lang.get('pages.checkout.apply');
23
25
  this.reset = salla.lang.get('pages.categories.filters_reset');
26
+ this.selectedTitle = salla.lang.getWithDefault('pages.categories.selected_filters', 'لقد اخترت');
24
27
  });
25
28
  salla.event.on('filters::fetched', ({ filters }) => {
26
29
  this.host.style.display = '';
@@ -55,7 +58,9 @@ const SallaFilters$1 = /*@__PURE__*/ proxyCustomElement(class SallaFilters exten
55
58
  break; // No need to continue checking once a match is found
56
59
  }
57
60
  }
58
- if (salla.config.get('page.slug') == "product.index" && Object.keys(freshFilterData).length == 0 && !hasFilters) {
61
+ // only on the first fetch after page load re-appending on later fetches
62
+ // would silently undo an explicit "remove all filters" (COD-10662)
63
+ if (this.isInitialFetch && salla.config.get('page.slug') == "product.index" && Object.keys(freshFilterData).length == 0 && !hasFilters) {
59
64
  // Append the current category to the url if there are no pre-selected filters
60
65
  let currentUrl = window.location.href;
61
66
  let filterValue = salla.config.get('page.id');
@@ -66,6 +71,7 @@ const SallaFilters$1 = /*@__PURE__*/ proxyCustomElement(class SallaFilters exten
66
71
  }
67
72
  return filter;
68
73
  });
74
+ this.isInitialFetch = false;
69
75
  this.filtersData = freshFilterData;
70
76
  this.host.childNodes.forEach(async (widget) => widget.setWidgetHeight && await widget.setWidgetHeight());
71
77
  });
@@ -127,9 +133,7 @@ const SallaFilters$1 = /*@__PURE__*/ proxyCustomElement(class SallaFilters exten
127
133
  const value = filters[key];
128
134
  const fullKey = parentKey ? `${parentKey}[${key}]` : key;
129
135
  if (Array.isArray(value)) {
130
- for (let i = 0; i < value.length; i++) {
131
- encodedFilters.push(`${fullKey}[${i}]=${value[i]}`);
132
- }
136
+ value.forEach(item => encodedFilters.push(`${fullKey}[]=${item}`));
133
137
  }
134
138
  else if (typeof value === 'object' && value !== null) {
135
139
  encodedFilters.push(this.encodeFilters(value, fullKey));
@@ -184,21 +188,105 @@ const SallaFilters$1 = /*@__PURE__*/ proxyCustomElement(class SallaFilters exten
184
188
  isChecked && (this.filtersData[option.key] = value);
185
189
  isChecked || (delete this.filtersData[option.key]);
186
190
  }
187
- //it's checkbox
188
- // add if condition to avoid error when the filter is not existed in the filtersData
191
+ //it's checkbox (multi-select / OR within the same group)
189
192
  else if (event.target.type == "checkbox") {
190
- this.filtersData[option.key] = this.filtersData[option.key] || [];
193
+ const current = this.filtersData[option.key];
194
+ // coerce legacy scalar values (e.g. ?filters[brand_id]=1) into an array
195
+ this.filtersData[option.key] = Array.isArray(current) ? current : (current != null ? [current] : []);
191
196
  if (isChecked) {
192
197
  this.filtersData[option.key].push(value);
193
198
  }
194
- this.filtersData[option.key] = this.filtersData[option.key].filter(val => val != value);
199
+ else {
200
+ this.filtersData[option.key] = this.filtersData[option.key].filter(val => val != value);
201
+ }
202
+ if (!this.filtersData[option.key].length) {
203
+ delete this.filtersData[option.key];
204
+ }
205
+ }
206
+ this.filtersData = { ...this.filtersData }; // reassign so @State re-renders the applied chips
207
+ this.applyFilters();
208
+ }
209
+ /**
210
+ * Flatten the selected filtersData into displayable chips, resolving the
211
+ * human label for each group + option from `this.filters`. Selections that
212
+ * can't be resolved to a known option (e.g. the auto-added base category)
213
+ * are skipped.
214
+ */
215
+ getAppliedFilters() {
216
+ const chips = [];
217
+ const data = this.filtersData || {};
218
+ for (const key of Object.keys(data)) {
219
+ if (key === 'variants') {
220
+ const variantFilter = this.filters?.find(f => f.type === FilterOptionTypes.VARIANTS);
221
+ for (const variantKey of Object.keys(data.variants || {})) {
222
+ const value = data.variants[variantKey];
223
+ const opt = variantFilter?.values?.find(o => (o.key || o.value) == value);
224
+ if (!opt)
225
+ continue;
226
+ chips.push({ key, variantKey, value, type: FilterOptionTypes.VARIANTS, groupLabel: variantFilter?.label, optionLabel: opt.value });
227
+ }
228
+ continue;
229
+ }
230
+ const group = this.filters?.find(f => f.key === key);
231
+ if (!group)
232
+ continue;
233
+ const raw = data[key];
234
+ // RANGE (e.g. price) is stored as a { min, max } object
235
+ if (group.type === FilterOptionTypes.RANGE || (raw && typeof raw === 'object' && !Array.isArray(raw))) {
236
+ chips.push({ key, value: raw, type: FilterOptionTypes.RANGE, groupLabel: group.label, optionLabel: `${raw.min} - ${raw.max}` });
237
+ continue;
238
+ }
239
+ // the auto-appended base category (see filters::fetched) is page scoping, not a user
240
+ // selection — skip it. It's stored as a scalar; user selections are always arrays.
241
+ if (key === 'category_id' && !Array.isArray(raw) && salla.config.get('page.slug') == 'product.index' && raw == salla.config.get('page.id')) {
242
+ continue;
243
+ }
244
+ const values = Array.isArray(raw) ? raw : [raw];
245
+ for (const value of values) {
246
+ // rating values are bare numbers; everything else maps key -> value label
247
+ const opt = group.values?.find(o => (typeof o === 'number' ? o : (o.key || o.value)) == value);
248
+ const optionLabel = group.key === 'rating' ? `${value}` : (opt && typeof opt !== 'number' ? opt.value : undefined);
249
+ if (optionLabel == null)
250
+ continue;
251
+ chips.push({ key, value, type: group.type, groupLabel: group.label, optionLabel });
252
+ }
253
+ }
254
+ return chips;
255
+ }
256
+ /**
257
+ * Remove a single applied filter — the direct inverse of handleOptionChange.
258
+ */
259
+ removeFilter(chip) {
260
+ if (chip.type === FilterOptionTypes.VARIANTS) {
261
+ if (this.filtersData.variants) {
262
+ delete this.filtersData.variants[chip.variantKey];
263
+ if (!Object.keys(this.filtersData.variants).length)
264
+ delete this.filtersData.variants;
265
+ }
266
+ }
267
+ else if (chip.type === FilterOptionTypes.RANGE) {
268
+ delete this.filtersData[chip.key];
269
+ }
270
+ else {
271
+ const raw = this.filtersData[chip.key];
272
+ if (Array.isArray(raw)) {
273
+ this.filtersData[chip.key] = raw.filter(val => val != chip.value);
274
+ if (!this.filtersData[chip.key].length)
275
+ delete this.filtersData[chip.key];
276
+ }
277
+ else {
278
+ delete this.filtersData[chip.key];
279
+ }
195
280
  }
281
+ this.filtersData = { ...this.filtersData }; // reassign so the panel + widgets re-render immediately
196
282
  this.applyFilters();
197
283
  }
198
284
  render() {
199
- return h(Host, { key: 'f94496fa176d99cf04b98fea8732b7c7c5912159' }, this.filters?.map(option => h("salla-filters-widget", { option: option, filtersData: this.filtersData, onChanged: ({ detail: { event, option, value } }) => {
285
+ const appliedFilters = this.getAppliedFilters();
286
+ const removeText = salla.lang.getWithDefault('common.elements.delete', 'Remove');
287
+ return h(Host, { key: 'd6dacbf458eadefda7ec2b2c6845c54f553abea8' }, appliedFilters.length ? h("div", { class: "s-filters-applied s-filters-widget-container" }, h("h3", { class: "s-filters-widget-title", onClick: () => this.appliedOpen = !this.appliedOpen }, h("span", null, this.selectedTitle), h("span", { class: `s-filters-widget-plusminus ${this.appliedOpen ? 's-filters-widget-plusminus-active' : ''}` })), h("div", { class: `s-filters-widget-content ${this.appliedOpen ? 's-filters-widget-opened' : 's-filters-widget-closed'}` }, h("div", { class: "s-filters-widget-values" }, appliedFilters.map(chip => h("div", { class: "s-filters-label s-filters-applied-item" }, h("span", { class: "s-filters-option-name" }, chip.groupLabel, ": ", chip.optionLabel), h("button", { type: "button", class: "s-filters-applied-remove", "aria-label": `${removeText} ${chip.groupLabel}: ${chip.optionLabel}`, onClick: () => this.removeFilter(chip) }, h("i", { class: "sicon-cancel", "aria-hidden": "true" }))))), h("div", { class: "s-filters-footer" }, h("salla-button", { color: 'gray', fill: 'outline', onClick: () => this.resetFilters() }, this.reset)))) : '', this.filters?.map(option => h("salla-filters-widget", { option: option, filtersData: this.filtersData, onChanged: ({ detail: { event, option, value } }) => {
200
288
  this.handleOptionChange(event, option, value);
201
- } })), this.filters?.length ? h("div", { class: "s-filters-footer" }, h("salla-button", { color: 'gray', fill: 'outline', onClick: () => this.resetFilters() }, this.reset)) : '');
289
+ } })));
202
290
  }
203
291
  componentDidLoad() {
204
292
  this.isReady = true;
@@ -211,6 +299,8 @@ const SallaFilters$1 = /*@__PURE__*/ proxyCustomElement(class SallaFilters exten
211
299
  "filtersData": [32],
212
300
  "apply": [32],
213
301
  "reset": [32],
302
+ "selectedTitle": [32],
303
+ "appliedOpen": [32],
214
304
  "getFilters": [64],
215
305
  "applyFilters": [64],
216
306
  "resetFilters": [64]
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface SallaOrderCancel extends Components.SallaOrderCancel, HTMLElement {}
4
+ export const SallaOrderCancel: {
5
+ prototype: SallaOrderCancel;
6
+ new (): SallaOrderCancel;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1,347 @@
1
+ /*!
2
+ * Crafted with ❤ by Salla
3
+ */
4
+ import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
5
+ import { d as defineCustomElement$4 } from './salla-button2.js';
6
+ import { d as defineCustomElement$3 } from './salla-loading2.js';
7
+ import { d as defineCustomElement$2 } from './salla-modal2.js';
8
+
9
+ const sallaOrderCancelCss = ".s-order-cancel-reason .s-order-cancel-radio::before,.s-order-cancel-reason .s-radio::before{content:\"\";width:10px;height:10px;border-radius:50%;transform:scale(0);transition:120ms transform ease-in-out;background-color:#fff;box-shadow:inset 1em 1em #fff}.s-order-cancel-reason .s-order-cancel-radio:checked::before,.s-order-cancel-reason .s-radio:checked::before{transform:scale(1);background-color:var(--color-primary);box-shadow:inset 1em 1em var(--color-primary)}";
10
+
11
+ const MAX_NOTE = 250;
12
+ const ORDER_WAIT_MS = 2500;
13
+ const DATE_HEADER = 'td.single-order-header-item:not(.flex)';
14
+ const CANCELLED_MARKER = '[data-salla-order-cancelled-reason]';
15
+ const CANCELLED_BY_LABELS = {
16
+ customer: 'أُلغي الطلب من قِبل العميل',
17
+ merchant: 'أُلغي الطلب من قِبل المتجر',
18
+ };
19
+ const LANG_PAIRS = [
20
+ ['pages.orders.cancel_modal_title', 'إلغاء الطلب', 'Cancel order'],
21
+ ['pages.orders.cancel_reason_title', 'لماذا ترغب في إلغاء الطلب؟', 'Why do you want to cancel this order?'],
22
+ ['pages.orders.cancel_reason_subtitle', 'ساعدنا نعرف السبب لتحسين تجربتك.', 'Help us understand why to improve your experience.'],
23
+ ['pages.orders.cancel_reason_confirm', 'تأكيد إلغاء الطلب', 'Confirm order cancellation'],
24
+ ['pages.orders.cancel_reason_back', 'تراجع', 'Go back'],
25
+ ['pages.orders.cancel_reason_note_placeholder', 'اذكر السبب', 'Mention the reason'],
26
+ ['pages.orders.cancelled_by_customer', CANCELLED_BY_LABELS.customer, 'Order cancelled by the customer'],
27
+ ['pages.orders.cancelled_by_merchant', CANCELLED_BY_LABELS.merchant, 'Order cancelled by the merchant'],
28
+ ['pages.orders.cancel_reason_char_limit', 'يتجاوز النص حد الأحرف المسموح', 'Text exceeds the allowed character limit'],
29
+ ];
30
+ const parseJson = (value) => {
31
+ if (!value)
32
+ return null;
33
+ try {
34
+ const data = typeof value === 'string' ? JSON.parse(value) : value;
35
+ return data && typeof data === 'object' ? data : null;
36
+ }
37
+ catch {
38
+ return null;
39
+ }
40
+ };
41
+ const parseCancelledReason = (raw) => {
42
+ const data = parseJson(raw);
43
+ const reasons = Array.isArray(data?.reasons)
44
+ ? data.reasons.filter((r) => typeof r === 'string' && r.length > 0)
45
+ : [];
46
+ if (!reasons.length)
47
+ return null;
48
+ return { cancelled_by: data?.cancelled_by === 'merchant' ? 'merchant' : 'customer', reasons };
49
+ };
50
+ const normalizeReasons = (reasons) => reasons.filter(r => r.is_active !== false).sort((a, b) => (a.sort ?? 0) - (b.sort ?? 0));
51
+ const parseReasonsProp = (value) => {
52
+ if (value == null || value === '')
53
+ return null;
54
+ const parsed = typeof value === 'string' ? parseJson(value) : value;
55
+ return Array.isArray(parsed) && parsed.length ? parsed : null;
56
+ };
57
+ const SallaOrderCancel$1 = /*@__PURE__*/ proxyCustomElement(class SallaOrderCancel extends HTMLElement {
58
+ constructor() {
59
+ super();
60
+ this.__registerHost();
61
+ this.reasons = [];
62
+ this.selectedReasonId = null;
63
+ this.reasonNote = '';
64
+ this.confirmLoading = false;
65
+ this.loading = true;
66
+ this.modalTitleLabel = '';
67
+ this.questionLabel = '';
68
+ this.subtitleLabel = '';
69
+ this.confirmLabel = '';
70
+ this.backLabel = '';
71
+ this.notePlaceholder = '';
72
+ this.charLimitLabel = '';
73
+ salla.lang.onLoaded(() => {
74
+ const ar = salla.lang.messages?.['ar.trans'];
75
+ const en = salla.lang.messages?.['en.trans'];
76
+ if (ar && en && salla.helpers?.setNested) {
77
+ for (const [key, arText, enText] of LANG_PAIRS) {
78
+ salla.helpers.setNested(ar, key, arText);
79
+ salla.helpers.setNested(en, key, enText);
80
+ }
81
+ }
82
+ this.refreshLabels();
83
+ });
84
+ }
85
+ onCancellationReasonsChange() {
86
+ void this.load();
87
+ }
88
+ async componentWillLoad() {
89
+ await salla.onReady();
90
+ this.refreshLabels();
91
+ await this.load();
92
+ }
93
+ refreshLabels() {
94
+ const t = (key, fb) => salla.lang.getWithDefault(key, fb);
95
+ this.modalTitleLabel = t('pages.orders.cancel_modal_title', 'إلغاء الطلب');
96
+ this.questionLabel = t('pages.orders.cancel_reason_title', 'لماذا ترغب في إلغاء الطلب؟');
97
+ this.subtitleLabel = t('pages.orders.cancel_reason_subtitle', 'ساعدنا نعرف السبب لتحسين تجربتك.');
98
+ this.confirmLabel = t('pages.orders.cancel_reason_confirm', 'تأكيد إلغاء الطلب');
99
+ this.backLabel = t('pages.orders.cancel_reason_back', 'تراجع');
100
+ this.notePlaceholder = t('pages.orders.cancel_reason_note_placeholder', 'اذكر السبب');
101
+ this.charLimitLabel = t('pages.orders.cancel_reason_char_limit', 'يتجاوز النص حد الأحرف المسموح');
102
+ }
103
+ get resolvedOrderId() {
104
+ const id = this.orderId ?? this.pageOrder?.id ?? salla.config.get('page.id');
105
+ const n = Number(id);
106
+ return Number.isFinite(n) ? n : id;
107
+ }
108
+ readPageOrder() {
109
+ const el = document.querySelector('salla-order-totals-card');
110
+ return el ? parseJson(el.order ?? el.getAttribute('order')) : null;
111
+ }
112
+ waitForPageOrder() {
113
+ const order = this.readPageOrder();
114
+ if (order)
115
+ return Promise.resolve(order);
116
+ if (typeof MutationObserver === 'undefined') {
117
+ // ponytail: jsdom has no MutationObserver; one microtask retry for spec DOM
118
+ return Promise.resolve().then(() => this.readPageOrder());
119
+ }
120
+ return new Promise(resolve => {
121
+ let settled = false;
122
+ const finish = () => {
123
+ if (settled)
124
+ return;
125
+ settled = true;
126
+ observer.disconnect();
127
+ clearTimeout(timer);
128
+ resolve(this.readPageOrder());
129
+ };
130
+ const card = document.querySelector('salla-order-totals-card');
131
+ const observer = new MutationObserver(finish);
132
+ observer.observe(card ?? document.documentElement, card
133
+ ? { attributes: true, attributeFilter: ['order'] }
134
+ : { childList: true, subtree: true, attributes: true, attributeFilter: ['order'] });
135
+ const timer = setTimeout(finish, ORDER_WAIT_MS);
136
+ });
137
+ }
138
+ cancelledByLabel(by) {
139
+ return salla.lang.getWithDefault(`pages.orders.cancelled_by_${by}`, CANCELLED_BY_LABELS[by]);
140
+ }
141
+ mountCancelledHeader(attempt = 0) {
142
+ const cancelled = this.orderCancelledReason;
143
+ const reason = cancelled?.reasons[0];
144
+ if (!reason || document.querySelector(CANCELLED_MARKER))
145
+ return;
146
+ const anchor = document.querySelector(DATE_HEADER);
147
+ if (!anchor) {
148
+ // ponytail: hook mounts before header table in single.twig; retry until anchor exists
149
+ if (attempt < 20)
150
+ requestAnimationFrame(() => this.mountCancelledHeader(attempt + 1));
151
+ return;
152
+ }
153
+ const cell = document.createElement('td');
154
+ cell.className = 's-order-cancel-cancelled-header-item';
155
+ cell.setAttribute('data-salla-order-cancelled-reason', '');
156
+ const label = document.createElement('div');
157
+ label.className = 's-order-cancel-cancelled-header-label';
158
+ label.textContent = this.cancelledByLabel(cancelled.cancelled_by);
159
+ const value = document.createElement('b');
160
+ value.className = 's-order-cancel-cancelled-header-reason';
161
+ value.textContent = reason;
162
+ value.title = reason;
163
+ cell.append(label, value);
164
+ anchor.insertAdjacentElement('afterend', cell);
165
+ }
166
+ purgeLegacyModal() {
167
+ if (!this.reasons.length)
168
+ return;
169
+ for (const el of document.querySelectorAll('salla-modal#modal-order-cancel:not([data-salla-order-cancel])')) {
170
+ el.remove();
171
+ }
172
+ }
173
+ applyPageOrder(order) {
174
+ this.pageOrder = order;
175
+ this.orderCancelledReason = parseCancelledReason(order.order_cancelled_reason) ?? undefined;
176
+ }
177
+ async load() {
178
+ this.loading = true;
179
+ try {
180
+ const fromProp = parseReasonsProp(this.cancellationReasons);
181
+ if (!this.pageOrder) {
182
+ const order = this.readPageOrder();
183
+ if (order)
184
+ this.applyPageOrder(order);
185
+ }
186
+ if (!this.pageOrder && !fromProp) {
187
+ const order = await this.waitForPageOrder();
188
+ if (order)
189
+ this.applyPageOrder(order);
190
+ }
191
+ else if (!this.pageOrder) {
192
+ void this.waitForPageOrder().then(order => {
193
+ if (order) {
194
+ this.applyPageOrder(order);
195
+ this.mountCancelledHeader();
196
+ }
197
+ });
198
+ }
199
+ const order = this.pageOrder;
200
+ this.reasons = fromProp
201
+ ? normalizeReasons(fromProp)
202
+ : order
203
+ ? normalizeReasons(Array.isArray(order.cancellation_reasons) ? order.cancellation_reasons : [])
204
+ : [];
205
+ }
206
+ finally {
207
+ this.loading = false;
208
+ this.purgeLegacyModal();
209
+ this.mountCancelledHeader();
210
+ }
211
+ }
212
+ reasonLabel(reason) {
213
+ const locale = salla.lang.getLocale?.() || 'ar';
214
+ return reason.translations?.[locale]?.name || reason.name;
215
+ }
216
+ get hasOtherSelected() {
217
+ return this.selectedReasonId !== null && this.reasons.some(r => r.id === this.selectedReasonId && r.slug === 'other');
218
+ }
219
+ get canConfirm() {
220
+ if (this.selectedReasonId === null)
221
+ return false;
222
+ if (!this.hasOtherSelected)
223
+ return true;
224
+ const len = this.reasonNote.trim().length;
225
+ return len > 0 && len <= MAX_NOTE;
226
+ }
227
+ selectReason(id) {
228
+ if (this.selectedReasonId === id) {
229
+ if (this.reasons.find(r => r.id === id)?.slug === 'other')
230
+ this.reasonNote = '';
231
+ this.selectedReasonId = null;
232
+ return;
233
+ }
234
+ if (this.reasons.find(r => r.id === this.selectedReasonId)?.slug === 'other') {
235
+ this.reasonNote = '';
236
+ }
237
+ this.selectedReasonId = id;
238
+ if (this.reasons.length && this.reasons[this.reasons.length - 1].id === id) {
239
+ const timer = setTimeout(() => {
240
+ requestAnimationFrame(() => {
241
+ document.getElementById(`s-order-cancel-reason-${id}`)?.scrollIntoView({ block: 'start', behavior: 'smooth' });
242
+ const textarea = document.querySelector('.s-order-cancel-textarea');
243
+ textarea?.focus();
244
+ clearTimeout(timer);
245
+ });
246
+ }, 200);
247
+ }
248
+ }
249
+ resetForm() {
250
+ this.selectedReasonId = null;
251
+ this.reasonNote = '';
252
+ this.confirmLoading = false;
253
+ }
254
+ setReasonNote(event) {
255
+ this.reasonNote = event.target.value;
256
+ }
257
+ onKeyActivate(event, action) {
258
+ if (event.key === 'Enter' || event.key === ' ')
259
+ action();
260
+ }
261
+ async confirmCancel() {
262
+ if (!this.canConfirm || this.confirmLoading)
263
+ return;
264
+ this.confirmLoading = true;
265
+ try {
266
+ const note = this.hasOtherSelected ? this.reasonNote.trim() : '';
267
+ const payload = {
268
+ reasons: [String(this.selectedReasonId)],
269
+ ...(note && { reason_note: note }),
270
+ };
271
+ await salla.order.api.cancel(this.resolvedOrderId, payload);
272
+ window.location.reload();
273
+ }
274
+ catch {
275
+ this.confirmLoading = false;
276
+ }
277
+ }
278
+ render() {
279
+ if (this.loading || !this.reasons.length)
280
+ return h(Host, { class: "s-order-cancel-wrapper" });
281
+ return (h(Host, { class: "s-order-cancel-wrapper" }, h("salla-modal", { id: "modal-order-cancel", class: "s-order-cancel-modal", "data-salla-order-cancel": "", ref: el => {
282
+ this.modal = el;
283
+ void el?.setTitle?.(this.modalTitleLabel);
284
+ }, width: "sm", onModalVisibilityChanged: e => !e.detail && this.resetForm() }, h("div", { class: "s-order-cancel-content" }, h("div", { class: "s-order-cancel-intro" }, h("p", { class: "s-order-cancel-heading" }, this.questionLabel), h("p", { class: "s-order-cancel-subtitle" }, this.subtitleLabel)), h("div", { class: "s-order-cancel-reasons s-scrollbar" }, this.reasons.map(reason => {
285
+ const id = `s-order-cancel-reason-${reason.id}`;
286
+ return (h("label", { key: reason.id, class: "s-order-cancel-reason", htmlFor: id }, h("input", { type: "radio", name: "cancellation_reason", id: id, class: "s-order-cancel-radio s-radio", checked: this.selectedReasonId === reason.id, onChange: () => this.selectReason(reason.id) }), h("span", { class: "s-order-cancel-reason-label" }, this.reasonLabel(reason))));
287
+ })), this.hasOtherSelected && (h("div", { class: "s-order-cancel-other-field" }, h("textarea", { class: "s-order-cancel-textarea", placeholder: this.notePlaceholder, value: this.reasonNote, onInput: e => this.setReasonNote(e) }), h("p", { class: {
288
+ 's-order-cancel-counter': true,
289
+ 's-order-cancel-counter--limit': this.reasonNote.length >= MAX_NOTE,
290
+ } }, this.reasonNote.length >= MAX_NOTE && `${this.charLimitLabel} `, MAX_NOTE, "/", this.reasonNote.length))), h("div", { class: "s-order-cancel-actions" }, h("salla-button", { color: "primary", class: "w-full", width: "wide", disabled: !this.canConfirm, loading: this.confirmLoading, onClick: () => this.confirmCancel(), onKeyDown: e => this.onKeyActivate(e, () => this.confirmCancel()) }, this.confirmLabel), h("salla-button", { class: "w-full", width: "wide", fill: "outline", color: "gray", onClick: () => this.modal?.close(), onKeyDown: e => this.onKeyActivate(e, () => this.modal?.close()) }, this.backLabel))))));
291
+ }
292
+ static get watchers() { return {
293
+ "cancellationReasons": ["onCancellationReasonsChange"]
294
+ }; }
295
+ static get style() { return sallaOrderCancelCss; }
296
+ }, [0, "salla-order-cancel", {
297
+ "orderId": [8, "order-id"],
298
+ "cancellationReasons": [1, "cancellation-reasons"],
299
+ "reasons": [32],
300
+ "selectedReasonId": [32],
301
+ "reasonNote": [32],
302
+ "confirmLoading": [32],
303
+ "loading": [32],
304
+ "modalTitleLabel": [32],
305
+ "questionLabel": [32],
306
+ "subtitleLabel": [32],
307
+ "confirmLabel": [32],
308
+ "backLabel": [32],
309
+ "notePlaceholder": [32],
310
+ "charLimitLabel": [32]
311
+ }, undefined, {
312
+ "cancellationReasons": ["onCancellationReasonsChange"]
313
+ }]);
314
+ function defineCustomElement$1() {
315
+ if (typeof customElements === "undefined") {
316
+ return;
317
+ }
318
+ const components = ["salla-order-cancel", "salla-button", "salla-loading", "salla-modal"];
319
+ components.forEach(tagName => { switch (tagName) {
320
+ case "salla-order-cancel":
321
+ if (!customElements.get(tagName)) {
322
+ customElements.define(tagName, SallaOrderCancel$1);
323
+ }
324
+ break;
325
+ case "salla-button":
326
+ if (!customElements.get(tagName)) {
327
+ defineCustomElement$4();
328
+ }
329
+ break;
330
+ case "salla-loading":
331
+ if (!customElements.get(tagName)) {
332
+ defineCustomElement$3();
333
+ }
334
+ break;
335
+ case "salla-modal":
336
+ if (!customElements.get(tagName)) {
337
+ defineCustomElement$2();
338
+ }
339
+ break;
340
+ } });
341
+ }
342
+ defineCustomElement$1();
343
+
344
+ const SallaOrderCancel = SallaOrderCancel$1;
345
+ const defineCustomElement = defineCustomElement$1;
346
+
347
+ export { SallaOrderCancel, defineCustomElement };
@@ -141,10 +141,11 @@ const SallaProductsList = /*@__PURE__*/ proxyCustomElement(class SallaProductsLi
141
141
  window.scrollTo({ top: 0, behavior: 'smooth' });
142
142
  // Create a deep copy of the filters object to avoid mutating the original object
143
143
  this.parsedFilters = JSON.parse(JSON.stringify(filters));
144
- if (this.currentPage?.slug == 'product.index' &&
145
- this.parsedFilters &&
146
- this.parsedFilters.category_id) {
147
- this.currentCategoryIdFilter = [this.parsedFilters.category_id];
144
+ if (this.currentPage?.slug == 'product.index') {
145
+ // clear when category_id disappears, otherwise getSourceValue() keeps filtering by the removed category
146
+ this.currentCategoryIdFilter = this.parsedFilters?.category_id
147
+ ? this.toCategoryIdFilter(this.parsedFilters.category_id)
148
+ : null;
148
149
  }
149
150
  return this.reload();
150
151
  }
@@ -607,6 +608,14 @@ const SallaProductsList = /*@__PURE__*/ proxyCustomElement(class SallaProductsLi
607
608
  isAuxiliaryProductsListSource() {
608
609
  return ['json', 'selected', 'related', 'landing-page', 'recently'].includes(this.getSource());
609
610
  }
611
+ // Normalize a category_id filter (array, legacy {0:,1:} object, or scalar) into a flat list of ids
612
+ toCategoryIdFilter(catId) {
613
+ if (Array.isArray(catId))
614
+ return catId;
615
+ if (catId && typeof catId === 'object')
616
+ return Object.values(catId);
617
+ return [catId];
618
+ }
610
619
  getSourceValue() {
611
620
  if (this.getSource() === 'wishlist') {
612
621
  const searchParams = new URLSearchParams(window.location.search);
@@ -911,7 +920,7 @@ const SallaProductsList = /*@__PURE__*/ proxyCustomElement(class SallaProductsLi
911
920
  this.sortBy = this.sortBy || searchParams.get('sort') || searchParams.get('by');
912
921
  this.parsedFilters = Helper.extractFiltersFromUrl(searchParams);
913
922
  if (this.parsedFilters && this.parsedFilters.category_id) {
914
- this.currentCategoryIdFilter = [this.parsedFilters.category_id];
923
+ this.currentCategoryIdFilter = this.toCategoryIdFilter(this.parsedFilters.category_id);
915
924
  }
916
925
  }
917
926
  catch (e) {
@@ -1032,12 +1041,15 @@ const SallaProductsList = /*@__PURE__*/ proxyCustomElement(class SallaProductsLi
1032
1041
  title = salla.lang.get('common.elements.search_about', { word: this.getSourceValue() });
1033
1042
  }
1034
1043
  else if (!title) {
1035
- let catId = this.parsedFilters.category_id || this.getSourceValue()[0];
1044
+ // with user-applied filters a category name in the title is misleading — show count only;
1045
+ // the unfiltered base state keeps the page category's name
1046
+ let catId = Object.keys(this.parsedFilters || {}).length ? null : this.getSourceValue()[0];
1036
1047
  // get the first filter that its key is category_id, then get the value when filter.value.*.key==catId
1037
1048
  title =
1038
1049
  response.filters
1039
1050
  ?.find(filter => filter.key === 'category_id')
1040
- ?.values?.find(cat => cat.key === catId)?.value ?? '';
1051
+ // loose == : catId may be a number (auto-appended page.id) while API keys are strings
1052
+ ?.values?.find(cat => cat.key == catId)?.value ?? '';
1041
1053
  }
1042
1054
  title +=
1043
1055
  (title ? ' - ' : '') +
@@ -101,6 +101,8 @@ const SallaUserMenu$1 = /*@__PURE__*/ proxyCustomElement(class SallaUserMenu ext
101
101
  this.opened = false;
102
102
  };
103
103
  this.OrderUpdate = 0;
104
+ // STD-13103: these pages moved under /account; link directly to avoid 301 redirects.
105
+ this.accountPrefixedKeys = ['orders', 'pending_orders', 'wallet', 'notifications', 'rating', 'profile', 'wishlist', 'settings'];
104
106
  this.items = {
105
107
  notifications: BellRing,
106
108
  orders: OrderIcon,
@@ -243,7 +245,8 @@ const SallaUserMenu$1 = /*@__PURE__*/ proxyCustomElement(class SallaUserMenu ext
243
245
  return { href: this.profileUrl, target: '_blank', rel: 'noopener noreferrer' };
244
246
  }
245
247
  const urlKey = itemKey === 'loyalty_points' ? 'loyalty' : itemKey;
246
- return { href: Salla.url.get(urlKey) };
248
+ const path = this.accountPrefixedKeys.includes(urlKey) ? `account/${urlKey}` : urlKey;
249
+ return { href: Salla.url.get(path) };
247
250
  }
248
251
  getMenuItem([itemKey, itemValue], i) {
249
252
  //todo:: enhancement support slot here
@@ -114,8 +114,13 @@ class Helper {
114
114
  if (matchesNested) {
115
115
  const filterName = matchesNested[1];
116
116
  const nestedKey = matchesNested[3];
117
- if (nestedKey) {
118
- // Handle nested object
117
+ if (nestedKey === '' || /^\d+$/.test(nestedKey)) {
118
+ // Handle array (OR within a group), e.g. filters[brand_id][] or filters[brand_id][0]
119
+ filters[filterName] = Array.isArray(filters[filterName]) ? filters[filterName] : [];
120
+ filters[filterName].push(value);
121
+ }
122
+ else if (nestedKey) {
123
+ // Handle nested object, e.g. filters[price][min]
119
124
  filters[filterName] = filters[filterName] || {};
120
125
  filters[filterName][nestedKey] = value;
121
126
  }
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { d as getDefaultExportFromCjs } from './index-BF901xIc.js';
4
+ import { d as getDefaultExportFromCjs } from './index-K0OclOPO.js';
5
5
 
6
6
  function _mergeNamespaces(n, m) {
7
7
  m.forEach(function (e) {
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { d as getDefaultExportFromCjs } from './index-BF901xIc.js';
4
+ import { d as getDefaultExportFromCjs } from './index-K0OclOPO.js';
5
5
 
6
6
  function _mergeNamespaces(n, m) {
7
7
  m.forEach(function (e) {
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { d as getDefaultExportFromCjs } from './index-BF901xIc.js';
4
+ import { d as getDefaultExportFromCjs } from './index-K0OclOPO.js';
5
5
 
6
6
  function _mergeNamespaces(n, m) {
7
7
  m.forEach(function (e) {