@xyd-js/content 0.1.0-xyd.4 → 0.1.0-xyd.55

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 (98) hide show
  1. package/CHANGELOG.md +628 -0
  2. package/ISSUES.md +1 -0
  3. package/LICENSE +21 -0
  4. package/TODO.md +2 -0
  5. package/dist/index.d.ts +27 -1733
  6. package/dist/index.js +1602 -179
  7. package/dist/index.js.map +1 -0
  8. package/dist/md.d.ts +69 -0
  9. package/dist/md.js +23396 -0
  10. package/dist/md.js.map +1 -0
  11. package/dist/mdToc-NBBxMJ4l.d.ts +12 -0
  12. package/dist/vite.d.ts +1066 -0
  13. package/dist/vite.js +20046 -0
  14. package/dist/vite.js.map +1 -0
  15. package/package.json +27 -7
  16. package/packages/md/index.ts +22 -0
  17. package/packages/md/plugins/component-directives/index.ts +3 -0
  18. package/packages/md/plugins/component-directives/mdComponentDirective.ts +524 -0
  19. package/packages/md/plugins/component-directives/types.ts +1 -0
  20. package/packages/md/plugins/component-directives/utils.ts +27 -0
  21. package/packages/md/plugins/composer/__fixtures__/1.single-example/input.md +7 -0
  22. package/packages/md/plugins/composer/__fixtures__/1.single-example/output.json +63 -0
  23. package/packages/md/plugins/composer/__fixtures__/2.single-example-with-name/input.md +7 -0
  24. package/packages/md/plugins/composer/__fixtures__/2.single-example-with-name/output.json +63 -0
  25. package/packages/md/plugins/composer/__fixtures__/3.multiple-examples/input.md +15 -0
  26. package/packages/md/plugins/composer/__fixtures__/3.multiple-examples/output.json +122 -0
  27. package/packages/md/plugins/composer/__fixtures__/4.example-groups/input.md +23 -0
  28. package/packages/md/plugins/composer/__fixtures__/4.example-groups/output.json +184 -0
  29. package/packages/md/plugins/composer/__tests__/mdComposer.test.ts +41 -0
  30. package/packages/md/plugins/composer/__tests__/testHelpers.ts +48 -0
  31. package/packages/md/plugins/composer/index.ts +1 -0
  32. package/packages/md/plugins/composer/mdComposer.ts +146 -0
  33. package/packages/md/plugins/developer-writing/index.ts +3 -0
  34. package/packages/md/plugins/developer-writing/mdCodeRehype.ts +78 -0
  35. package/packages/md/plugins/functions/__fixtures__/external.ts +4 -0
  36. package/packages/md/plugins/functions/__fixtures__/test.js +11 -0
  37. package/packages/md/plugins/functions/__fixtures__/test.py +9 -0
  38. package/packages/md/plugins/functions/__fixtures__/test.ts +18 -0
  39. package/packages/md/plugins/functions/__tests__/mdFunctionImportCode.test.ts +295 -0
  40. package/packages/md/plugins/functions/__tests__/parseFunctionCall.test.ts +47 -0
  41. package/packages/md/plugins/functions/__tests__/testHelpers.ts +71 -0
  42. package/packages/md/plugins/functions/index.ts +11 -0
  43. package/packages/md/plugins/functions/mdFunctionChangelog.ts +124 -0
  44. package/packages/md/plugins/functions/mdFunctionImportCode.ts +83 -0
  45. package/packages/md/plugins/functions/mdFunctionUniform.ts +79 -0
  46. package/packages/md/plugins/functions/types.ts +6 -0
  47. package/packages/md/plugins/functions/uniformProcessor.ts +349 -0
  48. package/packages/md/plugins/functions/utils.ts +423 -0
  49. package/packages/md/plugins/index.ts +71 -0
  50. package/packages/md/plugins/mdCode.ts +67 -0
  51. package/packages/md/plugins/mdHeadingId.ts +47 -0
  52. package/packages/md/plugins/mdPage.ts +35 -0
  53. package/{src/mdx/themeSettings.ts → packages/md/plugins/mdThemeSettings.ts} +8 -0
  54. package/packages/md/plugins/mdToc.ts +224 -0
  55. package/packages/md/plugins/meta/index.ts +1 -0
  56. package/packages/md/plugins/meta/mdMeta.ts +189 -0
  57. package/packages/md/plugins/output-variables/__fixtures__/1.simple/input.md +22 -0
  58. package/packages/md/plugins/output-variables/__fixtures__/1.simple/output.json +191 -0
  59. package/packages/md/plugins/output-variables/__fixtures__/2.multiple-vars/input.md +21 -0
  60. package/packages/md/plugins/output-variables/__fixtures__/2.multiple-vars/output.json +127 -0
  61. package/packages/md/plugins/output-variables/__tests__/index.test.ts +28 -0
  62. package/packages/md/plugins/output-variables/__tests__/testHelpers.ts +36 -0
  63. package/packages/md/plugins/output-variables/index.ts +1 -0
  64. package/packages/md/plugins/output-variables/lib/const.ts +4 -0
  65. package/packages/md/plugins/output-variables/lib/factoryAttributes.ts +350 -0
  66. package/packages/md/plugins/output-variables/lib/factoryLabel.ts +135 -0
  67. package/packages/md/plugins/output-variables/lib/factoryName.ts +59 -0
  68. package/packages/md/plugins/output-variables/lib/index.ts +21 -0
  69. package/packages/md/plugins/output-variables/lib/outputVarsContainer.ts +328 -0
  70. package/packages/md/plugins/output-variables/lib/util.ts +494 -0
  71. package/packages/md/plugins/output-variables/remarkOutputVars.ts +22 -0
  72. package/packages/md/plugins/rehypeHeading.ts +50 -0
  73. package/packages/md/plugins/types.ts +15 -0
  74. package/packages/md/plugins/utils/componentLike.ts +72 -0
  75. package/packages/md/plugins/utils/index.ts +2 -0
  76. package/packages/md/plugins/utils/mdParameters.test.ts +114 -0
  77. package/packages/md/plugins/utils/mdParameters.ts +249 -0
  78. package/packages/md/plugins/utils/mdastTypes.ts +42 -0
  79. package/packages/md/search/index.ts +251 -0
  80. package/packages/md/search/types.ts +36 -0
  81. package/{src/vite-plugins → packages/vite}/index.ts +8 -3
  82. package/src/fs.ts +58 -0
  83. package/src/index.ts +8 -0
  84. package/src/{navigation/index.ts → navigation.ts} +54 -58
  85. package/src/types.ts +8 -0
  86. package/tsconfig.json +31 -8
  87. package/tsup.config.ts +8 -6
  88. package/vitest.config.ts +17 -0
  89. package/dist/navigation.d.ts +0 -6
  90. package/dist/navigation.js +0 -2345
  91. package/index.ts +0 -10
  92. package/navigation.ts +0 -4
  93. package/src/mdx/code.ts +0 -15
  94. package/src/mdx/options.ts +0 -23
  95. package/src/mdx/page.ts +0 -22
  96. package/src/mdx/toc.ts +0 -132
  97. package/src/utils/index.ts +0 -43
  98. package/vite.config.js +0 -53
package/dist/index.js CHANGED
@@ -1,216 +1,1639 @@
1
- // src/utils/index.ts
2
- import { promises as fs } from "fs";
3
- import path from "path";
4
- import { VFile } from "vfile";
5
- import { compile as mdxCompile } from "@mdx-js/mdx";
6
-
7
- // src/mdx/options.ts
8
- import remarkFrontmatter from "remark-frontmatter";
9
- import remarkMdxFrontmatter from "remark-mdx-frontmatter";
10
- import remarkGfm from "remark-gfm";
11
-
12
- // src/mdx/toc.ts
13
- var remarkMdxToc = (options) => () => async (ast) => {
14
- const { visit: visit4 } = await import("unist-util-visit");
15
- const { toString } = await import("mdast-util-to-string");
16
- const { valueToEstree } = await import("estree-util-value-to-estree");
17
- const { name: isIdentifierName } = await import("estree-util-is-identifier-name");
18
- const mdast = ast;
19
- const name = options.name ?? "toc";
20
- if (!isIdentifierName(name)) {
21
- throw new Error(`Invalid name for an identifier: ${name}`);
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __commonJS = (cb, mod) => function __require() {
8
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
22
15
  }
23
- const toc = [];
24
- const flatToc = [];
25
- const createEntry = (node, depth) => {
26
- let attributes = node.data || {};
27
- if (node.type === "mdxJsxFlowElement") {
28
- attributes = Object.fromEntries(
29
- node.attributes.filter((attribute) => attribute.type === "mdxJsxAttribute" && typeof attribute.value === "string").map((attribute) => [attribute.name, attribute.value])
30
- );
16
+ return to;
17
+ };
18
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
19
+ // If the importer is in node compatibility mode or this is not an ESM
20
+ // file that has been converted to a CommonJS file using a Babel-
21
+ // compatible transform (i.e. "__esModule" has not been set), then set
22
+ // "default" to the CommonJS "module.exports" for node compatibility.
23
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
24
+ mod
25
+ ));
26
+
27
+ // ../../node_modules/.pnpm/react@19.1.0/node_modules/react/cjs/react.production.js
28
+ var require_react_production = __commonJS({
29
+ "../../node_modules/.pnpm/react@19.1.0/node_modules/react/cjs/react.production.js"(exports) {
30
+ "use strict";
31
+ var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element");
32
+ var REACT_PORTAL_TYPE = Symbol.for("react.portal");
33
+ var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
34
+ var REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode");
35
+ var REACT_PROFILER_TYPE = Symbol.for("react.profiler");
36
+ var REACT_CONSUMER_TYPE = Symbol.for("react.consumer");
37
+ var REACT_CONTEXT_TYPE = Symbol.for("react.context");
38
+ var REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref");
39
+ var REACT_SUSPENSE_TYPE = Symbol.for("react.suspense");
40
+ var REACT_MEMO_TYPE = Symbol.for("react.memo");
41
+ var REACT_LAZY_TYPE = Symbol.for("react.lazy");
42
+ var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
43
+ function getIteratorFn(maybeIterable) {
44
+ if (null === maybeIterable || "object" !== typeof maybeIterable) return null;
45
+ maybeIterable = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable["@@iterator"];
46
+ return "function" === typeof maybeIterable ? maybeIterable : null;
31
47
  }
32
- return {
33
- depth,
34
- value: toString(node, { includeImageAlt: false }),
35
- attributes,
36
- children: []
48
+ var ReactNoopUpdateQueue = {
49
+ isMounted: function() {
50
+ return false;
51
+ },
52
+ enqueueForceUpdate: function() {
53
+ },
54
+ enqueueReplaceState: function() {
55
+ },
56
+ enqueueSetState: function() {
57
+ }
37
58
  };
38
- };
39
- visit4(mdast, ["heading", "mdxJsxFlowElement"], (node) => {
40
- let depth = 0;
41
- if (node.type === "mdxJsxFlowElement") {
42
- let valid = false;
43
- if (/^h[1-6]$/.test(node.name || "")) {
44
- valid = true;
45
- depth = parseInt(node.name.substring(1));
46
- } else if (options.customTags) {
47
- for (const tag of options.customTags) {
48
- if (tag.name.test(node.name || "")) {
49
- valid = true;
50
- depth = tag.depth(node.name || "");
51
- break;
59
+ var assign = Object.assign;
60
+ var emptyObject = {};
61
+ function Component(props, context, updater) {
62
+ this.props = props;
63
+ this.context = context;
64
+ this.refs = emptyObject;
65
+ this.updater = updater || ReactNoopUpdateQueue;
66
+ }
67
+ Component.prototype.isReactComponent = {};
68
+ Component.prototype.setState = function(partialState, callback) {
69
+ if ("object" !== typeof partialState && "function" !== typeof partialState && null != partialState)
70
+ throw Error(
71
+ "takes an object of state variables to update or a function which returns an object of state variables."
72
+ );
73
+ this.updater.enqueueSetState(this, partialState, callback, "setState");
74
+ };
75
+ Component.prototype.forceUpdate = function(callback) {
76
+ this.updater.enqueueForceUpdate(this, callback, "forceUpdate");
77
+ };
78
+ function ComponentDummy() {
79
+ }
80
+ ComponentDummy.prototype = Component.prototype;
81
+ function PureComponent(props, context, updater) {
82
+ this.props = props;
83
+ this.context = context;
84
+ this.refs = emptyObject;
85
+ this.updater = updater || ReactNoopUpdateQueue;
86
+ }
87
+ var pureComponentPrototype = PureComponent.prototype = new ComponentDummy();
88
+ pureComponentPrototype.constructor = PureComponent;
89
+ assign(pureComponentPrototype, Component.prototype);
90
+ pureComponentPrototype.isPureReactComponent = true;
91
+ var isArrayImpl = Array.isArray;
92
+ var ReactSharedInternals = { H: null, A: null, T: null, S: null, V: null };
93
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
94
+ function ReactElement(type, key, self, source, owner, props) {
95
+ self = props.ref;
96
+ return {
97
+ $$typeof: REACT_ELEMENT_TYPE,
98
+ type,
99
+ key,
100
+ ref: void 0 !== self ? self : null,
101
+ props
102
+ };
103
+ }
104
+ function cloneAndReplaceKey(oldElement, newKey) {
105
+ return ReactElement(
106
+ oldElement.type,
107
+ newKey,
108
+ void 0,
109
+ void 0,
110
+ void 0,
111
+ oldElement.props
112
+ );
113
+ }
114
+ function isValidElement(object) {
115
+ return "object" === typeof object && null !== object && object.$$typeof === REACT_ELEMENT_TYPE;
116
+ }
117
+ function escape(key) {
118
+ var escaperLookup = { "=": "=0", ":": "=2" };
119
+ return "$" + key.replace(/[=:]/g, function(match) {
120
+ return escaperLookup[match];
121
+ });
122
+ }
123
+ var userProvidedKeyEscapeRegex = /\/+/g;
124
+ function getElementKey(element, index) {
125
+ return "object" === typeof element && null !== element && null != element.key ? escape("" + element.key) : index.toString(36);
126
+ }
127
+ function noop$1() {
128
+ }
129
+ function resolveThenable(thenable) {
130
+ switch (thenable.status) {
131
+ case "fulfilled":
132
+ return thenable.value;
133
+ case "rejected":
134
+ throw thenable.reason;
135
+ default:
136
+ switch ("string" === typeof thenable.status ? thenable.then(noop$1, noop$1) : (thenable.status = "pending", thenable.then(
137
+ function(fulfilledValue) {
138
+ "pending" === thenable.status && (thenable.status = "fulfilled", thenable.value = fulfilledValue);
139
+ },
140
+ function(error) {
141
+ "pending" === thenable.status && (thenable.status = "rejected", thenable.reason = error);
142
+ }
143
+ )), thenable.status) {
144
+ case "fulfilled":
145
+ return thenable.value;
146
+ case "rejected":
147
+ throw thenable.reason;
52
148
  }
53
- }
54
149
  }
55
- if (!valid) {
56
- return;
150
+ throw thenable;
151
+ }
152
+ function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
153
+ var type = typeof children;
154
+ if ("undefined" === type || "boolean" === type) children = null;
155
+ var invokeCallback = false;
156
+ if (null === children) invokeCallback = true;
157
+ else
158
+ switch (type) {
159
+ case "bigint":
160
+ case "string":
161
+ case "number":
162
+ invokeCallback = true;
163
+ break;
164
+ case "object":
165
+ switch (children.$$typeof) {
166
+ case REACT_ELEMENT_TYPE:
167
+ case REACT_PORTAL_TYPE:
168
+ invokeCallback = true;
169
+ break;
170
+ case REACT_LAZY_TYPE:
171
+ return invokeCallback = children._init, mapIntoArray(
172
+ invokeCallback(children._payload),
173
+ array,
174
+ escapedPrefix,
175
+ nameSoFar,
176
+ callback
177
+ );
178
+ }
179
+ }
180
+ if (invokeCallback)
181
+ return callback = callback(children), invokeCallback = "" === nameSoFar ? "." + getElementKey(children, 0) : nameSoFar, isArrayImpl(callback) ? (escapedPrefix = "", null != invokeCallback && (escapedPrefix = invokeCallback.replace(userProvidedKeyEscapeRegex, "$&/") + "/"), mapIntoArray(callback, array, escapedPrefix, "", function(c) {
182
+ return c;
183
+ })) : null != callback && (isValidElement(callback) && (callback = cloneAndReplaceKey(
184
+ callback,
185
+ escapedPrefix + (null == callback.key || children && children.key === callback.key ? "" : ("" + callback.key).replace(
186
+ userProvidedKeyEscapeRegex,
187
+ "$&/"
188
+ ) + "/") + invokeCallback
189
+ )), array.push(callback)), 1;
190
+ invokeCallback = 0;
191
+ var nextNamePrefix = "" === nameSoFar ? "." : nameSoFar + ":";
192
+ if (isArrayImpl(children))
193
+ for (var i = 0; i < children.length; i++)
194
+ nameSoFar = children[i], type = nextNamePrefix + getElementKey(nameSoFar, i), invokeCallback += mapIntoArray(
195
+ nameSoFar,
196
+ array,
197
+ escapedPrefix,
198
+ type,
199
+ callback
200
+ );
201
+ else if (i = getIteratorFn(children), "function" === typeof i)
202
+ for (children = i.call(children), i = 0; !(nameSoFar = children.next()).done; )
203
+ nameSoFar = nameSoFar.value, type = nextNamePrefix + getElementKey(nameSoFar, i++), invokeCallback += mapIntoArray(
204
+ nameSoFar,
205
+ array,
206
+ escapedPrefix,
207
+ type,
208
+ callback
209
+ );
210
+ else if ("object" === type) {
211
+ if ("function" === typeof children.then)
212
+ return mapIntoArray(
213
+ resolveThenable(children),
214
+ array,
215
+ escapedPrefix,
216
+ nameSoFar,
217
+ callback
218
+ );
219
+ array = String(children);
220
+ throw Error(
221
+ "Objects are not valid as a React child (found: " + ("[object Object]" === array ? "object with keys {" + Object.keys(children).join(", ") + "}" : array) + "). If you meant to render a collection of children, use an array instead."
222
+ );
57
223
  }
58
- } else if (node.type === "heading") {
59
- depth = node.depth;
60
- } else {
61
- return;
224
+ return invokeCallback;
62
225
  }
63
- if (depth && ((options == null ? void 0 : options.minDepth) && options.minDepth > depth)) {
64
- return;
226
+ function mapChildren(children, func, context) {
227
+ if (null == children) return children;
228
+ var result = [], count = 0;
229
+ mapIntoArray(children, result, "", "", function(child) {
230
+ return func.call(context, child, count++);
231
+ });
232
+ return result;
65
233
  }
66
- const entry = createEntry(node, depth);
67
- flatToc.push(entry);
68
- let parent = toc;
69
- for (let i = flatToc.length - 1; i >= 0; --i) {
70
- const current = flatToc[i];
71
- if (current.depth < entry.depth) {
72
- parent = current.children;
73
- break;
234
+ function lazyInitializer(payload) {
235
+ if (-1 === payload._status) {
236
+ var ctor = payload._result;
237
+ ctor = ctor();
238
+ ctor.then(
239
+ function(moduleObject) {
240
+ if (0 === payload._status || -1 === payload._status)
241
+ payload._status = 1, payload._result = moduleObject;
242
+ },
243
+ function(error) {
244
+ if (0 === payload._status || -1 === payload._status)
245
+ payload._status = 2, payload._result = error;
246
+ }
247
+ );
248
+ -1 === payload._status && (payload._status = 0, payload._result = ctor);
74
249
  }
250
+ if (1 === payload._status) return payload._result.default;
251
+ throw payload._result;
75
252
  }
76
- parent.push(entry);
77
- });
78
- const tocExport = {
79
- type: "mdxjsEsm",
80
- value: "",
81
- data: {
82
- estree: {
83
- type: "Program",
84
- sourceType: "module",
85
- body: [
86
- {
87
- type: "ExportNamedDeclaration",
88
- specifiers: [],
89
- source: null,
90
- declaration: {
91
- type: "VariableDeclaration",
92
- kind: "const",
93
- declarations: [
94
- {
95
- type: "VariableDeclarator",
96
- id: {
97
- type: "Identifier",
98
- name
99
- },
100
- init: valueToEstree(toc)
101
- }
102
- ]
103
- }
104
- }
105
- ]
253
+ var reportGlobalError = "function" === typeof reportError ? reportError : function(error) {
254
+ if ("object" === typeof window && "function" === typeof window.ErrorEvent) {
255
+ var event = new window.ErrorEvent("error", {
256
+ bubbles: true,
257
+ cancelable: true,
258
+ message: "object" === typeof error && null !== error && "string" === typeof error.message ? String(error.message) : String(error),
259
+ error
260
+ });
261
+ if (!window.dispatchEvent(event)) return;
262
+ } else if ("object" === typeof process && "function" === typeof process.emit) {
263
+ process.emit("uncaughtException", error);
264
+ return;
106
265
  }
266
+ console.error(error);
267
+ };
268
+ function noop() {
107
269
  }
108
- };
109
- mdast.children.unshift(tocExport);
110
- };
270
+ exports.Children = {
271
+ map: mapChildren,
272
+ forEach: function(children, forEachFunc, forEachContext) {
273
+ mapChildren(
274
+ children,
275
+ function() {
276
+ forEachFunc.apply(this, arguments);
277
+ },
278
+ forEachContext
279
+ );
280
+ },
281
+ count: function(children) {
282
+ var n = 0;
283
+ mapChildren(children, function() {
284
+ n++;
285
+ });
286
+ return n;
287
+ },
288
+ toArray: function(children) {
289
+ return mapChildren(children, function(child) {
290
+ return child;
291
+ }) || [];
292
+ },
293
+ only: function(children) {
294
+ if (!isValidElement(children))
295
+ throw Error(
296
+ "React.Children.only expected to receive a single React element child."
297
+ );
298
+ return children;
299
+ }
300
+ };
301
+ exports.Component = Component;
302
+ exports.Fragment = REACT_FRAGMENT_TYPE;
303
+ exports.Profiler = REACT_PROFILER_TYPE;
304
+ exports.PureComponent = PureComponent;
305
+ exports.StrictMode = REACT_STRICT_MODE_TYPE;
306
+ exports.Suspense = REACT_SUSPENSE_TYPE;
307
+ exports.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = ReactSharedInternals;
308
+ exports.__COMPILER_RUNTIME = {
309
+ __proto__: null,
310
+ c: function(size) {
311
+ return ReactSharedInternals.H.useMemoCache(size);
312
+ }
313
+ };
314
+ exports.cache = function(fn) {
315
+ return function() {
316
+ return fn.apply(null, arguments);
317
+ };
318
+ };
319
+ exports.cloneElement = function(element, config, children) {
320
+ if (null === element || void 0 === element)
321
+ throw Error(
322
+ "The argument must be a React element, but you passed " + element + "."
323
+ );
324
+ var props = assign({}, element.props), key = element.key, owner = void 0;
325
+ if (null != config)
326
+ for (propName in void 0 !== config.ref && (owner = void 0), void 0 !== config.key && (key = "" + config.key), config)
327
+ !hasOwnProperty.call(config, propName) || "key" === propName || "__self" === propName || "__source" === propName || "ref" === propName && void 0 === config.ref || (props[propName] = config[propName]);
328
+ var propName = arguments.length - 2;
329
+ if (1 === propName) props.children = children;
330
+ else if (1 < propName) {
331
+ for (var childArray = Array(propName), i = 0; i < propName; i++)
332
+ childArray[i] = arguments[i + 2];
333
+ props.children = childArray;
334
+ }
335
+ return ReactElement(element.type, key, void 0, void 0, owner, props);
336
+ };
337
+ exports.createContext = function(defaultValue) {
338
+ defaultValue = {
339
+ $$typeof: REACT_CONTEXT_TYPE,
340
+ _currentValue: defaultValue,
341
+ _currentValue2: defaultValue,
342
+ _threadCount: 0,
343
+ Provider: null,
344
+ Consumer: null
345
+ };
346
+ defaultValue.Provider = defaultValue;
347
+ defaultValue.Consumer = {
348
+ $$typeof: REACT_CONSUMER_TYPE,
349
+ _context: defaultValue
350
+ };
351
+ return defaultValue;
352
+ };
353
+ exports.createElement = function(type, config, children) {
354
+ var propName, props = {}, key = null;
355
+ if (null != config)
356
+ for (propName in void 0 !== config.key && (key = "" + config.key), config)
357
+ hasOwnProperty.call(config, propName) && "key" !== propName && "__self" !== propName && "__source" !== propName && (props[propName] = config[propName]);
358
+ var childrenLength = arguments.length - 2;
359
+ if (1 === childrenLength) props.children = children;
360
+ else if (1 < childrenLength) {
361
+ for (var childArray = Array(childrenLength), i = 0; i < childrenLength; i++)
362
+ childArray[i] = arguments[i + 2];
363
+ props.children = childArray;
364
+ }
365
+ if (type && type.defaultProps)
366
+ for (propName in childrenLength = type.defaultProps, childrenLength)
367
+ void 0 === props[propName] && (props[propName] = childrenLength[propName]);
368
+ return ReactElement(type, key, void 0, void 0, null, props);
369
+ };
370
+ exports.createRef = function() {
371
+ return { current: null };
372
+ };
373
+ exports.forwardRef = function(render) {
374
+ return { $$typeof: REACT_FORWARD_REF_TYPE, render };
375
+ };
376
+ exports.isValidElement = isValidElement;
377
+ exports.lazy = function(ctor) {
378
+ return {
379
+ $$typeof: REACT_LAZY_TYPE,
380
+ _payload: { _status: -1, _result: ctor },
381
+ _init: lazyInitializer
382
+ };
383
+ };
384
+ exports.memo = function(type, compare) {
385
+ return {
386
+ $$typeof: REACT_MEMO_TYPE,
387
+ type,
388
+ compare: void 0 === compare ? null : compare
389
+ };
390
+ };
391
+ exports.startTransition = function(scope) {
392
+ var prevTransition = ReactSharedInternals.T, currentTransition = {};
393
+ ReactSharedInternals.T = currentTransition;
394
+ try {
395
+ var returnValue = scope(), onStartTransitionFinish = ReactSharedInternals.S;
396
+ null !== onStartTransitionFinish && onStartTransitionFinish(currentTransition, returnValue);
397
+ "object" === typeof returnValue && null !== returnValue && "function" === typeof returnValue.then && returnValue.then(noop, reportGlobalError);
398
+ } catch (error) {
399
+ reportGlobalError(error);
400
+ } finally {
401
+ ReactSharedInternals.T = prevTransition;
402
+ }
403
+ };
404
+ exports.unstable_useCacheRefresh = function() {
405
+ return ReactSharedInternals.H.useCacheRefresh();
406
+ };
407
+ exports.use = function(usable) {
408
+ return ReactSharedInternals.H.use(usable);
409
+ };
410
+ exports.useActionState = function(action, initialState, permalink) {
411
+ return ReactSharedInternals.H.useActionState(action, initialState, permalink);
412
+ };
413
+ exports.useCallback = function(callback, deps) {
414
+ return ReactSharedInternals.H.useCallback(callback, deps);
415
+ };
416
+ exports.useContext = function(Context) {
417
+ return ReactSharedInternals.H.useContext(Context);
418
+ };
419
+ exports.useDebugValue = function() {
420
+ };
421
+ exports.useDeferredValue = function(value, initialValue) {
422
+ return ReactSharedInternals.H.useDeferredValue(value, initialValue);
423
+ };
424
+ exports.useEffect = function(create, createDeps, update) {
425
+ var dispatcher = ReactSharedInternals.H;
426
+ if ("function" === typeof update)
427
+ throw Error(
428
+ "useEffect CRUD overload is not enabled in this build of React."
429
+ );
430
+ return dispatcher.useEffect(create, createDeps);
431
+ };
432
+ exports.useId = function() {
433
+ return ReactSharedInternals.H.useId();
434
+ };
435
+ exports.useImperativeHandle = function(ref, create, deps) {
436
+ return ReactSharedInternals.H.useImperativeHandle(ref, create, deps);
437
+ };
438
+ exports.useInsertionEffect = function(create, deps) {
439
+ return ReactSharedInternals.H.useInsertionEffect(create, deps);
440
+ };
441
+ exports.useLayoutEffect = function(create, deps) {
442
+ return ReactSharedInternals.H.useLayoutEffect(create, deps);
443
+ };
444
+ exports.useMemo = function(create, deps) {
445
+ return ReactSharedInternals.H.useMemo(create, deps);
446
+ };
447
+ exports.useOptimistic = function(passthrough, reducer) {
448
+ return ReactSharedInternals.H.useOptimistic(passthrough, reducer);
449
+ };
450
+ exports.useReducer = function(reducer, initialArg, init) {
451
+ return ReactSharedInternals.H.useReducer(reducer, initialArg, init);
452
+ };
453
+ exports.useRef = function(initialValue) {
454
+ return ReactSharedInternals.H.useRef(initialValue);
455
+ };
456
+ exports.useState = function(initialState) {
457
+ return ReactSharedInternals.H.useState(initialState);
458
+ };
459
+ exports.useSyncExternalStore = function(subscribe, getSnapshot, getServerSnapshot) {
460
+ return ReactSharedInternals.H.useSyncExternalStore(
461
+ subscribe,
462
+ getSnapshot,
463
+ getServerSnapshot
464
+ );
465
+ };
466
+ exports.useTransition = function() {
467
+ return ReactSharedInternals.H.useTransition();
468
+ };
469
+ exports.version = "19.1.0";
470
+ }
471
+ });
111
472
 
112
- // src/mdx/code.ts
113
- import { visit } from "unist-util-visit";
114
- function remarkInjectCodeMeta() {
115
- return (tree) => {
116
- visit(tree, "code", (node) => {
117
- if (node.meta) {
118
- node.data = node.data || {};
119
- node.data.hProperties = {
120
- ...node.data.hProperties || {},
121
- meta: node.meta
473
+ // ../../node_modules/.pnpm/react@19.1.0/node_modules/react/cjs/react.development.js
474
+ var require_react_development = __commonJS({
475
+ "../../node_modules/.pnpm/react@19.1.0/node_modules/react/cjs/react.development.js"(exports, module) {
476
+ "use strict";
477
+ "production" !== process.env.NODE_ENV && function() {
478
+ function defineDeprecationWarning(methodName, info) {
479
+ Object.defineProperty(Component.prototype, methodName, {
480
+ get: function() {
481
+ console.warn(
482
+ "%s(...) is deprecated in plain JavaScript React classes. %s",
483
+ info[0],
484
+ info[1]
485
+ );
486
+ }
487
+ });
488
+ }
489
+ function getIteratorFn(maybeIterable) {
490
+ if (null === maybeIterable || "object" !== typeof maybeIterable)
491
+ return null;
492
+ maybeIterable = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable["@@iterator"];
493
+ return "function" === typeof maybeIterable ? maybeIterable : null;
494
+ }
495
+ function warnNoop(publicInstance, callerName) {
496
+ publicInstance = (publicInstance = publicInstance.constructor) && (publicInstance.displayName || publicInstance.name) || "ReactClass";
497
+ var warningKey = publicInstance + "." + callerName;
498
+ didWarnStateUpdateForUnmountedComponent[warningKey] || (console.error(
499
+ "Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",
500
+ callerName,
501
+ publicInstance
502
+ ), didWarnStateUpdateForUnmountedComponent[warningKey] = true);
503
+ }
504
+ function Component(props, context, updater) {
505
+ this.props = props;
506
+ this.context = context;
507
+ this.refs = emptyObject;
508
+ this.updater = updater || ReactNoopUpdateQueue;
509
+ }
510
+ function ComponentDummy() {
511
+ }
512
+ function PureComponent(props, context, updater) {
513
+ this.props = props;
514
+ this.context = context;
515
+ this.refs = emptyObject;
516
+ this.updater = updater || ReactNoopUpdateQueue;
517
+ }
518
+ function testStringCoercion(value) {
519
+ return "" + value;
520
+ }
521
+ function checkKeyStringCoercion(value) {
522
+ try {
523
+ testStringCoercion(value);
524
+ var JSCompiler_inline_result = false;
525
+ } catch (e) {
526
+ JSCompiler_inline_result = true;
527
+ }
528
+ if (JSCompiler_inline_result) {
529
+ JSCompiler_inline_result = console;
530
+ var JSCompiler_temp_const = JSCompiler_inline_result.error;
531
+ var JSCompiler_inline_result$jscomp$0 = "function" === typeof Symbol && Symbol.toStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object";
532
+ JSCompiler_temp_const.call(
533
+ JSCompiler_inline_result,
534
+ "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
535
+ JSCompiler_inline_result$jscomp$0
536
+ );
537
+ return testStringCoercion(value);
538
+ }
539
+ }
540
+ function getComponentNameFromType(type) {
541
+ if (null == type) return null;
542
+ if ("function" === typeof type)
543
+ return type.$$typeof === REACT_CLIENT_REFERENCE ? null : type.displayName || type.name || null;
544
+ if ("string" === typeof type) return type;
545
+ switch (type) {
546
+ case REACT_FRAGMENT_TYPE:
547
+ return "Fragment";
548
+ case REACT_PROFILER_TYPE:
549
+ return "Profiler";
550
+ case REACT_STRICT_MODE_TYPE:
551
+ return "StrictMode";
552
+ case REACT_SUSPENSE_TYPE:
553
+ return "Suspense";
554
+ case REACT_SUSPENSE_LIST_TYPE:
555
+ return "SuspenseList";
556
+ case REACT_ACTIVITY_TYPE:
557
+ return "Activity";
558
+ }
559
+ if ("object" === typeof type)
560
+ switch ("number" === typeof type.tag && console.error(
561
+ "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
562
+ ), type.$$typeof) {
563
+ case REACT_PORTAL_TYPE:
564
+ return "Portal";
565
+ case REACT_CONTEXT_TYPE:
566
+ return (type.displayName || "Context") + ".Provider";
567
+ case REACT_CONSUMER_TYPE:
568
+ return (type._context.displayName || "Context") + ".Consumer";
569
+ case REACT_FORWARD_REF_TYPE:
570
+ var innerType = type.render;
571
+ type = type.displayName;
572
+ type || (type = innerType.displayName || innerType.name || "", type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef");
573
+ return type;
574
+ case REACT_MEMO_TYPE:
575
+ return innerType = type.displayName || null, null !== innerType ? innerType : getComponentNameFromType(type.type) || "Memo";
576
+ case REACT_LAZY_TYPE:
577
+ innerType = type._payload;
578
+ type = type._init;
579
+ try {
580
+ return getComponentNameFromType(type(innerType));
581
+ } catch (x) {
582
+ }
583
+ }
584
+ return null;
585
+ }
586
+ function getTaskName(type) {
587
+ if (type === REACT_FRAGMENT_TYPE) return "<>";
588
+ if ("object" === typeof type && null !== type && type.$$typeof === REACT_LAZY_TYPE)
589
+ return "<...>";
590
+ try {
591
+ var name = getComponentNameFromType(type);
592
+ return name ? "<" + name + ">" : "<...>";
593
+ } catch (x) {
594
+ return "<...>";
595
+ }
596
+ }
597
+ function getOwner() {
598
+ var dispatcher = ReactSharedInternals.A;
599
+ return null === dispatcher ? null : dispatcher.getOwner();
600
+ }
601
+ function UnknownOwner() {
602
+ return Error("react-stack-top-frame");
603
+ }
604
+ function hasValidKey(config) {
605
+ if (hasOwnProperty.call(config, "key")) {
606
+ var getter = Object.getOwnPropertyDescriptor(config, "key").get;
607
+ if (getter && getter.isReactWarning) return false;
608
+ }
609
+ return void 0 !== config.key;
610
+ }
611
+ function defineKeyPropWarningGetter(props, displayName) {
612
+ function warnAboutAccessingKey() {
613
+ specialPropKeyWarningShown || (specialPropKeyWarningShown = true, console.error(
614
+ "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
615
+ displayName
616
+ ));
617
+ }
618
+ warnAboutAccessingKey.isReactWarning = true;
619
+ Object.defineProperty(props, "key", {
620
+ get: warnAboutAccessingKey,
621
+ configurable: true
622
+ });
623
+ }
624
+ function elementRefGetterWithDeprecationWarning() {
625
+ var componentName = getComponentNameFromType(this.type);
626
+ didWarnAboutElementRef[componentName] || (didWarnAboutElementRef[componentName] = true, console.error(
627
+ "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
628
+ ));
629
+ componentName = this.props.ref;
630
+ return void 0 !== componentName ? componentName : null;
631
+ }
632
+ function ReactElement(type, key, self, source, owner, props, debugStack, debugTask) {
633
+ self = props.ref;
634
+ type = {
635
+ $$typeof: REACT_ELEMENT_TYPE,
636
+ type,
637
+ key,
638
+ props,
639
+ _owner: owner
122
640
  };
641
+ null !== (void 0 !== self ? self : null) ? Object.defineProperty(type, "ref", {
642
+ enumerable: false,
643
+ get: elementRefGetterWithDeprecationWarning
644
+ }) : Object.defineProperty(type, "ref", { enumerable: false, value: null });
645
+ type._store = {};
646
+ Object.defineProperty(type._store, "validated", {
647
+ configurable: false,
648
+ enumerable: false,
649
+ writable: true,
650
+ value: 0
651
+ });
652
+ Object.defineProperty(type, "_debugInfo", {
653
+ configurable: false,
654
+ enumerable: false,
655
+ writable: true,
656
+ value: null
657
+ });
658
+ Object.defineProperty(type, "_debugStack", {
659
+ configurable: false,
660
+ enumerable: false,
661
+ writable: true,
662
+ value: debugStack
663
+ });
664
+ Object.defineProperty(type, "_debugTask", {
665
+ configurable: false,
666
+ enumerable: false,
667
+ writable: true,
668
+ value: debugTask
669
+ });
670
+ Object.freeze && (Object.freeze(type.props), Object.freeze(type));
671
+ return type;
123
672
  }
124
- });
125
- };
126
- }
127
-
128
- // src/mdx/themeSettings.ts
129
- import { visit as visit2 } from "unist-util-visit";
130
- var extractThemeSettings = () => {
131
- return (tree) => {
132
- visit2(tree, "exportNamedDeclaration", (node) => {
133
- const declaration = node.declaration;
134
- if (declaration && declaration.declarations) {
135
- declaration.declarations.forEach((decl) => {
136
- if (decl.id.name === "themeSettings") {
137
- global.themeSettings = decl.init;
673
+ function cloneAndReplaceKey(oldElement, newKey) {
674
+ newKey = ReactElement(
675
+ oldElement.type,
676
+ newKey,
677
+ void 0,
678
+ void 0,
679
+ oldElement._owner,
680
+ oldElement.props,
681
+ oldElement._debugStack,
682
+ oldElement._debugTask
683
+ );
684
+ oldElement._store && (newKey._store.validated = oldElement._store.validated);
685
+ return newKey;
686
+ }
687
+ function isValidElement(object) {
688
+ return "object" === typeof object && null !== object && object.$$typeof === REACT_ELEMENT_TYPE;
689
+ }
690
+ function escape(key) {
691
+ var escaperLookup = { "=": "=0", ":": "=2" };
692
+ return "$" + key.replace(/[=:]/g, function(match) {
693
+ return escaperLookup[match];
694
+ });
695
+ }
696
+ function getElementKey(element, index) {
697
+ return "object" === typeof element && null !== element && null != element.key ? (checkKeyStringCoercion(element.key), escape("" + element.key)) : index.toString(36);
698
+ }
699
+ function noop$1() {
700
+ }
701
+ function resolveThenable(thenable) {
702
+ switch (thenable.status) {
703
+ case "fulfilled":
704
+ return thenable.value;
705
+ case "rejected":
706
+ throw thenable.reason;
707
+ default:
708
+ switch ("string" === typeof thenable.status ? thenable.then(noop$1, noop$1) : (thenable.status = "pending", thenable.then(
709
+ function(fulfilledValue) {
710
+ "pending" === thenable.status && (thenable.status = "fulfilled", thenable.value = fulfilledValue);
711
+ },
712
+ function(error) {
713
+ "pending" === thenable.status && (thenable.status = "rejected", thenable.reason = error);
714
+ }
715
+ )), thenable.status) {
716
+ case "fulfilled":
717
+ return thenable.value;
718
+ case "rejected":
719
+ throw thenable.reason;
720
+ }
721
+ }
722
+ throw thenable;
723
+ }
724
+ function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
725
+ var type = typeof children;
726
+ if ("undefined" === type || "boolean" === type) children = null;
727
+ var invokeCallback = false;
728
+ if (null === children) invokeCallback = true;
729
+ else
730
+ switch (type) {
731
+ case "bigint":
732
+ case "string":
733
+ case "number":
734
+ invokeCallback = true;
735
+ break;
736
+ case "object":
737
+ switch (children.$$typeof) {
738
+ case REACT_ELEMENT_TYPE:
739
+ case REACT_PORTAL_TYPE:
740
+ invokeCallback = true;
741
+ break;
742
+ case REACT_LAZY_TYPE:
743
+ return invokeCallback = children._init, mapIntoArray(
744
+ invokeCallback(children._payload),
745
+ array,
746
+ escapedPrefix,
747
+ nameSoFar,
748
+ callback
749
+ );
750
+ }
138
751
  }
752
+ if (invokeCallback) {
753
+ invokeCallback = children;
754
+ callback = callback(invokeCallback);
755
+ var childKey = "" === nameSoFar ? "." + getElementKey(invokeCallback, 0) : nameSoFar;
756
+ isArrayImpl(callback) ? (escapedPrefix = "", null != childKey && (escapedPrefix = childKey.replace(userProvidedKeyEscapeRegex, "$&/") + "/"), mapIntoArray(callback, array, escapedPrefix, "", function(c) {
757
+ return c;
758
+ })) : null != callback && (isValidElement(callback) && (null != callback.key && (invokeCallback && invokeCallback.key === callback.key || checkKeyStringCoercion(callback.key)), escapedPrefix = cloneAndReplaceKey(
759
+ callback,
760
+ escapedPrefix + (null == callback.key || invokeCallback && invokeCallback.key === callback.key ? "" : ("" + callback.key).replace(
761
+ userProvidedKeyEscapeRegex,
762
+ "$&/"
763
+ ) + "/") + childKey
764
+ ), "" !== nameSoFar && null != invokeCallback && isValidElement(invokeCallback) && null == invokeCallback.key && invokeCallback._store && !invokeCallback._store.validated && (escapedPrefix._store.validated = 2), callback = escapedPrefix), array.push(callback));
765
+ return 1;
766
+ }
767
+ invokeCallback = 0;
768
+ childKey = "" === nameSoFar ? "." : nameSoFar + ":";
769
+ if (isArrayImpl(children))
770
+ for (var i = 0; i < children.length; i++)
771
+ nameSoFar = children[i], type = childKey + getElementKey(nameSoFar, i), invokeCallback += mapIntoArray(
772
+ nameSoFar,
773
+ array,
774
+ escapedPrefix,
775
+ type,
776
+ callback
777
+ );
778
+ else if (i = getIteratorFn(children), "function" === typeof i)
779
+ for (i === children.entries && (didWarnAboutMaps || console.warn(
780
+ "Using Maps as children is not supported. Use an array of keyed ReactElements instead."
781
+ ), didWarnAboutMaps = true), children = i.call(children), i = 0; !(nameSoFar = children.next()).done; )
782
+ nameSoFar = nameSoFar.value, type = childKey + getElementKey(nameSoFar, i++), invokeCallback += mapIntoArray(
783
+ nameSoFar,
784
+ array,
785
+ escapedPrefix,
786
+ type,
787
+ callback
788
+ );
789
+ else if ("object" === type) {
790
+ if ("function" === typeof children.then)
791
+ return mapIntoArray(
792
+ resolveThenable(children),
793
+ array,
794
+ escapedPrefix,
795
+ nameSoFar,
796
+ callback
797
+ );
798
+ array = String(children);
799
+ throw Error(
800
+ "Objects are not valid as a React child (found: " + ("[object Object]" === array ? "object with keys {" + Object.keys(children).join(", ") + "}" : array) + "). If you meant to render a collection of children, use an array instead."
801
+ );
802
+ }
803
+ return invokeCallback;
804
+ }
805
+ function mapChildren(children, func, context) {
806
+ if (null == children) return children;
807
+ var result = [], count = 0;
808
+ mapIntoArray(children, result, "", "", function(child) {
809
+ return func.call(context, child, count++);
139
810
  });
811
+ return result;
140
812
  }
141
- });
142
- };
143
- };
144
-
145
- // src/mdx/page.ts
146
- import { visit as visit3 } from "unist-util-visit";
147
- var extractPage = () => {
148
- return (tree) => {
149
- visit3(tree, "exportNamedDeclaration", (node) => {
150
- const declaration = node.declaration;
151
- if (declaration && declaration.declarations) {
152
- declaration.declarations.forEach((decl) => {
153
- if (decl.id.name === "page") {
154
- global.page = decl.init;
813
+ function lazyInitializer(payload) {
814
+ if (-1 === payload._status) {
815
+ var ctor = payload._result;
816
+ ctor = ctor();
817
+ ctor.then(
818
+ function(moduleObject) {
819
+ if (0 === payload._status || -1 === payload._status)
820
+ payload._status = 1, payload._result = moduleObject;
821
+ },
822
+ function(error) {
823
+ if (0 === payload._status || -1 === payload._status)
824
+ payload._status = 2, payload._result = error;
825
+ }
826
+ );
827
+ -1 === payload._status && (payload._status = 0, payload._result = ctor);
828
+ }
829
+ if (1 === payload._status)
830
+ return ctor = payload._result, void 0 === ctor && console.error(
831
+ "lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))\n\nDid you accidentally put curly braces around the import?",
832
+ ctor
833
+ ), "default" in ctor || console.error(
834
+ "lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))",
835
+ ctor
836
+ ), ctor.default;
837
+ throw payload._result;
838
+ }
839
+ function resolveDispatcher() {
840
+ var dispatcher = ReactSharedInternals.H;
841
+ null === dispatcher && console.error(
842
+ "Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem."
843
+ );
844
+ return dispatcher;
845
+ }
846
+ function noop() {
847
+ }
848
+ function enqueueTask(task) {
849
+ if (null === enqueueTaskImpl)
850
+ try {
851
+ var requireString = ("require" + Math.random()).slice(0, 7);
852
+ enqueueTaskImpl = (module && module[requireString]).call(
853
+ module,
854
+ "timers"
855
+ ).setImmediate;
856
+ } catch (_err) {
857
+ enqueueTaskImpl = function(callback) {
858
+ false === didWarnAboutMessageChannel && (didWarnAboutMessageChannel = true, "undefined" === typeof MessageChannel && console.error(
859
+ "This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."
860
+ ));
861
+ var channel = new MessageChannel();
862
+ channel.port1.onmessage = callback;
863
+ channel.port2.postMessage(void 0);
864
+ };
155
865
  }
866
+ return enqueueTaskImpl(task);
867
+ }
868
+ function aggregateErrors(errors) {
869
+ return 1 < errors.length && "function" === typeof AggregateError ? new AggregateError(errors) : errors[0];
870
+ }
871
+ function popActScope(prevActQueue, prevActScopeDepth) {
872
+ prevActScopeDepth !== actScopeDepth - 1 && console.error(
873
+ "You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "
874
+ );
875
+ actScopeDepth = prevActScopeDepth;
876
+ }
877
+ function recursivelyFlushAsyncActWork(returnValue, resolve, reject) {
878
+ var queue = ReactSharedInternals.actQueue;
879
+ if (null !== queue)
880
+ if (0 !== queue.length)
881
+ try {
882
+ flushActQueue(queue);
883
+ enqueueTask(function() {
884
+ return recursivelyFlushAsyncActWork(returnValue, resolve, reject);
885
+ });
886
+ return;
887
+ } catch (error) {
888
+ ReactSharedInternals.thrownErrors.push(error);
889
+ }
890
+ else ReactSharedInternals.actQueue = null;
891
+ 0 < ReactSharedInternals.thrownErrors.length ? (queue = aggregateErrors(ReactSharedInternals.thrownErrors), ReactSharedInternals.thrownErrors.length = 0, reject(queue)) : resolve(returnValue);
892
+ }
893
+ function flushActQueue(queue) {
894
+ if (!isFlushing) {
895
+ isFlushing = true;
896
+ var i = 0;
897
+ try {
898
+ for (; i < queue.length; i++) {
899
+ var callback = queue[i];
900
+ do {
901
+ ReactSharedInternals.didUsePromise = false;
902
+ var continuation = callback(false);
903
+ if (null !== continuation) {
904
+ if (ReactSharedInternals.didUsePromise) {
905
+ queue[i] = callback;
906
+ queue.splice(0, i);
907
+ return;
908
+ }
909
+ callback = continuation;
910
+ } else break;
911
+ } while (1);
912
+ }
913
+ queue.length = 0;
914
+ } catch (error) {
915
+ queue.splice(0, i + 1), ReactSharedInternals.thrownErrors.push(error);
916
+ } finally {
917
+ isFlushing = false;
918
+ }
919
+ }
920
+ }
921
+ "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
922
+ var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = Symbol.for("react.profiler");
923
+ Symbol.for("react.provider");
924
+ var REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"), REACT_ACTIVITY_TYPE = Symbol.for("react.activity"), MAYBE_ITERATOR_SYMBOL = Symbol.iterator, didWarnStateUpdateForUnmountedComponent = {}, ReactNoopUpdateQueue = {
925
+ isMounted: function() {
926
+ return false;
927
+ },
928
+ enqueueForceUpdate: function(publicInstance) {
929
+ warnNoop(publicInstance, "forceUpdate");
930
+ },
931
+ enqueueReplaceState: function(publicInstance) {
932
+ warnNoop(publicInstance, "replaceState");
933
+ },
934
+ enqueueSetState: function(publicInstance) {
935
+ warnNoop(publicInstance, "setState");
936
+ }
937
+ }, assign = Object.assign, emptyObject = {};
938
+ Object.freeze(emptyObject);
939
+ Component.prototype.isReactComponent = {};
940
+ Component.prototype.setState = function(partialState, callback) {
941
+ if ("object" !== typeof partialState && "function" !== typeof partialState && null != partialState)
942
+ throw Error(
943
+ "takes an object of state variables to update or a function which returns an object of state variables."
944
+ );
945
+ this.updater.enqueueSetState(this, partialState, callback, "setState");
946
+ };
947
+ Component.prototype.forceUpdate = function(callback) {
948
+ this.updater.enqueueForceUpdate(this, callback, "forceUpdate");
949
+ };
950
+ var deprecatedAPIs = {
951
+ isMounted: [
952
+ "isMounted",
953
+ "Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."
954
+ ],
955
+ replaceState: [
956
+ "replaceState",
957
+ "Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."
958
+ ]
959
+ }, fnName;
960
+ for (fnName in deprecatedAPIs)
961
+ deprecatedAPIs.hasOwnProperty(fnName) && defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
962
+ ComponentDummy.prototype = Component.prototype;
963
+ deprecatedAPIs = PureComponent.prototype = new ComponentDummy();
964
+ deprecatedAPIs.constructor = PureComponent;
965
+ assign(deprecatedAPIs, Component.prototype);
966
+ deprecatedAPIs.isPureReactComponent = true;
967
+ var isArrayImpl = Array.isArray, REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), ReactSharedInternals = {
968
+ H: null,
969
+ A: null,
970
+ T: null,
971
+ S: null,
972
+ V: null,
973
+ actQueue: null,
974
+ isBatchingLegacy: false,
975
+ didScheduleLegacyUpdate: false,
976
+ didUsePromise: false,
977
+ thrownErrors: [],
978
+ getCurrentStack: null,
979
+ recentlyCreatedOwnerStacks: 0
980
+ }, hasOwnProperty = Object.prototype.hasOwnProperty, createTask = console.createTask ? console.createTask : function() {
981
+ return null;
982
+ };
983
+ deprecatedAPIs = {
984
+ "react-stack-bottom-frame": function(callStackForError) {
985
+ return callStackForError();
986
+ }
987
+ };
988
+ var specialPropKeyWarningShown, didWarnAboutOldJSXRuntime;
989
+ var didWarnAboutElementRef = {};
990
+ var unknownOwnerDebugStack = deprecatedAPIs["react-stack-bottom-frame"].bind(deprecatedAPIs, UnknownOwner)();
991
+ var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));
992
+ var didWarnAboutMaps = false, userProvidedKeyEscapeRegex = /\/+/g, reportGlobalError = "function" === typeof reportError ? reportError : function(error) {
993
+ if ("object" === typeof window && "function" === typeof window.ErrorEvent) {
994
+ var event = new window.ErrorEvent("error", {
995
+ bubbles: true,
996
+ cancelable: true,
997
+ message: "object" === typeof error && null !== error && "string" === typeof error.message ? String(error.message) : String(error),
998
+ error
999
+ });
1000
+ if (!window.dispatchEvent(event)) return;
1001
+ } else if ("object" === typeof process && "function" === typeof process.emit) {
1002
+ process.emit("uncaughtException", error);
1003
+ return;
1004
+ }
1005
+ console.error(error);
1006
+ }, didWarnAboutMessageChannel = false, enqueueTaskImpl = null, actScopeDepth = 0, didWarnNoAwaitAct = false, isFlushing = false, queueSeveralMicrotasks = "function" === typeof queueMicrotask ? function(callback) {
1007
+ queueMicrotask(function() {
1008
+ return queueMicrotask(callback);
156
1009
  });
1010
+ } : enqueueTask;
1011
+ deprecatedAPIs = Object.freeze({
1012
+ __proto__: null,
1013
+ c: function(size) {
1014
+ return resolveDispatcher().useMemoCache(size);
1015
+ }
1016
+ });
1017
+ exports.Children = {
1018
+ map: mapChildren,
1019
+ forEach: function(children, forEachFunc, forEachContext) {
1020
+ mapChildren(
1021
+ children,
1022
+ function() {
1023
+ forEachFunc.apply(this, arguments);
1024
+ },
1025
+ forEachContext
1026
+ );
1027
+ },
1028
+ count: function(children) {
1029
+ var n = 0;
1030
+ mapChildren(children, function() {
1031
+ n++;
1032
+ });
1033
+ return n;
1034
+ },
1035
+ toArray: function(children) {
1036
+ return mapChildren(children, function(child) {
1037
+ return child;
1038
+ }) || [];
1039
+ },
1040
+ only: function(children) {
1041
+ if (!isValidElement(children))
1042
+ throw Error(
1043
+ "React.Children.only expected to receive a single React element child."
1044
+ );
1045
+ return children;
1046
+ }
1047
+ };
1048
+ exports.Component = Component;
1049
+ exports.Fragment = REACT_FRAGMENT_TYPE;
1050
+ exports.Profiler = REACT_PROFILER_TYPE;
1051
+ exports.PureComponent = PureComponent;
1052
+ exports.StrictMode = REACT_STRICT_MODE_TYPE;
1053
+ exports.Suspense = REACT_SUSPENSE_TYPE;
1054
+ exports.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = ReactSharedInternals;
1055
+ exports.__COMPILER_RUNTIME = deprecatedAPIs;
1056
+ exports.act = function(callback) {
1057
+ var prevActQueue = ReactSharedInternals.actQueue, prevActScopeDepth = actScopeDepth;
1058
+ actScopeDepth++;
1059
+ var queue = ReactSharedInternals.actQueue = null !== prevActQueue ? prevActQueue : [], didAwaitActCall = false;
1060
+ try {
1061
+ var result = callback();
1062
+ } catch (error) {
1063
+ ReactSharedInternals.thrownErrors.push(error);
1064
+ }
1065
+ if (0 < ReactSharedInternals.thrownErrors.length)
1066
+ throw popActScope(prevActQueue, prevActScopeDepth), callback = aggregateErrors(ReactSharedInternals.thrownErrors), ReactSharedInternals.thrownErrors.length = 0, callback;
1067
+ if (null !== result && "object" === typeof result && "function" === typeof result.then) {
1068
+ var thenable = result;
1069
+ queueSeveralMicrotasks(function() {
1070
+ didAwaitActCall || didWarnNoAwaitAct || (didWarnNoAwaitAct = true, console.error(
1071
+ "You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"
1072
+ ));
1073
+ });
1074
+ return {
1075
+ then: function(resolve, reject) {
1076
+ didAwaitActCall = true;
1077
+ thenable.then(
1078
+ function(returnValue) {
1079
+ popActScope(prevActQueue, prevActScopeDepth);
1080
+ if (0 === prevActScopeDepth) {
1081
+ try {
1082
+ flushActQueue(queue), enqueueTask(function() {
1083
+ return recursivelyFlushAsyncActWork(
1084
+ returnValue,
1085
+ resolve,
1086
+ reject
1087
+ );
1088
+ });
1089
+ } catch (error$0) {
1090
+ ReactSharedInternals.thrownErrors.push(error$0);
1091
+ }
1092
+ if (0 < ReactSharedInternals.thrownErrors.length) {
1093
+ var _thrownError = aggregateErrors(
1094
+ ReactSharedInternals.thrownErrors
1095
+ );
1096
+ ReactSharedInternals.thrownErrors.length = 0;
1097
+ reject(_thrownError);
1098
+ }
1099
+ } else resolve(returnValue);
1100
+ },
1101
+ function(error) {
1102
+ popActScope(prevActQueue, prevActScopeDepth);
1103
+ 0 < ReactSharedInternals.thrownErrors.length ? (error = aggregateErrors(
1104
+ ReactSharedInternals.thrownErrors
1105
+ ), ReactSharedInternals.thrownErrors.length = 0, reject(error)) : reject(error);
1106
+ }
1107
+ );
1108
+ }
1109
+ };
1110
+ }
1111
+ var returnValue$jscomp$0 = result;
1112
+ popActScope(prevActQueue, prevActScopeDepth);
1113
+ 0 === prevActScopeDepth && (flushActQueue(queue), 0 !== queue.length && queueSeveralMicrotasks(function() {
1114
+ didAwaitActCall || didWarnNoAwaitAct || (didWarnNoAwaitAct = true, console.error(
1115
+ "A component suspended inside an `act` scope, but the `act` call was not awaited. When testing React components that depend on asynchronous data, you must await the result:\n\nawait act(() => ...)"
1116
+ ));
1117
+ }), ReactSharedInternals.actQueue = null);
1118
+ if (0 < ReactSharedInternals.thrownErrors.length)
1119
+ throw callback = aggregateErrors(ReactSharedInternals.thrownErrors), ReactSharedInternals.thrownErrors.length = 0, callback;
1120
+ return {
1121
+ then: function(resolve, reject) {
1122
+ didAwaitActCall = true;
1123
+ 0 === prevActScopeDepth ? (ReactSharedInternals.actQueue = queue, enqueueTask(function() {
1124
+ return recursivelyFlushAsyncActWork(
1125
+ returnValue$jscomp$0,
1126
+ resolve,
1127
+ reject
1128
+ );
1129
+ })) : resolve(returnValue$jscomp$0);
1130
+ }
1131
+ };
1132
+ };
1133
+ exports.cache = function(fn) {
1134
+ return function() {
1135
+ return fn.apply(null, arguments);
1136
+ };
1137
+ };
1138
+ exports.captureOwnerStack = function() {
1139
+ var getCurrentStack = ReactSharedInternals.getCurrentStack;
1140
+ return null === getCurrentStack ? null : getCurrentStack();
1141
+ };
1142
+ exports.cloneElement = function(element, config, children) {
1143
+ if (null === element || void 0 === element)
1144
+ throw Error(
1145
+ "The argument must be a React element, but you passed " + element + "."
1146
+ );
1147
+ var props = assign({}, element.props), key = element.key, owner = element._owner;
1148
+ if (null != config) {
1149
+ var JSCompiler_inline_result;
1150
+ a: {
1151
+ if (hasOwnProperty.call(config, "ref") && (JSCompiler_inline_result = Object.getOwnPropertyDescriptor(
1152
+ config,
1153
+ "ref"
1154
+ ).get) && JSCompiler_inline_result.isReactWarning) {
1155
+ JSCompiler_inline_result = false;
1156
+ break a;
1157
+ }
1158
+ JSCompiler_inline_result = void 0 !== config.ref;
1159
+ }
1160
+ JSCompiler_inline_result && (owner = getOwner());
1161
+ hasValidKey(config) && (checkKeyStringCoercion(config.key), key = "" + config.key);
1162
+ for (propName in config)
1163
+ !hasOwnProperty.call(config, propName) || "key" === propName || "__self" === propName || "__source" === propName || "ref" === propName && void 0 === config.ref || (props[propName] = config[propName]);
1164
+ }
1165
+ var propName = arguments.length - 2;
1166
+ if (1 === propName) props.children = children;
1167
+ else if (1 < propName) {
1168
+ JSCompiler_inline_result = Array(propName);
1169
+ for (var i = 0; i < propName; i++)
1170
+ JSCompiler_inline_result[i] = arguments[i + 2];
1171
+ props.children = JSCompiler_inline_result;
1172
+ }
1173
+ props = ReactElement(
1174
+ element.type,
1175
+ key,
1176
+ void 0,
1177
+ void 0,
1178
+ owner,
1179
+ props,
1180
+ element._debugStack,
1181
+ element._debugTask
1182
+ );
1183
+ for (key = 2; key < arguments.length; key++)
1184
+ owner = arguments[key], isValidElement(owner) && owner._store && (owner._store.validated = 1);
1185
+ return props;
1186
+ };
1187
+ exports.createContext = function(defaultValue) {
1188
+ defaultValue = {
1189
+ $$typeof: REACT_CONTEXT_TYPE,
1190
+ _currentValue: defaultValue,
1191
+ _currentValue2: defaultValue,
1192
+ _threadCount: 0,
1193
+ Provider: null,
1194
+ Consumer: null
1195
+ };
1196
+ defaultValue.Provider = defaultValue;
1197
+ defaultValue.Consumer = {
1198
+ $$typeof: REACT_CONSUMER_TYPE,
1199
+ _context: defaultValue
1200
+ };
1201
+ defaultValue._currentRenderer = null;
1202
+ defaultValue._currentRenderer2 = null;
1203
+ return defaultValue;
1204
+ };
1205
+ exports.createElement = function(type, config, children) {
1206
+ for (var i = 2; i < arguments.length; i++) {
1207
+ var node = arguments[i];
1208
+ isValidElement(node) && node._store && (node._store.validated = 1);
1209
+ }
1210
+ i = {};
1211
+ node = null;
1212
+ if (null != config)
1213
+ for (propName in didWarnAboutOldJSXRuntime || !("__self" in config) || "key" in config || (didWarnAboutOldJSXRuntime = true, console.warn(
1214
+ "Your app (or one of its dependencies) is using an outdated JSX transform. Update to the modern JSX transform for faster performance: https://react.dev/link/new-jsx-transform"
1215
+ )), hasValidKey(config) && (checkKeyStringCoercion(config.key), node = "" + config.key), config)
1216
+ hasOwnProperty.call(config, propName) && "key" !== propName && "__self" !== propName && "__source" !== propName && (i[propName] = config[propName]);
1217
+ var childrenLength = arguments.length - 2;
1218
+ if (1 === childrenLength) i.children = children;
1219
+ else if (1 < childrenLength) {
1220
+ for (var childArray = Array(childrenLength), _i = 0; _i < childrenLength; _i++)
1221
+ childArray[_i] = arguments[_i + 2];
1222
+ Object.freeze && Object.freeze(childArray);
1223
+ i.children = childArray;
1224
+ }
1225
+ if (type && type.defaultProps)
1226
+ for (propName in childrenLength = type.defaultProps, childrenLength)
1227
+ void 0 === i[propName] && (i[propName] = childrenLength[propName]);
1228
+ node && defineKeyPropWarningGetter(
1229
+ i,
1230
+ "function" === typeof type ? type.displayName || type.name || "Unknown" : type
1231
+ );
1232
+ var propName = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
1233
+ return ReactElement(
1234
+ type,
1235
+ node,
1236
+ void 0,
1237
+ void 0,
1238
+ getOwner(),
1239
+ i,
1240
+ propName ? Error("react-stack-top-frame") : unknownOwnerDebugStack,
1241
+ propName ? createTask(getTaskName(type)) : unknownOwnerDebugTask
1242
+ );
1243
+ };
1244
+ exports.createRef = function() {
1245
+ var refObject = { current: null };
1246
+ Object.seal(refObject);
1247
+ return refObject;
1248
+ };
1249
+ exports.forwardRef = function(render) {
1250
+ null != render && render.$$typeof === REACT_MEMO_TYPE ? console.error(
1251
+ "forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."
1252
+ ) : "function" !== typeof render ? console.error(
1253
+ "forwardRef requires a render function but was given %s.",
1254
+ null === render ? "null" : typeof render
1255
+ ) : 0 !== render.length && 2 !== render.length && console.error(
1256
+ "forwardRef render functions accept exactly two parameters: props and ref. %s",
1257
+ 1 === render.length ? "Did you forget to use the ref parameter?" : "Any additional parameter will be undefined."
1258
+ );
1259
+ null != render && null != render.defaultProps && console.error(
1260
+ "forwardRef render functions do not support defaultProps. Did you accidentally pass a React component?"
1261
+ );
1262
+ var elementType = { $$typeof: REACT_FORWARD_REF_TYPE, render }, ownName;
1263
+ Object.defineProperty(elementType, "displayName", {
1264
+ enumerable: false,
1265
+ configurable: true,
1266
+ get: function() {
1267
+ return ownName;
1268
+ },
1269
+ set: function(name) {
1270
+ ownName = name;
1271
+ render.name || render.displayName || (Object.defineProperty(render, "name", { value: name }), render.displayName = name);
1272
+ }
1273
+ });
1274
+ return elementType;
1275
+ };
1276
+ exports.isValidElement = isValidElement;
1277
+ exports.lazy = function(ctor) {
1278
+ return {
1279
+ $$typeof: REACT_LAZY_TYPE,
1280
+ _payload: { _status: -1, _result: ctor },
1281
+ _init: lazyInitializer
1282
+ };
1283
+ };
1284
+ exports.memo = function(type, compare) {
1285
+ null == type && console.error(
1286
+ "memo: The first argument must be a component. Instead received: %s",
1287
+ null === type ? "null" : typeof type
1288
+ );
1289
+ compare = {
1290
+ $$typeof: REACT_MEMO_TYPE,
1291
+ type,
1292
+ compare: void 0 === compare ? null : compare
1293
+ };
1294
+ var ownName;
1295
+ Object.defineProperty(compare, "displayName", {
1296
+ enumerable: false,
1297
+ configurable: true,
1298
+ get: function() {
1299
+ return ownName;
1300
+ },
1301
+ set: function(name) {
1302
+ ownName = name;
1303
+ type.name || type.displayName || (Object.defineProperty(type, "name", { value: name }), type.displayName = name);
1304
+ }
1305
+ });
1306
+ return compare;
1307
+ };
1308
+ exports.startTransition = function(scope) {
1309
+ var prevTransition = ReactSharedInternals.T, currentTransition = {};
1310
+ ReactSharedInternals.T = currentTransition;
1311
+ currentTransition._updatedFibers = /* @__PURE__ */ new Set();
1312
+ try {
1313
+ var returnValue = scope(), onStartTransitionFinish = ReactSharedInternals.S;
1314
+ null !== onStartTransitionFinish && onStartTransitionFinish(currentTransition, returnValue);
1315
+ "object" === typeof returnValue && null !== returnValue && "function" === typeof returnValue.then && returnValue.then(noop, reportGlobalError);
1316
+ } catch (error) {
1317
+ reportGlobalError(error);
1318
+ } finally {
1319
+ null === prevTransition && currentTransition._updatedFibers && (scope = currentTransition._updatedFibers.size, currentTransition._updatedFibers.clear(), 10 < scope && console.warn(
1320
+ "Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."
1321
+ )), ReactSharedInternals.T = prevTransition;
1322
+ }
1323
+ };
1324
+ exports.unstable_useCacheRefresh = function() {
1325
+ return resolveDispatcher().useCacheRefresh();
1326
+ };
1327
+ exports.use = function(usable) {
1328
+ return resolveDispatcher().use(usable);
1329
+ };
1330
+ exports.useActionState = function(action, initialState, permalink) {
1331
+ return resolveDispatcher().useActionState(
1332
+ action,
1333
+ initialState,
1334
+ permalink
1335
+ );
1336
+ };
1337
+ exports.useCallback = function(callback, deps) {
1338
+ return resolveDispatcher().useCallback(callback, deps);
1339
+ };
1340
+ exports.useContext = function(Context) {
1341
+ var dispatcher = resolveDispatcher();
1342
+ Context.$$typeof === REACT_CONSUMER_TYPE && console.error(
1343
+ "Calling useContext(Context.Consumer) is not supported and will cause bugs. Did you mean to call useContext(Context) instead?"
1344
+ );
1345
+ return dispatcher.useContext(Context);
1346
+ };
1347
+ exports.useDebugValue = function(value, formatterFn) {
1348
+ return resolveDispatcher().useDebugValue(value, formatterFn);
1349
+ };
1350
+ exports.useDeferredValue = function(value, initialValue) {
1351
+ return resolveDispatcher().useDeferredValue(value, initialValue);
1352
+ };
1353
+ exports.useEffect = function(create, createDeps, update) {
1354
+ null == create && console.warn(
1355
+ "React Hook useEffect requires an effect callback. Did you forget to pass a callback to the hook?"
1356
+ );
1357
+ var dispatcher = resolveDispatcher();
1358
+ if ("function" === typeof update)
1359
+ throw Error(
1360
+ "useEffect CRUD overload is not enabled in this build of React."
1361
+ );
1362
+ return dispatcher.useEffect(create, createDeps);
1363
+ };
1364
+ exports.useId = function() {
1365
+ return resolveDispatcher().useId();
1366
+ };
1367
+ exports.useImperativeHandle = function(ref, create, deps) {
1368
+ return resolveDispatcher().useImperativeHandle(ref, create, deps);
1369
+ };
1370
+ exports.useInsertionEffect = function(create, deps) {
1371
+ null == create && console.warn(
1372
+ "React Hook useInsertionEffect requires an effect callback. Did you forget to pass a callback to the hook?"
1373
+ );
1374
+ return resolveDispatcher().useInsertionEffect(create, deps);
1375
+ };
1376
+ exports.useLayoutEffect = function(create, deps) {
1377
+ null == create && console.warn(
1378
+ "React Hook useLayoutEffect requires an effect callback. Did you forget to pass a callback to the hook?"
1379
+ );
1380
+ return resolveDispatcher().useLayoutEffect(create, deps);
1381
+ };
1382
+ exports.useMemo = function(create, deps) {
1383
+ return resolveDispatcher().useMemo(create, deps);
1384
+ };
1385
+ exports.useOptimistic = function(passthrough, reducer) {
1386
+ return resolveDispatcher().useOptimistic(passthrough, reducer);
1387
+ };
1388
+ exports.useReducer = function(reducer, initialArg, init) {
1389
+ return resolveDispatcher().useReducer(reducer, initialArg, init);
1390
+ };
1391
+ exports.useRef = function(initialValue) {
1392
+ return resolveDispatcher().useRef(initialValue);
1393
+ };
1394
+ exports.useState = function(initialState) {
1395
+ return resolveDispatcher().useState(initialState);
1396
+ };
1397
+ exports.useSyncExternalStore = function(subscribe, getSnapshot, getServerSnapshot) {
1398
+ return resolveDispatcher().useSyncExternalStore(
1399
+ subscribe,
1400
+ getSnapshot,
1401
+ getServerSnapshot
1402
+ );
1403
+ };
1404
+ exports.useTransition = function() {
1405
+ return resolveDispatcher().useTransition();
1406
+ };
1407
+ exports.version = "19.1.0";
1408
+ "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
1409
+ }();
1410
+ }
1411
+ });
1412
+
1413
+ // ../../node_modules/.pnpm/react@19.1.0/node_modules/react/index.js
1414
+ var require_react = __commonJS({
1415
+ "../../node_modules/.pnpm/react@19.1.0/node_modules/react/index.js"(exports, module) {
1416
+ "use strict";
1417
+ if (process.env.NODE_ENV === "production") {
1418
+ module.exports = require_react_production();
1419
+ } else {
1420
+ module.exports = require_react_development();
1421
+ }
1422
+ }
1423
+ });
1424
+
1425
+ // src/fs.ts
1426
+ import fs2 from "fs/promises";
1427
+ import { VFile as VFile2 } from "vfile";
1428
+ import { compile as mdxCompile2 } from "@mdx-js/mdx";
1429
+
1430
+ // src/navigation.ts
1431
+ var import_react = __toESM(require_react(), 1);
1432
+ import { promises as fs } from "fs";
1433
+ import path from "path";
1434
+ import remarkFrontmatter from "remark-frontmatter";
1435
+ import remarkMdxFrontmatter from "remark-mdx-frontmatter";
1436
+ import { VFile } from "vfile";
1437
+ import { compile as mdxCompile } from "@mdx-js/mdx";
1438
+ async function pageFrontMatters(navigation, pagePathMapping) {
1439
+ const frontmatters = {};
1440
+ const promises = [];
1441
+ function mapPages(page) {
1442
+ var _a;
1443
+ if (typeof page !== "string") {
1444
+ if ("virtual" in page) {
1445
+ promises.push(job(page, frontmatters, pagePathMapping));
1446
+ } else if ("pages" in page) {
1447
+ (_a = page.pages) == null ? void 0 : _a.forEach(mapPages);
1448
+ }
1449
+ return;
1450
+ }
1451
+ promises.push(job(page, frontmatters, pagePathMapping));
1452
+ }
1453
+ navigation.map(async (nav) => {
1454
+ var _a;
1455
+ (_a = nav.pages) == null ? void 0 : _a.forEach(mapPages);
1456
+ });
1457
+ await Promise.all(promises);
1458
+ return frontmatters;
1459
+ }
1460
+ function filterNavigationByLevels(headers, slug) {
1461
+ const topLevelTabMatcher = headers == null ? void 0 : headers.reduce((acc, header) => {
1462
+ var _a, _b;
1463
+ const tabLevel = (_b = (_a = header == null ? void 0 : header.page) == null ? void 0 : _a.split("/")) == null ? void 0 : _b.length;
1464
+ if (!tabLevel) {
1465
+ return {
1466
+ ...acc
1467
+ };
1468
+ }
1469
+ if (!acc[tabLevel]) {
1470
+ return {
1471
+ ...acc,
1472
+ [tabLevel]: (/* @__PURE__ */ new Set()).add(header == null ? void 0 : header.page)
1473
+ };
1474
+ }
1475
+ return {
1476
+ ...acc,
1477
+ [tabLevel]: acc[tabLevel].add(header == null ? void 0 : header.page)
1478
+ };
1479
+ }, {});
1480
+ return (nav) => {
1481
+ let match = false;
1482
+ Object.keys(topLevelTabMatcher).forEach((levelStr) => {
1483
+ var _a;
1484
+ if (match) {
1485
+ return true;
1486
+ }
1487
+ const level = parseInt(levelStr);
1488
+ const findThisSlug = slug.split("/").filter((s) => !!s).slice(0, level).join("/");
1489
+ function findMatchedPage(page) {
1490
+ var _a2;
1491
+ if (typeof page !== "string") {
1492
+ if ("virtual" in page && page.virtual) {
1493
+ return matchPage(page.virtual);
1494
+ } else if ("pages" in page) {
1495
+ (_a2 = page.pages) == null ? void 0 : _a2.forEach(findMatchedPage);
1496
+ }
1497
+ return;
1498
+ }
1499
+ return matchPage(page);
1500
+ }
1501
+ function matchPage(page) {
1502
+ const findThisPage = page.split("/").filter((p) => !!p).slice(0, level).join("/");
1503
+ const set = topLevelTabMatcher[level];
1504
+ if (set.has(findThisPage) && findThisPage === findThisSlug) {
1505
+ match = true;
1506
+ return true;
1507
+ }
157
1508
  }
1509
+ (_a = nav == null ? void 0 : nav.pages) == null ? void 0 : _a.forEach(findMatchedPage);
158
1510
  });
159
- };
160
- };
161
-
162
- // src/mdx/options.ts
163
- function mdxOptions(toc) {
164
- return {
165
- remarkPlugins: [
166
- remarkFrontmatter,
167
- remarkMdxFrontmatter,
168
- remarkGfm,
169
- remarkInjectCodeMeta,
170
- remarkMdxToc(toc),
171
- extractThemeSettings,
172
- extractPage
173
- ],
174
- rehypePlugins: []
1511
+ return match;
175
1512
  };
176
1513
  }
177
-
178
- // src/utils/index.ts
179
- async function compileBySlug(slug, mdx2) {
180
- const filePath = path.join(process.cwd(), `${slug}.${mdx2 ? "mdx" : "md"}`);
181
- await fs.access(filePath);
182
- const content = await fs.readFile(filePath, "utf-8");
183
- return await compile(content, filePath);
1514
+ function mdxExport(code) {
1515
+ const scope = {
1516
+ Fragment: import_react.default.Fragment,
1517
+ jsxs: import_react.default.createElement,
1518
+ jsx: import_react.default.createElement,
1519
+ jsxDEV: import_react.default.createElement
1520
+ };
1521
+ const fn = new Function(...Object.keys(scope), code);
1522
+ return fn(scope);
184
1523
  }
185
- async function compile(content, filePath) {
1524
+ async function getFrontmatter(filePath) {
1525
+ const body = await fs.readFile(filePath, "utf-8");
186
1526
  const vfile = new VFile({
187
1527
  path: filePath,
188
- value: content,
189
- contents: content
190
- });
191
- const mdOptions = mdxOptions({
192
- minDepth: 2
193
- // TODO: configurable?
1528
+ value: body,
1529
+ contents: body
194
1530
  });
195
1531
  const compiled = await mdxCompile(vfile, {
196
- remarkPlugins: mdOptions.remarkPlugins,
197
- rehypePlugins: mdOptions.rehypePlugins,
1532
+ remarkPlugins: [
1533
+ remarkFrontmatter,
1534
+ remarkMdxFrontmatter
1535
+ ],
1536
+ rehypePlugins: [],
198
1537
  recmaPlugins: [],
199
1538
  outputFormat: "function-body",
200
1539
  development: false
201
1540
  });
202
- return String(compiled);
1541
+ const code = String(compiled);
1542
+ const {
1543
+ reactFrontmatter,
1544
+ // in the future same key?
1545
+ frontmatter
1546
+ } = mdxExport(code);
1547
+ const matter = frontmatter;
1548
+ if (!matter) {
1549
+ throw new Error(`Frontmatter not found in ${filePath}`);
1550
+ }
1551
+ let title = "";
1552
+ if (typeof matter.title === "string") {
1553
+ title = matter.title;
1554
+ }
1555
+ if (reactFrontmatter) {
1556
+ console.error("currently react frontmatter is not supported");
1557
+ }
1558
+ return matter;
203
1559
  }
204
-
205
- // src/vite-plugins/index.ts
206
- import mdx from "@mdx-js/rollup";
207
- function vitePlugins(options) {
208
- return [
209
- mdx(mdxOptions(options.toc))
210
- ];
1560
+ async function job(page, frontmatters, pagePathMapping) {
1561
+ let pageName = "";
1562
+ if (typeof page === "string") {
1563
+ pageName = page;
1564
+ } else if (page.page) {
1565
+ pageName = page.page;
1566
+ }
1567
+ if (!pageName || !pagePathMapping[pageName]) {
1568
+ console.log(`\u26A0\uFE0F "${pageName}" is defined in the docs.json navigation but the file does not exist.`);
1569
+ return;
1570
+ }
1571
+ const filePath = path.join(process.cwd(), pagePathMapping[pageName]);
1572
+ const matter = await getFrontmatter(filePath);
1573
+ frontmatters[pageName] = matter;
211
1574
  }
1575
+
1576
+ // src/fs.ts
1577
+ var ContentFS = class {
1578
+ constructor(settings, remarkPlugins, rehypePlugins) {
1579
+ this.settings = settings;
1580
+ this.remarkPlugins = remarkPlugins;
1581
+ this.rehypePlugins = rehypePlugins;
1582
+ }
1583
+ async compile(filePath) {
1584
+ await fs2.access(filePath);
1585
+ const content = await fs2.readFile(filePath, "utf-8");
1586
+ return await this.compileContent(content, filePath);
1587
+ }
1588
+ async compileContent(content, filePath) {
1589
+ const vfile = new VFile2({
1590
+ path: filePath,
1591
+ value: content,
1592
+ contents: content
1593
+ });
1594
+ const compiled = await mdxCompile2(vfile, {
1595
+ remarkPlugins: this.remarkPlugins,
1596
+ rehypePlugins: this.rehypePlugins,
1597
+ recmaPlugins: [],
1598
+ outputFormat: "function-body",
1599
+ development: false,
1600
+ jsx: false
1601
+ });
1602
+ return String(compiled);
1603
+ }
1604
+ async readRaw(filePath) {
1605
+ await fs2.access(filePath);
1606
+ const content = await fs2.readFile(filePath, "utf-8");
1607
+ return content;
1608
+ }
1609
+ };
212
1610
  export {
213
- compileBySlug,
214
- mdxOptions,
215
- vitePlugins
1611
+ ContentFS,
1612
+ filterNavigationByLevels,
1613
+ pageFrontMatters
216
1614
  };
1615
+ /*! Bundled license information:
1616
+
1617
+ react/cjs/react.production.js:
1618
+ (**
1619
+ * @license React
1620
+ * react.production.js
1621
+ *
1622
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
1623
+ *
1624
+ * This source code is licensed under the MIT license found in the
1625
+ * LICENSE file in the root directory of this source tree.
1626
+ *)
1627
+
1628
+ react/cjs/react.development.js:
1629
+ (**
1630
+ * @license React
1631
+ * react.development.js
1632
+ *
1633
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
1634
+ *
1635
+ * This source code is licensed under the MIT license found in the
1636
+ * LICENSE file in the root directory of this source tree.
1637
+ *)
1638
+ */
1639
+ //# sourceMappingURL=index.js.map