@salla.sa/twilight-theme-engine 1.0.139 → 1.0.140
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/{AddToCartForm-QGJ2XVCZ.js → AddToCartForm-EPTN5O3X.js} +3 -3
- package/dist/{AddToCartForm-QGJ2XVCZ.js.map → AddToCartForm-EPTN5O3X.js.map} +1 -1
- package/dist/{BlogAuthorPage-5QGP4RDK.js → BlogAuthorPage-PGFINJSP.js} +16 -16
- package/dist/{BlogAuthorPage-5QGP4RDK.js.map → BlogAuthorPage-PGFINJSP.js.map} +1 -1
- package/dist/{BlogCategoryPage-FH7ASETM.js → BlogCategoryPage-ZVRRHTKJ.js} +16 -16
- package/dist/{BlogCategoryPage-FH7ASETM.js.map → BlogCategoryPage-ZVRRHTKJ.js.map} +1 -1
- package/dist/{BlogPage-HNNR2Q4U.js → BlogPage-5SRGR7NK.js} +14 -14
- package/dist/{BlogPage-HNNR2Q4U.js.map → BlogPage-5SRGR7NK.js.map} +1 -1
- package/dist/{BlogSinglePage-OYXJCOJ2.js → BlogSinglePage-6A5J2BKK.js} +14 -14
- package/dist/{BlogSinglePage-OYXJCOJ2.js.map → BlogSinglePage-6A5J2BKK.js.map} +1 -1
- package/dist/{BlogTagPage-XEHXO4PE.js → BlogTagPage-DAA3ZO76.js} +16 -16
- package/dist/{BlogTagPage-XEHXO4PE.js.map → BlogTagPage-DAA3ZO76.js.map} +1 -1
- package/dist/{BrandsPage-QSTJTEAA.js → BrandsPage-JABKRWP2.js} +15 -15
- package/dist/{BrandsPage-QSTJTEAA.js.map → BrandsPage-JABKRWP2.js.map} +1 -1
- package/dist/{Breadcrumb-7QGTM5S5.js → Breadcrumb-SCJZW4RO.js} +14 -14
- package/dist/{Breadcrumb-7QGTM5S5.js.map → Breadcrumb-SCJZW4RO.js.map} +1 -1
- package/dist/{CartItem-7FNRMTQS.js → CartItem-3KFTPQVF.js} +14 -14
- package/dist/{CartItem-7FNRMTQS.js.map → CartItem-3KFTPQVF.js.map} +1 -1
- package/dist/{CartSummary-A32524GZ.js → CartSummary-I64SD4QX.js} +14 -14
- package/dist/{CartSummary-A32524GZ.js.map → CartSummary-I64SD4QX.js.map} +1 -1
- package/dist/{Copyright-PVSTODJF.js → Copyright-3TREUCAK.js} +3 -3
- package/dist/{Copyright-PVSTODJF.js.map → Copyright-3TREUCAK.js.map} +1 -1
- package/dist/{CustomerLayout-NOHKTFXG.js → CustomerLayout-BH74QWRI.js} +14 -14
- package/dist/{CustomerLayout-NOHKTFXG.js.map → CustomerLayout-BH74QWRI.js.map} +1 -1
- package/dist/{Footer-RDRSICZP.js → Footer-DSSOB3ZW.js} +4 -4
- package/dist/{Footer-RDRSICZP.js.map → Footer-DSSOB3ZW.js.map} +1 -1
- package/dist/{Header-YCS4HJCH.js → Header-UWUS34D6.js} +8 -8
- package/dist/{Header-YCS4HJCH.js.map → Header-UWUS34D6.js.map} +1 -1
- package/dist/{LatestProducts-JEOWAHON.js → LatestProducts-VLSTOKEB.js} +16 -16
- package/dist/{LatestProducts-JEOWAHON.js.map → LatestProducts-VLSTOKEB.js.map} +1 -1
- package/dist/{LoyaltyPage-TE5E3OJC.js → LoyaltyPage-3FAD5MJ6.js} +14 -14
- package/dist/{LoyaltyPage-TE5E3OJC.js.map → LoyaltyPage-3FAD5MJ6.js.map} +1 -1
- package/dist/{LoyaltyPointsPage-GI3EQOLY.js → LoyaltyPointsPage-A4CTI55P.js} +6 -6
- package/dist/{LoyaltyPointsPage-GI3EQOLY.js.map → LoyaltyPointsPage-A4CTI55P.js.map} +1 -1
- package/dist/{MainMenu-46II2DJE.js → MainMenu-C7TWXVL5.js} +6 -6
- package/dist/MainMenu-C7TWXVL5.js.map +1 -0
- package/dist/{MasterLayout-ZYWD2XZO.js → MasterLayout-MZY44RTA.js} +14 -14
- package/dist/{MasterLayout-ZYWD2XZO.js.map → MasterLayout-MZY44RTA.js.map} +1 -1
- package/dist/{MobileMenu-O7354R4E.js → MobileMenu-KNDN34HO.js} +15 -15
- package/dist/{MobileMenu-O7354R4E.js.map → MobileMenu-KNDN34HO.js.map} +1 -1
- package/dist/{NotificationsPage-OZKKZ2CC.js → NotificationsPage-LKUTYWPR.js} +14 -14
- package/dist/{NotificationsPage-OZKKZ2CC.js.map → NotificationsPage-LKUTYWPR.js.map} +1 -1
- package/dist/{OrderSinglePage-IVOIE2YE.js → OrderSinglePage-VDALCKJL.js} +15 -15
- package/dist/{OrderSinglePage-IVOIE2YE.js.map → OrderSinglePage-VDALCKJL.js.map} +1 -1
- package/dist/{OrdersPage-PMLHIHDV.js → OrdersPage-TOSCY6ML.js} +14 -14
- package/dist/{OrdersPage-PMLHIHDV.js.map → OrdersPage-TOSCY6ML.js.map} +1 -1
- package/dist/{PageSingle-C3NBFFHR.js → PageSingle-56SRDA4Q.js} +3 -3
- package/dist/{PageSingle-C3NBFFHR.js.map → PageSingle-56SRDA4Q.js.map} +1 -1
- package/dist/{ProductDetails-R7SFKXNC.js → ProductDetails-YYU7TJSU.js} +4 -4
- package/dist/{ProductDetails-R7SFKXNC.js.map → ProductDetails-YYU7TJSU.js.map} +1 -1
- package/dist/{ProfilePage-5FU4N6O7.js → ProfilePage-CTGBAD2A.js} +14 -14
- package/dist/{ProfilePage-5FU4N6O7.js.map → ProfilePage-CTGBAD2A.js.map} +1 -1
- package/dist/{ReviewsPage-M7QHDNCJ.js → ReviewsPage-RJ5VQVB2.js} +3 -3
- package/dist/{ReviewsPage-M7QHDNCJ.js.map → ReviewsPage-RJ5VQVB2.js.map} +1 -1
- package/dist/{SeoCartWidget-T6PF34G4.js → SeoCartWidget-VL5TD2FU.js} +14 -14
- package/dist/{SeoCartWidget-T6PF34G4.js.map → SeoCartWidget-VL5TD2FU.js.map} +1 -1
- package/dist/{SettingsPage-HBREYY5Q.js → SettingsPage-ZHDB3YZS.js} +14 -14
- package/dist/{SettingsPage-HBREYY5Q.js.map → SettingsPage-ZHDB3YZS.js.map} +1 -1
- package/dist/{StoreClosedNotification-QTKW4PQ2.js → StoreClosedNotification-VP2ACWD6.js} +15 -15
- package/dist/{StoreClosedNotification-QTKW4PQ2.js.map → StoreClosedNotification-VP2ACWD6.js.map} +1 -1
- package/dist/{TestimonialsPage-ESB4CQRS.js → TestimonialsPage-V2RWUVZD.js} +3 -3
- package/dist/{TestimonialsPage-ESB4CQRS.js.map → TestimonialsPage-V2RWUVZD.js.map} +1 -1
- package/dist/{ThankYouPage-BLYIJQNV.js → ThankYouPage-NJKASZ2R.js} +14 -14
- package/dist/{ThankYouPage-BLYIJQNV.js.map → ThankYouPage-NJKASZ2R.js.map} +1 -1
- package/dist/{WalletPage-7YOOVSXO.js → WalletPage-N4FDKDK3.js} +15 -15
- package/dist/{WalletPage-7YOOVSXO.js.map → WalletPage-N4FDKDK3.js.map} +1 -1
- package/dist/{WishlistPage-MXVTTJD6.js → WishlistPage-JCOG3KOV.js} +16 -16
- package/dist/{WishlistPage-MXVTTJD6.js.map → WishlistPage-JCOG3KOV.js.map} +1 -1
- package/dist/api/advertisement.js +2 -2
- package/dist/api/apps.js +2 -2
- package/dist/api/blog.js +3 -3
- package/dist/api/brands.js +3 -3
- package/dist/api/cart.js +3 -3
- package/dist/api/category.js +3 -3
- package/dist/api/client.js +1 -1
- package/dist/api/home.js +2 -2
- package/dist/api/loyalty.js +3 -3
- package/dist/api/menu.js +2 -2
- package/dist/api/notification.js +2 -2
- package/dist/api/order.js +3 -3
- package/dist/api/page.js +3 -3
- package/dist/api/product.js +3 -3
- package/dist/api/profile.js +1 -1
- package/dist/api/store.js +2 -2
- package/dist/api/translations.js +2 -2
- package/dist/api/user.js +2 -2
- package/dist/api/wallet.js +2 -2
- package/dist/api/wishlist.js +4 -4
- package/dist/{chunk-ZU7TSTT7.js → chunk-2AS6KREO.js} +3 -3
- package/dist/{chunk-ZU7TSTT7.js.map → chunk-2AS6KREO.js.map} +1 -1
- package/dist/{chunk-YF3U4WYG.js → chunk-33R2PXOK.js} +4 -4
- package/dist/{chunk-YF3U4WYG.js.map → chunk-33R2PXOK.js.map} +1 -1
- package/dist/{chunk-WWGGQY6N.js → chunk-3CKMMFUF.js} +4 -4
- package/dist/{chunk-WWGGQY6N.js.map → chunk-3CKMMFUF.js.map} +1 -1
- package/dist/{chunk-HGNR4XBD.js → chunk-444GCMTZ.js} +7 -7
- package/dist/{chunk-HGNR4XBD.js.map → chunk-444GCMTZ.js.map} +1 -1
- package/dist/{chunk-JI6ZNE7R.js → chunk-5NTD7WXX.js} +3 -3
- package/dist/{chunk-JI6ZNE7R.js.map → chunk-5NTD7WXX.js.map} +1 -1
- package/dist/{chunk-HUJARQI7.js → chunk-7DRXAR76.js} +3 -3
- package/dist/{chunk-HUJARQI7.js.map → chunk-7DRXAR76.js.map} +1 -1
- package/dist/{chunk-ISDSQORB.js → chunk-7PFJOTZS.js} +4 -4
- package/dist/{chunk-ISDSQORB.js.map → chunk-7PFJOTZS.js.map} +1 -1
- package/dist/{chunk-5KKQUH72.js → chunk-ABVHWJPY.js} +10 -3
- package/dist/chunk-ABVHWJPY.js.map +1 -0
- package/dist/{chunk-FG2B552D.js → chunk-AEM5UEH6.js} +3 -3
- package/dist/{chunk-FG2B552D.js.map → chunk-AEM5UEH6.js.map} +1 -1
- package/dist/{chunk-J4GUGMPX.js → chunk-ATL7CYF2.js} +3 -3
- package/dist/{chunk-J4GUGMPX.js.map → chunk-ATL7CYF2.js.map} +1 -1
- package/dist/{chunk-ONPV2TED.js → chunk-AZT4TALZ.js} +5 -5
- package/dist/{chunk-ONPV2TED.js.map → chunk-AZT4TALZ.js.map} +1 -1
- package/dist/{chunk-XETMTAZC.js → chunk-BPM6LSOV.js} +4 -4
- package/dist/{chunk-XETMTAZC.js.map → chunk-BPM6LSOV.js.map} +1 -1
- package/dist/{chunk-E7TU4RW4.js → chunk-CU2DV3Z4.js} +3 -3
- package/dist/{chunk-E7TU4RW4.js.map → chunk-CU2DV3Z4.js.map} +1 -1
- package/dist/{chunk-EPMM5ZWB.js → chunk-F3SXHQU4.js} +5 -5
- package/dist/{chunk-EPMM5ZWB.js.map → chunk-F3SXHQU4.js.map} +1 -1
- package/dist/{chunk-ECMDQQO2.js → chunk-GIYRCRS6.js} +3 -3
- package/dist/{chunk-ECMDQQO2.js.map → chunk-GIYRCRS6.js.map} +1 -1
- package/dist/{chunk-5J3HVOTR.js → chunk-IK7CQSEA.js} +3 -3
- package/dist/{chunk-5J3HVOTR.js.map → chunk-IK7CQSEA.js.map} +1 -1
- package/dist/{chunk-P4UZRDTR.js → chunk-J4EFCWMM.js} +14 -14
- package/dist/{chunk-P4UZRDTR.js.map → chunk-J4EFCWMM.js.map} +1 -1
- package/dist/{chunk-VZ342V4W.js → chunk-LB4U7GI3.js} +4 -4
- package/dist/{chunk-VZ342V4W.js.map → chunk-LB4U7GI3.js.map} +1 -1
- package/dist/{chunk-7CGTHJ6S.js → chunk-LCRHHSBP.js} +5 -5
- package/dist/{chunk-7CGTHJ6S.js.map → chunk-LCRHHSBP.js.map} +1 -1
- package/dist/{chunk-GCZ46XF6.js → chunk-LGXEXLX3.js} +12 -12
- package/dist/chunk-LGXEXLX3.js.map +1 -0
- package/dist/{chunk-XRX6VFSO.js → chunk-MBU4LSRZ.js} +4 -4
- package/dist/{chunk-XRX6VFSO.js.map → chunk-MBU4LSRZ.js.map} +1 -1
- package/dist/{chunk-JRWBBN3M.js → chunk-MJ3DLAC3.js} +4 -4
- package/dist/{chunk-JRWBBN3M.js.map → chunk-MJ3DLAC3.js.map} +1 -1
- package/dist/{chunk-N63CWDNI.js → chunk-MOAMYULW.js} +4 -4
- package/dist/{chunk-N63CWDNI.js.map → chunk-MOAMYULW.js.map} +1 -1
- package/dist/{chunk-NVPOH3CU.js → chunk-N36TVQP2.js} +4 -4
- package/dist/{chunk-NVPOH3CU.js.map → chunk-N36TVQP2.js.map} +1 -1
- package/dist/{chunk-ECFDJBTE.js → chunk-NRPYHHRQ.js} +7 -7
- package/dist/{chunk-ECFDJBTE.js.map → chunk-NRPYHHRQ.js.map} +1 -1
- package/dist/{chunk-TZCTCRGB.js → chunk-NUTURBAK.js} +3 -3
- package/dist/{chunk-TZCTCRGB.js.map → chunk-NUTURBAK.js.map} +1 -1
- package/dist/{chunk-XNBCPEH6.js → chunk-O2RXB3P3.js} +7 -7
- package/dist/{chunk-XNBCPEH6.js.map → chunk-O2RXB3P3.js.map} +1 -1
- package/dist/{chunk-FN4I3UDJ.js → chunk-OEM2SFJE.js} +3 -3
- package/dist/{chunk-FN4I3UDJ.js.map → chunk-OEM2SFJE.js.map} +1 -1
- package/dist/{chunk-2IGIQA2S.js → chunk-OJMG3NAF.js} +3 -3
- package/dist/{chunk-2IGIQA2S.js.map → chunk-OJMG3NAF.js.map} +1 -1
- package/dist/{chunk-Y6X3TVOI.js → chunk-QQWJNRSI.js} +3 -3
- package/dist/{chunk-Y6X3TVOI.js.map → chunk-QQWJNRSI.js.map} +1 -1
- package/dist/{chunk-RSHQ43OI.js → chunk-RUUQ5OVU.js} +3 -3
- package/dist/{chunk-RSHQ43OI.js.map → chunk-RUUQ5OVU.js.map} +1 -1
- package/dist/{chunk-C5UK27T6.js → chunk-SCBSKIBA.js} +4 -4
- package/dist/{chunk-C5UK27T6.js.map → chunk-SCBSKIBA.js.map} +1 -1
- package/dist/{chunk-PLPIAVLJ.js → chunk-SOLUKKTW.js} +3 -3
- package/dist/{chunk-PLPIAVLJ.js.map → chunk-SOLUKKTW.js.map} +1 -1
- package/dist/{chunk-BBMRL2QU.js → chunk-TDIENKPW.js} +3 -3
- package/dist/{chunk-BBMRL2QU.js.map → chunk-TDIENKPW.js.map} +1 -1
- package/dist/{chunk-J5OJ7JM2.js → chunk-UXJAZ5JP.js} +3 -3
- package/dist/{chunk-J5OJ7JM2.js.map → chunk-UXJAZ5JP.js.map} +1 -1
- package/dist/{chunk-LQ2PXFR4.js → chunk-VNZ6VI2O.js} +3 -3
- package/dist/{chunk-LQ2PXFR4.js.map → chunk-VNZ6VI2O.js.map} +1 -1
- package/dist/{chunk-ELQFU3RH.js → chunk-VXMWMGBQ.js} +4 -4
- package/dist/{chunk-ELQFU3RH.js.map → chunk-VXMWMGBQ.js.map} +1 -1
- package/dist/{chunk-AORRIQPD.js → chunk-XMSZSSTZ.js} +4 -4
- package/dist/{chunk-AORRIQPD.js.map → chunk-XMSZSSTZ.js.map} +1 -1
- package/dist/{chunk-ICQIH7F6.js → chunk-YRIMECFU.js} +3 -3
- package/dist/{chunk-ICQIH7F6.js.map → chunk-YRIMECFU.js.map} +1 -1
- package/dist/{chunk-62FNNS7U.js → chunk-ZNA3SWRP.js} +7 -7
- package/dist/{chunk-62FNNS7U.js.map → chunk-ZNA3SWRP.js.map} +1 -1
- package/dist/components/cart/index.js +1 -1
- package/dist/components/common/index.js +1 -1
- package/dist/components/drawer/index.js +12 -12
- package/dist/components/home/index.js +17 -17
- package/dist/components/layout/index.js +4 -4
- package/dist/components/navigation/MainMenu.d.ts.map +1 -1
- package/dist/components/product/index.js +14 -14
- package/dist/components/store/index.js +13 -13
- package/dist/dev/editor/index.js +1 -1
- package/dist/dev/index.js +1 -1
- package/dist/{document-class-LR4X2CH5.js → document-class-B4WBGWSA.js} +11 -11
- package/dist/{document-class-LR4X2CH5.js.map → document-class-B4WBGWSA.js.map} +1 -1
- package/dist/hooks/index.js +12 -12
- package/dist/hooks/useGtm.js +12 -12
- package/dist/hooks/useMoney.js +12 -12
- package/dist/hooks/useStore.js +12 -12
- package/dist/hooks/useUser.js +3 -3
- package/dist/index.js +12 -12
- package/dist/{navigation-OQ2ZT3ID.js → navigation-MBQKDV5V.js} +5 -5
- package/dist/{navigation-OQ2ZT3ID.js.map → navigation-MBQKDV5V.js.map} +1 -1
- package/dist/{navigation-5PCMFALH.js → navigation-VPRCR725.js} +4 -4
- package/dist/{navigation-5PCMFALH.js.map → navigation-VPRCR725.js.map} +1 -1
- package/dist/{not-found-YHQVBI7H.js → not-found-OIZGDR7G.js} +15 -15
- package/dist/{not-found-YHQVBI7H.js.map → not-found-OIZGDR7G.js.map} +1 -1
- package/dist/providers/index.js +12 -12
- package/dist/routes/account/orders.js +4 -4
- package/dist/routes/account.js +13 -13
- package/dist/routes/blog.js +8 -8
- package/dist/routes/brands.js +4 -4
- package/dist/routes/cart.js +21 -21
- package/dist/routes/home.js +18 -18
- package/dist/routes/index.js +3 -3
- package/dist/routes/loyalty.js +5 -5
- package/dist/routes/page.js +4 -4
- package/dist/routes/product-listing.js +19 -19
- package/dist/routes/product.js +17 -17
- package/dist/routes/root/beforeLoad.d.ts.map +1 -1
- package/dist/routes/seo-redirects.js +3 -3
- package/dist/routes/testimonials.js +2 -2
- package/dist/routes/thank-you.js +4 -4
- package/dist/skeleton.js +18 -18
- package/dist/{store-lookup-NJCTSPFL.js → store-lookup-HMU7QMSC.js} +8 -8
- package/dist/{store-lookup-NJCTSPFL.js.map → store-lookup-HMU7QMSC.js.map} +1 -1
- package/dist/tanstack/link.d.ts.map +1 -1
- package/dist/tanstack.js +11 -11
- package/dist/utils/index.js +2 -2
- package/package.json +1 -1
- package/tailwind/components/navigation/MainMenu.tsx.txt +2 -1
- package/tailwind/routes/root/beforeLoad.ts.txt +4 -2
- package/dist/MainMenu-46II2DJE.js.map +0 -1
- package/dist/chunk-5KKQUH72.js.map +0 -1
- package/dist/chunk-GCZ46XF6.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/home/ProductsSlider.tsx","../src/components/home/StoreFeatures.tsx","../src/components/home/FixedBanner.tsx","../src/components/home/FixedProducts.tsx","../src/components/home/FeaturedProductsStyle1.tsx","../src/components/home/FeaturedProductsStyle2.tsx","../src/components/home/FeaturedProductsStyle3.tsx","../src/components/home/ParallaxBackground.tsx","../src/components/home/PhotosSlider.tsx","../src/components/home/SquarePhotos.tsx","../src/components/home/Youtube.tsx","../src/components/home/BundleComponent.tsx","../src/components/home/lazy.ts","../src/components/home/register.ts","../src/components/home/ComponentErrorBoundary.tsx","../src/components/home/HomePageRenderer.tsx","../src/components/home/PageBlocks.tsx","../src/components/home/reorder-hooks.ts","../src/components/home/ReorderProducts.tsx"],"names":["product","StoreFeatures","jsx","memo","FixedBanner","Fragment","jsxs","Suspense","FeaturedProductsStyle1","useCallback","FeaturedProductsStyle2","useState","SallaButton","SallaProductsSlider","FeaturedProductsStyle3","ParallaxBackground","PhotosSlider","SquarePhotos","Youtube","BundleComponent","useEffect","FallbackComponent","ProductsSliderSkeleton","FixedProductsSkeleton","HomeComponentRenderer","Component","PageBlocks","useQuery","ReorderProducts","useMemo"],"mappings":";;;;;;;;;;;;;;;;;;AA6BO,SAAS,cAAA,CAAe,EAAE,IAAA,EAAK,EAAwB;AAC5D,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,cAAA,EAAe;AAC7B,EAAA,MAAM;AAAA,IACJ,QAAA;AAAA,IACA,KAAA;AAAA,IACA,eAAA,EAAiB,aAAA;AAAA,IACjB,QAAA,GAAW,CAAA;AAAA,IACX,QAAA,GAAW,KAAA;AAAA,IACX,aAAA,EAAe,YAAA;AAAA,IACf,cAAA,EAAgB,aAAA;AAAA,IAChB,IAAA;AAAA,IACA,QAAA;AAAA,IACA,eAAA,EAAiB,aAAA;AAAA,IACjB,SAAA;AAAA,IACA;AAAA,GACF,GAAI,IAAA;AAEJ,EAAA,MAAM,WAAA,GAAc,OAAA;AAAA,IAClB,OAAO;AAAA,MACL,EAAA,EAAI,UAAU,QAAQ,CAAA,CAAA;AAAA,MACtB,eAAA,EAAiB,CAAA,CAAE,yBAAA,EAA2B,UAAU,CAAA;AAAA,MACxD,GAAI,YAAA,KAAiB,MAAA,IAAa,EAAE,YAAA,EAAa;AAAA,MACjD,GAAI,aAAA,KAAkB,MAAA,IAAa,EAAE,aAAA,EAAc;AAAA,MACnD,GAAI,IAAA,KAAS,MAAA,IAAa,EAAE,IAAA,EAAK;AAAA,MACjC,GAAI,QAAA,KAAa,MAAA,IAAa,EAAE,QAAA,EAAS;AAAA,MACzC,GAAI,aAAA,KAAkB,MAAA,IAAa,EAAE,aAAA,E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AAA,EAAU,EAAE,MAAA,EAAQ,SAAA;AAAU,KAChC,CAAA;AAAA,IACA,CAAC,KAAK;AAAA,GACR;AAEA,EAAA,IAAI,CAAC,SAAS,OAAO,IAAA;AAErB,EAAA,uBACE3B,GAAAA,CAAC,KAAA,EAAA,EAAI,EAAA,EAAG,mBAAkB,aAAA,EAAY,SAAA,EACpC,QAAA,kBAAAA,GAAAA,CAAC,yBAAsB,IAAA,EAAY,KAAA,EAAO,EAAA,EAAI,QAAA,EAAU,OAAO,CAAA,EACjE,CAAA;AAEJ,CAAC","file":"chunk-HGNR4XBD.js","sourcesContent":["import { Suspense, useCallback, useMemo } from 'react';\nimport { product, ProductsListSource } from '../../api/product';\nimport { ProductCard } from '../../components/product';\nimport { ProductsSliderSkeleton, SallaProductsSlider } from '@salla.sa/twilight-components-react';\nimport { useTranslation } from '../../providers/I18nProvider';\n\ninterface ProductsSourceConfig {\n source: ProductsListSource;\n source_value?: number | number[] | null;\n}\n\nexport interface ProductsSliderProps {\n data: {\n products: ProductsSourceConfig;\n title?: string;\n display_all_url?: string;\n position?: number;\n priority?: boolean;\n show_controls?: boolean;\n controls_outer?: boolean;\n loop?: boolean;\n centered?: boolean;\n slides_per_view?: number | 'auto';\n direction?: 'rtl' | 'ltr';\n autoplay?: boolean;\n [key: string]: unknown;\n };\n}\n\nexport function ProductsSlider({ data }: ProductsSliderProps) {\n const { t } = useTranslation();\n const {\n products,\n title,\n display_all_url: displayAllUrl,\n position = 1,\n priority = false,\n show_controls: showControls,\n controls_outer: controlsOuter,\n loop,\n centered,\n slides_per_view: slidesPerView,\n direction,\n autoplay,\n } = data;\n\n const sliderProps = useMemo(\n () => ({\n id: `slider-${position}`,\n displayAllTitle: t('blocks.home.display_all', 'View All'),\n ...(showControls !== undefined && { showControls }),\n ...(controlsOuter !== undefined && { controlsOuter }),\n ...(loop !== undefined && { loop }),\n ...(centered !== undefined && { centered }),\n ...(slidesPerView !== undefined && { slidesPerView }),\n ...(direction !== undefined && { direction }),\n }),\n [position, t, showControls, controlsOuter, loop, centered, slidesPerView, direction]\n );\n\n const loader = useCallback(\n () =>\n product.list({\n source: products.source,\n sourceValue: products.source_value,\n }),\n [products.source, products.source_value]\n );\n\n return (\n <Suspense fallback={<ProductsSliderSkeleton />}>\n <SallaProductsSlider\n id={`best-offers-${position}-slider`}\n loader={loader}\n sliderProps={sliderProps}\n {...(displayAllUrl ? { displayAllUrl } : {})}\n {...(title ? { blockTitle: title } : {})}\n {...(autoplay !== undefined ? { autoplay } : {})}\n skeleton={<ProductsSliderSkeleton />}\n >\n {(product, index) => (\n <ProductCard product={product} imagePriority={priority && index < 2} />\n )}\n </SallaProductsSlider>\n </Suspense>\n );\n}\n","import { memo } from 'react';\nimport type { Feature } from '../../types';\n\nexport interface StoreFeaturesProps {\n data: {\n features: Feature[];\n [key: string]: unknown;\n };\n}\n\nexport const StoreFeatures = memo(function StoreFeatures({ data }: StoreFeaturesProps) {\n const { features } = data;\n\n if (!features.length) return null;\n\n return (\n <>\n <div className=\"grid grid-cols-[repeat(2,minmax(0,1fr))] md:grid-cols-[repeat(3,minmax(0,1fr))] gap-4 sm:gap-6 xl:gap-8\">\n {features.map((feature) => (\n <div\n key={`${feature.icon}:${feature.title}:${feature.description ?? ''}`}\n className=\"s-block--features__item\"\n >\n <div className=\"feature-icon\">\n <i className={feature.icon}></i>\n </div>\n <h2>{feature.title}</h2>\n <p>{feature.description}</p>\n </div>\n ))}\n </div>\n </>\n );\n});\n","import { memo } from 'react';\nimport { Link } from '../common';\n\nexport interface FixedBannerComponentProps {\n data: {\n image: {\n url: string;\n alt?: string;\n small_url?: string;\n };\n url?: string;\n title?: string;\n position?: number;\n [key: string]: unknown;\n };\n priority?: boolean;\n}\n\nexport const FixedBanner = memo(function FixedBanner(props: FixedBannerComponentProps) {\n const { data, priority = false } = props;\n const image = data.image?.url;\n\n if (!image) {\n return null;\n }\n\n const url = data.url;\n const altText = data.image.alt?.trim() ? data.image.alt : data.title || 'fixed banner';\n\n const imgProps = priority\n ? {\n loading: 'eager' as const,\n fetchPriority: 'high' as const,\n decoding: 'sync' as const,\n }\n : {\n loading: 'lazy' as const,\n decoding: 'async' as const,\n };\n\n const smallUrl = data.image.small_url;\n\n return (\n <>\n <div className=\"container\">\n <Link\n to={url || '#'}\n className=\"banner banner--fixed overflow-hidden\"\n aria-label={`Banner ${altText}`}\n >\n <picture>\n {smallUrl && <source media=\"(max-width: 767px)\" srcSet={smallUrl} />}\n <img\n width=\"1200\"\n height=\"300\"\n src={image}\n alt={altText}\n style={{ maxWidth: '100%', objectFit: 'contain' }}\n loading={imgProps.loading}\n decoding={imgProps.decoding}\n {...(priority && { fetchPriority: imgProps.fetchPriority })}\n />\n </picture>\n </Link>\n </div>\n </>\n );\n});\n","import { Suspense } from 'react';\nimport { useQuery } from '@tanstack/react-query';\nimport { FixedProductsSkeleton } from '@salla.sa/twilight-components-react';\nimport { Link } from '../common';\nimport { product, ProductsListSource } from '../../api/product';\nimport { ProductCard } from '../../components/product';\nimport { useTranslation } from '../../providers/I18nProvider';\nimport { useTwilight } from '../../providers/TwilightProvider';\n\nexport interface FixedProductsProps {\n data: {\n products: { source: ProductsListSource; source_value?: number[] | null };\n title?: string;\n limit?: number | string;\n display_all_url?: string | null;\n key?: string | null;\n isVertical?: boolean;\n position?: number;\n [key: string]: unknown;\n };\n}\n\nexport function FixedProducts({ data }: FixedProductsProps) {\n const { t } = useTranslation();\n const { theme } = useTwilight();\n\n const title = data.title;\n // The merchant's product count: a number, or the same as a string. Anything that\n // isn't a positive whole number falls back to what the API returns.\n const parsedLimit = Number(data.limit);\n const limit = Number.isInteger(parsedLimit) && parsedLimit > 0 ? parsedLimit : undefined;\n // Matches Twig Raed: `theme.settings.get('vertical_fixed_products', true)`.\n const isVertical = data.isVertical ?? theme.settings.vertical_fixed_products ?? true;\n\n const { data: result, isLoading } = useQuery(\n product.queries.list({\n source: data.products.source,\n sourceValue: data.products?.source_value,\n perPage: limit,\n })\n );\n\n const products = result?.items ?? [];\n\n if (isLoading) {\n return <FixedProductsSkeleton />;\n }\n\n if (!products.length) return null;\n\n return (\n <Suspense fallback={<FixedProductsSkeleton />}>\n {title && (\n <div className=\"s-block__title\">\n <div className=\"right-side\">\n <h2>{title}</h2>\n </div>\n {data.display_all_url && (\n <Link to={data.display_all_url} className=\"s-block__display-all\">\n {t('blocks.home.display_all', 'View All')}\n <i className=\"sicon-arrow-left\"></i>\n </Link>\n )}\n </div>\n )}\n <div\n className={\n 's-products-list-wrapper ' +\n (isVertical ? 's-products-list-vertical-cards' : 's-products-list-horizontal-cards')\n }\n >\n {products.slice(0, limit).map((product) => (\n <ProductCard\n key={product.id}\n product={product}\n layout={isVertical ? 'vertical' : 'horizontal'}\n />\n ))}\n </div>\n </Suspense>\n );\n}\n","import { memo, useState, useCallback } from 'react';\nimport { SallaButton } from '@salla.sa/twilight-components-react/button';\nimport type { Product } from '../../types';\n\ninterface SectionItem {\n title?: string;\n name?: string;\n type?: string;\n id?: string;\n products?: Product[];\n limit?: number;\n}\n\ninterface MainProduct {\n id?: string;\n title?: string;\n value?: string;\n product?: Product;\n}\n\nexport interface FeaturedProductsStyle1Props {\n data: {\n items: SectionItem[];\n main_product?: MainProduct;\n position?: number;\n [key: string]: unknown;\n };\n}\n\nexport const FeaturedProductsStyle1 = memo(function FeaturedProductsStyle1({\n data,\n}: FeaturedProductsStyle1Props) {\n const items = data.items || [];\n const mainProduct = data.main_product;\n\n const [activeTab, setActiveTab] = useState<string>(items[0]?.id || '');\n const [isAnimating, setIsAnimating] = useState(false);\n\n const handleTabClick = useCallback(\n (tabId: string) => {\n if (tabId === activeTab) return;\n setIsAnimating(true);\n setActiveTab(tabId);\n setTimeout(() => setIsAnimating(false), 100);\n },\n [activeTab]\n );\n\n if (!items.length) return null;\n\n const hasMultipleSections = items.length > 1;\n\n return (\n <>\n <div className=\"s-block__title\">\n <div className=\"right-side\">\n <h2>{mainProduct?.title}</h2>\n </div>\n {hasMultipleSections && (\n <div className=\"tabs hide-scroll hidden lg:flex\">\n {items.map((section) => (\n <SallaButton\n key={section.id}\n shape=\"link\"\n onClick={() => handleTabClick(section.id || '')}\n className={`tab-trigger ${activeTab === section.id ? 'is-active' : ''}`}\n >\n {section.title || section.name}\n </SallaButton>\n ))}\n </div>\n )}\n </div>\n\n <div className={`grid grid-cols-1 gap-8 ${mainProduct?.product ? 'lg:grid-cols-2' : ''}`}>\n {mainProduct?.product && (\n <div className=\"flex flex-col\">\n <custom-salla-product-card\n shadow-on-hover\n product={JSON.stringify(mainProduct.product)}\n isSpecial\n ></custom-salla-product-card>\n </div>\n )}\n <div className=\"flex flex-col\">\n {hasMultipleSections && (\n <div className=\"tabs mb-4 sm:mb-8 hide-scroll lg:hidden\">\n {items.map((section) => (\n <SallaButton\n key={section.id}\n shape=\"link\"\n onClick={() => handleTabClick(section.id || '')}\n className={`tab-trigger ${activeTab === section.id ? 'is-active' : ''}`}\n >\n {section.title || section.name}\n </SallaButton>\n ))}\n </div>\n )}\n\n <div className=\"tabs-wrapper flex flex-1\">\n {items.map((section) => {\n const isActive = activeTab === section.id;\n return (\n <div\n key={section.id}\n className={`tabs__item grid-cols-2 ${mainProduct?.product ? '' : 'lg:grid-cols-4'} ${isActive ? 'is-active' : ''} ${isAnimating && isActive ? 'opacity-0 translate-y-3' : ''} ${!isAnimating && isActive ? 'opacity-100 translate-y-0' : ''}`}\n >\n {section.products\n ?.slice(0, mainProduct?.product ? 4 : 8)\n .map((product, productIndex) => (\n <custom-salla-product-card\n key={product.id || productIndex}\n product={JSON.stringify(product)}\n ></custom-salla-product-card>\n ))}\n </div>\n );\n })}\n </div>\n </div>\n </div>\n </>\n );\n});\n","import { memo, useState, useCallback } from 'react';\nimport { SallaButton } from '@salla.sa/twilight-components-react/button';\nimport { SallaProductsList } from '@salla.sa/twilight-components-react';\nimport { SallaProductsSlider } from '@salla.sa/twilight-components-react';\nimport { product, ProductsListSource } from '../../api/product';\nimport { ProductCard } from '../../components/product';\nimport { useTwilight } from '../../providers/TwilightProvider';\n\ninterface ProductSource {\n source: ProductsListSource;\n limit?: number;\n source_value?: number | number[];\n}\n\ninterface SectionItem {\n title?: string;\n name?: string;\n type?: string;\n id?: string;\n products: ProductSource;\n limit?: number;\n}\n\nexport interface FeaturedProductsStyle2Props {\n data: {\n items: SectionItem[];\n position?: number;\n is_slider?: boolean;\n [key: string]: unknown;\n };\n}\n\n// Like Twig Raed, the grid honors `vertical_fixed_products`; the slider never does.\nexport const FeaturedProductsStyle2 = memo(function FeaturedProductsStyle2({\n data,\n}: FeaturedProductsStyle2Props) {\n const { theme } = useTwilight();\n const items = data.items || [];\n const isSlider = data.is_slider ?? true;\n const cardLayout = (theme.settings.vertical_fixed_products ?? true) ? 'vertical' : 'horizontal';\n\n const [activeTab, setActiveTab] = useState<string>(items[0]?.id || '');\n const [isAnimating, setIsAnimating] = useState(false);\n\n const handleTabClick = useCallback(\n (tabId: string) => {\n if (tabId === activeTab) return;\n setIsAnimating(true);\n setActiveTab(tabId);\n setTimeout(() => setIsAnimating(false), 100);\n },\n [activeTab]\n );\n\n const loader = useCallback(\n (source: ProductsListSource, value?: number | number[], limit?: number) => {\n return () =>\n product.list({\n source: source,\n sourceValue: value,\n perPage: limit,\n });\n },\n []\n );\n\n if (!items.length) return null;\n\n const hasMultipleSections = items.length > 1;\n\n return (\n <>\n <div className=\"container\">\n {hasMultipleSections && (\n <div className=\"tabs hide-scroll\">\n {items.map((section) => (\n <SallaButton\n key={section.id}\n fill=\"outline\"\n onClick={() => handleTabClick(section.id || '')}\n className={`tab-trigger ${activeTab === section.id ? 'is-active' : ''}`}\n >\n {section.title || section.name}\n </SallaButton>\n ))}\n </div>\n )}\n\n <div className=\"tabs-wrapper\">\n {items.map((section) => {\n const isActive = activeTab === section.id;\n return (\n <div\n key={section.id}\n className={`tabs__item ${isActive ? 'is-active' : ''} ${isAnimating && isActive ? 'opacity-0 translate-y-3' : ''} ${!isAnimating && isActive ? 'opacity-100 translate-y-0' : ''}`}\n >\n {isSlider ? (\n <SallaProductsSlider\n loader={loader(\n section.products.source,\n section.products?.source_value,\n section.products?.limit\n )}\n sliderProps={{ id: `section-${section.id}-slider` }}\n >\n {(product) => (\n <ProductCard className=\"s-products-slider-card\" product={product} />\n )}\n </SallaProductsSlider>\n ) : (\n <SallaProductsList\n loader={loader(\n section.products.source,\n section.products?.source_value,\n section.products?.limit\n )}\n itemsClassName={`s-products-list-${cardLayout}-cards`}\n >\n {(products) =>\n products.map((product) => (\n <ProductCard key={product.id} product={product} layout={cardLayout} />\n ))\n }\n </SallaProductsList>\n )}\n </div>\n );\n })}\n </div>\n </div>\n </>\n );\n});\n","import { memo } from 'react';\nimport { ProductCard } from '../product/ProductCard';\nimport type { Product } from '../../types';\n\ninterface SectionItem {\n title?: string;\n name?: string;\n type?: string;\n products?: Product[];\n featured_product?: Product;\n limit?: number;\n id?: string;\n}\n\nexport interface FeaturedProductsStyle3Props {\n data: {\n items: SectionItem[];\n position?: number;\n [key: string]: unknown;\n };\n}\n\nexport const FeaturedProductsStyle3 = memo(function FeaturedProductsStyle3({\n data,\n}: FeaturedProductsStyle3Props) {\n const items = data.items || [];\n\n if (!items.length) return null;\n\n return (\n <>\n <div className=\"inner\">\n {items.map((section, sectionIndex) => (\n <div key={section.id || sectionIndex}>\n <div className=\"s-block__title\">\n <h2>{section.title}</h2>\n </div>\n <div className=\"flex-1 grid lg:grid-cols-2 gap-4 sm:gap-8\">\n {section.featured_product ? (\n <>\n <ProductCard product={section.featured_product} layout=\"fullImage\" withShadow />\n <div className=\"grid gap-4 sm:gap-8\">\n {section.products?.slice(0, 3).map((product, idx) => (\n <ProductCard\n key={product.id}\n product={product}\n layout=\"minimal\"\n withShadow\n index={idx}\n />\n ))}\n </div>\n </>\n ) : (\n section.products?.map((product, idx) => (\n <ProductCard\n key={product.id}\n product={product}\n layout=\"minimal\"\n withShadow\n index={idx}\n />\n ))\n )}\n </div>\n </div>\n ))}\n </div>\n </>\n );\n});\n","import { memo } from 'react';\nimport { Link } from '../common';\n\ninterface ImageData {\n url?: string;\n}\n\nexport interface ParallaxBackgroundProps {\n data: {\n image: ImageData;\n url?: string;\n title?: string;\n link_text?: string;\n is_opacity?: boolean;\n position?: number;\n [key: string]: unknown;\n };\n}\n\nexport const ParallaxBackground = memo(function ParallaxBackground({\n data,\n}: ParallaxBackgroundProps) {\n const { image, url, title, link_text: linkText, is_opacity: isOpacity = false } = data;\n\n if (!image?.url) return null;\n\n return (\n <>\n <div className=\"full-banner-entry\" style={{ backgroundImage: `url(${image.url})` }}>\n <div\n className={`overlay h-full w-full ${isOpacity ? 'bg-black' : ''} opacity-60 absolute top-0 left-0`}\n ></div>\n <div className=\"flex h-full items-center justify-center p-5 xs:p-11 relative\">\n <div>\n {title && <h2 className=\"text-2xl font-bold leading-12\">{title}</h2>}\n\n {url && linkText && (\n <Link\n to={url}\n className=\"inline-block text-white text-sm border rounded-md font-bold px-8 py-4\"\n >\n {linkText}\n </Link>\n )}\n </div>\n </div>\n </div>\n </>\n );\n});\n","import { memo } from 'react';\nimport { SallaSlider } from '@salla.sa/twilight-components-react/slider';\nimport { Link, Image } from '../common';\n\ninterface PhotoItem {\n id?: string | number;\n url?: string;\n link_type?: string;\n image?: string;\n}\n\nexport interface PhotosSliderProps {\n data: {\n items: PhotoItem[];\n position?: number;\n is_repeated?: boolean;\n [key: string]: unknown;\n };\n}\n\nexport const PhotosSlider = memo(function PhotosSlider({ data }: PhotosSliderProps) {\n const items = data.items || [];\n const position = data.position ?? 1;\n\n if (!items.length) return null;\n\n return (\n <>\n <SallaSlider\n type=\"carousel\"\n className=\"home-slider photos-slider\"\n centered\n autoPlay\n pagination\n id={`photos-${position}-slider`}\n sliderConfig={{ watchOverflow: true }}\n >\n <div slot=\"items\">\n {items.map((item, index) => (\n <div\n key={item.id ?? `${item.url ?? ''}:${item.image ?? ''}`}\n className=\"swiper-slide\"\n style={{ aspectRatio: '1200/300' }}\n >\n <Link to={item.url || '#'}>\n <Image\n src={item.image}\n className=\"w-full h-full object-contain rounded-md\"\n alt={`image-slider-${index}`}\n width={1200}\n height={300}\n priority={index === 0}\n />\n </Link>\n </div>\n ))}\n </div>\n </SallaSlider>\n </>\n );\n});\n","import { memo } from 'react';\nimport { Link } from '../common';\n\ninterface ImageData {\n url?: string;\n alt?: string;\n}\n\ninterface SquarePhotoItem {\n id?: string | number;\n url?: string;\n link_type?: string;\n /** The Store API sends the URL itself to the engine; Twig gets `{ url, alt }`. */\n image?: string | ImageData;\n text?: string;\n}\n\nconst imageUrl = (item: SquarePhotoItem) =>\n typeof item.image === 'string' ? item.image : item.image?.url;\n\nexport interface SquarePhotosProps {\n data: {\n title?: string;\n items: SquarePhotoItem[];\n position?: number;\n [key: string]: unknown;\n };\n}\n\nexport const SquarePhotos = memo(function SquarePhotos({ data }: SquarePhotosProps) {\n const items = data.items || [];\n const title = data.title;\n\n if (!items.length) return null;\n\n const gridCols =\n items.length <= 3 ? `one-row md:grid-cols-${items.length}` : 'md:grid-cols-3 two-row';\n\n return (\n <>\n {title && (\n <div className=\"s-block__title\">\n <div className=\"right-side\">\n <h2>{title}</h2>\n </div>\n </div>\n )}\n\n <div className={`grid ${gridCols} grid-flow-row gap-3 sm:gap-8`}>\n {items.map((item) => (\n <Link\n {...(item.link_type === 'external_link' ? { target: '_blank' } : {})}\n key={item.id ?? imageUrl(item) ?? item.url}\n className={`banner-entry square-photos ${item.text ? 'has-overlay with-hover' : ''}`}\n style={{ backgroundImage: `url(${imageUrl(item)})` }}\n to={item.url || '#'}\n >\n {item.text && (\n <h3 className=\"text-with-border\">\n <span>{item.text}</span>\n </h3>\n )}\n </Link>\n ))}\n </div>\n </>\n );\n});\n","import { memo, useEffect, useState } from 'react';\n\nexport interface YoutubeProps {\n data: {\n youtube_id: string;\n position?: number;\n [key: string]: unknown;\n };\n}\n\nexport const Youtube = memo(function Youtube({ data }: YoutubeProps) {\n const { youtube_id: youtubeId } = data;\n const [isLoaded, setIsLoaded] = useState(false);\n\n useEffect(() => {\n if (!youtubeId) return;\n\n // Lazy load the lite-youtube web component\n let mounted = true;\n import('@justinribeiro/lite-youtube')\n .then(() => {\n if (mounted) setIsLoaded(true);\n })\n .catch((err) => {\n console.error('Failed to load lite-youtube:', err);\n });\n\n return () => {\n mounted = false;\n };\n }, [youtubeId]);\n\n if (!youtubeId) return null;\n\n return (\n <>\n <div className=\"container\">\n <div className=\"videoWrapper\">\n {isLoaded ? (\n <lite-youtube videoid={youtubeId} params=\"rel=0\"></lite-youtube>\n ) : (\n <div className=\"animate-pulse bg-gray-200 w-full h-full min-h-[300px] rounded\" />\n )}\n </div>\n </div>\n </>\n );\n});\n","import { memo, useState, useEffect, type CSSProperties } from 'react';\n\n// Placeholder hints a bundle declares per component under `props` in its\n// twilight-bundle.json; the store API passes them as `component_props`. Each maps 1:1 to an\n// attribute on <salla-custom-component>, which reserves the component's space until the\n// bundle renders.\n// @see https://github.com/SallaApp/twilight-bundles/blob/master/packages/starter-kit/README.md#component-skeleton--placeholder\nconst SIZE_PROPS = ['min-height', 'height', 'width', 'aspect-ratio'] as const;\nconst SKELETON_PROPS: readonly string[] = [...SIZE_PROPS, 'skeleton-style'];\n\ntype SkeletonProps = Record<string, string>;\n\nexport interface BundleComponentProps {\n data: {\n component_name: string;\n bundle_id: string;\n component_props?: SkeletonProps;\n [key: string]: unknown;\n };\n}\n\nfunction pickSkeletonProps(props: unknown): SkeletonProps {\n if (!props || typeof props !== 'object') return {};\n return Object.fromEntries(\n Object.entries(props).filter(\n ([name, value]) =>\n SKELETON_PROPS.includes(name) && typeof value === 'string' && value.trim() !== ''\n )\n ) as SkeletonProps;\n}\n\n// Until mount there is no <salla-custom-component>, so hold the same footprint with a plain\n// block — otherwise the server HTML has nothing here and the page shifts once it mounts.\nfunction reservedSizeStyle(props: SkeletonProps): CSSProperties | undefined {\n const sizes = SIZE_PROPS.filter((name) => props[name]);\n if (!sizes.length) return undefined;\n return Object.fromEntries(\n sizes.map((name) => [\n name.replace(/-([a-z])/g, (_, char: string) => char.toUpperCase()),\n props[name],\n ])\n ) as CSSProperties;\n}\n\nexport const BundleComponent = memo(function BundleComponent(props: BundleComponentProps) {\n const [mounted, setMounted] = useState(false);\n\n useEffect(() => {\n setMounted(true);\n }, []);\n\n const {\n component_name: componentName,\n bundle_id: bundleId,\n component_props: componentProps,\n ...rest\n } = props.data;\n const skeletonProps = pickSkeletonProps(componentProps);\n\n if (!mounted) {\n const style = reservedSizeStyle(skeletonProps);\n return style ? <div aria-hidden=\"true\" style={style} /> : null;\n }\n\n const config = JSON.stringify(rest);\n\n return (\n <>\n <salla-custom-component\n component-name={componentName}\n bundle-id={bundleId}\n config={config}\n {...skeletonProps}\n suppressHydrationWarning\n />\n </>\n );\n});\n","import { lazyComponent } from '../../utils/lazy-component';\n\nexport { ProductsSlider as LazyProductsSlider } from './ProductsSlider';\nexport { StoreFeatures as LazyStoreFeatures } from './StoreFeatures';\nexport { FixedBanner as LazyFixedBanner } from './FixedBanner';\nexport { FixedProducts as LazyFixedProducts } from './FixedProducts';\n// Only a home page with no blocks shows it, so most stores never load it.\nexport const LazyLatestProducts = lazyComponent(() =>\n import('./LatestProducts').then((m) => ({ default: m.LatestProducts }))\n);\nexport { FeaturedProductsStyle1 as LazyFeaturedProductsStyle1 } from './FeaturedProductsStyle1';\nexport { FeaturedProductsStyle2 as LazyFeaturedProductsStyle2 } from './FeaturedProductsStyle2';\nexport { FeaturedProductsStyle3 as LazyFeaturedProductsStyle3 } from './FeaturedProductsStyle3';\nexport { ParallaxBackground as LazyParallaxBackground } from './ParallaxBackground';\nexport { PhotosSlider as LazyPhotosSlider } from './PhotosSlider';\nexport { SquarePhotos as LazySquarePhotos } from './SquarePhotos';\nexport const LazyTestimonials = lazyComponent(() =>\n import('./Testimonials').then((m) => ({ default: m.Testimonials }))\n);\nexport { Youtube as LazyYoutube } from './Youtube';\nexport { BundleComponent as LazyBundleComponent } from './BundleComponent';\n","import {\n LazyProductsSlider,\n LazyStoreFeatures,\n LazyFixedBanner,\n LazyFixedProducts,\n LazyLatestProducts,\n LazyFeaturedProductsStyle1,\n LazyFeaturedProductsStyle2,\n LazyFeaturedProductsStyle3,\n LazyParallaxBackground,\n LazyPhotosSlider,\n LazySquarePhotos,\n LazyTestimonials,\n LazyYoutube,\n LazyBundleComponent,\n} from './lazy';\nimport type { AnyHomeComponent } from './types';\nimport { registry } from '../ComponentRegistry';\n\nexport const DefaultHomeComponents: Record<string, AnyHomeComponent | null> = {\n 'fixed-banner': LazyFixedBanner,\n 'photos-slider': LazyPhotosSlider,\n testimonial: LazyTestimonials,\n 'store-features': LazyStoreFeatures,\n youtube: LazyYoutube,\n 'square-photos': LazySquarePhotos,\n 'fixed-products': LazyFixedProducts,\n 'latest-products': LazyLatestProducts,\n 'products-slider': LazyProductsSlider,\n 'parallax-background': LazyParallaxBackground,\n 'featured-products:style1': LazyFeaturedProductsStyle1,\n 'featured-products:style2': LazyFeaturedProductsStyle2,\n 'featured-products:style3': LazyFeaturedProductsStyle3,\n 'bundle-component': LazyBundleComponent,\n};\n\nexport function registerHomeComponents(\n components: Record<string, AnyHomeComponent | null> = DefaultHomeComponents,\n prefix = 'home:'\n): void {\n Object.entries(components).forEach(([path, component]) => {\n if (component) {\n registry.register(`${prefix}${path}`, component);\n }\n });\n}\n","import { Component, type ReactNode, type ErrorInfo } from 'react';\nimport { TwilightContext } from '../../providers/twilight-context';\nimport type { TwilightContextValue } from '../../types/twilight';\nimport type { HomeComponentData } from '../../types';\n\ninterface ComponentErrorBoundaryProps {\n children: ReactNode;\n data: HomeComponentData;\n position: number;\n}\n\ninterface ComponentErrorBoundaryState {\n hasError: boolean;\n error: Error | null;\n}\n\nfunction DevelopmentErrorCard({ error, data }: { error: Error; data: HomeComponentData }) {\n return (\n <section\n dir=\"ltr\"\n className=\"s-block container overflow-hidden bg-red-50 border border-red-300 p-4\"\n >\n <p className=\"text-red-800 text-sm font-bold\">Home Component Error: {data.path}</p>\n <p className=\"text-red-700 text-sm mt-2\">{error.message}</p>\n <details className=\"mt-2\">\n <summary className=\"text-xs cursor-pointer text-red-600\">Stack Trace</summary>\n <pre className=\"text-xs mt-1 overflow-auto max-h-32 text-red-700\">{error.stack}</pre>\n </details>\n <details className=\"mt-2\">\n <summary className=\"text-xs cursor-pointer text-red-600\">Component Data</summary>\n <pre className=\"text-xs mt-1 overflow-auto max-h-32 text-red-700\">\n {JSON.stringify(data, null, 2)}\n </pre>\n </details>\n </section>\n );\n}\n\nexport class ComponentErrorBoundary extends Component<\n ComponentErrorBoundaryProps,\n ComponentErrorBoundaryState\n> {\n static contextType = TwilightContext;\n\n declare context: TwilightContextValue | null;\n\n constructor(props: ComponentErrorBoundaryProps) {\n super(props);\n this.state = { hasError: false, error: null };\n }\n\n static getDerivedStateFromError(error: Error): ComponentErrorBoundaryState {\n return { hasError: true, error };\n }\n\n // Blocks are keyed by position, so a replacement block at the same position reuses\n // this boundary. An error belongs to the block that threw it, not the position.\n componentDidUpdate(prevProps: ComponentErrorBoundaryProps): void {\n if (this.state.hasError && prevProps.data !== this.props.data) {\n this.setState({ hasError: false, error: null });\n }\n }\n\n componentDidCatch(error: Error, errorInfo: ErrorInfo): void {\n if (!this.context) {\n console.error('[ComponentErrorBoundary] Must be used within TwilightProvider');\n return;\n }\n const { log } = this.context;\n const { data, position } = this.props;\n\n log.groupCollapsed(`HomeComponent Error: ${data.path || 'unknown'}`);\n log.error('ERROR', error.message);\n log.label('COMPONENT', data.path || 'unknown');\n log.label('POSITION', position);\n log.label('URL', typeof window !== 'undefined' ? window.location.href : 'SSR');\n log.label('TIME', new Date().toISOString());\n log.trace('STACK TRACE', error.stack || '');\n log.trace('COMPONENT STACK', errorInfo.componentStack || '');\n log.dir('COMPONENT DATA', data);\n log.groupEnd();\n }\n\n render(): ReactNode {\n const { hasError, error } = this.state;\n const { children, data } = this.props;\n\n if (hasError && error) {\n if (process.env.NODE_ENV === 'production') {\n return null;\n }\n\n return <DevelopmentErrorCard error={error} data={data} />;\n }\n\n return children;\n }\n}\n","import { memo, useEffect, useRef, type ReactNode } from 'react';\nimport { registry } from '../ComponentRegistry';\nimport { RenderWhenVisible } from '../common';\nimport { ComponentErrorBoundary } from './ComponentErrorBoundary';\nimport type { AnyHomeComponent } from './index';\nimport type { HomeComponentData } from '../../types';\nimport {\n BackgroundSliderSkeleton,\n BulletDeliverySkeleton,\n FixedProductsSkeleton,\n ListSkeleton,\n ProductsSliderSkeleton,\n Pulse,\n ReviewItemSkeleton,\n SliderSkeleton,\n} from '@salla.sa/twilight-components-react';\n\nfunction SquareGridSkeleton() {\n return (\n <div className=\"s-block container grid grid-cols-2 sm:grid-cols-4 gap-4 py-8\">\n {[1, 2, 3, 4].map((i) => (\n <Pulse key={i} className=\"aspect-square\" />\n ))}\n </div>\n );\n}\n\nexport type HomeComponentsProps = {\n data: HomeComponentData & {\n position?: number;\n [key: string]: unknown;\n };\n};\n\n/**\n * Fallback component for unknown/unregistered components\n * Only shows in development mode\n */\nconst FallbackComponent = memo(function FallbackComponent({ data }: HomeComponentsProps) {\n if (process.env.NODE_ENV === 'production') return null;\n\n return (\n <section\n dir=\"ltr\"\n className=\"s-block container overflow-hidden bg-yellow-50 border border-yellow-200 p-4\"\n >\n <p className=\"text-yellow-800 text-sm\">\n <strong>Unknown component:</strong> {data.path}\n </p>\n <p className=\"text-yellow-700 text-xs mt-1\">\n Register it in setup.ts: <code>registry.register('home:{data.path}', YourComponent)</code>\n </p>\n <details className=\"mt-2\">\n <summary className=\"text-xs cursor-pointer\">Component Data</summary>\n <pre className=\"text-xs mt-1 overflow-auto max-h-32\">{JSON.stringify(data, null, 2)}</pre>\n </details>\n </section>\n );\n});\n\n/**\n * Get the React component for a given home component path\n * Looks up from registry only - theme must register components\n */\nfunction getComponentByPath(data: HomeComponentData): AnyHomeComponent {\n const { path, view_style: viewStyle } = data;\n\n // 1. Check for view_style variant first\n if (viewStyle) {\n const variantKey = `home:${path}:${viewStyle}`;\n const variant = registry.resolve(variantKey);\n if (variant) {\n return variant as AnyHomeComponent;\n }\n }\n\n // 2. Check registry for component\n const registryKey = `home:${path}`;\n const component = registry.resolve(registryKey);\n if (component) {\n return component as AnyHomeComponent;\n }\n\n // 3. Fallback for unknown components\n return FallbackComponent;\n}\n\n/** Same breakpoint and rules the Store injects for Twig themes (`ComponentVisibilityStyles`). */\nconst CHANNEL_VISIBILITY_CSS =\n '@media (max-width:767.98px){.s-hide-on-mobile{display:none!important}}' +\n '@media (min-width:768px){.s-hide-on-desktop{display:none!important}}';\n\n/**\n * Hide class for the merchant's per-channel pick. A missing key, or one that\n * hides on both channels, means visible everywhere: hiding a block outright\n * is the `is_visible` toggle's job, and stores without the feature send no key.\n */\nexport function channelVisibilityClass(data: HomeComponentData): string {\n const raw = data.channel_visibility;\n if (!raw || typeof raw !== 'object') return '';\n const desktop = raw.desktop !== false;\n const mobile = raw.mobile !== false;\n if (desktop && !mobile) return 's-hide-on-mobile';\n if (mobile && !desktop) return 's-hide-on-desktop';\n return '';\n}\n\n/**\n * Render-shell config for a home block: the values the lazy-load wrapper\n * (`RenderWhenVisible`) needs *before* the block mounts — reserved height, the\n * skeleton placeholder, and the wrapper's className/id.\n *\n * Themes register config for blocks they own via `registerHomeComponentConfig`;\n * the engine knows nothing about theme-specific blocks.\n */\nexport type HomeComponentConfig = {\n height?: string;\n className?: string | ((data: HomeComponentData) => string);\n id?: string | ((data: HomeComponentData) => string);\n placeholder?: ReactNode;\n /** Mount on page load instead of when the block nears the viewport. */\n renderOnMount?: boolean;\n};\n\nconst COMPONENT_CONFIG: Record<string, HomeComponentConfig> = {\n 'products-slider': { height: '450px', placeholder: <ProductsSliderSkeleton /> },\n 'fixed-products': { height: '450px', placeholder: <FixedProductsSkeleton /> },\n 'latest-products': {\n height: '450px',\n placeholder: <FixedProductsSkeleton />,\n // As in Twig Raed's `latest-products.twig`.\n className: 's-block s-block--latest-products container mt-6 sm:mt-8',\n },\n 'featured-products': {\n height: '450px',\n placeholder: <ProductsSliderSkeleton />,\n className: (data) => {\n const style = data.view_style;\n if (style === 'style1')\n return 's-block s-block--featured-products s-block-tabs s-block--special-products container tabs-initialized';\n if (style === 'style2')\n return `s-block s-block--featured-products s-block-tabs s-block--tabs-produtcs s-block--full-bg tabs-initialized ${data.is_slider ? 'as-slider' : 'as-grid'} bg-gray-100 py-8 sm:py-16`;\n if (style === 'style3')\n return `s-block s-block--featured-products s-block--features-products${Array.isArray(data.items) && data.items.length > 1 ? ' two-cols' : ''} container`;\n return 's-block s-block--featured-products container overflow-hidden';\n },\n id: (data) => `featured-products-${data.view_style}-${data.position ?? 0}`,\n },\n testimonial: { height: '350px', placeholder: <ReviewItemSkeleton /> },\n 'store-features': { height: '200px', placeholder: <BulletDeliverySkeleton /> },\n 'parallax-background': { height: '500px', placeholder: <BackgroundSliderSkeleton /> },\n 'fixed-banner': { height: '350px', placeholder: <BackgroundSliderSkeleton /> },\n 'photos-slider': {\n height: 'clamp(130px, 30vw, 350px)',\n placeholder: <SliderSkeleton />,\n className: (data) =>\n `s-block s-block--photos-slider${data.is_repeated ? ' repeated-block' : ''}`,\n },\n 'square-photos': { height: '250px', placeholder: <SquareGridSkeleton /> },\n youtube: { height: '350px', placeholder: <SliderSkeleton /> },\n 'bundle-component': {\n // As in Twig: reserve nothing, the bundle grows the block from 0.\n height: '0px',\n placeholder: <></>,\n className: (data) => `s-block s-block--bundle-${data.component_name}`,\n // As in Twig, where merchant scripts wait a limited time for the bundle's markup.\n renderOnMount: true,\n },\n 'main-links': {\n height: '200px',\n placeholder: <ListSkeleton />,\n className: (data) => {\n const mergeWithTop = data.merge_links_with_top_component;\n const position = data.position;\n return [\n 's-block',\n 's-block--main-links',\n mergeWithTop && position ? 'merge-with-top-component' : '',\n !data.title && mergeWithTop ? 'merged-has-no-title' : '',\n ]\n .filter(Boolean)\n .join(' ');\n },\n },\n 'square-links': { height: '200px', placeholder: <SquareGridSkeleton /> },\n};\n\n/**\n * Theme-registered render-shell config, keyed by home component path. Themes own\n * the display of their blocks by registering config here; at render time a path's\n * theme entry replaces (not field-merges) the engine's built-in `COMPONENT_CONFIG`\n * entry for that path.\n */\nconst themeComponentConfig: Record<string, HomeComponentConfig> = {};\n\n/**\n * Register render-shell config for home blocks a theme owns (height, placeholder,\n * className, id). Merges by path and overwrites existing keys, so it is safe to\n * call more than once and idempotent for the same keys.\n */\nexport function registerHomeComponentConfig(config: Record<string, HomeComponentConfig>): void {\n Object.assign(themeComponentConfig, config);\n}\n\n/**\n * Resolve a block's render-shell config: theme-registered config takes precedence\n * over the engine's built-in config; returns `undefined` when neither defines the\n * path so the renderer can apply generic defaults.\n */\nfunction resolveComponentConfig(path: string): HomeComponentConfig | undefined {\n return themeComponentConfig[path] ?? COMPONENT_CONFIG[path];\n}\n\n/**\n * What the theme editor addresses a block by: the dev editor's layout id (less\n * the remount suffix), its row id, or the uuid of one not saved yet. The layout\n * id comes first: a customized layout keeps the store blocks' row ids among\n * their fields, and duplicates share them. A built-in block (fixed products,\n * YouTube, …) has neither id nor key, so it goes by its path, which the\n * editor matches to the block's slug; the bar says which copy. A block the\n * engine adds itself (`editable: false`) is not the merchant's, so it has none.\n */\nfunction liveBlockIdOf(data: HomeComponentData, editable?: boolean): string | undefined {\n if (editable === false) return undefined;\n const devId = typeof data.__dev_id === 'string' ? data.__dev_id.replace(/~\\d+$/, '') : undefined;\n const id = devId ?? data.id ?? data.key;\n if (typeof id === 'number' || (typeof id === 'string' && id)) return String(id);\n return data.path || undefined;\n}\n\n/**\n * Memoized component renderer with scroll-based lazy loading\n * Components only mount when scrolled into view - preventing API calls until needed\n */\nexport const HomeComponentRenderer = memo(function HomeComponentRenderer({\n data,\n index,\n priority,\n editable,\n}: {\n data: HomeComponentData;\n index: number;\n /** Mount right away with eager images. Defaults to the first three blocks of the page. */\n priority?: boolean;\n /** False for a block the engine adds, not the merchant: the theme editor's bar leaves it alone. */\n editable?: boolean;\n}) {\n const renderCountRef = useRef(0);\n renderCountRef.current += 1;\n\n if (process.env.NODE_ENV === 'development') {\n console.log(\n `[HomeComponentRenderer] RENDER: path=${data.path}, index=${index}, renderCount=${renderCountRef.current}`\n );\n }\n\n useEffect(() => {\n console.log(\n `[HomeComponentRenderer] MOUNT: path=${data.path}, index=${index}, renderCount=${renderCountRef.current}`\n );\n return () => {\n console.log(`[HomeComponentRenderer] UNMOUNT: path=${data.path}, index=${index}`);\n };\n }, [data.path, index]);\n\n const isFirstComponent = priority ?? index <= 2;\n const Component = getComponentByPath(data);\n\n const config = resolveComponentConfig(data.path);\n\n const resolvedClassName = config?.className\n ? typeof config.className === 'function'\n ? config.className(data)\n : config.className\n : `s-block s-block--${data.path}`;\n const hideClass = channelVisibilityClass(data);\n const resolvedId = config?.id\n ? typeof config.id === 'function'\n ? config.id(data)\n : config.id\n : undefined;\n const liveBlockId = liveBlockIdOf(data, editable);\n const height = config?.height || '400px';\n // A theme's config replaces the engine's, but keeps its mount timing unless the theme sets one.\n const renderOnMount = config?.renderOnMount ?? COMPONENT_CONFIG[data.path]?.renderOnMount;\n\n const content = (\n <ComponentErrorBoundary data={data} position={index + 1}>\n <Component data={{ ...data, position: index + 1, priority: isFirstComponent }} />\n </ComponentErrorBoundary>\n );\n\n return (\n <>\n {hideClass && (\n <style href=\"twilight-channel-visibility\" precedence=\"default\">\n {CHANNEL_VISIBILITY_CSS}\n </style>\n )}\n <RenderWhenVisible\n rootMargin=\"50px\"\n className={hideClass ? `${resolvedClassName} ${hideClass}` : resolvedClassName}\n id={resolvedId}\n estimatedHeight={height}\n renderOnMount={isFirstComponent || renderOnMount === true}\n placeholder={config?.placeholder ?? <ProductsSliderSkeleton />}\n // Dev only: lets the theme editor scroll the preview to a block.\n blockIndex={import.meta.env.DEV ? index : undefined}\n liveBlockId={liveBlockId}\n >\n {content}\n </RenderWhenVisible>\n </>\n );\n});\n","import { memo } from 'react';\nimport { useQuery } from '@tanstack/react-query';\nimport { home, type BlockScope } from '../../api/home';\nimport { HomeComponentRenderer } from './HomePageRenderer';\n\nexport interface PageBlocksProps {\n /** The page hook the merchant placed the blocks at, e.g. `product.single.before_customer_reviews`. */\n hook: string;\n /** The product, category or page being shown. */\n scope: BlockScope;\n}\n\n/** Draws the blocks placed at a product, category or page hook, loaded in the browser. */\nexport const PageBlocks = memo(function PageBlocks({ hook, scope }: PageBlocksProps) {\n const { data: blocks = [] } = useQuery(home.queries.blocks(hook, scope));\n\n return (\n <>\n {blocks.map((data, index) => (\n <HomeComponentRenderer key={index} data={data} index={index} priority={false} />\n ))}\n </>\n );\n});\n","import { useEffect } from 'react';\nimport { useTranslation } from '../../providers/I18nProvider';\nimport { whenSallaLoaded } from '../../utils/sdk-helpers';\n\ninterface ReorderLabels {\n /** The add button's text in a reorder list. */\n add: string;\n /** Its text for an out-of-stock product. */\n outOfStock: string;\n}\n\nlet registered = false;\n\n/**\n * Twig's ReorderProductsWidget script: inside a reorder list the add button reads the block's\n * title and adds the product as the customer last ordered it. The SDK has no way to remove a\n * hook, so it is registered once per page load.\n */\nfunction registerReorderHooks(labels: ReorderLabels): void {\n if (registered) return;\n registered = true;\n whenSallaLoaded((sdk) => {\n sdk.hooks?.registerHook?.('salla-add-product-button', 'componentDidLoad', (component) => {\n if (!component.host?.closest('[source=\"reorder\"], [data-source=\"reorder\"]')) return;\n const isOutOfStock =\n component.productStatus === 'out' || component.productStatus === 'out-and-notify';\n const setLabel = () => component.btn?.setText(isOutOfStock ? labels.outOfStock : labels.add);\n setLabel();\n sdk.lang?.onLoaded?.(setLabel);\n if (isOutOfStock) return;\n component.addProductToCart = async (event: Event) => {\n event.preventDefault();\n // The click lands on the inner button, which has no product-id; without one the SDK uses the page's.\n const productId = component.productId ?? component.host.getAttribute('product-id');\n await sdk.order.api.reorderProduct?.(productId ?? undefined);\n };\n });\n });\n}\n\n/**\n * Inside an element with `data-source=\"reorder\"`, make each add button read \"order again\" and\n * add the product as the customer last ordered it, as Twig's reorder block and page do.\n */\nexport function useReorderButtons(enabled: boolean): void {\n const { t } = useTranslation();\n const add = t('pages.orders.repurchase');\n const outOfStock = t('pages.products.out_of_stock');\n useEffect(() => {\n if (enabled) registerReorderHooks({ add, outOfStock });\n }, [enabled, add, outOfStock]);\n}\n","import { memo, useMemo } from 'react';\nimport { useTranslation } from '../../providers/I18nProvider';\nimport { getTwilightContext } from '../../twilight/context';\nimport type { HomeComponentData } from '../../types';\nimport { HomeComponentRenderer } from './HomePageRenderer';\nimport { useReorderButtons } from './reorder-hooks';\n\n/**\n * Twig's \"order again\" block (the Store app's ReorderProductsWidget): on the home page, for a\n * signed-in customer of a store with Reorder on, the products they ordered before, drawn by the\n * theme's own `products-slider` like the home's other product rows.\n */\nexport const ReorderProducts = memo(function ReorderProducts() {\n const { t } = useTranslation();\n const { authToken, settings } = getTwilightContext();\n // The platform lists `reorder` in the store's features exactly when the Reorder setting is on.\n const enabled = !!authToken && !!settings?.store?.features?.includes('reorder');\n const title = t('pages.orders.repurchase');\n useReorderButtons(enabled);\n\n const data = useMemo<HomeComponentData>(\n () => ({\n path: 'products-slider',\n title,\n display_all_url: '/products?source=reorder',\n products: { source: 'reorder' },\n }),\n [title]\n );\n\n if (!enabled) return null;\n\n return (\n <div id=\"reorder-section\" data-source=\"reorder\">\n <HomeComponentRenderer data={data} index={-1} priority={false} />\n </div>\n );\n});\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/components/home/ProductsSlider.tsx","../src/components/home/StoreFeatures.tsx","../src/components/home/FixedBanner.tsx","../src/components/home/FixedProducts.tsx","../src/components/home/FeaturedProductsStyle1.tsx","../src/components/home/FeaturedProductsStyle2.tsx","../src/components/home/FeaturedProductsStyle3.tsx","../src/components/home/ParallaxBackground.tsx","../src/components/home/PhotosSlider.tsx","../src/components/home/SquarePhotos.tsx","../src/components/home/Youtube.tsx","../src/components/home/BundleComponent.tsx","../src/components/home/lazy.ts","../src/components/home/register.ts","../src/components/home/ComponentErrorBoundary.tsx","../src/components/home/HomePageRenderer.tsx","../src/components/home/PageBlocks.tsx","../src/components/home/reorder-hooks.ts","../src/components/home/ReorderProducts.tsx"],"names":["product","StoreFeatures","jsx","memo","FixedBanner","Fragment","jsxs","Suspense","FeaturedProductsStyle1","useCallback","FeaturedProductsStyle2","useState","SallaButton","SallaProductsSlider","FeaturedProductsStyle3","ParallaxBackground","PhotosSlider","SquarePhotos","Youtube","BundleComponent","useEffect","FallbackComponent","ProductsSliderSkeleton","FixedProductsSkeleton","HomeComponentRenderer","Component","PageBlocks","useQuery","ReorderProducts","useMemo"],"mappings":";;;;;;;;;;;;;;;;;;AA6BO,SAAS,cAAA,CAAe,EAAE,IAAA,EAAK,EAAwB;AAC5D,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,cAAA,EAAe;AAC7B,EAAA,MAAM;AAAA,IACJ,QAAA;AAAA,IACA,KAAA;AAAA,IACA,eAAA,EAAiB,aAAA;AAAA,IACjB,QAAA,GAAW,CAAA;AAAA,IACX,QAAA,GAAW,KAAA;AAAA,IACX,aAAA,EAAe,YAAA;AAAA,IACf,cAAA,EAAgB,aAAA;AAAA,IAChB,IAAA;AAAA,IACA,QAAA;AAAA,IACA,eAAA,EAAiB,aAAA;AAAA,IACjB,SAAA;AAAA,IACA;AAAA,GACF,GAAI,IAAA;AAEJ,EAAA,MAAM,WAAA,GAAc,OAAA;AAAA,IAClB,OAAO;AAAA,MACL,EAAA,EAAI,UAAU,QAAQ,CAAA,CAAA;AAAA,MACtB,eAAA,EAAiB,CAAA,CAAE,yBAAA,EAA2B,UAAU,CAAA;AAAA,MACxD,GAAI,YAAA,KAAiB,MAAA,IAAa,EAAE,YAAA,EAAa;AAAA,MACjD,GAAI,aAAA,KAAkB,MAAA,IAAa,EAAE,aAAA,EAAc;AAAA,MACnD,GAAI,IAAA,KAAS,MAAA,IAAa,EAAE,IAAA,EAAK;AAAA,MACjC,GAAI,QAAA,KAAa,MAAA,IAAa,EAAE,QAAA,EAAS;AAAA,MACzC,GAAI,aAAA,KAAkB,MAAA,IAAa,EAAE,aAAA,EAAc;AAAA,MACnD,GAAI,SAAA,KAAc,MAAA,IAAa,EAAE,SAAA;AAAU,KAC7C,CAAA;AAAA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GACR;AAEA,EAAA,IAAI,CAAC,SAAS,OAAO,IAAA;AAErB,EAAA,uBACE3B,GAAAA,CAAC,KAAA,EAAA,EAAI,EAAA,EAAG,mBAAkB,aAAA,EAAY,SAAA,EACpC,QAAA,kBAAAA,GAAAA,CAAC,yBAAsB,IAAA,EAAY,KAAA,EAAO,EAAA,EAAI,QAAA,EAAU,OAAO,CAAA,EACjE,CAAA;AAEJ,CAAC","file":"chunk-444GCMTZ.js","sourcesContent":["import { Suspense, useCallback, useMemo } from 'react';\nimport { product, ProductsListSource } from '../../api/product';\nimport { ProductCard } from '../../components/product';\nimport { ProductsSliderSkeleton, SallaProductsSlider } from '@salla.sa/twilight-components-react';\nimport { useTranslation } from '../../providers/I18nProvider';\n\ninterface ProductsSourceConfig {\n source: ProductsListSource;\n source_value?: number | number[] | null;\n}\n\nexport interface ProductsSliderProps {\n data: {\n products: ProductsSourceConfig;\n title?: string;\n display_all_url?: string;\n position?: number;\n priority?: boolean;\n show_controls?: boolean;\n controls_outer?: boolean;\n loop?: boolean;\n centered?: boolean;\n slides_per_view?: number | 'auto';\n direction?: 'rtl' | 'ltr';\n autoplay?: boolean;\n [key: string]: unknown;\n };\n}\n\nexport function ProductsSlider({ data }: ProductsSliderProps) {\n const { t } = useTranslation();\n const {\n products,\n title,\n display_all_url: displayAllUrl,\n position = 1,\n priority = false,\n show_controls: showControls,\n controls_outer: controlsOuter,\n loop,\n centered,\n slides_per_view: slidesPerView,\n direction,\n autoplay,\n } = data;\n\n const sliderProps = useMemo(\n () => ({\n id: `slider-${position}`,\n displayAllTitle: t('blocks.home.display_all', 'View All'),\n ...(showControls !== undefined && { showControls }),\n ...(controlsOuter !== undefined && { controlsOuter }),\n ...(loop !== undefined && { loop }),\n ...(centered !== undefined && { centered }),\n ...(slidesPerView !== undefined && { slidesPerView }),\n ...(direction !== undefined && { direction }),\n }),\n [position, t, showControls, controlsOuter, loop, centered, slidesPerView, direction]\n );\n\n const loader = useCallback(\n () =>\n product.list({\n source: products.source,\n sourceValue: products.source_value,\n }),\n [products.source, products.source_value]\n );\n\n return (\n <Suspense fallback={<ProductsSliderSkeleton />}>\n <SallaProductsSlider\n id={`best-offers-${position}-slider`}\n loader={loader}\n sliderProps={sliderProps}\n {...(displayAllUrl ? { displayAllUrl } : {})}\n {...(title ? { blockTitle: title } : {})}\n {...(autoplay !== undefined ? { autoplay } : {})}\n skeleton={<ProductsSliderSkeleton />}\n >\n {(product, index) => (\n <ProductCard product={product} imagePriority={priority && index < 2} />\n )}\n </SallaProductsSlider>\n </Suspense>\n );\n}\n","import { memo } from 'react';\nimport type { Feature } from '../../types';\n\nexport interface StoreFeaturesProps {\n data: {\n features: Feature[];\n [key: string]: unknown;\n };\n}\n\nexport const StoreFeatures = memo(function StoreFeatures({ data }: StoreFeaturesProps) {\n const { features } = data;\n\n if (!features.length) return null;\n\n return (\n <>\n <div className=\"grid grid-cols-[repeat(2,minmax(0,1fr))] md:grid-cols-[repeat(3,minmax(0,1fr))] gap-4 sm:gap-6 xl:gap-8\">\n {features.map((feature) => (\n <div\n key={`${feature.icon}:${feature.title}:${feature.description ?? ''}`}\n className=\"s-block--features__item\"\n >\n <div className=\"feature-icon\">\n <i className={feature.icon}></i>\n </div>\n <h2>{feature.title}</h2>\n <p>{feature.description}</p>\n </div>\n ))}\n </div>\n </>\n );\n});\n","import { memo } from 'react';\nimport { Link } from '../common';\n\nexport interface FixedBannerComponentProps {\n data: {\n image: {\n url: string;\n alt?: string;\n small_url?: string;\n };\n url?: string;\n title?: string;\n position?: number;\n [key: string]: unknown;\n };\n priority?: boolean;\n}\n\nexport const FixedBanner = memo(function FixedBanner(props: FixedBannerComponentProps) {\n const { data, priority = false } = props;\n const image = data.image?.url;\n\n if (!image) {\n return null;\n }\n\n const url = data.url;\n const altText = data.image.alt?.trim() ? data.image.alt : data.title || 'fixed banner';\n\n const imgProps = priority\n ? {\n loading: 'eager' as const,\n fetchPriority: 'high' as const,\n decoding: 'sync' as const,\n }\n : {\n loading: 'lazy' as const,\n decoding: 'async' as const,\n };\n\n const smallUrl = data.image.small_url;\n\n return (\n <>\n <div className=\"container\">\n <Link\n to={url || '#'}\n className=\"banner banner--fixed overflow-hidden\"\n aria-label={`Banner ${altText}`}\n >\n <picture>\n {smallUrl && <source media=\"(max-width: 767px)\" srcSet={smallUrl} />}\n <img\n width=\"1200\"\n height=\"300\"\n src={image}\n alt={altText}\n style={{ maxWidth: '100%', objectFit: 'contain' }}\n loading={imgProps.loading}\n decoding={imgProps.decoding}\n {...(priority && { fetchPriority: imgProps.fetchPriority })}\n />\n </picture>\n </Link>\n </div>\n </>\n );\n});\n","import { Suspense } from 'react';\nimport { useQuery } from '@tanstack/react-query';\nimport { FixedProductsSkeleton } from '@salla.sa/twilight-components-react';\nimport { Link } from '../common';\nimport { product, ProductsListSource } from '../../api/product';\nimport { ProductCard } from '../../components/product';\nimport { useTranslation } from '../../providers/I18nProvider';\nimport { useTwilight } from '../../providers/TwilightProvider';\n\nexport interface FixedProductsProps {\n data: {\n products: { source: ProductsListSource; source_value?: number[] | null };\n title?: string;\n limit?: number | string;\n display_all_url?: string | null;\n key?: string | null;\n isVertical?: boolean;\n position?: number;\n [key: string]: unknown;\n };\n}\n\nexport function FixedProducts({ data }: FixedProductsProps) {\n const { t } = useTranslation();\n const { theme } = useTwilight();\n\n const title = data.title;\n // The merchant's product count: a number, or the same as a string. Anything that\n // isn't a positive whole number falls back to what the API returns.\n const parsedLimit = Number(data.limit);\n const limit = Number.isInteger(parsedLimit) && parsedLimit > 0 ? parsedLimit : undefined;\n // Matches Twig Raed: `theme.settings.get('vertical_fixed_products', true)`.\n const isVertical = data.isVertical ?? theme.settings.vertical_fixed_products ?? true;\n\n const { data: result, isLoading } = useQuery(\n product.queries.list({\n source: data.products.source,\n sourceValue: data.products?.source_value,\n perPage: limit,\n })\n );\n\n const products = result?.items ?? [];\n\n if (isLoading) {\n return <FixedProductsSkeleton />;\n }\n\n if (!products.length) return null;\n\n return (\n <Suspense fallback={<FixedProductsSkeleton />}>\n {title && (\n <div className=\"s-block__title\">\n <div className=\"right-side\">\n <h2>{title}</h2>\n </div>\n {data.display_all_url && (\n <Link to={data.display_all_url} className=\"s-block__display-all\">\n {t('blocks.home.display_all', 'View All')}\n <i className=\"sicon-arrow-left\"></i>\n </Link>\n )}\n </div>\n )}\n <div\n className={\n 's-products-list-wrapper ' +\n (isVertical ? 's-products-list-vertical-cards' : 's-products-list-horizontal-cards')\n }\n >\n {products.slice(0, limit).map((product) => (\n <ProductCard\n key={product.id}\n product={product}\n layout={isVertical ? 'vertical' : 'horizontal'}\n />\n ))}\n </div>\n </Suspense>\n );\n}\n","import { memo, useState, useCallback } from 'react';\nimport { SallaButton } from '@salla.sa/twilight-components-react/button';\nimport type { Product } from '../../types';\n\ninterface SectionItem {\n title?: string;\n name?: string;\n type?: string;\n id?: string;\n products?: Product[];\n limit?: number;\n}\n\ninterface MainProduct {\n id?: string;\n title?: string;\n value?: string;\n product?: Product;\n}\n\nexport interface FeaturedProductsStyle1Props {\n data: {\n items: SectionItem[];\n main_product?: MainProduct;\n position?: number;\n [key: string]: unknown;\n };\n}\n\nexport const FeaturedProductsStyle1 = memo(function FeaturedProductsStyle1({\n data,\n}: FeaturedProductsStyle1Props) {\n const items = data.items || [];\n const mainProduct = data.main_product;\n\n const [activeTab, setActiveTab] = useState<string>(items[0]?.id || '');\n const [isAnimating, setIsAnimating] = useState(false);\n\n const handleTabClick = useCallback(\n (tabId: string) => {\n if (tabId === activeTab) return;\n setIsAnimating(true);\n setActiveTab(tabId);\n setTimeout(() => setIsAnimating(false), 100);\n },\n [activeTab]\n );\n\n if (!items.length) return null;\n\n const hasMultipleSections = items.length > 1;\n\n return (\n <>\n <div className=\"s-block__title\">\n <div className=\"right-side\">\n <h2>{mainProduct?.title}</h2>\n </div>\n {hasMultipleSections && (\n <div className=\"tabs hide-scroll hidden lg:flex\">\n {items.map((section) => (\n <SallaButton\n key={section.id}\n shape=\"link\"\n onClick={() => handleTabClick(section.id || '')}\n className={`tab-trigger ${activeTab === section.id ? 'is-active' : ''}`}\n >\n {section.title || section.name}\n </SallaButton>\n ))}\n </div>\n )}\n </div>\n\n <div className={`grid grid-cols-1 gap-8 ${mainProduct?.product ? 'lg:grid-cols-2' : ''}`}>\n {mainProduct?.product && (\n <div className=\"flex flex-col\">\n <custom-salla-product-card\n shadow-on-hover\n product={JSON.stringify(mainProduct.product)}\n isSpecial\n ></custom-salla-product-card>\n </div>\n )}\n <div className=\"flex flex-col\">\n {hasMultipleSections && (\n <div className=\"tabs mb-4 sm:mb-8 hide-scroll lg:hidden\">\n {items.map((section) => (\n <SallaButton\n key={section.id}\n shape=\"link\"\n onClick={() => handleTabClick(section.id || '')}\n className={`tab-trigger ${activeTab === section.id ? 'is-active' : ''}`}\n >\n {section.title || section.name}\n </SallaButton>\n ))}\n </div>\n )}\n\n <div className=\"tabs-wrapper flex flex-1\">\n {items.map((section) => {\n const isActive = activeTab === section.id;\n return (\n <div\n key={section.id}\n className={`tabs__item grid-cols-2 ${mainProduct?.product ? '' : 'lg:grid-cols-4'} ${isActive ? 'is-active' : ''} ${isAnimating && isActive ? 'opacity-0 translate-y-3' : ''} ${!isAnimating && isActive ? 'opacity-100 translate-y-0' : ''}`}\n >\n {section.products\n ?.slice(0, mainProduct?.product ? 4 : 8)\n .map((product, productIndex) => (\n <custom-salla-product-card\n key={product.id || productIndex}\n product={JSON.stringify(product)}\n ></custom-salla-product-card>\n ))}\n </div>\n );\n })}\n </div>\n </div>\n </div>\n </>\n );\n});\n","import { memo, useState, useCallback } from 'react';\nimport { SallaButton } from '@salla.sa/twilight-components-react/button';\nimport { SallaProductsList } from '@salla.sa/twilight-components-react';\nimport { SallaProductsSlider } from '@salla.sa/twilight-components-react';\nimport { product, ProductsListSource } from '../../api/product';\nimport { ProductCard } from '../../components/product';\nimport { useTwilight } from '../../providers/TwilightProvider';\n\ninterface ProductSource {\n source: ProductsListSource;\n limit?: number;\n source_value?: number | number[];\n}\n\ninterface SectionItem {\n title?: string;\n name?: string;\n type?: string;\n id?: string;\n products: ProductSource;\n limit?: number;\n}\n\nexport interface FeaturedProductsStyle2Props {\n data: {\n items: SectionItem[];\n position?: number;\n is_slider?: boolean;\n [key: string]: unknown;\n };\n}\n\n// Like Twig Raed, the grid honors `vertical_fixed_products`; the slider never does.\nexport const FeaturedProductsStyle2 = memo(function FeaturedProductsStyle2({\n data,\n}: FeaturedProductsStyle2Props) {\n const { theme } = useTwilight();\n const items = data.items || [];\n const isSlider = data.is_slider ?? true;\n const cardLayout = (theme.settings.vertical_fixed_products ?? true) ? 'vertical' : 'horizontal';\n\n const [activeTab, setActiveTab] = useState<string>(items[0]?.id || '');\n const [isAnimating, setIsAnimating] = useState(false);\n\n const handleTabClick = useCallback(\n (tabId: string) => {\n if (tabId === activeTab) return;\n setIsAnimating(true);\n setActiveTab(tabId);\n setTimeout(() => setIsAnimating(false), 100);\n },\n [activeTab]\n );\n\n const loader = useCallback(\n (source: ProductsListSource, value?: number | number[], limit?: number) => {\n return () =>\n product.list({\n source: source,\n sourceValue: value,\n perPage: limit,\n });\n },\n []\n );\n\n if (!items.length) return null;\n\n const hasMultipleSections = items.length > 1;\n\n return (\n <>\n <div className=\"container\">\n {hasMultipleSections && (\n <div className=\"tabs hide-scroll\">\n {items.map((section) => (\n <SallaButton\n key={section.id}\n fill=\"outline\"\n onClick={() => handleTabClick(section.id || '')}\n className={`tab-trigger ${activeTab === section.id ? 'is-active' : ''}`}\n >\n {section.title || section.name}\n </SallaButton>\n ))}\n </div>\n )}\n\n <div className=\"tabs-wrapper\">\n {items.map((section) => {\n const isActive = activeTab === section.id;\n return (\n <div\n key={section.id}\n className={`tabs__item ${isActive ? 'is-active' : ''} ${isAnimating && isActive ? 'opacity-0 translate-y-3' : ''} ${!isAnimating && isActive ? 'opacity-100 translate-y-0' : ''}`}\n >\n {isSlider ? (\n <SallaProductsSlider\n loader={loader(\n section.products.source,\n section.products?.source_value,\n section.products?.limit\n )}\n sliderProps={{ id: `section-${section.id}-slider` }}\n >\n {(product) => (\n <ProductCard className=\"s-products-slider-card\" product={product} />\n )}\n </SallaProductsSlider>\n ) : (\n <SallaProductsList\n loader={loader(\n section.products.source,\n section.products?.source_value,\n section.products?.limit\n )}\n itemsClassName={`s-products-list-${cardLayout}-cards`}\n >\n {(products) =>\n products.map((product) => (\n <ProductCard key={product.id} product={product} layout={cardLayout} />\n ))\n }\n </SallaProductsList>\n )}\n </div>\n );\n })}\n </div>\n </div>\n </>\n );\n});\n","import { memo } from 'react';\nimport { ProductCard } from '../product/ProductCard';\nimport type { Product } from '../../types';\n\ninterface SectionItem {\n title?: string;\n name?: string;\n type?: string;\n products?: Product[];\n featured_product?: Product;\n limit?: number;\n id?: string;\n}\n\nexport interface FeaturedProductsStyle3Props {\n data: {\n items: SectionItem[];\n position?: number;\n [key: string]: unknown;\n };\n}\n\nexport const FeaturedProductsStyle3 = memo(function FeaturedProductsStyle3({\n data,\n}: FeaturedProductsStyle3Props) {\n const items = data.items || [];\n\n if (!items.length) return null;\n\n return (\n <>\n <div className=\"inner\">\n {items.map((section, sectionIndex) => (\n <div key={section.id || sectionIndex}>\n <div className=\"s-block__title\">\n <h2>{section.title}</h2>\n </div>\n <div className=\"flex-1 grid lg:grid-cols-2 gap-4 sm:gap-8\">\n {section.featured_product ? (\n <>\n <ProductCard product={section.featured_product} layout=\"fullImage\" withShadow />\n <div className=\"grid gap-4 sm:gap-8\">\n {section.products?.slice(0, 3).map((product, idx) => (\n <ProductCard\n key={product.id}\n product={product}\n layout=\"minimal\"\n withShadow\n index={idx}\n />\n ))}\n </div>\n </>\n ) : (\n section.products?.map((product, idx) => (\n <ProductCard\n key={product.id}\n product={product}\n layout=\"minimal\"\n withShadow\n index={idx}\n />\n ))\n )}\n </div>\n </div>\n ))}\n </div>\n </>\n );\n});\n","import { memo } from 'react';\nimport { Link } from '../common';\n\ninterface ImageData {\n url?: string;\n}\n\nexport interface ParallaxBackgroundProps {\n data: {\n image: ImageData;\n url?: string;\n title?: string;\n link_text?: string;\n is_opacity?: boolean;\n position?: number;\n [key: string]: unknown;\n };\n}\n\nexport const ParallaxBackground = memo(function ParallaxBackground({\n data,\n}: ParallaxBackgroundProps) {\n const { image, url, title, link_text: linkText, is_opacity: isOpacity = false } = data;\n\n if (!image?.url) return null;\n\n return (\n <>\n <div className=\"full-banner-entry\" style={{ backgroundImage: `url(${image.url})` }}>\n <div\n className={`overlay h-full w-full ${isOpacity ? 'bg-black' : ''} opacity-60 absolute top-0 left-0`}\n ></div>\n <div className=\"flex h-full items-center justify-center p-5 xs:p-11 relative\">\n <div>\n {title && <h2 className=\"text-2xl font-bold leading-12\">{title}</h2>}\n\n {url && linkText && (\n <Link\n to={url}\n className=\"inline-block text-white text-sm border rounded-md font-bold px-8 py-4\"\n >\n {linkText}\n </Link>\n )}\n </div>\n </div>\n </div>\n </>\n );\n});\n","import { memo } from 'react';\nimport { SallaSlider } from '@salla.sa/twilight-components-react/slider';\nimport { Link, Image } from '../common';\n\ninterface PhotoItem {\n id?: string | number;\n url?: string;\n link_type?: string;\n image?: string;\n}\n\nexport interface PhotosSliderProps {\n data: {\n items: PhotoItem[];\n position?: number;\n is_repeated?: boolean;\n [key: string]: unknown;\n };\n}\n\nexport const PhotosSlider = memo(function PhotosSlider({ data }: PhotosSliderProps) {\n const items = data.items || [];\n const position = data.position ?? 1;\n\n if (!items.length) return null;\n\n return (\n <>\n <SallaSlider\n type=\"carousel\"\n className=\"home-slider photos-slider\"\n centered\n autoPlay\n pagination\n id={`photos-${position}-slider`}\n sliderConfig={{ watchOverflow: true }}\n >\n <div slot=\"items\">\n {items.map((item, index) => (\n <div\n key={item.id ?? `${item.url ?? ''}:${item.image ?? ''}`}\n className=\"swiper-slide\"\n style={{ aspectRatio: '1200/300' }}\n >\n <Link to={item.url || '#'}>\n <Image\n src={item.image}\n className=\"w-full h-full object-contain rounded-md\"\n alt={`image-slider-${index}`}\n width={1200}\n height={300}\n priority={index === 0}\n />\n </Link>\n </div>\n ))}\n </div>\n </SallaSlider>\n </>\n );\n});\n","import { memo } from 'react';\nimport { Link } from '../common';\n\ninterface ImageData {\n url?: string;\n alt?: string;\n}\n\ninterface SquarePhotoItem {\n id?: string | number;\n url?: string;\n link_type?: string;\n /** The Store API sends the URL itself to the engine; Twig gets `{ url, alt }`. */\n image?: string | ImageData;\n text?: string;\n}\n\nconst imageUrl = (item: SquarePhotoItem) =>\n typeof item.image === 'string' ? item.image : item.image?.url;\n\nexport interface SquarePhotosProps {\n data: {\n title?: string;\n items: SquarePhotoItem[];\n position?: number;\n [key: string]: unknown;\n };\n}\n\nexport const SquarePhotos = memo(function SquarePhotos({ data }: SquarePhotosProps) {\n const items = data.items || [];\n const title = data.title;\n\n if (!items.length) return null;\n\n const gridCols =\n items.length <= 3 ? `one-row md:grid-cols-${items.length}` : 'md:grid-cols-3 two-row';\n\n return (\n <>\n {title && (\n <div className=\"s-block__title\">\n <div className=\"right-side\">\n <h2>{title}</h2>\n </div>\n </div>\n )}\n\n <div className={`grid ${gridCols} grid-flow-row gap-3 sm:gap-8`}>\n {items.map((item) => (\n <Link\n {...(item.link_type === 'external_link' ? { target: '_blank' } : {})}\n key={item.id ?? imageUrl(item) ?? item.url}\n className={`banner-entry square-photos ${item.text ? 'has-overlay with-hover' : ''}`}\n style={{ backgroundImage: `url(${imageUrl(item)})` }}\n to={item.url || '#'}\n >\n {item.text && (\n <h3 className=\"text-with-border\">\n <span>{item.text}</span>\n </h3>\n )}\n </Link>\n ))}\n </div>\n </>\n );\n});\n","import { memo, useEffect, useState } from 'react';\n\nexport interface YoutubeProps {\n data: {\n youtube_id: string;\n position?: number;\n [key: string]: unknown;\n };\n}\n\nexport const Youtube = memo(function Youtube({ data }: YoutubeProps) {\n const { youtube_id: youtubeId } = data;\n const [isLoaded, setIsLoaded] = useState(false);\n\n useEffect(() => {\n if (!youtubeId) return;\n\n // Lazy load the lite-youtube web component\n let mounted = true;\n import('@justinribeiro/lite-youtube')\n .then(() => {\n if (mounted) setIsLoaded(true);\n })\n .catch((err) => {\n console.error('Failed to load lite-youtube:', err);\n });\n\n return () => {\n mounted = false;\n };\n }, [youtubeId]);\n\n if (!youtubeId) return null;\n\n return (\n <>\n <div className=\"container\">\n <div className=\"videoWrapper\">\n {isLoaded ? (\n <lite-youtube videoid={youtubeId} params=\"rel=0\"></lite-youtube>\n ) : (\n <div className=\"animate-pulse bg-gray-200 w-full h-full min-h-[300px] rounded\" />\n )}\n </div>\n </div>\n </>\n );\n});\n","import { memo, useState, useEffect, type CSSProperties } from 'react';\n\n// Placeholder hints a bundle declares per component under `props` in its\n// twilight-bundle.json; the store API passes them as `component_props`. Each maps 1:1 to an\n// attribute on <salla-custom-component>, which reserves the component's space until the\n// bundle renders.\n// @see https://github.com/SallaApp/twilight-bundles/blob/master/packages/starter-kit/README.md#component-skeleton--placeholder\nconst SIZE_PROPS = ['min-height', 'height', 'width', 'aspect-ratio'] as const;\nconst SKELETON_PROPS: readonly string[] = [...SIZE_PROPS, 'skeleton-style'];\n\ntype SkeletonProps = Record<string, string>;\n\nexport interface BundleComponentProps {\n data: {\n component_name: string;\n bundle_id: string;\n component_props?: SkeletonProps;\n [key: string]: unknown;\n };\n}\n\nfunction pickSkeletonProps(props: unknown): SkeletonProps {\n if (!props || typeof props !== 'object') return {};\n return Object.fromEntries(\n Object.entries(props).filter(\n ([name, value]) =>\n SKELETON_PROPS.includes(name) && typeof value === 'string' && value.trim() !== ''\n )\n ) as SkeletonProps;\n}\n\n// Until mount there is no <salla-custom-component>, so hold the same footprint with a plain\n// block — otherwise the server HTML has nothing here and the page shifts once it mounts.\nfunction reservedSizeStyle(props: SkeletonProps): CSSProperties | undefined {\n const sizes = SIZE_PROPS.filter((name) => props[name]);\n if (!sizes.length) return undefined;\n return Object.fromEntries(\n sizes.map((name) => [\n name.replace(/-([a-z])/g, (_, char: string) => char.toUpperCase()),\n props[name],\n ])\n ) as CSSProperties;\n}\n\nexport const BundleComponent = memo(function BundleComponent(props: BundleComponentProps) {\n const [mounted, setMounted] = useState(false);\n\n useEffect(() => {\n setMounted(true);\n }, []);\n\n const {\n component_name: componentName,\n bundle_id: bundleId,\n component_props: componentProps,\n ...rest\n } = props.data;\n const skeletonProps = pickSkeletonProps(componentProps);\n\n if (!mounted) {\n const style = reservedSizeStyle(skeletonProps);\n return style ? <div aria-hidden=\"true\" style={style} /> : null;\n }\n\n const config = JSON.stringify(rest);\n\n return (\n <>\n <salla-custom-component\n component-name={componentName}\n bundle-id={bundleId}\n config={config}\n {...skeletonProps}\n suppressHydrationWarning\n />\n </>\n );\n});\n","import { lazyComponent } from '../../utils/lazy-component';\n\nexport { ProductsSlider as LazyProductsSlider } from './ProductsSlider';\nexport { StoreFeatures as LazyStoreFeatures } from './StoreFeatures';\nexport { FixedBanner as LazyFixedBanner } from './FixedBanner';\nexport { FixedProducts as LazyFixedProducts } from './FixedProducts';\n// Only a home page with no blocks shows it, so most stores never load it.\nexport const LazyLatestProducts = lazyComponent(() =>\n import('./LatestProducts').then((m) => ({ default: m.LatestProducts }))\n);\nexport { FeaturedProductsStyle1 as LazyFeaturedProductsStyle1 } from './FeaturedProductsStyle1';\nexport { FeaturedProductsStyle2 as LazyFeaturedProductsStyle2 } from './FeaturedProductsStyle2';\nexport { FeaturedProductsStyle3 as LazyFeaturedProductsStyle3 } from './FeaturedProductsStyle3';\nexport { ParallaxBackground as LazyParallaxBackground } from './ParallaxBackground';\nexport { PhotosSlider as LazyPhotosSlider } from './PhotosSlider';\nexport { SquarePhotos as LazySquarePhotos } from './SquarePhotos';\nexport const LazyTestimonials = lazyComponent(() =>\n import('./Testimonials').then((m) => ({ default: m.Testimonials }))\n);\nexport { Youtube as LazyYoutube } from './Youtube';\nexport { BundleComponent as LazyBundleComponent } from './BundleComponent';\n","import {\n LazyProductsSlider,\n LazyStoreFeatures,\n LazyFixedBanner,\n LazyFixedProducts,\n LazyLatestProducts,\n LazyFeaturedProductsStyle1,\n LazyFeaturedProductsStyle2,\n LazyFeaturedProductsStyle3,\n LazyParallaxBackground,\n LazyPhotosSlider,\n LazySquarePhotos,\n LazyTestimonials,\n LazyYoutube,\n LazyBundleComponent,\n} from './lazy';\nimport type { AnyHomeComponent } from './types';\nimport { registry } from '../ComponentRegistry';\n\nexport const DefaultHomeComponents: Record<string, AnyHomeComponent | null> = {\n 'fixed-banner': LazyFixedBanner,\n 'photos-slider': LazyPhotosSlider,\n testimonial: LazyTestimonials,\n 'store-features': LazyStoreFeatures,\n youtube: LazyYoutube,\n 'square-photos': LazySquarePhotos,\n 'fixed-products': LazyFixedProducts,\n 'latest-products': LazyLatestProducts,\n 'products-slider': LazyProductsSlider,\n 'parallax-background': LazyParallaxBackground,\n 'featured-products:style1': LazyFeaturedProductsStyle1,\n 'featured-products:style2': LazyFeaturedProductsStyle2,\n 'featured-products:style3': LazyFeaturedProductsStyle3,\n 'bundle-component': LazyBundleComponent,\n};\n\nexport function registerHomeComponents(\n components: Record<string, AnyHomeComponent | null> = DefaultHomeComponents,\n prefix = 'home:'\n): void {\n Object.entries(components).forEach(([path, component]) => {\n if (component) {\n registry.register(`${prefix}${path}`, component);\n }\n });\n}\n","import { Component, type ReactNode, type ErrorInfo } from 'react';\nimport { TwilightContext } from '../../providers/twilight-context';\nimport type { TwilightContextValue } from '../../types/twilight';\nimport type { HomeComponentData } from '../../types';\n\ninterface ComponentErrorBoundaryProps {\n children: ReactNode;\n data: HomeComponentData;\n position: number;\n}\n\ninterface ComponentErrorBoundaryState {\n hasError: boolean;\n error: Error | null;\n}\n\nfunction DevelopmentErrorCard({ error, data }: { error: Error; data: HomeComponentData }) {\n return (\n <section\n dir=\"ltr\"\n className=\"s-block container overflow-hidden bg-red-50 border border-red-300 p-4\"\n >\n <p className=\"text-red-800 text-sm font-bold\">Home Component Error: {data.path}</p>\n <p className=\"text-red-700 text-sm mt-2\">{error.message}</p>\n <details className=\"mt-2\">\n <summary className=\"text-xs cursor-pointer text-red-600\">Stack Trace</summary>\n <pre className=\"text-xs mt-1 overflow-auto max-h-32 text-red-700\">{error.stack}</pre>\n </details>\n <details className=\"mt-2\">\n <summary className=\"text-xs cursor-pointer text-red-600\">Component Data</summary>\n <pre className=\"text-xs mt-1 overflow-auto max-h-32 text-red-700\">\n {JSON.stringify(data, null, 2)}\n </pre>\n </details>\n </section>\n );\n}\n\nexport class ComponentErrorBoundary extends Component<\n ComponentErrorBoundaryProps,\n ComponentErrorBoundaryState\n> {\n static contextType = TwilightContext;\n\n declare context: TwilightContextValue | null;\n\n constructor(props: ComponentErrorBoundaryProps) {\n super(props);\n this.state = { hasError: false, error: null };\n }\n\n static getDerivedStateFromError(error: Error): ComponentErrorBoundaryState {\n return { hasError: true, error };\n }\n\n // Blocks are keyed by position, so a replacement block at the same position reuses\n // this boundary. An error belongs to the block that threw it, not the position.\n componentDidUpdate(prevProps: ComponentErrorBoundaryProps): void {\n if (this.state.hasError && prevProps.data !== this.props.data) {\n this.setState({ hasError: false, error: null });\n }\n }\n\n componentDidCatch(error: Error, errorInfo: ErrorInfo): void {\n if (!this.context) {\n console.error('[ComponentErrorBoundary] Must be used within TwilightProvider');\n return;\n }\n const { log } = this.context;\n const { data, position } = this.props;\n\n log.groupCollapsed(`HomeComponent Error: ${data.path || 'unknown'}`);\n log.error('ERROR', error.message);\n log.label('COMPONENT', data.path || 'unknown');\n log.label('POSITION', position);\n log.label('URL', typeof window !== 'undefined' ? window.location.href : 'SSR');\n log.label('TIME', new Date().toISOString());\n log.trace('STACK TRACE', error.stack || '');\n log.trace('COMPONENT STACK', errorInfo.componentStack || '');\n log.dir('COMPONENT DATA', data);\n log.groupEnd();\n }\n\n render(): ReactNode {\n const { hasError, error } = this.state;\n const { children, data } = this.props;\n\n if (hasError && error) {\n if (process.env.NODE_ENV === 'production') {\n return null;\n }\n\n return <DevelopmentErrorCard error={error} data={data} />;\n }\n\n return children;\n }\n}\n","import { memo, useEffect, useRef, type ReactNode } from 'react';\nimport { registry } from '../ComponentRegistry';\nimport { RenderWhenVisible } from '../common';\nimport { ComponentErrorBoundary } from './ComponentErrorBoundary';\nimport type { AnyHomeComponent } from './index';\nimport type { HomeComponentData } from '../../types';\nimport {\n BackgroundSliderSkeleton,\n BulletDeliverySkeleton,\n FixedProductsSkeleton,\n ListSkeleton,\n ProductsSliderSkeleton,\n Pulse,\n ReviewItemSkeleton,\n SliderSkeleton,\n} from '@salla.sa/twilight-components-react';\n\nfunction SquareGridSkeleton() {\n return (\n <div className=\"s-block container grid grid-cols-2 sm:grid-cols-4 gap-4 py-8\">\n {[1, 2, 3, 4].map((i) => (\n <Pulse key={i} className=\"aspect-square\" />\n ))}\n </div>\n );\n}\n\nexport type HomeComponentsProps = {\n data: HomeComponentData & {\n position?: number;\n [key: string]: unknown;\n };\n};\n\n/**\n * Fallback component for unknown/unregistered components\n * Only shows in development mode\n */\nconst FallbackComponent = memo(function FallbackComponent({ data }: HomeComponentsProps) {\n if (process.env.NODE_ENV === 'production') return null;\n\n return (\n <section\n dir=\"ltr\"\n className=\"s-block container overflow-hidden bg-yellow-50 border border-yellow-200 p-4\"\n >\n <p className=\"text-yellow-800 text-sm\">\n <strong>Unknown component:</strong> {data.path}\n </p>\n <p className=\"text-yellow-700 text-xs mt-1\">\n Register it in setup.ts: <code>registry.register('home:{data.path}', YourComponent)</code>\n </p>\n <details className=\"mt-2\">\n <summary className=\"text-xs cursor-pointer\">Component Data</summary>\n <pre className=\"text-xs mt-1 overflow-auto max-h-32\">{JSON.stringify(data, null, 2)}</pre>\n </details>\n </section>\n );\n});\n\n/**\n * Get the React component for a given home component path\n * Looks up from registry only - theme must register components\n */\nfunction getComponentByPath(data: HomeComponentData): AnyHomeComponent {\n const { path, view_style: viewStyle } = data;\n\n // 1. Check for view_style variant first\n if (viewStyle) {\n const variantKey = `home:${path}:${viewStyle}`;\n const variant = registry.resolve(variantKey);\n if (variant) {\n return variant as AnyHomeComponent;\n }\n }\n\n // 2. Check registry for component\n const registryKey = `home:${path}`;\n const component = registry.resolve(registryKey);\n if (component) {\n return component as AnyHomeComponent;\n }\n\n // 3. Fallback for unknown components\n return FallbackComponent;\n}\n\n/** Same breakpoint and rules the Store injects for Twig themes (`ComponentVisibilityStyles`). */\nconst CHANNEL_VISIBILITY_CSS =\n '@media (max-width:767.98px){.s-hide-on-mobile{display:none!important}}' +\n '@media (min-width:768px){.s-hide-on-desktop{display:none!important}}';\n\n/**\n * Hide class for the merchant's per-channel pick. A missing key, or one that\n * hides on both channels, means visible everywhere: hiding a block outright\n * is the `is_visible` toggle's job, and stores without the feature send no key.\n */\nexport function channelVisibilityClass(data: HomeComponentData): string {\n const raw = data.channel_visibility;\n if (!raw || typeof raw !== 'object') return '';\n const desktop = raw.desktop !== false;\n const mobile = raw.mobile !== false;\n if (desktop && !mobile) return 's-hide-on-mobile';\n if (mobile && !desktop) return 's-hide-on-desktop';\n return '';\n}\n\n/**\n * Render-shell config for a home block: the values the lazy-load wrapper\n * (`RenderWhenVisible`) needs *before* the block mounts — reserved height, the\n * skeleton placeholder, and the wrapper's className/id.\n *\n * Themes register config for blocks they own via `registerHomeComponentConfig`;\n * the engine knows nothing about theme-specific blocks.\n */\nexport type HomeComponentConfig = {\n height?: string;\n className?: string | ((data: HomeComponentData) => string);\n id?: string | ((data: HomeComponentData) => string);\n placeholder?: ReactNode;\n /** Mount on page load instead of when the block nears the viewport. */\n renderOnMount?: boolean;\n};\n\nconst COMPONENT_CONFIG: Record<string, HomeComponentConfig> = {\n 'products-slider': { height: '450px', placeholder: <ProductsSliderSkeleton /> },\n 'fixed-products': { height: '450px', placeholder: <FixedProductsSkeleton /> },\n 'latest-products': {\n height: '450px',\n placeholder: <FixedProductsSkeleton />,\n // As in Twig Raed's `latest-products.twig`.\n className: 's-block s-block--latest-products container mt-6 sm:mt-8',\n },\n 'featured-products': {\n height: '450px',\n placeholder: <ProductsSliderSkeleton />,\n className: (data) => {\n const style = data.view_style;\n if (style === 'style1')\n return 's-block s-block--featured-products s-block-tabs s-block--special-products container tabs-initialized';\n if (style === 'style2')\n return `s-block s-block--featured-products s-block-tabs s-block--tabs-produtcs s-block--full-bg tabs-initialized ${data.is_slider ? 'as-slider' : 'as-grid'} bg-gray-100 py-8 sm:py-16`;\n if (style === 'style3')\n return `s-block s-block--featured-products s-block--features-products${Array.isArray(data.items) && data.items.length > 1 ? ' two-cols' : ''} container`;\n return 's-block s-block--featured-products container overflow-hidden';\n },\n id: (data) => `featured-products-${data.view_style}-${data.position ?? 0}`,\n },\n testimonial: { height: '350px', placeholder: <ReviewItemSkeleton /> },\n 'store-features': { height: '200px', placeholder: <BulletDeliverySkeleton /> },\n 'parallax-background': { height: '500px', placeholder: <BackgroundSliderSkeleton /> },\n 'fixed-banner': { height: '350px', placeholder: <BackgroundSliderSkeleton /> },\n 'photos-slider': {\n height: 'clamp(130px, 30vw, 350px)',\n placeholder: <SliderSkeleton />,\n className: (data) =>\n `s-block s-block--photos-slider${data.is_repeated ? ' repeated-block' : ''}`,\n },\n 'square-photos': { height: '250px', placeholder: <SquareGridSkeleton /> },\n youtube: { height: '350px', placeholder: <SliderSkeleton /> },\n 'bundle-component': {\n // As in Twig: reserve nothing, the bundle grows the block from 0.\n height: '0px',\n placeholder: <></>,\n className: (data) => `s-block s-block--bundle-${data.component_name}`,\n // As in Twig, where merchant scripts wait a limited time for the bundle's markup.\n renderOnMount: true,\n },\n 'main-links': {\n height: '200px',\n placeholder: <ListSkeleton />,\n className: (data) => {\n const mergeWithTop = data.merge_links_with_top_component;\n const position = data.position;\n return [\n 's-block',\n 's-block--main-links',\n mergeWithTop && position ? 'merge-with-top-component' : '',\n !data.title && mergeWithTop ? 'merged-has-no-title' : '',\n ]\n .filter(Boolean)\n .join(' ');\n },\n },\n 'square-links': { height: '200px', placeholder: <SquareGridSkeleton /> },\n};\n\n/**\n * Theme-registered render-shell config, keyed by home component path. Themes own\n * the display of their blocks by registering config here; at render time a path's\n * theme entry replaces (not field-merges) the engine's built-in `COMPONENT_CONFIG`\n * entry for that path.\n */\nconst themeComponentConfig: Record<string, HomeComponentConfig> = {};\n\n/**\n * Register render-shell config for home blocks a theme owns (height, placeholder,\n * className, id). Merges by path and overwrites existing keys, so it is safe to\n * call more than once and idempotent for the same keys.\n */\nexport function registerHomeComponentConfig(config: Record<string, HomeComponentConfig>): void {\n Object.assign(themeComponentConfig, config);\n}\n\n/**\n * Resolve a block's render-shell config: theme-registered config takes precedence\n * over the engine's built-in config; returns `undefined` when neither defines the\n * path so the renderer can apply generic defaults.\n */\nfunction resolveComponentConfig(path: string): HomeComponentConfig | undefined {\n return themeComponentConfig[path] ?? COMPONENT_CONFIG[path];\n}\n\n/**\n * What the theme editor addresses a block by: the dev editor's layout id (less\n * the remount suffix), its row id, or the uuid of one not saved yet. The layout\n * id comes first: a customized layout keeps the store blocks' row ids among\n * their fields, and duplicates share them. A built-in block (fixed products,\n * YouTube, …) has neither id nor key, so it goes by its path, which the\n * editor matches to the block's slug; the bar says which copy. A block the\n * engine adds itself (`editable: false`) is not the merchant's, so it has none.\n */\nfunction liveBlockIdOf(data: HomeComponentData, editable?: boolean): string | undefined {\n if (editable === false) return undefined;\n const devId = typeof data.__dev_id === 'string' ? data.__dev_id.replace(/~\\d+$/, '') : undefined;\n const id = devId ?? data.id ?? data.key;\n if (typeof id === 'number' || (typeof id === 'string' && id)) return String(id);\n return data.path || undefined;\n}\n\n/**\n * Memoized component renderer with scroll-based lazy loading\n * Components only mount when scrolled into view - preventing API calls until needed\n */\nexport const HomeComponentRenderer = memo(function HomeComponentRenderer({\n data,\n index,\n priority,\n editable,\n}: {\n data: HomeComponentData;\n index: number;\n /** Mount right away with eager images. Defaults to the first three blocks of the page. */\n priority?: boolean;\n /** False for a block the engine adds, not the merchant: the theme editor's bar leaves it alone. */\n editable?: boolean;\n}) {\n const renderCountRef = useRef(0);\n renderCountRef.current += 1;\n\n if (process.env.NODE_ENV === 'development') {\n console.log(\n `[HomeComponentRenderer] RENDER: path=${data.path}, index=${index}, renderCount=${renderCountRef.current}`\n );\n }\n\n useEffect(() => {\n console.log(\n `[HomeComponentRenderer] MOUNT: path=${data.path}, index=${index}, renderCount=${renderCountRef.current}`\n );\n return () => {\n console.log(`[HomeComponentRenderer] UNMOUNT: path=${data.path}, index=${index}`);\n };\n }, [data.path, index]);\n\n const isFirstComponent = priority ?? index <= 2;\n const Component = getComponentByPath(data);\n\n const config = resolveComponentConfig(data.path);\n\n const resolvedClassName = config?.className\n ? typeof config.className === 'function'\n ? config.className(data)\n : config.className\n : `s-block s-block--${data.path}`;\n const hideClass = channelVisibilityClass(data);\n const resolvedId = config?.id\n ? typeof config.id === 'function'\n ? config.id(data)\n : config.id\n : undefined;\n const liveBlockId = liveBlockIdOf(data, editable);\n const height = config?.height || '400px';\n // A theme's config replaces the engine's, but keeps its mount timing unless the theme sets one.\n const renderOnMount = config?.renderOnMount ?? COMPONENT_CONFIG[data.path]?.renderOnMount;\n\n const content = (\n <ComponentErrorBoundary data={data} position={index + 1}>\n <Component data={{ ...data, position: index + 1, priority: isFirstComponent }} />\n </ComponentErrorBoundary>\n );\n\n return (\n <>\n {hideClass && (\n <style href=\"twilight-channel-visibility\" precedence=\"default\">\n {CHANNEL_VISIBILITY_CSS}\n </style>\n )}\n <RenderWhenVisible\n rootMargin=\"50px\"\n className={hideClass ? `${resolvedClassName} ${hideClass}` : resolvedClassName}\n id={resolvedId}\n estimatedHeight={height}\n renderOnMount={isFirstComponent || renderOnMount === true}\n placeholder={config?.placeholder ?? <ProductsSliderSkeleton />}\n // Dev only: lets the theme editor scroll the preview to a block.\n blockIndex={import.meta.env.DEV ? index : undefined}\n liveBlockId={liveBlockId}\n >\n {content}\n </RenderWhenVisible>\n </>\n );\n});\n","import { memo } from 'react';\nimport { useQuery } from '@tanstack/react-query';\nimport { home, type BlockScope } from '../../api/home';\nimport { HomeComponentRenderer } from './HomePageRenderer';\n\nexport interface PageBlocksProps {\n /** The page hook the merchant placed the blocks at, e.g. `product.single.before_customer_reviews`. */\n hook: string;\n /** The product, category or page being shown. */\n scope: BlockScope;\n}\n\n/** Draws the blocks placed at a product, category or page hook, loaded in the browser. */\nexport const PageBlocks = memo(function PageBlocks({ hook, scope }: PageBlocksProps) {\n const { data: blocks = [] } = useQuery(home.queries.blocks(hook, scope));\n\n return (\n <>\n {blocks.map((data, index) => (\n <HomeComponentRenderer key={index} data={data} index={index} priority={false} />\n ))}\n </>\n );\n});\n","import { useEffect } from 'react';\nimport { useTranslation } from '../../providers/I18nProvider';\nimport { whenSallaLoaded } from '../../utils/sdk-helpers';\n\ninterface ReorderLabels {\n /** The add button's text in a reorder list. */\n add: string;\n /** Its text for an out-of-stock product. */\n outOfStock: string;\n}\n\nlet registered = false;\n\n/**\n * Twig's ReorderProductsWidget script: inside a reorder list the add button reads the block's\n * title and adds the product as the customer last ordered it. The SDK has no way to remove a\n * hook, so it is registered once per page load.\n */\nfunction registerReorderHooks(labels: ReorderLabels): void {\n if (registered) return;\n registered = true;\n whenSallaLoaded((sdk) => {\n sdk.hooks?.registerHook?.('salla-add-product-button', 'componentDidLoad', (component) => {\n if (!component.host?.closest('[source=\"reorder\"], [data-source=\"reorder\"]')) return;\n const isOutOfStock =\n component.productStatus === 'out' || component.productStatus === 'out-and-notify';\n const setLabel = () => component.btn?.setText(isOutOfStock ? labels.outOfStock : labels.add);\n setLabel();\n sdk.lang?.onLoaded?.(setLabel);\n if (isOutOfStock) return;\n component.addProductToCart = async (event: Event) => {\n event.preventDefault();\n // The click lands on the inner button, which has no product-id; without one the SDK uses the page's.\n const productId = component.productId ?? component.host.getAttribute('product-id');\n await sdk.order.api.reorderProduct?.(productId ?? undefined);\n };\n });\n });\n}\n\n/**\n * Inside an element with `data-source=\"reorder\"`, make each add button read \"order again\" and\n * add the product as the customer last ordered it, as Twig's reorder block and page do.\n */\nexport function useReorderButtons(enabled: boolean): void {\n const { t } = useTranslation();\n const add = t('pages.orders.repurchase');\n const outOfStock = t('pages.products.out_of_stock');\n useEffect(() => {\n if (enabled) registerReorderHooks({ add, outOfStock });\n }, [enabled, add, outOfStock]);\n}\n","import { memo, useMemo } from 'react';\nimport { useTranslation } from '../../providers/I18nProvider';\nimport { getTwilightContext } from '../../twilight/context';\nimport type { HomeComponentData } from '../../types';\nimport { HomeComponentRenderer } from './HomePageRenderer';\nimport { useReorderButtons } from './reorder-hooks';\n\n/**\n * Twig's \"order again\" block (the Store app's ReorderProductsWidget): on the home page, for a\n * signed-in customer of a store with Reorder on, the products they ordered before, drawn by the\n * theme's own `products-slider` like the home's other product rows.\n */\nexport const ReorderProducts = memo(function ReorderProducts() {\n const { t } = useTranslation();\n const { authToken, settings } = getTwilightContext();\n // The platform lists `reorder` in the store's features exactly when the Reorder setting is on.\n const enabled = !!authToken && !!settings?.store?.features?.includes('reorder');\n const title = t('pages.orders.repurchase');\n useReorderButtons(enabled);\n\n const data = useMemo<HomeComponentData>(\n () => ({\n path: 'products-slider',\n title,\n display_all_url: '/products?source=reorder',\n products: { source: 'reorder' },\n }),\n [title]\n );\n\n if (!enabled) return null;\n\n return (\n <div id=\"reorder-section\" data-source=\"reorder\">\n <HomeComponentRenderer data={data} index={-1} priority={false} />\n </div>\n );\n});\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { advertisement, advertisementsFor } from './chunk-
|
|
1
|
+
import { advertisement, advertisementsFor } from './chunk-2AS6KREO.js';
|
|
2
2
|
import { useTranslation } from './chunk-TYNZ5B2B.js';
|
|
3
3
|
import { whenSallaReady } from './chunk-NHA4SBKG.js';
|
|
4
4
|
import { subscribeTwilight, getTwilightContext } from './chunk-6K34BCUP.js';
|
|
@@ -99,5 +99,5 @@ function PageAdvertisements() {
|
|
|
99
99
|
}
|
|
100
100
|
|
|
101
101
|
export { PageAdvertisements };
|
|
102
|
-
//# sourceMappingURL=chunk-
|
|
103
|
-
//# sourceMappingURL=chunk-
|
|
102
|
+
//# sourceMappingURL=chunk-5NTD7WXX.js.map
|
|
103
|
+
//# sourceMappingURL=chunk-5NTD7WXX.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/layout/PageAdvertisements.tsx"],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IAAA,CAAC,MAAA,EAAA,EAAK,WAAU,mEAAA,EAEd,QAAA,EAAA;AAAA,4BAAA,GAAA;AAAA,cAAC,GAAA;AAAA,cAAA;AAAA,gBACC,SAAA,EAAW,CAAA,sEAAA,EAAyE,EAAA,CAAG,IAAA,IAAQ,EAAE,CAAA;AAAA;AAAA,aACnG;AAAA,YACC,GAAG,GAAA,mBACF,GAAA;AAAA,cAAC,GAAA;AAAA,cAAA;AAAA,gBACC,MAAM,EAAA,CAAG,GAAA;AAAA,gBACT,MAAA,EAAQ,GAAG,MAAA,IAAU,MAAA;AAAA,gBACrB,GAAA,EAAK,EAAA,CAAG,MAAA,KAAW,QAAA,GAAW,UAAA,GAAa,MAAA;AAAA,gBAE1C,QAAA,EAAA,EAAA,CAAG;AAAA;AAAA,gBAGN,EAAA,CAAG;AAAA,WAAA,EAEP,CAAA;AAAA,0BACA,GAAA;AAAA,YAAC,QAAA;AAAA,YAAA;AAAA,cACC,IAAA,EAAK,QAAA;AAAA,cACL,SAAA,EAAU,6BAAA;AAAA,cACV,YAAA,EAAY,CAAA,CAAE,sBAAA,EAAwB,OAAO,CAAA;AAAA,cAC7C,OAAA,EAAS,MAAM,KAAA,CAAM,EAAA,CAAG,EAAE,CAAA;AAAA,cAG1B,QAAA,kBAAA,GAAA,CAAC,GAAA,EAAA,EAAE,SAAA,EAAU,2BAAA,EAA4B;AAAA;AAAA;AAC3C,SAAA,EACF;AAAA,OAAA;AAAA,MAhCK,EAAA,CAAG;AAAA,KAkCX,CAAA;AAAA,oBACD,GAAA,CAAC,QAAA,EAAA,EAAO,wBAAA,EAAwB,IAAA,EAAE,QAAA,EAAA,qBAAA,EAAsB;AAAA,GAAA,EAC1D,CAAA;AAEJ","file":"chunk-5NTD7WXX.js","sourcesContent":["import { useEffect, useState, useSyncExternalStore } from 'react';\nimport { useQuery } from '@tanstack/react-query';\nimport { advertisement, advertisementsFor, type Advertisement } from '../../api/advertisement';\nimport { whenSallaReady } from '../../utils/sdk-helpers';\nimport { useTranslation } from '../../providers/I18nProvider';\nimport { getTwilightContext, subscribeTwilight } from '../../twilight/context';\n\nconst currentPageSlug = () => getTwilightContext().page?.slug;\n\n/** The key `<salla-advertisement>` marks a closed ad with, through `salla.storage` (store.js, JSON). */\nconst dismissedKey = (id: number) => `statusAd-${id}`;\n\n/** Stable while the query has no data, so the effect below doesn't rerun on every render. */\nconst NO_ADS: Advertisement[] = [];\n\n/** Hides the ads this visitor closed before the first paint; the effect then drops them. */\nconst HIDE_DISMISSED_SCRIPT =\n \"(function(){try{if(window.self!==window.top)return;document.currentScript.parentNode.querySelectorAll('.s-advertisement[data-id]').forEach(function(e){if(localStorage.getItem('statusAd-'+e.getAttribute('data-id')))e.hidden=true})}catch(e){}})();\";\n\nfunction isDismissed(id: number): boolean {\n try {\n return Boolean(window.localStorage.getItem(dismissedKey(id)));\n } catch {\n return false;\n }\n}\n\nfunction dismiss(id: number): void {\n const storage = window.salla?.storage;\n if (typeof storage?.set === 'function') storage.set(dismissedKey(id), 'dismissed');\n else {\n try {\n window.localStorage.setItem(dismissedKey(id), JSON.stringify('dismissed'));\n } catch {\n // Storage disabled: the ad hides for this page view only.\n }\n }\n}\n\ninterface ClientView {\n /** The theme editor's iframe, or the SDK's debug flag: every ad shows, closed or not. */\n preview: boolean;\n /** Inside the Salla mobile app, which shows no ads. */\n inApp: boolean;\n dismissed: Set<number>;\n}\n\n/**\n * The merchant's announcement bars, in place of `<salla-advertisement>`. Same data, rules and\n * markup, but rendered on the server (the ads are prefetched in the root `beforeLoad`), so the\n * bar is in the first paint instead of pushing the page down when the web component fetches it.\n */\nexport function PageAdvertisements() {\n const { t } = useTranslation();\n // The deepest route loader's `page`, the page `salla.config` reports.\n const pageSlug = useSyncExternalStore(subscribeTwilight, currentPageSlug, currentPageSlug);\n // The query's `retry: 0` only bounds the server wait; the browser may retry.\n const { data: ads = NO_ADS } = useQuery({ ...advertisement.queries.list(), retry: 2 });\n const [view, setView] = useState<ClientView | null>(null);\n\n useEffect(() => {\n const dismissed = new Set(ads.filter((ad) => isDismissed(ad.id)).map((ad) => ad.id));\n setView({ preview: window.self !== window.top, inApp: false, dismissed });\n return whenSallaReady((sdk) => {\n const config = sdk.config as { isMobileApp?: () => boolean; isDebug?: () => boolean };\n const inApp = Boolean(config?.isMobileApp?.());\n const debug = Boolean(config?.isDebug?.());\n if (inApp || debug) {\n setView((current) =>\n current ? { ...current, inApp, preview: current.preview || debug } : current\n );\n }\n });\n }, [ads]);\n\n if (view?.inApp) return null;\n const shown = view?.preview\n ? ads\n : advertisementsFor(ads, pageSlug).filter((ad) => !view?.dismissed.has(ad.id));\n if (!shown.length) return null;\n\n const close = (id: number) => {\n dismiss(id);\n setView((current) =>\n current ? { ...current, dismissed: new Set(current.dismissed).add(id) } : current\n );\n };\n\n return (\n <>\n {shown.map((ad) => (\n <div\n key={ad.id}\n className=\"s-advertisement\"\n data-id={ad.id}\n style={{ backgroundColor: ad.colors?.bg, color: ad.colors?.text }}\n >\n <div className=\"s-advertisement-content container flex justify-between items-center py-2.5\">\n <span className=\"s-advertisement-content-main flex-1 font-bold text-center text-sm\">\n {/* Rendered without an icon too, as the SDK does: its margin is part of the layout. */}\n <i\n className={`s-advertisement-content-icon inline-block align-middle me-2 text-base ${ad.icon ?? ''}`}\n />\n {ad.url ? (\n <a\n href={ad.url}\n target={ad.target ?? undefined}\n rel={ad.target === '_blank' ? 'noopener' : undefined}\n >\n {ad.description}\n </a>\n ) : (\n ad.description\n )}\n </span>\n <button\n type=\"button\"\n className=\"s-advertisement-action px-1\"\n aria-label={t('common.buttons.close', 'Close')}\n onClick={() => close(ad.id)}\n >\n {/* `inline-block`: before the icon CSS loads, an empty inline `<i>` leaves the button 0px tall. */}\n <i className=\"sicon-cancel inline-block\" />\n </button>\n </div>\n </div>\n ))}\n <script suppressHydrationWarning>{HIDE_DISMISSED_SCRIPT}</script>\n </>\n );\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { filesCdn, cdn } from './chunk-
|
|
1
|
+
import { filesCdn, cdn } from './chunk-UXJAZ5JP.js';
|
|
2
2
|
import { storeTranslationsQueryKey, translationsQueryKey, composeMessages, isPlainObject } from './chunk-6K34BCUP.js';
|
|
3
3
|
import { queryOptions } from '@tanstack/react-query';
|
|
4
4
|
|
|
@@ -126,5 +126,5 @@ var translations = {
|
|
|
126
126
|
};
|
|
127
127
|
|
|
128
128
|
export { commonTranslationsPath, storeTranslationsPath, translations };
|
|
129
|
-
//# sourceMappingURL=chunk-
|
|
130
|
-
//# sourceMappingURL=chunk-
|
|
129
|
+
//# sourceMappingURL=chunk-7DRXAR76.js.map
|
|
130
|
+
//# sourceMappingURL=chunk-7DRXAR76.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/api/translations.ts"],"names":[],"mappings":";;;;AAiEA,IAAM,kBAAA,GAAqB,sBAAA;AAGpB,SAAS,uBAAuB,MAAA,EAAwB;AAC7D,EAAA,OAAO,uBAAuB,MAAM,CAAA,KAAA,CAAA;AACtC;AAWO,SAAS,qBAAA,CAAsB,SAA0B,MAAA,EAAwB;AACtF,EAAA,OAAO,CAAA,aAAA,EAAgB,OAAO,CAAA,CAAA,EAAI,MAAM,CAAA,KAAA,CAAA;AAC1C;AAUA,eAAe,eACb,IAAA,EACA,EAAE,aAAa,KAAA,EAAM,GAA8B,EAAC,EAC1B;AAE1B,EAAA,MAAM,UAAA,GAAa,CAAC,MAAA,EAAgB,KAAA,KAA0B;AAC5D,IAAA,IAAI,UAAA,EAAY,MAAM,IAAI,KAAA,CAAM,CAAA,eAAA,EAAkB,IAAI,CAAA,EAAA,EAAK,MAAM,CAAA,CAAA,EAAI,EAAE,KAAA,EAAO,CAAA;AAC9E,IAAA,OAAA,CAAQ,IAAA,CAAK,gBAAA,EAAkB,MAAA,EAAQ,IAAA,EAAM,SAAS,EAAE,CAAA;AACxD,IAAA,OAAO,IAAA;AAAA,EACT,CAAA;AAEA,EAAA,IAAI;AACF,IAAA,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A,CAA0B,OAAA,EAAS,MAAM,CAAA;AAAA,MACnD,OAAA,EAAS,MAAM,YAAA,CAAa,QAAA,CAAS,SAAS,MAAM;AAAA,KACrD;AAAA;AAEP","file":"chunk-HUJARQI7.js","sourcesContent":["/**\n * @fileoverview Where a storefront's words come from.\n *\n * Two files, merged: the platform's copy for this language, and the merchant's\n * own edits for this language and this store. Both are plain JSON objects on\n * the uploader's CDN, one per language.\n *\n * ```\n * https://cdn.files.salla.network/translations/common/<locale>.json the platform's\n * https://cdn.files.salla.network/translations/<storeId>/<locale>.json the merchant's\n * ```\n *\n * **What this replaces, and why.** Until now the engine read a single global\n * file, `cdn.salla.network/js/translations.json`, holding every language keyed\n * `\"<locale>.trans\"`. Nothing publishes that file: it is an object last written\n * on 2026-03-26, carrying only `ar` and `en` where the platform has 39 locales,\n * 405 keys behind `Languages-Module` and 959 English strings textually\n * different from it. So every React storefront has been serving copy from\n * March, and a key added since has never reached one. It also carried no\n * merchant overrides at all — a merchant editing their theme's wording in the\n * Dashboard changed nothing on a React theme.\n *\n * **Merchant overrides are read, and only when there are any.** Getting here\n * took two corrections worth keeping.\n *\n * The first is the address. A merchant's own wording lives at\n * `translations/<storeId>/<locale>.json`, keyed by `store()->getRouteKey()` —\n * the Optimus-encoded numeric id. An early version addressed it with\n * `resolveStoreIdentifier()`, on the claim that the two are the same string.\n * That is true of the `store-identifier` *header*, which accepts a host, a\n * username or an id, and false of the R2 key: on a custom domain the resolver\n * returns `reefperfumes.com` and on a shared host a username like\n * `mtgr-alaatr-2`. Both 404, both then read as \"this store has no overrides\",\n * and the merchant's wording silently never appears — so the feature would have\n * worked under `?storeId=` alone, which is preview and localhost. It is\n * `settings.store.id` now, which is known only after the settings query.\n *\n * The second is when to ask at all. Most stores have never customised a word,\n * and a miss is an uncached round trip (`cf-cache-status: DYNAMIC` on the 404)\n * on the critical path of every SSR render. So the request is made only when\n * `settings.languages[<ISO>].has_custom_translations` says there is something\n * to get — a flag `Languages-Module` writes when a merchant saves a\n * translation. A store without overrides pays nothing, which is what made this\n * shippable at all.\n *\n * ⚠️ The flag is written on save, so a store whose wording predates it reads as\n * `false` until someone edits a translation or the backfill runs. That is a\n * store keeping today's behaviour, not a regression — React themes have never\n * read merchant overrides — but it does mean the feature is only as complete as\n * the backfill.\n *\n * **Rollout is by fallback, not by flag.** `translations/common/` is written by\n * a sync in the theme build service that may not have run yet, and a hard switch\n * would leave every storefront with no platform strings at all. A missing common\n * file therefore falls back to the old global one, which is exactly today's\n * behaviour — so this is safe to ship before the bucket is populated, and stops\n * using the fallback on its own once it is.\n */\nimport { queryOptions } from '@tanstack/react-query';\nimport { cdn, filesCdn } from './client';\nimport { storeTranslationsQueryKey, translationsQueryKey } from './translations-key';\nimport { composeMessages, isPlainObject, type Messages } from './messages';\nimport type { TranslationMessages } from '../providers/I18nProvider';\n\n/** The global file this used to be the only reader of. See the file comment. */\nconst LEGACY_GLOBAL_FILE = 'js/translations.json';\n\n/** One language of platform copy, shared by every store. */\nexport function commonTranslationsPath(locale: string): string {\n return `translations/common/${locale}.json`;\n}\n\n/**\n * One language of a single merchant's own wording.\n *\n * `storeId` is `settings.store.id`, which is the value `Languages-Module` names\n * the object with (`store()->getRouteKey()`, the Optimus-encoded numeric id).\n * It is **not** `resolveStoreIdentifier()`: that returns a hostname on a custom\n * domain and a username on a shared host, both of which 404 here and would read\n * as \"this merchant has no overrides\" — silently, on every store but a preview.\n */\nexport function storeTranslationsPath(storeId: string | number, locale: string): string {\n return `translations/${storeId}/${locale}.json`;\n}\n\n/**\n * Reads one language file, or `null` when there is nothing to read.\n *\n * A 404 is the ordinary answer, not a failure: most stores have never had a\n * word customised, so their file does not exist. Distinguishing it from a real\n * error matters only for the log — both end in `null` — but a warning on every\n * page load of every uncustomised store is a warning nobody will read.\n */\nasync function readLocaleFile(\n path: string,\n { failLoudly = false }: { failLoudly?: boolean } = {}\n): Promise<Messages | null> {\n /** A 404 always means \"absent\"; everything else is a failure to read. */\n const unreadable = (reason: string, cause?: unknown): null => {\n if (failLoudly) throw new Error(`[translations] ${path}: ${reason}`, { cause });\n console.warn('[translations]', reason, path, cause ?? '');\n return null;\n };\n\n try {\n const response = await filesCdn.get(path, { throwHttpErrors: false, timeout: 5000 });\n if (response.status === 404) return null;\n\n if (!response.ok) {\n return unreadable(`answered ${response.status}`);\n }\n\n const data: unknown = await response.json();\n if (!isPlainObject(data)) {\n return unreadable('is not a JSON object');\n }\n\n return data;\n } catch (error) {\n if (error instanceof Error && error.message.startsWith('[translations]')) throw error;\n return unreadable('could not be read', error);\n }\n}\n\n/**\n * The pre-CDN global file, sliced to one language.\n *\n * Only reached when `translations/common/<locale>.json` is missing, which is\n * the state of the bucket until the sync has run once.\n */\nasync function readLegacyGlobal(locale: string): Promise<Messages | null> {\n try {\n const data = await cdn.get(LEGACY_GLOBAL_FILE, { timeout: 5000 }).json<TranslationMessages>();\n const forLocale = data?.[`${locale}.trans`];\n return isPlainObject(forLocale) ? forLocale : null;\n } catch {\n console.warn('[translations] the legacy global file could not be read either');\n return null;\n }\n}\n\nexport const translations = {\n /**\n * The platform's copy for `locale`.\n *\n * One file, so one request. See the file comment for why the merchant's own\n * wording is not merged in here yet and what it is waiting on.\n */\n get: async (locale: string): Promise<TranslationMessages | null> => {\n const common = await readLocaleFile(commonTranslationsPath(locale));\n const base = common ?? (await readLegacyGlobal(locale));\n if (!base) return null;\n\n // Still wrapped in the `<locale>.trans` shape the rest of the engine reads.\n // `createI18nInstance` slices by that key and so does the SDK bridge in\n // `I18nProvider`; changing the envelope here would be a second change for\n // no gain, since one language is all any of them ever take out of it.\n return { [`${locale}.trans`]: base as Record<string, string> };\n },\n\n /**\n * This merchant's own wording for `locale`, or `null` if they have none.\n *\n * Only worth calling when `settings.languages[<ISO>].has_custom_translations`\n * says there is something to get. Most stores have never customised a word,\n * and a miss here is an uncached round trip — `cf-cache-status: DYNAMIC` on a\n * 404 — on the critical path of an SSR render. The flag is what makes this\n * free for everyone who does not use it.\n *\n * Returned unwrapped, unlike {@link translations.get}: this is merged into\n * that one's messages rather than handed to i18next on its own.\n */\n forStore: async (storeId: string | number, locale: string): Promise<Messages | null> =>\n // `failLoudly`, unlike the platform file: this is only ever called because\n // the settings said overrides exist, so a 500, a timeout or a body that is\n // not JSON is a failure to read them — not a store that has none. Returning\n // `null` there would cache \"no overrides\" as a success, skip the query's\n // retry, and serve Salla's wording in place of the merchant's until the\n // entry expired. A 404 still means absent, and `rootBeforeLoad` catches the\n // throw and keeps the platform copy, so the worst case is unchanged.\n readLocaleFile(storeTranslationsPath(storeId, locale), { failLoudly: true }),\n\n /**\n * The platform's copy for `locale` with this merchant's wording laid over it.\n *\n * Takes the two as values rather than fetching them, so the caller decides\n * whether the second request happens at all and both stay separately cached.\n */\n /**\n * The platform's copy for `locale` with this merchant's wording over it.\n *\n * Delegates to `composeMessages`, which every other reader of these two\n * entries also uses — see `api/messages.ts` for why there is exactly one.\n */\n merge: (\n common: TranslationMessages | null,\n overrides: Messages | null,\n locale: string\n ): TranslationMessages | null => composeMessages(common, overrides, locale) ?? null,\n\n queries: {\n /**\n * @param locale taken as an argument rather than read from the twilight\n * context, and that is load-bearing. This key is built on the server, on\n * hydration, and again lazily from the context accessor; if any of the\n * three read a locale the others had not been given yet, the hydrated page\n * would miss the dehydrated entry and refetch both files it was just\n * handed. Every caller already has the locale in hand.\n *\n * The store is deliberately **not** in the key. One document serves one\n * store — a request that names a different one is redirected with\n * `reloadDocument`, so the client never changes store under a live cache —\n * and adding a value that resolves from the request on the server and from\n * the injected env on the client is how a key stops matching across\n * hydration.\n */\n byLocale: (locale: string) =>\n queryOptions({\n queryKey: translationsQueryKey(locale),\n queryFn: () => translations.get(locale),\n }),\n\n /**\n * This merchant's overrides, cached apart from the platform's copy.\n *\n * Its own entry rather than a wider `byLocale` key, so the common file is\n * fetched and dehydrated once per language whatever the store does, and a\n * store with no overrides never has an entry at all. Both sides compute the\n * key from the settings payload, so the hydrated page finds what the server\n * dehydrated instead of refetching it.\n */\n byStore: (storeId: string | number, locale: string) =>\n queryOptions({\n queryKey: storeTranslationsQueryKey(storeId, locale),\n queryFn: () => translations.forStore(storeId, locale),\n }),\n },\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/api/translations.ts"],"names":[],"mappings":";;;;AAiEA,IAAM,kBAAA,GAAqB,sBAAA;AAGpB,SAAS,uBAAuB,MAAA,EAAwB;AAC7D,EAAA,OAAO,uBAAuB,MAAM,CAAA,KAAA,CAAA;AACtC;AAWO,SAAS,qBAAA,CAAsB,SAA0B,MAAA,EAAwB;AACtF,EAAA,OAAO,CAAA,aAAA,EAAgB,OAAO,CAAA,CAAA,EAAI,MAAM,CAAA,KAAA,CAAA;AAC1C;AAUA,eAAe,eACb,IAAA,EACA,EAAE,aAAa,KAAA,EAAM,GAA8B,EAAC,EAC1B;AAE1B,EAAA,MAAM,UAAA,GAAa,CAAC,MAAA,EAAgB,KAAA,KAA0B;AAC5D,IAAA,IAAI,UAAA,EAAY,MAAM,IAAI,KAAA,CAAM,CAAA,eAAA,EAAkB,IAAI,CAAA,EAAA,EAAK,MAAM,CAAA,CAAA,EAAI,EAAE,KAAA,EAAO,CAAA;AAC9E,IAAA,OAAA,CAAQ,IAAA,CAAK,gBAAA,EAAkB,MAAA,EAAQ,IAAA,EAAM,SAAS,EAAE,CAAA;AACxD,IAAA,OAAO,IAAA;AAAA,EACT,CAAA;AAEA,EAAA,IAAI;AACF,IAAA,MAAM,QAAA,GAAW,MAAM,QAAA,CAAS,GAAA,CAAI,IAAA,EAAM,EAAE,eAAA,EAAiB,KAAA,EAAO,OAAA,EAAS,GAAA,EAAM,CAAA;AACnF,IAAA,IAAI,QAAA,CAAS,MAAA,KAAW,GAAA,EAAK,OAAO,IAAA;AAEpC,IAAA,IAAI,CAAC,SAAS,EAAA,EAAI;AAChB,MAAA,OAAO,UAAA,CAAW,CAAA,SAAA,EAAY,QAAA,CAAS,MAAM,CAAA,CAAE,CAAA;AAAA,IACjD;AAEA,IAAA,MAAM,IAAA,GAA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AA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAcA,QAAA,EAAU,OAAO,OAAA,EAA0B,MAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAQzC,cAAA,CAAe,sBAAsB,OAAA,EAAS,MAAM,GAAG,EAAE,UAAA,EAAY,MAAM;AAAA,GAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAc7E,KAAA,EAAO,CACL,MAAA,EACA,SAAA,EACA,WAC+B,eAAA,CAAgB,MAAA,EAAQ,SAAA,EAAW,MAAM,CAAA,IAAK,IAAA;AAAA,EAE/E,OAAA,EAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAgBP,QAAA,EAAU,CAAC,MAAA,KACT,YAAA,CAAa;AAAA,MACX,QAAA,EAAU,qBAAqB,MAAM,CAAA;AAAA,MACrC,OAAA,EAAS,MAAM,YAAA,CAAa,GAAA,CAAI,MAAM;AAAA,KACvC,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAWH,OAAA,EAAS,CAAC,OAAA,EAA0B,MAAA,KAClC,YAAA,CAAa;AAAA,MACX,QAAA,EAAU,yBAAA,CAA0B,OAAA,EAAS,MAAM,CAAA;AAAA,MACnD,OAAA,EAAS,MAAM,YAAA,CAAa,QAAA,CAAS,SAAS,MAAM;AAAA,KACrD;AAAA;AAEP","file":"chunk-7DRXAR76.js","sourcesContent":["/**\n * @fileoverview Where a storefront's words come from.\n *\n * Two files, merged: the platform's copy for this language, and the merchant's\n * own edits for this language and this store. Both are plain JSON objects on\n * the uploader's CDN, one per language.\n *\n * ```\n * https://cdn.files.salla.network/translations/common/<locale>.json the platform's\n * https://cdn.files.salla.network/translations/<storeId>/<locale>.json the merchant's\n * ```\n *\n * **What this replaces, and why.** Until now the engine read a single global\n * file, `cdn.salla.network/js/translations.json`, holding every language keyed\n * `\"<locale>.trans\"`. Nothing publishes that file: it is an object last written\n * on 2026-03-26, carrying only `ar` and `en` where the platform has 39 locales,\n * 405 keys behind `Languages-Module` and 959 English strings textually\n * different from it. So every React storefront has been serving copy from\n * March, and a key added since has never reached one. It also carried no\n * merchant overrides at all — a merchant editing their theme's wording in the\n * Dashboard changed nothing on a React theme.\n *\n * **Merchant overrides are read, and only when there are any.** Getting here\n * took two corrections worth keeping.\n *\n * The first is the address. A merchant's own wording lives at\n * `translations/<storeId>/<locale>.json`, keyed by `store()->getRouteKey()` —\n * the Optimus-encoded numeric id. An early version addressed it with\n * `resolveStoreIdentifier()`, on the claim that the two are the same string.\n * That is true of the `store-identifier` *header*, which accepts a host, a\n * username or an id, and false of the R2 key: on a custom domain the resolver\n * returns `reefperfumes.com` and on a shared host a username like\n * `mtgr-alaatr-2`. Both 404, both then read as \"this store has no overrides\",\n * and the merchant's wording silently never appears — so the feature would have\n * worked under `?storeId=` alone, which is preview and localhost. It is\n * `settings.store.id` now, which is known only after the settings query.\n *\n * The second is when to ask at all. Most stores have never customised a word,\n * and a miss is an uncached round trip (`cf-cache-status: DYNAMIC` on the 404)\n * on the critical path of every SSR render. So the request is made only when\n * `settings.languages[<ISO>].has_custom_translations` says there is something\n * to get — a flag `Languages-Module` writes when a merchant saves a\n * translation. A store without overrides pays nothing, which is what made this\n * shippable at all.\n *\n * ⚠️ The flag is written on save, so a store whose wording predates it reads as\n * `false` until someone edits a translation or the backfill runs. That is a\n * store keeping today's behaviour, not a regression — React themes have never\n * read merchant overrides — but it does mean the feature is only as complete as\n * the backfill.\n *\n * **Rollout is by fallback, not by flag.** `translations/common/` is written by\n * a sync in the theme build service that may not have run yet, and a hard switch\n * would leave every storefront with no platform strings at all. A missing common\n * file therefore falls back to the old global one, which is exactly today's\n * behaviour — so this is safe to ship before the bucket is populated, and stops\n * using the fallback on its own once it is.\n */\nimport { queryOptions } from '@tanstack/react-query';\nimport { cdn, filesCdn } from './client';\nimport { storeTranslationsQueryKey, translationsQueryKey } from './translations-key';\nimport { composeMessages, isPlainObject, type Messages } from './messages';\nimport type { TranslationMessages } from '../providers/I18nProvider';\n\n/** The global file this used to be the only reader of. See the file comment. */\nconst LEGACY_GLOBAL_FILE = 'js/translations.json';\n\n/** One language of platform copy, shared by every store. */\nexport function commonTranslationsPath(locale: string): string {\n return `translations/common/${locale}.json`;\n}\n\n/**\n * One language of a single merchant's own wording.\n *\n * `storeId` is `settings.store.id`, which is the value `Languages-Module` names\n * the object with (`store()->getRouteKey()`, the Optimus-encoded numeric id).\n * It is **not** `resolveStoreIdentifier()`: that returns a hostname on a custom\n * domain and a username on a shared host, both of which 404 here and would read\n * as \"this merchant has no overrides\" — silently, on every store but a preview.\n */\nexport function storeTranslationsPath(storeId: string | number, locale: string): string {\n return `translations/${storeId}/${locale}.json`;\n}\n\n/**\n * Reads one language file, or `null` when there is nothing to read.\n *\n * A 404 is the ordinary answer, not a failure: most stores have never had a\n * word customised, so their file does not exist. Distinguishing it from a real\n * error matters only for the log — both end in `null` — but a warning on every\n * page load of every uncustomised store is a warning nobody will read.\n */\nasync function readLocaleFile(\n path: string,\n { failLoudly = false }: { failLoudly?: boolean } = {}\n): Promise<Messages | null> {\n /** A 404 always means \"absent\"; everything else is a failure to read. */\n const unreadable = (reason: string, cause?: unknown): null => {\n if (failLoudly) throw new Error(`[translations] ${path}: ${reason}`, { cause });\n console.warn('[translations]', reason, path, cause ?? '');\n return null;\n };\n\n try {\n const response = await filesCdn.get(path, { throwHttpErrors: false, timeout: 5000 });\n if (response.status === 404) return null;\n\n if (!response.ok) {\n return unreadable(`answered ${response.status}`);\n }\n\n const data: unknown = await response.json();\n if (!isPlainObject(data)) {\n return unreadable('is not a JSON object');\n }\n\n return data;\n } catch (error) {\n if (error instanceof Error && error.message.startsWith('[translations]')) throw error;\n return unreadable('could not be read', error);\n }\n}\n\n/**\n * The pre-CDN global file, sliced to one language.\n *\n * Only reached when `translations/common/<locale>.json` is missing, which is\n * the state of the bucket until the sync has run once.\n */\nasync function readLegacyGlobal(locale: string): Promise<Messages | null> {\n try {\n const data = await cdn.get(LEGACY_GLOBAL_FILE, { timeout: 5000 }).json<TranslationMessages>();\n const forLocale = data?.[`${locale}.trans`];\n return isPlainObject(forLocale) ? forLocale : null;\n } catch {\n console.warn('[translations] the legacy global file could not be read either');\n return null;\n }\n}\n\nexport const translations = {\n /**\n * The platform's copy for `locale`.\n *\n * One file, so one request. See the file comment for why the merchant's own\n * wording is not merged in here yet and what it is waiting on.\n */\n get: async (locale: string): Promise<TranslationMessages | null> => {\n const common = await readLocaleFile(commonTranslationsPath(locale));\n const base = common ?? (await readLegacyGlobal(locale));\n if (!base) return null;\n\n // Still wrapped in the `<locale>.trans` shape the rest of the engine reads.\n // `createI18nInstance` slices by that key and so does the SDK bridge in\n // `I18nProvider`; changing the envelope here would be a second change for\n // no gain, since one language is all any of them ever take out of it.\n return { [`${locale}.trans`]: base as Record<string, string> };\n },\n\n /**\n * This merchant's own wording for `locale`, or `null` if they have none.\n *\n * Only worth calling when `settings.languages[<ISO>].has_custom_translations`\n * says there is something to get. Most stores have never customised a word,\n * and a miss here is an uncached round trip — `cf-cache-status: DYNAMIC` on a\n * 404 — on the critical path of an SSR render. The flag is what makes this\n * free for everyone who does not use it.\n *\n * Returned unwrapped, unlike {@link translations.get}: this is merged into\n * that one's messages rather than handed to i18next on its own.\n */\n forStore: async (storeId: string | number, locale: string): Promise<Messages | null> =>\n // `failLoudly`, unlike the platform file: this is only ever called because\n // the settings said overrides exist, so a 500, a timeout or a body that is\n // not JSON is a failure to read them — not a store that has none. Returning\n // `null` there would cache \"no overrides\" as a success, skip the query's\n // retry, and serve Salla's wording in place of the merchant's until the\n // entry expired. A 404 still means absent, and `rootBeforeLoad` catches the\n // throw and keeps the platform copy, so the worst case is unchanged.\n readLocaleFile(storeTranslationsPath(storeId, locale), { failLoudly: true }),\n\n /**\n * The platform's copy for `locale` with this merchant's wording laid over it.\n *\n * Takes the two as values rather than fetching them, so the caller decides\n * whether the second request happens at all and both stay separately cached.\n */\n /**\n * The platform's copy for `locale` with this merchant's wording over it.\n *\n * Delegates to `composeMessages`, which every other reader of these two\n * entries also uses — see `api/messages.ts` for why there is exactly one.\n */\n merge: (\n common: TranslationMessages | null,\n overrides: Messages | null,\n locale: string\n ): TranslationMessages | null => composeMessages(common, overrides, locale) ?? null,\n\n queries: {\n /**\n * @param locale taken as an argument rather than read from the twilight\n * context, and that is load-bearing. This key is built on the server, on\n * hydration, and again lazily from the context accessor; if any of the\n * three read a locale the others had not been given yet, the hydrated page\n * would miss the dehydrated entry and refetch both files it was just\n * handed. Every caller already has the locale in hand.\n *\n * The store is deliberately **not** in the key. One document serves one\n * store — a request that names a different one is redirected with\n * `reloadDocument`, so the client never changes store under a live cache —\n * and adding a value that resolves from the request on the server and from\n * the injected env on the client is how a key stops matching across\n * hydration.\n */\n byLocale: (locale: string) =>\n queryOptions({\n queryKey: translationsQueryKey(locale),\n queryFn: () => translations.get(locale),\n }),\n\n /**\n * This merchant's overrides, cached apart from the platform's copy.\n *\n * Its own entry rather than a wider `byLocale` key, so the common file is\n * fetched and dehydrated once per language whatever the store does, and a\n * store with no overrides never has an entry at all. Both sides compute the\n * key from the settings payload, so the hydrated page finds what the server\n * dehydrated instead of refetching it.\n */\n byStore: (storeId: string | number, locale: string) =>\n queryOptions({\n queryKey: storeTranslationsQueryKey(storeId, locale),\n queryFn: () => translations.forStore(storeId, locale),\n }),\n },\n};\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { orThrow } from './chunk-
|
|
2
|
-
import { getActiveScope, api } from './chunk-
|
|
1
|
+
import { orThrow } from './chunk-SOLUKKTW.js';
|
|
2
|
+
import { getActiveScope, api } from './chunk-UXJAZ5JP.js';
|
|
3
3
|
import { getTwilightContext } from './chunk-6K34BCUP.js';
|
|
4
4
|
import { defaultShouldDehydrateQuery, queryOptions } from '@tanstack/react-query';
|
|
5
5
|
|
|
@@ -215,5 +215,5 @@ var product = {
|
|
|
215
215
|
};
|
|
216
216
|
|
|
217
217
|
export { getProductPreview, isProductPreviewQuery, parseNextPageToken, product, productDetailQueryKey, productPreviewQueryKey, rememberProductPreview, shouldDehydrateQuery };
|
|
218
|
-
//# sourceMappingURL=chunk-
|
|
219
|
-
//# sourceMappingURL=chunk-
|
|
218
|
+
//# sourceMappingURL=chunk-7PFJOTZS.js.map
|
|
219
|
+
//# sourceMappingURL=chunk-7PFJOTZS.js.map
|