@salla.sa/twilight-components 2.14.543 → 2.14.545

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 (358) hide show
  1. package/dist/cjs/{filepond-uhJt4caG.js → filepond-B5aWlI3l.js} +1 -1
  2. package/dist/cjs/{filepond-plugin-file-poster-Dy-GRHf0.js → filepond-plugin-file-poster-BYq39KHd.js} +1 -1
  3. package/dist/cjs/{filepond-plugin-file-validate-size-BWIBGLW-.js → filepond-plugin-file-validate-size-Bi3TAsJv.js} +1 -1
  4. package/dist/cjs/{filepond-plugin-file-validate-type-DEVtMF0l.js → filepond-plugin-file-validate-type-Ck6S5TuZ.js} +1 -1
  5. package/dist/cjs/{filepond-plugin-image-edit-DSDoJaLw.js → filepond-plugin-image-edit-DbsdnH5j.js} +1 -1
  6. package/dist/cjs/{filepond-plugin-image-exif-orientation-BdZit5hj.js → filepond-plugin-image-exif-orientation-x7TfJR-2.js} +1 -1
  7. package/dist/cjs/{filepond-plugin-image-preview-Z3_zQyYR.js → filepond-plugin-image-preview-CrU7vIRk.js} +1 -1
  8. package/dist/cjs/helpers-DHdDjm5V.js +340 -0
  9. package/dist/cjs/{index-Bw3b6O6G.js → index-DGpOR-TH.js} +14 -14
  10. package/dist/cjs/{intlTelInput-CXe3TkdL.js → intlTelInput-DKAXRecW.js} +1 -1
  11. package/dist/cjs/loader.cjs.js +2 -2
  12. package/dist/cjs/{mail-CO8cFZH7.js → mail-C9D8MHae.js} +2 -2
  13. package/dist/cjs/salla-accordion-body_2.cjs.entry.js +1 -1
  14. package/dist/cjs/salla-accordion_6.cjs.entry.js +1 -1
  15. package/dist/cjs/salla-add-product-button_5.cjs.entry.js +1 -1
  16. package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
  17. package/dist/cjs/salla-alert_2.cjs.entry.js +1 -1
  18. package/dist/cjs/salla-app-install-alert.cjs.entry.js +1 -1
  19. package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
  20. package/dist/cjs/salla-attachment-view_9.cjs.entry.js +10 -10
  21. package/dist/cjs/salla-badge.cjs.entry.js +1 -1
  22. package/dist/cjs/salla-basket-gap.cjs.entry.js +1 -1
  23. package/dist/cjs/salla-bullet-delivery_2.cjs.entry.js +156 -401
  24. package/dist/cjs/salla-cart-coupons.cjs.entry.js +1 -1
  25. package/dist/cjs/salla-cart-item-offers_2.cjs.entry.js +1 -1
  26. package/dist/cjs/salla-cart-summary-card.cjs.entry.js +1 -1
  27. package/dist/cjs/salla-cashback-banner.cjs.entry.js +1 -1
  28. package/dist/cjs/salla-comment-factors.cjs.entry.js +1 -1
  29. package/dist/cjs/{salla-comment-form_9.cjs.entry.js → salla-comment-form_8.cjs.entry.js} +3 -259
  30. package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
  31. package/dist/cjs/salla-contacts.cjs.entry.js +3 -3
  32. package/dist/cjs/salla-cookies-bar.cjs.entry.js +1 -1
  33. package/dist/cjs/salla-count-down.cjs.entry.js +1 -1
  34. package/dist/cjs/salla-custom-fields.cjs.entry.js +1 -1
  35. package/dist/cjs/salla-delivery-promise.cjs.entry.js +21 -5
  36. package/dist/cjs/salla-edit-order-button.cjs.entry.js +1 -1
  37. package/dist/cjs/salla-filters-widget.cjs.entry.js +1 -1
  38. package/dist/cjs/salla-filters.cjs.entry.js +1 -1
  39. package/dist/cjs/salla-fulfillment-methods.cjs.entry.js +1 -1
  40. package/dist/cjs/salla-gifting.cjs.entry.js +1 -1
  41. package/dist/cjs/salla-hook.cjs.entry.js +1 -1
  42. package/dist/cjs/salla-infinite-scroll.cjs.entry.js +1 -1
  43. package/dist/cjs/salla-installment.cjs.entry.js +1 -1
  44. package/dist/cjs/salla-list-tile.cjs.entry.js +1 -1
  45. package/dist/cjs/salla-localization-modal.cjs.entry.js +1 -1
  46. package/dist/cjs/salla-login-modal.cjs.entry.js +1 -1
  47. package/dist/cjs/salla-loyalty-banner_10.cjs.entry.js +3 -3
  48. package/dist/cjs/salla-loyalty-exchange-product-card.cjs.entry.js +1 -1
  49. package/dist/cjs/salla-loyalty-points-banner.cjs.entry.js +1 -1
  50. package/dist/cjs/salla-loyalty-points-history.cjs.entry.js +1 -1
  51. package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
  52. package/dist/cjs/salla-loyalty.cjs.entry.js +1 -1
  53. package/dist/cjs/salla-maintenance-alert.cjs.entry.js +1 -1
  54. package/dist/cjs/salla-map_2.cjs.entry.js +1 -1
  55. package/dist/cjs/salla-menu.cjs.entry.js +1 -1
  56. package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
  57. package/dist/cjs/salla-multiple-bundle-product-cart_2.cjs.entry.js +1 -1
  58. package/dist/cjs/salla-multiple-bundle-product-options-modal_2.cjs.entry.js +1 -1
  59. package/dist/cjs/salla-multiple-bundle-product.cjs.entry.js +1 -1
  60. package/dist/cjs/salla-next-order-coupon.cjs.entry.js +1 -1
  61. package/dist/cjs/salla-notification-item_2.cjs.entry.js +1 -1
  62. package/dist/cjs/salla-offer-modal.cjs.entry.js +1 -1
  63. package/dist/cjs/salla-offer.cjs.entry.js +1 -1
  64. package/dist/cjs/salla-order-branch.cjs.entry.js +1 -1
  65. package/dist/cjs/salla-order-cancel.cjs.entry.js +1 -1
  66. package/dist/cjs/salla-order-details-multiple-bundle-product.cjs.entry.js +1 -1
  67. package/dist/cjs/salla-order-details-options.cjs.entry.js +1 -1
  68. package/dist/cjs/salla-order-details.cjs.entry.js +1 -1
  69. package/dist/cjs/salla-order-edit-item.cjs.entry.js +1 -1
  70. package/dist/cjs/salla-order-edit-product-card.cjs.entry.js +1 -1
  71. package/dist/cjs/salla-order-edit.cjs.entry.js +1 -1
  72. package/dist/cjs/salla-order-options-modal_2.cjs.entry.js +1 -1
  73. package/dist/cjs/salla-order-shipments.cjs.entry.js +1 -1
  74. package/dist/cjs/salla-order-summary.cjs.entry.js +1 -1
  75. package/dist/cjs/salla-order-totals-card.cjs.entry.js +1 -1
  76. package/dist/cjs/salla-orders.cjs.entry.js +1 -1
  77. package/dist/cjs/salla-payments.cjs.entry.js +1 -1
  78. package/dist/cjs/salla-placeholder.cjs.entry.js +1 -1
  79. package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
  80. package/dist/cjs/salla-product-card-embed.cjs.entry.js +1 -1
  81. package/dist/cjs/salla-product-size-guide.cjs.entry.js +1 -1
  82. package/dist/cjs/salla-products-list.cjs.entry.js +1 -1
  83. package/dist/cjs/salla-products-slider.cjs.entry.js +1 -1
  84. package/dist/cjs/salla-quick-order.cjs.entry.js +3 -3
  85. package/dist/cjs/salla-rating-modal-v2.cjs.entry.js +14 -73
  86. package/dist/cjs/salla-rating-modal.cjs.entry.js +7 -22
  87. package/dist/cjs/salla-review-factors-tags.cjs.entry.js +1 -1
  88. package/dist/cjs/salla-review-order-item.cjs.entry.js +1 -1
  89. package/dist/cjs/salla-scopes.cjs.entry.js +1 -1
  90. package/dist/cjs/salla-search.cjs.entry.js +1 -1
  91. package/dist/cjs/salla-skeleton.cjs.entry.js +1 -1
  92. package/dist/cjs/salla-slider.cjs.entry.js +1 -1
  93. package/dist/cjs/salla-social-share.cjs.entry.js +4 -4
  94. package/dist/cjs/salla-social.cjs.entry.js +1 -1
  95. package/dist/cjs/salla-tab-content_3.cjs.entry.js +1 -1
  96. package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
  97. package/dist/cjs/salla-tooltip.cjs.entry.js +1 -1
  98. package/dist/cjs/salla-trust-badges.cjs.entry.js +1 -1
  99. package/dist/cjs/salla-user-menu.cjs.entry.js +1 -1
  100. package/dist/cjs/salla-user-profile.cjs.entry.js +1 -1
  101. package/dist/cjs/salla-user-settings.cjs.entry.js +1 -1
  102. package/dist/cjs/salla-verify.cjs.entry.js +3 -3
  103. package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
  104. package/dist/cjs/salla-wishlist-actions.cjs.entry.js +1 -1
  105. package/dist/cjs/twilight.cjs.js +2 -2
  106. package/dist/cjs/{vanilla-picker-GTx-kpDm.js → vanilla-picker-DQDSSf6Q.js} +1 -1
  107. package/dist/collection/collection-manifest.json +12 -14
  108. package/dist/collection/components/salla-bullet-delivery/helpers.js +3 -0
  109. package/dist/collection/components/salla-bullet-delivery/salla-bullet-delivery.js +82 -16
  110. package/dist/collection/components/salla-comments/interfaces.js +0 -12
  111. package/dist/collection/components/salla-comments/salla-comment-item.js +1 -1
  112. package/dist/collection/components/salla-comments/salla-comments.js +5 -38
  113. package/dist/collection/components/salla-delivery-promise/delivery-promise-api.js +1 -1
  114. package/dist/collection/components/salla-delivery-promise/delivery-promise-intent.js +9 -0
  115. package/dist/collection/components/salla-delivery-promise/salla-delivery-promise.js +10 -3
  116. package/dist/collection/components/salla-rating-modal/salla-rating-modal-v2.js +16 -119
  117. package/dist/collection/components/salla-rating-modal/salla-rating-modal.js +10 -69
  118. package/dist/components/helpers.js +319 -0
  119. package/dist/components/index.js +2 -2
  120. package/dist/components/salla-bullet-delivery.js +82 -327
  121. package/dist/components/salla-comment-item2.js +1 -1
  122. package/dist/components/salla-comments.js +1 -40
  123. package/dist/components/salla-delivery-promise.js +20 -4
  124. package/dist/components/salla-rating-modal-v22.js +12 -73
  125. package/dist/components/salla-rating-modal.js +591 -1
  126. package/dist/esm/{filepond-plugin-file-poster-BTU_WzVu.js → filepond-plugin-file-poster-CkWxCmZT.js} +1 -1
  127. package/dist/esm/{filepond-plugin-file-validate-size-c_09APqP.js → filepond-plugin-file-validate-size-DlWS-oUK.js} +1 -1
  128. package/dist/esm/{filepond-plugin-file-validate-type-Dz2Lgh8V.js → filepond-plugin-file-validate-type-mdpFM1TG.js} +1 -1
  129. package/dist/esm/{filepond-plugin-image-edit-DK7eXs2p.js → filepond-plugin-image-edit-BqPLKgZU.js} +1 -1
  130. package/dist/esm/{filepond-plugin-image-exif-orientation-DYBURwn_.js → filepond-plugin-image-exif-orientation-CMqFjPu7.js} +1 -1
  131. package/dist/esm/{filepond-plugin-image-preview-4WNiH-ie.js → filepond-plugin-image-preview-DjCwk-CI.js} +1 -1
  132. package/dist/esm/{filepond-BcXR53L3.js → filepond-wd7_MQSV.js} +1 -1
  133. package/dist/esm/helpers-BDChq2t4.js +319 -0
  134. package/dist/esm/{index-BW1au-Nh.js → index-CHZfg_a9.js} +14 -14
  135. package/dist/esm/{intlTelInput-DvPcVtVG.js → intlTelInput-B5Q8rrU9.js} +1 -1
  136. package/dist/esm/loader.js +3 -3
  137. package/dist/esm/{mail-DmgxDvXL.js → mail-DzAIgzdz.js} +2 -2
  138. package/dist/esm/salla-accordion-body_2.entry.js +1 -1
  139. package/dist/esm/salla-accordion_6.entry.js +1 -1
  140. package/dist/esm/salla-add-product-button_5.entry.js +1 -1
  141. package/dist/esm/salla-advertisement.entry.js +1 -1
  142. package/dist/esm/salla-alert_2.entry.js +1 -1
  143. package/dist/esm/salla-app-install-alert.entry.js +1 -1
  144. package/dist/esm/salla-apps-icons.entry.js +1 -1
  145. package/dist/esm/salla-attachment-view_9.entry.js +10 -10
  146. package/dist/esm/salla-badge.entry.js +1 -1
  147. package/dist/esm/salla-basket-gap.entry.js +1 -1
  148. package/dist/esm/salla-bullet-delivery_2.entry.js +83 -328
  149. package/dist/esm/salla-cart-coupons.entry.js +1 -1
  150. package/dist/esm/salla-cart-item-offers_2.entry.js +1 -1
  151. package/dist/esm/salla-cart-summary-card.entry.js +1 -1
  152. package/dist/esm/salla-cashback-banner.entry.js +1 -1
  153. package/dist/esm/salla-comment-factors.entry.js +1 -1
  154. package/dist/esm/{salla-comment-form_9.entry.js → salla-comment-form_8.entry.js} +4 -259
  155. package/dist/esm/salla-conditional-offer.entry.js +1 -1
  156. package/dist/esm/salla-contacts.entry.js +3 -3
  157. package/dist/esm/salla-cookies-bar.entry.js +1 -1
  158. package/dist/esm/salla-count-down.entry.js +1 -1
  159. package/dist/esm/salla-custom-fields.entry.js +1 -1
  160. package/dist/esm/salla-delivery-promise.entry.js +21 -5
  161. package/dist/esm/salla-edit-order-button.entry.js +1 -1
  162. package/dist/esm/salla-filters-widget.entry.js +1 -1
  163. package/dist/esm/salla-filters.entry.js +1 -1
  164. package/dist/esm/salla-fulfillment-methods.entry.js +1 -1
  165. package/dist/esm/salla-gifting.entry.js +1 -1
  166. package/dist/esm/salla-hook.entry.js +1 -1
  167. package/dist/esm/salla-infinite-scroll.entry.js +1 -1
  168. package/dist/esm/salla-installment.entry.js +1 -1
  169. package/dist/esm/salla-list-tile.entry.js +1 -1
  170. package/dist/esm/salla-localization-modal.entry.js +1 -1
  171. package/dist/esm/salla-login-modal.entry.js +1 -1
  172. package/dist/esm/salla-loyalty-banner_10.entry.js +3 -3
  173. package/dist/esm/salla-loyalty-exchange-product-card.entry.js +1 -1
  174. package/dist/esm/salla-loyalty-points-banner.entry.js +1 -1
  175. package/dist/esm/salla-loyalty-points-history.entry.js +1 -1
  176. package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
  177. package/dist/esm/salla-loyalty.entry.js +1 -1
  178. package/dist/esm/salla-maintenance-alert.entry.js +1 -1
  179. package/dist/esm/salla-map_2.entry.js +1 -1
  180. package/dist/esm/salla-menu.entry.js +1 -1
  181. package/dist/esm/salla-metadata.entry.js +1 -1
  182. package/dist/esm/salla-multiple-bundle-product-cart_2.entry.js +1 -1
  183. package/dist/esm/salla-multiple-bundle-product-options-modal_2.entry.js +1 -1
  184. package/dist/esm/salla-multiple-bundle-product.entry.js +1 -1
  185. package/dist/esm/salla-next-order-coupon.entry.js +1 -1
  186. package/dist/esm/salla-notification-item_2.entry.js +1 -1
  187. package/dist/esm/salla-offer-modal.entry.js +1 -1
  188. package/dist/esm/salla-offer.entry.js +1 -1
  189. package/dist/esm/salla-order-branch.entry.js +1 -1
  190. package/dist/esm/salla-order-cancel.entry.js +1 -1
  191. package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +1 -1
  192. package/dist/esm/salla-order-details-options.entry.js +1 -1
  193. package/dist/esm/salla-order-details.entry.js +1 -1
  194. package/dist/esm/salla-order-edit-item.entry.js +1 -1
  195. package/dist/esm/salla-order-edit-product-card.entry.js +1 -1
  196. package/dist/esm/salla-order-edit.entry.js +1 -1
  197. package/dist/esm/salla-order-options-modal_2.entry.js +1 -1
  198. package/dist/esm/salla-order-shipments.entry.js +1 -1
  199. package/dist/esm/salla-order-summary.entry.js +1 -1
  200. package/dist/esm/salla-order-totals-card.entry.js +1 -1
  201. package/dist/esm/salla-orders.entry.js +1 -1
  202. package/dist/esm/salla-payments.entry.js +1 -1
  203. package/dist/esm/salla-placeholder.entry.js +1 -1
  204. package/dist/esm/salla-price-range.entry.js +1 -1
  205. package/dist/esm/salla-product-card-embed.entry.js +1 -1
  206. package/dist/esm/salla-product-size-guide.entry.js +1 -1
  207. package/dist/esm/salla-products-list.entry.js +1 -1
  208. package/dist/esm/salla-products-slider.entry.js +1 -1
  209. package/dist/esm/salla-quick-order.entry.js +3 -3
  210. package/dist/esm/salla-rating-modal-v2.entry.js +14 -73
  211. package/dist/esm/salla-rating-modal.entry.js +7 -22
  212. package/dist/esm/salla-review-factors-tags.entry.js +1 -1
  213. package/dist/esm/salla-review-order-item.entry.js +1 -1
  214. package/dist/esm/salla-scopes.entry.js +1 -1
  215. package/dist/esm/salla-search.entry.js +1 -1
  216. package/dist/esm/salla-skeleton.entry.js +1 -1
  217. package/dist/esm/salla-slider.entry.js +1 -1
  218. package/dist/esm/salla-social-share.entry.js +4 -4
  219. package/dist/esm/salla-social.entry.js +1 -1
  220. package/dist/esm/salla-tab-content_3.entry.js +1 -1
  221. package/dist/esm/salla-tiered-offer.entry.js +1 -1
  222. package/dist/esm/salla-tooltip.entry.js +1 -1
  223. package/dist/esm/salla-trust-badges.entry.js +1 -1
  224. package/dist/esm/salla-user-menu.entry.js +1 -1
  225. package/dist/esm/salla-user-profile.entry.js +1 -1
  226. package/dist/esm/salla-user-settings.entry.js +1 -1
  227. package/dist/esm/salla-verify.entry.js +3 -3
  228. package/dist/esm/salla-wallet.entry.js +1 -1
  229. package/dist/esm/salla-wishlist-actions.entry.js +1 -1
  230. package/dist/esm/twilight.js +3 -3
  231. package/dist/esm/{vanilla-picker-CDk_knNu.js → vanilla-picker-uNDULydX.js} +1 -1
  232. package/dist/twilight/{p-df202b1d.entry.js → p-0495bfac.entry.js} +1 -1
  233. package/dist/twilight/{p-13dbbbdc.entry.js → p-0573a498.entry.js} +1 -1
  234. package/dist/twilight/{p-b89d8c3c.entry.js → p-06d9e1c5.entry.js} +1 -1
  235. package/dist/twilight/{p-b1dfc455.entry.js → p-0749cc55.entry.js} +1 -1
  236. package/dist/twilight/p-0ae39262.entry.js +4 -0
  237. package/dist/twilight/{p-de83979a.entry.js → p-12836275.entry.js} +1 -1
  238. package/dist/twilight/p-12f61ae1.entry.js +4 -0
  239. package/dist/twilight/{p-69f4a089.entry.js → p-1419a93d.entry.js} +1 -1
  240. package/dist/twilight/{p-baa06c65.entry.js → p-17d49c87.entry.js} +1 -1
  241. package/dist/twilight/{p-1282e22a.entry.js → p-1ea25389.entry.js} +1 -1
  242. package/dist/twilight/{p-80c11fae.entry.js → p-2305edcc.entry.js} +1 -1
  243. package/dist/twilight/{p-10534171.entry.js → p-235d7596.entry.js} +1 -1
  244. package/dist/twilight/{p-50c0b6fa.entry.js → p-25d9f1b2.entry.js} +1 -1
  245. package/dist/twilight/{p-16ccbce5.entry.js → p-25f51a7e.entry.js} +1 -1
  246. package/dist/twilight/{p-3c28560f.entry.js → p-279a1661.entry.js} +1 -1
  247. package/dist/twilight/{p-ac794ed6.entry.js → p-28248b6b.entry.js} +1 -1
  248. package/dist/twilight/{p-7afd066a.entry.js → p-2d01a4f5.entry.js} +1 -1
  249. package/dist/twilight/{p-66c7b9e4.entry.js → p-2d62c947.entry.js} +1 -1
  250. package/dist/twilight/{p-489d084c.entry.js → p-2db5e829.entry.js} +1 -1
  251. package/dist/twilight/{p-362792d6.entry.js → p-2de58591.entry.js} +1 -1
  252. package/dist/twilight/{p-16296dce.entry.js → p-32e3daa3.entry.js} +1 -1
  253. package/dist/twilight/{p-beb2110d.entry.js → p-345532e5.entry.js} +1 -1
  254. package/dist/twilight/{p-280e67f0.entry.js → p-346366ba.entry.js} +1 -1
  255. package/dist/twilight/{p-46399dc8.entry.js → p-35557962.entry.js} +1 -1
  256. package/dist/twilight/{p-d54acab0.entry.js → p-3672d4f7.entry.js} +1 -1
  257. package/dist/twilight/{p-315890b5.entry.js → p-37163aef.entry.js} +1 -1
  258. package/dist/twilight/{p-e184cd72.entry.js → p-391a2ec6.entry.js} +1 -1
  259. package/dist/twilight/{p-b2b818a5.entry.js → p-3a8be7df.entry.js} +1 -1
  260. package/dist/twilight/{p-ceb40475.entry.js → p-3f5bc617.entry.js} +1 -1
  261. package/dist/twilight/{p-cf4efddb.entry.js → p-419499d6.entry.js} +1 -1
  262. package/dist/twilight/{p-d018fc49.entry.js → p-4ac9a3b6.entry.js} +1 -1
  263. package/dist/twilight/{p-aa9fb9f5.entry.js → p-5074de7d.entry.js} +1 -1
  264. package/dist/twilight/{p-65a86613.entry.js → p-51a062cd.entry.js} +1 -1
  265. package/dist/twilight/p-54e2d320.entry.js +1024 -0
  266. package/dist/twilight/{p-84679cc1.entry.js → p-5933ba05.entry.js} +1 -1
  267. package/dist/twilight/{p-4b14e0f8.entry.js → p-5d9a85b0.entry.js} +1 -1
  268. package/dist/twilight/{p-d7a68f6c.entry.js → p-5ded000f.entry.js} +1 -1
  269. package/dist/twilight/{p-a3fdec51.entry.js → p-63b01300.entry.js} +1 -1
  270. package/dist/twilight/{p-677bcf4c.entry.js → p-64efbb2c.entry.js} +1 -1
  271. package/dist/twilight/{p-feb80402.entry.js → p-67b91397.entry.js} +1 -1
  272. package/dist/twilight/{p-9b1403fc.entry.js → p-69119c00.entry.js} +1 -1
  273. package/dist/twilight/{p-6e78ee63.entry.js → p-6c18cc72.entry.js} +1 -1
  274. package/dist/twilight/{p-1ba8fb02.entry.js → p-6d961d73.entry.js} +1 -1
  275. package/dist/twilight/{p-64f0c216.entry.js → p-6ff53523.entry.js} +1 -1
  276. package/dist/twilight/{p-75065cbf.entry.js → p-72ee7071.entry.js} +1 -1
  277. package/dist/twilight/{p-6d6618f8.entry.js → p-72f54055.entry.js} +1 -1
  278. package/dist/twilight/{p-3b9dcb0f.entry.js → p-74529abb.entry.js} +1 -1
  279. package/dist/twilight/{p-664d428e.entry.js → p-766a3291.entry.js} +1 -1
  280. package/dist/twilight/{p-d3692caf.entry.js → p-788fd019.entry.js} +1 -1
  281. package/dist/twilight/{p-a15b4245.entry.js → p-82fe9f82.entry.js} +1 -1
  282. package/dist/twilight/{p-f45f5f91.entry.js → p-832f3a98.entry.js} +1 -1
  283. package/dist/twilight/{p-89fe5237.entry.js → p-84380d4a.entry.js} +1 -1
  284. package/dist/twilight/{p-311a905b.entry.js → p-8780a467.entry.js} +1 -1
  285. package/dist/twilight/{p-7adefcd6.entry.js → p-87e10a68.entry.js} +1 -1
  286. package/dist/twilight/{p-3cfd4fcd.entry.js → p-88f50d7e.entry.js} +1 -1
  287. package/dist/twilight/{p-f0a04676.entry.js → p-8fc6e860.entry.js} +1 -1
  288. package/dist/twilight/{p-cc3a9188.entry.js → p-90e5c3ab.entry.js} +1 -1
  289. package/dist/twilight/{p-641cc01d.entry.js → p-93aa1b67.entry.js} +1 -1
  290. package/dist/twilight/{p-a4436d17.entry.js → p-93dabb47.entry.js} +1 -1
  291. package/dist/twilight/{p-07c013f9.entry.js → p-98108ebe.entry.js} +1 -1
  292. package/dist/twilight/{p-72960bb3.entry.js → p-989f2adb.entry.js} +1 -1
  293. package/dist/twilight/{p-4be8900d.entry.js → p-9d224252.entry.js} +1 -1
  294. package/dist/twilight/p-BDChq2t4.js +4 -0
  295. package/dist/twilight/{p-D9Y6HNvi.js → p-BPkSO6gd.js} +1 -1
  296. package/dist/twilight/{p-BUMDIRU5.js → p-BWvO3cE-.js} +1 -1
  297. package/dist/twilight/{p-BW1au-Nh.js → p-CHZfg_a9.js} +1 -1
  298. package/dist/twilight/{p-AncUY1nn.js → p-CdgES2Of.js} +1 -1
  299. package/dist/twilight/{p-DPMPVhgw.js → p-D9VjvNQq.js} +2 -2
  300. package/dist/twilight/{p-C6nX89oY.js → p-DO7S0QBX.js} +1 -1
  301. package/dist/twilight/{p-UDPL8zGN.js → p-DtV7npW9.js} +1 -1
  302. package/dist/twilight/{p-DmgxDvXL.js → p-DzAIgzdz.js} +1 -1
  303. package/dist/twilight/{p-UIEwOe70.js → p-PCp-0mbL.js} +1 -1
  304. package/dist/twilight/{p-BjS2Vb6h.js → p-ZinKLSYw.js} +1 -1
  305. package/dist/twilight/{p-1c82117c.entry.js → p-a0561bd1.entry.js} +1 -1
  306. package/dist/twilight/{p-1187210a.entry.js → p-a785b49f.entry.js} +1 -1
  307. package/dist/twilight/{p-13bf1c47.entry.js → p-aa4daadf.entry.js} +1 -1
  308. package/dist/twilight/p-ab41d26c.entry.js +4 -0
  309. package/dist/twilight/{p-87cc2e08.entry.js → p-afb03ee5.entry.js} +1 -1
  310. package/dist/twilight/{p-caa8d5ae.entry.js → p-b279e0bb.entry.js} +1 -1
  311. package/dist/twilight/{p-bcee5564.entry.js → p-b33392c6.entry.js} +1 -1
  312. package/dist/twilight/{p-e1eb70d2.entry.js → p-b38c4e39.entry.js} +1 -1
  313. package/dist/twilight/{p-26f8a482.entry.js → p-bead6e6f.entry.js} +1 -1
  314. package/dist/twilight/{p-8643930a.entry.js → p-c26043ff.entry.js} +1 -1
  315. package/dist/twilight/{p-a7a10dbf.entry.js → p-c287e498.entry.js} +1 -1
  316. package/dist/twilight/{p-87af932a.entry.js → p-c2fe2dbe.entry.js} +1 -1
  317. package/dist/twilight/{p-6d3a4c41.entry.js → p-c603722c.entry.js} +1 -1
  318. package/dist/twilight/{p-edebecb3.entry.js → p-c816b198.entry.js} +1 -1
  319. package/dist/twilight/{p-f3f9d1fb.entry.js → p-c81bce54.entry.js} +1 -1
  320. package/dist/twilight/{p-40555637.entry.js → p-c9146d50.entry.js} +1 -1
  321. package/dist/twilight/{p-5335f307.entry.js → p-c92edd6f.entry.js} +1 -1
  322. package/dist/twilight/{p-821aa95a.entry.js → p-c948a8a8.entry.js} +1 -1
  323. package/dist/twilight/{p-93c006fc.entry.js → p-d0d3609c.entry.js} +1 -1
  324. package/dist/twilight/{p-a38dc391.entry.js → p-d9b0fa64.entry.js} +1 -1
  325. package/dist/twilight/{p-534e7760.entry.js → p-dd823fde.entry.js} +1 -1
  326. package/dist/twilight/p-e36f62a9.entry.js +4 -0
  327. package/dist/twilight/{p-beaab93e.entry.js → p-e5a3b689.entry.js} +1 -1
  328. package/dist/twilight/{p-c7e980aa.entry.js → p-ec281904.entry.js} +1 -1
  329. package/dist/twilight/{p-68d6fa66.entry.js → p-f07bbbc7.entry.js} +1 -1
  330. package/dist/twilight/{p-3ad55c42.entry.js → p-f168109d.entry.js} +1 -1
  331. package/dist/twilight/{p-e8153a9a.entry.js → p-f1d8729d.entry.js} +1 -1
  332. package/dist/twilight/{p-2a8f1ed4.entry.js → p-f1dfe18b.entry.js} +1 -1
  333. package/dist/twilight/{p-c23f7b95.entry.js → p-fb1ad954.entry.js} +1 -1
  334. package/dist/twilight/{p-c214700a.entry.js → p-ffdf5f92.entry.js} +1 -1
  335. package/dist/twilight/{p-CMWS1gyZ.js → p-ryHWESoh.js} +1 -1
  336. package/dist/twilight/twilight.esm.js +1 -1
  337. package/dist/types/components/salla-bullet-delivery/helpers.d.ts +1 -0
  338. package/dist/types/components/salla-bullet-delivery/interfaces.d.ts +14 -4
  339. package/dist/types/components/salla-bullet-delivery/salla-bullet-delivery.d.ts +2 -0
  340. package/dist/types/components/salla-comments/interfaces.d.ts +0 -15
  341. package/dist/types/components/salla-comments/salla-comments.d.ts +2 -5
  342. package/dist/types/components/salla-delivery-promise/delivery-promise-intent.d.ts +0 -4
  343. package/dist/types/components/salla-delivery-promise/interfaces.d.ts +2 -1
  344. package/dist/types/components/salla-rating-modal/salla-rating-modal-v2.d.ts +3 -16
  345. package/dist/types/components/salla-rating-modal/salla-rating-modal.d.ts +2 -10
  346. package/dist/types/components.d.ts +12 -45
  347. package/package.json +5 -5
  348. package/dist/collection/components/salla-verified-review/salla-verified-review.css +0 -162
  349. package/dist/collection/components/salla-verified-review/salla-verified-review.js +0 -264
  350. package/dist/components/salla-rating-modal2.js +0 -613
  351. package/dist/components/salla-verified-review.d.ts +0 -11
  352. package/dist/components/salla-verified-review.js +0 -325
  353. package/dist/twilight/p-03d77f90.entry.js +0 -4
  354. package/dist/twilight/p-4f052df8.entry.js +0 -4
  355. package/dist/twilight/p-a9674965.entry.js +0 -4
  356. package/dist/twilight/p-cbe760ce.entry.js +0 -4
  357. package/dist/twilight/p-e29f28eb.entry.js +0 -1019
  358. package/dist/types/components/salla-verified-review/salla-verified-review.d.ts +0 -51
@@ -0,0 +1,1024 @@
1
+ /*!
2
+ * Crafted with ❤ by Salla
3
+ */
4
+ import{r as t,c as e,h as i,H as s,a as r}from"./p-CHZfg_a9.js";import{a as o,b as a,r as l,g as n,c as h,h as d,d as c,e as p,f as u,j as b,k as m,l as g,m as f,n as v,o as y,p as w,q as x,i as k,s as S,t as C}from"./p-BDChq2t4.js";import{L as _}from"./p-BO5AoBAP.js";import{S as z}from"./p-BscTeWDc.js";
5
+ /**
6
+ * @license
7
+ * Copyright 2019 Google LLC
8
+ * SPDX-License-Identifier: BSD-3-Clause
9
+ */const A=globalThis,$=A.ShadowRoot&&(void 0===A.ShadyCSS||A.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,M=Symbol(),L=new WeakMap;let E=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==M)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if($&&void 0===t){const i=void 0!==e&&1===e.length;i&&(t=L.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&L.set(e,t))}return t}toString(){return this.cssText}};const I=(t,...e)=>{const i=1===t.length?t[0]:e.reduce(((e,i,s)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[s+1]),t[0]);return new E(i,t,M)},P=$?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return(t=>new E("string"==typeof t?t:t+"",void 0,M))(e)})(t):t
10
+ /**
11
+ * @license
12
+ * Copyright 2017 Google LLC
13
+ * SPDX-License-Identifier: BSD-3-Clause
14
+ */,{is:T,defineProperty:B,getOwnPropertyDescriptor:D,getOwnPropertyNames:j,getOwnPropertySymbols:O,getPrototypeOf:N}=Object,U=globalThis,F=U.trustedTypes,R=F?F.emptyScript:"",q=U.reactiveElementPolyfillSupport,Z={toAttribute(t,e){switch(e){case Boolean:t=t?R:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let i=t;switch(e){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(t){i=null}}return i}},G=(t,e)=>!T(t,e),V={attribute:!0,type:String,converter:Z,reflect:!1,useDefault:!1,hasChanged:G};Symbol.metadata??=Symbol("metadata"),U.litPropertyMetadata??=new WeakMap;let H=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=V){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){const i=Symbol(),s=this.getPropertyDescriptor(t,i,e);void 0!==s&&B(this.prototype,t,s)}}static getPropertyDescriptor(t,e,i){const{get:s,set:r}=D(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get:s,set(e){const o=s?.call(this);r?.call(this,e),this.requestUpdate(t,o,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??V}static _$Ei(){if(this.hasOwnProperty("elementProperties"))return;const t=N(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty("finalized"))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty("properties")){const t=this.properties,e=[...j(t),...O(t)];for(const i of e)this.createProperty(i,t[i])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,i]of e)this.elementProperties.set(t,i)}this._$Eh=new Map;for(const[t,e]of this.elementProperties){const i=this._$Eu(t,e);void 0!==i&&this._$Eh.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const t of i)e.unshift(P(t))}else void 0!==t&&e.push(P(t));return e}static _$Eu(t,e){const i=e.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)))}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const i of e.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((t,e)=>{if($)t.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const i of e){const e=document.createElement("style"),s=A.litNonce;void 0!==s&&e.setAttribute("nonce",s),e.textContent=i.cssText,t.appendChild(e)}})(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((t=>t.hostConnected?.()))}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach((t=>t.hostDisconnected?.()))}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$ET(t,e){const i=this.constructor.elementProperties.get(t),s=this.constructor._$Eu(t,i);if(void 0!==s&&!0===i.reflect){const r=(void 0!==i.converter?.toAttribute?i.converter:Z).toAttribute(e,i.type);this._$Em=t,null==r?this.removeAttribute(s):this.setAttribute(s,r),this._$Em=null}}_$AK(t,e){const i=this.constructor,s=i._$Eh.get(t);if(void 0!==s&&this._$Em!==s){const t=i.getPropertyOptions(s),r="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:Z;this._$Em=s;const o=r.fromAttribute(e,t.type);this[s]=o??this._$Ej?.get(s)??o,this._$Em=null}}requestUpdate(t,e,i,s=!1,r){if(void 0!==t){const o=this.constructor;if(!1===s&&(r=this[t]),i??=o.getPropertyOptions(t),!((i.hasChanged??G)(r,e)||i.useDefault&&i.reflect&&r===this._$Ej?.get(t)&&!this.hasAttribute(o._$Eu(t,i))))return;this.C(t,e,i)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(t,e,{useDefault:i,reflect:s,wrapped:r},o){i&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,o??e??this[t]),!0!==r||void 0!==o)||(this._$AL.has(t)||(this.hasUpdated||i||(e=void 0),this._$AL.set(t,e)),!0===s&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,i]of t){const{wrapped:t}=i,s=this[e];!0!==t||this._$AL.has(e)||void 0===s||this.C(e,void 0,i,s)}}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach((t=>t.hostUpdate?.())),this.update(e)):this._$EM()}catch(e){throw t=!1,this._$EM(),e}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach((t=>t.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach((t=>this._$ET(t,this[t]))),this._$EM()}updated(t){}firstUpdated(t){}};H.elementStyles=[],H.shadowRootOptions={mode:"open"},H.elementProperties=new Map,H.finalized=new Map,q?.({ReactiveElement:H}),(U.reactiveElementVersions??=[]).push("2.1.2");
15
+ /**
16
+ * @license
17
+ * Copyright 2017 Google LLC
18
+ * SPDX-License-Identifier: BSD-3-Clause
19
+ */
20
+ const K=globalThis,W=K.trustedTypes,Y=W?W.createPolicy("lit-html",{createHTML:t=>t}):void 0,J="$lit$",Q=`lit$${Math.random().toFixed(9).slice(2)}$`,X="?"+Q,tt=`<${X}>`,et=document,it=()=>et.createComment(""),st=t=>null===t||"object"!=typeof t&&"function"!=typeof t,rt=Array.isArray,ot="[ \t\n\f\r]",at=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,lt=/-->/g,nt=/>/g,ht=RegExp(`>|${ot}(?:([^\\s"'>=/]+)(${ot}*=${ot}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),dt=/'/g,ct=/"/g,pt=/^(?:script|style|textarea|title)$/i,ut=(t,...e)=>({_$litType$:1,strings:t,values:e}),bt=Symbol.for("lit-noChange"),mt=Symbol.for("lit-nothing"),gt=new WeakMap,ft=et.createTreeWalker(et,129);function vt(t,e){if(!rt(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==Y?Y.createHTML(e):e}const yt=(t,e)=>{const i=t.length-1,s=[];let r,o=2===e?"<svg>":3===e?"<math>":"",a=at;for(let e=0;e<i;e++){const i=t[e];let l,n,h=-1,d=0;for(;d<i.length&&(a.lastIndex=d,n=a.exec(i),null!==n);)d=a.lastIndex,a===at?"!--"===n[1]?a=lt:void 0!==n[1]?a=nt:void 0!==n[2]?(pt.test(n[2])&&(r=RegExp("</"+n[2],"g")),a=ht):void 0!==n[3]&&(a=ht):a===ht?">"===n[0]?(a=r??at,h=-1):void 0===n[1]?h=-2:(h=a.lastIndex-n[2].length,l=n[1],a=void 0===n[3]?ht:'"'===n[3]?ct:dt):a===ct||a===dt?a=ht:a===lt||a===nt?a=at:(a=ht,r=void 0);const c=a===ht&&t[e+1].startsWith("/>")?" ":"";o+=a===at?i+tt:h>=0?(s.push(l),i.slice(0,h)+J+i.slice(h)+Q+c):i+Q+(-2===h?e:c)}return[vt(t,o+(t[i]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),s]};let wt=class t{constructor({strings:e,_$litType$:i},s){let r;this.parts=[];let o=0,a=0;const l=e.length-1,n=this.parts,[h,d]=yt(e,i);if(this.el=t.createElement(h,s),ft.currentNode=this.el.content,2===i||3===i){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(r=ft.nextNode())&&n.length<l;){if(1===r.nodeType){if(r.hasAttributes())for(const t of r.getAttributeNames())if(t.endsWith(J)){const e=d[a++],i=r.getAttribute(t).split(Q),s=/([.?@])?(.*)/.exec(e);n.push({type:1,index:o,name:s[2],strings:i,ctor:"."===s[1]?_t:"?"===s[1]?zt:"@"===s[1]?At:Ct}),r.removeAttribute(t)}else t.startsWith(Q)&&(n.push({type:6,index:o}),r.removeAttribute(t));if(pt.test(r.tagName)){const t=r.textContent.split(Q),e=t.length-1;if(e>0){r.textContent=W?W.emptyScript:"";for(let i=0;i<e;i++)r.append(t[i],it()),ft.nextNode(),n.push({type:2,index:++o});r.append(t[e],it())}}}else if(8===r.nodeType)if(r.data===X)n.push({type:2,index:o});else{let t=-1;for(;-1!==(t=r.data.indexOf(Q,t+1));)n.push({type:7,index:o}),t+=Q.length-1}o++}}static createElement(t,e){const i=et.createElement("template");return i.innerHTML=t,i}};function xt(t,e,i=t,s){if(e===bt)return e;let r=void 0!==s?i._$Co?.[s]:i._$Cl;const o=st(e)?void 0:e._$litDirective$;return r?.constructor!==o&&(r?._$AO?.(!1),void 0===o?r=void 0:(r=new o(t),r._$AT(t,i,s)),void 0!==s?(i._$Co??=[])[s]=r:i._$Cl=r),void 0!==r&&(e=xt(t,r._$AS(t,e.values),r,s)),e}let kt=class{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:i}=this._$AD,s=(t?.creationScope??et).importNode(e,!0);ft.currentNode=s;let r=ft.nextNode(),o=0,a=0,l=i[0];for(;void 0!==l;){if(o===l.index){let e;2===l.type?e=new St(r,r.nextSibling,this,t):1===l.type?e=new l.ctor(r,l.name,l.strings,this,t):6===l.type&&(e=new $t(r,this,t)),this._$AV.push(e),l=i[++a]}o!==l?.index&&(r=ft.nextNode(),o++)}return ft.currentNode=et,s}p(t){let e=0;for(const i of this._$AV)void 0!==i&&(void 0!==i.strings?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}},St=class t{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,i,s){this.type=2,this._$AH=mt,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=s,this._$Cv=s?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t?.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=xt(this,t,e),st(t)?t===mt||null==t||""===t?(this._$AH!==mt&&this._$AR(),this._$AH=mt):t!==this._$AH&&t!==bt&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):(t=>rt(t)||"function"==typeof t?.[Symbol.iterator])(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==mt&&st(this._$AH)?this._$AA.nextSibling.data=t:this.T(et.createTextNode(t)),this._$AH=t}$(t){const{values:e,_$litType$:i}=t,s="number"==typeof i?this._$AC(t):(void 0===i.el&&(i.el=wt.createElement(vt(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===s)this._$AH.p(e);else{const t=new kt(s,this),i=t.u(this.options);t.p(e),this.T(i),this._$AH=t}}_$AC(t){let e=gt.get(t.strings);return void 0===e&&gt.set(t.strings,e=new wt(t)),e}k(e){rt(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let s,r=0;for(const o of e)r===i.length?i.push(s=new t(this.O(it()),this.O(it()),this,this.options)):s=i[r],s._$AI(o),r++;r<i.length&&(this._$AR(s&&s._$AB.nextSibling,r),i.length=r)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}},Ct=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,i,s,r){this.type=1,this._$AH=mt,this._$AN=void 0,this.element=t,this.name=e,this._$AM=s,this.options=r,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=mt}_$AI(t,e=this,i,s){const r=this.strings;let o=!1;if(void 0===r)t=xt(this,t,e,0),o=!st(t)||t!==this._$AH&&t!==bt,o&&(this._$AH=t);else{const s=t;let a,l;for(t=r[0],a=0;a<r.length-1;a++)l=xt(this,s[i+a],e,a),l===bt&&(l=this._$AH[a]),o||=!st(l)||l!==this._$AH[a],l===mt?t=mt:t!==mt&&(t+=(l??"")+r[a+1]),this._$AH[a]=l}o&&!s&&this.j(t)}j(t){t===mt?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},_t=class extends Ct{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===mt?void 0:t}},zt=class extends Ct{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==mt)}},At=class extends Ct{constructor(t,e,i,s,r){super(t,e,i,s,r),this.type=5}_$AI(t,e=this){if((t=xt(this,t,e,0)??mt)===bt)return;const i=this._$AH,s=t===mt&&i!==mt||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,r=t!==mt&&(i===mt||s);s&&this.element.removeEventListener(this.name,this,i),r&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}},$t=class{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){xt(this,t)}};const Mt=K.litHtmlPolyfillSupport;Mt?.(wt,St),(K.litHtmlVersions??=[]).push("3.3.2");const Lt=globalThis;
21
+ /**
22
+ * @license
23
+ * Copyright 2017 Google LLC
24
+ * SPDX-License-Identifier: BSD-3-Clause
25
+ */class Et extends H{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=((t,e,i)=>{const s=i?.renderBefore??e;let r=s._$litPart$;if(void 0===r){const t=i?.renderBefore??null;s._$litPart$=r=new St(e.insertBefore(it(),t),t,void 0,i??{})}return r._$AI(t),r})(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return bt}}Et._$litElement$=!0,Et.finalized=!0,Lt.litElementHydrateSupport?.({LitElement:Et});const It=Lt.litElementPolyfillSupport;It?.({LitElement:Et}),(Lt.litElementVersions??=[]).push("4.2.2");const Pt=globalThis,Tt=Pt.ShadowRoot&&(void 0===Pt.ShadyCSS||Pt.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Bt=Symbol(),Dt=new WeakMap;let jt=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==Bt)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(Tt&&void 0===t){const i=void 0!==e&&1===e.length;i&&(t=Dt.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&Dt.set(e,t))}return t}toString(){return this.cssText}};const Ot=Tt?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return(t=>new jt("string"==typeof t?t:t+"",void 0,Bt))(e)})(t):t,{is:Nt,defineProperty:Ut,getOwnPropertyDescriptor:Ft,getOwnPropertyNames:Rt,getOwnPropertySymbols:qt,getPrototypeOf:Zt}=Object,Gt=globalThis,Vt=Gt.trustedTypes,Ht=Vt?Vt.emptyScript:"",Kt=Gt.reactiveElementPolyfillSupport,Wt={toAttribute(t,e){switch(e){case Boolean:t=t?Ht:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let i=t;switch(e){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch{i=null}}return i}},Yt=(t,e)=>!Nt(t,e),Jt={attribute:!0,type:String,converter:Wt,reflect:!1,useDefault:!1,hasChanged:Yt};Symbol.metadata??=Symbol("metadata"),Gt.litPropertyMetadata??=new WeakMap;let Qt=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=Jt){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){const i=this.getPropertyDescriptor(t,Symbol(),e);void 0!==i&&Ut(this.prototype,t,i)}}static getPropertyDescriptor(t,e,i){const{get:s,set:r}=Ft(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get:s,set(e){const o=s?.call(this);r?.call(this,e),this.requestUpdate(t,o,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??Jt}static _$Ei(){if(this.hasOwnProperty("elementProperties"))return;const t=Zt(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty("finalized"))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty("properties")){const t=this.properties,e=[...Rt(t),...qt(t)];for(const i of e)this.createProperty(i,t[i])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,i]of e)this.elementProperties.set(t,i)}this._$Eh=new Map;for(const[t,e]of this.elementProperties){const i=this._$Eu(t,e);void 0!==i&&this._$Eh.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const t of i)e.unshift(Ot(t))}else void 0!==t&&e.push(Ot(t));return e}static _$Eu(t,e){const i=e.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)))}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const i of e.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((t,e)=>{if(Tt)t.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const i of e){const e=document.createElement("style"),s=Pt.litNonce;void 0!==s&&e.setAttribute("nonce",s),e.textContent=i.cssText,t.appendChild(e)}})(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((t=>t.hostConnected?.()))}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach((t=>t.hostDisconnected?.()))}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$ET(t,e){const i=this.constructor.elementProperties.get(t),s=this.constructor._$Eu(t,i);if(void 0!==s&&!0===i.reflect){const r=(void 0!==i.converter?.toAttribute?i.converter:Wt).toAttribute(e,i.type);this._$Em=t,null==r?this.removeAttribute(s):this.setAttribute(s,r),this._$Em=null}}_$AK(t,e){const i=this.constructor,s=i._$Eh.get(t);if(void 0!==s&&this._$Em!==s){const t=i.getPropertyOptions(s),r="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:Wt;this._$Em=s;const o=r.fromAttribute(e,t.type);this[s]=o??this._$Ej?.get(s)??o,this._$Em=null}}requestUpdate(t,e,i,s=!1,r){if(void 0!==t){const o=this.constructor;if(!1===s&&(r=this[t]),i??=o.getPropertyOptions(t),!((i.hasChanged??Yt)(r,e)||i.useDefault&&i.reflect&&r===this._$Ej?.get(t)&&!this.hasAttribute(o._$Eu(t,i))))return;this.C(t,e,i)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(t,e,{useDefault:i,reflect:s,wrapped:r},o){i&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,o??e??this[t]),!0!==r||void 0!==o)||(this._$AL.has(t)||(this.hasUpdated||i||(e=void 0),this._$AL.set(t,e)),!0===s&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,i]of t){const{wrapped:t}=i,s=this[e];!0!==t||this._$AL.has(e)||void 0===s||this.C(e,void 0,i,s)}}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach((t=>t.hostUpdate?.())),this.update(e)):this._$EM()}catch(e){throw t=!1,this._$EM(),e}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach((t=>t.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach((t=>this._$ET(t,this[t]))),this._$EM()}updated(t){}firstUpdated(t){}};Qt.elementStyles=[],Qt.shadowRootOptions={mode:"open"},Qt.elementProperties=new Map,Qt.finalized=new Map,Kt?.({ReactiveElement:Qt}),(Gt.reactiveElementVersions??=[]).push("2.1.2");const Xt=globalThis,te=Xt.trustedTypes,ee=te?te.createPolicy("lit-html",{createHTML:t=>t}):void 0,ie="$lit$",se=`lit$${Math.random().toFixed(9).slice(2)}$`,re="?"+se,oe=`<${re}>`,ae=document,le=()=>ae.createComment(""),ne=t=>null===t||"object"!=typeof t&&"function"!=typeof t,he=Array.isArray,de="[ \t\n\f\r]",ce=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,pe=/-->/g,ue=/>/g,be=RegExp(`>|${de}(?:([^\\s"'>=/]+)(${de}*=${de}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),me=/'/g,ge=/"/g,fe=/^(?:script|style|textarea|title)$/i,ve=(t,...e)=>({_$litType$:1,strings:t,values:e}),ye=Symbol.for("lit-noChange"),we=Symbol.for("lit-nothing"),xe=new WeakMap,ke=ae.createTreeWalker(ae,129);function Se(t,e){if(!he(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==ee?ee.createHTML(e):e}class Ce{constructor({strings:t,_$litType$:e},i){let s;this.parts=[];let r=0,o=0;const a=t.length-1,l=this.parts,[n,h]=((t,e)=>{const i=t.length-1,s=[];let r,o=2===e?"<svg>":3===e?"<math>":"",a=ce;for(let e=0;e<i;e++){const i=t[e];let l,n,h=-1,d=0;for(;d<i.length&&(a.lastIndex=d,n=a.exec(i),null!==n);)d=a.lastIndex,a===ce?"!--"===n[1]?a=pe:void 0!==n[1]?a=ue:void 0!==n[2]?(fe.test(n[2])&&(r=RegExp("</"+n[2],"g")),a=be):void 0!==n[3]&&(a=be):a===be?">"===n[0]?(a=r??ce,h=-1):void 0===n[1]?h=-2:(h=a.lastIndex-n[2].length,l=n[1],a=void 0===n[3]?be:'"'===n[3]?ge:me):a===ge||a===me?a=be:a===pe||a===ue?a=ce:(a=be,r=void 0);const c=a===be&&t[e+1].startsWith("/>")?" ":"";o+=a===ce?i+oe:h>=0?(s.push(l),i.slice(0,h)+ie+i.slice(h)+se+c):i+se+(-2===h?e:c)}return[Se(t,o+(t[i]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),s]})(t,e);if(this.el=Ce.createElement(n,i),ke.currentNode=this.el.content,2===e||3===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(s=ke.nextNode())&&l.length<a;){if(1===s.nodeType){if(s.hasAttributes())for(const t of s.getAttributeNames())if(t.endsWith(ie)){const e=h[o++],i=s.getAttribute(t).split(se),a=/([.?@])?(.*)/.exec(e);l.push({type:1,index:r,name:a[2],strings:i,ctor:"."===a[1]?Me:"?"===a[1]?Le:"@"===a[1]?Ee:$e}),s.removeAttribute(t)}else t.startsWith(se)&&(l.push({type:6,index:r}),s.removeAttribute(t));if(fe.test(s.tagName)){const t=s.textContent.split(se),e=t.length-1;if(e>0){s.textContent=te?te.emptyScript:"";for(let i=0;i<e;i++)s.append(t[i],le()),ke.nextNode(),l.push({type:2,index:++r});s.append(t[e],le())}}}else if(8===s.nodeType)if(s.data===re)l.push({type:2,index:r});else{let t=-1;for(;-1!==(t=s.data.indexOf(se,t+1));)l.push({type:7,index:r}),t+=se.length-1}r++}}static createElement(t,e){const i=ae.createElement("template");return i.innerHTML=t,i}}function _e(t,e,i=t,s){if(e===ye)return e;let r=void 0!==s?i._$Co?.[s]:i._$Cl;const o=ne(e)?void 0:e._$litDirective$;return r?.constructor!==o&&(r?._$AO?.(!1),void 0===o?r=void 0:(r=new o(t),r._$AT(t,i,s)),void 0!==s?(i._$Co??=[])[s]=r:i._$Cl=r),void 0!==r&&(e=_e(t,r._$AS(t,e.values),r,s)),e}class ze{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:i}=this._$AD,s=(t?.creationScope??ae).importNode(e,!0);ke.currentNode=s;let r=ke.nextNode(),o=0,a=0,l=i[0];for(;void 0!==l;){if(o===l.index){let e;2===l.type?e=new Ae(r,r.nextSibling,this,t):1===l.type?e=new l.ctor(r,l.name,l.strings,this,t):6===l.type&&(e=new Ie(r,this,t)),this._$AV.push(e),l=i[++a]}o!==l?.index&&(r=ke.nextNode(),o++)}return ke.currentNode=ae,s}p(t){let e=0;for(const i of this._$AV)void 0!==i&&(void 0!==i.strings?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}let Ae=class t{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,i,s){this.type=2,this._$AH=we,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=s,this._$Cv=s?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t?.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=_e(this,t,e),ne(t)?t===we||null==t||""===t?(this._$AH!==we&&this._$AR(),this._$AH=we):t!==this._$AH&&t!==ye&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):(t=>he(t)||"function"==typeof t?.[Symbol.iterator])(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==we&&ne(this._$AH)?this._$AA.nextSibling.data=t:this.T(ae.createTextNode(t)),this._$AH=t}$(t){const{values:e,_$litType$:i}=t,s="number"==typeof i?this._$AC(t):(void 0===i.el&&(i.el=Ce.createElement(Se(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===s)this._$AH.p(e);else{const t=new ze(s,this),i=t.u(this.options);t.p(e),this.T(i),this._$AH=t}}_$AC(t){let e=xe.get(t.strings);return void 0===e&&xe.set(t.strings,e=new Ce(t)),e}k(e){he(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let s,r=0;for(const o of e)r===i.length?i.push(s=new t(this.O(le()),this.O(le()),this,this.options)):s=i[r],s._$AI(o),r++;r<i.length&&(this._$AR(s&&s._$AB.nextSibling,r),i.length=r)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}},$e=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,i,s,r){this.type=1,this._$AH=we,this._$AN=void 0,this.element=t,this.name=e,this._$AM=s,this.options=r,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=we}_$AI(t,e=this,i,s){const r=this.strings;let o=!1;if(void 0===r)t=_e(this,t,e,0),o=!ne(t)||t!==this._$AH&&t!==ye,o&&(this._$AH=t);else{const s=t;let a,l;for(t=r[0],a=0;a<r.length-1;a++)l=_e(this,s[i+a],e,a),l===ye&&(l=this._$AH[a]),o||=!ne(l)||l!==this._$AH[a],l===we?t=we:t!==we&&(t+=(l??"")+r[a+1]),this._$AH[a]=l}o&&!s&&this.j(t)}j(t){t===we?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}};class Me extends $e{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===we?void 0:t}}class Le extends $e{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==we)}}class Ee extends $e{constructor(t,e,i,s,r){super(t,e,i,s,r),this.type=5}_$AI(t,e=this){if((t=_e(this,t,e,0)??we)===ye)return;const i=this._$AH,s=t===we&&i!==we||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,r=t!==we&&(i===we||s);s&&this.element.removeEventListener(this.name,this,i),r&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class Ie{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){_e(this,t)}}const Pe=Xt.litHtmlPolyfillSupport;Pe?.(Ce,Ae),(Xt.litHtmlVersions??=[]).push("3.3.2");const Te=globalThis;let Be=class extends Qt{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=((t,e,i)=>{const s=i?.renderBefore??e;let r=s._$litPart$;if(void 0===r){const t=i?.renderBefore??null;s._$litPart$=r=new Ae(e.insertBefore(le(),t),t,void 0,i??{})}return r._$AI(t),r})(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return ye}};Be._$litElement$=!0,Be.finalized=!0,Te.litElementHydrateSupport?.({LitElement:Be});const De=Te.litElementPolyfillSupport;De?.({LitElement:Be}),(Te.litElementVersions??=[]).push("4.2.2");const je={attribute:!0,type:String,converter:Wt,reflect:!1,hasChanged:Yt},Oe=(t=je,e,i)=>{const{kind:s,metadata:r}=i;let o=globalThis.litPropertyMetadata.get(r);if(void 0===o&&globalThis.litPropertyMetadata.set(r,o=new Map),"setter"===s&&((t=Object.create(t)).wrapped=!0),o.set(i.name,t),"accessor"===s){const{name:s}=i;return{set(i){const r=e.get.call(this);e.set.call(this,i),this.requestUpdate(s,r,t,!0,i)},init(e){return void 0!==e&&this.C(s,void 0,t,e),e}}}if("setter"===s){const{name:s}=i;return function(i){const r=this[s];e.call(this,i),this.requestUpdate(s,r,t,!0,i)}}throw Error("Unsupported decorator location: "+s)};function Ne(t){return(e,i)=>"object"==typeof i?Oe(t,e,i):((t,e,i)=>{const s=e.hasOwnProperty(i);return e.constructor.createProperty(i,t),s?Object.getOwnPropertyDescriptor(e,i):void 0})(t,e,i)}function Ue(t){return Ne({...t,state:!0,attribute:!1})}const Fe=t=>(...e)=>({_$litDirective$:t,values:e});class Re{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}const qe=Fe(class extends Re{constructor(t){if(super(t),1!==t.type||"class"!==t.name||t.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter((e=>t[e])).join(" ")+" "}update(t,[e]){if(void 0===this.st){this.st=new Set,void 0!==t.strings&&(this.nt=new Set(t.strings.join(" ").split(/\s/).filter((t=>""!==t))));for(const t in e)e[t]&&!this.nt?.has(t)&&this.st.add(t);return this.render(e)}const i=t.element.classList;for(const t of this.st)t in e||(i.remove(t),this.st.delete(t));for(const t in e){const s=!!e[t];s===this.st.has(t)||this.nt?.has(t)||(s?(i.add(t),this.st.add(t)):(i.remove(t),this.st.delete(t)))}return ye}}),Ze={},Ge=Fe(class extends Re{constructor(t){if(super(t),3!==t.type&&1!==t.type&&4!==t.type)throw Error("The `live` directive is not allowed on child or event bindings");if(!(t=>void 0===t.strings)(t))throw Error("`live` bindings can only contain a single expression")}render(t){return t}update(t,[e]){if(e===ye||e===we)return e;const i=t.element,s=t.name;if(3===t.type){if(e===i[s])return ye}else if(4===t.type){if(!!e===i.hasAttribute(s))return ye}else if(1===t.type&&i.getAttribute(s)===e+"")return ye;return((t,e=Ze)=>{t._$AH=e})(t),e}}),Ve=["AE","AR","AT","AU","BE","BG","BR","CA","CH","CL","CO","CZ","DE","DK","EE","ES","FI","FR","GB","GR","HK","HR","HU","ID","IE","IL","IN","IT","JP","KR","LT","LU","LV","MX","MY","NL","NO","NZ","PE","PH","PL","PT","RO","SE","SG","SI","SK","TH","TR","TW","US","VN","ZA"];function He(t,e){let i=null;return t.address_components?i=function(t){if(!t)return null;const e=t.find((t=>t.types?.includes("country")));return e?e.short_name:null}(t.address_components):e&&1===e.length&&(i=e[0].toUpperCase()),i?{isSupported:Ve.includes(i),countryCode:i}:{isSupported:null,countryCode:null}}const Ke={en:{placeholder:"Search for an address...",noResults:"No address found for this search. Try different keywords.",errorFetchPredictions:"Unable to search for addresses. Please try again.",errorFetchDetails:"Unable to load address details. Please try again.",errorNetwork:"Network error. Please check your connection and try again.",validationRequired:"This field is required",validationPattern:"Invalid format",validationSaudiFormat:"Please enter a valid Saudi national address (format: AAAA1234)"},ar:{placeholder:"ابحث عن عنوان...",noResults:"لم يتم العثور على عنوان لهذا البحث. جرب كلمات مختلفة.",errorFetchPredictions:"تعذر البحث عن العناوين. يرجى المحاولة مرة أخرى.",errorFetchDetails:"تعذر تحميل تفاصيل العنوان. يرجى المحاولة مرة أخرى.",errorNetwork:"خطأ في الشبكة. يرجى التحقق من اتصالك والمحاولة مرة أخرى.",validationRequired:"هذا الحقل مطلوب",validationPattern:"صيغة غير صحيحة",validationSaudiFormat:"الرجاء إدخال عنوان وطني صحيح (الصيغة: AAAA1234)"},es:{placeholder:"Buscar una dirección...",noResults:"No se encontró ninguna dirección para esta búsqueda. Intenta con diferentes palabras.",errorFetchPredictions:"No se pueden buscar direcciones. Por favor, inténtelo de nuevo.",errorFetchDetails:"No se pueden cargar los detalles de la dirección. Por favor, inténtelo de nuevo.",errorNetwork:"Error de red. Verifique su conexión e inténtelo de nuevo.",validationRequired:"Este campo es obligatorio",validationPattern:"Formato inválido",validationSaudiFormat:"Por favor ingrese una dirección nacional saudí válida (formato: AAAA1234)"},fr:{placeholder:"Rechercher une adresse...",noResults:"Aucune adresse trouvée pour cette recherche. Essayez différents mots-clés.",errorFetchPredictions:"Impossible de rechercher des adresses. Veuillez réessayer.",errorFetchDetails:"Impossible de charger les détails de l'adresse. Veuillez réessayer.",errorNetwork:"Erreur réseau. Vérifiez votre connexion et réessayez.",validationRequired:"Ce champ est obligatoire",validationPattern:"Format invalide",validationSaudiFormat:"Veuillez saisir une adresse nationale saoudienne valide (format: AAAA1234)"},de:{placeholder:"Nach einer Adresse suchen...",noResults:"Keine Adresse für diese Suche gefunden. Versuchen Sie es mit anderen Stichwörtern.",errorFetchPredictions:"Adressen können nicht gesucht werden. Bitte versuchen Sie es erneut.",errorFetchDetails:"Adressdetails können nicht geladen werden. Bitte versuchen Sie es erneut.",errorNetwork:"Netzwerkfehler. Bitte überprüfen Sie Ihre Verbindung und versuchen Sie es erneut.",validationRequired:"Dieses Feld ist erforderlich",validationPattern:"Ungültiges Format",validationSaudiFormat:"Bitte geben Sie eine gültige saudi-arabische nationale Adresse ein (Format: AAAA1234)"},it:{placeholder:"Cerca un indirizzo...",noResults:"Nessun indirizzo trovato per questa ricerca. Prova con parole chiave diverse.",errorFetchPredictions:"Impossibile cercare indirizzi. Riprova.",errorFetchDetails:"Impossibile caricare i dettagli dell'indirizzo. Riprova.",errorNetwork:"Errore di rete. Controlla la connessione e riprova.",validationRequired:"Questo campo è obbligatorio",validationPattern:"Formato non valido",validationSaudiFormat:"Inserisci un indirizzo nazionale saudita valido (formato: AAAA1234)"},pt:{placeholder:"Pesquisar um endereço...",noResults:"Nenhum endereço encontrado para esta pesquisa. Tente palavras-chave diferentes.",errorFetchPredictions:"Não é possível pesquisar endereços. Por favor, tente novamente.",errorFetchDetails:"Não é possível carregar os detalhes do endereço. Por favor, tente novamente.",errorNetwork:"Erro de rede. Verifique sua conexão e tente novamente.",validationRequired:"Este campo é obrigatório",validationPattern:"Formato inválido",validationSaudiFormat:"Por favor, insira um endereço nacional saudita válido (formato: AAAA1234)"},ru:{placeholder:"Поиск адреса...",noResults:"Адрес для этого поиска не найден. Попробуйте другие ключевые слова.",errorFetchPredictions:"Невозможно выполнить поиск адресов. Пожалуйста, попробуйте еще раз.",errorFetchDetails:"Невозможно загрузить детали адреса. Пожалуйста, попробуйте еще раз.",errorNetwork:"Ошибка сети. Проверьте соединение и попробуйте еще раз.",validationRequired:"Это поле обязательно",validationPattern:"Неверный формат",validationSaudiFormat:"Пожалуйста, введите действительный национальный адрес Саудовской Аравии (формат: AAAA1234)"},ja:{placeholder:"住所を検索...",noResults:"この検索では住所が見つかりませんでした。別のキーワードをお試しください。",errorFetchPredictions:"住所を検索できません。もう一度お試しください。",errorFetchDetails:"住所の詳細を読み込めません。もう一度お試しください。",errorNetwork:"ネットワークエラー。接続を確認してもう一度お試しください。",validationRequired:"この項目は必須です",validationPattern:"無効な形式",validationSaudiFormat:"有効なサウジアラビアの国内住所を入力してください(形式:AAAA1234)"},zh:{placeholder:"搜索地址...",noResults:"未找到此搜索的地址。请尝试不同的关键词。",errorFetchPredictions:"无法搜索地址。请重试。",errorFetchDetails:"无法加载地址详情。请重试。",errorNetwork:"网络错误。请检查您的连接并重试。",validationRequired:"此字段为必填项",validationPattern:"格式无效",validationSaudiFormat:"请输入有效的沙特国家地址(格式:AAAA1234)"},ko:{placeholder:"주소 검색...",noResults:"이 검색에 대한 주소를 찾을 수 없습니다. 다른 키워드를 시도해보세요.",errorFetchPredictions:"주소를 검색할 수 없습니다. 다시 시도해주세요.",errorFetchDetails:"주소 세부정보를 불러올 수 없습니다. 다시 시도해주세요.",errorNetwork:"네트워크 오류입니다. 연결을 확인하고 다시 시도해주세요.",validationRequired:"이 필드는 필수입니다",validationPattern:"유효하지 않은 형식",validationSaudiFormat:"유효한 사우디 국가 주소를 입력하세요 (형식: AAAA1234)"},hi:{placeholder:"पता खोजें...",noResults:"इस खोज के लिए कोई पता नहीं मिला। विभिन्न कीवर्ड आज़माएं।",errorFetchPredictions:"पते खोजने में असमर्थ। कृपया पुनः प्रयास करें।",errorFetchDetails:"पते का विवरण लोड करने में असमर्थ। कृपया पुनः प्रयास करें।",errorNetwork:"नेटवर्क त्रुटि। कृपया अपना कनेक्शन जांचें और पुनः प्रयास करें।",validationRequired:"यह फ़ील्ड आवश्यक है",validationPattern:"अमान्य प्रारूप",validationSaudiFormat:"कृपया एक मान्य सऊदी राष्ट्रीय पता दर्ज करें (प्रारूप: AAAA1234)"},tr:{placeholder:"Adres ara...",noResults:"Bu arama için adres bulunamadı. Farklı anahtar kelimeler deneyin.",errorFetchPredictions:"Adresler aranamıyor. Lütfen tekrar deneyin.",errorFetchDetails:"Adres detayları yüklenemiyor. Lütfen tekrar deneyin.",errorNetwork:"Ağ hatası. Lütfen bağlantınızı kontrol edin ve tekrar deneyin.",validationRequired:"Bu alan zorunludur",validationPattern:"Geçersiz format",validationSaudiFormat:"Lütfen geçerli bir Suudi ulusal adresi girin (format: AAAA1234)"}};function We(t="en"){return Ke[t]||Ke.en}var Ye=Object.defineProperty,Je=Object.getOwnPropertyDescriptor,Qe=(t,e,i,s)=>{for(var r,o=s>1?void 0:s?Je(e,i):e,a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s?r(e,i,o):r(o))||o);return s&&o&&Ye(e,i,o),o};let Xe=class extends Be{constructor(){super(),this.proxyUrl="https://api.salla.dev",this.authToken=null,this.placeholder="",this.defaultPlace="",this.label=null,this.className="",this.language="en",this.dir="auto",this.mode="search",this.name="",this.required=!1,this.pattern=null,this.tooltip=null,this.selectedId=null,this.errors=[],this.disabled=!1,this._value="",this._country=null,this.locationBias=null,this.locationRestriction=null,this.types=null,this._fields=["formatted_address","geometry"],this.strictBounds=!1,this.useSessionToken=!0,this.resolve=!1,this.onValidateAddress=null,this.debounceDelay=300,this.minChars=3,this.predictions=[],this.isOpen=!1,this.isLoading=!1,this.error=null,this.activeIndex=-1,this.inputValue="",this.sessionToken=null,this.validationError=null,this.touched=!1,this.showNationalAddressIcon=!1,this.abortController=null,this._internals=this.attachInternals()}set value(t){const e=this._value;this._value=t||"",this.requestUpdate("value",e)}get value(){return this._value}set country(t){this._country=null==t?null:Array.isArray(t)?t.filter((t=>t&&t.trim())).map((t=>t.trim())):t.split(",").map((t=>t.trim())).filter((t=>t))}get country(){return this._country}set fieldsStr(t){this._fields=t?t.split(",").map((t=>t.trim())).filter((t=>t)):["formatted_address","geometry"]}get fieldsStr(){return this._fields.join(",")}set fields(t){this._fields=t&&t.length>0?t:["formatted_address","geometry"]}get fields(){return this._fields}connectedCallback(){super.connectedCallback(),this.createNewSession(),this.initializeDebounce()}disconnectedCallback(){super.disconnectedCallback(),this.terminateSession(),this.cancelPendingRequest()}initializeDebounce(){this.debouncedFetch=function(t,e){let i=null;return function(...s){i&&clearTimeout(i),i=setTimeout((()=>{t.apply(this,s)}),e)}}(this.fetchPredictions.bind(this),this.debounceDelay)}firstUpdated(){const t=this.value||this.defaultPlace||"";t&&(this.inputValue=t,this.isSaudiFormMode()&&this.isShortAddressFormat(t)&&(this.showNationalAddressIcon=!0))}$nextTick(t){Promise.resolve().then(t)}isShortAddressFormat(t){return/^[a-zA-Z]{4}\d{4}$/.test(t?.trim())}updated(t){if(t.has("value")){const t=this.value||"";t!==this.inputValue&&(this.inputValue=t,this.showNationalAddressIcon=!!(this.isSaudiFormMode()&&t&&this.isShortAddressFormat(t)))}t.has("defaultPlace")&&!this.value&&this.defaultPlace!==this.inputValue&&(this.inputValue=this.defaultPlace||"",this.showNationalAddressIcon=!!(this.isSaudiFormMode()&&this.defaultPlace&&this.isShortAddressFormat(this.defaultPlace))),t.has("selectedId")&&this.selectedId&&this.selectedId!==this.inputValue&&this.isSaudiFormMode()&&this.isShortAddressFormat(this.selectedId)&&(this.inputValue=this.selectedId||"",this.showNationalAddressIcon=!0,this._internals.setFormValue(this.selectedId||"")),t.has("debounceDelay")&&this.initializeDebounce()}createNewSession(){this.useSessionToken&&(this.sessionToken=typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){const e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)})))}terminateSession(){this.sessionToken=null}cancelPendingRequest(){this.abortController&&(this.abortController.abort(),this.abortController=null)}isSaudiFormMode(){return"form"===this.mode&&null!==this.country&&1===this.country.length&&"sa"===this.country[0].toLowerCase()}getWhatsAppLink(){return`https://wa.me/966112898888?text=${encodeURIComponent("العنوان الوطني")}`}renderWhatsAppIcon(){return ve`
26
+ <svg class="whatsapp-icon" viewBox="0 0 24 24" fill="currentColor" part="whatsapp-icon">
27
+ <path d="M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413z"/>
28
+ </svg>
29
+ `}getSaudiHelpTextContent(){return{helpText:"ar"===this.language?"لا تعرف العنوان الوطني؟":"Don't know your national address?",linkText:"ar"===this.language?"احصل على العنوان الوطني عبر الواتساب":"Get your national address via WhatsApp"}}renderSaudiFriendlyError(){let t,e;this.inputValue&&this.inputValue.trim().length>0?(t="العنوان الوطني المختصر غير صحيح (الصيغة: AAAA1234). يمكنك الحصول عليه بسهولة",e="The short national address format is incorrect (format: AAAA1234). You can easily get it"):(t="العنوان الوطني المختصر مطلوب. يمكنك الحصول عليه بسهولة",e="The short national address is required. You can easily get it");const i="ar"===this.language?"عبر الواتساب (اضغط هنا)":"via WhatsApp (click here)",s="ar"===this.language?"أو ابحث أعلاه":"or search above";return ve`
30
+ <span>
31
+ ${"ar"===this.language?t:e}
32
+ <a
33
+ href="${this.getWhatsAppLink()}"
34
+ target="_blank"
35
+ rel="noopener noreferrer"
36
+ class="whatsapp-link-inline"
37
+ part="whatsapp-link"
38
+ >
39
+ ${this.renderWhatsAppIcon()}
40
+ ${i}
41
+ </a>
42
+ ${s}
43
+ </span>
44
+ `}renderSaudiHelpText(){if(!this.isSaudiFormMode()||this.validationError||this.errors&&this.errors.length>0)return"";const t="ar"===this.language?"عبر الواتساب (اضغط هنا)":"via WhatsApp (click here)",e="ar"===this.language?"أو ابحث أعلاه":"or search above";return ve`
45
+ <div class="help-text" part="help-text">
46
+ <span>
47
+ ${"ar"===this.language?"لا تعرف العنوان الوطني؟ احصل عليه بسهولة":"Don't know your national address? Get it easily"}
48
+ <a
49
+ href="${this.getWhatsAppLink()}"
50
+ target="_blank"
51
+ rel="noopener noreferrer"
52
+ class="whatsapp-link-inline"
53
+ part="whatsapp-link"
54
+ >
55
+ ${this.renderWhatsAppIcon()}
56
+ ${t}
57
+ </a>
58
+ ${e}
59
+ </span>
60
+ </div>
61
+ `}async fetchPredictions(t){if(!t.trim())return this.predictions=[],this.isOpen=!1,void(this.isLoading=!1);if(t.trim().length<this.minChars)return this.predictions=[],this.isOpen=!1,void(this.isLoading=!1);this.cancelPendingRequest(),this.abortController=new AbortController;const e=this.abortController.signal;this.isLoading=!0,this.error=null;try{const i={input:t,language:this.language};this.sessionToken&&(i.sessiontoken=this.sessionToken),this.country&&this.country.length>0&&(i.country=this.country.join(",")),this.types&&this.types.length>0&&(i.types=this.types.join("|")),this.locationBias&&this.locationBias.radius&&this.locationBias.center&&(i.location=`${this.locationBias.center.lat},${this.locationBias.center.lng}`,i.radius=this.locationBias.radius.toString()),this.strictBounds&&(i.strictbounds="true");const s=new URLSearchParams(i),r=`${this.proxyUrl||""}/store/v1/checkout/address/autocomplete/query?${s.toString()}`,o={};this.authToken&&(o.Authorization=`Bearer ${this.authToken}`);const a=await fetch(r,{signal:e,headers:o});if(!a.ok)throw new Error(`HTTP ${a.status}: ${a.statusText}`);const l=await a.json();l.success&&Array.isArray(l.data)?(this.error=null,l.data.length>0?(this.predictions=l.data.map((t=>({place_id:t.id,description:t.description||t.formatted_address,formatted_address:t.formatted_address,short_address:t.short_address,structured_formatting:{main_text:t.formatted_address||t.description,main_text_matched_substrings:[],secondary_text:t.description||""},types:t.types||[],geometry:t.geometry,address_components:t.address_components}))),this.isOpen=!0,this.activeIndex=-1):(this.predictions=[],this.isOpen=!0)):(this.predictions=[],this.isOpen=!0)}catch(t){if(t instanceof Error&&"AbortError"===t.name)return;this.predictions=[],this.isOpen=!0}finally{this.isLoading=!1,this.abortController=null}}async fetchPlaceDetails(t){this.isLoading=!0,this.error=null;try{const e={place_id:t,language:this.language};this.fields&&this.fields.length>0&&(e.fields=this.fields.join(",")),this.sessionToken&&(e.sessiontoken=this.sessionToken),this.country&&this.country.length>0&&(e.country=this.country.join(",")),this.resolve&&(e.resolve="true");const i=new URLSearchParams(e),s=`${this.proxyUrl||""}/store/v1/checkout/address/autocomplete/details?${i.toString()}`,r={};this.authToken&&(r.Authorization=`Bearer ${this.authToken}`);const o=await fetch(s,{headers:r});if(!o.ok)throw new Error(`HTTP ${o.status}: ${o.statusText}`);const a=await o.json();return!a.success||a.message?(this.error=a.message||"Failed to fetch place details",null):a.success&&a.data&&a.data.id?{place_id:a.data.id,...a.data,components:a.data.address_components?.reduce(((t,e)=>(e.types?.forEach((i=>{t[i]||(t[i]=[]),t[i].push({long_name:e.long_name,short_name:e.short_name})})),t)),{})}:null}catch(t){console.error("Error fetching place details:",t);const e=We(this.language);return this.error=t instanceof Error?t.message:e.errorFetchDetails,null}finally{this.isLoading=!1}}async validateAddress(t){try{if(!t||!t.formatted_address)return console.error("Cannot validate address - place or formatted_address is missing"),null;if(!this.onValidateAddress||"function"!=typeof this.onValidateAddress)return console.error("onValidateAddress callback is required for address validation"),null;const e=He(t,this.country),i=await this.onValidateAddress({place:t,sessionToken:this.sessionToken,validationSupport:e});return this.terminateSession(),i}catch(t){return console.error("Error validating address:",t),this.terminateSession(),null}}getValidationSupport(t){return He(t,this.country)}checkValidity(){return this.validate()}reportValidity(){this.touched=!0;const t=this.validate();return t||this.dispatchEvent(new CustomEvent("invalid",{detail:{error:this.validationError},bubbles:!0,composed:!0})),t}reset(){this.inputValue="",this.selectedId=null,this.validationError=null,this.errors=[],this.touched=!1,this.predictions=[],this.isOpen=!1,this.error=null,this.showNationalAddressIcon=!1,"form"===this.mode&&(this._internals.setFormValue(null),this._internals.setValidity({}))}formResetCallback(){this.reset()}formStateRestoreCallback(t){t&&"form"===this.mode&&(this.selectedId=t)}validate(){if("form"!==this.mode)return!0;const t=We(this.language),e=this.inputValue||"";return this.required&&!e.trim()?(this.validationError=t.validationRequired,this._internals.setValidity({valueMissing:!0},this.validationError,this.inputElement),!1):this.isSaudiFormMode()&&e.trim()&&!this.isShortAddressFormat(e)?(this.validationError=t.validationSaudiFormat,this._internals.setValidity({patternMismatch:!0},this.validationError,this.inputElement),!1):this.pattern&&e.trim()&&!new RegExp(this.pattern).test(e)?(this.validationError=t.validationPattern,this._internals.setValidity({patternMismatch:!0},this.validationError,this.inputElement),!1):(this.validationError=null,this._internals.setValidity({}),!0)}normalizeNumerals(t){if(!t)return t;const e={"٠":"0","١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","०":"0","१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","۰":"0","۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9","০":"0","১":"1","২":"2","৩":"3","৪":"4","৫":"5","৬":"6","৭":"7","৮":"8","৯":"9"};return t.split("").map((t=>e[t]??t)).join("")}handleInput(t){if(this.disabled)return;const e=t.target,i=e.selectionStart??0,s=this.inputValue,r=e.value,o=this.normalizeNumerals(r);o!==r&&(e.value=o,requestAnimationFrame((()=>{e.setSelectionRange(i,i)}))),this.inputValue=o,this.touched=!0,this.showNationalAddressIcon&&(this.showNationalAddressIcon=!1),"form"===this.mode&&(this.validationError&&(this.validationError=null),this.selectedId=null,this._internals.setFormValue(this.inputValue||null),this.validate()),this.errors&&this.errors.length>0&&(this.errors=[]),this.inputValue.trim().length>=this.minChars&&(this.isLoading=!0),this.debouncedFetch(this.inputValue),this._value=this.inputValue,this.requestUpdate("value",s),this.dispatchEvent(new CustomEvent("input",{detail:{value:this.inputValue},bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.dispatchEvent(new InputEvent("input",{data:this.inputValue,bubbles:!0,composed:!0}))}async handleSelect(t){if(this.disabled)return;this.isSaudiFormMode()&&t.place_id&&this.isShortAddressFormat(t.place_id)?(this.inputValue=t.place_id,this.showNationalAddressIcon=!0):(this.inputValue=t.formatted_address,this.showNationalAddressIcon=!1),this.isOpen=!1,this.predictions=[],this.touched=!0;let e=null;if(e="form"===this.mode?await this.fetchPlaceDetails(t.place_id):t.geometry?.location?{place_id:t.place_id,formatted_address:t.formatted_address||t.description,geometry:t.geometry,types:t.types,address_components:t.address_components}:await this.fetchPlaceDetails(t.place_id),e){this.isSaudiFormMode()&&e.place_id&&this.isShortAddressFormat(e.place_id)?(this.inputValue=e.place_id,this.showNationalAddressIcon=!0):(e.formatted_address&&(this.inputValue=e.formatted_address),this.showNationalAddressIcon=!1),"form"===this.mode&&(this.selectedId=e.place_id,this._internals.setFormValue(this.inputValue),this.validate()),this._value=this.inputValue,this.dispatchEvent(new CustomEvent("input",{detail:{value:this.inputValue},bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}));const t=this.getValidationSupport(e);this.dispatchEvent(new CustomEvent("place-select",{detail:{place:e,validationSupport:t},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("place-changed",{detail:{place:e,validationSupport:t},bubbles:!0,composed:!0}))}}handleKeyDown(t){if(!this.disabled&&this.isOpen&&0!==this.predictions.length)switch(t.key){case"ArrowDown":t.preventDefault(),this.activeIndex=Math.min(this.activeIndex+1,this.predictions.length-1);break;case"ArrowUp":t.preventDefault(),this.activeIndex=Math.max(this.activeIndex-1,-1);break;case"Enter":t.preventDefault(),this.activeIndex>=0&&this.activeIndex<this.predictions.length&&this.handleSelect(this.predictions[this.activeIndex]);break;case"Escape":t.preventDefault(),this.isOpen=!1,this.activeIndex=-1}}handleBlur(){setTimeout((()=>{this.isOpen=!1,this.activeIndex=-1,"form"===this.mode&&this.touched&&this.validate(),this.dispatchEvent(new Event("blur",{bubbles:!0,composed:!0}))}),200)}handleFocus(){this.disabled||this.predictions.length>0&&(this.isOpen=!0)}renderLocationIcon(){return ve`
62
+ <svg class="location-icon" fill="currentColor" viewBox="0 0 20 20">
63
+ <path fill-rule="evenodd" d="M5.05 4.05a7 7 0 119.9 9.9L10 18.9l-4.95-4.95a7 7 0 010-9.9zM10 11a2 2 0 100-4 2 2 0 000 4z" clip-rule="evenodd" />
64
+ </svg>
65
+ `}renderTooltip(){return this.tooltip?ve`
66
+ <span class="tooltip-toggle" part="tooltip-toggle">
67
+ <svg class="tooltip-icon" part="tooltip-icon" fill="none" viewBox="0 0 24 24" stroke="currentColor">
68
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" />
69
+ </svg>
70
+ <span class="tooltip-content" part="tooltip-content">${this.tooltip}</span>
71
+ </span>
72
+ `:""}renderPrediction(t,e){const i={"dropdown-item":!0,active:e===this.activeIndex};let s=t.structured_formatting.main_text;return t.short_address&&s.includes(t.short_address)&&(s=s.replace(t.short_address,"").trim(),s=s.replace(/\s*,\s*,\s*/g,", ").replace(/^\s*,\s*|\s*,\s*$/g,"").trim()),ve`
73
+ <div
74
+ class=${qe(i)}
75
+ part="dropdown-item ${e===this.activeIndex?"dropdown-item-active":""}"
76
+ @click=${()=>this.handleSelect(t)}
77
+ role="option"
78
+ aria-selected=${e===this.activeIndex}
79
+ >
80
+ ${this.renderLocationIcon()}
81
+ <div class="place-info" part="place-info">
82
+ <div class="main-text" part="main-text">
83
+ ${t.short_address?ve`
84
+ <span class="national-address-badge" part="national-address-badge">
85
+ <img
86
+ src="https://cdn.salla.network/images/shipping/png/national-address-icon-small-min.png"
87
+ alt="national address icon"
88
+ class="national-address-icon"
89
+ />
90
+ <span class="national-address-text">${t.short_address}</span>
91
+ <span class="national-address-separator">-</span>
92
+ </span>
93
+ `:""}
94
+ ${s}
95
+ </div>
96
+ ${t.structured_formatting.secondary_text?ve`
97
+ <div class="secondary-text" part="secondary-text">
98
+ ${t.structured_formatting.secondary_text}
99
+ </div>
100
+ `:""}
101
+ </div>
102
+ </div>
103
+ `}render(){const t={dropdown:!0,open:this.isOpen},e={"is-invalid":!("form"!==this.mode||!this.validationError)||this.errors&&this.errors.length>0,"with-national-icon":this.showNationalAddressIcon},i={required:"form"===this.mode&&this.required},s=We(this.language),r="auto"===this.dir?function(t){return["ar"].includes(t)}(this.language)?"rtl":"ltr":this.dir,o=this.placeholder||s.placeholder,a=this.name||"salla-address-search";return ve`
104
+ <div class="wrapper ${this.className}" part="wrapper" dir="${r}">
105
+ <div class="input-container" part="input-container">
106
+ ${this.label?ve`
107
+ <label part="label" class=${qe(i)}>
108
+ <span class="label-content">
109
+ <span>${this.label}</span>
110
+ ${this.renderTooltip()}
111
+ </span>
112
+ </label>
113
+ `:""}
114
+ <div class="input-wrapper">
115
+ <input
116
+ part="input"
117
+ class=${qe(e)}
118
+ type="text"
119
+ name="${a}"
120
+ .value=${Ge(this.inputValue)}
121
+ placeholder=${o}
122
+ ?disabled=${this.disabled}
123
+ @input=${this.handleInput}
124
+ @keydown=${this.handleKeyDown}
125
+ @blur=${this.handleBlur}
126
+ @focus=${this.handleFocus}
127
+ role="combobox"
128
+ aria-expanded=${this.isOpen}
129
+ aria-autocomplete="list"
130
+ aria-controls="predictions-list"
131
+ aria-invalid=${"form"===this.mode&&this.validationError||this.errors&&this.errors.length>0?"true":"false"}
132
+ aria-required=${"form"===this.mode&&this.required?"true":"false"}
133
+ autocomplete="off"
134
+ autocorrect="off"
135
+ autocapitalize="off"
136
+ spellcheck="false"
137
+ />
138
+ ${this.isLoading?ve`<div class="loading-spinner" part="spinner"></div>`:""}
139
+
140
+ <div
141
+ id="predictions-list"
142
+ class=${qe(t)}
143
+ part="dropdown"
144
+ role="listbox"
145
+ >
146
+ ${this.predictions.length>0?this.predictions.map(((t,e)=>this.renderPrediction(t,e))):this.inputValue&&!this.isLoading?ve`<div class="no-results" part="no-results">${s.noResults}</div>`:""}
147
+ </div>
148
+ </div>
149
+ ${"form"===this.mode&&this.validationError?ve`
150
+ <div class="validation-error" part="validation-error">
151
+ ${this.isSaudiFormMode()?this.renderSaudiFriendlyError():ve`<span>${this.validationError}</span>`}
152
+ </div>
153
+ `:""}
154
+ ${this.errors&&this.errors.length>0?ve`
155
+ <div class="validation-error" part="validation-error">${this.errors[0]}</div>
156
+ `:""}
157
+ ${this.error?ve`<div class="error-message" part="error">${this.error}</div>`:""}
158
+ ${this.renderSaudiHelpText()}
159
+ </div>
160
+ </div>
161
+ `}};Xe.formAssociated=!0,Xe.styles=((t,...e)=>{const i=1===t.length?t[0]:e.reduce(((e,i,s)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[s+1]),t[0]);return new jt(i,t,Bt)})`
162
+ :host {
163
+ display: block;
164
+ position: relative;
165
+ font-family: var(--salla-autocomplete-font-family, system-ui, -apple-system, sans-serif);
166
+ }
167
+
168
+ .wrapper {
169
+ position: relative;
170
+ }
171
+
172
+ .input-container {
173
+ display: flex;
174
+ flex-direction: column;
175
+ }
176
+
177
+ .input-wrapper {
178
+ position: relative;
179
+ }
180
+
181
+ label {
182
+ display: block;
183
+ margin-bottom: var(--salla-autocomplete-label-margin, 0.5rem);
184
+ font-size: var(--salla-autocomplete-label-font-size, 0.875rem);
185
+ font-weight: var(--salla-autocomplete-label-font-weight, 500);
186
+ color: var(--salla-autocomplete-label-color, #374151);
187
+ }
188
+
189
+ label.required::after {
190
+ content: ' *';
191
+ color: var(--salla-autocomplete-required-color, #dc2626);
192
+ }
193
+
194
+ .label-content {
195
+ display: inline-flex;
196
+ align-items: center;
197
+ gap: 0.5rem;
198
+ }
199
+
200
+ .tooltip-toggle {
201
+ position: relative;
202
+ display: inline-flex;
203
+ align-items: center;
204
+ cursor: help;
205
+ }
206
+
207
+ .tooltip-icon {
208
+ width: 1rem;
209
+ height: 1rem;
210
+ color: var(--salla-autocomplete-tooltip-icon-color, #6b7280);
211
+ }
212
+
213
+ .tooltip-content {
214
+ display: none;
215
+ position: absolute;
216
+ bottom: 125%;
217
+ left: 50%;
218
+ transform: translateX(-50%);
219
+ background: var(--salla-autocomplete-tooltip-bg, #1f2937);
220
+ color: var(--salla-autocomplete-tooltip-color, white);
221
+ padding: 0.5rem 0.75rem;
222
+ border-radius: 0.375rem;
223
+ font-size: 0.75rem;
224
+ line-height: 1.4;
225
+ white-space: nowrap;
226
+ z-index: 1000;
227
+ box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
228
+ }
229
+
230
+ .tooltip-content::after {
231
+ content: '';
232
+ position: absolute;
233
+ top: 100%;
234
+ left: 50%;
235
+ transform: translateX(-50%);
236
+ border: 5px solid transparent;
237
+ border-top-color: var(--salla-autocomplete-tooltip-bg, #1f2937);
238
+ }
239
+
240
+ .tooltip-toggle:hover .tooltip-content,
241
+ .tooltip-toggle:focus .tooltip-content {
242
+ display: block;
243
+ }
244
+
245
+ input {
246
+ width: 100%;
247
+ padding-block: 0.75rem;
248
+ padding-inline-start: var(--salla-autocomplete-input-padding-start, 0.875rem);
249
+ padding-inline-end: var(--salla-autocomplete-input-padding-end, 2.75rem);
250
+ font-family: var(--salla-autocomplete-font-family, system-ui, -apple-system, sans-serif);
251
+ font-size: var(--salla-autocomplete-input-font-size, 1rem);
252
+ line-height: var(--salla-autocomplete-input-line-height, 1.5);
253
+ border: var(--salla-autocomplete-input-border, 1px solid #d1d5db);
254
+ border-radius: var(--salla-autocomplete-input-border-radius, 0.5rem);
255
+ background: var(--salla-autocomplete-input-background, white);
256
+ color: var(--salla-autocomplete-input-color, #111827);
257
+ outline: none;
258
+ transition: all 0.2s;
259
+ box-sizing: border-box;
260
+ height: var(--salla-autocomplete-input-height, auto);
261
+ min-height: var(--salla-autocomplete-input-height, 44px);
262
+ -webkit-appearance: none;
263
+ appearance: none;
264
+ }
265
+
266
+ input.with-national-icon {
267
+ padding-inline-start: var(--salla-autocomplete-input-padding-start-icon, 2rem);
268
+ background-image: url('https://cdn.salla.network/images/shipping/png/national-address-icon-small-min.png');
269
+ background-repeat: no-repeat;
270
+ background-position: 0.75rem center;
271
+ background-size: 16px;
272
+ }
273
+
274
+ input.with-national-icon[dir="rtl"],
275
+ :host([dir="rtl"]) input.with-national-icon {
276
+ padding-inline-start: var(--salla-autocomplete-input-padding-start, 0.875rem);
277
+ padding-inline-end: var(--salla-autocomplete-input-padding-end-icon, 2.75rem);
278
+ background-position: calc(100% - 0.75rem) center;
279
+ }
280
+
281
+ @media (max-width: 640px) {
282
+ input {
283
+ font-size: var(--salla-autocomplete-input-font-size-mobile, 16px);
284
+ padding-block: 0.75rem;
285
+ padding-inline-start: var(--salla-autocomplete-input-padding-start-mobile, 0.875rem);
286
+ padding-inline-end: var(--salla-autocomplete-input-padding-end-mobile, 2.75rem);
287
+ min-height: 44px;
288
+ touch-action: manipulation;
289
+ }
290
+
291
+ input.with-national-icon {
292
+ padding-inline-start: var(--salla-autocomplete-input-padding-start-icon-mobile, 2rem);
293
+ background-position: 0.875rem center;
294
+ }
295
+
296
+ input.with-national-icon[dir="rtl"],
297
+ :host([dir="rtl"]) input.with-national-icon {
298
+ padding-inline-start: var(--salla-autocomplete-input-padding-start-mobile, 0.875rem);
299
+ padding-inline-end: var(--salla-autocomplete-input-padding-end-icon-mobile, 2.75rem);
300
+ background-position: calc(100% - 0.875rem) center;
301
+ }
302
+ }
303
+
304
+ input:focus {
305
+ border-color: var(--salla-autocomplete-input-focus-border-color, #3b82f6);
306
+ box-shadow: var(--salla-autocomplete-input-focus-shadow, 0 0 0 3px rgba(59, 130, 246, 0.1));
307
+ }
308
+
309
+ input:disabled {
310
+ background-color: var(--salla-autocomplete-input-disabled-bg, #f3f4f6);
311
+ cursor: not-allowed;
312
+ }
313
+
314
+ input.is-invalid {
315
+ border-color: var(--salla-autocomplete-input-error-border-color, #dc2626);
316
+ }
317
+
318
+ input.is-invalid:focus {
319
+ border-color: var(--salla-autocomplete-input-error-border-color, #dc2626);
320
+ box-shadow: var(--salla-autocomplete-input-error-shadow, 0 0 0 3px rgba(220, 38, 38, 0.1));
321
+ }
322
+
323
+ input::placeholder {
324
+ color: var(--salla-autocomplete-input-placeholder-color, #9ca3af);
325
+ }
326
+
327
+ .validation-error {
328
+ display: flex;
329
+ flex-wrap: wrap;
330
+ align-items: center;
331
+ gap: 0.5rem;
332
+ margin-top: 0.375rem;
333
+ font-size: var(--salla-autocomplete-error-font-size, 0.875rem);
334
+ color: var(--salla-autocomplete-error-color, #dc2626);
335
+ line-height: 1.5;
336
+ }
337
+
338
+ .validation-error > span {
339
+ line-height: 1.5;
340
+ }
341
+
342
+ .whatsapp-link-inline {
343
+ color: var(--salla-autocomplete-whatsapp-brand-color, #25D366);
344
+ white-space: nowrap;
345
+ line-height: inherit;
346
+ display: inline-flex;
347
+ align-items: center;
348
+ vertical-align: middle;
349
+ text-decoration: underline;
350
+ cursor: pointer;
351
+ transition: all 0.2s ease;
352
+ gap: 0.25rem;
353
+ margin-inline: 0.25rem;
354
+ font-weight: 500;
355
+ }
356
+
357
+ .whatsapp-link-inline:hover {
358
+ color: var(--salla-autocomplete-whatsapp-brand-hover, #1da851);
359
+ opacity: 0.9;
360
+ }
361
+
362
+ .whatsapp-link-inline:active {
363
+ transform: scale(0.98);
364
+ }
365
+
366
+ .whatsapp-link-inline .whatsapp-icon {
367
+ color: var(--salla-autocomplete-whatsapp-brand-color, #25D366);
368
+ }
369
+
370
+ .help-text {
371
+ display: block;
372
+ margin-top: 0.5rem;
373
+ font-size: var(--salla-autocomplete-help-font-size, 0.875rem);
374
+ color: var(--salla-autocomplete-help-color, #6b7280);
375
+ line-height: 1.5;
376
+ }
377
+
378
+ .help-text span {
379
+ line-height: 1.5;
380
+ }
381
+
382
+ .whatsapp-icon {
383
+ width: 1rem;
384
+ height: 1rem;
385
+ }
386
+
387
+ .loading-spinner {
388
+ position: absolute;
389
+ inset-inline-end: 0.875rem;
390
+ top: 50%;
391
+ transform: translateY(-50%);
392
+ width: var(--salla-autocomplete-spinner-size, 1.25rem);
393
+ height: var(--salla-autocomplete-spinner-size, 1.25rem);
394
+ border: 2px solid var(--salla-autocomplete-spinner-border-color, #e5e7eb);
395
+ border-top-color: var(--salla-autocomplete-spinner-color, #3b82f6);
396
+ border-radius: 50%;
397
+ animation: spin 0.6s linear infinite;
398
+ }
399
+
400
+ @media (max-width: 640px) {
401
+ .loading-spinner {
402
+ width: var(--salla-autocomplete-spinner-size-mobile, 1.375rem);
403
+ height: var(--salla-autocomplete-spinner-size-mobile, 1.375rem);
404
+ inset-inline-end: 1rem;
405
+ }
406
+ }
407
+
408
+ @keyframes spin {
409
+ to { transform: translateY(-50%) rotate(360deg); }
410
+ }
411
+
412
+ /* Custom scrollbar styling */
413
+ .dropdown::-webkit-scrollbar {
414
+ width: 6px;
415
+ }
416
+
417
+ .dropdown::-webkit-scrollbar-track {
418
+ background: #f1f1f1;
419
+ border-radius: 3px;
420
+ }
421
+
422
+ .dropdown::-webkit-scrollbar-thumb {
423
+ background: #c1c1c1;
424
+ border-radius: 3px;
425
+ }
426
+
427
+ .dropdown::-webkit-scrollbar-thumb:hover {
428
+ background: #a8a8a8;
429
+ }
430
+
431
+ .dropdown {
432
+ position: absolute;
433
+ top: 100%;
434
+ left: 0;
435
+ right: 0;
436
+ margin-top: var(--salla-autocomplete-dropdown-margin-top, 0.375rem);
437
+ background: var(--salla-autocomplete-dropdown-background, white);
438
+ border: var(--salla-autocomplete-dropdown-border, 1px solid #e5e7eb);
439
+ border-radius: var(--salla-autocomplete-dropdown-border-radius, 0.5rem);
440
+ box-shadow: var(--salla-autocomplete-dropdown-shadow, 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1));
441
+ max-height: var(--salla-autocomplete-dropdown-max-height, 240px);
442
+ overflow-y: auto;
443
+ overflow-x: hidden;
444
+ z-index: var(--salla-autocomplete-dropdown-z-index, 100);
445
+ display: none;
446
+ -webkit-overflow-scrolling: touch;
447
+ overscroll-behavior: contain;
448
+ scroll-behavior: smooth;
449
+ }
450
+
451
+ @media (max-width: 640px) {
452
+ .dropdown {
453
+ max-height: var(--salla-autocomplete-dropdown-max-height-mobile, 25vh);
454
+ border-radius: var(--salla-autocomplete-dropdown-border-radius-mobile, 0.5rem);
455
+ margin-top: var(--salla-autocomplete-dropdown-margin-top-mobile, 0.25rem);
456
+ }
457
+ }
458
+
459
+ @media (max-width: 640px) and (max-height: 667px) {
460
+ /* Smaller phones (iPhone SE, iPhone 8, etc.) */
461
+ .dropdown {
462
+ max-height: var(--salla-autocomplete-dropdown-max-height-small, 22vh);
463
+ }
464
+ }
465
+
466
+ @media (max-width: 640px) and (min-height: 668px) and (max-height: 896px) {
467
+ /* Standard phones (iPhone 12, iPhone 13, etc.) */
468
+ .dropdown {
469
+ max-height: var(--salla-autocomplete-dropdown-max-height-standard, 28vh);
470
+ }
471
+ }
472
+
473
+ @media (max-width: 640px) and (min-height: 897px) {
474
+ /* Larger phones (iPhone 14 Pro Max, etc.) */
475
+ .dropdown {
476
+ max-height: var(--salla-autocomplete-dropdown-max-height-large, 30vh);
477
+ }
478
+ }
479
+
480
+ .dropdown.open {
481
+ display: block;
482
+ }
483
+
484
+ .dropdown-item {
485
+ display: flex;
486
+ align-items: flex-start;
487
+ padding: var(--salla-autocomplete-item-padding, 0.625rem 0.75rem);
488
+ cursor: pointer;
489
+ transition: background-color 0.15s;
490
+ border-bottom: 1px solid var(--salla-autocomplete-item-border-color, #e5e7eb);
491
+ min-height: 35px;
492
+ -webkit-tap-highlight-color: transparent;
493
+ }
494
+
495
+ @media (max-width: 640px) {
496
+ .dropdown-item {
497
+ padding: var(--salla-autocomplete-item-padding-mobile, 0.75rem 0.875rem);
498
+ min-height: 35px;
499
+ }
500
+ }
501
+
502
+ .dropdown-item:last-child {
503
+ border-bottom: none;
504
+ }
505
+
506
+ .dropdown-item:hover,
507
+ .dropdown-item.selected {
508
+ background-color: var(--salla-autocomplete-item-hover-bg, #f9fafb);
509
+ }
510
+
511
+ .dropdown-item.active {
512
+ background-color: var(--salla-autocomplete-item-active-bg, #eff6ff);
513
+ }
514
+
515
+ @media (hover: none) and (pointer: coarse) {
516
+ .dropdown-item:hover {
517
+ background-color: transparent;
518
+ }
519
+
520
+ .dropdown-item:active {
521
+ background-color: var(--salla-autocomplete-item-active-bg, #eff6ff);
522
+ }
523
+ }
524
+
525
+ .location-icon {
526
+ display: none;
527
+ }
528
+
529
+ .place-info {
530
+ flex: 1;
531
+ min-width: 0;
532
+ display: flex;
533
+ flex-direction: column;
534
+ gap: 0.25rem;
535
+ }
536
+
537
+ .main-text {
538
+ font-size: var(--salla-autocomplete-main-text-font-size, 0.875rem);
539
+ font-weight: var(--salla-autocomplete-main-text-font-weight, 600);
540
+ color: var(--salla-autocomplete-main-text-color, #111827);
541
+ line-height: 1.4;
542
+ word-wrap: break-word;
543
+ overflow-wrap: break-word;
544
+ hyphens: auto;
545
+ }
546
+
547
+ @media (max-width: 640px) {
548
+ .main-text {
549
+ font-size: var(--salla-autocomplete-main-text-font-size-mobile, 0.9375rem);
550
+ line-height: 1.3;
551
+ }
552
+ }
553
+
554
+ .main-text .highlight {
555
+ font-weight: var(--salla-autocomplete-highlight-font-weight, 700);
556
+ color: var(--salla-autocomplete-highlight-color, inherit);
557
+ }
558
+
559
+ .national-address-badge {
560
+ display: inline-flex;
561
+ align-items: center;
562
+ font-size: 0.8125rem;
563
+ line-height: 1;
564
+ vertical-align: middle;
565
+ }
566
+
567
+ .national-address-icon {
568
+ width: 11px;
569
+ height: auto;
570
+ flex-shrink: 0;
571
+ display: inline-block;
572
+ }
573
+
574
+ .national-address-text {
575
+ padding-inline-start: 3px;
576
+ -webkit-text-fill-color: transparent;
577
+ background-clip: text;
578
+ -webkit-background-clip: text;
579
+ background-image: linear-gradient(135deg, #0052cc, #00b8d9 50%, #36b37e);
580
+ font-weight: 600;
581
+ display: inline-block;
582
+ }
583
+
584
+ .national-address-separator {
585
+ padding-inline: 4px;
586
+ color: #6b7280;
587
+ display: inline-block;
588
+ }
589
+
590
+ .secondary-text {
591
+ font-size: var(--salla-autocomplete-secondary-text-font-size, 0.75rem);
592
+ color: var(--salla-autocomplete-secondary-text-color, #6b7280);
593
+ line-height: 1.4;
594
+ word-wrap: break-word;
595
+ overflow-wrap: break-word;
596
+ hyphens: auto;
597
+ }
598
+
599
+ @media (max-width: 640px) {
600
+ .secondary-text {
601
+ font-size: var(--salla-autocomplete-secondary-text-font-size-mobile, 0.8125rem);
602
+ line-height: 1.3;
603
+ }
604
+ }
605
+
606
+ .error-message {
607
+ margin-top: 0.5rem;
608
+ font-size: var(--salla-autocomplete-error-font-size, 0.875rem);
609
+ color: var(--salla-autocomplete-error-color, #dc2626);
610
+ }
611
+
612
+ .no-results {
613
+ padding: 1rem;
614
+ text-align: start;
615
+ color: var(--salla-autocomplete-no-results-color, #6b7280);
616
+ font-size: var(--salla-autocomplete-no-results-font-size, 0.875rem);
617
+ }
618
+
619
+ .no-results.error-state {
620
+ color: var(--salla-autocomplete-error-color, #dc2626);
621
+ background-color: var(--salla-autocomplete-error-bg, #fef2f2);
622
+ border-radius: 0.375rem;
623
+ margin: 0.5rem;
624
+ padding: 0.875rem;
625
+ }
626
+
627
+ @media (max-width: 640px) {
628
+ .no-results {
629
+ padding: 0.875rem;
630
+ font-size: var(--salla-autocomplete-no-results-font-size-mobile, 0.8125rem);
631
+ }
632
+
633
+ .no-results.error-state {
634
+ margin: 0.375rem;
635
+ padding: 0.75rem;
636
+ }
637
+ }
638
+ `,Qe([Ne({type:String})],Xe.prototype,"proxyUrl",2),Qe([Ne({type:String})],Xe.prototype,"authToken",2),Qe([Ne({type:String})],Xe.prototype,"placeholder",2),Qe([Ne({type:String})],Xe.prototype,"defaultPlace",2),Qe([Ne({type:String})],Xe.prototype,"label",2),Qe([Ne({type:String})],Xe.prototype,"className",2),Qe([Ne({type:String})],Xe.prototype,"language",2),Qe([Ne({type:String})],Xe.prototype,"dir",2),Qe([Ne({type:String})],Xe.prototype,"mode",2),Qe([Ne({type:String})],Xe.prototype,"name",2),Qe([Ne({type:Boolean})],Xe.prototype,"required",2),Qe([Ne({type:String})],Xe.prototype,"pattern",2),Qe([Ne({type:String})],Xe.prototype,"tooltip",2),Qe([Ne({type:String})],Xe.prototype,"selectedId",2),Qe([Ne({type:Array})],Xe.prototype,"errors",2),Qe([Ne({type:Boolean})],Xe.prototype,"disabled",2),Qe([Ne({type:String})],Xe.prototype,"value",1),Qe([Ne({type:String})],Xe.prototype,"country",1),Qe([Ne({type:Object})],Xe.prototype,"locationBias",2),Qe([Ne({type:Object})],Xe.prototype,"locationRestriction",2),Qe([Ne({type:Array})],Xe.prototype,"types",2),Qe([Ne({type:String})],Xe.prototype,"fieldsStr",1),Qe([Ne({type:Array})],Xe.prototype,"fields",1),Qe([Ne({type:Boolean})],Xe.prototype,"strictBounds",2),Qe([Ne({type:Boolean})],Xe.prototype,"useSessionToken",2),Qe([Ne({type:Boolean})],Xe.prototype,"resolve",2),Qe([Ne({type:Function})],Xe.prototype,"onValidateAddress",2),Qe([Ne({type:Number})],Xe.prototype,"debounceDelay",2),Qe([Ne({type:Number})],Xe.prototype,"minChars",2),Qe([Ue()],Xe.prototype,"predictions",2),Qe([Ue()],Xe.prototype,"isOpen",2),Qe([Ue()],Xe.prototype,"isLoading",2),Qe([Ue()],Xe.prototype,"error",2),Qe([Ue()],Xe.prototype,"activeIndex",2),Qe([Ue()],Xe.prototype,"inputValue",2),Qe([Ue()],Xe.prototype,"sessionToken",2),Qe([Ue()],Xe.prototype,"validationError",2),Qe([Ue()],Xe.prototype,"touched",2),Qe([Ue()],Xe.prototype,"showNationalAddressIcon",2),Qe([(t,e)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Reflect.decorate&&"object"!=typeof e&&Object.defineProperty(t,e,i),i))(t,e,{get(){return(t=>t.renderRoot?.querySelector("input")??null)(this)}})],Xe.prototype,"inputElement",2),Xe=Qe([(t=>(e,i)=>{void 0!==i?i.addInitializer((()=>{customElements.define(t,e)})):customElements.define(t,e)})("salla-address-autocomplete")],Xe);let ti=!1;const ei=new Map,ii=new Promise(((t,e)=>{typeof window>"u"?t():(window.googleMapsInitCallback=t,window.gm_authFailure=()=>{e(new Error("Google Maps authentication failed"))})})),si=t=>(e,i)=>{void 0!==i?i.addInitializer((()=>{customElements.define(t,e)})):customElements.define(t,e)},ri=globalThis,oi=ri.ShadowRoot&&(void 0===ri.ShadyCSS||ri.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,ai=Symbol(),li=new WeakMap;let ni=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==ai)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(oi&&void 0===t){const i=void 0!==e&&1===e.length;i&&(t=li.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&li.set(e,t))}return t}toString(){return this.cssText}};const hi=oi?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return(t=>new ni("string"==typeof t?t:t+"",void 0,ai))(e)})(t):t,{is:di,defineProperty:ci,getOwnPropertyDescriptor:pi,getOwnPropertyNames:ui,getOwnPropertySymbols:bi,getPrototypeOf:mi}=Object,gi=globalThis,fi=gi.trustedTypes,vi=fi?fi.emptyScript:"",yi=gi.reactiveElementPolyfillSupport,wi={toAttribute(t,e){switch(e){case Boolean:t=t?vi:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let i=t;switch(e){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch{i=null}}return i}},xi=(t,e)=>!di(t,e),ki={attribute:!0,type:String,converter:wi,reflect:!1,useDefault:!1,hasChanged:xi};Symbol.metadata??=Symbol("metadata"),gi.litPropertyMetadata??=new WeakMap;class Si extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=ki){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){const i=this.getPropertyDescriptor(t,Symbol(),e);void 0!==i&&ci(this.prototype,t,i)}}static getPropertyDescriptor(t,e,i){const{get:s,set:r}=pi(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get:s,set(e){const o=s?.call(this);r?.call(this,e),this.requestUpdate(t,o,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??ki}static _$Ei(){if(this.hasOwnProperty("elementProperties"))return;const t=mi(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty("finalized"))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty("properties")){const t=this.properties,e=[...ui(t),...bi(t)];for(const i of e)this.createProperty(i,t[i])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,i]of e)this.elementProperties.set(t,i)}this._$Eh=new Map;for(const[t,e]of this.elementProperties){const i=this._$Eu(t,e);void 0!==i&&this._$Eh.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const t of i)e.unshift(hi(t))}else void 0!==t&&e.push(hi(t));return e}static _$Eu(t,e){const i=e.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)))}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const i of e.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((t,e)=>{if(oi)t.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const i of e){const e=document.createElement("style"),s=ri.litNonce;void 0!==s&&e.setAttribute("nonce",s),e.textContent=i.cssText,t.appendChild(e)}})(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((t=>t.hostConnected?.()))}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach((t=>t.hostDisconnected?.()))}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$ET(t,e){const i=this.constructor.elementProperties.get(t),s=this.constructor._$Eu(t,i);if(void 0!==s&&!0===i.reflect){const r=(void 0!==i.converter?.toAttribute?i.converter:wi).toAttribute(e,i.type);this._$Em=t,null==r?this.removeAttribute(s):this.setAttribute(s,r),this._$Em=null}}_$AK(t,e){const i=this.constructor,s=i._$Eh.get(t);if(void 0!==s&&this._$Em!==s){const t=i.getPropertyOptions(s),r="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:wi;this._$Em=s;const o=r.fromAttribute(e,t.type);this[s]=o??this._$Ej?.get(s)??o,this._$Em=null}}requestUpdate(t,e,i,s=!1,r){if(void 0!==t){const o=this.constructor;if(!1===s&&(r=this[t]),i??=o.getPropertyOptions(t),!((i.hasChanged??xi)(r,e)||i.useDefault&&i.reflect&&r===this._$Ej?.get(t)&&!this.hasAttribute(o._$Eu(t,i))))return;this.C(t,e,i)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(t,e,{useDefault:i,reflect:s,wrapped:r},o){i&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,o??e??this[t]),!0!==r||void 0!==o)||(this._$AL.has(t)||(this.hasUpdated||i||(e=void 0),this._$AL.set(t,e)),!0===s&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,i]of t){const{wrapped:t}=i,s=this[e];!0!==t||this._$AL.has(e)||void 0===s||this.C(e,void 0,i,s)}}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach((t=>t.hostUpdate?.())),this.update(e)):this._$EM()}catch(e){throw t=!1,this._$EM(),e}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach((t=>t.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach((t=>this._$ET(t,this[t]))),this._$EM()}updated(t){}firstUpdated(t){}}Si.elementStyles=[],Si.shadowRootOptions={mode:"open"},Si.elementProperties=new Map,Si.finalized=new Map,yi?.({ReactiveElement:Si}),(gi.reactiveElementVersions??=[]).push("2.1.2");const Ci={attribute:!0,type:String,converter:wi,reflect:!1,hasChanged:xi},_i=(t=Ci,e,i)=>{const{kind:s,metadata:r}=i;let o=globalThis.litPropertyMetadata.get(r);if(void 0===o&&globalThis.litPropertyMetadata.set(r,o=new Map),"setter"===s&&((t=Object.create(t)).wrapped=!0),o.set(i.name,t),"accessor"===s){const{name:s}=i;return{set(i){const r=e.get.call(this);e.set.call(this,i),this.requestUpdate(s,r,t,!0,i)},init(e){return void 0!==e&&this.C(s,void 0,t,e),e}}}if("setter"===s){const{name:s}=i;return function(i){const r=this[s];e.call(this,i),this.requestUpdate(s,r,t,!0,i)}}throw Error("Unsupported decorator location: "+s)};function zi(t){return(e,i)=>"object"==typeof i?_i(t,e,i):((t,e,i)=>{const s=e.hasOwnProperty(i);return e.constructor.createProperty(i,t),s?Object.getOwnPropertyDescriptor(e,i):void 0})(t,e,i)}function Ai(t){return zi({...t,state:!0,attribute:!1})}function $i(t){return(e,i)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Reflect.decorate&&"object"!=typeof e&&Object.defineProperty(t,e,i),i))(e,i,{get(){return(e=>e.renderRoot?.querySelector(t)??null)(this)}})}function Mi(t,e,i){const s=[];return e.forEach((e=>{if(!(t&&google&&google.maps&&google.maps.event))return;const r=google.maps.event.addListener(t,e,(t=>{i(e,t)}));s.push((()=>{r&&google.maps.event.removeListener(r)}))})),s}function Li(t){t.forEach((t=>t())),t.length=0}function Ei(t,e,i){if(!t)return;const s=`set${e.charAt(0).toUpperCase()}${e.slice(1)}`;"function"==typeof t[s]?t[s](i):e in t&&(t[e]=i)}const Ii={en:{buttonLabel:"Use my current location",errorTitle:"Unable to Access Location",closeButton:"Continue",loading:"Getting your location...",loadingInstructions:"Please allow location access in your browser to continue",timerMessage:"This message will auto-hide in 7 seconds or click Continue",permissionDenied:"Location access was denied. Please enable location services in your browser settings.",positionUnavailable:"Your location is currently unavailable. Please check your device settings.",timeout:"Location request timed out. Please try again.",generalError:"Unable to get your location. Please try entering your address manually.",clickToSelectLocation:"You can also choose your location by clicking on the map"},ar:{buttonLabel:"استخدم موقعي الحالي",errorTitle:"تعذر الوصول إلى الموقع",closeButton:"متابعة",loading:"جار الحصول على موقعك...",loadingInstructions:"يرجى السماح بالوصول إلى الموقع في المتصفح للمتابعة",timerMessage:"ستختفي هذه الرسالة تلقائياً بعد 7 ثوانٍ أو انقر متابعة",permissionDenied:"تم رفض الوصول إلى الموقع. يرجى تفعيل خدمات الموقع في إعدادات المتصفح.",positionUnavailable:"موقعك غير متاح حالياً. يرجى التحقق من إعدادات جهازك.",timeout:"انتهت مهلة طلب الموقع. يرجى المحاولة مرة أخرى.",generalError:"تعذر الحصول على موقعك. يرجى إدخال عنوانك يدوياً.",clickToSelectLocation:"يمكنك أيضاً اختيار موقعك بالنقر على الخريطة"},es:{buttonLabel:"Usar mi ubicación actual",errorTitle:"Error de ubicación",closeButton:"Cerrar",loading:"Obteniendo tu ubicación...",loadingInstructions:"Permite el acceso a la ubicación en tu navegador para continuar",timerMessage:"Este mensaje se ocultará automáticamente en 7 segundos o haz clic en Cerrar",permissionDenied:"Se denegó el acceso a la ubicación. Habilita los servicios de ubicación en la configuración de tu navegador.",positionUnavailable:"Tu ubicación no está disponible actualmente. Verifica la configuración de tu dispositivo.",timeout:"La solicitud de ubicación expiró. Inténtalo de nuevo.",generalError:"No se pudo obtener tu ubicación. Intenta ingresar tu dirección manualmente.",clickToSelectLocation:"Haz clic en el mapa para seleccionar una ubicación"},fr:{buttonLabel:"Utiliser ma position actuelle",errorTitle:"Erreur de localisation",closeButton:"Continuer",loading:"Obtention de votre position...",loadingInstructions:"Veuillez autoriser l'accès à la localisation dans votre navigateur pour continuer",timerMessage:"Ce message se masquera automatiquement dans 7 secondes ou cliquez sur Continuer",permissionDenied:"L'accès à la localisation a été refusé. Veuillez activer les services de localisation dans les paramètres de votre navigateur.",positionUnavailable:"Votre position n'est pas disponible actuellement. Veuillez vérifier les paramètres de votre appareil.",timeout:"La demande de localisation a expiré. Veuillez réessayer.",generalError:"Impossible d'obtenir votre position. Veuillez entrer votre adresse manuellement.",clickToSelectLocation:"Vous pouvez également choisir votre position en cliquant sur la carte"},de:{buttonLabel:"Meinen aktuellen Standort verwenden",errorTitle:"Standortfehler",closeButton:"Schließen",loading:"Getting your location...",loadingInstructions:"Please allow location access in your browser to continue",timerMessage:"This message will auto-hide in 7 seconds or click Continue",permissionDenied:"Der Zugriff auf den Standort wurde verweigert. Bitte aktivieren Sie die Standortdienste in Ihren Browsereinstellungen.",positionUnavailable:"Ihr Standort ist derzeit nicht verfügbar. Bitte überprüfen Sie Ihre Geräteeinstellungen.",timeout:"Standortanfrage ist abgelaufen. Bitte versuchen Sie es erneut.",generalError:"Ihr Standort konnte nicht abgerufen werden. Bitte geben Sie Ihre Adresse manuell ein.",clickToSelectLocation:"Klicken Sie auf die Karte, um einen Standort auszuwählen"},zh:{buttonLabel:"使用我的当前位置",errorTitle:"位置错误",closeButton:"关闭",loading:"Getting your location...",loadingInstructions:"Please allow location access in your browser to continue",timerMessage:"This message will auto-hide in 7 seconds or click Continue",permissionDenied:"位置访问被拒绝。请在浏览器设置中启用位置服务。",positionUnavailable:"您的位置当前不可用。请检查您的设备设置。",timeout:"位置请求超时。请重试。",generalError:"无法获取您的位置。请尝试手动输入地址。",clickToSelectLocation:"点击地图选择位置"},ja:{buttonLabel:"現在地を使用",errorTitle:"位置情報エラー",closeButton:"閉じる",loading:"Getting your location...",loadingInstructions:"Please allow location access in your browser to continue",timerMessage:"This message will auto-hide in 7 seconds or click Continue",permissionDenied:"位置情報へのアクセスが拒否されました。ブラウザの設定で位置情報サービスを有効にしてください。",positionUnavailable:"現在位置が利用できません。デバイスの設定を確認してください。",timeout:"位置情報リクエストがタイムアウトしました。もう一度お試しください。",generalError:"位置情報を取得できませんでした。住所を手動で入力してください。",clickToSelectLocation:"地図をクリックして場所を選択"},pt:{buttonLabel:"Usar minha localização atual",errorTitle:"Erro de localização",closeButton:"Fechar",loading:"Getting your location...",loadingInstructions:"Please allow location access in your browser to continue",timerMessage:"This message will auto-hide in 7 seconds or click Continue",permissionDenied:"O acesso à localização foi negado. Ative os serviços de localização nas configurações do navegador.",positionUnavailable:"Sua localização não está disponível no momento. Verifique as configurações do dispositivo.",timeout:"A solicitação de localização expirou. Tente novamente.",generalError:"Não foi possível obter sua localização. Tente inserir seu endereço manualmente.",clickToSelectLocation:"Clique no mapa para selecionar um local"},ru:{buttonLabel:"Использовать мое текущее местоположение",errorTitle:"Ошибка местоположения",closeButton:"Закрыть",loading:"Getting your location...",loadingInstructions:"Please allow location access in your browser to continue",timerMessage:"This message will auto-hide in 7 seconds or click Continue",permissionDenied:"Доступ к местоположению был запрещен. Включите службы определения местоположения в настройках браузера.",positionUnavailable:"Ваше местоположение в настоящее время недоступно. Проверьте настройки устройства.",timeout:"Время ожидания запроса местоположения истекло. Попробуйте еще раз.",generalError:"Не удалось получить ваше местоположение. Попробуйте ввести адрес вручную.",clickToSelectLocation:"Нажмите на карту, чтобы выбрать местоположение"},it:{buttonLabel:"Usa la mia posizione attuale",errorTitle:"Errore di posizione",closeButton:"Chiudi",loading:"Getting your location...",loadingInstructions:"Please allow location access in your browser to continue",timerMessage:"This message will auto-hide in 7 seconds or click Continue",permissionDenied:"L'accesso alla posizione è stato negato. Abilita i servizi di localizzazione nelle impostazioni del browser.",positionUnavailable:"La tua posizione non è attualmente disponibile. Controlla le impostazioni del dispositivo.",timeout:"La richiesta di posizione è scaduta. Riprova.",generalError:"Impossibile ottenere la tua posizione. Prova a inserire manualmente il tuo indirizzo.",clickToSelectLocation:"Fai clic sulla mappa per selezionare una posizione"},nl:{buttonLabel:"Gebruik mijn huidige locatie",errorTitle:"Locatiefout",closeButton:"Sluiten",loading:"Getting your location...",loadingInstructions:"Please allow location access in your browser to continue",timerMessage:"This message will auto-hide in 7 seconds or click Continue",permissionDenied:"Toegang tot locatie is geweigerd. Schakel locatieservices in in uw browserinstellingen.",positionUnavailable:"Uw locatie is momenteel niet beschikbaar. Controleer uw apparaatinstellingen.",timeout:"Locatieverzoek is verlopen. Probeer het opnieuw.",generalError:"Kan uw locatie niet ophalen. Probeer uw adres handmatig in te voeren.",clickToSelectLocation:"Klik op de kaart om een locatie te selecteren"},tr:{buttonLabel:"Mevcut konumumu kullan",errorTitle:"Konum Hatası",closeButton:"Kapat",loading:"Getting your location...",loadingInstructions:"Please allow location access in your browser to continue",timerMessage:"This message will auto-hide in 7 seconds or click Continue",permissionDenied:"Konum erişimi reddedildi. Lütfen tarayıcı ayarlarınızda konum hizmetlerini etkinleştirin.",positionUnavailable:"Konumunuz şu anda kullanılamıyor. Lütfen cihaz ayarlarınızı kontrol edin.",timeout:"Konum isteği zaman aşımına uğradı. Lütfen tekrar deneyin.",generalError:"Konumunuz alınamadı. Lütfen adresinizi manuel olarak girmeyi deneyin.",clickToSelectLocation:"Bir konum seçmek için haritaya tıklayın"},ko:{buttonLabel:"현재 위치 사용",errorTitle:"위치 오류",closeButton:"닫기",loading:"Getting your location...",loadingInstructions:"Please allow location access in your browser to continue",timerMessage:"This message will auto-hide in 7 seconds or click Continue",permissionDenied:"위치 액세스가 거부되었습니다. 브라우저 설정에서 위치 서비스를 활성화하십시오.",positionUnavailable:"현재 위치를 사용할 수 없습니다. 기기 설정을 확인하십시오.",timeout:"위치 요청 시간이 초과되었습니다. 다시 시도하십시오.",generalError:"위치를 가져올 수 없습니다. 수동으로 주소를 입력해 보십시오.",clickToSelectLocation:"지도를 클릭하여 위치를 선택하십시오"},hi:{buttonLabel:"मेरा वर्तमान स्थान उपयोग करें",errorTitle:"स्थान त्रुटि",closeButton:"बंद करें",loading:"Getting your location...",loadingInstructions:"Please allow location access in your browser to continue",timerMessage:"This message will auto-hide in 7 seconds or click Continue",permissionDenied:"स्थान पहुंच अस्वीकार कर दी गई थी। कृपया अपनी ब्राउज़र सेटिंग में स्थान सेवाएं सक्षम करें।",positionUnavailable:"आपका स्थान वर्तमान में उपलब्ध नहीं है। कृपया अपनी डिवाइस सेटिंग्स जांचें।",timeout:"स्थान अनुरोध समय समाप्त हो गया। कृपया पुनः प्रयास करें।",generalError:"आपका स्थान प्राप्त करने में असमर्थ। कृपया अपना पता मैन्युअल रूप से दर्ज करने का प्रयास करें।",clickToSelectLocation:"स्थान चुनने के लिए मानचित्र पर क्लिक करें"}},Pi=new Set(["ar","he","fa","ur"]);function Ti(t="en"){return Ii[t]||Ii.en}function Bi(t){return Pi.has(t)}var Di=Object.defineProperty,ji=Object.getOwnPropertyDescriptor,Oi=(t,e,i,s)=>{for(var r,o=s>1?void 0:s?ji(e,i):e,a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s?r(e,i,o):r(o))||o);return s&&o&&Di(e,i,o),o};let Ni=class extends Et{constructor(){super(...arguments),this.zoom=15,this.mapTypeId="roadmap",this.heading=0,this.tilt=0,this.gestureHandling="cooperative",this.minZoom=2,this.maxZoom=19,this.disableDefaultUI=!1,this.mapTypeControl=!1,this.streetViewControl=!1,this.rotateControl=!1,this.fullscreenControl=!1,this.enableGeolocation=!1,this.showLocationMarker=!0,this.geolocationOptions={maximumAge:6e4,timeout:1e4,enableHighAccuracy:!0},this.locationMarkerBackground="#4285F4",this.locationMarkerBorderColor="#1967D2",this.locationMarkerGlyphColor="#FFFFFF",this.locationMarkerScale=1.3,this.locationCircleOptions={},this.language="en",this.options={},this.enableAutocomplete=!1,this.autocompleteProxyUrl="https://api.salla.dev",this.autocompleteStrictBounds=!1,this.autocompleteResolve=!1,this.autocompleteDebounceDelay=300,this.autocompleteMinChars=3,this.geolocationLoading=!1,this.geolocationError=null,this.showLoadingOverlay=!1,this.buttonState="normal",this.eventListeners=[],this.autocompleteListenerAttached=!1}async connectedCallback(){super.connectedCallback(),Bi(this.language)&&(document.dir="rtl")}async firstUpdated(){await ii,this.createMap()}clearAutocompleteInput(){if(!this.autocompleteElement)return;const t=this.autocompleteElement.shadowRoot?.querySelector("input");t&&(t.value="",this.autocompleteElement.inputValue="",this.autocompleteElement.value="")}setupAutocompleteListener(){!this.enableAutocomplete||!this.autocompleteElement||this.autocompleteListenerAttached||(this.autocompleteElement.addEventListener("place-select",(t=>{const{place:e}=t.detail;if(e?.geometry?.location){const{lat:t,lng:i}=e.geometry.location;this.setLocation(t,i,50,!0),this.dispatchMapEvent("location_changed",{position:{lat:t,lng:i},accuracy:50,source:"autocomplete",place:{placeId:e.place_id,formattedAddress:e.formatted_address,addressComponents:e.address_components,name:e.name,types:e.types}}),this.dispatchMapEvent("autocomplete_place_selected",{place:e})}})),this.autocompleteListenerAttached=!0)}disconnectedCallback(){super.disconnectedCallback(),this.cleanup()}updated(t){super.updated(t),this.enableAutocomplete&&!this.autocompleteListenerAttached&&setTimeout((()=>this.setupAutocompleteListener()),0),this.map&&(t.has("center")&&this.center&&Ei(this.map,"center",this.center),t.has("zoom")&&void 0!==this.zoom&&Ei(this.map,"zoom",this.zoom),t.has("minZoom")&&void 0!==this.minZoom&&this.map&&this.map.setOptions({minZoom:this.minZoom}),t.has("maxZoom")&&void 0!==this.maxZoom&&this.map&&this.map.setOptions({maxZoom:this.maxZoom}),t.has("mapTypeId")&&this.mapTypeId&&Ei(this.map,"mapTypeId",this.mapTypeId),t.has("heading")&&void 0!==this.heading&&Ei(this.map,"heading",this.heading),t.has("tilt")&&void 0!==this.tilt&&Ei(this.map,"tilt",this.tilt),t.has("locationMarkerPosition")&&this.locationMarkerPosition&&this.showLocationMarker&&this.setLocation(this.locationMarkerPosition.lat,this.locationMarkerPosition.lng,this.locationMarkerPosition.accuracy))}createMap(){if(!this.mapElement)return;const t={center:this.center,zoom:this.zoom,mapId:this.mapId,mapTypeId:this.mapTypeId,heading:this.heading,tilt:this.tilt,gestureHandling:this.gestureHandling,minZoom:this.minZoom,maxZoom:this.maxZoom,disableDefaultUI:this.disableDefaultUI,zoomControl:this.zoomControl,mapTypeControl:this.mapTypeControl,scaleControl:this.scaleControl,streetViewControl:this.streetViewControl,rotateControl:this.rotateControl,fullscreenControl:this.fullscreenControl,disableDoubleClickZoom:!0,keyboardShortcuts:!1,zoomControlOptions:{position:google.maps.ControlPosition.RIGHT_BOTTOM},...this.options};this.map=new google.maps.Map(this.mapElement,t);const e=google.maps.event.addListener(this.map,"click",(t=>{if(t.latLng&&this.showLocationMarker){const e=t.latLng.lat(),i=t.latLng.lng();this.setLocation(e,i,50,!1),this.clearAutocompleteInput(),this.dispatchMapEvent("location_changed",{position:{lat:e,lng:i},accuracy:50,source:"map-click"})}}));this.eventListeners=Mi(this.map,["click","dblclick","drag","dragend","dragstart","idle","mousemove","mouseout","mouseover","resize","rightclick","tilesloaded"],((t,e)=>{this.dispatchMapEvent(t,e)})),this.eventListeners.push((()=>{e&&google.maps.event.removeListener(e)})),["center","zoom","bounds","mapTypeId"].forEach((t=>{const e=`${t}_changed`,i=google.maps.event.addListener(this.map,e,(()=>{const i=`get${t.charAt(0).toUpperCase()}${t.slice(1)}`;if("function"==typeof this.map[i]){const t=this.map[i]();this.dispatchMapEvent(e,t)}}));this.eventListeners.push((()=>{i&&google.maps.event.removeListener(i)}))})),this.dispatchEvent(new CustomEvent("gmap-ready",{detail:{map:this.map},bubbles:!0,composed:!0})),this.locationMarkerPosition&&this.showLocationMarker&&this.setLocation(this.locationMarkerPosition.lat,this.locationMarkerPosition.lng,this.locationMarkerPosition.accuracy)}dispatchMapEvent(t,e){let i=t;(t.includes("_changed")||t.startsWith("geolocation_")||t.startsWith("location_"))&&(i=`gmap-${t.replace(/_/g,"-")}`),this.dispatchEvent(new CustomEvent(i,{detail:e,bubbles:!0,composed:!0}))}cleanup(){Li(this.eventListeners),this.locationMarker&&(this.locationMarker.map=null,this.locationMarker=void 0),this.locationCircle&&(this.locationCircle.setMap(null),this.locationCircle=void 0),this.map=void 0}panBy(t,e){this.map?.panBy(t,e)}panTo(t){this.map?.panTo(t)}panToBounds(t){this.map?.panToBounds(t)}fitBounds(t){this.map?.fitBounds(t)}resize(){this.map&&google.maps.event.trigger(this.map,"resize")}resizePreserveCenter(){if(!this.map)return;const t=this.map.getCenter();google.maps.event.trigger(this.map,"resize"),t&&this.map.setCenter(t)}setLocation(t,e,i=50,s=!0){if(!this.map)return void console.warn("GMapMap: Cannot set location before map is initialized");const r={lat:t,lng:e};s&&this.map.panTo(r),this.showLocationMarker&&this.addLocationMarker(r,i),this.dispatchMapEvent("location_changed",{position:r,accuracy:i,source:"programmatic"})}async getCurrentLocation(t=!1){if(!navigator.geolocation)throw this.dispatchMapEvent("geolocation_error",{code:"NOT_SUPPORTED",message:"Geolocation is not supported by this browser"}),t||this.showGeolocationError(this.getTranslation("generalError")),new Error("NOT_SUPPORTED");this.geolocationLoading=!0,this.buttonState="loading",this.dispatchMapEvent("geolocation_loading",{message:"Getting your location..."});const e=t?null:setTimeout((()=>{this.geolocationLoading&&(this.showLoadingOverlay=!0)}),150);return new Promise(((i,s)=>{navigator.geolocation.getCurrentPosition((t=>{const s={lat:t.coords.latitude,lng:t.coords.longitude};if(e&&clearTimeout(e),this.geolocationLoading=!1,this.showLoadingOverlay=!1,this.buttonState="success",setTimeout((()=>{this.buttonState="normal"}),2e3),this.map){this.map.panTo(s);const e=t.coords.accuracy;let i=15;i=e>1e3?12:e>500?13:e>100?14:16,this.map.setZoom(i),this.showLocationMarker&&this.addLocationMarker(s,e),this.clearAutocompleteInput()}this.dispatchMapEvent("geolocation_success",{position:s,accuracy:t.coords.accuracy,altitude:t.coords.altitude,altitudeAccuracy:t.coords.altitudeAccuracy,heading:t.coords.heading,speed:t.coords.speed,timestamp:t.timestamp}),this.dispatchMapEvent("location_changed",{position:s,accuracy:t.coords.accuracy,source:"geolocation"}),i(s)}),(i=>{e&&clearTimeout(e),this.geolocationLoading=!1,this.showLoadingOverlay=!1,this.buttonState="error",setTimeout((()=>{this.buttonState="normal"}),2e3);let r="GENERAL_ERROR",o=this.getTranslation("generalError");i.code===i.PERMISSION_DENIED?(r="PERMISSION_DENIED",o=this.getTranslation("permissionDenied")):i.code===i.POSITION_UNAVAILABLE?(r="POSITION_UNAVAILABLE",o=this.getTranslation("positionUnavailable")):i.code===i.TIMEOUT&&(r="TIMEOUT",o=this.getTranslation("timeout")),this.dispatchMapEvent("geolocation_error",{code:r,message:o,error:i}),t||this.showGeolocationError(o),s(i)}),this.geolocationOptions)}))}handleGeolocationClick(){this.geolocationError=null,this.getCurrentLocation()}async addLocationMarker(t,e){if(this.map){if(this.locationMarker&&(this.locationMarker.map=null,this.locationMarker=void 0),this.locationCircle&&(this.locationCircle.setMap(null),this.locationCircle=void 0),!this.mapId)return void console.warn("GMapMap: mapId is required for location marker. Please set the mapId property on <gmap-map>. Get a Map ID from: https://console.cloud.google.com/google/maps-apis/studio/maps");try{const{AdvancedMarkerElement:e,PinElement:i}=await google.maps.importLibrary("marker"),s=new i({background:this.locationMarkerBackground,borderColor:this.locationMarkerBorderColor,glyphColor:this.locationMarkerGlyphColor,scale:this.locationMarkerScale});this.locationMarker=new e({map:this.map,position:t,title:"Your Location (Drag to adjust)",content:s.element,gmpDraggable:!0}),this.locationMarker.addListener("dragend",(()=>{if(this.locationMarker&&this.locationCircle){const t=this.locationMarker.position,e=t.toJSON?t.toJSON():{lat:t.lat(),lng:t.lng()};this.locationCircle.setCenter(e);const i=this.locationCircle.getRadius();this.clearAutocompleteInput(),this.dispatchMapEvent("location_marker_dragend",{position:e,accuracy:i}),this.dispatchMapEvent("location_changed",{position:e,accuracy:i,source:"marker-drag"})}}))}catch(t){console.error("Error creating AdvancedMarkerElement:",t)}this.locationCircle=new google.maps.Circle({map:this.map,center:t,radius:e,fillColor:"#4285F4",fillOpacity:.15,strokeColor:"#4285F4",strokeOpacity:.4,strokeWeight:1,clickable:!1,...this.locationCircleOptions})}}showGeolocationError(t){this.geolocationError=t,setTimeout((()=>{this.geolocationError=null}),7e3)}getTranslation(t){const e={loading:this.geolocationLoadingTitle,loadingInstructions:this.geolocationLoadingInstructions,errorTitle:this.geolocationErrorTitle,closeButton:this.geolocationErrorButtonText,timerMessage:this.geolocationErrorTimerMessage,clickToSelectLocation:this.geolocationClickToSelectMessage,generalError:this.geolocationGeneralErrorMessage,permissionDenied:this.geolocationPermissionDeniedMessage,positionUnavailable:this.geolocationPositionUnavailableMessage,timeout:this.geolocationTimeoutMessage}[t];if(null!=e&&""!==e)return e;const i=Ti(this.language);return i[t]||i.generalError}get buttonLabel(){return void 0!==this.geolocationButtonLabel?this.geolocationButtonLabel:Ti(this.language).buttonLabel||""}getButtonIconColor(){switch(this.buttonState){case"loading":return"#999";case"success":return"#4285F4";case"error":return"#EA4335";default:return"#666"}}getMap(){return this.map}render(){const t=Bi(this.language)?"rtl":"ltr";return ut`
639
+ <div class="map-page-wrapper">
640
+ ${this.enableAutocomplete?ut`
641
+ <div class="auto-complete-map-wrapper">
642
+ <div class="auto-complete-map-box" dir="${t}">
643
+ <salla-address-autocomplete
644
+ .proxyUrl=${this.autocompleteProxyUrl}
645
+ .authToken=${this.autocompleteAuthToken||null}
646
+ .placeholder=${this.autocompletePlaceholder||""}
647
+ .label=${this.autocompleteLabel||null}
648
+ .language=${this.language}
649
+ .country=${this.autocompleteCountry||null}
650
+ .locationBias=${this.autocompleteLocationBias||null}
651
+ .locationRestriction=${this.autocompleteLocationRestriction||null}
652
+ .types=${this.autocompleteTypes?this.autocompleteTypes.split(",").map((t=>t.trim())):null}
653
+ .fieldsStr=${this.autocompleteFields||null}
654
+ .strictBounds=${this.autocompleteStrictBounds}
655
+ .resolve=${this.autocompleteResolve}
656
+ .debounceDelay=${this.autocompleteDebounceDelay}
657
+ .minChars=${this.autocompleteMinChars}
658
+ ></salla-address-autocomplete>
659
+ ${this.autocompleteHint?ut`<span class="hint-wrapper">${this.autocompleteHint}</span>`:""}
660
+ </div>
661
+ </div>
662
+ `:""}
663
+
664
+ <div class="map-container">
665
+ <div class="map"></div>
666
+ <slot></slot>
667
+
668
+ ${this.enableGeolocation?ut`
669
+ <div class="controls-overlay">
670
+ <button
671
+ class="geolocation-button ${this.buttonLabel&&this.buttonLabel.trim()?"has-label":""}"
672
+ @click=${this.handleGeolocationClick}
673
+ title="Show your location"
674
+ ?disabled=${this.geolocationLoading}
675
+ >
676
+ <svg width="18" height="18" viewBox="0 0 24 24" fill="${this.getButtonIconColor()}">
677
+ <path
678
+ d="M12 8c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm8.94 3A8.994 8.994 0 0 0 13 3.06V1h-2v2.06A8.994 8.994 0 0 0 3.06 11H1v2h2.06A8.994 8.994 0 0 0 11 20.94V23h2v-2.06A8.994 8.994 0 0 0 20.94 13H23v-2h-2.06zM12 19c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7z"
679
+ />
680
+ </svg>
681
+ ${this.buttonLabel&&this.buttonLabel.trim()?ut`<span class="label">${this.buttonLabel}</span>`:""}
682
+ </button>
683
+ </div>
684
+ `:""}
685
+
686
+ ${this.showLoadingOverlay&&!this.geolocationError?ut`
687
+ <div class="loading-overlay">
688
+ <div class="spinner"></div>
689
+ <div class="title">
690
+ ${this.getTranslation("loading")}
691
+ </div>
692
+ <div class="instructions">
693
+ ${this.getTranslation("loadingInstructions")}
694
+ </div>
695
+ </div>
696
+ `:""}
697
+
698
+ ${this.geolocationError&&!this.showLoadingOverlay?ut`
699
+ <div class="error-overlay">
700
+ <div class="error-icon">
701
+ <svg width="40" height="40" viewBox="0 0 24 24" fill="none">
702
+ <circle cx="12" cy="12" r="10" stroke="#ef4444" stroke-width="2" fill="none"/>
703
+ <path d="M12 8v4M12 16h.01" stroke="#ef4444" stroke-width="2" stroke-linecap="round"/>
704
+ </svg>
705
+ </div>
706
+ <div class="error-title">
707
+ ${this.getTranslation("errorTitle")}
708
+ </div>
709
+ <div class="error-message">${this.geolocationError}</div>
710
+ <div class="map-hint">
711
+ ${this.getTranslation("clickToSelectLocation")}
712
+ </div>
713
+ <div class="timer-message">
714
+ ${this.getTranslation("timerMessage")}
715
+ </div>
716
+ <button @click=${()=>this.geolocationError=null}>
717
+ ${this.getTranslation("closeButton")}
718
+ </button>
719
+ </div>
720
+ `:""}
721
+ </div>
722
+ </div>
723
+ `}};Ni.styles=I`
724
+ :host {
725
+ display: block;
726
+ position: relative;
727
+ width: 100%;
728
+ height: 400px;
729
+ }
730
+
731
+ @media (max-width: 640px) {
732
+ :host {
733
+ height: 65vh;
734
+ min-height: 300px;
735
+ }
736
+ }
737
+
738
+ @media (max-width: 640px) and (min-height: 700px) {
739
+ :host {
740
+ height: 65vh;
741
+ }
742
+ }
743
+
744
+ .map-container {
745
+ width: 100%;
746
+ height: 100%;
747
+ position: relative;
748
+ }
749
+
750
+ .map {
751
+ width: 100%;
752
+ height: 100%;
753
+ }
754
+
755
+ .controls-overlay {
756
+ position: absolute;
757
+ top: 0;
758
+ left: 0;
759
+ right: 0;
760
+ bottom: 0;
761
+ pointer-events: none;
762
+ z-index: 40;
763
+ }
764
+
765
+ .controls-overlay > * {
766
+ pointer-events: auto;
767
+ }
768
+
769
+ .geolocation-button {
770
+ position: absolute;
771
+ bottom: 23px;
772
+ left: 10px;
773
+ right: auto;
774
+ background: #fff;
775
+ border: none;
776
+ border-radius: 2px;
777
+ box-shadow: rgba(0, 0, 0, 0.3) 0px 1px 4px -1px;
778
+ cursor: pointer;
779
+ padding: 10px;
780
+ height: 40px;
781
+ display: flex;
782
+ align-items: center;
783
+ justify-content: center;
784
+ gap: 8px;
785
+ outline: none;
786
+ color: rgb(86, 86, 86);
787
+ font-family: var(--gmap-font-family, Roboto, Arial, sans-serif);
788
+ font-size: 14px;
789
+ white-space: nowrap;
790
+ }
791
+
792
+ @media (max-width: 640px) {
793
+ .geolocation-button {
794
+ bottom: 23px;
795
+ left: 10px;
796
+ right: auto;
797
+ }
798
+
799
+ .geolocation-button .label {
800
+ display: none;
801
+ }
802
+
803
+ .geolocation-button {
804
+ width: 40px !important;
805
+ padding: 10px !important;
806
+ }
807
+ }
808
+
809
+ .geolocation-button.has-label {
810
+ width: auto;
811
+ padding: 8px 12px;
812
+ }
813
+
814
+ .geolocation-button:not(.has-label) {
815
+ width: 40px;
816
+ }
817
+
818
+ .geolocation-button:hover:not(:disabled) {
819
+ background: #ebebeb;
820
+ }
821
+
822
+ .geolocation-button:disabled {
823
+ cursor: wait;
824
+ opacity: 0.6;
825
+ }
826
+
827
+ .geolocation-button svg {
828
+ flex-shrink: 0;
829
+ }
830
+
831
+ .geolocation-button .label {
832
+ font-weight: 500;
833
+ }
834
+
835
+ .loading-overlay {
836
+ position: absolute;
837
+ top: 0;
838
+ left: 0;
839
+ right: 0;
840
+ bottom: 0;
841
+ background: rgba(0, 0, 0, 0.7);
842
+ z-index: 200;
843
+ display: flex;
844
+ flex-direction: column;
845
+ align-items: center;
846
+ justify-content: center;
847
+ gap: 16px;
848
+ padding: 16px;
849
+ font-family: var(--gmap-font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
850
+ }
851
+
852
+ .loading-overlay .spinner {
853
+ width: 48px;
854
+ height: 48px;
855
+ border: 4px solid rgba(255, 255, 255, 0.3);
856
+ border-top-color: #ffffff;
857
+ border-radius: 50%;
858
+ animation: spin 1s linear infinite;
859
+ }
860
+
861
+ @keyframes spin {
862
+ to { transform: rotate(360deg); }
863
+ }
864
+
865
+ .loading-overlay .title {
866
+ font-size: 18px;
867
+ font-weight: 600;
868
+ color: #ffffff;
869
+ margin: 0;
870
+ text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
871
+ }
872
+
873
+ .loading-overlay .instructions {
874
+ font-size: 14px;
875
+ color: #ffffff;
876
+ line-height: 1.5;
877
+ margin: 0;
878
+ text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
879
+ text-align: center;
880
+ max-width: 90%;
881
+ }
882
+
883
+ .error-overlay {
884
+ position: absolute;
885
+ top: 0;
886
+ left: 0;
887
+ right: 0;
888
+ bottom: 0;
889
+ background: rgba(0, 0, 0, 0.7);
890
+ z-index: 200;
891
+ display: flex;
892
+ flex-direction: column;
893
+ align-items: center;
894
+ justify-content: center;
895
+ gap: 12px;
896
+ padding: 16px;
897
+ font-family: var(--gmap-font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
898
+ }
899
+
900
+ .error-overlay .error-icon svg {
901
+ display: block;
902
+ }
903
+
904
+ .error-overlay .error-title {
905
+ font-size: 17px;
906
+ font-weight: 600;
907
+ color: #ef4444;
908
+ margin: 0;
909
+ text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
910
+ }
911
+
912
+ .error-overlay .error-message {
913
+ font-size: 14px;
914
+ color: #ffffff;
915
+ line-height: 1.4;
916
+ margin: 0;
917
+ text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
918
+ text-align: center;
919
+ max-width: 90%;
920
+ }
921
+
922
+ .error-overlay .map-hint {
923
+ font-size: 12px;
924
+ color: #d4d4d4;
925
+ line-height: 1.4;
926
+ margin: 0;
927
+ text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
928
+ text-align: center;
929
+ font-style: italic;
930
+ }
931
+
932
+ .error-overlay .timer-message {
933
+ font-size: 12px;
934
+ color: #d4d4d4;
935
+ margin: 0;
936
+ text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
937
+ }
938
+
939
+ .error-overlay button {
940
+ margin-top: 4px;
941
+ padding: 8px 24px;
942
+ background: #ffffff;
943
+ color: #18181b;
944
+ border: none;
945
+ border-radius: 8px;
946
+ font-size: 14px;
947
+ font-weight: 600;
948
+ cursor: pointer;
949
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
950
+ }
951
+
952
+ .error-overlay button:hover {
953
+ background: #f4f4f5;
954
+ }
955
+
956
+ .map-page-wrapper {
957
+ position: relative;
958
+ width: 100%;
959
+ height: 100%;
960
+ }
961
+
962
+ .auto-complete-map-wrapper {
963
+ position: absolute;
964
+ z-index: 50;
965
+ padding: 1rem;
966
+ width: 100%;
967
+ top: 0;
968
+ left: 0;
969
+ right: 0;
970
+ pointer-events: none;
971
+ box-sizing: border-box;
972
+ }
973
+
974
+ @media (max-width: 640px) {
975
+ .auto-complete-map-wrapper {
976
+ padding: 0.75rem 0.5rem;
977
+ }
978
+ }
979
+
980
+ .auto-complete-map-wrapper > * {
981
+ pointer-events: auto;
982
+ }
983
+
984
+ .auto-complete-map-box {
985
+ width: 100%;
986
+ display: flex;
987
+ flex-direction: column;
988
+ padding: 1rem;
989
+ background-color: #ffffffb2;
990
+ border-radius: 8px;
991
+ backdrop-filter: blur(4px);
992
+ box-sizing: border-box;
993
+ }
994
+
995
+ @media (max-width: 640px) {
996
+ .auto-complete-map-box {
997
+ padding: 0.75rem;
998
+ }
999
+ }
1000
+
1001
+ .auto-complete-map-box .hint-wrapper {
1002
+ font-size: 12px;
1003
+ color: #666666;
1004
+ margin-top: 0.5rem;
1005
+ text-align: start;
1006
+ direction: inherit;
1007
+ }
1008
+ `,Oi([zi({type:Object})],Ni.prototype,"center",2),Oi([zi({type:Number})],Ni.prototype,"zoom",2),Oi([zi({type:String,attribute:"map-id"})],Ni.prototype,"mapId",2),Oi([zi({type:String,attribute:"map-type-id"})],Ni.prototype,"mapTypeId",2),Oi([zi({type:Number})],Ni.prototype,"heading",2),Oi([zi({type:Number})],Ni.prototype,"tilt",2),Oi([zi({type:Object})],Ni.prototype,"bounds",2),Oi([zi({type:String})],Ni.prototype,"gestureHandling",2),Oi([zi({type:Number})],Ni.prototype,"minZoom",2),Oi([zi({type:Number})],Ni.prototype,"maxZoom",2),Oi([zi({type:Boolean})],Ni.prototype,"disableDefaultUI",2),Oi([zi({type:Boolean})],Ni.prototype,"zoomControl",2),Oi([zi({type:Boolean})],Ni.prototype,"mapTypeControl",2),Oi([zi({type:Boolean})],Ni.prototype,"scaleControl",2),Oi([zi({type:Boolean})],Ni.prototype,"streetViewControl",2),Oi([zi({type:Boolean})],Ni.prototype,"rotateControl",2),Oi([zi({type:Boolean})],Ni.prototype,"fullscreenControl",2),Oi([zi({type:Boolean,attribute:"enable-geolocation"})],Ni.prototype,"enableGeolocation",2),Oi([zi({type:Boolean,attribute:"show-location-marker"})],Ni.prototype,"showLocationMarker",2),Oi([zi({type:Object})],Ni.prototype,"geolocationOptions",2),Oi([zi({type:Object,attribute:"location-marker-position"})],Ni.prototype,"locationMarkerPosition",2),Oi([zi({type:String,attribute:"location-marker-background"})],Ni.prototype,"locationMarkerBackground",2),Oi([zi({type:String,attribute:"location-marker-border-color"})],Ni.prototype,"locationMarkerBorderColor",2),Oi([zi({type:String,attribute:"location-marker-glyph-color"})],Ni.prototype,"locationMarkerGlyphColor",2),Oi([zi({type:Number,attribute:"location-marker-scale"})],Ni.prototype,"locationMarkerScale",2),Oi([zi({type:Object,attribute:"location-circle-options"})],Ni.prototype,"locationCircleOptions",2),Oi([zi({type:String})],Ni.prototype,"language",2),Oi([zi({type:Object})],Ni.prototype,"options",2),Oi([zi({type:String,attribute:"geolocation-button-label"})],Ni.prototype,"geolocationButtonLabel",2),Oi([zi({type:String,attribute:"geolocation-loading-title"})],Ni.prototype,"geolocationLoadingTitle",2),Oi([zi({type:String,attribute:"geolocation-loading-instructions"})],Ni.prototype,"geolocationLoadingInstructions",2),Oi([zi({type:String,attribute:"geolocation-error-title"})],Ni.prototype,"geolocationErrorTitle",2),Oi([zi({type:String,attribute:"geolocation-error-button-text"})],Ni.prototype,"geolocationErrorButtonText",2),Oi([zi({type:String,attribute:"geolocation-error-timer-message"})],Ni.prototype,"geolocationErrorTimerMessage",2),Oi([zi({type:String,attribute:"geolocation-click-to-select-message"})],Ni.prototype,"geolocationClickToSelectMessage",2),Oi([zi({type:String,attribute:"geolocation-permission-denied-message"})],Ni.prototype,"geolocationPermissionDeniedMessage",2),Oi([zi({type:String,attribute:"geolocation-position-unavailable-message"})],Ni.prototype,"geolocationPositionUnavailableMessage",2),Oi([zi({type:String,attribute:"geolocation-timeout-message"})],Ni.prototype,"geolocationTimeoutMessage",2),Oi([zi({type:String,attribute:"geolocation-general-error-message"})],Ni.prototype,"geolocationGeneralErrorMessage",2),Oi([zi({type:Boolean,attribute:"enable-autocomplete"})],Ni.prototype,"enableAutocomplete",2),Oi([zi({type:String,attribute:"autocomplete-hint"})],Ni.prototype,"autocompleteHint",2),Oi([zi({type:String,attribute:"autocomplete-proxy-url"})],Ni.prototype,"autocompleteProxyUrl",2),Oi([zi({type:String,attribute:"autocomplete-auth-token"})],Ni.prototype,"autocompleteAuthToken",2),Oi([zi({type:String,attribute:"autocomplete-placeholder"})],Ni.prototype,"autocompletePlaceholder",2),Oi([zi({type:String,attribute:"autocomplete-label"})],Ni.prototype,"autocompleteLabel",2),Oi([zi({type:String,attribute:"autocomplete-country"})],Ni.prototype,"autocompleteCountry",2),Oi([zi({type:Object,attribute:"autocomplete-location-bias"})],Ni.prototype,"autocompleteLocationBias",2),Oi([zi({type:Object,attribute:"autocomplete-location-restriction"})],Ni.prototype,"autocompleteLocationRestriction",2),Oi([zi({type:String,attribute:"autocomplete-types"})],Ni.prototype,"autocompleteTypes",2),Oi([zi({type:String,attribute:"autocomplete-fields"})],Ni.prototype,"autocompleteFields",2),Oi([zi({type:Boolean,attribute:"autocomplete-strict-bounds"})],Ni.prototype,"autocompleteStrictBounds",2),Oi([zi({type:Boolean,attribute:"autocomplete-resolve"})],Ni.prototype,"autocompleteResolve",2),Oi([zi({type:Number,attribute:"autocomplete-debounce-delay"})],Ni.prototype,"autocompleteDebounceDelay",2),Oi([zi({type:Number,attribute:"autocomplete-min-chars"})],Ni.prototype,"autocompleteMinChars",2),Oi([$i(".map")],Ni.prototype,"mapElement",2),Oi([$i("salla-address-autocomplete")],Ni.prototype,"autocompleteElement",2),Oi([Ai()],Ni.prototype,"geolocationLoading",2),Oi([Ai()],Ni.prototype,"geolocationError",2),Oi([Ai()],Ni.prototype,"showLoadingOverlay",2),Oi([Ai()],Ni.prototype,"buttonState",2),Ni=Oi([si("gmap-map")],Ni);var Ui=Object.defineProperty,Fi=Object.getOwnPropertyDescriptor,Ri=(t,e,i,s)=>{for(var r,o=s>1?void 0:s?Fi(e,i):e,a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s?r(e,i,o):r(o))||o);return s&&o&&Ui(e,i,o),o};let qi=class extends Et{constructor(){super(...arguments),this.title="",this.gmpDraggable=!1,this.gmpClickable=!0,this.scale=1,this.draggable=!1,this.clickable=!0,this.eventListeners=[]}async connectedCallback(){super.connectedCallback(),await this.initMarker()}disconnectedCallback(){super.disconnectedCallback(),this.cleanup()}async updated(t){super.updated(t),this.marker&&(t.has("position")&&this.position&&(this.marker.position=this.normalizePosition(this.position)),t.has("title")&&this.title&&(this.marker.title=this.title),t.has("gmpDraggable")&&(this.marker.gmpDraggable=this.gmpDraggable||this.draggable),t.has("gmpClickable")&&(this.marker.gmpClickable=!1!==this.gmpClickable&&!1!==this.clickable),t.has("zIndex")&&void 0!==this.zIndex&&(this.marker.zIndex=this.zIndex),(t.has("content")||t.has("background")||t.has("borderColor")||t.has("glyphColor")||t.has("scale")||t.has("icon")||t.has("label"))&&this.updateMarkerContent())}async initMarker(){this.addEventListener("gmap-ready",(t=>{this.map=t.detail.map,this.createMarker()}));const t=this.closest("gmap-map");t?.getMap&&(this.map=t.getMap(),this.map&&await this.createMarker())}async createMarker(){if(!this.map)return void console.error("GMapMarker: No map found. Make sure the marker is inside a <gmap-map> element.");if(!this.map.get?.("mapId"))return void console.error('GMapMarker: AdvancedMarkerElement requires a mapId to be set on the map. Add mapId to your map. Example: mapId="YOUR_MAP_ID". Get a Map ID from: https://console.cloud.google.com/google/maps-apis/studio/maps');this.markerLibrary=await async function(t){if(ei.has(t))return ei.get(t);if(await ii,typeof google<"u"&&google.maps&&google.maps.importLibrary){const e=await google.maps.importLibrary(t);return ei.set(t,e),e}return google.maps[t]||google.maps}("marker");const{AdvancedMarkerElement:t,PinElement:e}=this.markerLibrary,i=this.gmpDraggable||this.draggable,s=!1!==this.gmpClickable&&!1!==this.clickable,r={map:this.map,position:this.normalizePosition(this.position),title:this.title,gmpDraggable:i,gmpClickable:s};if(void 0!==this.zIndex&&(r.zIndex=this.zIndex),this.content)if("string"==typeof this.content){const t=document.createElement("div");t.innerHTML=this.content,r.content=t}else r.content=this.content;else if(this.icon){const t=document.createElement("img");t.src=this.icon,t.style.width="32px",t.style.height="32px",r.content=t}else{const t={scale:this.scale||1};this.background&&(t.background=this.background),this.borderColor&&(t.borderColor=this.borderColor),this.glyphColor&&(t.glyphColor=this.glyphColor),this.label&&"string"==typeof this.label&&(t.glyph=this.label),this.pinElement=new e(t),this.pinElement?.element&&(r.content=this.pinElement.element)}this.marker=new t(r),this.eventListeners=Mi(this.marker,["click","drag","dragstart","dragend","gmp-click"],((t,e)=>{if("dragend"===t&&this.marker&&this.marker.position){const t=this.marker.position,e=t.toJSON?t.toJSON():{lat:t.lat(),lng:t.lng()};this.dispatchEvent(new CustomEvent("dragend",{detail:{latLng:e},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("gmap-position-changed",{detail:e,bubbles:!0,composed:!0}))}else this.dispatchEvent(new CustomEvent(t,{detail:e,bubbles:!0,composed:!0}))})),this.dispatchEvent(new CustomEvent("gmap-marker-ready",{detail:{marker:this.marker},bubbles:!0,composed:!0}))}updateMarkerContent(){if(!this.marker||!this.markerLibrary)return;const{PinElement:t}=this.markerLibrary;if(this.content)if("string"==typeof this.content){const t=document.createElement("div");t.innerHTML=this.content,this.marker.content=t}else this.marker.content=this.content;else if(this.icon){const t=document.createElement("img");t.src=this.icon,t.style.width="32px",t.style.height="32px",this.marker.content=t}else{const e={scale:this.scale||1};this.background&&(e.background=this.background),this.borderColor&&(e.borderColor=this.borderColor),this.glyphColor&&(e.glyphColor=this.glyphColor),this.label&&"string"==typeof this.label&&(e.glyph=this.label),this.pinElement=new t(e),this.pinElement?.element&&(this.marker.content=this.pinElement.element)}}normalizePosition(t){return t?{lat:"number"==typeof t.lat?t.lat:parseFloat(t.lat),lng:"number"==typeof t.lng?t.lng:parseFloat(t.lng)}:{lat:0,lng:0}}cleanup(){Li(this.eventListeners),this.marker&&(this.marker.map=null,this.marker=void 0)}getMarker(){return this.marker}render(){return ut`<slot></slot>`}};Ri([zi({type:Object})],qi.prototype,"position",2),Ri([zi({type:String})],qi.prototype,"title",2),Ri([zi({type:Boolean})],qi.prototype,"gmpDraggable",2),Ri([zi({type:Boolean})],qi.prototype,"gmpClickable",2),Ri([zi({type:Number})],qi.prototype,"zIndex",2),Ri([zi({type:Object})],qi.prototype,"content",2),Ri([zi({type:String})],qi.prototype,"background",2),Ri([zi({type:String})],qi.prototype,"borderColor",2),Ri([zi({type:String})],qi.prototype,"glyphColor",2),Ri([zi({type:Number})],qi.prototype,"scale",2),Ri([zi({type:Boolean})],qi.prototype,"draggable",2),Ri([zi({type:Boolean})],qi.prototype,"clickable",2),Ri([zi({type:String})],qi.prototype,"icon",2),Ri([zi({type:String})],qi.prototype,"label",2),Ri([Ai()],qi.prototype,"marker",2),Ri([Ai()],qi.prototype,"map",2),qi=Ri([si("gmap-marker")],qi);var Zi=Object.defineProperty,Gi=Object.getOwnPropertyDescriptor,Vi=(t,e,i,s)=>{for(var r,o=s>1?void 0:s?Gi(e,i):e,a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s?r(e,i,o):r(o))||o);return s&&o&&Zi(e,i,o),o};let Hi=class extends Et{constructor(){super(...arguments),this.opened=!0,this.options={},this.eventListeners=[]}async connectedCallback(){super.connectedCallback(),await this.initInfoWindow()}disconnectedCallback(){super.disconnectedCallback(),this.cleanup()}updated(t){super.updated(t),this.infoWindow&&(t.has("opened")&&(this.opened?this.open():this.close()),t.has("position")&&this.position&&!this.marker&&this.infoWindow.setPosition(this.position),t.has("zIndex")&&void 0!==this.zIndex&&this.infoWindow.setZIndex(this.zIndex))}async initInfoWindow(){const t=this.closest("gmap-marker");if(t)this.addEventListener("gmap-marker-ready",(t=>{this.marker=t.detail.marker,this.createInfoWindow()})),t.getMarker&&(this.marker=t.getMarker(),this.marker&&await this.createInfoWindow());else{const t=this.closest("gmap-map");t&&(this.addEventListener("gmap-ready",(t=>{this.map=t.detail.map,this.createInfoWindow()})),t.getMap&&(this.map=t.getMap(),this.map&&await this.createInfoWindow()))}}async createInfoWindow(){const t=document.createElement("div");t.style.cssText="min-width: 200px;";const e={content:t,...this.options};void 0!==this.zIndex&&(e.zIndex=this.zIndex),this.position&&!this.marker&&(e.position=this.position),this.infoWindow=new google.maps.InfoWindow(e),this.observeSlotContent(t),this.eventListeners=Mi(this.infoWindow,["closeclick","domready","content_changed"],(t=>{"closeclick"===t&&(this.opened=!1),this.dispatchEvent(new CustomEvent(t,{bubbles:!0,composed:!0}))})),this.opened&&this.open()}observeSlotContent(t){this.renderSlotContent(t);const e=this.shadowRoot?.querySelector("slot");e&&e.addEventListener("slotchange",(()=>{this.renderSlotContent(t)})),this.contentObserver=new MutationObserver((()=>{this.renderSlotContent(t)})),this.contentObserver.observe(this,{childList:!0,subtree:!0,characterData:!0})}renderSlotContent(t){const e=this.shadowRoot?.querySelector("slot");if(e){const i=e.assignedNodes({flatten:!0});t.innerHTML="",i.forEach((e=>{(e.nodeType===Node.ELEMENT_NODE||e.nodeType===Node.TEXT_NODE&&e.textContent?.trim())&&t.appendChild(e.cloneNode(!0))}))}}open(){this.infoWindow&&(this.marker?this.infoWindow.open({anchor:this.marker,map:this.map}):this.map&&this.infoWindow.open(this.map))}close(){this.infoWindow?.close()}cleanup(){Li(this.eventListeners),this.contentObserver&&(this.contentObserver.disconnect(),this.contentObserver=void 0),this.infoWindow&&(this.infoWindow.close(),this.infoWindow=void 0)}getInfoWindow(){return this.infoWindow}render(){return ut`<slot></slot>`}};Hi.styles=I`
1009
+ :host {
1010
+ display: contents;
1011
+ }
1012
+ `,Vi([zi({type:Boolean})],Hi.prototype,"opened",2),Vi([zi({type:Object})],Hi.prototype,"position",2),Vi([zi({type:Number})],Hi.prototype,"zIndex",2),Vi([zi({type:Object})],Hi.prototype,"options",2),Vi([Ai()],Hi.prototype,"infoWindow",2),Vi([Ai()],Hi.prototype,"map",2),Vi([Ai()],Hi.prototype,"marker",2),Hi=Vi([si("gmap-info-window")],Hi);var Ki=Object.defineProperty,Wi=Object.getOwnPropertyDescriptor,Yi=(t,e,i,s)=>{for(var r,o=s>1?void 0:s?Wi(e,i):e,a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s?r(e,i,o):r(o))||o);return s&&o&&Ki(e,i,o),o};let Ji=class extends Et{constructor(){super(...arguments),this.path=[],this.editable=!1,this.draggable=!1,this.options={},this.eventListeners=[]}async connectedCallback(){super.connectedCallback(),await this.initPolyline()}disconnectedCallback(){super.disconnectedCallback(),this.cleanup()}updated(t){super.updated(t),this.polyline&&(t.has("path")&&this.path&&this.polyline.setPath(this.path),t.has("editable")&&this.polyline.setEditable(this.editable),t.has("draggable")&&this.polyline.setDraggable(this.draggable),t.has("options")&&this.polyline.setOptions(this.options))}async initPolyline(){const t=this.closest("gmap-map");t&&(this.addEventListener("gmap-ready",(t=>{this.map=t.detail.map,this.createPolyline()})),t.getMap&&(this.map=t.getMap(),this.map&&await this.createPolyline()))}async createPolyline(){if(!this.map)return;const t={map:this.map,path:this.path,editable:this.editable,draggable:this.draggable,...this.options};this.polyline=new google.maps.Polyline(t),this.eventListeners=Mi(this.polyline,["click","dblclick","drag","dragend","dragstart","mousedown","mousemove","mouseout","mouseover","mouseup","rightclick"],((t,e)=>{this.dispatchEvent(new CustomEvent(t,{detail:e,bubbles:!0,composed:!0}))}));const e=google.maps.event.addListener(this.polyline.getPath(),"set_at",(()=>{this.emitPathChanged()})),i=google.maps.event.addListener(this.polyline.getPath(),"insert_at",(()=>{this.emitPathChanged()})),s=google.maps.event.addListener(this.polyline.getPath(),"remove_at",(()=>{this.emitPathChanged()}));this.eventListeners.push((()=>google.maps.event.removeListener(e)),(()=>google.maps.event.removeListener(i)),(()=>google.maps.event.removeListener(s)))}emitPathChanged(){if(!this.polyline)return;const t=this.polyline.getPath().getArray().map((t=>({lat:t.lat(),lng:t.lng()})));this.dispatchEvent(new CustomEvent("gmap-path-changed",{detail:t,bubbles:!0,composed:!0}))}cleanup(){Li(this.eventListeners),this.polyline&&(this.polyline.setMap(null),this.polyline=void 0)}getPolyline(){return this.polyline}render(){return ut``}};Yi([zi({type:Array})],Ji.prototype,"path",2),Yi([zi({type:Boolean})],Ji.prototype,"editable",2),Yi([zi({type:Boolean})],Ji.prototype,"draggable",2),Yi([zi({type:Object})],Ji.prototype,"options",2),Yi([Ai()],Ji.prototype,"polyline",2),Yi([Ai()],Ji.prototype,"map",2),Ji=Yi([si("gmap-polyline")],Ji);var Qi=Object.defineProperty,Xi=Object.getOwnPropertyDescriptor,ts=(t,e,i,s)=>{for(var r,o=s>1?void 0:s?Xi(e,i):e,a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s?r(e,i,o):r(o))||o);return s&&o&&Qi(e,i,o),o};let es=class extends Et{constructor(){super(...arguments),this.editable=!1,this.draggable=!1,this.options={},this.eventListeners=[]}async connectedCallback(){super.connectedCallback(),await this.initPolygon()}disconnectedCallback(){super.disconnectedCallback(),this.cleanup()}updated(t){super.updated(t),this.polygon&&(t.has("path")&&this.path&&this.polygon.setPath(this.path),t.has("paths")&&this.paths&&this.polygon.setPaths(this.paths),t.has("editable")&&this.polygon.setEditable(this.editable),t.has("draggable")&&this.polygon.setDraggable(this.draggable),t.has("options")&&this.polygon.setOptions(this.options))}async initPolygon(){const t=this.closest("gmap-map");t&&(this.addEventListener("gmap-ready",(t=>{this.map=t.detail.map,this.createPolygon()})),t.getMap&&(this.map=t.getMap(),this.map&&await this.createPolygon()))}async createPolygon(){if(!this.map)return;const t={map:this.map,editable:this.editable,draggable:this.draggable,...this.options};this.paths?t.paths=this.paths:this.path&&(t.paths=this.path),this.polygon=new google.maps.Polygon(t),this.eventListeners=Mi(this.polygon,["click","dblclick","drag","dragend","dragstart","mousedown","mousemove","mouseout","mouseover","mouseup","rightclick"],((t,e)=>{this.dispatchEvent(new CustomEvent(t,{detail:e,bubbles:!0,composed:!0}))})),this.paths?this.bindPathsChanges():this.bindPathChanges()}bindPathChanges(){if(!this.polygon)return;const t=this.polygon.getPath(),e=google.maps.event.addListener(t,"set_at",(()=>{this.emitPathChanged()})),i=google.maps.event.addListener(t,"insert_at",(()=>{this.emitPathChanged()})),s=google.maps.event.addListener(t,"remove_at",(()=>{this.emitPathChanged()}));this.eventListeners.push((()=>google.maps.event.removeListener(e)),(()=>google.maps.event.removeListener(i)),(()=>google.maps.event.removeListener(s)))}bindPathsChanges(){this.polygon&&this.polygon.getPaths().forEach((t=>{const e=google.maps.event.addListener(t,"set_at",(()=>{this.emitPathsChanged()})),i=google.maps.event.addListener(t,"insert_at",(()=>{this.emitPathsChanged()})),s=google.maps.event.addListener(t,"remove_at",(()=>{this.emitPathsChanged()}));this.eventListeners.push((()=>google.maps.event.removeListener(e)),(()=>google.maps.event.removeListener(i)),(()=>google.maps.event.removeListener(s)))}))}emitPathChanged(){if(!this.polygon)return;const t=this.polygon.getPath().getArray().map((t=>({lat:t.lat(),lng:t.lng()})));this.dispatchEvent(new CustomEvent("gmap-path-changed",{detail:t,bubbles:!0,composed:!0}))}emitPathsChanged(){if(!this.polygon)return;const t=this.polygon.getPaths().getArray().map((t=>t.getArray().map((t=>({lat:t.lat(),lng:t.lng()})))));this.dispatchEvent(new CustomEvent("gmap-paths-changed",{detail:t,bubbles:!0,composed:!0}))}cleanup(){Li(this.eventListeners),this.polygon&&(this.polygon.setMap(null),this.polygon=void 0)}getPolygon(){return this.polygon}render(){return ut``}};ts([zi({type:Array})],es.prototype,"path",2),ts([zi({type:Array})],es.prototype,"paths",2),ts([zi({type:Boolean})],es.prototype,"editable",2),ts([zi({type:Boolean})],es.prototype,"draggable",2),ts([zi({type:Object})],es.prototype,"options",2),ts([Ai()],es.prototype,"polygon",2),ts([Ai()],es.prototype,"map",2),es=ts([si("gmap-polygon")],es);var is=Object.defineProperty,ss=Object.getOwnPropertyDescriptor,rs=(t,e,i,s)=>{for(var r,o=s>1?void 0:s?ss(e,i):e,a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s?r(e,i,o):r(o))||o);return s&&o&&is(e,i,o),o};let os=class extends Et{constructor(){super(...arguments),this.radius=1e3,this.editable=!1,this.draggable=!1,this.options={},this.eventListeners=[]}async connectedCallback(){super.connectedCallback(),await this.initCircle()}disconnectedCallback(){super.disconnectedCallback(),this.cleanup()}updated(t){super.updated(t),this.circle&&(t.has("center")&&this.center&&this.circle.setCenter(this.center),t.has("radius")&&void 0!==this.radius&&this.circle.setRadius(this.radius),t.has("editable")&&this.circle.setEditable(this.editable),t.has("draggable")&&this.circle.setDraggable(this.draggable),t.has("options")&&this.circle.setOptions(this.options))}async initCircle(){const t=this.closest("gmap-map");t&&(this.addEventListener("gmap-ready",(t=>{this.map=t.detail.map,this.createCircle()})),t.getMap&&(this.map=t.getMap(),this.map&&await this.createCircle()))}async createCircle(){if(!this.map)return;const t={map:this.map,center:this.center,radius:this.radius,editable:this.editable,draggable:this.draggable,...this.options};this.circle=new google.maps.Circle(t),this.eventListeners=Mi(this.circle,["click","dblclick","drag","dragend","dragstart","mousedown","mousemove","mouseout","mouseover","mouseup","rightclick","center_changed","radius_changed","bounds_changed"],((t,e)=>{if("center_changed"===t){const e=this.circle.getCenter(),i=e?{lat:e.lat(),lng:e.lng()}:null;this.dispatchEvent(new CustomEvent(t,{detail:i,bubbles:!0,composed:!0}))}else if("radius_changed"===t){const e=this.circle.getRadius();this.dispatchEvent(new CustomEvent(t,{detail:e,bubbles:!0,composed:!0}))}else this.dispatchEvent(new CustomEvent(t,{detail:e,bubbles:!0,composed:!0}))}))}cleanup(){Li(this.eventListeners),this.circle&&(this.circle.setMap(null),this.circle=void 0)}getCircle(){return this.circle}render(){return ut``}};rs([zi({type:Object})],os.prototype,"center",2),rs([zi({type:Number})],os.prototype,"radius",2),rs([zi({type:Boolean})],os.prototype,"editable",2),rs([zi({type:Boolean})],os.prototype,"draggable",2),rs([zi({type:Object})],os.prototype,"options",2),rs([Ai()],os.prototype,"circle",2),rs([Ai()],os.prototype,"map",2),os=rs([si("gmap-circle")],os);var as=Object.defineProperty,ls=Object.getOwnPropertyDescriptor,ns=(t,e,i,s)=>{for(var r,o=s>1?void 0:s?ls(e,i):e,a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s?r(e,i,o):r(o))||o);return s&&o&&as(e,i,o),o};let hs=class extends Et{constructor(){super(...arguments),this.editable=!1,this.draggable=!1,this.options={},this.eventListeners=[]}async connectedCallback(){super.connectedCallback(),await this.initRectangle()}disconnectedCallback(){super.disconnectedCallback(),this.cleanup()}updated(t){super.updated(t),this.rectangle&&(t.has("bounds")&&this.bounds&&this.rectangle.setBounds(this.bounds),t.has("editable")&&this.rectangle.setEditable(this.editable),t.has("draggable")&&this.rectangle.setDraggable(this.draggable),t.has("options")&&this.rectangle.setOptions(this.options))}async initRectangle(){const t=this.closest("gmap-map");t&&(this.addEventListener("gmap-ready",(t=>{this.map=t.detail.map,this.createRectangle()})),t.getMap&&(this.map=t.getMap(),this.map&&await this.createRectangle()))}async createRectangle(){if(!this.map)return;const t={map:this.map,bounds:this.bounds,editable:this.editable,draggable:this.draggable,...this.options};this.rectangle=new google.maps.Rectangle(t),this.eventListeners=Mi(this.rectangle,["click","dblclick","drag","dragend","dragstart","mousedown","mousemove","mouseout","mouseover","mouseup","rightclick","bounds_changed"],((t,e)=>{if("bounds_changed"===t){const e=this.rectangle.getBounds();if(e){const i={north:e.getNorthEast().lat(),south:e.getSouthWest().lat(),east:e.getNorthEast().lng(),west:e.getSouthWest().lng()};this.dispatchEvent(new CustomEvent(t,{detail:i,bubbles:!0,composed:!0}))}}else this.dispatchEvent(new CustomEvent(t,{detail:e,bubbles:!0,composed:!0}))}))}cleanup(){Li(this.eventListeners),this.rectangle&&(this.rectangle.setMap(null),this.rectangle=void 0)}getRectangle(){return this.rectangle}render(){return ut``}};ns([zi({type:Object})],hs.prototype,"bounds",2),ns([zi({type:Boolean})],hs.prototype,"editable",2),ns([zi({type:Boolean})],hs.prototype,"draggable",2),ns([zi({type:Object})],hs.prototype,"options",2),ns([Ai()],hs.prototype,"rectangle",2),ns([Ai()],hs.prototype,"map",2),hs=ns([si("gmap-rectangle")],hs);var ds=Object.defineProperty,cs=Object.getOwnPropertyDescriptor,ps=(t,e,i,s)=>{for(var r,o=s>1?void 0:s?cs(e,i):e,a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s?r(e,i,o):r(o))||o);return s&&o&&ds(e,i,o),o};let us=class extends Et{constructor(){super(...arguments),this.gridSize=60,this.markers=[]}async connectedCallback(){super.connectedCallback(),await this.initCluster()}disconnectedCallback(){super.disconnectedCallback(),this.cleanup()}async initCluster(){const t=this.closest("gmap-map");t&&(this.addEventListener("gmap-ready",(t=>{this.map=t.detail.map,this.createCluster()})),t.getMap&&(this.map=t.getMap(),this.map&&await this.createCluster())),this.addEventListener("gmap-marker-ready",(t=>{this.addMarker(t.detail.marker)}))}async createCluster(){if(this.map)try{const t=await import("./p-BkPzCq-C.js").catch((()=>null));if(!t)return void console.error("GMapCluster: @googlemaps/markerclusterer not found. Install with: npm install @googlemaps/markerclusterer");const{MarkerClusterer:e}=t,i={map:this.map,markers:this.markers};this.gridSize&&(i.gridSize=this.gridSize),void 0!==this.maxZoom&&(i.maxZoom=this.maxZoom),this.styles&&(i.styles=this.styles),this.calculator&&(i.calculator=this.calculator),this.markerClusterer=new e(i)}catch(t){console.error("GMapCluster: Error creating cluster:",t)}}addMarker(t){this.markers.includes(t)||(this.markers.push(t),this.markerClusterer&&this.markerClusterer.addMarker(t))}cleanup(){this.markerClusterer&&(this.markerClusterer.clearMarkers(),this.markerClusterer=void 0),this.markers=[]}getClusterer(){return this.markerClusterer}render(){return ut`<slot></slot>`}};ps([zi({type:Number})],us.prototype,"gridSize",2),ps([zi({type:Number})],us.prototype,"maxZoom",2),ps([zi({type:Array})],us.prototype,"styles",2),ps([zi({type:Function})],us.prototype,"calculator",2),ps([Ai()],us.prototype,"map",2),ps([Ai()],us.prototype,"markerClusterer",2),ps([Ai()],us.prototype,"markers",2),us=ps([si("gmap-cluster")],us);var bs=Object.defineProperty,ms=Object.getOwnPropertyDescriptor,gs=(t,e,i,s)=>{for(var r,o=s>1?void 0:s?ms(e,i):e,a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s?r(e,i,o):r(o))||o);return s&&o&&bs(e,i,o),o};let fs=class extends Et{constructor(){super(...arguments),this.zoom=0,this.visible=!0,this.motionTracking=!0,this.options={},this.eventListeners=[]}async connectedCallback(){super.connectedCallback()}async firstUpdated(){await ii,this.createPanorama()}disconnectedCallback(){super.disconnectedCallback(),this.cleanup()}updated(t){super.updated(t),this.panorama&&(t.has("position")&&this.position&&this.panorama.setPosition(this.position),t.has("pano")&&this.pano&&this.panorama.setPano(this.pano),t.has("zoom")&&void 0!==this.zoom&&this.panorama.setZoom(this.zoom),t.has("pov")&&this.pov&&this.panorama.setPov(this.pov),t.has("visible")&&this.panorama.setVisible(this.visible),t.has("motionTracking")&&this.panorama.setMotionTracking(this.motionTracking))}createPanorama(){if(!this.panoramaElement)return;const t={position:this.position,pano:this.pano,zoom:this.zoom,pov:this.pov,visible:this.visible,motionTracking:this.motionTracking,...this.options};this.panorama=new google.maps.StreetViewPanorama(this.panoramaElement,t),this.eventListeners=Mi(this.panorama,["closeclick","status_changed"],((t,e)=>{this.dispatchEvent(new CustomEvent(t,{detail:e,bubbles:!0,composed:!0}))}))}cleanup(){Li(this.eventListeners),this.panorama=void 0}resize(){this.panorama&&google.maps.event.trigger(this.panorama,"resize")}getPanorama(){return this.panorama}render(){return ut`<div class="panorama"></div>`}};fs.styles=I`
1013
+ :host {
1014
+ display: block;
1015
+ position: relative;
1016
+ width: 100%;
1017
+ height: 400px;
1018
+ }
1019
+
1020
+ .panorama {
1021
+ width: 100%;
1022
+ height: 100%;
1023
+ }
1024
+ `,gs([zi({type:Object})],fs.prototype,"position",2),gs([zi({type:String})],fs.prototype,"pano",2),gs([zi({type:Number})],fs.prototype,"zoom",2),gs([zi({type:Object})],fs.prototype,"pov",2),gs([zi({type:Boolean})],fs.prototype,"visible",2),gs([zi({type:Boolean})],fs.prototype,"motionTracking",2),gs([zi({type:Object})],fs.prototype,"options",2),gs([$i(".panorama")],fs.prototype,"panoramaElement",2),gs([Ai()],fs.prototype,"panorama",2),fs=gs([si("gmap-street-view-panorama")],fs);var vs='<svg width="15" height="14" viewBox="0 0 15 14" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path\n d="M1.14453 5.83032L1.14453 9.16486C1.14453 11.0511 1.14453 11.9943 1.73032 12.5803C2.3161 13.1663 3.25891 13.1663 5.14453 13.1663L9.14453 13.1663C11.0301 13.1663 11.9729 13.1663 12.5587 12.5803C13.1445 11.9943 13.1445 11.0511 13.1445 9.16486V5.83032"\n stroke="currentcolor" stroke-linecap="round" />\n <path\n d="M9.14453 10.1619C8.68846 10.5667 7.9624 10.8285 7.14453 10.8285C6.32666 10.8285 5.60059 10.5667 5.14453 10.1619"\n stroke="currentcolor" stroke-linecap="round" />\n <path\n d="M5.90256 4.44533C5.71455 5.12426 5.03086 6.29542 3.73185 6.46516C2.58488 6.61502 1.71497 6.11437 1.49277 5.90504C1.24779 5.7353 0.689441 5.19216 0.552703 4.85269C0.415966 4.51322 0.575492 3.77771 0.689441 3.47785L1.14495 2.15892C1.25615 1.82765 1.51646 1.04411 1.78334 0.779094C2.05022 0.514073 2.59054 0.502543 2.81294 0.502543L7.48329 0.502543C8.68543 0.519525 11.3139 0.491824 11.8335 0.502545C12.3532 0.513266 12.6654 0.948828 12.7565 1.13553C13.5318 3.01341 13.8333 4.08889 13.8333 4.54717C13.7321 5.03605 13.3133 5.95787 11.8335 6.36332C10.2956 6.7847 9.42363 5.96509 9.15007 5.65043M5.27015 5.65044C5.48665 5.91635 6.16578 6.45158 7.15029 6.46516C8.1348 6.47873 8.98485 5.79188 9.28681 5.44676C9.37227 5.34492 9.55687 5.04279 9.7483 4.44533"\n stroke="currentcolor" stroke-linecap="round" stroke-linejoin="round" />\n</svg>\n ';const ys={lat:24.7756042,lng:46.7360729},ws="salla-bullet-delivery-override-ip";function xs(t,e){localStorage.getItem("salla-bullet-delivery-debug")&&(void 0!==e?console.log(t,e):console.log(t))}const ks=class{constructor(i){t(this,i),this.bulletDeliveryConfirmed=e(this,"bulletDeliveryConfirmed"),this.bulletDeliveryClosed=e(this,"bulletDeliveryClosed"),this.addressCreated=e(this,"addressCreated"),this.headerContextUpdate=e(this,"headerContextUpdate"),this.confirming=!1,this.pendingCartSubmitResolver=null,this.pendingCartSubmitPromise=null,this.cartSubmitConfirmationPending=!1,this.branchSearchDebounceTimer=null,this.countrySearchTimer=null,this.regionSearchTimer=null,this.citySearchTimer=null,this.districtSearchTimer=null,this.citySearchCounter=0,this.componentReady=!1,this.pendingOpen=!1,this.tabChanging=!1,this.intentStorageKey="bullet_delivery_intent",this.sessionShownKey="bullet_delivery_shown",this.incompleteIntentPromptKey="bullet_delivery_incomplete_intent_prompted",this.cartItemAddedEvent="cart::item.added",this.cartItemAddedHandler=null,this.cartSubmittingHandler=null,this.useCartEventApi=!1,this.authLoggedInHandler=null,this.authLoggedOutHandler=null,this.loginClosedHandler=null,this.hasExplicitPreselectedIdsForOpen=!1,this.bulletDeliveryOpenHandler=t=>{this.preselectedAddressId=t?.preselected_address_id,this.preselectedBranchId=t?.preselected_branch_id,this.hasExplicitPreselectedIdsForOpen=null!=t?.preselected_address_id||null!=t?.preselected_branch_id,this.open()},this.closeHandler=null,this.bulletDeliveryMobileSelectHandler=null,this.savedAddressesLoaded=!1,this.gmapRef=null,this.autoGeolocationTriggered=!1,this.geocodeRequestId=0,this.activeTab="address",this.isLoggedIn=!1,this.viewMode="main",this.countries=[],this.regions=[],this.cities=[],this.districts=[],this.loadingRegions=!1,this.selectedCountry=null,this.selectedRegion=null,this.selectedCity=null,this.selectedDistrict=null,this.districtName="",this.savedAddresses=[],this.selectedSavedAddress=null,this.selectedSessionAddress=!1,this.branches=[],this.filteredBranches=[],this.selectedBranch=null,this.branchSearchQuery="",this.loadingCountries=!1,this.loadingCities=!1,this.loadingDistricts=!1,this.loadingBranches=!1,this.loadingNearestBranch=!1,this.locationError="",this.savingAddress=!1,this.loadingSavedAddresses=!1,this.showCartWillBeClearedBanner=!1,this.countrySearchQuery="",this.regionSearchQuery="",this.citySearchQuery="",this.districtSearchQuery="",this.searchingCountries=!1,this.searchingRegions=!1,this.searchingCities=!1,this.searchingDistricts=!1,this.displayedCountries=[],this.displayedRegions=[],this.displayedCities=[],this.displayedDistricts=[],this.allocationOutOfCoverageMessage=null,this.mapLocationData=null,this.addressToken=null,this.loadingToken=!1,this.mapReady=!1,this.mapStep="map",this.addressDescription="",this.reverseGeocoding=!1,this.newAddressForm={...ks.INITIAL_ADDRESS_FORM},this.handleCountrySearch=t=>{this.countrySearchQuery=t},this.handleRegionSearch=t=>{this.regionSearchQuery=t},this.handleCitySearch=t=>{if(this.citySearchQuery=t,this.citySearchTimer&&clearTimeout(this.citySearchTimer),!t.trim())return this.displayedCities=this.cities,void(this.searchingCities=!1);if(t.trim().length<ks.DROPDOWN_SEARCH_MIN_CHARS)return;const e=++this.citySearchCounter;this.citySearchTimer=setTimeout((async()=>{this.searchingCities=!0;try{const i=o(this.selectedCountry?.code??"")?this.selectedRegion?.id:void 0,s=await a.getCities(this.selectedCountry?.id,i,t);e===this.citySearchCounter&&(this.displayedCities=s)}catch{e===this.citySearchCounter&&(this.displayedCities=this.cities)}finally{e===this.citySearchCounter&&(this.searchingCities=!1)}}),ks.DROPDOWN_SEARCH_DEBOUNCE_MS)},this.handleDistrictSearch=t=>{this.districtSearchQuery=t},this.handleCountryDropdownClosed=()=>{this.countrySearchQuery="",this.displayedCountries=this.countries,this.searchingCountries=!1},this.handleRegionDropdownClosed=()=>{this.regionSearchQuery="",this.displayedRegions=this.regions,this.searchingRegions=!1},this.handleCityDropdownClosed=()=>{this.citySearchQuery="",this.citySearchTimer&&(clearTimeout(this.citySearchTimer),this.citySearchTimer=null),++this.citySearchCounter,this.displayedCities=this.cities,this.searchingCities=!1},this.handleDistrictDropdownClosed=()=>{this.districtSearchQuery="",this.displayedDistricts=this.districts,this.searchingDistricts=!1},this.handleMapLocationChanged=t=>{const e=t.detail;if(!e?.position?.lat||!e?.position?.lng)return;const{lat:i,lng:s}=e.position;this.mapLocationData={lat:i,lng:s,shortAddress:e.place?.placeId??e.place?.place_id??void 0,formattedAddress:e.place?.formattedAddress??e.place?.formatted_address??void 0},this.updateLocationBias(),setTimeout((()=>{const t=this.gmapRef?.locationMarker;t&&(t.gmpDraggable=!1)}),100),this.mapLocationData.formattedAddress?this.invalidatePendingGeocode():this.reverseGeocodeLocation(i,s)},this.handleMapReady=()=>{if(this.mapReady=!0,this.gmapRef&&"function"==typeof this.gmapRef.resize&&this.gmapRef.resize(),this.updateLocationBias(),!this.autoGeolocationTriggered&&!this.hasMapLocation()&&this.gmapRef){const t=this.gmapRef.getCurrentLocation;if("function"==typeof t){this.autoGeolocationTriggered=!0;try{const e=t.call(this.gmapRef,!0);e&&"function"==typeof e.catch&&e.catch((t=>xs("Auto geolocation failed",t)))}catch(t){xs("Auto geolocation threw",t)}}}},this.handleSubmitAddAddress=async t=>{if(t.preventDefault(),this.savingAddress)return;const e=this.hasMapLocation();if((e||this.selectedCountry&&this.selectedCity)&&(e||l(this.selectedCountry?.code,this.selectedRegion?.id,this.selectedDistrict?.id??(this.districtName?.trim()||null)))){this.savingAddress=!0;try{const t=this.buildAddressLocationPayload(),{success:e,address:i}=await a.saveAddressLocation(t);if(e){await this.loadSavedAddresses();const t=i??this.savedAddresses[0]??null;t?.is_in_coverage&&(this.selectedSessionAddress=!1,this.selectedSavedAddress=t),this.addressCreated.emit({address:t}),this.viewMode="main",this.districtName="",this.mapLocationData=null,this.invalidatePendingGeocode(),this.mapStep="map",this.addressDescription=""}else this.isLoggedIn?Salla.notify?.error(Salla.lang.get("common.errors.error_occurred")):(Salla.notify?.error(Salla.lang.get("pages.checkout.login_to_use_saved_addresses")),this.handleLogin())}catch(t){console.error("SallaBulletDelivery: Error saving address",t),this.isLoggedIn?Salla.notify?.error(Salla.lang.get("common.errors.error_occurred")):(Salla.notify?.error(Salla.lang.get("pages.checkout.login_to_use_saved_addresses")),this.handleLogin())}finally{this.savingAddress=!1}}},this.handleCountrySelected=t=>{const e=this.countries.find((e=>String(e.id)===String(t.id)))||t;this.countrySearchQuery="",this.displayedCountries=this.countries,this.applyCountryChange(e||null)},this.handleRegionSelected=t=>{const e=this.regions.find((e=>String(e.id)===String(t.id)))||t;this.selectedRegion=e||null,this.regionSearchQuery="",this.displayedRegions=this.regions,this.updateNewAddressForm({region_id:e?.id,city_id:void 0,district_id:void 0,city:void 0,district:void 0}),e&&this.selectedCountry&&this.loadCities(this.selectedCountry.id,e.id)},this.handleCitySelected=t=>{const e=o(this.selectedCountry?.code??""),i=this.cities.find((e=>String(e.id)===String(t.id)))||t;this.selectedCity=i||null,this.selectedDistrict=null,this.districtName="",this.citySearchQuery="",this.displayedCities=this.cities,i&&(this.updateNewAddressForm({city:i,district:void 0}),e&&this.loadDistricts(i.id))},this.handleDistrictSelected=t=>{const e=this.districts.find((e=>String(e.id)===String(t.id)))||t;this.selectedDistrict=e||null,this.districtName="",this.districtSearchQuery="",this.displayedDistricts=this.districts,e&&this.updateNewAddressForm({district:e})}}get supportsPickup(){return Boolean(Salla.config.get("store.shipping.support_pickup"))||Boolean(Salla.config.get("store.support_pickup"))}get openingType(){return Salla.config.get("store.settings.bullet_delivery.settings.type")}get isRequired(){return!!Salla.config.get("store.settings.bullet_delivery.settings.is_required")}get isSupportsDelivery(){return!!Salla.config.get("store.settings.bullet_delivery.supports_delivery")}get isEnabled(){return!!Salla.config.get("store.features")?.includes("bullet-delivery-v2")&&!0===Salla.config.get("store.settings.bullet_delivery.enabled")}get isMobileApp(){return Salla.config.isMobileApp()}async open(){if(this.isEnabled)if(this.isMobileApp)Salla.event.dispatch("salla::bullet-delivery.open-sheet");else if(this.componentReady&&this.modal){this.resetState(),this.modal.open(),Salla.event.dispatch("salla::bullet-delivery.modal.opened");try{this.isLoggedIn=!this.isGuestUser();const t=this.cleanStaleGuestAddressIdIfNeeded(this.getStoredIntent());this.applyPreselectedIdsFromIntent(t);const e=!this.isLoggedIn&&"address"===t?.type&&null!=p(t)&&null!=c(t);if(this.activeTab=this.supportsPickup&&!this.isSupportsDelivery?"branch":this.supportsPickup&&t?.type&&("address"===t.type||"branch"===t.type)?t.type:"address",this.fetchAddressToken(),this.isLoggedIn&&"address"===this.activeTab&&(this.loadingSavedAddresses=!0),await Promise.all([this.loadCountries(e),this.isLoggedIn&&"address"===this.activeTab?this.loadSavedAddresses().then((()=>{this.savedAddressesLoaded=!0})).finally((()=>{this.loadingSavedAddresses=!1})):Promise.resolve()]),this.isLoggedIn&&this.preselectedAddressId){const t=this.savedAddresses.find((t=>t.id===this.preselectedAddressId));t&&(this.selectedSessionAddress=!1,this.selectedSavedAddress=t)}if("branch"===this.activeTab){const e=n(t),i=h(t);if(null!=e&&null!=i?await this.loadBranchesWithLocation(e,i):await this.loadBranches(),this.preselectedBranchId){const t=this.branches.find((t=>t.id===this.preselectedBranchId));t&&(this.selectedBranch=t)}}await this.prefillFromSessionStorage()}catch(t){console.error("SallaBulletDelivery: Error loading data",t)}finally{this.overrideScopeSwitchUI()}}else this.pendingOpen=!0}async close(){if(!this.shouldForceNonClosable()||this.confirming)return this.cartSubmitConfirmationPending&&!this.confirming&&this.resolvePendingCartSubmit(),this.bulletDeliveryClosed.emit(),this.modal?.close()}resetState(){this.viewMode="main",this.mapLocationData=null,this.invalidatePendingGeocode(),this.autoGeolocationTriggered=!1,this.selectedCountry=null,this.selectedRegion=null,this.selectedCity=null,this.selectedDistrict=null,this.districtName="",this.selectedSavedAddress=null,this.selectedSessionAddress=!1,this.selectedBranch=null,this.branchSearchQuery="",this.regions=[],this.cities=[],this.districts=[],this.branches=[],this.filteredBranches=[],this.newAddressForm={...ks.INITIAL_ADDRESS_FORM},this.showCartWillBeClearedBanner=!1,this.allocationOutOfCoverageMessage=null,this.locationError="",this.savedAddressesLoaded=!1,this.loadingSavedAddresses=!1,this.loadingCountries=!1,this.resetSearchState()}getIntentStorage(){const t=Boolean(Salla.config.get("store.settings.bullet_delivery.settings.remember_last_session"));return Salla.storage[t?"store":"session"]}getShownStorage(){return Salla.storage.session}getStoredIntent(){return this.getIntentStorage().get(this.intentStorageKey)}isGuestUser(){return"guest"===String(Salla.config.get("user.type")??"guest")}cleanStaleGuestAddressIdIfNeeded(t){if(!this.isGuestUser()||"address"!==t?.type||!t.address_id)return t;const e={...t,address_id:void 0};return this.setStoredIntent(e),e}applyPreselectedIdsFromIntent(t){this.hasExplicitPreselectedIdsForOpen?this.hasExplicitPreselectedIdsForOpen=!1:(this.preselectedAddressId=void 0,this.preselectedBranchId=void 0,this.isGuestUser()?"branch"===t?.type&&t.branch_id&&(this.preselectedBranchId=t.branch_id):"address"===t?.type&&t.address_id?this.preselectedAddressId=t.address_id:"branch"===t?.type&&t.branch_id&&(this.preselectedBranchId=t.branch_id))}hasIncompleteUserAddressIntent(){if(this.isGuestUser())return!1;const t=this.getStoredIntent();return!(!t||"address"!==t.type||t.address_id||!t.address_details)&&d(t)}isIntentMethodSupported(t){return"branch"===t.type?this.supportsPickup:"address"===t.type&&this.isSupportsDelivery}hasCompleteIntentForLoggedInUser(){if(this.isGuestUser())return!1;const t=this.getStoredIntent();return!!(t&&this.isIntentMethodSupported(t)&&("address"===t.type?t.address_id:"branch"===t.type&&t.branch_id))}shouldForceNonClosable(){return!this.isGuestUser()&&!!Salla.url.is_page("cart")&&!this.hasCompleteIntentForLoggedInUser()}shouldPromptIncompleteIntentThisSession(){const t=this.getShownStorage();return this.hasIncompleteUserAddressIntent()&&!0!==t.get(this.incompleteIntentPromptKey)}markIncompleteIntentPrompted(){this.getShownStorage().set(this.incompleteIntentPromptKey,!0)}setStoredIntent(t){this.getIntentStorage().set(this.intentStorageKey,t),this.overrideScopeSwitchUI()}clearBulletDeliveryStoredData(){Salla.storage.session.remove(this.intentStorageKey),Salla.storage.store.remove(this.intentStorageKey),Salla.storage.session.remove(this.sessionShownKey),Salla.storage.session.remove(this.incompleteIntentPromptKey),this.overrideScopeSwitchUI()}async prefillAddressFromStoredIntent(){const t=this.getStoredIntent();if(!t||"address"!==t.type||null==c(t))return;const e=p(t);if(!e)return;const i=this.countries.find((t=>String(t.id)===String(e)));if(!i)return;this.selectedCountry=i,this.updateNewAddressForm({country_id:Number(i.id)});const s=o(i.code),r=c(t),l=u(t),n=b(t),h=t.address_details?.district?.name,[d,m,g]=await Promise.all([s?a.getRegions(i.id):Promise.resolve([]),a.getCities(i.id,s&&null!=l?l:void 0),null!=r?a.getDistricts(Number(r)):Promise.resolve([])]);if(s&&(this.regions=d,this.displayedRegions=this.regions),this.cities=m,this.displayedCities=this.cities,this.districts=g,this.displayedDistricts=this.districts,this.loadingCities=!1,this.loadingRegions=!1,this.loadingDistricts=!1,s&&null!=l){const t=this.regions.find((t=>String(t.id)===String(l)));t&&(this.selectedRegion=t,this.updateNewAddressForm({region_id:t.id}))}if(null!=r&&this.cities.length>0){const t=this.cities.find((t=>String(t.id)===String(r)));t&&(this.selectedCity=t,this.updateNewAddressForm({city_id:t.id,city:t}))}if(this.districts.length>0){const t=this.findPrefillDistrict(n,h);t&&(this.updateNewAddressForm({district_id:t.id,district:t}),this.selectedDistrict=t)}!this.selectedDistrict&&h&&(this.districtName=h)}updateNewAddressForm(t){this.newAddressForm={...this.newAddressForm,...t}}hasBeenShownThisSession(){return!0===this.getShownStorage().get(this.sessionShownKey)}markShownThisSession(){this.getShownStorage().set(this.sessionShownKey,!0)}getIPLocationConfig(){const t="store.shipping.delivery_location",e={countryId:Salla.config.get(`${t}.country_id`),regionId:Salla.config.get(`${t}.region_id`),cityId:Salla.config.get(`${t}.city_id`),districtId:Salla.config.get(`${t}.district_id`)};return localStorage.getItem(ws)?JSON.parse(localStorage.getItem(ws)):e}async loadCountries(t=!1){this.loadingCountries=!0;const e="branch"===this.activeTab;try{this.countries=await a.getCountries(e),this.displayedCountries=this.countries;const{countryId:i,regionId:s,cityId:r,districtId:l}=this.getIPLocationConfig();xs("getIPLocationConfig",this.getIPLocationConfig());const n=i&&this.countries.length>0?this.countries.find((t=>String(t.id)===String(i))):null;n&&(this.selectedCountry=n,this.updateNewAddressForm({country_id:Number(this.selectedCountry.id)}),!t)&&(null!=s||null!=r||null!=l?await this.prefillFromIPLocation(n,{regionId:s,cityId:r,districtId:l}):o(this.selectedCountry.code)?await this.loadRegions(this.selectedCountry.id):await this.loadCities(this.selectedCountry.id))}finally{this.loadingCountries=!1}}async prefillFromIPLocation(t,e){const i=o(t.code),{regionId:s,cityId:r,districtId:l}=e,[n,h,d]=await Promise.all([i?a.getRegions(t.id):Promise.resolve([]),a.getCities(t.id,i&&null!=s?s:void 0),null!=r?a.getDistricts(Number(r)):Promise.resolve([])]);if(i&&(this.regions=n,this.displayedRegions=this.regions),this.cities=h,this.displayedCities=this.cities,this.districts=d,this.displayedDistricts=this.districts,this.loadingRegions=!1,this.loadingCities=!1,this.loadingDistricts=!1,i&&null!=s){const t=this.regions.find((t=>String(t.id)===String(s)));t&&(this.selectedRegion=t,this.updateNewAddressForm({region_id:t.id}))}if(null!=r&&this.cities.length>0){const t=this.cities.find((t=>String(t.id)===String(r)));t&&(this.selectedCity=t,this.updateNewAddressForm({city_id:t.id,city:t}))}if(null!=l&&this.districts.length>0){const t=this.findPrefillDistrict(l);t&&(this.selectedDistrict=t,this.updateNewAddressForm({district_id:t.id,district:t}))}}async loadCities(t,e){this.loadingCities=!0,this.cities=[],this.displayedCities=[],this.districts=[],this.displayedDistricts=[],this.selectedCity=null,this.selectedDistrict=null,this.districtName="";try{this.cities=await a.getCities(t,e),this.displayedCities=this.cities}finally{this.loadingCities=!1}}async loadDistricts(t){this.loadingDistricts=!0,this.districts=[],this.displayedDistricts=[],this.selectedDistrict=null,this.districtName="";try{this.districts=await a.getDistricts(t),this.displayedDistricts=this.districts}finally{this.loadingDistricts=!1}}findPrefillDistrict(t,e){if(0===this.districts.length)return;if(null!=t){const e=this.districts.find((e=>String(e.id)===String(t)));if(e)return e}const i=e?.trim().toLowerCase();return i?this.districts.find((t=>{const e=t.name?.trim().toLowerCase(),s=t.name_en?.trim().toLowerCase();return e===i||s===i})):void 0}async loadBranches(){this.loadingBranches=!0;try{this.branches=await a.getBranches({country_id:this.selectedCountry?.id}),this.filterBranches()}finally{this.loadingBranches=!1}}filterBranches(){this.filteredBranches=m(this.branches,this.branchSearchQuery)}async prefillFromSessionStorage(){try{const t=this.getStoredIntent();if(!t)return;if("address"!==this.activeTab||"address"!==t.type||this.isLoggedIn||await this.prefillAddressFromStoredIntent(),"branch"===this.activeTab&&"branch"===t.type){const e=p(t);if(null!=e){const i=this.countries.find((t=>String(t.id)===String(e)));if(i){this.selectedCountry=i,this.updateNewAddressForm({country_id:Number(i.id)});const e=x(t);if(null!=e&&this.branches.length>0){const t=this.branches.find((t=>t.id===e));t&&(this.selectedBranch=t)}}}}}catch(t){console.error("[BulletDelivery] Error prefilling from session storage:",t)}}async loadSavedAddresses(){const t=this.selectedSavedAddress?.id;this.savedAddresses=await a.getSavedAddresses();const e=this.getStoredIntent();if(d(e))return this.selectedSessionAddress=!0,void(this.selectedSavedAddress=null);if(null!=t){const e=this.savedAddresses.find((e=>e.id===t&&!1!==e.is_in_coverage));if(e)return this.selectedSessionAddress=!1,void(this.selectedSavedAddress=e)}const i=this.savedAddresses.find((t=>t.is_default&&!1!==t.is_in_coverage));if(i)this.selectedSavedAddress=i;else{const t=this.savedAddresses.find((t=>!1!==t.is_in_coverage));t&&(this.selectedSavedAddress=t)}}applyCountryChange(t){this.selectedCountry=t,this.selectedRegion=null,this.regions=[],this.displayedRegions=[],this.cities=[],this.displayedCities=[],this.districts=[],this.displayedDistricts=[],this.selectedCity=null,this.selectedDistrict=null,this.districtName="",this.allocationOutOfCoverageMessage=null,this.regionSearchQuery="",this.citySearchQuery="",this.districtSearchQuery="",this.searchingRegions=!1,this.searchingCities=!1,this.searchingDistricts=!1,this.clearSearchTimers(),this.selectedCountry&&(this.updateNewAddressForm({country_id:Number(this.selectedCountry.id),region_id:void 0,city_id:void 0,district_id:void 0,city:void 0,district:void 0}),"branch"===this.activeTab?this.loadBranches():o(this.selectedCountry.code)?this.loadRegions(this.selectedCountry.id):this.loadCities(this.selectedCountry.id))}async loadRegions(t){this.loadingRegions=!0,this.regions=[],this.displayedRegions=[],this.selectedRegion=null,this.cities=[],this.displayedCities=[],this.districts=[],this.displayedDistricts=[],this.selectedCity=null,this.selectedDistrict=null,this.districtName="";try{this.regions=await a.getRegions(t),this.displayedRegions=this.regions}finally{this.loadingRegions=!1}}emitHeaderContextUpdate(t,e,i){let s="";"address"===t.type?e?s=e.district?.name&&e.city?.name?`${e.district.name}، ${e.city.name}`:e.city?.name??"":this.isGuestMapPick?s=t.address_details?.formatted_address??"":this.selectedCity?s=this.selectedDistrict?`${this.selectedDistrict.name}، ${this.selectedCity.name}`:this.selectedCity.name:t.address_details&&(s=[t.address_details.district?.name,t.address_details.city?.name,t.address_details.country?.name].filter(Boolean).join("، ")||t.address_details.formatted_address||t.address_details.short_address||""):i?s=i.name:t.branch_details&&(s=t.branch_details.city??t.branch_details.name);const r="address"===t.type?Salla.lang.get("mobile_app.strings.delivery"):Salla.lang.get("mobile_app.strings.pickup");this.headerContextUpdate.emit({type:t.type,display_text:s?`${r}: ${s}`:"",country_code:t.country_code,city:this.selectedCity?.name??t.address_details?.city?.name,district:this.selectedDistrict?.name??t.address_details?.district?.name,branch_name:i?.name??t.branch_details?.name})}handleBranchSearch(t){const e=t.target.value;if(this.branchSearchQuery=e,this.branchSearchDebounceTimer&&clearTimeout(this.branchSearchDebounceTimer),!e?.trim())return this.branchSearchQuery="",void this.loadBranches();this.branchSearchDebounceTimer=setTimeout((async()=>{if(!(e.trim().length<2)){this.loadingBranches=!0;try{this.branches=await a.getBranches({country_id:this.selectedCountry?.id,query:e}),this.filterBranches()}finally{this.loadingBranches=!1}}}),1e3)}clearSearchTimers(){[this.countrySearchTimer,this.regionSearchTimer,this.citySearchTimer,this.districtSearchTimer].forEach((t=>{t&&clearTimeout(t)})),this.countrySearchTimer=this.regionSearchTimer=this.citySearchTimer=this.districtSearchTimer=null}resetSearchState(){this.countrySearchQuery="",this.regionSearchQuery="",this.citySearchQuery="",this.districtSearchQuery="",this.searchingCountries=!1,this.searchingRegions=!1,this.searchingCities=!1,this.searchingDistricts=!1,this.displayedCountries=[],this.displayedRegions=[],this.displayedCities=[],this.displayedDistricts=[],this.clearSearchTimers()}async loadBranchesWithLocation(t,e){this.loadingBranches=!0;try{if(this.branches=await a.getBranches({country_id:this.selectedCountry?.id,lat:t,lng:e}),this.filterBranches(),!this.selectedCountry&&this.branches.length>0){const t=this.branches[0];if(t.country){const e=this.countries.find((e=>e.id===t.country.id));e&&(this.selectedCountry=e,this.updateNewAddressForm({country_id:Number(e.id)}))}}}finally{this.loadingBranches=!1}}async handleFindNearestBranch(){if(navigator.geolocation){this.loadingNearestBranch=!0,this.locationError="";try{const t=await new Promise(((t,e)=>{navigator.geolocation.getCurrentPosition(t,e,{enableHighAccuracy:!0,timeout:1e4,maximumAge:0})})),{latitude:e,longitude:i}=t.coords;await this.loadBranchesWithLocation(e,i);const s=g(this.branches,e,i);s&&(this.selectedBranch=s,this.branchSearchQuery="",this.filterBranches())}catch(t){const e=t;this.locationError=f("number"==typeof e?.code?e.code:-1)}finally{this.loadingNearestBranch=!1}}else this.locationError=Salla.lang.get("pages.checkout.current_location_not_supported")}handleBranchSelect(t){this.selectedBranch=t}handleSavedAddressSelect(t){!1!==t.is_in_coverage?(this.selectedSavedAddress=t,this.selectedSessionAddress=!1):Salla.notify?.error(Salla.lang.get("pages.checkout.shipping_not_available"))}handleSessionAddressSelect(){this.selectedSessionAddress=!0,this.selectedSavedAddress=null}async handleAddNewAddress(){this.viewMode="add-address",this.mapLocationData=null,this.invalidatePendingGeocode(),this.autoGeolocationTriggered=!1,this.fetchAddressToken();const t=this.getStoredIntent(),e=p(t);if(e&&this.countries.length>0){const t=this.countries.find((t=>t.id===e));t&&(this.selectedCountry=t,this.updateNewAddressForm({country_id:Number(t.id)}),o(t.code)?await this.loadRegions(t.id):await this.loadCities(t.id))}}handleBackToAddressList(){this.viewMode="main",this.mapLocationData=null,this.invalidatePendingGeocode(),this.mapStep="map",this.addressDescription="",this.autoGeolocationTriggered=!1}async fetchAddressToken(){if(!this.addressToken&&!this.loadingToken){this.loadingToken=!0;try{const t=salla.config.get("store.settings.keys.maps");t&&function(t,e){if(typeof document>"u")return Promise.resolve();if(ti)return ii;let i;ti=!0,i={...t},Array.isArray(i.libraries)&&(i.libraries=i.libraries),!e&&!i.v&&(e="quarterly"),i.loading||(i.loading="async"),i.callback="googleMapsInitCallback";let s=`https://maps.googleapis.com/maps/api/js?${Object.keys(i).map((t=>`${encodeURIComponent(t)}=${encodeURIComponent(i[t])}`)).join("&")}`;e&&(s+=`&v=${e}`);const r=document.createElement("script");return r.src=s,r.async=!0,r.defer=!0,r.onerror=t=>{console.error("Failed to load Google Maps script:",t)},document.body.appendChild(r),ii}({key:t,libraries:["marker","places"],language:salla.config.get("user.language_code")||"ar"}).catch((t=>xs("Failed to load Google Maps SDK",t))),this.addressToken=await a.getAddressToken()}catch{xs("SallaBulletDelivery: Failed to fetch address token")}finally{this.loadingToken=!1}}}invalidatePendingGeocode(){this.reverseGeocoding=!1,this.geocodeRequestId++}applyCoordsFallback(t,e){this.mapLocationData={...this.mapLocationData,formattedAddress:this.mapLocationData?.formattedAddress??`${t.toFixed(6)}, ${e.toFixed(6)}`}}reverseGeocodeLocation(t,e){const i=window.google?.maps?.Geocoder;if(!i)return this.geocodeRequestId++,void this.applyCoordsFallback(t,e);this.reverseGeocoding=!0;const s=++this.geocodeRequestId;(new i).geocode({location:{lat:t,lng:e}},((i,r)=>{s===this.geocodeRequestId&&(this.reverseGeocoding=!1,r===window.google.maps.GeocoderStatus.OK&&i?.[0]?this.mapLocationData={...this.mapLocationData,formattedAddress:i[0].formatted_address,shortAddress:this.mapLocationData?.shortAddress??i[0].place_id}:(xs("Reverse geocoding failed for map location",r),this.applyCoordsFallback(t,e)))}))}updateLocationBias(){if(!this.gmapRef)return;const t=this.hasMapLocation()?{lat:this.mapLocationData.lat,lng:this.mapLocationData.lng}:this.mapInitialCenter;this.gmapRef.autocompleteLocationBias={center:t,radius:5e5}}hasMapLocation(){return null!=this.mapLocationData?.lat&&null!=this.mapLocationData?.lng}canConfirmMapLocation(){return this.hasMapLocation()&&!this.reverseGeocoding&&!!this.mapLocationData?.formattedAddress}get isMapSettingEnabled(){return Salla.config.get("store.settings.bullet_delivery.settings.map_enabled")}get isMapModeAvailable(){return this.isMapSettingEnabled&&!!salla.config.get("store.settings.keys.maps")&&!!this.addressToken}get isGuestMapPick(){return!this.isLoggedIn&&this.isMapModeAvailable&&this.hasMapLocation()}get mapInitialCenter(){const t=salla.config.get("user.default_geo_location"),e=this.toCoordinate(t?.lat),i=this.toCoordinate(t?.lng);return null!=e&&null!=i&&e>=-90&&e<=90&&i>=-180&&i<=180?{lat:e,lng:i}:ys}toCoordinate(t){if("string"==typeof t&&""===t.trim())return null;if(null==t)return null;const e=Number(t);return Number.isFinite(e)?e:null}buildAddressLocationPayload(){if(this.isMapModeAvailable&&this.hasMapLocation())return{lat:this.mapLocationData.lat,lng:this.mapLocationData.lng,...this.mapLocationData.shortAddress&&{short_address:this.mapLocationData.shortAddress},...this.addressDescription?.trim()&&{description:this.addressDescription.trim()}};const t=this.selectedDistrict?.name??this.districtName?.trim()??"";return v({countryId:this.selectedCountry?.id??0,countryCode:this.selectedCountry?.code,regionId:this.selectedRegion?.id,cityId:this.selectedCity?.id,districtId:this.selectedDistrict?.id,description:t,lat:this.mapLocationData?.lat,lng:this.mapLocationData?.lng,shortAddress:this.mapLocationData?.shortAddress})}async handleTabChange(t){if(!this.tabChanging){this.tabChanging=!0;try{this.activeTab=t,"add-address"===this.viewMode&&(this.viewMode="main",this.invalidatePendingGeocode()),this.showCartWillBeClearedBanner=!1,this.allocationOutOfCoverageMessage=null,this.resetSearchState();const e="branch"===t;this.countries=await a.getCountries(e),this.displayedCountries=this.countries;const i=this.selectedCountry?.id;if(null!=i&&(this.selectedCountry=this.countries.find((t=>t.id===i))||null),!this.selectedCountry){const{countryId:t}=this.getIPLocationConfig();t&&this.countries.length>0&&(this.selectedCountry=this.countries.find((e=>String(e.id)===String(t)))||null),this.selectedCountry||1!==this.countries.length||(this.selectedCountry=this.countries[0])}if(this.selectedCountry)if("branch"===t){const t=this.getStoredIntent(),e=n(t),i=h(t);null!=e&&null!=i?await this.loadBranchesWithLocation(e,i):await this.loadBranches();const s=x(t);if(null!=s&&this.branches.length>0){const t=this.branches.find((t=>t.id===s));t&&(this.selectedBranch=t)}}else if("address"===t){if(this.isLoggedIn&&!this.savedAddressesLoaded){this.loadingSavedAddresses=!0;try{await this.loadSavedAddresses(),this.savedAddressesLoaded=!0}finally{this.loadingSavedAddresses=!1}}if(!this.isLoggedIn){const t=this.getStoredIntent();t&&c(t)&&await this.prefillAddressFromStoredIntent()}}}finally{this.tabChanging=!1}}}isConfirmDisabled(){return"branch"===this.activeTab?!this.selectedBranch:!("address"!==this.activeTab||this.isLoggedIn&&this.selectedSessionAddress||(this.isLoggedIn&&this.selectedSavedAddress?!1!==this.selectedSavedAddress.is_in_coverage:!this.isLoggedIn&&this.isMapModeAvailable?this.isGuestMapPick:this.selectedCountry&&this.selectedCity&&l(this.selectedCountry?.code,this.selectedRegion?.id,this.selectedDistrict?.id??(this.districtName?.trim()||null))))}handleLogin(){Salla.auth.setCanRedirect(!1),Salla.event.dispatch("salla::bullet-delivery.modal.close.requested"),Salla.event.dispatch("login::open",Salla.url.is_page("cart")?{withoutReload:!0,source:"cart-submit"}:{withoutReload:!0,source:"bullet-delivery"})}resolvePendingCartSubmit(){if(!this.pendingCartSubmitResolver)return;const t=this.pendingCartSubmitResolver;this.pendingCartSubmitResolver=null,this.pendingCartSubmitPromise=null,this.cartSubmitConfirmationPending=!1,t()}buildIntentAddress(){if("address"!==this.activeTab)return;if(this.isGuestMapPick&&this.mapLocationData){const{lat:t,lng:e,formattedAddress:i,shortAddress:s}=this.mapLocationData;return{country:this.selectedCountry?{id:this.selectedCountry.id,name:this.selectedCountry.name,code:this.selectedCountry.code}:void 0,lat:t,lng:e,formatted_address:i,place_id:s,description:this.addressDescription?.trim()||void 0}}if(!this.selectedCountry||!this.selectedCity)return;const t={id:this.selectedCountry.id,name:this.selectedCountry.name,code:this.selectedCountry.code},e={id:this.selectedCity.id,name:this.selectedCity.name},i=this.selectedRegion?{id:this.selectedRegion.id,name:this.selectedRegion.name,code:this.selectedRegion.code}:void 0,s=this.selectedDistrict?{id:this.selectedDistrict.id,name:this.selectedDistrict.name}:this.districtName?{id:0,name:this.districtName}:void 0,r=this.selectedSavedAddress?.short_address;return{country:t,region:i,city:e,district:s,short_address:r}}buildIntentAddressFromSaved(t){return{country:{id:t.country?.id??t.country_id??0,name:t.country?.name??"",code:t.country?.code},region:t.region?{id:t.region.id,name:t.region.name,code:t.region.code}:void 0,city:{id:t.city?.id??t.city_id??0,name:t.city?.name??""},district:t.district?{id:t.district.id,name:t.district.name}:void 0,short_address:t.short_address}}buildIntentBranch(){if("branch"!==this.activeTab||!this.selectedBranch)return;const t=this.selectedBranch,e=null!=t.location?.lat?Number(t.location.lat):void 0,i=null!=t.location?.lng?Number(t.location.lng):void 0;return{id:t.id,name:t.name,city:t.city?.name,latitude:e,longitude:i}}buildAllocationConfirmedAddressData(t){return"address"!==this.activeTab?null:{saved_address:t??this.selectedSavedAddress??void 0,country:this.selectedCountry??void 0,region:this.selectedRegion??void 0,city:this.selectedCity??void 0,district:this.selectedDistrict??void 0,district_name:this.districtName?.trim()||void 0,short_address:t?.short_address??this.selectedSavedAddress?.short_address,form_data:{...this.newAddressForm},lat:this.mapLocationData?.lat,lng:this.mapLocationData?.lng,formatted_address:this.mapLocationData?.formattedAddress}}buildAllocationConfirmedAddressFromIntent(t){if("address"!==t.type)return null;const e=t.address_details,i=Number(t.country_id)||0;return{country:e?.country?{id:e.country.id,name:e.country.name,code:e.country.code??t.country_code??""}:void 0,region:e?.region?{id:Number(e.region.id),name:e.region.name,country_id:i,code:e.region.code??void 0}:void 0,city:e?.city?{id:Number(e.city.id),name:e.city.name,country_id:i}:void 0,district:e?.district?{id:Number(e.district.id),name:e.district.name,city_id:Number(e.city?.id)||0}:void 0,short_address:e?.short_address}}buildBranchFromIntent(t){if("branch"!==t.type||!t.branch_details)return null;const e=t.branch_details,i={id:e.id,name:e.name};return e.city&&(i.city={id:0,name:e.city}),null!=e.latitude&&null!=e.longitude&&(i.location={lat:String(e.latitude),lng:String(e.longitude)}),i}buildAllocationRequestFromIntent(t){if("branch"===t.type)return{type:"branch",branch_id:null!=t.branch_id?String(t.branch_id):""};if(null!=t.address_id)return{type:"address",address_id:String(t.address_id)};const e=t.address_details,i={type:"address",country_id:null!=t.country_id?String(t.country_id):"",city_id:null!=e?.city?.id?String(e.city.id):""};return null!=e?.region?.id&&(i.region_id=String(e.region.id)),null!=e?.district?.id&&(i.district_id=String(e.district.id)),i}applyMobileBulletDeliverySelection(t){if(!t||"address"!==t.type&&"branch"!==t.type)return void console.warn("SallaBulletDelivery: ignoring invalid mobile select payload",t);const e=t.allocation_headers??{},i=e["s-scope-allocation-type"]??t.type,s=e["s-scope-allocation-id"];i&&Salla.api.setHeader("s-scope-allocation-type",i),s&&Salla.api.setHeader("s-scope-allocation-id",String(s));const r=Salla.config.get("store.scope",Salla.storage.get("scope"))||{};Salla.storage.set("scope",{...r,allocation_type:i,allocation_id:s?String(s):void 0}),this.markShownThisSession();const o={...t,allocation_headers:{"s-scope-allocation-type":i,"s-scope-allocation-id":s?String(s):void 0}};this.setStoredIntent(o),y();const a=this.buildBranchFromIntent(o),l={...o,address:this.buildAllocationConfirmedAddressFromIntent(o),branch:a,allocation_request:this.buildAllocationRequestFromIntent(o),allocation_response:null};Salla.event.dispatch("salla::bullet-delivery.allocation.confirmed",l),this.bulletDeliveryConfirmed.emit({...o,branch:a??void 0}),this.emitHeaderContextUpdate(o,void 0,a??void 0),setTimeout((()=>window.location.reload()),100)}extractMobileSelectPayload(t){return t&&"object"==typeof t?"payload"in t&&t.payload?t.payload:t:null}async handleConfirm(){if(this.isConfirmDisabled()||this.confirming)return;this.allocationOutOfCoverageMessage=null,this.confirming=!0,this.confirmBtn?.load();let t=!1;try{const e={type:this.activeTab,country_id:Number(this.selectedCountry?.id)||0,country_code:this.selectedCountry?.code||""};let i,s,r;if("address"===this.activeTab){if(this.isLoggedIn&&this.selectedSessionAddress){const t=await this.saveSessionAddressToProfile();if(!t)return Salla.notify?.error(Salla.lang.get("common.errors.error_occurred")),void this.confirmBtn?.stop();e.address_id=t.id,i=t,this.selectedSessionAddress=!1,this.selectedSavedAddress=t,e.address_details=this.buildIntentAddressFromSaved(t)}else if(this.isLoggedIn&&this.selectedSavedAddress)e.address_id=this.selectedSavedAddress.id,i=this.selectedSavedAddress,e.address_details=this.buildIntentAddressFromSaved(this.selectedSavedAddress);else if(e.address_details=this.buildIntentAddress(),this.isGuestMapPick)return this.setStoredIntent(e),this.confirmBtn?.stop(),void this.handleLogin()}else e.branch_details=this.buildIntentBranch(),e.branch_id=this.selectedBranch?.id,s=this.selectedBranch||void 0;"address"===this.activeTab?this.isLoggedIn&&i?r={type:"address",address_id:String(i.id)}:(r={type:"address",country_id:String(this.selectedCountry?.id||0),city_id:String(this.selectedCity?.id||"")},o(this.selectedCountry?.code??"")&&(this.selectedRegion?.id&&(r.region_id=String(this.selectedRegion.id)),r.district_id=String(this.selectedDistrict?.id||""))):r={type:"branch",branch_id:String(this.selectedBranch?.id||"")};const l=await a.allocateScope(r);if(!l.success){console.error("BulletDelivery: Scope allocation failed",l.error);const t=l.error||("address"===this.activeTab?Salla.lang.get("pages.checkout.address_out_of_coverage"):Salla.lang.get("pages.checkout.failed_to_set_pickup"));return this.allocationOutOfCoverageMessage=t,this.confirmBtn?.stop(),void(this.confirming=!1)}let n;if(l.data){const t=l.data;n=t.id;const i=t?.allocation?.type,s=t?.allocation?.branch_id;i&&Salla.api.setHeader("s-scope-allocation-type",i),s&&Salla.api.setHeader("s-scope-allocation-id",String(s));const r=Salla.config.get("store.scope",Salla.storage.get("scope"))||{};Salla.storage.set("scope",{...r,id:n,allocation_type:i,allocation_id:s?String(s):void 0}),e.allocation_headers={"s-scope-allocation-type":i,"s-scope-allocation-id":s?String(s):void 0}}this.markShownThisSession(),this.setStoredIntent(e),n&&(await a.setDeliveryScope(n),y());const h={...e,address:this.buildAllocationConfirmedAddressData(i),branch:s??null,allocation_request:r,allocation_response:l.data??null};Salla.event.dispatch("salla::bullet-delivery.allocation.confirmed",h),this.bulletDeliveryConfirmed.emit({...e,address:i,branch:s}),this.emitHeaderContextUpdate(e,i,s),t=!0,setTimeout((()=>{if(this.confirmBtn?.stop(),this.close(),this.confirming=!1,this.cartSubmitConfirmationPending)this.resolvePendingCartSubmit();else if(n){const t=Salla.storage.get("scope")||{};let e=Salla.helpers.addParamToUrl("scope",n);t.allocation_id&&(e=Salla.helpers.addParamToUrl("allocation_id",t.allocation_id,e)),t.allocation_type&&(e=Salla.helpers.addParamToUrl("allocation_type",t.allocation_type,e)),window.location.replace(e)}else window.location.reload()}),500)}finally{t||(this.confirming=!1)}}getCartViewConfig(t){if(!t||!Salla.url.is_page("cart"))return null;if(!this.isIntentMethodSupported(t))return null;const e="address"===t.type;return{title:"branch"===t.type?Salla.lang.get("pages.checkout.pickup_option"):Salla.lang.get("pages.checkout.delivery_option"),subtitle:w(t,Salla.lang.get("common.elements.to"),""),buttonText:Salla.lang.get("common.elements.edit"),isAddress:e,intent:t}}createCartViewElement(){const t=this.getStoredIntent(),e=this.getCartViewConfig(t);if(!e)return null;const{title:i,subtitle:s,buttonText:r,intent:o}=e,a="branch"===o.type?{preselected_branch_id:x(o)}:{preselected_address_id:o.address_id},l=document.createElement("span");l.className="s-bullet-delivery-cart-view-icon s-bullet-delivery-tab-icon",l.setAttribute("aria-hidden","true"),l.innerHTML=_;const n=document.createElement("span");n.className="s-bullet-delivery-cart-view-title",n.textContent=i;const h=document.createElement("span");h.className="s-bullet-delivery-cart-view-subtitle",h.textContent=s;const d=document.createElement("div");d.className="s-bullet-delivery-cart-view-text",d.append(n,h);const c=document.createElement("div");c.className="s-bullet-delivery-cart-view-info",c.append(l,d);const p=document.createElement("salla-button");p.className="s-bullet-delivery-cart-view-button",p.setAttribute("fill","outline"),p.setAttribute("color","primary"),p.textContent=r,p.addEventListener("click",(()=>Salla.event.emit("salla::bullet-delivery.modal.open.requested",a)));const u=document.createElement("div");return u.className="s-bullet-delivery-cart-view",u.append(c,p),u}renderTabs(){return this.supportsPickup?i("div",{class:"s-bullet-delivery-tabs"},this.isSupportsDelivery&&i("button",{type:"button",class:{"s-bullet-delivery-tab":!0,"s-bullet-delivery-tab--active":"address"===this.activeTab},onClick:()=>this.handleTabChange("address")},i("span",{class:"s-bullet-delivery-tab-icon",innerHTML:_,"aria-hidden":"true"}),i("span",null,Salla.lang.get("mobile_app.strings.delivery"))),i("button",{type:"button",class:{"s-bullet-delivery-tab":!0,"s-bullet-delivery-tab--active":"branch"===this.activeTab},onClick:()=>this.handleTabChange("branch")},i("span",{class:"s-bullet-delivery-tab-icon",innerHTML:vs,"aria-hidden":"true"}),i("span",null,Salla.lang.get("mobile_app.strings.pickup")))):null}renderAlert(t){return i("div",{class:"s-bullet-delivery-allocation-out-of-coverage",role:"alert"},i("span",{class:"s-bullet-delivery-allocation-out-of-coverage-icon","aria-hidden":"true"},i("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-hidden":"true"},i("title",null,"Information"),i("circle",{cx:"10",cy:"10",r:"9",stroke:"currentColor","stroke-width":"1.5",fill:"currentColor"}),i("text",{x:"10",y:"14","text-anchor":"middle",fill:"white","font-size":"12","font-weight":"bold"},"i"))),i("span",{class:"s-bullet-delivery-allocation-out-of-coverage-text"},t))}renderAllocationOutOfCoverageAlert(){const t=this.allocationOutOfCoverageMessage||Salla.lang.get("pages.checkout.shipping_not_available");return this.renderAlert(t)}renderCountrySelect(){return i("div",{class:"s-bullet-delivery-field"},i("salla-searchable-dropdown",{label:Salla.lang.get("blocks.buy_as_gift.receiver_country"),placeholder:Salla.lang.get("pages.checkout.select_country"),items:this.displayedCountries,selectedItem:this.selectedCountry,loading:this.loadingCountries,searching:this.searchingCountries,disabled:this.countries.length<=1,required:!0,inputId:"bullet-delivery-country",searchQuery:this.countrySearchQuery,clientSearch:!0,onItemSelected:t=>this.handleCountrySelected(t.detail),onSearchInput:t=>this.handleCountrySearch(t.detail),onDropdownClosed:()=>this.handleCountryDropdownClosed()}))}renderRegionSelect(){return o(this.selectedCountry?.code??"")&&this.selectedCountry?i("div",{class:"s-bullet-delivery-field"},i("salla-searchable-dropdown",{label:Salla.lang.get("pages.checkout.region_field"),placeholder:Salla.lang.get("pages.checkout.select_region"),items:this.displayedRegions,selectedItem:this.selectedRegion,loading:this.loadingRegions,searching:this.searchingRegions,disabled:this.loadingRegions||0===this.regions.length,required:!0,inputId:"bullet-delivery-region",searchQuery:this.regionSearchQuery,clientSearch:!0,onItemSelected:t=>this.handleRegionSelected(t.detail),onSearchInput:t=>this.handleRegionSearch(t.detail),onDropdownClosed:()=>this.handleRegionDropdownClosed()})):null}renderCityDistrictSelects(){const t=o(this.selectedCountry?.code??""),e=t,s=e&&this.selectedCity&&!this.loadingDistricts&&0===this.districts.length,r=!this.selectedCountry||t&&!this.selectedRegion||this.loadingCities||0===this.cities.length,a=!this.selectedCountry||t&&!this.selectedRegion||!this.selectedCity||this.loadingDistricts;return i("div",{class:"s-bullet-delivery-field-row"},i("div",{class:"s-bullet-delivery-field"},i("salla-searchable-dropdown",{label:Salla.lang.get("blocks.buy_as_gift.receiver_city"),placeholder:Salla.lang.get("pages.checkout.select_city"),items:this.displayedCities,selectedItem:this.selectedCity,loading:this.loadingCities,searching:this.searchingCities,disabled:r,required:!0,inputId:"bullet-delivery-city",searchQuery:this.citySearchQuery,onItemSelected:t=>this.handleCitySelected(t.detail),onSearchInput:t=>this.handleCitySearch(t.detail),onDropdownClosed:()=>this.handleCityDropdownClosed(),dropUp:!0})),e&&i("div",{class:"s-bullet-delivery-field"},s?i("div",null,i("label",{class:"s-bullet-delivery-label",htmlFor:"bullet-delivery-district"},Salla.lang.get("pages.checkout.district_field"),i("span",{class:"text-red-500"}," *")),i("input",{id:"bullet-delivery-district",type:"text",class:"form-input",placeholder:Salla.lang.get("pages.checkout.select_district"),value:this.districtName,disabled:a,onInput:t=>{this.districtName=t.target.value,this.updateNewAddressForm({district:void 0})}})):i("salla-searchable-dropdown",{label:Salla.lang.get("pages.checkout.district_field"),placeholder:Salla.lang.get("pages.checkout.select_district"),items:this.displayedDistricts,selectedItem:this.selectedDistrict,loading:this.loadingDistricts,searching:this.searchingDistricts,disabled:a||0===this.districts.length,required:!0,inputId:"bullet-delivery-district",searchQuery:this.districtSearchQuery,clientSearch:!0,onItemSelected:t=>this.handleDistrictSelected(t.detail),onSearchInput:t=>this.handleDistrictSearch(t.detail),onDropdownClosed:()=>this.handleDistrictDropdownClosed(),dropUp:!0})))}renderSavedAddressesEmptyState(){return i("div",{class:"s-bullet-delivery-saved-addresses-empty"},i("div",{class:"s-bullet-delivery-saved-addresses-empty-icon","aria-hidden":"true"},i("svg",{width:"28",height:"28",viewBox:"0 0 28 29",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i("title",null,"No Saved Adresses"),i("path",{d:"M20.16 0C21.4613 0 22.6773 0.341333 23.808 1.024C24.9387 1.70667 25.8347 2.61333 26.496 3.744C27.1787 4.91733 27.52 6.18667 27.52 7.552C27.52 9.45067 26.8267 11.232 25.44 12.896C24.4587 14.0907 23.0827 15.2427 21.312 16.352H21.28C20.9387 16.5653 20.5653 16.672 20.16 16.672C19.7547 16.672 19.3813 16.5653 19.04 16.352H19.008C17.2373 15.2213 15.8613 14.0693 14.88 12.896C13.4933 11.232 12.8 9.45067 12.8 7.552C12.8 6.18667 13.1413 4.91733 13.824 3.744C14.4853 2.61333 15.3813 1.70667 16.512 1.024C17.6427 0.341333 18.8587 0 20.16 0ZM11.488 1.984C9.67467 2.368 8.04267 3.14667 6.592 4.32C5.14133 5.49333 4.01067 6.92267 3.2 8.608C2.34667 10.3573 1.92 12.224 1.92 14.208C1.92 14.72 1.952 15.2427 2.016 15.776L2.08 15.744C2.57067 15.488 2.94933 15.3067 3.216 15.2C3.48267 15.0933 3.73867 15.0933 3.984 15.2C4.22933 15.3067 4.4 15.488 4.496 15.744C4.592 16 4.58667 16.256 4.48 16.512C4.37333 16.768 4.19733 16.9493 3.952 17.056C3.70667 17.1627 3.36 17.3227 2.912 17.536L2.656 17.664C2.57067 17.7067 2.48533 17.7387 2.4 17.76C2.89067 19.4667 3.70133 20.9973 4.832 22.352C5.96267 23.7067 7.296 24.7573 8.832 25.504C10.432 26.272 12.1173 26.656 13.888 26.656C15.4667 26.656 16.9813 26.3467 18.432 25.728C19.8187 25.1307 21.0667 24.288 22.176 23.2C21.92 23.0507 21.7653 22.8373 21.712 22.56C21.6587 22.2827 21.7013 22.0267 21.84 21.792C21.9787 21.5573 22.176 21.408 22.432 21.344C22.8373 21.2587 23.2 21.12 23.52 20.928C23.6907 20.8427 23.8613 20.8 24.032 20.8C24.8 19.5413 25.3333 18.176 25.632 16.704C25.6747 16.4267 25.808 16.2133 26.032 16.064C26.256 15.9147 26.496 15.8667 26.752 15.92C27.008 15.9733 27.2107 16.1173 27.36 16.352C27.5093 16.5867 27.552 16.832 27.488 17.088C27.0613 19.2853 26.1973 21.264 24.896 23.024C23.5947 24.784 22.0053 26.1547 20.128 27.136C18.1653 28.16 16.0853 28.672 13.888 28.672C11.3707 28.672 9.03467 28.0107 6.88 26.688C4.78933 25.408 3.12533 23.68 1.888 21.504C0.629333 19.264 0 16.832 0 14.208C0 11.904 0.490667 9.73867 1.472 7.712C2.41067 5.74933 3.728 4.09067 5.424 2.736C7.12 1.38133 9.01333 0.48 11.104 0.032C11.36 -0.032 11.6 0.0106667 11.824 0.16C12.048 0.309333 12.1867 0.522667 12.24 0.8C12.2933 1.07733 12.2453 1.328 12.096 1.552C11.9467 1.776 11.744 1.92 11.488 1.984ZM14.72 7.552C14.72 8.96 15.2533 10.304 16.32 11.584C17.1733 12.5867 18.3893 13.6 19.968 14.624C20.032 14.6453 20.096 14.656 20.16 14.656C20.224 14.656 20.288 14.6453 20.352 14.624C21.9307 13.6213 23.1467 12.608 24 11.584C25.0667 10.304 25.6 8.96 25.6 7.552C25.6 6.57067 25.3547 5.65333 24.864 4.8C24.3733 3.94667 23.7067 3.26933 22.864 2.768C22.0213 2.26667 21.12 2.016 20.16 2.016C19.2 2.016 18.2987 2.26667 17.456 2.768C16.6133 3.26933 15.9467 3.94667 15.456 4.8C14.9653 5.65333 14.72 6.57067 14.72 7.552ZM17.28 7.68C17.28 6.848 17.5627 6.13867 18.128 5.552C18.6933 4.96533 19.3707 4.672 20.16 4.672C20.9493 4.672 21.6267 4.96533 22.192 5.552C22.7573 6.13867 23.04 6.848 23.04 7.68C23.04 8.512 22.7573 9.216 22.192 9.792C21.6267 10.368 20.9493 10.656 20.16 10.656C19.3707 10.656 18.6933 10.368 18.128 9.792C17.5627 9.216 17.28 8.512 17.28 7.68ZM6.752 14.688C7.62667 14.7733 8.53333 15.0293 9.472 15.456C9.70667 15.5627 9.87733 15.744 9.984 16C10.0907 16.256 10.0907 16.512 9.984 16.768C9.87733 17.024 9.70133 17.2 9.456 17.296C9.21067 17.392 8.97067 17.3867 8.736 17.28C7.94667 16.9387 7.22133 16.736 6.56 16.672C6.28267 16.6293 6.064 16.5013 5.904 16.288C5.744 16.0747 5.68 15.8293 5.712 15.552C5.744 15.2747 5.86133 15.0507 6.064 14.88C6.26667 14.7093 6.496 14.6453 6.752 14.688ZM17.6 20.544C18.304 20.864 18.976 21.0987 19.616 21.248C19.872 21.312 20.0693 21.4613 20.208 21.696C20.3467 21.9307 20.3893 22.1813 20.336 22.448C20.2827 22.7147 20.144 22.9227 19.92 23.072C19.696 23.2213 19.4453 23.264 19.168 23.2C18.4213 23.0293 17.632 22.752 16.8 22.368C16.5653 22.2613 16.4 22.08 16.304 21.824C16.208 21.568 16.2133 21.312 16.32 21.056C16.4267 20.8 16.6027 20.624 16.848 20.528C17.0933 20.432 17.344 20.4373 17.6 20.544ZM12.832 17.44C13.0027 17.568 13.248 17.7493 13.568 17.984L14.496 18.688C14.7093 18.8587 14.8373 19.0773 14.88 19.344C14.9227 19.6107 14.8693 19.856 14.72 20.08C14.5707 20.304 14.368 20.4427 14.112 20.496C13.856 20.5493 13.6107 20.5013 13.376 20.352L11.744 19.072C11.5307 18.9227 11.4027 18.7093 11.36 18.432C11.3173 18.1547 11.3707 17.904 11.52 17.68C11.6693 17.456 11.872 17.3227 12.128 17.28C12.384 17.2373 12.6187 17.2907 12.832 17.44ZM20.16 8.672C20.416 8.672 20.64 8.576 20.832 8.384C21.024 8.192 21.12 7.95733 21.12 7.68C21.12 7.40267 21.024 7.16267 20.832 6.96C20.64 6.75733 20.416 6.656 20.16 6.656C19.904 6.656 19.68 6.75733 19.488 6.96C19.296 7.16267 19.2 7.40267 19.2 7.68C19.2 7.95733 19.296 8.192 19.488 8.384C19.68 8.576 19.904 8.672 20.16 8.672Z",fill:"#666666"}))),i("p",{class:"s-bullet-delivery-saved-addresses-empty-title"},Salla.lang.get("pages.checkout.no_saved_addresses")),i("p",{class:"s-bullet-delivery-saved-addresses-empty-desc"},Salla.lang.get("pages.checkout.add_address_simplify_shipping")),i("salla-button",{onClick:()=>this.handleAddNewAddress(),onKeyUp:()=>this.handleAddNewAddress()},Salla.lang.get("pages.checkout.add_new_address")))}async saveSessionAddressToProfile(){const t=this.getStoredIntent();if(k(t)){const e=t.address_details,i={lat:e.lat,lng:e.lng,...e.place_id&&{short_address:e.place_id},...e.description&&{description:e.description}};try{const{success:e,address:s}=await a.saveAddressLocation(i);return e&&s?(this.setStoredIntent({...t,address_id:s.id}),this.addressCreated.emit({address:s}),s):null}catch(t){return console.error("SallaBulletDelivery: Error saving session address (map)",t),null}}const e=p(t),i=c(t),s=b(t);if(!t||"address"!==t.type||!e||!i)return null;const r=C(t);if(o(r)&&!s)return null;const l=o(r),n=t.address_details?.district?.name??"",h={country_id:e,region_id:u(t),city_id:i,district_id:s,description:n};l&&(h.local=n);try{const{success:t,address:e}=await a.saveAddressLocation(h);if(!t)return null;const i=e??null;return i&&this.addressCreated.emit({address:i}),i}catch(t){return console.error("SallaBulletDelivery: Error saving session address",t),null}}renderSavedAddresses(){if(!this.isLoggedIn)return null;if(this.loadingSavedAddresses)return i("div",{class:"s-bullet-delivery-addresses-list s-scrollbar"},[1,2,3].map((t=>i("div",{key:t,class:"s-bullet-delivery-address-item s-bullet-delivery-address-item--skeleton"},i("salla-skeleton",{class:"s-bullet-delivery-skel-radio",height:"18px",width:"18px"}),i("salla-skeleton",{class:"s-bullet-delivery-skel-map",height:"36px",width:"36px"}),i("div",{class:"s-bullet-delivery-address-content"},i("div",{class:"s-bullet-delivery-address-lines"},i("salla-skeleton",{height:"18px",width:"72%"}),i("salla-skeleton",{height:"16px",width:"56%"})))))));const t=this.getStoredIntent(),e=d(t),s=k(t),r=e&&t?.address_details?s?t.address_details.formatted_address??"":[t.address_details.city?.name,t.address_details.country?.name].filter(Boolean).join("، ")||"":"",o=e&&t?.address_details&&!s?(t.address_details.district?.name??"").trim():"";return 0!==this.savedAddresses.length||e?i("div",{class:"s-bullet-delivery-addresses-list s-scrollbar"},e&&this.renderAddressRow({key:"session-address",line1:r,line2:o,selected:this.selectedSessionAddress,onClick:()=>this.handleSessionAddressSelect()}),this.savedAddresses.map((t=>{const e=[t.building_number,t.street].filter(Boolean).join("، ")||t.formatted?.address_one||t.short_address||"",i=[t.district?.name,t.city?.name,t.country?.name].filter(Boolean).join("، "),s=(t.formatted?.address_two||i)??"",r=!1!==t.is_in_coverage;return this.renderAddressRow({key:String(t.id),line1:e,line2:s,selected:this.selectedSavedAddress?.id===t.id,disabled:!r,onClick:()=>r&&this.handleSavedAddressSelect(t)})}))):this.renderSavedAddressesEmptyState()}renderAddressRow(t){const{key:e,line1:s,line2:r,selected:o,disabled:a=!1,onClick:l}=t;return i("button",{key:e,class:{"s-bullet-delivery-address-item":!0,"s-bullet-delivery-address-item--selected":o,"s-bullet-delivery-address-item--disabled":a},type:"button",onClick:a?void 0:l,onKeyDown:t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),a||l())}},i("input",{type:"radio",name:"saved_address",class:"s-bullet-delivery-radio",checked:o,disabled:a}),i("span",{class:"s-bullet-delivery-address-map-icon",innerHTML:'<svg width="35" height="35" viewBox="0 0 35 35" fill="none" xmlns="http://www.w3.org/2000/svg">\n <g filter="url(#filter0_d_24181_220540)">\n <mask id="mask0_24181_220540" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="1" y="0" width="33" height="32">\n <rect x="1.90958" y="0.576577" width="30.8468" height="30.8468" rx="9.22523" fill="#D9D9D9" stroke="white" stroke-width="1.15315"/>\n </mask>\n <g mask="url(#mask0_24181_220540)">\n <rect x="1.90958" y="0.576577" width="30.8468" height="30.8468" rx="9.22523" fill="#E8E8E8" stroke="white" stroke-width="1.15315"/>\n <path d="M17.9096 6.77445L28.7204 5.33301H32.4681L32.7564 11.8195V23.6393L10.4141 23.9276V10.8105L17.9096 6.77445Z" fill="#97E7C8"/>\n <path d="M-2.70303 10.6664H10.2699M41.6934 5.47722C38.378 5.47722 34.7744 5.47722 27.8555 5.47722C20.9366 5.47722 18.4862 6.63037 15.4591 8.64839C12.4321 10.6664 10.2699 10.6664 10.2699 10.6664M10.2699 34.4502V23.6394M10.2699 10.6664V23.6394M-6.16249 23.6394H10.2699M10.2699 23.6394H21.0807M38.8105 23.6394H21.0807M21.0807 23.6394V34.4502" stroke="white" stroke-width="2.30631"/>\n <rect x="2.34202" y="1.00901" width="29.982" height="29.982" rx="8.79279" stroke="white" stroke-width="2.01802"/>\n </g>\n <g clip-path="url(#clip0_24181_220540)">\n <path fill-rule="evenodd" clip-rule="evenodd" d="M18.069 19.8621C19.4995 18.6902 22.171 16.0948 22.171 13.0548C22.171 11.7333 21.6461 10.466 20.7117 9.5316C19.7773 8.5972 18.51 8.07227 17.1885 8.07227C15.8671 8.07227 14.5998 8.5972 13.6654 9.5316C12.731 10.466 12.2061 11.7333 12.2061 13.0548C12.2061 16.0948 14.8776 18.6902 16.3081 19.8621C16.5553 20.0679 16.8669 20.1806 17.1885 20.1806C17.5102 20.1806 17.8218 20.0679 18.069 19.8621ZM17.1885 14.1618C17.517 14.1618 17.838 14.0644 18.1111 13.8819C18.3842 13.6995 18.597 13.4401 18.7227 13.1367C18.8484 12.8333 18.8812 12.4994 18.8172 12.1773C18.7531 11.8552 18.595 11.5593 18.3627 11.3271C18.1305 11.0948 17.8346 10.9367 17.5125 10.8726C17.1904 10.8085 16.8565 10.8414 16.5531 10.9671C16.2497 11.0928 15.9903 11.3056 15.8079 11.5787C15.6254 11.8518 15.528 12.1728 15.528 12.5012C15.528 12.9416 15.703 13.364 16.0144 13.6754C16.3258 13.9868 16.7481 14.1618 17.1885 14.1618Z" fill="#55575D"/>\n </g>\n </g>\n <defs>\n <filter id="filter0_d_24181_220540" x="-0.000325561" y="0" width="34.6667" height="34.6667" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">\n <feFlood flood-opacity="0" result="BackgroundImageFix"/>\n <feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>\n <feOffset dy="1.33333"/>\n <feGaussianBlur stdDeviation="0.666667"/>\n <feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.04 0"/>\n <feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_24181_220540"/>\n <feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_24181_220540" result="shape"/>\n </filter>\n <clipPath id="clip0_24181_220540">\n <rect width="12.1081" height="12.1081" fill="white" transform="translate(11.1338 8.07227)"/>\n </clipPath>\n </defs>\n </svg>\n ',"aria-hidden":"true"}),i("div",{class:"s-bullet-delivery-address-content"},i("div",{class:"s-bullet-delivery-address-lines"},i("span",{class:"s-bullet-delivery-address-line1"},s),i("span",{class:"s-bullet-delivery-address-line2"},r))))}renderMapSection(){const t=o(this.selectedCountry?.code??""),e=this.mapLocationData,s=null!=e?.lat&&null!=e?.lng,r=s?{lat:e.lat,lng:e.lng}:this.mapInitialCenter;return i("div",{class:"s-bullet-delivery-map-container"},i("gmap-map",{ref:t=>this.gmapRef=t,center:r,zoom:16,"min-zoom":4,"max-zoom":21,"map-id":"DEMO_MAP_ID","enable-autocomplete":!0,"enable-geolocation":!0,"show-location-marker":!0,"location-marker-position":s?{lat:e.lat,lng:e.lng,accuracy:50}:{...r,accuracy:50},language:Salla.lang.getLocale?.()??document.documentElement.lang??"ar","geolocation-button-label":Salla.lang.get("pages.checkout.current_location"),"autocomplete-placeholder":Salla.lang.get("pages.checkout.search_for_address"),"autocomplete-hint":t?Salla.lang.get("pages.checkout.short_address_format_validation"):void 0,"autocomplete-country":this.selectedCountry?.code?.toLowerCase(),"autocomplete-resolve":!1,"autocomplete-auth-token":this.addressToken,"location-marker-background":"#4285F4","location-marker-border-color":"#1967D2","location-marker-glyph-color":"#FFFFFF","location-marker-scale":1.3,"onGmap-location-changed":this.handleMapLocationChanged,"onGmap-ready":this.handleMapReady}))}renderAddressConfirmation(){const t=this.mapLocationData?.formattedAddress??"",e=this.mapLocationData?.shortAddress;return i("div",{class:"s-bullet-delivery-address-confirm"},i("div",{class:"s-bullet-delivery-address-confirm-card"},i("div",{class:"s-bullet-delivery-address-confirm-details"},i("span",{class:"s-bullet-delivery-address-confirm-label"},Salla.lang.get("pages.checkout.selected_address")),i("p",{class:"s-bullet-delivery-address-confirm-text"},t),e&&i("span",{class:"s-bullet-delivery-address-confirm-tag"},e,i("span",{class:"s-bullet-delivery-address-confirm-tag-icon",innerHTML:'<svg width="13" height="15" viewBox="0 0 8.97576 11.7781" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M6.2453 8.52122L5.8322 8.24311L5.86126 8.20024L6.27435 8.47694L6.2453 8.52122ZM6.42386 8.25126L6.00758 7.97882C5.96896 8.03798 5.92999 8.0975 5.88995 8.15737L6.30376 8.43372C6.34414 8.37136 6.38489 8.31184 6.42386 8.25126ZM6.63572 7.92213L6.21518 7.65677L6.11244 7.81797L6.5305 8.08723L6.63572 7.92213ZM6.43484 9.81081L5.92538 9.45547C5.32487 10.316 4.76617 11.0388 4.48664 11.3927L4.97413 11.7781C5.25827 11.4182 5.82512 10.6831 6.43484 9.81081ZM3.55487 10.1647C3.44257 10.0113 3.33097 9.85652 3.22327 9.70417L2.717 10.0638C2.82611 10.2179 2.93913 10.3745 3.0525 10.5307L3.55487 10.1647ZM3.11734 9.55006L2.99688 9.37823L2.48707 9.73216L2.60965 9.90753L3.11734 9.55006ZM6.58577 9.59257L6.07206 9.24113L5.95266 9.41402L6.46248 9.76865C6.50499 9.71091 6.54538 9.65174 6.58577 9.59151V9.59257ZM2.96535 9.33607C2.46191 8.60767 2.02898 7.92319 1.68072 7.30887L1.14044 7.61461C1.49933 8.24736 1.94182 8.9453 2.4566 9.68929L2.96535 9.33607ZM7.01161 8.95416L6.49152 8.6144C6.39055 8.7678 6.28533 8.92652 6.17763 9.08453L6.69134 9.43386C6.80329 9.27018 6.911 9.11146 7.01374 8.95486L7.01161 8.95416ZM8.97363 4.48559C8.97434 3.96621 8.88471 3.45073 8.70898 2.96217L8.12442 3.17262C8.27605 3.5935 8.35364 4.03777 8.35293 4.48559C8.35293 4.99505 8.11733 5.71955 7.65216 6.63927L8.2059 6.91916C8.72599 5.89847 8.97576 5.10204 8.97576 4.4863L8.97363 4.48559ZM0.749309 5.26111C0.699001 5.09389 0.661447 4.92313 0.637001 4.75059L0.0216118 4.83208C0.0488916 5.03579 0.0921143 5.23738 0.150217 5.43436L0.749309 5.26111ZM0.621058 4.58443V4.39737L0 4.3832V4.48594C0 4.51995 5.62238e-07 4.5738 0.00389767 4.6188L0.621058 4.58443ZM1.3275 2.25361L0.820874 1.89472C0.314958 2.60824 0.0297605 3.45427 0.000709258 4.32864L0.621058 4.35061C0.645858 3.59705 0.89173 2.86793 1.3275 2.25361ZM8.69233 2.91151C8.66612 2.84065 8.63706 2.76944 8.60766 2.70106L8.03797 2.94835C8.06348 3.00752 8.08792 3.06846 8.11131 3.12939L8.69233 2.91151ZM8.52227 2.51684C8.43264 2.33367 8.33025 2.15689 8.21653 1.98754L7.70282 2.33367C7.80095 2.47928 7.88846 2.63163 7.96534 2.78964L8.52227 2.51684ZM6.33848 0.397516C5.7571 0.13393 5.12577 -0.00140612 4.48735 1.10152e-05C4.25494 1.10152e-05 4.02288 0.0177252 3.79331 0.0531534L3.88825 0.664646C4.08665 0.634178 4.28682 0.618943 4.48735 0.618589C5.0372 0.617526 5.58137 0.73444 6.08197 0.961535L6.33848 0.397516ZM3.47906 0.752862L3.31644 0.150581C3.11946 0.203369 2.92602 0.269974 2.73825 0.349688L2.97987 0.921501C3.14214 0.853125 3.30865 0.796084 3.47835 0.750382L3.47906 0.752862ZM3.84184 0.673858L3.7391 0.061657C3.6647 0.0737026 3.58959 0.0885822 3.51519 0.104525L3.64876 0.710702C3.71182 0.694051 3.77666 0.681651 3.84078 0.671023L3.84184 0.673858ZM4.68149 10.6292C4.68149 10.6253 5.02975 10.2041 5.49138 9.58159L5.08998 9.28293C4.8434 9.6156 4.63083 9.8884 4.4877 10.0705C4.2436 9.76121 3.79791 9.18302 3.32069 8.49819L2.91043 8.78481C3.63494 9.82286 4.28824 10.6218 4.29462 10.6296L4.48735 10.8659L4.68149 10.6292ZM5.57039 9.47318L5.16757 9.17629L5.10344 9.26097L5.50556 9.55821C5.52752 9.52739 5.54843 9.50117 5.56968 9.47212L5.57039 9.47318ZM6.01997 8.85035L5.60759 8.56445C5.48359 8.74123 5.35463 8.92156 5.22213 9.10154L5.62566 9.39772C5.75993 9.21278 5.89137 9.02927 6.0175 8.85L6.01997 8.85035ZM8.12194 4.47708C8.12229 3.76958 7.91539 3.07731 7.52639 2.48601L7.10833 2.76023C7.44419 3.2704 7.62311 3.86807 7.62204 4.47886C7.62204 5.12436 7.14872 6.20669 6.25309 7.60788L6.67434 7.87714C7.63196 6.37108 8.11875 5.2271 8.11875 4.47567L8.12194 4.47708ZM2.68015 7.53667C2.55863 7.34394 2.44314 7.15653 2.33791 6.97584L1.9064 7.22951C2.01481 7.41444 2.13314 7.60788 2.25785 7.8077L2.68015 7.53667ZM2.29009 6.89436L2.23801 6.80366L1.80365 7.05237L1.8568 7.14554L2.29009 6.89436ZM2.22596 6.78205C1.65627 5.78155 1.35513 4.98371 1.35513 4.47567C1.35513 4.17453 1.39835 3.87516 1.48338 3.58642L1.00368 3.44541C0.905193 3.77915 0.854885 4.12528 0.855239 4.47319C0.855239 5.07618 1.16984 5.93567 1.79161 7.02757L2.22596 6.78205ZM7.50867 2.46263C7.48812 2.43181 7.46616 2.39851 7.44455 2.36946L7.03535 2.65465C7.05413 2.68087 7.07326 2.7078 7.09133 2.73508L7.50867 2.46263ZM2.36732 2.17389L2.02579 1.8026C1.85148 1.9638 1.69312 2.14201 1.55389 2.33438L1.95777 2.62985C2.07893 2.46369 2.21604 2.30994 2.36767 2.1707L2.36732 2.17389ZM7.38396 2.28726C7.24012 2.09772 7.07786 1.9227 6.90037 1.76434L6.5677 2.13811C6.7211 2.27415 6.86104 2.42472 6.98504 2.58769L7.38396 2.28726ZM2.50726 2.04848L2.19124 1.66302C2.16183 1.68675 2.13278 1.7112 2.10373 1.73635L2.43286 2.11402C2.45731 2.08993 2.48246 2.06867 2.50726 2.04848ZM4.48664 1.34203C4.8884 1.34133 5.28626 1.41856 5.65861 1.56878L5.84602 1.10431C4.62658 0.613984 3.23744 0.819114 2.21214 1.6414L2.52568 2.03112C3.08084 1.58295 3.77311 1.34026 4.48664 1.3431V1.34203ZM4.72649 9.03245C4.86927 8.82839 5.00708 8.62609 5.13817 8.43053C5.67207 7.64862 6.15567 6.83342 6.58506 5.98987C7.08141 4.98406 7.12463 4.54723 7.12853 4.47035V4.45618C7.12853 2.99689 5.94558 1.81394 4.48628 1.81394C3.02699 1.81394 1.84404 2.99689 1.84404 4.45618V4.47035C1.84404 4.54759 1.89081 4.98406 2.3868 5.98987C2.8169 6.83342 3.3005 7.64862 3.83476 8.43053C3.96336 8.62326 4.10401 8.82874 4.24643 9.03245L4.48522 9.3754L4.72649 9.03245ZM3.0316 3.00362C3.83547 2.19975 5.13887 2.20011 5.94274 3.00398C6.32537 3.3866 6.54183 3.90456 6.54538 4.44555C6.53971 4.49374 6.48125 4.87707 6.06178 5.73018C5.64373 6.55177 5.17289 7.34571 4.6528 8.10671C4.59895 8.18749 4.54368 8.26933 4.48699 8.35223C4.43102 8.26933 4.37504 8.18784 4.32119 8.10671C3.80146 7.34536 3.33061 6.55177 2.91221 5.73018C2.48636 4.86644 2.43357 4.48346 2.42932 4.44555C2.43109 3.90421 2.64791 3.38589 3.0316 3.00362Z" fill="url(#paint0_linear_0_471)"/>\n<defs>\n<linearGradient id="paint0_linear_0_471" x1="-0.000253536" y1="5.88509" x2="8.97608" y2="5.88509" gradientUnits="userSpaceOnUse">\n<stop offset="0.2" stop-color="#4498B6"/>\n<stop offset="0.49" stop-color="#273265"/>\n<stop offset="1" stop-color="#C93732"/>\n</linearGradient>\n</defs>\n</svg>\n'}))),i("button",{type:"button",class:"s-bullet-delivery-address-confirm-edit",onClick:()=>{this.mapStep="map"}},Salla.lang.get("common.elements.edit"))),i("div",{class:"s-bullet-delivery-address-confirm-description"},i("label",{class:"s-bullet-delivery-address-confirm-description-label"},Salla.lang.get("pages.checkout.address_description"),i("span",{class:"s-bullet-delivery-address-confirm-description-optional"},Salla.lang.get("common.elements.optional"))),i("input",{type:"text",class:"s-bullet-delivery-address-confirm-description-input form-input",placeholder:Salla.lang.get("pages.checkout.address_description_placeholder"),value:this.addressDescription,onInput:t=>{this.addressDescription=t.target.value}})))}renderGuestDeliveryForm(){if(this.isMapModeAvailable)return"confirm"===this.mapStep&&this.hasMapLocation()?this.renderAddressConfirmation():this.renderMapSection();const t=o(this.selectedCountry?.code??"");return[this.renderCountrySelect(),t?this.renderRegionSelect():null,this.renderCityDistrictSelects()]}renderDeliveryTab(){return i("div",{class:{"s-bullet-delivery-content":!0,"s-bullet-delivery-content--active":"address"===this.activeTab,"s-hidden":"address"!==this.activeTab}},this.isLoggedIn?this.renderSavedAddresses():this.renderGuestDeliveryContent())}renderGuestDeliveryContent(){if(!this.isMapModeAvailable)return this.renderGuestDeliveryForm();const t=this.hasMapLocation(),e="confirm"===this.mapStep&&t,s=this.canConfirmMapLocation(),r=e?this.confirming?Salla.lang.get("pages.checkout.loading"):Salla.lang.get("pages.checkout.confirm_address"):Salla.lang.get("pages.checkout.confirm_location");return i("form",{onSubmit:t=>{t.preventDefault(),e||!s?this.handleConfirm():this.mapStep="confirm"}},this.renderGuestDeliveryForm(),i("div",{class:"s-bullet-delivery-form-actions s-bullet-delivery-form-actions--single",style:{padding:"24px"}},i("salla-button",{type:"submit",loading:this.confirming,disabled:e?this.confirming:!s,width:"wide"},r),!this.isLoggedIn&&i("button",{type:"button",class:"s-bullet-delivery-login-prompt",onClick:()=>this.handleLogin()},Salla.lang.get("pages.checkout.login_to_use_saved_addresses"))))}renderBranchSearch(){return i("div",{class:"s-bullet-delivery-branch-search"},i("div",{class:"s-bullet-delivery-search-row"},i("div",{class:"s-bullet-delivery-search s-bullet-delivery-branch-search-wrap"},i("span",{class:"s-bullet-delivery-search-icon s-bullet-delivery-branch-search-icon",innerHTML:z,"aria-hidden":"true"}),i("input",{type:"text",class:"s-bullet-delivery-branch-search-input form-input",placeholder:Salla.lang.get("pages.checkout.search_for_city_or_branch"),value:this.branchSearchQuery,onInput:t=>this.handleBranchSearch(t),autocomplete:"off"})),i("button",{type:"button",class:{"s-bullet-delivery-location-btn":!0,"s-bullet-delivery-location-btn--full":!0,"s-bullet-delivery-location-btn--loading":this.loadingNearestBranch},onClick:()=>this.handleFindNearestBranch(),disabled:this.loadingNearestBranch},this.loadingNearestBranch?i("span",{class:"s-bullet-delivery-location-icon","aria-hidden":"true"},i("salla-skeleton",{height:"18px",width:"18px"})):i("span",{class:"s-bullet-delivery-location-icon",innerHTML:'<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path\n d="M13.3258 7.65006C13.3258 10.7797 10.7888 13.3167 7.65916 13.3167C4.52955 13.3167 1.99249 10.7797 1.99249 7.65006C1.99249 4.52045 4.52955 1.9834 7.65916 1.9834C10.7888 1.9834 13.3258 4.52045 13.3258 7.65006Z"\n stroke="#555555" stroke-width="1.3" />\n <path d="M14.65 7.65039H13.3167" stroke="#555555" stroke-width="1.3" stroke-linecap="round"\n stroke-linejoin="round" />\n <path d="M1.98336 7.65039L0.650024 7.65039" stroke="#555555" stroke-width="1.3"\n stroke-linecap="round" stroke-linejoin="round" />\n <path d="M7.65002 0.650065L7.65002 1.9834" stroke="#555555" stroke-width="1.3"\n stroke-linecap="round" stroke-linejoin="round" />\n <path d="M7.65002 13.3171L7.65002 14.6504" stroke="#555555" stroke-width="1.3"\n stroke-linecap="round" stroke-linejoin="round" />\n <path\n d="M9.64999 7.65039C9.64999 8.75496 8.75456 9.65039 7.64999 9.65039C6.54542 9.65039 5.64999 8.75496 5.64999 7.65039C5.64999 6.54582 6.54542 5.65039 7.64999 5.65039C8.75456 5.65039 9.64999 6.54582 9.64999 7.65039Z"\n stroke="#555555" stroke-width="1.3" />\n</svg>\n ',"aria-hidden":"true"}),i("span",null,Salla.lang.get("pages.checkout.nearest_to_my_location")))),this.locationError&&"branch"===this.activeTab&&i("span",{class:"s-bullet-delivery-error"},this.locationError))}renderBranchList(){return this.loadingBranches?i("div",{class:"s-bullet-delivery-branches-wrap"},i("div",{class:"s-bullet-delivery-branches-loading"},[1,2,3,4].map((t=>i("div",{key:t,class:"s-bullet-delivery-branch-skeleton"},i("salla-skeleton",{class:"s-bullet-delivery-branch-skeleton-radio",type:"circle",height:"16px",width:"16px"}),i("div",{class:"s-bullet-delivery-branch-skeleton-icon"},i("salla-skeleton",{height:"34px",width:"34px"})),i("div",{class:"s-bullet-delivery-branch-skeleton-content"},i("salla-skeleton",{class:"s-bullet-delivery-branch-skeleton-title",height:"12px",width:"124px"})),i("salla-skeleton",{class:"s-bullet-delivery-branch-skeleton-time",height:"12px",width:"88px"}),i("div",{class:"s-bullet-delivery-branch-skeleton-map"},i("salla-skeleton",{height:"32px",width:"32px"}))))))):0===this.filteredBranches.length?i("salla-placeholder",{alignment:"center",class:"s-bullet-delivery-placeholder"},i("span",{slot:"title"},Salla.lang.get("pages.checkout.no_pickup_branches_found"))):i("div",{class:"s-bullet-delivery-branches-wrap"},i("ul",{class:"s-bullet-delivery-branches-list s-scrollbar"},this.filteredBranches.map((t=>{const e=S(t),s=t?.pickup_readiness;return i("li",{key:t.id,class:{"s-bullet-delivery-branch-item":!0,"s-bullet-delivery-branch-item--selected":this.selectedBranch?.id===t.id,"s-bullet-delivery-branch-item--disabled":!e},tabIndex:e?0:-1,role:"option","aria-disabled":!e,onClick:()=>e&&this.handleBranchSelect(t),onKeyDown:i=>{"Enter"!==i.key&&" "!==i.key||(i.preventDefault(),e&&this.handleBranchSelect(t))}},i("input",{type:"radio",name:"branch",class:"s-bullet-delivery-radio",checked:this.selectedBranch?.id===t.id,disabled:!e}),i("span",{class:"s-bullet-delivery-branch-icon","aria-hidden":"true"},i("span",{innerHTML:vs})),i("div",{class:"flex flex-col gap-[2px]"},i("div",{class:"flex items-center gap-1"},i("p",{class:"s-bullet-delivery-branch-name text-start"},t.name),s?.label&&i("p",{class:"branch-status-badge"+(s.color?` ${s.color}`:"")},s.label)),t.preparation_time?i("span",{class:"s-bullet-delivery-branch-prep text-start"},i("i",{class:"sicon-clock"})," ",i("span",{class:"first-letter-cap"},t.preparation_time)):null,s?.detail_line&&i("span",{class:"s-bullet-delivery-branch-time text-start"},i("i",{class:"sicon-store"})," ",s.detail_line)),i("div",{style:{width:"full",maxWidth:"50px",marginInlineStart:"auto"}},null!=t.location?.lat&&null!=t.location?.lng&&i("a",{href:`https://www.google.com/maps?q=${t.location.lat},${t.location.lng}`,target:"_blank",rel:"noopener noreferrer",class:"s-bullet-delivery-branch-map-link",title:Salla.lang.get("common.elements.open_in_google_maps"),onClick:t=>t.stopPropagation()},i("span",{class:"s-bullet-delivery-branch-map-link-icon",innerHTML:'<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path\n d="M7.94798 3.19336C11.1309 2.1083 12.7223 1.56578 13.5783 2.42174C14.4342 3.27771 13.8917 4.86914 12.8066 8.05201L12.0678 10.2195C11.2344 12.6639 10.8178 13.8861 10.131 13.9872C9.94631 14.0144 9.75517 13.9981 9.57248 13.9394C8.89297 13.7212 8.53377 12.4326 7.81538 9.8553C7.65604 9.28364 7.57637 8.99781 7.39494 8.7795C7.34228 8.71614 7.28386 8.65772 7.2205 8.60506C7.00219 8.42363 6.71636 8.34396 6.1447 8.18462C3.56741 7.46623 2.27876 7.10703 2.0606 6.42752C2.00195 6.24483 1.98558 6.05369 2.01277 5.86903C2.11392 5.18221 3.33613 4.76556 5.78054 3.93225L7.94798 3.19336Z"\n stroke="#555555" stroke-width="1.2" />\n</svg>\n '.replace(/mask0_25437_34440/g,`mask0_branch_${t.id}`),"aria-hidden":"true"}),i("span",{class:"sr-only"},Salla.lang.get("common.elements.open_in_google_maps")))))}))))}renderPickupTab(){return i("div",{class:{"s-bullet-delivery-content":!0,"s-bullet-delivery-content--active":"branch"===this.activeTab,"s-hidden":"branch"!==this.activeTab}},this.renderCountrySelect(),this.renderBranchSearch(),this.renderBranchList())}renderAddAddressForm(){Salla.lang.get("pages.checkout.add_new_address");const t=this.isMapModeAvailable,e=o(this.selectedCountry?.code??""),s=this.hasMapLocation();let r,a;if(t)"map"===this.mapStep?(r=this.canConfirmMapLocation(),a=Salla.lang.get("pages.checkout.confirm_location")):(r=s,a=this.savingAddress?Salla.lang.get("pages.checkout.loading"):Salla.lang.get("pages.checkout.confirm_address"));else{const t=this.selectedCountry&&this.selectedCity&&(!e||this.selectedRegion)&&(!e||!!this.selectedDistrict||!!(this.districtName&&this.districtName.trim().length>0));r=s||t,a=this.savingAddress?Salla.lang.get("pages.checkout.loading"):Salla.lang.get("pages.checkout.confirm_address")}return this.savedAddresses.length>0||d(this.getStoredIntent()),i("div",{class:"s-bullet-delivery-add-address"},i("form",{class:"s-bullet-delivery-add-address-form",onSubmit:e=>{e.preventDefault(),t&&"map"===this.mapStep&&r?this.mapStep="confirm":this.handleSubmitAddAddress(e)}},this.renderGuestDeliveryForm(),i("div",{class:"s-bullet-delivery-form-actions s-bullet-delivery-form-actions--single"},i("salla-button",{type:"submit",loading:this.savingAddress,disabled:!r||this.savingAddress,class:"s-bullet-delivery-add-address-submit"},a))))}renderFooter(){if("address"===this.activeTab&&!this.isLoggedIn&&this.isMapModeAvailable)return null;const t="address"===this.activeTab&&this.isLoggedIn;return i("div",{class:"s-bullet-delivery-footer"},i("salla-button",{ref:t=>{this.confirmBtn=t},disabled:this.isConfirmDisabled(),onClick:()=>this.handleConfirm(),"loader-position":"center",width:"wide"},"branch"===this.activeTab?Salla.lang.get("pages.checkout.confirm_receipt_from_the_branch"):Salla.lang.get("pages.checkout.confirm_address")),t&&i("salla-button",{onClick:()=>this.handleAddNewAddress(),width:"wide",shape:"link"},Salla.lang.get("pages.checkout.add_new_address")),!this.isLoggedIn&&i("salla-button",{shape:"link",onClick:()=>this.handleLogin()},Salla.lang.get("pages.checkout.login_to_use_saved_addresses")))}renderMainView(){const t=this.isLoggedIn&&"address"===this.activeTab&&0===this.savedAddresses.length&&!d(this.getStoredIntent()),e="branch"===this.activeTab&&this.supportsPickup?this.renderPickupTab():this.renderDeliveryTab();return i("div",null,this.showCartWillBeClearedBanner&&this.renderAlert(Salla.lang.get("blocks.scope.empty_cart_warning")),this.allocationOutOfCoverageMessage&&this.renderAllocationOutOfCoverageAlert(),e,!t&&this.renderFooter())}handleAfterAddToCart(){if("after_add_to_cart"!==this.openingType)return;const t=this.shouldPromptIncompleteIntentThisSession();this.hasBeenShownThisSession()&&!t||this.modal?.hasAttribute?.("visible")||(t&&this.markIncompleteIntentPrompted(),this.open())}overrideScopeSwitchUI(){const t=this.getStoredIntent(),e=document.querySelector('[onclick*="scopes"]');if(!e)return;if(!t||"address"!==t.type&&"branch"!==t.type)return e.style.display="none",void(e.onclick=()=>this.open());const i=(t,e)=>t&&t.length>e?`${t.slice(0,e)}...`:t??"",s="branch"===t.type?`${Salla.lang.get("mobile_app.strings.pickup")} ${Salla.lang.get("common.elements.from")} ${i(t.branch_details?.name,20)}`:`${Salla.lang.get("mobile_app.strings.delivery")} ${Salla.lang.get("common.elements.to")} ${i(t.address_details?.city?.name,10)}`;e.style.display="inline-flex",e.onclick=()=>this.open();const r=e.querySelector('span:not([class*="sicon"]):not([class*="icon"])');if(r)r.textContent=s;else{const t=Array.from(e.childNodes).find((t=>t.nodeType===Node.TEXT_NODE&&t.textContent?.trim()));t&&(t.textContent=` ${s}`)}}async componentWillLoad(){await Salla.onReady();try{this.overrideScopeSwitchUI(),this.cartSubmittingHandler=async()=>{this.isEnabled&&(this.pendingCartSubmitPromise?await this.pendingCartSubmitPromise:this.hasCompleteIntentForLoggedInUser()||(this.cartSubmitConfirmationPending=!0,this.pendingCartSubmitPromise=new Promise((t=>{if(this.pendingCartSubmitResolver=t,this.isGuestUser())return Salla.auth.setCanRedirect(!1),void Salla.event.dispatch("login::open",{withoutReload:!0,source:"cart-submit"});this.open()})),await this.pendingCartSubmitPromise))},Salla.cart.event.onSubmitting(this.cartSubmittingHandler)}catch(t){console.warn("SallaBulletDelivery: overrideScopeSwitchUI failed",t)}Salla.event.on("salla::bullet-delivery.modal.open.requested",this.bulletDeliveryOpenHandler),this.closeHandler=this.close.bind(this),Salla.event.on("salla::bullet-delivery.modal.close.requested",this.closeHandler),this.isRTL=Salla.config.get("theme.is_rtl"),this.authLoggedInHandler=()=>{if(this.cartSubmitConfirmationPending)return Salla.event.dispatch("login::close"),this.hasCompleteIntentForLoggedInUser()?void this.resolvePendingCartSubmit():void(this.modal?.hasAttribute?.("visible")||this.open());this.hasIncompleteUserAddressIntent()&&(this.modal?.hasAttribute?.("visible")||this.open())},Salla.event.on("auth::logged.in",this.authLoggedInHandler),this.authLoggedOutHandler=()=>{this.clearBulletDeliveryStoredData()},Salla.event.on("auth::logged.out",this.authLoggedOutHandler),this.loginClosedHandler=()=>{this.cartSubmitConfirmationPending&&this.isGuestUser()&&(this.hasCompleteIntentForLoggedInUser()||this.resolvePendingCartSubmit())},Salla.event.on("salla-login::closed",this.loginClosedHandler),this.cartItemAddedHandler=()=>this.handleAfterAddToCart(),"function"==typeof Salla.cart?.event?.onItemAdded?(this.useCartEventApi=!0,Salla.cart.event.onItemAdded(this.cartItemAddedHandler)):Salla.event.on(this.cartItemAddedEvent,this.cartItemAddedHandler)}render(){return this.isMobileApp||!this.isEnabled?null:i(s,{class:"s-bullet-delivery"},i("salla-modal",{ref:t=>{this.modal=t},isClosable:!this.isRequired&&!this.shouldForceNonClosable(),class:"s-bullet-delivery-modal",width:"sm"},i("div",{class:"s-bullet-delivery-inner"},i("div",{class:"s-bullet-delivery-header"},i("h2",{class:"s-bullet-delivery-title"},"address"===this.activeTab?Salla.lang.get("blocks.home.add_address_for_order_delivery"):Salla.lang.get("blocks.home.choose_branch_for_order_pickup")),i("p",{class:"s-bullet-delivery-subtitle"},"address"===this.activeTab?Salla.lang.get("blocks.home.products_available_for_delivery_shown_while_shopping"):Salla.lang.get("blocks.home.choose_branch_for_order_pickup_description"))),this.renderTabs(),"main"===this.viewMode&&this.renderMainView(),"add-address"===this.viewMode&&this.renderAddAddressForm())))}componentDidLoad(){if(this.componentReady=!0,this.isMobileApp)return this.isEnabled&&!this.hasBeenShownThisSession()&&Salla.event.dispatch("salla::bullet-delivery.open-sheet"),this.bulletDeliveryMobileSelectHandler=t=>{const e=this.extractMobileSelectPayload(t);e?this.applyMobileBulletDeliverySelection(e):console.warn("SallaBulletDelivery: received empty mobile select payload",t)},void Salla.event.on("salla::bullet-delivery.select",this.bulletDeliveryMobileSelectHandler);if(this.pendingOpen)return this.pendingOpen=!1,void this.open();switch(this.openingType){case"first_visit":this.hasBeenShownThisSession()?this.shouldPromptIncompleteIntentThisSession()&&(this.markIncompleteIntentPrompted(),this.open()):this.open();break;case"on_cart_click":Salla.url.is_page("cart")&&(!0===this.getShownStorage().get(this.sessionShownKey)?this.shouldPromptIncompleteIntentThisSession()&&(this.markIncompleteIntentPrompted(),this.open()):this.open())}const t=this.createCartViewElement();t&&"function"==typeof salla?.hooks?.mount&&Salla.hooks.mount("cart:items.start",t).catch((()=>{}))}disconnectedCallback(){this.componentReady=!1,Salla.event.off("salla::bullet-delivery.modal.open.requested",this.bulletDeliveryOpenHandler),this.closeHandler&&(Salla.event.off("salla::bullet-delivery.modal.close.requested",this.closeHandler),this.closeHandler=null),this.cartItemAddedHandler&&(this.useCartEventApi&&"function"==typeof Salla.cart?.event?.offItemAdded?Salla.cart.event.offItemAdded(this.cartItemAddedHandler):Salla.event.off(this.cartItemAddedEvent,this.cartItemAddedHandler),this.cartItemAddedHandler=null),this.cartSubmittingHandler&&("function"==typeof Salla.cart?.event?.offSubmitting?Salla.cart.event.offSubmitting(this.cartSubmittingHandler):Salla.event.off("cart::submitting",this.cartSubmittingHandler),this.cartSubmittingHandler=null),this.authLoggedInHandler&&(Salla.event.off("auth::logged.in",this.authLoggedInHandler),this.authLoggedInHandler=null),this.authLoggedOutHandler&&(Salla.event.off("auth::logged.out",this.authLoggedOutHandler),this.authLoggedOutHandler=null),this.loginClosedHandler&&(Salla.event.off("salla-login::closed",this.loginClosedHandler),this.loginClosedHandler=null),this.bulletDeliveryMobileSelectHandler&&(Salla.event.off("salla::bullet-delivery.select",this.bulletDeliveryMobileSelectHandler),this.bulletDeliveryMobileSelectHandler=null)}};ks.INITIAL_ADDRESS_FORM={country_id:0,is_default:!1,city_id:void 0,district_id:void 0,street:void 0,building_number:void 0,additional_number:void 0,postal_code:void 0,description:void 0},ks.DROPDOWN_SEARCH_DEBOUNCE_MS=400,ks.DROPDOWN_SEARCH_MIN_CHARS=2,ks.style='/*!twlt*/@supports (interpolate-size: allow-keywords) and (block-size: calc-size(auto, size)){.s-bullet-delivery .s-bullet-delivery-modal .s-modal-body,.s-bullet-delivery-inner{interpolate-size:allow-keywords}.s-bullet-delivery .s-bullet-delivery-modal .s-modal-body{overflow:clip;transition:block-size 500ms ease}.s-bullet-delivery-inner{overflow:clip;transition:block-size 500ms ease;block-size:calc-size(auto, size)}}.s-bullet-delivery .s-bullet-delivery-modal .s-modal-body:has(.s-searchable-dropdown--open){overflow:visible !important}.first-letter-cap::first-letter{text-transform:uppercase}.s-bullet-delivery-map-container{width:100%;height:450px;border-radius:8px;overflow:hidden;margin-bottom:12px}.s-bullet-delivery-map-container gmap-map{display:block;width:100%;height:100%}.s-bullet-delivery-address-confirm{display:flex;flex-direction:column;gap:20px;padding:0 24px}.s-bullet-delivery-address-confirm-card{display:flex;align-items:flex-start;gap:12px}.s-bullet-delivery-address-confirm-edit{border:1px solid #eee;border-radius:8px;padding:6px 12px;font-size:12px;font-weight:500;line-height:1;color:#333;background:white;cursor:pointer;white-space:nowrap;height:32px;flex-shrink:0;align-self:center;display:inline-flex;align-items:center;justify-content:center}.s-bullet-delivery-address-confirm-details{display:flex;flex-direction:column;align-items:flex-start;gap:4px;flex:1;min-width:0}.s-bullet-delivery-address-confirm-label{font-size:12px;color:#666}.s-bullet-delivery-address-confirm-text{font-size:14px;font-weight:700;color:#333;margin:0;word-break:break-word}.s-bullet-delivery-address-confirm-tag{display:inline-flex;align-items:center;gap:4px;border:1px solid #eee;border-radius:140px;padding:4px 8px;font-size:12px;color:#333;margin-top:4px}.s-bullet-delivery-address-confirm-tag-icon{width:9px;display:inline-flex;flex-shrink:0}.s-bullet-delivery-address-confirm-tag-icon svg{width:100%;height:100%}.s-bullet-delivery-address-confirm-description{display:flex;flex-direction:column;gap:8px}.s-bullet-delivery-address-confirm-description-label{font-size:14px;font-weight:500;color:#444}.s-bullet-delivery-address-confirm-description-optional{font-weight:400;color:#999;margin-inline-start:4px}.s-bullet-delivery-address-confirm-description-input{width:100%;border:1px solid #eee;border-radius:8px;padding:10px 12px;font-size:14px}.s-bullet-delivery-login-prompt{display:block;width:100%;text-align:center;background:none;border:none;color:var(--color-primary, #004956);font-size:14px;font-weight:500;cursor:pointer;padding:12px 0}@keyframes s-bullet-delivery-fade-in{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}.branch-status-badge{display:inline-flex;align-items:center;justify-content:center;padding:2px 6px;max-height:20px;border-radius:20px;font-size:9px;font-weight:500;border:1px solid transparent;white-space:nowrap}.branch-status-badge.green{color:#43a047;background:#e8f5e9;border-color:#43a047}.branch-status-badge.blue{color:#1e88e5;background:#e3f2fd;border-color:#1e88e5}.branch-status-badge.red{color:#e53935;background:#fdf2f2;border-color:#e53935}.branch-status-badge.yellow{color:#f9a825;background:#fff8e1;border-color:#f9a825}.branch-status-badge.gray{color:#757575;background:#f5f5f5;border-color:#757575}.branch-status-badge.brown{color:#6d4c41;background:#efebe9;border-color:#6d4c41}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}.visible{visibility:visible}.static{position:static}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.resize{resize:both}.flex-col{flex-direction:column}.items-center{align-items:center}.gap-1{gap:0.25rem}.gap-\\[2px\\]{gap:2px}.text-start{text-align:start}.text-red-500{--tw-text-opacity:1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.outline{outline-style:solid}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.s-hidden{display:none}.form-input{height:2.5rem;width:100%;border-radius:0.375rem;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.form-input:focus{border-color:var(--color-primary);--tw-ring-color:transparent}.form-input:is(.dark *){--tw-border-opacity:1;border-color:rgb(75 85 99 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(75 85 99 / var(--tw-bg-opacity, 1))}.form-input:focus:is(.dark *){border-color:var(--color-primary)}@media (min-width: 640px){.form-input{font-size:0.875rem;line-height:1.25rem}}.\\!btn{display:inline-flex;flex:1 1 0%;align-items:center;justify-content:center;white-space:nowrap;border-radius:0.375rem;padding-left:1.5rem;padding-right:1.5rem;padding-bottom:0.625rem;padding-top:0.5rem;font-size:0.875rem;line-height:1.25rem;font-weight:700;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.\\!btn:hover{opacity:0.8}.btn{display:inline-flex;flex:1 1 0%;align-items:center;justify-content:center;white-space:nowrap;border-radius:0.375rem;padding-left:1.5rem;padding-right:1.5rem;padding-bottom:0.625rem;padding-top:0.5rem;font-size:0.875rem;line-height:1.25rem;font-weight:700;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.btn:hover{opacity:0.8}.spinner-loader.reverse{border-right-color:#9f7171 !important;background-color:#f98181}.s-hidden{display:none}.s-scrollbar::-webkit-scrollbar{width:5px}.s-scrollbar::-webkit-scrollbar-track{background-color:#eee}.s-scrollbar::-webkit-scrollbar-thumb{background-color:var(--color-primary);border-radius:10px;-webkit-border-radius:10px;-moz-border-radius:10px;-ms-border-radius:10px;-o-border-radius:10px}.s-bullet-delivery .s-bullet-delivery-modal .s-modal-body{padding:0px}@media (min-width: 768px){.s-bullet-delivery .s-bullet-delivery-modal .s-modal-body{max-height:70dvh;overflow-y:auto}}.s-bullet-delivery .s-bullet-delivery-modal .s-modal-body:has(.s-searchable-dropdown--open){overflow:visible !important}.s-bullet-delivery-inner{min-block-size:0}.s-bullet-delivery-header{margin-bottom:1.5rem;text-align:start}.s-bullet-delivery-title{display:block;font-size:1.25rem;line-height:1.75rem;font-weight:700;color:var(--color-primary-dark)}.s-bullet-delivery-subtitle{margin-top:0.25rem;display:block;font-size:0.875rem;line-height:1.25rem;color:var(--color-primary-dark)}.s-bullet-delivery-tabs{margin-bottom:1.5rem;display:flex;gap:0.5rem}.s-bullet-delivery-tab{display:flex;flex:1 1 0%;cursor:pointer;align-items:center;gap:1rem;border-radius:0.5rem;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding-top:0.5rem;padding-bottom:0.5rem;padding-left:0.75rem;padding-right:0.75rem;font-size:0.875rem;line-height:1.25rem;font-weight:500;color:var(--color-primary-dark);transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:200ms}.s-bullet-delivery-tab:hover{background-color:color-mix(in srgb,var(--color-primary) 5%,transparent)}.s-bullet-delivery-tab--active{border-color:var(--color-primary-dark)}.s-bullet-delivery-tab svg{height:0.875rem;width:0.875rem;color:var(--color-primary-dark)}.s-bullet-delivery-tab-icon{display:flex;height:2rem;width:2rem;flex-shrink:0;align-items:center;justify-content:center;border-radius:0.75rem;--tw-bg-opacity:1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.s-bullet-delivery-allocation-out-of-coverage{margin-bottom:1rem;display:flex;width:100%;align-items:center;gap:0.5rem;--tw-bg-opacity:1;background-color:rgb(254 226 226 / var(--tw-bg-opacity, 1));padding-top:0.75rem;padding-bottom:0.75rem;padding-left:1rem;padding-right:1rem;text-align:end;--tw-text-opacity:1;color:rgb(127 29 29 / var(--tw-text-opacity, 1))}.s-bullet-delivery-allocation-out-of-coverage:where([dir="ltr"],[dir="ltr"] *){border-left-width:4px;border-left-color:rgb(239 68 68 / 0.5)}.s-bullet-delivery-allocation-out-of-coverage:where([dir="rtl"],[dir="rtl"] *){border-right-width:4px;border-right-color:rgb(239 68 68 / 0.5)}.s-bullet-delivery-allocation-out-of-coverage-text{font-size:0.875rem;line-height:1.25rem;line-height:1.4}.s-bullet-delivery-allocation-out-of-coverage-icon{display:inline-flex;flex-shrink:0;align-items:center;justify-content:center;--tw-text-opacity:1;color:rgb(127 29 29 / var(--tw-text-opacity, 1))}.s-bullet-delivery-allocation-out-of-coverage-icon svg{height:1.25rem;width:1.25rem}.s-bullet-delivery-content{margin-bottom:1.5rem;display:grid;gap:1rem}.s-bullet-delivery-content--active{animation:s-bullet-delivery-fade-in 220ms ease-out}.s-bullet-delivery-label{margin-bottom:0.5rem;display:block;font-size:0.875rem;line-height:1.25rem;font-weight:500;--tw-text-opacity:1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.s-bullet-delivery-error{margin-top:0.25rem;display:block;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.s-bullet-delivery-footer{display:grid;gap:0.75rem;text-align:center}.s-bullet-delivery-placeholder{margin-top:1rem;margin-bottom:1rem}.s-bullet-delivery-placeholder.s-placeholder-wrapper{margin-top:1rem !important;margin-bottom:1rem !important}.s-bullet-delivery-label-content{display:inline-flex;align-items:center;gap:0.5rem}.s-bullet-delivery-select-loader{display:inline-flex;align-items:center;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-bullet-delivery-search-row{display:flex;flex-direction:row;align-items:center;justify-content:space-between;gap:0.5rem;padding-left:1px;padding-right:1px}.s-bullet-delivery-search-row .s-bullet-delivery-search{min-width:0px;flex:1 1 0%}.s-bullet-delivery-search-row .s-bullet-delivery-location-btn{width:auto;flex-shrink:0}.s-bullet-delivery-field-row{margin-bottom:1rem;display:flex;gap:1rem}.s-bullet-delivery-field-row .s-bullet-delivery-field{margin-bottom:0px;flex:1 1 0%}.s-bullet-delivery-saved-addresses-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center}.s-bullet-delivery-saved-addresses-empty-icon{margin-bottom:0.75rem;--tw-text-opacity:1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.s-bullet-delivery-saved-addresses-empty-icon svg{height:2rem;width:2rem}.s-bullet-delivery-saved-addresses-empty-title{margin-bottom:0.5rem;font-size:1.125rem;line-height:1.75rem;font-weight:700;--tw-text-opacity:1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.s-bullet-delivery-saved-addresses-empty-desc{margin-bottom:1.5rem;max-width:24rem;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-bullet-delivery-addresses-list{display:flex;max-height:260px;flex-direction:column;overflow-y:auto;border-radius:0.75rem;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}@media (min-width: 768px){.s-bullet-delivery-addresses-list{max-height:220px}}.s-bullet-delivery-address-item{display:flex;cursor:pointer;flex-direction:row;align-items:center;gap:0.75rem;border-bottom-width:1px;--tw-border-opacity:1;border-bottom-color:rgb(229 231 235 / var(--tw-border-opacity, 1));padding-left:1rem;padding-right:1rem;padding-top:0.875rem;padding-bottom:0.875rem;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}.s-bullet-delivery-address-item:not(.s-bullet-delivery-address-item--disabled):hover{background-color:rgb(249 250 251 / 0.5)}.s-bullet-delivery-address-item--selected{--tw-bg-opacity:1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.s-bullet-delivery-address-item--disabled{cursor:not-allowed;opacity:0.6}.s-bullet-delivery-address-item--skeleton{display:flex;cursor:default;align-items:center;gap:0.75rem;border-radius:0.75rem;border-width:1px;border-bottom-width:0px;--tw-border-opacity:1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding-left:1rem;padding-right:1rem;padding-top:1rem;padding-bottom:1rem}.s-bullet-delivery-address-item--skeleton .s-bullet-delivery-address-lines{gap:0.5rem}.s-bullet-delivery-address-content{display:flex;min-width:0px;flex:1 1 0%;flex-direction:column;justify-content:center;text-align:start}.s-bullet-delivery-address-lines{display:flex;flex-direction:column;gap:0.125rem}.s-bullet-delivery-address-line1{display:block;font-size:1rem;line-height:1.5rem;font-weight:400;line-height:1.375;--tw-text-opacity:1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.s-bullet-delivery-address-line2{display:block;font-size:0.875rem;line-height:1.25rem;line-height:1.375;--tw-text-opacity:1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.s-bullet-delivery-address-map-icon{display:grid;height:2.5rem;width:2.5rem;place-content:center}.s-bullet-delivery-address-map-icon svg{height:100%;width:100%}.s-bullet-delivery-skel-radio{flex-shrink:0;border-radius:9999px}.s-bullet-delivery-skel-map{flex-shrink:0;border-radius:0.75rem}.s-bullet-delivery-search{position:relative;flex:1 1 0%}.s-bullet-delivery-search-icon{pointer-events:none;position:absolute;top:0px;bottom:0px;left:0px;display:flex;align-items:center;padding-left:0.75rem}.s-bullet-delivery-search-icon:where([dir="rtl"],[dir="rtl"] *){left:auto;right:0px;padding-left:0px;padding-right:0.75rem}.s-bullet-delivery-search-icon svg{height:0.875rem;width:0.875rem;stroke:var(--color-primary)}.s-bullet-delivery-branch-search-wrap{display:flex;min-height:40px;min-width:0px;flex:1 1 0%;flex-direction:row;align-items:stretch;overflow:hidden;border-radius:0.375rem;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.s-bullet-delivery-branch-search-wrap:focus-within{border-color:var(--color-primary-dark);--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);--tw-ring-color:var(--color-primary-dark)}.s-bullet-delivery-branch-search-icon{pointer-events:none;position:static;display:flex;flex-shrink:0;align-items:center;justify-content:center;padding-inline-start:0.5rem;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-bullet-delivery-branch-search-icon svg{height:1.25rem;width:1.25rem}.s-bullet-delivery-branch-search-input{min-height:40px;min-width:0px;flex:1 1 0%;border-radius:0px;border-style:none;background-color:transparent;padding-top:0.5rem;padding-bottom:0.5rem;padding-inline-end:0.75rem;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(17 24 39 / var(--tw-text-opacity, 1));--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.s-bullet-delivery-branch-search-input::placeholder{--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-bullet-delivery-branch-search-input:focus{outline:2px solid transparent;outline-offset:2px;border:none;box-shadow:none;--tw-ring-shadow:none}.s-bullet-delivery-location-btn{display:flex;flex-shrink:0;cursor:pointer;align-items:center;justify-content:center;gap:0.5rem;border-radius:0.5rem;border-width:1px;padding-left:1rem;padding-right:1rem;padding-top:0.5rem;padding-bottom:0.5rem;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(55 65 81 / var(--tw-text-opacity, 1));transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}.s-bullet-delivery-location-btn:hover{--tw-bg-opacity:1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}.s-bullet-delivery-location-btn:disabled{cursor:not-allowed;opacity:0.5}.s-bullet-delivery-location-btn--full{min-height:40px}.s-bullet-delivery-location-btn--loading{--tw-bg-opacity:1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.s-bullet-delivery-location-icon{height:0.875rem;width:0.875rem;flex-shrink:0}.s-bullet-delivery-location-icon svg{height:100%;width:100%}.s-bullet-delivery-branches-wrap{overflow:hidden}.s-bullet-delivery-branches-list{max-height:min(260px, 32svh);overflow-y:auto;border-radius:0.5rem;border-width:1px;--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}@media (min-width: 768px){.s-bullet-delivery-branches-list{max-height:220px}}.s-bullet-delivery-branches-loading{overflow:hidden;border-radius:0.5rem;border-width:1px;--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.s-bullet-delivery-branch-info{display:flex;max-width:6.25rem;flex-direction:column;gap:0.125rem}.s-bullet-delivery-branch-name{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow-wrap:break-word;font-size:0.875rem;line-height:1.25rem;font-weight:500;line-height:1.375;--tw-text-opacity:1;color:rgb(24 24 27 / var(--tw-text-opacity, 1))}.s-bullet-delivery-branch-prep{text-align:start;font-size:0.875rem;line-height:1.25rem;font-weight:400;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-bullet-delivery-branch-time{font-size:0.875rem;line-height:1.25rem;font-weight:400;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-bullet-delivery-branch-time:where([dir="ltr"],[dir="ltr"] *){text-align:end}.s-bullet-delivery-branch-time:where([dir="rtl"],[dir="rtl"] *){text-align:start}.s-bullet-delivery-branch-map-link{display:flex;flex-shrink:0;align-items:center;justify-content:center;border-radius:0.5rem;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));padding:0.5rem;--tw-text-opacity:1;color:rgb(75 85 99 / var(--tw-text-opacity, 1));text-decoration-line:none;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}.s-bullet-delivery-branch-map-link:hover{--tw-bg-opacity:1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}.s-bullet-delivery-branch-item>.s-bullet-delivery-branch-map-link{position:relative;z-index:10;pointer-events:auto}.s-bullet-delivery-branch-map-link-icon{display:flex;height:0.875rem;width:0.875rem;align-items:center;justify-content:center}.s-bullet-delivery-branch-map-link-icon svg{height:100%;width:100%}.s-bullet-delivery-branch-skeleton-title{max-width:100%}.s-bullet-delivery-branch-skeleton-time{justify-self:end}.s-bullet-delivery-branch-item{display:grid;min-width:0px;cursor:pointer;align-items:center;gap:0.5rem;border-bottom-width:1px;--tw-border-opacity:1;border-bottom-color:rgb(229 231 235 / var(--tw-border-opacity, 1));padding-left:1rem;padding-right:1rem;padding-top:0.75rem;padding-bottom:0.75rem;text-align:end;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms;grid-template-columns:auto auto auto 1fr auto}.s-bullet-delivery-branch-item:last-child{border-bottom-width:0px}.s-bullet-delivery-branch-item:hover:not(.s-bullet-delivery-branch-item--disabled){--tw-bg-opacity:1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.s-bullet-delivery-branch-item--selected{background-color:color-mix(in srgb,var(--color-primary) 5%,transparent)}.s-bullet-delivery-branch-item--disabled{cursor:not-allowed;opacity:0.5}.s-bullet-delivery-branch-icon{display:grid;place-content:center;border-radius:0.75rem;--tw-bg-opacity:1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1));stroke:var(--color-primary-dark);padding:0.625rem;color:var(--color-primary-dark)}.s-bullet-delivery-branch-icon span{display:block;height:0.875rem;width:0.875rem}.s-bullet-delivery-branch-icon span svg{height:100%;width:100%}.s-bullet-delivery-branch-skeleton{display:grid;min-width:0px;align-items:center;gap:0.5rem;border-bottom-width:1px;--tw-border-opacity:1;border-bottom-color:rgb(229 231 235 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding-left:1rem;padding-right:1rem;padding-top:0.75rem;padding-bottom:0.75rem;grid-template-columns:auto auto auto 1fr auto}.s-bullet-delivery-branch-skeleton:last-child{border-bottom-width:0px}.s-bullet-delivery-branch-skeleton-radio{flex-shrink:0}.s-bullet-delivery-branch-skeleton-icon{flex-shrink:0;border-radius:0.75rem}.s-bullet-delivery-branch-skeleton-icon salla-skeleton{display:block}.s-bullet-delivery-branch-skeleton-map{flex-shrink:0;border-radius:0.75rem}.s-bullet-delivery-branch-skeleton-map salla-skeleton{display:block}.s-bullet-delivery-branch-skeleton-content{display:flex;min-width:0px;flex-direction:column;gap:0.5rem;overflow:hidden}.s-bullet-delivery-branch-skeleton-content salla-skeleton{min-width:0px;max-width:100%}.s-bullet-delivery-radio{margin-top:2px;height:1rem;width:1rem;flex-shrink:0;cursor:pointer;appearance:none;border-radius:9999px;border-width:2px;--tw-border-opacity:1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}.s-bullet-delivery-radio:checked{border-color:var(--color-primary-dark);background:radial-gradient(circle,#fff 0,#fff 22%,var(--color-primary) 22%)}.s-bullet-delivery-radio:focus{outline:2px solid transparent;outline-offset:2px}.s-bullet-delivery-radio:focus-visible{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);--tw-ring-color:var(--color-primary-dark);--tw-ring-offset-width:2px}.s-bullet-delivery-skeleton{box-sizing:border-box;min-width:0px;max-width:100%;overflow:hidden;padding:1.25rem}.s-bullet-delivery-skeleton salla-skeleton{min-width:0px;max-width:100%}.s-bullet-delivery-skeleton-header{margin-bottom:1.5rem;display:flex;min-width:0px;max-width:100%;flex-direction:column;align-items:flex-start;gap:0.75rem}.s-bullet-delivery-skeleton-title{display:block;max-width:100%}.s-bullet-delivery-skeleton-subtitle{display:block;max-width:100%}.s-bullet-delivery-skeleton-tabs{margin-bottom:1.5rem;display:grid;min-width:0px;max-width:100%;grid-template-columns:repeat(2, minmax(0, 1fr));gap:0.5rem}.s-bullet-delivery-skeleton-tabs--single{grid-template-columns:repeat(1, minmax(0, 1fr))}.s-bullet-delivery-skeleton-tab{display:flex;align-items:center;gap:1rem;border-radius:0.75rem;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));padding-left:1rem;padding-right:1rem;padding-top:0.75rem;padding-bottom:0.75rem;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-bullet-delivery-skeleton-tab-icon{display:block;max-width:100%}.s-bullet-delivery-skeleton-tab-label{display:block;max-width:100%}.s-bullet-delivery-skeleton-field-label{display:block;max-width:100%}.s-bullet-delivery-skeleton-field-control{display:block;max-width:100%}.s-bullet-delivery-skeleton-content{margin-bottom:1.5rem;display:grid;min-width:0px;max-width:100%;gap:1rem}.s-bullet-delivery-skeleton-field{display:flex;min-width:0px;max-width:100%;flex-direction:column;align-items:flex-start;gap:0.5rem}.s-bullet-delivery-skeleton-footer{min-width:0px;max-width:100%}.s-bullet-delivery-add-address-header{margin-bottom:1.5rem;display:flex;align-items:center;justify-content:space-between;gap:0.75rem}.s-bullet-delivery-add-address-title{display:flex;width:100%;flex:1 1 0%;cursor:pointer;align-items:center;border-style:none;background-color:transparent;padding:0px;text-align:start;font-size:1.125rem;line-height:1.75rem;font-weight:700;color:var(--color-primary)}.s-bullet-delivery-add-address svg{height:1.5rem;width:1.5rem;fill:currentColor}.s-bullet-delivery-add-address-form{display:grid;gap:1rem}.s-bullet-delivery-add-address-submit{width:100%}.s-bullet-delivery-form-actions{display:flex;gap:0.75rem;border-top-width:1px;--tw-border-opacity:1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1));padding-top:1rem}.s-bullet-delivery-form-actions salla-button{flex:1 1 0%}.s-bullet-delivery-form-actions--single{border-top-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));padding-top:1.25rem}.s-bullet-delivery-form-actions--single salla-button{width:100%;flex:1 1 0%}.s-bullet-delivery-market-warning-overlay{position:fixed;inset:0px;z-index:60;display:flex;align-items:center;justify-content:center;background-color:rgb(0 0 0 / 0.5)}.s-bullet-delivery-market-warning{margin-left:1rem;margin-right:1rem;width:100%;max-width:24rem;border-radius:0.75rem;--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding:1.5rem;--tw-shadow:0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.s-bullet-delivery-market-warning-title{margin-bottom:0.75rem;font-size:1.125rem;line-height:1.75rem;font-weight:700;--tw-text-opacity:1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.s-bullet-delivery-market-warning-message{margin-bottom:1.5rem;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.s-bullet-delivery-market-warning-actions{display:flex;gap:0.75rem}.s-bullet-delivery-market-warning-actions salla-button{flex:1 1 0%}.s-bullet-delivery-cart-view{margin-bottom:1rem;display:flex;align-items:center;justify-content:space-between;gap:1rem;border-radius:0.75rem;border-width:1px;--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding:1rem}.s-bullet-delivery-cart-view-info{display:flex;min-width:0px;flex:1 1 0%;align-items:center;gap:0.75rem}.s-bullet-delivery-cart-view-text{display:flex;flex-direction:column;text-align:start}.s-bullet-delivery-cart-view-title{font-size:1rem;line-height:1.5rem;font-weight:600;--tw-text-opacity:1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.s-bullet-delivery-cart-view-subtitle{font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1));margin-block-start:0.125rem}.s-bullet-delivery-cart-view-icon{display:flex;height:3.5rem;width:3.5rem;flex-shrink:0;align-items:center;justify-content:center;border-radius:1rem;--tw-bg-opacity:1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1));color:var(--color-primary-dark)}.s-bullet-delivery-cart-view-icon svg{height:1.25rem;width:1.25rem;stroke:currentColor}.s-bullet-delivery-cart-view-button{flex-shrink:0;align-self:center}';const Ss=class{constructor(i){t(this,i),this.itemSelected=e(this,"itemSelected"),this.searchInput=e(this,"searchInput"),this.dropdownOpened=e(this,"dropdownOpened"),this.dropdownClosed=e(this,"dropdownClosed"),this.placeholder="",this.items=[],this.selectedItem=null,this.loading=!1,this.searching=!1,this.disabled=!1,this.required=!1,this.noResultsText="",this.inputId="",this.searchQuery="",this.clientSearch=!1,this.dropUp=!1,this.searchable=!0,this.keepParentScroll=!1,this.isOpen=!1,this.focusedIndex=-1,this.clientSearchQuery="",this.scrollableAncestor=null,this.handleTriggerClick=()=>{this.isOpen?this.close():this.open()},this.handleTriggerKeyDown=t=>{this.isOpen?this.navigateItems(t):"Enter"===t.key||" "===t.key||"ArrowDown"===t.key?(t.preventDefault(),this.open()):"Escape"===t.key&&this.close()},this.handleSearchInputChange=t=>{const e=t.target.value;this.clientSearch&&(this.clientSearchQuery=e),this.searchInput.emit(e),this.focusedIndex=-1},this.handleSearchKeyDown=t=>{this.navigateItems(t)}}connectedCallback(){this.boundHandleClickOutside=this.handleClickOutside.bind(this),document.addEventListener("mousedown",this.boundHandleClickOutside)}disconnectedCallback(){document.removeEventListener("mousedown",this.boundHandleClickOutside),this.scrollableAncestor&&(this.scrollableAncestor.style.overflow="",this.scrollableAncestor=null)}onItemsChange(){this.focusedIndex=-1}normalizeArabic(t){return t.replace(/[أإآا]/g,"ا")}get filteredItems(){if(!this.clientSearch||!this.clientSearchQuery.trim())return this.items;const t=this.normalizeArabic(this.clientSearchQuery.trim().toLowerCase());return this.items.filter((e=>{const i=this.normalizeArabic(e.name.toLowerCase()),s=e.name_en?e.name_en.toLowerCase():"";return i.includes(t)||s.includes(t)}))}getDisplayName(t){const e=salla?.config?.get("user.language_code");return e&&"ar"!==e&&t.name_en?.trim()?t.name_en.trim():t.name}handleClickOutside(t){this.isOpen&&(this.host.contains(t.target)||this.close())}findScrollableAncestor(){let t=this.host.parentElement;for(;t;){const e=getComputedStyle(t),i=e.overflowY;if("auto"===i||"scroll"===i||"hidden"===i||"clip"===e.overflow)return t;t=t.parentElement}return null}open(){this.disabled||this.loading||(this.isOpen=!0,this.focusedIndex=-1,this.keepParentScroll||(this.scrollableAncestor=this.findScrollableAncestor(),this.scrollableAncestor&&(this.scrollableAncestor.style.overflow="visible")),this.dropdownOpened.emit(),requestAnimationFrame((()=>this.searchInputRef?.focus())))}close(){this.isOpen&&(this.isOpen=!1,this.focusedIndex=-1,this.clientSearchQuery="",this.scrollableAncestor&&(this.scrollableAncestor.style.overflow="",this.scrollableAncestor=null),this.dropdownClosed.emit())}navigateItems(t){const e=this.filteredItems,i=e.length;switch(t.key){case"ArrowDown":t.preventDefault(),this.focusedIndex=i>0?(this.focusedIndex+1)%i:-1,this.scrollFocusedIntoView();break;case"ArrowUp":t.preventDefault(),this.focusedIndex=i>0?(this.focusedIndex-1+i)%i:-1,this.scrollFocusedIntoView();break;case"Enter":t.preventDefault(),this.focusedIndex>=0&&this.focusedIndex<i&&this.selectItem(e[this.focusedIndex]);break;case"Escape":t.preventDefault(),this.close()}}scrollFocusedIntoView(){this.focusedIndex<0||requestAnimationFrame((()=>{const t=this.panelRef?.querySelector(".s-searchable-dropdown-list"),e=t?.children[this.focusedIndex];e?.scrollIntoView({block:"nearest"})}))}selectItem(t){this.itemSelected.emit(t),this.close()}render(){const t=null!=this.selectedItem,e=`${this.inputId}-listbox`;return i(s,{key:"813e07447e4b3c51180345a38e82ffe135b6aec0",class:"s-searchable-dropdown"},i("div",{key:"34eb275b53d173015a68bd2eeb93f1621eae47d1",class:{"s-searchable-dropdown":!0,"s-searchable-dropdown--open":this.isOpen}},this.label&&i("label",{key:"3659b3ca3a882ea94656c37d2862cf2ebd0a6690",class:"s-searchable-dropdown-label",htmlFor:this.inputId},this.label,this.required&&i("span",{key:"9bbce65147d41fad44282ad04c0707b34ee12526",class:"s-searchable-dropdown-required"}," *")),i("div",{key:"177b983bf879eae9a4d191226c480cbb3abe21c1",class:{"s-searchable-dropdown-trigger":!0,"s-searchable-dropdown-trigger--disabled":this.disabled||this.loading,"s-searchable-dropdown-trigger--open":this.isOpen},role:"combobox","aria-expanded":this.isOpen?"true":"false","aria-haspopup":"listbox","aria-controls":e,"aria-disabled":this.disabled||this.loading?"true":"false",tabIndex:this.disabled||this.loading?-1:0,onClick:this.handleTriggerClick,onKeyDown:this.handleTriggerKeyDown},t?i("span",{class:"s-searchable-dropdown-trigger-text"},this.getDisplayName(this.selectedItem)):i("span",{class:"s-searchable-dropdown-trigger-placeholder"},this.placeholder),i("i",{key:"7887cee514ce9220a5974816700e7519c201183b",class:{"sicon-keyboard_arrow_down":!0,"s-searchable-dropdown-trigger-icon":!0,"s-searchable-dropdown-trigger-icon--open":this.isOpen},"aria-hidden":"true"})),this.isOpen&&i("div",{key:"cbca93a72a5ec382903844c60f8fef8e77d46d92",class:{"s-searchable-dropdown-panel":!0,"s-searchable-dropdown-panel--up":this.dropUp},ref:t=>this.panelRef=t},this.searchable&&i("div",{key:"06f901a77c0ac9e2bfcfaa2823df51370163925c",class:"s-searchable-dropdown-search-wrap"},i("i",{key:"5bc57c4e8022f53d1c7b64cde61fdc386c94bd65",class:"sicon-search s-searchable-dropdown-search-icon","aria-hidden":"true"}),i("input",{key:"b6a3db42d1785326c4be15c58f3d37c34d221f9e",ref:t=>this.searchInputRef=t,id:this.inputId,type:"text",class:"s-searchable-dropdown-search-input",placeholder:this.placeholder,value:this.clientSearch?this.clientSearchQuery:this.searchQuery,onInput:this.handleSearchInputChange,onKeyDown:this.handleSearchKeyDown,autocomplete:"off","aria-autocomplete":"list","aria-expanded":this.isOpen?"true":"false","aria-controls":e})),i("div",{key:"aac10f08cd4ed51829f254990d11c103861f0984",id:e,class:"s-searchable-dropdown-list s-scrollbar",role:"listbox"},this.renderListContent()))))}renderListContent(){if(this.searching||this.loading)return i("div",{class:"s-searchable-dropdown-loading"},i("svg",{class:"s-searchable-dropdown-spinner",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"3","stroke-linecap":"round",opacity:"0.25"}),i("path",{d:"M12 2a10 10 0 0 1 10 10",stroke:"currentColor","stroke-width":"3","stroke-linecap":"round"})));const t=this.filteredItems;return 0===t.length?i("div",{class:"s-searchable-dropdown-empty"},this.noResultsText||salla?.lang?.get("common.elements.no_options")||"No results found"):t.map(((t,e)=>{const s=this.selectedItem?.id===t.id;return i("button",{key:t.id,type:"button",role:"option",class:{"s-searchable-dropdown-item":!0,"s-searchable-dropdown-item--selected":s,"s-searchable-dropdown-item--focused":this.focusedIndex===e&&!s},"aria-selected":s?"true":"false",onClick:()=>this.selectItem(t)},i("span",{class:{"s-searchable-dropdown-item-name":!0,"s-searchable-dropdown-item-name--selected":s}},this.getDisplayName(t)),s&&i("i",{class:"sicon-check s-searchable-dropdown-item-check","aria-hidden":"true"}))}))}get host(){return r(this)}static get watchers(){return{items:["onItemsChange"]}}};Ss.style="/*!twlt*/.s-searchable-dropdown{position:relative}.s-searchable-dropdown--open{z-index:9999}.s-searchable-dropdown-label{display:block;font-size:14px;font-weight:500;color:var(--color-text-primary, #374151);margin-bottom:8px}.s-searchable-dropdown-required{color:var(--color-danger, #ef4444)}.s-searchable-dropdown-trigger{display:flex;align-items:center;justify-content:space-between;width:100%;min-height:40px;padding:8px 12px;font-size:14px;text-align:start;background:var(--color-surface, #fff);border:1px solid var(--color-border, #e5e7eb);border-radius:6px;cursor:pointer;transition:border-color 0.15s ease, box-shadow 0.15s ease}.s-searchable-dropdown-trigger:hover:not(.s-searchable-dropdown-trigger--disabled){border-color:var(--color-border-hover, #d1d5db)}.s-searchable-dropdown-trigger:focus{outline:none;border-color:var(--color-primary, #00897b);box-shadow:0 0 0 1px var(--color-primary, #00897b)}.s-searchable-dropdown-trigger--disabled{opacity:0.5;cursor:not-allowed;background:var(--color-surface-disabled, #f9fafb)}.s-searchable-dropdown-trigger--open{border-color:var(--color-primary, #00897b);box-shadow:0 0 0 1px var(--color-primary, #00897b)}.s-searchable-dropdown-trigger-text{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--color-text-primary, #111827)}.s-searchable-dropdown-trigger-placeholder{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--color-text-secondary, #9ca3af)}.s-searchable-dropdown-trigger-icon{flex-shrink:0;color:var(--color-text-secondary, #9ca3af);font-size:18px;transition:transform 0.2s ease;margin-inline-start:8px}.s-searchable-dropdown-trigger-icon--open{transform:rotate(180deg)}.s-searchable-dropdown-panel{position:absolute;z-index:9999;width:100%;margin-top:4px;background:var(--color-surface, #fff);border:1px solid var(--color-border, #e5e7eb);border-radius:8px;box-shadow:0 8px 24px rgba(0, 0, 0, 0.12);overflow:hidden;animation:s-searchable-dropdown-in 0.15s ease}.s-searchable-dropdown-panel--up{bottom:60%}@keyframes s-searchable-dropdown-in{from{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}.s-searchable-dropdown-search-wrap{display:flex;align-items:center;gap:8px;padding:8px 12px;border-bottom:1px solid var(--color-border, #f3f4f6)}.s-searchable-dropdown-search-icon{flex-shrink:0;color:var(--color-text-secondary, #9ca3af);font-size:16px}.s-searchable-dropdown-search-input{flex:1;min-width:0;border:none;outline:none;background:transparent;font-size:14px;color:var(--color-text-primary, #111827);box-shadow:none}.s-searchable-dropdown-search-input::placeholder{color:var(--color-text-secondary, #9ca3af)}.s-searchable-dropdown-search-input:focus{outline:none;box-shadow:none;border:none}.s-searchable-dropdown-list{max-height:min(40vh, 220px);overflow-y:auto;scrollbar-width:thin}.s-searchable-dropdown-item{display:flex;align-items:center;justify-content:space-between;width:100%;padding:10px 16px;margin:0;gap:8px;font:inherit;font-size:14px;text-align:inherit;color:var(--color-text-primary, #111827);background:transparent;border:none;border-bottom:1px solid var(--color-border-light, #f9fafb);cursor:pointer;transition:background 0.15s ease}.s-searchable-dropdown-item:last-child{border-bottom:none}.s-searchable-dropdown-item:hover{background:var(--color-hover, #f9fafb)}.s-searchable-dropdown-item--selected{background:color-mix(in srgb, var(--color-primary, #00897b) 8%, transparent)}.s-searchable-dropdown-item--focused{background:color-mix(in srgb, var(--color-primary, #165b54) 12%, transparent)}.s-searchable-dropdown-item-name{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.s-searchable-dropdown-item-name--selected{color:var(--color-primary, #00897b);font-weight:500}.s-searchable-dropdown-item-check{flex-shrink:0;color:var(--color-primary, #00897b);font-size:14px;margin-inline-start:8px}.s-searchable-dropdown-empty{display:flex;align-items:center;justify-content:center;padding:24px 16px;font-size:14px;color:var(--color-text-secondary, #9ca3af)}.s-searchable-dropdown-loading{display:flex;align-items:center;justify-content:center;padding:24px 16px;color:var(--color-text-secondary, #9ca3af)}.s-searchable-dropdown-spinner{width:20px;height:20px;animation:s-searchable-dropdown-spin 0.8s linear infinite}@keyframes s-searchable-dropdown-spin{to{transform:rotate(360deg)}}.visible{visibility:visible}.block{display:block}.hidden{display:none}.shadow{--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.s-scrollbar::-webkit-scrollbar{width:5px}.s-scrollbar::-webkit-scrollbar-track{background-color:#eee}.s-scrollbar::-webkit-scrollbar-thumb{background-color:var(--color-primary);border-radius:10px;-webkit-border-radius:10px;-moz-border-radius:10px;-ms-border-radius:10px;-o-border-radius:10px}.s-bullet-delivery .s-bullet-delivery-modal .s-modal-body:has(.s-searchable-dropdown--open){overflow:visible !important}.s-searchable-dropdown{position:relative}.s-searchable-dropdown--open{z-index:9999}.s-searchable-dropdown-label{margin-bottom:0.5rem;display:block;font-size:0.875rem;line-height:1.25rem;font-weight:500;color:var(--color-text-primary,#374151)}.s-searchable-dropdown-required{color:var(--color-danger,#ef4444)}.s-searchable-dropdown-trigger{display:flex;min-height:40px;width:100%;cursor:pointer;align-items:center;justify-content:space-between;border-radius:0.375rem;border-width:1px;border-color:var(--color-border,#e5e7eb);background-color:var(--color-surface,#fff);padding-left:0.75rem;padding-right:0.75rem;padding-top:0.5rem;padding-bottom:0.5rem;text-align:start;font-size:0.875rem;line-height:1.25rem;transition-property:border-color,box-shadow;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}.s-searchable-dropdown-trigger:hover{border-color:var(--color-border-hover,#d1d5db)}.s-searchable-dropdown-trigger:focus{border-color:var(--color-primary);--tw-shadow:0 0 0 1px var(--color-primary,#00897b);--tw-shadow-colored:0 0 0 1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);outline:2px solid transparent;outline-offset:2px}.s-searchable-dropdown-trigger--disabled{cursor:not-allowed;background-color:var(--color-surface-disabled,#f9fafb);opacity:0.5}.s-searchable-dropdown-trigger--open{border-color:var(--color-primary) !important;--tw-shadow:0 0 0 1px var(--color-primary,#00897b);--tw-shadow-colored:0 0 0 1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.s-searchable-dropdown-trigger-text{flex:1 1 0%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--color-text-primary,#111827)}.s-searchable-dropdown-trigger-placeholder{flex:1 1 0%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--color-text-secondary,#9ca3af)}.s-searchable-dropdown-trigger-icon{margin-inline-start:0.5rem;flex-shrink:0;font-size:1.125rem;line-height:1.75rem;color:var(--color-text-secondary,#9ca3af);transition-property:transform;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:200ms}.s-searchable-dropdown-trigger-icon--open{--tw-rotate:180deg;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.s-searchable-dropdown-panel{position:absolute;z-index:9999;margin-top:0.25rem;width:100%;overflow:hidden;border-radius:0.5rem;border-width:1px;border-color:var(--color-border,#e5e7eb);background-color:var(--color-surface,#fff);--tw-shadow:0 8px 24px rgba(0,0,0,0.12);--tw-shadow-colored:0 8px 24px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.s-searchable-dropdown-panel--up{bottom:60%}.s-searchable-dropdown-search-wrap{display:flex;align-items:center;gap:0.5rem;border-bottom-width:1px;border-bottom-color:var(--color-border,#f3f4f6);padding-left:0.75rem;padding-right:0.75rem;padding-top:0.5rem;padding-bottom:0.5rem}.s-searchable-dropdown-search-icon{flex-shrink:0;font-size:1rem;line-height:1.5rem;color:var(--color-text-secondary,#9ca3af)}.s-searchable-dropdown-search-input{min-width:0px;flex:1 1 0%;border-width:0px;background-color:transparent;font-size:0.875rem;line-height:1.25rem;color:var(--color-text-primary,#111827);--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);outline:2px solid transparent;outline-offset:2px}.s-searchable-dropdown-search-input::placeholder{color:var(--color-text-secondary,#9ca3af)}.s-searchable-dropdown-search-input:focus{border-width:0px;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);outline:2px solid transparent;outline-offset:2px;--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000)}.s-searchable-dropdown-list{max-height:min(40vh, 220px);overflow-y:auto;scrollbar-width:thin}.s-searchable-dropdown-item{margin:0px;display:flex;width:100%;cursor:pointer;align-items:center;justify-content:space-between;gap:0.5rem;border-width:0px;border-bottom-width:1px;border-bottom-color:var(--color-border-light,#f9fafb);background-color:transparent;padding-left:1rem;padding-right:1rem;padding-top:0.625rem;padding-bottom:0.625rem;font-family:inherit;font-size:0.875rem;line-height:1.25rem;color:var(--color-text-primary,#111827);transition-property:background;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms;text-align:inherit}.s-searchable-dropdown-item:last-child{border-bottom-width:0px}.s-searchable-dropdown-item--selected{background-color:color-mix(in srgb,var(--color-primary,#00897b) 8%,transparent)}.s-searchable-dropdown-item-name{flex:1 1 0%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.s-searchable-dropdown-item-name--selected{font-weight:500;color:var(--color-primary)}.s-searchable-dropdown-item-check{margin-inline-start:0.5rem;flex-shrink:0;font-size:0.875rem;line-height:1.25rem;color:var(--color-primary)}.s-searchable-dropdown-empty{display:flex;align-items:center;justify-content:center;padding-left:1rem;padding-right:1rem;padding-top:1.5rem;padding-bottom:1.5rem;font-size:0.875rem;line-height:1.25rem;color:var(--color-text-secondary,#9ca3af)}.s-searchable-dropdown-loading{display:flex;align-items:center;justify-content:center;padding-left:1rem;padding-right:1rem;padding-top:1.5rem;padding-bottom:1.5rem;color:var(--color-text-secondary,#9ca3af)}.s-searchable-dropdown-spinner{height:1.25rem;width:1.25rem}@keyframes spin{to{transform:rotate(360deg)}}.s-searchable-dropdown-spinner{animation:spin 0.8s linear infinite}";export{ks as salla_bullet_delivery,Ss as salla_searchable_dropdown}