@salla.sa/twilight-components 3.0.14 → 3.0.16

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 (386) hide show
  1. package/dist/cjs/{Helper-BQjkdKQR.js → Helper-BV6HUQzI.js} +1 -1
  2. package/dist/cjs/{filepond-CxskOYg4.js → filepond-hJcaHnfM.js} +1 -1
  3. package/dist/cjs/{filepond-plugin-file-poster-B07yRMJ1.js → filepond-plugin-file-poster-DDkDXFOe.js} +1 -1
  4. package/dist/cjs/{filepond-plugin-file-validate-size-DBnT1Dbq.js → filepond-plugin-file-validate-size-BBZimb8J.js} +1 -1
  5. package/dist/cjs/{filepond-plugin-file-validate-type-7J10P-y_.js → filepond-plugin-file-validate-type-B5VDnf33.js} +1 -1
  6. package/dist/cjs/{filepond-plugin-image-edit-BCeiF3bq.js → filepond-plugin-image-edit-Cmuqwdn1.js} +1 -1
  7. package/dist/cjs/{filepond-plugin-image-exif-orientation-BGLPVh4r.js → filepond-plugin-image-exif-orientation-BFjHgWMS.js} +1 -1
  8. package/dist/cjs/{filepond-plugin-image-preview-CiJf5BH6.js → filepond-plugin-image-preview-C7Ow81pR.js} +1 -1
  9. package/dist/cjs/{index-_VQc877V.js → index-PB4iLztN.js} +11 -11
  10. package/dist/cjs/{intlTelInput-CtIksZen.js → intlTelInput-Ds-AW6H6.js} +1 -1
  11. package/dist/cjs/loader.cjs.js +1 -1
  12. package/dist/cjs/salla-accordion-body_2.cjs.entry.js +1 -1
  13. package/dist/cjs/salla-accordion_6.cjs.entry.js +3 -3
  14. package/dist/cjs/salla-add-product-button_5.cjs.entry.js +21 -8
  15. package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
  16. package/dist/cjs/salla-alert_2.cjs.entry.js +1 -1
  17. package/dist/cjs/salla-app-install-alert.cjs.entry.js +1 -1
  18. package/dist/cjs/salla-applied-filters.cjs.entry.js +2 -2
  19. package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
  20. package/dist/cjs/salla-attachment-view_9.cjs.entry.js +101 -17
  21. package/dist/cjs/salla-badge.cjs.entry.js +1 -1
  22. package/dist/cjs/salla-basket-gap.cjs.entry.js +1 -1
  23. package/dist/cjs/salla-bullet-delivery_3.cjs.entry.js +22 -9
  24. package/dist/cjs/salla-cart-coupons.cjs.entry.js +1 -1
  25. package/dist/cjs/salla-cart-item-offers_2.cjs.entry.js +1 -1
  26. package/dist/cjs/salla-cart-summary-card.cjs.entry.js +1 -1
  27. package/dist/cjs/salla-cashback-banner.cjs.entry.js +1 -1
  28. package/dist/cjs/salla-comment-factors.cjs.entry.js +1 -1
  29. package/dist/cjs/salla-comment-form_9.cjs.entry.js +2 -2
  30. package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
  31. package/dist/cjs/salla-contacts.cjs.entry.js +1 -1
  32. package/dist/cjs/salla-cookies-bar.cjs.entry.js +1 -1
  33. package/dist/cjs/salla-count-down.cjs.entry.js +1 -1
  34. package/dist/cjs/salla-custom-fields.cjs.entry.js +1 -1
  35. package/dist/cjs/salla-delivery-promise.cjs.entry.js +1 -1
  36. package/dist/cjs/salla-edit-order-button.cjs.entry.js +1 -1
  37. package/dist/cjs/salla-filters-widget.cjs.entry.js +16 -7
  38. package/dist/cjs/salla-filters.cjs.entry.js +2 -2
  39. package/dist/cjs/salla-free-shipping-banner.cjs.entry.js +1 -1
  40. package/dist/cjs/salla-free-shipping-tag.cjs.entry.js +1 -1
  41. package/dist/cjs/salla-fulfillment-methods.cjs.entry.js +1 -1
  42. package/dist/cjs/salla-gift-card-redeem_2.cjs.entry.js +1 -1
  43. package/dist/cjs/salla-gifting.cjs.entry.js +1 -1
  44. package/dist/cjs/salla-hook.cjs.entry.js +1 -1
  45. package/dist/cjs/salla-infinite-scroll.cjs.entry.js +2 -2
  46. package/dist/cjs/salla-installment.cjs.entry.js +1 -1
  47. package/dist/cjs/salla-list-tile.cjs.entry.js +1 -1
  48. package/dist/cjs/salla-localization-modal.cjs.entry.js +1 -1
  49. package/dist/cjs/salla-login-modal.cjs.entry.js +1 -1
  50. package/dist/cjs/salla-loyalty-banner_10.cjs.entry.js +1 -1
  51. package/dist/cjs/salla-loyalty-exchange-product-card.cjs.entry.js +1 -1
  52. package/dist/cjs/salla-loyalty-points-banner.cjs.entry.js +1 -1
  53. package/dist/cjs/salla-loyalty-points-history.cjs.entry.js +1 -1
  54. package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
  55. package/dist/cjs/salla-loyalty.cjs.entry.js +1 -1
  56. package/dist/cjs/salla-maintenance-alert.cjs.entry.js +1 -1
  57. package/dist/cjs/salla-map_3.cjs.entry.js +1 -1
  58. package/dist/cjs/salla-menu.cjs.entry.js +1 -1
  59. package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
  60. package/dist/cjs/salla-multiple-bundle-product-cart_2.cjs.entry.js +28 -12
  61. package/dist/cjs/salla-multiple-bundle-product-options-modal_2.cjs.entry.js +1 -1
  62. package/dist/cjs/salla-multiple-bundle-product.cjs.entry.js +2 -2
  63. package/dist/cjs/salla-next-order-coupon.cjs.entry.js +1 -1
  64. package/dist/cjs/salla-notification-item_2.cjs.entry.js +2 -2
  65. package/dist/cjs/salla-offer-modal.cjs.entry.js +1 -1
  66. package/dist/cjs/salla-offer.cjs.entry.js +1 -1
  67. package/dist/cjs/salla-order-branch.cjs.entry.js +1 -1
  68. package/dist/cjs/salla-order-cancel.cjs.entry.js +1 -1
  69. package/dist/cjs/salla-order-details-multiple-bundle-product.cjs.entry.js +1 -1
  70. package/dist/cjs/salla-order-details-options.cjs.entry.js +1 -1
  71. package/dist/cjs/salla-order-details.cjs.entry.js +1 -1
  72. package/dist/cjs/salla-order-edit-item.cjs.entry.js +1 -1
  73. package/dist/cjs/salla-order-edit-product-card.cjs.entry.js +1 -1
  74. package/dist/cjs/salla-order-edit.cjs.entry.js +1 -1
  75. package/dist/cjs/salla-order-items.cjs.entry.js +1 -1
  76. package/dist/cjs/salla-order-options-modal.cjs.entry.js +1 -1
  77. package/dist/cjs/salla-order-payment.cjs.entry.js +1 -1
  78. package/dist/cjs/salla-order-rewards.cjs.entry.js +1 -1
  79. package/dist/cjs/salla-order-shipments.cjs.entry.js +1 -1
  80. package/dist/cjs/salla-order-summary.cjs.entry.js +1 -1
  81. package/dist/cjs/salla-order-totals-card.cjs.entry.js +1 -1
  82. package/dist/cjs/salla-orders.cjs.entry.js +2 -2
  83. package/dist/cjs/salla-payments.cjs.entry.js +1 -1
  84. package/dist/cjs/salla-placeholder.cjs.entry.js +1 -1
  85. package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
  86. package/dist/cjs/salla-product-card-embed.cjs.entry.js +1 -1
  87. package/dist/cjs/salla-product-card.cjs.entry.js +1 -1
  88. package/dist/cjs/salla-product-size-guide.cjs.entry.js +1 -1
  89. package/dist/cjs/salla-products-list.cjs.entry.js +2 -2
  90. package/dist/cjs/salla-products-slider.cjs.entry.js +2 -2
  91. package/dist/cjs/salla-quick-order.cjs.entry.js +1 -1
  92. package/dist/cjs/salla-rating-modal-v2.cjs.entry.js +2 -2
  93. package/dist/cjs/salla-rating-modal.cjs.entry.js +2 -2
  94. package/dist/cjs/salla-review-factors-tags.cjs.entry.js +1 -1
  95. package/dist/cjs/salla-review-order-item.cjs.entry.js +1 -1
  96. package/dist/cjs/salla-scopes.cjs.entry.js +2 -2
  97. package/dist/cjs/salla-search-product-card.cjs.entry.js +1 -1
  98. package/dist/cjs/salla-search.cjs.entry.js +2 -2
  99. package/dist/cjs/salla-skeleton.cjs.entry.js +1 -1
  100. package/dist/cjs/salla-social-share.cjs.entry.js +1 -1
  101. package/dist/cjs/salla-social.cjs.entry.js +1 -1
  102. package/dist/cjs/salla-tab-content_3.cjs.entry.js +1 -1
  103. package/dist/cjs/salla-thank-you-header.cjs.entry.js +1 -1
  104. package/dist/cjs/salla-thank-you-page.cjs.entry.js +1 -1
  105. package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
  106. package/dist/cjs/salla-trust-badges.cjs.entry.js +1 -1
  107. package/dist/cjs/salla-user-menu.cjs.entry.js +1 -1
  108. package/dist/cjs/salla-user-profile.cjs.entry.js +1 -1
  109. package/dist/cjs/salla-user-settings.cjs.entry.js +1 -1
  110. package/dist/cjs/salla-verify.cjs.entry.js +1 -1
  111. package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
  112. package/dist/cjs/salla-wishlist-actions.cjs.entry.js +1 -1
  113. package/dist/cjs/salla-wishlist-summary.cjs.entry.js +2 -2
  114. package/dist/cjs/twilight.cjs.js +1 -1
  115. package/dist/cjs/{vanilla-picker-C9MGx2jV.js → vanilla-picker-ZsewI4gd.js} +1 -1
  116. package/dist/collection/components/salla-bullet-delivery/salla-bullet-delivery.css +11 -6
  117. package/dist/collection/components/salla-color-picker/color-popup-placement.js +68 -0
  118. package/dist/collection/components/salla-color-picker/salla-color-picker.css +13 -1
  119. package/dist/collection/components/salla-color-picker/salla-color-picker.js +24 -5
  120. package/dist/collection/components/salla-filters-widget/salla-filters-widget.js +14 -5
  121. package/dist/collection/components/salla-modal/salla-modal.css +4 -2
  122. package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-details.js +27 -11
  123. package/dist/collection/components/salla-multiple-bundle-product/salla-multiple-bundle-product.css +3 -0
  124. package/dist/collection/components/salla-product-options/salla-product-options.css +5 -0
  125. package/dist/collection/components/salla-product-options/salla-product-options.js +5 -1
  126. package/dist/collection/components/salla-quick-buy/salla-quick-buy.js +9 -1
  127. package/dist/collection/components/salla-scopes/salla-scopes.js +1 -1
  128. package/dist/collection/components/salla-searchable-dropdown/salla-searchable-dropdown.css +8 -2
  129. package/dist/collection/components/salla-searchable-dropdown/salla-searchable-dropdown.js +19 -6
  130. package/dist/components/index.js +11 -11
  131. package/dist/components/salla-bullet-delivery.js +1 -1
  132. package/dist/components/salla-color-picker2.js +90 -6
  133. package/dist/components/salla-filters-widget2.js +14 -5
  134. package/dist/components/salla-modal2.js +1 -1
  135. package/dist/components/salla-multiple-bundle-product-details2.js +27 -11
  136. package/dist/components/salla-multiple-bundle-product.js +1 -1
  137. package/dist/components/salla-product-options2.js +6 -2
  138. package/dist/components/salla-quick-buy2.js +13 -4
  139. package/dist/components/salla-scopes.js +1 -1
  140. package/dist/components/salla-searchable-dropdown2.js +20 -7
  141. package/dist/docs.json +1 -1
  142. package/dist/esm/{Helper-ugQ_d05z.js → Helper-CsyfMJLx.js} +1 -1
  143. package/dist/esm/{filepond-CK3iWGQr.js → filepond-Cla3ae_2.js} +1 -1
  144. package/dist/esm/{filepond-plugin-file-poster-BLnEbCEA.js → filepond-plugin-file-poster-BO0nARSu.js} +1 -1
  145. package/dist/esm/{filepond-plugin-file-validate-size-C-wYn6MJ.js → filepond-plugin-file-validate-size-CrcZ7P5c.js} +1 -1
  146. package/dist/esm/{filepond-plugin-file-validate-type-C3sGrm0S.js → filepond-plugin-file-validate-type-Cci8f5e3.js} +1 -1
  147. package/dist/esm/{filepond-plugin-image-edit-cPTJjenQ.js → filepond-plugin-image-edit-y0q-Gkyo.js} +1 -1
  148. package/dist/esm/{filepond-plugin-image-exif-orientation-DydDGbir.js → filepond-plugin-image-exif-orientation-WYrkP26J.js} +1 -1
  149. package/dist/esm/{filepond-plugin-image-preview-qzrPDdAI.js → filepond-plugin-image-preview-Bz0ZRBQp.js} +1 -1
  150. package/dist/esm/{index-Dn-G-rYP.js → index-DJuBNP7w.js} +11 -11
  151. package/dist/esm/{intlTelInput-T1Xx9nML.js → intlTelInput-Dcl0COqn.js} +1 -1
  152. package/dist/esm/loader.js +2 -2
  153. package/dist/esm/salla-accordion-body_2.entry.js +1 -1
  154. package/dist/esm/salla-accordion_6.entry.js +3 -3
  155. package/dist/esm/salla-add-product-button_5.entry.js +21 -8
  156. package/dist/esm/salla-advertisement.entry.js +1 -1
  157. package/dist/esm/salla-alert_2.entry.js +1 -1
  158. package/dist/esm/salla-app-install-alert.entry.js +1 -1
  159. package/dist/esm/salla-applied-filters.entry.js +2 -2
  160. package/dist/esm/salla-apps-icons.entry.js +1 -1
  161. package/dist/esm/salla-attachment-view_9.entry.js +101 -17
  162. package/dist/esm/salla-badge.entry.js +1 -1
  163. package/dist/esm/salla-basket-gap.entry.js +1 -1
  164. package/dist/esm/salla-bullet-delivery_3.entry.js +22 -9
  165. package/dist/esm/salla-cart-coupons.entry.js +1 -1
  166. package/dist/esm/salla-cart-item-offers_2.entry.js +1 -1
  167. package/dist/esm/salla-cart-summary-card.entry.js +1 -1
  168. package/dist/esm/salla-cashback-banner.entry.js +1 -1
  169. package/dist/esm/salla-comment-factors.entry.js +1 -1
  170. package/dist/esm/salla-comment-form_9.entry.js +2 -2
  171. package/dist/esm/salla-conditional-offer.entry.js +1 -1
  172. package/dist/esm/salla-contacts.entry.js +1 -1
  173. package/dist/esm/salla-cookies-bar.entry.js +1 -1
  174. package/dist/esm/salla-count-down.entry.js +1 -1
  175. package/dist/esm/salla-custom-fields.entry.js +1 -1
  176. package/dist/esm/salla-delivery-promise.entry.js +1 -1
  177. package/dist/esm/salla-edit-order-button.entry.js +1 -1
  178. package/dist/esm/salla-filters-widget.entry.js +16 -7
  179. package/dist/esm/salla-filters.entry.js +2 -2
  180. package/dist/esm/salla-free-shipping-banner.entry.js +1 -1
  181. package/dist/esm/salla-free-shipping-tag.entry.js +1 -1
  182. package/dist/esm/salla-fulfillment-methods.entry.js +1 -1
  183. package/dist/esm/salla-gift-card-redeem_2.entry.js +1 -1
  184. package/dist/esm/salla-gifting.entry.js +1 -1
  185. package/dist/esm/salla-hook.entry.js +1 -1
  186. package/dist/esm/salla-infinite-scroll.entry.js +2 -2
  187. package/dist/esm/salla-installment.entry.js +1 -1
  188. package/dist/esm/salla-list-tile.entry.js +1 -1
  189. package/dist/esm/salla-localization-modal.entry.js +1 -1
  190. package/dist/esm/salla-login-modal.entry.js +1 -1
  191. package/dist/esm/salla-loyalty-banner_10.entry.js +1 -1
  192. package/dist/esm/salla-loyalty-exchange-product-card.entry.js +1 -1
  193. package/dist/esm/salla-loyalty-points-banner.entry.js +1 -1
  194. package/dist/esm/salla-loyalty-points-history.entry.js +1 -1
  195. package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
  196. package/dist/esm/salla-loyalty.entry.js +1 -1
  197. package/dist/esm/salla-maintenance-alert.entry.js +1 -1
  198. package/dist/esm/salla-map_3.entry.js +1 -1
  199. package/dist/esm/salla-menu.entry.js +1 -1
  200. package/dist/esm/salla-metadata.entry.js +1 -1
  201. package/dist/esm/salla-multiple-bundle-product-cart_2.entry.js +28 -12
  202. package/dist/esm/salla-multiple-bundle-product-options-modal_2.entry.js +1 -1
  203. package/dist/esm/salla-multiple-bundle-product.entry.js +2 -2
  204. package/dist/esm/salla-next-order-coupon.entry.js +1 -1
  205. package/dist/esm/salla-notification-item_2.entry.js +2 -2
  206. package/dist/esm/salla-offer-modal.entry.js +1 -1
  207. package/dist/esm/salla-offer.entry.js +1 -1
  208. package/dist/esm/salla-order-branch.entry.js +1 -1
  209. package/dist/esm/salla-order-cancel.entry.js +1 -1
  210. package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +1 -1
  211. package/dist/esm/salla-order-details-options.entry.js +1 -1
  212. package/dist/esm/salla-order-details.entry.js +1 -1
  213. package/dist/esm/salla-order-edit-item.entry.js +1 -1
  214. package/dist/esm/salla-order-edit-product-card.entry.js +1 -1
  215. package/dist/esm/salla-order-edit.entry.js +1 -1
  216. package/dist/esm/salla-order-items.entry.js +1 -1
  217. package/dist/esm/salla-order-options-modal.entry.js +1 -1
  218. package/dist/esm/salla-order-payment.entry.js +1 -1
  219. package/dist/esm/salla-order-rewards.entry.js +1 -1
  220. package/dist/esm/salla-order-shipments.entry.js +1 -1
  221. package/dist/esm/salla-order-summary.entry.js +1 -1
  222. package/dist/esm/salla-order-totals-card.entry.js +1 -1
  223. package/dist/esm/salla-orders.entry.js +2 -2
  224. package/dist/esm/salla-payments.entry.js +1 -1
  225. package/dist/esm/salla-placeholder.entry.js +1 -1
  226. package/dist/esm/salla-price-range.entry.js +1 -1
  227. package/dist/esm/salla-product-card-embed.entry.js +1 -1
  228. package/dist/esm/salla-product-card.entry.js +1 -1
  229. package/dist/esm/salla-product-size-guide.entry.js +1 -1
  230. package/dist/esm/salla-products-list.entry.js +2 -2
  231. package/dist/esm/salla-products-slider.entry.js +2 -2
  232. package/dist/esm/salla-quick-order.entry.js +1 -1
  233. package/dist/esm/salla-rating-modal-v2.entry.js +2 -2
  234. package/dist/esm/salla-rating-modal.entry.js +2 -2
  235. package/dist/esm/salla-review-factors-tags.entry.js +1 -1
  236. package/dist/esm/salla-review-order-item.entry.js +1 -1
  237. package/dist/esm/salla-scopes.entry.js +2 -2
  238. package/dist/esm/salla-search-product-card.entry.js +1 -1
  239. package/dist/esm/salla-search.entry.js +2 -2
  240. package/dist/esm/salla-skeleton.entry.js +1 -1
  241. package/dist/esm/salla-social-share.entry.js +1 -1
  242. package/dist/esm/salla-social.entry.js +1 -1
  243. package/dist/esm/salla-tab-content_3.entry.js +1 -1
  244. package/dist/esm/salla-thank-you-header.entry.js +1 -1
  245. package/dist/esm/salla-thank-you-page.entry.js +1 -1
  246. package/dist/esm/salla-tiered-offer.entry.js +1 -1
  247. package/dist/esm/salla-trust-badges.entry.js +1 -1
  248. package/dist/esm/salla-user-menu.entry.js +1 -1
  249. package/dist/esm/salla-user-profile.entry.js +1 -1
  250. package/dist/esm/salla-user-settings.entry.js +1 -1
  251. package/dist/esm/salla-verify.entry.js +1 -1
  252. package/dist/esm/salla-wallet.entry.js +1 -1
  253. package/dist/esm/salla-wishlist-actions.entry.js +1 -1
  254. package/dist/esm/salla-wishlist-summary.entry.js +2 -2
  255. package/dist/esm/twilight.js +2 -2
  256. package/dist/esm/{vanilla-picker-BOVm7kmN.js → vanilla-picker-DPvEywPm.js} +1 -1
  257. package/dist/twilight/{p-f5f11216.entry.js → p-03e6d42b.entry.js} +1 -1
  258. package/dist/twilight/{p-5bc57eed.entry.js → p-05e1fc6a.entry.js} +1 -1
  259. package/dist/twilight/{p-7ab19f36.entry.js → p-09c651a2.entry.js} +1 -1
  260. package/dist/twilight/{p-e7ea698c.entry.js → p-0c292c9a.entry.js} +1 -1
  261. package/dist/twilight/{p-b6091333.entry.js → p-1267d95a.entry.js} +1 -1
  262. package/dist/twilight/{p-b4d9592e.entry.js → p-134692f5.entry.js} +1 -1
  263. package/dist/twilight/{p-8f3dc174.entry.js → p-1436b465.entry.js} +1 -1
  264. package/dist/twilight/{p-5c66077d.entry.js → p-15098cb1.entry.js} +1 -1
  265. package/dist/twilight/{p-f1a17520.entry.js → p-189fa3c4.entry.js} +1 -1
  266. package/dist/twilight/{p-d2ad4fb1.entry.js → p-19bf11c5.entry.js} +1 -1
  267. package/dist/twilight/{p-981c4a07.entry.js → p-1a7b0a2b.entry.js} +1 -1
  268. package/dist/twilight/{p-52eafe02.entry.js → p-1c2d9885.entry.js} +1 -1
  269. package/dist/twilight/{p-990aab23.entry.js → p-1e7a0a4f.entry.js} +1 -1
  270. package/dist/twilight/{p-9427a193.entry.js → p-20642013.entry.js} +1 -1
  271. package/dist/twilight/{p-66ef5e3b.entry.js → p-2ce991e8.entry.js} +1 -1
  272. package/dist/twilight/p-33689489.entry.js +4 -0
  273. package/dist/twilight/{p-335f1b26.entry.js → p-343f57ea.entry.js} +1 -1
  274. package/dist/twilight/{p-7aa902e6.entry.js → p-370924c0.entry.js} +1 -1
  275. package/dist/twilight/{p-bfa4a20f.entry.js → p-382dc313.entry.js} +1 -1
  276. package/dist/twilight/{p-684b21cf.entry.js → p-3b3f1838.entry.js} +1 -1
  277. package/dist/twilight/p-3b4aa865.entry.js +4 -0
  278. package/dist/twilight/{p-70f78e11.entry.js → p-3b6efc6e.entry.js} +1 -1
  279. package/dist/twilight/{p-05262172.entry.js → p-3cbcec7c.entry.js} +1 -1
  280. package/dist/twilight/p-3f701181.entry.js +4 -0
  281. package/dist/twilight/p-3f713fc0.entry.js +4 -0
  282. package/dist/twilight/{p-39c11b35.entry.js → p-43700093.entry.js} +1 -1
  283. package/dist/twilight/{p-2bb77526.entry.js → p-43a4e000.entry.js} +1 -1
  284. package/dist/twilight/{p-599174df.entry.js → p-48fb615e.entry.js} +1 -1
  285. package/dist/twilight/{p-8437a046.entry.js → p-4a07e070.entry.js} +1 -1
  286. package/dist/twilight/{p-283a2486.entry.js → p-4a3d4c28.entry.js} +1 -1
  287. package/dist/twilight/{p-09bf959a.entry.js → p-4a843e15.entry.js} +1 -1
  288. package/dist/twilight/{p-fc6062ff.entry.js → p-4be6e307.entry.js} +1 -1
  289. package/dist/twilight/{p-ea07e117.entry.js → p-52749db7.entry.js} +1 -1
  290. package/dist/twilight/{p-c089ca19.entry.js → p-537748de.entry.js} +1 -1
  291. package/dist/twilight/{p-5de673df.entry.js → p-558f8ee0.entry.js} +1 -1
  292. package/dist/twilight/{p-ec989a0b.entry.js → p-5aa8ec0a.entry.js} +1 -1
  293. package/dist/twilight/{p-38e5d462.entry.js → p-5b52ef24.entry.js} +1 -1
  294. package/dist/twilight/{p-5ceb5a28.entry.js → p-5b60ebdf.entry.js} +1 -1
  295. package/dist/twilight/{p-efe2645b.entry.js → p-5e8b7483.entry.js} +1 -1
  296. package/dist/twilight/{p-dcb56554.entry.js → p-5f1b28e3.entry.js} +1 -1
  297. package/dist/twilight/{p-bcdd8e20.entry.js → p-5f5c4f3c.entry.js} +1 -1
  298. package/dist/twilight/{p-9613f87f.entry.js → p-615edf90.entry.js} +1 -1
  299. package/dist/twilight/{p-e7a73278.entry.js → p-63053048.entry.js} +1 -1
  300. package/dist/twilight/{p-2e89ccdc.entry.js → p-67bb5e0c.entry.js} +1 -1
  301. package/dist/twilight/{p-b8611dc1.entry.js → p-6a8d04d9.entry.js} +1 -1
  302. package/dist/twilight/{p-b0b0cd7e.entry.js → p-70d5d802.entry.js} +1 -1
  303. package/dist/twilight/{p-b02e0f10.entry.js → p-72092eff.entry.js} +1 -1
  304. package/dist/twilight/{p-ebed26e5.entry.js → p-74238c01.entry.js} +1 -1
  305. package/dist/twilight/{p-9bb4bbae.entry.js → p-75015061.entry.js} +1 -1
  306. package/dist/twilight/{p-d9a48543.entry.js → p-788c0264.entry.js} +1 -1
  307. package/dist/twilight/{p-59ed15d0.entry.js → p-792f1e05.entry.js} +1 -1
  308. package/dist/twilight/{p-66425015.entry.js → p-8278e31a.entry.js} +1 -1
  309. package/dist/twilight/{p-5a351bdd.entry.js → p-82d50064.entry.js} +1 -1
  310. package/dist/twilight/{p-4655a08a.entry.js → p-86ade991.entry.js} +1 -1
  311. package/dist/twilight/{p-b7b764f3.entry.js → p-86db3fe8.entry.js} +1 -1
  312. package/dist/twilight/{p-26087245.entry.js → p-8907ef61.entry.js} +1 -1
  313. package/dist/twilight/{p-50a77bcb.entry.js → p-8a7bce99.entry.js} +1 -1
  314. package/dist/twilight/{p-b1aa9b07.entry.js → p-8b72b7a2.entry.js} +1 -1
  315. package/dist/twilight/{p-34df5588.entry.js → p-8cb6dfd9.entry.js} +1 -1
  316. package/dist/twilight/{p-962a2992.entry.js → p-8e6bc10e.entry.js} +1 -1
  317. package/dist/twilight/{p-13d92c04.entry.js → p-91ef7c89.entry.js} +1 -1
  318. package/dist/twilight/{p-aa5b00be.entry.js → p-927d1967.entry.js} +1 -1
  319. package/dist/twilight/{p-f14048bd.entry.js → p-951f1af4.entry.js} +1 -1
  320. package/dist/twilight/{p-e8b90fe9.entry.js → p-96be66eb.entry.js} +1 -1
  321. package/dist/twilight/{p-5f6c393d.entry.js → p-96e16a6b.entry.js} +1 -1
  322. package/dist/twilight/{p-19d5537e.entry.js → p-9b02e779.entry.js} +1 -1
  323. package/dist/twilight/{p-8b0230f7.entry.js → p-9b46c1ab.entry.js} +1 -1
  324. package/dist/twilight/{p-e1eca1c0.entry.js → p-9e24dec9.entry.js} +1 -1
  325. package/dist/twilight/{p-230d1bae.entry.js → p-9e8c583a.entry.js} +1 -1
  326. package/dist/twilight/{p-bb653aa9.entry.js → p-9f920812.entry.js} +1 -1
  327. package/dist/twilight/{p-0dc3f5c3.entry.js → p-9f9ab89c.entry.js} +1 -1
  328. package/dist/twilight/{p-BCAqnsw2.js → p-BPjqOy84.js} +1 -1
  329. package/dist/twilight/{p-iyDT2D68.js → p-BgGU8BXX.js} +1 -1
  330. package/dist/twilight/{p-CByYU0cc.js → p-C9eNuCn7.js} +1 -1
  331. package/dist/twilight/{p-CTMAmboj.js → p-CRYD9K0S.js} +1 -1
  332. package/dist/twilight/{p-CQzEIWvJ.js → p-CqENl4Wm.js} +1 -1
  333. package/dist/twilight/{p-BT-nRs3_.js → p-DCUZjQXX.js} +1 -1
  334. package/dist/twilight/{p-BDRIrndf.js → p-DHk7-wXk.js} +1 -1
  335. package/dist/twilight/p-DJuBNP7w.js +5 -0
  336. package/dist/twilight/p-DliR9Sp1.js +9 -0
  337. package/dist/twilight/{p-BbBadi9B.js → p-Do-w5Os8.js} +1 -1
  338. package/dist/twilight/{p-392658ea.entry.js → p-a16f2376.entry.js} +1 -1
  339. package/dist/twilight/{p-0747fdf2.entry.js → p-a36e2dcf.entry.js} +1 -1
  340. package/dist/twilight/{p-f75a8197.entry.js → p-a6ba5168.entry.js} +1 -1
  341. package/dist/twilight/{p-72051130.entry.js → p-a7d2613b.entry.js} +1 -1
  342. package/dist/twilight/{p-61a94823.entry.js → p-a8f88ea6.entry.js} +1 -1
  343. package/dist/twilight/p-a92e5068.entry.js +4 -0
  344. package/dist/twilight/{p-e57bbd99.entry.js → p-a9a8a819.entry.js} +1 -1
  345. package/dist/twilight/{p-ced36894.entry.js → p-aa210c8a.entry.js} +1 -1
  346. package/dist/twilight/{p-f38619d5.entry.js → p-b1aa33f3.entry.js} +1 -1
  347. package/dist/twilight/{p-ae2b2f4e.entry.js → p-b798788b.entry.js} +1 -1
  348. package/dist/twilight/{p-c3a4cf47.entry.js → p-b891f863.entry.js} +1 -1
  349. package/dist/twilight/{p-6a689318.entry.js → p-b90d0e51.entry.js} +1 -1
  350. package/dist/twilight/{p-32a4f4fa.entry.js → p-be203bd9.entry.js} +1 -1
  351. package/dist/twilight/{p-761ff2ee.entry.js → p-be84879f.entry.js} +1 -1
  352. package/dist/twilight/{p-150b90b8.entry.js → p-bf12f616.entry.js} +1 -1
  353. package/dist/twilight/{p-ac2ebf6b.entry.js → p-c33be542.entry.js} +1 -1
  354. package/dist/twilight/{p-8ea4b8bf.entry.js → p-c657883d.entry.js} +1 -1
  355. package/dist/twilight/{p-cc3a777c.entry.js → p-caac5694.entry.js} +1 -1
  356. package/dist/twilight/{p-80512599.entry.js → p-cfe523ab.entry.js} +1 -1
  357. package/dist/twilight/{p-290c8241.entry.js → p-d5b394c9.entry.js} +1 -1
  358. package/dist/twilight/{p-6899b648.entry.js → p-dcfd3688.entry.js} +1 -1
  359. package/dist/twilight/{p-ca8277a1.entry.js → p-de458068.entry.js} +1 -1
  360. package/dist/twilight/{p-93fcb7e3.entry.js → p-def7b9c4.entry.js} +1 -1
  361. package/dist/twilight/{p-d7203748.entry.js → p-e651c3ee.entry.js} +1 -1
  362. package/dist/twilight/{p-97e38038.entry.js → p-e66f1b70.entry.js} +1 -1
  363. package/dist/twilight/p-e67fdc9d.entry.js +4 -0
  364. package/dist/twilight/{p-501bb75a.entry.js → p-ebb756bc.entry.js} +1 -1
  365. package/dist/twilight/{p-5b34ccd4.entry.js → p-f1037da9.entry.js} +1 -1
  366. package/dist/twilight/{p-c4327d6f.entry.js → p-f2062f34.entry.js} +1 -1
  367. package/dist/twilight/{p-c8659c23.entry.js → p-f24a477c.entry.js} +1 -1
  368. package/dist/twilight/{p-b117b67e.entry.js → p-f46da712.entry.js} +1 -1
  369. package/dist/twilight/{p-BsTxLQBI.js → p-pOFi82Pb.js} +1 -1
  370. package/dist/twilight/twilight.esm.js +1 -1
  371. package/dist/types/components/salla-color-picker/color-popup-placement.d.ts +49 -0
  372. package/dist/types/components/salla-color-picker/salla-color-picker.d.ts +1 -1
  373. package/dist/types/components/salla-filters-widget/salla-filters-widget.d.ts +2 -0
  374. package/dist/types/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-details.d.ts +2 -0
  375. package/dist/types/components/salla-quick-buy/salla-quick-buy.d.ts +1 -0
  376. package/dist/types/components/salla-scopes/interfaces.d.ts +2 -0
  377. package/dist/types/components/salla-searchable-dropdown/salla-searchable-dropdown.d.ts +4 -0
  378. package/package.json +5 -5
  379. package/dist/twilight/p-1ba2b88b.entry.js +0 -4
  380. package/dist/twilight/p-2e744c1d.entry.js +0 -4
  381. package/dist/twilight/p-3ee7714e.entry.js +0 -4
  382. package/dist/twilight/p-6925ffe5.entry.js +0 -4
  383. package/dist/twilight/p-CtmwvhFW.js +0 -9
  384. package/dist/twilight/p-Dn-G-rYP.js +0 -5
  385. package/dist/twilight/p-c16b1399.entry.js +0 -4
  386. package/dist/twilight/p-c1e27a9b.entry.js +0 -4
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as e,c as t,h as i}from"./p-Dn-G-rYP.js";import{C as s}from"./p-C6jIkM-X.js";import{F as r}from"./p-OF8QcbMM.js";const o=class{constructor(i){e(this,i),this.fieldChanged=t(this,"fieldChanged"),this.fileUploaded=t(this,"fileUploaded"),this.isEditable=!0,this.fieldErrors={},this.isSubmitting=!1}get dragAndDropText(){return salla.lang.get("common.uploader.drag_and_drop")}get browseText(){return salla.lang.get("common.uploader.browse")}get saveButtonText(){return salla.lang.get("common.elements.save")}async setFields(e){this.parsedFields=e}async getFieldValues(){return this.parsedFields?.reduce(((e,t)=>(e[`custom_fields[${t.id}]`]=t.value,e)),{})||{}}async validateFields(){if(!this.parsedFields)return!0;const e=this.parsedFields.reduce(((e,t)=>(!t.required||t.value&&""!==t.value||(e[t.id.toString()]=`${t.label} is required`),e)),{});return this.fieldErrors=e,0===Object.keys(e).length}handleFieldChange(e,t){const i=t.target.value;e.value=i,this.clearFieldError(e.id);const s=!(e.required&&!i);s||this.setFieldError(e.id,`${e.label} is required`),this.fieldChanged.emit({fieldId:e.id,value:i,isValid:s})}handleFileUpload(e,t){const{error:i,file:s}=t.detail,r=!i;this.clearFieldError(e.id),r?e.value=s:this.setFieldError(e.id,"File upload failed"),this.fileUploaded.emit({fieldId:e.id,file:s,isValid:r})}clearFieldError(e){this.fieldErrors={...this.fieldErrors},delete this.fieldErrors[e]}setFieldError(e,t){this.fieldErrors={...this.fieldErrors,[e]:t}}renderTextField(e){return i("input",{disabled:!this.isEditable,type:e.type,id:`custom-field-${e.id}`,value:e.value?.toString()||"",onChange:t=>this.handleFieldChange(e,t),name:`${e.id}`,class:"form-input",required:e.required})}renderFileField(e){return i("salla-file-upload",{url:salla.url.api("upload"),id:`custom-field-${e.id}`,name:`${e.id}`,type:"registration",value:e.value,height:"120px",onAdded:t=>this.handleFileUpload(e,t),required:e.required,disabled:!this.isEditable,onUploaded:e=>{e.target.value=e.target.value?.url},allowRemove:!0,onRemoved:t=>{t.preventDefault(),t.stopPropagation(),e.value="",t.target.value=""},payloadName:"files[]",payloadParams:{type:"registration"},"instant-upload":!0},i("div",{class:"s-custom-fields-filepond-placeholder"},i("span",{class:"s-custom-fields-filepond-placeholder-icon"},i("i",{innerHTML:s})),i("p",{class:"s-custom-fields-filepond-placeholder-text"},this.dragAndDropText),i("span",{class:"filepond--label-action"},this.browseText)))}renderField(e){return i("div",{class:"s-custom-fields-field",key:e.id},i("label",{class:"s-custom-fields-field-label",htmlFor:`custom-field-${e.id}`},e.label,!!e.required&&i("span",{class:"s-custom-fields-required"},"*")),i("div",null,e.type===r.Photo?this.renderFileField(e):this.renderTextField(e),this.fieldErrors[e.id]&&i("p",{class:"s-custom-fields-error"},this.fieldErrors[e.id])))}componentWillLoad(){this.parsedFields=this.parseFields(this.fields)}parseFields(e){return e?"string"==typeof e?JSON.parse(e):Array.isArray(e)?e:[]:[]}async handleSubmit(e){e.preventDefault(),this.isSubmitting=!0;try{const t={},i=e.target.elements;for(let e=0;e<i.length;e++){const s=i[e];s.name&&!s.name.startsWith("hidden")&&s.value&&(t[s.name]=s.value)}await salla.api.profile.updateCustomFields({id:salla.config.get("store.id"),fields:t})}finally{this.isSubmitting=!1}}render(){return this.parsedFields?.length?i("form",{class:"s-custom-fields-wrapper",onSubmit:this.handleSubmit},this.parsedFields.map((e=>this.renderField(e))),i("salla-button",{type:"submit",loading:this.isSubmitting,disabled:this.isSubmitting||!this.isEditable,"loader-position":"end",class:"s-custom-fields-submit-btn"},this.saveButtonText)):null}};o.style="/*!twlt*/:host{display:block}.hidden{display:none}.form-input{height:2.5rem;width:100%;border-radius:0.375rem;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.form-input:focus{border-color:var(--color-primary);--tw-ring-color:transparent}.form-input:is(.dark *){--tw-border-opacity:1;border-color:rgb(75 85 99 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(75 85 99 / var(--tw-bg-opacity, 1))}.form-input:focus:is(.dark *){border-color:var(--color-primary)}@media (min-width: 640px){.form-input{font-size:0.875rem;line-height:1.25rem}}.s-custom-fields-wrapper{display:grid;grid-template-columns:repeat(1, minmax(0, 1fr));gap:1.5rem}@media (min-width: 640px){.s-custom-fields-wrapper{grid-template-columns:repeat(2, minmax(0, 1fr));gap:2rem}}.s-custom-fields-required{--tw-text-opacity:1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.s-custom-fields-submit-btn{grid-column:1 / -1;width:100%}.s-custom-fields-field-error{--tw-text-opacity:1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.s-custom-fields-field-label{margin-bottom:0.5rem;display:block;font-size:0.875rem;line-height:1.25rem;font-weight:700;--tw-text-opacity:1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.s-custom-fields-skeleton-wrapper{display:grid;grid-template-columns:repeat(2, minmax(0, 1fr));grid-template-rows:repeat(3, minmax(0, 1fr));gap:3rem}.s-custom-fields-filepond-placeholder{display:flex;flex-direction:column;align-items:center;justify-content:center}.s-custom-fields-filepond-placeholder-icon{margin-bottom:0.25rem}.s-custom-fields-filepond-placeholder-icon svg{height:1.5rem;width:1.5rem;fill:#7c8082}";export{o as salla_custom_fields}
4
+ import{r as e,c as t,h as i}from"./p-DJuBNP7w.js";import{C as s}from"./p-C6jIkM-X.js";import{F as r}from"./p-OF8QcbMM.js";const o=class{constructor(i){e(this,i),this.fieldChanged=t(this,"fieldChanged"),this.fileUploaded=t(this,"fileUploaded"),this.isEditable=!0,this.fieldErrors={},this.isSubmitting=!1}get dragAndDropText(){return salla.lang.get("common.uploader.drag_and_drop")}get browseText(){return salla.lang.get("common.uploader.browse")}get saveButtonText(){return salla.lang.get("common.elements.save")}async setFields(e){this.parsedFields=e}async getFieldValues(){return this.parsedFields?.reduce(((e,t)=>(e[`custom_fields[${t.id}]`]=t.value,e)),{})||{}}async validateFields(){if(!this.parsedFields)return!0;const e=this.parsedFields.reduce(((e,t)=>(!t.required||t.value&&""!==t.value||(e[t.id.toString()]=`${t.label} is required`),e)),{});return this.fieldErrors=e,0===Object.keys(e).length}handleFieldChange(e,t){const i=t.target.value;e.value=i,this.clearFieldError(e.id);const s=!(e.required&&!i);s||this.setFieldError(e.id,`${e.label} is required`),this.fieldChanged.emit({fieldId:e.id,value:i,isValid:s})}handleFileUpload(e,t){const{error:i,file:s}=t.detail,r=!i;this.clearFieldError(e.id),r?e.value=s:this.setFieldError(e.id,"File upload failed"),this.fileUploaded.emit({fieldId:e.id,file:s,isValid:r})}clearFieldError(e){this.fieldErrors={...this.fieldErrors},delete this.fieldErrors[e]}setFieldError(e,t){this.fieldErrors={...this.fieldErrors,[e]:t}}renderTextField(e){return i("input",{disabled:!this.isEditable,type:e.type,id:`custom-field-${e.id}`,value:e.value?.toString()||"",onChange:t=>this.handleFieldChange(e,t),name:`${e.id}`,class:"form-input",required:e.required})}renderFileField(e){return i("salla-file-upload",{url:salla.url.api("upload"),id:`custom-field-${e.id}`,name:`${e.id}`,type:"registration",value:e.value,height:"120px",onAdded:t=>this.handleFileUpload(e,t),required:e.required,disabled:!this.isEditable,onUploaded:e=>{e.target.value=e.target.value?.url},allowRemove:!0,onRemoved:t=>{t.preventDefault(),t.stopPropagation(),e.value="",t.target.value=""},payloadName:"files[]",payloadParams:{type:"registration"},"instant-upload":!0},i("div",{class:"s-custom-fields-filepond-placeholder"},i("span",{class:"s-custom-fields-filepond-placeholder-icon"},i("i",{innerHTML:s})),i("p",{class:"s-custom-fields-filepond-placeholder-text"},this.dragAndDropText),i("span",{class:"filepond--label-action"},this.browseText)))}renderField(e){return i("div",{class:"s-custom-fields-field",key:e.id},i("label",{class:"s-custom-fields-field-label",htmlFor:`custom-field-${e.id}`},e.label,!!e.required&&i("span",{class:"s-custom-fields-required"},"*")),i("div",null,e.type===r.Photo?this.renderFileField(e):this.renderTextField(e),this.fieldErrors[e.id]&&i("p",{class:"s-custom-fields-error"},this.fieldErrors[e.id])))}componentWillLoad(){this.parsedFields=this.parseFields(this.fields)}parseFields(e){return e?"string"==typeof e?JSON.parse(e):Array.isArray(e)?e:[]:[]}async handleSubmit(e){e.preventDefault(),this.isSubmitting=!0;try{const t={},i=e.target.elements;for(let e=0;e<i.length;e++){const s=i[e];s.name&&!s.name.startsWith("hidden")&&s.value&&(t[s.name]=s.value)}await salla.api.profile.updateCustomFields({id:salla.config.get("store.id"),fields:t})}finally{this.isSubmitting=!1}}render(){return this.parsedFields?.length?i("form",{class:"s-custom-fields-wrapper",onSubmit:this.handleSubmit},this.parsedFields.map((e=>this.renderField(e))),i("salla-button",{type:"submit",loading:this.isSubmitting,disabled:this.isSubmitting||!this.isEditable,"loader-position":"end",class:"s-custom-fields-submit-btn"},this.saveButtonText)):null}};o.style="/*!twlt*/:host{display:block}.hidden{display:none}.form-input{height:2.5rem;width:100%;border-radius:0.375rem;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.form-input:focus{border-color:var(--color-primary);--tw-ring-color:transparent}.form-input:is(.dark *){--tw-border-opacity:1;border-color:rgb(75 85 99 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(75 85 99 / var(--tw-bg-opacity, 1))}.form-input:focus:is(.dark *){border-color:var(--color-primary)}@media (min-width: 640px){.form-input{font-size:0.875rem;line-height:1.25rem}}.s-custom-fields-wrapper{display:grid;grid-template-columns:repeat(1, minmax(0, 1fr));gap:1.5rem}@media (min-width: 640px){.s-custom-fields-wrapper{grid-template-columns:repeat(2, minmax(0, 1fr));gap:2rem}}.s-custom-fields-required{--tw-text-opacity:1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.s-custom-fields-submit-btn{grid-column:1 / -1;width:100%}.s-custom-fields-field-error{--tw-text-opacity:1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.s-custom-fields-field-label{margin-bottom:0.5rem;display:block;font-size:0.875rem;line-height:1.25rem;font-weight:700;--tw-text-opacity:1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.s-custom-fields-skeleton-wrapper{display:grid;grid-template-columns:repeat(2, minmax(0, 1fr));grid-template-rows:repeat(3, minmax(0, 1fr));gap:3rem}.s-custom-fields-filepond-placeholder{display:flex;flex-direction:column;align-items:center;justify-content:center}.s-custom-fields-filepond-placeholder-icon{margin-bottom:0.25rem}.s-custom-fields-filepond-placeholder-icon svg{height:1.5rem;width:1.5rem;fill:#7c8082}";export{o as salla_custom_fields}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as t,c as s,h as i,H as e}from"./p-Dn-G-rYP.js";import{a}from"./p-C8xwacGT.js";import"./p-CoQJOPRz.js";const r=class{constructor(i){t(this,i),this.orderItemUpdated=s(this,"orderItemUpdated"),this.orderItemRemoved=s(this,"orderItemRemoved"),this.quantityInput=null,this.productOptions=null,this.handleQuantityChange=t=>{const s=t.detail,i=s?.quantity??parseInt(t.target.value,10);isNaN(i)||i<1||i!==this.quantity&&(this.quantity=i,this.emitUpdate(i))},this.handleOptionsChange=()=>{this.emitUpdate(this.quantity)}}componentWillLoad(){this.quantity=this.item?.quantity||1}handleItemChange(t){const s=t?.quantity||1;s!==this.quantity&&(this.quantity=s,this.quantityInput?.setValue?.(s,!1))}get hasOptions(){return(this.item.product?.options?.length||0)>0}async getSelectedOptions(){return await(this.productOptions?.getSelectedOptionsData?.())||{}}async getOptionsData(){return await(this.productOptions?.getOptionsData?.())||this.item.product?.options||[]}async emitUpdate(t){const s=this.item?.id;if(null==s)return;const i={itemId:s,quantity:t};this.hasOptions&&(i.options=await this.getSelectedOptions(),i.optionDefinitions=await this.getOptionsData()),this.orderItemUpdated.emit(i)}removeItem(){const t=this.item?.id;null!=t&&this.orderItemRemoved.emit({itemId:t})}render(){if(!this.item)return null;const t=this.item.product,s=this.item.name||t?.name||"",r=t?.image?.url||"",n=t?.image?.alt||s,l=t?.url||"#",o=t?.price,h=a(t),d=t?.weight_label,c=this.item.product?.options,m=`order-edit-item-${this.item.id}-${t?.id}`,u={value:this.quantity};return h&&(u.max=h),i(e,null,i("div",null,i("div",{class:"s-order-edit-item-header"},i("div",{class:"s-order-edit-item-media"},r&&i("a",{href:l},i("img",{src:r,alt:n,class:"s-order-edit-item-image"})),i("div",{class:"s-order-edit-item-details"},i("h2",{class:"s-order-edit-item-name"},i("a",{href:l,class:"s-order-edit-item-link"},s)),null!=o&&i("span",{class:"s-order-edit-item-price",innerHTML:salla.money(o)}),d&&i("p",{class:"s-order-edit-item-weight"},salla.lang.getWithDefault("pages.products.weight","الوزن")," ",d))),i("salla-button",{type:"button",shape:"icon",size:"small",color:"danger","aria-label":salla.lang.getWithDefault("common.elements.delete","حذف"),onClick:()=>this.removeItem()},i("i",{class:"sicon-cancel"}))),i("div",{class:"s-order-edit-item-quantity"},i("h3",{class:"s-order-edit-item-quantity-label"},salla.lang.getWithDefault("common.elements.quantity","الكمية")),i("div",{class:"s-order-edit-item-quantity-input"},i("salla-quantity-input",{ref:t=>this.quantityInput=t,...u,onChange:this.handleQuantityChange}))),this.hasOptions&&i("form",{class:"s-order-edit-item-options",onSubmit:t=>t.preventDefault()},i("salla-product-options",{ref:t=>this.productOptions=t,onChange:this.handleOptionsChange,"product-id":t.id,"unique-key":m,options:JSON.stringify(c),key:`${m}-options`}))))}static get watchers(){return{item:["handleItemChange"]}}};r.style=":host{display:block}";export{r as salla_order_edit_item}
4
+ import{r as t,c as s,h as i,H as e}from"./p-DJuBNP7w.js";import{a}from"./p-C8xwacGT.js";import"./p-CoQJOPRz.js";const r=class{constructor(i){t(this,i),this.orderItemUpdated=s(this,"orderItemUpdated"),this.orderItemRemoved=s(this,"orderItemRemoved"),this.quantityInput=null,this.productOptions=null,this.handleQuantityChange=t=>{const s=t.detail,i=s?.quantity??parseInt(t.target.value,10);isNaN(i)||i<1||i!==this.quantity&&(this.quantity=i,this.emitUpdate(i))},this.handleOptionsChange=()=>{this.emitUpdate(this.quantity)}}componentWillLoad(){this.quantity=this.item?.quantity||1}handleItemChange(t){const s=t?.quantity||1;s!==this.quantity&&(this.quantity=s,this.quantityInput?.setValue?.(s,!1))}get hasOptions(){return(this.item.product?.options?.length||0)>0}async getSelectedOptions(){return await(this.productOptions?.getSelectedOptionsData?.())||{}}async getOptionsData(){return await(this.productOptions?.getOptionsData?.())||this.item.product?.options||[]}async emitUpdate(t){const s=this.item?.id;if(null==s)return;const i={itemId:s,quantity:t};this.hasOptions&&(i.options=await this.getSelectedOptions(),i.optionDefinitions=await this.getOptionsData()),this.orderItemUpdated.emit(i)}removeItem(){const t=this.item?.id;null!=t&&this.orderItemRemoved.emit({itemId:t})}render(){if(!this.item)return null;const t=this.item.product,s=this.item.name||t?.name||"",r=t?.image?.url||"",n=t?.image?.alt||s,l=t?.url||"#",o=t?.price,h=a(t),d=t?.weight_label,c=this.item.product?.options,m=`order-edit-item-${this.item.id}-${t?.id}`,u={value:this.quantity};return h&&(u.max=h),i(e,null,i("div",null,i("div",{class:"s-order-edit-item-header"},i("div",{class:"s-order-edit-item-media"},r&&i("a",{href:l},i("img",{src:r,alt:n,class:"s-order-edit-item-image"})),i("div",{class:"s-order-edit-item-details"},i("h2",{class:"s-order-edit-item-name"},i("a",{href:l,class:"s-order-edit-item-link"},s)),null!=o&&i("span",{class:"s-order-edit-item-price",innerHTML:salla.money(o)}),d&&i("p",{class:"s-order-edit-item-weight"},salla.lang.getWithDefault("pages.products.weight","الوزن")," ",d))),i("salla-button",{type:"button",shape:"icon",size:"small",color:"danger","aria-label":salla.lang.getWithDefault("common.elements.delete","حذف"),onClick:()=>this.removeItem()},i("i",{class:"sicon-cancel"}))),i("div",{class:"s-order-edit-item-quantity"},i("h3",{class:"s-order-edit-item-quantity-label"},salla.lang.getWithDefault("common.elements.quantity","الكمية")),i("div",{class:"s-order-edit-item-quantity-input"},i("salla-quantity-input",{ref:t=>this.quantityInput=t,...u,onChange:this.handleQuantityChange}))),this.hasOptions&&i("form",{class:"s-order-edit-item-options",onSubmit:t=>t.preventDefault()},i("salla-product-options",{ref:t=>this.productOptions=t,onChange:this.handleOptionsChange,"product-id":t.id,"unique-key":m,options:JSON.stringify(c),key:`${m}-options`}))))}static get watchers(){return{item:["handleItemChange"]}}};r.style=":host{display:block}";export{r as salla_order_edit_item}
@@ -0,0 +1,4 @@
1
+ /*!
2
+ * Crafted with ❤ by Salla
3
+ */
4
+ import{r as s,f as e,h as t,H as i}from"./p-DJuBNP7w.js";import{S as o}from"./p-BscTeWDc.js";var r;!function(s){s.DEFAULT="default",s.AVAILABILITY="availability"}(r||(r={}));const a=class{constructor(e){s(this,e),this.loadedScopes={[r.DEFAULT]:null,[r.AVAILABILITY]:null},this.translationLoaded=!1,this.mode=r.DEFAULT,this.scopes=[],this.originalScopesList=[],this.isOpenedBefore=salla.storage.get("branch-choosed-before"),this.hasError=!1,this.loading=!1,this.selection="optional",this.searchDisplayLimit=6,this.getFormTitle=()=>{if(this.originalScopesList?.length<2)return"";const s=salla.config.get("store.features")?.includes("multi-countries");return this.mode===r.DEFAULT?salla.lang.get(s?"blocks.scope.shopping_from_another_market":"blocks.scope.shopping_from_another_branch"):salla.lang.get(s?"blocks.scope.search_for_availability_in_other_markets":"blocks.scope.search_for_availability_in_other_branches")}}connectedCallback(){this.scopesOpenListener=({mode:s=null,product_id:e=null}={})=>{this.open(s,e)},salla.event.on("scopes::open",this.scopesOpenListener),this.langUnsubscribe=salla.lang.subscribe((()=>{this.translationLoaded=!0,e(this)}))}disconnectedCallback(){salla.event.off("scopes::open",this.scopesOpenListener),this.langUnsubscribe?.()}get isNativeApp(){return!!salla.mobile?.isSpaWebview?.()}get shouldDelegateToNativeApp(){return this.isNativeApp&&"1"!==localStorage.getItem("delivery-selector-enabled")}async close(){return await(this.modal?.close())}async open(s=r.DEFAULT,e=null){return this.shouldDelegateToNativeApp?(salla.log("SallaScope:: delegated open to native app"),void salla.mobile?.openScopes?.()):(this.hasError=!1,this.mode=[r.AVAILABILITY,r.DEFAULT].includes(s)?s:r.DEFAULT,this.loading=!this.loadedScopes[this.mode],this.setScopeValues([]),salla.log("SallaScope:: opened"),this.modal.open(),this.loading?await salla.api.withoutNotifier((()=>s==r.AVAILABILITY?salla.scope.getProductAvailability(e):salla.scope.get())).then((e=>{if(s==r.AVAILABILITY)return this.setScopeValues(this.loadedScopes[r.AVAILABILITY]=e.data);this.setScopeValues(this.loadedScopes[this.mode]=e.data.scopes)})).catch((s=>{console.log(s),this.hasError=!0})).finally((()=>{this.modal.stopLoading(),this.loading=!1})):(this.setScopeValues(this.loadedScopes[this.mode]),this.modal.stopLoading()))}async handleSubmit(){let s={id:this.current_scope.id};return this.changeBtn.load(),await salla.scope.change(s).then((()=>{salla.storage.set("branch-choosed-before",!0),salla.storage.set("scope",{type:this.current_scope.type,id:this.current_scope.id}),salla.cart.reset(),window.location.replace(salla.scope.urlFor(this.current_scope))})).catch((s=>console.log(s))).finally((()=>{this.changeBtn.stop()}))}setScopeValues(s){this.scopes=s,this.originalScopesList=s,1==s?.length?(this.current_scope=s[0],this.selected_scope=s[0],this.scopes=[s[0]]):(this.current_scope=s?.find((s=>s.selected)),this.selected_scope=s?.find((s=>s.selected)))}handleSearchFieldTyping(s){let e=s.target.value.toLocaleLowerCase();this.scopes=e?this.originalScopesList.filter((s=>s.name.toLowerCase().includes(e))):this.originalScopesList}handleScopeSelection(s){this.current_scope=this.scopes?.find((e=>e.id==s.target.value))}placeholderContent(){return t("salla-placeholder",{alignment:"center",class:"s-scopes-placeholder"},t("span",{slot:"title"},salla.lang.get("blocks.scope.branch_looking_for_not_found")),t("span",{slot:"description"},salla.lang.get("blocks.scope.our_services_not_available_in_this_branch")))}defaultContent(){return[t("div",{class:"s-scopes-container s-scrollbar"},this.scopes?.map((s=>t("div",{class:"s-scopes-input-wrap","data-selection":this.selection},t("input",{id:`${this.selection} + '_scope_' + ${s.id}`,name:"lang",type:"radio",value:s.id,onChange:s=>this.handleScopeSelection(s),class:"s-scopes-input",checked:!!this.current_scope&&this.current_scope.id==s.id}),t("label",{htmlFor:`${this.selection} + '_scope_' + ${s.id}`,class:"s-scopes-label s-scopes-clickable"},t("span",null,s.icon&&t("img",{src:s.icon,alt:"",loading:"lazy",class:"s-scopes-icon"}),s.name)))))),this.footerContent()]}availabilityContent(){return t("div",{class:"s-scopes-container"},this.scopes?.map((s=>t("div",{class:"s-scopes-input-wrap","data-selection":this.selection},t("h2",{class:{"s-scopes-label":!0,"s-scopes-clickable":this.mode===r.DEFAULT}},t("span",null,s.name)),t("h2",{style:{color:s?.availability?.color},class:`s-scopes-${s?.availability?.key}`},s?.availability?.label)))))}footerContent(){return t("div",{class:"s-scopes-footer"},t("slot",{name:"footer"},t("salla-button",{ref:s=>this.changeBtn=s,disabled:!this.current_scope,onClick:()=>this.handleSubmit(),class:"s-scopes-submit","loader-position":"center",width:"wide"},salla.lang.get("common.elements.confirm"))))}componentWillLoad(){return salla.onReady()}render(){return this.shouldDelegateToNativeApp?null:t(i,null,t("salla-modal",{ref:s=>this.modal=s,isClosable:!(!this.isOpenedBefore&&"optional"!=this.selection),class:"s-scopes-modal",isLoading:this.loading,"has-skeleton":!0},this.loading?t("div",{slot:"loading"},t("div",{class:"s-scopes-skeleton"},t("salla-list-tile",{class:"s-scopes-header"},t("div",{slot:"icon",class:"s-scopes-header-icon"},t("salla-skeleton",{type:"circle"})),t("div",{slot:"title",class:"s-scopes-header-title mb-5"},t("salla-skeleton",{height:"15px",width:"50%"})),t("div",{slot:"subtitle",class:"s-scopes-header-subtitle"},t("salla-skeleton",{height:"10px"}),t("salla-skeleton",{height:"10px",width:"75%"}))),t("div",{class:"s-scopes-skeleton-search"},t("salla-skeleton",{height:"10px",width:"50%"}),t("salla-skeleton",{height:"30px",width:"100%"})),t("div",{class:"s-scopes-skeleton-scopes"},t("salla-skeleton",{height:"10px",width:"30%"}),t("salla-skeleton",{height:"10px",width:"25%"}),t("salla-skeleton",{height:"10px",width:"30%"}),t("salla-skeleton",{height:"10px",width:"25%"}),t("salla-skeleton",{height:"10px",width:"30%"}),t("salla-skeleton",{height:"10px",width:"25%"}),t("salla-skeleton",{height:"10px",width:"30%"}),t("salla-skeleton",{height:"10px",width:"25%"})),t("div",{class:"s-scopes-skeleton-btn"},t("salla-skeleton",{height:"40px",width:"100%"})))):[t("salla-list-tile",{class:this.originalScopesList?.length?"s-scopes-header block":"s-hidden"},t("div",{slot:"icon",class:"s-scopes-header-icon",innerHTML:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>store-alt</title>\n<path d="M6.667 24h5.333c0.736 0 1.333-0.596 1.333-1.333s-0.597-1.333-1.333-1.333h-5.333c-0.736 0-1.333 0.596-1.333 1.333s0.597 1.333 1.333 1.333zM31.86 10.071l-4-8c-0.227-0.452-0.688-0.737-1.193-0.737h-21.333c-0.505 0-0.967 0.285-1.193 0.737l-4 8c-0.092 0.184-0.14 0.389-0.14 0.596v18.667c0 0.737 0.597 1.333 1.333 1.333h29.333c0.736 0 1.333-0.596 1.333-1.333v-18.667c0-0.207-0.048-0.412-0.14-0.596zM6.157 4h19.685l3.333 6.667h-26.352zM24 28h-5.333v-9.333h5.333zM29.333 28h-2.667v-10.667c0-0.737-0.597-1.333-1.333-1.333h-8c-0.736 0-1.333 0.596-1.333 1.333v10.667h-13.333v-14.667h26.667zM6.667 18.667h5.333c0.736 0 1.333-0.596 1.333-1.333s-0.597-1.333-1.333-1.333h-5.333c-0.736 0-1.333 0.596-1.333 1.333s0.597 1.333 1.333 1.333z"></path>\n</svg>\n'}),t("div",{slot:"title",class:"s-scopes-header-title"},salla.lang.get("blocks.scope.you_are_browse_store_from")),t("div",{slot:"subtitle",class:"s-scopes-header-subtitle"},this.selected_scope?this.selected_scope.name:"")),t("div",{class:"s-scopes-wrap"},!!this.originalScopesList?.length&&t("h4",{class:"s-scopes-title"},this.getFormTitle()),this.originalScopesList?.length>this.searchDisplayLimit?t("div",{class:"s-scopes-search-wrapper"},t("div",{class:"s-scopes-search-icon",innerHTML:o}),t("input",{type:"text",class:"s-scopes-search-input",onInput:s=>this.handleSearchFieldTyping(s),enterkeyhint:"search",placeholder:salla.lang.get("blocks.scope.searching_for_a_branch")})):"",this.hasError||!this.originalScopesList?.length&&this.mode!==r.AVAILABILITY?this.placeholderContent():this.mode===r.DEFAULT?this.defaultContent():this.availabilityContent())]))}async componentDidLoad(){await Salla.hooks.registerComponent("salla-scopes",this),salla.config.isMobileApp()||this.isNativeApp||this.isOpenedBefore||"mandatory"!=this.selection||this.open()}};a.style='/*!twlt*/.s-scopes-availability-content{display:flex;justify-content:center;align-items:center}.s-scopes-placeholder{flex:0 0 85%}.mb-5{margin-bottom:1.25rem}.block{display:block}.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-hidden{display:none}.btn{display:inline-flex;flex:1 1 0%;align-items:center;justify-content:center;white-space:nowrap;border-radius:0.375rem;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}.btn:hover{opacity:0.8}.s-hidden{display:none}.s-scrollbar::-webkit-scrollbar{width:5px}.s-scrollbar::-webkit-scrollbar-track{background-color:#eee}.s-scrollbar::-webkit-scrollbar-thumb{background-color:var(--color-primary);border-radius:10px;-webkit-border-radius:10px;-moz-border-radius:10px;-ms-border-radius:10px;-o-border-radius:10px}.s-scopes-title{margin-bottom:0.75rem}.s-scopes-header{margin-bottom:0.5rem;display:block;text-align:center}.s-scopes-header-icon{margin:auto;display:flex;height:5rem;width:5rem;align-items:center;justify-content:center;border-radius:9999px;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(252 252 252 / var(--tw-bg-opacity, 1))}.s-scopes-header-icon svg{height:2rem;fill:var(--color-primary)}.s-scopes-header-title{font-size:1.125rem;line-height:1.75rem;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-scopes-header-subtitle{text-align:left;font-size:1.25rem;line-height:1.75rem}.s-scopes-header-subtitle:where([dir="rtl"],[dir="rtl"] *){text-align:right}.s-scopes-search-wrapper{position:relative;width:100%}.s-scopes-search-icon{pointer-events:none;position:absolute;top:0px;bottom:0px;left:0px;display:flex;align-items:center;padding-left:0.75rem}.s-scopes-search-icon:where([dir="rtl"],[dir="rtl"] *){left:auto;right:0px;padding-left:0px;padding-right:0.75rem}.s-scopes-search-icon svg{height:1.25rem;width:1.25rem;fill:#9ca3af}.s-scopes-search-input{display:block;width:100%;border-radius:var(--s-radius, 0.25rem);border-width:1px;--tw-border-opacity:1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1));padding:0.625rem;padding-left:2.5rem;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.s-scopes-search-input:focus{--tw-ring-color:var(--color-primary)}.s-scopes-search-input:where([dir="rtl"],[dir="rtl"] *){padding-left:0px;padding-right:2.5rem}.s-scopes-input-wrap{margin-bottom:1.25rem;display:flex;align-items:center}.s-scopes-input-wrap:last-child{margin-bottom:0px}.s-scopes-input{height:1rem;width:1rem;--tw-border-opacity:1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1));color:var(--color-primary)}.s-scopes-input:focus{--tw-ring-color:var(--color-primary)}.s-scopes-input:where([dir="ltr"],[dir="ltr"] *){margin-right:0.75rem}.s-scopes-input:where([dir="rtl"],[dir="rtl"] *){margin-left:0.75rem}.s-scopes-icon{display:inline-block;height:2rem;width:2rem;border-radius:var(--s-radius, 0.25rem);object-fit:contain;vertical-align:middle}.s-scopes-icon:where([dir="ltr"],[dir="ltr"] *){margin-right:0.75rem}.s-scopes-icon:where([dir="rtl"],[dir="rtl"] *){margin-left:0.75rem}.s-scopes-label{display:flex;flex-grow:1;align-items:center;justify-content:space-between;font-size:1rem;line-height:1.5rem;font-weight:500;--tw-text-opacity:1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.s-scopes-select{height:2.5rem;width:100%;appearance:none;border-radius:0.375rem;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));padding-left:1rem;padding-right:1rem;font-size:0.875rem;line-height:1.25rem;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-scopes-select:focus{border-color:var(--color-primary)}.s-scopes-container{margin-top:1.25rem;max-height:300px;overflow-y:auto;padding-left:0.5rem}.s-scopes-container:where([dir="rtl"],[dir="rtl"] *){padding-left:0px;padding-right:0.5rem}.s-scopes-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}.s-scopes-is-closed{opacity:0.5}.s-scopes-closed-badge{--tw-text-opacity:1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.s-scopes-clickable{cursor:pointer}.s-scopes-submit{margin-top:1.5rem;height:auto}.s-scopes-color-red{--tw-text-opacity:1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.s-scopes-color-green{--tw-text-opacity:1;color:rgb(34 197 94 / var(--tw-text-opacity, 1))}.s-scopes-color-gray{--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-scopes-hidden{display:none}.s-scopes-input-wrap.is-hidden-branch{display:none}.s-scopes-wrap{display:flex;max-height:350px;flex-direction:column}.s-scopes-wrap .s-placeholder-wrapper{display:flex;height:12rem;flex-direction:column;align-items:center;justify-content:center}.s-scopes-footer{margin-top:auto}.s-scopes-modal .s-modal-header{display:block !important}.s-scopes-skeleton .s-list-tile-item-content{display:block;width:100%}.s-scopes-skeleton .s-scopes-header-title>salla-skeleton{margin-top:0.75rem;margin-bottom:0.75rem;display:block}.s-scopes-skeleton .s-scopes-header-subtitle>salla-skeleton{margin-bottom:0.75rem;display:block}.s-scopes-skeleton .s-scopes-skeleton-scopes>salla-skeleton{margin-bottom:1.25rem;display:block}.s-scopes-skeleton .s-scopes-skeleton-search{margin-top:2rem;margin-bottom:2rem}.s-scopes-skeleton .s-scopes-skeleton-search>salla-skeleton{margin-bottom:0.75rem;display:block}.s-scopes-skeleton .s-list-tile-item-icon{margin-right:2rem}.s-scopes-skeleton .s-list-tile-item-icon:where([dir="rtl"],[dir="rtl"] *){margin-right:0px;margin-left:2rem}.s-scopes-skeleton-btn{margin-top:2rem}';export{a as salla_scopes}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as t,h as a,F as s,a as i}from"./p-Dn-G-rYP.js";const e=class{constructor(a){t(this,a),this.isMobileAllowed=!0,this.isEmailRequired=!1,this.supportWebAuth=!0,this.withoutReload=!1,this.source="",this.htmlElement=document.documentElement,this.messages=[],this.isClosable=!0,this.iframeLoaded=!1,this.scrolling="no",this.direction=document.dir,this.canRenderIframe=!1,this.loginSucceeded=!1,salla.onReady((()=>{this.api=salla.config.get("store.api"),this.storeId=salla.config.get("store.id")}))}connectedCallback(){this.loginOpenListener=t=>this.onLoginOpen(t),this.modalCloseListener=t=>{this.iframe&&this.sendMessageToIframe({source:"login",type:"modal_closed",data:t})},salla.event.on("login::open",this.loginOpenListener),salla.event.on("modal::close",this.modalCloseListener)}disconnectedCallback(){salla.event.off("login::open",this.loginOpenListener),salla.event.off("modal::close",this.modalCloseListener)}onLoginOpen(t){salla.mobile?.isNativeLoginEnabled?.()||(this.isEmailAllowed||this.isMobileAllowed?(this.source=t?.source??!1,this.withoutReload=t?.withoutReload??this.withoutReload,this.open(t),this.openModal()):salla.logger.warn("Please enable atleast one login type to use this component."))}componentDidLoad(){window.addEventListener("message",(t=>{if(!this.isTrustedMessage(t)||"login"!=t.data?.source)return;if(!this.inline&&!this.canRenderIframe)return;salla.log("salla-account:: recived an event",t.data);let a=t.data?.type?.replace("iframe::",""),s=t.data.message;if("ready"==a)return s.isPasskeyPage?void this.createPassKey.postMessage({source:"login",type:"init_passkey_page",data:{token:salla.storage.get("token"),store_id:salla.config.get("store.id"),locale:salla.config.get("user.language_code"),redirect:salla.config.get("store.url")}},salla.config.get("login.url")):void this.handleIframeReadyAction();if("height"==a)return this.iframe.height=s?.height+"px";if("storage"==a)return this.handleIframeStorageAction(s);if("scrolling"==a)return this.scrolling=s,void(this.isClosable=!1);if("direction"==a)return document.dir=this.direction=s?"rtl":"ltr";if("notify"==a)return salla.notify[s.type](s.message);if("authenticated"==a||"authenticated_web_auth"==a)return this.loginSucceeded=!0,!s?.withoutClose&&this.close(),salla.auth.api.handlAfterAuthenticatedResponse(s,this.supportWebAuth).then((()=>!(s?.withoutReload||this.withoutReload)&&setTimeout((()=>window.location.reload()),1e3)));if("dispatchEvent"!=a||"auth::verified"!=s.event){if("dispatchEvent"==a)return salla.event.emit(s.event,...s.payload);if("reload"==a)return s?.withClose&&this.modal.close(),window.location.reload();if("open_page"===a){if(!this.isSafeUrl(s?.url))return;return window.location.href=s.url}if("open_passkey_page"!==a)return"guest-checkout"===a?this.handleGuestCheckout():void("close"==a&&this.close());this.createPassKey=window.open(`${salla.config.get("login.url")}/create-passkey`)}else salla.log("Ignored dispatchEvent `auth::verified` from iframe")})),this.observeDarkModeChanges(),setTimeout((()=>Salla.event.emit("salla-login::ready")),1)}async open(t=null){return Salla.config.isGuest()?this.modal.open():this.withoutReload?void 0:location.reload()}onVisibilityChanged(t){t?this.loginSucceeded=!1:!this.loginSucceeded&&Salla.event.emit("salla-login::dismissed")}close(){Salla.event.emit("salla-login::closing"),this.modal.close(),this.iframeLoaded=!1,this.canRenderIframe=!1,this.host.dispatchEvent(new CustomEvent("salla-login:closed",{cancelable:!0,bubbles:!0,detail:null})),Salla.event.emit("salla-login::closed")}handleIframeReadyAction(){this.sendInitMessage(),this.sendMessageToIframe({source:"login",type:"width",data:document.body.clientWidth})}observeDarkModeChanges(){new MutationObserver((t=>{t.forEach((t=>{"class"===t.attributeName&&this.sendMessageToIframe({source:"login",type:"darkMode",data:{isDark:!!this.htmlElement.classList.contains("dark")}})}))})).observe(this.htmlElement,{attributes:!0})}async handleIframeStorageAction(t){let a,s=salla.storage.get("cart.user_id"),i=!1;if(Object.entries(t).filter((t=>!Salla.storage.get(t[0]))).forEach((([t,e])=>{salla.log("Shared storage from accounts domain",t,e);let l="string"==typeof e?e?.replace(/^"|"$/g,""):e;salla.storage.set(t,l),"token"===t&&(a=l),"user"===t&&s&&l.id!==s&&(i=!0)})),a){this.loginSucceeded=!0,this.modal.close(),Salla.auth.event.tokenFetched(a);try{await Salla.api.cart.assign()}catch(t){Salla.log("Error on assign after handle iframe",t)}i&&Salla.cart.reset();try{!Salla.auth.api.isSessionless()&&await Salla.auth.api.request("auth/jwt"),Salla.auth.api.canRedirect()?setTimeout((()=>window.location.reload()),100):await Salla.auth.event.loggedIn({data:{token:a}}).then((()=>Salla.auth.api.afterUserLogin()))}catch(t){this.modal.open(),Salla.log("Error on request auth/jwt after handle iframe",t)}}else i&&Salla.cart.reset()}isTrustedMessage(t){if(!(this.iframe&&t.source===this.iframe.contentWindow||this.createPassKey&&t.source===this.createPassKey))return!1;let a;try{a=new URL(salla.config.get("login.url","https://accounts.salla.com")).origin}catch(t){a="https://accounts.salla.com"}return t.origin===a}isSafeUrl(t){if("string"!=typeof t||!t)return!1;try{const{protocol:a}=new URL(t,location.href);return"https:"===a||"http:"===a}catch(t){return!1}}sendMessageToIframe(t){if(this.iframe)return this.iframe.contentWindow.postMessage(t,"*")}sendInitMessage(){let t=this.headers;try{t="string"==typeof t?JSON.parse(t):t}catch(a){console.error("Failed to parse headers!",this.headers,a),t=void 0}const a={user:salla.storage.get("user"),s_translations:salla.storage.get("s_translations"),token:salla.storage.get("token")};a.user||delete a.user,a.s_translations||delete a.s_translations,a.token||delete a.token,this.sendMessageToIframe({source:"login",type:"init",data:{id:this.storeId,lang:salla.lang.locale,isDark:!!this.htmlElement.classList.contains("dark"),apiUrl:this.api?.replace(/\/+$/,""),supportWebAuth:this.supportWebAuth,withoutReload:this.withoutReload,inline:this.inline,settings:salla.config.all(),headers:t,storage:a}})}async handleGuestCheckout(){if(this.modal.close(),salla.config.isGuest())return salla.cart.submit(!1,!0)}openModal(){this.canRenderIframe||(this.canRenderIframe=!0),this.modal.open()}render(){if(!Salla.config.isUser())return this.inline?this.getLoginDom():a("salla-modal",{class:"s-login-modal",ref:t=>this.modal=t,width:"xs",onModalVisibilityChanged:t=>this.onVisibilityChanged(t.detail)},this.getLoginDom())}getLoginDom(){if(this.canRenderIframe)return a(s,null,a("iframe",{src:`${salla.config.get("login.url","https://accounts.salla.com")}?src=${this.source}&version=${salla.config.get("login.version","0.1.78")}`,title:"Salla Login",class:"hide-scroll",loading:"lazy",ref:t=>{this.iframe=t},allow:"publickey-credentials-get; publickey-credentials-create",scrolling:this.scrolling,frameborder:"0",width:"100%"}))}get host(){return i(this)}};e.style="/*!twlt*/iframe{-moz-transition:height 0.3s;-ms-transition:height 0.3s;-o-transition:height 0.3s;-webkit-transition:height 0.3s;transition:height 0.3s;width:100%}.visible{visibility:visible}.inline{display:inline}.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)}";export{e as salla_login_modal}
4
+ import{r as t,h as a,F as s,a as i}from"./p-DJuBNP7w.js";const e=class{constructor(a){t(this,a),this.isMobileAllowed=!0,this.isEmailRequired=!1,this.supportWebAuth=!0,this.withoutReload=!1,this.source="",this.htmlElement=document.documentElement,this.messages=[],this.isClosable=!0,this.iframeLoaded=!1,this.scrolling="no",this.direction=document.dir,this.canRenderIframe=!1,this.loginSucceeded=!1,salla.onReady((()=>{this.api=salla.config.get("store.api"),this.storeId=salla.config.get("store.id")}))}connectedCallback(){this.loginOpenListener=t=>this.onLoginOpen(t),this.modalCloseListener=t=>{this.iframe&&this.sendMessageToIframe({source:"login",type:"modal_closed",data:t})},salla.event.on("login::open",this.loginOpenListener),salla.event.on("modal::close",this.modalCloseListener)}disconnectedCallback(){salla.event.off("login::open",this.loginOpenListener),salla.event.off("modal::close",this.modalCloseListener)}onLoginOpen(t){salla.mobile?.isNativeLoginEnabled?.()||(this.isEmailAllowed||this.isMobileAllowed?(this.source=t?.source??!1,this.withoutReload=t?.withoutReload??this.withoutReload,this.open(t),this.openModal()):salla.logger.warn("Please enable atleast one login type to use this component."))}componentDidLoad(){window.addEventListener("message",(t=>{if(!this.isTrustedMessage(t)||"login"!=t.data?.source)return;if(!this.inline&&!this.canRenderIframe)return;salla.log("salla-account:: recived an event",t.data);let a=t.data?.type?.replace("iframe::",""),s=t.data.message;if("ready"==a)return s.isPasskeyPage?void this.createPassKey.postMessage({source:"login",type:"init_passkey_page",data:{token:salla.storage.get("token"),store_id:salla.config.get("store.id"),locale:salla.config.get("user.language_code"),redirect:salla.config.get("store.url")}},salla.config.get("login.url")):void this.handleIframeReadyAction();if("height"==a)return this.iframe.height=s?.height+"px";if("storage"==a)return this.handleIframeStorageAction(s);if("scrolling"==a)return this.scrolling=s,void(this.isClosable=!1);if("direction"==a)return document.dir=this.direction=s?"rtl":"ltr";if("notify"==a)return salla.notify[s.type](s.message);if("authenticated"==a||"authenticated_web_auth"==a)return this.loginSucceeded=!0,!s?.withoutClose&&this.close(),salla.auth.api.handlAfterAuthenticatedResponse(s,this.supportWebAuth).then((()=>!(s?.withoutReload||this.withoutReload)&&setTimeout((()=>window.location.reload()),1e3)));if("dispatchEvent"!=a||"auth::verified"!=s.event){if("dispatchEvent"==a)return salla.event.emit(s.event,...s.payload);if("reload"==a)return s?.withClose&&this.modal.close(),window.location.reload();if("open_page"===a){if(!this.isSafeUrl(s?.url))return;return window.location.href=s.url}if("open_passkey_page"!==a)return"guest-checkout"===a?this.handleGuestCheckout():void("close"==a&&this.close());this.createPassKey=window.open(`${salla.config.get("login.url")}/create-passkey`)}else salla.log("Ignored dispatchEvent `auth::verified` from iframe")})),this.observeDarkModeChanges(),setTimeout((()=>Salla.event.emit("salla-login::ready")),1)}async open(t=null){return Salla.config.isGuest()?this.modal.open():this.withoutReload?void 0:location.reload()}onVisibilityChanged(t){t?this.loginSucceeded=!1:!this.loginSucceeded&&Salla.event.emit("salla-login::dismissed")}close(){Salla.event.emit("salla-login::closing"),this.modal.close(),this.iframeLoaded=!1,this.canRenderIframe=!1,this.host.dispatchEvent(new CustomEvent("salla-login:closed",{cancelable:!0,bubbles:!0,detail:null})),Salla.event.emit("salla-login::closed")}handleIframeReadyAction(){this.sendInitMessage(),this.sendMessageToIframe({source:"login",type:"width",data:document.body.clientWidth})}observeDarkModeChanges(){new MutationObserver((t=>{t.forEach((t=>{"class"===t.attributeName&&this.sendMessageToIframe({source:"login",type:"darkMode",data:{isDark:!!this.htmlElement.classList.contains("dark")}})}))})).observe(this.htmlElement,{attributes:!0})}async handleIframeStorageAction(t){let a,s=salla.storage.get("cart.user_id"),i=!1;if(Object.entries(t).filter((t=>!Salla.storage.get(t[0]))).forEach((([t,e])=>{salla.log("Shared storage from accounts domain",t,e);let l="string"==typeof e?e?.replace(/^"|"$/g,""):e;salla.storage.set(t,l),"token"===t&&(a=l),"user"===t&&s&&l.id!==s&&(i=!0)})),a){this.loginSucceeded=!0,this.modal.close(),Salla.auth.event.tokenFetched(a);try{await Salla.api.cart.assign()}catch(t){Salla.log("Error on assign after handle iframe",t)}i&&Salla.cart.reset();try{!Salla.auth.api.isSessionless()&&await Salla.auth.api.request("auth/jwt"),Salla.auth.api.canRedirect()?setTimeout((()=>window.location.reload()),100):await Salla.auth.event.loggedIn({data:{token:a}}).then((()=>Salla.auth.api.afterUserLogin()))}catch(t){this.modal.open(),Salla.log("Error on request auth/jwt after handle iframe",t)}}else i&&Salla.cart.reset()}isTrustedMessage(t){if(!(this.iframe&&t.source===this.iframe.contentWindow||this.createPassKey&&t.source===this.createPassKey))return!1;let a;try{a=new URL(salla.config.get("login.url","https://accounts.salla.com")).origin}catch(t){a="https://accounts.salla.com"}return t.origin===a}isSafeUrl(t){if("string"!=typeof t||!t)return!1;try{const{protocol:a}=new URL(t,location.href);return"https:"===a||"http:"===a}catch(t){return!1}}sendMessageToIframe(t){if(this.iframe)return this.iframe.contentWindow.postMessage(t,"*")}sendInitMessage(){let t=this.headers;try{t="string"==typeof t?JSON.parse(t):t}catch(a){console.error("Failed to parse headers!",this.headers,a),t=void 0}const a={user:salla.storage.get("user"),s_translations:salla.storage.get("s_translations"),token:salla.storage.get("token")};a.user||delete a.user,a.s_translations||delete a.s_translations,a.token||delete a.token,this.sendMessageToIframe({source:"login",type:"init",data:{id:this.storeId,lang:salla.lang.locale,isDark:!!this.htmlElement.classList.contains("dark"),apiUrl:this.api?.replace(/\/+$/,""),supportWebAuth:this.supportWebAuth,withoutReload:this.withoutReload,inline:this.inline,settings:salla.config.all(),headers:t,storage:a}})}async handleGuestCheckout(){if(this.modal.close(),salla.config.isGuest())return salla.cart.submit(!1,!0)}openModal(){this.canRenderIframe||(this.canRenderIframe=!0),this.modal.open()}render(){if(!Salla.config.isUser())return this.inline?this.getLoginDom():a("salla-modal",{class:"s-login-modal",ref:t=>this.modal=t,width:"xs",onModalVisibilityChanged:t=>this.onVisibilityChanged(t.detail)},this.getLoginDom())}getLoginDom(){if(this.canRenderIframe)return a(s,null,a("iframe",{src:`${salla.config.get("login.url","https://accounts.salla.com")}?src=${this.source}&version=${salla.config.get("login.version","0.1.78")}`,title:"Salla Login",class:"hide-scroll",loading:"lazy",ref:t=>{this.iframe=t},allow:"publickey-credentials-get; publickey-credentials-create",scrolling:this.scrolling,frameborder:"0",width:"100%"}))}get host(){return i(this)}};e.style="/*!twlt*/iframe{-moz-transition:height 0.3s;-ms-transition:height 0.3s;-o-transition:height 0.3s;-webkit-transition:height 0.3s;transition:height 0.3s;width:100%}.visible{visibility:visible}.inline{display:inline}.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)}";export{e as salla_login_modal}
@@ -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-Dn-G-rYP.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-DJuBNP7w.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 s,H as r}from"./p-Dn-G-rYP.js";import{s as t}from"./p-CxrJQ3Jf.js";const a=class{constructor(s){e(this,s),this.dark=!1,this.commercialRegisterLabel="",this.freelanceLabel=""}connectedCallback(){this.initializeTranslations()}disconnectedCallback(){this.langUnsubscribe?.()}isVisibilityEnforced(){return"SA"===salla.config.get("store.store_country")}initializeTranslations(){this.langUnsubscribe=salla.lang.subscribe((()=>{const e=(e,s,r)=>{t(e,s,r)};e("ar.trans","blocks.footer.commercial_register","السجل التجاري"),e("en.trans","blocks.footer.commercial_register","Commercial Register"),e("ar.trans","blocks.footer.freelance","وثيقة العمل الحر"),e("en.trans","blocks.footer.freelance","Freelance Certificate"),this.commercialRegisterLabel=salla.lang.getWithDefault("blocks.footer.commercial_register","السجل التجاري"),this.freelanceLabel=salla.lang.getWithDefault("blocks.footer.freelance","وثيقة العمل الحر")}))}getBadgeData(){const e=salla.config.get("store.settings.commercial_number"),s=salla.config.get("store.settings.freelance_number");return e?{number:e,label:this.commercialRegisterLabel||"السجل التجاري",imageUrl:salla.url.cdn("images/commercial-register.png",70,70),type:"commercial"}:s?{number:s,label:this.freelanceLabel||"وثيقة العمل الحر",imageUrl:this.dark?salla.url.cdn("images/freelance-white.png"):salla.url.cdn("images/freelance.png"),type:"freelance"}:null}render(){const e=this.getBadgeData();return e?s(r,{class:"s-trust-badges-wrapper "+(this.dark?"dark":"")},this.isVisibilityEnforced()?s("img",{class:"s-trust-badges-image",width:"55",height:"55",src:e.imageUrl,alt:e.label}):null,s("div",{class:"s-trust-badges-content"},s("p",{class:"s-trust-badges-label"},e.label),s("b",{class:"s-trust-badges-number"},e.number))):null}};a.style='/*!twlt*/.s-trust-badges-image{width:55px;height:55px;flex-shrink:0}.s-trust-badges-wrapper{display:flex;align-items:center}.s-trust-badges-wrapper>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(0.5rem * var(--tw-space-x-reverse));margin-left:calc(0.5rem * calc(1 - var(--tw-space-x-reverse)))}.s-trust-badges-wrapper:where([dir="rtl"],[dir="rtl"] *)>:not([hidden])~:not([hidden]){--tw-space-x-reverse:1}.s-trust-badges-label{margin-bottom:0.25rem;font-size:0.875rem;line-height:1.25rem}.s-trust-badges-number{font-size:0.875rem;line-height:1.25rem}';export{a as salla_trust_badges}
4
+ import{r as e,h as s,H as r}from"./p-DJuBNP7w.js";import{s as t}from"./p-CxrJQ3Jf.js";const a=class{constructor(s){e(this,s),this.dark=!1,this.commercialRegisterLabel="",this.freelanceLabel=""}connectedCallback(){this.initializeTranslations()}disconnectedCallback(){this.langUnsubscribe?.()}isVisibilityEnforced(){return"SA"===salla.config.get("store.store_country")}initializeTranslations(){this.langUnsubscribe=salla.lang.subscribe((()=>{const e=(e,s,r)=>{t(e,s,r)};e("ar.trans","blocks.footer.commercial_register","السجل التجاري"),e("en.trans","blocks.footer.commercial_register","Commercial Register"),e("ar.trans","blocks.footer.freelance","وثيقة العمل الحر"),e("en.trans","blocks.footer.freelance","Freelance Certificate"),this.commercialRegisterLabel=salla.lang.getWithDefault("blocks.footer.commercial_register","السجل التجاري"),this.freelanceLabel=salla.lang.getWithDefault("blocks.footer.freelance","وثيقة العمل الحر")}))}getBadgeData(){const e=salla.config.get("store.settings.commercial_number"),s=salla.config.get("store.settings.freelance_number");return e?{number:e,label:this.commercialRegisterLabel||"السجل التجاري",imageUrl:salla.url.cdn("images/commercial-register.png",70,70),type:"commercial"}:s?{number:s,label:this.freelanceLabel||"وثيقة العمل الحر",imageUrl:this.dark?salla.url.cdn("images/freelance-white.png"):salla.url.cdn("images/freelance.png"),type:"freelance"}:null}render(){const e=this.getBadgeData();return e?s(r,{class:"s-trust-badges-wrapper "+(this.dark?"dark":"")},this.isVisibilityEnforced()?s("img",{class:"s-trust-badges-image",width:"55",height:"55",src:e.imageUrl,alt:e.label}):null,s("div",{class:"s-trust-badges-content"},s("p",{class:"s-trust-badges-label"},e.label),s("b",{class:"s-trust-badges-number"},e.number))):null}};a.style='/*!twlt*/.s-trust-badges-image{width:55px;height:55px;flex-shrink:0}.s-trust-badges-wrapper{display:flex;align-items:center}.s-trust-badges-wrapper>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(0.5rem * var(--tw-space-x-reverse));margin-left:calc(0.5rem * calc(1 - var(--tw-space-x-reverse)))}.s-trust-badges-wrapper:where([dir="rtl"],[dir="rtl"] *)>:not([hidden])~:not([hidden]){--tw-space-x-reverse:1}.s-trust-badges-label{margin-bottom:0.25rem;font-size:0.875rem;line-height:1.25rem}.s-trust-badges-number{font-size:0.875rem;line-height:1.25rem}';export{a as salla_trust_badges}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as e,h as r}from"./p-Dn-G-rYP.js";import{S as a}from"./p-BpzvJ73s.js";import{C as t}from"./p-CTtM5VoO.js";import{S as i}from"./p-CiNDuG4-.js";const n=class{constructor(r){e(this,r)}async componentWillLoad(){await salla.onReady(),await salla.lang.onLoaded()}dateLabel(){const e=new Date(this.createdAt);if(Number.isNaN(e.getTime()))return"";const r=/([+-])(\d{2}):?(\d{2})$/.exec(this.createdAt||""),a=r?("-"===r[1]?-1:1)*(60*Number(r[2])+Number(r[3])):0,t=!!r||/Z$/i.test(this.createdAt||"");return new Intl.DateTimeFormat(document.documentElement.lang||"ar",{calendar:"gregory",day:"numeric",month:"long",year:"numeric",hour:"numeric",minute:"2-digit",...t?{timeZone:"UTC"}:{}}).format(t?new Date(e.getTime()+6e4*a):e)}async copyReference(){try{await navigator.clipboard.writeText(this.referenceId),salla.notify.success(salla.lang.get("common.elements.copied"))}catch{}}render(){const e=this.dateLabel();return r("header",{key:"d2d1914e2380a41b92c7d1ed0be4474535f347d4",class:"s-thank-you-header-wrapper"},r("div",{key:"a55c95fabb88c28027b4cdc8fec3b3689229f81c",class:"s-thank-you-header-intro"},r("span",{key:"68a5faab8488ff85cccdf74654be4c9a2c140399",class:"s-thank-you-header-success"},r("span",{key:"428d70eb21c90fe3db56e59141da3a7c581a8e94",class:"s-thank-you-header-success-icon","aria-hidden":"true",innerHTML:a}),r("span",{key:"5532f94ab170683945d88664c66d42f6cb75c68f",class:"s-thank-you-header-store"},this.storeLogo?r("img",{src:this.storeLogo,alt:this.storeName||""}):r("span",{"aria-hidden":"true",innerHTML:i}))),r("div",{key:"262f9756d2323be508c48bff389ebb8f840fc35b",class:"s-thank-you-header-copy"},r("h1",{key:"6f4cfc3918a346d561ab449314196bfb3a85bd20","data-testid":"store-thankyou-header-show-title",class:"s-thank-you-header-title"},this.heading),r("p",{key:"177f9fed6204bf568f6745311032521606eeafcf",class:"s-thank-you-header-subtitle"},this.subtitle||salla.lang.get("pages.thank_you.order_received")))),r("hr",{key:"864eedb2137299b4c73256cfd8f0cc5a848e1998",class:"s-thank-you-header-divider"}),r("div",{key:"d3e74fd5b47f6559d350f7a673c7cd0fdf1f4e76",class:"s-thank-you-header-meta"},this.referenceId?r("button",{type:"button",class:"s-thank-you-header-reference","data-testid":"store-thankyou-header-copy-reference","aria-label":`${salla.lang.get("common.elements.copy")} ${this.referenceId}`,onClick:()=>this.copyReference()},r("span",{"aria-hidden":"true",innerHTML:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>page-check</title>\n<path d="M13.629 21.113c-0.616-0.408-1.441-0.243-1.849 0.369-0.409 0.613-0.244 1.44 0.369 1.849l2.667 1.777c0.228 0.151 0.485 0.224 0.739 0.224 0.431 0 0.855-0.208 1.111-0.593l3.555-5.333c0.409-0.613 0.244-1.44-0.369-1.849-0.616-0.408-1.443-0.244-1.849 0.369l-2.815 4.224zM29.229 11.487c-0.068-0.163-0.167-0.309-0.289-0.431l-10.663-10.663c-0.123-0.123-0.269-0.221-0.431-0.289s-0.335-0.104-0.513-0.104h-10.667c-2.205 0-4 1.795-4 4v24c0 2.205 1.795 4 4 4h18.667c2.205 0 4-1.795 4-4v-16c0-0.179-0.036-0.352-0.104-0.513zM18.667 4.552l6.115 6.115h-6.115zM26.667 28c0 0.736-0.597 1.333-1.333 1.333h-18.667c-0.736 0-1.333-0.597-1.333-1.333v-24c0-0.736 0.597-1.333 1.333-1.333h9.333v9.333c0 0.737 0.596 1.333 1.333 1.333h9.333z"></path>\n</svg>\n'}),r("span",{dir:"ltr"},"#",this.referenceId),r("span",{"aria-hidden":"true",innerHTML:t})):null,e?r("span",{class:"s-thank-you-header-date"},r("span",{"aria-hidden":"true",innerHTML:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>clock</title>\n<path d="M16 10.667c-0.736 0-1.333 0.597-1.333 1.333v4h-2.667c-0.736 0-1.333 0.597-1.333 1.333 0 0.737 0.597 1.333 1.333 1.333h4c0.736 0 1.333-0.596 1.333-1.333v-5.333c0-0.736-0.597-1.333-1.333-1.333zM16 5.333c-5.881 0-10.667 4.785-10.667 10.667s4.785 10.667 10.667 10.667 10.667-4.785 10.667-10.667-4.785-10.667-10.667-10.667zM16 24c-4.412 0-8-3.588-8-8s3.588-8 8-8 8 3.588 8 8-3.588 8-8 8zM16 0c-8.823 0-16 7.177-16 16s7.177 16 16 16 16-7.177 16-16-7.177-16-16-16zM16 29.333c-7.352 0-13.333-5.981-13.333-13.333s5.981-13.333 13.333-13.333 13.333 5.981 13.333 13.333-5.981 13.333-13.333 13.333z"></path>\n</svg>\n'}),r("time",{dateTime:this.createdAt},e)):null),r("slot",{key:"086631b68ccd291cc3b188d4193aa3a782509edf"}))}};n.style="/*!twlt*/:host{display:block}.s-thank-you-header-wrapper{display:flex;width:100%;flex-direction:column;align-items:center;gap:1rem;text-align:center}@media (min-width: 640px){.s-thank-you-header-wrapper{gap:1.5rem}}.s-thank-you-header-intro{display:flex;width:100%;flex-direction:column;align-items:center;gap:0.75rem}.s-thank-you-header-success{position:relative;display:flex;height:4rem;width:4rem;align-items:center;justify-content:center;border-radius:9999px;background-color:var(--color-primary);color:var(--color-primary-reverse)}.s-thank-you-header-success-icon{display:inline-flex;align-items:center;justify-content:center}.s-thank-you-header-success-icon svg{height:2rem;width:2rem;fill:currentColor}.s-thank-you-header-store{position:absolute;bottom:1px;right:1px;display:flex;height:1.5rem;width:1.5rem;align-items:center;justify-content:center;overflow:hidden;border-radius:9999px;border-width:1px;border-color:var(--color-surface,#fff);background-color:var(--color-surface,#fff);padding:0.25rem;color:var(--color-primary)}.s-thank-you-header-store img,.s-thank-you-header-store svg{height:100%;width:100%;fill:currentColor;object-fit:contain}.s-thank-you-header-copy{display:flex;width:100%;flex-direction:column;gap:0.5rem}.s-thank-you-header-title{margin:0px;font-size:1.5rem;font-weight:700;line-height:1.75rem;color:var(--color-text-primary,#333)}.s-thank-you-header-subtitle{margin:0px;width:100%;font-size:1rem;line-height:1.5rem;color:var(--color-text-secondary,#666)}.s-thank-you-header-divider{margin:0px;width:100%;border-width:0px;border-top-width:1px;border-color:var(--color-border-light,#f4f4f4)}.s-thank-you-header-meta{display:flex;width:100%;flex-wrap:wrap;align-items:center;justify-content:center;column-gap:1.5rem;row-gap:0.5rem;font-size:0.875rem;line-height:1.25rem;color:var(--color-text-secondary,#666)}.s-thank-you-header-reference{display:inline-flex;cursor:pointer;align-items:center;gap:0.5rem;border-width:0px;background-color:transparent;padding:0px;color:inherit}.s-thank-you-header-date{display:inline-flex;align-items:center;gap:0.5rem}.s-thank-you-header-meta svg{height:1.25rem;width:1.25rem;fill:currentColor}";export{n as salla_thank_you_header}
4
+ import{r as e,h as r}from"./p-DJuBNP7w.js";import{S as a}from"./p-BpzvJ73s.js";import{C as t}from"./p-CTtM5VoO.js";import{S as i}from"./p-CiNDuG4-.js";const n=class{constructor(r){e(this,r)}async componentWillLoad(){await salla.onReady(),await salla.lang.onLoaded()}dateLabel(){const e=new Date(this.createdAt);if(Number.isNaN(e.getTime()))return"";const r=/([+-])(\d{2}):?(\d{2})$/.exec(this.createdAt||""),a=r?("-"===r[1]?-1:1)*(60*Number(r[2])+Number(r[3])):0,t=!!r||/Z$/i.test(this.createdAt||"");return new Intl.DateTimeFormat(document.documentElement.lang||"ar",{calendar:"gregory",day:"numeric",month:"long",year:"numeric",hour:"numeric",minute:"2-digit",...t?{timeZone:"UTC"}:{}}).format(t?new Date(e.getTime()+6e4*a):e)}async copyReference(){try{await navigator.clipboard.writeText(this.referenceId),salla.notify.success(salla.lang.get("common.elements.copied"))}catch{}}render(){const e=this.dateLabel();return r("header",{key:"d2d1914e2380a41b92c7d1ed0be4474535f347d4",class:"s-thank-you-header-wrapper"},r("div",{key:"a55c95fabb88c28027b4cdc8fec3b3689229f81c",class:"s-thank-you-header-intro"},r("span",{key:"68a5faab8488ff85cccdf74654be4c9a2c140399",class:"s-thank-you-header-success"},r("span",{key:"428d70eb21c90fe3db56e59141da3a7c581a8e94",class:"s-thank-you-header-success-icon","aria-hidden":"true",innerHTML:a}),r("span",{key:"5532f94ab170683945d88664c66d42f6cb75c68f",class:"s-thank-you-header-store"},this.storeLogo?r("img",{src:this.storeLogo,alt:this.storeName||""}):r("span",{"aria-hidden":"true",innerHTML:i}))),r("div",{key:"262f9756d2323be508c48bff389ebb8f840fc35b",class:"s-thank-you-header-copy"},r("h1",{key:"6f4cfc3918a346d561ab449314196bfb3a85bd20","data-testid":"store-thankyou-header-show-title",class:"s-thank-you-header-title"},this.heading),r("p",{key:"177f9fed6204bf568f6745311032521606eeafcf",class:"s-thank-you-header-subtitle"},this.subtitle||salla.lang.get("pages.thank_you.order_received")))),r("hr",{key:"864eedb2137299b4c73256cfd8f0cc5a848e1998",class:"s-thank-you-header-divider"}),r("div",{key:"d3e74fd5b47f6559d350f7a673c7cd0fdf1f4e76",class:"s-thank-you-header-meta"},this.referenceId?r("button",{type:"button",class:"s-thank-you-header-reference","data-testid":"store-thankyou-header-copy-reference","aria-label":`${salla.lang.get("common.elements.copy")} ${this.referenceId}`,onClick:()=>this.copyReference()},r("span",{"aria-hidden":"true",innerHTML:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>page-check</title>\n<path d="M13.629 21.113c-0.616-0.408-1.441-0.243-1.849 0.369-0.409 0.613-0.244 1.44 0.369 1.849l2.667 1.777c0.228 0.151 0.485 0.224 0.739 0.224 0.431 0 0.855-0.208 1.111-0.593l3.555-5.333c0.409-0.613 0.244-1.44-0.369-1.849-0.616-0.408-1.443-0.244-1.849 0.369l-2.815 4.224zM29.229 11.487c-0.068-0.163-0.167-0.309-0.289-0.431l-10.663-10.663c-0.123-0.123-0.269-0.221-0.431-0.289s-0.335-0.104-0.513-0.104h-10.667c-2.205 0-4 1.795-4 4v24c0 2.205 1.795 4 4 4h18.667c2.205 0 4-1.795 4-4v-16c0-0.179-0.036-0.352-0.104-0.513zM18.667 4.552l6.115 6.115h-6.115zM26.667 28c0 0.736-0.597 1.333-1.333 1.333h-18.667c-0.736 0-1.333-0.597-1.333-1.333v-24c0-0.736 0.597-1.333 1.333-1.333h9.333v9.333c0 0.737 0.596 1.333 1.333 1.333h9.333z"></path>\n</svg>\n'}),r("span",{dir:"ltr"},"#",this.referenceId),r("span",{"aria-hidden":"true",innerHTML:t})):null,e?r("span",{class:"s-thank-you-header-date"},r("span",{"aria-hidden":"true",innerHTML:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>clock</title>\n<path d="M16 10.667c-0.736 0-1.333 0.597-1.333 1.333v4h-2.667c-0.736 0-1.333 0.597-1.333 1.333 0 0.737 0.597 1.333 1.333 1.333h4c0.736 0 1.333-0.596 1.333-1.333v-5.333c0-0.736-0.597-1.333-1.333-1.333zM16 5.333c-5.881 0-10.667 4.785-10.667 10.667s4.785 10.667 10.667 10.667 10.667-4.785 10.667-10.667-4.785-10.667-10.667-10.667zM16 24c-4.412 0-8-3.588-8-8s3.588-8 8-8 8 3.588 8 8-3.588 8-8 8zM16 0c-8.823 0-16 7.177-16 16s7.177 16 16 16 16-7.177 16-16-7.177-16-16-16zM16 29.333c-7.352 0-13.333-5.981-13.333-13.333s5.981-13.333 13.333-13.333 13.333 5.981 13.333 13.333-5.981 13.333-13.333 13.333z"></path>\n</svg>\n'}),r("time",{dateTime:this.createdAt},e)):null),r("slot",{key:"086631b68ccd291cc3b188d4193aa3a782509edf"}))}};n.style="/*!twlt*/:host{display:block}.s-thank-you-header-wrapper{display:flex;width:100%;flex-direction:column;align-items:center;gap:1rem;text-align:center}@media (min-width: 640px){.s-thank-you-header-wrapper{gap:1.5rem}}.s-thank-you-header-intro{display:flex;width:100%;flex-direction:column;align-items:center;gap:0.75rem}.s-thank-you-header-success{position:relative;display:flex;height:4rem;width:4rem;align-items:center;justify-content:center;border-radius:9999px;background-color:var(--color-primary);color:var(--color-primary-reverse)}.s-thank-you-header-success-icon{display:inline-flex;align-items:center;justify-content:center}.s-thank-you-header-success-icon svg{height:2rem;width:2rem;fill:currentColor}.s-thank-you-header-store{position:absolute;bottom:1px;right:1px;display:flex;height:1.5rem;width:1.5rem;align-items:center;justify-content:center;overflow:hidden;border-radius:9999px;border-width:1px;border-color:var(--color-surface,#fff);background-color:var(--color-surface,#fff);padding:0.25rem;color:var(--color-primary)}.s-thank-you-header-store img,.s-thank-you-header-store svg{height:100%;width:100%;fill:currentColor;object-fit:contain}.s-thank-you-header-copy{display:flex;width:100%;flex-direction:column;gap:0.5rem}.s-thank-you-header-title{margin:0px;font-size:1.5rem;font-weight:700;line-height:1.75rem;color:var(--color-text-primary,#333)}.s-thank-you-header-subtitle{margin:0px;width:100%;font-size:1rem;line-height:1.5rem;color:var(--color-text-secondary,#666)}.s-thank-you-header-divider{margin:0px;width:100%;border-width:0px;border-top-width:1px;border-color:var(--color-border-light,#f4f4f4)}.s-thank-you-header-meta{display:flex;width:100%;flex-wrap:wrap;align-items:center;justify-content:center;column-gap:1.5rem;row-gap:0.5rem;font-size:0.875rem;line-height:1.25rem;color:var(--color-text-secondary,#666)}.s-thank-you-header-reference{display:inline-flex;cursor:pointer;align-items:center;gap:0.5rem;border-width:0px;background-color:transparent;padding:0px;color:inherit}.s-thank-you-header-date{display:inline-flex;align-items:center;gap:0.5rem}.s-thank-you-header-meta svg{height:1.25rem;width:1.25rem;fill:currentColor}";export{n as salla_thank_you_header}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as t,h as r,H as e,a as o}from"./p-Dn-G-rYP.js";import{H as i}from"./p-BDRIrndf.js";const n=class{constructor(r){t(this,r),this.nextPage="",this.autoload=!1,this.container="salla-infinite-scroll",this.item="salla-infinite-scroll > *",this.status=document.createElement("div"),this.status.className="s-infinite-scroll-wrapper",this.status.innerHTML=`<div class="s-infinite-scroll-status" style="display:none">\n <p class="s-infinite-scroll-last infinite-scroll-last"></p>\n <p class="s-infinite-scroll-error infinite-scroll-error"></p>\n </div>\n <a href="${this.nextPage}" class="s-infinite-scroll-btn s-button-btn s-button-primary">\n <span class="s-button-text s-infinite-scroll-btn-text">${this.loadMoreText?this.loadMoreText:salla.lang.get("common.elements.load_more")}</span>\n <span class="s-button-loader s-button-loader-center s-infinite-scroll-btn-loader" style="display: none"></span>\n </a>`,this.btnLoader=this.status.querySelector(".s-button-loader")}connectedCallback(){this.langUnsubscribe=salla.lang.subscribe((()=>{this.status.querySelector(".s-button-text").innerHTML=this.loadMoreText?this.loadMoreText:salla.lang.get("common.elements.load_more"),this.status.querySelector(".s-infinite-scroll-last").innerHTML=salla.lang.get("common.elements.end_of_content"),this.status.querySelector(".s-infinite-scroll-error").innerHTML=salla.lang.get("common.elements.failed_to_load_more")}))}disconnectedCallback(){this.langUnsubscribe?.()}loading(t=!0){let r=this.status.querySelector(".s-button-text");i.toggleElementClassIf(r,"s-button-hide","s-button-show",(()=>t)),this.btnLoader.style.display=t?"inherit":"none"}render(){return this.nextPage.length>1?r(e,{class:"s-infinite-scroll-container"},r("slot",null)):""}componentDidLoad(){if(0===this.nextPage.length)return;this.host.insertAdjacentElement("afterend",this.status);let t=this,r=salla.infiniteScroll.initiate(this.container,{history:!!this.autoload&&"push",scrollThreshold:!!this.autoload&&400,nextPage:this.nextPage,checkLastPage:'salla-infinite-scroll[next-page*=":"],salla-infinite-scroll[next-page*="."]',status:".s-infinite-scroll-status",button:this.status.querySelector(".s-button-btn"),append:this.item,path:function(){return t.nextPage.replace(/page\=(\d)/g,"page="+(this.loadCount+2))}}).on("request",(()=>this.loading())).on("load",(()=>{this.loading(!1),2==r.pageIndex&&r.option({loadOnScroll:!1}),3==r.pageIndex&&r.option({loadOnScroll:!0})})).on("error",(()=>this.loading(!1)))}get host(){return o(this)}};n.style="/*!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}";export{n as salla_infinite_scroll}
4
+ import{r as t,h as r,H as e,a as o}from"./p-DJuBNP7w.js";import{H as i}from"./p-DHk7-wXk.js";const n=class{constructor(r){t(this,r),this.nextPage="",this.autoload=!1,this.container="salla-infinite-scroll",this.item="salla-infinite-scroll > *",this.status=document.createElement("div"),this.status.className="s-infinite-scroll-wrapper",this.status.innerHTML=`<div class="s-infinite-scroll-status" style="display:none">\n <p class="s-infinite-scroll-last infinite-scroll-last"></p>\n <p class="s-infinite-scroll-error infinite-scroll-error"></p>\n </div>\n <a href="${this.nextPage}" class="s-infinite-scroll-btn s-button-btn s-button-primary">\n <span class="s-button-text s-infinite-scroll-btn-text">${this.loadMoreText?this.loadMoreText:salla.lang.get("common.elements.load_more")}</span>\n <span class="s-button-loader s-button-loader-center s-infinite-scroll-btn-loader" style="display: none"></span>\n </a>`,this.btnLoader=this.status.querySelector(".s-button-loader")}connectedCallback(){this.langUnsubscribe=salla.lang.subscribe((()=>{this.status.querySelector(".s-button-text").innerHTML=this.loadMoreText?this.loadMoreText:salla.lang.get("common.elements.load_more"),this.status.querySelector(".s-infinite-scroll-last").innerHTML=salla.lang.get("common.elements.end_of_content"),this.status.querySelector(".s-infinite-scroll-error").innerHTML=salla.lang.get("common.elements.failed_to_load_more")}))}disconnectedCallback(){this.langUnsubscribe?.()}loading(t=!0){let r=this.status.querySelector(".s-button-text");i.toggleElementClassIf(r,"s-button-hide","s-button-show",(()=>t)),this.btnLoader.style.display=t?"inherit":"none"}render(){return this.nextPage.length>1?r(e,{class:"s-infinite-scroll-container"},r("slot",null)):""}componentDidLoad(){if(0===this.nextPage.length)return;this.host.insertAdjacentElement("afterend",this.status);let t=this,r=salla.infiniteScroll.initiate(this.container,{history:!!this.autoload&&"push",scrollThreshold:!!this.autoload&&400,nextPage:this.nextPage,checkLastPage:'salla-infinite-scroll[next-page*=":"],salla-infinite-scroll[next-page*="."]',status:".s-infinite-scroll-status",button:this.status.querySelector(".s-button-btn"),append:this.item,path:function(){return t.nextPage.replace(/page\=(\d)/g,"page="+(this.loadCount+2))}}).on("request",(()=>this.loading())).on("load",(()=>{this.loading(!1),2==r.pageIndex&&r.option({loadOnScroll:!1}),3==r.pageIndex&&r.option({loadOnScroll:!0})})).on("error",(()=>this.loading(!1)))}get host(){return o(this)}};n.style="/*!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}";export{n as salla_infinite_scroll}
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{d as t}from"./p-Dn-G-rYP.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-DJuBNP7w.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/