@noxickon/onyx 0.0.1 → 0.0.2

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.
Files changed (41) hide show
  1. package/dist/chunks/Button-CLMaoxRW.js +11054 -0
  2. package/dist/chunks/Button-CZYAHivj.js +20 -0
  3. package/dist/chunks/Input-BQQT5eZ0.js +138 -0
  4. package/dist/chunks/Input-DJZcvJdP.js +1 -0
  5. package/dist/chunks/_commonjsHelpers-C6fGbg64.js +6 -0
  6. package/dist/chunks/_commonjsHelpers-DwGv2jUC.js +1 -0
  7. package/dist/chunks/constants-B1_n9ezb.js +1 -0
  8. package/dist/chunks/constants-CDXq37n6.js +4 -0
  9. package/dist/chunks/index-1-zQ3RaM.js +601 -0
  10. package/dist/chunks/index-BgUMV1hv.js +2129 -0
  11. package/dist/chunks/index-CjVXr8mh.js +2 -0
  12. package/dist/chunks/index-XTQUUzZ1.js +22 -0
  13. package/dist/chunks/isObject-BDHKUJKN.js +1 -0
  14. package/dist/chunks/isObject-vmP43YLW.js +6 -0
  15. package/dist/chunks/jsx-runtime-C5mzlN2N.js +284 -0
  16. package/dist/chunks/jsx-runtime-DUiatUiq.js +22 -0
  17. package/dist/chunks/useAuth-C-TIgBfr.js +61 -0
  18. package/dist/chunks/useAuth-CfKOZqhG.js +10 -0
  19. package/dist/chunks/useForm-BIKRbGHj.js +3085 -0
  20. package/dist/chunks/useForm-BZEaiRaa.js +26 -0
  21. package/dist/chunks/useQuery-B_ce5e8f.js +2 -0
  22. package/dist/chunks/useQuery-CJdYhuQu.js +1481 -0
  23. package/dist/context/context.cjs.js +1 -0
  24. package/dist/context/context.es.js +6 -0
  25. package/dist/context.d.ts +44 -0
  26. package/dist/hooks/hooks.cjs.js +6 -0
  27. package/dist/hooks/hooks.es.js +1917 -0
  28. package/dist/hooks.d.ts +130 -0
  29. package/dist/index.css +1 -1
  30. package/dist/index.d.ts +148 -110
  31. package/dist/layout/layout.cjs.js +1 -0
  32. package/dist/layout/layout.es.js +264 -0
  33. package/dist/layout.d.ts +89 -0
  34. package/dist/onyx.cjs.js +12 -0
  35. package/dist/onyx.es.js +2523 -9494
  36. package/dist/pages/pages.cjs.js +7 -0
  37. package/dist/pages/pages.es.js +93 -0
  38. package/dist/pages.d.ts +14 -0
  39. package/dist/shared.css +104 -0
  40. package/package.json +41 -16
  41. package/dist/onyx.umd.js +0 -42
@@ -0,0 +1,1917 @@
1
+ import { a as ut, b as De, i as lt } from "../chunks/useForm-BIKRbGHj.js";
2
+ import { h as Tr, u as Ar } from "../chunks/useForm-BIKRbGHj.js";
3
+ import { useState as ft, useRef as dt, useCallback as Z } from "react";
4
+ import { k as D, o as ge, _ as U } from "../chunks/index-1-zQ3RaM.js";
5
+ import { a as pt, g as ht, c as mt, b as yt, t as Re } from "../chunks/useQuery-CJdYhuQu.js";
6
+ var bt = [
7
+ "refetch",
8
+ "reobserve",
9
+ "fetchMore",
10
+ "updateQuery",
11
+ "startPolling",
12
+ "stopPolling",
13
+ "subscribeToMore"
14
+ ];
15
+ function wt(e, t) {
16
+ var n, r = D.useRef(void 0), s = D.useRef(void 0), o = D.useRef(void 0), i = ge(t, r.current || {}), c = (n = i == null ? void 0 : i.query) !== null && n !== void 0 ? n : e;
17
+ s.current = t, o.current = c;
18
+ var f = U(U({}, i), { skip: !r.current }), u = pt(c, f), l = u.obsQueryFields, d = u.result, w = u.client, g = u.resultData, p = u.observable, m = u.onQueryExecuted, h = p.options.initialFetchPolicy || ht(f.defaultOptions, w.defaultOptions), R = D.useReducer(function(x) {
19
+ return x + 1;
20
+ }, 0)[1], E = D.useMemo(function() {
21
+ for (var x = {}, F = function(Ee) {
22
+ var ct = l[Ee];
23
+ x[Ee] = function() {
24
+ return r.current || (r.current = /* @__PURE__ */ Object.create(null), R()), ct.apply(this, arguments);
25
+ };
26
+ }, M = 0, K = bt; M < K.length; M++) {
27
+ var at = K[M];
28
+ F(at);
29
+ }
30
+ return x;
31
+ }, [R, l]), b = !!r.current, T = D.useMemo(function() {
32
+ return U(U(U({}, d), E), { called: b });
33
+ }, [d, E, b]), S = D.useCallback(function(x) {
34
+ r.current = x ? U(U({}, x), { fetchPolicy: x.fetchPolicy || h }) : {
35
+ fetchPolicy: h
36
+ };
37
+ var F = ge(s.current, U({ query: o.current }, r.current)), M = Et(g, p, w, c, U(U({}, F), { skip: !1 }), m).then(function(K) {
38
+ return Object.assign(K, E);
39
+ });
40
+ return M.catch(function() {
41
+ }), M;
42
+ }, [
43
+ w,
44
+ c,
45
+ E,
46
+ h,
47
+ p,
48
+ g,
49
+ m
50
+ ]), A = D.useRef(S);
51
+ ut(function() {
52
+ A.current = S;
53
+ });
54
+ var L = D.useCallback(function() {
55
+ for (var x = [], F = 0; F < arguments.length; F++)
56
+ x[F] = arguments[F];
57
+ return A.current.apply(A, x);
58
+ }, []);
59
+ return [L, T];
60
+ }
61
+ function Et(e, t, n, r, s, o) {
62
+ var i = s.query || r, c = mt(n, i, s, !1)(t), f = t.reobserveAsConcast(yt(t, n, s, c));
63
+ return o(c), new Promise(function(u) {
64
+ var l;
65
+ f.subscribe({
66
+ next: function(d) {
67
+ l = d;
68
+ },
69
+ error: function() {
70
+ u(Re(t.getCurrentResult(), e.previousData, t, n));
71
+ },
72
+ complete: function() {
73
+ u(Re(t.maskResult(l), e.previousData, t, n));
74
+ }
75
+ });
76
+ });
77
+ }
78
+ const tr = (e, t) => {
79
+ const n = (r) => e(r);
80
+ return Object.defineProperty(n, "message", { value: t }), n;
81
+ };
82
+ function Be(e, t) {
83
+ return function() {
84
+ return e.apply(t, arguments);
85
+ };
86
+ }
87
+ const { toString: gt } = Object.prototype, { getPrototypeOf: ye } = Object, { iterator: te, toStringTag: je } = Symbol, ne = /* @__PURE__ */ ((e) => (t) => {
88
+ const n = gt.call(t);
89
+ return e[n] || (e[n] = n.slice(8, -1).toLowerCase());
90
+ })(/* @__PURE__ */ Object.create(null)), _ = (e) => (e = e.toLowerCase(), (t) => ne(t) === e), re = (e) => (t) => typeof t === e, { isArray: I } = Array, z = re("undefined");
91
+ function $(e) {
92
+ return e !== null && !z(e) && e.constructor !== null && !z(e.constructor) && P(e.constructor.isBuffer) && e.constructor.isBuffer(e);
93
+ }
94
+ const qe = _("ArrayBuffer");
95
+ function Rt(e) {
96
+ let t;
97
+ return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && qe(e.buffer), t;
98
+ }
99
+ const St = re("string"), P = re("function"), Me = re("number"), J = (e) => e !== null && typeof e == "object", Ot = (e) => e === !0 || e === !1, Q = (e) => {
100
+ if (ne(e) !== "object")
101
+ return !1;
102
+ const t = ye(e);
103
+ return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(je in e) && !(te in e);
104
+ }, Tt = (e) => {
105
+ if (!J(e) || $(e))
106
+ return !1;
107
+ try {
108
+ return Object.keys(e).length === 0 && Object.getPrototypeOf(e) === Object.prototype;
109
+ } catch {
110
+ return !1;
111
+ }
112
+ }, At = _("Date"), xt = _("File"), Ct = _("Blob"), Pt = _("FileList"), Nt = (e) => J(e) && P(e.pipe), Ft = (e) => {
113
+ let t;
114
+ return e && (typeof FormData == "function" && e instanceof FormData || P(e.append) && ((t = ne(e)) === "formdata" || // detect form-data instance
115
+ t === "object" && P(e.toString) && e.toString() === "[object FormData]"));
116
+ }, _t = _("URLSearchParams"), [Ut, kt, Lt, Dt] = ["ReadableStream", "Request", "Response", "Headers"].map(_), Bt = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
117
+ function V(e, t, { allOwnKeys: n = !1 } = {}) {
118
+ if (e === null || typeof e > "u")
119
+ return;
120
+ let r, s;
121
+ if (typeof e != "object" && (e = [e]), I(e))
122
+ for (r = 0, s = e.length; r < s; r++)
123
+ t.call(null, e[r], r, e);
124
+ else {
125
+ if ($(e))
126
+ return;
127
+ const o = n ? Object.getOwnPropertyNames(e) : Object.keys(e), i = o.length;
128
+ let c;
129
+ for (r = 0; r < i; r++)
130
+ c = o[r], t.call(null, e[c], c, e);
131
+ }
132
+ }
133
+ function Ie(e, t) {
134
+ if ($(e))
135
+ return null;
136
+ t = t.toLowerCase();
137
+ const n = Object.keys(e);
138
+ let r = n.length, s;
139
+ for (; r-- > 0; )
140
+ if (s = n[r], t === s.toLowerCase())
141
+ return s;
142
+ return null;
143
+ }
144
+ const B = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, ve = (e) => !z(e) && e !== B;
145
+ function le() {
146
+ const { caseless: e } = ve(this) && this || {}, t = {}, n = (r, s) => {
147
+ const o = e && Ie(t, s) || s;
148
+ Q(t[o]) && Q(r) ? t[o] = le(t[o], r) : Q(r) ? t[o] = le({}, r) : I(r) ? t[o] = r.slice() : t[o] = r;
149
+ };
150
+ for (let r = 0, s = arguments.length; r < s; r++)
151
+ arguments[r] && V(arguments[r], n);
152
+ return t;
153
+ }
154
+ const jt = (e, t, n, { allOwnKeys: r } = {}) => (V(t, (s, o) => {
155
+ n && P(s) ? e[o] = Be(s, n) : e[o] = s;
156
+ }, { allOwnKeys: r }), e), qt = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), Mt = (e, t, n, r) => {
157
+ e.prototype = Object.create(t.prototype, r), e.prototype.constructor = e, Object.defineProperty(e, "super", {
158
+ value: t.prototype
159
+ }), n && Object.assign(e.prototype, n);
160
+ }, It = (e, t, n, r) => {
161
+ let s, o, i;
162
+ const c = {};
163
+ if (t = t || {}, e == null) return t;
164
+ do {
165
+ for (s = Object.getOwnPropertyNames(e), o = s.length; o-- > 0; )
166
+ i = s[o], (!r || r(i, e, t)) && !c[i] && (t[i] = e[i], c[i] = !0);
167
+ e = n !== !1 && ye(e);
168
+ } while (e && (!n || n(e, t)) && e !== Object.prototype);
169
+ return t;
170
+ }, vt = (e, t, n) => {
171
+ e = String(e), (n === void 0 || n > e.length) && (n = e.length), n -= t.length;
172
+ const r = e.indexOf(t, n);
173
+ return r !== -1 && r === n;
174
+ }, Ht = (e) => {
175
+ if (!e) return null;
176
+ if (I(e)) return e;
177
+ let t = e.length;
178
+ if (!Me(t)) return null;
179
+ const n = new Array(t);
180
+ for (; t-- > 0; )
181
+ n[t] = e[t];
182
+ return n;
183
+ }, zt = /* @__PURE__ */ ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" && ye(Uint8Array)), $t = (e, t) => {
184
+ const r = (e && e[te]).call(e);
185
+ let s;
186
+ for (; (s = r.next()) && !s.done; ) {
187
+ const o = s.value;
188
+ t.call(e, o[0], o[1]);
189
+ }
190
+ }, Jt = (e, t) => {
191
+ let n;
192
+ const r = [];
193
+ for (; (n = e.exec(t)) !== null; )
194
+ r.push(n);
195
+ return r;
196
+ }, Vt = _("HTMLFormElement"), Wt = (e) => e.toLowerCase().replace(
197
+ /[-_\s]([a-z\d])(\w*)/g,
198
+ function(n, r, s) {
199
+ return r.toUpperCase() + s;
200
+ }
201
+ ), Se = (({ hasOwnProperty: e }) => (t, n) => e.call(t, n))(Object.prototype), Kt = _("RegExp"), He = (e, t) => {
202
+ const n = Object.getOwnPropertyDescriptors(e), r = {};
203
+ V(n, (s, o) => {
204
+ let i;
205
+ (i = t(s, o, e)) !== !1 && (r[o] = i || s);
206
+ }), Object.defineProperties(e, r);
207
+ }, Qt = (e) => {
208
+ He(e, (t, n) => {
209
+ if (P(e) && ["arguments", "caller", "callee"].indexOf(n) !== -1)
210
+ return !1;
211
+ const r = e[n];
212
+ if (P(r)) {
213
+ if (t.enumerable = !1, "writable" in t) {
214
+ t.writable = !1;
215
+ return;
216
+ }
217
+ t.set || (t.set = () => {
218
+ throw Error("Can not rewrite read-only method '" + n + "'");
219
+ });
220
+ }
221
+ });
222
+ }, Xt = (e, t) => {
223
+ const n = {}, r = (s) => {
224
+ s.forEach((o) => {
225
+ n[o] = !0;
226
+ });
227
+ };
228
+ return I(e) ? r(e) : r(String(e).split(t)), n;
229
+ }, Gt = () => {
230
+ }, Zt = (e, t) => e != null && Number.isFinite(e = +e) ? e : t;
231
+ function Yt(e) {
232
+ return !!(e && P(e.append) && e[je] === "FormData" && e[te]);
233
+ }
234
+ const en = (e) => {
235
+ const t = new Array(10), n = (r, s) => {
236
+ if (J(r)) {
237
+ if (t.indexOf(r) >= 0)
238
+ return;
239
+ if ($(r))
240
+ return r;
241
+ if (!("toJSON" in r)) {
242
+ t[s] = r;
243
+ const o = I(r) ? [] : {};
244
+ return V(r, (i, c) => {
245
+ const f = n(i, s + 1);
246
+ !z(f) && (o[c] = f);
247
+ }), t[s] = void 0, o;
248
+ }
249
+ }
250
+ return r;
251
+ };
252
+ return n(e, 0);
253
+ }, tn = _("AsyncFunction"), nn = (e) => e && (J(e) || P(e)) && P(e.then) && P(e.catch), ze = ((e, t) => e ? setImmediate : t ? ((n, r) => (B.addEventListener("message", ({ source: s, data: o }) => {
254
+ s === B && o === n && r.length && r.shift()();
255
+ }, !1), (s) => {
256
+ r.push(s), B.postMessage(n, "*");
257
+ }))(`axios@${Math.random()}`, []) : (n) => setTimeout(n))(
258
+ typeof setImmediate == "function",
259
+ P(B.postMessage)
260
+ ), rn = typeof queueMicrotask < "u" ? queueMicrotask.bind(B) : typeof process < "u" && process.nextTick || ze, sn = (e) => e != null && P(e[te]), a = {
261
+ isArray: I,
262
+ isArrayBuffer: qe,
263
+ isBuffer: $,
264
+ isFormData: Ft,
265
+ isArrayBufferView: Rt,
266
+ isString: St,
267
+ isNumber: Me,
268
+ isBoolean: Ot,
269
+ isObject: J,
270
+ isPlainObject: Q,
271
+ isEmptyObject: Tt,
272
+ isReadableStream: Ut,
273
+ isRequest: kt,
274
+ isResponse: Lt,
275
+ isHeaders: Dt,
276
+ isUndefined: z,
277
+ isDate: At,
278
+ isFile: xt,
279
+ isBlob: Ct,
280
+ isRegExp: Kt,
281
+ isFunction: P,
282
+ isStream: Nt,
283
+ isURLSearchParams: _t,
284
+ isTypedArray: zt,
285
+ isFileList: Pt,
286
+ forEach: V,
287
+ merge: le,
288
+ extend: jt,
289
+ trim: Bt,
290
+ stripBOM: qt,
291
+ inherits: Mt,
292
+ toFlatObject: It,
293
+ kindOf: ne,
294
+ kindOfTest: _,
295
+ endsWith: vt,
296
+ toArray: Ht,
297
+ forEachEntry: $t,
298
+ matchAll: Jt,
299
+ isHTMLForm: Vt,
300
+ hasOwnProperty: Se,
301
+ hasOwnProp: Se,
302
+ // an alias to avoid ESLint no-prototype-builtins detection
303
+ reduceDescriptors: He,
304
+ freezeMethods: Qt,
305
+ toObjectSet: Xt,
306
+ toCamelCase: Wt,
307
+ noop: Gt,
308
+ toFiniteNumber: Zt,
309
+ findKey: Ie,
310
+ global: B,
311
+ isContextDefined: ve,
312
+ isSpecCompliantForm: Yt,
313
+ toJSONObject: en,
314
+ isAsyncFn: tn,
315
+ isThenable: nn,
316
+ setImmediate: ze,
317
+ asap: rn,
318
+ isIterable: sn
319
+ };
320
+ function y(e, t, n, r, s) {
321
+ Error.call(this), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error().stack, this.message = e, this.name = "AxiosError", t && (this.code = t), n && (this.config = n), r && (this.request = r), s && (this.response = s, this.status = s.status ? s.status : null);
322
+ }
323
+ a.inherits(y, Error, {
324
+ toJSON: function() {
325
+ return {
326
+ // Standard
327
+ message: this.message,
328
+ name: this.name,
329
+ // Microsoft
330
+ description: this.description,
331
+ number: this.number,
332
+ // Mozilla
333
+ fileName: this.fileName,
334
+ lineNumber: this.lineNumber,
335
+ columnNumber: this.columnNumber,
336
+ stack: this.stack,
337
+ // Axios
338
+ config: a.toJSONObject(this.config),
339
+ code: this.code,
340
+ status: this.status
341
+ };
342
+ }
343
+ });
344
+ const $e = y.prototype, Je = {};
345
+ [
346
+ "ERR_BAD_OPTION_VALUE",
347
+ "ERR_BAD_OPTION",
348
+ "ECONNABORTED",
349
+ "ETIMEDOUT",
350
+ "ERR_NETWORK",
351
+ "ERR_FR_TOO_MANY_REDIRECTS",
352
+ "ERR_DEPRECATED",
353
+ "ERR_BAD_RESPONSE",
354
+ "ERR_BAD_REQUEST",
355
+ "ERR_CANCELED",
356
+ "ERR_NOT_SUPPORT",
357
+ "ERR_INVALID_URL"
358
+ // eslint-disable-next-line func-names
359
+ ].forEach((e) => {
360
+ Je[e] = { value: e };
361
+ });
362
+ Object.defineProperties(y, Je);
363
+ Object.defineProperty($e, "isAxiosError", { value: !0 });
364
+ y.from = (e, t, n, r, s, o) => {
365
+ const i = Object.create($e);
366
+ return a.toFlatObject(e, i, function(f) {
367
+ return f !== Error.prototype;
368
+ }, (c) => c !== "isAxiosError"), y.call(i, e.message, t, n, r, s), i.cause = e, i.name = e.name, o && Object.assign(i, o), i;
369
+ };
370
+ const on = null;
371
+ function fe(e) {
372
+ return a.isPlainObject(e) || a.isArray(e);
373
+ }
374
+ function Ve(e) {
375
+ return a.endsWith(e, "[]") ? e.slice(0, -2) : e;
376
+ }
377
+ function Oe(e, t, n) {
378
+ return e ? e.concat(t).map(function(s, o) {
379
+ return s = Ve(s), !n && o ? "[" + s + "]" : s;
380
+ }).join(n ? "." : "") : t;
381
+ }
382
+ function an(e) {
383
+ return a.isArray(e) && !e.some(fe);
384
+ }
385
+ const cn = a.toFlatObject(a, {}, null, function(t) {
386
+ return /^is[A-Z]/.test(t);
387
+ });
388
+ function se(e, t, n) {
389
+ if (!a.isObject(e))
390
+ throw new TypeError("target must be an object");
391
+ t = t || new FormData(), n = a.toFlatObject(n, {
392
+ metaTokens: !0,
393
+ dots: !1,
394
+ indexes: !1
395
+ }, !1, function(m, h) {
396
+ return !a.isUndefined(h[m]);
397
+ });
398
+ const r = n.metaTokens, s = n.visitor || l, o = n.dots, i = n.indexes, f = (n.Blob || typeof Blob < "u" && Blob) && a.isSpecCompliantForm(t);
399
+ if (!a.isFunction(s))
400
+ throw new TypeError("visitor must be a function");
401
+ function u(p) {
402
+ if (p === null) return "";
403
+ if (a.isDate(p))
404
+ return p.toISOString();
405
+ if (a.isBoolean(p))
406
+ return p.toString();
407
+ if (!f && a.isBlob(p))
408
+ throw new y("Blob is not supported. Use a Buffer instead.");
409
+ return a.isArrayBuffer(p) || a.isTypedArray(p) ? f && typeof Blob == "function" ? new Blob([p]) : Buffer.from(p) : p;
410
+ }
411
+ function l(p, m, h) {
412
+ let R = p;
413
+ if (p && !h && typeof p == "object") {
414
+ if (a.endsWith(m, "{}"))
415
+ m = r ? m : m.slice(0, -2), p = JSON.stringify(p);
416
+ else if (a.isArray(p) && an(p) || (a.isFileList(p) || a.endsWith(m, "[]")) && (R = a.toArray(p)))
417
+ return m = Ve(m), R.forEach(function(b, T) {
418
+ !(a.isUndefined(b) || b === null) && t.append(
419
+ // eslint-disable-next-line no-nested-ternary
420
+ i === !0 ? Oe([m], T, o) : i === null ? m : m + "[]",
421
+ u(b)
422
+ );
423
+ }), !1;
424
+ }
425
+ return fe(p) ? !0 : (t.append(Oe(h, m, o), u(p)), !1);
426
+ }
427
+ const d = [], w = Object.assign(cn, {
428
+ defaultVisitor: l,
429
+ convertValue: u,
430
+ isVisitable: fe
431
+ });
432
+ function g(p, m) {
433
+ if (!a.isUndefined(p)) {
434
+ if (d.indexOf(p) !== -1)
435
+ throw Error("Circular reference detected in " + m.join("."));
436
+ d.push(p), a.forEach(p, function(R, E) {
437
+ (!(a.isUndefined(R) || R === null) && s.call(
438
+ t,
439
+ R,
440
+ a.isString(E) ? E.trim() : E,
441
+ m,
442
+ w
443
+ )) === !0 && g(R, m ? m.concat(E) : [E]);
444
+ }), d.pop();
445
+ }
446
+ }
447
+ if (!a.isObject(e))
448
+ throw new TypeError("data must be an object");
449
+ return g(e), t;
450
+ }
451
+ function Te(e) {
452
+ const t = {
453
+ "!": "%21",
454
+ "'": "%27",
455
+ "(": "%28",
456
+ ")": "%29",
457
+ "~": "%7E",
458
+ "%20": "+",
459
+ "%00": "\0"
460
+ };
461
+ return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g, function(r) {
462
+ return t[r];
463
+ });
464
+ }
465
+ function be(e, t) {
466
+ this._pairs = [], e && se(e, this, t);
467
+ }
468
+ const We = be.prototype;
469
+ We.append = function(t, n) {
470
+ this._pairs.push([t, n]);
471
+ };
472
+ We.toString = function(t) {
473
+ const n = t ? function(r) {
474
+ return t.call(this, r, Te);
475
+ } : Te;
476
+ return this._pairs.map(function(s) {
477
+ return n(s[0]) + "=" + n(s[1]);
478
+ }, "").join("&");
479
+ };
480
+ function un(e) {
481
+ return encodeURIComponent(e).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
482
+ }
483
+ function Ke(e, t, n) {
484
+ if (!t)
485
+ return e;
486
+ const r = n && n.encode || un;
487
+ a.isFunction(n) && (n = {
488
+ serialize: n
489
+ });
490
+ const s = n && n.serialize;
491
+ let o;
492
+ if (s ? o = s(t, n) : o = a.isURLSearchParams(t) ? t.toString() : new be(t, n).toString(r), o) {
493
+ const i = e.indexOf("#");
494
+ i !== -1 && (e = e.slice(0, i)), e += (e.indexOf("?") === -1 ? "?" : "&") + o;
495
+ }
496
+ return e;
497
+ }
498
+ class Ae {
499
+ constructor() {
500
+ this.handlers = [];
501
+ }
502
+ /**
503
+ * Add a new interceptor to the stack
504
+ *
505
+ * @param {Function} fulfilled The function to handle `then` for a `Promise`
506
+ * @param {Function} rejected The function to handle `reject` for a `Promise`
507
+ *
508
+ * @return {Number} An ID used to remove interceptor later
509
+ */
510
+ use(t, n, r) {
511
+ return this.handlers.push({
512
+ fulfilled: t,
513
+ rejected: n,
514
+ synchronous: r ? r.synchronous : !1,
515
+ runWhen: r ? r.runWhen : null
516
+ }), this.handlers.length - 1;
517
+ }
518
+ /**
519
+ * Remove an interceptor from the stack
520
+ *
521
+ * @param {Number} id The ID that was returned by `use`
522
+ *
523
+ * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise
524
+ */
525
+ eject(t) {
526
+ this.handlers[t] && (this.handlers[t] = null);
527
+ }
528
+ /**
529
+ * Clear all interceptors from the stack
530
+ *
531
+ * @returns {void}
532
+ */
533
+ clear() {
534
+ this.handlers && (this.handlers = []);
535
+ }
536
+ /**
537
+ * Iterate over all the registered interceptors
538
+ *
539
+ * This method is particularly useful for skipping over any
540
+ * interceptors that may have become `null` calling `eject`.
541
+ *
542
+ * @param {Function} fn The function to call for each interceptor
543
+ *
544
+ * @returns {void}
545
+ */
546
+ forEach(t) {
547
+ a.forEach(this.handlers, function(r) {
548
+ r !== null && t(r);
549
+ });
550
+ }
551
+ }
552
+ const Qe = {
553
+ silentJSONParsing: !0,
554
+ forcedJSONParsing: !0,
555
+ clarifyTimeoutError: !1
556
+ }, ln = typeof URLSearchParams < "u" ? URLSearchParams : be, fn = typeof FormData < "u" ? FormData : null, dn = typeof Blob < "u" ? Blob : null, pn = {
557
+ isBrowser: !0,
558
+ classes: {
559
+ URLSearchParams: ln,
560
+ FormData: fn,
561
+ Blob: dn
562
+ },
563
+ protocols: ["http", "https", "file", "blob", "url", "data"]
564
+ }, we = typeof window < "u" && typeof document < "u", de = typeof navigator == "object" && navigator || void 0, hn = we && (!de || ["ReactNative", "NativeScript", "NS"].indexOf(de.product) < 0), mn = typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
565
+ self instanceof WorkerGlobalScope && typeof self.importScripts == "function", yn = we && window.location.href || "http://localhost", bn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
566
+ __proto__: null,
567
+ hasBrowserEnv: we,
568
+ hasStandardBrowserEnv: hn,
569
+ hasStandardBrowserWebWorkerEnv: mn,
570
+ navigator: de,
571
+ origin: yn
572
+ }, Symbol.toStringTag, { value: "Module" })), C = {
573
+ ...bn,
574
+ ...pn
575
+ };
576
+ function wn(e, t) {
577
+ return se(e, new C.classes.URLSearchParams(), {
578
+ visitor: function(n, r, s, o) {
579
+ return C.isNode && a.isBuffer(n) ? (this.append(r, n.toString("base64")), !1) : o.defaultVisitor.apply(this, arguments);
580
+ },
581
+ ...t
582
+ });
583
+ }
584
+ function En(e) {
585
+ return a.matchAll(/\w+|\[(\w*)]/g, e).map((t) => t[0] === "[]" ? "" : t[1] || t[0]);
586
+ }
587
+ function gn(e) {
588
+ const t = {}, n = Object.keys(e);
589
+ let r;
590
+ const s = n.length;
591
+ let o;
592
+ for (r = 0; r < s; r++)
593
+ o = n[r], t[o] = e[o];
594
+ return t;
595
+ }
596
+ function Xe(e) {
597
+ function t(n, r, s, o) {
598
+ let i = n[o++];
599
+ if (i === "__proto__") return !0;
600
+ const c = Number.isFinite(+i), f = o >= n.length;
601
+ return i = !i && a.isArray(s) ? s.length : i, f ? (a.hasOwnProp(s, i) ? s[i] = [s[i], r] : s[i] = r, !c) : ((!s[i] || !a.isObject(s[i])) && (s[i] = []), t(n, r, s[i], o) && a.isArray(s[i]) && (s[i] = gn(s[i])), !c);
602
+ }
603
+ if (a.isFormData(e) && a.isFunction(e.entries)) {
604
+ const n = {};
605
+ return a.forEachEntry(e, (r, s) => {
606
+ t(En(r), s, n, 0);
607
+ }), n;
608
+ }
609
+ return null;
610
+ }
611
+ function Rn(e, t, n) {
612
+ if (a.isString(e))
613
+ try {
614
+ return (t || JSON.parse)(e), a.trim(e);
615
+ } catch (r) {
616
+ if (r.name !== "SyntaxError")
617
+ throw r;
618
+ }
619
+ return (n || JSON.stringify)(e);
620
+ }
621
+ const W = {
622
+ transitional: Qe,
623
+ adapter: ["xhr", "http", "fetch"],
624
+ transformRequest: [function(t, n) {
625
+ const r = n.getContentType() || "", s = r.indexOf("application/json") > -1, o = a.isObject(t);
626
+ if (o && a.isHTMLForm(t) && (t = new FormData(t)), a.isFormData(t))
627
+ return s ? JSON.stringify(Xe(t)) : t;
628
+ if (a.isArrayBuffer(t) || a.isBuffer(t) || a.isStream(t) || a.isFile(t) || a.isBlob(t) || a.isReadableStream(t))
629
+ return t;
630
+ if (a.isArrayBufferView(t))
631
+ return t.buffer;
632
+ if (a.isURLSearchParams(t))
633
+ return n.setContentType("application/x-www-form-urlencoded;charset=utf-8", !1), t.toString();
634
+ let c;
635
+ if (o) {
636
+ if (r.indexOf("application/x-www-form-urlencoded") > -1)
637
+ return wn(t, this.formSerializer).toString();
638
+ if ((c = a.isFileList(t)) || r.indexOf("multipart/form-data") > -1) {
639
+ const f = this.env && this.env.FormData;
640
+ return se(
641
+ c ? { "files[]": t } : t,
642
+ f && new f(),
643
+ this.formSerializer
644
+ );
645
+ }
646
+ }
647
+ return o || s ? (n.setContentType("application/json", !1), Rn(t)) : t;
648
+ }],
649
+ transformResponse: [function(t) {
650
+ const n = this.transitional || W.transitional, r = n && n.forcedJSONParsing, s = this.responseType === "json";
651
+ if (a.isResponse(t) || a.isReadableStream(t))
652
+ return t;
653
+ if (t && a.isString(t) && (r && !this.responseType || s)) {
654
+ const i = !(n && n.silentJSONParsing) && s;
655
+ try {
656
+ return JSON.parse(t);
657
+ } catch (c) {
658
+ if (i)
659
+ throw c.name === "SyntaxError" ? y.from(c, y.ERR_BAD_RESPONSE, this, null, this.response) : c;
660
+ }
661
+ }
662
+ return t;
663
+ }],
664
+ /**
665
+ * A timeout in milliseconds to abort a request. If set to 0 (default) a
666
+ * timeout is not created.
667
+ */
668
+ timeout: 0,
669
+ xsrfCookieName: "XSRF-TOKEN",
670
+ xsrfHeaderName: "X-XSRF-TOKEN",
671
+ maxContentLength: -1,
672
+ maxBodyLength: -1,
673
+ env: {
674
+ FormData: C.classes.FormData,
675
+ Blob: C.classes.Blob
676
+ },
677
+ validateStatus: function(t) {
678
+ return t >= 200 && t < 300;
679
+ },
680
+ headers: {
681
+ common: {
682
+ Accept: "application/json, text/plain, */*",
683
+ "Content-Type": void 0
684
+ }
685
+ }
686
+ };
687
+ a.forEach(["delete", "get", "head", "post", "put", "patch"], (e) => {
688
+ W.headers[e] = {};
689
+ });
690
+ const Sn = a.toObjectSet([
691
+ "age",
692
+ "authorization",
693
+ "content-length",
694
+ "content-type",
695
+ "etag",
696
+ "expires",
697
+ "from",
698
+ "host",
699
+ "if-modified-since",
700
+ "if-unmodified-since",
701
+ "last-modified",
702
+ "location",
703
+ "max-forwards",
704
+ "proxy-authorization",
705
+ "referer",
706
+ "retry-after",
707
+ "user-agent"
708
+ ]), On = (e) => {
709
+ const t = {};
710
+ let n, r, s;
711
+ return e && e.split(`
712
+ `).forEach(function(i) {
713
+ s = i.indexOf(":"), n = i.substring(0, s).trim().toLowerCase(), r = i.substring(s + 1).trim(), !(!n || t[n] && Sn[n]) && (n === "set-cookie" ? t[n] ? t[n].push(r) : t[n] = [r] : t[n] = t[n] ? t[n] + ", " + r : r);
714
+ }), t;
715
+ }, xe = Symbol("internals");
716
+ function H(e) {
717
+ return e && String(e).trim().toLowerCase();
718
+ }
719
+ function X(e) {
720
+ return e === !1 || e == null ? e : a.isArray(e) ? e.map(X) : String(e);
721
+ }
722
+ function Tn(e) {
723
+ const t = /* @__PURE__ */ Object.create(null), n = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
724
+ let r;
725
+ for (; r = n.exec(e); )
726
+ t[r[1]] = r[2];
727
+ return t;
728
+ }
729
+ const An = (e) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());
730
+ function ae(e, t, n, r, s) {
731
+ if (a.isFunction(r))
732
+ return r.call(this, t, n);
733
+ if (s && (t = n), !!a.isString(t)) {
734
+ if (a.isString(r))
735
+ return t.indexOf(r) !== -1;
736
+ if (a.isRegExp(r))
737
+ return r.test(t);
738
+ }
739
+ }
740
+ function xn(e) {
741
+ return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (t, n, r) => n.toUpperCase() + r);
742
+ }
743
+ function Cn(e, t) {
744
+ const n = a.toCamelCase(" " + t);
745
+ ["get", "set", "has"].forEach((r) => {
746
+ Object.defineProperty(e, r + n, {
747
+ value: function(s, o, i) {
748
+ return this[r].call(this, t, s, o, i);
749
+ },
750
+ configurable: !0
751
+ });
752
+ });
753
+ }
754
+ let N = class {
755
+ constructor(t) {
756
+ t && this.set(t);
757
+ }
758
+ set(t, n, r) {
759
+ const s = this;
760
+ function o(c, f, u) {
761
+ const l = H(f);
762
+ if (!l)
763
+ throw new Error("header name must be a non-empty string");
764
+ const d = a.findKey(s, l);
765
+ (!d || s[d] === void 0 || u === !0 || u === void 0 && s[d] !== !1) && (s[d || f] = X(c));
766
+ }
767
+ const i = (c, f) => a.forEach(c, (u, l) => o(u, l, f));
768
+ if (a.isPlainObject(t) || t instanceof this.constructor)
769
+ i(t, n);
770
+ else if (a.isString(t) && (t = t.trim()) && !An(t))
771
+ i(On(t), n);
772
+ else if (a.isObject(t) && a.isIterable(t)) {
773
+ let c = {}, f, u;
774
+ for (const l of t) {
775
+ if (!a.isArray(l))
776
+ throw TypeError("Object iterator must return a key-value pair");
777
+ c[u = l[0]] = (f = c[u]) ? a.isArray(f) ? [...f, l[1]] : [f, l[1]] : l[1];
778
+ }
779
+ i(c, n);
780
+ } else
781
+ t != null && o(n, t, r);
782
+ return this;
783
+ }
784
+ get(t, n) {
785
+ if (t = H(t), t) {
786
+ const r = a.findKey(this, t);
787
+ if (r) {
788
+ const s = this[r];
789
+ if (!n)
790
+ return s;
791
+ if (n === !0)
792
+ return Tn(s);
793
+ if (a.isFunction(n))
794
+ return n.call(this, s, r);
795
+ if (a.isRegExp(n))
796
+ return n.exec(s);
797
+ throw new TypeError("parser must be boolean|regexp|function");
798
+ }
799
+ }
800
+ }
801
+ has(t, n) {
802
+ if (t = H(t), t) {
803
+ const r = a.findKey(this, t);
804
+ return !!(r && this[r] !== void 0 && (!n || ae(this, this[r], r, n)));
805
+ }
806
+ return !1;
807
+ }
808
+ delete(t, n) {
809
+ const r = this;
810
+ let s = !1;
811
+ function o(i) {
812
+ if (i = H(i), i) {
813
+ const c = a.findKey(r, i);
814
+ c && (!n || ae(r, r[c], c, n)) && (delete r[c], s = !0);
815
+ }
816
+ }
817
+ return a.isArray(t) ? t.forEach(o) : o(t), s;
818
+ }
819
+ clear(t) {
820
+ const n = Object.keys(this);
821
+ let r = n.length, s = !1;
822
+ for (; r--; ) {
823
+ const o = n[r];
824
+ (!t || ae(this, this[o], o, t, !0)) && (delete this[o], s = !0);
825
+ }
826
+ return s;
827
+ }
828
+ normalize(t) {
829
+ const n = this, r = {};
830
+ return a.forEach(this, (s, o) => {
831
+ const i = a.findKey(r, o);
832
+ if (i) {
833
+ n[i] = X(s), delete n[o];
834
+ return;
835
+ }
836
+ const c = t ? xn(o) : String(o).trim();
837
+ c !== o && delete n[o], n[c] = X(s), r[c] = !0;
838
+ }), this;
839
+ }
840
+ concat(...t) {
841
+ return this.constructor.concat(this, ...t);
842
+ }
843
+ toJSON(t) {
844
+ const n = /* @__PURE__ */ Object.create(null);
845
+ return a.forEach(this, (r, s) => {
846
+ r != null && r !== !1 && (n[s] = t && a.isArray(r) ? r.join(", ") : r);
847
+ }), n;
848
+ }
849
+ [Symbol.iterator]() {
850
+ return Object.entries(this.toJSON())[Symbol.iterator]();
851
+ }
852
+ toString() {
853
+ return Object.entries(this.toJSON()).map(([t, n]) => t + ": " + n).join(`
854
+ `);
855
+ }
856
+ getSetCookie() {
857
+ return this.get("set-cookie") || [];
858
+ }
859
+ get [Symbol.toStringTag]() {
860
+ return "AxiosHeaders";
861
+ }
862
+ static from(t) {
863
+ return t instanceof this ? t : new this(t);
864
+ }
865
+ static concat(t, ...n) {
866
+ const r = new this(t);
867
+ return n.forEach((s) => r.set(s)), r;
868
+ }
869
+ static accessor(t) {
870
+ const r = (this[xe] = this[xe] = {
871
+ accessors: {}
872
+ }).accessors, s = this.prototype;
873
+ function o(i) {
874
+ const c = H(i);
875
+ r[c] || (Cn(s, i), r[c] = !0);
876
+ }
877
+ return a.isArray(t) ? t.forEach(o) : o(t), this;
878
+ }
879
+ };
880
+ N.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
881
+ a.reduceDescriptors(N.prototype, ({ value: e }, t) => {
882
+ let n = t[0].toUpperCase() + t.slice(1);
883
+ return {
884
+ get: () => e,
885
+ set(r) {
886
+ this[n] = r;
887
+ }
888
+ };
889
+ });
890
+ a.freezeMethods(N);
891
+ function ce(e, t) {
892
+ const n = this || W, r = t || n, s = N.from(r.headers);
893
+ let o = r.data;
894
+ return a.forEach(e, function(c) {
895
+ o = c.call(n, o, s.normalize(), t ? t.status : void 0);
896
+ }), s.normalize(), o;
897
+ }
898
+ function Ge(e) {
899
+ return !!(e && e.__CANCEL__);
900
+ }
901
+ function v(e, t, n) {
902
+ y.call(this, e ?? "canceled", y.ERR_CANCELED, t, n), this.name = "CanceledError";
903
+ }
904
+ a.inherits(v, y, {
905
+ __CANCEL__: !0
906
+ });
907
+ function Ze(e, t, n) {
908
+ const r = n.config.validateStatus;
909
+ !n.status || !r || r(n.status) ? e(n) : t(new y(
910
+ "Request failed with status code " + n.status,
911
+ [y.ERR_BAD_REQUEST, y.ERR_BAD_RESPONSE][Math.floor(n.status / 100) - 4],
912
+ n.config,
913
+ n.request,
914
+ n
915
+ ));
916
+ }
917
+ function Pn(e) {
918
+ const t = /^([-+\w]{1,25})(:?\/\/|:)/.exec(e);
919
+ return t && t[1] || "";
920
+ }
921
+ function Nn(e, t) {
922
+ e = e || 10;
923
+ const n = new Array(e), r = new Array(e);
924
+ let s = 0, o = 0, i;
925
+ return t = t !== void 0 ? t : 1e3, function(f) {
926
+ const u = Date.now(), l = r[o];
927
+ i || (i = u), n[s] = f, r[s] = u;
928
+ let d = o, w = 0;
929
+ for (; d !== s; )
930
+ w += n[d++], d = d % e;
931
+ if (s = (s + 1) % e, s === o && (o = (o + 1) % e), u - i < t)
932
+ return;
933
+ const g = l && u - l;
934
+ return g ? Math.round(w * 1e3 / g) : void 0;
935
+ };
936
+ }
937
+ function Fn(e, t) {
938
+ let n = 0, r = 1e3 / t, s, o;
939
+ const i = (u, l = Date.now()) => {
940
+ n = l, s = null, o && (clearTimeout(o), o = null), e(...u);
941
+ };
942
+ return [(...u) => {
943
+ const l = Date.now(), d = l - n;
944
+ d >= r ? i(u, l) : (s = u, o || (o = setTimeout(() => {
945
+ o = null, i(s);
946
+ }, r - d)));
947
+ }, () => s && i(s)];
948
+ }
949
+ const Y = (e, t, n = 3) => {
950
+ let r = 0;
951
+ const s = Nn(50, 250);
952
+ return Fn((o) => {
953
+ const i = o.loaded, c = o.lengthComputable ? o.total : void 0, f = i - r, u = s(f), l = i <= c;
954
+ r = i;
955
+ const d = {
956
+ loaded: i,
957
+ total: c,
958
+ progress: c ? i / c : void 0,
959
+ bytes: f,
960
+ rate: u || void 0,
961
+ estimated: u && c && l ? (c - i) / u : void 0,
962
+ event: o,
963
+ lengthComputable: c != null,
964
+ [t ? "download" : "upload"]: !0
965
+ };
966
+ e(d);
967
+ }, n);
968
+ }, Ce = (e, t) => {
969
+ const n = e != null;
970
+ return [(r) => t[0]({
971
+ lengthComputable: n,
972
+ total: e,
973
+ loaded: r
974
+ }), t[1]];
975
+ }, Pe = (e) => (...t) => a.asap(() => e(...t)), _n = C.hasStandardBrowserEnv ? /* @__PURE__ */ ((e, t) => (n) => (n = new URL(n, C.origin), e.protocol === n.protocol && e.host === n.host && (t || e.port === n.port)))(
976
+ new URL(C.origin),
977
+ C.navigator && /(msie|trident)/i.test(C.navigator.userAgent)
978
+ ) : () => !0, Un = C.hasStandardBrowserEnv ? (
979
+ // Standard browser envs support document.cookie
980
+ {
981
+ write(e, t, n, r, s, o) {
982
+ const i = [e + "=" + encodeURIComponent(t)];
983
+ a.isNumber(n) && i.push("expires=" + new Date(n).toGMTString()), a.isString(r) && i.push("path=" + r), a.isString(s) && i.push("domain=" + s), o === !0 && i.push("secure"), document.cookie = i.join("; ");
984
+ },
985
+ read(e) {
986
+ const t = document.cookie.match(new RegExp("(^|;\\s*)(" + e + ")=([^;]*)"));
987
+ return t ? decodeURIComponent(t[3]) : null;
988
+ },
989
+ remove(e) {
990
+ this.write(e, "", Date.now() - 864e5);
991
+ }
992
+ }
993
+ ) : (
994
+ // Non-standard browser env (web workers, react-native) lack needed support.
995
+ {
996
+ write() {
997
+ },
998
+ read() {
999
+ return null;
1000
+ },
1001
+ remove() {
1002
+ }
1003
+ }
1004
+ );
1005
+ function kn(e) {
1006
+ return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(e);
1007
+ }
1008
+ function Ln(e, t) {
1009
+ return t ? e.replace(/\/?\/$/, "") + "/" + t.replace(/^\/+/, "") : e;
1010
+ }
1011
+ function Ye(e, t, n) {
1012
+ let r = !kn(t);
1013
+ return e && (r || n == !1) ? Ln(e, t) : t;
1014
+ }
1015
+ const Ne = (e) => e instanceof N ? { ...e } : e;
1016
+ function q(e, t) {
1017
+ t = t || {};
1018
+ const n = {};
1019
+ function r(u, l, d, w) {
1020
+ return a.isPlainObject(u) && a.isPlainObject(l) ? a.merge.call({ caseless: w }, u, l) : a.isPlainObject(l) ? a.merge({}, l) : a.isArray(l) ? l.slice() : l;
1021
+ }
1022
+ function s(u, l, d, w) {
1023
+ if (a.isUndefined(l)) {
1024
+ if (!a.isUndefined(u))
1025
+ return r(void 0, u, d, w);
1026
+ } else return r(u, l, d, w);
1027
+ }
1028
+ function o(u, l) {
1029
+ if (!a.isUndefined(l))
1030
+ return r(void 0, l);
1031
+ }
1032
+ function i(u, l) {
1033
+ if (a.isUndefined(l)) {
1034
+ if (!a.isUndefined(u))
1035
+ return r(void 0, u);
1036
+ } else return r(void 0, l);
1037
+ }
1038
+ function c(u, l, d) {
1039
+ if (d in t)
1040
+ return r(u, l);
1041
+ if (d in e)
1042
+ return r(void 0, u);
1043
+ }
1044
+ const f = {
1045
+ url: o,
1046
+ method: o,
1047
+ data: o,
1048
+ baseURL: i,
1049
+ transformRequest: i,
1050
+ transformResponse: i,
1051
+ paramsSerializer: i,
1052
+ timeout: i,
1053
+ timeoutMessage: i,
1054
+ withCredentials: i,
1055
+ withXSRFToken: i,
1056
+ adapter: i,
1057
+ responseType: i,
1058
+ xsrfCookieName: i,
1059
+ xsrfHeaderName: i,
1060
+ onUploadProgress: i,
1061
+ onDownloadProgress: i,
1062
+ decompress: i,
1063
+ maxContentLength: i,
1064
+ maxBodyLength: i,
1065
+ beforeRedirect: i,
1066
+ transport: i,
1067
+ httpAgent: i,
1068
+ httpsAgent: i,
1069
+ cancelToken: i,
1070
+ socketPath: i,
1071
+ responseEncoding: i,
1072
+ validateStatus: c,
1073
+ headers: (u, l, d) => s(Ne(u), Ne(l), d, !0)
1074
+ };
1075
+ return a.forEach(Object.keys({ ...e, ...t }), function(l) {
1076
+ const d = f[l] || s, w = d(e[l], t[l], l);
1077
+ a.isUndefined(w) && d !== c || (n[l] = w);
1078
+ }), n;
1079
+ }
1080
+ const et = (e) => {
1081
+ const t = q({}, e);
1082
+ let { data: n, withXSRFToken: r, xsrfHeaderName: s, xsrfCookieName: o, headers: i, auth: c } = t;
1083
+ t.headers = i = N.from(i), t.url = Ke(Ye(t.baseURL, t.url, t.allowAbsoluteUrls), e.params, e.paramsSerializer), c && i.set(
1084
+ "Authorization",
1085
+ "Basic " + btoa((c.username || "") + ":" + (c.password ? unescape(encodeURIComponent(c.password)) : ""))
1086
+ );
1087
+ let f;
1088
+ if (a.isFormData(n)) {
1089
+ if (C.hasStandardBrowserEnv || C.hasStandardBrowserWebWorkerEnv)
1090
+ i.setContentType(void 0);
1091
+ else if ((f = i.getContentType()) !== !1) {
1092
+ const [u, ...l] = f ? f.split(";").map((d) => d.trim()).filter(Boolean) : [];
1093
+ i.setContentType([u || "multipart/form-data", ...l].join("; "));
1094
+ }
1095
+ }
1096
+ if (C.hasStandardBrowserEnv && (r && a.isFunction(r) && (r = r(t)), r || r !== !1 && _n(t.url))) {
1097
+ const u = s && o && Un.read(o);
1098
+ u && i.set(s, u);
1099
+ }
1100
+ return t;
1101
+ }, Dn = typeof XMLHttpRequest < "u", Bn = Dn && function(e) {
1102
+ return new Promise(function(n, r) {
1103
+ const s = et(e);
1104
+ let o = s.data;
1105
+ const i = N.from(s.headers).normalize();
1106
+ let { responseType: c, onUploadProgress: f, onDownloadProgress: u } = s, l, d, w, g, p;
1107
+ function m() {
1108
+ g && g(), p && p(), s.cancelToken && s.cancelToken.unsubscribe(l), s.signal && s.signal.removeEventListener("abort", l);
1109
+ }
1110
+ let h = new XMLHttpRequest();
1111
+ h.open(s.method.toUpperCase(), s.url, !0), h.timeout = s.timeout;
1112
+ function R() {
1113
+ if (!h)
1114
+ return;
1115
+ const b = N.from(
1116
+ "getAllResponseHeaders" in h && h.getAllResponseHeaders()
1117
+ ), S = {
1118
+ data: !c || c === "text" || c === "json" ? h.responseText : h.response,
1119
+ status: h.status,
1120
+ statusText: h.statusText,
1121
+ headers: b,
1122
+ config: e,
1123
+ request: h
1124
+ };
1125
+ Ze(function(L) {
1126
+ n(L), m();
1127
+ }, function(L) {
1128
+ r(L), m();
1129
+ }, S), h = null;
1130
+ }
1131
+ "onloadend" in h ? h.onloadend = R : h.onreadystatechange = function() {
1132
+ !h || h.readyState !== 4 || h.status === 0 && !(h.responseURL && h.responseURL.indexOf("file:") === 0) || setTimeout(R);
1133
+ }, h.onabort = function() {
1134
+ h && (r(new y("Request aborted", y.ECONNABORTED, e, h)), h = null);
1135
+ }, h.onerror = function() {
1136
+ r(new y("Network Error", y.ERR_NETWORK, e, h)), h = null;
1137
+ }, h.ontimeout = function() {
1138
+ let T = s.timeout ? "timeout of " + s.timeout + "ms exceeded" : "timeout exceeded";
1139
+ const S = s.transitional || Qe;
1140
+ s.timeoutErrorMessage && (T = s.timeoutErrorMessage), r(new y(
1141
+ T,
1142
+ S.clarifyTimeoutError ? y.ETIMEDOUT : y.ECONNABORTED,
1143
+ e,
1144
+ h
1145
+ )), h = null;
1146
+ }, o === void 0 && i.setContentType(null), "setRequestHeader" in h && a.forEach(i.toJSON(), function(T, S) {
1147
+ h.setRequestHeader(S, T);
1148
+ }), a.isUndefined(s.withCredentials) || (h.withCredentials = !!s.withCredentials), c && c !== "json" && (h.responseType = s.responseType), u && ([w, p] = Y(u, !0), h.addEventListener("progress", w)), f && h.upload && ([d, g] = Y(f), h.upload.addEventListener("progress", d), h.upload.addEventListener("loadend", g)), (s.cancelToken || s.signal) && (l = (b) => {
1149
+ h && (r(!b || b.type ? new v(null, e, h) : b), h.abort(), h = null);
1150
+ }, s.cancelToken && s.cancelToken.subscribe(l), s.signal && (s.signal.aborted ? l() : s.signal.addEventListener("abort", l)));
1151
+ const E = Pn(s.url);
1152
+ if (E && C.protocols.indexOf(E) === -1) {
1153
+ r(new y("Unsupported protocol " + E + ":", y.ERR_BAD_REQUEST, e));
1154
+ return;
1155
+ }
1156
+ h.send(o || null);
1157
+ });
1158
+ }, jn = (e, t) => {
1159
+ const { length: n } = e = e ? e.filter(Boolean) : [];
1160
+ if (t || n) {
1161
+ let r = new AbortController(), s;
1162
+ const o = function(u) {
1163
+ if (!s) {
1164
+ s = !0, c();
1165
+ const l = u instanceof Error ? u : this.reason;
1166
+ r.abort(l instanceof y ? l : new v(l instanceof Error ? l.message : l));
1167
+ }
1168
+ };
1169
+ let i = t && setTimeout(() => {
1170
+ i = null, o(new y(`timeout ${t} of ms exceeded`, y.ETIMEDOUT));
1171
+ }, t);
1172
+ const c = () => {
1173
+ e && (i && clearTimeout(i), i = null, e.forEach((u) => {
1174
+ u.unsubscribe ? u.unsubscribe(o) : u.removeEventListener("abort", o);
1175
+ }), e = null);
1176
+ };
1177
+ e.forEach((u) => u.addEventListener("abort", o));
1178
+ const { signal: f } = r;
1179
+ return f.unsubscribe = () => a.asap(c), f;
1180
+ }
1181
+ }, qn = function* (e, t) {
1182
+ let n = e.byteLength;
1183
+ if (n < t) {
1184
+ yield e;
1185
+ return;
1186
+ }
1187
+ let r = 0, s;
1188
+ for (; r < n; )
1189
+ s = r + t, yield e.slice(r, s), r = s;
1190
+ }, Mn = async function* (e, t) {
1191
+ for await (const n of In(e))
1192
+ yield* qn(n, t);
1193
+ }, In = async function* (e) {
1194
+ if (e[Symbol.asyncIterator]) {
1195
+ yield* e;
1196
+ return;
1197
+ }
1198
+ const t = e.getReader();
1199
+ try {
1200
+ for (; ; ) {
1201
+ const { done: n, value: r } = await t.read();
1202
+ if (n)
1203
+ break;
1204
+ yield r;
1205
+ }
1206
+ } finally {
1207
+ await t.cancel();
1208
+ }
1209
+ }, Fe = (e, t, n, r) => {
1210
+ const s = Mn(e, t);
1211
+ let o = 0, i, c = (f) => {
1212
+ i || (i = !0, r && r(f));
1213
+ };
1214
+ return new ReadableStream({
1215
+ async pull(f) {
1216
+ try {
1217
+ const { done: u, value: l } = await s.next();
1218
+ if (u) {
1219
+ c(), f.close();
1220
+ return;
1221
+ }
1222
+ let d = l.byteLength;
1223
+ if (n) {
1224
+ let w = o += d;
1225
+ n(w);
1226
+ }
1227
+ f.enqueue(new Uint8Array(l));
1228
+ } catch (u) {
1229
+ throw c(u), u;
1230
+ }
1231
+ },
1232
+ cancel(f) {
1233
+ return c(f), s.return();
1234
+ }
1235
+ }, {
1236
+ highWaterMark: 2
1237
+ });
1238
+ }, oe = typeof fetch == "function" && typeof Request == "function" && typeof Response == "function", tt = oe && typeof ReadableStream == "function", vn = oe && (typeof TextEncoder == "function" ? /* @__PURE__ */ ((e) => (t) => e.encode(t))(new TextEncoder()) : async (e) => new Uint8Array(await new Response(e).arrayBuffer())), nt = (e, ...t) => {
1239
+ try {
1240
+ return !!e(...t);
1241
+ } catch {
1242
+ return !1;
1243
+ }
1244
+ }, Hn = tt && nt(() => {
1245
+ let e = !1;
1246
+ const t = new Request(C.origin, {
1247
+ body: new ReadableStream(),
1248
+ method: "POST",
1249
+ get duplex() {
1250
+ return e = !0, "half";
1251
+ }
1252
+ }).headers.has("Content-Type");
1253
+ return e && !t;
1254
+ }), _e = 64 * 1024, pe = tt && nt(() => a.isReadableStream(new Response("").body)), ee = {
1255
+ stream: pe && ((e) => e.body)
1256
+ };
1257
+ oe && ((e) => {
1258
+ ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((t) => {
1259
+ !ee[t] && (ee[t] = a.isFunction(e[t]) ? (n) => n[t]() : (n, r) => {
1260
+ throw new y(`Response type '${t}' is not supported`, y.ERR_NOT_SUPPORT, r);
1261
+ });
1262
+ });
1263
+ })(new Response());
1264
+ const zn = async (e) => {
1265
+ if (e == null)
1266
+ return 0;
1267
+ if (a.isBlob(e))
1268
+ return e.size;
1269
+ if (a.isSpecCompliantForm(e))
1270
+ return (await new Request(C.origin, {
1271
+ method: "POST",
1272
+ body: e
1273
+ }).arrayBuffer()).byteLength;
1274
+ if (a.isArrayBufferView(e) || a.isArrayBuffer(e))
1275
+ return e.byteLength;
1276
+ if (a.isURLSearchParams(e) && (e = e + ""), a.isString(e))
1277
+ return (await vn(e)).byteLength;
1278
+ }, $n = async (e, t) => {
1279
+ const n = a.toFiniteNumber(e.getContentLength());
1280
+ return n ?? zn(t);
1281
+ }, Jn = oe && (async (e) => {
1282
+ let {
1283
+ url: t,
1284
+ method: n,
1285
+ data: r,
1286
+ signal: s,
1287
+ cancelToken: o,
1288
+ timeout: i,
1289
+ onDownloadProgress: c,
1290
+ onUploadProgress: f,
1291
+ responseType: u,
1292
+ headers: l,
1293
+ withCredentials: d = "same-origin",
1294
+ fetchOptions: w
1295
+ } = et(e);
1296
+ u = u ? (u + "").toLowerCase() : "text";
1297
+ let g = jn([s, o && o.toAbortSignal()], i), p;
1298
+ const m = g && g.unsubscribe && (() => {
1299
+ g.unsubscribe();
1300
+ });
1301
+ let h;
1302
+ try {
1303
+ if (f && Hn && n !== "get" && n !== "head" && (h = await $n(l, r)) !== 0) {
1304
+ let S = new Request(t, {
1305
+ method: "POST",
1306
+ body: r,
1307
+ duplex: "half"
1308
+ }), A;
1309
+ if (a.isFormData(r) && (A = S.headers.get("content-type")) && l.setContentType(A), S.body) {
1310
+ const [L, x] = Ce(
1311
+ h,
1312
+ Y(Pe(f))
1313
+ );
1314
+ r = Fe(S.body, _e, L, x);
1315
+ }
1316
+ }
1317
+ a.isString(d) || (d = d ? "include" : "omit");
1318
+ const R = "credentials" in Request.prototype;
1319
+ p = new Request(t, {
1320
+ ...w,
1321
+ signal: g,
1322
+ method: n.toUpperCase(),
1323
+ headers: l.normalize().toJSON(),
1324
+ body: r,
1325
+ duplex: "half",
1326
+ credentials: R ? d : void 0
1327
+ });
1328
+ let E = await fetch(p, w);
1329
+ const b = pe && (u === "stream" || u === "response");
1330
+ if (pe && (c || b && m)) {
1331
+ const S = {};
1332
+ ["status", "statusText", "headers"].forEach((F) => {
1333
+ S[F] = E[F];
1334
+ });
1335
+ const A = a.toFiniteNumber(E.headers.get("content-length")), [L, x] = c && Ce(
1336
+ A,
1337
+ Y(Pe(c), !0)
1338
+ ) || [];
1339
+ E = new Response(
1340
+ Fe(E.body, _e, L, () => {
1341
+ x && x(), m && m();
1342
+ }),
1343
+ S
1344
+ );
1345
+ }
1346
+ u = u || "text";
1347
+ let T = await ee[a.findKey(ee, u) || "text"](E, e);
1348
+ return !b && m && m(), await new Promise((S, A) => {
1349
+ Ze(S, A, {
1350
+ data: T,
1351
+ headers: N.from(E.headers),
1352
+ status: E.status,
1353
+ statusText: E.statusText,
1354
+ config: e,
1355
+ request: p
1356
+ });
1357
+ });
1358
+ } catch (R) {
1359
+ throw m && m(), R && R.name === "TypeError" && /Load failed|fetch/i.test(R.message) ? Object.assign(
1360
+ new y("Network Error", y.ERR_NETWORK, e, p),
1361
+ {
1362
+ cause: R.cause || R
1363
+ }
1364
+ ) : y.from(R, R && R.code, e, p);
1365
+ }
1366
+ }), he = {
1367
+ http: on,
1368
+ xhr: Bn,
1369
+ fetch: Jn
1370
+ };
1371
+ a.forEach(he, (e, t) => {
1372
+ if (e) {
1373
+ try {
1374
+ Object.defineProperty(e, "name", { value: t });
1375
+ } catch {
1376
+ }
1377
+ Object.defineProperty(e, "adapterName", { value: t });
1378
+ }
1379
+ });
1380
+ const Ue = (e) => `- ${e}`, Vn = (e) => a.isFunction(e) || e === null || e === !1, rt = {
1381
+ getAdapter: (e) => {
1382
+ e = a.isArray(e) ? e : [e];
1383
+ const { length: t } = e;
1384
+ let n, r;
1385
+ const s = {};
1386
+ for (let o = 0; o < t; o++) {
1387
+ n = e[o];
1388
+ let i;
1389
+ if (r = n, !Vn(n) && (r = he[(i = String(n)).toLowerCase()], r === void 0))
1390
+ throw new y(`Unknown adapter '${i}'`);
1391
+ if (r)
1392
+ break;
1393
+ s[i || "#" + o] = r;
1394
+ }
1395
+ if (!r) {
1396
+ const o = Object.entries(s).map(
1397
+ ([c, f]) => `adapter ${c} ` + (f === !1 ? "is not supported by the environment" : "is not available in the build")
1398
+ );
1399
+ let i = t ? o.length > 1 ? `since :
1400
+ ` + o.map(Ue).join(`
1401
+ `) : " " + Ue(o[0]) : "as no adapter specified";
1402
+ throw new y(
1403
+ "There is no suitable adapter to dispatch the request " + i,
1404
+ "ERR_NOT_SUPPORT"
1405
+ );
1406
+ }
1407
+ return r;
1408
+ },
1409
+ adapters: he
1410
+ };
1411
+ function ue(e) {
1412
+ if (e.cancelToken && e.cancelToken.throwIfRequested(), e.signal && e.signal.aborted)
1413
+ throw new v(null, e);
1414
+ }
1415
+ function ke(e) {
1416
+ return ue(e), e.headers = N.from(e.headers), e.data = ce.call(
1417
+ e,
1418
+ e.transformRequest
1419
+ ), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1), rt.getAdapter(e.adapter || W.adapter)(e).then(function(r) {
1420
+ return ue(e), r.data = ce.call(
1421
+ e,
1422
+ e.transformResponse,
1423
+ r
1424
+ ), r.headers = N.from(r.headers), r;
1425
+ }, function(r) {
1426
+ return Ge(r) || (ue(e), r && r.response && (r.response.data = ce.call(
1427
+ e,
1428
+ e.transformResponse,
1429
+ r.response
1430
+ ), r.response.headers = N.from(r.response.headers))), Promise.reject(r);
1431
+ });
1432
+ }
1433
+ const st = "1.11.0", ie = {};
1434
+ ["object", "boolean", "number", "function", "string", "symbol"].forEach((e, t) => {
1435
+ ie[e] = function(r) {
1436
+ return typeof r === e || "a" + (t < 1 ? "n " : " ") + e;
1437
+ };
1438
+ });
1439
+ const Le = {};
1440
+ ie.transitional = function(t, n, r) {
1441
+ function s(o, i) {
1442
+ return "[Axios v" + st + "] Transitional option '" + o + "'" + i + (r ? ". " + r : "");
1443
+ }
1444
+ return (o, i, c) => {
1445
+ if (t === !1)
1446
+ throw new y(
1447
+ s(i, " has been removed" + (n ? " in " + n : "")),
1448
+ y.ERR_DEPRECATED
1449
+ );
1450
+ return n && !Le[i] && (Le[i] = !0, console.warn(
1451
+ s(
1452
+ i,
1453
+ " has been deprecated since v" + n + " and will be removed in the near future"
1454
+ )
1455
+ )), t ? t(o, i, c) : !0;
1456
+ };
1457
+ };
1458
+ ie.spelling = function(t) {
1459
+ return (n, r) => (console.warn(`${r} is likely a misspelling of ${t}`), !0);
1460
+ };
1461
+ function Wn(e, t, n) {
1462
+ if (typeof e != "object")
1463
+ throw new y("options must be an object", y.ERR_BAD_OPTION_VALUE);
1464
+ const r = Object.keys(e);
1465
+ let s = r.length;
1466
+ for (; s-- > 0; ) {
1467
+ const o = r[s], i = t[o];
1468
+ if (i) {
1469
+ const c = e[o], f = c === void 0 || i(c, o, e);
1470
+ if (f !== !0)
1471
+ throw new y("option " + o + " must be " + f, y.ERR_BAD_OPTION_VALUE);
1472
+ continue;
1473
+ }
1474
+ if (n !== !0)
1475
+ throw new y("Unknown option " + o, y.ERR_BAD_OPTION);
1476
+ }
1477
+ }
1478
+ const G = {
1479
+ assertOptions: Wn,
1480
+ validators: ie
1481
+ }, k = G.validators;
1482
+ let j = class {
1483
+ constructor(t) {
1484
+ this.defaults = t || {}, this.interceptors = {
1485
+ request: new Ae(),
1486
+ response: new Ae()
1487
+ };
1488
+ }
1489
+ /**
1490
+ * Dispatch a request
1491
+ *
1492
+ * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
1493
+ * @param {?Object} config
1494
+ *
1495
+ * @returns {Promise} The Promise to be fulfilled
1496
+ */
1497
+ async request(t, n) {
1498
+ try {
1499
+ return await this._request(t, n);
1500
+ } catch (r) {
1501
+ if (r instanceof Error) {
1502
+ let s = {};
1503
+ Error.captureStackTrace ? Error.captureStackTrace(s) : s = new Error();
1504
+ const o = s.stack ? s.stack.replace(/^.+\n/, "") : "";
1505
+ try {
1506
+ r.stack ? o && !String(r.stack).endsWith(o.replace(/^.+\n.+\n/, "")) && (r.stack += `
1507
+ ` + o) : r.stack = o;
1508
+ } catch {
1509
+ }
1510
+ }
1511
+ throw r;
1512
+ }
1513
+ }
1514
+ _request(t, n) {
1515
+ typeof t == "string" ? (n = n || {}, n.url = t) : n = t || {}, n = q(this.defaults, n);
1516
+ const { transitional: r, paramsSerializer: s, headers: o } = n;
1517
+ r !== void 0 && G.assertOptions(r, {
1518
+ silentJSONParsing: k.transitional(k.boolean),
1519
+ forcedJSONParsing: k.transitional(k.boolean),
1520
+ clarifyTimeoutError: k.transitional(k.boolean)
1521
+ }, !1), s != null && (a.isFunction(s) ? n.paramsSerializer = {
1522
+ serialize: s
1523
+ } : G.assertOptions(s, {
1524
+ encode: k.function,
1525
+ serialize: k.function
1526
+ }, !0)), n.allowAbsoluteUrls !== void 0 || (this.defaults.allowAbsoluteUrls !== void 0 ? n.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls : n.allowAbsoluteUrls = !0), G.assertOptions(n, {
1527
+ baseUrl: k.spelling("baseURL"),
1528
+ withXsrfToken: k.spelling("withXSRFToken")
1529
+ }, !0), n.method = (n.method || this.defaults.method || "get").toLowerCase();
1530
+ let i = o && a.merge(
1531
+ o.common,
1532
+ o[n.method]
1533
+ );
1534
+ o && a.forEach(
1535
+ ["delete", "get", "head", "post", "put", "patch", "common"],
1536
+ (p) => {
1537
+ delete o[p];
1538
+ }
1539
+ ), n.headers = N.concat(i, o);
1540
+ const c = [];
1541
+ let f = !0;
1542
+ this.interceptors.request.forEach(function(m) {
1543
+ typeof m.runWhen == "function" && m.runWhen(n) === !1 || (f = f && m.synchronous, c.unshift(m.fulfilled, m.rejected));
1544
+ });
1545
+ const u = [];
1546
+ this.interceptors.response.forEach(function(m) {
1547
+ u.push(m.fulfilled, m.rejected);
1548
+ });
1549
+ let l, d = 0, w;
1550
+ if (!f) {
1551
+ const p = [ke.bind(this), void 0];
1552
+ for (p.unshift(...c), p.push(...u), w = p.length, l = Promise.resolve(n); d < w; )
1553
+ l = l.then(p[d++], p[d++]);
1554
+ return l;
1555
+ }
1556
+ w = c.length;
1557
+ let g = n;
1558
+ for (d = 0; d < w; ) {
1559
+ const p = c[d++], m = c[d++];
1560
+ try {
1561
+ g = p(g);
1562
+ } catch (h) {
1563
+ m.call(this, h);
1564
+ break;
1565
+ }
1566
+ }
1567
+ try {
1568
+ l = ke.call(this, g);
1569
+ } catch (p) {
1570
+ return Promise.reject(p);
1571
+ }
1572
+ for (d = 0, w = u.length; d < w; )
1573
+ l = l.then(u[d++], u[d++]);
1574
+ return l;
1575
+ }
1576
+ getUri(t) {
1577
+ t = q(this.defaults, t);
1578
+ const n = Ye(t.baseURL, t.url, t.allowAbsoluteUrls);
1579
+ return Ke(n, t.params, t.paramsSerializer);
1580
+ }
1581
+ };
1582
+ a.forEach(["delete", "get", "head", "options"], function(t) {
1583
+ j.prototype[t] = function(n, r) {
1584
+ return this.request(q(r || {}, {
1585
+ method: t,
1586
+ url: n,
1587
+ data: (r || {}).data
1588
+ }));
1589
+ };
1590
+ });
1591
+ a.forEach(["post", "put", "patch"], function(t) {
1592
+ function n(r) {
1593
+ return function(o, i, c) {
1594
+ return this.request(q(c || {}, {
1595
+ method: t,
1596
+ headers: r ? {
1597
+ "Content-Type": "multipart/form-data"
1598
+ } : {},
1599
+ url: o,
1600
+ data: i
1601
+ }));
1602
+ };
1603
+ }
1604
+ j.prototype[t] = n(), j.prototype[t + "Form"] = n(!0);
1605
+ });
1606
+ let Kn = class ot {
1607
+ constructor(t) {
1608
+ if (typeof t != "function")
1609
+ throw new TypeError("executor must be a function.");
1610
+ let n;
1611
+ this.promise = new Promise(function(o) {
1612
+ n = o;
1613
+ });
1614
+ const r = this;
1615
+ this.promise.then((s) => {
1616
+ if (!r._listeners) return;
1617
+ let o = r._listeners.length;
1618
+ for (; o-- > 0; )
1619
+ r._listeners[o](s);
1620
+ r._listeners = null;
1621
+ }), this.promise.then = (s) => {
1622
+ let o;
1623
+ const i = new Promise((c) => {
1624
+ r.subscribe(c), o = c;
1625
+ }).then(s);
1626
+ return i.cancel = function() {
1627
+ r.unsubscribe(o);
1628
+ }, i;
1629
+ }, t(function(o, i, c) {
1630
+ r.reason || (r.reason = new v(o, i, c), n(r.reason));
1631
+ });
1632
+ }
1633
+ /**
1634
+ * Throws a `CanceledError` if cancellation has been requested.
1635
+ */
1636
+ throwIfRequested() {
1637
+ if (this.reason)
1638
+ throw this.reason;
1639
+ }
1640
+ /**
1641
+ * Subscribe to the cancel signal
1642
+ */
1643
+ subscribe(t) {
1644
+ if (this.reason) {
1645
+ t(this.reason);
1646
+ return;
1647
+ }
1648
+ this._listeners ? this._listeners.push(t) : this._listeners = [t];
1649
+ }
1650
+ /**
1651
+ * Unsubscribe from the cancel signal
1652
+ */
1653
+ unsubscribe(t) {
1654
+ if (!this._listeners)
1655
+ return;
1656
+ const n = this._listeners.indexOf(t);
1657
+ n !== -1 && this._listeners.splice(n, 1);
1658
+ }
1659
+ toAbortSignal() {
1660
+ const t = new AbortController(), n = (r) => {
1661
+ t.abort(r);
1662
+ };
1663
+ return this.subscribe(n), t.signal.unsubscribe = () => this.unsubscribe(n), t.signal;
1664
+ }
1665
+ /**
1666
+ * Returns an object that contains a new `CancelToken` and a function that, when called,
1667
+ * cancels the `CancelToken`.
1668
+ */
1669
+ static source() {
1670
+ let t;
1671
+ return {
1672
+ token: new ot(function(s) {
1673
+ t = s;
1674
+ }),
1675
+ cancel: t
1676
+ };
1677
+ }
1678
+ };
1679
+ function Qn(e) {
1680
+ return function(n) {
1681
+ return e.apply(null, n);
1682
+ };
1683
+ }
1684
+ function Xn(e) {
1685
+ return a.isObject(e) && e.isAxiosError === !0;
1686
+ }
1687
+ const me = {
1688
+ Continue: 100,
1689
+ SwitchingProtocols: 101,
1690
+ Processing: 102,
1691
+ EarlyHints: 103,
1692
+ Ok: 200,
1693
+ Created: 201,
1694
+ Accepted: 202,
1695
+ NonAuthoritativeInformation: 203,
1696
+ NoContent: 204,
1697
+ ResetContent: 205,
1698
+ PartialContent: 206,
1699
+ MultiStatus: 207,
1700
+ AlreadyReported: 208,
1701
+ ImUsed: 226,
1702
+ MultipleChoices: 300,
1703
+ MovedPermanently: 301,
1704
+ Found: 302,
1705
+ SeeOther: 303,
1706
+ NotModified: 304,
1707
+ UseProxy: 305,
1708
+ Unused: 306,
1709
+ TemporaryRedirect: 307,
1710
+ PermanentRedirect: 308,
1711
+ BadRequest: 400,
1712
+ Unauthorized: 401,
1713
+ PaymentRequired: 402,
1714
+ Forbidden: 403,
1715
+ NotFound: 404,
1716
+ MethodNotAllowed: 405,
1717
+ NotAcceptable: 406,
1718
+ ProxyAuthenticationRequired: 407,
1719
+ RequestTimeout: 408,
1720
+ Conflict: 409,
1721
+ Gone: 410,
1722
+ LengthRequired: 411,
1723
+ PreconditionFailed: 412,
1724
+ PayloadTooLarge: 413,
1725
+ UriTooLong: 414,
1726
+ UnsupportedMediaType: 415,
1727
+ RangeNotSatisfiable: 416,
1728
+ ExpectationFailed: 417,
1729
+ ImATeapot: 418,
1730
+ MisdirectedRequest: 421,
1731
+ UnprocessableEntity: 422,
1732
+ Locked: 423,
1733
+ FailedDependency: 424,
1734
+ TooEarly: 425,
1735
+ UpgradeRequired: 426,
1736
+ PreconditionRequired: 428,
1737
+ TooManyRequests: 429,
1738
+ RequestHeaderFieldsTooLarge: 431,
1739
+ UnavailableForLegalReasons: 451,
1740
+ InternalServerError: 500,
1741
+ NotImplemented: 501,
1742
+ BadGateway: 502,
1743
+ ServiceUnavailable: 503,
1744
+ GatewayTimeout: 504,
1745
+ HttpVersionNotSupported: 505,
1746
+ VariantAlsoNegotiates: 506,
1747
+ InsufficientStorage: 507,
1748
+ LoopDetected: 508,
1749
+ NotExtended: 510,
1750
+ NetworkAuthenticationRequired: 511
1751
+ };
1752
+ Object.entries(me).forEach(([e, t]) => {
1753
+ me[t] = e;
1754
+ });
1755
+ function it(e) {
1756
+ const t = new j(e), n = Be(j.prototype.request, t);
1757
+ return a.extend(n, j.prototype, t, { allOwnKeys: !0 }), a.extend(n, t, null, { allOwnKeys: !0 }), n.create = function(s) {
1758
+ return it(q(e, s));
1759
+ }, n;
1760
+ }
1761
+ const O = it(W);
1762
+ O.Axios = j;
1763
+ O.CanceledError = v;
1764
+ O.CancelToken = Kn;
1765
+ O.isCancel = Ge;
1766
+ O.VERSION = st;
1767
+ O.toFormData = se;
1768
+ O.AxiosError = y;
1769
+ O.Cancel = O.CanceledError;
1770
+ O.all = function(t) {
1771
+ return Promise.all(t);
1772
+ };
1773
+ O.spread = Qn;
1774
+ O.isAxiosError = Xn;
1775
+ O.mergeConfig = q;
1776
+ O.AxiosHeaders = N;
1777
+ O.formToJSON = (e) => Xe(a.isHTMLForm(e) ? new FormData(e) : e);
1778
+ O.getAdapter = rt.getAdapter;
1779
+ O.HttpStatusCode = me;
1780
+ O.default = O;
1781
+ const {
1782
+ Axios: sr,
1783
+ AxiosError: or,
1784
+ CanceledError: ir,
1785
+ isCancel: ar,
1786
+ CancelToken: cr,
1787
+ VERSION: ur,
1788
+ all: lr,
1789
+ Cancel: fr,
1790
+ isAxiosError: dr,
1791
+ spread: pr,
1792
+ toFormData: hr,
1793
+ AxiosHeaders: mr,
1794
+ HttpStatusCode: yr,
1795
+ formToJSON: br,
1796
+ getAdapter: wr,
1797
+ mergeConfig: Er
1798
+ } = O, gr = ({
1799
+ endpoint: e,
1800
+ headers: t = {},
1801
+ initialData: n,
1802
+ validationRules: r
1803
+ }) => {
1804
+ const s = De({ initialData: n, validationRules: r }), [o, i] = ft(!1), c = dt(null), f = Z(
1805
+ (l = {}) => {
1806
+ const {
1807
+ onBefore: d = () => {
1808
+ },
1809
+ onCancel: w = () => {
1810
+ },
1811
+ onError: g = () => {
1812
+ },
1813
+ onFinish: p = () => {
1814
+ },
1815
+ onSuccess: m = () => {
1816
+ },
1817
+ onUpload: h = () => {
1818
+ },
1819
+ skipValidation: R = !1
1820
+ } = l;
1821
+ if (!R && !s.validate())
1822
+ return;
1823
+ const E = new FormData();
1824
+ Object.entries(s.data).forEach(([b, T]) => {
1825
+ Array.isArray(T) ? T.forEach((S) => {
1826
+ S instanceof File ? E.append(b, S) : E.append(b, String(S));
1827
+ }) : T instanceof File ? E.append(b, T) : E.append(b, String(T));
1828
+ }), d == null || d(), i(!0), c.current = new AbortController(), O.post(e, E, {
1829
+ headers: {
1830
+ "Content-Type": "multipart/form-data",
1831
+ ...t
1832
+ },
1833
+ signal: c.current.signal,
1834
+ onUploadProgress: (b) => {
1835
+ h == null || h(b);
1836
+ }
1837
+ }).then((b) => {
1838
+ m == null || m(b);
1839
+ }).catch((b) => {
1840
+ O.isCancel(b) ? w == null || w(b) : g == null || g(b);
1841
+ }).finally(() => {
1842
+ p == null || p(), i(!1), c.current = null;
1843
+ });
1844
+ },
1845
+ [e, t, s]
1846
+ ), u = Z(() => {
1847
+ c.current && c.current.abort("Upload cancelled by user");
1848
+ }, []);
1849
+ return {
1850
+ ...s,
1851
+ upload: f,
1852
+ isUploading: o,
1853
+ cancel: u
1854
+ };
1855
+ }, Rr = ({
1856
+ headers: e = {},
1857
+ initialData: t,
1858
+ options: n = {},
1859
+ query: r,
1860
+ validationRules: s
1861
+ }) => {
1862
+ const { data: o, setData: i, validate: c, ...f } = De({
1863
+ initialData: t,
1864
+ validationRules: s
1865
+ }), [u, { data: l, error: d, loading: w, refetch: g }] = wt(r, {
1866
+ fetchPolicy: "network-only",
1867
+ errorPolicy: "all",
1868
+ notifyOnNetworkStatusChange: !0,
1869
+ ...n
1870
+ }), p = Z(
1871
+ (h = {}) => {
1872
+ const {
1873
+ onBefore: R = () => {
1874
+ },
1875
+ onError: E = () => {
1876
+ },
1877
+ onFinish: b = () => {
1878
+ },
1879
+ onSuccess: T = () => {
1880
+ },
1881
+ skipValidation: S = !1
1882
+ } = h;
1883
+ !S && !c() || (R == null || R(), u({
1884
+ variables: { filters: o },
1885
+ ...!lt(e) && { context: { headers: e } }
1886
+ }).then((A) => {
1887
+ T == null || T(A);
1888
+ }).catch((A) => {
1889
+ E == null || E(A);
1890
+ }).finally(() => {
1891
+ b == null || b();
1892
+ }));
1893
+ },
1894
+ [o, u, e, c]
1895
+ ), m = Z(() => {
1896
+ g && g({ filters: o });
1897
+ }, [g, o]);
1898
+ return {
1899
+ ...f,
1900
+ validate: c,
1901
+ filter: o,
1902
+ setFilter: i,
1903
+ isLoading: w,
1904
+ query: p,
1905
+ refetch: m,
1906
+ data: l,
1907
+ error: d
1908
+ };
1909
+ };
1910
+ export {
1911
+ Tr as handleRules,
1912
+ gr as useFileUpload,
1913
+ Rr as useFilter,
1914
+ Ar as useForm,
1915
+ De as useFormState,
1916
+ tr as validator
1917
+ };