@animaapp/anima-sdk-react 0.6.16 → 0.6.18
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/index.cjs +3 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +575 -563
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -34,14 +34,14 @@ const va = (t) => {
|
|
|
34
34
|
e += String.fromCharCode(n[r]);
|
|
35
35
|
return btoa(e);
|
|
36
36
|
};
|
|
37
|
-
var _a = Object.defineProperty, ba = Object.defineProperties, wa = Object.getOwnPropertyDescriptors, qs = Object.getOwnPropertySymbols, ka = Object.prototype.hasOwnProperty,
|
|
37
|
+
var _a = Object.defineProperty, ba = Object.defineProperties, wa = Object.getOwnPropertyDescriptors, qs = Object.getOwnPropertySymbols, ka = Object.prototype.hasOwnProperty, Ea = Object.prototype.propertyIsEnumerable, Hs = (t, e, n) => e in t ? _a(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, d = (t, e) => {
|
|
38
38
|
for (var n in e || (e = {}))
|
|
39
39
|
ka.call(e, n) && Hs(t, n, e[n]);
|
|
40
40
|
if (qs)
|
|
41
41
|
for (var n of qs(e))
|
|
42
|
-
|
|
42
|
+
Ea.call(e, n) && Hs(t, n, e[n]);
|
|
43
43
|
return t;
|
|
44
|
-
},
|
|
44
|
+
}, x = (t, e) => ba(t, wa(e)), Ee = (t, e, n) => new Promise((s, r) => {
|
|
45
45
|
var a = (c) => {
|
|
46
46
|
try {
|
|
47
47
|
o(n.next(c));
|
|
@@ -67,14 +67,14 @@ class Gs extends Error {
|
|
|
67
67
|
super(), this.name = e, this.message = n, this.detail = r, this.status = s;
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
|
-
const
|
|
70
|
+
const xa = "Figma Token Issue";
|
|
71
71
|
class Sa extends Error {
|
|
72
72
|
constructor({
|
|
73
73
|
fileKey: e,
|
|
74
74
|
reason: n,
|
|
75
75
|
cause: s
|
|
76
76
|
}) {
|
|
77
|
-
super(
|
|
77
|
+
super(xa), this.fileKey = e, this.reason = n, this.cause = s;
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
const Oa = "Rate Limit Exceeded";
|
|
@@ -83,10 +83,10 @@ class Ta extends Error {
|
|
|
83
83
|
super(Oa), this.fileKey = e, this.cause = n;
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
|
-
const
|
|
87
|
-
class
|
|
86
|
+
const Ca = "Request Too Large";
|
|
87
|
+
class Aa extends Error {
|
|
88
88
|
constructor({ fileKey: e, cause: n }) {
|
|
89
|
-
super(
|
|
89
|
+
super(Ca), this.fileKey = e, this.cause = n;
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
const Na = "Not Found";
|
|
@@ -116,20 +116,20 @@ const ja = (t, e) => {
|
|
|
116
116
|
if (r === 404)
|
|
117
117
|
return new Ra({ fileKey: e, cause: t });
|
|
118
118
|
if (r === 400 && s.includes("Request too large"))
|
|
119
|
-
return new
|
|
119
|
+
return new Aa({ fileKey: e, cause: t });
|
|
120
120
|
}
|
|
121
121
|
return new Ia({ fileKey: e, cause: t });
|
|
122
122
|
};
|
|
123
123
|
var Za = Object.defineProperty, Da = Object.defineProperties, Ma = Object.getOwnPropertyDescriptors, Js = Object.getOwnPropertySymbols, La = Object.prototype.hasOwnProperty, $a = Object.prototype.propertyIsEnumerable, Xs = (t, e) => (e = Symbol[t]) ? e : Symbol.for("Symbol." + t), Tr = (t) => {
|
|
124
124
|
throw TypeError(t);
|
|
125
|
-
}, Ys = (t, e, n) => e in t ? Za(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n,
|
|
125
|
+
}, Ys = (t, e, n) => e in t ? Za(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, ie = (t, e) => {
|
|
126
126
|
for (var n in e || (e = {}))
|
|
127
127
|
La.call(e, n) && Ys(t, n, e[n]);
|
|
128
128
|
if (Js)
|
|
129
129
|
for (var n of Js(e))
|
|
130
130
|
$a.call(e, n) && Ys(t, n, e[n]);
|
|
131
131
|
return t;
|
|
132
|
-
}, Ts = (t, e) => Da(t, Ma(e)),
|
|
132
|
+
}, Ts = (t, e) => Da(t, Ma(e)), Cs = (t, e, n) => e.has(t) || Tr("Cannot " + n), j = (t, e, n) => (Cs(t, e, "read from private field"), n ? n.call(t) : e.get(t)), le = (t, e, n) => e.has(t) ? Tr("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), X = (t, e, n, s) => (Cs(t, e, "write to private field"), e.set(t, n), n), be = (t, e, n) => (Cs(t, e, "access private method"), n), B = (t, e, n) => new Promise((s, r) => {
|
|
133
133
|
var a = (c) => {
|
|
134
134
|
try {
|
|
135
135
|
o(n.next(c));
|
|
@@ -154,11 +154,11 @@ function za() {
|
|
|
154
154
|
(function(n, s) {
|
|
155
155
|
t.exports = s();
|
|
156
156
|
})(Va, function() {
|
|
157
|
-
var n = typeof Promise == "function", s = typeof self == "object" ? self : Wa, r = typeof Symbol != "undefined", a = typeof Map != "undefined", i = typeof Set != "undefined", o = typeof WeakMap != "undefined", c = typeof WeakSet != "undefined", u = typeof DataView != "undefined", h = r && typeof Symbol.iterator != "undefined", p = r && typeof Symbol.toStringTag != "undefined", k = i && typeof Set.prototype.entries == "function", g = a && typeof Map.prototype.entries == "function", b = k && Object.getPrototypeOf((/* @__PURE__ */ new Set()).entries()), m = g && Object.getPrototypeOf((/* @__PURE__ */ new Map()).entries()), _ = h && typeof Array.prototype[Symbol.iterator] == "function", l = _ && Object.getPrototypeOf([][Symbol.iterator]()),
|
|
158
|
-
function
|
|
159
|
-
var
|
|
160
|
-
if (
|
|
161
|
-
return
|
|
157
|
+
var n = typeof Promise == "function", s = typeof self == "object" ? self : Wa, r = typeof Symbol != "undefined", a = typeof Map != "undefined", i = typeof Set != "undefined", o = typeof WeakMap != "undefined", c = typeof WeakSet != "undefined", u = typeof DataView != "undefined", h = r && typeof Symbol.iterator != "undefined", p = r && typeof Symbol.toStringTag != "undefined", k = i && typeof Set.prototype.entries == "function", g = a && typeof Map.prototype.entries == "function", b = k && Object.getPrototypeOf((/* @__PURE__ */ new Set()).entries()), m = g && Object.getPrototypeOf((/* @__PURE__ */ new Map()).entries()), _ = h && typeof Array.prototype[Symbol.iterator] == "function", l = _ && Object.getPrototypeOf([][Symbol.iterator]()), A = h && typeof String.prototype[Symbol.iterator] == "function", I = A && Object.getPrototypeOf(""[Symbol.iterator]()), K = 8, Z = -1;
|
|
158
|
+
function V(D) {
|
|
159
|
+
var M = typeof D;
|
|
160
|
+
if (M !== "object")
|
|
161
|
+
return M;
|
|
162
162
|
if (D === null)
|
|
163
163
|
return "null";
|
|
164
164
|
if (D === s)
|
|
@@ -185,18 +185,18 @@ function za() {
|
|
|
185
185
|
return "HTMLTableHeaderCellElement";
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
|
-
var
|
|
189
|
-
if (typeof
|
|
190
|
-
return
|
|
191
|
-
var
|
|
192
|
-
return
|
|
188
|
+
var G = p && D[Symbol.toStringTag];
|
|
189
|
+
if (typeof G == "string")
|
|
190
|
+
return G;
|
|
191
|
+
var $ = Object.getPrototypeOf(D);
|
|
192
|
+
return $ === RegExp.prototype ? "RegExp" : $ === Date.prototype ? "Date" : n && $ === Promise.prototype ? "Promise" : i && $ === Set.prototype ? "Set" : a && $ === Map.prototype ? "Map" : c && $ === WeakSet.prototype ? "WeakSet" : o && $ === WeakMap.prototype ? "WeakMap" : u && $ === DataView.prototype ? "DataView" : a && $ === m ? "Map Iterator" : i && $ === b ? "Set Iterator" : _ && $ === l ? "Array Iterator" : A && $ === I ? "String Iterator" : $ === null ? "Object" : Object.prototype.toString.call(D).slice(K, Z);
|
|
193
193
|
}
|
|
194
|
-
return
|
|
194
|
+
return V;
|
|
195
195
|
});
|
|
196
196
|
}(Bn)), Bn.exports;
|
|
197
197
|
}
|
|
198
198
|
var Ka = za();
|
|
199
|
-
const Ba = /* @__PURE__ */ Ua(Ka),
|
|
199
|
+
const Ba = /* @__PURE__ */ Ua(Ka), As = typeof Buffer != "undefined", qa = As && typeof Buffer.from != "undefined", Ha = As ? (
|
|
200
200
|
/**
|
|
201
201
|
* is value is Buffer?
|
|
202
202
|
*
|
|
@@ -227,7 +227,7 @@ const Ba = /* @__PURE__ */ Ua(Ka), Cs = typeof Buffer != "undefined", qa = Cs &&
|
|
|
227
227
|
function(t) {
|
|
228
228
|
return Buffer.from(t);
|
|
229
229
|
}
|
|
230
|
-
) :
|
|
230
|
+
) : As ? (
|
|
231
231
|
/**
|
|
232
232
|
* copy Buffer
|
|
233
233
|
*
|
|
@@ -318,10 +318,10 @@ function oi(t) {
|
|
|
318
318
|
function ci(t) {
|
|
319
319
|
return new String(t);
|
|
320
320
|
}
|
|
321
|
-
function
|
|
321
|
+
function Ce(t, e) {
|
|
322
322
|
return Rn[e].from ? Rn[e].from(t) : new Rn[e](t);
|
|
323
323
|
}
|
|
324
|
-
function
|
|
324
|
+
function ee(t) {
|
|
325
325
|
return t;
|
|
326
326
|
}
|
|
327
327
|
function tr() {
|
|
@@ -348,33 +348,33 @@ const fi = /* @__PURE__ */ new Map([
|
|
|
348
348
|
["String", ci],
|
|
349
349
|
// typed arrays
|
|
350
350
|
// TODO: pass bound function
|
|
351
|
-
["Float32Array",
|
|
352
|
-
["Float64Array",
|
|
353
|
-
["Int16Array",
|
|
354
|
-
["Int32Array",
|
|
355
|
-
["Int8Array",
|
|
356
|
-
["Uint16Array",
|
|
357
|
-
["Uint32Array",
|
|
358
|
-
["Uint8Array",
|
|
359
|
-
["Uint8ClampedArray",
|
|
351
|
+
["Float32Array", Ce],
|
|
352
|
+
["Float64Array", Ce],
|
|
353
|
+
["Int16Array", Ce],
|
|
354
|
+
["Int32Array", Ce],
|
|
355
|
+
["Int8Array", Ce],
|
|
356
|
+
["Uint16Array", Ce],
|
|
357
|
+
["Uint32Array", Ce],
|
|
358
|
+
["Uint8Array", Ce],
|
|
359
|
+
["Uint8ClampedArray", Ce],
|
|
360
360
|
// shallow copy
|
|
361
|
-
["Array Iterator",
|
|
362
|
-
["Map Iterator",
|
|
363
|
-
["Promise",
|
|
364
|
-
["Set Iterator",
|
|
365
|
-
["String Iterator",
|
|
366
|
-
["function",
|
|
367
|
-
["global",
|
|
361
|
+
["Array Iterator", ee],
|
|
362
|
+
["Map Iterator", ee],
|
|
363
|
+
["Promise", ee],
|
|
364
|
+
["Set Iterator", ee],
|
|
365
|
+
["String Iterator", ee],
|
|
366
|
+
["function", ee],
|
|
367
|
+
["global", ee],
|
|
368
368
|
// NOTE: WeakMap and WeakSet cannot get entries
|
|
369
|
-
["WeakMap",
|
|
370
|
-
["WeakSet",
|
|
369
|
+
["WeakMap", ee],
|
|
370
|
+
["WeakSet", ee],
|
|
371
371
|
// primitives
|
|
372
|
-
["boolean",
|
|
373
|
-
["null",
|
|
374
|
-
["number",
|
|
375
|
-
["string",
|
|
376
|
-
["symbol",
|
|
377
|
-
["undefined",
|
|
372
|
+
["boolean", ee],
|
|
373
|
+
["null", ee],
|
|
374
|
+
["number", ee],
|
|
375
|
+
["string", ee],
|
|
376
|
+
["symbol", ee],
|
|
377
|
+
["undefined", ee],
|
|
378
378
|
// collections
|
|
379
379
|
// NOTE: return empty value, because recursively copy later.
|
|
380
380
|
["Arguments", tr],
|
|
@@ -460,26 +460,26 @@ function Gn(t, e, n, s, r) {
|
|
|
460
460
|
return e;
|
|
461
461
|
}
|
|
462
462
|
const pi = (t) => new Promise((e) => setTimeout(e, t));
|
|
463
|
-
var an, He, on, Jn,
|
|
463
|
+
var an, He, on, Jn, Cr;
|
|
464
464
|
class mi {
|
|
465
465
|
constructor({ maxAttempts: e = 3, func: n }) {
|
|
466
|
-
|
|
466
|
+
le(this, Jn), le(this, an), le(this, He), le(this, on), X(this, an, e), X(this, on, n), X(this, He, 0);
|
|
467
467
|
}
|
|
468
468
|
run() {
|
|
469
469
|
return B(this, null, function* () {
|
|
470
470
|
try {
|
|
471
|
-
return yield
|
|
471
|
+
return yield j(this, on).call(this);
|
|
472
472
|
} catch (e) {
|
|
473
|
-
if (
|
|
473
|
+
if (X(this, He, j(this, He) + 1), j(this, He) > j(this, an))
|
|
474
474
|
throw console.error("Max attempts reached"), e;
|
|
475
|
-
const n =
|
|
475
|
+
const n = be(this, Jn, Cr).call(this);
|
|
476
476
|
return yield pi(n), yield this.run();
|
|
477
477
|
}
|
|
478
478
|
});
|
|
479
479
|
}
|
|
480
480
|
}
|
|
481
|
-
an = /* @__PURE__ */ new WeakMap(), He = /* @__PURE__ */ new WeakMap(), on = /* @__PURE__ */ new WeakMap(), Jn = /* @__PURE__ */ new WeakSet(),
|
|
482
|
-
return
|
|
481
|
+
an = /* @__PURE__ */ new WeakMap(), He = /* @__PURE__ */ new WeakMap(), on = /* @__PURE__ */ new WeakMap(), Jn = /* @__PURE__ */ new WeakSet(), Cr = function() {
|
|
482
|
+
return j(this, He) * 1e3 * 1.5;
|
|
483
483
|
};
|
|
484
484
|
function yi() {
|
|
485
485
|
return typeof CompressionStream != "undefined";
|
|
@@ -544,7 +544,7 @@ class nr extends Error {
|
|
|
544
544
|
}
|
|
545
545
|
}
|
|
546
546
|
}
|
|
547
|
-
class
|
|
547
|
+
class Et extends Error {
|
|
548
548
|
constructor(e = {}) {
|
|
549
549
|
const { canceled: n = !1 } = e;
|
|
550
550
|
super("Abort Error"), this.name = "Abort Error", this.canceled = n;
|
|
@@ -560,7 +560,7 @@ class Pn extends Error {
|
|
|
560
560
|
super(e), this.name = "Request Validation Error";
|
|
561
561
|
}
|
|
562
562
|
}
|
|
563
|
-
function
|
|
563
|
+
function Ar() {
|
|
564
564
|
return Array.from(
|
|
565
565
|
{ length: 32 },
|
|
566
566
|
() => Math.floor(Math.random() * 256).toString(16).padStart(2, "0")
|
|
@@ -570,10 +570,10 @@ function Xn() {
|
|
|
570
570
|
return Math.floor(Date.now() / 1e3).toString();
|
|
571
571
|
}
|
|
572
572
|
const wi = 5 * 60 * 1e3, ki = 1 * 1e3;
|
|
573
|
-
var Ge,
|
|
574
|
-
class
|
|
573
|
+
var Ge, se, ve, Yn, Qn, xt;
|
|
574
|
+
class Ei {
|
|
575
575
|
constructor({ fetch: e = globalThis.fetch.bind(globalThis), baseAddress: n }) {
|
|
576
|
-
|
|
576
|
+
le(this, ve), le(this, Ge), le(this, se), this.baseAddress = n, X(this, Ge, e), X(this, se, {}), this.plugins = [];
|
|
577
577
|
}
|
|
578
578
|
get headers() {
|
|
579
579
|
throw new Error("Missing implementation");
|
|
@@ -585,49 +585,49 @@ class xi {
|
|
|
585
585
|
this.plugins = this.plugins.filter((n) => n.name !== e);
|
|
586
586
|
}
|
|
587
587
|
withOptions(e = {}) {
|
|
588
|
-
return
|
|
588
|
+
return X(this, se, e), this;
|
|
589
589
|
}
|
|
590
590
|
get(e) {
|
|
591
591
|
return B(this, arguments, function* (n, s = {}) {
|
|
592
592
|
const { overrideBaseAddress: r, overrideDefaultHeaders: a } = s, i = r != null ? r : this.baseAddress;
|
|
593
593
|
let o = a != null ? a : this.headers;
|
|
594
|
-
const c = kt(
|
|
595
|
-
return
|
|
594
|
+
const c = kt(j(this, se));
|
|
595
|
+
return X(this, se, {}), c.extraHeaders && (o = ie(ie({}, o), c.extraHeaders)), c.requestValidation && (o = Ts(ie({}, o), { "X-Request-Nonce": Ar(), "X-Request-Timestamp": Xn() })), c.async ? yield be(this, ve, Qn).call(this, `${i}${n}`, c.async, { headers: o }) : yield be(this, ve, Yn).call(this, `${i}${n}`, c, { headers: o });
|
|
596
596
|
});
|
|
597
597
|
}
|
|
598
598
|
post(e, n) {
|
|
599
599
|
return B(this, arguments, function* (s, r, a = {}) {
|
|
600
|
-
const i = kt(
|
|
601
|
-
return
|
|
600
|
+
const i = kt(j(this, se));
|
|
601
|
+
return X(this, se, {}), be(this, ve, xt).call(this, s, "POST", r, a, i);
|
|
602
602
|
});
|
|
603
603
|
}
|
|
604
604
|
put(e, n) {
|
|
605
605
|
return B(this, arguments, function* (s, r, a = {}) {
|
|
606
|
-
const i = kt(
|
|
607
|
-
return
|
|
606
|
+
const i = kt(j(this, se));
|
|
607
|
+
return X(this, se, {}), be(this, ve, xt).call(this, s, "PUT", r, a, i);
|
|
608
608
|
});
|
|
609
609
|
}
|
|
610
610
|
delete(e, n) {
|
|
611
611
|
return B(this, arguments, function* (s, r, a = {}) {
|
|
612
|
-
const i = kt(
|
|
613
|
-
return
|
|
612
|
+
const i = kt(j(this, se));
|
|
613
|
+
return X(this, se, {}), be(this, ve, xt).call(this, s, "DELETE", r, a, i);
|
|
614
614
|
});
|
|
615
615
|
}
|
|
616
616
|
patch(e, n) {
|
|
617
617
|
return B(this, arguments, function* (s, r, a = {}) {
|
|
618
|
-
const i = kt(
|
|
619
|
-
return
|
|
618
|
+
const i = kt(j(this, se));
|
|
619
|
+
return X(this, se, {}), be(this, ve, xt).call(this, s, "PATCH", r, a, i);
|
|
620
620
|
});
|
|
621
621
|
}
|
|
622
622
|
}
|
|
623
|
-
Ge = /* @__PURE__ */ new WeakMap(),
|
|
623
|
+
Ge = /* @__PURE__ */ new WeakMap(), se = /* @__PURE__ */ new WeakMap(), ve = /* @__PURE__ */ new WeakSet(), Yn = function(t, e, n) {
|
|
624
624
|
return B(this, null, function* () {
|
|
625
625
|
const s = () => B(this, null, function* () {
|
|
626
626
|
var c, u;
|
|
627
627
|
try {
|
|
628
|
-
return yield
|
|
628
|
+
return yield j(this, Ge).call(this, t, ie(ie({}, n), e.abortSignal && { signal: e.abortSignal }));
|
|
629
629
|
} catch (h) {
|
|
630
|
-
throw h instanceof Error && h.name === "AbortError" ? new
|
|
630
|
+
throw h instanceof Error && h.name === "AbortError" ? new Et({ canceled: (u = (c = e.abortSignal) == null ? void 0 : c.aborted) != null ? u : !1 }) : h;
|
|
631
631
|
}
|
|
632
632
|
}), { headers: r } = n != null ? n : {}, a = (c, u) => {
|
|
633
633
|
var h, p;
|
|
@@ -685,9 +685,9 @@ Ge = /* @__PURE__ */ new WeakMap(), ne = /* @__PURE__ */ new WeakMap(), ge = /*
|
|
|
685
685
|
} = e, u = `${t}/async`, h = `${t}/async/job`;
|
|
686
686
|
let p;
|
|
687
687
|
try {
|
|
688
|
-
p = yield
|
|
688
|
+
p = yield j(this, Ge).call(this, u, ie(ie({}, n), i && { signal: i }));
|
|
689
689
|
} catch (b) {
|
|
690
|
-
throw b instanceof Error && b.name === "AbortError" ? new
|
|
690
|
+
throw b instanceof Error && b.name === "AbortError" ? new Et({ canceled: (s = i == null ? void 0 : i.aborted) != null ? s : !1 }) : b;
|
|
691
691
|
}
|
|
692
692
|
if (!p.ok) {
|
|
693
693
|
const b = yield p.text().catch();
|
|
@@ -706,27 +706,27 @@ Ge = /* @__PURE__ */ new WeakMap(), ne = /* @__PURE__ */ new WeakMap(), ge = /*
|
|
|
706
706
|
return new Promise((b, m) => B(this, null, function* () {
|
|
707
707
|
const _ = setTimeout(() => {
|
|
708
708
|
m(new Error("Job timed out"));
|
|
709
|
-
}, c), l = (
|
|
709
|
+
}, c), l = (A = 0) => B(this, null, function* () {
|
|
710
710
|
if (i != null && i.aborted) {
|
|
711
|
-
clearTimeout(_),
|
|
712
|
-
m(new
|
|
711
|
+
clearTimeout(_), j(this, Ge).call(this, `${h}/${g}/cancel`, { method: "POST", headers: this.headers }).then(() => {
|
|
712
|
+
m(new Et({ canceled: !0 }));
|
|
713
713
|
}).catch((I) => {
|
|
714
|
-
m(new
|
|
714
|
+
m(new Et({ canceled: !1 }));
|
|
715
715
|
});
|
|
716
716
|
return;
|
|
717
717
|
}
|
|
718
718
|
try {
|
|
719
|
-
const I = yield (yield
|
|
719
|
+
const I = yield (yield j(this, Ge).call(this, `${h}/${g}`, { headers: this.headers })).json();
|
|
720
720
|
if (I.status === "success") {
|
|
721
721
|
clearTimeout(_);
|
|
722
|
-
const
|
|
723
|
-
b(
|
|
722
|
+
const K = I.response_json;
|
|
723
|
+
b(K);
|
|
724
724
|
} else if (I.status === "failed")
|
|
725
725
|
clearTimeout(_), m(new bi(I.response_json));
|
|
726
726
|
else {
|
|
727
727
|
a && a(I.response_json);
|
|
728
|
-
const
|
|
729
|
-
setTimeout(() => l(
|
|
728
|
+
const K = o(A);
|
|
729
|
+
setTimeout(() => l(A + 1), K);
|
|
730
730
|
}
|
|
731
731
|
} catch (I) {
|
|
732
732
|
m(I);
|
|
@@ -735,20 +735,20 @@ Ge = /* @__PURE__ */ new WeakMap(), ne = /* @__PURE__ */ new WeakMap(), ge = /*
|
|
|
735
735
|
l();
|
|
736
736
|
}));
|
|
737
737
|
});
|
|
738
|
-
},
|
|
738
|
+
}, xt = function(t, e, n, s, r) {
|
|
739
739
|
return B(this, null, function* () {
|
|
740
740
|
const { overrideBaseAddress: a, overrideDefaultHeaders: i } = s, o = a != null ? a : this.baseAddress;
|
|
741
741
|
let c = i != null ? i : this.headers;
|
|
742
|
-
r.extraHeaders && (c =
|
|
742
|
+
r.extraHeaders && (c = ie(ie({}, c), r.extraHeaders)), r.requestValidation && (c = Ts(ie({}, c), { "X-Request-Nonce": Ar(), "X-Request-Timestamp": Xn() }));
|
|
743
743
|
let u = n;
|
|
744
|
-
return typeof FormData != "undefined" && n instanceof FormData ? delete c["Content-Type"] : (u = s.skipBodyJsonStringify ? n : JSON.stringify(n), r.compress && yi() && (c["Content-Encoding"] = "gzip", u = yield gi(u))), r.async ? yield
|
|
744
|
+
return typeof FormData != "undefined" && n instanceof FormData ? delete c["Content-Type"] : (u = s.skipBodyJsonStringify ? n : JSON.stringify(n), r.compress && yi() && (c["Content-Encoding"] = "gzip", u = yield gi(u))), r.async ? yield be(this, ve, Qn).call(this, `${o}${t}`, r.async, {
|
|
745
745
|
method: e,
|
|
746
746
|
headers: c,
|
|
747
747
|
body: u
|
|
748
|
-
}) : yield
|
|
748
|
+
}) : yield be(this, ve, Yn).call(this, `${o}${t}`, r, { method: e, headers: c, body: u });
|
|
749
749
|
});
|
|
750
750
|
};
|
|
751
|
-
const sr = (t, e, n, s) => t instanceof
|
|
751
|
+
const sr = (t, e, n, s) => t instanceof Et ? t : new _i({ resource: e, api: String(n), args: s, cause: t }), In = (t, e) => new Proxy(e, {
|
|
752
752
|
get(n, s) {
|
|
753
753
|
return (...r) => {
|
|
754
754
|
var a;
|
|
@@ -770,23 +770,23 @@ const sr = (t, e, n, s) => t instanceof xt ? t : new _i({ resource: e, api: Stri
|
|
|
770
770
|
}
|
|
771
771
|
});
|
|
772
772
|
var St;
|
|
773
|
-
class
|
|
773
|
+
class xi {
|
|
774
774
|
constructor(e) {
|
|
775
|
-
|
|
775
|
+
le(this, St), this.resourceName = "Files", X(this, St, e);
|
|
776
776
|
}
|
|
777
777
|
get(e) {
|
|
778
778
|
return B(this, arguments, function* ({ fileKey: n, params: s = {} }) {
|
|
779
|
-
const r = new URLSearchParams(
|
|
779
|
+
const r = new URLSearchParams(ie({
|
|
780
780
|
plugin_data: "857346721138427857"
|
|
781
781
|
}, s)).toString(), a = `v1/files/${n}?${r}`;
|
|
782
|
-
return yield
|
|
782
|
+
return yield j(this, St).get(a);
|
|
783
783
|
});
|
|
784
784
|
}
|
|
785
785
|
getImageFills(e) {
|
|
786
786
|
return B(this, arguments, function* ({ fileKey: n }) {
|
|
787
787
|
var s, r;
|
|
788
788
|
const a = `v1/files/${n}/images`;
|
|
789
|
-
return (r = (s = (yield
|
|
789
|
+
return (r = (s = (yield j(this, St).get(a)).meta) == null ? void 0 : s.images) != null ? r : {};
|
|
790
790
|
});
|
|
791
791
|
}
|
|
792
792
|
}
|
|
@@ -795,10 +795,10 @@ const Si = (t, e, n) => {
|
|
|
795
795
|
const s = e.sort();
|
|
796
796
|
return `${t}-${s.join("-")}-${n}`;
|
|
797
797
|
}, Oi = (t) => t ? t.ts > Date.now() - 1e3 * 30 : !1;
|
|
798
|
-
var
|
|
798
|
+
var _e, es, Nr;
|
|
799
799
|
class Ti {
|
|
800
800
|
constructor(e) {
|
|
801
|
-
|
|
801
|
+
le(this, es), le(this, _e), this.resourceName = "Images", X(this, _e, e);
|
|
802
802
|
}
|
|
803
803
|
/**
|
|
804
804
|
* Return the URL for the _layer_ images for the given nodes.
|
|
@@ -806,84 +806,84 @@ class Ti {
|
|
|
806
806
|
*/
|
|
807
807
|
get(e) {
|
|
808
808
|
return B(this, arguments, function* ({ fileKey: n, nodeIds: s, format: r = "jpg", scale: a }) {
|
|
809
|
-
const i = Si(n, s, r), o =
|
|
809
|
+
const i = Si(n, s, r), o = j(this, _e).cache.images.entries.get(i);
|
|
810
810
|
if (Oi(o))
|
|
811
811
|
return o.result;
|
|
812
|
-
o &&
|
|
813
|
-
const c =
|
|
812
|
+
o && j(this, _e).cache.images.entries.delete(i);
|
|
813
|
+
const c = j(this, _e).cache.images.pendingRequests.get(i);
|
|
814
814
|
if (c)
|
|
815
815
|
return c;
|
|
816
|
-
const u =
|
|
817
|
-
|
|
816
|
+
const u = be(this, es, Nr).call(this, i, n, s, r, a);
|
|
817
|
+
j(this, _e).cache.images.pendingRequests.set(i, u);
|
|
818
818
|
try {
|
|
819
819
|
return yield u;
|
|
820
820
|
} finally {
|
|
821
|
-
|
|
821
|
+
j(this, _e).cache.images.pendingRequests.delete(i);
|
|
822
822
|
}
|
|
823
823
|
});
|
|
824
824
|
}
|
|
825
825
|
}
|
|
826
|
-
|
|
826
|
+
_e = /* @__PURE__ */ new WeakMap(), es = /* @__PURE__ */ new WeakSet(), Nr = function(t, e, n, s, r) {
|
|
827
827
|
return B(this, null, function* () {
|
|
828
|
-
const a = yield
|
|
828
|
+
const a = yield j(this, _e).get(
|
|
829
829
|
`v1/images/${e}?ids=${n}&format=${s}${r ? `&scale=${r}` : ""}`
|
|
830
830
|
);
|
|
831
|
-
return
|
|
831
|
+
return j(this, _e).cache.images.entries.set(t, {
|
|
832
832
|
result: a,
|
|
833
833
|
ts: Date.now()
|
|
834
834
|
}), a;
|
|
835
835
|
});
|
|
836
836
|
};
|
|
837
837
|
var cn;
|
|
838
|
-
class
|
|
838
|
+
class Ci {
|
|
839
839
|
constructor(e) {
|
|
840
|
-
|
|
840
|
+
le(this, cn), this.resourceName = "Nodes", X(this, cn, e);
|
|
841
841
|
}
|
|
842
842
|
get(e) {
|
|
843
843
|
return B(this, arguments, function* ({ fileKey: n, nodeIds: s, params: r = {} }) {
|
|
844
|
-
const a = Ts(
|
|
844
|
+
const a = Ts(ie({}, r), {
|
|
845
845
|
ids: s.join(",")
|
|
846
|
-
}), i = new URLSearchParams(
|
|
846
|
+
}), i = new URLSearchParams(ie({
|
|
847
847
|
plugin_data: "857346721138427857"
|
|
848
848
|
}, a)).toString(), o = `v1/files/${n}/nodes?${i}`;
|
|
849
|
-
return yield
|
|
849
|
+
return yield j(this, cn).get(o);
|
|
850
850
|
});
|
|
851
851
|
}
|
|
852
852
|
}
|
|
853
853
|
cn = /* @__PURE__ */ new WeakMap();
|
|
854
854
|
var je;
|
|
855
|
-
class
|
|
855
|
+
class Ai extends Ei {
|
|
856
856
|
constructor({
|
|
857
857
|
baseAddress: e = "https://api.figma.com/",
|
|
858
858
|
fetch: n = globalThis.fetch.bind(globalThis)
|
|
859
859
|
} = {}) {
|
|
860
|
-
super({ fetch: n, baseAddress: e }),
|
|
860
|
+
super({ fetch: n, baseAddress: e }), le(this, je, ""), this.cache = {
|
|
861
861
|
images: {
|
|
862
862
|
entries: /* @__PURE__ */ new Map(),
|
|
863
863
|
pendingRequests: /* @__PURE__ */ new Map()
|
|
864
864
|
}
|
|
865
|
-
}, this.files = In(this, new
|
|
865
|
+
}, this.files = In(this, new xi(this)), this.nodes = In(this, new Ci(this)), this.images = In(this, new Ti(this));
|
|
866
866
|
}
|
|
867
867
|
set token(e) {
|
|
868
868
|
if (!e.startsWith("figd_") && !e.startsWith("figu_"))
|
|
869
869
|
throw new Error("Invalid Figma access token");
|
|
870
|
-
|
|
870
|
+
X(this, je, e);
|
|
871
871
|
}
|
|
872
872
|
get token() {
|
|
873
|
-
return
|
|
873
|
+
return j(this, je);
|
|
874
874
|
}
|
|
875
875
|
get headers() {
|
|
876
876
|
const e = {
|
|
877
877
|
"Content-Type": "application/json"
|
|
878
878
|
};
|
|
879
|
-
return
|
|
879
|
+
return j(this, je).startsWith("figd_") ? e["X-FIGMA-TOKEN"] = j(this, je) : j(this, je).startsWith("figu_") && (e.Authorization = `Bearer ${j(this, je)}`), e;
|
|
880
880
|
}
|
|
881
881
|
}
|
|
882
882
|
je = /* @__PURE__ */ new WeakMap();
|
|
883
|
-
const Ni = (t) =>
|
|
883
|
+
const Ni = (t) => Ee(void 0, [t], function* ({
|
|
884
884
|
fileKey: e,
|
|
885
885
|
authToken: n,
|
|
886
|
-
figmaRestApi: s = new
|
|
886
|
+
figmaRestApi: s = new Ai(),
|
|
887
887
|
params: r = {},
|
|
888
888
|
signal: a
|
|
889
889
|
}) {
|
|
@@ -999,7 +999,7 @@ const v = N.arrayToEnum([
|
|
|
999
999
|
"not_multiple_of",
|
|
1000
1000
|
"not_finite"
|
|
1001
1001
|
]), Ri = (t) => JSON.stringify(t, null, 2).replace(/"([^"]+)":/g, "$1:");
|
|
1002
|
-
class
|
|
1002
|
+
class oe extends Error {
|
|
1003
1003
|
get errors() {
|
|
1004
1004
|
return this.issues;
|
|
1005
1005
|
}
|
|
@@ -1036,7 +1036,7 @@ class ie extends Error {
|
|
|
1036
1036
|
return r(this), s;
|
|
1037
1037
|
}
|
|
1038
1038
|
static assert(e) {
|
|
1039
|
-
if (!(e instanceof
|
|
1039
|
+
if (!(e instanceof oe))
|
|
1040
1040
|
throw new Error(`Not a ZodError: ${e}`);
|
|
1041
1041
|
}
|
|
1042
1042
|
toString() {
|
|
@@ -1058,7 +1058,7 @@ class ie extends Error {
|
|
|
1058
1058
|
return this.flatten();
|
|
1059
1059
|
}
|
|
1060
1060
|
}
|
|
1061
|
-
|
|
1061
|
+
oe.create = (t) => new oe(t);
|
|
1062
1062
|
const yt = (t, e) => {
|
|
1063
1063
|
let n;
|
|
1064
1064
|
switch (t.code) {
|
|
@@ -1123,11 +1123,11 @@ function ln() {
|
|
|
1123
1123
|
return Rr;
|
|
1124
1124
|
}
|
|
1125
1125
|
const fn = (t) => {
|
|
1126
|
-
const { data: e, path: n, errorMaps: s, issueData: r } = t, a = [...n, ...r.path || []], i =
|
|
1126
|
+
const { data: e, path: n, errorMaps: s, issueData: r } = t, a = [...n, ...r.path || []], i = x(d({}, r), {
|
|
1127
1127
|
path: a
|
|
1128
1128
|
});
|
|
1129
1129
|
if (r.message !== void 0)
|
|
1130
|
-
return
|
|
1130
|
+
return x(d({}, r), {
|
|
1131
1131
|
path: a,
|
|
1132
1132
|
message: r.message
|
|
1133
1133
|
});
|
|
@@ -1135,7 +1135,7 @@ const fn = (t) => {
|
|
|
1135
1135
|
const c = s.filter((u) => !!u).slice().reverse();
|
|
1136
1136
|
for (const u of c)
|
|
1137
1137
|
o = u(i, { data: e, defaultError: o }).message;
|
|
1138
|
-
return
|
|
1138
|
+
return x(d({}, r), {
|
|
1139
1139
|
path: a,
|
|
1140
1140
|
message: o
|
|
1141
1141
|
});
|
|
@@ -1158,7 +1158,7 @@ function y(t, e) {
|
|
|
1158
1158
|
});
|
|
1159
1159
|
t.common.issues.push(s);
|
|
1160
1160
|
}
|
|
1161
|
-
class
|
|
1161
|
+
class Y {
|
|
1162
1162
|
constructor() {
|
|
1163
1163
|
this.value = "valid";
|
|
1164
1164
|
}
|
|
@@ -1178,7 +1178,7 @@ class X {
|
|
|
1178
1178
|
return { status: e.value, value: s };
|
|
1179
1179
|
}
|
|
1180
1180
|
static mergeObjectAsync(e, n) {
|
|
1181
|
-
return
|
|
1181
|
+
return Ee(this, null, function* () {
|
|
1182
1182
|
const s = [];
|
|
1183
1183
|
for (const r of n) {
|
|
1184
1184
|
const a = yield r.key, i = yield r.value;
|
|
@@ -1187,7 +1187,7 @@ class X {
|
|
|
1187
1187
|
value: i
|
|
1188
1188
|
});
|
|
1189
1189
|
}
|
|
1190
|
-
return
|
|
1190
|
+
return Y.mergeObjectSync(e, s);
|
|
1191
1191
|
});
|
|
1192
1192
|
}
|
|
1193
1193
|
static mergeObjectSync(e, n) {
|
|
@@ -1203,7 +1203,7 @@ class X {
|
|
|
1203
1203
|
}
|
|
1204
1204
|
const S = Object.freeze({
|
|
1205
1205
|
status: "aborted"
|
|
1206
|
-
}), hn = (t) => ({ status: "dirty", value: t }),
|
|
1206
|
+
}), hn = (t) => ({ status: "dirty", value: t }), ne = (t) => ({ status: "valid", value: t }), ns = (t) => t.status === "aborted", ss = (t) => t.status === "dirty", Ye = (t) => t.status === "valid", Pt = (t) => typeof Promise != "undefined" && t instanceof Promise;
|
|
1207
1207
|
function pn(t, e, n, s) {
|
|
1208
1208
|
if (typeof e == "function" ? t !== e || !0 : !e.has(t)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
1209
1209
|
return e.get(t);
|
|
@@ -1235,7 +1235,7 @@ const rr = (t, e) => {
|
|
|
1235
1235
|
get error() {
|
|
1236
1236
|
if (this._error)
|
|
1237
1237
|
return this._error;
|
|
1238
|
-
const n = new
|
|
1238
|
+
const n = new oe(t.common.issues);
|
|
1239
1239
|
return this._error = n, this._error;
|
|
1240
1240
|
}
|
|
1241
1241
|
};
|
|
@@ -1271,7 +1271,7 @@ class T {
|
|
|
1271
1271
|
}
|
|
1272
1272
|
_processInputParams(e) {
|
|
1273
1273
|
return {
|
|
1274
|
-
status: new
|
|
1274
|
+
status: new Y(),
|
|
1275
1275
|
ctx: {
|
|
1276
1276
|
common: e.parent.common,
|
|
1277
1277
|
data: e.data,
|
|
@@ -1348,7 +1348,7 @@ class T {
|
|
|
1348
1348
|
});
|
|
1349
1349
|
}
|
|
1350
1350
|
parseAsync(e, n) {
|
|
1351
|
-
return
|
|
1351
|
+
return Ee(this, null, function* () {
|
|
1352
1352
|
const s = yield this.safeParseAsync(e, n);
|
|
1353
1353
|
if (s.success)
|
|
1354
1354
|
return s.data;
|
|
@@ -1356,7 +1356,7 @@ class T {
|
|
|
1356
1356
|
});
|
|
1357
1357
|
}
|
|
1358
1358
|
safeParseAsync(e, n) {
|
|
1359
|
-
return
|
|
1359
|
+
return Ee(this, null, function* () {
|
|
1360
1360
|
const s = {
|
|
1361
1361
|
common: {
|
|
1362
1362
|
issues: [],
|
|
@@ -1385,9 +1385,9 @@ class T {
|
|
|
1385
1385
|
return this._refinement((s, r) => e(s) ? !0 : (r.addIssue(typeof n == "function" ? n(s, r) : n), !1));
|
|
1386
1386
|
}
|
|
1387
1387
|
_refinement(e) {
|
|
1388
|
-
return new
|
|
1388
|
+
return new ge({
|
|
1389
1389
|
schema: this,
|
|
1390
|
-
typeName:
|
|
1390
|
+
typeName: E.ZodEffects,
|
|
1391
1391
|
effect: { type: "refinement", refinement: e }
|
|
1392
1392
|
});
|
|
1393
1393
|
}
|
|
@@ -1402,7 +1402,7 @@ class T {
|
|
|
1402
1402
|
};
|
|
1403
1403
|
}
|
|
1404
1404
|
optional() {
|
|
1405
|
-
return
|
|
1405
|
+
return ke.create(this, this._def);
|
|
1406
1406
|
}
|
|
1407
1407
|
nullable() {
|
|
1408
1408
|
return We.create(this, this._def);
|
|
@@ -1411,7 +1411,7 @@ class T {
|
|
|
1411
1411
|
return this.nullable().optional();
|
|
1412
1412
|
}
|
|
1413
1413
|
array() {
|
|
1414
|
-
return
|
|
1414
|
+
return ye.create(this);
|
|
1415
1415
|
}
|
|
1416
1416
|
promise() {
|
|
1417
1417
|
return vt.create(this, this._def);
|
|
@@ -1423,37 +1423,37 @@ class T {
|
|
|
1423
1423
|
return Mt.create(this, e, this._def);
|
|
1424
1424
|
}
|
|
1425
1425
|
transform(e) {
|
|
1426
|
-
return new
|
|
1426
|
+
return new ge(x(d({}, O(this._def)), {
|
|
1427
1427
|
schema: this,
|
|
1428
|
-
typeName:
|
|
1428
|
+
typeName: E.ZodEffects,
|
|
1429
1429
|
effect: { type: "transform", transform: e }
|
|
1430
1430
|
}));
|
|
1431
1431
|
}
|
|
1432
1432
|
default(e) {
|
|
1433
1433
|
const n = typeof e == "function" ? e : () => e;
|
|
1434
|
-
return new Ut(
|
|
1434
|
+
return new Ut(x(d({}, O(this._def)), {
|
|
1435
1435
|
innerType: this,
|
|
1436
1436
|
defaultValue: n,
|
|
1437
|
-
typeName:
|
|
1437
|
+
typeName: E.ZodDefault
|
|
1438
1438
|
}));
|
|
1439
1439
|
}
|
|
1440
1440
|
brand() {
|
|
1441
1441
|
return new Ns(d({
|
|
1442
|
-
typeName:
|
|
1442
|
+
typeName: E.ZodBranded,
|
|
1443
1443
|
type: this
|
|
1444
1444
|
}, O(this._def)));
|
|
1445
1445
|
}
|
|
1446
1446
|
catch(e) {
|
|
1447
1447
|
const n = typeof e == "function" ? e : () => e;
|
|
1448
|
-
return new Vt(
|
|
1448
|
+
return new Vt(x(d({}, O(this._def)), {
|
|
1449
1449
|
innerType: this,
|
|
1450
1450
|
catchValue: n,
|
|
1451
|
-
typeName:
|
|
1451
|
+
typeName: E.ZodCatch
|
|
1452
1452
|
}));
|
|
1453
1453
|
}
|
|
1454
1454
|
describe(e) {
|
|
1455
1455
|
const n = this.constructor;
|
|
1456
|
-
return new n(
|
|
1456
|
+
return new n(x(d({}, this._def), {
|
|
1457
1457
|
description: e
|
|
1458
1458
|
}));
|
|
1459
1459
|
}
|
|
@@ -1501,7 +1501,7 @@ function Yi(t, e) {
|
|
|
1501
1501
|
function Qi(t, e) {
|
|
1502
1502
|
return !!((e === "v4" || !e) && zi.test(t) || (e === "v6" || !e) && Bi.test(t));
|
|
1503
1503
|
}
|
|
1504
|
-
class
|
|
1504
|
+
class me extends T {
|
|
1505
1505
|
_parse(e) {
|
|
1506
1506
|
if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== v.string) {
|
|
1507
1507
|
const r = this._getOrReturnCtx(e);
|
|
@@ -1511,7 +1511,7 @@ class pe extends T {
|
|
|
1511
1511
|
received: r.parsedType
|
|
1512
1512
|
}), S;
|
|
1513
1513
|
}
|
|
1514
|
-
const n = new
|
|
1514
|
+
const n = new Y();
|
|
1515
1515
|
let s;
|
|
1516
1516
|
for (const r of this._def.checks)
|
|
1517
1517
|
if (r.kind === "min")
|
|
@@ -1663,7 +1663,7 @@ class pe extends T {
|
|
|
1663
1663
|
}, w.errToObj(s)));
|
|
1664
1664
|
}
|
|
1665
1665
|
_addCheck(e) {
|
|
1666
|
-
return new
|
|
1666
|
+
return new me(x(d({}, this._def), {
|
|
1667
1667
|
checks: [...this._def.checks, e]
|
|
1668
1668
|
}));
|
|
1669
1669
|
}
|
|
@@ -1789,17 +1789,17 @@ class pe extends T {
|
|
|
1789
1789
|
return this.min(1, w.errToObj(e));
|
|
1790
1790
|
}
|
|
1791
1791
|
trim() {
|
|
1792
|
-
return new
|
|
1792
|
+
return new me(x(d({}, this._def), {
|
|
1793
1793
|
checks: [...this._def.checks, { kind: "trim" }]
|
|
1794
1794
|
}));
|
|
1795
1795
|
}
|
|
1796
1796
|
toLowerCase() {
|
|
1797
|
-
return new
|
|
1797
|
+
return new me(x(d({}, this._def), {
|
|
1798
1798
|
checks: [...this._def.checks, { kind: "toLowerCase" }]
|
|
1799
1799
|
}));
|
|
1800
1800
|
}
|
|
1801
1801
|
toUpperCase() {
|
|
1802
|
-
return new
|
|
1802
|
+
return new me(x(d({}, this._def), {
|
|
1803
1803
|
checks: [...this._def.checks, { kind: "toUpperCase" }]
|
|
1804
1804
|
}));
|
|
1805
1805
|
}
|
|
@@ -1864,11 +1864,11 @@ class pe extends T {
|
|
|
1864
1864
|
return e;
|
|
1865
1865
|
}
|
|
1866
1866
|
}
|
|
1867
|
-
|
|
1867
|
+
me.create = (t) => {
|
|
1868
1868
|
var e;
|
|
1869
|
-
return new
|
|
1869
|
+
return new me(d({
|
|
1870
1870
|
checks: [],
|
|
1871
|
-
typeName:
|
|
1871
|
+
typeName: E.ZodString,
|
|
1872
1872
|
coerce: (e = t == null ? void 0 : t.coerce) !== null && e !== void 0 ? e : !1
|
|
1873
1873
|
}, O(t)));
|
|
1874
1874
|
};
|
|
@@ -1890,7 +1890,7 @@ class Le extends T {
|
|
|
1890
1890
|
}), S;
|
|
1891
1891
|
}
|
|
1892
1892
|
let n;
|
|
1893
|
-
const s = new
|
|
1893
|
+
const s = new Y();
|
|
1894
1894
|
for (const r of this._def.checks)
|
|
1895
1895
|
r.kind === "int" ? N.isInteger(e.data) || (n = this._getOrReturnCtx(e, n), y(n, {
|
|
1896
1896
|
code: f.invalid_type,
|
|
@@ -1934,7 +1934,7 @@ class Le extends T {
|
|
|
1934
1934
|
return this.setLimit("max", e, !1, w.toString(n));
|
|
1935
1935
|
}
|
|
1936
1936
|
setLimit(e, n, s, r) {
|
|
1937
|
-
return new Le(
|
|
1937
|
+
return new Le(x(d({}, this._def), {
|
|
1938
1938
|
checks: [
|
|
1939
1939
|
...this._def.checks,
|
|
1940
1940
|
{
|
|
@@ -1947,7 +1947,7 @@ class Le extends T {
|
|
|
1947
1947
|
}));
|
|
1948
1948
|
}
|
|
1949
1949
|
_addCheck(e) {
|
|
1950
|
-
return new Le(
|
|
1950
|
+
return new Le(x(d({}, this._def), {
|
|
1951
1951
|
checks: [...this._def.checks, e]
|
|
1952
1952
|
}));
|
|
1953
1953
|
}
|
|
@@ -2042,7 +2042,7 @@ class Le extends T {
|
|
|
2042
2042
|
}
|
|
2043
2043
|
Le.create = (t) => new Le(d({
|
|
2044
2044
|
checks: [],
|
|
2045
|
-
typeName:
|
|
2045
|
+
typeName: E.ZodNumber,
|
|
2046
2046
|
coerce: (t == null ? void 0 : t.coerce) || !1
|
|
2047
2047
|
}, O(t)));
|
|
2048
2048
|
class $e extends T {
|
|
@@ -2059,7 +2059,7 @@ class $e extends T {
|
|
|
2059
2059
|
if (this._getType(e) !== v.bigint)
|
|
2060
2060
|
return this._getInvalidInput(e);
|
|
2061
2061
|
let n;
|
|
2062
|
-
const s = new
|
|
2062
|
+
const s = new Y();
|
|
2063
2063
|
for (const r of this._def.checks)
|
|
2064
2064
|
r.kind === "min" ? (r.inclusive ? e.data < r.value : e.data <= r.value) && (n = this._getOrReturnCtx(e, n), y(n, {
|
|
2065
2065
|
code: f.too_small,
|
|
@@ -2101,7 +2101,7 @@ class $e extends T {
|
|
|
2101
2101
|
return this.setLimit("max", e, !1, w.toString(n));
|
|
2102
2102
|
}
|
|
2103
2103
|
setLimit(e, n, s, r) {
|
|
2104
|
-
return new $e(
|
|
2104
|
+
return new $e(x(d({}, this._def), {
|
|
2105
2105
|
checks: [
|
|
2106
2106
|
...this._def.checks,
|
|
2107
2107
|
{
|
|
@@ -2114,7 +2114,7 @@ class $e extends T {
|
|
|
2114
2114
|
}));
|
|
2115
2115
|
}
|
|
2116
2116
|
_addCheck(e) {
|
|
2117
|
-
return new $e(
|
|
2117
|
+
return new $e(x(d({}, this._def), {
|
|
2118
2118
|
checks: [...this._def.checks, e]
|
|
2119
2119
|
}));
|
|
2120
2120
|
}
|
|
@@ -2174,7 +2174,7 @@ $e.create = (t) => {
|
|
|
2174
2174
|
var e;
|
|
2175
2175
|
return new $e(d({
|
|
2176
2176
|
checks: [],
|
|
2177
|
-
typeName:
|
|
2177
|
+
typeName: E.ZodBigInt,
|
|
2178
2178
|
coerce: (e = t == null ? void 0 : t.coerce) !== null && e !== void 0 ? e : !1
|
|
2179
2179
|
}, O(t)));
|
|
2180
2180
|
};
|
|
@@ -2188,11 +2188,11 @@ class It extends T {
|
|
|
2188
2188
|
received: n.parsedType
|
|
2189
2189
|
}), S;
|
|
2190
2190
|
}
|
|
2191
|
-
return
|
|
2191
|
+
return ne(e.data);
|
|
2192
2192
|
}
|
|
2193
2193
|
}
|
|
2194
2194
|
It.create = (t) => new It(d({
|
|
2195
|
-
typeName:
|
|
2195
|
+
typeName: E.ZodBoolean,
|
|
2196
2196
|
coerce: (t == null ? void 0 : t.coerce) || !1
|
|
2197
2197
|
}, O(t)));
|
|
2198
2198
|
class Qe extends T {
|
|
@@ -2211,7 +2211,7 @@ class Qe extends T {
|
|
|
2211
2211
|
code: f.invalid_date
|
|
2212
2212
|
}), S;
|
|
2213
2213
|
}
|
|
2214
|
-
const n = new
|
|
2214
|
+
const n = new Y();
|
|
2215
2215
|
let s;
|
|
2216
2216
|
for (const r of this._def.checks)
|
|
2217
2217
|
r.kind === "min" ? e.data.getTime() < r.value && (s = this._getOrReturnCtx(e, s), y(s, {
|
|
@@ -2235,7 +2235,7 @@ class Qe extends T {
|
|
|
2235
2235
|
};
|
|
2236
2236
|
}
|
|
2237
2237
|
_addCheck(e) {
|
|
2238
|
-
return new Qe(
|
|
2238
|
+
return new Qe(x(d({}, this._def), {
|
|
2239
2239
|
checks: [...this._def.checks, e]
|
|
2240
2240
|
}));
|
|
2241
2241
|
}
|
|
@@ -2269,7 +2269,7 @@ class Qe extends T {
|
|
|
2269
2269
|
Qe.create = (t) => new Qe(d({
|
|
2270
2270
|
checks: [],
|
|
2271
2271
|
coerce: (t == null ? void 0 : t.coerce) || !1,
|
|
2272
|
-
typeName:
|
|
2272
|
+
typeName: E.ZodDate
|
|
2273
2273
|
}, O(t)));
|
|
2274
2274
|
class mn extends T {
|
|
2275
2275
|
_parse(e) {
|
|
@@ -2281,11 +2281,11 @@ class mn extends T {
|
|
|
2281
2281
|
received: n.parsedType
|
|
2282
2282
|
}), S;
|
|
2283
2283
|
}
|
|
2284
|
-
return
|
|
2284
|
+
return ne(e.data);
|
|
2285
2285
|
}
|
|
2286
2286
|
}
|
|
2287
2287
|
mn.create = (t) => new mn(d({
|
|
2288
|
-
typeName:
|
|
2288
|
+
typeName: E.ZodSymbol
|
|
2289
2289
|
}, O(t)));
|
|
2290
2290
|
class jt extends T {
|
|
2291
2291
|
_parse(e) {
|
|
@@ -2297,11 +2297,11 @@ class jt extends T {
|
|
|
2297
2297
|
received: n.parsedType
|
|
2298
2298
|
}), S;
|
|
2299
2299
|
}
|
|
2300
|
-
return
|
|
2300
|
+
return ne(e.data);
|
|
2301
2301
|
}
|
|
2302
2302
|
}
|
|
2303
2303
|
jt.create = (t) => new jt(d({
|
|
2304
|
-
typeName:
|
|
2304
|
+
typeName: E.ZodUndefined
|
|
2305
2305
|
}, O(t)));
|
|
2306
2306
|
class Zt extends T {
|
|
2307
2307
|
_parse(e) {
|
|
@@ -2313,33 +2313,33 @@ class Zt extends T {
|
|
|
2313
2313
|
received: n.parsedType
|
|
2314
2314
|
}), S;
|
|
2315
2315
|
}
|
|
2316
|
-
return
|
|
2316
|
+
return ne(e.data);
|
|
2317
2317
|
}
|
|
2318
2318
|
}
|
|
2319
2319
|
Zt.create = (t) => new Zt(d({
|
|
2320
|
-
typeName:
|
|
2320
|
+
typeName: E.ZodNull
|
|
2321
2321
|
}, O(t)));
|
|
2322
2322
|
class gt extends T {
|
|
2323
2323
|
constructor() {
|
|
2324
2324
|
super(...arguments), this._any = !0;
|
|
2325
2325
|
}
|
|
2326
2326
|
_parse(e) {
|
|
2327
|
-
return
|
|
2327
|
+
return ne(e.data);
|
|
2328
2328
|
}
|
|
2329
2329
|
}
|
|
2330
2330
|
gt.create = (t) => new gt(d({
|
|
2331
|
-
typeName:
|
|
2331
|
+
typeName: E.ZodAny
|
|
2332
2332
|
}, O(t)));
|
|
2333
2333
|
class Xe extends T {
|
|
2334
2334
|
constructor() {
|
|
2335
2335
|
super(...arguments), this._unknown = !0;
|
|
2336
2336
|
}
|
|
2337
2337
|
_parse(e) {
|
|
2338
|
-
return
|
|
2338
|
+
return ne(e.data);
|
|
2339
2339
|
}
|
|
2340
2340
|
}
|
|
2341
2341
|
Xe.create = (t) => new Xe(d({
|
|
2342
|
-
typeName:
|
|
2342
|
+
typeName: E.ZodUnknown
|
|
2343
2343
|
}, O(t)));
|
|
2344
2344
|
class Pe extends T {
|
|
2345
2345
|
_parse(e) {
|
|
@@ -2352,7 +2352,7 @@ class Pe extends T {
|
|
|
2352
2352
|
}
|
|
2353
2353
|
}
|
|
2354
2354
|
Pe.create = (t) => new Pe(d({
|
|
2355
|
-
typeName:
|
|
2355
|
+
typeName: E.ZodNever
|
|
2356
2356
|
}, O(t)));
|
|
2357
2357
|
class yn extends T {
|
|
2358
2358
|
_parse(e) {
|
|
@@ -2364,13 +2364,13 @@ class yn extends T {
|
|
|
2364
2364
|
received: n.parsedType
|
|
2365
2365
|
}), S;
|
|
2366
2366
|
}
|
|
2367
|
-
return
|
|
2367
|
+
return ne(e.data);
|
|
2368
2368
|
}
|
|
2369
2369
|
}
|
|
2370
2370
|
yn.create = (t) => new yn(d({
|
|
2371
|
-
typeName:
|
|
2371
|
+
typeName: E.ZodVoid
|
|
2372
2372
|
}, O(t)));
|
|
2373
|
-
class
|
|
2373
|
+
class ye extends T {
|
|
2374
2374
|
_parse(e) {
|
|
2375
2375
|
const { ctx: n, status: s } = this._processInputParams(e), r = this._def;
|
|
2376
2376
|
if (n.parsedType !== v.array)
|
|
@@ -2406,25 +2406,25 @@ class me extends T {
|
|
|
2406
2406
|
exact: !1,
|
|
2407
2407
|
message: r.maxLength.message
|
|
2408
2408
|
}), s.dirty()), n.common.async)
|
|
2409
|
-
return Promise.all([...n.data].map((i, o) => r.type._parseAsync(new xe(n, i, n.path, o)))).then((i) =>
|
|
2409
|
+
return Promise.all([...n.data].map((i, o) => r.type._parseAsync(new xe(n, i, n.path, o)))).then((i) => Y.mergeArray(s, i));
|
|
2410
2410
|
const a = [...n.data].map((i, o) => r.type._parseSync(new xe(n, i, n.path, o)));
|
|
2411
|
-
return
|
|
2411
|
+
return Y.mergeArray(s, a);
|
|
2412
2412
|
}
|
|
2413
2413
|
get element() {
|
|
2414
2414
|
return this._def.type;
|
|
2415
2415
|
}
|
|
2416
2416
|
min(e, n) {
|
|
2417
|
-
return new
|
|
2417
|
+
return new ye(x(d({}, this._def), {
|
|
2418
2418
|
minLength: { value: e, message: w.toString(n) }
|
|
2419
2419
|
}));
|
|
2420
2420
|
}
|
|
2421
2421
|
max(e, n) {
|
|
2422
|
-
return new
|
|
2422
|
+
return new ye(x(d({}, this._def), {
|
|
2423
2423
|
maxLength: { value: e, message: w.toString(n) }
|
|
2424
2424
|
}));
|
|
2425
2425
|
}
|
|
2426
2426
|
length(e, n) {
|
|
2427
|
-
return new
|
|
2427
|
+
return new ye(x(d({}, this._def), {
|
|
2428
2428
|
exactLength: { value: e, message: w.toString(n) }
|
|
2429
2429
|
}));
|
|
2430
2430
|
}
|
|
@@ -2432,26 +2432,26 @@ class me extends T {
|
|
|
2432
2432
|
return this.min(1, e);
|
|
2433
2433
|
}
|
|
2434
2434
|
}
|
|
2435
|
-
|
|
2435
|
+
ye.create = (t, e) => new ye(d({
|
|
2436
2436
|
type: t,
|
|
2437
2437
|
minLength: null,
|
|
2438
2438
|
maxLength: null,
|
|
2439
2439
|
exactLength: null,
|
|
2440
|
-
typeName:
|
|
2440
|
+
typeName: E.ZodArray
|
|
2441
2441
|
}, O(e)));
|
|
2442
2442
|
function ct(t) {
|
|
2443
2443
|
if (t instanceof U) {
|
|
2444
2444
|
const e = {};
|
|
2445
2445
|
for (const n in t.shape) {
|
|
2446
2446
|
const s = t.shape[n];
|
|
2447
|
-
e[n] =
|
|
2447
|
+
e[n] = ke.create(ct(s));
|
|
2448
2448
|
}
|
|
2449
|
-
return new U(
|
|
2449
|
+
return new U(x(d({}, t._def), {
|
|
2450
2450
|
shape: () => e
|
|
2451
2451
|
}));
|
|
2452
|
-
} else return t instanceof
|
|
2452
|
+
} else return t instanceof ye ? new ye(x(d({}, t._def), {
|
|
2453
2453
|
type: ct(t.element)
|
|
2454
|
-
})) : t instanceof
|
|
2454
|
+
})) : t instanceof ke ? ke.create(ct(t.unwrap())) : t instanceof We ? We.create(ct(t.unwrap())) : t instanceof Se ? Se.create(t.items.map((e) => ct(e))) : t;
|
|
2455
2455
|
}
|
|
2456
2456
|
class U extends T {
|
|
2457
2457
|
constructor() {
|
|
@@ -2513,7 +2513,7 @@ class U extends T {
|
|
|
2513
2513
|
});
|
|
2514
2514
|
}
|
|
2515
2515
|
}
|
|
2516
|
-
return s.common.async ? Promise.resolve().then(() =>
|
|
2516
|
+
return s.common.async ? Promise.resolve().then(() => Ee(this, null, function* () {
|
|
2517
2517
|
const c = [];
|
|
2518
2518
|
for (const u of o) {
|
|
2519
2519
|
const h = yield u.key, p = yield u.value;
|
|
@@ -2524,13 +2524,13 @@ class U extends T {
|
|
|
2524
2524
|
});
|
|
2525
2525
|
}
|
|
2526
2526
|
return c;
|
|
2527
|
-
})).then((c) =>
|
|
2527
|
+
})).then((c) => Y.mergeObjectSync(n, c)) : Y.mergeObjectSync(n, o);
|
|
2528
2528
|
}
|
|
2529
2529
|
get shape() {
|
|
2530
2530
|
return this._def.shape();
|
|
2531
2531
|
}
|
|
2532
2532
|
strict(e) {
|
|
2533
|
-
return w.errToObj, new U(d(
|
|
2533
|
+
return w.errToObj, new U(d(x(d({}, this._def), {
|
|
2534
2534
|
unknownKeys: "strict"
|
|
2535
2535
|
}), e !== void 0 ? {
|
|
2536
2536
|
errorMap: (n, s) => {
|
|
@@ -2545,12 +2545,12 @@ class U extends T {
|
|
|
2545
2545
|
} : {}));
|
|
2546
2546
|
}
|
|
2547
2547
|
strip() {
|
|
2548
|
-
return new U(
|
|
2548
|
+
return new U(x(d({}, this._def), {
|
|
2549
2549
|
unknownKeys: "strip"
|
|
2550
2550
|
}));
|
|
2551
2551
|
}
|
|
2552
2552
|
passthrough() {
|
|
2553
|
-
return new U(
|
|
2553
|
+
return new U(x(d({}, this._def), {
|
|
2554
2554
|
unknownKeys: "passthrough"
|
|
2555
2555
|
}));
|
|
2556
2556
|
}
|
|
@@ -2572,7 +2572,7 @@ class U extends T {
|
|
|
2572
2572
|
// }) as any;
|
|
2573
2573
|
// };
|
|
2574
2574
|
extend(e) {
|
|
2575
|
-
return new U(
|
|
2575
|
+
return new U(x(d({}, this._def), {
|
|
2576
2576
|
shape: () => d(d({}, this._def.shape()), e)
|
|
2577
2577
|
}));
|
|
2578
2578
|
}
|
|
@@ -2586,7 +2586,7 @@ class U extends T {
|
|
|
2586
2586
|
unknownKeys: e._def.unknownKeys,
|
|
2587
2587
|
catchall: e._def.catchall,
|
|
2588
2588
|
shape: () => d(d({}, this._def.shape()), e._def.shape()),
|
|
2589
|
-
typeName:
|
|
2589
|
+
typeName: E.ZodObject
|
|
2590
2590
|
});
|
|
2591
2591
|
}
|
|
2592
2592
|
// merge<
|
|
@@ -2649,7 +2649,7 @@ class U extends T {
|
|
|
2649
2649
|
// return merged;
|
|
2650
2650
|
// }
|
|
2651
2651
|
catchall(e) {
|
|
2652
|
-
return new U(
|
|
2652
|
+
return new U(x(d({}, this._def), {
|
|
2653
2653
|
catchall: e
|
|
2654
2654
|
}));
|
|
2655
2655
|
}
|
|
@@ -2657,7 +2657,7 @@ class U extends T {
|
|
|
2657
2657
|
const n = {};
|
|
2658
2658
|
return N.objectKeys(e).forEach((s) => {
|
|
2659
2659
|
e[s] && this.shape[s] && (n[s] = this.shape[s]);
|
|
2660
|
-
}), new U(
|
|
2660
|
+
}), new U(x(d({}, this._def), {
|
|
2661
2661
|
shape: () => n
|
|
2662
2662
|
}));
|
|
2663
2663
|
}
|
|
@@ -2665,7 +2665,7 @@ class U extends T {
|
|
|
2665
2665
|
const n = {};
|
|
2666
2666
|
return N.objectKeys(this.shape).forEach((s) => {
|
|
2667
2667
|
e[s] || (n[s] = this.shape[s]);
|
|
2668
|
-
}), new U(
|
|
2668
|
+
}), new U(x(d({}, this._def), {
|
|
2669
2669
|
shape: () => n
|
|
2670
2670
|
}));
|
|
2671
2671
|
}
|
|
@@ -2680,7 +2680,7 @@ class U extends T {
|
|
|
2680
2680
|
return N.objectKeys(this.shape).forEach((s) => {
|
|
2681
2681
|
const r = this.shape[s];
|
|
2682
2682
|
e && !e[s] ? n[s] = r : n[s] = r.optional();
|
|
2683
|
-
}), new U(
|
|
2683
|
+
}), new U(x(d({}, this._def), {
|
|
2684
2684
|
shape: () => n
|
|
2685
2685
|
}));
|
|
2686
2686
|
}
|
|
@@ -2691,11 +2691,11 @@ class U extends T {
|
|
|
2691
2691
|
n[s] = this.shape[s];
|
|
2692
2692
|
else {
|
|
2693
2693
|
let r = this.shape[s];
|
|
2694
|
-
for (; r instanceof
|
|
2694
|
+
for (; r instanceof ke; )
|
|
2695
2695
|
r = r._def.innerType;
|
|
2696
2696
|
n[s] = r;
|
|
2697
2697
|
}
|
|
2698
|
-
}), new U(
|
|
2698
|
+
}), new U(x(d({}, this._def), {
|
|
2699
2699
|
shape: () => n
|
|
2700
2700
|
}));
|
|
2701
2701
|
}
|
|
@@ -2707,19 +2707,19 @@ U.create = (t, e) => new U(d({
|
|
|
2707
2707
|
shape: () => t,
|
|
2708
2708
|
unknownKeys: "strip",
|
|
2709
2709
|
catchall: Pe.create(),
|
|
2710
|
-
typeName:
|
|
2710
|
+
typeName: E.ZodObject
|
|
2711
2711
|
}, O(e)));
|
|
2712
2712
|
U.strictCreate = (t, e) => new U(d({
|
|
2713
2713
|
shape: () => t,
|
|
2714
2714
|
unknownKeys: "strict",
|
|
2715
2715
|
catchall: Pe.create(),
|
|
2716
|
-
typeName:
|
|
2716
|
+
typeName: E.ZodObject
|
|
2717
2717
|
}, O(e)));
|
|
2718
2718
|
U.lazycreate = (t, e) => new U(d({
|
|
2719
2719
|
shape: t,
|
|
2720
2720
|
unknownKeys: "strip",
|
|
2721
2721
|
catchall: Pe.create(),
|
|
2722
|
-
typeName:
|
|
2722
|
+
typeName: E.ZodObject
|
|
2723
2723
|
}, O(e)));
|
|
2724
2724
|
class Dt extends T {
|
|
2725
2725
|
_parse(e) {
|
|
@@ -2731,16 +2731,16 @@ class Dt extends T {
|
|
|
2731
2731
|
for (const o of a)
|
|
2732
2732
|
if (o.result.status === "dirty")
|
|
2733
2733
|
return n.common.issues.push(...o.ctx.common.issues), o.result;
|
|
2734
|
-
const i = a.map((o) => new
|
|
2734
|
+
const i = a.map((o) => new oe(o.ctx.common.issues));
|
|
2735
2735
|
return y(n, {
|
|
2736
2736
|
code: f.invalid_union,
|
|
2737
2737
|
unionErrors: i
|
|
2738
2738
|
}), S;
|
|
2739
2739
|
}
|
|
2740
2740
|
if (n.common.async)
|
|
2741
|
-
return Promise.all(s.map((a) =>
|
|
2742
|
-
const i =
|
|
2743
|
-
common:
|
|
2741
|
+
return Promise.all(s.map((a) => Ee(this, null, function* () {
|
|
2742
|
+
const i = x(d({}, n), {
|
|
2743
|
+
common: x(d({}, n.common), {
|
|
2744
2744
|
issues: []
|
|
2745
2745
|
}),
|
|
2746
2746
|
parent: null
|
|
@@ -2758,8 +2758,8 @@ class Dt extends T {
|
|
|
2758
2758
|
let a;
|
|
2759
2759
|
const i = [];
|
|
2760
2760
|
for (const c of s) {
|
|
2761
|
-
const u =
|
|
2762
|
-
common:
|
|
2761
|
+
const u = x(d({}, n), {
|
|
2762
|
+
common: x(d({}, n.common), {
|
|
2763
2763
|
issues: []
|
|
2764
2764
|
}),
|
|
2765
2765
|
parent: null
|
|
@@ -2774,7 +2774,7 @@ class Dt extends T {
|
|
|
2774
2774
|
}
|
|
2775
2775
|
if (a)
|
|
2776
2776
|
return n.common.issues.push(...a.ctx.common.issues), a.result;
|
|
2777
|
-
const o = i.map((c) => new
|
|
2777
|
+
const o = i.map((c) => new oe(c));
|
|
2778
2778
|
return y(n, {
|
|
2779
2779
|
code: f.invalid_union,
|
|
2780
2780
|
unionErrors: o
|
|
@@ -2787,10 +2787,10 @@ class Dt extends T {
|
|
|
2787
2787
|
}
|
|
2788
2788
|
Dt.create = (t, e) => new Dt(d({
|
|
2789
2789
|
options: t,
|
|
2790
|
-
typeName:
|
|
2790
|
+
typeName: E.ZodUnion
|
|
2791
2791
|
}, O(e)));
|
|
2792
|
-
const Ze = (t) => t instanceof $t ? Ze(t.schema) : t instanceof
|
|
2793
|
-
class
|
|
2792
|
+
const Ze = (t) => t instanceof $t ? Ze(t.schema) : t instanceof ge ? Ze(t.innerType()) : t instanceof Ft ? [t.value] : t instanceof Fe ? t.options : t instanceof Wt ? N.objectValues(t.enum) : t instanceof Ut ? Ze(t._def.innerType) : t instanceof jt ? [void 0] : t instanceof Zt ? [null] : t instanceof ke ? [void 0, ...Ze(t.unwrap())] : t instanceof We ? [null, ...Ze(t.unwrap())] : t instanceof Ns || t instanceof zt ? Ze(t.unwrap()) : t instanceof Vt ? Ze(t._def.innerType) : [];
|
|
2793
|
+
class En extends T {
|
|
2794
2794
|
_parse(e) {
|
|
2795
2795
|
const { ctx: n } = this._processInputParams(e);
|
|
2796
2796
|
if (n.parsedType !== v.object)
|
|
@@ -2843,8 +2843,8 @@ class xn extends T {
|
|
|
2843
2843
|
r.set(o, a);
|
|
2844
2844
|
}
|
|
2845
2845
|
}
|
|
2846
|
-
return new
|
|
2847
|
-
typeName:
|
|
2846
|
+
return new En(d({
|
|
2847
|
+
typeName: E.ZodDiscriminatedUnion,
|
|
2848
2848
|
discriminator: e,
|
|
2849
2849
|
options: n,
|
|
2850
2850
|
optionsMap: r
|
|
@@ -2912,9 +2912,9 @@ class Mt extends T {
|
|
|
2912
2912
|
Mt.create = (t, e, n) => new Mt(d({
|
|
2913
2913
|
left: t,
|
|
2914
2914
|
right: e,
|
|
2915
|
-
typeName:
|
|
2915
|
+
typeName: E.ZodIntersection
|
|
2916
2916
|
}, O(n)));
|
|
2917
|
-
class
|
|
2917
|
+
class Se extends T {
|
|
2918
2918
|
_parse(e) {
|
|
2919
2919
|
const { status: n, ctx: s } = this._processInputParams(e);
|
|
2920
2920
|
if (s.parsedType !== v.array)
|
|
@@ -2942,23 +2942,23 @@ class Ee extends T {
|
|
|
2942
2942
|
const o = this._def.items[i] || this._def.rest;
|
|
2943
2943
|
return o ? o._parse(new xe(s, a, s.path, i)) : null;
|
|
2944
2944
|
}).filter((a) => !!a);
|
|
2945
|
-
return s.common.async ? Promise.all(r).then((a) =>
|
|
2945
|
+
return s.common.async ? Promise.all(r).then((a) => Y.mergeArray(n, a)) : Y.mergeArray(n, r);
|
|
2946
2946
|
}
|
|
2947
2947
|
get items() {
|
|
2948
2948
|
return this._def.items;
|
|
2949
2949
|
}
|
|
2950
2950
|
rest(e) {
|
|
2951
|
-
return new
|
|
2951
|
+
return new Se(x(d({}, this._def), {
|
|
2952
2952
|
rest: e
|
|
2953
2953
|
}));
|
|
2954
2954
|
}
|
|
2955
2955
|
}
|
|
2956
|
-
|
|
2956
|
+
Se.create = (t, e) => {
|
|
2957
2957
|
if (!Array.isArray(t))
|
|
2958
2958
|
throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
|
|
2959
|
-
return new
|
|
2959
|
+
return new Se(d({
|
|
2960
2960
|
items: t,
|
|
2961
|
-
typeName:
|
|
2961
|
+
typeName: E.ZodTuple,
|
|
2962
2962
|
rest: null
|
|
2963
2963
|
}, O(e)));
|
|
2964
2964
|
};
|
|
@@ -2984,7 +2984,7 @@ class Lt extends T {
|
|
|
2984
2984
|
value: i._parse(new xe(s, s.data[o], s.path, o)),
|
|
2985
2985
|
alwaysSet: o in s.data
|
|
2986
2986
|
});
|
|
2987
|
-
return s.common.async ?
|
|
2987
|
+
return s.common.async ? Y.mergeObjectAsync(n, r) : Y.mergeObjectSync(n, r);
|
|
2988
2988
|
}
|
|
2989
2989
|
get element() {
|
|
2990
2990
|
return this._def.valueType;
|
|
@@ -2993,11 +2993,11 @@ class Lt extends T {
|
|
|
2993
2993
|
return n instanceof T ? new Lt(d({
|
|
2994
2994
|
keyType: e,
|
|
2995
2995
|
valueType: n,
|
|
2996
|
-
typeName:
|
|
2996
|
+
typeName: E.ZodRecord
|
|
2997
2997
|
}, O(s))) : new Lt(d({
|
|
2998
|
-
keyType:
|
|
2998
|
+
keyType: me.create(),
|
|
2999
2999
|
valueType: e,
|
|
3000
|
-
typeName:
|
|
3000
|
+
typeName: E.ZodRecord
|
|
3001
3001
|
}, O(n)));
|
|
3002
3002
|
}
|
|
3003
3003
|
}
|
|
@@ -3022,7 +3022,7 @@ class gn extends T {
|
|
|
3022
3022
|
}));
|
|
3023
3023
|
if (s.common.async) {
|
|
3024
3024
|
const o = /* @__PURE__ */ new Map();
|
|
3025
|
-
return Promise.resolve().then(() =>
|
|
3025
|
+
return Promise.resolve().then(() => Ee(this, null, function* () {
|
|
3026
3026
|
for (const c of i) {
|
|
3027
3027
|
const u = yield c.key, h = yield c.value;
|
|
3028
3028
|
if (u.status === "aborted" || h.status === "aborted")
|
|
@@ -3046,7 +3046,7 @@ class gn extends T {
|
|
|
3046
3046
|
gn.create = (t, e, n) => new gn(d({
|
|
3047
3047
|
valueType: e,
|
|
3048
3048
|
keyType: t,
|
|
3049
|
-
typeName:
|
|
3049
|
+
typeName: E.ZodMap
|
|
3050
3050
|
}, O(n)));
|
|
3051
3051
|
class et extends T {
|
|
3052
3052
|
_parse(e) {
|
|
@@ -3087,12 +3087,12 @@ class et extends T {
|
|
|
3087
3087
|
return s.common.async ? Promise.all(o).then((c) => i(c)) : i(o);
|
|
3088
3088
|
}
|
|
3089
3089
|
min(e, n) {
|
|
3090
|
-
return new et(
|
|
3090
|
+
return new et(x(d({}, this._def), {
|
|
3091
3091
|
minSize: { value: e, message: w.toString(n) }
|
|
3092
3092
|
}));
|
|
3093
3093
|
}
|
|
3094
3094
|
max(e, n) {
|
|
3095
|
-
return new et(
|
|
3095
|
+
return new et(x(d({}, this._def), {
|
|
3096
3096
|
maxSize: { value: e, message: w.toString(n) }
|
|
3097
3097
|
}));
|
|
3098
3098
|
}
|
|
@@ -3107,7 +3107,7 @@ et.create = (t, e) => new et(d({
|
|
|
3107
3107
|
valueType: t,
|
|
3108
3108
|
minSize: null,
|
|
3109
3109
|
maxSize: null,
|
|
3110
|
-
typeName:
|
|
3110
|
+
typeName: E.ZodSet
|
|
3111
3111
|
}, O(e)));
|
|
3112
3112
|
class ht extends T {
|
|
3113
3113
|
constructor() {
|
|
@@ -3156,9 +3156,9 @@ class ht extends T {
|
|
|
3156
3156
|
const a = { errorMap: n.common.contextualErrorMap }, i = n.data;
|
|
3157
3157
|
if (this._def.returns instanceof vt) {
|
|
3158
3158
|
const o = this;
|
|
3159
|
-
return
|
|
3160
|
-
return
|
|
3161
|
-
const u = new
|
|
3159
|
+
return ne(function(...c) {
|
|
3160
|
+
return Ee(this, null, function* () {
|
|
3161
|
+
const u = new oe([]), h = yield o._def.args.parseAsync(c, a).catch((k) => {
|
|
3162
3162
|
throw u.addIssue(s(c, k)), u;
|
|
3163
3163
|
}), p = yield Reflect.apply(i, this, h);
|
|
3164
3164
|
return yield o._def.returns._def.type.parseAsync(p, a).catch((k) => {
|
|
@@ -3168,13 +3168,13 @@ class ht extends T {
|
|
|
3168
3168
|
});
|
|
3169
3169
|
} else {
|
|
3170
3170
|
const o = this;
|
|
3171
|
-
return
|
|
3171
|
+
return ne(function(...c) {
|
|
3172
3172
|
const u = o._def.args.safeParse(c, a);
|
|
3173
3173
|
if (!u.success)
|
|
3174
|
-
throw new
|
|
3174
|
+
throw new oe([s(c, u.error)]);
|
|
3175
3175
|
const h = Reflect.apply(i, this, u.data), p = o._def.returns.safeParse(h, a);
|
|
3176
3176
|
if (!p.success)
|
|
3177
|
-
throw new
|
|
3177
|
+
throw new oe([r(h, p.error)]);
|
|
3178
3178
|
return p.data;
|
|
3179
3179
|
});
|
|
3180
3180
|
}
|
|
@@ -3186,12 +3186,12 @@ class ht extends T {
|
|
|
3186
3186
|
return this._def.returns;
|
|
3187
3187
|
}
|
|
3188
3188
|
args(...e) {
|
|
3189
|
-
return new ht(
|
|
3190
|
-
args:
|
|
3189
|
+
return new ht(x(d({}, this._def), {
|
|
3190
|
+
args: Se.create(e).rest(Xe.create())
|
|
3191
3191
|
}));
|
|
3192
3192
|
}
|
|
3193
3193
|
returns(e) {
|
|
3194
|
-
return new ht(
|
|
3194
|
+
return new ht(x(d({}, this._def), {
|
|
3195
3195
|
returns: e
|
|
3196
3196
|
}));
|
|
3197
3197
|
}
|
|
@@ -3203,9 +3203,9 @@ class ht extends T {
|
|
|
3203
3203
|
}
|
|
3204
3204
|
static create(e, n, s) {
|
|
3205
3205
|
return new ht(d({
|
|
3206
|
-
args: e ||
|
|
3206
|
+
args: e || Se.create([]).rest(Xe.create()),
|
|
3207
3207
|
returns: n || Xe.create(),
|
|
3208
|
-
typeName:
|
|
3208
|
+
typeName: E.ZodFunction
|
|
3209
3209
|
}, O(s)));
|
|
3210
3210
|
}
|
|
3211
3211
|
}
|
|
@@ -3220,7 +3220,7 @@ class $t extends T {
|
|
|
3220
3220
|
}
|
|
3221
3221
|
$t.create = (t, e) => new $t(d({
|
|
3222
3222
|
getter: t,
|
|
3223
|
-
typeName:
|
|
3223
|
+
typeName: E.ZodLazy
|
|
3224
3224
|
}, O(e)));
|
|
3225
3225
|
class Ft extends T {
|
|
3226
3226
|
_parse(e) {
|
|
@@ -3240,12 +3240,12 @@ class Ft extends T {
|
|
|
3240
3240
|
}
|
|
3241
3241
|
Ft.create = (t, e) => new Ft(d({
|
|
3242
3242
|
value: t,
|
|
3243
|
-
typeName:
|
|
3243
|
+
typeName: E.ZodLiteral
|
|
3244
3244
|
}, O(e)));
|
|
3245
3245
|
function Dr(t, e) {
|
|
3246
3246
|
return new Fe(d({
|
|
3247
3247
|
values: t,
|
|
3248
|
-
typeName:
|
|
3248
|
+
typeName: E.ZodEnum
|
|
3249
3249
|
}, O(e)));
|
|
3250
3250
|
}
|
|
3251
3251
|
class Fe extends T {
|
|
@@ -3269,7 +3269,7 @@ class Fe extends T {
|
|
|
3269
3269
|
options: s
|
|
3270
3270
|
}), S;
|
|
3271
3271
|
}
|
|
3272
|
-
return
|
|
3272
|
+
return ne(e.data);
|
|
3273
3273
|
}
|
|
3274
3274
|
get options() {
|
|
3275
3275
|
return this._def.values;
|
|
@@ -3323,7 +3323,7 @@ class Wt extends T {
|
|
|
3323
3323
|
options: r
|
|
3324
3324
|
}), S;
|
|
3325
3325
|
}
|
|
3326
|
-
return
|
|
3326
|
+
return ne(e.data);
|
|
3327
3327
|
}
|
|
3328
3328
|
get enum() {
|
|
3329
3329
|
return this._def.values;
|
|
@@ -3332,7 +3332,7 @@ class Wt extends T {
|
|
|
3332
3332
|
Tt = /* @__PURE__ */ new WeakMap();
|
|
3333
3333
|
Wt.create = (t, e) => new Wt(d({
|
|
3334
3334
|
values: t,
|
|
3335
|
-
typeName:
|
|
3335
|
+
typeName: E.ZodNativeEnum
|
|
3336
3336
|
}, O(e)));
|
|
3337
3337
|
class vt extends T {
|
|
3338
3338
|
unwrap() {
|
|
@@ -3347,7 +3347,7 @@ class vt extends T {
|
|
|
3347
3347
|
received: n.parsedType
|
|
3348
3348
|
}), S;
|
|
3349
3349
|
const s = n.parsedType === v.promise ? n.data : Promise.resolve(n.data);
|
|
3350
|
-
return
|
|
3350
|
+
return ne(s.then((r) => this._def.type.parseAsync(r, {
|
|
3351
3351
|
path: n.path,
|
|
3352
3352
|
errorMap: n.common.contextualErrorMap
|
|
3353
3353
|
})));
|
|
@@ -3355,14 +3355,14 @@ class vt extends T {
|
|
|
3355
3355
|
}
|
|
3356
3356
|
vt.create = (t, e) => new vt(d({
|
|
3357
3357
|
type: t,
|
|
3358
|
-
typeName:
|
|
3358
|
+
typeName: E.ZodPromise
|
|
3359
3359
|
}, O(e)));
|
|
3360
|
-
class
|
|
3360
|
+
class ge extends T {
|
|
3361
3361
|
innerType() {
|
|
3362
3362
|
return this._def.schema;
|
|
3363
3363
|
}
|
|
3364
3364
|
sourceType() {
|
|
3365
|
-
return this._def.schema._def.typeName ===
|
|
3365
|
+
return this._def.schema._def.typeName === E.ZodEffects ? this._def.schema.sourceType() : this._def.schema;
|
|
3366
3366
|
}
|
|
3367
3367
|
_parse(e) {
|
|
3368
3368
|
const { status: n, ctx: s } = this._processInputParams(e), r = this._def.effect || null, a = {
|
|
@@ -3376,7 +3376,7 @@ class ye extends T {
|
|
|
3376
3376
|
if (a.addIssue = a.addIssue.bind(a), r.type === "preprocess") {
|
|
3377
3377
|
const i = r.transform(s.data, a);
|
|
3378
3378
|
if (s.common.async)
|
|
3379
|
-
return Promise.resolve(i).then((o) =>
|
|
3379
|
+
return Promise.resolve(i).then((o) => Ee(this, null, function* () {
|
|
3380
3380
|
if (n.value === "aborted")
|
|
3381
3381
|
return S;
|
|
3382
3382
|
const c = yield this._def.schema._parseAsync({
|
|
@@ -3434,31 +3434,31 @@ class ye extends T {
|
|
|
3434
3434
|
N.assertNever(r);
|
|
3435
3435
|
}
|
|
3436
3436
|
}
|
|
3437
|
-
|
|
3437
|
+
ge.create = (t, e, n) => new ge(d({
|
|
3438
3438
|
schema: t,
|
|
3439
|
-
typeName:
|
|
3439
|
+
typeName: E.ZodEffects,
|
|
3440
3440
|
effect: e
|
|
3441
3441
|
}, O(n)));
|
|
3442
|
-
|
|
3442
|
+
ge.createWithPreprocess = (t, e, n) => new ge(d({
|
|
3443
3443
|
schema: e,
|
|
3444
3444
|
effect: { type: "preprocess", transform: t },
|
|
3445
|
-
typeName:
|
|
3445
|
+
typeName: E.ZodEffects
|
|
3446
3446
|
}, O(n)));
|
|
3447
|
-
class
|
|
3447
|
+
class ke extends T {
|
|
3448
3448
|
_parse(e) {
|
|
3449
|
-
return this._getType(e) === v.undefined ?
|
|
3449
|
+
return this._getType(e) === v.undefined ? ne(void 0) : this._def.innerType._parse(e);
|
|
3450
3450
|
}
|
|
3451
3451
|
unwrap() {
|
|
3452
3452
|
return this._def.innerType;
|
|
3453
3453
|
}
|
|
3454
3454
|
}
|
|
3455
|
-
|
|
3455
|
+
ke.create = (t, e) => new ke(d({
|
|
3456
3456
|
innerType: t,
|
|
3457
|
-
typeName:
|
|
3457
|
+
typeName: E.ZodOptional
|
|
3458
3458
|
}, O(e)));
|
|
3459
3459
|
class We extends T {
|
|
3460
3460
|
_parse(e) {
|
|
3461
|
-
return this._getType(e) === v.null ?
|
|
3461
|
+
return this._getType(e) === v.null ? ne(null) : this._def.innerType._parse(e);
|
|
3462
3462
|
}
|
|
3463
3463
|
unwrap() {
|
|
3464
3464
|
return this._def.innerType;
|
|
@@ -3466,7 +3466,7 @@ class We extends T {
|
|
|
3466
3466
|
}
|
|
3467
3467
|
We.create = (t, e) => new We(d({
|
|
3468
3468
|
innerType: t,
|
|
3469
|
-
typeName:
|
|
3469
|
+
typeName: E.ZodNullable
|
|
3470
3470
|
}, O(e)));
|
|
3471
3471
|
class Ut extends T {
|
|
3472
3472
|
_parse(e) {
|
|
@@ -3484,13 +3484,13 @@ class Ut extends T {
|
|
|
3484
3484
|
}
|
|
3485
3485
|
Ut.create = (t, e) => new Ut(d({
|
|
3486
3486
|
innerType: t,
|
|
3487
|
-
typeName:
|
|
3487
|
+
typeName: E.ZodDefault,
|
|
3488
3488
|
defaultValue: typeof e.default == "function" ? e.default : () => e.default
|
|
3489
3489
|
}, O(e)));
|
|
3490
3490
|
class Vt extends T {
|
|
3491
3491
|
_parse(e) {
|
|
3492
|
-
const { ctx: n } = this._processInputParams(e), s =
|
|
3493
|
-
common:
|
|
3492
|
+
const { ctx: n } = this._processInputParams(e), s = x(d({}, n), {
|
|
3493
|
+
common: x(d({}, n.common), {
|
|
3494
3494
|
issues: []
|
|
3495
3495
|
})
|
|
3496
3496
|
}), r = this._def.innerType._parse({
|
|
@@ -3502,7 +3502,7 @@ class Vt extends T {
|
|
|
3502
3502
|
status: "valid",
|
|
3503
3503
|
value: a.status === "valid" ? a.value : this._def.catchValue({
|
|
3504
3504
|
get error() {
|
|
3505
|
-
return new
|
|
3505
|
+
return new oe(s.common.issues);
|
|
3506
3506
|
},
|
|
3507
3507
|
input: s.data
|
|
3508
3508
|
})
|
|
@@ -3510,7 +3510,7 @@ class Vt extends T {
|
|
|
3510
3510
|
status: "valid",
|
|
3511
3511
|
value: r.status === "valid" ? r.value : this._def.catchValue({
|
|
3512
3512
|
get error() {
|
|
3513
|
-
return new
|
|
3513
|
+
return new oe(s.common.issues);
|
|
3514
3514
|
},
|
|
3515
3515
|
input: s.data
|
|
3516
3516
|
})
|
|
@@ -3522,7 +3522,7 @@ class Vt extends T {
|
|
|
3522
3522
|
}
|
|
3523
3523
|
Vt.create = (t, e) => new Vt(d({
|
|
3524
3524
|
innerType: t,
|
|
3525
|
-
typeName:
|
|
3525
|
+
typeName: E.ZodCatch,
|
|
3526
3526
|
catchValue: typeof e.catch == "function" ? e.catch : () => e.catch
|
|
3527
3527
|
}, O(e)));
|
|
3528
3528
|
class vn extends T {
|
|
@@ -3539,7 +3539,7 @@ class vn extends T {
|
|
|
3539
3539
|
}
|
|
3540
3540
|
}
|
|
3541
3541
|
vn.create = (t) => new vn(d({
|
|
3542
|
-
typeName:
|
|
3542
|
+
typeName: E.ZodNaN
|
|
3543
3543
|
}, O(t)));
|
|
3544
3544
|
const to = Symbol("zod_brand");
|
|
3545
3545
|
class Ns extends T {
|
|
@@ -3559,7 +3559,7 @@ class Jt extends T {
|
|
|
3559
3559
|
_parse(e) {
|
|
3560
3560
|
const { status: n, ctx: s } = this._processInputParams(e);
|
|
3561
3561
|
if (s.common.async)
|
|
3562
|
-
return
|
|
3562
|
+
return Ee(this, null, function* () {
|
|
3563
3563
|
const r = yield this._def.in._parseAsync({
|
|
3564
3564
|
data: s.data,
|
|
3565
3565
|
path: s.path,
|
|
@@ -3591,7 +3591,7 @@ class Jt extends T {
|
|
|
3591
3591
|
return new Jt({
|
|
3592
3592
|
in: e,
|
|
3593
3593
|
out: n,
|
|
3594
|
-
typeName:
|
|
3594
|
+
typeName: E.ZodPipeline
|
|
3595
3595
|
});
|
|
3596
3596
|
}
|
|
3597
3597
|
}
|
|
@@ -3606,7 +3606,7 @@ class zt extends T {
|
|
|
3606
3606
|
}
|
|
3607
3607
|
zt.create = (t, e) => new zt(d({
|
|
3608
3608
|
innerType: t,
|
|
3609
|
-
typeName:
|
|
3609
|
+
typeName: E.ZodReadonly
|
|
3610
3610
|
}, O(e)));
|
|
3611
3611
|
function ar(t, e) {
|
|
3612
3612
|
const n = typeof t == "function" ? t(e) : typeof t == "string" ? { message: t } : t;
|
|
@@ -3621,34 +3621,34 @@ function Mr(t, e = {}, n) {
|
|
|
3621
3621
|
var u, h;
|
|
3622
3622
|
if (!c) {
|
|
3623
3623
|
const p = ar(e, s), k = (h = (u = p.fatal) !== null && u !== void 0 ? u : n) !== null && h !== void 0 ? h : !0;
|
|
3624
|
-
r.addIssue(
|
|
3624
|
+
r.addIssue(x(d({ code: "custom" }, p), { fatal: k }));
|
|
3625
3625
|
}
|
|
3626
3626
|
});
|
|
3627
3627
|
if (!o) {
|
|
3628
3628
|
const c = ar(e, s), u = (i = (a = c.fatal) !== null && a !== void 0 ? a : n) !== null && i !== void 0 ? i : !0;
|
|
3629
|
-
r.addIssue(
|
|
3629
|
+
r.addIssue(x(d({ code: "custom" }, c), { fatal: u }));
|
|
3630
3630
|
}
|
|
3631
3631
|
}) : gt.create();
|
|
3632
3632
|
}
|
|
3633
3633
|
const no = {
|
|
3634
3634
|
object: U.lazycreate
|
|
3635
3635
|
};
|
|
3636
|
-
var
|
|
3636
|
+
var E;
|
|
3637
3637
|
(function(t) {
|
|
3638
3638
|
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";
|
|
3639
|
-
})(
|
|
3639
|
+
})(E || (E = {}));
|
|
3640
3640
|
const so = (t, e = {
|
|
3641
3641
|
message: `Input not instance of ${t.name}`
|
|
3642
|
-
}) => Mr((n) => n instanceof t, e), Lr =
|
|
3643
|
-
string: (t) =>
|
|
3644
|
-
number: (t) => Le.create(
|
|
3645
|
-
boolean: (t) => It.create(
|
|
3642
|
+
}) => Mr((n) => n instanceof t, e), Lr = me.create, $r = Le.create, ro = vn.create, ao = $e.create, Fr = It.create, io = Qe.create, oo = mn.create, co = jt.create, uo = Zt.create, lo = gt.create, fo = Xe.create, ho = Pe.create, po = yn.create, mo = ye.create, yo = U.create, go = U.strictCreate, vo = Dt.create, _o = En.create, bo = Mt.create, wo = Se.create, ko = Lt.create, Eo = gn.create, xo = et.create, So = ht.create, Oo = $t.create, To = Ft.create, Co = Fe.create, Ao = Wt.create, No = vt.create, ir = ge.create, Ro = ke.create, Po = We.create, Io = ge.createWithPreprocess, jo = Jt.create, Zo = () => Lr().optional(), Do = () => $r().optional(), Mo = () => Fr().optional(), Lo = {
|
|
3643
|
+
string: (t) => me.create(x(d({}, t), { coerce: !0 })),
|
|
3644
|
+
number: (t) => Le.create(x(d({}, t), { coerce: !0 })),
|
|
3645
|
+
boolean: (t) => It.create(x(d({}, t), {
|
|
3646
3646
|
coerce: !0
|
|
3647
3647
|
})),
|
|
3648
|
-
bigint: (t) => $e.create(
|
|
3649
|
-
date: (t) => Qe.create(
|
|
3648
|
+
bigint: (t) => $e.create(x(d({}, t), { coerce: !0 })),
|
|
3649
|
+
date: (t) => Qe.create(x(d({}, t), { coerce: !0 }))
|
|
3650
3650
|
}, $o = S;
|
|
3651
|
-
var
|
|
3651
|
+
var P = /* @__PURE__ */ Object.freeze({
|
|
3652
3652
|
__proto__: null,
|
|
3653
3653
|
defaultErrorMap: yt,
|
|
3654
3654
|
setErrorMap: Pi,
|
|
@@ -3656,10 +3656,10 @@ var j = /* @__PURE__ */ Object.freeze({
|
|
|
3656
3656
|
makeIssue: fn,
|
|
3657
3657
|
EMPTY_PATH: Ii,
|
|
3658
3658
|
addIssueToContext: y,
|
|
3659
|
-
ParseStatus:
|
|
3659
|
+
ParseStatus: Y,
|
|
3660
3660
|
INVALID: S,
|
|
3661
3661
|
DIRTY: hn,
|
|
3662
|
-
OK:
|
|
3662
|
+
OK: ne,
|
|
3663
3663
|
isAborted: ns,
|
|
3664
3664
|
isDirty: ss,
|
|
3665
3665
|
isValid: Ye,
|
|
@@ -3674,7 +3674,7 @@ var j = /* @__PURE__ */ Object.freeze({
|
|
|
3674
3674
|
getParsedType: Ne,
|
|
3675
3675
|
ZodType: T,
|
|
3676
3676
|
datetimeRegex: Zr,
|
|
3677
|
-
ZodString:
|
|
3677
|
+
ZodString: me,
|
|
3678
3678
|
ZodNumber: Le,
|
|
3679
3679
|
ZodBigInt: $e,
|
|
3680
3680
|
ZodBoolean: It,
|
|
@@ -3686,12 +3686,12 @@ var j = /* @__PURE__ */ Object.freeze({
|
|
|
3686
3686
|
ZodUnknown: Xe,
|
|
3687
3687
|
ZodNever: Pe,
|
|
3688
3688
|
ZodVoid: yn,
|
|
3689
|
-
ZodArray:
|
|
3689
|
+
ZodArray: ye,
|
|
3690
3690
|
ZodObject: U,
|
|
3691
3691
|
ZodUnion: Dt,
|
|
3692
|
-
ZodDiscriminatedUnion:
|
|
3692
|
+
ZodDiscriminatedUnion: En,
|
|
3693
3693
|
ZodIntersection: Mt,
|
|
3694
|
-
ZodTuple:
|
|
3694
|
+
ZodTuple: Se,
|
|
3695
3695
|
ZodRecord: Lt,
|
|
3696
3696
|
ZodMap: gn,
|
|
3697
3697
|
ZodSet: et,
|
|
@@ -3701,9 +3701,9 @@ var j = /* @__PURE__ */ Object.freeze({
|
|
|
3701
3701
|
ZodEnum: Fe,
|
|
3702
3702
|
ZodNativeEnum: Wt,
|
|
3703
3703
|
ZodPromise: vt,
|
|
3704
|
-
ZodEffects:
|
|
3705
|
-
ZodTransformer:
|
|
3706
|
-
ZodOptional:
|
|
3704
|
+
ZodEffects: ge,
|
|
3705
|
+
ZodTransformer: ge,
|
|
3706
|
+
ZodOptional: ke,
|
|
3707
3707
|
ZodNullable: We,
|
|
3708
3708
|
ZodDefault: Ut,
|
|
3709
3709
|
ZodCatch: Vt,
|
|
@@ -3717,7 +3717,7 @@ var j = /* @__PURE__ */ Object.freeze({
|
|
|
3717
3717
|
ZodSchema: T,
|
|
3718
3718
|
late: no,
|
|
3719
3719
|
get ZodFirstPartyTypeKind() {
|
|
3720
|
-
return
|
|
3720
|
+
return E;
|
|
3721
3721
|
},
|
|
3722
3722
|
coerce: Lo,
|
|
3723
3723
|
any: lo,
|
|
@@ -3727,15 +3727,15 @@ var j = /* @__PURE__ */ Object.freeze({
|
|
|
3727
3727
|
date: io,
|
|
3728
3728
|
discriminatedUnion: _o,
|
|
3729
3729
|
effect: ir,
|
|
3730
|
-
enum:
|
|
3730
|
+
enum: Co,
|
|
3731
3731
|
function: So,
|
|
3732
3732
|
instanceof: so,
|
|
3733
3733
|
intersection: bo,
|
|
3734
3734
|
lazy: Oo,
|
|
3735
3735
|
literal: To,
|
|
3736
|
-
map:
|
|
3736
|
+
map: Eo,
|
|
3737
3737
|
nan: ro,
|
|
3738
|
-
nativeEnum:
|
|
3738
|
+
nativeEnum: Ao,
|
|
3739
3739
|
never: ho,
|
|
3740
3740
|
null: uo,
|
|
3741
3741
|
nullable: Po,
|
|
@@ -3749,7 +3749,7 @@ var j = /* @__PURE__ */ Object.freeze({
|
|
|
3749
3749
|
preprocess: Io,
|
|
3750
3750
|
promise: No,
|
|
3751
3751
|
record: ko,
|
|
3752
|
-
set:
|
|
3752
|
+
set: xo,
|
|
3753
3753
|
strictObject: go,
|
|
3754
3754
|
string: Lr,
|
|
3755
3755
|
symbol: oo,
|
|
@@ -3762,18 +3762,18 @@ var j = /* @__PURE__ */ Object.freeze({
|
|
|
3762
3762
|
NEVER: $o,
|
|
3763
3763
|
ZodIssueCode: f,
|
|
3764
3764
|
quotelessJson: Ri,
|
|
3765
|
-
ZodError:
|
|
3765
|
+
ZodError: oe
|
|
3766
3766
|
});
|
|
3767
|
-
|
|
3768
|
-
language:
|
|
3769
|
-
disableMarkedForExport:
|
|
3770
|
-
allowAutoSelectFirstNode:
|
|
3767
|
+
P.object({
|
|
3768
|
+
language: P.enum(["typescript", "javascript"]).optional(),
|
|
3769
|
+
disableMarkedForExport: P.boolean().optional(),
|
|
3770
|
+
allowAutoSelectFirstNode: P.boolean().optional().default(!0)
|
|
3771
3771
|
}).and(
|
|
3772
|
-
|
|
3773
|
-
|
|
3774
|
-
framework:
|
|
3775
|
-
model:
|
|
3776
|
-
styling:
|
|
3772
|
+
P.union([
|
|
3773
|
+
P.object({
|
|
3774
|
+
framework: P.literal("react"),
|
|
3775
|
+
model: P.string().optional(),
|
|
3776
|
+
styling: P.enum([
|
|
3777
3777
|
"plain_css",
|
|
3778
3778
|
"css_modules",
|
|
3779
3779
|
"styled_components",
|
|
@@ -3782,27 +3782,29 @@ j.object({
|
|
|
3782
3782
|
"scss",
|
|
3783
3783
|
"inline_styles"
|
|
3784
3784
|
]),
|
|
3785
|
-
uiLibrary:
|
|
3786
|
-
responsivePages:
|
|
3787
|
-
|
|
3788
|
-
name:
|
|
3789
|
-
framesId:
|
|
3785
|
+
uiLibrary: P.enum(["mui", "antd", "radix", "shadcn", "clean_react"]).optional(),
|
|
3786
|
+
responsivePages: P.array(
|
|
3787
|
+
P.object({
|
|
3788
|
+
name: P.string(),
|
|
3789
|
+
framesId: P.array(P.string())
|
|
3790
3790
|
})
|
|
3791
3791
|
).optional(),
|
|
3792
|
-
enableUILibraryTheming:
|
|
3793
|
-
enableCompactStructure:
|
|
3794
|
-
enableDisplayScreenModelId:
|
|
3795
|
-
enableGeneratePackageLock:
|
|
3796
|
-
enableAnimationsPreset:
|
|
3797
|
-
|
|
3798
|
-
|
|
3799
|
-
|
|
3800
|
-
|
|
3792
|
+
enableUILibraryTheming: P.boolean().optional(),
|
|
3793
|
+
enableCompactStructure: P.boolean().optional(),
|
|
3794
|
+
enableDisplayScreenModelId: P.boolean().optional(),
|
|
3795
|
+
enableGeneratePackageLock: P.boolean().optional(),
|
|
3796
|
+
enableAnimationsPreset: P.boolean().optional(),
|
|
3797
|
+
enableDisplayDataId: P.boolean().optional(),
|
|
3798
|
+
enableDisplayDataName: P.boolean().optional(),
|
|
3799
|
+
enableAutoSplit: P.boolean().optional(),
|
|
3800
|
+
autoSplitThreshold: P.number().optional(),
|
|
3801
|
+
url: P.string().url().optional(),
|
|
3802
|
+
codegenSettings: P.record(P.unknown()).optional()
|
|
3801
3803
|
}),
|
|
3802
|
-
|
|
3803
|
-
framework:
|
|
3804
|
-
styling:
|
|
3805
|
-
enableTranslation:
|
|
3804
|
+
P.object({
|
|
3805
|
+
framework: P.literal("html"),
|
|
3806
|
+
styling: P.enum(["plain_css", "inline_styles", "tailwind"]),
|
|
3807
|
+
enableTranslation: P.boolean().optional()
|
|
3806
3808
|
})
|
|
3807
3809
|
])
|
|
3808
3810
|
);
|
|
@@ -3821,10 +3823,10 @@ function Fo(t) {
|
|
|
3821
3823
|
const { onEvent: e = Zn, onError: n = Zn, onRetry: s = Zn, onComment: r } = t;
|
|
3822
3824
|
let a = "", i = !0, o, c = "", u = "";
|
|
3823
3825
|
function h(m) {
|
|
3824
|
-
const _ = i ? m.replace(/^\xEF\xBB\xBF/, "") : m, [l,
|
|
3826
|
+
const _ = i ? m.replace(/^\xEF\xBB\xBF/, "") : m, [l, A] = Wo(`${a}${_}`);
|
|
3825
3827
|
for (const I of l)
|
|
3826
3828
|
p(I);
|
|
3827
|
-
a =
|
|
3829
|
+
a = A, i = !1;
|
|
3828
3830
|
}
|
|
3829
3831
|
function p(m) {
|
|
3830
3832
|
if (m === "") {
|
|
@@ -3837,7 +3839,7 @@ function Fo(t) {
|
|
|
3837
3839
|
}
|
|
3838
3840
|
const _ = m.indexOf(":");
|
|
3839
3841
|
if (_ !== -1) {
|
|
3840
|
-
const l = m.slice(0, _),
|
|
3842
|
+
const l = m.slice(0, _), A = m[_ + 1] === " " ? 2 : 1, I = m.slice(_ + A);
|
|
3841
3843
|
k(l, I, m);
|
|
3842
3844
|
return;
|
|
3843
3845
|
}
|
|
@@ -3968,54 +3970,54 @@ function ur(t) {
|
|
|
3968
3970
|
}
|
|
3969
3971
|
var Wr = (t) => {
|
|
3970
3972
|
throw TypeError(t);
|
|
3971
|
-
}, Rs = (t, e, n) => e.has(t) || Wr("Cannot " + n),
|
|
3973
|
+
}, Rs = (t, e, n) => e.has(t) || Wr("Cannot " + n), C = (t, e, n) => (Rs(t, e, "read from private field"), n ? n.call(t) : e.get(t)), q = (t, e, n) => e.has(t) ? Wr("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), W = (t, e, n, s) => (Rs(t, e, "write to private field"), e.set(t, n), n), Ae = (t, e, n) => (Rs(t, e, "access private method"), n), re, Je, ut, un, _n, Nt, ft, Rt, De, dt, pt, lt, Ct, pe, is, os, cs, dr, us, ds, At, ls, fs;
|
|
3972
3974
|
class dn extends EventTarget {
|
|
3973
3975
|
constructor(e, n) {
|
|
3974
3976
|
var s, r;
|
|
3975
|
-
super(), q(this,
|
|
3977
|
+
super(), q(this, pe), this.CONNECTING = 0, this.OPEN = 1, this.CLOSED = 2, q(this, re), q(this, Je), q(this, ut), q(this, un), q(this, _n), q(this, Nt), q(this, ft), q(this, Rt, null), q(this, De), q(this, dt), q(this, pt, null), q(this, lt, null), q(this, Ct, null), q(this, os, (a) => Ie(this, null, function* () {
|
|
3976
3978
|
var i;
|
|
3977
|
-
|
|
3979
|
+
C(this, dt).reset();
|
|
3978
3980
|
const { body: o, redirected: c, status: u, headers: h } = a;
|
|
3979
3981
|
if (u === 204) {
|
|
3980
|
-
|
|
3982
|
+
Ae(this, pe, At).call(this, "Server sent HTTP 204, not reconnecting", 204), this.close();
|
|
3981
3983
|
return;
|
|
3982
3984
|
}
|
|
3983
3985
|
if (c ? W(this, ut, new URL(a.url)) : W(this, ut, void 0), u !== 200) {
|
|
3984
|
-
|
|
3986
|
+
Ae(this, pe, At).call(this, `Non-200 status code (${u})`, u);
|
|
3985
3987
|
return;
|
|
3986
3988
|
}
|
|
3987
3989
|
if (!(h.get("content-type") || "").startsWith("text/event-stream")) {
|
|
3988
|
-
|
|
3990
|
+
Ae(this, pe, At).call(this, 'Invalid content type, expected "text/event-stream"', u);
|
|
3989
3991
|
return;
|
|
3990
3992
|
}
|
|
3991
|
-
if (
|
|
3993
|
+
if (C(this, re) === this.CLOSED)
|
|
3992
3994
|
return;
|
|
3993
|
-
W(this,
|
|
3995
|
+
W(this, re, this.OPEN);
|
|
3994
3996
|
const p = new Event("open");
|
|
3995
|
-
if ((i =
|
|
3996
|
-
|
|
3997
|
+
if ((i = C(this, Ct)) == null || i.call(this, p), this.dispatchEvent(p), typeof o != "object" || !o || !("getReader" in o)) {
|
|
3998
|
+
Ae(this, pe, At).call(this, "Invalid response body, expected a web ReadableStream", u), this.close();
|
|
3997
3999
|
return;
|
|
3998
4000
|
}
|
|
3999
4001
|
const k = new TextDecoder(), g = o.getReader();
|
|
4000
4002
|
let b = !0;
|
|
4001
4003
|
do {
|
|
4002
4004
|
const { done: m, value: _ } = yield g.read();
|
|
4003
|
-
_ &&
|
|
4005
|
+
_ && C(this, dt).feed(k.decode(_, { stream: !m })), m && (b = !1, C(this, dt).reset(), Ae(this, pe, ls).call(this));
|
|
4004
4006
|
} while (b);
|
|
4005
4007
|
})), q(this, cs, (a) => {
|
|
4006
|
-
W(this, De, void 0), !(a.name === "AbortError" || a.type === "aborted") &&
|
|
4008
|
+
W(this, De, void 0), !(a.name === "AbortError" || a.type === "aborted") && Ae(this, pe, ls).call(this, as(a));
|
|
4007
4009
|
}), q(this, us, (a) => {
|
|
4008
4010
|
typeof a.id == "string" && W(this, Rt, a.id);
|
|
4009
4011
|
const i = new MessageEvent(a.event || "message", {
|
|
4010
4012
|
data: a.data,
|
|
4011
|
-
origin:
|
|
4013
|
+
origin: C(this, ut) ? C(this, ut).origin : C(this, Je).origin,
|
|
4012
4014
|
lastEventId: a.id || ""
|
|
4013
4015
|
});
|
|
4014
|
-
|
|
4016
|
+
C(this, lt) && (!a.event || a.event === "message") && C(this, lt).call(this, i), this.dispatchEvent(i);
|
|
4015
4017
|
}), q(this, ds, (a) => {
|
|
4016
4018
|
W(this, Nt, a);
|
|
4017
4019
|
}), q(this, fs, () => {
|
|
4018
|
-
W(this, ft, void 0),
|
|
4020
|
+
W(this, ft, void 0), C(this, re) === this.CONNECTING && Ae(this, pe, is).call(this);
|
|
4019
4021
|
});
|
|
4020
4022
|
try {
|
|
4021
4023
|
if (e instanceof URL)
|
|
@@ -4028,9 +4030,9 @@ class dn extends EventTarget {
|
|
|
4028
4030
|
throw Uo("An invalid or illegal string was specified");
|
|
4029
4031
|
}
|
|
4030
4032
|
W(this, dt, Fo({
|
|
4031
|
-
onEvent:
|
|
4032
|
-
onRetry:
|
|
4033
|
-
})), W(this,
|
|
4033
|
+
onEvent: C(this, us),
|
|
4034
|
+
onRetry: C(this, ds)
|
|
4035
|
+
})), W(this, re, this.CONNECTING), W(this, Nt, 3e3), W(this, _n, (s = n == null ? void 0 : n.fetch) != null ? s : globalThis.fetch), W(this, un, (r = n == null ? void 0 : n.withCredentials) != null ? r : !1), Ae(this, pe, is).call(this);
|
|
4034
4036
|
}
|
|
4035
4037
|
/**
|
|
4036
4038
|
* Returns the state of this EventSource object's connection. It can have the values described below.
|
|
@@ -4043,7 +4045,7 @@ class dn extends EventTarget {
|
|
|
4043
4045
|
* @public
|
|
4044
4046
|
*/
|
|
4045
4047
|
get readyState() {
|
|
4046
|
-
return
|
|
4048
|
+
return C(this, re);
|
|
4047
4049
|
}
|
|
4048
4050
|
/**
|
|
4049
4051
|
* Returns the URL providing the event stream.
|
|
@@ -4053,7 +4055,7 @@ class dn extends EventTarget {
|
|
|
4053
4055
|
* @public
|
|
4054
4056
|
*/
|
|
4055
4057
|
get url() {
|
|
4056
|
-
return
|
|
4058
|
+
return C(this, Je).href;
|
|
4057
4059
|
}
|
|
4058
4060
|
/**
|
|
4059
4061
|
* Returns true if the credentials mode for connection requests to the URL providing the event stream is set to "include", and false otherwise.
|
|
@@ -4061,28 +4063,28 @@ class dn extends EventTarget {
|
|
|
4061
4063
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/withCredentials)
|
|
4062
4064
|
*/
|
|
4063
4065
|
get withCredentials() {
|
|
4064
|
-
return
|
|
4066
|
+
return C(this, un);
|
|
4065
4067
|
}
|
|
4066
4068
|
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/error_event) */
|
|
4067
4069
|
get onerror() {
|
|
4068
|
-
return
|
|
4070
|
+
return C(this, pt);
|
|
4069
4071
|
}
|
|
4070
4072
|
set onerror(e) {
|
|
4071
4073
|
W(this, pt, e);
|
|
4072
4074
|
}
|
|
4073
4075
|
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/message_event) */
|
|
4074
4076
|
get onmessage() {
|
|
4075
|
-
return
|
|
4077
|
+
return C(this, lt);
|
|
4076
4078
|
}
|
|
4077
4079
|
set onmessage(e) {
|
|
4078
4080
|
W(this, lt, e);
|
|
4079
4081
|
}
|
|
4080
4082
|
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/open_event) */
|
|
4081
4083
|
get onopen() {
|
|
4082
|
-
return
|
|
4084
|
+
return C(this, Ct);
|
|
4083
4085
|
}
|
|
4084
4086
|
set onopen(e) {
|
|
4085
|
-
W(this,
|
|
4087
|
+
W(this, Ct, e);
|
|
4086
4088
|
}
|
|
4087
4089
|
addEventListener(e, n, s) {
|
|
4088
4090
|
const r = n;
|
|
@@ -4100,16 +4102,16 @@ class dn extends EventTarget {
|
|
|
4100
4102
|
* @public
|
|
4101
4103
|
*/
|
|
4102
4104
|
close() {
|
|
4103
|
-
|
|
4105
|
+
C(this, ft) && clearTimeout(C(this, ft)), C(this, re) !== this.CLOSED && (C(this, De) && C(this, De).abort(), W(this, re, this.CLOSED), W(this, De, void 0));
|
|
4104
4106
|
}
|
|
4105
4107
|
}
|
|
4106
|
-
|
|
4108
|
+
re = /* @__PURE__ */ new WeakMap(), Je = /* @__PURE__ */ new WeakMap(), ut = /* @__PURE__ */ new WeakMap(), un = /* @__PURE__ */ new WeakMap(), _n = /* @__PURE__ */ new WeakMap(), Nt = /* @__PURE__ */ new WeakMap(), ft = /* @__PURE__ */ new WeakMap(), Rt = /* @__PURE__ */ new WeakMap(), De = /* @__PURE__ */ new WeakMap(), dt = /* @__PURE__ */ new WeakMap(), pt = /* @__PURE__ */ new WeakMap(), lt = /* @__PURE__ */ new WeakMap(), Ct = /* @__PURE__ */ new WeakMap(), pe = /* @__PURE__ */ new WeakSet(), /**
|
|
4107
4109
|
* Connect to the given URL and start receiving events
|
|
4108
4110
|
*
|
|
4109
4111
|
* @internal
|
|
4110
4112
|
*/
|
|
4111
4113
|
is = function() {
|
|
4112
|
-
W(this,
|
|
4114
|
+
W(this, re, this.CONNECTING), W(this, De, new AbortController()), C(this, _n)(C(this, Je), Ae(this, pe, dr).call(this)).then(C(this, os)).catch(C(this, cs));
|
|
4113
4115
|
}, os = /* @__PURE__ */ new WeakMap(), cs = /* @__PURE__ */ new WeakMap(), /**
|
|
4114
4116
|
* Get request options for the `fetch()` request
|
|
4115
4117
|
*
|
|
@@ -4123,9 +4125,9 @@ dr = function() {
|
|
|
4123
4125
|
// [spec] …will have their mode set to "cors"…
|
|
4124
4126
|
mode: "cors",
|
|
4125
4127
|
redirect: "follow",
|
|
4126
|
-
headers: Ke({ Accept: "text/event-stream" },
|
|
4128
|
+
headers: Ke({ Accept: "text/event-stream" }, C(this, Rt) ? { "Last-Event-ID": C(this, Rt) } : void 0),
|
|
4127
4129
|
cache: "no-store",
|
|
4128
|
-
signal: (t =
|
|
4130
|
+
signal: (t = C(this, De)) == null ? void 0 : t.signal
|
|
4129
4131
|
};
|
|
4130
4132
|
return "window" in globalThis && (e.credentials = this.withCredentials ? "include" : "same-origin"), e;
|
|
4131
4133
|
}, us = /* @__PURE__ */ new WeakMap(), ds = /* @__PURE__ */ new WeakMap(), /**
|
|
@@ -4135,11 +4137,11 @@ dr = function() {
|
|
|
4135
4137
|
* @param code - The HTTP status code, if available
|
|
4136
4138
|
* @internal
|
|
4137
4139
|
*/
|
|
4138
|
-
|
|
4140
|
+
At = function(t, e) {
|
|
4139
4141
|
var n;
|
|
4140
|
-
|
|
4142
|
+
C(this, re) !== this.CLOSED && W(this, re, this.CLOSED);
|
|
4141
4143
|
const s = new cr("error", { code: e, message: t });
|
|
4142
|
-
(n =
|
|
4144
|
+
(n = C(this, pt)) == null || n.call(this, s), this.dispatchEvent(s);
|
|
4143
4145
|
}, /**
|
|
4144
4146
|
* Schedules a reconnection attempt against the EventSource endpoint.
|
|
4145
4147
|
*
|
|
@@ -4149,11 +4151,11 @@ Ct = function(t, e) {
|
|
|
4149
4151
|
*/
|
|
4150
4152
|
ls = function(t, e) {
|
|
4151
4153
|
var n;
|
|
4152
|
-
if (
|
|
4154
|
+
if (C(this, re) === this.CLOSED)
|
|
4153
4155
|
return;
|
|
4154
|
-
W(this,
|
|
4156
|
+
W(this, re, this.CONNECTING);
|
|
4155
4157
|
const s = new cr("error", { code: e, message: t });
|
|
4156
|
-
(n =
|
|
4158
|
+
(n = C(this, pt)) == null || n.call(this, s), this.dispatchEvent(s), W(this, ft, setTimeout(C(this, fs), C(this, Nt)));
|
|
4157
4159
|
}, fs = /* @__PURE__ */ new WeakMap(), /**
|
|
4158
4160
|
* ReadyState representing an EventSource currently trying to connect
|
|
4159
4161
|
*
|
|
@@ -4174,7 +4176,7 @@ function Vo() {
|
|
|
4174
4176
|
const t = "document" in globalThis ? globalThis.document : void 0;
|
|
4175
4177
|
return t && typeof t == "object" && "baseURI" in t && typeof t.baseURI == "string" ? t.baseURI : void 0;
|
|
4176
4178
|
}
|
|
4177
|
-
var Ur = Symbol.for("immer-nothing"), lr = Symbol.for("immer-draftable"),
|
|
4179
|
+
var Ur = Symbol.for("immer-nothing"), lr = Symbol.for("immer-draftable"), ce = Symbol.for("immer-state"), zo = process.env.NODE_ENV !== "production" ? [
|
|
4178
4180
|
// All error codes, starting by 0:
|
|
4179
4181
|
function(t) {
|
|
4180
4182
|
return `The plugin for '${t}' has not been loaded into Immer. To enable the plugin, import and call \`enable${t}()\` when initializing your application.`;
|
|
@@ -4205,7 +4207,7 @@ var Ur = Symbol.for("immer-nothing"), lr = Symbol.for("immer-draftable"), oe = S
|
|
|
4205
4207
|
// Note: if more errors are added, the errorOffset in Patches.ts should be increased
|
|
4206
4208
|
// See Patches.ts for additional errors
|
|
4207
4209
|
] : [];
|
|
4208
|
-
function
|
|
4210
|
+
function ae(t, ...e) {
|
|
4209
4211
|
if (process.env.NODE_ENV !== "production") {
|
|
4210
4212
|
const n = zo[t], s = typeof n == "function" ? n.apply(null, e) : n;
|
|
4211
4213
|
throw new Error(`[Immer] ${s}`);
|
|
@@ -4216,7 +4218,7 @@ function re(t, ...e) {
|
|
|
4216
4218
|
}
|
|
4217
4219
|
var _t = Object.getPrototypeOf;
|
|
4218
4220
|
function bt(t) {
|
|
4219
|
-
return !!t && !!t[
|
|
4221
|
+
return !!t && !!t[ce];
|
|
4220
4222
|
}
|
|
4221
4223
|
function tt(t) {
|
|
4222
4224
|
var e;
|
|
@@ -4233,19 +4235,19 @@ function Vr(t) {
|
|
|
4233
4235
|
return n === Object ? !0 : typeof n == "function" && Function.toString.call(n) === Ko;
|
|
4234
4236
|
}
|
|
4235
4237
|
function bn(t, e) {
|
|
4236
|
-
|
|
4238
|
+
xn(t) === 0 ? Reflect.ownKeys(t).forEach((n) => {
|
|
4237
4239
|
e(n, t[n], t);
|
|
4238
4240
|
}) : t.forEach((n, s) => e(s, n, t));
|
|
4239
4241
|
}
|
|
4240
|
-
function
|
|
4241
|
-
const e = t[
|
|
4242
|
+
function xn(t) {
|
|
4243
|
+
const e = t[ce];
|
|
4242
4244
|
return e ? e.type_ : Array.isArray(t) ? 1 : Sn(t) ? 2 : On(t) ? 3 : 0;
|
|
4243
4245
|
}
|
|
4244
4246
|
function hs(t, e) {
|
|
4245
|
-
return
|
|
4247
|
+
return xn(t) === 2 ? t.has(e) : Object.prototype.hasOwnProperty.call(t, e);
|
|
4246
4248
|
}
|
|
4247
4249
|
function zr(t, e, n) {
|
|
4248
|
-
const s =
|
|
4250
|
+
const s = xn(t);
|
|
4249
4251
|
s === 2 ? t.set(e, n) : s === 3 ? t.add(n) : t[e] = n;
|
|
4250
4252
|
}
|
|
4251
4253
|
function Bo(t, e) {
|
|
@@ -4270,7 +4272,7 @@ function ps(t, e) {
|
|
|
4270
4272
|
const n = Vr(t);
|
|
4271
4273
|
if (e === !0 || e === "class_only" && !n) {
|
|
4272
4274
|
const s = Object.getOwnPropertyDescriptors(t);
|
|
4273
|
-
delete s[
|
|
4275
|
+
delete s[ce];
|
|
4274
4276
|
let r = Reflect.ownKeys(s);
|
|
4275
4277
|
for (let a = 0; a < r.length; a++) {
|
|
4276
4278
|
const i = r[a], o = s[i];
|
|
@@ -4292,10 +4294,10 @@ function ps(t, e) {
|
|
|
4292
4294
|
}
|
|
4293
4295
|
}
|
|
4294
4296
|
function Kt(t, e = !1) {
|
|
4295
|
-
return Tn(t) || bt(t) || !tt(t) || (
|
|
4297
|
+
return Tn(t) || bt(t) || !tt(t) || (xn(t) > 1 && (t.set = t.add = t.clear = t.delete = qo), Object.freeze(t), e && Object.entries(t).forEach(([n, s]) => Kt(s, !0))), t;
|
|
4296
4298
|
}
|
|
4297
4299
|
function qo() {
|
|
4298
|
-
|
|
4300
|
+
ae(2);
|
|
4299
4301
|
}
|
|
4300
4302
|
function Tn(t) {
|
|
4301
4303
|
return Object.isFrozen(t);
|
|
@@ -4303,7 +4305,7 @@ function Tn(t) {
|
|
|
4303
4305
|
var Ho = {};
|
|
4304
4306
|
function nt(t) {
|
|
4305
4307
|
const e = Ho[t];
|
|
4306
|
-
return e ||
|
|
4308
|
+
return e || ae(0, t), e;
|
|
4307
4309
|
}
|
|
4308
4310
|
var Bt;
|
|
4309
4311
|
function Kr() {
|
|
@@ -4333,14 +4335,14 @@ function hr(t) {
|
|
|
4333
4335
|
return Bt = Go(Bt, t);
|
|
4334
4336
|
}
|
|
4335
4337
|
function Jo(t) {
|
|
4336
|
-
const e = t[
|
|
4338
|
+
const e = t[ce];
|
|
4337
4339
|
e.type_ === 0 || e.type_ === 1 ? e.revoke_() : e.revoked_ = !0;
|
|
4338
4340
|
}
|
|
4339
4341
|
function pr(t, e) {
|
|
4340
4342
|
e.unfinalizedDrafts_ = e.drafts_.length;
|
|
4341
4343
|
const n = e.drafts_[0];
|
|
4342
|
-
return t !== void 0 && t !== n ? (n[
|
|
4343
|
-
n[
|
|
4344
|
+
return t !== void 0 && t !== n ? (n[ce].modified_ && (ms(e), ae(4)), tt(t) && (t = wn(e, t), e.parent_ || kn(e, t)), e.patches_ && nt("Patches").generateReplacementPatches_(
|
|
4345
|
+
n[ce].base_,
|
|
4344
4346
|
t,
|
|
4345
4347
|
e.patches_,
|
|
4346
4348
|
e.inversePatches_
|
|
@@ -4349,7 +4351,7 @@ function pr(t, e) {
|
|
|
4349
4351
|
function wn(t, e, n) {
|
|
4350
4352
|
if (Tn(e))
|
|
4351
4353
|
return e;
|
|
4352
|
-
const s = e[
|
|
4354
|
+
const s = e[ce];
|
|
4353
4355
|
if (!s)
|
|
4354
4356
|
return bn(
|
|
4355
4357
|
e,
|
|
@@ -4376,7 +4378,7 @@ function wn(t, e, n) {
|
|
|
4376
4378
|
return s.copy_;
|
|
4377
4379
|
}
|
|
4378
4380
|
function mr(t, e, n, s, r, a, i) {
|
|
4379
|
-
if (process.env.NODE_ENV !== "production" && r === n &&
|
|
4381
|
+
if (process.env.NODE_ENV !== "production" && r === n && ae(5), bt(r)) {
|
|
4380
4382
|
const o = a && e && e.type_ !== 3 && // Set objects are atomic since they have no keys.
|
|
4381
4383
|
!hs(e.assigned_, s) ? a.concat(s) : void 0, c = wn(t, r, o);
|
|
4382
4384
|
if (zr(n, s, c), bt(c))
|
|
@@ -4424,7 +4426,7 @@ function Xo(t, e) {
|
|
|
4424
4426
|
}
|
|
4425
4427
|
var Ps = {
|
|
4426
4428
|
get(t, e) {
|
|
4427
|
-
if (e ===
|
|
4429
|
+
if (e === ce)
|
|
4428
4430
|
return t;
|
|
4429
4431
|
const n = qe(t);
|
|
4430
4432
|
if (!hs(n, e))
|
|
@@ -4443,7 +4445,7 @@ var Ps = {
|
|
|
4443
4445
|
if (s != null && s.set)
|
|
4444
4446
|
return s.set.call(t.draft_, n), !0;
|
|
4445
4447
|
if (!t.modified_) {
|
|
4446
|
-
const r = Dn(qe(t), e), a = r == null ? void 0 : r[
|
|
4448
|
+
const r = Dn(qe(t), e), a = r == null ? void 0 : r[ce];
|
|
4447
4449
|
if (a && a.base_ === n)
|
|
4448
4450
|
return t.copy_[e] = n, t.assigned_[e] = !1, !0;
|
|
4449
4451
|
if (Bo(n, r) && (n !== void 0 || hs(t.base_, e)))
|
|
@@ -4469,13 +4471,13 @@ var Ps = {
|
|
|
4469
4471
|
};
|
|
4470
4472
|
},
|
|
4471
4473
|
defineProperty() {
|
|
4472
|
-
|
|
4474
|
+
ae(11);
|
|
4473
4475
|
},
|
|
4474
4476
|
getPrototypeOf(t) {
|
|
4475
4477
|
return _t(t.base_);
|
|
4476
4478
|
},
|
|
4477
4479
|
setPrototypeOf() {
|
|
4478
|
-
|
|
4480
|
+
ae(12);
|
|
4479
4481
|
}
|
|
4480
4482
|
}, qt = {};
|
|
4481
4483
|
bn(Ps, (t, e) => {
|
|
@@ -4484,13 +4486,13 @@ bn(Ps, (t, e) => {
|
|
|
4484
4486
|
};
|
|
4485
4487
|
});
|
|
4486
4488
|
qt.deleteProperty = function(t, e) {
|
|
4487
|
-
return process.env.NODE_ENV !== "production" && isNaN(parseInt(e)) &&
|
|
4489
|
+
return process.env.NODE_ENV !== "production" && isNaN(parseInt(e)) && ae(13), qt.set.call(this, t, e, void 0);
|
|
4488
4490
|
};
|
|
4489
4491
|
qt.set = function(t, e, n) {
|
|
4490
|
-
return process.env.NODE_ENV !== "production" && e !== "length" && isNaN(parseInt(e)) &&
|
|
4492
|
+
return process.env.NODE_ENV !== "production" && e !== "length" && isNaN(parseInt(e)) && ae(14), Ps.set.call(this, t[0], e, n, t[0]);
|
|
4491
4493
|
};
|
|
4492
4494
|
function Dn(t, e) {
|
|
4493
|
-
const n = t[
|
|
4495
|
+
const n = t[ce];
|
|
4494
4496
|
return (n ? qe(n) : t)[e];
|
|
4495
4497
|
}
|
|
4496
4498
|
function Yo(t, e, n) {
|
|
@@ -4533,7 +4535,7 @@ var Qo = class {
|
|
|
4533
4535
|
return i.produce(c, (h) => n.call(this, h, ...u));
|
|
4534
4536
|
};
|
|
4535
4537
|
}
|
|
4536
|
-
typeof n != "function" &&
|
|
4538
|
+
typeof n != "function" && ae(6), s !== void 0 && typeof s != "function" && ae(7);
|
|
4537
4539
|
let r;
|
|
4538
4540
|
if (tt(e)) {
|
|
4539
4541
|
const a = hr(this), i = vs(e, void 0);
|
|
@@ -4551,7 +4553,7 @@ var Qo = class {
|
|
|
4551
4553
|
}
|
|
4552
4554
|
return r;
|
|
4553
4555
|
} else
|
|
4554
|
-
|
|
4556
|
+
ae(1, e);
|
|
4555
4557
|
}, this.produceWithPatches = (e, n) => {
|
|
4556
4558
|
if (typeof e == "function")
|
|
4557
4559
|
return (i, ...o) => this.produceWithPatches(i, (c) => e(c, ...o));
|
|
@@ -4562,13 +4564,13 @@ var Qo = class {
|
|
|
4562
4564
|
}, typeof (t == null ? void 0 : t.autoFreeze) == "boolean" && this.setAutoFreeze(t.autoFreeze), typeof (t == null ? void 0 : t.useStrictShallowCopy) == "boolean" && this.setUseStrictShallowCopy(t.useStrictShallowCopy);
|
|
4563
4565
|
}
|
|
4564
4566
|
createDraft(t) {
|
|
4565
|
-
tt(t) ||
|
|
4567
|
+
tt(t) || ae(8), bt(t) && (t = ec(t));
|
|
4566
4568
|
const e = hr(this), n = vs(t, void 0);
|
|
4567
|
-
return n[
|
|
4569
|
+
return n[ce].isManual_ = !0, ys(e), n;
|
|
4568
4570
|
}
|
|
4569
4571
|
finishDraft(t, e) {
|
|
4570
|
-
const n = t && t[
|
|
4571
|
-
(!n || !n.isManual_) &&
|
|
4572
|
+
const n = t && t[ce];
|
|
4573
|
+
(!n || !n.isManual_) && ae(9);
|
|
4572
4574
|
const { scope_: s } = n;
|
|
4573
4575
|
return fr(s, e), pr(void 0, s);
|
|
4574
4576
|
}
|
|
@@ -4610,12 +4612,12 @@ function vs(t, e) {
|
|
|
4610
4612
|
return (e ? e.scope_ : Kr()).drafts_.push(n), n;
|
|
4611
4613
|
}
|
|
4612
4614
|
function ec(t) {
|
|
4613
|
-
return bt(t) ||
|
|
4615
|
+
return bt(t) || ae(10, t), qr(t);
|
|
4614
4616
|
}
|
|
4615
4617
|
function qr(t) {
|
|
4616
4618
|
if (!tt(t) || Tn(t))
|
|
4617
4619
|
return t;
|
|
4618
|
-
const e = t[
|
|
4620
|
+
const e = t[ce];
|
|
4619
4621
|
let n;
|
|
4620
4622
|
if (e) {
|
|
4621
4623
|
if (!e.modified_)
|
|
@@ -4627,15 +4629,15 @@ function qr(t) {
|
|
|
4627
4629
|
zr(n, s, qr(r));
|
|
4628
4630
|
}), e && (e.finalized_ = !1), n;
|
|
4629
4631
|
}
|
|
4630
|
-
var
|
|
4631
|
-
|
|
4632
|
-
|
|
4632
|
+
var ue = new Qo(), tc = ue.produce;
|
|
4633
|
+
ue.produceWithPatches.bind(
|
|
4634
|
+
ue
|
|
4633
4635
|
);
|
|
4634
|
-
|
|
4635
|
-
|
|
4636
|
-
|
|
4637
|
-
|
|
4638
|
-
|
|
4636
|
+
ue.setAutoFreeze.bind(ue);
|
|
4637
|
+
ue.setUseStrictShallowCopy.bind(ue);
|
|
4638
|
+
ue.applyPatches.bind(ue);
|
|
4639
|
+
ue.createDraft.bind(ue);
|
|
4640
|
+
ue.finishDraft.bind(ue);
|
|
4639
4641
|
function nc(t) {
|
|
4640
4642
|
var e = la(function() {
|
|
4641
4643
|
return Kt(typeof t == "function" ? t() : t, !0);
|
|
@@ -4691,14 +4693,14 @@ const yr = 10, gr = {
|
|
|
4691
4693
|
const b = {};
|
|
4692
4694
|
c.addEventListener("start", (_) => {
|
|
4693
4695
|
const l = JSON.parse(_.data);
|
|
4694
|
-
b.sessionId = l.sessionId, s((
|
|
4695
|
-
|
|
4696
|
+
b.sessionId = l.sessionId, s((A) => {
|
|
4697
|
+
A.tasks.fetchDesign.status = "running";
|
|
4696
4698
|
});
|
|
4697
4699
|
}), c.addEventListener("pre_codegen", (_) => {
|
|
4698
4700
|
JSON.parse(
|
|
4699
4701
|
_.data
|
|
4700
|
-
).message === "Anima model built" && s((
|
|
4701
|
-
|
|
4702
|
+
).message === "Anima model built" && s((A) => {
|
|
4703
|
+
A.tasks.fetchDesign.status = "finished", A.tasks.codeGeneration.status = "running", A.tasks.uploadAssets.status = "running";
|
|
4702
4704
|
});
|
|
4703
4705
|
}), c.addEventListener("figma_metadata", (_) => {
|
|
4704
4706
|
const l = JSON.parse(
|
|
@@ -4717,8 +4719,8 @@ const yr = 10, gr = {
|
|
|
4717
4719
|
const l = JSON.parse(
|
|
4718
4720
|
_.data
|
|
4719
4721
|
);
|
|
4720
|
-
l.payload.status === "success" && (b.files = l.payload.files), s((
|
|
4721
|
-
|
|
4722
|
+
l.payload.status === "success" && (b.files = l.payload.files), s((A) => {
|
|
4723
|
+
A.tasks.codeGeneration.progress = l.payload.progress, A.tasks.codeGeneration.status = "running";
|
|
4722
4724
|
});
|
|
4723
4725
|
}), c.addEventListener("codegen_completed", () => {
|
|
4724
4726
|
s((_) => {
|
|
@@ -4740,34 +4742,44 @@ const yr = 10, gr = {
|
|
|
4740
4742
|
});
|
|
4741
4743
|
let m = 0;
|
|
4742
4744
|
c.addEventListener("error", (_) => Ie(void 0, null, function* () {
|
|
4743
|
-
var
|
|
4745
|
+
var V, D, M;
|
|
4744
4746
|
console.warn(
|
|
4745
4747
|
`Experienced error during code generation (attempt ${m + 1} / ${yr})`,
|
|
4746
4748
|
_
|
|
4747
4749
|
);
|
|
4748
|
-
let l,
|
|
4750
|
+
let l, A, I = !1;
|
|
4749
4751
|
try {
|
|
4750
|
-
_ instanceof MessageEvent
|
|
4751
|
-
|
|
4752
|
+
if (_ instanceof MessageEvent)
|
|
4753
|
+
l = JSON.parse(_.data);
|
|
4754
|
+
else {
|
|
4755
|
+
const G = yield o;
|
|
4756
|
+
A = G.status;
|
|
4757
|
+
try {
|
|
4758
|
+
l = yield G.json();
|
|
4759
|
+
} catch ($) {
|
|
4760
|
+
}
|
|
4761
|
+
}
|
|
4762
|
+
(((V = l == null ? void 0 : l.payload) == null ? void 0 : V.name) === "Task Crashed" || A === 429) && (I = !0);
|
|
4763
|
+
} catch (G) {
|
|
4752
4764
|
}
|
|
4753
|
-
const
|
|
4754
|
-
name: (
|
|
4755
|
-
reason: (
|
|
4765
|
+
const K = new Gs({
|
|
4766
|
+
name: (D = l == null ? void 0 : l.payload.name) != null ? D : "Unknown error",
|
|
4767
|
+
reason: (M = l == null ? void 0 : l.payload.message) != null ? M : "Unknown",
|
|
4756
4768
|
status: l == null ? void 0 : l.payload.status,
|
|
4757
4769
|
detail: l == null ? void 0 : l.payload.detail
|
|
4758
4770
|
});
|
|
4759
4771
|
m++;
|
|
4760
|
-
let
|
|
4761
|
-
m > yr ? (console.error("Experienced too many errors, terminating request"),
|
|
4762
|
-
|
|
4772
|
+
let Z = !1;
|
|
4773
|
+
m > yr ? (console.error("Experienced too many errors, terminating request"), Z = !0) : I && (console.error("Experienced unrecoverable error, terminating request"), Z = !0), Z && (s((G) => {
|
|
4774
|
+
G.status = "error", G.error = K;
|
|
4763
4775
|
}), g({
|
|
4764
4776
|
result: null,
|
|
4765
|
-
error:
|
|
4777
|
+
error: K
|
|
4766
4778
|
}));
|
|
4767
4779
|
})), c.addEventListener("done", (_) => {
|
|
4768
4780
|
const l = JSON.parse(_.data);
|
|
4769
|
-
b.tokenUsage = l.payload.tokenUsage, b.sessionId = l.payload.sessionId, s((
|
|
4770
|
-
|
|
4781
|
+
b.tokenUsage = l.payload.tokenUsage, b.sessionId = l.payload.sessionId, s((A) => {
|
|
4782
|
+
A.status = "success", A.result = b;
|
|
4771
4783
|
}), g({ result: b, error: null });
|
|
4772
4784
|
});
|
|
4773
4785
|
});
|
|
@@ -4777,20 +4789,20 @@ const yr = 10, gr = {
|
|
|
4777
4789
|
const { filePath: _ } = vr(
|
|
4778
4790
|
i.assetsStorage
|
|
4779
4791
|
), l = m.assets.map((I) => Ie(void 0, null, function* () {
|
|
4780
|
-
const
|
|
4792
|
+
const Z = yield (yield fetch(I.url)).arrayBuffer();
|
|
4781
4793
|
return {
|
|
4782
4794
|
assetName: I.name,
|
|
4783
|
-
base64: va(
|
|
4795
|
+
base64: va(Z)
|
|
4784
4796
|
};
|
|
4785
|
-
})),
|
|
4786
|
-
for (const I of
|
|
4787
|
-
const
|
|
4797
|
+
})), A = yield Promise.allSettled(l);
|
|
4798
|
+
for (const I of A) {
|
|
4799
|
+
const K = {};
|
|
4788
4800
|
if (I.status === "fulfilled") {
|
|
4789
|
-
const { assetName:
|
|
4790
|
-
|
|
4791
|
-
const D = _ ? `${_}/${
|
|
4801
|
+
const { assetName: Z, base64: V } = I.value;
|
|
4802
|
+
K[Z] = V;
|
|
4803
|
+
const D = _ ? `${_}/${Z}` : Z;
|
|
4792
4804
|
m.files[D] = {
|
|
4793
|
-
content:
|
|
4805
|
+
content: V,
|
|
4794
4806
|
isBinary: !0
|
|
4795
4807
|
};
|
|
4796
4808
|
}
|
|
@@ -4888,16 +4900,16 @@ function rc() {
|
|
|
4888
4900
|
_ = i({
|
|
4889
4901
|
inst: { value: m, getSnapshot: b }
|
|
4890
4902
|
});
|
|
4891
|
-
var l = _[0].inst,
|
|
4903
|
+
var l = _[0].inst, A = _[1];
|
|
4892
4904
|
return c(
|
|
4893
4905
|
function() {
|
|
4894
|
-
l.value = m, l.getSnapshot = b, n(l) &&
|
|
4906
|
+
l.value = m, l.getSnapshot = b, n(l) && A({ inst: l });
|
|
4895
4907
|
},
|
|
4896
4908
|
[g, m, b]
|
|
4897
4909
|
), o(
|
|
4898
4910
|
function() {
|
|
4899
|
-
return n(l) &&
|
|
4900
|
-
n(l) &&
|
|
4911
|
+
return n(l) && A({ inst: l }), g(function() {
|
|
4912
|
+
n(l) && A({ inst: l });
|
|
4901
4913
|
});
|
|
4902
4914
|
},
|
|
4903
4915
|
[g]
|
|
@@ -4927,7 +4939,7 @@ function ac() {
|
|
|
4927
4939
|
}
|
|
4928
4940
|
var ic = ac();
|
|
4929
4941
|
const Hr = 0, Gr = 1, Jr = 2, kr = 3;
|
|
4930
|
-
var
|
|
4942
|
+
var Er = Object.prototype.hasOwnProperty;
|
|
4931
4943
|
function _s(t, e) {
|
|
4932
4944
|
var n, s;
|
|
4933
4945
|
if (t === e) return !0;
|
|
@@ -4942,17 +4954,17 @@ function _s(t, e) {
|
|
|
4942
4954
|
if (!n || typeof t == "object") {
|
|
4943
4955
|
s = 0;
|
|
4944
4956
|
for (n in t)
|
|
4945
|
-
if (
|
|
4957
|
+
if (Er.call(t, n) && ++s && !Er.call(e, n) || !(n in e) || !_s(t[n], e[n])) return !1;
|
|
4946
4958
|
return Object.keys(e).length === s;
|
|
4947
4959
|
}
|
|
4948
4960
|
}
|
|
4949
4961
|
return t !== t && e !== e;
|
|
4950
4962
|
}
|
|
4951
4963
|
const Re = /* @__PURE__ */ new WeakMap(), Me = () => {
|
|
4952
|
-
},
|
|
4964
|
+
}, te = (
|
|
4953
4965
|
/*#__NOINLINE__*/
|
|
4954
4966
|
Me()
|
|
4955
|
-
), bs = Object, R = (t) => t ===
|
|
4967
|
+
), bs = Object, R = (t) => t === te, we = (t) => typeof t == "function", Ue = (t, e) => Ke(Ke({}, t), e), Xr = (t) => we(t.then), Fn = {}, nn = {}, Is = "undefined", Xt = typeof window != Is, ws = typeof document != Is, oc = Xt && "Deno" in window, cc = () => Xt && typeof window.requestAnimationFrame != Is, Yr = (t, e) => {
|
|
4956
4968
|
const n = Re.get(t);
|
|
4957
4969
|
return [
|
|
4958
4970
|
// Getter
|
|
@@ -4971,7 +4983,7 @@ const Re = /* @__PURE__ */ new WeakMap(), Me = () => {
|
|
|
4971
4983
|
];
|
|
4972
4984
|
};
|
|
4973
4985
|
let ks = !0;
|
|
4974
|
-
const uc = () => ks, [
|
|
4986
|
+
const uc = () => ks, [Es, xs] = Xt && window.addEventListener ? [
|
|
4975
4987
|
window.addEventListener.bind(window),
|
|
4976
4988
|
window.removeEventListener.bind(window)
|
|
4977
4989
|
] : [
|
|
@@ -4980,16 +4992,16 @@ const uc = () => ks, [xs, Es] = Xt && window.addEventListener ? [
|
|
|
4980
4992
|
], dc = () => {
|
|
4981
4993
|
const t = ws && document.visibilityState;
|
|
4982
4994
|
return R(t) || t !== "hidden";
|
|
4983
|
-
}, lc = (t) => (ws && document.addEventListener("visibilitychange", t),
|
|
4984
|
-
ws && document.removeEventListener("visibilitychange", t),
|
|
4995
|
+
}, lc = (t) => (ws && document.addEventListener("visibilitychange", t), Es("focus", t), () => {
|
|
4996
|
+
ws && document.removeEventListener("visibilitychange", t), xs("focus", t);
|
|
4985
4997
|
}), fc = (t) => {
|
|
4986
4998
|
const e = () => {
|
|
4987
4999
|
ks = !0, t();
|
|
4988
5000
|
}, n = () => {
|
|
4989
5001
|
ks = !1;
|
|
4990
5002
|
};
|
|
4991
|
-
return
|
|
4992
|
-
|
|
5003
|
+
return Es("online", e), Es("offline", n), () => {
|
|
5004
|
+
xs("online", e), xs("offline", n);
|
|
4993
5005
|
};
|
|
4994
5006
|
}, hc = {
|
|
4995
5007
|
isOnline: uc,
|
|
@@ -4997,7 +5009,7 @@ const uc = () => ks, [xs, Es] = Xt && window.addEventListener ? [
|
|
|
4997
5009
|
}, pc = {
|
|
4998
5010
|
initFocus: lc,
|
|
4999
5011
|
initReconnect: fc
|
|
5000
|
-
},
|
|
5012
|
+
}, xr = !Gt.useId, Ht = !Xt || oc, mc = (t) => cc() ? window.requestAnimationFrame(t) : setTimeout(t, 1), Wn = Ht ? ha : pa, Un = typeof navigator != "undefined" && navigator.connection, Sr = !Ht && Un && ([
|
|
5001
5013
|
"slow-2g",
|
|
5002
5014
|
"2g"
|
|
5003
5015
|
].includes(Un.effectiveType) || Un.saveData), sn = /* @__PURE__ */ new WeakMap(), Vn = (t, e) => bs.prototype.toString.call(t) === `[object ${e}]`;
|
|
@@ -5023,7 +5035,7 @@ const Ss = (t) => {
|
|
|
5023
5035
|
a = n ? t.toJSON() : e == "symbol" ? t.toString() : e == "string" ? JSON.stringify(t) : "" + t;
|
|
5024
5036
|
return a;
|
|
5025
5037
|
}, js = (t) => {
|
|
5026
|
-
if (
|
|
5038
|
+
if (we(t))
|
|
5027
5039
|
try {
|
|
5028
5040
|
t = t();
|
|
5029
5041
|
} catch (n) {
|
|
@@ -5049,7 +5061,7 @@ function Qr(...t) {
|
|
|
5049
5061
|
const o = a.rollbackOnError;
|
|
5050
5062
|
let c = a.optimisticData;
|
|
5051
5063
|
const u = (k) => typeof o == "function" ? o(k) : o !== !1, h = a.throwOnError;
|
|
5052
|
-
if (
|
|
5064
|
+
if (we(n)) {
|
|
5053
5065
|
const k = n, g = [], b = e.keys();
|
|
5054
5066
|
for (const m of b)
|
|
5055
5067
|
// Skip the special useSWRInfinite and useSWRSubscription keys.
|
|
@@ -5061,61 +5073,61 @@ function Qr(...t) {
|
|
|
5061
5073
|
return Ie(this, null, function* () {
|
|
5062
5074
|
const [g] = js(k);
|
|
5063
5075
|
if (!g) return;
|
|
5064
|
-
const [b, m] = Yr(e, g), [_, l,
|
|
5065
|
-
const
|
|
5066
|
-
return (
|
|
5076
|
+
const [b, m] = Yr(e, g), [_, l, A, I] = Re.get(e), K = () => {
|
|
5077
|
+
const fe = _[g];
|
|
5078
|
+
return (we(a.revalidate) ? a.revalidate(b().data, k) : a.revalidate !== !1) && (delete A[g], delete I[g], fe && fe[0]) ? fe[0](Jr).then(() => b().data) : b().data;
|
|
5067
5079
|
};
|
|
5068
5080
|
if (t.length < 3)
|
|
5069
|
-
return
|
|
5070
|
-
let
|
|
5081
|
+
return K();
|
|
5082
|
+
let Z = s, V;
|
|
5071
5083
|
const D = Os();
|
|
5072
5084
|
l[g] = [
|
|
5073
5085
|
D,
|
|
5074
5086
|
0
|
|
5075
5087
|
];
|
|
5076
|
-
const
|
|
5077
|
-
if (
|
|
5088
|
+
const M = !R(c), G = b(), $ = G.data, st = G._c, Ve = R(st) ? $ : st;
|
|
5089
|
+
if (M && (c = we(c) ? c(Ve, $) : c, m({
|
|
5078
5090
|
data: c,
|
|
5079
5091
|
_c: Ve
|
|
5080
|
-
})),
|
|
5092
|
+
})), we(Z))
|
|
5081
5093
|
try {
|
|
5082
|
-
|
|
5083
|
-
} catch (
|
|
5084
|
-
|
|
5094
|
+
Z = Z(Ve);
|
|
5095
|
+
} catch (fe) {
|
|
5096
|
+
V = fe;
|
|
5085
5097
|
}
|
|
5086
|
-
if (
|
|
5087
|
-
if (
|
|
5088
|
-
|
|
5098
|
+
if (Z && Xr(Z))
|
|
5099
|
+
if (Z = yield Z.catch((fe) => {
|
|
5100
|
+
V = fe;
|
|
5089
5101
|
}), D !== l[g][0]) {
|
|
5090
|
-
if (
|
|
5091
|
-
return
|
|
5092
|
-
} else
|
|
5102
|
+
if (V) throw V;
|
|
5103
|
+
return Z;
|
|
5104
|
+
} else V && M && u(V) && (i = !0, m({
|
|
5093
5105
|
data: Ve,
|
|
5094
|
-
_c:
|
|
5106
|
+
_c: te
|
|
5095
5107
|
}));
|
|
5096
|
-
if (i && !
|
|
5097
|
-
if (
|
|
5098
|
-
const
|
|
5108
|
+
if (i && !V)
|
|
5109
|
+
if (we(i)) {
|
|
5110
|
+
const fe = i(Z, Ve);
|
|
5099
5111
|
m({
|
|
5100
|
-
data:
|
|
5101
|
-
error:
|
|
5102
|
-
_c:
|
|
5112
|
+
data: fe,
|
|
5113
|
+
error: te,
|
|
5114
|
+
_c: te
|
|
5103
5115
|
});
|
|
5104
5116
|
} else
|
|
5105
5117
|
m({
|
|
5106
|
-
data:
|
|
5107
|
-
error:
|
|
5108
|
-
_c:
|
|
5118
|
+
data: Z,
|
|
5119
|
+
error: te,
|
|
5120
|
+
_c: te
|
|
5109
5121
|
});
|
|
5110
|
-
if (l[g][1] = Os(), Promise.resolve(
|
|
5122
|
+
if (l[g][1] = Os(), Promise.resolve(K()).then(() => {
|
|
5111
5123
|
m({
|
|
5112
|
-
_c:
|
|
5124
|
+
_c: te
|
|
5113
5125
|
});
|
|
5114
|
-
}),
|
|
5115
|
-
if (h) throw
|
|
5126
|
+
}), V) {
|
|
5127
|
+
if (h) throw V;
|
|
5116
5128
|
return;
|
|
5117
5129
|
}
|
|
5118
|
-
return
|
|
5130
|
+
return Z;
|
|
5119
5131
|
});
|
|
5120
5132
|
}
|
|
5121
5133
|
});
|
|
@@ -5125,7 +5137,7 @@ const Or = (t, e) => {
|
|
|
5125
5137
|
t[n][0] && t[n][0](e);
|
|
5126
5138
|
}, vc = (t, e) => {
|
|
5127
5139
|
if (!Re.has(t)) {
|
|
5128
|
-
const n = Ue(pc, e), s = /* @__PURE__ */ Object.create(null), r = Qr.bind(
|
|
5140
|
+
const n = Ue(pc, e), s = /* @__PURE__ */ Object.create(null), r = Qr.bind(te, t);
|
|
5129
5141
|
let a = Me;
|
|
5130
5142
|
const i = /* @__PURE__ */ Object.create(null), o = (h, p) => {
|
|
5131
5143
|
const k = i[h] || [];
|
|
@@ -5146,7 +5158,7 @@ const Or = (t, e) => {
|
|
|
5146
5158
|
c,
|
|
5147
5159
|
o
|
|
5148
5160
|
]), !Ht)) {
|
|
5149
|
-
const h = n.initFocus(setTimeout.bind(
|
|
5161
|
+
const h = n.initFocus(setTimeout.bind(te, Or.bind(te, s, Hr))), p = n.initReconnect(setTimeout.bind(te, Or.bind(te, s, Gr)));
|
|
5150
5162
|
a = () => {
|
|
5151
5163
|
h && h(), p && p(), Re.delete(t);
|
|
5152
5164
|
};
|
|
@@ -5193,16 +5205,16 @@ const Or = (t, e) => {
|
|
|
5193
5205
|
},
|
|
5194
5206
|
// use web preset by default
|
|
5195
5207
|
hc
|
|
5196
|
-
),
|
|
5208
|
+
), Ec = (t, e) => {
|
|
5197
5209
|
const n = Ue(t, e);
|
|
5198
5210
|
if (e) {
|
|
5199
5211
|
const { use: s, fallback: r } = t, { use: a, fallback: i } = e;
|
|
5200
5212
|
s && a && (n.use = s.concat(a)), r && i && (n.fallback = Ue(r, i));
|
|
5201
5213
|
}
|
|
5202
5214
|
return n;
|
|
5203
|
-
},
|
|
5215
|
+
}, xc = fa({}), Sc = "$inf$", ta = Xt && window.__SWR_DEVTOOLS_USE__, Oc = ta ? window.__SWR_DEVTOOLS_USE__ : [], Tc = () => {
|
|
5204
5216
|
ta && (window.__SWR_DEVTOOLS_REACT__ = Gt);
|
|
5205
|
-
},
|
|
5217
|
+
}, Cc = (t) => we(t[1]) ? [
|
|
5206
5218
|
t[0],
|
|
5207
5219
|
t[1],
|
|
5208
5220
|
t[2] || {}
|
|
@@ -5210,14 +5222,14 @@ const Or = (t, e) => {
|
|
|
5210
5222
|
t[0],
|
|
5211
5223
|
null,
|
|
5212
5224
|
(t[1] === null ? t[2] : t[1]) || {}
|
|
5213
|
-
],
|
|
5225
|
+
], Ac = () => Ue(kc, ma(xc)), Nc = (t) => (e, n, s) => t(e, n && ((...a) => {
|
|
5214
5226
|
const [i] = js(e), [, , , o] = Re.get(ea);
|
|
5215
5227
|
if (i.startsWith(Sc))
|
|
5216
5228
|
return n(...a);
|
|
5217
5229
|
const c = o[i];
|
|
5218
5230
|
return R(c) ? n(...a) : (delete o[i], c);
|
|
5219
5231
|
}), s), Rc = Oc.concat(Nc), Pc = (t) => function(...n) {
|
|
5220
|
-
const s =
|
|
5232
|
+
const s = Ac(), [r, a, i] = Cc(n), o = Ec(s, i);
|
|
5221
5233
|
let c = t;
|
|
5222
5234
|
const { use: u } = o, h = (u || []).concat(Rc);
|
|
5223
5235
|
for (let p = h.length; p--; )
|
|
@@ -5253,29 +5265,29 @@ const zn = Gt.use || // This extra generic is to avoid TypeScript mixing up the
|
|
|
5253
5265
|
}), Kn = {
|
|
5254
5266
|
dedupe: !0
|
|
5255
5267
|
}, jc = (t, e, n) => {
|
|
5256
|
-
const { cache: s, compare: r, suspense: a, fallbackData: i, revalidateOnMount: o, revalidateIfStale: c, refreshInterval: u, refreshWhenHidden: h, refreshWhenOffline: p, keepPreviousData: k } = n, [g, b, m, _] = Re.get(s), [l,
|
|
5257
|
-
for (const
|
|
5258
|
-
const
|
|
5259
|
-
if (
|
|
5260
|
-
if (!r(
|
|
5268
|
+
const { cache: s, compare: r, suspense: a, fallbackData: i, revalidateOnMount: o, revalidateIfStale: c, refreshInterval: u, refreshWhenHidden: h, refreshWhenOffline: p, keepPreviousData: k } = n, [g, b, m, _] = Re.get(s), [l, A] = js(t), I = Be(!1), K = Be(!1), Z = Be(l), V = Be(e), D = Be(n), M = () => D.current, G = () => M().isVisible() && M().isOnline(), [$, st, Ve, fe] = Yr(s, l), rt = Be({}).current, Yt = R(i) ? R(n.fallback) ? te : n.fallback[l] : i, Zs = (F, L) => {
|
|
5269
|
+
for (const J in rt) {
|
|
5270
|
+
const z = J;
|
|
5271
|
+
if (z === "data") {
|
|
5272
|
+
if (!r(F[z], L[z]) && (!R(F[z]) || !r(en, L[z])))
|
|
5261
5273
|
return !1;
|
|
5262
|
-
} else if (L[
|
|
5274
|
+
} else if (L[z] !== F[z])
|
|
5263
5275
|
return !1;
|
|
5264
5276
|
}
|
|
5265
5277
|
return !0;
|
|
5266
5278
|
}, Ds = ya(() => {
|
|
5267
|
-
const
|
|
5268
|
-
const Oe = Ue(
|
|
5269
|
-
return delete Oe._k,
|
|
5279
|
+
const F = !l || !e ? !1 : R(o) ? M().isPaused() || a ? !1 : c !== !1 : o, L = (Q) => {
|
|
5280
|
+
const Oe = Ue(Q);
|
|
5281
|
+
return delete Oe._k, F ? Ke({
|
|
5270
5282
|
isValidating: !0,
|
|
5271
5283
|
isLoading: !0
|
|
5272
5284
|
}, Oe) : Oe;
|
|
5273
|
-
},
|
|
5274
|
-
let H =
|
|
5285
|
+
}, J = $(), z = fe(), he = L(J), ot = J === z ? he : L(z);
|
|
5286
|
+
let H = he;
|
|
5275
5287
|
return [
|
|
5276
5288
|
() => {
|
|
5277
|
-
const
|
|
5278
|
-
return Zs(
|
|
5289
|
+
const Q = L($());
|
|
5290
|
+
return Zs(Q, H) ? (H.data = Q.data, H.isLoading = Q.isLoading, H.isValidating = Q.isValidating, H.error = Q.error, H) : (H = Q, Q);
|
|
5279
5291
|
},
|
|
5280
5292
|
() => ot
|
|
5281
5293
|
];
|
|
@@ -5283,53 +5295,53 @@ const zn = Gt.use || // This extra generic is to avoid TypeScript mixing up the
|
|
|
5283
5295
|
s,
|
|
5284
5296
|
l
|
|
5285
5297
|
]), at = ic.useSyncExternalStore(rn(
|
|
5286
|
-
(
|
|
5287
|
-
Zs(
|
|
5298
|
+
(F) => Ve(l, (L, J) => {
|
|
5299
|
+
Zs(J, L) || F();
|
|
5288
5300
|
}),
|
|
5289
5301
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
5290
5302
|
[
|
|
5291
5303
|
s,
|
|
5292
5304
|
l
|
|
5293
5305
|
]
|
|
5294
|
-
), Ds[0], Ds[1]), Ms = !I.current, na = g[l] && g[l].length > 0, it = at.data, ze = R(it) ? Yt && Xr(Yt) ? zn(Yt) : Yt : it, Qt = at.error,
|
|
5295
|
-
(
|
|
5296
|
-
const L =
|
|
5297
|
-
if (!l || !L ||
|
|
5306
|
+
), Ds[0], Ds[1]), Ms = !I.current, na = g[l] && g[l].length > 0, it = at.data, ze = R(it) ? Yt && Xr(Yt) ? zn(Yt) : Yt : it, Qt = at.error, Cn = Be(ze), en = k ? R(it) ? R(Cn.current) ? ze : Cn.current : it : ze, Ls = na && !R(Qt) ? !1 : Ms && !R(o) ? o : M().isPaused() ? !1 : a ? R(ze) ? !1 : c : R(ze) || c, $s = !!(l && e && Ms && Ls), sa = R(at.isValidating) ? $s : at.isValidating, ra = R(at.isLoading) ? $s : at.isLoading, wt = rn(
|
|
5307
|
+
(F) => Ie(void 0, null, function* () {
|
|
5308
|
+
const L = V.current;
|
|
5309
|
+
if (!l || !L || K.current || M().isPaused())
|
|
5298
5310
|
return !1;
|
|
5299
|
-
let
|
|
5300
|
-
const ot =
|
|
5311
|
+
let J, z, he = !0;
|
|
5312
|
+
const ot = F || {}, H = !m[l] || !ot.dedupe, Q = () => xr ? !K.current && l === Z.current && I.current : l === Z.current, Oe = {
|
|
5301
5313
|
isValidating: !1,
|
|
5302
5314
|
isLoading: !1
|
|
5303
5315
|
}, Ws = () => {
|
|
5304
5316
|
st(Oe);
|
|
5305
5317
|
}, Us = () => {
|
|
5306
|
-
const
|
|
5307
|
-
|
|
5318
|
+
const de = m[l];
|
|
5319
|
+
de && de[1] === z && delete m[l];
|
|
5308
5320
|
}, Vs = {
|
|
5309
5321
|
isValidating: !0
|
|
5310
5322
|
};
|
|
5311
|
-
R(
|
|
5323
|
+
R($().data) && (Vs.isLoading = !0);
|
|
5312
5324
|
try {
|
|
5313
|
-
if (H && (st(Vs), n.loadingTimeout && R(
|
|
5314
|
-
|
|
5325
|
+
if (H && (st(Vs), n.loadingTimeout && R($().data) && setTimeout(() => {
|
|
5326
|
+
he && Q() && M().onLoadingSlow(l, n);
|
|
5315
5327
|
}, n.loadingTimeout), m[l] = [
|
|
5316
|
-
L(
|
|
5328
|
+
L(A),
|
|
5317
5329
|
Os()
|
|
5318
|
-
]), [
|
|
5319
|
-
return H &&
|
|
5320
|
-
Oe.error =
|
|
5321
|
-
const
|
|
5322
|
-
if (!R(
|
|
5323
|
-
(
|
|
5324
|
-
|
|
5325
|
-
|
|
5326
|
-
return Ws(), H &&
|
|
5327
|
-
const Te =
|
|
5328
|
-
Oe.data = r(Te,
|
|
5329
|
-
} catch (
|
|
5330
|
+
]), [J, z] = m[l], J = yield J, H && setTimeout(Us, n.dedupingInterval), !m[l] || m[l][1] !== z)
|
|
5331
|
+
return H && Q() && M().onDiscarded(l), !1;
|
|
5332
|
+
Oe.error = te;
|
|
5333
|
+
const de = b[l];
|
|
5334
|
+
if (!R(de) && // case 1
|
|
5335
|
+
(z <= de[0] || // case 2
|
|
5336
|
+
z <= de[1] || // case 3
|
|
5337
|
+
de[1] === 0))
|
|
5338
|
+
return Ws(), H && Q() && M().onDiscarded(l), !1;
|
|
5339
|
+
const Te = $().data;
|
|
5340
|
+
Oe.data = r(Te, J) ? Te : J, H && Q() && M().onSuccess(J, l, n);
|
|
5341
|
+
} catch (de) {
|
|
5330
5342
|
Us();
|
|
5331
|
-
const Te =
|
|
5332
|
-
Te.isPaused() || (Oe.error =
|
|
5343
|
+
const Te = M(), { shouldRetryOnError: An } = Te;
|
|
5344
|
+
Te.isPaused() || (Oe.error = de, H && Q() && (Te.onError(de, l, Te), (An === !0 || we(An) && An(de)) && (!M().revalidateOnFocus || !M().revalidateOnReconnect || G()) && Te.onErrorRetry(de, l, Te, (aa) => {
|
|
5333
5345
|
const Nn = g[l];
|
|
5334
5346
|
Nn && Nn[0] && Nn[0](kr, aa);
|
|
5335
5347
|
}, {
|
|
@@ -5337,7 +5349,7 @@ const zn = Gt.use || // This extra generic is to avoid TypeScript mixing up the
|
|
|
5337
5349
|
dedupe: !0
|
|
5338
5350
|
})));
|
|
5339
5351
|
}
|
|
5340
|
-
return
|
|
5352
|
+
return he = !1, Ws(), !0;
|
|
5341
5353
|
}),
|
|
5342
5354
|
// `setState` is immutable, and `eventsCallback`, `fnArg`, and
|
|
5343
5355
|
// `keyValidating` are depending on `key`, so we can exclude them from
|
|
@@ -5356,48 +5368,48 @@ const zn = Gt.use || // This extra generic is to avoid TypeScript mixing up the
|
|
|
5356
5368
|
]
|
|
5357
5369
|
), Fs = rn(
|
|
5358
5370
|
// Use callback to make sure `keyRef.current` returns latest result every time
|
|
5359
|
-
(
|
|
5371
|
+
(...F) => Qr(s, Z.current, ...F),
|
|
5360
5372
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
5361
5373
|
[]
|
|
5362
5374
|
);
|
|
5363
5375
|
if (Wn(() => {
|
|
5364
|
-
|
|
5376
|
+
V.current = e, D.current = n, R(it) || (Cn.current = it);
|
|
5365
5377
|
}), Wn(() => {
|
|
5366
5378
|
if (!l) return;
|
|
5367
|
-
const
|
|
5379
|
+
const F = wt.bind(te, Kn);
|
|
5368
5380
|
let L = 0;
|
|
5369
|
-
|
|
5370
|
-
const
|
|
5371
|
-
if (
|
|
5381
|
+
M().revalidateOnFocus && (L = Date.now() + M().focusThrottleInterval);
|
|
5382
|
+
const z = Ic(l, g, (he, ot = {}) => {
|
|
5383
|
+
if (he == Hr) {
|
|
5372
5384
|
const H = Date.now();
|
|
5373
|
-
|
|
5374
|
-
} else if (
|
|
5375
|
-
|
|
5385
|
+
M().revalidateOnFocus && H > L && G() && (L = H + M().focusThrottleInterval, F());
|
|
5386
|
+
} else if (he == Gr)
|
|
5387
|
+
M().revalidateOnReconnect && G() && F();
|
|
5376
5388
|
else {
|
|
5377
|
-
if (
|
|
5389
|
+
if (he == Jr)
|
|
5378
5390
|
return wt();
|
|
5379
|
-
if (
|
|
5391
|
+
if (he == kr)
|
|
5380
5392
|
return wt(ot);
|
|
5381
5393
|
}
|
|
5382
5394
|
});
|
|
5383
|
-
return
|
|
5384
|
-
_k:
|
|
5385
|
-
}), Ls && (R(ze) || Ht ?
|
|
5386
|
-
|
|
5395
|
+
return K.current = !1, Z.current = l, I.current = !0, st({
|
|
5396
|
+
_k: A
|
|
5397
|
+
}), Ls && (R(ze) || Ht ? F() : mc(F)), () => {
|
|
5398
|
+
K.current = !0, z();
|
|
5387
5399
|
};
|
|
5388
5400
|
}, [
|
|
5389
5401
|
l
|
|
5390
5402
|
]), Wn(() => {
|
|
5391
|
-
let
|
|
5403
|
+
let F;
|
|
5392
5404
|
function L() {
|
|
5393
|
-
const
|
|
5394
|
-
|
|
5405
|
+
const z = we(u) ? u($().data) : u;
|
|
5406
|
+
z && F !== -1 && (F = setTimeout(J, z));
|
|
5395
5407
|
}
|
|
5396
|
-
function
|
|
5397
|
-
|
|
5408
|
+
function J() {
|
|
5409
|
+
!$().error && (h || M().isVisible()) && (p || M().isOnline()) ? wt(Kn).then(L) : L();
|
|
5398
5410
|
}
|
|
5399
5411
|
return L(), () => {
|
|
5400
|
-
|
|
5412
|
+
F && (clearTimeout(F), F = -1);
|
|
5401
5413
|
};
|
|
5402
5414
|
}, [
|
|
5403
5415
|
u,
|
|
@@ -5405,12 +5417,12 @@ const zn = Gt.use || // This extra generic is to avoid TypeScript mixing up the
|
|
|
5405
5417
|
p,
|
|
5406
5418
|
l
|
|
5407
5419
|
]), ga(en), a && R(ze) && l) {
|
|
5408
|
-
if (!
|
|
5420
|
+
if (!xr && Ht)
|
|
5409
5421
|
throw new Error("Fallback data is required when using Suspense in SSR.");
|
|
5410
|
-
|
|
5411
|
-
const
|
|
5412
|
-
if (!R(
|
|
5413
|
-
const L = Fs(
|
|
5422
|
+
V.current = e, D.current = n, K.current = !1;
|
|
5423
|
+
const F = _[l];
|
|
5424
|
+
if (!R(F)) {
|
|
5425
|
+
const L = Fs(F);
|
|
5414
5426
|
zn(L);
|
|
5415
5427
|
}
|
|
5416
5428
|
if (R(Qt)) {
|