@marimo-team/islands 0.13.16-dev2 → 0.13.16-dev21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ConnectedDataExplorerComponent-BizAnuDQ.js → ConnectedDataExplorerComponent-CbgMGTNw.js} +1495 -1496
- package/dist/ImageComparisonComponent-BEvxQRYY.js +248 -0
- package/dist/{VegaLite-BvtjUHLS.js → VegaLite-CtlLD_UH.js} +12483 -12485
- package/dist/{_baseUniq-C1K8a5jF.js → _baseUniq-BPYian-Y.js} +13 -13
- package/dist/{any-language-editor-D3C2KiQW.js → any-language-editor-B9yuOY2a.js} +2 -2
- package/dist/{architectureDiagram-IEHRJDOE-DhrFWr1a.js → architectureDiagram-IEHRJDOE-yPyQlJjy.js} +1800 -1800
- package/dist/asn1-jKiBa2Ya.js +10 -10
- package/dist/assets/{save-worker-9HEtFDM0.js → save-worker-DwN_qfSx.js} +695 -702
- package/dist/assets/{worker-BGGm0KYZ.js → worker-BzMPE1Lq.js} +732 -739
- package/dist/assets/{worker-BNsqBj5w.js → worker-ISYYr8IB.js} +726 -732
- package/dist/blockDiagram-JOT3LUYC-548hLzGM.js +2249 -0
- package/dist/{c4Diagram-VJAJSXHY-DKSU0_Zg.js → c4Diagram-VJAJSXHY-CkEjf0GP.js} +401 -400
- package/dist/{channel-DMiLp-mI.js → channel-B4Bg4vOE.js} +1 -1
- package/dist/chunk-4BMEZGHF-De9P61oF.js +9 -0
- package/dist/chunk-A2AXSNBT-geH9ZZvt.js +1373 -0
- package/dist/chunk-AEK57VVT-B2sQ0hQa.js +1416 -0
- package/dist/{chunk-D6G4REZN-BZV3ukOi.js → chunk-D6G4REZN-C2nlv3Zm.js} +2 -2
- package/dist/{chunk-RZ5BOZE2-B4rOVQD8.js → chunk-RZ5BOZE2-CmOabQbu.js} +8 -8
- package/dist/chunk-XZIHB7SX-C-O1Dk7e.js +16 -0
- package/dist/{classDiagram-GIVACNV2-DLRT4_A4.js → classDiagram-GIVACNV2-Du2vgWFA.js} +2 -2
- package/dist/{classDiagram-v2-COTLJTTW-DLRT4_A4.js → classDiagram-v2-COTLJTTW-Du2vgWFA.js} +2 -2
- package/dist/clojure-CCKyeQKf.js +2 -2
- package/dist/{clone-CPwu6xRn.js → clone-DnSM2M6p.js} +1 -1
- package/dist/css-bIlmDBTK.js +19 -19
- package/dist/{cytoscape.esm-DAyNQ0qu.js → cytoscape.esm-CCQ3SVU1.js} +2301 -2301
- package/dist/dagre-OKDRZEBW-CnGJy_Hk.js +447 -0
- package/dist/{data-editor-CYvUeKhw.js → data-editor--qYs3N6K.js} +5785 -5795
- package/dist/{diagram-SSKATNLV-D8WhiY2q.js → diagram-SSKATNLV-Ba25ch_t.js} +13 -13
- package/dist/{diagram-VNBRO52H-Bil9sOsr.js → diagram-VNBRO52H-ky1Bklgc.js} +3 -3
- package/dist/{erDiagram-Q7BY3M3F-J-Jm-DD7.js → erDiagram-Q7BY3M3F-DKx4pdnF.js} +263 -262
- package/dist/flowDiagram-4HSFHLVR-D2g6V5ro.js +1623 -0
- package/dist/{ganttDiagram-APWFNJXF-C2G0-fOq.js → ganttDiagram-APWFNJXF-CM2375VL.js} +45 -45
- package/dist/gitGraphDiagram-7IBYFJ6S-CYBXIIJu.js +712 -0
- package/dist/{graph-BFerxzEi.js → graph-BXO6Y4fK.js} +9 -9
- package/dist/{index-DfpR00QG.js → index-BXQhgr_p.js} +99 -98
- package/dist/{index-BhtvwOag.js → index-CLVuMf-N.js} +28 -28
- package/dist/{index-j8M50mVa.js → index-DsjbPR0S.js} +4 -4
- package/dist/{index-DkuVwdVm.js → index-kCGDeFbz.js} +9 -9
- package/dist/{infoDiagram-PH2N3AL5-AYtb1_Lz.js → infoDiagram-PH2N3AL5-Bysuy2jX.js} +3 -3
- package/dist/javascript-WMWNx-Vj.js +47 -47
- package/dist/{journeyDiagram-U35MCT3I-Bdz9gIBI.js → journeyDiagram-U35MCT3I-TBaQruI8.js} +18 -18
- package/dist/kanban-definition-NDS4AKOZ-D4jw_Hry.js +719 -0
- package/dist/{katex-9tX9hjoM.js → katex-CUSbq6rG.js} +2180 -2180
- package/dist/{layout-Qs-BVu8V.js → layout-BUA-DPJm.js} +27 -27
- package/dist/{linear-SIbCb7yI.js → linear-BnTRnU3J.js} +2 -2
- package/dist/main-D-37AaR4.js +169855 -0
- package/dist/main.js +1 -1
- package/dist/mermaid-BzFQ2d9i.js +14517 -0
- package/dist/{mhchem-L5-rce7L.js → mhchem-Db_f2n8C.js} +30 -30
- package/dist/{min-BTA1UVkn.js → min-D_xIH6wU.js} +2 -2
- package/dist/{mindmap-definition-ALO5MXBD-CdrD5BzZ.js → mindmap-definition-ALO5MXBD-J6RsqNRW.js} +359 -359
- package/dist/mllike-BSnXJBGA.js +7 -7
- package/dist/{pieDiagram-IB7DONF6-BbbxWeqU.js → pieDiagram-IB7DONF6-CyMim2nt.js} +34 -34
- package/dist/pug-BqUR2bBq.js +35 -35
- package/dist/python-B5QdSKoL.js +18 -18
- package/dist/quadrantDiagram-7GDLP6J5-wbyf83kA.js +1025 -0
- package/dist/{radar-MK3ICKWK-Z5R0bt0z.js → radar-MK3ICKWK-BDGRcSnx.js} +2555 -2554
- package/dist/{react-plotly-DqDxe4Uh.js → react-plotly-DrgClWur.js} +6595 -6597
- package/dist/{requirementDiagram-KVF5MWMF-DMnvzAxX.js → requirementDiagram-KVF5MWMF-Cm8xuD8x.js} +251 -250
- package/dist/rpm-IznJm2Xc.js +9 -9
- package/dist/{sankeyDiagram-QLVOVGJD-DbUWg3a4.js → sankeyDiagram-QLVOVGJD-iRFZmvn2.js} +339 -338
- package/dist/{sequenceDiagram-X6HHIX6F-JltcBwLF.js → sequenceDiagram-X6HHIX6F-Dr8oo1TZ.js} +822 -821
- package/dist/{slides-component-DVr5mf9p.js → slides-component-D8N71t3Y.js} +280 -280
- package/dist/sql-mMre1Bo3.js +9 -9
- package/dist/{stateDiagram-DGXRK772-qbXtyoS6.js → stateDiagram-DGXRK772-BNQYJSkB.js} +17 -17
- package/dist/{stateDiagram-v2-YXO3MK2T-Ba7q5pMK.js → stateDiagram-v2-YXO3MK2T-Dl249u1C.js} +2 -2
- package/dist/style.css +1 -1
- package/dist/{time-DHD8Fix8.js → time-hpTGXdsY.js} +2 -2
- package/dist/{timeline-definition-BDJGKUSR-q4gOCBRq.js → timeline-definition-BDJGKUSR-kYwIJd20.js} +261 -261
- package/dist/timer-BYwnU4DF.js +378 -378
- package/dist/ttcn-cfg-Bac_acMi.js +9 -9
- package/dist/{vega-component-D2NZFVvw.js → vega-component-CIAcZw-F.js} +82 -82
- package/dist/{xychartDiagram-VJFVF3MP-BZs9xPvU.js → xychartDiagram-VJFVF3MP-Cj3j6vWQ.js} +472 -471
- package/package.json +7 -6
- package/dist/blockDiagram-JOT3LUYC-COVagShg.js +0 -2248
- package/dist/chunk-4BMEZGHF-CeMSohVe.js +0 -9
- package/dist/chunk-A2AXSNBT-mQ3fXQfx.js +0 -1372
- package/dist/chunk-AEK57VVT-B7kw2yt6.js +0 -1415
- package/dist/chunk-XZIHB7SX-C3-5SkZh.js +0 -15
- package/dist/dagre-OKDRZEBW-yEQf6TwX.js +0 -447
- package/dist/flowDiagram-4HSFHLVR-Dhymtq1g.js +0 -1622
- package/dist/gitGraphDiagram-7IBYFJ6S-DCZAwPro.js +0 -712
- package/dist/kanban-definition-NDS4AKOZ-ByLpDX9Y.js +0 -719
- package/dist/main-Cx3zrED9.js +0 -156521
- package/dist/mermaid-DAi_EtLa.js +0 -11991
- package/dist/quadrantDiagram-7GDLP6J5-1UQgbW9Z.js +0 -1024
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var pr = (t, e) => () => (e || t((e = { exports: {} }).exports, e), e.exports);
|
|
2
|
+
var rs = pr((as, mt) => {
|
|
3
3
|
var b;
|
|
4
4
|
(function(t) {
|
|
5
5
|
t.assertEqual = (s) => s;
|
|
@@ -36,14 +36,14 @@ var ns = hr((is, gt) => {
|
|
|
36
36
|
}
|
|
37
37
|
t.joinValues = n, t.jsonStringifyReplacer = (s, a) => typeof a == "bigint" ? a.toString() : a;
|
|
38
38
|
})(b || (b = {}));
|
|
39
|
-
var
|
|
39
|
+
var st;
|
|
40
40
|
(function(t) {
|
|
41
41
|
t.mergeShapes = (e, r) => ({
|
|
42
42
|
...e,
|
|
43
43
|
...r
|
|
44
44
|
// second overwrites first
|
|
45
45
|
});
|
|
46
|
-
})(
|
|
46
|
+
})(st || (st = {}));
|
|
47
47
|
const p = b.arrayToEnum([
|
|
48
48
|
"string",
|
|
49
49
|
"nan",
|
|
@@ -65,7 +65,7 @@ var ns = hr((is, gt) => {
|
|
|
65
65
|
"never",
|
|
66
66
|
"map",
|
|
67
67
|
"set"
|
|
68
|
-
]),
|
|
68
|
+
]), z = (t) => {
|
|
69
69
|
switch (typeof t) {
|
|
70
70
|
case "undefined":
|
|
71
71
|
return p.undefined;
|
|
@@ -103,8 +103,8 @@ var ns = hr((is, gt) => {
|
|
|
103
103
|
"invalid_intersection_types",
|
|
104
104
|
"not_multiple_of",
|
|
105
105
|
"not_finite"
|
|
106
|
-
]),
|
|
107
|
-
class
|
|
106
|
+
]), hr = (t) => JSON.stringify(t, null, 2).replace(/"([^"]+)":/g, "$1:");
|
|
107
|
+
class C extends Error {
|
|
108
108
|
get errors() {
|
|
109
109
|
return this.issues;
|
|
110
110
|
}
|
|
@@ -141,7 +141,7 @@ var ns = hr((is, gt) => {
|
|
|
141
141
|
return s(this), n;
|
|
142
142
|
}
|
|
143
143
|
static assert(e) {
|
|
144
|
-
if (!(e instanceof
|
|
144
|
+
if (!(e instanceof C))
|
|
145
145
|
throw new Error(`Not a ZodError: ${e}`);
|
|
146
146
|
}
|
|
147
147
|
toString() {
|
|
@@ -163,8 +163,8 @@ var ns = hr((is, gt) => {
|
|
|
163
163
|
return this.flatten();
|
|
164
164
|
}
|
|
165
165
|
}
|
|
166
|
-
|
|
167
|
-
const
|
|
166
|
+
C.create = (t) => new C(t);
|
|
167
|
+
const pe = (t, e) => {
|
|
168
168
|
let r;
|
|
169
169
|
switch (t.code) {
|
|
170
170
|
case u.invalid_type:
|
|
@@ -220,14 +220,14 @@ var ns = hr((is, gt) => {
|
|
|
220
220
|
}
|
|
221
221
|
return { message: r };
|
|
222
222
|
};
|
|
223
|
-
let
|
|
224
|
-
function
|
|
225
|
-
|
|
223
|
+
let Nt = pe;
|
|
224
|
+
function mr(t) {
|
|
225
|
+
Nt = t;
|
|
226
226
|
}
|
|
227
|
-
function
|
|
228
|
-
return
|
|
227
|
+
function Ve() {
|
|
228
|
+
return Nt;
|
|
229
229
|
}
|
|
230
|
-
const
|
|
230
|
+
const Ue = (t) => {
|
|
231
231
|
const { data: e, path: r, errorMaps: n, issueData: s } = t, a = [...r, ...s.path || []], i = {
|
|
232
232
|
...s,
|
|
233
233
|
path: a
|
|
@@ -247,9 +247,9 @@ var ns = hr((is, gt) => {
|
|
|
247
247
|
path: a,
|
|
248
248
|
message: o
|
|
249
249
|
};
|
|
250
|
-
},
|
|
250
|
+
}, yr = [];
|
|
251
251
|
function f(t, e) {
|
|
252
|
-
const r =
|
|
252
|
+
const r = Ve(), n = Ue({
|
|
253
253
|
issueData: e,
|
|
254
254
|
data: t.data,
|
|
255
255
|
path: t.path,
|
|
@@ -260,13 +260,13 @@ var ns = hr((is, gt) => {
|
|
|
260
260
|
// then schema-bound map if available
|
|
261
261
|
r,
|
|
262
262
|
// then global override map
|
|
263
|
-
r ===
|
|
263
|
+
r === pe ? void 0 : pe
|
|
264
264
|
// then global default map
|
|
265
265
|
].filter((s) => !!s)
|
|
266
266
|
});
|
|
267
267
|
t.common.issues.push(n);
|
|
268
268
|
}
|
|
269
|
-
class
|
|
269
|
+
class O {
|
|
270
270
|
constructor() {
|
|
271
271
|
this.value = "valid";
|
|
272
272
|
}
|
|
@@ -294,7 +294,7 @@ var ns = hr((is, gt) => {
|
|
|
294
294
|
value: i
|
|
295
295
|
});
|
|
296
296
|
}
|
|
297
|
-
return
|
|
297
|
+
return O.mergeObjectSync(e, n);
|
|
298
298
|
}
|
|
299
299
|
static mergeObjectSync(e, r) {
|
|
300
300
|
const n = {};
|
|
@@ -309,21 +309,21 @@ var ns = hr((is, gt) => {
|
|
|
309
309
|
}
|
|
310
310
|
const y = Object.freeze({
|
|
311
311
|
status: "aborted"
|
|
312
|
-
}),
|
|
313
|
-
function
|
|
312
|
+
}), le = (t) => ({ status: "dirty", value: t }), R = (t) => ({ status: "valid", value: t }), at = (t) => t.status === "aborted", it = (t) => t.status === "dirty", ne = (t) => t.status === "valid", xe = (t) => typeof Promise < "u" && t instanceof Promise;
|
|
313
|
+
function ze(t, e, r, n) {
|
|
314
314
|
if (typeof e == "function" ? t !== e || !0 : !e.has(t)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
315
315
|
return e.get(t);
|
|
316
316
|
}
|
|
317
|
-
function
|
|
317
|
+
function Rt(t, e, r, n, s) {
|
|
318
318
|
if (typeof e == "function" ? t !== e || !0 : !e.has(t)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
319
319
|
return e.set(t, r), r;
|
|
320
320
|
}
|
|
321
321
|
var h;
|
|
322
322
|
(function(t) {
|
|
323
|
-
t.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, t.toString = (e) => typeof e == "string" ? e : e
|
|
323
|
+
t.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, t.toString = (e) => typeof e == "string" ? e : e?.message;
|
|
324
324
|
})(h || (h = {}));
|
|
325
|
-
var
|
|
326
|
-
class
|
|
325
|
+
var _e, we;
|
|
326
|
+
class M {
|
|
327
327
|
constructor(e, r, n, s) {
|
|
328
328
|
this._cachedPath = [], this.parent = e, this.data = r, this._path = n, this._key = s;
|
|
329
329
|
}
|
|
@@ -331,8 +331,8 @@ var ns = hr((is, gt) => {
|
|
|
331
331
|
return this._cachedPath.length || (this._key instanceof Array ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
|
|
332
332
|
}
|
|
333
333
|
}
|
|
334
|
-
const
|
|
335
|
-
if (
|
|
334
|
+
const xt = (t, e) => {
|
|
335
|
+
if (ne(e))
|
|
336
336
|
return { success: !0, data: e.value };
|
|
337
337
|
if (!t.common.issues.length)
|
|
338
338
|
throw new Error("Validation failed but no issues detected.");
|
|
@@ -341,7 +341,7 @@ var ns = hr((is, gt) => {
|
|
|
341
341
|
get error() {
|
|
342
342
|
if (this._error)
|
|
343
343
|
return this._error;
|
|
344
|
-
const r = new
|
|
344
|
+
const r = new C(t.common.issues);
|
|
345
345
|
return this._error = r, this._error;
|
|
346
346
|
}
|
|
347
347
|
};
|
|
@@ -363,13 +363,13 @@ var ns = hr((is, gt) => {
|
|
|
363
363
|
return this._def.description;
|
|
364
364
|
}
|
|
365
365
|
_getType(e) {
|
|
366
|
-
return
|
|
366
|
+
return z(e.data);
|
|
367
367
|
}
|
|
368
368
|
_getOrReturnCtx(e, r) {
|
|
369
369
|
return r || {
|
|
370
370
|
common: e.parent.common,
|
|
371
371
|
data: e.data,
|
|
372
|
-
parsedType:
|
|
372
|
+
parsedType: z(e.data),
|
|
373
373
|
schemaErrorMap: this._def.errorMap,
|
|
374
374
|
path: e.path,
|
|
375
375
|
parent: e.parent
|
|
@@ -377,11 +377,11 @@ var ns = hr((is, gt) => {
|
|
|
377
377
|
}
|
|
378
378
|
_processInputParams(e) {
|
|
379
379
|
return {
|
|
380
|
-
status: new
|
|
380
|
+
status: new O(),
|
|
381
381
|
ctx: {
|
|
382
382
|
common: e.parent.common,
|
|
383
383
|
data: e.data,
|
|
384
|
-
parsedType:
|
|
384
|
+
parsedType: z(e.data),
|
|
385
385
|
schemaErrorMap: this._def.errorMap,
|
|
386
386
|
path: e.path,
|
|
387
387
|
parent: e.parent
|
|
@@ -390,7 +390,7 @@ var ns = hr((is, gt) => {
|
|
|
390
390
|
}
|
|
391
391
|
_parseSync(e) {
|
|
392
392
|
const r = this._parse(e);
|
|
393
|
-
if (
|
|
393
|
+
if (xe(r))
|
|
394
394
|
throw new Error("Synchronous parse encountered promise.");
|
|
395
395
|
return r;
|
|
396
396
|
}
|
|
@@ -409,16 +409,16 @@ var ns = hr((is, gt) => {
|
|
|
409
409
|
const s = {
|
|
410
410
|
common: {
|
|
411
411
|
issues: [],
|
|
412
|
-
async: (n = r
|
|
413
|
-
contextualErrorMap: r
|
|
412
|
+
async: (n = r?.async) !== null && n !== void 0 ? n : !1,
|
|
413
|
+
contextualErrorMap: r?.errorMap
|
|
414
414
|
},
|
|
415
|
-
path:
|
|
415
|
+
path: r?.path || [],
|
|
416
416
|
schemaErrorMap: this._def.errorMap,
|
|
417
417
|
parent: null,
|
|
418
418
|
data: e,
|
|
419
|
-
parsedType:
|
|
419
|
+
parsedType: z(e)
|
|
420
420
|
}, a = this._parseSync({ data: e, path: s.path, parent: s });
|
|
421
|
-
return
|
|
421
|
+
return xt(s, a);
|
|
422
422
|
}
|
|
423
423
|
"~validate"(e) {
|
|
424
424
|
var r, n;
|
|
@@ -431,23 +431,23 @@ var ns = hr((is, gt) => {
|
|
|
431
431
|
schemaErrorMap: this._def.errorMap,
|
|
432
432
|
parent: null,
|
|
433
433
|
data: e,
|
|
434
|
-
parsedType:
|
|
434
|
+
parsedType: z(e)
|
|
435
435
|
};
|
|
436
436
|
if (!this["~standard"].async)
|
|
437
437
|
try {
|
|
438
438
|
const a = this._parseSync({ data: e, path: [], parent: s });
|
|
439
|
-
return
|
|
439
|
+
return ne(a) ? {
|
|
440
440
|
value: a.value
|
|
441
441
|
} : {
|
|
442
442
|
issues: s.common.issues
|
|
443
443
|
};
|
|
444
444
|
} catch (a) {
|
|
445
|
-
!((n = (r = a
|
|
445
|
+
!((n = (r = a?.message) === null || r === void 0 ? void 0 : r.toLowerCase()) === null || n === void 0) && n.includes("encountered") && (this["~standard"].async = !0), s.common = {
|
|
446
446
|
issues: [],
|
|
447
447
|
async: !0
|
|
448
448
|
};
|
|
449
449
|
}
|
|
450
|
-
return this._parseAsync({ data: e, path: [], parent: s }).then((a) =>
|
|
450
|
+
return this._parseAsync({ data: e, path: [], parent: s }).then((a) => ne(a) ? {
|
|
451
451
|
value: a.value
|
|
452
452
|
} : {
|
|
453
453
|
issues: s.common.issues
|
|
@@ -463,16 +463,16 @@ var ns = hr((is, gt) => {
|
|
|
463
463
|
const n = {
|
|
464
464
|
common: {
|
|
465
465
|
issues: [],
|
|
466
|
-
contextualErrorMap: r
|
|
466
|
+
contextualErrorMap: r?.errorMap,
|
|
467
467
|
async: !0
|
|
468
468
|
},
|
|
469
|
-
path:
|
|
469
|
+
path: r?.path || [],
|
|
470
470
|
schemaErrorMap: this._def.errorMap,
|
|
471
471
|
parent: null,
|
|
472
472
|
data: e,
|
|
473
|
-
parsedType:
|
|
474
|
-
}, s = this._parse({ data: e, path: n.path, parent: n }), a = await (
|
|
475
|
-
return
|
|
473
|
+
parsedType: z(e)
|
|
474
|
+
}, s = this._parse({ data: e, path: n.path, parent: n }), a = await (xe(s) ? s : Promise.resolve(s));
|
|
475
|
+
return xt(n, a);
|
|
476
476
|
}
|
|
477
477
|
refine(e, r) {
|
|
478
478
|
const n = (s) => typeof r == "string" || typeof r > "u" ? { message: r } : typeof r == "function" ? r(s) : r;
|
|
@@ -488,7 +488,7 @@ var ns = hr((is, gt) => {
|
|
|
488
488
|
return this._refinement((n, s) => e(n) ? !0 : (s.addIssue(typeof r == "function" ? r(n, s) : r), !1));
|
|
489
489
|
}
|
|
490
490
|
_refinement(e) {
|
|
491
|
-
return new
|
|
491
|
+
return new j({
|
|
492
492
|
schema: this,
|
|
493
493
|
typeName: m.ZodEffects,
|
|
494
494
|
effect: { type: "refinement", refinement: e }
|
|
@@ -505,7 +505,7 @@ var ns = hr((is, gt) => {
|
|
|
505
505
|
};
|
|
506
506
|
}
|
|
507
507
|
optional() {
|
|
508
|
-
return
|
|
508
|
+
return F.create(this, this._def);
|
|
509
509
|
}
|
|
510
510
|
nullable() {
|
|
511
511
|
return K.create(this, this._def);
|
|
@@ -514,19 +514,19 @@ var ns = hr((is, gt) => {
|
|
|
514
514
|
return this.nullable().optional();
|
|
515
515
|
}
|
|
516
516
|
array() {
|
|
517
|
-
return
|
|
517
|
+
return Z.create(this);
|
|
518
518
|
}
|
|
519
519
|
promise() {
|
|
520
|
-
return
|
|
520
|
+
return me.create(this, this._def);
|
|
521
521
|
}
|
|
522
522
|
or(e) {
|
|
523
|
-
return
|
|
523
|
+
return Oe.create([this, e], this._def);
|
|
524
524
|
}
|
|
525
525
|
and(e) {
|
|
526
|
-
return
|
|
526
|
+
return Ne.create(this, e, this._def);
|
|
527
527
|
}
|
|
528
528
|
transform(e) {
|
|
529
|
-
return new
|
|
529
|
+
return new j({
|
|
530
530
|
...v(this._def),
|
|
531
531
|
schema: this,
|
|
532
532
|
typeName: m.ZodEffects,
|
|
@@ -535,7 +535,7 @@ var ns = hr((is, gt) => {
|
|
|
535
535
|
}
|
|
536
536
|
default(e) {
|
|
537
537
|
const r = typeof e == "function" ? e : () => e;
|
|
538
|
-
return new
|
|
538
|
+
return new Pe({
|
|
539
539
|
...v(this._def),
|
|
540
540
|
innerType: this,
|
|
541
541
|
defaultValue: r,
|
|
@@ -543,7 +543,7 @@ var ns = hr((is, gt) => {
|
|
|
543
543
|
});
|
|
544
544
|
}
|
|
545
545
|
brand() {
|
|
546
|
-
return new
|
|
546
|
+
return new yt({
|
|
547
547
|
typeName: m.ZodBranded,
|
|
548
548
|
type: this,
|
|
549
549
|
...v(this._def)
|
|
@@ -551,7 +551,7 @@ var ns = hr((is, gt) => {
|
|
|
551
551
|
}
|
|
552
552
|
catch(e) {
|
|
553
553
|
const r = typeof e == "function" ? e : () => e;
|
|
554
|
-
return new
|
|
554
|
+
return new Ze({
|
|
555
555
|
...v(this._def),
|
|
556
556
|
innerType: this,
|
|
557
557
|
catchValue: r,
|
|
@@ -566,10 +566,10 @@ var ns = hr((is, gt) => {
|
|
|
566
566
|
});
|
|
567
567
|
}
|
|
568
568
|
pipe(e) {
|
|
569
|
-
return
|
|
569
|
+
return $e.create(this, e);
|
|
570
570
|
}
|
|
571
571
|
readonly() {
|
|
572
|
-
return
|
|
572
|
+
return je.create(this);
|
|
573
573
|
}
|
|
574
574
|
isOptional() {
|
|
575
575
|
return this.safeParse(void 0).success;
|
|
@@ -578,26 +578,26 @@ var ns = hr((is, gt) => {
|
|
|
578
578
|
return this.safeParse(null).success;
|
|
579
579
|
}
|
|
580
580
|
}
|
|
581
|
-
const
|
|
582
|
-
let
|
|
583
|
-
const
|
|
584
|
-
function
|
|
581
|
+
const gr = /^c[^\s-]{8,}$/i, vr = /^[0-9a-z]+$/, _r = /^[0-9A-HJKMNP-TV-Z]{26}$/i, wr = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i, br = /^[a-z0-9_-]{21}$/i, kr = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, xr = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/, Tr = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, Sr = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
582
|
+
let tt;
|
|
583
|
+
const Er = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, Or = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/, Nr = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/, Rr = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, Ar = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, Cr = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, At = "((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))", Ir = new RegExp(`^${At}$`);
|
|
584
|
+
function Ct(t) {
|
|
585
585
|
let e = "([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";
|
|
586
586
|
return t.precision ? e = `${e}\\.\\d{${t.precision}}` : t.precision == null && (e = `${e}(\\.\\d+)?`), e;
|
|
587
587
|
}
|
|
588
|
-
function
|
|
589
|
-
return new RegExp(`^${
|
|
588
|
+
function Pr(t) {
|
|
589
|
+
return new RegExp(`^${Ct(t)}$`);
|
|
590
590
|
}
|
|
591
|
-
function
|
|
592
|
-
let e = `${
|
|
591
|
+
function It(t) {
|
|
592
|
+
let e = `${At}T${Ct(t)}`;
|
|
593
593
|
const r = [];
|
|
594
594
|
return r.push(t.local ? "Z?" : "Z"), t.offset && r.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${r.join("|")})`, new RegExp(`^${e}$`);
|
|
595
595
|
}
|
|
596
|
-
function
|
|
597
|
-
return !!((e === "v4" || !e) &&
|
|
596
|
+
function Zr(t, e) {
|
|
597
|
+
return !!((e === "v4" || !e) && Er.test(t) || (e === "v6" || !e) && Nr.test(t));
|
|
598
598
|
}
|
|
599
|
-
function
|
|
600
|
-
if (!
|
|
599
|
+
function jr(t, e) {
|
|
600
|
+
if (!kr.test(t))
|
|
601
601
|
return !1;
|
|
602
602
|
try {
|
|
603
603
|
const [r] = t.split("."), n = r.replace(/-/g, "+").replace(/_/g, "/").padEnd(r.length + (4 - r.length % 4) % 4, "="), s = JSON.parse(atob(n));
|
|
@@ -606,10 +606,10 @@ var ns = hr((is, gt) => {
|
|
|
606
606
|
return !1;
|
|
607
607
|
}
|
|
608
608
|
}
|
|
609
|
-
function
|
|
610
|
-
return !!((e === "v4" || !e) &&
|
|
609
|
+
function $r(t, e) {
|
|
610
|
+
return !!((e === "v4" || !e) && Or.test(t) || (e === "v6" || !e) && Rr.test(t));
|
|
611
611
|
}
|
|
612
|
-
class
|
|
612
|
+
class P extends _ {
|
|
613
613
|
_parse(e) {
|
|
614
614
|
if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== p.string) {
|
|
615
615
|
const a = this._getOrReturnCtx(e);
|
|
@@ -619,7 +619,7 @@ var ns = hr((is, gt) => {
|
|
|
619
619
|
received: a.parsedType
|
|
620
620
|
}), y;
|
|
621
621
|
}
|
|
622
|
-
const n = new
|
|
622
|
+
const n = new O();
|
|
623
623
|
let s;
|
|
624
624
|
for (const a of this._def.checks)
|
|
625
625
|
if (a.kind === "min")
|
|
@@ -658,43 +658,43 @@ var ns = hr((is, gt) => {
|
|
|
658
658
|
message: a.message
|
|
659
659
|
}), n.dirty());
|
|
660
660
|
} else if (a.kind === "email")
|
|
661
|
-
|
|
661
|
+
Tr.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
662
662
|
validation: "email",
|
|
663
663
|
code: u.invalid_string,
|
|
664
664
|
message: a.message
|
|
665
665
|
}), n.dirty());
|
|
666
666
|
else if (a.kind === "emoji")
|
|
667
|
-
|
|
667
|
+
tt || (tt = new RegExp(Sr, "u")), tt.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
668
668
|
validation: "emoji",
|
|
669
669
|
code: u.invalid_string,
|
|
670
670
|
message: a.message
|
|
671
671
|
}), n.dirty());
|
|
672
672
|
else if (a.kind === "uuid")
|
|
673
|
-
|
|
673
|
+
wr.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
674
674
|
validation: "uuid",
|
|
675
675
|
code: u.invalid_string,
|
|
676
676
|
message: a.message
|
|
677
677
|
}), n.dirty());
|
|
678
678
|
else if (a.kind === "nanoid")
|
|
679
|
-
|
|
679
|
+
br.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
680
680
|
validation: "nanoid",
|
|
681
681
|
code: u.invalid_string,
|
|
682
682
|
message: a.message
|
|
683
683
|
}), n.dirty());
|
|
684
684
|
else if (a.kind === "cuid")
|
|
685
|
-
|
|
685
|
+
gr.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
686
686
|
validation: "cuid",
|
|
687
687
|
code: u.invalid_string,
|
|
688
688
|
message: a.message
|
|
689
689
|
}), n.dirty());
|
|
690
690
|
else if (a.kind === "cuid2")
|
|
691
|
-
|
|
691
|
+
vr.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
692
692
|
validation: "cuid2",
|
|
693
693
|
code: u.invalid_string,
|
|
694
694
|
message: a.message
|
|
695
695
|
}), n.dirty());
|
|
696
696
|
else if (a.kind === "ulid")
|
|
697
|
-
|
|
697
|
+
_r.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
698
698
|
validation: "ulid",
|
|
699
699
|
code: u.invalid_string,
|
|
700
700
|
message: a.message
|
|
@@ -725,39 +725,39 @@ var ns = hr((is, gt) => {
|
|
|
725
725
|
code: u.invalid_string,
|
|
726
726
|
validation: { endsWith: a.value },
|
|
727
727
|
message: a.message
|
|
728
|
-
}), n.dirty()) : a.kind === "datetime" ?
|
|
728
|
+
}), n.dirty()) : a.kind === "datetime" ? It(a).test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
729
729
|
code: u.invalid_string,
|
|
730
730
|
validation: "datetime",
|
|
731
731
|
message: a.message
|
|
732
|
-
}), n.dirty()) : a.kind === "date" ?
|
|
732
|
+
}), n.dirty()) : a.kind === "date" ? Ir.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
733
733
|
code: u.invalid_string,
|
|
734
734
|
validation: "date",
|
|
735
735
|
message: a.message
|
|
736
|
-
}), n.dirty()) : a.kind === "time" ?
|
|
736
|
+
}), n.dirty()) : a.kind === "time" ? Pr(a).test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
737
737
|
code: u.invalid_string,
|
|
738
738
|
validation: "time",
|
|
739
739
|
message: a.message
|
|
740
|
-
}), n.dirty()) : a.kind === "duration" ?
|
|
740
|
+
}), n.dirty()) : a.kind === "duration" ? xr.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
741
741
|
validation: "duration",
|
|
742
742
|
code: u.invalid_string,
|
|
743
743
|
message: a.message
|
|
744
|
-
}), n.dirty()) : a.kind === "ip" ?
|
|
744
|
+
}), n.dirty()) : a.kind === "ip" ? Zr(e.data, a.version) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
745
745
|
validation: "ip",
|
|
746
746
|
code: u.invalid_string,
|
|
747
747
|
message: a.message
|
|
748
|
-
}), n.dirty()) : a.kind === "jwt" ?
|
|
748
|
+
}), n.dirty()) : a.kind === "jwt" ? jr(e.data, a.alg) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
749
749
|
validation: "jwt",
|
|
750
750
|
code: u.invalid_string,
|
|
751
751
|
message: a.message
|
|
752
|
-
}), n.dirty()) : a.kind === "cidr" ?
|
|
752
|
+
}), n.dirty()) : a.kind === "cidr" ? $r(e.data, a.version) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
753
753
|
validation: "cidr",
|
|
754
754
|
code: u.invalid_string,
|
|
755
755
|
message: a.message
|
|
756
|
-
}), n.dirty()) : a.kind === "base64" ?
|
|
756
|
+
}), n.dirty()) : a.kind === "base64" ? Ar.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
757
757
|
validation: "base64",
|
|
758
758
|
code: u.invalid_string,
|
|
759
759
|
message: a.message
|
|
760
|
-
}), n.dirty()) : a.kind === "base64url" ?
|
|
760
|
+
}), n.dirty()) : a.kind === "base64url" ? Cr.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
761
761
|
validation: "base64url",
|
|
762
762
|
code: u.invalid_string,
|
|
763
763
|
message: a.message
|
|
@@ -772,7 +772,7 @@ var ns = hr((is, gt) => {
|
|
|
772
772
|
});
|
|
773
773
|
}
|
|
774
774
|
_addCheck(e) {
|
|
775
|
-
return new
|
|
775
|
+
return new P({
|
|
776
776
|
...this._def,
|
|
777
777
|
checks: [...this._def.checks, e]
|
|
778
778
|
});
|
|
@@ -829,10 +829,10 @@ var ns = hr((is, gt) => {
|
|
|
829
829
|
message: e
|
|
830
830
|
}) : this._addCheck({
|
|
831
831
|
kind: "datetime",
|
|
832
|
-
precision: typeof
|
|
833
|
-
offset: (r = e
|
|
834
|
-
local: (n = e
|
|
835
|
-
...h.errToObj(e
|
|
832
|
+
precision: typeof e?.precision > "u" ? null : e?.precision,
|
|
833
|
+
offset: (r = e?.offset) !== null && r !== void 0 ? r : !1,
|
|
834
|
+
local: (n = e?.local) !== null && n !== void 0 ? n : !1,
|
|
835
|
+
...h.errToObj(e?.message)
|
|
836
836
|
});
|
|
837
837
|
}
|
|
838
838
|
date(e) {
|
|
@@ -845,8 +845,8 @@ var ns = hr((is, gt) => {
|
|
|
845
845
|
message: e
|
|
846
846
|
}) : this._addCheck({
|
|
847
847
|
kind: "time",
|
|
848
|
-
precision: typeof
|
|
849
|
-
...h.errToObj(e
|
|
848
|
+
precision: typeof e?.precision > "u" ? null : e?.precision,
|
|
849
|
+
...h.errToObj(e?.message)
|
|
850
850
|
});
|
|
851
851
|
}
|
|
852
852
|
duration(e) {
|
|
@@ -863,8 +863,8 @@ var ns = hr((is, gt) => {
|
|
|
863
863
|
return this._addCheck({
|
|
864
864
|
kind: "includes",
|
|
865
865
|
value: e,
|
|
866
|
-
position: r
|
|
867
|
-
...h.errToObj(r
|
|
866
|
+
position: r?.position,
|
|
867
|
+
...h.errToObj(r?.message)
|
|
868
868
|
});
|
|
869
869
|
}
|
|
870
870
|
startsWith(e, r) {
|
|
@@ -909,19 +909,19 @@ var ns = hr((is, gt) => {
|
|
|
909
909
|
return this.min(1, h.errToObj(e));
|
|
910
910
|
}
|
|
911
911
|
trim() {
|
|
912
|
-
return new
|
|
912
|
+
return new P({
|
|
913
913
|
...this._def,
|
|
914
914
|
checks: [...this._def.checks, { kind: "trim" }]
|
|
915
915
|
});
|
|
916
916
|
}
|
|
917
917
|
toLowerCase() {
|
|
918
|
-
return new
|
|
918
|
+
return new P({
|
|
919
919
|
...this._def,
|
|
920
920
|
checks: [...this._def.checks, { kind: "toLowerCase" }]
|
|
921
921
|
});
|
|
922
922
|
}
|
|
923
923
|
toUpperCase() {
|
|
924
|
-
return new
|
|
924
|
+
return new P({
|
|
925
925
|
...this._def,
|
|
926
926
|
checks: [...this._def.checks, { kind: "toUpperCase" }]
|
|
927
927
|
});
|
|
@@ -987,16 +987,16 @@ var ns = hr((is, gt) => {
|
|
|
987
987
|
return e;
|
|
988
988
|
}
|
|
989
989
|
}
|
|
990
|
-
|
|
990
|
+
P.create = (t) => {
|
|
991
991
|
var e;
|
|
992
|
-
return new
|
|
992
|
+
return new P({
|
|
993
993
|
checks: [],
|
|
994
994
|
typeName: m.ZodString,
|
|
995
|
-
coerce: (e = t
|
|
995
|
+
coerce: (e = t?.coerce) !== null && e !== void 0 ? e : !1,
|
|
996
996
|
...v(t)
|
|
997
997
|
});
|
|
998
998
|
};
|
|
999
|
-
function
|
|
999
|
+
function Fr(t, e) {
|
|
1000
1000
|
const r = (t.toString().split(".")[1] || "").length, n = (e.toString().split(".")[1] || "").length, s = r > n ? r : n, a = parseInt(t.toFixed(s).replace(".", "")), i = parseInt(e.toFixed(s).replace(".", ""));
|
|
1001
1001
|
return a % i / Math.pow(10, s);
|
|
1002
1002
|
}
|
|
@@ -1014,7 +1014,7 @@ var ns = hr((is, gt) => {
|
|
|
1014
1014
|
}), y;
|
|
1015
1015
|
}
|
|
1016
1016
|
let n;
|
|
1017
|
-
const s = new
|
|
1017
|
+
const s = new O();
|
|
1018
1018
|
for (const a of this._def.checks)
|
|
1019
1019
|
a.kind === "int" ? b.isInteger(e.data) || (n = this._getOrReturnCtx(e, n), f(n, {
|
|
1020
1020
|
code: u.invalid_type,
|
|
@@ -1035,7 +1035,7 @@ var ns = hr((is, gt) => {
|
|
|
1035
1035
|
inclusive: a.inclusive,
|
|
1036
1036
|
exact: !1,
|
|
1037
1037
|
message: a.message
|
|
1038
|
-
}), s.dirty()) : a.kind === "multipleOf" ?
|
|
1038
|
+
}), s.dirty()) : a.kind === "multipleOf" ? Fr(e.data, a.value) !== 0 && (n = this._getOrReturnCtx(e, n), f(n, {
|
|
1039
1039
|
code: u.not_multiple_of,
|
|
1040
1040
|
multipleOf: a.value,
|
|
1041
1041
|
message: a.message
|
|
@@ -1169,7 +1169,7 @@ var ns = hr((is, gt) => {
|
|
|
1169
1169
|
W.create = (t) => new W({
|
|
1170
1170
|
checks: [],
|
|
1171
1171
|
typeName: m.ZodNumber,
|
|
1172
|
-
coerce:
|
|
1172
|
+
coerce: t?.coerce || !1,
|
|
1173
1173
|
...v(t)
|
|
1174
1174
|
});
|
|
1175
1175
|
class J extends _ {
|
|
@@ -1186,7 +1186,7 @@ var ns = hr((is, gt) => {
|
|
|
1186
1186
|
if (this._getType(e) !== p.bigint)
|
|
1187
1187
|
return this._getInvalidInput(e);
|
|
1188
1188
|
let n;
|
|
1189
|
-
const s = new
|
|
1189
|
+
const s = new O();
|
|
1190
1190
|
for (const a of this._def.checks)
|
|
1191
1191
|
a.kind === "min" ? (a.inclusive ? e.data < a.value : e.data <= a.value) && (n = this._getOrReturnCtx(e, n), f(n, {
|
|
1192
1192
|
code: u.too_small,
|
|
@@ -1304,11 +1304,11 @@ var ns = hr((is, gt) => {
|
|
|
1304
1304
|
return new J({
|
|
1305
1305
|
checks: [],
|
|
1306
1306
|
typeName: m.ZodBigInt,
|
|
1307
|
-
coerce: (e = t
|
|
1307
|
+
coerce: (e = t?.coerce) !== null && e !== void 0 ? e : !1,
|
|
1308
1308
|
...v(t)
|
|
1309
1309
|
});
|
|
1310
1310
|
};
|
|
1311
|
-
class
|
|
1311
|
+
class Te extends _ {
|
|
1312
1312
|
_parse(e) {
|
|
1313
1313
|
if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== p.boolean) {
|
|
1314
1314
|
const n = this._getOrReturnCtx(e);
|
|
@@ -1318,15 +1318,15 @@ var ns = hr((is, gt) => {
|
|
|
1318
1318
|
received: n.parsedType
|
|
1319
1319
|
}), y;
|
|
1320
1320
|
}
|
|
1321
|
-
return
|
|
1321
|
+
return R(e.data);
|
|
1322
1322
|
}
|
|
1323
1323
|
}
|
|
1324
|
-
|
|
1324
|
+
Te.create = (t) => new Te({
|
|
1325
1325
|
typeName: m.ZodBoolean,
|
|
1326
|
-
coerce:
|
|
1326
|
+
coerce: t?.coerce || !1,
|
|
1327
1327
|
...v(t)
|
|
1328
1328
|
});
|
|
1329
|
-
class
|
|
1329
|
+
class se extends _ {
|
|
1330
1330
|
_parse(e) {
|
|
1331
1331
|
if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== p.date) {
|
|
1332
1332
|
const a = this._getOrReturnCtx(e);
|
|
@@ -1342,7 +1342,7 @@ var ns = hr((is, gt) => {
|
|
|
1342
1342
|
code: u.invalid_date
|
|
1343
1343
|
}), y;
|
|
1344
1344
|
}
|
|
1345
|
-
const n = new
|
|
1345
|
+
const n = new O();
|
|
1346
1346
|
let s;
|
|
1347
1347
|
for (const a of this._def.checks)
|
|
1348
1348
|
a.kind === "min" ? e.data.getTime() < a.value && (s = this._getOrReturnCtx(e, s), f(s, {
|
|
@@ -1366,7 +1366,7 @@ var ns = hr((is, gt) => {
|
|
|
1366
1366
|
};
|
|
1367
1367
|
}
|
|
1368
1368
|
_addCheck(e) {
|
|
1369
|
-
return new
|
|
1369
|
+
return new se({
|
|
1370
1370
|
...this._def,
|
|
1371
1371
|
checks: [...this._def.checks, e]
|
|
1372
1372
|
});
|
|
@@ -1398,13 +1398,13 @@ var ns = hr((is, gt) => {
|
|
|
1398
1398
|
return e != null ? new Date(e) : null;
|
|
1399
1399
|
}
|
|
1400
1400
|
}
|
|
1401
|
-
|
|
1401
|
+
se.create = (t) => new se({
|
|
1402
1402
|
checks: [],
|
|
1403
|
-
coerce:
|
|
1403
|
+
coerce: t?.coerce || !1,
|
|
1404
1404
|
typeName: m.ZodDate,
|
|
1405
1405
|
...v(t)
|
|
1406
1406
|
});
|
|
1407
|
-
class
|
|
1407
|
+
class qe extends _ {
|
|
1408
1408
|
_parse(e) {
|
|
1409
1409
|
if (this._getType(e) !== p.symbol) {
|
|
1410
1410
|
const n = this._getOrReturnCtx(e);
|
|
@@ -1414,14 +1414,14 @@ var ns = hr((is, gt) => {
|
|
|
1414
1414
|
received: n.parsedType
|
|
1415
1415
|
}), y;
|
|
1416
1416
|
}
|
|
1417
|
-
return
|
|
1417
|
+
return R(e.data);
|
|
1418
1418
|
}
|
|
1419
1419
|
}
|
|
1420
|
-
|
|
1420
|
+
qe.create = (t) => new qe({
|
|
1421
1421
|
typeName: m.ZodSymbol,
|
|
1422
1422
|
...v(t)
|
|
1423
1423
|
});
|
|
1424
|
-
class
|
|
1424
|
+
class Se extends _ {
|
|
1425
1425
|
_parse(e) {
|
|
1426
1426
|
if (this._getType(e) !== p.undefined) {
|
|
1427
1427
|
const n = this._getOrReturnCtx(e);
|
|
@@ -1431,14 +1431,14 @@ var ns = hr((is, gt) => {
|
|
|
1431
1431
|
received: n.parsedType
|
|
1432
1432
|
}), y;
|
|
1433
1433
|
}
|
|
1434
|
-
return
|
|
1434
|
+
return R(e.data);
|
|
1435
1435
|
}
|
|
1436
1436
|
}
|
|
1437
|
-
|
|
1437
|
+
Se.create = (t) => new Se({
|
|
1438
1438
|
typeName: m.ZodUndefined,
|
|
1439
1439
|
...v(t)
|
|
1440
1440
|
});
|
|
1441
|
-
class
|
|
1441
|
+
class Ee extends _ {
|
|
1442
1442
|
_parse(e) {
|
|
1443
1443
|
if (this._getType(e) !== p.null) {
|
|
1444
1444
|
const n = this._getOrReturnCtx(e);
|
|
@@ -1448,38 +1448,38 @@ var ns = hr((is, gt) => {
|
|
|
1448
1448
|
received: n.parsedType
|
|
1449
1449
|
}), y;
|
|
1450
1450
|
}
|
|
1451
|
-
return
|
|
1451
|
+
return R(e.data);
|
|
1452
1452
|
}
|
|
1453
1453
|
}
|
|
1454
|
-
|
|
1454
|
+
Ee.create = (t) => new Ee({
|
|
1455
1455
|
typeName: m.ZodNull,
|
|
1456
1456
|
...v(t)
|
|
1457
1457
|
});
|
|
1458
|
-
class
|
|
1458
|
+
class he extends _ {
|
|
1459
1459
|
constructor() {
|
|
1460
1460
|
super(...arguments), this._any = !0;
|
|
1461
1461
|
}
|
|
1462
1462
|
_parse(e) {
|
|
1463
|
-
return
|
|
1463
|
+
return R(e.data);
|
|
1464
1464
|
}
|
|
1465
1465
|
}
|
|
1466
|
-
|
|
1466
|
+
he.create = (t) => new he({
|
|
1467
1467
|
typeName: m.ZodAny,
|
|
1468
1468
|
...v(t)
|
|
1469
1469
|
});
|
|
1470
|
-
class
|
|
1470
|
+
class re extends _ {
|
|
1471
1471
|
constructor() {
|
|
1472
1472
|
super(...arguments), this._unknown = !0;
|
|
1473
1473
|
}
|
|
1474
1474
|
_parse(e) {
|
|
1475
|
-
return
|
|
1475
|
+
return R(e.data);
|
|
1476
1476
|
}
|
|
1477
1477
|
}
|
|
1478
|
-
|
|
1478
|
+
re.create = (t) => new re({
|
|
1479
1479
|
typeName: m.ZodUnknown,
|
|
1480
1480
|
...v(t)
|
|
1481
1481
|
});
|
|
1482
|
-
class
|
|
1482
|
+
class q extends _ {
|
|
1483
1483
|
_parse(e) {
|
|
1484
1484
|
const r = this._getOrReturnCtx(e);
|
|
1485
1485
|
return f(r, {
|
|
@@ -1489,11 +1489,11 @@ var ns = hr((is, gt) => {
|
|
|
1489
1489
|
}), y;
|
|
1490
1490
|
}
|
|
1491
1491
|
}
|
|
1492
|
-
|
|
1492
|
+
q.create = (t) => new q({
|
|
1493
1493
|
typeName: m.ZodNever,
|
|
1494
1494
|
...v(t)
|
|
1495
1495
|
});
|
|
1496
|
-
class
|
|
1496
|
+
class He extends _ {
|
|
1497
1497
|
_parse(e) {
|
|
1498
1498
|
if (this._getType(e) !== p.undefined) {
|
|
1499
1499
|
const n = this._getOrReturnCtx(e);
|
|
@@ -1503,14 +1503,14 @@ var ns = hr((is, gt) => {
|
|
|
1503
1503
|
received: n.parsedType
|
|
1504
1504
|
}), y;
|
|
1505
1505
|
}
|
|
1506
|
-
return
|
|
1506
|
+
return R(e.data);
|
|
1507
1507
|
}
|
|
1508
1508
|
}
|
|
1509
|
-
|
|
1509
|
+
He.create = (t) => new He({
|
|
1510
1510
|
typeName: m.ZodVoid,
|
|
1511
1511
|
...v(t)
|
|
1512
1512
|
});
|
|
1513
|
-
class
|
|
1513
|
+
class Z extends _ {
|
|
1514
1514
|
_parse(e) {
|
|
1515
1515
|
const { ctx: r, status: n } = this._processInputParams(e), s = this._def;
|
|
1516
1516
|
if (r.parsedType !== p.array)
|
|
@@ -1546,27 +1546,27 @@ var ns = hr((is, gt) => {
|
|
|
1546
1546
|
exact: !1,
|
|
1547
1547
|
message: s.maxLength.message
|
|
1548
1548
|
}), n.dirty()), r.common.async)
|
|
1549
|
-
return Promise.all([...r.data].map((i, o) => s.type._parseAsync(new
|
|
1550
|
-
const a = [...r.data].map((i, o) => s.type._parseSync(new
|
|
1551
|
-
return
|
|
1549
|
+
return Promise.all([...r.data].map((i, o) => s.type._parseAsync(new M(r, i, r.path, o)))).then((i) => O.mergeArray(n, i));
|
|
1550
|
+
const a = [...r.data].map((i, o) => s.type._parseSync(new M(r, i, r.path, o)));
|
|
1551
|
+
return O.mergeArray(n, a);
|
|
1552
1552
|
}
|
|
1553
1553
|
get element() {
|
|
1554
1554
|
return this._def.type;
|
|
1555
1555
|
}
|
|
1556
1556
|
min(e, r) {
|
|
1557
|
-
return new
|
|
1557
|
+
return new Z({
|
|
1558
1558
|
...this._def,
|
|
1559
1559
|
minLength: { value: e, message: h.toString(r) }
|
|
1560
1560
|
});
|
|
1561
1561
|
}
|
|
1562
1562
|
max(e, r) {
|
|
1563
|
-
return new
|
|
1563
|
+
return new Z({
|
|
1564
1564
|
...this._def,
|
|
1565
1565
|
maxLength: { value: e, message: h.toString(r) }
|
|
1566
1566
|
});
|
|
1567
1567
|
}
|
|
1568
1568
|
length(e, r) {
|
|
1569
|
-
return new
|
|
1569
|
+
return new Z({
|
|
1570
1570
|
...this._def,
|
|
1571
1571
|
exactLength: { value: e, message: h.toString(r) }
|
|
1572
1572
|
});
|
|
@@ -1575,7 +1575,7 @@ var ns = hr((is, gt) => {
|
|
|
1575
1575
|
return this.min(1, e);
|
|
1576
1576
|
}
|
|
1577
1577
|
}
|
|
1578
|
-
|
|
1578
|
+
Z.create = (t, e) => new Z({
|
|
1579
1579
|
type: t,
|
|
1580
1580
|
minLength: null,
|
|
1581
1581
|
maxLength: null,
|
|
@@ -1583,23 +1583,23 @@ var ns = hr((is, gt) => {
|
|
|
1583
1583
|
typeName: m.ZodArray,
|
|
1584
1584
|
...v(e)
|
|
1585
1585
|
});
|
|
1586
|
-
function
|
|
1587
|
-
if (t instanceof
|
|
1586
|
+
function ie(t) {
|
|
1587
|
+
if (t instanceof S) {
|
|
1588
1588
|
const e = {};
|
|
1589
1589
|
for (const r in t.shape) {
|
|
1590
1590
|
const n = t.shape[r];
|
|
1591
|
-
e[r] =
|
|
1591
|
+
e[r] = F.create(ie(n));
|
|
1592
1592
|
}
|
|
1593
|
-
return new
|
|
1593
|
+
return new S({
|
|
1594
1594
|
...t._def,
|
|
1595
1595
|
shape: () => e
|
|
1596
1596
|
});
|
|
1597
|
-
} else return t instanceof
|
|
1597
|
+
} else return t instanceof Z ? new Z({
|
|
1598
1598
|
...t._def,
|
|
1599
|
-
type:
|
|
1600
|
-
}) : t instanceof
|
|
1599
|
+
type: ie(t.element)
|
|
1600
|
+
}) : t instanceof F ? F.create(ie(t.unwrap())) : t instanceof K ? K.create(ie(t.unwrap())) : t instanceof L ? L.create(t.items.map((e) => ie(e))) : t;
|
|
1601
1601
|
}
|
|
1602
|
-
class
|
|
1602
|
+
class S extends _ {
|
|
1603
1603
|
constructor() {
|
|
1604
1604
|
super(...arguments), this._cached = null, this.nonstrict = this.passthrough, this.augment = this.extend;
|
|
1605
1605
|
}
|
|
@@ -1619,7 +1619,7 @@ var ns = hr((is, gt) => {
|
|
|
1619
1619
|
}), y;
|
|
1620
1620
|
}
|
|
1621
1621
|
const { status: n, ctx: s } = this._processInputParams(e), { shape: a, keys: i } = this._getCached(), o = [];
|
|
1622
|
-
if (!(this._def.catchall instanceof
|
|
1622
|
+
if (!(this._def.catchall instanceof q && this._def.unknownKeys === "strip"))
|
|
1623
1623
|
for (const c in s.data)
|
|
1624
1624
|
i.includes(c) || o.push(c);
|
|
1625
1625
|
const d = [];
|
|
@@ -1627,11 +1627,11 @@ var ns = hr((is, gt) => {
|
|
|
1627
1627
|
const l = a[c], w = s.data[c];
|
|
1628
1628
|
d.push({
|
|
1629
1629
|
key: { status: "valid", value: c },
|
|
1630
|
-
value: l._parse(new
|
|
1630
|
+
value: l._parse(new M(s, w, s.path, c)),
|
|
1631
1631
|
alwaysSet: c in s.data
|
|
1632
1632
|
});
|
|
1633
1633
|
}
|
|
1634
|
-
if (this._def.catchall instanceof
|
|
1634
|
+
if (this._def.catchall instanceof q) {
|
|
1635
1635
|
const c = this._def.unknownKeys;
|
|
1636
1636
|
if (c === "passthrough")
|
|
1637
1637
|
for (const l of o)
|
|
@@ -1652,7 +1652,7 @@ var ns = hr((is, gt) => {
|
|
|
1652
1652
|
d.push({
|
|
1653
1653
|
key: { status: "valid", value: l },
|
|
1654
1654
|
value: c._parse(
|
|
1655
|
-
new
|
|
1655
|
+
new M(s, w, s.path, l)
|
|
1656
1656
|
//, ctx.child(key), value, getParsedType(value)
|
|
1657
1657
|
),
|
|
1658
1658
|
alwaysSet: l in s.data
|
|
@@ -1670,13 +1670,13 @@ var ns = hr((is, gt) => {
|
|
|
1670
1670
|
});
|
|
1671
1671
|
}
|
|
1672
1672
|
return c;
|
|
1673
|
-
}).then((c) =>
|
|
1673
|
+
}).then((c) => O.mergeObjectSync(n, c)) : O.mergeObjectSync(n, d);
|
|
1674
1674
|
}
|
|
1675
1675
|
get shape() {
|
|
1676
1676
|
return this._def.shape();
|
|
1677
1677
|
}
|
|
1678
1678
|
strict(e) {
|
|
1679
|
-
return h.errToObj, new
|
|
1679
|
+
return h.errToObj, new S({
|
|
1680
1680
|
...this._def,
|
|
1681
1681
|
unknownKeys: "strict",
|
|
1682
1682
|
...e !== void 0 ? {
|
|
@@ -1693,13 +1693,13 @@ var ns = hr((is, gt) => {
|
|
|
1693
1693
|
});
|
|
1694
1694
|
}
|
|
1695
1695
|
strip() {
|
|
1696
|
-
return new
|
|
1696
|
+
return new S({
|
|
1697
1697
|
...this._def,
|
|
1698
1698
|
unknownKeys: "strip"
|
|
1699
1699
|
});
|
|
1700
1700
|
}
|
|
1701
1701
|
passthrough() {
|
|
1702
|
-
return new
|
|
1702
|
+
return new S({
|
|
1703
1703
|
...this._def,
|
|
1704
1704
|
unknownKeys: "passthrough"
|
|
1705
1705
|
});
|
|
@@ -1722,7 +1722,7 @@ var ns = hr((is, gt) => {
|
|
|
1722
1722
|
// }) as any;
|
|
1723
1723
|
// };
|
|
1724
1724
|
extend(e) {
|
|
1725
|
-
return new
|
|
1725
|
+
return new S({
|
|
1726
1726
|
...this._def,
|
|
1727
1727
|
shape: () => ({
|
|
1728
1728
|
...this._def.shape(),
|
|
@@ -1736,7 +1736,7 @@ var ns = hr((is, gt) => {
|
|
|
1736
1736
|
* upgrade if you are experiencing issues.
|
|
1737
1737
|
*/
|
|
1738
1738
|
merge(e) {
|
|
1739
|
-
return new
|
|
1739
|
+
return new S({
|
|
1740
1740
|
unknownKeys: e._def.unknownKeys,
|
|
1741
1741
|
catchall: e._def.catchall,
|
|
1742
1742
|
shape: () => ({
|
|
@@ -1806,7 +1806,7 @@ var ns = hr((is, gt) => {
|
|
|
1806
1806
|
// return merged;
|
|
1807
1807
|
// }
|
|
1808
1808
|
catchall(e) {
|
|
1809
|
-
return new
|
|
1809
|
+
return new S({
|
|
1810
1810
|
...this._def,
|
|
1811
1811
|
catchall: e
|
|
1812
1812
|
});
|
|
@@ -1815,7 +1815,7 @@ var ns = hr((is, gt) => {
|
|
|
1815
1815
|
const r = {};
|
|
1816
1816
|
return b.objectKeys(e).forEach((n) => {
|
|
1817
1817
|
e[n] && this.shape[n] && (r[n] = this.shape[n]);
|
|
1818
|
-
}), new
|
|
1818
|
+
}), new S({
|
|
1819
1819
|
...this._def,
|
|
1820
1820
|
shape: () => r
|
|
1821
1821
|
});
|
|
@@ -1824,7 +1824,7 @@ var ns = hr((is, gt) => {
|
|
|
1824
1824
|
const r = {};
|
|
1825
1825
|
return b.objectKeys(this.shape).forEach((n) => {
|
|
1826
1826
|
e[n] || (r[n] = this.shape[n]);
|
|
1827
|
-
}), new
|
|
1827
|
+
}), new S({
|
|
1828
1828
|
...this._def,
|
|
1829
1829
|
shape: () => r
|
|
1830
1830
|
});
|
|
@@ -1833,14 +1833,14 @@ var ns = hr((is, gt) => {
|
|
|
1833
1833
|
* @deprecated
|
|
1834
1834
|
*/
|
|
1835
1835
|
deepPartial() {
|
|
1836
|
-
return
|
|
1836
|
+
return ie(this);
|
|
1837
1837
|
}
|
|
1838
1838
|
partial(e) {
|
|
1839
1839
|
const r = {};
|
|
1840
1840
|
return b.objectKeys(this.shape).forEach((n) => {
|
|
1841
1841
|
const s = this.shape[n];
|
|
1842
1842
|
e && !e[n] ? r[n] = s : r[n] = s.optional();
|
|
1843
|
-
}), new
|
|
1843
|
+
}), new S({
|
|
1844
1844
|
...this._def,
|
|
1845
1845
|
shape: () => r
|
|
1846
1846
|
});
|
|
@@ -1852,41 +1852,41 @@ var ns = hr((is, gt) => {
|
|
|
1852
1852
|
r[n] = this.shape[n];
|
|
1853
1853
|
else {
|
|
1854
1854
|
let a = this.shape[n];
|
|
1855
|
-
for (; a instanceof
|
|
1855
|
+
for (; a instanceof F; )
|
|
1856
1856
|
a = a._def.innerType;
|
|
1857
1857
|
r[n] = a;
|
|
1858
1858
|
}
|
|
1859
|
-
}), new
|
|
1859
|
+
}), new S({
|
|
1860
1860
|
...this._def,
|
|
1861
1861
|
shape: () => r
|
|
1862
1862
|
});
|
|
1863
1863
|
}
|
|
1864
1864
|
keyof() {
|
|
1865
|
-
return
|
|
1865
|
+
return Pt(b.objectKeys(this.shape));
|
|
1866
1866
|
}
|
|
1867
1867
|
}
|
|
1868
|
-
|
|
1868
|
+
S.create = (t, e) => new S({
|
|
1869
1869
|
shape: () => t,
|
|
1870
1870
|
unknownKeys: "strip",
|
|
1871
|
-
catchall:
|
|
1871
|
+
catchall: q.create(),
|
|
1872
1872
|
typeName: m.ZodObject,
|
|
1873
1873
|
...v(e)
|
|
1874
1874
|
});
|
|
1875
|
-
|
|
1875
|
+
S.strictCreate = (t, e) => new S({
|
|
1876
1876
|
shape: () => t,
|
|
1877
1877
|
unknownKeys: "strict",
|
|
1878
|
-
catchall:
|
|
1878
|
+
catchall: q.create(),
|
|
1879
1879
|
typeName: m.ZodObject,
|
|
1880
1880
|
...v(e)
|
|
1881
1881
|
});
|
|
1882
|
-
|
|
1882
|
+
S.lazycreate = (t, e) => new S({
|
|
1883
1883
|
shape: t,
|
|
1884
1884
|
unknownKeys: "strip",
|
|
1885
|
-
catchall:
|
|
1885
|
+
catchall: q.create(),
|
|
1886
1886
|
typeName: m.ZodObject,
|
|
1887
1887
|
...v(e)
|
|
1888
1888
|
});
|
|
1889
|
-
class
|
|
1889
|
+
class Oe extends _ {
|
|
1890
1890
|
_parse(e) {
|
|
1891
1891
|
const { ctx: r } = this._processInputParams(e), n = this._def.options;
|
|
1892
1892
|
function s(a) {
|
|
@@ -1896,7 +1896,7 @@ var ns = hr((is, gt) => {
|
|
|
1896
1896
|
for (const o of a)
|
|
1897
1897
|
if (o.result.status === "dirty")
|
|
1898
1898
|
return r.common.issues.push(...o.ctx.common.issues), o.result;
|
|
1899
|
-
const i = a.map((o) => new
|
|
1899
|
+
const i = a.map((o) => new C(o.ctx.common.issues));
|
|
1900
1900
|
return f(r, {
|
|
1901
1901
|
code: u.invalid_union,
|
|
1902
1902
|
unionErrors: i
|
|
@@ -1943,7 +1943,7 @@ var ns = hr((is, gt) => {
|
|
|
1943
1943
|
}
|
|
1944
1944
|
if (a)
|
|
1945
1945
|
return r.common.issues.push(...a.ctx.common.issues), a.result;
|
|
1946
|
-
const o = i.map((d) => new
|
|
1946
|
+
const o = i.map((d) => new C(d));
|
|
1947
1947
|
return f(r, {
|
|
1948
1948
|
code: u.invalid_union,
|
|
1949
1949
|
unionErrors: o
|
|
@@ -1954,13 +1954,13 @@ var ns = hr((is, gt) => {
|
|
|
1954
1954
|
return this._def.options;
|
|
1955
1955
|
}
|
|
1956
1956
|
}
|
|
1957
|
-
|
|
1957
|
+
Oe.create = (t, e) => new Oe({
|
|
1958
1958
|
options: t,
|
|
1959
1959
|
typeName: m.ZodUnion,
|
|
1960
1960
|
...v(e)
|
|
1961
1961
|
});
|
|
1962
|
-
const
|
|
1963
|
-
class
|
|
1962
|
+
const U = (t) => t instanceof Ae ? U(t.schema) : t instanceof j ? U(t.innerType()) : t instanceof Ce ? [t.value] : t instanceof Y ? t.options : t instanceof Ie ? b.objectValues(t.enum) : t instanceof Pe ? U(t._def.innerType) : t instanceof Se ? [void 0] : t instanceof Ee ? [null] : t instanceof F ? [void 0, ...U(t.unwrap())] : t instanceof K ? [null, ...U(t.unwrap())] : t instanceof yt || t instanceof je ? U(t.unwrap()) : t instanceof Ze ? U(t._def.innerType) : [];
|
|
1963
|
+
class Xe extends _ {
|
|
1964
1964
|
_parse(e) {
|
|
1965
1965
|
const { ctx: r } = this._processInputParams(e);
|
|
1966
1966
|
if (r.parsedType !== p.object)
|
|
@@ -2004,7 +2004,7 @@ var ns = hr((is, gt) => {
|
|
|
2004
2004
|
static create(e, r, n) {
|
|
2005
2005
|
const s = /* @__PURE__ */ new Map();
|
|
2006
2006
|
for (const a of r) {
|
|
2007
|
-
const i =
|
|
2007
|
+
const i = U(a.shape[e]);
|
|
2008
2008
|
if (!i.length)
|
|
2009
2009
|
throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);
|
|
2010
2010
|
for (const o of i) {
|
|
@@ -2013,7 +2013,7 @@ var ns = hr((is, gt) => {
|
|
|
2013
2013
|
s.set(o, a);
|
|
2014
2014
|
}
|
|
2015
2015
|
}
|
|
2016
|
-
return new
|
|
2016
|
+
return new Xe({
|
|
2017
2017
|
typeName: m.ZodDiscriminatedUnion,
|
|
2018
2018
|
discriminator: e,
|
|
2019
2019
|
options: r,
|
|
@@ -2022,14 +2022,14 @@ var ns = hr((is, gt) => {
|
|
|
2022
2022
|
});
|
|
2023
2023
|
}
|
|
2024
2024
|
}
|
|
2025
|
-
function
|
|
2026
|
-
const r =
|
|
2025
|
+
function ot(t, e) {
|
|
2026
|
+
const r = z(t), n = z(e);
|
|
2027
2027
|
if (t === e)
|
|
2028
2028
|
return { valid: !0, data: t };
|
|
2029
2029
|
if (r === p.object && n === p.object) {
|
|
2030
2030
|
const s = b.objectKeys(e), a = b.objectKeys(t).filter((o) => s.indexOf(o) !== -1), i = { ...t, ...e };
|
|
2031
2031
|
for (const o of a) {
|
|
2032
|
-
const d =
|
|
2032
|
+
const d = ot(t[o], e[o]);
|
|
2033
2033
|
if (!d.valid)
|
|
2034
2034
|
return { valid: !1 };
|
|
2035
2035
|
i[o] = d.data;
|
|
@@ -2040,7 +2040,7 @@ var ns = hr((is, gt) => {
|
|
|
2040
2040
|
return { valid: !1 };
|
|
2041
2041
|
const s = [];
|
|
2042
2042
|
for (let a = 0; a < t.length; a++) {
|
|
2043
|
-
const i = t[a], o = e[a], d =
|
|
2043
|
+
const i = t[a], o = e[a], d = ot(i, o);
|
|
2044
2044
|
if (!d.valid)
|
|
2045
2045
|
return { valid: !1 };
|
|
2046
2046
|
s.push(d.data);
|
|
@@ -2048,13 +2048,13 @@ var ns = hr((is, gt) => {
|
|
|
2048
2048
|
return { valid: !0, data: s };
|
|
2049
2049
|
} else return r === p.date && n === p.date && +t == +e ? { valid: !0, data: t } : { valid: !1 };
|
|
2050
2050
|
}
|
|
2051
|
-
class
|
|
2051
|
+
class Ne extends _ {
|
|
2052
2052
|
_parse(e) {
|
|
2053
2053
|
const { status: r, ctx: n } = this._processInputParams(e), s = (a, i) => {
|
|
2054
|
-
if (
|
|
2054
|
+
if (at(a) || at(i))
|
|
2055
2055
|
return y;
|
|
2056
|
-
const o =
|
|
2057
|
-
return o.valid ? ((
|
|
2056
|
+
const o = ot(a.value, i.value);
|
|
2057
|
+
return o.valid ? ((it(a) || it(i)) && r.dirty(), { status: r.value, value: o.data }) : (f(n, {
|
|
2058
2058
|
code: u.invalid_intersection_types
|
|
2059
2059
|
}), y);
|
|
2060
2060
|
};
|
|
@@ -2080,13 +2080,13 @@ var ns = hr((is, gt) => {
|
|
|
2080
2080
|
}));
|
|
2081
2081
|
}
|
|
2082
2082
|
}
|
|
2083
|
-
|
|
2083
|
+
Ne.create = (t, e, r) => new Ne({
|
|
2084
2084
|
left: t,
|
|
2085
2085
|
right: e,
|
|
2086
2086
|
typeName: m.ZodIntersection,
|
|
2087
2087
|
...v(r)
|
|
2088
2088
|
});
|
|
2089
|
-
class
|
|
2089
|
+
class L extends _ {
|
|
2090
2090
|
_parse(e) {
|
|
2091
2091
|
const { status: r, ctx: n } = this._processInputParams(e);
|
|
2092
2092
|
if (n.parsedType !== p.array)
|
|
@@ -2112,31 +2112,31 @@ var ns = hr((is, gt) => {
|
|
|
2112
2112
|
}), r.dirty());
|
|
2113
2113
|
const a = [...n.data].map((i, o) => {
|
|
2114
2114
|
const d = this._def.items[o] || this._def.rest;
|
|
2115
|
-
return d ? d._parse(new
|
|
2115
|
+
return d ? d._parse(new M(n, i, n.path, o)) : null;
|
|
2116
2116
|
}).filter((i) => !!i);
|
|
2117
|
-
return n.common.async ? Promise.all(a).then((i) =>
|
|
2117
|
+
return n.common.async ? Promise.all(a).then((i) => O.mergeArray(r, i)) : O.mergeArray(r, a);
|
|
2118
2118
|
}
|
|
2119
2119
|
get items() {
|
|
2120
2120
|
return this._def.items;
|
|
2121
2121
|
}
|
|
2122
2122
|
rest(e) {
|
|
2123
|
-
return new
|
|
2123
|
+
return new L({
|
|
2124
2124
|
...this._def,
|
|
2125
2125
|
rest: e
|
|
2126
2126
|
});
|
|
2127
2127
|
}
|
|
2128
2128
|
}
|
|
2129
|
-
|
|
2129
|
+
L.create = (t, e) => {
|
|
2130
2130
|
if (!Array.isArray(t))
|
|
2131
2131
|
throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
|
|
2132
|
-
return new
|
|
2132
|
+
return new L({
|
|
2133
2133
|
items: t,
|
|
2134
2134
|
typeName: m.ZodTuple,
|
|
2135
2135
|
rest: null,
|
|
2136
2136
|
...v(e)
|
|
2137
2137
|
});
|
|
2138
2138
|
};
|
|
2139
|
-
class
|
|
2139
|
+
class Re extends _ {
|
|
2140
2140
|
get keySchema() {
|
|
2141
2141
|
return this._def.keyType;
|
|
2142
2142
|
}
|
|
@@ -2154,30 +2154,30 @@ var ns = hr((is, gt) => {
|
|
|
2154
2154
|
const s = [], a = this._def.keyType, i = this._def.valueType;
|
|
2155
2155
|
for (const o in n.data)
|
|
2156
2156
|
s.push({
|
|
2157
|
-
key: a._parse(new
|
|
2158
|
-
value: i._parse(new
|
|
2157
|
+
key: a._parse(new M(n, o, n.path, o)),
|
|
2158
|
+
value: i._parse(new M(n, n.data[o], n.path, o)),
|
|
2159
2159
|
alwaysSet: o in n.data
|
|
2160
2160
|
});
|
|
2161
|
-
return n.common.async ?
|
|
2161
|
+
return n.common.async ? O.mergeObjectAsync(r, s) : O.mergeObjectSync(r, s);
|
|
2162
2162
|
}
|
|
2163
2163
|
get element() {
|
|
2164
2164
|
return this._def.valueType;
|
|
2165
2165
|
}
|
|
2166
2166
|
static create(e, r, n) {
|
|
2167
|
-
return r instanceof _ ? new
|
|
2167
|
+
return r instanceof _ ? new Re({
|
|
2168
2168
|
keyType: e,
|
|
2169
2169
|
valueType: r,
|
|
2170
2170
|
typeName: m.ZodRecord,
|
|
2171
2171
|
...v(n)
|
|
2172
|
-
}) : new
|
|
2173
|
-
keyType:
|
|
2172
|
+
}) : new Re({
|
|
2173
|
+
keyType: P.create(),
|
|
2174
2174
|
valueType: e,
|
|
2175
2175
|
typeName: m.ZodRecord,
|
|
2176
2176
|
...v(r)
|
|
2177
2177
|
});
|
|
2178
2178
|
}
|
|
2179
2179
|
}
|
|
2180
|
-
class
|
|
2180
|
+
class Be extends _ {
|
|
2181
2181
|
get keySchema() {
|
|
2182
2182
|
return this._def.keyType;
|
|
2183
2183
|
}
|
|
@@ -2193,8 +2193,8 @@ var ns = hr((is, gt) => {
|
|
|
2193
2193
|
received: n.parsedType
|
|
2194
2194
|
}), y;
|
|
2195
2195
|
const s = this._def.keyType, a = this._def.valueType, i = [...n.data.entries()].map(([o, d], c) => ({
|
|
2196
|
-
key: s._parse(new
|
|
2197
|
-
value: a._parse(new
|
|
2196
|
+
key: s._parse(new M(n, o, n.path, [c, "key"])),
|
|
2197
|
+
value: a._parse(new M(n, d, n.path, [c, "value"]))
|
|
2198
2198
|
}));
|
|
2199
2199
|
if (n.common.async) {
|
|
2200
2200
|
const o = /* @__PURE__ */ new Map();
|
|
@@ -2219,13 +2219,13 @@ var ns = hr((is, gt) => {
|
|
|
2219
2219
|
}
|
|
2220
2220
|
}
|
|
2221
2221
|
}
|
|
2222
|
-
|
|
2222
|
+
Be.create = (t, e, r) => new Be({
|
|
2223
2223
|
valueType: e,
|
|
2224
2224
|
keyType: t,
|
|
2225
2225
|
typeName: m.ZodMap,
|
|
2226
2226
|
...v(r)
|
|
2227
2227
|
});
|
|
2228
|
-
class
|
|
2228
|
+
class ae extends _ {
|
|
2229
2229
|
_parse(e) {
|
|
2230
2230
|
const { status: r, ctx: n } = this._processInputParams(e);
|
|
2231
2231
|
if (n.parsedType !== p.set)
|
|
@@ -2260,17 +2260,17 @@ var ns = hr((is, gt) => {
|
|
|
2260
2260
|
}
|
|
2261
2261
|
return { status: r.value, value: c };
|
|
2262
2262
|
}
|
|
2263
|
-
const o = [...n.data.values()].map((d, c) => a._parse(new
|
|
2263
|
+
const o = [...n.data.values()].map((d, c) => a._parse(new M(n, d, n.path, c)));
|
|
2264
2264
|
return n.common.async ? Promise.all(o).then((d) => i(d)) : i(o);
|
|
2265
2265
|
}
|
|
2266
2266
|
min(e, r) {
|
|
2267
|
-
return new
|
|
2267
|
+
return new ae({
|
|
2268
2268
|
...this._def,
|
|
2269
2269
|
minSize: { value: e, message: h.toString(r) }
|
|
2270
2270
|
});
|
|
2271
2271
|
}
|
|
2272
2272
|
max(e, r) {
|
|
2273
|
-
return new
|
|
2273
|
+
return new ae({
|
|
2274
2274
|
...this._def,
|
|
2275
2275
|
maxSize: { value: e, message: h.toString(r) }
|
|
2276
2276
|
});
|
|
@@ -2282,14 +2282,14 @@ var ns = hr((is, gt) => {
|
|
|
2282
2282
|
return this.min(1, e);
|
|
2283
2283
|
}
|
|
2284
2284
|
}
|
|
2285
|
-
|
|
2285
|
+
ae.create = (t, e) => new ae({
|
|
2286
2286
|
valueType: t,
|
|
2287
2287
|
minSize: null,
|
|
2288
2288
|
maxSize: null,
|
|
2289
2289
|
typeName: m.ZodSet,
|
|
2290
2290
|
...v(e)
|
|
2291
2291
|
});
|
|
2292
|
-
class
|
|
2292
|
+
class fe extends _ {
|
|
2293
2293
|
constructor() {
|
|
2294
2294
|
super(...arguments), this.validate = this.implement;
|
|
2295
2295
|
}
|
|
@@ -2302,14 +2302,14 @@ var ns = hr((is, gt) => {
|
|
|
2302
2302
|
received: r.parsedType
|
|
2303
2303
|
}), y;
|
|
2304
2304
|
function n(o, d) {
|
|
2305
|
-
return
|
|
2305
|
+
return Ue({
|
|
2306
2306
|
data: o,
|
|
2307
2307
|
path: r.path,
|
|
2308
2308
|
errorMaps: [
|
|
2309
2309
|
r.common.contextualErrorMap,
|
|
2310
2310
|
r.schemaErrorMap,
|
|
2311
|
-
|
|
2312
|
-
|
|
2311
|
+
Ve(),
|
|
2312
|
+
pe
|
|
2313
2313
|
].filter((c) => !!c),
|
|
2314
2314
|
issueData: {
|
|
2315
2315
|
code: u.invalid_arguments,
|
|
@@ -2318,14 +2318,14 @@ var ns = hr((is, gt) => {
|
|
|
2318
2318
|
});
|
|
2319
2319
|
}
|
|
2320
2320
|
function s(o, d) {
|
|
2321
|
-
return
|
|
2321
|
+
return Ue({
|
|
2322
2322
|
data: o,
|
|
2323
2323
|
path: r.path,
|
|
2324
2324
|
errorMaps: [
|
|
2325
2325
|
r.common.contextualErrorMap,
|
|
2326
2326
|
r.schemaErrorMap,
|
|
2327
|
-
|
|
2328
|
-
|
|
2327
|
+
Ve(),
|
|
2328
|
+
pe
|
|
2329
2329
|
].filter((c) => !!c),
|
|
2330
2330
|
issueData: {
|
|
2331
2331
|
code: u.invalid_return_type,
|
|
@@ -2334,25 +2334,25 @@ var ns = hr((is, gt) => {
|
|
|
2334
2334
|
});
|
|
2335
2335
|
}
|
|
2336
2336
|
const a = { errorMap: r.common.contextualErrorMap }, i = r.data;
|
|
2337
|
-
if (this._def.returns instanceof
|
|
2337
|
+
if (this._def.returns instanceof me) {
|
|
2338
2338
|
const o = this;
|
|
2339
|
-
return
|
|
2340
|
-
const c = new
|
|
2341
|
-
throw c.addIssue(n(d,
|
|
2339
|
+
return R(async function(...d) {
|
|
2340
|
+
const c = new C([]), l = await o._def.args.parseAsync(d, a).catch((A) => {
|
|
2341
|
+
throw c.addIssue(n(d, A)), c;
|
|
2342
2342
|
}), w = await Reflect.apply(i, this, l);
|
|
2343
|
-
return await o._def.returns._def.type.parseAsync(w, a).catch((
|
|
2344
|
-
throw c.addIssue(s(w,
|
|
2343
|
+
return await o._def.returns._def.type.parseAsync(w, a).catch((A) => {
|
|
2344
|
+
throw c.addIssue(s(w, A)), c;
|
|
2345
2345
|
});
|
|
2346
2346
|
});
|
|
2347
2347
|
} else {
|
|
2348
2348
|
const o = this;
|
|
2349
|
-
return
|
|
2349
|
+
return R(function(...d) {
|
|
2350
2350
|
const c = o._def.args.safeParse(d, a);
|
|
2351
2351
|
if (!c.success)
|
|
2352
|
-
throw new
|
|
2352
|
+
throw new C([n(d, c.error)]);
|
|
2353
2353
|
const l = Reflect.apply(i, this, c.data), w = o._def.returns.safeParse(l, a);
|
|
2354
2354
|
if (!w.success)
|
|
2355
|
-
throw new
|
|
2355
|
+
throw new C([s(l, w.error)]);
|
|
2356
2356
|
return w.data;
|
|
2357
2357
|
});
|
|
2358
2358
|
}
|
|
@@ -2364,13 +2364,13 @@ var ns = hr((is, gt) => {
|
|
|
2364
2364
|
return this._def.returns;
|
|
2365
2365
|
}
|
|
2366
2366
|
args(...e) {
|
|
2367
|
-
return new
|
|
2367
|
+
return new fe({
|
|
2368
2368
|
...this._def,
|
|
2369
|
-
args:
|
|
2369
|
+
args: L.create(e).rest(re.create())
|
|
2370
2370
|
});
|
|
2371
2371
|
}
|
|
2372
2372
|
returns(e) {
|
|
2373
|
-
return new
|
|
2373
|
+
return new fe({
|
|
2374
2374
|
...this._def,
|
|
2375
2375
|
returns: e
|
|
2376
2376
|
});
|
|
@@ -2382,15 +2382,15 @@ var ns = hr((is, gt) => {
|
|
|
2382
2382
|
return this.parse(e);
|
|
2383
2383
|
}
|
|
2384
2384
|
static create(e, r, n) {
|
|
2385
|
-
return new
|
|
2386
|
-
args: e ||
|
|
2387
|
-
returns: r ||
|
|
2385
|
+
return new fe({
|
|
2386
|
+
args: e || L.create([]).rest(re.create()),
|
|
2387
|
+
returns: r || re.create(),
|
|
2388
2388
|
typeName: m.ZodFunction,
|
|
2389
2389
|
...v(n)
|
|
2390
2390
|
});
|
|
2391
2391
|
}
|
|
2392
2392
|
}
|
|
2393
|
-
class
|
|
2393
|
+
class Ae extends _ {
|
|
2394
2394
|
get schema() {
|
|
2395
2395
|
return this._def.getter();
|
|
2396
2396
|
}
|
|
@@ -2399,12 +2399,12 @@ var ns = hr((is, gt) => {
|
|
|
2399
2399
|
return this._def.getter()._parse({ data: r.data, path: r.path, parent: r });
|
|
2400
2400
|
}
|
|
2401
2401
|
}
|
|
2402
|
-
|
|
2402
|
+
Ae.create = (t, e) => new Ae({
|
|
2403
2403
|
getter: t,
|
|
2404
2404
|
typeName: m.ZodLazy,
|
|
2405
2405
|
...v(e)
|
|
2406
2406
|
});
|
|
2407
|
-
class
|
|
2407
|
+
class Ce extends _ {
|
|
2408
2408
|
_parse(e) {
|
|
2409
2409
|
if (e.data !== this._def.value) {
|
|
2410
2410
|
const r = this._getOrReturnCtx(e);
|
|
@@ -2420,12 +2420,12 @@ var ns = hr((is, gt) => {
|
|
|
2420
2420
|
return this._def.value;
|
|
2421
2421
|
}
|
|
2422
2422
|
}
|
|
2423
|
-
|
|
2423
|
+
Ce.create = (t, e) => new Ce({
|
|
2424
2424
|
value: t,
|
|
2425
2425
|
typeName: m.ZodLiteral,
|
|
2426
2426
|
...v(e)
|
|
2427
2427
|
});
|
|
2428
|
-
function
|
|
2428
|
+
function Pt(t, e) {
|
|
2429
2429
|
return new Y({
|
|
2430
2430
|
values: t,
|
|
2431
2431
|
typeName: m.ZodEnum,
|
|
@@ -2434,7 +2434,7 @@ var ns = hr((is, gt) => {
|
|
|
2434
2434
|
}
|
|
2435
2435
|
class Y extends _ {
|
|
2436
2436
|
constructor() {
|
|
2437
|
-
super(...arguments),
|
|
2437
|
+
super(...arguments), _e.set(this, void 0);
|
|
2438
2438
|
}
|
|
2439
2439
|
_parse(e) {
|
|
2440
2440
|
if (typeof e.data != "string") {
|
|
@@ -2445,7 +2445,7 @@ var ns = hr((is, gt) => {
|
|
|
2445
2445
|
code: u.invalid_type
|
|
2446
2446
|
}), y;
|
|
2447
2447
|
}
|
|
2448
|
-
if (
|
|
2448
|
+
if (ze(this, _e) || Rt(this, _e, new Set(this._def.values)), !ze(this, _e).has(e.data)) {
|
|
2449
2449
|
const r = this._getOrReturnCtx(e), n = this._def.values;
|
|
2450
2450
|
return f(r, {
|
|
2451
2451
|
received: r.data,
|
|
@@ -2453,7 +2453,7 @@ var ns = hr((is, gt) => {
|
|
|
2453
2453
|
options: n
|
|
2454
2454
|
}), y;
|
|
2455
2455
|
}
|
|
2456
|
-
return
|
|
2456
|
+
return R(e.data);
|
|
2457
2457
|
}
|
|
2458
2458
|
get options() {
|
|
2459
2459
|
return this._def.values;
|
|
@@ -2489,11 +2489,11 @@ var ns = hr((is, gt) => {
|
|
|
2489
2489
|
});
|
|
2490
2490
|
}
|
|
2491
2491
|
}
|
|
2492
|
-
|
|
2493
|
-
Y.create =
|
|
2494
|
-
class
|
|
2492
|
+
_e = /* @__PURE__ */ new WeakMap();
|
|
2493
|
+
Y.create = Pt;
|
|
2494
|
+
class Ie extends _ {
|
|
2495
2495
|
constructor() {
|
|
2496
|
-
super(...arguments),
|
|
2496
|
+
super(...arguments), we.set(this, void 0);
|
|
2497
2497
|
}
|
|
2498
2498
|
_parse(e) {
|
|
2499
2499
|
const r = b.getValidEnumValues(this._def.values), n = this._getOrReturnCtx(e);
|
|
@@ -2505,7 +2505,7 @@ var ns = hr((is, gt) => {
|
|
|
2505
2505
|
code: u.invalid_type
|
|
2506
2506
|
}), y;
|
|
2507
2507
|
}
|
|
2508
|
-
if (
|
|
2508
|
+
if (ze(this, we) || Rt(this, we, new Set(b.getValidEnumValues(this._def.values))), !ze(this, we).has(e.data)) {
|
|
2509
2509
|
const s = b.objectValues(r);
|
|
2510
2510
|
return f(n, {
|
|
2511
2511
|
received: n.data,
|
|
@@ -2513,19 +2513,19 @@ var ns = hr((is, gt) => {
|
|
|
2513
2513
|
options: s
|
|
2514
2514
|
}), y;
|
|
2515
2515
|
}
|
|
2516
|
-
return
|
|
2516
|
+
return R(e.data);
|
|
2517
2517
|
}
|
|
2518
2518
|
get enum() {
|
|
2519
2519
|
return this._def.values;
|
|
2520
2520
|
}
|
|
2521
2521
|
}
|
|
2522
|
-
|
|
2523
|
-
|
|
2522
|
+
we = /* @__PURE__ */ new WeakMap();
|
|
2523
|
+
Ie.create = (t, e) => new Ie({
|
|
2524
2524
|
values: t,
|
|
2525
2525
|
typeName: m.ZodNativeEnum,
|
|
2526
2526
|
...v(e)
|
|
2527
2527
|
});
|
|
2528
|
-
class
|
|
2528
|
+
class me extends _ {
|
|
2529
2529
|
unwrap() {
|
|
2530
2530
|
return this._def.type;
|
|
2531
2531
|
}
|
|
@@ -2538,18 +2538,18 @@ var ns = hr((is, gt) => {
|
|
|
2538
2538
|
received: r.parsedType
|
|
2539
2539
|
}), y;
|
|
2540
2540
|
const n = r.parsedType === p.promise ? r.data : Promise.resolve(r.data);
|
|
2541
|
-
return
|
|
2541
|
+
return R(n.then((s) => this._def.type.parseAsync(s, {
|
|
2542
2542
|
path: r.path,
|
|
2543
2543
|
errorMap: r.common.contextualErrorMap
|
|
2544
2544
|
})));
|
|
2545
2545
|
}
|
|
2546
2546
|
}
|
|
2547
|
-
|
|
2547
|
+
me.create = (t, e) => new me({
|
|
2548
2548
|
type: t,
|
|
2549
2549
|
typeName: m.ZodPromise,
|
|
2550
2550
|
...v(e)
|
|
2551
2551
|
});
|
|
2552
|
-
class
|
|
2552
|
+
class j extends _ {
|
|
2553
2553
|
innerType() {
|
|
2554
2554
|
return this._def.schema;
|
|
2555
2555
|
}
|
|
@@ -2576,7 +2576,7 @@ var ns = hr((is, gt) => {
|
|
|
2576
2576
|
path: n.path,
|
|
2577
2577
|
parent: n
|
|
2578
2578
|
});
|
|
2579
|
-
return d.status === "aborted" ? y : d.status === "dirty" || r.value === "dirty" ?
|
|
2579
|
+
return d.status === "aborted" ? y : d.status === "dirty" || r.value === "dirty" ? le(d.value) : d;
|
|
2580
2580
|
});
|
|
2581
2581
|
{
|
|
2582
2582
|
if (r.value === "aborted")
|
|
@@ -2586,7 +2586,7 @@ var ns = hr((is, gt) => {
|
|
|
2586
2586
|
path: n.path,
|
|
2587
2587
|
parent: n
|
|
2588
2588
|
});
|
|
2589
|
-
return o.status === "aborted" ? y : o.status === "dirty" || r.value === "dirty" ?
|
|
2589
|
+
return o.status === "aborted" ? y : o.status === "dirty" || r.value === "dirty" ? le(o.value) : o;
|
|
2590
2590
|
}
|
|
2591
2591
|
}
|
|
2592
2592
|
if (s.type === "refinement") {
|
|
@@ -2615,45 +2615,45 @@ var ns = hr((is, gt) => {
|
|
|
2615
2615
|
path: n.path,
|
|
2616
2616
|
parent: n
|
|
2617
2617
|
});
|
|
2618
|
-
if (!
|
|
2618
|
+
if (!ne(i))
|
|
2619
2619
|
return i;
|
|
2620
2620
|
const o = s.transform(i.value, a);
|
|
2621
2621
|
if (o instanceof Promise)
|
|
2622
2622
|
throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
|
|
2623
2623
|
return { status: r.value, value: o };
|
|
2624
2624
|
} else
|
|
2625
|
-
return this._def.schema._parseAsync({ data: n.data, path: n.path, parent: n }).then((i) =>
|
|
2625
|
+
return this._def.schema._parseAsync({ data: n.data, path: n.path, parent: n }).then((i) => ne(i) ? Promise.resolve(s.transform(i.value, a)).then((o) => ({ status: r.value, value: o })) : i);
|
|
2626
2626
|
b.assertNever(s);
|
|
2627
2627
|
}
|
|
2628
2628
|
}
|
|
2629
|
-
|
|
2629
|
+
j.create = (t, e, r) => new j({
|
|
2630
2630
|
schema: t,
|
|
2631
2631
|
typeName: m.ZodEffects,
|
|
2632
2632
|
effect: e,
|
|
2633
2633
|
...v(r)
|
|
2634
2634
|
});
|
|
2635
|
-
|
|
2635
|
+
j.createWithPreprocess = (t, e, r) => new j({
|
|
2636
2636
|
schema: e,
|
|
2637
2637
|
effect: { type: "preprocess", transform: t },
|
|
2638
2638
|
typeName: m.ZodEffects,
|
|
2639
2639
|
...v(r)
|
|
2640
2640
|
});
|
|
2641
|
-
class
|
|
2641
|
+
class F extends _ {
|
|
2642
2642
|
_parse(e) {
|
|
2643
|
-
return this._getType(e) === p.undefined ?
|
|
2643
|
+
return this._getType(e) === p.undefined ? R(void 0) : this._def.innerType._parse(e);
|
|
2644
2644
|
}
|
|
2645
2645
|
unwrap() {
|
|
2646
2646
|
return this._def.innerType;
|
|
2647
2647
|
}
|
|
2648
2648
|
}
|
|
2649
|
-
|
|
2649
|
+
F.create = (t, e) => new F({
|
|
2650
2650
|
innerType: t,
|
|
2651
2651
|
typeName: m.ZodOptional,
|
|
2652
2652
|
...v(e)
|
|
2653
2653
|
});
|
|
2654
2654
|
class K extends _ {
|
|
2655
2655
|
_parse(e) {
|
|
2656
|
-
return this._getType(e) === p.null ?
|
|
2656
|
+
return this._getType(e) === p.null ? R(null) : this._def.innerType._parse(e);
|
|
2657
2657
|
}
|
|
2658
2658
|
unwrap() {
|
|
2659
2659
|
return this._def.innerType;
|
|
@@ -2664,7 +2664,7 @@ var ns = hr((is, gt) => {
|
|
|
2664
2664
|
typeName: m.ZodNullable,
|
|
2665
2665
|
...v(e)
|
|
2666
2666
|
});
|
|
2667
|
-
class
|
|
2667
|
+
class Pe extends _ {
|
|
2668
2668
|
_parse(e) {
|
|
2669
2669
|
const { ctx: r } = this._processInputParams(e);
|
|
2670
2670
|
let n = r.data;
|
|
@@ -2678,13 +2678,13 @@ var ns = hr((is, gt) => {
|
|
|
2678
2678
|
return this._def.innerType;
|
|
2679
2679
|
}
|
|
2680
2680
|
}
|
|
2681
|
-
|
|
2681
|
+
Pe.create = (t, e) => new Pe({
|
|
2682
2682
|
innerType: t,
|
|
2683
2683
|
typeName: m.ZodDefault,
|
|
2684
2684
|
defaultValue: typeof e.default == "function" ? e.default : () => e.default,
|
|
2685
2685
|
...v(e)
|
|
2686
2686
|
});
|
|
2687
|
-
class
|
|
2687
|
+
class Ze extends _ {
|
|
2688
2688
|
_parse(e) {
|
|
2689
2689
|
const { ctx: r } = this._processInputParams(e), n = {
|
|
2690
2690
|
...r,
|
|
@@ -2699,11 +2699,11 @@ var ns = hr((is, gt) => {
|
|
|
2699
2699
|
...n
|
|
2700
2700
|
}
|
|
2701
2701
|
});
|
|
2702
|
-
return
|
|
2702
|
+
return xe(s) ? s.then((a) => ({
|
|
2703
2703
|
status: "valid",
|
|
2704
2704
|
value: a.status === "valid" ? a.value : this._def.catchValue({
|
|
2705
2705
|
get error() {
|
|
2706
|
-
return new
|
|
2706
|
+
return new C(n.common.issues);
|
|
2707
2707
|
},
|
|
2708
2708
|
input: n.data
|
|
2709
2709
|
})
|
|
@@ -2711,7 +2711,7 @@ var ns = hr((is, gt) => {
|
|
|
2711
2711
|
status: "valid",
|
|
2712
2712
|
value: s.status === "valid" ? s.value : this._def.catchValue({
|
|
2713
2713
|
get error() {
|
|
2714
|
-
return new
|
|
2714
|
+
return new C(n.common.issues);
|
|
2715
2715
|
},
|
|
2716
2716
|
input: n.data
|
|
2717
2717
|
})
|
|
@@ -2721,13 +2721,13 @@ var ns = hr((is, gt) => {
|
|
|
2721
2721
|
return this._def.innerType;
|
|
2722
2722
|
}
|
|
2723
2723
|
}
|
|
2724
|
-
|
|
2724
|
+
Ze.create = (t, e) => new Ze({
|
|
2725
2725
|
innerType: t,
|
|
2726
2726
|
typeName: m.ZodCatch,
|
|
2727
2727
|
catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
|
|
2728
2728
|
...v(e)
|
|
2729
2729
|
});
|
|
2730
|
-
class
|
|
2730
|
+
class We extends _ {
|
|
2731
2731
|
_parse(e) {
|
|
2732
2732
|
if (this._getType(e) !== p.nan) {
|
|
2733
2733
|
const n = this._getOrReturnCtx(e);
|
|
@@ -2740,12 +2740,12 @@ var ns = hr((is, gt) => {
|
|
|
2740
2740
|
return { status: "valid", value: e.data };
|
|
2741
2741
|
}
|
|
2742
2742
|
}
|
|
2743
|
-
|
|
2743
|
+
We.create = (t) => new We({
|
|
2744
2744
|
typeName: m.ZodNaN,
|
|
2745
2745
|
...v(t)
|
|
2746
2746
|
});
|
|
2747
|
-
const
|
|
2748
|
-
class
|
|
2747
|
+
const Mr = Symbol("zod_brand");
|
|
2748
|
+
class yt extends _ {
|
|
2749
2749
|
_parse(e) {
|
|
2750
2750
|
const { ctx: r } = this._processInputParams(e), n = r.data;
|
|
2751
2751
|
return this._def.type._parse({
|
|
@@ -2758,7 +2758,7 @@ var ns = hr((is, gt) => {
|
|
|
2758
2758
|
return this._def.type;
|
|
2759
2759
|
}
|
|
2760
2760
|
}
|
|
2761
|
-
class
|
|
2761
|
+
class $e extends _ {
|
|
2762
2762
|
_parse(e) {
|
|
2763
2763
|
const { status: r, ctx: n } = this._processInputParams(e);
|
|
2764
2764
|
if (n.common.async)
|
|
@@ -2768,7 +2768,7 @@ var ns = hr((is, gt) => {
|
|
|
2768
2768
|
path: n.path,
|
|
2769
2769
|
parent: n
|
|
2770
2770
|
});
|
|
2771
|
-
return a.status === "aborted" ? y : a.status === "dirty" ? (r.dirty(),
|
|
2771
|
+
return a.status === "aborted" ? y : a.status === "dirty" ? (r.dirty(), le(a.value)) : this._def.out._parseAsync({
|
|
2772
2772
|
data: a.value,
|
|
2773
2773
|
path: n.path,
|
|
2774
2774
|
parent: n
|
|
@@ -2791,201 +2791,201 @@ var ns = hr((is, gt) => {
|
|
|
2791
2791
|
}
|
|
2792
2792
|
}
|
|
2793
2793
|
static create(e, r) {
|
|
2794
|
-
return new
|
|
2794
|
+
return new $e({
|
|
2795
2795
|
in: e,
|
|
2796
2796
|
out: r,
|
|
2797
2797
|
typeName: m.ZodPipeline
|
|
2798
2798
|
});
|
|
2799
2799
|
}
|
|
2800
2800
|
}
|
|
2801
|
-
class
|
|
2801
|
+
class je extends _ {
|
|
2802
2802
|
_parse(e) {
|
|
2803
|
-
const r = this._def.innerType._parse(e), n = (s) => (
|
|
2804
|
-
return
|
|
2803
|
+
const r = this._def.innerType._parse(e), n = (s) => (ne(s) && (s.value = Object.freeze(s.value)), s);
|
|
2804
|
+
return xe(r) ? r.then((s) => n(s)) : n(r);
|
|
2805
2805
|
}
|
|
2806
2806
|
unwrap() {
|
|
2807
2807
|
return this._def.innerType;
|
|
2808
2808
|
}
|
|
2809
2809
|
}
|
|
2810
|
-
|
|
2810
|
+
je.create = (t, e) => new je({
|
|
2811
2811
|
innerType: t,
|
|
2812
2812
|
typeName: m.ZodReadonly,
|
|
2813
2813
|
...v(e)
|
|
2814
2814
|
});
|
|
2815
|
-
function
|
|
2815
|
+
function Tt(t, e) {
|
|
2816
2816
|
const r = typeof t == "function" ? t(e) : typeof t == "string" ? { message: t } : t;
|
|
2817
2817
|
return typeof r == "string" ? { message: r } : r;
|
|
2818
2818
|
}
|
|
2819
|
-
function
|
|
2820
|
-
return t ?
|
|
2819
|
+
function Zt(t, e = {}, r) {
|
|
2820
|
+
return t ? he.create().superRefine((n, s) => {
|
|
2821
2821
|
var a, i;
|
|
2822
2822
|
const o = t(n);
|
|
2823
2823
|
if (o instanceof Promise)
|
|
2824
2824
|
return o.then((d) => {
|
|
2825
2825
|
var c, l;
|
|
2826
2826
|
if (!d) {
|
|
2827
|
-
const w =
|
|
2827
|
+
const w = Tt(e, n), x = (l = (c = w.fatal) !== null && c !== void 0 ? c : r) !== null && l !== void 0 ? l : !0;
|
|
2828
2828
|
s.addIssue({ code: "custom", ...w, fatal: x });
|
|
2829
2829
|
}
|
|
2830
2830
|
});
|
|
2831
2831
|
if (!o) {
|
|
2832
|
-
const d =
|
|
2832
|
+
const d = Tt(e, n), c = (i = (a = d.fatal) !== null && a !== void 0 ? a : r) !== null && i !== void 0 ? i : !0;
|
|
2833
2833
|
s.addIssue({ code: "custom", ...d, fatal: c });
|
|
2834
2834
|
}
|
|
2835
|
-
}) :
|
|
2835
|
+
}) : he.create();
|
|
2836
2836
|
}
|
|
2837
|
-
const
|
|
2838
|
-
object:
|
|
2837
|
+
const Lr = {
|
|
2838
|
+
object: S.lazycreate
|
|
2839
2839
|
};
|
|
2840
2840
|
var m;
|
|
2841
2841
|
(function(t) {
|
|
2842
2842
|
t.ZodString = "ZodString", t.ZodNumber = "ZodNumber", t.ZodNaN = "ZodNaN", t.ZodBigInt = "ZodBigInt", t.ZodBoolean = "ZodBoolean", t.ZodDate = "ZodDate", t.ZodSymbol = "ZodSymbol", t.ZodUndefined = "ZodUndefined", t.ZodNull = "ZodNull", t.ZodAny = "ZodAny", t.ZodUnknown = "ZodUnknown", t.ZodNever = "ZodNever", t.ZodVoid = "ZodVoid", t.ZodArray = "ZodArray", t.ZodObject = "ZodObject", t.ZodUnion = "ZodUnion", t.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", t.ZodIntersection = "ZodIntersection", t.ZodTuple = "ZodTuple", t.ZodRecord = "ZodRecord", t.ZodMap = "ZodMap", t.ZodSet = "ZodSet", t.ZodFunction = "ZodFunction", t.ZodLazy = "ZodLazy", t.ZodLiteral = "ZodLiteral", t.ZodEnum = "ZodEnum", t.ZodEffects = "ZodEffects", t.ZodNativeEnum = "ZodNativeEnum", t.ZodOptional = "ZodOptional", t.ZodNullable = "ZodNullable", t.ZodDefault = "ZodDefault", t.ZodCatch = "ZodCatch", t.ZodPromise = "ZodPromise", t.ZodBranded = "ZodBranded", t.ZodPipeline = "ZodPipeline", t.ZodReadonly = "ZodReadonly";
|
|
2843
2843
|
})(m || (m = {}));
|
|
2844
|
-
const
|
|
2844
|
+
const Dr = (t, e = {
|
|
2845
2845
|
message: `Input not instance of ${t.name}`
|
|
2846
|
-
}) =>
|
|
2847
|
-
string: (t) =>
|
|
2846
|
+
}) => Zt((r) => r instanceof t, e), jt = P.create, $t = W.create, Vr = We.create, Ur = J.create, Ft = Te.create, zr = se.create, qr = qe.create, Hr = Se.create, Br = Ee.create, Wr = he.create, Jr = re.create, Yr = q.create, Kr = He.create, Gr = Z.create, Xr = S.create, Qr = S.strictCreate, en = Oe.create, tn = Xe.create, rn = Ne.create, nn = L.create, sn = Re.create, an = Be.create, on = ae.create, dn = fe.create, cn = Ae.create, un = Ce.create, ln = Y.create, fn = Ie.create, pn = me.create, St = j.create, hn = F.create, mn = K.create, yn = j.createWithPreprocess, gn = $e.create, vn = () => jt().optional(), _n = () => $t().optional(), wn = () => Ft().optional(), bn = {
|
|
2847
|
+
string: (t) => P.create({ ...t, coerce: !0 }),
|
|
2848
2848
|
number: (t) => W.create({ ...t, coerce: !0 }),
|
|
2849
|
-
boolean: (t) =>
|
|
2849
|
+
boolean: (t) => Te.create({
|
|
2850
2850
|
...t,
|
|
2851
2851
|
coerce: !0
|
|
2852
2852
|
}),
|
|
2853
2853
|
bigint: (t) => J.create({ ...t, coerce: !0 }),
|
|
2854
|
-
date: (t) =>
|
|
2855
|
-
},
|
|
2856
|
-
var
|
|
2854
|
+
date: (t) => se.create({ ...t, coerce: !0 })
|
|
2855
|
+
}, kn = y;
|
|
2856
|
+
var Je = /* @__PURE__ */ Object.freeze({
|
|
2857
2857
|
__proto__: null,
|
|
2858
|
-
defaultErrorMap:
|
|
2859
|
-
setErrorMap:
|
|
2860
|
-
getErrorMap:
|
|
2861
|
-
makeIssue:
|
|
2862
|
-
EMPTY_PATH:
|
|
2858
|
+
defaultErrorMap: pe,
|
|
2859
|
+
setErrorMap: mr,
|
|
2860
|
+
getErrorMap: Ve,
|
|
2861
|
+
makeIssue: Ue,
|
|
2862
|
+
EMPTY_PATH: yr,
|
|
2863
2863
|
addIssueToContext: f,
|
|
2864
|
-
ParseStatus:
|
|
2864
|
+
ParseStatus: O,
|
|
2865
2865
|
INVALID: y,
|
|
2866
|
-
DIRTY:
|
|
2867
|
-
OK:
|
|
2868
|
-
isAborted:
|
|
2869
|
-
isDirty:
|
|
2870
|
-
isValid:
|
|
2871
|
-
isAsync:
|
|
2866
|
+
DIRTY: le,
|
|
2867
|
+
OK: R,
|
|
2868
|
+
isAborted: at,
|
|
2869
|
+
isDirty: it,
|
|
2870
|
+
isValid: ne,
|
|
2871
|
+
isAsync: xe,
|
|
2872
2872
|
get util() {
|
|
2873
2873
|
return b;
|
|
2874
2874
|
},
|
|
2875
2875
|
get objectUtil() {
|
|
2876
|
-
return
|
|
2876
|
+
return st;
|
|
2877
2877
|
},
|
|
2878
2878
|
ZodParsedType: p,
|
|
2879
|
-
getParsedType:
|
|
2879
|
+
getParsedType: z,
|
|
2880
2880
|
ZodType: _,
|
|
2881
|
-
datetimeRegex:
|
|
2882
|
-
ZodString:
|
|
2881
|
+
datetimeRegex: It,
|
|
2882
|
+
ZodString: P,
|
|
2883
2883
|
ZodNumber: W,
|
|
2884
2884
|
ZodBigInt: J,
|
|
2885
|
-
ZodBoolean:
|
|
2886
|
-
ZodDate:
|
|
2887
|
-
ZodSymbol:
|
|
2888
|
-
ZodUndefined:
|
|
2889
|
-
ZodNull:
|
|
2890
|
-
ZodAny:
|
|
2891
|
-
ZodUnknown:
|
|
2892
|
-
ZodNever:
|
|
2893
|
-
ZodVoid:
|
|
2894
|
-
ZodArray:
|
|
2895
|
-
ZodObject:
|
|
2896
|
-
ZodUnion:
|
|
2897
|
-
ZodDiscriminatedUnion:
|
|
2898
|
-
ZodIntersection:
|
|
2899
|
-
ZodTuple:
|
|
2900
|
-
ZodRecord:
|
|
2901
|
-
ZodMap:
|
|
2902
|
-
ZodSet:
|
|
2903
|
-
ZodFunction:
|
|
2904
|
-
ZodLazy:
|
|
2905
|
-
ZodLiteral:
|
|
2885
|
+
ZodBoolean: Te,
|
|
2886
|
+
ZodDate: se,
|
|
2887
|
+
ZodSymbol: qe,
|
|
2888
|
+
ZodUndefined: Se,
|
|
2889
|
+
ZodNull: Ee,
|
|
2890
|
+
ZodAny: he,
|
|
2891
|
+
ZodUnknown: re,
|
|
2892
|
+
ZodNever: q,
|
|
2893
|
+
ZodVoid: He,
|
|
2894
|
+
ZodArray: Z,
|
|
2895
|
+
ZodObject: S,
|
|
2896
|
+
ZodUnion: Oe,
|
|
2897
|
+
ZodDiscriminatedUnion: Xe,
|
|
2898
|
+
ZodIntersection: Ne,
|
|
2899
|
+
ZodTuple: L,
|
|
2900
|
+
ZodRecord: Re,
|
|
2901
|
+
ZodMap: Be,
|
|
2902
|
+
ZodSet: ae,
|
|
2903
|
+
ZodFunction: fe,
|
|
2904
|
+
ZodLazy: Ae,
|
|
2905
|
+
ZodLiteral: Ce,
|
|
2906
2906
|
ZodEnum: Y,
|
|
2907
|
-
ZodNativeEnum:
|
|
2908
|
-
ZodPromise:
|
|
2909
|
-
ZodEffects:
|
|
2910
|
-
ZodTransformer:
|
|
2911
|
-
ZodOptional:
|
|
2907
|
+
ZodNativeEnum: Ie,
|
|
2908
|
+
ZodPromise: me,
|
|
2909
|
+
ZodEffects: j,
|
|
2910
|
+
ZodTransformer: j,
|
|
2911
|
+
ZodOptional: F,
|
|
2912
2912
|
ZodNullable: K,
|
|
2913
|
-
ZodDefault:
|
|
2914
|
-
ZodCatch:
|
|
2915
|
-
ZodNaN:
|
|
2916
|
-
BRAND:
|
|
2917
|
-
ZodBranded:
|
|
2918
|
-
ZodPipeline:
|
|
2919
|
-
ZodReadonly:
|
|
2920
|
-
custom:
|
|
2913
|
+
ZodDefault: Pe,
|
|
2914
|
+
ZodCatch: Ze,
|
|
2915
|
+
ZodNaN: We,
|
|
2916
|
+
BRAND: Mr,
|
|
2917
|
+
ZodBranded: yt,
|
|
2918
|
+
ZodPipeline: $e,
|
|
2919
|
+
ZodReadonly: je,
|
|
2920
|
+
custom: Zt,
|
|
2921
2921
|
Schema: _,
|
|
2922
2922
|
ZodSchema: _,
|
|
2923
|
-
late:
|
|
2923
|
+
late: Lr,
|
|
2924
2924
|
get ZodFirstPartyTypeKind() {
|
|
2925
2925
|
return m;
|
|
2926
2926
|
},
|
|
2927
|
-
coerce:
|
|
2928
|
-
any:
|
|
2929
|
-
array:
|
|
2930
|
-
bigint:
|
|
2931
|
-
boolean:
|
|
2932
|
-
date:
|
|
2933
|
-
discriminatedUnion:
|
|
2934
|
-
effect:
|
|
2935
|
-
enum:
|
|
2936
|
-
function:
|
|
2937
|
-
instanceof:
|
|
2938
|
-
intersection:
|
|
2939
|
-
lazy:
|
|
2940
|
-
literal:
|
|
2941
|
-
map:
|
|
2942
|
-
nan:
|
|
2943
|
-
nativeEnum:
|
|
2944
|
-
never:
|
|
2945
|
-
null:
|
|
2946
|
-
nullable:
|
|
2947
|
-
number:
|
|
2948
|
-
object:
|
|
2949
|
-
oboolean:
|
|
2950
|
-
onumber:
|
|
2951
|
-
optional:
|
|
2952
|
-
ostring:
|
|
2953
|
-
pipeline:
|
|
2954
|
-
preprocess:
|
|
2955
|
-
promise:
|
|
2956
|
-
record:
|
|
2957
|
-
set:
|
|
2958
|
-
strictObject:
|
|
2959
|
-
string:
|
|
2960
|
-
symbol:
|
|
2961
|
-
transformer:
|
|
2962
|
-
tuple:
|
|
2927
|
+
coerce: bn,
|
|
2928
|
+
any: Wr,
|
|
2929
|
+
array: Gr,
|
|
2930
|
+
bigint: Ur,
|
|
2931
|
+
boolean: Ft,
|
|
2932
|
+
date: zr,
|
|
2933
|
+
discriminatedUnion: tn,
|
|
2934
|
+
effect: St,
|
|
2935
|
+
enum: ln,
|
|
2936
|
+
function: dn,
|
|
2937
|
+
instanceof: Dr,
|
|
2938
|
+
intersection: rn,
|
|
2939
|
+
lazy: cn,
|
|
2940
|
+
literal: un,
|
|
2941
|
+
map: an,
|
|
2942
|
+
nan: Vr,
|
|
2943
|
+
nativeEnum: fn,
|
|
2944
|
+
never: Yr,
|
|
2945
|
+
null: Br,
|
|
2946
|
+
nullable: mn,
|
|
2947
|
+
number: $t,
|
|
2948
|
+
object: Xr,
|
|
2949
|
+
oboolean: wn,
|
|
2950
|
+
onumber: _n,
|
|
2951
|
+
optional: hn,
|
|
2952
|
+
ostring: vn,
|
|
2953
|
+
pipeline: gn,
|
|
2954
|
+
preprocess: yn,
|
|
2955
|
+
promise: pn,
|
|
2956
|
+
record: sn,
|
|
2957
|
+
set: on,
|
|
2958
|
+
strictObject: Qr,
|
|
2959
|
+
string: jt,
|
|
2960
|
+
symbol: qr,
|
|
2961
|
+
transformer: St,
|
|
2962
|
+
tuple: nn,
|
|
2963
2963
|
undefined: Hr,
|
|
2964
|
-
union:
|
|
2965
|
-
unknown:
|
|
2966
|
-
void:
|
|
2967
|
-
NEVER:
|
|
2964
|
+
union: en,
|
|
2965
|
+
unknown: Jr,
|
|
2966
|
+
void: Kr,
|
|
2967
|
+
NEVER: kn,
|
|
2968
2968
|
ZodIssueCode: u,
|
|
2969
|
-
quotelessJson:
|
|
2970
|
-
ZodError:
|
|
2969
|
+
quotelessJson: hr,
|
|
2970
|
+
ZodError: C
|
|
2971
2971
|
});
|
|
2972
|
-
const
|
|
2973
|
-
detail:
|
|
2974
|
-
}),
|
|
2975
|
-
error:
|
|
2972
|
+
const dt = Je.object({
|
|
2973
|
+
detail: Je.string()
|
|
2974
|
+
}), Mt = Je.object({
|
|
2975
|
+
error: Je.string()
|
|
2976
2976
|
});
|
|
2977
|
-
function
|
|
2977
|
+
function xn(t) {
|
|
2978
2978
|
if (!t)
|
|
2979
2979
|
return "Unknown error";
|
|
2980
2980
|
if (t instanceof Error) {
|
|
2981
|
-
const e =
|
|
2982
|
-
return e.success ? e.data.detail :
|
|
2981
|
+
const e = dt.safeParse(t.cause);
|
|
2982
|
+
return e.success ? e.data.detail : Tn(t.message);
|
|
2983
2983
|
}
|
|
2984
2984
|
if (typeof t == "object") {
|
|
2985
|
-
const e =
|
|
2985
|
+
const e = dt.safeParse(t);
|
|
2986
2986
|
if (e.success)
|
|
2987
2987
|
return e.data.detail;
|
|
2988
|
-
const r =
|
|
2988
|
+
const r = Mt.safeParse(t);
|
|
2989
2989
|
if (r.success)
|
|
2990
2990
|
return r.data.error;
|
|
2991
2991
|
}
|
|
@@ -2995,37 +2995,36 @@ var ns = hr((is, gt) => {
|
|
|
2995
2995
|
return String(t);
|
|
2996
2996
|
}
|
|
2997
2997
|
}
|
|
2998
|
-
function
|
|
2999
|
-
const e =
|
|
2998
|
+
function Tn(t) {
|
|
2999
|
+
const e = Sn(t);
|
|
3000
3000
|
if (!e)
|
|
3001
3001
|
return t;
|
|
3002
|
-
const r =
|
|
3002
|
+
const r = dt.safeParse(e);
|
|
3003
3003
|
if (r.success)
|
|
3004
3004
|
return r.data.detail;
|
|
3005
|
-
const n =
|
|
3005
|
+
const n = Mt.safeParse(e);
|
|
3006
3006
|
return n.success ? n.data.error : t;
|
|
3007
3007
|
}
|
|
3008
|
-
function
|
|
3008
|
+
function Sn(t) {
|
|
3009
3009
|
try {
|
|
3010
3010
|
return JSON.parse(t);
|
|
3011
3011
|
} catch {
|
|
3012
3012
|
return t;
|
|
3013
3013
|
}
|
|
3014
3014
|
}
|
|
3015
|
-
const
|
|
3016
|
-
function
|
|
3015
|
+
const En = 1e10, On = 1e3;
|
|
3016
|
+
function Me(t, e) {
|
|
3017
3017
|
const r = t.map((n) => `"${n}"`).join(", ");
|
|
3018
3018
|
return new Error(`This RPC instance cannot ${e} because the transport did not provide one or more of these methods: ${r}`);
|
|
3019
3019
|
}
|
|
3020
|
-
function
|
|
3020
|
+
function Nn(t = {}) {
|
|
3021
3021
|
let e = {};
|
|
3022
3022
|
function r(g) {
|
|
3023
3023
|
e = g;
|
|
3024
3024
|
}
|
|
3025
3025
|
let n = {};
|
|
3026
3026
|
function s(g) {
|
|
3027
|
-
|
|
3028
|
-
n.unregisterHandler && n.unregisterHandler(), n = g, (T = n.registerHandler) == null || T.call(n, pr);
|
|
3027
|
+
n.unregisterHandler && n.unregisterHandler(), n = g, n.registerHandler?.(fr);
|
|
3029
3028
|
}
|
|
3030
3029
|
let a;
|
|
3031
3030
|
function i(g) {
|
|
@@ -3033,120 +3032,115 @@ var ns = hr((is, gt) => {
|
|
|
3033
3032
|
a = g;
|
|
3034
3033
|
return;
|
|
3035
3034
|
}
|
|
3036
|
-
a = (T,
|
|
3037
|
-
const
|
|
3038
|
-
if (
|
|
3039
|
-
return
|
|
3040
|
-
const
|
|
3041
|
-
if (
|
|
3035
|
+
a = (T, E) => {
|
|
3036
|
+
const N = g[T];
|
|
3037
|
+
if (N)
|
|
3038
|
+
return N(E);
|
|
3039
|
+
const $ = g._;
|
|
3040
|
+
if (!$)
|
|
3042
3041
|
throw new Error(`The requested method has no handler: ${T}`);
|
|
3043
|
-
return
|
|
3042
|
+
return $(T, E);
|
|
3044
3043
|
};
|
|
3045
3044
|
}
|
|
3046
|
-
const { maxRequestTime: o =
|
|
3045
|
+
const { maxRequestTime: o = On } = t;
|
|
3047
3046
|
t.transport && s(t.transport), t.requestHandler && i(t.requestHandler), t._debugHooks && r(t._debugHooks);
|
|
3048
3047
|
let d = 0;
|
|
3049
3048
|
function c() {
|
|
3050
|
-
return d <=
|
|
3049
|
+
return d <= En ? ++d : d = 0;
|
|
3051
3050
|
}
|
|
3052
3051
|
const l = /* @__PURE__ */ new Map(), w = /* @__PURE__ */ new Map();
|
|
3053
3052
|
function x(g, ...T) {
|
|
3054
|
-
const
|
|
3055
|
-
return new Promise((
|
|
3056
|
-
var oe;
|
|
3053
|
+
const E = T[0];
|
|
3054
|
+
return new Promise((N, $) => {
|
|
3057
3055
|
if (!n.send)
|
|
3058
|
-
throw
|
|
3059
|
-
const
|
|
3056
|
+
throw Me(["send"], "make requests");
|
|
3057
|
+
const H = c(), kt = {
|
|
3060
3058
|
type: "request",
|
|
3061
|
-
id:
|
|
3059
|
+
id: H,
|
|
3062
3060
|
method: g,
|
|
3063
|
-
params:
|
|
3061
|
+
params: E
|
|
3064
3062
|
};
|
|
3065
|
-
l.set(
|
|
3066
|
-
w.delete(
|
|
3067
|
-
}, o)),
|
|
3063
|
+
l.set(H, { resolve: N, reject: $ }), o !== 1 / 0 && w.set(H, setTimeout(() => {
|
|
3064
|
+
w.delete(H), $(new Error("RPC request timed out."));
|
|
3065
|
+
}, o)), e.onSend?.(kt), n.send(kt);
|
|
3068
3066
|
});
|
|
3069
3067
|
}
|
|
3070
|
-
const
|
|
3071
|
-
get: (g, T,
|
|
3072
|
-
}),
|
|
3073
|
-
function
|
|
3074
|
-
|
|
3075
|
-
const O = T[0];
|
|
3068
|
+
const A = new Proxy(x, {
|
|
3069
|
+
get: (g, T, E) => T in g ? Reflect.get(g, T, E) : (N) => x(T, N)
|
|
3070
|
+
}), V = A;
|
|
3071
|
+
function Fe(g, ...T) {
|
|
3072
|
+
const E = T[0];
|
|
3076
3073
|
if (!n.send)
|
|
3077
|
-
throw
|
|
3078
|
-
const
|
|
3074
|
+
throw Me(["send"], "send messages");
|
|
3075
|
+
const N = {
|
|
3079
3076
|
type: "message",
|
|
3080
3077
|
id: g,
|
|
3081
|
-
payload:
|
|
3078
|
+
payload: E
|
|
3082
3079
|
};
|
|
3083
|
-
|
|
3080
|
+
e.onSend?.(N), n.send(N);
|
|
3084
3081
|
}
|
|
3085
|
-
const
|
|
3086
|
-
get: (g, T,
|
|
3087
|
-
}),
|
|
3088
|
-
function
|
|
3089
|
-
var O;
|
|
3082
|
+
const wt = new Proxy(Fe, {
|
|
3083
|
+
get: (g, T, E) => T in g ? Reflect.get(g, T, E) : (N) => Fe(T, N)
|
|
3084
|
+
}), bt = wt, X = /* @__PURE__ */ new Map(), et = /* @__PURE__ */ new Set();
|
|
3085
|
+
function ur(g, T) {
|
|
3090
3086
|
if (!n.registerHandler)
|
|
3091
|
-
throw
|
|
3087
|
+
throw Me(["registerHandler"], "register message listeners");
|
|
3092
3088
|
if (g === "*") {
|
|
3093
|
-
|
|
3089
|
+
et.add(T);
|
|
3094
3090
|
return;
|
|
3095
3091
|
}
|
|
3096
|
-
X.has(g) || X.set(g, /* @__PURE__ */ new Set()),
|
|
3092
|
+
X.has(g) || X.set(g, /* @__PURE__ */ new Set()), X.get(g)?.add(T);
|
|
3097
3093
|
}
|
|
3098
|
-
function
|
|
3099
|
-
var O, S;
|
|
3094
|
+
function lr(g, T) {
|
|
3100
3095
|
if (g === "*") {
|
|
3101
|
-
|
|
3096
|
+
et.delete(T);
|
|
3102
3097
|
return;
|
|
3103
3098
|
}
|
|
3104
|
-
|
|
3099
|
+
X.get(g)?.delete(T), X.get(g)?.size === 0 && X.delete(g);
|
|
3105
3100
|
}
|
|
3106
|
-
async function
|
|
3107
|
-
|
|
3108
|
-
if ((T = e.onReceive) == null || T.call(e, g), !("type" in g))
|
|
3101
|
+
async function fr(g) {
|
|
3102
|
+
if (e.onReceive?.(g), !("type" in g))
|
|
3109
3103
|
throw new Error("Message does not contain a type.");
|
|
3110
3104
|
if (g.type === "request") {
|
|
3111
3105
|
if (!n.send || !a)
|
|
3112
|
-
throw
|
|
3113
|
-
const { id:
|
|
3114
|
-
let
|
|
3106
|
+
throw Me(["send", "requestHandler"], "handle requests");
|
|
3107
|
+
const { id: T, method: E, params: N } = g;
|
|
3108
|
+
let $;
|
|
3115
3109
|
try {
|
|
3116
|
-
|
|
3110
|
+
$ = {
|
|
3117
3111
|
type: "response",
|
|
3118
|
-
id:
|
|
3112
|
+
id: T,
|
|
3119
3113
|
success: !0,
|
|
3120
|
-
payload: await a(
|
|
3114
|
+
payload: await a(E, N)
|
|
3121
3115
|
};
|
|
3122
|
-
} catch (
|
|
3123
|
-
if (!(
|
|
3124
|
-
throw
|
|
3125
|
-
|
|
3116
|
+
} catch (H) {
|
|
3117
|
+
if (!(H instanceof Error))
|
|
3118
|
+
throw H;
|
|
3119
|
+
$ = {
|
|
3126
3120
|
type: "response",
|
|
3127
|
-
id:
|
|
3121
|
+
id: T,
|
|
3128
3122
|
success: !1,
|
|
3129
|
-
error:
|
|
3123
|
+
error: H.message
|
|
3130
3124
|
};
|
|
3131
3125
|
}
|
|
3132
|
-
|
|
3126
|
+
e.onSend?.($), n.send($);
|
|
3133
3127
|
return;
|
|
3134
3128
|
}
|
|
3135
3129
|
if (g.type === "response") {
|
|
3136
|
-
const
|
|
3137
|
-
|
|
3138
|
-
const { resolve:
|
|
3139
|
-
g.success ?
|
|
3130
|
+
const T = w.get(g.id);
|
|
3131
|
+
T != null && clearTimeout(T);
|
|
3132
|
+
const { resolve: E, reject: N } = l.get(g.id) ?? {};
|
|
3133
|
+
g.success ? E?.(g.payload) : N?.(new Error(g.error));
|
|
3140
3134
|
return;
|
|
3141
3135
|
}
|
|
3142
3136
|
if (g.type === "message") {
|
|
3143
|
-
for (const
|
|
3144
|
-
|
|
3145
|
-
const
|
|
3146
|
-
if (!
|
|
3137
|
+
for (const E of et)
|
|
3138
|
+
E(g.id, g.payload);
|
|
3139
|
+
const T = X.get(g.id);
|
|
3140
|
+
if (!T)
|
|
3147
3141
|
return;
|
|
3148
|
-
for (const
|
|
3149
|
-
|
|
3142
|
+
for (const E of T)
|
|
3143
|
+
E(g.payload);
|
|
3150
3144
|
return;
|
|
3151
3145
|
}
|
|
3152
3146
|
throw new Error(`Unexpected RPC message type: ${g.type}`);
|
|
@@ -3154,48 +3148,48 @@ var ns = hr((is, gt) => {
|
|
|
3154
3148
|
return {
|
|
3155
3149
|
setTransport: s,
|
|
3156
3150
|
setRequestHandler: i,
|
|
3157
|
-
request:
|
|
3158
|
-
requestProxy:
|
|
3159
|
-
send:
|
|
3160
|
-
sendProxy:
|
|
3161
|
-
addMessageListener:
|
|
3162
|
-
removeMessageListener:
|
|
3163
|
-
proxy: { send:
|
|
3151
|
+
request: A,
|
|
3152
|
+
requestProxy: V,
|
|
3153
|
+
send: wt,
|
|
3154
|
+
sendProxy: bt,
|
|
3155
|
+
addMessageListener: ur,
|
|
3156
|
+
removeMessageListener: lr,
|
|
3157
|
+
proxy: { send: bt, request: V },
|
|
3164
3158
|
_setDebugHooks: r
|
|
3165
3159
|
};
|
|
3166
3160
|
}
|
|
3167
|
-
function
|
|
3168
|
-
return
|
|
3161
|
+
function Rn(t) {
|
|
3162
|
+
return Nn(t);
|
|
3169
3163
|
}
|
|
3170
|
-
const
|
|
3171
|
-
function
|
|
3164
|
+
const Lt = "[transport-id]";
|
|
3165
|
+
function An(t, e) {
|
|
3172
3166
|
const { transportId: r } = e;
|
|
3173
|
-
return r != null ? { [
|
|
3167
|
+
return r != null ? { [Lt]: r, data: t } : t;
|
|
3174
3168
|
}
|
|
3175
|
-
function
|
|
3176
|
-
const { transportId: r, filter: n } = e, s = n
|
|
3169
|
+
function Cn(t, e) {
|
|
3170
|
+
const { transportId: r, filter: n } = e, s = n?.();
|
|
3177
3171
|
if (r != null && s != null)
|
|
3178
3172
|
throw new Error("Cannot use both `transportId` and `filter` at the same time");
|
|
3179
3173
|
let a = t;
|
|
3180
3174
|
if (r) {
|
|
3181
|
-
if (t[
|
|
3175
|
+
if (t[Lt] !== r)
|
|
3182
3176
|
return [!0];
|
|
3183
3177
|
a = t.data;
|
|
3184
3178
|
}
|
|
3185
3179
|
return s === !1 ? [!0] : [!1, a];
|
|
3186
3180
|
}
|
|
3187
|
-
function
|
|
3181
|
+
function In(t, e = {}) {
|
|
3188
3182
|
const { transportId: r, filter: n, remotePort: s } = e, a = t, i = s ?? t;
|
|
3189
3183
|
let o;
|
|
3190
3184
|
return {
|
|
3191
3185
|
send(d) {
|
|
3192
|
-
i.postMessage(
|
|
3186
|
+
i.postMessage(An(d, { transportId: r }));
|
|
3193
3187
|
},
|
|
3194
3188
|
registerHandler(d) {
|
|
3195
3189
|
o = (c) => {
|
|
3196
|
-
const l = c.data, [w, x] =
|
|
3190
|
+
const l = c.data, [w, x] = Cn(l, {
|
|
3197
3191
|
transportId: r,
|
|
3198
|
-
filter: () => n
|
|
3192
|
+
filter: () => n?.(c)
|
|
3199
3193
|
});
|
|
3200
3194
|
w || d(x);
|
|
3201
3195
|
}, a.addEventListener("message", o);
|
|
@@ -3205,13 +3199,13 @@ var ns = hr((is, gt) => {
|
|
|
3205
3199
|
}
|
|
3206
3200
|
};
|
|
3207
3201
|
}
|
|
3208
|
-
function
|
|
3209
|
-
return
|
|
3202
|
+
function Pn(t) {
|
|
3203
|
+
return In(self, t);
|
|
3210
3204
|
}
|
|
3211
|
-
const
|
|
3205
|
+
const ye = {
|
|
3212
3206
|
NOOP: () => {
|
|
3213
3207
|
}
|
|
3214
|
-
},
|
|
3208
|
+
}, Dt = (t, e) => {
|
|
3215
3209
|
const r = `[${t}]`;
|
|
3216
3210
|
return {
|
|
3217
3211
|
debug: (...n) => e.debug(r, ...n),
|
|
@@ -3219,10 +3213,10 @@ var ns = hr((is, gt) => {
|
|
|
3219
3213
|
warn: (...n) => e.warn(r, ...n),
|
|
3220
3214
|
error: (...n) => e.error(r, ...n),
|
|
3221
3215
|
trace: (...n) => e.trace(r, ...n),
|
|
3222
|
-
get: (n) =>
|
|
3223
|
-
disabled: (n = !0) => n ?
|
|
3216
|
+
get: (n) => Dt(`${t}.${n}`, e),
|
|
3217
|
+
disabled: (n = !0) => n ? Ke : e
|
|
3224
3218
|
};
|
|
3225
|
-
},
|
|
3219
|
+
}, Ye = {
|
|
3226
3220
|
debug: (...t) => {
|
|
3227
3221
|
console.debug(...t);
|
|
3228
3222
|
},
|
|
@@ -3238,45 +3232,45 @@ var ns = hr((is, gt) => {
|
|
|
3238
3232
|
trace: (...t) => {
|
|
3239
3233
|
console.trace(...t);
|
|
3240
3234
|
},
|
|
3241
|
-
get: (t) =>
|
|
3242
|
-
disabled: (t = !0) => t ?
|
|
3243
|
-
},
|
|
3244
|
-
debug: () =>
|
|
3245
|
-
log: () =>
|
|
3246
|
-
warn: () =>
|
|
3247
|
-
error: () =>
|
|
3248
|
-
trace: () =>
|
|
3249
|
-
get: () =>
|
|
3250
|
-
disabled: () =>
|
|
3235
|
+
get: (t) => Dt(t, Ye),
|
|
3236
|
+
disabled: (t = !0) => t ? Ke : Ye
|
|
3237
|
+
}, Ke = {
|
|
3238
|
+
debug: () => ye.NOOP,
|
|
3239
|
+
log: () => ye.NOOP,
|
|
3240
|
+
warn: () => ye.NOOP,
|
|
3241
|
+
error: () => ye.NOOP,
|
|
3242
|
+
trace: () => ye.NOOP,
|
|
3243
|
+
get: () => Ke,
|
|
3244
|
+
disabled: () => Ke
|
|
3251
3245
|
};
|
|
3252
|
-
function
|
|
3253
|
-
return typeof window < "u" && window.Logger ||
|
|
3246
|
+
function Zn() {
|
|
3247
|
+
return typeof window < "u" && window.Logger || Ye;
|
|
3254
3248
|
}
|
|
3255
|
-
const
|
|
3256
|
-
var
|
|
3249
|
+
const be = Zn(), jn = "marimo-transport";
|
|
3250
|
+
var $n = Object.defineProperty, k = (t, e) => $n(t, "name", { value: e, configurable: !0 }), Vt = ((t) => typeof require < "u" ? require : typeof Proxy < "u" ? new Proxy(t, { get: (e, r) => (typeof require < "u" ? require : e)[r] }) : t)(function(t) {
|
|
3257
3251
|
if (typeof require < "u") return require.apply(this, arguments);
|
|
3258
3252
|
throw new Error('Dynamic require of "' + t + '" is not supported');
|
|
3259
3253
|
});
|
|
3260
|
-
function
|
|
3254
|
+
function Ut(t) {
|
|
3261
3255
|
return !isNaN(parseFloat(t)) && isFinite(t);
|
|
3262
3256
|
}
|
|
3263
|
-
k(
|
|
3257
|
+
k(Ut, "_isNumber");
|
|
3264
3258
|
function G(t) {
|
|
3265
3259
|
return t.charAt(0).toUpperCase() + t.substring(1);
|
|
3266
3260
|
}
|
|
3267
3261
|
k(G, "_capitalize");
|
|
3268
|
-
function
|
|
3262
|
+
function Qe(t) {
|
|
3269
3263
|
return function() {
|
|
3270
3264
|
return this[t];
|
|
3271
3265
|
};
|
|
3272
3266
|
}
|
|
3273
|
-
k(
|
|
3274
|
-
var
|
|
3275
|
-
function
|
|
3276
|
-
if (t) for (var e = 0; e <
|
|
3267
|
+
k(Qe, "_getter");
|
|
3268
|
+
var oe = ["isConstructor", "isEval", "isNative", "isToplevel"], de = ["columnNumber", "lineNumber"], ce = ["fileName", "functionName", "source"], Fn = ["args"], Mn = ["evalOrigin"], Le = oe.concat(de, ce, Fn, Mn);
|
|
3269
|
+
function I(t) {
|
|
3270
|
+
if (t) for (var e = 0; e < Le.length; e++) t[Le[e]] !== void 0 && this["set" + G(Le[e])](t[Le[e]]);
|
|
3277
3271
|
}
|
|
3278
|
-
k(
|
|
3279
|
-
|
|
3272
|
+
k(I, "StackFrame");
|
|
3273
|
+
I.prototype = { getArgs: function() {
|
|
3280
3274
|
return this.args;
|
|
3281
3275
|
}, setArgs: function(t) {
|
|
3282
3276
|
if (Object.prototype.toString.call(t) !== "[object Array]") throw new TypeError("Args must be an Array");
|
|
@@ -3284,38 +3278,38 @@ var ns = hr((is, gt) => {
|
|
|
3284
3278
|
}, getEvalOrigin: function() {
|
|
3285
3279
|
return this.evalOrigin;
|
|
3286
3280
|
}, setEvalOrigin: function(t) {
|
|
3287
|
-
if (t instanceof
|
|
3288
|
-
else if (t instanceof Object) this.evalOrigin = new
|
|
3281
|
+
if (t instanceof I) this.evalOrigin = t;
|
|
3282
|
+
else if (t instanceof Object) this.evalOrigin = new I(t);
|
|
3289
3283
|
else throw new TypeError("Eval Origin must be an Object or StackFrame");
|
|
3290
3284
|
}, toString: function() {
|
|
3291
3285
|
var t = this.getFileName() || "", e = this.getLineNumber() || "", r = this.getColumnNumber() || "", n = this.getFunctionName() || "";
|
|
3292
3286
|
return this.getIsEval() ? t ? "[eval] (" + t + ":" + e + ":" + r + ")" : "[eval]:" + e + ":" + r : n ? n + " (" + t + ":" + e + ":" + r + ")" : t + ":" + e + ":" + r;
|
|
3293
3287
|
} };
|
|
3294
|
-
|
|
3288
|
+
I.fromString = k(function(t) {
|
|
3295
3289
|
var e = t.indexOf("("), r = t.lastIndexOf(")"), n = t.substring(0, e), s = t.substring(e + 1, r).split(","), a = t.substring(r + 1);
|
|
3296
3290
|
if (a.indexOf("@") === 0) var i = /@(.+?)(?::(\d+))?(?::(\d+))?$/.exec(a, ""), o = i[1], d = i[2], c = i[3];
|
|
3297
|
-
return new
|
|
3291
|
+
return new I({ functionName: n, args: s || void 0, fileName: o, lineNumber: d || void 0, columnNumber: c || void 0 });
|
|
3298
3292
|
}, "StackFrame$$fromString");
|
|
3299
|
-
for (
|
|
3293
|
+
for (Q = 0; Q < oe.length; Q++) I.prototype["get" + G(oe[Q])] = Qe(oe[Q]), I.prototype["set" + G(oe[Q])] = /* @__PURE__ */ function(t) {
|
|
3300
3294
|
return function(e) {
|
|
3301
3295
|
this[t] = !!e;
|
|
3302
3296
|
};
|
|
3303
|
-
}(
|
|
3304
|
-
var
|
|
3305
|
-
for (
|
|
3297
|
+
}(oe[Q]);
|
|
3298
|
+
var Q;
|
|
3299
|
+
for (ee = 0; ee < de.length; ee++) I.prototype["get" + G(de[ee])] = Qe(de[ee]), I.prototype["set" + G(de[ee])] = /* @__PURE__ */ function(t) {
|
|
3306
3300
|
return function(e) {
|
|
3307
|
-
if (!
|
|
3301
|
+
if (!Ut(e)) throw new TypeError(t + " must be a Number");
|
|
3308
3302
|
this[t] = Number(e);
|
|
3309
3303
|
};
|
|
3310
|
-
}(
|
|
3311
|
-
var
|
|
3312
|
-
for (
|
|
3304
|
+
}(de[ee]);
|
|
3305
|
+
var ee;
|
|
3306
|
+
for (te = 0; te < ce.length; te++) I.prototype["get" + G(ce[te])] = Qe(ce[te]), I.prototype["set" + G(ce[te])] = /* @__PURE__ */ function(t) {
|
|
3313
3307
|
return function(e) {
|
|
3314
3308
|
this[t] = String(e);
|
|
3315
3309
|
};
|
|
3316
|
-
}(
|
|
3317
|
-
var
|
|
3318
|
-
function
|
|
3310
|
+
}(ce[te]);
|
|
3311
|
+
var te, rt = I;
|
|
3312
|
+
function zt() {
|
|
3319
3313
|
var t = /^\s*at .*(\S+:\d+|\(native\))/m, e = /^(eval@)?(\[native code])?$/;
|
|
3320
3314
|
return { parse: k(function(r) {
|
|
3321
3315
|
if (r.stack && r.stack.match(t)) return this.parseV8OrIE(r);
|
|
@@ -3335,7 +3329,7 @@ var ns = hr((is, gt) => {
|
|
|
3335
3329
|
var a = s.replace(/^\s+/, "").replace(/\(eval code/g, "(").replace(/^.*?\s+/, ""), i = a.match(/ (\(.+\)$)/);
|
|
3336
3330
|
a = i ? a.replace(i[0], "") : a;
|
|
3337
3331
|
var o = this.extractLocation(i ? i[1] : a), d = i && a || void 0, c = ["eval", "<anonymous>"].indexOf(o[0]) > -1 ? void 0 : o[0];
|
|
3338
|
-
return new
|
|
3332
|
+
return new rt({ functionName: d, fileName: c, lineNumber: o[1], columnNumber: o[2], source: s });
|
|
3339
3333
|
}, this);
|
|
3340
3334
|
}, "ErrorStackParser$$parseV8OrIE"), parseFFOrSafari: k(function(r) {
|
|
3341
3335
|
var n = r.stack.split(`
|
|
@@ -3343,58 +3337,58 @@ var ns = hr((is, gt) => {
|
|
|
3343
3337
|
return !s.match(e);
|
|
3344
3338
|
}, this);
|
|
3345
3339
|
return n.map(function(s) {
|
|
3346
|
-
if (s.indexOf(" > eval") > -1 && (s = s.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g, ":$1")), s.indexOf("@") === -1 && s.indexOf(":") === -1) return new
|
|
3340
|
+
if (s.indexOf(" > eval") > -1 && (s = s.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g, ":$1")), s.indexOf("@") === -1 && s.indexOf(":") === -1) return new rt({ functionName: s });
|
|
3347
3341
|
var a = /((.*".+"[^@]*)?[^@]*)(?:@)/, i = s.match(a), o = i && i[1] ? i[1] : void 0, d = this.extractLocation(s.replace(a, ""));
|
|
3348
|
-
return new
|
|
3342
|
+
return new rt({ functionName: o, fileName: d[0], lineNumber: d[1], columnNumber: d[2], source: s });
|
|
3349
3343
|
}, this);
|
|
3350
3344
|
}, "ErrorStackParser$$parseFFOrSafari") };
|
|
3351
3345
|
}
|
|
3352
|
-
k(
|
|
3353
|
-
var
|
|
3346
|
+
k(zt, "ErrorStackParser");
|
|
3347
|
+
var Ln = new zt(), Dn = Ln, D = typeof process == "object" && typeof process.versions == "object" && typeof process.versions.node == "string" && !process.browser, qt = D && typeof mt < "u" && typeof mt.exports < "u" && typeof Vt < "u" && typeof __dirname < "u", Vn = D && !qt, Un = typeof Deno < "u", Ht = !D && !Un, zn = Ht && typeof window == "object" && typeof document == "object" && typeof document.createElement == "function" && "sessionStorage" in window && typeof importScripts != "function", qn = Ht && typeof importScripts == "function" && typeof self == "object";
|
|
3354
3348
|
typeof navigator == "object" && typeof navigator.userAgent == "string" && navigator.userAgent.indexOf("Chrome") == -1 && navigator.userAgent.indexOf("Safari") > -1;
|
|
3355
|
-
var
|
|
3356
|
-
async function
|
|
3357
|
-
if (!
|
|
3358
|
-
let t =
|
|
3349
|
+
var Bt, ct, Wt, Et, gt;
|
|
3350
|
+
async function vt() {
|
|
3351
|
+
if (!D || (Bt = (await import("./__vite-browser-external-CPvbk0mb.js")).default, Et = await import("./__vite-browser-external-CPvbk0mb.js"), gt = await import("./__vite-browser-external-CPvbk0mb.js"), Wt = (await import("./__vite-browser-external-CPvbk0mb.js")).default, ct = await import("./__vite-browser-external-CPvbk0mb.js"), _t = ct.sep, typeof Vt < "u")) return;
|
|
3352
|
+
let t = Et, e = await import("./__vite-browser-external-CPvbk0mb.js"), r = await import("./__vite-browser-external-CPvbk0mb.js"), n = await import("./__vite-browser-external-CPvbk0mb.js"), s = { fs: t, crypto: e, ws: r, child_process: n };
|
|
3359
3353
|
globalThis.require = function(a) {
|
|
3360
3354
|
return s[a];
|
|
3361
3355
|
};
|
|
3362
3356
|
}
|
|
3363
|
-
k(
|
|
3357
|
+
k(vt, "initNodeModules");
|
|
3358
|
+
function Jt(t, e) {
|
|
3359
|
+
return ct.resolve(e || ".", t);
|
|
3360
|
+
}
|
|
3361
|
+
k(Jt, "node_resolvePath");
|
|
3364
3362
|
function Yt(t, e) {
|
|
3365
|
-
return
|
|
3363
|
+
return e === void 0 && (e = location), new URL(t, e).toString();
|
|
3366
3364
|
}
|
|
3367
|
-
k(Yt, "
|
|
3365
|
+
k(Yt, "browser_resolvePath");
|
|
3366
|
+
var ut;
|
|
3367
|
+
D ? ut = Jt : ut = Yt;
|
|
3368
|
+
var _t;
|
|
3369
|
+
D || (_t = "/");
|
|
3368
3370
|
function Kt(t, e) {
|
|
3369
|
-
return
|
|
3371
|
+
return t.startsWith("file://") && (t = t.slice(7)), t.includes("://") ? { response: fetch(t) } : { binary: gt.readFile(t).then((r) => new Uint8Array(r.buffer, r.byteOffset, r.byteLength)) };
|
|
3370
3372
|
}
|
|
3371
|
-
k(Kt, "
|
|
3372
|
-
var ft;
|
|
3373
|
-
V ? ft = Yt : ft = Kt;
|
|
3374
|
-
var bt;
|
|
3375
|
-
V || (bt = "/");
|
|
3373
|
+
k(Kt, "node_getBinaryResponse");
|
|
3376
3374
|
function Gt(t, e) {
|
|
3377
|
-
return t.startsWith("file://") && (t = t.slice(7)), t.includes("://") ? { response: fetch(t) } : { binary: _t.readFile(t).then((r) => new Uint8Array(r.buffer, r.byteOffset, r.byteLength)) };
|
|
3378
|
-
}
|
|
3379
|
-
k(Gt, "node_getBinaryResponse");
|
|
3380
|
-
function Xt(t, e) {
|
|
3381
3375
|
let r = new URL(t, location);
|
|
3382
3376
|
return { response: fetch(r, e ? { integrity: e } : {}) };
|
|
3383
3377
|
}
|
|
3384
|
-
k(
|
|
3385
|
-
var
|
|
3386
|
-
|
|
3387
|
-
async function
|
|
3388
|
-
let { response: r, binary: n } =
|
|
3378
|
+
k(Gt, "browser_getBinaryResponse");
|
|
3379
|
+
var Ge;
|
|
3380
|
+
D ? Ge = Kt : Ge = Gt;
|
|
3381
|
+
async function Xt(t, e) {
|
|
3382
|
+
let { response: r, binary: n } = Ge(t, e);
|
|
3389
3383
|
if (n) return n;
|
|
3390
3384
|
let s = await r;
|
|
3391
3385
|
if (!s.ok) throw new Error(`Failed to load '${t}': request failed.`);
|
|
3392
3386
|
return new Uint8Array(await s.arrayBuffer());
|
|
3393
3387
|
}
|
|
3394
|
-
k(
|
|
3395
|
-
var
|
|
3396
|
-
if (
|
|
3397
|
-
else if (
|
|
3388
|
+
k(Xt, "loadBinaryFile");
|
|
3389
|
+
var De;
|
|
3390
|
+
if (zn) De = k(async (t) => await import(t), "loadScript");
|
|
3391
|
+
else if (qn) De = k(async (t) => {
|
|
3398
3392
|
try {
|
|
3399
3393
|
globalThis.importScripts(t);
|
|
3400
3394
|
} catch (e) {
|
|
@@ -3402,39 +3396,39 @@ var ns = hr((is, gt) => {
|
|
|
3402
3396
|
else throw e;
|
|
3403
3397
|
}
|
|
3404
3398
|
}, "loadScript");
|
|
3405
|
-
else if (
|
|
3399
|
+
else if (D) De = Qt;
|
|
3406
3400
|
else throw new Error("Cannot determine runtime environment");
|
|
3407
|
-
async function
|
|
3408
|
-
t.startsWith("file://") && (t = t.slice(7)), t.includes("://") ?
|
|
3401
|
+
async function Qt(t) {
|
|
3402
|
+
t.startsWith("file://") && (t = t.slice(7)), t.includes("://") ? Wt.runInThisContext(await (await fetch(t)).text()) : await import(Bt.pathToFileURL(t).href);
|
|
3409
3403
|
}
|
|
3410
|
-
k(
|
|
3411
|
-
async function
|
|
3412
|
-
if (
|
|
3413
|
-
await
|
|
3414
|
-
let e = await
|
|
3404
|
+
k(Qt, "nodeLoadScript");
|
|
3405
|
+
async function er(t) {
|
|
3406
|
+
if (D) {
|
|
3407
|
+
await vt();
|
|
3408
|
+
let e = await gt.readFile(t, { encoding: "utf8" });
|
|
3415
3409
|
return JSON.parse(e);
|
|
3416
3410
|
} else return await (await fetch(t)).json();
|
|
3417
3411
|
}
|
|
3418
|
-
k(
|
|
3419
|
-
async function
|
|
3420
|
-
if (
|
|
3412
|
+
k(er, "loadLockFile");
|
|
3413
|
+
async function tr() {
|
|
3414
|
+
if (qt) return __dirname;
|
|
3421
3415
|
let t;
|
|
3422
3416
|
try {
|
|
3423
3417
|
throw new Error();
|
|
3424
3418
|
} catch (n) {
|
|
3425
3419
|
t = n;
|
|
3426
3420
|
}
|
|
3427
|
-
let e =
|
|
3428
|
-
if (
|
|
3421
|
+
let e = Dn.parse(t)[0].fileName;
|
|
3422
|
+
if (D && !e.startsWith("file://") && (e = `file://${e}`), Vn) {
|
|
3429
3423
|
let n = await import("./__vite-browser-external-CPvbk0mb.js");
|
|
3430
3424
|
return (await import("./__vite-browser-external-CPvbk0mb.js")).fileURLToPath(n.dirname(e));
|
|
3431
3425
|
}
|
|
3432
|
-
let r = e.lastIndexOf(
|
|
3426
|
+
let r = e.lastIndexOf(_t);
|
|
3433
3427
|
if (r === -1) throw new Error("Could not extract indexURL path from pyodide module location");
|
|
3434
3428
|
return e.slice(0, r);
|
|
3435
3429
|
}
|
|
3436
|
-
k(
|
|
3437
|
-
function
|
|
3430
|
+
k(tr, "calculateDirname");
|
|
3431
|
+
function rr(t) {
|
|
3438
3432
|
let e = t.FS, r = t.FS.filesystems.MEMFS, n = t.PATH, s = { DIR_MODE: 16895, FILE_MODE: 33279, mount: function(a) {
|
|
3439
3433
|
if (!a.opts.fileSystemHandle) throw new Error("opts.fileSystemHandle is required");
|
|
3440
3434
|
return r.mount.apply(null, arguments);
|
|
@@ -3498,8 +3492,8 @@ var ns = hr((is, gt) => {
|
|
|
3498
3492
|
}, reconcile: async (a, i, o) => {
|
|
3499
3493
|
let d = 0, c = [];
|
|
3500
3494
|
Object.keys(i.entries).forEach(function(x) {
|
|
3501
|
-
let
|
|
3502
|
-
(!
|
|
3495
|
+
let A = i.entries[x], V = o.entries[x];
|
|
3496
|
+
(!V || e.isFile(A.mode) && A.timestamp.getTime() > V.timestamp.getTime()) && (c.push(x), d++);
|
|
3503
3497
|
}), c.sort();
|
|
3504
3498
|
let l = [];
|
|
3505
3499
|
if (Object.keys(o.entries).forEach(function(x) {
|
|
@@ -3507,24 +3501,24 @@ var ns = hr((is, gt) => {
|
|
|
3507
3501
|
}), l.sort().reverse(), !d) return;
|
|
3508
3502
|
let w = i.type === "remote" ? i.handles : o.handles;
|
|
3509
3503
|
for (let x of c) {
|
|
3510
|
-
let
|
|
3504
|
+
let A = n.normalize(x.replace(a.mountpoint, "/")).substring(1);
|
|
3511
3505
|
if (o.type === "local") {
|
|
3512
|
-
let
|
|
3513
|
-
s.storeLocalEntry(x,
|
|
3506
|
+
let V = w.get(A), Fe = await s.loadRemoteEntry(V);
|
|
3507
|
+
s.storeLocalEntry(x, Fe);
|
|
3514
3508
|
} else {
|
|
3515
|
-
let
|
|
3516
|
-
await s.storeRemoteEntry(w,
|
|
3509
|
+
let V = s.loadLocalEntry(x);
|
|
3510
|
+
await s.storeRemoteEntry(w, A, V);
|
|
3517
3511
|
}
|
|
3518
3512
|
}
|
|
3519
3513
|
for (let x of l) if (o.type === "local") s.removeLocalEntry(x);
|
|
3520
3514
|
else {
|
|
3521
|
-
let
|
|
3522
|
-
await s.removeRemoteEntry(w,
|
|
3515
|
+
let A = n.normalize(x.replace(a.mountpoint, "/")).substring(1);
|
|
3516
|
+
await s.removeRemoteEntry(w, A);
|
|
3523
3517
|
}
|
|
3524
3518
|
} };
|
|
3525
3519
|
t.FS.filesystems.NATIVEFS_ASYNC = s;
|
|
3526
3520
|
}
|
|
3527
|
-
k(
|
|
3521
|
+
k(rr, "initializeNativeFS");
|
|
3528
3522
|
var Hn = k(async (t) => {
|
|
3529
3523
|
let e = [];
|
|
3530
3524
|
async function r(s) {
|
|
@@ -3539,14 +3533,14 @@ var ns = hr((is, gt) => {
|
|
|
3539
3533
|
}
|
|
3540
3534
|
return n;
|
|
3541
3535
|
}, "getFsHandles");
|
|
3542
|
-
function
|
|
3543
|
-
let e = { noImageDecoding: !0, noAudioDecoding: !0, noWasmDecoding: !1, preRun:
|
|
3536
|
+
function nr(t) {
|
|
3537
|
+
let e = { noImageDecoding: !0, noAudioDecoding: !0, noWasmDecoding: !1, preRun: dr(t), quit(r, n) {
|
|
3544
3538
|
throw e.exited = { status: r, toThrow: n }, n;
|
|
3545
|
-
}, print: t.stdout, printErr: t.stderr, thisProgram: t._sysExecutable, arguments: t.args, API: { config: t }, locateFile: (r) => t.indexURL + r, instantiateWasm:
|
|
3539
|
+
}, print: t.stdout, printErr: t.stderr, thisProgram: t._sysExecutable, arguments: t.args, API: { config: t }, locateFile: (r) => t.indexURL + r, instantiateWasm: cr(t.indexURL) };
|
|
3546
3540
|
return e;
|
|
3547
3541
|
}
|
|
3548
|
-
k(
|
|
3549
|
-
function
|
|
3542
|
+
k(nr, "createSettings");
|
|
3543
|
+
function sr(t) {
|
|
3550
3544
|
return function(e) {
|
|
3551
3545
|
let r = "/";
|
|
3552
3546
|
try {
|
|
@@ -3557,14 +3551,14 @@ var ns = hr((is, gt) => {
|
|
|
3557
3551
|
e.FS.chdir(t);
|
|
3558
3552
|
};
|
|
3559
3553
|
}
|
|
3560
|
-
k(
|
|
3561
|
-
function
|
|
3554
|
+
k(sr, "createHomeDirectory");
|
|
3555
|
+
function ar(t) {
|
|
3562
3556
|
return function(e) {
|
|
3563
3557
|
Object.assign(e.ENV, t);
|
|
3564
3558
|
};
|
|
3565
3559
|
}
|
|
3566
|
-
k(
|
|
3567
|
-
function
|
|
3560
|
+
k(ar, "setEnvironment");
|
|
3561
|
+
function ir(t) {
|
|
3568
3562
|
return t ? [async (e) => {
|
|
3569
3563
|
e.addRunDependency("fsInitHook");
|
|
3570
3564
|
try {
|
|
@@ -3574,9 +3568,9 @@ var ns = hr((is, gt) => {
|
|
|
3574
3568
|
}
|
|
3575
3569
|
}] : [];
|
|
3576
3570
|
}
|
|
3577
|
-
k(
|
|
3578
|
-
function
|
|
3579
|
-
let e =
|
|
3571
|
+
k(ir, "callFsInitHook");
|
|
3572
|
+
function or(t) {
|
|
3573
|
+
let e = Xt(t);
|
|
3580
3574
|
return async (r) => {
|
|
3581
3575
|
let n = r._py_version_major(), s = r._py_version_minor();
|
|
3582
3576
|
r.FS.mkdirTree("/lib"), r.API.sitePackages = `/lib/python${n}.${s}/site-packages`, r.FS.mkdirTree(r.API.sitePackages), r.addRunDependency("install-stdlib");
|
|
@@ -3590,15 +3584,15 @@ var ns = hr((is, gt) => {
|
|
|
3590
3584
|
}
|
|
3591
3585
|
};
|
|
3592
3586
|
}
|
|
3593
|
-
k(
|
|
3594
|
-
function
|
|
3587
|
+
k(or, "installStdlib");
|
|
3588
|
+
function dr(t) {
|
|
3595
3589
|
let e;
|
|
3596
|
-
return t.stdLibURL != null ? e = t.stdLibURL : e = t.indexURL + "python_stdlib.zip", [...
|
|
3590
|
+
return t.stdLibURL != null ? e = t.stdLibURL : e = t.indexURL + "python_stdlib.zip", [...ir(t.fsInit), or(e), sr(t.env.HOME), ar(t.env), rr];
|
|
3597
3591
|
}
|
|
3598
|
-
k(
|
|
3599
|
-
function
|
|
3592
|
+
k(dr, "getFileSystemInitializationFuncs");
|
|
3593
|
+
function cr(t) {
|
|
3600
3594
|
if (typeof WasmOffsetConverter < "u") return;
|
|
3601
|
-
let { binary: e, response: r } =
|
|
3595
|
+
let { binary: e, response: r } = Ge(t + "pyodide.asm.wasm");
|
|
3602
3596
|
return function(n, s) {
|
|
3603
3597
|
return async function() {
|
|
3604
3598
|
try {
|
|
@@ -3612,19 +3606,19 @@ var ns = hr((is, gt) => {
|
|
|
3612
3606
|
}(), {};
|
|
3613
3607
|
};
|
|
3614
3608
|
}
|
|
3615
|
-
k(
|
|
3616
|
-
var
|
|
3617
|
-
async function
|
|
3609
|
+
k(cr, "getInstantiateWasmFunc");
|
|
3610
|
+
var lt = "0.27.5";
|
|
3611
|
+
async function ft(t = {}) {
|
|
3618
3612
|
var e, r;
|
|
3619
|
-
await
|
|
3620
|
-
let n = t.indexURL || await
|
|
3621
|
-
n =
|
|
3613
|
+
await vt();
|
|
3614
|
+
let n = t.indexURL || await tr();
|
|
3615
|
+
n = ut(n), n.endsWith("/") || (n += "/"), t.indexURL = n;
|
|
3622
3616
|
let s = { fullStdLib: !1, jsglobals: globalThis, stdin: globalThis.prompt ? globalThis.prompt : void 0, lockFileURL: n + "pyodide-lock.json", args: [], env: {}, packageCacheDir: n, packages: [], enableRunUntilComplete: !1, checkAPIVersion: !0, BUILD_ID: "bd0388b62e760f8ba04185eb443fec955f25434f49c7b951efe5b1f792dbe5d4" }, a = Object.assign(s, t);
|
|
3623
3617
|
(e = a.env).HOME ?? (e.HOME = "/home/pyodide"), (r = a.env).PYTHONINSPECT ?? (r.PYTHONINSPECT = "1");
|
|
3624
|
-
let i =
|
|
3625
|
-
if (o.lockFilePromise =
|
|
3618
|
+
let i = nr(a), o = i.API;
|
|
3619
|
+
if (o.lockFilePromise = er(a.lockFileURL), typeof _createPyodideModule != "function") {
|
|
3626
3620
|
let x = `${a.indexURL}pyodide.asm.js`;
|
|
3627
|
-
await
|
|
3621
|
+
await De(x);
|
|
3628
3622
|
}
|
|
3629
3623
|
let d;
|
|
3630
3624
|
if (t._loadSnapshot) {
|
|
@@ -3633,7 +3627,7 @@ var ns = hr((is, gt) => {
|
|
|
3633
3627
|
}
|
|
3634
3628
|
let c = await _createPyodideModule(i);
|
|
3635
3629
|
if (i.exited) throw i.exited.toThrow;
|
|
3636
|
-
if (t.pyproxyToStringRepr && o.setPyProxyToStringMethod(!0), o.version !==
|
|
3630
|
+
if (t.pyproxyToStringRepr && o.setPyProxyToStringMethod(!0), o.version !== lt && a.checkAPIVersion) throw new Error(`Pyodide version does not match: '${lt}' <==> '${o.version}'. If you updated the Pyodide version, make sure you also updated the 'indexURL' parameter passed to loadPyodide.`);
|
|
3637
3631
|
c.locateFile = (x) => {
|
|
3638
3632
|
throw new Error("Didn't expect to load any more file_packager files!");
|
|
3639
3633
|
};
|
|
@@ -3642,47 +3636,47 @@ var ns = hr((is, gt) => {
|
|
|
3642
3636
|
let w = o.finalizeBootstrap(l, t._snapshotDeserializer);
|
|
3643
3637
|
return o.sys.path.insert(0, o.config.env.HOME), w.version.includes("dev") || o.setCdnUrl(`https://cdn.jsdelivr.net/pyodide/v${w.version}/full/`), o._pyodide.set_excepthook(), await o.packageIndexReady, o.initializeStreams(a.stdin, a.stdout, a.stderr), w;
|
|
3644
3638
|
}
|
|
3645
|
-
k(
|
|
3646
|
-
const
|
|
3647
|
-
function
|
|
3648
|
-
return t.includes("dev") &&
|
|
3639
|
+
k(ft, "loadPyodide");
|
|
3640
|
+
const Bn = !1;
|
|
3641
|
+
function Wn(t) {
|
|
3642
|
+
return t.includes("dev") && Bn ? "dev" : `v${lt}`;
|
|
3649
3643
|
}
|
|
3650
|
-
function
|
|
3644
|
+
function ke(t) {
|
|
3651
3645
|
return t.FS;
|
|
3652
3646
|
}
|
|
3653
|
-
const
|
|
3654
|
-
NOTEBOOK_FILENAME:
|
|
3655
|
-
HOME_DIR:
|
|
3647
|
+
const pt = (t) => new TextDecoder().decode(t), ge = "notebook.py", ve = "/marimo", B = {
|
|
3648
|
+
NOTEBOOK_FILENAME: ge,
|
|
3649
|
+
HOME_DIR: ve,
|
|
3656
3650
|
createHomeDir: (t) => {
|
|
3657
|
-
const e =
|
|
3651
|
+
const e = ke(t);
|
|
3658
3652
|
try {
|
|
3659
|
-
e.mkdirTree(
|
|
3653
|
+
e.mkdirTree(ve);
|
|
3660
3654
|
} catch {
|
|
3661
3655
|
}
|
|
3662
|
-
e.chdir(
|
|
3656
|
+
e.chdir(ve);
|
|
3663
3657
|
},
|
|
3664
3658
|
mountFS: (t) => {
|
|
3665
|
-
|
|
3659
|
+
ke(t).mount(t.FS.filesystems.IDBFS, { root: "." }, ve);
|
|
3666
3660
|
},
|
|
3667
3661
|
populateFilesToMemory: async (t) => {
|
|
3668
|
-
await
|
|
3662
|
+
await Ot(t, !0);
|
|
3669
3663
|
},
|
|
3670
3664
|
persistFilesToRemote: async (t) => {
|
|
3671
|
-
await
|
|
3665
|
+
await Ot(t, !1);
|
|
3672
3666
|
},
|
|
3673
3667
|
readNotebook: (t) => {
|
|
3674
|
-
const e =
|
|
3675
|
-
return
|
|
3668
|
+
const e = ke(t), r = `${ve}/${ge}`;
|
|
3669
|
+
return pt(e.readFile(r));
|
|
3676
3670
|
},
|
|
3677
3671
|
initNotebookCode: (t) => {
|
|
3678
|
-
const { pyodide: e, filename: r, code: n } = t, s =
|
|
3672
|
+
const { pyodide: e, filename: r, code: n } = t, s = ke(e), a = (i) => {
|
|
3679
3673
|
try {
|
|
3680
|
-
return
|
|
3674
|
+
return pt(s.readFile(i));
|
|
3681
3675
|
} catch {
|
|
3682
3676
|
return null;
|
|
3683
3677
|
}
|
|
3684
3678
|
};
|
|
3685
|
-
if (r && r !==
|
|
3679
|
+
if (r && r !== ge) {
|
|
3686
3680
|
const i = a(r);
|
|
3687
3681
|
if (i)
|
|
3688
3682
|
return {
|
|
@@ -3690,15 +3684,15 @@ var ns = hr((is, gt) => {
|
|
|
3690
3684
|
filename: r
|
|
3691
3685
|
};
|
|
3692
3686
|
}
|
|
3693
|
-
return s.writeFile(
|
|
3687
|
+
return s.writeFile(ge, n), {
|
|
3694
3688
|
code: n,
|
|
3695
|
-
filename:
|
|
3689
|
+
filename: ge
|
|
3696
3690
|
};
|
|
3697
3691
|
}
|
|
3698
3692
|
};
|
|
3699
|
-
function
|
|
3693
|
+
function Ot(t, e) {
|
|
3700
3694
|
return new Promise((r, n) => {
|
|
3701
|
-
|
|
3695
|
+
ke(t).syncfs(e, (s) => {
|
|
3702
3696
|
if (s instanceof Error) {
|
|
3703
3697
|
n(s);
|
|
3704
3698
|
return;
|
|
@@ -3707,11 +3701,11 @@ var ns = hr((is, gt) => {
|
|
|
3707
3701
|
});
|
|
3708
3702
|
});
|
|
3709
3703
|
}
|
|
3710
|
-
function
|
|
3704
|
+
function Jn(t, e) {
|
|
3711
3705
|
if (!t)
|
|
3712
3706
|
throw new Error(e);
|
|
3713
3707
|
}
|
|
3714
|
-
class
|
|
3708
|
+
class Yn {
|
|
3715
3709
|
constructor() {
|
|
3716
3710
|
this.spans = [];
|
|
3717
3711
|
}
|
|
@@ -3753,25 +3747,25 @@ var ns = hr((is, gt) => {
|
|
|
3753
3747
|
logSpans() {
|
|
3754
3748
|
}
|
|
3755
3749
|
}
|
|
3756
|
-
const
|
|
3757
|
-
globalThis.t =
|
|
3758
|
-
const
|
|
3759
|
-
class
|
|
3750
|
+
const ue = new Yn();
|
|
3751
|
+
globalThis.t = ue;
|
|
3752
|
+
const Kn = !1;
|
|
3753
|
+
class Gn {
|
|
3760
3754
|
constructor() {
|
|
3761
3755
|
this.pyodide = null;
|
|
3762
3756
|
}
|
|
3763
3757
|
get requirePyodide() {
|
|
3764
|
-
return
|
|
3758
|
+
return Jn(this.pyodide, "Pyodide not loaded"), this.pyodide;
|
|
3765
3759
|
}
|
|
3766
3760
|
async bootstrap(e) {
|
|
3767
3761
|
return await this.loadPyodideAndPackages(e);
|
|
3768
3762
|
}
|
|
3769
3763
|
async loadPyodideAndPackages(e) {
|
|
3770
|
-
if (!
|
|
3764
|
+
if (!ft)
|
|
3771
3765
|
throw new Error("loadPyodide is not defined");
|
|
3772
|
-
const r =
|
|
3766
|
+
const r = ue.startSpan("loadPyodide");
|
|
3773
3767
|
try {
|
|
3774
|
-
const n = await
|
|
3768
|
+
const n = await ft({
|
|
3775
3769
|
// Perf: These get loaded while pyodide is being bootstrapped
|
|
3776
3770
|
packages: [
|
|
3777
3771
|
"micropip",
|
|
@@ -3781,7 +3775,7 @@ var ns = hr((is, gt) => {
|
|
|
3781
3775
|
"narwhals",
|
|
3782
3776
|
"packaging"
|
|
3783
3777
|
],
|
|
3784
|
-
_makeSnapshot:
|
|
3778
|
+
_makeSnapshot: Kn,
|
|
3785
3779
|
lockFileURL: `https://wasm.marimo.app/pyodide-lock.json?v=${e.version}&pyodide=${e.pyodideVersion}`,
|
|
3786
3780
|
// Without this, this fails in Firefox with
|
|
3787
3781
|
// `Could not extract indexURL path from pyodide module`
|
|
@@ -3790,12 +3784,12 @@ var ns = hr((is, gt) => {
|
|
|
3790
3784
|
});
|
|
3791
3785
|
return this.pyodide = n, r.end("ok"), n;
|
|
3792
3786
|
} catch (n) {
|
|
3793
|
-
throw
|
|
3787
|
+
throw be.error("Failed to load Pyodide", n), n;
|
|
3794
3788
|
}
|
|
3795
3789
|
}
|
|
3796
3790
|
async mountFilesystem(e) {
|
|
3797
|
-
const r =
|
|
3798
|
-
return
|
|
3791
|
+
const r = ue.startSpan("mountFilesystem");
|
|
3792
|
+
return B.createHomeDir(this.requirePyodide), B.mountFS(this.requirePyodide), await B.populateFilesToMemory(this.requirePyodide), r.end("ok"), B.initNotebookCode({
|
|
3799
3793
|
pyodide: this.requirePyodide,
|
|
3800
3794
|
code: e.code,
|
|
3801
3795
|
filename: e.filename
|
|
@@ -3806,7 +3800,7 @@ var ns = hr((is, gt) => {
|
|
|
3806
3800
|
self.messenger = {
|
|
3807
3801
|
callback: s
|
|
3808
3802
|
}, self.query_params = a, self.user_config = i;
|
|
3809
|
-
const o =
|
|
3803
|
+
const o = ue.startSpan("startSession.runPython"), d = n || B.NOTEBOOK_FILENAME, [c, l, w] = this.requirePyodide.runPython(
|
|
3810
3804
|
`
|
|
3811
3805
|
print("[py] Starting marimo...")
|
|
3812
3806
|
import asyncio
|
|
@@ -3849,11 +3843,11 @@ ${e}`, e = `import jedi
|
|
|
3849
3843
|
${e}`, e = `import pyodide_http
|
|
3850
3844
|
${e}`;
|
|
3851
3845
|
const s = [...r];
|
|
3852
|
-
let a =
|
|
3846
|
+
let a = ue.startSpan("pyodide.loadPackage");
|
|
3853
3847
|
await n.loadPackagesFromImports(e, {
|
|
3854
|
-
errorCallback:
|
|
3855
|
-
messageCallback:
|
|
3856
|
-
}), a.end(), a =
|
|
3848
|
+
errorCallback: be.error,
|
|
3849
|
+
messageCallback: be.log
|
|
3850
|
+
}), a.end(), a = ue.startSpan("micropip.install");
|
|
3857
3851
|
const i = s.filter(
|
|
3858
3852
|
(o) => !n.loadedPackages[o]
|
|
3859
3853
|
);
|
|
@@ -3866,54 +3860,53 @@ ${e}`;
|
|
|
3866
3860
|
print("Loading from micropip:", missing)
|
|
3867
3861
|
await micropip.install(missing)
|
|
3868
3862
|
`).catch((o) => {
|
|
3869
|
-
|
|
3863
|
+
be.error("Failed to load packages from micropip", o);
|
|
3870
3864
|
}), a.end();
|
|
3871
3865
|
}
|
|
3872
3866
|
}
|
|
3873
|
-
async function
|
|
3867
|
+
async function Xn(t) {
|
|
3874
3868
|
try {
|
|
3875
3869
|
return await import(
|
|
3876
3870
|
/* @vite-ignore */
|
|
3877
3871
|
`/wasm/controller.js?version=${t}`
|
|
3878
3872
|
);
|
|
3879
3873
|
} catch {
|
|
3880
|
-
return new
|
|
3874
|
+
return new Gn();
|
|
3881
3875
|
}
|
|
3882
3876
|
}
|
|
3883
|
-
async function
|
|
3884
|
-
var t;
|
|
3877
|
+
async function Qn() {
|
|
3885
3878
|
try {
|
|
3886
|
-
const
|
|
3887
|
-
self.controller =
|
|
3888
|
-
version:
|
|
3889
|
-
pyodideVersion:
|
|
3890
|
-
}), await
|
|
3879
|
+
const t = ts(), e = Wn(t), r = await Xn(t);
|
|
3880
|
+
self.controller = r, self.pyodide = await r.bootstrap({
|
|
3881
|
+
version: t,
|
|
3882
|
+
pyodideVersion: e
|
|
3883
|
+
}), await r.mountFilesystem?.({
|
|
3891
3884
|
code: "",
|
|
3892
3885
|
filename: null
|
|
3893
|
-
})
|
|
3894
|
-
} catch (
|
|
3895
|
-
|
|
3886
|
+
}), ht.send.initialized({});
|
|
3887
|
+
} catch (t) {
|
|
3888
|
+
be.error("Error bootstrapping", t), ht.send.initializedError({ error: xn(t) });
|
|
3896
3889
|
}
|
|
3897
3890
|
}
|
|
3898
|
-
const
|
|
3899
|
-
readFile: async (t) => (await
|
|
3900
|
-
readNotebook: async () => (await
|
|
3891
|
+
const nt = Qn(), es = {
|
|
3892
|
+
readFile: async (t) => (await nt, pt(self.pyodide.FS.readFile(t))),
|
|
3893
|
+
readNotebook: async () => (await nt, B.readNotebook(self.pyodide)),
|
|
3901
3894
|
saveNotebook: async (t) => {
|
|
3902
|
-
await
|
|
3895
|
+
await nt, await self.pyodide.runPython(`
|
|
3903
3896
|
from marimo._pyodide.bootstrap import save_file
|
|
3904
3897
|
|
|
3905
3898
|
save_file
|
|
3906
|
-
`)(JSON.stringify(t),
|
|
3899
|
+
`)(JSON.stringify(t), B.NOTEBOOK_FILENAME), await B.persistFilesToRemote(self.pyodide);
|
|
3907
3900
|
}
|
|
3908
|
-
},
|
|
3909
|
-
transport:
|
|
3910
|
-
transportId:
|
|
3901
|
+
}, ht = Rn({
|
|
3902
|
+
transport: Pn({
|
|
3903
|
+
transportId: jn
|
|
3911
3904
|
}),
|
|
3912
|
-
requestHandler:
|
|
3905
|
+
requestHandler: es
|
|
3913
3906
|
});
|
|
3914
|
-
|
|
3915
|
-
function
|
|
3907
|
+
ht.send("ready", {});
|
|
3908
|
+
function ts() {
|
|
3916
3909
|
return self.name;
|
|
3917
3910
|
}
|
|
3918
3911
|
});
|
|
3919
|
-
export default
|
|
3912
|
+
export default rs();
|