@qualcomm-ui/mdx-vite 3.8.3 → 3.8.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/angular-demo-plugin/index.d.ts +1 -1
- package/dist/angular-demo-plugin/index.d.ts.map +1 -1
- package/dist/cli.js +5 -5
- package/dist/cli.js.map +1 -1
- package/dist/docs-plugin/config/config-loader.d.ts +1 -1
- package/dist/docs-plugin/config/config-loader.d.ts.map +1 -1
- package/dist/docs-plugin/config/config-schema.d.ts +4 -48
- package/dist/docs-plugin/config/config-schema.d.ts.map +1 -1
- package/dist/docs-plugin/config/index.d.ts +2 -3
- package/dist/docs-plugin/config/index.d.ts.map +1 -1
- package/dist/docs-plugin/config/types.d.ts +1 -1
- package/dist/docs-plugin/config/types.d.ts.map +1 -1
- package/dist/docs-plugin/config/zod.d.ts +2 -6
- package/dist/docs-plugin/config/zod.d.ts.map +1 -1
- package/dist/docs-plugin/doc-props/doc-props-indexer.d.ts +1 -1
- package/dist/docs-plugin/doc-props/doc-props-indexer.d.ts.map +1 -1
- package/dist/docs-plugin/doc-props/index.d.ts +1 -1
- package/dist/docs-plugin/doc-props/index.d.ts.map +1 -1
- package/dist/docs-plugin/docs-plugin.d.ts +1 -1
- package/dist/docs-plugin/docs-plugin.d.ts.map +1 -1
- package/dist/docs-plugin/generate-page-map.d.ts.map +1 -1
- package/dist/docs-plugin/index.d.ts +7 -7
- package/dist/docs-plugin/index.d.ts.map +1 -1
- package/dist/docs-plugin/markdown/frontmatter-schema.d.ts.map +1 -1
- package/dist/docs-plugin/markdown/index.d.ts +5 -5
- package/dist/docs-plugin/markdown/index.d.ts.map +1 -1
- package/dist/docs-plugin/markdown/knowledge/filter-frontmatter.d.ts +1 -1
- package/dist/docs-plugin/markdown/knowledge/filter-frontmatter.d.ts.map +1 -1
- package/dist/docs-plugin/markdown/knowledge/index.d.ts +1 -1
- package/dist/docs-plugin/markdown/knowledge/index.d.ts.map +1 -1
- package/dist/docs-plugin/markdown/knowledge/knowledge-exporter.d.ts +3 -3
- package/dist/docs-plugin/markdown/knowledge/knowledge-exporter.d.ts.map +1 -1
- package/dist/docs-plugin/markdown/knowledge/plugins/doc-props-plugin.d.ts +1 -1
- package/dist/docs-plugin/markdown/knowledge/plugins/doc-props-plugin.d.ts.map +1 -1
- package/dist/docs-plugin/markdown/knowledge/plugins/filter-text-directives.d.ts.map +1 -1
- package/dist/docs-plugin/markdown/knowledge/plugins/index.d.ts +5 -5
- package/dist/docs-plugin/markdown/knowledge/plugins/index.d.ts.map +1 -1
- package/dist/docs-plugin/markdown/knowledge/utils.d.ts +1 -1
- package/dist/docs-plugin/markdown/knowledge/utils.d.ts.map +1 -1
- package/dist/docs-plugin/markdown/markdown-file-reader.d.ts +3 -3
- package/dist/docs-plugin/markdown/markdown-file-reader.d.ts.map +1 -1
- package/dist/docs-plugin/markdown/remark-pipeline.d.ts +3 -2
- package/dist/docs-plugin/markdown/remark-pipeline.d.ts.map +1 -1
- package/dist/docs-plugin/mdx-plugins.d.ts +1 -1
- package/dist/docs-plugin/mdx-plugins.d.ts.map +1 -1
- package/dist/docs-plugin/nav-builder/get-route-meta.d.ts +1 -1
- package/dist/docs-plugin/nav-builder/get-route-meta.d.ts.map +1 -1
- package/dist/docs-plugin/nav-builder/index.d.ts +5 -5
- package/dist/docs-plugin/nav-builder/index.d.ts.map +1 -1
- package/dist/docs-plugin/nav-builder/nav-builder.d.ts +1 -1
- package/dist/docs-plugin/nav-builder/nav-builder.d.ts.map +1 -1
- package/dist/docs-plugin/nav-builder/page-map.d.ts +2 -2
- package/dist/docs-plugin/nav-builder/page-map.d.ts.map +1 -1
- package/dist/docs-plugin/nav-builder/transform-route-meta-array.d.ts +1 -1
- package/dist/docs-plugin/nav-builder/transform-route-meta-array.d.ts.map +1 -1
- package/dist/docs-plugin/plugin-state.d.ts +4 -4
- package/dist/docs-plugin/plugin-state.d.ts.map +1 -1
- package/dist/docs-plugin/rehype/index.d.ts +2 -2
- package/dist/docs-plugin/rehype/index.d.ts.map +1 -1
- package/dist/docs-plugin/remark/index.d.ts +12 -12
- package/dist/docs-plugin/remark/index.d.ts.map +1 -1
- package/dist/docs-plugin/remark/remark-alerts.d.ts.map +1 -1
- package/dist/docs-plugin/remark/remark-serialize-jsx.d.ts.map +1 -1
- package/dist/docs-plugin/remark/remark-spoilers.d.ts.map +1 -1
- package/dist/docs-plugin/remark/remark-steps.d.ts.map +1 -1
- package/dist/docs-plugin/search-indexer.d.ts +5 -5
- package/dist/docs-plugin/search-indexer.d.ts.map +1 -1
- package/dist/docs-plugin/shiki/index.d.ts +4 -4
- package/dist/docs-plugin/shiki/index.d.ts.map +1 -1
- package/dist/docs-plugin/shiki/internal/index.d.ts +1 -1
- package/dist/docs-plugin/shiki/internal/index.d.ts.map +1 -1
- package/dist/docs-plugin/shiki/internal/shiki-transformer-tailwind.d.ts.map +1 -1
- package/dist/docs-plugin/shiki/utils.d.ts.map +1 -1
- package/dist/exports.d.ts +1 -1
- package/dist/exports.d.ts.map +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +28 -28
- package/dist/index.js.map +1 -1
- package/dist/open-web-ui/common.d.ts +1 -1
- package/dist/open-web-ui/common.d.ts.map +1 -1
- package/dist/open-web-ui/download-knowledge.d.ts.map +1 -1
- package/dist/open-web-ui/env.d.ts.map +1 -1
- package/dist/open-web-ui/upload-knowledge.d.ts.map +1 -1
- package/dist/react-demo-plugin/demo-plugin-utils.d.ts.map +1 -1
- package/dist/react-demo-plugin/index.d.ts +4 -4
- package/dist/react-demo-plugin/index.d.ts.map +1 -1
- package/dist/react-demo-plugin/react-demo-plugin.d.ts +1 -1
- package/dist/react-demo-plugin/react-demo-plugin.d.ts.map +1 -1
- package/dist/search-indexer-C9iAWDL4.js +14 -0
- package/dist/search-indexer-C9iAWDL4.js.map +1 -0
- package/package.json +10 -10
- package/dist/open-web-ui/knowledge-cleaner.d.ts +0 -14
- package/dist/open-web-ui/knowledge-cleaner.d.ts.map +0 -1
- package/dist/search-indexer-Chr-z_vN.js +0 -14
- package/dist/search-indexer-Chr-z_vN.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/open-web-ui/common.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/open-web-ui/common.ts"],"names":[],"mappings":"AAKA,OAAO,EAEL,KAAK,oBAAoB,EAC1B,MAAM,gCAAgC,CAAA;AAEvC,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,MAAM,CAAA;IACd,WAAW,EAAE,MAAM,CAAA;IACnB,GAAG,EAAE,MAAM,CAAA;CACZ;AAED;;;GAGG;AACH,MAAM,WAAW,4BAA4B;IAC3C;;OAEG;IACH,MAAM,EAAE,MAAM,CAAA;IACd;;OAEG;IACH,WAAW,EAAE,MAAM,CAAA;IACnB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IACZ;;OAEG;IACH,UAAU,EAAE,MAAM,CAAA;IAClB;;OAEG;IACH,GAAG,EAAE,MAAM,CAAA;CACZ;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC9B,WAAW,EAAE,oBAAoB,EACjC,eAAe,EAAE,MAAM,GACtB,oBAAoB,CA6BtB;AAED;;GAEG;AACH,wBAAgB,2BAA2B,CACzC,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,oBAAoB,EACjC,UAAU,EAAE,MAAM,GACjB,4BAA4B,CAU9B;AAED,UAAU,gCAAgC;IACxC,2CAA2C;IAC3C,YAAY,CAAC,EAAE,MAAM,EAAE,CAAA;CACxB;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CACvC,OAAO,GAAE,gCAAqC,GAC7C,KAAK,CAAC;IACP,WAAW,EAAE,oBAAoB,CAAA;IACjC,IAAI,EAAE,MAAM,CAAA;IACZ,UAAU,EAAE,MAAM,CAAA;CACnB,CAAC,CA0BD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"download-knowledge.d.ts","sourceRoot":"","sources":["../../src/open-web-ui/download-knowledge.ts"],"names":[],"mappings":"AAWA,wBAAgB,2BAA2B,
|
|
1
|
+
{"version":3,"file":"download-knowledge.d.ts","sourceRoot":"","sources":["../../src/open-web-ui/download-knowledge.ts"],"names":[],"mappings":"AAWA,wBAAgB,2BAA2B,IAAI,IAAI,CAyClD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../src/open-web-ui/env.ts"],"names":[],"mappings":"AAUA,wBAAgB,OAAO,
|
|
1
|
+
{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../src/open-web-ui/env.ts"],"names":[],"mappings":"AAUA,wBAAgB,OAAO,IAAI,IAAI,CAO9B;AAED,MAAM,WAAW,YAAY;IAC3B,WAAW,EAAE,MAAM,CAAA;IACnB,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;CACjB;AAED;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,YAAY,CAc/C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upload-knowledge.d.ts","sourceRoot":"","sources":["../../src/open-web-ui/upload-knowledge.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"upload-knowledge.d.ts","sourceRoot":"","sources":["../../src/open-web-ui/upload-knowledge.ts"],"names":[],"mappings":"AA8UA,wBAAgB,yBAAyB,IAAI,IAAI,CA6JhD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"demo-plugin-utils.d.ts","sourceRoot":"","sources":["../../src/react-demo-plugin/demo-plugin-utils.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,MAAM,YAAY,CAAA;AAWhC,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAA;IACd,UAAU,EAAE,KAAK,CAAC;QAChB,QAAQ,EAAE,MAAM,CAAA;QAChB,KAAK,EAAE,MAAM,CAAA;KACd,CAAC,CAAA;IACF,IAAI,EAAE,YAAY,CAAA;CACnB;AAED,MAAM,WAAW,cAAc;IAC7B,YAAY,EAAE,MAAM,CAAA;IACpB,MAAM,EAAE,MAAM,CAAA;IACd,UAAU,EAAE,KAAK,CAAC;QAChB,QAAQ,EAAE,MAAM,CAAA;QAChB,KAAK,EAAE,MAAM,CAAA;KACd,CAAC,CAAA;IACF,IAAI,EAAE,UAAU,CAAA;CACjB;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAUvD;AAED,wBAAsB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;IAClE,eAAe,EAAE,cAAc,EAAE,CAAA;IACjC,iBAAiB,EAAE,eAAe,EAAE,CAAA;CACrC,GAAG,IAAI,CAAC,CAWR;AAqCD,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,EAAE,CAAC,UAAU,CAI7D;AAkRD,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAQzE;AAED,wBAAgB,UAAU,CAAC,QAAQ,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"demo-plugin-utils.d.ts","sourceRoot":"","sources":["../../src/react-demo-plugin/demo-plugin-utils.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,MAAM,YAAY,CAAA;AAWhC,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAA;IACd,UAAU,EAAE,KAAK,CAAC;QAChB,QAAQ,EAAE,MAAM,CAAA;QAChB,KAAK,EAAE,MAAM,CAAA;KACd,CAAC,CAAA;IACF,IAAI,EAAE,YAAY,CAAA;CACnB;AAED,MAAM,WAAW,cAAc;IAC7B,YAAY,EAAE,MAAM,CAAA;IACpB,MAAM,EAAE,MAAM,CAAA;IACd,UAAU,EAAE,KAAK,CAAC;QAChB,QAAQ,EAAE,MAAM,CAAA;QAChB,KAAK,EAAE,MAAM,CAAA;KACd,CAAC,CAAA;IACF,IAAI,EAAE,UAAU,CAAA;CACjB;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAUvD;AAED,wBAAsB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;IAClE,eAAe,EAAE,cAAc,EAAE,CAAA;IACjC,iBAAiB,EAAE,eAAe,EAAE,CAAA;CACrC,GAAG,IAAI,CAAC,CAWR;AAqCD,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,EAAE,CAAC,UAAU,CAI7D;AAkRD,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAQzE;AAED,wBAAgB,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAEpD;AAED,wBAAgB,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAUpD"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from "./demo-plugin-constants";
|
|
2
|
-
export type * from "./demo-plugin-types";
|
|
3
|
-
export * from "./demo-plugin-utils";
|
|
4
|
-
export * from "./react-demo-plugin";
|
|
1
|
+
export * from "./demo-plugin-constants.js";
|
|
2
|
+
export type * from "./demo-plugin-types.js";
|
|
3
|
+
export * from "./demo-plugin-utils.js";
|
|
4
|
+
export * from "./react-demo-plugin.js";
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/react-demo-plugin/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/react-demo-plugin/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAA;AAC1C,mBAAmB,wBAAwB,CAAA;AAC3C,cAAc,wBAAwB,CAAA;AACtC,cAAc,wBAAwB,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Plugin } from "vite";
|
|
2
|
-
import type { QuiDemoPluginOptions } from "./demo-plugin-types";
|
|
2
|
+
import type { QuiDemoPluginOptions } from "./demo-plugin-types.js";
|
|
3
3
|
/**
|
|
4
4
|
* Generates virtual modules for React demo components. Virtual modules contain
|
|
5
5
|
* highlighted source code and metadata about each demo.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react-demo-plugin.d.ts","sourceRoot":"","sources":["../../src/react-demo-plugin/react-demo-plugin.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,MAAM,CAAA;AAkBhC,OAAO,KAAK,EAAC,oBAAoB,EAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"react-demo-plugin.d.ts","sourceRoot":"","sources":["../../src/react-demo-plugin/react-demo-plugin.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,MAAM,CAAA;AAkBhC,OAAO,KAAK,EAAC,oBAAoB,EAAC,MAAM,wBAAwB,CAAA;AAgChE;;;GAGG;AACH,wBAAgB,eAAe,CAAC,EAC9B,WAAyC,EACzC,SAAwB,EACxB,KAGC,EACD,YAAiB,EACjB,aAAa,EACb,uBAAuB,GACxB,GAAE,oBAAyB,GAAG,MAAM,CA0epC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import{execSync as e}from"node:child_process";import{dirname as t,join as n,posix as r,resolve as i}from"node:path";import{readFileSync as a}from"node:fs";import{access as o}from"node:fs/promises";import{cosmiconfigSync as s}from"cosmiconfig";import{z as c}from"zod";import l from"chalk";import{defined as u}from"@qualcomm-ui/utils/guard";import d from"remark-mdx";import f from"remark-parse";import p from"remark-stringify";import{unified as m}from"unified";import{EXIT as ee,SKIP as te,visit as h}from"unist-util-visit";import{UniqueIdService as ne,isNavBadge as re}from"@qualcomm-ui/mdx-common";import{createHash as g}from"node:crypto";import _ from"remark-frontmatter";import ie from"remark-parse-frontmatter";import v from"remark-gfm";import{remove as y}from"unist-util-remove";import{toString as ae}from"mdast-util-to-string";import b from"typescript";import{sortBy as oe}from"lodash-es";import{v4 as x}from"uuid";import{capitalCase as S}from"@qualcomm-ui/utils/change-case";function C(e){return e.replaceAll(`\\`,`/`)}function se(e){return e.endsWith(`/`)?e.substring(0,e.length-1):e}function w(){return{with:e=>c.object(e)}}var ce=w().with({id:c.never().optional(),sectionTitle:c.string().optional(),separator:c.boolean().optional()}),T=w().with({children:c.array(c.lazy(()=>T)).optional(),expanded:c.boolean().optional(),group:c.string().optional(),groupOrder:c.string().array().optional(),hidden:c.boolean().optional(),hideBreadcrumbs:c.boolean().optional(),hideFromSearch:c.boolean().optional(),hidePageLinks:c.boolean().optional(),hideSideNav:c.boolean().optional(),hideToc:c.boolean().optional(),id:c.string(),ignoreRouteMetaOrder:c.boolean().optional(),restricted:c.boolean().optional(),sectionTitle:c.never().optional(),separator:c.never().optional(),sideNavTitle:c.string().optional(),title:c.string().optional()}),le=w().with({includeInSearchIndex:c.boolean().optional()}),ue=w().with({contents:c.string(),id:c.string(),processAsMdx:c.boolean().optional(),title:c.string().optional()}),de=c.object({exclude:c.array(c.string()).optional(),include:c.array(c.string()).optional()}).optional(),fe=w().with({outputPath:c.string().optional()}),pe=w().with({depths:c.array(c.number()).optional(),minContentLength:c.number().optional(),outputPath:c.string().optional()}),me=w().with({envFile:c.string().optional(),id:c.string()}),he=w().with({baseUrl:c.string().optional(),exclude:c.array(c.string()).optional(),extraFiles:c.array(ue).optional(),frontmatter:de,integrations:c.object({openWebUi:c.array(me).optional()}).optional(),outputPath:c.string().optional(),pageIdPrefix:c.string().optional(),pages:fe.optional(),sections:pe.optional()}),ge=w().with({appDirectory:c.string().optional(),disableCache:c.boolean().optional(),headings:c.array(c.union([c.literal(`h1`),c.literal(`h2`),c.literal(`h3`),c.literal(`h4`),c.literal(`h5`),c.literal(`h6`)])).optional(),hotUpdateIgnore:c.instanceof(RegExp).optional(),knowledge:he.optional(),navConfig:c.array(c.union([T,ce])).optional(),pageDirectory:c.string().optional(),pageTimestampMetadata:c.union([c.literal(`off`),c.literal(`timestamp`),c.literal(`user-and-timestamp`)]).optional(),routingStrategy:c.union([c.literal(`vite-generouted`),c.literal(`react-router-directory-groups`),c.any()]).optional(),throwOnError:c.boolean().optional(),typeDocProps:c.string().optional(),typeDocPropsOptions:le.optional(),validatePageLinks:c.boolean().optional()});function _e(e){return ge.safeParse(e)}var ve=class{options;constructor(e){return this.options=e,this}getCosmiconfig(){let e=s(`qui-docs`),t=this.options.configFile?e.load(this.options.configFile):e.search();if(!t)throw Error(`Config file not found. Please consult the docs at https://docs.qui.qualcomm.com/guide/page-setup#config`);return t}resolveConfigFromCosmiconfig(e){let t=_e(e.config);if(!t.success)throw console.dir(t.error.issues,{depth:10}),Error(`Failed to parse config file.`);let n=t.data;return{...n,appDirectory:n.appDirectory||`app`,filePath:e.filepath,pageDirectory:n.pageDirectory?se(n.pageDirectory):`routes`,validatePageLinks:n.validatePageLinks??!0}}loadConfig(){let e=this.getCosmiconfig();return this.resolveConfigFromCosmiconfig(e)}};function E(e){let t=e.replace(/[<>]/g,``).replace(/[^\w\s-]/g,``).trim();return t.includes(` `)?t.toLowerCase().replace(/\s+/g,`-`).replace(/^-+|-+$/g,``):(t.match(/[A-Z]/g)||[]).length>=2?t.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).replace(/([A-Z]+)([A-Z][a-z])/g,`$1-$2`).toLowerCase():t.toLowerCase()}var D=class{seenIds=new Map;reset(){this.seenIds.clear()}createSlug(e){let t=E(e),n=this.seenIds.get(t)||0;return this.seenIds.set(t,n+1),n>0?`${t}-${n}`:t}};function ye(){return{with:e=>c.object(e)}}var be=ye().with({categories:c.string().array().optional(),description:c.string().optional(),group:c.string().optional(),hidden:c.boolean().optional(),hideBreadcrumbs:c.boolean().optional(),hideFromSearch:c.boolean().optional(),hidePageLinks:c.boolean().optional(),hideSideNav:c.boolean().optional(),hideToc:c.boolean().optional(),id:c.string().optional(),restricted:c.boolean().optional(),sideNavTitle:c.string().optional(),title:c.string(),updatedBy:c.string().optional(),updatedOn:c.string().optional()});function xe(t,n){let r=new Map;if(n===`off`)return r;try{let a=e(`git rev-parse --show-toplevel`,{encoding:`utf-8`}).trim(),o=e(`git log --format="COMMIT%x09${n===`user-and-timestamp`?`%cI%x09%aN`:`%cI`}" --name-only -- "${t}/**/*.mdx"`,{encoding:`utf-8`,stdio:[`pipe`,`pipe`,`pipe`]}),s={};for(let e of o.split(`
|
|
2
|
+
`))if(e.startsWith(`COMMIT `)){let t=e.split(` `);s=n===`user-and-timestamp`?{updatedBy:t[2],updatedOn:t[1]}:{updatedOn:t[1]}}else if(e.trim()){let t=i(a,e.trim());r.has(t)||r.set(t,s)}}catch{}return r}var O=class{enabled;pageTimestampMetadata;cachedFileCount=0;gitMetadataMap=new Map;logWarnings=!0;mdxCache={};constructor(e,t=`off`){this.enabled=e,this.pageTimestampMetadata=t}hash(e){return g(`md5`).update(e).digest(`hex`)}reset(){this.cachedFileCount=0}readCache(e){return this.mdxCache[e]||null}checkCache(e,t){if(!this.enabled)return;let n=this.hash(t),r=this.mdxCache[e];if(r?.md5===n)return this.cachedFileCount++,{collectedLinks:r.collectedLinks,frontmatter:r.frontmatter,page:r.page,pageDocProps:r.pageDocProps,pageDocPropSections:r.pageDocPropSections}}parseFrontmatter(e,t,n){let r;if(n)r={data:{frontmatter:n}};else{let e=t.substring(0,t.indexOf(`
|
|
3
|
+
---`)+4);r=m().use(f).use(_,[`yaml`]).use(ie).use(p).processSync(e)}let i=r.data.frontmatter??{title:``};if(!i.title){let e=t.split(`
|
|
4
|
+
`).find(e=>e.startsWith(`# `));e&&(i.title=e.substring(2).trim())}!i.title&&this.logWarnings&&console.debug(l.red.bold(`Missing title:`),e);let a=be.safeParse(i);return a.success||(console.debug(`${l.redBright.bold(`Invalid frontmatter detected for file`)}: ${e}\n`),console.debug(l.redBright.bold(`Please check the following fields:`)),a.error.issues.map(e=>{console.debug(`- ${e.path.join(`.`)}`)})),i}enrichWithGitMetadata(e,t,n){let r=this.mdxCache[e];if(!this.enabled||!r){let n=this.gitMetadataMap.get(e)??{};!t.updatedOn&&n.updatedOn&&(t.updatedOn=n.updatedOn),!t.updatedBy&&n.updatedBy&&(t.updatedBy=n.updatedBy)}else !n&&r&&(!t.updatedOn&&r.frontmatter.updatedOn&&(t.updatedOn=r.frontmatter.updatedOn),!t.updatedBy&&r.frontmatter.updatedBy&&(t.updatedBy=r.frontmatter.updatedBy))}readFileSync(e){let t=a(e,`utf-8`),n=this.checkCache(e,t),r=this.parseFrontmatter(e,t,n?.frontmatter);return this.enrichWithGitMetadata(e,r,n),{cached:n,fileContents:t,frontmatter:r}}updateCache(e,t,n){this.enabled&&(this.mdxCache[e]={...n,md5:this.hash(t)})}};function k(e){if(!e.value)return[];if(typeof e.value==`string`)return[e.value];if(e.value.type===`mdxJsxAttributeValueExpression`){let t=e.value.data?.estree;if(!t?.body?.[0]||t.body[0].type!==`ExpressionStatement`)return[];let n=t.body[0].expression;if(n.type===`ArrayExpression`){let e=[];for(let t of n.elements)t?.type===`Literal`&&typeof t.value==`string`&&e.push(t.value);return e}if(n.type===`Literal`&&typeof n.value==`string`)return[n.value]}return[]}var Se=/^\[!(NOTE|TIP|SUCCESS|WARNING|CAUTION)(\/.*)?\]/i,A=()=>e=>{h(e,`blockquote`,e=>{let t=``,n=``,r=!0,i=e.children.map(e=>{if(r&&e.type===`paragraph`){let i=e.children[0],a=i.type===`text`?i.value:``,o=Se,s=a.match(o);if(s&&(r=!1,t=s[1].toLocaleLowerCase(),n=s[2]||t.toLocaleUpperCase(),a.includes(`
|
|
5
|
+
`)&&(e.children[0]={type:`text`,value:a.replace(o,``).replace(/^\n+/,``)}),!a.includes(`
|
|
6
|
+
`))){let t=[];for(let n=0;n<e.children.length;n++){let r=e.children[n];n!==0&&(n===1&&r.type===`break`||t.push(r))}e.children=[...t]}}return e});n=n.replace(/^\//,``),t&&(e.data={hName:`div`,hProperties:{class:`qui-notification__root`,"data-emphasis":we[t]||`neutral`,"data-orientation":`vertical`,dir:`auto`}},e.children=[{children:[j(t)],data:{hProperties:{class:`qui-notification__icon`,"data-inline-notification-part":`status-icon`}},type:`paragraph`},{children:[{type:`text`,value:n}],data:{hProperties:{class:`qui-notification__label`,dir:`auto`}},type:`paragraph`},{children:i,data:{hName:`div`,hProperties:{class:`qui-notification__description`,dir:`auto`}},type:`blockquote`}])})};function j(e){return{children:Ce[e]??[],data:{hName:`svg`,hProperties:{ariaHidden:`true`,class:`lucide`,fill:`transparent`,height:`20`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`2`,viewBox:`0 0 24 24`,width:`20`}},type:`emphasis`}}var Ce={caution:[{children:[],data:{hName:`polygon`,hProperties:{points:`7.86 2 16.14 2 22 7.86 22 16.14 16.14 22 7.86 22 2 16.14 2 7.86 7.86 2`}},type:`emphasis`},{children:[],data:{hName:`line`,hProperties:{x1:`12`,x2:`12`,y1:`8`,y2:`12`}},type:`emphasis`},{children:[],data:{hName:`line`,hProperties:{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`}},type:`emphasis`}],note:[{children:[],data:{hName:`circle`,hProperties:{cx:`12`,cy:`12`,r:`10`}},type:`emphasis`},{children:[],data:{hName:`path`,hProperties:{d:`M12 16v-4`}},type:`emphasis`},{children:[],data:{hName:`path`,hProperties:{d:`M12 8h.01`}},type:`emphasis`}],success:[{children:[],data:{hName:`path`,hProperties:{d:`M20 6 9 17l-5-5`}},type:`emphasis`}],tip:[{children:[],data:{hName:`path`,hProperties:{d:`M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5`}},type:`emphasis`},{children:[],data:{hName:`path`,hProperties:{d:`M9 18h6`}},type:`emphasis`},{children:[],data:{hName:`path`,hProperties:{d:`M10 22h4`}},type:`emphasis`}],warning:[{children:[],data:{hName:`path`,hProperties:{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`}},type:`emphasis`},{children:[],data:{hName:`path`,hProperties:{d:`M12 9v4`}},type:`emphasis`},{children:[],data:{hName:`path`,hProperties:{d:`M12 17h.01`}},type:`emphasis`}]},we={caution:`danger`,note:`neutral`,success:`success`,tip:`info`,warning:`warning`};function M(e){if(!e)return{label:null,remainingMeta:``,tabsGroup:null};let t=e.match(/tabs=["']([^"']+)["']|tabs=(\S+)/),n=e.match(/label=["']([^"']+)["']|label=(\S+)/),r=t?t[1]||t[2]:null;return{label:n?n[1]||n[2]:null,remainingMeta:e.replace(/\s*tabs=["']([^"']+)["']/g,``).replace(/\s*tabs=(\S+)/g,``).replace(/\s*label=["']([^"']+)["']/g,``).replace(/\s*label=(\S+)/g,``).trim(),tabsGroup:r}}function Te(e,t,n){let r=[],i=e;for(;i<t.children.length;){let e=t.children[i];if(!e||e.type!==`code`)break;let a=e;if(!a.meta)break;let{label:o,remainingMeta:s,tabsGroup:c}=M(a.meta);if(!c||!o||c!==n||(a.meta=s||void 0,r.push({index:i,label:o,meta:s||void 0,tabsGroup:c}),s&&s.includes(`end`)))break;i++}return r}function Ee(e,t){let n={attributes:[],children:[],name:`CodeTabs`,type:`mdxJsxFlowElement`};for(let r of e){let e=t.children[r.index],i=[{name:`label`,type:`mdxJsxAttribute`,value:r.label}];r.meta&&i.push({name:`meta`,type:`mdxJsxAttribute`,value:r.meta});let a={attributes:i,children:[{lang:e.lang,meta:e.meta,type:`code`,value:e.value}],name:`CodeTab`,type:`mdxJsxFlowElement`};n.children.push(a)}return[n]}var De=()=>e=>{let t=[];h(e,`code`,(e,n,r)=>{if(!e.meta||!r||n===void 0)return;let{label:i,tabsGroup:a}=M(e.meta);if(!a||!i||t.some(e=>e.parent===r&&n>=e.startIndex&&n<e.endIndex))return;let o=Te(n,r,a);if(o.length>1){let e=o[0].index,n=o[o.length-1].index+1,i=Ee(o,r);t.push({endIndex:n,parent:r,replacement:i,startIndex:e})}}),t.sort((e,t)=>t.startIndex-e.startIndex).forEach(e=>{e.parent.children.splice(e.startIndex,e.endIndex-e.startIndex,...e.replacement)})};function Oe(e){let t=e.trim();return t.startsWith(`[`)&&t.endsWith(`]`)?t.slice(1,-1).split(`,`).map(e=>e.trim()).filter(Boolean):t}function N(e){let t={},n=e.split(`
|
|
7
|
+
`);for(let e of n){let n=e.trim();if(!n||n===`:::`)continue;let r=n.indexOf(`:`);if(r===-1)continue;let i=n.slice(0,r).trim(),a=n.slice(r+1).trim();i&&a&&(t[i]=Oe(a))}return t}function P(e){return e.split(`
|
|
8
|
+
`).map(e=>e.trim()).filter(e=>e&&e!==`:::`)}var F=(e={})=>t=>{let n=[];h(t,`paragraph`,(t,r,i)=>{if(!i||r===void 0)return;let a=t.children[0];if(a?.type!==`text`)return;let o=a.value,s=o.match(/^:::\s*meta\s*/),c=o.match(/^:::\s*terms\s*/);if(!s&&!c)return;let l=s||c,u=!!c;if(o.includes(`:::`)&&o.lastIndexOf(`:::`)>l[0].length){let t=o.slice(l[0].length),a=t.lastIndexOf(`:::`),s=t.slice(0,a);if(u){let t=P(s);if(t.length>0){let n=e.terms;e.terms=Array.isArray(n)?[...n,...t]:t}}else{let t=N(s);Object.assign(e,t)}return n.push({index:r,parent:i}),te}let d=o;for(let e=1;e<t.children.length;e++){let n=t.children[e];n.type===`text`&&(d+=n.value)}let f=d.slice(l[0].length),p=f.lastIndexOf(`:::`);if(p!==-1){let t=f.slice(0,p);if(u){let n=P(t);if(n.length>0){let t=e.terms;e.terms=Array.isArray(t)?[...t,...n]:n}}else{let n=N(t);Object.assign(e,n)}return n.push({index:r,parent:i}),te}});for(let e=n.length-1;e>=0;e--){let{index:t,parent:r}=n[e];r.children.splice(t,1)}},ke=()=>e=>{h(e,`mdxFlowExpression`,(e,t,n)=>{if(e.value.trim()!==`frontmatter.description`||t===void 0||!n)return;let r={attributes:[{name:`className`,type:`mdxJsxAttribute`,value:`mdx qui-docs__page-description`}],children:[e],name:`p`,type:`mdxJsxFlowElement`};n.children[t]=r})},Ae=/^\s*frontmatter\.(\w+)\s*$/;function je(e){let t=e;return(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)&&typeof t.value==`string`}var I=e=>t=>{h(t,(t,n,r)=>{if(!je(t)||n===void 0||!r)return;let i=t.value.match(Ae);if(!i)return;let a=e[i[1]];if(typeof a==`string`||typeof a==`number`){let e={type:`text`,value:String(a)};r.children[n]=e}})},Me=()=>e=>{h(e,`heading`,(e,t,n)=>{if(t===void 0||!n||e.depth!==1)return;let r={attributes:[],children:e.children,name:`PageHeader`,type:`mdxJsxFlowElement`};return n.children[t]=r,ee})},L=()=>(e,t,n)=>{y(e,e=>e.type===`code`&&e.lang===`mermaid`),n()},R=()=>(e,t,n)=>{y(e,`mdxjsEsm`),y(e,`mdxJsxFlowElement`),y(e,`mdxJsxTextElement`),n()},Ne={};function Pe(e=``,t){return e?()=>{let n=t||Ne,r=n.prefix||``,i=new Set(n.allowedLevels||[2,3,4]),a=new Map;function o(e){let t=e.replace(/[<>]/g,``).replace(/[^\w\s-]/g,``).trim(),n;n=t.includes(` `)?t.toLowerCase().replace(/\s+/g,`-`).replace(/^-+|-+$/g,``):(t.match(/[A-Z]/g)||[]).length>=2?t.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).replace(/([A-Z]+)([A-Z][a-z])/g,`$1-$2`).toLowerCase():t.toLowerCase();let r=a.get(n)||0;return a.set(n,r+1),r>0?`${n}-${r}`:n}return t=>{a.clear(),h(t,`heading`,t=>{if(i.has(t.depth)){let n=r+o(ae(t));t.children=[{children:t.children,type:`link`,url:`${e}#${n}`}]}})}}:()=>{}}function z(e){return e.match(/^:::\s*serialize-jsx\s*$/)}function B(e){return e.trim()===`:::`}function Fe(e){return!!z(e)||!!B(e)}var Ie=e=>e.type===`mdxJsxFlowElement`||e.type===`mdxJsxTextElement`;function V(e){return()=>t=>{h(t,`paragraph`,(t,n,r)=>{if(!r||n===void 0)return;let i=t.children[0];if(i?.type!==`text`||!z(i.value))return;let a=n+1,o=[];for(;a<r.children.length;){let e=r.children[a];if(e.type===`paragraph`){let t=e.children[0];if(t?.type===`text`&&B(t.value))break}o.push(e),a++}a>=r.children.length||r.children.splice(n,a-n+1,...o.filter(e))})}}var Le=V(Ie),H=V(e=>!Ie(e));function U(e){return e.match(/^:::\s*spoiler\s*(.*)$/)}function W(e){return e.trim()===`:::`}function G(e){return!!U(e)||W(e)}var Re=(e={})=>{let{defaultSummary:t=`Open spoiler`,detailsClassName:n=[],summaryClassName:r=[]}=e;return e=>{h(e,`paragraph`,(e,i,a)=>{if(!a||i===void 0)return;let o=e.children[0];if(o?.type!==`text`)return;let s=U(o.value);if(!s)return;let c=s[1].trim()||t,l=i+1,u=[];for(;l<a.children.length;){let e=a.children[l];if(e.type===`paragraph`){let t=e.children[0];if(t?.type===`text`&&W(t.value.trim()))break}u.push(e),l++}if(l>=a.children.length)return;let d={attributes:r.length?[{name:`className`,type:`mdxJsxAttribute`,value:r.join(` `)}]:[],children:[{children:[{type:`text`,value:c}],type:`paragraph`}],name:`SpoilerSummary`,type:`mdxJsxFlowElement`},f={attributes:[],children:u,name:`SpoilerContent`,type:`mdxJsxFlowElement`},p={attributes:n.length?[{name:`className`,type:`mdxJsxAttribute`,value:n.join(` `)}]:[],children:[d,f],name:`SpoilerRoot`,type:`mdxJsxFlowElement`};a.children.splice(i,l-i+1,p)})}},K=new Set([2,3,4]);function ze(e){let t=e.match(/^h([1-6])(?:-h([1-6]))?$/);if(!t)return;let n=Number(t[1]),r=t[2]?Number(t[2]):n;if(n>r)return;let i=new Set;for(let e=n;e<=r;e++)i.add(e);return i}function Be(e){return e.type===`heading`}function q(e){return e.match(/^:::\s*steps(?:\s+(h[1-6](?:-h[1-6])?))?\s*$/)}function J(e){return e.match(/^:::\s*\/steps\s*$/)}function Ve(e){return!!(q(e)||J(e))}var He=()=>e=>{h(e,`paragraph`,(e,t,n)=>{if(!n||t===void 0)return;let r=e.children[0];if(r?.type!==`text`)return;let i=q(r.value);if(!i)return;let a=i[1]?ze(i[1])??K:K,o=t+1,s=[];for(;o<n.children.length;){let e=n.children[o];if(e.type===`paragraph`){let t=e.children[0];if(t?.type===`text`&&J(t.value))break}Be(e)&&a.has(e.depth)&&(e.data={...e.data,hProperties:{...e.data?.hProperties,"data-step":``}}),s.push(e),o++}if(o>=n.children.length)return;let c={attributes:[],children:s,name:`HeadingSteps`,type:`mdxJsxFlowElement`};n.children.splice(t,o-t+1,c)})};function Y(e={}){let t=m().use(f);if(e.mdx&&t.use(d),e.frontmatter&&t.use(_,[`yaml`]),e.removeJsx&&t.use(R),e.removeMermaidCodeBlocks&&t.use(L),e.gfm&&t.use(v),e.alerts&&t.use(A),e.interpolateFrontmatter&&t.use(I,e.interpolateFrontmatter),e.extractMeta&&t.use(F,e.extractMeta),e.plugins)for(let n of e.plugins)Array.isArray(n)?t.use(...n):t.use(n);return e.output===`md`&&t.use(p),t}function Ue(e){if(e.name!==`unionWithPick`||!e.value||typeof e.value==`string`)return null;let t=e.value.data?.estree;if(!t?.body?.[0]||t.body[0].type!==`ExpressionStatement`)return null;let n=t.body[0].expression;if(n.type!==`ObjectExpression`)return null;let r={};for(let e of n.properties){if(e.type!==`Property`||e.key.type!==`Identifier`||e.value.type!==`ArrayExpression`)continue;let t=e.key.name,n=[];for(let t of e.value.elements)t?.type===`Literal`&&typeof t.value==`string`&&n.push(t.value);r[t]=n}return r}var We=[`TypeDocProps`,`TypeDocAttributes`,`TypeDocAngularAttributes`,`TypeDocFunction`],Ge=class{docPropsEntries=[];idService=new ne;props;pageDocProps={};constructor(e){this.props=e}reset(){this.idService.reset(),this.docPropsEntries=[]}getTypeDocPropsNodes=()=>(e,t,n)=>{h(e,`mdxJsxFlowElement`,e=>{if(e&&`name`in e&&We.includes(e.name)){let t=e.attributes?.find(e=>e.name===`name`),n=e.attributes?.find(e=>e.name===`omitFrom`),r=n?k(n):void 0;if(t){let e=k(t);for(let t of e)this.docPropsEntries.push({name:t,omitFrom:r}),t.endsWith(`Props`)&&this.docPropsEntries.push({name:t.slice(0,-5),omitFrom:r})}let i=e.attributes?.find(e=>e.name===`unionWithPick`);if(i)try{let e=Ue(i);e&&this.docPropsEntries.push(...Object.keys(e).map(e=>({name:e,omitFrom:r})))}catch{}}}),n()};build(e,t){if(m().use(d).use(this.getTypeDocPropsNodes).use(f).use(p).processSync(e),!this.docPropsEntries.length)return null;for(let e of t)this.idService.add(e.id);return this.docPropsEntries.map(e=>{let t=this.props[e.name];if(!t)return[];let n=new Set((e.omitFrom??[]).map(e=>{let t=this.props[e];return t?[t.props,t.input,t.output,t.publicMethods].reduce((e,t)=>(t&&e.push(...t.map(e=>e.name)),e),[]):[]}).flat(1).filter(Boolean)),r=[],i=e=>{if(!e)return;let t=[];for(let i of e){if(n.has(i.name))continue;let e=this.idService.add(i.name);t.push({...i,id:e}),r.push(this.assembleProp(i,e))}return t},a=t.resolvedType,o=a?.type===`signature`&&a.functionParameters?.length?this.assembleFunctionParams(a.functionParameters,r):void 0;return this.pageDocProps[e.name]={...this.props[e.name],input:i(t.input),output:i(t.output),props:i(t.props),publicMethods:i(t.publicMethods),resolvedType:o?{...a,functionParameters:o}:a},r}).flat()}getDocProps(){return this.docPropsEntries.reduce((e,t)=>{let n=this.pageDocProps[t.name];return n&&(e[t.name]=n),e},{})}assembleFunctionParams(e,t){return e.map(e=>{let n=this.idService.add(e.name);t.push(this.assembleProp(e,n));let r=e.args?.length?this.assembleFunctionParams(e.args,t):void 0;return{...e,args:r,id:n}})}assembleProp(e,t){let n={headingLevel:4,id:t,tagName:`a`,textContent:e.name},r=e.comment;return r?{content:[{tagName:`p`,text:[r.summary.map(e=>e.text.replaceAll(`
|
|
9
|
+
`,` `)).join(``)]}],heading:n}:{content:[],heading:n}}},Ke=[`https://`,`http://`,`mailto:`,`tel:`];function qe(e){return Ke.some(t=>e.startsWith(t))}function Je(e,t){if(qe(e))return null;let[n,i]=e.split(`#`,2),a;if(!n||n===`./`||n===`.`)a=t;else if(n.startsWith(`/`))a=n;else{let e=t.endsWith(`/`)?t:r.dirname(t);a=r.resolve(e,n)}return a!==`/`&&a.endsWith(`/`)&&(a=a.slice(0,-1)),{fragment:i||void 0,pathname:a}}function Ye(e,t,n){let r=[];return h(e,`link`,e=>{let i=Je(e.url,n);i&&r.push({fragment:i.fragment,sourceFile:t,sourcePathname:n,targetPathname:i.pathname,url:e.url})}),r}function Xe(e,t){let n=e.attributes.find(e=>e.type===`mdxJsxAttribute`&&e.name===t);return typeof n?.value==`string`?n.value:void 0}function Ze(e){let t=new Set,n=e=>{if(e.name!==`a`)return;let n=Xe(e,`id`);n&&t.add(n)};return h(e,`mdxJsxFlowElement`,n),h(e,`mdxJsxTextElement`,n),t}function Qe(e,t,n,r){let i=[];for(let a of e){let e=t[a.targetPathname];if(!e){i.push({...a,reason:`page-not-found`});continue}if(a.fragment){let t=e.toc?.some(e=>e.id===a.fragment),o=n?.[a.targetPathname]?.has(a.fragment),s=r?.[a.targetPathname]?.has(a.fragment);!t&&!o&&!s&&i.push({...a,reason:`fragment-not-found`})}}return i}function $e(e){if(e.length===0)return;let t=new Map;for(let n of e){let e=t.get(n.sourcePathname)??[];e.push(n),t.set(n.sourcePathname,e)}console.debug(`\n${l.yellowBright.bold(`Found ${e.length} broken link${e.length===1?``:`s`}:`)}`);for(let[e,n]of t){console.debug(`\n ${l.blueBright.bold(e)}`);for(let e of n){let t=e.reason===`page-not-found`?`page not found`:`fragment "#${e.fragment}" not found`;console.debug(` ${l.red(`x`)} ${e.url} — ${t}`)}}console.debug(``)}async function X(e){return o(e).then(()=>!0).catch(()=>!1)}function Z(e){return g(`md5`).update(e).digest(`hex`)}function et(e){return e===`// preview`||/^\{\s*\/\*\s*preview\s*\*\/\s*\}$/.test(e)||/^<!--\s*preview\s*-->$/.test(e)}function tt(e){return e.split(`
|
|
10
|
+
`).filter(e=>!et(e.trim())).join(`
|
|
11
|
+
`)}function nt(e){let t=b.createSourceFile(`temp.ts`,e,b.ScriptTarget.Latest,!1,b.ScriptKind.TSX),n=[];for(let e of t.statements)if(b.isImportDeclaration(e)&&b.isStringLiteral(e.moduleSpecifier)){let t=e.moduleSpecifier.text;t.startsWith(`.`)&&n.push(t)}return n}async function rt(e,r){let a=i(t(r),e);for(let e of[`.ts`,`.tsx`,`.js`,`.jsx`,``]){let t=a+e;if(await X(t))return t}if(await X(a)){let e=n(a,`index.ts`);if(await X(e))return e}return null}function it(){return()=>e=>{h(e,`link`,e=>{let t=``;h(e,`text`,e=>{t+=e.value}),Object.assign(e,{children:void 0,type:`inlineCode`,url:void 0,value:t})})}}var at=m().use(v).use(p),ot=m().use(v).use(it()).use(p),st=class{depths;minContentLength;pageIdPrefix;constructor(e){let t=[1,2,3,4];this.depths=new Set(e?.depths??t),this.minContentLength=e?.minContentLength??0,this.pageIdPrefix=e?.pageIdPrefix??``}extract(e,t){let n=[],r=[],i=[{depth:1,text:t.title}],a=new D,o=null,s=()=>{if(!o||o.nodes.length===0)return;let e=this.buildSectionEntry(o,t);e&&e.content.length>=this.minContentLength&&n.push(e)};for(let t=0;t<e.children.length;t++){let n=e.children[t];if(n.type!==`yaml`)if(n.type===`heading`){let e=n;if(!this.depths.has(e.depth)){o?o.nodes.push(n):o={headerPath:i.map(e=>e.text),headingLevel:i[i.length-1]?.depth??1,nodes:[],startIndex:t};continue}for(s();i.length>0&&i[i.length-1].depth>=e.depth;)i.pop();let c=ae(e);i.push({depth:e.depth,text:c});let l;e.depth>1&&(l=a.createSlug(c),r.push({headingLevel:e.depth,id:l,tagName:`h${e.depth}`,textContent:c})),o={anchorId:l,headerPath:i.map(e=>e.text),headingLevel:e.depth,nodes:[],startIndex:t}}else o?o.nodes.push(n):o={headerPath:i.map(e=>e.text),headingLevel:i[i.length-1]?.depth??1,nodes:[n],startIndex:t}}return s(),{sections:n,toc:r}}extractPage(e,t){let n=e.children.filter(e=>e.type!==`yaml`);if(n.length===0)return null;let r=this.nodesToRawContent(n).trim();if(!r)return null;let i={content:r,pageId:`${this.pageIdPrefix}${t.id}`,pathname:t.pathname};return{content:r,hash:Z(JSON.stringify(i)),pageId:`${this.pageIdPrefix}${t.id}`,pathname:t.pathname,title:t.title}}buildSectionEntry(e,t){let{nodes:n,terms:r}=this.extractTerms(e.nodes),i=[],a=[],o=[];for(let e of n)if(e.type===`code`){let t=e;if(t.data?.typeDocProps){let{name:e,props:n,since:r}=t.data.typeDocProps;o.push({props:n,since:r,type:e})}a.push({code:t.value,language:t.lang??``})}else e.type===`text`&&(Ve(e.value.trim())||G(e.value.trim()))||i.push(e);let s=this.nodesToRawContent(n),c=this.nodesToContent(i),l=this.generateSectionId(e.headerPath),u=t.url&&e.anchorId?`${t.url}#${e.anchorId}`:void 0,d={headerPath:e.headerPath,pageFrontmatter:Object.keys(t.frontmatter).length?t.frontmatter:void 0,pageId:`${this.pageIdPrefix}${t.id}`,rawContent:s.trim(),terms:r.length?r:void 0,types:o.length?o:void 0,url:u},f=Z(JSON.stringify(d));return{...d,codeExamples:a.length?a:void 0,content:c.trim(),hash:f,headingLevel:e.headingLevel,sectionId:l}}extractTerms(e){let t=[],n=[];for(let r of e){if(r.type===`paragraph`){let e=r.children??[],t=e[0];if(t?.type===`text`){let r=t.value;if(r.match(/^:::\s*terms\s*/)){let t=r;for(let n=1;n<e.length;n++){let r=e[n];r.type===`text`?t+=r.value:r.type===`softBreak`&&(t+=`
|
|
12
|
+
`)}let i=this.parseTermsBlock(t);n.push(...i);continue}}}t.push(r)}return{nodes:t,terms:n}}parseTermsBlock(e){let t=e.replace(/^:::\s*terms\s*/,``),n=t.lastIndexOf(`:::`);return(n===-1?t:t.slice(0,n)).split(`
|
|
13
|
+
`).map(e=>e.trim()).filter(e=>e&&e!==`:::`)}nodesToRawContent(e){let t={children:e,type:`root`};return at.stringify(t)}nodesToContent(e){let t={children:structuredClone(e),type:`root`},n=ot.runSync(t);return ot.stringify(n)}generateSectionId(e){return e.map(e=>E(e)).join(`-`)}};function Q(e,t){let n=t[e[0]];if(n)return e.length===1?n:e.slice(1).reduce((e,t)=>e?.children?.[t],n)}var ct=class{initialRoutes=[];flatNavItems=[];get navItems(){return this._navItems}_navItems=[];metaJson;navMeta;constructor(e,t){this.navMeta=t,this.metaJson=e}add(e,t,n){this.initialRoutes.push({pageFrontmatter:t,pageSection:e,routeMeta:n})}reset(){this.initialRoutes=[],this.flatNavItems=[],this._navItems=[]}navItemSort(e,t,n){if(e.depth!==t.depth)return e.depth-t.depth;if(e.order&&!t.order)return-1;if(!e.order&&t.order)return 1;if(e.order&&t.order&&e.order!==t.order)return e.order-t.order;if(n&&e.group&&t.group){let r=e.group?n.indexOf(e.group):-1,i=t.group?n.indexOf(t.group):-1;if(r!==i){if(r!==-1&&i!==-1)return r-i;if(r!==-1)return-1;if(i!==-1)return 1}}if(e.group!==t.group){if(!e.group&&t.group)return-1;if(e.group&&!t.group)return 1;if(e.group&&t.group)return e.group.localeCompare(t.group)}return e.title.localeCompare(t.title)}resolveSideNavTitle(e,t,n){return(u(t.sideNavTitle)?t.sideNavTitle||``:e.sideNavTitle||``)||n}buildNavItem({pageFrontmatter:e,pageSection:{pathname:t,pathSegments:n,title:r},routeMeta:i}){let a=e?.id||``;if(!n.length&&t===`/`){let n=i||Q(a?[a]:[],this.metaJson);if(!n)return;this.flatNavItems.push({depth:1,expanded:n?.expanded||!1,id:`/`,order:n?.order,pathname:t,pathSegments:[],title:this.resolveSideNavTitle(e,n,n?.title||r)})}n.forEach((i,a)=>{let o=a+1;if(!this.flatNavItems.find(e=>n.slice(0,o).every((t,n)=>t===e.pathSegments[n]))){let s=a===n.length-1,c=n.slice(0,o),l=Q(s?n:c,this.metaJson)??{};this.flatNavItems.push({badges:s?this.extractBadges(e):void 0,depth:o,expanded:l?.expanded||!1,group:s?l.group||e.group:l.group,id:`/${c.join(`/`)}`,items:[],order:l?.order,pathname:s?t:void 0,pathSegments:c,title:this.resolveSideNavTitle(s?e:{},l,l?.title?l.title:s?r:S(i))})}})}ensureParent(e){let t=e.pathSegments,n=this.navItems,r,i;for(let e=0;e<t.length-1;e++){let a=t[e];if(r=n?.find(t=>t.pathSegments[e]===a),r){n=r.items??[],i=r;continue}if(i){let r=t.slice(0,e+1),o=Q(r,this.metaJson);n=[];let s={depth:r.length,id:`/routes/${r.join(`/`)}`,items:n,pathSegments:r,title:a},c=o?{...s,expanded:o.expanded,order:o.order,restricted:o.restricted,title:o.title??a}:s;i.items=i.items?[...i.items,c]:[c]}i=r}}nestedInsert(e,t,n){let r=t[0],i=n.find(e=>e.pathSegments.at(-1)===r);i?this.nestedInsert(e,t.slice(1),i.items??[]):t.length===1&&n.push(e)}buildNestedNavItems(){for(let e=0;e<this.flatNavItems.length;e++){let t=this.flatNavItems[e];if(t.depth===1){this.navItems.push(t);continue}this.ensureParent(t),this.nestedInsert(t,t.pathSegments,this.navItems)}}sortNestedNavItems(e,t){e.sort((e,n)=>this.navItemSort(e,n,t));for(let t of e)if(t.items?.length){let e=Q(t.pathSegments,this.metaJson);this.sortNestedNavItems(t.items,e?.groupOrder)}}build(){oe(this.initialRoutes,e=>e.pageSection.pathSegments.length).map(e=>this.buildNavItem(e)),this.buildNestedNavItems();let e=Q([],this.metaJson);if(this.sortNestedNavItems(this.navItems,e?.groupOrder),this.navMeta)for(let[e,t]of Object.entries(this.navMeta))this._navItems.splice(parseInt(e),0,{depth:1,id:x(),pathSegments:[],sectionTitle:t.sectionTitle,separator:t.separator,title:``});return this._navItems=this.groupNavItems(this.navItems),this._navItems=this.buildSearchMeta(this.navItems,[]),this.navItems}groupNavItems(e){let t=[],n=new Set;for(let r of e)r.group&&!n.has(r.group)&&(n.add(r.group),t.push({depth:r.depth,group:r.group,id:x(),pathSegments:[],sectionTitle:r.group,title:``})),t.push({...r,items:r.items?this.groupNavItems(r.items):void 0});return t}buildSearchMeta(e,t){let n=``,r=[];for(let i of e){let e={...i};if(e.sectionTitle?n=e.sectionTitle:e.separator&&(n=``),!e.separator){let r=n?[...t,n]:[...t],i=[...e.searchMeta||[],...r];i.length&&(e.searchMeta=[...i]),e.items&&=this.buildSearchMeta(e.items,r)}r.push(e)}return r}extractBadges(e){let t=e.badges;if(t&&typeof t==`object`&&Array.isArray(t))return t.filter(e=>re(e)&&!e.hideFromNav)}};function lt(e){return`/${e.join(`/`)}`}function ut(e,t,n){return e.reduce((r,i,a)=>{let o=e.slice(0,a+1);if(a===e.length-1)return r.push(n),r;let s=Q(o,t);return s?.title?r.push(s.title):r.push(dt(i)),r},[])}function dt(e){return e.split(`-`).map(e=>/\b(a|an|and|but|or|in|on|at)\b/.test(e)?e:S(e)).join(` `)}function ft(e){let t=e.endsWith(`mdx`)?`mdx`:`tsx`,n=e.substring(0,e.lastIndexOf(`.${t}`)).split(`/`);return n[n.length-1]===`index`?n.slice(0,n.length-1):n}var pt=/[\/\\.]/;function mt(e){return pt.test(e)}var ht=/((^|[.]|[+]\/)(index|_index))(\/[^\/]+)?$|(\/_?index\/)/;function gt(e,t,n=`$`){let r=typeof n==`string`?{paramPrefixChar:n}:n,i=r.paramPrefixChar??`$`,a=r.directoryMode??!1,o=[],s=0,c=``,l=`START`,u=`NORMAL`,d=!1;if(e.endsWith(`_layout`))return[];if(/\+\/_\./.test(e)&&(e=e.replace(/\+\/_\./g,`_+/`)),/\+\//.test(e)&&(e=e.replace(/\+\//g,`.`),d=!0),a&&/\//.test(e)){if(e.endsWith(`.route`)){let t=e.lastIndexOf(`/`);t>=0&&(e=`${e.substring(0,t).replace(/\//g,`.`)}/${e.substring(t+1)}`)}else e=e.replace(/\//g,`.`);d=!0}let f=/\//.test(e);if((d&&f||!d)&&!(e.endsWith(`.route`)||e.endsWith(`.index`))){let t=e.lastIndexOf(`/`);t>=0&&(e=e.substring(0,t))}let p=e=>{e&&o.push(e)};for(;s<e.length;){let t=e[s];switch(l){case`START`:if(c.includes(i)&&!(c.startsWith(i)||c.startsWith(`(${i}`)))throw Error(`Route params must start with prefix char ${i}: ${c}`);if(c.includes(`(`)&&!c.startsWith(`(`)&&!c.endsWith(`)`))throw Error(`Optional routes must start and end with parentheses: ${c}`);p(c),c=``,l=`PATH`;continue;case`PATH`:if(mt(t)&&u===`NORMAL`){l=`START`;break}else if(t===`[`){u=`ESCAPE`;break}else if(t===`]`){u=`NORMAL`;break}c+=t;break}s++}return p(c),(o.at(-1)===`route`||o.at(-1)===`index`||o.at(-1)===`_index`||o.at(-1)===`_route`)&&(o=o.slice(0,-1)),!t&&d&&o.at(-1)?.startsWith(`_`)&&(o=o.slice(0,-1)),o}function _t(e){let t=e.substring(0,e.lastIndexOf(`.`));return gt(t,ht.test(t))}function vt(e){let t=e.substring(0,e.lastIndexOf(`.`));return yt(t)?[]:gt(t,ht.test(t),{directoryMode:!0})}function yt(e){let t=e.split(`/`);for(let e=0;e<t.length-1;e++){let n=t[e];if(n.startsWith(`_`)&&!n.includes(`+`))return!0}return!1}function bt(e,t,n){let r=e.substring(e.indexOf(t)+t.length+1);if(typeof n==`function`)return n(r);switch(n){case`vite-generouted`:return ft(r);case`react-router-directory-groups`:return vt(r);default:return _t(r)}}function xt(e,t,r,i){if(typeof i==`string`&&i===`vite-generouted`){let i=/(\(.*\))|(\[.*\])/;return e.map(e=>e.replace(r,``)).filter(e=>e.endsWith(`.${t}`)&&!e.includes(`/_`)&&!e.includes(`/+`)).map(e=>e.split(`/`).filter(e=>!i.test(e)).join(`/`)).map(e=>n(r,e))}return typeof i==`string`&&i===`react-router-directory-groups`?e.filter(e=>e.endsWith(t)&&!e.includes(`$`)&&!St(e,r)):e.filter(e=>e.endsWith(t)&&!e.includes(`$`))}function St(e,t){let n=(e.startsWith(t)?e.slice(t.length):e).split(`/`).filter(Boolean);for(let e=0;e<n.length-1;e++){let t=n[e];if(t.startsWith(`_`)&&!t.includes(`+`))return!0}return!1}function $(e,t){let n=0;return e.reduce((e,r,i)=>{if(!(`id`in r))return(`separator`in r||`sectionTitle`in r)&&(t[i-n]=r),e;let a=r;return(a.ignoreRouteMetaOrder||a.hidden)&&n++,e[a.id]={children:a.children?$(a.children,t):void 0,expanded:a.expanded,group:a.group,groupOrder:a.groupOrder,hidden:a.hidden,hideBreadcrumbs:a.hideBreadcrumbs,hideFromSearch:a.hideFromSearch,hidePageLinks:a.hidePageLinks,hideSideNav:a.hideSideNav,hideToc:a.hideToc,order:a.ignoreRouteMetaOrder?void 0:i+1,restricted:a.restricted,title:a.title},e},{})}var Ct=class{docPropsIndexer;sectionExtractor;navBuilder;mdxFileReader;allowedHeadings;metaJson;_collectedLinks=[];_anchorIds={};_docPropIds={};routeMetaNav={};config;logWarnings;get cachedFileCount(){return this.mdxFileReader.cachedFileCount}get pageDocProps(){return this._pageDocProps}_pageDocProps={};get mdxFileCount(){return this._mdxFileCount}_mdxFileCount=0;get navItems(){return this.navBuilder.navItems}get pageMap(){return this._pageMap}_pageMap={};get searchIndex(){return this._searchIndex}_searchIndex=[];reset(){this.mdxFileReader.reset(),this._collectedLinks=[],this._anchorIds={},this._docPropIds={},this._pageMap={},this._searchIndex=[]}constructor(e,t=!0,n={}){this.config=e,this.logWarnings=t,this.allowedHeadings=new Set(Array.from(e?.headings||[`h2`,`h3`,`h4`])),this.metaJson=$(this.config.navConfig??[],this.routeMetaNav);let r=Array.from(this.allowedHeadings).map(e=>parseInt(e.charAt(1)));this.sectionExtractor=n.sectionExtractor||new st({depths:[1,...r]}),this.navBuilder=n.navBuilder||new ct(this.metaJson,this.routeMetaNav),this.docPropsIndexer=n.docPropsIndexer||new Ge(this.config.typeDocProps??{}),this.mdxFileReader=n.mdxFileReader||new O(process.env.NODE_ENV===`development`&&!this.config.disableCache,this.config.pageTimestampMetadata)}getPageEntry(e,t){let n=e.replace(this.config.srcDir,``),r=bt(n,this.config.pageDirectory,this.config.routingStrategy),i=lt(r),a=Q(r.length===0?t.id?[t.id]:[`_index`]:r,this.metaJson)??{};return{categories:t.categories??ut(r,this.metaJson,a?.title||t.title||``),data:t,description:t.description,hidden:u(a.hidden)?a.hidden:t.hidden,hideBreadcrumbs:u(a.hideBreadcrumbs)?a.hideBreadcrumbs:t.hideBreadcrumbs,hideFromSearch:u(a.hideFromSearch)?a.hideFromSearch:t.hideFromSearch,hidePageLinks:u(a.hidePageLinks)?a.hidePageLinks:t.hidePageLinks,hideSideNav:u(a.hideSideNav)?a.hideSideNav:t.hideSideNav,hideToc:u(a.hideToc)?a.hideToc:t.hideToc,id:n,pathname:i,pathSegments:r,restricted:u(a.restricted)?a.restricted:t.restricted,title:u(a.title)?a.title||``:t.title||``,updatedBy:t.updatedBy,updatedOn:t.updatedOn}}compileMdxFile(e){let{cached:t,fileContents:n,frontmatter:r}=this.mdxFileReader.readFileSync(e),i={changed:{},filePath:e},a;if(!t){let t=this.mdxFileReader.readCache(e);if(t){let e=JSON.stringify(t.frontmatter),n=JSON.stringify(r);a=t.page,e!==n&&(i.changed.frontmatter=!0)}}this.docPropsIndexer.reset();let o=this.getPageEntry(e,r);!o.categories.length&&o.title&&(o.categories=[o.title]),o.hidden||this.navBuilder.add(o,r),this._pageMap[o.pathname]=o;let s,c=[];try{if(this.config.validatePageLinks){let e=Ze(Y({frontmatter:!0,mdx:!0}).parse(n));e.size&&(this._anchorIds[o.pathname]=e)}if(t?.page)s=t.page,c=t.collectedLinks,this._collectedLinks.push(...c);else{let t=Y({alerts:!0,extractMeta:{},frontmatter:!0,gfm:!0,interpolateFrontmatter:r,mdx:!0,plugins:[H],removeJsx:!0,removeMermaidCodeBlocks:!0}),i=t.runSync(t.parse(n));this.config.validatePageLinks&&(c=Ye(i,e,o.pathname),this._collectedLinks.push(...c));let a={frontmatter:r,id:o.id,pathname:o.pathname,title:o.title,url:o.pathname},{sections:l,toc:u}=this.sectionExtractor.extract(i,a);s={sections:l,toc:u}}}catch(t){if(console.debug(`${l.yellowBright.bold(`Failed to parse mdx page content.`)} ${l.blueBright.bold(e)}`),this.config.throwOnError)throw Error(t);return{metadata:i,pageSections:[o]}}let{sections:u,toc:d}=s;if(a)for(let e=0;e<d.length;e++){let t=a.toc[e],n=d[e];if(t?.id!==n.id){i.changed.toc=!0;break}}d.length&&(this._pageMap[o.pathname].toc=d);let f=[],p={};if(this.config.typeDocProps&&(f=t?.pageDocPropSections||(this.docPropsIndexer.build(n,d)??[]),p=t?.pageDocProps||this.docPropsIndexer.getDocProps()),(f.length||Object.keys(p).length)&&(this._pageDocProps[o.pathname]=p,this.config.validatePageLinks)){let e=new Set;for(let t of f)t.heading?.id&&e.add(t.heading.id);e.size&&(this._docPropIds[o.pathname]=e)}if(t||this.mdxFileReader.updateCache(e,n,{collectedLinks:c,frontmatter:r,page:s,pageDocProps:p,pageDocPropSections:f}),r.hideFromSearch||!u.length&&!f.length)return{metadata:i,pageSections:[o]};let m=[...this.formatContentSections(u,o)];return this.config.typeDocPropsOptions?.includeInSearchIndex&&m.push(...this.formatDocPropSections(f,o)),{metadata:i,pageSections:m}}formatContentSections(e,{toc:t,...n}){return e.map((e,t)=>{let r=e.headerPath.at(-1)??n.title;return{...n,content:e.content||void 0,heading:r,headingLevel:e.headingLevel,href:e.url??n.pathname,id:`${n.id}-${t}`}})}formatDocPropSections(e,{toc:t,...n}){return e.map((e,t)=>{let r=e.content.map(e=>e.text.join(` `)).join(` `);return{...n,content:r||void 0,heading:e.heading?.textContent??n.title,headingLevel:e.heading?.headingLevel,href:e.heading?`${n.pathname}#${e.heading.id}`:n.pathname,id:`${n.id}-${t}-prop`,isDocProp:!0}})}compileTsxFile(e){let t=this.getPageEntry(e,{}),n=Q(t.pathSegments.length===0?[`_index`]:t.pathSegments,this.metaJson);return n?(t.hidden||this.navBuilder.add(t,{},n),this._pageMap[t.pathname]=t,t):null}buildIndex(e,t=!0){this.logWarnings=t,this.mdxFileReader.logWarnings=t;let n=e.map(C);this.navBuilder.reset(),this.reset();let r=xt(n,`mdx`,this.config.srcDir,this.config.routingStrategy);this._mdxFileCount=r.length,(!this.mdxFileReader.enabled||this.mdxFileReader.gitMetadataMap.size===0)&&(this.mdxFileReader.gitMetadataMap=xe(this.config.srcDir,this.mdxFileReader.pageTimestampMetadata));let i=r.map(e=>this.compileMdxFile(e)),a=i.map(e=>e.pageSections).flat();return xt(n,`tsx`,this.config.srcDir,this.config.routingStrategy).map(e=>this.compileTsxFile(e)),this._searchIndex.push(...a.filter(e=>!e.hideFromSearch)),this.navBuilder.build(),this.config.validatePageLinks&&$e(Qe(this._collectedLinks,this._pageMap,this._docPropIds,this._anchorIds)),i}};export{O as A,I as C,j as D,De as E,ve as M,C as N,A as O,Me as S,F as T,H as _,Z as a,R as b,tt as c,Y as d,Ve as f,Fe as g,Re as h,st as i,D as j,k,rt as l,G as m,bt as n,X as o,He as p,lt as r,nt as s,Ct as t,We as u,Le as v,ke as w,L as x,Pe as y};
|
|
14
|
+
//# sourceMappingURL=search-indexer-C9iAWDL4.js.map
|