@salla.sa/twilight-theme-engine 1.0.58 → 1.0.60
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-MTD46H63.js → AddToCartForm-GFAJUB4Y.js} +3 -3
- package/dist/{AddToCartForm-MTD46H63.js.map → AddToCartForm-GFAJUB4Y.js.map} +1 -1
- package/dist/{BlogAuthorPage-BT5BGQQJ.js → BlogAuthorPage-WWA75UTA.js} +15 -15
- package/dist/{BlogAuthorPage-BT5BGQQJ.js.map → BlogAuthorPage-WWA75UTA.js.map} +1 -1
- package/dist/{BlogCategoryPage-IDHUIFVG.js → BlogCategoryPage-VGIAMWPH.js} +15 -15
- package/dist/{BlogCategoryPage-IDHUIFVG.js.map → BlogCategoryPage-VGIAMWPH.js.map} +1 -1
- package/dist/{BlogPage-VSZPR4AD.js → BlogPage-5MW4WSOH.js} +13 -13
- package/dist/{BlogPage-VSZPR4AD.js.map → BlogPage-5MW4WSOH.js.map} +1 -1
- package/dist/{BlogSinglePage-3FWJ6UTQ.js → BlogSinglePage-67E3PVMP.js} +13 -13
- package/dist/{BlogSinglePage-3FWJ6UTQ.js.map → BlogSinglePage-67E3PVMP.js.map} +1 -1
- package/dist/{BlogTagPage-TIPPV2WW.js → BlogTagPage-EEOIAALL.js} +15 -15
- package/dist/{BlogTagPage-TIPPV2WW.js.map → BlogTagPage-EEOIAALL.js.map} +1 -1
- package/dist/{BrandsPage-LEXRPFVK.js → BrandsPage-SNVIBZGR.js} +13 -13
- package/dist/{BrandsPage-LEXRPFVK.js.map → BrandsPage-SNVIBZGR.js.map} +1 -1
- package/dist/{Breadcrumb-Q3P72LPT.js → Breadcrumb-4I2HVAFR.js} +13 -13
- package/dist/{Breadcrumb-Q3P72LPT.js.map → Breadcrumb-4I2HVAFR.js.map} +1 -1
- package/dist/{CartItem-LJYCK3UP.js → CartItem-A7Y6MZXS.js} +13 -13
- package/dist/{CartItem-LJYCK3UP.js.map → CartItem-A7Y6MZXS.js.map} +1 -1
- package/dist/{CartSummary-645YDH2N.js → CartSummary-MUCVTNKG.js} +13 -13
- package/dist/{CartSummary-645YDH2N.js.map → CartSummary-MUCVTNKG.js.map} +1 -1
- package/dist/{Copyright-N5323WE7.js → Copyright-VJYMP42V.js} +3 -3
- package/dist/{Copyright-N5323WE7.js.map → Copyright-VJYMP42V.js.map} +1 -1
- package/dist/{CustomerLayout-LB2EWG2P.js → CustomerLayout-L3Y2TIPF.js} +13 -13
- package/dist/{CustomerLayout-LB2EWG2P.js.map → CustomerLayout-L3Y2TIPF.js.map} +1 -1
- package/dist/{Footer-TTYS7K4V.js → Footer-OQFU25J4.js} +13 -13
- package/dist/{Footer-TTYS7K4V.js.map → Footer-OQFU25J4.js.map} +1 -1
- package/dist/{Header-26PWNGDF.js → Header-QNNAHZJL.js} +6 -6
- package/dist/{Header-26PWNGDF.js.map → Header-QNNAHZJL.js.map} +1 -1
- package/dist/{LoyaltyPage-F4QVHJAH.js → LoyaltyPage-IULR2XKZ.js} +14 -14
- package/dist/{LoyaltyPage-F4QVHJAH.js.map → LoyaltyPage-IULR2XKZ.js.map} +1 -1
- package/dist/{MainMenu-SACYMDKQ.js → MainMenu-3KKSHFCS.js} +7 -7
- package/dist/{MainMenu-SACYMDKQ.js.map → MainMenu-3KKSHFCS.js.map} +1 -1
- package/dist/{MasterLayout-MVY5N7G6.js → MasterLayout-HJWMQHWO.js} +13 -13
- package/dist/{MasterLayout-MVY5N7G6.js.map → MasterLayout-HJWMQHWO.js.map} +1 -1
- package/dist/{MobileMenu-DBIJRXTA.js → MobileMenu-DBJ23EKX.js} +14 -14
- package/dist/{MobileMenu-DBIJRXTA.js.map → MobileMenu-DBJ23EKX.js.map} +1 -1
- package/dist/{NotificationsPage-TMGF4BQM.js → NotificationsPage-PUS3WBU6.js} +13 -13
- package/dist/{NotificationsPage-TMGF4BQM.js.map → NotificationsPage-PUS3WBU6.js.map} +1 -1
- package/dist/{OrderSinglePage-NCQR6ADR.js → OrderSinglePage-4CK6OT6U.js} +14 -14
- package/dist/{OrderSinglePage-NCQR6ADR.js.map → OrderSinglePage-4CK6OT6U.js.map} +1 -1
- package/dist/{OrdersPage-O2LSXL4W.js → OrdersPage-EGIDHSYS.js} +14 -14
- package/dist/{OrdersPage-O2LSXL4W.js.map → OrdersPage-EGIDHSYS.js.map} +1 -1
- package/dist/{PageSingle-745SGJUG.js → PageSingle-ORPH52QX.js} +3 -3
- package/dist/{PageSingle-745SGJUG.js.map → PageSingle-ORPH52QX.js.map} +1 -1
- package/dist/{ProductDetails-AHYFTGM6.js → ProductDetails-RY6PNKKJ.js} +3 -3
- package/dist/{ProductDetails-AHYFTGM6.js.map → ProductDetails-RY6PNKKJ.js.map} +1 -1
- package/dist/{ProfilePage-5JUXB5SB.js → ProfilePage-IO2MDE53.js} +13 -13
- package/dist/{ProfilePage-5JUXB5SB.js.map → ProfilePage-IO2MDE53.js.map} +1 -1
- package/dist/{SeoCartWidget-XPPMBCQB.js → SeoCartWidget-TPSVEGMI.js} +13 -13
- package/dist/{SeoCartWidget-XPPMBCQB.js.map → SeoCartWidget-TPSVEGMI.js.map} +1 -1
- package/dist/{SettingsPage-NFSZ4CKO.js → SettingsPage-ZTD4ALAA.js} +13 -13
- package/dist/{SettingsPage-NFSZ4CKO.js.map → SettingsPage-ZTD4ALAA.js.map} +1 -1
- package/dist/{StoreClosedNotification-5XWRDBPA.js → StoreClosedNotification-52REE2T5.js} +14 -14
- package/dist/{StoreClosedNotification-5XWRDBPA.js.map → StoreClosedNotification-52REE2T5.js.map} +1 -1
- package/dist/{TestimonialsPage-JHGMJMGG.js → TestimonialsPage-QDBHJADT.js} +3 -3
- package/dist/{TestimonialsPage-JHGMJMGG.js.map → TestimonialsPage-QDBHJADT.js.map} +1 -1
- package/dist/{ThankYouPage-CYCVSBAO.js → ThankYouPage-IRLZI3HI.js} +13 -13
- package/dist/{ThankYouPage-CYCVSBAO.js.map → ThankYouPage-IRLZI3HI.js.map} +1 -1
- package/dist/{WalletPage-2JZ32SNZ.js → WalletPage-ZTSSGFMO.js} +14 -14
- package/dist/{WalletPage-2JZ32SNZ.js.map → WalletPage-ZTSSGFMO.js.map} +1 -1
- package/dist/{WishlistPage-N3K6MBMC.js → WishlistPage-OADS7B5J.js} +15 -15
- package/dist/{WishlistPage-N3K6MBMC.js.map → WishlistPage-OADS7B5J.js.map} +1 -1
- package/dist/api/apps.js +4 -4
- package/dist/api/brands.js +5 -5
- package/dist/api/cart.js +5 -5
- package/dist/api/category.js +5 -5
- package/dist/api/client.js +3 -3
- package/dist/api/home.js +4 -4
- package/dist/api/loyalty.js +5 -5
- package/dist/api/menu.js +4 -4
- package/dist/api/messages.d.ts +58 -0
- package/dist/api/messages.d.ts.map +1 -0
- package/dist/api/notification.js +4 -4
- package/dist/api/order.js +5 -5
- package/dist/api/page.js +5 -5
- package/dist/api/product.js +5 -5
- package/dist/api/profile.js +3 -3
- package/dist/api/store.js +4 -4
- package/dist/api/translations-key.d.ts +17 -0
- package/dist/api/translations-key.d.ts.map +1 -1
- package/dist/api/translations.d.ts +49 -0
- package/dist/api/translations.d.ts.map +1 -1
- package/dist/api/translations.js +4 -4
- package/dist/api/user.js +4 -4
- package/dist/api/wishlist.js +6 -6
- package/dist/{chunk-UOALND7V.js → chunk-6DVYW7OA.js} +4 -4
- package/dist/{chunk-UOALND7V.js.map → chunk-6DVYW7OA.js.map} +1 -1
- package/dist/chunk-6EES4C7J.js +14 -0
- package/dist/{chunk-3H27IEME.js.map → chunk-6EES4C7J.js.map} +1 -1
- package/dist/{chunk-7BWZYECG.js → chunk-6LIGRH4O.js} +5 -5
- package/dist/{chunk-7BWZYECG.js.map → chunk-6LIGRH4O.js.map} +1 -1
- package/dist/{chunk-36PDYP56.js → chunk-ANWDPISS.js} +15 -15
- package/dist/{chunk-36PDYP56.js.map → chunk-ANWDPISS.js.map} +1 -1
- package/dist/{chunk-YJ6ZSGQY.js → chunk-AODO3GFK.js} +3 -3
- package/dist/{chunk-YJ6ZSGQY.js.map → chunk-AODO3GFK.js.map} +1 -1
- package/dist/{chunk-675NJ2XP.js → chunk-AVUX6GAG.js} +4 -4
- package/dist/{chunk-675NJ2XP.js.map → chunk-AVUX6GAG.js.map} +1 -1
- package/dist/{chunk-F4MMWEII.js → chunk-BHU25UEW.js} +4 -4
- package/dist/{chunk-F4MMWEII.js.map → chunk-BHU25UEW.js.map} +1 -1
- package/dist/{chunk-JBNI5ZVG.js → chunk-CUX7O42G.js} +3 -3
- package/dist/{chunk-JBNI5ZVG.js.map → chunk-CUX7O42G.js.map} +1 -1
- package/dist/{chunk-WFSOVIYU.js → chunk-GX3EDS32.js} +6 -6
- package/dist/{chunk-WFSOVIYU.js.map → chunk-GX3EDS32.js.map} +1 -1
- package/dist/{chunk-2KU5ANFZ.js → chunk-GXXWHVLS.js} +5 -5
- package/dist/{chunk-2KU5ANFZ.js.map → chunk-GXXWHVLS.js.map} +1 -1
- package/dist/{chunk-TJGYL7GD.js → chunk-GZKCZ6X7.js} +5 -5
- package/dist/{chunk-TJGYL7GD.js.map → chunk-GZKCZ6X7.js.map} +1 -1
- package/dist/{chunk-BZ7ZIO33.js → chunk-HAV32VZS.js} +3 -3
- package/dist/{chunk-BZ7ZIO33.js.map → chunk-HAV32VZS.js.map} +1 -1
- package/dist/{chunk-YJJZN5UP.js → chunk-HF6RCUMD.js} +4 -4
- package/dist/{chunk-YJJZN5UP.js.map → chunk-HF6RCUMD.js.map} +1 -1
- package/dist/{chunk-BFZ47MS5.js → chunk-ICPO2ELD.js} +3 -3
- package/dist/{chunk-BFZ47MS5.js.map → chunk-ICPO2ELD.js.map} +1 -1
- package/dist/{chunk-J2GGMK3X.js → chunk-IFWQTDEY.js} +6 -6
- package/dist/{chunk-J2GGMK3X.js.map → chunk-IFWQTDEY.js.map} +1 -1
- package/dist/{chunk-MQBGRVOJ.js → chunk-J7BQY4ZK.js} +4 -4
- package/dist/{chunk-MQBGRVOJ.js.map → chunk-J7BQY4ZK.js.map} +1 -1
- package/dist/{chunk-RJAV554G.js → chunk-JDDQHFIW.js} +4 -4
- package/dist/{chunk-RJAV554G.js.map → chunk-JDDQHFIW.js.map} +1 -1
- package/dist/{chunk-2OX3JML4.js → chunk-K34A2LBY.js} +4 -4
- package/dist/{chunk-2OX3JML4.js.map → chunk-K34A2LBY.js.map} +1 -1
- package/dist/{chunk-RBVFIPX2.js → chunk-KRCPBXFJ.js} +4 -4
- package/dist/{chunk-RBVFIPX2.js.map → chunk-KRCPBXFJ.js.map} +1 -1
- package/dist/{chunk-YSFWVMBA.js → chunk-KZMUU5ZD.js} +3 -3
- package/dist/{chunk-YSFWVMBA.js.map → chunk-KZMUU5ZD.js.map} +1 -1
- package/dist/{chunk-3R7YKSO6.js → chunk-NK2V2SW5.js} +5 -5
- package/dist/{chunk-3R7YKSO6.js.map → chunk-NK2V2SW5.js.map} +1 -1
- package/dist/{chunk-WIAPOLEA.js → chunk-NKLKKZM6.js} +3 -3
- package/dist/{chunk-WIAPOLEA.js.map → chunk-NKLKKZM6.js.map} +1 -1
- package/dist/{chunk-K4YT7TOV.js → chunk-NOB7OWFA.js} +3 -3
- package/dist/{chunk-K4YT7TOV.js.map → chunk-NOB7OWFA.js.map} +1 -1
- package/dist/{chunk-PSRSWHML.js → chunk-NYD5Z4RJ.js} +4 -4
- package/dist/{chunk-PSRSWHML.js.map → chunk-NYD5Z4RJ.js.map} +1 -1
- package/dist/{chunk-SOPK72TP.js → chunk-OGQXRBCR.js} +44 -5
- package/dist/chunk-OGQXRBCR.js.map +1 -0
- package/dist/{chunk-LKRI35NZ.js → chunk-R2ULWW5T.js} +38 -16
- package/dist/chunk-R2ULWW5T.js.map +1 -0
- package/dist/{chunk-O2YV5DAL.js → chunk-R3TPJHLI.js} +4 -4
- package/dist/{chunk-O2YV5DAL.js.map → chunk-R3TPJHLI.js.map} +1 -1
- package/dist/{chunk-JDROOL5C.js → chunk-RLSYCDI4.js} +3 -3
- package/dist/{chunk-JDROOL5C.js.map → chunk-RLSYCDI4.js.map} +1 -1
- package/dist/{chunk-GLRXYGYI.js → chunk-S7JSNUU2.js} +3 -3
- package/dist/{chunk-GLRXYGYI.js.map → chunk-S7JSNUU2.js.map} +1 -1
- package/dist/{chunk-S7XYSF4X.js → chunk-T26Y47JL.js} +4 -4
- package/dist/{chunk-S7XYSF4X.js.map → chunk-T26Y47JL.js.map} +1 -1
- package/dist/{chunk-VO5ODVVL.js → chunk-T63KKKW2.js} +4 -4
- package/dist/{chunk-VO5ODVVL.js.map → chunk-T63KKKW2.js.map} +1 -1
- package/dist/{chunk-XDB2POG3.js → chunk-UQAUDOI7.js} +7 -7
- package/dist/{chunk-XDB2POG3.js.map → chunk-UQAUDOI7.js.map} +1 -1
- package/dist/{chunk-TX6ZP4FF.js → chunk-VRV5F6G7.js} +3 -3
- package/dist/{chunk-TX6ZP4FF.js.map → chunk-VRV5F6G7.js.map} +1 -1
- package/dist/{chunk-HVHFTVZT.js → chunk-WPHI6Q6N.js} +4 -4
- package/dist/{chunk-HVHFTVZT.js.map → chunk-WPHI6Q6N.js.map} +1 -1
- package/dist/{chunk-YNY5P2DG.js → chunk-X7P2WSNU.js} +3 -3
- package/dist/{chunk-YNY5P2DG.js.map → chunk-X7P2WSNU.js.map} +1 -1
- package/dist/{chunk-KTOKX3GC.js → chunk-YGDAYFQY.js} +3 -3
- package/dist/{chunk-KTOKX3GC.js.map → chunk-YGDAYFQY.js.map} +1 -1
- package/dist/{chunk-HOE2P2HU.js → chunk-YGSU36MZ.js} +3 -3
- package/dist/{chunk-HOE2P2HU.js.map → chunk-YGSU36MZ.js.map} +1 -1
- package/dist/chunk-ZOZLNUNA.js +130 -0
- package/dist/chunk-ZOZLNUNA.js.map +1 -0
- package/dist/components/cart/index.js +1 -1
- package/dist/components/common/index.js +1 -1
- package/dist/components/drawer/index.js +11 -11
- package/dist/components/home/index.js +14 -14
- package/dist/components/layout/index.js +5 -5
- package/dist/components/product/index.js +12 -12
- package/dist/components/store/index.js +13 -13
- package/dist/document-class-SX2LHILG.js +25 -0
- package/dist/{document-class-YYEVAIVJ.js.map → document-class-SX2LHILG.js.map} +1 -1
- package/dist/hooks/index.js +11 -11
- package/dist/hooks/useGtm.js +11 -11
- package/dist/hooks/useMoney.js +11 -11
- package/dist/hooks/useStore.js +11 -11
- package/dist/hooks/useUser.js +5 -5
- package/dist/index.js +11 -11
- package/dist/{navigation-MVKZENRD.js → navigation-7WGWEDLB.js} +4 -4
- package/dist/{navigation-MVKZENRD.js.map → navigation-7WGWEDLB.js.map} +1 -1
- package/dist/{navigation-4VEQUXHI.js → navigation-Z6JMJ4FZ.js} +5 -5
- package/dist/{navigation-4VEQUXHI.js.map → navigation-Z6JMJ4FZ.js.map} +1 -1
- package/dist/{not-found-JGDH4AQ3.js → not-found-CDXSWL7T.js} +14 -14
- package/dist/{not-found-JGDH4AQ3.js.map → not-found-CDXSWL7T.js.map} +1 -1
- package/dist/providers/index.js +11 -11
- package/dist/routes/account/orders.js +6 -6
- package/dist/routes/account.js +15 -15
- package/dist/routes/blog.js +10 -10
- package/dist/routes/brands.js +6 -6
- package/dist/routes/cart.js +19 -19
- package/dist/routes/home.js +16 -16
- package/dist/routes/index.js +3 -3
- package/dist/routes/loyalty.js +6 -6
- package/dist/routes/page.js +6 -6
- package/dist/routes/product-listing.js +16 -16
- package/dist/routes/product.js +14 -14
- package/dist/routes/root/beforeLoad.d.ts.map +1 -1
- package/dist/routes/seo-redirects.js +3 -3
- package/dist/routes/testimonials.js +2 -2
- package/dist/routes/thank-you.js +6 -6
- package/dist/skeleton.js +16 -16
- package/dist/tanstack/router.d.ts.map +1 -1
- package/dist/tanstack.js +15 -15
- package/dist/twilight/context.d.ts.map +1 -1
- package/dist/types/index.d.ts +15 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/utils/index.js +4 -4
- package/dist/vite/index.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-3H27IEME.js +0 -14
- package/dist/chunk-IE2FU6BR.js +0 -83
- package/dist/chunk-IE2FU6BR.js.map +0 -1
- package/dist/chunk-LKRI35NZ.js.map +0 -1
- package/dist/chunk-SOPK72TP.js.map +0 -1
- package/dist/document-class-YYEVAIVJ.js +0 -25
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/utils/app-scope.ts","../src/utils/theme-hook-slots.ts"],"names":[],"mappings":";;;AAGA,IAAM,SAAA,GAAY,OAAO,MAAA,KAAW,WAAA;AA2B7B,IAAM,qBAAA,GAAgD,CAAC,CAAA,EAAG,MAAA,KAAW;AAC1E,EAAA,MAAM,QAAA,GAAW,CAAC,GAAA,KAChB,OAAO,QAAQ,QAAA,IAAY,GAAA,CAAI,OAAA,CAAQ,MAAM,CAAA,KAAM,CAAA;AACrD,EAAA,MAAM,SAAA,GAAY,CAAC,GAAA,KAAwB,GAAA,CAAI,MAAM,CAAC,CAAA;AACtD,EAAA,MAAM,YAAY,MAA+B,CAAA,CAAE,KAAA,IAAS,CAAA,CAAE,SAAS,EAAC;AACxE,EAAA,MAAM,UAAA,GAAa,MAChB,SAAA,EAAU,CAAE,UAAsC,EAAC;AACtD,EAAA,MAAM,WAAA,GAAc,CAAC,GAAA,EAA8B,IAAA,KAAmC;AACpF,IAAA,MAAM,MAAA,GAAS,IAAI,IAAc,CAAA;AACjC,IAAA,OAAO,OAAO,MAAA,KAAW,UAAA,GAAa,MAAA,CAAO,IAAA,CAAK,GAAG,CAAA,GAAI,MAAA;AAAA,EAC3D,CAAA;AAEA,EAAA,MAAM,cAAA,GAAiB,CAAC,OAAA,KAA8B;AACpD,IAAA,MAAM,MAAA,GAAS,MAAqB,MAAA,CAAO,OAAO,IAAI,MAAA,CAAO,OAAO,KAAK,EAAC;AAE1E,IAAA,MAAM,SAAA,GAAY,CAAC,GAAA,EAAa,QAAA,KAAgC;AAC9D,MAAA,IAAI,QAAA,CAAS,GAAG,CAAA,EAAG;AACjB,QAAA,MAAM,GAAA,GAAM,UAAU,GAAG,CAAA;AACzB,QAAA,MAAM,IAAI,MAA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AM,IAAA,EAAM,CAAA;AACvF;AAGO,SAAS,2BAAA,GAAwC;AACtD,EAAA,OAAO,CAAC,GAAG,UAAU,CAAA;AACvB;AAeO,SAAS,0BAAA,CAA2B,KAAA,GAAkB,2BAAA,EAA4B,EAAG;AAC1F,EAAA,IAAI,CAAC,KAAA,CAAM,MAAA,EAAQ,OAAO,IAAA;AAC1B,EAAA,MAAM,IAAA,GAAO,qBAAA,CAAsB,IAAA,CAAK,SAAA,CAAU,KAAK,CAAC,CAAA;AACxD,EAAA,OACE,wUASM,IAAI,CAAA,EAAA,CAAA;AAEd","file":"chunk-KTOKX3GC.js","sourcesContent":["import type { SallaSDK } from '../types/salla-sdk';\nimport { escapeForInlineScript } from './inline-script';\n\nconst isBrowser = typeof window !== 'undefined';\n\n/** One app's private `app.*` bag, keyed without the `app.` prefix (`app.color` → `color`). */\nexport type AppConfigBag = Record<string, unknown>;\n\n/** One public `app.*` bucket per app, keyed by appScopeId. Everything else is read from the\n * real `salla.config` at runtime. */\nexport interface AppScopeContexts {\n apps: Record<string, AppConfigBag>;\n}\n\n/** Builds the `scopeId → sandboxed SDK` factory over a live bucket bag. */\nexport type AppScopeFactoryBuilder = (\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n w: any,\n appCtx: Record<string, AppConfigBag>\n) => (scopeId: string) => SallaSDK;\n\n/**\n * The sandbox itself: proxies that resolve `app.*` against the app's own bucket and pass\n * everything else through to the real SDK.\n *\n * MUST stay self-contained (only `Object`/`Proxy` and its two arguments): it is serialized via\n * `.toString()` next to {@link appScopeBootstrap} and handed in as an argument, so anything it\n * closed over at module scope would be undefined in the inline head copy. Split out from the\n * bootstrap purely to keep both halves reviewable.\n */\nexport const createAppScopeFactory: AppScopeFactoryBuilder = (w, appCtx) => {\n const isAppKey = (key: unknown): key is string =>\n typeof key === 'string' && key.indexOf('app.') === 0;\n const bucketKey = (key: string): string => key.slice(4);\n const realSalla = (): Record<string, unknown> => w.salla || w.Salla || {};\n const realConfig = (): Record<string, unknown> =>\n (realSalla().config as Record<string, unknown>) || {};\n const passthrough = (obj: Record<string, unknown>, prop: string | symbol): unknown => {\n const member = obj[prop as string];\n return typeof member === 'function' ? member.bind(obj) : member;\n };\n\n const createAppScope = (scopeId: string): SallaSDK => {\n const bucket = (): AppConfigBag => (appCtx[scopeId] = appCtx[scopeId] || {});\n\n const getConfig = (key: string, fallback?: unknown): unknown => {\n if (isAppKey(key)) {\n const sub = bucketKey(key);\n const b = bucket();\n // `app.*` miss returns the caller default, never the real config — a missing app\n // setting must not resolve to a same-named global.\n return sub in b ? b[sub] : fallback;\n }\n const cfg = realConfig();\n return typeof cfg.get === 'function'\n ? (cfg.get as (k: string, d?: unknown) => unknown)(key, fallback)\n : fallback;\n };\n\n const setConfig = (key: string, value: unknown): unknown => {\n if (isAppKey(key)) {\n bucket()[bucketKey(key)] = value;\n return value;\n }\n const cfg = realConfig();\n return typeof cfg.set === 'function'\n ? (cfg.set as (k: string, v: unknown) => unknown)(key, value)\n : value;\n };\n\n const hasConfig = (key: string): boolean =>\n isAppKey(key) ? bucketKey(key) in bucket() : key in realConfig();\n\n const configProxy = new Proxy({} as Record<string, unknown>, {\n get(_t, prop) {\n if (prop === 'get') return getConfig;\n if (prop === 'set') return setConfig;\n if (prop === 'has') return hasConfig;\n if (isAppKey(prop)) return getConfig(prop);\n return passthrough(realConfig(), prop);\n },\n set(_t, prop, value) {\n setConfig(prop as string, value);\n return true;\n },\n has(_t, prop) {\n return hasConfig(prop as string);\n },\n });\n\n return new Proxy({} as Record<string, unknown>, {\n get(_t, prop) {\n return prop === 'config' ? configProxy : passthrough(realSalla(), prop);\n },\n set(_t, prop, value) {\n // Reassigning `salla.config` wholesale would escape the sandbox; swallow it.\n if (prop === 'config') return true;\n realSalla()[prop as string] = value;\n return true;\n },\n }) as unknown as SallaSDK;\n };\n\n return createAppScope;\n};\n\n/**\n * Installs `window.Salla.appScope`, seeded with `contexts` and sandboxed by `makeFactory`.\n *\n * MUST stay self-contained (only `window`/`Object` and its arguments): it's serialized via\n * `.toString()` and inlined into the SSR head so the factory exists at parse time — before the\n * SDK init/hydration a CDN snippet's `onReady` races, else it throws `Salla.appScope is not a\n * function`. `makeFactory` is passed in rather than imported for exactly that reason. Also\n * called directly by `installAppScope` (tests/fallback).\n *\n * Idempotent: the factory is first-write-wins, while buckets are merged per scope (also\n * first-write-wins) so a later call can seed scopes the first one had no data for. `appCtx` is\n * closure-private (namespacing, not security: buckets are public-only and the boundary is\n * server-side).\n */\nexport function appScopeBootstrap(\n contexts: AppScopeContexts,\n makeFactory: AppScopeFactoryBuilder\n): void {\n if (typeof window === 'undefined') return;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const w = window as any;\n const Salla = (w.Salla = w.Salla || {});\n if (Salla.appScope) {\n // Already installed (normally by the inline head copy). The factory is first-write-wins,\n // but buckets are not: the head may have installed with none of them — the settings\n // endpoint can fail or lag behind the snippets one — so hand them to the existing install.\n if (Salla.__appScopeSeed) Salla.__appScopeSeed(contexts);\n return;\n }\n\n // Live bag + pristine snapshot (for mock overlays). Copy, don't alias: a snippet may\n // `config.set('app.x')` and the payload can be a cached response.\n const appCtx: Record<string, AppConfigBag> = {};\n const base: Record<string, AppConfigBag> = {};\n // Which scopes already got their real bucket, so a later seed can't overwrite one.\n const seeded: Record<string, boolean> = {};\n const seed = (next: AppScopeContexts): void => {\n const bags = (next && next.apps) || {};\n Object.keys(bags).forEach((scopeId) => {\n if (seeded[scopeId]) return;\n seeded[scopeId] = true;\n appCtx[scopeId] = Object.assign({}, appCtx[scopeId] || {}, bags[scopeId] || {});\n base[scopeId] = Object.assign({}, appCtx[scopeId]);\n });\n };\n seed(contexts);\n\n const createAppScope = makeFactory(w, appCtx);\n Salla.appScope = (scopeId: string): SallaSDK => createAppScope(scopeId);\n\n // Fill in buckets for scopes not seeded yet (first-write-wins per scope). Lets the head\n // install the factory unconditionally — at parse time, before any snippet's onReady — and\n // still pick up buckets that only the client managed to fetch.\n Salla.__appScopeSeed = (next: AppScopeContexts): void => seed(next);\n\n // Overlay preview mocks onto an app's pristine baseline, so fields the partner did not mock\n // keep their real values. Returns false for an unknown scope or before install.\n Salla.__appScopeMock = (scopeId: string, mocks: AppConfigBag): boolean => {\n if (!(scopeId in base)) return false;\n appCtx[scopeId] = Object.assign({}, base[scopeId], mocks);\n return true;\n };\n}\n\n/** Overlay preview mocks onto one app's bucket (over its pristine values). Delegates to the\n * bootstrap's `__appScopeMock`, so it works for both install paths. False if unknown/uninstalled. */\nexport function applyAppScopeMocks(appScopeId: string, mocks: AppConfigBag): boolean {\n if (!isBrowser) return false;\n const mock = (window.Salla as unknown as { __appScopeMock?: MockApplier } | undefined)\n ?.__appScopeMock;\n return mock?.(appScopeId, mocks) ?? false;\n}\n\ntype MockApplier = (appScopeId: string, mocks: AppConfigBag) => boolean;\n\n/** Serialize the installer into an inline `<script>` body seeded with `contexts` — both halves\n * via `.toString()`, hence their self-contained requirement. See `rootHead`. */\nexport function renderAppScopeInstallScript(contexts: AppScopeContexts): string {\n // Bucket values are partner-set, so escape the JSON seed against a `</script>` breakout.\n // The function sources have no `<`, so they need no escaping.\n const json = escapeForInlineScript(JSON.stringify(contexts));\n return `(${appScopeBootstrap.toString()})(${json},${createAppScopeFactory.toString()});`;\n}\n\n/** Install `Salla.appScope` on the client, or seed buckets into the inline SSR head copy that\n * already installed it. No-op on the server. Fallback for unseeded loads + the unit-test entry\n * point. */\nexport function installAppScope(contexts: AppScopeContexts): void {\n if (!isBrowser) return;\n appScopeBootstrap(contexts, createAppScopeFactory);\n}\n","import { escapeForInlineScript } from './inline-script';\n\nconst registered = new Set<string>();\n\nlet retryArmed = false;\n\n/**\n * Declare hook slots the theme renders itself so apps may mount into them.\n *\n * The SDK rejects `mount()` for any name absent from its `_themeSlots` whitelist, so a theme\n * rendering its own `<salla-hook>` must register the name. Call at module scope; the engine\n * applies the names via {@link applyThemeHookSlots}.\n */\nexport function registerThemeHookSlots(...names: string[]): void {\n for (const name of names) registered.add(name);\n}\n\n/** Push the registered names in. Returns false if the SDK hasn't exposed the list yet. */\nfunction pushSlots(): boolean {\n const slots = window.salla?.hooks?._themeSlots;\n if (!Array.isArray(slots)) return false;\n for (const name of registered) if (!slots.includes(name)) slots.push(name);\n return true;\n}\n\n/**\n * Push every registered slot name into the SDK whitelist. Idempotent. Engine-only.\n *\n * The SDK's hooks module may attach after this runs, so a first no-op falls back to a\n * one-shot retry on `twilight::initiated` — still before apps mount from their own onReady.\n *\n * This is only the late backstop: the whitelist is primarily seeded at parse time by the\n * inline head script from {@link renderThemeHookSlotsScript}, because an app's snippet\n * registers its `onReady` callback before React ever hydrates.\n */\nexport function applyThemeHookSlots(): void {\n if (typeof window === 'undefined' || registered.size === 0) return;\n if (pushSlots() || retryArmed) return;\n\n retryArmed = true;\n window.addEventListener('twilight::initiated', () => void pushSlots(), { once: true });\n}\n\n/** The slot names registered so far. Read by `rootHead` when rendering the inline script. */\nexport function getRegisteredThemeHookSlots(): string[] {\n return [...registered];\n}\n\n/**\n * Serialize the whitelist push into an inline head `<script>` body, so the slots are\n * registered at parse time.\n *\n * Ordering is the whole point: CDN snippets are parser-inserted `<script defer>` tags in the\n * body, so an app's `Salla.onReady` callback is registered long before React hydrates and runs\n * {@link applyThemeHookSlots}. Whichever `twilight::initiated` listener was added first runs\n * first, so the push must be armed from the head — otherwise the SDK rejects the app's\n * `hooks.mount()` with \"Hook <name> is not allowed\" and the app never renders.\n *\n * Returns null when the theme registered no slots. Kept self-contained (only `window`) since\n * it ships as raw source, not as a bundled module.\n */\nexport function renderThemeHookSlotsScript(names: string[] = getRegisteredThemeHookSlots()) {\n if (!names.length) return null;\n const json = escapeForInlineScript(JSON.stringify(names));\n return (\n `(function(names){` +\n `var w=window;` +\n `function push(){` +\n `var h=w.salla&&w.salla.hooks;var slots=h&&h._themeSlots;` +\n `if(!Array.isArray(slots))return false;` +\n `for(var i=0;i<names.length;i++)if(slots.indexOf(names[i])<0)slots.push(names[i]);` +\n `return true}` +\n `if(push())return;` +\n `w.addEventListener('twilight::initiated',function(){push()},{once:true})` +\n `})(${json});`\n );\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/utils/app-scope.ts","../src/utils/theme-hook-slots.ts"],"names":[],"mappings":";;;AAGA,IAAM,SAAA,GAAY,OAAO,MAAA,KAAW,WAAA;AA2B7B,IAAM,qBAAA,GAAgD,CAAC,CAAA,EAAG,MAAA,KAAW;AAC1E,EAAA,MAAM,QAAA,GAAW,CAAC,GAAA,KAChB,OAAO,QAAQ,QAAA,IAAY,GAAA,CAAI,OAAA,CAAQ,MAAM,CAAA,KAAM,CAAA;AACrD,EAAA,MAAM,SAAA,GAAY,CAAC,GAAA,KAAwB,GAAA,CAAI,MAAM,CAAC,CAAA;AACtD,EAAA,MAAM,YAAY,MAA+B,CAAA,CAAE,KAAA,IAAS,CAAA,CAAE,SAAS,EAAC;AACxE,EAAA,MAAM,UAAA,GAAa,MAChB,SAAA,EAAU,CAAE,UAAsC,EAAC;AACtD,EAAA,MAAM,WAAA,GAAc,CAAC,GAAA,EAA8B,IAAA,KAAmC;AACpF,IAAA,MAAM,MAAA,GAAS,IAAI,IAAc,CAAA;AACjC,IAAA,OAAO,OAAO,MAAA,KAAW,UAAA,GAAa,MAAA,CAAO,IAAA,CAAK,GAAG,CAAA,GAAI,MAAA;AAAA,EAC3D,CAAA;AAEA,EAAA,MAAM,cAAA,GAAiB,CAAC,OAAA,KAA8B;AACpD,IAAA,MAAM,MAAA,GAAS,MAAqB,MAAA,CAAO,OAAO,IAAI,MAAA,CAAO,OAAO,KAAK,EAAC;AAE1E,IAAA,MAAM,SAAA,GAAY,CAAC,GAAA,EAAa,QAAA,KAAgC;AAC9D,MAAA,IAAI,QAAA,CAAS,GAAG,CAAA,EAAG;AACjB,QAAA,MAAM,GAAA,GAAM,UAAU,GAAG,CAAA;AACzB,QAAA,MAAM,IAAI,MAAA,EAAO;AAGjB,QAAA,OAAO,GAAA,IAAO,CAAA,GAAI,CAAA,CAAE,GAAG,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O,CAAC,GAAG,UAAU,CAAA;AACvB;AAeO,SAAS,0BAAA,CAA2B,KAAA,GAAkB,2BAAA,EAA4B,EAAG;AAC1F,EAAA,IAAI,CAAC,KAAA,CAAM,MAAA,EAAQ,OAAO,IAAA;AAC1B,EAAA,MAAM,IAAA,GAAO,qBAAA,CAAsB,IAAA,CAAK,SAAA,CAAU,KAAK,CAAC,CAAA;AACxD,EAAA,OACE,wUASM,IAAI,CAAA,EAAA,CAAA;AAEd","file":"chunk-YGDAYFQY.js","sourcesContent":["import type { SallaSDK } from '../types/salla-sdk';\nimport { escapeForInlineScript } from './inline-script';\n\nconst isBrowser = typeof window !== 'undefined';\n\n/** One app's private `app.*` bag, keyed without the `app.` prefix (`app.color` → `color`). */\nexport type AppConfigBag = Record<string, unknown>;\n\n/** One public `app.*` bucket per app, keyed by appScopeId. Everything else is read from the\n * real `salla.config` at runtime. */\nexport interface AppScopeContexts {\n apps: Record<string, AppConfigBag>;\n}\n\n/** Builds the `scopeId → sandboxed SDK` factory over a live bucket bag. */\nexport type AppScopeFactoryBuilder = (\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n w: any,\n appCtx: Record<string, AppConfigBag>\n) => (scopeId: string) => SallaSDK;\n\n/**\n * The sandbox itself: proxies that resolve `app.*` against the app's own bucket and pass\n * everything else through to the real SDK.\n *\n * MUST stay self-contained (only `Object`/`Proxy` and its two arguments): it is serialized via\n * `.toString()` next to {@link appScopeBootstrap} and handed in as an argument, so anything it\n * closed over at module scope would be undefined in the inline head copy. Split out from the\n * bootstrap purely to keep both halves reviewable.\n */\nexport const createAppScopeFactory: AppScopeFactoryBuilder = (w, appCtx) => {\n const isAppKey = (key: unknown): key is string =>\n typeof key === 'string' && key.indexOf('app.') === 0;\n const bucketKey = (key: string): string => key.slice(4);\n const realSalla = (): Record<string, unknown> => w.salla || w.Salla || {};\n const realConfig = (): Record<string, unknown> =>\n (realSalla().config as Record<string, unknown>) || {};\n const passthrough = (obj: Record<string, unknown>, prop: string | symbol): unknown => {\n const member = obj[prop as string];\n return typeof member === 'function' ? member.bind(obj) : member;\n };\n\n const createAppScope = (scopeId: string): SallaSDK => {\n const bucket = (): AppConfigBag => (appCtx[scopeId] = appCtx[scopeId] || {});\n\n const getConfig = (key: string, fallback?: unknown): unknown => {\n if (isAppKey(key)) {\n const sub = bucketKey(key);\n const b = bucket();\n // `app.*` miss returns the caller default, never the real config — a missing app\n // setting must not resolve to a same-named global.\n return sub in b ? b[sub] : fallback;\n }\n const cfg = realConfig();\n return typeof cfg.get === 'function'\n ? (cfg.get as (k: string, d?: unknown) => unknown)(key, fallback)\n : fallback;\n };\n\n const setConfig = (key: string, value: unknown): unknown => {\n if (isAppKey(key)) {\n bucket()[bucketKey(key)] = value;\n return value;\n }\n const cfg = realConfig();\n return typeof cfg.set === 'function'\n ? (cfg.set as (k: string, v: unknown) => unknown)(key, value)\n : value;\n };\n\n const hasConfig = (key: string): boolean =>\n isAppKey(key) ? bucketKey(key) in bucket() : key in realConfig();\n\n const configProxy = new Proxy({} as Record<string, unknown>, {\n get(_t, prop) {\n if (prop === 'get') return getConfig;\n if (prop === 'set') return setConfig;\n if (prop === 'has') return hasConfig;\n if (isAppKey(prop)) return getConfig(prop);\n return passthrough(realConfig(), prop);\n },\n set(_t, prop, value) {\n setConfig(prop as string, value);\n return true;\n },\n has(_t, prop) {\n return hasConfig(prop as string);\n },\n });\n\n return new Proxy({} as Record<string, unknown>, {\n get(_t, prop) {\n return prop === 'config' ? configProxy : passthrough(realSalla(), prop);\n },\n set(_t, prop, value) {\n // Reassigning `salla.config` wholesale would escape the sandbox; swallow it.\n if (prop === 'config') return true;\n realSalla()[prop as string] = value;\n return true;\n },\n }) as unknown as SallaSDK;\n };\n\n return createAppScope;\n};\n\n/**\n * Installs `window.Salla.appScope`, seeded with `contexts` and sandboxed by `makeFactory`.\n *\n * MUST stay self-contained (only `window`/`Object` and its arguments): it's serialized via\n * `.toString()` and inlined into the SSR head so the factory exists at parse time — before the\n * SDK init/hydration a CDN snippet's `onReady` races, else it throws `Salla.appScope is not a\n * function`. `makeFactory` is passed in rather than imported for exactly that reason. Also\n * called directly by `installAppScope` (tests/fallback).\n *\n * Idempotent: the factory is first-write-wins, while buckets are merged per scope (also\n * first-write-wins) so a later call can seed scopes the first one had no data for. `appCtx` is\n * closure-private (namespacing, not security: buckets are public-only and the boundary is\n * server-side).\n */\nexport function appScopeBootstrap(\n contexts: AppScopeContexts,\n makeFactory: AppScopeFactoryBuilder\n): void {\n if (typeof window === 'undefined') return;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const w = window as any;\n const Salla = (w.Salla = w.Salla || {});\n if (Salla.appScope) {\n // Already installed (normally by the inline head copy). The factory is first-write-wins,\n // but buckets are not: the head may have installed with none of them — the settings\n // endpoint can fail or lag behind the snippets one — so hand them to the existing install.\n if (Salla.__appScopeSeed) Salla.__appScopeSeed(contexts);\n return;\n }\n\n // Live bag + pristine snapshot (for mock overlays). Copy, don't alias: a snippet may\n // `config.set('app.x')` and the payload can be a cached response.\n const appCtx: Record<string, AppConfigBag> = {};\n const base: Record<string, AppConfigBag> = {};\n // Which scopes already got their real bucket, so a later seed can't overwrite one.\n const seeded: Record<string, boolean> = {};\n const seed = (next: AppScopeContexts): void => {\n const bags = (next && next.apps) || {};\n Object.keys(bags).forEach((scopeId) => {\n if (seeded[scopeId]) return;\n seeded[scopeId] = true;\n appCtx[scopeId] = Object.assign({}, appCtx[scopeId] || {}, bags[scopeId] || {});\n base[scopeId] = Object.assign({}, appCtx[scopeId]);\n });\n };\n seed(contexts);\n\n const createAppScope = makeFactory(w, appCtx);\n Salla.appScope = (scopeId: string): SallaSDK => createAppScope(scopeId);\n\n // Fill in buckets for scopes not seeded yet (first-write-wins per scope). Lets the head\n // install the factory unconditionally — at parse time, before any snippet's onReady — and\n // still pick up buckets that only the client managed to fetch.\n Salla.__appScopeSeed = (next: AppScopeContexts): void => seed(next);\n\n // Overlay preview mocks onto an app's pristine baseline, so fields the partner did not mock\n // keep their real values. Returns false for an unknown scope or before install.\n Salla.__appScopeMock = (scopeId: string, mocks: AppConfigBag): boolean => {\n if (!(scopeId in base)) return false;\n appCtx[scopeId] = Object.assign({}, base[scopeId], mocks);\n return true;\n };\n}\n\n/** Overlay preview mocks onto one app's bucket (over its pristine values). Delegates to the\n * bootstrap's `__appScopeMock`, so it works for both install paths. False if unknown/uninstalled. */\nexport function applyAppScopeMocks(appScopeId: string, mocks: AppConfigBag): boolean {\n if (!isBrowser) return false;\n const mock = (window.Salla as unknown as { __appScopeMock?: MockApplier } | undefined)\n ?.__appScopeMock;\n return mock?.(appScopeId, mocks) ?? false;\n}\n\ntype MockApplier = (appScopeId: string, mocks: AppConfigBag) => boolean;\n\n/** Serialize the installer into an inline `<script>` body seeded with `contexts` — both halves\n * via `.toString()`, hence their self-contained requirement. See `rootHead`. */\nexport function renderAppScopeInstallScript(contexts: AppScopeContexts): string {\n // Bucket values are partner-set, so escape the JSON seed against a `</script>` breakout.\n // The function sources have no `<`, so they need no escaping.\n const json = escapeForInlineScript(JSON.stringify(contexts));\n return `(${appScopeBootstrap.toString()})(${json},${createAppScopeFactory.toString()});`;\n}\n\n/** Install `Salla.appScope` on the client, or seed buckets into the inline SSR head copy that\n * already installed it. No-op on the server. Fallback for unseeded loads + the unit-test entry\n * point. */\nexport function installAppScope(contexts: AppScopeContexts): void {\n if (!isBrowser) return;\n appScopeBootstrap(contexts, createAppScopeFactory);\n}\n","import { escapeForInlineScript } from './inline-script';\n\nconst registered = new Set<string>();\n\nlet retryArmed = false;\n\n/**\n * Declare hook slots the theme renders itself so apps may mount into them.\n *\n * The SDK rejects `mount()` for any name absent from its `_themeSlots` whitelist, so a theme\n * rendering its own `<salla-hook>` must register the name. Call at module scope; the engine\n * applies the names via {@link applyThemeHookSlots}.\n */\nexport function registerThemeHookSlots(...names: string[]): void {\n for (const name of names) registered.add(name);\n}\n\n/** Push the registered names in. Returns false if the SDK hasn't exposed the list yet. */\nfunction pushSlots(): boolean {\n const slots = window.salla?.hooks?._themeSlots;\n if (!Array.isArray(slots)) return false;\n for (const name of registered) if (!slots.includes(name)) slots.push(name);\n return true;\n}\n\n/**\n * Push every registered slot name into the SDK whitelist. Idempotent. Engine-only.\n *\n * The SDK's hooks module may attach after this runs, so a first no-op falls back to a\n * one-shot retry on `twilight::initiated` — still before apps mount from their own onReady.\n *\n * This is only the late backstop: the whitelist is primarily seeded at parse time by the\n * inline head script from {@link renderThemeHookSlotsScript}, because an app's snippet\n * registers its `onReady` callback before React ever hydrates.\n */\nexport function applyThemeHookSlots(): void {\n if (typeof window === 'undefined' || registered.size === 0) return;\n if (pushSlots() || retryArmed) return;\n\n retryArmed = true;\n window.addEventListener('twilight::initiated', () => void pushSlots(), { once: true });\n}\n\n/** The slot names registered so far. Read by `rootHead` when rendering the inline script. */\nexport function getRegisteredThemeHookSlots(): string[] {\n return [...registered];\n}\n\n/**\n * Serialize the whitelist push into an inline head `<script>` body, so the slots are\n * registered at parse time.\n *\n * Ordering is the whole point: CDN snippets are parser-inserted `<script defer>` tags in the\n * body, so an app's `Salla.onReady` callback is registered long before React hydrates and runs\n * {@link applyThemeHookSlots}. Whichever `twilight::initiated` listener was added first runs\n * first, so the push must be armed from the head — otherwise the SDK rejects the app's\n * `hooks.mount()` with \"Hook <name> is not allowed\" and the app never renders.\n *\n * Returns null when the theme registered no slots. Kept self-contained (only `window`) since\n * it ships as raw source, not as a bundled module.\n */\nexport function renderThemeHookSlotsScript(names: string[] = getRegisteredThemeHookSlots()) {\n if (!names.length) return null;\n const json = escapeForInlineScript(JSON.stringify(names));\n return (\n `(function(names){` +\n `var w=window;` +\n `function push(){` +\n `var h=w.salla&&w.salla.hooks;var slots=h&&h._themeSlots;` +\n `if(!Array.isArray(slots))return false;` +\n `for(var i=0;i<names.length;i++)if(slots.indexOf(names[i])<0)slots.push(names[i]);` +\n `return true}` +\n `if(push())return;` +\n `w.addEventListener('twilight::initiated',function(){push()},{once:true})` +\n `})(${json});`\n );\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { api } from './chunk-
|
|
1
|
+
import { api } from './chunk-BHU25UEW.js';
|
|
2
2
|
import { queryOptions } from '@tanstack/react-query';
|
|
3
3
|
|
|
4
4
|
var notification = {
|
|
@@ -24,5 +24,5 @@ var notification = {
|
|
|
24
24
|
};
|
|
25
25
|
|
|
26
26
|
export { notification };
|
|
27
|
-
//# sourceMappingURL=chunk-
|
|
28
|
-
//# sourceMappingURL=chunk-
|
|
27
|
+
//# sourceMappingURL=chunk-YGSU36MZ.js.map
|
|
28
|
+
//# sourceMappingURL=chunk-YGSU36MZ.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/api/notification.ts"],"names":[],"mappings":";;;AAcO,IAAM,YAAA,GAAe;AAAA,EAC1B,MAAM,YAAgD;AACpD,IAAA,MAAM,WAAW,MAAM,GAAA,CACpB,GAAA,CAAI,eAAe,EACnB,IAAA,EAAmF;AACtF,IAAA,OAAO;AAAA,MACL,IAAA,EAAM,QAAA,CAAS,IAAA,IAAQ,EAAC;AAAA,MACxB,QAAQ,QAAA,CAAS;AAAA,KACnB;AAAA,EACF,CAAA;AAAA,EAEA,UAAA,EAAY,OAAO,EAAA,KAA8B;AAC/C,IAAA,MAAM,IAAI,GAAA,CAAI,CAAA,cAAA,EAAiB,EAAE,CAAA,KAAA,CAAO,EAAE,IAAA,EAAK;AAAA,EACjD,CAAA;AAAA,EAEA,eAAe,YAA2B;AACxC,IAAA,MAAM,GAAA,CAAI,GAAA,CAAI,wBAAwB,CAAA,CAAE,IAAA,EAAK;AAAA,EAC/C,CAAA;AAAA,EAEA,OAAA,EAAS;AAAA,IACP,IAAA,EAAM,MACJ,YAAA,CAAa;AAAA,MACX,QAAA,EAAU,CAAC,eAAA,EAAiB,MAAM,CAAA;AAAA,MAClC,OAAA,EAAS,MAAM,YAAA,CAAa,IAAA;AAAK,KAClC;AAAA;AAEP","file":"chunk-
|
|
1
|
+
{"version":3,"sources":["../src/api/notification.ts"],"names":[],"mappings":";;;AAcO,IAAM,YAAA,GAAe;AAAA,EAC1B,MAAM,YAAgD;AACpD,IAAA,MAAM,WAAW,MAAM,GAAA,CACpB,GAAA,CAAI,eAAe,EACnB,IAAA,EAAmF;AACtF,IAAA,OAAO;AAAA,MACL,IAAA,EAAM,QAAA,CAAS,IAAA,IAAQ,EAAC;AAAA,MACxB,QAAQ,QAAA,CAAS;AAAA,KACnB;AAAA,EACF,CAAA;AAAA,EAEA,UAAA,EAAY,OAAO,EAAA,KAA8B;AAC/C,IAAA,MAAM,IAAI,GAAA,CAAI,CAAA,cAAA,EAAiB,EAAE,CAAA,KAAA,CAAO,EAAE,IAAA,EAAK;AAAA,EACjD,CAAA;AAAA,EAEA,eAAe,YAA2B;AACxC,IAAA,MAAM,GAAA,CAAI,GAAA,CAAI,wBAAwB,CAAA,CAAE,IAAA,EAAK;AAAA,EAC/C,CAAA;AAAA,EAEA,OAAA,EAAS;AAAA,IACP,IAAA,EAAM,MACJ,YAAA,CAAa;AAAA,MACX,QAAA,EAAU,CAAC,eAAA,EAAiB,MAAM,CAAA;AAAA,MAClC,OAAA,EAAS,MAAM,YAAA,CAAa,IAAA;AAAK,KAClC;AAAA;AAEP","file":"chunk-YGSU36MZ.js","sourcesContent":["import { queryOptions } from '@tanstack/react-query';\nimport { api } from './client';\nimport type { Notification } from '../routes/account/notifications/types';\n\nexport interface NotificationsListResponse {\n data: Notification[];\n cursor: {\n current: number;\n previous: number | null;\n next: number | null;\n count: number;\n };\n}\n\nexport const notification = {\n list: async (): Promise<NotificationsListResponse> => {\n const response = await api\n .get('notifications')\n .json<{ data: Notification[] | null; cursor: NotificationsListResponse['cursor'] }>();\n return {\n data: response.data ?? [],\n cursor: response.cursor,\n };\n },\n\n markAsRead: async (id: number): Promise<void> => {\n await api.put(`notifications/${id}/read`).json();\n },\n\n markAllAsRead: async (): Promise<void> => {\n await api.put('notifications/read-all').json();\n },\n\n queries: {\n list: () =>\n queryOptions({\n queryKey: ['notifications', 'list'],\n queryFn: () => notification.list(),\n }),\n },\n};\n"]}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { filesCdn, cdn } from './chunk-BHU25UEW.js';
|
|
2
|
+
import { storeTranslationsQueryKey, translationsQueryKey, composeMessages, isPlainObject } from './chunk-OGQXRBCR.js';
|
|
3
|
+
import { queryOptions } from '@tanstack/react-query';
|
|
4
|
+
|
|
5
|
+
var LEGACY_GLOBAL_FILE = "js/translations.json";
|
|
6
|
+
function commonTranslationsPath(locale) {
|
|
7
|
+
return `translations/common/${locale}.json`;
|
|
8
|
+
}
|
|
9
|
+
function storeTranslationsPath(storeId, locale) {
|
|
10
|
+
return `translations/${storeId}/${locale}.json`;
|
|
11
|
+
}
|
|
12
|
+
async function readLocaleFile(path, { failLoudly = false } = {}) {
|
|
13
|
+
const unreadable = (reason, cause) => {
|
|
14
|
+
if (failLoudly) throw new Error(`[translations] ${path}: ${reason}`, { cause });
|
|
15
|
+
console.warn("[translations]", reason, path, cause ?? "");
|
|
16
|
+
return null;
|
|
17
|
+
};
|
|
18
|
+
try {
|
|
19
|
+
const response = await filesCdn.get(path, { throwHttpErrors: false, timeout: 5e3 });
|
|
20
|
+
if (response.status === 404) return null;
|
|
21
|
+
if (!response.ok) {
|
|
22
|
+
return unreadable(`answered ${response.status}`);
|
|
23
|
+
}
|
|
24
|
+
const data = await response.json();
|
|
25
|
+
if (!isPlainObject(data)) {
|
|
26
|
+
return unreadable("is not a JSON object");
|
|
27
|
+
}
|
|
28
|
+
return data;
|
|
29
|
+
} catch (error) {
|
|
30
|
+
if (error instanceof Error && error.message.startsWith("[translations]")) throw error;
|
|
31
|
+
return unreadable("could not be read", error);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
async function readLegacyGlobal(locale) {
|
|
35
|
+
try {
|
|
36
|
+
const data = await cdn.get(LEGACY_GLOBAL_FILE, { timeout: 5e3 }).json();
|
|
37
|
+
const forLocale = data?.[`${locale}.trans`];
|
|
38
|
+
return isPlainObject(forLocale) ? forLocale : null;
|
|
39
|
+
} catch {
|
|
40
|
+
console.warn("[translations] the legacy global file could not be read either");
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
var translations = {
|
|
45
|
+
/**
|
|
46
|
+
* The platform's copy for `locale`.
|
|
47
|
+
*
|
|
48
|
+
* One file, so one request. See the file comment for why the merchant's own
|
|
49
|
+
* wording is not merged in here yet and what it is waiting on.
|
|
50
|
+
*/
|
|
51
|
+
get: async (locale) => {
|
|
52
|
+
const common = await readLocaleFile(commonTranslationsPath(locale));
|
|
53
|
+
const base = common ?? await readLegacyGlobal(locale);
|
|
54
|
+
if (!base) return null;
|
|
55
|
+
return { [`${locale}.trans`]: base };
|
|
56
|
+
},
|
|
57
|
+
/**
|
|
58
|
+
* This merchant's own wording for `locale`, or `null` if they have none.
|
|
59
|
+
*
|
|
60
|
+
* Only worth calling when `settings.languages[<ISO>].has_custom_translations`
|
|
61
|
+
* says there is something to get. Most stores have never customised a word,
|
|
62
|
+
* and a miss here is an uncached round trip — `cf-cache-status: DYNAMIC` on a
|
|
63
|
+
* 404 — on the critical path of an SSR render. The flag is what makes this
|
|
64
|
+
* free for everyone who does not use it.
|
|
65
|
+
*
|
|
66
|
+
* Returned unwrapped, unlike {@link translations.get}: this is merged into
|
|
67
|
+
* that one's messages rather than handed to i18next on its own.
|
|
68
|
+
*/
|
|
69
|
+
forStore: async (storeId, locale) => (
|
|
70
|
+
// `failLoudly`, unlike the platform file: this is only ever called because
|
|
71
|
+
// the settings said overrides exist, so a 500, a timeout or a body that is
|
|
72
|
+
// not JSON is a failure to read them — not a store that has none. Returning
|
|
73
|
+
// `null` there would cache "no overrides" as a success, skip the query's
|
|
74
|
+
// retry, and serve Salla's wording in place of the merchant's until the
|
|
75
|
+
// entry expired. A 404 still means absent, and `rootBeforeLoad` catches the
|
|
76
|
+
// throw and keeps the platform copy, so the worst case is unchanged.
|
|
77
|
+
readLocaleFile(storeTranslationsPath(storeId, locale), { failLoudly: true })
|
|
78
|
+
),
|
|
79
|
+
/**
|
|
80
|
+
* The platform's copy for `locale` with this merchant's wording laid over it.
|
|
81
|
+
*
|
|
82
|
+
* Takes the two as values rather than fetching them, so the caller decides
|
|
83
|
+
* whether the second request happens at all and both stay separately cached.
|
|
84
|
+
*/
|
|
85
|
+
/**
|
|
86
|
+
* The platform's copy for `locale` with this merchant's wording over it.
|
|
87
|
+
*
|
|
88
|
+
* Delegates to `composeMessages`, which every other reader of these two
|
|
89
|
+
* entries also uses — see `api/messages.ts` for why there is exactly one.
|
|
90
|
+
*/
|
|
91
|
+
merge: (common, overrides, locale) => composeMessages(common, overrides, locale) ?? null,
|
|
92
|
+
queries: {
|
|
93
|
+
/**
|
|
94
|
+
* @param locale taken as an argument rather than read from the twilight
|
|
95
|
+
* context, and that is load-bearing. This key is built on the server, on
|
|
96
|
+
* hydration, and again lazily from the context accessor; if any of the
|
|
97
|
+
* three read a locale the others had not been given yet, the hydrated page
|
|
98
|
+
* would miss the dehydrated entry and refetch both files it was just
|
|
99
|
+
* handed. Every caller already has the locale in hand.
|
|
100
|
+
*
|
|
101
|
+
* The store is deliberately **not** in the key. One document serves one
|
|
102
|
+
* store — a request that names a different one is redirected with
|
|
103
|
+
* `reloadDocument`, so the client never changes store under a live cache —
|
|
104
|
+
* and adding a value that resolves from the request on the server and from
|
|
105
|
+
* the injected env on the client is how a key stops matching across
|
|
106
|
+
* hydration.
|
|
107
|
+
*/
|
|
108
|
+
byLocale: (locale) => queryOptions({
|
|
109
|
+
queryKey: translationsQueryKey(locale),
|
|
110
|
+
queryFn: () => translations.get(locale)
|
|
111
|
+
}),
|
|
112
|
+
/**
|
|
113
|
+
* This merchant's overrides, cached apart from the platform's copy.
|
|
114
|
+
*
|
|
115
|
+
* Its own entry rather than a wider `byLocale` key, so the common file is
|
|
116
|
+
* fetched and dehydrated once per language whatever the store does, and a
|
|
117
|
+
* store with no overrides never has an entry at all. Both sides compute the
|
|
118
|
+
* key from the settings payload, so the hydrated page finds what the server
|
|
119
|
+
* dehydrated instead of refetching it.
|
|
120
|
+
*/
|
|
121
|
+
byStore: (storeId, locale) => queryOptions({
|
|
122
|
+
queryKey: storeTranslationsQueryKey(storeId, locale),
|
|
123
|
+
queryFn: () => translations.forStore(storeId, locale)
|
|
124
|
+
})
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
export { commonTranslationsPath, storeTranslationsPath, translations };
|
|
129
|
+
//# sourceMappingURL=chunk-ZOZLNUNA.js.map
|
|
130
|
+
//# sourceMappingURL=chunk-ZOZLNUNA.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/api/translations.ts"],"names":[],"mappings":";;;;AAiEA,IAAM,kBAAA,GAAqB,sBAAA;AAGpB,SAAS,uBAAuB,MAAA,EAAwB;AAC7D,EAAA,OAAO,uBAAuB,MAAM,CAAA,KAAA,CAAA;AACtC;AAWO,SAAS,qBAAA,CAAsB,SAA0B,MAAA,EAAwB;AACtF,EAAA,OAAO,CAAA,aAAA,EAAgB,OAAO,CAAA,CAAA,EAAI,MAAM,CAAA,KAAA,CAAA;AAC1C;AAUA,eAAe,eACb,IAAA,EACA,EAAE,aAAa,KAAA,EAAM,GAA8B,EAAC,EAC1B;AAE1B,EAAA,MAAM,UAAA,GAAa,CAAC,MAAA,EAAgB,KAAA,KAA0B;AAC5D,IAAA,IAAI,UAAA,EAAY,MAAM,IAAI,KAAA,CAAM,CAAA,eAAA,EAAkB,IAAI,CAAA,EAAA,EAAK,MAAM,CAAA,CAAA,EAAI,EAAE,KAAA,EAAO,CAAA;AAC9E,IAAA,OAAA,CAAQ,IAAA,CAAK,gBAAA,EAAkB,MAAA,EAAQ,IAAA,EAAM,SAAS,EAAE,CAAA;AACxD,IAAA,OAAO,IAAA;AAAA,EACT,CAAA;AAEA,EAAA,IAAI;AACF,IAAA,MAAM,QAAA,GAAW,MAAM,QAAA,CAAS,GAAA,CA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,OAAA,EAAS,MAAM,YAAA,CAAa,QAAA,CAAS,SAAS,MAAM;AAAA,KACrD;AAAA;AAEP","file":"chunk-ZOZLNUNA.js","sourcesContent":["/**\n * @fileoverview Where a storefront's words come from.\n *\n * Two files, merged: the platform's copy for this language, and the merchant's\n * own edits for this language and this store. Both are plain JSON objects on\n * the uploader's CDN, one per language.\n *\n * ```\n * https://cdn.files.salla.network/translations/common/<locale>.json the platform's\n * https://cdn.files.salla.network/translations/<storeId>/<locale>.json the merchant's\n * ```\n *\n * **What this replaces, and why.** Until now the engine read a single global\n * file, `cdn.salla.network/js/translations.json`, holding every language keyed\n * `\"<locale>.trans\"`. Nothing publishes that file: it is an object last written\n * on 2026-03-26, carrying only `ar` and `en` where the platform has 39 locales,\n * 405 keys behind `Languages-Module` and 959 English strings textually\n * different from it. So every React storefront has been serving copy from\n * March, and a key added since has never reached one. It also carried no\n * merchant overrides at all — a merchant editing their theme's wording in the\n * Dashboard changed nothing on a React theme.\n *\n * **Merchant overrides are read, and only when there are any.** Getting here\n * took two corrections worth keeping.\n *\n * The first is the address. A merchant's own wording lives at\n * `translations/<storeId>/<locale>.json`, keyed by `store()->getRouteKey()` —\n * the Optimus-encoded numeric id. An early version addressed it with\n * `resolveStoreIdentifier()`, on the claim that the two are the same string.\n * That is true of the `store-identifier` *header*, which accepts a host, a\n * username or an id, and false of the R2 key: on a custom domain the resolver\n * returns `reefperfumes.com` and on a shared host a username like\n * `mtgr-alaatr-2`. Both 404, both then read as \"this store has no overrides\",\n * and the merchant's wording silently never appears — so the feature would have\n * worked under `?storeId=` alone, which is preview and localhost. It is\n * `settings.store.id` now, which is known only after the settings query.\n *\n * The second is when to ask at all. Most stores have never customised a word,\n * and a miss is an uncached round trip (`cf-cache-status: DYNAMIC` on the 404)\n * on the critical path of every SSR render. So the request is made only when\n * `settings.languages[<ISO>].has_custom_translations` says there is something\n * to get — a flag `Languages-Module` writes when a merchant saves a\n * translation. A store without overrides pays nothing, which is what made this\n * shippable at all.\n *\n * ⚠️ The flag is written on save, so a store whose wording predates it reads as\n * `false` until someone edits a translation or the backfill runs. That is a\n * store keeping today's behaviour, not a regression — React themes have never\n * read merchant overrides — but it does mean the feature is only as complete as\n * the backfill.\n *\n * **Rollout is by fallback, not by flag.** `translations/common/` is written by\n * a sync in the theme build service that may not have run yet, and a hard switch\n * would leave every storefront with no platform strings at all. A missing common\n * file therefore falls back to the old global one, which is exactly today's\n * behaviour — so this is safe to ship before the bucket is populated, and stops\n * using the fallback on its own once it is.\n */\nimport { queryOptions } from '@tanstack/react-query';\nimport { cdn, filesCdn } from './client';\nimport { storeTranslationsQueryKey, translationsQueryKey } from './translations-key';\nimport { composeMessages, isPlainObject, type Messages } from './messages';\nimport type { TranslationMessages } from '../providers/I18nProvider';\n\n/** The global file this used to be the only reader of. See the file comment. */\nconst LEGACY_GLOBAL_FILE = 'js/translations.json';\n\n/** One language of platform copy, shared by every store. */\nexport function commonTranslationsPath(locale: string): string {\n return `translations/common/${locale}.json`;\n}\n\n/**\n * One language of a single merchant's own wording.\n *\n * `storeId` is `settings.store.id`, which is the value `Languages-Module` names\n * the object with (`store()->getRouteKey()`, the Optimus-encoded numeric id).\n * It is **not** `resolveStoreIdentifier()`: that returns a hostname on a custom\n * domain and a username on a shared host, both of which 404 here and would read\n * as \"this merchant has no overrides\" — silently, on every store but a preview.\n */\nexport function storeTranslationsPath(storeId: string | number, locale: string): string {\n return `translations/${storeId}/${locale}.json`;\n}\n\n/**\n * Reads one language file, or `null` when there is nothing to read.\n *\n * A 404 is the ordinary answer, not a failure: most stores have never had a\n * word customised, so their file does not exist. Distinguishing it from a real\n * error matters only for the log — both end in `null` — but a warning on every\n * page load of every uncustomised store is a warning nobody will read.\n */\nasync function readLocaleFile(\n path: string,\n { failLoudly = false }: { failLoudly?: boolean } = {}\n): Promise<Messages | null> {\n /** A 404 always means \"absent\"; everything else is a failure to read. */\n const unreadable = (reason: string, cause?: unknown): null => {\n if (failLoudly) throw new Error(`[translations] ${path}: ${reason}`, { cause });\n console.warn('[translations]', reason, path, cause ?? '');\n return null;\n };\n\n try {\n const response = await filesCdn.get(path, { throwHttpErrors: false, timeout: 5000 });\n if (response.status === 404) return null;\n\n if (!response.ok) {\n return unreadable(`answered ${response.status}`);\n }\n\n const data: unknown = await response.json();\n if (!isPlainObject(data)) {\n return unreadable('is not a JSON object');\n }\n\n return data;\n } catch (error) {\n if (error instanceof Error && error.message.startsWith('[translations]')) throw error;\n return unreadable('could not be read', error);\n }\n}\n\n/**\n * The pre-CDN global file, sliced to one language.\n *\n * Only reached when `translations/common/<locale>.json` is missing, which is\n * the state of the bucket until the sync has run once.\n */\nasync function readLegacyGlobal(locale: string): Promise<Messages | null> {\n try {\n const data = await cdn.get(LEGACY_GLOBAL_FILE, { timeout: 5000 }).json<TranslationMessages>();\n const forLocale = data?.[`${locale}.trans`];\n return isPlainObject(forLocale) ? forLocale : null;\n } catch {\n console.warn('[translations] the legacy global file could not be read either');\n return null;\n }\n}\n\nexport const translations = {\n /**\n * The platform's copy for `locale`.\n *\n * One file, so one request. See the file comment for why the merchant's own\n * wording is not merged in here yet and what it is waiting on.\n */\n get: async (locale: string): Promise<TranslationMessages | null> => {\n const common = await readLocaleFile(commonTranslationsPath(locale));\n const base = common ?? (await readLegacyGlobal(locale));\n if (!base) return null;\n\n // Still wrapped in the `<locale>.trans` shape the rest of the engine reads.\n // `createI18nInstance` slices by that key and so does the SDK bridge in\n // `I18nProvider`; changing the envelope here would be a second change for\n // no gain, since one language is all any of them ever take out of it.\n return { [`${locale}.trans`]: base as Record<string, string> };\n },\n\n /**\n * This merchant's own wording for `locale`, or `null` if they have none.\n *\n * Only worth calling when `settings.languages[<ISO>].has_custom_translations`\n * says there is something to get. Most stores have never customised a word,\n * and a miss here is an uncached round trip — `cf-cache-status: DYNAMIC` on a\n * 404 — on the critical path of an SSR render. The flag is what makes this\n * free for everyone who does not use it.\n *\n * Returned unwrapped, unlike {@link translations.get}: this is merged into\n * that one's messages rather than handed to i18next on its own.\n */\n forStore: async (storeId: string | number, locale: string): Promise<Messages | null> =>\n // `failLoudly`, unlike the platform file: this is only ever called because\n // the settings said overrides exist, so a 500, a timeout or a body that is\n // not JSON is a failure to read them — not a store that has none. Returning\n // `null` there would cache \"no overrides\" as a success, skip the query's\n // retry, and serve Salla's wording in place of the merchant's until the\n // entry expired. A 404 still means absent, and `rootBeforeLoad` catches the\n // throw and keeps the platform copy, so the worst case is unchanged.\n readLocaleFile(storeTranslationsPath(storeId, locale), { failLoudly: true }),\n\n /**\n * The platform's copy for `locale` with this merchant's wording laid over it.\n *\n * Takes the two as values rather than fetching them, so the caller decides\n * whether the second request happens at all and both stay separately cached.\n */\n /**\n * The platform's copy for `locale` with this merchant's wording over it.\n *\n * Delegates to `composeMessages`, which every other reader of these two\n * entries also uses — see `api/messages.ts` for why there is exactly one.\n */\n merge: (\n common: TranslationMessages | null,\n overrides: Messages | null,\n locale: string\n ): TranslationMessages | null => composeMessages(common, overrides, locale) ?? null,\n\n queries: {\n /**\n * @param locale taken as an argument rather than read from the twilight\n * context, and that is load-bearing. This key is built on the server, on\n * hydration, and again lazily from the context accessor; if any of the\n * three read a locale the others had not been given yet, the hydrated page\n * would miss the dehydrated entry and refetch both files it was just\n * handed. Every caller already has the locale in hand.\n *\n * The store is deliberately **not** in the key. One document serves one\n * store — a request that names a different one is redirected with\n * `reloadDocument`, so the client never changes store under a live cache —\n * and adding a value that resolves from the request on the server and from\n * the injected env on the client is how a key stops matching across\n * hydration.\n */\n byLocale: (locale: string) =>\n queryOptions({\n queryKey: translationsQueryKey(locale),\n queryFn: () => translations.get(locale),\n }),\n\n /**\n * This merchant's overrides, cached apart from the platform's copy.\n *\n * Its own entry rather than a wider `byLocale` key, so the common file is\n * fetched and dehydrated once per language whatever the store does, and a\n * store with no overrides never has an entry at all. Both sides compute the\n * key from the settings payload, so the hydrated page finds what the server\n * dehydrated instead of refetching it.\n */\n byStore: (storeId: string | number, locale: string) =>\n queryOptions({\n queryKey: storeTranslationsQueryKey(storeId, locale),\n queryFn: () => translations.forStore(storeId, locale),\n }),\n },\n};\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { LazyCartItem as CartItem, LazyCartSummary as CartSummary, LazySeoCartWidget as SeoCartWidget } from '../../chunk-
|
|
1
|
+
export { LazyCartItem as CartItem, LazyCartSummary as CartSummary, LazySeoCartWidget as SeoCartWidget } from '../../chunk-6EES4C7J.js';
|
|
2
2
|
import '../../chunk-DGUM43GV.js';
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
|
4
4
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { BlogSkeleton, LazyBreadcrumb as Breadcrumb, BreadcrumbSkeleton, LazyCurrencySymbol as CurrencySymbol, CustomerLayoutSkeleton, CustomerPageSkeleton, DeferredData, LazyErrorPage as ErrorPage, Image, LazyNoContent as NoContent, PageSkeleton, ProductCardSkeleton, ProductDetailSkeleton, ProductGridSkeleton, LazyRenderWhenVisible as RenderWhenVisible, SkeletonPulse, resolveDeferred } from '../../chunk-
|
|
1
|
+
export { BlogSkeleton, LazyBreadcrumb as Breadcrumb, BreadcrumbSkeleton, LazyCurrencySymbol as CurrencySymbol, CustomerLayoutSkeleton, CustomerPageSkeleton, DeferredData, LazyErrorPage as ErrorPage, Image, LazyNoContent as NoContent, PageSkeleton, ProductCardSkeleton, ProductDetailSkeleton, ProductGridSkeleton, LazyRenderWhenVisible as RenderWhenVisible, SkeletonPulse, resolveDeferred } from '../../chunk-CUX7O42G.js';
|
|
2
2
|
export { Link } from '../../chunk-AXW67SY7.js';
|
|
3
3
|
import '../../chunk-BYMOPN2S.js';
|
|
4
4
|
import '../../chunk-SKLEJJ6M.js';
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
export { Drawer } from '../../chunk-6TKIUG5C.js';
|
|
2
|
-
import '../../chunk-
|
|
3
|
-
import '../../chunk-
|
|
2
|
+
import '../../chunk-ANWDPISS.js';
|
|
3
|
+
import '../../chunk-IFWQTDEY.js';
|
|
4
4
|
import '../../chunk-JKIRRMBU.js';
|
|
5
5
|
import '../../chunk-2JV6WZ6O.js';
|
|
6
|
-
import '../../chunk-
|
|
6
|
+
import '../../chunk-X7P2WSNU.js';
|
|
7
7
|
import '../../chunk-VVZNW5CB.js';
|
|
8
|
-
import '../../chunk-
|
|
9
|
-
import '../../chunk-
|
|
8
|
+
import '../../chunk-YGDAYFQY.js';
|
|
9
|
+
import '../../chunk-RLSYCDI4.js';
|
|
10
10
|
import '../../chunk-TFB3QXYH.js';
|
|
11
11
|
import '../../chunk-C5X6CVXC.js';
|
|
12
|
-
import '../../chunk-
|
|
13
|
-
import '../../chunk-
|
|
14
|
-
import '../../chunk-
|
|
15
|
-
import '../../chunk-
|
|
12
|
+
import '../../chunk-6DVYW7OA.js';
|
|
13
|
+
import '../../chunk-KZMUU5ZD.js';
|
|
14
|
+
import '../../chunk-BHU25UEW.js';
|
|
15
|
+
import '../../chunk-VRV5F6G7.js';
|
|
16
16
|
import '../../chunk-XTMHHLNK.js';
|
|
17
|
-
import '../../chunk-
|
|
17
|
+
import '../../chunk-OGQXRBCR.js';
|
|
18
18
|
import '../../chunk-TP3LCGE7.js';
|
|
19
19
|
import '../../chunk-Z653O7MX.js';
|
|
20
20
|
import '../../chunk-ZCH7W7DZ.js';
|
|
@@ -30,7 +30,7 @@ import '../../chunk-YMVLYYLU.js';
|
|
|
30
30
|
import '../../chunk-RJPPO3ET.js';
|
|
31
31
|
import '../../chunk-Q7VWURUR.js';
|
|
32
32
|
import '../../chunk-GU2KUQVD.js';
|
|
33
|
-
import '../../chunk-
|
|
33
|
+
import '../../chunk-CUX7O42G.js';
|
|
34
34
|
import '../../chunk-AXW67SY7.js';
|
|
35
35
|
import '../../chunk-BYMOPN2S.js';
|
|
36
36
|
import '../../chunk-SKLEJJ6M.js';
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
export { BundleComponent, ComponentErrorBoundary, DefaultHomeComponents, FeaturedProductsStyle1, FeaturedProductsStyle2, FeaturedProductsStyle3, FixedBanner, FixedProducts, HomeComponentRenderer, ParallaxBackground, PhotosSlider, ProductsSlider, SquarePhotos, StoreFeatures, LazyTestimonials as Testimonials, Youtube, registerHomeComponentConfig, registerHomeComponents } from '../../chunk-
|
|
2
|
-
import '../../chunk-
|
|
3
|
-
import '../../chunk-
|
|
1
|
+
export { BundleComponent, ComponentErrorBoundary, DefaultHomeComponents, FeaturedProductsStyle1, FeaturedProductsStyle2, FeaturedProductsStyle3, FixedBanner, FixedProducts, HomeComponentRenderer, ParallaxBackground, PhotosSlider, ProductsSlider, SquarePhotos, StoreFeatures, LazyTestimonials as Testimonials, Youtube, registerHomeComponentConfig, registerHomeComponents } from '../../chunk-6LIGRH4O.js';
|
|
2
|
+
import '../../chunk-NK2V2SW5.js';
|
|
3
|
+
import '../../chunk-GX3EDS32.js';
|
|
4
4
|
import '../../chunk-342EPVXN.js';
|
|
5
|
-
import '../../chunk-
|
|
6
|
-
import '../../chunk-
|
|
5
|
+
import '../../chunk-ANWDPISS.js';
|
|
6
|
+
import '../../chunk-IFWQTDEY.js';
|
|
7
7
|
import '../../chunk-JKIRRMBU.js';
|
|
8
8
|
import '../../chunk-2JV6WZ6O.js';
|
|
9
|
-
import '../../chunk-
|
|
9
|
+
import '../../chunk-X7P2WSNU.js';
|
|
10
10
|
import '../../chunk-VVZNW5CB.js';
|
|
11
|
-
import '../../chunk-
|
|
12
|
-
import '../../chunk-
|
|
11
|
+
import '../../chunk-YGDAYFQY.js';
|
|
12
|
+
import '../../chunk-RLSYCDI4.js';
|
|
13
13
|
import '../../chunk-TFB3QXYH.js';
|
|
14
14
|
import '../../chunk-C5X6CVXC.js';
|
|
15
|
-
import '../../chunk-
|
|
16
|
-
import '../../chunk-
|
|
17
|
-
import '../../chunk-
|
|
18
|
-
import '../../chunk-
|
|
15
|
+
import '../../chunk-6DVYW7OA.js';
|
|
16
|
+
import '../../chunk-KZMUU5ZD.js';
|
|
17
|
+
import '../../chunk-BHU25UEW.js';
|
|
18
|
+
import '../../chunk-VRV5F6G7.js';
|
|
19
19
|
import '../../chunk-XTMHHLNK.js';
|
|
20
|
-
import '../../chunk-
|
|
20
|
+
import '../../chunk-OGQXRBCR.js';
|
|
21
21
|
import '../../chunk-TP3LCGE7.js';
|
|
22
22
|
import '../../chunk-Z653O7MX.js';
|
|
23
23
|
import '../../chunk-ZCH7W7DZ.js';
|
|
@@ -33,7 +33,7 @@ import '../../chunk-YMVLYYLU.js';
|
|
|
33
33
|
import '../../chunk-RJPPO3ET.js';
|
|
34
34
|
import '../../chunk-Q7VWURUR.js';
|
|
35
35
|
import '../../chunk-GU2KUQVD.js';
|
|
36
|
-
import '../../chunk-
|
|
36
|
+
import '../../chunk-CUX7O42G.js';
|
|
37
37
|
import '../../chunk-AXW67SY7.js';
|
|
38
38
|
import '../../chunk-BYMOPN2S.js';
|
|
39
39
|
import '../../chunk-SKLEJJ6M.js';
|
|
@@ -5,19 +5,19 @@ import '../../chunk-DF6FBKDN.js';
|
|
|
5
5
|
import '../../chunk-DGUM43GV.js';
|
|
6
6
|
import { lazy } from 'react';
|
|
7
7
|
|
|
8
|
-
var LazyHeader = lazy(() => import('../../Header-
|
|
9
|
-
var LazyFooter = lazy(() => import('../../Footer-
|
|
8
|
+
var LazyHeader = lazy(() => import('../../Header-QNNAHZJL.js').then((m) => ({ default: m.Header })));
|
|
9
|
+
var LazyFooter = lazy(() => import('../../Footer-OQFU25J4.js').then((m) => ({ default: m.Footer })));
|
|
10
10
|
var LazyCopyright = lazy(
|
|
11
|
-
() => import('../../Copyright-
|
|
11
|
+
() => import('../../Copyright-VJYMP42V.js').then((m) => ({ default: m.Copyright }))
|
|
12
12
|
);
|
|
13
13
|
var LazyMasterLayout = lazy(
|
|
14
|
-
() => import('../../MasterLayout-
|
|
14
|
+
() => import('../../MasterLayout-HJWMQHWO.js').then((m) => ({ default: m.MasterLayout }))
|
|
15
15
|
);
|
|
16
16
|
var LazyWidgetHead = lazy(
|
|
17
17
|
() => import('../../WidgetHead-RWL7D3CT.js').then((m) => ({ default: m.WidgetHead }))
|
|
18
18
|
);
|
|
19
19
|
var LazyCustomerLayout = lazy(
|
|
20
|
-
() => import('../../CustomerLayout-
|
|
20
|
+
() => import('../../CustomerLayout-L3Y2TIPF.js').then((m) => ({ default: m.CustomerLayout }))
|
|
21
21
|
);
|
|
22
22
|
|
|
23
23
|
export { LazyCopyright as Copyright, LazyCustomerLayout as CustomerLayout, LazyFooter as Footer, LazyHeader as Header, LazyMasterLayout as MasterLayout, LazyWidgetHead as WidgetHead };
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
export { LazyAddToCartForm as AddToCartForm, ProductCard, LazyProductDetails as ProductDetails, ProductGallery } from '../../chunk-
|
|
1
|
+
export { LazyAddToCartForm as AddToCartForm, ProductCard, LazyProductDetails as ProductDetails, ProductGallery } from '../../chunk-GX3EDS32.js';
|
|
2
2
|
import '../../chunk-342EPVXN.js';
|
|
3
|
-
import '../../chunk-
|
|
4
|
-
import '../../chunk-
|
|
3
|
+
import '../../chunk-ANWDPISS.js';
|
|
4
|
+
import '../../chunk-IFWQTDEY.js';
|
|
5
5
|
import '../../chunk-JKIRRMBU.js';
|
|
6
6
|
import '../../chunk-2JV6WZ6O.js';
|
|
7
|
-
import '../../chunk-
|
|
7
|
+
import '../../chunk-X7P2WSNU.js';
|
|
8
8
|
import '../../chunk-VVZNW5CB.js';
|
|
9
|
-
import '../../chunk-
|
|
10
|
-
import '../../chunk-
|
|
9
|
+
import '../../chunk-YGDAYFQY.js';
|
|
10
|
+
import '../../chunk-RLSYCDI4.js';
|
|
11
11
|
import '../../chunk-TFB3QXYH.js';
|
|
12
12
|
import '../../chunk-C5X6CVXC.js';
|
|
13
|
-
import '../../chunk-
|
|
14
|
-
import '../../chunk-
|
|
15
|
-
import '../../chunk-
|
|
16
|
-
import '../../chunk-
|
|
13
|
+
import '../../chunk-6DVYW7OA.js';
|
|
14
|
+
import '../../chunk-KZMUU5ZD.js';
|
|
15
|
+
import '../../chunk-BHU25UEW.js';
|
|
16
|
+
import '../../chunk-VRV5F6G7.js';
|
|
17
17
|
import '../../chunk-XTMHHLNK.js';
|
|
18
|
-
import '../../chunk-
|
|
18
|
+
import '../../chunk-OGQXRBCR.js';
|
|
19
19
|
import '../../chunk-TP3LCGE7.js';
|
|
20
20
|
import '../../chunk-Z653O7MX.js';
|
|
21
21
|
import '../../chunk-ZCH7W7DZ.js';
|
|
@@ -31,7 +31,7 @@ import '../../chunk-YMVLYYLU.js';
|
|
|
31
31
|
import '../../chunk-RJPPO3ET.js';
|
|
32
32
|
import '../../chunk-Q7VWURUR.js';
|
|
33
33
|
import '../../chunk-GU2KUQVD.js';
|
|
34
|
-
import '../../chunk-
|
|
34
|
+
import '../../chunk-CUX7O42G.js';
|
|
35
35
|
import '../../chunk-AXW67SY7.js';
|
|
36
36
|
import '../../chunk-BYMOPN2S.js';
|
|
37
37
|
import '../../chunk-SKLEJJ6M.js';
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
export { StoreClosedNotification } from '../../chunk-
|
|
2
|
-
import '../../chunk-
|
|
3
|
-
import '../../chunk-
|
|
1
|
+
export { StoreClosedNotification } from '../../chunk-NYD5Z4RJ.js';
|
|
2
|
+
import '../../chunk-ANWDPISS.js';
|
|
3
|
+
import '../../chunk-IFWQTDEY.js';
|
|
4
4
|
import '../../chunk-JKIRRMBU.js';
|
|
5
5
|
import '../../chunk-2JV6WZ6O.js';
|
|
6
|
-
import '../../chunk-
|
|
6
|
+
import '../../chunk-X7P2WSNU.js';
|
|
7
7
|
import '../../chunk-VVZNW5CB.js';
|
|
8
|
-
import '../../chunk-
|
|
9
|
-
import '../../chunk-
|
|
8
|
+
import '../../chunk-YGDAYFQY.js';
|
|
9
|
+
import '../../chunk-RLSYCDI4.js';
|
|
10
10
|
import '../../chunk-TFB3QXYH.js';
|
|
11
11
|
import '../../chunk-C5X6CVXC.js';
|
|
12
|
-
import '../../chunk-
|
|
13
|
-
import '../../chunk-
|
|
14
|
-
import '../../chunk-
|
|
15
|
-
import '../../chunk-
|
|
12
|
+
import '../../chunk-6DVYW7OA.js';
|
|
13
|
+
import '../../chunk-KZMUU5ZD.js';
|
|
14
|
+
import '../../chunk-BHU25UEW.js';
|
|
15
|
+
import '../../chunk-VRV5F6G7.js';
|
|
16
16
|
import '../../chunk-XTMHHLNK.js';
|
|
17
|
-
import '../../chunk-
|
|
17
|
+
import '../../chunk-OGQXRBCR.js';
|
|
18
18
|
import '../../chunk-TP3LCGE7.js';
|
|
19
19
|
import '../../chunk-Z653O7MX.js';
|
|
20
20
|
import '../../chunk-ZCH7W7DZ.js';
|
|
@@ -30,7 +30,7 @@ import '../../chunk-YMVLYYLU.js';
|
|
|
30
30
|
import '../../chunk-RJPPO3ET.js';
|
|
31
31
|
import '../../chunk-Q7VWURUR.js';
|
|
32
32
|
import '../../chunk-GU2KUQVD.js';
|
|
33
|
-
import '../../chunk-
|
|
33
|
+
import '../../chunk-CUX7O42G.js';
|
|
34
34
|
import '../../chunk-AXW67SY7.js';
|
|
35
35
|
import '../../chunk-BYMOPN2S.js';
|
|
36
36
|
import '../../chunk-SKLEJJ6M.js';
|
|
@@ -44,7 +44,7 @@ import '../../chunk-DGUM43GV.js';
|
|
|
44
44
|
import { lazy } from 'react';
|
|
45
45
|
|
|
46
46
|
var LazyStoreClosedNotification = lazy(
|
|
47
|
-
() => import('../../StoreClosedNotification-
|
|
47
|
+
() => import('../../StoreClosedNotification-52REE2T5.js').then((m) => ({
|
|
48
48
|
default: m.StoreClosedNotification
|
|
49
49
|
}))
|
|
50
50
|
);
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export { RouteDocumentSync, TanStackDocumentSync, tanstackDocumentAdapter, useTanstackDocumentAttrs } from './chunk-R2ULWW5T.js';
|
|
2
|
+
import './chunk-Z4Y55HWX.js';
|
|
3
|
+
import './chunk-NKLKKZM6.js';
|
|
4
|
+
import './chunk-S7JSNUU2.js';
|
|
5
|
+
import './chunk-B3EFOE57.js';
|
|
6
|
+
import './chunk-GXXWHVLS.js';
|
|
7
|
+
import './chunk-ZOZLNUNA.js';
|
|
8
|
+
import './chunk-TZ3E5BN4.js';
|
|
9
|
+
import './chunk-NK2V2SW5.js';
|
|
10
|
+
import './chunk-X7P2WSNU.js';
|
|
11
|
+
import './chunk-YGDAYFQY.js';
|
|
12
|
+
import './chunk-RLSYCDI4.js';
|
|
13
|
+
import './chunk-TFB3QXYH.js';
|
|
14
|
+
import './chunk-BHU25UEW.js';
|
|
15
|
+
import './chunk-VRV5F6G7.js';
|
|
16
|
+
import './chunk-XTMHHLNK.js';
|
|
17
|
+
import './chunk-OGQXRBCR.js';
|
|
18
|
+
import './chunk-JWXJPJBO.js';
|
|
19
|
+
import './chunk-CW625T2E.js';
|
|
20
|
+
import './chunk-TYNZ5B2B.js';
|
|
21
|
+
import './chunk-T72DAX7R.js';
|
|
22
|
+
import './chunk-DF6FBKDN.js';
|
|
23
|
+
import './chunk-DGUM43GV.js';
|
|
24
|
+
//# sourceMappingURL=document-class-SX2LHILG.js.map
|
|
25
|
+
//# sourceMappingURL=document-class-SX2LHILG.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"document-class-
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"document-class-SX2LHILG.js"}
|
package/dist/hooks/index.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
export { registerDefaultHooks, useBreadcrumbs, useDate, useGtm, useMoney, useNumber, useOpeningHours, usePageConfig, useStore } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
1
|
+
export { registerDefaultHooks, useBreadcrumbs, useDate, useGtm, useMoney, useNumber, useOpeningHours, usePageConfig, useStore } from '../chunk-ANWDPISS.js';
|
|
2
|
+
import '../chunk-IFWQTDEY.js';
|
|
3
3
|
import '../chunk-JKIRRMBU.js';
|
|
4
4
|
import '../chunk-2JV6WZ6O.js';
|
|
5
|
-
import '../chunk-
|
|
5
|
+
import '../chunk-X7P2WSNU.js';
|
|
6
6
|
import '../chunk-VVZNW5CB.js';
|
|
7
|
-
import '../chunk-
|
|
8
|
-
import '../chunk-
|
|
7
|
+
import '../chunk-YGDAYFQY.js';
|
|
8
|
+
import '../chunk-RLSYCDI4.js';
|
|
9
9
|
import '../chunk-TFB3QXYH.js';
|
|
10
10
|
export { useHook } from '../chunk-C5X6CVXC.js';
|
|
11
|
-
export { useUser } from '../chunk-
|
|
12
|
-
import '../chunk-
|
|
13
|
-
import '../chunk-
|
|
14
|
-
import '../chunk-
|
|
11
|
+
export { useUser } from '../chunk-6DVYW7OA.js';
|
|
12
|
+
import '../chunk-KZMUU5ZD.js';
|
|
13
|
+
import '../chunk-BHU25UEW.js';
|
|
14
|
+
import '../chunk-VRV5F6G7.js';
|
|
15
15
|
import '../chunk-XTMHHLNK.js';
|
|
16
|
-
import '../chunk-
|
|
16
|
+
import '../chunk-OGQXRBCR.js';
|
|
17
17
|
export { HookName } from '../chunk-TP3LCGE7.js';
|
|
18
18
|
export { useAsset } from '../chunk-Z653O7MX.js';
|
|
19
19
|
import '../chunk-ZCH7W7DZ.js';
|
|
@@ -29,7 +29,7 @@ export { useComments } from '../chunk-YMVLYYLU.js';
|
|
|
29
29
|
import '../chunk-RJPPO3ET.js';
|
|
30
30
|
export { HookSlot, useIsClient } from '../chunk-Q7VWURUR.js';
|
|
31
31
|
export { HookRegistry, defineHooks, hookRegistry } from '../chunk-GU2KUQVD.js';
|
|
32
|
-
import '../chunk-
|
|
32
|
+
import '../chunk-CUX7O42G.js';
|
|
33
33
|
import '../chunk-AXW67SY7.js';
|
|
34
34
|
import '../chunk-BYMOPN2S.js';
|
|
35
35
|
import '../chunk-SKLEJJ6M.js';
|
package/dist/hooks/useGtm.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
export { useGtm } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
1
|
+
export { useGtm } from '../chunk-ANWDPISS.js';
|
|
2
|
+
import '../chunk-IFWQTDEY.js';
|
|
3
3
|
import '../chunk-JKIRRMBU.js';
|
|
4
4
|
import '../chunk-2JV6WZ6O.js';
|
|
5
|
-
import '../chunk-
|
|
5
|
+
import '../chunk-X7P2WSNU.js';
|
|
6
6
|
import '../chunk-VVZNW5CB.js';
|
|
7
|
-
import '../chunk-
|
|
8
|
-
import '../chunk-
|
|
7
|
+
import '../chunk-YGDAYFQY.js';
|
|
8
|
+
import '../chunk-RLSYCDI4.js';
|
|
9
9
|
import '../chunk-TFB3QXYH.js';
|
|
10
10
|
import '../chunk-C5X6CVXC.js';
|
|
11
|
-
import '../chunk-
|
|
12
|
-
import '../chunk-
|
|
13
|
-
import '../chunk-
|
|
14
|
-
import '../chunk-
|
|
11
|
+
import '../chunk-6DVYW7OA.js';
|
|
12
|
+
import '../chunk-KZMUU5ZD.js';
|
|
13
|
+
import '../chunk-BHU25UEW.js';
|
|
14
|
+
import '../chunk-VRV5F6G7.js';
|
|
15
15
|
import '../chunk-XTMHHLNK.js';
|
|
16
|
-
import '../chunk-
|
|
16
|
+
import '../chunk-OGQXRBCR.js';
|
|
17
17
|
import '../chunk-TP3LCGE7.js';
|
|
18
18
|
import '../chunk-Z653O7MX.js';
|
|
19
19
|
import '../chunk-ZCH7W7DZ.js';
|
|
@@ -29,7 +29,7 @@ import '../chunk-YMVLYYLU.js';
|
|
|
29
29
|
import '../chunk-RJPPO3ET.js';
|
|
30
30
|
import '../chunk-Q7VWURUR.js';
|
|
31
31
|
import '../chunk-GU2KUQVD.js';
|
|
32
|
-
import '../chunk-
|
|
32
|
+
import '../chunk-CUX7O42G.js';
|
|
33
33
|
import '../chunk-AXW67SY7.js';
|
|
34
34
|
import '../chunk-BYMOPN2S.js';
|
|
35
35
|
import '../chunk-SKLEJJ6M.js';
|