@animaapp/anima-sdk-react 0.6.18 → 0.6.21
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 +5 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +415 -406
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2,15 +2,15 @@ var ia = Object.defineProperty, oa = Object.defineProperties;
|
|
|
2
2
|
var ca = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var zs = Object.getOwnPropertySymbols;
|
|
4
4
|
var ua = Object.prototype.hasOwnProperty, da = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var
|
|
5
|
+
var Bs = (t, e, n) => e in t ? ia(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, Be = (t, e) => {
|
|
6
6
|
for (var n in e || (e = {}))
|
|
7
|
-
ua.call(e, n) &&
|
|
7
|
+
ua.call(e, n) && Bs(t, n, e[n]);
|
|
8
8
|
if (zs)
|
|
9
9
|
for (var n of zs(e))
|
|
10
|
-
da.call(e, n) &&
|
|
10
|
+
da.call(e, n) && Bs(t, n, e[n]);
|
|
11
11
|
return t;
|
|
12
|
-
},
|
|
13
|
-
var
|
|
12
|
+
}, Ks = (t, e) => oa(t, ca(e));
|
|
13
|
+
var je = (t, e, n) => new Promise((s, r) => {
|
|
14
14
|
var a = (c) => {
|
|
15
15
|
try {
|
|
16
16
|
o(n.next(c));
|
|
@@ -26,7 +26,7 @@ var Ie = (t, e, n) => new Promise((s, r) => {
|
|
|
26
26
|
}, o = (c) => c.done ? s(c.value) : Promise.resolve(c.value).then(a, i);
|
|
27
27
|
o((n = n.apply(t, e)).next());
|
|
28
28
|
});
|
|
29
|
-
import Gt, { useState as la, useCallback as rn, createContext as fa, useEffect as ha, useLayoutEffect as pa, useContext as ma, useRef as
|
|
29
|
+
import Gt, { useState as la, useCallback as rn, createContext as fa, useEffect as ha, useLayoutEffect as pa, useContext as ma, useRef as Ke, useMemo as ya, useDebugValue as ga } from "react";
|
|
30
30
|
const va = (t) => {
|
|
31
31
|
let e = "";
|
|
32
32
|
const n = new Uint8Array(t), s = n.byteLength;
|
|
@@ -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 Aa = "Request Too Large";
|
|
87
|
+
class Ca extends Error {
|
|
88
88
|
constructor({ fileKey: e, cause: n }) {
|
|
89
|
-
super(
|
|
89
|
+
super(Aa), this.fileKey = e, this.cause = n;
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
const Na = "Not Found";
|
|
@@ -96,12 +96,12 @@ class Ra extends Error {
|
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
98
|
const Pa = "Unknown Figma API Exception";
|
|
99
|
-
class
|
|
99
|
+
class ja extends Error {
|
|
100
100
|
constructor({ fileKey: e, cause: n }) {
|
|
101
101
|
super(Pa), this.name = "UnknownFigmaApiException", this.fileKey = e, this.cause = n;
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
|
-
const
|
|
104
|
+
const Ia = (t, e) => {
|
|
105
105
|
var n;
|
|
106
106
|
if (((n = t == null ? void 0 : t.cause) == null ? void 0 : n.message) === "Fetch Error") {
|
|
107
107
|
const { err: s, status: r } = t.cause.body;
|
|
@@ -116,9 +116,9 @@ 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 Ca({ fileKey: e, cause: t });
|
|
120
120
|
}
|
|
121
|
-
return new
|
|
121
|
+
return new ja({ 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);
|
|
@@ -129,7 +129,7 @@ var Za = Object.defineProperty, Da = Object.defineProperties, Ma = Object.getOwn
|
|
|
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)), As = (t, e, n) => e.has(t) || Tr("Cannot " + n), I = (t, e, n) => (As(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) => (As(t, e, "write to private field"), e.set(t, n), n), be = (t, e, n) => (As(t, e, "access private method"), n), K = (t, e, n) => new Promise((s, r) => {
|
|
133
133
|
var a = (c) => {
|
|
134
134
|
try {
|
|
135
135
|
o(n.next(c));
|
|
@@ -145,17 +145,17 @@ var Za = Object.defineProperty, Da = Object.defineProperties, Ma = Object.getOwn
|
|
|
145
145
|
}, o = (c) => c.done ? s(c.value) : Promise.resolve(c.value).then(a, i);
|
|
146
146
|
o((n = n.apply(t, e)).next());
|
|
147
147
|
}), Fa = (t, e, n) => (e = t[Xs("asyncIterator")]) ? e.call(t) : (t = t[Xs("iterator")](), e = {}, n = (s, r) => (r = t[s]) && (e[s] = (a) => new Promise((i, o, c) => (a = r.call(t, a), c = a.done, Promise.resolve(a.value).then((u) => i({ value: u, done: c }), o)))), n("next"), n("return"), e), Wa = typeof globalThis != "undefined" ? globalThis : typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : {};
|
|
148
|
-
function
|
|
148
|
+
function Va(t) {
|
|
149
149
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
150
150
|
}
|
|
151
|
-
var
|
|
151
|
+
var Kn = { exports: {} }, Ua = Kn.exports, Qs;
|
|
152
152
|
function za() {
|
|
153
153
|
return Qs || (Qs = 1, function(t, e) {
|
|
154
154
|
(function(n, s) {
|
|
155
155
|
t.exports = s();
|
|
156
|
-
})(
|
|
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()),
|
|
158
|
-
function
|
|
156
|
+
})(Ua, 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()), v = h && typeof Array.prototype[Symbol.iterator] == "function", l = v && Object.getPrototypeOf([][Symbol.iterator]()), A = h && typeof String.prototype[Symbol.iterator] == "function", j = A && Object.getPrototypeOf(""[Symbol.iterator]()), B = 8, Z = -1;
|
|
158
|
+
function U(D) {
|
|
159
159
|
var M = typeof D;
|
|
160
160
|
if (M !== "object")
|
|
161
161
|
return M;
|
|
@@ -189,14 +189,14 @@ function za() {
|
|
|
189
189
|
if (typeof G == "string")
|
|
190
190
|
return G;
|
|
191
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" :
|
|
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" : v && $ === l ? "Array Iterator" : A && $ === j ? "String Iterator" : $ === null ? "Object" : Object.prototype.toString.call(D).slice(B, Z);
|
|
193
193
|
}
|
|
194
|
-
return
|
|
194
|
+
return U;
|
|
195
195
|
});
|
|
196
|
-
}(
|
|
196
|
+
}(Kn)), Kn.exports;
|
|
197
197
|
}
|
|
198
|
-
var
|
|
199
|
-
const
|
|
198
|
+
var Ba = za();
|
|
199
|
+
const Ka = /* @__PURE__ */ Va(Ba), Cs = typeof Buffer != "undefined", qa = Cs && typeof Buffer.from != "undefined", Ha = Cs ? (
|
|
200
200
|
/**
|
|
201
201
|
* is value is Buffer?
|
|
202
202
|
*
|
|
@@ -227,7 +227,7 @@ const Ba = /* @__PURE__ */ Ua(Ka), As = typeof Buffer != "undefined", qa = As &&
|
|
|
227
227
|
function(t) {
|
|
228
228
|
return Buffer.from(t);
|
|
229
229
|
}
|
|
230
|
-
) :
|
|
230
|
+
) : Cs ? (
|
|
231
231
|
/**
|
|
232
232
|
* copy Buffer
|
|
233
233
|
*
|
|
@@ -253,7 +253,7 @@ const Ba = /* @__PURE__ */ Ua(Ka), As = typeof Buffer != "undefined", qa = As &&
|
|
|
253
253
|
}
|
|
254
254
|
);
|
|
255
255
|
function mt(t) {
|
|
256
|
-
return Ha(t) ? "Buffer" :
|
|
256
|
+
return Ha(t) ? "Buffer" : Ka(t);
|
|
257
257
|
}
|
|
258
258
|
const Ja = /* @__PURE__ */ new Set([
|
|
259
259
|
"Arguments",
|
|
@@ -318,7 +318,7 @@ function oi(t) {
|
|
|
318
318
|
function ci(t) {
|
|
319
319
|
return new String(t);
|
|
320
320
|
}
|
|
321
|
-
function
|
|
321
|
+
function Ae(t, e) {
|
|
322
322
|
return Rn[e].from ? Rn[e].from(t) : new Rn[e](t);
|
|
323
323
|
}
|
|
324
324
|
function ee(t) {
|
|
@@ -348,15 +348,15 @@ 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", Ae],
|
|
352
|
+
["Float64Array", Ae],
|
|
353
|
+
["Int16Array", Ae],
|
|
354
|
+
["Int32Array", Ae],
|
|
355
|
+
["Int8Array", Ae],
|
|
356
|
+
["Uint16Array", Ae],
|
|
357
|
+
["Uint32Array", Ae],
|
|
358
|
+
["Uint8Array", Ae],
|
|
359
|
+
["Uint8ClampedArray", Ae],
|
|
360
360
|
// shallow copy
|
|
361
361
|
["Array Iterator", ee],
|
|
362
362
|
["Map Iterator", ee],
|
|
@@ -460,32 +460,32 @@ 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, Ar;
|
|
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
|
-
return
|
|
469
|
+
return K(this, null, function* () {
|
|
470
470
|
try {
|
|
471
|
-
return yield
|
|
471
|
+
return yield I(this, on).call(this);
|
|
472
472
|
} catch (e) {
|
|
473
|
-
if (X(this, He,
|
|
473
|
+
if (X(this, He, I(this, He) + 1), I(this, He) > I(this, an))
|
|
474
474
|
throw console.error("Max attempts reached"), e;
|
|
475
|
-
const n = be(this, Jn,
|
|
475
|
+
const n = be(this, Jn, Ar).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(), Ar = function() {
|
|
482
|
+
return I(this, He) * 1e3 * 1.5;
|
|
483
483
|
};
|
|
484
484
|
function yi() {
|
|
485
485
|
return typeof CompressionStream != "undefined";
|
|
486
486
|
}
|
|
487
487
|
function gi(t) {
|
|
488
|
-
return
|
|
488
|
+
return K(this, null, function* () {
|
|
489
489
|
const e = new Blob([t]).stream().pipeThrough(new CompressionStream("gzip")), n = [];
|
|
490
490
|
try {
|
|
491
491
|
for (var s = Fa(e), r, a, i; r = !(a = yield s.next()).done; r = !1) {
|
|
@@ -506,7 +506,7 @@ function gi(t) {
|
|
|
506
506
|
});
|
|
507
507
|
}
|
|
508
508
|
function vi(t) {
|
|
509
|
-
return
|
|
509
|
+
return K(this, null, function* () {
|
|
510
510
|
const e = yield new Blob(t).arrayBuffer();
|
|
511
511
|
return new Uint8Array(e);
|
|
512
512
|
});
|
|
@@ -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 Cr() {
|
|
564
564
|
return Array.from(
|
|
565
565
|
{ length: 32 },
|
|
566
566
|
() => Math.floor(Math.random() * 256).toString(16).padStart(2, "0")
|
|
@@ -588,51 +588,51 @@ class Ei {
|
|
|
588
588
|
return X(this, se, e), this;
|
|
589
589
|
}
|
|
590
590
|
get(e) {
|
|
591
|
-
return
|
|
591
|
+
return K(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 X(this, se, {}), c.extraHeaders && (o = ie(ie({}, o), c.extraHeaders)), c.requestValidation && (o = Ts(ie({}, o), { "X-Request-Nonce":
|
|
594
|
+
const c = kt(I(this, se));
|
|
595
|
+
return X(this, se, {}), c.extraHeaders && (o = ie(ie({}, o), c.extraHeaders)), c.requestValidation && (o = Ts(ie({}, o), { "X-Request-Nonce": Cr(), "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
|
-
return
|
|
600
|
-
const i = kt(
|
|
599
|
+
return K(this, arguments, function* (s, r, a = {}) {
|
|
600
|
+
const i = kt(I(this, se));
|
|
601
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
|
-
return
|
|
606
|
-
const i = kt(
|
|
605
|
+
return K(this, arguments, function* (s, r, a = {}) {
|
|
606
|
+
const i = kt(I(this, se));
|
|
607
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
|
-
return
|
|
612
|
-
const i = kt(
|
|
611
|
+
return K(this, arguments, function* (s, r, a = {}) {
|
|
612
|
+
const i = kt(I(this, se));
|
|
613
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
|
-
return
|
|
618
|
-
const i = kt(
|
|
617
|
+
return K(this, arguments, function* (s, r, a = {}) {
|
|
618
|
+
const i = kt(I(this, se));
|
|
619
619
|
return X(this, se, {}), be(this, ve, xt).call(this, s, "PATCH", r, a, i);
|
|
620
620
|
});
|
|
621
621
|
}
|
|
622
622
|
}
|
|
623
623
|
Ge = /* @__PURE__ */ new WeakMap(), se = /* @__PURE__ */ new WeakMap(), ve = /* @__PURE__ */ new WeakSet(), Yn = function(t, e, n) {
|
|
624
|
-
return
|
|
625
|
-
const s = () =>
|
|
624
|
+
return K(this, null, function* () {
|
|
625
|
+
const s = () => K(this, null, function* () {
|
|
626
626
|
var c, u;
|
|
627
627
|
try {
|
|
628
|
-
return yield
|
|
628
|
+
return yield I(this, Ge).call(this, t, ie(ie({}, n), e.abortSignal && { signal: e.abortSignal }));
|
|
629
629
|
} catch (h) {
|
|
630
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;
|
|
634
634
|
return ((h = c == null ? void 0 : c.headers) == null ? void 0 : h.get(u)) || ((p = c == null ? void 0 : c.headersObject) == null ? void 0 : p[u]) || "";
|
|
635
|
-
}, i = (c) =>
|
|
635
|
+
}, i = (c) => K(this, null, function* () {
|
|
636
636
|
var u;
|
|
637
637
|
if (!c.ok) {
|
|
638
638
|
const p = yield c.text().catch();
|
|
@@ -675,7 +675,7 @@ Ge = /* @__PURE__ */ new WeakMap(), se = /* @__PURE__ */ new WeakMap(), ve = /*
|
|
|
675
675
|
return yield i(o);
|
|
676
676
|
});
|
|
677
677
|
}, Qn = function(t, e, n) {
|
|
678
|
-
return
|
|
678
|
+
return K(this, null, function* () {
|
|
679
679
|
var s, r;
|
|
680
680
|
const {
|
|
681
681
|
onProgress: a,
|
|
@@ -685,7 +685,7 @@ Ge = /* @__PURE__ */ new WeakMap(), se = /* @__PURE__ */ new WeakMap(), ve = /*
|
|
|
685
685
|
} = e, u = `${t}/async`, h = `${t}/async/job`;
|
|
686
686
|
let p;
|
|
687
687
|
try {
|
|
688
|
-
p = yield
|
|
688
|
+
p = yield I(this, Ge).call(this, u, ie(ie({}, n), i && { signal: i }));
|
|
689
689
|
} catch (b) {
|
|
690
690
|
throw b instanceof Error && b.name === "AbortError" ? new Et({ canceled: (s = i == null ? void 0 : i.aborted) != null ? s : !1 }) : b;
|
|
691
691
|
}
|
|
@@ -703,43 +703,43 @@ Ge = /* @__PURE__ */ new WeakMap(), se = /* @__PURE__ */ new WeakMap(), ve = /*
|
|
|
703
703
|
const k = yield p.json(), { job_id: g } = k;
|
|
704
704
|
if (!g)
|
|
705
705
|
throw new Error("Job ID not found in response");
|
|
706
|
-
return new Promise((b, m) =>
|
|
707
|
-
const
|
|
706
|
+
return new Promise((b, m) => K(this, null, function* () {
|
|
707
|
+
const v = setTimeout(() => {
|
|
708
708
|
m(new Error("Job timed out"));
|
|
709
|
-
}, c), l = (A = 0) =>
|
|
709
|
+
}, c), l = (A = 0) => K(this, null, function* () {
|
|
710
710
|
if (i != null && i.aborted) {
|
|
711
|
-
clearTimeout(
|
|
711
|
+
clearTimeout(v), I(this, Ge).call(this, `${h}/${g}/cancel`, { method: "POST", headers: this.headers }).then(() => {
|
|
712
712
|
m(new Et({ canceled: !0 }));
|
|
713
|
-
}).catch((
|
|
713
|
+
}).catch((j) => {
|
|
714
714
|
m(new Et({ canceled: !1 }));
|
|
715
715
|
});
|
|
716
716
|
return;
|
|
717
717
|
}
|
|
718
718
|
try {
|
|
719
|
-
const
|
|
720
|
-
if (
|
|
721
|
-
clearTimeout(
|
|
722
|
-
const
|
|
723
|
-
b(
|
|
724
|
-
} else if (
|
|
725
|
-
clearTimeout(
|
|
719
|
+
const j = yield (yield I(this, Ge).call(this, `${h}/${g}`, { headers: this.headers })).json();
|
|
720
|
+
if (j.status === "success") {
|
|
721
|
+
clearTimeout(v);
|
|
722
|
+
const B = j.response_json;
|
|
723
|
+
b(B);
|
|
724
|
+
} else if (j.status === "failed")
|
|
725
|
+
clearTimeout(v), m(new bi(j.response_json));
|
|
726
726
|
else {
|
|
727
|
-
a && a(
|
|
728
|
-
const
|
|
729
|
-
setTimeout(() => l(A + 1),
|
|
727
|
+
a && a(j.response_json);
|
|
728
|
+
const B = o(A);
|
|
729
|
+
setTimeout(() => l(A + 1), B);
|
|
730
730
|
}
|
|
731
|
-
} catch (
|
|
732
|
-
m(
|
|
731
|
+
} catch (j) {
|
|
732
|
+
m(j);
|
|
733
733
|
}
|
|
734
734
|
});
|
|
735
735
|
l();
|
|
736
736
|
}));
|
|
737
737
|
});
|
|
738
738
|
}, xt = function(t, e, n, s, r) {
|
|
739
|
-
return
|
|
739
|
+
return K(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 = ie(ie({}, c), r.extraHeaders)), r.requestValidation && (c = Ts(ie({}, c), { "X-Request-Nonce":
|
|
742
|
+
r.extraHeaders && (c = ie(ie({}, c), r.extraHeaders)), r.requestValidation && (c = Ts(ie({}, c), { "X-Request-Nonce": Cr(), "X-Request-Timestamp": Xn() }));
|
|
743
743
|
let u = n;
|
|
744
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,
|
|
@@ -748,7 +748,7 @@ Ge = /* @__PURE__ */ new WeakMap(), se = /* @__PURE__ */ new WeakMap(), ve = /*
|
|
|
748
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 Et ? t : new _i({ resource: e, api: String(n), args: s, cause: t }),
|
|
751
|
+
const sr = (t, e, n, s) => t instanceof Et ? t : new _i({ resource: e, api: String(n), args: s, cause: t }), jn = (t, e) => new Proxy(e, {
|
|
752
752
|
get(n, s) {
|
|
753
753
|
return (...r) => {
|
|
754
754
|
var a;
|
|
@@ -775,18 +775,18 @@ class xi {
|
|
|
775
775
|
le(this, St), this.resourceName = "Files", X(this, St, e);
|
|
776
776
|
}
|
|
777
777
|
get(e) {
|
|
778
|
-
return
|
|
778
|
+
return K(this, arguments, function* ({ fileKey: n, params: s = {} }) {
|
|
779
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 I(this, St).get(a);
|
|
783
783
|
});
|
|
784
784
|
}
|
|
785
785
|
getImageFills(e) {
|
|
786
|
-
return
|
|
786
|
+
return K(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 I(this, St).get(a)).meta) == null ? void 0 : s.images) != null ? r : {};
|
|
790
790
|
});
|
|
791
791
|
}
|
|
792
792
|
}
|
|
@@ -805,85 +805,85 @@ class Ti {
|
|
|
805
805
|
* Note: Use the `file.images` API to get the _source_ images used on the node fills, which has better quality.
|
|
806
806
|
*/
|
|
807
807
|
get(e) {
|
|
808
|
-
return
|
|
809
|
-
const i = Si(n, s, r), o =
|
|
808
|
+
return K(this, arguments, function* ({ fileKey: n, nodeIds: s, format: r = "jpg", scale: a }) {
|
|
809
|
+
const i = Si(n, s, r), o = I(this, _e).cache.images.entries.get(i);
|
|
810
810
|
if (Oi(o))
|
|
811
811
|
return o.result;
|
|
812
|
-
o &&
|
|
813
|
-
const c =
|
|
812
|
+
o && I(this, _e).cache.images.entries.delete(i);
|
|
813
|
+
const c = I(this, _e).cache.images.pendingRequests.get(i);
|
|
814
814
|
if (c)
|
|
815
815
|
return c;
|
|
816
816
|
const u = be(this, es, Nr).call(this, i, n, s, r, a);
|
|
817
|
-
|
|
817
|
+
I(this, _e).cache.images.pendingRequests.set(i, u);
|
|
818
818
|
try {
|
|
819
819
|
return yield u;
|
|
820
820
|
} finally {
|
|
821
|
-
|
|
821
|
+
I(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
|
-
return
|
|
828
|
-
const a = yield
|
|
827
|
+
return K(this, null, function* () {
|
|
828
|
+
const a = yield I(this, _e).get(
|
|
829
829
|
`v1/images/${e}?ids=${n}&format=${s}${r ? `&scale=${r}` : ""}`
|
|
830
830
|
);
|
|
831
|
-
return
|
|
831
|
+
return I(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 Ai {
|
|
839
839
|
constructor(e) {
|
|
840
840
|
le(this, cn), this.resourceName = "Nodes", X(this, cn, e);
|
|
841
841
|
}
|
|
842
842
|
get(e) {
|
|
843
|
-
return
|
|
843
|
+
return K(this, arguments, function* ({ fileKey: n, nodeIds: s, params: r = {} }) {
|
|
844
844
|
const a = Ts(ie({}, r), {
|
|
845
845
|
ids: s.join(",")
|
|
846
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 I(this, cn).get(o);
|
|
850
850
|
});
|
|
851
851
|
}
|
|
852
852
|
}
|
|
853
853
|
cn = /* @__PURE__ */ new WeakMap();
|
|
854
|
-
var
|
|
855
|
-
class
|
|
854
|
+
var Ie;
|
|
855
|
+
class Ci 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 }), le(this,
|
|
860
|
+
super({ fetch: n, baseAddress: e }), le(this, Ie, ""), this.cache = {
|
|
861
861
|
images: {
|
|
862
862
|
entries: /* @__PURE__ */ new Map(),
|
|
863
863
|
pendingRequests: /* @__PURE__ */ new Map()
|
|
864
864
|
}
|
|
865
|
-
}, this.files =
|
|
865
|
+
}, this.files = jn(this, new xi(this)), this.nodes = jn(this, new Ai(this)), this.images = jn(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
|
-
X(this,
|
|
870
|
+
X(this, Ie, e);
|
|
871
871
|
}
|
|
872
872
|
get token() {
|
|
873
|
-
return
|
|
873
|
+
return I(this, Ie);
|
|
874
874
|
}
|
|
875
875
|
get headers() {
|
|
876
876
|
const e = {
|
|
877
877
|
"Content-Type": "application/json"
|
|
878
878
|
};
|
|
879
|
-
return
|
|
879
|
+
return I(this, Ie).startsWith("figd_") ? e["X-FIGMA-TOKEN"] = I(this, Ie) : I(this, Ie).startsWith("figu_") && (e.Authorization = `Bearer ${I(this, Ie)}`), e;
|
|
880
880
|
}
|
|
881
881
|
}
|
|
882
|
-
|
|
882
|
+
Ie = /* @__PURE__ */ new WeakMap();
|
|
883
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 Ci(),
|
|
887
887
|
params: r = {},
|
|
888
888
|
signal: a
|
|
889
889
|
}) {
|
|
@@ -896,7 +896,7 @@ const Ni = (t) => Ee(void 0, [t], function* ({
|
|
|
896
896
|
params: r
|
|
897
897
|
});
|
|
898
898
|
} catch (i) {
|
|
899
|
-
throw i instanceof Error && i.name === "AbortError" ? i : (console.error(i),
|
|
899
|
+
throw i instanceof Error && i.name === "AbortError" ? i : (console.error(i), Ia(i, e));
|
|
900
900
|
}
|
|
901
901
|
});
|
|
902
902
|
var N;
|
|
@@ -939,7 +939,7 @@ var ts;
|
|
|
939
939
|
(function(t) {
|
|
940
940
|
t.mergeShapes = (e, n) => d(d({}, e), n);
|
|
941
941
|
})(ts || (ts = {}));
|
|
942
|
-
const
|
|
942
|
+
const _ = N.arrayToEnum([
|
|
943
943
|
"string",
|
|
944
944
|
"nan",
|
|
945
945
|
"number",
|
|
@@ -963,23 +963,23 @@ const v = N.arrayToEnum([
|
|
|
963
963
|
]), Ne = (t) => {
|
|
964
964
|
switch (typeof t) {
|
|
965
965
|
case "undefined":
|
|
966
|
-
return
|
|
966
|
+
return _.undefined;
|
|
967
967
|
case "string":
|
|
968
|
-
return
|
|
968
|
+
return _.string;
|
|
969
969
|
case "number":
|
|
970
|
-
return isNaN(t) ?
|
|
970
|
+
return isNaN(t) ? _.nan : _.number;
|
|
971
971
|
case "boolean":
|
|
972
|
-
return
|
|
972
|
+
return _.boolean;
|
|
973
973
|
case "function":
|
|
974
|
-
return
|
|
974
|
+
return _.function;
|
|
975
975
|
case "bigint":
|
|
976
|
-
return
|
|
976
|
+
return _.bigint;
|
|
977
977
|
case "symbol":
|
|
978
|
-
return
|
|
978
|
+
return _.symbol;
|
|
979
979
|
case "object":
|
|
980
|
-
return Array.isArray(t) ?
|
|
980
|
+
return Array.isArray(t) ? _.array : t === null ? _.null : t.then && typeof t.then == "function" && t.catch && typeof t.catch == "function" ? _.promise : typeof Map != "undefined" && t instanceof Map ? _.map : typeof Set != "undefined" && t instanceof Set ? _.set : typeof Date != "undefined" && t instanceof Date ? _.date : _.object;
|
|
981
981
|
default:
|
|
982
|
-
return
|
|
982
|
+
return _.unknown;
|
|
983
983
|
}
|
|
984
984
|
}, f = N.arrayToEnum([
|
|
985
985
|
"invalid_type",
|
|
@@ -1063,7 +1063,7 @@ const yt = (t, e) => {
|
|
|
1063
1063
|
let n;
|
|
1064
1064
|
switch (t.code) {
|
|
1065
1065
|
case f.invalid_type:
|
|
1066
|
-
t.received ===
|
|
1066
|
+
t.received === _.undefined ? n = "Required" : n = `Expected ${t.expected}, received ${t.received}`;
|
|
1067
1067
|
break;
|
|
1068
1068
|
case f.invalid_literal:
|
|
1069
1069
|
n = `Invalid literal value, expected ${JSON.stringify(t.expected, N.jsonStringifyReplacer)}`;
|
|
@@ -1139,7 +1139,7 @@ const fn = (t) => {
|
|
|
1139
1139
|
path: a,
|
|
1140
1140
|
message: o
|
|
1141
1141
|
});
|
|
1142
|
-
},
|
|
1142
|
+
}, ji = [];
|
|
1143
1143
|
function y(t, e) {
|
|
1144
1144
|
const n = ln(), s = fn({
|
|
1145
1145
|
issueData: e,
|
|
@@ -1431,7 +1431,7 @@ class T {
|
|
|
1431
1431
|
}
|
|
1432
1432
|
default(e) {
|
|
1433
1433
|
const n = typeof e == "function" ? e : () => e;
|
|
1434
|
-
return new
|
|
1434
|
+
return new Vt(x(d({}, O(this._def)), {
|
|
1435
1435
|
innerType: this,
|
|
1436
1436
|
defaultValue: n,
|
|
1437
1437
|
typeName: E.ZodDefault
|
|
@@ -1445,7 +1445,7 @@ class T {
|
|
|
1445
1445
|
}
|
|
1446
1446
|
catch(e) {
|
|
1447
1447
|
const n = typeof e == "function" ? e : () => e;
|
|
1448
|
-
return new
|
|
1448
|
+
return new Ut(x(d({}, O(this._def)), {
|
|
1449
1449
|
innerType: this,
|
|
1450
1450
|
catchValue: n,
|
|
1451
1451
|
typeName: E.ZodCatch
|
|
@@ -1470,23 +1470,23 @@ class T {
|
|
|
1470
1470
|
return this.safeParse(null).success;
|
|
1471
1471
|
}
|
|
1472
1472
|
}
|
|
1473
|
-
const
|
|
1474
|
-
let
|
|
1475
|
-
const
|
|
1476
|
-
function
|
|
1473
|
+
const Ii = /^c[^\s-]{8,}$/i, Zi = /^[0-9a-z]+$/, Di = /^[0-9A-HJKMNP-TV-Z]{26}$/i, Mi = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i, Li = /^[a-z0-9_-]{21}$/i, $i = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, Fi = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/, Wi = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, Vi = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
1474
|
+
let In;
|
|
1475
|
+
const Ui = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, zi = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/, Bi = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/, Ki = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, qi = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, Hi = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, jr = "((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))", Gi = new RegExp(`^${jr}$`);
|
|
1476
|
+
function Ir(t) {
|
|
1477
1477
|
let e = "([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";
|
|
1478
1478
|
return t.precision ? e = `${e}\\.\\d{${t.precision}}` : t.precision == null && (e = `${e}(\\.\\d+)?`), e;
|
|
1479
1479
|
}
|
|
1480
1480
|
function Ji(t) {
|
|
1481
|
-
return new RegExp(`^${
|
|
1481
|
+
return new RegExp(`^${Ir(t)}$`);
|
|
1482
1482
|
}
|
|
1483
1483
|
function Zr(t) {
|
|
1484
|
-
let e = `${
|
|
1484
|
+
let e = `${jr}T${Ir(t)}`;
|
|
1485
1485
|
const n = [];
|
|
1486
1486
|
return n.push(t.local ? "Z?" : "Z"), t.offset && n.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${n.join("|")})`, new RegExp(`^${e}$`);
|
|
1487
1487
|
}
|
|
1488
1488
|
function Xi(t, e) {
|
|
1489
|
-
return !!((e === "v4" || !e) &&
|
|
1489
|
+
return !!((e === "v4" || !e) && Ui.test(t) || (e === "v6" || !e) && Bi.test(t));
|
|
1490
1490
|
}
|
|
1491
1491
|
function Yi(t, e) {
|
|
1492
1492
|
if (!$i.test(t))
|
|
@@ -1499,15 +1499,15 @@ function Yi(t, e) {
|
|
|
1499
1499
|
}
|
|
1500
1500
|
}
|
|
1501
1501
|
function Qi(t, e) {
|
|
1502
|
-
return !!((e === "v4" || !e) && zi.test(t) || (e === "v6" || !e) &&
|
|
1502
|
+
return !!((e === "v4" || !e) && zi.test(t) || (e === "v6" || !e) && Ki.test(t));
|
|
1503
1503
|
}
|
|
1504
1504
|
class me extends T {
|
|
1505
1505
|
_parse(e) {
|
|
1506
|
-
if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !==
|
|
1506
|
+
if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== _.string) {
|
|
1507
1507
|
const r = this._getOrReturnCtx(e);
|
|
1508
1508
|
return y(r, {
|
|
1509
1509
|
code: f.invalid_type,
|
|
1510
|
-
expected:
|
|
1510
|
+
expected: _.string,
|
|
1511
1511
|
received: r.parsedType
|
|
1512
1512
|
}), S;
|
|
1513
1513
|
}
|
|
@@ -1556,7 +1556,7 @@ class me extends T {
|
|
|
1556
1556
|
message: r.message
|
|
1557
1557
|
}), n.dirty());
|
|
1558
1558
|
else if (r.kind === "emoji")
|
|
1559
|
-
|
|
1559
|
+
In || (In = new RegExp(Vi, "u")), In.test(e.data) || (s = this._getOrReturnCtx(e, s), y(s, {
|
|
1560
1560
|
validation: "emoji",
|
|
1561
1561
|
code: f.invalid_string,
|
|
1562
1562
|
message: r.message
|
|
@@ -1574,7 +1574,7 @@ class me extends T {
|
|
|
1574
1574
|
message: r.message
|
|
1575
1575
|
}), n.dirty());
|
|
1576
1576
|
else if (r.kind === "cuid")
|
|
1577
|
-
|
|
1577
|
+
Ii.test(e.data) || (s = this._getOrReturnCtx(e, s), y(s, {
|
|
1578
1578
|
validation: "cuid",
|
|
1579
1579
|
code: f.invalid_string,
|
|
1580
1580
|
message: r.message
|
|
@@ -1881,11 +1881,11 @@ class Le extends T {
|
|
|
1881
1881
|
super(...arguments), this.min = this.gte, this.max = this.lte, this.step = this.multipleOf;
|
|
1882
1882
|
}
|
|
1883
1883
|
_parse(e) {
|
|
1884
|
-
if (this._def.coerce && (e.data = Number(e.data)), this._getType(e) !==
|
|
1884
|
+
if (this._def.coerce && (e.data = Number(e.data)), this._getType(e) !== _.number) {
|
|
1885
1885
|
const r = this._getOrReturnCtx(e);
|
|
1886
1886
|
return y(r, {
|
|
1887
1887
|
code: f.invalid_type,
|
|
1888
|
-
expected:
|
|
1888
|
+
expected: _.number,
|
|
1889
1889
|
received: r.parsedType
|
|
1890
1890
|
}), S;
|
|
1891
1891
|
}
|
|
@@ -2056,7 +2056,7 @@ class $e extends T {
|
|
|
2056
2056
|
} catch (r) {
|
|
2057
2057
|
return this._getInvalidInput(e);
|
|
2058
2058
|
}
|
|
2059
|
-
if (this._getType(e) !==
|
|
2059
|
+
if (this._getType(e) !== _.bigint)
|
|
2060
2060
|
return this._getInvalidInput(e);
|
|
2061
2061
|
let n;
|
|
2062
2062
|
const s = new Y();
|
|
@@ -2084,7 +2084,7 @@ class $e extends T {
|
|
|
2084
2084
|
const n = this._getOrReturnCtx(e);
|
|
2085
2085
|
return y(n, {
|
|
2086
2086
|
code: f.invalid_type,
|
|
2087
|
-
expected:
|
|
2087
|
+
expected: _.bigint,
|
|
2088
2088
|
received: n.parsedType
|
|
2089
2089
|
}), S;
|
|
2090
2090
|
}
|
|
@@ -2178,30 +2178,30 @@ $e.create = (t) => {
|
|
|
2178
2178
|
coerce: (e = t == null ? void 0 : t.coerce) !== null && e !== void 0 ? e : !1
|
|
2179
2179
|
}, O(t)));
|
|
2180
2180
|
};
|
|
2181
|
-
class
|
|
2181
|
+
class jt extends T {
|
|
2182
2182
|
_parse(e) {
|
|
2183
|
-
if (this._def.coerce && (e.data = !!e.data), this._getType(e) !==
|
|
2183
|
+
if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== _.boolean) {
|
|
2184
2184
|
const n = this._getOrReturnCtx(e);
|
|
2185
2185
|
return y(n, {
|
|
2186
2186
|
code: f.invalid_type,
|
|
2187
|
-
expected:
|
|
2187
|
+
expected: _.boolean,
|
|
2188
2188
|
received: n.parsedType
|
|
2189
2189
|
}), S;
|
|
2190
2190
|
}
|
|
2191
2191
|
return ne(e.data);
|
|
2192
2192
|
}
|
|
2193
2193
|
}
|
|
2194
|
-
|
|
2194
|
+
jt.create = (t) => new jt(d({
|
|
2195
2195
|
typeName: E.ZodBoolean,
|
|
2196
2196
|
coerce: (t == null ? void 0 : t.coerce) || !1
|
|
2197
2197
|
}, O(t)));
|
|
2198
2198
|
class Qe extends T {
|
|
2199
2199
|
_parse(e) {
|
|
2200
|
-
if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !==
|
|
2200
|
+
if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== _.date) {
|
|
2201
2201
|
const r = this._getOrReturnCtx(e);
|
|
2202
2202
|
return y(r, {
|
|
2203
2203
|
code: f.invalid_type,
|
|
2204
|
-
expected:
|
|
2204
|
+
expected: _.date,
|
|
2205
2205
|
received: r.parsedType
|
|
2206
2206
|
}), S;
|
|
2207
2207
|
}
|
|
@@ -2273,11 +2273,11 @@ Qe.create = (t) => new Qe(d({
|
|
|
2273
2273
|
}, O(t)));
|
|
2274
2274
|
class mn extends T {
|
|
2275
2275
|
_parse(e) {
|
|
2276
|
-
if (this._getType(e) !==
|
|
2276
|
+
if (this._getType(e) !== _.symbol) {
|
|
2277
2277
|
const n = this._getOrReturnCtx(e);
|
|
2278
2278
|
return y(n, {
|
|
2279
2279
|
code: f.invalid_type,
|
|
2280
|
-
expected:
|
|
2280
|
+
expected: _.symbol,
|
|
2281
2281
|
received: n.parsedType
|
|
2282
2282
|
}), S;
|
|
2283
2283
|
}
|
|
@@ -2287,29 +2287,29 @@ class mn extends T {
|
|
|
2287
2287
|
mn.create = (t) => new mn(d({
|
|
2288
2288
|
typeName: E.ZodSymbol
|
|
2289
2289
|
}, O(t)));
|
|
2290
|
-
class
|
|
2290
|
+
class It extends T {
|
|
2291
2291
|
_parse(e) {
|
|
2292
|
-
if (this._getType(e) !==
|
|
2292
|
+
if (this._getType(e) !== _.undefined) {
|
|
2293
2293
|
const n = this._getOrReturnCtx(e);
|
|
2294
2294
|
return y(n, {
|
|
2295
2295
|
code: f.invalid_type,
|
|
2296
|
-
expected:
|
|
2296
|
+
expected: _.undefined,
|
|
2297
2297
|
received: n.parsedType
|
|
2298
2298
|
}), S;
|
|
2299
2299
|
}
|
|
2300
2300
|
return ne(e.data);
|
|
2301
2301
|
}
|
|
2302
2302
|
}
|
|
2303
|
-
|
|
2303
|
+
It.create = (t) => new It(d({
|
|
2304
2304
|
typeName: E.ZodUndefined
|
|
2305
2305
|
}, O(t)));
|
|
2306
2306
|
class Zt extends T {
|
|
2307
2307
|
_parse(e) {
|
|
2308
|
-
if (this._getType(e) !==
|
|
2308
|
+
if (this._getType(e) !== _.null) {
|
|
2309
2309
|
const n = this._getOrReturnCtx(e);
|
|
2310
2310
|
return y(n, {
|
|
2311
2311
|
code: f.invalid_type,
|
|
2312
|
-
expected:
|
|
2312
|
+
expected: _.null,
|
|
2313
2313
|
received: n.parsedType
|
|
2314
2314
|
}), S;
|
|
2315
2315
|
}
|
|
@@ -2346,7 +2346,7 @@ class Pe extends T {
|
|
|
2346
2346
|
const n = this._getOrReturnCtx(e);
|
|
2347
2347
|
return y(n, {
|
|
2348
2348
|
code: f.invalid_type,
|
|
2349
|
-
expected:
|
|
2349
|
+
expected: _.never,
|
|
2350
2350
|
received: n.parsedType
|
|
2351
2351
|
}), S;
|
|
2352
2352
|
}
|
|
@@ -2356,11 +2356,11 @@ Pe.create = (t) => new Pe(d({
|
|
|
2356
2356
|
}, O(t)));
|
|
2357
2357
|
class yn extends T {
|
|
2358
2358
|
_parse(e) {
|
|
2359
|
-
if (this._getType(e) !==
|
|
2359
|
+
if (this._getType(e) !== _.undefined) {
|
|
2360
2360
|
const n = this._getOrReturnCtx(e);
|
|
2361
2361
|
return y(n, {
|
|
2362
2362
|
code: f.invalid_type,
|
|
2363
|
-
expected:
|
|
2363
|
+
expected: _.void,
|
|
2364
2364
|
received: n.parsedType
|
|
2365
2365
|
}), S;
|
|
2366
2366
|
}
|
|
@@ -2373,10 +2373,10 @@ yn.create = (t) => new yn(d({
|
|
|
2373
2373
|
class ye extends T {
|
|
2374
2374
|
_parse(e) {
|
|
2375
2375
|
const { ctx: n, status: s } = this._processInputParams(e), r = this._def;
|
|
2376
|
-
if (n.parsedType !==
|
|
2376
|
+
if (n.parsedType !== _.array)
|
|
2377
2377
|
return y(n, {
|
|
2378
2378
|
code: f.invalid_type,
|
|
2379
|
-
expected:
|
|
2379
|
+
expected: _.array,
|
|
2380
2380
|
received: n.parsedType
|
|
2381
2381
|
}), S;
|
|
2382
2382
|
if (r.exactLength !== null) {
|
|
@@ -2440,20 +2440,20 @@ ye.create = (t, e) => new ye(d({
|
|
|
2440
2440
|
typeName: E.ZodArray
|
|
2441
2441
|
}, O(e)));
|
|
2442
2442
|
function ct(t) {
|
|
2443
|
-
if (t instanceof
|
|
2443
|
+
if (t instanceof V) {
|
|
2444
2444
|
const e = {};
|
|
2445
2445
|
for (const n in t.shape) {
|
|
2446
2446
|
const s = t.shape[n];
|
|
2447
2447
|
e[n] = ke.create(ct(s));
|
|
2448
2448
|
}
|
|
2449
|
-
return new
|
|
2449
|
+
return new V(x(d({}, t._def), {
|
|
2450
2450
|
shape: () => e
|
|
2451
2451
|
}));
|
|
2452
2452
|
} else return t instanceof ye ? new ye(x(d({}, t._def), {
|
|
2453
2453
|
type: ct(t.element)
|
|
2454
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
|
-
class
|
|
2456
|
+
class V extends T {
|
|
2457
2457
|
constructor() {
|
|
2458
2458
|
super(...arguments), this._cached = null, this.nonstrict = this.passthrough, this.augment = this.extend;
|
|
2459
2459
|
}
|
|
@@ -2464,11 +2464,11 @@ class U extends T {
|
|
|
2464
2464
|
return this._cached = { shape: e, keys: n };
|
|
2465
2465
|
}
|
|
2466
2466
|
_parse(e) {
|
|
2467
|
-
if (this._getType(e) !==
|
|
2467
|
+
if (this._getType(e) !== _.object) {
|
|
2468
2468
|
const c = this._getOrReturnCtx(e);
|
|
2469
2469
|
return y(c, {
|
|
2470
2470
|
code: f.invalid_type,
|
|
2471
|
-
expected:
|
|
2471
|
+
expected: _.object,
|
|
2472
2472
|
received: c.parsedType
|
|
2473
2473
|
}), S;
|
|
2474
2474
|
}
|
|
@@ -2530,7 +2530,7 @@ class U extends T {
|
|
|
2530
2530
|
return this._def.shape();
|
|
2531
2531
|
}
|
|
2532
2532
|
strict(e) {
|
|
2533
|
-
return w.errToObj, new
|
|
2533
|
+
return w.errToObj, new V(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
|
|
2548
|
+
return new V(x(d({}, this._def), {
|
|
2549
2549
|
unknownKeys: "strip"
|
|
2550
2550
|
}));
|
|
2551
2551
|
}
|
|
2552
2552
|
passthrough() {
|
|
2553
|
-
return new
|
|
2553
|
+
return new V(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
|
|
2575
|
+
return new V(x(d({}, this._def), {
|
|
2576
2576
|
shape: () => d(d({}, this._def.shape()), e)
|
|
2577
2577
|
}));
|
|
2578
2578
|
}
|
|
@@ -2582,7 +2582,7 @@ class U extends T {
|
|
|
2582
2582
|
* upgrade if you are experiencing issues.
|
|
2583
2583
|
*/
|
|
2584
2584
|
merge(e) {
|
|
2585
|
-
return new
|
|
2585
|
+
return new V({
|
|
2586
2586
|
unknownKeys: e._def.unknownKeys,
|
|
2587
2587
|
catchall: e._def.catchall,
|
|
2588
2588
|
shape: () => d(d({}, this._def.shape()), e._def.shape()),
|
|
@@ -2649,7 +2649,7 @@ class U extends T {
|
|
|
2649
2649
|
// return merged;
|
|
2650
2650
|
// }
|
|
2651
2651
|
catchall(e) {
|
|
2652
|
-
return new
|
|
2652
|
+
return new V(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
|
|
2660
|
+
}), new V(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
|
|
2668
|
+
}), new V(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
|
|
2683
|
+
}), new V(x(d({}, this._def), {
|
|
2684
2684
|
shape: () => n
|
|
2685
2685
|
}));
|
|
2686
2686
|
}
|
|
@@ -2695,7 +2695,7 @@ class U extends T {
|
|
|
2695
2695
|
r = r._def.innerType;
|
|
2696
2696
|
n[s] = r;
|
|
2697
2697
|
}
|
|
2698
|
-
}), new
|
|
2698
|
+
}), new V(x(d({}, this._def), {
|
|
2699
2699
|
shape: () => n
|
|
2700
2700
|
}));
|
|
2701
2701
|
}
|
|
@@ -2703,19 +2703,19 @@ class U extends T {
|
|
|
2703
2703
|
return Dr(N.objectKeys(this.shape));
|
|
2704
2704
|
}
|
|
2705
2705
|
}
|
|
2706
|
-
|
|
2706
|
+
V.create = (t, e) => new V(d({
|
|
2707
2707
|
shape: () => t,
|
|
2708
2708
|
unknownKeys: "strip",
|
|
2709
2709
|
catchall: Pe.create(),
|
|
2710
2710
|
typeName: E.ZodObject
|
|
2711
2711
|
}, O(e)));
|
|
2712
|
-
|
|
2712
|
+
V.strictCreate = (t, e) => new V(d({
|
|
2713
2713
|
shape: () => t,
|
|
2714
2714
|
unknownKeys: "strict",
|
|
2715
2715
|
catchall: Pe.create(),
|
|
2716
2716
|
typeName: E.ZodObject
|
|
2717
2717
|
}, O(e)));
|
|
2718
|
-
|
|
2718
|
+
V.lazycreate = (t, e) => new V(d({
|
|
2719
2719
|
shape: t,
|
|
2720
2720
|
unknownKeys: "strip",
|
|
2721
2721
|
catchall: Pe.create(),
|
|
@@ -2789,14 +2789,14 @@ Dt.create = (t, e) => new Dt(d({
|
|
|
2789
2789
|
options: t,
|
|
2790
2790
|
typeName: E.ZodUnion
|
|
2791
2791
|
}, O(e)));
|
|
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
|
|
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 Vt ? Ze(t._def.innerType) : t instanceof It ? [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 Ut ? Ze(t._def.innerType) : [];
|
|
2793
2793
|
class En extends T {
|
|
2794
2794
|
_parse(e) {
|
|
2795
2795
|
const { ctx: n } = this._processInputParams(e);
|
|
2796
|
-
if (n.parsedType !==
|
|
2796
|
+
if (n.parsedType !== _.object)
|
|
2797
2797
|
return y(n, {
|
|
2798
2798
|
code: f.invalid_type,
|
|
2799
|
-
expected:
|
|
2799
|
+
expected: _.object,
|
|
2800
2800
|
received: n.parsedType
|
|
2801
2801
|
}), S;
|
|
2802
2802
|
const s = this.discriminator, r = n.data[s], a = this.optionsMap.get(r);
|
|
@@ -2855,7 +2855,7 @@ function rs(t, e) {
|
|
|
2855
2855
|
const n = Ne(t), s = Ne(e);
|
|
2856
2856
|
if (t === e)
|
|
2857
2857
|
return { valid: !0, data: t };
|
|
2858
|
-
if (n ===
|
|
2858
|
+
if (n === _.object && s === _.object) {
|
|
2859
2859
|
const r = N.objectKeys(e), a = N.objectKeys(t).filter((o) => r.indexOf(o) !== -1), i = d(d({}, t), e);
|
|
2860
2860
|
for (const o of a) {
|
|
2861
2861
|
const c = rs(t[o], e[o]);
|
|
@@ -2864,7 +2864,7 @@ function rs(t, e) {
|
|
|
2864
2864
|
i[o] = c.data;
|
|
2865
2865
|
}
|
|
2866
2866
|
return { valid: !0, data: i };
|
|
2867
|
-
} else if (n ===
|
|
2867
|
+
} else if (n === _.array && s === _.array) {
|
|
2868
2868
|
if (t.length !== e.length)
|
|
2869
2869
|
return { valid: !1 };
|
|
2870
2870
|
const r = [];
|
|
@@ -2875,7 +2875,7 @@ function rs(t, e) {
|
|
|
2875
2875
|
r.push(c.data);
|
|
2876
2876
|
}
|
|
2877
2877
|
return { valid: !0, data: r };
|
|
2878
|
-
} else return n ===
|
|
2878
|
+
} else return n === _.date && s === _.date && +t == +e ? { valid: !0, data: t } : { valid: !1 };
|
|
2879
2879
|
}
|
|
2880
2880
|
class Mt extends T {
|
|
2881
2881
|
_parse(e) {
|
|
@@ -2917,10 +2917,10 @@ Mt.create = (t, e, n) => new Mt(d({
|
|
|
2917
2917
|
class Se extends T {
|
|
2918
2918
|
_parse(e) {
|
|
2919
2919
|
const { status: n, ctx: s } = this._processInputParams(e);
|
|
2920
|
-
if (s.parsedType !==
|
|
2920
|
+
if (s.parsedType !== _.array)
|
|
2921
2921
|
return y(s, {
|
|
2922
2922
|
code: f.invalid_type,
|
|
2923
|
-
expected:
|
|
2923
|
+
expected: _.array,
|
|
2924
2924
|
received: s.parsedType
|
|
2925
2925
|
}), S;
|
|
2926
2926
|
if (s.data.length < this._def.items.length)
|
|
@@ -2971,10 +2971,10 @@ class Lt extends T {
|
|
|
2971
2971
|
}
|
|
2972
2972
|
_parse(e) {
|
|
2973
2973
|
const { status: n, ctx: s } = this._processInputParams(e);
|
|
2974
|
-
if (s.parsedType !==
|
|
2974
|
+
if (s.parsedType !== _.object)
|
|
2975
2975
|
return y(s, {
|
|
2976
2976
|
code: f.invalid_type,
|
|
2977
|
-
expected:
|
|
2977
|
+
expected: _.object,
|
|
2978
2978
|
received: s.parsedType
|
|
2979
2979
|
}), S;
|
|
2980
2980
|
const r = [], a = this._def.keyType, i = this._def.valueType;
|
|
@@ -3010,10 +3010,10 @@ class gn extends T {
|
|
|
3010
3010
|
}
|
|
3011
3011
|
_parse(e) {
|
|
3012
3012
|
const { status: n, ctx: s } = this._processInputParams(e);
|
|
3013
|
-
if (s.parsedType !==
|
|
3013
|
+
if (s.parsedType !== _.map)
|
|
3014
3014
|
return y(s, {
|
|
3015
3015
|
code: f.invalid_type,
|
|
3016
|
-
expected:
|
|
3016
|
+
expected: _.map,
|
|
3017
3017
|
received: s.parsedType
|
|
3018
3018
|
}), S;
|
|
3019
3019
|
const r = this._def.keyType, a = this._def.valueType, i = [...s.data.entries()].map(([o, c], u) => ({
|
|
@@ -3051,10 +3051,10 @@ gn.create = (t, e, n) => new gn(d({
|
|
|
3051
3051
|
class et extends T {
|
|
3052
3052
|
_parse(e) {
|
|
3053
3053
|
const { status: n, ctx: s } = this._processInputParams(e);
|
|
3054
|
-
if (s.parsedType !==
|
|
3054
|
+
if (s.parsedType !== _.set)
|
|
3055
3055
|
return y(s, {
|
|
3056
3056
|
code: f.invalid_type,
|
|
3057
|
-
expected:
|
|
3057
|
+
expected: _.set,
|
|
3058
3058
|
received: s.parsedType
|
|
3059
3059
|
}), S;
|
|
3060
3060
|
const r = this._def;
|
|
@@ -3115,10 +3115,10 @@ class ht extends T {
|
|
|
3115
3115
|
}
|
|
3116
3116
|
_parse(e) {
|
|
3117
3117
|
const { ctx: n } = this._processInputParams(e);
|
|
3118
|
-
if (n.parsedType !==
|
|
3118
|
+
if (n.parsedType !== _.function)
|
|
3119
3119
|
return y(n, {
|
|
3120
3120
|
code: f.invalid_type,
|
|
3121
|
-
expected:
|
|
3121
|
+
expected: _.function,
|
|
3122
3122
|
received: n.parsedType
|
|
3123
3123
|
}), S;
|
|
3124
3124
|
function s(o, c) {
|
|
@@ -3307,7 +3307,7 @@ class Wt extends T {
|
|
|
3307
3307
|
}
|
|
3308
3308
|
_parse(e) {
|
|
3309
3309
|
const n = N.getValidEnumValues(this._def.values), s = this._getOrReturnCtx(e);
|
|
3310
|
-
if (s.parsedType !==
|
|
3310
|
+
if (s.parsedType !== _.string && s.parsedType !== _.number) {
|
|
3311
3311
|
const r = N.objectValues(n);
|
|
3312
3312
|
return y(s, {
|
|
3313
3313
|
expected: N.joinValues(r),
|
|
@@ -3340,13 +3340,13 @@ class vt extends T {
|
|
|
3340
3340
|
}
|
|
3341
3341
|
_parse(e) {
|
|
3342
3342
|
const { ctx: n } = this._processInputParams(e);
|
|
3343
|
-
if (n.parsedType !==
|
|
3343
|
+
if (n.parsedType !== _.promise && n.common.async === !1)
|
|
3344
3344
|
return y(n, {
|
|
3345
3345
|
code: f.invalid_type,
|
|
3346
|
-
expected:
|
|
3346
|
+
expected: _.promise,
|
|
3347
3347
|
received: n.parsedType
|
|
3348
3348
|
}), S;
|
|
3349
|
-
const s = n.parsedType ===
|
|
3349
|
+
const s = n.parsedType === _.promise ? n.data : Promise.resolve(n.data);
|
|
3350
3350
|
return ne(s.then((r) => this._def.type.parseAsync(r, {
|
|
3351
3351
|
path: n.path,
|
|
3352
3352
|
errorMap: n.common.contextualErrorMap
|
|
@@ -3446,7 +3446,7 @@ ge.createWithPreprocess = (t, e, n) => new ge(d({
|
|
|
3446
3446
|
}, O(n)));
|
|
3447
3447
|
class ke extends T {
|
|
3448
3448
|
_parse(e) {
|
|
3449
|
-
return this._getType(e) ===
|
|
3449
|
+
return this._getType(e) === _.undefined ? ne(void 0) : this._def.innerType._parse(e);
|
|
3450
3450
|
}
|
|
3451
3451
|
unwrap() {
|
|
3452
3452
|
return this._def.innerType;
|
|
@@ -3458,7 +3458,7 @@ ke.create = (t, e) => new ke(d({
|
|
|
3458
3458
|
}, O(e)));
|
|
3459
3459
|
class We extends T {
|
|
3460
3460
|
_parse(e) {
|
|
3461
|
-
return this._getType(e) ===
|
|
3461
|
+
return this._getType(e) === _.null ? ne(null) : this._def.innerType._parse(e);
|
|
3462
3462
|
}
|
|
3463
3463
|
unwrap() {
|
|
3464
3464
|
return this._def.innerType;
|
|
@@ -3468,11 +3468,11 @@ We.create = (t, e) => new We(d({
|
|
|
3468
3468
|
innerType: t,
|
|
3469
3469
|
typeName: E.ZodNullable
|
|
3470
3470
|
}, O(e)));
|
|
3471
|
-
class
|
|
3471
|
+
class Vt extends T {
|
|
3472
3472
|
_parse(e) {
|
|
3473
3473
|
const { ctx: n } = this._processInputParams(e);
|
|
3474
3474
|
let s = n.data;
|
|
3475
|
-
return n.parsedType ===
|
|
3475
|
+
return n.parsedType === _.undefined && (s = this._def.defaultValue()), this._def.innerType._parse({
|
|
3476
3476
|
data: s,
|
|
3477
3477
|
path: n.path,
|
|
3478
3478
|
parent: n
|
|
@@ -3482,12 +3482,12 @@ class Ut extends T {
|
|
|
3482
3482
|
return this._def.innerType;
|
|
3483
3483
|
}
|
|
3484
3484
|
}
|
|
3485
|
-
|
|
3485
|
+
Vt.create = (t, e) => new Vt(d({
|
|
3486
3486
|
innerType: t,
|
|
3487
3487
|
typeName: E.ZodDefault,
|
|
3488
3488
|
defaultValue: typeof e.default == "function" ? e.default : () => e.default
|
|
3489
3489
|
}, O(e)));
|
|
3490
|
-
class
|
|
3490
|
+
class Ut extends T {
|
|
3491
3491
|
_parse(e) {
|
|
3492
3492
|
const { ctx: n } = this._processInputParams(e), s = x(d({}, n), {
|
|
3493
3493
|
common: x(d({}, n.common), {
|
|
@@ -3520,18 +3520,18 @@ class Vt extends T {
|
|
|
3520
3520
|
return this._def.innerType;
|
|
3521
3521
|
}
|
|
3522
3522
|
}
|
|
3523
|
-
|
|
3523
|
+
Ut.create = (t, e) => new Ut(d({
|
|
3524
3524
|
innerType: t,
|
|
3525
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 {
|
|
3529
3529
|
_parse(e) {
|
|
3530
|
-
if (this._getType(e) !==
|
|
3530
|
+
if (this._getType(e) !== _.nan) {
|
|
3531
3531
|
const n = this._getOrReturnCtx(e);
|
|
3532
3532
|
return y(n, {
|
|
3533
3533
|
code: f.invalid_type,
|
|
3534
|
-
expected:
|
|
3534
|
+
expected: _.nan,
|
|
3535
3535
|
received: n.parsedType
|
|
3536
3536
|
}), S;
|
|
3537
3537
|
}
|
|
@@ -3631,7 +3631,7 @@ function Mr(t, e = {}, n) {
|
|
|
3631
3631
|
}) : gt.create();
|
|
3632
3632
|
}
|
|
3633
3633
|
const no = {
|
|
3634
|
-
object:
|
|
3634
|
+
object: V.lazycreate
|
|
3635
3635
|
};
|
|
3636
3636
|
var E;
|
|
3637
3637
|
(function(t) {
|
|
@@ -3639,10 +3639,10 @@ var E;
|
|
|
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 = me.create, $r = Le.create, ro = vn.create, ao = $e.create, Fr =
|
|
3642
|
+
}) => Mr((n) => n instanceof t, e), Lr = me.create, $r = Le.create, ro = vn.create, ao = $e.create, Fr = jt.create, io = Qe.create, oo = mn.create, co = It.create, uo = Zt.create, lo = gt.create, fo = Xe.create, ho = Pe.create, po = yn.create, mo = ye.create, yo = V.create, go = V.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, Ao = Fe.create, Co = Wt.create, No = vt.create, ir = ge.create, Ro = ke.create, Po = We.create, jo = ge.createWithPreprocess, Io = Jt.create, Zo = () => Lr().optional(), Do = () => $r().optional(), Mo = () => Fr().optional(), Lo = {
|
|
3643
3643
|
string: (t) => me.create(x(d({}, t), { coerce: !0 })),
|
|
3644
3644
|
number: (t) => Le.create(x(d({}, t), { coerce: !0 })),
|
|
3645
|
-
boolean: (t) =>
|
|
3645
|
+
boolean: (t) => jt.create(x(d({}, t), {
|
|
3646
3646
|
coerce: !0
|
|
3647
3647
|
})),
|
|
3648
3648
|
bigint: (t) => $e.create(x(d({}, t), { coerce: !0 })),
|
|
@@ -3654,7 +3654,7 @@ var P = /* @__PURE__ */ Object.freeze({
|
|
|
3654
3654
|
setErrorMap: Pi,
|
|
3655
3655
|
getErrorMap: ln,
|
|
3656
3656
|
makeIssue: fn,
|
|
3657
|
-
EMPTY_PATH:
|
|
3657
|
+
EMPTY_PATH: ji,
|
|
3658
3658
|
addIssueToContext: y,
|
|
3659
3659
|
ParseStatus: Y,
|
|
3660
3660
|
INVALID: S,
|
|
@@ -3670,24 +3670,24 @@ var P = /* @__PURE__ */ Object.freeze({
|
|
|
3670
3670
|
get objectUtil() {
|
|
3671
3671
|
return ts;
|
|
3672
3672
|
},
|
|
3673
|
-
ZodParsedType:
|
|
3673
|
+
ZodParsedType: _,
|
|
3674
3674
|
getParsedType: Ne,
|
|
3675
3675
|
ZodType: T,
|
|
3676
3676
|
datetimeRegex: Zr,
|
|
3677
3677
|
ZodString: me,
|
|
3678
3678
|
ZodNumber: Le,
|
|
3679
3679
|
ZodBigInt: $e,
|
|
3680
|
-
ZodBoolean:
|
|
3680
|
+
ZodBoolean: jt,
|
|
3681
3681
|
ZodDate: Qe,
|
|
3682
3682
|
ZodSymbol: mn,
|
|
3683
|
-
ZodUndefined:
|
|
3683
|
+
ZodUndefined: It,
|
|
3684
3684
|
ZodNull: Zt,
|
|
3685
3685
|
ZodAny: gt,
|
|
3686
3686
|
ZodUnknown: Xe,
|
|
3687
3687
|
ZodNever: Pe,
|
|
3688
3688
|
ZodVoid: yn,
|
|
3689
3689
|
ZodArray: ye,
|
|
3690
|
-
ZodObject:
|
|
3690
|
+
ZodObject: V,
|
|
3691
3691
|
ZodUnion: Dt,
|
|
3692
3692
|
ZodDiscriminatedUnion: En,
|
|
3693
3693
|
ZodIntersection: Mt,
|
|
@@ -3705,8 +3705,8 @@ var P = /* @__PURE__ */ Object.freeze({
|
|
|
3705
3705
|
ZodTransformer: ge,
|
|
3706
3706
|
ZodOptional: ke,
|
|
3707
3707
|
ZodNullable: We,
|
|
3708
|
-
ZodDefault:
|
|
3709
|
-
ZodCatch:
|
|
3708
|
+
ZodDefault: Vt,
|
|
3709
|
+
ZodCatch: Ut,
|
|
3710
3710
|
ZodNaN: vn,
|
|
3711
3711
|
BRAND: to,
|
|
3712
3712
|
ZodBranded: Ns,
|
|
@@ -3727,7 +3727,7 @@ var P = /* @__PURE__ */ Object.freeze({
|
|
|
3727
3727
|
date: io,
|
|
3728
3728
|
discriminatedUnion: _o,
|
|
3729
3729
|
effect: ir,
|
|
3730
|
-
enum:
|
|
3730
|
+
enum: Ao,
|
|
3731
3731
|
function: So,
|
|
3732
3732
|
instanceof: so,
|
|
3733
3733
|
intersection: bo,
|
|
@@ -3735,7 +3735,7 @@ var P = /* @__PURE__ */ Object.freeze({
|
|
|
3735
3735
|
literal: To,
|
|
3736
3736
|
map: Eo,
|
|
3737
3737
|
nan: ro,
|
|
3738
|
-
nativeEnum:
|
|
3738
|
+
nativeEnum: Co,
|
|
3739
3739
|
never: ho,
|
|
3740
3740
|
null: uo,
|
|
3741
3741
|
nullable: Po,
|
|
@@ -3745,8 +3745,8 @@ var P = /* @__PURE__ */ Object.freeze({
|
|
|
3745
3745
|
onumber: Do,
|
|
3746
3746
|
optional: Ro,
|
|
3747
3747
|
ostring: Zo,
|
|
3748
|
-
pipeline:
|
|
3749
|
-
preprocess:
|
|
3748
|
+
pipeline: Io,
|
|
3749
|
+
preprocess: jo,
|
|
3750
3750
|
promise: No,
|
|
3751
3751
|
record: ko,
|
|
3752
3752
|
set: xo,
|
|
@@ -3767,7 +3767,9 @@ var P = /* @__PURE__ */ Object.freeze({
|
|
|
3767
3767
|
P.object({
|
|
3768
3768
|
language: P.enum(["typescript", "javascript"]).optional(),
|
|
3769
3769
|
disableMarkedForExport: P.boolean().optional(),
|
|
3770
|
-
allowAutoSelectFirstNode: P.boolean().optional().default(!0)
|
|
3770
|
+
allowAutoSelectFirstNode: P.boolean().optional().default(!0),
|
|
3771
|
+
enableDisplayDataId: P.boolean().optional(),
|
|
3772
|
+
enableDisplayDataName: P.boolean().optional()
|
|
3771
3773
|
}).and(
|
|
3772
3774
|
P.union([
|
|
3773
3775
|
P.object({
|
|
@@ -3794,8 +3796,6 @@ P.object({
|
|
|
3794
3796
|
enableDisplayScreenModelId: P.boolean().optional(),
|
|
3795
3797
|
enableGeneratePackageLock: P.boolean().optional(),
|
|
3796
3798
|
enableAnimationsPreset: P.boolean().optional(),
|
|
3797
|
-
enableDisplayDataId: P.boolean().optional(),
|
|
3798
|
-
enableDisplayDataName: P.boolean().optional(),
|
|
3799
3799
|
enableAutoSplit: P.boolean().optional(),
|
|
3800
3800
|
autoSplitThreshold: P.number().optional(),
|
|
3801
3801
|
url: P.string().url().optional(),
|
|
@@ -3823,9 +3823,9 @@ function Fo(t) {
|
|
|
3823
3823
|
const { onEvent: e = Zn, onError: n = Zn, onRetry: s = Zn, onComment: r } = t;
|
|
3824
3824
|
let a = "", i = !0, o, c = "", u = "";
|
|
3825
3825
|
function h(m) {
|
|
3826
|
-
const
|
|
3827
|
-
for (const
|
|
3828
|
-
p(
|
|
3826
|
+
const v = i ? m.replace(/^\xEF\xBB\xBF/, "") : m, [l, A] = Wo(`${a}${v}`);
|
|
3827
|
+
for (const j of l)
|
|
3828
|
+
p(j);
|
|
3829
3829
|
a = A, i = !1;
|
|
3830
3830
|
}
|
|
3831
3831
|
function p(m) {
|
|
@@ -3837,31 +3837,31 @@ function Fo(t) {
|
|
|
3837
3837
|
r && r(m.slice(m.startsWith(": ") ? 2 : 1));
|
|
3838
3838
|
return;
|
|
3839
3839
|
}
|
|
3840
|
-
const
|
|
3841
|
-
if (
|
|
3842
|
-
const l = m.slice(0,
|
|
3843
|
-
k(l,
|
|
3840
|
+
const v = m.indexOf(":");
|
|
3841
|
+
if (v !== -1) {
|
|
3842
|
+
const l = m.slice(0, v), A = m[v + 1] === " " ? 2 : 1, j = m.slice(v + A);
|
|
3843
|
+
k(l, j, m);
|
|
3844
3844
|
return;
|
|
3845
3845
|
}
|
|
3846
3846
|
k(m, "", m);
|
|
3847
3847
|
}
|
|
3848
|
-
function k(m,
|
|
3848
|
+
function k(m, v, l) {
|
|
3849
3849
|
switch (m) {
|
|
3850
3850
|
case "event":
|
|
3851
|
-
u =
|
|
3851
|
+
u = v;
|
|
3852
3852
|
break;
|
|
3853
3853
|
case "data":
|
|
3854
|
-
c = `${c}${
|
|
3854
|
+
c = `${c}${v}
|
|
3855
3855
|
`;
|
|
3856
3856
|
break;
|
|
3857
3857
|
case "id":
|
|
3858
|
-
o =
|
|
3858
|
+
o = v.includes("\0") ? void 0 : v;
|
|
3859
3859
|
break;
|
|
3860
3860
|
case "retry":
|
|
3861
|
-
/^\d+$/.test(
|
|
3862
|
-
new or(`Invalid \`retry\` value: "${
|
|
3861
|
+
/^\d+$/.test(v) ? s(parseInt(v, 10)) : n(
|
|
3862
|
+
new or(`Invalid \`retry\` value: "${v}"`, {
|
|
3863
3863
|
type: "invalid-retry",
|
|
3864
|
-
value:
|
|
3864
|
+
value: v,
|
|
3865
3865
|
line: l
|
|
3866
3866
|
})
|
|
3867
3867
|
);
|
|
@@ -3870,7 +3870,7 @@ function Fo(t) {
|
|
|
3870
3870
|
n(
|
|
3871
3871
|
new or(
|
|
3872
3872
|
`Unknown field "${m.length > 20 ? `${m.slice(0, 20)}…` : m}"`,
|
|
3873
|
-
{ type: "unknown-field", field: m, value:
|
|
3873
|
+
{ type: "unknown-field", field: m, value: v, line: l }
|
|
3874
3874
|
)
|
|
3875
3875
|
);
|
|
3876
3876
|
break;
|
|
@@ -3951,7 +3951,7 @@ class cr extends Event {
|
|
|
3951
3951
|
return e(ur(this), n);
|
|
3952
3952
|
}
|
|
3953
3953
|
}
|
|
3954
|
-
function
|
|
3954
|
+
function Vo(t) {
|
|
3955
3955
|
const e = globalThis.DOMException;
|
|
3956
3956
|
return typeof e == "function" ? new e(t, "SyntaxError") : new SyntaxError(t);
|
|
3957
3957
|
}
|
|
@@ -3970,42 +3970,42 @@ function ur(t) {
|
|
|
3970
3970
|
}
|
|
3971
3971
|
var Wr = (t) => {
|
|
3972
3972
|
throw TypeError(t);
|
|
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),
|
|
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), Ce = (t, e, n) => (Rs(t, e, "access private method"), n), re, Je, ut, un, _n, Nt, ft, Rt, De, dt, pt, lt, At, pe, is, os, cs, dr, us, ds, Ct, ls, fs;
|
|
3974
3974
|
class dn extends EventTarget {
|
|
3975
3975
|
constructor(e, n) {
|
|
3976
3976
|
var s, r;
|
|
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,
|
|
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, At, null), q(this, os, (a) => je(this, null, function* () {
|
|
3978
3978
|
var i;
|
|
3979
3979
|
C(this, dt).reset();
|
|
3980
3980
|
const { body: o, redirected: c, status: u, headers: h } = a;
|
|
3981
3981
|
if (u === 204) {
|
|
3982
|
-
|
|
3982
|
+
Ce(this, pe, Ct).call(this, "Server sent HTTP 204, not reconnecting", 204), this.close();
|
|
3983
3983
|
return;
|
|
3984
3984
|
}
|
|
3985
3985
|
if (c ? W(this, ut, new URL(a.url)) : W(this, ut, void 0), u !== 200) {
|
|
3986
|
-
|
|
3986
|
+
Ce(this, pe, Ct).call(this, `Non-200 status code (${u})`, u);
|
|
3987
3987
|
return;
|
|
3988
3988
|
}
|
|
3989
3989
|
if (!(h.get("content-type") || "").startsWith("text/event-stream")) {
|
|
3990
|
-
|
|
3990
|
+
Ce(this, pe, Ct).call(this, 'Invalid content type, expected "text/event-stream"', u);
|
|
3991
3991
|
return;
|
|
3992
3992
|
}
|
|
3993
3993
|
if (C(this, re) === this.CLOSED)
|
|
3994
3994
|
return;
|
|
3995
3995
|
W(this, re, this.OPEN);
|
|
3996
3996
|
const p = new Event("open");
|
|
3997
|
-
if ((i = C(this,
|
|
3998
|
-
|
|
3997
|
+
if ((i = C(this, At)) == null || i.call(this, p), this.dispatchEvent(p), typeof o != "object" || !o || !("getReader" in o)) {
|
|
3998
|
+
Ce(this, pe, Ct).call(this, "Invalid response body, expected a web ReadableStream", u), this.close();
|
|
3999
3999
|
return;
|
|
4000
4000
|
}
|
|
4001
4001
|
const k = new TextDecoder(), g = o.getReader();
|
|
4002
4002
|
let b = !0;
|
|
4003
4003
|
do {
|
|
4004
|
-
const { done: m, value:
|
|
4005
|
-
|
|
4004
|
+
const { done: m, value: v } = yield g.read();
|
|
4005
|
+
v && C(this, dt).feed(k.decode(v, { stream: !m })), m && (b = !1, C(this, dt).reset(), Ce(this, pe, ls).call(this));
|
|
4006
4006
|
} while (b);
|
|
4007
4007
|
})), q(this, cs, (a) => {
|
|
4008
|
-
W(this, De, void 0), !(a.name === "AbortError" || a.type === "aborted") &&
|
|
4008
|
+
W(this, De, void 0), !(a.name === "AbortError" || a.type === "aborted") && Ce(this, pe, ls).call(this, as(a));
|
|
4009
4009
|
}), q(this, us, (a) => {
|
|
4010
4010
|
typeof a.id == "string" && W(this, Rt, a.id);
|
|
4011
4011
|
const i = new MessageEvent(a.event || "message", {
|
|
@@ -4017,22 +4017,22 @@ class dn extends EventTarget {
|
|
|
4017
4017
|
}), q(this, ds, (a) => {
|
|
4018
4018
|
W(this, Nt, a);
|
|
4019
4019
|
}), q(this, fs, () => {
|
|
4020
|
-
W(this, ft, void 0), C(this, re) === this.CONNECTING &&
|
|
4020
|
+
W(this, ft, void 0), C(this, re) === this.CONNECTING && Ce(this, pe, is).call(this);
|
|
4021
4021
|
});
|
|
4022
4022
|
try {
|
|
4023
4023
|
if (e instanceof URL)
|
|
4024
4024
|
W(this, Je, e);
|
|
4025
4025
|
else if (typeof e == "string")
|
|
4026
|
-
W(this, Je, new URL(e,
|
|
4026
|
+
W(this, Je, new URL(e, Uo()));
|
|
4027
4027
|
else
|
|
4028
4028
|
throw new Error("Invalid URL");
|
|
4029
4029
|
} catch (a) {
|
|
4030
|
-
throw
|
|
4030
|
+
throw Vo("An invalid or illegal string was specified");
|
|
4031
4031
|
}
|
|
4032
4032
|
W(this, dt, Fo({
|
|
4033
4033
|
onEvent: C(this, us),
|
|
4034
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),
|
|
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), Ce(this, pe, is).call(this);
|
|
4036
4036
|
}
|
|
4037
4037
|
/**
|
|
4038
4038
|
* Returns the state of this EventSource object's connection. It can have the values described below.
|
|
@@ -4081,10 +4081,10 @@ class dn extends EventTarget {
|
|
|
4081
4081
|
}
|
|
4082
4082
|
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/open_event) */
|
|
4083
4083
|
get onopen() {
|
|
4084
|
-
return C(this,
|
|
4084
|
+
return C(this, At);
|
|
4085
4085
|
}
|
|
4086
4086
|
set onopen(e) {
|
|
4087
|
-
W(this,
|
|
4087
|
+
W(this, At, e);
|
|
4088
4088
|
}
|
|
4089
4089
|
addEventListener(e, n, s) {
|
|
4090
4090
|
const r = n;
|
|
@@ -4105,13 +4105,13 @@ class dn extends EventTarget {
|
|
|
4105
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));
|
|
4106
4106
|
}
|
|
4107
4107
|
}
|
|
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(),
|
|
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(), At = /* @__PURE__ */ new WeakMap(), pe = /* @__PURE__ */ new WeakSet(), /**
|
|
4109
4109
|
* Connect to the given URL and start receiving events
|
|
4110
4110
|
*
|
|
4111
4111
|
* @internal
|
|
4112
4112
|
*/
|
|
4113
4113
|
is = function() {
|
|
4114
|
-
W(this, re, this.CONNECTING), W(this, De, new AbortController()), C(this, _n)(C(this, Je),
|
|
4114
|
+
W(this, re, this.CONNECTING), W(this, De, new AbortController()), C(this, _n)(C(this, Je), Ce(this, pe, dr).call(this)).then(C(this, os)).catch(C(this, cs));
|
|
4115
4115
|
}, os = /* @__PURE__ */ new WeakMap(), cs = /* @__PURE__ */ new WeakMap(), /**
|
|
4116
4116
|
* Get request options for the `fetch()` request
|
|
4117
4117
|
*
|
|
@@ -4125,7 +4125,7 @@ dr = function() {
|
|
|
4125
4125
|
// [spec] …will have their mode set to "cors"…
|
|
4126
4126
|
mode: "cors",
|
|
4127
4127
|
redirect: "follow",
|
|
4128
|
-
headers:
|
|
4128
|
+
headers: Be({ Accept: "text/event-stream" }, C(this, Rt) ? { "Last-Event-ID": C(this, Rt) } : void 0),
|
|
4129
4129
|
cache: "no-store",
|
|
4130
4130
|
signal: (t = C(this, De)) == null ? void 0 : t.signal
|
|
4131
4131
|
};
|
|
@@ -4137,7 +4137,7 @@ dr = function() {
|
|
|
4137
4137
|
* @param code - The HTTP status code, if available
|
|
4138
4138
|
* @internal
|
|
4139
4139
|
*/
|
|
4140
|
-
|
|
4140
|
+
Ct = function(t, e) {
|
|
4141
4141
|
var n;
|
|
4142
4142
|
C(this, re) !== this.CLOSED && W(this, re, this.CLOSED);
|
|
4143
4143
|
const s = new cr("error", { code: e, message: t });
|
|
@@ -4172,11 +4172,11 @@ dn.OPEN = 1, /**
|
|
|
4172
4172
|
* @public
|
|
4173
4173
|
*/
|
|
4174
4174
|
dn.CLOSED = 2;
|
|
4175
|
-
function
|
|
4175
|
+
function Uo() {
|
|
4176
4176
|
const t = "document" in globalThis ? globalThis.document : void 0;
|
|
4177
4177
|
return t && typeof t == "object" && "baseURI" in t && typeof t.baseURI == "string" ? t.baseURI : void 0;
|
|
4178
4178
|
}
|
|
4179
|
-
var
|
|
4179
|
+
var Vr = Symbol.for("immer-nothing"), lr = Symbol.for("immer-draftable"), ce = Symbol.for("immer-state"), zo = process.env.NODE_ENV !== "production" ? [
|
|
4180
4180
|
// All error codes, starting by 0:
|
|
4181
4181
|
function(t) {
|
|
4182
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.`;
|
|
@@ -4222,17 +4222,17 @@ function bt(t) {
|
|
|
4222
4222
|
}
|
|
4223
4223
|
function tt(t) {
|
|
4224
4224
|
var e;
|
|
4225
|
-
return t ?
|
|
4225
|
+
return t ? Ur(t) || Array.isArray(t) || !!t[lr] || !!((e = t.constructor) != null && e[lr]) || Sn(t) || On(t) : !1;
|
|
4226
4226
|
}
|
|
4227
|
-
var
|
|
4228
|
-
function
|
|
4227
|
+
var Bo = Object.prototype.constructor.toString();
|
|
4228
|
+
function Ur(t) {
|
|
4229
4229
|
if (!t || typeof t != "object")
|
|
4230
4230
|
return !1;
|
|
4231
4231
|
const e = _t(t);
|
|
4232
4232
|
if (e === null)
|
|
4233
4233
|
return !0;
|
|
4234
4234
|
const n = Object.hasOwnProperty.call(e, "constructor") && e.constructor;
|
|
4235
|
-
return n === Object ? !0 : typeof n == "function" && Function.toString.call(n) ===
|
|
4235
|
+
return n === Object ? !0 : typeof n == "function" && Function.toString.call(n) === Bo;
|
|
4236
4236
|
}
|
|
4237
4237
|
function bn(t, e) {
|
|
4238
4238
|
xn(t) === 0 ? Reflect.ownKeys(t).forEach((n) => {
|
|
@@ -4250,7 +4250,7 @@ function zr(t, e, n) {
|
|
|
4250
4250
|
const s = xn(t);
|
|
4251
4251
|
s === 2 ? t.set(e, n) : s === 3 ? t.add(n) : t[e] = n;
|
|
4252
4252
|
}
|
|
4253
|
-
function
|
|
4253
|
+
function Ko(t, e) {
|
|
4254
4254
|
return t === e ? t !== 0 || 1 / t === 1 / e : t !== t && e !== e;
|
|
4255
4255
|
}
|
|
4256
4256
|
function Sn(t) {
|
|
@@ -4269,7 +4269,7 @@ function ps(t, e) {
|
|
|
4269
4269
|
return new Set(t);
|
|
4270
4270
|
if (Array.isArray(t))
|
|
4271
4271
|
return Array.prototype.slice.call(t);
|
|
4272
|
-
const n =
|
|
4272
|
+
const n = Ur(t);
|
|
4273
4273
|
if (e === !0 || e === "class_only" && !n) {
|
|
4274
4274
|
const s = Object.getOwnPropertyDescriptors(t);
|
|
4275
4275
|
delete s[ce];
|
|
@@ -4288,13 +4288,13 @@ function ps(t, e) {
|
|
|
4288
4288
|
} else {
|
|
4289
4289
|
const s = _t(t);
|
|
4290
4290
|
if (s !== null && n)
|
|
4291
|
-
return
|
|
4291
|
+
return Be({}, t);
|
|
4292
4292
|
const r = Object.create(s);
|
|
4293
4293
|
return Object.assign(r, t);
|
|
4294
4294
|
}
|
|
4295
4295
|
}
|
|
4296
|
-
function
|
|
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]) =>
|
|
4296
|
+
function Bt(t, e = !1) {
|
|
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]) => Bt(s, !0))), t;
|
|
4298
4298
|
}
|
|
4299
4299
|
function qo() {
|
|
4300
4300
|
ae(2);
|
|
@@ -4307,9 +4307,9 @@ function nt(t) {
|
|
|
4307
4307
|
const e = Ho[t];
|
|
4308
4308
|
return e || ae(0, t), e;
|
|
4309
4309
|
}
|
|
4310
|
-
var
|
|
4311
|
-
function
|
|
4312
|
-
return
|
|
4310
|
+
var Kt;
|
|
4311
|
+
function Br() {
|
|
4312
|
+
return Kt;
|
|
4313
4313
|
}
|
|
4314
4314
|
function Go(t, e) {
|
|
4315
4315
|
return {
|
|
@@ -4329,10 +4329,10 @@ function ms(t) {
|
|
|
4329
4329
|
ys(t), t.drafts_.forEach(Jo), t.drafts_ = null;
|
|
4330
4330
|
}
|
|
4331
4331
|
function ys(t) {
|
|
4332
|
-
t ===
|
|
4332
|
+
t === Kt && (Kt = t.parent_);
|
|
4333
4333
|
}
|
|
4334
4334
|
function hr(t) {
|
|
4335
|
-
return
|
|
4335
|
+
return Kt = Go(Kt, t);
|
|
4336
4336
|
}
|
|
4337
4337
|
function Jo(t) {
|
|
4338
4338
|
const e = t[ce];
|
|
@@ -4346,7 +4346,7 @@ function pr(t, e) {
|
|
|
4346
4346
|
t,
|
|
4347
4347
|
e.patches_,
|
|
4348
4348
|
e.inversePatches_
|
|
4349
|
-
)) : t = wn(e, n, []), ms(e), e.patches_ && e.patchListener_(e.patches_, e.inversePatches_), t !==
|
|
4349
|
+
)) : t = wn(e, n, []), ms(e), e.patches_ && e.patchListener_(e.patches_, e.inversePatches_), t !== Vr ? t : void 0;
|
|
4350
4350
|
}
|
|
4351
4351
|
function wn(t, e, n) {
|
|
4352
4352
|
if (Tn(e))
|
|
@@ -4393,13 +4393,13 @@ function mr(t, e, n, s, r, a, i) {
|
|
|
4393
4393
|
}
|
|
4394
4394
|
}
|
|
4395
4395
|
function kn(t, e, n = !1) {
|
|
4396
|
-
!t.parent_ && t.immer_.autoFreeze_ && t.canAutoFreeze_ &&
|
|
4396
|
+
!t.parent_ && t.immer_.autoFreeze_ && t.canAutoFreeze_ && Bt(e, n);
|
|
4397
4397
|
}
|
|
4398
4398
|
function Xo(t, e) {
|
|
4399
4399
|
const n = Array.isArray(t), s = {
|
|
4400
4400
|
type_: n ? 1 : 0,
|
|
4401
4401
|
// Track which produce call this is associated with.
|
|
4402
|
-
scope_: e ? e.scope_ :
|
|
4402
|
+
scope_: e ? e.scope_ : Br(),
|
|
4403
4403
|
// True for both shallow and deep changes.
|
|
4404
4404
|
modified_: !1,
|
|
4405
4405
|
// Used during finalization.
|
|
@@ -4441,14 +4441,14 @@ var Ps = {
|
|
|
4441
4441
|
return Reflect.ownKeys(qe(t));
|
|
4442
4442
|
},
|
|
4443
4443
|
set(t, e, n) {
|
|
4444
|
-
const s =
|
|
4444
|
+
const s = Kr(qe(t), e);
|
|
4445
4445
|
if (s != null && s.set)
|
|
4446
4446
|
return s.set.call(t.draft_, n), !0;
|
|
4447
4447
|
if (!t.modified_) {
|
|
4448
4448
|
const r = Dn(qe(t), e), a = r == null ? void 0 : r[ce];
|
|
4449
4449
|
if (a && a.base_ === n)
|
|
4450
4450
|
return t.copy_[e] = n, t.assigned_[e] = !1, !0;
|
|
4451
|
-
if (
|
|
4451
|
+
if (Ko(n, r) && (n !== void 0 || hs(t.base_, e)))
|
|
4452
4452
|
return !0;
|
|
4453
4453
|
Mn(t), gs(t);
|
|
4454
4454
|
}
|
|
@@ -4497,14 +4497,14 @@ function Dn(t, e) {
|
|
|
4497
4497
|
}
|
|
4498
4498
|
function Yo(t, e, n) {
|
|
4499
4499
|
var r;
|
|
4500
|
-
const s =
|
|
4500
|
+
const s = Kr(e, n);
|
|
4501
4501
|
return s ? "value" in s ? s.value : (
|
|
4502
4502
|
// This is a very special case, if the prop is a getter defined by the
|
|
4503
4503
|
// prototype, we should invoke it with the draft as context!
|
|
4504
4504
|
(r = s.get) == null ? void 0 : r.call(t.draft_)
|
|
4505
4505
|
) : void 0;
|
|
4506
4506
|
}
|
|
4507
|
-
function
|
|
4507
|
+
function Kr(t, e) {
|
|
4508
4508
|
if (!(e in t))
|
|
4509
4509
|
return;
|
|
4510
4510
|
let n = _t(t);
|
|
@@ -4547,7 +4547,7 @@ var Qo = class {
|
|
|
4547
4547
|
}
|
|
4548
4548
|
return fr(a, s), pr(r, a);
|
|
4549
4549
|
} else if (!e || typeof e != "object") {
|
|
4550
|
-
if (r = n(e), r === void 0 && (r = e), r ===
|
|
4550
|
+
if (r = n(e), r === void 0 && (r = e), r === Vr && (r = void 0), this.autoFreeze_ && Bt(r, !0), s) {
|
|
4551
4551
|
const a = [], i = [];
|
|
4552
4552
|
nt("Patches").generateReplacementPatches_(e, r, a, i), s(a, i);
|
|
4553
4553
|
}
|
|
@@ -4609,7 +4609,7 @@ var Qo = class {
|
|
|
4609
4609
|
};
|
|
4610
4610
|
function vs(t, e) {
|
|
4611
4611
|
const n = Sn(t) ? nt("MapSet").proxyMap_(t, e) : On(t) ? nt("MapSet").proxySet_(t, e) : Xo(t, e);
|
|
4612
|
-
return (e ? e.scope_ :
|
|
4612
|
+
return (e ? e.scope_ : Br()).drafts_.push(n), n;
|
|
4613
4613
|
}
|
|
4614
4614
|
function ec(t) {
|
|
4615
4615
|
return bt(t) || ae(10, t), qr(t);
|
|
@@ -4640,16 +4640,17 @@ ue.createDraft.bind(ue);
|
|
|
4640
4640
|
ue.finishDraft.bind(ue);
|
|
4641
4641
|
function nc(t) {
|
|
4642
4642
|
var e = la(function() {
|
|
4643
|
-
return
|
|
4643
|
+
return Bt(typeof t == "function" ? t() : t, !0);
|
|
4644
4644
|
}), n = e[1];
|
|
4645
4645
|
return [e[0], rn(function(s) {
|
|
4646
|
-
n(typeof s == "function" ? tc(s) :
|
|
4646
|
+
n(typeof s == "function" ? tc(s) : Bt(s));
|
|
4647
4647
|
}, [])];
|
|
4648
4648
|
}
|
|
4649
4649
|
const yr = 10, gr = {
|
|
4650
4650
|
status: "idle",
|
|
4651
4651
|
error: null,
|
|
4652
4652
|
result: null,
|
|
4653
|
+
progressMessages: [],
|
|
4653
4654
|
tasks: {
|
|
4654
4655
|
fetchDesign: { status: "pending" },
|
|
4655
4656
|
codeGeneration: { status: "pending", progress: 0 },
|
|
@@ -4668,7 +4669,7 @@ const yr = 10, gr = {
|
|
|
4668
4669
|
}) => {
|
|
4669
4670
|
const [n, s] = nc(gr);
|
|
4670
4671
|
return {
|
|
4671
|
-
getCode: (a) =>
|
|
4672
|
+
getCode: (a) => je(void 0, null, function* () {
|
|
4672
4673
|
var h, p, k;
|
|
4673
4674
|
s((g) => {
|
|
4674
4675
|
g.status = "pending", g.error = null, g.result = null, g.tasks = gr.tasks;
|
|
@@ -4685,72 +4686,79 @@ const yr = 10, gr = {
|
|
|
4685
4686
|
}
|
|
4686
4687
|
let o;
|
|
4687
4688
|
const c = new dn(t, {
|
|
4688
|
-
fetch: (g, b) => (o = fetch(g,
|
|
4689
|
+
fetch: (g, b) => (o = fetch(g, Ks(Be({}, b), {
|
|
4689
4690
|
method: e,
|
|
4690
4691
|
body: JSON.stringify(a)
|
|
4691
4692
|
})), o)
|
|
4692
4693
|
}), u = new Promise((g) => {
|
|
4693
4694
|
const b = {};
|
|
4694
|
-
c.addEventListener("start", (
|
|
4695
|
-
const l = JSON.parse(
|
|
4695
|
+
c.addEventListener("start", (v) => {
|
|
4696
|
+
const l = JSON.parse(v.data);
|
|
4696
4697
|
b.sessionId = l.sessionId, s((A) => {
|
|
4697
4698
|
A.tasks.fetchDesign.status = "running";
|
|
4698
4699
|
});
|
|
4699
|
-
}), c.addEventListener("pre_codegen", (
|
|
4700
|
+
}), c.addEventListener("pre_codegen", (v) => {
|
|
4700
4701
|
JSON.parse(
|
|
4701
|
-
|
|
4702
|
+
v.data
|
|
4702
4703
|
).message === "Anima model built" && s((A) => {
|
|
4703
4704
|
A.tasks.fetchDesign.status = "finished", A.tasks.codeGeneration.status = "running", A.tasks.uploadAssets.status = "running";
|
|
4704
4705
|
});
|
|
4705
|
-
}), c.addEventListener("figma_metadata", (
|
|
4706
|
+
}), c.addEventListener("figma_metadata", (v) => {
|
|
4706
4707
|
const l = JSON.parse(
|
|
4707
|
-
|
|
4708
|
+
v.data
|
|
4708
4709
|
);
|
|
4709
4710
|
b.figmaFileName = l.figmaFileName, b.figmaSelectedFrameName = l.figmaSelectedFrameName;
|
|
4710
4711
|
}), c.addEventListener("aborted", () => {
|
|
4711
|
-
const
|
|
4712
|
+
const v = new Gs({ name: "Aborted", reason: "Unknown" });
|
|
4712
4713
|
s((l) => {
|
|
4713
|
-
l.status = "aborted", l.result = null, l.error =
|
|
4714
|
+
l.status = "aborted", l.result = null, l.error = v;
|
|
4714
4715
|
}), g({
|
|
4715
4716
|
result: null,
|
|
4716
|
-
error:
|
|
4717
|
+
error: v
|
|
4717
4718
|
});
|
|
4718
|
-
}), c.addEventListener("generating_code", (
|
|
4719
|
+
}), c.addEventListener("generating_code", (v) => {
|
|
4719
4720
|
const l = JSON.parse(
|
|
4720
|
-
|
|
4721
|
+
v.data
|
|
4721
4722
|
);
|
|
4722
4723
|
l.payload.status === "success" && (b.files = l.payload.files), s((A) => {
|
|
4723
4724
|
A.tasks.codeGeneration.progress = l.payload.progress, A.tasks.codeGeneration.status = "running";
|
|
4724
4725
|
});
|
|
4726
|
+
}), c.addEventListener("progress_messages_updated", (v) => {
|
|
4727
|
+
const l = JSON.parse(
|
|
4728
|
+
v.data
|
|
4729
|
+
);
|
|
4730
|
+
s((A) => {
|
|
4731
|
+
A.progressMessages = l.payload.progressMessages;
|
|
4732
|
+
});
|
|
4725
4733
|
}), c.addEventListener("codegen_completed", () => {
|
|
4726
|
-
s((
|
|
4727
|
-
|
|
4734
|
+
s((v) => {
|
|
4735
|
+
v.tasks.codeGeneration.status = "finished";
|
|
4728
4736
|
});
|
|
4729
4737
|
}), c.addEventListener("generation_completed", () => {
|
|
4730
|
-
s((
|
|
4731
|
-
|
|
4738
|
+
s((v) => {
|
|
4739
|
+
v.tasks.codeGeneration.status = "finished";
|
|
4732
4740
|
});
|
|
4733
4741
|
}), c.addEventListener("assets_uploaded", () => {
|
|
4734
|
-
s((
|
|
4735
|
-
|
|
4742
|
+
s((v) => {
|
|
4743
|
+
v.tasks.uploadAssets.status = "finished";
|
|
4736
4744
|
});
|
|
4737
|
-
}), c.addEventListener("assets_list", (
|
|
4745
|
+
}), c.addEventListener("assets_list", (v) => {
|
|
4738
4746
|
const l = JSON.parse(
|
|
4739
|
-
|
|
4747
|
+
v.data
|
|
4740
4748
|
);
|
|
4741
4749
|
b.assets = l.payload.assets;
|
|
4742
4750
|
});
|
|
4743
4751
|
let m = 0;
|
|
4744
|
-
c.addEventListener("error", (
|
|
4745
|
-
var
|
|
4752
|
+
c.addEventListener("error", (v) => je(void 0, null, function* () {
|
|
4753
|
+
var U, D, M;
|
|
4746
4754
|
console.warn(
|
|
4747
4755
|
`Experienced error during code generation (attempt ${m + 1} / ${yr})`,
|
|
4748
|
-
|
|
4756
|
+
v
|
|
4749
4757
|
);
|
|
4750
|
-
let l, A,
|
|
4758
|
+
let l, A, j = !1;
|
|
4751
4759
|
try {
|
|
4752
|
-
if (
|
|
4753
|
-
l = JSON.parse(
|
|
4760
|
+
if (v instanceof MessageEvent)
|
|
4761
|
+
l = JSON.parse(v.data);
|
|
4754
4762
|
else {
|
|
4755
4763
|
const G = yield o;
|
|
4756
4764
|
A = G.status;
|
|
@@ -4759,10 +4767,10 @@ const yr = 10, gr = {
|
|
|
4759
4767
|
} catch ($) {
|
|
4760
4768
|
}
|
|
4761
4769
|
}
|
|
4762
|
-
(((
|
|
4770
|
+
(((U = l == null ? void 0 : l.payload) == null ? void 0 : U.name) === "Task Crashed" || A === 429) && (j = !0);
|
|
4763
4771
|
} catch (G) {
|
|
4764
4772
|
}
|
|
4765
|
-
const
|
|
4773
|
+
const B = new Gs({
|
|
4766
4774
|
name: (D = l == null ? void 0 : l.payload.name) != null ? D : "Unknown error",
|
|
4767
4775
|
reason: (M = l == null ? void 0 : l.payload.message) != null ? M : "Unknown",
|
|
4768
4776
|
status: l == null ? void 0 : l.payload.status,
|
|
@@ -4770,14 +4778,14 @@ const yr = 10, gr = {
|
|
|
4770
4778
|
});
|
|
4771
4779
|
m++;
|
|
4772
4780
|
let Z = !1;
|
|
4773
|
-
m > yr ? (console.error("Experienced too many errors, terminating request"), Z = !0) :
|
|
4774
|
-
G.status = "error", G.error =
|
|
4781
|
+
m > yr ? (console.error("Experienced too many errors, terminating request"), Z = !0) : j && (console.error("Experienced unrecoverable error, terminating request"), Z = !0), Z && (s((G) => {
|
|
4782
|
+
G.status = "error", G.error = B;
|
|
4775
4783
|
}), g({
|
|
4776
4784
|
result: null,
|
|
4777
|
-
error:
|
|
4785
|
+
error: B
|
|
4778
4786
|
}));
|
|
4779
|
-
})), c.addEventListener("done", (
|
|
4780
|
-
const l = JSON.parse(
|
|
4787
|
+
})), c.addEventListener("done", (v) => {
|
|
4788
|
+
const l = JSON.parse(v.data);
|
|
4781
4789
|
b.tokenUsage = l.payload.tokenUsage, b.sessionId = l.payload.sessionId, s((A) => {
|
|
4782
4790
|
A.status = "success", A.result = b;
|
|
4783
4791
|
}), g({ result: b, error: null });
|
|
@@ -4786,23 +4794,23 @@ const yr = 10, gr = {
|
|
|
4786
4794
|
try {
|
|
4787
4795
|
const { result: g, error: b } = yield u, m = structuredClone(g);
|
|
4788
4796
|
if (((p = i.assetsStorage) == null ? void 0 : p.strategy) === "local" && ((k = m == null ? void 0 : m.assets) != null && k.length)) {
|
|
4789
|
-
const { filePath:
|
|
4797
|
+
const { filePath: v } = vr(
|
|
4790
4798
|
i.assetsStorage
|
|
4791
|
-
), l = m.assets.map((
|
|
4792
|
-
const Z = yield (yield fetch(
|
|
4799
|
+
), l = m.assets.map((j) => je(void 0, null, function* () {
|
|
4800
|
+
const Z = yield (yield fetch(j.url)).arrayBuffer();
|
|
4793
4801
|
return {
|
|
4794
|
-
assetName:
|
|
4802
|
+
assetName: j.name,
|
|
4795
4803
|
base64: va(Z)
|
|
4796
4804
|
};
|
|
4797
4805
|
})), A = yield Promise.allSettled(l);
|
|
4798
|
-
for (const
|
|
4799
|
-
const
|
|
4800
|
-
if (
|
|
4801
|
-
const { assetName: Z, base64:
|
|
4802
|
-
|
|
4803
|
-
const D =
|
|
4806
|
+
for (const j of A) {
|
|
4807
|
+
const B = {};
|
|
4808
|
+
if (j.status === "fulfilled") {
|
|
4809
|
+
const { assetName: Z, base64: U } = j.value;
|
|
4810
|
+
B[Z] = U;
|
|
4811
|
+
const D = v ? `${v}/${Z}` : Z;
|
|
4804
4812
|
m.files[D] = {
|
|
4805
|
-
content:
|
|
4813
|
+
content: U,
|
|
4806
4814
|
isBinary: !0
|
|
4807
4815
|
};
|
|
4808
4816
|
}
|
|
@@ -4814,6 +4822,7 @@ const yr = 10, gr = {
|
|
|
4814
4822
|
}
|
|
4815
4823
|
}),
|
|
4816
4824
|
status: n.status,
|
|
4825
|
+
progressMessages: n.progressMessages,
|
|
4817
4826
|
tasks: n.tasks,
|
|
4818
4827
|
error: n.error,
|
|
4819
4828
|
result: n.result
|
|
@@ -4839,16 +4848,16 @@ function sc() {
|
|
|
4839
4848
|
}
|
|
4840
4849
|
var n = typeof Object.is == "function" ? Object.is : e, s = t.useState, r = t.useEffect, a = t.useLayoutEffect, i = t.useDebugValue;
|
|
4841
4850
|
function o(p, k) {
|
|
4842
|
-
var g = k(), b = s({ inst: { value: g, getSnapshot: k } }), m = b[0].inst,
|
|
4851
|
+
var g = k(), b = s({ inst: { value: g, getSnapshot: k } }), m = b[0].inst, v = b[1];
|
|
4843
4852
|
return a(
|
|
4844
4853
|
function() {
|
|
4845
|
-
m.value = g, m.getSnapshot = k, c(m) &&
|
|
4854
|
+
m.value = g, m.getSnapshot = k, c(m) && v({ inst: m });
|
|
4846
4855
|
},
|
|
4847
4856
|
[p, g, k]
|
|
4848
4857
|
), r(
|
|
4849
4858
|
function() {
|
|
4850
|
-
return c(m) &&
|
|
4851
|
-
c(m) &&
|
|
4859
|
+
return c(m) && v({ inst: m }), p(function() {
|
|
4860
|
+
c(m) && v({ inst: m });
|
|
4852
4861
|
});
|
|
4853
4862
|
},
|
|
4854
4863
|
[p]
|
|
@@ -4892,15 +4901,15 @@ function rc() {
|
|
|
4892
4901
|
));
|
|
4893
4902
|
var m = b();
|
|
4894
4903
|
if (!p) {
|
|
4895
|
-
var
|
|
4896
|
-
a(m,
|
|
4904
|
+
var v = b();
|
|
4905
|
+
a(m, v) || (console.error(
|
|
4897
4906
|
"The result of getSnapshot should be cached to avoid an infinite loop"
|
|
4898
4907
|
), p = !0);
|
|
4899
4908
|
}
|
|
4900
|
-
|
|
4909
|
+
v = i({
|
|
4901
4910
|
inst: { value: m, getSnapshot: b }
|
|
4902
4911
|
});
|
|
4903
|
-
var l =
|
|
4912
|
+
var l = v[0].inst, A = v[1];
|
|
4904
4913
|
return c(
|
|
4905
4914
|
function() {
|
|
4906
4915
|
l.value = m, l.getSnapshot = b, n(l) && A({ inst: l });
|
|
@@ -4921,7 +4930,7 @@ function rc() {
|
|
|
4921
4930
|
try {
|
|
4922
4931
|
var m = b();
|
|
4923
4932
|
return !a(g, m);
|
|
4924
|
-
} catch (
|
|
4933
|
+
} catch (v) {
|
|
4925
4934
|
return !0;
|
|
4926
4935
|
}
|
|
4927
4936
|
}
|
|
@@ -4964,7 +4973,7 @@ const Re = /* @__PURE__ */ new WeakMap(), Me = () => {
|
|
|
4964
4973
|
}, te = (
|
|
4965
4974
|
/*#__NOINLINE__*/
|
|
4966
4975
|
Me()
|
|
4967
|
-
), bs = Object, R = (t) => t === te, we = (t) => typeof t == "function",
|
|
4976
|
+
), bs = Object, R = (t) => t === te, we = (t) => typeof t == "function", Ve = (t, e) => Be(Be({}, t), e), Xr = (t) => we(t.then), Fn = {}, nn = {}, js = "undefined", Xt = typeof window != js, ws = typeof document != js, oc = Xt && "Deno" in window, cc = () => Xt && typeof window.requestAnimationFrame != js, Yr = (t, e) => {
|
|
4968
4977
|
const n = Re.get(t);
|
|
4969
4978
|
return [
|
|
4970
4979
|
// Getter
|
|
@@ -4973,7 +4982,7 @@ const Re = /* @__PURE__ */ new WeakMap(), Me = () => {
|
|
|
4973
4982
|
(s) => {
|
|
4974
4983
|
if (!R(e)) {
|
|
4975
4984
|
const r = t.get(e);
|
|
4976
|
-
e in nn || (nn[e] = r), n[5](e,
|
|
4985
|
+
e in nn || (nn[e] = r), n[5](e, Ve(r, s), r || Fn);
|
|
4977
4986
|
}
|
|
4978
4987
|
},
|
|
4979
4988
|
// Subscriber
|
|
@@ -5009,13 +5018,13 @@ const uc = () => ks, [Es, xs] = Xt && window.addEventListener ? [
|
|
|
5009
5018
|
}, pc = {
|
|
5010
5019
|
initFocus: lc,
|
|
5011
5020
|
initReconnect: fc
|
|
5012
|
-
}, xr = !Gt.useId, Ht = !Xt || oc, mc = (t) => cc() ? window.requestAnimationFrame(t) : setTimeout(t, 1), Wn = Ht ? ha : pa,
|
|
5021
|
+
}, xr = !Gt.useId, Ht = !Xt || oc, mc = (t) => cc() ? window.requestAnimationFrame(t) : setTimeout(t, 1), Wn = Ht ? ha : pa, Vn = typeof navigator != "undefined" && navigator.connection, Sr = !Ht && Vn && ([
|
|
5013
5022
|
"slow-2g",
|
|
5014
5023
|
"2g"
|
|
5015
|
-
].includes(
|
|
5024
|
+
].includes(Vn.effectiveType) || Vn.saveData), sn = /* @__PURE__ */ new WeakMap(), Un = (t, e) => bs.prototype.toString.call(t) === `[object ${e}]`;
|
|
5016
5025
|
let yc = 0;
|
|
5017
5026
|
const Ss = (t) => {
|
|
5018
|
-
const e = typeof t, n =
|
|
5027
|
+
const e = typeof t, n = Un(t, "Date"), s = Un(t, "RegExp"), r = Un(t, "Object");
|
|
5019
5028
|
let a, i;
|
|
5020
5029
|
if (bs(t) === t && !n && !s) {
|
|
5021
5030
|
if (a = sn.get(t), a) return a;
|
|
@@ -5034,7 +5043,7 @@ const Ss = (t) => {
|
|
|
5034
5043
|
} else
|
|
5035
5044
|
a = n ? t.toJSON() : e == "symbol" ? t.toString() : e == "string" ? JSON.stringify(t) : "" + t;
|
|
5036
5045
|
return a;
|
|
5037
|
-
},
|
|
5046
|
+
}, Is = (t) => {
|
|
5038
5047
|
if (we(t))
|
|
5039
5048
|
try {
|
|
5040
5049
|
t = t();
|
|
@@ -5050,8 +5059,8 @@ const Ss = (t) => {
|
|
|
5050
5059
|
let gc = 0;
|
|
5051
5060
|
const Os = () => ++gc;
|
|
5052
5061
|
function Qr(...t) {
|
|
5053
|
-
return
|
|
5054
|
-
const [e, n, s, r] = t, a =
|
|
5062
|
+
return je(this, null, function* () {
|
|
5063
|
+
const [e, n, s, r] = t, a = Ve({
|
|
5055
5064
|
populateCache: !0,
|
|
5056
5065
|
throwOnError: !0
|
|
5057
5066
|
}, typeof r == "boolean" ? {
|
|
@@ -5070,44 +5079,44 @@ function Qr(...t) {
|
|
|
5070
5079
|
}
|
|
5071
5080
|
return p(n);
|
|
5072
5081
|
function p(k) {
|
|
5073
|
-
return
|
|
5074
|
-
const [g] =
|
|
5082
|
+
return je(this, null, function* () {
|
|
5083
|
+
const [g] = Is(k);
|
|
5075
5084
|
if (!g) return;
|
|
5076
|
-
const [b, m] = Yr(e, g), [
|
|
5077
|
-
const fe =
|
|
5078
|
-
return (we(a.revalidate) ? a.revalidate(b().data, k) : a.revalidate !== !1) && (delete A[g], delete
|
|
5085
|
+
const [b, m] = Yr(e, g), [v, l, A, j] = Re.get(e), B = () => {
|
|
5086
|
+
const fe = v[g];
|
|
5087
|
+
return (we(a.revalidate) ? a.revalidate(b().data, k) : a.revalidate !== !1) && (delete A[g], delete j[g], fe && fe[0]) ? fe[0](Jr).then(() => b().data) : b().data;
|
|
5079
5088
|
};
|
|
5080
5089
|
if (t.length < 3)
|
|
5081
|
-
return
|
|
5082
|
-
let Z = s,
|
|
5090
|
+
return B();
|
|
5091
|
+
let Z = s, U;
|
|
5083
5092
|
const D = Os();
|
|
5084
5093
|
l[g] = [
|
|
5085
5094
|
D,
|
|
5086
5095
|
0
|
|
5087
5096
|
];
|
|
5088
|
-
const M = !R(c), G = b(), $ = G.data, st = G._c,
|
|
5089
|
-
if (M && (c = we(c) ? c(
|
|
5097
|
+
const M = !R(c), G = b(), $ = G.data, st = G._c, Ue = R(st) ? $ : st;
|
|
5098
|
+
if (M && (c = we(c) ? c(Ue, $) : c, m({
|
|
5090
5099
|
data: c,
|
|
5091
|
-
_c:
|
|
5100
|
+
_c: Ue
|
|
5092
5101
|
})), we(Z))
|
|
5093
5102
|
try {
|
|
5094
|
-
Z = Z(
|
|
5103
|
+
Z = Z(Ue);
|
|
5095
5104
|
} catch (fe) {
|
|
5096
|
-
|
|
5105
|
+
U = fe;
|
|
5097
5106
|
}
|
|
5098
5107
|
if (Z && Xr(Z))
|
|
5099
5108
|
if (Z = yield Z.catch((fe) => {
|
|
5100
|
-
|
|
5109
|
+
U = fe;
|
|
5101
5110
|
}), D !== l[g][0]) {
|
|
5102
|
-
if (
|
|
5111
|
+
if (U) throw U;
|
|
5103
5112
|
return Z;
|
|
5104
|
-
} else
|
|
5105
|
-
data:
|
|
5113
|
+
} else U && M && u(U) && (i = !0, m({
|
|
5114
|
+
data: Ue,
|
|
5106
5115
|
_c: te
|
|
5107
5116
|
}));
|
|
5108
|
-
if (i && !
|
|
5117
|
+
if (i && !U)
|
|
5109
5118
|
if (we(i)) {
|
|
5110
|
-
const fe = i(Z,
|
|
5119
|
+
const fe = i(Z, Ue);
|
|
5111
5120
|
m({
|
|
5112
5121
|
data: fe,
|
|
5113
5122
|
error: te,
|
|
@@ -5119,12 +5128,12 @@ function Qr(...t) {
|
|
|
5119
5128
|
error: te,
|
|
5120
5129
|
_c: te
|
|
5121
5130
|
});
|
|
5122
|
-
if (l[g][1] = Os(), Promise.resolve(
|
|
5131
|
+
if (l[g][1] = Os(), Promise.resolve(B()).then(() => {
|
|
5123
5132
|
m({
|
|
5124
5133
|
_c: te
|
|
5125
5134
|
});
|
|
5126
|
-
}),
|
|
5127
|
-
if (h) throw
|
|
5135
|
+
}), U) {
|
|
5136
|
+
if (h) throw U;
|
|
5128
5137
|
return;
|
|
5129
5138
|
}
|
|
5130
5139
|
return Z;
|
|
@@ -5137,7 +5146,7 @@ const Or = (t, e) => {
|
|
|
5137
5146
|
t[n][0] && t[n][0](e);
|
|
5138
5147
|
}, vc = (t, e) => {
|
|
5139
5148
|
if (!Re.has(t)) {
|
|
5140
|
-
const n =
|
|
5149
|
+
const n = Ve(pc, e), s = /* @__PURE__ */ Object.create(null), r = Qr.bind(te, t);
|
|
5141
5150
|
let a = Me;
|
|
5142
5151
|
const i = /* @__PURE__ */ Object.create(null), o = (h, p) => {
|
|
5143
5152
|
const k = i[h] || [];
|
|
@@ -5178,7 +5187,7 @@ const Or = (t, e) => {
|
|
|
5178
5187
|
}, _c = (t, e, n, s, r) => {
|
|
5179
5188
|
const a = n.errorRetryCount, i = r.retryCount, o = ~~((Math.random() + 0.5) * (1 << (i < 8 ? i : 8))) * n.errorRetryInterval;
|
|
5180
5189
|
!R(a) && i > a || setTimeout(s, o, r);
|
|
5181
|
-
}, bc = _s, [ea, wc] = vc(/* @__PURE__ */ new Map()), kc =
|
|
5190
|
+
}, bc = _s, [ea, wc] = vc(/* @__PURE__ */ new Map()), kc = Ve(
|
|
5182
5191
|
{
|
|
5183
5192
|
// events
|
|
5184
5193
|
onLoadingSlow: Me,
|
|
@@ -5206,15 +5215,15 @@ const Or = (t, e) => {
|
|
|
5206
5215
|
// use web preset by default
|
|
5207
5216
|
hc
|
|
5208
5217
|
), Ec = (t, e) => {
|
|
5209
|
-
const n =
|
|
5218
|
+
const n = Ve(t, e);
|
|
5210
5219
|
if (e) {
|
|
5211
5220
|
const { use: s, fallback: r } = t, { use: a, fallback: i } = e;
|
|
5212
|
-
s && a && (n.use = s.concat(a)), r && i && (n.fallback =
|
|
5221
|
+
s && a && (n.use = s.concat(a)), r && i && (n.fallback = Ve(r, i));
|
|
5213
5222
|
}
|
|
5214
5223
|
return n;
|
|
5215
5224
|
}, xc = fa({}), Sc = "$inf$", ta = Xt && window.__SWR_DEVTOOLS_USE__, Oc = ta ? window.__SWR_DEVTOOLS_USE__ : [], Tc = () => {
|
|
5216
5225
|
ta && (window.__SWR_DEVTOOLS_REACT__ = Gt);
|
|
5217
|
-
},
|
|
5226
|
+
}, Ac = (t) => we(t[1]) ? [
|
|
5218
5227
|
t[0],
|
|
5219
5228
|
t[1],
|
|
5220
5229
|
t[2] || {}
|
|
@@ -5222,20 +5231,20 @@ const Or = (t, e) => {
|
|
|
5222
5231
|
t[0],
|
|
5223
5232
|
null,
|
|
5224
5233
|
(t[1] === null ? t[2] : t[1]) || {}
|
|
5225
|
-
],
|
|
5226
|
-
const [i] =
|
|
5234
|
+
], Cc = () => Ve(kc, ma(xc)), Nc = (t) => (e, n, s) => t(e, n && ((...a) => {
|
|
5235
|
+
const [i] = Is(e), [, , , o] = Re.get(ea);
|
|
5227
5236
|
if (i.startsWith(Sc))
|
|
5228
5237
|
return n(...a);
|
|
5229
5238
|
const c = o[i];
|
|
5230
5239
|
return R(c) ? n(...a) : (delete o[i], c);
|
|
5231
5240
|
}), s), Rc = Oc.concat(Nc), Pc = (t) => function(...n) {
|
|
5232
|
-
const s =
|
|
5241
|
+
const s = Cc(), [r, a, i] = Ac(n), o = Ec(s, i);
|
|
5233
5242
|
let c = t;
|
|
5234
5243
|
const { use: u } = o, h = (u || []).concat(Rc);
|
|
5235
5244
|
for (let p = h.length; p--; )
|
|
5236
5245
|
c = h[p](c);
|
|
5237
5246
|
return c(r, a || o.fetcher || null, o);
|
|
5238
|
-
},
|
|
5247
|
+
}, jc = (t, e, n) => {
|
|
5239
5248
|
const s = e[t] || (e[t] = []);
|
|
5240
5249
|
return s.push(n), () => {
|
|
5241
5250
|
const r = s.indexOf(n);
|
|
@@ -5262,10 +5271,10 @@ const zn = Gt.use || // This extra generic is to avoid TypeScript mixing up the
|
|
|
5262
5271
|
t.status = "rejected", t.reason = e;
|
|
5263
5272
|
}), t;
|
|
5264
5273
|
}
|
|
5265
|
-
}),
|
|
5274
|
+
}), Bn = {
|
|
5266
5275
|
dedupe: !0
|
|
5267
|
-
},
|
|
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,
|
|
5276
|
+
}, Ic = (t, e, n) => {
|
|
5277
|
+
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, v] = Re.get(s), [l, A] = Is(t), j = Ke(!1), B = Ke(!1), Z = Ke(l), U = Ke(e), D = Ke(n), M = () => D.current, G = () => M().isVisible() && M().isOnline(), [$, st, Ue, fe] = Yr(s, l), rt = Ke({}).current, Yt = R(i) ? R(n.fallback) ? te : n.fallback[l] : i, Zs = (F, L) => {
|
|
5269
5278
|
for (const J in rt) {
|
|
5270
5279
|
const z = J;
|
|
5271
5280
|
if (z === "data") {
|
|
@@ -5277,8 +5286,8 @@ const zn = Gt.use || // This extra generic is to avoid TypeScript mixing up the
|
|
|
5277
5286
|
return !0;
|
|
5278
5287
|
}, Ds = ya(() => {
|
|
5279
5288
|
const F = !l || !e ? !1 : R(o) ? M().isPaused() || a ? !1 : c !== !1 : o, L = (Q) => {
|
|
5280
|
-
const Oe =
|
|
5281
|
-
return delete Oe._k, F ?
|
|
5289
|
+
const Oe = Ve(Q);
|
|
5290
|
+
return delete Oe._k, F ? Be({
|
|
5282
5291
|
isValidating: !0,
|
|
5283
5292
|
isLoading: !0
|
|
5284
5293
|
}, Oe) : Oe;
|
|
@@ -5295,7 +5304,7 @@ const zn = Gt.use || // This extra generic is to avoid TypeScript mixing up the
|
|
|
5295
5304
|
s,
|
|
5296
5305
|
l
|
|
5297
5306
|
]), at = ic.useSyncExternalStore(rn(
|
|
5298
|
-
(F) =>
|
|
5307
|
+
(F) => Ue(l, (L, J) => {
|
|
5299
5308
|
Zs(J, L) || F();
|
|
5300
5309
|
}),
|
|
5301
5310
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -5303,31 +5312,31 @@ const zn = Gt.use || // This extra generic is to avoid TypeScript mixing up the
|
|
|
5303
5312
|
s,
|
|
5304
5313
|
l
|
|
5305
5314
|
]
|
|
5306
|
-
), Ds[0], Ds[1]), Ms = !
|
|
5307
|
-
(F) =>
|
|
5308
|
-
const L =
|
|
5309
|
-
if (!l || !L ||
|
|
5315
|
+
), Ds[0], Ds[1]), Ms = !j.current, na = g[l] && g[l].length > 0, it = at.data, ze = R(it) ? Yt && Xr(Yt) ? zn(Yt) : Yt : it, Qt = at.error, An = Ke(ze), en = k ? R(it) ? R(An.current) ? ze : An.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(
|
|
5316
|
+
(F) => je(void 0, null, function* () {
|
|
5317
|
+
const L = U.current;
|
|
5318
|
+
if (!l || !L || B.current || M().isPaused())
|
|
5310
5319
|
return !1;
|
|
5311
5320
|
let J, z, he = !0;
|
|
5312
|
-
const ot = F || {}, H = !m[l] || !ot.dedupe, Q = () => xr ? !
|
|
5321
|
+
const ot = F || {}, H = !m[l] || !ot.dedupe, Q = () => xr ? !B.current && l === Z.current && j.current : l === Z.current, Oe = {
|
|
5313
5322
|
isValidating: !1,
|
|
5314
5323
|
isLoading: !1
|
|
5315
5324
|
}, Ws = () => {
|
|
5316
5325
|
st(Oe);
|
|
5317
|
-
},
|
|
5326
|
+
}, Vs = () => {
|
|
5318
5327
|
const de = m[l];
|
|
5319
5328
|
de && de[1] === z && delete m[l];
|
|
5320
|
-
},
|
|
5329
|
+
}, Us = {
|
|
5321
5330
|
isValidating: !0
|
|
5322
5331
|
};
|
|
5323
|
-
R($().data) && (
|
|
5332
|
+
R($().data) && (Us.isLoading = !0);
|
|
5324
5333
|
try {
|
|
5325
|
-
if (H && (st(
|
|
5334
|
+
if (H && (st(Us), n.loadingTimeout && R($().data) && setTimeout(() => {
|
|
5326
5335
|
he && Q() && M().onLoadingSlow(l, n);
|
|
5327
5336
|
}, n.loadingTimeout), m[l] = [
|
|
5328
5337
|
L(A),
|
|
5329
5338
|
Os()
|
|
5330
|
-
]), [J, z] = m[l], J = yield J, H && setTimeout(
|
|
5339
|
+
]), [J, z] = m[l], J = yield J, H && setTimeout(Vs, n.dedupingInterval), !m[l] || m[l][1] !== z)
|
|
5331
5340
|
return H && Q() && M().onDiscarded(l), !1;
|
|
5332
5341
|
Oe.error = te;
|
|
5333
5342
|
const de = b[l];
|
|
@@ -5339,9 +5348,9 @@ const zn = Gt.use || // This extra generic is to avoid TypeScript mixing up the
|
|
|
5339
5348
|
const Te = $().data;
|
|
5340
5349
|
Oe.data = r(Te, J) ? Te : J, H && Q() && M().onSuccess(J, l, n);
|
|
5341
5350
|
} catch (de) {
|
|
5342
|
-
|
|
5343
|
-
const Te = M(), { shouldRetryOnError:
|
|
5344
|
-
Te.isPaused() || (Oe.error = de, H && Q() && (Te.onError(de, l, Te), (
|
|
5351
|
+
Vs();
|
|
5352
|
+
const Te = M(), { shouldRetryOnError: Cn } = Te;
|
|
5353
|
+
Te.isPaused() || (Oe.error = de, H && Q() && (Te.onError(de, l, Te), (Cn === !0 || we(Cn) && Cn(de)) && (!M().revalidateOnFocus || !M().revalidateOnReconnect || G()) && Te.onErrorRetry(de, l, Te, (aa) => {
|
|
5345
5354
|
const Nn = g[l];
|
|
5346
5355
|
Nn && Nn[0] && Nn[0](kr, aa);
|
|
5347
5356
|
}, {
|
|
@@ -5373,13 +5382,13 @@ const zn = Gt.use || // This extra generic is to avoid TypeScript mixing up the
|
|
|
5373
5382
|
[]
|
|
5374
5383
|
);
|
|
5375
5384
|
if (Wn(() => {
|
|
5376
|
-
|
|
5385
|
+
U.current = e, D.current = n, R(it) || (An.current = it);
|
|
5377
5386
|
}), Wn(() => {
|
|
5378
5387
|
if (!l) return;
|
|
5379
|
-
const F = wt.bind(te,
|
|
5388
|
+
const F = wt.bind(te, Bn);
|
|
5380
5389
|
let L = 0;
|
|
5381
5390
|
M().revalidateOnFocus && (L = Date.now() + M().focusThrottleInterval);
|
|
5382
|
-
const z =
|
|
5391
|
+
const z = jc(l, g, (he, ot = {}) => {
|
|
5383
5392
|
if (he == Hr) {
|
|
5384
5393
|
const H = Date.now();
|
|
5385
5394
|
M().revalidateOnFocus && H > L && G() && (L = H + M().focusThrottleInterval, F());
|
|
@@ -5392,10 +5401,10 @@ const zn = Gt.use || // This extra generic is to avoid TypeScript mixing up the
|
|
|
5392
5401
|
return wt(ot);
|
|
5393
5402
|
}
|
|
5394
5403
|
});
|
|
5395
|
-
return
|
|
5404
|
+
return B.current = !1, Z.current = l, j.current = !0, st({
|
|
5396
5405
|
_k: A
|
|
5397
5406
|
}), Ls && (R(ze) || Ht ? F() : mc(F)), () => {
|
|
5398
|
-
|
|
5407
|
+
B.current = !0, z();
|
|
5399
5408
|
};
|
|
5400
5409
|
}, [
|
|
5401
5410
|
l
|
|
@@ -5406,7 +5415,7 @@ const zn = Gt.use || // This extra generic is to avoid TypeScript mixing up the
|
|
|
5406
5415
|
z && F !== -1 && (F = setTimeout(J, z));
|
|
5407
5416
|
}
|
|
5408
5417
|
function J() {
|
|
5409
|
-
!$().error && (h || M().isVisible()) && (p || M().isOnline()) ? wt(
|
|
5418
|
+
!$().error && (h || M().isVisible()) && (p || M().isOnline()) ? wt(Bn).then(L) : L();
|
|
5410
5419
|
}
|
|
5411
5420
|
return L(), () => {
|
|
5412
5421
|
F && (clearTimeout(F), F = -1);
|
|
@@ -5419,14 +5428,14 @@ const zn = Gt.use || // This extra generic is to avoid TypeScript mixing up the
|
|
|
5419
5428
|
]), ga(en), a && R(ze) && l) {
|
|
5420
5429
|
if (!xr && Ht)
|
|
5421
5430
|
throw new Error("Fallback data is required when using Suspense in SSR.");
|
|
5422
|
-
|
|
5423
|
-
const F =
|
|
5431
|
+
U.current = e, D.current = n, B.current = !1;
|
|
5432
|
+
const F = v[l];
|
|
5424
5433
|
if (!R(F)) {
|
|
5425
5434
|
const L = Fs(F);
|
|
5426
5435
|
zn(L);
|
|
5427
5436
|
}
|
|
5428
5437
|
if (R(Qt)) {
|
|
5429
|
-
const L = wt(
|
|
5438
|
+
const L = wt(Bn);
|
|
5430
5439
|
R(en) || (L.status = "fulfilled", L.value = !0), zn(L);
|
|
5431
5440
|
} else
|
|
5432
5441
|
throw Qt;
|
|
@@ -5446,7 +5455,7 @@ const zn = Gt.use || // This extra generic is to avoid TypeScript mixing up the
|
|
|
5446
5455
|
return rt.isLoading = !0, ra;
|
|
5447
5456
|
}
|
|
5448
5457
|
};
|
|
5449
|
-
}, Zc = Pc(
|
|
5458
|
+
}, Zc = Pc(Ic), Fc = ({
|
|
5450
5459
|
fileKey: t,
|
|
5451
5460
|
authToken: e,
|
|
5452
5461
|
enabled: n = !0,
|