@salla.sa/twilight-theme-engine 1.0.119 → 1.0.122
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-2E25Z3JH.js → AddToCartForm-4Z6BBSU4.js} +3 -3
- package/dist/{AddToCartForm-2E25Z3JH.js.map → AddToCartForm-4Z6BBSU4.js.map} +1 -1
- package/dist/{BlogAuthorPage-DIQMXVKT.js → BlogAuthorPage-GIQL4YX6.js} +17 -16
- package/dist/BlogAuthorPage-GIQL4YX6.js.map +1 -0
- package/dist/{BlogCategoryPage-CIEC3I3C.js → BlogCategoryPage-UELJFSB2.js} +17 -16
- package/dist/BlogCategoryPage-UELJFSB2.js.map +1 -0
- package/dist/{BlogPage-SRBQBKLP.js → BlogPage-G6LPLQRM.js} +15 -14
- package/dist/BlogPage-G6LPLQRM.js.map +1 -0
- package/dist/{BlogSinglePage-5BD3OVXK.js → BlogSinglePage-SVTO3C5D.js} +15 -14
- package/dist/BlogSinglePage-SVTO3C5D.js.map +1 -0
- package/dist/{BlogTagPage-ZCDTNTKI.js → BlogTagPage-CFXXPULN.js} +17 -16
- package/dist/BlogTagPage-CFXXPULN.js.map +1 -0
- package/dist/{BrandsPage-XHWYHEQS.js → BrandsPage-IC26RKIG.js} +16 -15
- package/dist/BrandsPage-IC26RKIG.js.map +1 -0
- package/dist/{Breadcrumb-OODSTILO.js → Breadcrumb-OI2H6GVZ.js} +15 -14
- package/dist/Breadcrumb-OI2H6GVZ.js.map +1 -0
- package/dist/{CartItem-N7PX7K6E.js → CartItem-HTEPMUDS.js} +15 -14
- package/dist/CartItem-HTEPMUDS.js.map +1 -0
- package/dist/{CartSummary-FVM26G2M.js → CartSummary-OKLYOGJ3.js} +15 -14
- package/dist/CartSummary-OKLYOGJ3.js.map +1 -0
- package/dist/{Copyright-JCBJN5YN.js → Copyright-EJW3DGP7.js} +3 -3
- package/dist/{Copyright-JCBJN5YN.js.map → Copyright-EJW3DGP7.js.map} +1 -1
- package/dist/{CustomerLayout-B3W377Y4.js → CustomerLayout-YADC5GF7.js} +15 -14
- package/dist/CustomerLayout-YADC5GF7.js.map +1 -0
- package/dist/{Footer-JYJDPUSD.js → Footer-XJJIN5T3.js} +4 -4
- package/dist/{Footer-JYJDPUSD.js.map → Footer-XJJIN5T3.js.map} +1 -1
- package/dist/{Header-DETRFG6N.js → Header-WCRFWQIF.js} +8 -8
- package/dist/{Header-DETRFG6N.js.map → Header-WCRFWQIF.js.map} +1 -1
- package/dist/LiveEditorBar-6SKEWJOX.js +338 -0
- package/dist/LiveEditorBar-6SKEWJOX.js.map +1 -0
- package/dist/{LoyaltyPage-UBYNGW6Z.js → LoyaltyPage-CVNIZVMT.js} +15 -14
- package/dist/LoyaltyPage-CVNIZVMT.js.map +1 -0
- package/dist/{LoyaltyPointsPage-OMCCDBLI.js → LoyaltyPointsPage-UZT7LR5E.js} +6 -6
- package/dist/{LoyaltyPointsPage-OMCCDBLI.js.map → LoyaltyPointsPage-UZT7LR5E.js.map} +1 -1
- package/dist/{MainMenu-BNVH3EVF.js → MainMenu-T2OXHLEM.js} +5 -5
- package/dist/{MainMenu-BNVH3EVF.js.map → MainMenu-T2OXHLEM.js.map} +1 -1
- package/dist/{MasterLayout-OLB2JUUR.js → MasterLayout-MLEDURJK.js} +15 -14
- package/dist/{MasterLayout-OLB2JUUR.js.map → MasterLayout-MLEDURJK.js.map} +1 -1
- package/dist/{MobileMenu-2EAPAHX5.js → MobileMenu-RYICFJPO.js} +16 -15
- package/dist/MobileMenu-RYICFJPO.js.map +1 -0
- package/dist/{NotificationsPage-PIQJTEHJ.js → NotificationsPage-J2YNZPAN.js} +15 -14
- package/dist/NotificationsPage-J2YNZPAN.js.map +1 -0
- package/dist/{OrderSinglePage-YPNO5B3Z.js → OrderSinglePage-IIC6JKFX.js} +16 -15
- package/dist/OrderSinglePage-IIC6JKFX.js.map +1 -0
- package/dist/{OrdersPage-FYL73WZO.js → OrdersPage-FPUE5T6O.js} +15 -14
- package/dist/OrdersPage-FPUE5T6O.js.map +1 -0
- package/dist/{PageSingle-3VAW7S6B.js → PageSingle-BOZFETZ5.js} +3 -3
- package/dist/{PageSingle-3VAW7S6B.js.map → PageSingle-BOZFETZ5.js.map} +1 -1
- package/dist/{ProductDetails-UJ4MKTFM.js → ProductDetails-ERSDEM5Z.js} +4 -4
- package/dist/{ProductDetails-UJ4MKTFM.js.map → ProductDetails-ERSDEM5Z.js.map} +1 -1
- package/dist/{ProfilePage-5NZVZU2S.js → ProfilePage-MP4PE2LF.js} +15 -14
- package/dist/ProfilePage-MP4PE2LF.js.map +1 -0
- package/dist/{RenderWhenVisible-KWAXEJOJ.js → RenderWhenVisible-BQ7KVPHK.js} +5 -3
- package/dist/RenderWhenVisible-BQ7KVPHK.js.map +1 -0
- package/dist/{ReviewsPage-SYD5UUVN.js → ReviewsPage-5L6DLPN2.js} +3 -3
- package/dist/{ReviewsPage-SYD5UUVN.js.map → ReviewsPage-5L6DLPN2.js.map} +1 -1
- package/dist/{SeoCartWidget-R45K7M4U.js → SeoCartWidget-XU5LKBMF.js} +15 -14
- package/dist/SeoCartWidget-XU5LKBMF.js.map +1 -0
- package/dist/{SettingsPage-DWTUF5TO.js → SettingsPage-A2AI5CWI.js} +15 -14
- package/dist/SettingsPage-A2AI5CWI.js.map +1 -0
- package/dist/{StoreClosedNotification-2NARK6HJ.js → StoreClosedNotification-C6EZSOQF.js} +16 -15
- package/dist/{StoreClosedNotification-2NARK6HJ.js.map → StoreClosedNotification-C6EZSOQF.js.map} +1 -1
- package/dist/{TestimonialsPage-QAOBCMAV.js → TestimonialsPage-ZO6OIZMX.js} +3 -3
- package/dist/{TestimonialsPage-QAOBCMAV.js.map → TestimonialsPage-ZO6OIZMX.js.map} +1 -1
- package/dist/{ThankYouPage-GBAAHFWB.js → ThankYouPage-RZFWZZXI.js} +15 -14
- package/dist/ThankYouPage-RZFWZZXI.js.map +1 -0
- package/dist/{WalletPage-QWJM6DTB.js → WalletPage-BDMVFQ4G.js} +16 -15
- package/dist/WalletPage-BDMVFQ4G.js.map +1 -0
- package/dist/{WishlistPage-PCQR3DEF.js → WishlistPage-3OFBHANB.js} +17 -16
- package/dist/WishlistPage-3OFBHANB.js.map +1 -0
- 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.d.ts.map +1 -1
- 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-3IBJ5QUW.js +14 -0
- package/dist/{chunk-UI625G7U.js.map → chunk-3IBJ5QUW.js.map} +1 -1
- package/dist/{chunk-B6JTC5R6.js → chunk-3PS2WFNQ.js} +4 -4
- package/dist/{chunk-B6JTC5R6.js.map → chunk-3PS2WFNQ.js.map} +1 -1
- package/dist/{chunk-I46KQSZH.js → chunk-3VOJOKQI.js} +6 -6
- package/dist/{chunk-I46KQSZH.js.map → chunk-3VOJOKQI.js.map} +1 -1
- package/dist/{chunk-JHTTTXTI.js → chunk-4IBG3GR6.js} +4 -4
- package/dist/{chunk-JHTTTXTI.js.map → chunk-4IBG3GR6.js.map} +1 -1
- package/dist/{chunk-3WGZZD2Y.js → chunk-5K53BZIN.js} +4 -4
- package/dist/{chunk-3WGZZD2Y.js.map → chunk-5K53BZIN.js.map} +1 -1
- package/dist/{chunk-PFAPRJVF.js → chunk-6BQN4JKH.js} +13 -4
- package/dist/chunk-6BQN4JKH.js.map +1 -0
- package/dist/{chunk-PRA6E6SQ.js → chunk-6F6VACX5.js} +4 -4
- package/dist/{chunk-PRA6E6SQ.js.map → chunk-6F6VACX5.js.map} +1 -1
- package/dist/{chunk-VI2WHQDR.js → chunk-6JS7UZ3S.js} +3 -3
- package/dist/{chunk-VI2WHQDR.js.map → chunk-6JS7UZ3S.js.map} +1 -1
- package/dist/{chunk-QWGSGNM7.js → chunk-7IQCF6GU.js} +7 -7
- package/dist/{chunk-QWGSGNM7.js.map → chunk-7IQCF6GU.js.map} +1 -1
- package/dist/{chunk-VSK2WS4G.js → chunk-ABDYSBBY.js} +3 -3
- package/dist/{chunk-VSK2WS4G.js.map → chunk-ABDYSBBY.js.map} +1 -1
- package/dist/{chunk-EFT442TN.js → chunk-ALHMPT6S.js} +3 -3
- package/dist/{chunk-EFT442TN.js.map → chunk-ALHMPT6S.js.map} +1 -1
- package/dist/{chunk-7K3AK6IC.js → chunk-BHCKUER2.js} +4 -4
- package/dist/{chunk-7K3AK6IC.js.map → chunk-BHCKUER2.js.map} +1 -1
- package/dist/{chunk-4EATTQQA.js → chunk-DEIABJV4.js} +3 -3
- package/dist/{chunk-4EATTQQA.js.map → chunk-DEIABJV4.js.map} +1 -1
- package/dist/{chunk-AVW4CLTB.js → chunk-E5OVMQIA.js} +4 -4
- package/dist/{chunk-AVW4CLTB.js.map → chunk-E5OVMQIA.js.map} +1 -1
- package/dist/{chunk-EFCIK5NI.js → chunk-EA334DDV.js} +3 -3
- package/dist/{chunk-EFCIK5NI.js.map → chunk-EA334DDV.js.map} +1 -1
- package/dist/{chunk-XMFVSBEO.js → chunk-EL6IDB5U.js} +3 -3
- package/dist/{chunk-XMFVSBEO.js.map → chunk-EL6IDB5U.js.map} +1 -1
- package/dist/{chunk-MQALPNFL.js → chunk-ESYRKX7T.js} +4 -4
- package/dist/{chunk-MQALPNFL.js.map → chunk-ESYRKX7T.js.map} +1 -1
- package/dist/{chunk-VT6FE3CB.js → chunk-F2MDQCTH.js} +3 -3
- package/dist/{chunk-VT6FE3CB.js.map → chunk-F2MDQCTH.js.map} +1 -1
- package/dist/{chunk-S4VVTUCI.js → chunk-HAH22L6T.js} +7 -7
- package/dist/{chunk-S4VVTUCI.js.map → chunk-HAH22L6T.js.map} +1 -1
- package/dist/{chunk-IRQJBRKV.js → chunk-JOY7HCIH.js} +3 -3
- package/dist/{chunk-IRQJBRKV.js.map → chunk-JOY7HCIH.js.map} +1 -1
- package/dist/{chunk-CKMLOJGM.js → chunk-KNUANWCR.js} +9 -6
- package/dist/chunk-KNUANWCR.js.map +1 -0
- package/dist/{chunk-RVPC4AYT.js → chunk-LCBETTJI.js} +3 -3
- package/dist/{chunk-RVPC4AYT.js.map → chunk-LCBETTJI.js.map} +1 -1
- package/dist/{chunk-VXSBJZ3E.js → chunk-LG5355UU.js} +4 -4
- package/dist/{chunk-VXSBJZ3E.js.map → chunk-LG5355UU.js.map} +1 -1
- package/dist/{chunk-3LJF7ECP.js → chunk-LNSMPXGR.js} +4 -4
- package/dist/{chunk-3LJF7ECP.js.map → chunk-LNSMPXGR.js.map} +1 -1
- package/dist/{chunk-UMTMIMH7.js → chunk-MWOP57ZR.js} +3 -3
- package/dist/{chunk-UMTMIMH7.js.map → chunk-MWOP57ZR.js.map} +1 -1
- package/dist/{chunk-CTNSIK3V.js → chunk-N6EWTAE4.js} +7 -7
- package/dist/{chunk-CTNSIK3V.js.map → chunk-N6EWTAE4.js.map} +1 -1
- package/dist/{chunk-EQ7I4AFL.js → chunk-NEPBUZ5S.js} +5 -5
- package/dist/{chunk-EQ7I4AFL.js.map → chunk-NEPBUZ5S.js.map} +1 -1
- package/dist/{chunk-D2RUSG36.js → chunk-P6X2QUYL.js} +4 -4
- package/dist/{chunk-D2RUSG36.js.map → chunk-P6X2QUYL.js.map} +1 -1
- package/dist/chunk-PDIFXQDX.js +63 -0
- package/dist/chunk-PDIFXQDX.js.map +1 -0
- package/dist/{chunk-NEHOBD4K.js → chunk-PO6PTKMN.js} +3 -3
- package/dist/{chunk-NEHOBD4K.js.map → chunk-PO6PTKMN.js.map} +1 -1
- package/dist/{chunk-ME4UKH7Y.js → chunk-PQNLRRWJ.js} +4 -4
- package/dist/{chunk-ME4UKH7Y.js.map → chunk-PQNLRRWJ.js.map} +1 -1
- package/dist/{chunk-E552K72T.js → chunk-QMKC7PA2.js} +3 -3
- package/dist/{chunk-E552K72T.js.map → chunk-QMKC7PA2.js.map} +1 -1
- package/dist/{chunk-R5TTR2G7.js → chunk-QTRV6N64.js} +38 -21
- package/dist/chunk-QTRV6N64.js.map +1 -0
- package/dist/{chunk-Y36VLQGV.js → chunk-UNDCL5EE.js} +10 -10
- package/dist/{chunk-Y36VLQGV.js.map → chunk-UNDCL5EE.js.map} +1 -1
- package/dist/{chunk-W6NQM4FQ.js → chunk-UQ7NS6BZ.js} +3 -3
- package/dist/{chunk-W6NQM4FQ.js.map → chunk-UQ7NS6BZ.js.map} +1 -1
- package/dist/{chunk-5CKTQAFX.js → chunk-V23ILNAK.js} +3 -3
- package/dist/{chunk-5CKTQAFX.js.map → chunk-V23ILNAK.js.map} +1 -1
- package/dist/{chunk-XM22O2B2.js → chunk-WZOWGICV.js} +3 -3
- package/dist/{chunk-XM22O2B2.js.map → chunk-WZOWGICV.js.map} +1 -1
- package/dist/{chunk-NU2LPGNB.js → chunk-XK6TXHVO.js} +3 -3
- package/dist/{chunk-NU2LPGNB.js.map → chunk-XK6TXHVO.js.map} +1 -1
- package/dist/{chunk-T23HXVW5.js → chunk-Y57KRLGY.js} +3 -3
- package/dist/{chunk-T23HXVW5.js.map → chunk-Y57KRLGY.js.map} +1 -1
- package/dist/{chunk-GEGB34LB.js → chunk-YC4CEVQO.js} +4 -4
- package/dist/{chunk-GEGB34LB.js.map → chunk-YC4CEVQO.js.map} +1 -1
- package/dist/components/cart/index.js +1 -1
- package/dist/components/common/RenderWhenVisible.d.ts +3 -1
- package/dist/components/common/RenderWhenVisible.d.ts.map +1 -1
- package/dist/components/common/index.js +1 -1
- package/dist/components/common/lazy.d.ts +1 -1
- package/dist/components/common/lazy.d.ts.map +1 -1
- package/dist/components/drawer/index.js +13 -12
- package/dist/components/home/HomePageRenderer.d.ts.map +1 -1
- package/dist/components/home/index.js +17 -16
- package/dist/components/layout/index.js +4 -4
- package/dist/components/live-editor/LiveEditorBar.d.ts +11 -0
- package/dist/components/live-editor/LiveEditorBar.d.ts.map +1 -0
- package/dist/components/live-editor/frame.d.ts +34 -0
- package/dist/components/live-editor/frame.d.ts.map +1 -0
- package/dist/components/live-editor/index.d.ts +9 -0
- package/dist/components/live-editor/index.d.ts.map +1 -0
- package/dist/components/product/index.js +14 -13
- package/dist/components/store/index.js +14 -13
- package/dist/dev/editor/index.js +1 -1
- package/dist/dev/index.js +1 -1
- package/dist/{document-class-TSDZIVXW.js → document-class-WRE36CKT.js} +11 -11
- package/dist/{document-class-TSDZIVXW.js.map → document-class-WRE36CKT.js.map} +1 -1
- package/dist/hooks/index.js +13 -12
- package/dist/hooks/useGtm.js +13 -12
- package/dist/hooks/useMoney.js +13 -12
- package/dist/hooks/useStore.js +13 -12
- package/dist/hooks/useUser.js +3 -3
- package/dist/index.js +13 -12
- package/dist/index.js.map +1 -1
- package/dist/{navigation-2V7R2ANX.js → navigation-F5YC4AN5.js} +5 -5
- package/dist/{navigation-2V7R2ANX.js.map → navigation-F5YC4AN5.js.map} +1 -1
- package/dist/{navigation-LRBZCNKS.js → navigation-KPN6OPJN.js} +4 -4
- package/dist/{navigation-LRBZCNKS.js.map → navigation-KPN6OPJN.js.map} +1 -1
- package/dist/{not-found-5DFPFQ4B.js → not-found-YZOISV3W.js} +16 -15
- package/dist/not-found-YZOISV3W.js.map +1 -0
- package/dist/providers/TwilightProvider.d.ts.map +1 -1
- package/dist/providers/index.js +13 -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 -20
- package/dist/routes/cart.js.map +1 -1
- package/dist/routes/home.js +18 -17
- 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 -18
- package/dist/routes/product-listing.js.map +1 -1
- package/dist/routes/product.js +17 -16
- package/dist/routes/product.js.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 -17
- package/dist/{store-lookup-YUA66JS6.js → store-lookup-GXBNYGCM.js} +8 -8
- package/dist/{store-lookup-YUA66JS6.js.map → store-lookup-GXBNYGCM.js.map} +1 -1
- package/dist/tanstack.js +11 -11
- package/dist/utils/fast-checkout.d.ts +1 -1
- package/dist/utils/fast-checkout.d.ts.map +1 -1
- package/dist/utils/index.js +2 -2
- package/package.json +1 -1
- package/tailwind/components/common/RenderWhenVisible.tsx.txt +4 -0
- package/tailwind/components/home/HomePageRenderer.tsx.txt +7 -0
- package/tailwind/components/live-editor/LiveEditorBar.tsx.txt +417 -0
- package/tailwind/components/live-editor/frame.ts.txt +97 -0
- package/tailwind/components/live-editor/index.tsx.txt +37 -0
- package/dist/BlogAuthorPage-DIQMXVKT.js.map +0 -1
- package/dist/BlogCategoryPage-CIEC3I3C.js.map +0 -1
- package/dist/BlogPage-SRBQBKLP.js.map +0 -1
- package/dist/BlogSinglePage-5BD3OVXK.js.map +0 -1
- package/dist/BlogTagPage-ZCDTNTKI.js.map +0 -1
- package/dist/BrandsPage-XHWYHEQS.js.map +0 -1
- package/dist/Breadcrumb-OODSTILO.js.map +0 -1
- package/dist/CartItem-N7PX7K6E.js.map +0 -1
- package/dist/CartSummary-FVM26G2M.js.map +0 -1
- package/dist/CustomerLayout-B3W377Y4.js.map +0 -1
- package/dist/LoyaltyPage-UBYNGW6Z.js.map +0 -1
- package/dist/MobileMenu-2EAPAHX5.js.map +0 -1
- package/dist/NotificationsPage-PIQJTEHJ.js.map +0 -1
- package/dist/OrderSinglePage-YPNO5B3Z.js.map +0 -1
- package/dist/OrdersPage-FYL73WZO.js.map +0 -1
- package/dist/ProfilePage-5NZVZU2S.js.map +0 -1
- package/dist/RenderWhenVisible-KWAXEJOJ.js.map +0 -1
- package/dist/SeoCartWidget-R45K7M4U.js.map +0 -1
- package/dist/SettingsPage-DWTUF5TO.js.map +0 -1
- package/dist/ThankYouPage-GBAAHFWB.js.map +0 -1
- package/dist/WalletPage-QWJM6DTB.js.map +0 -1
- package/dist/WishlistPage-PCQR3DEF.js.map +0 -1
- package/dist/chunk-CKMLOJGM.js.map +0 -1
- package/dist/chunk-PFAPRJVF.js.map +0 -1
- package/dist/chunk-R5TTR2G7.js.map +0 -1
- package/dist/chunk-UI625G7U.js +0 -14
- package/dist/not-found-5DFPFQ4B.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/hooks/useUser.ts"],"names":[],"mappings":";;;;AAUO,SAAS,OAAA,GAAyB;AACvC,EAAA,MAAM,KAAA,GAAQ,oBAAmB,CAAE,SAAA;AAEnC,EAAA,MAAM,QAAQ,QAAA,CAAS;AAAA,IACrB,GAAG,IAAA,CAAK,OAAA,CAAQ,OAAA,EAAQ;AAAA,IACxB,OAAA,EAAS,CAAC,CAAC,KAAA;AAAA,IACX,eAAA,EAAiB;AAAA,GAClB,CAAA;AAED,EAAA,OAAO,EAAE,GAAG,KAAA,EAAO,UAAA,EAAY,CAAC,CAAC,KAAA,EAAM;AACzC","file":"chunk-
|
|
1
|
+
{"version":3,"sources":["../src/hooks/useUser.ts"],"names":[],"mappings":";;;;AAUO,SAAS,OAAA,GAAyB;AACvC,EAAA,MAAM,KAAA,GAAQ,oBAAmB,CAAE,SAAA;AAEnC,EAAA,MAAM,QAAQ,QAAA,CAAS;AAAA,IACrB,GAAG,IAAA,CAAK,OAAA,CAAQ,OAAA,EAAQ;AAAA,IACxB,OAAA,EAAS,CAAC,CAAC,KAAA;AAAA,IACX,eAAA,EAAiB;AAAA,GAClB,CAAA;AAED,EAAA,OAAO,EAAE,GAAG,KAAA,EAAO,UAAA,EAAY,CAAC,CAAC,KAAA,EAAM;AACzC","file":"chunk-F2MDQCTH.js","sourcesContent":["import { useQuery, type UseQueryResult } from '@tanstack/react-query';\nimport { getTwilightContext } from '../twilight/context';\nimport { user } from '../api/user';\nimport type { User } from '../types';\n\nexport type UseUserReturn = UseQueryResult<User | null> & {\n /** True when an auth token exists (regardless of query state). */\n isLoggedIn: boolean;\n};\n\nexport function useUser(): UseUserReturn {\n const token = getTwilightContext().authToken;\n\n const query = useQuery({\n ...user.queries.current(),\n enabled: !!token,\n placeholderData: null,\n });\n\n return { ...query, isLoggedIn: !!token };\n}\n"]}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { lazy } from 'react';
|
|
2
2
|
|
|
3
3
|
// src/components/layout/lazy.ts
|
|
4
|
-
var LazyHeader = lazy(() => import('./Header-
|
|
5
|
-
var LazyFooter = lazy(() => import('./Footer-
|
|
4
|
+
var LazyHeader = lazy(() => import('./Header-WCRFWQIF.js').then((m) => ({ default: m.Header })));
|
|
5
|
+
var LazyFooter = lazy(() => import('./Footer-XJJIN5T3.js').then((m) => ({ default: m.Footer })));
|
|
6
6
|
var LazyCopyright = lazy(
|
|
7
|
-
() => import('./Copyright-
|
|
7
|
+
() => import('./Copyright-EJW3DGP7.js').then((m) => ({ default: m.Copyright }))
|
|
8
8
|
);
|
|
9
9
|
var LazyMasterLayout = lazy(
|
|
10
|
-
() => import('./MasterLayout-
|
|
10
|
+
() => import('./MasterLayout-MLEDURJK.js').then((m) => ({ default: m.MasterLayout }))
|
|
11
11
|
);
|
|
12
12
|
var LazyWidgetHead = lazy(
|
|
13
13
|
() => import('./WidgetHead-BCRIXIJQ.js').then((m) => ({ default: m.WidgetHead }))
|
|
14
14
|
);
|
|
15
15
|
var LazyCustomerLayout = lazy(
|
|
16
|
-
() => import('./CustomerLayout-
|
|
16
|
+
() => import('./CustomerLayout-YADC5GF7.js').then((m) => ({ default: m.CustomerLayout }))
|
|
17
17
|
);
|
|
18
18
|
|
|
19
19
|
export { LazyCopyright, LazyCustomerLayout, LazyFooter, LazyHeader, LazyMasterLayout, LazyWidgetHead };
|
|
20
|
-
//# sourceMappingURL=chunk-
|
|
21
|
-
//# sourceMappingURL=chunk-
|
|
20
|
+
//# sourceMappingURL=chunk-HAH22L6T.js.map
|
|
21
|
+
//# sourceMappingURL=chunk-HAH22L6T.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/layout/lazy.ts"],"names":[],"mappings":";;;AAMO,IAAM,UAAA,GAAa,IAAA,CAAK,MAAM,OAAO,sBAAU,CAAA,CAAE,IAAA,CAAK,CAAC,CAAA,MAAO,EAAE,OAAA,EAAS,CAAA,CAAE,MAAA,GAAS,CAAC;AAErF,IAAM,UAAA,GAAa,IAAA,CAAK,MAAM,OAAO,sBAAU,CAAA,CAAE,IAAA,CAAK,CAAC,CAAA,MAAO,EAAE,OAAA,EAAS,CAAA,CAAE,MAAA,GAAS,CAAC;AAErF,IAAM,aAAA,GAAgB,IAAA;AAAA,EAAK,MAChC,OAAO,yBAAa,CAAA,CAAE,IAAA,CAAK,CAAC,CAAA,MAAO,EAAE,OAAA,EAAS,CAAA,CAAE,SAAA,EAAU,CAAE;AAC9D;AAEO,IAAM,gBAAA,GAAmB,IAAA;AAAA,EAAK,MACnC,OAAO,4BAAgB,CAAA,CAAE,IAAA,CAAK,CAAC,CAAA,MAAO,EAAE,OAAA,EAAS,CAAA,CAAE,YAAA,EAAa,CAAE;AACpE;AAEO,IAAM,cAAA,GAAiB,IAAA;AAAA,EAAK,MACjC,OAAO,0BAAc,CAAA,CAAE,IAAA,CAAK,CAAC,CAAA,MAAO,EAAE,OAAA,EAAS,CAAA,CAAE,UAAA,EAAW,CAAE;AAChE;AAEO,IAAM,kBAAA,GAAqB,IAAA;AAAA,EAAK,MACrC,OAAO,8BAAkB,CAAA,CAAE,IAAA,CAAK,CAAC,CAAA,MAAO,EAAE,OAAA,EAAS,CAAA,CAAE,cAAA,EAAe,CAAE;AACxE","file":"chunk-
|
|
1
|
+
{"version":3,"sources":["../src/components/layout/lazy.ts"],"names":[],"mappings":";;;AAMO,IAAM,UAAA,GAAa,IAAA,CAAK,MAAM,OAAO,sBAAU,CAAA,CAAE,IAAA,CAAK,CAAC,CAAA,MAAO,EAAE,OAAA,EAAS,CAAA,CAAE,MAAA,GAAS,CAAC;AAErF,IAAM,UAAA,GAAa,IAAA,CAAK,MAAM,OAAO,sBAAU,CAAA,CAAE,IAAA,CAAK,CAAC,CAAA,MAAO,EAAE,OAAA,EAAS,CAAA,CAAE,MAAA,GAAS,CAAC;AAErF,IAAM,aAAA,GAAgB,IAAA;AAAA,EAAK,MAChC,OAAO,yBAAa,CAAA,CAAE,IAAA,CAAK,CAAC,CAAA,MAAO,EAAE,OAAA,EAAS,CAAA,CAAE,SAAA,EAAU,CAAE;AAC9D;AAEO,IAAM,gBAAA,GAAmB,IAAA;AAAA,EAAK,MACnC,OAAO,4BAAgB,CAAA,CAAE,IAAA,CAAK,CAAC,CAAA,MAAO,EAAE,OAAA,EAAS,CAAA,CAAE,YAAA,EAAa,CAAE;AACpE;AAEO,IAAM,cAAA,GAAiB,IAAA;AAAA,EAAK,MACjC,OAAO,0BAAc,CAAA,CAAE,IAAA,CAAK,CAAC,CAAA,MAAO,EAAE,OAAA,EAAS,CAAA,CAAE,UAAA,EAAW,CAAE;AAChE;AAEO,IAAM,kBAAA,GAAqB,IAAA;AAAA,EAAK,MACrC,OAAO,8BAAkB,CAAA,CAAE,IAAA,CAAK,CAAC,CAAA,MAAO,EAAE,OAAA,EAAS,CAAA,CAAE,cAAA,EAAe,CAAE;AACxE","file":"chunk-HAH22L6T.js","sourcesContent":["import { lazy } from 'react';\n\n/**\n * Lazy-loaded layout components\n * Use these for code-splitting layout sections\n */\nexport const LazyHeader = lazy(() => import('./Header').then((m) => ({ default: m.Header })));\n\nexport const LazyFooter = lazy(() => import('./Footer').then((m) => ({ default: m.Footer })));\n\nexport const LazyCopyright = lazy(() =>\n import('./Copyright').then((m) => ({ default: m.Copyright }))\n);\n\nexport const LazyMasterLayout = lazy(() =>\n import('./MasterLayout').then((m) => ({ default: m.MasterLayout }))\n);\n\nexport const LazyWidgetHead = lazy(() =>\n import('./WidgetHead').then((m) => ({ default: m.WidgetHead }))\n);\n\nexport const LazyCustomerLayout = lazy(() =>\n import('./CustomerLayout').then((m) => ({ default: m.CustomerLayout }))\n);\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getActiveScope, api, STORE_IDENTIFIER_HEADER } from './chunk-
|
|
1
|
+
import { getActiveScope, api, STORE_IDENTIFIER_HEADER } from './chunk-6BQN4JKH.js';
|
|
2
2
|
import { requestedThemeVersionId } from './chunk-GYXUYHKO.js';
|
|
3
3
|
import { resolveStoreIdentifier, parseStoreId } from './chunk-FHU2MXZA.js';
|
|
4
4
|
import { getTwilightContext, SettingsError } from './chunk-7VNVCHID.js';
|
|
@@ -202,5 +202,5 @@ var store = {
|
|
|
202
202
|
};
|
|
203
203
|
|
|
204
204
|
export { readNativeAppHeaders, store };
|
|
205
|
-
//# sourceMappingURL=chunk-
|
|
206
|
-
//# sourceMappingURL=chunk-
|
|
205
|
+
//# sourceMappingURL=chunk-JOY7HCIH.js.map
|
|
206
|
+
//# sourceMappingURL=chunk-JOY7HCIH.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/utils/native-app-headers.ts","../src/api/store.ts"],"names":[],"mappings":";;;;;;;;AACO,IAAM,kBAAA,GAAqB;AAAA,EAChC,UAAA;AAAA,EACA,eAAA;AAAA,EACA,oBAAA;AAAA,EACA;AACF,CAAA;AAUO,SAAS,qBAAqB,OAAA,EAAiD;AACpF,EAAA,MAAM,EAAA,GAAK,OAAA,CAAQ,GAAA,CAAI,UAAU,GAAG,WAAA,EAAY;AAChD,EAAA,IAAI,EAAA,KAAO,KAAA,IAAS,EAAA,KAAO,SAAA,EAAW,OAAO,IAAA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M,KAAA,GAAQ;AAAA,EACnB,QAAA,EAAU,OAAO,eAAA,KAA2D;AAC1E,IAAA,IAAI;AACF,MAAA,OAAO,MAAM,cAAc,eAAe,CAAA;AAAA,IAC5C,CAAA,CAAA,MAAQ;AAEN,MAAA,OAAO,IAAA;AAAA,IACT;AAAA,EACF,CAAA;AAAA,EAEA,OAAA,EAAS;AAAA,IACP,QAAA,EAAU,CAAC,eAAA,KACT,YAAA,CAAkC;AAAA,MAChC,QAAA,EAAU;AAAA,QACR,OAAA;AAAA,QACA,UAAA;AAAA,QACA,eAAA;AAAA,QACA,oBAAmB,CAAE,MAAA;AAAA,QACrB,cAAA,EAAe;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAQf,uBAAA;AAAwB,OAC1B;AAAA;AAAA,MAEA,OAAA,EAAS,MAAM,aAAA,CAAc,eAAe,CAAA;AAAA;AAAA;AAAA,MAG5C,KAAA,EAAO;AAAA,KACR;AAAA;AAEP","file":"chunk-IRQJBRKV.js","sourcesContent":["/** The headers the Salla native app sends with every page it loads in its webview. */\nexport const NATIVE_APP_HEADERS = [\n 's-app-os',\n 's-app-version',\n 's-app-full-version',\n 's-app-os-version',\n];\n\n/**\n * The native app's own headers on this request, or null when it is not the app.\n *\n * On a Twig theme Laravel copies them into the settings' `jitsu.context.extra.headers`,\n * where the SDK reads the app's platform and version from (`salla.config.isMobileApp()`).\n * A React theme asks for its settings from the server, through the API, so the app's\n * headers never reach that call: the request is the only place they are.\n */\nexport function readNativeAppHeaders(headers: Headers): Record<string, string> | null {\n const os = headers.get('s-app-os')?.toLowerCase();\n if (os !== 'ios' && os !== 'android') return null;\n const found: Record<string, string> = {};\n for (const name of NATIVE_APP_HEADERS) {\n const value = headers.get(name);\n if (value) found[name] = value;\n }\n return found;\n}\n","import { queryOptions } from '@tanstack/react-query';\nimport { isHTTPError, isNetworkError, isTimeoutError } from 'ky';\nimport { api, getActiveScope, STORE_IDENTIFIER_HEADER } from './client';\nimport { SettingsError } from '../utils/errors';\nimport type { Store, Theme, Language, JitsuConfig, MaintenanceDetails } from '../types';\nimport { getTwilightContext } from '../twilight/context';\nimport { resolveStoreIdentifier } from '../utils/store-identity';\nimport { parseStoreId } from '../utils/cookies';\nimport { requestedThemeVersionId } from '../utils/theme-version';\nimport { NATIVE_APP_HEADERS } from '../utils/native-app-headers';\n\nexport { resolveStoreIdentifier };\n\nconst DEFAULT_INCLUDE_ITEMS = [\n 'store',\n 'settings',\n 'theme',\n 'theme_settings',\n 'external_services',\n 'currencies',\n 'languages',\n 'payments',\n 'product_widgets',\n 'rating',\n 'ratings',\n 'user',\n];\n\n/** Twig's `salla.init({ user })` object; the endpoint ignores the token, so always the guest. */\nexport interface SettingsUser {\n type: 'guest' | 'user';\n id?: number | string | null;\n language_code?: string;\n currency_code?: string;\n country_code?: string;\n [key: string]: unknown;\n}\n\n/**\n * Raw API response for settings endpoint.\n * Languages come as object: { \"AR\": { code, name, ... }, \"EN\": {...} }\n */\ninterface SettingsApiResponse {\n store?: Store;\n theme?: Theme;\n languages?: Record<string, Language>;\n currencies?: Record<\n string,\n { code: string; name: string; symbol: string; amount: number; country_code: string }\n >;\n external_services?: Record<string, unknown>;\n headers?: Record<string, unknown>;\n login?: { url: string; turnstile_site_key: string };\n affiliate?: { utm_url: string; cta_enabled: boolean };\n debug?: boolean;\n trace_console?: boolean;\n policy_url?: string;\n user?: SettingsUser;\n swoole?: string[];\n jitsu?: JitsuConfig;\n maintenance?: boolean;\n maintenance_details?: MaintenanceDetails;\n}\n\n/**\n * Central settings context - single source of truth for all API data.\n * Contains everything from the settings endpoint response after processing.\n */\nexport interface StoreContext {\n store?: Store;\n theme?: Theme;\n /** Languages as array after conversion from API object format */\n languages?: Language[];\n currencies?: Record<\n string,\n { code: string; name: string; symbol: string; amount: number; country_code: string }\n >;\n external_services?: Record<string, unknown>;\n headers?: Record<string, unknown>;\n login?: { url: string; turnstile_site_key: string };\n affiliate?: { utm_url: string; cta_enabled: boolean };\n debug?: boolean;\n trace_console?: boolean; // todo:: remove it\n policy_url?: string;\n user?: SettingsUser;\n /** API paths the SDK sends with `s-store-api-version: swoole` */\n swoole?: string[];\n /** Where the SDK's analytics send events, and which ones; without it the SDK tracks nothing. */\n jitsu?: JitsuConfig;\n /**\n * The store is closed: by the merchant from the dashboard, by the platform, or\n * for the selected market only. The engine then renders the maintenance page\n * to everyone but the merchant; see `rootBeforeLoad`.\n */\n maintenance?: boolean;\n /** What the maintenance page says; sent beside `maintenance`. */\n maintenance_details?: MaintenanceDetails;\n /**\n * The scope these settings were requested with; absent when none was. Not from\n * the API: stamped by `store.settings`, so `resolveThemeVersionId` can tell\n * whether the version they name still answers the scope that is active now.\n */\n requestedScopeId?: string;\n /** Which answer of the API these settings are; see {@link SettingsAnswer}. */\n answer?: SettingsAnswer;\n}\n\n/**\n * Which answer of the settings API a set of settings came from, read off the\n * response rather than the body: the API's request id, the Store's trace, and\n * whether Cloudflare served it from its cache and how old it was. A decision the\n * settings drive for every visitor alike (the maintenance page) can then be\n * traced to the exact request the backend logged, or to a cached copy of it.\n */\nexport interface SettingsAnswer {\n requestId?: string;\n traceId?: string;\n cacheStatus?: string;\n age?: string;\n}\n\nconst ANSWER_HEADERS: Record<keyof SettingsAnswer, string> = {\n requestId: 's-request-id',\n traceId: 'x-trace-id',\n cacheStatus: 'cf-cache-status',\n age: 'age',\n};\n\nfunction settingsAnswerOf(headers: Headers | undefined): SettingsAnswer | undefined {\n if (!headers) return undefined;\n const answer: SettingsAnswer = {};\n for (const [field, name] of Object.entries(ANSWER_HEADERS) as [keyof SettingsAnswer, string][]) {\n const value = headers.get(name);\n if (value) answer[field] = value;\n }\n return Object.keys(answer).length ? answer : undefined;\n}\n\n/**\n * Converts languages object from API to array format.\n * API returns: { \"AR\": { code, name, ... }, \"EN\": { ... } }\n * We need: [{ code, name, ... }, { code, name, ... }]\n * todo:: return the languages as object from the APIs to avoid this\n */\nfunction languagesToArray(languages?: Record<string, Language>): Language[] | undefined {\n if (!languages) return undefined;\n // The SDK's localization modal reads `lang.iso_code` (not `code`) when a language is\n // selected — without it the switch navigates to `/undefined/...`.\n return Object.values(languages).map((lang) => ({ iso_code: lang.code, ...lang }));\n}\n\n/**\n * The settings' analytics context with the native app's headers in it, as Laravel\n * writes it for a Twig theme: the SDK reads the app's platform and version from there.\n * The API answers a server-side call with the engine's own headers, never the app's.\n */\nfunction withNativeAppHeaders(jitsu?: JitsuConfig): JitsuConfig | undefined {\n if (!jitsu || typeof window !== 'undefined') return jitsu;\n let appHeaders: Record<string, string> | null = null;\n try {\n appHeaders = getTwilightContext().nativeAppHeaders;\n } catch {\n return jitsu;\n }\n if (!appHeaders) return jitsu;\n const extra = jitsu.context?.extra;\n // The engine's own app headers go, so an app that sends no version doesn't get the engine's.\n const headers = { ...extra?.headers };\n for (const name of NATIVE_APP_HEADERS) delete headers[name];\n return {\n ...jitsu,\n context: {\n ...jitsu.context,\n extra: { ...extra, headers: { ...headers, ...appHeaders } },\n },\n };\n}\n\nconst SETTINGS_TIMEOUT_MS = 5000;\n\nasync function requestSettings(identifier: string): Promise<StoreContext> {\n const includeParams = DEFAULT_INCLUDE_ITEMS.map((i) => `include[]=${i}`).join('&');\n const scope = getActiveScope();\n const params = scope != null ? `${includeParams}&scope=${scope.id}` : includeParams;\n\n const request = api\n // Sent explicitly rather than left to the client's own resolution, so\n // the identifier this function checked is the identifier that travels.\n // They agree today; a caller passing one and being answered about\n // another is the failure this makes impossible rather than unlikely.\n .get(`store/settings?${params}`, {\n timeout: SETTINGS_TIMEOUT_MS,\n headers: { [STORE_IDENTIFIER_HEADER]: identifier },\n });\n const json = await request.json<{ data?: SettingsApiResponse }>();\n // The same response, already settled; only its headers are read.\n const answer = settingsAnswerOf((await request)?.headers);\n\n const data = json?.data;\n if (!data) {\n throw new SettingsError(\n `The Salla API answered the settings request for store \"${identifier}\" without settings.`,\n { reason: 'empty' }\n );\n }\n\n // Convert languages from object to array\n const languages = languagesToArray(data.languages);\n\n return {\n store: data.store,\n theme: data.theme,\n languages,\n currencies: data.currencies,\n external_services: data.external_services,\n headers: data.headers,\n login: data.login,\n affiliate: data.affiliate,\n policy_url: data.policy_url,\n user: data.user,\n swoole: data.swoole,\n jitsu: withNativeAppHeaders(data.jitsu),\n maintenance: data.maintenance,\n maintenance_details: data.maintenance_details,\n ...(scope && { requestedScopeId: scope.id }),\n ...(answer && { answer }),\n };\n}\n\n/** The message the API put in an error body, `{ error: { message } }`, when it sent one. */\nfunction apiErrorMessage(data: unknown): string | undefined {\n const message = (data as { error?: { message?: unknown } } | undefined)?.error?.message;\n return typeof message === 'string' && message.length > 0 && message.length <= 200\n ? message\n : undefined;\n}\n\n/**\n * What core's `CurrentStoreMiddleware` answers, with a 422, when no store has the\n * username or domain it was given (or the store's status is `deleted`). The lookup is\n * `loadUseUsernameOrDomain`, the same one Twig's `checkUsername` turns into its 410.\n * The literal is not translated: it reads the same whatever language was asked for.\n */\nconst STORE_NOT_FOUND_MESSAGE = 'المتجر غير موجود';\n\n/**\n * Whether the API answered that no store has this identifier. A numeric identifier\n * is looked up with `findOrFail`, which Store's exception handler answers with a 410;\n * a username or domain gets {@link STORE_NOT_FOUND_MESSAGE}. A 410 for a username is\n * not read as one: nothing on that path answers it, and a store that does exist must\n * never be told it does not.\n */\nfunction isStoreNotFound(identifier: string, status: number, said: string | undefined): boolean {\n if (status === 410) return parseStoreId(identifier) !== null;\n return status === 422 && said === STORE_NOT_FOUND_MESSAGE;\n}\n\n/**\n * Names what went wrong, because the page, the server log and Sentry all carry\n * this message. Every failure used to read \"Make sure VITE_STORE_DOMAIN is set\",\n * a local-development variable no deployed theme has, so a slow API looked like\n * a misconfigured theme.\n */\nfunction describeSettingsFailure(identifier: string, error: unknown): SettingsError {\n if (error instanceof SettingsError) return error;\n const request = `the settings request for store \"${identifier}\"`;\n if (isTimeoutError(error)) {\n return new SettingsError(\n `The Salla API did not answer ${request} within ${SETTINGS_TIMEOUT_MS} ms.`,\n { reason: 'timeout' }\n );\n }\n if (isHTTPError(error)) {\n const { status } = error.response;\n const said = apiErrorMessage(error.data);\n return new SettingsError(\n `The Salla API answered ${request} with HTTP ${status}${said ? `: ${said}` : ''}.`,\n { reason: isStoreNotFound(identifier, status, said) ? 'not-found' : 'http', status }\n );\n }\n if (isNetworkError(error)) {\n return new SettingsError(`The Salla API could not be reached for ${request}.`, {\n reason: 'network',\n });\n }\n const detail = error instanceof Error ? `: ${error.message}` : '';\n return new SettingsError(`The settings request for store \"${identifier}\" failed${detail}.`);\n}\n\n/**\n * The settings, or a {@link SettingsError} that says why there are none. The\n * query throws it so the root route can say why the store did not load;\n * `store.settings` keeps answering `null` for its own callers.\n */\nasync function fetchSettings(storeIdentifier?: string): Promise<StoreContext> {\n const identifier = storeIdentifier ?? resolveStoreIdentifier();\n\n if (!identifier) {\n const error = new SettingsError(\n 'No store is named for this request: add `?storeId=` on the preview host, or set VITE_STORE_DOMAIN in local development.',\n { reason: 'no-store' }\n );\n console.warn('[store.settings]', error.message);\n throw error;\n }\n\n try {\n return await requestSettings(identifier);\n } catch (cause) {\n const error = describeSettingsFailure(identifier, cause);\n console.error('[store.settings]', error.message, ...(cause === error ? [] : [cause]));\n throw error;\n }\n}\n\nexport const store = {\n settings: async (storeIdentifier?: string): Promise<StoreContext | null> => {\n try {\n return await fetchSettings(storeIdentifier);\n } catch {\n // Already logged, with the reason.\n return null;\n }\n },\n\n queries: {\n settings: (storeIdentifier?: string) =>\n queryOptions<StoreContext | null>({\n queryKey: [\n 'store',\n 'settings',\n storeIdentifier,\n getTwilightContext().locale,\n getActiveScope(),\n // Two versions of one store's settings are two different answers, and\n // this is the query whose answer decides what every other call is\n // pinned to. `requestedThemeVersionId` rather than the resolved one:\n // the resolved value falls back to what these settings report, so it\n // is not knowable until after this query has run — the key would be\n // one thing on the server and another on the client, and the hydrated\n // page would refetch the settings it was just handed.\n requestedThemeVersionId(),\n ],\n // Throws rather than resolving `null`, so the failure keeps its reason.\n queryFn: () => fetchSettings(storeIdentifier),\n // A null never retried, and the root route waits on this: the router's\n // default `retry: 1` would sit through the timeout twice.\n retry: 0,\n }),\n },\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/utils/native-app-headers.ts","../src/api/store.ts"],"names":[],"mappings":";;;;;;;;AACO,IAAM,kBAAA,GAAqB;AAAA,EAChC,UAAA;AAAA,EACA,eAAA;AAAA,EACA,oBAAA;AAAA,EACA;AACF,CAAA;AAUO,SAAS,qBAAqB,OAAA,EAAiD;AACpF,EAAA,MAAM,EAAA,GAAK,OAAA,CAAQ,GAAA,CAAI,UAAU,GAAG,WAAA,EAAY;AAChD,EAAA,IAAI,EAAA,KAAO,KAAA,IAAS,EAAA,KAAO,SAAA,EAAW,OAAO,IAAA;AAC7C,EAAA,MAAM,QAAgC,EAAC;AACvC,EAAA,KAAA,MAAW,QAAQ,kBAAA,EAAoB;AACrC,IAAA,MAAM,KAAA,GAAQ,OAAA,CAAQ,GAAA,CAAI,IAAI,CAAA;AAC9B,IAAA,IAAI,KAAA,EAAO,KAAA,CAAM,IAAI,CAAA,GAAI,KAAA;AAAA,EAC3B;AACA,EAAA,OAAO,KAAA;AACT;;;ACZA,IAAM,qBAAA,GAAwB;AAAA,EAC5B,OAAA;AAAA,EACA,UAAA;AAAA,EACA,OAAA;AAAA,EACA,gBAAA;AAAA,EACA,mBAAA;AAAA,EACA,YAAA;AAAA,EACA,WAAA;AAAA,EACA,UAAA;AAAA,EACA,iBAAA;AAAA,EACA,QAAA;AAAA,EACA,SAAA;AAAA,EACA;AACF,CAAA;AA+FA,IAAM,cAAA,GAAuD;AAAA,EAC3D,SAAA,EAAW,cAAA;AAAA,EACX,OAAA,EAAS,YAAA;AAAA,EACT,WAAA,EAAa,iBAAA;AAAA,EACb,GAAA,EAAK;AACP,CAAA;AAEA,SAAS,iBAAiB,OAAA,EAA0D;AAClF,EAAA,IAAI,CAAC,SAAS,OAAO,MAAA;AACrB,EAAA,MAAM,SAAyB,EAAC;AAChC,EAAA,KAAA,MAAW,CAAC,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CAAQ,IAAA,CAAK,kBAAA,EAAoB,KAAA,CAAM,OAAO,CAAA;AAC9C,IAAA,MAAM,KAAA;AAAA,EACR;AAEA,EAAA,IAAI;AACF,IAAA,OAAO,MAAM,gBAAgB,UAAU,CAAA;AAAA,EACzC,SAAS,KAAA,EAAO;AACd,IAAA,MAAM,KAAA,GAAQ,uBAAA,CAAwB,UAAA,EAAY,KAAK,CAAA;AACvD,IAAA,OAAA,CAAQ,KAAA,CAAM,kBAAA,EAAoB,KAAA,CAAM,OAAA,EAAS,GAAI,KAAA,KAAU,KAAA,GAAQ,EAAC,GAAI,CAAC,KAAK,CAAE,CAAA;AACpF,IAAA,MAAM,KAAA;AAAA,EACR;AACF;AAEO,IAAM,KAAA,GAAQ;AAAA,EACnB,QAAA,EAAU,OAAO,eAAA,KAA2D;AAC1E,IAAA,IAAI;AACF,MAAA,OAAO,MAAM,cAAc,eAAe,CAAA;AAAA,IAC5C,CAAA,CAAA,MAAQ;AAEN,MAAA,OAAO,IAAA;AAAA,IACT;AAAA,EACF,CAAA;AAAA,EAEA,OAAA,EAAS;AAAA,IACP,QAAA,EAAU,CAAC,eAAA,KACT,YAAA,CAAkC;AAAA,MAChC,QAAA,EAAU;AAAA,QACR,OAAA;AAAA,QACA,UAAA;AAAA,QACA,eAAA;AAAA,QACA,oBAAmB,CAAE,MAAA;AAAA,QACrB,cAAA,EAAe;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAQf,uBAAA;AAAwB,OAC1B;AAAA;AAAA,MAEA,OAAA,EAAS,MAAM,aAAA,CAAc,eAAe,CAAA;AAAA;AAAA;AAAA,MAG5C,KAAA,EAAO;AAAA,KACR;AAAA;AAEP","file":"chunk-JOY7HCIH.js","sourcesContent":["/** The headers the Salla native app sends with every page it loads in its webview. */\nexport const NATIVE_APP_HEADERS = [\n 's-app-os',\n 's-app-version',\n 's-app-full-version',\n 's-app-os-version',\n];\n\n/**\n * The native app's own headers on this request, or null when it is not the app.\n *\n * On a Twig theme Laravel copies them into the settings' `jitsu.context.extra.headers`,\n * where the SDK reads the app's platform and version from (`salla.config.isMobileApp()`).\n * A React theme asks for its settings from the server, through the API, so the app's\n * headers never reach that call: the request is the only place they are.\n */\nexport function readNativeAppHeaders(headers: Headers): Record<string, string> | null {\n const os = headers.get('s-app-os')?.toLowerCase();\n if (os !== 'ios' && os !== 'android') return null;\n const found: Record<string, string> = {};\n for (const name of NATIVE_APP_HEADERS) {\n const value = headers.get(name);\n if (value) found[name] = value;\n }\n return found;\n}\n","import { queryOptions } from '@tanstack/react-query';\nimport { isHTTPError, isNetworkError, isTimeoutError } from 'ky';\nimport { api, getActiveScope, STORE_IDENTIFIER_HEADER } from './client';\nimport { SettingsError } from '../utils/errors';\nimport type { Store, Theme, Language, JitsuConfig, MaintenanceDetails } from '../types';\nimport { getTwilightContext } from '../twilight/context';\nimport { resolveStoreIdentifier } from '../utils/store-identity';\nimport { parseStoreId } from '../utils/cookies';\nimport { requestedThemeVersionId } from '../utils/theme-version';\nimport { NATIVE_APP_HEADERS } from '../utils/native-app-headers';\n\nexport { resolveStoreIdentifier };\n\nconst DEFAULT_INCLUDE_ITEMS = [\n 'store',\n 'settings',\n 'theme',\n 'theme_settings',\n 'external_services',\n 'currencies',\n 'languages',\n 'payments',\n 'product_widgets',\n 'rating',\n 'ratings',\n 'user',\n];\n\n/** Twig's `salla.init({ user })` object; the endpoint ignores the token, so always the guest. */\nexport interface SettingsUser {\n type: 'guest' | 'user';\n id?: number | string | null;\n language_code?: string;\n currency_code?: string;\n country_code?: string;\n [key: string]: unknown;\n}\n\n/**\n * Raw API response for settings endpoint.\n * Languages come as object: { \"AR\": { code, name, ... }, \"EN\": {...} }\n */\ninterface SettingsApiResponse {\n store?: Store;\n theme?: Theme;\n languages?: Record<string, Language>;\n currencies?: Record<\n string,\n { code: string; name: string; symbol: string; amount: number; country_code: string }\n >;\n external_services?: Record<string, unknown>;\n headers?: Record<string, unknown>;\n login?: { url: string; turnstile_site_key: string };\n affiliate?: { utm_url: string; cta_enabled: boolean };\n debug?: boolean;\n trace_console?: boolean;\n policy_url?: string;\n user?: SettingsUser;\n swoole?: string[];\n jitsu?: JitsuConfig;\n maintenance?: boolean;\n maintenance_details?: MaintenanceDetails;\n}\n\n/**\n * Central settings context - single source of truth for all API data.\n * Contains everything from the settings endpoint response after processing.\n */\nexport interface StoreContext {\n store?: Store;\n theme?: Theme;\n /** Languages as array after conversion from API object format */\n languages?: Language[];\n currencies?: Record<\n string,\n { code: string; name: string; symbol: string; amount: number; country_code: string }\n >;\n external_services?: Record<string, unknown>;\n headers?: Record<string, unknown>;\n login?: { url: string; turnstile_site_key: string };\n affiliate?: { utm_url: string; cta_enabled: boolean };\n debug?: boolean;\n trace_console?: boolean; // todo:: remove it\n policy_url?: string;\n user?: SettingsUser;\n /** API paths the SDK sends with `s-store-api-version: swoole` */\n swoole?: string[];\n /** Where the SDK's analytics send events, and which ones; without it the SDK tracks nothing. */\n jitsu?: JitsuConfig;\n /**\n * The store is closed: by the merchant from the dashboard, by the platform, or\n * for the selected market only. The engine then renders the maintenance page\n * to everyone but the merchant; see `rootBeforeLoad`.\n */\n maintenance?: boolean;\n /** What the maintenance page says; sent beside `maintenance`. */\n maintenance_details?: MaintenanceDetails;\n /**\n * The scope these settings were requested with; absent when none was. Not from\n * the API: stamped by `store.settings`, so `resolveThemeVersionId` can tell\n * whether the version they name still answers the scope that is active now.\n */\n requestedScopeId?: string;\n /** Which answer of the API these settings are; see {@link SettingsAnswer}. */\n answer?: SettingsAnswer;\n}\n\n/**\n * Which answer of the settings API a set of settings came from, read off the\n * response rather than the body: the API's request id, the Store's trace, and\n * whether Cloudflare served it from its cache and how old it was. A decision the\n * settings drive for every visitor alike (the maintenance page) can then be\n * traced to the exact request the backend logged, or to a cached copy of it.\n */\nexport interface SettingsAnswer {\n requestId?: string;\n traceId?: string;\n cacheStatus?: string;\n age?: string;\n}\n\nconst ANSWER_HEADERS: Record<keyof SettingsAnswer, string> = {\n requestId: 's-request-id',\n traceId: 'x-trace-id',\n cacheStatus: 'cf-cache-status',\n age: 'age',\n};\n\nfunction settingsAnswerOf(headers: Headers | undefined): SettingsAnswer | undefined {\n if (!headers) return undefined;\n const answer: SettingsAnswer = {};\n for (const [field, name] of Object.entries(ANSWER_HEADERS) as [keyof SettingsAnswer, string][]) {\n const value = headers.get(name);\n if (value) answer[field] = value;\n }\n return Object.keys(answer).length ? answer : undefined;\n}\n\n/**\n * Converts languages object from API to array format.\n * API returns: { \"AR\": { code, name, ... }, \"EN\": { ... } }\n * We need: [{ code, name, ... }, { code, name, ... }]\n * todo:: return the languages as object from the APIs to avoid this\n */\nfunction languagesToArray(languages?: Record<string, Language>): Language[] | undefined {\n if (!languages) return undefined;\n // The SDK's localization modal reads `lang.iso_code` (not `code`) when a language is\n // selected — without it the switch navigates to `/undefined/...`.\n return Object.values(languages).map((lang) => ({ iso_code: lang.code, ...lang }));\n}\n\n/**\n * The settings' analytics context with the native app's headers in it, as Laravel\n * writes it for a Twig theme: the SDK reads the app's platform and version from there.\n * The API answers a server-side call with the engine's own headers, never the app's.\n */\nfunction withNativeAppHeaders(jitsu?: JitsuConfig): JitsuConfig | undefined {\n if (!jitsu || typeof window !== 'undefined') return jitsu;\n let appHeaders: Record<string, string> | null = null;\n try {\n appHeaders = getTwilightContext().nativeAppHeaders;\n } catch {\n return jitsu;\n }\n if (!appHeaders) return jitsu;\n const extra = jitsu.context?.extra;\n // The engine's own app headers go, so an app that sends no version doesn't get the engine's.\n const headers = { ...extra?.headers };\n for (const name of NATIVE_APP_HEADERS) delete headers[name];\n return {\n ...jitsu,\n context: {\n ...jitsu.context,\n extra: { ...extra, headers: { ...headers, ...appHeaders } },\n },\n };\n}\n\nconst SETTINGS_TIMEOUT_MS = 5000;\n\nasync function requestSettings(identifier: string): Promise<StoreContext> {\n const includeParams = DEFAULT_INCLUDE_ITEMS.map((i) => `include[]=${i}`).join('&');\n const scope = getActiveScope();\n const params = scope != null ? `${includeParams}&scope=${scope.id}` : includeParams;\n\n const request = api\n // Sent explicitly rather than left to the client's own resolution, so\n // the identifier this function checked is the identifier that travels.\n // They agree today; a caller passing one and being answered about\n // another is the failure this makes impossible rather than unlikely.\n .get(`store/settings?${params}`, {\n timeout: SETTINGS_TIMEOUT_MS,\n headers: { [STORE_IDENTIFIER_HEADER]: identifier },\n });\n const json = await request.json<{ data?: SettingsApiResponse }>();\n // The same response, already settled; only its headers are read.\n const answer = settingsAnswerOf((await request)?.headers);\n\n const data = json?.data;\n if (!data) {\n throw new SettingsError(\n `The Salla API answered the settings request for store \"${identifier}\" without settings.`,\n { reason: 'empty' }\n );\n }\n\n // Convert languages from object to array\n const languages = languagesToArray(data.languages);\n\n return {\n store: data.store,\n theme: data.theme,\n languages,\n currencies: data.currencies,\n external_services: data.external_services,\n headers: data.headers,\n login: data.login,\n affiliate: data.affiliate,\n policy_url: data.policy_url,\n user: data.user,\n swoole: data.swoole,\n jitsu: withNativeAppHeaders(data.jitsu),\n maintenance: data.maintenance,\n maintenance_details: data.maintenance_details,\n ...(scope && { requestedScopeId: scope.id }),\n ...(answer && { answer }),\n };\n}\n\n/** The message the API put in an error body, `{ error: { message } }`, when it sent one. */\nfunction apiErrorMessage(data: unknown): string | undefined {\n const message = (data as { error?: { message?: unknown } } | undefined)?.error?.message;\n return typeof message === 'string' && message.length > 0 && message.length <= 200\n ? message\n : undefined;\n}\n\n/**\n * What core's `CurrentStoreMiddleware` answers, with a 422, when no store has the\n * username or domain it was given (or the store's status is `deleted`). The lookup is\n * `loadUseUsernameOrDomain`, the same one Twig's `checkUsername` turns into its 410.\n * The literal is not translated: it reads the same whatever language was asked for.\n */\nconst STORE_NOT_FOUND_MESSAGE = 'المتجر غير موجود';\n\n/**\n * Whether the API answered that no store has this identifier. A numeric identifier\n * is looked up with `findOrFail`, which Store's exception handler answers with a 410;\n * a username or domain gets {@link STORE_NOT_FOUND_MESSAGE}. A 410 for a username is\n * not read as one: nothing on that path answers it, and a store that does exist must\n * never be told it does not.\n */\nfunction isStoreNotFound(identifier: string, status: number, said: string | undefined): boolean {\n if (status === 410) return parseStoreId(identifier) !== null;\n return status === 422 && said === STORE_NOT_FOUND_MESSAGE;\n}\n\n/**\n * Names what went wrong, because the page, the server log and Sentry all carry\n * this message. Every failure used to read \"Make sure VITE_STORE_DOMAIN is set\",\n * a local-development variable no deployed theme has, so a slow API looked like\n * a misconfigured theme.\n */\nfunction describeSettingsFailure(identifier: string, error: unknown): SettingsError {\n if (error instanceof SettingsError) return error;\n const request = `the settings request for store \"${identifier}\"`;\n if (isTimeoutError(error)) {\n return new SettingsError(\n `The Salla API did not answer ${request} within ${SETTINGS_TIMEOUT_MS} ms.`,\n { reason: 'timeout' }\n );\n }\n if (isHTTPError(error)) {\n const { status } = error.response;\n const said = apiErrorMessage(error.data);\n return new SettingsError(\n `The Salla API answered ${request} with HTTP ${status}${said ? `: ${said}` : ''}.`,\n { reason: isStoreNotFound(identifier, status, said) ? 'not-found' : 'http', status }\n );\n }\n if (isNetworkError(error)) {\n return new SettingsError(`The Salla API could not be reached for ${request}.`, {\n reason: 'network',\n });\n }\n const detail = error instanceof Error ? `: ${error.message}` : '';\n return new SettingsError(`The settings request for store \"${identifier}\" failed${detail}.`);\n}\n\n/**\n * The settings, or a {@link SettingsError} that says why there are none. The\n * query throws it so the root route can say why the store did not load;\n * `store.settings` keeps answering `null` for its own callers.\n */\nasync function fetchSettings(storeIdentifier?: string): Promise<StoreContext> {\n const identifier = storeIdentifier ?? resolveStoreIdentifier();\n\n if (!identifier) {\n const error = new SettingsError(\n 'No store is named for this request: add `?storeId=` on the preview host, or set VITE_STORE_DOMAIN in local development.',\n { reason: 'no-store' }\n );\n console.warn('[store.settings]', error.message);\n throw error;\n }\n\n try {\n return await requestSettings(identifier);\n } catch (cause) {\n const error = describeSettingsFailure(identifier, cause);\n console.error('[store.settings]', error.message, ...(cause === error ? [] : [cause]));\n throw error;\n }\n}\n\nexport const store = {\n settings: async (storeIdentifier?: string): Promise<StoreContext | null> => {\n try {\n return await fetchSettings(storeIdentifier);\n } catch {\n // Already logged, with the reason.\n return null;\n }\n },\n\n queries: {\n settings: (storeIdentifier?: string) =>\n queryOptions<StoreContext | null>({\n queryKey: [\n 'store',\n 'settings',\n storeIdentifier,\n getTwilightContext().locale,\n getActiveScope(),\n // Two versions of one store's settings are two different answers, and\n // this is the query whose answer decides what every other call is\n // pinned to. `requestedThemeVersionId` rather than the resolved one:\n // the resolved value falls back to what these settings report, so it\n // is not knowable until after this query has run — the key would be\n // one thing on the server and another on the client, and the hydrated\n // page would refetch the settings it was just handed.\n requestedThemeVersionId(),\n ],\n // Throws rather than resolving `null`, so the failure keeps its reason.\n queryFn: () => fetchSettings(storeIdentifier),\n // A null never retried, and the root route waits on this: the router's\n // default `retry: 1` would sit through the timeout twice.\n retry: 0,\n }),\n },\n};\n"]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { home } from './chunk-
|
|
2
|
-
import { product } from './chunk-
|
|
3
|
-
import { ProductCard } from './chunk-
|
|
1
|
+
import { home } from './chunk-V23ILNAK.js';
|
|
2
|
+
import { product } from './chunk-ESYRKX7T.js';
|
|
3
|
+
import { ProductCard } from './chunk-3VOJOKQI.js';
|
|
4
4
|
import { registry } from './chunk-Y32RHCOH.js';
|
|
5
5
|
import { useTranslation } from './chunk-TYNZ5B2B.js';
|
|
6
|
-
import { Image, LazyRenderWhenVisible } from './chunk-
|
|
6
|
+
import { Image, LazyRenderWhenVisible } from './chunk-E5OVMQIA.js';
|
|
7
7
|
import { Link } from './chunk-AXW67SY7.js';
|
|
8
8
|
import { whenSallaLoaded } from './chunk-GYXUYHKO.js';
|
|
9
9
|
import { getTwilightContext } from './chunk-7VNVCHID.js';
|
|
@@ -711,6 +711,8 @@ var HomeComponentRenderer = memo(function HomeComponentRenderer2({
|
|
|
711
711
|
const resolvedClassName = config?.className ? typeof config.className === "function" ? config.className(data) : config.className : `s-block s-block--${data.path}`;
|
|
712
712
|
const hideClass = channelVisibilityClass(data);
|
|
713
713
|
const resolvedId = config?.id ? typeof config.id === "function" ? config.id(data) : config.id : void 0;
|
|
714
|
+
const blockId = data.id ?? data.key;
|
|
715
|
+
const liveBlockId = typeof blockId === "number" || typeof blockId === "string" && blockId ? String(blockId) : void 0;
|
|
714
716
|
const height = config?.height || "400px";
|
|
715
717
|
const renderOnMount = config?.renderOnMount ?? COMPONENT_CONFIG[data.path]?.renderOnMount;
|
|
716
718
|
const content = /* @__PURE__ */ jsx(ComponentErrorBoundary, { data, position: index + 1, children: /* @__PURE__ */ jsx(Component2, { data: { ...data, position: index + 1, priority: isFirstComponent } }) });
|
|
@@ -726,6 +728,7 @@ var HomeComponentRenderer = memo(function HomeComponentRenderer2({
|
|
|
726
728
|
renderOnMount: isFirstComponent || renderOnMount === true,
|
|
727
729
|
placeholder: config?.placeholder ?? /* @__PURE__ */ jsx(ProductsSliderSkeleton, {}),
|
|
728
730
|
blockIndex: import.meta.env.DEV ? index : void 0,
|
|
731
|
+
liveBlockId,
|
|
729
732
|
children: content
|
|
730
733
|
}
|
|
731
734
|
)
|
|
@@ -783,5 +786,5 @@ var ReorderProducts = memo(function ReorderProducts2() {
|
|
|
783
786
|
});
|
|
784
787
|
|
|
785
788
|
export { BundleComponent, ComponentErrorBoundary, DefaultHomeComponents, FeaturedProductsStyle1, FeaturedProductsStyle2, FeaturedProductsStyle3, FixedBanner, FixedProducts, HomeComponentRenderer, LazyTestimonials, PageBlocks, ParallaxBackground, PhotosSlider, ProductsSlider, ReorderProducts, SquarePhotos, StoreFeatures, Youtube, registerHomeComponentConfig, registerHomeComponents, useReorderButtons };
|
|
786
|
-
//# sourceMappingURL=chunk-
|
|
787
|
-
//# sourceMappingURL=chunk-
|
|
789
|
+
//# sourceMappingURL=chunk-KNUANWCR.js.map
|
|
790
|
+
//# sourceMappingURL=chunk-KNUANWCR.js.map
|
|
@@ -0,0 +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,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EJ,CAAC","file":"chunk-KNUANWCR.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 } from 'react';\n\nexport interface BundleComponentProps {\n data: {\n component_name: string;\n bundle_id: string;\n [key: string]: unknown;\n };\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 if (!mounted) {\n return null;\n }\n\n const { component_name: componentName, bundle_id: bundleId, ...rest } = props.data;\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 suppressHydrationWarning\n />\n </>\n );\n});\n","import { lazy } from 'react';\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';\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 = lazy(() =>\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 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 '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 '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 * 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}: {\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}) {\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 // What the theme editor addresses the block by: its row id, or the uuid of one not saved yet.\n const blockId = data.id ?? data.key;\n const liveBlockId =\n typeof blockId === 'number' || (typeof blockId === 'string' && blockId)\n ? String(blockId)\n : undefined;\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 { api } from './chunk-
|
|
1
|
+
import { api } from './chunk-6BQN4JKH.js';
|
|
2
2
|
import { queryOptions } from '@tanstack/react-query';
|
|
3
3
|
|
|
4
4
|
var user = {
|
|
@@ -19,5 +19,5 @@ var user = {
|
|
|
19
19
|
};
|
|
20
20
|
|
|
21
21
|
export { user };
|
|
22
|
-
//# sourceMappingURL=chunk-
|
|
23
|
-
//# sourceMappingURL=chunk-
|
|
22
|
+
//# sourceMappingURL=chunk-LCBETTJI.js.map
|
|
23
|
+
//# sourceMappingURL=chunk-LCBETTJI.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/api/user.ts"],"names":[],"mappings":";;;AAIO,IAAM,IAAA,GAAO;AAAA,EAClB,KAAK,YAAkC;AACrC,IAAA,IAAI;AACF,MAAA,OAAO,MAAM,GAAA,CACV,GAAA,CAAI,WAAW,CAAA,CACf,MAAmC,CACnC,IAAA,CAAK,CAAC,CAAA,MAAO,EAAE,GAAG,CAAA,CAAE,IAAA,EAAM,IAAA,EAAM,QAAgB,CAAE,CAAA;AAAA,IACvD,SAAS,KAAA,EAAO;AACd,MAAA,OAAA,CAAQ,KAAA,CAAM,sBAAsB,KAAK,CAAA;AACzC,MAAA,OAAO,IAAA;AAAA,IACT;AAAA,EACF,CAAA;AAAA,EAEA,OAAA,EAAS;AAAA,IACP,OAAA,EAAS,MACP,YAAA,CAA0B;AAAA,MACxB,QAAA,EAAU,CAAC,MAAA,EAAQ,SAAS,CAAA;AAAA,MAC5B,SAAS,IAAA,CAAK;AAAA,KACf;AAAA;AAEP","file":"chunk-
|
|
1
|
+
{"version":3,"sources":["../src/api/user.ts"],"names":[],"mappings":";;;AAIO,IAAM,IAAA,GAAO;AAAA,EAClB,KAAK,YAAkC;AACrC,IAAA,IAAI;AACF,MAAA,OAAO,MAAM,GAAA,CACV,GAAA,CAAI,WAAW,CAAA,CACf,MAAmC,CACnC,IAAA,CAAK,CAAC,CAAA,MAAO,EAAE,GAAG,CAAA,CAAE,IAAA,EAAM,IAAA,EAAM,QAAgB,CAAE,CAAA;AAAA,IACvD,SAAS,KAAA,EAAO;AACd,MAAA,OAAA,CAAQ,KAAA,CAAM,sBAAsB,KAAK,CAAA;AACzC,MAAA,OAAO,IAAA;AAAA,IACT;AAAA,EACF,CAAA;AAAA,EAEA,OAAA,EAAS;AAAA,IACP,OAAA,EAAS,MACP,YAAA,CAA0B;AAAA,MACxB,QAAA,EAAU,CAAC,MAAA,EAAQ,SAAS,CAAA;AAAA,MAC5B,SAAS,IAAA,CAAK;AAAA,KACf;AAAA;AAEP","file":"chunk-LCBETTJI.js","sourcesContent":["import { queryOptions } from '@tanstack/react-query';\nimport { api } from './client';\nimport type { User } from '../types';\n\nexport const user = {\n get: async (): Promise<User | null> => {\n try {\n return await api\n .get('auth/user')\n .json<{ data: Omit<User, 'type'> }>()\n .then((r) => ({ ...r.data, type: 'user' as const }));\n } catch (error) {\n console.debug('[user.get] Failed:', error);\n return null;\n }\n },\n\n queries: {\n current: () =>\n queryOptions<User | null>({\n queryKey: ['user', 'current'],\n queryFn: user.get,\n }),\n },\n};\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { orThrow, orUnauthorized } from './chunk-
|
|
2
|
-
import { api } from './chunk-
|
|
1
|
+
import { orThrow, orUnauthorized } from './chunk-Y57KRLGY.js';
|
|
2
|
+
import { api } from './chunk-6BQN4JKH.js';
|
|
3
3
|
import { queryOptions } from '@tanstack/react-query';
|
|
4
4
|
|
|
5
5
|
var order = {
|
|
@@ -78,5 +78,5 @@ var order = {
|
|
|
78
78
|
};
|
|
79
79
|
|
|
80
80
|
export { order };
|
|
81
|
-
//# sourceMappingURL=chunk-
|
|
82
|
-
//# sourceMappingURL=chunk-
|
|
81
|
+
//# sourceMappingURL=chunk-LG5355UU.js.map
|
|
82
|
+
//# sourceMappingURL=chunk-LG5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A;AAAA,EAEA,iBAAiB,CAAC,OAAA,KAChB,QAAQ,KAAA,CAAM,QAAA,CAAS,OAAO,CAAC,CAAA;AAAA,EAEjC,OAAA,EAAS;AAAA,IACP,IAAA,EAAM,CAAC,MAAA,KACL,YAAA,CAAa;AAAA,MACX,QAAA,EAAU,CAAC,QAAA,EAAU,MAAA,EAAQ,MAAM,CAAA;AAAA,MACnC,OAAA,EAAS,CAAC,EAAE,MAAA,EAAO,KAAM,KAAA,CAAM,IAAA,CAAK,EAAE,GAAG,MAAA,EAAQ,MAAA,EAAQ;AAAA,KAC1D,CAAA;AAAA,IACH,IAAA,EAAM,CAAC,EAAA,KACL,YAAA,CAAa;AAAA,MACX,QAAA,EAAU,CAAC,QAAA,EAAU,QAAA,EAAU,EAAE,CAAA;AAAA,MACjC,OAAA,EAAS,MAAM,KAAA,CAAM,IAAA,CAAK,EAAE;AAAA,KAC7B,CAAA;AAAA,IACH,SAAA,EAAW,CAAC,OAAA,KACV,YAAA,CAAa;AAAA,MACX,QAAA,EAAU,CAAC,QAAA,EAAU,WAAA,EAAa,OAAO,CAAA;AAAA,MACzC,OAAA,EAAS,MAAM,KAAA,CAAM,SAAA,CAAU,OAAO;AAAA,KACvC,CAAA;AAAA,IACH,OAAA,EAAS,CAAC,OAAA,KACR,YAAA,CAAa;AAAA,MACX,QAAA,EAAU,CAAC,QAAA,EAAU,SAAA,EAAW,OAAO,CAAA;AAAA,MACvC,OAAA,EAAS,MAAM,KAAA,CAAM,OAAA,CAAQ,OAAO;AAAA,KACrC,CAAA;AAAA,IACH,QAAA,EAAU,CAAC,OAAA,KACT,YAAA,CAAa;AAAA,MACX,QAAA,EAAU,CAAC,QAAA,EAAU,UAAA,EAAY,OAAO,CAAA;AAAA,MACxC,OAAA,EAAS,MAAM,KAAA,CAAM,QAAA,CAAS,OAAO;AAAA,KACtC;AAAA;AAEP","file":"chunk-LG5355UU.js","sourcesContent":["import { queryOptions } from '@tanstack/react-query';\nimport { api } from './client';\nimport type {\n Order,\n OrderListItem,\n OrderShipmentItem,\n OrderRatingItem,\n} from '../routes/account/types';\nimport type { Pagination } from './types';\nimport { orThrow, orUnauthorized } from '../providers/NavigationProvider';\n\nexport interface OrderDetailResponse {\n order: Order;\n}\n\n/**\n * The order in the shape the Twilight web components read (`salla-order-details`,\n * `salla-order-totals-card`) and the Twig themes render: the API answers `orders/{id}` this\n * way when the request does not say it comes from a React theme (`s-theme-type`).\n */\nexport interface TwilightOrder {\n items: Array<{\n name: string;\n quantity: number;\n product?: { id: number; url?: string; type?: string; image?: { url?: string } };\n options?: unknown[];\n }>;\n [key: string]: unknown;\n}\n\nexport interface CheckoutThankYouData {\n thank_you_title?: string;\n messages?: string[];\n share_message?: string;\n short_share_message?: string;\n}\n\nexport interface OrdersListResponse {\n data: OrderListItem[];\n cursor?: Pagination;\n}\n\nexport interface OrdersListParams {\n page?: number;\n cursor?: string | null;\n status?: string;\n feedback_status?: string;\n /** When set, the list payload includes each order's `items[]` (`with_items=1`). */\n with_items?: boolean | number;\n signal?: AbortSignal;\n}\n\nexport const order = {\n list: async (params?: OrdersListParams): Promise<OrdersListResponse> => {\n const {\n page,\n cursor,\n status,\n feedback_status: feedbackStatus,\n with_items: withItems,\n signal,\n } = params ?? {};\n\n const searchParams = new URLSearchParams();\n if (page !== undefined) searchParams.set('page', String(page));\n if (cursor) searchParams.set('cursor', cursor);\n if (status) searchParams.set('status', status);\n if (feedbackStatus) searchParams.set('feedback_status', feedbackStatus);\n if (withItems) searchParams.set('with_items', '1');\n\n const options: Record<string, unknown> = {};\n if (signal) options.signal = signal;\n\n const response = await api\n .get(`orders?${searchParams.toString()}`, options as any)\n .json<{ data: OrderListItem[] | null; cursor?: Pagination }>();\n\n return {\n data: response.data ?? [],\n cursor: response.cursor,\n };\n },\n\n find: async (id: string): Promise<OrderDetailResponse> => {\n const response = await api.get(`orders/${id}`).json<{ data: Order }>();\n\n return { order: response.data };\n },\n\n findForComponents: async (id: string): Promise<TwilightOrder> => {\n const response = await api\n .get(`orders/${id}`, {\n hooks: {\n // Runs after the client's own hook, which marks every request as from a React theme.\n beforeRequest: [({ request }) => request.headers.delete('s-theme-type')],\n },\n })\n .json<{ data: TwilightOrder }>();\n return response.data;\n },\n\n shipments: async (orderId: string): Promise<OrderShipmentItem[]> => {\n const response = await api\n .get(`orders/${orderId}/shipments`)\n .json<{ data: OrderShipmentItem[] }>();\n return response.data ?? [];\n },\n\n ratings: async (orderId: string): Promise<OrderRatingItem[]> => {\n const response = await api.get(`orders/${orderId}/ratings`).json<{ data: OrderRatingItem[] }>();\n return response.data ?? [];\n },\n\n findOrThrow: (id: string): Promise<OrderDetailResponse> =>\n orThrow(orUnauthorized(order.find(id))),\n\n thankYou: async (orderId: string): Promise<CheckoutThankYouData> => {\n const { data } = await api\n .get(`checkout/thank-you/${orderId}`)\n .json<{ data: CheckoutThankYouData }>();\n return data;\n },\n\n thankYouOrThrow: (orderId: string): Promise<CheckoutThankYouData> =>\n orThrow(order.thankYou(orderId)),\n\n queries: {\n list: (params?: Omit<OrdersListParams, 'signal'>) =>\n queryOptions({\n queryKey: ['orders', 'list', params],\n queryFn: ({ signal }) => order.list({ ...params, signal }),\n }),\n find: (id: string) =>\n queryOptions({\n queryKey: ['orders', 'detail', id],\n queryFn: () => order.find(id),\n }),\n shipments: (orderId: string) =>\n queryOptions({\n queryKey: ['orders', 'shipments', orderId],\n queryFn: () => order.shipments(orderId),\n }),\n ratings: (orderId: string) =>\n queryOptions({\n queryKey: ['orders', 'ratings', orderId],\n queryFn: () => order.ratings(orderId),\n }),\n thankYou: (orderId: string) =>\n queryOptions({\n queryKey: ['orders', 'thankYou', orderId],\n queryFn: () => order.thankYou(orderId),\n }),\n },\n};\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { useDate } from './chunk-
|
|
1
|
+
import { useDate } from './chunk-QTRV6N64.js';
|
|
2
2
|
import { useTranslation } from './chunk-TYNZ5B2B.js';
|
|
3
|
-
import { Image } from './chunk-
|
|
3
|
+
import { Image } from './chunk-E5OVMQIA.js';
|
|
4
4
|
import { Link } from './chunk-AXW67SY7.js';
|
|
5
5
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
6
6
|
|
|
@@ -61,5 +61,5 @@ function BlogListLayout({
|
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
export { BlogArticleCard, BlogListLayout };
|
|
64
|
-
//# sourceMappingURL=chunk-
|
|
65
|
-
//# sourceMappingURL=chunk-
|
|
64
|
+
//# sourceMappingURL=chunk-LNSMPXGR.js.map
|
|
65
|
+
//# sourceMappingURL=chunk-LNSMPXGR.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/routes/blog/components.tsx"],"names":[],"mappings":";;;;;;AAMO,SAAS,qBAAA,CAAsB,EAAE,UAAA,EAAW,EAAmC;AACpF,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,cAAA,EAAe;AAE7B,EAAA,IAAI,CAAC,UAAA,CAAW,MAAA,EAAQ,OAAO,IAAA;AAE/B,EAAA,uBACE,IAAA,CAAC,KAAA,EAAA,EAAI,YAAA,EAAW,SAAA,EAAU,WAAU,sDAAA,EAClC,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,IAAA,EAAA,EAAG,SAAA,EAAU,gBAAA,EAAkB,QAAA,EAAA,CAAA,CAAE,kCAAkC,CAAA,EAAE,CAAA;AAAA,oBACtE,GAAA,CAAC,IAAA,EAAA,EACE,QAAA,EAAA,UAAA,CAAW,GAAA,CAAI,CAAC,QAAA,qBACf,GAAA,CAAC,IAAA,EAAA,EAAqB,SAAA,EAAW,QAAA,CAAS,UAAA,GAAa,cAAA,GAAiB,EAAA,EACtE,8BAAC,IAAA,EAAA,EAAK,SAAA,EAAU,uCAAA,EAAwC,EAAA,EAAI,QAAA,CAAS,GAAA,EAClE,QAAA,EAAA,QAAA,CAAS,IAAA,EACZ,CAAA,EAAA,EAHO,QAAA,CAAS,EAIlB,CACD,CAAA,EACH;AAAA,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;AAEJ","file":"chunk-LNSMPXGR.js","sourcesContent":["import type { ReactNode } from 'react';\nimport { useTranslation } from '../../providers/I18nProvider';\nimport { useDate } from '../../hooks';\nimport { Image, Link } from '../../components/common';\nimport type { BlogCategory, ArticleSummary } from './types';\n\nexport function BlogCategoriesSidebar({ categories }: { categories: BlogCategory[] }) {\n const { t } = useTranslation();\n\n if (!categories.length) return null;\n\n return (\n <nav aria-label=\"Sidebar\" className=\"hidden lg:block lg:sticky shrink-0 top-24 col-span-2\">\n <h2 className=\"font-bold mb-3\">{t('pages.blog_categories.categories')}</h2>\n <ul>\n {categories.map((category) => (\n <li key={category.id} className={category.is_current ? 'text-primary' : ''}>\n <Link className=\"py-3 block text-sm hover:text-primary\" to={category.url}>\n {category.name}\n </Link>\n </li>\n ))}\n </ul>\n </nav>\n );\n}\n\nexport function BlogArticleCard({\n article,\n showAuthor = false,\n}: {\n article: ArticleSummary;\n showAuthor?: boolean;\n}) {\n const { format: formatDate } = useDate();\n\n return (\n <div className=\"list-block post-entry relative h-full transition-shadow duration-500 bg-white hover:shadow-default rounded-lg justify-around overflow-hidden flex flex-col\">\n <Link\n to={article.url}\n className=\"post-entry__image relative overflow-hidden hover:opacity-90 w-full h-56 bg-border-color flex items-center justify-center\"\n >\n {article.image && (\n <Image\n className=\"h-full w-full object-cover\"\n src={article.image}\n alt={article.name}\n aspectRatio=\"16/9\"\n />\n )}\n </Link>\n <div className=\"flex-1 px-5 pt-5 pb-7\">\n <div className=\"mb-2.5 text-gray-500 rounded-md inline-flex text-sm rtl:space-x-reverse space-x-5\">\n <div className=\"flex items-center\">\n <i className=\"sicon-calendar-date rtl:ml-1 ltr:mr-1\"></i>\n <span>{formatDate(article.created_at)}</span>\n </div>\n {showAuthor && article.author && (\n <Link to={article.author.url} className=\"flex items-center hover:text-dark\">\n <i className=\"sicon-user rtl:ml-1 ltr:mr-1\"></i>\n <span>{article.author.name}</span>\n </Link>\n )}\n </div>\n <h3 className=\"post-entry__title text-sm font-bold text-gray-800 leading-6 mb-2.5\">\n <Link to={article.url}>{article.name}</Link>\n </h3>\n <p className=\"text-sm text-gray-500 leading-6 mb-2.5\">{article.description}</p>\n </div>\n </div>\n );\n}\n\nexport function BlogListLayout({\n categories,\n children,\n}: {\n categories: BlogCategory[];\n children: ReactNode;\n}) {\n return (\n <div className=\"grid grid-cols-1 lg:grid-cols-8 gap-8\">\n <BlogCategoriesSidebar categories={categories} />\n <div className=\"main-content lg:col-span-6\">{children}</div>\n </div>\n );\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { api } from './chunk-
|
|
1
|
+
import { api } from './chunk-6BQN4JKH.js';
|
|
2
2
|
import { queryOptions } from '@tanstack/react-query';
|
|
3
3
|
|
|
4
4
|
var apps = {
|
|
@@ -40,5 +40,5 @@ var apps = {
|
|
|
40
40
|
};
|
|
41
41
|
|
|
42
42
|
export { apps };
|
|
43
|
-
//# sourceMappingURL=chunk-
|
|
44
|
-
//# sourceMappingURL=chunk-
|
|
43
|
+
//# sourceMappingURL=chunk-MWOP57ZR.js.map
|
|
44
|
+
//# sourceMappingURL=chunk-MWOP57ZR.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/api/apps.ts"],"names":[],"mappings":";;;AAmCO,IAAM,IAAA,GAAO;AAAA;AAAA;AAAA;AAAA;AAAA,EAKlB,UAAU,YAAmC;AAC3C,IAAA,MAAM,EAAE,IAAA,EAAK,GAAI,MAAM,GAAA,CACpB,GAAA,CAAI,eAAA,EAAiB,EAAE,OAAA,EAAS,IAAA,EAAM,CAAA,CACtC,IAAA,EAA8B;AACjC,IAAA,OAAO,QAAQ,EAAC;AAAA,EAClB,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,UAAU,YAAkC;AAC1C,IAAA,MAAM,EAAE,IAAA,EAAK,GAAI,MAAM,GAAA,CACpB,GAAA,CAAI,wBAAA,EAA0B,EAAE,OAAA,EAAS,IAAA,EAAM,CAAA,CAC/C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EAEA,OAAA,EAAS;AAAA,IACP,QAAA,EAAU,MACR,YAAA,CAAa;AAAA,MACX,QAAA,EAAU,CAAC,MAAA,EAAQ,UAAU,CAAA;AAAA,MAC7B,OAAA,EAAS,MAAM,IAAA,CAAK,QAAA,EAAS;AAAA;AAAA,MAE7B,SAAA,EAAW,QAAA;AAAA;AAAA;AAAA;AAAA,MAIX,KAAA,EAAO;AAAA,KACR,CAAA;AAAA,IAEH,QAAA,EAAU,MACR,YAAA,CAAa;AAAA,MACX,QAAA,EAAU,CAAC,MAAA,EAAQ,UAAU,CAAA;AAAA,MAC7B,OAAA,EAAS,MAAM,IAAA,CAAK,QAAA,EAAS;AAAA;AAAA,MAE7B,SAAA,EAAW,QAAA;AAAA,MACX,KAAA,EAAO;AAAA,KACR;AAAA;AAEP","file":"chunk-MWOP57ZR.js","sourcesContent":["import { queryOptions } from '@tanstack/react-query';\nimport { api } from './client';\n\nexport interface AppSnippetRow {\n place: string;\n content: string;\n url?: string | null;\n /**\n * Raw snippet id, emitted as `data-snippet-id`. Present only on CDN rows — the\n * inline branch of the backend's snippet parser omits the key entirely.\n */\n id?: number;\n /** `{{customer.x}}` placeholders in `content` to substitute from SDK config `user.*` keys. */\n customer_parameters?: string[];\n}\n\nexport interface AppSnippet {\n service: string;\n app_id: string;\n /** Encoded app id (`getRouteKey()`): the scope id its snippets bind to via `data-scope-id`,\n * and its settings-bucket key. Absent on payloads predating the settings API. */\n id?: string;\n app_slug: string;\n status: string;\n snippets: AppSnippetRow[];\n}\n\n/**\n * Per-app public `app.*` buckets for CDN snippets, keyed by encoded app id (== `AppSnippet.id`,\n * the `Salla.appScope` scope id). One isolated bucket per app; reads within a scope are bare `app.*`.\n */\nexport interface AppSettings {\n apps: Record<string, Record<string, unknown>>;\n}\n\nexport const apps = {\n /**\n * Installed apps' snippets (scripts/HTML to inject). Timeout-bounded because it's awaited in\n * rootBeforeLoad (SSR/TTFB): a slow response degrades to no CDN tags, never stalls the page.\n */\n snippets: async (): Promise<AppSnippet[]> => {\n const { data } = await api\n .get('apps/snippets', { timeout: 2500 })\n .json<{ data?: AppSnippet[] }>();\n return data ?? [];\n },\n\n /**\n * Per-app public `app.*` buckets, keyed by encoded app id. Timeout-bounded (SSR-awaited):\n * a slow response degrades to empty buckets (fail-open), never strands injection.\n */\n settings: async (): Promise<AppSettings> => {\n const { data } = await api\n .get('apps/snippets/settings', { timeout: 2500 })\n .json<{ data?: Partial<AppSettings> }>();\n return { apps: data?.apps ?? {} };\n },\n\n queries: {\n snippets: () =>\n queryOptions({\n queryKey: ['apps', 'snippets'],\n queryFn: () => apps.snippets(),\n // Snippets are static per session; one fetch per page load is enough.\n staleTime: Infinity,\n // No retry: this is awaited in rootBeforeLoad, so the router's default `retry: 1` would\n // make the SSR wait 2 x the 2500ms timeout (plus backoff) before failing open. The\n // 2500ms timeout must be the whole budget; the client fallback query does the retrying.\n retry: 0,\n }),\n\n settings: () =>\n queryOptions({\n queryKey: ['apps', 'settings'],\n queryFn: () => apps.settings(),\n // Encoded app ids and their buckets are stable per page; one fetch is enough.\n staleTime: Infinity,\n retry: 0,\n }),\n },\n};\n"]}
|