@shipfox/client-shell 12.0.2 → 13.0.0
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/components/main-layout.js +2 -2
- package/dist/components/main-layout.js.map +1 -1
- package/dist/components/settings-nav.d.ts +2 -1
- package/dist/components/settings-nav.d.ts.map +1 -1
- package/dist/components/settings-nav.js +17 -13
- package/dist/components/settings-nav.js.map +1 -1
- package/dist/components/workspace-crumb.js +2 -2
- package/dist/components/workspace-crumb.js.map +1 -1
- package/dist/components/workspace-switcher.d.ts.map +1 -1
- package/dist/components/workspace-switcher.js +4 -2
- package/dist/components/workspace-switcher.js.map +1 -1
- package/dist/compose/compose-routes.d.ts.map +1 -1
- package/dist/compose/compose-routes.js +4 -1
- package/dist/compose/compose-routes.js.map +1 -1
- package/dist/compose/validate-registries.d.ts.map +1 -1
- package/dist/compose/validate-registries.js +1 -1
- package/dist/compose/validate-registries.js.map +1 -1
- package/dist/contract.d.ts +2 -1
- package/dist/contract.d.ts.map +1 -1
- package/dist/contract.js.map +1 -1
- package/dist/core/session.d.ts +1 -0
- package/dist/core/session.d.ts.map +1 -1
- package/dist/core/session.js.map +1 -1
- package/dist/hooks/api/session-auth.d.ts.map +1 -1
- package/dist/hooks/api/session-auth.js +1 -0
- package/dist/hooks/api/session-auth.js.map +1 -1
- package/dist/runtime/active-workspace.js +3 -3
- package/dist/runtime/active-workspace.js.map +1 -1
- package/dist/runtime/anchor-paths.d.ts +14 -4
- package/dist/runtime/anchor-paths.d.ts.map +1 -1
- package/dist/runtime/anchor-paths.js +57 -4
- package/dist/runtime/anchor-paths.js.map +1 -1
- package/dist/runtime/anchors.d.ts +9 -6
- package/dist/runtime/anchors.d.ts.map +1 -1
- package/dist/runtime/anchors.js +85 -42
- package/dist/runtime/anchors.js.map +1 -1
- package/dist/runtime/assemble-route-tree.d.ts.map +1 -1
- package/dist/runtime/assemble-route-tree.js +7 -2
- package/dist/runtime/assemble-route-tree.js.map +1 -1
- package/dist/runtime/chrome-context.d.ts +2 -1
- package/dist/runtime/chrome-context.d.ts.map +1 -1
- package/dist/runtime/chrome-context.js.map +1 -1
- package/dist/runtime/compose-client-app.d.ts.map +1 -1
- package/dist/runtime/compose-client-app.js +5 -3
- package/dist/runtime/compose-client-app.js.map +1 -1
- package/dist/runtime/index.d.ts +1 -0
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/index.js +1 -0
- package/dist/runtime/index.js.map +1 -1
- package/dist/runtime/registries.js +4 -1
- package/dist/runtime/registries.js.map +1 -1
- package/dist/runtime/route-inputs.d.ts +3 -3
- package/dist/runtime/route-inputs.d.ts.map +1 -1
- package/dist/runtime/route-inputs.js +9 -9
- package/dist/runtime/route-inputs.js.map +1 -1
- package/dist/runtime/router-context.d.ts +7 -0
- package/dist/runtime/router-context.d.ts.map +1 -1
- package/dist/runtime/router-context.js.map +1 -1
- package/dist/runtime/search-serialization.d.ts +26 -0
- package/dist/runtime/search-serialization.d.ts.map +1 -0
- package/dist/runtime/search-serialization.js +78 -0
- package/dist/runtime/search-serialization.js.map +1 -0
- package/dist/runtime/workspace-setup.d.ts +1 -0
- package/dist/runtime/workspace-setup.d.ts.map +1 -1
- package/dist/runtime/workspace-setup.js.map +1 -1
- package/dist/tsconfig.test.tsbuildinfo +1 -1
- package/dist/vite/generate.d.ts.map +1 -1
- package/dist/vite/generate.js +12 -3
- package/dist/vite/generate.js.map +1 -1
- package/package.json +6 -6
|
@@ -50,7 +50,8 @@ export function composeClientApp({ features, router, chrome, workspaceSetup }) {
|
|
|
50
50
|
/*#__PURE__*/ _jsx(RoutedApp, {
|
|
51
51
|
router: router,
|
|
52
52
|
queryClient: queryClient,
|
|
53
|
-
workspaceSetup: workspaceSetup
|
|
53
|
+
workspaceSetup: workspaceSetup,
|
|
54
|
+
projectSlugResolver: chrome?.projectSlugResolver
|
|
54
55
|
}),
|
|
55
56
|
/*#__PURE__*/ _jsx(Toaster, {})
|
|
56
57
|
]
|
|
@@ -60,7 +61,7 @@ export function composeClientApp({ features, router, chrome, workspaceSetup }) {
|
|
|
60
61
|
}
|
|
61
62
|
};
|
|
62
63
|
}
|
|
63
|
-
function RoutedApp({ router, queryClient, workspaceSetup }) {
|
|
64
|
+
function RoutedApp({ router, queryClient, workspaceSetup, projectSlugResolver }) {
|
|
64
65
|
const auth = useAuthState();
|
|
65
66
|
useEffect(()=>{
|
|
66
67
|
if (!auth.isLoading) router.invalidate();
|
|
@@ -73,7 +74,8 @@ function RoutedApp({ router, queryClient, workspaceSetup }) {
|
|
|
73
74
|
context: {
|
|
74
75
|
auth,
|
|
75
76
|
queryClient,
|
|
76
|
-
workspaceSetup
|
|
77
|
+
workspaceSetup,
|
|
78
|
+
projectSlugResolver
|
|
77
79
|
}
|
|
78
80
|
});
|
|
79
81
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/runtime/compose-client-app.tsx"],"sourcesContent":["import {configureApiClient} from '@shipfox/client-api';\nimport {\n ConfigErrorScreen,\n getWindowRuntimeConfig,\n loadConfig,\n setLoadedConfig,\n} from '@shipfox/client-config';\nimport {ThemeProvider} from '@shipfox/react-ui/theme';\nimport {Toaster} from '@shipfox/react-ui/toast';\nimport {TooltipProvider} from '@shipfox/react-ui/tooltip';\nimport {QueryClient} from '@tanstack/react-query';\nimport {type AnyRouter, RouterProvider} from '@tanstack/react-router';\nimport {createStore} from 'jotai';\nimport {StrictMode, useEffect} from 'react';\nimport {createRoot} from 'react-dom/client';\nimport {composeClientFeatures} from '#compose/compose-client-features.js';\nimport type {ClientFeature} from '#contract.js';\nimport {useAuthState} from './auth.js';\nimport {ChromeProvider, type ChromeSlots} from './chrome-context.js';\nimport {ShellProviderStack} from './provider-stack.js';\nimport type {WorkspaceSetupGate} from './workspace-setup.js';\n\nexport function composeClientApp({\n features,\n router,\n chrome,\n workspaceSetup,\n}: {\n features: readonly ClientFeature[];\n router: AnyRouter;\n chrome?: ChromeSlots;\n workspaceSetup?: WorkspaceSetupGate;\n}) {\n const composition = composeClientFeatures(features);\n const config = loadConfig(composition.configShape, {\n runtime: getWindowRuntimeConfig(),\n build: (import.meta as ImportMeta & {env?: Record<string, unknown>}).env,\n });\n if (config.ok) setLoadedConfig(config.config);\n\n return {\n mount(element: HTMLElement): void {\n const root = createRoot(element);\n if (!config.ok) {\n root.render(\n <StrictMode>\n <ThemeProvider>\n <TooltipProvider>\n <ConfigErrorScreen errors={config.errors} />\n </TooltipProvider>\n </ThemeProvider>\n </StrictMode>,\n );\n return;\n }\n\n configureApiClient({baseUrl: configApiUrl(config.config)});\n const queryClient = new QueryClient();\n root.render(\n <StrictMode>\n <ChromeProvider chrome={chrome}>\n <ShellProviderStack features={features} queryClient={queryClient} store={createStore()}>\n <RoutedApp\n router={router}\n queryClient={queryClient}\n workspaceSetup={workspaceSetup}\n />\n <Toaster />\n </ShellProviderStack>\n </ChromeProvider>\n </StrictMode>,\n );\n },\n };\n}\n\nfunction RoutedApp({\n router,\n queryClient,\n workspaceSetup,\n}: {\n router: AnyRouter;\n queryClient: QueryClient;\n workspaceSetup: WorkspaceSetupGate | undefined;\n}) {\n const auth = useAuthState();\n\n useEffect(() => {\n if (!auth.isLoading) router.invalidate();\n }, [auth.isLoading, router]);\n\n return (\n <RouterProvider\n router={router as never}\n context={{auth, queryClient, workspaceSetup} as never}\n />\n );\n}\n\nfunction configApiUrl(config: unknown): string {\n if (\n typeof config !== 'object' ||\n config === null ||\n !('apiUrl' in config) ||\n typeof config.apiUrl !== 'string'\n ) {\n throw new Error('Composed client configuration must include a string apiUrl.');\n }\n return config.apiUrl;\n}\n"],"names":["configureApiClient","ConfigErrorScreen","getWindowRuntimeConfig","loadConfig","setLoadedConfig","ThemeProvider","Toaster","TooltipProvider","QueryClient","RouterProvider","createStore","StrictMode","useEffect","createRoot","composeClientFeatures","useAuthState","ChromeProvider","ShellProviderStack","composeClientApp","features","router","chrome","workspaceSetup","composition","config","configShape","runtime","build","env","ok","mount","element","root","render","errors","baseUrl","configApiUrl","queryClient","store","RoutedApp","auth","isLoading","invalidate","context","apiUrl","Error"],"mappings":";AAAA,SAAQA,kBAAkB,QAAO,sBAAsB;AACvD,SACEC,iBAAiB,EACjBC,sBAAsB,EACtBC,UAAU,EACVC,eAAe,QACV,yBAAyB;AAChC,SAAQC,aAAa,QAAO,0BAA0B;AACtD,SAAQC,OAAO,QAAO,0BAA0B;AAChD,SAAQC,eAAe,QAAO,4BAA4B;AAC1D,SAAQC,WAAW,QAAO,wBAAwB;AAClD,SAAwBC,cAAc,QAAO,yBAAyB;AACtE,SAAQC,WAAW,QAAO,QAAQ;AAClC,SAAQC,UAAU,EAAEC,SAAS,QAAO,QAAQ;AAC5C,SAAQC,UAAU,QAAO,mBAAmB;AAC5C,SAAQC,qBAAqB,QAAO,sCAAsC;AAE1E,SAAQC,YAAY,QAAO,YAAY;AACvC,SAAQC,cAAc,QAAyB,sBAAsB;AACrE,SAAQC,kBAAkB,QAAO,sBAAsB;AAGvD,OAAO,SAASC,iBAAiB,EAC/BC,QAAQ,EACRC,MAAM,EACNC,MAAM,EACNC,cAAc,EAMf;IACC,MAAMC,cAAcT,sBAAsBK;IAC1C,MAAMK,SAASrB,WAAWoB,YAAYE,WAAW,EAAE;QACjDC,SAASxB;QACTyB,OAAO,AAAC,YAA6DC,GAAG;IAC1E;IACA,IAAIJ,OAAOK,EAAE,EAAEzB,gBAAgBoB,OAAOA,MAAM;IAE5C,OAAO;QACLM,OAAMC,OAAoB;YACxB,MAAMC,OAAOnB,WAAWkB;YACxB,IAAI,CAACP,OAAOK,EAAE,EAAE;gBACdG,KAAKC,MAAM,eACT,KAACtB;8BACC,cAAA,KAACN;kCACC,cAAA,KAACE;sCACC,cAAA,KAACN;gCAAkBiC,QAAQV,OAAOU,MAAM;;;;;gBAKhD;YACF;YAEAlC,mBAAmB;gBAACmC,SAASC,aAAaZ,OAAOA,MAAM;YAAC;YACxD,MAAMa,cAAc,IAAI7B;YACxBwB,KAAKC,MAAM,eACT,KAACtB;0BACC,cAAA,KAACK;oBAAeK,QAAQA;8BACtB,cAAA,MAACJ;wBAAmBE,UAAUA;wBAAUkB,aAAaA;wBAAaC,OAAO5B;;0CACvE,KAAC6B;gCACCnB,QAAQA;gCACRiB,aAAaA;gCACbf,gBAAgBA;;
|
|
1
|
+
{"version":3,"sources":["../../src/runtime/compose-client-app.tsx"],"sourcesContent":["import {configureApiClient} from '@shipfox/client-api';\nimport {\n ConfigErrorScreen,\n getWindowRuntimeConfig,\n loadConfig,\n setLoadedConfig,\n} from '@shipfox/client-config';\nimport {ThemeProvider} from '@shipfox/react-ui/theme';\nimport {Toaster} from '@shipfox/react-ui/toast';\nimport {TooltipProvider} from '@shipfox/react-ui/tooltip';\nimport {QueryClient} from '@tanstack/react-query';\nimport {type AnyRouter, RouterProvider} from '@tanstack/react-router';\nimport {createStore} from 'jotai';\nimport {StrictMode, useEffect} from 'react';\nimport {createRoot} from 'react-dom/client';\nimport {composeClientFeatures} from '#compose/compose-client-features.js';\nimport type {ClientFeature} from '#contract.js';\nimport {useAuthState} from './auth.js';\nimport {ChromeProvider, type ChromeSlots} from './chrome-context.js';\nimport {ShellProviderStack} from './provider-stack.js';\nimport type {WorkspaceSetupGate} from './workspace-setup.js';\n\nexport function composeClientApp({\n features,\n router,\n chrome,\n workspaceSetup,\n}: {\n features: readonly ClientFeature[];\n router: AnyRouter;\n chrome?: ChromeSlots;\n workspaceSetup?: WorkspaceSetupGate;\n}) {\n const composition = composeClientFeatures(features);\n const config = loadConfig(composition.configShape, {\n runtime: getWindowRuntimeConfig(),\n build: (import.meta as ImportMeta & {env?: Record<string, unknown>}).env,\n });\n if (config.ok) setLoadedConfig(config.config);\n\n return {\n mount(element: HTMLElement): void {\n const root = createRoot(element);\n if (!config.ok) {\n root.render(\n <StrictMode>\n <ThemeProvider>\n <TooltipProvider>\n <ConfigErrorScreen errors={config.errors} />\n </TooltipProvider>\n </ThemeProvider>\n </StrictMode>,\n );\n return;\n }\n\n configureApiClient({baseUrl: configApiUrl(config.config)});\n const queryClient = new QueryClient();\n root.render(\n <StrictMode>\n <ChromeProvider chrome={chrome}>\n <ShellProviderStack features={features} queryClient={queryClient} store={createStore()}>\n <RoutedApp\n router={router}\n queryClient={queryClient}\n workspaceSetup={workspaceSetup}\n projectSlugResolver={chrome?.projectSlugResolver}\n />\n <Toaster />\n </ShellProviderStack>\n </ChromeProvider>\n </StrictMode>,\n );\n },\n };\n}\n\nfunction RoutedApp({\n router,\n queryClient,\n workspaceSetup,\n projectSlugResolver,\n}: {\n router: AnyRouter;\n queryClient: QueryClient;\n workspaceSetup: WorkspaceSetupGate | undefined;\n projectSlugResolver: ChromeSlots['projectSlugResolver'] | undefined;\n}) {\n const auth = useAuthState();\n\n useEffect(() => {\n if (!auth.isLoading) router.invalidate();\n }, [auth.isLoading, router]);\n\n return (\n <RouterProvider\n router={router as never}\n context={{auth, queryClient, workspaceSetup, projectSlugResolver} as never}\n />\n );\n}\n\nfunction configApiUrl(config: unknown): string {\n if (\n typeof config !== 'object' ||\n config === null ||\n !('apiUrl' in config) ||\n typeof config.apiUrl !== 'string'\n ) {\n throw new Error('Composed client configuration must include a string apiUrl.');\n }\n return config.apiUrl;\n}\n"],"names":["configureApiClient","ConfigErrorScreen","getWindowRuntimeConfig","loadConfig","setLoadedConfig","ThemeProvider","Toaster","TooltipProvider","QueryClient","RouterProvider","createStore","StrictMode","useEffect","createRoot","composeClientFeatures","useAuthState","ChromeProvider","ShellProviderStack","composeClientApp","features","router","chrome","workspaceSetup","composition","config","configShape","runtime","build","env","ok","mount","element","root","render","errors","baseUrl","configApiUrl","queryClient","store","RoutedApp","projectSlugResolver","auth","isLoading","invalidate","context","apiUrl","Error"],"mappings":";AAAA,SAAQA,kBAAkB,QAAO,sBAAsB;AACvD,SACEC,iBAAiB,EACjBC,sBAAsB,EACtBC,UAAU,EACVC,eAAe,QACV,yBAAyB;AAChC,SAAQC,aAAa,QAAO,0BAA0B;AACtD,SAAQC,OAAO,QAAO,0BA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;AAEA,SAASiC,UAAU,EACjBnB,MAAM,EACNiB,WAAW,EACXf,cAAc,EACdkB,mBAAmB,EAMpB;IACC,MAAMC,OAAO1B;IAEbH,UAAU;QACR,IAAI,CAAC6B,KAAKC,SAAS,EAAEtB,OAAOuB,UAAU;IACxC,GAAG;QAACF,KAAKC,SAAS;QAAEtB;KAAO;IAE3B,qBACE,KAACX;QACCW,QAAQA;QACRwB,SAAS;YAACH;YAAMJ;YAAaf;YAAgBkB;QAAmB;;AAGtE;AAEA,SAASJ,aAAaZ,MAAe;IACnC,IACE,OAAOA,WAAW,YAClBA,WAAW,QACX,CAAE,CAAA,YAAYA,MAAK,KACnB,OAAOA,OAAOqB,MAAM,KAAK,UACzB;QACA,MAAM,IAAIC,MAAM;IAClB;IACA,OAAOtB,OAAOqB,MAAM;AACtB"}
|
package/dist/runtime/index.d.ts
CHANGED
|
@@ -22,5 +22,6 @@ export * from './layout-navigation.js';
|
|
|
22
22
|
export * from './nav-order.js';
|
|
23
23
|
export * from './route-inputs.js';
|
|
24
24
|
export * from './router-context.js';
|
|
25
|
+
export * from './search-serialization.js';
|
|
25
26
|
export * from './workspace-setup.js';
|
|
26
27
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/runtime/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAE,SAAS,EAAE,KAAK,cAAc,EAAC,MAAM,2BAA2B,CAAC;AACtF,OAAO,EAAC,cAAc,EAAE,KAAK,mBAAmB,EAAC,MAAM,gCAAgC,CAAC;AACxF,OAAO,EAAC,iBAAiB,EAAC,MAAM,mCAAmC,CAAC;AACpE,YAAY,EACV,oBAAoB,EACpB,YAAY,EACZ,mBAAmB,EACnB,gBAAgB,GACjB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAC,sBAAsB,EAAE,cAAc,EAAC,MAAM,8BAA8B,CAAC;AACpF,cAAc,uCA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AAc,WAAW,CAAC;AAC1B,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,sBAAsB,CAAC"}
|
package/dist/runtime/index.js
CHANGED
|
@@ -21,6 +21,7 @@ export * from './layout-navigation.js';
|
|
|
21
21
|
export * from './nav-order.js';
|
|
22
22
|
export * from './route-inputs.js';
|
|
23
23
|
export * from './router-context.js';
|
|
24
|
+
export * from './search-serialization.js';
|
|
24
25
|
export * from './workspace-setup.js';
|
|
25
26
|
|
|
26
27
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/runtime/index.ts"],"sourcesContent":["export {AuthActions, AuthShell, type AuthShellProps} from '#components/auth-shell.js';\nexport {WorkspaceCrumb, type WorkspaceCrumbProps} from '#components/workspace-crumb.js';\nexport {WorkspaceSwitcher} from '#components/workspace-switcher.js';\nexport type {\n AuthenticatedSession,\n UserIdentity,\n WorkspaceMembership,\n WorkspaceSummary,\n} from '#core/session.js';\nexport {toAuthenticatedSession, toUserIdentity} from '#hooks/api/session-mapper.js';\nexport * from '../compose/compose-client-features.js';\nexport * from '../compose/compose-routes.js';\nexport * from '../compose/errors.js';\nexport * from '../compose/merge-config.js';\nexport * from '../compose/normalize-route-path.js';\nexport * from '../compose/validate-providers.js';\nexport * from '../compose/validate-registries.js';\nexport * from './active-workspace.js';\nexport * from './anchor-paths.js';\nexport * from './anchors.js';\nexport * from './auth.js';\nexport * from './chrome-context.js';\nexport * from './compose-client-app.js';\nexport * from './define-route.js';\nexport * from './last-workspace.js';\nexport * from './layout-navigation.js';\nexport * from './nav-order.js';\nexport * from './route-inputs.js';\nexport * from './router-context.js';\nexport * from './workspace-setup.js';\n"],"names":["AuthActions","AuthShell","WorkspaceCrumb","WorkspaceSwitcher","toAuthenticatedSession","toUserIdentity"],"mappings":"AAAA,SAAQA,WAAW,EAAEC,SAAS,QAA4B,4BAA4B;AACtF,SAAQC,cAAc,QAAiC,iCAAiC;AACxF,SAAQC,iBAAiB,QAAO,oCAAoC;AAOpE,SAAQC,sBAAsB,EAAEC,cAAc,QAAO,+BAA+B;AACpF,cAAc,wCAAwC;AACtD,cAAc,+BAA+B;AAC7C,cAAc,uBAAuB;AACrC,cAAc,6BAA6B;AAC3C,cAAc,qCAAqC;AACnD,cAAc,mCAAmC;AACjD,cAAc,oCAAoC;AAClD,cAAc,wBAAwB;AACtC,cAAc,oBAAoB;AAClC,cAAc,eAAe;AAC7B,cAAc,YAAY;AAC1B,cAAc,sBAAsB;AACpC,cAAc,0BAA0B;AACxC,cAAc,oBAAoB;AAClC,cAAc,sBAAsB;AACpC,cAAc,yBAAyB;AACvC,cAAc,iBAAiB;AAC/B,cAAc,oBAAoB;AAClC,cAAc,sBAAsB;AACpC,cAAc,uBAAuB"}
|
|
1
|
+
{"version":3,"sources":["../../src/runtime/index.ts"],"sourcesContent":["export {AuthActions, AuthShell, type AuthShellProps} from '#components/auth-shell.js';\nexport {WorkspaceCrumb, type WorkspaceCrumbProps} from '#components/workspace-crumb.js';\nexport {WorkspaceSwitcher} from '#components/workspace-switcher.js';\nexport type {\n AuthenticatedSession,\n UserIdentity,\n WorkspaceMembership,\n WorkspaceSummary,\n} from '#core/session.js';\nexport {toAuthenticatedSession, toUserIdentity} from '#hooks/api/session-mapper.js';\nexport * from '../compose/compose-client-features.js';\nexport * from '../compose/compose-routes.js';\nexport * from '../compose/errors.js';\nexport * from '../compose/merge-config.js';\nexport * from '../compose/normalize-route-path.js';\nexport * from '../compose/validate-providers.js';\nexport * from '../compose/validate-registries.js';\nexport * from './active-workspace.js';\nexport * from './anchor-paths.js';\nexport * from './anchors.js';\nexport * from './auth.js';\nexport * from './chrome-context.js';\nexport * from './compose-client-app.js';\nexport * from './define-route.js';\nexport * from './last-workspace.js';\nexport * from './layout-navigation.js';\nexport * from './nav-order.js';\nexport * from './route-inputs.js';\nexport * from './router-context.js';\nexport * from './search-serialization.js';\nexport * from './workspace-setup.js';\n"],"names":["AuthActions","AuthShell","WorkspaceCrumb","WorkspaceSwitcher","toAuthenticatedSession","toUserIdentity"],"mappings":"AAAA,SAAQA,WAAW,EAAEC,SAAS,QAA4B,4BAA4B;AACtF,SAAQC,cAAc,QAAiC,iCAAiC;AACxF,SAAQC,iBAAiB,QAAO,oCAAoC;AAOpE,SAAQC,sBAAsB,EAAEC,cAAc,QAAO,+BAA+B;AACpF,cAAc,wCAAwC;AACtD,cAAc,+BAA+B;AAC7C,cAAc,uBAAuB;AACrC,cAAc,6BAA6B;AAC3C,cAAc,qCAAqC;AACnD,cAAc,mCAAmC;AACjD,cAAc,oCAAoC;AAClD,cAAc,wBAAwB;AACtC,cAAc,oBAAoB;AAClC,cAAc,eAAe;AAC7B,cAAc,YAAY;AAC1B,cAAc,sBAAsB;AACpC,cAAc,0BAA0B;AACxC,cAAc,oBAAoB;AAClC,cAAc,sBAAsB;AACpC,cAAc,yBAAyB;AACvC,cAAc,iBAAiB;AAC/B,cAAc,oBAAoB;AAClC,cAAc,sBAAsB;AACpC,cAAc,4BAA4B;AAC1C,cAAc,uBAAuB"}
|
|
@@ -27,7 +27,10 @@ export function settingsEntries(features) {
|
|
|
27
27
|
entry,
|
|
28
28
|
featureIndex,
|
|
29
29
|
declarationIndex
|
|
30
|
-
}))).sort(byOrder).map(({ entry })=>
|
|
30
|
+
}))).sort(byOrder).map(({ entry })=>({
|
|
31
|
+
...entry,
|
|
32
|
+
scope: entry.scope ?? 'workspace'
|
|
33
|
+
}));
|
|
31
34
|
}
|
|
32
35
|
|
|
33
36
|
//# sourceMappingURL=registries.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/runtime/registries.ts"],"sourcesContent":["import {normalizeRoutePath} from '#compose/normalize-route-path.js';\nimport type {\n ClientFeature,\n LayoutNavigationEntry,\n NavTabEntry,\n SettingsSectionEntry,\n} from '#contract.js';\n\ninterface Ordered<T> {\n entry: T;\n featureIndex: number;\n declarationIndex: number;\n}\n\nfunction byOrder<T extends {order?: number}>(left: Ordered<T>, right: Ordered<T>): number {\n return (\n (left.entry.order ?? 500) - (right.entry.order ?? 500) ||\n left.featureIndex - right.featureIndex ||\n left.declarationIndex - right.declarationIndex\n );\n}\n\nexport function navigationEntries(features: readonly ClientFeature[]): NavTabEntry[] {\n return features\n .flatMap((feature, featureIndex) =>\n (feature.navigation ?? []).map((entry, declarationIndex) => ({\n entry,\n featureIndex,\n declarationIndex,\n })),\n )\n .sort(byOrder)\n .map(({entry}) => ({...entry, to: normalizeRoutePath(entry.to)}));\n}\n\nexport function layoutNavigationRegistry(\n features: readonly ClientFeature[],\n): ReadonlyMap<string, readonly LayoutNavigationEntry[]> {\n const registry = new Map<string, LayoutNavigationEntry[]>();\n for (const entry of navigationEntries(features)) {\n if (entry.scope !== 'layout') continue;\n const entries = registry.get(entry.layout) ?? [];\n entries.push(entry);\n registry.set(entry.layout, entries);\n }\n return registry;\n}\n\nexport function settingsEntries(features: readonly ClientFeature[]): SettingsSectionEntry[] {\n return features\n .flatMap((feature, featureIndex) =>\n (feature.settingsSections ?? []).map((entry, declarationIndex) => ({\n entry,\n featureIndex,\n declarationIndex,\n })),\n )\n .sort(byOrder)\n .map(({entry}) => entry);\n}\n"],"names":["normalizeRoutePath","byOrder","left","right","entry","order","featureIndex","declarationIndex","navigationEntries","features","flatMap","feature","navigation","map","sort","to","layoutNavigationRegistry","registry","Map","scope","entries","get","layout","push","set","settingsEntries","settingsSections"],"mappings":"AAAA,SAAQA,kBAAkB,QAAO,mCAAmC;AAcpE,SAASC,QAAoCC,IAAgB,EAAEC,KAAiB;IAC9E,OACE,AAACD,CAAAA,KAAKE,KAAK,CAACC,KAAK,IAAI,GAAE,IAAMF,CAAAA,MAAMC,KAAK,CAACC,KAAK,IAAI,GAAE,KACpDH,KAAKI,YAAY,GAAGH,MAAMG,YAAY,IACtCJ,KAAKK,gBAAgB,GAAGJ,MAAMI,gBAAgB;AAElD;AAEA,OAAO,SAASC,kBAAkBC,QAAkC;IAClE,OAAOA,SACJC,OAAO,CAAC,CAACC,SAASL,eACjB,AAACK,CAAAA,QAAQC,UAAU,IAAI,EAAE,AAAD,EAAGC,GAAG,CAAC,CAACT,OAAOG,mBAAsB,CAAA;gBAC3DH;gBACAE;gBACAC;YACF,CAAA,IAEDO,IAAI,CAACb,SACLY,GAAG,CAAC,CAAC,EAACT,KAAK,EAAC,GAAM,CAAA;YAAC,GAAGA,KAAK;YAAEW,IAAIf,mBAAmBI,MAAMW,EAAE;QAAC,CAAA;AAClE;AAEA,OAAO,SAASC,yBACdP,QAAkC;IAElC,MAAMQ,WAAW,IAAIC;IACrB,KAAK,MAAMd,SAASI,kBAAkBC,UAAW;QAC/C,IAAIL,MAAMe,KAAK,KAAK,UAAU;QAC9B,MAAMC,UAAUH,SAASI,GAAG,CAACjB,MAAMkB,MAAM,KAAK,EAAE;QAChDF,QAAQG,IAAI,CAACnB;QACba,SAASO,GAAG,CAACpB,MAAMkB,MAAM,EAAEF;IAC7B;IACA,OAAOH;AACT;AAEA,OAAO,SAASQ,gBAAgBhB,QAAkC;IAChE,OAAOA,SACJC,OAAO,CAAC,CAACC,SAASL,eACjB,AAACK,CAAAA,QAAQe,gBAAgB,IAAI,EAAE,AAAD,EAAGb,GAAG,CAAC,CAACT,OAAOG,mBAAsB,CAAA;gBACjEH;gBACAE;gBACAC;YACF,CAAA,IAEDO,IAAI,CAACb,SACLY,GAAG,CAAC,CAAC,EAACT,KAAK,EAAC,
|
|
1
|
+
{"version":3,"sources":["../../src/runtime/registries.ts"],"sourcesContent":["import {normalizeRoutePath} from '#compose/normalize-route-path.js';\nimport type {\n ClientFeature,\n LayoutNavigationEntry,\n NavTabEntry,\n SettingsSectionEntry,\n} from '#contract.js';\n\ninterface Ordered<T> {\n entry: T;\n featureIndex: number;\n declarationIndex: number;\n}\n\nfunction byOrder<T extends {order?: number}>(left: Ordered<T>, right: Ordered<T>): number {\n return (\n (left.entry.order ?? 500) - (right.entry.order ?? 500) ||\n left.featureIndex - right.featureIndex ||\n left.declarationIndex - right.declarationIndex\n );\n}\n\nexport function navigationEntries(features: readonly ClientFeature[]): NavTabEntry[] {\n return features\n .flatMap((feature, featureIndex) =>\n (feature.navigation ?? []).map((entry, declarationIndex) => ({\n entry,\n featureIndex,\n declarationIndex,\n })),\n )\n .sort(byOrder)\n .map(({entry}) => ({...entry, to: normalizeRoutePath(entry.to)}));\n}\n\nexport function layoutNavigationRegistry(\n features: readonly ClientFeature[],\n): ReadonlyMap<string, readonly LayoutNavigationEntry[]> {\n const registry = new Map<string, LayoutNavigationEntry[]>();\n for (const entry of navigationEntries(features)) {\n if (entry.scope !== 'layout') continue;\n const entries = registry.get(entry.layout) ?? [];\n entries.push(entry);\n registry.set(entry.layout, entries);\n }\n return registry;\n}\n\nexport function settingsEntries(features: readonly ClientFeature[]): SettingsSectionEntry[] {\n return features\n .flatMap((feature, featureIndex) =>\n (feature.settingsSections ?? []).map((entry, declarationIndex) => ({\n entry,\n featureIndex,\n declarationIndex,\n })),\n )\n .sort(byOrder)\n .map(({entry}) => ({...entry, scope: entry.scope ?? 'workspace'}));\n}\n"],"names":["normalizeRoutePath","byOrder","left","right","entry","order","featureIndex","declarationIndex","navigationEntries","features","flatMap","feature","navigation","map","sort","to","layoutNavigationRegistry","registry","Map","scope","entries","get","layout","push","set","settingsEntries","settingsSections"],"mappings":"AAAA,SAAQA,kBAAkB,QAAO,mCAAmC;AAcpE,SAASC,QAAoCC,IAAgB,EAAEC,KAAiB;IAC9E,OACE,AAACD,CAAAA,KAAKE,KAAK,CAACC,KAAK,IAAI,GAAE,IAAMF,CAAAA,MAAMC,KAAK,CAACC,KAAK,IAAI,GAAE,KACpDH,KAAKI,YAAY,GAAGH,MAAMG,YAAY,IACtCJ,KAAKK,gBAAgB,GAAGJ,MAAMI,gBAAgB;AAElD;AAEA,OAAO,SAASC,kBAAkBC,QAAkC;IAClE,OAAOA,SACJC,OAAO,CAAC,CAACC,SAASL,eACjB,AAACK,CAAAA,QAAQC,UAAU,IAAI,EAAE,AAAD,EAAGC,GAAG,CAAC,CAACT,OAAOG,mBAAsB,CAAA;gBAC3DH;gBACAE;gBACAC;YACF,CAAA,IAEDO,IAAI,CAACb,SACLY,GAAG,CAAC,CAAC,EAACT,KAAK,EAAC,GAAM,CAAA;YAAC,GAAGA,KAAK;YAAEW,IAAIf,mBAAmBI,MAAMW,EAAE;QAAC,CAAA;AAClE;AAEA,OAAO,SAASC,yBACdP,QAAkC;IAElC,MAAMQ,WAAW,IAAIC;IACrB,KAAK,MAAMd,SAASI,kBAAkBC,UAAW;QAC/C,IAAIL,MAAMe,KAAK,KAAK,UAAU;QAC9B,MAAMC,UAAUH,SAASI,GAAG,CAACjB,MAAMkB,MAAM,KAAK,EAAE;QAChDF,QAAQG,IAAI,CAACnB;QACba,SAASO,GAAG,CAACpB,MAAMkB,MAAM,EAAEF;IAC7B;IACA,OAAOH;AACT;AAEA,OAAO,SAASQ,gBAAgBhB,QAAkC;IAChE,OAAOA,SACJC,OAAO,CAAC,CAACC,SAASL,eACjB,AAACK,CAAAA,QAAQe,gBAAgB,IAAI,EAAE,AAAD,EAAGb,GAAG,CAAC,CAACT,OAAOG,mBAAsB,CAAA;gBACjEH;gBACAE;gBACAC;YACF,CAAA,IAEDO,IAAI,CAACb,SACLY,GAAG,CAAC,CAAC,EAACT,KAAK,EAAC,GAAM,CAAA;YAAC,GAAGA,KAAK;YAAEe,OAAOf,MAAMe,KAAK,IAAI;QAAW,CAAA;AACnE"}
|
|
@@ -9,10 +9,10 @@ export declare function useRouteSearch<T>(parse: (search: Record<string, unknown
|
|
|
9
9
|
*/
|
|
10
10
|
export declare function useRouteParams<T>(parse: (params: Record<string, unknown>) => T): T;
|
|
11
11
|
export declare function parseWorkspaceParams(input: Record<string, unknown>): {
|
|
12
|
-
|
|
12
|
+
workspaceSlug?: string;
|
|
13
13
|
};
|
|
14
14
|
export declare function parseWorkspaceProjectParams(input: Record<string, unknown>): {
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
workspaceSlug?: string;
|
|
16
|
+
projectSlug?: string;
|
|
17
17
|
};
|
|
18
18
|
//# sourceMappingURL=route-inputs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"route-inputs.d.ts","sourceRoot":"","sources":["../../src/runtime/route-inputs.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAGlF;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAGlF;AAMD,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG;IAAC,
|
|
1
|
+
{"version":3,"file":"route-inputs.d.ts","sourceRoot":"","sources":["../../src/runtime/route-inputs.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAGlF;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAGlF;AAMD,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG;IAAC,aAAa,CAAC,EAAE,MAAM,CAAA;CAAC,CAG7F;AAED,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG;IAC3E,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAOA"}
|
|
@@ -28,20 +28,20 @@ function optionalRouteString(value) {
|
|
|
28
28
|
return typeof value === 'string' && value.length > 0 ? value : undefined;
|
|
29
29
|
}
|
|
30
30
|
export function parseWorkspaceParams(input) {
|
|
31
|
-
const
|
|
32
|
-
return
|
|
33
|
-
|
|
31
|
+
const workspaceSlug = optionalRouteString(input.workspaceSlug);
|
|
32
|
+
return workspaceSlug ? {
|
|
33
|
+
workspaceSlug
|
|
34
34
|
} : {};
|
|
35
35
|
}
|
|
36
36
|
export function parseWorkspaceProjectParams(input) {
|
|
37
|
-
const
|
|
38
|
-
const
|
|
37
|
+
const workspaceSlug = optionalRouteString(input.workspaceSlug);
|
|
38
|
+
const projectSlug = optionalRouteString(input.projectSlug);
|
|
39
39
|
return {
|
|
40
|
-
...
|
|
41
|
-
|
|
40
|
+
...workspaceSlug ? {
|
|
41
|
+
workspaceSlug
|
|
42
42
|
} : {},
|
|
43
|
-
...
|
|
44
|
-
|
|
43
|
+
...projectSlug ? {
|
|
44
|
+
projectSlug
|
|
45
45
|
} : {}
|
|
46
46
|
};
|
|
47
47
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/runtime/route-inputs.ts"],"sourcesContent":["import {useParams, useSearch} from '@tanstack/react-router';\nimport {useMemo} from 'react';\n\n/**\n * Reads inputs at the dynamic feature-route boundary. Feature routes must immediately\n * validate the result and pass typed values to pages; Shell never interprets feature input.\n */\nexport function useRouteSearch<T>(parse: (search: Record<string, unknown>) => T): T {\n const search = useSearch({strict: false}) as Record<string, unknown>;\n return useMemo(() => parse(search), [parse, search]);\n}\n\n/**\n * Reads path parameters at the dynamic feature-route boundary without making Shell\n * responsible for a feature's parameter contract.\n */\nexport function useRouteParams<T>(parse: (params: Record<string, unknown>) => T): T {\n const params = useParams({strict: false}) as Record<string, unknown>;\n return useMemo(() => parse(params), [parse, params]);\n}\n\nfunction optionalRouteString(value: unknown): string | undefined {\n return typeof value === 'string' && value.length > 0 ? value : undefined;\n}\n\nexport function parseWorkspaceParams(input: Record<string, unknown>): {
|
|
1
|
+
{"version":3,"sources":["../../src/runtime/route-inputs.ts"],"sourcesContent":["import {useParams, useSearch} from '@tanstack/react-router';\nimport {useMemo} from 'react';\n\n/**\n * Reads inputs at the dynamic feature-route boundary. Feature routes must immediately\n * validate the result and pass typed values to pages; Shell never interprets feature input.\n */\nexport function useRouteSearch<T>(parse: (search: Record<string, unknown>) => T): T {\n const search = useSearch({strict: false}) as Record<string, unknown>;\n return useMemo(() => parse(search), [parse, search]);\n}\n\n/**\n * Reads path parameters at the dynamic feature-route boundary without making Shell\n * responsible for a feature's parameter contract.\n */\nexport function useRouteParams<T>(parse: (params: Record<string, unknown>) => T): T {\n const params = useParams({strict: false}) as Record<string, unknown>;\n return useMemo(() => parse(params), [parse, params]);\n}\n\nfunction optionalRouteString(value: unknown): string | undefined {\n return typeof value === 'string' && value.length > 0 ? value : undefined;\n}\n\nexport function parseWorkspaceParams(input: Record<string, unknown>): {workspaceSlug?: string} {\n const workspaceSlug = optionalRouteString(input.workspaceSlug);\n return workspaceSlug ? {workspaceSlug} : {};\n}\n\nexport function parseWorkspaceProjectParams(input: Record<string, unknown>): {\n workspaceSlug?: string;\n projectSlug?: string;\n} {\n const workspaceSlug = optionalRouteString(input.workspaceSlug);\n const projectSlug = optionalRouteString(input.projectSlug);\n return {\n ...(workspaceSlug ? {workspaceSlug} : {}),\n ...(projectSlug ? {projectSlug} : {}),\n };\n}\n"],"names":["useParams","useSearch","useMemo","useRouteSearch","parse","search","strict","useRouteParams","params","optionalRouteString","value","length","undefined","parseWorkspaceParams","input","workspaceSlug","parseWorkspaceProjectParams","projectSlug"],"mappings":"AAAA,SAAQA,SAAS,EAAEC,SAAS,QAAO,yBAAyB;AAC5D,SAAQC,OAAO,QAAO,QAAQ;AAE9B;;;CAGC,GACD,OAAO,SAASC,eAAkBC,KAA6C;IAC7E,MAAMC,SAASJ,UAAU;QAACK,QAAQ;IAAK;IACvC,OAAOJ,QAAQ,IAAME,MAAMC,SAAS;QAACD;QAAOC;KAAO;AACrD;AAEA;;;CAGC,GACD,OAAO,SAASE,eAAkBH,KAA6C;IAC7E,MAAMI,SAASR,UAAU;QAACM,QAAQ;IAAK;IACvC,OAAOJ,QAAQ,IAAME,MAAMI,SAAS;QAACJ;QAAOI;KAAO;AACrD;AAEA,SAASC,oBAAoBC,KAAc;IACzC,OAAO,OAAOA,UAAU,YAAYA,MAAMC,MAAM,GAAG,IAAID,QAAQE;AACjE;AAEA,OAAO,SAASC,qBAAqBC,KAA8B;IACjE,MAAMC,gBAAgBN,oBAAoBK,MAAMC,aAAa;IAC7D,OAAOA,gBAAgB;QAACA;IAAa,IAAI,CAAC;AAC5C;AAEA,OAAO,SAASC,4BAA4BF,KAA8B;IAIxE,MAAMC,gBAAgBN,oBAAoBK,MAAMC,aAAa;IAC7D,MAAME,cAAcR,oBAAoBK,MAAMG,WAAW;IACzD,OAAO;QACL,GAAIF,gBAAgB;YAACA;QAAa,IAAI,CAAC,CAAC;QACxC,GAAIE,cAAc;YAACA;QAAW,IAAI,CAAC,CAAC;IACtC;AACF"}
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
import type { QueryClient } from '@tanstack/react-query';
|
|
2
2
|
import type { AuthStateValue } from './auth.js';
|
|
3
3
|
import type { WorkspaceSetupGate } from './workspace-setup.js';
|
|
4
|
+
export interface ProjectSlugResolverOptions {
|
|
5
|
+
queryClient: QueryClient;
|
|
6
|
+
workspaceId: string;
|
|
7
|
+
projectSlug: string;
|
|
8
|
+
}
|
|
9
|
+
export type ProjectSlugResolver = (options: ProjectSlugResolverOptions) => Promise<string | undefined>;
|
|
4
10
|
export interface RouterContext {
|
|
5
11
|
auth: AuthStateValue | undefined;
|
|
6
12
|
queryClient: QueryClient | undefined;
|
|
7
13
|
workspaceSetup?: WorkspaceSetupGate;
|
|
14
|
+
projectSlugResolver?: ProjectSlugResolver;
|
|
8
15
|
}
|
|
9
16
|
//# sourceMappingURL=router-context.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"router-context.d.ts","sourceRoot":"","sources":["../../src/runtime/router-context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,uBAAuB,CAAC;AACvD,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,WAAW,CAAC;AAC9C,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,sBAAsB,CAAC;AAE7D,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,cAAc,GAAG,SAAS,CAAC;IACjC,WAAW,EAAE,WAAW,GAAG,SAAS,CAAC;IACrC,cAAc,CAAC,EAAE,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"router-context.d.ts","sourceRoot":"","sources":["../../src/runtime/router-context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,uBAAuB,CAAC;AACvD,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,WAAW,CAAC;AAC9C,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,sBAAsB,CAAC;AAE7D,MAAM,WAAW,0BAA0B;IACzC,WAAW,EAAE,WAAW,CAAC;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,MAAM,mBAAmB,GAAG,CAChC,OAAO,EAAE,0BAA0B,KAChC,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;AAEjC,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,cAAc,GAAG,SAAS,CAAC;IACjC,WAAW,EAAE,WAAW,GAAG,SAAS,CAAC;IACrC,cAAc,CAAC,EAAE,kBAAkB,CAAC;IACpC,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;CAC3C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/runtime/router-context.ts"],"sourcesContent":["import type {QueryClient} from '@tanstack/react-query';\nimport type {AuthStateValue} from './auth.js';\nimport type {WorkspaceSetupGate} from './workspace-setup.js';\n\nexport interface RouterContext {\n auth: AuthStateValue | undefined;\n queryClient: QueryClient | undefined;\n workspaceSetup?: WorkspaceSetupGate;\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/runtime/router-context.ts"],"sourcesContent":["import type {QueryClient} from '@tanstack/react-query';\nimport type {AuthStateValue} from './auth.js';\nimport type {WorkspaceSetupGate} from './workspace-setup.js';\n\nexport interface ProjectSlugResolverOptions {\n queryClient: QueryClient;\n workspaceId: string;\n projectSlug: string;\n}\n\nexport type ProjectSlugResolver = (\n options: ProjectSlugResolverOptions,\n) => Promise<string | undefined>;\n\nexport interface RouterContext {\n auth: AuthStateValue | undefined;\n queryClient: QueryClient | undefined;\n workspaceSetup?: WorkspaceSetupGate;\n projectSlugResolver?: ProjectSlugResolver;\n}\n"],"names":[],"mappings":"AAcA,WAKC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parses a query string into route search values.
|
|
3
|
+
*
|
|
4
|
+
* TanStack's parser folds a repeated key into an array but then decodes only scalars, because
|
|
5
|
+
* its own encoder never writes a repeated key. `stringifyAppSearch` does, and it quotes a
|
|
6
|
+
* JSON-parseable string so the value survives the round trip, so the same decoding has to
|
|
7
|
+
* reach inside an array. Without this a branch named `2024` comes back as `"2024"`, quotes
|
|
8
|
+
* included, and silently matches nothing.
|
|
9
|
+
*/
|
|
10
|
+
export declare function parseAppSearch(searchStr: string): Record<string, unknown>;
|
|
11
|
+
/**
|
|
12
|
+
* Serializes route search values, expanding an array into one entry per element.
|
|
13
|
+
*
|
|
14
|
+
* TanStack's default encoder writes at most one entry per key and JSON-encodes anything that
|
|
15
|
+
* is not a primitive, so a multi-select filter would reach the URL as
|
|
16
|
+
* `?status=%5B%22failed%22%2C%22running%22%5D`. Repeating the key instead is what
|
|
17
|
+
* `URLSearchParams` does natively, keeps the URL readable, and is the only encoding that
|
|
18
|
+
* survives a value which legitimately contains a comma, such as a branch name.
|
|
19
|
+
*
|
|
20
|
+
* The round trip is lossy in exactly one direction: a single-element array comes back as a
|
|
21
|
+
* scalar, because `?status=failed` cannot say whether it meant one value or a list of one.
|
|
22
|
+
* A route that accepts repeated keys therefore normalizes a scalar into an array when it
|
|
23
|
+
* validates, rather than trusting the shape the parser handed it.
|
|
24
|
+
*/
|
|
25
|
+
export declare function stringifyAppSearch(search: Record<string, unknown>): string;
|
|
26
|
+
//# sourceMappingURL=search-serialization.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search-serialization.d.ts","sourceRoot":"","sources":["../../src/runtime/search-serialization.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAMzE;AAcD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAe1E"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { defaultParseSearch } from '@tanstack/react-router';
|
|
2
|
+
/**
|
|
3
|
+
* Parses a query string into route search values.
|
|
4
|
+
*
|
|
5
|
+
* TanStack's parser folds a repeated key into an array but then decodes only scalars, because
|
|
6
|
+
* its own encoder never writes a repeated key. `stringifyAppSearch` does, and it quotes a
|
|
7
|
+
* JSON-parseable string so the value survives the round trip, so the same decoding has to
|
|
8
|
+
* reach inside an array. Without this a branch named `2024` comes back as `"2024"`, quotes
|
|
9
|
+
* included, and silently matches nothing.
|
|
10
|
+
*/ export function parseAppSearch(searchStr) {
|
|
11
|
+
const search = defaultParseSearch(searchStr);
|
|
12
|
+
for (const [key, value] of Object.entries(search)){
|
|
13
|
+
if (Array.isArray(value)) search[key] = value.map(decodeSearchValue);
|
|
14
|
+
}
|
|
15
|
+
return search;
|
|
16
|
+
}
|
|
17
|
+
// Mirrors what the default parser already does to a scalar: JSON when it parses, the raw
|
|
18
|
+
// string when it does not. Values the query-string decoder already turned into numbers or
|
|
19
|
+
// booleans are left alone.
|
|
20
|
+
function decodeSearchValue(value) {
|
|
21
|
+
if (typeof value !== 'string') return value;
|
|
22
|
+
try {
|
|
23
|
+
return JSON.parse(value);
|
|
24
|
+
} catch {
|
|
25
|
+
return value;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Serializes route search values, expanding an array into one entry per element.
|
|
30
|
+
*
|
|
31
|
+
* TanStack's default encoder writes at most one entry per key and JSON-encodes anything that
|
|
32
|
+
* is not a primitive, so a multi-select filter would reach the URL as
|
|
33
|
+
* `?status=%5B%22failed%22%2C%22running%22%5D`. Repeating the key instead is what
|
|
34
|
+
* `URLSearchParams` does natively, keeps the URL readable, and is the only encoding that
|
|
35
|
+
* survives a value which legitimately contains a comma, such as a branch name.
|
|
36
|
+
*
|
|
37
|
+
* The round trip is lossy in exactly one direction: a single-element array comes back as a
|
|
38
|
+
* scalar, because `?status=failed` cannot say whether it meant one value or a list of one.
|
|
39
|
+
* A route that accepts repeated keys therefore normalizes a scalar into an array when it
|
|
40
|
+
* validates, rather than trusting the shape the parser handed it.
|
|
41
|
+
*/ export function stringifyAppSearch(search) {
|
|
42
|
+
const params = new URLSearchParams();
|
|
43
|
+
for (const [key, value] of Object.entries(search)){
|
|
44
|
+
if (value === undefined) continue;
|
|
45
|
+
if (Array.isArray(value)) {
|
|
46
|
+
for (const entry of value){
|
|
47
|
+
if (entry !== undefined) params.append(key, serializeSearchValue(entry));
|
|
48
|
+
}
|
|
49
|
+
continue;
|
|
50
|
+
}
|
|
51
|
+
params.set(key, serializeSearchValue(value));
|
|
52
|
+
}
|
|
53
|
+
const searchStr = params.toString();
|
|
54
|
+
return searchStr ? `?${searchStr}` : '';
|
|
55
|
+
}
|
|
56
|
+
// Mirrors the default encoder's value handling so non-array params are untouched by this
|
|
57
|
+
// override: objects are JSON, and a string that happens to parse as JSON is re-quoted so it
|
|
58
|
+
// survives the parser's JSON.parse rather than coming back as a number or a boolean.
|
|
59
|
+
function serializeSearchValue(value) {
|
|
60
|
+
if (typeof value === 'object' && value !== null) {
|
|
61
|
+
try {
|
|
62
|
+
return JSON.stringify(value);
|
|
63
|
+
} catch {
|
|
64
|
+
return String(value);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
if (typeof value === 'string') {
|
|
68
|
+
try {
|
|
69
|
+
JSON.parse(value);
|
|
70
|
+
return JSON.stringify(value);
|
|
71
|
+
} catch {
|
|
72
|
+
return value;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return String(value);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
//# sourceMappingURL=search-serialization.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/runtime/search-serialization.ts"],"sourcesContent":["import {defaultParseSearch} from '@tanstack/react-router';\n\n/**\n * Parses a query string into route search values.\n *\n * TanStack's parser folds a repeated key into an array but then decodes only scalars, because\n * its own encoder never writes a repeated key. `stringifyAppSearch` does, and it quotes a\n * JSON-parseable string so the value survives the round trip, so the same decoding has to\n * reach inside an array. Without this a branch named `2024` comes back as `\"2024\"`, quotes\n * included, and silently matches nothing.\n */\nexport function parseAppSearch(searchStr: string): Record<string, unknown> {\n const search: Record<string, unknown> = defaultParseSearch(searchStr);\n for (const [key, value] of Object.entries(search)) {\n if (Array.isArray(value)) search[key] = value.map(decodeSearchValue);\n }\n return search;\n}\n\n// Mirrors what the default parser already does to a scalar: JSON when it parses, the raw\n// string when it does not. Values the query-string decoder already turned into numbers or\n// booleans are left alone.\nfunction decodeSearchValue(value: unknown): unknown {\n if (typeof value !== 'string') return value;\n try {\n return JSON.parse(value);\n } catch {\n return value;\n }\n}\n\n/**\n * Serializes route search values, expanding an array into one entry per element.\n *\n * TanStack's default encoder writes at most one entry per key and JSON-encodes anything that\n * is not a primitive, so a multi-select filter would reach the URL as\n * `?status=%5B%22failed%22%2C%22running%22%5D`. Repeating the key instead is what\n * `URLSearchParams` does natively, keeps the URL readable, and is the only encoding that\n * survives a value which legitimately contains a comma, such as a branch name.\n *\n * The round trip is lossy in exactly one direction: a single-element array comes back as a\n * scalar, because `?status=failed` cannot say whether it meant one value or a list of one.\n * A route that accepts repeated keys therefore normalizes a scalar into an array when it\n * validates, rather than trusting the shape the parser handed it.\n */\nexport function stringifyAppSearch(search: Record<string, unknown>): string {\n const params = new URLSearchParams();\n for (const [key, value] of Object.entries(search)) {\n if (value === undefined) continue;\n if (Array.isArray(value)) {\n for (const entry of value) {\n if (entry !== undefined) params.append(key, serializeSearchValue(entry));\n }\n continue;\n }\n params.set(key, serializeSearchValue(value));\n }\n\n const searchStr = params.toString();\n return searchStr ? `?${searchStr}` : '';\n}\n\n// Mirrors the default encoder's value handling so non-array params are untouched by this\n// override: objects are JSON, and a string that happens to parse as JSON is re-quoted so it\n// survives the parser's JSON.parse rather than coming back as a number or a boolean.\nfunction serializeSearchValue(value: unknown): string {\n if (typeof value === 'object' && value !== null) {\n try {\n return JSON.stringify(value);\n } catch {\n return String(value);\n }\n }\n\n if (typeof value === 'string') {\n try {\n JSON.parse(value);\n return JSON.stringify(value);\n } catch {\n return value;\n }\n }\n\n return String(value);\n}\n"],"names":["defaultParseSearch","parseAppSearch","searchStr","search","key","value","Object","entries","Array","isArray","map","decodeSearchValue","JSON","parse","stringifyAppSearch","params","URLSearchParams","undefined","entry","append","serializeSearchValue","set","toString","stringify","String"],"mappings":"AAAA,SAAQA,kBAAkB,QAAO,yBAAyB;AAE1D;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O,KAAKW,SAAS,CAAClB;QACxB,EAAE,OAAM;YACN,OAAOA;QACT;IACF;IAEA,OAAOmB,OAAOnB;AAChB"}
|
|
@@ -7,6 +7,7 @@ export interface WorkspaceSetupState {
|
|
|
7
7
|
export interface WorkspaceSetupRouteOptions {
|
|
8
8
|
queryClient: QueryClient;
|
|
9
9
|
workspaceId: string;
|
|
10
|
+
workspaceSlug: string;
|
|
10
11
|
pathname: string;
|
|
11
12
|
}
|
|
12
13
|
export type WorkspaceSetupGate = (options: WorkspaceSetupRouteOptions) => Promise<WorkspaceSetupState>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspace-setup.d.ts","sourceRoot":"","sources":["../../src/runtime/workspace-setup.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAC,KAAK,mBAAmB,EAAY,MAAM,wBAAwB,CAAC;AAE3E,MAAM,WAAW,mBAAmB;IAClC,qBAAqB,EAAE,OAAO,CAAC;IAC/B,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AACD,MAAM,WAAW,0BAA0B;IACzC,WAAW,EAAE,WAAW,CAAC;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;CAClB;AACD,MAAM,MAAM,kBAAkB,GAAG,CAC/B,OAAO,EAAE,0BAA0B,KAChC,OAAO,CAAC,mBAAmB,CAAC,CAAC;AAElC,qBAAa,uBAAwB,SAAQ,KAAK;aACX,KAAK,EAAE,OAAO;gBAAd,KAAK,EAAE,OAAO;CAIpD;AACD,wBAAgB,qBAAqB,gCAEpC;AAED,wBAAgB,wBAAwB,CAAC,EAAC,aAAa,EAAC,EAAE;IAAC,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAAC,+BAc7F;AACD,wBAAgB,yBAAyB,CAAC,EAAC,KAAK,EAAE,KAAK,EAAC,EAAE,mBAAmB,+BA+B5E"}
|
|
1
|
+
{"version":3,"file":"workspace-setup.d.ts","sourceRoot":"","sources":["../../src/runtime/workspace-setup.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAC,KAAK,mBAAmB,EAAY,MAAM,wBAAwB,CAAC;AAE3E,MAAM,WAAW,mBAAmB;IAClC,qBAAqB,EAAE,OAAO,CAAC;IAC/B,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AACD,MAAM,WAAW,0BAA0B;IACzC,WAAW,EAAE,WAAW,CAAC;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;CAClB;AACD,MAAM,MAAM,kBAAkB,GAAG,CAC/B,OAAO,EAAE,0BAA0B,KAChC,OAAO,CAAC,mBAAmB,CAAC,CAAC;AAElC,qBAAa,uBAAwB,SAAQ,KAAK;aACX,KAAK,EAAE,OAAO;gBAAd,KAAK,EAAE,OAAO;CAIpD;AACD,wBAAgB,qBAAqB,gCAEpC;AAED,wBAAgB,wBAAwB,CAAC,EAAC,aAAa,EAAC,EAAE;IAAC,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAAC,+BAc7F;AACD,wBAAgB,yBAAyB,CAAC,EAAC,KAAK,EAAE,KAAK,EAAC,EAAE,mBAAmB,+BA+B5E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/runtime/workspace-setup.tsx"],"sourcesContent":["import {ApiError} from '@shipfox/client-api';\nimport {Button} from '@shipfox/react-ui/button';\nimport {Callout} from '@shipfox/react-ui/callout';\nimport {FullPageLoader} from '@shipfox/react-ui/loader';\nimport {Header, Text} from '@shipfox/react-ui/typography';\nimport type {QueryClient} from '@tanstack/react-query';\nimport {type ErrorComponentProps, useRouter} from '@tanstack/react-router';\n\nexport interface WorkspaceSetupState {\n hideProjectNavigation: boolean;\n unavailable?: boolean;\n}\nexport interface WorkspaceSetupRouteOptions {\n queryClient: QueryClient;\n workspaceId: string;\n pathname: string;\n}\nexport type WorkspaceSetupGate = (\n options: WorkspaceSetupRouteOptions,\n) => Promise<WorkspaceSetupState>;\n\nexport class WorkspaceSetupLoadError extends Error {\n constructor(public override readonly cause: unknown) {\n super(cause instanceof Error ? cause.message : 'Workspace setup load failed');\n this.name = 'WorkspaceSetupLoadError';\n }\n}\nexport function WorkspaceSetupPending() {\n return <FullPageLoader />;\n}\n\nexport function WorkspaceUnavailablePage({workspaceName}: {workspaceName?: string | undefined}) {\n return (\n <main className=\"min-h-screen bg-background-subtle-base px-24 py-32 max-[520px]:px-16\">\n <div className=\"mx-auto flex w-full max-w-[640px] flex-col gap-12\">\n <Header variant=\"h1\">Workspace unavailable</Header>\n <Text size=\"md\" className=\"text-foreground-neutral-muted\">\n {workspaceName\n ? `${workspaceName} is currently unavailable.`\n : 'This workspace is currently unavailable.'}{' '}\n Please contact your configured support contact if you need help.\n </Text>\n </div>\n </main>\n );\n}\nexport function WorkspaceLayoutErrorRoute({error, reset}: ErrorComponentProps) {\n const router = useRouter();\n const retry = () => {\n reset();\n void router.invalidate();\n };\n const setupError = error instanceof WorkspaceSetupLoadError;\n const message =\n error instanceof ApiError\n ? error.message\n : setupError && error.cause instanceof ApiError\n ? error.cause.message\n : 'Try again in a moment.';\n return (\n <main className=\"min-h-screen bg-background-subtle-base px-24 py-32 max-[520px]:px-16\">\n <div className=\"mx-auto flex w-full max-w-[640px] flex-col gap-24\">\n <Header variant=\"h1\">{setupError ? 'Workspace setup' : 'Workspace'}</Header>\n <Callout role=\"alert\" type=\"error\">\n <div className=\"flex flex-col gap-8\">\n <Text size=\"sm\" bold>\n {setupError ? 'Could not load workspace setup' : 'Could not load workspace'}\n </Text>\n <Text size=\"sm\">{message}</Text>\n <Button size=\"sm\" variant=\"secondary\" onClick={retry} className=\"w-fit\">\n Retry\n </Button>\n </div>\n </Callout>\n </div>\n </main>\n );\n}\n"],"names":["ApiError","Button","Callout","FullPageLoader","Header","Text","useRouter","WorkspaceSetupLoadError","Error","cause","message","name","WorkspaceSetupPending","WorkspaceUnavailablePage","workspaceName","main","className","div","variant","size","WorkspaceLayoutErrorRoute","error","reset","router","retry","invalidate","setupError","role","type","bold","onClick"],"mappings":";AAAA,SAAQA,QAAQ,QAAO,sBAAsB;AAC7C,SAAQC,MAAM,QAAO,2BAA2B;AAChD,SAAQC,OAAO,QAAO,4BAA4B;AAClD,SAAQC,cAAc,QAAO,2BAA2B;AACxD,SAAQC,MAAM,EAAEC,IAAI,QAAO,+BAA+B;AAE1D,SAAkCC,SAAS,QAAO,yBAAyB;
|
|
1
|
+
{"version":3,"sources":["../../src/runtime/workspace-setup.tsx"],"sourcesContent":["import {ApiError} from '@shipfox/client-api';\nimport {Button} from '@shipfox/react-ui/button';\nimport {Callout} from '@shipfox/react-ui/callout';\nimport {FullPageLoader} from '@shipfox/react-ui/loader';\nimport {Header, Text} from '@shipfox/react-ui/typography';\nimport type {QueryClient} from '@tanstack/react-query';\nimport {type ErrorComponentProps, useRouter} from '@tanstack/react-router';\n\nexport interface WorkspaceSetupState {\n hideProjectNavigation: boolean;\n unavailable?: boolean;\n}\nexport interface WorkspaceSetupRouteOptions {\n queryClient: QueryClient;\n workspaceId: string;\n workspaceSlug: string;\n pathname: string;\n}\nexport type WorkspaceSetupGate = (\n options: WorkspaceSetupRouteOptions,\n) => Promise<WorkspaceSetupState>;\n\nexport class WorkspaceSetupLoadError extends Error {\n constructor(public override readonly cause: unknown) {\n super(cause instanceof Error ? cause.message : 'Workspace setup load failed');\n this.name = 'WorkspaceSetupLoadError';\n }\n}\nexport function WorkspaceSetupPending() {\n return <FullPageLoader />;\n}\n\nexport function WorkspaceUnavailablePage({workspaceName}: {workspaceName?: string | undefined}) {\n return (\n <main className=\"min-h-screen bg-background-subtle-base px-24 py-32 max-[520px]:px-16\">\n <div className=\"mx-auto flex w-full max-w-[640px] flex-col gap-12\">\n <Header variant=\"h1\">Workspace unavailable</Header>\n <Text size=\"md\" className=\"text-foreground-neutral-muted\">\n {workspaceName\n ? `${workspaceName} is currently unavailable.`\n : 'This workspace is currently unavailable.'}{' '}\n Please contact your configured support contact if you need help.\n </Text>\n </div>\n </main>\n );\n}\nexport function WorkspaceLayoutErrorRoute({error, reset}: ErrorComponentProps) {\n const router = useRouter();\n const retry = () => {\n reset();\n void router.invalidate();\n };\n const setupError = error instanceof WorkspaceSetupLoadError;\n const message =\n error instanceof ApiError\n ? error.message\n : setupError && error.cause instanceof ApiError\n ? error.cause.message\n : 'Try again in a moment.';\n return (\n <main className=\"min-h-screen bg-background-subtle-base px-24 py-32 max-[520px]:px-16\">\n <div className=\"mx-auto flex w-full max-w-[640px] flex-col gap-24\">\n <Header variant=\"h1\">{setupError ? 'Workspace setup' : 'Workspace'}</Header>\n <Callout role=\"alert\" type=\"error\">\n <div className=\"flex flex-col gap-8\">\n <Text size=\"sm\" bold>\n {setupError ? 'Could not load workspace setup' : 'Could not load workspace'}\n </Text>\n <Text size=\"sm\">{message}</Text>\n <Button size=\"sm\" variant=\"secondary\" onClick={retry} className=\"w-fit\">\n Retry\n </Button>\n </div>\n </Callout>\n </div>\n </main>\n );\n}\n"],"names":["ApiError","Button","Callout","FullPageLoader","Header","Text","useRouter","WorkspaceSetupLoadError","Error","cause","message","name","WorkspaceSetupPending","WorkspaceUnavailablePage","workspaceName","main","className","div","variant","size","WorkspaceLayoutErrorRoute","error","reset","router","retry","invalidate","setupError","role","type","bold","onClick"],"mappings":";AAAA,SAAQA,QAAQ,QAAO,sBAAsB;AAC7C,SAAQC,MAAM,QAAO,2BAA2B;AAChD,SAAQC,OAAO,QAAO,4BAA4B;AAClD,SAAQC,cAAc,QAAO,2BAA2B;AACxD,SAAQC,MAAM,EAAEC,IAAI,QAAO,+BAA+B;AAE1D,SAAkCC,SAAS,QAAO,yBAAyB;AAgB3E,OAAO,MAAMC,gCAAgCC;IAC3C,YAAY,AAAyBC,KAAc,CAAE;QACnD,KAAK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