@brickkit/cli 0.14.0 → 0.16.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (89) hide show
  1. package/dashboard-dist/{CollapsiblePanel-CbUysOp5.js → CollapsiblePanel-DvJpFahB.js} +2 -2
  2. package/dashboard-dist/Geist-Variable.woff2 +0 -0
  3. package/dashboard-dist/GeistMono-Variable.woff2 +0 -0
  4. package/dashboard-dist/{api-reference-lLhahVJi.js → api-reference-C2_JX174.js} +82 -70
  5. package/dashboard-dist/app.css +2 -2
  6. package/dashboard-dist/app.js +5 -5
  7. package/dashboard-dist/{client-DRtkFydB.js → client-DsITZplk.js} +1 -1
  8. package/dashboard-dist/{core-BSTqZqMg.js → core-sW89OSz5.js} +1 -1
  9. package/dashboard-dist/docs-D3U7gUWq.js +4 -0
  10. package/dashboard-dist/kit.js +1 -1
  11. package/dashboard-dist/{popover-CKxhB1QI.js → popover-Bb2Q3jiK.js} +1 -1
  12. package/dist/bin.d.ts +1 -2
  13. package/dist/bin.js +6 -6
  14. package/dist/bin.js.map +1 -1
  15. package/dist/build.js +5 -1
  16. package/dist/build.js.map +1 -1
  17. package/dist/client-contract-file.js +3 -2
  18. package/dist/client-contract-file.js.map +1 -1
  19. package/dist/compiler.d.ts +1 -2
  20. package/dist/config2.d.ts +1 -2
  21. package/dist/dashboard-extension.d.ts +1 -2
  22. package/dist/dashboard-host.js +26 -7
  23. package/dist/dashboard-host.js.map +1 -1
  24. package/dist/dashboard.d.ts +4 -4
  25. package/dist/definitions.js +1 -0
  26. package/dist/definitions.js.map +1 -1
  27. package/dist/dev-application.js.map +1 -1
  28. package/dist/dev-reporter.d.ts +1 -2
  29. package/dist/dev-reporter.js.map +1 -1
  30. package/dist/dev-telemetry.js.map +1 -1
  31. package/dist/dev-worker.js.map +1 -1
  32. package/dist/index.d.ts +1 -2
  33. package/dist/lint/oxlint.d.ts +1 -2
  34. package/dist/plugin.d.ts +1 -2
  35. package/dist/production-dashboard2.d.ts +1 -2
  36. package/dist/project.js +35 -12
  37. package/dist/project.js.map +1 -1
  38. package/dist/serve.d.ts +1 -2
  39. package/dist/serve2.js.map +1 -1
  40. package/dist/vite.d.ts +1 -2
  41. package/dist/vite.js +2 -1
  42. package/dist/vite.js.map +1 -1
  43. package/dist/workflows.d.ts +1 -2
  44. package/inspector-dist/client/assets/app-Wfnqu2Ic.css +4610 -0
  45. package/inspector-dist/client/assets/{dist-BK8w6xOr.js → dist-CEyPxAJU.js} +2008 -334
  46. package/inspector-dist/client/assets/{entry.client-D9jbgmTR.js → entry.client-Cszf0uLP.js} +4628 -2593
  47. package/inspector-dist/client/assets/highlighted-body-JLMTFACH-CgFt8UnP.js +41 -0
  48. package/inspector-dist/client/assets/{home-hwPlkNhv.js → home-B2m1nnIz.js} +191 -105
  49. package/inspector-dist/client/assets/{jsx-runtime-CPEah4WQ.js → jsx-runtime-DRYYXgdJ.js} +2946 -2001
  50. package/inspector-dist/client/assets/{manifest-0e76e9ac.js → manifest-cfc09adc.js} +1 -1
  51. package/inspector-dist/client/assets/mermaid-WFAXDIZX-BoRESrqm.js +1 -0
  52. package/inspector-dist/client/assets/root-CVescmwt.css +4544 -0
  53. package/inspector-dist/client/assets/{root-SLeEf-sT.js → root-CVhM1JOR.js} +3 -3
  54. package/inspector-dist/client/assets/{run-detail-DYbVkIFH.js → run-detail-BdV01jxD.js} +90 -50
  55. package/inspector-dist/client/assets/tabs-BVrPbzfI.css +66 -0
  56. package/inspector-dist/client/assets/{tabs-CaJisoyb.js → tabs-C2hdi5D4.js} +12496 -8708
  57. package/inspector-dist/client/assets/{zstd-browser-decoder-D94wmfAU.js → zstd-browser-decoder-DQWDmc2d.js} +2 -2
  58. package/inspector-dist/server/assets/{app-DGlfWVUI.js → app-w0nTXgJd.js} +51489 -51478
  59. package/inspector-dist/server/assets/{chunk-RLXIAIE6-F0SJZlei.js → chunk-7TTQLYRW-BO6_qAAU.js} +10986 -7848
  60. package/inspector-dist/server/assets/cjs-DPK66Gxq.js +3600 -0
  61. package/inspector-dist/server/assets/{dist-BCbwm6jl.js → dist-DTHqO9VA.js} +149 -1619
  62. package/inspector-dist/server/assets/{dist-Ce0I2PUv.js → dist-OLuKLJ4s.js} +8 -8
  63. package/inspector-dist/server/assets/{encryption-DdQgC8Rk.js → encryption-DMo4uOFN.js} +5 -5
  64. package/inspector-dist/server/assets/{event-metadata-n7E4zEmT.js → event-metadata-Bx8Ts484.js} +1 -1
  65. package/inspector-dist/server/assets/functions-B9XwHSzK.js +6972 -0
  66. package/inspector-dist/server/assets/{global-singleton-D8sIN5du.js → global-singleton-rNtXNHKV.js} +1 -1
  67. package/inspector-dist/server/assets/highlighted-body-JLMTFACH-B0HDNeQE.js +41 -0
  68. package/inspector-dist/server/assets/mermaid-WFAXDIZX-B-AIJZhh.js +1 -0
  69. package/inspector-dist/server/assets/serialization-DsMds3lJ.js +5716 -0
  70. package/inspector-dist/server/assets/{serialization-format-BbuGfHog.js → serialization-format-B27jSUCM.js} +30 -9
  71. package/inspector-dist/server/assets/state-resolver-DVs_zsEO.js +1422 -0
  72. package/inspector-dist/server/assets/{token-BgMmJNP5.js → token-CvvD8Y5H.js} +1 -1
  73. package/inspector-dist/server/assets/token-CxjWFNNq.js +63 -0
  74. package/inspector-dist/server/assets/token-util-D9IsWeEs.js +3 -0
  75. package/inspector-dist/server/assets/{wrapper-CIC3w0oC.js → wrapper-B_u9Z5Up.js} +58 -26
  76. package/inspector-dist/server/assets/{ws-transport-CxTYB11n.js → ws-transport-CamzQ5O8.js} +24379 -24240
  77. package/inspector-dist/server/assets/{zstd-browser-decoder-D7bCXbGg.js → zstd-browser-decoder-DlGbqUuc.js} +2 -2
  78. package/inspector-dist/server/index.js +1 -1
  79. package/package.json +21 -21
  80. package/dashboard-dist/docs-Cye2p0fM.js +0 -4
  81. package/inspector-dist/client/assets/app-CeSwVsRm.css +0 -2
  82. package/inspector-dist/client/assets/highlighted-body-B3W2YXNL-CfRnuITN.js +0 -34
  83. package/inspector-dist/client/assets/mermaid-3ZIDBTTL-ZDR2PNY_.js +0 -1
  84. package/inspector-dist/client/assets/root-ChBNTZd2.css +0 -2
  85. package/inspector-dist/client/assets/tabs-L5XKzOpP.css +0 -1
  86. package/inspector-dist/server/assets/functions-CNVQtbgg.js +0 -1170
  87. package/inspector-dist/server/assets/highlighted-body-B3W2YXNL-CWRzMxYD.js +0 -34
  88. package/inspector-dist/server/assets/mermaid-3ZIDBTTL-D0v0ngVr.js +0 -1
  89. package/inspector-dist/server/assets/parse-Begau9cA.js +0 -469
@@ -1,34 +0,0 @@
1
- import { o as __toESM } from "./rolldown-runtime-C1I3wEg2.js";
2
- import { d as require_react, i as R, l as require_jsx_runtime, r as Qe, t as Ks } from "./chunk-RLXIAIE6-F0SJZlei.js";
3
- // ../../node_modules/.bun/streamdown@2.3.0+04238d267197158c/node_modules/streamdown/dist/highlighted-body-B3W2YXNL.js
4
- var import_react = /* @__PURE__ */ __toESM(require_react(), 1);
5
- var import_jsx_runtime = require_jsx_runtime();
6
- var L = ({ code: s, language: t, raw: e, className: n, ...d$1 }) => {
7
- let { shikiTheme: l } = (0, import_react.useContext)(R), o = Ks(), [m, i] = (0, import_react.useState)(e);
8
- return (0, import_react.useEffect)(() => {
9
- if (!o) {
10
- i(e);
11
- return;
12
- }
13
- let g = o.highlight({
14
- code: s,
15
- language: t,
16
- themes: l
17
- }, (p) => {
18
- i(p);
19
- });
20
- g && i(g);
21
- }, [
22
- s,
23
- t,
24
- l,
25
- o,
26
- e
27
- ]), (0, import_jsx_runtime.jsx)(Qe, {
28
- className: n,
29
- language: t,
30
- result: m,
31
- ...d$1
32
- });
33
- };
34
- export { L as HighlightedCodeBlockBody };
@@ -1 +0,0 @@
1
- export { n as Mermaid } from "./chunk-RLXIAIE6-F0SJZlei.js";
@@ -1,469 +0,0 @@
1
- // ../../node_modules/.bun/devalue@6.0.3/node_modules/devalue/src/constants.js
2
- var MAX_ARRAY_LEN = 2 ** 32 - 1;
3
- var MAX_ARRAY_INDEX = MAX_ARRAY_LEN - 1;
4
- // ../../node_modules/.bun/devalue@6.0.3/node_modules/devalue/src/utils.js
5
- var DevalueError = class extends Error {
6
- /**
7
- * @param {string} message
8
- * @param {string[]} keys
9
- * @param {any} [value] - The value that failed to be serialized
10
- * @param {any} [root] - The root value being serialized
11
- */
12
- constructor(message, keys, value, root) {
13
- super(message);
14
- this.name = "DevalueError";
15
- this.path = keys.join("");
16
- this.value = value;
17
- this.root = root;
18
- }
19
- };
20
- /**
21
- * Marks a Map key on the path being serialized. The key itself is recorded
22
- * right after the marker, so nothing is formatted or allocated per entry.
23
- */
24
- var MAP_KEY = Symbol();
25
- /**
26
- * Formats the path recorded on the way to the value being serialized — a
27
- * property key, an array index, or `MAP_KEY` followed by a Map key — into
28
- * the segments a `DevalueError` joins. Only runs when an error is raised.
29
- * @param {any[]} keys
30
- * @param {(key: any) => string} format_map_key
31
- * @returns {string[]}
32
- */
33
- function format_path(keys, format_map_key) {
34
- /** @type {string[]} */
35
- const path = [];
36
- for (let i = 0; i < keys.length; i += 1) {
37
- const segment = keys[i];
38
- if (segment === MAP_KEY) path.push(`.get(${format_map_key(keys[++i])})`);
39
- else if (typeof segment === "number") path.push(`[${segment}]`);
40
- else path.push(stringify_key(segment));
41
- }
42
- return path;
43
- }
44
- var object_proto_names = /* @__PURE__ */ Object.getOwnPropertyNames(Object.prototype).sort().join("\0");
45
- /** @param {any} thing */
46
- function is_plain_object(thing) {
47
- const proto = Object.getPrototypeOf(thing);
48
- return proto === Object.prototype || proto === null || Object.getPrototypeOf(proto) === null || Object.getOwnPropertyNames(proto).sort().join("\0") === object_proto_names;
49
- }
50
- /** @param {any} thing */
51
- function get_type(thing) {
52
- return Object.prototype.toString.call(thing).slice(8, -1);
53
- }
54
- /** @param {any} thing */
55
- function is_buffer(thing) {
56
- return typeof Buffer !== "undefined" && Buffer.isBuffer(thing);
57
- }
58
- var needs_escape = /["<\\\u0000-\u001f\u2028\u2029]/;
59
- var json_leaves_raw = /[<\u2028\u2029]/g;
60
- /** @type {Record<string, string>} */
61
- var raw_escapes = {
62
- "<": "\\u003C",
63
- "\u2028": "\\u2028",
64
- "\u2029": "\\u2029"
65
- };
66
- /** @param {string} char */
67
- function escape_raw(char) {
68
- return raw_escapes[char];
69
- }
70
- /** @param {string} str */
71
- function stringify_string(str) {
72
- if (!needs_escape.test(str) && str.isWellFormed()) return `"${str}"`;
73
- return JSON.stringify(str).replace(json_leaves_raw, escape_raw);
74
- }
75
- var MAX_CACHED_KEY_LENGTH = 64;
76
- /** @type {Map<string, string>} */
77
- var quoted_keys = /* @__PURE__ */ new Map();
78
- /** @param {string} key */
79
- function quote_key(key) {
80
- if (key.length > MAX_CACHED_KEY_LENGTH) return stringify_string(key);
81
- let quoted = quoted_keys.get(key);
82
- if (quoted === void 0) {
83
- if (quoted_keys.size >= 1024) quoted_keys.clear();
84
- quoted = stringify_string(key);
85
- quoted_keys.set(key, quoted);
86
- }
87
- return quoted;
88
- }
89
- /** @param {Record<string | symbol, any>} object */
90
- function enumerable_symbols(object) {
91
- const symbols = Object.getOwnPropertySymbols(object);
92
- return symbols.length === 0 ? symbols : symbols.filter((symbol) => Object.getOwnPropertyDescriptor(object, symbol)?.enumerable);
93
- }
94
- var is_identifier = /^[a-zA-Z_$][a-zA-Z_$0-9]*$/;
95
- /** @param {string} key */
96
- function stringify_key(key) {
97
- return is_identifier.test(key) ? "." + key : "[" + JSON.stringify(key) + "]";
98
- }
99
- /** @param {number} n */
100
- function is_valid_array_index(n) {
101
- if (!Number.isInteger(n)) return false;
102
- if (n < 0) return false;
103
- if (n > MAX_ARRAY_INDEX) return false;
104
- return true;
105
- }
106
- /** @param {number} n */
107
- function is_valid_array_len(n) {
108
- if (!Number.isInteger(n)) return false;
109
- if (n < 0) return false;
110
- if (n > MAX_ARRAY_LEN) return false;
111
- return true;
112
- }
113
- /** @param {string} s */
114
- function is_valid_array_index_string(s) {
115
- if (s.length === 0) return false;
116
- if (s.length > 1 && s.charCodeAt(0) === 48) return false;
117
- for (let i = 0; i < s.length; i++) {
118
- const c = s.charCodeAt(i);
119
- if (c < 48 || c > 57) return false;
120
- }
121
- return is_valid_array_index(+s);
122
- }
123
- /**
124
- * Returns the length of the leading run of valid array indices in `keys`.
125
- * @param {readonly string[]} keys
126
- */
127
- function array_index_cut(keys) {
128
- for (var i = keys.length - 1; i >= 0; i--) if (is_valid_array_index_string(keys[i])) break;
129
- return i + 1;
130
- }
131
- /**
132
- * Finds the populated indices of an array.
133
- * @param {unknown[]} array
134
- */
135
- function valid_array_indices(array) {
136
- const keys = Object.keys(array);
137
- keys.length = array_index_cut(keys);
138
- return keys;
139
- }
140
- // ../../node_modules/.bun/devalue@6.0.3/node_modules/devalue/src/base64.js
141
- /** @type {(array_buffer: ArrayBuffer) => string} */
142
- function encode_native(array_buffer) {
143
- return new Uint8Array(array_buffer).toBase64();
144
- }
145
- /** @type {(base64: string) => ArrayBuffer} */
146
- function decode_native(base64) {
147
- return Uint8Array.fromBase64(base64).buffer;
148
- }
149
- /** @type {(array_buffer: ArrayBuffer) => string} */
150
- function encode_buffer(array_buffer) {
151
- return Buffer.from(array_buffer).toString("base64");
152
- }
153
- /** @type {(base64: string) => ArrayBuffer} */
154
- function decode_buffer(base64) {
155
- return Uint8Array.from(Buffer.from(base64, "base64")).buffer;
156
- }
157
- /** @type {(array_buffer: ArrayBuffer) => string} */
158
- function encode_legacy(array_buffer) {
159
- const array = new Uint8Array(array_buffer);
160
- let binary = "";
161
- const chunk_size = 32768;
162
- for (let i = 0; i < array.length; i += chunk_size) {
163
- const chunk = array.subarray(i, i + chunk_size);
164
- binary += String.fromCharCode.apply(null, chunk);
165
- }
166
- return btoa(binary);
167
- }
168
- /** @type {(base64: string) => ArrayBuffer} */
169
- function decode_legacy(base64) {
170
- const binary_string = atob(base64);
171
- const len = binary_string.length;
172
- const array = new Uint8Array(len);
173
- for (let i = 0; i < len; i++) array[i] = binary_string.charCodeAt(i);
174
- return array.buffer;
175
- }
176
- var native = typeof Uint8Array.fromBase64 === "function";
177
- var buffer = typeof process === "object" && process.versions?.node !== void 0;
178
- var encode64 = native ? encode_native : buffer ? encode_buffer : encode_legacy;
179
- var decode64 = native ? decode_native : buffer ? decode_buffer : decode_legacy;
180
- // ../../node_modules/.bun/devalue@6.0.3/node_modules/devalue/src/operations.js
181
- /**
182
- * Merges caller-provided operation overrides over the defaults. Iterating the
183
- * default keys (rather than the override's own keys) means nullish members
184
- * fall back to the default, and inherited members — e.g. from a class
185
- * instance — are picked up.
186
- *
187
- * @template {Record<string, any>} T
188
- * @param {T} defaults
189
- * @param {Partial<T> | undefined} overrides
190
- * @returns {T}
191
- */
192
- function merge_operations(defaults, overrides) {
193
- if (!overrides) return defaults;
194
- const merged = {};
195
- for (const key of Object.keys(defaults)) merged[key] = overrides[key] ?? defaults[key];
196
- return merged;
197
- }
198
- /** @type {{ kind: 'not-plain' }} */
199
- var NOT_PLAIN = /* @__PURE__ */ Object.freeze({ kind: "not-plain" });
200
- /** @type {{ kind: 'symbol-keys' }} */
201
- var SYMBOL_KEYS = /* @__PURE__ */ Object.freeze({ kind: "symbol-keys" });
202
- var default_stringify_operations = /* @__PURE__ */ Object.freeze({
203
- identify: (value) => value,
204
- typeOf: (value) => value === null ? "null" : typeof value,
205
- toPrimitive: (value) => value,
206
- tagOf: (value) => get_type(value),
207
- isThenable: (value) => typeof value.then === "function",
208
- toPromise: (thenable) => Promise.resolve(thenable),
209
- unbox: (boxed) => boxed.valueOf(),
210
- toISOString: (date) => isNaN(date.getDate()) ? "" : date.toISOString(),
211
- toStringValue: (value) => value.toString(),
212
- regExpInfo: (regexp) => ({
213
- source: regexp.source,
214
- flags: regexp.flags
215
- }),
216
- valuesOf: (set) => set,
217
- entriesOf: (map) => map,
218
- viewInfo: (view) => {
219
- if (is_buffer(view)) view = new Uint8Array(view);
220
- return {
221
- buffer: view.buffer,
222
- byteOffset: view.byteOffset,
223
- byteLength: view.byteLength,
224
- length: view.length,
225
- bufferByteLength: view.buffer.byteLength
226
- };
227
- },
228
- toArrayBuffer: (buffer) => buffer,
229
- lengthOf: (array) => array.length,
230
- hasOwn: (value, key) => Object.hasOwn(value, key),
231
- indicesOf: (array) => valid_array_indices(array),
232
- shapeOf: (value) => {
233
- if (!is_plain_object(value)) return NOT_PLAIN;
234
- if (enumerable_symbols(value).length > 0) return SYMBOL_KEYS;
235
- return {
236
- kind: Object.getPrototypeOf(value) === null ? "null-proto" : "plain",
237
- keys: Object.keys(value)
238
- };
239
- },
240
- get: (value, key) => value[key]
241
- });
242
- var array_buffer_byte_length = Object.getOwnPropertyDescriptor(ArrayBuffer.prototype, "byteLength")?.get;
243
- var shared_array_buffer_byte_length = typeof SharedArrayBuffer === "undefined" ? void 0 : Object.getOwnPropertyDescriptor(SharedArrayBuffer.prototype, "byteLength")?.get;
244
- var default_parse_operations = /* @__PURE__ */ Object.freeze({
245
- fromPrimitive: (primitive) => primitive,
246
- fromISOString: (iso) => new Date(iso),
247
- fromStringValue: (tag, text) => {
248
- if (tag === "URL") return new URL(text);
249
- if (tag === "URLSearchParams") return new URLSearchParams(text);
250
- return Temporal[tag.slice(9)].from(text);
251
- },
252
- fromArrayBuffer: (buffer) => buffer,
253
- fromRegExpInfo: (source, flags) => new RegExp(source, flags),
254
- fromViewInfo: (tag, buffer, byteOffset, length) => {
255
- try {
256
- array_buffer_byte_length.call(buffer);
257
- } catch (error) {
258
- if (!shared_array_buffer_byte_length) throw error;
259
- shared_array_buffer_byte_length.call(buffer);
260
- }
261
- const Constructor = globalThis[tag];
262
- return byteOffset !== void 0 ? new Constructor(buffer, byteOffset, length) : new Constructor(buffer);
263
- },
264
- box: (value) => Object(value),
265
- createArray: (length) => new Array(length),
266
- createSparseArray: (length) => {
267
- /** @type {any[]} */
268
- const array = [];
269
- array[MAX_ARRAY_INDEX] = void 0;
270
- delete array[MAX_ARRAY_INDEX];
271
- array.length = length;
272
- return array;
273
- },
274
- createObject: () => ({}),
275
- createNullPrototypeObject: () => Object.create(null),
276
- createSet: () => /* @__PURE__ */ new Set(),
277
- createMap: () => /* @__PURE__ */ new Map(),
278
- set: (target, key, value) => {
279
- target[key] = value;
280
- },
281
- addValue: (set, value) => {
282
- set.add(value);
283
- },
284
- addEntry: (map, key, value) => {
285
- map.set(key, value);
286
- }
287
- });
288
- // ../../node_modules/.bun/devalue@6.0.3/node_modules/devalue/src/parse.js
289
- function invalid() {
290
- throw new Error("Invalid input");
291
- }
292
- /**
293
- * Revive a value serialized with `devalue.stringify`
294
- * @param {string} serialized
295
- * @param {Record<string, (value: any) => any>} [revivers]
296
- * @param {import('./types.js').ParseOptions} [options]
297
- */
298
- function parse(serialized, revivers, options) {
299
- return unflatten(JSON.parse(serialized), revivers, options);
300
- }
301
- /**
302
- * Revive a value flattened with `devalue.stringify`
303
- * @param {number | any[]} parsed
304
- * @param {Record<string, (value: any) => any>} [revivers]
305
- * @param {import('./types.js').ParseOptions} [options]
306
- */
307
- function unflatten(parsed, revivers, options) {
308
- /** @type {import('./types.js').ParseOperations} */
309
- const ops = merge_operations(default_parse_operations, options?.operations);
310
- if (typeof parsed === "number") return hydrate(parsed, true);
311
- if (!Array.isArray(parsed) || parsed.length === 0) invalid();
312
- const values = parsed;
313
- const hydrated = Array(values.length);
314
- /**
315
- * A set of values currently being hydrated with custom revivers,
316
- * used to detect invalid cyclical dependencies
317
- * @type {Set<number> | null}
318
- */
319
- let hydrating = null;
320
- /**
321
- * @param {number} index
322
- * @returns {any}
323
- */
324
- function get_raw(index) {
325
- if (!is_valid_array_index(index) || index >= values.length) invalid();
326
- return values[index];
327
- }
328
- /**
329
- * @param {number} index
330
- * @returns {any}
331
- */
332
- function hydrate(index, standalone = false) {
333
- if (index === -1) return ops.fromPrimitive(void 0);
334
- if (index === -3) return ops.fromPrimitive(NaN);
335
- if (index === -4) return ops.fromPrimitive(Infinity);
336
- if (index === -5) return ops.fromPrimitive(-Infinity);
337
- if (index === -6) return ops.fromPrimitive(-0);
338
- if (standalone || typeof index !== "number") invalid();
339
- if (index in hydrated) return hydrated[index];
340
- if (index >= values.length) invalid();
341
- const value = values[index];
342
- if (!value || typeof value !== "object") hydrated[index] = ops.fromPrimitive(value);
343
- else if (Array.isArray(value)) {
344
- if (typeof value[0] === "string") {
345
- const type = value[0];
346
- const reviver = revivers && Object.hasOwn(revivers, type) ? revivers[type] : void 0;
347
- if (reviver) {
348
- let i = value[1];
349
- if (typeof i !== "number") i = values.push(value[1]) - 1;
350
- if (Object.hasOwn(hydrated, i)) return hydrated[index] = reviver(hydrated[i]);
351
- hydrating ??= /* @__PURE__ */ new Set();
352
- if (hydrating.has(i)) throw new Error("Invalid circular reference");
353
- hydrating.add(i);
354
- hydrated[index] = reviver(hydrate(i));
355
- hydrating.delete(i);
356
- return hydrated[index];
357
- }
358
- switch (type) {
359
- case "Date":
360
- hydrated[index] = ops.fromISOString(value[1]);
361
- break;
362
- case "Set":
363
- const set = ops.createSet();
364
- hydrated[index] = set;
365
- for (let i = 1; i < value.length; i += 1) ops.addValue(set, hydrate(value[i]));
366
- break;
367
- case "Map":
368
- const map = ops.createMap();
369
- hydrated[index] = map;
370
- for (let i = 1; i < value.length; i += 2) ops.addEntry(map, hydrate(value[i]), hydrate(value[i + 1]));
371
- break;
372
- case "RegExp":
373
- hydrated[index] = ops.fromRegExpInfo(value[1], value[2]);
374
- break;
375
- case "Object": {
376
- const wrapped_index = value[1];
377
- if (!(wrapped_index === -3 || wrapped_index === -4 || wrapped_index === -5 || wrapped_index === -6)) {
378
- const wrapped = get_raw(wrapped_index);
379
- const is_bigint = Array.isArray(wrapped) && wrapped[0] === "BigInt";
380
- if ((wrapped === void 0 || typeof wrapped === "object") && !is_bigint) invalid();
381
- }
382
- hydrated[index] = ops.box(hydrate(wrapped_index));
383
- break;
384
- }
385
- case "BigInt":
386
- hydrated[index] = ops.fromPrimitive(BigInt(value[1]));
387
- break;
388
- case "null":
389
- const obj = ops.createNullPrototypeObject();
390
- hydrated[index] = obj;
391
- for (let i = 1; i < value.length; i += 2) {
392
- const key = value[i];
393
- if (typeof key !== "string") throw new Error("Cannot parse an object with a non-string key");
394
- if (key === "__proto__") throw new Error("Cannot parse an object with a `__proto__` property");
395
- ops.set(obj, key, hydrate(value[i + 1]));
396
- }
397
- break;
398
- case "Int8Array":
399
- case "Uint8Array":
400
- case "Uint8ClampedArray":
401
- case "Int16Array":
402
- case "Uint16Array":
403
- case "Float16Array":
404
- case "Int32Array":
405
- case "Uint32Array":
406
- case "Float32Array":
407
- case "Float64Array":
408
- case "BigInt64Array":
409
- case "BigUint64Array":
410
- case "DataView": {
411
- const buffer_index = value[1];
412
- const raw = get_raw(buffer_index);
413
- if (!Array.isArray(raw) || raw[0] !== "ArrayBuffer") invalid();
414
- const buffer = hydrate(buffer_index);
415
- hydrated[index] = ops.fromViewInfo(type, buffer, value[2], value[3]);
416
- break;
417
- }
418
- case "ArrayBuffer": {
419
- const base64 = value[1];
420
- if (typeof base64 !== "string") throw new Error("Invalid ArrayBuffer encoding");
421
- hydrated[index] = ops.fromArrayBuffer(decode64(base64));
422
- break;
423
- }
424
- case "URL":
425
- case "URLSearchParams":
426
- case "Temporal.Duration":
427
- case "Temporal.Instant":
428
- case "Temporal.PlainDate":
429
- case "Temporal.PlainTime":
430
- case "Temporal.PlainDateTime":
431
- case "Temporal.PlainMonthDay":
432
- case "Temporal.PlainYearMonth":
433
- case "Temporal.ZonedDateTime":
434
- hydrated[index] = ops.fromStringValue(type, value[1]);
435
- break;
436
- default: throw new Error(`Unknown type ${type}`);
437
- }
438
- } else if (value[0] === -7) {
439
- const len = value[1];
440
- if (!is_valid_array_len(len)) invalid();
441
- const array = ops.createSparseArray(len);
442
- hydrated[index] = array;
443
- for (let i = 2; i < value.length; i += 2) {
444
- const idx = value[i];
445
- if (!is_valid_array_index(idx) || idx >= len) invalid();
446
- ops.set(array, idx, hydrate(value[i + 1]));
447
- }
448
- } else {
449
- const array = ops.createArray(value.length);
450
- hydrated[index] = array;
451
- for (let i = 0; i < value.length; i += 1) {
452
- const n = value[i];
453
- if (n === -2) continue;
454
- ops.set(array, i, hydrate(n));
455
- }
456
- }
457
- } else {
458
- const object = ops.createObject();
459
- hydrated[index] = object;
460
- for (const key of Object.keys(value)) {
461
- if (key === "__proto__") throw new Error("Cannot parse an object with a `__proto__` property");
462
- ops.set(object, key, hydrate(value[key]));
463
- }
464
- }
465
- return hydrated[index];
466
- }
467
- return hydrate(0);
468
- }
469
- export { merge_operations as a, MAP_KEY as c, stringify_string as d, default_stringify_operations as i, format_path as l, unflatten as n, encode64 as o, default_parse_operations as r, DevalueError as s, parse as t, quote_key as u };