@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
@@ -3,7 +3,7 @@
3
3
  */
4
4
  'use strict';
5
5
 
6
- var index = require('./index-Bw3b6O6G.js');
6
+ var index = require('./index-DGpOR-TH.js');
7
7
 
8
8
  function _mergeNamespaces(n, m) {
9
9
  m.forEach(function (e) {
@@ -3,7 +3,7 @@
3
3
  */
4
4
  'use strict';
5
5
 
6
- var index = require('./index-Bw3b6O6G.js');
6
+ var index = require('./index-DGpOR-TH.js');
7
7
 
8
8
  function _mergeNamespaces(n, m) {
9
9
  m.forEach(function (e) {
@@ -3,7 +3,7 @@
3
3
  */
4
4
  'use strict';
5
5
 
6
- var index = require('./index-Bw3b6O6G.js');
6
+ var index = require('./index-DGpOR-TH.js');
7
7
 
8
8
  function _mergeNamespaces(n, m) {
9
9
  m.forEach(function (e) {
@@ -3,7 +3,7 @@
3
3
  */
4
4
  'use strict';
5
5
 
6
- var index = require('./index-Bw3b6O6G.js');
6
+ var index = require('./index-DGpOR-TH.js');
7
7
 
8
8
  function _mergeNamespaces(n, m) {
9
9
  m.forEach(function (e) {
@@ -3,7 +3,7 @@
3
3
  */
4
4
  'use strict';
5
5
 
6
- var index = require('./index-Bw3b6O6G.js');
6
+ var index = require('./index-DGpOR-TH.js');
7
7
 
8
8
  function _mergeNamespaces(n, m) {
9
9
  m.forEach(function (e) {
@@ -3,7 +3,7 @@
3
3
  */
4
4
  'use strict';
5
5
 
6
- var index = require('./index-Bw3b6O6G.js');
6
+ var index = require('./index-DGpOR-TH.js');
7
7
 
8
8
  function _mergeNamespaces(n, m) {
9
9
  m.forEach(function (e) {
@@ -3,7 +3,7 @@
3
3
  */
4
4
  'use strict';
5
5
 
6
- var index = require('./index-Bw3b6O6G.js');
6
+ var index = require('./index-DGpOR-TH.js');
7
7
 
8
8
  function _mergeNamespaces(n, m) {
9
9
  m.forEach(function (e) {
@@ -0,0 +1,340 @@
1
+ /*!
2
+ * Crafted with ❤ by Salla
3
+ */
4
+ 'use strict';
5
+
6
+ /**
7
+ * API Service for salla-bullet-delivery component
8
+ * Uses Salla's shipping API and scope API for delivery location management
9
+ */
10
+ const API_LOG_PREFIX = 'BulletDeliveryAPI';
11
+ const validId = (id) => {
12
+ const n = id == null ? Number.NaN : Number(id);
13
+ return !Number.isNaN(n) && n !== 0;
14
+ };
15
+ async function withApiErrorHandling(fn, fallback, logLabel) {
16
+ try {
17
+ return await fn();
18
+ }
19
+ catch (error) {
20
+ console.error(`${API_LOG_PREFIX}: ${logLabel}`, error);
21
+ return fallback;
22
+ }
23
+ }
24
+ const apiCache = new Map();
25
+ const CACHE_TTL = 5 * 60 * 1000;
26
+ function getCached(key) {
27
+ const entry = apiCache.get(key);
28
+ if (!entry || Date.now() - entry.timestamp > CACHE_TTL) {
29
+ apiCache.delete(key);
30
+ return null;
31
+ }
32
+ return entry.data;
33
+ }
34
+ function setCache(key, data) {
35
+ apiCache.set(key, { data, timestamp: Date.now() });
36
+ }
37
+ /** Uses country code from API (e.g. 'SA'). */
38
+ const isSaudiArabia = (countryCode) => String(countryCode).toUpperCase() === 'SA';
39
+ /**
40
+ * Fast Delivery API Service
41
+ * Uses Salla's shipping API and scopes API. Branch and address data are used as returned by the API (no mapping).
42
+ */
43
+ const bulletDeliveryAPI = {
44
+ /**
45
+ * Get available countries from Salla shipping API
46
+ * @param forBranch - when true, use for_branch=1 (e.g. for pickup/branches tab)
47
+ */
48
+ async getCountries(forBranch = false, query) {
49
+ const cacheKey = !query?.trim() ? `countries_${forBranch ? 1 : 0}` : null;
50
+ if (cacheKey) {
51
+ const cached = getCached(cacheKey);
52
+ if (cached)
53
+ return cached;
54
+ }
55
+ const result = await withApiErrorHandling(async () => {
56
+ const params = { for_branch: forBranch ? 1 : 0 };
57
+ if (forBranch) {
58
+ params.for_allocation = 1;
59
+ }
60
+ if (query?.trim())
61
+ params.query = query.trim();
62
+ const data = (await salla.api.request("shipping/countries", { params }))?.data ?? [];
63
+ return data.map((c) => ({ id: c.id, code: c.code, name: c.name, has_regions: isSaudiArabia(c.code) }));
64
+ }, [], 'Error getting countries');
65
+ if (cacheKey && result.length > 0)
66
+ setCache(cacheKey, result);
67
+ return result;
68
+ },
69
+ /**
70
+ * Get regions for a country from Salla shipping API
71
+ * Endpoint: GET /shipping/countries/<COUNTRY_ID>/region
72
+ */
73
+ async getRegions(countryId, query) {
74
+ if (!validId(countryId)) {
75
+ console.warn(`${API_LOG_PREFIX}: getRegions called without valid country_id`);
76
+ return [];
77
+ }
78
+ const cacheKey = !query?.trim() ? `regions_${countryId}` : null;
79
+ if (cacheKey) {
80
+ const cached = getCached(cacheKey);
81
+ if (cached)
82
+ return cached;
83
+ }
84
+ const result = await withApiErrorHandling(async () => {
85
+ const params = {};
86
+ if (query?.trim())
87
+ params.query = query.trim();
88
+ const data = (await salla.api.request(`shipping/countries/${countryId}/regions`, { params }))?.data ?? [];
89
+ return data.map((r) => ({ id: r.id, name: r.name, code: r.code, country_id: Number(countryId) }));
90
+ }, [], 'Error fetching regions');
91
+ if (cacheKey && result.length > 0)
92
+ setCache(cacheKey, result);
93
+ return result;
94
+ },
95
+ /**
96
+ * Get cities from Salla shipping API
97
+ * @param regionId - Optional; when provided (e.g. for SA), cities are filtered by region
98
+ */
99
+ async getCities(countryId, regionId, query) {
100
+ if (!validId(countryId)) {
101
+ console.warn(`${API_LOG_PREFIX}: getCities called without valid country_id`);
102
+ return [];
103
+ }
104
+ const cacheKey = !query?.trim() ? `cities_${countryId}_${regionId || 'all'}` : null;
105
+ if (cacheKey) {
106
+ const cached = getCached(cacheKey);
107
+ if (cached)
108
+ return cached;
109
+ }
110
+ const result = await withApiErrorHandling(async () => {
111
+ const params = { for_branch: 0, country_id: countryId };
112
+ if (regionId)
113
+ params.region_id = regionId;
114
+ if (query?.trim())
115
+ params.query = query.trim();
116
+ const data = (await salla.api.request("shipping/cities", { params }))?.data ?? [];
117
+ return data.map((c) => ({ id: c.id, name: c.name, country_id: countryId, ...(c.region_id != null && { region_id: c.region_id }) }));
118
+ }, [], 'Error fetching cities');
119
+ if (cacheKey && result.length > 0)
120
+ setCache(cacheKey, result);
121
+ return result;
122
+ },
123
+ /**
124
+ * Get districts from Salla shipping API
125
+ */
126
+ async getDistricts(cityId, query) {
127
+ if (!validId(cityId)) {
128
+ console.warn(`${API_LOG_PREFIX}: getDistricts called without valid city_id`);
129
+ return [];
130
+ }
131
+ return withApiErrorHandling(async () => {
132
+ const params = { for_branch: 0, city_id: cityId };
133
+ if (query?.trim())
134
+ params.query = query.trim();
135
+ const raw = (await salla.api.request("shipping/districts", { params }))?.data;
136
+ const list = Array.isArray(raw) ? raw : (Array.isArray(raw?.districts) ? raw.districts : []);
137
+ return list.map((d) => ({ id: d.id, name: d.name, name_en: d.name_en, city_id: cityId }));
138
+ }, [], 'Error fetching districts');
139
+ },
140
+ async getSavedAddresses() {
141
+ return withApiErrorHandling(async () => {
142
+ const data = (await salla.api.request("address"))?.data;
143
+ return Array.isArray(data) ? data : [];
144
+ }, [], 'Error fetching user addresses');
145
+ },
146
+ async getBranches({ query, lat, lng, country_id, per_page = 20 } = {}) {
147
+ const hasSearchParams = query?.trim()?.length >= 2 || lat || lng;
148
+ const cacheKey = !hasSearchParams && country_id ? `branches_${country_id}` : null;
149
+ if (cacheKey) {
150
+ const cached = getCached(cacheKey);
151
+ if (cached)
152
+ return cached;
153
+ }
154
+ const result = await withApiErrorHandling(async () => {
155
+ const params = { per_page };
156
+ if (query?.trim().length >= 2)
157
+ params.query = query;
158
+ if (lat)
159
+ params.lat = lat;
160
+ if (lng)
161
+ params.lng = lng;
162
+ if (country_id)
163
+ params.country_id = country_id;
164
+ const res = await salla.api.request("branches", { params });
165
+ return (Array.isArray(res?.data) ? res.data : []);
166
+ }, [], 'Error fetching branches');
167
+ if (cacheKey && result.length > 0)
168
+ setCache(cacheKey, result);
169
+ return result;
170
+ },
171
+ async saveAddressLocation(payload) {
172
+ return withApiErrorHandling(async () => {
173
+ const res = await salla.api.request('address/location', { ...payload, for_allocation: true }, 'post');
174
+ const data = res?.data ?? res;
175
+ const address = typeof data === 'object' && data != null && 'id' in data ? data : undefined;
176
+ return { success: true, address };
177
+ }, { success: false }, 'Error saving address/location');
178
+ },
179
+ async setDeliveryScope(scopeId) {
180
+ return withApiErrorHandling(async () => {
181
+ await salla.api.withoutNotifier(() => salla.scope.change({ id: scopeId }));
182
+ salla.storage.set("scope", { ...(salla.storage.get("scope") || {}), id: scopeId });
183
+ return true;
184
+ }, false, 'Error setting delivery scope');
185
+ },
186
+ async allocateScope(payload) {
187
+ const errMsg = (d) => d?.error?.message ?? d?.message ?? 'Failed to allocate scope';
188
+ try {
189
+ const response = await salla.api.withoutNotifier(() => salla.api.request("scopes/allocation", payload, 'post'));
190
+ // SDK resolves with { data } and throws on non-2xx; any resolved value is success
191
+ const data = response?.data ?? response;
192
+ return { success: true, data: data };
193
+ }
194
+ catch (error) {
195
+ console.error(`${API_LOG_PREFIX}: Error allocating scope`, error);
196
+ const err = error;
197
+ return { success: false, error: err?.response?.data != null ? errMsg(err.response.data) : (err?.message ?? 'Unknown error') };
198
+ }
199
+ },
200
+ async getAddressToken() {
201
+ return withApiErrorHandling(async () => {
202
+ const res = await salla.api.request('address/autocomplete-token');
203
+ return res?.data?.token ?? null;
204
+ }, null, 'Error fetching address autocomplete token');
205
+ },
206
+ };
207
+ function clearApiCache() {
208
+ apiCache.clear();
209
+ }
210
+
211
+ /**
212
+ * Helper functions for salla-bullet-delivery component
213
+ */
214
+ const EARTH_RADIUS_KM = 6371;
215
+ const deg2rad = (deg) => deg * (Math.PI / 180);
216
+ /** Haversine distance in km */
217
+ function calculateDistance(lat1, lon1, lat2, lon2) {
218
+ const dLat = deg2rad(lat2 - lat1);
219
+ const dLon = deg2rad(lon2 - lon1);
220
+ const a = Math.sin(dLat / 2) ** 2 +
221
+ Math.cos(deg2rad(lat1)) * Math.cos(deg2rad(lat2)) * Math.sin(dLon / 2) ** 2;
222
+ return EARTH_RADIUS_KM * 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
223
+ }
224
+ /**
225
+ * Whether a pickup branch can be selected.
226
+ *
227
+ * `pickup_readiness` is the richer, backend-computed verdict (INV-357) and wins whenever the API
228
+ * sends it. Not every store's `GET /branches` returns it though, so we fall back to the original
229
+ * `is_open` rule instead of treating a missing object as "not selectable" — otherwise every branch
230
+ * in the list renders disabled and pickup cannot be chosen at all (SP-22202).
231
+ */
232
+ const isBranchSelectable = (branch) => {
233
+ if (!branch)
234
+ return false;
235
+ const selectable = branch.pickup_readiness?.selectable;
236
+ return typeof selectable === 'boolean' ? selectable : branch.is_open !== false;
237
+ };
238
+ /** Nearest available branch by distance; single pass O(n). */
239
+ function findNearestBranch(branches, userLat, userLon) {
240
+ let nearest = null;
241
+ let minD = Number.POSITIVE_INFINITY;
242
+ for (const b of branches) {
243
+ const lat = b.location?.lat != null ? Number(b.location.lat) : Number.NaN;
244
+ const lng = b.location?.lng != null ? Number(b.location.lng) : Number.NaN;
245
+ if (Number.isNaN(lat) || Number.isNaN(lng) || b.is_open === false)
246
+ continue;
247
+ const d = calculateDistance(userLat, userLon, lat, lng);
248
+ if (d < minD) {
249
+ minD = d;
250
+ nearest = b;
251
+ }
252
+ }
253
+ return nearest;
254
+ }
255
+ const filterBranches = (branches, searchQuery) => {
256
+ if (!searchQuery)
257
+ return branches;
258
+ const q = searchQuery.toLowerCase();
259
+ return branches.filter((b) => b.name.toLowerCase().includes(q) || b.city?.name?.toLowerCase().includes(q));
260
+ };
261
+ const getIntentSubtitle = (intent, toAddress, fromBranch) => {
262
+ if (intent.type === 'branch') {
263
+ const loc = intent.branch_details?.city ?? intent.branch_details?.name;
264
+ return loc ? `${fromBranch} ${loc}`.trim() : '';
265
+ }
266
+ if (intent.type === 'address' && intent.address_details) {
267
+ const addr = [intent.address_details.district?.name, intent.address_details.city?.name, intent.address_details.country?.name].filter(Boolean).join('، ') || intent.address_details.short_address || '';
268
+ return addr ? `${toAddress} ${addr}`.trim() : '';
269
+ }
270
+ return '';
271
+ };
272
+ const idFrom = (val) => (val != null ? Number(val) : undefined);
273
+ const getIntentCountryId = (i) => idFrom(i?.address_details?.country?.id);
274
+ const getIntentCountryCode = (i) => i?.country_code ?? i?.address_details?.country?.code ?? '';
275
+ const getIntentRegionId = (i) => idFrom(i?.address_details?.region?.id);
276
+ const getIntentCityId = (i) => idFrom(i?.address_details?.city?.id);
277
+ const getIntentDistrictId = (i) => idFrom(i?.address_details?.district?.id);
278
+ const getIntentBranchId = (i) => i?.branch_details?.id;
279
+ /** Intent coordinates (branch tab only; address flow no longer uses coordinates). */
280
+ const getIntentLatitude = (i) => i?.branch_details?.latitude;
281
+ const getIntentLongitude = (i) => i?.branch_details?.longitude;
282
+ const isMapOriginIntent = (i) => !!i && i.type === 'address' && i.address_details?.lat != null && i.address_details?.lng != null;
283
+ const hasSessionAddressIntent = (intent) => {
284
+ if (!intent || intent.type !== 'address' || intent.address_id)
285
+ return false;
286
+ if (isMapOriginIntent(intent))
287
+ return true;
288
+ const c = getIntentCountryId(intent);
289
+ const city = getIntentCityId(intent);
290
+ const d = getIntentDistrictId(intent);
291
+ const code = getIntentCountryCode(intent);
292
+ const hasDistrictId = d != null && Number(d) !== 0;
293
+ const hasDistrictName = Boolean(intent.address_details?.district?.name?.trim());
294
+ const districtOk = !isSaudiArabia(code) || hasDistrictId || hasDistrictName;
295
+ return !!(c && city && districtOk);
296
+ };
297
+ const requireRegionAndDistrictForSA = (countryCode, regionId, districtIdOrName) => !countryCode || !isSaudiArabia(countryCode)
298
+ ? true
299
+ : (regionId != null && Number(regionId) !== 0) && (districtIdOrName != null && (typeof districtIdOrName === 'number' ? districtIdOrName !== 0 : String(districtIdOrName).trim().length > 0));
300
+ function buildAddressLocationPayloadFromSelection(options) {
301
+ const { countryId, countryCode, regionId, cityId, districtId, description = '', lat, lng, shortAddress } = options;
302
+ const desc = description || '';
303
+ return {
304
+ country_id: Number(countryId) || undefined,
305
+ region_id: regionId != null ? Number(regionId) : undefined,
306
+ city_id: cityId != null ? Number(cityId) : undefined,
307
+ district_id: districtId != null ? Number(districtId) : undefined,
308
+ description: desc,
309
+ ...(countryCode && isSaudiArabia(countryCode) && { local: desc }),
310
+ ...(lat != null && lng != null && { lat, lng }),
311
+ ...(shortAddress && { short_address: shortAddress }),
312
+ };
313
+ }
314
+ const GEO_ERROR_MESSAGES = {
315
+ [GeolocationPositionError.PERMISSION_DENIED]: 'Location permission denied',
316
+ [GeolocationPositionError.POSITION_UNAVAILABLE]: 'Location unavailable',
317
+ [GeolocationPositionError.TIMEOUT]: 'Location timeout',
318
+ };
319
+ const getGeolocationErrorMessage = (errorCode) => GEO_ERROR_MESSAGES[errorCode] ?? 'An error occurred while detecting location';
320
+
321
+ exports.buildAddressLocationPayloadFromSelection = buildAddressLocationPayloadFromSelection;
322
+ exports.bulletDeliveryAPI = bulletDeliveryAPI;
323
+ exports.clearApiCache = clearApiCache;
324
+ exports.filterBranches = filterBranches;
325
+ exports.findNearestBranch = findNearestBranch;
326
+ exports.getGeolocationErrorMessage = getGeolocationErrorMessage;
327
+ exports.getIntentBranchId = getIntentBranchId;
328
+ exports.getIntentCityId = getIntentCityId;
329
+ exports.getIntentCountryCode = getIntentCountryCode;
330
+ exports.getIntentCountryId = getIntentCountryId;
331
+ exports.getIntentDistrictId = getIntentDistrictId;
332
+ exports.getIntentLatitude = getIntentLatitude;
333
+ exports.getIntentLongitude = getIntentLongitude;
334
+ exports.getIntentRegionId = getIntentRegionId;
335
+ exports.getIntentSubtitle = getIntentSubtitle;
336
+ exports.hasSessionAddressIntent = hasSessionAddressIntent;
337
+ exports.isBranchSelectable = isBranchSelectable;
338
+ exports.isMapOriginIntent = isMapOriginIntent;
339
+ exports.isSaudiArabia = isSaudiArabia;
340
+ exports.requireRegionAndDistrictForSA = requireRegionAndDistrictForSA;