@marimo-team/islands 0.14.11-dev44 → 0.14.11-dev45
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-DZ_66N_p.js → ConnectedDataExplorerComponent-D_VZFrWe.js} +2 -2
- package/dist/{ImageComparisonComponent-CJ_XusM2.js → ImageComparisonComponent-BnrzrDfk.js} +1 -1
- package/dist/{VegaLite-DFuwZ6tC.js → VegaLite-wqmltzFk.js} +3 -3
- package/dist/{_baseUniq-CyOllyUX.js → _baseUniq-CW4zu_DC.js} +1 -1
- package/dist/{any-language-editor-LJ23VL7y.js → any-language-editor-B5iMbkMt.js} +1 -1
- package/dist/{architectureDiagram-NQ2NVSRB-C-5-NYK2.js → architectureDiagram-NQ2NVSRB-CGlVQ_9F.js} +5 -5
- package/dist/assets/{worker-Bfk1FrzG.js → worker-BLUAwPAO.js} +506 -505
- package/dist/{blockDiagram-PHRCVELO-CJvg9kxQ.js → blockDiagram-PHRCVELO-b2wKOB53.js} +5 -5
- package/dist/{c4Diagram-6F6E4RAY-DXa9X0mD.js → c4Diagram-6F6E4RAY-D2N9ol9b.js} +2 -2
- package/dist/{channel-1nigxPwc.js → channel-fUvrimOy.js} +1 -1
- package/dist/{chunk-353BL4L5-fa6fUmDf.js → chunk-353BL4L5-CPzsYDvl.js} +1 -1
- package/dist/{chunk-67H74DCK-Bzu6Wnkl.js → chunk-67H74DCK-Br62ckur.js} +1 -1
- package/dist/{chunk-6OLS64BW-RbXGGJDS.js → chunk-6OLS64BW-Bbu9kSvy.js} +3 -3
- package/dist/{chunk-AACKK3MU-KTTntYbB.js → chunk-AACKK3MU-BVQghPX_.js} +1 -1
- package/dist/{chunk-BFAMUDN2-C2JvcPSH.js → chunk-BFAMUDN2-rstejIq8.js} +1 -1
- package/dist/{chunk-E2GYISFI-D4DiImm9.js → chunk-E2GYISFI-n2bzExB9.js} +1 -1
- package/dist/{chunk-QEP2MXWD-CPjMZvjG.js → chunk-QEP2MXWD-C-897owL.js} +4 -4
- package/dist/{chunk-SKB7J2MH-BNDZWFKn.js → chunk-SKB7J2MH-CSReEQEQ.js} +1 -1
- package/dist/{classDiagram-v2-O24JOBDK-C7LmlJaK.js → classDiagram-BGRH5UQR-DUfcgu2w.js} +2 -2
- package/dist/{classDiagram-BGRH5UQR-C7LmlJaK.js → classDiagram-v2-O24JOBDK-DUfcgu2w.js} +2 -2
- package/dist/{clone-DEHVykzo.js → clone-CAZltIIA.js} +1 -1
- package/dist/{dagre-FFZHY6LT-BUGqgPJp.js → dagre-FFZHY6LT-3P1oM6iM.js} +6 -6
- package/dist/{data-editor-DOsImV2x.js → data-editor-DtwM73pn.js} +1 -1
- package/dist/{diagram-3EMPZRKU-B_fSAcTl.js → diagram-3EMPZRKU-DuQA9zRa.js} +6 -6
- package/dist/{diagram-5UYTHUR4-DWN9TeSQ.js → diagram-5UYTHUR4-BKtM0Ef7.js} +3 -3
- package/dist/{diagram-ZTM2IBQH-Bw5QsERC.js → diagram-ZTM2IBQH-CMxTO7F8.js} +3 -3
- package/dist/{erDiagram-R3QVA2FD-BQxcS2du.js → erDiagram-R3QVA2FD-CmSbk6-K.js} +4 -4
- package/dist/{flowDiagram-PKI6S5ZS-BlayOYcx.js → flowDiagram-PKI6S5ZS-CR0vKcqk.js} +5 -5
- package/dist/{ganttDiagram-EK5VF46D-C5UZHXTU.js → ganttDiagram-EK5VF46D-CF_bXfaf.js} +4 -4
- package/dist/{gitGraphDiagram-GW3U2K7C-er32Gey7.js → gitGraphDiagram-GW3U2K7C-Da4479V1.js} +4 -4
- package/dist/{graph-CQN4Lxfn.js → graph-BDjcWK-h.js} +3 -3
- package/dist/{index-BfyV4UWs.js → index-B6jsK579.js} +1 -1
- package/dist/{index-BslDHspx.js → index-BsV3Hc_j.js} +3 -3
- package/dist/{index-Q88FIDAu.js → index-Ck3v5Nr0.js} +1 -1
- package/dist/{index-s6eGj1oR.js → index-laPXyGbH.js} +1 -1
- package/dist/{infoDiagram-RLU2ROGC--WgUAx5o.js → infoDiagram-RLU2ROGC-BxXv2q1O.js} +2 -2
- package/dist/{journeyDiagram-EWQZEKCU-C2E2-68x.js → journeyDiagram-EWQZEKCU-BfAogm4Y.js} +3 -3
- package/dist/{kanban-definition-ILFWEQ3N-BpHCy5nk.js → kanban-definition-ILFWEQ3N--B2KU3i9.js} +2 -2
- package/dist/{layout-d3u5lw3x.js → layout-CsbDiSn-.js} +4 -4
- package/dist/{linear-7sNNj-ic.js → linear-DJQ5Bwo1.js} +1 -1
- package/dist/{main-Cy3_1oYT.js → main-D87mRik0.js} +3564 -3563
- package/dist/main.js +1 -1
- package/dist/{mermaid-D4fMV-vc.js → mermaid-B-tenK4z.js} +29 -29
- package/dist/{min-CI0vm9Vj.js → min-F5h_nj6-.js} +2 -2
- package/dist/{mindmap-definition-CZNETY7S-DKBwXdVL.js → mindmap-definition-CZNETY7S-DcDNz8eE.js} +2 -2
- package/dist/{pieDiagram-NIOCPIFQ-CKvDCSFa.js → pieDiagram-NIOCPIFQ-G4B8nW-1.js} +3 -3
- package/dist/{quadrantDiagram-2OG54O6I-B01MF4Uw.js → quadrantDiagram-2OG54O6I-Ewc37SDl.js} +2 -2
- package/dist/{react-plotly-CiTUCDvC.js → react-plotly-DH8EDCRG.js} +1 -1
- package/dist/{requirementDiagram-SO3GGRV7-CU1IVl5U.js → requirementDiagram-SO3GGRV7-B_CnGism.js} +3 -3
- package/dist/{sankeyDiagram-4UZDY2LN-DdvfMsoK.js → sankeyDiagram-4UZDY2LN-7sLRvJVP.js} +1 -1
- package/dist/{sequenceDiagram-ZIKVLSP4-BulavigO.js → sequenceDiagram-ZIKVLSP4-CwuOH1p_.js} +3 -3
- package/dist/{slides-component-3aBs3hq3.js → slides-component-DkDSqJAl.js} +1 -1
- package/dist/{stateDiagram-XX37X6EN-Bnw0qUOu.js → stateDiagram-XX37X6EN-memRrrC1.js} +4 -4
- package/dist/{stateDiagram-v2-GD6S3NHB-iKOHUKaX.js → stateDiagram-v2-GD6S3NHB-BIsIz24I.js} +2 -2
- package/dist/{time-BmWWl7BJ.js → time-CuTyisRC.js} +2 -2
- package/dist/{timeline-definition-RI47OAVP-CYsH9Bpi.js → timeline-definition-RI47OAVP-DGmYjoup.js} +1 -1
- package/dist/{treemap-FKARHQ26-D2UW6XmB.js → treemap-FKARHQ26-CP0UNfel.js} +5 -5
- package/dist/{vega-component-Dpt8psM1.js → vega-component-CGrZH0sG.js} +2 -2
- package/dist/{xychartDiagram-H2YORKM3-CcWkTSoR.js → xychartDiagram-H2YORKM3-C1htmIph.js} +2 -2
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
var
|
|
2
|
-
var kn =
|
|
1
|
+
var sr = (t, e) => () => (e || t((e = { exports: {} }).exports, e), e.exports);
|
|
2
|
+
var kn = sr((xn, Ye) => {
|
|
3
3
|
const ir = 1e10, or = 1e3;
|
|
4
|
-
function
|
|
4
|
+
function we(t, e) {
|
|
5
5
|
const r = t.map((n) => `"${n}"`).join(", ");
|
|
6
6
|
return new Error(`This RPC instance cannot ${e} because the transport did not provide one or more of these methods: ${r}`);
|
|
7
7
|
}
|
|
@@ -11,16 +11,16 @@ var kn = ar((xn, Ye) => {
|
|
|
11
11
|
e = y;
|
|
12
12
|
}
|
|
13
13
|
let n = {};
|
|
14
|
-
function
|
|
15
|
-
n.unregisterHandler && n.unregisterHandler(), n = y, n.registerHandler?.(
|
|
14
|
+
function a(y) {
|
|
15
|
+
n.unregisterHandler && n.unregisterHandler(), n = y, n.registerHandler?.(ar);
|
|
16
16
|
}
|
|
17
|
-
let
|
|
17
|
+
let s;
|
|
18
18
|
function i(y) {
|
|
19
19
|
if (typeof y == "function") {
|
|
20
|
-
|
|
20
|
+
s = y;
|
|
21
21
|
return;
|
|
22
22
|
}
|
|
23
|
-
|
|
23
|
+
s = (b, E) => {
|
|
24
24
|
const C = y[b];
|
|
25
25
|
if (C)
|
|
26
26
|
return C(E);
|
|
@@ -31,7 +31,7 @@ var kn = ar((xn, Ye) => {
|
|
|
31
31
|
};
|
|
32
32
|
}
|
|
33
33
|
const { maxRequestTime: o = or } = t;
|
|
34
|
-
t.transport &&
|
|
34
|
+
t.transport && a(t.transport), t.requestHandler && i(t.requestHandler), t._debugHooks && r(t._debugHooks);
|
|
35
35
|
let d = 0;
|
|
36
36
|
function l() {
|
|
37
37
|
return d <= ir ? ++d : d = 0;
|
|
@@ -41,7 +41,7 @@ var kn = ar((xn, Ye) => {
|
|
|
41
41
|
const E = b[0];
|
|
42
42
|
return new Promise((C, $) => {
|
|
43
43
|
if (!n.send)
|
|
44
|
-
throw
|
|
44
|
+
throw we(["send"], "make requests");
|
|
45
45
|
const z = l(), rt = {
|
|
46
46
|
type: "request",
|
|
47
47
|
id: z,
|
|
@@ -56,10 +56,10 @@ var kn = ar((xn, Ye) => {
|
|
|
56
56
|
const j = new Proxy(S, {
|
|
57
57
|
get: (y, b, E) => b in y ? Reflect.get(y, b, E) : (C) => S(b, C)
|
|
58
58
|
}), L = j;
|
|
59
|
-
function
|
|
59
|
+
function ke(y, ...b) {
|
|
60
60
|
const E = b[0];
|
|
61
61
|
if (!n.send)
|
|
62
|
-
throw
|
|
62
|
+
throw we(["send"], "send messages");
|
|
63
63
|
const C = {
|
|
64
64
|
type: "message",
|
|
65
65
|
id: y,
|
|
@@ -67,12 +67,12 @@ var kn = ar((xn, Ye) => {
|
|
|
67
67
|
};
|
|
68
68
|
e.onSend?.(C), n.send(C);
|
|
69
69
|
}
|
|
70
|
-
const et = new Proxy(
|
|
71
|
-
get: (y, b, E) => b in y ? Reflect.get(y, b, E) : (C) =>
|
|
70
|
+
const et = new Proxy(ke, {
|
|
71
|
+
get: (y, b, E) => b in y ? Reflect.get(y, b, E) : (C) => ke(b, C)
|
|
72
72
|
}), tt = et, Y = /* @__PURE__ */ new Map(), $e = /* @__PURE__ */ new Set();
|
|
73
73
|
function rr(y, b) {
|
|
74
74
|
if (!n.registerHandler)
|
|
75
|
-
throw
|
|
75
|
+
throw we(["registerHandler"], "register message listeners");
|
|
76
76
|
if (y === "*") {
|
|
77
77
|
$e.add(b);
|
|
78
78
|
return;
|
|
@@ -86,12 +86,12 @@ var kn = ar((xn, Ye) => {
|
|
|
86
86
|
}
|
|
87
87
|
Y.get(y)?.delete(b), Y.get(y)?.size === 0 && Y.delete(y);
|
|
88
88
|
}
|
|
89
|
-
async function
|
|
89
|
+
async function ar(y) {
|
|
90
90
|
if (e.onReceive?.(y), !("type" in y))
|
|
91
91
|
throw new Error("Message does not contain a type.");
|
|
92
92
|
if (y.type === "request") {
|
|
93
|
-
if (!n.send || !
|
|
94
|
-
throw
|
|
93
|
+
if (!n.send || !s)
|
|
94
|
+
throw we(["send", "requestHandler"], "handle requests");
|
|
95
95
|
const { id: b, method: E, params: C } = y;
|
|
96
96
|
let $;
|
|
97
97
|
try {
|
|
@@ -99,7 +99,7 @@ var kn = ar((xn, Ye) => {
|
|
|
99
99
|
type: "response",
|
|
100
100
|
id: b,
|
|
101
101
|
success: !0,
|
|
102
|
-
payload: await
|
|
102
|
+
payload: await s(E, C)
|
|
103
103
|
};
|
|
104
104
|
} catch (z) {
|
|
105
105
|
if (!(z instanceof Error))
|
|
@@ -134,7 +134,7 @@ var kn = ar((xn, Ye) => {
|
|
|
134
134
|
throw new Error(`Unexpected RPC message type: ${y.type}`);
|
|
135
135
|
}
|
|
136
136
|
return {
|
|
137
|
-
setTransport:
|
|
137
|
+
setTransport: a,
|
|
138
138
|
setRequestHandler: i,
|
|
139
139
|
request: j,
|
|
140
140
|
requestProxy: L,
|
|
@@ -155,19 +155,19 @@ var kn = ar((xn, Ye) => {
|
|
|
155
155
|
return r != null ? { [bt]: r, data: t } : t;
|
|
156
156
|
}
|
|
157
157
|
function ur(t, e) {
|
|
158
|
-
const { transportId: r, filter: n } = e,
|
|
159
|
-
if (r != null &&
|
|
158
|
+
const { transportId: r, filter: n } = e, a = n?.();
|
|
159
|
+
if (r != null && a != null)
|
|
160
160
|
throw new Error("Cannot use both `transportId` and `filter` at the same time");
|
|
161
|
-
let
|
|
161
|
+
let s = t;
|
|
162
162
|
if (r) {
|
|
163
163
|
if (t[bt] !== r)
|
|
164
164
|
return [!0];
|
|
165
|
-
|
|
165
|
+
s = t.data;
|
|
166
166
|
}
|
|
167
|
-
return
|
|
167
|
+
return a === !1 ? [!0] : [!1, s];
|
|
168
168
|
}
|
|
169
169
|
function fr(t, e = {}) {
|
|
170
|
-
const { transportId: r, filter: n, remotePort:
|
|
170
|
+
const { transportId: r, filter: n, remotePort: a } = e, s = t, i = a ?? t;
|
|
171
171
|
let o;
|
|
172
172
|
return {
|
|
173
173
|
send(d) {
|
|
@@ -180,10 +180,10 @@ var kn = ar((xn, Ye) => {
|
|
|
180
180
|
filter: () => n?.(l)
|
|
181
181
|
});
|
|
182
182
|
x || d(S);
|
|
183
|
-
},
|
|
183
|
+
}, s.addEventListener("message", o);
|
|
184
184
|
},
|
|
185
185
|
unregisterHandler() {
|
|
186
|
-
o &&
|
|
186
|
+
o && s.removeEventListener("message", o);
|
|
187
187
|
}
|
|
188
188
|
};
|
|
189
189
|
}
|
|
@@ -209,9 +209,9 @@ var kn = ar((xn, Ye) => {
|
|
|
209
209
|
};
|
|
210
210
|
}
|
|
211
211
|
k(je, "_getter");
|
|
212
|
-
var te = ["isConstructor", "isEval", "isNative", "isToplevel"], re = ["columnNumber", "lineNumber"], ne = ["fileName", "functionName", "source"], yr = ["args"], gr = ["evalOrigin"],
|
|
212
|
+
var te = ["isConstructor", "isEval", "isNative", "isToplevel"], re = ["columnNumber", "lineNumber"], ne = ["fileName", "functionName", "source"], yr = ["args"], gr = ["evalOrigin"], be = te.concat(re, ne, yr, gr);
|
|
213
213
|
function I(t) {
|
|
214
|
-
if (t) for (var e = 0; e <
|
|
214
|
+
if (t) for (var e = 0; e < be.length; e++) t[be[e]] !== void 0 && this["set" + W(be[e])](t[be[e]]);
|
|
215
215
|
}
|
|
216
216
|
k(I, "StackFrame");
|
|
217
217
|
I.prototype = { getArgs: function() {
|
|
@@ -230,9 +230,9 @@ var kn = ar((xn, Ye) => {
|
|
|
230
230
|
return this.getIsEval() ? t ? "[eval] (" + t + ":" + e + ":" + r + ")" : "[eval]:" + e + ":" + r : n ? n + " (" + t + ":" + e + ":" + r + ")" : t + ":" + e + ":" + r;
|
|
231
231
|
} };
|
|
232
232
|
I.fromString = k(function(t) {
|
|
233
|
-
var e = t.indexOf("("), r = t.lastIndexOf(")"), n = t.substring(0, e),
|
|
234
|
-
if (
|
|
235
|
-
return new I({ functionName: n, args:
|
|
233
|
+
var e = t.indexOf("("), r = t.lastIndexOf(")"), n = t.substring(0, e), a = t.substring(e + 1, r).split(","), s = t.substring(r + 1);
|
|
234
|
+
if (s.indexOf("@") === 0) var i = /@(.+?)(?::(\d+))?(?::(\d+))?$/.exec(s, ""), o = i[1], d = i[2], l = i[3];
|
|
235
|
+
return new I({ functionName: n, args: a || void 0, fileName: o, lineNumber: d || void 0, columnNumber: l || void 0 });
|
|
236
236
|
}, "StackFrame$$fromString");
|
|
237
237
|
for (Q = 0; Q < te.length; Q++) I.prototype["get" + W(te[Q])] = je(te[Q]), I.prototype["set" + W(te[Q])] = /* @__PURE__ */ function(t) {
|
|
238
238
|
return function(e) {
|
|
@@ -261,29 +261,29 @@ var kn = ar((xn, Ye) => {
|
|
|
261
261
|
throw new Error("Cannot parse given Error object");
|
|
262
262
|
}, "ErrorStackParser$$parse"), extractLocation: k(function(r) {
|
|
263
263
|
if (r.indexOf(":") === -1) return [r];
|
|
264
|
-
var n = /(.+?)(?::(\d+))?(?::(\d+))?$/,
|
|
265
|
-
return [
|
|
264
|
+
var n = /(.+?)(?::(\d+))?(?::(\d+))?$/, a = n.exec(r.replace(/[()]/g, ""));
|
|
265
|
+
return [a[1], a[2] || void 0, a[3] || void 0];
|
|
266
266
|
}, "ErrorStackParser$$extractLocation"), parseV8OrIE: k(function(r) {
|
|
267
267
|
var n = r.stack.split(`
|
|
268
|
-
`).filter(function(
|
|
269
|
-
return !!
|
|
268
|
+
`).filter(function(a) {
|
|
269
|
+
return !!a.match(t);
|
|
270
270
|
}, this);
|
|
271
|
-
return n.map(function(
|
|
272
|
-
|
|
273
|
-
var
|
|
274
|
-
|
|
275
|
-
var o = this.extractLocation(i ? i[1] :
|
|
276
|
-
return new Fe({ functionName: d, fileName: l, lineNumber: o[1], columnNumber: o[2], source:
|
|
271
|
+
return n.map(function(a) {
|
|
272
|
+
a.indexOf("(eval ") > -1 && (a = a.replace(/eval code/g, "eval").replace(/(\(eval at [^()]*)|(,.*$)/g, ""));
|
|
273
|
+
var s = a.replace(/^\s+/, "").replace(/\(eval code/g, "(").replace(/^.*?\s+/, ""), i = s.match(/ (\(.+\)$)/);
|
|
274
|
+
s = i ? s.replace(i[0], "") : s;
|
|
275
|
+
var o = this.extractLocation(i ? i[1] : s), d = i && s || void 0, l = ["eval", "<anonymous>"].indexOf(o[0]) > -1 ? void 0 : o[0];
|
|
276
|
+
return new Fe({ functionName: d, fileName: l, lineNumber: o[1], columnNumber: o[2], source: a });
|
|
277
277
|
}, this);
|
|
278
278
|
}, "ErrorStackParser$$parseV8OrIE"), parseFFOrSafari: k(function(r) {
|
|
279
279
|
var n = r.stack.split(`
|
|
280
|
-
`).filter(function(
|
|
281
|
-
return !
|
|
280
|
+
`).filter(function(a) {
|
|
281
|
+
return !a.match(e);
|
|
282
282
|
}, this);
|
|
283
|
-
return n.map(function(
|
|
284
|
-
if (
|
|
285
|
-
var
|
|
286
|
-
return new Fe({ functionName: o, fileName: d[0], lineNumber: d[1], columnNumber: d[2], source:
|
|
283
|
+
return n.map(function(a) {
|
|
284
|
+
if (a.indexOf(" > eval") > -1 && (a = a.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g, ":$1")), a.indexOf("@") === -1 && a.indexOf(":") === -1) return new Fe({ functionName: a });
|
|
285
|
+
var s = /((.*".+"[^@]*)?[^@]*)(?:@)/, i = a.match(s), o = i && i[1] ? i[1] : void 0, d = this.extractLocation(a.replace(s, ""));
|
|
286
|
+
return new Fe({ functionName: o, fileName: d[0], lineNumber: d[1], columnNumber: d[2], source: a });
|
|
287
287
|
}, this);
|
|
288
288
|
}, "ErrorStackParser$$parseFFOrSafari") };
|
|
289
289
|
}
|
|
@@ -293,9 +293,9 @@ var kn = ar((xn, Ye) => {
|
|
|
293
293
|
var Nt, Me, Rt, nt, Qe;
|
|
294
294
|
async function Xe() {
|
|
295
295
|
if (!M || (Nt = (await import("./__vite-browser-external-CPvbk0mb.js")).default, nt = await import("./__vite-browser-external-CPvbk0mb.js"), Qe = await import("./__vite-browser-external-CPvbk0mb.js"), Rt = (await import("./__vite-browser-external-CPvbk0mb.js")).default, Me = await import("./__vite-browser-external-CPvbk0mb.js"), Ge = Me.sep, typeof xt < "u")) return;
|
|
296
|
-
let t = nt, e = await import("./__vite-browser-external-CPvbk0mb.js"), r = await import("./__vite-browser-external-CPvbk0mb.js"), n = await import("./__vite-browser-external-CPvbk0mb.js"),
|
|
297
|
-
globalThis.require = function(
|
|
298
|
-
return s
|
|
296
|
+
let t = nt, e = await import("./__vite-browser-external-CPvbk0mb.js"), r = await import("./__vite-browser-external-CPvbk0mb.js"), n = await import("./__vite-browser-external-CPvbk0mb.js"), a = { fs: t, crypto: e, ws: r, child_process: n };
|
|
297
|
+
globalThis.require = function(s) {
|
|
298
|
+
return a[s];
|
|
299
299
|
};
|
|
300
300
|
}
|
|
301
301
|
k(Xe, "initNodeModules");
|
|
@@ -325,9 +325,9 @@ var kn = ar((xn, Ye) => {
|
|
|
325
325
|
async function jt(t, e) {
|
|
326
326
|
let { response: r, binary: n } = Te(t, e);
|
|
327
327
|
if (n) return n;
|
|
328
|
-
let
|
|
329
|
-
if (!
|
|
330
|
-
return new Uint8Array(await
|
|
328
|
+
let a = await r;
|
|
329
|
+
if (!a.ok) throw new Error(`Failed to load '${t}': request failed.`);
|
|
330
|
+
return new Uint8Array(await a.arrayBuffer());
|
|
331
331
|
}
|
|
332
332
|
k(jt, "loadBinaryFile");
|
|
333
333
|
var xe;
|
|
@@ -373,17 +373,17 @@ var kn = ar((xn, Ye) => {
|
|
|
373
373
|
}
|
|
374
374
|
k(Zt, "calculateDirname");
|
|
375
375
|
function Mt(t) {
|
|
376
|
-
let e = t.FS, r = t.FS.filesystems.MEMFS, n = t.PATH,
|
|
377
|
-
if (!
|
|
376
|
+
let e = t.FS, r = t.FS.filesystems.MEMFS, n = t.PATH, a = { DIR_MODE: 16895, FILE_MODE: 33279, mount: function(s) {
|
|
377
|
+
if (!s.opts.fileSystemHandle) throw new Error("opts.fileSystemHandle is required");
|
|
378
378
|
return r.mount.apply(null, arguments);
|
|
379
|
-
}, syncfs: async (
|
|
379
|
+
}, syncfs: async (s, i, o) => {
|
|
380
380
|
try {
|
|
381
|
-
let d =
|
|
382
|
-
await
|
|
381
|
+
let d = a.getLocalSet(s), l = await a.getRemoteSet(s), h = i ? l : d, x = i ? d : l;
|
|
382
|
+
await a.reconcile(s, h, x), o(null);
|
|
383
383
|
} catch (d) {
|
|
384
384
|
o(d);
|
|
385
385
|
}
|
|
386
|
-
}, getLocalSet: (
|
|
386
|
+
}, getLocalSet: (s) => {
|
|
387
387
|
let i = /* @__PURE__ */ Object.create(null);
|
|
388
388
|
function o(h) {
|
|
389
389
|
return h !== "." && h !== "..";
|
|
@@ -393,47 +393,47 @@ var kn = ar((xn, Ye) => {
|
|
|
393
393
|
return (x) => n.join2(h, x);
|
|
394
394
|
}
|
|
395
395
|
k(d, "toAbsolute");
|
|
396
|
-
let l = e.readdir(
|
|
396
|
+
let l = e.readdir(s.mountpoint).filter(o).map(d(s.mountpoint));
|
|
397
397
|
for (; l.length; ) {
|
|
398
398
|
let h = l.pop(), x = e.stat(h);
|
|
399
399
|
e.isDir(x.mode) && l.push.apply(l, e.readdir(h).filter(o).map(d(h))), i[h] = { timestamp: x.mtime, mode: x.mode };
|
|
400
400
|
}
|
|
401
401
|
return { type: "local", entries: i };
|
|
402
|
-
}, getRemoteSet: async (
|
|
403
|
-
let i = /* @__PURE__ */ Object.create(null), o = await Sr(
|
|
404
|
-
for (let [d, l] of o) d !== "." && (i[n.join2(
|
|
402
|
+
}, getRemoteSet: async (s) => {
|
|
403
|
+
let i = /* @__PURE__ */ Object.create(null), o = await Sr(s.opts.fileSystemHandle);
|
|
404
|
+
for (let [d, l] of o) d !== "." && (i[n.join2(s.mountpoint, d)] = { timestamp: l.kind === "file" ? new Date((await l.getFile()).lastModified) : /* @__PURE__ */ new Date(), mode: l.kind === "file" ? a.FILE_MODE : a.DIR_MODE });
|
|
405
405
|
return { type: "remote", entries: i, handles: o };
|
|
406
|
-
}, loadLocalEntry: (
|
|
407
|
-
let i = e.lookupPath(
|
|
406
|
+
}, loadLocalEntry: (s) => {
|
|
407
|
+
let i = e.lookupPath(s).node, o = e.stat(s);
|
|
408
408
|
if (e.isDir(o.mode)) return { timestamp: o.mtime, mode: o.mode };
|
|
409
409
|
if (e.isFile(o.mode)) return i.contents = r.getFileDataAsTypedArray(i), { timestamp: o.mtime, mode: o.mode, contents: i.contents };
|
|
410
410
|
throw new Error("node type not supported");
|
|
411
|
-
}, storeLocalEntry: (
|
|
412
|
-
if (e.isDir(i.mode)) e.mkdirTree(
|
|
413
|
-
else if (e.isFile(i.mode)) e.writeFile(
|
|
411
|
+
}, storeLocalEntry: (s, i) => {
|
|
412
|
+
if (e.isDir(i.mode)) e.mkdirTree(s, i.mode);
|
|
413
|
+
else if (e.isFile(i.mode)) e.writeFile(s, i.contents, { canOwn: !0 });
|
|
414
414
|
else throw new Error("node type not supported");
|
|
415
|
-
e.chmod(
|
|
416
|
-
}, removeLocalEntry: (
|
|
417
|
-
var i = e.stat(
|
|
418
|
-
e.isDir(i.mode) ? e.rmdir(
|
|
419
|
-
}, loadRemoteEntry: async (
|
|
420
|
-
if (
|
|
421
|
-
let i = await
|
|
422
|
-
return { contents: new Uint8Array(await i.arrayBuffer()), mode:
|
|
415
|
+
e.chmod(s, i.mode), e.utime(s, i.timestamp, i.timestamp);
|
|
416
|
+
}, removeLocalEntry: (s) => {
|
|
417
|
+
var i = e.stat(s);
|
|
418
|
+
e.isDir(i.mode) ? e.rmdir(s) : e.isFile(i.mode) && e.unlink(s);
|
|
419
|
+
}, loadRemoteEntry: async (s) => {
|
|
420
|
+
if (s.kind === "file") {
|
|
421
|
+
let i = await s.getFile();
|
|
422
|
+
return { contents: new Uint8Array(await i.arrayBuffer()), mode: a.FILE_MODE, timestamp: new Date(i.lastModified) };
|
|
423
423
|
} else {
|
|
424
|
-
if (
|
|
425
|
-
throw new Error("unknown kind: " +
|
|
424
|
+
if (s.kind === "directory") return { mode: a.DIR_MODE, timestamp: /* @__PURE__ */ new Date() };
|
|
425
|
+
throw new Error("unknown kind: " + s.kind);
|
|
426
426
|
}
|
|
427
|
-
}, storeRemoteEntry: async (
|
|
428
|
-
let d =
|
|
427
|
+
}, storeRemoteEntry: async (s, i, o) => {
|
|
428
|
+
let d = s.get(n.dirname(i)), l = e.isFile(o.mode) ? await d.getFileHandle(n.basename(i), { create: !0 }) : await d.getDirectoryHandle(n.basename(i), { create: !0 });
|
|
429
429
|
if (l.kind === "file") {
|
|
430
430
|
let h = await l.createWritable();
|
|
431
431
|
await h.write(o.contents), await h.close();
|
|
432
432
|
}
|
|
433
|
-
|
|
434
|
-
}, removeRemoteEntry: async (
|
|
435
|
-
await
|
|
436
|
-
}, reconcile: async (
|
|
433
|
+
s.set(i, l);
|
|
434
|
+
}, removeRemoteEntry: async (s, i) => {
|
|
435
|
+
await s.get(n.dirname(i)).removeEntry(n.basename(i)), s.delete(i);
|
|
436
|
+
}, reconcile: async (s, i, o) => {
|
|
437
437
|
let d = 0, l = [];
|
|
438
438
|
Object.keys(i.entries).forEach(function(S) {
|
|
439
439
|
let j = i.entries[S], L = o.entries[S];
|
|
@@ -445,35 +445,35 @@ var kn = ar((xn, Ye) => {
|
|
|
445
445
|
}), h.sort().reverse(), !d) return;
|
|
446
446
|
let x = i.type === "remote" ? i.handles : o.handles;
|
|
447
447
|
for (let S of l) {
|
|
448
|
-
let j = n.normalize(S.replace(
|
|
448
|
+
let j = n.normalize(S.replace(s.mountpoint, "/")).substring(1);
|
|
449
449
|
if (o.type === "local") {
|
|
450
|
-
let L = x.get(j),
|
|
451
|
-
|
|
450
|
+
let L = x.get(j), ke = await a.loadRemoteEntry(L);
|
|
451
|
+
a.storeLocalEntry(S, ke);
|
|
452
452
|
} else {
|
|
453
|
-
let L =
|
|
454
|
-
await
|
|
453
|
+
let L = a.loadLocalEntry(S);
|
|
454
|
+
await a.storeRemoteEntry(x, j, L);
|
|
455
455
|
}
|
|
456
456
|
}
|
|
457
|
-
for (let S of h) if (o.type === "local")
|
|
457
|
+
for (let S of h) if (o.type === "local") a.removeLocalEntry(S);
|
|
458
458
|
else {
|
|
459
|
-
let j = n.normalize(S.replace(
|
|
460
|
-
await
|
|
459
|
+
let j = n.normalize(S.replace(s.mountpoint, "/")).substring(1);
|
|
460
|
+
await a.removeRemoteEntry(x, j);
|
|
461
461
|
}
|
|
462
462
|
} };
|
|
463
|
-
t.FS.filesystems.NATIVEFS_ASYNC =
|
|
463
|
+
t.FS.filesystems.NATIVEFS_ASYNC = a;
|
|
464
464
|
}
|
|
465
465
|
k(Mt, "initializeNativeFS");
|
|
466
466
|
var Sr = k(async (t) => {
|
|
467
467
|
let e = [];
|
|
468
|
-
async function r(
|
|
469
|
-
for await (let
|
|
468
|
+
async function r(a) {
|
|
469
|
+
for await (let s of a.values()) e.push(s), s.kind === "directory" && await r(s);
|
|
470
470
|
}
|
|
471
471
|
k(r, "collect"), await r(t);
|
|
472
472
|
let n = /* @__PURE__ */ new Map();
|
|
473
473
|
n.set(".", t);
|
|
474
|
-
for (let
|
|
475
|
-
let
|
|
476
|
-
n.set(
|
|
474
|
+
for (let a of e) {
|
|
475
|
+
let s = (await t.resolve(a)).join("/");
|
|
476
|
+
n.set(s, a);
|
|
477
477
|
}
|
|
478
478
|
return n;
|
|
479
479
|
}, "getFsHandles");
|
|
@@ -516,13 +516,13 @@ var kn = ar((xn, Ye) => {
|
|
|
516
516
|
function zt(t) {
|
|
517
517
|
let e = jt(t);
|
|
518
518
|
return async (r) => {
|
|
519
|
-
let n = r._py_version_major(),
|
|
520
|
-
r.FS.mkdirTree("/lib"), r.API.sitePackages = `/lib/python${n}.${
|
|
519
|
+
let n = r._py_version_major(), a = r._py_version_minor();
|
|
520
|
+
r.FS.mkdirTree("/lib"), r.API.sitePackages = `/lib/python${n}.${a}/site-packages`, r.FS.mkdirTree(r.API.sitePackages), r.addRunDependency("install-stdlib");
|
|
521
521
|
try {
|
|
522
|
-
let
|
|
523
|
-
r.FS.writeFile(`/lib/python${n}${
|
|
524
|
-
} catch (
|
|
525
|
-
console.error("Error occurred while installing the standard library:"), console.error(
|
|
522
|
+
let s = await e;
|
|
523
|
+
r.FS.writeFile(`/lib/python${n}${a}.zip`, s);
|
|
524
|
+
} catch (s) {
|
|
525
|
+
console.error("Error occurred while installing the standard library:"), console.error(s);
|
|
526
526
|
} finally {
|
|
527
527
|
r.removeRunDependency("install-stdlib");
|
|
528
528
|
}
|
|
@@ -537,15 +537,15 @@ var kn = ar((xn, Ye) => {
|
|
|
537
537
|
function Ht(t) {
|
|
538
538
|
if (typeof WasmOffsetConverter < "u") return;
|
|
539
539
|
let { binary: e, response: r } = Te(t + "pyodide.asm.wasm");
|
|
540
|
-
return function(n,
|
|
540
|
+
return function(n, a) {
|
|
541
541
|
return async function() {
|
|
542
542
|
try {
|
|
543
|
-
let
|
|
544
|
-
r ?
|
|
545
|
-
let { instance: i, module: o } =
|
|
546
|
-
|
|
547
|
-
} catch (
|
|
548
|
-
console.warn("wasm instantiation failed!"), console.warn(
|
|
543
|
+
let s;
|
|
544
|
+
r ? s = await WebAssembly.instantiateStreaming(r, n) : s = await WebAssembly.instantiate(await e, n);
|
|
545
|
+
let { instance: i, module: o } = s;
|
|
546
|
+
a(i, o);
|
|
547
|
+
} catch (s) {
|
|
548
|
+
console.warn("wasm instantiation failed!"), console.warn(s);
|
|
549
549
|
}
|
|
550
550
|
}(), {};
|
|
551
551
|
};
|
|
@@ -557,11 +557,11 @@ var kn = ar((xn, Ye) => {
|
|
|
557
557
|
await Xe();
|
|
558
558
|
let n = t.indexURL || await Zt();
|
|
559
559
|
n = Le(n), n.endsWith("/") || (n += "/"), t.indexURL = n;
|
|
560
|
-
let
|
|
561
|
-
(e =
|
|
562
|
-
let i = Lt(
|
|
563
|
-
if (o.lockFilePromise = Ft(
|
|
564
|
-
let S = `${
|
|
560
|
+
let a = { fullStdLib: !1, jsglobals: globalThis, stdin: globalThis.prompt ? globalThis.prompt : void 0, lockFileURL: n + "pyodide-lock.json", args: [], env: {}, packageCacheDir: n, packages: [], enableRunUntilComplete: !0, checkAPIVersion: !0, BUILD_ID: "e94377f5ce7dcf67e0417b69a0016733c2cfb6b4622ee8c490a6f17eb58e863b" }, s = Object.assign(a, t);
|
|
561
|
+
(e = s.env).HOME ?? (e.HOME = "/home/pyodide"), (r = s.env).PYTHONINSPECT ?? (r.PYTHONINSPECT = "1");
|
|
562
|
+
let i = Lt(s), o = i.API;
|
|
563
|
+
if (o.lockFilePromise = Ft(s.lockFileURL), typeof _createPyodideModule != "function") {
|
|
564
|
+
let S = `${s.indexURL}pyodide.asm.js`;
|
|
565
565
|
await xe(S);
|
|
566
566
|
}
|
|
567
567
|
let d;
|
|
@@ -571,14 +571,14 @@ var kn = ar((xn, Ye) => {
|
|
|
571
571
|
}
|
|
572
572
|
let l = await _createPyodideModule(i);
|
|
573
573
|
if (i.exited) throw i.exited.toThrow;
|
|
574
|
-
if (t.pyproxyToStringRepr && o.setPyProxyToStringMethod(!0), o.version !== De &&
|
|
574
|
+
if (t.pyproxyToStringRepr && o.setPyProxyToStringMethod(!0), o.version !== De && s.checkAPIVersion) throw new Error(`Pyodide version does not match: '${De}' <==> '${o.version}'. If you updated the Pyodide version, make sure you also updated the 'indexURL' parameter passed to loadPyodide.`);
|
|
575
575
|
l.locateFile = (S) => {
|
|
576
576
|
throw new Error("Didn't expect to load any more file_packager files!");
|
|
577
577
|
};
|
|
578
578
|
let h;
|
|
579
579
|
d && (h = o.restoreSnapshot(d));
|
|
580
580
|
let x = o.finalizeBootstrap(h, t._snapshotDeserializer);
|
|
581
|
-
return o.sys.path.insert(0, ""), x.version.includes("dev") || o.setCdnUrl(`https://cdn.jsdelivr.net/pyodide/v${x.version}/full/`), o._pyodide.set_excepthook(), await o.packageIndexReady, o.initializeStreams(
|
|
581
|
+
return o.sys.path.insert(0, ""), x.version.includes("dev") || o.setCdnUrl(`https://cdn.jsdelivr.net/pyodide/v${x.version}/full/`), o._pyodide.set_excepthook(), await o.packageIndexReady, o.initializeStreams(s.stdin, s.stdout, s.stderr), x;
|
|
582
582
|
}
|
|
583
583
|
k(qe, "loadPyodide");
|
|
584
584
|
const Tr = !1;
|
|
@@ -663,49 +663,49 @@ var kn = ar((xn, Ye) => {
|
|
|
663
663
|
}
|
|
664
664
|
var w;
|
|
665
665
|
(function(t) {
|
|
666
|
-
t.assertEqual = (
|
|
666
|
+
t.assertEqual = (a) => {
|
|
667
667
|
};
|
|
668
|
-
function e(
|
|
668
|
+
function e(a) {
|
|
669
669
|
}
|
|
670
670
|
t.assertIs = e;
|
|
671
|
-
function r(
|
|
671
|
+
function r(a) {
|
|
672
672
|
throw new Error();
|
|
673
673
|
}
|
|
674
|
-
t.assertNever = r, t.arrayToEnum = (
|
|
675
|
-
const
|
|
676
|
-
for (const i of
|
|
677
|
-
|
|
678
|
-
return
|
|
679
|
-
}, t.getValidEnumValues = (
|
|
680
|
-
const
|
|
681
|
-
for (const o of
|
|
682
|
-
i[o] =
|
|
674
|
+
t.assertNever = r, t.arrayToEnum = (a) => {
|
|
675
|
+
const s = {};
|
|
676
|
+
for (const i of a)
|
|
677
|
+
s[i] = i;
|
|
678
|
+
return s;
|
|
679
|
+
}, t.getValidEnumValues = (a) => {
|
|
680
|
+
const s = t.objectKeys(a).filter((o) => typeof a[a[o]] != "number"), i = {};
|
|
681
|
+
for (const o of s)
|
|
682
|
+
i[o] = a[o];
|
|
683
683
|
return t.objectValues(i);
|
|
684
|
-
}, t.objectValues = (
|
|
685
|
-
return s
|
|
686
|
-
}), t.objectKeys = typeof Object.keys == "function" ? (
|
|
687
|
-
const
|
|
688
|
-
for (const i in
|
|
689
|
-
Object.prototype.hasOwnProperty.call(
|
|
690
|
-
return
|
|
691
|
-
}, t.find = (
|
|
692
|
-
for (const i of
|
|
693
|
-
if (
|
|
684
|
+
}, t.objectValues = (a) => t.objectKeys(a).map(function(s) {
|
|
685
|
+
return a[s];
|
|
686
|
+
}), t.objectKeys = typeof Object.keys == "function" ? (a) => Object.keys(a) : (a) => {
|
|
687
|
+
const s = [];
|
|
688
|
+
for (const i in a)
|
|
689
|
+
Object.prototype.hasOwnProperty.call(a, i) && s.push(i);
|
|
690
|
+
return s;
|
|
691
|
+
}, t.find = (a, s) => {
|
|
692
|
+
for (const i of a)
|
|
693
|
+
if (s(i))
|
|
694
694
|
return i;
|
|
695
|
-
}, t.isInteger = typeof Number.isInteger == "function" ? (
|
|
696
|
-
function n(
|
|
697
|
-
return
|
|
695
|
+
}, t.isInteger = typeof Number.isInteger == "function" ? (a) => Number.isInteger(a) : (a) => typeof a == "number" && Number.isFinite(a) && Math.floor(a) === a;
|
|
696
|
+
function n(a, s = " | ") {
|
|
697
|
+
return a.map((i) => typeof i == "string" ? `'${i}'` : i).join(s);
|
|
698
698
|
}
|
|
699
|
-
t.joinValues = n, t.jsonStringifyReplacer = (
|
|
699
|
+
t.joinValues = n, t.jsonStringifyReplacer = (a, s) => typeof s == "bigint" ? s.toString() : s;
|
|
700
700
|
})(w || (w = {}));
|
|
701
|
-
var
|
|
701
|
+
var at;
|
|
702
702
|
(function(t) {
|
|
703
703
|
t.mergeShapes = (e, r) => ({
|
|
704
704
|
...e,
|
|
705
705
|
...r
|
|
706
706
|
// second overwrites first
|
|
707
707
|
});
|
|
708
|
-
})(
|
|
708
|
+
})(at || (at = {}));
|
|
709
709
|
const f = w.arrayToEnum([
|
|
710
710
|
"string",
|
|
711
711
|
"nan",
|
|
@@ -780,16 +780,16 @@ var kn = ar((xn, Ye) => {
|
|
|
780
780
|
Object.setPrototypeOf ? Object.setPrototypeOf(this, r) : this.__proto__ = r, this.name = "ZodError", this.issues = e;
|
|
781
781
|
}
|
|
782
782
|
format(e) {
|
|
783
|
-
const r = e || function(
|
|
784
|
-
return
|
|
785
|
-
}, n = { _errors: [] },
|
|
786
|
-
for (const i of
|
|
783
|
+
const r = e || function(s) {
|
|
784
|
+
return s.message;
|
|
785
|
+
}, n = { _errors: [] }, a = (s) => {
|
|
786
|
+
for (const i of s.issues)
|
|
787
787
|
if (i.code === "invalid_union")
|
|
788
|
-
i.unionErrors.map(
|
|
788
|
+
i.unionErrors.map(a);
|
|
789
789
|
else if (i.code === "invalid_return_type")
|
|
790
|
-
|
|
790
|
+
a(i.returnTypeError);
|
|
791
791
|
else if (i.code === "invalid_arguments")
|
|
792
|
-
|
|
792
|
+
a(i.argumentsError);
|
|
793
793
|
else if (i.path.length === 0)
|
|
794
794
|
n._errors.push(r(i));
|
|
795
795
|
else {
|
|
@@ -800,7 +800,7 @@ var kn = ar((xn, Ye) => {
|
|
|
800
800
|
}
|
|
801
801
|
}
|
|
802
802
|
};
|
|
803
|
-
return
|
|
803
|
+
return a(this), n;
|
|
804
804
|
}
|
|
805
805
|
static assert(e) {
|
|
806
806
|
if (!(e instanceof V))
|
|
@@ -817,12 +817,12 @@ var kn = ar((xn, Ye) => {
|
|
|
817
817
|
}
|
|
818
818
|
flatten(e = (r) => r.message) {
|
|
819
819
|
const r = {}, n = [];
|
|
820
|
-
for (const
|
|
821
|
-
if (
|
|
822
|
-
const
|
|
823
|
-
r[
|
|
820
|
+
for (const a of this.issues)
|
|
821
|
+
if (a.path.length > 0) {
|
|
822
|
+
const s = a.path[0];
|
|
823
|
+
r[s] = r[s] || [], r[s].push(e(a));
|
|
824
824
|
} else
|
|
825
|
-
n.push(e(
|
|
825
|
+
n.push(e(a));
|
|
826
826
|
return { formErrors: n, fieldErrors: r };
|
|
827
827
|
}
|
|
828
828
|
get formErrors() {
|
|
@@ -891,23 +891,23 @@ var kn = ar((xn, Ye) => {
|
|
|
891
891
|
return Cr;
|
|
892
892
|
}
|
|
893
893
|
const Ir = (t) => {
|
|
894
|
-
const { data: e, path: r, errorMaps: n, issueData:
|
|
895
|
-
...
|
|
896
|
-
path:
|
|
894
|
+
const { data: e, path: r, errorMaps: n, issueData: a } = t, s = [...r, ...a.path || []], i = {
|
|
895
|
+
...a,
|
|
896
|
+
path: s
|
|
897
897
|
};
|
|
898
|
-
if (
|
|
898
|
+
if (a.message !== void 0)
|
|
899
899
|
return {
|
|
900
|
-
...
|
|
901
|
-
path:
|
|
902
|
-
message:
|
|
900
|
+
...a,
|
|
901
|
+
path: s,
|
|
902
|
+
message: a.message
|
|
903
903
|
};
|
|
904
904
|
let o = "";
|
|
905
905
|
const d = n.filter((l) => !!l).slice().reverse();
|
|
906
906
|
for (const l of d)
|
|
907
907
|
o = l(i, { data: e, defaultError: o }).message;
|
|
908
908
|
return {
|
|
909
|
-
...
|
|
910
|
-
path:
|
|
909
|
+
...a,
|
|
910
|
+
path: s,
|
|
911
911
|
message: o
|
|
912
912
|
};
|
|
913
913
|
};
|
|
@@ -925,7 +925,7 @@ var kn = ar((xn, Ye) => {
|
|
|
925
925
|
// then global override map
|
|
926
926
|
r === Ve ? void 0 : Ve
|
|
927
927
|
// then global default map
|
|
928
|
-
].filter((
|
|
928
|
+
].filter((a) => !!a)
|
|
929
929
|
});
|
|
930
930
|
t.common.issues.push(n);
|
|
931
931
|
}
|
|
@@ -941,19 +941,19 @@ var kn = ar((xn, Ye) => {
|
|
|
941
941
|
}
|
|
942
942
|
static mergeArray(e, r) {
|
|
943
943
|
const n = [];
|
|
944
|
-
for (const
|
|
945
|
-
if (
|
|
944
|
+
for (const a of r) {
|
|
945
|
+
if (a.status === "aborted")
|
|
946
946
|
return g;
|
|
947
|
-
|
|
947
|
+
a.status === "dirty" && e.dirty(), n.push(a.value);
|
|
948
948
|
}
|
|
949
949
|
return { status: e.value, value: n };
|
|
950
950
|
}
|
|
951
951
|
static async mergeObjectAsync(e, r) {
|
|
952
952
|
const n = [];
|
|
953
|
-
for (const
|
|
954
|
-
const
|
|
953
|
+
for (const a of r) {
|
|
954
|
+
const s = await a.key, i = await a.value;
|
|
955
955
|
n.push({
|
|
956
|
-
key:
|
|
956
|
+
key: s,
|
|
957
957
|
value: i
|
|
958
958
|
});
|
|
959
959
|
}
|
|
@@ -961,25 +961,25 @@ var kn = ar((xn, Ye) => {
|
|
|
961
961
|
}
|
|
962
962
|
static mergeObjectSync(e, r) {
|
|
963
963
|
const n = {};
|
|
964
|
-
for (const
|
|
965
|
-
const { key:
|
|
966
|
-
if (
|
|
964
|
+
for (const a of r) {
|
|
965
|
+
const { key: s, value: i } = a;
|
|
966
|
+
if (s.status === "aborted" || i.status === "aborted")
|
|
967
967
|
return g;
|
|
968
|
-
|
|
968
|
+
s.status === "dirty" && e.dirty(), i.status === "dirty" && e.dirty(), s.value !== "__proto__" && (typeof i.value < "u" || a.alwaysSet) && (n[s.value] = i.value);
|
|
969
969
|
}
|
|
970
970
|
return { status: e.value, value: n };
|
|
971
971
|
}
|
|
972
972
|
}
|
|
973
973
|
const g = Object.freeze({
|
|
974
974
|
status: "aborted"
|
|
975
|
-
}),
|
|
975
|
+
}), ye = (t) => ({ status: "dirty", value: t }), P = (t) => ({ status: "valid", value: t }), st = (t) => t.status === "aborted", it = (t) => t.status === "dirty", ie = (t) => t.status === "valid", Ne = (t) => typeof Promise < "u" && t instanceof Promise;
|
|
976
976
|
var p;
|
|
977
977
|
(function(t) {
|
|
978
978
|
t.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, t.toString = (e) => typeof e == "string" ? e : e?.message;
|
|
979
979
|
})(p || (p = {}));
|
|
980
980
|
class Z {
|
|
981
|
-
constructor(e, r, n,
|
|
982
|
-
this._cachedPath = [], this.parent = e, this.data = r, this._path = n, this._key =
|
|
981
|
+
constructor(e, r, n, a) {
|
|
982
|
+
this._cachedPath = [], this.parent = e, this.data = r, this._path = n, this._key = a;
|
|
983
983
|
}
|
|
984
984
|
get path() {
|
|
985
985
|
return this._cachedPath.length || (Array.isArray(this._key) ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
|
|
@@ -1003,13 +1003,13 @@ var kn = ar((xn, Ye) => {
|
|
|
1003
1003
|
function _(t) {
|
|
1004
1004
|
if (!t)
|
|
1005
1005
|
return {};
|
|
1006
|
-
const { errorMap: e, invalid_type_error: r, required_error: n, description:
|
|
1006
|
+
const { errorMap: e, invalid_type_error: r, required_error: n, description: a } = t;
|
|
1007
1007
|
if (e && (r || n))
|
|
1008
1008
|
throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);
|
|
1009
|
-
return e ? { errorMap: e, description:
|
|
1009
|
+
return e ? { errorMap: e, description: a } : { errorMap: (i, o) => {
|
|
1010
1010
|
const { message: d } = t;
|
|
1011
1011
|
return i.code === "invalid_enum_value" ? { message: d ?? o.defaultError } : typeof o.data > "u" ? { message: d ?? n ?? o.defaultError } : i.code !== "invalid_type" ? { message: o.defaultError } : { message: d ?? r ?? o.defaultError };
|
|
1012
|
-
}, description:
|
|
1012
|
+
}, description: a };
|
|
1013
1013
|
}
|
|
1014
1014
|
class v {
|
|
1015
1015
|
get description() {
|
|
@@ -1069,8 +1069,8 @@ var kn = ar((xn, Ye) => {
|
|
|
1069
1069
|
parent: null,
|
|
1070
1070
|
data: e,
|
|
1071
1071
|
parsedType: U(e)
|
|
1072
|
-
},
|
|
1073
|
-
return ot(n,
|
|
1072
|
+
}, a = this._parseSync({ data: e, path: n.path, parent: n });
|
|
1073
|
+
return ot(n, a);
|
|
1074
1074
|
}
|
|
1075
1075
|
"~validate"(e) {
|
|
1076
1076
|
const r = {
|
|
@@ -1122,21 +1122,21 @@ var kn = ar((xn, Ye) => {
|
|
|
1122
1122
|
parent: null,
|
|
1123
1123
|
data: e,
|
|
1124
1124
|
parsedType: U(e)
|
|
1125
|
-
},
|
|
1126
|
-
return ot(n,
|
|
1125
|
+
}, a = this._parse({ data: e, path: n.path, parent: n }), s = await (Ne(a) ? a : Promise.resolve(a));
|
|
1126
|
+
return ot(n, s);
|
|
1127
1127
|
}
|
|
1128
1128
|
refine(e, r) {
|
|
1129
|
-
const n = (
|
|
1130
|
-
return this._refinement((
|
|
1131
|
-
const i = e(
|
|
1129
|
+
const n = (a) => typeof r == "string" || typeof r > "u" ? { message: r } : typeof r == "function" ? r(a) : r;
|
|
1130
|
+
return this._refinement((a, s) => {
|
|
1131
|
+
const i = e(a), o = () => s.addIssue({
|
|
1132
1132
|
code: c.custom,
|
|
1133
|
-
...n(
|
|
1133
|
+
...n(a)
|
|
1134
1134
|
});
|
|
1135
1135
|
return typeof Promise < "u" && i instanceof Promise ? i.then((d) => d ? !0 : (o(), !1)) : i ? !0 : (o(), !1);
|
|
1136
1136
|
});
|
|
1137
1137
|
}
|
|
1138
1138
|
refinement(e, r) {
|
|
1139
|
-
return this._refinement((n,
|
|
1139
|
+
return this._refinement((n, a) => e(n) ? !0 : (a.addIssue(typeof r == "function" ? r(n, a) : r), !1));
|
|
1140
1140
|
}
|
|
1141
1141
|
_refinement(e) {
|
|
1142
1142
|
return new ce({
|
|
@@ -1256,8 +1256,8 @@ var kn = ar((xn, Ye) => {
|
|
|
1256
1256
|
const [r] = t.split(".");
|
|
1257
1257
|
if (!r)
|
|
1258
1258
|
return !1;
|
|
1259
|
-
const n = r.replace(/-/g, "+").replace(/_/g, "/").padEnd(r.length + (4 - r.length % 4) % 4, "="),
|
|
1260
|
-
return !(typeof
|
|
1259
|
+
const n = r.replace(/-/g, "+").replace(/_/g, "/").padEnd(r.length + (4 - r.length % 4) % 4, "="), a = JSON.parse(atob(n));
|
|
1260
|
+
return !(typeof a != "object" || a === null || "typ" in a && a?.typ !== "JWT" || !a.alg || e && a.alg !== e);
|
|
1261
1261
|
} catch {
|
|
1262
1262
|
return !1;
|
|
1263
1263
|
}
|
|
@@ -1268,160 +1268,160 @@ var kn = ar((xn, Ye) => {
|
|
|
1268
1268
|
class q extends v {
|
|
1269
1269
|
_parse(e) {
|
|
1270
1270
|
if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== f.string) {
|
|
1271
|
-
const
|
|
1272
|
-
return u(
|
|
1271
|
+
const s = this._getOrReturnCtx(e);
|
|
1272
|
+
return u(s, {
|
|
1273
1273
|
code: c.invalid_type,
|
|
1274
1274
|
expected: f.string,
|
|
1275
|
-
received:
|
|
1275
|
+
received: s.parsedType
|
|
1276
1276
|
}), g;
|
|
1277
1277
|
}
|
|
1278
1278
|
const n = new A();
|
|
1279
|
-
let
|
|
1280
|
-
for (const
|
|
1281
|
-
if (
|
|
1282
|
-
e.data.length <
|
|
1279
|
+
let a;
|
|
1280
|
+
for (const s of this._def.checks)
|
|
1281
|
+
if (s.kind === "min")
|
|
1282
|
+
e.data.length < s.value && (a = this._getOrReturnCtx(e, a), u(a, {
|
|
1283
1283
|
code: c.too_small,
|
|
1284
|
-
minimum:
|
|
1284
|
+
minimum: s.value,
|
|
1285
1285
|
type: "string",
|
|
1286
1286
|
inclusive: !0,
|
|
1287
1287
|
exact: !1,
|
|
1288
|
-
message:
|
|
1288
|
+
message: s.message
|
|
1289
1289
|
}), n.dirty());
|
|
1290
|
-
else if (
|
|
1291
|
-
e.data.length >
|
|
1290
|
+
else if (s.kind === "max")
|
|
1291
|
+
e.data.length > s.value && (a = this._getOrReturnCtx(e, a), u(a, {
|
|
1292
1292
|
code: c.too_big,
|
|
1293
|
-
maximum:
|
|
1293
|
+
maximum: s.value,
|
|
1294
1294
|
type: "string",
|
|
1295
1295
|
inclusive: !0,
|
|
1296
1296
|
exact: !1,
|
|
1297
|
-
message:
|
|
1297
|
+
message: s.message
|
|
1298
1298
|
}), n.dirty());
|
|
1299
|
-
else if (
|
|
1300
|
-
const i = e.data.length >
|
|
1301
|
-
(i || o) && (
|
|
1299
|
+
else if (s.kind === "length") {
|
|
1300
|
+
const i = e.data.length > s.value, o = e.data.length < s.value;
|
|
1301
|
+
(i || o) && (a = this._getOrReturnCtx(e, a), i ? u(a, {
|
|
1302
1302
|
code: c.too_big,
|
|
1303
|
-
maximum:
|
|
1303
|
+
maximum: s.value,
|
|
1304
1304
|
type: "string",
|
|
1305
1305
|
inclusive: !0,
|
|
1306
1306
|
exact: !0,
|
|
1307
|
-
message:
|
|
1308
|
-
}) : o && u(
|
|
1307
|
+
message: s.message
|
|
1308
|
+
}) : o && u(a, {
|
|
1309
1309
|
code: c.too_small,
|
|
1310
|
-
minimum:
|
|
1310
|
+
minimum: s.value,
|
|
1311
1311
|
type: "string",
|
|
1312
1312
|
inclusive: !0,
|
|
1313
1313
|
exact: !0,
|
|
1314
|
-
message:
|
|
1314
|
+
message: s.message
|
|
1315
1315
|
}), n.dirty());
|
|
1316
|
-
} else if (
|
|
1317
|
-
Dr.test(e.data) || (
|
|
1316
|
+
} else if (s.kind === "email")
|
|
1317
|
+
Dr.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
1318
1318
|
validation: "email",
|
|
1319
1319
|
code: c.invalid_string,
|
|
1320
|
-
message:
|
|
1320
|
+
message: s.message
|
|
1321
1321
|
}), n.dirty());
|
|
1322
|
-
else if (
|
|
1323
|
-
Ze || (Ze = new RegExp(qr, "u")), Ze.test(e.data) || (
|
|
1322
|
+
else if (s.kind === "emoji")
|
|
1323
|
+
Ze || (Ze = new RegExp(qr, "u")), Ze.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
1324
1324
|
validation: "emoji",
|
|
1325
1325
|
code: c.invalid_string,
|
|
1326
|
-
message:
|
|
1326
|
+
message: s.message
|
|
1327
1327
|
}), n.dirty());
|
|
1328
|
-
else if (
|
|
1329
|
-
Fr.test(e.data) || (
|
|
1328
|
+
else if (s.kind === "uuid")
|
|
1329
|
+
Fr.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
1330
1330
|
validation: "uuid",
|
|
1331
1331
|
code: c.invalid_string,
|
|
1332
|
-
message:
|
|
1332
|
+
message: s.message
|
|
1333
1333
|
}), n.dirty());
|
|
1334
|
-
else if (
|
|
1335
|
-
Zr.test(e.data) || (
|
|
1334
|
+
else if (s.kind === "nanoid")
|
|
1335
|
+
Zr.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
1336
1336
|
validation: "nanoid",
|
|
1337
1337
|
code: c.invalid_string,
|
|
1338
|
-
message:
|
|
1338
|
+
message: s.message
|
|
1339
1339
|
}), n.dirty());
|
|
1340
|
-
else if (
|
|
1341
|
-
Pr.test(e.data) || (
|
|
1340
|
+
else if (s.kind === "cuid")
|
|
1341
|
+
Pr.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
1342
1342
|
validation: "cuid",
|
|
1343
1343
|
code: c.invalid_string,
|
|
1344
|
-
message:
|
|
1344
|
+
message: s.message
|
|
1345
1345
|
}), n.dirty());
|
|
1346
|
-
else if (
|
|
1347
|
-
jr.test(e.data) || (
|
|
1346
|
+
else if (s.kind === "cuid2")
|
|
1347
|
+
jr.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
1348
1348
|
validation: "cuid2",
|
|
1349
1349
|
code: c.invalid_string,
|
|
1350
|
-
message:
|
|
1350
|
+
message: s.message
|
|
1351
1351
|
}), n.dirty());
|
|
1352
|
-
else if (
|
|
1353
|
-
$r.test(e.data) || (
|
|
1352
|
+
else if (s.kind === "ulid")
|
|
1353
|
+
$r.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
1354
1354
|
validation: "ulid",
|
|
1355
1355
|
code: c.invalid_string,
|
|
1356
|
-
message:
|
|
1356
|
+
message: s.message
|
|
1357
1357
|
}), n.dirty());
|
|
1358
|
-
else if (
|
|
1358
|
+
else if (s.kind === "url")
|
|
1359
1359
|
try {
|
|
1360
1360
|
new URL(e.data);
|
|
1361
1361
|
} catch {
|
|
1362
|
-
|
|
1362
|
+
a = this._getOrReturnCtx(e, a), u(a, {
|
|
1363
1363
|
validation: "url",
|
|
1364
1364
|
code: c.invalid_string,
|
|
1365
|
-
message:
|
|
1365
|
+
message: s.message
|
|
1366
1366
|
}), n.dirty();
|
|
1367
1367
|
}
|
|
1368
|
-
else
|
|
1368
|
+
else s.kind === "regex" ? (s.regex.lastIndex = 0, s.regex.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
1369
1369
|
validation: "regex",
|
|
1370
1370
|
code: c.invalid_string,
|
|
1371
|
-
message:
|
|
1372
|
-
}), n.dirty())) :
|
|
1371
|
+
message: s.message
|
|
1372
|
+
}), n.dirty())) : s.kind === "trim" ? e.data = e.data.trim() : s.kind === "includes" ? e.data.includes(s.value, s.position) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
1373
1373
|
code: c.invalid_string,
|
|
1374
|
-
validation: { includes:
|
|
1375
|
-
message:
|
|
1376
|
-
}), n.dirty()) :
|
|
1374
|
+
validation: { includes: s.value, position: s.position },
|
|
1375
|
+
message: s.message
|
|
1376
|
+
}), n.dirty()) : s.kind === "toLowerCase" ? e.data = e.data.toLowerCase() : s.kind === "toUpperCase" ? e.data = e.data.toUpperCase() : s.kind === "startsWith" ? e.data.startsWith(s.value) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
1377
1377
|
code: c.invalid_string,
|
|
1378
|
-
validation: { startsWith:
|
|
1379
|
-
message:
|
|
1380
|
-
}), n.dirty()) :
|
|
1378
|
+
validation: { startsWith: s.value },
|
|
1379
|
+
message: s.message
|
|
1380
|
+
}), n.dirty()) : s.kind === "endsWith" ? e.data.endsWith(s.value) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
1381
1381
|
code: c.invalid_string,
|
|
1382
|
-
validation: { endsWith:
|
|
1383
|
-
message:
|
|
1384
|
-
}), n.dirty()) :
|
|
1382
|
+
validation: { endsWith: s.value },
|
|
1383
|
+
message: s.message
|
|
1384
|
+
}), n.dirty()) : s.kind === "datetime" ? Qr(s).test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
1385
1385
|
code: c.invalid_string,
|
|
1386
1386
|
validation: "datetime",
|
|
1387
|
-
message:
|
|
1388
|
-
}), n.dirty()) :
|
|
1387
|
+
message: s.message
|
|
1388
|
+
}), n.dirty()) : s.kind === "date" ? Jr.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
1389
1389
|
code: c.invalid_string,
|
|
1390
1390
|
validation: "date",
|
|
1391
|
-
message:
|
|
1392
|
-
}), n.dirty()) :
|
|
1391
|
+
message: s.message
|
|
1392
|
+
}), n.dirty()) : s.kind === "time" ? Yr(s).test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
1393
1393
|
code: c.invalid_string,
|
|
1394
1394
|
validation: "time",
|
|
1395
|
-
message:
|
|
1396
|
-
}), n.dirty()) :
|
|
1395
|
+
message: s.message
|
|
1396
|
+
}), n.dirty()) : s.kind === "duration" ? Lr.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
1397
1397
|
validation: "duration",
|
|
1398
1398
|
code: c.invalid_string,
|
|
1399
|
-
message:
|
|
1400
|
-
}), n.dirty()) :
|
|
1399
|
+
message: s.message
|
|
1400
|
+
}), n.dirty()) : s.kind === "ip" ? Xr(e.data, s.version) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
1401
1401
|
validation: "ip",
|
|
1402
1402
|
code: c.invalid_string,
|
|
1403
|
-
message:
|
|
1404
|
-
}), n.dirty()) :
|
|
1403
|
+
message: s.message
|
|
1404
|
+
}), n.dirty()) : s.kind === "jwt" ? Gr(e.data, s.alg) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
1405
1405
|
validation: "jwt",
|
|
1406
1406
|
code: c.invalid_string,
|
|
1407
|
-
message:
|
|
1408
|
-
}), n.dirty()) :
|
|
1407
|
+
message: s.message
|
|
1408
|
+
}), n.dirty()) : s.kind === "cidr" ? Kr(e.data, s.version) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
1409
1409
|
validation: "cidr",
|
|
1410
1410
|
code: c.invalid_string,
|
|
1411
|
-
message:
|
|
1412
|
-
}), n.dirty()) :
|
|
1411
|
+
message: s.message
|
|
1412
|
+
}), n.dirty()) : s.kind === "base64" ? Br.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
1413
1413
|
validation: "base64",
|
|
1414
1414
|
code: c.invalid_string,
|
|
1415
|
-
message:
|
|
1416
|
-
}), n.dirty()) :
|
|
1415
|
+
message: s.message
|
|
1416
|
+
}), n.dirty()) : s.kind === "base64url" ? Wr.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
1417
1417
|
validation: "base64url",
|
|
1418
1418
|
code: c.invalid_string,
|
|
1419
|
-
message:
|
|
1420
|
-
}), n.dirty()) : w.assertNever(
|
|
1419
|
+
message: s.message
|
|
1420
|
+
}), n.dirty()) : w.assertNever(s);
|
|
1421
1421
|
return { status: n.value, value: e.data };
|
|
1422
1422
|
}
|
|
1423
1423
|
_regex(e, r, n) {
|
|
1424
|
-
return this.refinement((
|
|
1424
|
+
return this.refinement((a) => e.test(a), {
|
|
1425
1425
|
validation: r,
|
|
1426
1426
|
code: c.invalid_string,
|
|
1427
1427
|
...p.errToObj(n)
|
|
@@ -1649,8 +1649,8 @@ var kn = ar((xn, Ye) => {
|
|
|
1649
1649
|
..._(t)
|
|
1650
1650
|
});
|
|
1651
1651
|
function en(t, e) {
|
|
1652
|
-
const r = (t.toString().split(".")[1] || "").length, n = (e.toString().split(".")[1] || "").length,
|
|
1653
|
-
return
|
|
1652
|
+
const r = (t.toString().split(".")[1] || "").length, n = (e.toString().split(".")[1] || "").length, a = r > n ? r : n, s = Number.parseInt(t.toFixed(a).replace(".", "")), i = Number.parseInt(e.toFixed(a).replace(".", ""));
|
|
1653
|
+
return s % i / 10 ** a;
|
|
1654
1654
|
}
|
|
1655
1655
|
class oe extends v {
|
|
1656
1656
|
constructor() {
|
|
@@ -1658,44 +1658,44 @@ var kn = ar((xn, Ye) => {
|
|
|
1658
1658
|
}
|
|
1659
1659
|
_parse(e) {
|
|
1660
1660
|
if (this._def.coerce && (e.data = Number(e.data)), this._getType(e) !== f.number) {
|
|
1661
|
-
const
|
|
1662
|
-
return u(
|
|
1661
|
+
const s = this._getOrReturnCtx(e);
|
|
1662
|
+
return u(s, {
|
|
1663
1663
|
code: c.invalid_type,
|
|
1664
1664
|
expected: f.number,
|
|
1665
|
-
received:
|
|
1665
|
+
received: s.parsedType
|
|
1666
1666
|
}), g;
|
|
1667
1667
|
}
|
|
1668
1668
|
let n;
|
|
1669
|
-
const
|
|
1670
|
-
for (const
|
|
1671
|
-
|
|
1669
|
+
const a = new A();
|
|
1670
|
+
for (const s of this._def.checks)
|
|
1671
|
+
s.kind === "int" ? w.isInteger(e.data) || (n = this._getOrReturnCtx(e, n), u(n, {
|
|
1672
1672
|
code: c.invalid_type,
|
|
1673
1673
|
expected: "integer",
|
|
1674
1674
|
received: "float",
|
|
1675
|
-
message:
|
|
1676
|
-
}),
|
|
1675
|
+
message: s.message
|
|
1676
|
+
}), a.dirty()) : s.kind === "min" ? (s.inclusive ? e.data < s.value : e.data <= s.value) && (n = this._getOrReturnCtx(e, n), u(n, {
|
|
1677
1677
|
code: c.too_small,
|
|
1678
|
-
minimum:
|
|
1678
|
+
minimum: s.value,
|
|
1679
1679
|
type: "number",
|
|
1680
|
-
inclusive:
|
|
1680
|
+
inclusive: s.inclusive,
|
|
1681
1681
|
exact: !1,
|
|
1682
|
-
message:
|
|
1683
|
-
}),
|
|
1682
|
+
message: s.message
|
|
1683
|
+
}), a.dirty()) : s.kind === "max" ? (s.inclusive ? e.data > s.value : e.data >= s.value) && (n = this._getOrReturnCtx(e, n), u(n, {
|
|
1684
1684
|
code: c.too_big,
|
|
1685
|
-
maximum:
|
|
1685
|
+
maximum: s.value,
|
|
1686
1686
|
type: "number",
|
|
1687
|
-
inclusive:
|
|
1687
|
+
inclusive: s.inclusive,
|
|
1688
1688
|
exact: !1,
|
|
1689
|
-
message:
|
|
1690
|
-
}),
|
|
1689
|
+
message: s.message
|
|
1690
|
+
}), a.dirty()) : s.kind === "multipleOf" ? en(e.data, s.value) !== 0 && (n = this._getOrReturnCtx(e, n), u(n, {
|
|
1691
1691
|
code: c.not_multiple_of,
|
|
1692
|
-
multipleOf:
|
|
1693
|
-
message:
|
|
1694
|
-
}),
|
|
1692
|
+
multipleOf: s.value,
|
|
1693
|
+
message: s.message
|
|
1694
|
+
}), a.dirty()) : s.kind === "finite" ? Number.isFinite(e.data) || (n = this._getOrReturnCtx(e, n), u(n, {
|
|
1695
1695
|
code: c.not_finite,
|
|
1696
|
-
message:
|
|
1697
|
-
}),
|
|
1698
|
-
return { status:
|
|
1696
|
+
message: s.message
|
|
1697
|
+
}), a.dirty()) : w.assertNever(s);
|
|
1698
|
+
return { status: a.value, value: e.data };
|
|
1699
1699
|
}
|
|
1700
1700
|
gte(e, r) {
|
|
1701
1701
|
return this.setLimit("min", e, !0, p.toString(r));
|
|
@@ -1709,7 +1709,7 @@ var kn = ar((xn, Ye) => {
|
|
|
1709
1709
|
lt(e, r) {
|
|
1710
1710
|
return this.setLimit("max", e, !1, p.toString(r));
|
|
1711
1711
|
}
|
|
1712
|
-
setLimit(e, r, n,
|
|
1712
|
+
setLimit(e, r, n, a) {
|
|
1713
1713
|
return new oe({
|
|
1714
1714
|
...this._def,
|
|
1715
1715
|
checks: [
|
|
@@ -1718,7 +1718,7 @@ var kn = ar((xn, Ye) => {
|
|
|
1718
1718
|
kind: e,
|
|
1719
1719
|
value: r,
|
|
1720
1720
|
inclusive: n,
|
|
1721
|
-
message: p.toString(
|
|
1721
|
+
message: p.toString(a)
|
|
1722
1722
|
}
|
|
1723
1723
|
]
|
|
1724
1724
|
});
|
|
@@ -1824,7 +1824,7 @@ var kn = ar((xn, Ye) => {
|
|
|
1824
1824
|
coerce: t?.coerce || !1,
|
|
1825
1825
|
..._(t)
|
|
1826
1826
|
});
|
|
1827
|
-
class
|
|
1827
|
+
class _e extends v {
|
|
1828
1828
|
constructor() {
|
|
1829
1829
|
super(...arguments), this.min = this.gte, this.max = this.lte;
|
|
1830
1830
|
}
|
|
@@ -1838,26 +1838,26 @@ var kn = ar((xn, Ye) => {
|
|
|
1838
1838
|
if (this._getType(e) !== f.bigint)
|
|
1839
1839
|
return this._getInvalidInput(e);
|
|
1840
1840
|
let n;
|
|
1841
|
-
const
|
|
1842
|
-
for (const
|
|
1843
|
-
|
|
1841
|
+
const a = new A();
|
|
1842
|
+
for (const s of this._def.checks)
|
|
1843
|
+
s.kind === "min" ? (s.inclusive ? e.data < s.value : e.data <= s.value) && (n = this._getOrReturnCtx(e, n), u(n, {
|
|
1844
1844
|
code: c.too_small,
|
|
1845
1845
|
type: "bigint",
|
|
1846
|
-
minimum:
|
|
1847
|
-
inclusive:
|
|
1848
|
-
message:
|
|
1849
|
-
}),
|
|
1846
|
+
minimum: s.value,
|
|
1847
|
+
inclusive: s.inclusive,
|
|
1848
|
+
message: s.message
|
|
1849
|
+
}), a.dirty()) : s.kind === "max" ? (s.inclusive ? e.data > s.value : e.data >= s.value) && (n = this._getOrReturnCtx(e, n), u(n, {
|
|
1850
1850
|
code: c.too_big,
|
|
1851
1851
|
type: "bigint",
|
|
1852
|
-
maximum:
|
|
1853
|
-
inclusive:
|
|
1854
|
-
message:
|
|
1855
|
-
}),
|
|
1852
|
+
maximum: s.value,
|
|
1853
|
+
inclusive: s.inclusive,
|
|
1854
|
+
message: s.message
|
|
1855
|
+
}), a.dirty()) : s.kind === "multipleOf" ? e.data % s.value !== BigInt(0) && (n = this._getOrReturnCtx(e, n), u(n, {
|
|
1856
1856
|
code: c.not_multiple_of,
|
|
1857
|
-
multipleOf:
|
|
1858
|
-
message:
|
|
1859
|
-
}),
|
|
1860
|
-
return { status:
|
|
1857
|
+
multipleOf: s.value,
|
|
1858
|
+
message: s.message
|
|
1859
|
+
}), a.dirty()) : w.assertNever(s);
|
|
1860
|
+
return { status: a.value, value: e.data };
|
|
1861
1861
|
}
|
|
1862
1862
|
_getInvalidInput(e) {
|
|
1863
1863
|
const r = this._getOrReturnCtx(e);
|
|
@@ -1879,8 +1879,8 @@ var kn = ar((xn, Ye) => {
|
|
|
1879
1879
|
lt(e, r) {
|
|
1880
1880
|
return this.setLimit("max", e, !1, p.toString(r));
|
|
1881
1881
|
}
|
|
1882
|
-
setLimit(e, r, n,
|
|
1883
|
-
return new
|
|
1882
|
+
setLimit(e, r, n, a) {
|
|
1883
|
+
return new _e({
|
|
1884
1884
|
...this._def,
|
|
1885
1885
|
checks: [
|
|
1886
1886
|
...this._def.checks,
|
|
@@ -1888,13 +1888,13 @@ var kn = ar((xn, Ye) => {
|
|
|
1888
1888
|
kind: e,
|
|
1889
1889
|
value: r,
|
|
1890
1890
|
inclusive: n,
|
|
1891
|
-
message: p.toString(
|
|
1891
|
+
message: p.toString(a)
|
|
1892
1892
|
}
|
|
1893
1893
|
]
|
|
1894
1894
|
});
|
|
1895
1895
|
}
|
|
1896
1896
|
_addCheck(e) {
|
|
1897
|
-
return new
|
|
1897
|
+
return new _e({
|
|
1898
1898
|
...this._def,
|
|
1899
1899
|
checks: [...this._def.checks, e]
|
|
1900
1900
|
});
|
|
@@ -1951,7 +1951,7 @@ var kn = ar((xn, Ye) => {
|
|
|
1951
1951
|
return e;
|
|
1952
1952
|
}
|
|
1953
1953
|
}
|
|
1954
|
-
|
|
1954
|
+
_e.create = (t) => new _e({
|
|
1955
1955
|
checks: [],
|
|
1956
1956
|
typeName: m.ZodBigInt,
|
|
1957
1957
|
coerce: t?.coerce ?? !1,
|
|
@@ -1978,37 +1978,37 @@ var kn = ar((xn, Ye) => {
|
|
|
1978
1978
|
class Re extends v {
|
|
1979
1979
|
_parse(e) {
|
|
1980
1980
|
if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== f.date) {
|
|
1981
|
-
const
|
|
1982
|
-
return u(
|
|
1981
|
+
const s = this._getOrReturnCtx(e);
|
|
1982
|
+
return u(s, {
|
|
1983
1983
|
code: c.invalid_type,
|
|
1984
1984
|
expected: f.date,
|
|
1985
|
-
received:
|
|
1985
|
+
received: s.parsedType
|
|
1986
1986
|
}), g;
|
|
1987
1987
|
}
|
|
1988
1988
|
if (Number.isNaN(e.data.getTime())) {
|
|
1989
|
-
const
|
|
1990
|
-
return u(
|
|
1989
|
+
const s = this._getOrReturnCtx(e);
|
|
1990
|
+
return u(s, {
|
|
1991
1991
|
code: c.invalid_date
|
|
1992
1992
|
}), g;
|
|
1993
1993
|
}
|
|
1994
1994
|
const n = new A();
|
|
1995
|
-
let
|
|
1996
|
-
for (const
|
|
1997
|
-
|
|
1995
|
+
let a;
|
|
1996
|
+
for (const s of this._def.checks)
|
|
1997
|
+
s.kind === "min" ? e.data.getTime() < s.value && (a = this._getOrReturnCtx(e, a), u(a, {
|
|
1998
1998
|
code: c.too_small,
|
|
1999
|
-
message:
|
|
1999
|
+
message: s.message,
|
|
2000
2000
|
inclusive: !0,
|
|
2001
2001
|
exact: !1,
|
|
2002
|
-
minimum:
|
|
2002
|
+
minimum: s.value,
|
|
2003
2003
|
type: "date"
|
|
2004
|
-
}), n.dirty()) :
|
|
2004
|
+
}), n.dirty()) : s.kind === "max" ? e.data.getTime() > s.value && (a = this._getOrReturnCtx(e, a), u(a, {
|
|
2005
2005
|
code: c.too_big,
|
|
2006
|
-
message:
|
|
2006
|
+
message: s.message,
|
|
2007
2007
|
inclusive: !0,
|
|
2008
2008
|
exact: !1,
|
|
2009
|
-
maximum:
|
|
2009
|
+
maximum: s.value,
|
|
2010
2010
|
type: "date"
|
|
2011
|
-
}), n.dirty()) : w.assertNever(
|
|
2011
|
+
}), n.dirty()) : w.assertNever(s);
|
|
2012
2012
|
return {
|
|
2013
2013
|
status: n.value,
|
|
2014
2014
|
value: new Date(e.data.getTime())
|
|
@@ -2161,43 +2161,43 @@ var kn = ar((xn, Ye) => {
|
|
|
2161
2161
|
});
|
|
2162
2162
|
class F extends v {
|
|
2163
2163
|
_parse(e) {
|
|
2164
|
-
const { ctx: r, status: n } = this._processInputParams(e),
|
|
2164
|
+
const { ctx: r, status: n } = this._processInputParams(e), a = this._def;
|
|
2165
2165
|
if (r.parsedType !== f.array)
|
|
2166
2166
|
return u(r, {
|
|
2167
2167
|
code: c.invalid_type,
|
|
2168
2168
|
expected: f.array,
|
|
2169
2169
|
received: r.parsedType
|
|
2170
2170
|
}), g;
|
|
2171
|
-
if (
|
|
2172
|
-
const i = r.data.length >
|
|
2171
|
+
if (a.exactLength !== null) {
|
|
2172
|
+
const i = r.data.length > a.exactLength.value, o = r.data.length < a.exactLength.value;
|
|
2173
2173
|
(i || o) && (u(r, {
|
|
2174
2174
|
code: i ? c.too_big : c.too_small,
|
|
2175
|
-
minimum: o ?
|
|
2176
|
-
maximum: i ?
|
|
2175
|
+
minimum: o ? a.exactLength.value : void 0,
|
|
2176
|
+
maximum: i ? a.exactLength.value : void 0,
|
|
2177
2177
|
type: "array",
|
|
2178
2178
|
inclusive: !0,
|
|
2179
2179
|
exact: !0,
|
|
2180
|
-
message:
|
|
2180
|
+
message: a.exactLength.message
|
|
2181
2181
|
}), n.dirty());
|
|
2182
2182
|
}
|
|
2183
|
-
if (
|
|
2183
|
+
if (a.minLength !== null && r.data.length < a.minLength.value && (u(r, {
|
|
2184
2184
|
code: c.too_small,
|
|
2185
|
-
minimum:
|
|
2185
|
+
minimum: a.minLength.value,
|
|
2186
2186
|
type: "array",
|
|
2187
2187
|
inclusive: !0,
|
|
2188
2188
|
exact: !1,
|
|
2189
|
-
message:
|
|
2190
|
-
}), n.dirty()),
|
|
2189
|
+
message: a.minLength.message
|
|
2190
|
+
}), n.dirty()), a.maxLength !== null && r.data.length > a.maxLength.value && (u(r, {
|
|
2191
2191
|
code: c.too_big,
|
|
2192
|
-
maximum:
|
|
2192
|
+
maximum: a.maxLength.value,
|
|
2193
2193
|
type: "array",
|
|
2194
2194
|
inclusive: !0,
|
|
2195
2195
|
exact: !1,
|
|
2196
|
-
message:
|
|
2196
|
+
message: a.maxLength.message
|
|
2197
2197
|
}), n.dirty()), r.common.async)
|
|
2198
|
-
return Promise.all([...r.data].map((i, o) =>
|
|
2199
|
-
const
|
|
2200
|
-
return A.mergeArray(n,
|
|
2198
|
+
return Promise.all([...r.data].map((i, o) => a.type._parseAsync(new Z(r, i, r.path, o)))).then((i) => A.mergeArray(n, i));
|
|
2199
|
+
const s = [...r.data].map((i, o) => a.type._parseSync(new Z(r, i, r.path, o)));
|
|
2200
|
+
return A.mergeArray(n, s);
|
|
2201
2201
|
}
|
|
2202
2202
|
get element() {
|
|
2203
2203
|
return this._def.type;
|
|
@@ -2232,12 +2232,12 @@ var kn = ar((xn, Ye) => {
|
|
|
2232
2232
|
typeName: m.ZodArray,
|
|
2233
2233
|
..._(e)
|
|
2234
2234
|
});
|
|
2235
|
-
function
|
|
2235
|
+
function ae(t) {
|
|
2236
2236
|
if (t instanceof T) {
|
|
2237
2237
|
const e = {};
|
|
2238
2238
|
for (const r in t.shape) {
|
|
2239
2239
|
const n = t.shape[r];
|
|
2240
|
-
e[r] = B.create(
|
|
2240
|
+
e[r] = B.create(ae(n));
|
|
2241
2241
|
}
|
|
2242
2242
|
return new T({
|
|
2243
2243
|
...t._def,
|
|
@@ -2245,8 +2245,8 @@ var kn = ar((xn, Ye) => {
|
|
|
2245
2245
|
});
|
|
2246
2246
|
} else return t instanceof F ? new F({
|
|
2247
2247
|
...t._def,
|
|
2248
|
-
type:
|
|
2249
|
-
}) : t instanceof B ? B.create(
|
|
2248
|
+
type: ae(t.element)
|
|
2249
|
+
}) : t instanceof B ? B.create(ae(t.unwrap())) : t instanceof le ? le.create(ae(t.unwrap())) : t instanceof ee ? ee.create(t.items.map((e) => ae(e))) : t;
|
|
2250
2250
|
}
|
|
2251
2251
|
class T extends v {
|
|
2252
2252
|
constructor() {
|
|
@@ -2267,17 +2267,17 @@ var kn = ar((xn, Ye) => {
|
|
|
2267
2267
|
received: l.parsedType
|
|
2268
2268
|
}), g;
|
|
2269
2269
|
}
|
|
2270
|
-
const { status: n, ctx:
|
|
2270
|
+
const { status: n, ctx: a } = this._processInputParams(e), { shape: s, keys: i } = this._getCached(), o = [];
|
|
2271
2271
|
if (!(this._def.catchall instanceof J && this._def.unknownKeys === "strip"))
|
|
2272
|
-
for (const l in
|
|
2272
|
+
for (const l in a.data)
|
|
2273
2273
|
i.includes(l) || o.push(l);
|
|
2274
2274
|
const d = [];
|
|
2275
2275
|
for (const l of i) {
|
|
2276
|
-
const h =
|
|
2276
|
+
const h = s[l], x = a.data[l];
|
|
2277
2277
|
d.push({
|
|
2278
2278
|
key: { status: "valid", value: l },
|
|
2279
|
-
value: h._parse(new Z(
|
|
2280
|
-
alwaysSet: l in
|
|
2279
|
+
value: h._parse(new Z(a, x, a.path, l)),
|
|
2280
|
+
alwaysSet: l in a.data
|
|
2281
2281
|
});
|
|
2282
2282
|
}
|
|
2283
2283
|
if (this._def.catchall instanceof J) {
|
|
@@ -2286,10 +2286,10 @@ var kn = ar((xn, Ye) => {
|
|
|
2286
2286
|
for (const h of o)
|
|
2287
2287
|
d.push({
|
|
2288
2288
|
key: { status: "valid", value: h },
|
|
2289
|
-
value: { status: "valid", value:
|
|
2289
|
+
value: { status: "valid", value: a.data[h] }
|
|
2290
2290
|
});
|
|
2291
2291
|
else if (l === "strict")
|
|
2292
|
-
o.length > 0 && (u(
|
|
2292
|
+
o.length > 0 && (u(a, {
|
|
2293
2293
|
code: c.unrecognized_keys,
|
|
2294
2294
|
keys: o
|
|
2295
2295
|
}), n.dirty());
|
|
@@ -2297,18 +2297,18 @@ var kn = ar((xn, Ye) => {
|
|
|
2297
2297
|
} else {
|
|
2298
2298
|
const l = this._def.catchall;
|
|
2299
2299
|
for (const h of o) {
|
|
2300
|
-
const x =
|
|
2300
|
+
const x = a.data[h];
|
|
2301
2301
|
d.push({
|
|
2302
2302
|
key: { status: "valid", value: h },
|
|
2303
2303
|
value: l._parse(
|
|
2304
|
-
new Z(
|
|
2304
|
+
new Z(a, x, a.path, h)
|
|
2305
2305
|
//, ctx.child(key), value, getParsedType(value)
|
|
2306
2306
|
),
|
|
2307
|
-
alwaysSet: h in
|
|
2307
|
+
alwaysSet: h in a.data
|
|
2308
2308
|
});
|
|
2309
2309
|
}
|
|
2310
2310
|
}
|
|
2311
|
-
return
|
|
2311
|
+
return a.common.async ? Promise.resolve().then(async () => {
|
|
2312
2312
|
const l = [];
|
|
2313
2313
|
for (const h of d) {
|
|
2314
2314
|
const x = await h.key, S = await h.value;
|
|
@@ -2330,11 +2330,11 @@ var kn = ar((xn, Ye) => {
|
|
|
2330
2330
|
unknownKeys: "strict",
|
|
2331
2331
|
...e !== void 0 ? {
|
|
2332
2332
|
errorMap: (r, n) => {
|
|
2333
|
-
const
|
|
2333
|
+
const a = this._def.errorMap?.(r, n).message ?? n.defaultError;
|
|
2334
2334
|
return r.code === "unrecognized_keys" ? {
|
|
2335
|
-
message: p.errToObj(e).message ??
|
|
2335
|
+
message: p.errToObj(e).message ?? a
|
|
2336
2336
|
} : {
|
|
2337
|
-
message:
|
|
2337
|
+
message: a
|
|
2338
2338
|
};
|
|
2339
2339
|
}
|
|
2340
2340
|
} : {}
|
|
@@ -2481,13 +2481,13 @@ var kn = ar((xn, Ye) => {
|
|
|
2481
2481
|
* @deprecated
|
|
2482
2482
|
*/
|
|
2483
2483
|
deepPartial() {
|
|
2484
|
-
return
|
|
2484
|
+
return ae(this);
|
|
2485
2485
|
}
|
|
2486
2486
|
partial(e) {
|
|
2487
2487
|
const r = {};
|
|
2488
2488
|
for (const n of w.objectKeys(this.shape)) {
|
|
2489
|
-
const
|
|
2490
|
-
e && !e[n] ? r[n] =
|
|
2489
|
+
const a = this.shape[n];
|
|
2490
|
+
e && !e[n] ? r[n] = a : r[n] = a.optional();
|
|
2491
2491
|
}
|
|
2492
2492
|
return new T({
|
|
2493
2493
|
...this._def,
|
|
@@ -2500,10 +2500,10 @@ var kn = ar((xn, Ye) => {
|
|
|
2500
2500
|
if (e && !e[n])
|
|
2501
2501
|
r[n] = this.shape[n];
|
|
2502
2502
|
else {
|
|
2503
|
-
let
|
|
2504
|
-
for (;
|
|
2505
|
-
|
|
2506
|
-
r[n] =
|
|
2503
|
+
let s = this.shape[n];
|
|
2504
|
+
for (; s instanceof B; )
|
|
2505
|
+
s = s._def.innerType;
|
|
2506
|
+
r[n] = s;
|
|
2507
2507
|
}
|
|
2508
2508
|
return new T({
|
|
2509
2509
|
...this._def,
|
|
@@ -2538,21 +2538,21 @@ var kn = ar((xn, Ye) => {
|
|
|
2538
2538
|
class Ce extends v {
|
|
2539
2539
|
_parse(e) {
|
|
2540
2540
|
const { ctx: r } = this._processInputParams(e), n = this._def.options;
|
|
2541
|
-
function s
|
|
2542
|
-
for (const o of
|
|
2541
|
+
function a(s) {
|
|
2542
|
+
for (const o of s)
|
|
2543
2543
|
if (o.result.status === "valid")
|
|
2544
2544
|
return o.result;
|
|
2545
|
-
for (const o of
|
|
2545
|
+
for (const o of s)
|
|
2546
2546
|
if (o.result.status === "dirty")
|
|
2547
2547
|
return r.common.issues.push(...o.ctx.common.issues), o.result;
|
|
2548
|
-
const i =
|
|
2548
|
+
const i = s.map((o) => new V(o.ctx.common.issues));
|
|
2549
2549
|
return u(r, {
|
|
2550
2550
|
code: c.invalid_union,
|
|
2551
2551
|
unionErrors: i
|
|
2552
2552
|
}), g;
|
|
2553
2553
|
}
|
|
2554
2554
|
if (r.common.async)
|
|
2555
|
-
return Promise.all(n.map(async (
|
|
2555
|
+
return Promise.all(n.map(async (s) => {
|
|
2556
2556
|
const i = {
|
|
2557
2557
|
...r,
|
|
2558
2558
|
common: {
|
|
@@ -2562,16 +2562,16 @@ var kn = ar((xn, Ye) => {
|
|
|
2562
2562
|
parent: null
|
|
2563
2563
|
};
|
|
2564
2564
|
return {
|
|
2565
|
-
result: await
|
|
2565
|
+
result: await s._parseAsync({
|
|
2566
2566
|
data: r.data,
|
|
2567
2567
|
path: r.path,
|
|
2568
2568
|
parent: i
|
|
2569
2569
|
}),
|
|
2570
2570
|
ctx: i
|
|
2571
2571
|
};
|
|
2572
|
-
})).then(
|
|
2572
|
+
})).then(a);
|
|
2573
2573
|
{
|
|
2574
|
-
let
|
|
2574
|
+
let s;
|
|
2575
2575
|
const i = [];
|
|
2576
2576
|
for (const d of n) {
|
|
2577
2577
|
const l = {
|
|
@@ -2588,10 +2588,10 @@ var kn = ar((xn, Ye) => {
|
|
|
2588
2588
|
});
|
|
2589
2589
|
if (h.status === "valid")
|
|
2590
2590
|
return h;
|
|
2591
|
-
h.status === "dirty" && !
|
|
2591
|
+
h.status === "dirty" && !s && (s = { result: h, ctx: l }), l.common.issues.length && i.push(l.common.issues);
|
|
2592
2592
|
}
|
|
2593
|
-
if (
|
|
2594
|
-
return r.common.issues.push(...
|
|
2593
|
+
if (s)
|
|
2594
|
+
return r.common.issues.push(...s.ctx.common.issues), s.result;
|
|
2595
2595
|
const o = i.map((d) => new V(d));
|
|
2596
2596
|
return u(r, {
|
|
2597
2597
|
code: c.invalid_union,
|
|
@@ -2613,8 +2613,8 @@ var kn = ar((xn, Ye) => {
|
|
|
2613
2613
|
if (t === e)
|
|
2614
2614
|
return { valid: !0, data: t };
|
|
2615
2615
|
if (r === f.object && n === f.object) {
|
|
2616
|
-
const
|
|
2617
|
-
for (const o of
|
|
2616
|
+
const a = w.objectKeys(e), s = w.objectKeys(t).filter((o) => a.indexOf(o) !== -1), i = { ...t, ...e };
|
|
2617
|
+
for (const o of s) {
|
|
2618
2618
|
const d = Ue(t[o], e[o]);
|
|
2619
2619
|
if (!d.valid)
|
|
2620
2620
|
return { valid: !1 };
|
|
@@ -2624,23 +2624,23 @@ var kn = ar((xn, Ye) => {
|
|
|
2624
2624
|
} else if (r === f.array && n === f.array) {
|
|
2625
2625
|
if (t.length !== e.length)
|
|
2626
2626
|
return { valid: !1 };
|
|
2627
|
-
const
|
|
2628
|
-
for (let
|
|
2629
|
-
const i = t[
|
|
2627
|
+
const a = [];
|
|
2628
|
+
for (let s = 0; s < t.length; s++) {
|
|
2629
|
+
const i = t[s], o = e[s], d = Ue(i, o);
|
|
2630
2630
|
if (!d.valid)
|
|
2631
2631
|
return { valid: !1 };
|
|
2632
|
-
|
|
2632
|
+
a.push(d.data);
|
|
2633
2633
|
}
|
|
2634
|
-
return { valid: !0, data:
|
|
2634
|
+
return { valid: !0, data: a };
|
|
2635
2635
|
} else return r === f.date && n === f.date && +t == +e ? { valid: !0, data: t } : { valid: !1 };
|
|
2636
2636
|
}
|
|
2637
2637
|
class Ae extends v {
|
|
2638
2638
|
_parse(e) {
|
|
2639
|
-
const { status: r, ctx: n } = this._processInputParams(e),
|
|
2640
|
-
if (
|
|
2639
|
+
const { status: r, ctx: n } = this._processInputParams(e), a = (s, i) => {
|
|
2640
|
+
if (st(s) || st(i))
|
|
2641
2641
|
return g;
|
|
2642
|
-
const o = Ue(
|
|
2643
|
-
return o.valid ? ((it(
|
|
2642
|
+
const o = Ue(s.value, i.value);
|
|
2643
|
+
return o.valid ? ((it(s) || it(i)) && r.dirty(), { status: r.value, value: o.data }) : (u(n, {
|
|
2644
2644
|
code: c.invalid_intersection_types
|
|
2645
2645
|
}), g);
|
|
2646
2646
|
};
|
|
@@ -2655,7 +2655,7 @@ var kn = ar((xn, Ye) => {
|
|
|
2655
2655
|
path: n.path,
|
|
2656
2656
|
parent: n
|
|
2657
2657
|
})
|
|
2658
|
-
]).then(([
|
|
2658
|
+
]).then(([s, i]) => a(s, i)) : a(this._def.left._parseSync({
|
|
2659
2659
|
data: n.data,
|
|
2660
2660
|
path: n.path,
|
|
2661
2661
|
parent: n
|
|
@@ -2696,11 +2696,11 @@ var kn = ar((xn, Ye) => {
|
|
|
2696
2696
|
exact: !1,
|
|
2697
2697
|
type: "array"
|
|
2698
2698
|
}), r.dirty());
|
|
2699
|
-
const
|
|
2699
|
+
const s = [...n.data].map((i, o) => {
|
|
2700
2700
|
const d = this._def.items[o] || this._def.rest;
|
|
2701
2701
|
return d ? d._parse(new Z(n, i, n.path, o)) : null;
|
|
2702
2702
|
}).filter((i) => !!i);
|
|
2703
|
-
return n.common.async ? Promise.all(
|
|
2703
|
+
return n.common.async ? Promise.all(s).then((i) => A.mergeArray(r, i)) : A.mergeArray(r, s);
|
|
2704
2704
|
}
|
|
2705
2705
|
get items() {
|
|
2706
2706
|
return this._def.items;
|
|
@@ -2737,14 +2737,14 @@ var kn = ar((xn, Ye) => {
|
|
|
2737
2737
|
expected: f.object,
|
|
2738
2738
|
received: n.parsedType
|
|
2739
2739
|
}), g;
|
|
2740
|
-
const
|
|
2740
|
+
const a = [], s = this._def.keyType, i = this._def.valueType;
|
|
2741
2741
|
for (const o in n.data)
|
|
2742
|
-
|
|
2743
|
-
key:
|
|
2742
|
+
a.push({
|
|
2743
|
+
key: s._parse(new Z(n, o, n.path, o)),
|
|
2744
2744
|
value: i._parse(new Z(n, n.data[o], n.path, o)),
|
|
2745
2745
|
alwaysSet: o in n.data
|
|
2746
2746
|
});
|
|
2747
|
-
return n.common.async ? A.mergeObjectAsync(r,
|
|
2747
|
+
return n.common.async ? A.mergeObjectAsync(r, a) : A.mergeObjectSync(r, a);
|
|
2748
2748
|
}
|
|
2749
2749
|
get element() {
|
|
2750
2750
|
return this._def.valueType;
|
|
@@ -2778,9 +2778,9 @@ var kn = ar((xn, Ye) => {
|
|
|
2778
2778
|
expected: f.map,
|
|
2779
2779
|
received: n.parsedType
|
|
2780
2780
|
}), g;
|
|
2781
|
-
const
|
|
2782
|
-
key:
|
|
2783
|
-
value:
|
|
2781
|
+
const a = this._def.keyType, s = this._def.valueType, i = [...n.data.entries()].map(([o, d], l) => ({
|
|
2782
|
+
key: a._parse(new Z(n, o, n.path, [l, "key"])),
|
|
2783
|
+
value: s._parse(new Z(n, d, n.path, [l, "value"]))
|
|
2784
2784
|
}));
|
|
2785
2785
|
if (n.common.async) {
|
|
2786
2786
|
const o = /* @__PURE__ */ new Map();
|
|
@@ -2811,7 +2811,7 @@ var kn = ar((xn, Ye) => {
|
|
|
2811
2811
|
typeName: m.ZodMap,
|
|
2812
2812
|
..._(r)
|
|
2813
2813
|
});
|
|
2814
|
-
class
|
|
2814
|
+
class ve extends v {
|
|
2815
2815
|
_parse(e) {
|
|
2816
2816
|
const { status: r, ctx: n } = this._processInputParams(e);
|
|
2817
2817
|
if (n.parsedType !== f.set)
|
|
@@ -2820,23 +2820,23 @@ var kn = ar((xn, Ye) => {
|
|
|
2820
2820
|
expected: f.set,
|
|
2821
2821
|
received: n.parsedType
|
|
2822
2822
|
}), g;
|
|
2823
|
-
const
|
|
2824
|
-
|
|
2823
|
+
const a = this._def;
|
|
2824
|
+
a.minSize !== null && n.data.size < a.minSize.value && (u(n, {
|
|
2825
2825
|
code: c.too_small,
|
|
2826
|
-
minimum:
|
|
2826
|
+
minimum: a.minSize.value,
|
|
2827
2827
|
type: "set",
|
|
2828
2828
|
inclusive: !0,
|
|
2829
2829
|
exact: !1,
|
|
2830
|
-
message:
|
|
2831
|
-
}), r.dirty()),
|
|
2830
|
+
message: a.minSize.message
|
|
2831
|
+
}), r.dirty()), a.maxSize !== null && n.data.size > a.maxSize.value && (u(n, {
|
|
2832
2832
|
code: c.too_big,
|
|
2833
|
-
maximum:
|
|
2833
|
+
maximum: a.maxSize.value,
|
|
2834
2834
|
type: "set",
|
|
2835
2835
|
inclusive: !0,
|
|
2836
2836
|
exact: !1,
|
|
2837
|
-
message:
|
|
2837
|
+
message: a.maxSize.message
|
|
2838
2838
|
}), r.dirty());
|
|
2839
|
-
const
|
|
2839
|
+
const s = this._def.valueType;
|
|
2840
2840
|
function i(d) {
|
|
2841
2841
|
const l = /* @__PURE__ */ new Set();
|
|
2842
2842
|
for (const h of d) {
|
|
@@ -2846,17 +2846,17 @@ var kn = ar((xn, Ye) => {
|
|
|
2846
2846
|
}
|
|
2847
2847
|
return { status: r.value, value: l };
|
|
2848
2848
|
}
|
|
2849
|
-
const o = [...n.data.values()].map((d, l) =>
|
|
2849
|
+
const o = [...n.data.values()].map((d, l) => s._parse(new Z(n, d, n.path, l)));
|
|
2850
2850
|
return n.common.async ? Promise.all(o).then((d) => i(d)) : i(o);
|
|
2851
2851
|
}
|
|
2852
2852
|
min(e, r) {
|
|
2853
|
-
return new
|
|
2853
|
+
return new ve({
|
|
2854
2854
|
...this._def,
|
|
2855
2855
|
minSize: { value: e, message: p.toString(r) }
|
|
2856
2856
|
});
|
|
2857
2857
|
}
|
|
2858
2858
|
max(e, r) {
|
|
2859
|
-
return new
|
|
2859
|
+
return new ve({
|
|
2860
2860
|
...this._def,
|
|
2861
2861
|
maxSize: { value: e, message: p.toString(r) }
|
|
2862
2862
|
});
|
|
@@ -2868,7 +2868,7 @@ var kn = ar((xn, Ye) => {
|
|
|
2868
2868
|
return this.min(1, e);
|
|
2869
2869
|
}
|
|
2870
2870
|
}
|
|
2871
|
-
|
|
2871
|
+
ve.create = (t, e) => new ve({
|
|
2872
2872
|
valueType: t,
|
|
2873
2873
|
minSize: null,
|
|
2874
2874
|
maxSize: null,
|
|
@@ -2976,19 +2976,19 @@ var kn = ar((xn, Ye) => {
|
|
|
2976
2976
|
_parse(e) {
|
|
2977
2977
|
const r = w.getValidEnumValues(this._def.values), n = this._getOrReturnCtx(e);
|
|
2978
2978
|
if (n.parsedType !== f.string && n.parsedType !== f.number) {
|
|
2979
|
-
const
|
|
2979
|
+
const a = w.objectValues(r);
|
|
2980
2980
|
return u(n, {
|
|
2981
|
-
expected: w.joinValues(
|
|
2981
|
+
expected: w.joinValues(a),
|
|
2982
2982
|
received: n.parsedType,
|
|
2983
2983
|
code: c.invalid_type
|
|
2984
2984
|
}), g;
|
|
2985
2985
|
}
|
|
2986
2986
|
if (this._cache || (this._cache = new Set(w.getValidEnumValues(this._def.values))), !this._cache.has(e.data)) {
|
|
2987
|
-
const
|
|
2987
|
+
const a = w.objectValues(r);
|
|
2988
2988
|
return u(n, {
|
|
2989
2989
|
received: n.data,
|
|
2990
2990
|
code: c.invalid_enum_value,
|
|
2991
|
-
options:
|
|
2991
|
+
options: a
|
|
2992
2992
|
}), g;
|
|
2993
2993
|
}
|
|
2994
2994
|
return P(e.data);
|
|
@@ -3015,7 +3015,7 @@ var kn = ar((xn, Ye) => {
|
|
|
3015
3015
|
received: r.parsedType
|
|
3016
3016
|
}), g;
|
|
3017
3017
|
const n = r.parsedType === f.promise ? r.data : Promise.resolve(r.data);
|
|
3018
|
-
return P(n.then((
|
|
3018
|
+
return P(n.then((a) => this._def.type.parseAsync(a, {
|
|
3019
3019
|
path: r.path,
|
|
3020
3020
|
errorMap: r.common.contextualErrorMap
|
|
3021
3021
|
})));
|
|
@@ -3034,7 +3034,7 @@ var kn = ar((xn, Ye) => {
|
|
|
3034
3034
|
return this._def.schema._def.typeName === m.ZodEffects ? this._def.schema.sourceType() : this._def.schema;
|
|
3035
3035
|
}
|
|
3036
3036
|
_parse(e) {
|
|
3037
|
-
const { status: r, ctx: n } = this._processInputParams(e),
|
|
3037
|
+
const { status: r, ctx: n } = this._processInputParams(e), a = this._def.effect || null, s = {
|
|
3038
3038
|
addIssue: (i) => {
|
|
3039
3039
|
u(n, i), i.fatal ? r.abort() : r.dirty();
|
|
3040
3040
|
},
|
|
@@ -3042,8 +3042,8 @@ var kn = ar((xn, Ye) => {
|
|
|
3042
3042
|
return n.path;
|
|
3043
3043
|
}
|
|
3044
3044
|
};
|
|
3045
|
-
if (
|
|
3046
|
-
const i =
|
|
3045
|
+
if (s.addIssue = s.addIssue.bind(s), a.type === "preprocess") {
|
|
3046
|
+
const i = a.transform(n.data, s);
|
|
3047
3047
|
if (n.common.async)
|
|
3048
3048
|
return Promise.resolve(i).then(async (o) => {
|
|
3049
3049
|
if (r.value === "aborted")
|
|
@@ -3053,7 +3053,7 @@ var kn = ar((xn, Ye) => {
|
|
|
3053
3053
|
path: n.path,
|
|
3054
3054
|
parent: n
|
|
3055
3055
|
});
|
|
3056
|
-
return d.status === "aborted" ? g : d.status === "dirty" || r.value === "dirty" ?
|
|
3056
|
+
return d.status === "aborted" ? g : d.status === "dirty" || r.value === "dirty" ? ye(d.value) : d;
|
|
3057
3057
|
});
|
|
3058
3058
|
{
|
|
3059
3059
|
if (r.value === "aborted")
|
|
@@ -3063,12 +3063,12 @@ var kn = ar((xn, Ye) => {
|
|
|
3063
3063
|
path: n.path,
|
|
3064
3064
|
parent: n
|
|
3065
3065
|
});
|
|
3066
|
-
return o.status === "aborted" ? g : o.status === "dirty" || r.value === "dirty" ?
|
|
3066
|
+
return o.status === "aborted" ? g : o.status === "dirty" || r.value === "dirty" ? ye(o.value) : o;
|
|
3067
3067
|
}
|
|
3068
3068
|
}
|
|
3069
|
-
if (
|
|
3069
|
+
if (a.type === "refinement") {
|
|
3070
3070
|
const i = (o) => {
|
|
3071
|
-
const d =
|
|
3071
|
+
const d = a.refinement(o, s);
|
|
3072
3072
|
if (n.common.async)
|
|
3073
3073
|
return Promise.resolve(d);
|
|
3074
3074
|
if (d instanceof Promise)
|
|
@@ -3085,7 +3085,7 @@ var kn = ar((xn, Ye) => {
|
|
|
3085
3085
|
} else
|
|
3086
3086
|
return this._def.schema._parseAsync({ data: n.data, path: n.path, parent: n }).then((o) => o.status === "aborted" ? g : (o.status === "dirty" && r.dirty(), i(o.value).then(() => ({ status: r.value, value: o.value }))));
|
|
3087
3087
|
}
|
|
3088
|
-
if (
|
|
3088
|
+
if (a.type === "transform")
|
|
3089
3089
|
if (n.common.async === !1) {
|
|
3090
3090
|
const i = this._def.schema._parseSync({
|
|
3091
3091
|
data: n.data,
|
|
@@ -3094,16 +3094,16 @@ var kn = ar((xn, Ye) => {
|
|
|
3094
3094
|
});
|
|
3095
3095
|
if (!ie(i))
|
|
3096
3096
|
return g;
|
|
3097
|
-
const o =
|
|
3097
|
+
const o = a.transform(i.value, s);
|
|
3098
3098
|
if (o instanceof Promise)
|
|
3099
3099
|
throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
|
|
3100
3100
|
return { status: r.value, value: o };
|
|
3101
3101
|
} else
|
|
3102
|
-
return this._def.schema._parseAsync({ data: n.data, path: n.path, parent: n }).then((i) => ie(i) ? Promise.resolve(
|
|
3102
|
+
return this._def.schema._parseAsync({ data: n.data, path: n.path, parent: n }).then((i) => ie(i) ? Promise.resolve(a.transform(i.value, s)).then((o) => ({
|
|
3103
3103
|
status: r.value,
|
|
3104
3104
|
value: o
|
|
3105
3105
|
})) : g);
|
|
3106
|
-
w.assertNever(
|
|
3106
|
+
w.assertNever(a);
|
|
3107
3107
|
}
|
|
3108
3108
|
}
|
|
3109
3109
|
ce.create = (t, e, r) => new ce({
|
|
@@ -3172,16 +3172,16 @@ var kn = ar((xn, Ye) => {
|
|
|
3172
3172
|
...r.common,
|
|
3173
3173
|
issues: []
|
|
3174
3174
|
}
|
|
3175
|
-
},
|
|
3175
|
+
}, a = this._def.innerType._parse({
|
|
3176
3176
|
data: n.data,
|
|
3177
3177
|
path: n.path,
|
|
3178
3178
|
parent: {
|
|
3179
3179
|
...n
|
|
3180
3180
|
}
|
|
3181
3181
|
});
|
|
3182
|
-
return Ne(
|
|
3182
|
+
return Ne(a) ? a.then((s) => ({
|
|
3183
3183
|
status: "valid",
|
|
3184
|
-
value:
|
|
3184
|
+
value: s.status === "valid" ? s.value : this._def.catchValue({
|
|
3185
3185
|
get error() {
|
|
3186
3186
|
return new V(n.common.issues);
|
|
3187
3187
|
},
|
|
@@ -3189,7 +3189,7 @@ var kn = ar((xn, Ye) => {
|
|
|
3189
3189
|
})
|
|
3190
3190
|
})) : {
|
|
3191
3191
|
status: "valid",
|
|
3192
|
-
value:
|
|
3192
|
+
value: a.status === "valid" ? a.value : this._def.catchValue({
|
|
3193
3193
|
get error() {
|
|
3194
3194
|
return new V(n.common.issues);
|
|
3195
3195
|
},
|
|
@@ -3242,28 +3242,28 @@ var kn = ar((xn, Ye) => {
|
|
|
3242
3242
|
const { status: r, ctx: n } = this._processInputParams(e);
|
|
3243
3243
|
if (n.common.async)
|
|
3244
3244
|
return (async () => {
|
|
3245
|
-
const
|
|
3245
|
+
const s = await this._def.in._parseAsync({
|
|
3246
3246
|
data: n.data,
|
|
3247
3247
|
path: n.path,
|
|
3248
3248
|
parent: n
|
|
3249
3249
|
});
|
|
3250
|
-
return
|
|
3251
|
-
data:
|
|
3250
|
+
return s.status === "aborted" ? g : s.status === "dirty" ? (r.dirty(), ye(s.value)) : this._def.out._parseAsync({
|
|
3251
|
+
data: s.value,
|
|
3252
3252
|
path: n.path,
|
|
3253
3253
|
parent: n
|
|
3254
3254
|
});
|
|
3255
3255
|
})();
|
|
3256
3256
|
{
|
|
3257
|
-
const
|
|
3257
|
+
const a = this._def.in._parseSync({
|
|
3258
3258
|
data: n.data,
|
|
3259
3259
|
path: n.path,
|
|
3260
3260
|
parent: n
|
|
3261
3261
|
});
|
|
3262
|
-
return
|
|
3262
|
+
return a.status === "aborted" ? g : a.status === "dirty" ? (r.dirty(), {
|
|
3263
3263
|
status: "dirty",
|
|
3264
|
-
value:
|
|
3264
|
+
value: a.value
|
|
3265
3265
|
}) : this._def.out._parseSync({
|
|
3266
|
-
data:
|
|
3266
|
+
data: a.value,
|
|
3267
3267
|
path: n.path,
|
|
3268
3268
|
parent: n
|
|
3269
3269
|
});
|
|
@@ -3279,8 +3279,8 @@ var kn = ar((xn, Ye) => {
|
|
|
3279
3279
|
}
|
|
3280
3280
|
class We extends v {
|
|
3281
3281
|
_parse(e) {
|
|
3282
|
-
const r = this._def.innerType._parse(e), n = (
|
|
3283
|
-
return Ne(r) ? r.then((
|
|
3282
|
+
const r = this._def.innerType._parse(e), n = (a) => (ie(a) && (a.value = Object.freeze(a.value)), a);
|
|
3283
|
+
return Ne(r) ? r.then((a) => n(a)) : n(r);
|
|
3284
3284
|
}
|
|
3285
3285
|
unwrap() {
|
|
3286
3286
|
return this._def.innerType;
|
|
@@ -3295,12 +3295,12 @@ var kn = ar((xn, Ye) => {
|
|
|
3295
3295
|
(function(t) {
|
|
3296
3296
|
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";
|
|
3297
3297
|
})(m || (m = {}));
|
|
3298
|
-
const N = q.create,
|
|
3298
|
+
const N = q.create, he = oe.create, D = ze.create;
|
|
3299
3299
|
J.create;
|
|
3300
3300
|
const rn = F.create, O = T.create, nn = Ce.create;
|
|
3301
3301
|
Ae.create;
|
|
3302
3302
|
ee.create;
|
|
3303
|
-
const
|
|
3303
|
+
const an = Ie.create, R = de.create;
|
|
3304
3304
|
Pe.create;
|
|
3305
3305
|
B.create;
|
|
3306
3306
|
le.create;
|
|
@@ -3314,7 +3314,7 @@ var kn = ar((xn, Ye) => {
|
|
|
3314
3314
|
return "Unknown error";
|
|
3315
3315
|
if (t instanceof Error) {
|
|
3316
3316
|
const e = Je.safeParse(t.cause);
|
|
3317
|
-
return e.success ? e.data.detail :
|
|
3317
|
+
return e.success ? e.data.detail : sn(t.message);
|
|
3318
3318
|
}
|
|
3319
3319
|
if (typeof t == "object") {
|
|
3320
3320
|
const e = Je.safeParse(t);
|
|
@@ -3330,7 +3330,7 @@ var kn = ar((xn, Ye) => {
|
|
|
3330
3330
|
return String(t);
|
|
3331
3331
|
}
|
|
3332
3332
|
}
|
|
3333
|
-
function
|
|
3333
|
+
function sn(t) {
|
|
3334
3334
|
const e = on(t);
|
|
3335
3335
|
if (!e)
|
|
3336
3336
|
return t;
|
|
@@ -3377,15 +3377,15 @@ var kn = ar((xn, Ye) => {
|
|
|
3377
3377
|
}).passthrough().default({}),
|
|
3378
3378
|
save: O({
|
|
3379
3379
|
autosave: R(["off", "after_delay"]).default("after_delay"),
|
|
3380
|
-
autosave_delay:
|
|
3380
|
+
autosave_delay: he().nonnegative().transform((t) => Math.max(t, 1e3)).default(1e3),
|
|
3381
3381
|
format_on_save: D().default(!1)
|
|
3382
3382
|
}).passthrough().default({}),
|
|
3383
3383
|
formatting: O({
|
|
3384
|
-
line_length:
|
|
3384
|
+
line_length: he().nonnegative().default(79).transform((t) => Math.min(t, 1e3))
|
|
3385
3385
|
}).passthrough().default({}),
|
|
3386
3386
|
keymap: O({
|
|
3387
3387
|
preset: R(["default", "vim"]).default("default"),
|
|
3388
|
-
overrides:
|
|
3388
|
+
overrides: an(N()).default({})
|
|
3389
3389
|
}).passthrough().default({}),
|
|
3390
3390
|
runtime: O({
|
|
3391
3391
|
auto_instantiate: D().default(!0),
|
|
@@ -3396,10 +3396,11 @@ var kn = ar((xn, Ye) => {
|
|
|
3396
3396
|
}).passthrough().default({}),
|
|
3397
3397
|
display: O({
|
|
3398
3398
|
theme: R(["light", "dark", "system"]).default("light"),
|
|
3399
|
-
code_editor_font_size:
|
|
3399
|
+
code_editor_font_size: he().nonnegative().default(14),
|
|
3400
3400
|
cell_output: R(["above", "below"]).default("above"),
|
|
3401
3401
|
dataframes: R(["rich", "plain"]).default("rich"),
|
|
3402
|
-
default_table_page_size:
|
|
3402
|
+
default_table_page_size: he().default(10),
|
|
3403
|
+
default_table_max_columns: he().default(50),
|
|
3403
3404
|
default_width: R(Kt).default("medium").transform((t) => t === "normal" ? "compact" : t),
|
|
3404
3405
|
reference_highlighting: D().default(!1)
|
|
3405
3406
|
}).passthrough().default({}),
|
|
@@ -3464,22 +3465,22 @@ var kn = ar((xn, Ye) => {
|
|
|
3464
3465
|
return cn.parse({});
|
|
3465
3466
|
}
|
|
3466
3467
|
const vt = (t) => new TextDecoder().decode(t);
|
|
3467
|
-
function
|
|
3468
|
+
function ge(t) {
|
|
3468
3469
|
return t.FS;
|
|
3469
3470
|
}
|
|
3470
|
-
const
|
|
3471
|
-
NOTEBOOK_FILENAME:
|
|
3472
|
-
HOME_DIR:
|
|
3471
|
+
const pe = "notebook.py", me = "/marimo", K = {
|
|
3472
|
+
NOTEBOOK_FILENAME: pe,
|
|
3473
|
+
HOME_DIR: me,
|
|
3473
3474
|
createHomeDir: (t) => {
|
|
3474
|
-
const e =
|
|
3475
|
+
const e = ge(t);
|
|
3475
3476
|
try {
|
|
3476
|
-
e.mkdirTree(
|
|
3477
|
+
e.mkdirTree(me);
|
|
3477
3478
|
} catch {
|
|
3478
3479
|
}
|
|
3479
|
-
e.chdir(
|
|
3480
|
+
e.chdir(me);
|
|
3480
3481
|
},
|
|
3481
3482
|
mountFS: (t) => {
|
|
3482
|
-
|
|
3483
|
+
ge(t).mount(t.FS.filesystems.IDBFS, { root: "." }, me);
|
|
3483
3484
|
},
|
|
3484
3485
|
populateFilesToMemory: async (t) => {
|
|
3485
3486
|
await kt(t, !0);
|
|
@@ -3488,36 +3489,36 @@ var kn = ar((xn, Ye) => {
|
|
|
3488
3489
|
await kt(t, !1);
|
|
3489
3490
|
},
|
|
3490
3491
|
readNotebook: (t) => {
|
|
3491
|
-
const e =
|
|
3492
|
+
const e = ge(t), r = `${me}/${pe}`;
|
|
3492
3493
|
return vt(e.readFile(r));
|
|
3493
3494
|
},
|
|
3494
3495
|
initNotebookCode: (t) => {
|
|
3495
|
-
const { pyodide: e, filename: r, code: n } = t,
|
|
3496
|
+
const { pyodide: e, filename: r, code: n } = t, a = ge(e), s = (i) => {
|
|
3496
3497
|
try {
|
|
3497
|
-
return vt(
|
|
3498
|
+
return vt(a.readFile(i));
|
|
3498
3499
|
} catch {
|
|
3499
3500
|
return null;
|
|
3500
3501
|
}
|
|
3501
3502
|
};
|
|
3502
|
-
if (r && r !==
|
|
3503
|
-
const i =
|
|
3503
|
+
if (r && r !== pe) {
|
|
3504
|
+
const i = s(r);
|
|
3504
3505
|
if (i)
|
|
3505
3506
|
return {
|
|
3506
3507
|
code: i,
|
|
3507
3508
|
filename: r
|
|
3508
3509
|
};
|
|
3509
3510
|
}
|
|
3510
|
-
return
|
|
3511
|
+
return a.writeFile(pe, n), {
|
|
3511
3512
|
code: n,
|
|
3512
|
-
filename:
|
|
3513
|
+
filename: pe
|
|
3513
3514
|
};
|
|
3514
3515
|
}
|
|
3515
3516
|
};
|
|
3516
3517
|
function kt(t, e) {
|
|
3517
3518
|
return new Promise((r, n) => {
|
|
3518
|
-
|
|
3519
|
-
if (
|
|
3520
|
-
n(
|
|
3519
|
+
ge(t).syncfs(e, (a) => {
|
|
3520
|
+
if (a instanceof Error) {
|
|
3521
|
+
n(a);
|
|
3521
3522
|
return;
|
|
3522
3523
|
}
|
|
3523
3524
|
r();
|
|
@@ -3531,7 +3532,7 @@ var kn = ar((xn, Ye) => {
|
|
|
3531
3532
|
name: e,
|
|
3532
3533
|
startTime: Date.now(),
|
|
3533
3534
|
attributes: r,
|
|
3534
|
-
end: (
|
|
3535
|
+
end: (a = "ok") => this.endSpan(n, a)
|
|
3535
3536
|
};
|
|
3536
3537
|
return this.spans.push(n), n;
|
|
3537
3538
|
}
|
|
@@ -3542,30 +3543,30 @@ var kn = ar((xn, Ye) => {
|
|
|
3542
3543
|
return this.spans;
|
|
3543
3544
|
}
|
|
3544
3545
|
wrap(e, r, n = {}) {
|
|
3545
|
-
const
|
|
3546
|
+
const a = this.startSpan(r || e.name, n);
|
|
3546
3547
|
try {
|
|
3547
|
-
const
|
|
3548
|
-
return this.endSpan(
|
|
3549
|
-
} catch (
|
|
3550
|
-
throw this.endSpan(
|
|
3548
|
+
const s = e();
|
|
3549
|
+
return this.endSpan(a), s;
|
|
3550
|
+
} catch (s) {
|
|
3551
|
+
throw this.endSpan(a, "error"), s;
|
|
3551
3552
|
}
|
|
3552
3553
|
}
|
|
3553
3554
|
wrapAsync(e, r, n = {}) {
|
|
3554
|
-
return async (...
|
|
3555
|
-
const
|
|
3555
|
+
return async (...a) => {
|
|
3556
|
+
const s = this.startSpan(r || e.name, n);
|
|
3556
3557
|
try {
|
|
3557
|
-
const i = await e(...
|
|
3558
|
-
return this.endSpan(
|
|
3558
|
+
const i = await e(...a);
|
|
3559
|
+
return this.endSpan(s), i;
|
|
3559
3560
|
} catch (i) {
|
|
3560
|
-
throw this.endSpan(
|
|
3561
|
+
throw this.endSpan(s, "error"), i;
|
|
3561
3562
|
}
|
|
3562
3563
|
};
|
|
3563
3564
|
}
|
|
3564
3565
|
logSpans() {
|
|
3565
3566
|
}
|
|
3566
3567
|
}
|
|
3567
|
-
const
|
|
3568
|
-
globalThis.t =
|
|
3568
|
+
const se = new hn();
|
|
3569
|
+
globalThis.t = se;
|
|
3569
3570
|
const pn = !1;
|
|
3570
3571
|
class mn {
|
|
3571
3572
|
pyodide = null;
|
|
@@ -3578,7 +3579,7 @@ var kn = ar((xn, Ye) => {
|
|
|
3578
3579
|
async loadPyodideAndPackages(e) {
|
|
3579
3580
|
if (!qe)
|
|
3580
3581
|
throw new Error("loadPyodide is not defined");
|
|
3581
|
-
const r =
|
|
3582
|
+
const r = se.startSpan("loadPyodide");
|
|
3582
3583
|
try {
|
|
3583
3584
|
const n = await qe({
|
|
3584
3585
|
// Perf: These get loaded while pyodide is being bootstrapped
|
|
@@ -3603,7 +3604,7 @@ var kn = ar((xn, Ye) => {
|
|
|
3603
3604
|
}
|
|
3604
3605
|
}
|
|
3605
3606
|
async mountFilesystem(e) {
|
|
3606
|
-
const r =
|
|
3607
|
+
const r = se.startSpan("mountFilesystem");
|
|
3607
3608
|
return K.createHomeDir(this.requirePyodide), K.mountFS(this.requirePyodide), await K.populateFilesToMemory(this.requirePyodide), r.end("ok"), K.initNotebookCode({
|
|
3608
3609
|
pyodide: this.requirePyodide,
|
|
3609
3610
|
code: e.code,
|
|
@@ -3611,11 +3612,11 @@ var kn = ar((xn, Ye) => {
|
|
|
3611
3612
|
});
|
|
3612
3613
|
}
|
|
3613
3614
|
async startSession(e) {
|
|
3614
|
-
const { code: r, filename: n, onMessage:
|
|
3615
|
+
const { code: r, filename: n, onMessage: a, queryParameters: s, userConfig: i } = e;
|
|
3615
3616
|
self.messenger = {
|
|
3616
|
-
callback:
|
|
3617
|
-
}, self.query_params =
|
|
3618
|
-
const o =
|
|
3617
|
+
callback: a
|
|
3618
|
+
}, self.query_params = s, self.user_config = i;
|
|
3619
|
+
const o = se.startSpan("startSession.runPython"), d = n || K.NOTEBOOK_FILENAME, [l, h, x] = this.requirePyodide.runPython(
|
|
3619
3620
|
`
|
|
3620
3621
|
print("[py] Starting marimo...")
|
|
3621
3622
|
import asyncio
|
|
@@ -3657,13 +3658,13 @@ ${e}`, e = `import pygments
|
|
|
3657
3658
|
${e}`, e = `import jedi
|
|
3658
3659
|
${e}`, e = `import pyodide_http
|
|
3659
3660
|
${e}`;
|
|
3660
|
-
const
|
|
3661
|
-
let
|
|
3661
|
+
const a = [...r];
|
|
3662
|
+
let s = se.startSpan("pyodide.loadPackage");
|
|
3662
3663
|
await n.loadPackagesFromImports(e, {
|
|
3663
3664
|
errorCallback: H.error,
|
|
3664
3665
|
messageCallback: H.log
|
|
3665
|
-
}),
|
|
3666
|
-
const i =
|
|
3666
|
+
}), s.end(), s = se.startSpan("micropip.install");
|
|
3667
|
+
const i = a.filter(
|
|
3667
3668
|
(o) => !n.loadedPackages[o]
|
|
3668
3669
|
);
|
|
3669
3670
|
i.length > 0 && await n.runPythonAsync(`
|
|
@@ -3676,7 +3677,7 @@ ${e}`;
|
|
|
3676
3677
|
await micropip.install(missing)
|
|
3677
3678
|
`).catch((o) => {
|
|
3678
3679
|
H.error("Failed to load packages from micropip", o);
|
|
3679
|
-
}),
|
|
3680
|
+
}), s.end();
|
|
3680
3681
|
}
|
|
3681
3682
|
}
|
|
3682
3683
|
class yn extends mn {
|
|
@@ -3691,8 +3692,8 @@ ${e}`;
|
|
|
3691
3692
|
code: r,
|
|
3692
3693
|
filename: n
|
|
3693
3694
|
});
|
|
3694
|
-
} catch (
|
|
3695
|
-
H.error(
|
|
3695
|
+
} catch (a) {
|
|
3696
|
+
H.error(a);
|
|
3696
3697
|
}
|
|
3697
3698
|
return { code: r, filename: n };
|
|
3698
3699
|
}
|
|
@@ -3763,14 +3764,14 @@ ${t}`)), await self.pyodide.loadPackagesFromImports(t, {
|
|
|
3763
3764
|
*/
|
|
3764
3765
|
bridge: async (t) => {
|
|
3765
3766
|
await Se;
|
|
3766
|
-
const { functionName: e, payload: r } = t, n = await wt.promise,
|
|
3767
|
+
const { functionName: e, payload: r } = t, n = await wt.promise, a = r == null ? null : typeof r == "string" ? r : JSON.stringify(r), s = a == null ? (
|
|
3767
3768
|
// @ts-expect-error ehh TypeScript
|
|
3768
3769
|
await n[e]()
|
|
3769
3770
|
) : (
|
|
3770
3771
|
// @ts-expect-error ehh TypeScript
|
|
3771
|
-
await n[e](
|
|
3772
|
+
await n[e](a)
|
|
3772
3773
|
);
|
|
3773
|
-
return typeof
|
|
3774
|
+
return typeof s == "string" ? JSON.parse(s) : s;
|
|
3774
3775
|
}
|
|
3775
3776
|
}, ue = cr({
|
|
3776
3777
|
transport: hr({
|