@salla.sa/twilight-components 2.14.377 → 2.14.378
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.
- package/dist/cjs/{filepond-Ds5SboGX.js → filepond-QBbfa1kb.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-poster-CiuOM8Vm.js → filepond-plugin-file-poster-D73Ejtx6.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-size-voKg0Usf.js → filepond-plugin-file-validate-size-B9s06RWW.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-type-DTD5zuEB.js → filepond-plugin-file-validate-type-D0RhYoZP.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-edit-9AlDikBO.js → filepond-plugin-image-edit-VMHg4Uws.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-exif-orientation-CwrQWSUK.js → filepond-plugin-image-exif-orientation-BRPczdYm.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-preview-Cn3dM1Mv.js → filepond-plugin-image-preview-CE0l5H-P.js} +1 -1
- package/dist/cjs/{index-DUzQ48hR.js → index-BSeuTimA.js} +1 -1
- package/dist/cjs/{index-BRmyjxh8.js → index-CfjtAMJT.js} +2 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/salla-accordion-body_3.cjs.entry.js +1 -1
- package/dist/cjs/salla-accordion_6.cjs.entry.js +1 -1
- package/dist/cjs/salla-add-product-button_4.cjs.entry.js +1 -1
- package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
- package/dist/cjs/salla-alert_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-app-install-alert.cjs.entry.js +1 -1
- package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
- package/dist/cjs/salla-booking-field_7.cjs.entry.js +10 -10
- package/dist/cjs/salla-bullet-delivery.cjs.entry.js +1 -1
- package/dist/cjs/salla-cart-item-offers_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-comment-form_8.cjs.entry.js +1 -1
- package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-contacts.cjs.entry.js +1 -1
- package/dist/cjs/salla-cookies-bar.cjs.entry.js +1 -1
- package/dist/cjs/salla-count-down_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-custom-fields.cjs.entry.js +1 -1
- package/dist/cjs/salla-filters-widget.cjs.entry.js +1 -1
- package/dist/cjs/salla-filters.cjs.entry.js +1 -1
- package/dist/cjs/salla-gifting.cjs.entry.js +1 -1
- package/dist/cjs/salla-hook.cjs.entry.js +1 -1
- package/dist/cjs/salla-infinite-scroll.cjs.entry.js +1 -1
- package/dist/cjs/salla-installment.cjs.entry.js +1 -1
- package/dist/cjs/salla-list-tile.cjs.entry.js +1 -1
- package/dist/cjs/salla-localization-modal.cjs.entry.js +1 -1
- package/dist/cjs/salla-login-modal.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-program.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty.cjs.entry.js +1 -1
- package/dist/cjs/salla-maintenance-alert.cjs.entry.js +1 -1
- package/dist/cjs/salla-menu.cjs.entry.js +1 -1
- package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
- package/dist/cjs/salla-multiple-bundle-product-cart_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-multiple-bundle-product-options-modal_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-multiple-bundle-product.cjs.entry.js +1 -1
- package/dist/cjs/salla-notification-item.cjs.entry.js +1 -1
- package/dist/cjs/salla-notifications.cjs.entry.js +1 -1
- package/dist/cjs/salla-offer-modal.cjs.entry.js +1 -1
- package/dist/cjs/salla-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-details-multiple-bundle-product.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-details-options.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-details.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-summary.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-totals-card.cjs.entry.js +1 -1
- package/dist/cjs/salla-orders.cjs.entry.js +1 -1
- package/dist/cjs/salla-payments.cjs.entry.js +1 -1
- package/dist/cjs/salla-placeholder.cjs.entry.js +1 -1
- package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
- package/dist/cjs/salla-product-size-guide.cjs.entry.js +1 -1
- package/dist/cjs/salla-products-list.cjs.entry.js +1 -1
- package/dist/cjs/salla-products-slider.cjs.entry.js +1 -1
- package/dist/cjs/salla-progress-bar.cjs.entry.js +1 -1
- package/dist/cjs/salla-quick-order.cjs.entry.js +1 -1
- package/dist/cjs/salla-rating-modal.cjs.entry.js +1 -1
- package/dist/cjs/salla-scopes.cjs.entry.js +1 -1
- package/dist/cjs/salla-search.cjs.entry.js +1 -1
- package/dist/cjs/salla-skeleton.cjs.entry.js +1 -1
- package/dist/cjs/salla-slider.cjs.entry.js +1 -1
- package/dist/cjs/salla-social-share.cjs.entry.js +1 -1
- package/dist/cjs/salla-social.cjs.entry.js +1 -1
- package/dist/cjs/salla-tab-content_3.cjs.entry.js +1 -1
- package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-tooltip.cjs.entry.js +1 -1
- package/dist/cjs/salla-trust-badges.cjs.entry.js +1 -1
- package/dist/cjs/salla-user-menu.cjs.entry.js +1 -1
- package/dist/cjs/salla-user-profile.cjs.entry.js +1 -1
- package/dist/cjs/salla-user-settings.cjs.entry.js +1 -1
- package/dist/cjs/salla-verify.cjs.entry.js +1 -1
- package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
- package/dist/cjs/twilight.cjs.js +1 -1
- package/dist/cjs/{vanilla-picker-B1kN8AK-.js → vanilla-picker-eNn0ke6P.js} +1 -1
- package/dist/components/index.js +2 -2
- package/dist/esm/{filepond-JF8hYPuh.js → filepond-buH_syGL.js} +1 -1
- package/dist/esm/{filepond-plugin-file-poster-CTJ4szfB.js → filepond-plugin-file-poster-CrCmJw6m.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-size-Jh8Ua3zk.js → filepond-plugin-file-validate-size-ZEbffSET.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-type-wRcUPSd7.js → filepond-plugin-file-validate-type-B8tKWOv8.js} +1 -1
- package/dist/esm/{filepond-plugin-image-edit-C9oJ-3Xm.js → filepond-plugin-image-edit-DQ1j_1Hs.js} +1 -1
- package/dist/esm/{filepond-plugin-image-exif-orientation-D2PoXzFu.js → filepond-plugin-image-exif-orientation-S36ZMTTn.js} +1 -1
- package/dist/esm/{filepond-plugin-image-preview-BzYVseWH.js → filepond-plugin-image-preview-Ck3h57QG.js} +1 -1
- package/dist/esm/{index-BydBx2Hz.js → index-CLfrQ6bI.js} +2 -2
- package/dist/esm/{index-BbsvNFsp.js → index-DoMCP0As.js} +1 -1
- package/dist/esm/loader.js +2 -2
- package/dist/esm/salla-accordion-body_3.entry.js +1 -1
- package/dist/esm/salla-accordion_6.entry.js +1 -1
- package/dist/esm/salla-add-product-button_4.entry.js +1 -1
- package/dist/esm/salla-advertisement.entry.js +1 -1
- package/dist/esm/salla-alert_2.entry.js +1 -1
- package/dist/esm/salla-app-install-alert.entry.js +1 -1
- package/dist/esm/salla-apps-icons.entry.js +1 -1
- package/dist/esm/salla-booking-field_7.entry.js +10 -10
- package/dist/esm/salla-bullet-delivery.entry.js +1 -1
- package/dist/esm/salla-cart-item-offers_2.entry.js +1 -1
- package/dist/esm/salla-comment-form_8.entry.js +1 -1
- package/dist/esm/salla-conditional-offer.entry.js +1 -1
- package/dist/esm/salla-contacts.entry.js +1 -1
- package/dist/esm/salla-cookies-bar.entry.js +1 -1
- package/dist/esm/salla-count-down_2.entry.js +1 -1
- package/dist/esm/salla-custom-fields.entry.js +1 -1
- package/dist/esm/salla-filters-widget.entry.js +1 -1
- package/dist/esm/salla-filters.entry.js +1 -1
- package/dist/esm/salla-gifting.entry.js +1 -1
- package/dist/esm/salla-hook.entry.js +1 -1
- package/dist/esm/salla-infinite-scroll.entry.js +1 -1
- package/dist/esm/salla-installment.entry.js +1 -1
- package/dist/esm/salla-list-tile.entry.js +1 -1
- package/dist/esm/salla-localization-modal.entry.js +1 -1
- package/dist/esm/salla-login-modal.entry.js +1 -1
- package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
- package/dist/esm/salla-loyalty-program.entry.js +1 -1
- package/dist/esm/salla-loyalty.entry.js +1 -1
- package/dist/esm/salla-maintenance-alert.entry.js +1 -1
- package/dist/esm/salla-menu.entry.js +1 -1
- package/dist/esm/salla-metadata.entry.js +1 -1
- package/dist/esm/salla-multiple-bundle-product-cart_2.entry.js +1 -1
- package/dist/esm/salla-multiple-bundle-product-options-modal_2.entry.js +1 -1
- package/dist/esm/salla-multiple-bundle-product.entry.js +1 -1
- package/dist/esm/salla-notification-item.entry.js +1 -1
- package/dist/esm/salla-notifications.entry.js +1 -1
- package/dist/esm/salla-offer-modal.entry.js +1 -1
- package/dist/esm/salla-offer.entry.js +1 -1
- package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +1 -1
- package/dist/esm/salla-order-details-options.entry.js +1 -1
- package/dist/esm/salla-order-details.entry.js +1 -1
- package/dist/esm/salla-order-summary.entry.js +1 -1
- package/dist/esm/salla-order-totals-card.entry.js +1 -1
- package/dist/esm/salla-orders.entry.js +1 -1
- package/dist/esm/salla-payments.entry.js +1 -1
- package/dist/esm/salla-placeholder.entry.js +1 -1
- package/dist/esm/salla-price-range.entry.js +1 -1
- package/dist/esm/salla-product-size-guide.entry.js +1 -1
- package/dist/esm/salla-products-list.entry.js +1 -1
- package/dist/esm/salla-products-slider.entry.js +1 -1
- package/dist/esm/salla-progress-bar.entry.js +1 -1
- package/dist/esm/salla-quick-order.entry.js +1 -1
- package/dist/esm/salla-rating-modal.entry.js +1 -1
- package/dist/esm/salla-scopes.entry.js +1 -1
- package/dist/esm/salla-search.entry.js +1 -1
- package/dist/esm/salla-skeleton.entry.js +1 -1
- package/dist/esm/salla-slider.entry.js +1 -1
- package/dist/esm/salla-social-share.entry.js +1 -1
- package/dist/esm/salla-social.entry.js +1 -1
- package/dist/esm/salla-tab-content_3.entry.js +1 -1
- package/dist/esm/salla-tiered-offer.entry.js +1 -1
- package/dist/esm/salla-tooltip.entry.js +1 -1
- package/dist/esm/salla-trust-badges.entry.js +1 -1
- package/dist/esm/salla-user-menu.entry.js +1 -1
- package/dist/esm/salla-user-profile.entry.js +1 -1
- package/dist/esm/salla-user-settings.entry.js +1 -1
- package/dist/esm/salla-verify.entry.js +1 -1
- package/dist/esm/salla-wallet.entry.js +1 -1
- package/dist/esm/twilight.js +2 -2
- package/dist/esm/{vanilla-picker-B_HpR2sR.js → vanilla-picker-C-jd9K2P.js} +1 -1
- package/dist/twilight/{p-269b7ccb.entry.js → p-0197571f.entry.js} +1 -1
- package/dist/twilight/{p-d9744d75.entry.js → p-0260619d.entry.js} +1 -1
- package/dist/twilight/{p-f5aabe58.entry.js → p-03f8ad9e.entry.js} +1 -1
- package/dist/twilight/{p-c9f697b2.entry.js → p-051e3dda.entry.js} +1 -1
- package/dist/twilight/{p-f485d95f.entry.js → p-053b71e6.entry.js} +1 -1
- package/dist/twilight/{p-eac472ee.entry.js → p-08073b13.entry.js} +1 -1
- package/dist/twilight/{p-6eb7a1c9.entry.js → p-0c94a0ba.entry.js} +1 -1
- package/dist/twilight/{p-9a2094af.entry.js → p-0d89d8e1.entry.js} +1 -1
- package/dist/twilight/{p-33bdb6b4.entry.js → p-14b1e2d0.entry.js} +1 -1
- package/dist/twilight/{p-fac74a09.entry.js → p-20e9c331.entry.js} +1 -1
- package/dist/twilight/{p-84c24cbf.entry.js → p-26032f24.entry.js} +1 -1
- package/dist/twilight/{p-c121bf62.entry.js → p-30a0ad26.entry.js} +1 -1
- package/dist/twilight/{p-d88f8d71.entry.js → p-36bbf0f4.entry.js} +1 -1
- package/dist/twilight/{p-7bfdbe2c.entry.js → p-36e8eb7c.entry.js} +1 -1
- package/dist/twilight/{p-d7e8d463.entry.js → p-377e1c79.entry.js} +1 -1
- package/dist/twilight/{p-d88dace7.entry.js → p-38191a0e.entry.js} +1 -1
- package/dist/twilight/{p-072e0f0e.entry.js → p-3b80943f.entry.js} +1 -1
- package/dist/twilight/{p-bf0da096.entry.js → p-3d4a1b1b.entry.js} +1 -1
- package/dist/twilight/{p-ac899f06.entry.js → p-4440a6ff.entry.js} +1 -1
- package/dist/twilight/{p-17513005.entry.js → p-4886e880.entry.js} +1 -1
- package/dist/twilight/{p-6b9ff7c8.entry.js → p-48e70cb0.entry.js} +1 -1
- package/dist/twilight/{p-2ebecee9.entry.js → p-4a09504d.entry.js} +1 -1
- package/dist/twilight/{p-ae950f3d.entry.js → p-4c99593f.entry.js} +1 -1
- package/dist/twilight/{p-a42a1b2e.entry.js → p-4e06ddfa.entry.js} +1 -1
- package/dist/twilight/{p-644fce9b.entry.js → p-4e42d162.entry.js} +1 -1
- package/dist/twilight/{p-2fd30bc5.entry.js → p-4f076de1.entry.js} +1 -1
- package/dist/twilight/{p-7b489e5d.entry.js → p-5840e752.entry.js} +1 -1
- package/dist/twilight/{p-0cfd02ac.entry.js → p-6907c710.entry.js} +1 -1
- package/dist/twilight/{p-35315e94.entry.js → p-6af3c1f6.entry.js} +1 -1
- package/dist/twilight/{p-bdd30dd8.entry.js → p-6b471877.entry.js} +1 -1
- package/dist/twilight/{p-ae717169.entry.js → p-6de27f49.entry.js} +1 -1
- package/dist/twilight/{p-f3ed92ab.entry.js → p-74855829.entry.js} +1 -1
- package/dist/twilight/{p-0b809343.entry.js → p-76c9b4a4.entry.js} +1 -1
- package/dist/twilight/{p-13f00911.entry.js → p-76f2f01b.entry.js} +1 -1
- package/dist/twilight/{p-7764a304.entry.js → p-79f8ca6d.entry.js} +1 -1
- package/dist/twilight/{p-a0306fe1.entry.js → p-7ad96323.entry.js} +1 -1
- package/dist/twilight/{p-ff69f252.entry.js → p-7e4be0c4.entry.js} +1 -1
- package/dist/twilight/{p-f312e8c3.entry.js → p-8717ee61.entry.js} +1 -1
- package/dist/twilight/{p-74e64863.entry.js → p-95ee89d0.entry.js} +1 -1
- package/dist/twilight/{p-BQGxkpNf.js → p-BFDfgy7S.js} +1 -1
- package/dist/twilight/{p-BW4PTXIV.js → p-CENly0Ds.js} +1 -1
- package/dist/twilight/{p-BydBx2Hz.js → p-CLfrQ6bI.js} +1 -1
- package/dist/twilight/{p-COyNuZga.js → p-CfPcIuUK.js} +1 -1
- package/dist/twilight/{p-B4cEhvSn.js → p-DX7cHKQU.js} +1 -1
- package/dist/twilight/{p-BuVkzZPJ.js → p-DcXc0Zp9.js} +1 -1
- package/dist/twilight/{p-D9pFfS0x.js → p-Dh0de9Ra.js} +1 -1
- package/dist/twilight/{p-BaaWLUWL.js → p-Dmq3escH.js} +1 -1
- package/dist/twilight/{p-xFAL2vxu.js → p-EHepWG4x.js} +1 -1
- package/dist/twilight/{p-gzTMnCaL.js → p-SC958swN.js} +1 -1
- package/dist/twilight/{p-01ef4e51.entry.js → p-a01445f4.entry.js} +1 -1
- package/dist/twilight/{p-bed51089.entry.js → p-a034c54c.entry.js} +1 -1
- package/dist/twilight/{p-4e2337a5.entry.js → p-a19b6177.entry.js} +1 -1
- package/dist/twilight/{p-5cde0413.entry.js → p-a3d6030f.entry.js} +1 -1
- package/dist/twilight/{p-16dd2422.entry.js → p-a7754ee7.entry.js} +1 -1
- package/dist/twilight/{p-d75e1e5f.entry.js → p-ae633d64.entry.js} +1 -1
- package/dist/twilight/{p-fcc47e94.entry.js → p-b5366d24.entry.js} +1 -1
- package/dist/twilight/{p-57600606.entry.js → p-bb910a1c.entry.js} +1 -1
- package/dist/twilight/{p-669987db.entry.js → p-bf34a39d.entry.js} +1 -1
- package/dist/twilight/{p-4b9f4269.entry.js → p-bffdfc94.entry.js} +1 -1
- package/dist/twilight/{p-ada6c43e.entry.js → p-ca30c6ee.entry.js} +1 -1
- package/dist/twilight/{p-7a0a5ee5.entry.js → p-cc3fbf6a.entry.js} +1 -1
- package/dist/twilight/{p-d682c191.entry.js → p-d294fb4e.entry.js} +1 -1
- package/dist/twilight/{p-0e672192.entry.js → p-d8a664c6.entry.js} +1 -1
- package/dist/twilight/{p-aeefa78e.entry.js → p-d9cf9ee1.entry.js} +1 -1
- package/dist/twilight/{p-1d67ec26.entry.js → p-dcb89afa.entry.js} +1 -1
- package/dist/twilight/{p-663b99b7.entry.js → p-dcddba20.entry.js} +1 -1
- package/dist/twilight/{p-f2dfe3b8.entry.js → p-e0bcc8d3.entry.js} +1 -1
- package/dist/twilight/{p-d403d4ee.entry.js → p-e15cc4e1.entry.js} +1 -1
- package/dist/twilight/{p-48b131d7.entry.js → p-e3b54aea.entry.js} +1 -1
- package/dist/twilight/{p-83429697.entry.js → p-ec02e14c.entry.js} +1 -1
- package/dist/twilight/{p-2488dc2d.entry.js → p-f14a6a4a.entry.js} +1 -1
- package/dist/twilight/{p-f0cc775f.entry.js → p-f350c729.entry.js} +1 -1
- package/dist/twilight/{p-f146c8a6.entry.js → p-f618bcba.entry.js} +1 -1
- package/dist/twilight/{p-034b4c1a.entry.js → p-f9978b96.entry.js} +1 -1
- package/dist/twilight/{p-6211929d.entry.js → p-fc72ec63.entry.js} +1 -1
- package/dist/twilight/{p-96152b9c.entry.js → p-fd97048c.entry.js} +1 -1
- package/dist/twilight/{p-342e085d.entry.js → p-fdbe9004.entry.js} +1 -1
- package/dist/twilight/{p-70a78ebf.entry.js → p-fe8869f5.entry.js} +1 -1
- package/dist/twilight/twilight.esm.js +1 -1
- package/package.json +5 -5
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as a,h as l,H as t}from"./p-
|
|
4
|
+
import{r as a,h as l,H as t}from"./p-CLfrQ6bI.js";import{l as s}from"./p-BChI23pG.js";const o=a=>a?new Date(Number(a)).toLocaleDateString(salla.lang.locale,{weekday:"long",year:"numeric",month:"long",day:"numeric",hour:"numeric"}):"",r=a=>{if(!a)return"";try{const l=a.toLowerCase(),t=salla.lang.get(`pages.loyalty_program.${l}`);return t===`pages.loyalty_program.${l}`?a:t}catch{return a}},e=class{constructor(l){a(this,l),this.loyaltyPointsArray=[],this.isLoadingLoyalty=!1,this.nextPageUrlLoyalty="",this.handleClick=()=>{this.loadMoreLoyaltyPoints()}}componentWillLoad(){return salla.onReady().then((()=>{this.loadLoyaltyPoints()}))}async loadLoyaltyPoints(){this.isLoadingLoyalty=!0;try{let a="/balance/points?page=1",l=await salla.api.request(a);this.loyaltyPointsArray=l.data,this.nextPageUrlLoyalty=l.cursor.next}catch(a){console.error("Error loading loyalty points transactions",a)}finally{this.isLoadingLoyalty=!1}}async loadMoreLoyaltyPoints(){if(this.nextPageUrlLoyalty){this.isLoadingLoyalty=!0;try{let a=await salla.api.request(this.nextPageUrlLoyalty);this.loyaltyPointsArray=[...this.loyaltyPointsArray,...a.data],this.nextPageUrlLoyalty=a.cursor?.next||""}catch(a){console.error("Error loading more loyalty points",a)}finally{this.isLoadingLoyalty=!1}}}render(){return l(t,{key:"8db94d6959cdbfa850f64d6c37471a78e9b36fb8"},l("div",{key:"e7d4eeef9079ac87ea4d4359c6833dce82bfa11e"},this.isLoadingLoyalty?l("salla-loading",null):l("div",null,this.loyaltyPointsArray.length>0?l("div",null,l("table",{class:"s-loyalty-program-table"},l("thead",{class:"s-loyalty-program-table-head"},l("tr",{class:"s-loyalty-program-table-head-tr"},l("th",{scope:"col",class:"s-loyalty-program-table-head-tr-th"},salla.lang.get("pages.wallet.points")),l("th",{scope:"col",class:"s-loyalty-program-table-head-tr-th"},salla.lang.get("pages.wallet.date")),l("th",{scope:"col",class:"s-loyalty-program-table-head-tr-th"},salla.lang.get("pages.wallet.expiry_date")),l("th",{scope:"col",class:"s-loyalty-program-table-head-tr-th"},salla.lang.get("common.elements.note")),l("th",{scope:"col",class:"s-loyalty-program-table-head-tr-th"},salla.lang.get("common.elements.status")))),l("tbody",{class:"s-loyalty-program-table-tbody"},this.loyaltyPointsArray.map((a=>l("tr",{class:"s-loyalty-program-table-tbody-tr"},l("td",{class:"s-loyalty-program-table-tbody-tr-td"},"plus"===a?.type?"+":"",a?.points||""," ",salla.lang.get("pages.loyalty_program.point")),l("td",{class:"s-loyalty-program-table-tbody-tr-td"},o(a?.created_at?1e3*Number(a.created_at):void 0)),l("td",{class:"s-loyalty-program-table-tbody-tr-td"},o(a?.points_expire_date)),l("td",{class:"s-loyalty-program-table-tbody-tr-td"},r(a?.key)),l("td",{class:"s-loyalty-program-table-tbody-tr-td"},r(a?.status_key))))))),l("div",{class:"s-infinite-scroll-wrapper"},!!this.nextPageUrlLoyalty&&l("salla-button",{onClick:this.handleClick,loading:this.isLoadingLoyalty},salla.lang.get("common.elements.load_more")))):l("div",null,l("div",{class:"s-loyalty-program-table-empty-state"},l("span",{innerHTML:s}),l("div",{class:"s-loyalty-program-table-placeholder-title"},salla.lang.get("pages.loyalty_program.no_loyality_points_title")),l("div",{class:"s-loyalty-program-table-placeholder-sub-title"},salla.lang.get("pages.loyalty_program.no_loyality_points_sub_title")))))))}};e.style="";export{e as salla_loyalty_program}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as s,h as t,H as a,a as i}from"./p-
|
|
4
|
+
import{r as s,h as t,H as a,a as i}from"./p-CLfrQ6bI.js";const e=class{constructor(t){s(this,t),this.exclude=[]}componentWillLoad(){return salla.onReady().then((()=>{if("string"==typeof this.exclude)try{this.exclude=JSON.parse(this.exclude)}catch(s){salla.logger.error("salla-payments:: failed to parse the exclude props!",this.exclude),this.exclude=[]}this.paymentSlot=this.host.querySelector('[slot="payment"]')?.innerHTML||'<li class="s-payments-list-item"><img width="100%" height="100%" decoding="async" loading="lazy" src="{image}" alt="{payment}" /></li>',this.sbcSlot=this.host.querySelector('[slot="sbc"]')?.innerHTML||'<li class="s-payments-list-item"><a target="_blank" href="{link}"><img width="100%" height="100%" decoding="async" loading="lazy" src="{image}" class="s-payments-sbc-image" alt="SBC" /></a></li>',this.codSlot=this.host.querySelector('[slot="cod"]')?.innerHTML||'<li class="s-payments-list-item"><img width="100%" height="100%" decoding="async" loading="lazy" src="{image}" alt="COD" /></li>',this.payments=salla.config.get("store.settings.payments")}))}render(){const s=!this.exclude.includes("made-in-ksa")&&salla.config.get("store.settings.made_in_ksa"),i=this.exclude.includes("sbc")?null:salla.config.get("store.settings.certificate.id");return t(a,{key:"ac201f76fd82b48a5c3121890724519addac63d1",class:"s-payments-list-wrap"},t("ul",{key:"b82ff166164a2d1186312b3c246b4940a33acb52",class:"s-payments-list"},s&&t("li",{key:"47fdd99738046820b52617f0101df65fcd1029f7",class:"s-payments-list-item"},t("img",{key:"cd7aa2fc1265eea115d2f89d1cdf9a1de34b59c1",width:"100%",height:"100%",decoding:"async",loading:"lazy",src:salla.url.cdn("images/made-in-ksa.svg",58,58),alt:"made in KSA certified"})),this.payments.map((s=>t("div","cod"==s?{id:"cod-slot",innerHTML:this.codSlot.replace(/\{image\}/g,salla.url.cdn("images/payment/cod_mini.png",58,58))}:{id:"payment-slot",innerHTML:this.paymentSlot.replace(/\{image\}/g,salla.url.cdn(`images/payment/${s}_mini.png`,58,58)).replace(/\{payment\}/g,s)}))),i&&t("div",{key:"628d3efa7636011713975fb3310bfe2a65dc774a",id:"sbc-slot",innerHTML:this.sbcSlot.replace(/\{image\}/g,salla.url.cdn("images/sbc.png",58,58)).replace(/\{link\}/g,`https://eauthenticate.saudibusiness.gov.sa/certificate-details/${i}`)})))}componentDidRender(){this.host.querySelectorAll("#payment-slot").forEach((s=>s.replaceWith(s.firstChild))),this.host.querySelectorAll("#sbc-slot").forEach((s=>s.replaceWith(s.firstChild))),this.host.querySelectorAll("#cod-slot").forEach((s=>s.replaceWith(s.firstChild))),this.host.querySelector('[slot="payment"]')?.remove(),this.host.querySelector('[slot="sbc"]')?.remove(),this.host.querySelector('[slot="cod"]')?.remove()}get host(){return i(this)}};e.style=":host{display:block}";export{e as salla_payments}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as e,h as t,H as s,a}from"./p-BydBx2Hz.js";import{P as l}from"./p-DY4LZmNP.js";import{I as o}from"./p-C-tzSDxw.js";const i=class{constructor(t){e(this,t),this.variant="info"}renderIcon(){const e=this.icon||this.variant;if("none"===e)return null;switch(e){case"success":return t("svg",{viewBox:"0 0 24 24",width:"20",height:"20",fill:"currentColor"},t("path",{d:"M9 16.2l-3.5-3.5L4 14.2l5 5 11-11-1.5-1.5z"}));case"warning":return t("svg",{viewBox:"0 0 24 24",width:"20",height:"20",fill:"currentColor"},t("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"}));case"error":return t("svg",{viewBox:"0 0 24 24",width:"20",height:"20",fill:"currentColor"},t("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 \n 10 10 10-4.48 10-10S17.52 2 12 2zm5 \n 13.59L15.59 17 12 13.41 8.41 17 \n 7 15.59 10.59 12 7 8.41 8.41 7 \n 12 10.59 15.59 7 17 8.41 13.41 \n 12 17 15.59z"}));default:return t("span",{innerHTML:'<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M9.99935 18.3332C5.39697 18.3332 1.66602 14.6022 1.66602 9.99984C1.66602 5.39746 5.39697 1.6665 9.99935 1.6665C14.6017 1.6665 18.3327 5.39746 18.3327 9.99984C18.3327 14.6022 14.6017 18.3332 9.99935 18.3332ZM9.99935 16.6665C13.6813 16.6665 16.666 13.6818 16.666 9.99984C16.666 6.31794 13.6813 3.33317 9.99935 3.33317C6.31745 3.33317 3.33268 6.31794 3.33268 9.99984C3.33268 13.6818 6.31745 16.6665 9.99935 16.6665ZM9.16602 5.83317H10.8327V7.49984H9.16602V5.83317ZM9.16602 9.1665H10.8327V14.1665H9.16602V9.1665Z" fill="#417AC8"/>\n</svg>\n'})}}render(){return t(s,{key:"3b5dd808399eeda5d930454542cd41cca26b0cc3",class:`s-alert-wrapper s-alert-${this.variant}`},t("span",{key:"4f58234774d1afc790fb83bff983ca9366faa349",class:"s-alert-icon"},this.renderIcon()),t("span",{key:"10eb3f87e6e77dcc5406a24f866feee1cc1f46ef",class:"s-alert-text"},this.message,t("slot",{key:"3656e15aeb25fb7285e88f694c090bad3b32dfbd"})))}};i.style=":host{display:block}";const n=class{constructor(t){e(this,t),this.storeId=salla.config.get("store.id"),this.template=salla.config.get("store.template"),this.loading=!1,this.templateData={},this.defaultMessage=salla.lang.getWithDefault("common.elements.store_is_available_for_purchase","هذا المتجر تطويري ومتاح للشراء من"),this.defaultActionLabel=salla.lang.get("common.elements.know_more"),this.storeFeatures=salla.lang.get("common.elements.store_features"),this.storeDetails=salla.lang.get("common.elements.store_details"),this.storePrice=salla.lang.getWithDefault("common.elements.store_price","سعر المتجر"),this.storePriceDetails=salla.lang.getWithDefault("common.elements.store_price_details","السعر يشمل"),this.theDeveloper=salla.lang.get("common.elements.the_developer"),this.templateInformation=salla.lang.get("common.elements.template_information"),this.buyTheTemplate=salla.lang.get("common.elements.buy_the_template"),this.isRtl=salla.config.get("theme.is_rtl",!0),this.storeName=salla.config.get("store.name"),this.salla=salla.lang.getWithDefault("common.elements.salla","سلة"),this.readyStores=salla.lang.getWithDefault("common.elements.ready_stores","المتاجر الجاهزة"),this.moreDetailsLabel=salla.lang.getWithDefault("common.elements.more_details","تفاصيل أكثر"),this.type="popup",salla.lang.onLoaded((()=>{this.defaultMessage=salla.lang.get("common.elements.experimental_and_available_store"),this.defaultActionLabel=salla.lang.get("common.elements.know_more"),this.storeFeatures=salla.lang.get("common.elements.store_features"),this.storeDetails=salla.lang.get("common.elements.store_details"),this.templateInformation=salla.lang.get("common.elements.template_information"),this.buyTheTemplate=salla.lang.get("common.elements.buy_the_template"),salla.helpers.setNested(salla.lang.messages["ar.trans"],"common.elements.more_details","تفاصيل أكثر"),salla.helpers.setNested(salla.lang.messages["en.trans"],"common.elements.more_details","More Details"),salla.helpers.setNested(salla.lang.messages["ar.trans"],"common.elements.store_price","سعر المتجر"),salla.helpers.setNested(salla.lang.messages["en.trans"],"common.elements.store_price","Store Price"),salla.helpers.setNested(salla.lang.messages["ar.trans"],"common.elements.the_developer","المطور"),salla.helpers.setNested(salla.lang.messages["en.trans"],"common.elements.the_developer","the developer"),salla.helpers.setNested(salla.lang.messages["ar.trans"],"common.elements.store_price_details","السعر يشمل"),salla.helpers.setNested(salla.lang.messages["en.trans"],"common.elements.store_price_details","Price Includes"),salla.helpers.setNested(salla.lang.messages["ar.trans"],"common.elements.salla","سلة"),salla.helpers.setNested(salla.lang.messages["en.trans"],"common.elements.salla","Salla"),salla.helpers.setNested(salla.lang.messages["ar.trans"],"common.elements.store_is_available_for_purchase","هذا المتجر تطويري ومتاح للشراء من"),salla.helpers.setNested(salla.lang.messages["en.trans"],"common.elements.store_is_available_for_purchase","This ready store is available for purchase from"),salla.helpers.setNested(salla.lang.messages["ar.trans"],"common.elements.ready_stores","المتاجر الجاهزة"),salla.helpers.setNested(salla.lang.messages["en.trans"],"common.elements.ready_stores","Ready Stores"),setTimeout((()=>{this.storePrice=salla.lang.get("common.elements.store_price"),this.theDeveloper=salla.lang.get("common.elements.the_developer"),this.storePriceDetails=salla.lang.getWithDefault("common.elements.store_price_details","السعر يشمل"),this.salla=salla.lang.getWithDefault("common.elements.salla","سلة"),this.defaultMessage=salla.lang.getWithDefault("common.elements.store_is_available_for_purchase","هذا المتجر تطويري ومتاح للشراء من"),this.readyStores=salla.lang.getWithDefault("common.elements.ready_stores","المتاجر الجاهزة"),this.moreDetailsLabel=salla.lang.getWithDefault("common.elements.more_details","More Details")}),100)}))}componentDidLoad(){this.template&&"object"==typeof this.template&&Object.keys(this.template).length>0&&this.fetchTemplateData()}open(){return this.drawer.open()}fetchTemplateData(){if(!Object.keys(this.templateData).length)return this.loading=!0,salla.api.request("/store/template",{},"get",{"Store-Identifier":this.storeId}).then((e=>{this.templateData=e.data,this.loading=!1})).catch((()=>{this.loading=!1}))}handleAction(){"link"===this.type&&(window.location.href=this.actionUrl),"popup"===this.type&&this.open()}popup(){return t("salla-drawer",{class:"s-bottom-alert-modal",ref:e=>this.drawer=e,"no-padding":!0,onLoad:()=>{this.drawer&&Object.keys(this.templateData).length&&this.drawer.setTitle(this.storeDetails+" "+this.storeName)}},Object.keys(this.templateData).length?[t("div",{class:"s-bottom-alert-modal-inner s-scrollbar"},t("div",{class:{"s-bottom-alert-modal-content":!0}},this.templateData?.features?[t("div",{class:"s-bottom-alert-modal-content-title"},t("i",{innerHTML:o,class:"s-bottom-alert-modal-content-icon"}),t("span",null,this.storeFeatures)),t("div",{class:"s-bottom-alert-modal-content-features",innerHTML:this.templateData?.features})]:""),t("div",{class:{"s-bottom-alert-modal-content":!0,"s-bottom-alert-modal-content-extra-padding":this.templateData?.price}},this.templateData?.features?[t("div",{class:"s-bottom-alert-modal-content-title"},t("i",{innerHTML:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>money-card</title>\n<path d="M17.333 14.667h-2.667c-0.736 0-1.333-0.599-1.333-1.333s0.597-1.333 1.333-1.333h4c0.737 0 1.333-0.597 1.333-1.333s-0.596-1.333-1.333-1.333h-1.333v-1.333c0-0.736-0.596-1.333-1.333-1.333s-1.333 0.597-1.333 1.333v1.333c-2.205 0-4 1.795-4 4s1.795 4 4 4h2.667c0.736 0 1.333 0.597 1.333 1.333s-0.597 1.333-1.333 1.333h-4c-0.737 0-1.333 0.596-1.333 1.333s0.596 1.333 1.333 1.333h1.333v1.333c0 0.737 0.596 1.333 1.333 1.333s1.333-0.596 1.333-1.333v-1.333c2.205 0 4-1.795 4-4s-1.795-4-4-4zM28 2.667h-24c-2.205 0-4 1.795-4 4v18.667c0 2.205 1.795 4 4 4h24c2.205 0 4-1.795 4-4v-18.667c0-2.205-1.795-4-4-4zM29.333 25.333c0 0.736-0.597 1.333-1.333 1.333h-24c-0.736 0-1.333-0.597-1.333-1.333v-18.667c0-0.735 0.597-1.333 1.333-1.333h24c0.736 0 1.333 0.599 1.333 1.333z"></path>\n</svg>\n',class:"s-bottom-alert-modal-content-icon"}),t("span",null,this.storePriceDetails)),t("div",{class:"s-bottom-alert-modal-content-price-details"},this.templateData?.price_details?.items.map((e=>t("div",{class:"s-bottom-alert-modal-content-price-details-item"},t("i",{innerHTML:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>check-circle</title>\n<path d="M19.557 11.26l-4.593 6.891-2.891-1.927c-0.616-0.411-1.441-0.243-1.849 0.369-0.409 0.612-0.244 1.441 0.369 1.849l4 2.667c0.228 0.152 0.485 0.224 0.739 0.224 0.431 0 0.855-0.208 1.111-0.593l5.333-8c0.409-0.612 0.244-1.441-0.369-1.849-0.616-0.411-1.443-0.243-1.849 0.369zM16 0c-8.823 0-16 7.177-16 16s7.177 16 16 16 16-7.177 16-16-7.177-16-16-16zM16 29.333c-7.352 0-13.333-5.981-13.333-13.333s5.981-13.333 13.333-13.333 13.333 5.981 13.333 13.333-5.981 13.333-13.333 13.333z"></path>\n</svg>\n',class:"s-bottom-alert-modal-content-price-details-item-icon"}),t("span",{class:"s-bottom-alert-modal-content-price-details-item-name"},e.name),t("span",{class:"s-bottom-alert-modal-content-price-details-item-price",innerHTML:salla.money(e.price)})))))]:""),this.templateData?.link?t("div",{class:"s-bottom-alert-modal-content-footer"},t("salla-button",{color:"primary",size:"medium",width:"wide",href:this.templateData?.link},t("i",{innerHTML:l}),this.buyTheTemplate)):"")]:"")}render(){const e=this.template&&"object"==typeof this.template&&Object.keys(this.template).length>0;return t(s,{key:"e5f273d72875760e30d99d419b247137583bc450",class:"s-bottom-alert-wrapper "+(e?"s-bottom-alert-wrapper-with-template":"")},e&&t("div",{key:"1db37d7c67aae449f41a9a3ed83489b2a0653cef",class:"s-bottom-alert-logo-section"},t("img",{key:"18701cd3d807042b4d852f283d43a6855282f791",src:"https://cdn.salla.network/images/logo/logo-light.svg",alt:"Salla",class:"s-bottom-alert-logo"}),t("span",{key:"66bb3f9b3c00aee5c2694d5ddb142e753ae7fa1a",class:"s-bottom-alert-logo-text"},this.readyStores)),t("div",{key:"01d47c9ec38370b83bdb3fdc29291f55e1b3aa42",class:"s-bottom-alert-content"},t("div",{key:"5380873bf9d393c0fa18da196e1bfb675a8c9c9b",class:"flex items-center gap-2"},t("div",{key:"882382de35a7c9a767e2eb90305c8a973d01ac21",class:"s-bottom-alert-icon"},t("i",this.icon?{class:this.icon}:{innerHTML:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>info</title>\n<path d="M16 13.333c-0.737 0-1.333 0.596-1.333 1.333v9.333c0 0.737 0.596 1.333 1.333 1.333s1.333-0.596 1.333-1.333v-9.333c0-0.737-0.596-1.333-1.333-1.333zM16 7.987c-0.737 0-1.333 0.596-1.333 1.333v0.013c0 0.737 0.596 1.327 1.333 1.327s1.333-0.603 1.333-1.34-0.596-1.333-1.333-1.333zM16 0c-8.823 0-16 7.177-16 16s7.177 16 16 16 16-7.177 16-16-7.177-16-16-16zM16 29.333c-7.352 0-13.333-5.981-13.333-13.333s5.981-13.333 13.333-13.333 13.333 5.981 13.333 13.333-5.981 13.333-13.333 13.333z"></path>\n</svg>\n'})),t("div",{key:"dfbaa427fd4e8b755a479e0b5459422e44a95f59",class:"s-bottom-alert-message"},this.message?this.message:e?t("span",{class:"flex flex-wrap items-center gap-1"},this.defaultMessage,t("span",{class:{"s-bottom-alert-message-highlight":!0},"aria-label":"Developer"},this.salla),t("span",{innerHTML:salla.money(this.template.price)})):this.defaultMessage)),"banner"!==this.type&&t("div",{key:"327ef4b5ecdab7d994418c033a78c2531eb28de5",class:e?"s-bottom-alert-actions-group":"s-bottom-alert-action"},e?this.loading?t("salla-loading",{size:"20"}):t("div",{class:"s-bottom-alert-actions-group-container"},t("a",{class:"s-bottom-alert-action-link",onClick:()=>this.handleAction()},this.actionLabel||this.moreDetailsLabel),this.templateData?.link?t("button",{type:"button",class:"s-bottom-alert-action-purchase-button",onClick:()=>window.open(this.templateData?.link,"_blank")},this.buyTheTemplate):null):t("salla-button",{href:this.actionUrl,size:"medium",onClick:()=>this.handleAction(),width:"normal"},this.actionLabel||this.defaultActionLabel)),"popup"===this.type&&this.popup()))}get host(){return a(this)}};n.style=":host{display:block}";export{i as salla_alert,n as salla_bottom_alert}
|
|
4
|
+
import{r as e,h as t,H as s,a}from"./p-CLfrQ6bI.js";import{P as l}from"./p-DY4LZmNP.js";import{I as o}from"./p-C-tzSDxw.js";const i=class{constructor(t){e(this,t),this.variant="info"}renderIcon(){const e=this.icon||this.variant;if("none"===e)return null;switch(e){case"success":return t("svg",{viewBox:"0 0 24 24",width:"20",height:"20",fill:"currentColor"},t("path",{d:"M9 16.2l-3.5-3.5L4 14.2l5 5 11-11-1.5-1.5z"}));case"warning":return t("svg",{viewBox:"0 0 24 24",width:"20",height:"20",fill:"currentColor"},t("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"}));case"error":return t("svg",{viewBox:"0 0 24 24",width:"20",height:"20",fill:"currentColor"},t("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 \n 10 10 10-4.48 10-10S17.52 2 12 2zm5 \n 13.59L15.59 17 12 13.41 8.41 17 \n 7 15.59 10.59 12 7 8.41 8.41 7 \n 12 10.59 15.59 7 17 8.41 13.41 \n 12 17 15.59z"}));default:return t("span",{innerHTML:'<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M9.99935 18.3332C5.39697 18.3332 1.66602 14.6022 1.66602 9.99984C1.66602 5.39746 5.39697 1.6665 9.99935 1.6665C14.6017 1.6665 18.3327 5.39746 18.3327 9.99984C18.3327 14.6022 14.6017 18.3332 9.99935 18.3332ZM9.99935 16.6665C13.6813 16.6665 16.666 13.6818 16.666 9.99984C16.666 6.31794 13.6813 3.33317 9.99935 3.33317C6.31745 3.33317 3.33268 6.31794 3.33268 9.99984C3.33268 13.6818 6.31745 16.6665 9.99935 16.6665ZM9.16602 5.83317H10.8327V7.49984H9.16602V5.83317ZM9.16602 9.1665H10.8327V14.1665H9.16602V9.1665Z" fill="#417AC8"/>\n</svg>\n'})}}render(){return t(s,{key:"3b5dd808399eeda5d930454542cd41cca26b0cc3",class:`s-alert-wrapper s-alert-${this.variant}`},t("span",{key:"4f58234774d1afc790fb83bff983ca9366faa349",class:"s-alert-icon"},this.renderIcon()),t("span",{key:"10eb3f87e6e77dcc5406a24f866feee1cc1f46ef",class:"s-alert-text"},this.message,t("slot",{key:"3656e15aeb25fb7285e88f694c090bad3b32dfbd"})))}};i.style=":host{display:block}";const n=class{constructor(t){e(this,t),this.storeId=salla.config.get("store.id"),this.template=salla.config.get("store.template"),this.loading=!1,this.templateData={},this.defaultMessage=salla.lang.getWithDefault("common.elements.store_is_available_for_purchase","هذا المتجر تطويري ومتاح للشراء من"),this.defaultActionLabel=salla.lang.get("common.elements.know_more"),this.storeFeatures=salla.lang.get("common.elements.store_features"),this.storeDetails=salla.lang.get("common.elements.store_details"),this.storePrice=salla.lang.getWithDefault("common.elements.store_price","سعر المتجر"),this.storePriceDetails=salla.lang.getWithDefault("common.elements.store_price_details","السعر يشمل"),this.theDeveloper=salla.lang.get("common.elements.the_developer"),this.templateInformation=salla.lang.get("common.elements.template_information"),this.buyTheTemplate=salla.lang.get("common.elements.buy_the_template"),this.isRtl=salla.config.get("theme.is_rtl",!0),this.storeName=salla.config.get("store.name"),this.salla=salla.lang.getWithDefault("common.elements.salla","سلة"),this.readyStores=salla.lang.getWithDefault("common.elements.ready_stores","المتاجر الجاهزة"),this.moreDetailsLabel=salla.lang.getWithDefault("common.elements.more_details","تفاصيل أكثر"),this.type="popup",salla.lang.onLoaded((()=>{this.defaultMessage=salla.lang.get("common.elements.experimental_and_available_store"),this.defaultActionLabel=salla.lang.get("common.elements.know_more"),this.storeFeatures=salla.lang.get("common.elements.store_features"),this.storeDetails=salla.lang.get("common.elements.store_details"),this.templateInformation=salla.lang.get("common.elements.template_information"),this.buyTheTemplate=salla.lang.get("common.elements.buy_the_template"),salla.helpers.setNested(salla.lang.messages["ar.trans"],"common.elements.more_details","تفاصيل أكثر"),salla.helpers.setNested(salla.lang.messages["en.trans"],"common.elements.more_details","More Details"),salla.helpers.setNested(salla.lang.messages["ar.trans"],"common.elements.store_price","سعر المتجر"),salla.helpers.setNested(salla.lang.messages["en.trans"],"common.elements.store_price","Store Price"),salla.helpers.setNested(salla.lang.messages["ar.trans"],"common.elements.the_developer","المطور"),salla.helpers.setNested(salla.lang.messages["en.trans"],"common.elements.the_developer","the developer"),salla.helpers.setNested(salla.lang.messages["ar.trans"],"common.elements.store_price_details","السعر يشمل"),salla.helpers.setNested(salla.lang.messages["en.trans"],"common.elements.store_price_details","Price Includes"),salla.helpers.setNested(salla.lang.messages["ar.trans"],"common.elements.salla","سلة"),salla.helpers.setNested(salla.lang.messages["en.trans"],"common.elements.salla","Salla"),salla.helpers.setNested(salla.lang.messages["ar.trans"],"common.elements.store_is_available_for_purchase","هذا المتجر تطويري ومتاح للشراء من"),salla.helpers.setNested(salla.lang.messages["en.trans"],"common.elements.store_is_available_for_purchase","This ready store is available for purchase from"),salla.helpers.setNested(salla.lang.messages["ar.trans"],"common.elements.ready_stores","المتاجر الجاهزة"),salla.helpers.setNested(salla.lang.messages["en.trans"],"common.elements.ready_stores","Ready Stores"),setTimeout((()=>{this.storePrice=salla.lang.get("common.elements.store_price"),this.theDeveloper=salla.lang.get("common.elements.the_developer"),this.storePriceDetails=salla.lang.getWithDefault("common.elements.store_price_details","السعر يشمل"),this.salla=salla.lang.getWithDefault("common.elements.salla","سلة"),this.defaultMessage=salla.lang.getWithDefault("common.elements.store_is_available_for_purchase","هذا المتجر تطويري ومتاح للشراء من"),this.readyStores=salla.lang.getWithDefault("common.elements.ready_stores","المتاجر الجاهزة"),this.moreDetailsLabel=salla.lang.getWithDefault("common.elements.more_details","More Details")}),100)}))}componentDidLoad(){this.template&&"object"==typeof this.template&&Object.keys(this.template).length>0&&this.fetchTemplateData()}open(){return this.drawer.open()}fetchTemplateData(){if(!Object.keys(this.templateData).length)return this.loading=!0,salla.api.request("/store/template",{},"get",{"Store-Identifier":this.storeId}).then((e=>{this.templateData=e.data,this.loading=!1})).catch((()=>{this.loading=!1}))}handleAction(){"link"===this.type&&(window.location.href=this.actionUrl),"popup"===this.type&&this.open()}popup(){return t("salla-drawer",{class:"s-bottom-alert-modal",ref:e=>this.drawer=e,"no-padding":!0,onLoad:()=>{this.drawer&&Object.keys(this.templateData).length&&this.drawer.setTitle(this.storeDetails+" "+this.storeName)}},Object.keys(this.templateData).length?[t("div",{class:"s-bottom-alert-modal-inner s-scrollbar"},t("div",{class:{"s-bottom-alert-modal-content":!0}},this.templateData?.features?[t("div",{class:"s-bottom-alert-modal-content-title"},t("i",{innerHTML:o,class:"s-bottom-alert-modal-content-icon"}),t("span",null,this.storeFeatures)),t("div",{class:"s-bottom-alert-modal-content-features",innerHTML:this.templateData?.features})]:""),t("div",{class:{"s-bottom-alert-modal-content":!0,"s-bottom-alert-modal-content-extra-padding":this.templateData?.price}},this.templateData?.features?[t("div",{class:"s-bottom-alert-modal-content-title"},t("i",{innerHTML:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>money-card</title>\n<path d="M17.333 14.667h-2.667c-0.736 0-1.333-0.599-1.333-1.333s0.597-1.333 1.333-1.333h4c0.737 0 1.333-0.597 1.333-1.333s-0.596-1.333-1.333-1.333h-1.333v-1.333c0-0.736-0.596-1.333-1.333-1.333s-1.333 0.597-1.333 1.333v1.333c-2.205 0-4 1.795-4 4s1.795 4 4 4h2.667c0.736 0 1.333 0.597 1.333 1.333s-0.597 1.333-1.333 1.333h-4c-0.737 0-1.333 0.596-1.333 1.333s0.596 1.333 1.333 1.333h1.333v1.333c0 0.737 0.596 1.333 1.333 1.333s1.333-0.596 1.333-1.333v-1.333c2.205 0 4-1.795 4-4s-1.795-4-4-4zM28 2.667h-24c-2.205 0-4 1.795-4 4v18.667c0 2.205 1.795 4 4 4h24c2.205 0 4-1.795 4-4v-18.667c0-2.205-1.795-4-4-4zM29.333 25.333c0 0.736-0.597 1.333-1.333 1.333h-24c-0.736 0-1.333-0.597-1.333-1.333v-18.667c0-0.735 0.597-1.333 1.333-1.333h24c0.736 0 1.333 0.599 1.333 1.333z"></path>\n</svg>\n',class:"s-bottom-alert-modal-content-icon"}),t("span",null,this.storePriceDetails)),t("div",{class:"s-bottom-alert-modal-content-price-details"},this.templateData?.price_details?.items.map((e=>t("div",{class:"s-bottom-alert-modal-content-price-details-item"},t("i",{innerHTML:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>check-circle</title>\n<path d="M19.557 11.26l-4.593 6.891-2.891-1.927c-0.616-0.411-1.441-0.243-1.849 0.369-0.409 0.612-0.244 1.441 0.369 1.849l4 2.667c0.228 0.152 0.485 0.224 0.739 0.224 0.431 0 0.855-0.208 1.111-0.593l5.333-8c0.409-0.612 0.244-1.441-0.369-1.849-0.616-0.411-1.443-0.243-1.849 0.369zM16 0c-8.823 0-16 7.177-16 16s7.177 16 16 16 16-7.177 16-16-7.177-16-16-16zM16 29.333c-7.352 0-13.333-5.981-13.333-13.333s5.981-13.333 13.333-13.333 13.333 5.981 13.333 13.333-5.981 13.333-13.333 13.333z"></path>\n</svg>\n',class:"s-bottom-alert-modal-content-price-details-item-icon"}),t("span",{class:"s-bottom-alert-modal-content-price-details-item-name"},e.name),t("span",{class:"s-bottom-alert-modal-content-price-details-item-price",innerHTML:salla.money(e.price)})))))]:""),this.templateData?.link?t("div",{class:"s-bottom-alert-modal-content-footer"},t("salla-button",{color:"primary",size:"medium",width:"wide",href:this.templateData?.link},t("i",{innerHTML:l}),this.buyTheTemplate)):"")]:"")}render(){const e=this.template&&"object"==typeof this.template&&Object.keys(this.template).length>0;return t(s,{key:"e5f273d72875760e30d99d419b247137583bc450",class:"s-bottom-alert-wrapper "+(e?"s-bottom-alert-wrapper-with-template":"")},e&&t("div",{key:"1db37d7c67aae449f41a9a3ed83489b2a0653cef",class:"s-bottom-alert-logo-section"},t("img",{key:"18701cd3d807042b4d852f283d43a6855282f791",src:"https://cdn.salla.network/images/logo/logo-light.svg",alt:"Salla",class:"s-bottom-alert-logo"}),t("span",{key:"66bb3f9b3c00aee5c2694d5ddb142e753ae7fa1a",class:"s-bottom-alert-logo-text"},this.readyStores)),t("div",{key:"01d47c9ec38370b83bdb3fdc29291f55e1b3aa42",class:"s-bottom-alert-content"},t("div",{key:"5380873bf9d393c0fa18da196e1bfb675a8c9c9b",class:"flex items-center gap-2"},t("div",{key:"882382de35a7c9a767e2eb90305c8a973d01ac21",class:"s-bottom-alert-icon"},t("i",this.icon?{class:this.icon}:{innerHTML:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>info</title>\n<path d="M16 13.333c-0.737 0-1.333 0.596-1.333 1.333v9.333c0 0.737 0.596 1.333 1.333 1.333s1.333-0.596 1.333-1.333v-9.333c0-0.737-0.596-1.333-1.333-1.333zM16 7.987c-0.737 0-1.333 0.596-1.333 1.333v0.013c0 0.737 0.596 1.327 1.333 1.327s1.333-0.603 1.333-1.34-0.596-1.333-1.333-1.333zM16 0c-8.823 0-16 7.177-16 16s7.177 16 16 16 16-7.177 16-16-7.177-16-16-16zM16 29.333c-7.352 0-13.333-5.981-13.333-13.333s5.981-13.333 13.333-13.333 13.333 5.981 13.333 13.333-5.981 13.333-13.333 13.333z"></path>\n</svg>\n'})),t("div",{key:"dfbaa427fd4e8b755a479e0b5459422e44a95f59",class:"s-bottom-alert-message"},this.message?this.message:e?t("span",{class:"flex flex-wrap items-center gap-1"},this.defaultMessage,t("span",{class:{"s-bottom-alert-message-highlight":!0},"aria-label":"Developer"},this.salla),t("span",{innerHTML:salla.money(this.template.price)})):this.defaultMessage)),"banner"!==this.type&&t("div",{key:"327ef4b5ecdab7d994418c033a78c2531eb28de5",class:e?"s-bottom-alert-actions-group":"s-bottom-alert-action"},e?this.loading?t("salla-loading",{size:"20"}):t("div",{class:"s-bottom-alert-actions-group-container"},t("a",{class:"s-bottom-alert-action-link",onClick:()=>this.handleAction()},this.actionLabel||this.moreDetailsLabel),this.templateData?.link?t("button",{type:"button",class:"s-bottom-alert-action-purchase-button",onClick:()=>window.open(this.templateData?.link,"_blank")},this.buyTheTemplate):null):t("salla-button",{href:this.actionUrl,size:"medium",onClick:()=>this.handleAction(),width:"normal"},this.actionLabel||this.defaultActionLabel)),"popup"===this.type&&this.popup()))}get host(){return a(this)}};n.style=":host{display:block}";export{i as salla_alert,n as salla_bottom_alert}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as t,h as s,H as e}from"./p-
|
|
4
|
+
import{r as t,h as s,H as e}from"./p-CLfrQ6bI.js";const r=class{constructor(s){t(this,s),this.parsedSections=[]}parseProducts(t){let s=[];if("string"==typeof t)try{const e=JSON.parse(t);s=this.extractSections(e)}catch(e){console.error("Invalid JSON passed to bundleSections prop:",t),s=[]}else t&&(s=this.extractSections(t));this.parsedSections=s}extractSections(t){return t.bundle&&t.bundle.sections&&Array.isArray(t.bundle.sections)?t.bundle.sections:Array.isArray(t)?t:t.sections&&Array.isArray(t.sections)?t.sections:(console.warn("No valid sections found in data:",t),[])}isCartPage(){return salla.url.is_page("cart")}renderCartPage(){return s("salla-multiple-bundle-product-cart",{sections:this.parsedSections})}renderDetailsPage(){return s("salla-multiple-bundle-product-details",{sections:this.parsedSections})}componentWillLoad(){this.parseProducts(this.bundleSections)}render(){return s(e,{key:"05c5e7d3b7d18f23e66f3d95a04f16ab266e99a1",class:"s-multiple-bundle-product-wrapper"},this.isCartPage()?this.renderCartPage():this.renderDetailsPage())}static get watchers(){return{bundleSections:["parseProducts"]}}};r.style=":host{display:block}";export{r as salla_multiple_bundle_product}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as e,h as t,H as s}from"./p-
|
|
4
|
+
import{r as e,h as t,H as s}from"./p-CLfrQ6bI.js";const a=class{constructor(t){e(this,t),this.href=void 0,this.target="_self"}generateClass(){return{"s-list-tile-item":!0,"s-list-tile-item-href":!!this.href}}render(){return t(s,{key:"c66af50f4293094425640dd48246a973a240687b"},t("a",{key:"5f2969fa28b312b2df0aa8f4ea93476f3d46f415",class:this.generateClass(),href:this.href||"#",target:this.target,"aria-label":"List Tile Link"},t("div",{key:"4b92b66742957d2cb1d0961f78912ee28fd156d2",class:"s-list-tile-item-icon"},t("slot",{key:"8593c413f0f7ed60d5f5b2e80a1e10880b6fd063",name:"icon"})),t("div",{key:"469efd30ddfd208c1b73b6fc4485ae7fae11f914",class:"s-list-tile-item-content"},t("div",{key:"e5bebc43345b3921597d73020948ed5f913974e8",class:"s-list-tile-item-title"},t("slot",{key:"306e82cccd99c6a8341c23fc5f8f35c5a656a088",name:"title"})),t("div",{key:"b148fbbc417ff3e174833a91c8b852525f6cacc1",class:"s-list-tile-item-subtitle"},t("slot",{key:"44ef5d6b3aae8a7b511244be00c12700605c596a",name:"subtitle"}))),t("div",{key:"8cfd1fa5145a3b2adf7eb1da27f1cf96d7d96780",class:"s-list-tile-item-action"},t("slot",{key:"47db71ae396cfc1cbdeb9fd7fd643afefd1af5db",name:"action"}))))}};a.style="";export{a as salla_list_tile}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as s,c as t,h as i,H as e,a as h}from"./p-
|
|
4
|
+
import{r as s,c as t,h as i,H as e,a as h}from"./p-CLfrQ6bI.js";import{H as a}from"./p-CHf8XdiS.js";import{F as l}from"./p-DL4h2bc3.js";import"./p-CgtvEd63.js";const r=class{constructor(i){s(this,i),this.changed=t(this,"changed"),this.initialItemCount=10,this.expandedItemCount=15,this.calculatedInitialHeight=0,this.calculatedExpandedHeight=0,this.isOpen=!0,this.isShowMore=!1,this.showMoreLabel="عرض المزيد",this.showLessLabel="عرض أقل",this.page=salla.config.get("page"),this.searchQuery="",this.filteredCount=0}connectedCallback(){this.withLoadMore="price"!=this.option.key&&Array.isArray(this.option.values)&&this.option.values.length>this.initialItemCount,salla.onReady((()=>{this.page=salla.config.get("page")})),salla.lang.onLoaded((()=>{this.showMoreLabel=salla.lang.getWithDefault("common.titles.more",this.showMoreLabel),this.showLessLabel=salla.lang.getWithDefault("common.elements.show_less",this.showLessLabel)}))}componentDidLoad(){const s=this.widgetValues.querySelectorAll(".s-filters-label");if(s.length>0){const t=Math.min(this.initialItemCount,s.length);this.calculatedInitialHeight=35*this.initialItemCount,this.calculatedExpandedHeight=s.length>this.initialItemCount?35*this.expandedItemCount:35*t}this.widgetValues.scrollHeight<this.calculatedInitialHeight&&(this.withLoadMore=!1),this.withLoadMore&&this.widgetValues&&(this.widgetValues.style.maxHeight=`${this.calculatedInitialHeight}px`),this.widgetContent.style.height=`${this.widgetContent.scrollHeight}px`}async setWidgetHeight(s=250){this.widgetContent.removeAttribute("style"),setTimeout((()=>{this.widgetContent.style.height=this.widgetContent.scrollHeight+"px"}),s)}async reset(){this.option.type===l.RANGE&&this.priceRange.reset(),Array.from(this.host.querySelectorAll("input")).forEach((s=>s.checked=!1))}async showMore(){this.isShowMore=!this.isShowMore,this.widgetContent.style.height="auto",this.isShowMore||(this.widgetValues.scrollTop=0);const s=this.isShowMore?this.calculatedExpandedHeight:this.calculatedInitialHeight,t=this.searchQuery?this.filteredCount:Array.isArray(this.option.values)?this.option.values.length:0;this.widgetValues.style.maxHeight=`${s}px`,this.widgetValues.style.overflowY=this.isShowMore&&t>this.expandedItemCount?"auto":"hidden",setTimeout((()=>{this.widgetContent.style.height=`${this.widgetContent.scrollHeight}px`}),400)}async toggleWidget(){this.isOpen=!this.isOpen,a.toggleElementClassIf(this.widgetContent,"s-filters-widget-opened","s-filters-widget-closed",(()=>this.isOpen))}renderFilterOption(s){if(![l.VALUES,l.MINIMUM,l.VARIANTS].includes(s.type))return"";const t=s.values.filter((s=>{if(!this.searchQuery)return!0;const t="number"==typeof s?String(s):s?.value||s?.key||"";return String(t).toLowerCase().includes(this.searchQuery.toLowerCase())}));return this.filteredCount=t.length,0===t.length?i("div",{class:"s-filters-widget-empty-state"},salla.lang.get("common.elements.no_options")||"لا توجد نتائج"):t.map((t=>{let e="number"==typeof t?t:t.key||t.value;return i("label",{class:"s-filters-label",htmlFor:`${s.key}-option-${e}`,key:`${s.key}-option-${e}`},i("input",{id:`${s.key}-option-${e}`,name:s.key,type:"radio",checked:this.isSelectedOption(s,e),class:"s-filters-radio",onChange:t=>this.changed.emit({event:t,option:s,value:e})}),this.getOptionLabel(s,t))}))}isSelectedOption(s,t){return s.type===l.MINIMUM?this.filtersData[s.key]==t:s.type===l.VARIANTS?this.filtersData[s.type]&&this.filtersData[s.type][Object.keys(this.filtersData[s.type])[0]]==t:s.type===l.RANGE?this.filtersData[s.key]&&this.filtersData[s.key].min==t.min&&this.filtersData[s.key].max==t.max:s.type===l.VALUES&&this.filtersData[s.key]&&Number(this.filtersData[s.key])==Number(t)}getOptionLabel(s,t){return"rating"==s.key?i("salla-rating-stars",{size:"small",value:t}):i("span",{class:"s-filters-option-name"},t.value||"null")}render(){return i(e,{key:"aaa423868d5ecd62a1d3dbb05a5143f7983e15ab",class:"s-filters-widget-container"},i("h3",{key:"444a72e027f870fcd3f2fb01d8a52d642b1d6fab",class:"s-filters-widget-title",onClick:()=>this.toggleWidget()},i("span",{key:"1813e58218aefebecdd0b2d8af9ce89ce5c17b9f"},this.option.label),i("span",{key:"11926f6d1343095b29c93f010b99cfc07152918a",class:"s-filters-widget-plusminus "+(this.isOpen?"s-filters-widget-plusminus-active":"")})),i("div",{key:"24f151541c5da697d157f6f110fb640b316ad533",class:"s-filters-widget-content",ref:s=>this.widgetContent=s},Array.isArray(this.option.values)&&this.option.values.length>5&&i("div",{key:"12b4adb00888f657f9d67f84b377634190e0cedd",class:"s-filters-widget-search-wrapper",style:{padding:"8px 0",marginBottom:"8px"}},i("input",{key:"b14ff87ad64e594c3120be3b5e5d102c8d74cd98",type:"text",class:"s-filters-widget-search-input",placeholder:salla.lang.get("blocks.header.search_placeholder")||"بحث...",value:this.searchQuery,onInput:s=>this.searchQuery=s.target.value})),i("div",{key:"9a9f76a9ca1a9ae7e474dcf771e0a58936dee7d7",class:"s-filters-widget-values",ref:s=>this.widgetValues=s},i("slot",{key:"020b614afb9c6ca5aadfccafe748e73e8f2fa77a"}),this.option.type!==l.RANGE?this.renderFilterOption(this.option):i("salla-price-range",{onChanged:s=>{this.changed.emit(s.detail)},ref:s=>this.priceRange=s,filtersData:this.filtersData,option:this.option})),this.withLoadMore&&(!this.searchQuery||this.filteredCount>this.initialItemCount)&&i("a",{key:"4d03eccbc3b357444e27d61c647b09d435ceb1be",class:"s-filters-widget-more",onClick:()=>this.showMore()},this.isShowMore?this.showLessLabel:this.showMoreLabel)))}get host(){return h(this)}};r.style=":host{display:block}";export{r as salla_filters_widget}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as t,h as a,H as i,a as s}from"./p-BydBx2Hz.js";const e=class{constructor(a){t(this,a),this.tabbyBorderRemoved=!1,this.tabbyRemoveBorderTries=0,this.language=salla.config.get("user.language_code"),this.currency=salla.config.get("user.currency_code"),this.country=salla.config.get("user.country_code"),this.installment_sheria_text=(t,a)=>salla.lang.get(t,a)}async componentWillLoad(){await salla.onReady(),await salla.lang.onLoaded(),this.currency=salla.config.get("user.currency_code")||"SAR",this.language=salla.config.get("user.language_code")||"ar",this.country=salla.config.get("user.country_code")||"SA",[{key:"pages.products.installments",installments:3},{key:"pages.products.installments_emkan",installments:5}].forEach((t=>{this.installment_sheria_text(t.key,{payment:salla.money(parseFloat(this.price)),amount:salla.money((parseFloat(this.price)/t.installments).toFixed(2)).replace(/\.00$/,""),installments:t.installments})}));const t=salla.config.get("store.settings.installments");t&&(this.tamaraIsActive=t.tamara,this.tabbyIsActive=t.tabby,this.spotiiIsActive=t.spotii,this.mispayActive=t.mispay,this.emkanIsActive=t.emkan,this.madfuActive=t.madfu,this.rajehiIsActive=t.mokafaa_alrajhi),salla.event.on("product::price.updated",(({data:t})=>{t.price&&t.price!=this.price&&(this.price=t.price,this.renderInstallments(!0))}))}componentDidLoad(){this.renderInstallments()}render(){const t="SAR"===this.currency;return this.isValidPrice(this.price)?a(i,null,this.tamaraIsActive&&(this.tamaraIsActive?.publicKey?a("div",{class:"mb-5"},a("tamara-widget",{type:"tamara-summary","inline-type":"2",amount:this.price})):a("div",{class:"tamara-product-widget","data-price":this.price,"data-currency":this.currency,"data-lang":this.language,"data-payment-type":"installment"})),this.tabbyIsActive?a("div",{id:"tabbyPromoWrapper"},a("div",{id:"tabbyPromo"})):"",this.spotiiIsActive?a("div",{class:"spotii-wrapper"},a("div",{class:"spotii-promo"})):"",this.shouldShowMispay()&&(this.mispayActive.publicKey?a("div",{class:"mb-5"},a("mispay-widget",{amount:this.price,lang:this.language})):a("div",{class:"s-installment-mispay-wrapper"},a("div",{class:"s-installment-mispay-content"},a("img",{src:salla.url.cdn("images/payment/png/mispay.png"),alt:"mispay"}),a("span",{class:"s-installment-mispay-content-text",innerHTML:this.installment_sheria_text("pages.products.installments",{payment:salla.money(parseFloat(this.price)),amount:salla.money((parseFloat(this.price)/4).toFixed(2)),installments:4})})))),this.emkanIsActive&&"SAR"===this.currency?a("div",{class:"s-installment-emkan-wrapper"},a("div",{class:"s-installment-emkan-content"},a("img",{src:salla.url.cdn("images/payment/png/emkan.png"),alt:"emkan"}),a("span",{class:"s-installment-emkan-content-text",innerHTML:this.installment_sheria_text("pages.products.installments_emkan",{payment:salla.money(parseFloat(this.price)),installments:5})}))):"",this.madfuActive&&"SAR"===this.currency?a("div",{class:"s-installment-madfu-wrapper"},a("div",{class:"s-installment-madfu-content"},a("img",{src:salla.url.cdn("images/payment/png/madfu.png"),alt:"madfu"}),a("span",{class:"s-installment-madfu-content-text"},salla.lang.get("pages.products.installments_madfu")))):"",t&&this.rajehiIsActive?a("div",{class:"s-installment-rajehi-wrapper"},a("div",{class:"s-installment-rajehi-content"},a("img",{src:salla.url.cdn("images/payment/png/mokafaa_alrajhi_loyalty.png"),alt:"mokafaa_alrajhi_loyalty"}),a("span",{class:"s-installment-rajehi-content-text"},salla.lang.get("pages.products.rajahi_earn_points",{points:Math.floor(+this.price*this.rajehiIsActive.pointsPerRiyal)})))):""):""}renderInstallments(t=!1){if(this.isValidPrice(this.price)){if(this.tamaraIsActive&&this.loadTamara({isUpdating:t}),this.tabbyIsActive){if(t){var a=this.host.querySelector("#tabbyPromoWrapper");a&&a.remove();var i=document.createElement("div");i.setAttribute("id","tabbyPromoWrapper");var s=document.createElement("div");s.setAttribute("id","tabbyPromo"),i.appendChild(s),this.host.appendChild(i);var e=document.querySelector('script[src="https://checkout.tabby.ai/tabby-promo.js"]');e&&e.remove()}var n=document.createElement("script");n.setAttribute("src","https://checkout.tabby.ai/tabby-promo.js"),document.head.appendChild(n),n.onload=()=>{new(0,window.TabbyPromo)({selector:"#tabbyPromo",currency:this.currency,price:this.price,lang:this.language,publicKey:salla.config.get("store.settings.installments.tabby.publicKey"),merchantCode:salla.config.get("store.settings.installments.tabby.merchantCode")}),document.querySelectorAll(".tabby-promo-snippet__logo").forEach((function(t){t.setAttribute("aria-label","Tabby Logo")}))},this.removeTabbyBorder()}if(this.spotiiIsActive){if(t){var r=this.host.querySelector(".spotii-wrapper");r&&r.remove();var o=document.createElement("div");o.classList.add("spotii-wrapper");var l=document.createElement("div");l.classList.add("spotii-promo"),o.appendChild(l),this.host.appendChild(o);var p=document.querySelector('script[src="'+salla.url.cdn("js/price-widget-ar-salla.js")+'"]');p&&p.remove()}let a=salla.money((Number(this.price)/3).toFixed(2),!1),i=salla.config.get("theme.is_rtl",!0);window.spotiiConfig={targetXPath:[".spotii-wrapper"],renderToPath:[".spotii-promo"],numberOfPayment:3,currency:this.currency,templateLine:"${textOne} ${number} ${textTwo} "+a+"${logo} ${info}",textOne:i?"جزء الدفع على":"Split it into",textTwo:i?"أقساط متساوية بدون تكاليف اضافية بقيمة":"payments of",textThree:"مع",price:this.price};var m=document.createElement("script");m.setAttribute("src",salla.url.cdn("js/price-widget-ar-salla.js")),document.head.appendChild(m)}this.shouldShowMispay()&&this.mispayActive.publicKey&&this.loadExternalScript({position:"head",src:`https://widget.mispay.co/v1/sdk.js?authorize=${this.mispayActive.publicKey}`})}}isValidPrice(t){const a=/^\d+(\.\d{1,2})?$/.test(t),i=parseFloat(t)>0;return a&&i}loadExternalScript({src:t,onLoad:a,position:i}){const s=document.createElement("script");s.src=t,s.onload=a,document[i].appendChild(s)}loadTamara({isUpdating:t}){const a=!!this.tamaraIsActive?.publicKey;if(t)setTimeout((()=>{if(a)return window.TamaraWidgetV2?.refresh();window.TamaraProductWidget?.render()}),300);else if(a){const t=salla.config.get("user.language_code"),a=["ar","en"].includes(t)?t:"ar",i=this.currency?.slice(0,-1),s=["SA","AE","KW","BH","OM","QA"].includes(i)?i:null;s?(window.tamaraWidgetConfig={lang:a,country:s,publicKey:this.tamaraIsActive.publicKey,style:{fontSize:"14px"}},this.loadExternalScript({position:"head",src:"https://cdn.tamara.co/widget-v2/tamara-widget.js"})):console.error("Tamara: Country code is not supported",i)}else this.loadExternalScript({position:"head",src:"https://cdn.tamara.co/widget/product-widget.min.js",onLoad:()=>{window.TamaraProductWidget.init({lang:this.language}),setTimeout((()=>{window.TamaraProductWidget.render()}),300)}})}shouldShowMispay(){return"SAR"===this.currency&&this.mispayActive}removeTabbyBorder(){this.tabbyBorderRemoved||this.tabbyRemoveBorderTries>5||(this.tabbyRemoveBorderTries++,setTimeout((()=>{let t=document.querySelector("#tabbyPromo>div>div");t=t&&t.shadowRoot?t.shadowRoot.querySelector('div[class^="styles__tabby-promo-snippet--"]'):null,t?(t.style="border: none; margin: 15px 0!important;",this.tabbyBorderRemoved=!0):this.removeTabbyBorder()}),500*this.tabbyRemoveBorderTries))}get host(){return s(this)}};e.style="salla-installment:empty{display:none}#tabbyPromoWrapper{background:white;border-radius:0.375rem;transition:box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);margin-bottom:20px;border:unset !important;font-weight:500}.salla-y #tabbyPromoWrapper{border:1px solid var(--color-grey-dark);border-radius:12px}#tabbyPromoWrapper:hover{box-shadow:0 0 rgba(0, 0, 0, 0), 0 0 rgba(0, 0, 0, 0), 5px 10px 30px rgba(43, 45, 52, 0.0509803922)}#tabbyPromoWrapper #tabbyPromo *{font-family:var(--font-main)}#tabbyPromoWrapper #tabbyPromo>div>div{max-width:none;box-shadow:none;border:none}#tabbyPromoWrapper #tabbyPromo .tabby-promo-snippet{max-width:100%;min-height:100px;padding:18px 20px;border:none !important}#tabbyPromoWrapper #tabbyPromo .tabby-promo-snippet__text,#tabbyPromoWrapper #tabbyPromo .tabby-promo-snippet__link{font-size:var(--font-sm);color:var(--color-text) !important}#tabbyPromoWrapper #tabbyPromo .tabby-promo-snippet__link{font-weight:bold}.tabby-promo-wrapper #tabby-promo{font-family:var(--font-main) !important}.tabby-promo-wrapper #tabby-promo .tabby-promo__feature-title{font-size:var(--font-md)}.tabby-promo-wrapper #tabby-promo .tabby-promo__feature-desc{font-size:var(--font-sm);line-height:20px}.tamara-product-widget{margin-bottom:20px}.tamara-product-widget,.spotii-wrapper{min-height:100px;position:relative;color:var(--main-text-color);font-size:var(--font-sm);line-height:1.25;padding:20px 20px 20px 115px !important;background:white;border-radius:0.375rem;transition:box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);border:unset !important;font-family:inherit !important;font-weight:500}.salla-y .tamara-product-widget,.salla-y .spotii-wrapper{border-radius:12px;border:1px solid var(--color-grey-dark)}.tamara-product-widget:hover,.spotii-wrapper:hover{box-shadow:0 0 rgba(0, 0, 0, 0), 0 0 rgba(0, 0, 0, 0), 5px 10px 30px rgba(43, 45, 52, 0.0509803922)}.tamara-product-widget .spotii-logo,.spotii-wrapper .spotii-logo{float:left;margin:0 0 0 -75px}.ltr .tamara-product-widget,.ltr .spotii-wrapper{text-align:left;padding:18px 100px 18px 20px !important}.ltr .tamara-product-widget .spotii-logo,.ltr .spotii-wrapper .spotii-logo{float:right;margin:0 -75px 0 0}.ltr .tamara-product-widget .spotii-product-widget,.ltr .spotii-wrapper .spotii-product-widget{text-align:left !important}.spotii-wrapper{margin-bottom:20px}.spotii-wrapper .spotii-promo{font-size:var(--font-md)}.spotii-wrapper .spotii-product-widget{font-size:var(--font-sm) !important;margin-top:10px}.tamara-product-widget .tamara-logo{position:absolute;left:20px !important;top:35px !important;margin:0 !important;height:24px !important}.ltr .tamara-product-widget .tamara-logo{right:20px !important;left:auto !important}.tamara-product-widget span{font-family:var(--font-main);font-size:var(--font-sm);color:var(--color-text)}.tamara-product-widget span:last-child{display:block;position:relative;margin-top:8px}.tamara-popup__wrap{overflow:auto !important}.s-installment-mispay-wrapper,.s-installment-madfu-wrapper,.s-installment-emkan-wrapper,.s-installment-rajehi-wrapper{font-size:14px;text-align:right;padding:20px;gap:42px;line-height:22px;color:rgb(0, 0, 0);min-width:100%;box-sizing:border-box;position:relative;background-color:white;border-radius:10px;margin:15px 0;display:flex;transition:box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1)}.s-installment-mispay-wrapper:hover,.s-installment-madfu-wrapper:hover,.s-installment-emkan-wrapper:hover,.s-installment-rajehi-wrapper:hover{box-shadow:0 0 rgba(0, 0, 0, 0), 0 0 rgba(0, 0, 0, 0), 5px 10px 30px rgba(43, 45, 52, 0.0509803922)}.s-installment-mispay-content,.s-installment-madfu-content,.s-installment-emkan-content,.s-installment-rajehi-content{display:flex;flex-direction:row-reverse;width:100%;justify-content:space-between;align-items:center;gap:1rem}.s-installment-mispay-content-text,.s-installment-madfu-content-text,.s-installment-emkan-content-text,.s-installment-rajehi-content-text{color:var(--main-text-color);font-size:14px;font-weight:500;margin:0 16px 0 0;width:80%;left:14px;text-align:left}.s-installment-mispay-content img,.s-installment-madfu-content img,.s-installment-emkan-content img,.s-installment-rajehi-content img{height:28px;width:70px;display:inline-block;max-height:100%;vertical-align:middle;fill:none;stroke:unset;width:auto}.rtl .s-installment-mispay-content-text,.rtl .s-installment-madfu-content-text,.rtl .s-installment-emkan-content-text,.rtl .s-installment-rajehi-content-text{right:14px;text-align:right;margin:0 0 0 16px}.rtl .s-installment-mispay-content img,.rtl .s-installment-madfu-content img,.rtl .s-installment-emkan-content img,.rtl .s-installment-rajehi-content img{left:14px !important}.ltr .s-installment-mispay-content img,.ltr .s-installment-madfu-content img,.ltr .s-installment-emkan-content img,.ltr .s-installment-rajehi-content img{right:14px !important}.s-installment-rajehi-content img{width:70px !important;height:40px !important}.s-installment-emkan-content img{height:35px !important}";export{e as salla_installment}
|
|
4
|
+
import{r as t,h as a,H as i,a as s}from"./p-CLfrQ6bI.js";const e=class{constructor(a){t(this,a),this.tabbyBorderRemoved=!1,this.tabbyRemoveBorderTries=0,this.language=salla.config.get("user.language_code"),this.currency=salla.config.get("user.currency_code"),this.country=salla.config.get("user.country_code"),this.installment_sheria_text=(t,a)=>salla.lang.get(t,a)}async componentWillLoad(){await salla.onReady(),await salla.lang.onLoaded(),this.currency=salla.config.get("user.currency_code")||"SAR",this.language=salla.config.get("user.language_code")||"ar",this.country=salla.config.get("user.country_code")||"SA",[{key:"pages.products.installments",installments:3},{key:"pages.products.installments_emkan",installments:5}].forEach((t=>{this.installment_sheria_text(t.key,{payment:salla.money(parseFloat(this.price)),amount:salla.money((parseFloat(this.price)/t.installments).toFixed(2)).replace(/\.00$/,""),installments:t.installments})}));const t=salla.config.get("store.settings.installments");t&&(this.tamaraIsActive=t.tamara,this.tabbyIsActive=t.tabby,this.spotiiIsActive=t.spotii,this.mispayActive=t.mispay,this.emkanIsActive=t.emkan,this.madfuActive=t.madfu,this.rajehiIsActive=t.mokafaa_alrajhi),salla.event.on("product::price.updated",(({data:t})=>{t.price&&t.price!=this.price&&(this.price=t.price,this.renderInstallments(!0))}))}componentDidLoad(){this.renderInstallments()}render(){const t="SAR"===this.currency;return this.isValidPrice(this.price)?a(i,null,this.tamaraIsActive&&(this.tamaraIsActive?.publicKey?a("div",{class:"mb-5"},a("tamara-widget",{type:"tamara-summary","inline-type":"2",amount:this.price})):a("div",{class:"tamara-product-widget","data-price":this.price,"data-currency":this.currency,"data-lang":this.language,"data-payment-type":"installment"})),this.tabbyIsActive?a("div",{id:"tabbyPromoWrapper"},a("div",{id:"tabbyPromo"})):"",this.spotiiIsActive?a("div",{class:"spotii-wrapper"},a("div",{class:"spotii-promo"})):"",this.shouldShowMispay()&&(this.mispayActive.publicKey?a("div",{class:"mb-5"},a("mispay-widget",{amount:this.price,lang:this.language})):a("div",{class:"s-installment-mispay-wrapper"},a("div",{class:"s-installment-mispay-content"},a("img",{src:salla.url.cdn("images/payment/png/mispay.png"),alt:"mispay"}),a("span",{class:"s-installment-mispay-content-text",innerHTML:this.installment_sheria_text("pages.products.installments",{payment:salla.money(parseFloat(this.price)),amount:salla.money((parseFloat(this.price)/4).toFixed(2)),installments:4})})))),this.emkanIsActive&&"SAR"===this.currency?a("div",{class:"s-installment-emkan-wrapper"},a("div",{class:"s-installment-emkan-content"},a("img",{src:salla.url.cdn("images/payment/png/emkan.png"),alt:"emkan"}),a("span",{class:"s-installment-emkan-content-text",innerHTML:this.installment_sheria_text("pages.products.installments_emkan",{payment:salla.money(parseFloat(this.price)),installments:5})}))):"",this.madfuActive&&"SAR"===this.currency?a("div",{class:"s-installment-madfu-wrapper"},a("div",{class:"s-installment-madfu-content"},a("img",{src:salla.url.cdn("images/payment/png/madfu.png"),alt:"madfu"}),a("span",{class:"s-installment-madfu-content-text"},salla.lang.get("pages.products.installments_madfu")))):"",t&&this.rajehiIsActive?a("div",{class:"s-installment-rajehi-wrapper"},a("div",{class:"s-installment-rajehi-content"},a("img",{src:salla.url.cdn("images/payment/png/mokafaa_alrajhi_loyalty.png"),alt:"mokafaa_alrajhi_loyalty"}),a("span",{class:"s-installment-rajehi-content-text"},salla.lang.get("pages.products.rajahi_earn_points",{points:Math.floor(+this.price*this.rajehiIsActive.pointsPerRiyal)})))):""):""}renderInstallments(t=!1){if(this.isValidPrice(this.price)){if(this.tamaraIsActive&&this.loadTamara({isUpdating:t}),this.tabbyIsActive){if(t){var a=this.host.querySelector("#tabbyPromoWrapper");a&&a.remove();var i=document.createElement("div");i.setAttribute("id","tabbyPromoWrapper");var s=document.createElement("div");s.setAttribute("id","tabbyPromo"),i.appendChild(s),this.host.appendChild(i);var e=document.querySelector('script[src="https://checkout.tabby.ai/tabby-promo.js"]');e&&e.remove()}var n=document.createElement("script");n.setAttribute("src","https://checkout.tabby.ai/tabby-promo.js"),document.head.appendChild(n),n.onload=()=>{new(0,window.TabbyPromo)({selector:"#tabbyPromo",currency:this.currency,price:this.price,lang:this.language,publicKey:salla.config.get("store.settings.installments.tabby.publicKey"),merchantCode:salla.config.get("store.settings.installments.tabby.merchantCode")}),document.querySelectorAll(".tabby-promo-snippet__logo").forEach((function(t){t.setAttribute("aria-label","Tabby Logo")}))},this.removeTabbyBorder()}if(this.spotiiIsActive){if(t){var r=this.host.querySelector(".spotii-wrapper");r&&r.remove();var o=document.createElement("div");o.classList.add("spotii-wrapper");var l=document.createElement("div");l.classList.add("spotii-promo"),o.appendChild(l),this.host.appendChild(o);var p=document.querySelector('script[src="'+salla.url.cdn("js/price-widget-ar-salla.js")+'"]');p&&p.remove()}let a=salla.money((Number(this.price)/3).toFixed(2),!1),i=salla.config.get("theme.is_rtl",!0);window.spotiiConfig={targetXPath:[".spotii-wrapper"],renderToPath:[".spotii-promo"],numberOfPayment:3,currency:this.currency,templateLine:"${textOne} ${number} ${textTwo} "+a+"${logo} ${info}",textOne:i?"جزء الدفع على":"Split it into",textTwo:i?"أقساط متساوية بدون تكاليف اضافية بقيمة":"payments of",textThree:"مع",price:this.price};var m=document.createElement("script");m.setAttribute("src",salla.url.cdn("js/price-widget-ar-salla.js")),document.head.appendChild(m)}this.shouldShowMispay()&&this.mispayActive.publicKey&&this.loadExternalScript({position:"head",src:`https://widget.mispay.co/v1/sdk.js?authorize=${this.mispayActive.publicKey}`})}}isValidPrice(t){const a=/^\d+(\.\d{1,2})?$/.test(t),i=parseFloat(t)>0;return a&&i}loadExternalScript({src:t,onLoad:a,position:i}){const s=document.createElement("script");s.src=t,s.onload=a,document[i].appendChild(s)}loadTamara({isUpdating:t}){const a=!!this.tamaraIsActive?.publicKey;if(t)setTimeout((()=>{if(a)return window.TamaraWidgetV2?.refresh();window.TamaraProductWidget?.render()}),300);else if(a){const t=salla.config.get("user.language_code"),a=["ar","en"].includes(t)?t:"ar",i=this.currency?.slice(0,-1),s=["SA","AE","KW","BH","OM","QA"].includes(i)?i:null;s?(window.tamaraWidgetConfig={lang:a,country:s,publicKey:this.tamaraIsActive.publicKey,style:{fontSize:"14px"}},this.loadExternalScript({position:"head",src:"https://cdn.tamara.co/widget-v2/tamara-widget.js"})):console.error("Tamara: Country code is not supported",i)}else this.loadExternalScript({position:"head",src:"https://cdn.tamara.co/widget/product-widget.min.js",onLoad:()=>{window.TamaraProductWidget.init({lang:this.language}),setTimeout((()=>{window.TamaraProductWidget.render()}),300)}})}shouldShowMispay(){return"SAR"===this.currency&&this.mispayActive}removeTabbyBorder(){this.tabbyBorderRemoved||this.tabbyRemoveBorderTries>5||(this.tabbyRemoveBorderTries++,setTimeout((()=>{let t=document.querySelector("#tabbyPromo>div>div");t=t&&t.shadowRoot?t.shadowRoot.querySelector('div[class^="styles__tabby-promo-snippet--"]'):null,t?(t.style="border: none; margin: 15px 0!important;",this.tabbyBorderRemoved=!0):this.removeTabbyBorder()}),500*this.tabbyRemoveBorderTries))}get host(){return s(this)}};e.style="salla-installment:empty{display:none}#tabbyPromoWrapper{background:white;border-radius:0.375rem;transition:box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);margin-bottom:20px;border:unset !important;font-weight:500}.salla-y #tabbyPromoWrapper{border:1px solid var(--color-grey-dark);border-radius:12px}#tabbyPromoWrapper:hover{box-shadow:0 0 rgba(0, 0, 0, 0), 0 0 rgba(0, 0, 0, 0), 5px 10px 30px rgba(43, 45, 52, 0.0509803922)}#tabbyPromoWrapper #tabbyPromo *{font-family:var(--font-main)}#tabbyPromoWrapper #tabbyPromo>div>div{max-width:none;box-shadow:none;border:none}#tabbyPromoWrapper #tabbyPromo .tabby-promo-snippet{max-width:100%;min-height:100px;padding:18px 20px;border:none !important}#tabbyPromoWrapper #tabbyPromo .tabby-promo-snippet__text,#tabbyPromoWrapper #tabbyPromo .tabby-promo-snippet__link{font-size:var(--font-sm);color:var(--color-text) !important}#tabbyPromoWrapper #tabbyPromo .tabby-promo-snippet__link{font-weight:bold}.tabby-promo-wrapper #tabby-promo{font-family:var(--font-main) !important}.tabby-promo-wrapper #tabby-promo .tabby-promo__feature-title{font-size:var(--font-md)}.tabby-promo-wrapper #tabby-promo .tabby-promo__feature-desc{font-size:var(--font-sm);line-height:20px}.tamara-product-widget{margin-bottom:20px}.tamara-product-widget,.spotii-wrapper{min-height:100px;position:relative;color:var(--main-text-color);font-size:var(--font-sm);line-height:1.25;padding:20px 20px 20px 115px !important;background:white;border-radius:0.375rem;transition:box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);border:unset !important;font-family:inherit !important;font-weight:500}.salla-y .tamara-product-widget,.salla-y .spotii-wrapper{border-radius:12px;border:1px solid var(--color-grey-dark)}.tamara-product-widget:hover,.spotii-wrapper:hover{box-shadow:0 0 rgba(0, 0, 0, 0), 0 0 rgba(0, 0, 0, 0), 5px 10px 30px rgba(43, 45, 52, 0.0509803922)}.tamara-product-widget .spotii-logo,.spotii-wrapper .spotii-logo{float:left;margin:0 0 0 -75px}.ltr .tamara-product-widget,.ltr .spotii-wrapper{text-align:left;padding:18px 100px 18px 20px !important}.ltr .tamara-product-widget .spotii-logo,.ltr .spotii-wrapper .spotii-logo{float:right;margin:0 -75px 0 0}.ltr .tamara-product-widget .spotii-product-widget,.ltr .spotii-wrapper .spotii-product-widget{text-align:left !important}.spotii-wrapper{margin-bottom:20px}.spotii-wrapper .spotii-promo{font-size:var(--font-md)}.spotii-wrapper .spotii-product-widget{font-size:var(--font-sm) !important;margin-top:10px}.tamara-product-widget .tamara-logo{position:absolute;left:20px !important;top:35px !important;margin:0 !important;height:24px !important}.ltr .tamara-product-widget .tamara-logo{right:20px !important;left:auto !important}.tamara-product-widget span{font-family:var(--font-main);font-size:var(--font-sm);color:var(--color-text)}.tamara-product-widget span:last-child{display:block;position:relative;margin-top:8px}.tamara-popup__wrap{overflow:auto !important}.s-installment-mispay-wrapper,.s-installment-madfu-wrapper,.s-installment-emkan-wrapper,.s-installment-rajehi-wrapper{font-size:14px;text-align:right;padding:20px;gap:42px;line-height:22px;color:rgb(0, 0, 0);min-width:100%;box-sizing:border-box;position:relative;background-color:white;border-radius:10px;margin:15px 0;display:flex;transition:box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1)}.s-installment-mispay-wrapper:hover,.s-installment-madfu-wrapper:hover,.s-installment-emkan-wrapper:hover,.s-installment-rajehi-wrapper:hover{box-shadow:0 0 rgba(0, 0, 0, 0), 0 0 rgba(0, 0, 0, 0), 5px 10px 30px rgba(43, 45, 52, 0.0509803922)}.s-installment-mispay-content,.s-installment-madfu-content,.s-installment-emkan-content,.s-installment-rajehi-content{display:flex;flex-direction:row-reverse;width:100%;justify-content:space-between;align-items:center;gap:1rem}.s-installment-mispay-content-text,.s-installment-madfu-content-text,.s-installment-emkan-content-text,.s-installment-rajehi-content-text{color:var(--main-text-color);font-size:14px;font-weight:500;margin:0 16px 0 0;width:80%;left:14px;text-align:left}.s-installment-mispay-content img,.s-installment-madfu-content img,.s-installment-emkan-content img,.s-installment-rajehi-content img{height:28px;width:70px;display:inline-block;max-height:100%;vertical-align:middle;fill:none;stroke:unset;width:auto}.rtl .s-installment-mispay-content-text,.rtl .s-installment-madfu-content-text,.rtl .s-installment-emkan-content-text,.rtl .s-installment-rajehi-content-text{right:14px;text-align:right;margin:0 0 0 16px}.rtl .s-installment-mispay-content img,.rtl .s-installment-madfu-content img,.rtl .s-installment-emkan-content img,.rtl .s-installment-rajehi-content img{left:14px !important}.ltr .s-installment-mispay-content img,.ltr .s-installment-madfu-content img,.ltr .s-installment-emkan-content img,.ltr .s-installment-rajehi-content img{right:14px !important}.s-installment-rajehi-content img{width:70px !important;height:40px !important}.s-installment-emkan-content img{height:35px !important}";export{e as salla_installment}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as t,c as s,h as e,H as i}from"./p-BydBx2Hz.js";import{S as l}from"./p-BscTeWDc.js";import{L as a}from"./p-BO5AoBAP.js";import{a as n,A as r}from"./p-Vqpj4CWE.js";const o="BulletDeliveryAPI",d=t=>{const s=null==t?Number.NaN:Number(t);return!Number.isNaN(s)&&0!==s};async function h(t,s,e){try{return await t()}catch(t){return console.error(`${o}: ${e}`,t),s}}const c=t=>"SA"===String(t).toUpperCase(),u={getCountries:async(t=!1)=>h((async()=>((await salla.api.request("shipping/countries",{params:{for_branch:t?1:0}}))?.data??[]).map((t=>({id:t.id,code:t.code,name:t.name,has_regions:c(t.code)})))),[],"Error getting countries"),getRegions:async t=>d(t)?h((async()=>((await salla.api.request(`shipping/countries/${t}/regions`))?.data??[]).map((s=>({id:s.id,name:s.name,code:s.code,country_id:Number(t)})))),[],"Error fetching regions"):(console.warn(`${o}: getRegions called without valid country_id`),[]),getCities:async(t,s)=>d(t)?h((async()=>{const e={for_branch:0,country_id:t};return s&&(e.region_id=s),((await salla.api.request("shipping/cities",{params:e}))?.data??[]).map((s=>({id:s.id,name:s.name,country_id:t,...null!=s.region_id&&{region_id:s.region_id}})))}),[],"Error fetching cities"):(console.warn(`${o}: getCities called without valid country_id`),[]),getDistricts:async t=>d(t)?h((async()=>{const s=(await salla.api.request("shipping/districts",{params:{for_branch:0,city_id:t}}))?.data;return(Array.isArray(s)?s:Array.isArray(s?.districts)?s.districts:[]).map((s=>({id:s.id,name:s.name,name_en:s.name_en,city_id:t})))}),[],"Error fetching districts"):(console.warn(`${o}: getDistricts called without valid city_id`),[]),getSavedAddresses:async()=>h((async()=>{const t=(await salla.api.request("address"))?.data;return Array.isArray(t)?t:[]}),[],"Error fetching user addresses"),getBranches:async({query:t,lat:s,lng:e,country_id:i,per_page:l=20}={})=>h((async()=>{const a={per_page:l};t?.trim().length>=2&&(a.query=t),s&&(a.lat=s),e&&(a.lng=e),i&&(a.country_id=i);const n=await salla.api.request("branches",{params:a});return Array.isArray(n?.data)?n.data:[]}),[],"Error fetching branches"),saveAddressLocation:async t=>h((async()=>{const s=await salla.api.request("address/location",{...t,for_allocation:!0},"post"),e=s?.data??s;return{success:!0,address:"object"==typeof e&&null!=e&&"id"in e?e:void 0}}),{success:!1},"Error saving address/location"),setDeliveryScope:async t=>h((async()=>(await salla.scope.change({id:t}),salla.storage.set("scope",{...salla.storage.get("scope")||{},id:t}),!0)),!1,"Error setting delivery scope"),async allocateScope(t){try{const s=await salla.api.request("scopes/allocation",t,"post");return{success:!0,data:s?.data??s}}catch(t){console.error(`${o}: Error allocating scope`,t);const e=t;return{success:!1,error:null!=e?.response?.data?(s=e.response.data,s?.error?.message??s?.message??"Failed to allocate scope"):e?.message??"Unknown error"}}var s}},y=t=>t*(Math.PI/180);function b(t,s,e,i){const l=y(e-t),a=y(i-s),n=Math.sin(l/2)**2+Math.cos(y(t))*Math.cos(y(e))*Math.sin(a/2)**2;return 12742*Math.atan2(Math.sqrt(n),Math.sqrt(1-n))}function p(t,s){const[e,i]=String(t).trim().split(":").map(Number);return Number.isNaN(e)||Number.isNaN(i)?t:new Date(2e3,0,1,e,i).toLocaleTimeString(s,{hour:"numeric",minute:"2-digit",hour12:!0})}const v=(t,s,e)=>{if("branch"===t.type){const s=t.branch_details?.city??t.branch_details?.name;return s?`${e} ${s}`.trim():""}if("address"===t.type&&t.address_details){const e=[t.address_details.district?.name,t.address_details.city?.name,t.address_details.country?.name].filter(Boolean).join("، ")||t.address_details.short_address||"";return e?`${s} ${e}`.trim():""}return""},g=t=>null!=t?Number(t):void 0,m=t=>g(t?.address_details?.country?.id),f=t=>t?.country_code??t?.address_details?.country?.code??"",C=t=>g(t?.address_details?.region?.id),_=t=>g(t?.address_details?.city?.id),k=t=>g(t?.address_details?.district?.id),w=t=>t?.branch_details?.id,S=t=>t?.branch_details?.latitude,x=t=>t?.branch_details?.longitude,M=t=>{if(!t||"address"!==t.type||t.address_id)return!1;const s=m(t),e=_(t),i=k(t),l=f(t);return!(!s||!e||c(l)&&!i)},A=(t,s,e)=>!t||!c(t)||null!=s&&0!==Number(s)&&null!=e&&("number"==typeof e?0!==e:String(e).trim().length>0),B={[GeolocationPositionError.PERMISSION_DENIED]:"Location permission denied",[GeolocationPositionError.POSITION_UNAVAILABLE]:"Location unavailable",[GeolocationPositionError.TIMEOUT]:"Location timeout"};var L='<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 N=class{constructor(e){t(this,e),this.bulletDeliveryConfirmed=s(this,"bulletDeliveryConfirmed"),this.bulletDeliveryClosed=s(this,"bulletDeliveryClosed"),this.addressCreated=s(this,"addressCreated"),this.headerContextUpdate=s(this,"headerContextUpdate"),this.confirming=!1,this.branchSearchDebounceTimer=null,this.componentReady=!1,this.pendingOpen=!1,this.tabChanging=!1,this.intentStorageKey="bullet_delivery_intent",this.sessionShownKey="bullet_delivery_shown_this_session",this.cartItemAddedEvent="cart::item.added",this.cartItemAddedHandler=null,this.useCartEventApi=!1,this.bulletDeliveryOpenHandler=t=>{this.preselectedAddressId=t?.preselected_address_id,this.preselectedBranchId=t?.preselected_branch_id,this.open()},this.closeHandler=null,this.guestLoginSyncHandler=null,this.savedAddressesLoaded=!1,this.loading=!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.loadingCities=!1,this.loadingDistricts=!1,this.loadingBranches=!1,this.loadingNearestBranch=!1,this.locationError="",this.savingAddress=!1,this.loadingSavedAddresses=!1,this.showCartWillBeClearedBanner=!1,this.allocationOutOfCoverageMessage=null,this.newAddressForm={...N.INITIAL_ADDRESS_FORM},this.handleSubmitAddAddress=async t=>{if(t.preventDefault(),!this.savingAddress&&this.selectedCountry&&this.selectedCity&&A(this.selectedCountry?.code,this.selectedRegion?.id,this.selectedDistrict?.id??(this.districtName?.trim()||null))){this.savingAddress=!0;try{const t=this.buildAddressLocationPayload(),{success:s,address:e}=await u.saveAddressLocation(t);if(s){await this.loadSavedAddresses();const t=e??this.savedAddresses[0]??null;t?.is_in_coverage&&(this.selectedSessionAddress=!1,this.selectedSavedAddress=t),this.addressCreated.emit({address:t}),this.viewMode="main",this.districtName=""}else Salla.notify?.error(Salla.lang.get("common.errors.error_occurred"))}catch(t){console.error("SallaBulletDelivery: Error saving address",t),Salla.notify?.error(Salla.lang.get("common.errors.error_occurred"))}finally{this.savingAddress=!1}}}}get supportsPickup(){return!!Salla.config.get("store.settings.bullet_delivery.supports_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")}async open(){if(this.componentReady&&this.modal){this.resetState(),this.loading=!0,this.modal.open();try{const t=Salla.config.get("user.type");this.isLoggedIn="guest"!==t;const s=this.getStoredIntent();"address"===s?.type&&s.address_id&&(this.preselectedAddressId=s.address_id),"branch"===s?.type&&s.branch_id&&(this.preselectedBranchId=s.branch_id);const e=!this.isLoggedIn&&"address"===s?.type&&null!=m(s)&&null!=_(s);if(this.activeTab=this.supportsPickup&&s?.type&&("address"===s.type||"branch"===s.type)?s.type:"address",await Promise.all([this.loadCountries(e),this.isLoggedIn&&"address"===this.activeTab?this.loadSavedAddresses().then((()=>{this.savedAddressesLoaded=!0})):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 t=S(s),e=x(s);if(null!=t&&null!=e?await this.loadBranchesWithLocation(t,e):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.loading=!1,this.modal?.stopLoading()}}else this.pendingOpen=!0}async close(){return this.bulletDeliveryClosed.emit(),this.modal?.close()}resetState(){this.viewMode="main",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={...N.INITIAL_ADDRESS_FORM},this.showCartWillBeClearedBanner=!1,this.allocationOutOfCoverageMessage=null,this.locationError="",this.savedAddressesLoaded=!1,this.loadingSavedAddresses=!1}getIntentStorage(){const t=Boolean(Salla.config.get("store.settings.bullet_delivery.settings.remember_last_session"));return Salla.storage[t?"store":"session"]}getStoredIntent(){return this.getIntentStorage().get(this.intentStorageKey)}setStoredIntent(t){this.getIntentStorage().set(this.intentStorageKey,t)}removeStoredIntent(){this.getIntentStorage().remove(this.intentStorageKey)}async prefillAddressFromStoredIntent(){const t=this.getStoredIntent();if(!t||"address"!==t.type||null==_(t))return;const s=m(t);if(!s)return;const e=this.countries.find((t=>String(t.id)===String(s)));if(!e)return;this.selectedCountry=e,this.updateNewAddressForm({country_id:Number(e.id)});const i=c(e.code),l=_(t),a=C(t),n=k(t),r=t.address_details?.district?.name,[o,d,h]=await Promise.all([i?u.getRegions(e.id):Promise.resolve([]),u.getCities(e.id,i&&null!=a?a:void 0),null!=l?u.getDistricts(Number(l)):Promise.resolve([])]);if(i&&(this.regions=o),this.cities=d,this.districts=h,this.loadingCities=!1,this.loadingRegions=!1,this.loadingDistricts=!1,i&&null!=a){const t=this.regions.find((t=>String(t.id)===String(a)));t&&(this.selectedRegion=t,this.updateNewAddressForm({region_id:t.id}))}if(null!=l&&this.cities.length>0){const t=this.cities.find((t=>String(t.id)===String(l)));t&&(this.selectedCity=t,this.updateNewAddressForm({city_id:t.id,city:t}))}if(this.districts.length>0){const t=this.findPrefillDistrict(n,r);t&&(this.updateNewAddressForm({district_id:t.id,district:t}),this.selectedDistrict=t)}}updateNewAddressForm(t){this.newAddressForm={...this.newAddressForm,...t}}hasBeenShownThisSession(){return!!Salla.storage.session.get(this.sessionShownKey)}markShownThisSession(){Salla.storage.session.set(this.sessionShownKey,!0)}async loadCountries(t=!1){const s="branch"===this.activeTab;this.countries=await u.getCountries(s);const e=Salla.config.get("store.settings.bullet_delivery.customer_location.country"),i=e&&this.countries.length>0?this.countries.find((t=>String(t.code).toUpperCase()===String(e).toUpperCase())):null;i&&(this.selectedCountry=i,this.updateNewAddressForm({country_id:Number(this.selectedCountry.id)}),t||(c(this.selectedCountry.code)?await this.loadRegions(this.selectedCountry.id):await this.loadCities(this.selectedCountry.id)))}async loadCities(t,s){this.loadingCities=!0,this.cities=[],this.districts=[],this.selectedCity=null,this.selectedDistrict=null,this.districtName="";try{this.cities=await u.getCities(t,s)}finally{this.loadingCities=!1}}async loadDistricts(t){this.loadingDistricts=!0,this.districts=[],this.selectedDistrict=null,this.districtName="";try{this.districts=await u.getDistricts(t)}finally{this.loadingDistricts=!1}}findPrefillDistrict(t,s){if(0===this.districts.length)return;if(null!=t){const s=this.districts.find((s=>String(s.id)===String(t)));if(s)return s}const e=s?.trim().toLowerCase();return e?this.districts.find((t=>{const s=t.name?.trim().toLowerCase(),i=t.name_en?.trim().toLowerCase();return s===e||i===e})):void 0}async loadBranches(){this.loadingBranches=!0;try{this.branches=await u.getBranches({country_id:this.selectedCountry?.id}),this.filterBranches()}finally{this.loadingBranches=!1}}filterBranches(){this.filteredBranches=((t,s)=>{if(!s)return t;const e=s.toLowerCase();return t.filter((t=>t.name.toLowerCase().includes(e)||t.city?.name?.toLowerCase().includes(e)))})(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 s=m(t);if(null!=s){const e=this.countries.find((t=>String(t.id)===String(s)));if(e){this.selectedCountry=e,this.updateNewAddressForm({country_id:Number(e.id)});const s=w(t);if(null!=s&&this.branches.length>0){const t=this.branches.find((t=>t.id===s));t&&(this.selectedBranch=t)}}}}}catch(t){console.error("[BulletDelivery] Error prefilling from session storage:",t)}}async loadSavedAddresses(){this.savedAddresses=await u.getSavedAddresses();const t=this.getStoredIntent();if(M(t))this.selectedSessionAddress=!0,this.selectedSavedAddress=null;else{const t=this.savedAddresses.find((t=>t.is_default&&!1!==t.is_in_coverage));if(t)this.selectedSavedAddress=t;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.cities=[],this.districts=[],this.selectedCity=null,this.selectedDistrict=null,this.districtName="",this.allocationOutOfCoverageMessage=null,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():c(this.selectedCountry.code)?this.loadRegions(this.selectedCountry.id):this.loadCities(this.selectedCountry.id))}async loadRegions(t){this.loadingRegions=!0,this.regions=[],this.selectedRegion=null,this.cities=[],this.districts=[],this.selectedCity=null,this.selectedDistrict=null,this.districtName="";try{this.regions=await u.getRegions(t)}finally{this.loadingRegions=!1}}async handleGuestToRegisteredSync(){try{if(!Salla.config.get("user.id"))return;const t=this.getStoredIntent();if(!t||"address"!==t.type)return;const s=function(t,s){const e=_(t),i=k(t);return s.find((s=>!(null==e||(s.city?.id??s.city_id)!==e||null!=i&&((s.district?.id??s.district_id)!==i||t.street&&s.street&&t.street.toLowerCase()!==s.street.toLowerCase()))))??null}(t,await u.getSavedAddresses());if(s){await this.setAddressAsActive(s.id);const e={...t,address_id:s.id,address_details:this.buildIntentAddressFromSaved(s)};this.setStoredIntent(e)}else if(_(t)){const s=await this.createAddressFromGuestSession(t);if(s){const e={...t,address_id:s.id,address_details:this.buildIntentAddressFromSaved(s)};this.setStoredIntent(e),this.addressCreated.emit({address:s})}}Salla.event.emit("bullet-delivery::guest-synced",{guest_intent:t,matched_address_id:s?.id})}catch(t){console.error("SallaBulletDelivery: Error syncing guest session to user profile",t)}}async setAddressAsActive(t){try{await(Salla.address?.api?.setDefault?.(t))}catch(t){console.warn("SallaBulletDelivery: Could not set address as default",t)}}async createAddressFromGuestSession(t){const s=m(t),e=_(t);if(!s||!e)return null;const i=c(f(t)),l=t.address_details?.district?.name??"",a={country_id:s,region_id:C(t),city_id:e,district_id:k(t),description:l};i&&(a.local=l);try{const{success:s,address:i}=await u.saveAddressLocation(a);if(!s)return null;if(i)return i;const l=await u.getSavedAddresses(),n=k(t);return l.find((t=>(t.city_id??t.city?.id)===e&&(t.district_id??t.district?.id)===n))??l[0]??null}catch(t){return console.error("SallaBulletDelivery: Could not create address from guest session",t),null}}emitHeaderContextUpdate(t,s,e){let i="";"address"===t.type?s?i=s.district?.name&&s.city?.name?`${s.district.name}، ${s.city.name}`:s.city?.name??"":this.selectedCity?i=this.selectedDistrict?`${this.selectedDistrict.name}، ${this.selectedCity.name}`:this.selectedCity.name:t.address_details&&(i=[t.address_details.district?.name,t.address_details.city.name,t.address_details.country.name].filter(Boolean).join("، ")||t.address_details.short_address||""):e?i=e.name:t.branch_details&&(i=t.branch_details.city??t.branch_details.name);const l="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:i?`${l}: ${i}`:"",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:e?.name??t.branch_details?.name})}handleBranchSearch(t){const s=t.target.value;if(this.branchSearchQuery=s,this.branchSearchDebounceTimer&&clearTimeout(this.branchSearchDebounceTimer),!s?.trim())return this.branchSearchQuery="",void this.loadBranches();this.branchSearchDebounceTimer=setTimeout((async()=>{if(!(s.trim().length<2)){this.loadingBranches=!0;try{this.branches=await u.getBranches({country_id:this.selectedCountry?.id,query:s}),this.filterBranches()}finally{this.loadingBranches=!1}}}),1e3)}async loadBranchesWithLocation(t,s){this.loadingBranches=!0;try{if(this.branches=await u.getBranches({country_id:this.selectedCountry?.id,lat:t,lng:s}),this.filterBranches(),!this.selectedCountry&&this.branches.length>0){const t=this.branches[0];if(t.country){const s=this.countries.find((s=>s.id===t.country.id));s&&(this.selectedCountry=s,this.updateNewAddressForm({country_id:Number(s.id)}))}}}finally{this.loadingBranches=!1}}async handleFindNearestBranch(){if(navigator.geolocation){this.loadingNearestBranch=!0,this.locationError="";try{const t=await new Promise(((t,s)=>{navigator.geolocation.getCurrentPosition(t,s,{enableHighAccuracy:!0,timeout:1e4,maximumAge:0})})),{latitude:s,longitude:e}=t.coords;await this.loadBranchesWithLocation(s,e);const i=function(t,s,e){let i=null,l=Number.POSITIVE_INFINITY;for(const a of t){const t=null!=a.location?.lat?Number(a.location.lat):Number.NaN,n=null!=a.location?.lng?Number(a.location.lng):Number.NaN;if(Number.isNaN(t)||Number.isNaN(n)||!1===a.is_open)continue;const r=b(s,e,t,n);r<l&&(l=r,i=a)}return i}(this.branches,s,e);i&&(this.selectedBranch=i,this.branchSearchQuery="",this.filterBranches())}catch(t){const s=t;this.locationError=B["number"==typeof s?.code?s.code:-1]??"An error occurred while detecting location"}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";const t=this.getStoredIntent(),s=m(t);if(s&&this.countries.length>0){const t=this.countries.find((t=>t.id===s));t&&(this.selectedCountry=t,this.updateNewAddressForm({country_id:Number(t.id)}),c(t.code)?await this.loadRegions(t.id):await this.loadCities(t.id))}}handleBackToAddressList(){this.viewMode="main"}buildAddressLocationPayload(){const t=this.selectedDistrict?.name??this.districtName?.trim()??"";return function(t){const{countryId:s,countryCode:e,regionId:i,cityId:l,districtId:a,description:n=""}=t,r=n||"";return{country_id:Number(s)||void 0,region_id:null!=i?Number(i):void 0,city_id:null!=l?Number(l):void 0,district_id:null!=a?Number(a):void 0,description:r,...e&&c(e)&&{local:r}}}({countryId:this.selectedCountry?.id??0,countryCode:this.selectedCountry?.code,regionId:this.selectedRegion?.id,cityId:this.selectedCity?.id,districtId:this.selectedDistrict?.id,description:t})}async handleTabChange(t){if(!this.tabChanging){this.tabChanging=!0;try{this.activeTab=t,this.showCartWillBeClearedBanner=!1,this.allocationOutOfCoverageMessage=null;const s="branch"===t;this.countries=await u.getCountries(s);const e=this.selectedCountry?.id;if(null!=e&&(this.selectedCountry=this.countries.find((t=>t.id===e))||null),this.selectedCountry)if("branch"===t){const t=this.getStoredIntent(),s=S(t),e=x(t);null!=s&&null!=e?await this.loadBranchesWithLocation(s,e):await this.loadBranches();const i=w(t);if(null!=i&&this.branches.length>0){const t=this.branches.find((t=>t.id===i));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&&_(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.selectedCountry&&this.selectedCity&&A(this.selectedCountry?.code,this.selectedRegion?.id,this.selectedDistrict?.id??(this.districtName?.trim()||null))))}handleLogin(){Salla.event.dispatch("bullet-delivery::close"),Salla.event.dispatch("login::open")}buildIntentAddress(){if("address"!==this.activeTab||!this.selectedCountry||!this.selectedCity)return;const t={id:this.selectedCountry.id,name:this.selectedCountry.name,code:this.selectedCountry.code},s={id:this.selectedCity.id,name:this.selectedCity.name},e=this.selectedRegion?{id:this.selectedRegion.id,name:this.selectedRegion.name,code:this.selectedRegion.code}:void 0,i=this.selectedDistrict?{id:this.selectedDistrict.id,name:this.selectedDistrict.name}:this.districtName?{id:0,name:this.districtName}:void 0,l=this.selectedSavedAddress?.short_address;return{country:t,region:e,city:s,district:i,short_address:l}}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,s=null!=t.location?.lat?Number(t.location.lat):void 0,e=null!=t.location?.lng?Number(t.location.lng):void 0;return{id:t.id,name:t.name,city:t.city?.name,latitude:s,longitude:e}}async handleConfirm(){if(this.isConfirmDisabled()||this.confirming)return;this.confirming=!0,this.confirmBtn?.load();let t=!1;try{const s={type:this.activeTab,country_id:Number(this.selectedCountry?.id)||0,country_code:this.selectedCountry?.code||""};let e,i,l,a=!1;if("address"===this.activeTab)if(this.isLoggedIn&&this.selectedSessionAddress){a=!0;const t=await this.saveSessionAddressToProfile();if(!t)return Salla.notify?.error(Salla.lang.get("common.errors.error_occurred")),void this.confirmBtn?.stop();s.address_id=t.id,e=t,this.selectedSessionAddress=!1,this.selectedSavedAddress=t,s.address_details=this.buildIntentAddressFromSaved(t)}else this.isLoggedIn&&this.selectedSavedAddress?(s.address_id=this.selectedSavedAddress.id,e=this.selectedSavedAddress,s.address_details=this.buildIntentAddressFromSaved(this.selectedSavedAddress)):s.address_details=this.buildIntentAddress();else s.branch_details=this.buildIntentBranch(),s.branch_id=this.selectedBranch?.id,i=this.selectedBranch||void 0;"address"===this.activeTab?this.isLoggedIn&&this.selectedSavedAddress?l={type:"address",address_id:String(this.selectedSavedAddress.id)}:(l={type:"address",country_id:String(this.selectedCountry?.id||0),city_id:String(this.selectedCity?.id||"")},c(this.selectedCountry?.code??"")&&(this.selectedRegion?.id&&(l.region_id=String(this.selectedRegion.id)),l.district_id=String(this.selectedDistrict?.id||""))):l={type:"branch",branch_id:String(this.selectedBranch?.id||"")};const n=await u.allocateScope(l);if(!n.success){console.error("BulletDelivery: Scope allocation failed",n.error);const t=n.error||("address"===this.activeTab?Salla.lang.get("pages.checkout.address_out_of_coverage"):Salla.lang.get("pages.checkout.failed_to_set_pickup"));return Salla.notify?.error(t),this.allocationOutOfCoverageMessage=t,this.confirmBtn?.stop(),void(this.confirming=!1)}let r;if(n.data){const t=n.data;r=t.id;const e=t?.allocation?.type,i=t?.allocation?.branch_id;e&&Salla.api.setHeader("s-scope-allocation-type",e),i&&Salla.api.setHeader("s-scope-allocation-id",String(i));const l=Salla.config.get("store.scope",Salla.storage.get("scope"))||{};Salla.storage.set("scope",{...l,id:r,allocation_type:e,allocation_id:i?String(i):void 0}),s.allocation_headers={"s-scope-allocation-type":e,"s-scope-allocation-id":i?String(i):void 0}}this.markShownThisSession(),a?this.removeStoredIntent():this.setStoredIntent(s),r&&await u.setDeliveryScope(r),this.bulletDeliveryConfirmed.emit({...s,address:e,branch:i}),this.emitHeaderContextUpdate(s,e,i),t=!0,setTimeout((()=>{if(this.confirmBtn?.stop(),this.close(),this.confirming=!1,r){const t=Salla.storage.get("scope")||{};let s=Salla.helpers.addParamToUrl("scope",r);t.allocation_id&&(s=Salla.helpers.addParamToUrl("allocation_id",t.allocation_id,s)),t.allocation_type&&(s=Salla.helpers.addParamToUrl("allocation_type",t.allocation_type,s)),window.location.replace(s)}else window.location.reload()}),500)}finally{t||(this.confirming=!1)}}getCartViewConfig(t){if(!t||!Salla.url.is_page("cart"))return null;const s="branch"===t.type,e="address"===t.type;return s&&!this.supportsPickup||!s&&!e?null:{title:s?Salla.lang.get("pages.checkout.pickup_option"):Salla.lang.get("pages.checkout.delivery_option"),subtitle:v(t,Salla.lang.get("common.elements.to"),""),buttonText:Salla.lang.get("common.elements.edit"),isAddress:e,intent:t}}createCartViewElement(){const t=this.getStoredIntent(),s=this.getCartViewConfig(t);if(!s)return null;const{title:e,subtitle:i,buttonText:l,intent:n}=s,r="branch"===n.type?{preselected_branch_id:w(n)}:{preselected_address_id:n.address_id},o=document.createElement("span");o.className="s-bullet-delivery-cart-view-icon s-bullet-delivery-tab-icon",o.setAttribute("aria-hidden","true"),o.innerHTML=a;const d=document.createElement("span");d.className="s-bullet-delivery-cart-view-title",d.textContent=e;const h=document.createElement("span");h.className="s-bullet-delivery-cart-view-subtitle",h.textContent=i;const c=document.createElement("div");c.className="s-bullet-delivery-cart-view-text",c.append(d,h);const u=document.createElement("div");u.className="s-bullet-delivery-cart-view-info",u.append(o,c);const y=document.createElement("salla-button");y.className="s-bullet-delivery-cart-view-button",y.setAttribute("fill","outline"),y.setAttribute("color","primary"),y.textContent=l,y.addEventListener("click",(()=>Salla.event.emit("bullet-delivery::open",r)));const b=document.createElement("div");return b.className="s-bullet-delivery-cart-view",b.append(u,y),b}renderSkeleton(){return e("div",{slot:"loading",class:"s-bullet-delivery-skeleton"},e("div",{class:"s-bullet-delivery-skeleton-header"},e("salla-skeleton",{class:"s-bullet-delivery-skeleton-title",height:"28px",width:"68%"}),e("salla-skeleton",{class:"s-bullet-delivery-skeleton-subtitle",height:"18px",width:"84%"})),e("div",{class:{"s-bullet-delivery-skeleton-tabs":!0,"s-bullet-delivery-skeleton-tabs--single":!this.supportsPickup}},e("div",{class:"s-bullet-delivery-skeleton-tab"},e("salla-skeleton",{class:"s-bullet-delivery-skeleton-tab-icon",height:"32px",width:"32px"}),e("salla-skeleton",{class:"s-bullet-delivery-skeleton-tab-label",height:"18px",width:"92px"})),this.supportsPickup&&e("div",{class:"s-bullet-delivery-skeleton-tab"},e("salla-skeleton",{class:"s-bullet-delivery-skeleton-tab-icon",height:"32px",width:"32px"}),e("salla-skeleton",{class:"s-bullet-delivery-skeleton-tab-label",height:"18px",width:"84px"}))),e("div",{class:"s-bullet-delivery-skeleton-content"},e("div",{class:"s-bullet-delivery-skeleton-field"},e("salla-skeleton",{class:"s-bullet-delivery-skeleton-field-label",height:"16px",width:"96px"}),e("salla-skeleton",{class:"s-bullet-delivery-skeleton-field-control",height:"56px",width:"100%"})),e("div",{class:"s-bullet-delivery-skeleton-field"},e("salla-skeleton",{class:"s-bullet-delivery-skeleton-field-label",height:"16px",width:"104px"}),e("salla-skeleton",{class:"s-bullet-delivery-skeleton-field-control",height:"56px",width:"100%"})),e("div",{class:"s-bullet-delivery-skeleton-field"},e("salla-skeleton",{class:"s-bullet-delivery-skeleton-field-label",height:"16px",width:"88px"}),e("salla-skeleton",{class:"s-bullet-delivery-skeleton-field-control",height:"56px",width:"100%"}))),e("div",{class:"s-bullet-delivery-skeleton-footer"},e("salla-skeleton",{height:"52px",width:"100%"})))}renderTabs(){return this.supportsPickup?e("div",{class:"s-bullet-delivery-tabs"},e("button",{type:"button",class:{"s-bullet-delivery-tab":!0,"s-bullet-delivery-tab--active":"address"===this.activeTab},onClick:()=>this.handleTabChange("address")},e("span",{class:"s-bullet-delivery-tab-icon",innerHTML:a,"aria-hidden":"true"}),e("span",null,Salla.lang.get("mobile_app.strings.delivery"))),e("button",{type:"button",class:{"s-bullet-delivery-tab":!0,"s-bullet-delivery-tab--active":"branch"===this.activeTab},onClick:()=>this.handleTabChange("branch")},e("span",{class:"s-bullet-delivery-tab-icon",innerHTML:L,"aria-hidden":"true"}),e("span",null,Salla.lang.get("mobile_app.strings.pickup")))):null}renderAlert(t){return e("div",{class:"s-bullet-delivery-allocation-out-of-coverage",role:"alert"},e("span",{class:"s-bullet-delivery-allocation-out-of-coverage-icon","aria-hidden":"true"},e("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-hidden":"true"},e("title",null,"Information"),e("circle",{cx:"10",cy:"10",r:"9",stroke:"currentColor","stroke-width":"1.5",fill:"currentColor"}),e("text",{x:"10",y:"14","text-anchor":"middle",fill:"white","font-size":"12","font-weight":"bold"},"i"))),e("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 e("div",{class:"s-bullet-delivery-field"},e("label",{class:"s-bullet-delivery-label",htmlFor:"bullet-delivery-country"},Salla.lang.get("blocks.buy_as_gift.receiver_country"),e("span",{class:"text-red-500"}," *")),e("select",{id:"bullet-delivery-country",class:"form-input",onChange:t=>{const s=Number.parseInt(t.target.value),e=this.countries.find((t=>t.id===s));this.showCartWillBeClearedBanner=!(!this.selectedCountry||!e||this.selectedCountry.code===e.code),this.applyCountryChange(e||null)}},e("option",{value:"",disabled:!0,selected:!this.selectedCountry},Salla.lang.get("pages.checkout.select_country")),this.countries.map((t=>e("option",{key:t.id,value:t.id,selected:this.selectedCountry?.id===t.id},t.name)))))}renderSelectLoader(){return e("span",{class:"s-bullet-delivery-select-loader","aria-hidden":"true"},e("salla-loading",{size:"16",width:"3"}))}renderLoadingLabel(t,s,i=!1,l=!0){return e("label",{class:"s-bullet-delivery-label",htmlFor:s},e("span",{class:"s-bullet-delivery-label-content"},e("span",null,t,l&&e("span",{class:"text-red-500"}," *")),i&&this.renderSelectLoader()))}renderRegionSelect(){return c(this.selectedCountry?.code??"")&&this.selectedCountry?e("div",{class:"s-bullet-delivery-field"},this.renderLoadingLabel(Salla.lang.get("pages.checkout.region_field"),"bullet-delivery-region",this.loadingRegions),e("select",{id:"bullet-delivery-region",class:"form-input",disabled:this.loadingRegions||0===this.regions.length,onChange:t=>{const s=Number.parseInt(t.target.value),e=this.regions.find((t=>t.id===s));this.selectedRegion=e||null,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)}},e("option",{value:"",disabled:!0,selected:!this.selectedRegion},Salla.lang.get("pages.checkout.select_region")),this.regions.map((t=>e("option",{key:t.id,value:t.id,selected:this.selectedRegion?.id===t.id},t.name))))):null}renderCityDistrictSelects(){const t=c(this.selectedCountry?.code??""),s=t,i=s&&this.selectedCity&&!this.loadingDistricts&&0===this.districts.length,l=!this.selectedCountry||t&&!this.selectedRegion||this.loadingCities||0===this.cities.length,a=!this.selectedCountry||t&&!this.selectedRegion||!this.selectedCity||this.loadingDistricts;return e("div",{class:"s-bullet-delivery-field-row"},e("div",{class:"s-bullet-delivery-field"},this.renderLoadingLabel(Salla.lang.get("blocks.buy_as_gift.receiver_city"),"bullet-delivery-city",this.loadingCities),e("select",{id:"bullet-delivery-city",class:"form-input",disabled:l,onChange:t=>{const e=Number.parseInt(t.target.value),i=this.cities.find((t=>t.id===e));this.selectedCity=i||null,this.selectedDistrict=null,this.districtName="",i&&(this.updateNewAddressForm({city:i,district:void 0}),s&&this.loadDistricts(i.id))}},e("option",{value:"",disabled:!0,selected:!this.selectedCity},Salla.lang.get("pages.checkout.select_city")),this.cities.map((t=>e("option",{key:t.id,value:t.id,selected:this.selectedCity?.id===t.id},t.name))))),s&&e("div",{class:"s-bullet-delivery-field"},this.renderLoadingLabel(Salla.lang.get("pages.checkout.district_field"),"bullet-delivery-district",this.loadingDistricts&&!i),i?e("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})}}):e("select",{id:"bullet-delivery-district",class:"form-input",disabled:a||0===this.districts.length,onChange:t=>{const s=Number.parseInt(t.target.value),e=this.districts.find((t=>t.id===s));this.selectedDistrict=e||null,this.districtName="",e&&this.updateNewAddressForm({district:e})}},e("option",{value:"",disabled:!0,selected:!this.selectedDistrict},Salla.lang.get("pages.checkout.select_district")),this.districts.map((t=>{const s="ar"===Salla.config.get("user.language_code")?t.name:t.name_en??t.name;return e("option",{key:t.id,value:t.id,selected:this.selectedDistrict?.id===t.id},s)})))))}renderSavedAddressesEmptyState(){return e("div",{class:"s-bullet-delivery-saved-addresses-empty"},e("div",{class:"s-bullet-delivery-saved-addresses-empty-icon","aria-hidden":"true"},e("svg",{width:"28",height:"28",viewBox:"0 0 28 29",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e("title",null,"No Saved Adresses"),e("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"}))),e("p",{class:"s-bullet-delivery-saved-addresses-empty-title"},Salla.lang.get("pages.checkout.no_saved_addresses")),e("p",{class:"s-bullet-delivery-saved-addresses-empty-desc"},Salla.lang.get("pages.checkout.add_address_simplify_shipping")),e("salla-button",{onClick:()=>this.handleAddNewAddress(),onKeyUp:()=>this.handleAddNewAddress()},Salla.lang.get("pages.checkout.add_new_address")))}async saveSessionAddressToProfile(){const t=this.getStoredIntent(),s=m(t),e=_(t),i=k(t);if(!t||"address"!==t.type||!s||!e)return null;const l=f(t);if(c(l)&&!i)return null;const a=c(l),n=t.address_details?.district?.name??"",r={country_id:s,region_id:C(t),city_id:e,district_id:i,description:n};a&&(r.local=n);try{const{success:t,address:s}=await u.saveAddressLocation(r);if(!t)return null;const e=s??null;return e&&this.addressCreated.emit({address:e}),e}catch(t){return console.error("SallaBulletDelivery: Error saving session address",t),null}}renderSavedAddresses(){if(!this.isLoggedIn)return null;if(this.loadingSavedAddresses)return e("div",null,e("salla-loading",{size:"md"}));const t=this.getStoredIntent(),s=M(t),i=s&&t?.address_details?[t.address_details.district?.name,t.address_details.city.name,t.address_details.country.name].filter(Boolean).join("، ")||[t.address_details.country.id,t.address_details.city.id].join(", "):"";return 0!==this.savedAddresses.length||s?e("div",{class:"s-bullet-delivery-addresses-list s-scrollbar"},s&&this.renderAddressRow({key:"session-address",line1:i,line2:"",selected:this.selectedSessionAddress,onClick:()=>this.handleSessionAddressSelect()}),this.savedAddresses.map((t=>{const s=[t.building_number,t.street].filter(Boolean).join("، ")||t.formatted?.address_one||t.short_address||"",e=([t.district?.name,t.city?.name,t.country?.name].filter(Boolean).join("، ")||t.formatted?.address_two)??"",i=!1!==t.is_in_coverage;return this.renderAddressRow({key:String(t.id),line1:s,line2:e,selected:this.selectedSavedAddress?.id===t.id,disabled:!i,onClick:()=>i&&this.handleSavedAddressSelect(t)})}))):this.renderSavedAddressesEmptyState()}renderAddressRow(t){const{key:s,line1:i,line2:l,selected:a,disabled:n=!1,onClick:r}=t;return e("button",{key:s,class:{"s-bullet-delivery-address-item":!0,"s-bullet-delivery-address-item--selected":a,"s-bullet-delivery-address-item--disabled":n},type:"button",onClick:n?void 0:r,onKeyDown:t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),n||r())}},e("input",{type:"radio",name:"saved_address",class:"s-bullet-delivery-radio",checked:a,disabled:n,onClick:t=>t.stopPropagation()}),e("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"}),e("div",{class:"s-bullet-delivery-address-content"},e("div",{class:"s-bullet-delivery-address-lines"},e("span",{class:"s-bullet-delivery-address-line1"},i),e("span",{class:"s-bullet-delivery-address-line2"},l))))}renderGuestDeliveryForm(){const t=c(this.selectedCountry?.code??"");return[this.renderCountrySelect(),t?this.renderRegionSelect():null,this.renderCityDistrictSelects()]}renderDeliveryTab(){return e("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.renderGuestDeliveryForm())}renderBranchSearch(){return e("div",{class:"s-bullet-delivery-branch-search"},e("div",{class:"s-bullet-delivery-search-row"},e("div",{class:"s-bullet-delivery-search s-bullet-delivery-branch-search-wrap"},e("span",{class:"s-bullet-delivery-search-icon s-bullet-delivery-branch-search-icon",innerHTML:l,"aria-hidden":"true"}),e("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"})),e("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?e("salla-loading",{size:"sm"}):e("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"}),e("span",null,Salla.lang.get("pages.checkout.nearest_to_my_location")))),this.locationError&&"branch"===this.activeTab&&e("span",{class:"s-bullet-delivery-error"},this.locationError))}renderBranchList(){return this.loadingBranches?e("div",{class:"s-bullet-delivery-branches-wrap"},e("div",{class:"s-bullet-delivery-branches-loading"},[1,2,3,4].map((t=>e("div",{key:t,class:"s-bullet-delivery-branch-skeleton"},e("salla-skeleton",{class:"s-bullet-delivery-branch-skeleton-radio",type:"circle",height:"16px",width:"16px"}),e("div",{class:"s-bullet-delivery-branch-skeleton-icon"},e("salla-skeleton",{height:"34px",width:"34px"})),e("div",{class:"s-bullet-delivery-branch-skeleton-content"},e("salla-skeleton",{class:"s-bullet-delivery-branch-skeleton-title",height:"12px",width:"124px"})),e("salla-skeleton",{class:"s-bullet-delivery-branch-skeleton-time",height:"12px",width:"88px"}),e("div",{class:"s-bullet-delivery-branch-skeleton-map"},e("salla-skeleton",{height:"32px",width:"32px"}))))))):0===this.filteredBranches.length?e("salla-placeholder",{alignment:"center",class:"s-bullet-delivery-placeholder"},e("span",{slot:"title"},Salla.lang.get("pages.checkout.no_pickup_branches_found"))):e("div",{class:"s-bullet-delivery-branches-wrap"},e("ul",{class:"s-bullet-delivery-branches-list s-scrollbar"},this.filteredBranches.map((t=>e("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":!1===t.is_open},tabIndex:!1===t.is_open?-1:0,role:"option","aria-disabled":!1===t.is_open,onClick:()=>!1!==t.is_open&&this.handleBranchSelect(t),onKeyDown:s=>{"Enter"!==s.key&&" "!==s.key||(s.preventDefault(),!1!==t.is_open&&this.handleBranchSelect(t))}},e("input",{type:"radio",name:"branch",class:"s-bullet-delivery-radio",checked:this.selectedBranch?.id===t.id,disabled:!1===t.is_open}),e("span",{class:"s-bullet-delivery-branch-icon","aria-hidden":"true"},e("span",{innerHTML:L})),e("div",{class:"s-bullet-delivery-branch-info"},e("span",{class:"s-bullet-delivery-branch-name"},t.name),t.preparation_time?e("span",{class:"s-bullet-delivery-branch-prep"},`${Salla.lang.get("pages.checkout.processing_time")}: ${t.preparation_time}`):null),(()=>{const s=(i=t.working_hours,i?.[0]?.times?.[0]??null);var i;return s?e("span",{class:"s-bullet-delivery-branch-time"},function(t,s,e,i){const l=String(t).trim(),a=String(s).trim();return l&&a?"00:00"===l?`${i} ${p(a,e)}`:`${p(l,e)} - ${p(a,e)}`:""}(s.from,s.to,Salla.config.get("user.language_code")||"ar",Salla.lang.get("pages.checkout.until"))):null})(),null!=t.location?.lat&&null!=t.location?.lng&&e("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()},e("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"}),e("span",{class:"sr-only"},Salla.lang.get("common.elements.open_in_google_maps"))))))))}renderPickupTab(){return e("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(){const t=Salla.lang.get("pages.checkout.add_new_address"),s=c(this.selectedCountry?.code??""),i=this.selectedCountry&&this.selectedCity&&(!s||this.selectedRegion)&&(!s||!!this.selectedDistrict||!!(this.districtName&&this.districtName.trim().length>0)),l=this.savingAddress?Salla.lang.get("pages.checkout.loading"):Salla.lang.get("pages.checkout.confirm_address");return e("div",{class:"s-bullet-delivery-add-address"},e("div",{class:"s-bullet-delivery-add-address-header"},e("button",{type:"button",class:"s-bullet-delivery-add-address-title",onClick:()=>this.handleBackToAddressList(),onKeyDown:t=>"Enter"===t.key&&this.handleBackToAddressList()},e("span",{innerHTML:this.isRTL?n:r,"aria-hidden":"true"}),e("span",{class:"s-bullet-delivery-add-address-title-text"},t))),e("form",{class:"s-bullet-delivery-add-address-form",onSubmit:t=>this.handleSubmitAddAddress(t)},this.renderGuestDeliveryForm(),e("div",{class:"s-bullet-delivery-form-actions s-bullet-delivery-form-actions--single"},e("salla-button",{type:"submit",loading:this.savingAddress,disabled:!i||this.savingAddress,class:"s-bullet-delivery-add-address-submit"},l))))}renderFooter(){const t="address"===this.activeTab&&this.isLoggedIn;return e("div",{class:"s-bullet-delivery-footer"},e("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&&e("salla-button",{onClick:()=>this.handleAddNewAddress(),width:"wide",shape:"link"},Salla.lang.get("pages.checkout.add_new_address")),!this.isLoggedIn&&e("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&&!M(this.getStoredIntent()),s="branch"===this.activeTab&&this.supportsPickup?this.renderPickupTab():this.renderDeliveryTab();return e("div",null,e("div",{class:"s-bullet-delivery-header"},e("h2",{class:"s-bullet-delivery-title"},Salla.lang.get("blocks.home.select_the_receiving_method")),e("p",{class:"s-bullet-delivery-subtitle"},Salla.lang.get("pages.checkout.delivery_pickup_availability_hint"))),this.renderTabs(),this.showCartWillBeClearedBanner&&this.renderAlert(Salla.lang.get("blocks.scope.empty_cart_warning")),this.allocationOutOfCoverageMessage&&this.renderAllocationOutOfCoverageAlert(),s,!t&&this.renderFooter())}handleAfterAddToCart(){"after_add_to_cart"===this.openingType&&(this.hasBeenShownThisSession()||this.modal?.hasAttribute?.("visible")||this.open())}overrideScopeSwitchUI(){const t=this.getStoredIntent(),s=document.querySelector('[onclick*="scopes"]');if(!s)return;const e=(t,s)=>t&&t.length>s?`${t.slice(0,s)}...`:t??"",i=t?"branch"===t.type?`${Salla.lang.get("mobile_app.strings.pickup")} ${Salla.lang.get("common.elements.from")} ${e(t.branch_details?.name,20)}`:`${Salla.lang.get("mobile_app.strings.delivery")} ${Salla.lang.get("common.elements.to")} ${e(t.address_details?.city?.name,10)}`:Salla.lang.get("common.titles.shipping");s.style.display=t?"":"none",s.onclick=()=>this.open();const l=s.querySelector('span:not([class*="sicon"]):not([class*="icon"])');if(l)l.textContent=i;else{const t=Array.from(s.childNodes).find((t=>t.nodeType===Node.TEXT_NODE&&t.textContent?.trim()));t&&(t.textContent=` ${i}`)}}async componentWillLoad(){await Salla.onReady();try{this.overrideScopeSwitchUI()}catch(t){console.warn("SallaBulletDelivery: overrideScopeSwitchUI failed",t)}Salla.event.on("bullet-delivery::open",this.bulletDeliveryOpenHandler),this.closeHandler=this.close.bind(this),Salla.event.on("bullet-delivery::close",this.closeHandler),this.guestLoginSyncHandler=this.handleGuestToRegisteredSync.bind(this),Salla.event.on("login::success",this.guestLoginSyncHandler),Salla.event.on("auth::logged-in",this.guestLoginSyncHandler),this.isRTL=Salla.config.get("theme.is_rtl"),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 e(i,{key:"5d79f6404692b4a68504770a54f46c9e5161e533",class:"s-bullet-delivery"},e("salla-modal",{key:"f123012f8593e20eeb14ebf59fc8dc5af9bbe12b",ref:t=>{this.modal=t},isClosable:!this.isRequired,class:"s-bullet-delivery-modal",isLoading:this.loading,width:"sm"},this.loading?this.renderSkeleton():e("div",{class:"s-bullet-delivery-inner"},"main"===this.viewMode&&this.renderMainView(),"add-address"===this.viewMode&&this.renderAddAddressForm())))}componentDidLoad(){if(this.componentReady=!0,this.pendingOpen)return this.pendingOpen=!1,void this.open();switch(this.openingType){case"first_visit":this.hasBeenShownThisSession()||this.open();break;case"on_cart_click":Salla.url.is_page("cart")&&!0!==Salla.storage.session.get(this.sessionShownKey)&&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("bullet-delivery::open",this.bulletDeliveryOpenHandler),this.closeHandler&&(Salla.event.off("bullet-delivery::close",this.closeHandler),this.closeHandler=null),this.guestLoginSyncHandler&&(Salla.event.off("login::success",this.guestLoginSyncHandler),Salla.event.off("auth::logged-in",this.guestLoginSyncHandler),this.guestLoginSyncHandler=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)}};N.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},N.style="@supports (interpolate-size: allow-keywords) and (block-size: calc-size(auto, size)) {\n .s-bullet-delivery .s-bullet-delivery-modal .s-modal-body, .s-bullet-delivery-inner {\n @apply [interpolate-size:allow-keywords];\n }\n .s-bullet-delivery .s-bullet-delivery-modal .s-modal-body {\n @apply [overflow:clip] [transition:block-size_500ms_ease];\n }\n .s-bullet-delivery-inner {\n @apply [overflow:clip] [transition:block-size_500ms_ease];\n block-size: calc-size(auto, size);\n }\n}\n\n@keyframes s-bullet-delivery-fade-in {\n from {\n opacity: 0;\n transform: translateY(6px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n}";export{N as salla_bullet_delivery}
|
|
4
|
+
import{r as t,c as s,h as e,H as i}from"./p-CLfrQ6bI.js";import{S as l}from"./p-BscTeWDc.js";import{L as a}from"./p-BO5AoBAP.js";import{a as n,A as r}from"./p-Vqpj4CWE.js";const o="BulletDeliveryAPI",d=t=>{const s=null==t?Number.NaN:Number(t);return!Number.isNaN(s)&&0!==s};async function h(t,s,e){try{return await t()}catch(t){return console.error(`${o}: ${e}`,t),s}}const c=t=>"SA"===String(t).toUpperCase(),u={getCountries:async(t=!1)=>h((async()=>((await salla.api.request("shipping/countries",{params:{for_branch:t?1:0}}))?.data??[]).map((t=>({id:t.id,code:t.code,name:t.name,has_regions:c(t.code)})))),[],"Error getting countries"),getRegions:async t=>d(t)?h((async()=>((await salla.api.request(`shipping/countries/${t}/regions`))?.data??[]).map((s=>({id:s.id,name:s.name,code:s.code,country_id:Number(t)})))),[],"Error fetching regions"):(console.warn(`${o}: getRegions called without valid country_id`),[]),getCities:async(t,s)=>d(t)?h((async()=>{const e={for_branch:0,country_id:t};return s&&(e.region_id=s),((await salla.api.request("shipping/cities",{params:e}))?.data??[]).map((s=>({id:s.id,name:s.name,country_id:t,...null!=s.region_id&&{region_id:s.region_id}})))}),[],"Error fetching cities"):(console.warn(`${o}: getCities called without valid country_id`),[]),getDistricts:async t=>d(t)?h((async()=>{const s=(await salla.api.request("shipping/districts",{params:{for_branch:0,city_id:t}}))?.data;return(Array.isArray(s)?s:Array.isArray(s?.districts)?s.districts:[]).map((s=>({id:s.id,name:s.name,name_en:s.name_en,city_id:t})))}),[],"Error fetching districts"):(console.warn(`${o}: getDistricts called without valid city_id`),[]),getSavedAddresses:async()=>h((async()=>{const t=(await salla.api.request("address"))?.data;return Array.isArray(t)?t:[]}),[],"Error fetching user addresses"),getBranches:async({query:t,lat:s,lng:e,country_id:i,per_page:l=20}={})=>h((async()=>{const a={per_page:l};t?.trim().length>=2&&(a.query=t),s&&(a.lat=s),e&&(a.lng=e),i&&(a.country_id=i);const n=await salla.api.request("branches",{params:a});return Array.isArray(n?.data)?n.data:[]}),[],"Error fetching branches"),saveAddressLocation:async t=>h((async()=>{const s=await salla.api.request("address/location",{...t,for_allocation:!0},"post"),e=s?.data??s;return{success:!0,address:"object"==typeof e&&null!=e&&"id"in e?e:void 0}}),{success:!1},"Error saving address/location"),setDeliveryScope:async t=>h((async()=>(await salla.scope.change({id:t}),salla.storage.set("scope",{...salla.storage.get("scope")||{},id:t}),!0)),!1,"Error setting delivery scope"),async allocateScope(t){try{const s=await salla.api.request("scopes/allocation",t,"post");return{success:!0,data:s?.data??s}}catch(t){console.error(`${o}: Error allocating scope`,t);const e=t;return{success:!1,error:null!=e?.response?.data?(s=e.response.data,s?.error?.message??s?.message??"Failed to allocate scope"):e?.message??"Unknown error"}}var s}},y=t=>t*(Math.PI/180);function b(t,s,e,i){const l=y(e-t),a=y(i-s),n=Math.sin(l/2)**2+Math.cos(y(t))*Math.cos(y(e))*Math.sin(a/2)**2;return 12742*Math.atan2(Math.sqrt(n),Math.sqrt(1-n))}function p(t,s){const[e,i]=String(t).trim().split(":").map(Number);return Number.isNaN(e)||Number.isNaN(i)?t:new Date(2e3,0,1,e,i).toLocaleTimeString(s,{hour:"numeric",minute:"2-digit",hour12:!0})}const v=(t,s,e)=>{if("branch"===t.type){const s=t.branch_details?.city??t.branch_details?.name;return s?`${e} ${s}`.trim():""}if("address"===t.type&&t.address_details){const e=[t.address_details.district?.name,t.address_details.city?.name,t.address_details.country?.name].filter(Boolean).join("، ")||t.address_details.short_address||"";return e?`${s} ${e}`.trim():""}return""},g=t=>null!=t?Number(t):void 0,m=t=>g(t?.address_details?.country?.id),f=t=>t?.country_code??t?.address_details?.country?.code??"",C=t=>g(t?.address_details?.region?.id),_=t=>g(t?.address_details?.city?.id),k=t=>g(t?.address_details?.district?.id),w=t=>t?.branch_details?.id,S=t=>t?.branch_details?.latitude,x=t=>t?.branch_details?.longitude,M=t=>{if(!t||"address"!==t.type||t.address_id)return!1;const s=m(t),e=_(t),i=k(t),l=f(t);return!(!s||!e||c(l)&&!i)},A=(t,s,e)=>!t||!c(t)||null!=s&&0!==Number(s)&&null!=e&&("number"==typeof e?0!==e:String(e).trim().length>0),B={[GeolocationPositionError.PERMISSION_DENIED]:"Location permission denied",[GeolocationPositionError.POSITION_UNAVAILABLE]:"Location unavailable",[GeolocationPositionError.TIMEOUT]:"Location timeout"};var L='<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 N=class{constructor(e){t(this,e),this.bulletDeliveryConfirmed=s(this,"bulletDeliveryConfirmed"),this.bulletDeliveryClosed=s(this,"bulletDeliveryClosed"),this.addressCreated=s(this,"addressCreated"),this.headerContextUpdate=s(this,"headerContextUpdate"),this.confirming=!1,this.branchSearchDebounceTimer=null,this.componentReady=!1,this.pendingOpen=!1,this.tabChanging=!1,this.intentStorageKey="bullet_delivery_intent",this.sessionShownKey="bullet_delivery_shown_this_session",this.cartItemAddedEvent="cart::item.added",this.cartItemAddedHandler=null,this.useCartEventApi=!1,this.bulletDeliveryOpenHandler=t=>{this.preselectedAddressId=t?.preselected_address_id,this.preselectedBranchId=t?.preselected_branch_id,this.open()},this.closeHandler=null,this.guestLoginSyncHandler=null,this.savedAddressesLoaded=!1,this.loading=!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.loadingCities=!1,this.loadingDistricts=!1,this.loadingBranches=!1,this.loadingNearestBranch=!1,this.locationError="",this.savingAddress=!1,this.loadingSavedAddresses=!1,this.showCartWillBeClearedBanner=!1,this.allocationOutOfCoverageMessage=null,this.newAddressForm={...N.INITIAL_ADDRESS_FORM},this.handleSubmitAddAddress=async t=>{if(t.preventDefault(),!this.savingAddress&&this.selectedCountry&&this.selectedCity&&A(this.selectedCountry?.code,this.selectedRegion?.id,this.selectedDistrict?.id??(this.districtName?.trim()||null))){this.savingAddress=!0;try{const t=this.buildAddressLocationPayload(),{success:s,address:e}=await u.saveAddressLocation(t);if(s){await this.loadSavedAddresses();const t=e??this.savedAddresses[0]??null;t?.is_in_coverage&&(this.selectedSessionAddress=!1,this.selectedSavedAddress=t),this.addressCreated.emit({address:t}),this.viewMode="main",this.districtName=""}else Salla.notify?.error(Salla.lang.get("common.errors.error_occurred"))}catch(t){console.error("SallaBulletDelivery: Error saving address",t),Salla.notify?.error(Salla.lang.get("common.errors.error_occurred"))}finally{this.savingAddress=!1}}}}get supportsPickup(){return!!Salla.config.get("store.settings.bullet_delivery.supports_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")}async open(){if(this.componentReady&&this.modal){this.resetState(),this.loading=!0,this.modal.open();try{const t=Salla.config.get("user.type");this.isLoggedIn="guest"!==t;const s=this.getStoredIntent();"address"===s?.type&&s.address_id&&(this.preselectedAddressId=s.address_id),"branch"===s?.type&&s.branch_id&&(this.preselectedBranchId=s.branch_id);const e=!this.isLoggedIn&&"address"===s?.type&&null!=m(s)&&null!=_(s);if(this.activeTab=this.supportsPickup&&s?.type&&("address"===s.type||"branch"===s.type)?s.type:"address",await Promise.all([this.loadCountries(e),this.isLoggedIn&&"address"===this.activeTab?this.loadSavedAddresses().then((()=>{this.savedAddressesLoaded=!0})):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 t=S(s),e=x(s);if(null!=t&&null!=e?await this.loadBranchesWithLocation(t,e):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.loading=!1,this.modal?.stopLoading()}}else this.pendingOpen=!0}async close(){return this.bulletDeliveryClosed.emit(),this.modal?.close()}resetState(){this.viewMode="main",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={...N.INITIAL_ADDRESS_FORM},this.showCartWillBeClearedBanner=!1,this.allocationOutOfCoverageMessage=null,this.locationError="",this.savedAddressesLoaded=!1,this.loadingSavedAddresses=!1}getIntentStorage(){const t=Boolean(Salla.config.get("store.settings.bullet_delivery.settings.remember_last_session"));return Salla.storage[t?"store":"session"]}getStoredIntent(){return this.getIntentStorage().get(this.intentStorageKey)}setStoredIntent(t){this.getIntentStorage().set(this.intentStorageKey,t)}removeStoredIntent(){this.getIntentStorage().remove(this.intentStorageKey)}async prefillAddressFromStoredIntent(){const t=this.getStoredIntent();if(!t||"address"!==t.type||null==_(t))return;const s=m(t);if(!s)return;const e=this.countries.find((t=>String(t.id)===String(s)));if(!e)return;this.selectedCountry=e,this.updateNewAddressForm({country_id:Number(e.id)});const i=c(e.code),l=_(t),a=C(t),n=k(t),r=t.address_details?.district?.name,[o,d,h]=await Promise.all([i?u.getRegions(e.id):Promise.resolve([]),u.getCities(e.id,i&&null!=a?a:void 0),null!=l?u.getDistricts(Number(l)):Promise.resolve([])]);if(i&&(this.regions=o),this.cities=d,this.districts=h,this.loadingCities=!1,this.loadingRegions=!1,this.loadingDistricts=!1,i&&null!=a){const t=this.regions.find((t=>String(t.id)===String(a)));t&&(this.selectedRegion=t,this.updateNewAddressForm({region_id:t.id}))}if(null!=l&&this.cities.length>0){const t=this.cities.find((t=>String(t.id)===String(l)));t&&(this.selectedCity=t,this.updateNewAddressForm({city_id:t.id,city:t}))}if(this.districts.length>0){const t=this.findPrefillDistrict(n,r);t&&(this.updateNewAddressForm({district_id:t.id,district:t}),this.selectedDistrict=t)}}updateNewAddressForm(t){this.newAddressForm={...this.newAddressForm,...t}}hasBeenShownThisSession(){return!!Salla.storage.session.get(this.sessionShownKey)}markShownThisSession(){Salla.storage.session.set(this.sessionShownKey,!0)}async loadCountries(t=!1){const s="branch"===this.activeTab;this.countries=await u.getCountries(s);const e=Salla.config.get("store.settings.bullet_delivery.customer_location.country"),i=e&&this.countries.length>0?this.countries.find((t=>String(t.code).toUpperCase()===String(e).toUpperCase())):null;i&&(this.selectedCountry=i,this.updateNewAddressForm({country_id:Number(this.selectedCountry.id)}),t||(c(this.selectedCountry.code)?await this.loadRegions(this.selectedCountry.id):await this.loadCities(this.selectedCountry.id)))}async loadCities(t,s){this.loadingCities=!0,this.cities=[],this.districts=[],this.selectedCity=null,this.selectedDistrict=null,this.districtName="";try{this.cities=await u.getCities(t,s)}finally{this.loadingCities=!1}}async loadDistricts(t){this.loadingDistricts=!0,this.districts=[],this.selectedDistrict=null,this.districtName="";try{this.districts=await u.getDistricts(t)}finally{this.loadingDistricts=!1}}findPrefillDistrict(t,s){if(0===this.districts.length)return;if(null!=t){const s=this.districts.find((s=>String(s.id)===String(t)));if(s)return s}const e=s?.trim().toLowerCase();return e?this.districts.find((t=>{const s=t.name?.trim().toLowerCase(),i=t.name_en?.trim().toLowerCase();return s===e||i===e})):void 0}async loadBranches(){this.loadingBranches=!0;try{this.branches=await u.getBranches({country_id:this.selectedCountry?.id}),this.filterBranches()}finally{this.loadingBranches=!1}}filterBranches(){this.filteredBranches=((t,s)=>{if(!s)return t;const e=s.toLowerCase();return t.filter((t=>t.name.toLowerCase().includes(e)||t.city?.name?.toLowerCase().includes(e)))})(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 s=m(t);if(null!=s){const e=this.countries.find((t=>String(t.id)===String(s)));if(e){this.selectedCountry=e,this.updateNewAddressForm({country_id:Number(e.id)});const s=w(t);if(null!=s&&this.branches.length>0){const t=this.branches.find((t=>t.id===s));t&&(this.selectedBranch=t)}}}}}catch(t){console.error("[BulletDelivery] Error prefilling from session storage:",t)}}async loadSavedAddresses(){this.savedAddresses=await u.getSavedAddresses();const t=this.getStoredIntent();if(M(t))this.selectedSessionAddress=!0,this.selectedSavedAddress=null;else{const t=this.savedAddresses.find((t=>t.is_default&&!1!==t.is_in_coverage));if(t)this.selectedSavedAddress=t;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.cities=[],this.districts=[],this.selectedCity=null,this.selectedDistrict=null,this.districtName="",this.allocationOutOfCoverageMessage=null,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():c(this.selectedCountry.code)?this.loadRegions(this.selectedCountry.id):this.loadCities(this.selectedCountry.id))}async loadRegions(t){this.loadingRegions=!0,this.regions=[],this.selectedRegion=null,this.cities=[],this.districts=[],this.selectedCity=null,this.selectedDistrict=null,this.districtName="";try{this.regions=await u.getRegions(t)}finally{this.loadingRegions=!1}}async handleGuestToRegisteredSync(){try{if(!Salla.config.get("user.id"))return;const t=this.getStoredIntent();if(!t||"address"!==t.type)return;const s=function(t,s){const e=_(t),i=k(t);return s.find((s=>!(null==e||(s.city?.id??s.city_id)!==e||null!=i&&((s.district?.id??s.district_id)!==i||t.street&&s.street&&t.street.toLowerCase()!==s.street.toLowerCase()))))??null}(t,await u.getSavedAddresses());if(s){await this.setAddressAsActive(s.id);const e={...t,address_id:s.id,address_details:this.buildIntentAddressFromSaved(s)};this.setStoredIntent(e)}else if(_(t)){const s=await this.createAddressFromGuestSession(t);if(s){const e={...t,address_id:s.id,address_details:this.buildIntentAddressFromSaved(s)};this.setStoredIntent(e),this.addressCreated.emit({address:s})}}Salla.event.emit("bullet-delivery::guest-synced",{guest_intent:t,matched_address_id:s?.id})}catch(t){console.error("SallaBulletDelivery: Error syncing guest session to user profile",t)}}async setAddressAsActive(t){try{await(Salla.address?.api?.setDefault?.(t))}catch(t){console.warn("SallaBulletDelivery: Could not set address as default",t)}}async createAddressFromGuestSession(t){const s=m(t),e=_(t);if(!s||!e)return null;const i=c(f(t)),l=t.address_details?.district?.name??"",a={country_id:s,region_id:C(t),city_id:e,district_id:k(t),description:l};i&&(a.local=l);try{const{success:s,address:i}=await u.saveAddressLocation(a);if(!s)return null;if(i)return i;const l=await u.getSavedAddresses(),n=k(t);return l.find((t=>(t.city_id??t.city?.id)===e&&(t.district_id??t.district?.id)===n))??l[0]??null}catch(t){return console.error("SallaBulletDelivery: Could not create address from guest session",t),null}}emitHeaderContextUpdate(t,s,e){let i="";"address"===t.type?s?i=s.district?.name&&s.city?.name?`${s.district.name}، ${s.city.name}`:s.city?.name??"":this.selectedCity?i=this.selectedDistrict?`${this.selectedDistrict.name}، ${this.selectedCity.name}`:this.selectedCity.name:t.address_details&&(i=[t.address_details.district?.name,t.address_details.city.name,t.address_details.country.name].filter(Boolean).join("، ")||t.address_details.short_address||""):e?i=e.name:t.branch_details&&(i=t.branch_details.city??t.branch_details.name);const l="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:i?`${l}: ${i}`:"",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:e?.name??t.branch_details?.name})}handleBranchSearch(t){const s=t.target.value;if(this.branchSearchQuery=s,this.branchSearchDebounceTimer&&clearTimeout(this.branchSearchDebounceTimer),!s?.trim())return this.branchSearchQuery="",void this.loadBranches();this.branchSearchDebounceTimer=setTimeout((async()=>{if(!(s.trim().length<2)){this.loadingBranches=!0;try{this.branches=await u.getBranches({country_id:this.selectedCountry?.id,query:s}),this.filterBranches()}finally{this.loadingBranches=!1}}}),1e3)}async loadBranchesWithLocation(t,s){this.loadingBranches=!0;try{if(this.branches=await u.getBranches({country_id:this.selectedCountry?.id,lat:t,lng:s}),this.filterBranches(),!this.selectedCountry&&this.branches.length>0){const t=this.branches[0];if(t.country){const s=this.countries.find((s=>s.id===t.country.id));s&&(this.selectedCountry=s,this.updateNewAddressForm({country_id:Number(s.id)}))}}}finally{this.loadingBranches=!1}}async handleFindNearestBranch(){if(navigator.geolocation){this.loadingNearestBranch=!0,this.locationError="";try{const t=await new Promise(((t,s)=>{navigator.geolocation.getCurrentPosition(t,s,{enableHighAccuracy:!0,timeout:1e4,maximumAge:0})})),{latitude:s,longitude:e}=t.coords;await this.loadBranchesWithLocation(s,e);const i=function(t,s,e){let i=null,l=Number.POSITIVE_INFINITY;for(const a of t){const t=null!=a.location?.lat?Number(a.location.lat):Number.NaN,n=null!=a.location?.lng?Number(a.location.lng):Number.NaN;if(Number.isNaN(t)||Number.isNaN(n)||!1===a.is_open)continue;const r=b(s,e,t,n);r<l&&(l=r,i=a)}return i}(this.branches,s,e);i&&(this.selectedBranch=i,this.branchSearchQuery="",this.filterBranches())}catch(t){const s=t;this.locationError=B["number"==typeof s?.code?s.code:-1]??"An error occurred while detecting location"}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";const t=this.getStoredIntent(),s=m(t);if(s&&this.countries.length>0){const t=this.countries.find((t=>t.id===s));t&&(this.selectedCountry=t,this.updateNewAddressForm({country_id:Number(t.id)}),c(t.code)?await this.loadRegions(t.id):await this.loadCities(t.id))}}handleBackToAddressList(){this.viewMode="main"}buildAddressLocationPayload(){const t=this.selectedDistrict?.name??this.districtName?.trim()??"";return function(t){const{countryId:s,countryCode:e,regionId:i,cityId:l,districtId:a,description:n=""}=t,r=n||"";return{country_id:Number(s)||void 0,region_id:null!=i?Number(i):void 0,city_id:null!=l?Number(l):void 0,district_id:null!=a?Number(a):void 0,description:r,...e&&c(e)&&{local:r}}}({countryId:this.selectedCountry?.id??0,countryCode:this.selectedCountry?.code,regionId:this.selectedRegion?.id,cityId:this.selectedCity?.id,districtId:this.selectedDistrict?.id,description:t})}async handleTabChange(t){if(!this.tabChanging){this.tabChanging=!0;try{this.activeTab=t,this.showCartWillBeClearedBanner=!1,this.allocationOutOfCoverageMessage=null;const s="branch"===t;this.countries=await u.getCountries(s);const e=this.selectedCountry?.id;if(null!=e&&(this.selectedCountry=this.countries.find((t=>t.id===e))||null),this.selectedCountry)if("branch"===t){const t=this.getStoredIntent(),s=S(t),e=x(t);null!=s&&null!=e?await this.loadBranchesWithLocation(s,e):await this.loadBranches();const i=w(t);if(null!=i&&this.branches.length>0){const t=this.branches.find((t=>t.id===i));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&&_(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.selectedCountry&&this.selectedCity&&A(this.selectedCountry?.code,this.selectedRegion?.id,this.selectedDistrict?.id??(this.districtName?.trim()||null))))}handleLogin(){Salla.event.dispatch("bullet-delivery::close"),Salla.event.dispatch("login::open")}buildIntentAddress(){if("address"!==this.activeTab||!this.selectedCountry||!this.selectedCity)return;const t={id:this.selectedCountry.id,name:this.selectedCountry.name,code:this.selectedCountry.code},s={id:this.selectedCity.id,name:this.selectedCity.name},e=this.selectedRegion?{id:this.selectedRegion.id,name:this.selectedRegion.name,code:this.selectedRegion.code}:void 0,i=this.selectedDistrict?{id:this.selectedDistrict.id,name:this.selectedDistrict.name}:this.districtName?{id:0,name:this.districtName}:void 0,l=this.selectedSavedAddress?.short_address;return{country:t,region:e,city:s,district:i,short_address:l}}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,s=null!=t.location?.lat?Number(t.location.lat):void 0,e=null!=t.location?.lng?Number(t.location.lng):void 0;return{id:t.id,name:t.name,city:t.city?.name,latitude:s,longitude:e}}async handleConfirm(){if(this.isConfirmDisabled()||this.confirming)return;this.confirming=!0,this.confirmBtn?.load();let t=!1;try{const s={type:this.activeTab,country_id:Number(this.selectedCountry?.id)||0,country_code:this.selectedCountry?.code||""};let e,i,l,a=!1;if("address"===this.activeTab)if(this.isLoggedIn&&this.selectedSessionAddress){a=!0;const t=await this.saveSessionAddressToProfile();if(!t)return Salla.notify?.error(Salla.lang.get("common.errors.error_occurred")),void this.confirmBtn?.stop();s.address_id=t.id,e=t,this.selectedSessionAddress=!1,this.selectedSavedAddress=t,s.address_details=this.buildIntentAddressFromSaved(t)}else this.isLoggedIn&&this.selectedSavedAddress?(s.address_id=this.selectedSavedAddress.id,e=this.selectedSavedAddress,s.address_details=this.buildIntentAddressFromSaved(this.selectedSavedAddress)):s.address_details=this.buildIntentAddress();else s.branch_details=this.buildIntentBranch(),s.branch_id=this.selectedBranch?.id,i=this.selectedBranch||void 0;"address"===this.activeTab?this.isLoggedIn&&this.selectedSavedAddress?l={type:"address",address_id:String(this.selectedSavedAddress.id)}:(l={type:"address",country_id:String(this.selectedCountry?.id||0),city_id:String(this.selectedCity?.id||"")},c(this.selectedCountry?.code??"")&&(this.selectedRegion?.id&&(l.region_id=String(this.selectedRegion.id)),l.district_id=String(this.selectedDistrict?.id||""))):l={type:"branch",branch_id:String(this.selectedBranch?.id||"")};const n=await u.allocateScope(l);if(!n.success){console.error("BulletDelivery: Scope allocation failed",n.error);const t=n.error||("address"===this.activeTab?Salla.lang.get("pages.checkout.address_out_of_coverage"):Salla.lang.get("pages.checkout.failed_to_set_pickup"));return Salla.notify?.error(t),this.allocationOutOfCoverageMessage=t,this.confirmBtn?.stop(),void(this.confirming=!1)}let r;if(n.data){const t=n.data;r=t.id;const e=t?.allocation?.type,i=t?.allocation?.branch_id;e&&Salla.api.setHeader("s-scope-allocation-type",e),i&&Salla.api.setHeader("s-scope-allocation-id",String(i));const l=Salla.config.get("store.scope",Salla.storage.get("scope"))||{};Salla.storage.set("scope",{...l,id:r,allocation_type:e,allocation_id:i?String(i):void 0}),s.allocation_headers={"s-scope-allocation-type":e,"s-scope-allocation-id":i?String(i):void 0}}this.markShownThisSession(),a?this.removeStoredIntent():this.setStoredIntent(s),r&&await u.setDeliveryScope(r),this.bulletDeliveryConfirmed.emit({...s,address:e,branch:i}),this.emitHeaderContextUpdate(s,e,i),t=!0,setTimeout((()=>{if(this.confirmBtn?.stop(),this.close(),this.confirming=!1,r){const t=Salla.storage.get("scope")||{};let s=Salla.helpers.addParamToUrl("scope",r);t.allocation_id&&(s=Salla.helpers.addParamToUrl("allocation_id",t.allocation_id,s)),t.allocation_type&&(s=Salla.helpers.addParamToUrl("allocation_type",t.allocation_type,s)),window.location.replace(s)}else window.location.reload()}),500)}finally{t||(this.confirming=!1)}}getCartViewConfig(t){if(!t||!Salla.url.is_page("cart"))return null;const s="branch"===t.type,e="address"===t.type;return s&&!this.supportsPickup||!s&&!e?null:{title:s?Salla.lang.get("pages.checkout.pickup_option"):Salla.lang.get("pages.checkout.delivery_option"),subtitle:v(t,Salla.lang.get("common.elements.to"),""),buttonText:Salla.lang.get("common.elements.edit"),isAddress:e,intent:t}}createCartViewElement(){const t=this.getStoredIntent(),s=this.getCartViewConfig(t);if(!s)return null;const{title:e,subtitle:i,buttonText:l,intent:n}=s,r="branch"===n.type?{preselected_branch_id:w(n)}:{preselected_address_id:n.address_id},o=document.createElement("span");o.className="s-bullet-delivery-cart-view-icon s-bullet-delivery-tab-icon",o.setAttribute("aria-hidden","true"),o.innerHTML=a;const d=document.createElement("span");d.className="s-bullet-delivery-cart-view-title",d.textContent=e;const h=document.createElement("span");h.className="s-bullet-delivery-cart-view-subtitle",h.textContent=i;const c=document.createElement("div");c.className="s-bullet-delivery-cart-view-text",c.append(d,h);const u=document.createElement("div");u.className="s-bullet-delivery-cart-view-info",u.append(o,c);const y=document.createElement("salla-button");y.className="s-bullet-delivery-cart-view-button",y.setAttribute("fill","outline"),y.setAttribute("color","primary"),y.textContent=l,y.addEventListener("click",(()=>Salla.event.emit("bullet-delivery::open",r)));const b=document.createElement("div");return b.className="s-bullet-delivery-cart-view",b.append(u,y),b}renderSkeleton(){return e("div",{slot:"loading",class:"s-bullet-delivery-skeleton"},e("div",{class:"s-bullet-delivery-skeleton-header"},e("salla-skeleton",{class:"s-bullet-delivery-skeleton-title",height:"28px",width:"68%"}),e("salla-skeleton",{class:"s-bullet-delivery-skeleton-subtitle",height:"18px",width:"84%"})),e("div",{class:{"s-bullet-delivery-skeleton-tabs":!0,"s-bullet-delivery-skeleton-tabs--single":!this.supportsPickup}},e("div",{class:"s-bullet-delivery-skeleton-tab"},e("salla-skeleton",{class:"s-bullet-delivery-skeleton-tab-icon",height:"32px",width:"32px"}),e("salla-skeleton",{class:"s-bullet-delivery-skeleton-tab-label",height:"18px",width:"92px"})),this.supportsPickup&&e("div",{class:"s-bullet-delivery-skeleton-tab"},e("salla-skeleton",{class:"s-bullet-delivery-skeleton-tab-icon",height:"32px",width:"32px"}),e("salla-skeleton",{class:"s-bullet-delivery-skeleton-tab-label",height:"18px",width:"84px"}))),e("div",{class:"s-bullet-delivery-skeleton-content"},e("div",{class:"s-bullet-delivery-skeleton-field"},e("salla-skeleton",{class:"s-bullet-delivery-skeleton-field-label",height:"16px",width:"96px"}),e("salla-skeleton",{class:"s-bullet-delivery-skeleton-field-control",height:"56px",width:"100%"})),e("div",{class:"s-bullet-delivery-skeleton-field"},e("salla-skeleton",{class:"s-bullet-delivery-skeleton-field-label",height:"16px",width:"104px"}),e("salla-skeleton",{class:"s-bullet-delivery-skeleton-field-control",height:"56px",width:"100%"})),e("div",{class:"s-bullet-delivery-skeleton-field"},e("salla-skeleton",{class:"s-bullet-delivery-skeleton-field-label",height:"16px",width:"88px"}),e("salla-skeleton",{class:"s-bullet-delivery-skeleton-field-control",height:"56px",width:"100%"}))),e("div",{class:"s-bullet-delivery-skeleton-footer"},e("salla-skeleton",{height:"52px",width:"100%"})))}renderTabs(){return this.supportsPickup?e("div",{class:"s-bullet-delivery-tabs"},e("button",{type:"button",class:{"s-bullet-delivery-tab":!0,"s-bullet-delivery-tab--active":"address"===this.activeTab},onClick:()=>this.handleTabChange("address")},e("span",{class:"s-bullet-delivery-tab-icon",innerHTML:a,"aria-hidden":"true"}),e("span",null,Salla.lang.get("mobile_app.strings.delivery"))),e("button",{type:"button",class:{"s-bullet-delivery-tab":!0,"s-bullet-delivery-tab--active":"branch"===this.activeTab},onClick:()=>this.handleTabChange("branch")},e("span",{class:"s-bullet-delivery-tab-icon",innerHTML:L,"aria-hidden":"true"}),e("span",null,Salla.lang.get("mobile_app.strings.pickup")))):null}renderAlert(t){return e("div",{class:"s-bullet-delivery-allocation-out-of-coverage",role:"alert"},e("span",{class:"s-bullet-delivery-allocation-out-of-coverage-icon","aria-hidden":"true"},e("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-hidden":"true"},e("title",null,"Information"),e("circle",{cx:"10",cy:"10",r:"9",stroke:"currentColor","stroke-width":"1.5",fill:"currentColor"}),e("text",{x:"10",y:"14","text-anchor":"middle",fill:"white","font-size":"12","font-weight":"bold"},"i"))),e("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 e("div",{class:"s-bullet-delivery-field"},e("label",{class:"s-bullet-delivery-label",htmlFor:"bullet-delivery-country"},Salla.lang.get("blocks.buy_as_gift.receiver_country"),e("span",{class:"text-red-500"}," *")),e("select",{id:"bullet-delivery-country",class:"form-input",onChange:t=>{const s=Number.parseInt(t.target.value),e=this.countries.find((t=>t.id===s));this.showCartWillBeClearedBanner=!(!this.selectedCountry||!e||this.selectedCountry.code===e.code),this.applyCountryChange(e||null)}},e("option",{value:"",disabled:!0,selected:!this.selectedCountry},Salla.lang.get("pages.checkout.select_country")),this.countries.map((t=>e("option",{key:t.id,value:t.id,selected:this.selectedCountry?.id===t.id},t.name)))))}renderSelectLoader(){return e("span",{class:"s-bullet-delivery-select-loader","aria-hidden":"true"},e("salla-loading",{size:"16",width:"3"}))}renderLoadingLabel(t,s,i=!1,l=!0){return e("label",{class:"s-bullet-delivery-label",htmlFor:s},e("span",{class:"s-bullet-delivery-label-content"},e("span",null,t,l&&e("span",{class:"text-red-500"}," *")),i&&this.renderSelectLoader()))}renderRegionSelect(){return c(this.selectedCountry?.code??"")&&this.selectedCountry?e("div",{class:"s-bullet-delivery-field"},this.renderLoadingLabel(Salla.lang.get("pages.checkout.region_field"),"bullet-delivery-region",this.loadingRegions),e("select",{id:"bullet-delivery-region",class:"form-input",disabled:this.loadingRegions||0===this.regions.length,onChange:t=>{const s=Number.parseInt(t.target.value),e=this.regions.find((t=>t.id===s));this.selectedRegion=e||null,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)}},e("option",{value:"",disabled:!0,selected:!this.selectedRegion},Salla.lang.get("pages.checkout.select_region")),this.regions.map((t=>e("option",{key:t.id,value:t.id,selected:this.selectedRegion?.id===t.id},t.name))))):null}renderCityDistrictSelects(){const t=c(this.selectedCountry?.code??""),s=t,i=s&&this.selectedCity&&!this.loadingDistricts&&0===this.districts.length,l=!this.selectedCountry||t&&!this.selectedRegion||this.loadingCities||0===this.cities.length,a=!this.selectedCountry||t&&!this.selectedRegion||!this.selectedCity||this.loadingDistricts;return e("div",{class:"s-bullet-delivery-field-row"},e("div",{class:"s-bullet-delivery-field"},this.renderLoadingLabel(Salla.lang.get("blocks.buy_as_gift.receiver_city"),"bullet-delivery-city",this.loadingCities),e("select",{id:"bullet-delivery-city",class:"form-input",disabled:l,onChange:t=>{const e=Number.parseInt(t.target.value),i=this.cities.find((t=>t.id===e));this.selectedCity=i||null,this.selectedDistrict=null,this.districtName="",i&&(this.updateNewAddressForm({city:i,district:void 0}),s&&this.loadDistricts(i.id))}},e("option",{value:"",disabled:!0,selected:!this.selectedCity},Salla.lang.get("pages.checkout.select_city")),this.cities.map((t=>e("option",{key:t.id,value:t.id,selected:this.selectedCity?.id===t.id},t.name))))),s&&e("div",{class:"s-bullet-delivery-field"},this.renderLoadingLabel(Salla.lang.get("pages.checkout.district_field"),"bullet-delivery-district",this.loadingDistricts&&!i),i?e("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})}}):e("select",{id:"bullet-delivery-district",class:"form-input",disabled:a||0===this.districts.length,onChange:t=>{const s=Number.parseInt(t.target.value),e=this.districts.find((t=>t.id===s));this.selectedDistrict=e||null,this.districtName="",e&&this.updateNewAddressForm({district:e})}},e("option",{value:"",disabled:!0,selected:!this.selectedDistrict},Salla.lang.get("pages.checkout.select_district")),this.districts.map((t=>{const s="ar"===Salla.config.get("user.language_code")?t.name:t.name_en??t.name;return e("option",{key:t.id,value:t.id,selected:this.selectedDistrict?.id===t.id},s)})))))}renderSavedAddressesEmptyState(){return e("div",{class:"s-bullet-delivery-saved-addresses-empty"},e("div",{class:"s-bullet-delivery-saved-addresses-empty-icon","aria-hidden":"true"},e("svg",{width:"28",height:"28",viewBox:"0 0 28 29",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e("title",null,"No Saved Adresses"),e("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"}))),e("p",{class:"s-bullet-delivery-saved-addresses-empty-title"},Salla.lang.get("pages.checkout.no_saved_addresses")),e("p",{class:"s-bullet-delivery-saved-addresses-empty-desc"},Salla.lang.get("pages.checkout.add_address_simplify_shipping")),e("salla-button",{onClick:()=>this.handleAddNewAddress(),onKeyUp:()=>this.handleAddNewAddress()},Salla.lang.get("pages.checkout.add_new_address")))}async saveSessionAddressToProfile(){const t=this.getStoredIntent(),s=m(t),e=_(t),i=k(t);if(!t||"address"!==t.type||!s||!e)return null;const l=f(t);if(c(l)&&!i)return null;const a=c(l),n=t.address_details?.district?.name??"",r={country_id:s,region_id:C(t),city_id:e,district_id:i,description:n};a&&(r.local=n);try{const{success:t,address:s}=await u.saveAddressLocation(r);if(!t)return null;const e=s??null;return e&&this.addressCreated.emit({address:e}),e}catch(t){return console.error("SallaBulletDelivery: Error saving session address",t),null}}renderSavedAddresses(){if(!this.isLoggedIn)return null;if(this.loadingSavedAddresses)return e("div",null,e("salla-loading",{size:"md"}));const t=this.getStoredIntent(),s=M(t),i=s&&t?.address_details?[t.address_details.district?.name,t.address_details.city.name,t.address_details.country.name].filter(Boolean).join("، ")||[t.address_details.country.id,t.address_details.city.id].join(", "):"";return 0!==this.savedAddresses.length||s?e("div",{class:"s-bullet-delivery-addresses-list s-scrollbar"},s&&this.renderAddressRow({key:"session-address",line1:i,line2:"",selected:this.selectedSessionAddress,onClick:()=>this.handleSessionAddressSelect()}),this.savedAddresses.map((t=>{const s=[t.building_number,t.street].filter(Boolean).join("، ")||t.formatted?.address_one||t.short_address||"",e=([t.district?.name,t.city?.name,t.country?.name].filter(Boolean).join("، ")||t.formatted?.address_two)??"",i=!1!==t.is_in_coverage;return this.renderAddressRow({key:String(t.id),line1:s,line2:e,selected:this.selectedSavedAddress?.id===t.id,disabled:!i,onClick:()=>i&&this.handleSavedAddressSelect(t)})}))):this.renderSavedAddressesEmptyState()}renderAddressRow(t){const{key:s,line1:i,line2:l,selected:a,disabled:n=!1,onClick:r}=t;return e("button",{key:s,class:{"s-bullet-delivery-address-item":!0,"s-bullet-delivery-address-item--selected":a,"s-bullet-delivery-address-item--disabled":n},type:"button",onClick:n?void 0:r,onKeyDown:t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),n||r())}},e("input",{type:"radio",name:"saved_address",class:"s-bullet-delivery-radio",checked:a,disabled:n,onClick:t=>t.stopPropagation()}),e("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"}),e("div",{class:"s-bullet-delivery-address-content"},e("div",{class:"s-bullet-delivery-address-lines"},e("span",{class:"s-bullet-delivery-address-line1"},i),e("span",{class:"s-bullet-delivery-address-line2"},l))))}renderGuestDeliveryForm(){const t=c(this.selectedCountry?.code??"");return[this.renderCountrySelect(),t?this.renderRegionSelect():null,this.renderCityDistrictSelects()]}renderDeliveryTab(){return e("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.renderGuestDeliveryForm())}renderBranchSearch(){return e("div",{class:"s-bullet-delivery-branch-search"},e("div",{class:"s-bullet-delivery-search-row"},e("div",{class:"s-bullet-delivery-search s-bullet-delivery-branch-search-wrap"},e("span",{class:"s-bullet-delivery-search-icon s-bullet-delivery-branch-search-icon",innerHTML:l,"aria-hidden":"true"}),e("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"})),e("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?e("salla-loading",{size:"sm"}):e("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"}),e("span",null,Salla.lang.get("pages.checkout.nearest_to_my_location")))),this.locationError&&"branch"===this.activeTab&&e("span",{class:"s-bullet-delivery-error"},this.locationError))}renderBranchList(){return this.loadingBranches?e("div",{class:"s-bullet-delivery-branches-wrap"},e("div",{class:"s-bullet-delivery-branches-loading"},[1,2,3,4].map((t=>e("div",{key:t,class:"s-bullet-delivery-branch-skeleton"},e("salla-skeleton",{class:"s-bullet-delivery-branch-skeleton-radio",type:"circle",height:"16px",width:"16px"}),e("div",{class:"s-bullet-delivery-branch-skeleton-icon"},e("salla-skeleton",{height:"34px",width:"34px"})),e("div",{class:"s-bullet-delivery-branch-skeleton-content"},e("salla-skeleton",{class:"s-bullet-delivery-branch-skeleton-title",height:"12px",width:"124px"})),e("salla-skeleton",{class:"s-bullet-delivery-branch-skeleton-time",height:"12px",width:"88px"}),e("div",{class:"s-bullet-delivery-branch-skeleton-map"},e("salla-skeleton",{height:"32px",width:"32px"}))))))):0===this.filteredBranches.length?e("salla-placeholder",{alignment:"center",class:"s-bullet-delivery-placeholder"},e("span",{slot:"title"},Salla.lang.get("pages.checkout.no_pickup_branches_found"))):e("div",{class:"s-bullet-delivery-branches-wrap"},e("ul",{class:"s-bullet-delivery-branches-list s-scrollbar"},this.filteredBranches.map((t=>e("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":!1===t.is_open},tabIndex:!1===t.is_open?-1:0,role:"option","aria-disabled":!1===t.is_open,onClick:()=>!1!==t.is_open&&this.handleBranchSelect(t),onKeyDown:s=>{"Enter"!==s.key&&" "!==s.key||(s.preventDefault(),!1!==t.is_open&&this.handleBranchSelect(t))}},e("input",{type:"radio",name:"branch",class:"s-bullet-delivery-radio",checked:this.selectedBranch?.id===t.id,disabled:!1===t.is_open}),e("span",{class:"s-bullet-delivery-branch-icon","aria-hidden":"true"},e("span",{innerHTML:L})),e("div",{class:"s-bullet-delivery-branch-info"},e("span",{class:"s-bullet-delivery-branch-name"},t.name),t.preparation_time?e("span",{class:"s-bullet-delivery-branch-prep"},`${Salla.lang.get("pages.checkout.processing_time")}: ${t.preparation_time}`):null),(()=>{const s=(i=t.working_hours,i?.[0]?.times?.[0]??null);var i;return s?e("span",{class:"s-bullet-delivery-branch-time"},function(t,s,e,i){const l=String(t).trim(),a=String(s).trim();return l&&a?"00:00"===l?`${i} ${p(a,e)}`:`${p(l,e)} - ${p(a,e)}`:""}(s.from,s.to,Salla.config.get("user.language_code")||"ar",Salla.lang.get("pages.checkout.until"))):null})(),null!=t.location?.lat&&null!=t.location?.lng&&e("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()},e("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"}),e("span",{class:"sr-only"},Salla.lang.get("common.elements.open_in_google_maps"))))))))}renderPickupTab(){return e("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(){const t=Salla.lang.get("pages.checkout.add_new_address"),s=c(this.selectedCountry?.code??""),i=this.selectedCountry&&this.selectedCity&&(!s||this.selectedRegion)&&(!s||!!this.selectedDistrict||!!(this.districtName&&this.districtName.trim().length>0)),l=this.savingAddress?Salla.lang.get("pages.checkout.loading"):Salla.lang.get("pages.checkout.confirm_address");return e("div",{class:"s-bullet-delivery-add-address"},e("div",{class:"s-bullet-delivery-add-address-header"},e("button",{type:"button",class:"s-bullet-delivery-add-address-title",onClick:()=>this.handleBackToAddressList(),onKeyDown:t=>"Enter"===t.key&&this.handleBackToAddressList()},e("span",{innerHTML:this.isRTL?n:r,"aria-hidden":"true"}),e("span",{class:"s-bullet-delivery-add-address-title-text"},t))),e("form",{class:"s-bullet-delivery-add-address-form",onSubmit:t=>this.handleSubmitAddAddress(t)},this.renderGuestDeliveryForm(),e("div",{class:"s-bullet-delivery-form-actions s-bullet-delivery-form-actions--single"},e("salla-button",{type:"submit",loading:this.savingAddress,disabled:!i||this.savingAddress,class:"s-bullet-delivery-add-address-submit"},l))))}renderFooter(){const t="address"===this.activeTab&&this.isLoggedIn;return e("div",{class:"s-bullet-delivery-footer"},e("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&&e("salla-button",{onClick:()=>this.handleAddNewAddress(),width:"wide",shape:"link"},Salla.lang.get("pages.checkout.add_new_address")),!this.isLoggedIn&&e("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&&!M(this.getStoredIntent()),s="branch"===this.activeTab&&this.supportsPickup?this.renderPickupTab():this.renderDeliveryTab();return e("div",null,e("div",{class:"s-bullet-delivery-header"},e("h2",{class:"s-bullet-delivery-title"},Salla.lang.get("blocks.home.select_the_receiving_method")),e("p",{class:"s-bullet-delivery-subtitle"},Salla.lang.get("pages.checkout.delivery_pickup_availability_hint"))),this.renderTabs(),this.showCartWillBeClearedBanner&&this.renderAlert(Salla.lang.get("blocks.scope.empty_cart_warning")),this.allocationOutOfCoverageMessage&&this.renderAllocationOutOfCoverageAlert(),s,!t&&this.renderFooter())}handleAfterAddToCart(){"after_add_to_cart"===this.openingType&&(this.hasBeenShownThisSession()||this.modal?.hasAttribute?.("visible")||this.open())}overrideScopeSwitchUI(){const t=this.getStoredIntent(),s=document.querySelector('[onclick*="scopes"]');if(!s)return;const e=(t,s)=>t&&t.length>s?`${t.slice(0,s)}...`:t??"",i=t?"branch"===t.type?`${Salla.lang.get("mobile_app.strings.pickup")} ${Salla.lang.get("common.elements.from")} ${e(t.branch_details?.name,20)}`:`${Salla.lang.get("mobile_app.strings.delivery")} ${Salla.lang.get("common.elements.to")} ${e(t.address_details?.city?.name,10)}`:Salla.lang.get("common.titles.shipping");s.style.display=t?"":"none",s.onclick=()=>this.open();const l=s.querySelector('span:not([class*="sicon"]):not([class*="icon"])');if(l)l.textContent=i;else{const t=Array.from(s.childNodes).find((t=>t.nodeType===Node.TEXT_NODE&&t.textContent?.trim()));t&&(t.textContent=` ${i}`)}}async componentWillLoad(){await Salla.onReady();try{this.overrideScopeSwitchUI()}catch(t){console.warn("SallaBulletDelivery: overrideScopeSwitchUI failed",t)}Salla.event.on("bullet-delivery::open",this.bulletDeliveryOpenHandler),this.closeHandler=this.close.bind(this),Salla.event.on("bullet-delivery::close",this.closeHandler),this.guestLoginSyncHandler=this.handleGuestToRegisteredSync.bind(this),Salla.event.on("login::success",this.guestLoginSyncHandler),Salla.event.on("auth::logged-in",this.guestLoginSyncHandler),this.isRTL=Salla.config.get("theme.is_rtl"),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 e(i,{key:"5d79f6404692b4a68504770a54f46c9e5161e533",class:"s-bullet-delivery"},e("salla-modal",{key:"f123012f8593e20eeb14ebf59fc8dc5af9bbe12b",ref:t=>{this.modal=t},isClosable:!this.isRequired,class:"s-bullet-delivery-modal",isLoading:this.loading,width:"sm"},this.loading?this.renderSkeleton():e("div",{class:"s-bullet-delivery-inner"},"main"===this.viewMode&&this.renderMainView(),"add-address"===this.viewMode&&this.renderAddAddressForm())))}componentDidLoad(){if(this.componentReady=!0,this.pendingOpen)return this.pendingOpen=!1,void this.open();switch(this.openingType){case"first_visit":this.hasBeenShownThisSession()||this.open();break;case"on_cart_click":Salla.url.is_page("cart")&&!0!==Salla.storage.session.get(this.sessionShownKey)&&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("bullet-delivery::open",this.bulletDeliveryOpenHandler),this.closeHandler&&(Salla.event.off("bullet-delivery::close",this.closeHandler),this.closeHandler=null),this.guestLoginSyncHandler&&(Salla.event.off("login::success",this.guestLoginSyncHandler),Salla.event.off("auth::logged-in",this.guestLoginSyncHandler),this.guestLoginSyncHandler=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)}};N.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},N.style="@supports (interpolate-size: allow-keywords) and (block-size: calc-size(auto, size)) {\n .s-bullet-delivery .s-bullet-delivery-modal .s-modal-body, .s-bullet-delivery-inner {\n @apply [interpolate-size:allow-keywords];\n }\n .s-bullet-delivery .s-bullet-delivery-modal .s-modal-body {\n @apply [overflow:clip] [transition:block-size_500ms_ease];\n }\n .s-bullet-delivery-inner {\n @apply [overflow:clip] [transition:block-size_500ms_ease];\n block-size: calc-size(auto, size);\n }\n}\n\n@keyframes s-bullet-delivery-fade-in {\n from {\n opacity: 0;\n transform: translateY(6px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n}";export{N as salla_bullet_delivery}
|