@powerhousedao/connect 6.2.3-dev.8 → 6.2.3-dev.80
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/README.md +29 -1
- package/dist/{AddDriveModal-xAw48kdl.js → AddDriveModal-CFi-9FQU.js} +28 -15
- package/dist/AddDriveModal-CFi-9FQU.js.map +1 -0
- package/dist/{ClearStorageModal-BAqs4G2s.js → ClearStorageModal-XlHarNph.js} +11 -13
- package/dist/ClearStorageModal-XlHarNph.js.map +1 -0
- package/dist/{ConfirmDocumentUpgradeModal-FUOhZsk7.js → ConfirmDocumentUpgradeModal-CoixS60F.js} +9 -8
- package/dist/ConfirmDocumentUpgradeModal-CoixS60F.js.map +1 -0
- package/dist/{CookiesPolicyModal-BpyPPyxS.js → CookiesPolicyModal-BpFjYc7T.js} +5 -5
- package/dist/{CookiesPolicyModal-BpyPPyxS.js.map → CookiesPolicyModal-BpFjYc7T.js.map} +1 -1
- package/dist/CreateDocumentModal-CiIW3pzx.js +45 -0
- package/dist/CreateDocumentModal-CiIW3pzx.js.map +1 -0
- package/dist/{DebugSettingsModal-rV_v0F0d.js → DebugSettingsModal-BSafp4hB.js} +9 -9
- package/dist/DebugSettingsModal-BSafp4hB.js.map +1 -0
- package/dist/{DeleteDriveModal-Dug84t1j.js → DeleteDriveModal-1pAIayG_.js} +7 -7
- package/dist/DeleteDriveModal-1pAIayG_.js.map +1 -0
- package/dist/{DeleteItemModal-mMzy3V8o.js → DeleteItemModal-BUpqmFxS.js} +8 -8
- package/dist/DeleteItemModal-BUpqmFxS.js.map +1 -0
- package/dist/{DisclaimerModal-DvpD5dPM.js → DisclaimerModal-TIJXRYLF.js} +7 -7
- package/dist/DisclaimerModal-TIJXRYLF.js.map +1 -0
- package/dist/{DocumentVersionUnsupportedModal-C3Q0V75l.js → DocumentVersionUnsupportedModal-DH9Zzsyw.js} +6 -6
- package/dist/DocumentVersionUnsupportedModal-DH9Zzsyw.js.map +1 -0
- package/dist/{DownloadDocumentWithErrorsModal-IKl0ljQb.js → DownloadDocumentWithErrorsModal-Beh-xw8B.js} +8 -7
- package/dist/DownloadDocumentWithErrorsModal-Beh-xw8B.js.map +1 -0
- package/dist/{DriveAuthRequiredModal-DVK7ZQzO.js → DriveAuthRequiredModal-XTcoJKvj.js} +7 -7
- package/dist/DriveAuthRequiredModal-XTcoJKvj.js.map +1 -0
- package/dist/{DriveSettingsModal-C6-mRQiv.js → DriveSettingsModal-DZKawN7w.js} +6 -6
- package/dist/DriveSettingsModal-DZKawN7w.js.map +1 -0
- package/dist/FloatingTanStackRouterDevtools-CqogiFob-dxj8lrTP.js +2565 -0
- package/dist/FloatingTanStackRouterDevtools-CqogiFob-dxj8lrTP.js.map +1 -0
- package/dist/{InspectorModal-CpEhVnM6.js → InspectorModal-BEil2KCK.js} +70 -30
- package/dist/InspectorModal-BEil2KCK.js.map +1 -0
- package/dist/{LoginModal-CybbOm3N.js → LoginModal-O06ZvWFI.js} +8 -8
- package/dist/LoginModal-O06ZvWFI.js.map +1 -0
- package/dist/{OpenFileDocumentsModal-BW3ZFRDR.js → OpenFileDocumentsModal-DJsC1oR1.js} +22 -16
- package/dist/OpenFileDocumentsModal-DJsC1oR1.js.map +1 -0
- package/dist/{UpgradeDriveModal-_8t9slxQ.js → UpgradeDriveModal-CCWKp5yn.js} +7 -7
- package/dist/UpgradeDriveModal-CCWKp5yn.js.map +1 -0
- package/dist/app-loader-C1jLx7Yk.js +4 -0
- package/dist/app-loader-i_orb0RX.js +1254 -0
- package/dist/app-loader-i_orb0RX.js.map +1 -0
- package/dist/app-skeleton-CMUP2zaz.js +132 -0
- package/dist/app-skeleton-CMUP2zaz.js.map +1 -0
- package/dist/app-skeleton-CdD1m8G3.js +4 -0
- package/dist/boot-66bf7yVc.js +233 -0
- package/dist/boot-66bf7yVc.js.map +1 -0
- package/dist/buffer-DNTcuap_.js +66 -0
- package/dist/buffer-DNTcuap_.js.map +1 -0
- package/dist/{build-info-D1h45Bga.js → build-info-Dg9V2Zes.js} +10 -6
- package/dist/build-info-Dg9V2Zes.js.map +1 -0
- package/dist/components-C5X9jfPL.js +121 -0
- package/dist/components-C5X9jfPL.js.map +1 -0
- package/dist/{connect.config-DaHDEUrw.js → connect.config-DL9nKtlW.js} +28 -15
- package/dist/connect.config-DL9nKtlW.js.map +1 -0
- package/dist/{connection-state-3w4liC1X.js → connection-state-Bwm9Agwy.js} +20 -9
- package/dist/connection-state-Bwm9Agwy.js.map +1 -0
- package/dist/context-De2EB1AA-Ni0d829Q.js +1759 -0
- package/dist/context-De2EB1AA-Ni0d829Q.js.map +1 -0
- package/dist/{cookie-banner-BH6bIq24.js → cookie-banner-NclLYtB0.js} +7 -7
- package/dist/{cookie-banner-BH6bIq24.js.map → cookie-banner-NclLYtB0.js.map} +1 -1
- package/dist/document-editor-container-CGLXOl0t.js +4 -0
- package/dist/document-editor-container-FNIEsf8H.js +310 -0
- package/dist/document-editor-container-FNIEsf8H.js.map +1 -0
- package/dist/drive-icon-BIpd8edR.js +49 -0
- package/dist/drive-icon-BIpd8edR.js.map +1 -0
- package/dist/error-boundary-BsUBww61.js +155 -0
- package/dist/error-boundary-BsUBww61.js.map +1 -0
- package/dist/esm-BDACZntJ.js +148 -0
- package/dist/esm-BDACZntJ.js.map +1 -0
- package/dist/generic.d.ts +140 -0
- package/dist/generic.d.ts.map +1 -0
- package/dist/generic.js +31 -0
- package/dist/generic.js.map +1 -0
- package/dist/{i18n-CWO0vYVd.js → i18n-D9WYPgk9.js} +4 -4
- package/dist/{i18n-CWO0vYVd.js.map → i18n-D9WYPgk9.js.map} +1 -1
- package/dist/index-D7c2WAbn.d.ts +4 -0
- package/dist/layout-Dj3_KscE.js +5 -0
- package/dist/layout.d.ts +3 -0
- package/dist/layout.js +4 -0
- package/dist/{load-B0xIT-MF.js → load-jNCWf-Tp.js} +48 -46
- package/dist/load-jNCWf-Tp.js.map +1 -0
- package/dist/load-runtime-config-BAaAgQg0.js +14 -0
- package/dist/load-runtime-config-BAaAgQg0.js.map +1 -0
- package/dist/main.d.ts +2 -1
- package/dist/main.js +8 -8
- package/dist/main.js.map +1 -1
- package/dist/open-file-uploads-B5pr1sA2.js +183 -0
- package/dist/open-file-uploads-B5pr1sA2.js.map +1 -0
- package/dist/package-manager-B-bEk-5n.js +543 -0
- package/dist/package-manager-B-bEk-5n.js.map +1 -0
- package/dist/{pglite-major-B39aOEiE.js → pglite-major-p4_YefAE.js} +23 -5
- package/dist/pglite-major-p4_YefAE.js.map +1 -0
- package/dist/{pglite-migrate-core-Boxqqx-c.js → pglite-migrate-core-DBlU6HIc.js} +9 -7
- package/dist/pglite-migrate-core-DBlU6HIc.js.map +1 -0
- package/dist/{pglite-seed-BqAUvNFw.js → pglite-seed-QPbGbLB_.js} +4 -4
- package/dist/{pglite-seed-BqAUvNFw.js.map → pglite-seed-QPbGbLB_.js.map} +1 -1
- package/dist/pglite.worker.d.ts +2 -1
- package/dist/pglite.worker.js +4 -3
- package/dist/pglite.worker.js.map +1 -1
- package/dist/pglite.worker.legacy.d.ts +2 -1
- package/dist/pglite.worker.legacy.js +4 -3
- package/dist/pglite.worker.legacy.js.map +1 -1
- package/dist/plugin-configs.d.ts +242 -0
- package/dist/plugin-configs.d.ts.map +1 -0
- package/dist/plugin-configs.js +26 -0
- package/dist/plugin-configs.js.map +1 -0
- package/dist/plugins-CPd2_0eG.js +264 -0
- package/dist/plugins-CPd2_0eG.js.map +1 -0
- package/dist/{preferences-store-_5Cw4_YV.js → preferences-store-DxYAnGCc.js} +6 -25
- package/dist/preferences-store-DxYAnGCc.js.map +1 -0
- package/dist/prerender.d.ts +38 -0
- package/dist/prerender.d.ts.map +1 -0
- package/dist/prerender.js +195 -0
- package/dist/prerender.js.map +1 -0
- package/dist/prerendered-shell-peKE7AqI.js +51 -0
- package/dist/prerendered-shell-peKE7AqI.js.map +1 -0
- package/dist/{pwa-manifest-link-DIgOSo2Q.js → pwa-manifest-link-DQRJpF0r.js} +3 -3
- package/dist/{pwa-manifest-link-DIgOSo2Q.js.map → pwa-manifest-link-DQRJpF0r.js.map} +1 -1
- package/dist/{reactor-B6xhZK1N.js → reactor-BEYvZrpZ.js} +565 -567
- package/dist/reactor-BEYvZrpZ.js.map +1 -0
- package/dist/reactor-chat-BwR9R1ah.js +46 -0
- package/dist/reactor-chat-BwR9R1ah.js.map +1 -0
- package/dist/reactor.worker.d.ts +2 -1
- package/dist/reactor.worker.js +478 -158
- package/dist/reactor.worker.js.map +1 -1
- package/dist/{registerServiceWorker-BSzbNfvz.js → registerServiceWorker-X6fT91iL.js} +5 -5
- package/dist/{registerServiceWorker-BSzbNfvz.js.map → registerServiceWorker-X6fT91iL.js.map} +1 -1
- package/dist/root-v9fj27sn.js +27 -0
- package/dist/root-v9fj27sn.js.map +1 -0
- package/dist/route-tree.d.ts +2220 -0
- package/dist/route-tree.d.ts.map +1 -0
- package/dist/route-tree.js +135 -0
- package/dist/route-tree.js.map +1 -0
- package/dist/route-views-BovMNHyn.js +60 -0
- package/dist/route-views-BovMNHyn.js.map +1 -0
- package/dist/route-views-C-H3ofJW.js +4 -0
- package/dist/route-views-DzgRMAx8.js +55 -0
- package/dist/route-views-DzgRMAx8.js.map +1 -0
- package/dist/route-views.d.ts +7 -0
- package/dist/route-views.d.ts.map +1 -0
- package/dist/route-views.js +4 -0
- package/dist/router-CWIsjETx.js +54 -0
- package/dist/router-CWIsjETx.js.map +1 -0
- package/dist/router-CnWkTEey.js +4 -0
- package/dist/router.d.ts +2 -0
- package/dist/router.js +3 -0
- package/dist/sentry-Cuc_Nbba.js +22 -0
- package/dist/sentry-Cuc_Nbba.js.map +1 -0
- package/dist/settings-KlgfolUd.js +1089 -0
- package/dist/settings-KlgfolUd.js.map +1 -0
- package/dist/settings-tabs-CJ40jEPe.js +424 -0
- package/dist/settings-tabs-CJ40jEPe.js.map +1 -0
- package/dist/shell-core-head.html +2 -0
- package/dist/shell-core.html +1 -0
- package/dist/shell-head.html +2 -0
- package/dist/shell-plugins.json +1 -0
- package/dist/shell.html +1 -0
- package/dist/start-connect.d.ts +7 -9
- package/dist/start-connect.d.ts.map +1 -1
- package/dist/start-connect.js +9 -8
- package/dist/start-connect.js.map +1 -1
- package/dist/store-lock-Bi3B9VJD.js +159 -0
- package/dist/store-lock-Bi3B9VJD.js.map +1 -0
- package/dist/style.css +3340 -755
- package/dist/{toast-BXIGd4Eb.js → toast-C6WW-_O-.js} +3 -3
- package/dist/{toast-BXIGd4Eb.js.map → toast-C6WW-_O-.js.map} +1 -1
- package/dist/ui-C1-l-Eyh.js +170 -0
- package/dist/ui-C1-l-Eyh.js.map +1 -0
- package/dist/ui-DFO6kV2V.js +66 -0
- package/dist/ui-DFO6kV2V.js.map +1 -0
- package/dist/{use-renown-login-Cf3va6u_.js → use-renown-login-dPpDOYq5.js} +4 -4
- package/dist/use-renown-login-dPpDOYq5.js.map +1 -0
- package/dist/workflows-C3qEvx1R.js +63 -0
- package/dist/workflows-C3qEvx1R.js.map +1 -0
- package/fonts.css +177 -0
- package/generic-routes.json +9 -0
- package/package.json +87 -26
- package/scripts/assert-plugin-configs.mjs +47 -0
- package/scripts/prerender-shell.ts +51 -0
- package/skills/customize-connect/SKILL.md +80 -0
- package/skills/customize-connect/references/data-and-navigation.md +315 -0
- package/skills/customize-connect/references/drive-apps.md +44 -0
- package/skills/customize-connect/references/hosts-and-plugins.md +88 -0
- package/skills/customize-connect/references/layout.md +162 -0
- package/skills/customize-connect/references/modals.md +99 -0
- package/skills/customize-connect/references/overrides.md +177 -0
- package/skills/customize-connect/references/packages.md +41 -0
- package/skills/customize-connect/references/pages.md +141 -0
- package/skills/customize-connect/references/runtime-config.md +403 -0
- package/skills/customize-connect/references/styles-and-branding.md +76 -0
- package/skills/customize-connect/references/types-and-troubleshooting.md +64 -0
- package/src/route-tree.ts +3 -0
- package/src/routeTree.gen.ts +235 -0
- package/src/router/index.ts +2 -0
- package/src/router/register.ts +9 -0
- package/src/routes/__root.tsx +12 -0
- package/src/routes/_app/$.tsx +13 -0
- package/src/routes/_app/d/$driveSlug/{-$nodeSlug}.tsx +13 -0
- package/src/routes/_app/d/$driveSlug.tsx +13 -0
- package/src/routes/_app/index.tsx +13 -0
- package/src/routes/_app/settings/appearance.tsx +13 -0
- package/src/routes/_app/settings/packages.tsx +13 -0
- package/src/routes/_app/settings.tsx +13 -0
- package/src/routes/_app.tsx +13 -0
- package/style.css +8 -23
- package/tailwind.css +12 -0
- package/theme.css +5 -0
- package/dist/AddDriveModal-xAw48kdl.js.map +0 -1
- package/dist/ClearStorageModal-BAqs4G2s.js.map +0 -1
- package/dist/ConfirmDocumentUpgradeModal-FUOhZsk7.js.map +0 -1
- package/dist/CreateDocumentModal-C45W8J0V.js +0 -35
- package/dist/CreateDocumentModal-C45W8J0V.js.map +0 -1
- package/dist/DebugSettingsModal-rV_v0F0d.js.map +0 -1
- package/dist/DeleteDriveModal-Dug84t1j.js.map +0 -1
- package/dist/DeleteItemModal-mMzy3V8o.js.map +0 -1
- package/dist/DisclaimerModal-DvpD5dPM.js.map +0 -1
- package/dist/DocumentVersionUnsupportedModal-C3Q0V75l.js.map +0 -1
- package/dist/DownloadDocumentWithErrorsModal-IKl0ljQb.js.map +0 -1
- package/dist/DriveAuthRequiredModal-DVK7ZQzO.js.map +0 -1
- package/dist/DriveSettingsModal-C6-mRQiv.js.map +0 -1
- package/dist/InspectorModal-CpEhVnM6.js.map +0 -1
- package/dist/LoginModal-CybbOm3N.js.map +0 -1
- package/dist/MissingPackageModal-nBnExqO0.js +0 -49
- package/dist/MissingPackageModal-nBnExqO0.js.map +0 -1
- package/dist/OpenFileDocumentsModal-BW3ZFRDR.js.map +0 -1
- package/dist/SettingsModal-DlxUZEQ4.js +0 -569
- package/dist/SettingsModal-DlxUZEQ4.js.map +0 -1
- package/dist/UpgradeDriveModal-_8t9slxQ.js.map +0 -1
- package/dist/app-loader-D4tbk4ev.js +0 -4
- package/dist/app-loader-Dz_X0r7a.js +0 -2244
- package/dist/app-loader-Dz_X0r7a.js.map +0 -1
- package/dist/build-info-D1h45Bga.js.map +0 -1
- package/dist/components-Bmn9nGdQ.js +0 -4
- package/dist/connect.config-DaHDEUrw.js.map +0 -1
- package/dist/connection-state-3w4liC1X.js.map +0 -1
- package/dist/load-B0xIT-MF.js.map +0 -1
- package/dist/pglite-major-B39aOEiE.js.map +0 -1
- package/dist/pglite-migrate-core-Boxqqx-c.js.map +0 -1
- package/dist/preferences-store-_5Cw4_YV.js.map +0 -1
- package/dist/reactor-B6xhZK1N.js.map +0 -1
- package/dist/runtime-config-DL3QjcfM.js +0 -24
- package/dist/runtime-config-DL3QjcfM.js.map +0 -1
- package/dist/sentry-QXKgQmr2.js +0 -15
- package/dist/sentry-QXKgQmr2.js.map +0 -1
- package/dist/use-renown-login-Cf3va6u_.js.map +0 -1
- package/dist/useRegistryPackages-BnUcL_nZ.js +0 -390
- package/dist/useRegistryPackages-BnUcL_nZ.js.map +0 -1
package/dist/generic.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="a22e7ee3-a1b4-5773-abee-29f7a20f6fb3")}catch(e){}}();
|
|
3
|
+
import { a as useDriveRouteData, i as useConnectChrome, n as ModalDialog, o as useNavRoutes, r as SidebarItem, s as useSidebarMode, t as ContentOutlet } from "./layout-Dj3_KscE.js";
|
|
4
|
+
import { r as ErrorBoundary } from "./error-boundary-BsUBww61.js";
|
|
5
|
+
import { _ as SidebarNavItems, a as settingsTab, c as Home, d as NodeView, f as DrivePending, g as SidebarDriveItems, h as Sidebar, i as aiAssistantEnabled, l as HomeAddDriveItem, m as AppLayout, o as ConnectHomeScreen, r as SettingsPage, s as DriveLayout, t as genericSettingsTabs, u as HomeDriveItem, v as useVisibleDrives } from "./settings-tabs-CJ40jEPe.js";
|
|
6
|
+
import { n as EditorLoader } from "./document-editor-container-FNIEsf8H.js";
|
|
7
|
+
import { Suspense, lazy } from "react";
|
|
8
|
+
import { jsx } from "react/jsx-runtime";
|
|
9
|
+
import { useDriveRouteData as useDriveRouteData$1 } from "@powerhousedao/connect-core/router";
|
|
10
|
+
//#region src/generic/editors/open-document.tsx
|
|
11
|
+
const DocumentEditorContainer = lazy(() => import("./document-editor-container-CGLXOl0t.js").then((module) => ({ default: module.DocumentEditorContainer })));
|
|
12
|
+
/** The route's open document's editor, e.g. in a project's drive route
|
|
13
|
+
* override; nothing while no document is open. */
|
|
14
|
+
function OpenDocument() {
|
|
15
|
+
const { documentId } = useDriveRouteData$1();
|
|
16
|
+
if (!documentId) return null;
|
|
17
|
+
return /* @__PURE__ */ jsx(ErrorBoundary, {
|
|
18
|
+
variant: "detailed",
|
|
19
|
+
resetKeys: [documentId],
|
|
20
|
+
loggerContext: ["Connect", "OpenDocument"],
|
|
21
|
+
children: /* @__PURE__ */ jsx(Suspense, {
|
|
22
|
+
fallback: /* @__PURE__ */ jsx(EditorLoader, {}),
|
|
23
|
+
children: /* @__PURE__ */ jsx(DocumentEditorContainer, { documentId })
|
|
24
|
+
})
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
//#endregion
|
|
28
|
+
export { AppLayout, ConnectHomeScreen, Sidebar as ConnectSidebar, ContentOutlet, DriveLayout, DrivePending, Home, HomeAddDriveItem, HomeDriveItem, ModalDialog, NodeView, OpenDocument, SettingsPage, SidebarDriveItems, SidebarItem, SidebarNavItems, aiAssistantEnabled, genericSettingsTabs, settingsTab, useConnectChrome, useDriveRouteData, useNavRoutes, useSidebarMode, useVisibleDrives };
|
|
29
|
+
|
|
30
|
+
//# sourceMappingURL=generic.js.map
|
|
31
|
+
//# debugId=a22e7ee3-a1b4-5773-abee-29f7a20f6fb3
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generic.js","sources":["../src/generic/editors/open-document.tsx"],"sourcesContent":["import { useDriveRouteData } from \"@powerhousedao/connect-core/router\";\nimport { lazy, Suspense } from \"react\";\nimport { EditorLoader } from \"./editor-loader.js\";\nimport { ErrorBoundary } from \"@powerhousedao/connect/components/shared\";\n\nconst DocumentEditorContainer = lazy(() =>\n import(\"./document-editor-container.js\").then((module) => ({\n default: module.DocumentEditorContainer,\n })),\n);\n\n/** The route's open document's editor, e.g. in a project's drive route\n * override; nothing while no document is open. */\nexport function OpenDocument() {\n const { documentId } = useDriveRouteData();\n if (!documentId) return null;\n return (\n <ErrorBoundary\n variant=\"detailed\"\n resetKeys={[documentId]}\n loggerContext={[\"Connect\", \"OpenDocument\"]}\n >\n <Suspense fallback={<EditorLoader />}>\n <DocumentEditorContainer documentId={documentId} />\n </Suspense>\n </ErrorBoundary>\n );\n}\n"],"names":["useDriveRouteData"],"mappings":";;;;;;;;;;AAKA,MAAM,0BAA0B,WAC9B,OAAO,0CAAiC,CAAC,MAAM,YAAY,EACzD,SAAS,OAAO,wBAClB,EAAE,CACJ;;;AAIA,SAAgB,eAAe;CAC7B,MAAM,EAAE,eAAeA,oBAAkB;CACzC,IAAI,CAAC,YAAY,OAAO;CACxB,OACE,oBAAC,eAAD;EACE,SAAQ;EACR,WAAW,CAAC,UAAU;EACtB,eAAe,CAAC,WAAW,cAAc;EAEzC,UAAA,oBAAC,UAAD;GAAU,UAAU,oBAAC,cAAD,CAAe,CAAA;GACjC,UAAA,oBAAC,yBAAD,EAAqC,WAAa,CAAA;EAC1C,CAAA;CACG,CAAA;AAEnB","debug_id":"a22e7ee3-a1b4-5773-abee-29f7a20f6fb3"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
3
|
-
import i18n from "i18next";
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="f0b2e116-91b3-5b5d-95e7-2400fe83b7ae")}catch(e){}}();
|
|
4
3
|
import { initReactI18next } from "react-i18next";
|
|
4
|
+
import i18n from "i18next";
|
|
5
5
|
i18n.use(initReactI18next).init({
|
|
6
6
|
resources: { en: {
|
|
7
7
|
code: "en",
|
|
@@ -140,5 +140,5 @@ i18n.use(initReactI18next).init({
|
|
|
140
140
|
//#endregion
|
|
141
141
|
export { i18n as t };
|
|
142
142
|
|
|
143
|
-
//# sourceMappingURL=i18n-
|
|
144
|
-
//# debugId=
|
|
143
|
+
//# sourceMappingURL=i18n-D9WYPgk9.js.map
|
|
144
|
+
//# debugId=f0b2e116-91b3-5b5d-95e7-2400fe83b7ae
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i18n-
|
|
1
|
+
{"version":3,"file":"i18n-D9WYPgk9.js","sources":["../src/i18n/locales/en.json","../src/i18n/index.ts"],"sourcesContent":["","import type { Resource } from \"i18next\";\nimport i18n from \"i18next\";\nimport { initReactI18next } from \"react-i18next\";\n\nimport translationEN from \"./locales/en.json\" with { type: \"json\" };\n\nconst resources: Resource = {\n en: {\n code: \"en\",\n name: \"English\",\n translation: translationEN,\n },\n};\n\ni18n\n .use(initReactI18next)\n .init({\n resources,\n fallbackLng: \"en\",\n debug: false,\n interpolation: {\n escapeValue: false,\n },\n })\n .catch((e: unknown) => {\n console.error(e);\n });\n\nexport { i18n };\nexport default i18n;\n"],"names":["translationEN"],"mappings":";;;;ACcA,KACG,IAAI,gBAAgB,CAAC,CACrB,KAAK;CACJ,aAVF,IAAI;EACF,MAAM;EACN,MAAM;EACN,aAAaA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAAA;CACf,EAME;CACA,aAAa;CACb,OAAO;CACP,eAAe,EACb,aAAa,MACf;AACF,CAAC,CAAC,CACD,OAAO,MAAe;CACrB,QAAQ,MAAM,CAAC;AACjB,CAAC","debug_id":"f0b2e116-91b3-5b5d-95e7-2400fe83b7ae"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ConnectChrome, ContentOutlet as ContentOutlet$1, ModalDialog, ModalFrameProps, useConnectChrome as useConnectChrome$1, useDriveRouteData as useDriveRouteData$1, useNavRoutes as useNavRoutes$1, useSidebarMode } from "@powerhousedao/connect-core/router";
|
|
2
|
+
import { SidebarItem as SidebarItem$1 } from "@powerhousedao/design-system/connect";
|
|
3
|
+
export { SidebarItem$1 as a, useNavRoutes$1 as c, ModalFrameProps as i, useSidebarMode as l, ContentOutlet$1 as n, useConnectChrome$1 as o, ModalDialog as r, useDriveRouteData$1 as s, ConnectChrome as t };
|
|
4
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ContentOutlet as ContentOutlet$1, ModalDialog, useConnectChrome as useConnectChrome$1, useDriveRouteData as useDriveRouteData$1, useNavRoutes as useNavRoutes$1, useSidebarMode } from "@powerhousedao/connect-core/router";
|
|
2
|
+
import { SidebarItem as SidebarItem$1 } from "@powerhousedao/design-system/connect";
|
|
3
|
+
export { useDriveRouteData$1 as a, useConnectChrome$1 as i, ModalDialog as n, useNavRoutes$1 as o, SidebarItem$1 as r, useSidebarMode as s, ContentOutlet$1 as t };
|
|
4
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="f1bd78ef-ea93-5f11-a8c5-0242044e36ec")}catch(e){}}();
|
|
5
|
+
//# debugId=f1bd78ef-ea93-5f11-a8c5-0242044e36ec
|
package/dist/layout.d.ts
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { a as SidebarItem, c as useNavRoutes, i as ModalFrameProps, l as useSidebarMode, n as ContentOutlet, o as useConnectChrome, r as ModalDialog, s as useDriveRouteData, t as ConnectChrome } from "./index-D7c2WAbn.js";
|
|
2
|
+
export { type ConnectChrome, ContentOutlet, ModalDialog, type ModalFrameProps, SidebarItem, useConnectChrome, useDriveRouteData, useNavRoutes, useSidebarMode };
|
|
3
|
+
export {};
|
package/dist/layout.js
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { a as useDriveRouteData, i as useConnectChrome, n as ModalDialog, o as useNavRoutes, r as SidebarItem, s as useSidebarMode, t as ContentOutlet } from "./layout-Dj3_KscE.js";
|
|
2
|
+
export { ContentOutlet, ModalDialog, SidebarItem, useConnectChrome, useDriveRouteData, useNavRoutes, useSidebarMode };
|
|
3
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="d8c2bee4-909a-5cec-b0ec-0ebf05616aa7")}catch(e){}}();
|
|
4
|
+
//# debugId=d8c2bee4-909a-5cec-b0ec-0ebf05616aa7
|
|
@@ -1,15 +1,50 @@
|
|
|
1
1
|
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import { n as
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="cadb8785-a0c8-50e5-9fac-4962aa239e7c")}catch(e){}}();
|
|
3
|
+
import { t as loadRuntimeConfig } from "./load-runtime-config-BAaAgQg0.js";
|
|
4
|
+
import { r as connectConfig } from "./connect.config-DL9nKtlW.js";
|
|
5
|
+
import { t as getBuildHash } from "./build-info-Dg9V2Zes.js";
|
|
6
|
+
import { r as setUser } from "./sentry-Cuc_Nbba.js";
|
|
7
|
+
import "./i18n-D9WYPgk9.js";
|
|
8
|
+
import { a as detectMigrationMajor, o as detectReactorPgMajor } from "./connection-state-Bwm9Agwy.js";
|
|
9
|
+
import { n as seedPendingPgVersion } from "./pglite-seed-QPbGbLB_.js";
|
|
10
|
+
import { n as createReactor } from "./reactor-BEYvZrpZ.js";
|
|
10
11
|
import { useEffect } from "react";
|
|
11
12
|
import { initTheme, useUser } from "@powerhousedao/reactor-browser";
|
|
12
13
|
import { logger } from "document-model";
|
|
14
|
+
window.navigator.appVersion.includes("Mac");
|
|
15
|
+
/**
|
|
16
|
+
* Same-origin build-identity probe. The build bakes a hash of the inputs that
|
|
17
|
+
* determine the deployed content into the bundle (define
|
|
18
|
+
* `PH_CONNECT_BUILD_HASH`, see builder-tools' connectBuildHashPlugin) and
|
|
19
|
+
* emits `build-hash.json` next to the app (served no-cache). Comparing the
|
|
20
|
+
* two tells us whether the server is serving a different build than the one
|
|
21
|
+
* this page was loaded from — the reliable "a new deploy went out" signal.
|
|
22
|
+
* Unlike the old GitHub-raw version check it works on localhost (it compares
|
|
23
|
+
* against what the origin actually serves, not a remote branch head) and
|
|
24
|
+
* needs no network beyond the app's own origin.
|
|
25
|
+
*
|
|
26
|
+
* Returns null when there is nothing to compare: dev/studio builds (no hash
|
|
27
|
+
* baked), a server predating `build-hash.json`, an offline fetch, or a
|
|
28
|
+
* malformed body.
|
|
29
|
+
*/
|
|
30
|
+
const getBuildHashStatus = async () => {
|
|
31
|
+
const currentHash = getBuildHash();
|
|
32
|
+
if (!currentHash || currentHash === "unknown") return null;
|
|
33
|
+
try {
|
|
34
|
+
const result = await fetch(`${import.meta.env.BASE_URL}build-hash.json`, { cache: "no-cache" });
|
|
35
|
+
if (!result.ok) return null;
|
|
36
|
+
const data = await result.json();
|
|
37
|
+
if (typeof data.hash !== "string" || !data.hash) return null;
|
|
38
|
+
return {
|
|
39
|
+
currentHash,
|
|
40
|
+
deployedHash: data.hash,
|
|
41
|
+
isCurrent: data.hash === currentHash
|
|
42
|
+
};
|
|
43
|
+
} catch {
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
//#endregion
|
|
13
48
|
//#region src/hooks/useCheckLatestVersion.ts
|
|
14
49
|
const RELOADED_FOR_KEY = "ph-reloaded-for-build-hash";
|
|
15
50
|
/**
|
|
@@ -60,39 +95,6 @@ const useCheckLatestVersion = () => {
|
|
|
60
95
|
};
|
|
61
96
|
}, []);
|
|
62
97
|
};
|
|
63
|
-
window.navigator.appVersion.includes("Mac");
|
|
64
|
-
/**
|
|
65
|
-
* Same-origin build-identity probe. The build bakes a hash of the inputs that
|
|
66
|
-
* determine the deployed content into the bundle (define
|
|
67
|
-
* `PH_CONNECT_BUILD_HASH`, see builder-tools' connectBuildHashPlugin) and
|
|
68
|
-
* emits `build-hash.json` next to the app (served no-cache). Comparing the
|
|
69
|
-
* two tells us whether the server is serving a different build than the one
|
|
70
|
-
* this page was loaded from — the reliable "a new deploy went out" signal.
|
|
71
|
-
* Unlike the old GitHub-raw version check it works on localhost (it compares
|
|
72
|
-
* against what the origin actually serves, not a remote branch head) and
|
|
73
|
-
* needs no network beyond the app's own origin.
|
|
74
|
-
*
|
|
75
|
-
* Returns null when there is nothing to compare: dev/studio builds (no hash
|
|
76
|
-
* baked), a server predating `build-hash.json`, an offline fetch, or a
|
|
77
|
-
* malformed body.
|
|
78
|
-
*/
|
|
79
|
-
const getBuildHashStatus = async () => {
|
|
80
|
-
const currentHash = getBuildHash();
|
|
81
|
-
if (!currentHash || currentHash === "unknown") return null;
|
|
82
|
-
try {
|
|
83
|
-
const result = await fetch(`${import.meta.env.BASE_URL}build-hash.json`, { cache: "no-cache" });
|
|
84
|
-
if (!result.ok) return null;
|
|
85
|
-
const data = await result.json();
|
|
86
|
-
if (typeof data.hash !== "string" || !data.hash) return null;
|
|
87
|
-
return {
|
|
88
|
-
currentHash,
|
|
89
|
-
deployedHash: data.hash,
|
|
90
|
-
isCurrent: data.hash === currentHash
|
|
91
|
-
};
|
|
92
|
-
} catch {
|
|
93
|
-
return null;
|
|
94
|
-
}
|
|
95
|
-
};
|
|
96
98
|
//#endregion
|
|
97
99
|
//#region src/store/user.ts
|
|
98
100
|
function useSetSentryUser() {
|
|
@@ -112,11 +114,11 @@ function useSetSentryUser() {
|
|
|
112
114
|
}
|
|
113
115
|
//#endregion
|
|
114
116
|
//#region src/components/load.tsx
|
|
115
|
-
async function loadComponent(localPackage) {
|
|
117
|
+
async function loadComponent(localPackage, store) {
|
|
116
118
|
await seedPendingPgVersion();
|
|
117
119
|
await Promise.all([detectReactorPgMajor(), detectMigrationMajor()]);
|
|
118
|
-
|
|
119
|
-
await createReactor(localPackage);
|
|
120
|
+
await loadRuntimeConfig();
|
|
121
|
+
await createReactor(await localPackage, store);
|
|
120
122
|
return { default: ({ children }) => {
|
|
121
123
|
initTheme();
|
|
122
124
|
useSetSentryUser();
|
|
@@ -127,5 +129,5 @@ async function loadComponent(localPackage) {
|
|
|
127
129
|
//#endregion
|
|
128
130
|
export { loadComponent };
|
|
129
131
|
|
|
130
|
-
//# sourceMappingURL=load-
|
|
131
|
-
//# debugId=
|
|
132
|
+
//# sourceMappingURL=load-jNCWf-Tp.js.map
|
|
133
|
+
//# debugId=cadb8785-a0c8-50e5-9fac-4962aa239e7c
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"load-jNCWf-Tp.js","sources":["../src/hooks/utils.ts","../src/hooks/useCheckLatestVersion.ts","../src/store/user.ts","../src/components/load.tsx"],"sourcesContent":["import { getBuildHash } from \"../utils/build-info.js\";\n\nexport const isMac = window.navigator.appVersion.includes(\"Mac\");\n\nexport interface BuildHashStatus {\n /** Hash baked into the running build. */\n currentHash: string;\n /** Hash the server is currently serving. */\n deployedHash: string;\n /** true when the running build matches what the server serves. */\n isCurrent: boolean;\n}\n\n/**\n * Same-origin build-identity probe. The build bakes a hash of the inputs that\n * determine the deployed content into the bundle (define\n * `PH_CONNECT_BUILD_HASH`, see builder-tools' connectBuildHashPlugin) and\n * emits `build-hash.json` next to the app (served no-cache). Comparing the\n * two tells us whether the server is serving a different build than the one\n * this page was loaded from — the reliable \"a new deploy went out\" signal.\n * Unlike the old GitHub-raw version check it works on localhost (it compares\n * against what the origin actually serves, not a remote branch head) and\n * needs no network beyond the app's own origin.\n *\n * Returns null when there is nothing to compare: dev/studio builds (no hash\n * baked), a server predating `build-hash.json`, an offline fetch, or a\n * malformed body.\n */\nexport const getBuildHashStatus = async (): Promise<BuildHashStatus | null> => {\n const currentHash = getBuildHash();\n if (!currentHash || currentHash === \"unknown\") return null;\n try {\n const result = await fetch(`${import.meta.env.BASE_URL}build-hash.json`, {\n cache: \"no-cache\",\n });\n if (!result.ok) return null;\n const data = (await result.json()) as { hash?: unknown };\n if (typeof data.hash !== \"string\" || !data.hash) return null;\n return {\n currentHash,\n deployedHash: data.hash,\n isCurrent: data.hash === currentHash,\n };\n } catch {\n return null;\n }\n};\n","import { connectConfig } from \"@powerhousedao/connect/config\";\nimport { getBuildHashStatus } from \"./utils.js\";\nimport { logger } from \"document-model\";\nimport { useEffect } from \"react\";\n\n// Session-scoped guard: records the deployed hash this tab already reloaded\n// for, so a broken or rolling deploy (server hash keeps changing under us)\n// cannot turn the tab into a reload loop. Cleared implicitly with the tab.\nconst RELOADED_FOR_KEY = \"ph-reloaded-for-build-hash\";\n\n/**\n * Drop the service worker's stale caches (precache + the NetworkFirst shell\n * cache) before reloading onto a new deploy, so the post-reload navigation\n * is answered from the network / fresh build instead of leftovers of the\n * build we are leaving. Best-effort: if the Caches API is unavailable or a\n * delete fails, the reload still picks up the new shell (the navigation\n * route is NetworkFirst).\n */\nasync function clearStaleCaches(): Promise<void> {\n try {\n if (!(\"caches\" in window)) return;\n const keys = await window.caches.keys();\n await Promise.all(\n keys\n .filter((key) => key.includes(\"precache\") || key.includes(\"ph-shell\"))\n .map((key) => window.caches.delete(key)),\n );\n } catch (error) {\n logger.warn(\n \"Failed to clear stale caches before update reload @error\",\n error,\n );\n }\n}\n\n/**\n * Detects that the server is serving a different build than the one this\n * page was loaded from (a new deploy) and reloads onto it — once per session\n * per deployed hash. Checked on mount and whenever the tab returns to the\n * foreground, so a deploy that lands while the tab sits open is picked up on\n * the next focus without a manual reload. The in-tab \"new version available\"\n * service-worker prompt (ServiceWorkerUpdatePrompt) remains the opt-in path\n * for workers that are waiting but not yet controlling.\n */\nexport const useCheckLatestVersion = () => {\n useEffect(() => {\n if (\n import.meta.env.MODE === \"development\" ||\n connectConfig.studioMode ||\n !connectConfig.warnOutdatedApp\n ) {\n return;\n }\n\n const checkBuildHash = async () => {\n const status = await getBuildHashStatus();\n if (!status || status.isCurrent) return;\n\n const reloadedFor = window.sessionStorage.getItem(RELOADED_FOR_KEY);\n if (reloadedFor === status.deployedHash) return;\n window.sessionStorage.setItem(RELOADED_FOR_KEY, status.deployedHash);\n\n logger.info(\n \"New deploy detected — reloading from build @currentHash to @deployedHash\",\n status.currentHash,\n status.deployedHash,\n );\n await clearStaleCaches();\n window.location.reload();\n };\n\n void checkBuildHash();\n const onVisibilityChange = () => {\n if (document.visibilityState === \"visible\") void checkBuildHash();\n };\n document.addEventListener(\"visibilitychange\", onVisibilityChange);\n return () => {\n document.removeEventListener(\"visibilitychange\", onVisibilityChange);\n };\n }, []);\n};\n","import { useUser } from \"@powerhousedao/reactor-browser\";\nimport type { User as SentryUser } from \"@sentry/react\";\nimport { useEffect } from \"react\";\nimport { setUser as setSentryUser } from \"../services/sentry.js\";\n\nexport function useSetSentryUser() {\n const user = useUser();\n useEffect(() => {\n let sentryUser: SentryUser | null = null;\n if (user) {\n // saves the user info except the credential\n const { credential: _credential, ...rest } = user;\n sentryUser = { id: rest.did, username: rest.ens?.name, ...rest };\n }\n setSentryUser(sentryUser);\n }, [user]);\n}\n","import { useCheckLatestVersion } from \"@powerhousedao/connect/hooks\";\nimport \"@powerhousedao/connect/i18n\";\nimport { createReactor, useSetSentryUser } from \"@powerhousedao/connect/store\";\nimport {\n detectMigrationMajor,\n detectReactorPgMajor,\n seedPendingPgVersion,\n} from \"@powerhousedao/connect/utils\";\nimport type { PHStore } from \"@powerhousedao/reactor-browser\";\nimport { initTheme } from \"@powerhousedao/reactor-browser\";\nimport type { DocumentModelLib } from \"document-model\";\nimport { type ReactNode } from \"react\";\nimport { loadRuntimeConfig } from \"../load-runtime-config.js\";\n\nexport async function loadComponent(\n localPackage: DocumentModelLib | Promise<DocumentModelLib> | undefined,\n store: PHStore,\n) {\n await seedPendingPgVersion();\n await Promise.all([detectReactorPgMajor(), detectMigrationMajor()]);\n await loadRuntimeConfig();\n await createReactor(await localPackage, store);\n return {\n default: ({ children }: { children?: ReactNode }) => {\n initTheme();\n // eslint-disable-next-line react-hooks/rules-of-hooks\n useSetSentryUser();\n // eslint-disable-next-line react-hooks/rules-of-hooks\n useCheckLatestVersion();\n return children;\n },\n };\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;AAEqB,OAAO,UAAU,WAAW,SAAS,KAAK;;;;;;;;;;;;;;;;AA0B/D,MAAa,qBAAqB,YAA6C;CAC7E,MAAM,cAAc,aAAa;CACjC,IAAI,CAAC,eAAe,gBAAgB,WAAW,OAAO;CACtD,IAAI;EACF,MAAM,SAAS,MAAM,MAAM,GAAG,YAAY,IAAI,SAAS,kBAAkB,EACvE,OAAO,WACT,CAAC;EACD,IAAI,CAAC,OAAO,IAAI,OAAO;EACvB,MAAM,OAAQ,M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MAAM,EAAE,YAAY,aAAa,GAAG,SAAS;GAC7C,aAAa;IAAE,IAAI,KAAK;IAAK,UAAU,KAAK,KAAK;IAAM,GAAG;GAAK;EACjE;EACA,QAAc,UAAU;CAC1B,GAAG,CAAC,IAAI,CAAC;AACX;;;ACFA,eAAsB,cACpB,cACA,OACA;CACA,MAAM,qBAAqB;CAC3B,MAAM,QAAQ,IAAI,CAAC,qBAAqB,GAAG,qBAAqB,CAAC,CAAC;CAClE,MAAM,kBAAkB;CACxB,MAAM,cAAc,MAAM,cAAc,KAAK;CAC7C,OAAO,EACL,UAAU,EAAE,eAAyC;EACnD,UAAU;EAEV,iBAAiB;EAEjB,sBAAsB;EACtB,OAAO;CACT,EACF;AACF","debug_id":"cadb8785-a0c8-50e5-9fac-4962aa239e7c"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="b3d6782c-a03b-5e19-85a9-274c97e442c4")}catch(e){}}();
|
|
3
|
+
import { loadRuntimeConfig } from "@powerhousedao/connect-core/runtime-config";
|
|
4
|
+
//#region src/load-runtime-config.ts
|
|
5
|
+
const connectPlugins = () => import("./plugins-CPd2_0eG.js").then((m) => m.connectPlugins);
|
|
6
|
+
/** Core's loader, with Connect's built-in plugins for the composition. */
|
|
7
|
+
function loadRuntimeConfig$1() {
|
|
8
|
+
return loadRuntimeConfig({ plugins: connectPlugins });
|
|
9
|
+
}
|
|
10
|
+
//#endregion
|
|
11
|
+
export { loadRuntimeConfig$1 as t };
|
|
12
|
+
|
|
13
|
+
//# sourceMappingURL=load-runtime-config-BAaAgQg0.js.map
|
|
14
|
+
//# debugId=b3d6782c-a03b-5e19-85a9-274c97e442c4
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"load-runtime-config-BAaAgQg0.js","sources":["../src/load-runtime-config.ts"],"sourcesContent":["import { loadRuntimeConfig as loadCoreRuntimeConfig } from \"@powerhousedao/connect-core/runtime-config\";\n\n// The built-ins: a declared composition's transform the config, and the active\n// ones' UI loads (every one's without a composition).\nconst connectPlugins = () =>\n import(\"./plugins/index.js\").then((m) => m.connectPlugins);\n\n/** Core's loader, with Connect's built-in plugins for the composition. */\nexport function loadRuntimeConfig() {\n return loadCoreRuntimeConfig({ plugins: connectPlugins });\n}\n"],"names":["loadRuntimeConfig","loadCoreRuntimeConfig"],"mappings":";;;;AAIA,MAAM,uBACJ,OAAO,wBAAqB,CAAC,MAAM,MAAM,EAAE,cAAc;;AAG3D,SAAgBA,sBAAoB;CAClC,OAAOC,kBAAsB,EAAE,SAAS,eAAe,CAAC;AAC1D","debug_id":"b3d6782c-a03b-5e19-85a9-274c97e442c4"}
|
package/dist/main.d.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export {}
|
|
2
|
+
export {};
|
package/dist/main.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
3
|
-
import {
|
|
4
|
-
import { createRoot } from "react-dom/client";
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="1f52a123-ef3c-5452-bdfa-b05d09bb17c0")}catch(e){}}();
|
|
3
|
+
import { t as bootConnect } from "./boot-66bf7yVc.js";
|
|
5
4
|
import { jsx } from "react/jsx-runtime";
|
|
6
5
|
//#region main.tsx
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const { AppLoader } = await import("./app-loader-
|
|
10
|
-
|
|
6
|
+
const root = await bootConnect();
|
|
7
|
+
if (root) {
|
|
8
|
+
const { AppLoader } = await import("./app-loader-C1jLx7Yk.js");
|
|
9
|
+
root.render(/* @__PURE__ */ jsx(AppLoader, {}));
|
|
10
|
+
}
|
|
11
11
|
//#endregion
|
|
12
12
|
|
|
13
13
|
//# sourceMappingURL=main.js.map
|
|
14
|
-
//# debugId=
|
|
14
|
+
//# debugId=1f52a123-ef3c-5452-bdfa-b05d09bb17c0
|
package/dist/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.js","sources":["../main.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"main.js","sources":["../main.tsx"],"sourcesContent":["import { bootConnect } from \"./src/boot.js\";\n\n// Paint the config-independent skeleton, start the runtime config fetch\n// alongside it, and wait for the config. See src/boot.tsx for why the two\n// overlap and what a failure renders.\nconst root = await bootConnect();\n\n// `null` means startup failed and the error state is already painted. The app\n// graph must not be imported then: its modules read the runtime config at\n// module-evaluation and would throw.\nif (root) {\n const { AppLoader } = await import(\"./src/components/app-loader.js\");\n root.render(<AppLoader />);\n}\n"],"names":[],"mappings":";;;;;AAKA,MAAM,OAAO,MAAM,YAAY;AAK/B,IAAI,MAAM;CACR,MAAM,EAAE,cAAc,MAAM,OAAO;CACnC,KAAK,OAAO,oBAAC,WAAD,CAAY,CAAA,CAAC;AAC3B","debug_id":"1f52a123-ef3c-5452-bdfa-b05d09bb17c0"}
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="a45854ff-38ca-5447-8b9d-a71fddae89a6")}catch(e){}}();
|
|
3
|
+
import { formatFileSize, mapProgressStageToStatus } from "@powerhousedao/design-system/connect";
|
|
4
|
+
import { addFileWithProgress, getPHStore, setSelectedNode, showPHModal, subscribeToPHValue } from "@powerhousedao/reactor-browser";
|
|
5
|
+
//#region src/utils/launch-queue.ts
|
|
6
|
+
let pendingImportFiles = [];
|
|
7
|
+
const pendingListeners = /* @__PURE__ */ new Set();
|
|
8
|
+
function notifyPendingListeners() {
|
|
9
|
+
for (const listener of pendingListeners) listener();
|
|
10
|
+
}
|
|
11
|
+
function getPendingImportFiles() {
|
|
12
|
+
return pendingImportFiles;
|
|
13
|
+
}
|
|
14
|
+
/** Stable identity of a pending file (also the picker's pre-check cache key). */
|
|
15
|
+
function pendingFileKey(file) {
|
|
16
|
+
return `${file.name}|${file.size}|${file.lastModified}`;
|
|
17
|
+
}
|
|
18
|
+
function addPendingImportFiles(files) {
|
|
19
|
+
const seen = new Set(pendingImportFiles.map(pendingFileKey));
|
|
20
|
+
const fresh = files.filter((file) => {
|
|
21
|
+
const key = pendingFileKey(file);
|
|
22
|
+
if (seen.has(key)) return false;
|
|
23
|
+
seen.add(key);
|
|
24
|
+
return true;
|
|
25
|
+
});
|
|
26
|
+
if (fresh.length === 0) return;
|
|
27
|
+
pendingImportFiles = [...pendingImportFiles, ...fresh];
|
|
28
|
+
notifyPendingListeners();
|
|
29
|
+
}
|
|
30
|
+
function clearPendingImportFiles() {
|
|
31
|
+
if (pendingImportFiles.length === 0) return;
|
|
32
|
+
pendingImportFiles = [];
|
|
33
|
+
notifyPendingListeners();
|
|
34
|
+
}
|
|
35
|
+
function subscribePendingImportFiles(cb) {
|
|
36
|
+
pendingListeners.add(cb);
|
|
37
|
+
return () => {
|
|
38
|
+
pendingListeners.delete(cb);
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
async function handleLaunchParams(params) {
|
|
42
|
+
const handles = params.files.filter((handle) => handle.kind === "file");
|
|
43
|
+
if (handles.length === 0) return;
|
|
44
|
+
const files = [];
|
|
45
|
+
for (const handle of handles) try {
|
|
46
|
+
files.push(await handle.getFile());
|
|
47
|
+
} catch (error) {
|
|
48
|
+
console.error("Failed to read launched file:", handle.name, error);
|
|
49
|
+
}
|
|
50
|
+
if (files.length === 0) return;
|
|
51
|
+
addPendingImportFiles(files);
|
|
52
|
+
showPHModal({ type: "openFileDocuments" });
|
|
53
|
+
}
|
|
54
|
+
function maybeReopenImportModal() {
|
|
55
|
+
if (getPendingImportFiles().length === 0) return;
|
|
56
|
+
if (getPHStore()?.modal !== void 0) return;
|
|
57
|
+
showPHModal({ type: "openFileDocuments" });
|
|
58
|
+
}
|
|
59
|
+
let initialized = false;
|
|
60
|
+
/**
|
|
61
|
+
* Register the launchQueue consumer that receives files opened with Connect
|
|
62
|
+
* through the OS file association. Idempotent (safe under StrictMode double
|
|
63
|
+
* effects) and a no-op where the File Handling API doesn't exist — Firefox,
|
|
64
|
+
* Safari, and any context without an installed PWA manifest simply never
|
|
65
|
+
* deliver launches.
|
|
66
|
+
*/
|
|
67
|
+
function initLaunchQueueFileHandling() {
|
|
68
|
+
if (initialized) return;
|
|
69
|
+
initialized = true;
|
|
70
|
+
subscribeToPHValue("modal", maybeReopenImportModal);
|
|
71
|
+
window.launchQueue?.setConsumer((params) => {
|
|
72
|
+
handleLaunchParams(params);
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
//#endregion
|
|
76
|
+
//#region src/utils/open-file-uploads.ts
|
|
77
|
+
let uploads = [];
|
|
78
|
+
const listeners = /* @__PURE__ */ new Set();
|
|
79
|
+
function notifyUploadListeners() {
|
|
80
|
+
for (const listener of listeners) listener();
|
|
81
|
+
}
|
|
82
|
+
function getOpenFileUploads() {
|
|
83
|
+
return uploads;
|
|
84
|
+
}
|
|
85
|
+
function subscribeOpenFileUploads(cb) {
|
|
86
|
+
listeners.add(cb);
|
|
87
|
+
return () => {
|
|
88
|
+
listeners.delete(cb);
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
function removeOpenFileUpload(id) {
|
|
92
|
+
const next = uploads.filter((upload) => upload.id !== id);
|
|
93
|
+
if (next.length === uploads.length) return;
|
|
94
|
+
uploads = next;
|
|
95
|
+
notifyUploadListeners();
|
|
96
|
+
}
|
|
97
|
+
function clearOpenFileUploads() {
|
|
98
|
+
if (uploads.length === 0) return;
|
|
99
|
+
uploads = [];
|
|
100
|
+
notifyUploadListeners();
|
|
101
|
+
}
|
|
102
|
+
function addOpenFileUploads(rows) {
|
|
103
|
+
uploads = [...uploads, ...rows];
|
|
104
|
+
notifyUploadListeners();
|
|
105
|
+
}
|
|
106
|
+
function patchOpenFileUpload(id, patch) {
|
|
107
|
+
uploads = uploads.map((upload) => upload.id === id ? {
|
|
108
|
+
...upload,
|
|
109
|
+
...patch
|
|
110
|
+
} : upload);
|
|
111
|
+
notifyUploadListeners();
|
|
112
|
+
}
|
|
113
|
+
let uploadCounter = 0;
|
|
114
|
+
let importChain = Promise.resolve();
|
|
115
|
+
/**
|
|
116
|
+
* Import one file and resolve once the flow truly ends. Completion is
|
|
117
|
+
* tracked through the progress stages, NOT the returned promise — the
|
|
118
|
+
* package-discovery retry path resolves early and keeps reporting through
|
|
119
|
+
* the callback. `resolveConflict: "duplicate"` is always passed: duplicates
|
|
120
|
+
* were resolved in the picker (rename), so the conflict stage must never
|
|
121
|
+
* fire — this also covers a duplicate appearing between pre-check and import.
|
|
122
|
+
*/
|
|
123
|
+
function importOne(row, driveId, documentTypes) {
|
|
124
|
+
return new Promise((resolve) => {
|
|
125
|
+
let settled = false;
|
|
126
|
+
const settle = (fileNode) => {
|
|
127
|
+
if (settled) return;
|
|
128
|
+
settled = true;
|
|
129
|
+
resolve(fileNode);
|
|
130
|
+
};
|
|
131
|
+
addFileWithProgress(row.file, driveId, row.name, void 0, (progress) => {
|
|
132
|
+
patchOpenFileUpload(row.id, {
|
|
133
|
+
status: mapProgressStageToStatus(progress.stage),
|
|
134
|
+
progress: progress.progress,
|
|
135
|
+
...progress.error ? { errorDetails: progress.error } : {},
|
|
136
|
+
...progress.documentType ? { documentType: progress.documentType } : {},
|
|
137
|
+
...progress.fileNode ? { fileNode: progress.fileNode } : {}
|
|
138
|
+
});
|
|
139
|
+
switch (progress.stage) {
|
|
140
|
+
case "complete":
|
|
141
|
+
settle(progress.fileNode);
|
|
142
|
+
break;
|
|
143
|
+
case "failed":
|
|
144
|
+
case "unsupported-document-type": settle(void 0);
|
|
145
|
+
}
|
|
146
|
+
}, documentTypes, "duplicate").catch(() => {
|
|
147
|
+
settle(void 0);
|
|
148
|
+
});
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Run a confirmed batch of imports into a drive, feeding the floating upload
|
|
153
|
+
* panel. Rows appear immediately (queued), files import sequentially, and a
|
|
154
|
+
* single-file batch that succeeds opens its document in the editor.
|
|
155
|
+
*/
|
|
156
|
+
function runOpenFileImports(args) {
|
|
157
|
+
const { driveId, imports, documentTypes } = args;
|
|
158
|
+
if (imports.length === 0) return importChain;
|
|
159
|
+
const rows = imports.map(({ file, name }) => ({
|
|
160
|
+
id: `open-file-${++uploadCounter}`,
|
|
161
|
+
file,
|
|
162
|
+
name
|
|
163
|
+
}));
|
|
164
|
+
addOpenFileUploads(rows.map((row) => ({
|
|
165
|
+
id: row.id,
|
|
166
|
+
fileName: row.name,
|
|
167
|
+
fileSize: formatFileSize(row.file.size),
|
|
168
|
+
status: "pending",
|
|
169
|
+
progress: 0
|
|
170
|
+
})));
|
|
171
|
+
const run = async () => {
|
|
172
|
+
const results = [];
|
|
173
|
+
for (const row of rows) results.push(await importOne(row, driveId, documentTypes));
|
|
174
|
+
if (rows.length === 1 && results[0]) setSelectedNode(results[0]);
|
|
175
|
+
};
|
|
176
|
+
importChain = importChain.then(run, run);
|
|
177
|
+
return importChain;
|
|
178
|
+
}
|
|
179
|
+
//#endregion
|
|
180
|
+
export { subscribeOpenFileUploads as a, initLaunchQueueFileHandling as c, runOpenFileImports as i, pendingFileKey as l, getOpenFileUploads as n, clearPendingImportFiles as o, removeOpenFileUpload as r, getPendingImportFiles as s, clearOpenFileUploads as t, subscribePendingImportFiles as u };
|
|
181
|
+
|
|
182
|
+
//# sourceMappingURL=open-file-uploads-B5pr1sA2.js.map
|
|
183
|
+
//# debugId=a45854ff-38ca-5447-8b9d-a71fddae89a6
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"open-file-uploads-B5pr1sA2.js","sources":["../src/utils/launch-queue.ts","../src/utils/open-file-uploads.ts"],"sourcesContent":["import {\n getPHStore,\n showPHModal,\n subscribeToPHValue,\n} from \"@powerhousedao/reactor-browser\";\n\n// PWA launch handling: consume the files the OS hands the installed Connect app\n// via window.launchQueue when a document is opened through its file association\n// (manifest file_handlers) — stash the files in the pending store below and open\n// the openFileDocuments modal (drive picking + import).\n//\n// Same shape as registerServiceWorker.ts: a module singleton with a tiny\n// external store consumed via useSyncExternalStore.\n\n// External store holding files launched but not yet imported. Repeated\n// launches into an already-focused window (launch_handler: focus-existing)\n// merge into it.\nlet pendingImportFiles: File[] = [];\nconst pendingListeners = new Set<() => void>();\n\nfunction notifyPendingListeners() {\n for (const listener of pendingListeners) listener();\n}\n\nexport function getPendingImportFiles(): File[] {\n return pendingImportFiles;\n}\n\n/** Stable identity of a pending file (also the picker's pre-check cache key). */\nexport function pendingFileKey(file: File): string {\n return `${file.name}|${file.size}|${file.lastModified}`;\n}\n\nexport function addPendingImportFiles(files: File[]) {\n // Re-opening a file that is already waiting (e.g. after detouring to create\n // a drive) must not queue it twice.\n const seen = new Set(pendingImportFiles.map(pendingFileKey));\n const fresh = files.filter((file) => {\n const key = pendingFileKey(file);\n if (seen.has(key)) return false;\n seen.add(key);\n return true;\n });\n if (fresh.length === 0) return;\n pendingImportFiles = [...pendingImportFiles, ...fresh];\n notifyPendingListeners();\n}\n\nexport function clearPendingImportFiles() {\n if (pendingImportFiles.length === 0) return;\n pendingImportFiles = [];\n notifyPendingListeners();\n}\n\nexport function subscribePendingImportFiles(cb: () => void): () => void {\n pendingListeners.add(cb);\n return () => {\n pendingListeners.delete(cb);\n };\n}\n\nasync function handleLaunchParams(params: LaunchParams) {\n const handles = params.files.filter(\n (handle): handle is FileSystemFileHandle => handle.kind === \"file\",\n );\n if (handles.length === 0) return;\n\n const files: File[] = [];\n for (const handle of handles) {\n try {\n files.push(await handle.getFile());\n } catch (error) {\n // Permission/IO failure on one file must not drop the rest.\n console.error(\"Failed to read launched file:\", handle.name, error);\n }\n }\n if (files.length === 0) return;\n\n addPendingImportFiles(files);\n showPHModal({ type: \"openFileDocuments\" });\n}\n\n// Re-surface the picker when another modal closes while launched files are\n// still waiting — e.g. after the zero-drives detour through the create-drive\n// modal, so the user doesn't have to open the file again. Cancelling the\n// import clears the pending store BEFORE closing, so this can't loop.\nfunction maybeReopenImportModal() {\n if (getPendingImportFiles().length === 0) return;\n if (getPHStore()?.modal !== undefined) return;\n showPHModal({ type: \"openFileDocuments\" });\n}\n\nlet initialized = false;\n\n/**\n * Register the launchQueue consumer that receives files opened with Connect\n * through the OS file association. Idempotent (safe under StrictMode double\n * effects) and a no-op where the File Handling API doesn't exist — Firefox,\n * Safari, and any context without an installed PWA manifest simply never\n * deliver launches.\n */\nexport function initLaunchQueueFileHandling() {\n if (initialized) return;\n initialized = true;\n subscribeToPHValue(\"modal\", maybeReopenImportModal);\n window.launchQueue?.setConsumer((params) => {\n void handleLaunchParams(params);\n });\n}\n","import {\n formatFileSize,\n mapProgressStageToStatus,\n type UploadFileListContainerProps,\n} from \"@powerhousedao/design-system/connect\";\nimport {\n addFileWithProgress,\n setSelectedNode,\n} from \"@powerhousedao/reactor-browser\";\nimport type { FileNode } from \"@powerhousedao/shared/document-drive\";\n\n// Progress store + import driver for documents opened through the OS file\n// association. Imports run OUTSIDE React (the picker modal closes the moment\n// the user confirms), reporting into a module store rendered by\n// OpenFileUploadList through the same floating panel UI drag-and-drop uses.\n// Memory-only on purpose: persisting rows (as DropZone does) leaves stale\n// frozen \"uploading\" entries after a reload, and launched imports are\n// one-shot. Rows are cleared only by user action, like drag-and-drop.\n\n/** Row shape the design-system upload panel consumes (UploadTracker). */\nexport type OpenFileUpload = NonNullable<\n UploadFileListContainerProps[\"uploadsArray\"][number]\n>;\n\nlet uploads: OpenFileUpload[] = [];\nconst listeners = new Set<() => void>();\n\nfunction notifyUploadListeners() {\n for (const listener of listeners) listener();\n}\n\nexport function getOpenFileUploads(): OpenFileUpload[] {\n return uploads;\n}\n\nexport function subscribeOpenFileUploads(cb: () => void): () => void {\n listeners.add(cb);\n return () => {\n listeners.delete(cb);\n };\n}\n\nexport function removeOpenFileUpload(id: string) {\n const next = uploads.filter((upload) => upload.id !== id);\n if (next.length === uploads.length) return;\n uploads = next;\n notifyUploadListeners();\n}\n\nexport function clearOpenFileUploads() {\n if (uploads.length === 0) return;\n uploads = [];\n notifyUploadListeners();\n}\n\nfunction addOpenFileUploads(rows: OpenFileUpload[]) {\n uploads = [...uploads, ...rows];\n notifyUploadListeners();\n}\n\nfunction patchOpenFileUpload(id: string, patch: Partial<OpenFileUpload>) {\n uploads = uploads.map((upload) =>\n upload.id === id ? { ...upload, ...patch } : upload,\n );\n notifyUploadListeners();\n}\n\nexport type PlannedOpenFileImport = {\n file: File;\n /** Final (possibly renamed) name the document is stored under. */\n name: string;\n};\n\nlet uploadCounter = 0;\n// Batches are serialized: a second OS launch confirmed mid-upload must not\n// race addDocument calls against the same drive.\nlet importChain: Promise<void> = Promise.resolve();\n\n/**\n * Import one file and resolve once the flow truly ends. Completion is\n * tracked through the progress stages, NOT the returned promise — the\n * package-discovery retry path resolves early and keeps reporting through\n * the callback. `resolveConflict: \"duplicate\"` is always passed: duplicates\n * were resolved in the picker (rename), so the conflict stage must never\n * fire — this also covers a duplicate appearing between pre-check and import.\n */\nfunction importOne(\n row: { id: string; file: File; name: string },\n driveId: string,\n documentTypes: string[] | undefined,\n): Promise<FileNode | undefined> {\n return new Promise((resolve) => {\n let settled = false;\n const settle = (fileNode?: FileNode) => {\n if (settled) return;\n settled = true;\n resolve(fileNode);\n };\n addFileWithProgress(\n row.file,\n driveId,\n row.name,\n undefined, // drive root\n (progress) => {\n patchOpenFileUpload(row.id, {\n status: mapProgressStageToStatus(progress.stage),\n progress: progress.progress,\n ...(progress.error ? { errorDetails: progress.error } : {}),\n ...(progress.documentType\n ? { documentType: progress.documentType }\n : {}),\n ...(progress.fileNode ? { fileNode: progress.fileNode } : {}),\n });\n switch (progress.stage) {\n case \"complete\":\n settle(progress.fileNode);\n break;\n case \"failed\":\n case \"unsupported-document-type\":\n settle(undefined);\n break;\n default:\n break;\n }\n },\n documentTypes,\n \"duplicate\",\n ).catch(() => {\n // A terminal stage was already reported through the callback (the\n // action always emits one before throwing); keep the batch going.\n settle(undefined);\n });\n });\n}\n\n/**\n * Run a confirmed batch of imports into a drive, feeding the floating upload\n * panel. Rows appear immediately (queued), files import sequentially, and a\n * single-file batch that succeeds opens its document in the editor.\n */\nexport function runOpenFileImports(args: {\n driveId: string;\n imports: PlannedOpenFileImport[];\n documentTypes: string[] | undefined;\n}): Promise<void> {\n const { driveId, imports, documentTypes } = args;\n if (imports.length === 0) return importChain;\n\n const rows = imports.map(({ file, name }) => ({\n id: `open-file-${++uploadCounter}`,\n file,\n name,\n }));\n addOpenFileUploads(\n rows.map((row) => ({\n id: row.id,\n fileName: row.name,\n fileSize: formatFileSize(row.file.size),\n status: \"pending\",\n progress: 0,\n })),\n );\n\n const run = async () => {\n const results: (FileNode | undefined)[] = [];\n for (const row of rows) {\n results.push(await importOne(row, driveId, documentTypes));\n }\n // Auto-open only for a single-file batch; several files land on the\n // drive and the panel rows carry their own \"Open Document\" links.\n if (rows.length === 1 && results[0]) {\n setSelectedNode(results[0]);\n }\n };\n importChain = importChain.then(run, run);\n return importChain;\n}\n"],"names":[],"mappings":";;;;;AAiBA,IAAI,qBAA6B,CAAC;AAClC,MAAM,mCAAmB,IAAI,IAAgB;AAE7C,SAAS,yBAAyB;CAChC,KAAK,MAAM,YAAY,kBAAkB,SAAS;AACp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