@salla.sa/twilight-components 2.14.410 → 2.14.412

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 (315) hide show
  1. package/dist/cjs/{filepond-Apepuv0K.js → filepond-BO-XBD1i.js} +1 -1
  2. package/dist/cjs/{filepond-plugin-file-poster-iW6rBzvV.js → filepond-plugin-file-poster-DJIG7vOj.js} +1 -1
  3. package/dist/cjs/{filepond-plugin-file-validate-size-CnSaNZSz.js → filepond-plugin-file-validate-size-Bhtuy-Ar.js} +1 -1
  4. package/dist/cjs/{filepond-plugin-file-validate-type-Cd_N5-75.js → filepond-plugin-file-validate-type-BQhRvZvr.js} +1 -1
  5. package/dist/cjs/{filepond-plugin-image-edit-B-VgjvBB.js → filepond-plugin-image-edit-C4unOPfE.js} +1 -1
  6. package/dist/cjs/{filepond-plugin-image-exif-orientation-B7pvpLQQ.js → filepond-plugin-image-exif-orientation-QreJIoqS.js} +1 -1
  7. package/dist/cjs/{filepond-plugin-image-preview-CrwqE_eH.js → filepond-plugin-image-preview-aiURUVDo.js} +1 -1
  8. package/dist/cjs/{functions-BeVUNcRL.js → functions-qbO9xyMC.js} +1 -1
  9. package/dist/cjs/{index-HaF0YPfl.js → index-BtHm_lmK.js} +1 -1
  10. package/dist/cjs/{index-CvTXoznS.js → index-DR2nrv6V.js} +10 -10
  11. package/dist/cjs/loader.cjs.js +2 -2
  12. package/dist/cjs/salla-accordion-body_2.cjs.entry.js +1 -1
  13. package/dist/cjs/salla-accordion_6.cjs.entry.js +1 -1
  14. package/dist/cjs/{salla-add-product-button_4.cjs.entry.js → salla-add-product-button_5.cjs.entry.js} +130 -1
  15. package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
  16. package/dist/cjs/salla-alert_2.cjs.entry.js +1 -1
  17. package/dist/cjs/salla-app-install-alert.cjs.entry.js +1 -1
  18. package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
  19. package/dist/cjs/salla-badge.cjs.entry.js +1 -1
  20. package/dist/cjs/salla-booking-field_7.cjs.entry.js +10 -10
  21. package/dist/cjs/salla-bullet-delivery.cjs.entry.js +2 -2
  22. package/dist/cjs/salla-cart-coupons.cjs.entry.js +1 -1
  23. package/dist/cjs/salla-cart-item-offers_2.cjs.entry.js +1 -1
  24. package/dist/cjs/salla-comment-form_8.cjs.entry.js +1 -1
  25. package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
  26. package/dist/cjs/salla-contacts.cjs.entry.js +1 -1
  27. package/dist/cjs/salla-cookies-bar.cjs.entry.js +1 -1
  28. package/dist/cjs/salla-count-down.cjs.entry.js +1 -1
  29. package/dist/cjs/salla-custom-fields.cjs.entry.js +1 -1
  30. package/dist/cjs/salla-delivery-promise.cjs.entry.js +294 -157
  31. package/dist/cjs/salla-edit-order-button.cjs.entry.js +1 -1
  32. package/dist/cjs/salla-filters-widget.cjs.entry.js +1 -1
  33. package/dist/cjs/salla-filters.cjs.entry.js +1 -1
  34. package/dist/cjs/salla-fulfillment-methods.cjs.entry.js +1 -1
  35. package/dist/cjs/salla-gifting.cjs.entry.js +1 -1
  36. package/dist/cjs/salla-hook.cjs.entry.js +1 -1
  37. package/dist/cjs/salla-infinite-scroll.cjs.entry.js +1 -1
  38. package/dist/cjs/salla-installment.cjs.entry.js +1 -1
  39. package/dist/cjs/salla-list-tile.cjs.entry.js +1 -1
  40. package/dist/cjs/salla-localization-modal.cjs.entry.js +1 -1
  41. package/dist/cjs/salla-login-modal.cjs.entry.js +1 -1
  42. package/dist/cjs/salla-loyalty-banner.cjs.entry.js +2 -2
  43. package/dist/cjs/salla-loyalty-hero_2.cjs.entry.js +2 -2
  44. package/dist/cjs/salla-loyalty-panel.cjs.entry.js +3 -3
  45. package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
  46. package/dist/cjs/salla-loyalty-program.cjs.entry.js +3 -3
  47. package/dist/cjs/salla-loyalty-reward.cjs.entry.js +2 -2
  48. package/dist/cjs/salla-loyalty.cjs.entry.js +1 -1
  49. package/dist/cjs/salla-maintenance-alert.cjs.entry.js +1 -1
  50. package/dist/cjs/salla-map.cjs.entry.js +1 -1
  51. package/dist/cjs/salla-menu.cjs.entry.js +1 -1
  52. package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
  53. package/dist/cjs/salla-multiple-bundle-product-cart_2.cjs.entry.js +1 -1
  54. package/dist/cjs/salla-multiple-bundle-product-options-modal_2.cjs.entry.js +1 -1
  55. package/dist/cjs/salla-multiple-bundle-product.cjs.entry.js +1 -1
  56. package/dist/cjs/salla-notification-item.cjs.entry.js +1 -1
  57. package/dist/cjs/salla-notifications.cjs.entry.js +1 -1
  58. package/dist/cjs/salla-offer-modal.cjs.entry.js +1 -1
  59. package/dist/cjs/salla-offer.cjs.entry.js +1 -1
  60. package/dist/cjs/salla-order-details-multiple-bundle-product.cjs.entry.js +1 -1
  61. package/dist/cjs/salla-order-details-options.cjs.entry.js +1 -1
  62. package/dist/cjs/salla-order-details.cjs.entry.js +1 -1
  63. package/dist/cjs/salla-order-edit-item.cjs.entry.js +1 -1
  64. package/dist/cjs/salla-order-edit.cjs.entry.js +1 -1
  65. package/dist/cjs/salla-order-summary.cjs.entry.js +1 -1
  66. package/dist/cjs/salla-order-totals-card.cjs.entry.js +1 -1
  67. package/dist/cjs/salla-orders.cjs.entry.js +1 -1
  68. package/dist/cjs/salla-payments.cjs.entry.js +1 -1
  69. package/dist/cjs/salla-placeholder.cjs.entry.js +1 -1
  70. package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
  71. package/dist/cjs/salla-product-card_2.cjs.entry.js +1 -1
  72. package/dist/cjs/salla-product-size-guide.cjs.entry.js +1 -1
  73. package/dist/cjs/salla-products-list.cjs.entry.js +1 -1
  74. package/dist/cjs/salla-progress-bar.cjs.entry.js +1 -1
  75. package/dist/cjs/salla-quick-order.cjs.entry.js +1 -1
  76. package/dist/cjs/salla-rating-modal.cjs.entry.js +1 -1
  77. package/dist/cjs/salla-reward-action_4.cjs.entry.js +3 -3
  78. package/dist/cjs/salla-scopes.cjs.entry.js +1 -1
  79. package/dist/cjs/salla-search.cjs.entry.js +1 -1
  80. package/dist/cjs/salla-skeleton.cjs.entry.js +1 -1
  81. package/dist/cjs/salla-slider.cjs.entry.js +1 -1
  82. package/dist/cjs/salla-social-share.cjs.entry.js +1 -1
  83. package/dist/cjs/salla-social.cjs.entry.js +1 -1
  84. package/dist/cjs/salla-tab-content_3.cjs.entry.js +1 -1
  85. package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
  86. package/dist/cjs/salla-tooltip.cjs.entry.js +1 -1
  87. package/dist/cjs/salla-trust-badges.cjs.entry.js +1 -1
  88. package/dist/cjs/salla-user-menu.cjs.entry.js +1 -1
  89. package/dist/cjs/salla-user-profile.cjs.entry.js +1 -1
  90. package/dist/cjs/salla-user-settings.cjs.entry.js +1 -1
  91. package/dist/cjs/salla-verify.cjs.entry.js +1 -1
  92. package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
  93. package/dist/cjs/{tracked-promise--fbeE9eN.js → tracked-promise-Dlrrx6bS.js} +1 -1
  94. package/dist/cjs/twilight.cjs.js +2 -2
  95. package/dist/cjs/{vanilla-picker-BFVuX93Y.js → vanilla-picker-BgvVWFWW.js} +1 -1
  96. package/dist/collection/collection-manifest.json +2 -0
  97. package/dist/collection/components/salla-bought-together/interfaces.js +1 -0
  98. package/dist/collection/components/salla-bought-together/salla-bought-together.css +18 -0
  99. package/dist/collection/components/salla-bought-together/salla-bought-together.js +174 -0
  100. package/dist/collection/components/salla-bullet-delivery/salla-bullet-delivery.js +1 -1
  101. package/dist/collection/components/salla-delivery-promise/delivery-promise-api.js +40 -0
  102. package/dist/collection/components/salla-delivery-promise/delivery-promise-city-filter.js +11 -0
  103. package/dist/collection/components/salla-delivery-promise/delivery-promise-intent.js +55 -0
  104. package/dist/collection/components/salla-delivery-promise/delivery-promise-labels.js +39 -0
  105. package/dist/collection/components/salla-delivery-promise/salla-delivery-promise.js +175 -167
  106. package/dist/components/index.js +2 -2
  107. package/dist/components/salla-bought-together.d.ts +11 -0
  108. package/dist/components/salla-bought-together.js +174 -0
  109. package/dist/components/salla-bullet-delivery.js +1 -1
  110. package/dist/components/salla-delivery-promise.js +324 -165
  111. package/dist/esm/{filepond-DPbkat7B.js → filepond-BdAJ1Q3U.js} +1 -1
  112. package/dist/esm/{filepond-plugin-file-poster-DgPt1KP-.js → filepond-plugin-file-poster-_P46glp3.js} +1 -1
  113. package/dist/esm/{filepond-plugin-file-validate-size-BV_54qp5.js → filepond-plugin-file-validate-size-Cs7iDcpm.js} +1 -1
  114. package/dist/esm/{filepond-plugin-file-validate-type-C_0YZnJv.js → filepond-plugin-file-validate-type-BokfkNG5.js} +1 -1
  115. package/dist/esm/{filepond-plugin-image-edit-BWL4OVdy.js → filepond-plugin-image-edit-DqujritR.js} +1 -1
  116. package/dist/esm/{filepond-plugin-image-exif-orientation-CteQgPe5.js → filepond-plugin-image-exif-orientation-CTqsgDyW.js} +1 -1
  117. package/dist/esm/{filepond-plugin-image-preview-CCPL4ZAz.js → filepond-plugin-image-preview-zoBFIa44.js} +1 -1
  118. package/dist/esm/{functions-BPhNXHAK.js → functions-CEdm6lBq.js} +1 -1
  119. package/dist/esm/{index-xzl1T3nS.js → index-DXkuZzsm.js} +1 -1
  120. package/dist/esm/{index--aLzvRrO.js → index-eYsXdqjv.js} +10 -10
  121. package/dist/esm/loader.js +3 -3
  122. package/dist/esm/salla-accordion-body_2.entry.js +1 -1
  123. package/dist/esm/salla-accordion_6.entry.js +1 -1
  124. package/dist/esm/{salla-add-product-button_4.entry.js → salla-add-product-button_5.entry.js} +130 -2
  125. package/dist/esm/salla-advertisement.entry.js +1 -1
  126. package/dist/esm/salla-alert_2.entry.js +1 -1
  127. package/dist/esm/salla-app-install-alert.entry.js +1 -1
  128. package/dist/esm/salla-apps-icons.entry.js +1 -1
  129. package/dist/esm/salla-badge.entry.js +1 -1
  130. package/dist/esm/salla-booking-field_7.entry.js +10 -10
  131. package/dist/esm/salla-bullet-delivery.entry.js +2 -2
  132. package/dist/esm/salla-cart-coupons.entry.js +1 -1
  133. package/dist/esm/salla-cart-item-offers_2.entry.js +1 -1
  134. package/dist/esm/salla-comment-form_8.entry.js +1 -1
  135. package/dist/esm/salla-conditional-offer.entry.js +1 -1
  136. package/dist/esm/salla-contacts.entry.js +1 -1
  137. package/dist/esm/salla-cookies-bar.entry.js +1 -1
  138. package/dist/esm/salla-count-down.entry.js +1 -1
  139. package/dist/esm/salla-custom-fields.entry.js +1 -1
  140. package/dist/esm/salla-delivery-promise.entry.js +294 -157
  141. package/dist/esm/salla-edit-order-button.entry.js +1 -1
  142. package/dist/esm/salla-filters-widget.entry.js +1 -1
  143. package/dist/esm/salla-filters.entry.js +1 -1
  144. package/dist/esm/salla-fulfillment-methods.entry.js +1 -1
  145. package/dist/esm/salla-gifting.entry.js +1 -1
  146. package/dist/esm/salla-hook.entry.js +1 -1
  147. package/dist/esm/salla-infinite-scroll.entry.js +1 -1
  148. package/dist/esm/salla-installment.entry.js +1 -1
  149. package/dist/esm/salla-list-tile.entry.js +1 -1
  150. package/dist/esm/salla-localization-modal.entry.js +1 -1
  151. package/dist/esm/salla-login-modal.entry.js +1 -1
  152. package/dist/esm/salla-loyalty-banner.entry.js +2 -2
  153. package/dist/esm/salla-loyalty-hero_2.entry.js +2 -2
  154. package/dist/esm/salla-loyalty-panel.entry.js +3 -3
  155. package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
  156. package/dist/esm/salla-loyalty-program.entry.js +3 -3
  157. package/dist/esm/salla-loyalty-reward.entry.js +2 -2
  158. package/dist/esm/salla-loyalty.entry.js +1 -1
  159. package/dist/esm/salla-maintenance-alert.entry.js +1 -1
  160. package/dist/esm/salla-map.entry.js +1 -1
  161. package/dist/esm/salla-menu.entry.js +1 -1
  162. package/dist/esm/salla-metadata.entry.js +1 -1
  163. package/dist/esm/salla-multiple-bundle-product-cart_2.entry.js +1 -1
  164. package/dist/esm/salla-multiple-bundle-product-options-modal_2.entry.js +1 -1
  165. package/dist/esm/salla-multiple-bundle-product.entry.js +1 -1
  166. package/dist/esm/salla-notification-item.entry.js +1 -1
  167. package/dist/esm/salla-notifications.entry.js +1 -1
  168. package/dist/esm/salla-offer-modal.entry.js +1 -1
  169. package/dist/esm/salla-offer.entry.js +1 -1
  170. package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +1 -1
  171. package/dist/esm/salla-order-details-options.entry.js +1 -1
  172. package/dist/esm/salla-order-details.entry.js +1 -1
  173. package/dist/esm/salla-order-edit-item.entry.js +1 -1
  174. package/dist/esm/salla-order-edit.entry.js +1 -1
  175. package/dist/esm/salla-order-summary.entry.js +1 -1
  176. package/dist/esm/salla-order-totals-card.entry.js +1 -1
  177. package/dist/esm/salla-orders.entry.js +1 -1
  178. package/dist/esm/salla-payments.entry.js +1 -1
  179. package/dist/esm/salla-placeholder.entry.js +1 -1
  180. package/dist/esm/salla-price-range.entry.js +1 -1
  181. package/dist/esm/salla-product-card_2.entry.js +1 -1
  182. package/dist/esm/salla-product-size-guide.entry.js +1 -1
  183. package/dist/esm/salla-products-list.entry.js +1 -1
  184. package/dist/esm/salla-progress-bar.entry.js +1 -1
  185. package/dist/esm/salla-quick-order.entry.js +1 -1
  186. package/dist/esm/salla-rating-modal.entry.js +1 -1
  187. package/dist/esm/salla-reward-action_4.entry.js +3 -3
  188. package/dist/esm/salla-scopes.entry.js +1 -1
  189. package/dist/esm/salla-search.entry.js +1 -1
  190. package/dist/esm/salla-skeleton.entry.js +1 -1
  191. package/dist/esm/salla-slider.entry.js +1 -1
  192. package/dist/esm/salla-social-share.entry.js +1 -1
  193. package/dist/esm/salla-social.entry.js +1 -1
  194. package/dist/esm/salla-tab-content_3.entry.js +1 -1
  195. package/dist/esm/salla-tiered-offer.entry.js +1 -1
  196. package/dist/esm/salla-tooltip.entry.js +1 -1
  197. package/dist/esm/salla-trust-badges.entry.js +1 -1
  198. package/dist/esm/salla-user-menu.entry.js +1 -1
  199. package/dist/esm/salla-user-profile.entry.js +1 -1
  200. package/dist/esm/salla-user-settings.entry.js +1 -1
  201. package/dist/esm/salla-verify.entry.js +1 -1
  202. package/dist/esm/salla-wallet.entry.js +1 -1
  203. package/dist/esm/{tracked-promise-DZU9tZyv.js → tracked-promise-DC9Saija.js} +1 -1
  204. package/dist/esm/twilight.js +3 -3
  205. package/dist/esm/{vanilla-picker-B2fiZJce.js → vanilla-picker-DdyyxtyV.js} +1 -1
  206. package/dist/twilight/{p-ba732bc9.entry.js → p-040057c7.entry.js} +1 -1
  207. package/dist/twilight/{p-1e9aaede.entry.js → p-046ef0cf.entry.js} +1 -1
  208. package/dist/twilight/{p-7d1b25c8.entry.js → p-04a3bd3a.entry.js} +1 -1
  209. package/dist/twilight/{p-5ed72df9.entry.js → p-083bfceb.entry.js} +1 -1
  210. package/dist/twilight/{p-f302049c.entry.js → p-0b6cfdc6.entry.js} +1 -1
  211. package/dist/twilight/{p-a9042935.entry.js → p-0c773a98.entry.js} +1 -1
  212. package/dist/twilight/{p-516b313b.entry.js → p-0fee8df2.entry.js} +1 -1
  213. package/dist/twilight/p-12e78aef.entry.js +4 -0
  214. package/dist/twilight/{p-b0381a65.entry.js → p-18046a80.entry.js} +1 -1
  215. package/dist/twilight/{p-53a365b6.entry.js → p-18428cad.entry.js} +1 -1
  216. package/dist/twilight/{p-a341cc6c.entry.js → p-18e4e822.entry.js} +1 -1
  217. package/dist/twilight/{p-1b74cdc9.entry.js → p-1c2c212f.entry.js} +1 -1
  218. package/dist/twilight/{p-7cb5b79e.entry.js → p-1d9e9e5e.entry.js} +1 -1
  219. package/dist/twilight/{p-5b731980.entry.js → p-1f18bb8c.entry.js} +1 -1
  220. package/dist/twilight/{p-ce24f47a.entry.js → p-24121404.entry.js} +1 -1
  221. package/dist/twilight/{p-3306a0e3.entry.js → p-28a276b7.entry.js} +1 -1
  222. package/dist/twilight/{p-b1a991a4.entry.js → p-2beb780e.entry.js} +1 -1
  223. package/dist/twilight/{p-74ca5db0.entry.js → p-2d29eae4.entry.js} +1 -1
  224. package/dist/twilight/{p-14430749.entry.js → p-2ea91f4d.entry.js} +1 -1
  225. package/dist/twilight/{p-ef51ee9c.entry.js → p-371ea2ac.entry.js} +1 -1
  226. package/dist/twilight/{p-a1551640.entry.js → p-38df842f.entry.js} +1 -1
  227. package/dist/twilight/{p-dcdaa403.entry.js → p-3a0482aa.entry.js} +1 -1
  228. package/dist/twilight/{p-6fbdfb32.entry.js → p-3dd609ff.entry.js} +1 -1
  229. package/dist/twilight/{p-efb25d45.entry.js → p-473e829b.entry.js} +1 -1
  230. package/dist/twilight/{p-63ca4a50.entry.js → p-4c7e5ca7.entry.js} +1 -1
  231. package/dist/twilight/p-4rGFyB1b.js +4 -0
  232. package/dist/twilight/{p-595ff7ae.entry.js → p-543482d0.entry.js} +1 -1
  233. package/dist/twilight/{p-c709eecf.entry.js → p-569db60a.entry.js} +1 -1
  234. package/dist/twilight/{p-6fcf797a.entry.js → p-63b091c3.entry.js} +1 -1
  235. package/dist/twilight/{p-0b3ab0c0.entry.js → p-67b3a063.entry.js} +1 -1
  236. package/dist/twilight/{p-33ed3cf6.entry.js → p-6a50e4ab.entry.js} +1 -1
  237. package/dist/twilight/{p-c4ddea92.entry.js → p-6ffe96cf.entry.js} +1 -1
  238. package/dist/twilight/{p-2864a914.entry.js → p-70e26072.entry.js} +1 -1
  239. package/dist/twilight/{p-c1e50801.entry.js → p-78b27b6f.entry.js} +1 -1
  240. package/dist/twilight/{p-2be849c0.entry.js → p-809d8765.entry.js} +1 -1
  241. package/dist/twilight/{p-4705328f.entry.js → p-82d315dc.entry.js} +1 -1
  242. package/dist/twilight/{p-ae739a30.entry.js → p-82fc9f8a.entry.js} +1 -1
  243. package/dist/twilight/{p-df3e785e.entry.js → p-86494434.entry.js} +1 -1
  244. package/dist/twilight/{p-62f5b9d2.entry.js → p-880974c0.entry.js} +1 -1
  245. package/dist/twilight/{p-cdb85c38.entry.js → p-914ef875.entry.js} +1 -1
  246. package/dist/twilight/{p-4cf14603.entry.js → p-92c3525a.entry.js} +1 -1
  247. package/dist/twilight/{p-a783f44e.entry.js → p-92ee979a.entry.js} +1 -1
  248. package/dist/twilight/{p-b9a3cd97.entry.js → p-98dfc58c.entry.js} +1 -1
  249. package/dist/twilight/{p-ae5a1e83.entry.js → p-9da33e90.entry.js} +1 -1
  250. package/dist/twilight/p-9f51245d.entry.js +4 -0
  251. package/dist/twilight/{p-9114ec15.entry.js → p-9fea03ff.entry.js} +1 -1
  252. package/dist/twilight/{p-gfF4Tkzf.js → p-B-gehnpX.js} +1 -1
  253. package/dist/twilight/{p-W0o3F-X6.js → p-BrL7ZFF-.js} +1 -1
  254. package/dist/twilight/{p-Dqn5ubGV.js → p-Bt5MNLrr.js} +1 -1
  255. package/dist/twilight/{p-CKKsiY6U.js → p-C4iKSe6r.js} +1 -1
  256. package/dist/twilight/{p-vMhKvihG.js → p-CZP8nF-D.js} +1 -1
  257. package/dist/twilight/{p-eA49HkVR.js → p-CdKOsdhF.js} +1 -1
  258. package/dist/twilight/{p-D8id_g5X.js → p-CdQPD_4N.js} +1 -1
  259. package/dist/twilight/{p-vdGuE3O6.js → p-CkMgy4QX.js} +1 -1
  260. package/dist/twilight/{p-MFOr6dmh.js → p-DgUXy-oM.js} +1 -1
  261. package/dist/twilight/{p-KGKLTJUI.js → p-VP7525fx.js} +1 -1
  262. package/dist/twilight/{p-638ff172.entry.js → p-a0792c90.entry.js} +1 -1
  263. package/dist/twilight/{p-90670ab5.entry.js → p-a74e2625.entry.js} +1 -1
  264. package/dist/twilight/{p-35084537.entry.js → p-a97da8bc.entry.js} +1 -1
  265. package/dist/twilight/p-aced00e2.entry.js +4 -0
  266. package/dist/twilight/{p-3c9c9316.entry.js → p-b04f3b37.entry.js} +1 -1
  267. package/dist/twilight/{p-5ea75d8d.entry.js → p-b258ef5c.entry.js} +1 -1
  268. package/dist/twilight/{p-984ab6ec.entry.js → p-ba81b8d6.entry.js} +1 -1
  269. package/dist/twilight/{p-6585c82b.entry.js → p-bab9b1ad.entry.js} +1 -1
  270. package/dist/twilight/{p-3953f0a0.entry.js → p-c00c26f4.entry.js} +1 -1
  271. package/dist/twilight/{p-81b43cf3.entry.js → p-c0ea9ff2.entry.js} +1 -1
  272. package/dist/twilight/{p-cc5aba4d.entry.js → p-c11f0af9.entry.js} +1 -1
  273. package/dist/twilight/{p-3646f57c.entry.js → p-c38311a2.entry.js} +1 -1
  274. package/dist/twilight/{p-7f5af809.entry.js → p-c6a56a0c.entry.js} +1 -1
  275. package/dist/twilight/{p-681c8fc0.entry.js → p-c8821c21.entry.js} +1 -1
  276. package/dist/twilight/{p-675f6c3f.entry.js → p-c8b8ea5c.entry.js} +1 -1
  277. package/dist/twilight/{p-3a643e3f.entry.js → p-c8f6bc81.entry.js} +1 -1
  278. package/dist/twilight/{p-e1054044.entry.js → p-cb5fbe10.entry.js} +1 -1
  279. package/dist/twilight/{p-c6bf0f70.entry.js → p-cf4c9420.entry.js} +1 -1
  280. package/dist/twilight/{p-e6fbc27e.entry.js → p-d400841e.entry.js} +1 -1
  281. package/dist/twilight/p-d49fd79d.entry.js +4 -0
  282. package/dist/twilight/{p-4828c47f.entry.js → p-d6a5df0d.entry.js} +1 -1
  283. package/dist/twilight/{p-f4d19537.entry.js → p-d6a86efa.entry.js} +1 -1
  284. package/dist/twilight/{p-02cb524a.entry.js → p-dbe6cc9c.entry.js} +1 -1
  285. package/dist/twilight/{p-30a0554b.entry.js → p-e2cec9f6.entry.js} +1 -1
  286. package/dist/twilight/{p-63250e42.entry.js → p-e5e1574f.entry.js} +1 -1
  287. package/dist/twilight/{p-6213a6b6.entry.js → p-e89e8a20.entry.js} +1 -1
  288. package/dist/twilight/{p--aLzvRrO.js → p-eYsXdqjv.js} +1 -1
  289. package/dist/twilight/{p-2ca1a6ef.entry.js → p-eadaf058.entry.js} +1 -1
  290. package/dist/twilight/{p-331bc274.entry.js → p-eae4b2c9.entry.js} +1 -1
  291. package/dist/twilight/p-ed6e8053.entry.js +4 -0
  292. package/dist/twilight/{p-6632849d.entry.js → p-f267b033.entry.js} +1 -1
  293. package/dist/twilight/{p-97d3ed79.entry.js → p-f3105e54.entry.js} +1 -1
  294. package/dist/twilight/{p-6773040a.entry.js → p-f3d76113.entry.js} +1 -1
  295. package/dist/twilight/{p-9bd8770c.entry.js → p-f91399b4.entry.js} +1 -1
  296. package/dist/twilight/{p-aa4d7e56.entry.js → p-faae4443.entry.js} +1 -1
  297. package/dist/twilight/{p-d3202fae.entry.js → p-fea8186b.entry.js} +1 -1
  298. package/dist/twilight/{p-614959f2.entry.js → p-ff972c8b.entry.js} +1 -1
  299. package/dist/twilight/twilight.esm.js +1 -1
  300. package/dist/types/components/salla-bought-together/interfaces.d.ts +15 -0
  301. package/dist/types/components/salla-bought-together/salla-bought-together.d.ts +23 -0
  302. package/dist/types/components/salla-delivery-promise/delivery-promise-api.d.ts +8 -0
  303. package/dist/types/components/salla-delivery-promise/delivery-promise-city-filter.d.ts +3 -0
  304. package/dist/types/components/salla-delivery-promise/delivery-promise-intent.d.ts +18 -0
  305. package/dist/types/components/salla-delivery-promise/delivery-promise-labels.d.ts +8 -0
  306. package/dist/types/components/salla-delivery-promise/interfaces.d.ts +16 -7
  307. package/dist/types/components/salla-delivery-promise/salla-delivery-promise.d.ts +31 -33
  308. package/dist/types/components.d.ts +23 -0
  309. package/package.json +5 -5
  310. package/dist/twilight/p-0598e48d.entry.js +0 -4
  311. package/dist/twilight/p-0d9e6f1b.entry.js +0 -4
  312. package/dist/twilight/p-264205d3.entry.js +0 -4
  313. package/dist/twilight/p-2e7c0235.entry.js +0 -4
  314. package/dist/twilight/p-CFQnlnSJ.js +0 -4
  315. package/dist/twilight/p-cace9063.entry.js +0 -4
@@ -0,0 +1,39 @@
1
+ /*!
2
+ * Crafted with ❤ by Salla
3
+ */
4
+ export const DEFAULT_LABELS = {
5
+ deliveryTo: 'توصيل إلى',
6
+ pickupFromBranch: 'الاستلام من فرع',
7
+ noResults: 'لا توجد نتائج',
8
+ selectCity: 'اختر المدينة',
9
+ changeCityTitle: 'تغيير المدينة',
10
+ changeCitySubtitle: '',
11
+ cityFieldLabel: 'المدينة',
12
+ modalSearchPlaceholder: 'ابحث عن مدينة',
13
+ confirmAddress: 'تأكيد العنوان',
14
+ errorDeliveryPromise: 'لا يتوفر وعد تسليم لهذه المدينة',
15
+ errorPickupPromise: 'لا يتوفر وعد تسليم لهذا الفرع',
16
+ };
17
+ export function loadLabels() {
18
+ return {
19
+ deliveryTo: salla.lang.getWithDefault('pages.products.promise_deliver_to', DEFAULT_LABELS.deliveryTo),
20
+ pickupFromBranch: salla.lang.getWithDefault('pages.products.promise_pickup_from_branch', DEFAULT_LABELS.pickupFromBranch),
21
+ noResults: salla.lang.getWithDefault('common.elements.no_options', DEFAULT_LABELS.noResults),
22
+ selectCity: salla.lang.getWithDefault('common.elements.select_city', DEFAULT_LABELS.selectCity),
23
+ changeCityTitle: salla.lang.getWithDefault('pages.products.promise_change_city_title', DEFAULT_LABELS.changeCityTitle),
24
+ changeCitySubtitle: salla.lang.getWithDefault('pages.products.promise_change_city_subtitle', 'قد تتغيّر مدة التوصيل حسب المدينة.'),
25
+ cityFieldLabel: salla.lang.getWithDefault('pages.products.promise_city_field', DEFAULT_LABELS.cityFieldLabel),
26
+ modalSearchPlaceholder: salla.lang.getWithDefault('pages.products.promise_search_city', DEFAULT_LABELS.modalSearchPlaceholder),
27
+ confirmAddress: salla.lang.getWithDefault('pages.checkout.confirm_address', DEFAULT_LABELS.confirmAddress),
28
+ errorDeliveryPromise: salla.lang.getWithDefault('pages.products.promise_delivery_not_available', DEFAULT_LABELS.errorDeliveryPromise),
29
+ errorPickupPromise: salla.lang.getWithDefault('pages.products.promise_pickup_not_available', DEFAULT_LABELS.errorPickupPromise),
30
+ };
31
+ }
32
+ /** Localized city display name (English when available and user language is not Arabic). */
33
+ export function getCityDisplayName(city) {
34
+ const lang = salla.config.get('user.language_code');
35
+ if (lang && lang !== 'ar' && city.name_en?.trim()) {
36
+ return city.name_en.trim();
37
+ }
38
+ return city.name;
39
+ }
@@ -2,6 +2,10 @@
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
4
  import { h, Host } from "@stencil/core";
5
+ import { fetchCities, fetchDeliveryMessage } from "./delivery-promise-api";
6
+ import { filterCitiesForModal } from "./delivery-promise-city-filter";
7
+ import { buildBulletOpenPayload, resolveIntent } from "./delivery-promise-intent";
8
+ import { DEFAULT_LABELS, getCityDisplayName, loadLabels } from "./delivery-promise-labels";
5
9
  /**
6
10
  * @name SallaDeliveryPromise
7
11
  * @description Displays delivery promise message (from BE) with city selection
@@ -9,106 +13,127 @@ import { h, Host } from "@stencil/core";
9
13
  */
10
14
  export class SallaDeliveryPromise {
11
15
  constructor() {
12
- this.cities = [];
13
- this.filteredCities = [];
14
- this.selectedCity = null;
16
+ // ── Feature flags & config ────────────────────────────────────────────
17
+ this.isDeliveryPromiseEnabled = false;
18
+ this.isLoginCycleEnabled = false;
19
+ this.canRender = false;
20
+ // ── Shared display state ──────────────────────────────────────────────
21
+ this.labels = DEFAULT_LABELS;
22
+ this.selectedLabel = null;
15
23
  this.deliveryMessage = null;
16
- this.isLoadingCities = false;
17
- this.isLoadingPromises = false;
18
- this.isDropdownOpen = false;
19
- this.searchQuery = '';
20
24
  this.hasError = false;
21
25
  this.errorMessage = '';
22
- /** i18n labels for city selector only; message comes from BE */
23
- this.labels = {
24
- deliveryTo: 'توصيل إلى',
25
- pickupFromBranch: 'الاستلام من فرع',
26
- searchPlaceholder: 'بحث...',
27
- noResults: 'لا توجد نتائج',
28
- selectCity: 'اختر المدينة',
26
+ this.isLoadingPromises = false;
27
+ // ── Login-cycle state (bullet delivery integration) ───────────────────
28
+ this.selectedCityLoginCycle = null;
29
+ this.selectedBranchLoginCycle = null;
30
+ // ── Standard flow state (city list) ───────────────────────────────────
31
+ this.cities = [];
32
+ this.selectedCity = null;
33
+ this.isLoadingCities = false;
34
+ // ── City-change modal state (non–login-cycle) ─────────────────────────
35
+ this.modalSearchQuery = '';
36
+ this.cityPendingSelection = null;
37
+ this.isCityPopoverOpen = false;
38
+ // ═══════════════════════════════════════════════════════════════════════
39
+ // Login-cycle (bullet delivery) integration
40
+ // ═══════════════════════════════════════════════════════════════════════
41
+ this.onBulletDeliveryConfirmed = () => {
42
+ this.applyBulletIntent();
29
43
  };
30
- this.canRender = false;
31
- this.requiresShipping = false;
32
- /** Used only for API calls, not rendered — no need for @State */
33
- this.productId = undefined;
34
- this.onClickOutside = (e) => {
35
- if (this.host.contains(e.target)) {
36
- return; // click inside component (e.g. search input, city list) — don't close
37
- }
38
- this.isDropdownOpen = false;
39
- window.removeEventListener('click', this.onClickOutside);
44
+ this.handleModalSearchInput = (event) => {
45
+ this.modalSearchQuery = event.target.value;
46
+ this.isCityPopoverOpen = true;
40
47
  };
41
- }
42
- setLabels() {
43
- this.labels = {
44
- deliveryTo: salla.lang.getWithDefault('pages.products.promise_deliver_to', 'توصيل إلى'),
45
- pickupFromBranch: salla.lang.getWithDefault('pages.products.promise_pickup_from_branch', 'الاستلام من فرع'),
46
- searchPlaceholder: salla.lang.getWithDefault('blocks.header.search_placeholder', 'بحث...'),
47
- noResults: salla.lang.getWithDefault('common.elements.no_options', 'لا توجد نتائج'),
48
- selectCity: salla.lang.getWithDefault('common.elements.select_city', 'اختر المدينة'),
48
+ this.handleModalComboboxActivate = () => {
49
+ this.isCityPopoverOpen = true;
49
50
  };
50
- }
51
- logger(message, data) {
52
- if (localStorage.getItem('salla-delivery-promise-debug')) {
53
- if (data) {
54
- console.log(message, data);
51
+ // ═══════════════════════════════════════════════════════════════════════
52
+ // Header click (dispatches to correct flow)
53
+ // ═══════════════════════════════════════════════════════════════════════
54
+ this.handleHeaderClick = (e) => {
55
+ e.stopPropagation();
56
+ if (this.isLoginCycleEnabled) {
57
+ this.openBulletDeliveryModal();
55
58
  }
56
59
  else {
57
- console.log(message);
60
+ void this.openCityChangeModal();
58
61
  }
59
- }
62
+ };
60
63
  }
64
+ // ═══════════════════════════════════════════════════════════════════════
65
+ // Lifecycle
66
+ // ═══════════════════════════════════════════════════════════════════════
61
67
  async componentDidLoad() {
62
68
  await salla.onReady();
63
69
  await salla.lang.onLoaded();
64
- this.setLabels();
65
- this.requiresShipping = salla.url.is_page('product.single') &&
66
- salla.config.get('store.features', []).includes('delivery-promises');
67
- if (this.requiresShipping) {
68
- this.logger('requiresShipping', this.requiresShipping);
69
- this.productId = salla.config.get('page.id');
70
- this.logger('productId', this.productId);
70
+ this.labels = loadLabels();
71
+ this.isDeliveryPromiseEnabled = salla.config.get('store.features', []).includes('delivery-promises');
72
+ this.isLoginCycleEnabled = salla.config.get('store.features', []).includes('bullet-delivery-v2');
73
+ this.productId = salla.config.get('page.id');
74
+ if (!this.isDeliveryPromiseEnabled) {
75
+ this.canRender = false;
76
+ return;
77
+ }
78
+ if (this.isLoginCycleEnabled) {
79
+ this.applyBulletIntent();
80
+ this.canRender = true;
81
+ window.addEventListener('bulletDeliveryConfirmed', this.onBulletDeliveryConfirmed);
71
82
  }
72
83
  else {
73
- this.canRender = false;
74
- this.logger('not requiresShipping', {
75
- is_product_single: salla.url.is_page('product.single'),
76
- includesDeliveryPromises: salla.config.get('store.features', []).includes('delivery-promises')
77
- });
84
+ this.selectedLabel = `${this.labels.deliveryTo} ${this.labels.selectCity}`;
85
+ await this.loadCities();
86
+ }
87
+ }
88
+ disconnectedCallback() {
89
+ window.removeEventListener('bulletDeliveryConfirmed', this.onBulletDeliveryConfirmed);
90
+ }
91
+ applyBulletIntent() {
92
+ const resolved = resolveIntent();
93
+ if (!resolved) {
94
+ this.selectedLabel = `${this.labels.deliveryTo} ${this.labels.selectCity}`;
95
+ this.selectedCityLoginCycle = null;
96
+ this.selectedBranchLoginCycle = null;
97
+ this.deliveryMessage = null;
78
98
  return;
79
99
  }
80
- await this.fetchCities();
100
+ if (resolved.type === 'address') {
101
+ this.selectedCityLoginCycle = resolved.option;
102
+ this.selectedBranchLoginCycle = null;
103
+ this.selectedLabel = `${this.labels.deliveryTo} ${resolved.option.name || this.labels.selectCity}`;
104
+ void this.loadDeliveryMessage(resolved.option.id, 'city');
105
+ }
106
+ else {
107
+ this.selectedBranchLoginCycle = resolved.option;
108
+ this.selectedCityLoginCycle = null;
109
+ this.selectedLabel = `${this.labels.pickupFromBranch} ${resolved.option.name}`;
110
+ void this.loadDeliveryMessage(resolved.option.id, 'branch');
111
+ }
81
112
  }
82
- async fetchCities() {
83
- this.logger('start startfetchCities');
113
+ openBulletDeliveryModal() {
114
+ salla.event.emit('bullet-delivery::open', buildBulletOpenPayload());
115
+ }
116
+ // ═══════════════════════════════════════════════════════════════════════
117
+ // Standard flow (city list, no login cycle)
118
+ // ═══════════════════════════════════════════════════════════════════════
119
+ async loadCities() {
84
120
  this.isLoadingCities = true;
85
121
  this.hasError = false;
86
122
  try {
87
- const response = await salla.api.request(salla.url.api(`products/${this.productId}/delivery-promises/cities`));
88
- if (response.success && Array.isArray(response.data) && response.data.length > 0) {
89
- this.logger('fetchCities success', { cities: response.data });
90
- // Sort cities: explicit cities first (id !== -1), then "Rest of cities" (id === -1)
91
- this.cities = this.sortCities(response.data);
92
- this.filteredCities = [...this.cities];
93
- // First, check if API returns a selected city (is_selected: true)
94
- let cityToSelect = this.cities.find(c => c.is_selected);
95
- if (!cityToSelect) {
96
- this.logger('no selectedCity from API response');
97
- }
98
- else {
99
- this.logger('selectedCity', cityToSelect);
100
- this.selectedCity = cityToSelect;
101
- await this.fetchDeliveryMessage(cityToSelect.id);
102
- }
103
- this.canRender = true;
104
- }
105
- else {
106
- this.logger('no data returned from fetchCities', { response: response });
123
+ const { cities, preselected } = await fetchCities(this.productId);
124
+ if (cities.length === 0) {
107
125
  this.canRender = false;
126
+ return;
127
+ }
128
+ this.cities = cities;
129
+ if (preselected) {
130
+ this.selectedCity = preselected;
131
+ this.selectedLabel = `${this.labels.deliveryTo} ${getCityDisplayName(preselected)}`;
132
+ await this.loadDeliveryMessage(preselected.id, 'city');
108
133
  }
134
+ this.canRender = true;
109
135
  }
110
136
  catch (error) {
111
- this.logger('fetchCities error', { error: error.message });
112
137
  this.hasError = true;
113
138
  this.errorMessage = error.message || 'Failed to load cities';
114
139
  this.canRender = false;
@@ -117,130 +142,113 @@ export class SallaDeliveryPromise {
117
142
  this.isLoadingCities = false;
118
143
  }
119
144
  }
120
- async fetchDeliveryMessage(cityId) {
121
- this.logger('start fetchDeliveryMessage', { cityId });
145
+ // ═══════════════════════════════════════════════════════════════════════
146
+ // Delivery message (shared by both flows)
147
+ // ═══════════════════════════════════════════════════════════════════════
148
+ async loadDeliveryMessage(id, optionType) {
122
149
  this.isLoadingPromises = true;
123
150
  this.hasError = false;
124
151
  this.deliveryMessage = null;
125
152
  try {
126
- const response = await salla.api.withoutNotifier(() => salla.api.request(salla.url.api(`products/${this.productId}/delivery-promises?city_id=${cityId}`)));
127
- if (response.success && response.data?.message) {
128
- const message = response.data.message.trim();
129
- this.logger('fetchDeliveryMessage success', { message });
130
- this.deliveryMessage = message || null;
131
- }
132
- else {
133
- this.logger('deliveryMessage not valid', { response });
134
- }
153
+ this.deliveryMessage = await fetchDeliveryMessage(this.productId, id, optionType, this.isLoginCycleEnabled);
135
154
  }
136
155
  catch (error) {
137
- this.logger('fetchDeliveryMessage error', { error: error.message });
138
156
  this.hasError = true;
139
- this.errorMessage = error.message || 'Failed to load delivery message';
157
+ this.errorMessage = optionType === 'city' ? this.labels.errorDeliveryPromise : this.labels.errorPickupPromise;
140
158
  }
141
159
  finally {
142
160
  this.isLoadingPromises = false;
143
161
  }
144
162
  }
145
- toggleDropdown(e) {
146
- e?.stopPropagation();
147
- this.isDropdownOpen = !this.isDropdownOpen;
148
- if (this.isDropdownOpen) {
149
- window.addEventListener('click', this.onClickOutside);
150
- if (this.searchInputRef) {
151
- setTimeout(() => this.searchInputRef.focus(), 100);
152
- }
153
- }
154
- else {
155
- window.removeEventListener('click', this.onClickOutside);
156
- }
157
- }
158
- disconnectedCallback() {
159
- window.removeEventListener('click', this.onClickOutside);
160
- }
161
- /**
162
- * Sort cities: explicit cities first (id !== -1), then "Rest of cities" (id === -1) at the end
163
- */
164
- sortCities(cities) {
165
- return [...cities].sort((a, b) => {
166
- // "Rest of cities" (id === -1) should always be at the end
167
- if (a.id === -1)
168
- return 1;
169
- if (b.id === -1)
170
- return -1;
171
- return 0;
172
- });
173
- }
174
- handleSearch(event) {
175
- const query = event.target.value.toLowerCase();
176
- this.searchQuery = query;
177
- if (query.length > 0) {
178
- this.filteredCities = this.cities.filter(city => city.name.toLowerCase()?.includes(query) ||
179
- (city.name_en || '').toLowerCase()?.includes(query));
180
- }
181
- else {
182
- this.filteredCities = [...this.cities];
163
+ // ═══════════════════════════════════════════════════════════════════════
164
+ // City-change modal handlers (non–login-cycle)
165
+ // ═══════════════════════════════════════════════════════════════════════
166
+ async openCityChangeModal() {
167
+ if (!this.cityModalRef)
168
+ return;
169
+ this.cityPendingSelection = null;
170
+ this.modalSearchQuery = '';
171
+ this.isCityPopoverOpen = false;
172
+ await this.cityModalRef.setTitle(this.labels.changeCityTitle);
173
+ await this.cityModalRef.open();
174
+ }
175
+ handleModalSelectCity(city) {
176
+ this.cityPendingSelection = city;
177
+ this.modalSearchQuery = getCityDisplayName(city);
178
+ this.isCityPopoverOpen = false;
179
+ }
180
+ async handleConfirmCityModal() {
181
+ if (!this.cityPendingSelection) {
182
+ await this.cityModalRef?.close();
183
+ return;
183
184
  }
184
- }
185
- async selectCity(city) {
186
- this.logger('selectCity', { city: city });
185
+ const city = this.cityPendingSelection;
187
186
  this.selectedCity = city;
188
- this.isDropdownOpen = false;
189
- window.removeEventListener('click', this.onClickOutside);
190
- this.searchQuery = '';
191
- this.filteredCities = [...this.cities];
192
- await this.fetchDeliveryMessage(city.id);
193
- }
194
- renderDropdown() {
195
- return (h("div", { class: "s-delivery-promise-dropdown" }, h("div", { class: "s-delivery-promise-dropdown-search" }, h("i", { class: "sicon-search" }), h("input", { type: "text", placeholder: this.labels.searchPlaceholder, value: this.searchQuery, onInput: (e) => this.handleSearch(e), ref: el => this.searchInputRef = el })), h("div", { class: "s-delivery-promise-dropdown-list" }, this.filteredCities.length === 0 ? (h("div", { class: "s-delivery-promise-dropdown-empty" }, this.labels.noResults)) : (this.filteredCities.map(city => (h("div", { key: city.id, class: `s-delivery-promise-dropdown-item ${this.selectedCity?.id === city.id ? 'selected' : ''}`, onClick: () => this.selectCity(city) }, h("span", { class: "s-delivery-promise-city-name" }, city.name), this.selectedCity?.id === city.id && (h("i", { class: "sicon-check" })))))))));
196
- }
197
- /**
198
- * Skeleton shown during initial city fetch to avoid blank period and layout shift.
199
- * Matches the structure/size of the real content (header + message area).
200
- */
201
- renderInitialLoadingSkeleton() {
187
+ this.selectedLabel = `${this.labels.deliveryTo} ${getCityDisplayName(city)}`;
188
+ await this.loadDeliveryMessage(city.id, 'city');
189
+ await this.cityModalRef?.close();
190
+ }
191
+ // ═══════════════════════════════════════════════════════════════════════
192
+ // Render helpers
193
+ // ═══════════════════════════════════════════════════════════════════════
194
+ renderLoadingSkeleton() {
202
195
  return (h(Host, { class: "s-delivery-promise-wrapper s-delivery-promise-skeleton" }, h("div", { class: "s-delivery-promise-container" }, h("div", { class: "s-delivery-promise-header s-delivery-promise-header-skeleton" }, h("div", { class: "s-delivery-promise-location" }, h("salla-skeleton", { height: "14px", width: "180px" })), h("salla-skeleton", { height: "18px", width: "18px" })), h("div", { class: "s-delivery-promise-loading" }, h("salla-skeleton", { height: "20px", width: "80%" })))));
203
196
  }
204
197
  renderDeliveryMessage() {
205
198
  if (this.isLoadingPromises) {
206
199
  return (h("div", { class: "s-delivery-promise-loading" }, h("salla-skeleton", { height: "20px", width: "80%" })));
207
200
  }
208
- if (!this.deliveryMessage) {
201
+ if (!this.deliveryMessage)
209
202
  return null;
210
- }
211
- return (h("div", { class: "s-delivery-promise-message" }, this.deliveryMessage));
203
+ return h("div", { class: "s-delivery-promise-message" }, this.deliveryMessage);
204
+ }
205
+ renderCityModalBody() {
206
+ const filtered = filterCitiesForModal(this.cities, this.modalSearchQuery);
207
+ return (h("div", { class: "s-delivery-promise-modal-body" }, h("label", { class: "s-delivery-promise-modal-field-label", htmlFor: "s-delivery-promise-modal-search" }, this.labels.cityFieldLabel, h("span", { class: "s-delivery-promise-required", "aria-hidden": "true" }, " *")), h("div", { class: "s-delivery-promise-modal-combobox" }, h("div", { class: "s-delivery-promise-modal-search", onClick: this.handleModalComboboxActivate }, h("i", { class: "sicon-search", "aria-hidden": "true" }), h("input", { id: "s-delivery-promise-modal-search", type: "text", class: "form-input", placeholder: this.labels.modalSearchPlaceholder, value: this.modalSearchQuery, onInput: this.handleModalSearchInput, autocomplete: "off", "aria-autocomplete": "list", "aria-expanded": this.isCityPopoverOpen ? 'true' : 'false', "aria-controls": "s-delivery-promise-modal-listbox" })), h("div", { id: "s-delivery-promise-modal-listbox", class: "s-delivery-promise-modal-popover", role: "listbox", hidden: !this.isCityPopoverOpen }, h("div", { class: "s-delivery-promise-modal-list s-scrollbar" }, filtered.length === 0 ? (h("div", { class: "s-delivery-promise-modal-empty" }, this.labels.noResults)) : (filtered.map(city => (h("button", { key: city.id, type: "button", role: "option", class: {
208
+ 's-delivery-promise-modal-item': true,
209
+ 's-delivery-promise-modal-item--selected': this.cityPendingSelection?.id === city.id,
210
+ }, "aria-selected": this.cityPendingSelection?.id === city.id ? 'true' : 'false', onClick: e => {
211
+ e.stopPropagation();
212
+ this.handleModalSelectCity(city);
213
+ } }, h("span", { class: "s-delivery-promise-modal-item-name" }, city.name), this.cityPendingSelection?.id === city.id ? h("i", { class: "sicon-check", "aria-hidden": "true" }) : null)))))))));
214
+ }
215
+ renderCityChangeModal() {
216
+ if (this.isLoginCycleEnabled)
217
+ return null;
218
+ return (h("salla-modal", { id: "s-delivery-promise-city-modal", ref: el => { this.cityModalRef = el; }, class: "s-delivery-promise-city-modal", isClosable: true, width: "md", "modal-title": this.labels.changeCityTitle, subTitle: this.labels.changeCitySubtitle }, this.renderCityModalBody(), h("salla-button", { slot: "footer", width: "wide", disabled: !this.cityPendingSelection, onClick: () => this.handleConfirmCityModal() }, !this.isLoadingPromises && this.labels.confirmAddress)));
212
219
  }
220
+ // ═══════════════════════════════════════════════════════════════════════
221
+ // Main render
222
+ // ═══════════════════════════════════════════════════════════════════════
213
223
  render() {
214
- // Not on product page or delivery-promises disabled — hide entirely
215
- if (!this.requiresShipping) {
224
+ if (!this.isDeliveryPromiseEnabled)
216
225
  return null;
217
- }
218
- // Initial city fetch: show skeleton to avoid blank period and layout shift
219
- if (this.isLoadingCities) {
220
- return this.renderInitialLoadingSkeleton();
221
- }
222
- // Fetch done but no cities / error — hide
223
- if (!this.canRender || this.cities.length === 0) {
226
+ if (this.isLoadingCities)
227
+ return this.renderLoadingSkeleton();
228
+ if (!this.canRender)
224
229
  return null;
225
- }
226
- return (h(Host, { class: "s-delivery-promise-wrapper" }, h("div", { class: "s-delivery-promise-container" }, h("div", { class: "s-delivery-promise-header", onClick: (e) => this.toggleDropdown(e) }, h("div", { class: "s-delivery-promise-location" }, h("span", { class: "s-delivery-promise-title" }, this.labels.deliveryTo, " ", this.selectedCity?.name || this.labels.selectCity)), h("i", { class: `sicon-keyboard_arrow_down s-delivery-promise-arrow ${this.isDropdownOpen ? 'open' : ''}` })), this.hasError && (h("div", { class: "s-delivery-promise-error" }, this.errorMessage)), this.isDropdownOpen && this.renderDropdown(), !this.hasError && this.renderDeliveryMessage())));
230
+ return (h(Host, { class: "s-delivery-promise-wrapper" }, h("div", { class: "s-delivery-promise-container" }, h("div", { class: "s-delivery-promise-header", onClick: this.handleHeaderClick }, h("div", { class: "s-delivery-promise-location" }, h("span", { class: "s-delivery-promise-title" }, this.selectedLabel)), h("i", { class: `sicon-keyboard_arrow_down s-delivery-promise-arrow` })), this.hasError && h("div", { class: "s-delivery-promise-error" }, this.errorMessage), !this.hasError && this.renderDeliveryMessage()), this.renderCityChangeModal()));
227
231
  }
228
232
  static get is() { return "salla-delivery-promise"; }
229
233
  static get states() {
230
234
  return {
231
- "cities": {},
232
- "filteredCities": {},
233
- "selectedCity": {},
235
+ "isDeliveryPromiseEnabled": {},
236
+ "isLoginCycleEnabled": {},
237
+ "canRender": {},
238
+ "labels": {},
239
+ "selectedLabel": {},
234
240
  "deliveryMessage": {},
235
- "isLoadingCities": {},
236
- "isLoadingPromises": {},
237
- "isDropdownOpen": {},
238
- "searchQuery": {},
239
241
  "hasError": {},
240
242
  "errorMessage": {},
241
- "labels": {},
242
- "canRender": {},
243
- "requiresShipping": {}
243
+ "isLoadingPromises": {},
244
+ "selectedCityLoginCycle": {},
245
+ "selectedBranchLoginCycle": {},
246
+ "cities": {},
247
+ "selectedCity": {},
248
+ "isLoadingCities": {},
249
+ "modalSearchQuery": {},
250
+ "cityPendingSelection": {},
251
+ "isCityPopoverOpen": {}
244
252
  };
245
253
  }
246
254
  static get elementRef() { return "host"; }