@salla.sa/twilight-theme-engine 1.0.157 → 1.0.159
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-EZBTZ3B7.js → AddToCartForm-X6SVLDEW.js} +3 -3
- package/dist/{AddToCartForm-EZBTZ3B7.js.map → AddToCartForm-X6SVLDEW.js.map} +1 -1
- package/dist/{BlogAuthorPage-MKYARWYL.js → BlogAuthorPage-LHHPMRE7.js} +17 -17
- package/dist/{BlogAuthorPage-MKYARWYL.js.map → BlogAuthorPage-LHHPMRE7.js.map} +1 -1
- package/dist/{BlogCategoryPage-RGW55K6V.js → BlogCategoryPage-EGA42YON.js} +17 -17
- package/dist/{BlogCategoryPage-RGW55K6V.js.map → BlogCategoryPage-EGA42YON.js.map} +1 -1
- package/dist/{BlogPage-3DNO4J33.js → BlogPage-BFUNHES2.js} +15 -15
- package/dist/{BlogPage-3DNO4J33.js.map → BlogPage-BFUNHES2.js.map} +1 -1
- package/dist/{BlogSinglePage-6MHVC5DS.js → BlogSinglePage-AH7BEXFJ.js} +15 -15
- package/dist/{BlogSinglePage-6MHVC5DS.js.map → BlogSinglePage-AH7BEXFJ.js.map} +1 -1
- package/dist/{BlogTagPage-VR7KJYBW.js → BlogTagPage-CYJBWNCT.js} +17 -17
- package/dist/{BlogTagPage-VR7KJYBW.js.map → BlogTagPage-CYJBWNCT.js.map} +1 -1
- package/dist/{BrandsPage-N4ZLUT25.js → BrandsPage-C3BHZJZN.js} +16 -16
- package/dist/{BrandsPage-N4ZLUT25.js.map → BrandsPage-C3BHZJZN.js.map} +1 -1
- package/dist/{Breadcrumb-SKYU5LTC.js → Breadcrumb-7ZOIFMT5.js} +15 -15
- package/dist/{Breadcrumb-SKYU5LTC.js.map → Breadcrumb-7ZOIFMT5.js.map} +1 -1
- package/dist/{CartItem-7EYWYL5G.js → CartItem-RG7STXKL.js} +15 -15
- package/dist/{CartItem-7EYWYL5G.js.map → CartItem-RG7STXKL.js.map} +1 -1
- package/dist/{CartSummary-NTIULTCW.js → CartSummary-QJDYXKAG.js} +15 -15
- package/dist/{CartSummary-NTIULTCW.js.map → CartSummary-QJDYXKAG.js.map} +1 -1
- package/dist/{Copyright-CDKA4EMA.js → Copyright-FUT6D7M5.js} +3 -3
- package/dist/{Copyright-CDKA4EMA.js.map → Copyright-FUT6D7M5.js.map} +1 -1
- package/dist/{CustomerLayout-2CR6DTNL.js → CustomerLayout-GPTFFZ2U.js} +15 -15
- package/dist/{CustomerLayout-2CR6DTNL.js.map → CustomerLayout-GPTFFZ2U.js.map} +1 -1
- package/dist/{Footer-H5IGQ4XE.js → Footer-CP5RCS23.js} +4 -4
- package/dist/{Footer-H5IGQ4XE.js.map → Footer-CP5RCS23.js.map} +1 -1
- package/dist/{Header-SMZTEZE7.js → Header-3Y667NBL.js} +8 -8
- package/dist/{Header-SMZTEZE7.js.map → Header-3Y667NBL.js.map} +1 -1
- package/dist/{LatestProducts-5AZGNQD3.js → LatestProducts-M5QPEJXU.js} +17 -17
- package/dist/{LatestProducts-5AZGNQD3.js.map → LatestProducts-M5QPEJXU.js.map} +1 -1
- package/dist/{LoyaltyPage-35IRDKWX.js → LoyaltyPage-YKMLC5W7.js} +15 -15
- package/dist/{LoyaltyPage-35IRDKWX.js.map → LoyaltyPage-YKMLC5W7.js.map} +1 -1
- package/dist/{LoyaltyPointsPage-2NSTTKWX.js → LoyaltyPointsPage-5L35QSBO.js} +6 -6
- package/dist/{LoyaltyPointsPage-2NSTTKWX.js.map → LoyaltyPointsPage-5L35QSBO.js.map} +1 -1
- package/dist/{MainMenu-RZ4WI2WH.js → MainMenu-SA7YSR4V.js} +5 -5
- package/dist/{MainMenu-RZ4WI2WH.js.map → MainMenu-SA7YSR4V.js.map} +1 -1
- package/dist/{MasterLayout-7HZ2ENBI.js → MasterLayout-YG7C3MSG.js} +15 -15
- package/dist/{MasterLayout-7HZ2ENBI.js.map → MasterLayout-YG7C3MSG.js.map} +1 -1
- package/dist/{MobileMenu-QCY7ZS42.js → MobileMenu-ICBFKICG.js} +16 -16
- package/dist/{MobileMenu-QCY7ZS42.js.map → MobileMenu-ICBFKICG.js.map} +1 -1
- package/dist/{NotificationsPage-ZDJM4WBE.js → NotificationsPage-HCBYJWYP.js} +15 -15
- package/dist/{NotificationsPage-ZDJM4WBE.js.map → NotificationsPage-HCBYJWYP.js.map} +1 -1
- package/dist/{OrderSinglePage-KEME65L6.js → OrderSinglePage-6HK72LN2.js} +16 -16
- package/dist/{OrderSinglePage-KEME65L6.js.map → OrderSinglePage-6HK72LN2.js.map} +1 -1
- package/dist/{OrdersPage-QJ4XAOUS.js → OrdersPage-MUPRAING.js} +15 -15
- package/dist/{OrdersPage-QJ4XAOUS.js.map → OrdersPage-MUPRAING.js.map} +1 -1
- package/dist/{PageSingle-764IZP2N.js → PageSingle-W7PGG3RM.js} +3 -3
- package/dist/{PageSingle-764IZP2N.js.map → PageSingle-W7PGG3RM.js.map} +1 -1
- package/dist/{ProductDetails-ISC73QBQ.js → ProductDetails-K6SCUIUS.js} +4 -4
- package/dist/{ProductDetails-ISC73QBQ.js.map → ProductDetails-K6SCUIUS.js.map} +1 -1
- package/dist/{ProfilePage-DZEJZ5K2.js → ProfilePage-56JY67IJ.js} +15 -15
- package/dist/{ProfilePage-DZEJZ5K2.js.map → ProfilePage-56JY67IJ.js.map} +1 -1
- package/dist/{ReviewsPage-WRQFDJL6.js → ReviewsPage-RR7456GQ.js} +3 -3
- package/dist/{ReviewsPage-WRQFDJL6.js.map → ReviewsPage-RR7456GQ.js.map} +1 -1
- package/dist/{SeoCartWidget-AL2MNWF4.js → SeoCartWidget-HOHZEC3W.js} +15 -15
- package/dist/{SeoCartWidget-AL2MNWF4.js.map → SeoCartWidget-HOHZEC3W.js.map} +1 -1
- package/dist/{SettingsPage-MWY4X26Y.js → SettingsPage-QYGZGYQL.js} +15 -15
- package/dist/{SettingsPage-MWY4X26Y.js.map → SettingsPage-QYGZGYQL.js.map} +1 -1
- package/dist/{StoreClosedNotification-ZT7HNX4O.js → StoreClosedNotification-QDS5TEKT.js} +16 -16
- package/dist/{StoreClosedNotification-ZT7HNX4O.js.map → StoreClosedNotification-QDS5TEKT.js.map} +1 -1
- package/dist/{TestimonialsPage-AYMTOENI.js → TestimonialsPage-VAHKCNAM.js} +3 -3
- package/dist/{TestimonialsPage-AYMTOENI.js.map → TestimonialsPage-VAHKCNAM.js.map} +1 -1
- package/dist/{ThankYouPage-EEOD7PKW.js → ThankYouPage-BHQYMGGF.js} +15 -15
- package/dist/{ThankYouPage-EEOD7PKW.js.map → ThankYouPage-BHQYMGGF.js.map} +1 -1
- package/dist/{WalletPage-ZK7TH2KC.js → WalletPage-4IDD3FKM.js} +16 -16
- package/dist/{WalletPage-ZK7TH2KC.js.map → WalletPage-4IDD3FKM.js.map} +1 -1
- package/dist/{WebMcpTools-IOY5SM5G.js → WebMcpTools-FELJCRTD.js} +5 -5
- package/dist/{WebMcpTools-IOY5SM5G.js.map → WebMcpTools-FELJCRTD.js.map} +1 -1
- package/dist/{WishlistPage-PHJQUNFK.js → WishlistPage-PQ3IMOAN.js} +17 -17
- package/dist/{WishlistPage-PHJQUNFK.js.map → WishlistPage-PQ3IMOAN.js.map} +1 -1
- package/dist/api/advertisement.js +2 -2
- package/dist/api/apps.js +2 -2
- package/dist/api/blog.js +3 -3
- package/dist/api/brands.js +3 -3
- package/dist/api/cart.js +3 -3
- package/dist/api/category.js +3 -3
- package/dist/api/client.js +1 -1
- package/dist/api/home.js +2 -2
- package/dist/api/loyalty.js +3 -3
- package/dist/api/menu.js +2 -2
- package/dist/api/notification.js +2 -2
- package/dist/api/order.js +3 -3
- package/dist/api/page.js +3 -3
- package/dist/api/product.js +3 -3
- package/dist/api/profile.js +1 -1
- package/dist/api/store.js +3 -3
- 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-MZN3JEIY.js → chunk-2DXJQQL3.js} +3 -3
- package/dist/{chunk-MZN3JEIY.js.map → chunk-2DXJQQL3.js.map} +1 -1
- package/dist/{chunk-RVRNTDXM.js → chunk-3A6OZTAZ.js} +5 -5
- package/dist/{chunk-RVRNTDXM.js.map → chunk-3A6OZTAZ.js.map} +1 -1
- package/dist/{chunk-BGBZXKRA.js → chunk-4ABYIKK7.js} +3 -3
- package/dist/{chunk-BGBZXKRA.js.map → chunk-4ABYIKK7.js.map} +1 -1
- package/dist/{chunk-2ES4KKNM.js → chunk-5RVVQZ4O.js} +3 -3
- package/dist/{chunk-2ES4KKNM.js.map → chunk-5RVVQZ4O.js.map} +1 -1
- package/dist/{chunk-R4W4BHEK.js → chunk-66SUDAT7.js} +3 -3
- package/dist/{chunk-R4W4BHEK.js.map → chunk-66SUDAT7.js.map} +1 -1
- package/dist/{chunk-OPYPTTRI.js → chunk-6XUP6FRY.js} +3 -3
- package/dist/{chunk-OPYPTTRI.js.map → chunk-6XUP6FRY.js.map} +1 -1
- package/dist/{chunk-VGP7RUO4.js → chunk-7DCTHZPD.js} +4 -4
- package/dist/{chunk-VGP7RUO4.js.map → chunk-7DCTHZPD.js.map} +1 -1
- package/dist/{chunk-VR4KFSHQ.js → chunk-BEPNPQEH.js} +4 -4
- package/dist/{chunk-VR4KFSHQ.js.map → chunk-BEPNPQEH.js.map} +1 -1
- package/dist/{chunk-CLBUKYD5.js → chunk-BSJJO3MF.js} +4 -4
- package/dist/{chunk-CLBUKYD5.js.map → chunk-BSJJO3MF.js.map} +1 -1
- package/dist/{chunk-PBQ2KJHF.js → chunk-DB4IM7DO.js} +4 -4
- package/dist/{chunk-PBQ2KJHF.js.map → chunk-DB4IM7DO.js.map} +1 -1
- package/dist/{chunk-VR6L6RQ6.js → chunk-ECTZFDOB.js} +3 -3
- package/dist/{chunk-VR6L6RQ6.js.map → chunk-ECTZFDOB.js.map} +1 -1
- package/dist/{chunk-56MUKMAH.js → chunk-FYXP35LM.js} +3 -3
- package/dist/{chunk-56MUKMAH.js.map → chunk-FYXP35LM.js.map} +1 -1
- package/dist/{chunk-W3JEFUIX.js → chunk-IYLOAA2K.js} +4 -4
- package/dist/{chunk-W3JEFUIX.js.map → chunk-IYLOAA2K.js.map} +1 -1
- package/dist/{chunk-QHGGRMC5.js → chunk-IYS7T6DQ.js} +4 -4
- package/dist/{chunk-QHGGRMC5.js.map → chunk-IYS7T6DQ.js.map} +1 -1
- package/dist/{chunk-BYSW626W.js → chunk-JJENRYMB.js} +3 -3
- package/dist/{chunk-BYSW626W.js.map → chunk-JJENRYMB.js.map} +1 -1
- package/dist/{chunk-VGSV76FZ.js → chunk-K2447HJF.js} +4 -4
- package/dist/{chunk-VGSV76FZ.js.map → chunk-K2447HJF.js.map} +1 -1
- package/dist/{chunk-C5ZVACBI.js → chunk-KF3EZPSU.js} +5 -5
- package/dist/{chunk-C5ZVACBI.js.map → chunk-KF3EZPSU.js.map} +1 -1
- package/dist/{chunk-TVSQH6T7.js → chunk-LK643DPN.js} +2 -2
- package/dist/{chunk-TVSQH6T7.js.map → chunk-LK643DPN.js.map} +1 -1
- package/dist/{chunk-OGXW62G2.js → chunk-LLENIPV6.js} +3 -3
- package/dist/{chunk-OGXW62G2.js.map → chunk-LLENIPV6.js.map} +1 -1
- package/dist/{chunk-NZLXLD6E.js → chunk-M4HYFYKZ.js} +7 -7
- package/dist/{chunk-NZLXLD6E.js.map → chunk-M4HYFYKZ.js.map} +1 -1
- package/dist/{chunk-GWD4QYN3.js → chunk-MQ232EVE.js} +3 -3
- package/dist/{chunk-GWD4QYN3.js.map → chunk-MQ232EVE.js.map} +1 -1
- package/dist/{chunk-NFUQGLKY.js → chunk-NFVG2U3B.js} +5 -5
- package/dist/{chunk-NFUQGLKY.js.map → chunk-NFVG2U3B.js.map} +1 -1
- package/dist/{chunk-DS7RAJK5.js → chunk-NP4QCQRR.js} +3 -3
- package/dist/{chunk-DS7RAJK5.js.map → chunk-NP4QCQRR.js.map} +1 -1
- package/dist/{chunk-GXFHRCHN.js → chunk-NW2P3GB5.js} +3 -3
- package/dist/{chunk-GXFHRCHN.js.map → chunk-NW2P3GB5.js.map} +1 -1
- package/dist/{chunk-FUA3JWQN.js → chunk-OGUQUI7R.js} +3 -3
- package/dist/{chunk-FUA3JWQN.js.map → chunk-OGUQUI7R.js.map} +1 -1
- package/dist/{chunk-LIDZ5ONW.js → chunk-PEIVM62H.js} +3 -3
- package/dist/{chunk-LIDZ5ONW.js.map → chunk-PEIVM62H.js.map} +1 -1
- package/dist/{chunk-SQJGSORP.js → chunk-PLJML6HL.js} +3 -3
- package/dist/{chunk-SQJGSORP.js.map → chunk-PLJML6HL.js.map} +1 -1
- package/dist/{chunk-FGL7ZLGW.js → chunk-PT4RFLWI.js} +7 -7
- package/dist/{chunk-FGL7ZLGW.js.map → chunk-PT4RFLWI.js.map} +1 -1
- package/dist/{chunk-GEL3TAZ6.js → chunk-QC3KTR3R.js} +3 -3
- package/dist/{chunk-GEL3TAZ6.js.map → chunk-QC3KTR3R.js.map} +1 -1
- package/dist/{chunk-MGR3VFCX.js → chunk-QQYYOHJC.js} +7 -7
- package/dist/{chunk-MGR3VFCX.js.map → chunk-QQYYOHJC.js.map} +1 -1
- package/dist/{chunk-UAG25J4R.js → chunk-SQ3U67TT.js} +3 -3
- package/dist/{chunk-UAG25J4R.js.map → chunk-SQ3U67TT.js.map} +1 -1
- package/dist/{chunk-Q2IR5QOJ.js → chunk-SZGEJZIT.js} +3 -3
- package/dist/{chunk-Q2IR5QOJ.js.map → chunk-SZGEJZIT.js.map} +1 -1
- package/dist/{chunk-3XWB4KR6.js → chunk-TCOC7YLE.js} +4 -4
- package/dist/{chunk-3XWB4KR6.js.map → chunk-TCOC7YLE.js.map} +1 -1
- package/dist/{chunk-VVYX3JGV.js → chunk-TWWYSYDK.js} +4 -4
- package/dist/{chunk-VVYX3JGV.js.map → chunk-TWWYSYDK.js.map} +1 -1
- package/dist/{chunk-DJFNTWSZ.js → chunk-UVLTXD4S.js} +4 -4
- package/dist/{chunk-DJFNTWSZ.js.map → chunk-UVLTXD4S.js.map} +1 -1
- package/dist/{chunk-BUYOH3KR.js → chunk-VMBCLCL2.js} +4 -4
- package/dist/{chunk-BUYOH3KR.js.map → chunk-VMBCLCL2.js.map} +1 -1
- package/dist/{chunk-JIEQ5XIF.js → chunk-XRQL54BO.js} +4 -4
- package/dist/{chunk-JIEQ5XIF.js.map → chunk-XRQL54BO.js.map} +1 -1
- package/dist/{chunk-W35Z2YSD.js → chunk-Y623G24S.js} +4 -4
- package/dist/{chunk-W35Z2YSD.js.map → chunk-Y623G24S.js.map} +1 -1
- package/dist/{chunk-EZ3I3BFJ.js → chunk-YEEJBFG3.js} +12 -12
- package/dist/chunk-YEEJBFG3.js.map +1 -0
- package/dist/{chunk-CZUHI5CR.js → chunk-Z7YTSWQQ.js} +16 -16
- package/dist/{chunk-CZUHI5CR.js.map → chunk-Z7YTSWQQ.js.map} +1 -1
- package/dist/{chunk-22MU63B3.js → chunk-ZQO2VYPQ.js} +4 -4
- package/dist/{chunk-22MU63B3.js.map → chunk-ZQO2VYPQ.js.map} +1 -1
- package/dist/{chunk-6A6C2AMC.js → chunk-ZXNP577V.js} +7 -7
- package/dist/{chunk-6A6C2AMC.js.map → chunk-ZXNP577V.js.map} +1 -1
- package/dist/components/cart/index.js +1 -1
- package/dist/components/common/index.js +1 -1
- package/dist/components/drawer/index.js +13 -13
- package/dist/components/home/index.js +18 -18
- package/dist/components/layout/index.js +4 -4
- package/dist/components/product/index.js +15 -15
- package/dist/components/store/index.js +14 -14
- package/dist/dev/editor/index.js +1 -1
- package/dist/dev/index.js +1 -1
- package/dist/{document-class-ZUEILHOS.js → document-class-PITQNXR5.js} +13 -13
- package/dist/{document-class-ZUEILHOS.js.map → document-class-PITQNXR5.js.map} +1 -1
- package/dist/hooks/index.js +13 -13
- package/dist/hooks/useGtm.js +13 -13
- package/dist/hooks/useMoney.js +13 -13
- package/dist/hooks/useStore.js +13 -13
- package/dist/hooks/useUser.js +3 -3
- package/dist/index.js +13 -13
- package/dist/{navigation-5TZFA37U.js → navigation-I64B7LBN.js} +5 -5
- package/dist/{navigation-5TZFA37U.js.map → navigation-I64B7LBN.js.map} +1 -1
- package/dist/{navigation-NNDRNWCN.js → navigation-UPEJLRYJ.js} +4 -4
- package/dist/{navigation-NNDRNWCN.js.map → navigation-UPEJLRYJ.js.map} +1 -1
- package/dist/{not-found-EOFG5E22.js → not-found-UOG7ZU3E.js} +16 -16
- package/dist/{not-found-EOFG5E22.js.map → not-found-UOG7ZU3E.js.map} +1 -1
- package/dist/providers/index.js +13 -13
- 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 +22 -22
- package/dist/routes/home.js +19 -19
- 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 +23 -23
- package/dist/routes/product.js +18 -18
- package/dist/routes/root/beforeLoad.d.ts +2 -2
- 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 +19 -19
- package/dist/{store-lookup-IFUNRW7U.js → store-lookup-A47YUEPQ.js} +8 -8
- package/dist/{store-lookup-IFUNRW7U.js.map → store-lookup-A47YUEPQ.js.map} +1 -1
- package/dist/tanstack/middleware/twilight.d.ts +21 -9
- package/dist/tanstack/middleware/twilight.d.ts.map +1 -1
- package/dist/tanstack/templates/locale-wrapper.d.ts.map +1 -1
- package/dist/tanstack.js +22 -20
- package/dist/tanstack.js.map +1 -1
- package/dist/utils/index.js +2 -2
- package/dist/utils/maintenance.d.ts +3 -3
- package/dist/vite/index.js +46 -2
- package/dist/vite/index.js.map +1 -1
- package/package.json +1 -1
- package/tailwind/routes/root/beforeLoad.ts.txt +2 -2
- package/dist/chunk-EZ3I3BFJ.js.map +0 -1
package/dist/tanstack.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/tanstack/stylesheet.tsx","../src/tanstack/middleware/store-not-found.ts","../src/tanstack/middleware/twilight.ts","../src/tanstack/middleware/earlyHints.ts"],"names":["createMiddleware"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeA,IAAM,gBAAA,GAAmB,MAAM,MAAM;AAAC,CAAA;AAG/B,SAAS,gBAAgB,EAAE,IAAA,EAAM,QAAA,GAAW,IAAG,EAAyB;AAC7E,EAAA,MAAM,UAAU,cAAA,CAAe;AAAA,IAC7B,MAAA,EAAQ,CAAC,KAAA,KACP,KAAA,CAAM,QAAQ,IAAA,CAAK,CAAC,KAAA,KAAU,MAAA,CAAO,MAAA,CAAO,QAAA,EAAU,KAAA,CAAM,OAAO,CAAC,CAAA,EAAG;AAAA,GAC1E,CAAA;AAED,EAAA,MAAM,CAAC,aAAa,CAAA,GAAI,QAAA,CAAS,OAAO,CAAA;AACxC,EAAA,MAAM,QAAA,GAAW,oBAAA;AAAA,IACf,gBAAA;AAAA,IACA,MAAM,IAAA;AAAA,IACN,MAAM;AAAA,GACR;AAEA,EAAA,uBACE,IAAA,CAAA,QAAA,EAAA,EACG,QAAA,EAAA;AAAA,IAAA,aAAA;AAAA,oBAEC,GAAA,CAAC,WAAM,IAAA,EAAM,mBAAA,EAAqB,YAAW,UAAA,EAC1C,QAAA,EAAA,QAAA,CAAS,aAAa,CAAA,EACzB,CAAA;AAAA,IAAA,CAEA,CAAC,aAAA,IAAiB,QAAA,qBAClB,GAAA,CAAC,MAAA,EAAA,EAAK,EAAA,EAAG,iBAAA,EAAkB,GAAA,EAAI,YAAA,EAAa,IAAA,EAAY,UAAA,EAAW,SAAA,EAAU,CAAA;AAAA,IAE9E,aAAA,wBACE,UAAA,EAAA,EACC,QAAA,kBAAA,GAAA,CAAC,UAAK,GAAA,EAAI,YAAA,EAAa,MAAY,CAAA,EACrC;AAAA,GAAA,EAEJ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C;AAEA,IAAA,OAAO,IAAI,QAAA,CAAS,QAAA,CAAS,IAAA,EAAM;AAAA,MACjC,QAAQ,QAAA,CAAS,MAAA;AAAA,MACjB,YAAY,QAAA,CAAS,UAAA;AAAA,MACrB;AAAA,KACD,CAAA;AAAA,EACH,CAAC,CAAA;AACH","file":"tanstack.js","sourcesContent":["import { useState, useSyncExternalStore } from 'react';\nimport { Asset, useRouter, useRouterState, useTags } from '@tanstack/react-router';\nimport { CRITICAL_STYLE_HREF } from '../boot/critical-style';\n\nexport interface ThemeStylesheetProps {\n /** The full stylesheet's URL (`app.css?url`). */\n href: string;\n /**\n * Inline critical CSS by route id. A page server-rendered as one of these routes paints from it,\n * and `bootClient` adds `href` once its first screen has painted. Pass the same route ids on the\n * client with empty strings, so hydration renders the same tags without shipping the CSS twice.\n */\n critical?: Readonly<Record<string, string>>;\n}\n\nconst subscribeNothing = () => () => {};\n\n/** The theme's stylesheet: inline critical CSS for the routes that have it, the full sheet otherwise. */\nexport function ThemeStylesheet({ href, critical = {} }: ThemeStylesheetProps) {\n const routeId = useRouterState({\n select: (state): string | undefined =>\n state.matches.find((match) => Object.hasOwn(critical, match.routeId))?.routeId,\n });\n // The route the page was server-rendered as: never added or removed on client-side navigations.\n const [criticalRoute] = useState(routeId);\n const hydrated = useSyncExternalStore(\n subscribeNothing,\n () => true,\n () => false\n );\n\n return (\n <>\n {criticalRoute && (\n // Its own precedence, so it lands before the full sheet; React renders the CSS verbatim.\n <style href={CRITICAL_STYLE_HREF} precedence=\"critical\">\n {critical[criticalRoute]}\n </style>\n )}\n {(!criticalRoute || hydrated) && (\n <link id=\"salla-theme-css\" rel=\"stylesheet\" href={href} precedence=\"default\" />\n )}\n {criticalRoute && (\n <noscript>\n <link rel=\"stylesheet\" href={href} />\n </noscript>\n )}\n </>\n );\n}\n\n/** The route's head tags without module preloads: they raced the LCP image, and the entry loads every chunk anyway. */\nexport function ThemeHeadContent() {\n const tags = useTags();\n const nonce = useRouter().options.ssr?.nonce;\n return tags\n .filter((tag) => !(tag.tag === 'link' && tag.attrs?.rel === 'modulepreload'))\n .map((tag) => <Asset {...tag} key={`tsr-meta-${JSON.stringify(tag)}`} nonce={nonce} />);\n}\n","/**\n * Which address was not found, as Twig's `checkUsername` (SallaApp/Store) tells them\n * apart: a store the request named (a username, `?storeId=`), or the domain itself.\n */\nexport type StoreNotFoundKind = 'store' | 'domain';\n\n/** Twig's copy (`error::errors.<kind>.not_found_*`). Arabic in every language, as there. */\nconst COPY: Record<StoreNotFoundKind, { title: string; message: string }> = {\n store: {\n title: 'المتجر غير موجود!',\n message: 'نأسف هذا المتجر غير موجود حاليا!.',\n },\n domain: {\n title: 'نطاق المتجر غير موجود!',\n message: 'نأسف نطاق المتجر المطلوب غير موجود حاليا!.',\n },\n};\n\n/**\n * The page Twig answers with a 410 when no store has the address it was asked for,\n * with what a visitor sees kept: the same markup and the same stylesheet. Dropped: the\n * feedback form, which Twig renders hidden, and the jQuery and legacy scripts behind\n * it. `iframe-embed` is on `<body>` from the start because Twig's script adds it on\n * every load, and it is what hides the `body--bg` background; the empty `msg-container`\n * keeps the block where Twig's sits. The link goes to merchant sign-up on s.salla.sa;\n * Twig's relative `/register` would reach the theme on any host but salla.sa.\n *\n * One constant document, and only {@link COPY} is ever put into it: nothing from the\n * request reaches this page.\n */\nconst PAGE = `<!DOCTYPE html>\n<html lang=\"ar\" dir=\"rtl\">\n<head>\n<meta charset=\"UTF-8\">\n<meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1, shrink-to-fit=no\">\n<meta name=\"theme-color\" content=\"#37a495\">\n<meta name=\"author\" content=\"منصة سلة\">\n<meta name=\"robots\" content=\"noindex, follow\">\n<meta name=\"copyright\" content=\"Salla.sa\">\n<title>{title}</title>\n<link rel=\"icon\" type=\"image/png\" href=\"https://cdn.salla.network/images/logo/logo-square.png\">\n<link rel=\"apple-touch-icon-precomposed\" href=\"https://cdn.salla.network/images/logo/logo-square.png\">\n<link rel=\"stylesheet\" href=\"https://cdn.salla.network/fonts/pingarlt.css?v=0.2\">\n<link rel=\"stylesheet\" href=\"https://cdn.assets.salla.network/prod/stores/vendor/salla/errors/css/app.css?id=0d7e71fbf018a0d5c478129a56c7a71f\">\n</head>\n<body class=\"body body--rtl body--bg iframe-embed\">\n<header id=\"header\" class=\"header header--404\"></header>\n<main id=\"main\" class=\"main main--404\">\n<div class=\"container container--wide\">\n<div class=\"e404-container\">\n<div class=\"landing\">\n<h1 class=\"title title--giant title--404\"><img src=\"https://cdn.assets.salla.network/prod/stores/vendor/salla/errors/images/error.svg\" alt=\"\"/> 410</h1>\n<h3>{title}</h3>\n<p>{message}<br> بإمكانك العودة للصفحة لرئيسية أو التسجيل للتمتع بمتجر رائع!</p>\n<a href=\"https://s.salla.sa/register\">سجل متجرك الأن</a>\n</div>\n</div>\n<div class=\"form-group msg-container\"></div>\n</div>\n</main>\n<footer id=\"footer\" class=\"footer\"></footer>\n</body>\n</html>\n`;\n\n/** Twig's 410 page for `kind`. */\nexport function storeNotFoundPage(kind: StoreNotFoundKind): string {\n const { title, message } = COPY[kind];\n return PAGE.replaceAll('{title}', title).replace('{message}', message);\n}\n\n/** {@link storeNotFoundPage} as Twig sends it: a 410 that no cache keeps. */\nexport function storeNotFoundResponse(kind: StoreNotFoundKind): Response {\n return new Response(storeNotFoundPage(kind), {\n status: 410,\n headers: {\n 'content-type': 'text/html; charset=UTF-8',\n 'cache-control': 'max-age=0, must-revalidate, no-cache, no-store, private',\n },\n });\n}\n","import type { AnyRequestMiddleware } from '@tanstack/react-start';\nimport { createMiddleware } from '@tanstack/react-start';\nimport {\n extractTokenFromCookies,\n resolveAddressedStore,\n resolveRequestScope,\n resolveRequestVersionId,\n AUTH_TOKEN_COOKIE_NAME,\n STORE_BASE_HEADER,\n} from '../../utils/cookies';\nimport { getTwilightContext, runWithTwilightContext } from '../../twilight/context';\nimport type { StoreContext } from '../../api/store';\nimport {\n MAINTENANCE_EVIDENCE_HEADER,\n maintenanceEvidence,\n maintenanceEvidenceHeader,\n} from '../../utils/maintenance';\nimport { requestHostOf } from '../../utils/request-host';\nimport { legacyLocaleRedirectHref } from '../../utils/store-base';\nimport { readNativeAppHeaders } from '../../utils/native-app-headers';\nimport { storeNotFoundResponse } from './store-not-found';\n\n/**\n * A 503 for the maintenance page, so search engines read it as temporary and keep\n * the store indexed. TanStack sets the SSR status from the router alone (200, 404,\n * 500) and ignores `setResponseStatus`, so the status is applied here, on the\n * response the render produced, from the decision `rootBeforeLoad` left in the\n * request context. Only a 200 is rewritten: a redirect or an error keeps its own.\n *\n * `next()` resolves to the middleware context, whose `response` is the render; a\n * bare `Response` is accepted too. The rewrite keeps the body stream, so TanStack\n * treats it as the same response rather than a replacement to cancel.\n */\nexport function withMaintenanceStatus<T>(result: T): T | Response {\n const response =\n result instanceof Response\n ? result\n : (result as { response?: unknown } | null)?.response instanceof Response\n ? ((result as { response: Response }).response as Response)\n : null;\n if (!response || response.status !== 200 || !getTwilightContext().maintenance) return result;\n const unavailable = new Response(response.body, {\n status: 503,\n statusText: 'Service Unavailable',\n headers: response.headers,\n });\n stampMaintenanceEvidence(unavailable.headers);\n return result instanceof Response ? unavailable : { ...result, response: unavailable };\n}\n\n/**\n * Says on the 503 which settings answer closed the store, and logs it once.\n *\n * The page is for everyone but the merchant, so it is usually the merchant's own\n * store state; when it is not (503s interleaved with 200s on one store), the\n * answer's trace and cache status are what settle it. The Store's trace goes in\n * `x-trace-id`, which the dispatcher already logs for a 5xx.\n */\nfunction stampMaintenanceEvidence(headers: Headers): void {\n let settings: StoreContext | undefined;\n try {\n settings = getTwilightContext().settings;\n } catch {\n return;\n }\n const evidence = maintenanceEvidence(settings);\n if (!Object.keys(evidence).length) return;\n headers.set(MAINTENANCE_EVIDENCE_HEADER, maintenanceEvidenceHeader(evidence));\n if (evidence.trace) headers.set('x-trace-id', evidence.trace);\n console.warn('[twilight] maintenance page', {\n ...evidence,\n title: settings?.maintenance_details?.title,\n });\n}\n\n/**\n * Twig's 410 page in place of the render, once rootBeforeLoad has learned that no store\n * has this request's identifier: there is no store to render, so nothing of it is kept.\n * The page says \"domain\" when the host was the identifier (nothing in the request named\n * a store), as Twig's `checkUsername` does for a host that is not salla.sa.\n *\n * A render that threw is answered the same way. A theme's shell renders even when the\n * root route failed, and one that reads the settings there throws, which h3 would\n * otherwise answer with a bare `{\"status\":500,\"unhandled\":true}`.\n */\nexport function withStoreNotFoundPage<T>(result: T): T | Response {\n if (!getTwilightContext().storeNotFound) return result;\n const page = storeNotFoundAnswer();\n const carried = (result as { response?: unknown } | null)?.response;\n return carried instanceof Response ? { ...result, response: page } : page;\n}\n\n/** The render's failure, unless {@link withStoreNotFoundPage} has an answer for it. */\nexport function storeNotFoundOrThrow(error: unknown): Response {\n if (getTwilightContext().storeNotFound) return storeNotFoundAnswer();\n throw error;\n}\n\n/** A store the request named (`?storeId=`, a path segment, a username), else the host's. */\nfunction storeNotFoundAnswer(): Response {\n const { storeId, storeBase } = getTwilightContext();\n return storeNotFoundResponse(storeId || storeBase ? 'store' : 'domain');\n}\n\ninterface TwilightMiddlewareOptions {\n cookieName?: string;\n}\n\nexport const twilightMiddleware = (options?: TwilightMiddlewareOptions): AnyRequestMiddleware => {\n const cookieName = options?.cookieName ?? AUTH_TOKEN_COOKIE_NAME;\n\n return createMiddleware().server(async ({ request, next }) => {\n const cookieHeader = request.headers.get('Cookie');\n const authToken = extractTokenFromCookies(cookieHeader, cookieName);\n // `?scope=` before the cookie: it is how a market is switched (see resolveRequestScope).\n const scope = resolveRequestScope(request.url, cookieHeader);\n const requestHost = requestHostOf(request);\n // Read here and nowhere else: a deployed theme worker has no vars and no\n // bindings, so the request is the only thing that knows which store it is\n // serving. Everything downstream reads it off the context rather than\n // reaching for a build-time constant that is not there in production.\n //\n // The host goes in because it decides whether the request is allowed to name\n // a store at all. On a merchant's own domain it is not: the hostname is the\n // store, and `?storeId=` there would serve a stranger's shop from a domain\n // its owner controls.\n //\n // On those same hosts the store is also the first segment of the path, the\n // root of every URL there, and a store named that way takes the cookie's\n // place: the path is the address the visitor can see.\n //\n // On a Salla shared host the dispatcher names the store instead, from the\n // segment after the locale, and that is where it stays in every URL.\n const { storeId, storeBase, storeBaseFollowsLocale } = resolveAddressedStore(\n request.url,\n cookieHeader,\n requestHost,\n request.headers.get(STORE_BASE_HEADER)\n );\n // The version is read here for the same reason and behind the same gate. A\n // theme editor previews a draft version of a merchant's settings before it is\n // published, and a partner running the theme locally renders against one —\n // both open the storefront in an iframe and say which version in the URL.\n const versionId = resolveRequestVersionId(request.url, cookieHeader, requestHost);\n const nativeAppHeaders = readNativeAppHeaders(request.headers);\n\n // A shared host's address has no language in it any more: `/dev-x/cart`, not\n // `/ar/dev-x/cart`. An old link is sent to the new one once, keeping its language as\n // `?lang=`. Only a page load is redirected; anything else is answered as asked.\n if (\n storeBase &&\n storeBaseFollowsLocale &&\n (request.method === 'GET' || request.method === 'HEAD')\n ) {\n const location = legacyLocaleRedirectHref(request.url, storeBase);\n if (location) return new Response(null, { status: 302, headers: { Location: location } });\n }\n\n const response = await runWithTwilightContext(\n {\n authToken,\n scope,\n storeId,\n storeBase,\n storeBaseFollowsLocale,\n versionId,\n requestHost,\n nativeAppHeaders,\n },\n () => {\n const result = next({ context: { authToken } });\n const settle = <R>(rendered: R) => withMaintenanceStatus(withStoreNotFoundPage(rendered));\n // The continuation stays in this request's scope: it was registered inside `run`.\n return result instanceof Promise\n ? result.then(settle, storeNotFoundOrThrow)\n : settle(result);\n }\n );\n // On a shared host the same URL is answered in the language the `s-lang` cookie names, so\n // a cache in front of the worker must not serve one visitor's page to another.\n return storeBaseFollowsLocale ? varyOnCookie(response) : response;\n });\n};\n\n/** A copy of `response` with `Vary: Cookie` added (the original's headers may be immutable). */\nfunction withVaryCookie(response: Response): Response {\n const headers = new Headers(response.headers);\n headers.append('Vary', 'Cookie');\n return new Response(response.body, {\n status: response.status,\n statusText: response.statusText,\n headers,\n });\n}\n\n/**\n * Adds `Vary: Cookie` to what `next()` produced: its result carries the page's `response`,\n * and a middleware may also pass a bare `Response` through. Anything else is left as it is.\n */\nfunction varyOnCookie<T>(result: T): T {\n if (result instanceof Response) return withVaryCookie(result) as T;\n const carried = (result as { response?: unknown } | null)?.response;\n if (carried instanceof Response) {\n (result as { response: Response }).response = withVaryCookie(carried);\n }\n return result;\n}\n","import type { AnyRequestMiddleware } from '@tanstack/react-start';\nimport { createMiddleware } from '@tanstack/react-start';\nimport { tsrStartManifest } from 'tanstack-start-manifest:v';\nimport { rootHead } from '../../routes/root/head';\n\n/** Known critical assets that should always be preloaded */\nconst CRITICAL_ASSETS = [\n { rel: 'preconnect', href: 'https://api.salla.dev' },\n { rel: 'preconnect', href: 'https://cdn.salla.sa' },\n { rel: 'preconnect', href: 'https://cdn.assets.salla.network', crossOrigin: 'anonymous' },\n { rel: 'preconnect', href: 'https://fonts.gstatic.com', crossOrigin: 'anonymous' },\n] as const;\n\n/** Extract locale from URL path (e.g., /ar/products → 'ar') */\nfunction extractLocale(url: string): string | undefined {\n const match = url.match(/^\\/([a-z]{2})(\\/|$)/);\n return match?.[1];\n}\n\n/** Build Link header value from a link descriptor */\nfunction buildLinkHeader(link: Record<string, unknown>): string | null {\n const href = link.href as string | undefined;\n const rel = link.rel as string | undefined;\n if (!href || !rel) return null;\n\n // Skip print-media stylesheets (already non-blocking)\n if (rel === 'stylesheet') {\n const media = link.media as string | undefined;\n if (media === 'print') return null;\n return `<${href}>; rel=preload; as=style`;\n }\n\n if (rel === 'preload') {\n const asType = link.as as string | undefined;\n if (!asType) return null;\n const parts = [`<${href}>`, 'rel=preload', `as=${asType}`];\n if (asType === 'font' || link.crossOrigin) {\n parts.push('crossorigin');\n }\n return parts.join('; ');\n }\n\n if (rel === 'modulepreload') {\n return `<${href}>; rel=modulepreload`;\n }\n\n return null;\n}\n\nexport const earlyHintsMiddleware = (): AnyRequestMiddleware => {\n let cachedManifestPaths: string[] | null = null;\n\n return createMiddleware().server(async ({ request, next }) => {\n const response = await next();\n\n const accept = request.headers.get('Accept') ?? '';\n if (!accept.includes('text/html') && accept !== '*/*') return response;\n if (!(response instanceof Response)) return response;\n\n const linkHeaders: string[] = [];\n\n // 1. Add critical assets from rootHead (fonts, icons, SDK, etc.)\n try {\n const url = new URL(request.url);\n const locale = extractLocale(url.pathname);\n if (locale) {\n const headResult = rootHead({ params: { locale } });\n const links = (headResult.links as Record<string, unknown>[]) ?? [];\n for (const link of links) {\n const header = buildLinkHeader(link);\n if (header) linkHeaders.push(header);\n }\n }\n } catch (e) {\n // rootHead failed — log why, then fall back to known critical assets\n console.warn('[earlyHints] rootHead failed:', e instanceof Error ? e.message : e);\n for (const asset of CRITICAL_ASSETS) {\n const co = 'crossOrigin' in asset ? asset.crossOrigin : undefined;\n linkHeaders.push(`<${asset.href}>; rel=${asset.rel}${co ? '; crossorigin' : ''}`);\n }\n }\n\n // 2. Add CSS from TanStack Start manifest (bundled theme CSS)\n if (!cachedManifestPaths) {\n try {\n const manifest = tsrStartManifest();\n const rootAssets = manifest.routes['__root__']?.assets ?? [];\n const seen = new Set<string>();\n cachedManifestPaths = [];\n for (const asset of rootAssets) {\n if (asset.tag === 'link' && asset.attrs?.href?.endsWith('.css')) {\n if (!seen.has(asset.attrs.href)) {\n seen.add(asset.attrs.href);\n cachedManifestPaths.push(asset.attrs.href);\n }\n }\n }\n } catch (e) {\n // manifest not available — skip\n console.warn('[earlyHints] tsrStartManifest failed:', e instanceof Error ? e.message : e);\n }\n }\n\n if (cachedManifestPaths) {\n for (const href of cachedManifestPaths) {\n linkHeaders.push(`<${href}>; rel=preload; as=style`);\n }\n }\n\n // Apply Link headers if we have any\n if (linkHeaders.length === 0) {\n console.warn('[earlyHints] no critical assets found — no Link headers added');\n return response;\n }\n\n const headers = new Headers(response.headers);\n for (const linkHeader of linkHeaders) {\n headers.append('Link', linkHeader);\n }\n\n return new Response(response.body, {\n status: response.status,\n statusText: response.statusText,\n headers,\n });\n });\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/tanstack/stylesheet.tsx","../src/tanstack/middleware/store-not-found.ts","../src/tanstack/middleware/twilight.ts","../src/tanstack/middleware/earlyHints.ts"],"names":["createMiddleware"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeA,IAAM,gBAAA,GAAmB,MAAM,MAAM;AAAC,CAAA;AAG/B,SAAS,gBAAgB,EAAE,IAAA,EAAM,QAAA,GAAW,IAAG,EAAyB;AAC7E,EAAA,MAAM,UAAU,cAAA,CAAe;AAAA,IAC7B,MAAA,EAAQ,CAAC,KAAA,KACP,KAAA,CAAM,QAAQ,IAAA,CAAK,CAAC,KAAA,KAAU,MAAA,CAAO,MAAA,CAAO,QAAA,EAAU,KAAA,CAAM,OAAO,CAAC,CAAA,EAAG;AAAA,GAC1E,CAAA;AAED,EAAA,MAAM,CAAC,aAAa,CAAA,GAAI,QAAA,CAAS,OAAO,CAAA;AACxC,EAAA,MAAM,QAAA,GAAW,oBAAA;AAAA,IACf,gBAAA;AAAA,IACA,MAAM,IAAA;AAAA,IACN,MAAM;AAAA,GACR;AAEA,EAAA,uBACE,IAAA,CAAA,QAAA,EAAA,EACG,QAAA,EAAA;AAAA,IAAA,aAAA;AAAA,oBAEC,GAAA,CAAC,WAAM,IAAA,EAAM,mBAAA,EAAqB,YAAW,UAAA,EAC1C,QAAA,EAAA,QAAA,CAAS,aAAa,CAAA,EACzB,CAAA;AAAA,IAAA,CAEA,CAAC,aAAA,IAAiB,QAAA,qBAClB,GAAA,CAAC,MAAA,EAAA,EAAK,EAAA,EAAG,iBAAA,EAAkB,GAAA,EAAI,YAAA,EAAa,IAAA,EAAY,UAAA,EAAW,SAAA,EAAU,CAAA;AAAA,IAE9E,aAAA,wBACE,UAAA,EAAA,EACC,QAAA,kBAAA,GAAA,CAAC,UAAK,GAAA,EAAI,YAAA,EAAa,MAAY,CAAA,EACrC;AAAA,GAAA,EAEJ,CAAA;AAEJ;AAGO,SAAS,gBAA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AA,MAAW,cAAc,WAAA,EAAa;AACpC,MAAA,OAAA,CAAQ,MAAA,CAAO,QAAQ,UAAU,CAAA;AAAA,IACnC;AAEA,IAAA,OAAO,IAAI,QAAA,CAAS,QAAA,CAAS,IAAA,EAAM;AAAA,MACjC,QAAQ,QAAA,CAAS,MAAA;AAAA,MACjB,YAAY,QAAA,CAAS,UAAA;AAAA,MACrB;AAAA,KACD,CAAA;AAAA,EACH,CAAC,CAAA;AACH","file":"tanstack.js","sourcesContent":["import { useState, useSyncExternalStore } from 'react';\nimport { Asset, useRouter, useRouterState, useTags } from '@tanstack/react-router';\nimport { CRITICAL_STYLE_HREF } from '../boot/critical-style';\n\nexport interface ThemeStylesheetProps {\n /** The full stylesheet's URL (`app.css?url`). */\n href: string;\n /**\n * Inline critical CSS by route id. A page server-rendered as one of these routes paints from it,\n * and `bootClient` adds `href` once its first screen has painted. Pass the same route ids on the\n * client with empty strings, so hydration renders the same tags without shipping the CSS twice.\n */\n critical?: Readonly<Record<string, string>>;\n}\n\nconst subscribeNothing = () => () => {};\n\n/** The theme's stylesheet: inline critical CSS for the routes that have it, the full sheet otherwise. */\nexport function ThemeStylesheet({ href, critical = {} }: ThemeStylesheetProps) {\n const routeId = useRouterState({\n select: (state): string | undefined =>\n state.matches.find((match) => Object.hasOwn(critical, match.routeId))?.routeId,\n });\n // The route the page was server-rendered as: never added or removed on client-side navigations.\n const [criticalRoute] = useState(routeId);\n const hydrated = useSyncExternalStore(\n subscribeNothing,\n () => true,\n () => false\n );\n\n return (\n <>\n {criticalRoute && (\n // Its own precedence, so it lands before the full sheet; React renders the CSS verbatim.\n <style href={CRITICAL_STYLE_HREF} precedence=\"critical\">\n {critical[criticalRoute]}\n </style>\n )}\n {(!criticalRoute || hydrated) && (\n <link id=\"salla-theme-css\" rel=\"stylesheet\" href={href} precedence=\"default\" />\n )}\n {criticalRoute && (\n <noscript>\n <link rel=\"stylesheet\" href={href} />\n </noscript>\n )}\n </>\n );\n}\n\n/** The route's head tags without module preloads: they raced the LCP image, and the entry loads every chunk anyway. */\nexport function ThemeHeadContent() {\n const tags = useTags();\n const nonce = useRouter().options.ssr?.nonce;\n return tags\n .filter((tag) => !(tag.tag === 'link' && tag.attrs?.rel === 'modulepreload'))\n .map((tag) => <Asset {...tag} key={`tsr-meta-${JSON.stringify(tag)}`} nonce={nonce} />);\n}\n","/**\n * Which address was not found, as Twig's `checkUsername` (SallaApp/Store) tells them\n * apart: a store the request named (a username, `?storeId=`), or the domain itself.\n */\nexport type StoreNotFoundKind = 'store' | 'domain';\n\n/** Twig's copy (`error::errors.<kind>.not_found_*`). Arabic in every language, as there. */\nconst COPY: Record<StoreNotFoundKind, { title: string; message: string }> = {\n store: {\n title: 'المتجر غير موجود!',\n message: 'نأسف هذا المتجر غير موجود حاليا!.',\n },\n domain: {\n title: 'نطاق المتجر غير موجود!',\n message: 'نأسف نطاق المتجر المطلوب غير موجود حاليا!.',\n },\n};\n\n/**\n * The page Twig answers with a 410 when no store has the address it was asked for,\n * with what a visitor sees kept: the same markup and the same stylesheet. Dropped: the\n * feedback form, which Twig renders hidden, and the jQuery and legacy scripts behind\n * it. `iframe-embed` is on `<body>` from the start because Twig's script adds it on\n * every load, and it is what hides the `body--bg` background; the empty `msg-container`\n * keeps the block where Twig's sits. The link goes to merchant sign-up on s.salla.sa;\n * Twig's relative `/register` would reach the theme on any host but salla.sa.\n *\n * One constant document, and only {@link COPY} is ever put into it: nothing from the\n * request reaches this page.\n */\nconst PAGE = `<!DOCTYPE html>\n<html lang=\"ar\" dir=\"rtl\">\n<head>\n<meta charset=\"UTF-8\">\n<meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1, shrink-to-fit=no\">\n<meta name=\"theme-color\" content=\"#37a495\">\n<meta name=\"author\" content=\"منصة سلة\">\n<meta name=\"robots\" content=\"noindex, follow\">\n<meta name=\"copyright\" content=\"Salla.sa\">\n<title>{title}</title>\n<link rel=\"icon\" type=\"image/png\" href=\"https://cdn.salla.network/images/logo/logo-square.png\">\n<link rel=\"apple-touch-icon-precomposed\" href=\"https://cdn.salla.network/images/logo/logo-square.png\">\n<link rel=\"stylesheet\" href=\"https://cdn.salla.network/fonts/pingarlt.css?v=0.2\">\n<link rel=\"stylesheet\" href=\"https://cdn.assets.salla.network/prod/stores/vendor/salla/errors/css/app.css?id=0d7e71fbf018a0d5c478129a56c7a71f\">\n</head>\n<body class=\"body body--rtl body--bg iframe-embed\">\n<header id=\"header\" class=\"header header--404\"></header>\n<main id=\"main\" class=\"main main--404\">\n<div class=\"container container--wide\">\n<div class=\"e404-container\">\n<div class=\"landing\">\n<h1 class=\"title title--giant title--404\"><img src=\"https://cdn.assets.salla.network/prod/stores/vendor/salla/errors/images/error.svg\" alt=\"\"/> 410</h1>\n<h3>{title}</h3>\n<p>{message}<br> بإمكانك العودة للصفحة لرئيسية أو التسجيل للتمتع بمتجر رائع!</p>\n<a href=\"https://s.salla.sa/register\">سجل متجرك الأن</a>\n</div>\n</div>\n<div class=\"form-group msg-container\"></div>\n</div>\n</main>\n<footer id=\"footer\" class=\"footer\"></footer>\n</body>\n</html>\n`;\n\n/** Twig's 410 page for `kind`. */\nexport function storeNotFoundPage(kind: StoreNotFoundKind): string {\n const { title, message } = COPY[kind];\n return PAGE.replaceAll('{title}', title).replace('{message}', message);\n}\n\n/** {@link storeNotFoundPage} as Twig sends it: a 410 that no cache keeps. */\nexport function storeNotFoundResponse(kind: StoreNotFoundKind): Response {\n return new Response(storeNotFoundPage(kind), {\n status: 410,\n headers: {\n 'content-type': 'text/html; charset=UTF-8',\n 'cache-control': 'max-age=0, must-revalidate, no-cache, no-store, private',\n },\n });\n}\n","import type { AnyRequestMiddleware } from '@tanstack/react-start';\nimport { createMiddleware } from '@tanstack/react-start';\nimport {\n extractTokenFromCookies,\n resolveAddressedStore,\n resolveRequestScope,\n resolveRequestVersionId,\n AUTH_TOKEN_COOKIE_NAME,\n STORE_BASE_HEADER,\n} from '../../utils/cookies';\nimport { getTwilightContext, runWithTwilightContext } from '../../twilight/context';\nimport type { StoreContext } from '../../api/store';\nimport {\n MAINTENANCE_EVIDENCE_HEADER,\n maintenanceEvidence,\n maintenanceEvidenceHeader,\n} from '../../utils/maintenance';\nimport { requestHostOf } from '../../utils/request-host';\nimport { legacyLocaleRedirectHref } from '../../utils/store-base';\nimport { readNativeAppHeaders } from '../../utils/native-app-headers';\nimport { storeNotFoundResponse } from './store-not-found';\n\n/**\n * The maintenance page's headers: never cached, and saying which settings answer\n * closed the store. Its status stays the render's 200, as Twig's `CheckStoreStatus`\n * answers a closed, not-yet-launched or market-maintenance store.\n *\n * It was a 503, so search engines would read the closure as temporary. A merchant\n * closes a store for longer than Google honours one (about two days, after which it\n * drops the URLs), and every visit to a closed store was a 5xx that the dispatcher's\n * Workers Issues counted as a failure: Cloudflare raises its own\n * `HttpServerError · HTTP 503` for any 5xx a Worker returns, error line or not.\n *\n * `no-store` because the same URLs serve the store again the moment it reopens, and\n * a 200, unlike a 503, is something a browser or a proxy may keep.\n *\n * The headers are applied here, on the response the render produced, from the\n * decision `rootBeforeLoad` left in the request context. Only a 200 is touched: a\n * redirect or an error keeps its own. `next()` resolves to the middleware context,\n * whose `response` is the render; a bare `Response` is accepted too. The copy keeps\n * the body stream, so TanStack treats it as the same response rather than a\n * replacement to cancel.\n */\nexport function withMaintenanceHeaders<T>(result: T): T | Response {\n const response =\n result instanceof Response\n ? result\n : (result as { response?: unknown } | null)?.response instanceof Response\n ? ((result as { response: Response }).response as Response)\n : null;\n if (!response || response.status !== 200 || !getTwilightContext().maintenance) return result;\n // A copy: the render's own headers may be immutable.\n const page = new Response(response.body, {\n status: response.status,\n statusText: response.statusText,\n headers: response.headers,\n });\n page.headers.set('cache-control', MAINTENANCE_CACHE_CONTROL);\n stampMaintenanceEvidence(page.headers);\n return result instanceof Response ? page : { ...result, response: page };\n}\n\n/** Nothing keeps the maintenance page: the store's own pages come back on these URLs. */\nexport const MAINTENANCE_CACHE_CONTROL = 'no-store, private';\n\n/**\n * Says on the maintenance page which settings answer closed the store, and logs it once.\n *\n * The page is for everyone but the merchant, so it is usually the merchant's own\n * store state; when it is not (the page interleaved with the store on one host), the\n * answer's trace and cache status are what settle it, read off the response.\n */\nfunction stampMaintenanceEvidence(headers: Headers): void {\n let settings: StoreContext | undefined;\n try {\n settings = getTwilightContext().settings;\n } catch {\n return;\n }\n const evidence = maintenanceEvidence(settings);\n if (!Object.keys(evidence).length) return;\n headers.set(MAINTENANCE_EVIDENCE_HEADER, maintenanceEvidenceHeader(evidence));\n if (evidence.trace) headers.set('x-trace-id', evidence.trace);\n console.warn('[twilight] maintenance page', {\n ...evidence,\n title: settings?.maintenance_details?.title,\n });\n}\n\n/**\n * Twig's 410 page in place of the render, once rootBeforeLoad has learned that no store\n * has this request's identifier: there is no store to render, so nothing of it is kept.\n * The page says \"domain\" when the host was the identifier (nothing in the request named\n * a store), as Twig's `checkUsername` does for a host that is not salla.sa.\n *\n * A render that threw is answered the same way. A theme's shell renders even when the\n * root route failed, and one that reads the settings there throws, which h3 would\n * otherwise answer with a bare `{\"status\":500,\"unhandled\":true}`.\n */\nexport function withStoreNotFoundPage<T>(result: T): T | Response {\n if (!getTwilightContext().storeNotFound) return result;\n const page = storeNotFoundAnswer();\n const carried = (result as { response?: unknown } | null)?.response;\n return carried instanceof Response ? { ...result, response: page } : page;\n}\n\n/** The render's failure, unless {@link withStoreNotFoundPage} has an answer for it. */\nexport function storeNotFoundOrThrow(error: unknown): Response {\n if (getTwilightContext().storeNotFound) return storeNotFoundAnswer();\n throw error;\n}\n\n/** A store the request named (`?storeId=`, a path segment, a username), else the host's. */\nfunction storeNotFoundAnswer(): Response {\n const { storeId, storeBase } = getTwilightContext();\n return storeNotFoundResponse(storeId || storeBase ? 'store' : 'domain');\n}\n\ninterface TwilightMiddlewareOptions {\n cookieName?: string;\n}\n\nexport const twilightMiddleware = (options?: TwilightMiddlewareOptions): AnyRequestMiddleware => {\n const cookieName = options?.cookieName ?? AUTH_TOKEN_COOKIE_NAME;\n\n return createMiddleware().server(async ({ request, next }) => {\n const cookieHeader = request.headers.get('Cookie');\n const authToken = extractTokenFromCookies(cookieHeader, cookieName);\n // `?scope=` before the cookie: it is how a market is switched (see resolveRequestScope).\n const scope = resolveRequestScope(request.url, cookieHeader);\n const requestHost = requestHostOf(request);\n // Read here and nowhere else: a deployed theme worker has no vars and no\n // bindings, so the request is the only thing that knows which store it is\n // serving. Everything downstream reads it off the context rather than\n // reaching for a build-time constant that is not there in production.\n //\n // The host goes in because it decides whether the request is allowed to name\n // a store at all. On a merchant's own domain it is not: the hostname is the\n // store, and `?storeId=` there would serve a stranger's shop from a domain\n // its owner controls.\n //\n // On those same hosts the store is also the first segment of the path, the\n // root of every URL there, and a store named that way takes the cookie's\n // place: the path is the address the visitor can see.\n //\n // On a Salla shared host the dispatcher names the store instead, from the\n // segment after the locale, and that is where it stays in every URL.\n const { storeId, storeBase, storeBaseFollowsLocale } = resolveAddressedStore(\n request.url,\n cookieHeader,\n requestHost,\n request.headers.get(STORE_BASE_HEADER)\n );\n // The version is read here for the same reason and behind the same gate. A\n // theme editor previews a draft version of a merchant's settings before it is\n // published, and a partner running the theme locally renders against one —\n // both open the storefront in an iframe and say which version in the URL.\n const versionId = resolveRequestVersionId(request.url, cookieHeader, requestHost);\n const nativeAppHeaders = readNativeAppHeaders(request.headers);\n\n // A shared host's address has no language in it any more: `/dev-x/cart`, not\n // `/ar/dev-x/cart`. An old link is sent to the new one once, keeping its language as\n // `?lang=`. Only a page load is redirected; anything else is answered as asked.\n if (\n storeBase &&\n storeBaseFollowsLocale &&\n (request.method === 'GET' || request.method === 'HEAD')\n ) {\n const location = legacyLocaleRedirectHref(request.url, storeBase);\n if (location) return new Response(null, { status: 302, headers: { Location: location } });\n }\n\n const response = await runWithTwilightContext(\n {\n authToken,\n scope,\n storeId,\n storeBase,\n storeBaseFollowsLocale,\n versionId,\n requestHost,\n nativeAppHeaders,\n },\n () => {\n const result = next({ context: { authToken } });\n const settle = <R>(rendered: R) => withMaintenanceHeaders(withStoreNotFoundPage(rendered));\n // The continuation stays in this request's scope: it was registered inside `run`.\n return result instanceof Promise\n ? result.then(settle, storeNotFoundOrThrow)\n : settle(result);\n }\n );\n // On a shared host the same URL is answered in the language the `s-lang` cookie names, so\n // a cache in front of the worker must not serve one visitor's page to another.\n return storeBaseFollowsLocale ? varyOnCookie(response) : response;\n });\n};\n\n/** A copy of `response` with `Vary: Cookie` added (the original's headers may be immutable). */\nfunction withVaryCookie(response: Response): Response {\n const headers = new Headers(response.headers);\n headers.append('Vary', 'Cookie');\n return new Response(response.body, {\n status: response.status,\n statusText: response.statusText,\n headers,\n });\n}\n\n/**\n * Adds `Vary: Cookie` to what `next()` produced: its result carries the page's `response`,\n * and a middleware may also pass a bare `Response` through. Anything else is left as it is.\n */\nfunction varyOnCookie<T>(result: T): T {\n if (result instanceof Response) return withVaryCookie(result) as T;\n const carried = (result as { response?: unknown } | null)?.response;\n if (carried instanceof Response) {\n (result as { response: Response }).response = withVaryCookie(carried);\n }\n return result;\n}\n","import type { AnyRequestMiddleware } from '@tanstack/react-start';\nimport { createMiddleware } from '@tanstack/react-start';\nimport { tsrStartManifest } from 'tanstack-start-manifest:v';\nimport { rootHead } from '../../routes/root/head';\n\n/** Known critical assets that should always be preloaded */\nconst CRITICAL_ASSETS = [\n { rel: 'preconnect', href: 'https://api.salla.dev' },\n { rel: 'preconnect', href: 'https://cdn.salla.sa' },\n { rel: 'preconnect', href: 'https://cdn.assets.salla.network', crossOrigin: 'anonymous' },\n { rel: 'preconnect', href: 'https://fonts.gstatic.com', crossOrigin: 'anonymous' },\n] as const;\n\n/** Extract locale from URL path (e.g., /ar/products → 'ar') */\nfunction extractLocale(url: string): string | undefined {\n const match = url.match(/^\\/([a-z]{2})(\\/|$)/);\n return match?.[1];\n}\n\n/** Build Link header value from a link descriptor */\nfunction buildLinkHeader(link: Record<string, unknown>): string | null {\n const href = link.href as string | undefined;\n const rel = link.rel as string | undefined;\n if (!href || !rel) return null;\n\n // Skip print-media stylesheets (already non-blocking)\n if (rel === 'stylesheet') {\n const media = link.media as string | undefined;\n if (media === 'print') return null;\n return `<${href}>; rel=preload; as=style`;\n }\n\n if (rel === 'preload') {\n const asType = link.as as string | undefined;\n if (!asType) return null;\n const parts = [`<${href}>`, 'rel=preload', `as=${asType}`];\n if (asType === 'font' || link.crossOrigin) {\n parts.push('crossorigin');\n }\n return parts.join('; ');\n }\n\n if (rel === 'modulepreload') {\n return `<${href}>; rel=modulepreload`;\n }\n\n return null;\n}\n\nexport const earlyHintsMiddleware = (): AnyRequestMiddleware => {\n let cachedManifestPaths: string[] | null = null;\n\n return createMiddleware().server(async ({ request, next }) => {\n const response = await next();\n\n const accept = request.headers.get('Accept') ?? '';\n if (!accept.includes('text/html') && accept !== '*/*') return response;\n if (!(response instanceof Response)) return response;\n\n const linkHeaders: string[] = [];\n\n // 1. Add critical assets from rootHead (fonts, icons, SDK, etc.)\n try {\n const url = new URL(request.url);\n const locale = extractLocale(url.pathname);\n if (locale) {\n const headResult = rootHead({ params: { locale } });\n const links = (headResult.links as Record<string, unknown>[]) ?? [];\n for (const link of links) {\n const header = buildLinkHeader(link);\n if (header) linkHeaders.push(header);\n }\n }\n } catch (e) {\n // rootHead failed — log why, then fall back to known critical assets\n console.warn('[earlyHints] rootHead failed:', e instanceof Error ? e.message : e);\n for (const asset of CRITICAL_ASSETS) {\n const co = 'crossOrigin' in asset ? asset.crossOrigin : undefined;\n linkHeaders.push(`<${asset.href}>; rel=${asset.rel}${co ? '; crossorigin' : ''}`);\n }\n }\n\n // 2. Add CSS from TanStack Start manifest (bundled theme CSS)\n if (!cachedManifestPaths) {\n try {\n const manifest = tsrStartManifest();\n const rootAssets = manifest.routes['__root__']?.assets ?? [];\n const seen = new Set<string>();\n cachedManifestPaths = [];\n for (const asset of rootAssets) {\n if (asset.tag === 'link' && asset.attrs?.href?.endsWith('.css')) {\n if (!seen.has(asset.attrs.href)) {\n seen.add(asset.attrs.href);\n cachedManifestPaths.push(asset.attrs.href);\n }\n }\n }\n } catch (e) {\n // manifest not available — skip\n console.warn('[earlyHints] tsrStartManifest failed:', e instanceof Error ? e.message : e);\n }\n }\n\n if (cachedManifestPaths) {\n for (const href of cachedManifestPaths) {\n linkHeaders.push(`<${href}>; rel=preload; as=style`);\n }\n }\n\n // Apply Link headers if we have any\n if (linkHeaders.length === 0) {\n console.warn('[earlyHints] no critical assets found — no Link headers added');\n return response;\n }\n\n const headers = new Headers(response.headers);\n for (const linkHeader of linkHeaders) {\n headers.append('Link', linkHeader);\n }\n\n return new Response(response.body, {\n status: response.status,\n statusText: response.statusText,\n headers,\n });\n });\n};\n"]}
|
package/dist/utils/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { stripUnsafeHtml } from '../chunk-RUHSV4Z6.js';
|
|
2
2
|
export { formatSallaPlural } from '../chunk-BT6HEEAP.js';
|
|
3
|
-
export { dispatchRouteChanged } from '../chunk-
|
|
3
|
+
export { dispatchRouteChanged } from '../chunk-SZGEJZIT.js';
|
|
4
4
|
export { sortOptions } from '../chunk-3LZJXKVO.js';
|
|
5
5
|
export { color } from '../chunk-VVZNW5CB.js';
|
|
6
6
|
export { applyAppScopeMocks, registerThemeHookSlots } from '../chunk-SY7ESZ44.js';
|
|
@@ -8,7 +8,7 @@ export { mergeHead, resolveHead, setHeadAdapter } from '../chunk-GD26FI4J.js';
|
|
|
8
8
|
export { buildBaseHead, buildHreflangAlternates, localeToOgLocale } from '../chunk-OL7X4VAI.js';
|
|
9
9
|
export { asset, cdn, isPlaceholder } from '../chunk-ZCH7W7DZ.js';
|
|
10
10
|
export { mergeDocumentDescriptors, mergeElementAttrs, normalizeClasses, syncAttrsToElement, toReactProps } from '../chunk-CW625T2E.js';
|
|
11
|
-
import '../chunk-
|
|
11
|
+
import '../chunk-JJENRYMB.js';
|
|
12
12
|
import '../chunk-Z5M4YYWT.js';
|
|
13
13
|
export { getSallaSDK, getStoreIdentifier, onSallaEvent, whenSallaLoaded, whenSallaReady } from '../chunk-MJHYGAN3.js';
|
|
14
14
|
export { AUTH_TOKEN_COOKIE_NAME, clearAuthTokenCookie, extractTokenFromCookies } from '../chunk-3Y6HAX72.js';
|
|
@@ -60,10 +60,10 @@ export declare function showsMaintenancePage(settings: StoreContext | null | und
|
|
|
60
60
|
*/
|
|
61
61
|
export declare function withoutMaintenanceOnPreviewHost<T extends Pick<StoreContext, 'maintenance'>>(settings: T, host: string | null | undefined): T;
|
|
62
62
|
/**
|
|
63
|
-
* The response header
|
|
63
|
+
* The response header the maintenance page carries saying which settings decided it.
|
|
64
64
|
*
|
|
65
|
-
* Theme workers write no logs,
|
|
66
|
-
* answer's own `x-trace-id
|
|
65
|
+
* Theme workers write no logs, so the evidence travels on the answer, where a request
|
|
66
|
+
* for the page reads it with the answer's own `x-trace-id`.
|
|
67
67
|
* The backend sets `maintenance` from store-wide state alone (closed, not launched,
|
|
68
68
|
* or the market in maintenance), so `request-id` and `trace` find the settings
|
|
69
69
|
* request it logged, and `cache`/`age` say whether this was a cached copy of one.
|
package/dist/vite/index.js
CHANGED
|
@@ -1870,6 +1870,26 @@ function addressLanguage(settings) {
|
|
|
1870
1870
|
return { single, segment };
|
|
1871
1871
|
}
|
|
1872
1872
|
|
|
1873
|
+
/**
|
|
1874
|
+
* The languages this store (this market, when it has several) offers, and the one a page is
|
|
1875
|
+
* sent to when its address names none, or one the store does not offer: the language marked
|
|
1876
|
+
* default, else FALLBACK_LOCALE when listed, else the first listed. Each market of a store
|
|
1877
|
+
* answers the settings with its own list, so a customer who switches market on \`/ar/\u2026\`
|
|
1878
|
+
* keeps Arabic only if the new market offers it. \`offered\` is null when the settings list no
|
|
1879
|
+
* language the engine knows, and then nothing is checked.
|
|
1880
|
+
*/
|
|
1881
|
+
function marketLanguages(settings) {
|
|
1882
|
+
const codeOf = (language) => (language?.iso_code ?? language?.code)?.toLowerCase();
|
|
1883
|
+
const listed = (settings?.languages ?? []).map(codeOf).filter((code) => isLocale(code));
|
|
1884
|
+
const marked = codeOf(settings?.languages?.find((language) => Boolean(language?.is_default)));
|
|
1885
|
+
const fallback = listed.includes(marked)
|
|
1886
|
+
? marked
|
|
1887
|
+
: listed.length && !listed.includes(FALLBACK_LOCALE)
|
|
1888
|
+
? listed[0]
|
|
1889
|
+
: FALLBACK_LOCALE;
|
|
1890
|
+
return { offered: listed.length ? listed : null, fallback };
|
|
1891
|
+
}
|
|
1892
|
+
|
|
1873
1893
|
/**
|
|
1874
1894
|
* The language a Twig URL's redirect lands in: the one the loader below would send the target
|
|
1875
1895
|
* to, so it is one hop. The settings are in the cache already (the root route's beforeLoad).
|
|
@@ -1880,7 +1900,11 @@ function twigTargetLocale(context) {
|
|
|
1880
1900
|
const settings = await context.queryClient.ensureQueryData(store.queries.settings());
|
|
1881
1901
|
const { single, segment } = addressLanguage(settings);
|
|
1882
1902
|
if (single) return segment ?? undefined;
|
|
1883
|
-
|
|
1903
|
+
// As the loader: the market's default when the address names no language, or one this
|
|
1904
|
+
// market does not offer.
|
|
1905
|
+
const market = marketLanguages(settings);
|
|
1906
|
+
if (!addressLocale) return market.fallback;
|
|
1907
|
+
return market.offered && !market.offered.includes(addressLocale) ? market.fallback : addressLocale;
|
|
1884
1908
|
};
|
|
1885
1909
|
}`;
|
|
1886
1910
|
function getLocaleWrapperTemplate(baseRoutesImport) {
|
|
@@ -1911,6 +1935,11 @@ export const Route = createFileRoute('/{-$locale}')({
|
|
|
1911
1935
|
const settings = await context.queryClient.ensureQueryData(store.queries.settings());
|
|
1912
1936
|
const { single, segment } = addressLanguage(settings);
|
|
1913
1937
|
if (single && !segment) throw notFound();
|
|
1938
|
+
throw redirect({
|
|
1939
|
+
to: \`/\${marketLanguages(settings).fallback}\${location.pathname}\`,
|
|
1940
|
+
search: location.search,
|
|
1941
|
+
replace: true,
|
|
1942
|
+
});
|
|
1914
1943
|
}
|
|
1915
1944
|
throw redirect({
|
|
1916
1945
|
to: \`/\${FALLBACK_LOCALE}\${location.pathname}\`,
|
|
@@ -1929,6 +1958,7 @@ export const Route = createFileRoute('/{-$locale}')({
|
|
|
1929
1958
|
const settings = await context.queryClient.ensureQueryData(store.queries.settings());
|
|
1930
1959
|
const { single, segment } = addressLanguage(settings);
|
|
1931
1960
|
const isMultilingual = !single;
|
|
1961
|
+
const market = marketLanguages(settings);
|
|
1932
1962
|
const pathWithoutLocale = params.locale
|
|
1933
1963
|
? location.pathname.slice(params.locale.length + 1) || '/'
|
|
1934
1964
|
: location.pathname;
|
|
@@ -1959,8 +1989,10 @@ export const Route = createFileRoute('/{-$locale}')({
|
|
|
1959
1989
|
if (isMultilingual && !params.locale) {
|
|
1960
1990
|
// A leading locale bound to a child param (/ar/p1 as slug 'ar'): Twig has no such page.
|
|
1961
1991
|
if (isLocale(location.pathname.split('/')[1])) throw notFound();
|
|
1992
|
+
// The store's default language, not FALLBACK_LOCALE: a market whose default is English
|
|
1993
|
+
// and that offers no Arabic was rendered in Arabic, right to left.
|
|
1962
1994
|
throw redirect({
|
|
1963
|
-
to: \`/\${
|
|
1995
|
+
to: \`/\${market.fallback}\${location.pathname}\`,
|
|
1964
1996
|
search: location.search,
|
|
1965
1997
|
replace: true,
|
|
1966
1998
|
});
|
|
@@ -1978,6 +2010,18 @@ export const Route = createFileRoute('/{-$locale}')({
|
|
|
1978
2010
|
replace: true,
|
|
1979
2011
|
});
|
|
1980
2012
|
}
|
|
2013
|
+
// A language this store does not offer, typically after a market switch: the market
|
|
2014
|
+
// picker reloads the same address with \`?scope=\`, so \`/ar/\u2026\` reaches a market that may
|
|
2015
|
+
// offer only English. Its default instead, on the same page. \`market.fallback\` is one
|
|
2016
|
+
// of \`market.offered\`, so this cannot send the page back to itself.
|
|
2017
|
+
const unoffered = market.offered && !market.offered.includes(params.locale);
|
|
2018
|
+
if (isMultilingual && params.locale && unoffered) {
|
|
2019
|
+
throw redirect({
|
|
2020
|
+
to: \`/\${market.fallback}\${pathWithoutLocale === '/' ? '' : pathWithoutLocale}\`,
|
|
2021
|
+
search: location.search,
|
|
2022
|
+
replace: true,
|
|
2023
|
+
});
|
|
2024
|
+
}
|
|
1981
2025
|
},
|
|
1982
2026
|
component: () => <Outlet />,
|
|
1983
2027
|
});
|