@salla.sa/twilight-components 2.14.489 → 2.14.490

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 (401) hide show
  1. package/dist/cjs/{filepond-C-1J1qrF.js → filepond-DMNwZGDe.js} +1 -1
  2. package/dist/cjs/{filepond-plugin-file-poster-B8fUrKqJ.js → filepond-plugin-file-poster-CwJqn9cv.js} +1 -1
  3. package/dist/cjs/{filepond-plugin-file-validate-size-BJ4Bw3Ju.js → filepond-plugin-file-validate-size-D8HCq_yt.js} +1 -1
  4. package/dist/cjs/{filepond-plugin-file-validate-type-D_Smjf6h.js → filepond-plugin-file-validate-type-DZHIztrf.js} +1 -1
  5. package/dist/cjs/{filepond-plugin-image-edit-BDZBDL-U.js → filepond-plugin-image-edit-DtW6aab5.js} +1 -1
  6. package/dist/cjs/{filepond-plugin-image-exif-orientation-B68mU2op.js → filepond-plugin-image-exif-orientation-DlHuggE7.js} +1 -1
  7. package/dist/cjs/{filepond-plugin-image-preview-B2RzZ9r9.js → filepond-plugin-image-preview-rSt0R5Fs.js} +1 -1
  8. package/dist/cjs/{functions-DdZX56J7.js → functions-Cl4vQLXn.js} +1 -1
  9. package/dist/cjs/{index-DWea49r_.js → index-CfrGmYJa.js} +17 -5
  10. package/dist/cjs/{index-B5CW9Xve.js → index-CrTL2nRh.js} +1 -1
  11. package/dist/cjs/loader.cjs.js +2 -2
  12. package/dist/cjs/salla-accordion-body_2.cjs.entry.js +1 -1
  13. package/dist/cjs/salla-accordion_6.cjs.entry.js +1 -1
  14. package/dist/cjs/salla-add-product-button_5.cjs.entry.js +1 -1
  15. package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
  16. package/dist/cjs/salla-alert_2.cjs.entry.js +1 -1
  17. package/dist/cjs/salla-app-install-alert.cjs.entry.js +1 -1
  18. package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
  19. package/dist/cjs/salla-badge.cjs.entry.js +1 -1
  20. package/dist/cjs/salla-booking-field_7.cjs.entry.js +11 -11
  21. package/dist/cjs/salla-bullet-delivery_2.cjs.entry.js +5 -5
  22. package/dist/cjs/salla-cart-coupons.cjs.entry.js +1 -1
  23. package/dist/cjs/salla-cart-item-offers_2.cjs.entry.js +1 -1
  24. package/dist/cjs/salla-cart-summary-card.cjs.entry.js +1 -1
  25. package/dist/cjs/salla-cashback-banner.cjs.entry.js +1 -1
  26. package/dist/cjs/salla-comment-factors.cjs.entry.js +45 -0
  27. package/dist/cjs/salla-comment-form_8.cjs.entry.js +112 -30
  28. package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
  29. package/dist/cjs/salla-contacts.cjs.entry.js +1 -1
  30. package/dist/cjs/salla-cookies-bar.cjs.entry.js +1 -1
  31. package/dist/cjs/salla-count-down.cjs.entry.js +1 -1
  32. package/dist/cjs/salla-custom-fields.cjs.entry.js +1 -1
  33. package/dist/cjs/salla-delivery-promise.cjs.entry.js +1 -1
  34. package/dist/cjs/salla-edit-order-button.cjs.entry.js +1 -1
  35. package/dist/cjs/salla-filters-widget.cjs.entry.js +1 -1
  36. package/dist/cjs/salla-filters.cjs.entry.js +1 -1
  37. package/dist/cjs/salla-fulfillment-methods.cjs.entry.js +1 -1
  38. package/dist/cjs/salla-gifting.cjs.entry.js +1 -1
  39. package/dist/cjs/salla-hook.cjs.entry.js +1 -1
  40. package/dist/cjs/salla-infinite-scroll.cjs.entry.js +1 -1
  41. package/dist/cjs/salla-installment.cjs.entry.js +1 -1
  42. package/dist/cjs/salla-list-tile.cjs.entry.js +1 -1
  43. package/dist/cjs/salla-localization-modal.cjs.entry.js +1 -1
  44. package/dist/cjs/salla-login-modal.cjs.entry.js +1 -1
  45. package/dist/cjs/salla-loyalty-banner.cjs.entry.js +2 -2
  46. package/dist/cjs/salla-loyalty-hero_2.cjs.entry.js +2 -2
  47. package/dist/cjs/salla-loyalty-panel.cjs.entry.js +3 -3
  48. package/dist/cjs/salla-loyalty-points-banner.cjs.entry.js +1 -1
  49. package/dist/cjs/salla-loyalty-points-history.cjs.entry.js +1 -1
  50. package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
  51. package/dist/cjs/salla-loyalty-program.cjs.entry.js +3 -3
  52. package/dist/cjs/salla-loyalty-reward.cjs.entry.js +2 -2
  53. package/dist/cjs/salla-loyalty.cjs.entry.js +1 -1
  54. package/dist/cjs/salla-maintenance-alert.cjs.entry.js +1 -1
  55. package/dist/cjs/salla-map_2.cjs.entry.js +1 -1
  56. package/dist/cjs/salla-menu.cjs.entry.js +1 -1
  57. package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
  58. package/dist/cjs/salla-multiple-bundle-product-cart_2.cjs.entry.js +1 -1
  59. package/dist/cjs/salla-multiple-bundle-product-options-modal_2.cjs.entry.js +1 -1
  60. package/dist/cjs/salla-multiple-bundle-product.cjs.entry.js +1 -1
  61. package/dist/cjs/salla-next-order-coupon.cjs.entry.js +1 -1
  62. package/dist/cjs/salla-notification-item.cjs.entry.js +1 -1
  63. package/dist/cjs/salla-notifications.cjs.entry.js +1 -1
  64. package/dist/cjs/salla-offer-modal.cjs.entry.js +1 -1
  65. package/dist/cjs/salla-offer.cjs.entry.js +1 -1
  66. package/dist/cjs/salla-order-branch.cjs.entry.js +1 -1
  67. package/dist/cjs/salla-order-cancel.cjs.entry.js +1 -1
  68. package/dist/cjs/salla-order-details-multiple-bundle-product.cjs.entry.js +1 -1
  69. package/dist/cjs/salla-order-details-options.cjs.entry.js +1 -1
  70. package/dist/cjs/salla-order-details.cjs.entry.js +1 -1
  71. package/dist/cjs/salla-order-edit-item.cjs.entry.js +1 -1
  72. package/dist/cjs/salla-order-edit-product-card.cjs.entry.js +1 -1
  73. package/dist/cjs/salla-order-edit.cjs.entry.js +1 -1
  74. package/dist/cjs/salla-order-options-modal_3.cjs.entry.js +1 -1
  75. package/dist/cjs/salla-order-summary.cjs.entry.js +1 -1
  76. package/dist/cjs/salla-order-totals-card.cjs.entry.js +1 -1
  77. package/dist/cjs/salla-orders.cjs.entry.js +1 -1
  78. package/dist/cjs/salla-payments.cjs.entry.js +1 -1
  79. package/dist/cjs/salla-placeholder.cjs.entry.js +1 -1
  80. package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
  81. package/dist/cjs/salla-product-card-embed.cjs.entry.js +1 -1
  82. package/dist/cjs/salla-product-size-guide.cjs.entry.js +1 -1
  83. package/dist/cjs/salla-products-list.cjs.entry.js +1 -1
  84. package/dist/cjs/salla-quick-order.cjs.entry.js +1 -1
  85. package/dist/cjs/salla-rating-modal-v2.cjs.entry.js +1060 -0
  86. package/dist/cjs/salla-rating-modal.cjs.entry.js +38 -14
  87. package/dist/cjs/salla-review-factors-tags.cjs.entry.js +127 -0
  88. package/dist/cjs/salla-reward-action_4.cjs.entry.js +3 -3
  89. package/dist/cjs/salla-scopes.cjs.entry.js +1 -1
  90. package/dist/cjs/salla-search.cjs.entry.js +6 -6
  91. package/dist/cjs/salla-skeleton.cjs.entry.js +2 -2
  92. package/dist/cjs/salla-slider.cjs.entry.js +1 -1
  93. package/dist/cjs/salla-social-share.cjs.entry.js +2 -2
  94. package/dist/cjs/salla-social.cjs.entry.js +2 -2
  95. package/dist/cjs/salla-tab-content_3.cjs.entry.js +4 -4
  96. package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
  97. package/dist/cjs/salla-tooltip.cjs.entry.js +2 -2
  98. package/dist/cjs/salla-trust-badges.cjs.entry.js +1 -1
  99. package/dist/cjs/salla-user-menu.cjs.entry.js +3 -3
  100. package/dist/cjs/salla-user-profile.cjs.entry.js +1 -1
  101. package/dist/cjs/salla-user-settings.cjs.entry.js +2 -2
  102. package/dist/cjs/salla-verify.cjs.entry.js +1 -1
  103. package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
  104. package/dist/cjs/salla-wishlist-actions.cjs.entry.js +2 -2
  105. package/dist/cjs/shipping-fast-CsqEQE78.js +13 -0
  106. package/dist/{esm/star-ZT7ehBBk.js → cjs/star-DMzrN05M.js} +4 -2
  107. package/dist/cjs/{tracked-promise-DNxhV4_1.js → tracked-promise-ClJBjg9o.js} +1 -1
  108. package/dist/cjs/twilight.cjs.js +2 -2
  109. package/dist/cjs/{vanilla-picker-ClijNDRd.js → vanilla-picker-um8NlppX.js} +1 -1
  110. package/dist/collection/collection-manifest.json +3 -0
  111. package/dist/collection/components/salla-comments/salla-comment-factors.js +76 -0
  112. package/dist/collection/components/salla-comments/salla-comment-item.js +20 -6
  113. package/dist/collection/components/salla-comments/salla-comments.css +110 -0
  114. package/dist/collection/components/salla-rating-modal/salla-rating-modal-v2.js +1203 -0
  115. package/dist/collection/components/salla-rating-modal/salla-rating-modal.css +112 -1
  116. package/dist/collection/components/salla-rating-modal/salla-rating-modal.js +33 -2
  117. package/dist/collection/components/salla-rating-stars/salla-rating-stars.css +34 -1
  118. package/dist/collection/components/salla-rating-stars/salla-rating-stars.js +117 -16
  119. package/dist/collection/components/salla-review-factors-tags/helpers.js +86 -0
  120. package/dist/collection/components/salla-review-factors-tags/interfaces.js +1 -0
  121. package/dist/collection/components/salla-review-factors-tags/salla-review-factors-tags.css +41 -0
  122. package/dist/collection/components/salla-review-factors-tags/salla-review-factors-tags.js +135 -0
  123. package/dist/collection/components/salla-reviews/salla-reviews.js +1 -1
  124. package/dist/collection/components/salla-reviews-page/salla-reviews-page.js +1 -1
  125. package/dist/collection/components/salla-reviews-summary/salla-reviews-summary.css +60 -0
  126. package/dist/collection/components/salla-reviews-summary/salla-reviews-summary.js +12 -2
  127. package/dist/collection/components/salla-search/salla-search.js +5 -5
  128. package/dist/collection/components/salla-searchable-dropdown/salla-searchable-dropdown.js +4 -4
  129. package/dist/collection/components/salla-skeleton/salla-skeleton.js +1 -1
  130. package/dist/collection/components/salla-social/salla-social.js +1 -1
  131. package/dist/collection/components/salla-social-share/salla-social-share.js +1 -1
  132. package/dist/collection/components/salla-tabs/salla-tab-content.js +1 -1
  133. package/dist/collection/components/salla-tabs/salla-tab-header.js +1 -1
  134. package/dist/collection/components/salla-tabs/salla-tabs.js +1 -1
  135. package/dist/collection/components/salla-tel-input/salla-tel-input.js +1 -1
  136. package/dist/collection/components/salla-tooltip/salla-tooltip.js +1 -1
  137. package/dist/collection/components/salla-user-settings/salla-user-settings.js +1 -1
  138. package/dist/collection/components/salla-wishlist-actions/salla-wishlist-actions.js +1 -1
  139. package/dist/components/index.js +3 -3
  140. package/dist/components/salla-comment-factors.d.ts +11 -0
  141. package/dist/components/salla-comment-factors.js +9 -0
  142. package/dist/components/salla-comment-factors2.js +66 -0
  143. package/dist/components/salla-comment-item2.js +29 -9
  144. package/dist/components/salla-comments.js +9 -3
  145. package/dist/components/salla-rating-modal-v2.d.ts +11 -0
  146. package/dist/components/salla-rating-modal-v2.js +9 -0
  147. package/dist/components/salla-rating-modal-v22.js +1149 -0
  148. package/dist/components/salla-rating-modal.js +49 -19
  149. package/dist/components/salla-rating-stars2.js +80 -17
  150. package/dist/components/salla-review-factors-tags.d.ts +11 -0
  151. package/dist/components/salla-review-factors-tags.js +149 -0
  152. package/dist/components/salla-reviews-page.js +1 -1
  153. package/dist/components/salla-reviews-summary2.js +13 -3
  154. package/dist/components/salla-reviews.js +1 -1
  155. package/dist/components/salla-search.js +5 -5
  156. package/dist/components/salla-searchable-dropdown2.js +4 -4
  157. package/dist/components/salla-skeleton2.js +1 -1
  158. package/dist/components/salla-social-share2.js +1 -1
  159. package/dist/components/salla-social.js +1 -1
  160. package/dist/components/salla-tab-content2.js +1 -1
  161. package/dist/components/salla-tab-header2.js +1 -1
  162. package/dist/components/salla-tabs2.js +1 -1
  163. package/dist/components/salla-tel-input2.js +1 -1
  164. package/dist/components/salla-tooltip2.js +1 -1
  165. package/dist/components/salla-user-settings.js +1 -1
  166. package/dist/components/salla-wishlist-actions.js +1 -1
  167. package/dist/esm/{filepond-z2hEBvHC.js → filepond-Cg7o_vnN.js} +1 -1
  168. package/dist/esm/{filepond-plugin-file-poster-B9sxi6Yz.js → filepond-plugin-file-poster-BJ1q5i_Q.js} +1 -1
  169. package/dist/esm/{filepond-plugin-file-validate-size-HWpVatr_.js → filepond-plugin-file-validate-size-KAp2gG4p.js} +1 -1
  170. package/dist/esm/{filepond-plugin-file-validate-type-SgpUhQB_.js → filepond-plugin-file-validate-type-D6KC6aKt.js} +1 -1
  171. package/dist/esm/{filepond-plugin-image-edit-0F90Q6lM.js → filepond-plugin-image-edit-CsviUA8z.js} +1 -1
  172. package/dist/esm/{filepond-plugin-image-exif-orientation-CXJDp_1v.js → filepond-plugin-image-exif-orientation-DORQxh2z.js} +1 -1
  173. package/dist/esm/{filepond-plugin-image-preview-APl1nt4k.js → filepond-plugin-image-preview-DiN_MPtQ.js} +1 -1
  174. package/dist/esm/{functions-BCdJLPcs.js → functions-ChcWts7Y.js} +1 -1
  175. package/dist/esm/{index-DNWyGkAx.js → index-DkTbP5UX.js} +17 -5
  176. package/dist/esm/{index-DhwQVX77.js → index-nv62Rr6s.js} +1 -1
  177. package/dist/esm/loader.js +3 -3
  178. package/dist/esm/salla-accordion-body_2.entry.js +1 -1
  179. package/dist/esm/salla-accordion_6.entry.js +1 -1
  180. package/dist/esm/salla-add-product-button_5.entry.js +1 -1
  181. package/dist/esm/salla-advertisement.entry.js +1 -1
  182. package/dist/esm/salla-alert_2.entry.js +1 -1
  183. package/dist/esm/salla-app-install-alert.entry.js +1 -1
  184. package/dist/esm/salla-apps-icons.entry.js +1 -1
  185. package/dist/esm/salla-badge.entry.js +1 -1
  186. package/dist/esm/salla-booking-field_7.entry.js +11 -11
  187. package/dist/esm/salla-bullet-delivery_2.entry.js +5 -5
  188. package/dist/esm/salla-cart-coupons.entry.js +1 -1
  189. package/dist/esm/salla-cart-item-offers_2.entry.js +1 -1
  190. package/dist/esm/salla-cart-summary-card.entry.js +1 -1
  191. package/dist/esm/salla-cashback-banner.entry.js +1 -1
  192. package/dist/esm/salla-comment-factors.entry.js +43 -0
  193. package/dist/esm/salla-comment-form_8.entry.js +112 -30
  194. package/dist/esm/salla-conditional-offer.entry.js +1 -1
  195. package/dist/esm/salla-contacts.entry.js +1 -1
  196. package/dist/esm/salla-cookies-bar.entry.js +1 -1
  197. package/dist/esm/salla-count-down.entry.js +1 -1
  198. package/dist/esm/salla-custom-fields.entry.js +1 -1
  199. package/dist/esm/salla-delivery-promise.entry.js +1 -1
  200. package/dist/esm/salla-edit-order-button.entry.js +1 -1
  201. package/dist/esm/salla-filters-widget.entry.js +1 -1
  202. package/dist/esm/salla-filters.entry.js +1 -1
  203. package/dist/esm/salla-fulfillment-methods.entry.js +1 -1
  204. package/dist/esm/salla-gifting.entry.js +1 -1
  205. package/dist/esm/salla-hook.entry.js +1 -1
  206. package/dist/esm/salla-infinite-scroll.entry.js +1 -1
  207. package/dist/esm/salla-installment.entry.js +1 -1
  208. package/dist/esm/salla-list-tile.entry.js +1 -1
  209. package/dist/esm/salla-localization-modal.entry.js +1 -1
  210. package/dist/esm/salla-login-modal.entry.js +1 -1
  211. package/dist/esm/salla-loyalty-banner.entry.js +2 -2
  212. package/dist/esm/salla-loyalty-hero_2.entry.js +2 -2
  213. package/dist/esm/salla-loyalty-panel.entry.js +3 -3
  214. package/dist/esm/salla-loyalty-points-banner.entry.js +1 -1
  215. package/dist/esm/salla-loyalty-points-history.entry.js +1 -1
  216. package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
  217. package/dist/esm/salla-loyalty-program.entry.js +3 -3
  218. package/dist/esm/salla-loyalty-reward.entry.js +2 -2
  219. package/dist/esm/salla-loyalty.entry.js +1 -1
  220. package/dist/esm/salla-maintenance-alert.entry.js +1 -1
  221. package/dist/esm/salla-map_2.entry.js +1 -1
  222. package/dist/esm/salla-menu.entry.js +1 -1
  223. package/dist/esm/salla-metadata.entry.js +1 -1
  224. package/dist/esm/salla-multiple-bundle-product-cart_2.entry.js +1 -1
  225. package/dist/esm/salla-multiple-bundle-product-options-modal_2.entry.js +1 -1
  226. package/dist/esm/salla-multiple-bundle-product.entry.js +1 -1
  227. package/dist/esm/salla-next-order-coupon.entry.js +1 -1
  228. package/dist/esm/salla-notification-item.entry.js +1 -1
  229. package/dist/esm/salla-notifications.entry.js +1 -1
  230. package/dist/esm/salla-offer-modal.entry.js +1 -1
  231. package/dist/esm/salla-offer.entry.js +1 -1
  232. package/dist/esm/salla-order-branch.entry.js +1 -1
  233. package/dist/esm/salla-order-cancel.entry.js +1 -1
  234. package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +1 -1
  235. package/dist/esm/salla-order-details-options.entry.js +1 -1
  236. package/dist/esm/salla-order-details.entry.js +1 -1
  237. package/dist/esm/salla-order-edit-item.entry.js +1 -1
  238. package/dist/esm/salla-order-edit-product-card.entry.js +1 -1
  239. package/dist/esm/salla-order-edit.entry.js +1 -1
  240. package/dist/esm/salla-order-options-modal_3.entry.js +1 -1
  241. package/dist/esm/salla-order-summary.entry.js +1 -1
  242. package/dist/esm/salla-order-totals-card.entry.js +1 -1
  243. package/dist/esm/salla-orders.entry.js +1 -1
  244. package/dist/esm/salla-payments.entry.js +1 -1
  245. package/dist/esm/salla-placeholder.entry.js +1 -1
  246. package/dist/esm/salla-price-range.entry.js +1 -1
  247. package/dist/esm/salla-product-card-embed.entry.js +1 -1
  248. package/dist/esm/salla-product-size-guide.entry.js +1 -1
  249. package/dist/esm/salla-products-list.entry.js +1 -1
  250. package/dist/esm/salla-quick-order.entry.js +1 -1
  251. package/dist/esm/salla-rating-modal-v2.entry.js +1058 -0
  252. package/dist/esm/salla-rating-modal.entry.js +36 -12
  253. package/dist/esm/salla-review-factors-tags.entry.js +125 -0
  254. package/dist/esm/salla-reward-action_4.entry.js +3 -3
  255. package/dist/esm/salla-scopes.entry.js +1 -1
  256. package/dist/esm/salla-search.entry.js +6 -6
  257. package/dist/esm/salla-skeleton.entry.js +2 -2
  258. package/dist/esm/salla-slider.entry.js +1 -1
  259. package/dist/esm/salla-social-share.entry.js +2 -2
  260. package/dist/esm/salla-social.entry.js +2 -2
  261. package/dist/esm/salla-tab-content_3.entry.js +4 -4
  262. package/dist/esm/salla-tiered-offer.entry.js +1 -1
  263. package/dist/esm/salla-tooltip.entry.js +2 -2
  264. package/dist/esm/salla-trust-badges.entry.js +1 -1
  265. package/dist/esm/salla-user-menu.entry.js +5 -5
  266. package/dist/esm/salla-user-profile.entry.js +1 -1
  267. package/dist/esm/salla-user-settings.entry.js +2 -2
  268. package/dist/esm/salla-verify.entry.js +1 -1
  269. package/dist/esm/salla-wallet.entry.js +1 -1
  270. package/dist/esm/salla-wishlist-actions.entry.js +2 -2
  271. package/dist/esm/shipping-fast-lMgMt31Q.js +11 -0
  272. package/dist/{cjs/star-DGcH7Yso.js → esm/star-CeFAfcTv.js} +2 -4
  273. package/dist/esm/{tracked-promise-CjtqaGP2.js → tracked-promise-BhGtlRVb.js} +1 -1
  274. package/dist/esm/twilight.js +3 -3
  275. package/dist/esm/{vanilla-picker-DPMDb9SB.js → vanilla-picker-CBI_4fLe.js} +1 -1
  276. package/dist/twilight/{p-61813e83.entry.js → p-01240db4.entry.js} +1 -1
  277. package/dist/twilight/{p-90534314.entry.js → p-01cd2407.entry.js} +1 -1
  278. package/dist/twilight/{p-40407996.entry.js → p-02b365bd.entry.js} +1 -1
  279. package/dist/twilight/p-03ab9920.entry.js +4 -0
  280. package/dist/twilight/{p-b5d32897.entry.js → p-03cc6665.entry.js} +1 -1
  281. package/dist/twilight/{p-f9192741.entry.js → p-0a32b0d6.entry.js} +1 -1
  282. package/dist/twilight/{p-1aeeb0f0.entry.js → p-0de58301.entry.js} +1 -1
  283. package/dist/twilight/{p-da66f939.entry.js → p-0e0db003.entry.js} +1 -1
  284. package/dist/twilight/{p-e9cdcf2f.entry.js → p-0f853d19.entry.js} +1 -1
  285. package/dist/twilight/{p-991b1e85.entry.js → p-0f859745.entry.js} +1 -1
  286. package/dist/twilight/{p-26faf85e.entry.js → p-0ff0a5cd.entry.js} +1 -1
  287. package/dist/twilight/{p-fa5fa155.entry.js → p-111e8bd4.entry.js} +1 -1
  288. package/dist/twilight/{p-160fc21e.entry.js → p-1182a8df.entry.js} +1 -1
  289. package/dist/twilight/{p-46cd5ece.entry.js → p-121dc015.entry.js} +1 -1
  290. package/dist/twilight/{p-1a957d13.entry.js → p-15bc19e7.entry.js} +1 -1
  291. package/dist/twilight/{p-5171b440.entry.js → p-18dada14.entry.js} +1 -1
  292. package/dist/twilight/{p-14f8ba23.entry.js → p-1a3e548c.entry.js} +1 -1
  293. package/dist/twilight/{p-7fb92e0b.entry.js → p-1f43ed62.entry.js} +1 -1
  294. package/dist/twilight/{p-3e7a3c6e.entry.js → p-2414aef5.entry.js} +1 -1
  295. package/dist/twilight/{p-3ce46edf.entry.js → p-25bfec19.entry.js} +1 -1
  296. package/dist/twilight/{p-f14fe365.entry.js → p-26211933.entry.js} +1 -1
  297. package/dist/twilight/{p-4ab4e5ea.entry.js → p-2656742a.entry.js} +1 -1
  298. package/dist/twilight/{p-aaf7cbb1.entry.js → p-26594c13.entry.js} +1 -1
  299. package/dist/twilight/{p-06966ed6.entry.js → p-271b69a0.entry.js} +1 -1
  300. package/dist/twilight/{p-9fc965a7.entry.js → p-27ae0022.entry.js} +1 -1
  301. package/dist/twilight/{p-85fc94be.entry.js → p-28318fdf.entry.js} +1 -1
  302. package/dist/twilight/{p-8fec15f8.entry.js → p-28636b6b.entry.js} +1 -1
  303. package/dist/twilight/{p-1efc0eed.entry.js → p-2b6f45d9.entry.js} +1 -1
  304. package/dist/twilight/{p-6852162e.entry.js → p-2bcfed29.entry.js} +1 -1
  305. package/dist/twilight/{p-082f3913.entry.js → p-2e2d9a86.entry.js} +1 -1
  306. package/dist/twilight/{p-78f161f2.entry.js → p-31c63840.entry.js} +1 -1
  307. package/dist/twilight/{p-edc4193f.entry.js → p-38e6442f.entry.js} +1 -1
  308. package/dist/twilight/p-3956807e.entry.js +4 -0
  309. package/dist/twilight/{p-6sBYUIya.js → p-495aeIVH.js} +1 -1
  310. package/dist/twilight/{p-12ccff98.entry.js → p-4b659dd8.entry.js} +1 -1
  311. package/dist/twilight/{p-43a2f42e.entry.js → p-51be1247.entry.js} +1 -1
  312. package/dist/twilight/{p-6ab60f90.entry.js → p-556550d6.entry.js} +1 -1
  313. package/dist/twilight/{p-844c6c1f.entry.js → p-57926552.entry.js} +1 -1
  314. package/dist/twilight/{p-7a0d2f4d.entry.js → p-583b37a5.entry.js} +1 -1
  315. package/dist/twilight/{p-c9aa80c3.entry.js → p-5932a5aa.entry.js} +1 -1
  316. package/dist/twilight/{p-094dcf0c.entry.js → p-5cd89a8e.entry.js} +1 -1
  317. package/dist/twilight/{p-56365c64.entry.js → p-6c74b5a4.entry.js} +1 -1
  318. package/dist/twilight/{p-6891f00b.entry.js → p-7092d5e9.entry.js} +1 -1
  319. package/dist/twilight/{p-b0d5084c.entry.js → p-7331a7d0.entry.js} +1 -1
  320. package/dist/twilight/{p-de942889.entry.js → p-75b9780f.entry.js} +1 -1
  321. package/dist/twilight/{p-ed02b506.entry.js → p-75d071f5.entry.js} +1 -1
  322. package/dist/twilight/{p-5b989746.entry.js → p-78364b26.entry.js} +1 -1
  323. package/dist/twilight/{p-d3f3eed5.entry.js → p-7869e2b4.entry.js} +1 -1
  324. package/dist/twilight/{p-24127075.entry.js → p-789ede46.entry.js} +1 -1
  325. package/dist/twilight/{p-f2e9d83b.entry.js → p-7cb04076.entry.js} +1 -1
  326. package/dist/twilight/{p-6e7a6f4b.entry.js → p-7fa40598.entry.js} +1 -1
  327. package/dist/twilight/{p-f8933bd5.entry.js → p-8430e33c.entry.js} +1 -1
  328. package/dist/twilight/p-8549ed85.entry.js +4 -0
  329. package/dist/twilight/{p-f6d6dada.entry.js → p-88bc9aff.entry.js} +1 -1
  330. package/dist/twilight/{p-c4c32432.entry.js → p-8d83987b.entry.js} +1 -1
  331. package/dist/twilight/{p-9474d525.entry.js → p-956be35f.entry.js} +1 -1
  332. package/dist/twilight/{p-f2dbde1c.entry.js → p-9c27c468.entry.js} +1 -1
  333. package/dist/twilight/{p-Ca18LMTl.js → p-B4xPvvKC.js} +1 -1
  334. package/dist/twilight/{p-C72A7Y44.js → p-Bp81rq7T.js} +1 -1
  335. package/dist/twilight/{p-ZT7ehBBk.js → p-CeFAfcTv.js} +1 -1
  336. package/dist/twilight/{p-DJ3ziTwG.js → p-CszkocSp.js} +2 -2
  337. package/dist/twilight/{p-5wempgCB.js → p-CvcP7d1k.js} +1 -1
  338. package/dist/twilight/{p-Bw7P5SwX.js → p-D1tp_3zr.js} +1 -1
  339. package/dist/twilight/{p-BwggHXVj.js → p-D3lg7_WR.js} +1 -1
  340. package/dist/twilight/{p-DQUSqsnq.js → p-D68AOZPQ.js} +1 -1
  341. package/dist/twilight/{p-DNWyGkAx.js → p-DkTbP5UX.js} +2 -2
  342. package/dist/twilight/{p-3c10826c.entry.js → p-a104a885.entry.js} +1 -1
  343. package/dist/twilight/{p-85c6c44f.entry.js → p-a5310ab5.entry.js} +1 -1
  344. package/dist/twilight/{p-04a6cb8f.entry.js → p-ab8ffcbf.entry.js} +1 -1
  345. package/dist/twilight/{p-0a9af711.entry.js → p-acf6a8f0.entry.js} +1 -1
  346. package/dist/twilight/{p-47dd6817.entry.js → p-ad8111fa.entry.js} +1 -1
  347. package/dist/twilight/{p-cbc66d20.entry.js → p-af41ebe4.entry.js} +1 -1
  348. package/dist/twilight/{p-f01c12dc.entry.js → p-b4fc5871.entry.js} +1 -1
  349. package/dist/twilight/{p-ca028945.entry.js → p-b7916db2.entry.js} +1 -1
  350. package/dist/twilight/{p-e2da0555.entry.js → p-b87ac43c.entry.js} +1 -1
  351. package/dist/twilight/{p-338a55c1.entry.js → p-bdca0d7a.entry.js} +1 -1
  352. package/dist/twilight/{p-6494c6bf.entry.js → p-be44f2e4.entry.js} +1 -1
  353. package/dist/twilight/{p-5993b7d0.entry.js → p-bf50723d.entry.js} +1 -1
  354. package/dist/twilight/{p-a965c431.entry.js → p-c0dd76e3.entry.js} +1 -1
  355. package/dist/twilight/{p-db9dc344.entry.js → p-c3c9b136.entry.js} +1 -1
  356. package/dist/twilight/{p-d239611f.entry.js → p-c583ab13.entry.js} +1 -1
  357. package/dist/twilight/p-c71a6e9c.entry.js +4 -0
  358. package/dist/twilight/{p-ef2d94d3.entry.js → p-c774a729.entry.js} +1 -1
  359. package/dist/twilight/p-c80b8b30.entry.js +4 -0
  360. package/dist/twilight/{p-52283d18.entry.js → p-c9dcf28b.entry.js} +1 -1
  361. package/dist/twilight/{p-C5HojqDY.js → p-cUujZ85s.js} +1 -1
  362. package/dist/twilight/{p-3f924fc5.entry.js → p-ca1c1c50.entry.js} +2 -2
  363. package/dist/twilight/{p-9273a620.entry.js → p-cbbfec66.entry.js} +1 -1
  364. package/dist/twilight/{p-602df9ed.entry.js → p-ce0d56c1.entry.js} +1 -1
  365. package/dist/twilight/{p-7bbea228.entry.js → p-d0eb0e3d.entry.js} +1 -1
  366. package/dist/twilight/{p-08641aeb.entry.js → p-d27c3758.entry.js} +1 -1
  367. package/dist/twilight/p-d617bb3f.entry.js +4 -0
  368. package/dist/twilight/{p-cee1f87a.entry.js → p-d7633d87.entry.js} +1 -1
  369. package/dist/twilight/{p-ac7c0ea4.entry.js → p-d981255b.entry.js} +1 -1
  370. package/dist/twilight/{p-69766916.entry.js → p-d9e7a2a9.entry.js} +1 -1
  371. package/dist/twilight/{p-02e2f661.entry.js → p-dca909c8.entry.js} +1 -1
  372. package/dist/twilight/{p-4b17c9a0.entry.js → p-df9267ca.entry.js} +1 -1
  373. package/dist/twilight/{p-cfc209db.entry.js → p-eba770b4.entry.js} +1 -1
  374. package/dist/twilight/{p-c84ada78.entry.js → p-ee67787c.entry.js} +1 -1
  375. package/dist/twilight/{p-0cd023d2.entry.js → p-f303739b.entry.js} +1 -1
  376. package/dist/twilight/{p-afc451ef.entry.js → p-f834ded2.entry.js} +1 -1
  377. package/dist/twilight/{p-ab2a5243.entry.js → p-f855ad35.entry.js} +1 -1
  378. package/dist/twilight/{p-39b8ffcd.entry.js → p-faf369b8.entry.js} +1 -1
  379. package/dist/twilight/{p-b6cdfd09.entry.js → p-fc26088c.entry.js} +1 -1
  380. package/dist/twilight/{p-Dp4UckOj.js → p-jgiIvZFz.js} +1 -1
  381. package/dist/twilight/p-lMgMt31Q.js +4 -0
  382. package/dist/twilight/{p-CsSICzhL.js → p-qT0_dvbw.js} +1 -1
  383. package/dist/twilight/twilight.esm.js +1 -1
  384. package/dist/types/components/salla-comments/interfaces.d.ts +6 -0
  385. package/dist/types/components/salla-comments/salla-comment-factors.d.ts +6 -0
  386. package/dist/types/components/salla-comments/salla-comment-item.d.ts +3 -0
  387. package/dist/types/components/salla-comments/salla-comments.d.ts +2 -2
  388. package/dist/types/components/salla-rating-modal/order-feedback-response.d.ts +32 -0
  389. package/dist/types/components/salla-rating-modal/salla-rating-modal-v2.d.ts +151 -0
  390. package/dist/types/components/salla-rating-modal/salla-rating-modal.d.ts +5 -1
  391. package/dist/types/components/salla-rating-stars/salla-rating-stars.d.ts +13 -0
  392. package/dist/types/components/salla-review-factors-tags/helpers.d.ts +16 -0
  393. package/dist/types/components/salla-review-factors-tags/interfaces.d.ts +17 -0
  394. package/dist/types/components/salla-review-factors-tags/salla-review-factors-tags.d.ts +24 -0
  395. package/dist/types/components/salla-reviews-summary/interfaces.d.ts +5 -0
  396. package/dist/types/components/salla-reviews-summary/salla-reviews-summary.d.ts +2 -0
  397. package/dist/types/components.d.ts +114 -2
  398. package/package.json +5 -5
  399. package/dist/twilight/p-f12a28f9.entry.js +0 -4
  400. package/dist/twilight/p-f6205375.entry.js +0 -4
  401. package/dist/twilight/p-fc676125.entry.js +0 -4
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as i,h as a}from"./p-DNWyGkAx.js";const t=class{constructor(a){i(this,a)}render(){return a("a",{key:"2573709498a577a39e568d38191ea531e56e5bca",href:this.notification.url,class:{"s-notifications-item":!0,"s-notifications-item-shadow":!0,"s-notifications-item-read":!this.notification.is_new}},a("span",{key:"9cff10cd702cdc37002cb83b9b5d0e60431d86f1",class:"s-notifications-item-icon"},a("i",{key:"a7c40a60acf089b1bd8ea666edd52c6bc433790c",class:{"s-notifications-item-icon sicon-bell-ring":!0,"s-notifications-item-icon-new":this.notification.is_new}})),a("div",{key:"00b34ed21d29b4949f0172e49eae3782f6f2688f",class:"s-notifications-item-content"},a("div",{key:"7be372db8b087dbe961db3602911ea34878ab110",class:"s-notifications-item-content-leading"},a("h4",{key:"18139289b2341d6af1f017b05a75f4302997da6f"},this.notification.title),a("p",{key:"3090714cc101fbda9caa69f7eddba5626fda2e4a"},this.notification.sub_title)),a("span",{key:"b5027892afe18b49562735f757dfa731360b4e41",class:"s-notifications-item-content-trailing"},a("i",{key:"32feaafc7bba48bc7da4a0d4aaac894580650671",class:"sicon-time s-notifications-item-content-trailing-icon"}),a("span",{key:"2187685dcd41610810f7d21be983dcd52caae555"},this.notification.date))))}};t.style="";export{t as salla_notification_item}
4
+ import{r as i,h as a}from"./p-DkTbP5UX.js";const t=class{constructor(a){i(this,a)}render(){return a("a",{key:"2573709498a577a39e568d38191ea531e56e5bca",href:this.notification.url,class:{"s-notifications-item":!0,"s-notifications-item-shadow":!0,"s-notifications-item-read":!this.notification.is_new}},a("span",{key:"9cff10cd702cdc37002cb83b9b5d0e60431d86f1",class:"s-notifications-item-icon"},a("i",{key:"a7c40a60acf089b1bd8ea666edd52c6bc433790c",class:{"s-notifications-item-icon sicon-bell-ring":!0,"s-notifications-item-icon-new":this.notification.is_new}})),a("div",{key:"00b34ed21d29b4949f0172e49eae3782f6f2688f",class:"s-notifications-item-content"},a("div",{key:"7be372db8b087dbe961db3602911ea34878ab110",class:"s-notifications-item-content-leading"},a("h4",{key:"18139289b2341d6af1f017b05a75f4302997da6f"},this.notification.title),a("p",{key:"3090714cc101fbda9caa69f7eddba5626fda2e4a"},this.notification.sub_title)),a("span",{key:"b5027892afe18b49562735f757dfa731360b4e41",class:"s-notifications-item-content-trailing"},a("i",{key:"32feaafc7bba48bc7da4a0d4aaac894580650671",class:"sicon-time s-notifications-item-content-trailing-icon"}),a("span",{key:"2187685dcd41610810f7d21be983dcd52caae555"},this.notification.date))))}};t.style="";export{t as salla_notification_item}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as s,h as t,H as a,a as i}from"./p-DNWyGkAx.js";const r=[{label:"100px",value:"56px"},{label:"72px",value:"64px"},{label:"96px",value:"48px"}],h=class{constructor(t){s(this,t),this.validateForms=!0,this.cartCount=0,this.cartTotal=0,this.cartTotalDiscount=0,this.cartSubTotal=0,this.cartOptionsTotal=0,this.cartShippingCost=0,this.cartTaxAmount=0,this.cartHasShipping=!1,this.isOpen=!1,this.isDesktop=!1,this.isLoading=!0,this.originalParent=null,this.originalNextSibling=null,this.bodyObserver=null,this.mediaQueryList=null,this.submitObserver=null,this.isSubmitting=!1,this.mqlChangeHandler=s=>{this.isDesktop=s.matches,this.applyMode()},this.cartEventNames=["cart::details.fetched","cart::updated","cart::latest.fetched","cart::coupon.added","cart::coupon.deleted"],this.cartEventHandler=s=>this.applyCartData(this.extractCart(s)),this.toggleSheet=()=>{this.isDesktop||(this.isOpen=!this.isOpen)},this.handleSubmit=async s=>{if(this.isSubmitting)return void s.preventDefault();if(this.isSubmitting=!0,this.validateForms&&!await this.validateCartForms())return s.preventDefault(),salla.notify?.error?.(salla.lang?.get?.("common.messages.required_fields")),void(this.isSubmitting=!1);const t=this.host.querySelector("#s-cart-summary-card-submit");"undefined"!=typeof salla&&"guest"!==salla.config?.get?.("user.type")&&t&&(t.load?.(),this.submitObserver?.disconnect(),this.submitObserverTimeout&&clearTimeout(this.submitObserverTimeout),this.submitObserver=new MutationObserver((()=>{t.hasAttribute("loading")||t.setAttribute("loading","")})),this.submitObserver.observe(t,{attributes:!0,attributeFilter:["loading"]}),this.submitObserverTimeout=window.setTimeout((()=>{this.submitObserver?.disconnect(),this.submitObserver=null,t.removeAttribute?.("loading")}),1e4)),salla.cart?.submit?.(),window.setTimeout((()=>{this.isSubmitting=!1}),1500)}}componentWillLoad(){this.mediaQueryList=window.matchMedia(this.desktopMediaQuery()),this.isDesktop=this.mediaQueryList.matches,this.isDesktop&&(this.isOpen=!0),this.init()}async init(){await salla.onReady(),await salla.lang.onLoaded(),this.loadTranslations(),this.cartEventNames.forEach((s=>salla.event.on(s,this.cartEventHandler))),this.fetchCart()}loadTranslations(){this.summaryLabel=salla.lang.get("pages.cart.summary"),this.itemsTotalLabel=salla.lang.get("pages.cart.items_total"),this.itemsTotalNoTaxLabel=salla.lang.get("pages.cart.items_total_without_tax"),this.optionsTotalLabel=salla.lang.get("pages.cart.order_options_total"),this.shippingCostLabel=salla.lang.get("pages.cart.shipping_cost"),this.vatTaxLabel=salla.lang.get("pages.cart.VAT_tax_amount"),this.savedLabel=salla.lang.get("pages.cart.discount"),this.discountBadge=salla.lang.get("pages.cart.saved"),this.finalTotalLabel=salla.lang.get("pages.cart.final_total"),this.pricesTaxedLabel=salla.lang.get("pages.cart.prices_taxed"),this.completeOrderLabel=salla.lang.get("pages.cart.complete_order"),this.openSummaryLabel=salla.lang.get("pages.cart.open_summary"),this.closeSummaryLabel=salla.lang.get("pages.cart.close_summary"),this.itemsCountTemplate=salla.lang.get("pages.cart.items_with_count")}num(s){if(null==s)return 0;if("number"==typeof s)return isFinite(s)?s:0;if("string"==typeof s)return parseFloat(s)||0;if("object"==typeof s){if("amount"in s)return this.num(s.amount);if("value"in s)return this.num(s.value);if("formatted"in s)return this.num(s.formatted)}return 0}breakpointPx(){return 1024}desktopMediaQuery(){return`(min-width: ${this.breakpointPx()}px)`}componentDidLoad(){this.originalParent=this.host.parentElement,this.originalNextSibling=this.host.nextSibling,this.mediaQueryList||(this.mediaQueryList=window.matchMedia(this.desktopMediaQuery()),this.isDesktop=this.mediaQueryList.matches),this.applyMode(),this.mediaQueryList.addEventListener?this.mediaQueryList.addEventListener("change",this.mqlChangeHandler):this.mediaQueryList.addListener(this.mqlChangeHandler)}applyMode(){this.isDesktop?(this.isOpen=!0,this.bodyObserver?.disconnect(),this.bodyObserver=null,this.originalParent&&this.host.parentElement!==this.originalParent&&this.originalParent.insertBefore(this.host,this.originalNextSibling?.parentNode===this.originalParent?this.originalNextSibling:null)):this.pinToBodyEnd()}pinToBodyEnd(){this.host.parentElement===document.body&&document.body.lastElementChild===this.host||document.body.appendChild(this.host),this.bodyObserver||(this.bodyObserver=new MutationObserver((()=>{this.isDesktop||document.body.lastElementChild===this.host||document.body.appendChild(this.host)})),this.bodyObserver.observe(document.body,{childList:!0}))}disconnectedCallback(){Promise.resolve().then((()=>{this.host.isConnected||(this.bodyObserver?.disconnect(),this.submitObserver?.disconnect(),this.submitObserverTimeout&&(clearTimeout(this.submitObserverTimeout),this.submitObserverTimeout=void 0),this.mediaQueryList?.removeEventListener?this.mediaQueryList.removeEventListener("change",this.mqlChangeHandler):this.mediaQueryList?.removeListener(this.mqlChangeHandler),this.mediaQueryList=null,this.cartEventNames.forEach((s=>salla.event.off(s,this.cartEventHandler))))}))}fetchCart(){const s=salla.config?.get?.("page.id"),t=salla.cart?.api?.details?.(s);t&&"function"==typeof t.then?t.then((s=>this.applyCartData(this.extractCart(s)))).catch((()=>this.applyCachedSummary())):this.applyCachedSummary()}applyCachedSummary(){const s=salla.storage?.get?.("cart.summary");s&&"object"==typeof s&&this.applyCartData(s),this.isLoading=!1}extractCart(s){return s?s.data?.cart?s.data.cart:s.cart?s.cart:s:null}applyCartData(s){if(!s)return;this.isLoading=!1,void 0!==s.count&&(this.cartCount=this.num(s.count)),void 0!==s.total&&(this.cartTotal=this.num(s.total));const t=s.total_discount??s.discount;void 0!==t&&(this.cartTotalDiscount=this.num(t)),void 0!==s.sub_total&&(this.cartSubTotal=this.num(s.sub_total)),void 0!==s.options_total&&(this.cartOptionsTotal=this.num(s.options_total)),void 0!==s.tax_amount&&(this.cartTaxAmount=this.num(s.tax_amount));const a=!!s.free_shipping_bar?.has_free_shipping;void 0!==s.shipping_cost?this.cartShippingCost=this.num(s.shipping_cost):void 0!==s.real_shipping_cost&&(this.cartShippingCost=a?0:this.num(s.real_shipping_cost)),this.cartHasShipping=this.cartShippingCost>0||!!s.has_shipping}async validateCartForms(){let s=!0;document.querySelectorAll('form[id^="item-"]').forEach((t=>{t.reportValidity()||(s=!1)}));const t=Array.from(document.querySelectorAll('form[id^="item-"] salla-product-options'));for(const a of t)"function"!=typeof a.reportValidity||await a.reportValidity()||(s=!1);return s}money(s){try{if("undefined"!=typeof salla&&"function"==typeof salla.money)return salla.money(s)}catch(s){}return String(s??0)}getItemsLabel(){return this.itemsCountTemplate?.replace(":count",String(this.cartCount))??""}renderSkeleton(){return t(a,{class:{"s-cart-summary-card":!0,"s-cart-summary-card--loading":!0,"s-cart-summary-card--desktop":this.isDesktop,"s-cart-summary-card--mobile":!this.isDesktop}},this.isDesktop&&t("div",{class:"s-cart-summary-card-sheet-wrap s-cart-summary-card-sheet-wrap--open"},t("div",{class:"s-cart-summary-card-sheet"},t("header",{class:"s-cart-summary-card-sheet-header"},t("h3",{class:"s-cart-summary-card-sheet-title"},t("salla-skeleton",{width:"140px",height:"16px"}))),r.map((({label:s,value:a},i)=>t("div",{class:"s-cart-summary-card-line",key:i},t("salla-skeleton",{width:s,height:"16px"}),t("salla-skeleton",{width:a,height:"16px"})))))),t("div",{class:"s-cart-summary-card-bar"},t("div",{class:"s-cart-summary-card-bar-label"},t("div",{class:"s-cart-summary-card-bar-label-main"},t("salla-skeleton",{width:"90px",height:"16px"}),t("salla-skeleton",{width:"48px",height:"12px"}))),t("div",{class:"s-cart-summary-card-bar-totals"},t("div",{class:"s-cart-summary-card-bar-totals-row"},t("salla-skeleton",{width:"80px",height:"20px"})))),t("div",{class:"s-cart-summary-card-action"},t("salla-skeleton",{width:"100%",height:"44px"})))}render(){if(this.isLoading)return this.renderSkeleton();const s=this.cartTotalDiscount>0,i=this.cartTaxAmount?this.itemsTotalNoTaxLabel:this.itemsTotalLabel;return t(a,{class:{"s-cart-summary-card":!0,"s-cart-summary-card--open":this.isOpen,"s-cart-summary-card--desktop":this.isDesktop,"s-cart-summary-card--mobile":!this.isDesktop}},t("div",{class:{"s-cart-summary-card-sheet-wrap":!0,"s-cart-summary-card-sheet-wrap--open":this.isOpen},"aria-hidden":this.isOpen?"false":"true"},t("div",{class:"s-cart-summary-card-sheet",style:this.isDesktop?{}:{transform:this.isOpen?"translateY(0)":"translateY(100%)",transition:"transform 0.4s cubic-bezier(0.32, 0.72, 0, 1)"}},t("header",{class:"s-cart-summary-card-sheet-header"},t("h3",{class:"s-cart-summary-card-sheet-title"},this.summaryLabel)),t("div",{class:"s-cart-summary-card-line"},t("span",null,i),t("b",{innerHTML:this.money(this.cartSubTotal)})),this.cartOptionsTotal>0&&t("div",{class:"s-cart-summary-card-line"},t("span",null,this.optionsTotalLabel),t("b",{innerHTML:this.money(this.cartOptionsTotal)})),this.cartHasShipping&&t("div",{class:"s-cart-summary-card-line"},t("span",null,this.shippingCostLabel),t("b",{innerHTML:this.money(this.cartShippingCost)})),this.cartTaxAmount>0&&t("div",{class:"s-cart-summary-card-line"},t("span",null,this.vatTaxLabel),t("b",{innerHTML:this.money(this.cartTaxAmount)})),s&&t("div",{class:"s-cart-summary-card-line s-cart-summary-card-line--discount"},t("span",null,this.savedLabel),t("b",null,"− ",t("span",{innerHTML:this.money(this.cartTotalDiscount)}))))),t("div",{class:"s-cart-summary-card-bar"},t("div",{class:"s-cart-summary-card-bar-label"},t("div",{class:"s-cart-summary-card-bar-label-main"},t("span",{class:"s-cart-summary-card-bar-label-text"},this.finalTotalLabel),t("span",{class:"s-cart-summary-card-bar-count"},this.getItemsLabel())),this.cartTaxAmount>0&&t("div",{class:"s-cart-summary-card-bar-label-sub"},this.pricesTaxedLabel)),t("div",{class:"s-cart-summary-card-bar-totals"},t("div",{class:"s-cart-summary-card-bar-totals-row"},s&&t("s",{class:"s-cart-summary-card-bar-original"},salla.helpers.number(this.cartTotal+this.cartTotalDiscount)),t("b",{class:"s-cart-summary-card-bar-total",innerHTML:this.money(this.cartTotal)}),!this.isDesktop&&t("button",{type:"button",class:"s-cart-summary-card-chevron","aria-label":this.isOpen?this.closeSummaryLabel:this.openSummaryLabel,"aria-expanded":this.isOpen?"true":"false",onClick:this.toggleSheet},t("i",{class:"sicon-keyboard_arrow_up s-cart-summary-card-chevron-icon"}))),s&&t("div",{class:"s-cart-summary-card-bar-savings-badge"},t("span",{"aria-hidden":"true"},"🎉"),t("span",null,this.discountBadge," ",t("span",{innerHTML:this.money(this.cartTotalDiscount)}))))),t("div",{class:"s-cart-summary-card-action"},t("salla-button",{id:"s-cart-summary-card-submit",width:"wide","loader-position":"center",onClick:this.handleSubmit},this.completeOrderLabel)))}get host(){return i(this)}};export{h as salla_cart_summary_card}
4
+ import{r as s,h as t,H as a,a as i}from"./p-DkTbP5UX.js";const r=[{label:"100px",value:"56px"},{label:"72px",value:"64px"},{label:"96px",value:"48px"}],h=class{constructor(t){s(this,t),this.validateForms=!0,this.cartCount=0,this.cartTotal=0,this.cartTotalDiscount=0,this.cartSubTotal=0,this.cartOptionsTotal=0,this.cartShippingCost=0,this.cartTaxAmount=0,this.cartHasShipping=!1,this.isOpen=!1,this.isDesktop=!1,this.isLoading=!0,this.originalParent=null,this.originalNextSibling=null,this.bodyObserver=null,this.mediaQueryList=null,this.submitObserver=null,this.isSubmitting=!1,this.mqlChangeHandler=s=>{this.isDesktop=s.matches,this.applyMode()},this.cartEventNames=["cart::details.fetched","cart::updated","cart::latest.fetched","cart::coupon.added","cart::coupon.deleted"],this.cartEventHandler=s=>this.applyCartData(this.extractCart(s)),this.toggleSheet=()=>{this.isDesktop||(this.isOpen=!this.isOpen)},this.handleSubmit=async s=>{if(this.isSubmitting)return void s.preventDefault();if(this.isSubmitting=!0,this.validateForms&&!await this.validateCartForms())return s.preventDefault(),salla.notify?.error?.(salla.lang?.get?.("common.messages.required_fields")),void(this.isSubmitting=!1);const t=this.host.querySelector("#s-cart-summary-card-submit");"undefined"!=typeof salla&&"guest"!==salla.config?.get?.("user.type")&&t&&(t.load?.(),this.submitObserver?.disconnect(),this.submitObserverTimeout&&clearTimeout(this.submitObserverTimeout),this.submitObserver=new MutationObserver((()=>{t.hasAttribute("loading")||t.setAttribute("loading","")})),this.submitObserver.observe(t,{attributes:!0,attributeFilter:["loading"]}),this.submitObserverTimeout=window.setTimeout((()=>{this.submitObserver?.disconnect(),this.submitObserver=null,t.removeAttribute?.("loading")}),1e4)),salla.cart?.submit?.(),window.setTimeout((()=>{this.isSubmitting=!1}),1500)}}componentWillLoad(){this.mediaQueryList=window.matchMedia(this.desktopMediaQuery()),this.isDesktop=this.mediaQueryList.matches,this.isDesktop&&(this.isOpen=!0),this.init()}async init(){await salla.onReady(),await salla.lang.onLoaded(),this.loadTranslations(),this.cartEventNames.forEach((s=>salla.event.on(s,this.cartEventHandler))),this.fetchCart()}loadTranslations(){this.summaryLabel=salla.lang.get("pages.cart.summary"),this.itemsTotalLabel=salla.lang.get("pages.cart.items_total"),this.itemsTotalNoTaxLabel=salla.lang.get("pages.cart.items_total_without_tax"),this.optionsTotalLabel=salla.lang.get("pages.cart.order_options_total"),this.shippingCostLabel=salla.lang.get("pages.cart.shipping_cost"),this.vatTaxLabel=salla.lang.get("pages.cart.VAT_tax_amount"),this.savedLabel=salla.lang.get("pages.cart.discount"),this.discountBadge=salla.lang.get("pages.cart.saved"),this.finalTotalLabel=salla.lang.get("pages.cart.final_total"),this.pricesTaxedLabel=salla.lang.get("pages.cart.prices_taxed"),this.completeOrderLabel=salla.lang.get("pages.cart.complete_order"),this.openSummaryLabel=salla.lang.get("pages.cart.open_summary"),this.closeSummaryLabel=salla.lang.get("pages.cart.close_summary"),this.itemsCountTemplate=salla.lang.get("pages.cart.items_with_count")}num(s){if(null==s)return 0;if("number"==typeof s)return isFinite(s)?s:0;if("string"==typeof s)return parseFloat(s)||0;if("object"==typeof s){if("amount"in s)return this.num(s.amount);if("value"in s)return this.num(s.value);if("formatted"in s)return this.num(s.formatted)}return 0}breakpointPx(){return 1024}desktopMediaQuery(){return`(min-width: ${this.breakpointPx()}px)`}componentDidLoad(){this.originalParent=this.host.parentElement,this.originalNextSibling=this.host.nextSibling,this.mediaQueryList||(this.mediaQueryList=window.matchMedia(this.desktopMediaQuery()),this.isDesktop=this.mediaQueryList.matches),this.applyMode(),this.mediaQueryList.addEventListener?this.mediaQueryList.addEventListener("change",this.mqlChangeHandler):this.mediaQueryList.addListener(this.mqlChangeHandler)}applyMode(){this.isDesktop?(this.isOpen=!0,this.bodyObserver?.disconnect(),this.bodyObserver=null,this.originalParent&&this.host.parentElement!==this.originalParent&&this.originalParent.insertBefore(this.host,this.originalNextSibling?.parentNode===this.originalParent?this.originalNextSibling:null)):this.pinToBodyEnd()}pinToBodyEnd(){this.host.parentElement===document.body&&document.body.lastElementChild===this.host||document.body.appendChild(this.host),this.bodyObserver||(this.bodyObserver=new MutationObserver((()=>{this.isDesktop||document.body.lastElementChild===this.host||document.body.appendChild(this.host)})),this.bodyObserver.observe(document.body,{childList:!0}))}disconnectedCallback(){Promise.resolve().then((()=>{this.host.isConnected||(this.bodyObserver?.disconnect(),this.submitObserver?.disconnect(),this.submitObserverTimeout&&(clearTimeout(this.submitObserverTimeout),this.submitObserverTimeout=void 0),this.mediaQueryList?.removeEventListener?this.mediaQueryList.removeEventListener("change",this.mqlChangeHandler):this.mediaQueryList?.removeListener(this.mqlChangeHandler),this.mediaQueryList=null,this.cartEventNames.forEach((s=>salla.event.off(s,this.cartEventHandler))))}))}fetchCart(){const s=salla.config?.get?.("page.id"),t=salla.cart?.api?.details?.(s);t&&"function"==typeof t.then?t.then((s=>this.applyCartData(this.extractCart(s)))).catch((()=>this.applyCachedSummary())):this.applyCachedSummary()}applyCachedSummary(){const s=salla.storage?.get?.("cart.summary");s&&"object"==typeof s&&this.applyCartData(s),this.isLoading=!1}extractCart(s){return s?s.data?.cart?s.data.cart:s.cart?s.cart:s:null}applyCartData(s){if(!s)return;this.isLoading=!1,void 0!==s.count&&(this.cartCount=this.num(s.count)),void 0!==s.total&&(this.cartTotal=this.num(s.total));const t=s.total_discount??s.discount;void 0!==t&&(this.cartTotalDiscount=this.num(t)),void 0!==s.sub_total&&(this.cartSubTotal=this.num(s.sub_total)),void 0!==s.options_total&&(this.cartOptionsTotal=this.num(s.options_total)),void 0!==s.tax_amount&&(this.cartTaxAmount=this.num(s.tax_amount));const a=!!s.free_shipping_bar?.has_free_shipping;void 0!==s.shipping_cost?this.cartShippingCost=this.num(s.shipping_cost):void 0!==s.real_shipping_cost&&(this.cartShippingCost=a?0:this.num(s.real_shipping_cost)),this.cartHasShipping=this.cartShippingCost>0||!!s.has_shipping}async validateCartForms(){let s=!0;document.querySelectorAll('form[id^="item-"]').forEach((t=>{t.reportValidity()||(s=!1)}));const t=Array.from(document.querySelectorAll('form[id^="item-"] salla-product-options'));for(const a of t)"function"!=typeof a.reportValidity||await a.reportValidity()||(s=!1);return s}money(s){try{if("undefined"!=typeof salla&&"function"==typeof salla.money)return salla.money(s)}catch(s){}return String(s??0)}getItemsLabel(){return this.itemsCountTemplate?.replace(":count",String(this.cartCount))??""}renderSkeleton(){return t(a,{class:{"s-cart-summary-card":!0,"s-cart-summary-card--loading":!0,"s-cart-summary-card--desktop":this.isDesktop,"s-cart-summary-card--mobile":!this.isDesktop}},this.isDesktop&&t("div",{class:"s-cart-summary-card-sheet-wrap s-cart-summary-card-sheet-wrap--open"},t("div",{class:"s-cart-summary-card-sheet"},t("header",{class:"s-cart-summary-card-sheet-header"},t("h3",{class:"s-cart-summary-card-sheet-title"},t("salla-skeleton",{width:"140px",height:"16px"}))),r.map((({label:s,value:a},i)=>t("div",{class:"s-cart-summary-card-line",key:i},t("salla-skeleton",{width:s,height:"16px"}),t("salla-skeleton",{width:a,height:"16px"})))))),t("div",{class:"s-cart-summary-card-bar"},t("div",{class:"s-cart-summary-card-bar-label"},t("div",{class:"s-cart-summary-card-bar-label-main"},t("salla-skeleton",{width:"90px",height:"16px"}),t("salla-skeleton",{width:"48px",height:"12px"}))),t("div",{class:"s-cart-summary-card-bar-totals"},t("div",{class:"s-cart-summary-card-bar-totals-row"},t("salla-skeleton",{width:"80px",height:"20px"})))),t("div",{class:"s-cart-summary-card-action"},t("salla-skeleton",{width:"100%",height:"44px"})))}render(){if(this.isLoading)return this.renderSkeleton();const s=this.cartTotalDiscount>0,i=this.cartTaxAmount?this.itemsTotalNoTaxLabel:this.itemsTotalLabel;return t(a,{class:{"s-cart-summary-card":!0,"s-cart-summary-card--open":this.isOpen,"s-cart-summary-card--desktop":this.isDesktop,"s-cart-summary-card--mobile":!this.isDesktop}},t("div",{class:{"s-cart-summary-card-sheet-wrap":!0,"s-cart-summary-card-sheet-wrap--open":this.isOpen},"aria-hidden":this.isOpen?"false":"true"},t("div",{class:"s-cart-summary-card-sheet",style:this.isDesktop?{}:{transform:this.isOpen?"translateY(0)":"translateY(100%)",transition:"transform 0.4s cubic-bezier(0.32, 0.72, 0, 1)"}},t("header",{class:"s-cart-summary-card-sheet-header"},t("h3",{class:"s-cart-summary-card-sheet-title"},this.summaryLabel)),t("div",{class:"s-cart-summary-card-line"},t("span",null,i),t("b",{innerHTML:this.money(this.cartSubTotal)})),this.cartOptionsTotal>0&&t("div",{class:"s-cart-summary-card-line"},t("span",null,this.optionsTotalLabel),t("b",{innerHTML:this.money(this.cartOptionsTotal)})),this.cartHasShipping&&t("div",{class:"s-cart-summary-card-line"},t("span",null,this.shippingCostLabel),t("b",{innerHTML:this.money(this.cartShippingCost)})),this.cartTaxAmount>0&&t("div",{class:"s-cart-summary-card-line"},t("span",null,this.vatTaxLabel),t("b",{innerHTML:this.money(this.cartTaxAmount)})),s&&t("div",{class:"s-cart-summary-card-line s-cart-summary-card-line--discount"},t("span",null,this.savedLabel),t("b",null,"− ",t("span",{innerHTML:this.money(this.cartTotalDiscount)}))))),t("div",{class:"s-cart-summary-card-bar"},t("div",{class:"s-cart-summary-card-bar-label"},t("div",{class:"s-cart-summary-card-bar-label-main"},t("span",{class:"s-cart-summary-card-bar-label-text"},this.finalTotalLabel),t("span",{class:"s-cart-summary-card-bar-count"},this.getItemsLabel())),this.cartTaxAmount>0&&t("div",{class:"s-cart-summary-card-bar-label-sub"},this.pricesTaxedLabel)),t("div",{class:"s-cart-summary-card-bar-totals"},t("div",{class:"s-cart-summary-card-bar-totals-row"},s&&t("s",{class:"s-cart-summary-card-bar-original"},salla.helpers.number(this.cartTotal+this.cartTotalDiscount)),t("b",{class:"s-cart-summary-card-bar-total",innerHTML:this.money(this.cartTotal)}),!this.isDesktop&&t("button",{type:"button",class:"s-cart-summary-card-chevron","aria-label":this.isOpen?this.closeSummaryLabel:this.openSummaryLabel,"aria-expanded":this.isOpen?"true":"false",onClick:this.toggleSheet},t("i",{class:"sicon-keyboard_arrow_up s-cart-summary-card-chevron-icon"}))),s&&t("div",{class:"s-cart-summary-card-bar-savings-badge"},t("span",{"aria-hidden":"true"},"🎉"),t("span",null,this.discountBadge," ",t("span",{innerHTML:this.money(this.cartTotalDiscount)}))))),t("div",{class:"s-cart-summary-card-action"},t("salla-button",{id:"s-cart-summary-card-submit",width:"wide","loader-position":"center",onClick:this.handleSubmit},this.completeOrderLabel)))}get host(){return i(this)}};export{h as salla_cart_summary_card}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as t,h as s,H as a}from"./p-DNWyGkAx.js";const l=class{constructor(s){t(this,s),this.order=null,this.loading=!0}async componentWillLoad(){await salla.onReady(),await this.loadOrder()}async onOrderIdChange(){this.loading=!0,this.order=null,await this.loadOrder()}get paymentUrl(){return this.order?.customer_editing?.payment_url}async loadOrder(){const t=this.orderId||salla.config.get("page.id");if(t)try{const s=await salla.order.api.getDetails(t);this.order=s?.data??s??null}catch(t){salla.logger?.warn?.("[salla-edit-order-button] failed to fetch order details",t),this.order=null}finally{this.loading=!1}else this.loading=!1}renderEditButton(){return s("salla-count-down",{prefixText:salla.lang.getWithDefault("pages.orders.edit_within","يمكنك التعديل خلال"),buttonHref:this.order?.edit_url,buttonText:salla.lang.getWithDefault("pages.orders.edit_order","تعديل الطلب"),buttonIcon:"sicon-edit",date:this.order?.editable_until,horizontal:!0,autoSegments:!0,withButton:!0,labeled:!1,size:"sm",color:"primary"})}render(){return this.loading||!this.order?null:this.order?.is_editable?s(a,null,this.renderEditButton()):this.paymentUrl?s(a,null,s("salla-button",{href:this.paymentUrl,color:"primary",size:"small"},s("i",{class:"sicon-wallet"}),salla.lang.getWithDefault("pages.orders.pay_difference","دفع فارق المبلغ"))):null}static get watchers(){return{orderId:["onOrderIdChange"]}}};l.style=":host{display:block}";export{l as salla_edit_order_button}
4
+ import{r as t,h as s,H as a}from"./p-DkTbP5UX.js";const l=class{constructor(s){t(this,s),this.order=null,this.loading=!0}async componentWillLoad(){await salla.onReady(),await this.loadOrder()}async onOrderIdChange(){this.loading=!0,this.order=null,await this.loadOrder()}get paymentUrl(){return this.order?.customer_editing?.payment_url}async loadOrder(){const t=this.orderId||salla.config.get("page.id");if(t)try{const s=await salla.order.api.getDetails(t);this.order=s?.data??s??null}catch(t){salla.logger?.warn?.("[salla-edit-order-button] failed to fetch order details",t),this.order=null}finally{this.loading=!1}else this.loading=!1}renderEditButton(){return s("salla-count-down",{prefixText:salla.lang.getWithDefault("pages.orders.edit_within","يمكنك التعديل خلال"),buttonHref:this.order?.edit_url,buttonText:salla.lang.getWithDefault("pages.orders.edit_order","تعديل الطلب"),buttonIcon:"sicon-edit",date:this.order?.editable_until,horizontal:!0,autoSegments:!0,withButton:!0,labeled:!1,size:"sm",color:"primary"})}render(){return this.loading||!this.order?null:this.order?.is_editable?s(a,null,this.renderEditButton()):this.paymentUrl?s(a,null,s("salla-button",{href:this.paymentUrl,color:"primary",size:"small"},s("i",{class:"sicon-wallet"}),salla.lang.getWithDefault("pages.orders.pay_difference","دفع فارق المبلغ"))):null}static get watchers(){return{orderId:["onOrderIdChange"]}}};l.style=":host{display:block}";export{l as salla_edit_order_button}
@@ -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,a}from"./p-DNWyGkAx.js";import{P as l}from"./p-DY4LZmNP.js";import{I as o}from"./p-C-tzSDxw.js";const i=class{constructor(t){e(this,t),this.variant="info"}renderIcon(){const e=this.icon||this.variant;if("none"===e)return null;switch(e){case"success":return t("svg",{viewBox:"0 0 24 24",width:"20",height:"20",fill:"currentColor"},t("path",{d:"M9 16.2l-3.5-3.5L4 14.2l5 5 11-11-1.5-1.5z"}));case"warning":return t("svg",{viewBox:"0 0 24 24",width:"20",height:"20",fill:"currentColor"},t("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"}));case"error":return t("svg",{viewBox:"0 0 24 24",width:"20",height:"20",fill:"currentColor"},t("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 \n 10 10 10-4.48 10-10S17.52 2 12 2zm5 \n 13.59L15.59 17 12 13.41 8.41 17 \n 7 15.59 10.59 12 7 8.41 8.41 7 \n 12 10.59 15.59 7 17 8.41 13.41 \n 12 17 15.59z"}));default:return t("span",{innerHTML:'<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M9.99935 18.3332C5.39697 18.3332 1.66602 14.6022 1.66602 9.99984C1.66602 5.39746 5.39697 1.6665 9.99935 1.6665C14.6017 1.6665 18.3327 5.39746 18.3327 9.99984C18.3327 14.6022 14.6017 18.3332 9.99935 18.3332ZM9.99935 16.6665C13.6813 16.6665 16.666 13.6818 16.666 9.99984C16.666 6.31794 13.6813 3.33317 9.99935 3.33317C6.31745 3.33317 3.33268 6.31794 3.33268 9.99984C3.33268 13.6818 6.31745 16.6665 9.99935 16.6665ZM9.16602 5.83317H10.8327V7.49984H9.16602V5.83317ZM9.16602 9.1665H10.8327V14.1665H9.16602V9.1665Z" fill="#417AC8"/>\n</svg>\n'})}}render(){return t(s,{key:"e26a52cc275ac4c2e4090c113cb7e7d4d578fc11",class:`s-alert-wrapper s-alert-${this.variant}`},t("span",{key:"bdb1c6693b226a4e136e89640fcc19fbefc6e29e",class:"s-alert-icon"},this.renderIcon()),t("span",{key:"de8997f9617e74fc082ae9603bf16eac4c0a4b17",class:"s-alert-text"},this.message,t("slot",{key:"37fb1adba1fa7f0226143250632cf20b514ee06b"})))}};i.style=":host{display:block}";const n=class{constructor(t){e(this,t),this.storeId=salla.config.get("store.id"),this.template=salla.config.get("store.template"),this.loading=!1,this.templateData={},this.defaultMessage=salla.lang.getWithDefault("common.elements.store_is_available_for_purchase","هذا المتجر تطويري ومتاح للشراء من"),this.defaultActionLabel=salla.lang.get("common.elements.know_more"),this.storeFeatures=salla.lang.get("common.elements.store_features"),this.storeDetails=salla.lang.get("common.elements.store_details"),this.storePrice=salla.lang.getWithDefault("common.elements.store_price","سعر المتجر"),this.storePriceDetails=salla.lang.getWithDefault("common.elements.store_price_details","السعر يشمل"),this.theDeveloper=salla.lang.get("common.elements.the_developer"),this.templateInformation=salla.lang.get("common.elements.template_information"),this.buyTheTemplate=salla.lang.get("common.elements.buy_the_template"),this.isRtl=salla.config.get("theme.is_rtl",!0),this.storeName=salla.config.get("store.name"),this.salla=salla.lang.getWithDefault("common.elements.salla","سلة"),this.readyStores=salla.lang.getWithDefault("common.elements.ready_stores","المتاجر الجاهزة"),this.moreDetailsLabel=salla.lang.getWithDefault("common.elements.more_details","تفاصيل أكثر"),this.type="popup",salla.lang.onLoaded((()=>{this.defaultMessage=salla.lang.get("common.elements.experimental_and_available_store"),this.defaultActionLabel=salla.lang.get("common.elements.know_more"),this.storeFeatures=salla.lang.get("common.elements.store_features"),this.storeDetails=salla.lang.get("common.elements.store_details"),this.templateInformation=salla.lang.get("common.elements.template_information"),this.buyTheTemplate=salla.lang.get("common.elements.buy_the_template");const e=salla.lang.messages?.["ar.trans"],t=salla.lang.messages?.["en.trans"];e&&t&&(salla.helpers.setNested(e,"common.elements.more_details","تفاصيل أكثر"),salla.helpers.setNested(t,"common.elements.more_details","More Details"),salla.helpers.setNested(e,"common.elements.store_price","سعر المتجر"),salla.helpers.setNested(t,"common.elements.store_price","Store Price"),salla.helpers.setNested(e,"common.elements.the_developer","المطور"),salla.helpers.setNested(t,"common.elements.the_developer","the developer"),salla.helpers.setNested(e,"common.elements.store_price_details","السعر يشمل"),salla.helpers.setNested(t,"common.elements.store_price_details","Price Includes"),salla.helpers.setNested(e,"common.elements.salla","سلة"),salla.helpers.setNested(t,"common.elements.salla","Salla"),salla.helpers.setNested(e,"common.elements.store_is_available_for_purchase","هذا المتجر تطويري ومتاح للشراء من"),salla.helpers.setNested(t,"common.elements.store_is_available_for_purchase","This ready store is available for purchase from"),salla.helpers.setNested(e,"common.elements.ready_stores","المتاجر الجاهزة"),salla.helpers.setNested(t,"common.elements.ready_stores","Ready Stores"),setTimeout((()=>{this.storePrice=salla.lang.get("common.elements.store_price"),this.theDeveloper=salla.lang.get("common.elements.the_developer"),this.storePriceDetails=salla.lang.getWithDefault("common.elements.store_price_details","السعر يشمل"),this.salla=salla.lang.getWithDefault("common.elements.salla","سلة"),this.defaultMessage=salla.lang.getWithDefault("common.elements.store_is_available_for_purchase","هذا المتجر تطويري ومتاح للشراء من"),this.readyStores=salla.lang.getWithDefault("common.elements.ready_stores","المتاجر الجاهزة"),this.moreDetailsLabel=salla.lang.getWithDefault("common.elements.more_details","More Details")}),100))}))}componentDidLoad(){this.template&&"object"==typeof this.template&&Object.keys(this.template).length>0&&this.fetchTemplateData()}open(){return this.drawer.open()}fetchTemplateData(){if(!Object.keys(this.templateData).length)return this.loading=!0,salla.api.request("/store/template",{},"get",{"Store-Identifier":this.storeId}).then((e=>{this.templateData=e.data,this.loading=!1})).catch((()=>{this.loading=!1}))}handleAction(){"link"===this.type&&(window.location.href=this.actionUrl),"popup"===this.type&&this.open()}popup(){return t("salla-drawer",{class:"s-bottom-alert-modal",ref:e=>this.drawer=e,"no-padding":!0,onLoad:()=>{this.drawer&&Object.keys(this.templateData).length&&this.drawer.setTitle(this.storeDetails+" "+this.storeName)}},Object.keys(this.templateData).length?[t("div",{class:"s-bottom-alert-modal-inner s-scrollbar"},t("div",{class:{"s-bottom-alert-modal-content":!0}},this.templateData?.features?[t("div",{class:"s-bottom-alert-modal-content-title"},t("i",{innerHTML:o,class:"s-bottom-alert-modal-content-icon"}),t("span",null,this.storeFeatures)),t("div",{class:"s-bottom-alert-modal-content-features",innerHTML:this.templateData?.features})]:""),t("div",{class:{"s-bottom-alert-modal-content":!0,"s-bottom-alert-modal-content-extra-padding":this.templateData?.price}},this.templateData?.features?[t("div",{class:"s-bottom-alert-modal-content-title"},t("i",{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>money-card</title>\n<path d="M17.333 14.667h-2.667c-0.736 0-1.333-0.599-1.333-1.333s0.597-1.333 1.333-1.333h4c0.737 0 1.333-0.597 1.333-1.333s-0.596-1.333-1.333-1.333h-1.333v-1.333c0-0.736-0.596-1.333-1.333-1.333s-1.333 0.597-1.333 1.333v1.333c-2.205 0-4 1.795-4 4s1.795 4 4 4h2.667c0.736 0 1.333 0.597 1.333 1.333s-0.597 1.333-1.333 1.333h-4c-0.737 0-1.333 0.596-1.333 1.333s0.596 1.333 1.333 1.333h1.333v1.333c0 0.737 0.596 1.333 1.333 1.333s1.333-0.596 1.333-1.333v-1.333c2.205 0 4-1.795 4-4s-1.795-4-4-4zM28 2.667h-24c-2.205 0-4 1.795-4 4v18.667c0 2.205 1.795 4 4 4h24c2.205 0 4-1.795 4-4v-18.667c0-2.205-1.795-4-4-4zM29.333 25.333c0 0.736-0.597 1.333-1.333 1.333h-24c-0.736 0-1.333-0.597-1.333-1.333v-18.667c0-0.735 0.597-1.333 1.333-1.333h24c0.736 0 1.333 0.599 1.333 1.333z"></path>\n</svg>\n',class:"s-bottom-alert-modal-content-icon"}),t("span",null,this.storePriceDetails)),t("div",{class:"s-bottom-alert-modal-content-price-details"},this.templateData?.price_details?.items.map((e=>t("div",{class:"s-bottom-alert-modal-content-price-details-item"},t("i",{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>check-circle</title>\n<path d="M19.557 11.26l-4.593 6.891-2.891-1.927c-0.616-0.411-1.441-0.243-1.849 0.369-0.409 0.612-0.244 1.441 0.369 1.849l4 2.667c0.228 0.152 0.485 0.224 0.739 0.224 0.431 0 0.855-0.208 1.111-0.593l5.333-8c0.409-0.612 0.244-1.441-0.369-1.849-0.616-0.411-1.443-0.243-1.849 0.369zM16 0c-8.823 0-16 7.177-16 16s7.177 16 16 16 16-7.177 16-16-7.177-16-16-16zM16 29.333c-7.352 0-13.333-5.981-13.333-13.333s5.981-13.333 13.333-13.333 13.333 5.981 13.333 13.333-5.981 13.333-13.333 13.333z"></path>\n</svg>\n',class:"s-bottom-alert-modal-content-price-details-item-icon"}),t("span",{class:"s-bottom-alert-modal-content-price-details-item-name"},e.name),t("span",{class:"s-bottom-alert-modal-content-price-details-item-price",innerHTML:salla.money(e.price)})))))]:""),this.templateData?.link?t("div",{class:"s-bottom-alert-modal-content-footer"},t("salla-button",{color:"primary",size:"medium",width:"wide",href:this.templateData?.link},t("i",{innerHTML:l}),this.buyTheTemplate)):"")]:"")}render(){const e=this.template&&"object"==typeof this.template&&Object.keys(this.template).length>0;return t(s,{key:"1e598df3c91be1e357fc5d771061ec386573f968",class:"s-bottom-alert-wrapper "+(e?"s-bottom-alert-wrapper-with-template":"")},e&&t("div",{key:"20a0173dfa6a01b793f8e1e9416d295ee4e61783",class:"s-bottom-alert-logo-section"},t("img",{key:"2c9042f0ce022aeb9b2879496ec2837ed14dfe9f",src:"https://cdn.salla.network/images/logo/logo-light.svg",alt:"Salla",class:"s-bottom-alert-logo"}),t("span",{key:"69c2bc09acca8a535d2f982131ccc09d65ea44e6",class:"s-bottom-alert-logo-text"},this.readyStores)),t("div",{key:"553122bac6f1f11c2bcc41a92ac798b3701ebfb9",class:"s-bottom-alert-content"},t("div",{key:"e0df96405998b70c15a8320c8400fa75db77d041",class:"flex items-center gap-2"},t("div",{key:"26f241c725c763dfc25f58cdcd0f2979571a2061",class:"s-bottom-alert-icon"},t("i",this.icon?{class:this.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>info</title>\n<path d="M16 13.333c-0.737 0-1.333 0.596-1.333 1.333v9.333c0 0.737 0.596 1.333 1.333 1.333s1.333-0.596 1.333-1.333v-9.333c0-0.737-0.596-1.333-1.333-1.333zM16 7.987c-0.737 0-1.333 0.596-1.333 1.333v0.013c0 0.737 0.596 1.327 1.333 1.327s1.333-0.603 1.333-1.34-0.596-1.333-1.333-1.333zM16 0c-8.823 0-16 7.177-16 16s7.177 16 16 16 16-7.177 16-16-7.177-16-16-16zM16 29.333c-7.352 0-13.333-5.981-13.333-13.333s5.981-13.333 13.333-13.333 13.333 5.981 13.333 13.333-5.981 13.333-13.333 13.333z"></path>\n</svg>\n'})),t("div",{key:"5e6ba42a2924aec3b99050e8f53634716023a535",class:"s-bottom-alert-message"},this.message?this.message:e?t("span",{class:"flex flex-wrap items-center gap-1"},this.defaultMessage,t("span",{class:{"s-bottom-alert-message-highlight":!0},"aria-label":"Developer"},this.salla),t("span",{innerHTML:salla.money(this.template.price)})):this.defaultMessage)),"banner"!==this.type&&t("div",{key:"44c4d9499736d84da97b640b8ab063a6b9dd6d3c",class:e?"s-bottom-alert-actions-group":"s-bottom-alert-action"},e?this.loading?t("salla-loading",{size:"20"}):t("div",{class:"s-bottom-alert-actions-group-container"},t("a",{class:"s-bottom-alert-action-link",onClick:()=>this.handleAction()},this.actionLabel||this.moreDetailsLabel),this.templateData?.link?t("button",{type:"button",class:"s-bottom-alert-action-purchase-button",onClick:()=>window.open(this.templateData?.link,"_blank")},this.buyTheTemplate):null):t("salla-button",{href:this.actionUrl,size:"medium",onClick:()=>this.handleAction(),width:"normal"},this.actionLabel||this.defaultActionLabel)),"popup"===this.type&&this.popup()))}get host(){return a(this)}};n.style=":host{display:block}";export{i as salla_alert,n as salla_bottom_alert}
4
+ import{r as e,h as t,H as s,a}from"./p-DkTbP5UX.js";import{P as l}from"./p-DY4LZmNP.js";import{I as o}from"./p-C-tzSDxw.js";const i=class{constructor(t){e(this,t),this.variant="info"}renderIcon(){const e=this.icon||this.variant;if("none"===e)return null;switch(e){case"success":return t("svg",{viewBox:"0 0 24 24",width:"20",height:"20",fill:"currentColor"},t("path",{d:"M9 16.2l-3.5-3.5L4 14.2l5 5 11-11-1.5-1.5z"}));case"warning":return t("svg",{viewBox:"0 0 24 24",width:"20",height:"20",fill:"currentColor"},t("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"}));case"error":return t("svg",{viewBox:"0 0 24 24",width:"20",height:"20",fill:"currentColor"},t("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 \n 10 10 10-4.48 10-10S17.52 2 12 2zm5 \n 13.59L15.59 17 12 13.41 8.41 17 \n 7 15.59 10.59 12 7 8.41 8.41 7 \n 12 10.59 15.59 7 17 8.41 13.41 \n 12 17 15.59z"}));default:return t("span",{innerHTML:'<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M9.99935 18.3332C5.39697 18.3332 1.66602 14.6022 1.66602 9.99984C1.66602 5.39746 5.39697 1.6665 9.99935 1.6665C14.6017 1.6665 18.3327 5.39746 18.3327 9.99984C18.3327 14.6022 14.6017 18.3332 9.99935 18.3332ZM9.99935 16.6665C13.6813 16.6665 16.666 13.6818 16.666 9.99984C16.666 6.31794 13.6813 3.33317 9.99935 3.33317C6.31745 3.33317 3.33268 6.31794 3.33268 9.99984C3.33268 13.6818 6.31745 16.6665 9.99935 16.6665ZM9.16602 5.83317H10.8327V7.49984H9.16602V5.83317ZM9.16602 9.1665H10.8327V14.1665H9.16602V9.1665Z" fill="#417AC8"/>\n</svg>\n'})}}render(){return t(s,{key:"e26a52cc275ac4c2e4090c113cb7e7d4d578fc11",class:`s-alert-wrapper s-alert-${this.variant}`},t("span",{key:"bdb1c6693b226a4e136e89640fcc19fbefc6e29e",class:"s-alert-icon"},this.renderIcon()),t("span",{key:"de8997f9617e74fc082ae9603bf16eac4c0a4b17",class:"s-alert-text"},this.message,t("slot",{key:"37fb1adba1fa7f0226143250632cf20b514ee06b"})))}};i.style=":host{display:block}";const n=class{constructor(t){e(this,t),this.storeId=salla.config.get("store.id"),this.template=salla.config.get("store.template"),this.loading=!1,this.templateData={},this.defaultMessage=salla.lang.getWithDefault("common.elements.store_is_available_for_purchase","هذا المتجر تطويري ومتاح للشراء من"),this.defaultActionLabel=salla.lang.get("common.elements.know_more"),this.storeFeatures=salla.lang.get("common.elements.store_features"),this.storeDetails=salla.lang.get("common.elements.store_details"),this.storePrice=salla.lang.getWithDefault("common.elements.store_price","سعر المتجر"),this.storePriceDetails=salla.lang.getWithDefault("common.elements.store_price_details","السعر يشمل"),this.theDeveloper=salla.lang.get("common.elements.the_developer"),this.templateInformation=salla.lang.get("common.elements.template_information"),this.buyTheTemplate=salla.lang.get("common.elements.buy_the_template"),this.isRtl=salla.config.get("theme.is_rtl",!0),this.storeName=salla.config.get("store.name"),this.salla=salla.lang.getWithDefault("common.elements.salla","سلة"),this.readyStores=salla.lang.getWithDefault("common.elements.ready_stores","المتاجر الجاهزة"),this.moreDetailsLabel=salla.lang.getWithDefault("common.elements.more_details","تفاصيل أكثر"),this.type="popup",salla.lang.onLoaded((()=>{this.defaultMessage=salla.lang.get("common.elements.experimental_and_available_store"),this.defaultActionLabel=salla.lang.get("common.elements.know_more"),this.storeFeatures=salla.lang.get("common.elements.store_features"),this.storeDetails=salla.lang.get("common.elements.store_details"),this.templateInformation=salla.lang.get("common.elements.template_information"),this.buyTheTemplate=salla.lang.get("common.elements.buy_the_template");const e=salla.lang.messages?.["ar.trans"],t=salla.lang.messages?.["en.trans"];e&&t&&(salla.helpers.setNested(e,"common.elements.more_details","تفاصيل أكثر"),salla.helpers.setNested(t,"common.elements.more_details","More Details"),salla.helpers.setNested(e,"common.elements.store_price","سعر المتجر"),salla.helpers.setNested(t,"common.elements.store_price","Store Price"),salla.helpers.setNested(e,"common.elements.the_developer","المطور"),salla.helpers.setNested(t,"common.elements.the_developer","the developer"),salla.helpers.setNested(e,"common.elements.store_price_details","السعر يشمل"),salla.helpers.setNested(t,"common.elements.store_price_details","Price Includes"),salla.helpers.setNested(e,"common.elements.salla","سلة"),salla.helpers.setNested(t,"common.elements.salla","Salla"),salla.helpers.setNested(e,"common.elements.store_is_available_for_purchase","هذا المتجر تطويري ومتاح للشراء من"),salla.helpers.setNested(t,"common.elements.store_is_available_for_purchase","This ready store is available for purchase from"),salla.helpers.setNested(e,"common.elements.ready_stores","المتاجر الجاهزة"),salla.helpers.setNested(t,"common.elements.ready_stores","Ready Stores"),setTimeout((()=>{this.storePrice=salla.lang.get("common.elements.store_price"),this.theDeveloper=salla.lang.get("common.elements.the_developer"),this.storePriceDetails=salla.lang.getWithDefault("common.elements.store_price_details","السعر يشمل"),this.salla=salla.lang.getWithDefault("common.elements.salla","سلة"),this.defaultMessage=salla.lang.getWithDefault("common.elements.store_is_available_for_purchase","هذا المتجر تطويري ومتاح للشراء من"),this.readyStores=salla.lang.getWithDefault("common.elements.ready_stores","المتاجر الجاهزة"),this.moreDetailsLabel=salla.lang.getWithDefault("common.elements.more_details","More Details")}),100))}))}componentDidLoad(){this.template&&"object"==typeof this.template&&Object.keys(this.template).length>0&&this.fetchTemplateData()}open(){return this.drawer.open()}fetchTemplateData(){if(!Object.keys(this.templateData).length)return this.loading=!0,salla.api.request("/store/template",{},"get",{"Store-Identifier":this.storeId}).then((e=>{this.templateData=e.data,this.loading=!1})).catch((()=>{this.loading=!1}))}handleAction(){"link"===this.type&&(window.location.href=this.actionUrl),"popup"===this.type&&this.open()}popup(){return t("salla-drawer",{class:"s-bottom-alert-modal",ref:e=>this.drawer=e,"no-padding":!0,onLoad:()=>{this.drawer&&Object.keys(this.templateData).length&&this.drawer.setTitle(this.storeDetails+" "+this.storeName)}},Object.keys(this.templateData).length?[t("div",{class:"s-bottom-alert-modal-inner s-scrollbar"},t("div",{class:{"s-bottom-alert-modal-content":!0}},this.templateData?.features?[t("div",{class:"s-bottom-alert-modal-content-title"},t("i",{innerHTML:o,class:"s-bottom-alert-modal-content-icon"}),t("span",null,this.storeFeatures)),t("div",{class:"s-bottom-alert-modal-content-features",innerHTML:this.templateData?.features})]:""),t("div",{class:{"s-bottom-alert-modal-content":!0,"s-bottom-alert-modal-content-extra-padding":this.templateData?.price}},this.templateData?.features?[t("div",{class:"s-bottom-alert-modal-content-title"},t("i",{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>money-card</title>\n<path d="M17.333 14.667h-2.667c-0.736 0-1.333-0.599-1.333-1.333s0.597-1.333 1.333-1.333h4c0.737 0 1.333-0.597 1.333-1.333s-0.596-1.333-1.333-1.333h-1.333v-1.333c0-0.736-0.596-1.333-1.333-1.333s-1.333 0.597-1.333 1.333v1.333c-2.205 0-4 1.795-4 4s1.795 4 4 4h2.667c0.736 0 1.333 0.597 1.333 1.333s-0.597 1.333-1.333 1.333h-4c-0.737 0-1.333 0.596-1.333 1.333s0.596 1.333 1.333 1.333h1.333v1.333c0 0.737 0.596 1.333 1.333 1.333s1.333-0.596 1.333-1.333v-1.333c2.205 0 4-1.795 4-4s-1.795-4-4-4zM28 2.667h-24c-2.205 0-4 1.795-4 4v18.667c0 2.205 1.795 4 4 4h24c2.205 0 4-1.795 4-4v-18.667c0-2.205-1.795-4-4-4zM29.333 25.333c0 0.736-0.597 1.333-1.333 1.333h-24c-0.736 0-1.333-0.597-1.333-1.333v-18.667c0-0.735 0.597-1.333 1.333-1.333h24c0.736 0 1.333 0.599 1.333 1.333z"></path>\n</svg>\n',class:"s-bottom-alert-modal-content-icon"}),t("span",null,this.storePriceDetails)),t("div",{class:"s-bottom-alert-modal-content-price-details"},this.templateData?.price_details?.items.map((e=>t("div",{class:"s-bottom-alert-modal-content-price-details-item"},t("i",{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>check-circle</title>\n<path d="M19.557 11.26l-4.593 6.891-2.891-1.927c-0.616-0.411-1.441-0.243-1.849 0.369-0.409 0.612-0.244 1.441 0.369 1.849l4 2.667c0.228 0.152 0.485 0.224 0.739 0.224 0.431 0 0.855-0.208 1.111-0.593l5.333-8c0.409-0.612 0.244-1.441-0.369-1.849-0.616-0.411-1.443-0.243-1.849 0.369zM16 0c-8.823 0-16 7.177-16 16s7.177 16 16 16 16-7.177 16-16-7.177-16-16-16zM16 29.333c-7.352 0-13.333-5.981-13.333-13.333s5.981-13.333 13.333-13.333 13.333 5.981 13.333 13.333-5.981 13.333-13.333 13.333z"></path>\n</svg>\n',class:"s-bottom-alert-modal-content-price-details-item-icon"}),t("span",{class:"s-bottom-alert-modal-content-price-details-item-name"},e.name),t("span",{class:"s-bottom-alert-modal-content-price-details-item-price",innerHTML:salla.money(e.price)})))))]:""),this.templateData?.link?t("div",{class:"s-bottom-alert-modal-content-footer"},t("salla-button",{color:"primary",size:"medium",width:"wide",href:this.templateData?.link},t("i",{innerHTML:l}),this.buyTheTemplate)):"")]:"")}render(){const e=this.template&&"object"==typeof this.template&&Object.keys(this.template).length>0;return t(s,{key:"1e598df3c91be1e357fc5d771061ec386573f968",class:"s-bottom-alert-wrapper "+(e?"s-bottom-alert-wrapper-with-template":"")},e&&t("div",{key:"20a0173dfa6a01b793f8e1e9416d295ee4e61783",class:"s-bottom-alert-logo-section"},t("img",{key:"2c9042f0ce022aeb9b2879496ec2837ed14dfe9f",src:"https://cdn.salla.network/images/logo/logo-light.svg",alt:"Salla",class:"s-bottom-alert-logo"}),t("span",{key:"69c2bc09acca8a535d2f982131ccc09d65ea44e6",class:"s-bottom-alert-logo-text"},this.readyStores)),t("div",{key:"553122bac6f1f11c2bcc41a92ac798b3701ebfb9",class:"s-bottom-alert-content"},t("div",{key:"e0df96405998b70c15a8320c8400fa75db77d041",class:"flex items-center gap-2"},t("div",{key:"26f241c725c763dfc25f58cdcd0f2979571a2061",class:"s-bottom-alert-icon"},t("i",this.icon?{class:this.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>info</title>\n<path d="M16 13.333c-0.737 0-1.333 0.596-1.333 1.333v9.333c0 0.737 0.596 1.333 1.333 1.333s1.333-0.596 1.333-1.333v-9.333c0-0.737-0.596-1.333-1.333-1.333zM16 7.987c-0.737 0-1.333 0.596-1.333 1.333v0.013c0 0.737 0.596 1.327 1.333 1.327s1.333-0.603 1.333-1.34-0.596-1.333-1.333-1.333zM16 0c-8.823 0-16 7.177-16 16s7.177 16 16 16 16-7.177 16-16-7.177-16-16-16zM16 29.333c-7.352 0-13.333-5.981-13.333-13.333s5.981-13.333 13.333-13.333 13.333 5.981 13.333 13.333-5.981 13.333-13.333 13.333z"></path>\n</svg>\n'})),t("div",{key:"5e6ba42a2924aec3b99050e8f53634716023a535",class:"s-bottom-alert-message"},this.message?this.message:e?t("span",{class:"flex flex-wrap items-center gap-1"},this.defaultMessage,t("span",{class:{"s-bottom-alert-message-highlight":!0},"aria-label":"Developer"},this.salla),t("span",{innerHTML:salla.money(this.template.price)})):this.defaultMessage)),"banner"!==this.type&&t("div",{key:"44c4d9499736d84da97b640b8ab063a6b9dd6d3c",class:e?"s-bottom-alert-actions-group":"s-bottom-alert-action"},e?this.loading?t("salla-loading",{size:"20"}):t("div",{class:"s-bottom-alert-actions-group-container"},t("a",{class:"s-bottom-alert-action-link",onClick:()=>this.handleAction()},this.actionLabel||this.moreDetailsLabel),this.templateData?.link?t("button",{type:"button",class:"s-bottom-alert-action-purchase-button",onClick:()=>window.open(this.templateData?.link,"_blank")},this.buyTheTemplate):null):t("salla-button",{href:this.actionUrl,size:"medium",onClick:()=>this.handleAction(),width:"normal"},this.actionLabel||this.defaultActionLabel)),"popup"===this.type&&this.popup()))}get host(){return a(this)}};n.style=":host{display:block}";export{i as salla_alert,n as salla_bottom_alert}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as t,h as s}from"./p-DNWyGkAx.js";import{a as i}from"./p-CgtvEd63.js";import{a as e}from"./p-BedNk7k1.js";import{S as a}from"./p-8Tsmrwno.js";import{S as h}from"./p-0-eTJXSD.js";const l=class{constructor(s){t(this,s),this.defaultEvent="gifting:open",this.selectImageForYourGift=salla.lang.get("blocks.buy_as_gift.select_image_for_your_gift"),this.currentStep=1,this.showCalendar=!1,this.showGiftText=!1,this.currentLang="",this.parentClass="is-current-step-1",this.errors={},this.gift=void 0,this.selectedGiftTextOption=void 0,this.selectedCountryId=void 0,this.selectedCountryCode=void 0,this.loadingCities=!1,this.loadingRegions=!1,this.regions=[],this.selectedRegionId=void 0,this.isKSA=!1,this.selectedCountry=null,this.selectedRegion=null,this.displayedCities=[],this.selectedCity=null,this.searchingCities=!1,this.enableCityAjaxSearch=!1,this.citySearchQuery="",this.step2Animated=!1,this.citySearchTimer=null,this.citySearchCounter=0,this.locationRequestCounter=0,this.showTextArea=!1,this.selectedImage=void 0,this.uploadedImage=void 0,this.selectedText=void 0,this.hasError=!1,this.timeZone=null,this.receiverCountryCode=salla.config.get("store.scope.countries")?.[0]||salla.config.get("store.store_country")||"SA",this.hostId=`salla-gifting-${Math.random().toString(36).slice(2,10)}`,this.disableClass=this.gift?.show_image_upload?"":"pointer-events-none",this.formSelector="form.product-form, form.form--product-options",this.handleCitySearch=t=>{if(this.citySearchQuery=t,!this.enableCityAjaxSearch)return;this.citySearchTimer&&clearTimeout(this.citySearchTimer);const s=++this.citySearchCounter;this.citySearchTimer=setTimeout((async()=>{this.searchingCities=!0;try{const i=await this.fetchCities(t);s===this.citySearchCounter&&(this.displayedCities=i)}catch(t){s===this.citySearchCounter&&(this.displayedCities=[])}finally{s===this.citySearchCounter&&(this.searchingCities=!1)}}),l.CITY_SEARCH_DEBOUNCE_MS)},this.handleCitySelected=t=>{this.selectedCity=t,this.receiverCity=String(t.id),this.clearError("receiver.city_id")},this.handleCityDropdownClosed=()=>{this.citySearchQuery="",this.citySearchTimer&&(clearTimeout(this.citySearchTimer),this.citySearchTimer=null),++this.citySearchCounter,this.displayedCities=this.gift?.cities??[],this.searchingCities=!1},this.handleCountryDropdownClosed=()=>{},this.handleRegionDropdownClosed=()=>{},salla.lang.onLoaded((()=>{this.selectImageOrUpload=salla.lang.get("blocks.buy_as_gift.select_image_or_upload"),this.selectImageForYourGift=salla.lang.get("blocks.buy_as_gift.select_image_for_your_gift"),this.sectionTitle=salla.lang.get("blocks.buy_as_gift.gift_the_one_you_love"),this.sectionSubtitle=salla.lang.get("blocks.buy_as_gift.gift_the_one_you_love_message"),this.sectionBtnText=salla.lang.get("blocks.buy_as_gift.send_as_a_gift"),this.giftDetails=salla.lang.get("blocks.buy_as_gift.gift_details"),this.selectGiftMessage=salla.lang.get("blocks.buy_as_gift.select_gift_message"),this.giftText=salla.lang.get("blocks.buy_as_gift.gift_text"),this.giftCustomText=salla.lang.get("blocks.buy_as_gift.gift_custom_text"),this.textId=salla.lang.get("blocks.buy_as_gift.text_id"),this.incorrectGiftText=salla.lang.get("blocks.buy_as_gift.incorrect_gift_text"),this.nextStep=salla.lang.get("blocks.buy_as_gift.next_step"),this.senderNameLabel=salla.lang.get("blocks.buy_as_gift.sender_name"),this.receiverNameFieldLabel=salla.lang.get("blocks.buy_as_gift.receiver_name"),this.receiverMobileFieldLabel=salla.lang.get("blocks.buy_as_gift.receiver_mobile"),this.receiverCountryFieldLabel=salla.lang.get("blocks.buy_as_gift.receiver_country"),this.ksa=salla.lang.get("pages.checkout.ksa"),this.selectCity=salla.lang.get("pages.checkout.select_city"),this.selectCountry=salla.lang.get("pages.checkout.select_country"),this.selectCityInfo=salla.lang.get("blocks.buy_as_gift.city_info"),this.cityChangeNotice=salla.lang.get("blocks.buy_as_gift.city_change_notice"),this.receiverCityFieldLabel=salla.lang.get("blocks.buy_as_gift.receiver_city"),this.receiverRegionFieldLabel=salla.lang.get("blocks.buy_as_gift.receiver_region")||salla.lang.get("pages.checkout.region"),this.selectRegion=salla.lang.get("pages.checkout.select_region"),this.receiverEmailFieldLabel=salla.lang.get("blocks.buy_as_gift.receiver_email"),this.emailPlaceholder=salla.lang.get("common.elements.email_placeholder"),this.sendLater=salla.lang.get("blocks.buy_as_gift.send_later"),this.selectSendDateAndTime=salla.lang.get("blocks.buy_as_gift.select_send_date_and_time"),this.canNotEditOrderAfterSelectDate=salla.lang.get("blocks.buy_as_gift.can_not_edit_order_after_select_date"),this.sendGift=salla.lang.get("blocks.buy_as_gift.send_gift"),this.donationRequired=salla.lang.get("pages.products.donation_amount_required"),this.currentLang=salla.lang.locale})),salla.event.on(this.defaultEvent,(()=>{this.open()}))}isPhysical(){return this.physicalProducts||this.physical}cityNoticeText(){return this.gift?.recipient_can_change_address?this.gift?.allows_different_shipping_cost?null:this.cityChangeNotice:this.selectCityInfo}componentDidLoad(){salla.event.product.onPriceUpdated((()=>{const t=document.querySelector(".s-quantity-input-input");this.quantity=t?.value}))}getFormDataFromForm(){if(!this.formSelector)return null;const t=document.querySelector(this.formSelector);return t?new FormData(t):null}mergeObjectToFormData(t,s,i){for(let e in t){if(!t.hasOwnProperty(e)||null==t[e])continue;const a=i?`${i}[${e}]`:e;"object"!=typeof t[e]||null===t[e]||t[e]instanceof File?s.set(a,t[e]):this.mergeObjectToFormData(t[e],s,a)}return s}async open(){if(salla.config.isGuest())return salla.api.auth.setAfterLoginEvent(this.defaultEvent),void salla.event.dispatch("login::open",{withoutReload:!0});this.resetStepsAnimation(),this.currentStep=1,this.parentClass="is-current-step-1",this.step2Animated=!1,this.stepsWrapper?.style.removeProperty("height"),await this.modal.open();const t=this.productId?()=>salla.product.getGiftProductDetails(this.productId):()=>salla.cart.getGiftCartDetails();return await salla.api.withoutNotifier(t).then((t=>{this.gift=t.data,this.senderName=this.gift.sender_name,this.disableClass=this.gift?.show_image_upload?"":"pointer-events-none",this.gift.show_texts||(this.selectedGiftTextOption=void 0,this.selectedText=void 0),this.gift.show_images||(this.selectedImage=void 0,this.uploadedImage=void 0),this.skipStep1()&&(this.currentStep=2,this.parentClass="is-current-step-2",this.step2Animated=!0)})).catch((t=>{this.hasError=!0,this.errorMessage=t.response?.data?.error?.message||t.response?.data})).finally((()=>this.modal.stopLoading()))}skipStep1(){return!!this.gift&&!this.gift.show_images&&!this.gift.show_texts}resetStepsAnimation(){[this.step1Elems,this.step2Elems].forEach((t=>{t?.querySelectorAll(".anime-item").forEach((t=>t.removeAttribute("style")))})),this.step1Elems?.removeAttribute("style"),this.step2Elems&&!this.skipStep1()&&(this.step2Elems.style.removeProperty("opacity"),this.step2Elems.style.removeProperty("transform"))}async close(){return this.modal.close()}async setWrapperHeight(t=1,s=250,i=0,e=0){let a=document.querySelector(`#${this.hostId} .gift-step-${t}`);const h=()=>{this.stepsWrapper.style.height=e?`${e}px`:a.offsetHeight+i+"px"};this.step2Animated&&2===t?requestAnimationFrame(h):setTimeout(h,s)}toggleCalendar(){this.showCalendar=!this.showCalendar,this.setWrapperHeight(2,150,0)}toggleGiftText(t){this.textSelect?.classList.remove("s-form-has-error");let s=t.target.children[t.target.selectedIndex].getAttribute("data-id"),i="custom"==s;const e=this.showGiftText!==i;this.showGiftText=i,s?(this.selectedGiftTextOption=s,this.selectedText=i?void 0:t.target.value):(this.textArea.value="",this.selectedText=void 0,this.selectedGiftTextOption=void 0),e&&this.setWrapperHeight(1,150,5)}async goToStep2(t=!0){this.step1Elems&&(t&&!this.validateStep1()||(this.stepsWrapper&&this.step1Elems&&(this.stepsWrapper.style.height=`${this.step1Elems.offsetHeight}px`),this.setWrapperHeight(2,50,0),(new i.timeline).add({targets:this.step1Elems.querySelectorAll(`#${this.hostId} .anime-item`),opacity:[1,0],translateX:[0,50],delay:i.stagger(70),duration:1200}).add({targets:".gift-step-2",translateX:["-110%",0],opacity:[0,1]},"-=1800").add({targets:this.step2Elems.querySelectorAll(`#${this.hostId} .anime-item`),opacity:[0,1],translateX:[-50,0],delay:i.stagger(70),duration:1200,complete:()=>{this.step2Elems.querySelectorAll(`#${this.hostId} .anime-item`).forEach((t=>{t.classList.remove("opacity-0"),t.removeAttribute("style")})),this.step2Animated=!0}},"-=1200"),this.currentStep=2,this.parentClass=`is-current-step-${this.currentStep}`))}validateStep1(){return!(this.gift?.show_texts&&(this.selectedGiftTextOption?"custom"!=this.selectedGiftTextOption||this.selectedText?(this.textSelect?.classList.remove("s-form-has-error"),this.customTextArea?.classList.remove("s-form-has-error"),0):(this.textSelect?.classList.remove("s-form-has-error"),this.customTextArea?.classList.add("s-form-has-error"),1):(this.textSelect?.classList.add("s-form-has-error"),this.customTextArea?.classList.remove("s-form-has-error"),1)))}goToStep1(t){t.preventDefault();let s=new i.timeline({autoplay:!1});s.add({targets:this.step2Elems.querySelectorAll(`#${this.hostId} .anime-item`),opacity:[1,0],translateX:[0,-50],delay:i.stagger(70),duration:1200}).add({targets:".gift-step-1",translateX:["110%",0],opacity:[0,1]},"-=1800").add({targets:this.step1Elems.querySelectorAll(`#${this.hostId} .anime-item`),opacity:[0,1],translateX:[50,0],delay:i.stagger(70),duration:1200,complete:()=>{this.step1Elems.querySelectorAll(`#${this.hostId} .anime-item`).forEach((t=>{t.classList.remove("opacity-0"),t.removeAttribute("style")}))}},"-=1200"),s.play(),this.step2Animated=!1,this.setWrapperHeight(1,600,0),this.currentStep=1,this.parentClass=`is-current-step-${this.currentStep}`}getFilepondPlaceholder(){return`<div class="s-gifting-filepond-placeholder"><span class="s-gifting-filepond-placeholder-icon"><svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>images</title>\n<path d="M22.667 29.333h-13.333c-3.676 0-6.667-2.991-6.667-6.667v-13.333c0-0.737-0.597-1.333-1.333-1.333s-1.333 0.596-1.333 1.333v13.333c0 5.145 4.187 9.333 9.333 9.333h13.333c0.736 0 1.333-0.596 1.333-1.333s-0.597-1.333-1.333-1.333zM22.667 5.333c-2.205 0-4 1.795-4 4s1.795 4 4 4 4-1.795 4-4-1.795-4-4-4zM22.667 10.667c-0.735 0-1.333-0.597-1.333-1.333s0.599-1.333 1.333-1.333 1.333 0.597 1.333 1.333-0.599 1.333-1.333 1.333zM25.333 0h-13.333c-3.676 0-6.667 2.991-6.667 6.667v13.333c0 1.055 0.268 2.040 0.707 2.927 0.039 0.099 0.088 0.188 0.151 0.277 1.137 2.053 3.301 3.463 5.809 3.463h13.333c3.676 0 6.667-2.991 6.667-6.667v-13.333c0-3.676-2.991-6.667-6.667-6.667zM12 24c-1.244 0-2.344-0.583-3.077-1.476l5.721-7.047 6.629 8.523zM29.333 20c0 2.205-1.795 4-4 4h-0.68l-8.933-11.485c-0.251-0.32-0.633-0.511-1.039-0.515h-0.015c-0.401 0-0.781 0.181-1.035 0.492l-5.632 6.935v-12.76c0-2.205 1.795-4 4-4h13.333c2.205 0 4 1.795 4 4z"></path>\n</svg>\n</span><p class="s-gifting-filepond-placeholder-text">${this.selectImageOrUpload&&this.gift.show_image_upload?this.selectImageOrUpload:this.selectImageForYourGift}</p></div>`}setPreview(t){this.uploader?.classList.add("has-bg");var s=document.querySelector(`#${this.hostId}.filepond-bg`)?document.querySelector(`#${this.hostId} .filepond-bg`):document.createElement("div");s.classList.add("filepond-bg"),s.classList.remove("s-hidden"),s.style.backgroundImage="url('"+t.url+"')",this.uploader?.querySelector(".filepond--root")?.appendChild(s),this.uploadedImage=t.url,this.gift&&this.gift.gift_images?.length&&this.setWrapperHeight(1,150,0)}removePreview(){this.uploader.classList.remove("has-bg");let t=document.querySelector(`#${this.hostId} .filepond-bg`);t.removeAttribute("style"),t.classList.add("s-hidden"),this.handleRemoveImage()}handleTextAreaChange(t){this.selectedText=t.target.value,this.customTextArea?.classList.remove("s-form-has-error")}clearError(t){if(this.errors?.[t]){const{[t]:s,...i}=this.errors;this.errors=i}}handleSenderName(t){this.senderName=t.target.value,this.clearError("sender_name")}handleReceiverName(t){this.receiverName=t.target.value,this.clearError("receiver.name")}resetCityState(){this.citySearchTimer&&(clearTimeout(this.citySearchTimer),this.citySearchTimer=null),++this.citySearchCounter,this.gift={...this.gift,cities:[]},this.displayedCities=[],this.receiverCity=void 0,this.selectedCity=null,this.citySearchQuery="",this.searchingCities=!1,this.enableCityAjaxSearch=!1}setInitialCities(t){this.gift={...this.gift,cities:t},this.displayedCities=t,this.enableCityAjaxSearch=t.length>=l.CITY_AJAX_THRESHOLD}async fetchCities(t=""){if(!this.selectedCountryId)return[];if(this.isKSA&&!this.selectedRegionId)return[];const s=["for_branch=0",`country_id=${this.selectedCountryId}`];this.isKSA&&this.selectedRegionId&&s.push(`region_id=${this.selectedRegionId}`),t?.trim()&&s.push(`query=${encodeURIComponent(t.trim())}`);const i=await salla.api.request(`shipping/cities?${s.join("&")}`);return i?.data??[]}async handleCountrySelected(t){const s=t?.id;this.selectedCountry=t??null,this.selectedCountryId=s,this.selectedCountryCode=t?.country_code,this.isKSA="SA"===t?.country_code,this.clearError("receiver.country"),this.regions=[],this.selectedRegionId=void 0,this.selectedRegion=null,this.resetCityState();const i=++this.locationRequestCounter;if(!s)return this.selectedCountryCode=void 0,this.isKSA=!1,void this.setWrapperHeight(2,0,0);if(this.isKSA){this.loadingRegions=!0,this.setWrapperHeight(2,0,0);try{const t=await salla.api.request(`shipping/countries/${s}/regions`);if(i!==this.locationRequestCounter)return;t&&t.data&&(this.regions=t.data)}catch(t){if(i!==this.locationRequestCounter)return;console.error("Error fetching regions:",t)}finally{i===this.locationRequestCounter&&(this.loadingRegions=!1,this.setWrapperHeight(2,0,0))}}else{this.loadingCities=!0,this.setWrapperHeight(2,0,0);try{const t=await this.fetchCities();if(i!==this.locationRequestCounter)return;this.setInitialCities(t)}catch(t){if(i!==this.locationRequestCounter)return;console.error("Error fetching cities:",t)}finally{i===this.locationRequestCounter&&(this.loadingCities=!1)}}}async handleRegionSelected(t){const s=t?.id;this.selectedRegion=t??null,this.selectedRegionId=s,this.clearError("receiver.region"),this.resetCityState();const i=++this.locationRequestCounter;if(s){this.loadingCities=!0;try{const t=await this.fetchCities();if(i!==this.locationRequestCounter)return;this.setInitialCities(t)}catch(t){if(i!==this.locationRequestCounter)return;console.error("Error fetching cities:",t)}finally{i===this.locationRequestCounter&&(this.loadingCities=!1,this.setWrapperHeight(2,0,0))}}}handleUploadImage(t){this.uploadedImage=t,this.gift&&this.gift.gift_images?.length&&this.setWrapperHeight(1,150,0)}handleRemoveImage(){this.uploadedImage="",this.gift&&this.gift.gift_images?.length&&this.setWrapperHeight(1,150,0)}handlePhoneInputChange(t){let s=t.detail;this.receiverMobile=s.number,this.receiverCountryCode=s.country_code,this.clearError("receiver.mobile")}handleDateTimePicker(t){this.deliveryDate=t.detail}getCalendarClasses(){return{"s-form-group":!0,"anime-item":!0,"s-gifting-calendar":!0,shown:this.showCalendar,hide:!this.showCalendar,"s-form-has-error":!!this.errors&&this.errors.deliver_at}}async submitForm(){const t=document.querySelector("#donating-amount")?.value;if(this.calendarFormGroup.classList.remove("s-form-has-error"),this.errors&&(this.errors={},this.setWrapperHeight(2,150,0)),this.showCalendar&&!this.deliveryDate)return void this.calendarFormGroup.classList.add("s-form-has-error");const s=[{key:"sender_name",value:this.senderName,label:this.senderNameLabel},{key:"receiver.name",value:this.receiverName,label:this.receiverNameFieldLabel},{key:"receiver.mobile",value:this.receiverMobile,label:this.receiverMobileFieldLabel},...this.isPhysical()?[{key:"receiver.country",value:this.selectedCountryId,label:this.receiverCountryFieldLabel},...this.isKSA?[{key:"receiver.region",value:this.selectedRegionId,label:this.receiverRegionFieldLabel}]:[],{key:"receiver.city_id",value:this.receiverCity,label:this.receiverCityFieldLabel}]:[]],i={};if(s.forEach((({key:t,value:s,label:e})=>{s||(i[t]=salla.lang.get("common.errors.field_required",{attribute:e}))})),Object.keys(i).length)return this.errors=i,void this.setWrapperHeight(2,150,0);const e="custom"===this.selectedGiftTextOption,a={text:e?this.selectedText:void 0,text_id:!e&&this.selectedGiftTextOption?Number(this.selectedGiftTextOption):void 0,sender_name:this.senderName,quantity:this.quantity,deliver_at:this.showCalendar?this.deliveryDate:null,image_url:this.uploadedImage??this.selectedImage,donation_amount:t||null,receiver:{name:this.receiverName,mobile_country_code:this.receiverCountryCode,mobile:this.receiverMobile,...this.isPhysical()&&this.selectedCountryCode?{country_code:this.selectedCountryCode}:{},...this.isPhysical()&&this.selectedRegionId?{region_id:this.selectedRegionId}:{},...this.receiverCity&&this.isPhysical()?{city_id:this.receiverCity}:{}},has_apple_pay:salla.helpers.hasApplePay()};let h;this.productId&&this.formSelector&&(h=this.getFormDataFromForm()||new FormData,h=this.mergeObjectToFormData(a,h));const l=this.productId?()=>salla.product.addProductGiftToCart(this.productId,h,!0):()=>salla.cart.addCartGiftToCart(a,!0);return await l().then((()=>this.modal.close())).catch((t=>{t.response&&422==t.response.status?this.errors=t.response.data.error.fields:console.log(t),this.setWrapperHeight(2,150,0)}))}step2ItemClass(t=""){const s="anime-item"+(this.step2Animated?"":" opacity-0");return t?`${t} ${s}`:s}generateClass(){return{"s-gifting-widget":!0,"s-gifting-widget-vertical":!!this.vertical,"s-gifting-widget-horizontal":!this.vertical}}async handleGiftButtonClick(){if(this.productId&&this.formSelector){const t=document.querySelector(this.formSelector);if(!t)return void console.error("SallaGifting:: Form not found in the document!");if(!(t instanceof HTMLFormElement))return void console.error("SallaGifting:: The specified selector does not correspond to a form tag!");if(!t.reportValidity())return console.error("SallaGifting:: Form is not valid!"),void salla.error(salla.lang.get("common.messages.required_fields"))}const t=document.querySelector(`salla-product-options[product-id="${this.productId}"]`);!t||await t.reportValidity()?this.open():salla.error(salla.lang.get("common.messages.required_fields"))}render(){return[s("div",{key:"416981417bec78c8c3fda43e6f80745f4d735154"},s("salla-list-tile",{key:"495255205e1c226669a14a94e50442aabd9818da",class:this.generateClass()},s("div",{key:"f2dbdc4ea0dc76d806f18563739a116e15cbbe08",slot:"title"},this.vertical?s("span",{innerHTML:h}):"",s("h3",{key:"9ed4f1d995eaf2341a9ec237ebfb486ed3db988e"},this.widgetTitle?this.widgetTitle:this.sectionTitle)),s("div",{key:"b5d5512fcb2513177eaa1e25eacce9092f7d845f",slot:"subtitle"},s("div",{key:"0a8223b41973b72d942ce91c5f478a3edaa5dfd3"},this.widgetSubtitle?this.widgetSubtitle:this.sectionSubtitle)),s("div",{key:"a6d5a077131117c6854ffc2b39e506be7953051e",slot:"action"},s("salla-button",{key:"99b14364789884b0010e50941c27cbcfe7445785",color:"primary",fill:"outline",width:"wide",class:"s-gifting-widget-action",onClick:()=>this.handleGiftButtonClick()},s("slot",{key:"27f6be7b07084f48da83af6240933d619407307f",name:"widget-btn-content"},s("div",{key:"ee5d04e96dd1e3849a33813b3737b476b5470497",class:"s-gifting-widget-action-content"},s("span",{key:"d02bb1f6cd4dff335eeca1341da2c86d2976b4fc",innerHTML:h}),"  ",s("span",{key:"98a3594e6d01133c4f448d8e5df22ba2984cf09e"},this.sectionBtnText)))))),s("salla-modal",{key:"0be87b9d369e92a71b68f570b9bf19a0ddb7dd6b",id:this.hostId,isLoading:!0,class:"s-gifting-modal",width:"sm",ref:t=>this.modal=t},s("div",{key:"978995d399506ff82ac0f2385a1f85a808c7da3e",slot:"loading"},s("div",{key:"7d1f141fd9131d35edb81326062e8f7cadfa2cab",class:"s-gifting-skeleton"},s("div",{key:"b33cfd58381c7c1b545ffedf6739e42fdb75c8de",class:"s-gifting-modal-header"},s("salla-skeleton",{key:"e03a505ad3720c25077ca91c7eec2843cdaee225",type:"circle",height:"5rem",width:"5rem"}),s("h2",{key:"6f630d2582c96fc71406ef4557143c6e9dbd4a88",class:"s-gifting-modal-title"},s("div",{key:"8d1a3540993c9b40e705f2145bf0514754c36dab",class:"s-gifting-modal-badge-wrapper"},s("salla-skeleton",{key:"d965c353f19cf785a13eba6332b715eed9748836",height:"15px",width:"150px"})))),s("div",{key:"abacc03d1e30075d3d24dfd577dc9a60f7b52810",class:"s-gifting-skeleton-content"},s("salla-skeleton",{key:"03db84cfccc546602a6f521b015d0c12b93caa6f",height:"10px",width:"150px"}),s("salla-skeleton",{key:"e8e2d4e70d208055baaae44a8d7da8aa5c6a33da",height:"230px"}),s("salla-skeleton",{key:"2c90d91fb63551685b2041f2bc51fdb5219cbbb7",height:"10px",width:"150px"}),s("salla-skeleton",{key:"8962bc17f43cb04563caa02db3df585189579f8f",height:"30px"}),s("salla-skeleton",{key:"73730453aa6f8d0ec2a653b4711b80b32a18b916",height:"40px"})))),s("slot",{key:"4bcf5a6d53485c461c35f53ce7e265bcf770989e",name:"header"}),this.hasError?s("salla-placeholder",{alignment:"center"},s("span",{slot:"title"},this.errorMessage||salla.lang.get("common.errors.empty_results")),s("span",{slot:"description"}," ")):[s("div",{class:"s-gifting-modal-header"},s("span",{class:"s-gifting-modal-icon"},s("span",{innerHTML:h})),s("h2",{class:"s-gifting-modal-title"},s("div",{class:"s-gifting-modal-badge-wrapper"},!this.skipStep1()&&s("div",{class:"s-gifting-modal-badge"},s("span",null,s("span",null,this.currentStep),"/2")),s("span",null,this.giftDetails)))),s("div",{class:"s-gifting-steps-wrapper "+this.parentClass,ref:t=>this.stepsWrapper=t},!this.skipStep1()&&s("div",{class:"s-gifting-step-one gift-step-1",ref:t=>this.step1Elems=t},this.gift&&this.gift.show_images&&s("div",{class:"s-gifting-modal-uploader-title anime-item"},this.selectImageForYourGift),this.gift&&this.gift.show_images&&s("div",{class:"s-gifting-image-section"},s("div",{class:`s-gifting-modal-uploader anime-item ${this.disableClass}`,ref:t=>this.uploader=t},s("span",{class:"s-gifting-remove-preview pointer-events-auto",onClick:()=>this.removePreview(),innerHTML:a}),this.selectImageOrUpload&&this.gift&&s("salla-file-upload",{"instant-upload":!0,name:"image_url",url:salla.url.api(salla.product.api.getUrl("giftImage")),onUploaded:t=>this.handleUploadImage(t.detail),labelIdle:this.getFilepondPlaceholder(),onRemoved:()=>this.handleRemoveImage()})),s("div",{class:"anime-item"},!this.uploadedImage&&this.gift&&this.gift.gift_images&&this.gift.gift_images.length>0?s("salla-slider",{id:"gifting-slider",loop:!1,"controls-outer":!0,class:"s-gifting-slider",type:"carousel"},s("div",{slot:"items"},this.gift&&this.gift.gift_images?this.gift?.gift_images.map((t=>s("a",{class:"s-gifting-clickable s-gifting-image",onClick:()=>this.setPreview(t)},s("img",{src:t.url,alt:`${t.id}`})))):"")):"")),this.gift&&this.gift.show_texts?s("div",{class:"anime-item"},s("div",{class:"s-gifting-modal-uploader-title s-gifting-text-title"},this.giftText),s("div",{class:"s-form-group s-gifting-selectText",ref:t=>this.textSelect=t},s("select",{id:"gift-text-selection",name:"gift-text-selection",class:"s-form-control s-gifting-select",onChange:t=>this.toggleGiftText(t)},s("option",{"data-id":null,selected:!this.selectedGiftTextOption},this.selectGiftMessage),this.gift&&this.gift.gift_texts?this.gift?.gift_texts.map((t=>s("option",{"data-id":t.id,value:t.text,key:t.id,selected:String(this.selectedGiftTextOption)===String(t.id)},t.text))):"",this.gift&&this.gift.show_custom_text?s("option",{"data-id":"custom",selected:"custom"===this.selectedGiftTextOption},this.giftCustomText):null)),s("div",{class:this.showGiftText&&this.gift&&this.gift.show_custom_text?"s-form-group s-gifting-textarea shown":"s-form-group s-gifting-textarea hide",ref:t=>this.customTextArea=t},s("label",{htmlFor:"gift-custom-text",class:"s-form-label"},this.giftCustomText),s("div",{class:"mt-1"},s("textarea",{onInput:t=>this.handleTextAreaChange(t),rows:4,ref:t=>this.textArea=t,name:"gift-custom-text",id:"gift-custom-text",class:"s-form-control"})))):null,s("div",{class:"anime-item"},s("salla-button",{color:"primary",width:"wide",onClick:()=>this.goToStep2(!!this.gift?.show_texts)},s("span",null,this.nextStep)))),s("div",{class:"s-gifting-step-two gift-step-2",style:this.skipStep1()?{opacity:"1",transform:"translateX(0)",position:"relative"}:void 0,ref:t=>this.step2Elems=t},s("div",{class:this.step2ItemClass(this.errors?.sender_name?"s-form-group s-form-has-error":"s-form-group")},s("label",{htmlFor:"sender_name",class:"s-form-label"},this.senderNameLabel),s("input",{type:"text",class:"s-form-control",name:"sender_name",id:"sender_name",value:this.senderName,onInput:t=>this.handleSenderName(t),placeholder:""}),this.errors&&this.errors.sender_name?s("span",{class:"s-gifting-error"},this.errors.sender_name):""),s("div",{class:this.step2ItemClass(this.errors?.["receiver.name"]?"s-form-group s-form-has-error":"s-form-group")},s("label",{htmlFor:"receiver_name",class:"s-form-label"},this.receiverNameFieldLabel),s("input",{type:"text",class:"s-form-control",name:"receiver_name",id:"receiver_name",value:"",onInput:t=>this.handleReceiverName(t),placeholder:""}),this.errors&&this.errors["receiver.name"]?s("span",{class:"s-gifting-error"},this.errors["receiver.name"]):""),s("div",{class:this.step2ItemClass(this.errors?.["receiver.mobile"]?"s-form-group s-form-has-error":"s-form-group")},s("label",{class:"s-form-label"},this.receiverMobileFieldLabel),s("salla-tel-input",{class:"s-gifting-tel-input",phone:this.receiverMobile,countryCode:this.receiverCountryCode,onPhoneEntered:t=>this.handlePhoneInputChange(t)}),this.errors&&this.errors["receiver.mobile"]?s("span",{class:"s-gifting-error"},this.errors["receiver.mobile"]):""),this.isPhysical()&&s("div",{class:this.step2ItemClass(this.errors?.["receiver.country"]?"s-form-group s-form-has-error":"s-form-group")},s("label",{class:"s-form-label",htmlFor:`${this.hostId}-country`},this.receiverCountryFieldLabel),s("salla-searchable-dropdown",{placeholder:this.selectCountry,items:this.gift?.countries??[],selectedItem:this.selectedCountry,disabled:!this.gift?.countries?.length,required:!0,inputId:`${this.hostId}-country`,searchable:!1,keepParentScroll:!0,onItemSelected:t=>this.handleCountrySelected(t.detail),onDropdownClosed:()=>this.handleCountryDropdownClosed()}),this.errors&&this.errors["receiver.country"]?s("span",{class:"s-gifting-error"},this.errors["receiver.country"]):""),this.isPhysical()&&this.isKSA&&s("div",{class:this.step2ItemClass(this.errors?.["receiver.region"]?"s-form-group s-form-has-error":"s-form-group")},s("label",{class:"s-form-label",htmlFor:`${this.hostId}-region`},this.receiverRegionFieldLabel),s("salla-searchable-dropdown",{placeholder:this.selectRegion,items:this.regions??[],selectedItem:this.selectedRegion,loading:this.loadingRegions,disabled:this.loadingRegions||!this.regions?.length,required:!0,inputId:`${this.hostId}-region`,searchable:!1,keepParentScroll:!0,onItemSelected:t=>this.handleRegionSelected(t.detail),onDropdownClosed:()=>this.handleRegionDropdownClosed()}),this.errors&&this.errors["receiver.region"]?s("span",{class:"s-gifting-error"},this.errors["receiver.region"]):""),this.isPhysical()&&s("div",{class:this.step2ItemClass(this.errors?.["receiver.city_id"]?"s-form-group s-form-has-error":"s-form-group")},s("label",{class:"s-form-label",htmlFor:`${this.hostId}-city`},this.receiverCityFieldLabel),s("salla-searchable-dropdown",{placeholder:this.selectCity,items:this.displayedCities,selectedItem:this.selectedCity,loading:this.loadingCities,searching:this.searchingCities,disabled:this.loadingCities||this.isKSA&&!this.selectedRegionId,required:!0,inputId:`${this.hostId}-city`,searchQuery:this.citySearchQuery,clientSearch:!this.enableCityAjaxSearch,dropUp:!0,keepParentScroll:!0,onItemSelected:t=>this.handleCitySelected(t.detail),onSearchInput:t=>this.handleCitySearch(t.detail),onDropdownClosed:()=>this.handleCityDropdownClosed()}),this.errors&&this.errors["receiver.city_id"]?s("span",{class:"s-gifting-error"},this.errors["receiver.city_id"]):""),this.isPhysical()&&this.cityNoticeText()&&s("div",{class:this.step2ItemClass("s-gifting-info")},s("span",{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>alert</title>\n<path d="M16 13.333c-0.736 0-1.333 0.597-1.333 1.333v8c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-8c0-0.736-0.597-1.333-1.333-1.333zM16 9.327c-0.736 0-1.333 0.604-1.333 1.34s0.597 1.333 1.333 1.333 1.333-0.597 1.333-1.333v-0.013c0-0.736-0.597-1.327-1.333-1.327zM27.313 4.687c-6.237-6.237-16.389-6.239-22.628 0-6.237 6.239-6.237 16.389 0 22.628 3.119 3.119 7.216 4.679 11.313 4.679s8.195-1.559 11.313-4.679c6.24-6.239 6.24-16.391 0.001-22.628zM25.428 25.428c-5.199 5.197-13.657 5.197-18.857 0-5.197-5.199-5.197-13.659 0-18.857 5.199-5.197 13.659-5.197 18.857 0 5.199 5.2 5.199 13.659 0 18.857z"></path>\n</svg>\n'}),s("span",null,this.cityNoticeText())),!this.isPhysical()&&s("div",{class:this.step2ItemClass()},s("label",{class:"s-gifting-schedule s-gifting-clickable",htmlFor:`schedule-${this.hostId}`},s("input",{type:"checkbox",name:"schedule",id:`schedule-${this.hostId}`,onChange:()=>this.toggleCalendar(),class:"s-checkbox"}),s("span",{class:"s-form-label"}," ",this.sendLater," "))),s("div",{class:this.getCalendarClasses(),ref:t=>this.calendarFormGroup=t},s("label",{class:"s-form-label"},this.selectSendDateAndTime),s("salla-datetime-picker",{value:this.deliveryDate,placeholder:this.selectSendDateAndTime,"enable-time":!0,"date-format":"Y-m-d h:i K",onPicked:t=>this.handleDateTimePicker(t)}),s("span",{class:"s-gifting-calendar-hint"},this.canNotEditOrderAfterSelectDate)),s("div",{class:this.step2ItemClass("s-gifting-step-two-footer")},!this.skipStep1()&&s("a",{href:"#!",innerHTML:e,onClick:t=>this.goToStep1(t)}),s("salla-button",{onClick:()=>this.submitForm(),color:"primary",width:"wide"},s("span",null,this.sendGift)))))],s("slot",{key:"a4d37b893e4a0867c044817434ade65b16fbe89a",name:"footer"})))]}};l.CITY_AJAX_THRESHOLD=400,l.CITY_SEARCH_DEBOUNCE_MS=100,l.style=".s-gifting-steps-wrapper{transition:height 0.8s cubic-bezier(0.55, 0, 0.1, 1) 0s}.s-gifting-select{background-image:url(\"data:image/svg+xml;utf8,<svg version='1.1' fill='gray' xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'><title>keyboard_arrow_down</title><path d='M9.875 11.104l6.125 6.125 6.125-6.125 1.875 1.875-8 8-8-8z'></path></svg>\");background-size:24px;background-repeat:no-repeat;background-position:99%;appearance:none}[dir=rtl] .s-gifting-select{background-position:5px}.s-gifting-widget-vertical .s-list-tile-item [slot=title]{display:flex;align-items:center;gap:1.5rem}.s-gifting-widget-vertical .s-list-tile-item-content{width:100%}.s-gifting-modal .s-searchable-dropdown-trigger{border-color:#d1d5db}.s-gifting-modal .s-searchable-dropdown-trigger:hover:not(.s-searchable-dropdown-trigger--disabled){border-color:#d1d5db}.s-gifting-modal .s-searchable-dropdown-trigger--open,.s-gifting-modal .s-searchable-dropdown-trigger:focus{border-color:var(--color-primary, #00897b);box-shadow:0 0 0 1px var(--color-primary, #00897b)}.s-gifting-modal .s-searchable-dropdown-trigger-placeholder{color:#000}.s-gifting-modal .s-gifting-image-section{margin-bottom:1.5rem}.s-gifting-modal .s-gifting-slider{margin-bottom:0.5rem}.s-gifting-modal .s-gifting-image{display:block}.s-gifting-modal .s-gifting-image img{display:block;width:auto;height:100px;object-fit:contain}.s-gifting-modal .s-gifting-image-section+.anime-item .s-gifting-text-title{margin-top:1rem}";export{l as salla_gifting}
4
+ import{r as t,h as s}from"./p-DkTbP5UX.js";import{a as i}from"./p-CgtvEd63.js";import{a as e}from"./p-BedNk7k1.js";import{S as a}from"./p-8Tsmrwno.js";import{S as h}from"./p-0-eTJXSD.js";const l=class{constructor(s){t(this,s),this.defaultEvent="gifting:open",this.selectImageForYourGift=salla.lang.get("blocks.buy_as_gift.select_image_for_your_gift"),this.currentStep=1,this.showCalendar=!1,this.showGiftText=!1,this.currentLang="",this.parentClass="is-current-step-1",this.errors={},this.gift=void 0,this.selectedGiftTextOption=void 0,this.selectedCountryId=void 0,this.selectedCountryCode=void 0,this.loadingCities=!1,this.loadingRegions=!1,this.regions=[],this.selectedRegionId=void 0,this.isKSA=!1,this.selectedCountry=null,this.selectedRegion=null,this.displayedCities=[],this.selectedCity=null,this.searchingCities=!1,this.enableCityAjaxSearch=!1,this.citySearchQuery="",this.step2Animated=!1,this.citySearchTimer=null,this.citySearchCounter=0,this.locationRequestCounter=0,this.showTextArea=!1,this.selectedImage=void 0,this.uploadedImage=void 0,this.selectedText=void 0,this.hasError=!1,this.timeZone=null,this.receiverCountryCode=salla.config.get("store.scope.countries")?.[0]||salla.config.get("store.store_country")||"SA",this.hostId=`salla-gifting-${Math.random().toString(36).slice(2,10)}`,this.disableClass=this.gift?.show_image_upload?"":"pointer-events-none",this.formSelector="form.product-form, form.form--product-options",this.handleCitySearch=t=>{if(this.citySearchQuery=t,!this.enableCityAjaxSearch)return;this.citySearchTimer&&clearTimeout(this.citySearchTimer);const s=++this.citySearchCounter;this.citySearchTimer=setTimeout((async()=>{this.searchingCities=!0;try{const i=await this.fetchCities(t);s===this.citySearchCounter&&(this.displayedCities=i)}catch(t){s===this.citySearchCounter&&(this.displayedCities=[])}finally{s===this.citySearchCounter&&(this.searchingCities=!1)}}),l.CITY_SEARCH_DEBOUNCE_MS)},this.handleCitySelected=t=>{this.selectedCity=t,this.receiverCity=String(t.id),this.clearError("receiver.city_id")},this.handleCityDropdownClosed=()=>{this.citySearchQuery="",this.citySearchTimer&&(clearTimeout(this.citySearchTimer),this.citySearchTimer=null),++this.citySearchCounter,this.displayedCities=this.gift?.cities??[],this.searchingCities=!1},this.handleCountryDropdownClosed=()=>{},this.handleRegionDropdownClosed=()=>{},salla.lang.onLoaded((()=>{this.selectImageOrUpload=salla.lang.get("blocks.buy_as_gift.select_image_or_upload"),this.selectImageForYourGift=salla.lang.get("blocks.buy_as_gift.select_image_for_your_gift"),this.sectionTitle=salla.lang.get("blocks.buy_as_gift.gift_the_one_you_love"),this.sectionSubtitle=salla.lang.get("blocks.buy_as_gift.gift_the_one_you_love_message"),this.sectionBtnText=salla.lang.get("blocks.buy_as_gift.send_as_a_gift"),this.giftDetails=salla.lang.get("blocks.buy_as_gift.gift_details"),this.selectGiftMessage=salla.lang.get("blocks.buy_as_gift.select_gift_message"),this.giftText=salla.lang.get("blocks.buy_as_gift.gift_text"),this.giftCustomText=salla.lang.get("blocks.buy_as_gift.gift_custom_text"),this.textId=salla.lang.get("blocks.buy_as_gift.text_id"),this.incorrectGiftText=salla.lang.get("blocks.buy_as_gift.incorrect_gift_text"),this.nextStep=salla.lang.get("blocks.buy_as_gift.next_step"),this.senderNameLabel=salla.lang.get("blocks.buy_as_gift.sender_name"),this.receiverNameFieldLabel=salla.lang.get("blocks.buy_as_gift.receiver_name"),this.receiverMobileFieldLabel=salla.lang.get("blocks.buy_as_gift.receiver_mobile"),this.receiverCountryFieldLabel=salla.lang.get("blocks.buy_as_gift.receiver_country"),this.ksa=salla.lang.get("pages.checkout.ksa"),this.selectCity=salla.lang.get("pages.checkout.select_city"),this.selectCountry=salla.lang.get("pages.checkout.select_country"),this.selectCityInfo=salla.lang.get("blocks.buy_as_gift.city_info"),this.cityChangeNotice=salla.lang.get("blocks.buy_as_gift.city_change_notice"),this.receiverCityFieldLabel=salla.lang.get("blocks.buy_as_gift.receiver_city"),this.receiverRegionFieldLabel=salla.lang.get("blocks.buy_as_gift.receiver_region")||salla.lang.get("pages.checkout.region"),this.selectRegion=salla.lang.get("pages.checkout.select_region"),this.receiverEmailFieldLabel=salla.lang.get("blocks.buy_as_gift.receiver_email"),this.emailPlaceholder=salla.lang.get("common.elements.email_placeholder"),this.sendLater=salla.lang.get("blocks.buy_as_gift.send_later"),this.selectSendDateAndTime=salla.lang.get("blocks.buy_as_gift.select_send_date_and_time"),this.canNotEditOrderAfterSelectDate=salla.lang.get("blocks.buy_as_gift.can_not_edit_order_after_select_date"),this.sendGift=salla.lang.get("blocks.buy_as_gift.send_gift"),this.donationRequired=salla.lang.get("pages.products.donation_amount_required"),this.currentLang=salla.lang.locale})),salla.event.on(this.defaultEvent,(()=>{this.open()}))}isPhysical(){return this.physicalProducts||this.physical}cityNoticeText(){return this.gift?.recipient_can_change_address?this.gift?.allows_different_shipping_cost?null:this.cityChangeNotice:this.selectCityInfo}componentDidLoad(){salla.event.product.onPriceUpdated((()=>{const t=document.querySelector(".s-quantity-input-input");this.quantity=t?.value}))}getFormDataFromForm(){if(!this.formSelector)return null;const t=document.querySelector(this.formSelector);return t?new FormData(t):null}mergeObjectToFormData(t,s,i){for(let e in t){if(!t.hasOwnProperty(e)||null==t[e])continue;const a=i?`${i}[${e}]`:e;"object"!=typeof t[e]||null===t[e]||t[e]instanceof File?s.set(a,t[e]):this.mergeObjectToFormData(t[e],s,a)}return s}async open(){if(salla.config.isGuest())return salla.api.auth.setAfterLoginEvent(this.defaultEvent),void salla.event.dispatch("login::open",{withoutReload:!0});this.resetStepsAnimation(),this.currentStep=1,this.parentClass="is-current-step-1",this.step2Animated=!1,this.stepsWrapper?.style.removeProperty("height"),await this.modal.open();const t=this.productId?()=>salla.product.getGiftProductDetails(this.productId):()=>salla.cart.getGiftCartDetails();return await salla.api.withoutNotifier(t).then((t=>{this.gift=t.data,this.senderName=this.gift.sender_name,this.disableClass=this.gift?.show_image_upload?"":"pointer-events-none",this.gift.show_texts||(this.selectedGiftTextOption=void 0,this.selectedText=void 0),this.gift.show_images||(this.selectedImage=void 0,this.uploadedImage=void 0),this.skipStep1()&&(this.currentStep=2,this.parentClass="is-current-step-2",this.step2Animated=!0)})).catch((t=>{this.hasError=!0,this.errorMessage=t.response?.data?.error?.message||t.response?.data})).finally((()=>this.modal.stopLoading()))}skipStep1(){return!!this.gift&&!this.gift.show_images&&!this.gift.show_texts}resetStepsAnimation(){[this.step1Elems,this.step2Elems].forEach((t=>{t?.querySelectorAll(".anime-item").forEach((t=>t.removeAttribute("style")))})),this.step1Elems?.removeAttribute("style"),this.step2Elems&&!this.skipStep1()&&(this.step2Elems.style.removeProperty("opacity"),this.step2Elems.style.removeProperty("transform"))}async close(){return this.modal.close()}async setWrapperHeight(t=1,s=250,i=0,e=0){let a=document.querySelector(`#${this.hostId} .gift-step-${t}`);const h=()=>{this.stepsWrapper.style.height=e?`${e}px`:a.offsetHeight+i+"px"};this.step2Animated&&2===t?requestAnimationFrame(h):setTimeout(h,s)}toggleCalendar(){this.showCalendar=!this.showCalendar,this.setWrapperHeight(2,150,0)}toggleGiftText(t){this.textSelect?.classList.remove("s-form-has-error");let s=t.target.children[t.target.selectedIndex].getAttribute("data-id"),i="custom"==s;const e=this.showGiftText!==i;this.showGiftText=i,s?(this.selectedGiftTextOption=s,this.selectedText=i?void 0:t.target.value):(this.textArea.value="",this.selectedText=void 0,this.selectedGiftTextOption=void 0),e&&this.setWrapperHeight(1,150,5)}async goToStep2(t=!0){this.step1Elems&&(t&&!this.validateStep1()||(this.stepsWrapper&&this.step1Elems&&(this.stepsWrapper.style.height=`${this.step1Elems.offsetHeight}px`),this.setWrapperHeight(2,50,0),(new i.timeline).add({targets:this.step1Elems.querySelectorAll(`#${this.hostId} .anime-item`),opacity:[1,0],translateX:[0,50],delay:i.stagger(70),duration:1200}).add({targets:".gift-step-2",translateX:["-110%",0],opacity:[0,1]},"-=1800").add({targets:this.step2Elems.querySelectorAll(`#${this.hostId} .anime-item`),opacity:[0,1],translateX:[-50,0],delay:i.stagger(70),duration:1200,complete:()=>{this.step2Elems.querySelectorAll(`#${this.hostId} .anime-item`).forEach((t=>{t.classList.remove("opacity-0"),t.removeAttribute("style")})),this.step2Animated=!0}},"-=1200"),this.currentStep=2,this.parentClass=`is-current-step-${this.currentStep}`))}validateStep1(){return!(this.gift?.show_texts&&(this.selectedGiftTextOption?"custom"!=this.selectedGiftTextOption||this.selectedText?(this.textSelect?.classList.remove("s-form-has-error"),this.customTextArea?.classList.remove("s-form-has-error"),0):(this.textSelect?.classList.remove("s-form-has-error"),this.customTextArea?.classList.add("s-form-has-error"),1):(this.textSelect?.classList.add("s-form-has-error"),this.customTextArea?.classList.remove("s-form-has-error"),1)))}goToStep1(t){t.preventDefault();let s=new i.timeline({autoplay:!1});s.add({targets:this.step2Elems.querySelectorAll(`#${this.hostId} .anime-item`),opacity:[1,0],translateX:[0,-50],delay:i.stagger(70),duration:1200}).add({targets:".gift-step-1",translateX:["110%",0],opacity:[0,1]},"-=1800").add({targets:this.step1Elems.querySelectorAll(`#${this.hostId} .anime-item`),opacity:[0,1],translateX:[50,0],delay:i.stagger(70),duration:1200,complete:()=>{this.step1Elems.querySelectorAll(`#${this.hostId} .anime-item`).forEach((t=>{t.classList.remove("opacity-0"),t.removeAttribute("style")}))}},"-=1200"),s.play(),this.step2Animated=!1,this.setWrapperHeight(1,600,0),this.currentStep=1,this.parentClass=`is-current-step-${this.currentStep}`}getFilepondPlaceholder(){return`<div class="s-gifting-filepond-placeholder"><span class="s-gifting-filepond-placeholder-icon"><svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>images</title>\n<path d="M22.667 29.333h-13.333c-3.676 0-6.667-2.991-6.667-6.667v-13.333c0-0.737-0.597-1.333-1.333-1.333s-1.333 0.596-1.333 1.333v13.333c0 5.145 4.187 9.333 9.333 9.333h13.333c0.736 0 1.333-0.596 1.333-1.333s-0.597-1.333-1.333-1.333zM22.667 5.333c-2.205 0-4 1.795-4 4s1.795 4 4 4 4-1.795 4-4-1.795-4-4-4zM22.667 10.667c-0.735 0-1.333-0.597-1.333-1.333s0.599-1.333 1.333-1.333 1.333 0.597 1.333 1.333-0.599 1.333-1.333 1.333zM25.333 0h-13.333c-3.676 0-6.667 2.991-6.667 6.667v13.333c0 1.055 0.268 2.040 0.707 2.927 0.039 0.099 0.088 0.188 0.151 0.277 1.137 2.053 3.301 3.463 5.809 3.463h13.333c3.676 0 6.667-2.991 6.667-6.667v-13.333c0-3.676-2.991-6.667-6.667-6.667zM12 24c-1.244 0-2.344-0.583-3.077-1.476l5.721-7.047 6.629 8.523zM29.333 20c0 2.205-1.795 4-4 4h-0.68l-8.933-11.485c-0.251-0.32-0.633-0.511-1.039-0.515h-0.015c-0.401 0-0.781 0.181-1.035 0.492l-5.632 6.935v-12.76c0-2.205 1.795-4 4-4h13.333c2.205 0 4 1.795 4 4z"></path>\n</svg>\n</span><p class="s-gifting-filepond-placeholder-text">${this.selectImageOrUpload&&this.gift.show_image_upload?this.selectImageOrUpload:this.selectImageForYourGift}</p></div>`}setPreview(t){this.uploader?.classList.add("has-bg");var s=document.querySelector(`#${this.hostId}.filepond-bg`)?document.querySelector(`#${this.hostId} .filepond-bg`):document.createElement("div");s.classList.add("filepond-bg"),s.classList.remove("s-hidden"),s.style.backgroundImage="url('"+t.url+"')",this.uploader?.querySelector(".filepond--root")?.appendChild(s),this.uploadedImage=t.url,this.gift&&this.gift.gift_images?.length&&this.setWrapperHeight(1,150,0)}removePreview(){this.uploader.classList.remove("has-bg");let t=document.querySelector(`#${this.hostId} .filepond-bg`);t.removeAttribute("style"),t.classList.add("s-hidden"),this.handleRemoveImage()}handleTextAreaChange(t){this.selectedText=t.target.value,this.customTextArea?.classList.remove("s-form-has-error")}clearError(t){if(this.errors?.[t]){const{[t]:s,...i}=this.errors;this.errors=i}}handleSenderName(t){this.senderName=t.target.value,this.clearError("sender_name")}handleReceiverName(t){this.receiverName=t.target.value,this.clearError("receiver.name")}resetCityState(){this.citySearchTimer&&(clearTimeout(this.citySearchTimer),this.citySearchTimer=null),++this.citySearchCounter,this.gift={...this.gift,cities:[]},this.displayedCities=[],this.receiverCity=void 0,this.selectedCity=null,this.citySearchQuery="",this.searchingCities=!1,this.enableCityAjaxSearch=!1}setInitialCities(t){this.gift={...this.gift,cities:t},this.displayedCities=t,this.enableCityAjaxSearch=t.length>=l.CITY_AJAX_THRESHOLD}async fetchCities(t=""){if(!this.selectedCountryId)return[];if(this.isKSA&&!this.selectedRegionId)return[];const s=["for_branch=0",`country_id=${this.selectedCountryId}`];this.isKSA&&this.selectedRegionId&&s.push(`region_id=${this.selectedRegionId}`),t?.trim()&&s.push(`query=${encodeURIComponent(t.trim())}`);const i=await salla.api.request(`shipping/cities?${s.join("&")}`);return i?.data??[]}async handleCountrySelected(t){const s=t?.id;this.selectedCountry=t??null,this.selectedCountryId=s,this.selectedCountryCode=t?.country_code,this.isKSA="SA"===t?.country_code,this.clearError("receiver.country"),this.regions=[],this.selectedRegionId=void 0,this.selectedRegion=null,this.resetCityState();const i=++this.locationRequestCounter;if(!s)return this.selectedCountryCode=void 0,this.isKSA=!1,void this.setWrapperHeight(2,0,0);if(this.isKSA){this.loadingRegions=!0,this.setWrapperHeight(2,0,0);try{const t=await salla.api.request(`shipping/countries/${s}/regions`);if(i!==this.locationRequestCounter)return;t&&t.data&&(this.regions=t.data)}catch(t){if(i!==this.locationRequestCounter)return;console.error("Error fetching regions:",t)}finally{i===this.locationRequestCounter&&(this.loadingRegions=!1,this.setWrapperHeight(2,0,0))}}else{this.loadingCities=!0,this.setWrapperHeight(2,0,0);try{const t=await this.fetchCities();if(i!==this.locationRequestCounter)return;this.setInitialCities(t)}catch(t){if(i!==this.locationRequestCounter)return;console.error("Error fetching cities:",t)}finally{i===this.locationRequestCounter&&(this.loadingCities=!1)}}}async handleRegionSelected(t){const s=t?.id;this.selectedRegion=t??null,this.selectedRegionId=s,this.clearError("receiver.region"),this.resetCityState();const i=++this.locationRequestCounter;if(s){this.loadingCities=!0;try{const t=await this.fetchCities();if(i!==this.locationRequestCounter)return;this.setInitialCities(t)}catch(t){if(i!==this.locationRequestCounter)return;console.error("Error fetching cities:",t)}finally{i===this.locationRequestCounter&&(this.loadingCities=!1,this.setWrapperHeight(2,0,0))}}}handleUploadImage(t){this.uploadedImage=t,this.gift&&this.gift.gift_images?.length&&this.setWrapperHeight(1,150,0)}handleRemoveImage(){this.uploadedImage="",this.gift&&this.gift.gift_images?.length&&this.setWrapperHeight(1,150,0)}handlePhoneInputChange(t){let s=t.detail;this.receiverMobile=s.number,this.receiverCountryCode=s.country_code,this.clearError("receiver.mobile")}handleDateTimePicker(t){this.deliveryDate=t.detail}getCalendarClasses(){return{"s-form-group":!0,"anime-item":!0,"s-gifting-calendar":!0,shown:this.showCalendar,hide:!this.showCalendar,"s-form-has-error":!!this.errors&&this.errors.deliver_at}}async submitForm(){const t=document.querySelector("#donating-amount")?.value;if(this.calendarFormGroup.classList.remove("s-form-has-error"),this.errors&&(this.errors={},this.setWrapperHeight(2,150,0)),this.showCalendar&&!this.deliveryDate)return void this.calendarFormGroup.classList.add("s-form-has-error");const s=[{key:"sender_name",value:this.senderName,label:this.senderNameLabel},{key:"receiver.name",value:this.receiverName,label:this.receiverNameFieldLabel},{key:"receiver.mobile",value:this.receiverMobile,label:this.receiverMobileFieldLabel},...this.isPhysical()?[{key:"receiver.country",value:this.selectedCountryId,label:this.receiverCountryFieldLabel},...this.isKSA?[{key:"receiver.region",value:this.selectedRegionId,label:this.receiverRegionFieldLabel}]:[],{key:"receiver.city_id",value:this.receiverCity,label:this.receiverCityFieldLabel}]:[]],i={};if(s.forEach((({key:t,value:s,label:e})=>{s||(i[t]=salla.lang.get("common.errors.field_required",{attribute:e}))})),Object.keys(i).length)return this.errors=i,void this.setWrapperHeight(2,150,0);const e="custom"===this.selectedGiftTextOption,a={text:e?this.selectedText:void 0,text_id:!e&&this.selectedGiftTextOption?Number(this.selectedGiftTextOption):void 0,sender_name:this.senderName,quantity:this.quantity,deliver_at:this.showCalendar?this.deliveryDate:null,image_url:this.uploadedImage??this.selectedImage,donation_amount:t||null,receiver:{name:this.receiverName,mobile_country_code:this.receiverCountryCode,mobile:this.receiverMobile,...this.isPhysical()&&this.selectedCountryCode?{country_code:this.selectedCountryCode}:{},...this.isPhysical()&&this.selectedRegionId?{region_id:this.selectedRegionId}:{},...this.receiverCity&&this.isPhysical()?{city_id:this.receiverCity}:{}},has_apple_pay:salla.helpers.hasApplePay()};let h;this.productId&&this.formSelector&&(h=this.getFormDataFromForm()||new FormData,h=this.mergeObjectToFormData(a,h));const l=this.productId?()=>salla.product.addProductGiftToCart(this.productId,h,!0):()=>salla.cart.addCartGiftToCart(a,!0);return await l().then((()=>this.modal.close())).catch((t=>{t.response&&422==t.response.status?this.errors=t.response.data.error.fields:console.log(t),this.setWrapperHeight(2,150,0)}))}step2ItemClass(t=""){const s="anime-item"+(this.step2Animated?"":" opacity-0");return t?`${t} ${s}`:s}generateClass(){return{"s-gifting-widget":!0,"s-gifting-widget-vertical":!!this.vertical,"s-gifting-widget-horizontal":!this.vertical}}async handleGiftButtonClick(){if(this.productId&&this.formSelector){const t=document.querySelector(this.formSelector);if(!t)return void console.error("SallaGifting:: Form not found in the document!");if(!(t instanceof HTMLFormElement))return void console.error("SallaGifting:: The specified selector does not correspond to a form tag!");if(!t.reportValidity())return console.error("SallaGifting:: Form is not valid!"),void salla.error(salla.lang.get("common.messages.required_fields"))}const t=document.querySelector(`salla-product-options[product-id="${this.productId}"]`);!t||await t.reportValidity()?this.open():salla.error(salla.lang.get("common.messages.required_fields"))}render(){return[s("div",{key:"416981417bec78c8c3fda43e6f80745f4d735154"},s("salla-list-tile",{key:"495255205e1c226669a14a94e50442aabd9818da",class:this.generateClass()},s("div",{key:"f2dbdc4ea0dc76d806f18563739a116e15cbbe08",slot:"title"},this.vertical?s("span",{innerHTML:h}):"",s("h3",{key:"9ed4f1d995eaf2341a9ec237ebfb486ed3db988e"},this.widgetTitle?this.widgetTitle:this.sectionTitle)),s("div",{key:"b5d5512fcb2513177eaa1e25eacce9092f7d845f",slot:"subtitle"},s("div",{key:"0a8223b41973b72d942ce91c5f478a3edaa5dfd3"},this.widgetSubtitle?this.widgetSubtitle:this.sectionSubtitle)),s("div",{key:"a6d5a077131117c6854ffc2b39e506be7953051e",slot:"action"},s("salla-button",{key:"99b14364789884b0010e50941c27cbcfe7445785",color:"primary",fill:"outline",width:"wide",class:"s-gifting-widget-action",onClick:()=>this.handleGiftButtonClick()},s("slot",{key:"27f6be7b07084f48da83af6240933d619407307f",name:"widget-btn-content"},s("div",{key:"ee5d04e96dd1e3849a33813b3737b476b5470497",class:"s-gifting-widget-action-content"},s("span",{key:"d02bb1f6cd4dff335eeca1341da2c86d2976b4fc",innerHTML:h}),"  ",s("span",{key:"98a3594e6d01133c4f448d8e5df22ba2984cf09e"},this.sectionBtnText)))))),s("salla-modal",{key:"0be87b9d369e92a71b68f570b9bf19a0ddb7dd6b",id:this.hostId,isLoading:!0,class:"s-gifting-modal",width:"sm",ref:t=>this.modal=t},s("div",{key:"978995d399506ff82ac0f2385a1f85a808c7da3e",slot:"loading"},s("div",{key:"7d1f141fd9131d35edb81326062e8f7cadfa2cab",class:"s-gifting-skeleton"},s("div",{key:"b33cfd58381c7c1b545ffedf6739e42fdb75c8de",class:"s-gifting-modal-header"},s("salla-skeleton",{key:"e03a505ad3720c25077ca91c7eec2843cdaee225",type:"circle",height:"5rem",width:"5rem"}),s("h2",{key:"6f630d2582c96fc71406ef4557143c6e9dbd4a88",class:"s-gifting-modal-title"},s("div",{key:"8d1a3540993c9b40e705f2145bf0514754c36dab",class:"s-gifting-modal-badge-wrapper"},s("salla-skeleton",{key:"d965c353f19cf785a13eba6332b715eed9748836",height:"15px",width:"150px"})))),s("div",{key:"abacc03d1e30075d3d24dfd577dc9a60f7b52810",class:"s-gifting-skeleton-content"},s("salla-skeleton",{key:"03db84cfccc546602a6f521b015d0c12b93caa6f",height:"10px",width:"150px"}),s("salla-skeleton",{key:"e8e2d4e70d208055baaae44a8d7da8aa5c6a33da",height:"230px"}),s("salla-skeleton",{key:"2c90d91fb63551685b2041f2bc51fdb5219cbbb7",height:"10px",width:"150px"}),s("salla-skeleton",{key:"8962bc17f43cb04563caa02db3df585189579f8f",height:"30px"}),s("salla-skeleton",{key:"73730453aa6f8d0ec2a653b4711b80b32a18b916",height:"40px"})))),s("slot",{key:"4bcf5a6d53485c461c35f53ce7e265bcf770989e",name:"header"}),this.hasError?s("salla-placeholder",{alignment:"center"},s("span",{slot:"title"},this.errorMessage||salla.lang.get("common.errors.empty_results")),s("span",{slot:"description"}," ")):[s("div",{class:"s-gifting-modal-header"},s("span",{class:"s-gifting-modal-icon"},s("span",{innerHTML:h})),s("h2",{class:"s-gifting-modal-title"},s("div",{class:"s-gifting-modal-badge-wrapper"},!this.skipStep1()&&s("div",{class:"s-gifting-modal-badge"},s("span",null,s("span",null,this.currentStep),"/2")),s("span",null,this.giftDetails)))),s("div",{class:"s-gifting-steps-wrapper "+this.parentClass,ref:t=>this.stepsWrapper=t},!this.skipStep1()&&s("div",{class:"s-gifting-step-one gift-step-1",ref:t=>this.step1Elems=t},this.gift&&this.gift.show_images&&s("div",{class:"s-gifting-modal-uploader-title anime-item"},this.selectImageForYourGift),this.gift&&this.gift.show_images&&s("div",{class:"s-gifting-image-section"},s("div",{class:`s-gifting-modal-uploader anime-item ${this.disableClass}`,ref:t=>this.uploader=t},s("span",{class:"s-gifting-remove-preview pointer-events-auto",onClick:()=>this.removePreview(),innerHTML:a}),this.selectImageOrUpload&&this.gift&&s("salla-file-upload",{"instant-upload":!0,name:"image_url",url:salla.url.api(salla.product.api.getUrl("giftImage")),onUploaded:t=>this.handleUploadImage(t.detail),labelIdle:this.getFilepondPlaceholder(),onRemoved:()=>this.handleRemoveImage()})),s("div",{class:"anime-item"},!this.uploadedImage&&this.gift&&this.gift.gift_images&&this.gift.gift_images.length>0?s("salla-slider",{id:"gifting-slider",loop:!1,"controls-outer":!0,class:"s-gifting-slider",type:"carousel"},s("div",{slot:"items"},this.gift&&this.gift.gift_images?this.gift?.gift_images.map((t=>s("a",{class:"s-gifting-clickable s-gifting-image",onClick:()=>this.setPreview(t)},s("img",{src:t.url,alt:`${t.id}`})))):"")):"")),this.gift&&this.gift.show_texts?s("div",{class:"anime-item"},s("div",{class:"s-gifting-modal-uploader-title s-gifting-text-title"},this.giftText),s("div",{class:"s-form-group s-gifting-selectText",ref:t=>this.textSelect=t},s("select",{id:"gift-text-selection",name:"gift-text-selection",class:"s-form-control s-gifting-select",onChange:t=>this.toggleGiftText(t)},s("option",{"data-id":null,selected:!this.selectedGiftTextOption},this.selectGiftMessage),this.gift&&this.gift.gift_texts?this.gift?.gift_texts.map((t=>s("option",{"data-id":t.id,value:t.text,key:t.id,selected:String(this.selectedGiftTextOption)===String(t.id)},t.text))):"",this.gift&&this.gift.show_custom_text?s("option",{"data-id":"custom",selected:"custom"===this.selectedGiftTextOption},this.giftCustomText):null)),s("div",{class:this.showGiftText&&this.gift&&this.gift.show_custom_text?"s-form-group s-gifting-textarea shown":"s-form-group s-gifting-textarea hide",ref:t=>this.customTextArea=t},s("label",{htmlFor:"gift-custom-text",class:"s-form-label"},this.giftCustomText),s("div",{class:"mt-1"},s("textarea",{onInput:t=>this.handleTextAreaChange(t),rows:4,ref:t=>this.textArea=t,name:"gift-custom-text",id:"gift-custom-text",class:"s-form-control"})))):null,s("div",{class:"anime-item"},s("salla-button",{color:"primary",width:"wide",onClick:()=>this.goToStep2(!!this.gift?.show_texts)},s("span",null,this.nextStep)))),s("div",{class:"s-gifting-step-two gift-step-2",style:this.skipStep1()?{opacity:"1",transform:"translateX(0)",position:"relative"}:void 0,ref:t=>this.step2Elems=t},s("div",{class:this.step2ItemClass(this.errors?.sender_name?"s-form-group s-form-has-error":"s-form-group")},s("label",{htmlFor:"sender_name",class:"s-form-label"},this.senderNameLabel),s("input",{type:"text",class:"s-form-control",name:"sender_name",id:"sender_name",value:this.senderName,onInput:t=>this.handleSenderName(t),placeholder:""}),this.errors&&this.errors.sender_name?s("span",{class:"s-gifting-error"},this.errors.sender_name):""),s("div",{class:this.step2ItemClass(this.errors?.["receiver.name"]?"s-form-group s-form-has-error":"s-form-group")},s("label",{htmlFor:"receiver_name",class:"s-form-label"},this.receiverNameFieldLabel),s("input",{type:"text",class:"s-form-control",name:"receiver_name",id:"receiver_name",value:"",onInput:t=>this.handleReceiverName(t),placeholder:""}),this.errors&&this.errors["receiver.name"]?s("span",{class:"s-gifting-error"},this.errors["receiver.name"]):""),s("div",{class:this.step2ItemClass(this.errors?.["receiver.mobile"]?"s-form-group s-form-has-error":"s-form-group")},s("label",{class:"s-form-label"},this.receiverMobileFieldLabel),s("salla-tel-input",{class:"s-gifting-tel-input",phone:this.receiverMobile,countryCode:this.receiverCountryCode,onPhoneEntered:t=>this.handlePhoneInputChange(t)}),this.errors&&this.errors["receiver.mobile"]?s("span",{class:"s-gifting-error"},this.errors["receiver.mobile"]):""),this.isPhysical()&&s("div",{class:this.step2ItemClass(this.errors?.["receiver.country"]?"s-form-group s-form-has-error":"s-form-group")},s("label",{class:"s-form-label",htmlFor:`${this.hostId}-country`},this.receiverCountryFieldLabel),s("salla-searchable-dropdown",{placeholder:this.selectCountry,items:this.gift?.countries??[],selectedItem:this.selectedCountry,disabled:!this.gift?.countries?.length,required:!0,inputId:`${this.hostId}-country`,searchable:!1,keepParentScroll:!0,onItemSelected:t=>this.handleCountrySelected(t.detail),onDropdownClosed:()=>this.handleCountryDropdownClosed()}),this.errors&&this.errors["receiver.country"]?s("span",{class:"s-gifting-error"},this.errors["receiver.country"]):""),this.isPhysical()&&this.isKSA&&s("div",{class:this.step2ItemClass(this.errors?.["receiver.region"]?"s-form-group s-form-has-error":"s-form-group")},s("label",{class:"s-form-label",htmlFor:`${this.hostId}-region`},this.receiverRegionFieldLabel),s("salla-searchable-dropdown",{placeholder:this.selectRegion,items:this.regions??[],selectedItem:this.selectedRegion,loading:this.loadingRegions,disabled:this.loadingRegions||!this.regions?.length,required:!0,inputId:`${this.hostId}-region`,searchable:!1,keepParentScroll:!0,onItemSelected:t=>this.handleRegionSelected(t.detail),onDropdownClosed:()=>this.handleRegionDropdownClosed()}),this.errors&&this.errors["receiver.region"]?s("span",{class:"s-gifting-error"},this.errors["receiver.region"]):""),this.isPhysical()&&s("div",{class:this.step2ItemClass(this.errors?.["receiver.city_id"]?"s-form-group s-form-has-error":"s-form-group")},s("label",{class:"s-form-label",htmlFor:`${this.hostId}-city`},this.receiverCityFieldLabel),s("salla-searchable-dropdown",{placeholder:this.selectCity,items:this.displayedCities,selectedItem:this.selectedCity,loading:this.loadingCities,searching:this.searchingCities,disabled:this.loadingCities||this.isKSA&&!this.selectedRegionId,required:!0,inputId:`${this.hostId}-city`,searchQuery:this.citySearchQuery,clientSearch:!this.enableCityAjaxSearch,dropUp:!0,keepParentScroll:!0,onItemSelected:t=>this.handleCitySelected(t.detail),onSearchInput:t=>this.handleCitySearch(t.detail),onDropdownClosed:()=>this.handleCityDropdownClosed()}),this.errors&&this.errors["receiver.city_id"]?s("span",{class:"s-gifting-error"},this.errors["receiver.city_id"]):""),this.isPhysical()&&this.cityNoticeText()&&s("div",{class:this.step2ItemClass("s-gifting-info")},s("span",{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>alert</title>\n<path d="M16 13.333c-0.736 0-1.333 0.597-1.333 1.333v8c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-8c0-0.736-0.597-1.333-1.333-1.333zM16 9.327c-0.736 0-1.333 0.604-1.333 1.34s0.597 1.333 1.333 1.333 1.333-0.597 1.333-1.333v-0.013c0-0.736-0.597-1.327-1.333-1.327zM27.313 4.687c-6.237-6.237-16.389-6.239-22.628 0-6.237 6.239-6.237 16.389 0 22.628 3.119 3.119 7.216 4.679 11.313 4.679s8.195-1.559 11.313-4.679c6.24-6.239 6.24-16.391 0.001-22.628zM25.428 25.428c-5.199 5.197-13.657 5.197-18.857 0-5.197-5.199-5.197-13.659 0-18.857 5.199-5.197 13.659-5.197 18.857 0 5.199 5.2 5.199 13.659 0 18.857z"></path>\n</svg>\n'}),s("span",null,this.cityNoticeText())),!this.isPhysical()&&s("div",{class:this.step2ItemClass()},s("label",{class:"s-gifting-schedule s-gifting-clickable",htmlFor:`schedule-${this.hostId}`},s("input",{type:"checkbox",name:"schedule",id:`schedule-${this.hostId}`,onChange:()=>this.toggleCalendar(),class:"s-checkbox"}),s("span",{class:"s-form-label"}," ",this.sendLater," "))),s("div",{class:this.getCalendarClasses(),ref:t=>this.calendarFormGroup=t},s("label",{class:"s-form-label"},this.selectSendDateAndTime),s("salla-datetime-picker",{value:this.deliveryDate,placeholder:this.selectSendDateAndTime,"enable-time":!0,"date-format":"Y-m-d h:i K",onPicked:t=>this.handleDateTimePicker(t)}),s("span",{class:"s-gifting-calendar-hint"},this.canNotEditOrderAfterSelectDate)),s("div",{class:this.step2ItemClass("s-gifting-step-two-footer")},!this.skipStep1()&&s("a",{href:"#!",innerHTML:e,onClick:t=>this.goToStep1(t)}),s("salla-button",{onClick:()=>this.submitForm(),color:"primary",width:"wide"},s("span",null,this.sendGift)))))],s("slot",{key:"a4d37b893e4a0867c044817434ade65b16fbe89a",name:"footer"})))]}};l.CITY_AJAX_THRESHOLD=400,l.CITY_SEARCH_DEBOUNCE_MS=100,l.style=".s-gifting-steps-wrapper{transition:height 0.8s cubic-bezier(0.55, 0, 0.1, 1) 0s}.s-gifting-select{background-image:url(\"data:image/svg+xml;utf8,<svg version='1.1' fill='gray' xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'><title>keyboard_arrow_down</title><path d='M9.875 11.104l6.125 6.125 6.125-6.125 1.875 1.875-8 8-8-8z'></path></svg>\");background-size:24px;background-repeat:no-repeat;background-position:99%;appearance:none}[dir=rtl] .s-gifting-select{background-position:5px}.s-gifting-widget-vertical .s-list-tile-item [slot=title]{display:flex;align-items:center;gap:1.5rem}.s-gifting-widget-vertical .s-list-tile-item-content{width:100%}.s-gifting-modal .s-searchable-dropdown-trigger{border-color:#d1d5db}.s-gifting-modal .s-searchable-dropdown-trigger:hover:not(.s-searchable-dropdown-trigger--disabled){border-color:#d1d5db}.s-gifting-modal .s-searchable-dropdown-trigger--open,.s-gifting-modal .s-searchable-dropdown-trigger:focus{border-color:var(--color-primary, #00897b);box-shadow:0 0 0 1px var(--color-primary, #00897b)}.s-gifting-modal .s-searchable-dropdown-trigger-placeholder{color:#000}.s-gifting-modal .s-gifting-image-section{margin-bottom:1.5rem}.s-gifting-modal .s-gifting-slider{margin-bottom:0.5rem}.s-gifting-modal .s-gifting-image{display:block}.s-gifting-modal .s-gifting-image img{display:block;width:auto;height:100px;object-fit:contain}.s-gifting-modal .s-gifting-image-section+.anime-item .s-gifting-text-title{margin-top:1rem}";export{l as salla_gifting}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{d as i}from"./p-DNWyGkAx.js";function t(i,t){return t.forEach((function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach((function(e){if("default"!==e&&!(e in i)){var n=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(i,e,n.get?n:{enumerable:!0,get:function(){return t[e]}})}}))})),Object.freeze(i)}var e,n,s,a={exports:{}};var r,o=s?n:(s=1,e||(e=1,r=function(i){return function(){for(var t=[["Afghanistan","af","93"],["Albania","al","355"],["Algeria","dz","213"],["American Samoa","as","1",5,["684"]],["Andorra","ad","376"],["Angola","ao","244"],["Anguilla","ai","1",6,["264"]],["Antigua & Barbuda","ag","1",7,["268"]],["Argentina","ar","54"],["Armenia","am","374"],["Aruba","aw","297"],["Ascension Island","ac","247"],["Australia","au","61",0],["Austria","at","43"],["Azerbaijan","az","994"],["Bahamas","bs","1",8,["242"]],["Bahrain","bh","973"],["Bangladesh","bd","880"],["Barbados","bb","1",9,["246"]],["Belarus","by","375"],["Belgium","be","32"],["Belize","bz","501"],["Benin","bj","229"],["Bermuda","bm","1",10,["441"]],["Bhutan","bt","975"],["Bolivia","bo","591"],["Bosnia & Herzegovina","ba","387"],["Botswana","bw","267"],["Brazil","br","55"],["British Indian Ocean Territory","io","246"],["British Virgin Islands","vg","1",11,["284"]],["Brunei","bn","673"],["Bulgaria","bg","359"],["Burkina Faso","bf","226"],["Burundi","bi","257"],["Cambodia","kh","855"],["Cameroon","cm","237"],["Canada","ca","1",1,["204","226","236","249","250","263","289","306","343","354","365","367","368","382","387","403","416","418","428","431","437","438","450","584","468","474","506","514","519","548","579","581","584","587","604","613","639","647","672","683","705","709","742","753","778","780","782","807","819","825","867","873","902","905"]],["Cape Verde","cv","238"],["Caribbean Netherlands","bq","599",1,["3","4","7"]],["Cayman Islands","ky","1",12,["345"]],["Central African Republic","cf","236"],["Chad","td","235"],["Chile","cl","56"],["China","cn","86"],["Christmas Island","cx","61",2,["89164"]],["Cocos (Keeling) Islands","cc","61",1,["89162"]],["Colombia","co","57"],["Comoros","km","269"],["Congo - Brazzaville","cg","242"],["Congo - Kinshasa","cd","243"],["Cook Islands","ck","682"],["Costa Rica","cr","506"],["Côte d’Ivoire","ci","225"],["Croatia","hr","385"],["Cuba","cu","53"],["Curaçao","cw","599",0],["Cyprus","cy","357"],["Czech Republic","cz","420"],["Denmark","dk","45"],["Djibouti","dj","253"],["Dominica","dm","1",13,["767"]],["Dominican Republic","do","1",2,["809","829","849"]],["Ecuador","ec","593"],["Egypt","eg","20"],["El Salvador","sv","503"],["Equatorial Guinea","gq","240"],["Eritrea","er","291"],["Estonia","ee","372"],["Eswatini","sz","268"],["Ethiopia","et","251"],["Falkland Islands","fk","500"],["Faroe Islands","fo","298"],["Fiji","fj","679"],["Finland","fi","358",0],["France","fr","33"],["French Guiana","gf","594"],["French Polynesia","pf","689"],["Gabon","ga","241"],["Gambia","gm","220"],["Georgia","ge","995"],["Germany","de","49"],["Ghana","gh","233"],["Gibraltar","gi","350"],["Greece","gr","30"],["Greenland","gl","299"],["Grenada","gd","1",14,["473"]],["Guadeloupe","gp","590",0],["Guam","gu","1",15,["671"]],["Guatemala","gt","502"],["Guernsey","gg","44",1,["1481","7781","7839","7911"]],["Guinea","gn","224"],["Guinea-Bissau","gw","245"],["Guyana","gy","592"],["Haiti","ht","509"],["Honduras","hn","504"],["Hong Kong","hk","852"],["Hungary","hu","36"],["Iceland","is","354"],["India","in","91"],["Indonesia","id","62"],["Iran","ir","98"],["Iraq","iq","964"],["Ireland","ie","353"],["Isle of Man","im","44",2,["1624","74576","7524","7924","7624"]],["Israel","il","972"],["Italy","it","39",0],["Jamaica","jm","1",4,["876","658"]],["Japan","jp","81"],["Jersey","je","44",3,["1534","7509","7700","7797","7829","7937"]],["Jordan","jo","962"],["Kazakhstan","kz","7",1,["33","7"]],["Kenya","ke","254"],["Kiribati","ki","686"],["Kosovo","xk","383"],["Kuwait","kw","965"],["Kyrgyzstan","kg","996"],["Laos","la","856"],["Latvia","lv","371"],["Lebanon","lb","961"],["Lesotho","ls","266"],["Liberia","lr","231"],["Libya","ly","218"],["Liechtenstein","li","423"],["Lithuania","lt","370"],["Luxembourg","lu","352"],["Macau","mo","853"],["Madagascar","mg","261"],["Malawi","mw","265"],["Malaysia","my","60"],["Maldives","mv","960"],["Mali","ml","223"],["Malta","mt","356"],["Marshall Islands","mh","692"],["Martinique","mq","596"],["Mauritania","mr","222"],["Mauritius","mu","230"],["Mayotte","yt","262",1,["269","639"]],["Mexico","mx","52"],["Micronesia","fm","691"],["Moldova","md","373"],["Monaco","mc","377"],["Mongolia","mn","976"],["Montenegro","me","382"],["Montserrat","ms","1",16,["664"]],["Morocco","ma","212",0],["Mozambique","mz","258"],["Myanmar (Burma)","mm","95"],["Namibia","na","264"],["Nauru","nr","674"],["Nepal","np","977"],["Netherlands","nl","31"],["New Caledonia","nc","687"],["New Zealand","nz","64"],["Nicaragua","ni","505"],["Niger","ne","227"],["Nigeria","ng","234"],["Niue","nu","683"],["Norfolk Island","nf","672"],["North Korea","kp","850"],["North Macedonia","mk","389"],["Northern Mariana Islands","mp","1",17,["670"]],["Norway","no","47",0],["Oman","om","968"],["Pakistan","pk","92"],["Palau","pw","680"],["Palestine","ps","970"],["Panama","pa","507"],["Papua New Guinea","pg","675"],["Paraguay","py","595"],["Peru","pe","51"],["Philippines","ph","63"],["Poland","pl","48"],["Portugal","pt","351"],["Puerto Rico","pr","1",3,["787","939"]],["Qatar","qa","974"],["Réunion","re","262",0],["Romania","ro","40"],["Russia","ru","7",0],["Rwanda","rw","250"],["Samoa","ws","685"],["San Marino","sm","378"],["São Tomé & Príncipe","st","239"],["Saudi Arabia","sa","966"],["Senegal","sn","221"],["Serbia","rs","381"],["Seychelles","sc","248"],["Sierra Leone","sl","232"],["Singapore","sg","65"],["Sint Maarten","sx","1",21,["721"]],["Slovakia","sk","421"],["Slovenia","si","386"],["Solomon Islands","sb","677"],["Somalia","so","252"],["South Africa","za","27"],["South Korea","kr","82"],["South Sudan","ss","211"],["Spain","es","34"],["Sri Lanka","lk","94"],["St Barthélemy","bl","590",1],["St Helena","sh","290"],["St Kitts & Nevis","kn","1",18,["869"]],["St Lucia","lc","1",19,["758"]],["St Martin","mf","590",2],["St Pierre & Miquelon","pm","508"],["St Vincent & Grenadines","vc","1",20,["784"]],["Sudan","sd","249"],["Suriname","sr","597"],["Svalbard & Jan Mayen","sj","47",1,["79"]],["Sweden","se","46"],["Switzerland","ch","41"],["Syria","sy","963"],["Taiwan","tw","886"],["Tajikistan","tj","992"],["Tanzania","tz","255"],["Thailand","th","66"],["Timor-Leste","tl","670"],["Togo","tg","228"],["Tokelau","tk","690"],["Tonga","to","676"],["Trinidad & Tobago","tt","1",22,["868"]],["Tunisia","tn","216"],["Turkey","tr","90"],["Turkmenistan","tm","993"],["Turks & Caicos Islands","tc","1",23,["649"]],["Tuvalu","tv","688"],["Uganda","ug","256"],["Ukraine","ua","380"],["United Arab Emirates","ae","971"],["United Kingdom","gb","44",0],["United States","us","1",0],["Uruguay","uy","598"],["US Virgin Islands","vi","1",24,["340"]],["Uzbekistan","uz","998"],["Vanuatu","vu","678"],["Vatican City","va","39",1,["06698"]],["Venezuela","ve","58"],["Vietnam","vn","84"],["Wallis & Futuna","wf","681"],["Western Sahara","eh","212",1,["5288","5289"]],["Yemen","ye","967"],["Zambia","zm","260"],["Zimbabwe","zw","263"],["Åland Islands","ax","358",1,["18"]]],e=0;e<t.length;e++){var n=t[e];t[e]={name:n[0],iso2:n[1],dialCode:n[2],priority:n[3]||0,areaCodes:n[4]||null}}function s(i,t,e){return(t=a(t))in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}function a(t){var e=function(t){if("object"!=typeof t||null===t)return t;var e=t[Symbol.toPrimitive];if(e!==i){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}var r={getInstance:function(i){var t=i.getAttribute("data-intl-tel-input-id");return window.intlTelInputGlobals.instances[t]},instances:{},documentReady:function(){return"complete"===document.readyState}};"object"==typeof window&&(window.intlTelInputGlobals=r);var o=0,h={allowDropdown:!0,autoInsertDialCode:!1,autoPlaceholder:"polite",countrySearch:!1,customContainer:"",customPlaceholder:null,dropdownContainer:null,excludeCountries:[],fixDropdownWidth:!1,formatOnDisplay:!0,geoIpLookup:null,hiddenInput:"",initialCountry:"",localizedCountries:null,nationalMode:!0,onlyCountries:[],placeholderNumberType:"MOBILE",preferredCountries:["us","gb"],separateDialCode:!1,showFlags:!0,useFullscreenPopup:"undefined"!=typeof navigator&&"undefined"!=typeof window&&(/Android.+Mobile|webOS|iPhone|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||window.innerWidth<=500),utilsScript:""},u=["800","822","833","844","855","866","877","880","881","882","883","884","885","886","887","888","889"],l=function(i,t){for(var e=Object.keys(i),n=0;n<e.length;n++)t(e[n],i[e[n]])},c=function(i){l(window.intlTelInputGlobals.instances,(function(t){window.intlTelInputGlobals.instances[t][i]()}))},d=function(){function e(i,t){var n=this;!function(i,t){if(!(i instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.id=o++,this.telInput=i,this.activeItem=null,this.highlightedItem=null;var s=t||{};this.options={},l(h,(function(i,t){n.options[i]=s.hasOwnProperty(i)?s[i]:t})),this.hadInitialPlaceholder=Boolean(i.getAttribute("placeholder"))}return n=e,r=[{key:"_init",value:function(){var i=this;if(this.options.useFullscreenPopup&&(this.options.fixDropdownWidth=!1),this.options.countrySearch&&!this.options.useFullscreenPopup&&(this.options.fixDropdownWidth=!0),this.options.nationalMode&&(this.options.autoInsertDialCode=!1),this.options.separateDialCode&&(this.options.autoInsertDialCode=!1),!this.options.showFlags&&this.options.allowDropdown&&!this.options.separateDialCode&&(this.options.showFlags=!0),this.options.useFullscreenPopup&&!this.options.dropdownContainer&&(this.options.dropdownContainer=document.body),this.isRTL=!!this.telInput.closest("[dir=rtl]"),"undefined"!=typeof Promise){var t=new Promise((function(t,e){i.resolveAutoCountryPromise=t,i.rejectAutoCountryPromise=e})),e=new Promise((function(t,e){i.resolveUtilsScriptPromise=t,i.rejectUtilsScriptPromise=e}));this.promise=Promise.all([t,e])}else this.resolveAutoCountryPromise=this.rejectAutoCountryPromise=function(){},this.resolveUtilsScriptPromise=this.rejectUtilsScriptPromise=function(){};this.selectedCountryData={},this._processCountryData(),this._generateMarkup(),this._setInitialState(),this._initListeners(),this._initRequests()}},{key:"_processCountryData",value:function(){this._processAllCountries(),this._processCountryCodes(),this._processPreferredCountries(),this.options.localizedCountries&&this._translateCountriesByLocale(),(this.options.onlyCountries.length||this.options.localizedCountries)&&this.countries.sort(this._countryNameSort)}},{key:"_addCountryCode",value:function(t,e,n){e.length>this.countryCodeMaxLen&&(this.countryCodeMaxLen=e.length),this.countryCodes.hasOwnProperty(e)||(this.countryCodes[e]=[]);for(var s=0;s<this.countryCodes[e].length;s++)if(this.countryCodes[e][s]===t)return;this.countryCodes[e][n!==i?n:this.countryCodes[e].length]=t}},{key:"_processAllCountries",value:function(){if(this.options.onlyCountries.length){var i=this.options.onlyCountries.map((function(i){return i.toLowerCase()}));this.countries=t.filter((function(t){return i.indexOf(t.iso2)>-1}))}else if(this.options.excludeCountries.length){var e=this.options.excludeCountries.map((function(i){return i.toLowerCase()}));this.countries=t.filter((function(i){return-1===e.indexOf(i.iso2)}))}else this.countries=t}},{key:"_translateCountriesByLocale",value:function(){for(var i=0;i<this.countries.length;i++){var t=this.countries[i].iso2.toLowerCase();this.options.localizedCountries.hasOwnProperty(t)&&(this.countries[i].name=this.options.localizedCountries[t])}}},{key:"_countryNameSort",value:function(i,t){return i.name<t.name?-1:i.name>t.name?1:0}},{key:"_processCountryCodes",value:function(){this.countryCodeMaxLen=0,this.dialCodes={},this.countryCodes={};for(var i=0;i<this.countries.length;i++){var t=this.countries[i];this.dialCodes[t.dialCode]||(this.dialCodes[t.dialCode]=!0),this._addCountryCode(t.iso2,t.dialCode,t.priority)}for(var e=0;e<this.countries.length;e++){var n=this.countries[e];if(n.areaCodes)for(var s=this.countryCodes[n.dialCode][0],a=0;a<n.areaCodes.length;a++){for(var r=n.areaCodes[a],o=1;o<r.length;o++){var h=n.dialCode+r.substr(0,o);this._addCountryCode(s,h),this._addCountryCode(n.iso2,h)}this._addCountryCode(n.iso2,n.dialCode+r)}}}},{key:"_processPreferredCountries",value:function(){this.preferredCountries=[];for(var i=0;i<this.options.preferredCountries.length;i++){var t=this.options.preferredCountries[i].toLowerCase(),e=this._getCountryData(t,!1,!0);e&&this.preferredCountries.push(e)}}},{key:"_createEl",value:function(i,t,e){var n=document.createElement(i);return t&&l(t,(function(i,t){return n.setAttribute(i,t)})),e&&e.appendChild(n),n}},{key:"_generateMarkup",value:function(){this.telInput.classList.add("iti__tel-input"),this.telInput.hasAttribute("autocomplete")||this.telInput.form&&this.telInput.form.hasAttribute("autocomplete")||this.telInput.setAttribute("autocomplete","off");var i=this.options,t=i.allowDropdown,e=i.separateDialCode,n=i.showFlags,a=i.customContainer,r=i.hiddenInput,o=i.dropdownContainer,h=i.fixDropdownWidth,u=i.useFullscreenPopup,l=i.countrySearch,c="iti";t&&(c+=" iti--allow-dropdown"),e&&(c+=" iti--separate-dial-code"),n&&(c+=" iti--show-flags"),a&&(c+=" ".concat(a));var d=this._createEl("div",{class:c});this.telInput.parentNode.insertBefore(d,this.telInput);var f=t||n||e;if(f&&(this.flagsContainer=this._createEl("div",{class:"iti__flag-container"},d)),d.appendChild(this.telInput),f&&(this.selectedFlag=this._createEl("div",function(i){for(var t=1;t<arguments.length;t++){var e=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(e);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(e).filter((function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable}))),n.forEach((function(t){s(i,t,e[t])}))}return i}({class:"iti__selected-flag"},t&&{role:"combobox","aria-haspopup":"listbox","aria-controls":"iti-".concat(this.id,"__country-listbox"),"aria-expanded":"false","aria-label":"Telephone country code"}),this.flagsContainer)),n&&(this.selectedFlagInner=this._createEl("div",{class:"iti__flag"},this.selectedFlag)),this.selectedFlag&&this.telInput.disabled&&this.selectedFlag.setAttribute("aria-disabled","true"),e&&(this.selectedDialCode=this._createEl("div",{class:"iti__selected-dial-code"},this.selectedFlag)),t)if(this.telInput.disabled||this.selectedFlag.setAttribute("tabindex","0"),this.dropdownArrow=this._createEl("div",{class:"iti__arrow"},this.selectedFlag),this.dropdownContent=this._createEl("div",{class:"iti__dropdown-content iti__hide ".concat(h?"":"iti--flexible-dropdown-width")}),l&&(this.searchInput=this._createEl("input",{type:"text",class:"iti__search-input",placeholder:"Search"},this.dropdownContent)),this.countryList=this._createEl("ul",{class:"iti__country-list",id:"iti-".concat(this.id,"__country-listbox"),role:"listbox","aria-label":"List of countries"},this.dropdownContent),this.preferredCountries.length&&!l&&(this._appendListItems(this.preferredCountries,"iti__preferred",!0),this._createEl("li",{class:"iti__divider","aria-hidden":"true"},this.countryList)),this._appendListItems(this.countries,"iti__standard"),o){var v="iti iti--container";u&&(v+=" iti--fullscreen-popup"),l&&(v+=" iti--country-search"),this.dropdown=this._createEl("div",{class:v}),this.dropdown.appendChild(this.dropdownContent)}else this.flagsContainer.appendChild(this.dropdownContent);if(r){var p=r,y=this.telInput.getAttribute("name");if(y){var m=y.lastIndexOf("[");-1!==m&&(p="".concat(y.substr(0,m),"[").concat(p,"]"))}this.hiddenInput=this._createEl("input",{type:"hidden",name:p}),d.appendChild(this.hiddenInput)}}},{key:"_appendListItems",value:function(i,t,e){for(var n=0;n<i.length;n++){var s=i[n],a=e?"-preferred":"",r=this._createEl("li",{id:"iti-".concat(this.id,"__item-").concat(s.iso2).concat(a),class:"iti__country ".concat(t),tabindex:"-1",role:"option","data-dial-code":s.dialCode,"data-country-code":s.iso2,"aria-selected":"false"},this.countryList);s.node=r;var o="";this.options.showFlags&&(o+="<div class='iti__flag-box'><div class='iti__flag iti__".concat(s.iso2,"'></div></div>")),o+="<span class='iti__country-name'>".concat(s.name,"</span>"),o+="<span class='iti__dial-code'>+".concat(s.dialCode,"</span>"),r.insertAdjacentHTML("beforeend",o)}}},{key:"_setInitialState",value:function(){var i=this.telInput.getAttribute("value"),t=this.telInput.value,e=!i||"+"!==i.charAt(0)||t&&"+"===t.charAt(0)?t:i,n=this._getDialCode(e),s=this._isRegionlessNanp(e),a=this.options,r=a.initialCountry,o=a.autoInsertDialCode;n&&!s?this._updateFlagFromNumber(e):"auto"!==r&&(r&&this._getCountryData(r,!1,!0)?this._setFlag(r.toLowerCase()):n&&s?this._setFlag("us"):(this.defaultCountry=this.preferredCountries.length?this.preferredCountries[0].iso2:this.countries[0].iso2,e||this._setFlag(this.defaultCountry)),!e&&o&&(this.telInput.value="+".concat(this.selectedCountryData.dialCode))),e&&this._updateValFromNumber(e)}},{key:"_initListeners",value:function(){this._initKeyListeners(),this.options.autoInsertDialCode&&this._initBlurListeners(),this.options.allowDropdown&&this._initDropdownListeners(),this.hiddenInput&&this._initHiddenInputListener()}},{key:"_initHiddenInputListener",value:function(){var i=this;this._handleHiddenInputSubmit=function(){i.hiddenInput.value=i.getNumber()},this.telInput.form&&this.telInput.form.addEventListener("submit",this._handleHiddenInputSubmit)}},{key:"_getClosestLabel",value:function(){for(var i=this.telInput;i&&"LABEL"!==i.tagName;)i=i.parentNode;return i}},{key:"_initDropdownListeners",value:function(){var i=this;this._handleLabelClick=function(t){i.dropdownContent.classList.contains("iti__hide")?i.telInput.focus():t.preventDefault()};var t=this._getClosestLabel();t&&t.addEventListener("click",this._handleLabelClick),this._handleClickSelectedFlag=function(){!i.dropdownContent.classList.contains("iti__hide")||i.telInput.disabled||i.telInput.readOnly||i._showDropdown()},this.selectedFlag.addEventListener("click",this._handleClickSelectedFlag),this._handleFlagsContainerKeydown=function(t){i.dropdownContent.classList.contains("iti__hide")&&["ArrowUp","ArrowDown"," ","Enter"].includes(t.key)&&(t.preventDefault(),t.stopPropagation(),i._showDropdown()),"Tab"===t.key&&i._closeDropdown()},this.flagsContainer.addEventListener("keydown",this._handleFlagsContainerKeydown)}},{key:"_initRequests",value:function(){var i=this;this.options.utilsScript&&!window.intlTelInputUtils?window.intlTelInputGlobals.documentReady()?window.intlTelInputGlobals.loadUtils(this.options.utilsScript):window.addEventListener("load",(function(){window.intlTelInputGlobals.loadUtils(i.options.utilsScript)})):this.resolveUtilsScriptPromise(),"auto"===this.options.initialCountry?this._loadAutoCountry():this.resolveAutoCountryPromise()}},{key:"_loadAutoCountry",value:function(){window.intlTelInputGlobals.autoCountry?this.handleAutoCountry():window.intlTelInputGlobals.startedLoadingAutoCountry||(window.intlTelInputGlobals.startedLoadingAutoCountry=!0,"function"==typeof this.options.geoIpLookup&&this.options.geoIpLookup((function(i){window.intlTelInputGlobals.autoCountry=i.toLowerCase(),setTimeout((function(){return c("handleAutoCountry")}))}),(function(){return c("rejectAutoCountryPromise")})))}},{key:"_initKeyListeners",value:function(){var i=this;this._handleKeyupEvent=function(){i._updateFlagFromNumber(i.telInput.value)&&i._triggerCountryChange()},this.telInput.addEventListener("keyup",this._handleKeyupEvent),this._handleClipboardEvent=function(){setTimeout(i._handleKeyupEvent)},this.telInput.addEventListener("cut",this._handleClipboardEvent),this.telInput.addEventListener("paste",this._handleClipboardEvent)}},{key:"_cap",value:function(i){var t=this.telInput.getAttribute("maxlength");return t&&i.length>t?i.substr(0,t):i}},{key:"_initBlurListeners",value:function(){var i=this;this._handleSubmitOrBlurEvent=function(){i._removeEmptyDialCode()},this.telInput.form&&this.telInput.form.addEventListener("submit",this._handleSubmitOrBlurEvent),this.telInput.addEventListener("blur",this._handleSubmitOrBlurEvent)}},{key:"_removeEmptyDialCode",value:function(){if("+"===this.telInput.value.charAt(0)){var i=this._getNumeric(this.telInput.value);i&&this.selectedCountryData.dialCode!==i||(this.telInput.value="")}}},{key:"_getNumeric",value:function(i){return i.replace(/\D/g,"")}},{key:"_trigger",value:function(i){var t=document.createEvent("Event");t.initEvent(i,!0,!0),this.telInput.dispatchEvent(t)}},{key:"_showDropdown",value:function(){this.options.fixDropdownWidth&&(this.dropdownContent.style.width="".concat(this.telInput.offsetWidth,"px")),this.dropdownContent.classList.remove("iti__hide"),this.selectedFlag.setAttribute("aria-expanded","true"),this._setDropdownPosition(),this.options.countrySearch?(this._highlightListItem(this.countryList.firstElementChild,!1),this.searchInput.focus()):this.activeItem&&(this._highlightListItem(this.activeItem,!1),this._scrollTo(this.activeItem,!0)),this._bindDropdownListeners(),this.dropdownArrow.classList.add("iti__arrow--up"),this._trigger("open:countrydropdown")}},{key:"_toggleClass",value:function(i,t,e){e&&!i.classList.contains(t)?i.classList.add(t):!e&&i.classList.contains(t)&&i.classList.remove(t)}},{key:"_setDropdownPosition",value:function(){var i=this;if(this.options.dropdownContainer&&this.options.dropdownContainer.appendChild(this.dropdown),!this.options.useFullscreenPopup){var t=this.telInput.getBoundingClientRect(),e=window.pageYOffset||document.documentElement.scrollTop,n=t.top+e,s=this.dropdownContent.offsetHeight,a=n+this.telInput.offsetHeight+s<e+window.innerHeight,r=!this.options.countrySearch&&!a&&n-s>e;this._toggleClass(this.dropdownContent,"iti__dropdown-content--dropup",r),this.options.dropdownContainer&&(this.dropdown.style.top="".concat(n+(r?0:this.telInput.offsetHeight),"px"),this.dropdown.style.left="".concat(t.left+document.body.scrollLeft,"px"),this._handleWindowScroll=function(){return i._closeDropdown()},window.addEventListener("scroll",this._handleWindowScroll))}}},{key:"_getClosestListItem",value:function(i){for(var t=i;t&&t!==this.countryList&&!t.classList.contains("iti__country");)t=t.parentNode;return t===this.countryList?null:t}},{key:"_bindDropdownListeners",value:function(){var i=this;this._handleMouseoverCountryList=function(t){var e=i._getClosestListItem(t.target);e&&i._highlightListItem(e,!1)},this.countryList.addEventListener("mouseover",this._handleMouseoverCountryList),this._handleClickCountryList=function(t){var e=i._getClosestListItem(t.target);e&&i._selectListItem(e)},this.countryList.addEventListener("click",this._handleClickCountryList);var t=!0;this._handleClickOffToClose=function(){t||i._closeDropdown(),t=!1},document.documentElement.addEventListener("click",this._handleClickOffToClose);var e="",n=null;if(this._handleKeydownOnDropdown=function(t){["ArrowUp","ArrowDown","Enter","Escape"].includes(t.key)&&(t.preventDefault(),t.stopPropagation(),"ArrowUp"===t.key||"ArrowDown"===t.key?i._handleUpDownKey(t.key):"Enter"===t.key?i._handleEnterKey():"Escape"===t.key&&i._closeDropdown()),!i.options.countrySearch&&/^[a-zA-ZÀ-ÿа-яА-Я ]$/.test(t.key)&&(t.stopPropagation(),n&&clearTimeout(n),e+=t.key.toLowerCase(),i._searchForCountry(e),n=setTimeout((function(){e=""}),1e3))},document.addEventListener("keydown",this._handleKeydownOnDropdown),this.options.countrySearch){var s=null;this._handleSearchChange=function(){s&&clearTimeout(s),s=setTimeout((function(){var t;(t=i.searchInput.value.trim())?i._filterCountries(t.toLowerCase()):i._filterCountries(null,!0),s=null}),100)},this.searchInput.addEventListener("input",this._handleSearchChange),this.searchInput.addEventListener("click",(function(i){return i.stopPropagation()}))}}},{key:"_filterCountries",value:function(t){var e=arguments.length>1&&arguments[1]!==i&&arguments[1],n=!0;this.countryList.innerHTML="";for(var s=0;s<this.countries.length;s++){var a=this.countries[s],r=a.name.toLowerCase(),o="+".concat(a.dialCode);(e||r.includes(t)||o.includes(t))&&(this.countryList.appendChild(a.node),n&&(this._highlightListItem(a.node,!1),n=!1))}}},{key:"_handleUpDownKey",value:function(i){var t="ArrowUp"===i?this.highlightedItem.previousElementSibling:this.highlightedItem.nextElementSibling;t?t.classList.contains("iti__divider")&&(t="ArrowUp"===i?t.previousElementSibling:t.nextElementSibling):this.countryList.childElementCount>1&&(t="ArrowUp"===i?this.countryList.lastElementChild:this.countryList.firstElementChild),t&&(this._highlightListItem(t,!this.options.countrySearch),this.options.countrySearch&&this._scrollTo(t,!1))}},{key:"_handleEnterKey",value:function(){this.highlightedItem&&this._selectListItem(this.highlightedItem)}},{key:"_searchForCountry",value:function(i){for(var t=0;t<this.countries.length;t++)if(this._startsWith(this.countries[t].name,i)){var e=this.countries[t].node;this._highlightListItem(e,!1),this._scrollTo(e,!0);break}}},{key:"_startsWith",value:function(i,t){return i.substr(0,t.length).toLowerCase()===t}},{key:"_updateValFromNumber",value:function(i){var t=i;if(this.options.formatOnDisplay&&window.intlTelInputUtils&&this.selectedCountryData){var e=this.options.nationalMode||"+"!==t.charAt(0)&&!this.options.separateDialCode,n=intlTelInputUtils.numberFormat;t=intlTelInputUtils.formatNumber(t,this.selectedCountryData.iso2,e?n.NATIONAL:n.INTERNATIONAL)}t=this._beforeSetNumber(t),this.telInput.value=t}},{key:"_updateFlagFromNumber",value:function(i){var t=i.indexOf("+"),e=t?i.substring(t):i,n=this.selectedCountryData.dialCode;e&&"1"===n&&"+"!==e.charAt(0)&&("1"!==e.charAt(0)&&(e="1".concat(e)),e="+".concat(e)),this.options.separateDialCode&&n&&"+"!==e.charAt(0)&&(e="+".concat(n).concat(e));var s=this._getDialCode(e,!0),a=this._getNumeric(e),r=null;if(s){var o=this.countryCodes[this._getNumeric(s)],h=-1!==o.indexOf(this.selectedCountryData.iso2)&&a.length<=s.length-1;if(!("1"===n&&this._isRegionlessNanp(a)||h))for(var u=0;u<o.length;u++)if(o[u]){r=o[u];break}}else"+"===e.charAt(0)&&a.length?r="":e&&"+"!==e||(r=this.defaultCountry);return null!==r&&this._setFlag(r)}},{key:"_isRegionlessNanp",value:function(i){var t=this._getNumeric(i);if("1"===t.charAt(0)){var e=t.substr(1,3);return-1!==u.indexOf(e)}return!1}},{key:"_highlightListItem",value:function(i,t){var e=this.highlightedItem;e&&e.classList.remove("iti__highlight"),this.highlightedItem=i,this.highlightedItem.classList.add("iti__highlight"),this.selectedFlag.setAttribute("aria-activedescendant",i.getAttribute("id")),t&&this.highlightedItem.focus()}},{key:"_getCountryData",value:function(i,e,n){for(var s=e?t:this.countries,a=0;a<s.length;a++)if(s[a].iso2===i)return s[a];if(n)return null;throw new Error("No country data for '".concat(i,"'"))}},{key:"_setFlag",value:function(i){var t=this.options,e=t.allowDropdown,n=t.separateDialCode,s=t.showFlags,a=this.selectedCountryData.iso2?this.selectedCountryData:{};if(this.selectedCountryData=i?this._getCountryData(i,!1,!1):{},this.selectedCountryData.iso2&&(this.defaultCountry=this.selectedCountryData.iso2),s&&this.selectedFlagInner.setAttribute("class","iti__flag iti__".concat(i)),this._setSelectedCountryFlagTitleAttribute(i,n),n){var r=this.selectedCountryData.dialCode?"+".concat(this.selectedCountryData.dialCode):"";this.selectedDialCode.innerHTML=r;var o=this.selectedFlag.offsetWidth||this._getHiddenSelectedFlagWidth();this.isRTL?this.telInput.style.paddingRight="".concat(o+6,"px"):this.telInput.style.paddingLeft="".concat(o+6,"px")}if(this._updatePlaceholder(),e){var h=this.activeItem;if(h&&(h.classList.remove("iti__active"),h.setAttribute("aria-selected","false")),i){var u=this.countryList.querySelector("#iti-".concat(this.id,"__item-").concat(i,"-preferred"))||this.countryList.querySelector("#iti-".concat(this.id,"__item-").concat(i));u.setAttribute("aria-selected","true"),u.classList.add("iti__active"),this.activeItem=u}}return a.iso2!==i}},{key:"_setSelectedCountryFlagTitleAttribute",value:function(i,t){var e;this.selectedFlag&&(e=i&&!t?"".concat(this.selectedCountryData.name,": +").concat(this.selectedCountryData.dialCode):i?this.selectedCountryData.name:"Unknown",this.selectedFlag.setAttribute("title",e))}},{key:"_getHiddenSelectedFlagWidth",value:function(){var i=this.telInput.parentNode.cloneNode();i.style.visibility="hidden",document.body.appendChild(i);var t=this.flagsContainer.cloneNode();i.appendChild(t);var e=this.selectedFlag.cloneNode(!0);t.appendChild(e);var n=e.offsetWidth;return i.parentNode.removeChild(i),n}},{key:"_updatePlaceholder",value:function(){if(window.intlTelInputUtils&&("aggressive"===this.options.autoPlaceholder||!this.hadInitialPlaceholder&&"polite"===this.options.autoPlaceholder)){var i=intlTelInputUtils.numberType[this.options.placeholderNumberType],t=this.selectedCountryData.iso2?intlTelInputUtils.getExampleNumber(this.selectedCountryData.iso2,this.options.nationalMode,i):"";t=this._beforeSetNumber(t),"function"==typeof this.options.customPlaceholder&&(t=this.options.customPlaceholder(t,this.selectedCountryData)),this.telInput.setAttribute("placeholder",t)}}},{key:"_selectListItem",value:function(i){var t=this._setFlag(i.getAttribute("data-country-code"));this._closeDropdown(),this._updateDialCode(i.getAttribute("data-dial-code")),this.telInput.focus();var e=this.telInput.value.length;this.telInput.setSelectionRange(e,e),t&&this._triggerCountryChange()}},{key:"_closeDropdown",value:function(){this.dropdownContent.classList.add("iti__hide"),this.selectedFlag.setAttribute("aria-expanded","false"),this.selectedFlag.removeAttribute("aria-activedescendant"),this.dropdownArrow.classList.remove("iti__arrow--up"),document.removeEventListener("keydown",this._handleKeydownOnDropdown),this.options.countrySearch&&this.searchInput.removeEventListener("input",this._handleSearchChange),document.documentElement.removeEventListener("click",this._handleClickOffToClose),this.countryList.removeEventListener("mouseover",this._handleMouseoverCountryList),this.countryList.removeEventListener("click",this._handleClickCountryList),this.options.dropdownContainer&&(this.options.useFullscreenPopup||window.removeEventListener("scroll",this._handleWindowScroll),this.dropdown.parentNode&&this.dropdown.parentNode.removeChild(this.dropdown)),this._trigger("close:countrydropdown")}},{key:"_scrollTo",value:function(i,t){var e=this.dropdownContent,n=window.pageYOffset||document.documentElement.scrollTop,s=e.offsetHeight,a=e.getBoundingClientRect().top+n,r=a+s,o=i.offsetHeight,h=i.getBoundingClientRect().top+n,u=h+o,l=h-a+e.scrollTop,c=s/2-o/2;h<a?(t&&(l-=c),e.scrollTop=l):u>r&&(t&&(l+=c),e.scrollTop=l-(s-o))}},{key:"_updateDialCode",value:function(i){var t,e=this.telInput.value,n="+".concat(i);if("+"===e.charAt(0)){var s=this._getDialCode(e);t=s?e.replace(s,n):n,this.telInput.value=t}else this.options.autoInsertDialCode&&(this.telInput.value=t=e?n+e:n)}},{key:"_getDialCode",value:function(i,t){var e="";if("+"===i.charAt(0))for(var n="",s=0;s<i.length;s++){var a=i.charAt(s);if(!isNaN(parseInt(a,10))){if(n+=a,t)this.countryCodes[n]&&(e=i.substr(0,s+1));else if(this.dialCodes[n]){e=i.substr(0,s+1);break}if(n.length===this.countryCodeMaxLen)break}}return e}},{key:"_getFullNumber",value:function(){var i=this.telInput.value.trim(),t=this.selectedCountryData.dialCode,e=this._getNumeric(i);return(this.options.separateDialCode&&"+"!==i.charAt(0)&&t&&e?"+".concat(t):"")+i}},{key:"_beforeSetNumber",value:function(i){var t=i;if(this.options.separateDialCode){var e=this._getDialCode(t);e&&(e="+".concat(this.selectedCountryData.dialCode),t=t.substr(" "===t[e.length]||"-"===t[e.length]?e.length+1:e.length))}return this._cap(t)}},{key:"_triggerCountryChange",value:function(){this._trigger("countrychange")}},{key:"handleAutoCountry",value:function(){"auto"===this.options.initialCountry&&(this.defaultCountry=window.intlTelInputGlobals.autoCountry,this.telInput.value||this.setCountry(this.defaultCountry),this.resolveAutoCountryPromise())}},{key:"handleUtils",value:function(){window.intlTelInputUtils&&(this.telInput.value&&this._updateValFromNumber(this.telInput.value),this._updatePlaceholder()),this.resolveUtilsScriptPromise()}},{key:"destroy",value:function(){var i=this.telInput.form;if(this.options.allowDropdown){this._closeDropdown(),this.selectedFlag.removeEventListener("click",this._handleClickSelectedFlag),this.flagsContainer.removeEventListener("keydown",this._handleFlagsContainerKeydown);var t=this._getClosestLabel();t&&t.removeEventListener("click",this._handleLabelClick)}this.hiddenInput&&i&&i.removeEventListener("submit",this._handleHiddenInputSubmit),this.options.autoInsertDialCode&&(i&&i.removeEventListener("submit",this._handleSubmitOrBlurEvent),this.telInput.removeEventListener("blur",this._handleSubmitOrBlurEvent)),this.telInput.removeEventListener("keyup",this._handleKeyupEvent),this.telInput.removeEventListener("cut",this._handleClipboardEvent),this.telInput.removeEventListener("paste",this._handleClipboardEvent),this.telInput.removeAttribute("data-intl-tel-input-id");var e=this.telInput.parentNode;e.parentNode.insertBefore(this.telInput,e),e.parentNode.removeChild(e),delete window.intlTelInputGlobals.instances[this.id]}},{key:"getExtension",value:function(){return window.intlTelInputUtils?intlTelInputUtils.getExtension(this._getFullNumber(),this.selectedCountryData.iso2):""}},{key:"getNumber",value:function(i){if(window.intlTelInputUtils){var t=this.selectedCountryData.iso2;return intlTelInputUtils.formatNumber(this._getFullNumber(),t,i)}return""}},{key:"getNumberType",value:function(){return window.intlTelInputUtils?intlTelInputUtils.getNumberType(this._getFullNumber(),this.selectedCountryData.iso2):-99}},{key:"getSelectedCountryData",value:function(){return this.selectedCountryData}},{key:"getValidationError",value:function(){if(window.intlTelInputUtils){var i=this.selectedCountryData.iso2;return intlTelInputUtils.getValidationError(this._getFullNumber(),i)}return-99}},{key:"isValidNumber",value:function(){var i=this._getFullNumber().trim();return window.intlTelInputUtils?intlTelInputUtils.isValidNumber(i,this.selectedCountryData.iso2):null}},{key:"isPossibleNumber",value:function(){var i=this._getFullNumber().trim();return window.intlTelInputUtils?intlTelInputUtils.isPossibleNumber(i,this.selectedCountryData.iso2):null}},{key:"setCountry",value:function(i){var t=i.toLowerCase();this.selectedCountryData.iso2!==t&&(this._setFlag(t),this._updateDialCode(this.selectedCountryData.dialCode),this._triggerCountryChange())}},{key:"setNumber",value:function(i){var t=this._updateFlagFromNumber(i);this._updateValFromNumber(i),t&&this._triggerCountryChange()}},{key:"setPlaceholderNumberType",value:function(i){this.options.placeholderNumberType=i,this._updatePlaceholder()}}],r&&function(i,t){for(var e=0;e<t.length;e++){var n=t[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(i,a(n.key),n)}}(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),e;var n,r}();r.getCountryData=function(){return t};var f=function(i,t,e){var n=document.createElement("script");n.onload=function(){c("handleUtils"),t&&t()},n.onerror=function(){c("rejectUtilsScriptPromise"),e&&e()},n.className="iti-load-utils",n.async=!0,n.src=i,document.body.appendChild(n)};return r.loadUtils=function(i){if(!window.intlTelInputUtils&&!window.intlTelInputGlobals.startedLoadingUtilsScript){if(window.intlTelInputGlobals.startedLoadingUtilsScript=!0,"undefined"!=typeof Promise)return new Promise((function(t,e){return f(i,t,e)}));f(i)}return null},r.defaults=h,r.version="18.5.3",function(i,t){var e=new d(i,t);return e._init(),i.setAttribute("data-intl-tel-input-id",e.id),window.intlTelInputGlobals.instances[e.id]=e,e}}()},a.exports?a.exports=r():window.intlTelInput=r()),n=a.exports),h=t({__proto__:null,default:i(o)},[o]);export{h as i}
4
+ import{d as i}from"./p-DkTbP5UX.js";function t(i,t){return t.forEach((function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach((function(e){if("default"!==e&&!(e in i)){var n=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(i,e,n.get?n:{enumerable:!0,get:function(){return t[e]}})}}))})),Object.freeze(i)}var e,n,s,a={exports:{}};var r,o=s?n:(s=1,e||(e=1,r=function(i){return function(){for(var t=[["Afghanistan","af","93"],["Albania","al","355"],["Algeria","dz","213"],["American Samoa","as","1",5,["684"]],["Andorra","ad","376"],["Angola","ao","244"],["Anguilla","ai","1",6,["264"]],["Antigua & Barbuda","ag","1",7,["268"]],["Argentina","ar","54"],["Armenia","am","374"],["Aruba","aw","297"],["Ascension Island","ac","247"],["Australia","au","61",0],["Austria","at","43"],["Azerbaijan","az","994"],["Bahamas","bs","1",8,["242"]],["Bahrain","bh","973"],["Bangladesh","bd","880"],["Barbados","bb","1",9,["246"]],["Belarus","by","375"],["Belgium","be","32"],["Belize","bz","501"],["Benin","bj","229"],["Bermuda","bm","1",10,["441"]],["Bhutan","bt","975"],["Bolivia","bo","591"],["Bosnia & Herzegovina","ba","387"],["Botswana","bw","267"],["Brazil","br","55"],["British Indian Ocean Territory","io","246"],["British Virgin Islands","vg","1",11,["284"]],["Brunei","bn","673"],["Bulgaria","bg","359"],["Burkina Faso","bf","226"],["Burundi","bi","257"],["Cambodia","kh","855"],["Cameroon","cm","237"],["Canada","ca","1",1,["204","226","236","249","250","263","289","306","343","354","365","367","368","382","387","403","416","418","428","431","437","438","450","584","468","474","506","514","519","548","579","581","584","587","604","613","639","647","672","683","705","709","742","753","778","780","782","807","819","825","867","873","902","905"]],["Cape Verde","cv","238"],["Caribbean Netherlands","bq","599",1,["3","4","7"]],["Cayman Islands","ky","1",12,["345"]],["Central African Republic","cf","236"],["Chad","td","235"],["Chile","cl","56"],["China","cn","86"],["Christmas Island","cx","61",2,["89164"]],["Cocos (Keeling) Islands","cc","61",1,["89162"]],["Colombia","co","57"],["Comoros","km","269"],["Congo - Brazzaville","cg","242"],["Congo - Kinshasa","cd","243"],["Cook Islands","ck","682"],["Costa Rica","cr","506"],["Côte d’Ivoire","ci","225"],["Croatia","hr","385"],["Cuba","cu","53"],["Curaçao","cw","599",0],["Cyprus","cy","357"],["Czech Republic","cz","420"],["Denmark","dk","45"],["Djibouti","dj","253"],["Dominica","dm","1",13,["767"]],["Dominican Republic","do","1",2,["809","829","849"]],["Ecuador","ec","593"],["Egypt","eg","20"],["El Salvador","sv","503"],["Equatorial Guinea","gq","240"],["Eritrea","er","291"],["Estonia","ee","372"],["Eswatini","sz","268"],["Ethiopia","et","251"],["Falkland Islands","fk","500"],["Faroe Islands","fo","298"],["Fiji","fj","679"],["Finland","fi","358",0],["France","fr","33"],["French Guiana","gf","594"],["French Polynesia","pf","689"],["Gabon","ga","241"],["Gambia","gm","220"],["Georgia","ge","995"],["Germany","de","49"],["Ghana","gh","233"],["Gibraltar","gi","350"],["Greece","gr","30"],["Greenland","gl","299"],["Grenada","gd","1",14,["473"]],["Guadeloupe","gp","590",0],["Guam","gu","1",15,["671"]],["Guatemala","gt","502"],["Guernsey","gg","44",1,["1481","7781","7839","7911"]],["Guinea","gn","224"],["Guinea-Bissau","gw","245"],["Guyana","gy","592"],["Haiti","ht","509"],["Honduras","hn","504"],["Hong Kong","hk","852"],["Hungary","hu","36"],["Iceland","is","354"],["India","in","91"],["Indonesia","id","62"],["Iran","ir","98"],["Iraq","iq","964"],["Ireland","ie","353"],["Isle of Man","im","44",2,["1624","74576","7524","7924","7624"]],["Israel","il","972"],["Italy","it","39",0],["Jamaica","jm","1",4,["876","658"]],["Japan","jp","81"],["Jersey","je","44",3,["1534","7509","7700","7797","7829","7937"]],["Jordan","jo","962"],["Kazakhstan","kz","7",1,["33","7"]],["Kenya","ke","254"],["Kiribati","ki","686"],["Kosovo","xk","383"],["Kuwait","kw","965"],["Kyrgyzstan","kg","996"],["Laos","la","856"],["Latvia","lv","371"],["Lebanon","lb","961"],["Lesotho","ls","266"],["Liberia","lr","231"],["Libya","ly","218"],["Liechtenstein","li","423"],["Lithuania","lt","370"],["Luxembourg","lu","352"],["Macau","mo","853"],["Madagascar","mg","261"],["Malawi","mw","265"],["Malaysia","my","60"],["Maldives","mv","960"],["Mali","ml","223"],["Malta","mt","356"],["Marshall Islands","mh","692"],["Martinique","mq","596"],["Mauritania","mr","222"],["Mauritius","mu","230"],["Mayotte","yt","262",1,["269","639"]],["Mexico","mx","52"],["Micronesia","fm","691"],["Moldova","md","373"],["Monaco","mc","377"],["Mongolia","mn","976"],["Montenegro","me","382"],["Montserrat","ms","1",16,["664"]],["Morocco","ma","212",0],["Mozambique","mz","258"],["Myanmar (Burma)","mm","95"],["Namibia","na","264"],["Nauru","nr","674"],["Nepal","np","977"],["Netherlands","nl","31"],["New Caledonia","nc","687"],["New Zealand","nz","64"],["Nicaragua","ni","505"],["Niger","ne","227"],["Nigeria","ng","234"],["Niue","nu","683"],["Norfolk Island","nf","672"],["North Korea","kp","850"],["North Macedonia","mk","389"],["Northern Mariana Islands","mp","1",17,["670"]],["Norway","no","47",0],["Oman","om","968"],["Pakistan","pk","92"],["Palau","pw","680"],["Palestine","ps","970"],["Panama","pa","507"],["Papua New Guinea","pg","675"],["Paraguay","py","595"],["Peru","pe","51"],["Philippines","ph","63"],["Poland","pl","48"],["Portugal","pt","351"],["Puerto Rico","pr","1",3,["787","939"]],["Qatar","qa","974"],["Réunion","re","262",0],["Romania","ro","40"],["Russia","ru","7",0],["Rwanda","rw","250"],["Samoa","ws","685"],["San Marino","sm","378"],["São Tomé & Príncipe","st","239"],["Saudi Arabia","sa","966"],["Senegal","sn","221"],["Serbia","rs","381"],["Seychelles","sc","248"],["Sierra Leone","sl","232"],["Singapore","sg","65"],["Sint Maarten","sx","1",21,["721"]],["Slovakia","sk","421"],["Slovenia","si","386"],["Solomon Islands","sb","677"],["Somalia","so","252"],["South Africa","za","27"],["South Korea","kr","82"],["South Sudan","ss","211"],["Spain","es","34"],["Sri Lanka","lk","94"],["St Barthélemy","bl","590",1],["St Helena","sh","290"],["St Kitts & Nevis","kn","1",18,["869"]],["St Lucia","lc","1",19,["758"]],["St Martin","mf","590",2],["St Pierre & Miquelon","pm","508"],["St Vincent & Grenadines","vc","1",20,["784"]],["Sudan","sd","249"],["Suriname","sr","597"],["Svalbard & Jan Mayen","sj","47",1,["79"]],["Sweden","se","46"],["Switzerland","ch","41"],["Syria","sy","963"],["Taiwan","tw","886"],["Tajikistan","tj","992"],["Tanzania","tz","255"],["Thailand","th","66"],["Timor-Leste","tl","670"],["Togo","tg","228"],["Tokelau","tk","690"],["Tonga","to","676"],["Trinidad & Tobago","tt","1",22,["868"]],["Tunisia","tn","216"],["Turkey","tr","90"],["Turkmenistan","tm","993"],["Turks & Caicos Islands","tc","1",23,["649"]],["Tuvalu","tv","688"],["Uganda","ug","256"],["Ukraine","ua","380"],["United Arab Emirates","ae","971"],["United Kingdom","gb","44",0],["United States","us","1",0],["Uruguay","uy","598"],["US Virgin Islands","vi","1",24,["340"]],["Uzbekistan","uz","998"],["Vanuatu","vu","678"],["Vatican City","va","39",1,["06698"]],["Venezuela","ve","58"],["Vietnam","vn","84"],["Wallis & Futuna","wf","681"],["Western Sahara","eh","212",1,["5288","5289"]],["Yemen","ye","967"],["Zambia","zm","260"],["Zimbabwe","zw","263"],["Åland Islands","ax","358",1,["18"]]],e=0;e<t.length;e++){var n=t[e];t[e]={name:n[0],iso2:n[1],dialCode:n[2],priority:n[3]||0,areaCodes:n[4]||null}}function s(i,t,e){return(t=a(t))in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}function a(t){var e=function(t){if("object"!=typeof t||null===t)return t;var e=t[Symbol.toPrimitive];if(e!==i){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}var r={getInstance:function(i){var t=i.getAttribute("data-intl-tel-input-id");return window.intlTelInputGlobals.instances[t]},instances:{},documentReady:function(){return"complete"===document.readyState}};"object"==typeof window&&(window.intlTelInputGlobals=r);var o=0,h={allowDropdown:!0,autoInsertDialCode:!1,autoPlaceholder:"polite",countrySearch:!1,customContainer:"",customPlaceholder:null,dropdownContainer:null,excludeCountries:[],fixDropdownWidth:!1,formatOnDisplay:!0,geoIpLookup:null,hiddenInput:"",initialCountry:"",localizedCountries:null,nationalMode:!0,onlyCountries:[],placeholderNumberType:"MOBILE",preferredCountries:["us","gb"],separateDialCode:!1,showFlags:!0,useFullscreenPopup:"undefined"!=typeof navigator&&"undefined"!=typeof window&&(/Android.+Mobile|webOS|iPhone|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||window.innerWidth<=500),utilsScript:""},u=["800","822","833","844","855","866","877","880","881","882","883","884","885","886","887","888","889"],l=function(i,t){for(var e=Object.keys(i),n=0;n<e.length;n++)t(e[n],i[e[n]])},c=function(i){l(window.intlTelInputGlobals.instances,(function(t){window.intlTelInputGlobals.instances[t][i]()}))},d=function(){function e(i,t){var n=this;!function(i,t){if(!(i instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.id=o++,this.telInput=i,this.activeItem=null,this.highlightedItem=null;var s=t||{};this.options={},l(h,(function(i,t){n.options[i]=s.hasOwnProperty(i)?s[i]:t})),this.hadInitialPlaceholder=Boolean(i.getAttribute("placeholder"))}return n=e,r=[{key:"_init",value:function(){var i=this;if(this.options.useFullscreenPopup&&(this.options.fixDropdownWidth=!1),this.options.countrySearch&&!this.options.useFullscreenPopup&&(this.options.fixDropdownWidth=!0),this.options.nationalMode&&(this.options.autoInsertDialCode=!1),this.options.separateDialCode&&(this.options.autoInsertDialCode=!1),!this.options.showFlags&&this.options.allowDropdown&&!this.options.separateDialCode&&(this.options.showFlags=!0),this.options.useFullscreenPopup&&!this.options.dropdownContainer&&(this.options.dropdownContainer=document.body),this.isRTL=!!this.telInput.closest("[dir=rtl]"),"undefined"!=typeof Promise){var t=new Promise((function(t,e){i.resolveAutoCountryPromise=t,i.rejectAutoCountryPromise=e})),e=new Promise((function(t,e){i.resolveUtilsScriptPromise=t,i.rejectUtilsScriptPromise=e}));this.promise=Promise.all([t,e])}else this.resolveAutoCountryPromise=this.rejectAutoCountryPromise=function(){},this.resolveUtilsScriptPromise=this.rejectUtilsScriptPromise=function(){};this.selectedCountryData={},this._processCountryData(),this._generateMarkup(),this._setInitialState(),this._initListeners(),this._initRequests()}},{key:"_processCountryData",value:function(){this._processAllCountries(),this._processCountryCodes(),this._processPreferredCountries(),this.options.localizedCountries&&this._translateCountriesByLocale(),(this.options.onlyCountries.length||this.options.localizedCountries)&&this.countries.sort(this._countryNameSort)}},{key:"_addCountryCode",value:function(t,e,n){e.length>this.countryCodeMaxLen&&(this.countryCodeMaxLen=e.length),this.countryCodes.hasOwnProperty(e)||(this.countryCodes[e]=[]);for(var s=0;s<this.countryCodes[e].length;s++)if(this.countryCodes[e][s]===t)return;this.countryCodes[e][n!==i?n:this.countryCodes[e].length]=t}},{key:"_processAllCountries",value:function(){if(this.options.onlyCountries.length){var i=this.options.onlyCountries.map((function(i){return i.toLowerCase()}));this.countries=t.filter((function(t){return i.indexOf(t.iso2)>-1}))}else if(this.options.excludeCountries.length){var e=this.options.excludeCountries.map((function(i){return i.toLowerCase()}));this.countries=t.filter((function(i){return-1===e.indexOf(i.iso2)}))}else this.countries=t}},{key:"_translateCountriesByLocale",value:function(){for(var i=0;i<this.countries.length;i++){var t=this.countries[i].iso2.toLowerCase();this.options.localizedCountries.hasOwnProperty(t)&&(this.countries[i].name=this.options.localizedCountries[t])}}},{key:"_countryNameSort",value:function(i,t){return i.name<t.name?-1:i.name>t.name?1:0}},{key:"_processCountryCodes",value:function(){this.countryCodeMaxLen=0,this.dialCodes={},this.countryCodes={};for(var i=0;i<this.countries.length;i++){var t=this.countries[i];this.dialCodes[t.dialCode]||(this.dialCodes[t.dialCode]=!0),this._addCountryCode(t.iso2,t.dialCode,t.priority)}for(var e=0;e<this.countries.length;e++){var n=this.countries[e];if(n.areaCodes)for(var s=this.countryCodes[n.dialCode][0],a=0;a<n.areaCodes.length;a++){for(var r=n.areaCodes[a],o=1;o<r.length;o++){var h=n.dialCode+r.substr(0,o);this._addCountryCode(s,h),this._addCountryCode(n.iso2,h)}this._addCountryCode(n.iso2,n.dialCode+r)}}}},{key:"_processPreferredCountries",value:function(){this.preferredCountries=[];for(var i=0;i<this.options.preferredCountries.length;i++){var t=this.options.preferredCountries[i].toLowerCase(),e=this._getCountryData(t,!1,!0);e&&this.preferredCountries.push(e)}}},{key:"_createEl",value:function(i,t,e){var n=document.createElement(i);return t&&l(t,(function(i,t){return n.setAttribute(i,t)})),e&&e.appendChild(n),n}},{key:"_generateMarkup",value:function(){this.telInput.classList.add("iti__tel-input"),this.telInput.hasAttribute("autocomplete")||this.telInput.form&&this.telInput.form.hasAttribute("autocomplete")||this.telInput.setAttribute("autocomplete","off");var i=this.options,t=i.allowDropdown,e=i.separateDialCode,n=i.showFlags,a=i.customContainer,r=i.hiddenInput,o=i.dropdownContainer,h=i.fixDropdownWidth,u=i.useFullscreenPopup,l=i.countrySearch,c="iti";t&&(c+=" iti--allow-dropdown"),e&&(c+=" iti--separate-dial-code"),n&&(c+=" iti--show-flags"),a&&(c+=" ".concat(a));var d=this._createEl("div",{class:c});this.telInput.parentNode.insertBefore(d,this.telInput);var f=t||n||e;if(f&&(this.flagsContainer=this._createEl("div",{class:"iti__flag-container"},d)),d.appendChild(this.telInput),f&&(this.selectedFlag=this._createEl("div",function(i){for(var t=1;t<arguments.length;t++){var e=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(e);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(e).filter((function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable}))),n.forEach((function(t){s(i,t,e[t])}))}return i}({class:"iti__selected-flag"},t&&{role:"combobox","aria-haspopup":"listbox","aria-controls":"iti-".concat(this.id,"__country-listbox"),"aria-expanded":"false","aria-label":"Telephone country code"}),this.flagsContainer)),n&&(this.selectedFlagInner=this._createEl("div",{class:"iti__flag"},this.selectedFlag)),this.selectedFlag&&this.telInput.disabled&&this.selectedFlag.setAttribute("aria-disabled","true"),e&&(this.selectedDialCode=this._createEl("div",{class:"iti__selected-dial-code"},this.selectedFlag)),t)if(this.telInput.disabled||this.selectedFlag.setAttribute("tabindex","0"),this.dropdownArrow=this._createEl("div",{class:"iti__arrow"},this.selectedFlag),this.dropdownContent=this._createEl("div",{class:"iti__dropdown-content iti__hide ".concat(h?"":"iti--flexible-dropdown-width")}),l&&(this.searchInput=this._createEl("input",{type:"text",class:"iti__search-input",placeholder:"Search"},this.dropdownContent)),this.countryList=this._createEl("ul",{class:"iti__country-list",id:"iti-".concat(this.id,"__country-listbox"),role:"listbox","aria-label":"List of countries"},this.dropdownContent),this.preferredCountries.length&&!l&&(this._appendListItems(this.preferredCountries,"iti__preferred",!0),this._createEl("li",{class:"iti__divider","aria-hidden":"true"},this.countryList)),this._appendListItems(this.countries,"iti__standard"),o){var v="iti iti--container";u&&(v+=" iti--fullscreen-popup"),l&&(v+=" iti--country-search"),this.dropdown=this._createEl("div",{class:v}),this.dropdown.appendChild(this.dropdownContent)}else this.flagsContainer.appendChild(this.dropdownContent);if(r){var p=r,y=this.telInput.getAttribute("name");if(y){var m=y.lastIndexOf("[");-1!==m&&(p="".concat(y.substr(0,m),"[").concat(p,"]"))}this.hiddenInput=this._createEl("input",{type:"hidden",name:p}),d.appendChild(this.hiddenInput)}}},{key:"_appendListItems",value:function(i,t,e){for(var n=0;n<i.length;n++){var s=i[n],a=e?"-preferred":"",r=this._createEl("li",{id:"iti-".concat(this.id,"__item-").concat(s.iso2).concat(a),class:"iti__country ".concat(t),tabindex:"-1",role:"option","data-dial-code":s.dialCode,"data-country-code":s.iso2,"aria-selected":"false"},this.countryList);s.node=r;var o="";this.options.showFlags&&(o+="<div class='iti__flag-box'><div class='iti__flag iti__".concat(s.iso2,"'></div></div>")),o+="<span class='iti__country-name'>".concat(s.name,"</span>"),o+="<span class='iti__dial-code'>+".concat(s.dialCode,"</span>"),r.insertAdjacentHTML("beforeend",o)}}},{key:"_setInitialState",value:function(){var i=this.telInput.getAttribute("value"),t=this.telInput.value,e=!i||"+"!==i.charAt(0)||t&&"+"===t.charAt(0)?t:i,n=this._getDialCode(e),s=this._isRegionlessNanp(e),a=this.options,r=a.initialCountry,o=a.autoInsertDialCode;n&&!s?this._updateFlagFromNumber(e):"auto"!==r&&(r&&this._getCountryData(r,!1,!0)?this._setFlag(r.toLowerCase()):n&&s?this._setFlag("us"):(this.defaultCountry=this.preferredCountries.length?this.preferredCountries[0].iso2:this.countries[0].iso2,e||this._setFlag(this.defaultCountry)),!e&&o&&(this.telInput.value="+".concat(this.selectedCountryData.dialCode))),e&&this._updateValFromNumber(e)}},{key:"_initListeners",value:function(){this._initKeyListeners(),this.options.autoInsertDialCode&&this._initBlurListeners(),this.options.allowDropdown&&this._initDropdownListeners(),this.hiddenInput&&this._initHiddenInputListener()}},{key:"_initHiddenInputListener",value:function(){var i=this;this._handleHiddenInputSubmit=function(){i.hiddenInput.value=i.getNumber()},this.telInput.form&&this.telInput.form.addEventListener("submit",this._handleHiddenInputSubmit)}},{key:"_getClosestLabel",value:function(){for(var i=this.telInput;i&&"LABEL"!==i.tagName;)i=i.parentNode;return i}},{key:"_initDropdownListeners",value:function(){var i=this;this._handleLabelClick=function(t){i.dropdownContent.classList.contains("iti__hide")?i.telInput.focus():t.preventDefault()};var t=this._getClosestLabel();t&&t.addEventListener("click",this._handleLabelClick),this._handleClickSelectedFlag=function(){!i.dropdownContent.classList.contains("iti__hide")||i.telInput.disabled||i.telInput.readOnly||i._showDropdown()},this.selectedFlag.addEventListener("click",this._handleClickSelectedFlag),this._handleFlagsContainerKeydown=function(t){i.dropdownContent.classList.contains("iti__hide")&&["ArrowUp","ArrowDown"," ","Enter"].includes(t.key)&&(t.preventDefault(),t.stopPropagation(),i._showDropdown()),"Tab"===t.key&&i._closeDropdown()},this.flagsContainer.addEventListener("keydown",this._handleFlagsContainerKeydown)}},{key:"_initRequests",value:function(){var i=this;this.options.utilsScript&&!window.intlTelInputUtils?window.intlTelInputGlobals.documentReady()?window.intlTelInputGlobals.loadUtils(this.options.utilsScript):window.addEventListener("load",(function(){window.intlTelInputGlobals.loadUtils(i.options.utilsScript)})):this.resolveUtilsScriptPromise(),"auto"===this.options.initialCountry?this._loadAutoCountry():this.resolveAutoCountryPromise()}},{key:"_loadAutoCountry",value:function(){window.intlTelInputGlobals.autoCountry?this.handleAutoCountry():window.intlTelInputGlobals.startedLoadingAutoCountry||(window.intlTelInputGlobals.startedLoadingAutoCountry=!0,"function"==typeof this.options.geoIpLookup&&this.options.geoIpLookup((function(i){window.intlTelInputGlobals.autoCountry=i.toLowerCase(),setTimeout((function(){return c("handleAutoCountry")}))}),(function(){return c("rejectAutoCountryPromise")})))}},{key:"_initKeyListeners",value:function(){var i=this;this._handleKeyupEvent=function(){i._updateFlagFromNumber(i.telInput.value)&&i._triggerCountryChange()},this.telInput.addEventListener("keyup",this._handleKeyupEvent),this._handleClipboardEvent=function(){setTimeout(i._handleKeyupEvent)},this.telInput.addEventListener("cut",this._handleClipboardEvent),this.telInput.addEventListener("paste",this._handleClipboardEvent)}},{key:"_cap",value:function(i){var t=this.telInput.getAttribute("maxlength");return t&&i.length>t?i.substr(0,t):i}},{key:"_initBlurListeners",value:function(){var i=this;this._handleSubmitOrBlurEvent=function(){i._removeEmptyDialCode()},this.telInput.form&&this.telInput.form.addEventListener("submit",this._handleSubmitOrBlurEvent),this.telInput.addEventListener("blur",this._handleSubmitOrBlurEvent)}},{key:"_removeEmptyDialCode",value:function(){if("+"===this.telInput.value.charAt(0)){var i=this._getNumeric(this.telInput.value);i&&this.selectedCountryData.dialCode!==i||(this.telInput.value="")}}},{key:"_getNumeric",value:function(i){return i.replace(/\D/g,"")}},{key:"_trigger",value:function(i){var t=document.createEvent("Event");t.initEvent(i,!0,!0),this.telInput.dispatchEvent(t)}},{key:"_showDropdown",value:function(){this.options.fixDropdownWidth&&(this.dropdownContent.style.width="".concat(this.telInput.offsetWidth,"px")),this.dropdownContent.classList.remove("iti__hide"),this.selectedFlag.setAttribute("aria-expanded","true"),this._setDropdownPosition(),this.options.countrySearch?(this._highlightListItem(this.countryList.firstElementChild,!1),this.searchInput.focus()):this.activeItem&&(this._highlightListItem(this.activeItem,!1),this._scrollTo(this.activeItem,!0)),this._bindDropdownListeners(),this.dropdownArrow.classList.add("iti__arrow--up"),this._trigger("open:countrydropdown")}},{key:"_toggleClass",value:function(i,t,e){e&&!i.classList.contains(t)?i.classList.add(t):!e&&i.classList.contains(t)&&i.classList.remove(t)}},{key:"_setDropdownPosition",value:function(){var i=this;if(this.options.dropdownContainer&&this.options.dropdownContainer.appendChild(this.dropdown),!this.options.useFullscreenPopup){var t=this.telInput.getBoundingClientRect(),e=window.pageYOffset||document.documentElement.scrollTop,n=t.top+e,s=this.dropdownContent.offsetHeight,a=n+this.telInput.offsetHeight+s<e+window.innerHeight,r=!this.options.countrySearch&&!a&&n-s>e;this._toggleClass(this.dropdownContent,"iti__dropdown-content--dropup",r),this.options.dropdownContainer&&(this.dropdown.style.top="".concat(n+(r?0:this.telInput.offsetHeight),"px"),this.dropdown.style.left="".concat(t.left+document.body.scrollLeft,"px"),this._handleWindowScroll=function(){return i._closeDropdown()},window.addEventListener("scroll",this._handleWindowScroll))}}},{key:"_getClosestListItem",value:function(i){for(var t=i;t&&t!==this.countryList&&!t.classList.contains("iti__country");)t=t.parentNode;return t===this.countryList?null:t}},{key:"_bindDropdownListeners",value:function(){var i=this;this._handleMouseoverCountryList=function(t){var e=i._getClosestListItem(t.target);e&&i._highlightListItem(e,!1)},this.countryList.addEventListener("mouseover",this._handleMouseoverCountryList),this._handleClickCountryList=function(t){var e=i._getClosestListItem(t.target);e&&i._selectListItem(e)},this.countryList.addEventListener("click",this._handleClickCountryList);var t=!0;this._handleClickOffToClose=function(){t||i._closeDropdown(),t=!1},document.documentElement.addEventListener("click",this._handleClickOffToClose);var e="",n=null;if(this._handleKeydownOnDropdown=function(t){["ArrowUp","ArrowDown","Enter","Escape"].includes(t.key)&&(t.preventDefault(),t.stopPropagation(),"ArrowUp"===t.key||"ArrowDown"===t.key?i._handleUpDownKey(t.key):"Enter"===t.key?i._handleEnterKey():"Escape"===t.key&&i._closeDropdown()),!i.options.countrySearch&&/^[a-zA-ZÀ-ÿа-яА-Я ]$/.test(t.key)&&(t.stopPropagation(),n&&clearTimeout(n),e+=t.key.toLowerCase(),i._searchForCountry(e),n=setTimeout((function(){e=""}),1e3))},document.addEventListener("keydown",this._handleKeydownOnDropdown),this.options.countrySearch){var s=null;this._handleSearchChange=function(){s&&clearTimeout(s),s=setTimeout((function(){var t;(t=i.searchInput.value.trim())?i._filterCountries(t.toLowerCase()):i._filterCountries(null,!0),s=null}),100)},this.searchInput.addEventListener("input",this._handleSearchChange),this.searchInput.addEventListener("click",(function(i){return i.stopPropagation()}))}}},{key:"_filterCountries",value:function(t){var e=arguments.length>1&&arguments[1]!==i&&arguments[1],n=!0;this.countryList.innerHTML="";for(var s=0;s<this.countries.length;s++){var a=this.countries[s],r=a.name.toLowerCase(),o="+".concat(a.dialCode);(e||r.includes(t)||o.includes(t))&&(this.countryList.appendChild(a.node),n&&(this._highlightListItem(a.node,!1),n=!1))}}},{key:"_handleUpDownKey",value:function(i){var t="ArrowUp"===i?this.highlightedItem.previousElementSibling:this.highlightedItem.nextElementSibling;t?t.classList.contains("iti__divider")&&(t="ArrowUp"===i?t.previousElementSibling:t.nextElementSibling):this.countryList.childElementCount>1&&(t="ArrowUp"===i?this.countryList.lastElementChild:this.countryList.firstElementChild),t&&(this._highlightListItem(t,!this.options.countrySearch),this.options.countrySearch&&this._scrollTo(t,!1))}},{key:"_handleEnterKey",value:function(){this.highlightedItem&&this._selectListItem(this.highlightedItem)}},{key:"_searchForCountry",value:function(i){for(var t=0;t<this.countries.length;t++)if(this._startsWith(this.countries[t].name,i)){var e=this.countries[t].node;this._highlightListItem(e,!1),this._scrollTo(e,!0);break}}},{key:"_startsWith",value:function(i,t){return i.substr(0,t.length).toLowerCase()===t}},{key:"_updateValFromNumber",value:function(i){var t=i;if(this.options.formatOnDisplay&&window.intlTelInputUtils&&this.selectedCountryData){var e=this.options.nationalMode||"+"!==t.charAt(0)&&!this.options.separateDialCode,n=intlTelInputUtils.numberFormat;t=intlTelInputUtils.formatNumber(t,this.selectedCountryData.iso2,e?n.NATIONAL:n.INTERNATIONAL)}t=this._beforeSetNumber(t),this.telInput.value=t}},{key:"_updateFlagFromNumber",value:function(i){var t=i.indexOf("+"),e=t?i.substring(t):i,n=this.selectedCountryData.dialCode;e&&"1"===n&&"+"!==e.charAt(0)&&("1"!==e.charAt(0)&&(e="1".concat(e)),e="+".concat(e)),this.options.separateDialCode&&n&&"+"!==e.charAt(0)&&(e="+".concat(n).concat(e));var s=this._getDialCode(e,!0),a=this._getNumeric(e),r=null;if(s){var o=this.countryCodes[this._getNumeric(s)],h=-1!==o.indexOf(this.selectedCountryData.iso2)&&a.length<=s.length-1;if(!("1"===n&&this._isRegionlessNanp(a)||h))for(var u=0;u<o.length;u++)if(o[u]){r=o[u];break}}else"+"===e.charAt(0)&&a.length?r="":e&&"+"!==e||(r=this.defaultCountry);return null!==r&&this._setFlag(r)}},{key:"_isRegionlessNanp",value:function(i){var t=this._getNumeric(i);if("1"===t.charAt(0)){var e=t.substr(1,3);return-1!==u.indexOf(e)}return!1}},{key:"_highlightListItem",value:function(i,t){var e=this.highlightedItem;e&&e.classList.remove("iti__highlight"),this.highlightedItem=i,this.highlightedItem.classList.add("iti__highlight"),this.selectedFlag.setAttribute("aria-activedescendant",i.getAttribute("id")),t&&this.highlightedItem.focus()}},{key:"_getCountryData",value:function(i,e,n){for(var s=e?t:this.countries,a=0;a<s.length;a++)if(s[a].iso2===i)return s[a];if(n)return null;throw new Error("No country data for '".concat(i,"'"))}},{key:"_setFlag",value:function(i){var t=this.options,e=t.allowDropdown,n=t.separateDialCode,s=t.showFlags,a=this.selectedCountryData.iso2?this.selectedCountryData:{};if(this.selectedCountryData=i?this._getCountryData(i,!1,!1):{},this.selectedCountryData.iso2&&(this.defaultCountry=this.selectedCountryData.iso2),s&&this.selectedFlagInner.setAttribute("class","iti__flag iti__".concat(i)),this._setSelectedCountryFlagTitleAttribute(i,n),n){var r=this.selectedCountryData.dialCode?"+".concat(this.selectedCountryData.dialCode):"";this.selectedDialCode.innerHTML=r;var o=this.selectedFlag.offsetWidth||this._getHiddenSelectedFlagWidth();this.isRTL?this.telInput.style.paddingRight="".concat(o+6,"px"):this.telInput.style.paddingLeft="".concat(o+6,"px")}if(this._updatePlaceholder(),e){var h=this.activeItem;if(h&&(h.classList.remove("iti__active"),h.setAttribute("aria-selected","false")),i){var u=this.countryList.querySelector("#iti-".concat(this.id,"__item-").concat(i,"-preferred"))||this.countryList.querySelector("#iti-".concat(this.id,"__item-").concat(i));u.setAttribute("aria-selected","true"),u.classList.add("iti__active"),this.activeItem=u}}return a.iso2!==i}},{key:"_setSelectedCountryFlagTitleAttribute",value:function(i,t){var e;this.selectedFlag&&(e=i&&!t?"".concat(this.selectedCountryData.name,": +").concat(this.selectedCountryData.dialCode):i?this.selectedCountryData.name:"Unknown",this.selectedFlag.setAttribute("title",e))}},{key:"_getHiddenSelectedFlagWidth",value:function(){var i=this.telInput.parentNode.cloneNode();i.style.visibility="hidden",document.body.appendChild(i);var t=this.flagsContainer.cloneNode();i.appendChild(t);var e=this.selectedFlag.cloneNode(!0);t.appendChild(e);var n=e.offsetWidth;return i.parentNode.removeChild(i),n}},{key:"_updatePlaceholder",value:function(){if(window.intlTelInputUtils&&("aggressive"===this.options.autoPlaceholder||!this.hadInitialPlaceholder&&"polite"===this.options.autoPlaceholder)){var i=intlTelInputUtils.numberType[this.options.placeholderNumberType],t=this.selectedCountryData.iso2?intlTelInputUtils.getExampleNumber(this.selectedCountryData.iso2,this.options.nationalMode,i):"";t=this._beforeSetNumber(t),"function"==typeof this.options.customPlaceholder&&(t=this.options.customPlaceholder(t,this.selectedCountryData)),this.telInput.setAttribute("placeholder",t)}}},{key:"_selectListItem",value:function(i){var t=this._setFlag(i.getAttribute("data-country-code"));this._closeDropdown(),this._updateDialCode(i.getAttribute("data-dial-code")),this.telInput.focus();var e=this.telInput.value.length;this.telInput.setSelectionRange(e,e),t&&this._triggerCountryChange()}},{key:"_closeDropdown",value:function(){this.dropdownContent.classList.add("iti__hide"),this.selectedFlag.setAttribute("aria-expanded","false"),this.selectedFlag.removeAttribute("aria-activedescendant"),this.dropdownArrow.classList.remove("iti__arrow--up"),document.removeEventListener("keydown",this._handleKeydownOnDropdown),this.options.countrySearch&&this.searchInput.removeEventListener("input",this._handleSearchChange),document.documentElement.removeEventListener("click",this._handleClickOffToClose),this.countryList.removeEventListener("mouseover",this._handleMouseoverCountryList),this.countryList.removeEventListener("click",this._handleClickCountryList),this.options.dropdownContainer&&(this.options.useFullscreenPopup||window.removeEventListener("scroll",this._handleWindowScroll),this.dropdown.parentNode&&this.dropdown.parentNode.removeChild(this.dropdown)),this._trigger("close:countrydropdown")}},{key:"_scrollTo",value:function(i,t){var e=this.dropdownContent,n=window.pageYOffset||document.documentElement.scrollTop,s=e.offsetHeight,a=e.getBoundingClientRect().top+n,r=a+s,o=i.offsetHeight,h=i.getBoundingClientRect().top+n,u=h+o,l=h-a+e.scrollTop,c=s/2-o/2;h<a?(t&&(l-=c),e.scrollTop=l):u>r&&(t&&(l+=c),e.scrollTop=l-(s-o))}},{key:"_updateDialCode",value:function(i){var t,e=this.telInput.value,n="+".concat(i);if("+"===e.charAt(0)){var s=this._getDialCode(e);t=s?e.replace(s,n):n,this.telInput.value=t}else this.options.autoInsertDialCode&&(this.telInput.value=t=e?n+e:n)}},{key:"_getDialCode",value:function(i,t){var e="";if("+"===i.charAt(0))for(var n="",s=0;s<i.length;s++){var a=i.charAt(s);if(!isNaN(parseInt(a,10))){if(n+=a,t)this.countryCodes[n]&&(e=i.substr(0,s+1));else if(this.dialCodes[n]){e=i.substr(0,s+1);break}if(n.length===this.countryCodeMaxLen)break}}return e}},{key:"_getFullNumber",value:function(){var i=this.telInput.value.trim(),t=this.selectedCountryData.dialCode,e=this._getNumeric(i);return(this.options.separateDialCode&&"+"!==i.charAt(0)&&t&&e?"+".concat(t):"")+i}},{key:"_beforeSetNumber",value:function(i){var t=i;if(this.options.separateDialCode){var e=this._getDialCode(t);e&&(e="+".concat(this.selectedCountryData.dialCode),t=t.substr(" "===t[e.length]||"-"===t[e.length]?e.length+1:e.length))}return this._cap(t)}},{key:"_triggerCountryChange",value:function(){this._trigger("countrychange")}},{key:"handleAutoCountry",value:function(){"auto"===this.options.initialCountry&&(this.defaultCountry=window.intlTelInputGlobals.autoCountry,this.telInput.value||this.setCountry(this.defaultCountry),this.resolveAutoCountryPromise())}},{key:"handleUtils",value:function(){window.intlTelInputUtils&&(this.telInput.value&&this._updateValFromNumber(this.telInput.value),this._updatePlaceholder()),this.resolveUtilsScriptPromise()}},{key:"destroy",value:function(){var i=this.telInput.form;if(this.options.allowDropdown){this._closeDropdown(),this.selectedFlag.removeEventListener("click",this._handleClickSelectedFlag),this.flagsContainer.removeEventListener("keydown",this._handleFlagsContainerKeydown);var t=this._getClosestLabel();t&&t.removeEventListener("click",this._handleLabelClick)}this.hiddenInput&&i&&i.removeEventListener("submit",this._handleHiddenInputSubmit),this.options.autoInsertDialCode&&(i&&i.removeEventListener("submit",this._handleSubmitOrBlurEvent),this.telInput.removeEventListener("blur",this._handleSubmitOrBlurEvent)),this.telInput.removeEventListener("keyup",this._handleKeyupEvent),this.telInput.removeEventListener("cut",this._handleClipboardEvent),this.telInput.removeEventListener("paste",this._handleClipboardEvent),this.telInput.removeAttribute("data-intl-tel-input-id");var e=this.telInput.parentNode;e.parentNode.insertBefore(this.telInput,e),e.parentNode.removeChild(e),delete window.intlTelInputGlobals.instances[this.id]}},{key:"getExtension",value:function(){return window.intlTelInputUtils?intlTelInputUtils.getExtension(this._getFullNumber(),this.selectedCountryData.iso2):""}},{key:"getNumber",value:function(i){if(window.intlTelInputUtils){var t=this.selectedCountryData.iso2;return intlTelInputUtils.formatNumber(this._getFullNumber(),t,i)}return""}},{key:"getNumberType",value:function(){return window.intlTelInputUtils?intlTelInputUtils.getNumberType(this._getFullNumber(),this.selectedCountryData.iso2):-99}},{key:"getSelectedCountryData",value:function(){return this.selectedCountryData}},{key:"getValidationError",value:function(){if(window.intlTelInputUtils){var i=this.selectedCountryData.iso2;return intlTelInputUtils.getValidationError(this._getFullNumber(),i)}return-99}},{key:"isValidNumber",value:function(){var i=this._getFullNumber().trim();return window.intlTelInputUtils?intlTelInputUtils.isValidNumber(i,this.selectedCountryData.iso2):null}},{key:"isPossibleNumber",value:function(){var i=this._getFullNumber().trim();return window.intlTelInputUtils?intlTelInputUtils.isPossibleNumber(i,this.selectedCountryData.iso2):null}},{key:"setCountry",value:function(i){var t=i.toLowerCase();this.selectedCountryData.iso2!==t&&(this._setFlag(t),this._updateDialCode(this.selectedCountryData.dialCode),this._triggerCountryChange())}},{key:"setNumber",value:function(i){var t=this._updateFlagFromNumber(i);this._updateValFromNumber(i),t&&this._triggerCountryChange()}},{key:"setPlaceholderNumberType",value:function(i){this.options.placeholderNumberType=i,this._updatePlaceholder()}}],r&&function(i,t){for(var e=0;e<t.length;e++){var n=t[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(i,a(n.key),n)}}(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),e;var n,r}();r.getCountryData=function(){return t};var f=function(i,t,e){var n=document.createElement("script");n.onload=function(){c("handleUtils"),t&&t()},n.onerror=function(){c("rejectUtilsScriptPromise"),e&&e()},n.className="iti-load-utils",n.async=!0,n.src=i,document.body.appendChild(n)};return r.loadUtils=function(i){if(!window.intlTelInputUtils&&!window.intlTelInputGlobals.startedLoadingUtilsScript){if(window.intlTelInputGlobals.startedLoadingUtilsScript=!0,"undefined"!=typeof Promise)return new Promise((function(t,e){return f(i,t,e)}));f(i)}return null},r.defaults=h,r.version="18.5.3",function(i,t){var e=new d(i,t);return e._init(),i.setAttribute("data-intl-tel-input-id",e.id),window.intlTelInputGlobals.instances[e.id]=e,e}}()},a.exports?a.exports=r():window.intlTelInput=r()),n=a.exports),h=t({__proto__:null,default:i(o)},[o]);export{h as i}
@@ -0,0 +1,4 @@
1
+ /*!
2
+ * Crafted with ❤ by Salla
3
+ */
4
+ var c='\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>shipping-fast</title>\n<path d="M10.667 14.667c0-0.737-0.597-1.333-1.333-1.333h-8c-0.736 0-1.333 0.596-1.333 1.333s0.597 1.333 1.333 1.333h8c0.736 0 1.333-0.596 1.333-1.333zM9.333 18.667c-2.941 0-5.333 2.392-5.333 5.333s2.392 5.333 5.333 5.333 5.333-2.392 5.333-5.333-2.392-5.333-5.333-5.333zM9.333 26.667c-1.471 0-2.667-1.196-2.667-2.667s1.196-2.667 2.667-2.667 2.667 1.196 2.667 2.667-1.196 2.667-2.667 2.667zM1.333 10.667h5.333c0.736 0 1.333-0.596 1.333-1.333s-0.597-1.333-1.333-1.333h-5.333c-0.736 0-1.333 0.596-1.333 1.333s0.597 1.333 1.333 1.333zM31.123 13.103l-3.147-3.935c-1.273-1.589-3.171-2.501-5.205-2.501h-1.437c0-2.205-1.795-4-4-4h-13.333c-0.736 0-1.333 0.596-1.333 1.333s0.597 1.333 1.333 1.333h13.333c0.735 0 1.333 0.597 1.333 1.333v1.333c0 0.248 0.087 0.468 0.204 0.667-0.117 0.199-0.204 0.419-0.204 0.667v5.333c0 0.737 0.597 1.333 1.333 1.333h9.333v6.667h-1.333c-0.063 0-0.117 0.028-0.179 0.036-0.583-2.313-2.664-4.036-5.155-4.036-2.941 0-5.333 2.392-5.333 5.333s2.392 5.333 5.333 5.333c2.491 0 4.572-1.723 5.155-4.036 0.061 0.008 0.116 0.036 0.179 0.036h2.667c0.736 0 1.333-0.596 1.333-1.333v-8.399c0-0.905-0.311-1.792-0.877-2.499zM21.333 13.333v-4h1.437c1.221 0 2.36 0.547 3.124 1.501l1.997 2.499zM22.667 26.667c-1.471 0-2.667-1.196-2.667-2.667s1.196-2.667 2.667-2.667 2.667 1.196 2.667 2.667-1.196 2.667-2.667 2.667z"></path>\n</svg>\n';export{c as S}