@powerhousedao/connect 6.2.3-dev.23 → 6.2.3-dev.24

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.
Files changed (94) hide show
  1. package/dist/{AddDriveModal-CW-ZSWkf.js → AddDriveModal-z8TsS9Ke.js} +4 -4
  2. package/dist/{AddDriveModal-CW-ZSWkf.js.map → AddDriveModal-z8TsS9Ke.js.map} +1 -1
  3. package/dist/{ClearStorageModal-BYFLwlea.js → ClearStorageModal-CtuJM3lA.js} +4 -4
  4. package/dist/{ClearStorageModal-BYFLwlea.js.map → ClearStorageModal-CtuJM3lA.js.map} +1 -1
  5. package/dist/{ConfirmDocumentUpgradeModal-BBrFlHp_.js → ConfirmDocumentUpgradeModal-DqbpFyOV.js} +4 -4
  6. package/dist/{ConfirmDocumentUpgradeModal-BBrFlHp_.js.map → ConfirmDocumentUpgradeModal-DqbpFyOV.js.map} +1 -1
  7. package/dist/{CookiesPolicyModal-lKdOuTNm.js → CookiesPolicyModal-D3mk3rk1.js} +3 -3
  8. package/dist/{CookiesPolicyModal-lKdOuTNm.js.map → CookiesPolicyModal-D3mk3rk1.js.map} +1 -1
  9. package/dist/{CreateDocumentModal-HmK-78sB.js → CreateDocumentModal-DsyHqRHf.js} +3 -3
  10. package/dist/{CreateDocumentModal-HmK-78sB.js.map → CreateDocumentModal-DsyHqRHf.js.map} +1 -1
  11. package/dist/{DebugSettingsModal-BLs1jLfT.js → DebugSettingsModal-WuNVN6S3.js} +6 -6
  12. package/dist/{DebugSettingsModal-BLs1jLfT.js.map → DebugSettingsModal-WuNVN6S3.js.map} +1 -1
  13. package/dist/{DeleteDriveModal-Cyw6hwc2.js → DeleteDriveModal-BkQ__i9M.js} +4 -4
  14. package/dist/{DeleteDriveModal-Cyw6hwc2.js.map → DeleteDriveModal-BkQ__i9M.js.map} +1 -1
  15. package/dist/{DeleteItemModal-CiFwstZx.js → DeleteItemModal-BR_sB_e4.js} +4 -4
  16. package/dist/{DeleteItemModal-CiFwstZx.js.map → DeleteItemModal-BR_sB_e4.js.map} +1 -1
  17. package/dist/{DisclaimerModal-DIRsjUvu.js → DisclaimerModal-l-CvpwSz.js} +3 -3
  18. package/dist/{DisclaimerModal-DIRsjUvu.js.map → DisclaimerModal-l-CvpwSz.js.map} +1 -1
  19. package/dist/{DocumentVersionUnsupportedModal-KftC3-jr.js → DocumentVersionUnsupportedModal-B59V3Gl1.js} +3 -3
  20. package/dist/{DocumentVersionUnsupportedModal-KftC3-jr.js.map → DocumentVersionUnsupportedModal-B59V3Gl1.js.map} +1 -1
  21. package/dist/{DownloadDocumentWithErrorsModal-CxsR74d-.js → DownloadDocumentWithErrorsModal-DrF87oh-.js} +3 -3
  22. package/dist/{DownloadDocumentWithErrorsModal-CxsR74d-.js.map → DownloadDocumentWithErrorsModal-DrF87oh-.js.map} +1 -1
  23. package/dist/{DriveAuthRequiredModal-BoqnnNKT.js → DriveAuthRequiredModal-DcDgrltc.js} +4 -4
  24. package/dist/{DriveAuthRequiredModal-BoqnnNKT.js.map → DriveAuthRequiredModal-DcDgrltc.js.map} +1 -1
  25. package/dist/{DriveSettingsModal-DRarHRIb.js → DriveSettingsModal-KZWK9EP3.js} +3 -3
  26. package/dist/{DriveSettingsModal-DRarHRIb.js.map → DriveSettingsModal-KZWK9EP3.js.map} +1 -1
  27. package/dist/{InspectorModal-BnJgQP8R.js → InspectorModal-BPNKmCyl.js} +7 -7
  28. package/dist/{InspectorModal-BnJgQP8R.js.map → InspectorModal-BPNKmCyl.js.map} +1 -1
  29. package/dist/{LoginModal-DhQTxsoG.js → LoginModal-8Y3365cS.js} +4 -4
  30. package/dist/{LoginModal-DhQTxsoG.js.map → LoginModal-8Y3365cS.js.map} +1 -1
  31. package/dist/{MissingPackageModal-Bar7ErIs.js → MissingPackageModal-CAEbJYp3.js} +4 -4
  32. package/dist/{MissingPackageModal-Bar7ErIs.js.map → MissingPackageModal-CAEbJYp3.js.map} +1 -1
  33. package/dist/{OpenFileDocumentsModal-0l2dkdEB.js → OpenFileDocumentsModal-DS41M_nY.js} +4 -4
  34. package/dist/{OpenFileDocumentsModal-0l2dkdEB.js.map → OpenFileDocumentsModal-DS41M_nY.js.map} +1 -1
  35. package/dist/{SettingsModal-H1j2W31l.js → SettingsModal-CLjbxshb.js} +9 -9
  36. package/dist/{SettingsModal-H1j2W31l.js.map → SettingsModal-CLjbxshb.js.map} +1 -1
  37. package/dist/{UpgradeDriveModal-C8scFkuq.js → UpgradeDriveModal-DPtfpSbC.js} +3 -3
  38. package/dist/{UpgradeDriveModal-C8scFkuq.js.map → UpgradeDriveModal-DPtfpSbC.js.map} +1 -1
  39. package/dist/{app-loader-CEjrJHls.js → app-loader--k1XniB2.js} +35 -35
  40. package/dist/{app-loader-CEjrJHls.js.map → app-loader--k1XniB2.js.map} +1 -1
  41. package/dist/app-loader-Cs1PxImi.js +4 -0
  42. package/dist/{app-skeleton-C6RjKQuy.js → app-skeleton-BZGG7nm6.js} +4 -4
  43. package/dist/{app-skeleton-C6RjKQuy.js.map → app-skeleton-BZGG7nm6.js.map} +1 -1
  44. package/dist/{app-skeleton-BQts0IHn.js → app-skeleton-DO3ox92L.js} +3 -3
  45. package/dist/{boot-uobbAyWT.js → boot-CloWnD0n.js} +4 -4
  46. package/dist/{boot-uobbAyWT.js.map → boot-CloWnD0n.js.map} +1 -1
  47. package/dist/{build-info-BKKhnRdh.js → build-info-BCDZwe0Q.js} +5 -5
  48. package/dist/{build-info-BKKhnRdh.js.map → build-info-BCDZwe0Q.js.map} +1 -1
  49. package/dist/{components-ChCIuJW9.js → components-BTsIcRV_.js} +4 -4
  50. package/dist/{connect.config-BofwIsWJ.js → connect.config-D1mCRtVA.js} +3 -3
  51. package/dist/{connect.config-BofwIsWJ.js.map → connect.config-D1mCRtVA.js.map} +1 -1
  52. package/dist/{connection-state-DAqW06pk.js → connection-state-oYbhN61I.js} +5 -5
  53. package/dist/{connection-state-DAqW06pk.js.map → connection-state-oYbhN61I.js.map} +1 -1
  54. package/dist/{cookie-banner-BQescTYk.js → cookie-banner-DKzkT2wu.js} +5 -5
  55. package/dist/{cookie-banner-BQescTYk.js.map → cookie-banner-DKzkT2wu.js.map} +1 -1
  56. package/dist/{i18n-90Q8hAPL.js → i18n-BlC8tGho.js} +3 -3
  57. package/dist/{i18n-90Q8hAPL.js.map → i18n-BlC8tGho.js.map} +1 -1
  58. package/dist/{load-G--MiC6j.js → load-B_jzTipS.js} +9 -9
  59. package/dist/{load-G--MiC6j.js.map → load-B_jzTipS.js.map} +1 -1
  60. package/dist/main.js +2 -2
  61. package/dist/{package-manager-CKEdIJGv.js → package-manager-DBRABkZ_.js} +4 -4
  62. package/dist/{package-manager-CKEdIJGv.js.map → package-manager-DBRABkZ_.js.map} +1 -1
  63. package/dist/{pglite-major-D3sdYMs2.js → pglite-major-u7qHLpXj.js} +3 -3
  64. package/dist/{pglite-major-D3sdYMs2.js.map → pglite-major-u7qHLpXj.js.map} +1 -1
  65. package/dist/{pglite-migrate-core-BIWwtl5e.js → pglite-migrate-core-BOyb7luT.js} +4 -4
  66. package/dist/{pglite-migrate-core-BIWwtl5e.js.map → pglite-migrate-core-BOyb7luT.js.map} +1 -1
  67. package/dist/{pglite-seed-ChNTfFkc.js → pglite-seed-Cj5X6aSi.js} +4 -4
  68. package/dist/{pglite-seed-ChNTfFkc.js.map → pglite-seed-Cj5X6aSi.js.map} +1 -1
  69. package/dist/{preferences-store-Coa1SHvi.js → preferences-store-CtKCuHwO.js} +5 -5
  70. package/dist/{preferences-store-Coa1SHvi.js.map → preferences-store-CtKCuHwO.js.map} +1 -1
  71. package/dist/{pwa-manifest-link-B38lBmEu.js → pwa-manifest-link-BI410b04.js} +3 -3
  72. package/dist/{pwa-manifest-link-B38lBmEu.js.map → pwa-manifest-link-BI410b04.js.map} +1 -1
  73. package/dist/{reactor-CWJmSgjl.js → reactor-Cxjyf6yo.js} +25 -17
  74. package/dist/reactor-Cxjyf6yo.js.map +1 -0
  75. package/dist/reactor.worker.js +22 -11
  76. package/dist/reactor.worker.js.map +1 -1
  77. package/dist/{registerServiceWorker-BAbPbSW4.js → registerServiceWorker-DhB4qPLx.js} +5 -5
  78. package/dist/{registerServiceWorker-BAbPbSW4.js.map → registerServiceWorker-DhB4qPLx.js.map} +1 -1
  79. package/dist/renown-trust-DVgdB10t.js +34 -0
  80. package/dist/renown-trust-DVgdB10t.js.map +1 -0
  81. package/dist/{sentry-QXKgQmr2.js → sentry-BWJJNfUQ.js} +3 -3
  82. package/dist/{sentry-QXKgQmr2.js.map → sentry-BWJJNfUQ.js.map} +1 -1
  83. package/dist/start-connect.js +2 -2
  84. package/dist/{toast-CO6ChlzE.js → toast-DtfTKZND.js} +3 -3
  85. package/dist/{toast-CO6ChlzE.js.map → toast-DtfTKZND.js.map} +1 -1
  86. package/dist/{use-renown-login-rS9wfcuG.js → use-renown-login-BQEJ2Zo3.js} +3 -3
  87. package/dist/{use-renown-login-rS9wfcuG.js.map → use-renown-login-BQEJ2Zo3.js.map} +1 -1
  88. package/dist/{useIsEmbedded-B_AIFqBu.js → useIsEmbedded-D1iaTmBn.js} +3 -3
  89. package/dist/{useIsEmbedded-B_AIFqBu.js.map → useIsEmbedded-D1iaTmBn.js.map} +1 -1
  90. package/dist/{useRegistryPackages-C2WHmqn4.js → useRegistryPackages-akngEtRy.js} +4 -4
  91. package/dist/{useRegistryPackages-C2WHmqn4.js.map → useRegistryPackages-akngEtRy.js.map} +1 -1
  92. package/package.json +14 -14
  93. package/dist/app-loader-Cpuo40Tm.js +0 -4
  94. package/dist/reactor-CWJmSgjl.js.map +0 -1
@@ -0,0 +1,4 @@
1
+ import { t as AppLoader } from "./app-loader--k1XniB2.js";
2
+ export { AppLoader };
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]="f782a491-75d5-5c0c-9e60-79f16d631085")}catch(e){}}();
4
+ //# debugId=f782a491-75d5-5c0c-9e60-79f16d631085
@@ -1,6 +1,6 @@
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]="16807434-5773-5fab-9a32-c89e0d8ac09c")}catch(e){}}();
3
- import { t as getIsEmbedded } from "./useIsEmbedded-B_AIFqBu.js";
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]="2664a676-b288-5518-b18e-a696c783d1ea")}catch(e){}}();
3
+ import { t as getIsEmbedded } from "./useIsEmbedded-D1iaTmBn.js";
4
4
  import { jsx, jsxs } from "react/jsx-runtime";
5
5
  import { useEffect, useState, useSyncExternalStore } from "react";
6
6
  import { ConnectSidebar, HomeScreen, LogoAnimation } from "@powerhousedao/design-system/connect";
@@ -107,5 +107,5 @@ const AppSkeleton = (props) => {
107
107
  //#endregion
108
108
  export { setMigrationStatus as n, AppSkeleton as t };
109
109
 
110
- //# sourceMappingURL=app-skeleton-C6RjKQuy.js.map
111
- //# debugId=16807434-5773-5fab-9a32-c89e0d8ac09c
110
+ //# sourceMappingURL=app-skeleton-BZGG7nm6.js.map
111
+ //# debugId=2664a676-b288-5518-b18e-a696c783d1ea
@@ -1 +1 @@
1
- {"version":3,"file":"app-skeleton-C6RjKQuy.js","sources":["../src/utils/browser.ts","../src/components/migration-status.ts","../src/components/app-skeleton.tsx"],"sourcesContent":["export function getBasePath() {\n if (typeof document === \"undefined\") {\n return \"/\";\n }\n\n const baseEl = document.querySelector(\"base\");\n const href = baseEl?.getAttribute(\"href\");\n return href || \"/\";\n}\n","export type MigrationPhase = \"clone\" | \"dump\" | \"restore\";\n\nexport type MigrationStatus = {\n idbName: string;\n phase: MigrationPhase;\n};\n\nlet current: MigrationStatus | null = null;\nconst listeners = new Set<() => void>();\n\nexport function setMigrationStatus(status: MigrationStatus | null): void {\n current = status;\n for (const l of listeners) l();\n}\n\nexport function getMigrationStatus(): MigrationStatus | null {\n return current;\n}\n\nexport function subscribeMigrationStatus(cb: () => void): () => void {\n listeners.add(cb);\n return () => {\n listeners.delete(cb);\n };\n}\n","// Leaf imports, not the `@powerhousedao/connect/{utils,hooks}` barrels: this\n// is the first contentful paint and main.tsx loads it BEFORE the runtime\n// config is fetched. The barrels re-export modules that read the config at\n// module-evaluation (which throws if the config cache isn't warm), so they\n// must stay out of this graph.\nimport { getBasePath } from \"../utils/browser.js\";\nimport { getIsEmbedded } from \"../hooks/useIsEmbedded.js\";\nimport {\n ConnectSidebar,\n HomeScreen,\n LogoAnimation,\n} from \"@powerhousedao/design-system/connect\";\nimport { initTheme } from \"@powerhousedao/reactor-browser\";\nimport {\n useEffect,\n useState,\n useSyncExternalStore,\n type PropsWithChildren,\n} from \"react\";\nimport {\n getMigrationStatus,\n subscribeMigrationStatus,\n type MigrationPhase,\n} from \"./migration-status.js\";\nconst LOADER_DELAY = 250;\n\nconst PHASE_LABEL: Record<MigrationPhase, string> = {\n clone: \"Backing up local database…\",\n dump: \"Exporting data from previous version…\",\n restore: \"Restoring data into the new database…\",\n};\n\nconst MigrationOverlay = () => {\n const status = useSyncExternalStore(\n subscribeMigrationStatus,\n getMigrationStatus,\n () => null,\n );\n if (!status) return null;\n return (\n <div className=\"absolute inset-0 z-20 flex items-center justify-center\">\n <div className=\"rounded-lg bg-card/90 px-6 py-4 text-sm text-foreground shadow-lg\">\n <div className=\"font-medium\">Upgrading local database…</div>\n <div className=\"text-foreground\">{PHASE_LABEL[status.phase]}</div>\n </div>\n </div>\n );\n};\n\nconst Loader = ({ delay = LOADER_DELAY }: { delay?: number }) => {\n const isSSR = typeof window === \"undefined\";\n const showInitialLoader =\n typeof document !== \"undefined\" &&\n document.body.getAttribute(\"data-show-loader\") === \"true\";\n if (!isSSR) {\n initTheme();\n }\n\n const [showLoading, setShowLoading] = useState(!delay || showInitialLoader);\n\n useEffect(() => {\n const id = setTimeout(() => {\n setShowLoading(true);\n // Latch it on the body — the same flag the SSR branch below sets, and\n // the one `showInitialLoader` reads on mount. The bootstrap renders this\n // skeleton, then swaps in the config-dependent app whose Suspense\n // fallback is this same component, which remounts it. Without the latch\n // the delay re-arms and the logo blinks out for another `delay` ms at\n // exactly the moment the app is loading.\n document.body.setAttribute(\"data-show-loader\", \"true\");\n }, delay);\n\n return () => clearTimeout(id);\n }, []);\n\n return (\n <div\n className={`skeleton-loader absolute inset-0 z-10 flex items-center justify-center ${showLoading ? \"\" : \"hidden\"}`}\n >\n <div className=\"animate-pulse overflow-hidden rounded-full shadow-lg\">\n <LogoAnimation />\n </div>\n {isSSR ? (\n <script\n dangerouslySetInnerHTML={{\n __html: `setTimeout(() => {\n document.querySelector('.skeleton-loader')?.classList.remove('hidden');\n document.body.setAttribute('data-show-loader', 'true');\n }, ${delay})`,\n }}\n />\n ) : null}\n </div>\n );\n};\n\nexport const AppSkeleton: React.FC<PropsWithChildren> = (props) => {\n const isSSR = typeof window === \"undefined\";\n const isHomeScreen = !isSSR && window.location.pathname === getBasePath();\n /* Match Root's behavior: when Connect is rendered inside an embed (e.g. the\n * vetra-studio BUILD iframe), suppress the sidebar during the Suspense\n * fallback so the loading state matches the loaded state. */\n const isEmbedded = !isSSR && getIsEmbedded();\n return (\n <div className=\"flex h-screen overflow-hidden bg-background\">\n {!isEmbedded && (\n <ConnectSidebar\n className=\"animate-pulse\"\n onLogin={undefined}\n onDisconnect={undefined}\n onClickSettings={undefined}\n address={undefined}\n />\n )}\n <HomeScreen\n containerClassName={\n isSSR || !isHomeScreen ? \"home-screen hidden\" : undefined\n }\n children={props.children ?? null}\n />\n {isSSR ? (\n <script\n dangerouslySetInnerHTML={{\n __html: `\n const baseEl = document.querySelector('base');\n const href = baseEl?.getAttribute('href');\n const basePath = href || '/';\n if (window.location.pathname === basePath) {\n document.querySelector('.home-screen')?.classList.remove('hidden')\n }`,\n }}\n />\n ) : null}\n {!props.children ? <Loader /> : null}\n <MigrationOverlay />\n </div>\n );\n};\n\nexport default AppSkeleton;\n"],"names":[],"mappings":";;;;;;;;AAAA,SAAgB,cAAc;AAC5B,KAAI,OAAO,aAAa,YACtB,QAAO;AAKT,QAFe,SAAS,cAAc,OAAO,EACxB,aAAa,OAAO,IAC1B;;;;ACAjB,IAAI,UAAkC;AACtC,MAAM,4BAAY,IAAI,KAAiB;AAEvC,SAAgB,mBAAmB,QAAsC;AACvE,WAAU;AACV,MAAK,MAAM,KAAK,UAAW,IAAG;;AAGhC,SAAgB,qBAA6C;AAC3D,QAAO;;AAGT,SAAgB,yBAAyB,IAA4B;AACnE,WAAU,IAAI,GAAG;AACjB,cAAa;AACX,YAAU,OAAO,GAAG;;;;;ACExB,MAAM,eAAe;AAErB,MAAM,cAA8C;CAClD,OAAO;CACP,MAAM;CACN,SAAS;CACV;AAED,MAAM,yBAAyB;CAC7B,MAAM,SAAS,qBACb,0BACA,0BACM,KACP;AACD,KAAI,CAAC,OAAQ,QAAO;AACpB,QACE,oBAAC,OAAD;EAAK,WAAU;YACb,qBAAC,OAAD;GAAK,WAAU;aAAf,CACE,oBAAC,OAAD;IAAK,WAAU;cAAc;IAA+B,CAAA,EAC5D,oBAAC,OAAD;IAAK,WAAU;cAAmB,YAAY,OAAO;IAAa,CAAA,CAC9D;;EACF,CAAA;;AAIV,MAAM,UAAU,EAAE,QAAQ,mBAAuC;CAC/D,MAAM,QAAQ,OAAO,WAAW;CAChC,MAAM,oBACJ,OAAO,aAAa,eACpB,SAAS,KAAK,aAAa,mBAAmB,KAAK;AACrD,KAAI,CAAC,MACH,YAAW;CAGb,MAAM,CAAC,aAAa,kBAAkB,SAAS,CAAC,SAAS,kBAAkB;AAE3E,iBAAgB;EACd,MAAM,KAAK,iBAAiB;AAC1B,kBAAe,KAAK;AAOpB,YAAS,KAAK,aAAa,oBAAoB,OAAO;KACrD,MAAM;AAET,eAAa,aAAa,GAAG;IAC5B,EAAE,CAAC;AAEN,QACE,qBAAC,OAAD;EACE,WAAW,0EAA0E,cAAc,KAAK;YAD1G,CAGE,oBAAC,OAAD;GAAK,WAAU;aACb,oBAAC,eAAD,EAAiB,CAAA;GACb,CAAA,EACL,QACC,oBAAC,UAAD,EACE,yBAAyB,EACvB,QAAQ;;;yBAGK,MAAM,IACpB,EACD,CAAA,GACA,KACA;;;AAIV,MAAa,eAA4C,UAAU;CACjE,MAAM,QAAQ,OAAO,WAAW;CAChC,MAAM,eAAe,CAAC,SAAS,OAAO,SAAS,aAAa,aAAa;AAKzE,QACE,qBAAC,OAAD;EAAK,WAAU;YAAf;GACG,EAHc,CAAC,SAAS,eAAe,KAItC,oBAAC,gBAAD;IACE,WAAU;IACV,SAAS,KAAA;IACT,cAAc,KAAA;IACd,iBAAiB,KAAA;IACjB,SAAS,KAAA;IACT,CAAA;GAEJ,oBAAC,YAAD;IACE,oBACE,SAAS,CAAC,eAAe,uBAAuB,KAAA;IAElD,UAAU,MAAM,YAAY;IAC5B,CAAA;GACD,QACC,oBAAC,UAAD,EACE,yBAAyB,EACvB,QAAQ;;;;;;wBAOT,EACD,CAAA,GACA;GACH,CAAC,MAAM,WAAW,oBAAC,QAAD,EAAU,CAAA,GAAG;GAChC,oBAAC,kBAAD,EAAoB,CAAA;GAChB","debug_id":"16807434-5773-5fab-9a32-c89e0d8ac09c"}
1
+ {"version":3,"file":"app-skeleton-BZGG7nm6.js","sources":["../src/utils/browser.ts","../src/components/migration-status.ts","../src/components/app-skeleton.tsx"],"sourcesContent":["export function getBasePath() {\n if (typeof document === \"undefined\") {\n return \"/\";\n }\n\n const baseEl = document.querySelector(\"base\");\n const href = baseEl?.getAttribute(\"href\");\n return href || \"/\";\n}\n","export type MigrationPhase = \"clone\" | \"dump\" | \"restore\";\n\nexport type MigrationStatus = {\n idbName: string;\n phase: MigrationPhase;\n};\n\nlet current: MigrationStatus | null = null;\nconst listeners = new Set<() => void>();\n\nexport function setMigrationStatus(status: MigrationStatus | null): void {\n current = status;\n for (const l of listeners) l();\n}\n\nexport function getMigrationStatus(): MigrationStatus | null {\n return current;\n}\n\nexport function subscribeMigrationStatus(cb: () => void): () => void {\n listeners.add(cb);\n return () => {\n listeners.delete(cb);\n };\n}\n","// Leaf imports, not the `@powerhousedao/connect/{utils,hooks}` barrels: this\n// is the first contentful paint and main.tsx loads it BEFORE the runtime\n// config is fetched. The barrels re-export modules that read the config at\n// module-evaluation (which throws if the config cache isn't warm), so they\n// must stay out of this graph.\nimport { getBasePath } from \"../utils/browser.js\";\nimport { getIsEmbedded } from \"../hooks/useIsEmbedded.js\";\nimport {\n ConnectSidebar,\n HomeScreen,\n LogoAnimation,\n} from \"@powerhousedao/design-system/connect\";\nimport { initTheme } from \"@powerhousedao/reactor-browser\";\nimport {\n useEffect,\n useState,\n useSyncExternalStore,\n type PropsWithChildren,\n} from \"react\";\nimport {\n getMigrationStatus,\n subscribeMigrationStatus,\n type MigrationPhase,\n} from \"./migration-status.js\";\nconst LOADER_DELAY = 250;\n\nconst PHASE_LABEL: Record<MigrationPhase, string> = {\n clone: \"Backing up local database…\",\n dump: \"Exporting data from previous version…\",\n restore: \"Restoring data into the new database…\",\n};\n\nconst MigrationOverlay = () => {\n const status = useSyncExternalStore(\n subscribeMigrationStatus,\n getMigrationStatus,\n () => null,\n );\n if (!status) return null;\n return (\n <div className=\"absolute inset-0 z-20 flex items-center justify-center\">\n <div className=\"rounded-lg bg-card/90 px-6 py-4 text-sm text-foreground shadow-lg\">\n <div className=\"font-medium\">Upgrading local database…</div>\n <div className=\"text-foreground\">{PHASE_LABEL[status.phase]}</div>\n </div>\n </div>\n );\n};\n\nconst Loader = ({ delay = LOADER_DELAY }: { delay?: number }) => {\n const isSSR = typeof window === \"undefined\";\n const showInitialLoader =\n typeof document !== \"undefined\" &&\n document.body.getAttribute(\"data-show-loader\") === \"true\";\n if (!isSSR) {\n initTheme();\n }\n\n const [showLoading, setShowLoading] = useState(!delay || showInitialLoader);\n\n useEffect(() => {\n const id = setTimeout(() => {\n setShowLoading(true);\n // Latch it on the body — the same flag the SSR branch below sets, and\n // the one `showInitialLoader` reads on mount. The bootstrap renders this\n // skeleton, then swaps in the config-dependent app whose Suspense\n // fallback is this same component, which remounts it. Without the latch\n // the delay re-arms and the logo blinks out for another `delay` ms at\n // exactly the moment the app is loading.\n document.body.setAttribute(\"data-show-loader\", \"true\");\n }, delay);\n\n return () => clearTimeout(id);\n }, []);\n\n return (\n <div\n className={`skeleton-loader absolute inset-0 z-10 flex items-center justify-center ${showLoading ? \"\" : \"hidden\"}`}\n >\n <div className=\"animate-pulse overflow-hidden rounded-full shadow-lg\">\n <LogoAnimation />\n </div>\n {isSSR ? (\n <script\n dangerouslySetInnerHTML={{\n __html: `setTimeout(() => {\n document.querySelector('.skeleton-loader')?.classList.remove('hidden');\n document.body.setAttribute('data-show-loader', 'true');\n }, ${delay})`,\n }}\n />\n ) : null}\n </div>\n );\n};\n\nexport const AppSkeleton: React.FC<PropsWithChildren> = (props) => {\n const isSSR = typeof window === \"undefined\";\n const isHomeScreen = !isSSR && window.location.pathname === getBasePath();\n /* Match Root's behavior: when Connect is rendered inside an embed (e.g. the\n * vetra-studio BUILD iframe), suppress the sidebar during the Suspense\n * fallback so the loading state matches the loaded state. */\n const isEmbedded = !isSSR && getIsEmbedded();\n return (\n <div className=\"flex h-screen overflow-hidden bg-background\">\n {!isEmbedded && (\n <ConnectSidebar\n className=\"animate-pulse\"\n onLogin={undefined}\n onDisconnect={undefined}\n onClickSettings={undefined}\n address={undefined}\n />\n )}\n <HomeScreen\n containerClassName={\n isSSR || !isHomeScreen ? \"home-screen hidden\" : undefined\n }\n children={props.children ?? null}\n />\n {isSSR ? (\n <script\n dangerouslySetInnerHTML={{\n __html: `\n const baseEl = document.querySelector('base');\n const href = baseEl?.getAttribute('href');\n const basePath = href || '/';\n if (window.location.pathname === basePath) {\n document.querySelector('.home-screen')?.classList.remove('hidden')\n }`,\n }}\n />\n ) : null}\n {!props.children ? <Loader /> : null}\n <MigrationOverlay />\n </div>\n );\n};\n\nexport default AppSkeleton;\n"],"names":[],"mappings":";;;;;;;;AAAA,SAAgB,cAAc;AAC5B,KAAI,OAAO,aAAa,YACtB,QAAO;AAKT,QAFe,SAAS,cAAc,OAAO,EACxB,aAAa,OAAO,IAC1B;;;;ACAjB,IAAI,UAAkC;AACtC,MAAM,4BAAY,IAAI,KAAiB;AAEvC,SAAgB,mBAAmB,QAAsC;AACvE,WAAU;AACV,MAAK,MAAM,KAAK,UAAW,IAAG;;AAGhC,SAAgB,qBAA6C;AAC3D,QAAO;;AAGT,SAAgB,yBAAyB,IAA4B;AACnE,WAAU,IAAI,GAAG;AACjB,cAAa;AACX,YAAU,OAAO,GAAG;;;;;ACExB,MAAM,eAAe;AAErB,MAAM,cAA8C;CAClD,OAAO;CACP,MAAM;CACN,SAAS;CACV;AAED,MAAM,yBAAyB;CAC7B,MAAM,SAAS,qBACb,0BACA,0BACM,KACP;AACD,KAAI,CAAC,OAAQ,QAAO;AACpB,QACE,oBAAC,OAAD;EAAK,WAAU;YACb,qBAAC,OAAD;GAAK,WAAU;aAAf,CACE,oBAAC,OAAD;IAAK,WAAU;cAAc;IAA+B,CAAA,EAC5D,oBAAC,OAAD;IAAK,WAAU;cAAmB,YAAY,OAAO;IAAa,CAAA,CAC9D;;EACF,CAAA;;AAIV,MAAM,UAAU,EAAE,QAAQ,mBAAuC;CAC/D,MAAM,QAAQ,OAAO,WAAW;CAChC,MAAM,oBACJ,OAAO,aAAa,eACpB,SAAS,KAAK,aAAa,mBAAmB,KAAK;AACrD,KAAI,CAAC,MACH,YAAW;CAGb,MAAM,CAAC,aAAa,kBAAkB,SAAS,CAAC,SAAS,kBAAkB;AAE3E,iBAAgB;EACd,MAAM,KAAK,iBAAiB;AAC1B,kBAAe,KAAK;AAOpB,YAAS,KAAK,aAAa,oBAAoB,OAAO;KACrD,MAAM;AAET,eAAa,aAAa,GAAG;IAC5B,EAAE,CAAC;AAEN,QACE,qBAAC,OAAD;EACE,WAAW,0EAA0E,cAAc,KAAK;YAD1G,CAGE,oBAAC,OAAD;GAAK,WAAU;aACb,oBAAC,eAAD,EAAiB,CAAA;GACb,CAAA,EACL,QACC,oBAAC,UAAD,EACE,yBAAyB,EACvB,QAAQ;;;yBAGK,MAAM,IACpB,EACD,CAAA,GACA,KACA;;;AAIV,MAAa,eAA4C,UAAU;CACjE,MAAM,QAAQ,OAAO,WAAW;CAChC,MAAM,eAAe,CAAC,SAAS,OAAO,SAAS,aAAa,aAAa;AAKzE,QACE,qBAAC,OAAD;EAAK,WAAU;YAAf;GACG,EAHc,CAAC,SAAS,eAAe,KAItC,oBAAC,gBAAD;IACE,WAAU;IACV,SAAS,KAAA;IACT,cAAc,KAAA;IACd,iBAAiB,KAAA;IACjB,SAAS,KAAA;IACT,CAAA;GAEJ,oBAAC,YAAD;IACE,oBACE,SAAS,CAAC,eAAe,uBAAuB,KAAA;IAElD,UAAU,MAAM,YAAY;IAC5B,CAAA;GACD,QACC,oBAAC,UAAD,EACE,yBAAyB,EACvB,QAAQ;;;;;;wBAOT,EACD,CAAA,GACA;GACH,CAAC,MAAM,WAAW,oBAAC,QAAD,EAAU,CAAA,GAAG;GAChC,oBAAC,kBAAD,EAAoB,CAAA;GAChB","debug_id":"2664a676-b288-5518-b18e-a696c783d1ea"}
@@ -1,4 +1,4 @@
1
- import { t as AppSkeleton } from "./app-skeleton-C6RjKQuy.js";
1
+ import { t as AppSkeleton } from "./app-skeleton-BZGG7nm6.js";
2
2
  export { AppSkeleton, AppSkeleton as default };
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]="0d0717e1-19f2-54c5-a997-461a73f334a6")}catch(e){}}();
4
- //# debugId=0d0717e1-19f2-54c5-a997-461a73f334a6
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]="638e1f7d-d465-5467-87c9-e9db97b5362a")}catch(e){}}();
4
+ //# debugId=638e1f7d-d465-5467-87c9-e9db97b5362a
@@ -1,5 +1,5 @@
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]="cee66ed6-f2ac-5035-b1b4-102374a5c0b3")}catch(e){}}();
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]="a17f0e25-86f5-5c5d-9a21-5b6813d3f687")}catch(e){}}();
3
3
  import { r as loadRuntimeConfig } from "./runtime-config-DL3QjcfM.js";
4
4
  import { r as track } from "./buffer-Bu1eWySI.js";
5
5
  import { createRoot } from "react-dom/client";
@@ -127,7 +127,7 @@ function initPerformanceObserver() {
127
127
  //#region src/boot.tsx
128
128
  const defaultDeps = {
129
129
  loadConfig: () => loadRuntimeConfig(),
130
- importSkeleton: () => import("./app-skeleton-BQts0IHn.js"),
130
+ importSkeleton: () => import("./app-skeleton-DO3ox92L.js"),
131
131
  createRoot: () => createRoot(document.getElementById("root")),
132
132
  initObserver: initPerformanceObserver
133
133
  };
@@ -206,5 +206,5 @@ async function bootConnect(overrides = {}) {
206
206
  //#endregion
207
207
  export { bootConnect as t };
208
208
 
209
- //# sourceMappingURL=boot-uobbAyWT.js.map
210
- //# debugId=cee66ed6-f2ac-5035-b1b4-102374a5c0b3
209
+ //# sourceMappingURL=boot-CloWnD0n.js.map
210
+ //# debugId=a17f0e25-86f5-5c5d-9a21-5b6813d3f687
@@ -1 +1 @@
1
- {"version":3,"file":"boot-uobbAyWT.js","sources":["../src/utils/performance-observer.ts","../src/boot.tsx"],"sourcesContent":["import { track } from \"../services/openpanel/buffer.js\";\nimport type { PHGlobal } from \"@powerhousedao/reactor-browser\";\n\n/**\n * Startup performance measurement.\n *\n * Captures First Contentful Paint (FCP) and Largest Contentful Paint (LCP) via\n * the Performance API and reports each to the OpenPanel analytics buffer (a\n * consent-gated, never-throwing queue). Call {@link initPerformanceObserver}\n * at the very top of the entry module, before the runtime config is fetched,\n * so FCP is caught even if the browser has already painted — a\n * `PerformanceObserver` with `buffered: true` replays entries that fired\n * before `observe()` was called.\n *\n * This module is intentionally dependency-light (only the OpenPanel event\n * buffer, which has no runtime imports of its own) so it is safe to load\n * before the runtime config is fetched. Every API access is guarded: nothing\n * here may throw into the application.\n */\n\nfunction navigationType(): string | undefined {\n try {\n const entry = performance.getEntriesByType(\"navigation\")[0] as\n | PerformanceNavigationTiming\n | undefined;\n return entry?.type; // \"navigate\" | \"reload\" | \"back_forward\" | \"prerender\"\n } catch {\n return undefined;\n }\n}\n\n// window.ph is the app's global bag (PHGlobal). This module owns a\n// `performance` sub-object it writes into; `PhWithPerformance` is a named\n// stand-in for that write so it type-checks without touching the shared\n// PHGlobal definition.\ntype PhWithPerformance = PHGlobal & { performance?: Record<string, number> };\n\n/**\n * Mirror the metric on `window.ph.performance` for devtools inspection. Only\n * writes to an already-existing `window.ph` (owned by the entry module) —\n * never creates or replaces it, so it can't clobber the app's global state.\n */\nfunction storeOnWindow(name: string, value: number): void {\n try {\n const ph = window.ph as PhWithPerformance | undefined;\n if (!ph) return;\n ph.performance = ph.performance ?? {};\n ph.performance[name] = value;\n } catch {\n // devtools mirror is best-effort only\n }\n}\n\nfunction report(name: string, ms: number): void {\n const value = Math.round(ms);\n const props: Record<string, unknown> = { ms: value };\n const navType = navigationType();\n if (navType) props.navigation = navType;\n\n storeOnWindow(name, value);\n\n // The console summary is a developer aid. In a production build it is noise\n // in every user's console and in every support screenshot, so it is gated\n // out of the bundle there.\n if (!import.meta.env.PROD) {\n try {\n console.info(`[connect:performance] ${name}: ${value}ms`, props);\n } catch {\n // console is best-effort only\n }\n }\n\n try {\n track(`performance.${name}`, props);\n } catch {\n // analytics must never throw into the app\n }\n}\n\n/**\n * Starts the observers. Returns a disposer that detaches all of them. The app\n * never needs it — the observers live as long as the page does — but it keeps\n * the module testable and leaves no listener behind.\n */\nexport function initPerformanceObserver(): () => void {\n if (\n typeof window === \"undefined\" ||\n typeof PerformanceObserver === \"undefined\"\n ) {\n return () => undefined;\n }\n\n const teardown: Array<() => void> = [];\n\n /** Registers a listener and queues its removal on dispose. */\n const listen = (\n target: EventTarget,\n type: string,\n handler: () => void,\n once = true,\n ): void => {\n target.addEventListener(type, handler, { once });\n teardown.push(() => target.removeEventListener(type, handler));\n };\n\n // FCP — from the \"paint\" buffer. It fires once, so stop observing after it.\n try {\n const fcpObserver = new PerformanceObserver((list) => {\n for (const entry of list.getEntries()) {\n if (entry.name === \"first-contentful-paint\") {\n fcpObserver.disconnect();\n report(\"first_contentful_paint\", entry.startTime);\n }\n }\n });\n fcpObserver.observe({ type: \"paint\", buffered: true });\n teardown.push(() => fcpObserver.disconnect());\n } catch (err) {\n console.warn(\"[connect:performance] FCP observer failed:\", err);\n }\n\n // LCP — the final value only settles on an interaction or page hide, so latch\n // the latest candidate and report on the first terminal signal.\n let lcpMs = 0;\n let lcpReported = false;\n let lcpObserver: PerformanceObserver | undefined;\n\n /** Latches the newest candidate of a batch. The last entry is the newest. */\n const latch = (entries: ArrayLike<{ startTime: number }>): void => {\n if (entries.length > 0) {\n lcpMs = entries[entries.length - 1].startTime;\n }\n };\n\n const reportLcp = (): void => {\n // Several terminal signals can fire in one session (a click, then the page\n // hiding, then pagehide). The metric is sent for the first one only: every\n // repeat would be a double-count downstream.\n if (lcpReported) return;\n lcpReported = true;\n\n // A PerformanceObserver delivers entries in a task of its own, so a\n // terminal signal early in the page's life arrives while the newest\n // candidate is still buffered. Drain it before disconnecting — otherwise\n // an early click costs the session its LCP entirely.\n try {\n latch(lcpObserver?.takeRecords() ?? []);\n } catch {\n // draining is best-effort; report whatever was already delivered\n }\n\n lcpObserver?.disconnect();\n if (lcpMs > 0) report(\"largest_contentful_paint\", lcpMs);\n };\n\n try {\n lcpObserver = new PerformanceObserver((list) => {\n latch(list.getEntries());\n });\n lcpObserver.observe({ type: \"largest-contentful-paint\", buffered: true });\n teardown.push(() => lcpObserver?.disconnect());\n\n listen(window, \"pagehide\", reportLcp);\n listen(window, \"pointerdown\", reportLcp);\n listen(window, \"keydown\", reportLcp);\n // Not `once`: a page that loads in a background tab, or that the user tabs\n // away from and back, fires visibilitychange more than once, and only the\n // transition to \"hidden\" is terminal. A one-shot listener would be spent\n // on an earlier \"visible\" event and never see the hide.\n listen(\n document,\n \"visibilitychange\",\n () => {\n if (document.visibilityState === \"hidden\") reportLcp();\n },\n false,\n );\n } catch (err) {\n console.warn(\"[connect:performance] LCP observer failed:\", err);\n }\n\n return () => {\n for (const detach of teardown) {\n try {\n detach();\n } catch {\n // teardown is best-effort only\n }\n }\n teardown.length = 0;\n };\n}\n","import type { ComponentType, PropsWithChildren, ReactNode } from \"react\";\nimport { createRoot } from \"react-dom/client\";\nimport { loadRuntimeConfig } from \"./runtime-config.js\";\nimport { initPerformanceObserver } from \"./utils/performance-observer.js\";\n\n/**\n * The two-phase startup shared by both entry points.\n *\n * Phase 1 paints the config-independent skeleton, so first contentful paint\n * does not wait on the `powerhouse.config.json` round-trip. Phase 2 awaits the\n * config and hands the caller back the root to render the config-dependent app\n * into — every module that reads the runtime config at module-evaluation\n * throws if the cache isn't warm, so the app graph may only be imported after\n * this resolves.\n *\n * Kept dependency-light on purpose: it loads before the config is fetched, so\n * nothing in its import graph may read the config.\n */\n\n/** All the bootstrap needs of a React root — and all a test has to stand in for. */\ntype RenderTarget = { render: (node: ReactNode) => void };\n\nexport type BootDeps = {\n loadConfig: () => Promise<unknown>;\n importSkeleton: () => Promise<{ default: ComponentType<PropsWithChildren> }>;\n createRoot: () => RenderTarget;\n initObserver: () => () => void;\n};\n\nconst defaultDeps: BootDeps = {\n loadConfig: () => loadRuntimeConfig(),\n importSkeleton: () => import(\"./components/app-skeleton.js\"),\n createRoot: () => createRoot(document.getElementById(\"root\")!),\n initObserver: initPerformanceObserver,\n};\n\n/**\n * Shown when startup cannot proceed. Deliberately built from plain elements:\n * this renders precisely when the runtime config is unavailable, so it must\n * not depend on anything that reads it.\n */\nfunction BootError({ error }: { error: unknown }): ReactNode {\n const message = error instanceof Error ? error.message : String(error);\n return (\n <div\n role=\"alert\"\n className=\"flex h-screen flex-col items-center justify-center gap-3 bg-background p-6 text-center\"\n >\n <h1 className=\"text-lg font-semibold text-foreground\">\n Connect could not start\n </h1>\n <p className=\"max-w-prose text-sm text-foreground\">\n Its runtime configuration could not be loaded. This is usually temporary\n — reloading often resolves it.\n </p>\n <pre className=\"max-w-prose overflow-x-auto rounded-sm bg-card px-3 py-2 text-left text-xs text-foreground\">\n {message}\n </pre>\n <button\n type=\"button\"\n className=\"rounded-sm bg-card px-4 py-2 text-sm font-medium text-foreground shadow-sm\"\n onClick={() => {\n window.location.reload();\n }}\n >\n Reload\n </button>\n </div>\n );\n}\n\n/**\n * Paints the skeleton, then waits for the runtime config.\n *\n * Returns the root to render the app into, or `null` when startup failed — in\n * which case the error state is already painted and the caller must not import\n * the config-dependent app. It resolves rather than rejecting on failure: both\n * entry points await this at their module's top level, where a rejection would\n * surface only as an unhandled rejection behind a skeleton that never goes\n * away.\n */\nexport async function bootConnect(\n overrides: Partial<BootDeps> = {},\n): Promise<RenderTarget | null> {\n const {\n loadConfig,\n importSkeleton,\n createRoot: makeRoot,\n initObserver,\n } = { ...defaultDeps, ...overrides };\n\n if (!window.ph) {\n window.ph = {};\n }\n\n // Before anything else: the observers use `buffered: true`, so they catch\n // the browser's paint even when setup runs a tick after it fired.\n initObserver();\n\n // Started here and awaited at the bottom. The config fetch and the skeleton\n // chunk are independent round-trips, so they overlap; awaiting the chunk\n // first would put the config fetch — and with it everything the app needs —\n // behind it, which measured ~180ms of extra time-to-usable on a 150ms-RTT\n // connection. Mapping the rejection to a value here also means a config\n // failure is handled from the start, never an unhandled rejection.\n const config = loadConfig().then(\n () => ({ ok: true }) as const,\n (error: unknown) => ({ ok: false, error }) as const,\n );\n\n const root = makeRoot();\n\n try {\n const { default: AppSkeleton } = await importSkeleton();\n root.render(<AppSkeleton />);\n } catch (error) {\n console.error(\"[connect:boot] the app skeleton failed to load:\", error);\n root.render(<BootError error={error} />);\n return null;\n }\n\n const result = await config;\n if (!result.ok) {\n console.error(\n \"[connect:boot] the runtime config failed to load:\",\n result.error,\n );\n root.render(<BootError error={result.error} />);\n return null;\n }\n\n return root;\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAoBA,SAAS,iBAAqC;AAC5C,KAAI;AAIF,SAHc,YAAY,iBAAiB,aAAa,CAAC,IAG3C;SACR;AACN;;;;;;;;AAeJ,SAAS,cAAc,MAAc,OAAqB;AACxD,KAAI;EACF,MAAM,KAAK,OAAO;AAClB,MAAI,CAAC,GAAI;AACT,KAAG,cAAc,GAAG,eAAe,EAAE;AACrC,KAAG,YAAY,QAAQ;SACjB;;AAKV,SAAS,OAAO,MAAc,IAAkB;CAC9C,MAAM,QAAQ,KAAK,MAAM,GAAG;CAC5B,MAAM,QAAiC,EAAE,IAAI,OAAO;CACpD,MAAM,UAAU,gBAAgB;AAChC,KAAI,QAAS,OAAM,aAAa;AAEhC,eAAc,MAAM,MAAM;AAK1B,KAAI,CAAC,OAAO,KAAK,IAAI,KACnB,KAAI;AACF,UAAQ,KAAK,yBAAyB,KAAK,IAAI,MAAM,KAAK,MAAM;SAC1D;AAKV,KAAI;AACF,QAAM,eAAe,QAAQ,MA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AM,SAAS,MAAM;AACrB,KAAI,CAAC,OAAO,IAAI;AACd,UAAQ,MACN,qDACA,OAAO,MACR;AACD,OAAK,OAAO,oBAAC,WAAD,EAAW,OAAO,OAAO,OAAS,CAAA,CAAC;AAC/C,SAAO;;AAGT,QAAO","debug_id":"cee66ed6-f2ac-5035-b1b4-102374a5c0b3"}
1
+ {"version":3,"file":"boot-CloWnD0n.js","sources":["../src/utils/performance-observer.ts","../src/boot.tsx"],"sourcesContent":["import { track } from \"../services/openpanel/buffer.js\";\nimport type { PHGlobal } from \"@powerhousedao/reactor-browser\";\n\n/**\n * Startup performance measurement.\n *\n * Captures First Contentful Paint (FCP) and Largest Contentful Paint (LCP) via\n * the Performance API and reports each to the OpenPanel analytics buffer (a\n * consent-gated, never-throwing queue). Call {@link initPerformanceObserver}\n * at the very top of the entry module, before the runtime config is fetched,\n * so FCP is caught even if the browser has already painted — a\n * `PerformanceObserver` with `buffered: true` replays entries that fired\n * before `observe()` was called.\n *\n * This module is intentionally dependency-light (only the OpenPanel event\n * buffer, which has no runtime imports of its own) so it is safe to load\n * before the runtime config is fetched. Every API access is guarded: nothing\n * here may throw into the application.\n */\n\nfunction navigationType(): string | undefined {\n try {\n const entry = performance.getEntriesByType(\"navigation\")[0] as\n | PerformanceNavigationTiming\n | undefined;\n return entry?.type; // \"navigate\" | \"reload\" | \"back_forward\" | \"prerender\"\n } catch {\n return undefined;\n }\n}\n\n// window.ph is the app's global bag (PHGlobal). This module owns a\n// `performance` sub-object it writes into; `PhWithPerformance` is a named\n// stand-in for that write so it type-checks without touching the shared\n// PHGlobal definition.\ntype PhWithPerformance = PHGlobal & { performance?: Record<string, number> };\n\n/**\n * Mirror the metric on `window.ph.performance` for devtools inspection. Only\n * writes to an already-existing `window.ph` (owned by the entry module) —\n * never creates or replaces it, so it can't clobber the app's global state.\n */\nfunction storeOnWindow(name: string, value: number): void {\n try {\n const ph = window.ph as PhWithPerformance | undefined;\n if (!ph) return;\n ph.performance = ph.performance ?? {};\n ph.performance[name] = value;\n } catch {\n // devtools mirror is best-effort only\n }\n}\n\nfunction report(name: string, ms: number): void {\n const value = Math.round(ms);\n const props: Record<string, unknown> = { ms: value };\n const navType = navigationType();\n if (navType) props.navigation = navType;\n\n storeOnWindow(name, value);\n\n // The console summary is a developer aid. In a production build it is noise\n // in every user's console and in every support screenshot, so it is gated\n // out of the bundle there.\n if (!import.meta.env.PROD) {\n try {\n console.info(`[connect:performance] ${name}: ${value}ms`, props);\n } catch {\n // console is best-effort only\n }\n }\n\n try {\n track(`performance.${name}`, props);\n } catch {\n // analytics must never throw into the app\n }\n}\n\n/**\n * Starts the observers. Returns a disposer that detaches all of them. The app\n * never needs it — the observers live as long as the page does — but it keeps\n * the module testable and leaves no listener behind.\n */\nexport function initPerformanceObserver(): () => void {\n if (\n typeof window === \"undefined\" ||\n typeof PerformanceObserver === \"undefined\"\n ) {\n return () => undefined;\n }\n\n const teardown: Array<() => void> = [];\n\n /** Registers a listener and queues its removal on dispose. */\n const listen = (\n target: EventTarget,\n type: string,\n handler: () => void,\n once = true,\n ): void => {\n target.addEventListener(type, handler, { once });\n teardown.push(() => target.removeEventListener(type, handler));\n };\n\n // FCP — from the \"paint\" buffer. It fires once, so stop observing after it.\n try {\n const fcpObserver = new PerformanceObserver((list) => {\n for (const entry of list.getEntries()) {\n if (entry.name === \"first-contentful-paint\") {\n fcpObserver.disconnect();\n report(\"first_contentful_paint\", entry.startTime);\n }\n }\n });\n fcpObserver.observe({ type: \"paint\", buffered: true });\n teardown.push(() => fcpObserver.disconnect());\n } catch (err) {\n console.warn(\"[connect:performance] FCP observer failed:\", err);\n }\n\n // LCP — the final value only settles on an interaction or page hide, so latch\n // the latest candidate and report on the first terminal signal.\n let lcpMs = 0;\n let lcpReported = false;\n let lcpObserver: PerformanceObserver | undefined;\n\n /** Latches the newest candidate of a batch. The last entry is the newest. */\n const latch = (entries: ArrayLike<{ startTime: number }>): void => {\n if (entries.length > 0) {\n lcpMs = entries[entries.length - 1].startTime;\n }\n };\n\n const reportLcp = (): void => {\n // Several terminal signals can fire in one session (a click, then the page\n // hiding, then pagehide). The metric is sent for the first one only: every\n // repeat would be a double-count downstream.\n if (lcpReported) return;\n lcpReported = true;\n\n // A PerformanceObserver delivers entries in a task of its own, so a\n // terminal signal early in the page's life arrives while the newest\n // candidate is still buffered. Drain it before disconnecting — otherwise\n // an early click costs the session its LCP entirely.\n try {\n latch(lcpObserver?.takeRecords() ?? []);\n } catch {\n // draining is best-effort; report whatever was already delivered\n }\n\n lcpObserver?.disconnect();\n if (lcpMs > 0) report(\"largest_contentful_paint\", lcpMs);\n };\n\n try {\n lcpObserver = new PerformanceObserver((list) => {\n latch(list.getEntries());\n });\n lcpObserver.observe({ type: \"largest-contentful-paint\", buffered: true });\n teardown.push(() => lcpObserver?.disconnect());\n\n listen(window, \"pagehide\", reportLcp);\n listen(window, \"pointerdown\", reportLcp);\n listen(window, \"keydown\", reportLcp);\n // Not `once`: a page that loads in a background tab, or that the user tabs\n // away from and back, fires visibilitychange more than once, and only the\n // transition to \"hidden\" is terminal. A one-shot listener would be spent\n // on an earlier \"visible\" event and never see the hide.\n listen(\n document,\n \"visibilitychange\",\n () => {\n if (document.visibilityState === \"hidden\") reportLcp();\n },\n false,\n );\n } catch (err) {\n console.warn(\"[connect:performance] LCP observer failed:\", err);\n }\n\n return () => {\n for (const detach of teardown) {\n try {\n detach();\n } catch {\n // teardown is best-effort only\n }\n }\n teardown.length = 0;\n };\n}\n","import type { ComponentType, PropsWithChildren, ReactNode } from \"react\";\nimport { createRoot } from \"react-dom/client\";\nimport { loadRuntimeConfig } from \"./runtime-config.js\";\nimport { initPerformanceObserver } from \"./utils/performance-observer.js\";\n\n/**\n * The two-phase startup shared by both entry points.\n *\n * Phase 1 paints the config-independent skeleton, so first contentful paint\n * does not wait on the `powerhouse.config.json` round-trip. Phase 2 awaits the\n * config and hands the caller back the root to render the config-dependent app\n * into — every module that reads the runtime config at module-evaluation\n * throws if the cache isn't warm, so the app graph may only be imported after\n * this resolves.\n *\n * Kept dependency-light on purpose: it loads before the config is fetched, so\n * nothing in its import graph may read the config.\n */\n\n/** All the bootstrap needs of a React root — and all a test has to stand in for. */\ntype RenderTarget = { render: (node: ReactNode) => void };\n\nexport type BootDeps = {\n loadConfig: () => Promise<unknown>;\n importSkeleton: () => Promise<{ default: ComponentType<PropsWithChildren> }>;\n createRoot: () => RenderTarget;\n initObserver: () => () => void;\n};\n\nconst defaultDeps: BootDeps = {\n loadConfig: () => loadRuntimeConfig(),\n importSkeleton: () => import(\"./components/app-skeleton.js\"),\n createRoot: () => createRoot(document.getElementById(\"root\")!),\n initObserver: initPerformanceObserver,\n};\n\n/**\n * Shown when startup cannot proceed. Deliberately built from plain elements:\n * this renders precisely when the runtime config is unavailable, so it must\n * not depend on anything that reads it.\n */\nfunction BootError({ error }: { error: unknown }): ReactNode {\n const message = error instanceof Error ? error.message : String(error);\n return (\n <div\n role=\"alert\"\n className=\"flex h-screen flex-col items-center justify-center gap-3 bg-background p-6 text-center\"\n >\n <h1 className=\"text-lg font-semibold text-foreground\">\n Connect could not start\n </h1>\n <p className=\"max-w-prose text-sm text-foreground\">\n Its runtime configuration could not be loaded. This is usually temporary\n — reloading often resolves it.\n </p>\n <pre className=\"max-w-prose overflow-x-auto rounded-sm bg-card px-3 py-2 text-left text-xs text-foreground\">\n {message}\n </pre>\n <button\n type=\"button\"\n className=\"rounded-sm bg-card px-4 py-2 text-sm font-medium text-foreground shadow-sm\"\n onClick={() => {\n window.location.reload();\n }}\n >\n Reload\n </button>\n </div>\n );\n}\n\n/**\n * Paints the skeleton, then waits for the runtime config.\n *\n * Returns the root to render the app into, or `null` when startup failed — in\n * which case the error state is already painted and the caller must not import\n * the config-dependent app. It resolves rather than rejecting on failure: both\n * entry points await this at their module's top level, where a rejection would\n * surface only as an unhandled rejection behind a skeleton that never goes\n * away.\n */\nexport async function bootConnect(\n overrides: Partial<BootDeps> = {},\n): Promise<RenderTarget | null> {\n const {\n loadConfig,\n importSkeleton,\n createRoot: makeRoot,\n initObserver,\n } = { ...defaultDeps, ...overrides };\n\n if (!window.ph) {\n window.ph = {};\n }\n\n // Before anything else: the observers use `buffered: true`, so they catch\n // the browser's paint even when setup runs a tick after it fired.\n initObserver();\n\n // Started here and awaited at the bottom. The config fetch and the skeleton\n // chunk are independent round-trips, so they overlap; awaiting the chunk\n // first would put the config fetch — and with it everything the app needs —\n // behind it, which measured ~180ms of extra time-to-usable on a 150ms-RTT\n // connection. Mapping the rejection to a value here also means a config\n // failure is handled from the start, never an unhandled rejection.\n const config = loadConfig().then(\n () => ({ ok: true }) as const,\n (error: unknown) => ({ ok: false, error }) as const,\n );\n\n const root = makeRoot();\n\n try {\n const { default: AppSkeleton } = await importSkeleton();\n root.render(<AppSkeleton />);\n } catch (error) {\n console.error(\"[connect:boot] the app skeleton failed to load:\", error);\n root.render(<BootError error={error} />);\n return null;\n }\n\n const result = await config;\n if (!result.ok) {\n console.error(\n \"[connect:boot] the runtime config failed to load:\",\n result.error,\n );\n root.render(<BootError error={result.error} />);\n return null;\n }\n\n return root;\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAoBA,SAAS,iBAAqC;AAC5C,KAAI;AAIF,SAHc,YAAY,iBAAiB,aAAa,CAAC,IAG3C;SACR;AACN;;;;;;;;AAeJ,SAAS,cAAc,MAAc,OAAqB;AACxD,KAAI;EACF,MAAM,KAAK,OAAO;AAClB,MAAI,CAAC,GAAI;AACT,KAAG,cAAc,GAAG,eAAe,EAAE;AACrC,KAAG,YAAY,QAAQ;SACjB;;AAKV,SAAS,OAAO,MAAc,IAAkB;CAC9C,MAAM,QAAQ,KAAK,MAAM,GAAG;CAC5B,MAAM,QAAiC,EAAE,IAAI,OAAO;CACpD,MAAM,UAAU,gBAAgB;AAChC,KAAI,QAAS,OAAM,aAAa;AAEhC,eAAc,MAAM,MAAM;AAK1B,KAAI,CAAC,OAAO,KAAK,IAAI,KACnB,KAAI;AACF,UAAQ,KAAK,yB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AM;AACvE,OAAK,OAAO,oBAAC,WAAD,EAAkB,OAAS,CAAA,CAAC;AACxC,SAAO;;CAGT,MAAM,SAAS,MAAM;AACrB,KAAI,CAAC,OAAO,IAAI;AACd,UAAQ,MACN,qDACA,OAAO,MACR;AACD,OAAK,OAAO,oBAAC,WAAD,EAAW,OAAO,OAAO,OAAS,CAAA,CAAC;AAC/C,SAAO;;AAGT,QAAO","debug_id":"a17f0e25-86f5-5c5d-9a21-5b6813d3f687"}
@@ -1,12 +1,12 @@
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]="6268dc07-c494-5a00-a05b-b68f7aa12307")}catch(e){}}();
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]="3effbc27-d997-5e79-b050-c80e0c583282")}catch(e){}}();
3
3
  import { buildTreeUrl, shortGitSha } from "@powerhousedao/shared";
4
4
  //#region src/utils/build-info.ts
5
5
  function getVersion() {
6
- return "6.2.3-dev.23";
6
+ return "6.2.3-dev.24";
7
7
  }
8
8
  function getGitSha() {
9
- return "7b5cf362aaa580a9e468dd0e3d98e0dca9630e91";
9
+ return "895cfda0dfc73ba08e40437ca258507d8b2c9377";
10
10
  }
11
11
  /**
12
12
  * Build identity baked in at build time (define PH_CONNECT_BUILD_HASH —
@@ -24,5 +24,5 @@ function getGitUrl() {
24
24
  //#endregion
25
25
  export { shortGitSha as a, getVersion as i, getGitSha as n, getGitUrl as r, getBuildHash as t };
26
26
 
27
- //# sourceMappingURL=build-info-BKKhnRdh.js.map
28
- //# debugId=6268dc07-c494-5a00-a05b-b68f7aa12307
27
+ //# sourceMappingURL=build-info-BCDZwe0Q.js.map
28
+ //# debugId=3effbc27-d997-5e79-b050-c80e0c583282
@@ -1 +1 @@
1
- {"version":3,"file":"build-info-BKKhnRdh.js","sources":["../src/utils/build-info.ts"],"sourcesContent":["import { buildTreeUrl, shortGitSha } from \"@powerhousedao/shared\";\nimport { packageJson } from \"./package-json.js\";\n\nexport { shortGitSha };\n\ndeclare const CONNECT_VERSION: string | undefined;\ndeclare const CONNECT_GIT_SHA: string | undefined;\ndeclare const PH_CONNECT_BUILD_HASH: string | undefined;\n\nexport function getVersion(): string {\n if (typeof CONNECT_VERSION !== \"undefined\") return CONNECT_VERSION;\n return (\n process.env.WORKSPACE_VERSION ??\n process.env.npm_package_version ??\n packageJson.version\n );\n}\n\nexport function getGitSha(): string {\n if (typeof CONNECT_GIT_SHA !== \"undefined\") return CONNECT_GIT_SHA;\n return process.env.WORKSPACE_GIT_SHA ?? \"unknown\";\n}\n\n/**\n * Build identity baked in at build time (define PH_CONNECT_BUILD_HASH —\n * see builder-tools' connectBuildHashPlugin). Identical builds of the same\n * inputs produce the same hash; any change to the deployed content (Connect\n * version, project config, package list, build options) changes it.\n */\nexport function getBuildHash(): string {\n if (typeof PH_CONNECT_BUILD_HASH !== \"undefined\")\n return PH_CONNECT_BUILD_HASH;\n return \"unknown\";\n}\n\nexport function getGitUrl(): string | null {\n return buildTreeUrl(getGitSha());\n}\n"],"names":[],"mappings":";;;;AASA,SAAgB,aAAqB;AACS,QAAA;;AAQ9C,SAAgB,YAAoB;AACU,QAAA;;;;;;;;AAU9C,SAAgB,eAAuB;AACrC,KAAI,OAAO,0BAA0B,YACnC,QAAO;AACT,QAAO;;AAGT,SAAgB,YAA2B;AACzC,QAAO,aAAa,WAAW,CAAC","debug_id":"6268dc07-c494-5a00-a05b-b68f7aa12307"}
1
+ {"version":3,"file":"build-info-BCDZwe0Q.js","sources":["../src/utils/build-info.ts"],"sourcesContent":["import { buildTreeUrl, shortGitSha } from \"@powerhousedao/shared\";\nimport { packageJson } from \"./package-json.js\";\n\nexport { shortGitSha };\n\ndeclare const CONNECT_VERSION: string | undefined;\ndeclare const CONNECT_GIT_SHA: string | undefined;\ndeclare const PH_CONNECT_BUILD_HASH: string | undefined;\n\nexport function getVersion(): string {\n if (typeof CONNECT_VERSION !== \"undefined\") return CONNECT_VERSION;\n return (\n process.env.WORKSPACE_VERSION ??\n process.env.npm_package_version ??\n packageJson.version\n );\n}\n\nexport function getGitSha(): string {\n if (typeof CONNECT_GIT_SHA !== \"undefined\") return CONNECT_GIT_SHA;\n return process.env.WORKSPACE_GIT_SHA ?? \"unknown\";\n}\n\n/**\n * Build identity baked in at build time (define PH_CONNECT_BUILD_HASH —\n * see builder-tools' connectBuildHashPlugin). Identical builds of the same\n * inputs produce the same hash; any change to the deployed content (Connect\n * version, project config, package list, build options) changes it.\n */\nexport function getBuildHash(): string {\n if (typeof PH_CONNECT_BUILD_HASH !== \"undefined\")\n return PH_CONNECT_BUILD_HASH;\n return \"unknown\";\n}\n\nexport function getGitUrl(): string | null {\n return buildTreeUrl(getGitSha());\n}\n"],"names":[],"mappings":";;;;AASA,SAAgB,aAAqB;AACS,QAAA;;AAQ9C,SAAgB,YAAoB;AACU,QAAA;;;;;;;;AAU9C,SAAgB,eAAuB;AACrC,KAAI,OAAO,0BAA0B,YACnC,QAAO;AACT,QAAO;;AAGT,SAAgB,YAA2B;AACzC,QAAO,aAAa,WAAW,CAAC","debug_id":"3effbc27-d997-5e79-b050-c80e0c583282"}
@@ -1,5 +1,5 @@
1
- import { t as AppSkeleton } from "./app-skeleton-C6RjKQuy.js";
2
- import { _ as EditorLoader, a as Root, b as Analytics, c as DriveIcon, g as AppContainer, i as Router, l as DotsLoader, n as Sidebar, o as Footer, r as SearchBar, s as DocumentEditor, t as AppLoader, u as App, v as DocumentEditorContainer, y as OpenPanel } from "./app-loader-CEjrJHls.js";
1
+ import { t as AppSkeleton } from "./app-skeleton-BZGG7nm6.js";
2
+ import { _ as EditorLoader, a as Root, b as Analytics, c as DriveIcon, g as AppContainer, i as Router, l as DotsLoader, n as Sidebar, o as Footer, r as SearchBar, s as DocumentEditor, t as AppLoader, u as App, v as DocumentEditorContainer, y as OpenPanel } from "./app-loader--k1XniB2.js";
3
3
  export { Analytics, App, AppContainer, AppLoader, AppSkeleton, DocumentEditor, DocumentEditorContainer, DotsLoader, DriveIcon, EditorLoader, Footer, OpenPanel, Root, Router, SearchBar, Sidebar };
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]="e73db873-8833-56fd-951d-ba312c7c6510")}catch(e){}}();
5
- //# debugId=e73db873-8833-56fd-951d-ba312c7c6510
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]="0ef5e994-1461-502b-a682-f03d6c20799a")}catch(e){}}();
5
+ //# debugId=0ef5e994-1461-502b-a682-f03d6c20799a
@@ -1,5 +1,5 @@
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]="403c52f3-f935-584b-b8c9-9a6e2d7485a1")}catch(e){}}();
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]="80bb3f43-15cc-5cd8-975b-4506ddcbb869")}catch(e){}}();
3
3
  import { n as getRuntimeConfig } from "./runtime-config-DL3QjcfM.js";
4
4
  import { loadRuntimeEnv, normalizeBasePath } from "@powerhousedao/shared/connect";
5
5
  import { setLogLevel } from "@powerhousedao/reactor-browser";
@@ -179,5 +179,5 @@ const connectConfig = {
179
179
  //#endregion
180
180
  export { defaultPHDocumentEditorConfig as a, defaultPHAppConfig as i, buildPHGlobalConfig as n, phGlobalConfig as o, connectConfig as r, PH_CONNECT_BASE_PATH as t };
181
181
 
182
- //# sourceMappingURL=connect.config-BofwIsWJ.js.map
183
- //# debugId=403c52f3-f935-584b-b8c9-9a6e2d7485a1
182
+ //# sourceMappingURL=connect.config-D1mCRtVA.js.map
183
+ //# debugId=80bb3f43-15cc-5cd8-975b-4506ddcbb869
@@ -1 +1 @@
1
- {"version":3,"file":"connect.config-BofwIsWJ.js","sources":["../src/connect.config.ts"],"sourcesContent":["import {\n setLogLevel,\n type PHAppConfig,\n type PHDocumentEditorConfig,\n type PHGlobalConfig,\n} from \"@powerhousedao/reactor-browser\";\nimport type { PHConnectRuntimeConfig } from \"@powerhousedao/shared/clis\";\nimport {\n loadRuntimeEnv,\n normalizeBasePath,\n} from \"@powerhousedao/shared/connect\";\nimport { logger } from \"document-model\";\nimport { getRuntimeConfig } from \"./runtime-config.js\";\n\n// Env vars are reserved for version stamps and analytics processor toggles.\n// Everything in the Connect runtime schema (PHConnectRuntimeConfig) is read\n// from `runtime` below. The Sentry release tag is stamped at build time via\n// Vite's `define` so it always matches the sourcemap upload tag CI used.\nexport const env = loadRuntimeEnv({\n processEnv: import.meta.env,\n});\n\ndeclare const PH_CONNECT_SENTRY_RELEASE: string;\n\n// Runtime fields come from the JSON, not env. start-connect.tsx's top-level\n// await guarantees the loader cache is warm by the time this module\n// evaluates, so getRuntimeConfig() resolves synchronously. The cache merges\n// DEFAULT_CONNECT_CONFIG into whatever the file declared, so every leaf\n// under `runtime.*` is guaranteed defined.\nconst runtime = getRuntimeConfig().connect;\n\nfunction getRouterBasenameFromBasePath(basePath: string) {\n return basePath.endsWith(\"/\") ? basePath : basePath + \"/\";\n}\n\n// Runtime deploy base. In dynamic-base builds the plugin rewrites\n// import.meta.env.BASE_URL to (globalThis.__PH_DYNAMIC_BASE__||\"/\"), the same\n// base assets resolve against; it takes precedence so router basename and\n// path stripping match the served subpath. A baked runtime base path\n// (runtime.app.basePath) only applies to concrete-base builds, where the\n// dynamic global is unset.\nfunction getDeployBasePath() {\n if (\n typeof globalThis !== \"undefined\" &&\n (globalThis as { __PH_DYNAMIC_BASE__?: string }).__PH_DYNAMIC_BASE__\n ) {\n return import.meta.env.BASE_URL;\n }\n return runtime.app?.basePath || import.meta.env.BASE_URL;\n}\n\n// Hardcoded literal defaults for `PHGlobalConfig` fields whose env-var\n// source was removed. The fields stay on the type so wired-but-dead SW /\n// hook consumers keep typechecking; values mirror the previous Zod\n// defaults.\nfunction getBuiltInDefaults(): Omit<\n PHGlobalConfig,\n \"basePath\" | \"routerBasename\"\n> {\n const studioMode = runtime.app?.studioMode ?? false;\n // Drive containers, DocumentModel, and vetra builder-spec types are authored\n // via their own drives — never creatable from a generic drive.\n const disabledEditors = [\n \"powerhouse/document-drive\",\n \"powerhouse/reactor-drive\",\n \"powerhouse/document-model\",\n \"powerhouse/app\",\n \"powerhouse/document-editor\",\n \"powerhouse/processor\",\n \"powerhouse/subgraph\",\n \"powerhouse/package\",\n ];\n return {\n allowList: undefined,\n allowedDocumentTypes: [],\n isDragAndDropEnabled: true,\n isEditorDebugModeEnabled: false,\n isEditorReadModeEnabled: false,\n isExternalControlsEnabled: false,\n version: env.PH_CONNECT_VERSION,\n logLevel: runtime.app?.logLevel,\n requiresHardRefresh: true,\n warnOutdatedApp: true,\n studioMode,\n versionCheckInterval: 60 * 60 * 1000,\n cliVersion: env.PH_CONNECT_CLI_VERSION,\n fileUploadOperationsChunkSize: 50,\n gaTrackingId: undefined,\n defaultDrivesUrl: runtime.drives?.defaultDrives?.find(\n (drive) => \"url\" in drive,\n )?.url,\n drivesPreserveStrategy: runtime.drives?.preserveStrategy,\n enabledEditors: undefined,\n disabledEditors,\n\n /* Processors */\n isExternalProcessorsEnabled: true,\n // Analytics off by default; flip to true (or wire a runtime-config field)\n // when we want analytics enabled out of the box.\n isAnalyticsEnabled: false,\n isAnalyticsExternalProcessorsEnabled:\n env.PH_CONNECT_EXTERNAL_ANALYTICS_PROCESSORS_ENABLED,\n analyticsDatabaseName: undefined,\n isRelationalProcessorsEnabled: true,\n isExternalRelationalProcessorsEnabled: true,\n\n renownUrl: runtime.renown?.url,\n renownNetworkId: runtime.renown?.networkId,\n renownChainId: runtime.renown?.chainId,\n switchboardUrl: runtime.renown?.switchboardUrl,\n renownAdapters: runtime.renown?.adapters,\n sentryRelease: PH_CONNECT_SENTRY_RELEASE,\n sentryDsn: runtime.sentry?.dsn ?? undefined,\n sentryEnv: runtime.sentry?.env,\n isDiffAnalyticsEnabled: env.PH_CONNECT_DIFF_ANALYTICS_ENABLED,\n isDriveAnalyticsEnabled: env.PH_CONNECT_DRIVE_ANALYTICS_ENABLED,\n isPublicDrivesEnabled: runtime.drives?.sections?.remote?.enabled,\n isCloudDrivesEnabled: runtime.drives?.sections?.remote?.enabled ?? true,\n isLocalDrivesEnabled: runtime.drives?.sections?.local?.enabled,\n isSentryTracingEnabled: runtime.sentry?.tracing,\n isDocumentModelSelectionSettingsEnabled: false,\n isAddDriveEnabled: runtime.drives?.allowAddDrive,\n isAddPublicDrivesEnabled: runtime.drives?.sections?.remote?.allowAdd,\n isDeletePublicDrivesEnabled: runtime.drives?.sections?.remote?.allowDelete,\n isAddCloudDrivesEnabled: runtime.drives?.sections?.remote?.allowAdd ?? true,\n isDeleteCloudDrivesEnabled:\n runtime.drives?.sections?.remote?.allowDelete ?? true,\n isAddLocalDrivesEnabled: runtime.drives?.sections?.local?.allowAdd,\n isDeleteLocalDrivesEnabled: runtime.drives?.sections?.local?.allowDelete,\n isAnalyticsDatabaseWorkerEnabled: false,\n isExternalPackagesEnabled: runtime.packages?.externalEnabled,\n };\n}\n\nexport function buildPHGlobalConfig(\n basePath: string,\n routerBasename: string,\n connectFromConfig: PHConnectRuntimeConfig,\n): PHGlobalConfig {\n const defaults = getBuiltInDefaults();\n const fileOverrides: Partial<PHGlobalConfig> = {};\n\n if (connectFromConfig.drives?.allowAddDrive !== undefined) {\n fileOverrides.isAddDriveEnabled = connectFromConfig.drives.allowAddDrive;\n }\n\n return {\n basePath,\n routerBasename,\n ...defaults,\n ...fileOverrides,\n };\n}\n\nfunction getPHGlobalConfigFromRuntime(): PHGlobalConfig {\n // Deploy base wins via getDeployBasePath: the dynamic-base global when set,\n // else runtime.app.basePath (DEFAULT_CONNECT_CONFIG guarantees it defined),\n // with a \"/\" fallback as a defensive guard for typecheck.\n const basePath = getDeployBasePath() ?? \"/\";\n const routerBasename = getRouterBasenameFromBasePath(basePath);\n return buildPHGlobalConfig(basePath, routerBasename, runtime);\n}\n\nexport const phGlobalConfig = getPHGlobalConfigFromRuntime();\n\nexport const defaultPHDocumentEditorConfig: PHDocumentEditorConfig = {\n isExternalControlsEnabled: phGlobalConfig.isExternalControlsEnabled,\n};\n\nexport const defaultPHAppConfig: PHAppConfig = {\n allowedDocumentTypes: phGlobalConfig.allowedDocumentTypes,\n isDragAndDropEnabled: phGlobalConfig.isDragAndDropEnabled,\n};\n\n// Set log level from the runtime config (DEFAULT_CONNECT_CONFIG provides a\n// fallback, so this is always defined).\nconst RESOLVED_LOG_LEVEL = runtime.app?.logLevel;\nif (RESOLVED_LOG_LEVEL) {\n setLogLevel(RESOLVED_LOG_LEVEL);\n}\nlogger.debug(\"Setting log level to @level.\", RESOLVED_LOG_LEVEL);\n\n// Normalize the base path to ensure it starts and ends with a forward slash.\nexport const PH_CONNECT_BASE_PATH = normalizeBasePath(\n getDeployBasePath() ?? \"/\",\n);\n\n// Analytics database name — derived deterministically from the base path so\n// instances on different prefixes of one origin do not share an analytics DB.\n// Root resolves to \":analytics\".\nconst PH_CONNECT_ANALYTICS_DATABASE_NAME = `${PH_CONNECT_BASE_PATH.replace(\n /\\//g,\n \"\",\n)}:analytics`;\n\n// The CLOUD section was collapsed into the unified `remote` section. PUBLIC\n// keeps its existing string identifier in the legacy\n// connectConfig.drives.sections map to avoid rippling through downstream UI\n// components — both PUBLIC and the\n// soon-to-be-removed CLOUD readers point at runtime.drives.sections.remote.\nexport const connectConfig = {\n appVersion: env.PH_CONNECT_VERSION,\n studioMode: runtime.app?.studioMode ?? false,\n // Boot-time constant, so it is read straight off the runtime config rather\n // than through the PHGlobalConfig event machinery. Off unless turned on.\n workflowsEnabled: runtime.app?.workflowsEnabled ?? false,\n warnOutdatedApp: phGlobalConfig.warnOutdatedApp,\n appVersionCheckInterval: 60 * 60 * 1000,\n routerBasename: PH_CONNECT_BASE_PATH,\n offline: runtime.app?.offline ?? true,\n aiAssistantEnabled: runtime.ai?.assistantEnabled ?? false,\n externalPackagesEnabled: runtime.packages?.externalEnabled,\n processors: {\n enabled: true,\n externalProcessorsEnabled: true,\n },\n analytics: {\n enabled: true,\n databaseName: PH_CONNECT_ANALYTICS_DATABASE_NAME,\n useWorker: false,\n driveAnalyticsEnabled: env.PH_CONNECT_DRIVE_ANALYTICS_ENABLED,\n diffProcessorEnabled: env.PH_CONNECT_DIFF_ANALYTICS_ENABLED,\n externalProcessorsEnabled: true,\n },\n relational: {\n enabled: true,\n externalProcessorsEnabled: true,\n },\n openPanel: {\n clientId: env.PH_CONNECT_OPENPANEL_CLIENT_ID ?? \"\",\n apiUrl: env.PH_CONNECT_OPENPANEL_API_URL,\n // Intentionally dormant — no call sites gate on this yet; UI-event tracking is future work.\n trackUiEvents: env.PH_CONNECT_OPENPANEL_TRACK_UI_EVENTS,\n trackOperations: env.PH_CONNECT_OPENPANEL_TRACK_OPERATIONS,\n },\n renown: {\n url: runtime.renown?.url,\n networkId: runtime.renown?.networkId,\n chainId: runtime.renown?.chainId,\n namespace: runtime.renown?.namespace,\n switchboardUrl: runtime.renown?.switchboardUrl,\n adapters: runtime.renown?.adapters,\n },\n sentry: {\n release: PH_CONNECT_SENTRY_RELEASE,\n // `dsn: null` (default) means Sentry is disabled — useInitSentry bails.\n dsn: runtime.sentry?.dsn ?? null,\n env: runtime.sentry?.env,\n tracing: runtime.sentry?.tracing ?? false,\n },\n content: {\n showSearchBar: false,\n showDocumentModelSelectionSetting: false,\n },\n drives: {\n addDriveEnabled: runtime.drives?.allowAddDrive,\n preserveStrategy: runtime.drives?.preserveStrategy,\n // The legacy `SharingType` enum still includes a \"CLOUD\" variant.\n // Connect collapsed CLOUD into the unified remote section, so both CLOUD\n // and PUBLIC map to the same `runtime.drives.sections.remote` object —\n // the alias keeps `sections[sharingType]` lookups type-safe for every\n // SharingType value.\n sections: (() => {\n const remote = {\n enabled: runtime.drives?.sections?.remote?.enabled,\n allowAdd: runtime.drives?.sections?.remote?.allowAdd,\n allowDelete: runtime.drives?.sections?.remote?.allowDelete,\n };\n return {\n LOCAL: {\n enabled: runtime.drives?.sections?.local?.enabled,\n allowAdd: runtime.drives?.sections?.local?.allowAdd,\n allowDelete: runtime.drives?.sections?.local?.allowDelete,\n },\n PUBLIC: remote,\n CLOUD: remote,\n };\n })(),\n },\n gaTrackingId: undefined,\n phCliVersion: env.PH_CONNECT_CLI_VERSION,\n} as const;\n"],"names":[],"mappings":";;;;;;;AAkBA,MAAa,MAAM,eAAe,EAChC,YAAY,OAAO,KAAK,KACzB,CAAC;AASF,MAAM,UAAU,kBAAkB,CAAC;AAEnC,SAAS,8BAA8B,UAAkB;AACvD,QAAO,SAAS,SAAS,IAAI,GAAG,WAAW,WAAW;;AASxD,SAAS,oBAAoB;AAC3B,KACE,OAAO,eAAe,eACrB,WAAgD,oBAEjD,QAAO,OAAO,KAAK,IAAI;AAEzB,QAAO,QAAQ,KAAK,YAAY,OAAO,KAAK,IAAI;;AAOlD,SAAS,qBAGP;CACA,MAAM,aAAa,QAAQ,KAAK,cAAc;AAa9C,QAAO;EACL,WAAW,KAAA;EACX,sBAAsB,EAAE;EACxB,sBAAsB;EACtB,0BAA0B;EAC1B,yBAAyB;EACzB,2BAA2B;EAC3B,SAAS,IAAI;EACb,UA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AAQ,QAAQ;EAC3B,SAAS,QAAQ,QAAQ;EACzB,WAAW,QAAQ,QAAQ;EAC3B,gBAAgB,QAAQ,QAAQ;EAChC,UAAU,QAAQ,QAAQ;EAC3B;CACD,QAAQ;EACN,SAAS;EAET,KAAK,QAAQ,QAAQ,OAAO;EAC5B,KAAK,QAAQ,QAAQ;EACrB,SAAS,QAAQ,QAAQ,WAAW;EACrC;CACD,SAAS;EACP,eAAe;EACf,mCAAmC;EACpC;CACD,QAAQ;EACN,iBAAiB,QAAQ,QAAQ;EACjC,kBAAkB,QAAQ,QAAQ;EAMlC,iBAAiB;GACf,MAAM,SAAS;IACb,SAAS,QAAQ,QAAQ,UAAU,QAAQ;IAC3C,UAAU,QAAQ,QAAQ,UAAU,QAAQ;IAC5C,aAAa,QAAQ,QAAQ,UAAU,QAAQ;IAChD;AACD,UAAO;IACL,OAAO;KACL,SAAS,QAAQ,QAAQ,UAAU,OAAO;KAC1C,UAAU,QAAQ,QAAQ,UAAU,OAAO;KAC3C,aAAa,QAAQ,QAAQ,UAAU,OAAO;KAC/C;IACD,QAAQ;IACR,OAAO;IACR;MACC;EACL;CACD,cAAc,KAAA;CACd,cAAc,IAAI;CACnB","debug_id":"403c52f3-f935-584b-b8c9-9a6e2d7485a1"}
1
+ {"version":3,"file":"connect.config-D1mCRtVA.js","sources":["../src/connect.config.ts"],"sourcesContent":["import {\n setLogLevel,\n type PHAppConfig,\n type PHDocumentEditorConfig,\n type PHGlobalConfig,\n} from \"@powerhousedao/reactor-browser\";\nimport type { PHConnectRuntimeConfig } from \"@powerhousedao/shared/clis\";\nimport {\n loadRuntimeEnv,\n normalizeBasePath,\n} from \"@powerhousedao/shared/connect\";\nimport { logger } from \"document-model\";\nimport { getRuntimeConfig } from \"./runtime-config.js\";\n\n// Env vars are reserved for version stamps and analytics processor toggles.\n// Everything in the Connect runtime schema (PHConnectRuntimeConfig) is read\n// from `runtime` below. The Sentry release tag is stamped at build time via\n// Vite's `define` so it always matches the sourcemap upload tag CI used.\nexport const env = loadRuntimeEnv({\n processEnv: import.meta.env,\n});\n\ndeclare const PH_CONNECT_SENTRY_RELEASE: string;\n\n// Runtime fields come from the JSON, not env. start-connect.tsx's top-level\n// await guarantees the loader cache is warm by the time this module\n// evaluates, so getRuntimeConfig() resolves synchronously. The cache merges\n// DEFAULT_CONNECT_CONFIG into whatever the file declared, so every leaf\n// under `runtime.*` is guaranteed defined.\nconst runtime = getRuntimeConfig().connect;\n\nfunction getRouterBasenameFromBasePath(basePath: string) {\n return basePath.endsWith(\"/\") ? basePath : basePath + \"/\";\n}\n\n// Runtime deploy base. In dynamic-base builds the plugin rewrites\n// import.meta.env.BASE_URL to (globalThis.__PH_DYNAMIC_BASE__||\"/\"), the same\n// base assets resolve against; it takes precedence so router basename and\n// path stripping match the served subpath. A baked runtime base path\n// (runtime.app.basePath) only applies to concrete-base builds, where the\n// dynamic global is unset.\nfunction getDeployBasePath() {\n if (\n typeof globalThis !== \"undefined\" &&\n (globalThis as { __PH_DYNAMIC_BASE__?: string }).__PH_DYNAMIC_BASE__\n ) {\n return import.meta.env.BASE_URL;\n }\n return runtime.app?.basePath || import.meta.env.BASE_URL;\n}\n\n// Hardcoded literal defaults for `PHGlobalConfig` fields whose env-var\n// source was removed. The fields stay on the type so wired-but-dead SW /\n// hook consumers keep typechecking; values mirror the previous Zod\n// defaults.\nfunction getBuiltInDefaults(): Omit<\n PHGlobalConfig,\n \"basePath\" | \"routerBasename\"\n> {\n const studioMode = runtime.app?.studioMode ?? false;\n // Drive containers, DocumentModel, and vetra builder-spec types are authored\n // via their own drives — never creatable from a generic drive.\n const disabledEditors = [\n \"powerhouse/document-drive\",\n \"powerhouse/reactor-drive\",\n \"powerhouse/document-model\",\n \"powerhouse/app\",\n \"powerhouse/document-editor\",\n \"powerhouse/processor\",\n \"powerhouse/subgraph\",\n \"powerhouse/package\",\n ];\n return {\n allowList: undefined,\n allowedDocumentTypes: [],\n isDragAndDropEnabled: true,\n isEditorDebugModeEnabled: false,\n isEditorReadModeEnabled: false,\n isExternalControlsEnabled: false,\n version: env.PH_CONNECT_VERSION,\n logLevel: runtime.app?.logLevel,\n requiresHardRefresh: true,\n warnOutdatedApp: true,\n studioMode,\n versionCheckInterval: 60 * 60 * 1000,\n cliVersion: env.PH_CONNECT_CLI_VERSION,\n fileUploadOperationsChunkSize: 50,\n gaTrackingId: undefined,\n defaultDrivesUrl: runtime.drives?.defaultDrives?.find(\n (drive) => \"url\" in drive,\n )?.url,\n drivesPreserveStrategy: runtime.drives?.preserveStrategy,\n enabledEditors: undefined,\n disabledEditors,\n\n /* Processors */\n isExternalProcessorsEnabled: true,\n // Analytics off by default; flip to true (or wire a runtime-config field)\n // when we want analytics enabled out of the box.\n isAnalyticsEnabled: false,\n isAnalyticsExternalProcessorsEnabled:\n env.PH_CONNECT_EXTERNAL_ANALYTICS_PROCESSORS_ENABLED,\n analyticsDatabaseName: undefined,\n isRelationalProcessorsEnabled: true,\n isExternalRelationalProcessorsEnabled: true,\n\n renownUrl: runtime.renown?.url,\n renownNetworkId: runtime.renown?.networkId,\n renownChainId: runtime.renown?.chainId,\n switchboardUrl: runtime.renown?.switchboardUrl,\n renownAdapters: runtime.renown?.adapters,\n sentryRelease: PH_CONNECT_SENTRY_RELEASE,\n sentryDsn: runtime.sentry?.dsn ?? undefined,\n sentryEnv: runtime.sentry?.env,\n isDiffAnalyticsEnabled: env.PH_CONNECT_DIFF_ANALYTICS_ENABLED,\n isDriveAnalyticsEnabled: env.PH_CONNECT_DRIVE_ANALYTICS_ENABLED,\n isPublicDrivesEnabled: runtime.drives?.sections?.remote?.enabled,\n isCloudDrivesEnabled: runtime.drives?.sections?.remote?.enabled ?? true,\n isLocalDrivesEnabled: runtime.drives?.sections?.local?.enabled,\n isSentryTracingEnabled: runtime.sentry?.tracing,\n isDocumentModelSelectionSettingsEnabled: false,\n isAddDriveEnabled: runtime.drives?.allowAddDrive,\n isAddPublicDrivesEnabled: runtime.drives?.sections?.remote?.allowAdd,\n isDeletePublicDrivesEnabled: runtime.drives?.sections?.remote?.allowDelete,\n isAddCloudDrivesEnabled: runtime.drives?.sections?.remote?.allowAdd ?? true,\n isDeleteCloudDrivesEnabled:\n runtime.drives?.sections?.remote?.allowDelete ?? true,\n isAddLocalDrivesEnabled: runtime.drives?.sections?.local?.allowAdd,\n isDeleteLocalDrivesEnabled: runtime.drives?.sections?.local?.allowDelete,\n isAnalyticsDatabaseWorkerEnabled: false,\n isExternalPackagesEnabled: runtime.packages?.externalEnabled,\n };\n}\n\nexport function buildPHGlobalConfig(\n basePath: string,\n routerBasename: string,\n connectFromConfig: PHConnectRuntimeConfig,\n): PHGlobalConfig {\n const defaults = getBuiltInDefaults();\n const fileOverrides: Partial<PHGlobalConfig> = {};\n\n if (connectFromConfig.drives?.allowAddDrive !== undefined) {\n fileOverrides.isAddDriveEnabled = connectFromConfig.drives.allowAddDrive;\n }\n\n return {\n basePath,\n routerBasename,\n ...defaults,\n ...fileOverrides,\n };\n}\n\nfunction getPHGlobalConfigFromRuntime(): PHGlobalConfig {\n // Deploy base wins via getDeployBasePath: the dynamic-base global when set,\n // else runtime.app.basePath (DEFAULT_CONNECT_CONFIG guarantees it defined),\n // with a \"/\" fallback as a defensive guard for typecheck.\n const basePath = getDeployBasePath() ?? \"/\";\n const routerBasename = getRouterBasenameFromBasePath(basePath);\n return buildPHGlobalConfig(basePath, routerBasename, runtime);\n}\n\nexport const phGlobalConfig = getPHGlobalConfigFromRuntime();\n\nexport const defaultPHDocumentEditorConfig: PHDocumentEditorConfig = {\n isExternalControlsEnabled: phGlobalConfig.isExternalControlsEnabled,\n};\n\nexport const defaultPHAppConfig: PHAppConfig = {\n allowedDocumentTypes: phGlobalConfig.allowedDocumentTypes,\n isDragAndDropEnabled: phGlobalConfig.isDragAndDropEnabled,\n};\n\n// Set log level from the runtime config (DEFAULT_CONNECT_CONFIG provides a\n// fallback, so this is always defined).\nconst RESOLVED_LOG_LEVEL = runtime.app?.logLevel;\nif (RESOLVED_LOG_LEVEL) {\n setLogLevel(RESOLVED_LOG_LEVEL);\n}\nlogger.debug(\"Setting log level to @level.\", RESOLVED_LOG_LEVEL);\n\n// Normalize the base path to ensure it starts and ends with a forward slash.\nexport const PH_CONNECT_BASE_PATH = normalizeBasePath(\n getDeployBasePath() ?? \"/\",\n);\n\n// Analytics database name — derived deterministically from the base path so\n// instances on different prefixes of one origin do not share an analytics DB.\n// Root resolves to \":analytics\".\nconst PH_CONNECT_ANALYTICS_DATABASE_NAME = `${PH_CONNECT_BASE_PATH.replace(\n /\\//g,\n \"\",\n)}:analytics`;\n\n// The CLOUD section was collapsed into the unified `remote` section. PUBLIC\n// keeps its existing string identifier in the legacy\n// connectConfig.drives.sections map to avoid rippling through downstream UI\n// components — both PUBLIC and the\n// soon-to-be-removed CLOUD readers point at runtime.drives.sections.remote.\nexport const connectConfig = {\n appVersion: env.PH_CONNECT_VERSION,\n studioMode: runtime.app?.studioMode ?? false,\n // Boot-time constant, so it is read straight off the runtime config rather\n // than through the PHGlobalConfig event machinery. Off unless turned on.\n workflowsEnabled: runtime.app?.workflowsEnabled ?? false,\n warnOutdatedApp: phGlobalConfig.warnOutdatedApp,\n appVersionCheckInterval: 60 * 60 * 1000,\n routerBasename: PH_CONNECT_BASE_PATH,\n offline: runtime.app?.offline ?? true,\n aiAssistantEnabled: runtime.ai?.assistantEnabled ?? false,\n externalPackagesEnabled: runtime.packages?.externalEnabled,\n processors: {\n enabled: true,\n externalProcessorsEnabled: true,\n },\n analytics: {\n enabled: true,\n databaseName: PH_CONNECT_ANALYTICS_DATABASE_NAME,\n useWorker: false,\n driveAnalyticsEnabled: env.PH_CONNECT_DRIVE_ANALYTICS_ENABLED,\n diffProcessorEnabled: env.PH_CONNECT_DIFF_ANALYTICS_ENABLED,\n externalProcessorsEnabled: true,\n },\n relational: {\n enabled: true,\n externalProcessorsEnabled: true,\n },\n openPanel: {\n clientId: env.PH_CONNECT_OPENPANEL_CLIENT_ID ?? \"\",\n apiUrl: env.PH_CONNECT_OPENPANEL_API_URL,\n // Intentionally dormant — no call sites gate on this yet; UI-event tracking is future work.\n trackUiEvents: env.PH_CONNECT_OPENPANEL_TRACK_UI_EVENTS,\n trackOperations: env.PH_CONNECT_OPENPANEL_TRACK_OPERATIONS,\n },\n renown: {\n url: runtime.renown?.url,\n networkId: runtime.renown?.networkId,\n chainId: runtime.renown?.chainId,\n namespace: runtime.renown?.namespace,\n switchboardUrl: runtime.renown?.switchboardUrl,\n adapters: runtime.renown?.adapters,\n },\n sentry: {\n release: PH_CONNECT_SENTRY_RELEASE,\n // `dsn: null` (default) means Sentry is disabled — useInitSentry bails.\n dsn: runtime.sentry?.dsn ?? null,\n env: runtime.sentry?.env,\n tracing: runtime.sentry?.tracing ?? false,\n },\n content: {\n showSearchBar: false,\n showDocumentModelSelectionSetting: false,\n },\n drives: {\n addDriveEnabled: runtime.drives?.allowAddDrive,\n preserveStrategy: runtime.drives?.preserveStrategy,\n // The legacy `SharingType` enum still includes a \"CLOUD\" variant.\n // Connect collapsed CLOUD into the unified remote section, so both CLOUD\n // and PUBLIC map to the same `runtime.drives.sections.remote` object —\n // the alias keeps `sections[sharingType]` lookups type-safe for every\n // SharingType value.\n sections: (() => {\n const remote = {\n enabled: runtime.drives?.sections?.remote?.enabled,\n allowAdd: runtime.drives?.sections?.remote?.allowAdd,\n allowDelete: runtime.drives?.sections?.remote?.allowDelete,\n };\n return {\n LOCAL: {\n enabled: runtime.drives?.sections?.local?.enabled,\n allowAdd: runtime.drives?.sections?.local?.allowAdd,\n allowDelete: runtime.drives?.sections?.local?.allowDelete,\n },\n PUBLIC: remote,\n CLOUD: remote,\n };\n })(),\n },\n gaTrackingId: undefined,\n phCliVersion: env.PH_CONNECT_CLI_VERSION,\n} as const;\n"],"names":[],"mappings":";;;;;;;AAkBA,MAAa,MAAM,eAAe,EAChC,YAAY,OAAO,KAAK,KACzB,CAAC;AASF,MAAM,UAAU,kBAAkB,CAAC;AAEnC,SAAS,8BAA8B,UAAkB;AACvD,Q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global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="2834a590-1adc-54e5-af9a-33770bdfcc6b")}catch(e){}}();
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]="cbeb9009-c18e-558a-bf2a-8fc137148a30")}catch(e){}}();
3
3
  import { n as getRuntimeConfig } from "./runtime-config-DL3QjcfM.js";
4
- import { n as isMigratableMajor, t as coerceMajor, u as readPgVersionFile } from "./pglite-major-D3sdYMs2.js";
5
- import { t as PH_CONNECT_BASE_PATH } from "./connect.config-BofwIsWJ.js";
4
+ import { n as isMigratableMajor, t as coerceMajor, u as readPgVersionFile } from "./pglite-major-u7qHLpXj.js";
5
+ import { t as PH_CONNECT_BASE_PATH } from "./connect.config-D1mCRtVA.js";
6
6
  import { ROOT_STORAGE_NAMESPACE, getStorageNamespace } from "@powerhousedao/shared/connect";
7
7
  import { DEFAULT_RELATIONAL_PROCESSOR_DB_NAME, hashNamespace } from "@powerhousedao/shared/processors";
8
8
  //#region src/utils/reactor-namespace.ts
@@ -122,5 +122,5 @@ function subscribeWorkerConnection(listener) {
122
122
  //#endregion
123
123
  export { detectReactorPgMajor as a, getCachedReactorPgMajor as c, subscribeReactorPgMajor as d, PRIMARY_IDB_NAMES as f, RELATIONAL_PGLITE_NAME as h, detectMigrationMajor as i, invalidateReactorPgMajorCache as l, REACTOR_PGLITE_NAME as m, setWorkerConnectionStatus as n, detectRelationalPgMajor as o, REACTOR_INSTANCE_NAMESPACE as p, subscribeWorkerConnection as r, getCachedMigrationMajor as s, getWorkerConnectionStatus as t, subscribeMigrationMajor as u };
124
124
 
125
- //# sourceMappingURL=connection-state-DAqW06pk.js.map
126
- //# debugId=2834a590-1adc-54e5-af9a-33770bdfcc6b
125
+ //# sourceMappingURL=connection-state-oYbhN61I.js.map
126
+ //# debugId=cbeb9009-c18e-558a-bf2a-8fc137148a30
@@ -1 +1 @@
1
- {"version":3,"file":"connection-state-DAqW06pk.js","sources":["../src/utils/reactor-namespace.ts","../src/utils/storage-namespace.ts","../src/utils/pglite-runtime.ts","../src/connection-state.ts"],"sourcesContent":["import { getStorageNamespace } from \"@powerhousedao/shared/connect\";\nimport { hashNamespace } from \"@powerhousedao/shared/processors\";\n\nexport type ReactorNamespaceInput = {\n basePath: string;\n explicit?: string;\n endpoint?: string;\n};\n\nexport function resolveReactorNamespace(input: ReactorNamespaceInput): string {\n const explicit = input.explicit?.trim();\n if (explicit) {\n return explicit;\n }\n const base = getStorageNamespace(input.basePath);\n const endpoint = input.endpoint?.trim();\n if (endpoint) {\n return `${base}--${hashNamespace(endpoint, 8)}`;\n }\n return base;\n}\n","import { DEFAULT_RELATIONAL_PROCESSOR_DB_NAME } from \"@powerhousedao/shared/processors\";\nimport { ROOT_STORAGE_NAMESPACE } from \"@powerhousedao/shared/connect\";\nimport { PH_CONNECT_BASE_PATH } from \"../connect.config.js\";\nimport { getRuntimeConfig } from \"../runtime-config.js\";\nimport { resolveReactorNamespace } from \"./reactor-namespace.js\";\n\nexport const REACTOR_INSTANCE_NAMESPACE = resolveReactorNamespace({\n basePath: PH_CONNECT_BASE_PATH,\n explicit: getRuntimeConfig().connect.instance?.namespace ?? undefined,\n});\n\nexport const REACTOR_PGLITE_NAME = REACTOR_INSTANCE_NAMESPACE;\n\nexport const RELATIONAL_PGLITE_NAME =\n REACTOR_INSTANCE_NAMESPACE === ROOT_STORAGE_NAMESPACE\n ? DEFAULT_RELATIONAL_PROCESSOR_DB_NAME\n : `${REACTOR_INSTANCE_NAMESPACE}-${DEFAULT_RELATIONAL_PROCESSOR_DB_NAME}`;\n\n// Here, not pglite-idb.ts, so those IDB helpers stay free of runtime-config\n// and remain importable by the reactor SharedWorker.\nexport const REACTOR_IDB_NAME = `/pglite/${REACTOR_PGLITE_NAME}`;\nexport const RELATIONAL_IDB_NAME = `/pglite/${RELATIONAL_PGLITE_NAME}`;\nexport const PRIMARY_IDB_NAMES = [\n REACTOR_IDB_NAME,\n RELATIONAL_IDB_NAME,\n] as const;\n","import { readPgVersionFile } from \"./pglite-idb.js\";\nimport {\n coerceMajor,\n isMigratableMajor,\n type DetectedMajor,\n} from \"./pglite-major.js\";\nimport { REACTOR_IDB_NAME, RELATIONAL_IDB_NAME } from \"./storage-namespace.js\";\n\nexport {\n CURRENT_PG_MAJOR,\n SUPPORTED_PG_MAJORS,\n coerceMajor,\n resolvePgMajorForRuntime,\n loadPGliteModule,\n loadPgDump,\n type SupportedPgMajor,\n type DetectedMajor,\n} from \"./pglite-major.js\";\n\nlet cachedReactorMajor: DetectedMajor | undefined;\nlet inflight: Promise<DetectedMajor> | undefined;\nconst majorListeners = new Set<() => void>();\n\nlet cachedMigrationMajor: DetectedMajor | undefined;\nlet migrationInflight: Promise<DetectedMajor> | undefined;\nconst migrationListeners = new Set<() => void>();\n\nfunction notifyMajorChanged() {\n for (const l of majorListeners) l();\n}\n\nfunction notifyMigrationChanged() {\n for (const l of migrationListeners) l();\n}\n\nexport function subscribeReactorPgMajor(cb: () => void): () => void {\n majorListeners.add(cb);\n return () => {\n majorListeners.delete(cb);\n };\n}\n\nexport async function detectReactorPgMajor(): Promise<DetectedMajor> {\n if (cachedReactorMajor !== undefined) return cachedReactorMajor;\n if (inflight) return inflight;\n\n inflight = (async () => {\n const major = coerceMajor(await readPgVersionFile(REACTOR_IDB_NAME));\n cachedReactorMajor = major;\n notifyMajorChanged();\n return major;\n })();\n try {\n return await inflight;\n } finally {\n inflight = undefined;\n }\n}\n\nexport function getCachedReactorPgMajor(): DetectedMajor | undefined {\n return cachedReactorMajor;\n}\n\nexport function invalidateReactorPgMajorCache(): void {\n cachedReactorMajor = undefined;\n cachedMigrationMajor = undefined;\n notifyMajorChanged();\n notifyMigrationChanged();\n}\n\nexport async function detectRelationalPgMajor(): Promise<DetectedMajor> {\n return coerceMajor(await readPgVersionFile(RELATIONAL_IDB_NAME));\n}\n\nexport function subscribeMigrationMajor(cb: () => void): () => void {\n migrationListeners.add(cb);\n return () => {\n migrationListeners.delete(cb);\n };\n}\n\nexport function getCachedMigrationMajor(): DetectedMajor | undefined {\n return cachedMigrationMajor;\n}\n\n/**\n * Legacy major the migration banner should prompt for: the first primary store\n * (reactor or relational) on a supported, non-current major. Spans both stores\n * to match migrateAllIfNeeded.\n */\nexport async function detectMigrationMajor(): Promise<DetectedMajor> {\n if (cachedMigrationMajor !== undefined) return cachedMigrationMajor;\n if (migrationInflight) return migrationInflight;\n\n migrationInflight = (async () => {\n const majors = await Promise.all([\n readPgVersionFile(REACTOR_IDB_NAME),\n readPgVersionFile(RELATIONAL_IDB_NAME),\n ]);\n const legacy = majors.find(isMigratableMajor) ?? null;\n cachedMigrationMajor = legacy;\n notifyMigrationChanged();\n return legacy;\n })();\n try {\n return await migrationInflight;\n } finally {\n migrationInflight = undefined;\n }\n}\n","export type WorkerConnectionStatus = \"connected\" | \"lost\";\n\nlet status: WorkerConnectionStatus = \"connected\";\nconst listeners = new Set<() => void>();\n\nexport function getWorkerConnectionStatus(): WorkerConnectionStatus {\n return status;\n}\n\nexport function setWorkerConnectionStatus(next: WorkerConnectionStatus): void {\n if (status === next) {\n return;\n }\n status = next;\n for (const listener of [...listeners]) {\n listener();\n }\n}\n\nexport function subscribeWorkerConnection(listener: () => void): () => void {\n listeners.add(listener);\n return () => {\n listeners.delete(listener);\n };\n}\n"],"names":[],"mappings":";;;;;;;;AASA,SAAgB,wBAAwB,OAAsC;CAC5E,MAAM,WAAW,MAAM,UAAU,MAAM;AACvC,KAAI,SACF,QAAO;CAET,MAAM,OAAO,oBAAoB,MAAM,SAAS;CAChD,MAAM,WAAW,MAAM,UAAU,MAAM;AACvC,KAAI,SACF,QAAO,GAAG,KAAK,IAAI,cAAc,UAAU,EAAE;AAE/C,QAAO;;;;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C;AACnE,KAAI,yBAAyB,KAAA,EAAW,QAAO;AAC/C,KAAI,kBAAmB,QAAO;AAE9B,sBAAqB,YAAY;EAK/B,MAAM,UAJS,MAAM,QAAQ,IAAI,CAC/B,kBAAkB,iBAAiB,EACnC,kBAAkB,oBAAoB,CACvC,CAAC,EACoB,KAAK,kBAAkB,IAAI;AACjD,yBAAuB;AACvB,0BAAwB;AACxB,SAAO;KACL;AACJ,KAAI;AACF,SAAO,MAAM;WACL;AACR,sBAAoB,KAAA;;;;;ACzGxB,IAAI,SAAiC;AACrC,MAAM,4BAAY,IAAI,KAAiB;AAEvC,SAAgB,4BAAoD;AAClE,QAAO;;AAGT,SAAgB,0BAA0B,MAAoC;AAC5E,KAAI,WAAW,KACb;AAEF,UAAS;AACT,MAAK,MAAM,YAAY,CAAC,GAAG,UAAU,CACnC,WAAU;;AAId,SAAgB,0BAA0B,UAAkC;AAC1E,WAAU,IAAI,SAAS;AACvB,cAAa;AACX,YAAU,OAAO,SAAS","debug_id":"2834a590-1adc-54e5-af9a-33770bdfcc6b"}
1
+ {"version":3,"file":"connection-state-oYbhN61I.js","sources":["../src/utils/reactor-namespace.ts","../src/utils/storage-namespace.ts","../src/utils/pglite-runtime.ts","../src/connection-state.ts"],"sourcesContent":["import { getStorageNamespace } from \"@powerhousedao/shared/connect\";\nimport { hashNamespace } from \"@powerhousedao/shared/processors\";\n\nexport type ReactorNamespaceInput = {\n basePath: string;\n explicit?: string;\n endpoint?: string;\n};\n\nexport function resolveReactorNamespace(input: ReactorNamespaceInput): string {\n const explicit = input.explicit?.trim();\n if (explicit) {\n return explicit;\n }\n const base = getStorageNamespace(input.basePath);\n const endpoint = input.endpoint?.trim();\n if (endpoint) {\n return `${base}--${hashNamespace(endpoint, 8)}`;\n }\n return base;\n}\n","import { DEFAULT_RELATIONAL_PROCESSOR_DB_NAME } from \"@powerhousedao/shared/processors\";\nimport { ROOT_STORAGE_NAMESPACE } from \"@powerhousedao/shared/connect\";\nimport { PH_CONNECT_BASE_PATH } from \"../connect.config.js\";\nimport { getRuntimeConfig } from \"../runtime-config.js\";\nimport { resolveReactorNamespace } from \"./reactor-namespace.js\";\n\nexport const REACTOR_INSTANCE_NAMESPACE = resolveReactorNamespace({\n basePath: PH_CONNECT_BASE_PATH,\n explicit: getRuntimeConfig().connect.instance?.namespace ?? undefined,\n});\n\nexport const REACTOR_PGLITE_NAME = REACTOR_INSTANCE_NAMESPACE;\n\nexport const RELATIONAL_PGLITE_NAME =\n REACTOR_INSTANCE_NAMESPACE === ROOT_STORAGE_NAMESPACE\n ? DEFAULT_RELATIONAL_PROCESSOR_DB_NAME\n : `${REACTOR_INSTANCE_NAMESPACE}-${DEFAULT_RELATIONAL_PROCESSOR_DB_NAME}`;\n\n// Here, not pglite-idb.ts, so those IDB helpers stay free of runtime-config\n// and remain importable by the reactor SharedWorker.\nexport const REACTOR_IDB_NAME = `/pglite/${REACTOR_PGLITE_NAME}`;\nexport const RELATIONAL_IDB_NAME = `/pglite/${RELATIONAL_PGLITE_NAME}`;\nexport const PRIMARY_IDB_NAMES = [\n REACTOR_IDB_NAME,\n RELATIONAL_IDB_NAME,\n] as const;\n","import { readPgVersionFile } from \"./pglite-idb.js\";\nimport {\n coerceMajor,\n isMigratableMajor,\n type DetectedMajor,\n} from \"./pglite-major.js\";\nimport { REACTOR_IDB_NAME, RELATIONAL_IDB_NAME } from \"./storage-namespace.js\";\n\nexport {\n CURRENT_PG_MAJOR,\n SUPPORTED_PG_MAJORS,\n coerceMajor,\n resolvePgMajorForRuntime,\n loadPGliteModule,\n loadPgDump,\n type SupportedPgMajor,\n type DetectedMajor,\n} from \"./pglite-major.js\";\n\nlet cachedReactorMajor: DetectedMajor | undefined;\nlet inflight: Promise<DetectedMajor> | undefined;\nconst majorListeners = new Set<() => void>();\n\nlet cachedMigrationMajor: DetectedMajor | undefined;\nlet migrationInflight: Promise<DetectedMajor> | undefined;\nconst migrationListeners = new Set<() => void>();\n\nfunction notifyMajorChanged() {\n for (const l of majorListeners) l();\n}\n\nfunction notifyMigrationChanged() {\n for (const l of migrationListeners) l();\n}\n\nexport function subscribeReactorPgMajor(cb: () => void): () => void {\n majorListeners.add(cb);\n return () => {\n majorListeners.delete(cb);\n };\n}\n\nexport async function detectReactorPgMajor(): Promise<DetectedMajor> {\n if (cachedReactorMajor !== undefined) return cachedReactorMajor;\n if (inflight) return inflight;\n\n inflight = (async () => {\n const major = coerceMajor(await readPgVersionFile(REACTOR_IDB_NAME));\n cachedReactorMajor = major;\n notifyMajorChanged();\n return major;\n })();\n try {\n return await inflight;\n } finally {\n inflight = undefined;\n }\n}\n\nexport function getCachedReactorPgMajor(): DetectedMajor | undefined {\n return cachedReactorMajor;\n}\n\nexport function invalidateReactorPgMajorCache(): void {\n cachedReactorMajor = undefined;\n cachedMigrationMajor = undefined;\n notifyMajorChanged();\n notifyMigrationChanged();\n}\n\nexport async function detectRelationalPgMajor(): Promise<DetectedMajor> {\n return coerceMajor(await readPgVersionFile(RELATIONAL_IDB_NAME));\n}\n\nexport function subscribeMigrationMajor(cb: () => void): () => void {\n migrationListeners.add(cb);\n return () => {\n migrationListeners.delete(cb);\n };\n}\n\nexport function getCachedMigrationMajor(): DetectedMajor | undefined {\n return cachedMigrationMajor;\n}\n\n/**\n * Legacy major the migration banner should prompt for: the first primary store\n * (reactor or relational) on a supported, non-current major. Spans both stores\n * to match migrateAllIfNeeded.\n */\nexport async function detectMigrationMajor(): Promise<DetectedMajor> {\n if (cachedMigrationMajor !== undefined) return cachedMigrationMajor;\n if (migrationInflight) return migrationInflight;\n\n migrationInflight = (async () => {\n const majors = await Promise.all([\n readPgVersionFile(REACTOR_IDB_NAME),\n readPgVersionFile(RELATIONAL_IDB_NAME),\n ]);\n const legacy = majors.find(isMigratableMajor) ?? null;\n cachedMigrationMajor = legacy;\n notifyMigrationChanged();\n return legacy;\n })();\n try {\n return await migrationInflight;\n } finally {\n migrationInflight = undefined;\n }\n}\n","export type WorkerConnectionStatus = \"connected\" | \"lost\";\n\nlet status: WorkerConnectionStatus = \"connected\";\nconst listeners = new Set<() => void>();\n\nexport function getWorkerConnectionStatus(): WorkerConnectionStatus {\n return status;\n}\n\nexport function setWorkerConnectionStatus(next: WorkerConnectionStatus): void {\n if (status === next) {\n return;\n }\n status = next;\n for (const listener of [...listeners]) {\n listener();\n }\n}\n\nexport function subscribeWorkerConnection(listener: () => void): () => void {\n listeners.add(listener);\n return () => {\n listeners.delete(listener);\n };\n}\n"],"names":[],"mappings":";;;;;;;;AASA,SAAgB,wBAAwB,OAAsC;CAC5E,MAAM,WAAW,MAAM,UAAU,MAAM;AACvC,KAAI,SACF,QAAO;CAET,MAAM,OAAO,oBAAoB,MAAM,SAAS;CAChD,MAAM,WAAW,MAAM,UAAU,MAAM;AACvC,KAAI,SACF,QAAO,GAAG,KAAK,IAAI,cAAc,UAAU,EAAE;AAE/C,QAAO;;;;ACbT,MAAa,6BAA6B,wBAAwB;CAChE,UAAU;CACV,UAAU,kBAAkB,CAAC,QAAQ,UAAU,aAAa,KAAA;CAC7D,CAAC;AAEF,MAAa,sBAAsB;AAEnC,MAAa,yBACX,+BAA+B,yBAC3B,uCACA,GAAG,2BAA2B,GAAG;AAIvC,MAAa,mBAAmB,WAAW;AAC3C,MAAa,sBAAsB,WAAW;AAC9C,MAAa,oBAAoB,CAC/B,kBACA,oBACD;;;ACND,IAAI;AACJ,IAAI;AACJ,MAAM,iCAAiB,IAAI,KAAiB;AAE5C,IAAI;AACJ,IAAI;AACJ,MAAM,qCAAqB,IAAI,KAAiB;AAEhD,SAAS,qBAAqB;AAC5B,MAAK,MAAM,KAAK,eAAgB,IAAG;;AAGrC,SAAS,yBAAyB;AAChC,MAAK,MAAM,KAAK,mBAAoB,IAAG;;AAGzC,SAAgB,wBAAwB,IAA4B;AAClE,gBAAe,IAAI,GAAG;AACtB,cAAa;AACX,iBAAe,OAAO,GAAG;;;AAI7B,eAAsB,uBAA+C;AACnE,KAAI,uBAAuB,KAAA,EAAW,QAAO;AAC7C,KAAI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){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]="fa3623af-f876-5786-bd60-ed7b5bb30a6a")}catch(e){}}();
3
- import { t as i18n } from "./i18n-90Q8hAPL.js";
4
- import { n as useAcceptedCookies, r as useCookieBanner } from "./preferences-store-Coa1SHvi.js";
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]="dab925e3-28f0-5630-be5e-440bb3c5c3b7")}catch(e){}}();
3
+ import { t as i18n } from "./i18n-BlC8tGho.js";
4
+ import { n as useAcceptedCookies, r as useCookieBanner } from "./preferences-store-CtKCuHwO.js";
5
5
  import { jsx, jsxs } from "react/jsx-runtime";
6
6
  import { Trans, useTranslation } from "react-i18next";
7
7
  import { CookieBanner as CookieBanner$1 } from "@powerhousedao/design-system/connect";
@@ -66,5 +66,5 @@ const CookieBanner = () => {
66
66
  //#endregion
67
67
  export { CookieBanner };
68
68
 
69
- //# sourceMappingURL=cookie-banner-BQescTYk.js.map
70
- //# debugId=fa3623af-f876-5786-bd60-ed7b5bb30a6a
69
+ //# sourceMappingURL=cookie-banner-DKzkT2wu.js.map
70
+ //# debugId=dab925e3-28f0-5630-be5e-440bb3c5c3b7
@@ -1 +1 @@
1
- {"version":3,"file":"cookie-banner-BQescTYk.js","sources":["../src/components/cookie-banner.tsx"],"sourcesContent":["import {\n useAcceptedCookies,\n useCookieBanner,\n} from \"../hooks/preferences-store.js\";\nimport type { CookieInput } from \"@powerhousedao/design-system/connect\";\nimport { CookieBanner as PHCookieBanner } from \"@powerhousedao/design-system/connect\";\nimport { showPHModal } from \"@powerhousedao/reactor-browser\";\nimport { Trans, useTranslation } from \"react-i18next\";\nimport { i18n } from \"@powerhousedao/connect/i18n\";\n\nconst isCookieAccepted = (cookies: CookieInput[], id: string) => {\n return cookies.some((cookie) => cookie.id === id && cookie.value);\n};\n\nexport const CookieBanner = () => {\n const { t } = useTranslation(undefined, {\n useSuspense: true,\n i18n,\n });\n const [showBanner, setShowBanner] = useCookieBanner();\n const [, setAcceptedCookies] = useAcceptedCookies();\n\n const cookiesInput: CookieInput[] = [\n {\n id: \"analytics-cookie\",\n label: t(\"cookieBanner.cookies.analytics\"),\n value: true,\n },\n ];\n\n const handleAccept = (cookies: CookieInput[]) => {\n setShowBanner(false);\n\n if (isCookieAccepted(cookies, \"analytics-cookie\")) {\n setAcceptedCookies((acceptedCookies) => ({\n ...acceptedCookies,\n analytics: true,\n }));\n }\n };\n\n const handleReject = () => {\n setShowBanner(false);\n setAcceptedCookies(() => ({\n analytics: false,\n functional: false,\n marketing: false,\n }));\n };\n\n if (!showBanner) {\n return null;\n }\n\n return (\n <div className=\"absolute inset-0 z-10000 backdrop-blur-sm\">\n <div className=\"absolute inset-0 bg-primary opacity-15\" />\n <div className=\"absolute inset-x-0 bottom-0 flex justify-center bg-background px-10 pt-10 pb-16 shadow-lg\">\n <PHCookieBanner\n className=\"max-w-[1024px]\"\n cookies={cookiesInput}\n onSubmit={handleAccept}\n onReject={handleReject}\n submitLabel={t(\"cookieBanner.accept\")}\n rejectLabel={t(\"cookieBanner.reject\")}\n >\n <p className=\"font-semibold text-muted-foreground\">\n <Trans\n key={\"cookieBanner.message\"}\n i18nKey=\"cookieBanner.message\"\n components={{\n a: (\n <a\n onClick={() => showPHModal({ type: \"cookiesPolicy\" })}\n key={\"cookieBanner.message-link\"}\n className=\"cursor-pointer text-foreground hover:underline\"\n />\n ),\n }}\n />\n </p>\n </PHCookieBanner>\n </div>\n </div>\n );\n};\n"],"names":["PHCookieBanner"],"mappings":";;;;;;;;;AAUA,MAAM,oBAAoB,SAAwB,OAAe;AAC/D,QAAO,QAAQ,MAAM,WAAW,OAAO,OAAO,MAAM,OAAO,MAAM;;AAGnE,MAAa,qBAAqB;CAChC,MAAM,EAAE,MAAM,eAAe,KAAA,GAAW;EACtC,aAAa;EACb;EACD,CAAC;CACF,MAAM,CAAC,YAAY,iBAAiB,iBAAiB;CACrD,MAAM,GAAG,sBAAsB,oBAAoB;CAEnD,MAAM,eAA8B,CAClC;EACE,IAAI;EACJ,OAAO,EAAE,iCAAiC;EAC1C,OAAO;EACR,CACF;CAED,MAAM,gBAAgB,YAA2B;AAC/C,gBAAc,MAAM;AAEpB,MAAI,iBAAiB,SAAS,mBAAmB,CAC/C,qBAAoB,qBAAqB;GACvC,GAAG;GACH,WAAW;GACZ,EAAE;;CAIP,MAAM,qBAAqB;AACzB,gBAAc,MAAM;AACpB,4BAA0B;GACxB,WAAW;GACX,YAAY;GACZ,WAAW;GACZ,EAAE;;AAGL,KAAI,CAAC,WACH,QAAO;AAGT,QACE,qBAAC,OAAD;EAAK,WAAU;YAAf,CACE,oBAAC,OAAD,EAAK,WAAU,0CAA2C,CAAA,EAC1D,oBAAC,OAAD;GAAK,WAAU;aACb,oBAACA,gBAAD;IACE,WAAU;IACV,SAAS;IACT,UAAU;IACV,UAAU;IACV,aAAa,EAAE,sBAAsB;IACrC,aAAa,EAAE,sBAAsB;cAErC,oBAAC,KAAD;KAAG,WAAU;eACX,oBAAC,OAAD;MAEE,SAAQ;MACR,YAAY,EACV,GACE,oBAAC,KAAD;OACE,eAAe,YAAY,EAAE,MAAM,iBAAiB,CAAC;OAErD,WAAU;OACV,EAFK,4BAEL,EAEL;MACD,EAXK,uBAWL;KACA,CAAA;IACW,CAAA;GACb,CAAA,CACF","debug_id":"fa3623af-f876-5786-bd60-ed7b5bb30a6a"}
1
+ {"version":3,"file":"cookie-banner-DKzkT2wu.js","sources":["../src/components/cookie-banner.tsx"],"sourcesContent":["import {\n useAcceptedCookies,\n useCookieBanner,\n} from \"../hooks/preferences-store.js\";\nimport type { CookieInput } from \"@powerhousedao/design-system/connect\";\nimport { CookieBanner as PHCookieBanner } from \"@powerhousedao/design-system/connect\";\nimport { showPHModal } from \"@powerhousedao/reactor-browser\";\nimport { Trans, useTranslation } from \"react-i18next\";\nimport { i18n } from \"@powerhousedao/connect/i18n\";\n\nconst isCookieAccepted = (cookies: CookieInput[], id: string) => {\n return cookies.some((cookie) => cookie.id === id && cookie.value);\n};\n\nexport const CookieBanner = () => {\n const { t } = useTranslation(undefined, {\n useSuspense: true,\n i18n,\n });\n const [showBanner, setShowBanner] = useCookieBanner();\n const [, setAcceptedCookies] = useAcceptedCookies();\n\n const cookiesInput: CookieInput[] = [\n {\n id: \"analytics-cookie\",\n label: t(\"cookieBanner.cookies.analytics\"),\n value: true,\n },\n ];\n\n const handleAccept = (cookies: CookieInput[]) => {\n setShowBanner(false);\n\n if (isCookieAccepted(cookies, \"analytics-cookie\")) {\n setAcceptedCookies((acceptedCookies) => ({\n ...acceptedCookies,\n analytics: true,\n }));\n }\n };\n\n const handleReject = () => {\n setShowBanner(false);\n setAcceptedCookies(() => ({\n analytics: false,\n functional: false,\n marketing: false,\n }));\n };\n\n if (!showBanner) {\n return null;\n }\n\n return (\n <div className=\"absolute inset-0 z-10000 backdrop-blur-sm\">\n <div className=\"absolute inset-0 bg-primary opacity-15\" />\n <div className=\"absolute inset-x-0 bottom-0 flex justify-center bg-background px-10 pt-10 pb-16 shadow-lg\">\n <PHCookieBanner\n className=\"max-w-[1024px]\"\n cookies={cookiesInput}\n onSubmit={handleAccept}\n onReject={handleReject}\n submitLabel={t(\"cookieBanner.accept\")}\n rejectLabel={t(\"cookieBanner.reject\")}\n >\n <p className=\"font-semibold text-muted-foreground\">\n <Trans\n key={\"cookieBanner.message\"}\n i18nKey=\"cookieBanner.message\"\n components={{\n a: (\n <a\n onClick={() => showPHModal({ type: \"cookiesPolicy\" })}\n key={\"cookieBanner.message-link\"}\n className=\"cursor-pointer text-foreground hover:underline\"\n />\n ),\n }}\n />\n </p>\n </PHCookieBanner>\n </div>\n </div>\n );\n};\n"],"names":["PHCookieBanner"],"mappings":";;;;;;;;;AAUA,MAAM,oBAAoB,SAAwB,OAAe;AAC/D,QAAO,QAAQ,MAAM,WAAW,OAAO,OAAO,MAAM,OAAO,MAAM;;AAGnE,MAAa,qBAAqB;CAChC,MAAM,EAAE,MAAM,eAAe,KAAA,GAAW;EACtC,aAAa;EACb;EACD,CAAC;CACF,MAAM,CAAC,YAAY,iBAAiB,iBAAiB;CACrD,MAAM,GAAG,sBAAsB,oBAAoB;CAEnD,MAAM,eAA8B,CAClC;EACE,IAAI;EACJ,OAAO,EAAE,iCAAiC;EAC1C,OAAO;EACR,CACF;CAED,MAAM,gBAAgB,YAA2B;AAC/C,gBAAc,MAAM;AAEpB,MAAI,iBAAiB,SAAS,mBAAmB,CAC/C,qBAAoB,qBAAqB;GACvC,GAAG;GACH,WAAW;GACZ,EAAE;;CAIP,MAAM,qBAAqB;AACzB,gBAAc,MAAM;AACpB,4BAA0B;GACxB,WAAW;GACX,YAAY;GACZ,WAAW;GACZ,EAAE;;AAGL,KAAI,CAAC,WACH,QAAO;AAGT,QACE,qBAAC,OAAD;EAAK,WAAU;YAAf,CACE,oBAAC,OAAD,EAAK,WAAU,0CAA2C,CAAA,EAC1D,oBAAC,OAAD;GAAK,WAAU;aACb,oBAACA,gBAAD;IACE,WAAU;IACV,SAAS;IACT,UAAU;IACV,UAAU;IACV,aAAa,EAAE,sBAAsB;IACrC,aAAa,EAAE,sBAAsB;cAErC,oBAAC,KAAD;KAAG,WAAU;eACX,oBAAC,OAAD;MAEE,SAAQ;MACR,YAAY,EACV,GACE,oBAAC,KAAD;OACE,eAAe,YAAY,EAAE,MAAM,iBAAiB,CAAC;OAErD,WAAU;OACV,EAFK,4BAEL,EAEL;MACD,EAXK,uBAWL;KACA,CAAA;IACW,CAAA;GACb,CAAA,CACF","debug_id":"dab925e3-28f0-5630-be5e-440bb3c5c3b7"}
@@ -1,5 +1,5 @@
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]="f073cd62-bc06-5961-9165-7e1788631a8f")}catch(e){}}();
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]="fbcfeaf8-4cd1-518a-943e-564981a0f951")}catch(e){}}();
3
3
  import i18n from "i18next";
4
4
  import { initReactI18next } from "react-i18next";
5
5
  i18n.use(initReactI18next).init({
@@ -140,5 +140,5 @@ i18n.use(initReactI18next).init({
140
140
  //#endregion
141
141
  export { i18n as t };
142
142
 
143
- //# sourceMappingURL=i18n-90Q8hAPL.js.map
144
- //# debugId=f073cd62-bc06-5961-9165-7e1788631a8f
143
+ //# sourceMappingURL=i18n-BlC8tGho.js.map
144
+ //# debugId=fbcfeaf8-4cd1-518a-943e-564981a0f951
@@ -1 +1 @@
1
- {"version":3,"file":"i18n-90Q8hAPL.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,iBAAiB,CACrB,KAAK;CACJ,WAXwB,EAC1B,IAAI;EACF,MAAM;EACN,MAAM;EACN;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EACD,EACF;CAMG,aAAa;CACb,OAAO;CACP,eAAe,EACb,aAAa,OACd;CACF,CAAC,CACD,OAAO,MAAe;AACrB,SAAQ,MAAM,EAAE;EAChB","debug_id":"f073cd62-bc06-5961-9165-7e1788631a8f"}
1
+ {"version":3,"file":"i18n-BlC8tGho.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,iBAAiB,CACrB,KAAK;CACJ,WAXwB,EAC1B,IAAI;EACF,MAAM;EACN,MAAM;EACN;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EACD,EACF;CAMG,aAAa;CACb,OAAO;CACP,eAAe,EACb,aAAa,OACd;CACF,CAAC,CACD,OAAO,MAAe;AACrB,SAAQ,MAAM,EAAE;EAChB","debug_id":"fbcfeaf8-4cd1-518a-943e-564981a0f951"}
@@ -1,12 +1,12 @@
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]="ceae5cd4-39f1-5f75-b820-498726425b7b")}catch(e){}}();
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]="3e02293b-9520-5e3a-916f-1391948c188b")}catch(e){}}();
3
3
  import { r as loadRuntimeConfig, t as applyConnectBranding } from "./runtime-config-DL3QjcfM.js";
4
- import { r as connectConfig } from "./connect.config-BofwIsWJ.js";
5
- import { n as setUser } from "./sentry-QXKgQmr2.js";
6
- import { t as getBuildHash } from "./build-info-BKKhnRdh.js";
7
- import { a as detectReactorPgMajor, i as detectMigrationMajor } from "./connection-state-DAqW06pk.js";
8
- import { n as seedPendingPgVersion } from "./pglite-seed-ChNTfFkc.js";
9
- import { n as createReactor } from "./reactor-CWJmSgjl.js";
4
+ import { r as connectConfig } from "./connect.config-D1mCRtVA.js";
5
+ import { n as setUser } from "./sentry-BWJJNfUQ.js";
6
+ import { t as getBuildHash } from "./build-info-BCDZwe0Q.js";
7
+ import { a as detectReactorPgMajor, i as detectMigrationMajor } from "./connection-state-oYbhN61I.js";
8
+ import { n as seedPendingPgVersion } from "./pglite-seed-Cj5X6aSi.js";
9
+ import { n as createReactor } from "./reactor-Cxjyf6yo.js";
10
10
  import { useEffect } from "react";
11
11
  import { initTheme, useUser } from "@powerhousedao/reactor-browser";
12
12
  import { logger } from "document-model";
@@ -127,5 +127,5 @@ async function loadComponent(localPackage) {
127
127
  //#endregion
128
128
  export { loadComponent };
129
129
 
130
- //# sourceMappingURL=load-G--MiC6j.js.map
131
- //# debugId=ceae5cd4-39f1-5f75-b820-498726425b7b
130
+ //# sourceMappingURL=load-B_jzTipS.js.map
131
+ //# debugId=3e02293b-9520-5e3a-916f-1391948c188b
@@ -1 +1 @@
1
- {"version":3,"file":"load-G--MiC6j.js","sources":["../src/hooks/useCheckLatestVersion.ts","../src/hooks/utils.ts","../src/store/user.ts","../src/components/load.tsx"],"sourcesContent":["import { connectConfig } from \"@powerhousedao/connect/config\";\nimport { getBuildHashStatus } from \"@powerhousedao/connect/hooks\";\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 { 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 { 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 { initTheme } from \"@powerhousedao/reactor-browser\";\nimport type { DocumentModelLib } from \"document-model\";\nimport { type ReactNode } from \"react\";\nimport { applyConnectBranding, loadRuntimeConfig } from \"../runtime-config.js\";\n\nexport async function loadComponent(localPackage?: DocumentModelLib) {\n await seedPendingPgVersion();\n await Promise.all([detectReactorPgMajor(), detectMigrationMajor()]);\n const runtimeConfig = await loadRuntimeConfig();\n applyConnectBranding(runtimeConfig);\n await createReactor(localPackage);\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":";;;;;;;;;;;;;AAQA,MAAM,mBAAmB;;;;;;;;;AAUzB,eAAe,mBAAkC;AAC/C,KAAI;AACF,MAAI,EAAE,YAAY,QAAS;EAC3B,MAAM,OAAO,MAAM,OAAO,OAAO,MAAM;AACvC,QAAM,QAAQ,IACZ,KACG,QAAQ,QAAQ,IAAI,SAAS,WAAW,IAAI,IAAI,SAAS,WAAW,CAAC,CACrE,KAAK,QAAQ,OAAO,OAAO,OAAO,IAAI,CAAC,CAC3C;UACM,OAAO;AACd,SAAO,KACL,4DACA,MACD;;;;;;;;;;;;AAaL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K,UAAU,KAAK,KAAK;IAAM,GAAG;IAAM;;AAElE,UAAc,WAAW;IACxB,CAAC,KAAK,CAAC;;;;ACFZ,eAAsB,cAAc,cAAiC;AACnE,OAAM,sBAAsB;AAC5B,OAAM,QAAQ,IAAI,CAAC,sBAAsB,EAAE,sBAAsB,CAAC,CAAC;AAEnE,sBADsB,MAAM,mBAAmB,CACZ;AACnC,OAAM,cAAc,aAAa;AACjC,QAAO,EACL,UAAU,EAAE,eAAyC;AACnD,aAAW;AAEX,oBAAkB;AAElB,yBAAuB;AACvB,SAAO;IAEV","debug_id":"ceae5cd4-39f1-5f75-b820-498726425b7b"}
1
+ {"version":3,"file":"load-B_jzTipS.js","sources":["../src/hooks/useCheckLatestVersion.ts","../src/hooks/utils.ts","../src/store/user.ts","../src/components/load.tsx"],"sourcesContent":["import { connectConfig } from \"@powerhousedao/connect/config\";\nimport { getBuildHashStatus } from \"@powerhousedao/connect/hooks\";\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 { 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 { 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 { initTheme } from \"@powerhousedao/reactor-browser\";\nimport type { DocumentModelLib } from \"document-model\";\nimport { type ReactNode } from \"react\";\nimport { applyConnectBranding, loadRuntimeConfig } from \"../runtime-config.js\";\n\nexport async function loadComponent(localPackage?: DocumentModelLib) {\n await seedPendingPgVersion();\n await Promise.all([detectReactorPgMajor(), detectMigrationMajor()]);\n const runtimeConfig = await loadRuntimeConfig();\n applyConnectBranding(runtimeConfig);\n await createReactor(localPackage);\n return {\n default: ({ children }: { children?: ReactNode }) => {\n initTheme();\n // eslint-disable-next-line react-hooks/rules-of-hooks\n useSetSentryUser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AAK,IAAI,SAAS,kBAAkB,EACvE,OAAO,YACR,CAAC;AACF,MAAI,CAAC,OAAO,GAAI,QAAO;EACvB,MAAM,OAAQ,MAAM,OAAO,MAAM;AACjC,MAAI,OAAO,KAAK,SAAS,YAAY,CAAC,KAAK,KAAM,QAAO;AACxD,SAAO;GACL;GACA,cAAc,KAAK;GACnB,WAAW,KAAK,SAAS;GAC1B;SACK;AACN,SAAO;;;;;ACvCX,SAAgB,mBAAmB;CACjC,MAAM,OAAO,SAAS;AACtB,iBAAgB;EACd,IAAI,aAAgC;AACpC,MAAI,MAAM;GAER,MAAM,EAAE,YAAY,aAAa,GAAG,SAAS;AAC7C,gBAAa;IAAE,IAAI,KAAK;IAAK,UAAU,KAAK,KAAK;IAAM,GAAG;IAAM;;AAElE,UAAc,WAAW;IACxB,CAAC,KAAK,CAAC;;;;ACFZ,eAAsB,cAAc,cAAiC;AACnE,OAAM,sBAAsB;AAC5B,OAAM,QAAQ,IAAI,CAAC,sBAAsB,EAAE,sBAAsB,CAAC,CAAC;AAEnE,sBADsB,MAAM,mBAAmB,CACZ;AACnC,OAAM,cAAc,aAAa;AACjC,QAAO,EACL,UAAU,EAAE,eAAyC;AACnD,aAAW;AAEX,oBAAkB;AAElB,yBAAuB;AACvB,SAAO;IAEV","debug_id":"3e02293b-9520-5e3a-916f-1391948c188b"}
package/dist/main.js CHANGED
@@ -1,11 +1,11 @@
1
1
 
2
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]="14c18035-92f7-5038-a949-40c41955da64")}catch(e){}}();
3
- import { t as bootConnect } from "./boot-uobbAyWT.js";
3
+ import { t as bootConnect } from "./boot-CloWnD0n.js";
4
4
  import { jsx } from "react/jsx-runtime";
5
5
  //#region main.tsx
6
6
  const root = await bootConnect();
7
7
  if (root) {
8
- const { AppLoader } = await import("./app-loader-Cpuo40Tm.js");
8
+ const { AppLoader } = await import("./app-loader-Cs1PxImi.js");
9
9
  root.render(/* @__PURE__ */ jsx(AppLoader, {}));
10
10
  }
11
11
  //#endregion
@@ -1,6 +1,6 @@
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]="1b3f492a-b3e2-5b14-a419-ada62d3e771f")}catch(e){}}();
3
- import { t as refreshPwaManifestLink } from "./pwa-manifest-link-B38lBmEu.js";
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]="b25b9c46-d1f5-5da1-a862-8423e3bbb05e")}catch(e){}}();
3
+ import { t as refreshPwaManifestLink } from "./pwa-manifest-link-BI410b04.js";
4
4
  import { DYNAMIC_BASE_PLACEHOLDER, PWA_IDB_KEY, PWA_IDB_NAME, PWA_IDB_STORE, PWA_IDB_VERSION, checkSharedDeps, formatSharedDepWarnings, mergePwaConfig, withInferredCategory } from "@powerhousedao/shared/connect";
5
5
  import { BrowserLocalStorage } from "@powerhousedao/reactor-browser";
6
6
  import { toCdnUrl } from "@powerhousedao/shared/registry/urls";
@@ -471,5 +471,5 @@ var BrowserPackageManager = class {
471
471
  //#endregion
472
472
  export { sharedDepMismatchWarnings as n, getSharedDeps as r, BrowserPackageManager as t };
473
473
 
474
- //# sourceMappingURL=package-manager-CKEdIJGv.js.map
475
- //# debugId=1b3f492a-b3e2-5b14-a419-ada62d3e771f
474
+ //# sourceMappingURL=package-manager-DBRABkZ_.js.map
475
+ //# debugId=b25b9c46-d1f5-5da1-a862-8423e3bbb05e