nervoscan-js-sdk 1.0.0

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