@salla.sa/twilight-components 3.0.29 → 3.0.31

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 (366) hide show
  1. package/dist/cjs/{Helper-DU3zZ7Qr.js → Helper-BhBYMWEC.js} +1 -1
  2. package/dist/cjs/coupons-request-CF_Z3OPL.js +57 -0
  3. package/dist/cjs/{filepond-Bq-ERE2c.js → filepond-U_cpW5LY.js} +1 -1
  4. package/dist/cjs/{filepond-plugin-file-poster-C2ltYy9Z.js → filepond-plugin-file-poster-j3A0G9wx.js} +1 -1
  5. package/dist/cjs/{filepond-plugin-file-validate-size-BygSYF-k.js → filepond-plugin-file-validate-size-p1uylMZh.js} +1 -1
  6. package/dist/cjs/{filepond-plugin-file-validate-type-B_PLqGws.js → filepond-plugin-file-validate-type-Dw8lGbpV.js} +1 -1
  7. package/dist/cjs/{filepond-plugin-image-edit-BQ1nPI5z.js → filepond-plugin-image-edit-dT6Tl8ni.js} +1 -1
  8. package/dist/cjs/{filepond-plugin-image-exif-orientation-BQbCEIyF.js → filepond-plugin-image-exif-orientation-_4wurzkP.js} +1 -1
  9. package/dist/cjs/{filepond-plugin-image-preview-7RqoxYqp.js → filepond-plugin-image-preview-DxF89SF4.js} +1 -1
  10. package/dist/cjs/{index-CMIQ0eTF.js → index-DHGhTYkj.js} +6 -6
  11. package/dist/cjs/{intlTelInput-BqtVcUx9.js → intlTelInput-DKoKXEG1.js} +1 -1
  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 +2 -2
  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-applied-filters.cjs.entry.js +2 -2
  20. package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
  21. package/dist/cjs/salla-attachment-view_9.cjs.entry.js +11 -11
  22. package/dist/cjs/salla-badge.cjs.entry.js +1 -1
  23. package/dist/cjs/salla-basket-gap.cjs.entry.js +1 -1
  24. package/dist/cjs/salla-bullet-delivery_3.cjs.entry.js +1 -1
  25. package/dist/cjs/salla-cart-coupons.cjs.entry.js +12 -50
  26. package/dist/cjs/salla-cart-item-offers_2.cjs.entry.js +1 -1
  27. package/dist/cjs/salla-cart-summary-card.cjs.entry.js +1 -1
  28. package/dist/cjs/salla-cashback-banner.cjs.entry.js +1 -1
  29. package/dist/cjs/salla-comment-factors.cjs.entry.js +1 -1
  30. package/dist/cjs/salla-comment-form_9.cjs.entry.js +2 -2
  31. package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
  32. package/dist/cjs/salla-contacts.cjs.entry.js +1 -1
  33. package/dist/cjs/salla-cookies-bar.cjs.entry.js +1 -1
  34. package/dist/cjs/salla-count-down.cjs.entry.js +1 -1
  35. package/dist/cjs/salla-custom-fields.cjs.entry.js +1 -1
  36. package/dist/cjs/salla-delivery-promise.cjs.entry.js +1 -1
  37. package/dist/cjs/salla-edit-order-button.cjs.entry.js +1 -1
  38. package/dist/cjs/salla-filters-widget.cjs.entry.js +2 -2
  39. package/dist/cjs/salla-filters.cjs.entry.js +2 -2
  40. package/dist/cjs/salla-free-shipping-banner.cjs.entry.js +1 -1
  41. package/dist/cjs/salla-free-shipping-tag.cjs.entry.js +1 -1
  42. package/dist/cjs/salla-fulfillment-methods.cjs.entry.js +1 -1
  43. package/dist/cjs/salla-gift-card-redeem_2.cjs.entry.js +1 -1
  44. package/dist/cjs/salla-gifting.cjs.entry.js +1 -1
  45. package/dist/cjs/salla-hook.cjs.entry.js +1 -1
  46. package/dist/cjs/salla-infinite-scroll.cjs.entry.js +2 -2
  47. package/dist/cjs/salla-installment.cjs.entry.js +1 -1
  48. package/dist/cjs/salla-list-tile.cjs.entry.js +1 -1
  49. package/dist/cjs/salla-localization-modal.cjs.entry.js +1 -1
  50. package/dist/cjs/salla-login-modal.cjs.entry.js +1 -1
  51. package/dist/cjs/salla-loyalty-banner_10.cjs.entry.js +1 -1
  52. package/dist/cjs/salla-loyalty-exchange-product-card.cjs.entry.js +1 -1
  53. package/dist/cjs/salla-loyalty-points-banner.cjs.entry.js +1 -1
  54. package/dist/cjs/salla-loyalty-points-history.cjs.entry.js +1 -1
  55. package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
  56. package/dist/cjs/salla-loyalty.cjs.entry.js +1 -1
  57. package/dist/cjs/salla-maintenance-alert.cjs.entry.js +1 -1
  58. package/dist/cjs/salla-map_3.cjs.entry.js +1 -1
  59. package/dist/cjs/salla-menu.cjs.entry.js +1 -1
  60. package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
  61. package/dist/cjs/salla-mobile-update-modal.cjs.entry.js +1 -1
  62. package/dist/cjs/salla-multiple-bundle-product-cart_2.cjs.entry.js +1 -1
  63. package/dist/cjs/salla-multiple-bundle-product-options-modal_2.cjs.entry.js +1 -1
  64. package/dist/cjs/salla-multiple-bundle-product.cjs.entry.js +1 -1
  65. package/dist/cjs/salla-next-order-coupon.cjs.entry.js +9 -2
  66. package/dist/cjs/salla-notification-item_2.cjs.entry.js +2 -2
  67. package/dist/cjs/salla-offer-modal.cjs.entry.js +1 -1
  68. package/dist/cjs/salla-offer.cjs.entry.js +1 -1
  69. package/dist/cjs/salla-order-branch.cjs.entry.js +1 -1
  70. package/dist/cjs/salla-order-cancel.cjs.entry.js +1 -1
  71. package/dist/cjs/salla-order-details-multiple-bundle-product.cjs.entry.js +1 -1
  72. package/dist/cjs/salla-order-details-options.cjs.entry.js +1 -1
  73. package/dist/cjs/salla-order-details.cjs.entry.js +1 -1
  74. package/dist/cjs/salla-order-edit-item.cjs.entry.js +1 -1
  75. package/dist/cjs/salla-order-edit-product-card.cjs.entry.js +1 -1
  76. package/dist/cjs/salla-order-edit.cjs.entry.js +1 -1
  77. package/dist/cjs/salla-order-items.cjs.entry.js +1 -1
  78. package/dist/cjs/salla-order-options-modal.cjs.entry.js +1 -1
  79. package/dist/cjs/salla-order-payment.cjs.entry.js +1 -1
  80. package/dist/cjs/salla-order-rewards.cjs.entry.js +1 -1
  81. package/dist/cjs/salla-order-shipments.cjs.entry.js +1 -1
  82. package/dist/cjs/salla-order-summary.cjs.entry.js +1 -1
  83. package/dist/cjs/salla-order-totals-card.cjs.entry.js +1 -1
  84. package/dist/cjs/salla-orders.cjs.entry.js +2 -2
  85. package/dist/cjs/salla-payments.cjs.entry.js +1 -1
  86. package/dist/cjs/salla-placeholder.cjs.entry.js +1 -1
  87. package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
  88. package/dist/cjs/salla-product-card-embed.cjs.entry.js +1 -1
  89. package/dist/cjs/salla-product-card.cjs.entry.js +1 -1
  90. package/dist/cjs/salla-product-size-guide.cjs.entry.js +1 -1
  91. package/dist/cjs/salla-products-list.cjs.entry.js +2 -2
  92. package/dist/cjs/salla-products-slider.cjs.entry.js +2 -2
  93. package/dist/cjs/salla-quick-order.cjs.entry.js +1 -1
  94. package/dist/cjs/salla-rating-modal-v2.cjs.entry.js +2 -2
  95. package/dist/cjs/salla-rating-modal.cjs.entry.js +2 -2
  96. package/dist/cjs/salla-review-factors-tags.cjs.entry.js +1 -1
  97. package/dist/cjs/salla-review-order-item.cjs.entry.js +1 -1
  98. package/dist/cjs/salla-scopes.cjs.entry.js +1 -1
  99. package/dist/cjs/salla-search-product-card.cjs.entry.js +1 -1
  100. package/dist/cjs/salla-search.cjs.entry.js +2 -2
  101. package/dist/cjs/salla-skeleton.cjs.entry.js +1 -1
  102. package/dist/cjs/salla-social-share.cjs.entry.js +1 -1
  103. package/dist/cjs/salla-social.cjs.entry.js +1 -1
  104. package/dist/cjs/salla-tab-content_3.cjs.entry.js +1 -1
  105. package/dist/cjs/salla-thank-you-header.cjs.entry.js +1 -1
  106. package/dist/cjs/salla-thank-you-page.cjs.entry.js +1 -1
  107. package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
  108. package/dist/cjs/salla-trust-badges.cjs.entry.js +1 -1
  109. package/dist/cjs/salla-user-menu.cjs.entry.js +2 -2
  110. package/dist/cjs/salla-user-profile.cjs.entry.js +1 -1
  111. package/dist/cjs/salla-user-settings.cjs.entry.js +1 -1
  112. package/dist/cjs/salla-verify.cjs.entry.js +1 -1
  113. package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
  114. package/dist/cjs/salla-wishlist-actions.cjs.entry.js +1 -1
  115. package/dist/cjs/salla-wishlist-summary.cjs.entry.js +2 -2
  116. package/dist/cjs/twilight.cjs.js +2 -2
  117. package/dist/cjs/{vanilla-picker-BzjfVl8l.js → vanilla-picker-Cr_cWLy_.js} +1 -1
  118. package/dist/collection/components/salla-cart-coupons/salla-cart-coupons.js +10 -4
  119. package/dist/collection/components/salla-next-order-coupon/salla-next-order-coupon.css +3 -0
  120. package/dist/collection/components/salla-next-order-coupon/salla-next-order-coupon.js +7 -0
  121. package/dist/collection/components/salla-user-menu/salla-user-menu.css +2 -0
  122. package/dist/collection/shared/coupons-request.js +5 -0
  123. package/dist/components/coupons-request.js +54 -0
  124. package/dist/components/index.js +2 -2
  125. package/dist/components/salla-cart-coupons.js +10 -48
  126. package/dist/components/salla-next-order-coupon.js +8 -1
  127. package/dist/components/salla-user-menu.js +1 -1
  128. package/dist/docs.json +1 -1
  129. package/dist/esm/{Helper-c5Qfk37-.js → Helper-Cs3rNokA.js} +1 -1
  130. package/dist/esm/coupons-request-Cx3AzTeQ.js +54 -0
  131. package/dist/esm/{filepond-DT0RKUzJ.js → filepond-BZyp1-48.js} +1 -1
  132. package/dist/esm/{filepond-plugin-file-poster-BGfksGup.js → filepond-plugin-file-poster-CoMNDYop.js} +1 -1
  133. package/dist/esm/{filepond-plugin-file-validate-size-CUfbYnkC.js → filepond-plugin-file-validate-size-debOeTrR.js} +1 -1
  134. package/dist/esm/{filepond-plugin-file-validate-type-hMjZ-CIS.js → filepond-plugin-file-validate-type-dSGCeVlZ.js} +1 -1
  135. package/dist/esm/{filepond-plugin-image-edit-BHXzx8Yi.js → filepond-plugin-image-edit-CsBgEE7e.js} +1 -1
  136. package/dist/esm/{filepond-plugin-image-exif-orientation-j7eYGuBq.js → filepond-plugin-image-exif-orientation-OC83qIAb.js} +1 -1
  137. package/dist/esm/{filepond-plugin-image-preview-C-VIKNS5.js → filepond-plugin-image-preview-Cmp7AK_B.js} +1 -1
  138. package/dist/esm/{index-3xfbOSPM.js → index-lS_doykN.js} +6 -6
  139. package/dist/esm/{intlTelInput-B1Oa-VLs.js → intlTelInput-BrPGHjwa.js} +1 -1
  140. package/dist/esm/loader.js +3 -3
  141. package/dist/esm/salla-accordion-body_2.entry.js +1 -1
  142. package/dist/esm/salla-accordion_6.entry.js +2 -2
  143. package/dist/esm/salla-add-product-button_5.entry.js +2 -2
  144. package/dist/esm/salla-advertisement.entry.js +1 -1
  145. package/dist/esm/salla-alert_2.entry.js +1 -1
  146. package/dist/esm/salla-app-install-alert.entry.js +1 -1
  147. package/dist/esm/salla-applied-filters.entry.js +2 -2
  148. package/dist/esm/salla-apps-icons.entry.js +1 -1
  149. package/dist/esm/salla-attachment-view_9.entry.js +11 -11
  150. package/dist/esm/salla-badge.entry.js +1 -1
  151. package/dist/esm/salla-basket-gap.entry.js +1 -1
  152. package/dist/esm/salla-bullet-delivery_3.entry.js +1 -1
  153. package/dist/esm/salla-cart-coupons.entry.js +11 -49
  154. package/dist/esm/salla-cart-item-offers_2.entry.js +1 -1
  155. package/dist/esm/salla-cart-summary-card.entry.js +1 -1
  156. package/dist/esm/salla-cashback-banner.entry.js +1 -1
  157. package/dist/esm/salla-comment-factors.entry.js +1 -1
  158. package/dist/esm/salla-comment-form_9.entry.js +2 -2
  159. package/dist/esm/salla-conditional-offer.entry.js +1 -1
  160. package/dist/esm/salla-contacts.entry.js +1 -1
  161. package/dist/esm/salla-cookies-bar.entry.js +1 -1
  162. package/dist/esm/salla-count-down.entry.js +1 -1
  163. package/dist/esm/salla-custom-fields.entry.js +1 -1
  164. package/dist/esm/salla-delivery-promise.entry.js +1 -1
  165. package/dist/esm/salla-edit-order-button.entry.js +1 -1
  166. package/dist/esm/salla-filters-widget.entry.js +2 -2
  167. package/dist/esm/salla-filters.entry.js +2 -2
  168. package/dist/esm/salla-free-shipping-banner.entry.js +1 -1
  169. package/dist/esm/salla-free-shipping-tag.entry.js +1 -1
  170. package/dist/esm/salla-fulfillment-methods.entry.js +1 -1
  171. package/dist/esm/salla-gift-card-redeem_2.entry.js +1 -1
  172. package/dist/esm/salla-gifting.entry.js +1 -1
  173. package/dist/esm/salla-hook.entry.js +1 -1
  174. package/dist/esm/salla-infinite-scroll.entry.js +2 -2
  175. package/dist/esm/salla-installment.entry.js +1 -1
  176. package/dist/esm/salla-list-tile.entry.js +1 -1
  177. package/dist/esm/salla-localization-modal.entry.js +1 -1
  178. package/dist/esm/salla-login-modal.entry.js +1 -1
  179. package/dist/esm/salla-loyalty-banner_10.entry.js +1 -1
  180. package/dist/esm/salla-loyalty-exchange-product-card.entry.js +1 -1
  181. package/dist/esm/salla-loyalty-points-banner.entry.js +1 -1
  182. package/dist/esm/salla-loyalty-points-history.entry.js +1 -1
  183. package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
  184. package/dist/esm/salla-loyalty.entry.js +1 -1
  185. package/dist/esm/salla-maintenance-alert.entry.js +1 -1
  186. package/dist/esm/salla-map_3.entry.js +1 -1
  187. package/dist/esm/salla-menu.entry.js +1 -1
  188. package/dist/esm/salla-metadata.entry.js +1 -1
  189. package/dist/esm/salla-mobile-update-modal.entry.js +1 -1
  190. package/dist/esm/salla-multiple-bundle-product-cart_2.entry.js +1 -1
  191. package/dist/esm/salla-multiple-bundle-product-options-modal_2.entry.js +1 -1
  192. package/dist/esm/salla-multiple-bundle-product.entry.js +1 -1
  193. package/dist/esm/salla-next-order-coupon.entry.js +9 -2
  194. package/dist/esm/salla-notification-item_2.entry.js +2 -2
  195. package/dist/esm/salla-offer-modal.entry.js +1 -1
  196. package/dist/esm/salla-offer.entry.js +1 -1
  197. package/dist/esm/salla-order-branch.entry.js +1 -1
  198. package/dist/esm/salla-order-cancel.entry.js +1 -1
  199. package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +1 -1
  200. package/dist/esm/salla-order-details-options.entry.js +1 -1
  201. package/dist/esm/salla-order-details.entry.js +1 -1
  202. package/dist/esm/salla-order-edit-item.entry.js +1 -1
  203. package/dist/esm/salla-order-edit-product-card.entry.js +1 -1
  204. package/dist/esm/salla-order-edit.entry.js +1 -1
  205. package/dist/esm/salla-order-items.entry.js +1 -1
  206. package/dist/esm/salla-order-options-modal.entry.js +1 -1
  207. package/dist/esm/salla-order-payment.entry.js +1 -1
  208. package/dist/esm/salla-order-rewards.entry.js +1 -1
  209. package/dist/esm/salla-order-shipments.entry.js +1 -1
  210. package/dist/esm/salla-order-summary.entry.js +1 -1
  211. package/dist/esm/salla-order-totals-card.entry.js +1 -1
  212. package/dist/esm/salla-orders.entry.js +2 -2
  213. package/dist/esm/salla-payments.entry.js +1 -1
  214. package/dist/esm/salla-placeholder.entry.js +1 -1
  215. package/dist/esm/salla-price-range.entry.js +1 -1
  216. package/dist/esm/salla-product-card-embed.entry.js +1 -1
  217. package/dist/esm/salla-product-card.entry.js +1 -1
  218. package/dist/esm/salla-product-size-guide.entry.js +1 -1
  219. package/dist/esm/salla-products-list.entry.js +2 -2
  220. package/dist/esm/salla-products-slider.entry.js +2 -2
  221. package/dist/esm/salla-quick-order.entry.js +1 -1
  222. package/dist/esm/salla-rating-modal-v2.entry.js +2 -2
  223. package/dist/esm/salla-rating-modal.entry.js +2 -2
  224. package/dist/esm/salla-review-factors-tags.entry.js +1 -1
  225. package/dist/esm/salla-review-order-item.entry.js +1 -1
  226. package/dist/esm/salla-scopes.entry.js +1 -1
  227. package/dist/esm/salla-search-product-card.entry.js +1 -1
  228. package/dist/esm/salla-search.entry.js +2 -2
  229. package/dist/esm/salla-skeleton.entry.js +1 -1
  230. package/dist/esm/salla-social-share.entry.js +1 -1
  231. package/dist/esm/salla-social.entry.js +1 -1
  232. package/dist/esm/salla-tab-content_3.entry.js +1 -1
  233. package/dist/esm/salla-thank-you-header.entry.js +1 -1
  234. package/dist/esm/salla-thank-you-page.entry.js +1 -1
  235. package/dist/esm/salla-tiered-offer.entry.js +1 -1
  236. package/dist/esm/salla-trust-badges.entry.js +1 -1
  237. package/dist/esm/salla-user-menu.entry.js +2 -2
  238. package/dist/esm/salla-user-profile.entry.js +1 -1
  239. package/dist/esm/salla-user-settings.entry.js +1 -1
  240. package/dist/esm/salla-verify.entry.js +1 -1
  241. package/dist/esm/salla-wallet.entry.js +1 -1
  242. package/dist/esm/salla-wishlist-actions.entry.js +1 -1
  243. package/dist/esm/salla-wishlist-summary.entry.js +2 -2
  244. package/dist/esm/twilight.js +3 -3
  245. package/dist/esm/{vanilla-picker-B9hxPiDz.js → vanilla-picker-BIJ7ohOS.js} +1 -1
  246. package/dist/twilight/{p-893647e1.entry.js → p-000146e8.entry.js} +1 -1
  247. package/dist/twilight/{p-3217b9e3.entry.js → p-01b91d24.entry.js} +1 -1
  248. package/dist/twilight/{p-ecca6d32.entry.js → p-026e0af4.entry.js} +1 -1
  249. package/dist/twilight/{p-0a6bd345.entry.js → p-052cb03f.entry.js} +1 -1
  250. package/dist/twilight/{p-bb8136a5.entry.js → p-05df663b.entry.js} +1 -1
  251. package/dist/twilight/{p-18100032.entry.js → p-064a9bec.entry.js} +1 -1
  252. package/dist/twilight/{p-c4448d6e.entry.js → p-07f5a27d.entry.js} +1 -1
  253. package/dist/twilight/p-088cef29.entry.js +4 -0
  254. package/dist/twilight/{p-81539aff.entry.js → p-0933a118.entry.js} +1 -1
  255. package/dist/twilight/{p-bccd3e98.entry.js → p-0c32297c.entry.js} +1 -1
  256. package/dist/twilight/{p-b518cbbf.entry.js → p-0fd67b7d.entry.js} +1 -1
  257. package/dist/twilight/{p-c4269a1f.entry.js → p-1434b948.entry.js} +1 -1
  258. package/dist/twilight/{p-490d9f92.entry.js → p-16d7cc24.entry.js} +1 -1
  259. package/dist/twilight/{p-83966fd1.entry.js → p-18396456.entry.js} +1 -1
  260. package/dist/twilight/{p-2be46680.entry.js → p-187b5e74.entry.js} +1 -1
  261. package/dist/twilight/{p-06567c16.entry.js → p-18f125a3.entry.js} +1 -1
  262. package/dist/twilight/{p-4782dd95.entry.js → p-2168a1b7.entry.js} +1 -1
  263. package/dist/twilight/{p-1584c95b.entry.js → p-2283318c.entry.js} +1 -1
  264. package/dist/twilight/{p-beebb445.entry.js → p-24892bb6.entry.js} +1 -1
  265. package/dist/twilight/{p-b7e434d7.entry.js → p-2b04fdb5.entry.js} +1 -1
  266. package/dist/twilight/{p-47b37e82.entry.js → p-2e45388e.entry.js} +1 -1
  267. package/dist/twilight/{p-7b1cb749.entry.js → p-2ff50fed.entry.js} +1 -1
  268. package/dist/twilight/{p-01c524f9.entry.js → p-309fdf0f.entry.js} +1 -1
  269. package/dist/twilight/{p-5444b1e6.entry.js → p-333acffb.entry.js} +1 -1
  270. package/dist/twilight/{p-f6222191.entry.js → p-381d28e0.entry.js} +1 -1
  271. package/dist/twilight/{p-87a6ad96.entry.js → p-3a777816.entry.js} +1 -1
  272. package/dist/twilight/{p-9602dcf1.entry.js → p-3caa9c5b.entry.js} +1 -1
  273. package/dist/twilight/{p-524c27dc.entry.js → p-3d725a11.entry.js} +1 -1
  274. package/dist/twilight/{p-ae48dabb.entry.js → p-3e59be9a.entry.js} +1 -1
  275. package/dist/twilight/{p-52472275.entry.js → p-4003f28e.entry.js} +1 -1
  276. package/dist/twilight/{p-67961628.entry.js → p-440f3f56.entry.js} +1 -1
  277. package/dist/twilight/{p-d34236d4.entry.js → p-445ffaa3.entry.js} +1 -1
  278. package/dist/twilight/{p-253751b1.entry.js → p-466e81c2.entry.js} +1 -1
  279. package/dist/twilight/{p-d569a30f.entry.js → p-4b482fa1.entry.js} +1 -1
  280. package/dist/twilight/{p-83a1890b.entry.js → p-4c82eafa.entry.js} +1 -1
  281. package/dist/twilight/p-4da393db.entry.js +4 -0
  282. package/dist/twilight/{p-62b84c2a.entry.js → p-4e8f6ded.entry.js} +1 -1
  283. package/dist/twilight/{p-11e00cd9.entry.js → p-4f8f2feb.entry.js} +1 -1
  284. package/dist/twilight/{p-f8f5382c.entry.js → p-50b6c22c.entry.js} +1 -1
  285. package/dist/twilight/{p-a5f17905.entry.js → p-5205d63e.entry.js} +1 -1
  286. package/dist/twilight/{p-339af879.entry.js → p-581a8b45.entry.js} +1 -1
  287. package/dist/twilight/{p-da28283d.entry.js → p-5a21d194.entry.js} +1 -1
  288. package/dist/twilight/{p-fd25d593.entry.js → p-5d6c3392.entry.js} +1 -1
  289. package/dist/twilight/{p-e618c3b5.entry.js → p-5ef1833b.entry.js} +1 -1
  290. package/dist/twilight/{p-fe99f57a.entry.js → p-5fc02026.entry.js} +1 -1
  291. package/dist/twilight/{p-14b953e6.entry.js → p-6094c30b.entry.js} +1 -1
  292. package/dist/twilight/p-62a169d1.entry.js +4 -0
  293. package/dist/twilight/{p-03700885.entry.js → p-62ac3794.entry.js} +1 -1
  294. package/dist/twilight/{p-5b13fc31.entry.js → p-63218518.entry.js} +1 -1
  295. package/dist/twilight/{p-a339becc.entry.js → p-6509aa03.entry.js} +1 -1
  296. package/dist/twilight/{p-27cdd027.entry.js → p-6523dc46.entry.js} +1 -1
  297. package/dist/twilight/{p-80c6b366.entry.js → p-72613749.entry.js} +1 -1
  298. package/dist/twilight/{p-c442a7ac.entry.js → p-7a3509dc.entry.js} +1 -1
  299. package/dist/twilight/{p-b0b2c43c.entry.js → p-7a4e4cf8.entry.js} +1 -1
  300. package/dist/twilight/{p-579e26cf.entry.js → p-7b32d8ed.entry.js} +1 -1
  301. package/dist/twilight/{p-aed0fd64.entry.js → p-7d0e6388.entry.js} +1 -1
  302. package/dist/twilight/{p-b72d0322.entry.js → p-7db55bbd.entry.js} +1 -1
  303. package/dist/twilight/{p-73856c1c.entry.js → p-836dd695.entry.js} +1 -1
  304. package/dist/twilight/{p-2590ffab.entry.js → p-85688b20.entry.js} +1 -1
  305. package/dist/twilight/{p-B_72Wcdd.js → p-88X5ZOpy.js} +1 -1
  306. package/dist/twilight/{p-5f74fe6b.entry.js → p-8a3f0f6f.entry.js} +1 -1
  307. package/dist/twilight/{p-d7191fdf.entry.js → p-8e5fd8c4.entry.js} +1 -1
  308. package/dist/twilight/{p-4170b090.entry.js → p-8e6f8658.entry.js} +1 -1
  309. package/dist/twilight/{p-d71dc484.entry.js → p-97e75d89.entry.js} +1 -1
  310. package/dist/twilight/{p-76d7d16b.entry.js → p-9fd500d9.entry.js} +1 -1
  311. package/dist/twilight/{p-BmMPNouI.js → p-BKX_fK3V.js} +1 -1
  312. package/dist/twilight/{p-CyEKxqUy.js → p-BUrckDHu.js} +1 -1
  313. package/dist/twilight/{p-CT0cM10j.js → p-Bv52S6nw.js} +1 -1
  314. package/dist/twilight/{p-D3sV8bk6.js → p-C0pl0Rh-.js} +1 -1
  315. package/dist/twilight/{p-DfJQohpt.js → p-Cn0tfZpG.js} +1 -1
  316. package/dist/twilight/p-Cx3AzTeQ.js +4 -0
  317. package/dist/twilight/{p-B2MFLSFA.js → p-DGsIK1oA.js} +1 -1
  318. package/dist/twilight/{p-kc64jRSI.js → p-DH2EP3yv.js} +1 -1
  319. package/dist/twilight/{p-CguEi8pz.js → p-QCX-Ccdr.js} +1 -1
  320. package/dist/twilight/{p-b7b2ddd1.entry.js → p-a030085d.entry.js} +1 -1
  321. package/dist/twilight/{p-3aeb38dc.entry.js → p-a45cdc04.entry.js} +1 -1
  322. package/dist/twilight/{p-aab104bf.entry.js → p-a9a31035.entry.js} +1 -1
  323. package/dist/twilight/{p-661b2a59.entry.js → p-ae52b008.entry.js} +1 -1
  324. package/dist/twilight/{p-915ba55c.entry.js → p-b2179de6.entry.js} +1 -1
  325. package/dist/twilight/{p-45574ef2.entry.js → p-b28486a1.entry.js} +1 -1
  326. package/dist/twilight/{p-4bb50513.entry.js → p-b69076be.entry.js} +1 -1
  327. package/dist/twilight/{p-f611ba62.entry.js → p-b775654f.entry.js} +1 -1
  328. package/dist/twilight/{p-cc8f7a83.entry.js → p-b882fe2c.entry.js} +1 -1
  329. package/dist/twilight/{p-322e374e.entry.js → p-bb29e1c4.entry.js} +1 -1
  330. package/dist/twilight/{p-fd2ad6f4.entry.js → p-c2eebe72.entry.js} +1 -1
  331. package/dist/twilight/{p-7830eb6a.entry.js → p-c689281b.entry.js} +1 -1
  332. package/dist/twilight/{p-7d83a1e4.entry.js → p-c923c4bc.entry.js} +1 -1
  333. package/dist/twilight/{p-76ec887e.entry.js → p-cd2e721e.entry.js} +1 -1
  334. package/dist/twilight/{p-Dre0STRQ.js → p-cncDkB0J.js} +1 -1
  335. package/dist/twilight/{p-de30b9ae.entry.js → p-d1c0e94a.entry.js} +1 -1
  336. package/dist/twilight/{p-a6156ec1.entry.js → p-d1d123be.entry.js} +1 -1
  337. package/dist/twilight/{p-16ae7123.entry.js → p-d2ac109e.entry.js} +1 -1
  338. package/dist/twilight/{p-8161558b.entry.js → p-d2f4fd0d.entry.js} +1 -1
  339. package/dist/twilight/{p-8ef6d1fd.entry.js → p-d32817cf.entry.js} +1 -1
  340. package/dist/twilight/{p-0ff82ef6.entry.js → p-d545dd56.entry.js} +1 -1
  341. package/dist/twilight/{p-7b3db8b0.entry.js → p-d58a0330.entry.js} +1 -1
  342. package/dist/twilight/{p-2b0e76d8.entry.js → p-db787ac0.entry.js} +1 -1
  343. package/dist/twilight/{p-88b4cf65.entry.js → p-e2cbd2d8.entry.js} +1 -1
  344. package/dist/twilight/{p-09cd66d7.entry.js → p-e34bb476.entry.js} +1 -1
  345. package/dist/twilight/{p-56a9fcb9.entry.js → p-e3557122.entry.js} +1 -1
  346. package/dist/twilight/{p-741bb11f.entry.js → p-e48a3ff8.entry.js} +1 -1
  347. package/dist/twilight/{p-b7f65b7b.entry.js → p-e56447db.entry.js} +1 -1
  348. package/dist/twilight/{p-fb934756.entry.js → p-e5e53ee6.entry.js} +1 -1
  349. package/dist/twilight/{p-f6b30227.entry.js → p-e645b7a0.entry.js} +1 -1
  350. package/dist/twilight/{p-eb40b12d.entry.js → p-e651fb2b.entry.js} +1 -1
  351. package/dist/twilight/{p-b8cb4594.entry.js → p-e6a445ea.entry.js} +1 -1
  352. package/dist/twilight/{p-dd5068b3.entry.js → p-ea7e9494.entry.js} +1 -1
  353. package/dist/twilight/{p-3d4ca11b.entry.js → p-eb4d96bc.entry.js} +1 -1
  354. package/dist/twilight/{p-0c94e462.entry.js → p-eebec3ae.entry.js} +1 -1
  355. package/dist/twilight/{p-b9c60b02.entry.js → p-ef728985.entry.js} +1 -1
  356. package/dist/twilight/{p-36b84542.entry.js → p-f15fea94.entry.js} +1 -1
  357. package/dist/twilight/{p-471104d3.entry.js → p-f792da44.entry.js} +1 -1
  358. package/dist/twilight/{p-59a22067.entry.js → p-f99e493c.entry.js} +1 -1
  359. package/dist/twilight/{p-dbed337b.entry.js → p-fe174351.entry.js} +1 -1
  360. package/dist/twilight/{p-3xfbOSPM.js → p-lS_doykN.js} +1 -1
  361. package/dist/twilight/twilight.esm.js +1 -1
  362. package/dist/types/shared/coupons-request.d.ts +5 -0
  363. package/package.json +5 -5
  364. package/dist/twilight/p-16486a69.entry.js +0 -4
  365. package/dist/twilight/p-206e9ef5.entry.js +0 -4
  366. package/dist/twilight/p-7d6b99d1.entry.js +0 -4
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as t,h as r}from"./p-3xfbOSPM.js";import{H as e}from"./p-D3sV8bk6.js";import{m as o}from"./p-DfHdQUMm.js";import{a as s}from"./p-CxrJQ3Jf.js";const i="waiting",a="tab",n={"pages.orders.filter_all":{ar:"الكل",en:"All"},"pages.orders.filter_archived":{ar:"الطلبات المؤرشفة",en:"Archived orders"},"pages.orders.filter_awaiting_review":{ar:"بانتظار تقييمك",en:"Awaiting your review"},"pages.orders.leave_review":{ar:"أضف تقييمك",en:"Add review"},"pages.orders.no_unrated_orders":{ar:"لا توجد طلبات غير مقيَّمة",en:"No unrated orders"},"pages.orders.no_archived_orders":{ar:"لا توجد طلبات مؤرشفة",en:"No archived orders"},"pages.orders.review_banner":{ar:"لديك طلبات بانتظار تقييمك. شارك رأيك وساعدنا على تحسين تجربتك.",en:"You have orders awaiting your review. Share your feedback and help us improve your experience."},"pages.orders.review_banner_with_points":{ar:"لديك طلبات بانتظار تقييمك. قيِّمها واحصل على ما يصل إلى {{points}} نقطة ولاء.",en:"You have orders awaiting your review. Rate them and earn up to {{points}} loyalty points."}},l=class{constructor(r){t(this,r),this.orderNumberText=salla.lang.get("pages.thank_you.order_id"),this.totalOrderText=salla.lang.get("pages.orders.total"),this.orderDateText=salla.lang.get("pages.orders.date"),this.orderStatusText=salla.lang.get("pages.orders.status"),this.noOrderText=salla.lang.get("pages.orders.non_orders"),this.load_more_text_trans=salla.lang.get("common.elements.load_more"),this.languageCode=salla.lang.locale,this.filterAllText=salla.lang.getWithDefault("pages.orders.filter_all","الكل"),this.filterArchivedText=salla.lang.getWithDefault("pages.orders.filter_archived","الطلبات المؤرشفة"),this.filterAwaitingReviewText=salla.lang.getWithDefault("pages.orders.filter_awaiting_review","بانتظار تقييمك"),this.leaveReviewText=salla.lang.getWithDefault("pages.orders.leave_review","شارك تقييمك"),this.noUnratedOrdersText=salla.lang.getWithDefault("pages.orders.no_unrated_orders","لا توجد طلبات غير مقيَّمة"),this.noArchivedOrdersText=salla.lang.getWithDefault("pages.orders.no_archived_orders","لا توجد طلبات مؤرشفة"),this.orders=[],this.nextPage=null,this.activeFilter=function(){const t=new URLSearchParams(window.location.search).get(a);return"waiting"===t||"archived"===t?t:"all"}(),this.pendingReviewCount=0,this.emptyFilterResult=!1,this.isFetching=!1,this.reviewPoints=0,this.filterGeneration=0,this.showExternalOrders=!1}connectedCallback(){this.langUnsubscribe=salla.lang.subscribe((()=>{s(n),this.refreshReviewLabels(),this.languageCode=salla.lang.locale,this.orderNumberText=salla.lang.get("pages.thank_you.order_id"),this.totalOrderText=salla.lang.get("pages.orders.total"),this.orderDateText=salla.lang.get("pages.orders.date"),this.orderStatusText=salla.lang.get("pages.orders.status"),this.noOrderText=salla.lang.get("pages.orders.non_orders"),this.load_more_text_trans=salla.lang.get("common.elements.load_more")}))}disconnectedCallback(){this.langUnsubscribe?.()}setLoadMoreLoading(t=!0){const r=this.status?.querySelector(".s-button-text");r&&this.btnLoader&&(e.toggleElementClassIf(r,"s-button-hide","s-button-show",(()=>t)),this.btnLoader.style.display=t?"inherit":"none")}refreshReviewLabels(){this.filterAllText=salla.lang.getWithDefault("pages.orders.filter_all","الكل"),this.filterArchivedText=salla.lang.getWithDefault("pages.orders.filter_archived","الطلبات المؤرشفة"),this.filterAwaitingReviewText=salla.lang.getWithDefault("pages.orders.filter_awaiting_review","بانتظار تقييمك"),this.leaveReviewText=salla.lang.getWithDefault("pages.orders.leave_review","شارك تقييمك"),this.noUnratedOrdersText=salla.lang.getWithDefault("pages.orders.no_unrated_orders","لا توجد طلبات غير مقيَّمة"),this.noArchivedOrdersText=salla.lang.getWithDefault("pages.orders.no_archived_orders","لا توجد طلبات مؤرشفة")}setupLoyalty(){const t=!!salla.config.get("store.settings.rating.can_rate_product"),r=!!salla.config.get("store.settings.rating.can_rate_shipping"),e=!!salla.config.get("store.settings.rating.can_rate_store"),o=!!salla.config.get("store.settings.rating.allow_attach_images")||!!salla.config.get("store.settings.rating.allow_attach_videos"),s=Number(salla.config.get("store.settings.rating.rating_product_points"))||0,i=Number(salla.config.get("store.settings.rating.rating_product_with_image_points"))||0,a=Number(salla.config.get("store.settings.rating.rating_shipping_company_points"))||0,n=Number(salla.config.get("store.settings.rating.rating_store_points"))||0;this.reviewPoints=0,t&&(this.reviewPoints+=s),r&&(this.reviewPoints+=a),e&&(this.reviewPoints+=n),o&&(this.reviewPoints+=i)}formatNumber(t){return salla.helpers?.number?salla.helpers.number(t):String(t)}getBannerText(){const t=this.reviewPoints>0,r="pages.orders.review_banner"+(t?"_with_points":"");let e=salla.lang.getWithDefault(r,n[r]?.ar||"");return t&&(e=e.replace("{{points}}",this.formatNumber(this.reviewPoints))),e}isEligibleForReview(t){return!t.is_rated&&!1!==t.can_rate}async openReviewModal(t){this.ratingModal&&t&&(await this.ratingModal.setOrder(t),await this.ratingModal.open())}switchFilter(t){this.isFetching||this.activeFilter===t||(this.activeFilter=t,this.syncFilterToSearchParams(t),this.fetchOrders(t))}syncFilterToSearchParams(t){const r=new URL(window.location.href);"all"===t?r.searchParams.delete(a):r.searchParams.set(a,t),window.history.replaceState(window.history.state,"",r)}initiateInfiniteScroll(){if(!this.hasInfiniteScroll)return;if(!this.ordersTableBody)return void salla.logger.error("Orders table body is undefined. Cannot initiate infinite scroll.");const t=this.filterGeneration;this.infiniteScroll=salla.infiniteScroll.initiate(this.ordersTableBody,this.ordersTableBody,{path:()=>this.nextPage,history:!1,nextPage:this.nextPage,scrollThreshold:!1},!0),this.infiniteScroll?.on("request",(()=>{this.setLoadMoreLoading()})),this.infiniteScroll?.on("load",(r=>{if(t===this.filterGeneration){this.setLoadMoreLoading(!1),this.pagination=r.pagination,this.nextPage=r.pagination?.links?.next||null;for(const t of this.createOrderRows(r.data))this.ordersTableBody.append(t);this.orders=[...this.orders,...r.data],e.animateItems(this.ordersTableBody.querySelectorAll(".s-orders-table-tbody-tr:not(.animated)"))}})),this.infiniteScroll?.on("error",(t=>{salla.logger.error("Error loading more comments:",t)}))}async loadMore(){this.infiniteScroll.loadNextPage()}createOrderRows(t){return t.map((t=>this.getSingleOrderItem(t)))}async loadPendingReviewCount(){try{const t=await salla.order.api.fetch({...this.params,format:"light",types:[""],feedback_status:i,per_page:1});this.pendingReviewCount=t.pagination?.count??0}catch(t){this.pendingReviewCount=0,salla.logger.error(t)}}populateOrdersTableIfEmpty(){if(this.ordersTableBody&&this.orders.length&&!this.ordersTableBody.children.length){for(const t of this.createOrderRows(this.orders))this.ordersTableBody.append(t);this.infiniteScroll||this.initiateInfiniteScroll(),e.animateItems(this.ordersTableBody.querySelectorAll(".s-orders-table-tbody-tr:not(.animated)"))}}async fetchOrders(t){if(this.isFetching)return;this.setLoadMoreLoading(!1),this.isFetching=!0,this.ordersTableBody&&(this.ordersTableBody.innerHTML=""),this.filterGeneration++;const r="waiting"===t?i:null;try{const e=await salla.order.api.fetch({...this.params,format:"light",types:[""],feedback_status:r,..."archived"===t?{external_orders:1}:{}});if(this.orders=e.data,this.hasInfiniteScroll=!!e.pagination?.links.next,this.pagination=e.pagination,this.total=e.pagination?.count,this.nextPage=e.pagination?.links?.next||null,this.infiniteScroll?.destroy?.(),this.infiniteScroll=null,"waiting"===t&&(this.pendingReviewCount=e.pagination?.count??0),!this.orders.length)return this.setLoadMoreLoading(!1),this.emptyFilterResult="all"!==t,void(this.showPlaceholder="all"===t);this.showPlaceholder=!1,this.emptyFilterResult=!1,this.ordersTableBody&&(this.ordersTableBody.innerHTML="")}catch(t){this.showPlaceholder=!0,this.setLoadMoreLoading(!1),salla.logger.error(t)}finally{this.isFetching=!1}}getSingleOrderItem(t){const r=String(("archived"===this.activeFilter?t.external_order_id:t.reference_id)??""),s=/^\d+$/.test(r)?`#${r}`:r,i=document.createElement("tr");i.classList.add("s-orders-table-tbody-tr","s-orders-table-tbody-tr-shadow");const a=document.createElement("td");a.classList.add("s-orders-table-tbody-tr-td");const n=document.createElement("div");n.classList.add("s-orders-table-tbody-tr-td-content");const l=document.createElement("span");l.classList.add("s-orders-mobile-title"),l.textContent=`${this.orderNumberText}:`;const d=document.createElement("span");if(d.classList.add("s-orders-reference-id"),d.textContent=s,n.appendChild(l),n.appendChild(d),"buy_as_gift"===t.source){const t=document.createElement("i");t.classList.add("sicon-gift-sharing","s-orders-buy-as-gift-icon"),n.appendChild(t)}const c=document.createElement("a");t.url&&(c.href=t.url),n.appendChild(c);const h=document.createElement("div");h.classList.add("s-orders-copy-to-clipboard-button");const p=document.createElement("salla-button");p.classList.add("relative"),p.setAttribute("color","dark"),p.setAttribute("shape","link"),p.dataset.content=r,p.addEventListener("click",(t=>{e.copyToClipboard(t),e.toggleElementClassIf(p,"copied","code-to-copy",(()=>!0)),setTimeout((()=>{e.toggleElementClassIf(p,"code-to-copy","copied",(()=>!0))}),1e3)}));const b=document.createElement("span");b.textContent=s;const m=document.createElement("i");m.classList.add("sicon-swap-stroke","s-orders-copy-to-clipboard-button-icon");let g=salla.config.get("theme.is_rtl",!0);g?(p.appendChild(m),p.appendChild(b)):(p.appendChild(b),p.appendChild(m)),h.appendChild(p),n.appendChild(h),a.appendChild(n),i.appendChild(a);const u=document.createElement("td");u.classList.add("s-orders-table-tbody-tr-td");const w=document.createElement("div");w.classList.add("s-orders-table-tbody-tr-td-content");const y=document.createElement("span");y.classList.add("s-orders-mobile-title"),y.textContent=`${this.orderStatusText}:`;const f=document.createElement("span");if(f.classList.add("s-orders-status-container"),t.status?.color&&(f.style.color=t.status.color),t.status?.icon){const r=document.createElement("i");r.classList.add(t.status.icon),f.appendChild(r)}const v=document.createElement("span");v.textContent=t.status?.name??"",f.appendChild(v),w.appendChild(y),w.appendChild(f);const x=document.createElement("a");t.url&&(x.href=t.url),w.appendChild(x),u.appendChild(w),i.appendChild(u);const k=document.createElement("td");k.classList.add("s-orders-table-tbody-tr-td");const _=document.createElement("div");_.classList.add("s-orders-table-tbody-tr-td-content");const C=document.createElement("span");C.classList.add("s-orders-mobile-title"),C.textContent=`${this.totalOrderText}:`;const z=document.createElement("div");z.innerHTML=o(Number(t.total?.amount),t.total?.currency);const j=document.createElement("a");t.url&&(j.href=t.url),_.appendChild(C),_.appendChild(z),_.appendChild(j),k.appendChild(_),i.appendChild(k);const L=document.createElement("td");L.classList.add("s-orders-table-tbody-tr-td");const H=document.createElement("div");H.classList.add("s-orders-table-tbody-tr-td-content");const R=document.createElement("span");R.classList.add("s-orders-mobile-title"),R.textContent=`${this.orderDateText}:`;const S=document.createElement("div");S.textContent=e.formatDateFromString(t.created_at?.date??"",salla.helpers.number,this.languageCode);const M=document.createElement("a");t.url&&(M.href=t.url),H.appendChild(R),H.appendChild(S),H.appendChild(M),L.appendChild(H),i.appendChild(L);const N=document.createElement("td");N.classList.add("s-orders-table-tbody-tr-td");const Y=document.createElement("div");if(Y.classList.add("s-orders-table-tbody-tr-td-content","s-orders-action-cell"),t.is_rated){const t=document.createElement("i");Y.appendChild(t)}else if(this.isEligibleForReview(t)){const r=document.createElement("salla-button");r.classList.add("relative","s-orders-leave-review-btn"),r.setAttribute("color","primary"),r.setAttribute("fill","outline"),r.setAttribute("size","small");const e=document.createElement("i");e.classList.add("sicon-star-o","s-orders-review-star-icon");const o=document.createElement("span");o.textContent=this.leaveReviewText,g?(r.appendChild(e),r.appendChild(o)):(r.appendChild(o),r.appendChild(e)),r.addEventListener("click",(r=>{r.preventDefault(),r.stopPropagation(),this.openReviewModal(t.id)})),Y.appendChild(r)}return N.appendChild(Y),i.appendChild(N),i}renderTableHead(){return r("thead",{class:"s-orders-table-head"},r("tr",{class:"s-orders-table-head-tr"},r("th",{class:"s-orders-table-head-tr-th",scope:"col"},this.orderNumberText),r("th",{class:"s-orders-table-head-tr-th",scope:"col"},this.orderStatusText),r("th",{class:"s-orders-table-head-tr-th",scope:"col"},this.totalOrderText),r("th",{class:"s-orders-table-head-tr-th",scope:"col"},this.orderDateText),r("th",{class:"s-orders-table-head-tr-th",scope:"col"})))}renderSkeletonRow(t){return r("tr",{class:"s-orders-table-tbody-tr s-orders-table-tbody-tr-skeleton",key:`skeleton-${t}`},r("td",{class:"s-orders-table-tbody-tr-td"},r("div",{class:"s-orders-table-tbody-tr-td-content"},r("salla-skeleton",{height:"14px",width:"90px"}))),r("td",{class:"s-orders-table-tbody-tr-td"},r("div",{class:"s-orders-table-tbody-tr-td-content"},r("salla-skeleton",{height:"14px",width:"70px"}))),r("td",{class:"s-orders-table-tbody-tr-td"},r("div",{class:"s-orders-table-tbody-tr-td-content"},r("salla-skeleton",{height:"14px",width:"60px"}))),r("td",{class:"s-orders-table-tbody-tr-td"},r("div",{class:"s-orders-table-tbody-tr-td-content"},r("salla-skeleton",{height:"14px",width:"80px"}))),r("td",{class:"s-orders-table-tbody-tr-td"},r("div",{class:"s-orders-table-tbody-tr-td-content s-orders-action-cell"},r("salla-skeleton",{height:"32px",width:"90px"}))))}renderSkeletonRows(t=5){return Array.from({length:t},((t,r)=>this.renderSkeletonRow(r)))}getEmptyFilterText(){return"archived"===this.activeFilter?this.noArchivedOrdersText:this.noUnratedOrdersText}renderFilters(){return r("div",{class:"s-orders-filters"},r("salla-button",{size:"small",color:"all"===this.activeFilter?"primary":"light",fill:"outline",onClick:()=>this.switchFilter("all"),enableLoader:!1},this.filterAllText),this.showExternalOrders&&r("salla-button",{size:"small",color:"archived"===this.activeFilter?"primary":"light",fill:"outline",onClick:()=>this.switchFilter("archived"),enableLoader:!1},this.filterArchivedText),r("salla-button",{size:"small",color:"waiting"===this.activeFilter?"primary":"light",fill:"outline",onClick:()=>this.switchFilter("waiting"),enableLoader:!1},this.filterAwaitingReviewText))}renderBanner(){return this.pendingReviewCount?r("div",{class:"s-orders-banner"},r("span",{class:"s-orders-banner-icon"},r("svg",{width:"17",height:"17",viewBox:"0 0 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},r("path",{d:"M10 0C13.6819 0 16.6667 2.98477 16.6667 6.66664C16.6667 9.37047 15.057 11.6984 12.7437 12.7444C11.6978 15.0575 9.3701 16.6666 6.66668 16.6666C2.98477 16.6666 0 13.6819 0 9.99998C0 7.29656 1.60918 4.96894 3.92195 3.92276C4.96827 1.60964 7.29618 0 10 0ZM6.66668 5C3.90524 5 1.66667 7.23856 1.66667 9.99998C1.66667 12.7614 3.90524 15 6.66668 15C9.4281 15 11.6667 12.7614 11.6667 9.99998C11.6667 7.23856 9.4281 5 6.66668 5ZM7.50002 5.83333V6.66664H9.16668V8.33331H5.83333C5.60322 8.33331 5.41667 8.51989 5.41667 8.74998C5.41667 8.95456 5.56407 9.12464 5.75844 9.15998L5.83333 9.16664H7.50002C8.6506 9.16664 9.58335 10.0994 9.58335 11.25C9.58335 12.4006 8.6506 13.3333 7.50002 13.3333V14.1666H5.83333V13.3333H4.16667V11.6666H7.50002C7.7301 11.6666 7.91668 11.4801 7.91668 11.25C7.91668 11.0455 7.76927 10.8753 7.57493 10.8401L7.50002 10.8333H5.83333C4.68274 10.8333 3.75 9.90056 3.75 8.74998C3.75 7.59939 4.68274 6.66664 5.83333 6.66664V5.83333H7.50002ZM10 1.66667C8.51377 1.66667 7.17893 2.31513 6.26313 3.34457C6.39704 3.33736 6.53138 3.33333 6.66668 3.33333C10.3486 3.33333 13.3333 6.3181 13.3333 9.99998C13.3333 10.1356 13.3293 10.2702 13.3213 10.4037C14.3513 9.48814 15 8.15314 15 6.66664C15 3.90524 12.7614 1.66667 10 1.66667Z",fill:"#008C56"}))),r("p",{class:"s-orders-banner-text"},this.getBannerText())):null}render(){return this.showPlaceholder?r("div",{class:"s-orders-no-content"},r("i",{class:"sicon-packed-box icon"}),r("p",null,this.noOrderText)):r("div",{class:"s-orders-wrapper"},this.renderBanner(),this.renderFilters(),r("div",{class:"s-orders-list-wrapper"},this.isFetching?r("table",{class:"s-orders-table s-orders-table-skeleton"},this.renderTableHead(),r("tbody",{class:"s-orders-table-tbody"},this.renderSkeletonRows())):this.emptyFilterResult?r("div",{class:"s-orders-no-content"},r("i",{class:"sicon-packed-box icon"}),r("p",null,this.getEmptyFilterText())):r("table",{class:"s-orders-table"},this.renderTableHead(),r("tbody",{class:"s-orders-table-tbody",ref:t=>this.ordersTableBody=t}))),this.nextPage&&!this.emptyFilterResult&&r("div",{class:"s-infinite-scroll-wrapper",ref:t=>this.status=t},r("button",{type:"button",onClick:()=>this.loadMore(),class:"s-infinite-scroll-btn s-button-btn s-button-primary"},r("span",{class:"s-button-text s-infinite-scroll-btn-text"},this.loadMoreText??this.load_more_text_trans),r("span",{class:"s-button-loader s-button-loader-center s-infinite-scroll-btn-loader",ref:t=>this.btnLoader=t,style:{display:"none"}}))),r("salla-rating-modal",{ref:t=>this.ratingModal=t}))}componentDidRender(){this.populateOrdersTableIfEmpty()}componentWillLoad(){return salla.onReady().then((()=>{this.setupLoyalty(),this.showExternalOrders=salla.config.get("store.features",[]).includes("show-external-orders"),"archived"!==this.activeFilter||this.showExternalOrders||(this.activeFilter="all",this.syncFilterToSearchParams("all"));const t=[this.fetchOrders(this.activeFilter)];return"waiting"!==this.activeFilter&&t.push(this.loadPendingReviewCount()),Promise.all(t)}))}};l.style='/*!twlt*/:host{display:block}.s-orders-banner{display:flex;align-items:center;gap:0.625rem;width:100%;margin-top:1.5rem;margin-bottom:0.75rem;padding:0.75rem;border-radius:0.5rem;background-color:#E6F4EA}.s-orders-banner-icon{display:flex;flex-shrink:0;align-items:center;justify-content:center;width:1.25rem;height:1.25rem;color:#1B7F5C}.s-orders-banner-icon svg{width:1.5rem;height:1.5rem;fill:currentColor}.s-orders-banner-text{flex:1;margin:0;font-size:0.875rem;line-height:1.25rem;color:#1f2937}.s-orders-action-cell.s-orders-action-cell{display:flex;align-items:center;justify-content:flex-end}.s-orders-leave-review-btn .s-button-text{display:flex;align-items:center;gap:0.375rem}.s-orders-action-cell .s-orders-status-rated{margin-inline-start:auto}.relative{position:relative}.table{display:table}.outline{outline-style:solid}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.s-button-btn{position:relative;display:inline-flex;flex:1 1 0%;user-select:none;flex-direction:row-reverse;align-items:center;justify-content:center;white-space:nowrap;border-radius:var(--s-radius, 0.25rem);border-style:solid;padding-left:1.5rem;padding-right:1.5rem;padding-bottom:0.625rem;padding-top:0.5rem;font-size:0.875rem;line-height:1.25rem;font-weight:700;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-button-btn:hover{opacity:0.8}.s-button-primary{border-width:1px;border-color:var(--color-primary);background-color:var(--color-primary);color:var(--color-primary-reverse)}.s-button-primary:hover{background-color:var(--color-primary-dark)}.s-button-text{pointer-events:none;align-items:center;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;transition-property:opacity;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-button-loader{margin-left:0.5rem;margin-right:0.5rem;display:flex;align-items:center;justify-content:center;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}.s-button-loader::before{display:inline-block;height:1rem;content:var(--tw-content);width:1rem}@keyframes spin{to{content:var(--tw-content);transform:rotate(360deg)}}.s-button-loader::before{animation:spin 1s linear infinite;border-radius:9999px;border-width:2px;border-style:solid;border-top-color:var(--color-primary);border-left-color:var(--color-primary);border-bottom-color:rgb(243 244 246 / var(--tw-border-opacity, 1));--tw-border-opacity:1;border-right-color:rgb(243 244 246 / var(--tw-border-opacity, 1));--tw-content:\'\';content:var(--tw-content)}.s-button-loader-center .s-button-loader{position:absolute;top:50%;left:50%;margin:0px !important;--tw-translate-y:-50%;--tw-translate-x:-50%;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.s-comments-item-like-btn .s-button-text{display:flex;flex-direction:row-reverse;gap:0.5rem}.s-orders-container>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(0.625rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(0.625rem * var(--tw-space-y-reverse))}@media (min-width: 768px){.s-orders-container>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(1.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.25rem * var(--tw-space-y-reverse))}}.s-orders-mobile-title{display:inline-block;width:8rem;font-weight:400;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}@media (min-width: 768px){.s-orders-mobile-title{display:none}}.s-orders-reference-id{display:none}@media (min-width: 768px){.s-orders-reference-id{display:inline-block}}.s-orders-buy-as-gift-icon{margin-left:0.25rem;margin-right:0.25rem;display:inline-block;color:var(--color-primary)}.s-orders-copy-to-clipboard-button{display:flex;align-items:center}@media (min-width: 768px){.s-orders-copy-to-clipboard-button{display:none}}.s-orders-copy-to-clipboard-button salla-button{position:relative}.s-orders-copy-to-clipboard-button-icon{pointer-events:none;font-size:0.75rem;line-height:1rem}.s-orders-copy-to-clipboard-button-icon:where([dir="ltr"],[dir="ltr"] *){margin-left:0.25rem}.s-orders-copy-to-clipboard-button-icon:where([dir="rtl"],[dir="rtl"] *){margin-right:0.25rem}@media (min-width: 768px){.s-orders-status-container{margin-left:0px;margin-right:0px}}.s-orders-status-container:where([dir="ltr"],[dir="ltr"] *){margin-left:auto}.s-orders-status-container:where([dir="rtl"],[dir="rtl"] *){margin-right:auto}.s-orders-status-container i{margin-top:0.25rem}.s-orders-status-container i:where([dir="ltr"],[dir="ltr"] *){margin-right:0.25rem}.s-orders-status-container i:where([dir="rtl"],[dir="rtl"] *){margin-left:0.25rem}.s-orders-status-rated{font-size:1.125rem;line-height:1.75rem}.s-orders-status-rated:where([dir="ltr"],[dir="ltr"] *){margin-left:1rem}.s-orders-status-rated:where([dir="rtl"],[dir="rtl"] *){margin-right:1rem}.s-orders-rated-text{--tw-text-opacity:1;color:rgb(251 191 36 / var(--tw-text-opacity, 1))}.s-orders-unrated-text{--tw-text-opacity:1;color:rgb(229 231 235 / var(--tw-text-opacity, 1))}.s-orders-leave-review-btn{display:inline-flex;flex-shrink:0;align-items:center;gap:0.25rem;font-weight:700;color:var(--color-primary);transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-orders-leave-review-btn:hover{opacity:0.7}.s-orders-leave-review-btn:where([dir="ltr"],[dir="ltr"] *){margin-left:1rem}.s-orders-leave-review-btn:where([dir="rtl"],[dir="rtl"] *){margin-right:1rem}.s-orders-review-star-icon{font-size:1.125rem;line-height:1.75rem}.s-orders-no-content{display:flex;height:100%;flex-direction:column;align-items:center;justify-content:center;padding-top:2.5rem;padding-bottom:5rem;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-orders-no-content .icon{margin-bottom:1rem;display:flex;height:8rem;width:8rem;align-items:center;justify-content:center;border-radius:9999px;--tw-bg-opacity:1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1));font-size:3rem;line-height:1;--tw-text-opacity:1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.s-orders-no-content p{margin-bottom:1rem;font-size:1rem;line-height:1.5rem;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-orders-filters{margin-bottom:1rem;display:flex;flex-wrap:wrap;align-items:center;gap:0.5rem}.s-orders-list-wrapper{position:relative}.s-orders-list-loading{position:absolute;inset:0px;z-index:10;display:flex;align-items:center;justify-content:center;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1));--tw-bg-opacity:0.1}.s-orders-table{min-width:100%;border-collapse:separate}@media (min-width: 768px){.s-orders-table{margin-bottom:-0.75rem;--tw-border-spacing-y:1.25rem;border-spacing:var(--tw-border-spacing-x) var(--tw-border-spacing-y)}}.s-orders-table-fetching{pointer-events:none;opacity:0.4;transition-property:opacity;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:200ms}.s-orders-table-head{margin-bottom:1.25rem;display:none;--tw-bg-opacity:1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}@media (min-width: 768px){.s-orders-table-head{display:table-header-group}}.s-orders-table-head-tr-th{padding-left:1.5rem;padding-right:1.5rem;text-align:start;font-size:0.875rem;line-height:1.25rem;font-weight:500;text-transform:uppercase;letter-spacing:0.05em}.s-orders-table-head-tr-th:where([dir="ltr"],[dir="ltr"] *){text-align:left}.s-orders-table-head-tr-th:last-child:where([dir="ltr"],[dir="ltr"] *){text-align:right}.s-orders-table-head-tr-th:where([dir="rtl"],[dir="rtl"] *){text-align:right}.s-orders-table-head-tr-th:last-child:where([dir="rtl"],[dir="rtl"] *){text-align:left}.s-orders-table-tbody-tr{position:relative;display:flex;flex-direction:row;flex-wrap:wrap;overflow:hidden;border-radius:var(--s-radius, 0.25rem);border-bottom-width:8px;border-top-width:8px;--tw-border-opacity:1;border-color:rgb(249 250 251 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding:0.5rem;transition-property:box-shadow;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:500ms}@media (min-width: 768px){.s-orders-table-tbody-tr{display:table-row;flex-direction:row;flex-wrap:nowrap;padding:0px}}.s-orders-table-tbody-tr-shadow:hover{box-shadow:5px 10px 30px #2b2d340d}.s-orders-table-tbody-tr-td{width:100%;white-space:nowrap;font-size:0.875rem;line-height:1.25rem}.s-orders-table-tbody-tr-td:first-child{font-weight:700}@media (min-width: 768px){.s-orders-table-tbody-tr-td{height:5rem;width:auto}.s-orders-table-tbody-tr-td:last-child{text-align:end}.s-orders-table-tbody-tr-td:first-child:where([dir="ltr"],[dir="ltr"] *){border-top-left-radius:0.375rem;border-bottom-left-radius:0.375rem}.s-orders-table-tbody-tr-td:first-child:where([dir="rtl"],[dir="rtl"] *){border-top-right-radius:0.375rem;border-bottom-right-radius:0.375rem}}.s-orders-table-tbody-tr-td:first-child{font-weight:700}.s-orders-table-tbody-tr-td-content{position:relative;display:flex;align-items:center;justify-content:space-between;padding-left:0.5rem;padding-right:0.5rem;padding-top:0.25rem;padding-bottom:0.25rem}@media (min-width: 768px){.s-orders-table-tbody-tr-td-content{padding-left:1.5rem;padding-right:1.5rem;padding-top:1.5rem;padding-bottom:1.5rem}}.s-orders-table-tbody-tr a{position:absolute;top:0px;bottom:0px;display:block;width:100%}.s-orders-table-tbody-tr a:where([dir="ltr"],[dir="ltr"] *){left:0px}.s-orders-table-tbody-tr a:where([dir="rtl"],[dir="rtl"] *){right:0px}/*!twlt*/.s-button-btn{position:relative;display:inline-flex;flex:1 1 0%;user-select:none;flex-direction:row-reverse;align-items:center;justify-content:center;white-space:nowrap;border-radius:var(--s-radius, 0.25rem);border-style:solid;padding-left:1.5rem;padding-right:1.5rem;padding-bottom:0.625rem;padding-top:0.5rem;font-size:0.875rem;line-height:1.25rem;font-weight:700;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-button-btn:hover{opacity:0.8}.s-button-primary{border-width:1px;border-color:var(--color-primary);background-color:var(--color-primary);color:var(--color-primary-reverse)}.s-button-primary:hover{background-color:var(--color-primary-dark)}.s-button-text{pointer-events:none;align-items:center;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;transition-property:opacity;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-button-loader{margin-left:0.5rem;margin-right:0.5rem;display:flex;align-items:center;justify-content:center;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}.s-button-loader::before{display:inline-block;height:1rem;content:var(--tw-content);width:1rem}@keyframes spin{to{content:var(--tw-content);transform:rotate(360deg)}}.s-button-loader::before{animation:spin 1s linear infinite;border-radius:9999px;border-width:2px;border-style:solid;border-top-color:var(--color-primary);border-left-color:var(--color-primary);border-bottom-color:rgb(243 244 246 / var(--tw-border-opacity, 1));--tw-border-opacity:1;border-right-color:rgb(243 244 246 / var(--tw-border-opacity, 1));--tw-content:\'\';content:var(--tw-content)}.s-button-loader-center .s-button-loader{position:absolute;top:50%;left:50%;margin:0px !important;--tw-translate-y:-50%;--tw-translate-x:-50%;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.s-comments-item-like-btn .s-button-text{display:flex;flex-direction:row-reverse;gap:0.5rem}.s-infinite-scroll-wrapper{margin-top:1rem;text-align:center}.s-infinite-scroll-last{margin:0px;text-align:center}.s-infinite-scroll-error{margin:0px;text-align:center}@keyframes s-fade-in-up{from{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}.s-animate-fade-in-up{animation:s-fade-in-up 1200ms cubic-bezier(0.16, 1, 0.3, 1) both}';export{l as salla_orders}
4
+ import{r as t,h as r}from"./p-lS_doykN.js";import{H as e}from"./p-C0pl0Rh-.js";import{m as o}from"./p-DfHdQUMm.js";import{a as s}from"./p-CxrJQ3Jf.js";const i="waiting",a="tab",n={"pages.orders.filter_all":{ar:"الكل",en:"All"},"pages.orders.filter_archived":{ar:"الطلبات المؤرشفة",en:"Archived orders"},"pages.orders.filter_awaiting_review":{ar:"بانتظار تقييمك",en:"Awaiting your review"},"pages.orders.leave_review":{ar:"أضف تقييمك",en:"Add review"},"pages.orders.no_unrated_orders":{ar:"لا توجد طلبات غير مقيَّمة",en:"No unrated orders"},"pages.orders.no_archived_orders":{ar:"لا توجد طلبات مؤرشفة",en:"No archived orders"},"pages.orders.review_banner":{ar:"لديك طلبات بانتظار تقييمك. شارك رأيك وساعدنا على تحسين تجربتك.",en:"You have orders awaiting your review. Share your feedback and help us improve your experience."},"pages.orders.review_banner_with_points":{ar:"لديك طلبات بانتظار تقييمك. قيِّمها واحصل على ما يصل إلى {{points}} نقطة ولاء.",en:"You have orders awaiting your review. Rate them and earn up to {{points}} loyalty points."}},l=class{constructor(r){t(this,r),this.orderNumberText=salla.lang.get("pages.thank_you.order_id"),this.totalOrderText=salla.lang.get("pages.orders.total"),this.orderDateText=salla.lang.get("pages.orders.date"),this.orderStatusText=salla.lang.get("pages.orders.status"),this.noOrderText=salla.lang.get("pages.orders.non_orders"),this.load_more_text_trans=salla.lang.get("common.elements.load_more"),this.languageCode=salla.lang.locale,this.filterAllText=salla.lang.getWithDefault("pages.orders.filter_all","الكل"),this.filterArchivedText=salla.lang.getWithDefault("pages.orders.filter_archived","الطلبات المؤرشفة"),this.filterAwaitingReviewText=salla.lang.getWithDefault("pages.orders.filter_awaiting_review","بانتظار تقييمك"),this.leaveReviewText=salla.lang.getWithDefault("pages.orders.leave_review","شارك تقييمك"),this.noUnratedOrdersText=salla.lang.getWithDefault("pages.orders.no_unrated_orders","لا توجد طلبات غير مقيَّمة"),this.noArchivedOrdersText=salla.lang.getWithDefault("pages.orders.no_archived_orders","لا توجد طلبات مؤرشفة"),this.orders=[],this.nextPage=null,this.activeFilter=function(){const t=new URLSearchParams(window.location.search).get(a);return"waiting"===t||"archived"===t?t:"all"}(),this.pendingReviewCount=0,this.emptyFilterResult=!1,this.isFetching=!1,this.reviewPoints=0,this.filterGeneration=0,this.showExternalOrders=!1}connectedCallback(){this.langUnsubscribe=salla.lang.subscribe((()=>{s(n),this.refreshReviewLabels(),this.languageCode=salla.lang.locale,this.orderNumberText=salla.lang.get("pages.thank_you.order_id"),this.totalOrderText=salla.lang.get("pages.orders.total"),this.orderDateText=salla.lang.get("pages.orders.date"),this.orderStatusText=salla.lang.get("pages.orders.status"),this.noOrderText=salla.lang.get("pages.orders.non_orders"),this.load_more_text_trans=salla.lang.get("common.elements.load_more")}))}disconnectedCallback(){this.langUnsubscribe?.()}setLoadMoreLoading(t=!0){const r=this.status?.querySelector(".s-button-text");r&&this.btnLoader&&(e.toggleElementClassIf(r,"s-button-hide","s-button-show",(()=>t)),this.btnLoader.style.display=t?"inherit":"none")}refreshReviewLabels(){this.filterAllText=salla.lang.getWithDefault("pages.orders.filter_all","الكل"),this.filterArchivedText=salla.lang.getWithDefault("pages.orders.filter_archived","الطلبات المؤرشفة"),this.filterAwaitingReviewText=salla.lang.getWithDefault("pages.orders.filter_awaiting_review","بانتظار تقييمك"),this.leaveReviewText=salla.lang.getWithDefault("pages.orders.leave_review","شارك تقييمك"),this.noUnratedOrdersText=salla.lang.getWithDefault("pages.orders.no_unrated_orders","لا توجد طلبات غير مقيَّمة"),this.noArchivedOrdersText=salla.lang.getWithDefault("pages.orders.no_archived_orders","لا توجد طلبات مؤرشفة")}setupLoyalty(){const t=!!salla.config.get("store.settings.rating.can_rate_product"),r=!!salla.config.get("store.settings.rating.can_rate_shipping"),e=!!salla.config.get("store.settings.rating.can_rate_store"),o=!!salla.config.get("store.settings.rating.allow_attach_images")||!!salla.config.get("store.settings.rating.allow_attach_videos"),s=Number(salla.config.get("store.settings.rating.rating_product_points"))||0,i=Number(salla.config.get("store.settings.rating.rating_product_with_image_points"))||0,a=Number(salla.config.get("store.settings.rating.rating_shipping_company_points"))||0,n=Number(salla.config.get("store.settings.rating.rating_store_points"))||0;this.reviewPoints=0,t&&(this.reviewPoints+=s),r&&(this.reviewPoints+=a),e&&(this.reviewPoints+=n),o&&(this.reviewPoints+=i)}formatNumber(t){return salla.helpers?.number?salla.helpers.number(t):String(t)}getBannerText(){const t=this.reviewPoints>0,r="pages.orders.review_banner"+(t?"_with_points":"");let e=salla.lang.getWithDefault(r,n[r]?.ar||"");return t&&(e=e.replace("{{points}}",this.formatNumber(this.reviewPoints))),e}isEligibleForReview(t){return!t.is_rated&&!1!==t.can_rate}async openReviewModal(t){this.ratingModal&&t&&(await this.ratingModal.setOrder(t),await this.ratingModal.open())}switchFilter(t){this.isFetching||this.activeFilter===t||(this.activeFilter=t,this.syncFilterToSearchParams(t),this.fetchOrders(t))}syncFilterToSearchParams(t){const r=new URL(window.location.href);"all"===t?r.searchParams.delete(a):r.searchParams.set(a,t),window.history.replaceState(window.history.state,"",r)}initiateInfiniteScroll(){if(!this.hasInfiniteScroll)return;if(!this.ordersTableBody)return void salla.logger.error("Orders table body is undefined. Cannot initiate infinite scroll.");const t=this.filterGeneration;this.infiniteScroll=salla.infiniteScroll.initiate(this.ordersTableBody,this.ordersTableBody,{path:()=>this.nextPage,history:!1,nextPage:this.nextPage,scrollThreshold:!1},!0),this.infiniteScroll?.on("request",(()=>{this.setLoadMoreLoading()})),this.infiniteScroll?.on("load",(r=>{if(t===this.filterGeneration){this.setLoadMoreLoading(!1),this.pagination=r.pagination,this.nextPage=r.pagination?.links?.next||null;for(const t of this.createOrderRows(r.data))this.ordersTableBody.append(t);this.orders=[...this.orders,...r.data],e.animateItems(this.ordersTableBody.querySelectorAll(".s-orders-table-tbody-tr:not(.animated)"))}})),this.infiniteScroll?.on("error",(t=>{salla.logger.error("Error loading more comments:",t)}))}async loadMore(){this.infiniteScroll.loadNextPage()}createOrderRows(t){return t.map((t=>this.getSingleOrderItem(t)))}async loadPendingReviewCount(){try{const t=await salla.order.api.fetch({...this.params,format:"light",types:[""],feedback_status:i,per_page:1});this.pendingReviewCount=t.pagination?.count??0}catch(t){this.pendingReviewCount=0,salla.logger.error(t)}}populateOrdersTableIfEmpty(){if(this.ordersTableBody&&this.orders.length&&!this.ordersTableBody.children.length){for(const t of this.createOrderRows(this.orders))this.ordersTableBody.append(t);this.infiniteScroll||this.initiateInfiniteScroll(),e.animateItems(this.ordersTableBody.querySelectorAll(".s-orders-table-tbody-tr:not(.animated)"))}}async fetchOrders(t){if(this.isFetching)return;this.setLoadMoreLoading(!1),this.isFetching=!0,this.ordersTableBody&&(this.ordersTableBody.innerHTML=""),this.filterGeneration++;const r="waiting"===t?i:null;try{const e=await salla.order.api.fetch({...this.params,format:"light",types:[""],feedback_status:r,..."archived"===t?{external_orders:1}:{}});if(this.orders=e.data,this.hasInfiniteScroll=!!e.pagination?.links.next,this.pagination=e.pagination,this.total=e.pagination?.count,this.nextPage=e.pagination?.links?.next||null,this.infiniteScroll?.destroy?.(),this.infiniteScroll=null,"waiting"===t&&(this.pendingReviewCount=e.pagination?.count??0),!this.orders.length)return this.setLoadMoreLoading(!1),this.emptyFilterResult="all"!==t,void(this.showPlaceholder="all"===t);this.showPlaceholder=!1,this.emptyFilterResult=!1,this.ordersTableBody&&(this.ordersTableBody.innerHTML="")}catch(t){this.showPlaceholder=!0,this.setLoadMoreLoading(!1),salla.logger.error(t)}finally{this.isFetching=!1}}getSingleOrderItem(t){const r=String(("archived"===this.activeFilter?t.external_order_id:t.reference_id)??""),s=/^\d+$/.test(r)?`#${r}`:r,i=document.createElement("tr");i.classList.add("s-orders-table-tbody-tr","s-orders-table-tbody-tr-shadow");const a=document.createElement("td");a.classList.add("s-orders-table-tbody-tr-td");const n=document.createElement("div");n.classList.add("s-orders-table-tbody-tr-td-content");const l=document.createElement("span");l.classList.add("s-orders-mobile-title"),l.textContent=`${this.orderNumberText}:`;const d=document.createElement("span");if(d.classList.add("s-orders-reference-id"),d.textContent=s,n.appendChild(l),n.appendChild(d),"buy_as_gift"===t.source){const t=document.createElement("i");t.classList.add("sicon-gift-sharing","s-orders-buy-as-gift-icon"),n.appendChild(t)}const c=document.createElement("a");t.url&&(c.href=t.url),n.appendChild(c);const h=document.createElement("div");h.classList.add("s-orders-copy-to-clipboard-button");const p=document.createElement("salla-button");p.classList.add("relative"),p.setAttribute("color","dark"),p.setAttribute("shape","link"),p.dataset.content=r,p.addEventListener("click",(t=>{e.copyToClipboard(t),e.toggleElementClassIf(p,"copied","code-to-copy",(()=>!0)),setTimeout((()=>{e.toggleElementClassIf(p,"code-to-copy","copied",(()=>!0))}),1e3)}));const b=document.createElement("span");b.textContent=s;const m=document.createElement("i");m.classList.add("sicon-swap-stroke","s-orders-copy-to-clipboard-button-icon");let g=salla.config.get("theme.is_rtl",!0);g?(p.appendChild(m),p.appendChild(b)):(p.appendChild(b),p.appendChild(m)),h.appendChild(p),n.appendChild(h),a.appendChild(n),i.appendChild(a);const u=document.createElement("td");u.classList.add("s-orders-table-tbody-tr-td");const w=document.createElement("div");w.classList.add("s-orders-table-tbody-tr-td-content");const y=document.createElement("span");y.classList.add("s-orders-mobile-title"),y.textContent=`${this.orderStatusText}:`;const f=document.createElement("span");if(f.classList.add("s-orders-status-container"),t.status?.color&&(f.style.color=t.status.color),t.status?.icon){const r=document.createElement("i");r.classList.add(t.status.icon),f.appendChild(r)}const v=document.createElement("span");v.textContent=t.status?.name??"",f.appendChild(v),w.appendChild(y),w.appendChild(f);const x=document.createElement("a");t.url&&(x.href=t.url),w.appendChild(x),u.appendChild(w),i.appendChild(u);const k=document.createElement("td");k.classList.add("s-orders-table-tbody-tr-td");const _=document.createElement("div");_.classList.add("s-orders-table-tbody-tr-td-content");const C=document.createElement("span");C.classList.add("s-orders-mobile-title"),C.textContent=`${this.totalOrderText}:`;const z=document.createElement("div");z.innerHTML=o(Number(t.total?.amount),t.total?.currency);const j=document.createElement("a");t.url&&(j.href=t.url),_.appendChild(C),_.appendChild(z),_.appendChild(j),k.appendChild(_),i.appendChild(k);const L=document.createElement("td");L.classList.add("s-orders-table-tbody-tr-td");const R=document.createElement("div");R.classList.add("s-orders-table-tbody-tr-td-content");const H=document.createElement("span");H.classList.add("s-orders-mobile-title"),H.textContent=`${this.orderDateText}:`;const S=document.createElement("div");S.textContent=e.formatDateFromString(t.created_at?.date??"",salla.helpers.number,this.languageCode);const N=document.createElement("a");t.url&&(N.href=t.url),R.appendChild(H),R.appendChild(S),R.appendChild(N),L.appendChild(R),i.appendChild(L);const M=document.createElement("td");M.classList.add("s-orders-table-tbody-tr-td");const Y=document.createElement("div");if(Y.classList.add("s-orders-table-tbody-tr-td-content","s-orders-action-cell"),t.is_rated){const t=document.createElement("i");Y.appendChild(t)}else if(this.isEligibleForReview(t)){const r=document.createElement("salla-button");r.classList.add("relative","s-orders-leave-review-btn"),r.setAttribute("color","primary"),r.setAttribute("fill","outline"),r.setAttribute("size","small");const e=document.createElement("i");e.classList.add("sicon-star-o","s-orders-review-star-icon");const o=document.createElement("span");o.textContent=this.leaveReviewText,g?(r.appendChild(e),r.appendChild(o)):(r.appendChild(o),r.appendChild(e)),r.addEventListener("click",(r=>{r.preventDefault(),r.stopPropagation(),this.openReviewModal(t.id)})),Y.appendChild(r)}return M.appendChild(Y),i.appendChild(M),i}renderTableHead(){return r("thead",{class:"s-orders-table-head"},r("tr",{class:"s-orders-table-head-tr"},r("th",{class:"s-orders-table-head-tr-th",scope:"col"},this.orderNumberText),r("th",{class:"s-orders-table-head-tr-th",scope:"col"},this.orderStatusText),r("th",{class:"s-orders-table-head-tr-th",scope:"col"},this.totalOrderText),r("th",{class:"s-orders-table-head-tr-th",scope:"col"},this.orderDateText),r("th",{class:"s-orders-table-head-tr-th",scope:"col"})))}renderSkeletonRow(t){return r("tr",{class:"s-orders-table-tbody-tr s-orders-table-tbody-tr-skeleton",key:`skeleton-${t}`},r("td",{class:"s-orders-table-tbody-tr-td"},r("div",{class:"s-orders-table-tbody-tr-td-content"},r("salla-skeleton",{height:"14px",width:"90px"}))),r("td",{class:"s-orders-table-tbody-tr-td"},r("div",{class:"s-orders-table-tbody-tr-td-content"},r("salla-skeleton",{height:"14px",width:"70px"}))),r("td",{class:"s-orders-table-tbody-tr-td"},r("div",{class:"s-orders-table-tbody-tr-td-content"},r("salla-skeleton",{height:"14px",width:"60px"}))),r("td",{class:"s-orders-table-tbody-tr-td"},r("div",{class:"s-orders-table-tbody-tr-td-content"},r("salla-skeleton",{height:"14px",width:"80px"}))),r("td",{class:"s-orders-table-tbody-tr-td"},r("div",{class:"s-orders-table-tbody-tr-td-content s-orders-action-cell"},r("salla-skeleton",{height:"32px",width:"90px"}))))}renderSkeletonRows(t=5){return Array.from({length:t},((t,r)=>this.renderSkeletonRow(r)))}getEmptyFilterText(){return"archived"===this.activeFilter?this.noArchivedOrdersText:this.noUnratedOrdersText}renderFilters(){return r("div",{class:"s-orders-filters"},r("salla-button",{size:"small",color:"all"===this.activeFilter?"primary":"light",fill:"outline",onClick:()=>this.switchFilter("all"),enableLoader:!1},this.filterAllText),this.showExternalOrders&&r("salla-button",{size:"small",color:"archived"===this.activeFilter?"primary":"light",fill:"outline",onClick:()=>this.switchFilter("archived"),enableLoader:!1},this.filterArchivedText),r("salla-button",{size:"small",color:"waiting"===this.activeFilter?"primary":"light",fill:"outline",onClick:()=>this.switchFilter("waiting"),enableLoader:!1},this.filterAwaitingReviewText))}renderBanner(){return this.pendingReviewCount?r("div",{class:"s-orders-banner"},r("span",{class:"s-orders-banner-icon"},r("svg",{width:"17",height:"17",viewBox:"0 0 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},r("path",{d:"M10 0C13.6819 0 16.6667 2.98477 16.6667 6.66664C16.6667 9.37047 15.057 11.6984 12.7437 12.7444C11.6978 15.0575 9.3701 16.6666 6.66668 16.6666C2.98477 16.6666 0 13.6819 0 9.99998C0 7.29656 1.60918 4.96894 3.92195 3.92276C4.96827 1.60964 7.29618 0 10 0ZM6.66668 5C3.90524 5 1.66667 7.23856 1.66667 9.99998C1.66667 12.7614 3.90524 15 6.66668 15C9.4281 15 11.6667 12.7614 11.6667 9.99998C11.6667 7.23856 9.4281 5 6.66668 5ZM7.50002 5.83333V6.66664H9.16668V8.33331H5.83333C5.60322 8.33331 5.41667 8.51989 5.41667 8.74998C5.41667 8.95456 5.56407 9.12464 5.75844 9.15998L5.83333 9.16664H7.50002C8.6506 9.16664 9.58335 10.0994 9.58335 11.25C9.58335 12.4006 8.6506 13.3333 7.50002 13.3333V14.1666H5.83333V13.3333H4.16667V11.6666H7.50002C7.7301 11.6666 7.91668 11.4801 7.91668 11.25C7.91668 11.0455 7.76927 10.8753 7.57493 10.8401L7.50002 10.8333H5.83333C4.68274 10.8333 3.75 9.90056 3.75 8.74998C3.75 7.59939 4.68274 6.66664 5.83333 6.66664V5.83333H7.50002ZM10 1.66667C8.51377 1.66667 7.17893 2.31513 6.26313 3.34457C6.39704 3.33736 6.53138 3.33333 6.66668 3.33333C10.3486 3.33333 13.3333 6.3181 13.3333 9.99998C13.3333 10.1356 13.3293 10.2702 13.3213 10.4037C14.3513 9.48814 15 8.15314 15 6.66664C15 3.90524 12.7614 1.66667 10 1.66667Z",fill:"#008C56"}))),r("p",{class:"s-orders-banner-text"},this.getBannerText())):null}render(){return this.showPlaceholder?r("div",{class:"s-orders-no-content"},r("i",{class:"sicon-packed-box icon"}),r("p",null,this.noOrderText)):r("div",{class:"s-orders-wrapper"},this.renderBanner(),this.renderFilters(),r("div",{class:"s-orders-list-wrapper"},this.isFetching?r("table",{class:"s-orders-table s-orders-table-skeleton"},this.renderTableHead(),r("tbody",{class:"s-orders-table-tbody"},this.renderSkeletonRows())):this.emptyFilterResult?r("div",{class:"s-orders-no-content"},r("i",{class:"sicon-packed-box icon"}),r("p",null,this.getEmptyFilterText())):r("table",{class:"s-orders-table"},this.renderTableHead(),r("tbody",{class:"s-orders-table-tbody",ref:t=>this.ordersTableBody=t}))),this.nextPage&&!this.emptyFilterResult&&r("div",{class:"s-infinite-scroll-wrapper",ref:t=>this.status=t},r("button",{type:"button",onClick:()=>this.loadMore(),class:"s-infinite-scroll-btn s-button-btn s-button-primary"},r("span",{class:"s-button-text s-infinite-scroll-btn-text"},this.loadMoreText??this.load_more_text_trans),r("span",{class:"s-button-loader s-button-loader-center s-infinite-scroll-btn-loader",ref:t=>this.btnLoader=t,style:{display:"none"}}))),r("salla-rating-modal",{ref:t=>this.ratingModal=t}))}componentDidRender(){this.populateOrdersTableIfEmpty()}componentWillLoad(){return salla.onReady().then((()=>{this.setupLoyalty(),this.showExternalOrders=salla.config.get("store.features",[]).includes("show-external-orders"),"archived"!==this.activeFilter||this.showExternalOrders||(this.activeFilter="all",this.syncFilterToSearchParams("all"));const t=[this.fetchOrders(this.activeFilter)];return"waiting"!==this.activeFilter&&t.push(this.loadPendingReviewCount()),Promise.all(t)}))}};l.style='/*!twlt*/:host{display:block}.s-orders-banner{display:flex;align-items:center;gap:0.625rem;width:100%;margin-top:1.5rem;margin-bottom:0.75rem;padding:0.75rem;border-radius:0.5rem;background-color:#E6F4EA}.s-orders-banner-icon{display:flex;flex-shrink:0;align-items:center;justify-content:center;width:1.25rem;height:1.25rem;color:#1B7F5C}.s-orders-banner-icon svg{width:1.5rem;height:1.5rem;fill:currentColor}.s-orders-banner-text{flex:1;margin:0;font-size:0.875rem;line-height:1.25rem;color:#1f2937}.s-orders-action-cell.s-orders-action-cell{display:flex;align-items:center;justify-content:flex-end}.s-orders-leave-review-btn .s-button-text{display:flex;align-items:center;gap:0.375rem}.s-orders-action-cell .s-orders-status-rated{margin-inline-start:auto}.relative{position:relative}.table{display:table}.outline{outline-style:solid}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.s-button-btn{position:relative;display:inline-flex;flex:1 1 0%;user-select:none;flex-direction:row-reverse;align-items:center;justify-content:center;white-space:nowrap;border-radius:var(--s-radius, 0.25rem);border-style:solid;padding-left:1.5rem;padding-right:1.5rem;padding-bottom:0.625rem;padding-top:0.5rem;font-size:0.875rem;line-height:1.25rem;font-weight:700;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-button-btn:hover{opacity:0.8}.s-button-primary{border-width:1px;border-color:var(--color-primary);background-color:var(--color-primary);color:var(--color-primary-reverse)}.s-button-primary:hover{background-color:var(--color-primary-dark)}.s-button-text{pointer-events:none;align-items:center;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;transition-property:opacity;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-button-loader{margin-left:0.5rem;margin-right:0.5rem;display:flex;align-items:center;justify-content:center;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}.s-button-loader::before{display:inline-block;height:1rem;content:var(--tw-content);width:1rem}@keyframes spin{to{content:var(--tw-content);transform:rotate(360deg)}}.s-button-loader::before{animation:spin 1s linear infinite;border-radius:9999px;border-width:2px;border-style:solid;border-top-color:var(--color-primary);border-left-color:var(--color-primary);border-bottom-color:rgb(243 244 246 / var(--tw-border-opacity, 1));--tw-border-opacity:1;border-right-color:rgb(243 244 246 / var(--tw-border-opacity, 1));--tw-content:\'\';content:var(--tw-content)}.s-button-loader-center .s-button-loader{position:absolute;top:50%;left:50%;margin:0px !important;--tw-translate-y:-50%;--tw-translate-x:-50%;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.s-comments-item-like-btn .s-button-text{display:flex;flex-direction:row-reverse;gap:0.5rem}.s-orders-container>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(0.625rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(0.625rem * var(--tw-space-y-reverse))}@media (min-width: 768px){.s-orders-container>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(1.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.25rem * var(--tw-space-y-reverse))}}.s-orders-mobile-title{display:inline-block;width:8rem;font-weight:400;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}@media (min-width: 768px){.s-orders-mobile-title{display:none}}.s-orders-reference-id{display:none}@media (min-width: 768px){.s-orders-reference-id{display:inline-block}}.s-orders-buy-as-gift-icon{margin-left:0.25rem;margin-right:0.25rem;display:inline-block;color:var(--color-primary)}.s-orders-copy-to-clipboard-button{display:flex;align-items:center}@media (min-width: 768px){.s-orders-copy-to-clipboard-button{display:none}}.s-orders-copy-to-clipboard-button salla-button{position:relative}.s-orders-copy-to-clipboard-button-icon{pointer-events:none;font-size:0.75rem;line-height:1rem}.s-orders-copy-to-clipboard-button-icon:where([dir="ltr"],[dir="ltr"] *){margin-left:0.25rem}.s-orders-copy-to-clipboard-button-icon:where([dir="rtl"],[dir="rtl"] *){margin-right:0.25rem}@media (min-width: 768px){.s-orders-status-container{margin-left:0px;margin-right:0px}}.s-orders-status-container:where([dir="ltr"],[dir="ltr"] *){margin-left:auto}.s-orders-status-container:where([dir="rtl"],[dir="rtl"] *){margin-right:auto}.s-orders-status-container i{margin-top:0.25rem}.s-orders-status-container i:where([dir="ltr"],[dir="ltr"] *){margin-right:0.25rem}.s-orders-status-container i:where([dir="rtl"],[dir="rtl"] *){margin-left:0.25rem}.s-orders-status-rated{font-size:1.125rem;line-height:1.75rem}.s-orders-status-rated:where([dir="ltr"],[dir="ltr"] *){margin-left:1rem}.s-orders-status-rated:where([dir="rtl"],[dir="rtl"] *){margin-right:1rem}.s-orders-rated-text{--tw-text-opacity:1;color:rgb(251 191 36 / var(--tw-text-opacity, 1))}.s-orders-unrated-text{--tw-text-opacity:1;color:rgb(229 231 235 / var(--tw-text-opacity, 1))}.s-orders-leave-review-btn{display:inline-flex;flex-shrink:0;align-items:center;gap:0.25rem;font-weight:700;color:var(--color-primary);transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-orders-leave-review-btn:hover{opacity:0.7}.s-orders-leave-review-btn:where([dir="ltr"],[dir="ltr"] *){margin-left:1rem}.s-orders-leave-review-btn:where([dir="rtl"],[dir="rtl"] *){margin-right:1rem}.s-orders-review-star-icon{font-size:1.125rem;line-height:1.75rem}.s-orders-no-content{display:flex;height:100%;flex-direction:column;align-items:center;justify-content:center;padding-top:2.5rem;padding-bottom:5rem;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-orders-no-content .icon{margin-bottom:1rem;display:flex;height:8rem;width:8rem;align-items:center;justify-content:center;border-radius:9999px;--tw-bg-opacity:1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1));font-size:3rem;line-height:1;--tw-text-opacity:1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.s-orders-no-content p{margin-bottom:1rem;font-size:1rem;line-height:1.5rem;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-orders-filters{margin-bottom:1rem;display:flex;flex-wrap:wrap;align-items:center;gap:0.5rem}.s-orders-list-wrapper{position:relative}.s-orders-list-loading{position:absolute;inset:0px;z-index:10;display:flex;align-items:center;justify-content:center;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1));--tw-bg-opacity:0.1}.s-orders-table{min-width:100%;border-collapse:separate}@media (min-width: 768px){.s-orders-table{margin-bottom:-0.75rem;--tw-border-spacing-y:1.25rem;border-spacing:var(--tw-border-spacing-x) var(--tw-border-spacing-y)}}.s-orders-table-fetching{pointer-events:none;opacity:0.4;transition-property:opacity;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:200ms}.s-orders-table-head{margin-bottom:1.25rem;display:none;--tw-bg-opacity:1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}@media (min-width: 768px){.s-orders-table-head{display:table-header-group}}.s-orders-table-head-tr-th{padding-left:1.5rem;padding-right:1.5rem;text-align:start;font-size:0.875rem;line-height:1.25rem;font-weight:500;text-transform:uppercase;letter-spacing:0.05em}.s-orders-table-head-tr-th:where([dir="ltr"],[dir="ltr"] *){text-align:left}.s-orders-table-head-tr-th:last-child:where([dir="ltr"],[dir="ltr"] *){text-align:right}.s-orders-table-head-tr-th:where([dir="rtl"],[dir="rtl"] *){text-align:right}.s-orders-table-head-tr-th:last-child:where([dir="rtl"],[dir="rtl"] *){text-align:left}.s-orders-table-tbody-tr{position:relative;display:flex;flex-direction:row;flex-wrap:wrap;overflow:hidden;border-radius:var(--s-radius, 0.25rem);border-bottom-width:8px;border-top-width:8px;--tw-border-opacity:1;border-color:rgb(249 250 251 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding:0.5rem;transition-property:box-shadow;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:500ms}@media (min-width: 768px){.s-orders-table-tbody-tr{display:table-row;flex-direction:row;flex-wrap:nowrap;padding:0px}}.s-orders-table-tbody-tr-shadow:hover{box-shadow:5px 10px 30px #2b2d340d}.s-orders-table-tbody-tr-td{width:100%;white-space:nowrap;font-size:0.875rem;line-height:1.25rem}.s-orders-table-tbody-tr-td:first-child{font-weight:700}@media (min-width: 768px){.s-orders-table-tbody-tr-td{height:5rem;width:auto}.s-orders-table-tbody-tr-td:last-child{text-align:end}.s-orders-table-tbody-tr-td:first-child:where([dir="ltr"],[dir="ltr"] *){border-top-left-radius:0.375rem;border-bottom-left-radius:0.375rem}.s-orders-table-tbody-tr-td:first-child:where([dir="rtl"],[dir="rtl"] *){border-top-right-radius:0.375rem;border-bottom-right-radius:0.375rem}}.s-orders-table-tbody-tr-td:first-child{font-weight:700}.s-orders-table-tbody-tr-td-content{position:relative;display:flex;align-items:center;justify-content:space-between;padding-left:0.5rem;padding-right:0.5rem;padding-top:0.25rem;padding-bottom:0.25rem}@media (min-width: 768px){.s-orders-table-tbody-tr-td-content{padding-left:1.5rem;padding-right:1.5rem;padding-top:1.5rem;padding-bottom:1.5rem}}.s-orders-table-tbody-tr a{position:absolute;top:0px;bottom:0px;display:block;width:100%}.s-orders-table-tbody-tr a:where([dir="ltr"],[dir="ltr"] *){left:0px}.s-orders-table-tbody-tr a:where([dir="rtl"],[dir="rtl"] *){right:0px}/*!twlt*/.s-button-btn{position:relative;display:inline-flex;flex:1 1 0%;user-select:none;flex-direction:row-reverse;align-items:center;justify-content:center;white-space:nowrap;border-radius:var(--s-radius, 0.25rem);border-style:solid;padding-left:1.5rem;padding-right:1.5rem;padding-bottom:0.625rem;padding-top:0.5rem;font-size:0.875rem;line-height:1.25rem;font-weight:700;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-button-btn:hover{opacity:0.8}.s-button-primary{border-width:1px;border-color:var(--color-primary);background-color:var(--color-primary);color:var(--color-primary-reverse)}.s-button-primary:hover{background-color:var(--color-primary-dark)}.s-button-text{pointer-events:none;align-items:center;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;transition-property:opacity;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-button-loader{margin-left:0.5rem;margin-right:0.5rem;display:flex;align-items:center;justify-content:center;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}.s-button-loader::before{display:inline-block;height:1rem;content:var(--tw-content);width:1rem}@keyframes spin{to{content:var(--tw-content);transform:rotate(360deg)}}.s-button-loader::before{animation:spin 1s linear infinite;border-radius:9999px;border-width:2px;border-style:solid;border-top-color:var(--color-primary);border-left-color:var(--color-primary);border-bottom-color:rgb(243 244 246 / var(--tw-border-opacity, 1));--tw-border-opacity:1;border-right-color:rgb(243 244 246 / var(--tw-border-opacity, 1));--tw-content:\'\';content:var(--tw-content)}.s-button-loader-center .s-button-loader{position:absolute;top:50%;left:50%;margin:0px !important;--tw-translate-y:-50%;--tw-translate-x:-50%;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.s-comments-item-like-btn .s-button-text{display:flex;flex-direction:row-reverse;gap:0.5rem}.s-infinite-scroll-wrapper{margin-top:1rem;text-align:center}.s-infinite-scroll-last{margin:0px;text-align:center}.s-infinite-scroll-error{margin:0px;text-align:center}@keyframes s-fade-in-up{from{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}.s-animate-fade-in-up{animation:s-fade-in-up 1200ms cubic-bezier(0.16, 1, 0.3, 1) both}';export{l as salla_orders}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as e,h as t,F as i}from"./p-3xfbOSPM.js";const r=class{constructor(t){e(this,t),this.source="header",this.useReactLink=!1,this.menus=[],this.displayAllText=""}async componentWillLoad(){return salla.onReady((()=>{if(this.displayAllText=salla.lang.get("blocks.home.display_all"),!this.sourceValue||"json"!==this.source)return this.getMenuItems();this.menus="string"==typeof this.sourceValue?JSON.parse(this.sourceValue):this.sourceValue||[]}))}getMenuItems(){return salla.api.component.getMenus(this.source).then((async({data:e})=>{this.menus=e,await salla.hooks.call("salla-menu","afterFetchMenuItems",this)})).catch((e=>{salla.logger.error("salla-menu::Error fetching menus",e)}))}hasChildren(e){return e?.children?.length>0}hasProducts(e){return e?.products?.length>0}getDesktopClasses(e,t){return`s-menu-desktop-item !hidden lg:!block ${t?"root-level s-menu-root-level lg:!inline-block":"s-menu-non-root-level relative"} ${e.products?" mega-menu s-menu-mega-menu":""}\n ${this.hasChildren(e)?"has-children s-menu-has-children":""}`}getAttributes(e){return e.trim().split(" ").reduce(((e,t)=>{let[i,r]=t.split("=");return e[i]=r.replace(/"/g,""),e}),{})}getMobileMenu(e,r){const n=e.image?t("img",{src:e.image,class:"s-menu-category-image rounded-full",width:"48",height:"48",alt:e.title}):null;return t("li",{class:"s-menu-mobile-item lg:hidden text-sm font-bold",...this.getAttributes(e.attrs)},this.hasChildren(e)?t(i,null,t("span",{class:e.image?"s-menu-title-with-image !py-3":""},n,e.title),t("ul",null,t("li",{class:"s-menu-mobile-sub-menu-item text-sm font-bold"},t("a",{href:e.url,class:"s-menu-mobile-link text-gray-500"},r)),e.children.map((e=>this.getMobileMenu(e,r))))):t("a",{href:e.url,"aria-label":e.title||"category",class:"s-menu-mobile-link text-gray-500 "+(e.image?"s-menu-title-with-image !py-3":""),...this.getAttributes(e.link_attrs)},n,t("span",null,e.title||"")))}getDesktopMenu(e,i){return t("li",{class:this.getDesktopClasses(e,i),...this.getAttributes(e.attrs)},t("a",{href:e.url,"aria-label":e.title||"category",...this.getAttributes(e.link_attrs)},t("span",null,e.title)),this.hasChildren(e)?t("div",{class:"sub-menu s-menu-sub-menu shadow-default "+(this.hasProducts(e)?"s-menu-sub-menu-with-product w-full left-0 flex":"s-menu-sub-menu-without-product w-56")},t("ul",{class:this.hasProducts(e)?"s-menu-sub-menu-unordered-list w-56 shrink-0 m-8 rtl:ml-0 ltr:mr-0":""},e.children.map((e=>this.getDesktopMenu(e,!1)))),this.hasProducts(e)?t("div",{class:"s-menu-products-wrapper"},t("salla-products-list",{source:"selected","shadow-on-hover":!0,"source-value":`[${e.products}]`})):null):null)}getFooterMenu(e){const i=this.topnav||this.limit?e.slice(0,this.limit||3):e;return t("div",null,t("div",{class:{"s-menu-footer-list":!this.topnav,"s-menu-topnav-list":this.topnav}},i.map((e=>t("a",{key:e.id,href:e.url,target:e.target,class:{"s-menu-footer-item":!this.topnav,"s-menu-topnav-item topnav-link-item right-side":this.topnav},...e.callback?{onClick:e.callback}:{}},e.title)))))}getHeaderMenu(e){return e.map((e=>[this.getMobileMenu(e,this.displayAllText),this.getDesktopMenu(e,!0)]))}render(){return"footer"===this.source?this.getFooterMenu(this.menus):[t("nav",{key:"main-nav",id:"mobile-menu",class:"mobile-menu"},t("ul",{class:"main-menu"},this.getHeaderMenu(this.menus)),t("button",{class:"btn--close close-mobile-menu sicon-cancel lg:hidden"})),t("button",{key:"close-btn",class:"btn--close-sm close-mobile-menu sicon-cancel hidden"})]}};r.style='/*!twlt*/:host{display:block}.relative{position:relative}.left-0{left:0px}.m-8{margin:2rem}.flex{display:flex}.\\!hidden{display:none !important}.hidden{display:none}.w-56{width:14rem}.w-full{width:100%}.shrink-0{flex-shrink:0}.rounded-full{border-radius:9999px}.\\!py-3{padding-top:0.75rem !important;padding-bottom:0.75rem !important}.text-sm{font-size:0.875rem;line-height:1.25rem}.font-bold{font-weight:700}.text-gray-500{--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.shadow-default{--tw-shadow:5px 10px 30px #2B2D340D;--tw-shadow-colored:5px 10px 30px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.s-menu-item{display:none !important}@media (min-width: 1024px){.s-menu-item{display:block !important}.s-menu-root-level{display:inline-block !important}}.s-menu-non-root-level{position:relative}.s-menu-products-container{display:grid;grid-template-columns:repeat(4, minmax(0, 1fr));gap:1rem}.s-menu-submenu-unordered-list{margin:2rem;width:14rem;flex-shrink:0}.s-menu-submenu-unordered-list:where([dir="ltr"],[dir="ltr"] *){margin-right:0px}.s-menu-submenu-unordered-list:where([dir="rtl"],[dir="rtl"] *){margin-left:0px}.s-menu-submenu-with-product{left:0px;display:flex;width:100%}.s-menu-submenu-without-product{width:14rem}.s-menu-desktop-item{display:none !important}@media (min-width: 1024px){.s-menu-desktop-item{display:block !important}}.s-menu-sub-menu-with-product{left:0px;display:flex;width:100%}.s-menu-sub-menu-without-product{width:14rem}.s-menu-sub-menu-unordered-list{margin:2rem;width:14rem;flex-shrink:0}.s-menu-sub-menu-unordered-list:where([dir="ltr"],[dir="ltr"] *){margin-right:0px}.s-menu-sub-menu-unordered-list:where([dir="rtl"],[dir="rtl"] *){margin-left:0px}.s-menu-mobile-item{font-size:0.875rem;line-height:1.25rem;font-weight:700}@media (min-width: 1024px){.s-menu-mobile-item{display:none}}.s-menu-mobile-sub-menu-item{font-size:0.875rem;line-height:1.25rem;font-weight:700}.s-menu-mobile-link{--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-menu-category-image{border-radius:9999px}.s-menu-title-with-image{padding-top:0.75rem !important;padding-bottom:0.75rem !important}.s-menu-footer-item{margin-bottom:1.25rem;display:block;font-size:0.875rem;line-height:1.25rem;line-height:1}.s-menu-footer-item:last-child{margin-bottom:0px}.s-menu-topnav-list{display:none;align-items:center;white-space:nowrap}@media (min-width: 1024px){.s-menu-topnav-list{display:flex}}.s-menu-topnav-list:where([dir="ltr"],[dir="ltr"] *){padding-right:1rem}.s-menu-topnav-list:where([dir="rtl"],[dir="rtl"] *){padding-left:1rem}.s-menu-topnav-item{display:inline-block;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));padding-left:1rem;padding-right:1rem;padding-top:1px;padding-bottom:1px;font-size:0.875rem;line-height:1.25rem;line-height:1;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-menu-topnav-item:hover{opacity:0.8}.s-menu-topnav-item:where([dir="ltr"],[dir="ltr"] *){border-right-width:1px}.s-menu-topnav-item:first-child:where([dir="ltr"],[dir="ltr"] *){padding-left:0px}.s-menu-topnav-item:last-child:where([dir="ltr"],[dir="ltr"] *){border-width:0px;padding-right:0px}.s-menu-topnav-item:where([dir="rtl"],[dir="rtl"] *){border-left-width:1px}.s-menu-topnav-item:first-child:where([dir="rtl"],[dir="rtl"] *){padding-right:0px}.s-menu-topnav-item:last-child:where([dir="rtl"],[dir="rtl"] *){border-width:0px;padding-left:0px}@media (min-width: 1024px){.lg\\:\\!block{display:block !important}.lg\\:\\!inline-block{display:inline-block !important}.lg\\:hidden{display:none}}.ltr\\:mr-0:where([dir="ltr"],[dir="ltr"] *){margin-right:0px}.rtl\\:ml-0:where([dir="rtl"],[dir="rtl"] *){margin-left:0px}';export{r as salla_menu}
4
+ import{r as e,h as t,F as i}from"./p-lS_doykN.js";const r=class{constructor(t){e(this,t),this.source="header",this.useReactLink=!1,this.menus=[],this.displayAllText=""}async componentWillLoad(){return salla.onReady((()=>{if(this.displayAllText=salla.lang.get("blocks.home.display_all"),!this.sourceValue||"json"!==this.source)return this.getMenuItems();this.menus="string"==typeof this.sourceValue?JSON.parse(this.sourceValue):this.sourceValue||[]}))}getMenuItems(){return salla.api.component.getMenus(this.source).then((async({data:e})=>{this.menus=e,await salla.hooks.call("salla-menu","afterFetchMenuItems",this)})).catch((e=>{salla.logger.error("salla-menu::Error fetching menus",e)}))}hasChildren(e){return e?.children?.length>0}hasProducts(e){return e?.products?.length>0}getDesktopClasses(e,t){return`s-menu-desktop-item !hidden lg:!block ${t?"root-level s-menu-root-level lg:!inline-block":"s-menu-non-root-level relative"} ${e.products?" mega-menu s-menu-mega-menu":""}\n ${this.hasChildren(e)?"has-children s-menu-has-children":""}`}getAttributes(e){return e.trim().split(" ").reduce(((e,t)=>{let[i,r]=t.split("=");return e[i]=r.replace(/"/g,""),e}),{})}getMobileMenu(e,r){const n=e.image?t("img",{src:e.image,class:"s-menu-category-image rounded-full",width:"48",height:"48",alt:e.title}):null;return t("li",{class:"s-menu-mobile-item lg:hidden text-sm font-bold",...this.getAttributes(e.attrs)},this.hasChildren(e)?t(i,null,t("span",{class:e.image?"s-menu-title-with-image !py-3":""},n,e.title),t("ul",null,t("li",{class:"s-menu-mobile-sub-menu-item text-sm font-bold"},t("a",{href:e.url,class:"s-menu-mobile-link text-gray-500"},r)),e.children.map((e=>this.getMobileMenu(e,r))))):t("a",{href:e.url,"aria-label":e.title||"category",class:"s-menu-mobile-link text-gray-500 "+(e.image?"s-menu-title-with-image !py-3":""),...this.getAttributes(e.link_attrs)},n,t("span",null,e.title||"")))}getDesktopMenu(e,i){return t("li",{class:this.getDesktopClasses(e,i),...this.getAttributes(e.attrs)},t("a",{href:e.url,"aria-label":e.title||"category",...this.getAttributes(e.link_attrs)},t("span",null,e.title)),this.hasChildren(e)?t("div",{class:"sub-menu s-menu-sub-menu shadow-default "+(this.hasProducts(e)?"s-menu-sub-menu-with-product w-full left-0 flex":"s-menu-sub-menu-without-product w-56")},t("ul",{class:this.hasProducts(e)?"s-menu-sub-menu-unordered-list w-56 shrink-0 m-8 rtl:ml-0 ltr:mr-0":""},e.children.map((e=>this.getDesktopMenu(e,!1)))),this.hasProducts(e)?t("div",{class:"s-menu-products-wrapper"},t("salla-products-list",{source:"selected","shadow-on-hover":!0,"source-value":`[${e.products}]`})):null):null)}getFooterMenu(e){const i=this.topnav||this.limit?e.slice(0,this.limit||3):e;return t("div",null,t("div",{class:{"s-menu-footer-list":!this.topnav,"s-menu-topnav-list":this.topnav}},i.map((e=>t("a",{key:e.id,href:e.url,target:e.target,class:{"s-menu-footer-item":!this.topnav,"s-menu-topnav-item topnav-link-item right-side":this.topnav},...e.callback?{onClick:e.callback}:{}},e.title)))))}getHeaderMenu(e){return e.map((e=>[this.getMobileMenu(e,this.displayAllText),this.getDesktopMenu(e,!0)]))}render(){return"footer"===this.source?this.getFooterMenu(this.menus):[t("nav",{key:"main-nav",id:"mobile-menu",class:"mobile-menu"},t("ul",{class:"main-menu"},this.getHeaderMenu(this.menus)),t("button",{class:"btn--close close-mobile-menu sicon-cancel lg:hidden"})),t("button",{key:"close-btn",class:"btn--close-sm close-mobile-menu sicon-cancel hidden"})]}};r.style='/*!twlt*/:host{display:block}.relative{position:relative}.left-0{left:0px}.m-8{margin:2rem}.flex{display:flex}.\\!hidden{display:none !important}.hidden{display:none}.w-56{width:14rem}.w-full{width:100%}.shrink-0{flex-shrink:0}.rounded-full{border-radius:9999px}.\\!py-3{padding-top:0.75rem !important;padding-bottom:0.75rem !important}.text-sm{font-size:0.875rem;line-height:1.25rem}.font-bold{font-weight:700}.text-gray-500{--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.shadow-default{--tw-shadow:5px 10px 30px #2B2D340D;--tw-shadow-colored:5px 10px 30px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.s-menu-item{display:none !important}@media (min-width: 1024px){.s-menu-item{display:block !important}.s-menu-root-level{display:inline-block !important}}.s-menu-non-root-level{position:relative}.s-menu-products-container{display:grid;grid-template-columns:repeat(4, minmax(0, 1fr));gap:1rem}.s-menu-submenu-unordered-list{margin:2rem;width:14rem;flex-shrink:0}.s-menu-submenu-unordered-list:where([dir="ltr"],[dir="ltr"] *){margin-right:0px}.s-menu-submenu-unordered-list:where([dir="rtl"],[dir="rtl"] *){margin-left:0px}.s-menu-submenu-with-product{left:0px;display:flex;width:100%}.s-menu-submenu-without-product{width:14rem}.s-menu-desktop-item{display:none !important}@media (min-width: 1024px){.s-menu-desktop-item{display:block !important}}.s-menu-sub-menu-with-product{left:0px;display:flex;width:100%}.s-menu-sub-menu-without-product{width:14rem}.s-menu-sub-menu-unordered-list{margin:2rem;width:14rem;flex-shrink:0}.s-menu-sub-menu-unordered-list:where([dir="ltr"],[dir="ltr"] *){margin-right:0px}.s-menu-sub-menu-unordered-list:where([dir="rtl"],[dir="rtl"] *){margin-left:0px}.s-menu-mobile-item{font-size:0.875rem;line-height:1.25rem;font-weight:700}@media (min-width: 1024px){.s-menu-mobile-item{display:none}}.s-menu-mobile-sub-menu-item{font-size:0.875rem;line-height:1.25rem;font-weight:700}.s-menu-mobile-link{--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-menu-category-image{border-radius:9999px}.s-menu-title-with-image{padding-top:0.75rem !important;padding-bottom:0.75rem !important}.s-menu-footer-item{margin-bottom:1.25rem;display:block;font-size:0.875rem;line-height:1.25rem;line-height:1}.s-menu-footer-item:last-child{margin-bottom:0px}.s-menu-topnav-list{display:none;align-items:center;white-space:nowrap}@media (min-width: 1024px){.s-menu-topnav-list{display:flex}}.s-menu-topnav-list:where([dir="ltr"],[dir="ltr"] *){padding-right:1rem}.s-menu-topnav-list:where([dir="rtl"],[dir="rtl"] *){padding-left:1rem}.s-menu-topnav-item{display:inline-block;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));padding-left:1rem;padding-right:1rem;padding-top:1px;padding-bottom:1px;font-size:0.875rem;line-height:1.25rem;line-height:1;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-menu-topnav-item:hover{opacity:0.8}.s-menu-topnav-item:where([dir="ltr"],[dir="ltr"] *){border-right-width:1px}.s-menu-topnav-item:first-child:where([dir="ltr"],[dir="ltr"] *){padding-left:0px}.s-menu-topnav-item:last-child:where([dir="ltr"],[dir="ltr"] *){border-width:0px;padding-right:0px}.s-menu-topnav-item:where([dir="rtl"],[dir="rtl"] *){border-left-width:1px}.s-menu-topnav-item:first-child:where([dir="rtl"],[dir="rtl"] *){padding-right:0px}.s-menu-topnav-item:last-child:where([dir="rtl"],[dir="rtl"] *){border-width:0px;padding-left:0px}@media (min-width: 1024px){.lg\\:\\!block{display:block !important}.lg\\:\\!inline-block{display:inline-block !important}.lg\\:hidden{display:none}}.ltr\\:mr-0:where([dir="ltr"],[dir="ltr"] *){margin-right:0px}.rtl\\:ml-0:where([dir="rtl"],[dir="rtl"] *){margin-left:0px}';export{r as salla_menu}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as e,h as r,H as t}from"./p-3xfbOSPM.js";import{s}from"./p-BQHBj1u_.js";import{m as i,a as o}from"./p-DfHdQUMm.js";const a=class{constructor(r){e(this,r),this.items=[],this.collapsed=!0,this.list=[],this.langVersion=0}connectedCallback(){this.langUnsubscribe=salla.lang.subscribe((()=>this.langVersion++))}disconnectedCallback(){this.langUnsubscribe?.()}componentWillLoad(){this.parseItems(this.items)}parseItems(e){try{const r="string"==typeof e?JSON.parse(e):e;this.list=Array.isArray(r)?r:[]}catch{this.list=[]}}get collapsedText(){if(this.collapsedTitle)return this.collapsedTitle;const e=this.list.reduce(((e,r)=>e+(Number(r.quantity)||1)),0),r=1===e?salla.lang.get("common.elements.product"):salla.lang.get("pages.orders.items"),t=`${salla.helpers.number(e)} ${r}`;return this.summary?`${t} • ${this.summary}`:t}renderThumbs(){const e=this.list.slice(0,2),t=this.list.length-e.length;return r("span",{class:"s-order-items-thumbs"},e.map((e=>r("span",{class:"s-order-items-thumb"},e.image?r("img",{src:e.image,alt:e.name}):e.name?.charAt(0)))),t>0?r("span",{class:"s-order-items-thumb"},"+",salla.helpers.number(t)):null)}price(e){const r=e.price;if(null==r||""===r)return{};const t=Number("object"==typeof r&&r?r.amount:r);return Number.isFinite(t)?{html:i(t,"object"==typeof r&&r.currency||this.currency)}:"string"==typeof r?{text:r}:{}}renderItem(e){const t=s(e.url),i=this.price(e);return r("div",{class:"s-order-items-item"},r("span",{class:"s-order-items-image"},e.image?r("img",{src:e.image,alt:e.name}):null),r("div",{class:"s-order-items-text"},t?r("a",{href:t,class:"s-order-items-name",title:e.name},e.name):r("span",{class:"s-order-items-name",title:e.name},e.name),i.html?r("span",{class:"s-order-items-price",innerHTML:i.html}):null,i.text?r("span",{class:"s-order-items-price",innerHTML:o(i.text)}):null),null!=e.quantity?r("span",{class:"s-order-items-qty"},salla.helpers.number(e.quantity)):null)}render(){return r(t,{key:"0caddaf962003684a67ff5d2439dff7fa14b029b",class:"s-order-items-wrapper"},r("div",{key:"c4bf86751dd8f20b83d99e2f95d0a25ac5acceee",class:"s-order-items-card"},r("button",{key:"c10ab197715c6a5b022ace0b5c4ba06d278ebe6b",type:"button",class:"s-order-items-header","aria-expanded":String(!this.collapsed),onClick:()=>this.collapsed=!this.collapsed},r("span",{key:"f5823e5f5c9f4f5c256ff096532e179247d8478b",class:"s-order-items-summary"},this.collapsed?this.renderThumbs():null,r("span",{key:"b6c13d062907133880923c5051d33bb255a0110f",class:"s-order-items-title"},this.collapsed?this.collapsedText:this.cardTitle||this.collapsedText),this.collapsed&&this.logo?r("img",{class:"s-order-items-logo",src:this.logo,alt:""}):null),r("span",{key:"80c62df6872eda47081b2b012ed1adfcf0fd69b4",class:"s-order-items-toggle","aria-hidden":"true"},r("i",{key:"d733ae71fef343d66ebccbc8a83f332d795aed81",class:"hgi-stroke "+(this.collapsed?"hgi-unfold-more":"hgi-unfold-less")}))),r("div",{key:"b0fbfef920006e7908db84966eba7994a83b85ca",class:"s-order-items-list",hidden:this.collapsed},this.list.map((e=>this.renderItem(e)))),r("div",{key:"48e9bf8d2317a3d36456d11ab5503bf6f0322e2a",class:"s-order-items-footer",hidden:this.collapsed},r("slot",{key:"4d7783a95ba0e0cda4759f5e3c965257e66ef1ab",name:"footer"}))))}static get watchers(){return{items:["parseItems"]}}};a.style="/*!twlt*/:host{display:block}.hidden{display:none}.s-order-items-wrapper{display:block}.s-order-items-card{display:flex;flex-direction:column;gap:1.5rem;border-radius:0.5rem;border-width:1px;border-color:var(--color-border-light,#f4f4f4);background-color:var(--color-surface,#fff);padding:0.75rem}.s-order-items-header{display:flex;width:100%;cursor:pointer;align-items:center;gap:0.5rem;border-width:0px;background-color:transparent;padding:0px;text-align:start}.s-order-items-title{min-width:0px;flex:1 1 0%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:0.875rem;line-height:1.25rem;font-weight:700;color:var(--color-primary)}.s-order-items-header[aria-expanded='false'] .s-order-items-title{text-align:end;font-size:0.75rem;line-height:1rem;color:var(--color-primary)}.s-order-items-summary{display:flex;min-width:0px;flex:1 1 0%;align-items:center;gap:0.5rem}.s-order-items-thumbs{display:flex;flex-shrink:0;align-items:center}.s-order-items-thumbs>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(-0.75rem * var(--tw-space-x-reverse));margin-left:calc(-0.75rem * calc(1 - var(--tw-space-x-reverse)))}.s-order-items-thumbs:where([dir=\"rtl\"],[dir=\"rtl\"] *)>:not([hidden])~:not([hidden]){--tw-space-x-reverse:1}.s-order-items-thumb{display:inline-flex;height:2.75rem;width:2.75rem;align-items:center;justify-content:center;overflow:hidden;border-radius:0.75rem;border-width:1px;border-color:var(--color-border-light,#f4f4f4);background-color:var(--color-surface,#fff);font-size:0.75rem;line-height:1rem;font-weight:500;color:var(--color-text-secondary,#666)}.s-order-items-thumb img{display:block;height:100%;width:100%;object-fit:cover}.s-order-items-toggle{display:inline-flex;height:1.25rem;width:1.25rem;flex-shrink:0;align-items:center;justify-content:center;color:var(--color-primary-dark)}.s-order-items-toggle i{font-size:1rem;line-height:1.5rem;line-height:1}.s-order-items-list{display:flex;flex-direction:column;gap:1rem}.s-order-items-item{display:flex;align-items:flex-start;gap:0.75rem}.s-order-items-image{display:inline-flex;height:2.75rem;width:2.75rem;flex-shrink:0;align-items:center;justify-content:center;overflow:hidden;border-radius:0.75rem;border-width:1px;border-color:var(--color-border-light,#f4f4f4)}.s-order-items-image img{display:block;height:100%;width:100%;object-fit:cover}.s-order-items-text{display:flex;min-width:0px;flex:1 1 0%;flex-direction:column;gap:0.25rem;font-size:0.75rem;line-height:1rem;color:var(--color-text-primary,#333)}.s-order-items-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:currentColor;text-decoration-line:none}.s-order-items-qty{display:inline-flex;height:1.5rem;width:1.5rem;flex-shrink:0;align-items:center;justify-content:center;border-radius:9999px;border-width:1px;border-color:var(--color-border-light,#f4f4f4);background-color:var(--color-surface-secondary,#fcfcfc);font-size:0.75rem;line-height:1rem}.s-order-items-footer{border-top-width:1px;border-color:var(--color-border-light,#f4f4f4);padding-top:1.5rem}.s-order-items-footer:empty{display:none}.s-order-items-list[hidden]{display:none}.s-order-items-footer[hidden]{display:none}.s-order-items-logo{height:2rem;width:2rem;flex-shrink:0;border-radius:0.5rem;border-width:1px;border-color:var(--color-border,#eee);object-fit:contain;padding:1px}.s-thank-you-page-wrapper .s-order-items-card{padding:1rem}@media (min-width: 640px){.s-thank-you-page-wrapper .s-order-items-card{padding:1.5rem}}.s-thank-you-page-wrapper .s-order-items-title{font-size:1rem;line-height:1.5rem}.s-thank-you-page-wrapper .s-order-items-header[aria-expanded='false'] .s-order-items-title{font-size:0.875rem;line-height:1.25rem}.s-thank-you-page-wrapper .s-order-items-text,.s-thank-you-page-wrapper .s-order-items-qty{font-size:0.875rem;line-height:1.25rem}.s-thank-you-page-wrapper .s-order-items-toggle i{font-size:1.25rem;line-height:1.75rem}.s-thank-you-page-wrapper .s-order-items-header{min-height:2.75rem;gap:0.75rem}";export{a as salla_order_items}
4
+ import{r as e,h as r,H as t}from"./p-lS_doykN.js";import{s}from"./p-BQHBj1u_.js";import{m as i,a as o}from"./p-DfHdQUMm.js";const a=class{constructor(r){e(this,r),this.items=[],this.collapsed=!0,this.list=[],this.langVersion=0}connectedCallback(){this.langUnsubscribe=salla.lang.subscribe((()=>this.langVersion++))}disconnectedCallback(){this.langUnsubscribe?.()}componentWillLoad(){this.parseItems(this.items)}parseItems(e){try{const r="string"==typeof e?JSON.parse(e):e;this.list=Array.isArray(r)?r:[]}catch{this.list=[]}}get collapsedText(){if(this.collapsedTitle)return this.collapsedTitle;const e=this.list.reduce(((e,r)=>e+(Number(r.quantity)||1)),0),r=1===e?salla.lang.get("common.elements.product"):salla.lang.get("pages.orders.items"),t=`${salla.helpers.number(e)} ${r}`;return this.summary?`${t} • ${this.summary}`:t}renderThumbs(){const e=this.list.slice(0,2),t=this.list.length-e.length;return r("span",{class:"s-order-items-thumbs"},e.map((e=>r("span",{class:"s-order-items-thumb"},e.image?r("img",{src:e.image,alt:e.name}):e.name?.charAt(0)))),t>0?r("span",{class:"s-order-items-thumb"},"+",salla.helpers.number(t)):null)}price(e){const r=e.price;if(null==r||""===r)return{};const t=Number("object"==typeof r&&r?r.amount:r);return Number.isFinite(t)?{html:i(t,"object"==typeof r&&r.currency||this.currency)}:"string"==typeof r?{text:r}:{}}renderItem(e){const t=s(e.url),i=this.price(e);return r("div",{class:"s-order-items-item"},r("span",{class:"s-order-items-image"},e.image?r("img",{src:e.image,alt:e.name}):null),r("div",{class:"s-order-items-text"},t?r("a",{href:t,class:"s-order-items-name",title:e.name},e.name):r("span",{class:"s-order-items-name",title:e.name},e.name),i.html?r("span",{class:"s-order-items-price",innerHTML:i.html}):null,i.text?r("span",{class:"s-order-items-price",innerHTML:o(i.text)}):null),null!=e.quantity?r("span",{class:"s-order-items-qty"},salla.helpers.number(e.quantity)):null)}render(){return r(t,{key:"0caddaf962003684a67ff5d2439dff7fa14b029b",class:"s-order-items-wrapper"},r("div",{key:"c4bf86751dd8f20b83d99e2f95d0a25ac5acceee",class:"s-order-items-card"},r("button",{key:"c10ab197715c6a5b022ace0b5c4ba06d278ebe6b",type:"button",class:"s-order-items-header","aria-expanded":String(!this.collapsed),onClick:()=>this.collapsed=!this.collapsed},r("span",{key:"f5823e5f5c9f4f5c256ff096532e179247d8478b",class:"s-order-items-summary"},this.collapsed?this.renderThumbs():null,r("span",{key:"b6c13d062907133880923c5051d33bb255a0110f",class:"s-order-items-title"},this.collapsed?this.collapsedText:this.cardTitle||this.collapsedText),this.collapsed&&this.logo?r("img",{class:"s-order-items-logo",src:this.logo,alt:""}):null),r("span",{key:"80c62df6872eda47081b2b012ed1adfcf0fd69b4",class:"s-order-items-toggle","aria-hidden":"true"},r("i",{key:"d733ae71fef343d66ebccbc8a83f332d795aed81",class:"hgi-stroke "+(this.collapsed?"hgi-unfold-more":"hgi-unfold-less")}))),r("div",{key:"b0fbfef920006e7908db84966eba7994a83b85ca",class:"s-order-items-list",hidden:this.collapsed},this.list.map((e=>this.renderItem(e)))),r("div",{key:"48e9bf8d2317a3d36456d11ab5503bf6f0322e2a",class:"s-order-items-footer",hidden:this.collapsed},r("slot",{key:"4d7783a95ba0e0cda4759f5e3c965257e66ef1ab",name:"footer"}))))}static get watchers(){return{items:["parseItems"]}}};a.style="/*!twlt*/:host{display:block}.hidden{display:none}.s-order-items-wrapper{display:block}.s-order-items-card{display:flex;flex-direction:column;gap:1.5rem;border-radius:0.5rem;border-width:1px;border-color:var(--color-border-light,#f4f4f4);background-color:var(--color-surface,#fff);padding:0.75rem}.s-order-items-header{display:flex;width:100%;cursor:pointer;align-items:center;gap:0.5rem;border-width:0px;background-color:transparent;padding:0px;text-align:start}.s-order-items-title{min-width:0px;flex:1 1 0%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:0.875rem;line-height:1.25rem;font-weight:700;color:var(--color-primary)}.s-order-items-header[aria-expanded='false'] .s-order-items-title{text-align:end;font-size:0.75rem;line-height:1rem;color:var(--color-primary)}.s-order-items-summary{display:flex;min-width:0px;flex:1 1 0%;align-items:center;gap:0.5rem}.s-order-items-thumbs{display:flex;flex-shrink:0;align-items:center}.s-order-items-thumbs>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(-0.75rem * var(--tw-space-x-reverse));margin-left:calc(-0.75rem * calc(1 - var(--tw-space-x-reverse)))}.s-order-items-thumbs:where([dir=\"rtl\"],[dir=\"rtl\"] *)>:not([hidden])~:not([hidden]){--tw-space-x-reverse:1}.s-order-items-thumb{display:inline-flex;height:2.75rem;width:2.75rem;align-items:center;justify-content:center;overflow:hidden;border-radius:0.75rem;border-width:1px;border-color:var(--color-border-light,#f4f4f4);background-color:var(--color-surface,#fff);font-size:0.75rem;line-height:1rem;font-weight:500;color:var(--color-text-secondary,#666)}.s-order-items-thumb img{display:block;height:100%;width:100%;object-fit:cover}.s-order-items-toggle{display:inline-flex;height:1.25rem;width:1.25rem;flex-shrink:0;align-items:center;justify-content:center;color:var(--color-primary-dark)}.s-order-items-toggle i{font-size:1rem;line-height:1.5rem;line-height:1}.s-order-items-list{display:flex;flex-direction:column;gap:1rem}.s-order-items-item{display:flex;align-items:flex-start;gap:0.75rem}.s-order-items-image{display:inline-flex;height:2.75rem;width:2.75rem;flex-shrink:0;align-items:center;justify-content:center;overflow:hidden;border-radius:0.75rem;border-width:1px;border-color:var(--color-border-light,#f4f4f4)}.s-order-items-image img{display:block;height:100%;width:100%;object-fit:cover}.s-order-items-text{display:flex;min-width:0px;flex:1 1 0%;flex-direction:column;gap:0.25rem;font-size:0.75rem;line-height:1rem;color:var(--color-text-primary,#333)}.s-order-items-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:currentColor;text-decoration-line:none}.s-order-items-qty{display:inline-flex;height:1.5rem;width:1.5rem;flex-shrink:0;align-items:center;justify-content:center;border-radius:9999px;border-width:1px;border-color:var(--color-border-light,#f4f4f4);background-color:var(--color-surface-secondary,#fcfcfc);font-size:0.75rem;line-height:1rem}.s-order-items-footer{border-top-width:1px;border-color:var(--color-border-light,#f4f4f4);padding-top:1.5rem}.s-order-items-footer:empty{display:none}.s-order-items-list[hidden]{display:none}.s-order-items-footer[hidden]{display:none}.s-order-items-logo{height:2rem;width:2rem;flex-shrink:0;border-radius:0.5rem;border-width:1px;border-color:var(--color-border,#eee);object-fit:contain;padding:1px}.s-thank-you-page-wrapper .s-order-items-card{padding:1rem}@media (min-width: 640px){.s-thank-you-page-wrapper .s-order-items-card{padding:1.5rem}}.s-thank-you-page-wrapper .s-order-items-title{font-size:1rem;line-height:1.5rem}.s-thank-you-page-wrapper .s-order-items-header[aria-expanded='false'] .s-order-items-title{font-size:0.875rem;line-height:1.25rem}.s-thank-you-page-wrapper .s-order-items-text,.s-thank-you-page-wrapper .s-order-items-qty{font-size:0.875rem;line-height:1.25rem}.s-thank-you-page-wrapper .s-order-items-toggle i{font-size:1.25rem;line-height:1.75rem}.s-thank-you-page-wrapper .s-order-items-header{min-height:2.75rem;gap:0.75rem}";export{a as salla_order_items}
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{d as i}from"./p-3xfbOSPM.js";function n(i,n){return n.forEach((function(n){n&&"string"!=typeof n&&!Array.isArray(n)&&Object.keys(n).forEach((function(t){if("default"!==t&&!(t in i)){var e=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(i,t,e.get?e:{enumerable:!0,get:function(){return n[t]}})}}))})),Object.freeze(i)}var t,e,o,E={exports:{}},r=t?E.exports:(t=1,E.exports=(e=function(i){return/^image/.test(i.type)},o=function(i){var n=i.addFilter,t=i.utils,o=t.Type,E=t.createRoute,r=t.createItemAPI,l=void 0===r?function(i){return i}:r,_=i.views.fileActionButton;n("SHOULD_REMOVE_ON_REVERT",(function(i,n){var t=n.item,o=n.query;return new Promise((function(i){var n=t.file;i(!(o("GET_ALLOW_IMAGE_EDIT")&&o("GET_IMAGE_EDIT_ALLOW_EDIT")&&e(n)))}))})),n("DID_LOAD_ITEM",(function(i,n){var t=n.query,o=n.dispatch;return new Promise((function(n,E){if(i.origin>1)n(i);else{var r=i.file;if(t("GET_ALLOW_IMAGE_EDIT")&&t("GET_IMAGE_EDIT_INSTANT_EDIT"))if(e(r)){var l=function(i,n,t){return function(e){a.shift(),e?n(i):t(i),o("KICK"),_()}},_=function(){if(a.length){var i=a[0],n=i.item;o("EDIT_ITEM",{id:n.id,handleEditorResponse:l(n,i.resolve,i.reject)})}};f({item:i,resolve:n,reject:E}),1===a.length&&_()}else n(i);else n(i)}}))})),n("DID_CREATE_ITEM",(function(i,n){var t=n.dispatch;i.extend("edit",(function(){t("EDIT_ITEM",{id:i.id})}))}));var a=[],f=function(i){return a.push(i),i};return n("CREATE_VIEW",(function(i){var n=i.is,t=i.view,o=i.query;if(o("GET_ALLOW_IMAGE_EDIT")){var r=o("GET_ALLOW_IMAGE_PREVIEW");if(n("file-info")&&!r||n("file")&&r){var a=o("GET_IMAGE_EDIT_EDITOR");if(a){a.filepondCallbackBridge||(a.outputData=!0,a.outputFile=!1,a.filepondCallbackBridge={onconfirm:a.onconfirm||function(){},oncancel:a.oncancel||function(){}});t.registerDestroyer((function(i){var n=i.root;n.ref.buttonEditItem&&n.ref.buttonEditItem.off("click",n.ref.handleEdit),n.ref.editButton&&n.ref.editButton.removeEventListener("click",n.ref.handleEdit)}));var f={EDIT_ITEM:function(i){var n=i.root,t=i.props.id,e=i.action.handleEditorResponse;a.cropAspectRatio=n.query("GET_IMAGE_CROP_ASPECT_RATIO")||a.cropAspectRatio,a.outputCanvasBackgroundColor=n.query("GET_IMAGE_TRANSFORM_CANVAS_BACKGROUND_COLOR")||a.outputCanvasBackgroundColor;var o=n.query("GET_ITEM",t);if(o){var E=o.file,r=o.getMetadata("crop"),_=o.getMetadata("resize"),f=o.getMetadata("filter")||null,u=o.getMetadata("filters")||null,I=o.getMetadata("colors")||null,c=o.getMetadata("markup")||null,T={crop:r||{center:{x:.5,y:.5},flip:{horizontal:!1,vertical:!1},zoom:1,rotation:0,aspectRatio:null},size:_?{upscale:_.upscale,mode:_.mode,width:_.size.width,height:_.size.height}:null,filter:u?u.id||u.matrix:n.query("GET_ALLOW_IMAGE_FILTER")&&n.query("GET_IMAGE_FILTER_COLOR_MATRIX")&&!I?f:null,color:I,markup:c};a.onconfirm=function(i){var n=i.data,t=n.crop,E=n.size,r=n.filter,_=n.color,f=n.colorMatrix,u=n.markup,I={};if(t&&(I.crop=t),E){var c=(o.getMetadata("resize")||{}).size,T={width:E.width,height:E.height};T.width&&T.height||!c||(T.width=c.width,T.height=c.height),(T.width||T.height)&&(I.resize={upscale:E.upscale,mode:E.mode,size:T})}u&&(I.markup=u),I.colors=_,I.filters=r,I.filter=f,o.setMetadata(I),a.filepondCallbackBridge.onconfirm(n,l(o)),e&&(a.onclose=function(){e(!0),a.onclose=null})},a.oncancel=function(){a.filepondCallbackBridge.oncancel(l(o)),e&&(a.onclose=function(){e(!1),a.onclose=null})},a.open(E,T)}},DID_LOAD_ITEM:function(i){var n=i.root,E=i.props;if(o("GET_IMAGE_EDIT_ALLOW_EDIT")){var l=E.id,a=o("GET_ITEM",l);if(a&&e(a.file))if(n.ref.handleEdit=function(i){i.stopPropagation(),n.dispatch("EDIT_ITEM",{id:l})},r){var f=t.createChildView(_,{label:"edit",icon:o("GET_IMAGE_EDIT_ICON_EDIT"),opacity:0});f.element.classList.add("filepond--action-edit-item"),f.element.dataset.align=o("GET_STYLE_IMAGE_EDIT_BUTTON_EDIT_ITEM_POSITION"),f.on("click",n.ref.handleEdit),n.ref.buttonEditItem=t.appendChildView(f)}else{var u=t.element.querySelector(".filepond--file-info-main"),I=document.createElement("button");I.className="filepond--action-edit-item-alt",I.innerHTML=o("GET_IMAGE_EDIT_ICON_EDIT")+"<span>edit</span>",I.addEventListener("click",n.ref.handleEdit),u.appendChild(I),n.ref.editButton=I}}}};r&&(f.DID_IMAGE_PREVIEW_SHOW=function(i){var n=i.root;n.ref.buttonEditItem&&(n.ref.buttonEditItem.opacity=1)}),t.registerWriter(E(f))}}}})),{options:{allowImageEdit:[!0,o.BOOLEAN],styleImageEditButtonEditItemPosition:["bottom center",o.STRING],imageEditInstantEdit:[!1,o.BOOLEAN],imageEditAllowEdit:[!0,o.BOOLEAN],imageEditIconEdit:['<svg width="26" height="26" viewBox="0 0 26 26" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M8.5 17h1.586l7-7L15.5 8.414l-7 7V17zm-1.707-2.707l8-8a1 1 0 0 1 1.414 0l3 3a1 1 0 0 1 0 1.414l-8 8A1 1 0 0 1 10.5 19h-3a1 1 0 0 1-1-1v-3a1 1 0 0 1 .293-.707z" fill="currentColor" fill-rule="nonzero"/></svg>',o.STRING],imageEditEditor:[null,o.OBJECT]}}},"undefined"!=typeof window&&void 0!==window.document&&document.dispatchEvent(new CustomEvent("FilePond:pluginloaded",{detail:o})),o)),l=n({__proto__:null,default:i(r)},[r]);
4
+ import{d as i}from"./p-lS_doykN.js";function n(i,n){return n.forEach((function(n){n&&"string"!=typeof n&&!Array.isArray(n)&&Object.keys(n).forEach((function(t){if("default"!==t&&!(t in i)){var e=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(i,t,e.get?e:{enumerable:!0,get:function(){return n[t]}})}}))})),Object.freeze(i)}var t,e,o,E={exports:{}},r=t?E.exports:(t=1,E.exports=(e=function(i){return/^image/.test(i.type)},o=function(i){var n=i.addFilter,t=i.utils,o=t.Type,E=t.createRoute,r=t.createItemAPI,l=void 0===r?function(i){return i}:r,_=i.views.fileActionButton;n("SHOULD_REMOVE_ON_REVERT",(function(i,n){var t=n.item,o=n.query;return new Promise((function(i){var n=t.file;i(!(o("GET_ALLOW_IMAGE_EDIT")&&o("GET_IMAGE_EDIT_ALLOW_EDIT")&&e(n)))}))})),n("DID_LOAD_ITEM",(function(i,n){var t=n.query,o=n.dispatch;return new Promise((function(n,E){if(i.origin>1)n(i);else{var r=i.file;if(t("GET_ALLOW_IMAGE_EDIT")&&t("GET_IMAGE_EDIT_INSTANT_EDIT"))if(e(r)){var l=function(i,n,t){return function(e){a.shift(),e?n(i):t(i),o("KICK"),_()}},_=function(){if(a.length){var i=a[0],n=i.item;o("EDIT_ITEM",{id:n.id,handleEditorResponse:l(n,i.resolve,i.reject)})}};u({item:i,resolve:n,reject:E}),1===a.length&&_()}else n(i);else n(i)}}))})),n("DID_CREATE_ITEM",(function(i,n){var t=n.dispatch;i.extend("edit",(function(){t("EDIT_ITEM",{id:i.id})}))}));var a=[],u=function(i){return a.push(i),i};return n("CREATE_VIEW",(function(i){var n=i.is,t=i.view,o=i.query;if(o("GET_ALLOW_IMAGE_EDIT")){var r=o("GET_ALLOW_IMAGE_PREVIEW");if(n("file-info")&&!r||n("file")&&r){var a=o("GET_IMAGE_EDIT_EDITOR");if(a){a.filepondCallbackBridge||(a.outputData=!0,a.outputFile=!1,a.filepondCallbackBridge={onconfirm:a.onconfirm||function(){},oncancel:a.oncancel||function(){}});t.registerDestroyer((function(i){var n=i.root;n.ref.buttonEditItem&&n.ref.buttonEditItem.off("click",n.ref.handleEdit),n.ref.editButton&&n.ref.editButton.removeEventListener("click",n.ref.handleEdit)}));var u={EDIT_ITEM:function(i){var n=i.root,t=i.props.id,e=i.action.handleEditorResponse;a.cropAspectRatio=n.query("GET_IMAGE_CROP_ASPECT_RATIO")||a.cropAspectRatio,a.outputCanvasBackgroundColor=n.query("GET_IMAGE_TRANSFORM_CANVAS_BACKGROUND_COLOR")||a.outputCanvasBackgroundColor;var o=n.query("GET_ITEM",t);if(o){var E=o.file,r=o.getMetadata("crop"),_=o.getMetadata("resize"),u=o.getMetadata("filter")||null,f=o.getMetadata("filters")||null,I=o.getMetadata("colors")||null,c=o.getMetadata("markup")||null,T={crop:r||{center:{x:.5,y:.5},flip:{horizontal:!1,vertical:!1},zoom:1,rotation:0,aspectRatio:null},size:_?{upscale:_.upscale,mode:_.mode,width:_.size.width,height:_.size.height}:null,filter:f?f.id||f.matrix:n.query("GET_ALLOW_IMAGE_FILTER")&&n.query("GET_IMAGE_FILTER_COLOR_MATRIX")&&!I?u:null,color:I,markup:c};a.onconfirm=function(i){var n=i.data,t=n.crop,E=n.size,r=n.filter,_=n.color,u=n.colorMatrix,f=n.markup,I={};if(t&&(I.crop=t),E){var c=(o.getMetadata("resize")||{}).size,T={width:E.width,height:E.height};T.width&&T.height||!c||(T.width=c.width,T.height=c.height),(T.width||T.height)&&(I.resize={upscale:E.upscale,mode:E.mode,size:T})}f&&(I.markup=f),I.colors=_,I.filters=r,I.filter=u,o.setMetadata(I),a.filepondCallbackBridge.onconfirm(n,l(o)),e&&(a.onclose=function(){e(!0),a.onclose=null})},a.oncancel=function(){a.filepondCallbackBridge.oncancel(l(o)),e&&(a.onclose=function(){e(!1),a.onclose=null})},a.open(E,T)}},DID_LOAD_ITEM:function(i){var n=i.root,E=i.props;if(o("GET_IMAGE_EDIT_ALLOW_EDIT")){var l=E.id,a=o("GET_ITEM",l);if(a&&e(a.file))if(n.ref.handleEdit=function(i){i.stopPropagation(),n.dispatch("EDIT_ITEM",{id:l})},r){var u=t.createChildView(_,{label:"edit",icon:o("GET_IMAGE_EDIT_ICON_EDIT"),opacity:0});u.element.classList.add("filepond--action-edit-item"),u.element.dataset.align=o("GET_STYLE_IMAGE_EDIT_BUTTON_EDIT_ITEM_POSITION"),u.on("click",n.ref.handleEdit),n.ref.buttonEditItem=t.appendChildView(u)}else{var f=t.element.querySelector(".filepond--file-info-main"),I=document.createElement("button");I.className="filepond--action-edit-item-alt",I.innerHTML=o("GET_IMAGE_EDIT_ICON_EDIT")+"<span>edit</span>",I.addEventListener("click",n.ref.handleEdit),f.appendChild(I),n.ref.editButton=I}}}};r&&(u.DID_IMAGE_PREVIEW_SHOW=function(i){var n=i.root;n.ref.buttonEditItem&&(n.ref.buttonEditItem.opacity=1)}),t.registerWriter(E(u))}}}})),{options:{allowImageEdit:[!0,o.BOOLEAN],styleImageEditButtonEditItemPosition:["bottom center",o.STRING],imageEditInstantEdit:[!1,o.BOOLEAN],imageEditAllowEdit:[!0,o.BOOLEAN],imageEditIconEdit:['<svg width="26" height="26" viewBox="0 0 26 26" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M8.5 17h1.586l7-7L15.5 8.414l-7 7V17zm-1.707-2.707l8-8a1 1 0 0 1 1.414 0l3 3a1 1 0 0 1 0 1.414l-8 8A1 1 0 0 1 10.5 19h-3a1 1 0 0 1-1-1v-3a1 1 0 0 1 .293-.707z" fill="currentColor" fill-rule="nonzero"/></svg>',o.STRING],imageEditEditor:[null,o.OBJECT]}}},"undefined"!=typeof window&&void 0!==window.document&&document.dispatchEvent(new CustomEvent("FilePond:pluginloaded",{detail:o})),o)),l=n({__proto__:null,default:i(r)},[r]);
5
5
  /*!
6
6
  * FilePondPluginImageEdit 1.6.3
7
7
  * Licensed under MIT, https://opensource.org/licenses/MIT/
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{d as t}from"./p-3xfbOSPM.js";function n(t,n){return n.forEach((function(n){n&&"string"!=typeof n&&!Array.isArray(n)&&Object.keys(n).forEach((function(e){if("default"!==e&&!(e in t)){var r=Object.getOwnPropertyDescriptor(n,e);Object.defineProperty(t,e,r.get?r:{enumerable:!0,get:function(){return n[e]}})}}))})),Object.freeze(t)}var e,r={exports:{}},i=(e||(e=1,r.exports=function(){var t={type:"spring",stiffness:.5,damping:.45,mass:10},n=function(t){return-.5*(Math.cos(Math.PI*t)-1)},e=function(t){var n=Math.min(10/t.width,10/t.height),e=document.createElement("canvas"),i=e.getContext("2d"),o=e.width=Math.ceil(t.width*n),a=e.height=Math.ceil(t.height*n);i.drawImage(t,0,0,o,a);var _=null;try{_=i.getImageData(0,0,o,a).data}catch(t){return null}for(var E=_.length,u=0,I=0,c=0,T=0;T<E;T+=4)u+=_[T]*_[T],I+=_[T+1]*_[T+1],c+=_[T+2]*_[T+2];return{r:u=r(u,E),g:I=r(I,E),b:c=r(c,E)}},r=function(t,n){return Math.floor(Math.sqrt(t/(n/4)))},i=function(t,e,r,i,o){t.width=e,t.height=r;var a=t.getContext("2d"),_=.5*e,E=a.createRadialGradient(_,r+110,r-100,_,r+110,r+100);(function(t,e){for(var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:n,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:10,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,_=1-a,E=e.join(","),u=0;u<=o;u++){var I=u/o;t.addColorStop(a+_*I,"rgba(".concat(E,", ").concat(i(I)*r,")"))}})(E,i,o,void 0,8,.4),a.save(),a.translate(-250,0),a.scale(2,1),a.fillStyle=E,a.fillRect(0,0,e,r),a.restore()},o="undefined"!=typeof navigator,a="undefined"!=typeof document,_=500,E=200,u=o&&a&&document.createElement("canvas"),I=o&&a&&document.createElement("canvas"),c=o&&a&&document.createElement("canvas"),T=[40,40,40],f=[196,78,71],l=[54,151,99];o&&a&&(i(u,_,E,T,.85),i(I,_,E,f,1),i(c,_,E,l,1));var s=function(n){var r=n.utils.createView({name:"file-poster-overlay",tag:"canvas",ignoreRect:!0,create:function(t){var n,e;(e=t.root.element).width=(n=t.props.template).width,e.height=n.height,e.getContext("2d").drawImage(n,0,0)},mixins:{styles:["opacity"],animations:{opacity:{type:"spring",mass:25}}}}),o=function(t){var n=t.root;n.ref.overlayShadow.opacity=1,n.ref.overlayError.opacity=0,n.ref.overlaySuccess.opacity=0},a=function(t){var n=t.root;n.ref.overlayShadow.opacity=.25,n.ref.overlayError.opacity=1};return n.utils.createView({name:"file-poster-wrapper",create:function(e){var o=e.root,a=e.props,s=o.query("GET_FILE_POSTER_ITEM_OVERLAY_SHADOW_COLOR"),O=o.query("GET_FILE_POSTER_ITEM_OVERLAY_ERROR_COLOR"),R=o.query("GET_FILE_POSTER_ITEM_OVERLAY_SUCCESS_COLOR");s&&s!==T&&i(u,_,E,T=s,.85),O&&O!==f&&i(I,_,E,f=O,1),R&&R!==l&&i(c,_,E,l=R,1);var v=function(n){return n.utils.createView({name:"file-poster",tag:"div",ignoreRect:!0,create:function(t){var n=t.root;n.ref.image=document.createElement("img"),n.element.appendChild(n.ref.image)},write:n.utils.createRoute({DID_FILE_POSTER_LOAD:function(t){var n=t.root,e=t.props,r=e.id,i=n.query("GET_ITEM",{id:e.id});if(i){var o=i.getMetadata("poster");n.ref.image.src=o,n.dispatch("DID_FILE_POSTER_DRAW",{id:r})}}}),mixins:{styles:["scaleX","scaleY","opacity"],animations:{scaleX:t,scaleY:t,opacity:{type:"tween",duration:750}}}})}(n);o.ref.image=o.appendChildView(o.createChildView(v,{id:a.id,scaleX:1.25,scaleY:1.25,opacity:0})),o.ref.overlayShadow=o.appendChildView(o.createChildView(r,{template:u,opacity:0})),o.ref.overlaySuccess=o.appendChildView(o.createChildView(r,{template:c,opacity:0})),o.ref.overlayError=o.appendChildView(o.createChildView(r,{template:I,opacity:0}))},write:n.utils.createRoute({DID_FILE_POSTER_LOAD:function(t){t.root.ref.overlayShadow.opacity=1},DID_FILE_POSTER_DRAW:function(t){var n=t.root.ref.image;n.scaleX=1,n.scaleY=1,n.opacity=1},DID_FILE_POSTER_CONTAINER_CREATE:function(t){var n,r,i,o=t.root,a=t.props.id,_=o.query("GET_ITEM",a);if(_){var E=_.getMetadata("poster"),u=function(t){var n=o.query("GET_FILE_POSTER_CALCULATE_AVERAGE_IMAGE_COLOR")?e(t):null;_.setMetadata("color",n,!0),o.dispatch("DID_FILE_POSTER_LOAD",{id:a,data:t})};n=E,r=function(t,n){var e,r;o.dispatch("DID_FILE_POSTER_CALCULATE_SIZE",{id:a,width:t,height:n}),(e=E,r=o.query("GET_FILE_POSTER_CROSS_ORIGIN_ATTRIBUTE_VALUE"),new Promise((function(t,n){var i=new Image;"string"==typeof crossOrigin&&(i.crossOrigin=r),i.onload=function(){t(i)},i.onerror=function(t){n(t)},i.src=e}))).then(u)},(i=new Image).onload=function(){var t=i.naturalWidth,n=i.naturalHeight;i=null,r(t,n)},i.src=n}},DID_THROW_ITEM_LOAD_ERROR:a,DID_THROW_ITEM_PROCESSING_ERROR:a,DID_THROW_ITEM_INVALID:a,DID_COMPLETE_ITEM_PROCESSING:function(t){var n=t.root;n.ref.overlayShadow.opacity=.25,n.ref.overlaySuccess.opacity=1},DID_START_ITEM_PROCESSING:o,DID_REVERT_ITEM_PROCESSING:o})})},O=function(t){var n=t.addFilter,e=t.utils,r=e.Type,i=e.createRoute,o=s(t);return n("CREATE_VIEW",(function(t){var n=t.view,e=t.query;if((0,t.is)("file")&&e("GET_ALLOW_FILE_POSTER")){var r=function(t,r){var i=r.id,a=e("GET_ITEM",i);a&&a.getMetadata("poster")&&!a.archived&&t.ref.previousPoster!==a.getMetadata("poster")&&(t.ref.previousPoster=a.getMetadata("poster"),e("GET_FILE_POSTER_FILTER_ITEM")(a)&&(t.ref.filePoster&&n.removeChildView(t.ref.filePoster),t.ref.filePoster=n.appendChildView(n.createChildView(o,{id:i})),t.dispatch("DID_FILE_POSTER_CONTAINER_CREATE",{id:i})))},a=function(t){var n=t.root,e=n.query("GET_FILE_POSTER_HEIGHT");if(e)return e;var r=n.query("GET_FILE_POSTER_MIN_HEIGHT"),i=n.query("GET_FILE_POSTER_MAX_HEIGHT");if(r&&n.ref.imageHeight<r)return r;var o=n.rect.element.width*(n.ref.imageHeight/n.ref.imageWidth);return r&&o<r?r:i&&o>i?i:o};n.registerWriter(i({DID_LOAD_ITEM:function(t){r(t.root,t.props)},DID_FILE_POSTER_CALCULATE_SIZE:function(t){var n=t.root,e=t.action;n.ref.filePoster&&(n.ref.imageWidth=e.width,n.ref.imageHeight=e.height,n.ref.shouldUpdatePanelHeight=!0,n.dispatch("KICK"))},DID_UPDATE_ITEM_METADATA:function(t){var n=t.root,e=t.props;/poster/.test(t.action.change.key)&&r(n,e)}},(function(t){var n=t.root;n.ref.filePoster&&(n.rect.element.hidden||n.ref.shouldUpdatePanelHeight&&(n.dispatch("DID_UPDATE_PANEL_HEIGHT",{id:t.props.id,height:a({root:n})}),n.ref.shouldUpdatePanelHeight=!1))})))}})),{options:{allowFilePoster:[!0,r.BOOLEAN],filePosterHeight:[null,r.INT],filePosterMinHeight:[null,r.INT],filePosterMaxHeight:[null,r.INT],filePosterFilterItem:[function(){return!0},r.FUNCTION],filePosterCalculateAverageImageColor:[!1,r.BOOLEAN],filePosterCrossOriginAttributeValue:["Anonymous",r.STRING],filePosterItemOverlayShadowColor:[null,r.ARRAY],filePosterItemOverlayErrorColor:[null,r.ARRAY],filePosterItemOverlaySuccessColor:[null,r.ARRAY]}}};return"undefined"!=typeof window&&void 0!==window.document&&document.dispatchEvent(new CustomEvent("FilePond:pluginloaded",{detail:O})),O}()),r.exports),o=n({__proto__:null,default:t(i)},[i]);
4
+ import{d as t}from"./p-lS_doykN.js";function n(t,n){return n.forEach((function(n){n&&"string"!=typeof n&&!Array.isArray(n)&&Object.keys(n).forEach((function(e){if("default"!==e&&!(e in t)){var r=Object.getOwnPropertyDescriptor(n,e);Object.defineProperty(t,e,r.get?r:{enumerable:!0,get:function(){return n[e]}})}}))})),Object.freeze(t)}var e,r={exports:{}},i=(e||(e=1,r.exports=function(){var t={type:"spring",stiffness:.5,damping:.45,mass:10},n=function(t){return-.5*(Math.cos(Math.PI*t)-1)},e=function(t){var n=Math.min(10/t.width,10/t.height),e=document.createElement("canvas"),i=e.getContext("2d"),o=e.width=Math.ceil(t.width*n),a=e.height=Math.ceil(t.height*n);i.drawImage(t,0,0,o,a);var _=null;try{_=i.getImageData(0,0,o,a).data}catch(t){return null}for(var E=_.length,u=0,I=0,c=0,T=0;T<E;T+=4)u+=_[T]*_[T],I+=_[T+1]*_[T+1],c+=_[T+2]*_[T+2];return{r:u=r(u,E),g:I=r(I,E),b:c=r(c,E)}},r=function(t,n){return Math.floor(Math.sqrt(t/(n/4)))},i=function(t,e,r,i,o){t.width=e,t.height=r;var a=t.getContext("2d"),_=.5*e,E=a.createRadialGradient(_,r+110,r-100,_,r+110,r+100);(function(t,e){for(var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:n,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:10,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,_=1-a,E=e.join(","),u=0;u<=o;u++){var I=u/o;t.addColorStop(a+_*I,"rgba(".concat(E,", ").concat(i(I)*r,")"))}})(E,i,o,void 0,8,.4),a.save(),a.translate(-250,0),a.scale(2,1),a.fillStyle=E,a.fillRect(0,0,e,r),a.restore()},o="undefined"!=typeof navigator,a="undefined"!=typeof document,_=500,E=200,u=o&&a&&document.createElement("canvas"),I=o&&a&&document.createElement("canvas"),c=o&&a&&document.createElement("canvas"),T=[40,40,40],f=[196,78,71],l=[54,151,99];o&&a&&(i(u,_,E,T,.85),i(I,_,E,f,1),i(c,_,E,l,1));var s=function(n){var r=n.utils.createView({name:"file-poster-overlay",tag:"canvas",ignoreRect:!0,create:function(t){var n,e;(e=t.root.element).width=(n=t.props.template).width,e.height=n.height,e.getContext("2d").drawImage(n,0,0)},mixins:{styles:["opacity"],animations:{opacity:{type:"spring",mass:25}}}}),o=function(t){var n=t.root;n.ref.overlayShadow.opacity=1,n.ref.overlayError.opacity=0,n.ref.overlaySuccess.opacity=0},a=function(t){var n=t.root;n.ref.overlayShadow.opacity=.25,n.ref.overlayError.opacity=1};return n.utils.createView({name:"file-poster-wrapper",create:function(e){var o=e.root,a=e.props,s=o.query("GET_FILE_POSTER_ITEM_OVERLAY_SHADOW_COLOR"),O=o.query("GET_FILE_POSTER_ITEM_OVERLAY_ERROR_COLOR"),R=o.query("GET_FILE_POSTER_ITEM_OVERLAY_SUCCESS_COLOR");s&&s!==T&&i(u,_,E,T=s,.85),O&&O!==f&&i(I,_,E,f=O,1),R&&R!==l&&i(c,_,E,l=R,1);var v=function(n){return n.utils.createView({name:"file-poster",tag:"div",ignoreRect:!0,create:function(t){var n=t.root;n.ref.image=document.createElement("img"),n.element.appendChild(n.ref.image)},write:n.utils.createRoute({DID_FILE_POSTER_LOAD:function(t){var n=t.root,e=t.props,r=e.id,i=n.query("GET_ITEM",{id:e.id});if(i){var o=i.getMetadata("poster");n.ref.image.src=o,n.dispatch("DID_FILE_POSTER_DRAW",{id:r})}}}),mixins:{styles:["scaleX","scaleY","opacity"],animations:{scaleX:t,scaleY:t,opacity:{type:"tween",duration:750}}}})}(n);o.ref.image=o.appendChildView(o.createChildView(v,{id:a.id,scaleX:1.25,scaleY:1.25,opacity:0})),o.ref.overlayShadow=o.appendChildView(o.createChildView(r,{template:u,opacity:0})),o.ref.overlaySuccess=o.appendChildView(o.createChildView(r,{template:c,opacity:0})),o.ref.overlayError=o.appendChildView(o.createChildView(r,{template:I,opacity:0}))},write:n.utils.createRoute({DID_FILE_POSTER_LOAD:function(t){t.root.ref.overlayShadow.opacity=1},DID_FILE_POSTER_DRAW:function(t){var n=t.root.ref.image;n.scaleX=1,n.scaleY=1,n.opacity=1},DID_FILE_POSTER_CONTAINER_CREATE:function(t){var n,r,i,o=t.root,a=t.props.id,_=o.query("GET_ITEM",a);if(_){var E=_.getMetadata("poster"),u=function(t){var n=o.query("GET_FILE_POSTER_CALCULATE_AVERAGE_IMAGE_COLOR")?e(t):null;_.setMetadata("color",n,!0),o.dispatch("DID_FILE_POSTER_LOAD",{id:a,data:t})};n=E,r=function(t,n){var e,r;o.dispatch("DID_FILE_POSTER_CALCULATE_SIZE",{id:a,width:t,height:n}),(e=E,r=o.query("GET_FILE_POSTER_CROSS_ORIGIN_ATTRIBUTE_VALUE"),new Promise((function(t,n){var i=new Image;"string"==typeof crossOrigin&&(i.crossOrigin=r),i.onload=function(){t(i)},i.onerror=function(t){n(t)},i.src=e}))).then(u)},(i=new Image).onload=function(){var t=i.naturalWidth,n=i.naturalHeight;i=null,r(t,n)},i.src=n}},DID_THROW_ITEM_LOAD_ERROR:a,DID_THROW_ITEM_PROCESSING_ERROR:a,DID_THROW_ITEM_INVALID:a,DID_COMPLETE_ITEM_PROCESSING:function(t){var n=t.root;n.ref.overlayShadow.opacity=.25,n.ref.overlaySuccess.opacity=1},DID_START_ITEM_PROCESSING:o,DID_REVERT_ITEM_PROCESSING:o})})},O=function(t){var n=t.addFilter,e=t.utils,r=e.Type,i=e.createRoute,o=s(t);return n("CREATE_VIEW",(function(t){var n=t.view,e=t.query;if((0,t.is)("file")&&e("GET_ALLOW_FILE_POSTER")){var r=function(t,r){var i=r.id,a=e("GET_ITEM",i);a&&a.getMetadata("poster")&&!a.archived&&t.ref.previousPoster!==a.getMetadata("poster")&&(t.ref.previousPoster=a.getMetadata("poster"),e("GET_FILE_POSTER_FILTER_ITEM")(a)&&(t.ref.filePoster&&n.removeChildView(t.ref.filePoster),t.ref.filePoster=n.appendChildView(n.createChildView(o,{id:i})),t.dispatch("DID_FILE_POSTER_CONTAINER_CREATE",{id:i})))},a=function(t){var n=t.root,e=n.query("GET_FILE_POSTER_HEIGHT");if(e)return e;var r=n.query("GET_FILE_POSTER_MIN_HEIGHT"),i=n.query("GET_FILE_POSTER_MAX_HEIGHT");if(r&&n.ref.imageHeight<r)return r;var o=n.rect.element.width*(n.ref.imageHeight/n.ref.imageWidth);return r&&o<r?r:i&&o>i?i:o};n.registerWriter(i({DID_LOAD_ITEM:function(t){r(t.root,t.props)},DID_FILE_POSTER_CALCULATE_SIZE:function(t){var n=t.root,e=t.action;n.ref.filePoster&&(n.ref.imageWidth=e.width,n.ref.imageHeight=e.height,n.ref.shouldUpdatePanelHeight=!0,n.dispatch("KICK"))},DID_UPDATE_ITEM_METADATA:function(t){var n=t.root,e=t.props;/poster/.test(t.action.change.key)&&r(n,e)}},(function(t){var n=t.root;n.ref.filePoster&&(n.rect.element.hidden||n.ref.shouldUpdatePanelHeight&&(n.dispatch("DID_UPDATE_PANEL_HEIGHT",{id:t.props.id,height:a({root:n})}),n.ref.shouldUpdatePanelHeight=!1))})))}})),{options:{allowFilePoster:[!0,r.BOOLEAN],filePosterHeight:[null,r.INT],filePosterMinHeight:[null,r.INT],filePosterMaxHeight:[null,r.INT],filePosterFilterItem:[function(){return!0},r.FUNCTION],filePosterCalculateAverageImageColor:[!1,r.BOOLEAN],filePosterCrossOriginAttributeValue:["Anonymous",r.STRING],filePosterItemOverlayShadowColor:[null,r.ARRAY],filePosterItemOverlayErrorColor:[null,r.ARRAY],filePosterItemOverlaySuccessColor:[null,r.ARRAY]}}};return"undefined"!=typeof window&&void 0!==window.document&&document.dispatchEvent(new CustomEvent("FilePond:pluginloaded",{detail:O})),O}()),r.exports),o=n({__proto__:null,default:t(i)},[i]);
5
5
  /*!
6
6
  * FilePondPluginFilePoster 2.5.2
7
7
  * Licensed under MIT, https://opensource.org/licenses/MIT/
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{d as A}from"./p-3xfbOSPM.js";function n(A,n){return n.forEach((function(n){n&&"string"!=typeof n&&!Array.isArray(n)&&Object.keys(n).forEach((function(e){if("default"!==e&&!(e in A)){var r=Object.getOwnPropertyDescriptor(n,e);Object.defineProperty(A,e,r.get?r:{enumerable:!0,get:function(){return n[e]}})}}))})),Object.freeze(A)}var e,r={exports:{}},i=(e||(e=1,r.exports=function(){var A=65496,n=65505,e=1165519206,r=18761,i=274,t=65280,o=function(A,n){return A.getUint16(n,arguments.length>2&&void 0!==arguments[2]&&arguments[2])},a=function(A,n){return A.getUint32(n,arguments.length>2&&void 0!==arguments[2]&&arguments[2])},f="undefined"!=typeof window&&void 0!==window.document,u=void 0,d=f?new Image:{};d.onload=function(){return u=d.naturalWidth>d.naturalHeight},d.src="data:image/jpg;base64,/9j/4AAQSkZJRgABAQEASABIAAD/4QA6RXhpZgAATU0AKgAAAAgAAwESAAMAAAABAAYAAAEoAAMAAAABAAIAAAITAAMAAAABAAEAAAAAAAD/2wBDAP//////////////////////////////////////////////////////////////////////////////////////wAALCAABAAIBASIA/8QAJgABAAAAAAAAAAAAAAAAAAAAAxABAAAAAAAAAAAAAAAAAAAAAP/aAAgBAQAAPwBH/9k=";var c=function(f){var d=f.utils,c=d.Type,v=d.isFile;return(0,f.addFilter)("DID_LOAD_ITEM",(function(f,d){var c=d.query;return new Promise((function(d){var w=f.file;if(!(v(w)&&function(A){return/^image\/jpeg/.test(A.type)}(w)&&c("GET_ALLOW_IMAGE_EXIF_ORIENTATION")&&u))return d(f);(function(f){return new Promise((function(u){var d=new FileReader;d.onload=function(f){var d=new DataView(f.target.result);if(o(d,0)===A){for(var c=d.byteLength,v=2;v<c;){var w=o(d,v);if(v+=2,w===n){if(a(d,v+=2)!==e)break;var g=o(d,v+=6)===r;v+=a(d,v+4,g);var l=o(d,v,g);v+=2;for(var p=0;p<l;p++)if(o(d,v+12*p,g)===i)return void u(o(d,v+12*p+8,g))}else{if((w&t)!==t)break;v+=o(d,v)}}u(-1)}else u(-1)},d.readAsArrayBuffer(f.slice(0,65536))}))})(w).then((function(A){f.setMetadata("exif",{orientation:A}),d(f)}))}))})),{options:{allowImageExifOrientation:[!0,c.BOOLEAN]}}};return"undefined"!=typeof window&&void 0!==window.document&&document.dispatchEvent(new CustomEvent("FilePond:pluginloaded",{detail:c})),c}()),r.exports),t=n({__proto__:null,default:A(i)},[i]);
4
+ import{d as A}from"./p-lS_doykN.js";function n(A,n){return n.forEach((function(n){n&&"string"!=typeof n&&!Array.isArray(n)&&Object.keys(n).forEach((function(e){if("default"!==e&&!(e in A)){var r=Object.getOwnPropertyDescriptor(n,e);Object.defineProperty(A,e,r.get?r:{enumerable:!0,get:function(){return n[e]}})}}))})),Object.freeze(A)}var e,r={exports:{}},i=(e||(e=1,r.exports=function(){var A=65496,n=65505,e=1165519206,r=18761,i=274,t=65280,o=function(A,n){return A.getUint16(n,arguments.length>2&&void 0!==arguments[2]&&arguments[2])},a=function(A,n){return A.getUint32(n,arguments.length>2&&void 0!==arguments[2]&&arguments[2])},u="undefined"!=typeof window&&void 0!==window.document,f=void 0,d=u?new Image:{};d.onload=function(){return f=d.naturalWidth>d.naturalHeight},d.src="data:image/jpg;base64,/9j/4AAQSkZJRgABAQEASABIAAD/4QA6RXhpZgAATU0AKgAAAAgAAwESAAMAAAABAAYAAAEoAAMAAAABAAIAAAITAAMAAAABAAEAAAAAAAD/2wBDAP//////////////////////////////////////////////////////////////////////////////////////wAALCAABAAIBASIA/8QAJgABAAAAAAAAAAAAAAAAAAAAAxABAAAAAAAAAAAAAAAAAAAAAP/aAAgBAQAAPwBH/9k=";var c=function(u){var d=u.utils,c=d.Type,v=d.isFile;return(0,u.addFilter)("DID_LOAD_ITEM",(function(u,d){var c=d.query;return new Promise((function(d){var w=u.file;if(!(v(w)&&function(A){return/^image\/jpeg/.test(A.type)}(w)&&c("GET_ALLOW_IMAGE_EXIF_ORIENTATION")&&f))return d(u);(function(u){return new Promise((function(f){var d=new FileReader;d.onload=function(u){var d=new DataView(u.target.result);if(o(d,0)===A){for(var c=d.byteLength,v=2;v<c;){var w=o(d,v);if(v+=2,w===n){if(a(d,v+=2)!==e)break;var g=o(d,v+=6)===r;v+=a(d,v+4,g);var l=o(d,v,g);v+=2;for(var p=0;p<l;p++)if(o(d,v+12*p,g)===i)return void f(o(d,v+12*p+8,g))}else{if((w&t)!==t)break;v+=o(d,v)}}f(-1)}else f(-1)},d.readAsArrayBuffer(u.slice(0,65536))}))})(w).then((function(A){u.setMetadata("exif",{orientation:A}),d(u)}))}))})),{options:{allowImageExifOrientation:[!0,c.BOOLEAN]}}};return"undefined"!=typeof window&&void 0!==window.document&&document.dispatchEvent(new CustomEvent("FilePond:pluginloaded",{detail:c})),c}()),r.exports),t=n({__proto__:null,default:A(i)},[i]);
5
5
  /*!
6
6
  * FilePondPluginImageExifOrientation 1.0.11
7
7
  * Licensed under MIT, https://opensource.org/licenses/MIT/
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import"./p-3xfbOSPM.js";var e,t;!function(e){e.VALUES="values",e.VARIANTS="variants",e.MINIMUM="minimum",e.RANGE="range"}(e||(e={})),function(e){e.VALUES="values",e.VARIANT="variants",e.RANGE="range"}(t||(t={})),"undefined"!=typeof salla&&salla.event.setMaxListeners(100);var a=new class{constructor(){this.plans={0:"basic",25:"plus",50:"pro",100:"special"}}setIncludes(e){return this.includes=e,this}toggleElementClassIf(e,t,a,r){t=Array.isArray(t)?t:t.split(" "),a=Array.isArray(a)?a:a.split(" ");let s=r(e);return e?.classList.remove(...s?a:t),e?.classList.add(...s?t:a),this}toggleClassIf(e,t,a,r){return document.querySelectorAll(e).forEach((e=>this.toggleElementClassIf(e,t,a,r))),this}isValidEmail(e){return/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(String(e).toLowerCase())}filterEmojies(e){return e.replace(/(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff]|[\u0023-\u0039]\ufe0f?\u20e3|\u3299|\u3297|\u303d|\u3030|\u24c2|\ud83c[\udd70-\udd71]|\ud83c[\udd7e-\udd7f]|\ud83c\udd8e|\ud83c[\udd91-\udd9a]|\ud83c[\udde6-\uddff]|\ud83c[\ude01-\ude02]|\ud83c\ude1a|\ud83c\ude2f|\ud83c[\ude32-\ude3a]|\ud83c[\ude50-\ude51]|\u203c|\u2049|[\u25aa-\u25ab]|\u25b6|\u25c0|[\u25fb-\u25fe]|\u00a9|\u00ae|\u2122|\u2139|\ud83c\udc04|[\u2600-\u26FF]|\u2b05|\u2b06|\u2b07|\u2b1b|\u2b1c|\u2b50|\u2b55|\u231a|\u231b|\u2328|\u23cf|[\u23e9-\u23f3]|[\u23f8-\u23fa]|\ud83c\udccf|\u2934|\u2935|[\u2190-\u21ff])/g,"")}debounce(e,...t){return this.debounce_||(this.debounce_=salla.helpers.debounce(((e,...t)=>e(...t)),500)),this.debounce_(e,...t)}getProductsSource(e){return{"brands.single":"brands","product.index":"categories","product.index.latest":"latest","product.index.offers":"offers","product.index.search":"search","customer.wishlist":"wishlist","landing-page":"landing-page","product.index.tag":"tags","product.index.sales":"sales","components.most_sales_products":"sales"}[e||salla.config.get("page.slug")]||e||"latest"}getApiSource(e){return{recently:"selected"}[e]||e}getPageTitleForSource(e){return(e={brands:"common.titles.brands",latest:"blocks.home.latest_products",offers:"common.titles.discounts",reorder:"common.titles.products",sales:"common.titles.most_sales"}[e])?salla.lang.get(e):""}getProductsSourceValue(e,t){const a=this.getProductsSource(e);let r=null;if(t)try{r="string"==typeof t?JSON.parse(t):t}catch(e){console.error("Failed to parse JSON string in sourceValue:",e)}if(!["search","json","offers","latest","sales","related"].includes(a)){if(Array.isArray(r)&&r.length)return r;if(Array.isArray(r)&&!r.length)return"";if("number"==typeof r)return[r];if(!t&&["categories","tags","brands"].includes(e))return[salla.config.get("page.id")]}return r||t?r||t:"search"===a?"undefined"!=typeof window&&new URLSearchParams(window.location.search).get("q")||"":salla.config.get("page.id")}extractFiltersFromUrl(e){let t={};return e.forEach(((e,a)=>{const r=a.match(/^filters\[(.*?)\](\[(.*?)\])?$/u);if(r){const a=r[1],s=r[3];""===s||/^\d+$/.test(s)?(t[a]=Array.isArray(t[a])?t[a]:[],t[a].push(e)):s?(t[a]=t[a]||{},t[a][s]=e):t[a]=e}else{const r=a.match(/^(.*?)$/u);r&&(t[r[1]]=e)}})),t}resolveFilterLabels(t){return t.map((t=>{const a={...t};if(a.label={category_id:salla.lang.get("common.titles.categories"),brand_id:salla.lang.get("common.titles.brands"),rating:salla.lang.get("pages.categories.filter_rating"),price:salla.lang.get("pages.categories.filter_price")}[a.key]||a.label,"rating"==a.key){a.type=e.VALUES;const{max:r,min:s}=t.values;a.values=[5,4,3,2,1].filter((e=>e>=s||e<=r))}return a}))}async injectExtraFieldsToResponse(e){if(!e||!this.includes)return e;const t=e.data.map((e=>e.id));try{const{data:a}=await this.fetchImagesAndOptions(t);if(this.injectOptionsAndImages(e.data,a),!this.includes.includes("metadata"))return e;const r=await salla.api.metadata.fetchValues("product",t);return e.data.forEach((e=>{e.metadata=r.data.find((t=>parseInt(t.entity_id)===parseInt((e.id||"").toString())))})),e}catch(e){throw console.error("Error in injectExtraFieldsToResponse:",e),e}}fetchImagesAndOptions(e){return this.productsIncludes().length?salla.api.product.fetchOptions(e,{with:this.productsIncludes()}):Promise.resolve({data:[]})}injectOptionsAndImages(e,t){return t.length?e.map((e=>(this.includes.filter((e=>"metadata"!==e)).forEach((a=>{const r=t.find((t=>parseInt((t.id||"").toString())===parseInt((e.id||"").toString())));e[a]=r?r[a]:null})),e))):null}productsIncludes(){return this.includes?.filter((e=>"metadata"!=e))}saveSource(e,t){if(t)try{sessionStorage.setItem(e,t)}catch(e){salla.logger.warn("Error saving source to session storage")}}saveProductSource(e){this.saveSource("s-viewed-source",e)}saveProductPosition(e){if(null!=e&&""!==e)try{sessionStorage.setItem("s-viewed-position",String(e))}catch(e){salla.logger.warn("Error saving position to session storage")}}saveRequestId(e){if(e)try{sessionStorage.setItem("s-request-id",e)}catch(e){salla.logger.warn("Error saving request id to session storage")}}saveAddToCartSource(e){this.saveSource("s-add-to-cart-source",e)}parseJson(e){if("string"!=typeof e)return e;try{return JSON.parse(e)}catch(e){salla.logger.error("Failed to parse includes as JSON:",e)}return null}getProductSchemaMarkupScript(e){const t=document.createElement("script");return t.type="application/ld+json",t.text=JSON.stringify({"@context":"http://schema.org","@type":"Product",name:e?.name,image:e?.image?.url||e?.thumbnail,description:e?.description,brand:{"@type":"Brand",logo:e?.brand?.logo},offers:{"@type":"Offer",price:e?.price}}),t}createProductSchema(e,t){let a={productID:`${e.id}`,"@type":"Product",name:e.name,url:e.url,image:e.image.url||e.image,description:e.description||e.subtitle||e.name,...e.sku&&e.sku.length>0&&{sku:e.sku},offers:{"@type":"Offer",url:e.url,priceCurrency:e.currency,price:e.price,itemCondition:"NewCondition",availability:e.is_available?"InStock":"OutOfStock",priceValidUntil:e.discount_ends||new Date((new Date).setDate((new Date).getDate()+7)).toISOString().split("T")[0],priceSpecification:{"@type":"PriceSpecification",price:e.regular_price,priceCurrency:e.currency,valueAddedTaxIncluded:e.is_taxable},seller:{"@type":"Organization",name:salla.config.get("store.name")},shippingDetails:{"@type":"OfferShippingDetails",shippingRate:{"@type":"MonetaryAmount",value:"0",currency:e.currency||"SAR"},deliveryTime:{"@type":"ShippingDeliveryTime",businessDays:{"@type":"OpeningHoursSpecification",dayOfWeek:["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"]},cutoffTime:"14:00"}},hasMerchantReturnPolicy:{"@type":"MerchantReturnPolicy",returnPolicyCategory:"https://schema.org/MerchantReturnFiniteReturnWindow",merchantReturnDays:30,returnMethod:"https://schema.org/ReturnByMail",returnFees:"https://schema.org/FreeReturn"}}};return e.rating?.stars&&(a.aggregateRating={"@type":"AggregateRating",ratingValue:e.rating.stars,reviewCount:e.rating.count}),{"@type":"ListItem",position:t,item:a}}generateProductSchema(e){const t="salla-product-schema-script";if(document.getElementById(t))return void salla.logger.warn(`already added schema-script with id (${t})!`);const a=document.createElement("script");a.type="application/ld+json",a.id=t;const r={"@context":"https://schema.org","@type":"ItemList",name:salla.config.get("page.title"),itemListElement:e.map(((e,t)=>this.createProductSchema(e,t+1)))};a.textContent=JSON.stringify(r),document.head.appendChild(a)}formatDateFromString(e,t,a="en"){const r={en:"Invalid Date",ar:"تاريخ غير صالح"};if(!e||"string"!=typeof e||""===e.trim())return r[a];let s;if(/^\d+$/.test(e)){const t=parseInt(e);s=new Date(t>1e12?t:1e3*t)}else s=new Date(e);return isNaN(s.getTime())?r[a]:`${{en:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],ar:["الأحد","الاثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"]}[a][s.getDay()]} ${t(s.getDate(),"en"===a)} ${{en:["January","February","March","April","May","June","July","August","September","October","November","December"],ar:["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر"]}[a][s.getMonth()]} ${t(s.getFullYear(),"en"===a)}`}copyToClipboard(e){var t=e.target.innerText;navigator.clipboard.writeText(t).then((()=>{console.log("Text copied to clipboard: "+t)})).catch((e=>{console.error("Unable to copy text to clipboard",e)}))}animateItems(e){if(!e?.length)return;const t=Array.from(e);t.forEach((e=>e.classList.remove("s-animate-fade-in-up"))),t[0].getBoundingClientRect(),t.forEach(((e,t)=>{e.style.animationDelay=100*t+"ms",e.classList.add("s-animate-fade-in-up")})),setTimeout((()=>t.forEach((e=>e.classList.add("animated")))),1200+100*(t.length-1))}createReviewObject(e){return{"@type":"Review",author:{"@type":"Person",name:e.name},reviewBody:e.content,reviewRating:{"@type":"Rating",bestRating:"5",ratingValue:e.stars,worstRating:"1"}}}generateReviewSchema(e){const t=document.createElement("script");t.type="application/ld+json";const a={"@context":"http://schema.org/","@type":"Store",name:salla.config.get("store.name"),url:salla.config.get("store.url"),address:"الرياض",review:e.map((e=>this.createReviewObject(e))),aggregateRating:{"@type":"AggregateRating",ratingValue:e.reduce(((e,t)=>e+t.stars),0)/e.length,reviewCount:e.length}};t.textContent=JSON.stringify(a),document.head.appendChild(t)}availabilityChannels(){let e=salla.config.get("store.settings.product.availability_notify");if(!e)return"";let t=[];return e.email&&t.push("email"),(e.sms||e.mobile||e.whatsapp)&&t.push("sms"),t.join(",")}syncWishlistIcons(e,t){e?.querySelectorAll(t).forEach((e=>{const t=e.product?.id,a="number"==typeof t?t:Number(t);if(Number.isNaN(a))return;const r=salla.wishlist.api.has(a);e.querySelectorAll(".s-product-card-wishlist-btn, .btn--wishlist").forEach((e=>{e.classList.toggle("s-product-card-wishlist-added",r),e.classList.toggle("wishlist-added",r)}))}))}getPlanName(){const e=Number(salla.config.get("store.ray"));return e in this.plans?this.plans[e]:void 0}escapeHtml(e){return String(e??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}};export{e as F,a as H}
4
+ import"./p-lS_doykN.js";var e,t;!function(e){e.VALUES="values",e.VARIANTS="variants",e.MINIMUM="minimum",e.RANGE="range"}(e||(e={})),function(e){e.VALUES="values",e.VARIANT="variants",e.RANGE="range"}(t||(t={})),"undefined"!=typeof salla&&salla.event.setMaxListeners(100);var a=new class{constructor(){this.plans={0:"basic",25:"plus",50:"pro",100:"special"}}setIncludes(e){return this.includes=e,this}toggleElementClassIf(e,t,a,r){t=Array.isArray(t)?t:t.split(" "),a=Array.isArray(a)?a:a.split(" ");let s=r(e);return e?.classList.remove(...s?a:t),e?.classList.add(...s?t:a),this}toggleClassIf(e,t,a,r){return document.querySelectorAll(e).forEach((e=>this.toggleElementClassIf(e,t,a,r))),this}isValidEmail(e){return/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(String(e).toLowerCase())}filterEmojies(e){return e.replace(/(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff]|[\u0023-\u0039]\ufe0f?\u20e3|\u3299|\u3297|\u303d|\u3030|\u24c2|\ud83c[\udd70-\udd71]|\ud83c[\udd7e-\udd7f]|\ud83c\udd8e|\ud83c[\udd91-\udd9a]|\ud83c[\udde6-\uddff]|\ud83c[\ude01-\ude02]|\ud83c\ude1a|\ud83c\ude2f|\ud83c[\ude32-\ude3a]|\ud83c[\ude50-\ude51]|\u203c|\u2049|[\u25aa-\u25ab]|\u25b6|\u25c0|[\u25fb-\u25fe]|\u00a9|\u00ae|\u2122|\u2139|\ud83c\udc04|[\u2600-\u26FF]|\u2b05|\u2b06|\u2b07|\u2b1b|\u2b1c|\u2b50|\u2b55|\u231a|\u231b|\u2328|\u23cf|[\u23e9-\u23f3]|[\u23f8-\u23fa]|\ud83c\udccf|\u2934|\u2935|[\u2190-\u21ff])/g,"")}debounce(e,...t){return this.debounce_||(this.debounce_=salla.helpers.debounce(((e,...t)=>e(...t)),500)),this.debounce_(e,...t)}getProductsSource(e){return{"brands.single":"brands","product.index":"categories","product.index.latest":"latest","product.index.offers":"offers","product.index.search":"search","customer.wishlist":"wishlist","landing-page":"landing-page","product.index.tag":"tags","product.index.sales":"sales","components.most_sales_products":"sales"}[e||salla.config.get("page.slug")]||e||"latest"}getApiSource(e){return{recently:"selected"}[e]||e}getPageTitleForSource(e){return(e={brands:"common.titles.brands",latest:"blocks.home.latest_products",offers:"common.titles.discounts",reorder:"common.titles.products",sales:"common.titles.most_sales"}[e])?salla.lang.get(e):""}getProductsSourceValue(e,t){const a=this.getProductsSource(e);let r=null;if(t)try{r="string"==typeof t?JSON.parse(t):t}catch(e){console.error("Failed to parse JSON string in sourceValue:",e)}if(!["search","json","offers","latest","sales","related"].includes(a)){if(Array.isArray(r)&&r.length)return r;if(Array.isArray(r)&&!r.length)return"";if("number"==typeof r)return[r];if(!t&&["categories","tags","brands"].includes(e))return[salla.config.get("page.id")]}return r||t?r||t:"search"===a?"undefined"!=typeof window&&new URLSearchParams(window.location.search).get("q")||"":salla.config.get("page.id")}extractFiltersFromUrl(e){let t={};return e.forEach(((e,a)=>{const r=a.match(/^filters\[(.*?)\](\[(.*?)\])?$/u);if(r){const a=r[1],s=r[3];""===s||/^\d+$/.test(s)?(t[a]=Array.isArray(t[a])?t[a]:[],t[a].push(e)):s?(t[a]=t[a]||{},t[a][s]=e):t[a]=e}else{const r=a.match(/^(.*?)$/u);r&&(t[r[1]]=e)}})),t}resolveFilterLabels(t){return t.map((t=>{const a={...t};if(a.label={category_id:salla.lang.get("common.titles.categories"),brand_id:salla.lang.get("common.titles.brands"),rating:salla.lang.get("pages.categories.filter_rating"),price:salla.lang.get("pages.categories.filter_price")}[a.key]||a.label,"rating"==a.key){a.type=e.VALUES;const{max:r,min:s}=t.values;a.values=[5,4,3,2,1].filter((e=>e>=s||e<=r))}return a}))}async injectExtraFieldsToResponse(e){if(!e||!this.includes)return e;const t=e.data.map((e=>e.id));try{const{data:a}=await this.fetchImagesAndOptions(t);if(this.injectOptionsAndImages(e.data,a),!this.includes.includes("metadata"))return e;const r=await salla.api.metadata.fetchValues("product",t);return e.data.forEach((e=>{e.metadata=r.data.find((t=>parseInt(t.entity_id)===parseInt((e.id||"").toString())))})),e}catch(e){throw console.error("Error in injectExtraFieldsToResponse:",e),e}}fetchImagesAndOptions(e){return this.productsIncludes().length?salla.api.product.fetchOptions(e,{with:this.productsIncludes()}):Promise.resolve({data:[]})}injectOptionsAndImages(e,t){return t.length?e.map((e=>(this.includes.filter((e=>"metadata"!==e)).forEach((a=>{const r=t.find((t=>parseInt((t.id||"").toString())===parseInt((e.id||"").toString())));e[a]=r?r[a]:null})),e))):null}productsIncludes(){return this.includes?.filter((e=>"metadata"!=e))}saveSource(e,t){if(t)try{sessionStorage.setItem(e,t)}catch(e){salla.logger.warn("Error saving source to session storage")}}saveProductSource(e){this.saveSource("s-viewed-source",e)}saveProductPosition(e){if(null!=e&&""!==e)try{sessionStorage.setItem("s-viewed-position",String(e))}catch(e){salla.logger.warn("Error saving position to session storage")}}saveRequestId(e){if(e)try{sessionStorage.setItem("s-request-id",e)}catch(e){salla.logger.warn("Error saving request id to session storage")}}saveAddToCartSource(e){this.saveSource("s-add-to-cart-source",e)}parseJson(e){if("string"!=typeof e)return e;try{return JSON.parse(e)}catch(e){salla.logger.error("Failed to parse includes as JSON:",e)}return null}getProductSchemaMarkupScript(e){const t=document.createElement("script");return t.type="application/ld+json",t.text=JSON.stringify({"@context":"http://schema.org","@type":"Product",name:e?.name,image:e?.image?.url||e?.thumbnail,description:e?.description,brand:{"@type":"Brand",logo:e?.brand?.logo},offers:{"@type":"Offer",price:e?.price}}),t}createProductSchema(e,t){let a={productID:`${e.id}`,"@type":"Product",name:e.name,url:e.url,image:e.image.url||e.image,description:e.description||e.subtitle||e.name,...e.sku&&e.sku.length>0&&{sku:e.sku},offers:{"@type":"Offer",url:e.url,priceCurrency:e.currency,price:e.price,itemCondition:"NewCondition",availability:e.is_available?"InStock":"OutOfStock",priceValidUntil:e.discount_ends||new Date((new Date).setDate((new Date).getDate()+7)).toISOString().split("T")[0],priceSpecification:{"@type":"PriceSpecification",price:e.regular_price,priceCurrency:e.currency,valueAddedTaxIncluded:e.is_taxable},seller:{"@type":"Organization",name:salla.config.get("store.name")},shippingDetails:{"@type":"OfferShippingDetails",shippingRate:{"@type":"MonetaryAmount",value:"0",currency:e.currency||"SAR"},deliveryTime:{"@type":"ShippingDeliveryTime",businessDays:{"@type":"OpeningHoursSpecification",dayOfWeek:["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"]},cutoffTime:"14:00"}},hasMerchantReturnPolicy:{"@type":"MerchantReturnPolicy",returnPolicyCategory:"https://schema.org/MerchantReturnFiniteReturnWindow",merchantReturnDays:30,returnMethod:"https://schema.org/ReturnByMail",returnFees:"https://schema.org/FreeReturn"}}};return e.rating?.stars&&(a.aggregateRating={"@type":"AggregateRating",ratingValue:e.rating.stars,reviewCount:e.rating.count}),{"@type":"ListItem",position:t,item:a}}generateProductSchema(e){const t="salla-product-schema-script";if(document.getElementById(t))return void salla.logger.warn(`already added schema-script with id (${t})!`);const a=document.createElement("script");a.type="application/ld+json",a.id=t;const r={"@context":"https://schema.org","@type":"ItemList",name:salla.config.get("page.title"),itemListElement:e.map(((e,t)=>this.createProductSchema(e,t+1)))};a.textContent=JSON.stringify(r),document.head.appendChild(a)}formatDateFromString(e,t,a="en"){const r={en:"Invalid Date",ar:"تاريخ غير صالح"};if(!e||"string"!=typeof e||""===e.trim())return r[a];let s;if(/^\d+$/.test(e)){const t=parseInt(e);s=new Date(t>1e12?t:1e3*t)}else s=new Date(e);return isNaN(s.getTime())?r[a]:`${{en:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],ar:["الأحد","الاثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"]}[a][s.getDay()]} ${t(s.getDate(),"en"===a)} ${{en:["January","February","March","April","May","June","July","August","September","October","November","December"],ar:["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر"]}[a][s.getMonth()]} ${t(s.getFullYear(),"en"===a)}`}copyToClipboard(e){var t=e.target.innerText;navigator.clipboard.writeText(t).then((()=>{console.log("Text copied to clipboard: "+t)})).catch((e=>{console.error("Unable to copy text to clipboard",e)}))}animateItems(e){if(!e?.length)return;const t=Array.from(e);t.forEach((e=>e.classList.remove("s-animate-fade-in-up"))),t[0].getBoundingClientRect(),t.forEach(((e,t)=>{e.style.animationDelay=100*t+"ms",e.classList.add("s-animate-fade-in-up")})),setTimeout((()=>t.forEach((e=>e.classList.add("animated")))),1200+100*(t.length-1))}createReviewObject(e){return{"@type":"Review",author:{"@type":"Person",name:e.name},reviewBody:e.content,reviewRating:{"@type":"Rating",bestRating:"5",ratingValue:e.stars,worstRating:"1"}}}generateReviewSchema(e){const t=document.createElement("script");t.type="application/ld+json";const a={"@context":"http://schema.org/","@type":"Store",name:salla.config.get("store.name"),url:salla.config.get("store.url"),address:"الرياض",review:e.map((e=>this.createReviewObject(e))),aggregateRating:{"@type":"AggregateRating",ratingValue:e.reduce(((e,t)=>e+t.stars),0)/e.length,reviewCount:e.length}};t.textContent=JSON.stringify(a),document.head.appendChild(t)}availabilityChannels(){let e=salla.config.get("store.settings.product.availability_notify");if(!e)return"";let t=[];return e.email&&t.push("email"),(e.sms||e.mobile||e.whatsapp)&&t.push("sms"),t.join(",")}syncWishlistIcons(e,t){e?.querySelectorAll(t).forEach((e=>{const t=e.product?.id,a="number"==typeof t?t:Number(t);if(Number.isNaN(a))return;const r=salla.wishlist.api.has(a);e.querySelectorAll(".s-product-card-wishlist-btn, .btn--wishlist").forEach((e=>{e.classList.toggle("s-product-card-wishlist-added",r),e.classList.toggle("wishlist-added",r)}))}))}getPlanName(){const e=Number(salla.config.get("store.ray"));return e in this.plans?this.plans[e]:void 0}escapeHtml(e){return String(e??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}};export{e as F,a as H}
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{d as t}from"./p-3xfbOSPM.js";function n(t,n){return n.forEach((function(n){n&&"string"!=typeof n&&!Array.isArray(n)&&Object.keys(n).forEach((function(i){if("default"!==i&&!(i in t)){var r=Object.getOwnPropertyDescriptor(n,i);Object.defineProperty(t,i,r.get?r:{enumerable:!0,get:function(){return n[i]}})}}))})),Object.freeze(t)}var i,r={exports:{}},e=(i||(i=1,r.exports=function(){function t(t,n){return function(t){if(Array.isArray(t))return t}(t)||function(t,n){var i=[],r=!0,e=!1,a=void 0;try{for(var o,u=t[Symbol.iterator]();!(r=(o=u.next()).done)&&(i.push(o.value),i.length!==n);r=!0);}catch(t){e=!0,a=t}finally{try{r||null==u.return||u.return()}finally{if(e)throw a}}return i}(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var n=function(t,n){return e(t.x*n,t.y*n)},i=function(t,n){return e(t.x+n.x,t.y+n.y)},r=function(t,n,i){var r=Math.cos(n),a=Math.sin(n),o=e(t.x-i.x,t.y-i.y);return e(i.x+r*o.x-a*o.y,i.y+a*o.x+r*o.y)},e=function(){return{x:arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,y:arguments.length>1&&void 0!==arguments[1]?arguments[1]:0}},a=function(t,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3?arguments[3]:void 0;return"string"==typeof t?parseFloat(t)*i:"number"==typeof t?t*(r?n[r]:Math.min(n.width,n.height)):void 0},o=function(t){return null!=t},u=function(t,n){return Object.keys(n).forEach((function(i){return t.setAttribute(i,n[i])}))},c=function(t,n){var i=document.createElementNS("http://www.w3.org/2000/svg",t);return n&&u(i,n),i},f={contain:"xMidYMid meet",cover:"xMidYMid slice"},E={left:"start",center:"middle",right:"end"},_=function(t){return function(n){return c(t,{id:n.id})}},s={image:function(t){var n=c("image",{id:t.id,"stroke-linecap":"round","stroke-linejoin":"round",opacity:"0"});return n.onload=function(){n.setAttribute("opacity",t.opacity||1)},n.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",t.src),n},rect:_("rect"),ellipse:_("ellipse"),text:_("text"),path:_("path"),line:function(t){var n=c("g",{id:t.id,"stroke-linecap":"round","stroke-linejoin":"round"}),i=c("line");n.appendChild(i);var r=c("path");n.appendChild(r);var e=c("path");return n.appendChild(e),n}},l={rect:function(t){return u(t,Object.assign({},t.rect,t.styles))},ellipse:function(t){return u(t,Object.assign({cx:t.rect.x+.5*t.rect.width,cy:t.rect.y+.5*t.rect.height,rx:.5*t.rect.width,ry:.5*t.rect.height},t.styles))},image:function(t,n){u(t,Object.assign({},t.rect,t.styles,{preserveAspectRatio:f[n.fit]||"none"}))},text:function(t,n,i,r){var e=a(n.fontSize,i,r);u(t,Object.assign({},t.rect,t.styles,{"stroke-width":0,"font-weight":n.fontWeight||"normal","font-size":e,"font-family":n.fontFamily||"sans-serif","text-anchor":E[n.textAlign]||"start"})),t.text!==n.text&&(t.text=n.text,t.textContent=n.text.length?n.text:" ")},path:function(t,n,i,r){var e;u(t,Object.assign({},t.styles,{fill:"none",d:(e=n.points.map((function(t){return{x:a(t.x,i,r,"width"),y:a(t.y,i,r,"height")}})),e.map((function(t,n){return"".concat(0===n?"M":"L"," ").concat(t.x," ").concat(t.y)})).join(" "))}))},line:function(t,o,c,f){u(t,Object.assign({},t.rect,t.styles,{fill:"none"}));var E=t.childNodes[1],_=t.childNodes[2],s=t.rect,l={x:t.rect.x+t.rect.width,y:t.rect.y+t.rect.height};if(u(t.childNodes[0],{x1:s.x,y1:s.y,x2:l.x,y2:l.y}),o.lineDecoration){E.style.display="none",_.style.display="none";var v=function(t){var n=Math.sqrt(t.x*t.x+t.y*t.y);return 0===n?{x:0,y:0}:e(t.x/n,t.y/n)}({x:l.x-s.x,y:l.y-s.y}),h=a(.05,c,f);if(-1!==o.lineDecoration.indexOf("arrow-begin")){var I=n(v,h),d=i(s,I),p=r(s,2,d),M=r(s,-2,d);u(E,{style:"display:block;",d:"M".concat(p.x,",").concat(p.y," L").concat(s.x,",").concat(s.y," L").concat(M.x,",").concat(M.y)})}if(-1!==o.lineDecoration.indexOf("arrow-end")){var g=n(v,-h),m=i(l,g),T=r(l,2,m),A=r(l,-2,m);u(_,{style:"display:block;",d:"M".concat(T.x,",").concat(T.y," L").concat(l.x,",").concat(l.y," L").concat(A.x,",").concat(A.y)})}}}},v=function(t,n,i,r,e){"path"!==n&&(t.rect=function(t,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=a(t.x,n,i,"width")||a(t.left,n,i,"width"),e=a(t.y,n,i,"height")||a(t.top,n,i,"height"),u=a(t.width,n,i,"width"),c=a(t.height,n,i,"height"),f=a(t.right,n,i,"width"),E=a(t.bottom,n,i,"height");return o(e)||(e=o(c)&&o(E)?n.height-c-E:E),o(r)||(r=o(u)&&o(f)?n.width-u-f:f),o(u)||(u=o(r)&&o(f)?n.width-r-f:0),o(c)||(c=o(e)&&o(E)?n.height-e-E:0),{x:r||0,y:e||0,width:u||0,height:c||0}}(i,r,e)),t.styles=function(t,n,i){var r=t.borderStyle||t.lineStyle||"solid",e=t.backgroundColor||t.fontColor||"transparent",o=t.borderColor||t.lineColor||"transparent",u=a(t.borderWidth||t.lineWidth,n,i);return{"stroke-linecap":t.lineCap||"round","stroke-linejoin":t.lineJoin||"round","stroke-width":u||0,"stroke-dasharray":"string"==typeof r?"":r.map((function(t){return a(t,n,i)})).join(","),stroke:o,fill:e,opacity:t.opacity||1}}(i,r,e),l[n](t,i,r,e)},h=["x","y","left","top","right","bottom","width","height"],I=function(n){var i=t(n,2),r=i[0],e=i[1],a=e.points?{}:h.reduce((function(t,n){return t[n]="string"==typeof(i=e[n])&&/%/.test(i)?parseFloat(i)/100:i,t;var i}),{});return[r,Object.assign({zIndex:0},e,a)]},d=function(t,n){return t[1].zIndex>n[1].zIndex?1:t[1].zIndex<n[1].zIndex?-1:0},p=function(n){return n.utils.createView({name:"image-preview-markup",tag:"svg",ignoreRect:!0,mixins:{apis:["width","height","crop","markup","resize","dirty"]},write:function(n){var i=n.root,r=n.props;if(r.dirty){var e=r.crop,a=r.resize,o=r.markup,u=r.width,c=r.height,f=e.width,E=e.height;if(a){var _=a.size,l=_&&_.width,h=_&&_.height,p=a.mode;l&&!h&&(h=l),h&&!l&&(l=h);var M=f<l&&E<h;if(!M||M&&a.upscale){var g,m=l/f,T=h/E;"force"===p?(f=l,E=h):("cover"===p?g=Math.max(m,T):"contain"===p&&(g=Math.min(m,T)),f*=g,E*=g)}}var A={width:u,height:c};i.element.setAttribute("width",A.width),i.element.setAttribute("height",A.height);var w=Math.min(u/f,c/E);i.element.innerHTML="";var R=i.query("GET_IMAGE_PREVIEW_MARKUP_FILTER");o.filter(R).map(I).sort(d).forEach((function(n){var r=t(n,2),e=r[0],a=r[1],o=function(t,n){return s[t](n)}(e,a);v(o,e,a,A,w),i.element.appendChild(o)}))}}})},M=function(t,n){return{x:t,y:n}},g=function(t,n){return M(t.x-n.x,t.y-n.y)},m=function(t,n){return Math.sqrt(function(t,n){return function(t,n){return t.x*n.x+t.y*n.y}(g(t,n),g(t,n))}(t,n))},T=function(t,n){var i=t,r=n,e=1.5707963267948966-n,a=Math.sin(1.5707963267948966),o=Math.sin(r),u=Math.sin(e),c=Math.cos(e),f=i/a;return M(c*(f*o),c*(f*u))},A=function(t,n,i,r){var e=2*(r.x>.5?1-r.x:r.x)*t.width,a=2*(r.y>.5?1-r.y:r.y)*t.height,o=function(t,n){var i=t.height,r=T(t.width,n),e=T(i,n),a=M(t.x+Math.abs(r.x),t.y-Math.abs(r.y)),o=M(t.x+t.width+Math.abs(e.y),t.y+Math.abs(e.x)),u=M(t.x-Math.abs(e.y),t.y+t.height-Math.abs(e.x));return{width:m(a,o),height:m(a,u)}}(n,i);return Math.max(o.width/e,o.height/a)},w=function(t,n){var i=t.width,r=i*n;return r>t.height&&(i=(r=t.height)/n),{x:.5*(t.width-i),y:.5*(t.height-r),width:i,height:r}},R=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.zoom,r=n.rotation,e=n.center,a=n.aspectRatio;a||(a=t.height/t.width);var o=function(t,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=t.height/t.width,e=1,a=r;a>n&&(e=(a=n)/r);var o=Math.max(1/e,n/a),u=t.width/(i*o*e);return{width:u,height:u*n}}(t,a,i),u=void 0===n.scaleToFit||n.scaleToFit,c=i*A(t,w({width:o.width,height:o.height},a),r,u?e:{x:.5,y:.5});return{widthFloat:o.width/c,heightFloat:o.height/c,width:Math.round(o.width/c),height:Math.round(o.height/c)}},y={type:"spring",stiffness:.5,damping:.45,mass:10},G=function(t){return t.utils.createView({name:"image-clip",tag:"div",ignoreRect:!0,mixins:{apis:["crop","markup","resize","width","height","dirty","background"],styles:["width","height","opacity"],animations:{opacity:{type:"tween",duration:250}}},didWriteView:function(t){var n=t.props;n.background&&(t.root.element.style.backgroundColor=n.background)},create:function(n){var i=n.root,r=n.props;i.ref.image=i.appendChildView(i.createChildView(function(t){return t.utils.createView({name:"image-canvas-wrapper",tag:"div",ignoreRect:!0,mixins:{apis:["crop","width","height"],styles:["originX","originY","translateX","translateY","scaleX","scaleY","rotateZ"],animations:{originX:y,originY:y,scaleX:y,scaleY:y,translateX:y,translateY:y,rotateZ:y}},create:function(n){var i=n.root,r=n.props;r.width=r.image.width,r.height=r.image.height,i.ref.bitmap=i.appendChildView(i.createChildView(function(t){return t.utils.createView({name:"image-bitmap",ignoreRect:!0,mixins:{styles:["scaleX","scaleY"]},create:function(t){t.root.appendChild(t.props.image)}})}(t),{image:r.image}))},write:function(t){var n=t.props.crop.flip,i=t.root.ref.bitmap;i.scaleX=n.horizontal?-1:1,i.scaleY=n.vertical?-1:1}})}(t),Object.assign({},r))),i.ref.createMarkup=function(){i.ref.markup||(i.ref.markup=i.appendChildView(i.createChildView(p(t),Object.assign({},r))))},i.ref.destroyMarkup=function(){i.ref.markup&&(i.removeChildView(i.ref.markup),i.ref.markup=null)};var e=i.query("GET_IMAGE_PREVIEW_TRANSPARENCY_INDICATOR");null!==e&&(i.element.dataset.transparencyIndicator="grid"===e?e:"color")},write:function(t){var n=t.root,i=t.props,r=t.shouldOptimize,e=i.crop,a=i.markup,o=i.resize,u=i.dirty,c=i.width,f=i.height;n.ref.image.crop=e;var E={width:c,height:f,center:{x:.5*c,y:.5*f}},_={width:n.ref.image.width,height:n.ref.image.height},s={x:e.center.x*_.width,y:e.center.y*_.height},l={x:E.center.x-_.width*e.center.x,y:E.center.y-_.height*e.center.y},v=2*Math.PI+e.rotation%(2*Math.PI),h=void 0===e.scaleToFit||e.scaleToFit,I=A(_,w(E,e.aspectRatio||_.height/_.width),v,h?e.center:{x:.5,y:.5}),d=e.zoom*I;a&&a.length?(n.ref.createMarkup(),n.ref.markup.width=c,n.ref.markup.height=f,n.ref.markup.resize=o,n.ref.markup.dirty=u,n.ref.markup.markup=a,n.ref.markup.crop=R(_,e)):n.ref.markup&&n.ref.destroyMarkup();var p=n.ref.image;if(r)return p.originX=null,p.originY=null,p.translateX=null,p.translateY=null,p.rotateZ=null,p.scaleX=null,void(p.scaleY=null);p.originX=s.x,p.originY=s.y,p.translateX=l.x,p.translateY=l.y,p.rotateZ=v,p.scaleX=d,p.scaleY=d}})},P=0,D=function(){self.onmessage=function(t){createImageBitmap(t.data.message.file).then((function(n){self.postMessage({id:t.data.id,message:n},[n])}))}},O=function(){self.onmessage=function(t){for(var n=t.data.message.imageData,i=t.data.message.colorMatrix,r=n.data,e=r.length,a=i[0],o=i[1],u=i[2],c=i[3],f=i[4],E=i[5],_=i[6],s=i[7],l=i[8],v=i[9],h=i[10],I=i[11],d=i[12],p=i[13],M=i[14],g=i[15],m=i[16],T=i[17],A=i[18],w=i[19],R=0,y=0,G=0,P=0,D=0;R<e;R+=4)y=r[R]/255,G=r[R+1]/255,P=r[R+2]/255,D=r[R+3]/255,r[R]=Math.max(0,Math.min(255*(y*a+G*o+P*u+D*c+f),255)),r[R+1]=Math.max(0,Math.min(255*(y*E+G*_+P*s+D*l+v),255)),r[R+2]=Math.max(0,Math.min(255*(y*h+G*I+P*d+D*p+M),255)),r[R+3]=Math.max(0,Math.min(255*(y*g+G*m+P*T+D*A+w),255));self.postMessage({id:t.data.id,message:n},[n.data.buffer])}},x={1:function(){return[1,0,0,1,0,0]},2:function(t){return[-1,0,0,1,t,0]},3:function(t,n){return[-1,0,0,-1,t,n]},4:function(t,n){return[1,0,0,-1,0,n]},5:function(){return[0,1,1,0,0,0]},6:function(t,n){return[0,1,-1,0,n,0]},7:function(t,n){return[0,-1,-1,0,n,t]},8:function(t){return[0,-1,1,0,0,t]}},L=function(t,n,i,r){n=Math.round(n),i=Math.round(i);var e=document.createElement("canvas");e.width=n,e.height=i;var a=e.getContext("2d");if(r>=5&&r<=8){var o=[i,n];n=o[0],i=o[1]}return function(t,n,i,r){-1!==r&&t.transform.apply(t,x[r](n,i))}(a,n,i,r),a.drawImage(t,0,0,n,i),e},C=function(t){return/^image/.test(t.type)&&!/svg/.test(t.type)},W=function(t){var n=Math.min(10/t.width,10/t.height),i=document.createElement("canvas"),r=i.getContext("2d"),e=i.width=Math.ceil(t.width*n),a=i.height=Math.ceil(t.height*n);r.drawImage(t,0,0,e,a);var o=null;try{o=r.getImageData(0,0,e,a).data}catch(t){return null}for(var u=o.length,c=0,f=0,E=0,_=0;_<u;_+=4)c+=o[_]*o[_],f+=o[_+1]*o[_+1],E+=o[_+2]*o[_+2];return{r:c=S(c,u),g:f=S(f,u),b:E=S(E,u)}},S=function(t,n){return Math.floor(Math.sqrt(t/(n/4)))},k=function(t){var n=t.utils.createView({name:"image-preview-overlay",tag:"div",ignoreRect:!0,create:function(t){var n=t.root,i=t.props,r='<svg width="500" height="200" viewBox="0 0 500 200" preserveAspectRatio="none">\n <defs>\n <radialGradient id="gradient-__UID__" cx=".5" cy="1.25" r="1.15">\n <stop offset=\'50%\' stop-color=\'#000000\'/>\n <stop offset=\'56%\' stop-color=\'#0a0a0a\'/>\n <stop offset=\'63%\' stop-color=\'#262626\'/>\n <stop offset=\'69%\' stop-color=\'#4f4f4f\'/>\n <stop offset=\'75%\' stop-color=\'#808080\'/>\n <stop offset=\'81%\' stop-color=\'#b1b1b1\'/>\n <stop offset=\'88%\' stop-color=\'#dadada\'/>\n <stop offset=\'94%\' stop-color=\'#f6f6f6\'/>\n <stop offset=\'100%\' stop-color=\'#ffffff\'/>\n </radialGradient>\n <mask id="mask-__UID__">\n <rect x="0" y="0" width="500" height="200" fill="url(#gradient-__UID__)"></rect>\n </mask>\n </defs>\n <rect x="0" width="500" height="200" fill="currentColor" mask="url(#mask-__UID__)"></rect>\n</svg>';if(document.querySelector("base")){var e=new URL(window.location.href.replace(window.location.hash,"")).href;r=r.replace(/url\(\#/g,"url("+e+"#")}P++,n.element.classList.add("filepond--image-preview-overlay-".concat(i.status)),n.element.innerHTML=r.replace(/__UID__/g,P)},mixins:{styles:["opacity"],animations:{opacity:{type:"spring",mass:25}}}}),i=function(t){return t.utils.createView({name:"image-preview",tag:"div",ignoreRect:!0,mixins:{apis:["image","crop","markup","resize","dirty","background"],styles:["translateY","scaleX","scaleY","opacity"],animations:{scaleX:y,scaleY:y,translateY:y,opacity:{type:"tween",duration:400}}},create:function(n){var i=n.root,r=n.props;i.ref.clip=i.appendChildView(i.createChildView(G(t),{id:r.id,image:r.image,crop:r.crop,markup:r.markup,resize:r.resize,dirty:r.dirty,background:r.background}))},write:function(t){var n=t.root,i=t.props,r=t.shouldOptimize,e=n.ref.clip,a=i.image,o=i.crop,u=i.markup,c=i.resize,f=i.dirty;if(e.crop=o,e.markup=u,e.resize=c,e.dirty=f,e.opacity=r?0:1,!r&&!n.rect.element.hidden){var E=o.aspectRatio||a.height/a.width,_=n.rect.inner.width,s=n.rect.inner.height,l=n.query("GET_IMAGE_PREVIEW_HEIGHT"),v=n.query("GET_IMAGE_PREVIEW_MIN_HEIGHT"),h=n.query("GET_IMAGE_PREVIEW_MAX_HEIGHT"),I=n.query("GET_PANEL_ASPECT_RATIO"),d=n.query("GET_ALLOW_MULTIPLE");I&&!d&&(l=_*I,E=I);var p=null!==l?l:Math.max(v,Math.min(_*E,h)),M=p/E;M>_&&(p=(M=_)*E),p>s&&(p=s,M=s/E),e.width=M,e.height=p}}})}(t),r=t.utils.createWorker,e=function(t,n,i){return new Promise((function(e){t.ref.imageData||(t.ref.imageData=i.getContext("2d").getImageData(0,0,i.width,i.height));var a=function(t){var n;try{n=new ImageData(t.width,t.height)}catch(i){n=document.createElement("canvas").getContext("2d").createImageData(t.width,t.height)}return n.data.set(new Uint8ClampedArray(t.data)),n}(t.ref.imageData);if(!n||20!==n.length)return i.getContext("2d").putImageData(a,0,0),e();var o=r(O);o.post({imageData:a,colorMatrix:n},(function(t){i.getContext("2d").putImageData(t,0,0),o.terminate(),e()}),[a.data.buffer])}))},a=function(t){var n=t.root,r=t.image,e=t.props.id,a=n.query("GET_ITEM",{id:e});if(a){var o,u,c=a.getMetadata("crop")||{center:{x:.5,y:.5},flip:{horizontal:!1,vertical:!1},zoom:1,rotation:0,aspectRatio:null},f=n.query("GET_IMAGE_TRANSFORM_CANVAS_BACKGROUND_COLOR"),E=!1;n.query("GET_IMAGE_PREVIEW_MARKUP_SHOW")&&(o=a.getMetadata("markup")||[],u=a.getMetadata("resize"),E=!0);var _=n.appendChildView(n.createChildView(i,{id:e,image:r,crop:c,resize:u,markup:o,dirty:E,background:f,opacity:0,scaleX:1.15,scaleY:1.15,translateY:15}),n.childViews.length);n.ref.images.push(_),_.opacity=1,_.scaleX=1,_.scaleY=1,_.translateY=0,setTimeout((function(){n.dispatch("DID_IMAGE_PREVIEW_SHOW",{id:e})}),250)}},o=function(t){var n=t.root;n.ref.overlayShadow.opacity=1,n.ref.overlayError.opacity=0,n.ref.overlaySuccess.opacity=0},u=function(t){var n=t.root;n.ref.overlayShadow.opacity=.25,n.ref.overlayError.opacity=1};return t.utils.createView({name:"image-preview-wrapper",create:function(t){var i=t.root;i.ref.images=[],i.ref.imageData=null,i.ref.imageViewBin=[],i.ref.overlayShadow=i.appendChildView(i.createChildView(n,{opacity:0,status:"idle"})),i.ref.overlaySuccess=i.appendChildView(i.createChildView(n,{opacity:0,status:"success"})),i.ref.overlayError=i.appendChildView(i.createChildView(n,{opacity:0,status:"failure"}))},styles:["height"],apis:["height"],destroy:function(t){t.root.ref.images.forEach((function(t){t.image.width=1,t.image.height=1}))},didWriteView:function(t){t.root.ref.images.forEach((function(t){t.dirty=!1}))},write:t.utils.createRoute({DID_IMAGE_PREVIEW_DRAW:function(t){var n=t.root,i=n.ref.images[n.ref.images.length-1];i.translateY=0,i.scaleX=1,i.scaleY=1,i.opacity=1},DID_IMAGE_PREVIEW_CONTAINER_CREATE:function(t){var n,i,r,e=t.root,a=t.props.id,o=e.query("GET_ITEM",a);if(o){var u=URL.createObjectURL(o.file);n=u,i=function(t,n){e.dispatch("DID_IMAGE_PREVIEW_CALCULATE_SIZE",{id:a,width:t,height:n})},(r=new Image).onload=function(){var t=r.naturalWidth,n=r.naturalHeight;r=null,i(t,n)},r.src=n}},DID_FINISH_CALCULATE_PREVIEWSIZE:function(t){var n,i,o,u=t.root,c=t.props,f=u.query("GET_ITEM",c.id);if(f){var E=URL.createObjectURL(f.file),_=function(){var t;(t=E,new Promise((function(n,i){var r=new Image;r.crossOrigin="Anonymous",r.onload=function(){n(r)},r.onerror=function(t){i(t)},r.src=t}))).then(s)},s=function(t){URL.revokeObjectURL(E);var n=(f.getMetadata("exif")||{}).orientation||-1,i=t.width,r=t.height;if(i&&r){if(n>=5&&n<=8){var o=[r,i];i=o[0],r=o[1]}var _=Math.max(1,.75*window.devicePixelRatio),s=u.query("GET_IMAGE_PREVIEW_ZOOM_FACTOR")*_,l=r/i,v=u.rect.element.width,h=u.rect.element.height,I=v,d=I*l;l>1?d=(I=Math.min(i,v*s))*l:I=(d=Math.min(r,h*s))/l;var p=L(t,I,d,n),M=function(){var n=u.query("GET_IMAGE_PREVIEW_CALCULATE_AVERAGE_IMAGE_COLOR")?W(data):null;f.setMetadata("color",n,!0),"close"in t&&t.close(),u.ref.overlayShadow.opacity=1,a({root:u,props:c,image:p})},g=f.getMetadata("filter");g?e(u,g,p).then(M):M()}};if(n=f.file,i=window.navigator.userAgent.match(/Firefox\/([0-9]+)\./),null!==(o=i?parseInt(i[1]):null)&&o<=58||!("createImageBitmap"in window)||!C(n))_();else{var l=r(D);l.post({file:f.file},(function(t){l.terminate(),t?s(t):_()}))}}},DID_UPDATE_ITEM_METADATA:function(t){var n,i,r=t.root,o=t.props,u=t.action;if(/crop|filter|markup|resize/.test(u.change.key)&&r.ref.images.length){var c=r.query("GET_ITEM",{id:o.id});if(c)if(/filter/.test(u.change.key))e(r,u.change.value,r.ref.images[r.ref.images.length-1].image);else if(/crop|markup|resize/.test(u.change.key)){var f=c.getMetadata("crop"),E=r.ref.images[r.ref.images.length-1];if(f&&f.aspectRatio&&E.crop&&E.crop.aspectRatio&&Math.abs(f.aspectRatio-E.crop.aspectRatio)>1e-5){var _=function(t){var n=t.root,i=n.ref.images.shift();return i.opacity=0,i.translateY=-15,n.ref.imageViewBin.push(i),i}({root:r});a({root:r,props:o,image:(n=_.image,(i=i||document.createElement("canvas")).width=n.width,i.height=n.height,i.getContext("2d").drawImage(n,0,0),i)})}else!function(t){var n=t.root,i=n.query("GET_ITEM",{id:t.props.id});if(i){var r=n.ref.images[n.ref.images.length-1];r.crop=i.getMetadata("crop"),r.background=n.query("GET_IMAGE_TRANSFORM_CANVAS_BACKGROUND_COLOR"),n.query("GET_IMAGE_PREVIEW_MARKUP_SHOW")&&(r.dirty=!0,r.resize=i.getMetadata("resize"),r.markup=i.getMetadata("markup"))}}({root:r,props:o})}}},DID_THROW_ITEM_LOAD_ERROR:u,DID_THROW_ITEM_PROCESSING_ERROR:u,DID_THROW_ITEM_INVALID:u,DID_COMPLETE_ITEM_PROCESSING:function(t){var n=t.root;n.ref.overlayShadow.opacity=.25,n.ref.overlaySuccess.opacity=1},DID_START_ITEM_PROCESSING:o,DID_REVERT_ITEM_PROCESSING:o},(function(t){var n=t.root,i=n.ref.imageViewBin.filter((function(t){return 0===t.opacity}));n.ref.imageViewBin=n.ref.imageViewBin.filter((function(t){return t.opacity>0})),i.forEach((function(t){return function(t,n){t.removeChildView(n),n.image.width=1,n.image.height=1,n._destroy()}(n,t)})),i.length=0}))})},V=function(t){var n=t.addFilter,i=t.utils,r=i.Type,e=i.createRoute,a=i.isFile,o=k(t);return n("CREATE_VIEW",(function(t){var n=t.view,i=t.query;if((0,t.is)("file")&&i("GET_ALLOW_IMAGE_PREVIEW")){var r=function(t){t.root.ref.shouldRescale=!0};n.registerWriter(e({DID_RESIZE_ROOT:r,DID_STOP_RESIZE:r,DID_LOAD_ITEM:function(t){var r=t.root,e=t.props.id,u=i("GET_ITEM",e);if(u&&a(u.file)&&!u.archived){var c=u.file;if(function(t){return/^image/.test(t.type)}(c)&&i("GET_IMAGE_PREVIEW_FILTER_ITEM")(u)){var f="createImageBitmap"in(window||{}),E=i("GET_IMAGE_PREVIEW_MAX_FILE_SIZE");if(!(!f&&E&&c.size>E)){r.ref.imagePreview=n.appendChildView(n.createChildView(o,{id:e}));var _=r.query("GET_IMAGE_PREVIEW_HEIGHT");_&&r.dispatch("DID_UPDATE_PANEL_HEIGHT",{id:u.id,height:_});var s=!f&&c.size>i("GET_IMAGE_PREVIEW_MAX_INSTANT_PREVIEW_FILE_SIZE");r.dispatch("DID_IMAGE_PREVIEW_CONTAINER_CREATE",{id:e},s)}}}},DID_IMAGE_PREVIEW_CALCULATE_SIZE:function(t){var n=t.root,i=t.action;n.ref.imageWidth=i.width,n.ref.imageHeight=i.height,n.ref.shouldRescale=!0,n.ref.shouldDrawPreview=!0,n.dispatch("KICK")},DID_UPDATE_ITEM_METADATA:function(t){"crop"===t.action.change.key&&(t.root.ref.shouldRescale=!0)}},(function(t){var n=t.root,i=t.props;n.ref.imagePreview&&(n.rect.element.hidden||(n.ref.shouldRescale&&(function(t,n){if(t.ref.imagePreview){var i=t.query("GET_ITEM",{id:n.id});if(i){var r=t.query("GET_PANEL_ASPECT_RATIO"),e=t.query("GET_ITEM_PANEL_ASPECT_RATIO"),a=t.query("GET_IMAGE_PREVIEW_HEIGHT");if(!(r||e||a)){var o=t.ref,u=o.imageWidth,c=o.imageHeight;if(u&&c){var f=t.query("GET_IMAGE_PREVIEW_MIN_HEIGHT"),E=t.query("GET_IMAGE_PREVIEW_MAX_HEIGHT"),_=(i.getMetadata("exif")||{}).orientation||-1;if(_>=5&&_<=8){var s=[c,u];u=s[0],c=s[1]}if(!C(i.file)||t.query("GET_IMAGE_PREVIEW_UPSCALE")){var l=2048/u;u*=l,c*=l}var v=c/u,h=(i.getMetadata("crop")||{}).aspectRatio||v,I=Math.max(f,Math.min(c,E)),d=Math.min(t.rect.element.width*h,I);t.dispatch("DID_UPDATE_PANEL_HEIGHT",{id:i.id,height:d})}}}}}(n,i),n.ref.shouldRescale=!1),n.ref.shouldDrawPreview&&(requestAnimationFrame((function(){requestAnimationFrame((function(){n.dispatch("DID_FINISH_CALCULATE_PREVIEWSIZE",{id:i.id})}))})),n.ref.shouldDrawPreview=!1)))})))}})),{options:{allowImagePreview:[!0,r.BOOLEAN],imagePreviewFilterItem:[function(){return!0},r.FUNCTION],imagePreviewHeight:[null,r.INT],imagePreviewMinHeight:[44,r.INT],imagePreviewMaxHeight:[256,r.INT],imagePreviewMaxFileSize:[null,r.INT],imagePreviewZoomFactor:[2,r.INT],imagePreviewUpscale:[!1,r.BOOLEAN],imagePreviewMaxInstantPreviewFileSize:[1e6,r.INT],imagePreviewTransparencyIndicator:[null,r.STRING],imagePreviewCalculateAverageImageColor:[!1,r.BOOLEAN],imagePreviewMarkupShow:[!0,r.BOOLEAN],imagePreviewMarkupFilter:[function(){return!0},r.FUNCTION]}}};return"undefined"!=typeof window&&void 0!==window.document&&document.dispatchEvent(new CustomEvent("FilePond:pluginloaded",{detail:V})),V}()),r.exports),a=n({__proto__:null,default:t(e)},[e]);
4
+ import{d as t}from"./p-lS_doykN.js";function n(t,n){return n.forEach((function(n){n&&"string"!=typeof n&&!Array.isArray(n)&&Object.keys(n).forEach((function(i){if("default"!==i&&!(i in t)){var r=Object.getOwnPropertyDescriptor(n,i);Object.defineProperty(t,i,r.get?r:{enumerable:!0,get:function(){return n[i]}})}}))})),Object.freeze(t)}var i,r={exports:{}},e=(i||(i=1,r.exports=function(){function t(t,n){return function(t){if(Array.isArray(t))return t}(t)||function(t,n){var i=[],r=!0,e=!1,a=void 0;try{for(var o,u=t[Symbol.iterator]();!(r=(o=u.next()).done)&&(i.push(o.value),i.length!==n);r=!0);}catch(t){e=!0,a=t}finally{try{r||null==u.return||u.return()}finally{if(e)throw a}}return i}(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var n=function(t,n){return e(t.x*n,t.y*n)},i=function(t,n){return e(t.x+n.x,t.y+n.y)},r=function(t,n,i){var r=Math.cos(n),a=Math.sin(n),o=e(t.x-i.x,t.y-i.y);return e(i.x+r*o.x-a*o.y,i.y+a*o.x+r*o.y)},e=function(){return{x:arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,y:arguments.length>1&&void 0!==arguments[1]?arguments[1]:0}},a=function(t,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3?arguments[3]:void 0;return"string"==typeof t?parseFloat(t)*i:"number"==typeof t?t*(r?n[r]:Math.min(n.width,n.height)):void 0},o=function(t){return null!=t},u=function(t,n){return Object.keys(n).forEach((function(i){return t.setAttribute(i,n[i])}))},c=function(t,n){var i=document.createElementNS("http://www.w3.org/2000/svg",t);return n&&u(i,n),i},f={contain:"xMidYMid meet",cover:"xMidYMid slice"},E={left:"start",center:"middle",right:"end"},_=function(t){return function(n){return c(t,{id:n.id})}},s={image:function(t){var n=c("image",{id:t.id,"stroke-linecap":"round","stroke-linejoin":"round",opacity:"0"});return n.onload=function(){n.setAttribute("opacity",t.opacity||1)},n.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",t.src),n},rect:_("rect"),ellipse:_("ellipse"),text:_("text"),path:_("path"),line:function(t){var n=c("g",{id:t.id,"stroke-linecap":"round","stroke-linejoin":"round"}),i=c("line");n.appendChild(i);var r=c("path");n.appendChild(r);var e=c("path");return n.appendChild(e),n}},l={rect:function(t){return u(t,Object.assign({},t.rect,t.styles))},ellipse:function(t){return u(t,Object.assign({cx:t.rect.x+.5*t.rect.width,cy:t.rect.y+.5*t.rect.height,rx:.5*t.rect.width,ry:.5*t.rect.height},t.styles))},image:function(t,n){u(t,Object.assign({},t.rect,t.styles,{preserveAspectRatio:f[n.fit]||"none"}))},text:function(t,n,i,r){var e=a(n.fontSize,i,r);u(t,Object.assign({},t.rect,t.styles,{"stroke-width":0,"font-weight":n.fontWeight||"normal","font-size":e,"font-family":n.fontFamily||"sans-serif","text-anchor":E[n.textAlign]||"start"})),t.text!==n.text&&(t.text=n.text,t.textContent=n.text.length?n.text:" ")},path:function(t,n,i,r){var e;u(t,Object.assign({},t.styles,{fill:"none",d:(e=n.points.map((function(t){return{x:a(t.x,i,r,"width"),y:a(t.y,i,r,"height")}})),e.map((function(t,n){return"".concat(0===n?"M":"L"," ").concat(t.x," ").concat(t.y)})).join(" "))}))},line:function(t,o,c,f){u(t,Object.assign({},t.rect,t.styles,{fill:"none"}));var E=t.childNodes[1],_=t.childNodes[2],s=t.rect,l={x:t.rect.x+t.rect.width,y:t.rect.y+t.rect.height};if(u(t.childNodes[0],{x1:s.x,y1:s.y,x2:l.x,y2:l.y}),o.lineDecoration){E.style.display="none",_.style.display="none";var v=function(t){var n=Math.sqrt(t.x*t.x+t.y*t.y);return 0===n?{x:0,y:0}:e(t.x/n,t.y/n)}({x:l.x-s.x,y:l.y-s.y}),h=a(.05,c,f);if(-1!==o.lineDecoration.indexOf("arrow-begin")){var I=n(v,h),d=i(s,I),p=r(s,2,d),M=r(s,-2,d);u(E,{style:"display:block;",d:"M".concat(p.x,",").concat(p.y," L").concat(s.x,",").concat(s.y," L").concat(M.x,",").concat(M.y)})}if(-1!==o.lineDecoration.indexOf("arrow-end")){var g=n(v,-h),m=i(l,g),T=r(l,2,m),A=r(l,-2,m);u(_,{style:"display:block;",d:"M".concat(T.x,",").concat(T.y," L").concat(l.x,",").concat(l.y," L").concat(A.x,",").concat(A.y)})}}}},v=function(t,n,i,r,e){"path"!==n&&(t.rect=function(t,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=a(t.x,n,i,"width")||a(t.left,n,i,"width"),e=a(t.y,n,i,"height")||a(t.top,n,i,"height"),u=a(t.width,n,i,"width"),c=a(t.height,n,i,"height"),f=a(t.right,n,i,"width"),E=a(t.bottom,n,i,"height");return o(e)||(e=o(c)&&o(E)?n.height-c-E:E),o(r)||(r=o(u)&&o(f)?n.width-u-f:f),o(u)||(u=o(r)&&o(f)?n.width-r-f:0),o(c)||(c=o(e)&&o(E)?n.height-e-E:0),{x:r||0,y:e||0,width:u||0,height:c||0}}(i,r,e)),t.styles=function(t,n,i){var r=t.borderStyle||t.lineStyle||"solid",e=t.backgroundColor||t.fontColor||"transparent",o=t.borderColor||t.lineColor||"transparent",u=a(t.borderWidth||t.lineWidth,n,i);return{"stroke-linecap":t.lineCap||"round","stroke-linejoin":t.lineJoin||"round","stroke-width":u||0,"stroke-dasharray":"string"==typeof r?"":r.map((function(t){return a(t,n,i)})).join(","),stroke:o,fill:e,opacity:t.opacity||1}}(i,r,e),l[n](t,i,r,e)},h=["x","y","left","top","right","bottom","width","height"],I=function(n){var i=t(n,2),r=i[0],e=i[1],a=e.points?{}:h.reduce((function(t,n){return t[n]="string"==typeof(i=e[n])&&/%/.test(i)?parseFloat(i)/100:i,t;var i}),{});return[r,Object.assign({zIndex:0},e,a)]},d=function(t,n){return t[1].zIndex>n[1].zIndex?1:t[1].zIndex<n[1].zIndex?-1:0},p=function(n){return n.utils.createView({name:"image-preview-markup",tag:"svg",ignoreRect:!0,mixins:{apis:["width","height","crop","markup","resize","dirty"]},write:function(n){var i=n.root,r=n.props;if(r.dirty){var e=r.crop,a=r.resize,o=r.markup,u=r.width,c=r.height,f=e.width,E=e.height;if(a){var _=a.size,l=_&&_.width,h=_&&_.height,p=a.mode;l&&!h&&(h=l),h&&!l&&(l=h);var M=f<l&&E<h;if(!M||M&&a.upscale){var g,m=l/f,T=h/E;"force"===p?(f=l,E=h):("cover"===p?g=Math.max(m,T):"contain"===p&&(g=Math.min(m,T)),f*=g,E*=g)}}var A={width:u,height:c};i.element.setAttribute("width",A.width),i.element.setAttribute("height",A.height);var w=Math.min(u/f,c/E);i.element.innerHTML="";var R=i.query("GET_IMAGE_PREVIEW_MARKUP_FILTER");o.filter(R).map(I).sort(d).forEach((function(n){var r=t(n,2),e=r[0],a=r[1],o=function(t,n){return s[t](n)}(e,a);v(o,e,a,A,w),i.element.appendChild(o)}))}}})},M=function(t,n){return{x:t,y:n}},g=function(t,n){return M(t.x-n.x,t.y-n.y)},m=function(t,n){return Math.sqrt(function(t,n){return function(t,n){return t.x*n.x+t.y*n.y}(g(t,n),g(t,n))}(t,n))},T=function(t,n){var i=t,r=n,e=1.5707963267948966-n,a=Math.sin(1.5707963267948966),o=Math.sin(r),u=Math.sin(e),c=Math.cos(e),f=i/a;return M(c*(f*o),c*(f*u))},A=function(t,n,i,r){var e=2*(r.x>.5?1-r.x:r.x)*t.width,a=2*(r.y>.5?1-r.y:r.y)*t.height,o=function(t,n){var i=t.height,r=T(t.width,n),e=T(i,n),a=M(t.x+Math.abs(r.x),t.y-Math.abs(r.y)),o=M(t.x+t.width+Math.abs(e.y),t.y+Math.abs(e.x)),u=M(t.x-Math.abs(e.y),t.y+t.height-Math.abs(e.x));return{width:m(a,o),height:m(a,u)}}(n,i);return Math.max(o.width/e,o.height/a)},w=function(t,n){var i=t.width,r=i*n;return r>t.height&&(i=(r=t.height)/n),{x:.5*(t.width-i),y:.5*(t.height-r),width:i,height:r}},R=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.zoom,r=n.rotation,e=n.center,a=n.aspectRatio;a||(a=t.height/t.width);var o=function(t,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=t.height/t.width,e=1,a=r;a>n&&(e=(a=n)/r);var o=Math.max(1/e,n/a),u=t.width/(i*o*e);return{width:u,height:u*n}}(t,a,i),u=void 0===n.scaleToFit||n.scaleToFit,c=i*A(t,w({width:o.width,height:o.height},a),r,u?e:{x:.5,y:.5});return{widthFloat:o.width/c,heightFloat:o.height/c,width:Math.round(o.width/c),height:Math.round(o.height/c)}},y={type:"spring",stiffness:.5,damping:.45,mass:10},G=function(t){return t.utils.createView({name:"image-clip",tag:"div",ignoreRect:!0,mixins:{apis:["crop","markup","resize","width","height","dirty","background"],styles:["width","height","opacity"],animations:{opacity:{type:"tween",duration:250}}},didWriteView:function(t){var n=t.props;n.background&&(t.root.element.style.backgroundColor=n.background)},create:function(n){var i=n.root,r=n.props;i.ref.image=i.appendChildView(i.createChildView(function(t){return t.utils.createView({name:"image-canvas-wrapper",tag:"div",ignoreRect:!0,mixins:{apis:["crop","width","height"],styles:["originX","originY","translateX","translateY","scaleX","scaleY","rotateZ"],animations:{originX:y,originY:y,scaleX:y,scaleY:y,translateX:y,translateY:y,rotateZ:y}},create:function(n){var i=n.root,r=n.props;r.width=r.image.width,r.height=r.image.height,i.ref.bitmap=i.appendChildView(i.createChildView(function(t){return t.utils.createView({name:"image-bitmap",ignoreRect:!0,mixins:{styles:["scaleX","scaleY"]},create:function(t){t.root.appendChild(t.props.image)}})}(t),{image:r.image}))},write:function(t){var n=t.props.crop.flip,i=t.root.ref.bitmap;i.scaleX=n.horizontal?-1:1,i.scaleY=n.vertical?-1:1}})}(t),Object.assign({},r))),i.ref.createMarkup=function(){i.ref.markup||(i.ref.markup=i.appendChildView(i.createChildView(p(t),Object.assign({},r))))},i.ref.destroyMarkup=function(){i.ref.markup&&(i.removeChildView(i.ref.markup),i.ref.markup=null)};var e=i.query("GET_IMAGE_PREVIEW_TRANSPARENCY_INDICATOR");null!==e&&(i.element.dataset.transparencyIndicator="grid"===e?e:"color")},write:function(t){var n=t.root,i=t.props,r=t.shouldOptimize,e=i.crop,a=i.markup,o=i.resize,u=i.dirty,c=i.width,f=i.height;n.ref.image.crop=e;var E={width:c,height:f,center:{x:.5*c,y:.5*f}},_={width:n.ref.image.width,height:n.ref.image.height},s={x:e.center.x*_.width,y:e.center.y*_.height},l={x:E.center.x-_.width*e.center.x,y:E.center.y-_.height*e.center.y},v=2*Math.PI+e.rotation%(2*Math.PI),h=void 0===e.scaleToFit||e.scaleToFit,I=A(_,w(E,e.aspectRatio||_.height/_.width),v,h?e.center:{x:.5,y:.5}),d=e.zoom*I;a&&a.length?(n.ref.createMarkup(),n.ref.markup.width=c,n.ref.markup.height=f,n.ref.markup.resize=o,n.ref.markup.dirty=u,n.ref.markup.markup=a,n.ref.markup.crop=R(_,e)):n.ref.markup&&n.ref.destroyMarkup();var p=n.ref.image;if(r)return p.originX=null,p.originY=null,p.translateX=null,p.translateY=null,p.rotateZ=null,p.scaleX=null,void(p.scaleY=null);p.originX=s.x,p.originY=s.y,p.translateX=l.x,p.translateY=l.y,p.rotateZ=v,p.scaleX=d,p.scaleY=d}})},P=0,D=function(){self.onmessage=function(t){createImageBitmap(t.data.message.file).then((function(n){self.postMessage({id:t.data.id,message:n},[n])}))}},O=function(){self.onmessage=function(t){for(var n=t.data.message.imageData,i=t.data.message.colorMatrix,r=n.data,e=r.length,a=i[0],o=i[1],u=i[2],c=i[3],f=i[4],E=i[5],_=i[6],s=i[7],l=i[8],v=i[9],h=i[10],I=i[11],d=i[12],p=i[13],M=i[14],g=i[15],m=i[16],T=i[17],A=i[18],w=i[19],R=0,y=0,G=0,P=0,D=0;R<e;R+=4)y=r[R]/255,G=r[R+1]/255,P=r[R+2]/255,D=r[R+3]/255,r[R]=Math.max(0,Math.min(255*(y*a+G*o+P*u+D*c+f),255)),r[R+1]=Math.max(0,Math.min(255*(y*E+G*_+P*s+D*l+v),255)),r[R+2]=Math.max(0,Math.min(255*(y*h+G*I+P*d+D*p+M),255)),r[R+3]=Math.max(0,Math.min(255*(y*g+G*m+P*T+D*A+w),255));self.postMessage({id:t.data.id,message:n},[n.data.buffer])}},x={1:function(){return[1,0,0,1,0,0]},2:function(t){return[-1,0,0,1,t,0]},3:function(t,n){return[-1,0,0,-1,t,n]},4:function(t,n){return[1,0,0,-1,0,n]},5:function(){return[0,1,1,0,0,0]},6:function(t,n){return[0,1,-1,0,n,0]},7:function(t,n){return[0,-1,-1,0,n,t]},8:function(t){return[0,-1,1,0,0,t]}},L=function(t,n,i,r){n=Math.round(n),i=Math.round(i);var e=document.createElement("canvas");e.width=n,e.height=i;var a=e.getContext("2d");if(r>=5&&r<=8){var o=[i,n];n=o[0],i=o[1]}return function(t,n,i,r){-1!==r&&t.transform.apply(t,x[r](n,i))}(a,n,i,r),a.drawImage(t,0,0,n,i),e},C=function(t){return/^image/.test(t.type)&&!/svg/.test(t.type)},W=function(t){var n=Math.min(10/t.width,10/t.height),i=document.createElement("canvas"),r=i.getContext("2d"),e=i.width=Math.ceil(t.width*n),a=i.height=Math.ceil(t.height*n);r.drawImage(t,0,0,e,a);var o=null;try{o=r.getImageData(0,0,e,a).data}catch(t){return null}for(var u=o.length,c=0,f=0,E=0,_=0;_<u;_+=4)c+=o[_]*o[_],f+=o[_+1]*o[_+1],E+=o[_+2]*o[_+2];return{r:c=S(c,u),g:f=S(f,u),b:E=S(E,u)}},S=function(t,n){return Math.floor(Math.sqrt(t/(n/4)))},k=function(t){var n=t.utils.createView({name:"image-preview-overlay",tag:"div",ignoreRect:!0,create:function(t){var n=t.root,i=t.props,r='<svg width="500" height="200" viewBox="0 0 500 200" preserveAspectRatio="none">\n <defs>\n <radialGradient id="gradient-__UID__" cx=".5" cy="1.25" r="1.15">\n <stop offset=\'50%\' stop-color=\'#000000\'/>\n <stop offset=\'56%\' stop-color=\'#0a0a0a\'/>\n <stop offset=\'63%\' stop-color=\'#262626\'/>\n <stop offset=\'69%\' stop-color=\'#4f4f4f\'/>\n <stop offset=\'75%\' stop-color=\'#808080\'/>\n <stop offset=\'81%\' stop-color=\'#b1b1b1\'/>\n <stop offset=\'88%\' stop-color=\'#dadada\'/>\n <stop offset=\'94%\' stop-color=\'#f6f6f6\'/>\n <stop offset=\'100%\' stop-color=\'#ffffff\'/>\n </radialGradient>\n <mask id="mask-__UID__">\n <rect x="0" y="0" width="500" height="200" fill="url(#gradient-__UID__)"></rect>\n </mask>\n </defs>\n <rect x="0" width="500" height="200" fill="currentColor" mask="url(#mask-__UID__)"></rect>\n</svg>';if(document.querySelector("base")){var e=new URL(window.location.href.replace(window.location.hash,"")).href;r=r.replace(/url\(\#/g,"url("+e+"#")}P++,n.element.classList.add("filepond--image-preview-overlay-".concat(i.status)),n.element.innerHTML=r.replace(/__UID__/g,P)},mixins:{styles:["opacity"],animations:{opacity:{type:"spring",mass:25}}}}),i=function(t){return t.utils.createView({name:"image-preview",tag:"div",ignoreRect:!0,mixins:{apis:["image","crop","markup","resize","dirty","background"],styles:["translateY","scaleX","scaleY","opacity"],animations:{scaleX:y,scaleY:y,translateY:y,opacity:{type:"tween",duration:400}}},create:function(n){var i=n.root,r=n.props;i.ref.clip=i.appendChildView(i.createChildView(G(t),{id:r.id,image:r.image,crop:r.crop,markup:r.markup,resize:r.resize,dirty:r.dirty,background:r.background}))},write:function(t){var n=t.root,i=t.props,r=t.shouldOptimize,e=n.ref.clip,a=i.image,o=i.crop,u=i.markup,c=i.resize,f=i.dirty;if(e.crop=o,e.markup=u,e.resize=c,e.dirty=f,e.opacity=r?0:1,!r&&!n.rect.element.hidden){var E=o.aspectRatio||a.height/a.width,_=n.rect.inner.width,s=n.rect.inner.height,l=n.query("GET_IMAGE_PREVIEW_HEIGHT"),v=n.query("GET_IMAGE_PREVIEW_MIN_HEIGHT"),h=n.query("GET_IMAGE_PREVIEW_MAX_HEIGHT"),I=n.query("GET_PANEL_ASPECT_RATIO"),d=n.query("GET_ALLOW_MULTIPLE");I&&!d&&(l=_*I,E=I);var p=null!==l?l:Math.max(v,Math.min(_*E,h)),M=p/E;M>_&&(p=(M=_)*E),p>s&&(p=s,M=s/E),e.width=M,e.height=p}}})}(t),r=t.utils.createWorker,e=function(t,n,i){return new Promise((function(e){t.ref.imageData||(t.ref.imageData=i.getContext("2d").getImageData(0,0,i.width,i.height));var a=function(t){var n;try{n=new ImageData(t.width,t.height)}catch(i){n=document.createElement("canvas").getContext("2d").createImageData(t.width,t.height)}return n.data.set(new Uint8ClampedArray(t.data)),n}(t.ref.imageData);if(!n||20!==n.length)return i.getContext("2d").putImageData(a,0,0),e();var o=r(O);o.post({imageData:a,colorMatrix:n},(function(t){i.getContext("2d").putImageData(t,0,0),o.terminate(),e()}),[a.data.buffer])}))},a=function(t){var n=t.root,r=t.image,e=t.props.id,a=n.query("GET_ITEM",{id:e});if(a){var o,u,c=a.getMetadata("crop")||{center:{x:.5,y:.5},flip:{horizontal:!1,vertical:!1},zoom:1,rotation:0,aspectRatio:null},f=n.query("GET_IMAGE_TRANSFORM_CANVAS_BACKGROUND_COLOR"),E=!1;n.query("GET_IMAGE_PREVIEW_MARKUP_SHOW")&&(o=a.getMetadata("markup")||[],u=a.getMetadata("resize"),E=!0);var _=n.appendChildView(n.createChildView(i,{id:e,image:r,crop:c,resize:u,markup:o,dirty:E,background:f,opacity:0,scaleX:1.15,scaleY:1.15,translateY:15}),n.childViews.length);n.ref.images.push(_),_.opacity=1,_.scaleX=1,_.scaleY=1,_.translateY=0,setTimeout((function(){n.dispatch("DID_IMAGE_PREVIEW_SHOW",{id:e})}),250)}},o=function(t){var n=t.root;n.ref.overlayShadow.opacity=1,n.ref.overlayError.opacity=0,n.ref.overlaySuccess.opacity=0},u=function(t){var n=t.root;n.ref.overlayShadow.opacity=.25,n.ref.overlayError.opacity=1};return t.utils.createView({name:"image-preview-wrapper",create:function(t){var i=t.root;i.ref.images=[],i.ref.imageData=null,i.ref.imageViewBin=[],i.ref.overlayShadow=i.appendChildView(i.createChildView(n,{opacity:0,status:"idle"})),i.ref.overlaySuccess=i.appendChildView(i.createChildView(n,{opacity:0,status:"success"})),i.ref.overlayError=i.appendChildView(i.createChildView(n,{opacity:0,status:"failure"}))},styles:["height"],apis:["height"],destroy:function(t){t.root.ref.images.forEach((function(t){t.image.width=1,t.image.height=1}))},didWriteView:function(t){t.root.ref.images.forEach((function(t){t.dirty=!1}))},write:t.utils.createRoute({DID_IMAGE_PREVIEW_DRAW:function(t){var n=t.root,i=n.ref.images[n.ref.images.length-1];i.translateY=0,i.scaleX=1,i.scaleY=1,i.opacity=1},DID_IMAGE_PREVIEW_CONTAINER_CREATE:function(t){var n,i,r,e=t.root,a=t.props.id,o=e.query("GET_ITEM",a);if(o){var u=URL.createObjectURL(o.file);n=u,i=function(t,n){e.dispatch("DID_IMAGE_PREVIEW_CALCULATE_SIZE",{id:a,width:t,height:n})},(r=new Image).onload=function(){var t=r.naturalWidth,n=r.naturalHeight;r=null,i(t,n)},r.src=n}},DID_FINISH_CALCULATE_PREVIEWSIZE:function(t){var n,i,o,u=t.root,c=t.props,f=u.query("GET_ITEM",c.id);if(f){var E=URL.createObjectURL(f.file),_=function(){var t;(t=E,new Promise((function(n,i){var r=new Image;r.crossOrigin="Anonymous",r.onload=function(){n(r)},r.onerror=function(t){i(t)},r.src=t}))).then(s)},s=function(t){URL.revokeObjectURL(E);var n=(f.getMetadata("exif")||{}).orientation||-1,i=t.width,r=t.height;if(i&&r){if(n>=5&&n<=8){var o=[r,i];i=o[0],r=o[1]}var _=Math.max(1,.75*window.devicePixelRatio),s=u.query("GET_IMAGE_PREVIEW_ZOOM_FACTOR")*_,l=r/i,v=u.rect.element.width,h=u.rect.element.height,I=v,d=I*l;l>1?d=(I=Math.min(i,v*s))*l:I=(d=Math.min(r,h*s))/l;var p=L(t,I,d,n),M=function(){var n=u.query("GET_IMAGE_PREVIEW_CALCULATE_AVERAGE_IMAGE_COLOR")?W(data):null;f.setMetadata("color",n,!0),"close"in t&&t.close(),u.ref.overlayShadow.opacity=1,a({root:u,props:c,image:p})},g=f.getMetadata("filter");g?e(u,g,p).then(M):M()}};if(n=f.file,i=window.navigator.userAgent.match(/Firefox\/([0-9]+)\./),null!==(o=i?parseInt(i[1]):null)&&o<=58||!("createImageBitmap"in window)||!C(n))_();else{var l=r(D);l.post({file:f.file},(function(t){l.terminate(),t?s(t):_()}))}}},DID_UPDATE_ITEM_METADATA:function(t){var n,i,r=t.root,o=t.props,u=t.action;if(/crop|filter|markup|resize/.test(u.change.key)&&r.ref.images.length){var c=r.query("GET_ITEM",{id:o.id});if(c)if(/filter/.test(u.change.key))e(r,u.change.value,r.ref.images[r.ref.images.length-1].image);else if(/crop|markup|resize/.test(u.change.key)){var f=c.getMetadata("crop"),E=r.ref.images[r.ref.images.length-1];if(f&&f.aspectRatio&&E.crop&&E.crop.aspectRatio&&Math.abs(f.aspectRatio-E.crop.aspectRatio)>1e-5){var _=function(t){var n=t.root,i=n.ref.images.shift();return i.opacity=0,i.translateY=-15,n.ref.imageViewBin.push(i),i}({root:r});a({root:r,props:o,image:(n=_.image,(i=i||document.createElement("canvas")).width=n.width,i.height=n.height,i.getContext("2d").drawImage(n,0,0),i)})}else!function(t){var n=t.root,i=n.query("GET_ITEM",{id:t.props.id});if(i){var r=n.ref.images[n.ref.images.length-1];r.crop=i.getMetadata("crop"),r.background=n.query("GET_IMAGE_TRANSFORM_CANVAS_BACKGROUND_COLOR"),n.query("GET_IMAGE_PREVIEW_MARKUP_SHOW")&&(r.dirty=!0,r.resize=i.getMetadata("resize"),r.markup=i.getMetadata("markup"))}}({root:r,props:o})}}},DID_THROW_ITEM_LOAD_ERROR:u,DID_THROW_ITEM_PROCESSING_ERROR:u,DID_THROW_ITEM_INVALID:u,DID_COMPLETE_ITEM_PROCESSING:function(t){var n=t.root;n.ref.overlayShadow.opacity=.25,n.ref.overlaySuccess.opacity=1},DID_START_ITEM_PROCESSING:o,DID_REVERT_ITEM_PROCESSING:o},(function(t){var n=t.root,i=n.ref.imageViewBin.filter((function(t){return 0===t.opacity}));n.ref.imageViewBin=n.ref.imageViewBin.filter((function(t){return t.opacity>0})),i.forEach((function(t){return function(t,n){t.removeChildView(n),n.image.width=1,n.image.height=1,n._destroy()}(n,t)})),i.length=0}))})},V=function(t){var n=t.addFilter,i=t.utils,r=i.Type,e=i.createRoute,a=i.isFile,o=k(t);return n("CREATE_VIEW",(function(t){var n=t.view,i=t.query;if((0,t.is)("file")&&i("GET_ALLOW_IMAGE_PREVIEW")){var r=function(t){t.root.ref.shouldRescale=!0};n.registerWriter(e({DID_RESIZE_ROOT:r,DID_STOP_RESIZE:r,DID_LOAD_ITEM:function(t){var r=t.root,e=t.props.id,u=i("GET_ITEM",e);if(u&&a(u.file)&&!u.archived){var c=u.file;if(function(t){return/^image/.test(t.type)}(c)&&i("GET_IMAGE_PREVIEW_FILTER_ITEM")(u)){var f="createImageBitmap"in(window||{}),E=i("GET_IMAGE_PREVIEW_MAX_FILE_SIZE");if(!(!f&&E&&c.size>E)){r.ref.imagePreview=n.appendChildView(n.createChildView(o,{id:e}));var _=r.query("GET_IMAGE_PREVIEW_HEIGHT");_&&r.dispatch("DID_UPDATE_PANEL_HEIGHT",{id:u.id,height:_});var s=!f&&c.size>i("GET_IMAGE_PREVIEW_MAX_INSTANT_PREVIEW_FILE_SIZE");r.dispatch("DID_IMAGE_PREVIEW_CONTAINER_CREATE",{id:e},s)}}}},DID_IMAGE_PREVIEW_CALCULATE_SIZE:function(t){var n=t.root,i=t.action;n.ref.imageWidth=i.width,n.ref.imageHeight=i.height,n.ref.shouldRescale=!0,n.ref.shouldDrawPreview=!0,n.dispatch("KICK")},DID_UPDATE_ITEM_METADATA:function(t){"crop"===t.action.change.key&&(t.root.ref.shouldRescale=!0)}},(function(t){var n=t.root,i=t.props;n.ref.imagePreview&&(n.rect.element.hidden||(n.ref.shouldRescale&&(function(t,n){if(t.ref.imagePreview){var i=t.query("GET_ITEM",{id:n.id});if(i){var r=t.query("GET_PANEL_ASPECT_RATIO"),e=t.query("GET_ITEM_PANEL_ASPECT_RATIO"),a=t.query("GET_IMAGE_PREVIEW_HEIGHT");if(!(r||e||a)){var o=t.ref,u=o.imageWidth,c=o.imageHeight;if(u&&c){var f=t.query("GET_IMAGE_PREVIEW_MIN_HEIGHT"),E=t.query("GET_IMAGE_PREVIEW_MAX_HEIGHT"),_=(i.getMetadata("exif")||{}).orientation||-1;if(_>=5&&_<=8){var s=[c,u];u=s[0],c=s[1]}if(!C(i.file)||t.query("GET_IMAGE_PREVIEW_UPSCALE")){var l=2048/u;u*=l,c*=l}var v=c/u,h=(i.getMetadata("crop")||{}).aspectRatio||v,I=Math.max(f,Math.min(c,E)),d=Math.min(t.rect.element.width*h,I);t.dispatch("DID_UPDATE_PANEL_HEIGHT",{id:i.id,height:d})}}}}}(n,i),n.ref.shouldRescale=!1),n.ref.shouldDrawPreview&&(requestAnimationFrame((function(){requestAnimationFrame((function(){n.dispatch("DID_FINISH_CALCULATE_PREVIEWSIZE",{id:i.id})}))})),n.ref.shouldDrawPreview=!1)))})))}})),{options:{allowImagePreview:[!0,r.BOOLEAN],imagePreviewFilterItem:[function(){return!0},r.FUNCTION],imagePreviewHeight:[null,r.INT],imagePreviewMinHeight:[44,r.INT],imagePreviewMaxHeight:[256,r.INT],imagePreviewMaxFileSize:[null,r.INT],imagePreviewZoomFactor:[2,r.INT],imagePreviewUpscale:[!1,r.BOOLEAN],imagePreviewMaxInstantPreviewFileSize:[1e6,r.INT],imagePreviewTransparencyIndicator:[null,r.STRING],imagePreviewCalculateAverageImageColor:[!1,r.BOOLEAN],imagePreviewMarkupShow:[!0,r.BOOLEAN],imagePreviewMarkupFilter:[function(){return!0},r.FUNCTION]}}};return"undefined"!=typeof window&&void 0!==window.document&&document.dispatchEvent(new CustomEvent("FilePond:pluginloaded",{detail:V})),V}()),r.exports),a=n({__proto__:null,default:t(e)},[e]);
5
5
  /*!
6
6
  * FilePondPluginImagePreview 4.6.12
7
7
  * Licensed under MIT, https://opensource.org/licenses/MIT/
@@ -0,0 +1,4 @@
1
+ /*!
2
+ * Crafted with ❤ by Salla
3
+ */
4
+ const s=new Map,a=s=>!1===salla.config.get(`store.settings.cart.has_${s}_coupons`),e=()=>{s.clear()},o=()=>{["cart::coupon.added","cart::coupon.deleted"].forEach((s=>{salla.event.off(s,e),salla.event.on(s,e)}));const a=(()=>{const s=salla.config.get("store.scope",salla.storage.get("scope"));return[...["store.id","user.currency_code","user.language_code"].map((s=>String(salla.config.get(s,"")))),String(s?.id??"")].join("|")})();let o=s.get(a);if(!o){o=salla.api.request("coupons"),s.set(a,o);const e=o;e.catch((()=>{s.get(a)===e&&s.delete(a)}))}return o};export{o as g,a as i}