@xh/hoist 90.0.0 → 90.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (172) hide show
  1. package/CHANGELOG.md +136 -54
  2. package/admin/columns/Tracking.ts +9 -3
  3. package/admin/tabs/activity/tracking/ActivityTrackingModel.ts +155 -47
  4. package/admin/tabs/activity/tracking/ActivityTrackingPanel.ts +25 -4
  5. package/admin/tabs/activity/tracking/chart/AggChartModel.ts +2 -3
  6. package/appcontainer/ImpersonationBarModel.ts +8 -5
  7. package/build/types/admin/tabs/activity/tracking/ActivityTrackingModel.d.ts +25 -5
  8. package/build/types/cmp/cubegrid/CubeGrid.d.ts +26 -0
  9. package/build/types/cmp/cubegrid/CubeGridModel.d.ts +103 -0
  10. package/build/types/cmp/cubegrid/CubeGridPivotModel.d.ts +181 -0
  11. package/build/types/cmp/cubegrid/Types.d.ts +85 -0
  12. package/build/types/cmp/cubegrid/index.d.ts +4 -0
  13. package/build/types/cmp/dataview/DataViewModel.d.ts +6 -10
  14. package/build/types/cmp/grid/GridModel.d.ts +8 -33
  15. package/build/types/cmp/grid/Types.d.ts +51 -1
  16. package/build/types/cmp/grid/columns/Column.d.ts +2 -1
  17. package/build/types/cmp/grid/columns/ColumnGroup.d.ts +6 -0
  18. package/build/types/cmp/grid/helpers/GridCountLabel.d.ts +6 -3
  19. package/build/types/cmp/grid/impl/ColumnWidthCalculator.d.ts +6 -0
  20. package/build/types/cmp/grid/impl/GridLikeModel.d.ts +3 -0
  21. package/build/types/cmp/grid/impl/MenuSupport.d.ts +13 -0
  22. package/build/types/cmp/pdfviewer/PdfViewer.d.ts +14 -0
  23. package/build/types/cmp/pdfviewer/PdfViewerModel.d.ts +150 -0
  24. package/build/types/cmp/pdfviewer/Types.d.ts +55 -0
  25. package/build/types/cmp/pdfviewer/impl/PdfFindInputModel.d.ts +14 -0
  26. package/build/types/cmp/pdfviewer/impl/PdfViewerToolbarModel.d.ts +34 -0
  27. package/build/types/cmp/pdfviewer/impl/ZoomOptions.d.ts +10 -0
  28. package/build/types/cmp/pdfviewer/index.d.ts +3 -0
  29. package/build/types/cmp/statcard/StatCard.d.ts +90 -0
  30. package/build/types/cmp/statcard/index.d.ts +1 -0
  31. package/build/types/cmp/store/StoreFilterField.d.ts +8 -9
  32. package/build/types/cmp/store/impl/StoreFilterFieldImplModel.d.ts +4 -4
  33. package/build/types/cmp/zoneGrid/ZoneGridModel.d.ts +6 -10
  34. package/build/types/core/types/Types.d.ts +6 -0
  35. package/build/types/data/Field.d.ts +8 -1
  36. package/build/types/data/Store.d.ts +12 -0
  37. package/build/types/data/cube/Cube.d.ts +2 -0
  38. package/build/types/data/cube/CubeField.d.ts +3 -2
  39. package/build/types/data/cube/Query.d.ts +66 -4
  40. package/build/types/data/cube/View.d.ts +82 -4
  41. package/build/types/data/cube/ViewRowData.d.ts +13 -0
  42. package/build/types/data/cube/aggregate/MedianAggregator.d.ts +19 -0
  43. package/build/types/data/cube/aggregate/SumIfSameAggregator.d.ts +30 -0
  44. package/build/types/data/cube/impl/RowCache.d.ts +5 -0
  45. package/build/types/data/cube/impl/RowDataGenerator.d.ts +26 -0
  46. package/build/types/data/cube/impl/ViewDiagnostics.d.ts +27 -0
  47. package/build/types/data/cube/pivot/PivotCellRow.d.ts +27 -0
  48. package/build/types/data/cube/pivot/PivotPath.d.ts +45 -0
  49. package/build/types/data/cube/pivot/impl/PivotCells.d.ts +111 -0
  50. package/build/types/data/cube/pivot/impl/PivotReference.d.ts +39 -0
  51. package/build/types/data/cube/pivot/impl/PivotStructure.d.ts +105 -0
  52. package/build/types/data/cube/row/BaseRow.d.ts +12 -0
  53. package/build/types/data/cube/row/LeafRow.d.ts +4 -4
  54. package/build/types/data/cube/row/ParentRow.d.ts +20 -4
  55. package/build/types/data/cube/row/RowUpdate.d.ts +2 -0
  56. package/build/types/data/index.d.ts +3 -0
  57. package/build/types/desktop/cmp/button/grid/ColAutosizeButton.d.ts +6 -3
  58. package/build/types/desktop/cmp/button/grid/ColChooserButton.d.ts +7 -3
  59. package/build/types/desktop/cmp/button/grid/ExpandToLevelButton.d.ts +6 -3
  60. package/build/types/desktop/cmp/button/grid/ExportButton.d.ts +6 -3
  61. package/build/types/desktop/cmp/grid/find/GridFindField.d.ts +8 -9
  62. package/build/types/desktop/cmp/grid/find/impl/GridFindFieldImplModel.d.ts +3 -4
  63. package/build/types/desktop/cmp/pdfviewer/impl/PdfViewerToolbar.d.ts +12 -0
  64. package/build/types/desktop/cmp/statcard/impl/StatCardInfoImpl.d.ts +12 -0
  65. package/build/types/dynamics/desktop.d.ts +2 -0
  66. package/build/types/dynamics/mobile.d.ts +1 -0
  67. package/build/types/icon/Icon.d.ts +12 -0
  68. package/build/types/kit/pdfjs/index.d.ts +23 -0
  69. package/build/types/kit/pdfjs/styles.d.ts +2 -0
  70. package/build/types/kit/swiper/index.d.ts +7 -7
  71. package/build/types/mobile/cmp/button/grid/ColAutosizeButton.d.ts +6 -3
  72. package/build/types/mobile/cmp/button/grid/ColChooserButton.d.ts +6 -3
  73. package/build/types/mobile/cmp/button/grid/ExpandCollapseButton.d.ts +4 -4
  74. package/build/types/mobile/cmp/button/grid/ExpandToLevelButton.d.ts +4 -4
  75. package/build/types/mobile/cmp/pdfviewer/impl/PdfViewerToolbar.d.ts +12 -0
  76. package/cmp/README.md +3 -0
  77. package/cmp/ag-grid/AgGrid.ts +25 -3
  78. package/cmp/cubegrid/CubeGrid.ts +60 -0
  79. package/cmp/cubegrid/CubeGridModel.ts +365 -0
  80. package/cmp/cubegrid/CubeGridPivotModel.ts +943 -0
  81. package/cmp/cubegrid/README.md +343 -0
  82. package/cmp/cubegrid/Types.ts +105 -0
  83. package/cmp/cubegrid/index.ts +10 -0
  84. package/cmp/dataview/DataViewModel.ts +13 -8
  85. package/cmp/grid/Grid.scss +21 -5
  86. package/cmp/grid/GridModel.ts +41 -47
  87. package/cmp/grid/Types.ts +58 -1
  88. package/cmp/grid/columns/Column.ts +3 -1
  89. package/cmp/grid/columns/ColumnGroup.ts +10 -0
  90. package/cmp/grid/helpers/GridCountLabel.ts +12 -5
  91. package/cmp/grid/impl/ColumnGroupHeader.ts +18 -4
  92. package/cmp/grid/impl/ColumnWidthCalculator.ts +24 -0
  93. package/cmp/grid/impl/GridLikeModel.ts +17 -0
  94. package/cmp/grid/impl/MenuSupport.ts +36 -20
  95. package/cmp/pdfviewer/PdfViewer.scss +48 -0
  96. package/cmp/pdfviewer/PdfViewer.ts +102 -0
  97. package/cmp/pdfviewer/PdfViewerModel.ts +641 -0
  98. package/cmp/pdfviewer/README.md +224 -0
  99. package/cmp/pdfviewer/Types.ts +72 -0
  100. package/cmp/pdfviewer/impl/PdfFindInputModel.ts +44 -0
  101. package/cmp/pdfviewer/impl/PdfViewerToolbarModel.ts +45 -0
  102. package/cmp/pdfviewer/impl/ZoomOptions.ts +36 -0
  103. package/cmp/pdfviewer/index.ts +9 -0
  104. package/cmp/statcard/StatCard.scss +181 -0
  105. package/cmp/statcard/StatCard.ts +320 -0
  106. package/cmp/statcard/index.ts +1 -0
  107. package/cmp/store/StoreFilterField.ts +8 -9
  108. package/cmp/store/impl/StoreFilterFieldImplModel.ts +14 -14
  109. package/cmp/zoneGrid/ZoneGridModel.ts +13 -8
  110. package/core/types/Types.ts +7 -0
  111. package/data/Field.ts +10 -0
  112. package/data/Store.ts +25 -2
  113. package/data/cube/Cube.ts +5 -0
  114. package/data/cube/CubeField.ts +5 -0
  115. package/data/cube/Query.ts +170 -17
  116. package/data/cube/README.md +77 -2
  117. package/data/cube/View.ts +211 -32
  118. package/data/cube/ViewRowData.ts +22 -0
  119. package/data/cube/aggregate/MedianAggregator.ts +88 -0
  120. package/data/cube/aggregate/SumIfSameAggregator.ts +128 -0
  121. package/data/cube/impl/RowCache.ts +32 -11
  122. package/data/cube/impl/RowDataGenerator.ts +96 -4
  123. package/data/cube/impl/ViewDiagnostics.ts +47 -0
  124. package/data/cube/pivot/PivotCellRow.ts +73 -0
  125. package/data/cube/pivot/PivotPath.ts +67 -0
  126. package/data/cube/pivot/impl/PivotCells.ts +538 -0
  127. package/data/cube/pivot/impl/PivotReference.ts +125 -0
  128. package/data/cube/pivot/impl/PivotStructure.ts +500 -0
  129. package/data/cube/row/BaseRow.ts +26 -0
  130. package/data/cube/row/LeafRow.ts +9 -8
  131. package/data/cube/row/ParentRow.ts +58 -25
  132. package/data/cube/row/RowUpdate.ts +8 -0
  133. package/data/index.ts +3 -0
  134. package/desktop/appcontainer/AppContainer.ts +5 -1
  135. package/desktop/cmp/button/grid/ColAutosizeButton.ts +21 -5
  136. package/desktop/cmp/button/grid/ColChooserButton.ts +11 -5
  137. package/desktop/cmp/button/grid/ExpandToLevelButton.ts +20 -5
  138. package/desktop/cmp/button/grid/ExportButton.ts +19 -7
  139. package/desktop/cmp/dash/canvas/DashCanvas.ts +26 -2
  140. package/desktop/cmp/grid/find/GridFindField.ts +8 -9
  141. package/desktop/cmp/grid/find/impl/GridFindFieldImplModel.ts +15 -16
  142. package/desktop/cmp/grid/impl/colchooser/ColChooserBucketModel.ts +1 -1
  143. package/desktop/cmp/pdfviewer/impl/PdfViewerToolbar.ts +190 -0
  144. package/desktop/cmp/statcard/impl/StatCardInfoImpl.ts +27 -0
  145. package/docs/README.md +6 -2
  146. package/docs/doc-registry.json +21 -5
  147. package/docs/upgrade-notes/v90-upgrade-notes.md +130 -0
  148. package/docs/version-compatibility.md +2 -1
  149. package/dynamics/desktop.ts +4 -0
  150. package/dynamics/mobile.ts +2 -0
  151. package/format/FormatNumber.ts +6 -2
  152. package/icon/Icon.ts +18 -0
  153. package/icon/index.ts +32 -0
  154. package/kit/README.md +2 -0
  155. package/kit/pdfjs/PdfJs.scss +25 -0
  156. package/kit/pdfjs/index.ts +103 -0
  157. package/kit/pdfjs/pdf_viewer.css +6481 -0
  158. package/kit/pdfjs/styles.ts +12 -0
  159. package/mcp/README.md +13 -0
  160. package/mcp/data/import-paths.ts +4 -8
  161. package/mcp/data/index-cache.ts +2 -1
  162. package/mcp/data/ts-registry.ts +8 -29
  163. package/mcp/util/paths.ts +26 -0
  164. package/mobile/appcontainer/AppContainer.ts +3 -1
  165. package/mobile/cmp/button/grid/ColAutosizeButton.ts +20 -5
  166. package/mobile/cmp/button/grid/ColChooserButton.ts +12 -5
  167. package/mobile/cmp/button/grid/ExpandCollapseButton.ts +10 -6
  168. package/mobile/cmp/button/grid/ExpandToLevelButton.ts +10 -6
  169. package/mobile/cmp/pdfviewer/impl/PdfViewerToolbar.ts +137 -0
  170. package/package.json +14 -8
  171. package/public/msal-redirect-bridge.min.js +1 -1
  172. package/styles/vars.scss +59 -0
@@ -0,0 +1,12 @@
1
+ /*
2
+ * This file belongs to Hoist, an application development toolkit
3
+ * developed by Extremely Heavy Industries (www.xh.io | info@xh.io)
4
+ *
5
+ * Copyright © 2026 Extremely Heavy Industries Inc.
6
+ */
7
+
8
+ // Imported dynamically by `loadPdfJsAsync()`, so pdf.js styles load only with pdf.js itself.
9
+ // The pdf.js stylesheet is scoped to `.xh-pdf-viewer` - see scripts/generate-pdfjs-css.mjs.
10
+ // Hoist's overrides must follow it, to win at equal specificity.
11
+ import './pdf_viewer.css';
12
+ import './PdfJs.scss';
package/mcp/README.md CHANGED
@@ -67,6 +67,7 @@ mcp/
67
67
  │ ├── ts-registry.ts # Lazy ts-morph symbol index with on-demand type extraction
68
68
  │ ├── ts-registry.spec.ts # Path handling and live index integration checks
69
69
  │ ├── import-paths.ts # Barrel import path resolution by walking package barrels
70
+ │ ├── import-paths.spec.ts # Source filtering and barrel resolution at installed roots (see Testing)
70
71
  │ ├── index-cache.ts # Disk cache for the symbol and member indexes
71
72
  │ ├── symbol-search.ts # MiniSearch (BM25) indexes over symbols and members, ranked search
72
73
  │ └── symbol-search.spec.ts # Golden-set retrieval eval and tool acceptance checks (see Testing)
@@ -78,6 +79,7 @@ mcp/
78
79
  ├── tools/
79
80
  │ ├── docs.ts # MCP documentation tools (search, list, read, ping)
80
81
  │ ├── docs.spec.ts # MCP / CLI parity check for the doc tools
82
+ │ ├── installed-package.spec.ts # CLIs run from a packed install in a fixture app (see Testing)
81
83
  │ ├── typescript.ts # MCP TypeScript tools (search-symbols, get-symbol, get-members)
82
84
  │ └── typescript.spec.ts # MCP / CLI parity check for the TypeScript tools
83
85
  ├── util/
@@ -988,8 +990,10 @@ typecheck. Both `pnpm lint` and `pnpm typecheck` cover `mcp/`, via its own ESLin
988
990
  | `data/doc-sections.spec.ts` | Section parsing, section-name resolution, and full / section / outline reads |
989
991
  | `data/doc-search.spec.ts` | Golden-set retrieval eval: top-3 hit rate (must stay at or above 85%), named experiment queries, and the default-search token budget (under 800) |
990
992
  | `data/ts-registry.spec.ts` | TypeScript symbol and member lookup, cross-platform path handling |
993
+ | `data/import-paths.spec.ts` | `isLibrarySource()` and barrel import path resolution, at a checkout root and at installed roots (npm, pnpm store, under a `build/` or `mcp/` folder, Windows), in an in-memory ts-morph project. Covers `export *`, `export type *`, named re-exports, and barrel chains |
991
994
  | `data/symbol-search.spec.ts` | Golden-set retrieval eval for symbol search: top-3 hit rate (must stay at or above 85%), multi-word queries that must return their obvious hit, search token ceilings (`MAX_EXPERIMENT_TOKENS` 1000 for the experiment queries, `MAX_SEARCH_TOKENS` 1200 for all), barrel-exported golden symbols returning a barrel import path, a ranking guard that keeps file imports out of the top hits for `PanelModel`, `confirm`, `loading`, and `select input options`, the file import for `LeafRow` (top hit, hit-line tag, `barrelExport: false`, and the marked import line on `hoist-get-symbol` and `hoist-get-members`), the hidden exact match footer for an `impl/` symbol (`ColumnWidthCalculator`), the Props-owner, internal-code (hidden counts cover only location-hidden hits), no-fuzzy, and component-folding rules, and the tool-level acceptance cases (`ColumnSpec` import path and member summary, `ButtonProps` external `onClick`, the `FieldType` error and dual declarations, `XH` as an instance of `XHApi`, complete JSDoc on `ColumnSpec`, `PanelProps`, and `GridModel` filtered by `col`, the summary fallback for unfiltered `GridModel`, inherited JSDoc on `Column.headerName`, and the `PanelModel.collapsed` default) |
992
995
  | `tools/docs.spec.ts` | MCP / CLI parity - calls the doc tools through an in-memory MCP client and compares them with `hoist-docs` output and `--json` |
996
+ | `tools/installed-package.spec.ts` | The tools as an app runs them. Lays out the `npm pack` file list under a fixture app's `node_modules`, then runs `hoist-ts` and `hoist-docs` from the app: barrel import paths (including `HoistRoute` through `export type *`), search, members, and doc search and reads. The slowest spec (about 20s), because it builds a fresh index |
993
997
  | `tools/typescript.spec.ts` | MCP / CLI parity for the three TypeScript tools, including filters, `kind` and `filePath` disambiguation, and error cases. Covers the import line for a barrel symbol, a file-import symbol (`LeafRow`), and a Promise extension, and the hidden exact match query. Runs the CLI in-process via `cli/ts-command.ts` (about 4s) and spawns the real bin once as a smoke check |
994
998
 
995
999
  Each golden set maps realistic agent queries to the doc section, symbol, or `Owner.member` that
@@ -1124,6 +1128,15 @@ any incoming file-path argument) from `util/paths.ts` rather than `resolveRepoRo
1124
1128
  access that stays within Node's `path`/`fs` APIs (e.g. the doc registry, the index cache) can keep
1125
1129
  using `resolveRepoRoot()`, since those are separator-consistent on both sides.
1126
1130
 
1131
+ ### Path Filters (Installed Package)
1132
+
1133
+ In an app, the package root is `client-app/node_modules/@xh/hoist`, often inside the pnpm store.
1134
+ Every absolute path under it contains `/node_modules/`, and a folder above it may be named `build`
1135
+ or `mcp`. A filter that tests the absolute path for those segments rejects every file in an app,
1136
+ while every spec run from a checkout still passes. Test the path relative to the package root with
1137
+ `isLibrarySource()` from `util/paths.ts`. `tools/installed-package.spec.ts` runs the CLIs from a
1138
+ packed install to catch this class of bug.
1139
+
1127
1140
  ### Registry Sync
1128
1141
 
1129
1142
  The doc registry is hardcoded, not filesystem-scanned. When documentation files are added or
@@ -13,6 +13,7 @@
13
13
  * disk cache carries it. The file path is derived at output time.
14
14
  */
15
15
  import type {Project, SourceFile} from 'ts-morph';
16
+ import {isLibrarySource} from '../util/paths.js';
16
17
 
17
18
  /** Resolve the barrel import path of `name` declared in `filePath` (POSIX, absolute). */
18
19
  export type ImportPathResolver = (filePath: string, name: string) => string | null;
@@ -30,18 +31,13 @@ interface ExportEdge {
30
31
  * lazily per barrel and memoized, since most barrels are only consulted for their own subtree.
31
32
  */
32
33
  export function createImportPathResolver(project: Project, repoRoot: string): ImportPathResolver {
33
- const prefix = repoRoot + '/',
34
- isIndexable = (path: string) =>
35
- path.startsWith(prefix) &&
36
- !path.includes('/node_modules/') &&
37
- !path.includes('/build/') &&
38
- !path.includes('/mcp/');
34
+ const prefix = repoRoot + '/';
39
35
 
40
36
  // Barrel file path keyed by its directory, relative to the repo root (`cmp/grid`).
41
37
  const barrels = new Map<string, SourceFile>();
42
38
  for (const sf of project.getSourceFiles()) {
43
39
  const path = sf.getFilePath();
44
- if (!isIndexable(path) || !path.endsWith('/index.ts')) continue;
40
+ if (!isLibrarySource(path, repoRoot) || !path.endsWith('/index.ts')) continue;
45
41
  barrels.set(path.slice(prefix.length, -'/index.ts'.length), sf);
46
42
  }
47
43
 
@@ -109,7 +105,7 @@ export function createImportPathResolver(project: Project, repoRoot: string): Im
109
105
  }
110
106
 
111
107
  return (filePath, name) => {
112
- if (!isIndexable(filePath)) return null;
108
+ if (!isLibrarySource(filePath, repoRoot)) return null;
113
109
  const segments = filePath.slice(prefix.length).split('/').slice(0, -1);
114
110
  for (let depth = 1; depth <= segments.length; depth++) {
115
111
  const dir = segments.slice(0, depth).join('/'),
@@ -54,7 +54,8 @@ const EXCLUDED_DIRS = new Set(['node_modules', 'build', 'mcp', '.git', '.idea',
54
54
  const INDEXER_SOURCES = [
55
55
  'mcp/data/ts-registry.ts',
56
56
  'mcp/data/import-paths.ts',
57
- 'mcp/data/index-cache.ts'
57
+ 'mcp/data/index-cache.ts',
58
+ 'mcp/util/paths.ts'
58
59
  ];
59
60
 
60
61
  interface CachePayload {
@@ -25,7 +25,12 @@ import type {
25
25
  import {resolve} from 'node:path';
26
26
 
27
27
  import {log} from '../util/logger.js';
28
- import {resolveRepoRoot, resolveRepoRootPosix, toPosixPath} from '../util/paths.js';
28
+ import {
29
+ isLibrarySource,
30
+ resolveRepoRoot,
31
+ resolveRepoRootPosix,
32
+ toPosixPath
33
+ } from '../util/paths.js';
29
34
  import {createImportPathResolver} from './import-paths.js';
30
35
  import {computeFingerprint, loadCache, writeCache} from './index-cache.js';
31
36
 
@@ -283,23 +288,6 @@ export function isPromiseExtension(entry: Pick<SymbolEntry, 'name' | 'filePath'>
283
288
  /** Longest property initializer surfaced as a member default. */
284
289
  const MAX_DEFAULT_LENGTH = 60;
285
290
 
286
- /**
287
- * True if a file, given by its path relative to the repo root (with a leading slash), is library
288
- * source to index. Excludes dependencies, build output, this MCP sub-project, specs, and the CI
289
- * reporter for hoist-react's own tests - none of which ship. The test kit in `test-support/` ships
290
- * as `@xh/hoist/test-support`, so it is indexed.
291
- */
292
- function isLibrarySource(relPath: string | null): boolean {
293
- return (
294
- !!relPath &&
295
- !relPath.startsWith('/node_modules/') &&
296
- !relPath.includes('/build/') &&
297
- !relPath.includes('/mcp/') &&
298
- !relPath.startsWith('/test-support/report/') &&
299
- !relPath.endsWith('.spec.ts')
300
- );
301
- }
302
-
303
291
  /**
304
292
  * Derive the source package from a file's absolute path.
305
293
  * e.g. `/repo/core/HoistBase.ts` maps to `core`,
@@ -431,13 +419,7 @@ function buildSymbolIndex(proj: Project): {
431
419
  for (const sourceFile of proj.getSourceFiles()) {
432
420
  const filePath = sourceFile.getFilePath();
433
421
 
434
- // Skip non-source files - use path relative to repoRoot so that
435
- // hoist-react's own sources are included even when the package is
436
- // installed under an app's node_modules directory.
437
- const relPath = filePath.startsWith(repoRoot + '/')
438
- ? filePath.slice(repoRoot.length)
439
- : null;
440
- if (!isLibrarySource(relPath)) continue;
422
+ if (!isLibrarySource(filePath, repoRoot)) continue;
441
423
 
442
424
  const pkg = derivePackage(filePath, repoRoot);
443
425
 
@@ -925,10 +907,7 @@ function enrichMemberIndexJsDoc(proj: Project): void {
925
907
 
926
908
  for (const sourceFile of proj.getSourceFiles()) {
927
909
  const filePath = sourceFile.getFilePath();
928
- const relPath = filePath.startsWith(repoRoot + '/')
929
- ? filePath.slice(repoRoot.length)
930
- : null;
931
- if (!isLibrarySource(relPath)) continue;
910
+ if (!isLibrarySource(filePath, repoRoot)) continue;
932
911
 
933
912
  for (const cls of sourceFile.getClasses()) {
934
913
  if (!shouldIndexClassMembers(cls)) continue;
package/mcp/util/paths.ts CHANGED
@@ -61,6 +61,32 @@ export function resolveRepoRootPosix(): string {
61
61
  return toPosixPath(resolveRepoRoot());
62
62
  }
63
63
 
64
+ /**
65
+ * True if a source file is library source to index. Excludes files outside the repo root and,
66
+ * within it, dependencies, build output, this MCP sub-project, specs, and the CI reporter for
67
+ * hoist-react's own tests - none of which ship. The test kit in `test-support/` ships as
68
+ * `@xh/hoist/test-support`, so it is indexed.
69
+ *
70
+ * Tests the path relative to `repoRoot`, never the absolute path. In an app, the package root
71
+ * itself sits under `node_modules`, and a folder above it may be named `build` or `mcp`. A test
72
+ * of the absolute path then rejects every file. The symbol indexer and the import path resolver
73
+ * both filter with this function so that they always agree.
74
+ *
75
+ * @param filePath - absolute POSIX path, as ts-morph `getFilePath()` reports it.
76
+ * @param repoRoot - repo root in POSIX form - see {@link resolveRepoRootPosix}.
77
+ */
78
+ export function isLibrarySource(filePath: string, repoRoot: string): boolean {
79
+ if (!filePath.startsWith(repoRoot + '/')) return false;
80
+ const relPath = filePath.slice(repoRoot.length);
81
+ return (
82
+ !relPath.startsWith('/node_modules/') &&
83
+ !relPath.includes('/build/') &&
84
+ !relPath.includes('/mcp/') &&
85
+ !relPath.startsWith('/test-support/report/') &&
86
+ !relPath.endsWith('.spec.ts')
87
+ );
88
+ }
89
+
64
90
  /**
65
91
  * Resolve the `@xh/hoist` library version from the repo root `package.json`.
66
92
  *
@@ -15,6 +15,7 @@ import {installMobileImpls} from '@xh/hoist/dynamics/mobile';
15
15
  import {colChooser} from '@xh/hoist/mobile/cmp/grid/impl/ColChooser';
16
16
  import {ColChooserModel} from '@xh/hoist/mobile/cmp/grid/impl/ColChooserModel';
17
17
  import {mask} from '@xh/hoist/cmp/mask';
18
+ import {pdfViewerToolbarImpl} from '@xh/hoist/mobile/cmp/pdfviewer/impl/PdfViewerToolbar';
18
19
  import {pinPadImpl} from '@xh/hoist/mobile/cmp/pinpad/impl/PinPad';
19
20
  import {storeFilterFieldImpl} from '@xh/hoist/mobile/cmp/store/impl/StoreFilterField';
20
21
  import {tabContainerImpl} from '@xh/hoist/mobile/cmp/tab/impl/TabContainer';
@@ -44,7 +45,8 @@ installMobileImpls({
44
45
  zoneMapper,
45
46
  errorMessageImpl,
46
47
  maskImpl,
47
- cardHeaderImpl
48
+ cardHeaderImpl,
49
+ pdfViewerToolbarImpl
48
50
  });
49
51
 
50
52
  /**
@@ -6,7 +6,8 @@
6
6
  */
7
7
 
8
8
  import type {GridAutosizeOptions} from '@xh/hoist/cmp/grid';
9
- import {GridModel} from '@xh/hoist/cmp/grid';
9
+ import type {GridLikeModel} from '@xh/hoist/cmp/grid';
10
+ import {isGridLikeModel} from '@xh/hoist/cmp/grid/impl/GridLikeModel';
10
11
  import {hoistCmp, useContextModel} from '@xh/hoist/core';
11
12
  import {Icon} from '@xh/hoist/icon';
12
13
  import type {ButtonProps} from '@xh/hoist/mobile/cmp/button';
@@ -15,8 +16,11 @@ import '@xh/hoist/mobile/register';
15
16
  import {logError, withDefault} from '@xh/hoist/utils/js';
16
17
 
17
18
  export interface ColAutosizeButtonProps extends ButtonProps {
18
- /** GridModel to which this button should bind. Will find nearest in context if not provided. */
19
- gridModel?: GridModel;
19
+ /**
20
+ * GridModel, or a model wrapping one, to which this button should bind. Will find the
21
+ * nearest in context if not provided.
22
+ */
23
+ gridModel?: GridLikeModel;
20
24
 
21
25
  /** Options to override grid's default or configured autosize settings. */
22
26
  autosizeOptions?: Omit<GridAutosizeOptions, 'mode'>;
@@ -30,8 +34,19 @@ export const [ColAutosizeButton, colAutosizeButton] = hoistCmp.withFactory<ColAu
30
34
  className: 'xh-col-autosize-button',
31
35
  model: false,
32
36
 
33
- render({className, gridModel, icon, onClick, disabled, autosizeOptions = {}, ...props}) {
34
- gridModel = withDefault(gridModel, useContextModel(GridModel));
37
+ render({
38
+ className,
39
+ gridModel: boundModel,
40
+ icon,
41
+ onClick,
42
+ disabled,
43
+ autosizeOptions = {},
44
+ ...props
45
+ }) {
46
+ const gridModel = withDefault(
47
+ boundModel,
48
+ useContextModel<GridLikeModel>(isGridLikeModel)
49
+ )?.innerGridModel;
35
50
 
36
51
  // Validate bound model available and suitable for use.
37
52
  if (!onClick) {
@@ -4,7 +4,8 @@
4
4
  *
5
5
  * Copyright © 2026 Extremely Heavy Industries Inc.
6
6
  */
7
- import {GridModel} from '@xh/hoist/cmp/grid';
7
+ import type {GridLikeModel} from '@xh/hoist/cmp/grid';
8
+ import {isGridLikeModel} from '@xh/hoist/cmp/grid/impl/GridLikeModel';
8
9
  import {hoistCmp, useContextModel} from '@xh/hoist/core';
9
10
  import {Icon} from '@xh/hoist/icon';
10
11
  import type {ButtonProps} from '@xh/hoist/mobile/cmp/button';
@@ -13,8 +14,11 @@ import '@xh/hoist/mobile/register';
13
14
  import {logError, withDefault} from '@xh/hoist/utils/js';
14
15
 
15
16
  export interface ColChooserButtonProps extends ButtonProps {
16
- /** GridModel to which this button should bind. Will find nearest in context if not provided. */
17
- gridModel?: GridModel;
17
+ /**
18
+ * GridModel, or a model wrapping one, to which this button should bind. Will find the
19
+ * nearest in context if not provided.
20
+ */
21
+ gridModel?: GridLikeModel;
18
22
  }
19
23
 
20
24
  /**
@@ -28,8 +32,11 @@ export const [ColChooserButton, colChooserButton] = hoistCmp.withFactory<ColChoo
28
32
  className: 'xh-col-chooser-button',
29
33
  model: false,
30
34
 
31
- render({className, gridModel, icon, onClick, disabled, ...props}) {
32
- gridModel = withDefault(gridModel, useContextModel(GridModel));
35
+ render({className, gridModel: boundModel, icon, onClick, disabled, ...props}) {
36
+ const gridModel = withDefault(
37
+ boundModel,
38
+ useContextModel<GridLikeModel>(isGridLikeModel)
39
+ )?.innerGridModel;
33
40
 
34
41
  if (!onClick) {
35
42
  // Validate bound model available and suitable for use.
@@ -4,7 +4,8 @@
4
4
  *
5
5
  * Copyright © 2026 Extremely Heavy Industries Inc.
6
6
  */
7
- import {GridModel} from '@xh/hoist/cmp/grid';
7
+ import type {GridLikeModel} from '@xh/hoist/cmp/grid';
8
+ import {isGridLikeModel} from '@xh/hoist/cmp/grid/impl/GridLikeModel';
8
9
  import {hoistCmp, useContextModel} from '@xh/hoist/core';
9
10
  import {Icon} from '@xh/hoist/icon';
10
11
  import type {ButtonProps} from '@xh/hoist/mobile/cmp/button';
@@ -15,10 +16,10 @@ import {isEmpty} from 'lodash';
15
16
 
16
17
  export interface ExpandCollapseButtonProps extends ButtonProps {
17
18
  /**
18
- * `GridModel` to which this button should bind.
19
- * Optional, will find nearest GridModel in context if not provided.
19
+ * GridModel, or a model wrapping one, to which this button should bind. Will find the
20
+ * nearest in context if not provided.
20
21
  */
21
- gridModel?: GridModel;
22
+ gridModel?: GridLikeModel;
22
23
  }
23
24
 
24
25
  /**
@@ -30,8 +31,11 @@ export const [ExpandCollapseButton, expandCollapseButton] =
30
31
  className: 'xh-expand-collapse-button',
31
32
  model: false,
32
33
 
33
- render({className, gridModel, onClick, ...props}) {
34
- gridModel = withDefault(gridModel, useContextModel(GridModel));
34
+ render({className, gridModel: boundModel, onClick, ...props}) {
35
+ const gridModel = withDefault(
36
+ boundModel,
37
+ useContextModel<GridLikeModel>(isGridLikeModel)
38
+ )?.innerGridModel;
35
39
 
36
40
  // Validate bound model available and suitable for use.
37
41
  if (!onClick && !gridModel) {
@@ -4,7 +4,8 @@
4
4
  *
5
5
  * Copyright © 2026 Extremely Heavy Industries Inc.
6
6
  */
7
- import {GridModel} from '@xh/hoist/cmp/grid';
7
+ import type {GridLikeModel} from '@xh/hoist/cmp/grid';
8
+ import {isGridLikeModel} from '@xh/hoist/cmp/grid/impl/GridLikeModel';
8
9
  import type {MenuItemLike} from '@xh/hoist/core';
9
10
  import {hoistCmp, useContextModel} from '@xh/hoist/core';
10
11
  import {Icon} from '@xh/hoist/icon';
@@ -15,10 +16,10 @@ import {menuButton} from '../../menu';
15
16
 
16
17
  export interface ExpandToLevelButtonProps extends MenuButtonProps {
17
18
  /**
18
- * `GridModel` to which this button should bind.
19
- * Optional, will find nearest GridModel in context if not provided.
19
+ * GridModel, or a model wrapping one, to which this button should bind. Will find the
20
+ * nearest in context if not provided.
20
21
  */
21
- gridModel?: GridModel;
22
+ gridModel?: GridLikeModel;
22
23
  }
23
24
 
24
25
  /**
@@ -32,8 +33,11 @@ export const [ExpandToLevelButton, expandToLevelButton] =
32
33
  className: 'xh-expand-to-level-button',
33
34
  model: false,
34
35
 
35
- render({gridModel, className, icon, disabled, ...rest}) {
36
- gridModel = withDefault(gridModel, useContextModel(GridModel));
36
+ render({gridModel: boundModel, className, icon, disabled, ...rest}) {
37
+ const gridModel = withDefault(
38
+ boundModel,
39
+ useContextModel<GridLikeModel>(isGridLikeModel)
40
+ )?.innerGridModel;
37
41
  icon = withDefault(icon, Icon.treeList());
38
42
 
39
43
  const disabledButton = () =>
@@ -0,0 +1,137 @@
1
+ /*
2
+ * This file belongs to Hoist, an application development toolkit
3
+ * developed by Extremely Heavy Industries (www.xh.io | info@xh.io)
4
+ *
5
+ * Copyright © 2026 Extremely Heavy Industries Inc.
6
+ */
7
+ import {filler, fragment, span} from '@xh/hoist/cmp/layout';
8
+ import {PdfFindInputModel} from '@xh/hoist/cmp/pdfviewer/impl/PdfFindInputModel';
9
+ import {getZoomOptions} from '@xh/hoist/cmp/pdfviewer/impl/ZoomOptions';
10
+ import type {PdfViewerToolbarModel} from '@xh/hoist/cmp/pdfviewer/impl/PdfViewerToolbarModel';
11
+ import type {PdfViewerToolbarItem} from '@xh/hoist/cmp/pdfviewer/Types';
12
+ import type {HoistModel} from '@xh/hoist/core';
13
+ import {hoistCmp, useLocalModel, uses} from '@xh/hoist/core';
14
+ import {Icon} from '@xh/hoist/icon';
15
+ import {button} from '@xh/hoist/mobile/cmp/button';
16
+ import {select, textInput} from '@xh/hoist/mobile/cmp/input';
17
+ import {toolbar, toolbarSep} from '@xh/hoist/mobile/cmp/toolbar';
18
+ import '@xh/hoist/mobile/register';
19
+ import {isString} from 'lodash';
20
+ import type {ReactNode} from 'react';
21
+
22
+ /**
23
+ * Mobile implementation of the PdfViewer toolbar.
24
+ *
25
+ * Note that this module is installed by the mobile AppContainer and must not import
26
+ * PdfViewerModel, even as a type. A runtime import would bring pdf.js into every app's build, and a
27
+ * type import would break `tsc` in apps without `pdfjs-dist`. See {@link PdfViewerToolbarModel}.
28
+ *
29
+ * @internal
30
+ */
31
+ export const pdfViewerToolbarImpl = hoistCmp.factory<PdfViewerToolbarModel>({
32
+ model: uses((m: HoistModel) => m['isPdfViewerModel']),
33
+
34
+ render({model}) {
35
+ return toolbar({
36
+ className: 'xh-pdf-viewer__toolbar',
37
+ items: model.toolbar.map((item, idx) => renderItem(item, idx, model))
38
+ });
39
+ }
40
+ });
41
+
42
+ function renderItem(
43
+ item: PdfViewerToolbarItem,
44
+ key: number,
45
+ model: PdfViewerToolbarModel
46
+ ): ReactNode {
47
+ if (!isString(item)) return item;
48
+ switch (item) {
49
+ case 'pageNav':
50
+ return pageNav({key, model});
51
+ case 'zoom':
52
+ return zoom({key, model});
53
+ case 'find':
54
+ return find({key, model});
55
+ case 'rotate':
56
+ return button({
57
+ key,
58
+ icon: Icon.rotateRight(),
59
+ disabled: !model.hasDocument,
60
+ onClick: () => model.rotate()
61
+ });
62
+ case 'download':
63
+ return button({
64
+ key,
65
+ icon: Icon.download(),
66
+ disabled: !model.hasDocument,
67
+ onClick: () => model.downloadAsync().catchDefault()
68
+ });
69
+ case '-':
70
+ return toolbarSep({key});
71
+ case 'filler':
72
+ return filler({key});
73
+ default:
74
+ return item;
75
+ }
76
+ }
77
+
78
+ const pageNav = hoistCmp.factory<PdfViewerToolbarModel>(({model}) =>
79
+ fragment(
80
+ button({
81
+ icon: Icon.chevronLeft(),
82
+ disabled: !model.canGoPrevious,
83
+ onClick: () => model.previousPage()
84
+ }),
85
+ span({
86
+ className: 'xh-pdf-viewer__page-count',
87
+ item: model.hasDocument ? `${model.pageNumber} / ${model.pageCount}` : null
88
+ }),
89
+ button({
90
+ icon: Icon.chevronRight(),
91
+ disabled: !model.canGoNext,
92
+ onClick: () => model.nextPage()
93
+ })
94
+ )
95
+ );
96
+
97
+ const zoom = hoistCmp.factory<PdfViewerToolbarModel>(({model}) =>
98
+ select({
99
+ width: 110,
100
+ value: model.scale,
101
+ options: getZoomOptions(model),
102
+ enableFilter: false,
103
+ disabled: !model.hasDocument,
104
+ onChange: v => model.setScale(v)
105
+ })
106
+ );
107
+
108
+ const find = hoistCmp.factory<PdfViewerToolbarModel>(({model}) => {
109
+ const impl = useLocalModel(() => new PdfFindInputModel(model)),
110
+ {findQuery, findMatchCount, findMatchNumber, isFinding, hasDocument} = model;
111
+ return fragment(
112
+ textInput({
113
+ model: impl,
114
+ bind: 'query',
115
+ flex: 1,
116
+ placeholder: 'Find...',
117
+ enableClear: true,
118
+ commitOnChange: true,
119
+ disabled: !hasDocument
120
+ }),
121
+ span({
122
+ className: 'xh-pdf-viewer__find-count',
123
+ item: findMatchCount
124
+ ? `${findMatchNumber} / ${findMatchCount}`
125
+ : isFinding
126
+ ? null
127
+ : span({className: 'xh-text-color-muted', item: 'No results'}),
128
+ omit: !findQuery
129
+ }),
130
+ button({
131
+ icon: Icon.arrowDown(),
132
+ disabled: !findMatchCount,
133
+ onClick: () => model.findNext(),
134
+ omit: !findQuery
135
+ })
136
+ );
137
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xh/hoist",
3
- "version": "90.0.0",
3
+ "version": "90.1.0",
4
4
  "description": "Hoist add-on for building and deploying React Applications.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -39,9 +39,9 @@
39
39
  ]
40
40
  },
41
41
  "dependencies": {
42
- "@auth0/auth0-spa-js": "~2.29.0",
43
- "@azure/msal-browser": "~5.27.0",
44
- "@azure/msal-common": "~16.15.0",
42
+ "@auth0/auth0-spa-js": "~2.30.0",
43
+ "@azure/msal-browser": "~5.28.0",
44
+ "@azure/msal-common": "~16.16.0",
45
45
  "@blueprintjs/core": "^6.21.0",
46
46
  "@codemirror/commands": "^6.11.1",
47
47
  "@codemirror/language": "^6.13.1",
@@ -76,7 +76,7 @@
76
76
  "moment": "~2.31.0",
77
77
  "qs": "^6.16.1",
78
78
  "react-dropzone": "~20.1.4",
79
- "react-grid-layout": "~2.3.0",
79
+ "react-grid-layout": "~2.2.4",
80
80
  "react-markdown": "~10.1.0",
81
81
  "react-select": "~5.10.2",
82
82
  "react-window": "~2.5.1",
@@ -85,7 +85,7 @@
85
85
  "router5": "~8.0.1",
86
86
  "router5-plugin-browser": "~8.0.1",
87
87
  "sass-material-colors": "~0.0.5",
88
- "swiper": "~14.3.0",
88
+ "swiper": "~14.4.0",
89
89
  "ts-morph": "^28.0.0",
90
90
  "tsx": "^4.23.15",
91
91
  "unified": "~11.0.5",
@@ -96,6 +96,7 @@
96
96
  "@testing-library/react": "^16.3.3",
97
97
  "jsdom": "^30.1.1",
98
98
  "msw": "^3.0.2",
99
+ "pdfjs-dist": "^6.5.0",
99
100
  "react": "^19.3.0",
100
101
  "react-dom": "^19.3.0",
101
102
  "vitest": "^5.0.3"
@@ -113,6 +114,9 @@
113
114
  "msw": {
114
115
  "optional": true
115
116
  },
117
+ "pdfjs-dist": {
118
+ "optional": true
119
+ },
116
120
  "vitest": {
117
121
  "optional": true
118
122
  }
@@ -127,8 +131,8 @@
127
131
  "@vitest/ui": "^5.0.5",
128
132
  "@xh/eslint-config": "^8.1.0",
129
133
  "@xh/hoist-dev-utils": "^16.1.1",
130
- "ag-grid-community": "~36.2.0",
131
- "ag-grid-react": "~36.2.0",
134
+ "ag-grid-community": "~36.3.0",
135
+ "ag-grid-react": "~36.3.0",
132
136
  "csstype": "^3.2.3",
133
137
  "eslint": "^10.13.0",
134
138
  "eslint-config-prettier": "^10.1.8",
@@ -138,6 +142,7 @@
138
142
  "jsdom": "^30.1.3",
139
143
  "lint-staged": "^17.6.0",
140
144
  "msw": "^3.0.3",
145
+ "pdfjs-dist": "~6.5.438",
141
146
  "postcss": "^8.5.31",
142
147
  "prettier": "^3.9.10",
143
148
  "react": "^19.3.1",
@@ -156,6 +161,7 @@
156
161
  "lint:styles": "stylelint \"**/*.s?(a|c)ss\"",
157
162
  "lint:mcp": "eslint --config mcp/eslint.config.mjs mcp/ bin/hoist-mcp.mjs bin/hoist-docs.mjs bin/hoist-ts.mjs",
158
163
  "check:vendored": "node scripts/check-vendored.mjs",
164
+ "generate:pdfjs-css": "node scripts/generate-pdfjs-css.mjs",
159
165
  "typecheck": "tsc --noEmit && tsc -p mcp/tsconfig.json",
160
166
  "test": "vitest run",
161
167
  "test:watch": "vitest",
@@ -1,2 +1,2 @@
1
- /*! @azure/msal-browser v5.27.0 2026-10-27 */
1
+ /*! @azure/msal-browser v5.28.0 2026-11-05 */
2
2
  "use strict";!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).msalRedirectBridge={})}(this,function(t){const e="common",r="organizations";class n extends Error{constructor(t,e,r,o){const s=r||(t?`See https://aka.ms/msal.js.errors#${t} for details`:"");super(s?`${t}: ${s}`:t),Object.setPrototypeOf(this,n.prototype),this.errorCode=t||"",this.errorMessage=s||"",this.subError=o||"",this.correlationId=e,this.name="AuthError"}}class o extends n{constructor(t,e,r){super(t,e,r),this.name="ClientAuthError",Object.setPrototypeOf(this,o.prototype)}}function s(t,e,r){return new o(t,e,r)}const i="invalid_state";class a extends n{constructor(t,e){super(t,e),this.name="ClientConfigurationError",Object.setPrototypeOf(this,a.prototype)}}function c(t,e){return new a(t,e)}const l="url_parse_error";class u{static isEmptyObj(t){if(t)try{const e=JSON.parse(t);return 0===Object.keys(e).length}catch(t){}return!0}static startsWith(t,e){return 0===t.indexOf(e)}static endsWith(t,e){return t.length>=e.length&&t.lastIndexOf(e)===t.length-e.length}static queryStringToObject(t){const e={},r=t.split("&"),n=t=>decodeURIComponent(t.replace(/\+/g," "));return r.forEach(t=>{if(t.trim()){const[r,o]=t.split(/=(.+)/g,2);r&&o&&(e[n(r)]=n(o))}}),e}static trimArrayEntries(t){return t.map(t=>t.trim())}static removeEmptyStringsFromArray(t){return t.filter(t=>!!t)}static jsonParseHelper(t){try{return JSON.parse(t)}catch(t){return null}}}class h{get urlString(){return this._urlString}constructor(t,e){if(this._urlString=t,this.correlationId=e,!this._urlString)throw c("empty_url_error",e);t.includes("#")||(this._urlString=h.canonicalizeUri(t))}static canonicalizeUri(t){if(t){let e=t.toLowerCase();return u.endsWith(e,"?")?e=e.slice(0,-1):u.endsWith(e,"?/")&&(e=e.slice(0,-2)),u.endsWith(e,"/")||(e+="/"),e}return t}validateAsUri(){let t;try{t=this.getUrlComponents()}catch(t){throw c(l,this.correlationId)}if(!t.HostNameAndPort||!t.PathSegments)throw c(l,this.correlationId);if(!t.Protocol||"https:"!==t.Protocol.toLowerCase())throw c("authority_uri_insecure",this.correlationId)}static appendQueryString(t,e){return e?t.indexOf("?")<0?`${t}?${e}`:`${t}&${e}`:t}static removeHashFromUrl(t){return h.canonicalizeUri(t.split("#")[0])}replaceTenantPath(t){const n=this.getUrlComponents(),o=n.PathSegments;return!t||0===o.length||o[0]!==e&&o[0]!==r||(o[0]=t),h.constructAuthorityUriFromObject(n,this.correlationId)}getUrlComponents(){const t=RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?"),e=this.urlString.match(t);if(!e)throw c(l,this.correlationId);const r={Protocol:e[1],HostNameAndPort:e[4],AbsolutePath:e[5],QueryString:e[7]};let n=r.AbsolutePath.split("/");return n=n.filter(t=>t&&t.length>0),r.PathSegments=n,r.QueryString&&r.QueryString.endsWith("/")&&(r.QueryString=r.QueryString.substring(0,r.QueryString.length-1)),r}static getDomainFromUrl(t,e){const r=RegExp("^([^:/?#]+://)?([^/?#]*)"),n=t.match(r);if(!n)throw c(l,e);return n[2]}static getAbsoluteUrl(t,e,r){if("/"===t[0]){const n=new h(e,r).getUrlComponents();return n.Protocol+"//"+n.HostNameAndPort+t}return t}static constructAuthorityUriFromObject(t,e){return new h(t.Protocol+"//"+t.HostNameAndPort+"/"+t.PathSegments.join("/"),e)}}const d="invalid_base64_string";class p extends n{constructor(t,e,r){super(t,e,`See https://aka.ms/msal.js.errors#${t} for details`,r),Object.setPrototypeOf(this,p.prototype),this.name="BrowserAuthError"}}function g(t,e,r){return new p(t,e,r)}function f(t){return(new TextDecoder).decode(function(t){let e=t.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw g(d,"")}const r=atob(e);return Uint8Array.from(r,t=>t.codePointAt(0)||0)}(t))}const m="signout",w="request.origin",y="urlHash",S="interaction.status",b=865,P=961;var _;function $(){const t=window.location.hash,e=window.location.search;let r,n=!1,o=!1,a="";if(t&&t.length>1){const e="#"===t.charAt(0)?t.substring(1):t,o=new URLSearchParams(e);o.has("state")&&(n=!0,a=e,r=o)}if(e&&e.length>1){const t="?"===e.charAt(0)?e.substring(1):e,n=new URLSearchParams(t);n.has("state")&&(o=!0,a=t,r=n)}if(n&&o){a=`${"?"===e.charAt(0)?e.substring(1):e}${"#"===t.charAt(0)?t.substring(1):t}`,r=new URLSearchParams(a)}if(!a||!r)throw g("empty_response","");const c=r.get("state");if(!c)throw g("no_state_in_hash","");const{libraryState:l}=function(t,e,r){if(!t)throw s("no_crypto_object",r);if(!e)throw s(i,r);try{const r=e.split("|"),n=r[0],o=r.length>1?r.slice(1).join("|"):"",s=t(n);return{userRequestState:o||"",libraryState:JSON.parse(s)}}catch(t){throw s(i,r)}}(f,c,""),{id:u,meta:h}=l;if(!u||!h)throw g("unable_to_parse_state","","missing_library_state");return{params:r,payload:a,urlHash:t,urlQuery:e,hasResponseInHash:n,hasResponseInQuery:o,libraryState:{id:u,meta:h}}}!function(t){t.Redirect="redirect",t.Popup="popup",t.Silent="silent",t.None="none"}(_||(_={}));class A{navigateInternal(t,e){return A.defaultNavigateWindow(t,e)}navigateExternal(t,e){return A.defaultNavigateWindow(t,e)}static defaultNavigateWindow(t,e){return e.noHistory?window.location.replace(t):window.location.assign(t),new Promise((t,r)=>{setTimeout(()=>{r(g("timed_out","","failed_to_redirect"))},e.timeout)})}}const I="msal";t.broadcastResponseToMainFrame=async function(t){let e;document.title="Microsoft Authentication";try{e=$()}catch(t){throw r=window,"function"==typeof r.history?.replaceState&&r.history.replaceState(null,"",`${r.location.origin}${r.location.pathname}`),t}var r;const{payload:n,urlHash:o,urlQuery:s,hasResponseInHash:i,hasResponseInQuery:a,libraryState:c}=e,{id:l,meta:u}=c;if(u.interactionType===_.Redirect){const e=t||new A;let r="",o="",s="";const i=`${I}.${S}`;try{const t=window.sessionStorage.getItem(i),e=JSON.parse(t||"");if(o=e.clientId||"",s=e.type,o){const t=`${I}.${o}.${w}`;r=window.sessionStorage.getItem(t)||""}}catch{}const a={apiId:s===m?P:b,noHistory:!0,timeout:3e4};if(o)try{window.sessionStorage.setItem(`${I}.${o}.${y}`,n)}catch{}const c=r||function(){const t=new h(window.location.href,"").getUrlComponents();return`${t.Protocol}//${t.HostNameAndPort}/`}(),l=c.endsWith("?")?c.slice(0,-1):c;return void await e.navigateInternal(l,a)}if("function"==typeof window.history.replaceState){let t=`${window.location.origin}${window.location.pathname}`;!i&&o&&(t+=o),!a&&s&&(t+=s),window.history.replaceState(null,"",t)}const d=new BroadcastChannel(l);d.postMessage({v:1,payload:n}),d.close();try{window.close()}catch{}}});