@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 _r = (t, e) => () => (e || t((e = { exports: {} }).exports, e), e.exports);
|
|
2
|
+
var ps = _r((ys, ht) => {
|
|
3
3
|
class br {
|
|
4
4
|
constructor() {
|
|
5
5
|
this.status = "pending", this.promise = new Promise((e, r) => {
|
|
@@ -47,14 +47,14 @@ var hs = wr((gs, yt) => {
|
|
|
47
47
|
}
|
|
48
48
|
t.joinValues = n, t.jsonStringifyReplacer = (s, a) => typeof a == "bigint" ? a.toString() : a;
|
|
49
49
|
})(k || (k = {}));
|
|
50
|
-
var
|
|
50
|
+
var at;
|
|
51
51
|
(function(t) {
|
|
52
52
|
t.mergeShapes = (e, r) => ({
|
|
53
53
|
...e,
|
|
54
54
|
...r
|
|
55
55
|
// second overwrites first
|
|
56
56
|
});
|
|
57
|
-
})(
|
|
57
|
+
})(at || (at = {}));
|
|
58
58
|
const p = k.arrayToEnum([
|
|
59
59
|
"string",
|
|
60
60
|
"nan",
|
|
@@ -76,7 +76,7 @@ var hs = wr((gs, yt) => {
|
|
|
76
76
|
"never",
|
|
77
77
|
"map",
|
|
78
78
|
"set"
|
|
79
|
-
]),
|
|
79
|
+
]), U = (t) => {
|
|
80
80
|
switch (typeof t) {
|
|
81
81
|
case "undefined":
|
|
82
82
|
return p.undefined;
|
|
@@ -114,8 +114,8 @@ var hs = wr((gs, yt) => {
|
|
|
114
114
|
"invalid_intersection_types",
|
|
115
115
|
"not_multiple_of",
|
|
116
116
|
"not_finite"
|
|
117
|
-
]),
|
|
118
|
-
class
|
|
117
|
+
]), wr = (t) => JSON.stringify(t, null, 2).replace(/"([^"]+)":/g, "$1:");
|
|
118
|
+
class I extends Error {
|
|
119
119
|
get errors() {
|
|
120
120
|
return this.issues;
|
|
121
121
|
}
|
|
@@ -152,7 +152,7 @@ var hs = wr((gs, yt) => {
|
|
|
152
152
|
return s(this), n;
|
|
153
153
|
}
|
|
154
154
|
static assert(e) {
|
|
155
|
-
if (!(e instanceof
|
|
155
|
+
if (!(e instanceof I))
|
|
156
156
|
throw new Error(`Not a ZodError: ${e}`);
|
|
157
157
|
}
|
|
158
158
|
toString() {
|
|
@@ -174,8 +174,8 @@ var hs = wr((gs, yt) => {
|
|
|
174
174
|
return this.flatten();
|
|
175
175
|
}
|
|
176
176
|
}
|
|
177
|
-
|
|
178
|
-
const
|
|
177
|
+
I.create = (t) => new I(t);
|
|
178
|
+
const me = (t, e) => {
|
|
179
179
|
let r;
|
|
180
180
|
switch (t.code) {
|
|
181
181
|
case u.invalid_type:
|
|
@@ -231,14 +231,14 @@ var hs = wr((gs, yt) => {
|
|
|
231
231
|
}
|
|
232
232
|
return { message: r };
|
|
233
233
|
};
|
|
234
|
-
let
|
|
235
|
-
function
|
|
236
|
-
|
|
234
|
+
let Rt = me;
|
|
235
|
+
function kr(t) {
|
|
236
|
+
Rt = t;
|
|
237
237
|
}
|
|
238
|
-
function
|
|
239
|
-
return
|
|
238
|
+
function Ue() {
|
|
239
|
+
return Rt;
|
|
240
240
|
}
|
|
241
|
-
const
|
|
241
|
+
const He = (t) => {
|
|
242
242
|
const { data: e, path: r, errorMaps: n, issueData: s } = t, a = [...r, ...s.path || []], i = {
|
|
243
243
|
...s,
|
|
244
244
|
path: a
|
|
@@ -258,9 +258,9 @@ var hs = wr((gs, yt) => {
|
|
|
258
258
|
path: a,
|
|
259
259
|
message: o
|
|
260
260
|
};
|
|
261
|
-
},
|
|
261
|
+
}, xr = [];
|
|
262
262
|
function f(t, e) {
|
|
263
|
-
const r =
|
|
263
|
+
const r = Ue(), n = He({
|
|
264
264
|
issueData: e,
|
|
265
265
|
data: t.data,
|
|
266
266
|
path: t.path,
|
|
@@ -271,13 +271,13 @@ var hs = wr((gs, yt) => {
|
|
|
271
271
|
// then schema-bound map if available
|
|
272
272
|
r,
|
|
273
273
|
// then global override map
|
|
274
|
-
r ===
|
|
274
|
+
r === me ? void 0 : me
|
|
275
275
|
// then global default map
|
|
276
276
|
].filter((s) => !!s)
|
|
277
277
|
});
|
|
278
278
|
t.common.issues.push(n);
|
|
279
279
|
}
|
|
280
|
-
class
|
|
280
|
+
class N {
|
|
281
281
|
constructor() {
|
|
282
282
|
this.value = "valid";
|
|
283
283
|
}
|
|
@@ -305,7 +305,7 @@ var hs = wr((gs, yt) => {
|
|
|
305
305
|
value: i
|
|
306
306
|
});
|
|
307
307
|
}
|
|
308
|
-
return
|
|
308
|
+
return N.mergeObjectSync(e, n);
|
|
309
309
|
}
|
|
310
310
|
static mergeObjectSync(e, r) {
|
|
311
311
|
const n = {};
|
|
@@ -320,21 +320,21 @@ var hs = wr((gs, yt) => {
|
|
|
320
320
|
}
|
|
321
321
|
const g = Object.freeze({
|
|
322
322
|
status: "aborted"
|
|
323
|
-
}),
|
|
324
|
-
function
|
|
323
|
+
}), pe = (t) => ({ status: "dirty", value: t }), A = (t) => ({ status: "valid", value: t }), it = (t) => t.status === "aborted", ot = (t) => t.status === "dirty", ae = (t) => t.status === "valid", Te = (t) => typeof Promise < "u" && t instanceof Promise;
|
|
324
|
+
function Be(t, e, r, n) {
|
|
325
325
|
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");
|
|
326
326
|
return e.get(t);
|
|
327
327
|
}
|
|
328
|
-
function
|
|
328
|
+
function At(t, e, r, n, s) {
|
|
329
329
|
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");
|
|
330
330
|
return e.set(t, r), r;
|
|
331
331
|
}
|
|
332
332
|
var m;
|
|
333
333
|
(function(t) {
|
|
334
|
-
t.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, t.toString = (e) => typeof e == "string" ? e : e
|
|
334
|
+
t.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, t.toString = (e) => typeof e == "string" ? e : e?.message;
|
|
335
335
|
})(m || (m = {}));
|
|
336
|
-
var
|
|
337
|
-
class
|
|
336
|
+
var ke, xe;
|
|
337
|
+
class D {
|
|
338
338
|
constructor(e, r, n, s) {
|
|
339
339
|
this._cachedPath = [], this.parent = e, this.data = r, this._path = n, this._key = s;
|
|
340
340
|
}
|
|
@@ -342,8 +342,8 @@ var hs = wr((gs, yt) => {
|
|
|
342
342
|
return this._cachedPath.length || (this._key instanceof Array ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
|
|
343
343
|
}
|
|
344
344
|
}
|
|
345
|
-
const
|
|
346
|
-
if (
|
|
345
|
+
const kt = (t, e) => {
|
|
346
|
+
if (ae(e))
|
|
347
347
|
return { success: !0, data: e.value };
|
|
348
348
|
if (!t.common.issues.length)
|
|
349
349
|
throw new Error("Validation failed but no issues detected.");
|
|
@@ -352,7 +352,7 @@ var hs = wr((gs, yt) => {
|
|
|
352
352
|
get error() {
|
|
353
353
|
if (this._error)
|
|
354
354
|
return this._error;
|
|
355
|
-
const r = new
|
|
355
|
+
const r = new I(t.common.issues);
|
|
356
356
|
return this._error = r, this._error;
|
|
357
357
|
}
|
|
358
358
|
};
|
|
@@ -369,18 +369,18 @@ var hs = wr((gs, yt) => {
|
|
|
369
369
|
return i.code === "invalid_enum_value" ? { message: l ?? o.defaultError } : typeof o.data > "u" ? { message: (d = l ?? n) !== null && d !== void 0 ? d : o.defaultError } : i.code !== "invalid_type" ? { message: o.defaultError } : { message: (c = l ?? r) !== null && c !== void 0 ? c : o.defaultError };
|
|
370
370
|
}, description: s };
|
|
371
371
|
}
|
|
372
|
-
class
|
|
372
|
+
class b {
|
|
373
373
|
get description() {
|
|
374
374
|
return this._def.description;
|
|
375
375
|
}
|
|
376
376
|
_getType(e) {
|
|
377
|
-
return
|
|
377
|
+
return U(e.data);
|
|
378
378
|
}
|
|
379
379
|
_getOrReturnCtx(e, r) {
|
|
380
380
|
return r || {
|
|
381
381
|
common: e.parent.common,
|
|
382
382
|
data: e.data,
|
|
383
|
-
parsedType:
|
|
383
|
+
parsedType: U(e.data),
|
|
384
384
|
schemaErrorMap: this._def.errorMap,
|
|
385
385
|
path: e.path,
|
|
386
386
|
parent: e.parent
|
|
@@ -388,11 +388,11 @@ var hs = wr((gs, yt) => {
|
|
|
388
388
|
}
|
|
389
389
|
_processInputParams(e) {
|
|
390
390
|
return {
|
|
391
|
-
status: new
|
|
391
|
+
status: new N(),
|
|
392
392
|
ctx: {
|
|
393
393
|
common: e.parent.common,
|
|
394
394
|
data: e.data,
|
|
395
|
-
parsedType:
|
|
395
|
+
parsedType: U(e.data),
|
|
396
396
|
schemaErrorMap: this._def.errorMap,
|
|
397
397
|
path: e.path,
|
|
398
398
|
parent: e.parent
|
|
@@ -401,7 +401,7 @@ var hs = wr((gs, yt) => {
|
|
|
401
401
|
}
|
|
402
402
|
_parseSync(e) {
|
|
403
403
|
const r = this._parse(e);
|
|
404
|
-
if (
|
|
404
|
+
if (Te(r))
|
|
405
405
|
throw new Error("Synchronous parse encountered promise.");
|
|
406
406
|
return r;
|
|
407
407
|
}
|
|
@@ -420,16 +420,16 @@ var hs = wr((gs, yt) => {
|
|
|
420
420
|
const s = {
|
|
421
421
|
common: {
|
|
422
422
|
issues: [],
|
|
423
|
-
async: (n = r
|
|
424
|
-
contextualErrorMap: r
|
|
423
|
+
async: (n = r?.async) !== null && n !== void 0 ? n : !1,
|
|
424
|
+
contextualErrorMap: r?.errorMap
|
|
425
425
|
},
|
|
426
|
-
path:
|
|
426
|
+
path: r?.path || [],
|
|
427
427
|
schemaErrorMap: this._def.errorMap,
|
|
428
428
|
parent: null,
|
|
429
429
|
data: e,
|
|
430
|
-
parsedType:
|
|
430
|
+
parsedType: U(e)
|
|
431
431
|
}, a = this._parseSync({ data: e, path: s.path, parent: s });
|
|
432
|
-
return
|
|
432
|
+
return kt(s, a);
|
|
433
433
|
}
|
|
434
434
|
"~validate"(e) {
|
|
435
435
|
var r, n;
|
|
@@ -442,23 +442,23 @@ var hs = wr((gs, yt) => {
|
|
|
442
442
|
schemaErrorMap: this._def.errorMap,
|
|
443
443
|
parent: null,
|
|
444
444
|
data: e,
|
|
445
|
-
parsedType:
|
|
445
|
+
parsedType: U(e)
|
|
446
446
|
};
|
|
447
447
|
if (!this["~standard"].async)
|
|
448
448
|
try {
|
|
449
449
|
const a = this._parseSync({ data: e, path: [], parent: s });
|
|
450
|
-
return
|
|
450
|
+
return ae(a) ? {
|
|
451
451
|
value: a.value
|
|
452
452
|
} : {
|
|
453
453
|
issues: s.common.issues
|
|
454
454
|
};
|
|
455
455
|
} catch (a) {
|
|
456
|
-
!((n = (r = a
|
|
456
|
+
!((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 = {
|
|
457
457
|
issues: [],
|
|
458
458
|
async: !0
|
|
459
459
|
};
|
|
460
460
|
}
|
|
461
|
-
return this._parseAsync({ data: e, path: [], parent: s }).then((a) =>
|
|
461
|
+
return this._parseAsync({ data: e, path: [], parent: s }).then((a) => ae(a) ? {
|
|
462
462
|
value: a.value
|
|
463
463
|
} : {
|
|
464
464
|
issues: s.common.issues
|
|
@@ -474,16 +474,16 @@ var hs = wr((gs, yt) => {
|
|
|
474
474
|
const n = {
|
|
475
475
|
common: {
|
|
476
476
|
issues: [],
|
|
477
|
-
contextualErrorMap: r
|
|
477
|
+
contextualErrorMap: r?.errorMap,
|
|
478
478
|
async: !0
|
|
479
479
|
},
|
|
480
|
-
path:
|
|
480
|
+
path: r?.path || [],
|
|
481
481
|
schemaErrorMap: this._def.errorMap,
|
|
482
482
|
parent: null,
|
|
483
483
|
data: e,
|
|
484
|
-
parsedType:
|
|
485
|
-
}, s = this._parse({ data: e, path: n.path, parent: n }), a = await (
|
|
486
|
-
return
|
|
484
|
+
parsedType: U(e)
|
|
485
|
+
}, s = this._parse({ data: e, path: n.path, parent: n }), a = await (Te(s) ? s : Promise.resolve(s));
|
|
486
|
+
return kt(n, a);
|
|
487
487
|
}
|
|
488
488
|
refine(e, r) {
|
|
489
489
|
const n = (s) => typeof r == "string" || typeof r > "u" ? { message: r } : typeof r == "function" ? r(s) : r;
|
|
@@ -499,7 +499,7 @@ var hs = wr((gs, yt) => {
|
|
|
499
499
|
return this._refinement((n, s) => e(n) ? !0 : (s.addIssue(typeof r == "function" ? r(n, s) : r), !1));
|
|
500
500
|
}
|
|
501
501
|
_refinement(e) {
|
|
502
|
-
return new
|
|
502
|
+
return new $({
|
|
503
503
|
schema: this,
|
|
504
504
|
typeName: y.ZodEffects,
|
|
505
505
|
effect: { type: "refinement", refinement: e }
|
|
@@ -516,7 +516,7 @@ var hs = wr((gs, yt) => {
|
|
|
516
516
|
};
|
|
517
517
|
}
|
|
518
518
|
optional() {
|
|
519
|
-
return
|
|
519
|
+
return F.create(this, this._def);
|
|
520
520
|
}
|
|
521
521
|
nullable() {
|
|
522
522
|
return K.create(this, this._def);
|
|
@@ -525,19 +525,19 @@ var hs = wr((gs, yt) => {
|
|
|
525
525
|
return this.nullable().optional();
|
|
526
526
|
}
|
|
527
527
|
array() {
|
|
528
|
-
return
|
|
528
|
+
return Z.create(this);
|
|
529
529
|
}
|
|
530
530
|
promise() {
|
|
531
|
-
return
|
|
531
|
+
return ge.create(this, this._def);
|
|
532
532
|
}
|
|
533
533
|
or(e) {
|
|
534
|
-
return
|
|
534
|
+
return Re.create([this, e], this._def);
|
|
535
535
|
}
|
|
536
536
|
and(e) {
|
|
537
|
-
return
|
|
537
|
+
return Ae.create(this, e, this._def);
|
|
538
538
|
}
|
|
539
539
|
transform(e) {
|
|
540
|
-
return new
|
|
540
|
+
return new $({
|
|
541
541
|
..._(this._def),
|
|
542
542
|
schema: this,
|
|
543
543
|
typeName: y.ZodEffects,
|
|
@@ -546,7 +546,7 @@ var hs = wr((gs, yt) => {
|
|
|
546
546
|
}
|
|
547
547
|
default(e) {
|
|
548
548
|
const r = typeof e == "function" ? e : () => e;
|
|
549
|
-
return new
|
|
549
|
+
return new Ze({
|
|
550
550
|
..._(this._def),
|
|
551
551
|
innerType: this,
|
|
552
552
|
defaultValue: r,
|
|
@@ -554,7 +554,7 @@ var hs = wr((gs, yt) => {
|
|
|
554
554
|
});
|
|
555
555
|
}
|
|
556
556
|
brand() {
|
|
557
|
-
return new
|
|
557
|
+
return new mt({
|
|
558
558
|
typeName: y.ZodBranded,
|
|
559
559
|
type: this,
|
|
560
560
|
..._(this._def)
|
|
@@ -562,7 +562,7 @@ var hs = wr((gs, yt) => {
|
|
|
562
562
|
}
|
|
563
563
|
catch(e) {
|
|
564
564
|
const r = typeof e == "function" ? e : () => e;
|
|
565
|
-
return new
|
|
565
|
+
return new $e({
|
|
566
566
|
..._(this._def),
|
|
567
567
|
innerType: this,
|
|
568
568
|
catchValue: r,
|
|
@@ -577,10 +577,10 @@ var hs = wr((gs, yt) => {
|
|
|
577
577
|
});
|
|
578
578
|
}
|
|
579
579
|
pipe(e) {
|
|
580
|
-
return
|
|
580
|
+
return Fe.create(this, e);
|
|
581
581
|
}
|
|
582
582
|
readonly() {
|
|
583
|
-
return
|
|
583
|
+
return Me.create(this);
|
|
584
584
|
}
|
|
585
585
|
isOptional() {
|
|
586
586
|
return this.safeParse(void 0).success;
|
|
@@ -589,26 +589,26 @@ var hs = wr((gs, yt) => {
|
|
|
589
589
|
return this.safeParse(null).success;
|
|
590
590
|
}
|
|
591
591
|
}
|
|
592
|
-
const
|
|
593
|
-
let
|
|
594
|
-
const
|
|
595
|
-
function
|
|
592
|
+
const Sr = /^c[^\s-]{8,}$/i, Tr = /^[0-9a-z]+$/, Er = /^[0-9A-HJKMNP-TV-Z]{26}$/i, Or = /^[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, Nr = /^[a-z0-9_-]{21}$/i, Rr = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, Ar = /^[-+]?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)?)??$/, Cr = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, Ir = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
593
|
+
let nt;
|
|
594
|
+
const Pr = /^(?:(?: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])$/, jr = /^(?:(?: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])$/, Zr = /^(([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]))$/, $r = /^(([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])$/, Mr = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, Fr = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, Ct = "((\\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])))", Dr = new RegExp(`^${Ct}$`);
|
|
595
|
+
function It(t) {
|
|
596
596
|
let e = "([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";
|
|
597
597
|
return t.precision ? e = `${e}\\.\\d{${t.precision}}` : t.precision == null && (e = `${e}(\\.\\d+)?`), e;
|
|
598
598
|
}
|
|
599
|
-
function
|
|
600
|
-
return new RegExp(`^${
|
|
599
|
+
function Lr(t) {
|
|
600
|
+
return new RegExp(`^${It(t)}$`);
|
|
601
601
|
}
|
|
602
|
-
function
|
|
603
|
-
let e = `${
|
|
602
|
+
function Pt(t) {
|
|
603
|
+
let e = `${Ct}T${It(t)}`;
|
|
604
604
|
const r = [];
|
|
605
605
|
return r.push(t.local ? "Z?" : "Z"), t.offset && r.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${r.join("|")})`, new RegExp(`^${e}$`);
|
|
606
606
|
}
|
|
607
|
-
function
|
|
608
|
-
return !!((e === "v4" || !e) &&
|
|
607
|
+
function Vr(t, e) {
|
|
608
|
+
return !!((e === "v4" || !e) && Pr.test(t) || (e === "v6" || !e) && Zr.test(t));
|
|
609
609
|
}
|
|
610
|
-
function
|
|
611
|
-
if (!
|
|
610
|
+
function zr(t, e) {
|
|
611
|
+
if (!Rr.test(t))
|
|
612
612
|
return !1;
|
|
613
613
|
try {
|
|
614
614
|
const [r] = t.split("."), n = r.replace(/-/g, "+").replace(/_/g, "/").padEnd(r.length + (4 - r.length % 4) % 4, "="), s = JSON.parse(atob(n));
|
|
@@ -617,10 +617,10 @@ var hs = wr((gs, yt) => {
|
|
|
617
617
|
return !1;
|
|
618
618
|
}
|
|
619
619
|
}
|
|
620
|
-
function
|
|
621
|
-
return !!((e === "v4" || !e) &&
|
|
620
|
+
function qr(t, e) {
|
|
621
|
+
return !!((e === "v4" || !e) && jr.test(t) || (e === "v6" || !e) && $r.test(t));
|
|
622
622
|
}
|
|
623
|
-
class
|
|
623
|
+
class j extends b {
|
|
624
624
|
_parse(e) {
|
|
625
625
|
if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== p.string) {
|
|
626
626
|
const a = this._getOrReturnCtx(e);
|
|
@@ -630,7 +630,7 @@ var hs = wr((gs, yt) => {
|
|
|
630
630
|
received: a.parsedType
|
|
631
631
|
}), g;
|
|
632
632
|
}
|
|
633
|
-
const n = new
|
|
633
|
+
const n = new N();
|
|
634
634
|
let s;
|
|
635
635
|
for (const a of this._def.checks)
|
|
636
636
|
if (a.kind === "min")
|
|
@@ -669,43 +669,43 @@ var hs = wr((gs, yt) => {
|
|
|
669
669
|
message: a.message
|
|
670
670
|
}), n.dirty());
|
|
671
671
|
} else if (a.kind === "email")
|
|
672
|
-
|
|
672
|
+
Cr.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
673
673
|
validation: "email",
|
|
674
674
|
code: u.invalid_string,
|
|
675
675
|
message: a.message
|
|
676
676
|
}), n.dirty());
|
|
677
677
|
else if (a.kind === "emoji")
|
|
678
|
-
|
|
678
|
+
nt || (nt = new RegExp(Ir, "u")), nt.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
679
679
|
validation: "emoji",
|
|
680
680
|
code: u.invalid_string,
|
|
681
681
|
message: a.message
|
|
682
682
|
}), n.dirty());
|
|
683
683
|
else if (a.kind === "uuid")
|
|
684
|
-
|
|
684
|
+
Or.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
685
685
|
validation: "uuid",
|
|
686
686
|
code: u.invalid_string,
|
|
687
687
|
message: a.message
|
|
688
688
|
}), n.dirty());
|
|
689
689
|
else if (a.kind === "nanoid")
|
|
690
|
-
|
|
690
|
+
Nr.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
691
691
|
validation: "nanoid",
|
|
692
692
|
code: u.invalid_string,
|
|
693
693
|
message: a.message
|
|
694
694
|
}), n.dirty());
|
|
695
695
|
else if (a.kind === "cuid")
|
|
696
|
-
|
|
696
|
+
Sr.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
697
697
|
validation: "cuid",
|
|
698
698
|
code: u.invalid_string,
|
|
699
699
|
message: a.message
|
|
700
700
|
}), n.dirty());
|
|
701
701
|
else if (a.kind === "cuid2")
|
|
702
|
-
|
|
702
|
+
Tr.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
703
703
|
validation: "cuid2",
|
|
704
704
|
code: u.invalid_string,
|
|
705
705
|
message: a.message
|
|
706
706
|
}), n.dirty());
|
|
707
707
|
else if (a.kind === "ulid")
|
|
708
|
-
|
|
708
|
+
Er.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
709
709
|
validation: "ulid",
|
|
710
710
|
code: u.invalid_string,
|
|
711
711
|
message: a.message
|
|
@@ -736,39 +736,39 @@ var hs = wr((gs, yt) => {
|
|
|
736
736
|
code: u.invalid_string,
|
|
737
737
|
validation: { endsWith: a.value },
|
|
738
738
|
message: a.message
|
|
739
|
-
}), n.dirty()) : a.kind === "datetime" ?
|
|
739
|
+
}), n.dirty()) : a.kind === "datetime" ? Pt(a).test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
740
740
|
code: u.invalid_string,
|
|
741
741
|
validation: "datetime",
|
|
742
742
|
message: a.message
|
|
743
|
-
}), n.dirty()) : a.kind === "date" ?
|
|
743
|
+
}), n.dirty()) : a.kind === "date" ? Dr.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
744
744
|
code: u.invalid_string,
|
|
745
745
|
validation: "date",
|
|
746
746
|
message: a.message
|
|
747
|
-
}), n.dirty()) : a.kind === "time" ?
|
|
747
|
+
}), n.dirty()) : a.kind === "time" ? Lr(a).test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
748
748
|
code: u.invalid_string,
|
|
749
749
|
validation: "time",
|
|
750
750
|
message: a.message
|
|
751
|
-
}), n.dirty()) : a.kind === "duration" ?
|
|
751
|
+
}), n.dirty()) : a.kind === "duration" ? Ar.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
752
752
|
validation: "duration",
|
|
753
753
|
code: u.invalid_string,
|
|
754
754
|
message: a.message
|
|
755
|
-
}), n.dirty()) : a.kind === "ip" ?
|
|
755
|
+
}), n.dirty()) : a.kind === "ip" ? Vr(e.data, a.version) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
756
756
|
validation: "ip",
|
|
757
757
|
code: u.invalid_string,
|
|
758
758
|
message: a.message
|
|
759
|
-
}), n.dirty()) : a.kind === "jwt" ?
|
|
759
|
+
}), n.dirty()) : a.kind === "jwt" ? zr(e.data, a.alg) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
760
760
|
validation: "jwt",
|
|
761
761
|
code: u.invalid_string,
|
|
762
762
|
message: a.message
|
|
763
|
-
}), n.dirty()) : a.kind === "cidr" ?
|
|
763
|
+
}), n.dirty()) : a.kind === "cidr" ? qr(e.data, a.version) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
764
764
|
validation: "cidr",
|
|
765
765
|
code: u.invalid_string,
|
|
766
766
|
message: a.message
|
|
767
|
-
}), n.dirty()) : a.kind === "base64" ?
|
|
767
|
+
}), n.dirty()) : a.kind === "base64" ? Mr.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
768
768
|
validation: "base64",
|
|
769
769
|
code: u.invalid_string,
|
|
770
770
|
message: a.message
|
|
771
|
-
}), n.dirty()) : a.kind === "base64url" ?
|
|
771
|
+
}), n.dirty()) : a.kind === "base64url" ? Fr.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
772
772
|
validation: "base64url",
|
|
773
773
|
code: u.invalid_string,
|
|
774
774
|
message: a.message
|
|
@@ -783,7 +783,7 @@ var hs = wr((gs, yt) => {
|
|
|
783
783
|
});
|
|
784
784
|
}
|
|
785
785
|
_addCheck(e) {
|
|
786
|
-
return new
|
|
786
|
+
return new j({
|
|
787
787
|
...this._def,
|
|
788
788
|
checks: [...this._def.checks, e]
|
|
789
789
|
});
|
|
@@ -840,10 +840,10 @@ var hs = wr((gs, yt) => {
|
|
|
840
840
|
message: e
|
|
841
841
|
}) : this._addCheck({
|
|
842
842
|
kind: "datetime",
|
|
843
|
-
precision: typeof
|
|
844
|
-
offset: (r = e
|
|
845
|
-
local: (n = e
|
|
846
|
-
...m.errToObj(e
|
|
843
|
+
precision: typeof e?.precision > "u" ? null : e?.precision,
|
|
844
|
+
offset: (r = e?.offset) !== null && r !== void 0 ? r : !1,
|
|
845
|
+
local: (n = e?.local) !== null && n !== void 0 ? n : !1,
|
|
846
|
+
...m.errToObj(e?.message)
|
|
847
847
|
});
|
|
848
848
|
}
|
|
849
849
|
date(e) {
|
|
@@ -856,8 +856,8 @@ var hs = wr((gs, yt) => {
|
|
|
856
856
|
message: e
|
|
857
857
|
}) : this._addCheck({
|
|
858
858
|
kind: "time",
|
|
859
|
-
precision: typeof
|
|
860
|
-
...m.errToObj(e
|
|
859
|
+
precision: typeof e?.precision > "u" ? null : e?.precision,
|
|
860
|
+
...m.errToObj(e?.message)
|
|
861
861
|
});
|
|
862
862
|
}
|
|
863
863
|
duration(e) {
|
|
@@ -874,8 +874,8 @@ var hs = wr((gs, yt) => {
|
|
|
874
874
|
return this._addCheck({
|
|
875
875
|
kind: "includes",
|
|
876
876
|
value: e,
|
|
877
|
-
position: r
|
|
878
|
-
...m.errToObj(r
|
|
877
|
+
position: r?.position,
|
|
878
|
+
...m.errToObj(r?.message)
|
|
879
879
|
});
|
|
880
880
|
}
|
|
881
881
|
startsWith(e, r) {
|
|
@@ -920,19 +920,19 @@ var hs = wr((gs, yt) => {
|
|
|
920
920
|
return this.min(1, m.errToObj(e));
|
|
921
921
|
}
|
|
922
922
|
trim() {
|
|
923
|
-
return new
|
|
923
|
+
return new j({
|
|
924
924
|
...this._def,
|
|
925
925
|
checks: [...this._def.checks, { kind: "trim" }]
|
|
926
926
|
});
|
|
927
927
|
}
|
|
928
928
|
toLowerCase() {
|
|
929
|
-
return new
|
|
929
|
+
return new j({
|
|
930
930
|
...this._def,
|
|
931
931
|
checks: [...this._def.checks, { kind: "toLowerCase" }]
|
|
932
932
|
});
|
|
933
933
|
}
|
|
934
934
|
toUpperCase() {
|
|
935
|
-
return new
|
|
935
|
+
return new j({
|
|
936
936
|
...this._def,
|
|
937
937
|
checks: [...this._def.checks, { kind: "toUpperCase" }]
|
|
938
938
|
});
|
|
@@ -998,20 +998,20 @@ var hs = wr((gs, yt) => {
|
|
|
998
998
|
return e;
|
|
999
999
|
}
|
|
1000
1000
|
}
|
|
1001
|
-
|
|
1001
|
+
j.create = (t) => {
|
|
1002
1002
|
var e;
|
|
1003
|
-
return new
|
|
1003
|
+
return new j({
|
|
1004
1004
|
checks: [],
|
|
1005
1005
|
typeName: y.ZodString,
|
|
1006
|
-
coerce: (e = t
|
|
1006
|
+
coerce: (e = t?.coerce) !== null && e !== void 0 ? e : !1,
|
|
1007
1007
|
..._(t)
|
|
1008
1008
|
});
|
|
1009
1009
|
};
|
|
1010
|
-
function
|
|
1010
|
+
function Ur(t, e) {
|
|
1011
1011
|
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(".", ""));
|
|
1012
1012
|
return a % i / Math.pow(10, s);
|
|
1013
1013
|
}
|
|
1014
|
-
class J extends
|
|
1014
|
+
class J extends b {
|
|
1015
1015
|
constructor() {
|
|
1016
1016
|
super(...arguments), this.min = this.gte, this.max = this.lte, this.step = this.multipleOf;
|
|
1017
1017
|
}
|
|
@@ -1025,7 +1025,7 @@ var hs = wr((gs, yt) => {
|
|
|
1025
1025
|
}), g;
|
|
1026
1026
|
}
|
|
1027
1027
|
let n;
|
|
1028
|
-
const s = new
|
|
1028
|
+
const s = new N();
|
|
1029
1029
|
for (const a of this._def.checks)
|
|
1030
1030
|
a.kind === "int" ? k.isInteger(e.data) || (n = this._getOrReturnCtx(e, n), f(n, {
|
|
1031
1031
|
code: u.invalid_type,
|
|
@@ -1046,7 +1046,7 @@ var hs = wr((gs, yt) => {
|
|
|
1046
1046
|
inclusive: a.inclusive,
|
|
1047
1047
|
exact: !1,
|
|
1048
1048
|
message: a.message
|
|
1049
|
-
}), s.dirty()) : a.kind === "multipleOf" ?
|
|
1049
|
+
}), s.dirty()) : a.kind === "multipleOf" ? Ur(e.data, a.value) !== 0 && (n = this._getOrReturnCtx(e, n), f(n, {
|
|
1050
1050
|
code: u.not_multiple_of,
|
|
1051
1051
|
multipleOf: a.value,
|
|
1052
1052
|
message: a.message
|
|
@@ -1180,10 +1180,10 @@ var hs = wr((gs, yt) => {
|
|
|
1180
1180
|
J.create = (t) => new J({
|
|
1181
1181
|
checks: [],
|
|
1182
1182
|
typeName: y.ZodNumber,
|
|
1183
|
-
coerce:
|
|
1183
|
+
coerce: t?.coerce || !1,
|
|
1184
1184
|
..._(t)
|
|
1185
1185
|
});
|
|
1186
|
-
class Y extends
|
|
1186
|
+
class Y extends b {
|
|
1187
1187
|
constructor() {
|
|
1188
1188
|
super(...arguments), this.min = this.gte, this.max = this.lte;
|
|
1189
1189
|
}
|
|
@@ -1197,7 +1197,7 @@ var hs = wr((gs, yt) => {
|
|
|
1197
1197
|
if (this._getType(e) !== p.bigint)
|
|
1198
1198
|
return this._getInvalidInput(e);
|
|
1199
1199
|
let n;
|
|
1200
|
-
const s = new
|
|
1200
|
+
const s = new N();
|
|
1201
1201
|
for (const a of this._def.checks)
|
|
1202
1202
|
a.kind === "min" ? (a.inclusive ? e.data < a.value : e.data <= a.value) && (n = this._getOrReturnCtx(e, n), f(n, {
|
|
1203
1203
|
code: u.too_small,
|
|
@@ -1315,11 +1315,11 @@ var hs = wr((gs, yt) => {
|
|
|
1315
1315
|
return new Y({
|
|
1316
1316
|
checks: [],
|
|
1317
1317
|
typeName: y.ZodBigInt,
|
|
1318
|
-
coerce: (e = t
|
|
1318
|
+
coerce: (e = t?.coerce) !== null && e !== void 0 ? e : !1,
|
|
1319
1319
|
..._(t)
|
|
1320
1320
|
});
|
|
1321
1321
|
};
|
|
1322
|
-
class
|
|
1322
|
+
class Ee extends b {
|
|
1323
1323
|
_parse(e) {
|
|
1324
1324
|
if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== p.boolean) {
|
|
1325
1325
|
const n = this._getOrReturnCtx(e);
|
|
@@ -1329,15 +1329,15 @@ var hs = wr((gs, yt) => {
|
|
|
1329
1329
|
received: n.parsedType
|
|
1330
1330
|
}), g;
|
|
1331
1331
|
}
|
|
1332
|
-
return
|
|
1332
|
+
return A(e.data);
|
|
1333
1333
|
}
|
|
1334
1334
|
}
|
|
1335
|
-
|
|
1335
|
+
Ee.create = (t) => new Ee({
|
|
1336
1336
|
typeName: y.ZodBoolean,
|
|
1337
|
-
coerce:
|
|
1337
|
+
coerce: t?.coerce || !1,
|
|
1338
1338
|
..._(t)
|
|
1339
1339
|
});
|
|
1340
|
-
class
|
|
1340
|
+
class ie extends b {
|
|
1341
1341
|
_parse(e) {
|
|
1342
1342
|
if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== p.date) {
|
|
1343
1343
|
const a = this._getOrReturnCtx(e);
|
|
@@ -1353,7 +1353,7 @@ var hs = wr((gs, yt) => {
|
|
|
1353
1353
|
code: u.invalid_date
|
|
1354
1354
|
}), g;
|
|
1355
1355
|
}
|
|
1356
|
-
const n = new
|
|
1356
|
+
const n = new N();
|
|
1357
1357
|
let s;
|
|
1358
1358
|
for (const a of this._def.checks)
|
|
1359
1359
|
a.kind === "min" ? e.data.getTime() < a.value && (s = this._getOrReturnCtx(e, s), f(s, {
|
|
@@ -1377,7 +1377,7 @@ var hs = wr((gs, yt) => {
|
|
|
1377
1377
|
};
|
|
1378
1378
|
}
|
|
1379
1379
|
_addCheck(e) {
|
|
1380
|
-
return new
|
|
1380
|
+
return new ie({
|
|
1381
1381
|
...this._def,
|
|
1382
1382
|
checks: [...this._def.checks, e]
|
|
1383
1383
|
});
|
|
@@ -1409,13 +1409,13 @@ var hs = wr((gs, yt) => {
|
|
|
1409
1409
|
return e != null ? new Date(e) : null;
|
|
1410
1410
|
}
|
|
1411
1411
|
}
|
|
1412
|
-
|
|
1412
|
+
ie.create = (t) => new ie({
|
|
1413
1413
|
checks: [],
|
|
1414
|
-
coerce:
|
|
1414
|
+
coerce: t?.coerce || !1,
|
|
1415
1415
|
typeName: y.ZodDate,
|
|
1416
1416
|
..._(t)
|
|
1417
1417
|
});
|
|
1418
|
-
class
|
|
1418
|
+
class We extends b {
|
|
1419
1419
|
_parse(e) {
|
|
1420
1420
|
if (this._getType(e) !== p.symbol) {
|
|
1421
1421
|
const n = this._getOrReturnCtx(e);
|
|
@@ -1425,14 +1425,14 @@ var hs = wr((gs, yt) => {
|
|
|
1425
1425
|
received: n.parsedType
|
|
1426
1426
|
}), g;
|
|
1427
1427
|
}
|
|
1428
|
-
return
|
|
1428
|
+
return A(e.data);
|
|
1429
1429
|
}
|
|
1430
1430
|
}
|
|
1431
|
-
|
|
1431
|
+
We.create = (t) => new We({
|
|
1432
1432
|
typeName: y.ZodSymbol,
|
|
1433
1433
|
..._(t)
|
|
1434
1434
|
});
|
|
1435
|
-
class
|
|
1435
|
+
class Oe extends b {
|
|
1436
1436
|
_parse(e) {
|
|
1437
1437
|
if (this._getType(e) !== p.undefined) {
|
|
1438
1438
|
const n = this._getOrReturnCtx(e);
|
|
@@ -1442,14 +1442,14 @@ var hs = wr((gs, yt) => {
|
|
|
1442
1442
|
received: n.parsedType
|
|
1443
1443
|
}), g;
|
|
1444
1444
|
}
|
|
1445
|
-
return
|
|
1445
|
+
return A(e.data);
|
|
1446
1446
|
}
|
|
1447
1447
|
}
|
|
1448
|
-
|
|
1448
|
+
Oe.create = (t) => new Oe({
|
|
1449
1449
|
typeName: y.ZodUndefined,
|
|
1450
1450
|
..._(t)
|
|
1451
1451
|
});
|
|
1452
|
-
class
|
|
1452
|
+
class Ne extends b {
|
|
1453
1453
|
_parse(e) {
|
|
1454
1454
|
if (this._getType(e) !== p.null) {
|
|
1455
1455
|
const n = this._getOrReturnCtx(e);
|
|
@@ -1459,38 +1459,38 @@ var hs = wr((gs, yt) => {
|
|
|
1459
1459
|
received: n.parsedType
|
|
1460
1460
|
}), g;
|
|
1461
1461
|
}
|
|
1462
|
-
return
|
|
1462
|
+
return A(e.data);
|
|
1463
1463
|
}
|
|
1464
1464
|
}
|
|
1465
|
-
|
|
1465
|
+
Ne.create = (t) => new Ne({
|
|
1466
1466
|
typeName: y.ZodNull,
|
|
1467
1467
|
..._(t)
|
|
1468
1468
|
});
|
|
1469
|
-
class
|
|
1469
|
+
class ye extends b {
|
|
1470
1470
|
constructor() {
|
|
1471
1471
|
super(...arguments), this._any = !0;
|
|
1472
1472
|
}
|
|
1473
1473
|
_parse(e) {
|
|
1474
|
-
return
|
|
1474
|
+
return A(e.data);
|
|
1475
1475
|
}
|
|
1476
1476
|
}
|
|
1477
|
-
|
|
1477
|
+
ye.create = (t) => new ye({
|
|
1478
1478
|
typeName: y.ZodAny,
|
|
1479
1479
|
..._(t)
|
|
1480
1480
|
});
|
|
1481
|
-
class
|
|
1481
|
+
class se extends b {
|
|
1482
1482
|
constructor() {
|
|
1483
1483
|
super(...arguments), this._unknown = !0;
|
|
1484
1484
|
}
|
|
1485
1485
|
_parse(e) {
|
|
1486
|
-
return
|
|
1486
|
+
return A(e.data);
|
|
1487
1487
|
}
|
|
1488
1488
|
}
|
|
1489
|
-
|
|
1489
|
+
se.create = (t) => new se({
|
|
1490
1490
|
typeName: y.ZodUnknown,
|
|
1491
1491
|
..._(t)
|
|
1492
1492
|
});
|
|
1493
|
-
class H extends
|
|
1493
|
+
class H extends b {
|
|
1494
1494
|
_parse(e) {
|
|
1495
1495
|
const r = this._getOrReturnCtx(e);
|
|
1496
1496
|
return f(r, {
|
|
@@ -1504,7 +1504,7 @@ var hs = wr((gs, yt) => {
|
|
|
1504
1504
|
typeName: y.ZodNever,
|
|
1505
1505
|
..._(t)
|
|
1506
1506
|
});
|
|
1507
|
-
class
|
|
1507
|
+
class Je extends b {
|
|
1508
1508
|
_parse(e) {
|
|
1509
1509
|
if (this._getType(e) !== p.undefined) {
|
|
1510
1510
|
const n = this._getOrReturnCtx(e);
|
|
@@ -1514,14 +1514,14 @@ var hs = wr((gs, yt) => {
|
|
|
1514
1514
|
received: n.parsedType
|
|
1515
1515
|
}), g;
|
|
1516
1516
|
}
|
|
1517
|
-
return
|
|
1517
|
+
return A(e.data);
|
|
1518
1518
|
}
|
|
1519
1519
|
}
|
|
1520
|
-
|
|
1520
|
+
Je.create = (t) => new Je({
|
|
1521
1521
|
typeName: y.ZodVoid,
|
|
1522
1522
|
..._(t)
|
|
1523
1523
|
});
|
|
1524
|
-
class
|
|
1524
|
+
class Z extends b {
|
|
1525
1525
|
_parse(e) {
|
|
1526
1526
|
const { ctx: r, status: n } = this._processInputParams(e), s = this._def;
|
|
1527
1527
|
if (r.parsedType !== p.array)
|
|
@@ -1557,27 +1557,27 @@ var hs = wr((gs, yt) => {
|
|
|
1557
1557
|
exact: !1,
|
|
1558
1558
|
message: s.maxLength.message
|
|
1559
1559
|
}), n.dirty()), r.common.async)
|
|
1560
|
-
return Promise.all([...r.data].map((i, o) => s.type._parseAsync(new
|
|
1561
|
-
const a = [...r.data].map((i, o) => s.type._parseSync(new
|
|
1562
|
-
return
|
|
1560
|
+
return Promise.all([...r.data].map((i, o) => s.type._parseAsync(new D(r, i, r.path, o)))).then((i) => N.mergeArray(n, i));
|
|
1561
|
+
const a = [...r.data].map((i, o) => s.type._parseSync(new D(r, i, r.path, o)));
|
|
1562
|
+
return N.mergeArray(n, a);
|
|
1563
1563
|
}
|
|
1564
1564
|
get element() {
|
|
1565
1565
|
return this._def.type;
|
|
1566
1566
|
}
|
|
1567
1567
|
min(e, r) {
|
|
1568
|
-
return new
|
|
1568
|
+
return new Z({
|
|
1569
1569
|
...this._def,
|
|
1570
1570
|
minLength: { value: e, message: m.toString(r) }
|
|
1571
1571
|
});
|
|
1572
1572
|
}
|
|
1573
1573
|
max(e, r) {
|
|
1574
|
-
return new
|
|
1574
|
+
return new Z({
|
|
1575
1575
|
...this._def,
|
|
1576
1576
|
maxLength: { value: e, message: m.toString(r) }
|
|
1577
1577
|
});
|
|
1578
1578
|
}
|
|
1579
1579
|
length(e, r) {
|
|
1580
|
-
return new
|
|
1580
|
+
return new Z({
|
|
1581
1581
|
...this._def,
|
|
1582
1582
|
exactLength: { value: e, message: m.toString(r) }
|
|
1583
1583
|
});
|
|
@@ -1586,7 +1586,7 @@ var hs = wr((gs, yt) => {
|
|
|
1586
1586
|
return this.min(1, e);
|
|
1587
1587
|
}
|
|
1588
1588
|
}
|
|
1589
|
-
|
|
1589
|
+
Z.create = (t, e) => new Z({
|
|
1590
1590
|
type: t,
|
|
1591
1591
|
minLength: null,
|
|
1592
1592
|
maxLength: null,
|
|
@@ -1594,23 +1594,23 @@ var hs = wr((gs, yt) => {
|
|
|
1594
1594
|
typeName: y.ZodArray,
|
|
1595
1595
|
..._(e)
|
|
1596
1596
|
});
|
|
1597
|
-
function
|
|
1598
|
-
if (t instanceof
|
|
1597
|
+
function de(t) {
|
|
1598
|
+
if (t instanceof E) {
|
|
1599
1599
|
const e = {};
|
|
1600
1600
|
for (const r in t.shape) {
|
|
1601
1601
|
const n = t.shape[r];
|
|
1602
|
-
e[r] =
|
|
1602
|
+
e[r] = F.create(de(n));
|
|
1603
1603
|
}
|
|
1604
|
-
return new
|
|
1604
|
+
return new E({
|
|
1605
1605
|
...t._def,
|
|
1606
1606
|
shape: () => e
|
|
1607
1607
|
});
|
|
1608
|
-
} else return t instanceof
|
|
1608
|
+
} else return t instanceof Z ? new Z({
|
|
1609
1609
|
...t._def,
|
|
1610
|
-
type:
|
|
1611
|
-
}) : t instanceof
|
|
1610
|
+
type: de(t.element)
|
|
1611
|
+
}) : t instanceof F ? F.create(de(t.unwrap())) : t instanceof K ? K.create(de(t.unwrap())) : t instanceof L ? L.create(t.items.map((e) => de(e))) : t;
|
|
1612
1612
|
}
|
|
1613
|
-
class
|
|
1613
|
+
class E extends b {
|
|
1614
1614
|
constructor() {
|
|
1615
1615
|
super(...arguments), this._cached = null, this.nonstrict = this.passthrough, this.augment = this.extend;
|
|
1616
1616
|
}
|
|
@@ -1635,10 +1635,10 @@ var hs = wr((gs, yt) => {
|
|
|
1635
1635
|
i.includes(c) || o.push(c);
|
|
1636
1636
|
const d = [];
|
|
1637
1637
|
for (const c of i) {
|
|
1638
|
-
const l = a[c],
|
|
1638
|
+
const l = a[c], w = s.data[c];
|
|
1639
1639
|
d.push({
|
|
1640
1640
|
key: { status: "valid", value: c },
|
|
1641
|
-
value: l._parse(new
|
|
1641
|
+
value: l._parse(new D(s, w, s.path, c)),
|
|
1642
1642
|
alwaysSet: c in s.data
|
|
1643
1643
|
});
|
|
1644
1644
|
}
|
|
@@ -1659,11 +1659,11 @@ var hs = wr((gs, yt) => {
|
|
|
1659
1659
|
} else {
|
|
1660
1660
|
const c = this._def.catchall;
|
|
1661
1661
|
for (const l of o) {
|
|
1662
|
-
const
|
|
1662
|
+
const w = s.data[l];
|
|
1663
1663
|
d.push({
|
|
1664
1664
|
key: { status: "valid", value: l },
|
|
1665
1665
|
value: c._parse(
|
|
1666
|
-
new
|
|
1666
|
+
new D(s, w, s.path, l)
|
|
1667
1667
|
//, ctx.child(key), value, getParsedType(value)
|
|
1668
1668
|
),
|
|
1669
1669
|
alwaysSet: l in s.data
|
|
@@ -1673,21 +1673,21 @@ var hs = wr((gs, yt) => {
|
|
|
1673
1673
|
return s.common.async ? Promise.resolve().then(async () => {
|
|
1674
1674
|
const c = [];
|
|
1675
1675
|
for (const l of d) {
|
|
1676
|
-
const
|
|
1676
|
+
const w = await l.key, S = await l.value;
|
|
1677
1677
|
c.push({
|
|
1678
|
-
key:
|
|
1678
|
+
key: w,
|
|
1679
1679
|
value: S,
|
|
1680
1680
|
alwaysSet: l.alwaysSet
|
|
1681
1681
|
});
|
|
1682
1682
|
}
|
|
1683
1683
|
return c;
|
|
1684
|
-
}).then((c) =>
|
|
1684
|
+
}).then((c) => N.mergeObjectSync(n, c)) : N.mergeObjectSync(n, d);
|
|
1685
1685
|
}
|
|
1686
1686
|
get shape() {
|
|
1687
1687
|
return this._def.shape();
|
|
1688
1688
|
}
|
|
1689
1689
|
strict(e) {
|
|
1690
|
-
return m.errToObj, new
|
|
1690
|
+
return m.errToObj, new E({
|
|
1691
1691
|
...this._def,
|
|
1692
1692
|
unknownKeys: "strict",
|
|
1693
1693
|
...e !== void 0 ? {
|
|
@@ -1704,13 +1704,13 @@ var hs = wr((gs, yt) => {
|
|
|
1704
1704
|
});
|
|
1705
1705
|
}
|
|
1706
1706
|
strip() {
|
|
1707
|
-
return new
|
|
1707
|
+
return new E({
|
|
1708
1708
|
...this._def,
|
|
1709
1709
|
unknownKeys: "strip"
|
|
1710
1710
|
});
|
|
1711
1711
|
}
|
|
1712
1712
|
passthrough() {
|
|
1713
|
-
return new
|
|
1713
|
+
return new E({
|
|
1714
1714
|
...this._def,
|
|
1715
1715
|
unknownKeys: "passthrough"
|
|
1716
1716
|
});
|
|
@@ -1733,7 +1733,7 @@ var hs = wr((gs, yt) => {
|
|
|
1733
1733
|
// }) as any;
|
|
1734
1734
|
// };
|
|
1735
1735
|
extend(e) {
|
|
1736
|
-
return new
|
|
1736
|
+
return new E({
|
|
1737
1737
|
...this._def,
|
|
1738
1738
|
shape: () => ({
|
|
1739
1739
|
...this._def.shape(),
|
|
@@ -1747,7 +1747,7 @@ var hs = wr((gs, yt) => {
|
|
|
1747
1747
|
* upgrade if you are experiencing issues.
|
|
1748
1748
|
*/
|
|
1749
1749
|
merge(e) {
|
|
1750
|
-
return new
|
|
1750
|
+
return new E({
|
|
1751
1751
|
unknownKeys: e._def.unknownKeys,
|
|
1752
1752
|
catchall: e._def.catchall,
|
|
1753
1753
|
shape: () => ({
|
|
@@ -1817,7 +1817,7 @@ var hs = wr((gs, yt) => {
|
|
|
1817
1817
|
// return merged;
|
|
1818
1818
|
// }
|
|
1819
1819
|
catchall(e) {
|
|
1820
|
-
return new
|
|
1820
|
+
return new E({
|
|
1821
1821
|
...this._def,
|
|
1822
1822
|
catchall: e
|
|
1823
1823
|
});
|
|
@@ -1826,7 +1826,7 @@ var hs = wr((gs, yt) => {
|
|
|
1826
1826
|
const r = {};
|
|
1827
1827
|
return k.objectKeys(e).forEach((n) => {
|
|
1828
1828
|
e[n] && this.shape[n] && (r[n] = this.shape[n]);
|
|
1829
|
-
}), new
|
|
1829
|
+
}), new E({
|
|
1830
1830
|
...this._def,
|
|
1831
1831
|
shape: () => r
|
|
1832
1832
|
});
|
|
@@ -1835,7 +1835,7 @@ var hs = wr((gs, yt) => {
|
|
|
1835
1835
|
const r = {};
|
|
1836
1836
|
return k.objectKeys(this.shape).forEach((n) => {
|
|
1837
1837
|
e[n] || (r[n] = this.shape[n]);
|
|
1838
|
-
}), new
|
|
1838
|
+
}), new E({
|
|
1839
1839
|
...this._def,
|
|
1840
1840
|
shape: () => r
|
|
1841
1841
|
});
|
|
@@ -1844,14 +1844,14 @@ var hs = wr((gs, yt) => {
|
|
|
1844
1844
|
* @deprecated
|
|
1845
1845
|
*/
|
|
1846
1846
|
deepPartial() {
|
|
1847
|
-
return
|
|
1847
|
+
return de(this);
|
|
1848
1848
|
}
|
|
1849
1849
|
partial(e) {
|
|
1850
1850
|
const r = {};
|
|
1851
1851
|
return k.objectKeys(this.shape).forEach((n) => {
|
|
1852
1852
|
const s = this.shape[n];
|
|
1853
1853
|
e && !e[n] ? r[n] = s : r[n] = s.optional();
|
|
1854
|
-
}), new
|
|
1854
|
+
}), new E({
|
|
1855
1855
|
...this._def,
|
|
1856
1856
|
shape: () => r
|
|
1857
1857
|
});
|
|
@@ -1863,41 +1863,41 @@ var hs = wr((gs, yt) => {
|
|
|
1863
1863
|
r[n] = this.shape[n];
|
|
1864
1864
|
else {
|
|
1865
1865
|
let a = this.shape[n];
|
|
1866
|
-
for (; a instanceof
|
|
1866
|
+
for (; a instanceof F; )
|
|
1867
1867
|
a = a._def.innerType;
|
|
1868
1868
|
r[n] = a;
|
|
1869
1869
|
}
|
|
1870
|
-
}), new
|
|
1870
|
+
}), new E({
|
|
1871
1871
|
...this._def,
|
|
1872
1872
|
shape: () => r
|
|
1873
1873
|
});
|
|
1874
1874
|
}
|
|
1875
1875
|
keyof() {
|
|
1876
|
-
return
|
|
1876
|
+
return jt(k.objectKeys(this.shape));
|
|
1877
1877
|
}
|
|
1878
1878
|
}
|
|
1879
|
-
|
|
1879
|
+
E.create = (t, e) => new E({
|
|
1880
1880
|
shape: () => t,
|
|
1881
1881
|
unknownKeys: "strip",
|
|
1882
1882
|
catchall: H.create(),
|
|
1883
1883
|
typeName: y.ZodObject,
|
|
1884
1884
|
..._(e)
|
|
1885
1885
|
});
|
|
1886
|
-
|
|
1886
|
+
E.strictCreate = (t, e) => new E({
|
|
1887
1887
|
shape: () => t,
|
|
1888
1888
|
unknownKeys: "strict",
|
|
1889
1889
|
catchall: H.create(),
|
|
1890
1890
|
typeName: y.ZodObject,
|
|
1891
1891
|
..._(e)
|
|
1892
1892
|
});
|
|
1893
|
-
|
|
1893
|
+
E.lazycreate = (t, e) => new E({
|
|
1894
1894
|
shape: t,
|
|
1895
1895
|
unknownKeys: "strip",
|
|
1896
1896
|
catchall: H.create(),
|
|
1897
1897
|
typeName: y.ZodObject,
|
|
1898
1898
|
..._(e)
|
|
1899
1899
|
});
|
|
1900
|
-
class
|
|
1900
|
+
class Re extends b {
|
|
1901
1901
|
_parse(e) {
|
|
1902
1902
|
const { ctx: r } = this._processInputParams(e), n = this._def.options;
|
|
1903
1903
|
function s(a) {
|
|
@@ -1907,7 +1907,7 @@ var hs = wr((gs, yt) => {
|
|
|
1907
1907
|
for (const o of a)
|
|
1908
1908
|
if (o.result.status === "dirty")
|
|
1909
1909
|
return r.common.issues.push(...o.ctx.common.issues), o.result;
|
|
1910
|
-
const i = a.map((o) => new
|
|
1910
|
+
const i = a.map((o) => new I(o.ctx.common.issues));
|
|
1911
1911
|
return f(r, {
|
|
1912
1912
|
code: u.invalid_union,
|
|
1913
1913
|
unionErrors: i
|
|
@@ -1954,7 +1954,7 @@ var hs = wr((gs, yt) => {
|
|
|
1954
1954
|
}
|
|
1955
1955
|
if (a)
|
|
1956
1956
|
return r.common.issues.push(...a.ctx.common.issues), a.result;
|
|
1957
|
-
const o = i.map((d) => new
|
|
1957
|
+
const o = i.map((d) => new I(d));
|
|
1958
1958
|
return f(r, {
|
|
1959
1959
|
code: u.invalid_union,
|
|
1960
1960
|
unionErrors: o
|
|
@@ -1965,13 +1965,13 @@ var hs = wr((gs, yt) => {
|
|
|
1965
1965
|
return this._def.options;
|
|
1966
1966
|
}
|
|
1967
1967
|
}
|
|
1968
|
-
|
|
1968
|
+
Re.create = (t, e) => new Re({
|
|
1969
1969
|
options: t,
|
|
1970
1970
|
typeName: y.ZodUnion,
|
|
1971
1971
|
..._(e)
|
|
1972
1972
|
});
|
|
1973
|
-
const
|
|
1974
|
-
class
|
|
1973
|
+
const q = (t) => t instanceof Ie ? q(t.schema) : t instanceof $ ? q(t.innerType()) : t instanceof Pe ? [t.value] : t instanceof G ? t.options : t instanceof je ? k.objectValues(t.enum) : t instanceof Ze ? q(t._def.innerType) : t instanceof Oe ? [void 0] : t instanceof Ne ? [null] : t instanceof F ? [void 0, ...q(t.unwrap())] : t instanceof K ? [null, ...q(t.unwrap())] : t instanceof mt || t instanceof Me ? q(t.unwrap()) : t instanceof $e ? q(t._def.innerType) : [];
|
|
1974
|
+
class et extends b {
|
|
1975
1975
|
_parse(e) {
|
|
1976
1976
|
const { ctx: r } = this._processInputParams(e);
|
|
1977
1977
|
if (r.parsedType !== p.object)
|
|
@@ -2015,7 +2015,7 @@ var hs = wr((gs, yt) => {
|
|
|
2015
2015
|
static create(e, r, n) {
|
|
2016
2016
|
const s = /* @__PURE__ */ new Map();
|
|
2017
2017
|
for (const a of r) {
|
|
2018
|
-
const i =
|
|
2018
|
+
const i = q(a.shape[e]);
|
|
2019
2019
|
if (!i.length)
|
|
2020
2020
|
throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);
|
|
2021
2021
|
for (const o of i) {
|
|
@@ -2024,7 +2024,7 @@ var hs = wr((gs, yt) => {
|
|
|
2024
2024
|
s.set(o, a);
|
|
2025
2025
|
}
|
|
2026
2026
|
}
|
|
2027
|
-
return new
|
|
2027
|
+
return new et({
|
|
2028
2028
|
typeName: y.ZodDiscriminatedUnion,
|
|
2029
2029
|
discriminator: e,
|
|
2030
2030
|
options: r,
|
|
@@ -2033,14 +2033,14 @@ var hs = wr((gs, yt) => {
|
|
|
2033
2033
|
});
|
|
2034
2034
|
}
|
|
2035
2035
|
}
|
|
2036
|
-
function
|
|
2037
|
-
const r =
|
|
2036
|
+
function dt(t, e) {
|
|
2037
|
+
const r = U(t), n = U(e);
|
|
2038
2038
|
if (t === e)
|
|
2039
2039
|
return { valid: !0, data: t };
|
|
2040
2040
|
if (r === p.object && n === p.object) {
|
|
2041
2041
|
const s = k.objectKeys(e), a = k.objectKeys(t).filter((o) => s.indexOf(o) !== -1), i = { ...t, ...e };
|
|
2042
2042
|
for (const o of a) {
|
|
2043
|
-
const d =
|
|
2043
|
+
const d = dt(t[o], e[o]);
|
|
2044
2044
|
if (!d.valid)
|
|
2045
2045
|
return { valid: !1 };
|
|
2046
2046
|
i[o] = d.data;
|
|
@@ -2051,7 +2051,7 @@ var hs = wr((gs, yt) => {
|
|
|
2051
2051
|
return { valid: !1 };
|
|
2052
2052
|
const s = [];
|
|
2053
2053
|
for (let a = 0; a < t.length; a++) {
|
|
2054
|
-
const i = t[a], o = e[a], d =
|
|
2054
|
+
const i = t[a], o = e[a], d = dt(i, o);
|
|
2055
2055
|
if (!d.valid)
|
|
2056
2056
|
return { valid: !1 };
|
|
2057
2057
|
s.push(d.data);
|
|
@@ -2059,13 +2059,13 @@ var hs = wr((gs, yt) => {
|
|
|
2059
2059
|
return { valid: !0, data: s };
|
|
2060
2060
|
} else return r === p.date && n === p.date && +t == +e ? { valid: !0, data: t } : { valid: !1 };
|
|
2061
2061
|
}
|
|
2062
|
-
class
|
|
2062
|
+
class Ae extends b {
|
|
2063
2063
|
_parse(e) {
|
|
2064
2064
|
const { status: r, ctx: n } = this._processInputParams(e), s = (a, i) => {
|
|
2065
|
-
if (
|
|
2065
|
+
if (it(a) || it(i))
|
|
2066
2066
|
return g;
|
|
2067
|
-
const o =
|
|
2068
|
-
return o.valid ? ((
|
|
2067
|
+
const o = dt(a.value, i.value);
|
|
2068
|
+
return o.valid ? ((ot(a) || ot(i)) && r.dirty(), { status: r.value, value: o.data }) : (f(n, {
|
|
2069
2069
|
code: u.invalid_intersection_types
|
|
2070
2070
|
}), g);
|
|
2071
2071
|
};
|
|
@@ -2091,13 +2091,13 @@ var hs = wr((gs, yt) => {
|
|
|
2091
2091
|
}));
|
|
2092
2092
|
}
|
|
2093
2093
|
}
|
|
2094
|
-
|
|
2094
|
+
Ae.create = (t, e, r) => new Ae({
|
|
2095
2095
|
left: t,
|
|
2096
2096
|
right: e,
|
|
2097
2097
|
typeName: y.ZodIntersection,
|
|
2098
2098
|
..._(r)
|
|
2099
2099
|
});
|
|
2100
|
-
class
|
|
2100
|
+
class L extends b {
|
|
2101
2101
|
_parse(e) {
|
|
2102
2102
|
const { status: r, ctx: n } = this._processInputParams(e);
|
|
2103
2103
|
if (n.parsedType !== p.array)
|
|
@@ -2123,31 +2123,31 @@ var hs = wr((gs, yt) => {
|
|
|
2123
2123
|
}), r.dirty());
|
|
2124
2124
|
const a = [...n.data].map((i, o) => {
|
|
2125
2125
|
const d = this._def.items[o] || this._def.rest;
|
|
2126
|
-
return d ? d._parse(new
|
|
2126
|
+
return d ? d._parse(new D(n, i, n.path, o)) : null;
|
|
2127
2127
|
}).filter((i) => !!i);
|
|
2128
|
-
return n.common.async ? Promise.all(a).then((i) =>
|
|
2128
|
+
return n.common.async ? Promise.all(a).then((i) => N.mergeArray(r, i)) : N.mergeArray(r, a);
|
|
2129
2129
|
}
|
|
2130
2130
|
get items() {
|
|
2131
2131
|
return this._def.items;
|
|
2132
2132
|
}
|
|
2133
2133
|
rest(e) {
|
|
2134
|
-
return new
|
|
2134
|
+
return new L({
|
|
2135
2135
|
...this._def,
|
|
2136
2136
|
rest: e
|
|
2137
2137
|
});
|
|
2138
2138
|
}
|
|
2139
2139
|
}
|
|
2140
|
-
|
|
2140
|
+
L.create = (t, e) => {
|
|
2141
2141
|
if (!Array.isArray(t))
|
|
2142
2142
|
throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
|
|
2143
|
-
return new
|
|
2143
|
+
return new L({
|
|
2144
2144
|
items: t,
|
|
2145
2145
|
typeName: y.ZodTuple,
|
|
2146
2146
|
rest: null,
|
|
2147
2147
|
..._(e)
|
|
2148
2148
|
});
|
|
2149
2149
|
};
|
|
2150
|
-
class
|
|
2150
|
+
class Ce extends b {
|
|
2151
2151
|
get keySchema() {
|
|
2152
2152
|
return this._def.keyType;
|
|
2153
2153
|
}
|
|
@@ -2165,30 +2165,30 @@ var hs = wr((gs, yt) => {
|
|
|
2165
2165
|
const s = [], a = this._def.keyType, i = this._def.valueType;
|
|
2166
2166
|
for (const o in n.data)
|
|
2167
2167
|
s.push({
|
|
2168
|
-
key: a._parse(new
|
|
2169
|
-
value: i._parse(new
|
|
2168
|
+
key: a._parse(new D(n, o, n.path, o)),
|
|
2169
|
+
value: i._parse(new D(n, n.data[o], n.path, o)),
|
|
2170
2170
|
alwaysSet: o in n.data
|
|
2171
2171
|
});
|
|
2172
|
-
return n.common.async ?
|
|
2172
|
+
return n.common.async ? N.mergeObjectAsync(r, s) : N.mergeObjectSync(r, s);
|
|
2173
2173
|
}
|
|
2174
2174
|
get element() {
|
|
2175
2175
|
return this._def.valueType;
|
|
2176
2176
|
}
|
|
2177
2177
|
static create(e, r, n) {
|
|
2178
|
-
return r instanceof
|
|
2178
|
+
return r instanceof b ? new Ce({
|
|
2179
2179
|
keyType: e,
|
|
2180
2180
|
valueType: r,
|
|
2181
2181
|
typeName: y.ZodRecord,
|
|
2182
2182
|
..._(n)
|
|
2183
|
-
}) : new
|
|
2184
|
-
keyType:
|
|
2183
|
+
}) : new Ce({
|
|
2184
|
+
keyType: j.create(),
|
|
2185
2185
|
valueType: e,
|
|
2186
2186
|
typeName: y.ZodRecord,
|
|
2187
2187
|
..._(r)
|
|
2188
2188
|
});
|
|
2189
2189
|
}
|
|
2190
2190
|
}
|
|
2191
|
-
class
|
|
2191
|
+
class Ye extends b {
|
|
2192
2192
|
get keySchema() {
|
|
2193
2193
|
return this._def.keyType;
|
|
2194
2194
|
}
|
|
@@ -2204,8 +2204,8 @@ var hs = wr((gs, yt) => {
|
|
|
2204
2204
|
received: n.parsedType
|
|
2205
2205
|
}), g;
|
|
2206
2206
|
const s = this._def.keyType, a = this._def.valueType, i = [...n.data.entries()].map(([o, d], c) => ({
|
|
2207
|
-
key: s._parse(new
|
|
2208
|
-
value: a._parse(new
|
|
2207
|
+
key: s._parse(new D(n, o, n.path, [c, "key"])),
|
|
2208
|
+
value: a._parse(new D(n, d, n.path, [c, "value"]))
|
|
2209
2209
|
}));
|
|
2210
2210
|
if (n.common.async) {
|
|
2211
2211
|
const o = /* @__PURE__ */ new Map();
|
|
@@ -2230,13 +2230,13 @@ var hs = wr((gs, yt) => {
|
|
|
2230
2230
|
}
|
|
2231
2231
|
}
|
|
2232
2232
|
}
|
|
2233
|
-
|
|
2233
|
+
Ye.create = (t, e, r) => new Ye({
|
|
2234
2234
|
valueType: e,
|
|
2235
2235
|
keyType: t,
|
|
2236
2236
|
typeName: y.ZodMap,
|
|
2237
2237
|
..._(r)
|
|
2238
2238
|
});
|
|
2239
|
-
class
|
|
2239
|
+
class oe extends b {
|
|
2240
2240
|
_parse(e) {
|
|
2241
2241
|
const { status: r, ctx: n } = this._processInputParams(e);
|
|
2242
2242
|
if (n.parsedType !== p.set)
|
|
@@ -2271,17 +2271,17 @@ var hs = wr((gs, yt) => {
|
|
|
2271
2271
|
}
|
|
2272
2272
|
return { status: r.value, value: c };
|
|
2273
2273
|
}
|
|
2274
|
-
const o = [...n.data.values()].map((d, c) => a._parse(new
|
|
2274
|
+
const o = [...n.data.values()].map((d, c) => a._parse(new D(n, d, n.path, c)));
|
|
2275
2275
|
return n.common.async ? Promise.all(o).then((d) => i(d)) : i(o);
|
|
2276
2276
|
}
|
|
2277
2277
|
min(e, r) {
|
|
2278
|
-
return new
|
|
2278
|
+
return new oe({
|
|
2279
2279
|
...this._def,
|
|
2280
2280
|
minSize: { value: e, message: m.toString(r) }
|
|
2281
2281
|
});
|
|
2282
2282
|
}
|
|
2283
2283
|
max(e, r) {
|
|
2284
|
-
return new
|
|
2284
|
+
return new oe({
|
|
2285
2285
|
...this._def,
|
|
2286
2286
|
maxSize: { value: e, message: m.toString(r) }
|
|
2287
2287
|
});
|
|
@@ -2293,14 +2293,14 @@ var hs = wr((gs, yt) => {
|
|
|
2293
2293
|
return this.min(1, e);
|
|
2294
2294
|
}
|
|
2295
2295
|
}
|
|
2296
|
-
|
|
2296
|
+
oe.create = (t, e) => new oe({
|
|
2297
2297
|
valueType: t,
|
|
2298
2298
|
minSize: null,
|
|
2299
2299
|
maxSize: null,
|
|
2300
2300
|
typeName: y.ZodSet,
|
|
2301
2301
|
..._(e)
|
|
2302
2302
|
});
|
|
2303
|
-
class
|
|
2303
|
+
class he extends b {
|
|
2304
2304
|
constructor() {
|
|
2305
2305
|
super(...arguments), this.validate = this.implement;
|
|
2306
2306
|
}
|
|
@@ -2313,14 +2313,14 @@ var hs = wr((gs, yt) => {
|
|
|
2313
2313
|
received: r.parsedType
|
|
2314
2314
|
}), g;
|
|
2315
2315
|
function n(o, d) {
|
|
2316
|
-
return
|
|
2316
|
+
return He({
|
|
2317
2317
|
data: o,
|
|
2318
2318
|
path: r.path,
|
|
2319
2319
|
errorMaps: [
|
|
2320
2320
|
r.common.contextualErrorMap,
|
|
2321
2321
|
r.schemaErrorMap,
|
|
2322
|
-
|
|
2323
|
-
|
|
2322
|
+
Ue(),
|
|
2323
|
+
me
|
|
2324
2324
|
].filter((c) => !!c),
|
|
2325
2325
|
issueData: {
|
|
2326
2326
|
code: u.invalid_arguments,
|
|
@@ -2329,14 +2329,14 @@ var hs = wr((gs, yt) => {
|
|
|
2329
2329
|
});
|
|
2330
2330
|
}
|
|
2331
2331
|
function s(o, d) {
|
|
2332
|
-
return
|
|
2332
|
+
return He({
|
|
2333
2333
|
data: o,
|
|
2334
2334
|
path: r.path,
|
|
2335
2335
|
errorMaps: [
|
|
2336
2336
|
r.common.contextualErrorMap,
|
|
2337
2337
|
r.schemaErrorMap,
|
|
2338
|
-
|
|
2339
|
-
|
|
2338
|
+
Ue(),
|
|
2339
|
+
me
|
|
2340
2340
|
].filter((c) => !!c),
|
|
2341
2341
|
issueData: {
|
|
2342
2342
|
code: u.invalid_return_type,
|
|
@@ -2345,26 +2345,26 @@ var hs = wr((gs, yt) => {
|
|
|
2345
2345
|
});
|
|
2346
2346
|
}
|
|
2347
2347
|
const a = { errorMap: r.common.contextualErrorMap }, i = r.data;
|
|
2348
|
-
if (this._def.returns instanceof
|
|
2348
|
+
if (this._def.returns instanceof ge) {
|
|
2349
2349
|
const o = this;
|
|
2350
|
-
return
|
|
2351
|
-
const c = new
|
|
2352
|
-
throw c.addIssue(n(d,
|
|
2353
|
-
}),
|
|
2354
|
-
return await o._def.returns._def.type.parseAsync(
|
|
2355
|
-
throw c.addIssue(s(
|
|
2350
|
+
return A(async function(...d) {
|
|
2351
|
+
const c = new I([]), l = await o._def.args.parseAsync(d, a).catch((C) => {
|
|
2352
|
+
throw c.addIssue(n(d, C)), c;
|
|
2353
|
+
}), w = await Reflect.apply(i, this, l);
|
|
2354
|
+
return await o._def.returns._def.type.parseAsync(w, a).catch((C) => {
|
|
2355
|
+
throw c.addIssue(s(w, C)), c;
|
|
2356
2356
|
});
|
|
2357
2357
|
});
|
|
2358
2358
|
} else {
|
|
2359
2359
|
const o = this;
|
|
2360
|
-
return
|
|
2360
|
+
return A(function(...d) {
|
|
2361
2361
|
const c = o._def.args.safeParse(d, a);
|
|
2362
2362
|
if (!c.success)
|
|
2363
|
-
throw new
|
|
2364
|
-
const l = Reflect.apply(i, this, c.data),
|
|
2365
|
-
if (!
|
|
2366
|
-
throw new
|
|
2367
|
-
return
|
|
2363
|
+
throw new I([n(d, c.error)]);
|
|
2364
|
+
const l = Reflect.apply(i, this, c.data), w = o._def.returns.safeParse(l, a);
|
|
2365
|
+
if (!w.success)
|
|
2366
|
+
throw new I([s(l, w.error)]);
|
|
2367
|
+
return w.data;
|
|
2368
2368
|
});
|
|
2369
2369
|
}
|
|
2370
2370
|
}
|
|
@@ -2375,13 +2375,13 @@ var hs = wr((gs, yt) => {
|
|
|
2375
2375
|
return this._def.returns;
|
|
2376
2376
|
}
|
|
2377
2377
|
args(...e) {
|
|
2378
|
-
return new
|
|
2378
|
+
return new he({
|
|
2379
2379
|
...this._def,
|
|
2380
|
-
args:
|
|
2380
|
+
args: L.create(e).rest(se.create())
|
|
2381
2381
|
});
|
|
2382
2382
|
}
|
|
2383
2383
|
returns(e) {
|
|
2384
|
-
return new
|
|
2384
|
+
return new he({
|
|
2385
2385
|
...this._def,
|
|
2386
2386
|
returns: e
|
|
2387
2387
|
});
|
|
@@ -2393,15 +2393,15 @@ var hs = wr((gs, yt) => {
|
|
|
2393
2393
|
return this.parse(e);
|
|
2394
2394
|
}
|
|
2395
2395
|
static create(e, r, n) {
|
|
2396
|
-
return new
|
|
2397
|
-
args: e ||
|
|
2398
|
-
returns: r ||
|
|
2396
|
+
return new he({
|
|
2397
|
+
args: e || L.create([]).rest(se.create()),
|
|
2398
|
+
returns: r || se.create(),
|
|
2399
2399
|
typeName: y.ZodFunction,
|
|
2400
2400
|
..._(n)
|
|
2401
2401
|
});
|
|
2402
2402
|
}
|
|
2403
2403
|
}
|
|
2404
|
-
class
|
|
2404
|
+
class Ie extends b {
|
|
2405
2405
|
get schema() {
|
|
2406
2406
|
return this._def.getter();
|
|
2407
2407
|
}
|
|
@@ -2410,12 +2410,12 @@ var hs = wr((gs, yt) => {
|
|
|
2410
2410
|
return this._def.getter()._parse({ data: r.data, path: r.path, parent: r });
|
|
2411
2411
|
}
|
|
2412
2412
|
}
|
|
2413
|
-
|
|
2413
|
+
Ie.create = (t, e) => new Ie({
|
|
2414
2414
|
getter: t,
|
|
2415
2415
|
typeName: y.ZodLazy,
|
|
2416
2416
|
..._(e)
|
|
2417
2417
|
});
|
|
2418
|
-
class
|
|
2418
|
+
class Pe extends b {
|
|
2419
2419
|
_parse(e) {
|
|
2420
2420
|
if (e.data !== this._def.value) {
|
|
2421
2421
|
const r = this._getOrReturnCtx(e);
|
|
@@ -2431,21 +2431,21 @@ var hs = wr((gs, yt) => {
|
|
|
2431
2431
|
return this._def.value;
|
|
2432
2432
|
}
|
|
2433
2433
|
}
|
|
2434
|
-
|
|
2434
|
+
Pe.create = (t, e) => new Pe({
|
|
2435
2435
|
value: t,
|
|
2436
2436
|
typeName: y.ZodLiteral,
|
|
2437
2437
|
..._(e)
|
|
2438
2438
|
});
|
|
2439
|
-
function
|
|
2439
|
+
function jt(t, e) {
|
|
2440
2440
|
return new G({
|
|
2441
2441
|
values: t,
|
|
2442
2442
|
typeName: y.ZodEnum,
|
|
2443
2443
|
..._(e)
|
|
2444
2444
|
});
|
|
2445
2445
|
}
|
|
2446
|
-
class G extends
|
|
2446
|
+
class G extends b {
|
|
2447
2447
|
constructor() {
|
|
2448
|
-
super(...arguments),
|
|
2448
|
+
super(...arguments), ke.set(this, void 0);
|
|
2449
2449
|
}
|
|
2450
2450
|
_parse(e) {
|
|
2451
2451
|
if (typeof e.data != "string") {
|
|
@@ -2456,7 +2456,7 @@ var hs = wr((gs, yt) => {
|
|
|
2456
2456
|
code: u.invalid_type
|
|
2457
2457
|
}), g;
|
|
2458
2458
|
}
|
|
2459
|
-
if (
|
|
2459
|
+
if (Be(this, ke) || At(this, ke, new Set(this._def.values)), !Be(this, ke).has(e.data)) {
|
|
2460
2460
|
const r = this._getOrReturnCtx(e), n = this._def.values;
|
|
2461
2461
|
return f(r, {
|
|
2462
2462
|
received: r.data,
|
|
@@ -2464,7 +2464,7 @@ var hs = wr((gs, yt) => {
|
|
|
2464
2464
|
options: n
|
|
2465
2465
|
}), g;
|
|
2466
2466
|
}
|
|
2467
|
-
return
|
|
2467
|
+
return A(e.data);
|
|
2468
2468
|
}
|
|
2469
2469
|
get options() {
|
|
2470
2470
|
return this._def.values;
|
|
@@ -2500,11 +2500,11 @@ var hs = wr((gs, yt) => {
|
|
|
2500
2500
|
});
|
|
2501
2501
|
}
|
|
2502
2502
|
}
|
|
2503
|
-
|
|
2504
|
-
G.create =
|
|
2505
|
-
class
|
|
2503
|
+
ke = /* @__PURE__ */ new WeakMap();
|
|
2504
|
+
G.create = jt;
|
|
2505
|
+
class je extends b {
|
|
2506
2506
|
constructor() {
|
|
2507
|
-
super(...arguments),
|
|
2507
|
+
super(...arguments), xe.set(this, void 0);
|
|
2508
2508
|
}
|
|
2509
2509
|
_parse(e) {
|
|
2510
2510
|
const r = k.getValidEnumValues(this._def.values), n = this._getOrReturnCtx(e);
|
|
@@ -2516,7 +2516,7 @@ var hs = wr((gs, yt) => {
|
|
|
2516
2516
|
code: u.invalid_type
|
|
2517
2517
|
}), g;
|
|
2518
2518
|
}
|
|
2519
|
-
if (
|
|
2519
|
+
if (Be(this, xe) || At(this, xe, new Set(k.getValidEnumValues(this._def.values))), !Be(this, xe).has(e.data)) {
|
|
2520
2520
|
const s = k.objectValues(r);
|
|
2521
2521
|
return f(n, {
|
|
2522
2522
|
received: n.data,
|
|
@@ -2524,19 +2524,19 @@ var hs = wr((gs, yt) => {
|
|
|
2524
2524
|
options: s
|
|
2525
2525
|
}), g;
|
|
2526
2526
|
}
|
|
2527
|
-
return
|
|
2527
|
+
return A(e.data);
|
|
2528
2528
|
}
|
|
2529
2529
|
get enum() {
|
|
2530
2530
|
return this._def.values;
|
|
2531
2531
|
}
|
|
2532
2532
|
}
|
|
2533
|
-
|
|
2534
|
-
|
|
2533
|
+
xe = /* @__PURE__ */ new WeakMap();
|
|
2534
|
+
je.create = (t, e) => new je({
|
|
2535
2535
|
values: t,
|
|
2536
2536
|
typeName: y.ZodNativeEnum,
|
|
2537
2537
|
..._(e)
|
|
2538
2538
|
});
|
|
2539
|
-
class
|
|
2539
|
+
class ge extends b {
|
|
2540
2540
|
unwrap() {
|
|
2541
2541
|
return this._def.type;
|
|
2542
2542
|
}
|
|
@@ -2549,18 +2549,18 @@ var hs = wr((gs, yt) => {
|
|
|
2549
2549
|
received: r.parsedType
|
|
2550
2550
|
}), g;
|
|
2551
2551
|
const n = r.parsedType === p.promise ? r.data : Promise.resolve(r.data);
|
|
2552
|
-
return
|
|
2552
|
+
return A(n.then((s) => this._def.type.parseAsync(s, {
|
|
2553
2553
|
path: r.path,
|
|
2554
2554
|
errorMap: r.common.contextualErrorMap
|
|
2555
2555
|
})));
|
|
2556
2556
|
}
|
|
2557
2557
|
}
|
|
2558
|
-
|
|
2558
|
+
ge.create = (t, e) => new ge({
|
|
2559
2559
|
type: t,
|
|
2560
2560
|
typeName: y.ZodPromise,
|
|
2561
2561
|
..._(e)
|
|
2562
2562
|
});
|
|
2563
|
-
class
|
|
2563
|
+
class $ extends b {
|
|
2564
2564
|
innerType() {
|
|
2565
2565
|
return this._def.schema;
|
|
2566
2566
|
}
|
|
@@ -2587,7 +2587,7 @@ var hs = wr((gs, yt) => {
|
|
|
2587
2587
|
path: n.path,
|
|
2588
2588
|
parent: n
|
|
2589
2589
|
});
|
|
2590
|
-
return d.status === "aborted" ? g : d.status === "dirty" || r.value === "dirty" ?
|
|
2590
|
+
return d.status === "aborted" ? g : d.status === "dirty" || r.value === "dirty" ? pe(d.value) : d;
|
|
2591
2591
|
});
|
|
2592
2592
|
{
|
|
2593
2593
|
if (r.value === "aborted")
|
|
@@ -2597,7 +2597,7 @@ var hs = wr((gs, yt) => {
|
|
|
2597
2597
|
path: n.path,
|
|
2598
2598
|
parent: n
|
|
2599
2599
|
});
|
|
2600
|
-
return o.status === "aborted" ? g : o.status === "dirty" || r.value === "dirty" ?
|
|
2600
|
+
return o.status === "aborted" ? g : o.status === "dirty" || r.value === "dirty" ? pe(o.value) : o;
|
|
2601
2601
|
}
|
|
2602
2602
|
}
|
|
2603
2603
|
if (s.type === "refinement") {
|
|
@@ -2626,45 +2626,45 @@ var hs = wr((gs, yt) => {
|
|
|
2626
2626
|
path: n.path,
|
|
2627
2627
|
parent: n
|
|
2628
2628
|
});
|
|
2629
|
-
if (!
|
|
2629
|
+
if (!ae(i))
|
|
2630
2630
|
return i;
|
|
2631
2631
|
const o = s.transform(i.value, a);
|
|
2632
2632
|
if (o instanceof Promise)
|
|
2633
2633
|
throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
|
|
2634
2634
|
return { status: r.value, value: o };
|
|
2635
2635
|
} else
|
|
2636
|
-
return this._def.schema._parseAsync({ data: n.data, path: n.path, parent: n }).then((i) =>
|
|
2636
|
+
return this._def.schema._parseAsync({ data: n.data, path: n.path, parent: n }).then((i) => ae(i) ? Promise.resolve(s.transform(i.value, a)).then((o) => ({ status: r.value, value: o })) : i);
|
|
2637
2637
|
k.assertNever(s);
|
|
2638
2638
|
}
|
|
2639
2639
|
}
|
|
2640
|
-
|
|
2640
|
+
$.create = (t, e, r) => new $({
|
|
2641
2641
|
schema: t,
|
|
2642
2642
|
typeName: y.ZodEffects,
|
|
2643
2643
|
effect: e,
|
|
2644
2644
|
..._(r)
|
|
2645
2645
|
});
|
|
2646
|
-
|
|
2646
|
+
$.createWithPreprocess = (t, e, r) => new $({
|
|
2647
2647
|
schema: e,
|
|
2648
2648
|
effect: { type: "preprocess", transform: t },
|
|
2649
2649
|
typeName: y.ZodEffects,
|
|
2650
2650
|
..._(r)
|
|
2651
2651
|
});
|
|
2652
|
-
class
|
|
2652
|
+
class F extends b {
|
|
2653
2653
|
_parse(e) {
|
|
2654
|
-
return this._getType(e) === p.undefined ?
|
|
2654
|
+
return this._getType(e) === p.undefined ? A(void 0) : this._def.innerType._parse(e);
|
|
2655
2655
|
}
|
|
2656
2656
|
unwrap() {
|
|
2657
2657
|
return this._def.innerType;
|
|
2658
2658
|
}
|
|
2659
2659
|
}
|
|
2660
|
-
|
|
2660
|
+
F.create = (t, e) => new F({
|
|
2661
2661
|
innerType: t,
|
|
2662
2662
|
typeName: y.ZodOptional,
|
|
2663
2663
|
..._(e)
|
|
2664
2664
|
});
|
|
2665
|
-
class K extends
|
|
2665
|
+
class K extends b {
|
|
2666
2666
|
_parse(e) {
|
|
2667
|
-
return this._getType(e) === p.null ?
|
|
2667
|
+
return this._getType(e) === p.null ? A(null) : this._def.innerType._parse(e);
|
|
2668
2668
|
}
|
|
2669
2669
|
unwrap() {
|
|
2670
2670
|
return this._def.innerType;
|
|
@@ -2675,7 +2675,7 @@ var hs = wr((gs, yt) => {
|
|
|
2675
2675
|
typeName: y.ZodNullable,
|
|
2676
2676
|
..._(e)
|
|
2677
2677
|
});
|
|
2678
|
-
class
|
|
2678
|
+
class Ze extends b {
|
|
2679
2679
|
_parse(e) {
|
|
2680
2680
|
const { ctx: r } = this._processInputParams(e);
|
|
2681
2681
|
let n = r.data;
|
|
@@ -2689,13 +2689,13 @@ var hs = wr((gs, yt) => {
|
|
|
2689
2689
|
return this._def.innerType;
|
|
2690
2690
|
}
|
|
2691
2691
|
}
|
|
2692
|
-
|
|
2692
|
+
Ze.create = (t, e) => new Ze({
|
|
2693
2693
|
innerType: t,
|
|
2694
2694
|
typeName: y.ZodDefault,
|
|
2695
2695
|
defaultValue: typeof e.default == "function" ? e.default : () => e.default,
|
|
2696
2696
|
..._(e)
|
|
2697
2697
|
});
|
|
2698
|
-
class
|
|
2698
|
+
class $e extends b {
|
|
2699
2699
|
_parse(e) {
|
|
2700
2700
|
const { ctx: r } = this._processInputParams(e), n = {
|
|
2701
2701
|
...r,
|
|
@@ -2710,11 +2710,11 @@ var hs = wr((gs, yt) => {
|
|
|
2710
2710
|
...n
|
|
2711
2711
|
}
|
|
2712
2712
|
});
|
|
2713
|
-
return
|
|
2713
|
+
return Te(s) ? s.then((a) => ({
|
|
2714
2714
|
status: "valid",
|
|
2715
2715
|
value: a.status === "valid" ? a.value : this._def.catchValue({
|
|
2716
2716
|
get error() {
|
|
2717
|
-
return new
|
|
2717
|
+
return new I(n.common.issues);
|
|
2718
2718
|
},
|
|
2719
2719
|
input: n.data
|
|
2720
2720
|
})
|
|
@@ -2722,7 +2722,7 @@ var hs = wr((gs, yt) => {
|
|
|
2722
2722
|
status: "valid",
|
|
2723
2723
|
value: s.status === "valid" ? s.value : this._def.catchValue({
|
|
2724
2724
|
get error() {
|
|
2725
|
-
return new
|
|
2725
|
+
return new I(n.common.issues);
|
|
2726
2726
|
},
|
|
2727
2727
|
input: n.data
|
|
2728
2728
|
})
|
|
@@ -2732,13 +2732,13 @@ var hs = wr((gs, yt) => {
|
|
|
2732
2732
|
return this._def.innerType;
|
|
2733
2733
|
}
|
|
2734
2734
|
}
|
|
2735
|
-
|
|
2735
|
+
$e.create = (t, e) => new $e({
|
|
2736
2736
|
innerType: t,
|
|
2737
2737
|
typeName: y.ZodCatch,
|
|
2738
2738
|
catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
|
|
2739
2739
|
..._(e)
|
|
2740
2740
|
});
|
|
2741
|
-
class
|
|
2741
|
+
class Ge extends b {
|
|
2742
2742
|
_parse(e) {
|
|
2743
2743
|
if (this._getType(e) !== p.nan) {
|
|
2744
2744
|
const n = this._getOrReturnCtx(e);
|
|
@@ -2751,12 +2751,12 @@ var hs = wr((gs, yt) => {
|
|
|
2751
2751
|
return { status: "valid", value: e.data };
|
|
2752
2752
|
}
|
|
2753
2753
|
}
|
|
2754
|
-
|
|
2754
|
+
Ge.create = (t) => new Ge({
|
|
2755
2755
|
typeName: y.ZodNaN,
|
|
2756
2756
|
..._(t)
|
|
2757
2757
|
});
|
|
2758
2758
|
const Hr = Symbol("zod_brand");
|
|
2759
|
-
class
|
|
2759
|
+
class mt extends b {
|
|
2760
2760
|
_parse(e) {
|
|
2761
2761
|
const { ctx: r } = this._processInputParams(e), n = r.data;
|
|
2762
2762
|
return this._def.type._parse({
|
|
@@ -2769,7 +2769,7 @@ var hs = wr((gs, yt) => {
|
|
|
2769
2769
|
return this._def.type;
|
|
2770
2770
|
}
|
|
2771
2771
|
}
|
|
2772
|
-
class
|
|
2772
|
+
class Fe extends b {
|
|
2773
2773
|
_parse(e) {
|
|
2774
2774
|
const { status: r, ctx: n } = this._processInputParams(e);
|
|
2775
2775
|
if (n.common.async)
|
|
@@ -2779,7 +2779,7 @@ var hs = wr((gs, yt) => {
|
|
|
2779
2779
|
path: n.path,
|
|
2780
2780
|
parent: n
|
|
2781
2781
|
});
|
|
2782
|
-
return a.status === "aborted" ? g : a.status === "dirty" ? (r.dirty(),
|
|
2782
|
+
return a.status === "aborted" ? g : a.status === "dirty" ? (r.dirty(), pe(a.value)) : this._def.out._parseAsync({
|
|
2783
2783
|
data: a.value,
|
|
2784
2784
|
path: n.path,
|
|
2785
2785
|
parent: n
|
|
@@ -2802,201 +2802,201 @@ var hs = wr((gs, yt) => {
|
|
|
2802
2802
|
}
|
|
2803
2803
|
}
|
|
2804
2804
|
static create(e, r) {
|
|
2805
|
-
return new
|
|
2805
|
+
return new Fe({
|
|
2806
2806
|
in: e,
|
|
2807
2807
|
out: r,
|
|
2808
2808
|
typeName: y.ZodPipeline
|
|
2809
2809
|
});
|
|
2810
2810
|
}
|
|
2811
2811
|
}
|
|
2812
|
-
class
|
|
2812
|
+
class Me extends b {
|
|
2813
2813
|
_parse(e) {
|
|
2814
|
-
const r = this._def.innerType._parse(e), n = (s) => (
|
|
2815
|
-
return
|
|
2814
|
+
const r = this._def.innerType._parse(e), n = (s) => (ae(s) && (s.value = Object.freeze(s.value)), s);
|
|
2815
|
+
return Te(r) ? r.then((s) => n(s)) : n(r);
|
|
2816
2816
|
}
|
|
2817
2817
|
unwrap() {
|
|
2818
2818
|
return this._def.innerType;
|
|
2819
2819
|
}
|
|
2820
2820
|
}
|
|
2821
|
-
|
|
2821
|
+
Me.create = (t, e) => new Me({
|
|
2822
2822
|
innerType: t,
|
|
2823
2823
|
typeName: y.ZodReadonly,
|
|
2824
2824
|
..._(e)
|
|
2825
2825
|
});
|
|
2826
|
-
function
|
|
2826
|
+
function xt(t, e) {
|
|
2827
2827
|
const r = typeof t == "function" ? t(e) : typeof t == "string" ? { message: t } : t;
|
|
2828
2828
|
return typeof r == "string" ? { message: r } : r;
|
|
2829
2829
|
}
|
|
2830
|
-
function
|
|
2831
|
-
return t ?
|
|
2830
|
+
function Zt(t, e = {}, r) {
|
|
2831
|
+
return t ? ye.create().superRefine((n, s) => {
|
|
2832
2832
|
var a, i;
|
|
2833
2833
|
const o = t(n);
|
|
2834
2834
|
if (o instanceof Promise)
|
|
2835
2835
|
return o.then((d) => {
|
|
2836
2836
|
var c, l;
|
|
2837
2837
|
if (!d) {
|
|
2838
|
-
const
|
|
2839
|
-
s.addIssue({ code: "custom", ...
|
|
2838
|
+
const w = xt(e, n), S = (l = (c = w.fatal) !== null && c !== void 0 ? c : r) !== null && l !== void 0 ? l : !0;
|
|
2839
|
+
s.addIssue({ code: "custom", ...w, fatal: S });
|
|
2840
2840
|
}
|
|
2841
2841
|
});
|
|
2842
2842
|
if (!o) {
|
|
2843
|
-
const d =
|
|
2843
|
+
const d = xt(e, n), c = (i = (a = d.fatal) !== null && a !== void 0 ? a : r) !== null && i !== void 0 ? i : !0;
|
|
2844
2844
|
s.addIssue({ code: "custom", ...d, fatal: c });
|
|
2845
2845
|
}
|
|
2846
|
-
}) :
|
|
2846
|
+
}) : ye.create();
|
|
2847
2847
|
}
|
|
2848
|
-
const
|
|
2849
|
-
object:
|
|
2848
|
+
const Br = {
|
|
2849
|
+
object: E.lazycreate
|
|
2850
2850
|
};
|
|
2851
2851
|
var y;
|
|
2852
2852
|
(function(t) {
|
|
2853
2853
|
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";
|
|
2854
2854
|
})(y || (y = {}));
|
|
2855
|
-
const
|
|
2855
|
+
const Wr = (t, e = {
|
|
2856
2856
|
message: `Input not instance of ${t.name}`
|
|
2857
|
-
}) =>
|
|
2858
|
-
string: (t) =>
|
|
2857
|
+
}) => Zt((r) => r instanceof t, e), $t = j.create, Mt = J.create, Jr = Ge.create, Yr = Y.create, Ft = Ee.create, Gr = ie.create, Kr = We.create, Xr = Oe.create, Qr = Ne.create, en = ye.create, tn = se.create, rn = H.create, nn = Je.create, sn = Z.create, an = E.create, on = E.strictCreate, dn = Re.create, cn = et.create, un = Ae.create, ln = L.create, fn = Ce.create, pn = Ye.create, hn = oe.create, mn = he.create, yn = Ie.create, gn = Pe.create, vn = G.create, _n = je.create, bn = ge.create, St = $.create, wn = F.create, kn = K.create, xn = $.createWithPreprocess, Sn = Fe.create, Tn = () => $t().optional(), En = () => Mt().optional(), On = () => Ft().optional(), Nn = {
|
|
2858
|
+
string: (t) => j.create({ ...t, coerce: !0 }),
|
|
2859
2859
|
number: (t) => J.create({ ...t, coerce: !0 }),
|
|
2860
|
-
boolean: (t) =>
|
|
2860
|
+
boolean: (t) => Ee.create({
|
|
2861
2861
|
...t,
|
|
2862
2862
|
coerce: !0
|
|
2863
2863
|
}),
|
|
2864
2864
|
bigint: (t) => Y.create({ ...t, coerce: !0 }),
|
|
2865
|
-
date: (t) =>
|
|
2866
|
-
},
|
|
2865
|
+
date: (t) => ie.create({ ...t, coerce: !0 })
|
|
2866
|
+
}, Rn = g;
|
|
2867
2867
|
var h = /* @__PURE__ */ Object.freeze({
|
|
2868
2868
|
__proto__: null,
|
|
2869
|
-
defaultErrorMap:
|
|
2870
|
-
setErrorMap:
|
|
2871
|
-
getErrorMap:
|
|
2872
|
-
makeIssue:
|
|
2873
|
-
EMPTY_PATH:
|
|
2869
|
+
defaultErrorMap: me,
|
|
2870
|
+
setErrorMap: kr,
|
|
2871
|
+
getErrorMap: Ue,
|
|
2872
|
+
makeIssue: He,
|
|
2873
|
+
EMPTY_PATH: xr,
|
|
2874
2874
|
addIssueToContext: f,
|
|
2875
|
-
ParseStatus:
|
|
2875
|
+
ParseStatus: N,
|
|
2876
2876
|
INVALID: g,
|
|
2877
|
-
DIRTY:
|
|
2878
|
-
OK:
|
|
2879
|
-
isAborted:
|
|
2880
|
-
isDirty:
|
|
2881
|
-
isValid:
|
|
2882
|
-
isAsync:
|
|
2877
|
+
DIRTY: pe,
|
|
2878
|
+
OK: A,
|
|
2879
|
+
isAborted: it,
|
|
2880
|
+
isDirty: ot,
|
|
2881
|
+
isValid: ae,
|
|
2882
|
+
isAsync: Te,
|
|
2883
2883
|
get util() {
|
|
2884
2884
|
return k;
|
|
2885
2885
|
},
|
|
2886
2886
|
get objectUtil() {
|
|
2887
|
-
return
|
|
2887
|
+
return at;
|
|
2888
2888
|
},
|
|
2889
2889
|
ZodParsedType: p,
|
|
2890
|
-
getParsedType:
|
|
2891
|
-
ZodType:
|
|
2892
|
-
datetimeRegex:
|
|
2893
|
-
ZodString:
|
|
2890
|
+
getParsedType: U,
|
|
2891
|
+
ZodType: b,
|
|
2892
|
+
datetimeRegex: Pt,
|
|
2893
|
+
ZodString: j,
|
|
2894
2894
|
ZodNumber: J,
|
|
2895
2895
|
ZodBigInt: Y,
|
|
2896
|
-
ZodBoolean:
|
|
2897
|
-
ZodDate:
|
|
2898
|
-
ZodSymbol:
|
|
2899
|
-
ZodUndefined:
|
|
2900
|
-
ZodNull:
|
|
2901
|
-
ZodAny:
|
|
2902
|
-
ZodUnknown:
|
|
2896
|
+
ZodBoolean: Ee,
|
|
2897
|
+
ZodDate: ie,
|
|
2898
|
+
ZodSymbol: We,
|
|
2899
|
+
ZodUndefined: Oe,
|
|
2900
|
+
ZodNull: Ne,
|
|
2901
|
+
ZodAny: ye,
|
|
2902
|
+
ZodUnknown: se,
|
|
2903
2903
|
ZodNever: H,
|
|
2904
|
-
ZodVoid:
|
|
2905
|
-
ZodArray:
|
|
2906
|
-
ZodObject:
|
|
2907
|
-
ZodUnion:
|
|
2908
|
-
ZodDiscriminatedUnion:
|
|
2909
|
-
ZodIntersection:
|
|
2910
|
-
ZodTuple:
|
|
2911
|
-
ZodRecord:
|
|
2912
|
-
ZodMap:
|
|
2913
|
-
ZodSet:
|
|
2914
|
-
ZodFunction:
|
|
2915
|
-
ZodLazy:
|
|
2916
|
-
ZodLiteral:
|
|
2904
|
+
ZodVoid: Je,
|
|
2905
|
+
ZodArray: Z,
|
|
2906
|
+
ZodObject: E,
|
|
2907
|
+
ZodUnion: Re,
|
|
2908
|
+
ZodDiscriminatedUnion: et,
|
|
2909
|
+
ZodIntersection: Ae,
|
|
2910
|
+
ZodTuple: L,
|
|
2911
|
+
ZodRecord: Ce,
|
|
2912
|
+
ZodMap: Ye,
|
|
2913
|
+
ZodSet: oe,
|
|
2914
|
+
ZodFunction: he,
|
|
2915
|
+
ZodLazy: Ie,
|
|
2916
|
+
ZodLiteral: Pe,
|
|
2917
2917
|
ZodEnum: G,
|
|
2918
|
-
ZodNativeEnum:
|
|
2919
|
-
ZodPromise:
|
|
2920
|
-
ZodEffects:
|
|
2921
|
-
ZodTransformer:
|
|
2922
|
-
ZodOptional:
|
|
2918
|
+
ZodNativeEnum: je,
|
|
2919
|
+
ZodPromise: ge,
|
|
2920
|
+
ZodEffects: $,
|
|
2921
|
+
ZodTransformer: $,
|
|
2922
|
+
ZodOptional: F,
|
|
2923
2923
|
ZodNullable: K,
|
|
2924
|
-
ZodDefault:
|
|
2925
|
-
ZodCatch:
|
|
2926
|
-
ZodNaN:
|
|
2924
|
+
ZodDefault: Ze,
|
|
2925
|
+
ZodCatch: $e,
|
|
2926
|
+
ZodNaN: Ge,
|
|
2927
2927
|
BRAND: Hr,
|
|
2928
|
-
ZodBranded:
|
|
2929
|
-
ZodPipeline:
|
|
2930
|
-
ZodReadonly:
|
|
2931
|
-
custom:
|
|
2932
|
-
Schema:
|
|
2933
|
-
ZodSchema:
|
|
2934
|
-
late:
|
|
2928
|
+
ZodBranded: mt,
|
|
2929
|
+
ZodPipeline: Fe,
|
|
2930
|
+
ZodReadonly: Me,
|
|
2931
|
+
custom: Zt,
|
|
2932
|
+
Schema: b,
|
|
2933
|
+
ZodSchema: b,
|
|
2934
|
+
late: Br,
|
|
2935
2935
|
get ZodFirstPartyTypeKind() {
|
|
2936
2936
|
return y;
|
|
2937
2937
|
},
|
|
2938
|
-
coerce:
|
|
2939
|
-
any:
|
|
2940
|
-
array:
|
|
2941
|
-
bigint:
|
|
2942
|
-
boolean:
|
|
2943
|
-
date:
|
|
2944
|
-
discriminatedUnion:
|
|
2945
|
-
effect:
|
|
2946
|
-
enum:
|
|
2947
|
-
function:
|
|
2948
|
-
instanceof:
|
|
2949
|
-
intersection:
|
|
2950
|
-
lazy:
|
|
2951
|
-
literal:
|
|
2952
|
-
map:
|
|
2953
|
-
nan:
|
|
2954
|
-
nativeEnum:
|
|
2955
|
-
never:
|
|
2956
|
-
null:
|
|
2957
|
-
nullable:
|
|
2958
|
-
number:
|
|
2959
|
-
object:
|
|
2960
|
-
oboolean:
|
|
2961
|
-
onumber:
|
|
2962
|
-
optional:
|
|
2963
|
-
ostring:
|
|
2964
|
-
pipeline:
|
|
2965
|
-
preprocess:
|
|
2938
|
+
coerce: Nn,
|
|
2939
|
+
any: en,
|
|
2940
|
+
array: sn,
|
|
2941
|
+
bigint: Yr,
|
|
2942
|
+
boolean: Ft,
|
|
2943
|
+
date: Gr,
|
|
2944
|
+
discriminatedUnion: cn,
|
|
2945
|
+
effect: St,
|
|
2946
|
+
enum: vn,
|
|
2947
|
+
function: mn,
|
|
2948
|
+
instanceof: Wr,
|
|
2949
|
+
intersection: un,
|
|
2950
|
+
lazy: yn,
|
|
2951
|
+
literal: gn,
|
|
2952
|
+
map: pn,
|
|
2953
|
+
nan: Jr,
|
|
2954
|
+
nativeEnum: _n,
|
|
2955
|
+
never: rn,
|
|
2956
|
+
null: Qr,
|
|
2957
|
+
nullable: kn,
|
|
2958
|
+
number: Mt,
|
|
2959
|
+
object: an,
|
|
2960
|
+
oboolean: On,
|
|
2961
|
+
onumber: En,
|
|
2962
|
+
optional: wn,
|
|
2963
|
+
ostring: Tn,
|
|
2964
|
+
pipeline: Sn,
|
|
2965
|
+
preprocess: xn,
|
|
2966
2966
|
promise: bn,
|
|
2967
|
-
record:
|
|
2968
|
-
set:
|
|
2969
|
-
strictObject:
|
|
2970
|
-
string:
|
|
2971
|
-
symbol:
|
|
2972
|
-
transformer:
|
|
2973
|
-
tuple:
|
|
2974
|
-
undefined:
|
|
2975
|
-
union:
|
|
2976
|
-
unknown:
|
|
2977
|
-
void:
|
|
2978
|
-
NEVER:
|
|
2967
|
+
record: fn,
|
|
2968
|
+
set: hn,
|
|
2969
|
+
strictObject: on,
|
|
2970
|
+
string: $t,
|
|
2971
|
+
symbol: Kr,
|
|
2972
|
+
transformer: St,
|
|
2973
|
+
tuple: ln,
|
|
2974
|
+
undefined: Xr,
|
|
2975
|
+
union: dn,
|
|
2976
|
+
unknown: tn,
|
|
2977
|
+
void: nn,
|
|
2978
|
+
NEVER: Rn,
|
|
2979
2979
|
ZodIssueCode: u,
|
|
2980
|
-
quotelessJson:
|
|
2981
|
-
ZodError:
|
|
2980
|
+
quotelessJson: wr,
|
|
2981
|
+
ZodError: I
|
|
2982
2982
|
});
|
|
2983
|
-
const
|
|
2983
|
+
const ct = h.object({
|
|
2984
2984
|
detail: h.string()
|
|
2985
|
-
}),
|
|
2985
|
+
}), Dt = h.object({
|
|
2986
2986
|
error: h.string()
|
|
2987
2987
|
});
|
|
2988
|
-
function
|
|
2988
|
+
function Lt(t) {
|
|
2989
2989
|
if (!t)
|
|
2990
2990
|
return "Unknown error";
|
|
2991
2991
|
if (t instanceof Error) {
|
|
2992
|
-
const e =
|
|
2993
|
-
return e.success ? e.data.detail :
|
|
2992
|
+
const e = ct.safeParse(t.cause);
|
|
2993
|
+
return e.success ? e.data.detail : An(t.message);
|
|
2994
2994
|
}
|
|
2995
2995
|
if (typeof t == "object") {
|
|
2996
|
-
const e =
|
|
2996
|
+
const e = ct.safeParse(t);
|
|
2997
2997
|
if (e.success)
|
|
2998
2998
|
return e.data.detail;
|
|
2999
|
-
const r =
|
|
2999
|
+
const r = Dt.safeParse(t);
|
|
3000
3000
|
if (r.success)
|
|
3001
3001
|
return r.data.error;
|
|
3002
3002
|
}
|
|
@@ -3006,37 +3006,36 @@ var hs = wr((gs, yt) => {
|
|
|
3006
3006
|
return String(t);
|
|
3007
3007
|
}
|
|
3008
3008
|
}
|
|
3009
|
-
function
|
|
3010
|
-
const e =
|
|
3009
|
+
function An(t) {
|
|
3010
|
+
const e = Cn(t);
|
|
3011
3011
|
if (!e)
|
|
3012
3012
|
return t;
|
|
3013
|
-
const r =
|
|
3013
|
+
const r = ct.safeParse(e);
|
|
3014
3014
|
if (r.success)
|
|
3015
3015
|
return r.data.detail;
|
|
3016
|
-
const n =
|
|
3016
|
+
const n = Dt.safeParse(e);
|
|
3017
3017
|
return n.success ? n.data.error : t;
|
|
3018
3018
|
}
|
|
3019
|
-
function
|
|
3019
|
+
function Cn(t) {
|
|
3020
3020
|
try {
|
|
3021
3021
|
return JSON.parse(t);
|
|
3022
3022
|
} catch {
|
|
3023
3023
|
return t;
|
|
3024
3024
|
}
|
|
3025
3025
|
}
|
|
3026
|
-
const
|
|
3027
|
-
function
|
|
3026
|
+
const In = 1e10, Pn = 1e3;
|
|
3027
|
+
function Le(t, e) {
|
|
3028
3028
|
const r = t.map((n) => `"${n}"`).join(", ");
|
|
3029
3029
|
return new Error(`This RPC instance cannot ${e} because the transport did not provide one or more of these methods: ${r}`);
|
|
3030
3030
|
}
|
|
3031
|
-
function
|
|
3031
|
+
function jn(t = {}) {
|
|
3032
3032
|
let e = {};
|
|
3033
3033
|
function r(v) {
|
|
3034
3034
|
e = v;
|
|
3035
3035
|
}
|
|
3036
3036
|
let n = {};
|
|
3037
3037
|
function s(v) {
|
|
3038
|
-
|
|
3039
|
-
n.unregisterHandler && n.unregisterHandler(), n = v, (T = n.registerHandler) == null || T.call(n, _r);
|
|
3038
|
+
n.unregisterHandler && n.unregisterHandler(), n = v, n.registerHandler?.(vr);
|
|
3040
3039
|
}
|
|
3041
3040
|
let a;
|
|
3042
3041
|
function i(v) {
|
|
@@ -3044,120 +3043,115 @@ var hs = wr((gs, yt) => {
|
|
|
3044
3043
|
a = v;
|
|
3045
3044
|
return;
|
|
3046
3045
|
}
|
|
3047
|
-
a = (T,
|
|
3048
|
-
const
|
|
3049
|
-
if (
|
|
3050
|
-
return
|
|
3051
|
-
const
|
|
3052
|
-
if (!
|
|
3046
|
+
a = (T, O) => {
|
|
3047
|
+
const R = v[T];
|
|
3048
|
+
if (R)
|
|
3049
|
+
return R(O);
|
|
3050
|
+
const M = v._;
|
|
3051
|
+
if (!M)
|
|
3053
3052
|
throw new Error(`The requested method has no handler: ${T}`);
|
|
3054
|
-
return
|
|
3053
|
+
return M(T, O);
|
|
3055
3054
|
};
|
|
3056
3055
|
}
|
|
3057
|
-
const { maxRequestTime: o =
|
|
3056
|
+
const { maxRequestTime: o = Pn } = t;
|
|
3058
3057
|
t.transport && s(t.transport), t.requestHandler && i(t.requestHandler), t._debugHooks && r(t._debugHooks);
|
|
3059
3058
|
let d = 0;
|
|
3060
3059
|
function c() {
|
|
3061
|
-
return d <=
|
|
3060
|
+
return d <= In ? ++d : d = 0;
|
|
3062
3061
|
}
|
|
3063
|
-
const l = /* @__PURE__ */ new Map(),
|
|
3062
|
+
const l = /* @__PURE__ */ new Map(), w = /* @__PURE__ */ new Map();
|
|
3064
3063
|
function S(v, ...T) {
|
|
3065
|
-
const
|
|
3066
|
-
return new Promise((
|
|
3067
|
-
var ce;
|
|
3064
|
+
const O = T[0];
|
|
3065
|
+
return new Promise((R, M) => {
|
|
3068
3066
|
if (!n.send)
|
|
3069
|
-
throw
|
|
3070
|
-
const
|
|
3067
|
+
throw Le(["send"], "make requests");
|
|
3068
|
+
const B = c(), wt = {
|
|
3071
3069
|
type: "request",
|
|
3072
|
-
id:
|
|
3070
|
+
id: B,
|
|
3073
3071
|
method: v,
|
|
3074
|
-
params:
|
|
3072
|
+
params: O
|
|
3075
3073
|
};
|
|
3076
|
-
l.set(
|
|
3077
|
-
|
|
3078
|
-
}, o)),
|
|
3074
|
+
l.set(B, { resolve: R, reject: M }), o !== 1 / 0 && w.set(B, setTimeout(() => {
|
|
3075
|
+
w.delete(B), M(new Error("RPC request timed out."));
|
|
3076
|
+
}, o)), e.onSend?.(wt), n.send(wt);
|
|
3079
3077
|
});
|
|
3080
3078
|
}
|
|
3081
|
-
const
|
|
3082
|
-
get: (v, T,
|
|
3083
|
-
}),
|
|
3084
|
-
function
|
|
3085
|
-
|
|
3086
|
-
const N = T[0];
|
|
3079
|
+
const C = new Proxy(S, {
|
|
3080
|
+
get: (v, T, O) => T in v ? Reflect.get(v, T, O) : (R) => S(T, R)
|
|
3081
|
+
}), z = C;
|
|
3082
|
+
function De(v, ...T) {
|
|
3083
|
+
const O = T[0];
|
|
3087
3084
|
if (!n.send)
|
|
3088
|
-
throw
|
|
3089
|
-
const
|
|
3085
|
+
throw Le(["send"], "send messages");
|
|
3086
|
+
const R = {
|
|
3090
3087
|
type: "message",
|
|
3091
3088
|
id: v,
|
|
3092
|
-
payload:
|
|
3089
|
+
payload: O
|
|
3093
3090
|
};
|
|
3094
|
-
|
|
3091
|
+
e.onSend?.(R), n.send(R);
|
|
3095
3092
|
}
|
|
3096
|
-
const
|
|
3097
|
-
get: (v, T,
|
|
3098
|
-
}),
|
|
3099
|
-
function
|
|
3100
|
-
var N;
|
|
3093
|
+
const _t = new Proxy(De, {
|
|
3094
|
+
get: (v, T, O) => T in v ? Reflect.get(v, T, O) : (R) => De(T, R)
|
|
3095
|
+
}), bt = _t, Q = /* @__PURE__ */ new Map(), rt = /* @__PURE__ */ new Set();
|
|
3096
|
+
function yr(v, T) {
|
|
3101
3097
|
if (!n.registerHandler)
|
|
3102
|
-
throw
|
|
3098
|
+
throw Le(["registerHandler"], "register message listeners");
|
|
3103
3099
|
if (v === "*") {
|
|
3104
|
-
|
|
3100
|
+
rt.add(T);
|
|
3105
3101
|
return;
|
|
3106
3102
|
}
|
|
3107
|
-
Q.has(v) || Q.set(v, /* @__PURE__ */ new Set()),
|
|
3103
|
+
Q.has(v) || Q.set(v, /* @__PURE__ */ new Set()), Q.get(v)?.add(T);
|
|
3108
3104
|
}
|
|
3109
|
-
function
|
|
3110
|
-
var N, E;
|
|
3105
|
+
function gr(v, T) {
|
|
3111
3106
|
if (v === "*") {
|
|
3112
|
-
|
|
3107
|
+
rt.delete(T);
|
|
3113
3108
|
return;
|
|
3114
3109
|
}
|
|
3115
|
-
|
|
3110
|
+
Q.get(v)?.delete(T), Q.get(v)?.size === 0 && Q.delete(v);
|
|
3116
3111
|
}
|
|
3117
|
-
async function
|
|
3118
|
-
|
|
3119
|
-
if ((T = e.onReceive) == null || T.call(e, v), !("type" in v))
|
|
3112
|
+
async function vr(v) {
|
|
3113
|
+
if (e.onReceive?.(v), !("type" in v))
|
|
3120
3114
|
throw new Error("Message does not contain a type.");
|
|
3121
3115
|
if (v.type === "request") {
|
|
3122
3116
|
if (!n.send || !a)
|
|
3123
|
-
throw
|
|
3124
|
-
const { id:
|
|
3125
|
-
let
|
|
3117
|
+
throw Le(["send", "requestHandler"], "handle requests");
|
|
3118
|
+
const { id: T, method: O, params: R } = v;
|
|
3119
|
+
let M;
|
|
3126
3120
|
try {
|
|
3127
|
-
|
|
3121
|
+
M = {
|
|
3128
3122
|
type: "response",
|
|
3129
|
-
id:
|
|
3123
|
+
id: T,
|
|
3130
3124
|
success: !0,
|
|
3131
|
-
payload: await a(
|
|
3125
|
+
payload: await a(O, R)
|
|
3132
3126
|
};
|
|
3133
|
-
} catch (
|
|
3134
|
-
if (!(
|
|
3135
|
-
throw
|
|
3136
|
-
|
|
3127
|
+
} catch (B) {
|
|
3128
|
+
if (!(B instanceof Error))
|
|
3129
|
+
throw B;
|
|
3130
|
+
M = {
|
|
3137
3131
|
type: "response",
|
|
3138
|
-
id:
|
|
3132
|
+
id: T,
|
|
3139
3133
|
success: !1,
|
|
3140
|
-
error:
|
|
3134
|
+
error: B.message
|
|
3141
3135
|
};
|
|
3142
3136
|
}
|
|
3143
|
-
|
|
3137
|
+
e.onSend?.(M), n.send(M);
|
|
3144
3138
|
return;
|
|
3145
3139
|
}
|
|
3146
3140
|
if (v.type === "response") {
|
|
3147
|
-
const
|
|
3148
|
-
|
|
3149
|
-
const { resolve:
|
|
3150
|
-
v.success ?
|
|
3141
|
+
const T = w.get(v.id);
|
|
3142
|
+
T != null && clearTimeout(T);
|
|
3143
|
+
const { resolve: O, reject: R } = l.get(v.id) ?? {};
|
|
3144
|
+
v.success ? O?.(v.payload) : R?.(new Error(v.error));
|
|
3151
3145
|
return;
|
|
3152
3146
|
}
|
|
3153
3147
|
if (v.type === "message") {
|
|
3154
|
-
for (const
|
|
3155
|
-
|
|
3156
|
-
const
|
|
3157
|
-
if (!
|
|
3148
|
+
for (const O of rt)
|
|
3149
|
+
O(v.id, v.payload);
|
|
3150
|
+
const T = Q.get(v.id);
|
|
3151
|
+
if (!T)
|
|
3158
3152
|
return;
|
|
3159
|
-
for (const
|
|
3160
|
-
|
|
3153
|
+
for (const O of T)
|
|
3154
|
+
O(v.payload);
|
|
3161
3155
|
return;
|
|
3162
3156
|
}
|
|
3163
3157
|
throw new Error(`Unexpected RPC message type: ${v.type}`);
|
|
@@ -3165,50 +3159,50 @@ var hs = wr((gs, yt) => {
|
|
|
3165
3159
|
return {
|
|
3166
3160
|
setTransport: s,
|
|
3167
3161
|
setRequestHandler: i,
|
|
3168
|
-
request:
|
|
3169
|
-
requestProxy:
|
|
3170
|
-
send:
|
|
3171
|
-
sendProxy:
|
|
3172
|
-
addMessageListener:
|
|
3173
|
-
removeMessageListener:
|
|
3174
|
-
proxy: { send:
|
|
3162
|
+
request: C,
|
|
3163
|
+
requestProxy: z,
|
|
3164
|
+
send: _t,
|
|
3165
|
+
sendProxy: bt,
|
|
3166
|
+
addMessageListener: yr,
|
|
3167
|
+
removeMessageListener: gr,
|
|
3168
|
+
proxy: { send: bt, request: z },
|
|
3175
3169
|
_setDebugHooks: r
|
|
3176
3170
|
};
|
|
3177
3171
|
}
|
|
3178
|
-
function
|
|
3179
|
-
return
|
|
3172
|
+
function Zn(t) {
|
|
3173
|
+
return jn(t);
|
|
3180
3174
|
}
|
|
3181
|
-
const
|
|
3182
|
-
function
|
|
3175
|
+
const Vt = "[transport-id]";
|
|
3176
|
+
function $n(t, e) {
|
|
3183
3177
|
const { transportId: r } = e;
|
|
3184
|
-
return r != null ? { [
|
|
3178
|
+
return r != null ? { [Vt]: r, data: t } : t;
|
|
3185
3179
|
}
|
|
3186
|
-
function
|
|
3187
|
-
const { transportId: r, filter: n } = e, s = n
|
|
3180
|
+
function Mn(t, e) {
|
|
3181
|
+
const { transportId: r, filter: n } = e, s = n?.();
|
|
3188
3182
|
if (r != null && s != null)
|
|
3189
3183
|
throw new Error("Cannot use both `transportId` and `filter` at the same time");
|
|
3190
3184
|
let a = t;
|
|
3191
3185
|
if (r) {
|
|
3192
|
-
if (t[
|
|
3186
|
+
if (t[Vt] !== r)
|
|
3193
3187
|
return [!0];
|
|
3194
3188
|
a = t.data;
|
|
3195
3189
|
}
|
|
3196
3190
|
return s === !1 ? [!0] : [!1, a];
|
|
3197
3191
|
}
|
|
3198
|
-
function
|
|
3192
|
+
function Fn(t, e = {}) {
|
|
3199
3193
|
const { transportId: r, filter: n, remotePort: s } = e, a = t, i = s ?? t;
|
|
3200
3194
|
let o;
|
|
3201
3195
|
return {
|
|
3202
3196
|
send(d) {
|
|
3203
|
-
i.postMessage(
|
|
3197
|
+
i.postMessage($n(d, { transportId: r }));
|
|
3204
3198
|
},
|
|
3205
3199
|
registerHandler(d) {
|
|
3206
3200
|
o = (c) => {
|
|
3207
|
-
const l = c.data, [
|
|
3201
|
+
const l = c.data, [w, S] = Mn(l, {
|
|
3208
3202
|
transportId: r,
|
|
3209
|
-
filter: () => n
|
|
3203
|
+
filter: () => n?.(c)
|
|
3210
3204
|
});
|
|
3211
|
-
|
|
3205
|
+
w || d(S);
|
|
3212
3206
|
}, a.addEventListener("message", o);
|
|
3213
3207
|
},
|
|
3214
3208
|
unregisterHandler() {
|
|
@@ -3216,15 +3210,15 @@ var hs = wr((gs, yt) => {
|
|
|
3216
3210
|
}
|
|
3217
3211
|
};
|
|
3218
3212
|
}
|
|
3219
|
-
function
|
|
3220
|
-
return
|
|
3213
|
+
function Dn(t) {
|
|
3214
|
+
return Fn(self, t);
|
|
3221
3215
|
}
|
|
3222
|
-
function
|
|
3216
|
+
function zt(t, e) {
|
|
3223
3217
|
if (!t)
|
|
3224
3218
|
throw new Error(e);
|
|
3225
3219
|
}
|
|
3226
|
-
const
|
|
3227
|
-
class
|
|
3220
|
+
const Ln = "marimo-transport";
|
|
3221
|
+
class Vn {
|
|
3228
3222
|
constructor(e) {
|
|
3229
3223
|
this.onMessage = e, this.started = !1, this.push = (r) => {
|
|
3230
3224
|
this.started ? this.onMessage(r) : this.buffer.push(r);
|
|
@@ -3233,10 +3227,10 @@ var hs = wr((gs, yt) => {
|
|
|
3233
3227
|
}, this.buffer = [];
|
|
3234
3228
|
}
|
|
3235
3229
|
}
|
|
3236
|
-
const
|
|
3230
|
+
const _e = {
|
|
3237
3231
|
NOOP: () => {
|
|
3238
3232
|
}
|
|
3239
|
-
},
|
|
3233
|
+
}, qt = (t, e) => {
|
|
3240
3234
|
const r = `[${t}]`;
|
|
3241
3235
|
return {
|
|
3242
3236
|
debug: (...n) => e.debug(r, ...n),
|
|
@@ -3244,10 +3238,10 @@ var hs = wr((gs, yt) => {
|
|
|
3244
3238
|
warn: (...n) => e.warn(r, ...n),
|
|
3245
3239
|
error: (...n) => e.error(r, ...n),
|
|
3246
3240
|
trace: (...n) => e.trace(r, ...n),
|
|
3247
|
-
get: (n) =>
|
|
3248
|
-
disabled: (n = !0) => n ?
|
|
3241
|
+
get: (n) => qt(`${t}.${n}`, e),
|
|
3242
|
+
disabled: (n = !0) => n ? Xe : e
|
|
3249
3243
|
};
|
|
3250
|
-
},
|
|
3244
|
+
}, Ke = {
|
|
3251
3245
|
debug: (...t) => {
|
|
3252
3246
|
console.debug(...t);
|
|
3253
3247
|
},
|
|
@@ -3263,27 +3257,27 @@ var hs = wr((gs, yt) => {
|
|
|
3263
3257
|
trace: (...t) => {
|
|
3264
3258
|
console.trace(...t);
|
|
3265
3259
|
},
|
|
3266
|
-
get: (t) =>
|
|
3267
|
-
disabled: (t = !0) => t ?
|
|
3268
|
-
},
|
|
3269
|
-
debug: () =>
|
|
3270
|
-
log: () =>
|
|
3271
|
-
warn: () =>
|
|
3272
|
-
error: () =>
|
|
3273
|
-
trace: () =>
|
|
3274
|
-
get: () =>
|
|
3275
|
-
disabled: () =>
|
|
3260
|
+
get: (t) => qt(t, Ke),
|
|
3261
|
+
disabled: (t = !0) => t ? Xe : Ke
|
|
3262
|
+
}, Xe = {
|
|
3263
|
+
debug: () => _e.NOOP,
|
|
3264
|
+
log: () => _e.NOOP,
|
|
3265
|
+
warn: () => _e.NOOP,
|
|
3266
|
+
error: () => _e.NOOP,
|
|
3267
|
+
trace: () => _e.NOOP,
|
|
3268
|
+
get: () => Xe,
|
|
3269
|
+
disabled: () => Xe
|
|
3276
3270
|
};
|
|
3277
|
-
function
|
|
3278
|
-
return typeof window < "u" && window.Logger ||
|
|
3271
|
+
function zn() {
|
|
3272
|
+
return typeof window < "u" && window.Logger || Ke;
|
|
3279
3273
|
}
|
|
3280
|
-
const W =
|
|
3274
|
+
const W = zn(), qn = [
|
|
3281
3275
|
"pip",
|
|
3282
3276
|
"uv",
|
|
3283
3277
|
"rye",
|
|
3284
3278
|
"poetry",
|
|
3285
3279
|
"pixi"
|
|
3286
|
-
],
|
|
3280
|
+
], Ut = [
|
|
3287
3281
|
"normal",
|
|
3288
3282
|
"compact",
|
|
3289
3283
|
"medium",
|
|
@@ -3295,7 +3289,7 @@ var hs = wr((gs, yt) => {
|
|
|
3295
3289
|
"polars",
|
|
3296
3290
|
"lazy-polars",
|
|
3297
3291
|
"pandas"
|
|
3298
|
-
],
|
|
3292
|
+
], Un = h.object({
|
|
3299
3293
|
completion: h.object({
|
|
3300
3294
|
activate_on_typing: h.boolean().default(!0),
|
|
3301
3295
|
copilot: h.union([h.boolean(), h.enum(["github", "codeium", "custom"])]).default(!1).transform((t) => t === !0 ? "github" : t),
|
|
@@ -3326,10 +3320,10 @@ var hs = wr((gs, yt) => {
|
|
|
3326
3320
|
cell_output: h.enum(["above", "below"]).default("above"),
|
|
3327
3321
|
dataframes: h.enum(["rich", "plain"]).default("rich"),
|
|
3328
3322
|
default_table_page_size: h.number().default(10),
|
|
3329
|
-
default_width: h.enum(
|
|
3323
|
+
default_width: h.enum(Ut).default("medium").transform((t) => t === "normal" ? "compact" : t)
|
|
3330
3324
|
}).passthrough().default({}),
|
|
3331
3325
|
package_management: h.object({
|
|
3332
|
-
manager: h.enum(
|
|
3326
|
+
manager: h.enum(qn).default("pip")
|
|
3333
3327
|
}).passthrough().default({ manager: "pip" }),
|
|
3334
3328
|
ai: h.object({
|
|
3335
3329
|
rules: h.string().default(""),
|
|
@@ -3370,42 +3364,42 @@ var hs = wr((gs, yt) => {
|
|
|
3370
3364
|
rules: "",
|
|
3371
3365
|
open_ai: {}
|
|
3372
3366
|
}
|
|
3373
|
-
}), Hn = h.string(),
|
|
3367
|
+
}), Hn = h.string(), Bn = h.enum(Ht).default("auto");
|
|
3374
3368
|
h.object({
|
|
3375
|
-
width: h.enum(
|
|
3369
|
+
width: h.enum(Ut).default("medium").transform((t) => t === "normal" ? "compact" : t),
|
|
3376
3370
|
app_title: Hn.nullish(),
|
|
3377
3371
|
css_file: h.string().nullish(),
|
|
3378
3372
|
html_head_file: h.string().nullish(),
|
|
3379
3373
|
auto_download: h.array(h.enum(["html", "markdown", "ipynb"])).default([]),
|
|
3380
|
-
sql_output:
|
|
3374
|
+
sql_output: Bn
|
|
3381
3375
|
}).default({ width: "medium", auto_download: [] });
|
|
3382
|
-
function
|
|
3383
|
-
return
|
|
3376
|
+
function Wn() {
|
|
3377
|
+
return Un.parse({});
|
|
3384
3378
|
}
|
|
3385
|
-
var
|
|
3379
|
+
var Jn = Object.defineProperty, x = (t, e) => Jn(t, "name", { value: e, configurable: !0 }), Bt = ((t) => typeof require < "u" ? require : typeof Proxy < "u" ? new Proxy(t, { get: (e, r) => (typeof require < "u" ? require : e)[r] }) : t)(function(t) {
|
|
3386
3380
|
if (typeof require < "u") return require.apply(this, arguments);
|
|
3387
3381
|
throw new Error('Dynamic require of "' + t + '" is not supported');
|
|
3388
3382
|
});
|
|
3389
|
-
function
|
|
3383
|
+
function Wt(t) {
|
|
3390
3384
|
return !isNaN(parseFloat(t)) && isFinite(t);
|
|
3391
3385
|
}
|
|
3392
|
-
x(
|
|
3386
|
+
x(Wt, "_isNumber");
|
|
3393
3387
|
function X(t) {
|
|
3394
3388
|
return t.charAt(0).toUpperCase() + t.substring(1);
|
|
3395
3389
|
}
|
|
3396
3390
|
x(X, "_capitalize");
|
|
3397
|
-
function
|
|
3391
|
+
function tt(t) {
|
|
3398
3392
|
return function() {
|
|
3399
3393
|
return this[t];
|
|
3400
3394
|
};
|
|
3401
3395
|
}
|
|
3402
|
-
x(
|
|
3403
|
-
var
|
|
3404
|
-
function
|
|
3405
|
-
if (t) for (var e = 0; e <
|
|
3396
|
+
x(tt, "_getter");
|
|
3397
|
+
var ce = ["isConstructor", "isEval", "isNative", "isToplevel"], ue = ["columnNumber", "lineNumber"], le = ["fileName", "functionName", "source"], Yn = ["args"], Gn = ["evalOrigin"], Ve = ce.concat(ue, le, Yn, Gn);
|
|
3398
|
+
function P(t) {
|
|
3399
|
+
if (t) for (var e = 0; e < Ve.length; e++) t[Ve[e]] !== void 0 && this["set" + X(Ve[e])](t[Ve[e]]);
|
|
3406
3400
|
}
|
|
3407
|
-
x(
|
|
3408
|
-
|
|
3401
|
+
x(P, "StackFrame");
|
|
3402
|
+
P.prototype = { getArgs: function() {
|
|
3409
3403
|
return this.args;
|
|
3410
3404
|
}, setArgs: function(t) {
|
|
3411
3405
|
if (Object.prototype.toString.call(t) !== "[object Array]") throw new TypeError("Args must be an Array");
|
|
@@ -3413,38 +3407,38 @@ var hs = wr((gs, yt) => {
|
|
|
3413
3407
|
}, getEvalOrigin: function() {
|
|
3414
3408
|
return this.evalOrigin;
|
|
3415
3409
|
}, setEvalOrigin: function(t) {
|
|
3416
|
-
if (t instanceof
|
|
3417
|
-
else if (t instanceof Object) this.evalOrigin = new
|
|
3410
|
+
if (t instanceof P) this.evalOrigin = t;
|
|
3411
|
+
else if (t instanceof Object) this.evalOrigin = new P(t);
|
|
3418
3412
|
else throw new TypeError("Eval Origin must be an Object or StackFrame");
|
|
3419
3413
|
}, toString: function() {
|
|
3420
3414
|
var t = this.getFileName() || "", e = this.getLineNumber() || "", r = this.getColumnNumber() || "", n = this.getFunctionName() || "";
|
|
3421
3415
|
return this.getIsEval() ? t ? "[eval] (" + t + ":" + e + ":" + r + ")" : "[eval]:" + e + ":" + r : n ? n + " (" + t + ":" + e + ":" + r + ")" : t + ":" + e + ":" + r;
|
|
3422
3416
|
} };
|
|
3423
|
-
|
|
3417
|
+
P.fromString = x(function(t) {
|
|
3424
3418
|
var e = t.indexOf("("), r = t.lastIndexOf(")"), n = t.substring(0, e), s = t.substring(e + 1, r).split(","), a = t.substring(r + 1);
|
|
3425
3419
|
if (a.indexOf("@") === 0) var i = /@(.+?)(?::(\d+))?(?::(\d+))?$/.exec(a, ""), o = i[1], d = i[2], c = i[3];
|
|
3426
|
-
return new
|
|
3420
|
+
return new P({ functionName: n, args: s || void 0, fileName: o, lineNumber: d || void 0, columnNumber: c || void 0 });
|
|
3427
3421
|
}, "StackFrame$$fromString");
|
|
3428
|
-
for (
|
|
3422
|
+
for (ee = 0; ee < ce.length; ee++) P.prototype["get" + X(ce[ee])] = tt(ce[ee]), P.prototype["set" + X(ce[ee])] = /* @__PURE__ */ function(t) {
|
|
3429
3423
|
return function(e) {
|
|
3430
3424
|
this[t] = !!e;
|
|
3431
3425
|
};
|
|
3432
|
-
}(
|
|
3433
|
-
var
|
|
3434
|
-
for (
|
|
3426
|
+
}(ce[ee]);
|
|
3427
|
+
var ee;
|
|
3428
|
+
for (te = 0; te < ue.length; te++) P.prototype["get" + X(ue[te])] = tt(ue[te]), P.prototype["set" + X(ue[te])] = /* @__PURE__ */ function(t) {
|
|
3435
3429
|
return function(e) {
|
|
3436
|
-
if (!
|
|
3430
|
+
if (!Wt(e)) throw new TypeError(t + " must be a Number");
|
|
3437
3431
|
this[t] = Number(e);
|
|
3438
3432
|
};
|
|
3439
|
-
}(
|
|
3440
|
-
var
|
|
3441
|
-
for (
|
|
3433
|
+
}(ue[te]);
|
|
3434
|
+
var te;
|
|
3435
|
+
for (re = 0; re < le.length; re++) P.prototype["get" + X(le[re])] = tt(le[re]), P.prototype["set" + X(le[re])] = /* @__PURE__ */ function(t) {
|
|
3442
3436
|
return function(e) {
|
|
3443
3437
|
this[t] = String(e);
|
|
3444
3438
|
};
|
|
3445
|
-
}(
|
|
3446
|
-
var
|
|
3447
|
-
function
|
|
3439
|
+
}(le[re]);
|
|
3440
|
+
var re, st = P;
|
|
3441
|
+
function Jt() {
|
|
3448
3442
|
var t = /^\s*at .*(\S+:\d+|\(native\))/m, e = /^(eval@)?(\[native code])?$/;
|
|
3449
3443
|
return { parse: x(function(r) {
|
|
3450
3444
|
if (r.stack && r.stack.match(t)) return this.parseV8OrIE(r);
|
|
@@ -3464,7 +3458,7 @@ var hs = wr((gs, yt) => {
|
|
|
3464
3458
|
var a = s.replace(/^\s+/, "").replace(/\(eval code/g, "(").replace(/^.*?\s+/, ""), i = a.match(/ (\(.+\)$)/);
|
|
3465
3459
|
a = i ? a.replace(i[0], "") : a;
|
|
3466
3460
|
var o = this.extractLocation(i ? i[1] : a), d = i && a || void 0, c = ["eval", "<anonymous>"].indexOf(o[0]) > -1 ? void 0 : o[0];
|
|
3467
|
-
return new
|
|
3461
|
+
return new st({ functionName: d, fileName: c, lineNumber: o[1], columnNumber: o[2], source: s });
|
|
3468
3462
|
}, this);
|
|
3469
3463
|
}, "ErrorStackParser$$parseV8OrIE"), parseFFOrSafari: x(function(r) {
|
|
3470
3464
|
var n = r.stack.split(`
|
|
@@ -3472,58 +3466,58 @@ var hs = wr((gs, yt) => {
|
|
|
3472
3466
|
return !s.match(e);
|
|
3473
3467
|
}, this);
|
|
3474
3468
|
return n.map(function(s) {
|
|
3475
|
-
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
|
|
3469
|
+
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 st({ functionName: s });
|
|
3476
3470
|
var a = /((.*".+"[^@]*)?[^@]*)(?:@)/, i = s.match(a), o = i && i[1] ? i[1] : void 0, d = this.extractLocation(s.replace(a, ""));
|
|
3477
|
-
return new
|
|
3471
|
+
return new st({ functionName: o, fileName: d[0], lineNumber: d[1], columnNumber: d[2], source: s });
|
|
3478
3472
|
}, this);
|
|
3479
3473
|
}, "ErrorStackParser$$parseFFOrSafari") };
|
|
3480
3474
|
}
|
|
3481
|
-
x(
|
|
3482
|
-
var
|
|
3475
|
+
x(Jt, "ErrorStackParser");
|
|
3476
|
+
var Kn = new Jt(), Xn = Kn, V = typeof process == "object" && typeof process.versions == "object" && typeof process.versions.node == "string" && !process.browser, Yt = V && typeof ht < "u" && typeof ht.exports < "u" && typeof Bt < "u" && typeof __dirname < "u", Qn = V && !Yt, es = typeof Deno < "u", Gt = !V && !es, ts = Gt && typeof window == "object" && typeof document == "object" && typeof document.createElement == "function" && "sessionStorage" in window && typeof importScripts != "function", rs = Gt && typeof importScripts == "function" && typeof self == "object";
|
|
3483
3477
|
typeof navigator == "object" && typeof navigator.userAgent == "string" && navigator.userAgent.indexOf("Chrome") == -1 && navigator.userAgent.indexOf("Safari") > -1;
|
|
3484
|
-
var
|
|
3485
|
-
async function
|
|
3486
|
-
if (!
|
|
3487
|
-
let t =
|
|
3478
|
+
var Kt, ut, Xt, Tt, yt;
|
|
3479
|
+
async function gt() {
|
|
3480
|
+
if (!V || (Kt = (await import("./__vite-browser-external-CPvbk0mb.js")).default, Tt = await import("./__vite-browser-external-CPvbk0mb.js"), yt = await import("./__vite-browser-external-CPvbk0mb.js"), Xt = (await import("./__vite-browser-external-CPvbk0mb.js")).default, ut = await import("./__vite-browser-external-CPvbk0mb.js"), vt = ut.sep, typeof Bt < "u")) return;
|
|
3481
|
+
let t = Tt, 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 };
|
|
3488
3482
|
globalThis.require = function(a) {
|
|
3489
3483
|
return s[a];
|
|
3490
3484
|
};
|
|
3491
3485
|
}
|
|
3492
|
-
x(
|
|
3486
|
+
x(gt, "initNodeModules");
|
|
3487
|
+
function Qt(t, e) {
|
|
3488
|
+
return ut.resolve(e || ".", t);
|
|
3489
|
+
}
|
|
3490
|
+
x(Qt, "node_resolvePath");
|
|
3493
3491
|
function er(t, e) {
|
|
3494
|
-
return
|
|
3492
|
+
return e === void 0 && (e = location), new URL(t, e).toString();
|
|
3495
3493
|
}
|
|
3496
|
-
x(er, "
|
|
3494
|
+
x(er, "browser_resolvePath");
|
|
3495
|
+
var lt;
|
|
3496
|
+
V ? lt = Qt : lt = er;
|
|
3497
|
+
var vt;
|
|
3498
|
+
V || (vt = "/");
|
|
3497
3499
|
function tr(t, e) {
|
|
3498
|
-
return
|
|
3500
|
+
return t.startsWith("file://") && (t = t.slice(7)), t.includes("://") ? { response: fetch(t) } : { binary: yt.readFile(t).then((r) => new Uint8Array(r.buffer, r.byteOffset, r.byteLength)) };
|
|
3499
3501
|
}
|
|
3500
|
-
x(tr, "
|
|
3501
|
-
var pt;
|
|
3502
|
-
z ? pt = er : pt = tr;
|
|
3503
|
-
var wt;
|
|
3504
|
-
z || (wt = "/");
|
|
3502
|
+
x(tr, "node_getBinaryResponse");
|
|
3505
3503
|
function rr(t, e) {
|
|
3506
|
-
return t.startsWith("file://") && (t = t.slice(7)), t.includes("://") ? { response: fetch(t) } : { binary: vt.readFile(t).then((r) => new Uint8Array(r.buffer, r.byteOffset, r.byteLength)) };
|
|
3507
|
-
}
|
|
3508
|
-
x(rr, "node_getBinaryResponse");
|
|
3509
|
-
function nr(t, e) {
|
|
3510
3504
|
let r = new URL(t, location);
|
|
3511
3505
|
return { response: fetch(r, e ? { integrity: e } : {}) };
|
|
3512
3506
|
}
|
|
3513
|
-
x(
|
|
3514
|
-
var
|
|
3515
|
-
|
|
3516
|
-
async function
|
|
3517
|
-
let { response: r, binary: n } =
|
|
3507
|
+
x(rr, "browser_getBinaryResponse");
|
|
3508
|
+
var Qe;
|
|
3509
|
+
V ? Qe = tr : Qe = rr;
|
|
3510
|
+
async function nr(t, e) {
|
|
3511
|
+
let { response: r, binary: n } = Qe(t, e);
|
|
3518
3512
|
if (n) return n;
|
|
3519
3513
|
let s = await r;
|
|
3520
3514
|
if (!s.ok) throw new Error(`Failed to load '${t}': request failed.`);
|
|
3521
3515
|
return new Uint8Array(await s.arrayBuffer());
|
|
3522
3516
|
}
|
|
3523
|
-
x(
|
|
3524
|
-
var
|
|
3525
|
-
if (
|
|
3526
|
-
else if (
|
|
3517
|
+
x(nr, "loadBinaryFile");
|
|
3518
|
+
var ze;
|
|
3519
|
+
if (ts) ze = x(async (t) => await import(t), "loadScript");
|
|
3520
|
+
else if (rs) ze = x(async (t) => {
|
|
3527
3521
|
try {
|
|
3528
3522
|
globalThis.importScripts(t);
|
|
3529
3523
|
} catch (e) {
|
|
@@ -3531,46 +3525,46 @@ var hs = wr((gs, yt) => {
|
|
|
3531
3525
|
else throw e;
|
|
3532
3526
|
}
|
|
3533
3527
|
}, "loadScript");
|
|
3534
|
-
else if (
|
|
3528
|
+
else if (V) ze = sr;
|
|
3535
3529
|
else throw new Error("Cannot determine runtime environment");
|
|
3536
|
-
async function
|
|
3537
|
-
t.startsWith("file://") && (t = t.slice(7)), t.includes("://") ?
|
|
3530
|
+
async function sr(t) {
|
|
3531
|
+
t.startsWith("file://") && (t = t.slice(7)), t.includes("://") ? Xt.runInThisContext(await (await fetch(t)).text()) : await import(Kt.pathToFileURL(t).href);
|
|
3538
3532
|
}
|
|
3539
|
-
x(
|
|
3540
|
-
async function
|
|
3541
|
-
if (
|
|
3542
|
-
await
|
|
3543
|
-
let e = await
|
|
3533
|
+
x(sr, "nodeLoadScript");
|
|
3534
|
+
async function ar(t) {
|
|
3535
|
+
if (V) {
|
|
3536
|
+
await gt();
|
|
3537
|
+
let e = await yt.readFile(t, { encoding: "utf8" });
|
|
3544
3538
|
return JSON.parse(e);
|
|
3545
3539
|
} else return await (await fetch(t)).json();
|
|
3546
3540
|
}
|
|
3547
|
-
x(
|
|
3548
|
-
async function
|
|
3549
|
-
if (
|
|
3541
|
+
x(ar, "loadLockFile");
|
|
3542
|
+
async function ir() {
|
|
3543
|
+
if (Yt) return __dirname;
|
|
3550
3544
|
let t;
|
|
3551
3545
|
try {
|
|
3552
3546
|
throw new Error();
|
|
3553
3547
|
} catch (n) {
|
|
3554
3548
|
t = n;
|
|
3555
3549
|
}
|
|
3556
|
-
let e =
|
|
3557
|
-
if (
|
|
3550
|
+
let e = Xn.parse(t)[0].fileName;
|
|
3551
|
+
if (V && !e.startsWith("file://") && (e = `file://${e}`), Qn) {
|
|
3558
3552
|
let n = await import("./__vite-browser-external-CPvbk0mb.js");
|
|
3559
3553
|
return (await import("./__vite-browser-external-CPvbk0mb.js")).fileURLToPath(n.dirname(e));
|
|
3560
3554
|
}
|
|
3561
|
-
let r = e.lastIndexOf(
|
|
3555
|
+
let r = e.lastIndexOf(vt);
|
|
3562
3556
|
if (r === -1) throw new Error("Could not extract indexURL path from pyodide module location");
|
|
3563
3557
|
return e.slice(0, r);
|
|
3564
3558
|
}
|
|
3565
|
-
x(
|
|
3566
|
-
function
|
|
3559
|
+
x(ir, "calculateDirname");
|
|
3560
|
+
function or(t) {
|
|
3567
3561
|
let e = t.FS, r = t.FS.filesystems.MEMFS, n = t.PATH, s = { DIR_MODE: 16895, FILE_MODE: 33279, mount: function(a) {
|
|
3568
3562
|
if (!a.opts.fileSystemHandle) throw new Error("opts.fileSystemHandle is required");
|
|
3569
3563
|
return r.mount.apply(null, arguments);
|
|
3570
3564
|
}, syncfs: async (a, i, o) => {
|
|
3571
3565
|
try {
|
|
3572
|
-
let d = s.getLocalSet(a), c = await s.getRemoteSet(a), l = i ? c : d,
|
|
3573
|
-
await s.reconcile(a, l,
|
|
3566
|
+
let d = s.getLocalSet(a), c = await s.getRemoteSet(a), l = i ? c : d, w = i ? d : c;
|
|
3567
|
+
await s.reconcile(a, l, w), o(null);
|
|
3574
3568
|
} catch (d) {
|
|
3575
3569
|
o(d);
|
|
3576
3570
|
}
|
|
@@ -3581,17 +3575,17 @@ var hs = wr((gs, yt) => {
|
|
|
3581
3575
|
}
|
|
3582
3576
|
x(o, "isRealDir");
|
|
3583
3577
|
function d(l) {
|
|
3584
|
-
return (
|
|
3578
|
+
return (w) => n.join2(l, w);
|
|
3585
3579
|
}
|
|
3586
3580
|
x(d, "toAbsolute");
|
|
3587
3581
|
let c = e.readdir(a.mountpoint).filter(o).map(d(a.mountpoint));
|
|
3588
3582
|
for (; c.length; ) {
|
|
3589
|
-
let l = c.pop(),
|
|
3590
|
-
e.isDir(
|
|
3583
|
+
let l = c.pop(), w = e.stat(l);
|
|
3584
|
+
e.isDir(w.mode) && c.push.apply(c, e.readdir(l).filter(o).map(d(l))), i[l] = { timestamp: w.mtime, mode: w.mode };
|
|
3591
3585
|
}
|
|
3592
3586
|
return { type: "local", entries: i };
|
|
3593
3587
|
}, getRemoteSet: async (a) => {
|
|
3594
|
-
let i = /* @__PURE__ */ Object.create(null), o = await
|
|
3588
|
+
let i = /* @__PURE__ */ Object.create(null), o = await ns(a.opts.fileSystemHandle);
|
|
3595
3589
|
for (let [d, c] of o) d !== "." && (i[n.join2(a.mountpoint, d)] = { timestamp: c.kind === "file" ? new Date((await c.getFile()).lastModified) : /* @__PURE__ */ new Date(), mode: c.kind === "file" ? s.FILE_MODE : s.DIR_MODE });
|
|
3596
3590
|
return { type: "remote", entries: i, handles: o };
|
|
3597
3591
|
}, loadLocalEntry: (a) => {
|
|
@@ -3627,34 +3621,34 @@ var hs = wr((gs, yt) => {
|
|
|
3627
3621
|
}, reconcile: async (a, i, o) => {
|
|
3628
3622
|
let d = 0, c = [];
|
|
3629
3623
|
Object.keys(i.entries).forEach(function(S) {
|
|
3630
|
-
let
|
|
3631
|
-
(!
|
|
3624
|
+
let C = i.entries[S], z = o.entries[S];
|
|
3625
|
+
(!z || e.isFile(C.mode) && C.timestamp.getTime() > z.timestamp.getTime()) && (c.push(S), d++);
|
|
3632
3626
|
}), c.sort();
|
|
3633
3627
|
let l = [];
|
|
3634
3628
|
if (Object.keys(o.entries).forEach(function(S) {
|
|
3635
3629
|
i.entries[S] || (l.push(S), d++);
|
|
3636
3630
|
}), l.sort().reverse(), !d) return;
|
|
3637
|
-
let
|
|
3631
|
+
let w = i.type === "remote" ? i.handles : o.handles;
|
|
3638
3632
|
for (let S of c) {
|
|
3639
|
-
let
|
|
3633
|
+
let C = n.normalize(S.replace(a.mountpoint, "/")).substring(1);
|
|
3640
3634
|
if (o.type === "local") {
|
|
3641
|
-
let
|
|
3642
|
-
s.storeLocalEntry(S,
|
|
3635
|
+
let z = w.get(C), De = await s.loadRemoteEntry(z);
|
|
3636
|
+
s.storeLocalEntry(S, De);
|
|
3643
3637
|
} else {
|
|
3644
|
-
let
|
|
3645
|
-
await s.storeRemoteEntry(
|
|
3638
|
+
let z = s.loadLocalEntry(S);
|
|
3639
|
+
await s.storeRemoteEntry(w, C, z);
|
|
3646
3640
|
}
|
|
3647
3641
|
}
|
|
3648
3642
|
for (let S of l) if (o.type === "local") s.removeLocalEntry(S);
|
|
3649
3643
|
else {
|
|
3650
|
-
let
|
|
3651
|
-
await s.removeRemoteEntry(
|
|
3644
|
+
let C = n.normalize(S.replace(a.mountpoint, "/")).substring(1);
|
|
3645
|
+
await s.removeRemoteEntry(w, C);
|
|
3652
3646
|
}
|
|
3653
3647
|
} };
|
|
3654
3648
|
t.FS.filesystems.NATIVEFS_ASYNC = s;
|
|
3655
3649
|
}
|
|
3656
|
-
x(
|
|
3657
|
-
var
|
|
3650
|
+
x(or, "initializeNativeFS");
|
|
3651
|
+
var ns = x(async (t) => {
|
|
3658
3652
|
let e = [];
|
|
3659
3653
|
async function r(s) {
|
|
3660
3654
|
for await (let a of s.values()) e.push(a), a.kind === "directory" && await r(a);
|
|
@@ -3668,14 +3662,14 @@ var hs = wr((gs, yt) => {
|
|
|
3668
3662
|
}
|
|
3669
3663
|
return n;
|
|
3670
3664
|
}, "getFsHandles");
|
|
3671
|
-
function
|
|
3672
|
-
let e = { noImageDecoding: !0, noAudioDecoding: !0, noWasmDecoding: !1, preRun:
|
|
3665
|
+
function dr(t) {
|
|
3666
|
+
let e = { noImageDecoding: !0, noAudioDecoding: !0, noWasmDecoding: !1, preRun: pr(t), quit(r, n) {
|
|
3673
3667
|
throw e.exited = { status: r, toThrow: n }, n;
|
|
3674
|
-
}, print: t.stdout, printErr: t.stderr, thisProgram: t._sysExecutable, arguments: t.args, API: { config: t }, locateFile: (r) => t.indexURL + r, instantiateWasm:
|
|
3668
|
+
}, print: t.stdout, printErr: t.stderr, thisProgram: t._sysExecutable, arguments: t.args, API: { config: t }, locateFile: (r) => t.indexURL + r, instantiateWasm: hr(t.indexURL) };
|
|
3675
3669
|
return e;
|
|
3676
3670
|
}
|
|
3677
|
-
x(
|
|
3678
|
-
function
|
|
3671
|
+
x(dr, "createSettings");
|
|
3672
|
+
function cr(t) {
|
|
3679
3673
|
return function(e) {
|
|
3680
3674
|
let r = "/";
|
|
3681
3675
|
try {
|
|
@@ -3686,14 +3680,14 @@ var hs = wr((gs, yt) => {
|
|
|
3686
3680
|
e.FS.chdir(t);
|
|
3687
3681
|
};
|
|
3688
3682
|
}
|
|
3689
|
-
x(
|
|
3690
|
-
function
|
|
3683
|
+
x(cr, "createHomeDirectory");
|
|
3684
|
+
function ur(t) {
|
|
3691
3685
|
return function(e) {
|
|
3692
3686
|
Object.assign(e.ENV, t);
|
|
3693
3687
|
};
|
|
3694
3688
|
}
|
|
3695
|
-
x(
|
|
3696
|
-
function
|
|
3689
|
+
x(ur, "setEnvironment");
|
|
3690
|
+
function lr(t) {
|
|
3697
3691
|
return t ? [async (e) => {
|
|
3698
3692
|
e.addRunDependency("fsInitHook");
|
|
3699
3693
|
try {
|
|
@@ -3703,9 +3697,9 @@ var hs = wr((gs, yt) => {
|
|
|
3703
3697
|
}
|
|
3704
3698
|
}] : [];
|
|
3705
3699
|
}
|
|
3706
|
-
x(
|
|
3707
|
-
function
|
|
3708
|
-
let e =
|
|
3700
|
+
x(lr, "callFsInitHook");
|
|
3701
|
+
function fr(t) {
|
|
3702
|
+
let e = nr(t);
|
|
3709
3703
|
return async (r) => {
|
|
3710
3704
|
let n = r._py_version_major(), s = r._py_version_minor();
|
|
3711
3705
|
r.FS.mkdirTree("/lib"), r.API.sitePackages = `/lib/python${n}.${s}/site-packages`, r.FS.mkdirTree(r.API.sitePackages), r.addRunDependency("install-stdlib");
|
|
@@ -3719,15 +3713,15 @@ var hs = wr((gs, yt) => {
|
|
|
3719
3713
|
}
|
|
3720
3714
|
};
|
|
3721
3715
|
}
|
|
3722
|
-
x(
|
|
3723
|
-
function
|
|
3716
|
+
x(fr, "installStdlib");
|
|
3717
|
+
function pr(t) {
|
|
3724
3718
|
let e;
|
|
3725
|
-
return t.stdLibURL != null ? e = t.stdLibURL : e = t.indexURL + "python_stdlib.zip", [...
|
|
3719
|
+
return t.stdLibURL != null ? e = t.stdLibURL : e = t.indexURL + "python_stdlib.zip", [...lr(t.fsInit), fr(e), cr(t.env.HOME), ur(t.env), or];
|
|
3726
3720
|
}
|
|
3727
|
-
x(
|
|
3728
|
-
function
|
|
3721
|
+
x(pr, "getFileSystemInitializationFuncs");
|
|
3722
|
+
function hr(t) {
|
|
3729
3723
|
if (typeof WasmOffsetConverter < "u") return;
|
|
3730
|
-
let { binary: e, response: r } =
|
|
3724
|
+
let { binary: e, response: r } = Qe(t + "pyodide.asm.wasm");
|
|
3731
3725
|
return function(n, s) {
|
|
3732
3726
|
return async function() {
|
|
3733
3727
|
try {
|
|
@@ -3741,19 +3735,19 @@ var hs = wr((gs, yt) => {
|
|
|
3741
3735
|
}(), {};
|
|
3742
3736
|
};
|
|
3743
3737
|
}
|
|
3744
|
-
x(
|
|
3745
|
-
var
|
|
3746
|
-
async function
|
|
3738
|
+
x(hr, "getInstantiateWasmFunc");
|
|
3739
|
+
var ft = "0.27.5";
|
|
3740
|
+
async function pt(t = {}) {
|
|
3747
3741
|
var e, r;
|
|
3748
|
-
await
|
|
3749
|
-
let n = t.indexURL || await
|
|
3750
|
-
n =
|
|
3742
|
+
await gt();
|
|
3743
|
+
let n = t.indexURL || await ir();
|
|
3744
|
+
n = lt(n), n.endsWith("/") || (n += "/"), t.indexURL = n;
|
|
3751
3745
|
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);
|
|
3752
3746
|
(e = a.env).HOME ?? (e.HOME = "/home/pyodide"), (r = a.env).PYTHONINSPECT ?? (r.PYTHONINSPECT = "1");
|
|
3753
|
-
let i =
|
|
3754
|
-
if (o.lockFilePromise =
|
|
3747
|
+
let i = dr(a), o = i.API;
|
|
3748
|
+
if (o.lockFilePromise = ar(a.lockFileURL), typeof _createPyodideModule != "function") {
|
|
3755
3749
|
let S = `${a.indexURL}pyodide.asm.js`;
|
|
3756
|
-
await
|
|
3750
|
+
await ze(S);
|
|
3757
3751
|
}
|
|
3758
3752
|
let d;
|
|
3759
3753
|
if (t._loadSnapshot) {
|
|
@@ -3762,52 +3756,52 @@ var hs = wr((gs, yt) => {
|
|
|
3762
3756
|
}
|
|
3763
3757
|
let c = await _createPyodideModule(i);
|
|
3764
3758
|
if (i.exited) throw i.exited.toThrow;
|
|
3765
|
-
if (t.pyproxyToStringRepr && o.setPyProxyToStringMethod(!0), o.version !==
|
|
3759
|
+
if (t.pyproxyToStringRepr && o.setPyProxyToStringMethod(!0), o.version !== ft && a.checkAPIVersion) throw new Error(`Pyodide version does not match: '${ft}' <==> '${o.version}'. If you updated the Pyodide version, make sure you also updated the 'indexURL' parameter passed to loadPyodide.`);
|
|
3766
3760
|
c.locateFile = (S) => {
|
|
3767
3761
|
throw new Error("Didn't expect to load any more file_packager files!");
|
|
3768
3762
|
};
|
|
3769
3763
|
let l;
|
|
3770
3764
|
d && (l = o.restoreSnapshot(d));
|
|
3771
|
-
let
|
|
3772
|
-
return o.sys.path.insert(0, o.config.env.HOME),
|
|
3765
|
+
let w = o.finalizeBootstrap(l, t._snapshotDeserializer);
|
|
3766
|
+
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;
|
|
3773
3767
|
}
|
|
3774
|
-
x(
|
|
3775
|
-
function
|
|
3768
|
+
x(pt, "loadPyodide");
|
|
3769
|
+
function Se(t) {
|
|
3776
3770
|
return t.FS;
|
|
3777
3771
|
}
|
|
3778
|
-
const
|
|
3779
|
-
NOTEBOOK_FILENAME:
|
|
3780
|
-
HOME_DIR:
|
|
3772
|
+
const Et = (t) => new TextDecoder().decode(t), be = "notebook.py", we = "/marimo", ne = {
|
|
3773
|
+
NOTEBOOK_FILENAME: be,
|
|
3774
|
+
HOME_DIR: we,
|
|
3781
3775
|
createHomeDir: (t) => {
|
|
3782
|
-
const e =
|
|
3776
|
+
const e = Se(t);
|
|
3783
3777
|
try {
|
|
3784
|
-
e.mkdirTree(
|
|
3778
|
+
e.mkdirTree(we);
|
|
3785
3779
|
} catch {
|
|
3786
3780
|
}
|
|
3787
|
-
e.chdir(
|
|
3781
|
+
e.chdir(we);
|
|
3788
3782
|
},
|
|
3789
3783
|
mountFS: (t) => {
|
|
3790
|
-
|
|
3784
|
+
Se(t).mount(t.FS.filesystems.IDBFS, { root: "." }, we);
|
|
3791
3785
|
},
|
|
3792
3786
|
populateFilesToMemory: async (t) => {
|
|
3793
|
-
await
|
|
3787
|
+
await Ot(t, !0);
|
|
3794
3788
|
},
|
|
3795
3789
|
persistFilesToRemote: async (t) => {
|
|
3796
|
-
await
|
|
3790
|
+
await Ot(t, !1);
|
|
3797
3791
|
},
|
|
3798
3792
|
readNotebook: (t) => {
|
|
3799
|
-
const e =
|
|
3800
|
-
return
|
|
3793
|
+
const e = Se(t), r = `${we}/${be}`;
|
|
3794
|
+
return Et(e.readFile(r));
|
|
3801
3795
|
},
|
|
3802
3796
|
initNotebookCode: (t) => {
|
|
3803
|
-
const { pyodide: e, filename: r, code: n } = t, s =
|
|
3797
|
+
const { pyodide: e, filename: r, code: n } = t, s = Se(e), a = (i) => {
|
|
3804
3798
|
try {
|
|
3805
|
-
return
|
|
3799
|
+
return Et(s.readFile(i));
|
|
3806
3800
|
} catch {
|
|
3807
3801
|
return null;
|
|
3808
3802
|
}
|
|
3809
3803
|
};
|
|
3810
|
-
if (r && r !==
|
|
3804
|
+
if (r && r !== be) {
|
|
3811
3805
|
const i = a(r);
|
|
3812
3806
|
if (i)
|
|
3813
3807
|
return {
|
|
@@ -3815,15 +3809,15 @@ var hs = wr((gs, yt) => {
|
|
|
3815
3809
|
filename: r
|
|
3816
3810
|
};
|
|
3817
3811
|
}
|
|
3818
|
-
return s.writeFile(
|
|
3812
|
+
return s.writeFile(be, n), {
|
|
3819
3813
|
code: n,
|
|
3820
|
-
filename:
|
|
3814
|
+
filename: be
|
|
3821
3815
|
};
|
|
3822
3816
|
}
|
|
3823
3817
|
};
|
|
3824
|
-
function
|
|
3818
|
+
function Ot(t, e) {
|
|
3825
3819
|
return new Promise((r, n) => {
|
|
3826
|
-
|
|
3820
|
+
Se(t).syncfs(e, (s) => {
|
|
3827
3821
|
if (s instanceof Error) {
|
|
3828
3822
|
n(s);
|
|
3829
3823
|
return;
|
|
@@ -3832,7 +3826,7 @@ var hs = wr((gs, yt) => {
|
|
|
3832
3826
|
});
|
|
3833
3827
|
});
|
|
3834
3828
|
}
|
|
3835
|
-
class
|
|
3829
|
+
class ss {
|
|
3836
3830
|
constructor() {
|
|
3837
3831
|
this.spans = [];
|
|
3838
3832
|
}
|
|
@@ -3874,25 +3868,25 @@ var hs = wr((gs, yt) => {
|
|
|
3874
3868
|
logSpans() {
|
|
3875
3869
|
}
|
|
3876
3870
|
}
|
|
3877
|
-
const
|
|
3878
|
-
globalThis.t =
|
|
3879
|
-
const
|
|
3880
|
-
class
|
|
3871
|
+
const fe = new ss();
|
|
3872
|
+
globalThis.t = fe;
|
|
3873
|
+
const as = !1;
|
|
3874
|
+
class is {
|
|
3881
3875
|
constructor() {
|
|
3882
3876
|
this.pyodide = null;
|
|
3883
3877
|
}
|
|
3884
3878
|
get requirePyodide() {
|
|
3885
|
-
return
|
|
3879
|
+
return zt(this.pyodide, "Pyodide not loaded"), this.pyodide;
|
|
3886
3880
|
}
|
|
3887
3881
|
async bootstrap(e) {
|
|
3888
3882
|
return await this.loadPyodideAndPackages(e);
|
|
3889
3883
|
}
|
|
3890
3884
|
async loadPyodideAndPackages(e) {
|
|
3891
|
-
if (!
|
|
3885
|
+
if (!pt)
|
|
3892
3886
|
throw new Error("loadPyodide is not defined");
|
|
3893
|
-
const r =
|
|
3887
|
+
const r = fe.startSpan("loadPyodide");
|
|
3894
3888
|
try {
|
|
3895
|
-
const n = await
|
|
3889
|
+
const n = await pt({
|
|
3896
3890
|
// Perf: These get loaded while pyodide is being bootstrapped
|
|
3897
3891
|
packages: [
|
|
3898
3892
|
"micropip",
|
|
@@ -3902,7 +3896,7 @@ var hs = wr((gs, yt) => {
|
|
|
3902
3896
|
"narwhals",
|
|
3903
3897
|
"packaging"
|
|
3904
3898
|
],
|
|
3905
|
-
_makeSnapshot:
|
|
3899
|
+
_makeSnapshot: as,
|
|
3906
3900
|
lockFileURL: `https://wasm.marimo.app/pyodide-lock.json?v=${e.version}&pyodide=${e.pyodideVersion}`,
|
|
3907
3901
|
// Without this, this fails in Firefox with
|
|
3908
3902
|
// `Could not extract indexURL path from pyodide module`
|
|
@@ -3915,8 +3909,8 @@ var hs = wr((gs, yt) => {
|
|
|
3915
3909
|
}
|
|
3916
3910
|
}
|
|
3917
3911
|
async mountFilesystem(e) {
|
|
3918
|
-
const r =
|
|
3919
|
-
return
|
|
3912
|
+
const r = fe.startSpan("mountFilesystem");
|
|
3913
|
+
return ne.createHomeDir(this.requirePyodide), ne.mountFS(this.requirePyodide), await ne.populateFilesToMemory(this.requirePyodide), r.end("ok"), ne.initNotebookCode({
|
|
3920
3914
|
pyodide: this.requirePyodide,
|
|
3921
3915
|
code: e.code,
|
|
3922
3916
|
filename: e.filename
|
|
@@ -3927,7 +3921,7 @@ var hs = wr((gs, yt) => {
|
|
|
3927
3921
|
self.messenger = {
|
|
3928
3922
|
callback: s
|
|
3929
3923
|
}, self.query_params = a, self.user_config = i;
|
|
3930
|
-
const o =
|
|
3924
|
+
const o = fe.startSpan("startSession.runPython"), d = n || ne.NOTEBOOK_FILENAME, [c, l, w] = this.requirePyodide.runPython(
|
|
3931
3925
|
`
|
|
3932
3926
|
print("[py] Starting marimo...")
|
|
3933
3927
|
import asyncio
|
|
@@ -3955,7 +3949,7 @@ var hs = wr((gs, yt) => {
|
|
|
3955
3949
|
bridge, init, packages`
|
|
3956
3950
|
);
|
|
3957
3951
|
o.end();
|
|
3958
|
-
const S = new Set(
|
|
3952
|
+
const S = new Set(w.toJs());
|
|
3959
3953
|
return this.loadNotebookDeps(r, S).then(() => l(i.runtime.auto_instantiate)), c;
|
|
3960
3954
|
}
|
|
3961
3955
|
async loadNotebookDeps(e, r) {
|
|
@@ -3970,11 +3964,11 @@ ${e}`, e = `import jedi
|
|
|
3970
3964
|
${e}`, e = `import pyodide_http
|
|
3971
3965
|
${e}`;
|
|
3972
3966
|
const s = [...r];
|
|
3973
|
-
let a =
|
|
3967
|
+
let a = fe.startSpan("pyodide.loadPackage");
|
|
3974
3968
|
await n.loadPackagesFromImports(e, {
|
|
3975
3969
|
errorCallback: W.error,
|
|
3976
3970
|
messageCallback: W.log
|
|
3977
|
-
}), a.end(), a =
|
|
3971
|
+
}), a.end(), a = fe.startSpan("micropip.install");
|
|
3978
3972
|
const i = s.filter(
|
|
3979
3973
|
(o) => !n.loadedPackages[o]
|
|
3980
3974
|
);
|
|
@@ -3991,14 +3985,14 @@ ${e}`;
|
|
|
3991
3985
|
}), a.end();
|
|
3992
3986
|
}
|
|
3993
3987
|
}
|
|
3994
|
-
class
|
|
3988
|
+
class os extends is {
|
|
3995
3989
|
async bootstrap(e) {
|
|
3996
3990
|
return await super.bootstrap(e);
|
|
3997
3991
|
}
|
|
3998
3992
|
async mountFilesystem(e) {
|
|
3999
3993
|
const { code: r, filename: n } = e;
|
|
4000
3994
|
try {
|
|
4001
|
-
return
|
|
3995
|
+
return ne.createHomeDir(this.requirePyodide), ne.initNotebookCode({
|
|
4002
3996
|
pyodide: this.requirePyodide,
|
|
4003
3997
|
code: r,
|
|
4004
3998
|
filename: n
|
|
@@ -4014,50 +4008,50 @@ ${e}`;
|
|
|
4014
4008
|
code: e.code,
|
|
4015
4009
|
filename: e.filename,
|
|
4016
4010
|
onMessage: e.onMessage,
|
|
4017
|
-
userConfig:
|
|
4011
|
+
userConfig: Wn()
|
|
4018
4012
|
});
|
|
4019
4013
|
}
|
|
4020
4014
|
}
|
|
4021
|
-
const
|
|
4022
|
-
function
|
|
4023
|
-
return t.includes("dev") &&
|
|
4015
|
+
const ds = !1;
|
|
4016
|
+
function cs(t) {
|
|
4017
|
+
return t.includes("dev") && ds ? "dev" : `v${ft}`;
|
|
4024
4018
|
}
|
|
4025
|
-
async function
|
|
4026
|
-
const t =
|
|
4019
|
+
async function us() {
|
|
4020
|
+
const t = fs(), e = cs(t);
|
|
4027
4021
|
try {
|
|
4028
|
-
self.controller = new
|
|
4022
|
+
self.controller = new os(), self.pyodide = await self.controller.bootstrap({
|
|
4029
4023
|
version: t,
|
|
4030
4024
|
pyodideVersion: e
|
|
4031
4025
|
});
|
|
4032
4026
|
} catch (r) {
|
|
4033
|
-
W.error("Error bootstrapping", r),
|
|
4034
|
-
error:
|
|
4027
|
+
W.error("Error bootstrapping", r), ve.send.initializedError({
|
|
4028
|
+
error: Lt(r)
|
|
4035
4029
|
});
|
|
4036
4030
|
}
|
|
4037
4031
|
}
|
|
4038
|
-
const
|
|
4032
|
+
const qe = us(), mr = new Vn(
|
|
4039
4033
|
(t) => {
|
|
4040
|
-
|
|
4034
|
+
ve.send.kernelMessage({ message: t });
|
|
4041
4035
|
}
|
|
4042
|
-
),
|
|
4036
|
+
), Nt = new br(), ls = {
|
|
4043
4037
|
/**
|
|
4044
4038
|
* Start the session
|
|
4045
4039
|
*/
|
|
4046
4040
|
startSession: async (t) => {
|
|
4047
|
-
await
|
|
4041
|
+
await qe;
|
|
4048
4042
|
try {
|
|
4049
|
-
|
|
4043
|
+
zt(self.controller, "Controller not loaded");
|
|
4050
4044
|
const e = await self.controller.mountFilesystem({
|
|
4051
4045
|
code: t.code,
|
|
4052
4046
|
filename: `app-${t.appId}.py`
|
|
4053
4047
|
}), r = await self.controller.startSession({
|
|
4054
4048
|
...e,
|
|
4055
|
-
onMessage:
|
|
4049
|
+
onMessage: mr.push
|
|
4056
4050
|
});
|
|
4057
|
-
|
|
4051
|
+
Nt.resolve(r), ve.send.initialized({});
|
|
4058
4052
|
} catch (e) {
|
|
4059
|
-
|
|
4060
|
-
error:
|
|
4053
|
+
ve.send.initializedError({
|
|
4054
|
+
error: Lt(e)
|
|
4061
4055
|
});
|
|
4062
4056
|
}
|
|
4063
4057
|
},
|
|
@@ -4065,7 +4059,7 @@ ${e}`;
|
|
|
4065
4059
|
* Load packages
|
|
4066
4060
|
*/
|
|
4067
4061
|
loadPackages: async (t) => {
|
|
4068
|
-
await
|
|
4062
|
+
await qe, t.includes("mo.sql") && (t = `import pandas
|
|
4069
4063
|
${t}`, t = `import duckdb
|
|
4070
4064
|
${t}`, t = `import sqlglot
|
|
4071
4065
|
${t}`, t.includes("polars") && (t = `import pyarrow
|
|
@@ -4078,8 +4072,8 @@ ${t}`)), await self.pyodide.loadPackagesFromImports(t, {
|
|
|
4078
4072
|
* Call a function on the bridge
|
|
4079
4073
|
*/
|
|
4080
4074
|
bridge: async (t) => {
|
|
4081
|
-
await
|
|
4082
|
-
const { functionName: e, payload: r } = t, n = await
|
|
4075
|
+
await qe;
|
|
4076
|
+
const { functionName: e, payload: r } = t, n = await Nt.promise, s = r == null ? null : typeof r == "string" ? r : JSON.stringify(r), a = s == null ? (
|
|
4083
4077
|
// @ts-expect-error ehh TypeScript
|
|
4084
4078
|
await n[e]()
|
|
4085
4079
|
) : (
|
|
@@ -4088,18 +4082,18 @@ ${t}`)), await self.pyodide.loadPackagesFromImports(t, {
|
|
|
4088
4082
|
);
|
|
4089
4083
|
return typeof a == "string" ? JSON.parse(a) : a;
|
|
4090
4084
|
}
|
|
4091
|
-
},
|
|
4092
|
-
transport:
|
|
4093
|
-
transportId:
|
|
4085
|
+
}, ve = Zn({
|
|
4086
|
+
transport: Dn({
|
|
4087
|
+
transportId: Ln
|
|
4094
4088
|
}),
|
|
4095
|
-
requestHandler:
|
|
4089
|
+
requestHandler: ls
|
|
4096
4090
|
});
|
|
4097
|
-
|
|
4098
|
-
|
|
4099
|
-
await
|
|
4091
|
+
ve.send("ready", {});
|
|
4092
|
+
ve.addMessageListener("consumerReady", async () => {
|
|
4093
|
+
await qe, mr.start();
|
|
4100
4094
|
});
|
|
4101
|
-
function
|
|
4095
|
+
function fs() {
|
|
4102
4096
|
return self.name;
|
|
4103
4097
|
}
|
|
4104
4098
|
});
|
|
4105
|
-
export default
|
|
4099
|
+
export default ps();
|