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