@salla.sa/twilight-components 3.0.19 → 3.0.20

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 (469) hide show
  1. package/dist/cjs/{Helper-DqKJCL8G.js → Helper-C3MBaLHQ.js} +1 -1
  2. package/dist/cjs/delivery-promise-intent-5WTKLkFZ.js +71 -0
  3. package/dist/cjs/{filepond-Byu0lc8z.js → filepond-DGt10gCq.js} +1 -1
  4. package/dist/cjs/{filepond-plugin-file-poster-qwx7lYZ-.js → filepond-plugin-file-poster-NSV7ClY6.js} +1 -1
  5. package/dist/cjs/{filepond-plugin-file-validate-size-C-n0P4TT.js → filepond-plugin-file-validate-size-C08-fDj7.js} +1 -1
  6. package/dist/cjs/{filepond-plugin-file-validate-type-C8VOOXdT.js → filepond-plugin-file-validate-type-CbbTh4qd.js} +1 -1
  7. package/dist/cjs/{filepond-plugin-image-edit-B9KG763Y.js → filepond-plugin-image-edit-CqqtsmjD.js} +1 -1
  8. package/dist/cjs/{filepond-plugin-image-exif-orientation-Czt4pYzU.js → filepond-plugin-image-exif-orientation-D60HJIiL.js} +1 -1
  9. package/dist/cjs/{filepond-plugin-image-preview-BFm1Zl0o.js → filepond-plugin-image-preview-B7bWOXFm.js} +1 -1
  10. package/dist/cjs/{helpers-NV7wgP50.js → helpers-wRMwEkLy.js} +25 -0
  11. package/dist/cjs/{index-CFW798jX.js → index-U-OadFju.js} +14 -10
  12. package/dist/cjs/{intlTelInput-CLa2B89b.js → intlTelInput-Cp6WJvPO.js} +1 -1
  13. package/dist/cjs/loader.cjs.js +2 -2
  14. package/dist/cjs/salla-accordion-body_2.cjs.entry.js +1 -1
  15. package/dist/cjs/salla-accordion_6.cjs.entry.js +2 -2
  16. package/dist/cjs/salla-add-product-button_5.cjs.entry.js +120 -6
  17. package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
  18. package/dist/cjs/salla-alert_2.cjs.entry.js +1 -1
  19. package/dist/cjs/salla-app-install-alert.cjs.entry.js +1 -1
  20. package/dist/cjs/salla-applied-filters.cjs.entry.js +2 -2
  21. package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
  22. package/dist/cjs/salla-attachment-view_9.cjs.entry.js +13 -13
  23. package/dist/cjs/salla-badge.cjs.entry.js +1 -1
  24. package/dist/cjs/salla-basket-gap.cjs.entry.js +1 -1
  25. package/dist/cjs/salla-bullet-delivery_3.cjs.entry.js +12 -17
  26. package/dist/cjs/salla-cart-coupons.cjs.entry.js +1 -1
  27. package/dist/cjs/salla-cart-item-offers_2.cjs.entry.js +1 -1
  28. package/dist/cjs/salla-cart-summary-card.cjs.entry.js +1 -1
  29. package/dist/cjs/salla-cashback-banner.cjs.entry.js +1 -1
  30. package/dist/cjs/salla-comment-factors.cjs.entry.js +1 -1
  31. package/dist/cjs/salla-comment-form_9.cjs.entry.js +4 -4
  32. package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
  33. package/dist/cjs/salla-contacts.cjs.entry.js +1 -1
  34. package/dist/cjs/salla-cookies-bar.cjs.entry.js +1 -1
  35. package/dist/cjs/salla-count-down.cjs.entry.js +1 -1
  36. package/dist/cjs/salla-custom-fields.cjs.entry.js +1 -1
  37. package/dist/cjs/salla-delivery-promise.cjs.entry.js +5 -65
  38. package/dist/cjs/salla-edit-order-button.cjs.entry.js +1 -1
  39. package/dist/cjs/salla-filters-widget.cjs.entry.js +2 -2
  40. package/dist/cjs/salla-filters.cjs.entry.js +2 -2
  41. package/dist/cjs/salla-free-shipping-banner.cjs.entry.js +1 -1
  42. package/dist/cjs/salla-free-shipping-tag.cjs.entry.js +1 -1
  43. package/dist/cjs/salla-fulfillment-methods.cjs.entry.js +1 -1
  44. package/dist/cjs/salla-gift-card-redeem_2.cjs.entry.js +2 -2
  45. package/dist/cjs/salla-gifting.cjs.entry.js +1 -1
  46. package/dist/cjs/salla-hook.cjs.entry.js +1 -1
  47. package/dist/cjs/salla-infinite-scroll.cjs.entry.js +2 -2
  48. package/dist/cjs/salla-installment.cjs.entry.js +1 -1
  49. package/dist/cjs/salla-list-tile.cjs.entry.js +1 -1
  50. package/dist/cjs/salla-localization-modal.cjs.entry.js +1 -1
  51. package/dist/cjs/salla-login-modal.cjs.entry.js +1 -1
  52. package/dist/cjs/salla-loyalty-banner_10.cjs.entry.js +1 -1
  53. package/dist/cjs/salla-loyalty-exchange-product-card.cjs.entry.js +1 -1
  54. package/dist/cjs/salla-loyalty-points-banner.cjs.entry.js +1 -1
  55. package/dist/cjs/salla-loyalty-points-history.cjs.entry.js +1 -1
  56. package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
  57. package/dist/cjs/salla-loyalty.cjs.entry.js +1 -1
  58. package/dist/cjs/salla-maintenance-alert.cjs.entry.js +1 -1
  59. package/dist/cjs/salla-map_3.cjs.entry.js +1 -1
  60. package/dist/cjs/salla-menu.cjs.entry.js +1 -1
  61. package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
  62. package/dist/cjs/salla-mobile-update-modal.cjs.entry.js +188 -0
  63. package/dist/cjs/salla-multiple-bundle-product-cart_2.cjs.entry.js +4 -4
  64. package/dist/cjs/salla-multiple-bundle-product-options-modal_2.cjs.entry.js +6 -6
  65. package/dist/cjs/salla-multiple-bundle-product.cjs.entry.js +2 -2
  66. package/dist/cjs/salla-next-order-coupon.cjs.entry.js +1 -1
  67. package/dist/cjs/salla-notification-item_2.cjs.entry.js +3 -3
  68. package/dist/cjs/salla-offer-modal.cjs.entry.js +2 -2
  69. package/dist/cjs/salla-offer.cjs.entry.js +1 -1
  70. package/dist/cjs/salla-order-branch.cjs.entry.js +1 -1
  71. package/dist/cjs/salla-order-cancel.cjs.entry.js +1 -1
  72. package/dist/cjs/salla-order-details-multiple-bundle-product.cjs.entry.js +1 -1
  73. package/dist/cjs/salla-order-details-options.cjs.entry.js +1 -1
  74. package/dist/cjs/salla-order-details.cjs.entry.js +2 -2
  75. package/dist/cjs/salla-order-edit-item.cjs.entry.js +1 -1
  76. package/dist/cjs/salla-order-edit-product-card.cjs.entry.js +2 -2
  77. package/dist/cjs/salla-order-edit.cjs.entry.js +1 -1
  78. package/dist/cjs/salla-order-items.cjs.entry.js +2 -2
  79. package/dist/cjs/salla-order-options-modal.cjs.entry.js +1 -1
  80. package/dist/cjs/salla-order-payment.cjs.entry.js +2 -2
  81. package/dist/cjs/salla-order-rewards.cjs.entry.js +2 -2
  82. package/dist/cjs/salla-order-shipments.cjs.entry.js +1 -1
  83. package/dist/cjs/salla-order-summary.cjs.entry.js +2 -2
  84. package/dist/cjs/salla-order-totals-card.cjs.entry.js +1 -1
  85. package/dist/cjs/salla-orders.cjs.entry.js +2 -2
  86. package/dist/cjs/salla-payments.cjs.entry.js +3 -3
  87. package/dist/cjs/salla-placeholder.cjs.entry.js +2 -2
  88. package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
  89. package/dist/cjs/salla-product-card-embed.cjs.entry.js +2 -2
  90. package/dist/cjs/salla-product-card.cjs.entry.js +1 -1
  91. package/dist/cjs/salla-product-size-guide.cjs.entry.js +3 -3
  92. package/dist/cjs/salla-products-list.cjs.entry.js +2 -2
  93. package/dist/cjs/salla-products-slider.cjs.entry.js +2 -2
  94. package/dist/cjs/salla-quick-order.cjs.entry.js +1 -1
  95. package/dist/cjs/salla-rating-modal-v2.cjs.entry.js +33 -7
  96. package/dist/cjs/salla-rating-modal.cjs.entry.js +2 -2
  97. package/dist/cjs/salla-review-factors-tags.cjs.entry.js +2 -2
  98. package/dist/cjs/salla-review-order-item.cjs.entry.js +1 -1
  99. package/dist/cjs/salla-scopes.cjs.entry.js +1 -1
  100. package/dist/cjs/salla-search-product-card.cjs.entry.js +3 -3
  101. package/dist/cjs/salla-search.cjs.entry.js +2 -2
  102. package/dist/cjs/salla-skeleton.cjs.entry.js +2 -2
  103. package/dist/cjs/salla-social-share.cjs.entry.js +2 -2
  104. package/dist/cjs/salla-social.cjs.entry.js +2 -2
  105. package/dist/cjs/salla-tab-content_3.cjs.entry.js +4 -4
  106. package/dist/cjs/salla-thank-you-header.cjs.entry.js +2 -2
  107. package/dist/cjs/salla-thank-you-page.cjs.entry.js +2 -2
  108. package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
  109. package/dist/cjs/salla-trust-badges.cjs.entry.js +1 -1
  110. package/dist/cjs/salla-user-menu.cjs.entry.js +1 -1
  111. package/dist/cjs/salla-user-profile.cjs.entry.js +1 -1
  112. package/dist/cjs/salla-user-settings.cjs.entry.js +2 -2
  113. package/dist/cjs/salla-verify.cjs.entry.js +3 -3
  114. package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
  115. package/dist/cjs/salla-wishlist-actions.cjs.entry.js +2 -2
  116. package/dist/cjs/salla-wishlist-summary.cjs.entry.js +2 -2
  117. package/dist/cjs/twilight.cjs.js +2 -2
  118. package/dist/cjs/{vanilla-picker-Vx_7G7bs.js → vanilla-picker-C-rN_NiT.js} +1 -1
  119. package/dist/collection/collection-manifest.json +1 -0
  120. package/dist/collection/components/salla-bullet-delivery/helpers.js +23 -0
  121. package/dist/collection/components/salla-bullet-delivery/salla-bullet-delivery.js +7 -12
  122. package/dist/collection/components/salla-mobile-update-modal/salla-mobile-update-modal.css +43 -0
  123. package/dist/collection/components/salla-mobile-update-modal/salla-mobile-update-modal.js +235 -0
  124. package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-cart.js +1 -1
  125. package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-details.js +2 -2
  126. package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-options-modal.js +4 -4
  127. package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-slider.js +1 -1
  128. package/dist/collection/components/salla-multiple-bundle-product/salla-multiple-bundle-product.js +1 -1
  129. package/dist/collection/components/salla-notifications/salla-notification-item.js +1 -1
  130. package/dist/collection/components/salla-offer-modal/salla-offer-modal.js +1 -1
  131. package/dist/collection/components/salla-order-details/salla-order-details.js +1 -1
  132. package/dist/collection/components/salla-order-edit/salla-order-edit-product-card.js +1 -1
  133. package/dist/collection/components/salla-order-items/salla-order-items.js +1 -1
  134. package/dist/collection/components/salla-order-payment/salla-order-payment.js +1 -1
  135. package/dist/collection/components/salla-order-rewards/salla-order-rewards.js +1 -1
  136. package/dist/collection/components/salla-order-summary/salla-order-summary.js +1 -1
  137. package/dist/collection/components/salla-payments/salla-payments.js +2 -2
  138. package/dist/collection/components/salla-placeholder/salla-placeholder.js +1 -1
  139. package/dist/collection/components/salla-product-availability/salla-product-availability.js +1 -1
  140. package/dist/collection/components/salla-product-card-embed/salla-product-card-embed.js +1 -1
  141. package/dist/collection/components/salla-product-size-guide/salla-product-size-guide.js +2 -2
  142. package/dist/collection/components/salla-quantity-input/salla-quantity-input.js +1 -1
  143. package/dist/collection/components/salla-quick-buy/salla-quick-buy.js +47 -1
  144. package/dist/collection/components/salla-rating-modal/salla-rating-modal-v2.js +31 -5
  145. package/dist/collection/components/salla-review-card/salla-review-card.js +1 -1
  146. package/dist/collection/components/salla-review-factors-tags/salla-review-factors-tags.js +1 -1
  147. package/dist/collection/components/salla-reviews-page/salla-reviews-page.js +1 -1
  148. package/dist/collection/components/salla-search-product-card/salla-search-product-card.js +2 -2
  149. package/dist/collection/components/salla-searchable-dropdown/salla-searchable-dropdown.js +4 -4
  150. package/dist/collection/components/salla-skeleton/salla-skeleton.js +1 -1
  151. package/dist/collection/components/salla-social/salla-social.js +1 -1
  152. package/dist/collection/components/salla-social-share/salla-social-share.js +1 -1
  153. package/dist/collection/components/salla-tabs/salla-tab-content.js +1 -1
  154. package/dist/collection/components/salla-tabs/salla-tab-header.js +1 -1
  155. package/dist/collection/components/salla-tabs/salla-tabs.js +1 -1
  156. package/dist/collection/components/salla-tel-input/salla-tel-input.js +1 -1
  157. package/dist/collection/components/salla-thank-you-header/salla-thank-you-header.js +1 -1
  158. package/dist/collection/components/salla-thank-you-page/salla-thank-you-page.js +1 -1
  159. package/dist/collection/components/salla-tooltip/salla-tooltip.js +1 -1
  160. package/dist/collection/components/salla-user-settings/salla-user-settings.js +1 -1
  161. package/dist/collection/components/salla-verify/salla-verify.js +48 -2
  162. package/dist/collection/components/salla-wishlist-actions/salla-wishlist-actions.js +1 -1
  163. package/dist/components/delivery-promise-intent.js +67 -0
  164. package/dist/components/helpers.js +24 -1
  165. package/dist/components/index.js +2 -2
  166. package/dist/components/mail.js +2 -2
  167. package/dist/components/salla-bullet-delivery.js +7 -12
  168. package/dist/components/salla-contacts.js +2 -2
  169. package/dist/components/salla-delivery-promise.js +1 -62
  170. package/dist/components/salla-loyalty-point2.js +2 -2
  171. package/dist/components/salla-mobile-update-modal.d.ts +11 -0
  172. package/dist/components/salla-mobile-update-modal.js +241 -0
  173. package/dist/components/salla-multiple-bundle-product-cart2.js +1 -1
  174. package/dist/components/salla-multiple-bundle-product-details2.js +2 -2
  175. package/dist/components/salla-multiple-bundle-product-options-modal2.js +4 -4
  176. package/dist/components/salla-multiple-bundle-product-slider2.js +1 -1
  177. package/dist/components/salla-multiple-bundle-product.js +1 -1
  178. package/dist/components/salla-notification-item2.js +1 -1
  179. package/dist/components/salla-offer-modal.js +1 -1
  180. package/dist/components/salla-order-details.js +1 -1
  181. package/dist/components/salla-order-edit-product-card.js +1 -1
  182. package/dist/components/salla-order-items2.js +1 -1
  183. package/dist/components/salla-order-payment.js +1 -1
  184. package/dist/components/salla-order-rewards.js +1 -1
  185. package/dist/components/salla-order-summary.js +1 -1
  186. package/dist/components/salla-payments.js +2 -2
  187. package/dist/components/salla-placeholder2.js +1 -1
  188. package/dist/components/salla-product-availability2.js +1 -1
  189. package/dist/components/salla-product-card-embed.js +1 -1
  190. package/dist/components/salla-product-size-guide.js +2 -2
  191. package/dist/components/salla-quantity-input2.js +1 -1
  192. package/dist/components/salla-quick-buy2.js +117 -3
  193. package/dist/components/salla-quick-order.js +2 -2
  194. package/dist/components/salla-rating-modal-v22.js +33 -7
  195. package/dist/components/salla-rating-modal2.js +2 -2
  196. package/dist/components/salla-review-card2.js +1 -1
  197. package/dist/components/salla-review-factors-tags2.js +1 -1
  198. package/dist/components/salla-reviews-page.js +1 -1
  199. package/dist/components/salla-search-product-card2.js +2 -2
  200. package/dist/components/salla-searchable-dropdown2.js +4 -4
  201. package/dist/components/salla-skeleton2.js +1 -1
  202. package/dist/components/salla-social-share2.js +4 -4
  203. package/dist/components/salla-social.js +1 -1
  204. package/dist/components/salla-tab-content2.js +1 -1
  205. package/dist/components/salla-tab-header2.js +1 -1
  206. package/dist/components/salla-tabs2.js +1 -1
  207. package/dist/components/salla-tel-input2.js +1 -1
  208. package/dist/components/salla-thank-you-header.js +1 -1
  209. package/dist/components/salla-thank-you-page.js +1 -1
  210. package/dist/components/salla-tooltip2.js +1 -1
  211. package/dist/components/salla-user-settings.js +1 -1
  212. package/dist/components/salla-verify.js +1 -321
  213. package/dist/components/salla-verify2.js +328 -0
  214. package/dist/components/salla-wishlist-actions.js +1 -1
  215. package/dist/docs.json +158 -2
  216. package/dist/esm/{Helper-I0CAizv1.js → Helper-BKruFMBN.js} +1 -1
  217. package/dist/esm/delivery-promise-intent-C6pZjRut.js +67 -0
  218. package/dist/esm/{filepond-DTUYXV0J.js → filepond-Vl6a--vT.js} +1 -1
  219. package/dist/esm/{filepond-plugin-file-poster-DydZjneT.js → filepond-plugin-file-poster-CrQqmzd5.js} +1 -1
  220. package/dist/esm/{filepond-plugin-file-validate-size-nbsCU2t9.js → filepond-plugin-file-validate-size-BrHjddJa.js} +1 -1
  221. package/dist/esm/{filepond-plugin-file-validate-type-Cl5B_DIy.js → filepond-plugin-file-validate-type-BeMZq9Fl.js} +1 -1
  222. package/dist/esm/{filepond-plugin-image-edit-bzskFyFR.js → filepond-plugin-image-edit-DW6JzY39.js} +1 -1
  223. package/dist/esm/{filepond-plugin-image-exif-orientation-MBDuxLaX.js → filepond-plugin-image-exif-orientation-gzIIB75B.js} +1 -1
  224. package/dist/esm/{filepond-plugin-image-preview-N6wzEryW.js → filepond-plugin-image-preview-BwbtnJIU.js} +1 -1
  225. package/dist/esm/{helpers-Cnh7Qptl.js → helpers-BVaKfTMx.js} +24 -1
  226. package/dist/esm/{index-C9zdeQFI.js → index-CrXKQnBu.js} +14 -10
  227. package/dist/esm/{intlTelInput-B5L9nYtO.js → intlTelInput-BkjSbnO6.js} +1 -1
  228. package/dist/esm/loader.js +3 -3
  229. package/dist/esm/salla-accordion-body_2.entry.js +1 -1
  230. package/dist/esm/salla-accordion_6.entry.js +2 -2
  231. package/dist/esm/salla-add-product-button_5.entry.js +120 -6
  232. package/dist/esm/salla-advertisement.entry.js +1 -1
  233. package/dist/esm/salla-alert_2.entry.js +1 -1
  234. package/dist/esm/salla-app-install-alert.entry.js +1 -1
  235. package/dist/esm/salla-applied-filters.entry.js +2 -2
  236. package/dist/esm/salla-apps-icons.entry.js +1 -1
  237. package/dist/esm/salla-attachment-view_9.entry.js +13 -13
  238. package/dist/esm/salla-badge.entry.js +1 -1
  239. package/dist/esm/salla-basket-gap.entry.js +1 -1
  240. package/dist/esm/salla-bullet-delivery_3.entry.js +12 -17
  241. package/dist/esm/salla-cart-coupons.entry.js +1 -1
  242. package/dist/esm/salla-cart-item-offers_2.entry.js +1 -1
  243. package/dist/esm/salla-cart-summary-card.entry.js +1 -1
  244. package/dist/esm/salla-cashback-banner.entry.js +1 -1
  245. package/dist/esm/salla-comment-factors.entry.js +1 -1
  246. package/dist/esm/salla-comment-form_9.entry.js +4 -4
  247. package/dist/esm/salla-conditional-offer.entry.js +1 -1
  248. package/dist/esm/salla-contacts.entry.js +1 -1
  249. package/dist/esm/salla-cookies-bar.entry.js +1 -1
  250. package/dist/esm/salla-count-down.entry.js +1 -1
  251. package/dist/esm/salla-custom-fields.entry.js +1 -1
  252. package/dist/esm/salla-delivery-promise.entry.js +3 -63
  253. package/dist/esm/salla-edit-order-button.entry.js +1 -1
  254. package/dist/esm/salla-filters-widget.entry.js +2 -2
  255. package/dist/esm/salla-filters.entry.js +2 -2
  256. package/dist/esm/salla-free-shipping-banner.entry.js +1 -1
  257. package/dist/esm/salla-free-shipping-tag.entry.js +1 -1
  258. package/dist/esm/salla-fulfillment-methods.entry.js +1 -1
  259. package/dist/esm/salla-gift-card-redeem_2.entry.js +2 -2
  260. package/dist/esm/salla-gifting.entry.js +1 -1
  261. package/dist/esm/salla-hook.entry.js +1 -1
  262. package/dist/esm/salla-infinite-scroll.entry.js +2 -2
  263. package/dist/esm/salla-installment.entry.js +1 -1
  264. package/dist/esm/salla-list-tile.entry.js +1 -1
  265. package/dist/esm/salla-localization-modal.entry.js +1 -1
  266. package/dist/esm/salla-login-modal.entry.js +1 -1
  267. package/dist/esm/salla-loyalty-banner_10.entry.js +1 -1
  268. package/dist/esm/salla-loyalty-exchange-product-card.entry.js +1 -1
  269. package/dist/esm/salla-loyalty-points-banner.entry.js +1 -1
  270. package/dist/esm/salla-loyalty-points-history.entry.js +1 -1
  271. package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
  272. package/dist/esm/salla-loyalty.entry.js +1 -1
  273. package/dist/esm/salla-maintenance-alert.entry.js +1 -1
  274. package/dist/esm/salla-map_3.entry.js +1 -1
  275. package/dist/esm/salla-menu.entry.js +1 -1
  276. package/dist/esm/salla-metadata.entry.js +1 -1
  277. package/dist/esm/salla-mobile-update-modal.entry.js +186 -0
  278. package/dist/esm/salla-multiple-bundle-product-cart_2.entry.js +4 -4
  279. package/dist/esm/salla-multiple-bundle-product-options-modal_2.entry.js +6 -6
  280. package/dist/esm/salla-multiple-bundle-product.entry.js +2 -2
  281. package/dist/esm/salla-next-order-coupon.entry.js +1 -1
  282. package/dist/esm/salla-notification-item_2.entry.js +3 -3
  283. package/dist/esm/salla-offer-modal.entry.js +2 -2
  284. package/dist/esm/salla-offer.entry.js +1 -1
  285. package/dist/esm/salla-order-branch.entry.js +1 -1
  286. package/dist/esm/salla-order-cancel.entry.js +1 -1
  287. package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +1 -1
  288. package/dist/esm/salla-order-details-options.entry.js +1 -1
  289. package/dist/esm/salla-order-details.entry.js +2 -2
  290. package/dist/esm/salla-order-edit-item.entry.js +1 -1
  291. package/dist/esm/salla-order-edit-product-card.entry.js +2 -2
  292. package/dist/esm/salla-order-edit.entry.js +1 -1
  293. package/dist/esm/salla-order-items.entry.js +2 -2
  294. package/dist/esm/salla-order-options-modal.entry.js +1 -1
  295. package/dist/esm/salla-order-payment.entry.js +2 -2
  296. package/dist/esm/salla-order-rewards.entry.js +2 -2
  297. package/dist/esm/salla-order-shipments.entry.js +1 -1
  298. package/dist/esm/salla-order-summary.entry.js +2 -2
  299. package/dist/esm/salla-order-totals-card.entry.js +1 -1
  300. package/dist/esm/salla-orders.entry.js +2 -2
  301. package/dist/esm/salla-payments.entry.js +3 -3
  302. package/dist/esm/salla-placeholder.entry.js +2 -2
  303. package/dist/esm/salla-price-range.entry.js +1 -1
  304. package/dist/esm/salla-product-card-embed.entry.js +2 -2
  305. package/dist/esm/salla-product-card.entry.js +1 -1
  306. package/dist/esm/salla-product-size-guide.entry.js +3 -3
  307. package/dist/esm/salla-products-list.entry.js +2 -2
  308. package/dist/esm/salla-products-slider.entry.js +2 -2
  309. package/dist/esm/salla-quick-order.entry.js +1 -1
  310. package/dist/esm/salla-rating-modal-v2.entry.js +33 -7
  311. package/dist/esm/salla-rating-modal.entry.js +2 -2
  312. package/dist/esm/salla-review-factors-tags.entry.js +2 -2
  313. package/dist/esm/salla-review-order-item.entry.js +1 -1
  314. package/dist/esm/salla-scopes.entry.js +1 -1
  315. package/dist/esm/salla-search-product-card.entry.js +3 -3
  316. package/dist/esm/salla-search.entry.js +2 -2
  317. package/dist/esm/salla-skeleton.entry.js +2 -2
  318. package/dist/esm/salla-social-share.entry.js +2 -2
  319. package/dist/esm/salla-social.entry.js +2 -2
  320. package/dist/esm/salla-tab-content_3.entry.js +4 -4
  321. package/dist/esm/salla-thank-you-header.entry.js +2 -2
  322. package/dist/esm/salla-thank-you-page.entry.js +2 -2
  323. package/dist/esm/salla-tiered-offer.entry.js +1 -1
  324. package/dist/esm/salla-trust-badges.entry.js +1 -1
  325. package/dist/esm/salla-user-menu.entry.js +1 -1
  326. package/dist/esm/salla-user-profile.entry.js +1 -1
  327. package/dist/esm/salla-user-settings.entry.js +2 -2
  328. package/dist/esm/salla-verify.entry.js +3 -3
  329. package/dist/esm/salla-wallet.entry.js +1 -1
  330. package/dist/esm/salla-wishlist-actions.entry.js +2 -2
  331. package/dist/esm/salla-wishlist-summary.entry.js +2 -2
  332. package/dist/esm/twilight.js +3 -3
  333. package/dist/esm/{vanilla-picker-CAeu4f87.js → vanilla-picker-eSagUASw.js} +1 -1
  334. package/dist/twilight/p-0050dd2a.entry.js +4 -0
  335. package/dist/twilight/{p-c92cc92f.entry.js → p-012ff05c.entry.js} +1 -1
  336. package/dist/twilight/{p-8948b58c.entry.js → p-02ce2139.entry.js} +1 -1
  337. package/dist/twilight/{p-3cc6ca6c.entry.js → p-059aa8a9.entry.js} +1 -1
  338. package/dist/twilight/{p-995b898f.entry.js → p-09798a10.entry.js} +1 -1
  339. package/dist/twilight/p-0af7555c.entry.js +4 -0
  340. package/dist/twilight/{p-bbb09d92.entry.js → p-11075f15.entry.js} +1 -1
  341. package/dist/twilight/{p-e20d5e75.entry.js → p-12b2b553.entry.js} +1 -1
  342. package/dist/twilight/{p-619c709c.entry.js → p-14fb124b.entry.js} +1 -1
  343. package/dist/twilight/{p-e921b2d1.entry.js → p-1ca3525d.entry.js} +1 -1
  344. package/dist/twilight/{p-30d64bd1.entry.js → p-1f54638c.entry.js} +1 -1
  345. package/dist/twilight/{p-2b930157.entry.js → p-201c816d.entry.js} +1 -1
  346. package/dist/twilight/{p-d0f903ac.entry.js → p-203b2723.entry.js} +1 -1
  347. package/dist/twilight/{p-c4274188.entry.js → p-224c35e6.entry.js} +1 -1
  348. package/dist/twilight/{p-386b3dcd.entry.js → p-22bd8281.entry.js} +1 -1
  349. package/dist/twilight/{p-4070f808.entry.js → p-25ac8744.entry.js} +1 -1
  350. package/dist/twilight/{p-ec356e5a.entry.js → p-25b964c0.entry.js} +1 -1
  351. package/dist/twilight/{p-7fa4d0b6.entry.js → p-2a469c80.entry.js} +1 -1
  352. package/dist/twilight/{p-d57b49ff.entry.js → p-2a6f93a8.entry.js} +1 -1
  353. package/dist/twilight/{p-2e4e15c5.entry.js → p-2b0f98fc.entry.js} +1 -1
  354. package/dist/twilight/{p-8712f7c7.entry.js → p-2e66576c.entry.js} +1 -1
  355. package/dist/twilight/{p-45e0a5d0.entry.js → p-2e8e7cf2.entry.js} +1 -1
  356. package/dist/twilight/{p-faf00404.entry.js → p-2f05393f.entry.js} +1 -1
  357. package/dist/twilight/{p-a0bfedad.entry.js → p-3054e1c1.entry.js} +1 -1
  358. package/dist/twilight/{p-90a59027.entry.js → p-3295390b.entry.js} +1 -1
  359. package/dist/twilight/{p-a3959219.entry.js → p-33678067.entry.js} +1 -1
  360. package/dist/twilight/{p-4d615f9f.entry.js → p-33c05de2.entry.js} +1 -1
  361. package/dist/twilight/{p-036fbfc0.entry.js → p-381a9e70.entry.js} +1 -1
  362. package/dist/twilight/{p-982e9124.entry.js → p-38270121.entry.js} +1 -1
  363. package/dist/twilight/{p-7db6ccfe.entry.js → p-385bf37d.entry.js} +1 -1
  364. package/dist/twilight/{p-8c2992e7.entry.js → p-40ee2ca3.entry.js} +1 -1
  365. package/dist/twilight/{p-e455709f.entry.js → p-43a3401b.entry.js} +1 -1
  366. package/dist/twilight/{p-32f100f8.entry.js → p-4616033a.entry.js} +1 -1
  367. package/dist/twilight/p-484af8cc.entry.js +4 -0
  368. package/dist/twilight/{p-32495dd2.entry.js → p-4b6627f5.entry.js} +1 -1
  369. package/dist/twilight/p-4ed8ae08.entry.js +4 -0
  370. package/dist/twilight/{p-8eb3fd92.entry.js → p-4fb442c2.entry.js} +1 -1
  371. package/dist/twilight/{p-8262e669.entry.js → p-516f9b83.entry.js} +1 -1
  372. package/dist/twilight/{p-99cb3dba.entry.js → p-56aebb36.entry.js} +1 -1
  373. package/dist/twilight/{p-1867f7d4.entry.js → p-56fbe5ff.entry.js} +1 -1
  374. package/dist/twilight/{p-5aee5e44.entry.js → p-58af47e4.entry.js} +1 -1
  375. package/dist/twilight/{p-575014c4.entry.js → p-616e6781.entry.js} +1 -1
  376. package/dist/twilight/{p-e223beca.entry.js → p-62077080.entry.js} +1 -1
  377. package/dist/twilight/p-6427664a.entry.js +4 -0
  378. package/dist/twilight/{p-0b0d4942.entry.js → p-65253725.entry.js} +1 -1
  379. package/dist/twilight/{p-d0acd7ff.entry.js → p-6a05f69c.entry.js} +1 -1
  380. package/dist/twilight/{p-cb54adac.entry.js → p-6afa5aa8.entry.js} +1 -1
  381. package/dist/twilight/{p-3b766a79.entry.js → p-6ff116eb.entry.js} +1 -1
  382. package/dist/twilight/{p-9e429047.entry.js → p-710b19d2.entry.js} +1 -1
  383. package/dist/twilight/{p-e3991836.entry.js → p-71297800.entry.js} +1 -1
  384. package/dist/twilight/{p-0add41ce.entry.js → p-7234a066.entry.js} +1 -1
  385. package/dist/twilight/{p-777d28f6.entry.js → p-73af6a02.entry.js} +1 -1
  386. package/dist/twilight/{p-20f9c62f.entry.js → p-7428deca.entry.js} +1 -1
  387. package/dist/twilight/{p-703b9253.entry.js → p-75b509cd.entry.js} +1 -1
  388. package/dist/twilight/{p-9a0218a6.entry.js → p-79e446b2.entry.js} +1 -1
  389. package/dist/twilight/{p-550ad1a6.entry.js → p-7a8c9411.entry.js} +1 -1
  390. package/dist/twilight/{p-427c13b6.entry.js → p-86533832.entry.js} +1 -1
  391. package/dist/twilight/p-8a4af12c.entry.js +4 -0
  392. package/dist/twilight/{p-3bb0e184.entry.js → p-8ddf6933.entry.js} +1 -1
  393. package/dist/twilight/{p-fa622715.entry.js → p-93fe31b9.entry.js} +1 -1
  394. package/dist/twilight/{p-9d1a5007.entry.js → p-9c96a9e7.entry.js} +1 -1
  395. package/dist/twilight/{p-RflSBQNB.js → p-BNr49RmW.js} +1 -1
  396. package/dist/twilight/{p-JGEddAgs.js → p-BUzdlb7Q.js} +1 -1
  397. package/dist/twilight/{p-Cnh7Qptl.js → p-BVaKfTMx.js} +1 -1
  398. package/dist/twilight/{p-CmYSalnM.js → p-BYWjrTuB.js} +1 -1
  399. package/dist/twilight/{p-CSGj1pY-.js → p-Bo_J3Do4.js} +1 -1
  400. package/dist/twilight/{p-Cfz9xit3.js → p-ChxhrML8.js} +1 -1
  401. package/dist/twilight/{p-C9zdeQFI.js → p-CrXKQnBu.js} +2 -2
  402. package/dist/twilight/{p-Bgu5gtOF.js → p-D1oKTNWQ.js} +1 -1
  403. package/dist/twilight/{p-Dav_R_d2.js → p-DUNRPrqt.js} +1 -1
  404. package/dist/twilight/{p-BcT9tEVW.js → p-DUuRpwsl.js} +1 -1
  405. package/dist/twilight/{p-Xgbueas7.js → p-DZR3BP63.js} +1 -1
  406. package/dist/twilight/{p-6f84c662.entry.js → p-a52a3664.entry.js} +1 -1
  407. package/dist/twilight/p-a7114995.entry.js +4 -0
  408. package/dist/twilight/{p-e37da59f.entry.js → p-aa7494cd.entry.js} +1 -1
  409. package/dist/twilight/{p-eeefc285.entry.js → p-ae5d26da.entry.js} +1 -1
  410. package/dist/twilight/{p-17bcbf9b.entry.js → p-b5434bcc.entry.js} +1 -1
  411. package/dist/twilight/p-b9fabd92.entry.js +4 -0
  412. package/dist/twilight/{p-01d5cd61.entry.js → p-bac38ed2.entry.js} +1 -1
  413. package/dist/twilight/{p-6d572fe0.entry.js → p-bbcfcdb0.entry.js} +1 -1
  414. package/dist/twilight/{p-a22d9931.entry.js → p-c097cfa1.entry.js} +1 -1
  415. package/dist/twilight/p-c13e7efb.entry.js +4 -0
  416. package/dist/twilight/{p-c5e2c781.entry.js → p-d0ea4c3a.entry.js} +1 -1
  417. package/dist/twilight/{p-74285af9.entry.js → p-d0ec7ca7.entry.js} +1 -1
  418. package/dist/twilight/{p-4d7fc363.entry.js → p-d31fbdea.entry.js} +1 -1
  419. package/dist/twilight/{p-9683535f.entry.js → p-d482d43e.entry.js} +1 -1
  420. package/dist/twilight/{p-0213fde4.entry.js → p-d5368882.entry.js} +1 -1
  421. package/dist/twilight/{p-b5e0065a.entry.js → p-d5a2a231.entry.js} +1 -1
  422. package/dist/twilight/{p-a55b5c44.entry.js → p-d6705759.entry.js} +1 -1
  423. package/dist/twilight/p-d7f2a028.entry.js +4 -0
  424. package/dist/twilight/{p-7db8d545.entry.js → p-d84dedaf.entry.js} +1 -1
  425. package/dist/twilight/{p-f6279a13.entry.js → p-d8d9ff09.entry.js} +1 -1
  426. package/dist/twilight/{p-3b7a45ec.entry.js → p-d902ad13.entry.js} +1 -1
  427. package/dist/twilight/{p-ade9a68c.entry.js → p-d941dc58.entry.js} +1 -1
  428. package/dist/twilight/{p-db3efb27.entry.js → p-dd046bbd.entry.js} +1 -1
  429. package/dist/twilight/{p-a5fc8358.entry.js → p-dd21db09.entry.js} +1 -1
  430. package/dist/twilight/{p-aabcd09f.entry.js → p-dd83b424.entry.js} +1 -1
  431. package/dist/twilight/{p-8b8cf457.entry.js → p-e04fb844.entry.js} +1 -1
  432. package/dist/twilight/{p-290ce0bc.entry.js → p-e60d784c.entry.js} +1 -1
  433. package/dist/twilight/{p-ad00021e.entry.js → p-e6cc7742.entry.js} +1 -1
  434. package/dist/twilight/{p-252748d9.entry.js → p-e853ac07.entry.js} +1 -1
  435. package/dist/twilight/{p-db73d0bf.entry.js → p-e9ecae21.entry.js} +1 -1
  436. package/dist/twilight/{p-f3b12754.entry.js → p-ebe3d316.entry.js} +1 -1
  437. package/dist/twilight/{p-ce1e45a3.entry.js → p-ec2a45fb.entry.js} +1 -1
  438. package/dist/twilight/{p-73dea22d.entry.js → p-ef216c0a.entry.js} +1 -1
  439. package/dist/twilight/{p-825c5b73.entry.js → p-f3306980.entry.js} +1 -1
  440. package/dist/twilight/{p-50853b76.entry.js → p-f65205d5.entry.js} +1 -1
  441. package/dist/twilight/{p-32d9da31.entry.js → p-f6e5cd28.entry.js} +1 -1
  442. package/dist/twilight/{p-412fb721.entry.js → p-f8cfc9f7.entry.js} +1 -1
  443. package/dist/twilight/{p-c2df20f8.entry.js → p-faa0b9aa.entry.js} +1 -1
  444. package/dist/twilight/{p-5009f654.entry.js → p-fb10df18.entry.js} +1 -1
  445. package/dist/twilight/{p-c64b2b22.entry.js → p-fcb1cff7.entry.js} +1 -1
  446. package/dist/twilight/{p-f83efc62.entry.js → p-ff3cb99b.entry.js} +1 -1
  447. package/dist/twilight/{p-194ff38c.entry.js → p-ff4680ea.entry.js} +1 -1
  448. package/dist/twilight/p-oL7bxwey.js +9 -0
  449. package/dist/twilight/p-q5NJ0uS-.js +4 -0
  450. package/dist/twilight/twilight.esm.js +1 -1
  451. package/dist/types/components/salla-bullet-delivery/helpers.d.ts +7 -0
  452. package/dist/types/components/salla-bullet-delivery/interfaces.d.ts +4 -0
  453. package/dist/types/components/salla-bullet-delivery/salla-bullet-delivery.d.ts +0 -2
  454. package/dist/types/components/salla-mobile-update-modal/salla-mobile-update-modal.d.ts +44 -0
  455. package/dist/types/components/salla-quick-buy/salla-quick-buy.d.ts +12 -0
  456. package/dist/types/components/salla-rating-modal/salla-rating-modal-v2.d.ts +4 -0
  457. package/dist/types/components/salla-verify/salla-verify.d.ts +8 -0
  458. package/dist/types/components.d.ts +50 -0
  459. package/package.json +5 -5
  460. package/dist/twilight/p-2e6537a3.entry.js +0 -4
  461. package/dist/twilight/p-3a4e86d1.entry.js +0 -4
  462. package/dist/twilight/p-86d55a6b.entry.js +0 -4
  463. package/dist/twilight/p-8c548259.entry.js +0 -4
  464. package/dist/twilight/p-908716fb.entry.js +0 -4
  465. package/dist/twilight/p-9cf31ff4.entry.js +0 -4
  466. package/dist/twilight/p-9e542951.entry.js +0 -4
  467. package/dist/twilight/p-CWWgpQ8Q.js +0 -9
  468. package/dist/twilight/p-a070cce0.entry.js +0 -4
  469. package/dist/twilight/p-a3ca61af.entry.js +0 -4
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as e,h as t,H as s}from"./p-C9zdeQFI.js";var i='\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>user-off</title>\n<path d="M10.837 19.309c-4.963 1.284-8.171 4.303-8.171 7.691v3.667c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-3.667c0-2.101 2.48-4.155 6.172-5.109 0.713-0.184 1.141-0.912 0.957-1.625-0.184-0.711-0.908-1.137-1.625-0.956zM12.859 3.715c0.933-0.685 2.020-1.048 3.141-1.048 2.941 0 5.333 2.392 5.333 5.333 0 1.121-0.363 2.208-1.048 3.141-0.436 0.593-0.308 1.428 0.284 1.864 0.239 0.175 0.515 0.259 0.788 0.259 0.411 0 0.815-0.188 1.076-0.544 1.025-1.393 1.567-3.025 1.567-4.72 0-4.412-3.588-8-8-8-1.695 0-3.327 0.541-4.721 1.567-0.592 0.435-0.72 1.269-0.284 1.864 0.436 0.593 1.269 0.721 1.864 0.284zM31.609 29.724l-29.333-29.333c-0.521-0.521-1.364-0.521-1.885 0s-0.521 1.364 0 1.885l29.333 29.333c0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391c0.521-0.521 0.521-1.364 0-1.885z"></path>\n</svg>\n';const r=class{constructor(t){e(this,t),this.otpInputs=[],this.isDeleteAccountEnabled=!!salla.config.get("store.features",[])?.includes("customer-account-deletion"),this.deactivateAccount=salla.lang.get("pages.profile.deactivate_account"),this.deactivateDesc=salla.lang.get("pages.profile.deactivate_account_description"),this.sorryForLeavingText=salla.lang.get("pages.profile.warning_for_deactivate"),this.warningText=salla.lang.get("pages.profile.sorry_for_leaving"),this.keepAccount=salla.lang.get("pages.profile.keep_account"),this.buttonLoading=!1,this.deletePendingDays=null,this.currentStep="confirm",this.isDeletePending=!1,this.otpType="email",this.otpHasError=!1,this.otpErrorMessage="",this.isSubmitting=!1,this.isVerifyingOtp=!1,this.isSwitchingChannel=!1,this.resendAfter=30,this.showResendLink=!1,this.canHideName=salla.config.get("store.settings.rating.can_customer_hide_name"),this.translationDefaults={"pages.profile.delete_account":{ar:"حذف الحساب",en:"Delete account"},"pages.profile.delete_account_description":{ar:"سيُحذف حسابك وبياناتك من المتجر نهائيًا، بما في ذلك سجل طلباتك.",en:"Your account and data will be permanently deleted from the store, including your order history."},"pages.profile.delete_account_confirm_title":{ar:"هل تريد حذف حسابك؟",en:"Do you want to delete your account?"},"pages.profile.delete_account_warning":{ar:"بعد الحذف، ستفقد الوصول إلى بياناتك، بما في ذلك سجل الطلبات، وقائمة الأمنيات، وأي نقاط ولاء أو رصيد متاح في المحفظة.",en:"After deletion, you will lose access to your data, including order history, wishlist, and any loyalty points or wallet balance."},"pages.profile.cancel":{ar:"إلغاء",en:"Cancel"},"pages.profile.delete_account_otp_title":{ar:"تأكيد حذف الحساب",en:"Confirm account deletion"},"pages.profile.delete_account_otp_instruction":{ar:"للمتابعة، أدخل رمز التحقٌّق المرسل إلى:",en:"To continue, enter the verification code sent to:"},"pages.profile.delete_account_confirm_otp":{ar:"تأكيد الحذف",en:"Confirm deletion"},"pages.profile.delete_account_otp_required":{ar:"يرجى إدخال رمز التحقٌّق",en:"Please enter the verification code"},"pages.profile.delete_account_send_via_phone":{ar:"إرسال عبر الهاتف",en:"Send via phone"},"pages.profile.delete_account_send_via_email":{ar:"إرسال عبر البريد الإلكتروني",en:"Send via email"},"pages.profile.delete_account_success_title":{ar:"أُرسل طلب حذف الحساب",en:"Account deletion request submitted"},"pages.profile.delete_account_success_message":{ar:"سيُحذف حسابك خلال 30 يومًا. يمكنك إلغاء الطلب بتسجيل الدخول مرة أخرى قبل اكتمال الحذف.",en:"Your account will be deleted within 30 days. You can cancel the request by signing in again before deletion is complete."},"pages.profile.ok":{ar:"موافق",en:"OK"},"pages.profile.cancel_deletion_request":{ar:"تراجع عن الحذف",en:"Withdraw deletion"},"pages.profile.delete_account_pending":{ar:"حسابك مجدول للحذف نهائيًا من المتجر خلال :days يومًا. يمكنك التراجع عن الحذف قبل انقضاء المدة.",en:"Your account will be deleted permanently from the store within :days days. You can withdraw the deletion before the deadline."},"pages.profile.delete_request_cancelled":{ar:"تم إلغاء طلب الحذف",en:"Deletion request cancelled"}},this.needsProfileListener=!1,this.profileListenerBound=!1,this.profileInfoFetchedListener=e=>{this.isHiddenName=this.readHiddenName(e.data.preferences,e.data.is_hidden_name),this.isNotifiable=e.data.preferences?.notifications_enabled??e.data.is_notifiable},this.isConnectedToDom=!1,this.registerTranslationDefaults(),this.loadTranslations(),salla.onReady((()=>{const e=salla.config.get("user.preferences");this.isHiddenName=this.readHiddenName(e,salla.config.get("user.is_hidden_name")),this.isNotifiable=e?.notifications_enabled??salla.config.get("user.is_notifiable"),this.canHideName=salla.config.get("store.settings.rating.can_customer_hide_name"),this.isDeleteAccountEnabled&&this.fetchDeleteRequestStatus(),this.needsProfileListener=!this.isNotifiable||!this.isHiddenName,this.bindProfileListener()}))}readHiddenName(e,t){return void 0!==e?.name_visible?!e.name_visible:t}bindProfileListener(){this.needsProfileListener&&!this.profileListenerBound&&this.isConnectedToDom&&(this.profileListenerBound=!0,salla.event.on("profile::info.fetched",this.profileInfoFetchedListener))}connectedCallback(){this.isConnectedToDom=!0,this.bindProfileListener(),this.langUnsubscribe=salla.lang.subscribe((()=>{this.registerTranslationDefaults(),this.loadTranslations()}))}disconnectedCallback(){this.isConnectedToDom=!1,this.profileListenerBound&&(salla.event.off("profile::info.fetched",this.profileInfoFetchedListener),this.profileListenerBound=!1),this.langUnsubscribe?.()}getDaysUntilExecution(e){return Math.max(0,Math.ceil(((e>1e12?e:1e3*e)-Date.now())/864e5))}applyPendingMessage(){const e=salla.lang.get("pages.profile.delete_account_pending");this.deleteAccountPending=null!=this.deletePendingDays?e.replace(/:days/g,String(salla.helpers.number(this.deletePendingDays))):e}async fetchDeleteRequestStatus(){try{const e=await salla.profile.getDeleteRequest(),t=e?.data??null,s=t?.data_request||t,i=s?.status;this.isDeletePending="pending"===i;const r=s?.execution_at;this.deletePendingDays=null==r||Number.isNaN(Number(r))?null:this.getDaysUntilExecution(Number(r)),this.applyPendingMessage()}catch{}}registerTranslationDefaults(){if(!salla?.lang?.addBulk)return;const e=Object.entries(this.translationDefaults).reduce(((e,[t,s])=>(salla.lang.get(t)===t&&(e[t]=s),e)),{});Object.keys(e).length&&salla.lang.addBulk(e)}loadTranslations(){this.deactivateAccount=salla.lang.get("pages.profile.deactivate_account"),this.deactivateDesc=salla.lang.get("pages.profile.deactivate_account_description"),this.sorryForLeavingText=salla.lang.get("pages.profile.warning_for_deactivate"),this.warningText=salla.lang.get("pages.profile.sorry_for_leaving"),this.keepAccount=salla.lang.get("pages.profile.keep_account"),this.deleteAccount=salla.lang.get("pages.profile.delete_account"),this.deleteAccountDesc=salla.lang.get("pages.profile.delete_account_description"),this.deleteConfirmTitle=salla.lang.get("pages.profile.delete_account_confirm_title"),this.deleteAccountWarning=salla.lang.get("pages.profile.delete_account_warning"),this.cancelLabel=salla.lang.get("pages.profile.cancel"),this.deleteOtpTitle=salla.lang.get("pages.profile.delete_account_otp_title"),this.deleteOtpInstruction=salla.lang.get("pages.profile.delete_account_otp_instruction"),this.deleteConfirmOtp=salla.lang.get("pages.profile.delete_account_confirm_otp"),this.sendViaPhone=salla.lang.get("pages.profile.delete_account_send_via_phone"),this.sendViaEmail=salla.lang.get("pages.profile.delete_account_send_via_email"),this.deleteSuccessTitle=salla.lang.get("pages.profile.delete_account_success_title"),this.deleteSuccessMessage=salla.lang.get("pages.profile.delete_account_success_message"),this.okLabel=salla.lang.get("pages.profile.ok"),this.cancelDeletionRequest=salla.lang.get("pages.profile.cancel_deletion_request"),this.applyPendingMessage(),this.resendAfterLabel=salla.lang.get("blocks.header.resend_after"),this.resendLabel=salla.lang.get("blocks.comments.submit"),this.promotionalMsgs=salla.lang.get("pages.profile.promotional_messages"),this.hideMyName=salla.lang.get("pages.profile.hide_my_name"),this.hideMyNameDesc=salla.lang.get("pages.profile.hide_my_name_desc"),this.promotionalMsgsDesc=salla.lang.get("pages.profile.promotional_messages_description")}toggleSetting(e,t){salla.profile.updateSettings({name:e,value:t.target.checked})}capitalizeText(e){return e?e.charAt(0).toUpperCase()+e.slice(1):""}getOtpTarget(){return"email"===this.otpType?salla.config.get("user.email")||"":salla.config.get("user.mobile")||""}updateModalForStep(){if(this.confirmationModal)switch(this.currentStep){case"confirm":this.confirmationModal.setTitle(this.capitalizeText(this.deleteConfirmTitle));break;case"otp":this.confirmationModal.setTitle(this.capitalizeText(this.deleteOtpTitle));break;case"success":this.confirmationModal.setTitle(this.capitalizeText(this.deleteSuccessTitle))}}openDeleteModal(){this.currentStep="confirm",this.otpType="email",this.resetOtpInputs(),this.clearResendTimer(),this.updateModalForStep(),this.confirmationModal.open()}openDeactivateModal(){this.confirmationModal.setTitle(this.capitalizeText(this.deactivateAccount)),this.confirmationModal.open()}async confirmDeactivateAccount(){this.buttonLoading=!0,await salla.profile.delete().finally((()=>{this.buttonLoading=!1,this.confirmationModal.close()}))}closeDeleteModal(){this.clearResendTimer(),this.confirmationModal?.close()}goBackFromOtp(){this.clearResendTimer(),this.resetOtpInputs(),this.resetOtpError(),this.currentStep="confirm",this.updateModalForStep()}async handleModalVisibilityChanged(e){if(e.detail)return;this.clearResendTimer();const t="success"===this.currentStep;t&&(this.isDeletePending=!0),this.currentStep="confirm",this.resetOtpInputs(),t&&await this.fetchDeleteRequestStatus()}formatResendTimer(e){return"00 : "+(e>=10?`${e}`:`0${e}`)}updateResendTimerDisplay(){this.timerEl&&(this.timerEl.innerHTML=this.formatResendTimer(this.resendAfter))}isDeleteRequestInFlight(){return this.isSubmitting||this.isSwitchingChannel||this.isVerifyingOtp}async initiateDeleteRequest(e="confirm"){if(!this.isDeleteRequestInFlight()){"switch"===e||"resend"===e?this.isSwitchingChannel=!0:this.isSubmitting=!0;try{await salla.profile.initiateDeleteRequest(this.otpType),this.currentStep="otp",this.updateModalForStep(),this.resetOtpInputs(),this.startResendTimer(),setTimeout((()=>this.otpInputs[0]?.focus()),100)}catch(e){salla.notify?.error?.(e.response?.data?.error?.message||salla.lang.get("common.errors.error_occurred"))}finally{"switch"===e||"resend"===e?this.isSwitchingChannel=!1:this.isSubmitting=!1}}}async switchOtpChannel(){this.isDeleteRequestInFlight()||(this.otpType="email"===this.otpType?"mobile":"email",await this.initiateDeleteRequest("switch"))}async resendOtp(){this.showResendLink&&!this.isDeleteRequestInFlight()&&await this.initiateDeleteRequest("resend")}collectOtpCode(){const e=salla.helpers.number(this.otpInputs.map((e=>e?.value||"")).join(""),!0).replace(/[^0-9]/g,"");return this.hiddenCodeInput&&(this.hiddenCodeInput.value=e),e}resetOtpError(){this.otpHasError=!1,this.otpErrorMessage=""}setOtpError(e){this.otpHasError=!0,this.otpErrorMessage=e}async verifyDeleteOtp(){if(this.isVerifyingOtp||this.isSwitchingChannel)return;const e=this.collectOtpCode();if(e.length<4)return this.setOtpError(salla.lang.get("pages.profile.delete_account_otp_required")),void this.otpInputs[e.length]?.focus();this.resetOtpError(),this.isVerifyingOtp=!0;try{const t=await salla.profile.verifyDeleteRequest({type:this.otpType,code:e});this.deleteSuccessMessage=t?.data?.message||salla.lang.get("pages.profile.delete_account_success_message"),this.clearResendTimer(),this.resetOtpInputs(),this.otpInputs=[],this.currentStep="success",this.updateModalForStep()}catch(e){this.setOtpError(e.response?.data?.error?.message||salla.lang.get("common.errors.error_occurred")),this.resetOtpInputs()}finally{this.isVerifyingOtp=!1}}async confirmSuccess(){this.isDeletePending=!0,this.closeDeleteModal(),this.currentStep="confirm",await this.fetchDeleteRequestStatus()}async cancelDeleteRequest(){if(!this.isSubmitting){this.isSubmitting=!0;try{const e=(await salla.profile.cancelDeleteRequest()).message||salla.lang.get("pages.profile.delete_request_cancelled");this.isDeletePending=!1,salla.notify?.success?.(e)}catch(e){salla.notify?.error?.(e.response?.data?.error?.message||salla.lang.get("common.errors.error_occurred"))}finally{this.isSubmitting=!1}}}resetOtpInputs(){this.otpInputs.forEach((e=>{e&&(e.value="")})),this.hiddenCodeInput&&(this.hiddenCodeInput.value="")}modifyNextOtpInput(e,t){e.value=t[0],t=t.substring(1),e.nextElementSibling&&t.length?this.modifyNextOtpInput(e.nextElementSibling,t):e.nextElementSibling||0!==t.length?e.nextElementSibling&&0===t.length&&e.nextElementSibling.focus():e.focus()}splitOtpNumber(e){const t=salla.helpers.number(e.data||e.target.value||"",!0).replace(/[^0-9]/g,"");t&&1!==t.length&&this.modifyNextOtpInput(e.target,t)}allOtpInputsFilled(){return this.otpInputs.every((e=>e?.value))}handleOtpInput(e){this.resetOtpError(),e.target.value=salla.helpers.number(e.target.value||"",!0),salla.helpers.inputDigitsOnly(e.target),this.allOtpInputsFilled()&&setTimeout((()=>this.verifyDeleteOtp()),100)}handleOtpKeyUp(e){if(this.resetOtpError(),["Alt","Shift","Control","AltGraph","Ctrl"].includes(e.key))return;const t=e.keyCode||e.charCode;e.target.value?(e.target.nextElementSibling?.focus(),e.target.nextElementSibling?.select()):[8,46].includes(t)&&(e.target.previousElementSibling?.focus(),e.target.previousElementSibling?.select()),e.target.value.length>1&&this.splitOtpNumber(e)}handleOtpPaste(e){this.resetOtpError();const t=salla.helpers.number(e.clipboardData.getData("text")||"",!0).replace(/[^0-9]/g,"").substring(0,this.otpInputs.length);this.otpInputs.forEach((e=>e.value="")),this.otpInputs[0]&&this.modifyNextOtpInput(this.otpInputs[0],t)}handleOtpFocus(e){e.target!==this.otpInputs[0]&&(""===this.otpInputs[0]?.value&&this.otpInputs[0].focus(),""===e.target.previousElementSibling?.value&&e.target.previousElementSibling.focus())}startResendTimer(){this.clearResendTimer(),this.resendAfter=30,this.showResendLink=!1,this.updateResendTimerDisplay(),this.resendTimerId=setInterval((()=>{if(this.resendAfter--,this.resendAfter<=0)return this.clearResendTimer(),void(this.showResendLink=!0);this.updateResendTimerDisplay()}),1e3)}clearResendTimer(){this.resendTimerId&&(clearInterval(this.resendTimerId),this.resendTimerId=null),this.showResendLink=!1}renderUserDeleteIcon(){return t("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24",color:"currentColor",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},t("path",{d:"M14.5 8C14.5 5.23858 12.2614 3 9.5 3C6.73858 3 4.5 5.23858 4.5 8C4.5 10.7614 6.73858 13 9.5 13C12.2614 13 14.5 10.7614 14.5 8Z"}),t("path",{d:"M15.5 21L18.5 18M18.5 18L21.5 15M18.5 18L15.5 15M18.5 18L21.5 21"}),t("path",{d:"M2.5 20C2.5 16.134 5.63401 13 9.5 13C10.775 13 11.9704 13.3409 13 13.9365"}))}renderConfirmStep(){return t("div",{class:"s-user-settings-delete-body"},t("p",{class:"s-user-settings-delete-warning"},this.deleteAccountWarning),t("div",{class:"s-user-settings-delete-actions s-user-settings-delete-actions--row"},t("salla-button",{width:"wide",fill:"outline",color:"danger",onClick:()=>this.closeDeleteModal()},this.capitalizeText(this.cancelLabel)),t("salla-button",{width:"wide",color:"primary",loading:this.isSubmitting,onClick:()=>this.initiateDeleteRequest()},this.capitalizeText(this.deleteAccount))))}renderOtpStep(){return t("div",{class:"s-user-settings-delete-body"},t("p",{class:"s-user-settings-delete-otp-instruction"},this.deleteOtpInstruction),t("p",{class:"s-user-settings-delete-otp-target"},this.getOtpTarget()),t("input",{type:"hidden",name:"code",maxlength:"4",ref:e=>this.hiddenCodeInput=e}),t("div",{class:{"s-user-settings-delete-otp-codes":!0,"has-error":this.otpHasError},dir:"ltr"},[1,2,3,4].map((e=>t("input",{type:"text",autocomplete:"one-time-code",pattern:"[0-9]*",inputmode:"numeric",maxlength:"1",id:`delete-otp-${e}`,class:{"s-user-settings-delete-otp-input":!0,"s-has-error":this.otpHasError},onInput:e=>this.handleOtpInput(e),onPaste:e=>this.handleOtpPaste(e),onKeyUp:e=>this.handleOtpKeyUp(e),onFocus:e=>this.handleOtpFocus(e),ref:t=>this.otpInputs[e-1]=t,required:!0})))),this.otpHasError&&this.otpErrorMessage?t("span",{class:"s-user-settings-delete-otp-error"},this.otpErrorMessage):"",t("div",{class:"s-user-settings-delete-actions s-user-settings-delete-actions--stack"},t("salla-button",{width:"wide",color:"primary",disabled:this.isSwitchingChannel,onClick:()=>this.verifyDeleteOtp()},this.capitalizeText(this.deleteConfirmOtp)),t("salla-button",{width:"wide",fill:"outline",color:"primary",disabled:this.isVerifyingOtp,onClick:()=>this.switchOtpChannel()},this.capitalizeText("email"===this.otpType?this.sendViaPhone:this.sendViaEmail))),t("p",{class:"s-user-settings-delete-otp-resend",style:{display:this.showResendLink?"none":"block"}},this.resendAfterLabel,t("b",{class:"s-user-settings-delete-otp-timer mx-1 font-bold",ref:e=>this.timerEl=e})),t("a",{href:"#",class:"s-user-settings-delete-otp-resend-link",style:{display:this.showResendLink?"block":"none"},onClick:e=>{e.preventDefault(),this.resendOtp()}},this.resendLabel))}renderSuccessStep(){return t("div",{class:"s-user-settings-delete-body"},t("p",{class:"s-user-settings-delete-success-body"},this.deleteSuccessMessage),t("div",{class:"s-user-settings-delete-actions s-user-settings-delete-actions--stack"},t("salla-button",{class:"s-user-settings-delete-success-btn",width:"wide",color:"primary",onClick:()=>this.confirmSuccess()},this.capitalizeText(this.okLabel))))}renderDeleteStep(){switch(this.currentStep){case"otp":return this.renderOtpStep();case"success":return this.renderSuccessStep();default:return this.renderConfirmStep()}}renderDeleteSectionAction(){return this.isDeletePending?t("salla-button",{fill:"outline",color:"danger",shape:"btn",size:"medium",width:"normal",loading:this.isSubmitting,onClick:()=>this.cancelDeleteRequest()},this.capitalizeText(this.cancelDeletionRequest)):t("salla-button",{fill:"outline",color:"danger",shape:"btn",size:"medium",width:"normal",onClick:()=>this.openDeleteModal()},this.capitalizeText(this.deleteAccount))}render(){return t(s,{key:"235e0a344565e48724ade2bae57ba084273f120c",class:"s-user-settings-wrapper"},this.canHideName&&t("div",{key:"16fa72a01cdf69c82f1389164dd64ef814b7212f",class:"s-user-settings-section"},t("salla-list-tile",{key:"b753024966a6df5f4b27e9cbb70591055f7fcead"},t("div",{key:"1af0bf18b22d5df386d88eea7249f92e5edadfdf",slot:"icon",class:"s-user-settings-section-icon"},t("span",{key:"29eab8ad46744c402bc9c97b5a1f2864c242ae44",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>user-cancel</title>\n<path d="M29.885 16l1.724-1.724c0.521-0.521 0.521-1.364 0-1.885s-1.364-0.521-1.885 0l-1.724 1.724-1.724-1.724c-0.521-0.521-1.364-0.521-1.885 0s-0.521 1.364 0 1.885l1.724 1.724-1.724 1.724c-0.521 0.521-0.521 1.364 0 1.885 0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391l1.724-1.724 1.724 1.724c0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391c0.521-0.521 0.521-1.364 0-1.885zM10.667 16c4.043 0 7.333-3.289 7.333-7.333s-3.291-7.333-7.333-7.333-7.333 3.289-7.333 7.333 3.291 7.333 7.333 7.333zM10.667 4c2.573 0 4.667 2.093 4.667 4.667s-2.093 4.667-4.667 4.667-4.667-2.093-4.667-4.667 2.093-4.667 4.667-4.667zM10.667 18.667c-5.881 0-10.667 3.813-10.667 8.5v2.167c0 0.736 0.596 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-2.167c0-3.217 3.588-5.833 8-5.833s8 2.616 8 5.833v2.167c0 0.736 0.596 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-2.167c0-4.687-4.785-8.5-10.667-8.5z"></path>\n</svg>\n'})),t("div",{key:"3978c127bc9195f1384c4867d1820b2868c7e1ed",slot:"title",class:"s-user-settings-section-title"},this.capitalizeText(this.hideMyName)),t("div",{key:"a8cddacc12bb9ec6c078c664dc4de44b1cf071af",slot:"subtitle",class:"s-user-settings-section-subtitle"},this.capitalizeText(this.hideMyNameDesc)),t("div",{key:"58ced777acef0cea96d9d2c921ca15aae50d5407",slot:"action",class:"s-user-settings-section-action"},t("label",{key:"17827e38c54b85f0cdd143b13e20149224959447",class:"s-toggle"},t("input",{key:"227128054c57e7b7efb66f9ddf6773f3bdace0ae",class:"s-toggle-input",checked:this.isHiddenName,onChange:e=>this.toggleSetting("is_hidden_name",e),type:"checkbox"}),t("div",{key:"9c14439a42c1548ca7fd4c3bed9df5e19667e286",class:"s-toggle-switcher"}))))),t("div",{key:"1c5784612dff9eb994852379b104d52f9293b4a4",class:"s-user-settings-section"},t("salla-list-tile",{key:"f55f9302936d52c19ae0732f535b27347487abf7"},t("div",{key:"c27db366d4529650203b90d7992fd3866d396a4a",slot:"icon",class:"s-user-settings-section-icon"},t("span",{key:"7d523f03f771d0a7e6fe32ef8879e7e6c27702ec",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>bullhorn</title>\n<path d="M30.129 0.264c-0.339-0.252-0.776-0.328-1.179-0.208l-24.951 7.485v-0.216c0-0.736-0.597-1.333-1.333-1.333s-1.333 0.597-1.333 1.333v14.667c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-0.112l3.448 1.207-0.595 1.704c-0.321 1.019-0.227 2.103 0.267 3.051s1.327 1.647 2.345 1.968l6.359 2.004c0.399 0.127 0.804 0.187 1.201 0.187 1.699 0 3.277-1.091 3.812-2.785l0.423-1.295 7.633 2.672c0.143 0.049 0.292 0.075 0.44 0.075 0.273 0 0.543-0.084 0.772-0.247 0.352-0.249 0.561-0.655 0.561-1.087v-28c0-0.421-0.199-0.819-0.537-1.069zM18.297 28.4c-0.221 0.701-0.973 1.089-1.673 0.871l-6.357-2.004c-0.34-0.108-0.617-0.34-0.781-0.656s-0.196-0.676-0.101-0.977l0.581-1.665 8.777 3.072zM28 27.453l-24-8.4v-8.728l24-7.2z"></path>\n</svg>\n'})),t("div",{key:"0a62c6326d28479c6a1d9c15f71e0a70dc2b4b75",slot:"title",class:"s-user-settings-section-title"},this.capitalizeText(this.promotionalMsgs)),t("div",{key:"3bb66045d5fede7f9c366be329c5d0370b662124",slot:"subtitle",class:"s-user-settings-section-subtitle"},this.capitalizeText(this.promotionalMsgsDesc)),t("div",{key:"31dab543f6bc02e5f111169e2d2cec5cbc2ba6a6",slot:"action",class:"s-user-settings-section-action"},t("label",{key:"cacfe5a74684feab1f73a9cc31c805e123816a23",class:"s-toggle"},t("input",{key:"bc1939012a98db1f038aab5920aaca174f02a2c0",class:"s-toggle-input",checked:this.isNotifiable,onChange:e=>this.toggleSetting("is_notifiable",e),type:"checkbox"}),t("div",{key:"bce649ee7e21658be48d9a8bf8c5331298bf0717",class:"s-toggle-switcher"}))))),this.isDeleteAccountEnabled?t("div",{class:"s-user-settings-section s-user-settings-section-delete-user"},t("salla-list-tile",null,t("div",{slot:"icon",class:"s-user-settings-section-icon"},this.renderUserDeleteIcon()),t("div",{slot:"title",class:"s-user-settings-section-title"},this.capitalizeText(this.deleteAccount)),t("div",{slot:"subtitle",class:"s-user-settings-section-subtitle"},this.capitalizeText(this.isDeletePending?this.deleteAccountPending:this.deleteAccountDesc)),t("div",{slot:"action",class:"s-user-settings-section-action"},this.renderDeleteSectionAction()))):t("div",{class:"s-user-settings-section s-user-settings-section-deactivate-user"},t("salla-list-tile",null,t("div",{slot:"icon",class:"s-user-settings-section-icon"},t("span",{innerHTML:i})),t("div",{slot:"title",class:"s-user-settings-section-title"},this.capitalizeText(this.deactivateAccount)),t("div",{slot:"subtitle",class:"s-user-settings-section-subtitle"},this.capitalizeText(this.deactivateDesc)),t("div",{slot:"action",class:"s-user-settings-section-action"},t("salla-button",{fill:"outline",color:"danger",shape:"btn",size:"medium",width:"normal",onClick:()=>this.openDeactivateModal()},this.capitalizeText(this.deactivateAccount))))),this.isDeleteAccountEnabled?t("salla-modal",{id:"salla-user-settings-delete-modal",width:"xs",centered:!0,showBack:"otp"===this.currentStep,isClosable:"success"!==this.currentStep,iconStyle:"success"===this.currentStep?"success":void 0,onModalVisibilityChanged:e=>this.handleModalVisibilityChanged(e),onModalBack:()=>this.goBackFromOtp(),ref:e=>this.confirmationModal=e},"success"!==this.currentStep?t("span",{slot:"icon",class:"s-user-settings-delete-icon"},this.renderUserDeleteIcon()):null,t("div",{key:this.currentStep,class:"s-user-settings-delete-step"},this.renderDeleteStep())):t("salla-modal",{width:"sm",subTitle:this.capitalizeText(this.sorryForLeavingText),ref:e=>this.confirmationModal=e},t("span",{slot:"icon",class:"s-user-settings-confirmation-icon",innerHTML:i}),t("div",{class:"s-user-settings-confirmation"},t("div",{class:"s-user-settings-confirmation-warning"},this.capitalizeText(this.warningText)),t("div",{class:"s-user-settings-confirmation-actions"},t("salla-button",{width:"wide",onClick:()=>this.confirmationModal.close()},this.capitalizeText(this.keepAccount)),t("salla-button",{fill:"outline",loading:this.buttonLoading,width:"wide",onClick:()=>this.confirmDeactivateAccount()},this.capitalizeText(this.deactivateAccount))))))}};r.style='/*!twlt*/.s-modal-header-inner{display:flex;flex-direction:column !important;align-items:center !important;justify-content:center !important}.s-modal-header-content{text-align:center !important}.s-user-settings-delete-body{text-align:center}.s-user-settings-delete-icon{display:inline-flex;align-items:center;justify-content:center;width:4rem;height:4rem;border-radius:9999px;border:1px solid var(--infinte-color);color:var(--infinte-color);margin:0 auto 1rem}.s-user-settings-delete-icon svg{width:1.5rem;height:1.5rem}.s-user-settings-delete-warning{color:#6b7280;font-size:0.875rem;line-height:1.625;margin-bottom:1.25rem}.s-user-settings-delete-actions--row{display:flex;gap:0.75rem;justify-content:center}.s-user-settings-delete-actions--row salla-button{flex:1}.s-user-settings-delete-actions--stack{display:flex;flex-direction:column;gap:0.75rem;margin-top:1.25rem}.s-user-settings-delete-otp-instruction{color:#6b7280;font-size:0.875rem}.s-user-settings-delete-otp-target{color:#6b7280;direction:ltr;margin-bottom:1.25rem}.s-user-settings-delete-otp-codes{display:flex;justify-content:stretch;gap:0.75rem;direction:ltr;margin-bottom:0.75rem;width:100%}.s-user-settings-delete-otp-codes.has-error{margin-bottom:0}.s-user-settings-delete-otp-input{flex:1 1 0;min-width:0;width:100%;height:3.5rem;text-align:center;border:1px solid #d1d5db;border-radius:0.5rem;font-size:1.25rem;font-weight:600;color:#111827;outline:none}.s-user-settings-delete-otp-input:focus{border-color:#004956;box-shadow:0 0 0 1px #004956}.s-user-settings-delete-otp-input.s-has-error{border-color:#ef4444 !important}.s-user-settings-delete-otp-input.s-has-error:focus{border-color:#ef4444 !important;box-shadow:0 0 0 1px #ef4444}.s-user-settings-delete-otp-input::-webkit-outer-spin-button,.s-user-settings-delete-otp-input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.s-user-settings-delete-otp-input[type=text]{-moz-appearance:textfield}.s-user-settings-delete-otp-error{display:block;color:#ef4444;font-size:0.75rem;text-align:center;padding-top:0.75rem;margin-bottom:1.25rem}.s-user-settings-delete-otp-resend{color:#6b7280;font-size:0.75rem;margin-top:1rem;text-align:center}.s-user-settings-delete-otp-timer{font-weight:600;direction:ltr;display:inline-block}.s-user-settings-delete-otp-resend-link{display:block;color:#004956;font-size:0.875rem;margin-top:1rem;text-align:center;text-decoration:underline;cursor:pointer}.s-user-settings-delete-success-body{color:#6b7280;font-size:0.875rem;line-height:1.625;margin-bottom:1.25rem}.s-user-settings-delete-success-btn{--s-button-color:#004956}.mx-1{margin-left:0.25rem;margin-right:0.25rem}.block{display:block}.hidden{display:none}.font-bold{font-weight:700}.outline{outline-style:solid}.s-has-error{--tw-border-opacity:1;border-color:rgb(248 113 113 / var(--tw-border-opacity, 1))}.s-has-error:focus{--tw-border-opacity:1;border-color:rgb(239 68 68 / var(--tw-border-opacity, 1))}.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}.has-error .s-form-label{color:#ff443a}.has-error .s-form-control,.has-error .s-tel-input-control,.has-error .s-datetime-picker-input{border-color:#ff443a;color:#ff443a}.toggle-checkbox .s-toggle-input{position:absolute;visibility:hidden}.toggle-checkbox .s-toggle-switcher{display:inline-block;background:#ccc;border-radius:16px;width:40px;height:25px;position:relative;vertical-align:middle;transition:background 0.25s}.toggle-checkbox .s-toggle-switcher:before,.toggle-checkbox .s-toggle-switcher:after{content:""}.toggle-checkbox .s-toggle-switcher:before{display:block;background:#fff;border-radius:50%;box-shadow:0 0 0 1px rgba(0,0,0,0.25);width:20px;height:21px;position:absolute;top:2.2px;left:1px;transition:left 0.25s}.toggle-checkbox .s-toggle-input:checked+div{background:#30D158}.toggle-checkbox .s-toggle-input:checked+div:before{left:18px}.s-has-error{--tw-border-opacity:1 !important;border-color:rgb(239 68 68 / var(--tw-border-opacity, 1)) !important;--tw-text-opacity:1 !important;color:rgb(239 68 68 / var(--tw-text-opacity, 1)) !important}.s-toggle{cursor:pointer;display:inline-block}.s-toggle .s-toggle-input{position:absolute;visibility:hidden}.s-toggle .s-toggle-label{margin-left:5px;position:relative;top:2px}.s-toggle .s-toggle-switcher{display:inline-block;background:#ccc;border-radius:16px;width:40px;height:25px;position:relative;vertical-align:middle;transition:background 0.25s}.s-toggle .s-toggle-switcher:before,.s-toggle .s-toggle-switcher:after{content:""}.s-toggle .s-toggle-switcher:before{display:block;background:#fff;border-radius:50%;box-shadow:0 0 0 1px rgba(0,0,0,0.25);width:20px;height:21px;position:absolute;top:2.2px;left:1px;transition:left 0.25s}.s-toggle .s-toggle-input:checked+div{background:#30D158}.s-toggle .s-toggle-input:checked+div:before{left:18px}.s-user-settings-section{border-bottom-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.s-user-settings-section:first-child{border-bottom-right-radius:0px;border-bottom-left-radius:0px;border-top-left-radius:0.375rem;border-top-right-radius:0.375rem}.s-user-settings-section:last-child{border-bottom-right-radius:0.375rem;border-bottom-left-radius:0.375rem;border-top-left-radius:0px;border-top-right-radius:0px;border-bottom-width:0px}.s-user-settings-section .s-list-tile-item{align-items:flex-start;background-color:transparent;padding:1.25rem}@media (min-width: 768px){.s-user-settings-section .s-list-tile-item{align-items:center}}.s-user-settings-section .s-list-tile-item-action{margin-left:auto}.s-user-settings-section .s-list-tile-item-action:where([dir="rtl"],[dir="rtl"] *){margin-right:auto;margin-left:0px}.s-user-settings-section .s-list-tile-item-action button{width:100%;padding:10px}.s-user-settings-section-delete-user .s-list-tile-item{flex-wrap:wrap}@media (min-width: 768px){.s-user-settings-section-delete-user .s-list-tile-item{flex-wrap:nowrap}}.s-user-settings-section-delete-user .s-list-tile-item-icon{position:relative;top:5px}@media (min-width: 768px){.s-user-settings-section-delete-user .s-list-tile-item-icon{top:0px}}@media (max-width: 768px){.s-user-settings-section-delete-user .s-list-tile-item-content{flex:1 0 85%}.s-user-settings-section-delete-user .s-list-tile-item-action{flex:1 1 100%;margin-top:1rem}}.s-user-settings-section-title{font-size:1rem;line-height:1.5rem;--tw-text-opacity:1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.s-user-settings-section-subtitle{font-size:0.75rem;line-height:1rem;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-user-settings-section-icon svg{height:1.25rem;width:1.25rem}.s-user-settings-confirmation{text-align:center}.s-user-settings-confirmation svg{text-align:center}.s-user-settings-confirmation-icon{display:inline-flex;height:3rem;width:3rem;align-items:center;justify-content:center;border-radius:9999px;border-width:1px;border-style:solid;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}@media (min-width: 640px){.s-user-settings-confirmation-icon{margin-left:auto;margin-right:auto;margin-bottom:1rem;height:5rem;width:5rem}}.s-user-settings-confirmation-icon:where([dir="ltr"],[dir="ltr"] *){margin-right:0.5rem}@media (min-width: 640px){.s-user-settings-confirmation-icon:where([dir="ltr"],[dir="ltr"] *){margin-right:0px}}.s-user-settings-confirmation-icon:where([dir="rtl"],[dir="rtl"] *){margin-left:0.5rem}@media (min-width: 640px){.s-user-settings-confirmation-icon:where([dir="rtl"],[dir="rtl"] *){margin-left:0px}}.s-user-settings-confirmation-icon svg{height:1.25rem;width:1.25rem;flex-shrink:0;fill:#9ca3af}.s-user-settings-confirmation-warning{font-size:0.75rem;line-height:1rem;--tw-text-opacity:1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.s-user-settings-confirmation-actions{margin-top:1.25rem;display:flex;align-items:center;justify-content:space-between}.s-user-settings-confirmation-actions>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(1.25rem * var(--tw-space-x-reverse));margin-left:calc(1.25rem * calc(1 - var(--tw-space-x-reverse)))}.s-user-settings-confirmation-actions:where([dir="rtl"],[dir="rtl"] *)>:not([hidden])~:not([hidden]){--tw-space-x-reverse:1}';export{r as salla_user_settings}
4
+ import{r as e,h as t,H as s}from"./p-CrXKQnBu.js";var i='\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>user-off</title>\n<path d="M10.837 19.309c-4.963 1.284-8.171 4.303-8.171 7.691v3.667c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-3.667c0-2.101 2.48-4.155 6.172-5.109 0.713-0.184 1.141-0.912 0.957-1.625-0.184-0.711-0.908-1.137-1.625-0.956zM12.859 3.715c0.933-0.685 2.020-1.048 3.141-1.048 2.941 0 5.333 2.392 5.333 5.333 0 1.121-0.363 2.208-1.048 3.141-0.436 0.593-0.308 1.428 0.284 1.864 0.239 0.175 0.515 0.259 0.788 0.259 0.411 0 0.815-0.188 1.076-0.544 1.025-1.393 1.567-3.025 1.567-4.72 0-4.412-3.588-8-8-8-1.695 0-3.327 0.541-4.721 1.567-0.592 0.435-0.72 1.269-0.284 1.864 0.436 0.593 1.269 0.721 1.864 0.284zM31.609 29.724l-29.333-29.333c-0.521-0.521-1.364-0.521-1.885 0s-0.521 1.364 0 1.885l29.333 29.333c0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391c0.521-0.521 0.521-1.364 0-1.885z"></path>\n</svg>\n';const r=class{constructor(t){e(this,t),this.otpInputs=[],this.isDeleteAccountEnabled=!!salla.config.get("store.features",[])?.includes("customer-account-deletion"),this.deactivateAccount=salla.lang.get("pages.profile.deactivate_account"),this.deactivateDesc=salla.lang.get("pages.profile.deactivate_account_description"),this.sorryForLeavingText=salla.lang.get("pages.profile.warning_for_deactivate"),this.warningText=salla.lang.get("pages.profile.sorry_for_leaving"),this.keepAccount=salla.lang.get("pages.profile.keep_account"),this.buttonLoading=!1,this.deletePendingDays=null,this.currentStep="confirm",this.isDeletePending=!1,this.otpType="email",this.otpHasError=!1,this.otpErrorMessage="",this.isSubmitting=!1,this.isVerifyingOtp=!1,this.isSwitchingChannel=!1,this.resendAfter=30,this.showResendLink=!1,this.canHideName=salla.config.get("store.settings.rating.can_customer_hide_name"),this.translationDefaults={"pages.profile.delete_account":{ar:"حذف الحساب",en:"Delete account"},"pages.profile.delete_account_description":{ar:"سيُحذف حسابك وبياناتك من المتجر نهائيًا، بما في ذلك سجل طلباتك.",en:"Your account and data will be permanently deleted from the store, including your order history."},"pages.profile.delete_account_confirm_title":{ar:"هل تريد حذف حسابك؟",en:"Do you want to delete your account?"},"pages.profile.delete_account_warning":{ar:"بعد الحذف، ستفقد الوصول إلى بياناتك، بما في ذلك سجل الطلبات، وقائمة الأمنيات، وأي نقاط ولاء أو رصيد متاح في المحفظة.",en:"After deletion, you will lose access to your data, including order history, wishlist, and any loyalty points or wallet balance."},"pages.profile.cancel":{ar:"إلغاء",en:"Cancel"},"pages.profile.delete_account_otp_title":{ar:"تأكيد حذف الحساب",en:"Confirm account deletion"},"pages.profile.delete_account_otp_instruction":{ar:"للمتابعة، أدخل رمز التحقٌّق المرسل إلى:",en:"To continue, enter the verification code sent to:"},"pages.profile.delete_account_confirm_otp":{ar:"تأكيد الحذف",en:"Confirm deletion"},"pages.profile.delete_account_otp_required":{ar:"يرجى إدخال رمز التحقٌّق",en:"Please enter the verification code"},"pages.profile.delete_account_send_via_phone":{ar:"إرسال عبر الهاتف",en:"Send via phone"},"pages.profile.delete_account_send_via_email":{ar:"إرسال عبر البريد الإلكتروني",en:"Send via email"},"pages.profile.delete_account_success_title":{ar:"أُرسل طلب حذف الحساب",en:"Account deletion request submitted"},"pages.profile.delete_account_success_message":{ar:"سيُحذف حسابك خلال 30 يومًا. يمكنك إلغاء الطلب بتسجيل الدخول مرة أخرى قبل اكتمال الحذف.",en:"Your account will be deleted within 30 days. You can cancel the request by signing in again before deletion is complete."},"pages.profile.ok":{ar:"موافق",en:"OK"},"pages.profile.cancel_deletion_request":{ar:"تراجع عن الحذف",en:"Withdraw deletion"},"pages.profile.delete_account_pending":{ar:"حسابك مجدول للحذف نهائيًا من المتجر خلال :days يومًا. يمكنك التراجع عن الحذف قبل انقضاء المدة.",en:"Your account will be deleted permanently from the store within :days days. You can withdraw the deletion before the deadline."},"pages.profile.delete_request_cancelled":{ar:"تم إلغاء طلب الحذف",en:"Deletion request cancelled"}},this.needsProfileListener=!1,this.profileListenerBound=!1,this.profileInfoFetchedListener=e=>{this.isHiddenName=this.readHiddenName(e.data.preferences,e.data.is_hidden_name),this.isNotifiable=e.data.preferences?.notifications_enabled??e.data.is_notifiable},this.isConnectedToDom=!1,this.registerTranslationDefaults(),this.loadTranslations(),salla.onReady((()=>{const e=salla.config.get("user.preferences");this.isHiddenName=this.readHiddenName(e,salla.config.get("user.is_hidden_name")),this.isNotifiable=e?.notifications_enabled??salla.config.get("user.is_notifiable"),this.canHideName=salla.config.get("store.settings.rating.can_customer_hide_name"),this.isDeleteAccountEnabled&&this.fetchDeleteRequestStatus(),this.needsProfileListener=!this.isNotifiable||!this.isHiddenName,this.bindProfileListener()}))}readHiddenName(e,t){return void 0!==e?.name_visible?!e.name_visible:t}bindProfileListener(){this.needsProfileListener&&!this.profileListenerBound&&this.isConnectedToDom&&(this.profileListenerBound=!0,salla.event.on("profile::info.fetched",this.profileInfoFetchedListener))}connectedCallback(){this.isConnectedToDom=!0,this.bindProfileListener(),this.langUnsubscribe=salla.lang.subscribe((()=>{this.registerTranslationDefaults(),this.loadTranslations()}))}disconnectedCallback(){this.isConnectedToDom=!1,this.profileListenerBound&&(salla.event.off("profile::info.fetched",this.profileInfoFetchedListener),this.profileListenerBound=!1),this.langUnsubscribe?.()}getDaysUntilExecution(e){return Math.max(0,Math.ceil(((e>1e12?e:1e3*e)-Date.now())/864e5))}applyPendingMessage(){const e=salla.lang.get("pages.profile.delete_account_pending");this.deleteAccountPending=null!=this.deletePendingDays?e.replace(/:days/g,String(salla.helpers.number(this.deletePendingDays))):e}async fetchDeleteRequestStatus(){try{const e=await salla.profile.getDeleteRequest(),t=e?.data??null,s=t?.data_request||t,i=s?.status;this.isDeletePending="pending"===i;const r=s?.execution_at;this.deletePendingDays=null==r||Number.isNaN(Number(r))?null:this.getDaysUntilExecution(Number(r)),this.applyPendingMessage()}catch{}}registerTranslationDefaults(){if(!salla?.lang?.addBulk)return;const e=Object.entries(this.translationDefaults).reduce(((e,[t,s])=>(salla.lang.get(t)===t&&(e[t]=s),e)),{});Object.keys(e).length&&salla.lang.addBulk(e)}loadTranslations(){this.deactivateAccount=salla.lang.get("pages.profile.deactivate_account"),this.deactivateDesc=salla.lang.get("pages.profile.deactivate_account_description"),this.sorryForLeavingText=salla.lang.get("pages.profile.warning_for_deactivate"),this.warningText=salla.lang.get("pages.profile.sorry_for_leaving"),this.keepAccount=salla.lang.get("pages.profile.keep_account"),this.deleteAccount=salla.lang.get("pages.profile.delete_account"),this.deleteAccountDesc=salla.lang.get("pages.profile.delete_account_description"),this.deleteConfirmTitle=salla.lang.get("pages.profile.delete_account_confirm_title"),this.deleteAccountWarning=salla.lang.get("pages.profile.delete_account_warning"),this.cancelLabel=salla.lang.get("pages.profile.cancel"),this.deleteOtpTitle=salla.lang.get("pages.profile.delete_account_otp_title"),this.deleteOtpInstruction=salla.lang.get("pages.profile.delete_account_otp_instruction"),this.deleteConfirmOtp=salla.lang.get("pages.profile.delete_account_confirm_otp"),this.sendViaPhone=salla.lang.get("pages.profile.delete_account_send_via_phone"),this.sendViaEmail=salla.lang.get("pages.profile.delete_account_send_via_email"),this.deleteSuccessTitle=salla.lang.get("pages.profile.delete_account_success_title"),this.deleteSuccessMessage=salla.lang.get("pages.profile.delete_account_success_message"),this.okLabel=salla.lang.get("pages.profile.ok"),this.cancelDeletionRequest=salla.lang.get("pages.profile.cancel_deletion_request"),this.applyPendingMessage(),this.resendAfterLabel=salla.lang.get("blocks.header.resend_after"),this.resendLabel=salla.lang.get("blocks.comments.submit"),this.promotionalMsgs=salla.lang.get("pages.profile.promotional_messages"),this.hideMyName=salla.lang.get("pages.profile.hide_my_name"),this.hideMyNameDesc=salla.lang.get("pages.profile.hide_my_name_desc"),this.promotionalMsgsDesc=salla.lang.get("pages.profile.promotional_messages_description")}toggleSetting(e,t){salla.profile.updateSettings({name:e,value:t.target.checked})}capitalizeText(e){return e?e.charAt(0).toUpperCase()+e.slice(1):""}getOtpTarget(){return"email"===this.otpType?salla.config.get("user.email")||"":salla.config.get("user.mobile")||""}updateModalForStep(){if(this.confirmationModal)switch(this.currentStep){case"confirm":this.confirmationModal.setTitle(this.capitalizeText(this.deleteConfirmTitle));break;case"otp":this.confirmationModal.setTitle(this.capitalizeText(this.deleteOtpTitle));break;case"success":this.confirmationModal.setTitle(this.capitalizeText(this.deleteSuccessTitle))}}openDeleteModal(){this.currentStep="confirm",this.otpType="email",this.resetOtpInputs(),this.clearResendTimer(),this.updateModalForStep(),this.confirmationModal.open()}openDeactivateModal(){this.confirmationModal.setTitle(this.capitalizeText(this.deactivateAccount)),this.confirmationModal.open()}async confirmDeactivateAccount(){this.buttonLoading=!0,await salla.profile.delete().finally((()=>{this.buttonLoading=!1,this.confirmationModal.close()}))}closeDeleteModal(){this.clearResendTimer(),this.confirmationModal?.close()}goBackFromOtp(){this.clearResendTimer(),this.resetOtpInputs(),this.resetOtpError(),this.currentStep="confirm",this.updateModalForStep()}async handleModalVisibilityChanged(e){if(e.detail)return;this.clearResendTimer();const t="success"===this.currentStep;t&&(this.isDeletePending=!0),this.currentStep="confirm",this.resetOtpInputs(),t&&await this.fetchDeleteRequestStatus()}formatResendTimer(e){return"00 : "+(e>=10?`${e}`:`0${e}`)}updateResendTimerDisplay(){this.timerEl&&(this.timerEl.innerHTML=this.formatResendTimer(this.resendAfter))}isDeleteRequestInFlight(){return this.isSubmitting||this.isSwitchingChannel||this.isVerifyingOtp}async initiateDeleteRequest(e="confirm"){if(!this.isDeleteRequestInFlight()){"switch"===e||"resend"===e?this.isSwitchingChannel=!0:this.isSubmitting=!0;try{await salla.profile.initiateDeleteRequest(this.otpType),this.currentStep="otp",this.updateModalForStep(),this.resetOtpInputs(),this.startResendTimer(),setTimeout((()=>this.otpInputs[0]?.focus()),100)}catch(e){salla.notify?.error?.(e.response?.data?.error?.message||salla.lang.get("common.errors.error_occurred"))}finally{"switch"===e||"resend"===e?this.isSwitchingChannel=!1:this.isSubmitting=!1}}}async switchOtpChannel(){this.isDeleteRequestInFlight()||(this.otpType="email"===this.otpType?"mobile":"email",await this.initiateDeleteRequest("switch"))}async resendOtp(){this.showResendLink&&!this.isDeleteRequestInFlight()&&await this.initiateDeleteRequest("resend")}collectOtpCode(){const e=salla.helpers.number(this.otpInputs.map((e=>e?.value||"")).join(""),!0).replace(/[^0-9]/g,"");return this.hiddenCodeInput&&(this.hiddenCodeInput.value=e),e}resetOtpError(){this.otpHasError=!1,this.otpErrorMessage=""}setOtpError(e){this.otpHasError=!0,this.otpErrorMessage=e}async verifyDeleteOtp(){if(this.isVerifyingOtp||this.isSwitchingChannel)return;const e=this.collectOtpCode();if(e.length<4)return this.setOtpError(salla.lang.get("pages.profile.delete_account_otp_required")),void this.otpInputs[e.length]?.focus();this.resetOtpError(),this.isVerifyingOtp=!0;try{const t=await salla.profile.verifyDeleteRequest({type:this.otpType,code:e});this.deleteSuccessMessage=t?.data?.message||salla.lang.get("pages.profile.delete_account_success_message"),this.clearResendTimer(),this.resetOtpInputs(),this.otpInputs=[],this.currentStep="success",this.updateModalForStep()}catch(e){this.setOtpError(e.response?.data?.error?.message||salla.lang.get("common.errors.error_occurred")),this.resetOtpInputs()}finally{this.isVerifyingOtp=!1}}async confirmSuccess(){this.isDeletePending=!0,this.closeDeleteModal(),this.currentStep="confirm",await this.fetchDeleteRequestStatus()}async cancelDeleteRequest(){if(!this.isSubmitting){this.isSubmitting=!0;try{const e=(await salla.profile.cancelDeleteRequest()).message||salla.lang.get("pages.profile.delete_request_cancelled");this.isDeletePending=!1,salla.notify?.success?.(e)}catch(e){salla.notify?.error?.(e.response?.data?.error?.message||salla.lang.get("common.errors.error_occurred"))}finally{this.isSubmitting=!1}}}resetOtpInputs(){this.otpInputs.forEach((e=>{e&&(e.value="")})),this.hiddenCodeInput&&(this.hiddenCodeInput.value="")}modifyNextOtpInput(e,t){e.value=t[0],t=t.substring(1),e.nextElementSibling&&t.length?this.modifyNextOtpInput(e.nextElementSibling,t):e.nextElementSibling||0!==t.length?e.nextElementSibling&&0===t.length&&e.nextElementSibling.focus():e.focus()}splitOtpNumber(e){const t=salla.helpers.number(e.data||e.target.value||"",!0).replace(/[^0-9]/g,"");t&&1!==t.length&&this.modifyNextOtpInput(e.target,t)}allOtpInputsFilled(){return this.otpInputs.every((e=>e?.value))}handleOtpInput(e){this.resetOtpError(),e.target.value=salla.helpers.number(e.target.value||"",!0),salla.helpers.inputDigitsOnly(e.target),this.allOtpInputsFilled()&&setTimeout((()=>this.verifyDeleteOtp()),100)}handleOtpKeyUp(e){if(this.resetOtpError(),["Alt","Shift","Control","AltGraph","Ctrl"].includes(e.key))return;const t=e.keyCode||e.charCode;e.target.value?(e.target.nextElementSibling?.focus(),e.target.nextElementSibling?.select()):[8,46].includes(t)&&(e.target.previousElementSibling?.focus(),e.target.previousElementSibling?.select()),e.target.value.length>1&&this.splitOtpNumber(e)}handleOtpPaste(e){this.resetOtpError();const t=salla.helpers.number(e.clipboardData.getData("text")||"",!0).replace(/[^0-9]/g,"").substring(0,this.otpInputs.length);this.otpInputs.forEach((e=>e.value="")),this.otpInputs[0]&&this.modifyNextOtpInput(this.otpInputs[0],t)}handleOtpFocus(e){e.target!==this.otpInputs[0]&&(""===this.otpInputs[0]?.value&&this.otpInputs[0].focus(),""===e.target.previousElementSibling?.value&&e.target.previousElementSibling.focus())}startResendTimer(){this.clearResendTimer(),this.resendAfter=30,this.showResendLink=!1,this.updateResendTimerDisplay(),this.resendTimerId=setInterval((()=>{if(this.resendAfter--,this.resendAfter<=0)return this.clearResendTimer(),void(this.showResendLink=!0);this.updateResendTimerDisplay()}),1e3)}clearResendTimer(){this.resendTimerId&&(clearInterval(this.resendTimerId),this.resendTimerId=null),this.showResendLink=!1}renderUserDeleteIcon(){return t("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24",color:"currentColor",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},t("path",{d:"M14.5 8C14.5 5.23858 12.2614 3 9.5 3C6.73858 3 4.5 5.23858 4.5 8C4.5 10.7614 6.73858 13 9.5 13C12.2614 13 14.5 10.7614 14.5 8Z"}),t("path",{d:"M15.5 21L18.5 18M18.5 18L21.5 15M18.5 18L15.5 15M18.5 18L21.5 21"}),t("path",{d:"M2.5 20C2.5 16.134 5.63401 13 9.5 13C10.775 13 11.9704 13.3409 13 13.9365"}))}renderConfirmStep(){return t("div",{class:"s-user-settings-delete-body"},t("p",{class:"s-user-settings-delete-warning"},this.deleteAccountWarning),t("div",{class:"s-user-settings-delete-actions s-user-settings-delete-actions--row"},t("salla-button",{width:"wide",fill:"outline",color:"danger",onClick:()=>this.closeDeleteModal()},this.capitalizeText(this.cancelLabel)),t("salla-button",{width:"wide",color:"primary",loading:this.isSubmitting,onClick:()=>this.initiateDeleteRequest()},this.capitalizeText(this.deleteAccount))))}renderOtpStep(){return t("div",{class:"s-user-settings-delete-body"},t("p",{class:"s-user-settings-delete-otp-instruction"},this.deleteOtpInstruction),t("p",{class:"s-user-settings-delete-otp-target"},this.getOtpTarget()),t("input",{type:"hidden",name:"code",maxlength:"4",ref:e=>this.hiddenCodeInput=e}),t("div",{class:{"s-user-settings-delete-otp-codes":!0,"has-error":this.otpHasError},dir:"ltr"},[1,2,3,4].map((e=>t("input",{type:"text",autocomplete:"one-time-code",pattern:"[0-9]*",inputmode:"numeric",maxlength:"1",id:`delete-otp-${e}`,class:{"s-user-settings-delete-otp-input":!0,"s-has-error":this.otpHasError},onInput:e=>this.handleOtpInput(e),onPaste:e=>this.handleOtpPaste(e),onKeyUp:e=>this.handleOtpKeyUp(e),onFocus:e=>this.handleOtpFocus(e),ref:t=>this.otpInputs[e-1]=t,required:!0})))),this.otpHasError&&this.otpErrorMessage?t("span",{class:"s-user-settings-delete-otp-error"},this.otpErrorMessage):"",t("div",{class:"s-user-settings-delete-actions s-user-settings-delete-actions--stack"},t("salla-button",{width:"wide",color:"primary",disabled:this.isSwitchingChannel,onClick:()=>this.verifyDeleteOtp()},this.capitalizeText(this.deleteConfirmOtp)),t("salla-button",{width:"wide",fill:"outline",color:"primary",disabled:this.isVerifyingOtp,onClick:()=>this.switchOtpChannel()},this.capitalizeText("email"===this.otpType?this.sendViaPhone:this.sendViaEmail))),t("p",{class:"s-user-settings-delete-otp-resend",style:{display:this.showResendLink?"none":"block"}},this.resendAfterLabel,t("b",{class:"s-user-settings-delete-otp-timer mx-1 font-bold",ref:e=>this.timerEl=e})),t("a",{href:"#",class:"s-user-settings-delete-otp-resend-link",style:{display:this.showResendLink?"block":"none"},onClick:e=>{e.preventDefault(),this.resendOtp()}},this.resendLabel))}renderSuccessStep(){return t("div",{class:"s-user-settings-delete-body"},t("p",{class:"s-user-settings-delete-success-body"},this.deleteSuccessMessage),t("div",{class:"s-user-settings-delete-actions s-user-settings-delete-actions--stack"},t("salla-button",{class:"s-user-settings-delete-success-btn",width:"wide",color:"primary",onClick:()=>this.confirmSuccess()},this.capitalizeText(this.okLabel))))}renderDeleteStep(){switch(this.currentStep){case"otp":return this.renderOtpStep();case"success":return this.renderSuccessStep();default:return this.renderConfirmStep()}}renderDeleteSectionAction(){return this.isDeletePending?t("salla-button",{fill:"outline",color:"danger",shape:"btn",size:"medium",width:"normal",loading:this.isSubmitting,onClick:()=>this.cancelDeleteRequest()},this.capitalizeText(this.cancelDeletionRequest)):t("salla-button",{fill:"outline",color:"danger",shape:"btn",size:"medium",width:"normal",onClick:()=>this.openDeleteModal()},this.capitalizeText(this.deleteAccount))}render(){return t(s,{key:"a5329b99eb9ae0d351d3732a8bd73cb5a0e3bf0e",class:"s-user-settings-wrapper"},this.canHideName&&t("div",{key:"fa451ecdfcc4797eb5a844a6b6ba57456887bc65",class:"s-user-settings-section"},t("salla-list-tile",{key:"efe0e7fbf16ce4c23f9fefd7d96e77b86c17407d"},t("div",{key:"6749a02ca8b2fe06bf604aa7e6343c2f6a933db9",slot:"icon",class:"s-user-settings-section-icon"},t("span",{key:"3fac5e8f843a6d7a82355e742801701daa839b37",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>user-cancel</title>\n<path d="M29.885 16l1.724-1.724c0.521-0.521 0.521-1.364 0-1.885s-1.364-0.521-1.885 0l-1.724 1.724-1.724-1.724c-0.521-0.521-1.364-0.521-1.885 0s-0.521 1.364 0 1.885l1.724 1.724-1.724 1.724c-0.521 0.521-0.521 1.364 0 1.885 0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391l1.724-1.724 1.724 1.724c0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391c0.521-0.521 0.521-1.364 0-1.885zM10.667 16c4.043 0 7.333-3.289 7.333-7.333s-3.291-7.333-7.333-7.333-7.333 3.289-7.333 7.333 3.291 7.333 7.333 7.333zM10.667 4c2.573 0 4.667 2.093 4.667 4.667s-2.093 4.667-4.667 4.667-4.667-2.093-4.667-4.667 2.093-4.667 4.667-4.667zM10.667 18.667c-5.881 0-10.667 3.813-10.667 8.5v2.167c0 0.736 0.596 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-2.167c0-3.217 3.588-5.833 8-5.833s8 2.616 8 5.833v2.167c0 0.736 0.596 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-2.167c0-4.687-4.785-8.5-10.667-8.5z"></path>\n</svg>\n'})),t("div",{key:"9902df824f1c959e5e78448019bb0019139181e3",slot:"title",class:"s-user-settings-section-title"},this.capitalizeText(this.hideMyName)),t("div",{key:"a2d6b461b818fb5c88831fc3515c62fbb27a3604",slot:"subtitle",class:"s-user-settings-section-subtitle"},this.capitalizeText(this.hideMyNameDesc)),t("div",{key:"14dfc10aeb8f3ae132bd6a884f6f0909b3ee0071",slot:"action",class:"s-user-settings-section-action"},t("label",{key:"d224bf45f7b946f37460478e49019d38fbe5f4f9",class:"s-toggle"},t("input",{key:"f6b97efb600c39f0e66eaac8538a7e076cba851e",class:"s-toggle-input",checked:this.isHiddenName,onChange:e=>this.toggleSetting("is_hidden_name",e),type:"checkbox"}),t("div",{key:"e6c00fa21b86e168a4a6c236cc20035ca3310c7e",class:"s-toggle-switcher"}))))),t("div",{key:"5452089f49aa35bdf5ee2f8cd39dbfc7bf5b83d3",class:"s-user-settings-section"},t("salla-list-tile",{key:"95a23fe5cbb2e5481137bdad8a424430922110af"},t("div",{key:"ae6f7395a3beb1a46339acb225fbf8ae86086f1a",slot:"icon",class:"s-user-settings-section-icon"},t("span",{key:"4f09f13877d1c9c405163bc7035196ce4e7ab574",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>bullhorn</title>\n<path d="M30.129 0.264c-0.339-0.252-0.776-0.328-1.179-0.208l-24.951 7.485v-0.216c0-0.736-0.597-1.333-1.333-1.333s-1.333 0.597-1.333 1.333v14.667c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-0.112l3.448 1.207-0.595 1.704c-0.321 1.019-0.227 2.103 0.267 3.051s1.327 1.647 2.345 1.968l6.359 2.004c0.399 0.127 0.804 0.187 1.201 0.187 1.699 0 3.277-1.091 3.812-2.785l0.423-1.295 7.633 2.672c0.143 0.049 0.292 0.075 0.44 0.075 0.273 0 0.543-0.084 0.772-0.247 0.352-0.249 0.561-0.655 0.561-1.087v-28c0-0.421-0.199-0.819-0.537-1.069zM18.297 28.4c-0.221 0.701-0.973 1.089-1.673 0.871l-6.357-2.004c-0.34-0.108-0.617-0.34-0.781-0.656s-0.196-0.676-0.101-0.977l0.581-1.665 8.777 3.072zM28 27.453l-24-8.4v-8.728l24-7.2z"></path>\n</svg>\n'})),t("div",{key:"77e038e9ede04ebceb33dc5732552bfb872ff07f",slot:"title",class:"s-user-settings-section-title"},this.capitalizeText(this.promotionalMsgs)),t("div",{key:"c1332d656e6c898b09d63b8985ab2b32f92029f1",slot:"subtitle",class:"s-user-settings-section-subtitle"},this.capitalizeText(this.promotionalMsgsDesc)),t("div",{key:"236c6622e61210bdcad47582e4626fbf7a4f77d3",slot:"action",class:"s-user-settings-section-action"},t("label",{key:"be37b0ea5465911064146779025fd5e353a6f556",class:"s-toggle"},t("input",{key:"fea0f0478c959bc94f91bc302618eb2e30047927",class:"s-toggle-input",checked:this.isNotifiable,onChange:e=>this.toggleSetting("is_notifiable",e),type:"checkbox"}),t("div",{key:"1420206f5679e67ce1fd908ae8e9179eaae1dc77",class:"s-toggle-switcher"}))))),this.isDeleteAccountEnabled?t("div",{class:"s-user-settings-section s-user-settings-section-delete-user"},t("salla-list-tile",null,t("div",{slot:"icon",class:"s-user-settings-section-icon"},this.renderUserDeleteIcon()),t("div",{slot:"title",class:"s-user-settings-section-title"},this.capitalizeText(this.deleteAccount)),t("div",{slot:"subtitle",class:"s-user-settings-section-subtitle"},this.capitalizeText(this.isDeletePending?this.deleteAccountPending:this.deleteAccountDesc)),t("div",{slot:"action",class:"s-user-settings-section-action"},this.renderDeleteSectionAction()))):t("div",{class:"s-user-settings-section s-user-settings-section-deactivate-user"},t("salla-list-tile",null,t("div",{slot:"icon",class:"s-user-settings-section-icon"},t("span",{innerHTML:i})),t("div",{slot:"title",class:"s-user-settings-section-title"},this.capitalizeText(this.deactivateAccount)),t("div",{slot:"subtitle",class:"s-user-settings-section-subtitle"},this.capitalizeText(this.deactivateDesc)),t("div",{slot:"action",class:"s-user-settings-section-action"},t("salla-button",{fill:"outline",color:"danger",shape:"btn",size:"medium",width:"normal",onClick:()=>this.openDeactivateModal()},this.capitalizeText(this.deactivateAccount))))),this.isDeleteAccountEnabled?t("salla-modal",{id:"salla-user-settings-delete-modal",width:"xs",centered:!0,showBack:"otp"===this.currentStep,isClosable:"success"!==this.currentStep,iconStyle:"success"===this.currentStep?"success":void 0,onModalVisibilityChanged:e=>this.handleModalVisibilityChanged(e),onModalBack:()=>this.goBackFromOtp(),ref:e=>this.confirmationModal=e},"success"!==this.currentStep?t("span",{slot:"icon",class:"s-user-settings-delete-icon"},this.renderUserDeleteIcon()):null,t("div",{key:this.currentStep,class:"s-user-settings-delete-step"},this.renderDeleteStep())):t("salla-modal",{width:"sm",subTitle:this.capitalizeText(this.sorryForLeavingText),ref:e=>this.confirmationModal=e},t("span",{slot:"icon",class:"s-user-settings-confirmation-icon",innerHTML:i}),t("div",{class:"s-user-settings-confirmation"},t("div",{class:"s-user-settings-confirmation-warning"},this.capitalizeText(this.warningText)),t("div",{class:"s-user-settings-confirmation-actions"},t("salla-button",{width:"wide",onClick:()=>this.confirmationModal.close()},this.capitalizeText(this.keepAccount)),t("salla-button",{fill:"outline",loading:this.buttonLoading,width:"wide",onClick:()=>this.confirmDeactivateAccount()},this.capitalizeText(this.deactivateAccount))))))}};r.style='/*!twlt*/.s-modal-header-inner{display:flex;flex-direction:column !important;align-items:center !important;justify-content:center !important}.s-modal-header-content{text-align:center !important}.s-user-settings-delete-body{text-align:center}.s-user-settings-delete-icon{display:inline-flex;align-items:center;justify-content:center;width:4rem;height:4rem;border-radius:9999px;border:1px solid var(--infinte-color);color:var(--infinte-color);margin:0 auto 1rem}.s-user-settings-delete-icon svg{width:1.5rem;height:1.5rem}.s-user-settings-delete-warning{color:#6b7280;font-size:0.875rem;line-height:1.625;margin-bottom:1.25rem}.s-user-settings-delete-actions--row{display:flex;gap:0.75rem;justify-content:center}.s-user-settings-delete-actions--row salla-button{flex:1}.s-user-settings-delete-actions--stack{display:flex;flex-direction:column;gap:0.75rem;margin-top:1.25rem}.s-user-settings-delete-otp-instruction{color:#6b7280;font-size:0.875rem}.s-user-settings-delete-otp-target{color:#6b7280;direction:ltr;margin-bottom:1.25rem}.s-user-settings-delete-otp-codes{display:flex;justify-content:stretch;gap:0.75rem;direction:ltr;margin-bottom:0.75rem;width:100%}.s-user-settings-delete-otp-codes.has-error{margin-bottom:0}.s-user-settings-delete-otp-input{flex:1 1 0;min-width:0;width:100%;height:3.5rem;text-align:center;border:1px solid #d1d5db;border-radius:0.5rem;font-size:1.25rem;font-weight:600;color:#111827;outline:none}.s-user-settings-delete-otp-input:focus{border-color:#004956;box-shadow:0 0 0 1px #004956}.s-user-settings-delete-otp-input.s-has-error{border-color:#ef4444 !important}.s-user-settings-delete-otp-input.s-has-error:focus{border-color:#ef4444 !important;box-shadow:0 0 0 1px #ef4444}.s-user-settings-delete-otp-input::-webkit-outer-spin-button,.s-user-settings-delete-otp-input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.s-user-settings-delete-otp-input[type=text]{-moz-appearance:textfield}.s-user-settings-delete-otp-error{display:block;color:#ef4444;font-size:0.75rem;text-align:center;padding-top:0.75rem;margin-bottom:1.25rem}.s-user-settings-delete-otp-resend{color:#6b7280;font-size:0.75rem;margin-top:1rem;text-align:center}.s-user-settings-delete-otp-timer{font-weight:600;direction:ltr;display:inline-block}.s-user-settings-delete-otp-resend-link{display:block;color:#004956;font-size:0.875rem;margin-top:1rem;text-align:center;text-decoration:underline;cursor:pointer}.s-user-settings-delete-success-body{color:#6b7280;font-size:0.875rem;line-height:1.625;margin-bottom:1.25rem}.s-user-settings-delete-success-btn{--s-button-color:#004956}.mx-1{margin-left:0.25rem;margin-right:0.25rem}.block{display:block}.hidden{display:none}.font-bold{font-weight:700}.outline{outline-style:solid}.s-has-error{--tw-border-opacity:1;border-color:rgb(248 113 113 / var(--tw-border-opacity, 1))}.s-has-error:focus{--tw-border-opacity:1;border-color:rgb(239 68 68 / var(--tw-border-opacity, 1))}.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}.has-error .s-form-label{color:#ff443a}.has-error .s-form-control,.has-error .s-tel-input-control,.has-error .s-datetime-picker-input{border-color:#ff443a;color:#ff443a}.toggle-checkbox .s-toggle-input{position:absolute;visibility:hidden}.toggle-checkbox .s-toggle-switcher{display:inline-block;background:#ccc;border-radius:16px;width:40px;height:25px;position:relative;vertical-align:middle;transition:background 0.25s}.toggle-checkbox .s-toggle-switcher:before,.toggle-checkbox .s-toggle-switcher:after{content:""}.toggle-checkbox .s-toggle-switcher:before{display:block;background:#fff;border-radius:50%;box-shadow:0 0 0 1px rgba(0,0,0,0.25);width:20px;height:21px;position:absolute;top:2.2px;left:1px;transition:left 0.25s}.toggle-checkbox .s-toggle-input:checked+div{background:#30D158}.toggle-checkbox .s-toggle-input:checked+div:before{left:18px}.s-has-error{--tw-border-opacity:1 !important;border-color:rgb(239 68 68 / var(--tw-border-opacity, 1)) !important;--tw-text-opacity:1 !important;color:rgb(239 68 68 / var(--tw-text-opacity, 1)) !important}.s-toggle{cursor:pointer;display:inline-block}.s-toggle .s-toggle-input{position:absolute;visibility:hidden}.s-toggle .s-toggle-label{margin-left:5px;position:relative;top:2px}.s-toggle .s-toggle-switcher{display:inline-block;background:#ccc;border-radius:16px;width:40px;height:25px;position:relative;vertical-align:middle;transition:background 0.25s}.s-toggle .s-toggle-switcher:before,.s-toggle .s-toggle-switcher:after{content:""}.s-toggle .s-toggle-switcher:before{display:block;background:#fff;border-radius:50%;box-shadow:0 0 0 1px rgba(0,0,0,0.25);width:20px;height:21px;position:absolute;top:2.2px;left:1px;transition:left 0.25s}.s-toggle .s-toggle-input:checked+div{background:#30D158}.s-toggle .s-toggle-input:checked+div:before{left:18px}.s-user-settings-section{border-bottom-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.s-user-settings-section:first-child{border-bottom-right-radius:0px;border-bottom-left-radius:0px;border-top-left-radius:0.375rem;border-top-right-radius:0.375rem}.s-user-settings-section:last-child{border-bottom-right-radius:0.375rem;border-bottom-left-radius:0.375rem;border-top-left-radius:0px;border-top-right-radius:0px;border-bottom-width:0px}.s-user-settings-section .s-list-tile-item{align-items:flex-start;background-color:transparent;padding:1.25rem}@media (min-width: 768px){.s-user-settings-section .s-list-tile-item{align-items:center}}.s-user-settings-section .s-list-tile-item-action{margin-left:auto}.s-user-settings-section .s-list-tile-item-action:where([dir="rtl"],[dir="rtl"] *){margin-right:auto;margin-left:0px}.s-user-settings-section .s-list-tile-item-action button{width:100%;padding:10px}.s-user-settings-section-delete-user .s-list-tile-item{flex-wrap:wrap}@media (min-width: 768px){.s-user-settings-section-delete-user .s-list-tile-item{flex-wrap:nowrap}}.s-user-settings-section-delete-user .s-list-tile-item-icon{position:relative;top:5px}@media (min-width: 768px){.s-user-settings-section-delete-user .s-list-tile-item-icon{top:0px}}@media (max-width: 768px){.s-user-settings-section-delete-user .s-list-tile-item-content{flex:1 0 85%}.s-user-settings-section-delete-user .s-list-tile-item-action{flex:1 1 100%;margin-top:1rem}}.s-user-settings-section-title{font-size:1rem;line-height:1.5rem;--tw-text-opacity:1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.s-user-settings-section-subtitle{font-size:0.75rem;line-height:1rem;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-user-settings-section-icon svg{height:1.25rem;width:1.25rem}.s-user-settings-confirmation{text-align:center}.s-user-settings-confirmation svg{text-align:center}.s-user-settings-confirmation-icon{display:inline-flex;height:3rem;width:3rem;align-items:center;justify-content:center;border-radius:9999px;border-width:1px;border-style:solid;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}@media (min-width: 640px){.s-user-settings-confirmation-icon{margin-left:auto;margin-right:auto;margin-bottom:1rem;height:5rem;width:5rem}}.s-user-settings-confirmation-icon:where([dir="ltr"],[dir="ltr"] *){margin-right:0.5rem}@media (min-width: 640px){.s-user-settings-confirmation-icon:where([dir="ltr"],[dir="ltr"] *){margin-right:0px}}.s-user-settings-confirmation-icon:where([dir="rtl"],[dir="rtl"] *){margin-left:0.5rem}@media (min-width: 640px){.s-user-settings-confirmation-icon:where([dir="rtl"],[dir="rtl"] *){margin-left:0px}}.s-user-settings-confirmation-icon svg{height:1.25rem;width:1.25rem;flex-shrink:0;fill:#9ca3af}.s-user-settings-confirmation-warning{font-size:0.75rem;line-height:1rem;--tw-text-opacity:1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.s-user-settings-confirmation-actions{margin-top:1.25rem;display:flex;align-items:center;justify-content:space-between}.s-user-settings-confirmation-actions>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(1.25rem * var(--tw-space-x-reverse));margin-left:calc(1.25rem * calc(1 - var(--tw-space-x-reverse)))}.s-user-settings-confirmation-actions:where([dir="rtl"],[dir="rtl"] *)>:not([hidden])~:not([hidden]){--tw-space-x-reverse:1}';export{r as salla_user_settings}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r,f as e,h as t,H as n,F as a}from"./p-C9zdeQFI.js";function i(r,e){if("string"!=typeof r)return r??e;const t=r.trim();if(!t)return e;try{return JSON.parse(t)}catch{return e}}function o(r){if(r)return"string"==typeof r?i(r,void 0):r}function s(r,e="ar"){const[t,n]=String(r).trim().split(":").map(Number);if(!Number.isFinite(t)||!Number.isFinite(n))return r;const a=new Date(2e3,0,1,t,n),i={hour:"numeric",minute:"2-digit",hour12:!0};try{return a.toLocaleTimeString(e,i)}catch{return a.toLocaleTimeString("ar",i)}}var c='<svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M6.95448 2.79419C9.7395 1.84477 11.132 1.37005 11.881 2.11902C12.6299 2.86799 12.1552 4.2605 11.2058 7.04551L10.5593 8.94203C9.83014 11.0809 9.46556 12.1503 8.8646 12.2388C8.70303 12.2626 8.53577 12.2483 8.37592 12.197C7.78135 12.0061 7.46705 10.8785 6.83846 8.62339C6.69903 8.12319 6.62932 7.87308 6.47057 7.68206C6.4245 7.62662 6.37338 7.5755 6.31794 7.52943C6.12692 7.37068 5.87681 7.30097 5.37661 7.16154C3.12148 6.53295 1.99391 6.21865 1.80302 5.62408C1.7517 5.46423 1.73738 5.29698 1.76117 5.1354C1.84968 4.53444 2.91911 4.16986 5.05797 3.44072L6.95448 2.79419Z" stroke="currentColor" stroke-width="1.5"/>\n</svg>\n';const l=class{constructor(e){r(this,e),this.stackCards=!1,this.stickyCta=!1,this.isLoading=!1,this.translationDefaults={"pages.orders.pickup_instructions":{ar:"معلومات إرشادية",en:"Pickup instructions"}}}connectedCallback(){this.langUnsubscribe=salla.lang.subscribe?.((()=>e(this)))}disconnectedCallback(){this.langUnsubscribe?.()}componentWillLoad(){if(salla.lang.onLoaded?.((()=>this.registerTranslationDefaults())),this.registerTranslationDefaults(),null==this.items)return this.getBranchData();this.getBranchData()}registerTranslationDefaults(){if(!salla?.lang?.addBulk)return;const r=Object.entries(this.translationDefaults).reduce(((r,[e,t])=>(salla.lang.get?.(e)===e&&(r[e]=t),r)),{});Object.keys(r).length&&salla.lang.addBulk(r)}async getBranchData(){const r=salla.config.get("page.id");if(r){this.isLoading=!0;try{const e=await salla.order.api.getBranchDetails(r);this.branchData=this.parseBranchResponse(e)}catch(r){this.notifyApiError(r)}finally{this.isLoading=!1}}}parseBranchResponse(r){const e=r?.data?.data||r?.data||r;return e&&"object"==typeof e&&Object.prototype.hasOwnProperty.call(e,"branch")?e.branch?o(e.branch):void 0:o(e)}getApiErrorMessage(r){return r?.response?.data?.error?.message||r?.response?.data?.message}notifyApiError(r){const e=this.getApiErrorMessage(r);e&&salla.notify.error(e)}label(r,e){return salla.lang.getWithDefault(r,e)}bilingualLabel(r){const e=this.translationDefaults[r],t=(salla.lang.locale||"ar").startsWith("en")?"en":"ar";return this.label(r,e?.[t]??e?.ar??r)}get preparationText(){const r=this.branchData?.preparation_time_range;if(!r?.from||!r?.to)return"";const e=salla.helpers.number(r.from.value),t=salla.helpers.number(r.to.value),n=this.unitLabel(r.to.unit),a=e===t?e:`⁦${e}-${t}⁩`;return this.label("pages.orders.pickup_ready_after","جاهز للاستلام بعد :time").replace(":time",`${a} ${n}`)}unitLabel(r){const e=function(r){const e=String(r||"hour").toLowerCase();return e.startsWith("min")?"minute":e.startsWith("day")?"day":"hour"}(r);return"minute"===e?this.label("pages.checkout.minute","دقيقة"):"day"===e?this.label("pages.checkout.day","يوم"):this.label("pages.checkout.hour","ساعة")}get workingHoursItems(){const r=this.branchData;if(!r)return[];if(!0===r.always_open||1===r.always_open||"1"===r.always_open)return[this.label("pages.orders.branch_always_open","مفتوح على مدار الساعة")];const e=salla.lang.locale||"ar";return(r.working_hours||[]).filter((r=>r?.name&&r.times?.length)).map((r=>{const t=r.times.map((r=>`${s(r.from,e)}–${s(r.to,e)}`)).join(" - ");return`${r.name}: ${t}`}))}get todayHours(){const r=this.branchData;if(!r?.timezone||!0===r.always_open||1===r.always_open||"1"===r.always_open)return"";const e=new Date;let t;try{t=["ar","en"].flatMap((t=>["long","short"].map((n=>e.toLocaleDateString(t,{weekday:n,timeZone:r.timezone}).toLowerCase()))))}catch{return""}const n=(r.working_hours||[]).find((r=>r?.name&&t.includes(r.name.trim().toLowerCase())));if(!n?.times?.length)return"";const a=salla.lang.locale||"ar";return n.times.map((r=>`${s(r.from,a)}–${s(r.to,a)}`)).join(" - ")}get branchAddress(){return this.branchData?.address||""}get mapUrl(){const r=this.branchData?.location;if(null!=r?.lat&&null!=r?.lng)return`https://www.google.com/maps?q=${r.lat},${r.lng}`}get phone(){return function(r){const e=i(r,null),t=e&&"object"==typeof e?e.phone:"";return"string"==typeof t?t.trim():""}(this.branchData?.contacts)}get pickupInstructions(){const r=this.branchData?.pickup_instructions;return"string"==typeof r&&r.trim()?r:""}renderPickupInstructions(){const r=this.pickupInstructions;return r?t("div",{class:"s-order-branch-instructions"},t("div",{class:"s-order-branch-instructions-heading"},t("span",{"aria-hidden":"true"},t("i",{class:"sicon-info"})),t("span",null,this.bilingualLabel("pages.orders.pickup_instructions"))),t("p",{class:"s-order-branch-instructions-content"},r)):null}renderDetailsColumn(){const r=this.phone;return r?t("div",{class:"s-order-branch-details"},t("div",{class:"s-order-branch-info-card"},t("span",{class:"s-order-branch-info-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>phone-talking</title>\n<path d="M18.667 8c2.941 0 5.333 2.392 5.333 5.333 0 0.737 0.596 1.333 1.333 1.333s1.333-0.596 1.333-1.333c0-4.412-3.588-8-8-8-0.737 0-1.333 0.596-1.333 1.333s0.596 1.333 1.333 1.333zM18.667 2.667c5.881 0 10.667 4.785 10.667 10.667 0 0.737 0.596 1.333 1.333 1.333s1.333-0.596 1.333-1.333c0-7.352-5.981-13.333-13.333-13.333-0.737 0-1.333 0.596-1.333 1.333s0.596 1.333 1.333 1.333zM26.939 17.831c-1.568-1.568-4.119-1.568-5.689 0l-2.567 2.568c-3.064-1.499-5.584-4.019-7.083-7.083l2.569-2.567c1.567-1.569 1.567-4.121-0.001-5.689l-3.88-3.881c-1.521-1.521-4.169-1.521-5.691 0l-1.847 1.847c-2.22 2.22-3.183 5.408-2.573 8.527 1.979 10.144 10.127 18.292 20.271 20.271 0.617 0.121 1.236 0.18 1.851 0.18 2.491 0 4.895-0.972 6.676-2.752l1.847-1.847c1.569-1.569 1.569-4.12 0-5.689zM28.936 25.517l-1.847 1.847c-1.591 1.591-3.876 2.281-6.131 1.841-9.089-1.776-16.388-9.075-18.163-18.165-0.439-2.247 0.249-4.539 1.841-6.129l1.847-1.847c0.256-0.257 0.597-0.397 0.959-0.397s0.701 0.14 0.959 0.397l3.883 3.883c0.528 0.528 0.528 1.389 0 1.917l-3.22 3.219c-0.383 0.384-0.496 0.959-0.288 1.457 1.815 4.34 5.344 7.868 9.684 9.684 0.5 0.205 1.075 0.095 1.457-0.288l3.219-3.219c0.528-0.531 1.389-0.529 1.917-0.001l3.883 3.883c0.529 0.529 0.529 1.389 0 1.919z"></path>\n</svg>\n'}),t("div",{class:"s-order-branch-info-text"},t("span",{class:"s-order-branch-info-label"},this.label("pages.orders.branch_contacts","ارقام التواصل")),t("span",{class:"s-order-branch-info-value",dir:"ltr"},r)))):null}renderWorkingHoursCard(){const r=this.workingHoursItems;return r.length?t("div",{class:"s-order-branch-info-card s-order-branch-hours-card"},t("span",{class:"s-order-branch-info-icon","aria-hidden":"true"},t("i",{class:"sicon-calendar-alt"})),t("div",{class:"s-order-branch-info-text"},t("span",{class:"s-order-branch-info-label"},this.label("pages.checkout.working_hours","ساعات العمل")),t("div",{class:"s-order-branch-hours-list"},r.map(((r,e)=>t("span",{key:`${r}-${e}`,class:"s-order-branch-hours-item"},r)))))):null}renderBranchIdentityCard(){const r=this.branchData,e=this.branchAddress,n=this.preparationText;return t("section",{class:"s-order-branch-card"},t("div",{class:"s-order-branch-location"},t("div",{class:"s-order-branch-identity"},t("span",{class:"s-order-branch-store-icon"},t("i",{class:"sicon-store","aria-hidden":"true"})),t("div",{class:"s-order-branch-text"},t("div",{class:"s-order-branch-name-row"},r?.name?t("span",{class:"s-order-branch-name"},r.name):null,n?t("span",{class:"s-order-branch-ready"},n):null),e?t("span",{class:"s-order-branch-address"},e):null)),this.mapUrl?t("div",{class:"s-order-branch-actions"},t("a",{href:this.mapUrl,target:"_blank",rel:"noopener noreferrer",class:"s-order-branch-map-link"},t("span",null,this.label("pages.orders.branch_map","موقع الفرع علي الخريطة")),t("span",{class:"s-order-branch-action-icon",innerHTML:c}))):null),this.renderPickupInstructions())}renderCompactCard(){const r=this.branchData,e=this.preparationText||r?.name||"",n=this.workingHoursItems,a=this.todayHours;return t("salla-order-items",{currency:this.currency,items:this.items,collapsedTitle:e,cardTitle:e,collapsed:!0},t("div",{slot:"footer",class:"s-order-branch-compact"},t("div",{class:"s-order-branch-identity"},t("span",{class:"s-order-branch-store-icon"},t("i",{class:"sicon-store","aria-hidden":"true"})),t("div",{class:"s-order-branch-text"},r?.name?t("span",{class:"s-order-branch-name"},r.name):null,this.branchAddress?t("span",{class:"s-order-branch-address"},this.branchAddress):null,a?t("span",{class:"s-order-branch-address"},salla.lang.get("pages.thank_you.working_time")," ",a):n.length?t("span",{class:"s-order-branch-address"},salla.lang.get("pages.checkout.working_hours")," ",n.join(" · ")):null,this.phone?t("span",{class:"s-order-branch-address"},salla.lang.get("pages.orders.branch_contacts")," ",t("a",{href:`tel:${this.phone.replace(/[^+\d]/g,"")}`,dir:"ltr"},this.phone)):null)),this.mapUrl?t("a",{href:this.mapUrl,target:"_blank",rel:"noopener noreferrer",class:"s-order-branch-map-link s-order-branch-map-link-wide"},t("span",{class:"s-order-branch-action-icon",innerHTML:c}),t("span",null,salla.lang.get("pages.orders.go_to_pickup_location"))):null,this.renderPickupInstructions()))}renderStickyCta(){const r=this.branchData,e=this.preparationText;return t("div",{class:"s-order-branch-cta"},t("div",{class:"s-order-branch-cta-text"},r?.name?t("b",{class:"s-order-branch-cta-name"},r.name):null,e?t("span",{class:"s-order-branch-cta-ready"},e):null),this.mapUrl?t("a",{href:this.mapUrl,target:"_blank",rel:"noopener noreferrer",class:"s-order-branch-cta-link"},t("span",{class:"s-order-branch-action-icon",innerHTML:c}),t("span",null,salla.lang.get("pages.orders.go_to_pickup_location"))):null)}render(){return this.isLoading||!this.branchData?t(n,{class:"s-order-branch-wrapper"},null!=this.items?t("salla-order-items",{currency:this.currency,items:this.items,collapsed:!0}):null):this.items?t(n,{class:"s-order-branch-wrapper"},this.renderCompactCard(),this.stickyCta?this.renderStickyCta():null):t(n,{class:"s-order-branch-wrapper"},this.stackCards?t(a,null,this.renderBranchIdentityCard(),this.renderDetailsColumn()):t("div",{class:"s-order-branch-container"},this.renderBranchIdentityCard(),this.renderDetailsColumn()),this.renderWorkingHoursCard(),this.stickyCta?this.renderStickyCta():null)}};l.style="/*!twlt*/:host{display:flex;flex-direction:column}.s-order-branch-ready{background-color:color-mix(in srgb, var(--color-primary) 30%, transparent)}.s-order-branch-instructions{background-color:color-mix(in srgb, var(--color-primary) 10%, transparent)}.s-order-branch-instructions-content{white-space:pre-wrap}@media not all and (min-width: 768px){.s-order-branch-cta{position:fixed;left:0px;right:0px;bottom:0px;z-index:40;border-top-width:1px;border-color:var(--color-border,#eee);background-color:var(--color-surface,#fff);padding:1rem}.s-order-branch-wrapper:has(.s-order-branch-cta):not(.s-thank-you-page-wrapper *){padding-bottom:calc(9rem + env(safe-area-inset-bottom, 0px))}}.fixed{position:fixed}.sticky{position:sticky}.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-order-branch-wrapper{margin-bottom:1.5rem;display:flex;flex-direction:column;gap:1rem;font-family:inherit}.s-order-branch-container{display:grid;grid-template-columns:repeat(1, minmax(0, 1fr));align-items:stretch;gap:1rem}@media (min-width: 768px){.s-order-branch-container{grid-template-columns:repeat(2, minmax(0, 1fr))}}.s-order-branch-details{display:grid;align-content:stretch;gap:1rem}.s-order-branch-info-card{display:flex;min-height:4rem;align-items:center;justify-content:space-between;gap:0.75rem;border-radius:0.5rem;border-width:1px;border-color:var(--color-border,#eee);background-color:var(--color-surface,#fff);padding:0.75rem}.s-order-branch-info-text{display:flex;min-width:0px;flex:1 1 0%;flex-direction:column;gap:0.125rem;text-align:start}.s-order-branch-info-label{font-size:0.75rem;line-height:1rem;line-height:1.375;color:var(--color-text-secondary,#666)}.s-order-branch-info-value{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:0.875rem;line-height:1.25rem;font-weight:500;line-height:1.5;color:var(--color-text-primary,#1d1d1d)}.s-order-branch-hours-card .s-order-branch-info-text{gap:0.5rem}.s-order-branch-hours-list{display:flex;flex-wrap:wrap;align-items:center;gap:0.5rem}.s-order-branch-hours-item{display:inline-flex;align-items:center;white-space:nowrap;border-radius:0.375rem;border-width:1px;border-color:var(--color-border,#eee);padding-left:0.625rem;padding-right:0.625rem;padding-top:0.25rem;padding-bottom:0.25rem;font-size:0.75rem;line-height:1rem;font-weight:500;line-height:1.5;color:var(--color-text-primary,#1d1d1d)}.s-order-branch-info-action{display:inline-flex;height:3rem;width:3rem;flex-shrink:0;align-items:center;justify-content:center;border-radius:0.5rem;background-color:var(--color-surface-secondary,#f6f6f6);color:var(--color-text-primary,#2b2d34);text-decoration-line:none}.s-order-branch-info-icon{display:inline-flex;height:3rem;width:3rem;align-items:center;justify-content:center;border-radius:0.375rem;--tw-bg-opacity:1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1));font-size:1.25rem;line-height:1.75rem;color:currentColor}.s-order-branch-info-icon svg{height:1.5rem;width:1.5rem;fill:currentColor}.s-order-branch-card{display:flex;flex-direction:column;gap:0.75rem;border-radius:0.5rem;border-width:1px;border-color:var(--color-border,#eee);background-color:var(--color-surface,#fff);padding:1rem}@media (min-width: 768px){.s-order-branch-card{padding:1.25rem}}.s-order-branch-ready{display:inline-flex;flex-shrink:0;align-items:center;white-space:nowrap;border-radius:9999px;border-width:1px;border-color:var(--color-primary);padding-left:0.75rem;padding-right:0.75rem;padding-top:0.25rem;padding-bottom:0.25rem;font-size:0.75rem;line-height:1rem;font-weight:500;color:var(--color-primary-dark)}.s-order-branch-location{display:flex;min-height:3.5rem;flex-direction:column;align-items:stretch;justify-content:space-between;gap:1.5rem}@media (min-width: 768px){.s-order-branch-location{flex-direction:row;align-items:center}}.s-order-branch-identity{display:flex;min-width:0px;flex:1 1 0%;align-items:center;gap:0.75rem}.s-order-branch-store-icon{display:inline-flex;height:3rem;width:3rem;flex-shrink:0;align-items:center;justify-content:center;--tw-bg-opacity:1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1));font-size:1.5rem;line-height:2rem;color:var(--color-text-primary,#2b2d34)}.s-order-branch-store-icon svg{height:1em;width:1em;fill:currentColor}.s-order-branch-text{display:flex;min-width:0px;flex-direction:column;gap:0.25rem;text-align:start}.s-order-branch-name-row{display:flex;flex-wrap:wrap;align-items:center;gap:0.5rem}.s-order-branch-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:1rem;line-height:1.5rem;font-weight:500;line-height:1.5;color:var(--color-text-primary,#2b2d34)}.s-order-branch-address{overflow-wrap:break-word;font-size:0.75rem;line-height:1rem;line-height:1.5;color:var(--color-text-secondary,#666)}.s-order-branch-instructions{border-radius:0.5rem;padding:1rem;text-align:start}.s-order-branch-instructions-heading{margin-bottom:0.5rem;display:flex;align-items:center;gap:0.5rem;font-size:0.75rem;line-height:1rem;line-height:1.35}.s-order-branch-instructions-heading i{font-size:0.875rem;line-height:1.25rem;font-weight:700;--tw-text-opacity:1;color:rgb(0 0 0 / var(--tw-text-opacity, 1))}.s-order-branch-instructions-content{margin:0px;overflow-wrap:break-word;font-size:0.875rem;line-height:1.25rem;font-weight:600;line-height:1.6}.s-order-branch-actions{display:flex;flex-shrink:0;flex-wrap:wrap;align-items:center;gap:0.75rem}@media (min-width: 768px){.s-order-branch-actions{flex-wrap:nowrap}}.s-order-branch-map-link{display:inline-flex;min-height:2.25rem;align-items:center;justify-content:center;gap:0.5rem;white-space:nowrap;border-radius:0.375rem;border-width:1px;border-color:var(--color-primary);padding-left:0.875rem;padding-right:0.875rem;padding-top:0.5rem;padding-bottom:0.5rem;font-size:0.875rem;line-height:1.25rem;font-weight:700;line-height:1.25;color:var(--color-primary);text-decoration-line:none}.s-order-branch-action-icon{display:inline-flex;align-items:center;justify-content:center;font-size:0.875rem;line-height:1.25rem;color:currentColor}.s-order-branch-action-icon svg{height:1em;width:1em}.s-order-branch-cta{display:flex;flex-direction:column;gap:0.75rem}@media (min-width: 768px){.s-order-branch-cta{order:-1}}.s-order-branch-cta-text{display:flex;align-items:center;justify-content:space-between;gap:0.5rem;font-size:0.75rem;line-height:1rem}@media (min-width: 768px){.s-order-branch-cta-text{display:none}}.s-order-branch-cta-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--color-text-primary,#333)}.s-order-branch-cta-ready{flex-shrink:0;font-weight:700;color:var(--color-primary)}.s-order-branch-cta-link{display:inline-flex;min-height:2.5rem;width:100%;align-items:center;justify-content:center;gap:0.5rem;border-radius:0.375rem;background-color:var(--color-primary);padding-left:1rem;padding-right:1rem;padding-top:0.5rem;padding-bottom:0.5rem;font-size:0.875rem;line-height:1.25rem;font-weight:700;color:var(--color-primary-reverse);text-decoration-line:none}.s-order-branch-compact{display:flex;flex-direction:column;gap:1.5rem}.s-order-branch-map-link-wide{min-height:2.5rem;width:100%;border-radius:0.5rem;border-color:var(--color-border,#eee);color:var(--color-primary)}.s-thank-you-page-wrapper .s-order-branch-wrapper{margin-bottom:0px}.s-thank-you-page-wrapper .s-order-branch-address,.s-thank-you-page-wrapper .s-order-branch-cta-text{font-size:0.875rem;line-height:1.25rem}.s-thank-you-page-wrapper .s-order-branch-action-icon{font-size:1.25rem;line-height:1.75rem}.s-thank-you-page-wrapper .s-order-branch-cta-link,.s-thank-you-page-wrapper .s-order-branch-map-link-wide{min-height:3rem;font-size:1rem;line-height:1.5rem}.s-thank-you-page-wrapper .s-order-branch-store-icon{border-radius:0.5rem;border-width:1px;border-color:var(--color-border,#eee);background-color:transparent;color:var(--color-primary)}.s-thank-you-page-wrapper .s-order-branch-compact{gap:1rem}@media (min-width: 640px){.s-thank-you-page-wrapper .s-order-branch-compact{gap:1.5rem}}.s-thank-you-page-wrapper .s-order-branch-cta-text{flex-wrap:wrap;gap:0.5rem;font-size:0.875rem;line-height:1.25rem}";export{l as salla_order_branch}
4
+ import{r,f as e,h as t,H as n,F as a}from"./p-CrXKQnBu.js";function i(r,e){if("string"!=typeof r)return r??e;const t=r.trim();if(!t)return e;try{return JSON.parse(t)}catch{return e}}function o(r){if(r)return"string"==typeof r?i(r,void 0):r}function s(r,e="ar"){const[t,n]=String(r).trim().split(":").map(Number);if(!Number.isFinite(t)||!Number.isFinite(n))return r;const a=new Date(2e3,0,1,t,n),i={hour:"numeric",minute:"2-digit",hour12:!0};try{return a.toLocaleTimeString(e,i)}catch{return a.toLocaleTimeString("ar",i)}}var c='<svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M6.95448 2.79419C9.7395 1.84477 11.132 1.37005 11.881 2.11902C12.6299 2.86799 12.1552 4.2605 11.2058 7.04551L10.5593 8.94203C9.83014 11.0809 9.46556 12.1503 8.8646 12.2388C8.70303 12.2626 8.53577 12.2483 8.37592 12.197C7.78135 12.0061 7.46705 10.8785 6.83846 8.62339C6.69903 8.12319 6.62932 7.87308 6.47057 7.68206C6.4245 7.62662 6.37338 7.5755 6.31794 7.52943C6.12692 7.37068 5.87681 7.30097 5.37661 7.16154C3.12148 6.53295 1.99391 6.21865 1.80302 5.62408C1.7517 5.46423 1.73738 5.29698 1.76117 5.1354C1.84968 4.53444 2.91911 4.16986 5.05797 3.44072L6.95448 2.79419Z" stroke="currentColor" stroke-width="1.5"/>\n</svg>\n';const l=class{constructor(e){r(this,e),this.stackCards=!1,this.stickyCta=!1,this.isLoading=!1,this.translationDefaults={"pages.orders.pickup_instructions":{ar:"معلومات إرشادية",en:"Pickup instructions"}}}connectedCallback(){this.langUnsubscribe=salla.lang.subscribe?.((()=>e(this)))}disconnectedCallback(){this.langUnsubscribe?.()}componentWillLoad(){if(salla.lang.onLoaded?.((()=>this.registerTranslationDefaults())),this.registerTranslationDefaults(),null==this.items)return this.getBranchData();this.getBranchData()}registerTranslationDefaults(){if(!salla?.lang?.addBulk)return;const r=Object.entries(this.translationDefaults).reduce(((r,[e,t])=>(salla.lang.get?.(e)===e&&(r[e]=t),r)),{});Object.keys(r).length&&salla.lang.addBulk(r)}async getBranchData(){const r=salla.config.get("page.id");if(r){this.isLoading=!0;try{const e=await salla.order.api.getBranchDetails(r);this.branchData=this.parseBranchResponse(e)}catch(r){this.notifyApiError(r)}finally{this.isLoading=!1}}}parseBranchResponse(r){const e=r?.data?.data||r?.data||r;return e&&"object"==typeof e&&Object.prototype.hasOwnProperty.call(e,"branch")?e.branch?o(e.branch):void 0:o(e)}getApiErrorMessage(r){return r?.response?.data?.error?.message||r?.response?.data?.message}notifyApiError(r){const e=this.getApiErrorMessage(r);e&&salla.notify.error(e)}label(r,e){return salla.lang.getWithDefault(r,e)}bilingualLabel(r){const e=this.translationDefaults[r],t=(salla.lang.locale||"ar").startsWith("en")?"en":"ar";return this.label(r,e?.[t]??e?.ar??r)}get preparationText(){const r=this.branchData?.preparation_time_range;if(!r?.from||!r?.to)return"";const e=salla.helpers.number(r.from.value),t=salla.helpers.number(r.to.value),n=this.unitLabel(r.to.unit),a=e===t?e:`⁦${e}-${t}⁩`;return this.label("pages.orders.pickup_ready_after","جاهز للاستلام بعد :time").replace(":time",`${a} ${n}`)}unitLabel(r){const e=function(r){const e=String(r||"hour").toLowerCase();return e.startsWith("min")?"minute":e.startsWith("day")?"day":"hour"}(r);return"minute"===e?this.label("pages.checkout.minute","دقيقة"):"day"===e?this.label("pages.checkout.day","يوم"):this.label("pages.checkout.hour","ساعة")}get workingHoursItems(){const r=this.branchData;if(!r)return[];if(!0===r.always_open||1===r.always_open||"1"===r.always_open)return[this.label("pages.orders.branch_always_open","مفتوح على مدار الساعة")];const e=salla.lang.locale||"ar";return(r.working_hours||[]).filter((r=>r?.name&&r.times?.length)).map((r=>{const t=r.times.map((r=>`${s(r.from,e)}–${s(r.to,e)}`)).join(" - ");return`${r.name}: ${t}`}))}get todayHours(){const r=this.branchData;if(!r?.timezone||!0===r.always_open||1===r.always_open||"1"===r.always_open)return"";const e=new Date;let t;try{t=["ar","en"].flatMap((t=>["long","short"].map((n=>e.toLocaleDateString(t,{weekday:n,timeZone:r.timezone}).toLowerCase()))))}catch{return""}const n=(r.working_hours||[]).find((r=>r?.name&&t.includes(r.name.trim().toLowerCase())));if(!n?.times?.length)return"";const a=salla.lang.locale||"ar";return n.times.map((r=>`${s(r.from,a)}–${s(r.to,a)}`)).join(" - ")}get branchAddress(){return this.branchData?.address||""}get mapUrl(){const r=this.branchData?.location;if(null!=r?.lat&&null!=r?.lng)return`https://www.google.com/maps?q=${r.lat},${r.lng}`}get phone(){return function(r){const e=i(r,null),t=e&&"object"==typeof e?e.phone:"";return"string"==typeof t?t.trim():""}(this.branchData?.contacts)}get pickupInstructions(){const r=this.branchData?.pickup_instructions;return"string"==typeof r&&r.trim()?r:""}renderPickupInstructions(){const r=this.pickupInstructions;return r?t("div",{class:"s-order-branch-instructions"},t("div",{class:"s-order-branch-instructions-heading"},t("span",{"aria-hidden":"true"},t("i",{class:"sicon-info"})),t("span",null,this.bilingualLabel("pages.orders.pickup_instructions"))),t("p",{class:"s-order-branch-instructions-content"},r)):null}renderDetailsColumn(){const r=this.phone;return r?t("div",{class:"s-order-branch-details"},t("div",{class:"s-order-branch-info-card"},t("span",{class:"s-order-branch-info-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>phone-talking</title>\n<path d="M18.667 8c2.941 0 5.333 2.392 5.333 5.333 0 0.737 0.596 1.333 1.333 1.333s1.333-0.596 1.333-1.333c0-4.412-3.588-8-8-8-0.737 0-1.333 0.596-1.333 1.333s0.596 1.333 1.333 1.333zM18.667 2.667c5.881 0 10.667 4.785 10.667 10.667 0 0.737 0.596 1.333 1.333 1.333s1.333-0.596 1.333-1.333c0-7.352-5.981-13.333-13.333-13.333-0.737 0-1.333 0.596-1.333 1.333s0.596 1.333 1.333 1.333zM26.939 17.831c-1.568-1.568-4.119-1.568-5.689 0l-2.567 2.568c-3.064-1.499-5.584-4.019-7.083-7.083l2.569-2.567c1.567-1.569 1.567-4.121-0.001-5.689l-3.88-3.881c-1.521-1.521-4.169-1.521-5.691 0l-1.847 1.847c-2.22 2.22-3.183 5.408-2.573 8.527 1.979 10.144 10.127 18.292 20.271 20.271 0.617 0.121 1.236 0.18 1.851 0.18 2.491 0 4.895-0.972 6.676-2.752l1.847-1.847c1.569-1.569 1.569-4.12 0-5.689zM28.936 25.517l-1.847 1.847c-1.591 1.591-3.876 2.281-6.131 1.841-9.089-1.776-16.388-9.075-18.163-18.165-0.439-2.247 0.249-4.539 1.841-6.129l1.847-1.847c0.256-0.257 0.597-0.397 0.959-0.397s0.701 0.14 0.959 0.397l3.883 3.883c0.528 0.528 0.528 1.389 0 1.917l-3.22 3.219c-0.383 0.384-0.496 0.959-0.288 1.457 1.815 4.34 5.344 7.868 9.684 9.684 0.5 0.205 1.075 0.095 1.457-0.288l3.219-3.219c0.528-0.531 1.389-0.529 1.917-0.001l3.883 3.883c0.529 0.529 0.529 1.389 0 1.919z"></path>\n</svg>\n'}),t("div",{class:"s-order-branch-info-text"},t("span",{class:"s-order-branch-info-label"},this.label("pages.orders.branch_contacts","ارقام التواصل")),t("span",{class:"s-order-branch-info-value",dir:"ltr"},r)))):null}renderWorkingHoursCard(){const r=this.workingHoursItems;return r.length?t("div",{class:"s-order-branch-info-card s-order-branch-hours-card"},t("span",{class:"s-order-branch-info-icon","aria-hidden":"true"},t("i",{class:"sicon-calendar-alt"})),t("div",{class:"s-order-branch-info-text"},t("span",{class:"s-order-branch-info-label"},this.label("pages.checkout.working_hours","ساعات العمل")),t("div",{class:"s-order-branch-hours-list"},r.map(((r,e)=>t("span",{key:`${r}-${e}`,class:"s-order-branch-hours-item"},r)))))):null}renderBranchIdentityCard(){const r=this.branchData,e=this.branchAddress,n=this.preparationText;return t("section",{class:"s-order-branch-card"},t("div",{class:"s-order-branch-location"},t("div",{class:"s-order-branch-identity"},t("span",{class:"s-order-branch-store-icon"},t("i",{class:"sicon-store","aria-hidden":"true"})),t("div",{class:"s-order-branch-text"},t("div",{class:"s-order-branch-name-row"},r?.name?t("span",{class:"s-order-branch-name"},r.name):null,n?t("span",{class:"s-order-branch-ready"},n):null),e?t("span",{class:"s-order-branch-address"},e):null)),this.mapUrl?t("div",{class:"s-order-branch-actions"},t("a",{href:this.mapUrl,target:"_blank",rel:"noopener noreferrer",class:"s-order-branch-map-link"},t("span",null,this.label("pages.orders.branch_map","موقع الفرع علي الخريطة")),t("span",{class:"s-order-branch-action-icon",innerHTML:c}))):null),this.renderPickupInstructions())}renderCompactCard(){const r=this.branchData,e=this.preparationText||r?.name||"",n=this.workingHoursItems,a=this.todayHours;return t("salla-order-items",{currency:this.currency,items:this.items,collapsedTitle:e,cardTitle:e,collapsed:!0},t("div",{slot:"footer",class:"s-order-branch-compact"},t("div",{class:"s-order-branch-identity"},t("span",{class:"s-order-branch-store-icon"},t("i",{class:"sicon-store","aria-hidden":"true"})),t("div",{class:"s-order-branch-text"},r?.name?t("span",{class:"s-order-branch-name"},r.name):null,this.branchAddress?t("span",{class:"s-order-branch-address"},this.branchAddress):null,a?t("span",{class:"s-order-branch-address"},salla.lang.get("pages.thank_you.working_time")," ",a):n.length?t("span",{class:"s-order-branch-address"},salla.lang.get("pages.checkout.working_hours")," ",n.join(" · ")):null,this.phone?t("span",{class:"s-order-branch-address"},salla.lang.get("pages.orders.branch_contacts")," ",t("a",{href:`tel:${this.phone.replace(/[^+\d]/g,"")}`,dir:"ltr"},this.phone)):null)),this.mapUrl?t("a",{href:this.mapUrl,target:"_blank",rel:"noopener noreferrer",class:"s-order-branch-map-link s-order-branch-map-link-wide"},t("span",{class:"s-order-branch-action-icon",innerHTML:c}),t("span",null,salla.lang.get("pages.orders.go_to_pickup_location"))):null,this.renderPickupInstructions()))}renderStickyCta(){const r=this.branchData,e=this.preparationText;return t("div",{class:"s-order-branch-cta"},t("div",{class:"s-order-branch-cta-text"},r?.name?t("b",{class:"s-order-branch-cta-name"},r.name):null,e?t("span",{class:"s-order-branch-cta-ready"},e):null),this.mapUrl?t("a",{href:this.mapUrl,target:"_blank",rel:"noopener noreferrer",class:"s-order-branch-cta-link"},t("span",{class:"s-order-branch-action-icon",innerHTML:c}),t("span",null,salla.lang.get("pages.orders.go_to_pickup_location"))):null)}render(){return this.isLoading||!this.branchData?t(n,{class:"s-order-branch-wrapper"},null!=this.items?t("salla-order-items",{currency:this.currency,items:this.items,collapsed:!0}):null):this.items?t(n,{class:"s-order-branch-wrapper"},this.renderCompactCard(),this.stickyCta?this.renderStickyCta():null):t(n,{class:"s-order-branch-wrapper"},this.stackCards?t(a,null,this.renderBranchIdentityCard(),this.renderDetailsColumn()):t("div",{class:"s-order-branch-container"},this.renderBranchIdentityCard(),this.renderDetailsColumn()),this.renderWorkingHoursCard(),this.stickyCta?this.renderStickyCta():null)}};l.style="/*!twlt*/:host{display:flex;flex-direction:column}.s-order-branch-ready{background-color:color-mix(in srgb, var(--color-primary) 30%, transparent)}.s-order-branch-instructions{background-color:color-mix(in srgb, var(--color-primary) 10%, transparent)}.s-order-branch-instructions-content{white-space:pre-wrap}@media not all and (min-width: 768px){.s-order-branch-cta{position:fixed;left:0px;right:0px;bottom:0px;z-index:40;border-top-width:1px;border-color:var(--color-border,#eee);background-color:var(--color-surface,#fff);padding:1rem}.s-order-branch-wrapper:has(.s-order-branch-cta):not(.s-thank-you-page-wrapper *){padding-bottom:calc(9rem + env(safe-area-inset-bottom, 0px))}}.fixed{position:fixed}.sticky{position:sticky}.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-order-branch-wrapper{margin-bottom:1.5rem;display:flex;flex-direction:column;gap:1rem;font-family:inherit}.s-order-branch-container{display:grid;grid-template-columns:repeat(1, minmax(0, 1fr));align-items:stretch;gap:1rem}@media (min-width: 768px){.s-order-branch-container{grid-template-columns:repeat(2, minmax(0, 1fr))}}.s-order-branch-details{display:grid;align-content:stretch;gap:1rem}.s-order-branch-info-card{display:flex;min-height:4rem;align-items:center;justify-content:space-between;gap:0.75rem;border-radius:0.5rem;border-width:1px;border-color:var(--color-border,#eee);background-color:var(--color-surface,#fff);padding:0.75rem}.s-order-branch-info-text{display:flex;min-width:0px;flex:1 1 0%;flex-direction:column;gap:0.125rem;text-align:start}.s-order-branch-info-label{font-size:0.75rem;line-height:1rem;line-height:1.375;color:var(--color-text-secondary,#666)}.s-order-branch-info-value{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:0.875rem;line-height:1.25rem;font-weight:500;line-height:1.5;color:var(--color-text-primary,#1d1d1d)}.s-order-branch-hours-card .s-order-branch-info-text{gap:0.5rem}.s-order-branch-hours-list{display:flex;flex-wrap:wrap;align-items:center;gap:0.5rem}.s-order-branch-hours-item{display:inline-flex;align-items:center;white-space:nowrap;border-radius:0.375rem;border-width:1px;border-color:var(--color-border,#eee);padding-left:0.625rem;padding-right:0.625rem;padding-top:0.25rem;padding-bottom:0.25rem;font-size:0.75rem;line-height:1rem;font-weight:500;line-height:1.5;color:var(--color-text-primary,#1d1d1d)}.s-order-branch-info-action{display:inline-flex;height:3rem;width:3rem;flex-shrink:0;align-items:center;justify-content:center;border-radius:0.5rem;background-color:var(--color-surface-secondary,#f6f6f6);color:var(--color-text-primary,#2b2d34);text-decoration-line:none}.s-order-branch-info-icon{display:inline-flex;height:3rem;width:3rem;align-items:center;justify-content:center;border-radius:0.375rem;--tw-bg-opacity:1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1));font-size:1.25rem;line-height:1.75rem;color:currentColor}.s-order-branch-info-icon svg{height:1.5rem;width:1.5rem;fill:currentColor}.s-order-branch-card{display:flex;flex-direction:column;gap:0.75rem;border-radius:0.5rem;border-width:1px;border-color:var(--color-border,#eee);background-color:var(--color-surface,#fff);padding:1rem}@media (min-width: 768px){.s-order-branch-card{padding:1.25rem}}.s-order-branch-ready{display:inline-flex;flex-shrink:0;align-items:center;white-space:nowrap;border-radius:9999px;border-width:1px;border-color:var(--color-primary);padding-left:0.75rem;padding-right:0.75rem;padding-top:0.25rem;padding-bottom:0.25rem;font-size:0.75rem;line-height:1rem;font-weight:500;color:var(--color-primary-dark)}.s-order-branch-location{display:flex;min-height:3.5rem;flex-direction:column;align-items:stretch;justify-content:space-between;gap:1.5rem}@media (min-width: 768px){.s-order-branch-location{flex-direction:row;align-items:center}}.s-order-branch-identity{display:flex;min-width:0px;flex:1 1 0%;align-items:center;gap:0.75rem}.s-order-branch-store-icon{display:inline-flex;height:3rem;width:3rem;flex-shrink:0;align-items:center;justify-content:center;--tw-bg-opacity:1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1));font-size:1.5rem;line-height:2rem;color:var(--color-text-primary,#2b2d34)}.s-order-branch-store-icon svg{height:1em;width:1em;fill:currentColor}.s-order-branch-text{display:flex;min-width:0px;flex-direction:column;gap:0.25rem;text-align:start}.s-order-branch-name-row{display:flex;flex-wrap:wrap;align-items:center;gap:0.5rem}.s-order-branch-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:1rem;line-height:1.5rem;font-weight:500;line-height:1.5;color:var(--color-text-primary,#2b2d34)}.s-order-branch-address{overflow-wrap:break-word;font-size:0.75rem;line-height:1rem;line-height:1.5;color:var(--color-text-secondary,#666)}.s-order-branch-instructions{border-radius:0.5rem;padding:1rem;text-align:start}.s-order-branch-instructions-heading{margin-bottom:0.5rem;display:flex;align-items:center;gap:0.5rem;font-size:0.75rem;line-height:1rem;line-height:1.35}.s-order-branch-instructions-heading i{font-size:0.875rem;line-height:1.25rem;font-weight:700;--tw-text-opacity:1;color:rgb(0 0 0 / var(--tw-text-opacity, 1))}.s-order-branch-instructions-content{margin:0px;overflow-wrap:break-word;font-size:0.875rem;line-height:1.25rem;font-weight:600;line-height:1.6}.s-order-branch-actions{display:flex;flex-shrink:0;flex-wrap:wrap;align-items:center;gap:0.75rem}@media (min-width: 768px){.s-order-branch-actions{flex-wrap:nowrap}}.s-order-branch-map-link{display:inline-flex;min-height:2.25rem;align-items:center;justify-content:center;gap:0.5rem;white-space:nowrap;border-radius:0.375rem;border-width:1px;border-color:var(--color-primary);padding-left:0.875rem;padding-right:0.875rem;padding-top:0.5rem;padding-bottom:0.5rem;font-size:0.875rem;line-height:1.25rem;font-weight:700;line-height:1.25;color:var(--color-primary);text-decoration-line:none}.s-order-branch-action-icon{display:inline-flex;align-items:center;justify-content:center;font-size:0.875rem;line-height:1.25rem;color:currentColor}.s-order-branch-action-icon svg{height:1em;width:1em}.s-order-branch-cta{display:flex;flex-direction:column;gap:0.75rem}@media (min-width: 768px){.s-order-branch-cta{order:-1}}.s-order-branch-cta-text{display:flex;align-items:center;justify-content:space-between;gap:0.5rem;font-size:0.75rem;line-height:1rem}@media (min-width: 768px){.s-order-branch-cta-text{display:none}}.s-order-branch-cta-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--color-text-primary,#333)}.s-order-branch-cta-ready{flex-shrink:0;font-weight:700;color:var(--color-primary)}.s-order-branch-cta-link{display:inline-flex;min-height:2.5rem;width:100%;align-items:center;justify-content:center;gap:0.5rem;border-radius:0.375rem;background-color:var(--color-primary);padding-left:1rem;padding-right:1rem;padding-top:0.5rem;padding-bottom:0.5rem;font-size:0.875rem;line-height:1.25rem;font-weight:700;color:var(--color-primary-reverse);text-decoration-line:none}.s-order-branch-compact{display:flex;flex-direction:column;gap:1.5rem}.s-order-branch-map-link-wide{min-height:2.5rem;width:100%;border-radius:0.5rem;border-color:var(--color-border,#eee);color:var(--color-primary)}.s-thank-you-page-wrapper .s-order-branch-wrapper{margin-bottom:0px}.s-thank-you-page-wrapper .s-order-branch-address,.s-thank-you-page-wrapper .s-order-branch-cta-text{font-size:0.875rem;line-height:1.25rem}.s-thank-you-page-wrapper .s-order-branch-action-icon{font-size:1.25rem;line-height:1.75rem}.s-thank-you-page-wrapper .s-order-branch-cta-link,.s-thank-you-page-wrapper .s-order-branch-map-link-wide{min-height:3rem;font-size:1rem;line-height:1.5rem}.s-thank-you-page-wrapper .s-order-branch-store-icon{border-radius:0.5rem;border-width:1px;border-color:var(--color-border,#eee);background-color:transparent;color:var(--color-primary)}.s-thank-you-page-wrapper .s-order-branch-compact{gap:1rem}@media (min-width: 640px){.s-thank-you-page-wrapper .s-order-branch-compact{gap:1.5rem}}.s-thank-you-page-wrapper .s-order-branch-cta-text{flex-wrap:wrap;gap:0.5rem;font-size:0.875rem;line-height:1.25rem}";export{l as salla_order_branch}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as t,h as i,H as s,a as e}from"./p-C9zdeQFI.js";import{i as n}from"./p-DgheRYLY.js";import{W as o}from"./p-CgR-T_ZS.js";import{M as r}from"./p-DmgxDvXL.js";const a=class{constructor(i){t(this,i),this.hideTitle=!1,this.isHeader=!1,this.horizontal=!1,this.iconsOnly=!1,this.sdkContacts=null,this.iconsList={mobile:'\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>iphone</title>\n<path d="M15.053 27.613c0.133 0.12 0.28 0.213 0.44 0.28s0.333 0.107 0.507 0.107c0.36 0 0.693-0.135 0.947-0.387 0.12-0.135 0.213-0.28 0.28-0.44 0.080-0.16 0.107-0.333 0.107-0.507 0-0.347-0.147-0.695-0.387-0.947-0.507-0.493-1.387-0.493-1.893 0-0.12 0.12-0.213 0.267-0.28 0.44-0.067 0.16-0.107 0.333-0.107 0.507s0.040 0.347 0.107 0.507 0.16 0.305 0.28 0.44zM24 0h-16c-2.205 0-4 1.795-4 4v24c0 2.205 1.795 4 4 4h16c2.205 0 4-1.795 4-4v-24c0-2.205-1.795-4-4-4zM25.333 28c0 0.736-0.599 1.333-1.333 1.333h-16c-0.735 0-1.333-0.597-1.333-1.333v-4h18.667zM25.333 21.333h-18.667v-17.333c0-0.735 0.599-1.333 1.333-1.333h16c0.735 0 1.333 0.599 1.333 1.333z"></path>\n</svg>\n',whatsapp:o,phone:'\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>phone</title>\n<path d="M30.823 21.713l-3.883-3.883c-1.569-1.568-4.12-1.568-5.689 0l-2.568 2.568c-3.063-1.499-5.583-4.019-7.081-7.083l2.568-2.567c0.759-0.76 1.177-1.771 1.177-2.845s-0.419-2.084-1.179-2.844l-3.881-3.881c-1.52-1.521-4.171-1.521-5.689 0l-1.845 1.847c-2.22 2.219-3.183 5.407-2.573 8.527 1.98 10.144 10.125 18.292 20.269 20.271 0.616 0.121 1.236 0.18 1.849 0.18 2.492 0 4.896-0.972 6.677-2.752l1.847-1.847c1.568-1.571 1.568-4.121 0.001-5.691zM28.936 25.517l-1.845 1.847c-1.592 1.592-3.883 2.283-6.132 1.841-9.089-1.776-16.388-9.075-18.163-18.165-0.439-2.247 0.249-4.539 1.841-6.129l1.847-1.847c0.256-0.257 0.596-0.397 0.959-0.397s0.703 0.14 0.959 0.397l3.883 3.883c0.256 0.256 0.397 0.596 0.397 0.959s-0.141 0.703-0.397 0.96l-3.22 3.217c-0.383 0.384-0.496 0.959-0.287 1.457 1.813 4.339 5.343 7.868 9.683 9.684 0.497 0.207 1.073 0.095 1.457-0.288l3.22-3.22c0.529-0.529 1.389-0.528 1.917 0l3.881 3.883c0.528 0.529 0.528 1.389 0 1.919z"></path>\n</svg>\n',telegram:'\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>paper-plane-o</title>\n<path d="M31.5 0.482c0.375 0.268 0.554 0.696 0.482 1.143l-4.571 27.429c-0.054 0.339-0.268 0.625-0.571 0.804-0.161 0.089-0.357 0.143-0.554 0.143-0.143 0-0.286-0.036-0.429-0.089l-9.411-3.839-5.321 5.839c-0.214 0.25-0.518 0.375-0.839 0.375-0.143 0-0.286-0.018-0.411-0.071-0.446-0.179-0.732-0.607-0.732-1.071v-8.071l-8.429-3.446c-0.411-0.161-0.679-0.536-0.714-0.982-0.036-0.429 0.196-0.839 0.571-1.054l29.714-17.143c0.375-0.232 0.857-0.214 1.214 0.036zM25.393 27.25l3.946-23.625-25.607 14.768 6 2.446 15.411-11.411-8.536 14.232z"></path>\n</svg>\n',email:r}}componentWillLoad(){this.contactSlot=this.host.querySelector('[slot="contact"]')?.innerHTML}getTemplate(){return this.slotTemplate||this.contactSlot||this.getDefaultSlot()}getDefaultSlot(){return'<a href="{link}" aria-label="{value}" class="s-contacts-item"><span class="s-contacts-icon">{icon}</span>'+(this.iconsOnly?"":"<span class='unicode'>{value}</span>")+"</a>"}connectedCallback(){n()&&(this.langUnsubscribe=salla.lang.subscribe((()=>{this.contactsTitle&&this.contactsTitle!==this.langTitle||(this.contactsTitle=this.langTitle=salla.lang.get("blocks.footer.social"))}))),n()&&salla.onReady((()=>{this.sdkContacts=salla.config.get("store.contacts")}))}disconnectedCallback(){this.langUnsubscribe?.()}getContactsData(){return this.contacts||this.sdkContacts||{}}getContactsArray(){const t=Object.entries(this.getContactsData()).filter((([t,i])=>"string"==typeof i&&""!==i.trim()&&(null==this.channels||this.channels.split(",").map((t=>t.trim())).includes(t)))).map((([t,i])=>({type:t,value:i})));if(!this.iconsOnly)return t;const i=a.ICONS_ONLY_ORDER,s=t=>{const s=i.indexOf(t);return-1===s?i.length:s};return t.sort(((t,i)=>s(t.type)-s(i.type)))}getContactLink(t,i){switch(t){case"phone":case"mobile":return`tel:${i}`;case"whatsapp":const t=i.toString().replace(/[^\d]/g,"");return t?`https://wa.me/${t}`:n()?salla.url.get("whatsapp/send"):"";case"email":return`mailto:${i}`;case"telegram":return i.startsWith("https://t.me/")?i:`https://t.me/${i}`;default:return i}}getContactIcon(t){return this.iconsList[t]||""}componentDidRender(){this.host.querySelector('[slot="contact"]')?.remove()}render(){const t=this.getContactsArray();if(t&&0!==t.length)return this.isHeader?i(s,{class:"s-contacts s-contacts-header"},t.filter((t=>"phone"===t.type||"email"===t.type)).map(((t,s)=>i("a",{href:this.getContactLink(t.type,t.value),key:s,class:"s-contacts-topnav-link"},"email"===t.type?t.value:[i("span",null,this.contactsTitle,": "),i("span",{class:"unicode"},t.value)])))):i(s,{class:{"s-contacts":!0,"s-contacts-with-introduction":!!this.introduction}},this.introduction?i("p",{class:"s-contacts-introduction"},this.introduction):null,!this.hideTitle&&this.contactsTitle&&i("h3",{class:"s-contacts-title"},this.contactsTitle),i("div",{class:{"s-contacts-list":!0,"s-contacts-list-horizontal":this.horizontal,"s-contacts-list-vertical":!this.horizontal,"s-contacts-list-icons-only":this.iconsOnly}},t.map(((t,s)=>i("div",{key:s,id:"contact-slot",innerHTML:this.getTemplate().replace(/\{icon\}/g,this.getContactIcon(t.type)).replace(/\{value\}/g,t.value.toString()).replace(/\{link\}/g,this.getContactLink(t.type,t.value))})))))}get host(){return e(this)}};a.ICONS_ONLY_ORDER=["whatsapp","mobile","phone","telegram","email"],a.style='/*!twlt*/.unicode{unicode-bidi:plaintext}.static{position:static}.block{display:block}.contents{display:contents}.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-contacts-title{margin-bottom:0.75rem;font-size:1.125rem;line-height:1.75rem;font-weight:700}@media (min-width: 1024px){.s-contacts-title{margin-bottom:1.25rem}}.s-contacts-header{display:none;align-items:center}@media (min-width: 1024px){.s-contacts-header{display:flex}}.s-contacts-topnav-link{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-contacts-topnav-link:hover{opacity:0.8}.s-contacts-topnav-link:where([dir="ltr"],[dir="ltr"] *){border-right-width:1px}.s-contacts-topnav-link:last-child:where([dir="ltr"],[dir="ltr"] *){border-width:0px;padding-right:0px}.s-contacts-topnav-link:where([dir="rtl"],[dir="rtl"] *){border-left-width:1px}.s-contacts-topnav-link:last-child:where([dir="rtl"],[dir="rtl"] *){border-width:0px;padding-left:0px}.s-contacts-item{display:flex;align-items:center;font-size:0.875rem;line-height:1.25rem;line-height:1}.s-contacts-icon{display:flex;height:2rem;width:2rem;flex-shrink:0;align-items:center;justify-content:center;border-radius:9999px;border-width:1px}.s-contacts-icon:where([dir="ltr"],[dir="ltr"] *){margin-right:0.625rem}.s-contacts-icon:where([dir="rtl"],[dir="rtl"] *){margin-left:0.625rem}.s-contacts-icon svg{height:0.875rem;width:0.875rem;fill:currentColor}.s-contacts-list{display:flex;gap:1rem}.s-contacts-list-horizontal{align-items:center}.s-contacts-list-vertical{flex-direction:column}.s-contacts-list-icons-only .s-contacts-icon{margin-left:0px;margin-right:0px;height:2.5rem;width:2.5rem;border-radius:0.5rem;border-color:var(--color-border,#eee)}.s-contacts-list-icons-only{gap:0.5rem}.s-contacts-with-introduction{display:flex;flex-direction:column;align-items:center;gap:0.75rem;text-align:center}.s-contacts-introduction{margin:0px;font-size:0.875rem;line-height:1.25rem;color:var(--color-text-secondary,#666)}.s-contacts-with-introduction .s-contacts-icon{color:var(--color-primary)}.s-thank-you-page-wrapper .s-contacts-introduction{font-size:1rem;line-height:1.5rem}.s-thank-you-page-wrapper .s-contacts-icon svg{height:1.25rem;width:1.25rem}.s-thank-you-page-wrapper .s-contacts-with-introduction{gap:1rem}';export{a as salla_contacts}
4
+ import{r as t,h as i,H as s,a as e}from"./p-CrXKQnBu.js";import{i as n}from"./p-DgheRYLY.js";import{W as o}from"./p-CgR-T_ZS.js";import{M as r}from"./p-DmgxDvXL.js";const a=class{constructor(i){t(this,i),this.hideTitle=!1,this.isHeader=!1,this.horizontal=!1,this.iconsOnly=!1,this.sdkContacts=null,this.iconsList={mobile:'\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>iphone</title>\n<path d="M15.053 27.613c0.133 0.12 0.28 0.213 0.44 0.28s0.333 0.107 0.507 0.107c0.36 0 0.693-0.135 0.947-0.387 0.12-0.135 0.213-0.28 0.28-0.44 0.080-0.16 0.107-0.333 0.107-0.507 0-0.347-0.147-0.695-0.387-0.947-0.507-0.493-1.387-0.493-1.893 0-0.12 0.12-0.213 0.267-0.28 0.44-0.067 0.16-0.107 0.333-0.107 0.507s0.040 0.347 0.107 0.507 0.16 0.305 0.28 0.44zM24 0h-16c-2.205 0-4 1.795-4 4v24c0 2.205 1.795 4 4 4h16c2.205 0 4-1.795 4-4v-24c0-2.205-1.795-4-4-4zM25.333 28c0 0.736-0.599 1.333-1.333 1.333h-16c-0.735 0-1.333-0.597-1.333-1.333v-4h18.667zM25.333 21.333h-18.667v-17.333c0-0.735 0.599-1.333 1.333-1.333h16c0.735 0 1.333 0.599 1.333 1.333z"></path>\n</svg>\n',whatsapp:o,phone:'\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>phone</title>\n<path d="M30.823 21.713l-3.883-3.883c-1.569-1.568-4.12-1.568-5.689 0l-2.568 2.568c-3.063-1.499-5.583-4.019-7.081-7.083l2.568-2.567c0.759-0.76 1.177-1.771 1.177-2.845s-0.419-2.084-1.179-2.844l-3.881-3.881c-1.52-1.521-4.171-1.521-5.689 0l-1.845 1.847c-2.22 2.219-3.183 5.407-2.573 8.527 1.98 10.144 10.125 18.292 20.269 20.271 0.616 0.121 1.236 0.18 1.849 0.18 2.492 0 4.896-0.972 6.677-2.752l1.847-1.847c1.568-1.571 1.568-4.121 0.001-5.691zM28.936 25.517l-1.845 1.847c-1.592 1.592-3.883 2.283-6.132 1.841-9.089-1.776-16.388-9.075-18.163-18.165-0.439-2.247 0.249-4.539 1.841-6.129l1.847-1.847c0.256-0.257 0.596-0.397 0.959-0.397s0.703 0.14 0.959 0.397l3.883 3.883c0.256 0.256 0.397 0.596 0.397 0.959s-0.141 0.703-0.397 0.96l-3.22 3.217c-0.383 0.384-0.496 0.959-0.287 1.457 1.813 4.339 5.343 7.868 9.683 9.684 0.497 0.207 1.073 0.095 1.457-0.288l3.22-3.22c0.529-0.529 1.389-0.528 1.917 0l3.881 3.883c0.528 0.529 0.528 1.389 0 1.919z"></path>\n</svg>\n',telegram:'\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>paper-plane-o</title>\n<path d="M31.5 0.482c0.375 0.268 0.554 0.696 0.482 1.143l-4.571 27.429c-0.054 0.339-0.268 0.625-0.571 0.804-0.161 0.089-0.357 0.143-0.554 0.143-0.143 0-0.286-0.036-0.429-0.089l-9.411-3.839-5.321 5.839c-0.214 0.25-0.518 0.375-0.839 0.375-0.143 0-0.286-0.018-0.411-0.071-0.446-0.179-0.732-0.607-0.732-1.071v-8.071l-8.429-3.446c-0.411-0.161-0.679-0.536-0.714-0.982-0.036-0.429 0.196-0.839 0.571-1.054l29.714-17.143c0.375-0.232 0.857-0.214 1.214 0.036zM25.393 27.25l3.946-23.625-25.607 14.768 6 2.446 15.411-11.411-8.536 14.232z"></path>\n</svg>\n',email:r}}componentWillLoad(){this.contactSlot=this.host.querySelector('[slot="contact"]')?.innerHTML}getTemplate(){return this.slotTemplate||this.contactSlot||this.getDefaultSlot()}getDefaultSlot(){return'<a href="{link}" aria-label="{value}" class="s-contacts-item"><span class="s-contacts-icon">{icon}</span>'+(this.iconsOnly?"":"<span class='unicode'>{value}</span>")+"</a>"}connectedCallback(){n()&&(this.langUnsubscribe=salla.lang.subscribe((()=>{this.contactsTitle&&this.contactsTitle!==this.langTitle||(this.contactsTitle=this.langTitle=salla.lang.get("blocks.footer.social"))}))),n()&&salla.onReady((()=>{this.sdkContacts=salla.config.get("store.contacts")}))}disconnectedCallback(){this.langUnsubscribe?.()}getContactsData(){return this.contacts||this.sdkContacts||{}}getContactsArray(){const t=Object.entries(this.getContactsData()).filter((([t,i])=>"string"==typeof i&&""!==i.trim()&&(null==this.channels||this.channels.split(",").map((t=>t.trim())).includes(t)))).map((([t,i])=>({type:t,value:i})));if(!this.iconsOnly)return t;const i=a.ICONS_ONLY_ORDER,s=t=>{const s=i.indexOf(t);return-1===s?i.length:s};return t.sort(((t,i)=>s(t.type)-s(i.type)))}getContactLink(t,i){switch(t){case"phone":case"mobile":return`tel:${i}`;case"whatsapp":const t=i.toString().replace(/[^\d]/g,"");return t?`https://wa.me/${t}`:n()?salla.url.get("whatsapp/send"):"";case"email":return`mailto:${i}`;case"telegram":return i.startsWith("https://t.me/")?i:`https://t.me/${i}`;default:return i}}getContactIcon(t){return this.iconsList[t]||""}componentDidRender(){this.host.querySelector('[slot="contact"]')?.remove()}render(){const t=this.getContactsArray();if(t&&0!==t.length)return this.isHeader?i(s,{class:"s-contacts s-contacts-header"},t.filter((t=>"phone"===t.type||"email"===t.type)).map(((t,s)=>i("a",{href:this.getContactLink(t.type,t.value),key:s,class:"s-contacts-topnav-link"},"email"===t.type?t.value:[i("span",null,this.contactsTitle,": "),i("span",{class:"unicode"},t.value)])))):i(s,{class:{"s-contacts":!0,"s-contacts-with-introduction":!!this.introduction}},this.introduction?i("p",{class:"s-contacts-introduction"},this.introduction):null,!this.hideTitle&&this.contactsTitle&&i("h3",{class:"s-contacts-title"},this.contactsTitle),i("div",{class:{"s-contacts-list":!0,"s-contacts-list-horizontal":this.horizontal,"s-contacts-list-vertical":!this.horizontal,"s-contacts-list-icons-only":this.iconsOnly}},t.map(((t,s)=>i("div",{key:s,id:"contact-slot",innerHTML:this.getTemplate().replace(/\{icon\}/g,this.getContactIcon(t.type)).replace(/\{value\}/g,t.value.toString()).replace(/\{link\}/g,this.getContactLink(t.type,t.value))})))))}get host(){return e(this)}};a.ICONS_ONLY_ORDER=["whatsapp","mobile","phone","telegram","email"],a.style='/*!twlt*/.unicode{unicode-bidi:plaintext}.static{position:static}.block{display:block}.contents{display:contents}.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-contacts-title{margin-bottom:0.75rem;font-size:1.125rem;line-height:1.75rem;font-weight:700}@media (min-width: 1024px){.s-contacts-title{margin-bottom:1.25rem}}.s-contacts-header{display:none;align-items:center}@media (min-width: 1024px){.s-contacts-header{display:flex}}.s-contacts-topnav-link{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-contacts-topnav-link:hover{opacity:0.8}.s-contacts-topnav-link:where([dir="ltr"],[dir="ltr"] *){border-right-width:1px}.s-contacts-topnav-link:last-child:where([dir="ltr"],[dir="ltr"] *){border-width:0px;padding-right:0px}.s-contacts-topnav-link:where([dir="rtl"],[dir="rtl"] *){border-left-width:1px}.s-contacts-topnav-link:last-child:where([dir="rtl"],[dir="rtl"] *){border-width:0px;padding-left:0px}.s-contacts-item{display:flex;align-items:center;font-size:0.875rem;line-height:1.25rem;line-height:1}.s-contacts-icon{display:flex;height:2rem;width:2rem;flex-shrink:0;align-items:center;justify-content:center;border-radius:9999px;border-width:1px}.s-contacts-icon:where([dir="ltr"],[dir="ltr"] *){margin-right:0.625rem}.s-contacts-icon:where([dir="rtl"],[dir="rtl"] *){margin-left:0.625rem}.s-contacts-icon svg{height:0.875rem;width:0.875rem;fill:currentColor}.s-contacts-list{display:flex;gap:1rem}.s-contacts-list-horizontal{align-items:center}.s-contacts-list-vertical{flex-direction:column}.s-contacts-list-icons-only .s-contacts-icon{margin-left:0px;margin-right:0px;height:2.5rem;width:2.5rem;border-radius:0.5rem;border-color:var(--color-border,#eee)}.s-contacts-list-icons-only{gap:0.5rem}.s-contacts-with-introduction{display:flex;flex-direction:column;align-items:center;gap:0.75rem;text-align:center}.s-contacts-introduction{margin:0px;font-size:0.875rem;line-height:1.25rem;color:var(--color-text-secondary,#666)}.s-contacts-with-introduction .s-contacts-icon{color:var(--color-primary)}.s-thank-you-page-wrapper .s-contacts-introduction{font-size:1rem;line-height:1.5rem}.s-thank-you-page-wrapper .s-contacts-icon svg{height:1.25rem;width:1.25rem}.s-thank-you-page-wrapper .s-contacts-with-introduction{gap:1rem}';export{a as salla_contacts}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as i,h as s,H as t}from"./p-C9zdeQFI.js";import{H as r}from"./p-00vBRoH3.js";import{H as e}from"./p-JGEddAgs.js";const a=class{constructor(s){i(this,s),this.isEnabled=!1,this.wishlistCount=0,this.wishlistLabel=salla.lang.get("common.titles.wishlist"),salla.wishlist.event.onAdded((()=>this.syncCount())),salla.wishlist.event.onRemoved((()=>this.syncCount())),salla.event.on("wishlist::storage.synced",(()=>this.syncCount()))}componentWillLoad(){return new Promise((i=>salla.onReady((()=>{const s=e.getPlanName();this.isEnabled=!!s&&["basic","plus"].includes(s),this.syncCount(),i()}))))}syncCount(){this.wishlistCount=(salla.storage.get("salla::wishlist",[])||[]).length}render(){const i=salla.config.isGuest();return!this.isEnabled||i?s(t,{hidden:!0}):s(t,null,s("a",{class:"s-wishlist-summary-wrapper",href:salla.url.get("account/wishlist"),"aria-label":this.wishlistLabel},s("i",{class:"s-wishlist-summary-icon",innerHTML:r}),this.wishlistCount>0&&s("span",{class:"s-wishlist-summary-count"},salla.helpers.number(this.wishlistCount))))}};a.style='/*!twlt*/:host{display:inline-flex;align-items:center;margin-inline-start:1rem}.hidden{display:none}.s-wishlist-summary-wrapper{position:relative;margin-inline-start:0.75rem;display:inline-flex;align-items:center;border-style:none;text-decoration-line:none;outline:2px solid transparent;outline-offset:2px;transition-property:opacity;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:200ms}.s-wishlist-summary-wrapper:hover{opacity:0.8}.s-wishlist-summary-icon{display:inline-flex;height:2.5rem;width:2.5rem;align-items:center;justify-content:center;border-radius:9999px;border-width:1px;border-color:var(--color-border,#e5e7eb);color:var(--color-text-primary,#374151)}.s-wishlist-summary-icon svg{height:1.25rem;width:1.25rem;fill:currentColor}.s-wishlist-summary-count{position:absolute;top:-4px;left:-6px;display:inline-flex;height:1.25rem;width:1.25rem;align-items:center;justify-content:center;border-radius:9999px;--tw-bg-opacity:1;background-color:rgb(248 113 113 / var(--tw-bg-opacity, 1));padding:0.25rem;font-size:0.75rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.s-wishlist-summary-count:where([dir="rtl"],[dir="rtl"] *){left:unset;right:-6px}';export{a as salla_wishlist_summary}
4
+ import{r as i,h as s,H as t}from"./p-CrXKQnBu.js";import{H as r}from"./p-00vBRoH3.js";import{H as e}from"./p-BUzdlb7Q.js";const a=class{constructor(s){i(this,s),this.isEnabled=!1,this.wishlistCount=0,this.wishlistLabel=salla.lang.get("common.titles.wishlist"),salla.wishlist.event.onAdded((()=>this.syncCount())),salla.wishlist.event.onRemoved((()=>this.syncCount())),salla.event.on("wishlist::storage.synced",(()=>this.syncCount()))}componentWillLoad(){return new Promise((i=>salla.onReady((()=>{const s=e.getPlanName();this.isEnabled=!!s&&["basic","plus"].includes(s),this.syncCount(),i()}))))}syncCount(){this.wishlistCount=(salla.storage.get("salla::wishlist",[])||[]).length}render(){const i=salla.config.isGuest();return!this.isEnabled||i?s(t,{hidden:!0}):s(t,null,s("a",{class:"s-wishlist-summary-wrapper",href:salla.url.get("account/wishlist"),"aria-label":this.wishlistLabel},s("i",{class:"s-wishlist-summary-icon",innerHTML:r}),this.wishlistCount>0&&s("span",{class:"s-wishlist-summary-count"},salla.helpers.number(this.wishlistCount))))}};a.style='/*!twlt*/:host{display:inline-flex;align-items:center;margin-inline-start:1rem}.hidden{display:none}.s-wishlist-summary-wrapper{position:relative;margin-inline-start:0.75rem;display:inline-flex;align-items:center;border-style:none;text-decoration-line:none;outline:2px solid transparent;outline-offset:2px;transition-property:opacity;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:200ms}.s-wishlist-summary-wrapper:hover{opacity:0.8}.s-wishlist-summary-icon{display:inline-flex;height:2.5rem;width:2.5rem;align-items:center;justify-content:center;border-radius:9999px;border-width:1px;border-color:var(--color-border,#e5e7eb);color:var(--color-text-primary,#374151)}.s-wishlist-summary-icon svg{height:1.25rem;width:1.25rem;fill:currentColor}.s-wishlist-summary-count{position:absolute;top:-4px;left:-6px;display:inline-flex;height:1.25rem;width:1.25rem;align-items:center;justify-content:center;border-radius:9999px;--tw-bg-opacity:1;background-color:rgb(248 113 113 / var(--tw-bg-opacity, 1));padding:0.25rem;font-size:0.75rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.s-wishlist-summary-count:where([dir="rtl"],[dir="rtl"] *){left:unset;right:-6px}';export{a as salla_wishlist_summary}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as e,h as t,a}from"./p-C9zdeQFI.js";const i=class{constructor(t){e(this,t),this.hasError=!1}connectedCallback(){this.sizeGuideOpenListener=e=>this.open(e),salla.event.on("size-guide::open",this.sizeGuideOpenListener),this.langUnsubscribe=salla.lang.subscribe((()=>{this.placeholder_title=salla.lang.get("pages.products.size_guide_placeholder"),this.placeholder_description=salla.lang.get("pages.products.size_guide_placeholder_info"),this.modal_title=salla.lang.get("pages.products.size_guides")}))}disconnectedCallback(){salla.event.off("size-guide::open",this.sizeGuideOpenListener),this.langUnsubscribe?.()}async open(e){return this.modal.setTitle(this.modal_title),this.modal.open(),await salla.api.withoutNotifier((()=>salla.product.getSizeGuides(e))).then((e=>{this.guides=e.data})).catch((e=>{console.log(e),this.hasError=!0,this.placeholder_description=e.response?.data?.error?.message||e.response?.data})).finally((()=>this.modal.stopLoading()))}async close(){return this.modal.close()}showPlaceholder(){return t("salla-placeholder",{alignment:"center",iconSize:"xl"},t("div",{slot:"title"},this.placeholder_title),t("div",{slot:"description"},this.placeholder_description))}render(){return t("salla-modal",{key:"31195e037abff8654af838c6c87ba5e52646afe2",class:"s-product-size-guide-wrapper",id:"salla-product-size-guide-modal",isLoading:!0,"has-skeleton":!0,width:"md",ref:e=>this.modal=e},t("span",{key:"586f60a7466f2f9d167f5861357f4337b325e706",slot:"icon",class:"s-product-size-guide-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>pencil-ruler</title>\n<path d="M3.057 11.609c0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391l6.667-6.667c0.521-0.521 0.521-1.364 0-1.885l-1.285-1.285c-1.143-1.143-2.661-1.772-4.276-1.772-1.616 0-3.135 0.629-4.276 1.772-1.143 1.141-1.772 2.66-1.772 4.276 0 1.615 0.629 3.135 1.772 4.276zM3.657 3.657c1.277-1.277 3.504-1.277 4.781 0l0.343 0.343-4.781 4.781-0.343-0.343c-0.639-0.639-0.991-1.488-0.991-2.391s0.352-1.752 0.991-2.391zM29.317 20.972c-0.2-0.707-0.932-1.119-1.645-0.921-0.709 0.2-1.121 0.937-0.921 1.645l1.987 7.041-7.041-1.987c-0.707-0.195-1.444 0.213-1.645 0.921-0.2 0.708 0.212 1.445 0.921 1.645l9.333 2.633c0.119 0.032 0.24 0.049 0.361 0.049 0.349 0 0.689-0.137 0.943-0.391 0.341-0.341 0.472-0.84 0.34-1.305zM31.609 8.772l-8.381-8.381c-0.5-0.5-1.385-0.5-1.885 0l-8.171 8.171s-0.001 0-0.001 0.001 0 0.001-0.001 0.001l-4.607 4.607s0 0-0.001 0 0 0 0 0.001l-8.171 8.171c-0.251 0.249-0.391 0.588-0.391 0.943 0 0.353 0.14 0.693 0.391 0.943l8.381 8.381c0.249 0.251 0.589 0.391 0.943 0.391s0.693-0.14 0.943-0.391l20.952-20.952c0.521-0.521 0.521-1.365 0-1.885zM9.715 28.781l-6.495-6.496 1.676-1.676 1.851 1.851c0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391c0.521-0.521 0.521-1.364 0-1.885l-1.851-1.851 2.724-2.724 3.008 3.008c0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391c0.521-0.521 0.521-1.364 0-1.885l-3.008-3.008 2.724-2.724 1.851 1.851c0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391c0.521-0.52 0.521-1.364 0-1.885l-1.851-1.851 2.724-2.724 3.008 3.008c0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391c0.521-0.521 0.521-1.365 0-1.885l-3.008-3.008 1.677-1.677 6.496 6.496z"></path>\n</svg>\n'}),t("div",{key:"0e129703a53a4de9a280d067600991ef6d020f59",slot:"loading"},t("div",{key:"7937b1e2525437aba3e0d25987678ffe0bfaec06",class:"s-product-size-guide-skeleton"},t("salla-skeleton",{key:"03201726c4817b1a61dc9d0a6b5076d33e8d5abe",height:"15px",width:"25%"}),t("div",{key:"bb71cdf3ee7b1d82fab177be16c65bb15f46af35",class:"s-product-size-guide-skeleton-header"},t("salla-skeleton",{key:"1dabafdfb70285a313024c4481da2b8d82d2706a",height:"40px"}),t("salla-skeleton",{key:"d858a2795a8f2e9b92fe74b435acab70cde9cf79",height:"40px"}),t("salla-skeleton",{key:"aa02427470f7b1614d7900e8eed981a91da80dd7",height:"40px"}),t("salla-skeleton",{key:"fee729b4620c49cb2d869851dfdfbd3f56713b2b",height:"40px"})),t("div",{key:"acac2ba31051539ce1d7a86cbb54b0a95d672716",class:"s-product-size-guide-skeleton-content"},t("salla-skeleton",{key:"950bac6b9532c876a9b19fe7eb614218d8eabed1",height:"15px",width:"25%"}),t("salla-skeleton",{key:"3a03a7cee62ff565c38dbd4cac10b155841a4a17",height:"10px",width:"75%"}),t("salla-skeleton",{key:"731c5f9191b4133d35d32914063ab5ee207160a5",height:"10px",width:"50%"}),t("salla-skeleton",{key:"ecf3a698f63110937102b881ed8888bffc1aff6f",height:"10px",width:"75%"}),t("salla-skeleton",{key:"52d88576752037bcf9878a8527aa3d083f5d0e89",height:"10px",width:"100%"}),t("salla-skeleton",{key:"9b1274d4c5e9d997b1fa23005ca8a07b0d067574",height:"10px",width:"25%"}),t("salla-skeleton",{key:"15c28ca15f44c71417c6ad340303eed09bd33752",height:"10px",width:"60%"}),t("salla-skeleton",{key:"dcf626b475fbe54ed2d8c678261d7e98e4640c42",height:"10px",width:"45%"}),t("salla-skeleton",{key:"b242994920b6f079b0d0aa582f92fa85e8ff355a",height:"10px",width:"30%"})))),t("slot",{key:"d8f52fa5454c208364e1d062dc102c628945318a",name:"header"}),!this.hasError&&this.guides?[t("salla-tabs",{activeTab:this.guides[0]?.name},this.guides.map((e=>t("salla-tab-header",{slot:"header",name:e.name},t("span",null,e.name)))),this.guides.map((e=>t("salla-tab-content",{slot:"content",name:e.name},t("div",{innerHTML:e.description})))))]:this.showPlaceholder(),t("slot",{key:"1a0d9d1a01e18e5bd1c610dac92654f53c2dcad4",name:"footer"}))}get host(){return a(this)}};i.style='/*!twlt*/.s-product-size-guide-wrapper .s-modal-title{margin-bottom:0px !important}.s-product-size-guide-wrapper .s-tabs-content{max-height:60vh;overflow:auto}@media (min-width: 768px){.s-product-size-guide-wrapper .s-tabs-content{max-height:70vh}}.s-product-size-guide-placeholder{display:flex;align-items:center;justify-content:center}.s-product-size-guide-skeleton-table{margin-top:1.25rem;width:100%;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));line-height:1.25rem}.s-product-size-guide-skeleton-table td{border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));padding:0.5rem;line-height:1.25rem}.s-product-size-guide-header-icon{display:inline-flex;height:3rem;width:3rem;align-items:center;justify-content:center;border-radius:9999px;border-width:1px;border-style:solid;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}@media (min-width: 640px){.s-product-size-guide-header-icon{margin-left:auto;margin-right:auto;margin-bottom:1rem;height:5rem;width:5rem}}.s-product-size-guide-header-icon:where([dir="ltr"],[dir="ltr"] *){margin-right:0.5rem}@media (min-width: 640px){.s-product-size-guide-header-icon:where([dir="ltr"],[dir="ltr"] *){margin-right:0px}}.s-product-size-guide-header-icon:where([dir="rtl"],[dir="rtl"] *){margin-left:0.5rem}@media (min-width: 640px){.s-product-size-guide-header-icon:where([dir="rtl"],[dir="rtl"] *){margin-left:0px}}.s-product-size-guide-header-icon svg{height:1.25rem;width:1.25rem;flex-shrink:0;fill:#9ca3af}.s-product-size-guide-skeleton-content{margin-top:1.25rem;display:flex;flex-direction:column}.s-product-size-guide-skeleton-content>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(0.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(0.75rem * var(--tw-space-y-reverse))}.s-product-size-guide-skeleton-header{margin-top:2rem;margin-bottom:2rem;display:flex;align-items:center;justify-content:space-between}.s-product-size-guide-skeleton-header>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(1.25rem * var(--tw-space-x-reverse));margin-left:calc(1.25rem * calc(1 - var(--tw-space-x-reverse)))}.s-product-size-guide-skeleton-header:where([dir="rtl"],[dir="rtl"] *)>:not([hidden])~:not([hidden]){--tw-space-x-reverse:1}.s-product-size-guide-skeleton-header>salla-skeleton{flex:1 1 0%}';export{i as salla_product_size_guide}
4
+ import{r as e,h as t,a}from"./p-CrXKQnBu.js";const i=class{constructor(t){e(this,t),this.hasError=!1}connectedCallback(){this.sizeGuideOpenListener=e=>this.open(e),salla.event.on("size-guide::open",this.sizeGuideOpenListener),this.langUnsubscribe=salla.lang.subscribe((()=>{this.placeholder_title=salla.lang.get("pages.products.size_guide_placeholder"),this.placeholder_description=salla.lang.get("pages.products.size_guide_placeholder_info"),this.modal_title=salla.lang.get("pages.products.size_guides")}))}disconnectedCallback(){salla.event.off("size-guide::open",this.sizeGuideOpenListener),this.langUnsubscribe?.()}async open(e){return this.modal.setTitle(this.modal_title),this.modal.open(),await salla.api.withoutNotifier((()=>salla.product.getSizeGuides(e))).then((e=>{this.guides=e.data})).catch((e=>{console.log(e),this.hasError=!0,this.placeholder_description=e.response?.data?.error?.message||e.response?.data})).finally((()=>this.modal.stopLoading()))}async close(){return this.modal.close()}showPlaceholder(){return t("salla-placeholder",{alignment:"center",iconSize:"xl"},t("div",{slot:"title"},this.placeholder_title),t("div",{slot:"description"},this.placeholder_description))}render(){return t("salla-modal",{key:"949a60f0becc6594358c20215c86564c9f96a5b2",class:"s-product-size-guide-wrapper",id:"salla-product-size-guide-modal",isLoading:!0,"has-skeleton":!0,width:"md",ref:e=>this.modal=e},t("span",{key:"a250df4a45be84188ce9875c969d544baee4aba8",slot:"icon",class:"s-product-size-guide-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>pencil-ruler</title>\n<path d="M3.057 11.609c0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391l6.667-6.667c0.521-0.521 0.521-1.364 0-1.885l-1.285-1.285c-1.143-1.143-2.661-1.772-4.276-1.772-1.616 0-3.135 0.629-4.276 1.772-1.143 1.141-1.772 2.66-1.772 4.276 0 1.615 0.629 3.135 1.772 4.276zM3.657 3.657c1.277-1.277 3.504-1.277 4.781 0l0.343 0.343-4.781 4.781-0.343-0.343c-0.639-0.639-0.991-1.488-0.991-2.391s0.352-1.752 0.991-2.391zM29.317 20.972c-0.2-0.707-0.932-1.119-1.645-0.921-0.709 0.2-1.121 0.937-0.921 1.645l1.987 7.041-7.041-1.987c-0.707-0.195-1.444 0.213-1.645 0.921-0.2 0.708 0.212 1.445 0.921 1.645l9.333 2.633c0.119 0.032 0.24 0.049 0.361 0.049 0.349 0 0.689-0.137 0.943-0.391 0.341-0.341 0.472-0.84 0.34-1.305zM31.609 8.772l-8.381-8.381c-0.5-0.5-1.385-0.5-1.885 0l-8.171 8.171s-0.001 0-0.001 0.001 0 0.001-0.001 0.001l-4.607 4.607s0 0-0.001 0 0 0 0 0.001l-8.171 8.171c-0.251 0.249-0.391 0.588-0.391 0.943 0 0.353 0.14 0.693 0.391 0.943l8.381 8.381c0.249 0.251 0.589 0.391 0.943 0.391s0.693-0.14 0.943-0.391l20.952-20.952c0.521-0.521 0.521-1.365 0-1.885zM9.715 28.781l-6.495-6.496 1.676-1.676 1.851 1.851c0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391c0.521-0.521 0.521-1.364 0-1.885l-1.851-1.851 2.724-2.724 3.008 3.008c0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391c0.521-0.521 0.521-1.364 0-1.885l-3.008-3.008 2.724-2.724 1.851 1.851c0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391c0.521-0.52 0.521-1.364 0-1.885l-1.851-1.851 2.724-2.724 3.008 3.008c0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391c0.521-0.521 0.521-1.365 0-1.885l-3.008-3.008 1.677-1.677 6.496 6.496z"></path>\n</svg>\n'}),t("div",{key:"5a3e827e8223a846f7b33372c4550144802bfd5d",slot:"loading"},t("div",{key:"77c24101a09e4ef97deed4a74e07e704300bffeb",class:"s-product-size-guide-skeleton"},t("salla-skeleton",{key:"a4803f830e8c682a299df76a4a16b2ad38a031d5",height:"15px",width:"25%"}),t("div",{key:"fa7bb72254eaa88670b0625244a19e8718cdc19c",class:"s-product-size-guide-skeleton-header"},t("salla-skeleton",{key:"90e41d1cba2dc9adc9730e9c84a0703dd222ec2c",height:"40px"}),t("salla-skeleton",{key:"09042f1818dd7bc5e03bb21adcbd7ea0a247287b",height:"40px"}),t("salla-skeleton",{key:"36e3a8804cebc939cf3e7d595f42b0ab145a8906",height:"40px"}),t("salla-skeleton",{key:"c0517ad2fad0e2a120af65a67524e8e368bcbbbe",height:"40px"})),t("div",{key:"72277a6e5717cb6f46b7d4ca00315e3fc6323840",class:"s-product-size-guide-skeleton-content"},t("salla-skeleton",{key:"a8fc7c88dfba933765c59e94efd6f57975d384d3",height:"15px",width:"25%"}),t("salla-skeleton",{key:"7f551c7e5851080aad5147ad026700ade3d4f729",height:"10px",width:"75%"}),t("salla-skeleton",{key:"4690828dd0204b6682658093ddcd782b7d7808cf",height:"10px",width:"50%"}),t("salla-skeleton",{key:"cfbc0911430d4f0f86fbd23f7a2cb795997f9ead",height:"10px",width:"75%"}),t("salla-skeleton",{key:"5dc89933c85eda48afb6d71755e5e810644b25dd",height:"10px",width:"100%"}),t("salla-skeleton",{key:"a87d5c8c088241516fb5a1e3f09a3c2f31231fe3",height:"10px",width:"25%"}),t("salla-skeleton",{key:"e103932b5300849c43b141d0551cb69291e7ebdd",height:"10px",width:"60%"}),t("salla-skeleton",{key:"7ebf1a7aa02eae1bca9aafd06b0b85bc8c188ef1",height:"10px",width:"45%"}),t("salla-skeleton",{key:"25e82e97bf169c5757bd02139160cf6b75efb993",height:"10px",width:"30%"})))),t("slot",{key:"36fe07ad56643fb92b517c4bf92424a893c7ba9b",name:"header"}),!this.hasError&&this.guides?[t("salla-tabs",{activeTab:this.guides[0]?.name},this.guides.map((e=>t("salla-tab-header",{slot:"header",name:e.name},t("span",null,e.name)))),this.guides.map((e=>t("salla-tab-content",{slot:"content",name:e.name},t("div",{innerHTML:e.description})))))]:this.showPlaceholder(),t("slot",{key:"4b6c6a747d398416f814e316fcb97db5281237a5",name:"footer"}))}get host(){return a(this)}};i.style='/*!twlt*/.s-product-size-guide-wrapper .s-modal-title{margin-bottom:0px !important}.s-product-size-guide-wrapper .s-tabs-content{max-height:60vh;overflow:auto}@media (min-width: 768px){.s-product-size-guide-wrapper .s-tabs-content{max-height:70vh}}.s-product-size-guide-placeholder{display:flex;align-items:center;justify-content:center}.s-product-size-guide-skeleton-table{margin-top:1.25rem;width:100%;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));line-height:1.25rem}.s-product-size-guide-skeleton-table td{border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));padding:0.5rem;line-height:1.25rem}.s-product-size-guide-header-icon{display:inline-flex;height:3rem;width:3rem;align-items:center;justify-content:center;border-radius:9999px;border-width:1px;border-style:solid;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}@media (min-width: 640px){.s-product-size-guide-header-icon{margin-left:auto;margin-right:auto;margin-bottom:1rem;height:5rem;width:5rem}}.s-product-size-guide-header-icon:where([dir="ltr"],[dir="ltr"] *){margin-right:0.5rem}@media (min-width: 640px){.s-product-size-guide-header-icon:where([dir="ltr"],[dir="ltr"] *){margin-right:0px}}.s-product-size-guide-header-icon:where([dir="rtl"],[dir="rtl"] *){margin-left:0.5rem}@media (min-width: 640px){.s-product-size-guide-header-icon:where([dir="rtl"],[dir="rtl"] *){margin-left:0px}}.s-product-size-guide-header-icon svg{height:1.25rem;width:1.25rem;flex-shrink:0;fill:#9ca3af}.s-product-size-guide-skeleton-content{margin-top:1.25rem;display:flex;flex-direction:column}.s-product-size-guide-skeleton-content>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(0.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(0.75rem * var(--tw-space-y-reverse))}.s-product-size-guide-skeleton-header{margin-top:2rem;margin-bottom:2rem;display:flex;align-items:center;justify-content:space-between}.s-product-size-guide-skeleton-header>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(1.25rem * var(--tw-space-x-reverse));margin-left:calc(1.25rem * calc(1 - var(--tw-space-x-reverse)))}.s-product-size-guide-skeleton-header:where([dir="rtl"],[dir="rtl"] *)>:not([hidden])~:not([hidden]){--tw-space-x-reverse:1}.s-product-size-guide-skeleton-header>salla-skeleton{flex:1 1 0%}';export{i as salla_product_size_guide}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as t,h as e,H as a}from"./p-C9zdeQFI.js";const r=class{constructor(e){t(this,e),this.transactionsArray=[],this.isLoading=!1,this.nextPageUrl="",this.requestSeq=0,this.handleClick=()=>{this.isLoading||this.loadMoreTransactions()},this.handleGiftCardRedeemed=()=>{this.loadTransactions()}}componentWillLoad(){return salla.onReady().then((()=>this.loadTransactions()))}normalizeTransactions(t){if(Array.isArray(t))return{list:t,nextPageUrl:""};const e=t?.current_page??1,a=e<(t?.last_page??e)?`/balance/wallet?per_page=${t?.per_page??10}&page=${e+1}`:"";return{list:t?.data??[],nextPageUrl:a}}loadTransactions(){return this.fetchTransactions("/balance/wallet?per_page=10&page=1",!1)}loadMoreTransactions(){return this.fetchTransactions(this.nextPageUrl||"/balance/wallet?page=2&per_page=10",!0)}async fetchTransactions(t,e){const a=++this.requestSeq;this.isLoading=!0;try{const r=await salla.api.request(t);if(a!==this.requestSeq)return;const{list:l,nextPageUrl:i}=this.normalizeTransactions(r.data.transactions);this.nextPageUrl=i,this.transactionsArray=e?[...this.transactionsArray,...l]:l,this.balance=r.data.balance}catch(t){if(a!==this.requestSeq)return;console.error("Error loading wallet transactions",t)}finally{a===this.requestSeq&&(this.isLoading=!1)}}formatDate(t){return t?new Date(1e3*t).toLocaleDateString(salla.lang.locale,{weekday:"long",year:"numeric",month:"long",day:"numeric",hour:"numeric"}):""}renderCell(t,a){return e("td",{class:"s-wallet-table-tbody-tr-td"},e("div",{class:"s-wallet-table-tbody-tr-td-content"},e("span",{class:"s-wallet-mobile-title"},salla.lang.get(`pages.wallet.${t}`),":"),a))}isCredit(t){return"debit"!==t.transaction_type}renderSummary(){return e("div",{class:"s-wallet-summary"},e("div",{class:"s-wallet-balance-card"},e("span",{class:"s-wallet-balance-mark"},e("i",{class:"sicon-wallet","aria-hidden":"true"})),e("div",{class:"s-wallet-balance-figure",innerHTML:salla.money(this.balance)}),e("div",{class:"s-wallet-balance-label"},salla.lang.get("pages.wallet.balance"))),e("salla-gift-card-redeem",{onGiftCardRedeemed:this.handleGiftCardRedeemed}))}render(){return this.transactionsArray.length>0?e(a,null,this.renderSummary(),e("h2",{style:{"margin-top":"32px"}},salla.lang.get("pages.wallet.title")),e("table",{class:"s-wallet-table"},e("thead",{class:"s-wallet-table-head"},e("tr",{class:"s-wallet-table-head-tr"},e("th",{scope:"col"},salla.lang.get("pages.wallet.transaction_number")),e("th",{scope:"col",class:"s-wallet-table-head-tr-th"},salla.lang.get("pages.wallet.amount")),e("th",{scope:"col",class:"s-wallet-table-head-tr-th"},salla.lang.get("pages.wallet.date")),e("th",{scope:"col",class:"s-wallet-table-head-tr-th"},salla.lang.get("pages.wallet.order_no")),e("th",{scope:"col",class:"s-wallet-table-head-tr-th"},salla.lang.get("pages.wallet.expiry_date")),e("th",{scope:"col",class:"s-wallet-table-head-tr-th"},salla.lang.get("pages.wallet.transaction_type")," "))),e("tbody",{class:"s-wallet-table-tbody"},this.transactionsArray.map((t=>e("tr",{class:"s-wallet-table-tbody-tr s-wallet-table-tbody-tr-shadow animated"},this.renderCell("transaction_number",[t.id&&e("span",{class:"hidden md:inline-block"},"#",t.id),e("div",{class:"flex items-center md:hidden"},e("salla-button",{class:"relative",color:"dark",shape:"link","data-content":t.order_id},t.order_id&&e("span",null,"#",t.order_id)))]),this.renderCell("amount",e("div",{class:{"s-wallet-amount":!0,"s-wallet-amount-credit":this.isCredit(t),"s-wallet-amount-debit":!this.isCredit(t)}},e("span",{class:"s-wallet-amount-sign"},this.isCredit(t)?"+":"-"),e("span",{innerHTML:salla.money(t.amount)}))),this.renderCell("date",this.formatDate(t.created_at)),this.renderCell("order_no",e("span",{class:"rtl:mr-auto ltr:ml-auto md:mx-0"},t.order_id&&e("span",null,"#",t.order_id))),this.renderCell("expiry_date",e("span",null,this.formatDate(t.expired_at))),this.renderCell("transaction_type",e("div",{class:"s-wallet-transaction-type"},!!t.description&&[e("i",{id:t.id.toString(),class:"sicon-information text-lg rtl:ml-4 ltr:mr-4 s-wallet-table-transaction-status-icon-success"}),e("salla-tooltip",{text:t.description,targetId:t.id.toString()})],e("span",null,t.title)))))))),e("div",{class:"s-infinite-scroll-wrapper"},!!this.nextPageUrl&&e("salla-button",{onClick:this.handleClick,loading:this.isLoading},salla.lang.get("common.elements.load_more")))):e(a,null,this.renderSummary(),e("h2",{style:{"margin-top":"32px"}},salla.lang.get("pages.wallet.title")),e("div",{class:"s-wallet-table-empty-state"},e("i",{class:"sicon-full-wallet"}),e("div",{class:"text-center p-3 text-xl font-bold "},salla.lang.get("pages.wallet.no_transactions")),e("div",{class:"text-center text-gray-400 text-sm font-normal "},salla.lang.get("pages.wallet.zero_balance")," ")))}};r.style='/*!twlt*/@charset "UTF-8";.s-wallet-table{min-width:100%}.s-wallet-table-balance-container{display:flex !important;align-items:center !important;justify-content:flex-start !important;gap:1rem}.s-wallet-table-balance-icon{border-radius:50%;width:52px;height:52px;font-size:25px;padding:16px 13px;background:var(--color-primary-reverse);color:var(--color-primary)}.s-wallet-table-empty-state{display:flex;flex-direction:column;align-items:center}.s-wallet-table-empty-state i{font-size:80px;margin:4rem 0 2rem;color:var(--infinte-color)}.s-wallet-table-transaction-status{padding:6px 19px !important;border-radius:20px;width:max-content;display:flex;align-items:center}.s-wallet-table-transaction-status-default{background:#fff6eb;color:#a46f29}.s-wallet-table-transaction-status-cashback{background:#effbf6;color:#00af6c}.s-wallet-table-transaction-status-refund{background:#ecf3fe;color:#5196f3}.s-wallet-table-transaction-status-purchase{background:#feecec;color:#f55157}.s-wallet-table-transaction-status-icons-success{color:#00af6c}.s-wallet-summary{display:flex;align-items:stretch;gap:16px;margin-bottom:28px}.s-wallet-balance-card{flex:0 0 34%;max-width:240px;background:#fff;border-radius:12px;padding:20px;box-sizing:border-box}.s-wallet-balance-mark{width:48px;height:48px;border-radius:9999px;background:var(--color-primary-reverse, #eaf7f0);color:var(--color-primary, #2e8b57);display:inline-flex;align-items:center;justify-content:center;font-size:22px;margin-bottom:12px}.s-wallet-balance-figure{font-size:18px;font-weight:700;color:#1c1c1c}.s-wallet-balance-label{margin-top:2px;font-size:12px;color:#9aa0a6}.s-wallet-amount{display:inline-flex;align-items:center;gap:4px;font-weight:700;white-space:nowrap}.s-wallet-amount-credit{color:#00af6c}.s-wallet-amount-debit{color:#f55157}.s-wallet-transaction-type{display:flex;align-items:center;color:#4b5563}@media screen and (min-width: 768px){.s-wallet-balance-card{display:flex;flex-direction:column;justify-content:center}}@media screen and (max-width: 767px){.s-wallet-summary{gap:12px;margin-bottom:20px}.s-wallet-balance-card{flex:0 0 38%;padding:16px;text-align:center}.s-wallet-balance-mark{margin-bottom:8px}}.absolute{position:absolute}.relative{position:relative}.flex{display:flex}.table{display:table}.hidden{display:none}.items-center{align-items:center}.p-3{padding:0.75rem}.text-center{text-align:center}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:0.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.font-bold{font-weight:700}.font-normal{font-weight:400}.text-gray-400{--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-wallet-container>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(0.625rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(0.625rem * var(--tw-space-y-reverse))}@media (min-width: 768px){.s-wallet-container>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(1.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.25rem * var(--tw-space-y-reverse))}}.s-wallet-mobile-title{display:inline-block;width:8rem;font-weight:400;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}@media (min-width: 768px){.s-wallet-mobile-title{display:none}}.s-wallet-reference-id{display:none}@media (min-width: 768px){.s-wallet-reference-id{display:inline-block}}.s-wallet-buy-as-gift-icon{margin-left:0.25rem;margin-right:0.25rem;display:inline-block;color:var(--color-primary)}.s-wallet-copy-to-clipboard-button{display:flex;align-items:center}@media (min-width: 768px){.s-wallet-copy-to-clipboard-button{display:none}}.s-wallet-copy-to-clipboard-button salla-button{position:relative}.s-wallet-copy-to-clipboard-button-icon{pointer-events:none;font-size:0.75rem;line-height:1rem}.s-wallet-copy-to-clipboard-button-icon:where([dir="ltr"],[dir="ltr"] *){margin-left:0.25rem}.s-wallet-copy-to-clipboard-button-icon:where([dir="rtl"],[dir="rtl"] *){margin-right:0.25rem}@media (min-width: 768px){.s-wallet-status-container{margin-left:0px;margin-right:0px}}.s-wallet-status-container:where([dir="ltr"],[dir="ltr"] *){margin-left:auto}.s-wallet-status-container:where([dir="rtl"],[dir="rtl"] *){margin-right:auto}.s-wallet-status-container i{margin-top:0.25rem}.s-wallet-status-container i:where([dir="ltr"],[dir="ltr"] *){margin-right:0.25rem}.s-wallet-status-container i:where([dir="rtl"],[dir="rtl"] *){margin-left:0.25rem}.s-wallet-rated-text{--tw-text-opacity:1;color:rgb(251 191 36 / var(--tw-text-opacity, 1))}.s-wallet-unrated-text{--tw-text-opacity:1;color:rgb(229 231 235 / var(--tw-text-opacity, 1))}.s-wallet-no-content{display:flex;height:100%;flex-direction:column;align-items:center;justify-content:center;padding-top:2.5rem;padding-bottom:5rem;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-wallet-no-content .icon{margin-bottom:1rem;display:flex;height:8rem;width:8rem;align-items:center;justify-content:center;border-radius:9999px;--tw-bg-opacity:1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1));font-size:3rem;line-height:1;--tw-text-opacity:1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.s-wallet-no-content p{margin-bottom:1rem;font-size:1rem;line-height:1.5rem;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-wallet-table{min-width:100%;border-collapse:separate}@media (min-width: 768px){.s-wallet-table{margin-bottom:-0.75rem;--tw-border-spacing-y:1.25rem;border-spacing:var(--tw-border-spacing-x) var(--tw-border-spacing-y)}}.s-wallet-table-head{margin-bottom:1.25rem;display:none;--tw-bg-opacity:1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}@media (min-width: 768px){.s-wallet-table-head{display:table-header-group}}.s-wallet-table-head-tr-th{padding-left:1.5rem;padding-right:1.5rem;text-align:start;font-size:0.875rem;line-height:1.25rem;font-weight:500;text-transform:uppercase;letter-spacing:0.05em}.s-wallet-table-head-tr-th:where([dir="ltr"],[dir="ltr"] *){text-align:left}.s-wallet-table-head-tr-th:last-child:where([dir="ltr"],[dir="ltr"] *){text-align:right}.s-wallet-table-head-tr-th:where([dir="rtl"],[dir="rtl"] *){text-align:right}.s-wallet-table-head-tr-th:last-child:where([dir="rtl"],[dir="rtl"] *){text-align:left}.s-wallet-table-tbody-tr{position:relative;display:flex;flex-direction:row;flex-wrap:wrap;overflow:hidden;border-radius:var(--s-radius, 0.25rem);border-bottom-width:8px;border-top-width:8px;--tw-border-opacity:1;border-color:rgb(249 250 251 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding:0.5rem;transition-property:box-shadow;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:500ms}@media (min-width: 768px){.s-wallet-table-tbody-tr{display:table-row;flex-direction:row;flex-wrap:nowrap;padding:0px}}.s-wallet-table-tbody-tr-td{width:100%;white-space:nowrap;font-size:0.875rem;line-height:1.25rem}.s-wallet-table-tbody-tr-td:first-child{font-weight:700}@media (min-width: 768px){.s-wallet-table-tbody-tr-td{height:5rem;width:auto}.s-wallet-table-tbody-tr-td:last-child{text-align:end}.s-wallet-table-tbody-tr-td:first-child:where([dir="ltr"],[dir="ltr"] *){border-top-left-radius:0.375rem;border-bottom-left-radius:0.375rem}.s-wallet-table-tbody-tr-td:first-child:where([dir="rtl"],[dir="rtl"] *){border-top-right-radius:0.375rem;border-bottom-right-radius:0.375rem}}.s-wallet-table-tbody-tr-td:first-child{font-weight:700}.s-wallet-table-tbody-tr-td-content{position:relative;display:flex;align-items:center;justify-content:space-between;padding-left:0.5rem;padding-right:0.5rem;padding-top:0.25rem;padding-bottom:0.25rem;font-size:0.75rem;line-height:1rem}@media (min-width: 768px){.s-wallet-table-tbody-tr-td-content{padding-left:1.5rem;padding-right:1.5rem;padding-top:1.5rem;padding-bottom:1.5rem}}.s-wallet-table-tbody-tr-td-content:where([dir="ltr"],[dir="ltr"] *){padding-right:0.5rem}.s-wallet-table-tbody-tr-td-content:where([dir="rtl"],[dir="rtl"] *){padding-left:0.5rem}.s-wallet-table-tbody-tr a{position:absolute;top:0px;bottom:0px;display:block;width:100%}.s-wallet-table-tbody-tr a:where([dir="ltr"],[dir="ltr"] *){left:0px}.s-wallet-table-tbody-tr a:where([dir="rtl"],[dir="rtl"] *){right:0px}@media (min-width: 768px){.md\\:mx-0{margin-left:0px;margin-right:0px}.md\\:inline-block{display:inline-block}.md\\:hidden{display:none}}.ltr\\:ml-auto:where([dir="ltr"],[dir="ltr"] *){margin-left:auto}.ltr\\:mr-4:where([dir="ltr"],[dir="ltr"] *){margin-right:1rem}.rtl\\:ml-4:where([dir="rtl"],[dir="rtl"] *){margin-left:1rem}.rtl\\:mr-auto:where([dir="rtl"],[dir="rtl"] *){margin-right:auto}/*!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{r as salla_wallet}
4
+ import{r as t,h as e,H as a}from"./p-CrXKQnBu.js";const r=class{constructor(e){t(this,e),this.transactionsArray=[],this.isLoading=!1,this.nextPageUrl="",this.requestSeq=0,this.handleClick=()=>{this.isLoading||this.loadMoreTransactions()},this.handleGiftCardRedeemed=()=>{this.loadTransactions()}}componentWillLoad(){return salla.onReady().then((()=>this.loadTransactions()))}normalizeTransactions(t){if(Array.isArray(t))return{list:t,nextPageUrl:""};const e=t?.current_page??1,a=e<(t?.last_page??e)?`/balance/wallet?per_page=${t?.per_page??10}&page=${e+1}`:"";return{list:t?.data??[],nextPageUrl:a}}loadTransactions(){return this.fetchTransactions("/balance/wallet?per_page=10&page=1",!1)}loadMoreTransactions(){return this.fetchTransactions(this.nextPageUrl||"/balance/wallet?page=2&per_page=10",!0)}async fetchTransactions(t,e){const a=++this.requestSeq;this.isLoading=!0;try{const r=await salla.api.request(t);if(a!==this.requestSeq)return;const{list:l,nextPageUrl:i}=this.normalizeTransactions(r.data.transactions);this.nextPageUrl=i,this.transactionsArray=e?[...this.transactionsArray,...l]:l,this.balance=r.data.balance}catch(t){if(a!==this.requestSeq)return;console.error("Error loading wallet transactions",t)}finally{a===this.requestSeq&&(this.isLoading=!1)}}formatDate(t){return t?new Date(1e3*t).toLocaleDateString(salla.lang.locale,{weekday:"long",year:"numeric",month:"long",day:"numeric",hour:"numeric"}):""}renderCell(t,a){return e("td",{class:"s-wallet-table-tbody-tr-td"},e("div",{class:"s-wallet-table-tbody-tr-td-content"},e("span",{class:"s-wallet-mobile-title"},salla.lang.get(`pages.wallet.${t}`),":"),a))}isCredit(t){return"debit"!==t.transaction_type}renderSummary(){return e("div",{class:"s-wallet-summary"},e("div",{class:"s-wallet-balance-card"},e("span",{class:"s-wallet-balance-mark"},e("i",{class:"sicon-wallet","aria-hidden":"true"})),e("div",{class:"s-wallet-balance-figure",innerHTML:salla.money(this.balance)}),e("div",{class:"s-wallet-balance-label"},salla.lang.get("pages.wallet.balance"))),e("salla-gift-card-redeem",{onGiftCardRedeemed:this.handleGiftCardRedeemed}))}render(){return this.transactionsArray.length>0?e(a,null,this.renderSummary(),e("h2",{style:{"margin-top":"32px"}},salla.lang.get("pages.wallet.title")),e("table",{class:"s-wallet-table"},e("thead",{class:"s-wallet-table-head"},e("tr",{class:"s-wallet-table-head-tr"},e("th",{scope:"col"},salla.lang.get("pages.wallet.transaction_number")),e("th",{scope:"col",class:"s-wallet-table-head-tr-th"},salla.lang.get("pages.wallet.amount")),e("th",{scope:"col",class:"s-wallet-table-head-tr-th"},salla.lang.get("pages.wallet.date")),e("th",{scope:"col",class:"s-wallet-table-head-tr-th"},salla.lang.get("pages.wallet.order_no")),e("th",{scope:"col",class:"s-wallet-table-head-tr-th"},salla.lang.get("pages.wallet.expiry_date")),e("th",{scope:"col",class:"s-wallet-table-head-tr-th"},salla.lang.get("pages.wallet.transaction_type")," "))),e("tbody",{class:"s-wallet-table-tbody"},this.transactionsArray.map((t=>e("tr",{class:"s-wallet-table-tbody-tr s-wallet-table-tbody-tr-shadow animated"},this.renderCell("transaction_number",[t.id&&e("span",{class:"hidden md:inline-block"},"#",t.id),e("div",{class:"flex items-center md:hidden"},e("salla-button",{class:"relative",color:"dark",shape:"link","data-content":t.order_id},t.order_id&&e("span",null,"#",t.order_id)))]),this.renderCell("amount",e("div",{class:{"s-wallet-amount":!0,"s-wallet-amount-credit":this.isCredit(t),"s-wallet-amount-debit":!this.isCredit(t)}},e("span",{class:"s-wallet-amount-sign"},this.isCredit(t)?"+":"-"),e("span",{innerHTML:salla.money(t.amount)}))),this.renderCell("date",this.formatDate(t.created_at)),this.renderCell("order_no",e("span",{class:"rtl:mr-auto ltr:ml-auto md:mx-0"},t.order_id&&e("span",null,"#",t.order_id))),this.renderCell("expiry_date",e("span",null,this.formatDate(t.expired_at))),this.renderCell("transaction_type",e("div",{class:"s-wallet-transaction-type"},!!t.description&&[e("i",{id:t.id.toString(),class:"sicon-information text-lg rtl:ml-4 ltr:mr-4 s-wallet-table-transaction-status-icon-success"}),e("salla-tooltip",{text:t.description,targetId:t.id.toString()})],e("span",null,t.title)))))))),e("div",{class:"s-infinite-scroll-wrapper"},!!this.nextPageUrl&&e("salla-button",{onClick:this.handleClick,loading:this.isLoading},salla.lang.get("common.elements.load_more")))):e(a,null,this.renderSummary(),e("h2",{style:{"margin-top":"32px"}},salla.lang.get("pages.wallet.title")),e("div",{class:"s-wallet-table-empty-state"},e("i",{class:"sicon-full-wallet"}),e("div",{class:"text-center p-3 text-xl font-bold "},salla.lang.get("pages.wallet.no_transactions")),e("div",{class:"text-center text-gray-400 text-sm font-normal "},salla.lang.get("pages.wallet.zero_balance")," ")))}};r.style='/*!twlt*/@charset "UTF-8";.s-wallet-table{min-width:100%}.s-wallet-table-balance-container{display:flex !important;align-items:center !important;justify-content:flex-start !important;gap:1rem}.s-wallet-table-balance-icon{border-radius:50%;width:52px;height:52px;font-size:25px;padding:16px 13px;background:var(--color-primary-reverse);color:var(--color-primary)}.s-wallet-table-empty-state{display:flex;flex-direction:column;align-items:center}.s-wallet-table-empty-state i{font-size:80px;margin:4rem 0 2rem;color:var(--infinte-color)}.s-wallet-table-transaction-status{padding:6px 19px !important;border-radius:20px;width:max-content;display:flex;align-items:center}.s-wallet-table-transaction-status-default{background:#fff6eb;color:#a46f29}.s-wallet-table-transaction-status-cashback{background:#effbf6;color:#00af6c}.s-wallet-table-transaction-status-refund{background:#ecf3fe;color:#5196f3}.s-wallet-table-transaction-status-purchase{background:#feecec;color:#f55157}.s-wallet-table-transaction-status-icons-success{color:#00af6c}.s-wallet-summary{display:flex;align-items:stretch;gap:16px;margin-bottom:28px}.s-wallet-balance-card{flex:0 0 34%;max-width:240px;background:#fff;border-radius:12px;padding:20px;box-sizing:border-box}.s-wallet-balance-mark{width:48px;height:48px;border-radius:9999px;background:var(--color-primary-reverse, #eaf7f0);color:var(--color-primary, #2e8b57);display:inline-flex;align-items:center;justify-content:center;font-size:22px;margin-bottom:12px}.s-wallet-balance-figure{font-size:18px;font-weight:700;color:#1c1c1c}.s-wallet-balance-label{margin-top:2px;font-size:12px;color:#9aa0a6}.s-wallet-amount{display:inline-flex;align-items:center;gap:4px;font-weight:700;white-space:nowrap}.s-wallet-amount-credit{color:#00af6c}.s-wallet-amount-debit{color:#f55157}.s-wallet-transaction-type{display:flex;align-items:center;color:#4b5563}@media screen and (min-width: 768px){.s-wallet-balance-card{display:flex;flex-direction:column;justify-content:center}}@media screen and (max-width: 767px){.s-wallet-summary{gap:12px;margin-bottom:20px}.s-wallet-balance-card{flex:0 0 38%;padding:16px;text-align:center}.s-wallet-balance-mark{margin-bottom:8px}}.absolute{position:absolute}.relative{position:relative}.flex{display:flex}.table{display:table}.hidden{display:none}.items-center{align-items:center}.p-3{padding:0.75rem}.text-center{text-align:center}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:0.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.font-bold{font-weight:700}.font-normal{font-weight:400}.text-gray-400{--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-wallet-container>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(0.625rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(0.625rem * var(--tw-space-y-reverse))}@media (min-width: 768px){.s-wallet-container>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(1.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.25rem * var(--tw-space-y-reverse))}}.s-wallet-mobile-title{display:inline-block;width:8rem;font-weight:400;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}@media (min-width: 768px){.s-wallet-mobile-title{display:none}}.s-wallet-reference-id{display:none}@media (min-width: 768px){.s-wallet-reference-id{display:inline-block}}.s-wallet-buy-as-gift-icon{margin-left:0.25rem;margin-right:0.25rem;display:inline-block;color:var(--color-primary)}.s-wallet-copy-to-clipboard-button{display:flex;align-items:center}@media (min-width: 768px){.s-wallet-copy-to-clipboard-button{display:none}}.s-wallet-copy-to-clipboard-button salla-button{position:relative}.s-wallet-copy-to-clipboard-button-icon{pointer-events:none;font-size:0.75rem;line-height:1rem}.s-wallet-copy-to-clipboard-button-icon:where([dir="ltr"],[dir="ltr"] *){margin-left:0.25rem}.s-wallet-copy-to-clipboard-button-icon:where([dir="rtl"],[dir="rtl"] *){margin-right:0.25rem}@media (min-width: 768px){.s-wallet-status-container{margin-left:0px;margin-right:0px}}.s-wallet-status-container:where([dir="ltr"],[dir="ltr"] *){margin-left:auto}.s-wallet-status-container:where([dir="rtl"],[dir="rtl"] *){margin-right:auto}.s-wallet-status-container i{margin-top:0.25rem}.s-wallet-status-container i:where([dir="ltr"],[dir="ltr"] *){margin-right:0.25rem}.s-wallet-status-container i:where([dir="rtl"],[dir="rtl"] *){margin-left:0.25rem}.s-wallet-rated-text{--tw-text-opacity:1;color:rgb(251 191 36 / var(--tw-text-opacity, 1))}.s-wallet-unrated-text{--tw-text-opacity:1;color:rgb(229 231 235 / var(--tw-text-opacity, 1))}.s-wallet-no-content{display:flex;height:100%;flex-direction:column;align-items:center;justify-content:center;padding-top:2.5rem;padding-bottom:5rem;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-wallet-no-content .icon{margin-bottom:1rem;display:flex;height:8rem;width:8rem;align-items:center;justify-content:center;border-radius:9999px;--tw-bg-opacity:1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1));font-size:3rem;line-height:1;--tw-text-opacity:1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.s-wallet-no-content p{margin-bottom:1rem;font-size:1rem;line-height:1.5rem;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-wallet-table{min-width:100%;border-collapse:separate}@media (min-width: 768px){.s-wallet-table{margin-bottom:-0.75rem;--tw-border-spacing-y:1.25rem;border-spacing:var(--tw-border-spacing-x) var(--tw-border-spacing-y)}}.s-wallet-table-head{margin-bottom:1.25rem;display:none;--tw-bg-opacity:1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}@media (min-width: 768px){.s-wallet-table-head{display:table-header-group}}.s-wallet-table-head-tr-th{padding-left:1.5rem;padding-right:1.5rem;text-align:start;font-size:0.875rem;line-height:1.25rem;font-weight:500;text-transform:uppercase;letter-spacing:0.05em}.s-wallet-table-head-tr-th:where([dir="ltr"],[dir="ltr"] *){text-align:left}.s-wallet-table-head-tr-th:last-child:where([dir="ltr"],[dir="ltr"] *){text-align:right}.s-wallet-table-head-tr-th:where([dir="rtl"],[dir="rtl"] *){text-align:right}.s-wallet-table-head-tr-th:last-child:where([dir="rtl"],[dir="rtl"] *){text-align:left}.s-wallet-table-tbody-tr{position:relative;display:flex;flex-direction:row;flex-wrap:wrap;overflow:hidden;border-radius:var(--s-radius, 0.25rem);border-bottom-width:8px;border-top-width:8px;--tw-border-opacity:1;border-color:rgb(249 250 251 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding:0.5rem;transition-property:box-shadow;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:500ms}@media (min-width: 768px){.s-wallet-table-tbody-tr{display:table-row;flex-direction:row;flex-wrap:nowrap;padding:0px}}.s-wallet-table-tbody-tr-td{width:100%;white-space:nowrap;font-size:0.875rem;line-height:1.25rem}.s-wallet-table-tbody-tr-td:first-child{font-weight:700}@media (min-width: 768px){.s-wallet-table-tbody-tr-td{height:5rem;width:auto}.s-wallet-table-tbody-tr-td:last-child{text-align:end}.s-wallet-table-tbody-tr-td:first-child:where([dir="ltr"],[dir="ltr"] *){border-top-left-radius:0.375rem;border-bottom-left-radius:0.375rem}.s-wallet-table-tbody-tr-td:first-child:where([dir="rtl"],[dir="rtl"] *){border-top-right-radius:0.375rem;border-bottom-right-radius:0.375rem}}.s-wallet-table-tbody-tr-td:first-child{font-weight:700}.s-wallet-table-tbody-tr-td-content{position:relative;display:flex;align-items:center;justify-content:space-between;padding-left:0.5rem;padding-right:0.5rem;padding-top:0.25rem;padding-bottom:0.25rem;font-size:0.75rem;line-height:1rem}@media (min-width: 768px){.s-wallet-table-tbody-tr-td-content{padding-left:1.5rem;padding-right:1.5rem;padding-top:1.5rem;padding-bottom:1.5rem}}.s-wallet-table-tbody-tr-td-content:where([dir="ltr"],[dir="ltr"] *){padding-right:0.5rem}.s-wallet-table-tbody-tr-td-content:where([dir="rtl"],[dir="rtl"] *){padding-left:0.5rem}.s-wallet-table-tbody-tr a{position:absolute;top:0px;bottom:0px;display:block;width:100%}.s-wallet-table-tbody-tr a:where([dir="ltr"],[dir="ltr"] *){left:0px}.s-wallet-table-tbody-tr a:where([dir="rtl"],[dir="rtl"] *){right:0px}@media (min-width: 768px){.md\\:mx-0{margin-left:0px;margin-right:0px}.md\\:inline-block{display:inline-block}.md\\:hidden{display:none}}.ltr\\:ml-auto:where([dir="ltr"],[dir="ltr"] *){margin-left:auto}.ltr\\:mr-4:where([dir="ltr"],[dir="ltr"] *){margin-right:1rem}.rtl\\:ml-4:where([dir="rtl"],[dir="rtl"] *){margin-left:1rem}.rtl\\:mr-auto:where([dir="rtl"],[dir="rtl"] *){margin-right:auto}/*!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{r as salla_wallet}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as t,c as i,h as s,H as e,a as r}from"./p-C9zdeQFI.js";const a=class{constructor(s){t(this,s),this.giftCardRedeemed=i(this,"giftCardRedeemed"),this.code="",this.inlineForm=!1,this.pending=!1,this.error=null,this.redeemedOnce=!1,this.isDesktop=!1,this.modalView=null,this.result=null,this.mediaQueryList=null,this.mqlChangeHandler=t=>{this.isDesktop=t.matches,"form"===this.modalView&&this.isDesktop?(this.modalView=null,this.inlineForm=!0):this.inlineForm&&!this.isDesktop&&(this.inlineForm=!1,this.openModal("form"))},this.closeModal=()=>{this.modalView=null,this.modal?.close?.()},this.start=()=>{if(this.error=null,this.code="",this.isDesktop)return this.inlineForm=!0,void setTimeout((()=>this.field?.focus()),0);this.openModal("form")},this.cancel=()=>{this.inlineForm=!1,this.code="",this.error=null,this.closeModal()},this.handleInput=t=>{const i=t.target;this.code=(i.value||"").toUpperCase().replace(/[^A-Z0-9]/g,"").slice(0,16),i.value=this.code,this.error=null},this.onKeyUp=t=>{"Enter"===t.key&&(t.preventDefault(),this.redeem())},this.shopNow=()=>{this.closeModal(),window.location.href=salla.url.get("/")}}breakpointPx(){return 768}async componentWillLoad(){await salla.onReady(),this.mediaQueryList=window.matchMedia(`(min-width: ${this.breakpointPx()}px)`),this.isDesktop=this.mediaQueryList.matches,this.mediaQueryList.addEventListener?this.mediaQueryList.addEventListener("change",this.mqlChangeHandler):this.mediaQueryList.addListener&&this.mediaQueryList.addListener(this.mqlChangeHandler),await salla.lang.onLoaded()}disconnectedCallback(){this.mediaQueryList?.removeEventListener?this.mediaQueryList.removeEventListener("change",this.mqlChangeHandler):this.mediaQueryList?.removeListener&&this.mediaQueryList.removeListener(this.mqlChangeHandler)}tFirst(t,i){for(const s of t){const t=salla.lang.get(s,i);if(t&&t!==s)return t}return""}t(t,i){return this.tFirst([`pages.checkout.${t}`],i)}get canRedeem(){const t=salla.config.get("store.features",[]);return!salla.config.isGuest()&&t.includes("wallet-gift-card")&&t.includes("giftcard-redemption-form-enabled")}get isValidCode(){return/^[A-Z0-9]{16}$/.test(this.code)}get addLabel(){return this.t(this.redeemedOnce?"gift_card_add_another":"gift_card_add")}openModal(t){this.modalView=t,this.modal?.open?.(),"form"===t&&setTimeout((()=>this.field?.focus()),0)}toDate(t){if(!t)return null;const i="object"==typeof t?t.date??t.datetime??null:t;if("number"==typeof i){const t=new Date(i<1e12?1e3*i:i);return isNaN(t.getTime())?null:t}if("string"!=typeof i)return null;const s=new Date(i.replace(" ","T"));return isNaN(s.getTime())?null:s}expiryMonths(t){const i=this.toDate(t);if(!i)return null;const s=Math.round((i.getTime()-Date.now())/2630016e3);return s>0?s:null}formatMoney(t){try{return salla.money(t)||""}catch(t){return salla.logger?.warn?.("gift-card: could not format amount",t),""}}trackRedeem(t,i,s={}){salla.event.dispatch("giftcard::redeemed",{status:t,code:i?i.slice(0,4)+"X".repeat(Math.max(0,i.length-4)):"",...s})}async redeem(){if(this.pending||!this.isValidCode||!this.canRedeem)return;this.pending=!0,this.error=null;const t=this.code;try{const i=await salla.api.request("wallet/gift-card/redeem",{code:this.code},"post"),s=i?.data||{};this.code="",this.field&&(this.field.value=""),this.inlineForm=!1,this.redeemedOnce=!0,this.result=s,this.openModal("success"),this.giftCardRedeemed.emit(s),this.trackRedeem("success",t,{amount:s.amount,new_balance:s.new_balance,expires_at:s.expires_at})}catch(i){const s=i?.response?.data?.error?.fields;this.error=s?Object.values(s).flat().join(", "):i?.response?.data?.error?.message||this.t("gift_card_redeem_error"),this.inlineForm=!1,this.openModal("error"),this.trackRedeem("failed",t,{reason:this.error})}finally{this.pending=!1}}renderPrompt(){return s("div",{class:"s-gift-card-prompt"},s("div",{class:"s-gift-card-intro"},s("span",{class:"s-gift-card-mark"},s("i",{class:"sicon-gift","aria-hidden":"true"})),s("div",{class:"s-gift-card-copy"},s("p",{class:"s-gift-card-title"},this.t("gift_card_title")),s("p",{class:"s-gift-card-subtitle"},this.t("gift_card_subtitle")))),s("salla-button",{class:"s-gift-card-trigger",color:"primary",fill:"outline",onClick:this.start},s("span",null,this.addLabel)))}renderField(){return[s("label",{class:"s-gift-card-label",htmlFor:"gift_card_redeem_field"},this.tFirst(["pages.gift.code"])),s("input",{id:"gift_card_redeem_field",ref:t=>this.field=t,type:"text",maxlength:16,autocomplete:"off",class:"s-gift-card-input",value:this.code,disabled:this.pending,placeholder:this.t("gift_card_redeem_placeholder"),onInput:this.handleInput,onKeyUp:this.onKeyUp})]}renderSubmit(t=!1){return s("salla-button",{id:"gift_card_redeem_submit",color:"primary",width:t?"wide":"normal",loading:this.pending,"loader-position":"center",disabled:this.pending||!this.isValidCode,onClick:()=>this.redeem()},s("span",null,this.t("gift_card_redeem_confirm")))}renderInlineForm(){return s("div",{class:"s-gift-card-form"},s("div",{class:"s-gift-card-field"},this.renderField()),this.renderSubmit(),s("button",{type:"button",class:"s-gift-card-cancel",disabled:this.pending,onClick:this.cancel},this.t("gift_card_cancel")))}renderSheetForm(){return s("div",{class:"s-gift-card-sheet"},s("div",{class:"s-gift-card-field"},this.renderField()),this.renderSubmit(!0))}renderSuccess(){const t=this.formatMoney(this.result?.amount),i=this.expiryMonths(this.result?.expires_at),e=this.t("gift_card_success_title");return s("div",{class:"s-gift-card-result"},s("span",{class:"s-gift-card-result-mark s-gift-card-result-mark-success",innerHTML:'\n<svg viewBox="0 0 96 96" width="72" height="72" role="img" aria-hidden="true" xmlns="http://www.w3.org/2000/svg">\n \x3c!-- burst --\x3e\n <g fill="#F5C242">\n <path d="M48 8l3.2 7.6L59 18l-6.2 5.3L54 31l-6-4-6 4 1.2-7.7L37 18l7.8-2.4z"/>\n <path d="M71 26l1.9 4.4L77 32l-3.6 3 .7 4.5-4.1-2.3-4.1 2.3.7-4.5L63 32l4.1-1.6z"/>\n <path d="M25 26l1.9 4.4L31 32l-3.6 3 .7 4.5L24 37.2 19.9 39.5l.7-4.5L17 32l4.1-1.6z"/>\n </g>\n <g fill="#E4572E" opacity=".9">\n <circle cx="30" cy="18" r="2.4"/>\n <circle cx="66" cy="18" r="2.4"/>\n <circle cx="48" cy="44" r="2.2"/>\n </g>\n \x3c!-- lid --\x3e\n <rect x="20" y="46" width="56" height="12" rx="3" fill="#2E8B57"/>\n \x3c!-- box --\x3e\n <path d="M25 58h46v26a4 4 0 0 1-4 4H29a4 4 0 0 1-4-4z" fill="#3AA76D"/>\n \x3c!-- ribbon --\x3e\n <rect x="44" y="46" width="8" height="42" fill="#F5F7F6"/>\n <rect x="20" y="46" width="56" height="12" rx="3" fill="#2E8B57" opacity="0"/>\n <rect x="44" y="46" width="8" height="12" fill="#E9EFEB"/>\n</svg>\n'}),e&&s("h3",{class:"s-gift-card-result-title"},e),s("p",{class:"s-gift-card-result-text",innerHTML:i?this.tFirst(["pages.checkout.gift_card_success_body_expiring","pages.checkout.gift_card_success_body","pages.checkout.gift_card_redeem_success"],{amount:t,months:i}):this.tFirst(["pages.checkout.gift_card_success_body","pages.checkout.gift_card_redeem_success"],{amount:t})}),s("salla-button",{color:"primary",width:"wide",onClick:this.shopNow},s("span",null,this.tFirst(["pages.loyalty_program.shop_now"]))))}renderError(){return s("div",{class:"s-gift-card-result"},s("span",{class:"s-gift-card-result-mark s-gift-card-result-mark-error"},s("i",{class:"sicon-cancel","aria-hidden":"true"})),s("h3",{class:"s-gift-card-result-title"},this.tFirst(["pages.checkout.gift_card_failure_title","pages.checkout.gift_card_redeem_error"])),s("p",{class:"s-gift-card-result-text"},this.error))}render(){return this.canRedeem?s(e,{class:"s-gift-card"},s("div",{class:"s-gift-card-panel"},this.inlineForm&&this.isDesktop?this.renderInlineForm():this.renderPrompt()),s("salla-modal",{ref:t=>this.modal=t,class:"s-gift-card-modal",width:"sm",position:this.isDesktop?"middle":"bottom","modal-title":this.t("gift_card_redeem_label"),onModalVisibilityChanged:t=>{t.detail||(this.modalView=null)}},s("div",{class:"s-gift-card-modal-body"},"form"===this.modalView&&this.renderSheetForm(),"success"===this.modalView&&this.renderSuccess(),"error"===this.modalView&&this.renderError()))):null}};a.style='/*!twlt*/@charset "UTF-8";.s-gift-card{display:block;flex:1 1 auto;min-width:0}.s-gift-card-panel{height:100%;background:#fff;border-radius:12px;padding:20px;box-sizing:border-box}.s-gift-card-prompt{display:flex;flex-direction:column;align-items:stretch;gap:16px;height:100%}.s-gift-card-intro{display:flex;align-items:center;gap:12px}.s-gift-card-mark{flex:0 0 auto;width:48px;height:48px;border-radius:9999px;background:#fdecef;color:#e8637c;display:inline-flex;align-items:center;justify-content:center;font-size:22px}.s-gift-card-copy{min-width:0}.s-gift-card-title{margin:0;font-weight:700;font-size:15px;color:#1c1c1c}.s-gift-card-subtitle{margin:2px 0 0;font-size:12px;color:#9aa0a6}.s-gift-card-trigger{display:block}.s-gift-card-form{display:flex;align-items:flex-end;gap:12px}.s-gift-card-field{flex:1 1 auto;min-width:0}.s-gift-card-label{display:block;margin-bottom:6px;font-size:13px;font-weight:700;color:#1c1c1c}.s-gift-card-input{width:100%;height:44px;padding:0 14px;box-sizing:border-box;border:1px solid #e6e8eb;border-radius:8px;background:#fff;font-size:13px;color:#1c1c1c}.s-gift-card-input::placeholder{color:#b7bcc2}.s-gift-card-input:focus{outline:none;border-color:var(--color-primary, #2e8b57)}.s-gift-card-cancel{flex:0 0 auto;height:44px;padding:0 8px;border:0;background:none;color:#6b7280;font-size:13px;cursor:pointer}.s-gift-card-cancel:disabled{opacity:0.5;cursor:default}.s-gift-card-sheet{display:flex;flex-direction:column;gap:16px;padding-top:4px}.s-gift-card-result{display:flex;flex-direction:column;align-items:center;text-align:center;padding:12px 8px 8px}.s-gift-card-result-mark{width:120px;height:120px;border-radius:9999px;display:inline-flex;align-items:center;justify-content:center;margin-bottom:20px}.s-gift-card-result-mark-success{background:#eaf7f0}.s-gift-card-result-mark-error{background:#fdeaea;color:#fff;font-size:34px}.s-gift-card-result-mark-error i{width:72px;height:72px;border-radius:9999px;background:#ea4b4b;display:inline-flex;align-items:center;justify-content:center}.s-gift-card-result-title{margin:0 0 10px;font-size:19px;font-weight:700;color:#1c1c1c}.s-gift-card-result-text{margin:0 0 22px;font-size:13px;line-height:1.7;color:#6b7280}@media screen and (min-width: 768px){.s-gift-card-panel{padding:22px 24px;display:flex;align-items:center}.s-gift-card-prompt{flex-direction:row;align-items:center;justify-content:space-between;gap:24px;width:100%}.s-gift-card-trigger{flex:0 0 auto}.s-gift-card-form{width:100%}.s-gift-card-result{padding:8px 24px 16px}}.inline{display:inline}.contents{display:contents}.resize{resize:both}.uppercase{text-transform:uppercase}.outline{outline-style:solid}';const l=class{constructor(i){t(this,i),this.theme="default",this.show=!1,this.targetElement=null}handleMouseOver(t){this.targetElement&&this.targetElement.contains(t.target)&&(this.show=!0)}handleMouseOut(t){this.targetElement&&this.targetElement.contains(t.target)&&(this.show=!1)}componentDidLoad(){this.targetElement=document.getElementById(this.targetId)}render(){const t=["default","dark"].includes(this.theme)?this.theme:"default";return s("div",{key:"e88949e9f1d97170bc61a0ab37e221863b9bc79f",class:"s-tooltip-container"},s("div",{key:"1e65ce349cab58449512ba02ab11028de7fd6aa4",class:`s-tooltip-item s-tooltip-item--${t}`,style:{display:this.show?"block":"none"}},this.text?s("span",null,this.text):s("slot",null)))}get el(){return r(this)}};l.style='/*!twlt*/.s-tooltip-container{position:relative;display:inline-block}.s-tooltip-item{position:absolute;transform:translateX(-63%) translateY(-50%);background-color:var(--color-primary);color:var(--color-primary-reverse);bottom:100%;left:50%;text-align:center;border-radius:5px;z-index:1;white-space:nowrap;transition:opacity 0.3s;pointer-events:none;margin:0 0 16px 8px;padding:12px;max-width:150px;width:190px;white-space:normal;opacity:1}.s-tooltip-item::after{content:"";position:absolute;bottom:-10px;left:50%;margin-left:-5px;border-width:5px;border-style:solid;border-color:var(--color-primary) transparent transparent transparent}.s-tooltip-item:dir(ltr){transform:translateX(-72%)}.s-tooltip-item--dark{background-color:#555555;color:white;padding:5px 15px;border-radius:8px;font-size:12px;font-weight:normal;max-width:330px;width:max-content}.s-tooltip-item--dark::after{border-color:#555555 transparent transparent transparent}.block{display:block}.shadow{--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}';export{a as salla_gift_card_redeem,l as salla_tooltip}
4
+ import{r as t,c as i,h as s,H as e,a as r}from"./p-CrXKQnBu.js";const a=class{constructor(s){t(this,s),this.giftCardRedeemed=i(this,"giftCardRedeemed"),this.code="",this.inlineForm=!1,this.pending=!1,this.error=null,this.redeemedOnce=!1,this.isDesktop=!1,this.modalView=null,this.result=null,this.mediaQueryList=null,this.mqlChangeHandler=t=>{this.isDesktop=t.matches,"form"===this.modalView&&this.isDesktop?(this.modalView=null,this.inlineForm=!0):this.inlineForm&&!this.isDesktop&&(this.inlineForm=!1,this.openModal("form"))},this.closeModal=()=>{this.modalView=null,this.modal?.close?.()},this.start=()=>{if(this.error=null,this.code="",this.isDesktop)return this.inlineForm=!0,void setTimeout((()=>this.field?.focus()),0);this.openModal("form")},this.cancel=()=>{this.inlineForm=!1,this.code="",this.error=null,this.closeModal()},this.handleInput=t=>{const i=t.target;this.code=(i.value||"").toUpperCase().replace(/[^A-Z0-9]/g,"").slice(0,16),i.value=this.code,this.error=null},this.onKeyUp=t=>{"Enter"===t.key&&(t.preventDefault(),this.redeem())},this.shopNow=()=>{this.closeModal(),window.location.href=salla.url.get("/")}}breakpointPx(){return 768}async componentWillLoad(){await salla.onReady(),this.mediaQueryList=window.matchMedia(`(min-width: ${this.breakpointPx()}px)`),this.isDesktop=this.mediaQueryList.matches,this.mediaQueryList.addEventListener?this.mediaQueryList.addEventListener("change",this.mqlChangeHandler):this.mediaQueryList.addListener&&this.mediaQueryList.addListener(this.mqlChangeHandler),await salla.lang.onLoaded()}disconnectedCallback(){this.mediaQueryList?.removeEventListener?this.mediaQueryList.removeEventListener("change",this.mqlChangeHandler):this.mediaQueryList?.removeListener&&this.mediaQueryList.removeListener(this.mqlChangeHandler)}tFirst(t,i){for(const s of t){const t=salla.lang.get(s,i);if(t&&t!==s)return t}return""}t(t,i){return this.tFirst([`pages.checkout.${t}`],i)}get canRedeem(){const t=salla.config.get("store.features",[]);return!salla.config.isGuest()&&t.includes("wallet-gift-card")&&t.includes("giftcard-redemption-form-enabled")}get isValidCode(){return/^[A-Z0-9]{16}$/.test(this.code)}get addLabel(){return this.t(this.redeemedOnce?"gift_card_add_another":"gift_card_add")}openModal(t){this.modalView=t,this.modal?.open?.(),"form"===t&&setTimeout((()=>this.field?.focus()),0)}toDate(t){if(!t)return null;const i="object"==typeof t?t.date??t.datetime??null:t;if("number"==typeof i){const t=new Date(i<1e12?1e3*i:i);return isNaN(t.getTime())?null:t}if("string"!=typeof i)return null;const s=new Date(i.replace(" ","T"));return isNaN(s.getTime())?null:s}expiryMonths(t){const i=this.toDate(t);if(!i)return null;const s=Math.round((i.getTime()-Date.now())/2630016e3);return s>0?s:null}formatMoney(t){try{return salla.money(t)||""}catch(t){return salla.logger?.warn?.("gift-card: could not format amount",t),""}}trackRedeem(t,i,s={}){salla.event.dispatch("giftcard::redeemed",{status:t,code:i?i.slice(0,4)+"X".repeat(Math.max(0,i.length-4)):"",...s})}async redeem(){if(this.pending||!this.isValidCode||!this.canRedeem)return;this.pending=!0,this.error=null;const t=this.code;try{const i=await salla.api.request("wallet/gift-card/redeem",{code:this.code},"post"),s=i?.data||{};this.code="",this.field&&(this.field.value=""),this.inlineForm=!1,this.redeemedOnce=!0,this.result=s,this.openModal("success"),this.giftCardRedeemed.emit(s),this.trackRedeem("success",t,{amount:s.amount,new_balance:s.new_balance,expires_at:s.expires_at})}catch(i){const s=i?.response?.data?.error?.fields;this.error=s?Object.values(s).flat().join(", "):i?.response?.data?.error?.message||this.t("gift_card_redeem_error"),this.inlineForm=!1,this.openModal("error"),this.trackRedeem("failed",t,{reason:this.error})}finally{this.pending=!1}}renderPrompt(){return s("div",{class:"s-gift-card-prompt"},s("div",{class:"s-gift-card-intro"},s("span",{class:"s-gift-card-mark"},s("i",{class:"sicon-gift","aria-hidden":"true"})),s("div",{class:"s-gift-card-copy"},s("p",{class:"s-gift-card-title"},this.t("gift_card_title")),s("p",{class:"s-gift-card-subtitle"},this.t("gift_card_subtitle")))),s("salla-button",{class:"s-gift-card-trigger",color:"primary",fill:"outline",onClick:this.start},s("span",null,this.addLabel)))}renderField(){return[s("label",{class:"s-gift-card-label",htmlFor:"gift_card_redeem_field"},this.tFirst(["pages.gift.code"])),s("input",{id:"gift_card_redeem_field",ref:t=>this.field=t,type:"text",maxlength:16,autocomplete:"off",class:"s-gift-card-input",value:this.code,disabled:this.pending,placeholder:this.t("gift_card_redeem_placeholder"),onInput:this.handleInput,onKeyUp:this.onKeyUp})]}renderSubmit(t=!1){return s("salla-button",{id:"gift_card_redeem_submit",color:"primary",width:t?"wide":"normal",loading:this.pending,"loader-position":"center",disabled:this.pending||!this.isValidCode,onClick:()=>this.redeem()},s("span",null,this.t("gift_card_redeem_confirm")))}renderInlineForm(){return s("div",{class:"s-gift-card-form"},s("div",{class:"s-gift-card-field"},this.renderField()),this.renderSubmit(),s("button",{type:"button",class:"s-gift-card-cancel",disabled:this.pending,onClick:this.cancel},this.t("gift_card_cancel")))}renderSheetForm(){return s("div",{class:"s-gift-card-sheet"},s("div",{class:"s-gift-card-field"},this.renderField()),this.renderSubmit(!0))}renderSuccess(){const t=this.formatMoney(this.result?.amount),i=this.expiryMonths(this.result?.expires_at),e=this.t("gift_card_success_title");return s("div",{class:"s-gift-card-result"},s("span",{class:"s-gift-card-result-mark s-gift-card-result-mark-success",innerHTML:'\n<svg viewBox="0 0 96 96" width="72" height="72" role="img" aria-hidden="true" xmlns="http://www.w3.org/2000/svg">\n \x3c!-- burst --\x3e\n <g fill="#F5C242">\n <path d="M48 8l3.2 7.6L59 18l-6.2 5.3L54 31l-6-4-6 4 1.2-7.7L37 18l7.8-2.4z"/>\n <path d="M71 26l1.9 4.4L77 32l-3.6 3 .7 4.5-4.1-2.3-4.1 2.3.7-4.5L63 32l4.1-1.6z"/>\n <path d="M25 26l1.9 4.4L31 32l-3.6 3 .7 4.5L24 37.2 19.9 39.5l.7-4.5L17 32l4.1-1.6z"/>\n </g>\n <g fill="#E4572E" opacity=".9">\n <circle cx="30" cy="18" r="2.4"/>\n <circle cx="66" cy="18" r="2.4"/>\n <circle cx="48" cy="44" r="2.2"/>\n </g>\n \x3c!-- lid --\x3e\n <rect x="20" y="46" width="56" height="12" rx="3" fill="#2E8B57"/>\n \x3c!-- box --\x3e\n <path d="M25 58h46v26a4 4 0 0 1-4 4H29a4 4 0 0 1-4-4z" fill="#3AA76D"/>\n \x3c!-- ribbon --\x3e\n <rect x="44" y="46" width="8" height="42" fill="#F5F7F6"/>\n <rect x="20" y="46" width="56" height="12" rx="3" fill="#2E8B57" opacity="0"/>\n <rect x="44" y="46" width="8" height="12" fill="#E9EFEB"/>\n</svg>\n'}),e&&s("h3",{class:"s-gift-card-result-title"},e),s("p",{class:"s-gift-card-result-text",innerHTML:i?this.tFirst(["pages.checkout.gift_card_success_body_expiring","pages.checkout.gift_card_success_body","pages.checkout.gift_card_redeem_success"],{amount:t,months:i}):this.tFirst(["pages.checkout.gift_card_success_body","pages.checkout.gift_card_redeem_success"],{amount:t})}),s("salla-button",{color:"primary",width:"wide",onClick:this.shopNow},s("span",null,this.tFirst(["pages.loyalty_program.shop_now"]))))}renderError(){return s("div",{class:"s-gift-card-result"},s("span",{class:"s-gift-card-result-mark s-gift-card-result-mark-error"},s("i",{class:"sicon-cancel","aria-hidden":"true"})),s("h3",{class:"s-gift-card-result-title"},this.tFirst(["pages.checkout.gift_card_failure_title","pages.checkout.gift_card_redeem_error"])),s("p",{class:"s-gift-card-result-text"},this.error))}render(){return this.canRedeem?s(e,{class:"s-gift-card"},s("div",{class:"s-gift-card-panel"},this.inlineForm&&this.isDesktop?this.renderInlineForm():this.renderPrompt()),s("salla-modal",{ref:t=>this.modal=t,class:"s-gift-card-modal",width:"sm",position:this.isDesktop?"middle":"bottom","modal-title":this.t("gift_card_redeem_label"),onModalVisibilityChanged:t=>{t.detail||(this.modalView=null)}},s("div",{class:"s-gift-card-modal-body"},"form"===this.modalView&&this.renderSheetForm(),"success"===this.modalView&&this.renderSuccess(),"error"===this.modalView&&this.renderError()))):null}};a.style='/*!twlt*/@charset "UTF-8";.s-gift-card{display:block;flex:1 1 auto;min-width:0}.s-gift-card-panel{height:100%;background:#fff;border-radius:12px;padding:20px;box-sizing:border-box}.s-gift-card-prompt{display:flex;flex-direction:column;align-items:stretch;gap:16px;height:100%}.s-gift-card-intro{display:flex;align-items:center;gap:12px}.s-gift-card-mark{flex:0 0 auto;width:48px;height:48px;border-radius:9999px;background:#fdecef;color:#e8637c;display:inline-flex;align-items:center;justify-content:center;font-size:22px}.s-gift-card-copy{min-width:0}.s-gift-card-title{margin:0;font-weight:700;font-size:15px;color:#1c1c1c}.s-gift-card-subtitle{margin:2px 0 0;font-size:12px;color:#9aa0a6}.s-gift-card-trigger{display:block}.s-gift-card-form{display:flex;align-items:flex-end;gap:12px}.s-gift-card-field{flex:1 1 auto;min-width:0}.s-gift-card-label{display:block;margin-bottom:6px;font-size:13px;font-weight:700;color:#1c1c1c}.s-gift-card-input{width:100%;height:44px;padding:0 14px;box-sizing:border-box;border:1px solid #e6e8eb;border-radius:8px;background:#fff;font-size:13px;color:#1c1c1c}.s-gift-card-input::placeholder{color:#b7bcc2}.s-gift-card-input:focus{outline:none;border-color:var(--color-primary, #2e8b57)}.s-gift-card-cancel{flex:0 0 auto;height:44px;padding:0 8px;border:0;background:none;color:#6b7280;font-size:13px;cursor:pointer}.s-gift-card-cancel:disabled{opacity:0.5;cursor:default}.s-gift-card-sheet{display:flex;flex-direction:column;gap:16px;padding-top:4px}.s-gift-card-result{display:flex;flex-direction:column;align-items:center;text-align:center;padding:12px 8px 8px}.s-gift-card-result-mark{width:120px;height:120px;border-radius:9999px;display:inline-flex;align-items:center;justify-content:center;margin-bottom:20px}.s-gift-card-result-mark-success{background:#eaf7f0}.s-gift-card-result-mark-error{background:#fdeaea;color:#fff;font-size:34px}.s-gift-card-result-mark-error i{width:72px;height:72px;border-radius:9999px;background:#ea4b4b;display:inline-flex;align-items:center;justify-content:center}.s-gift-card-result-title{margin:0 0 10px;font-size:19px;font-weight:700;color:#1c1c1c}.s-gift-card-result-text{margin:0 0 22px;font-size:13px;line-height:1.7;color:#6b7280}@media screen and (min-width: 768px){.s-gift-card-panel{padding:22px 24px;display:flex;align-items:center}.s-gift-card-prompt{flex-direction:row;align-items:center;justify-content:space-between;gap:24px;width:100%}.s-gift-card-trigger{flex:0 0 auto}.s-gift-card-form{width:100%}.s-gift-card-result{padding:8px 24px 16px}}.inline{display:inline}.contents{display:contents}.resize{resize:both}.uppercase{text-transform:uppercase}.outline{outline-style:solid}';const l=class{constructor(i){t(this,i),this.theme="default",this.show=!1,this.targetElement=null}handleMouseOver(t){this.targetElement&&this.targetElement.contains(t.target)&&(this.show=!0)}handleMouseOut(t){this.targetElement&&this.targetElement.contains(t.target)&&(this.show=!1)}componentDidLoad(){this.targetElement=document.getElementById(this.targetId)}render(){const t=["default","dark"].includes(this.theme)?this.theme:"default";return s("div",{key:"e78c348a4fdc3eae7b719a8c8f1f115d521a1965",class:"s-tooltip-container"},s("div",{key:"dc2137a53c1f5b2075d8a96d13c16ad216ca9b37",class:`s-tooltip-item s-tooltip-item--${t}`,style:{display:this.show?"block":"none"}},this.text?s("span",null,this.text):s("slot",null)))}get el(){return r(this)}};l.style='/*!twlt*/.s-tooltip-container{position:relative;display:inline-block}.s-tooltip-item{position:absolute;transform:translateX(-63%) translateY(-50%);background-color:var(--color-primary);color:var(--color-primary-reverse);bottom:100%;left:50%;text-align:center;border-radius:5px;z-index:1;white-space:nowrap;transition:opacity 0.3s;pointer-events:none;margin:0 0 16px 8px;padding:12px;max-width:150px;width:190px;white-space:normal;opacity:1}.s-tooltip-item::after{content:"";position:absolute;bottom:-10px;left:50%;margin-left:-5px;border-width:5px;border-style:solid;border-color:var(--color-primary) transparent transparent transparent}.s-tooltip-item:dir(ltr){transform:translateX(-72%)}.s-tooltip-item--dark{background-color:#555555;color:white;padding:5px 15px;border-radius:8px;font-size:12px;font-weight:normal;max-width:330px;width:max-content}.s-tooltip-item--dark::after{border-color:#555555 transparent transparent transparent}.block{display:block}.shadow{--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}';export{a as salla_gift_card_redeem,l as salla_tooltip}