@clickcns/vmedic-react 0.0.3 → 0.0.4
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/es/api/index.js
CHANGED
|
@@ -6,11 +6,11 @@ function We(e, t) {
|
|
|
6
6
|
const { toString: yt } = Object.prototype, { getPrototypeOf: be } = Object, { iterator: re, toStringTag: Ve } = Symbol, oe = /* @__PURE__ */ ((e) => (t) => {
|
|
7
7
|
const n = yt.call(t);
|
|
8
8
|
return e[n] || (e[n] = n.slice(8, -1).toLowerCase());
|
|
9
|
-
})(/* @__PURE__ */ Object.create(null)),
|
|
9
|
+
})(/* @__PURE__ */ Object.create(null)), N = (e) => (e = e.toLowerCase(), (t) => oe(t) === e), ae = (e) => (t) => typeof t === e, { isArray: M } = Array, H = ae("undefined");
|
|
10
10
|
function V(e) {
|
|
11
11
|
return e !== null && !H(e) && e.constructor !== null && !H(e.constructor) && T(e.constructor.isBuffer) && e.constructor.isBuffer(e);
|
|
12
12
|
}
|
|
13
|
-
const Ke =
|
|
13
|
+
const Ke = N("ArrayBuffer");
|
|
14
14
|
function wt(e) {
|
|
15
15
|
let t;
|
|
16
16
|
return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && Ke(e.buffer), t;
|
|
@@ -28,11 +28,11 @@ const bt = ae("string"), T = ae("function"), ve = ae("number"), K = (e) => e !==
|
|
|
28
28
|
} catch {
|
|
29
29
|
return !1;
|
|
30
30
|
}
|
|
31
|
-
}, Rt =
|
|
31
|
+
}, Rt = N("Date"), St = N("File"), Ot = N("Blob"), At = N("FileList"), Tt = (e) => K(e) && T(e.pipe), Ct = (e) => {
|
|
32
32
|
let t;
|
|
33
33
|
return e && (typeof FormData == "function" && e instanceof FormData || T(e.append) && ((t = oe(e)) === "formdata" || // detect form-data instance
|
|
34
34
|
t === "object" && T(e.toString) && e.toString() === "[object FormData]"));
|
|
35
|
-
}, xt =
|
|
35
|
+
}, xt = N("URLSearchParams"), [Pt, Ft, Nt, kt] = ["ReadableStream", "Request", "Response", "Headers"].map(N), Ut = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
|
|
36
36
|
function v(e, t, { allOwnKeys: n = !1 } = {}) {
|
|
37
37
|
if (e === null || typeof e > "u")
|
|
38
38
|
return;
|
|
@@ -112,12 +112,12 @@ const _t = (e, t, n, { allOwnKeys: s } = {}) => (v(t, (r, a) => {
|
|
|
112
112
|
for (; (n = e.exec(t)) !== null; )
|
|
113
113
|
s.push(n);
|
|
114
114
|
return s;
|
|
115
|
-
}, Mt =
|
|
115
|
+
}, Mt = N("HTMLFormElement"), zt = (e) => e.toLowerCase().replace(
|
|
116
116
|
/[-_\s]([a-z\d])(\w*)/g,
|
|
117
117
|
function(n, s, r) {
|
|
118
118
|
return s.toUpperCase() + r;
|
|
119
119
|
}
|
|
120
|
-
), Pe = (({ hasOwnProperty: e }) => (t, n) => e.call(t, n))(Object.prototype), Jt =
|
|
120
|
+
), Pe = (({ hasOwnProperty: e }) => (t, n) => e.call(t, n))(Object.prototype), Jt = N("RegExp"), Qe = (e, t) => {
|
|
121
121
|
const n = Object.getOwnPropertyDescriptors(e), s = {};
|
|
122
122
|
v(n, (r, a) => {
|
|
123
123
|
let o;
|
|
@@ -169,7 +169,7 @@ const Gt = (e) => {
|
|
|
169
169
|
return s;
|
|
170
170
|
};
|
|
171
171
|
return n(e, 0);
|
|
172
|
-
}, Qt =
|
|
172
|
+
}, Qt = N("AsyncFunction"), Zt = (e) => e && (K(e) || T(e)) && T(e.then) && T(e.catch), Ze = ((e, t) => e ? setImmediate : t ? ((n, s) => ($.addEventListener("message", ({ source: r, data: a }) => {
|
|
173
173
|
r === $ && a === n && s.length && s.shift()();
|
|
174
174
|
}, !1), (r) => {
|
|
175
175
|
s.push(r), $.postMessage(n, "*");
|
|
@@ -189,9 +189,9 @@ const Gt = (e) => {
|
|
|
189
189
|
isPlainObject: ee,
|
|
190
190
|
isEmptyObject: Et,
|
|
191
191
|
isReadableStream: Pt,
|
|
192
|
-
isRequest:
|
|
193
|
-
isResponse:
|
|
194
|
-
isHeaders:
|
|
192
|
+
isRequest: Ft,
|
|
193
|
+
isResponse: Nt,
|
|
194
|
+
isHeaders: kt,
|
|
195
195
|
isUndefined: H,
|
|
196
196
|
isDate: Rt,
|
|
197
197
|
isFile: St,
|
|
@@ -205,12 +205,12 @@ const Gt = (e) => {
|
|
|
205
205
|
forEach: v,
|
|
206
206
|
merge: he,
|
|
207
207
|
extend: _t,
|
|
208
|
-
trim:
|
|
208
|
+
trim: Ut,
|
|
209
209
|
stripBOM: Bt,
|
|
210
210
|
inherits: Dt,
|
|
211
211
|
toFlatObject: Lt,
|
|
212
212
|
kindOf: oe,
|
|
213
|
-
kindOfTest:
|
|
213
|
+
kindOfTest: N,
|
|
214
214
|
endsWith: $t,
|
|
215
215
|
toArray: jt,
|
|
216
216
|
forEachEntry: It,
|
|
@@ -295,7 +295,7 @@ function me(e) {
|
|
|
295
295
|
function tt(e) {
|
|
296
296
|
return i.endsWith(e, "[]") ? e.slice(0, -2) : e;
|
|
297
297
|
}
|
|
298
|
-
function
|
|
298
|
+
function Fe(e, t, n) {
|
|
299
299
|
return e ? e.concat(t).map(function(r, a) {
|
|
300
300
|
return r = tt(r), !n && a ? "[" + r + "]" : r;
|
|
301
301
|
}).join(n ? "." : "") : t;
|
|
@@ -313,8 +313,8 @@ function ie(e, t, n) {
|
|
|
313
313
|
metaTokens: !0,
|
|
314
314
|
dots: !1,
|
|
315
315
|
indexes: !1
|
|
316
|
-
}, !1, function(y,
|
|
317
|
-
return !i.isUndefined(
|
|
316
|
+
}, !1, function(y, m) {
|
|
317
|
+
return !i.isUndefined(m[y]);
|
|
318
318
|
});
|
|
319
319
|
const s = n.metaTokens, r = n.visitor || u, a = n.dots, o = n.indexes, p = (n.Blob || typeof Blob < "u" && Blob) && i.isSpecCompliantForm(t);
|
|
320
320
|
if (!i.isFunction(r))
|
|
@@ -329,32 +329,32 @@ function ie(e, t, n) {
|
|
|
329
329
|
throw new w("Blob is not supported. Use a Buffer instead.");
|
|
330
330
|
return i.isArrayBuffer(d) || i.isTypedArray(d) ? p && typeof Blob == "function" ? new Blob([d]) : Buffer.from(d) : d;
|
|
331
331
|
}
|
|
332
|
-
function u(d, y,
|
|
332
|
+
function u(d, y, m) {
|
|
333
333
|
let E = d;
|
|
334
|
-
if (d && !
|
|
334
|
+
if (d && !m && typeof d == "object") {
|
|
335
335
|
if (i.endsWith(y, "{}"))
|
|
336
336
|
y = s ? y : y.slice(0, -2), d = JSON.stringify(d);
|
|
337
337
|
else if (i.isArray(d) && nn(d) || (i.isFileList(d) || i.endsWith(y, "[]")) && (E = i.toArray(d)))
|
|
338
338
|
return y = tt(y), E.forEach(function(R, A) {
|
|
339
339
|
!(i.isUndefined(R) || R === null) && t.append(
|
|
340
340
|
// eslint-disable-next-line no-nested-ternary
|
|
341
|
-
o === !0 ?
|
|
341
|
+
o === !0 ? Fe([y], A, a) : o === null ? y : y + "[]",
|
|
342
342
|
l(R)
|
|
343
343
|
);
|
|
344
344
|
}), !1;
|
|
345
345
|
}
|
|
346
|
-
return me(d) ? !0 : (t.append(
|
|
346
|
+
return me(d) ? !0 : (t.append(Fe(m, y, a), l(d)), !1);
|
|
347
347
|
}
|
|
348
|
-
const
|
|
348
|
+
const h = [], b = Object.assign(sn, {
|
|
349
349
|
defaultVisitor: u,
|
|
350
350
|
convertValue: l,
|
|
351
351
|
isVisitable: me
|
|
352
352
|
});
|
|
353
353
|
function S(d, y) {
|
|
354
354
|
if (!i.isUndefined(d)) {
|
|
355
|
-
if (
|
|
355
|
+
if (h.indexOf(d) !== -1)
|
|
356
356
|
throw Error("Circular reference detected in " + y.join("."));
|
|
357
|
-
|
|
357
|
+
h.push(d), i.forEach(d, function(E, x) {
|
|
358
358
|
(!(i.isUndefined(E) || E === null) && r.call(
|
|
359
359
|
t,
|
|
360
360
|
E,
|
|
@@ -362,14 +362,14 @@ function ie(e, t, n) {
|
|
|
362
362
|
y,
|
|
363
363
|
b
|
|
364
364
|
)) === !0 && S(E, y ? y.concat(x) : [x]);
|
|
365
|
-
}),
|
|
365
|
+
}), h.pop();
|
|
366
366
|
}
|
|
367
367
|
}
|
|
368
368
|
if (!i.isObject(e))
|
|
369
369
|
throw new TypeError("data must be an object");
|
|
370
370
|
return S(e), t;
|
|
371
371
|
}
|
|
372
|
-
function
|
|
372
|
+
function Ne(e) {
|
|
373
373
|
const t = {
|
|
374
374
|
"!": "%21",
|
|
375
375
|
"'": "%27",
|
|
@@ -392,8 +392,8 @@ nt.append = function(t, n) {
|
|
|
392
392
|
};
|
|
393
393
|
nt.toString = function(t) {
|
|
394
394
|
const n = t ? function(s) {
|
|
395
|
-
return t.call(this, s,
|
|
396
|
-
} :
|
|
395
|
+
return t.call(this, s, Ne);
|
|
396
|
+
} : Ne;
|
|
397
397
|
return this._pairs.map(function(r) {
|
|
398
398
|
return n(r[0]) + "=" + n(r[1]);
|
|
399
399
|
}, "").join("&");
|
|
@@ -416,7 +416,7 @@ function st(e, t, n) {
|
|
|
416
416
|
}
|
|
417
417
|
return e;
|
|
418
418
|
}
|
|
419
|
-
class
|
|
419
|
+
class ke {
|
|
420
420
|
constructor() {
|
|
421
421
|
this.handlers = [];
|
|
422
422
|
}
|
|
@@ -633,7 +633,7 @@ const bn = i.toObjectSet([
|
|
|
633
633
|
`).forEach(function(o) {
|
|
634
634
|
r = o.indexOf(":"), n = o.substring(0, r).trim().toLowerCase(), s = o.substring(r + 1).trim(), !(!n || t[n] && bn[n]) && (n === "set-cookie" ? t[n] ? t[n].push(s) : t[n] = [s] : t[n] = t[n] ? t[n] + ", " + s : s);
|
|
635
635
|
}), t;
|
|
636
|
-
},
|
|
636
|
+
}, Ue = Symbol("internals");
|
|
637
637
|
function W(e) {
|
|
638
638
|
return e && String(e).trim().toLowerCase();
|
|
639
639
|
}
|
|
@@ -682,8 +682,8 @@ let C = class {
|
|
|
682
682
|
const u = W(p);
|
|
683
683
|
if (!u)
|
|
684
684
|
throw new Error("header name must be a non-empty string");
|
|
685
|
-
const
|
|
686
|
-
(!
|
|
685
|
+
const h = i.findKey(r, u);
|
|
686
|
+
(!h || r[h] === void 0 || l === !0 || l === void 0 && r[h] !== !1) && (r[h || p] = te(c));
|
|
687
687
|
}
|
|
688
688
|
const o = (c, p) => i.forEach(c, (l, u) => a(l, u, p));
|
|
689
689
|
if (i.isPlainObject(t) || t instanceof this.constructor)
|
|
@@ -788,7 +788,7 @@ let C = class {
|
|
|
788
788
|
return n.forEach((r) => s.set(r)), s;
|
|
789
789
|
}
|
|
790
790
|
static accessor(t) {
|
|
791
|
-
const s = (this[
|
|
791
|
+
const s = (this[Ue] = this[Ue] = {
|
|
792
792
|
accessors: {}
|
|
793
793
|
}).accessors, r = this.prototype;
|
|
794
794
|
function a(o) {
|
|
@@ -846,9 +846,9 @@ function Tn(e, t) {
|
|
|
846
846
|
return t = t !== void 0 ? t : 1e3, function(p) {
|
|
847
847
|
const l = Date.now(), u = s[a];
|
|
848
848
|
o || (o = l), n[r] = p, s[r] = l;
|
|
849
|
-
let
|
|
850
|
-
for (;
|
|
851
|
-
b += n[
|
|
849
|
+
let h = a, b = 0;
|
|
850
|
+
for (; h !== r; )
|
|
851
|
+
b += n[h++], h = h % e;
|
|
852
852
|
if (r = (r + 1) % e, r === a && (a = (a + 1) % e), l - o < t)
|
|
853
853
|
return;
|
|
854
854
|
const S = u && l - u;
|
|
@@ -861,10 +861,10 @@ function Cn(e, t) {
|
|
|
861
861
|
n = u, r = null, a && (clearTimeout(a), a = null), e(...l);
|
|
862
862
|
};
|
|
863
863
|
return [(...l) => {
|
|
864
|
-
const u = Date.now(),
|
|
865
|
-
|
|
864
|
+
const u = Date.now(), h = u - n;
|
|
865
|
+
h >= s ? o(l, u) : (r = l, a || (a = setTimeout(() => {
|
|
866
866
|
a = null, o(r);
|
|
867
|
-
}, s -
|
|
867
|
+
}, s - h)));
|
|
868
868
|
}, () => r && o(r)];
|
|
869
869
|
}
|
|
870
870
|
const se = (e, t, n = 3) => {
|
|
@@ -873,7 +873,7 @@ const se = (e, t, n = 3) => {
|
|
|
873
873
|
return Cn((a) => {
|
|
874
874
|
const o = a.loaded, c = a.lengthComputable ? a.total : void 0, p = o - s, l = r(p), u = o <= c;
|
|
875
875
|
s = o;
|
|
876
|
-
const
|
|
876
|
+
const h = {
|
|
877
877
|
loaded: o,
|
|
878
878
|
total: c,
|
|
879
879
|
progress: c ? o / c : void 0,
|
|
@@ -884,7 +884,7 @@ const se = (e, t, n = 3) => {
|
|
|
884
884
|
lengthComputable: c != null,
|
|
885
885
|
[t ? "download" : "upload"]: !0
|
|
886
886
|
};
|
|
887
|
-
e(
|
|
887
|
+
e(h);
|
|
888
888
|
}, n);
|
|
889
889
|
}, _e = (e, t) => {
|
|
890
890
|
const n = e != null;
|
|
@@ -925,28 +925,28 @@ const se = (e, t, n = 3) => {
|
|
|
925
925
|
}
|
|
926
926
|
}
|
|
927
927
|
);
|
|
928
|
-
function
|
|
928
|
+
function Fn(e) {
|
|
929
929
|
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(e);
|
|
930
930
|
}
|
|
931
|
-
function
|
|
931
|
+
function Nn(e, t) {
|
|
932
932
|
return t ? e.replace(/\/?\/$/, "") + "/" + t.replace(/^\/+/, "") : e;
|
|
933
933
|
}
|
|
934
934
|
function ct(e, t, n) {
|
|
935
|
-
let s = !
|
|
936
|
-
return e && (s || n == !1) ?
|
|
935
|
+
let s = !Fn(t);
|
|
936
|
+
return e && (s || n == !1) ? Nn(e, t) : t;
|
|
937
937
|
}
|
|
938
938
|
const De = (e) => e instanceof C ? { ...e } : e;
|
|
939
939
|
function q(e, t) {
|
|
940
940
|
t = t || {};
|
|
941
941
|
const n = {};
|
|
942
|
-
function s(l, u,
|
|
942
|
+
function s(l, u, h, b) {
|
|
943
943
|
return i.isPlainObject(l) && i.isPlainObject(u) ? i.merge.call({ caseless: b }, l, u) : i.isPlainObject(u) ? i.merge({}, u) : i.isArray(u) ? u.slice() : u;
|
|
944
944
|
}
|
|
945
|
-
function r(l, u,
|
|
945
|
+
function r(l, u, h, b) {
|
|
946
946
|
if (i.isUndefined(u)) {
|
|
947
947
|
if (!i.isUndefined(l))
|
|
948
|
-
return s(void 0, l,
|
|
949
|
-
} else return s(l, u,
|
|
948
|
+
return s(void 0, l, h, b);
|
|
949
|
+
} else return s(l, u, h, b);
|
|
950
950
|
}
|
|
951
951
|
function a(l, u) {
|
|
952
952
|
if (!i.isUndefined(u))
|
|
@@ -958,10 +958,10 @@ function q(e, t) {
|
|
|
958
958
|
return s(void 0, l);
|
|
959
959
|
} else return s(void 0, u);
|
|
960
960
|
}
|
|
961
|
-
function c(l, u,
|
|
962
|
-
if (
|
|
961
|
+
function c(l, u, h) {
|
|
962
|
+
if (h in t)
|
|
963
963
|
return s(l, u);
|
|
964
|
-
if (
|
|
964
|
+
if (h in e)
|
|
965
965
|
return s(void 0, l);
|
|
966
966
|
}
|
|
967
967
|
const p = {
|
|
@@ -993,11 +993,11 @@ function q(e, t) {
|
|
|
993
993
|
socketPath: o,
|
|
994
994
|
responseEncoding: o,
|
|
995
995
|
validateStatus: c,
|
|
996
|
-
headers: (l, u,
|
|
996
|
+
headers: (l, u, h) => r(De(l), De(u), h, !0)
|
|
997
997
|
};
|
|
998
998
|
return i.forEach(Object.keys({ ...e, ...t }), function(u) {
|
|
999
|
-
const
|
|
1000
|
-
i.isUndefined(b) &&
|
|
999
|
+
const h = p[u] || r, b = h(e[u], t[u], u);
|
|
1000
|
+
i.isUndefined(b) && h !== c || (n[u] = b);
|
|
1001
1001
|
}), n;
|
|
1002
1002
|
}
|
|
1003
1003
|
const ut = (e) => {
|
|
@@ -1011,8 +1011,8 @@ const ut = (e) => {
|
|
|
1011
1011
|
o.setContentType(void 0);
|
|
1012
1012
|
else if (i.isFunction(n.getHeaders)) {
|
|
1013
1013
|
const p = n.getHeaders(), l = ["content-type", "content-length"];
|
|
1014
|
-
Object.entries(p).forEach(([u,
|
|
1015
|
-
l.includes(u.toLowerCase()) && o.set(u,
|
|
1014
|
+
Object.entries(p).forEach(([u, h]) => {
|
|
1015
|
+
l.includes(u.toLowerCase()) && o.set(u, h);
|
|
1016
1016
|
});
|
|
1017
1017
|
}
|
|
1018
1018
|
}
|
|
@@ -1021,63 +1021,63 @@ const ut = (e) => {
|
|
|
1021
1021
|
p && o.set(r, p);
|
|
1022
1022
|
}
|
|
1023
1023
|
return t;
|
|
1024
|
-
},
|
|
1024
|
+
}, kn = typeof XMLHttpRequest < "u", Un = kn && function(e) {
|
|
1025
1025
|
return new Promise(function(n, s) {
|
|
1026
1026
|
const r = ut(e);
|
|
1027
1027
|
let a = r.data;
|
|
1028
1028
|
const o = C.from(r.headers).normalize();
|
|
1029
|
-
let { responseType: c, onUploadProgress: p, onDownloadProgress: l } = r, u,
|
|
1029
|
+
let { responseType: c, onUploadProgress: p, onDownloadProgress: l } = r, u, h, b, S, d;
|
|
1030
1030
|
function y() {
|
|
1031
1031
|
S && S(), d && d(), r.cancelToken && r.cancelToken.unsubscribe(u), r.signal && r.signal.removeEventListener("abort", u);
|
|
1032
1032
|
}
|
|
1033
|
-
let
|
|
1034
|
-
|
|
1033
|
+
let m = new XMLHttpRequest();
|
|
1034
|
+
m.open(r.method.toUpperCase(), r.url, !0), m.timeout = r.timeout;
|
|
1035
1035
|
function E() {
|
|
1036
|
-
if (!
|
|
1036
|
+
if (!m)
|
|
1037
1037
|
return;
|
|
1038
1038
|
const R = C.from(
|
|
1039
|
-
"getAllResponseHeaders" in
|
|
1040
|
-
),
|
|
1041
|
-
data: !c || c === "text" || c === "json" ?
|
|
1042
|
-
status:
|
|
1043
|
-
statusText:
|
|
1039
|
+
"getAllResponseHeaders" in m && m.getAllResponseHeaders()
|
|
1040
|
+
), F = {
|
|
1041
|
+
data: !c || c === "text" || c === "json" ? m.responseText : m.response,
|
|
1042
|
+
status: m.status,
|
|
1043
|
+
statusText: m.statusText,
|
|
1044
1044
|
headers: R,
|
|
1045
1045
|
config: e,
|
|
1046
|
-
request:
|
|
1046
|
+
request: m
|
|
1047
1047
|
};
|
|
1048
1048
|
it(function(P) {
|
|
1049
1049
|
n(P), y();
|
|
1050
1050
|
}, function(P) {
|
|
1051
1051
|
s(P), y();
|
|
1052
|
-
},
|
|
1052
|
+
}, F), m = null;
|
|
1053
1053
|
}
|
|
1054
|
-
"onloadend" in
|
|
1055
|
-
!
|
|
1056
|
-
},
|
|
1057
|
-
|
|
1058
|
-
},
|
|
1059
|
-
const
|
|
1060
|
-
D.event = A || null, s(D),
|
|
1061
|
-
},
|
|
1054
|
+
"onloadend" in m ? m.onloadend = E : m.onreadystatechange = function() {
|
|
1055
|
+
!m || m.readyState !== 4 || m.status === 0 && !(m.responseURL && m.responseURL.indexOf("file:") === 0) || setTimeout(E);
|
|
1056
|
+
}, m.onabort = function() {
|
|
1057
|
+
m && (s(new w("Request aborted", w.ECONNABORTED, e, m)), m = null);
|
|
1058
|
+
}, m.onerror = function(A) {
|
|
1059
|
+
const F = A && A.message ? A.message : "Network Error", D = new w(F, w.ERR_NETWORK, e, m);
|
|
1060
|
+
D.event = A || null, s(D), m = null;
|
|
1061
|
+
}, m.ontimeout = function() {
|
|
1062
1062
|
let A = r.timeout ? "timeout of " + r.timeout + "ms exceeded" : "timeout exceeded";
|
|
1063
|
-
const
|
|
1063
|
+
const F = r.transitional || rt;
|
|
1064
1064
|
r.timeoutErrorMessage && (A = r.timeoutErrorMessage), s(new w(
|
|
1065
1065
|
A,
|
|
1066
|
-
|
|
1066
|
+
F.clarifyTimeoutError ? w.ETIMEDOUT : w.ECONNABORTED,
|
|
1067
1067
|
e,
|
|
1068
|
-
|
|
1069
|
-
)),
|
|
1070
|
-
}, a === void 0 && o.setContentType(null), "setRequestHeader" in
|
|
1071
|
-
|
|
1072
|
-
}), i.isUndefined(r.withCredentials) || (
|
|
1073
|
-
|
|
1068
|
+
m
|
|
1069
|
+
)), m = null;
|
|
1070
|
+
}, a === void 0 && o.setContentType(null), "setRequestHeader" in m && i.forEach(o.toJSON(), function(A, F) {
|
|
1071
|
+
m.setRequestHeader(F, A);
|
|
1072
|
+
}), i.isUndefined(r.withCredentials) || (m.withCredentials = !!r.withCredentials), c && c !== "json" && (m.responseType = r.responseType), l && ([b, d] = se(l, !0), m.addEventListener("progress", b)), p && m.upload && ([h, S] = se(p), m.upload.addEventListener("progress", h), m.upload.addEventListener("loadend", S)), (r.cancelToken || r.signal) && (u = (R) => {
|
|
1073
|
+
m && (s(!R || R.type ? new z(null, e, m) : R), m.abort(), m = null);
|
|
1074
1074
|
}, r.cancelToken && r.cancelToken.subscribe(u), r.signal && (r.signal.aborted ? u() : r.signal.addEventListener("abort", u)));
|
|
1075
1075
|
const x = An(r.url);
|
|
1076
1076
|
if (x && O.protocols.indexOf(x) === -1) {
|
|
1077
1077
|
s(new w("Unsupported protocol " + x + ":", w.ERR_BAD_REQUEST, e));
|
|
1078
1078
|
return;
|
|
1079
1079
|
}
|
|
1080
|
-
|
|
1080
|
+
m.send(a || null);
|
|
1081
1081
|
});
|
|
1082
1082
|
}, _n = (e, t) => {
|
|
1083
1083
|
const { length: n } = e = e ? e.filter(Boolean) : [];
|
|
@@ -1143,9 +1143,9 @@ const ut = (e) => {
|
|
|
1143
1143
|
c(), p.close();
|
|
1144
1144
|
return;
|
|
1145
1145
|
}
|
|
1146
|
-
let
|
|
1146
|
+
let h = u.byteLength;
|
|
1147
1147
|
if (n) {
|
|
1148
|
-
let b = a +=
|
|
1148
|
+
let b = a += h;
|
|
1149
1149
|
n(b);
|
|
1150
1150
|
}
|
|
1151
1151
|
p.enqueue(new Uint8Array(u));
|
|
@@ -1188,15 +1188,15 @@ const ut = (e) => {
|
|
|
1188
1188
|
}
|
|
1189
1189
|
}).headers.has("Content-Type");
|
|
1190
1190
|
return d && !y;
|
|
1191
|
-
}), u = o && c && Ie(() => i.isReadableStream(new s("").body)),
|
|
1191
|
+
}), u = o && c && Ie(() => i.isReadableStream(new s("").body)), h = {
|
|
1192
1192
|
stream: u && ((d) => d.body)
|
|
1193
1193
|
};
|
|
1194
1194
|
r && ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((d) => {
|
|
1195
|
-
!
|
|
1195
|
+
!h[d] && (h[d] = (y, m) => {
|
|
1196
1196
|
let E = y && y[d];
|
|
1197
1197
|
if (E)
|
|
1198
1198
|
return E.call(y);
|
|
1199
|
-
throw new w(`Response type '${d}' is not supported`, w.ERR_NOT_SUPPORT,
|
|
1199
|
+
throw new w(`Response type '${d}' is not supported`, w.ERR_NOT_SUPPORT, m);
|
|
1200
1200
|
});
|
|
1201
1201
|
});
|
|
1202
1202
|
const b = async (d) => {
|
|
@@ -1214,18 +1214,18 @@ const ut = (e) => {
|
|
|
1214
1214
|
if (i.isURLSearchParams(d) && (d = d + ""), i.isString(d))
|
|
1215
1215
|
return (await p(d)).byteLength;
|
|
1216
1216
|
}, S = async (d, y) => {
|
|
1217
|
-
const
|
|
1218
|
-
return
|
|
1217
|
+
const m = i.toFiniteNumber(d.getContentLength());
|
|
1218
|
+
return m ?? b(y);
|
|
1219
1219
|
};
|
|
1220
1220
|
return async (d) => {
|
|
1221
1221
|
let {
|
|
1222
1222
|
url: y,
|
|
1223
|
-
method:
|
|
1223
|
+
method: m,
|
|
1224
1224
|
data: E,
|
|
1225
1225
|
signal: x,
|
|
1226
1226
|
cancelToken: R,
|
|
1227
1227
|
timeout: A,
|
|
1228
|
-
onDownloadProgress:
|
|
1228
|
+
onDownloadProgress: F,
|
|
1229
1229
|
onUploadProgress: D,
|
|
1230
1230
|
responseType: P,
|
|
1231
1231
|
headers: ue,
|
|
@@ -1239,7 +1239,7 @@ const ut = (e) => {
|
|
|
1239
1239
|
});
|
|
1240
1240
|
let Ae;
|
|
1241
1241
|
try {
|
|
1242
|
-
if (D && l &&
|
|
1242
|
+
if (D && l && m !== "get" && m !== "head" && (Ae = await S(ue, E)) !== 0) {
|
|
1243
1243
|
let B = new n(y, {
|
|
1244
1244
|
method: "POST",
|
|
1245
1245
|
body: E,
|
|
@@ -1254,26 +1254,26 @@ const ut = (e) => {
|
|
|
1254
1254
|
}
|
|
1255
1255
|
}
|
|
1256
1256
|
i.isString(G) || (G = G ? "include" : "omit");
|
|
1257
|
-
const
|
|
1257
|
+
const k = a && "credentials" in n.prototype, Te = {
|
|
1258
1258
|
...Se,
|
|
1259
1259
|
signal: Q,
|
|
1260
|
-
method:
|
|
1260
|
+
method: m.toUpperCase(),
|
|
1261
1261
|
headers: ue.normalize().toJSON(),
|
|
1262
1262
|
body: E,
|
|
1263
1263
|
duplex: "half",
|
|
1264
|
-
credentials:
|
|
1264
|
+
credentials: k ? G : void 0
|
|
1265
1265
|
};
|
|
1266
1266
|
J = a && new n(y, Te);
|
|
1267
1267
|
let _ = await (a ? Oe(J, Se) : Oe(y, Te));
|
|
1268
1268
|
const Ce = u && (P === "stream" || P === "response");
|
|
1269
|
-
if (u && (
|
|
1269
|
+
if (u && (F || Ce && L)) {
|
|
1270
1270
|
const B = {};
|
|
1271
1271
|
["status", "statusText", "headers"].forEach((xe) => {
|
|
1272
1272
|
B[xe] = _[xe];
|
|
1273
1273
|
});
|
|
1274
|
-
const I = i.toFiniteNumber(_.headers.get("content-length")), [le, Z] =
|
|
1274
|
+
const I = i.toFiniteNumber(_.headers.get("content-length")), [le, Z] = F && _e(
|
|
1275
1275
|
I,
|
|
1276
|
-
se(Be(
|
|
1276
|
+
se(Be(F), !0)
|
|
1277
1277
|
) || [];
|
|
1278
1278
|
_ = new s(
|
|
1279
1279
|
Le(_.body, $e, le, () => {
|
|
@@ -1283,7 +1283,7 @@ const ut = (e) => {
|
|
|
1283
1283
|
);
|
|
1284
1284
|
}
|
|
1285
1285
|
P = P || "text";
|
|
1286
|
-
let mt = await
|
|
1286
|
+
let mt = await h[i.findKey(h, P) || "text"](_, d);
|
|
1287
1287
|
return !Ce && L && L(), await new Promise((B, I) => {
|
|
1288
1288
|
it(B, I, {
|
|
1289
1289
|
data: mt,
|
|
@@ -1294,13 +1294,13 @@ const ut = (e) => {
|
|
|
1294
1294
|
request: J
|
|
1295
1295
|
});
|
|
1296
1296
|
});
|
|
1297
|
-
} catch (
|
|
1298
|
-
throw L && L(),
|
|
1297
|
+
} catch (k) {
|
|
1298
|
+
throw L && L(), k && k.name === "TypeError" && /Load failed|fetch/i.test(k.message) ? Object.assign(
|
|
1299
1299
|
new w("Network Error", w.ERR_NETWORK, d, J),
|
|
1300
1300
|
{
|
|
1301
|
-
cause:
|
|
1301
|
+
cause: k.cause || k
|
|
1302
1302
|
}
|
|
1303
|
-
) : w.from(
|
|
1303
|
+
) : w.from(k, k && k.code, d, J);
|
|
1304
1304
|
}
|
|
1305
1305
|
};
|
|
1306
1306
|
}, qn = /* @__PURE__ */ new Map(), lt = (e) => {
|
|
@@ -1318,7 +1318,7 @@ const ut = (e) => {
|
|
|
1318
1318
|
lt();
|
|
1319
1319
|
const Re = {
|
|
1320
1320
|
http: tn,
|
|
1321
|
-
xhr:
|
|
1321
|
+
xhr: Un,
|
|
1322
1322
|
fetch: {
|
|
1323
1323
|
get: lt
|
|
1324
1324
|
}
|
|
@@ -1443,12 +1443,12 @@ function Mn(e, t, n) {
|
|
|
1443
1443
|
const ne = {
|
|
1444
1444
|
assertOptions: Mn,
|
|
1445
1445
|
validators: ce
|
|
1446
|
-
},
|
|
1446
|
+
}, U = ne.validators;
|
|
1447
1447
|
let j = class {
|
|
1448
1448
|
constructor(t) {
|
|
1449
1449
|
this.defaults = t || {}, this.interceptors = {
|
|
1450
|
-
request: new
|
|
1451
|
-
response: new
|
|
1450
|
+
request: new ke(),
|
|
1451
|
+
response: new ke()
|
|
1452
1452
|
};
|
|
1453
1453
|
}
|
|
1454
1454
|
/**
|
|
@@ -1480,17 +1480,17 @@ let j = class {
|
|
|
1480
1480
|
typeof t == "string" ? (n = n || {}, n.url = t) : n = t || {}, n = q(this.defaults, n);
|
|
1481
1481
|
const { transitional: s, paramsSerializer: r, headers: a } = n;
|
|
1482
1482
|
s !== void 0 && ne.assertOptions(s, {
|
|
1483
|
-
silentJSONParsing:
|
|
1484
|
-
forcedJSONParsing:
|
|
1485
|
-
clarifyTimeoutError:
|
|
1483
|
+
silentJSONParsing: U.transitional(U.boolean),
|
|
1484
|
+
forcedJSONParsing: U.transitional(U.boolean),
|
|
1485
|
+
clarifyTimeoutError: U.transitional(U.boolean)
|
|
1486
1486
|
}, !1), r != null && (i.isFunction(r) ? n.paramsSerializer = {
|
|
1487
1487
|
serialize: r
|
|
1488
1488
|
} : ne.assertOptions(r, {
|
|
1489
|
-
encode:
|
|
1490
|
-
serialize:
|
|
1489
|
+
encode: U.function,
|
|
1490
|
+
serialize: U.function
|
|
1491
1491
|
}, !0)), n.allowAbsoluteUrls !== void 0 || (this.defaults.allowAbsoluteUrls !== void 0 ? n.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls : n.allowAbsoluteUrls = !0), ne.assertOptions(n, {
|
|
1492
|
-
baseUrl:
|
|
1493
|
-
withXsrfToken:
|
|
1492
|
+
baseUrl: U.spelling("baseURL"),
|
|
1493
|
+
withXsrfToken: U.spelling("withXSRFToken")
|
|
1494
1494
|
}, !0), n.method = (n.method || this.defaults.method || "get").toLowerCase();
|
|
1495
1495
|
let o = a && i.merge(
|
|
1496
1496
|
a.common,
|
|
@@ -1511,21 +1511,21 @@ let j = class {
|
|
|
1511
1511
|
this.interceptors.response.forEach(function(y) {
|
|
1512
1512
|
l.push(y.fulfilled, y.rejected);
|
|
1513
1513
|
});
|
|
1514
|
-
let u,
|
|
1514
|
+
let u, h = 0, b;
|
|
1515
1515
|
if (!p) {
|
|
1516
1516
|
const d = [Me.bind(this), void 0];
|
|
1517
|
-
for (d.unshift(...c), d.push(...l), b = d.length, u = Promise.resolve(n);
|
|
1518
|
-
u = u.then(d[
|
|
1517
|
+
for (d.unshift(...c), d.push(...l), b = d.length, u = Promise.resolve(n); h < b; )
|
|
1518
|
+
u = u.then(d[h++], d[h++]);
|
|
1519
1519
|
return u;
|
|
1520
1520
|
}
|
|
1521
1521
|
b = c.length;
|
|
1522
1522
|
let S = n;
|
|
1523
|
-
for (;
|
|
1524
|
-
const d = c[
|
|
1523
|
+
for (; h < b; ) {
|
|
1524
|
+
const d = c[h++], y = c[h++];
|
|
1525
1525
|
try {
|
|
1526
1526
|
S = d(S);
|
|
1527
|
-
} catch (
|
|
1528
|
-
y.call(this,
|
|
1527
|
+
} catch (m) {
|
|
1528
|
+
y.call(this, m);
|
|
1529
1529
|
break;
|
|
1530
1530
|
}
|
|
1531
1531
|
}
|
|
@@ -1534,8 +1534,8 @@ let j = class {
|
|
|
1534
1534
|
} catch (d) {
|
|
1535
1535
|
return Promise.reject(d);
|
|
1536
1536
|
}
|
|
1537
|
-
for (
|
|
1538
|
-
u = u.then(l[
|
|
1537
|
+
for (h = 0, b = l.length; h < b; )
|
|
1538
|
+
u = u.then(l[h++], l[h++]);
|
|
1539
1539
|
return u;
|
|
1540
1540
|
}
|
|
1541
1541
|
getUri(t) {
|
|
@@ -1776,7 +1776,8 @@ const ys = ({
|
|
|
1776
1776
|
getAccessToken: r,
|
|
1777
1777
|
getRefreshAccessToken: a,
|
|
1778
1778
|
onUnauthorized: o,
|
|
1779
|
-
|
|
1779
|
+
onRefreshTokenSuccess: c,
|
|
1780
|
+
...p
|
|
1780
1781
|
}) => (f = g.create({
|
|
1781
1782
|
baseURL: e,
|
|
1782
1783
|
timeout: t,
|
|
@@ -1784,24 +1785,26 @@ const ys = ({
|
|
|
1784
1785
|
headers: s || {
|
|
1785
1786
|
"Content-Type": "application/json"
|
|
1786
1787
|
},
|
|
1787
|
-
...
|
|
1788
|
-
}), f.interceptors.request.use((
|
|
1789
|
-
const
|
|
1790
|
-
return
|
|
1791
|
-
}, (
|
|
1792
|
-
const
|
|
1793
|
-
if (
|
|
1794
|
-
return Promise.reject(
|
|
1795
|
-
if (
|
|
1796
|
-
|
|
1788
|
+
...p
|
|
1789
|
+
}), f.interceptors.request.use((l) => {
|
|
1790
|
+
const u = r();
|
|
1791
|
+
return u && (l.headers.Authorization = `Bearer ${u}`), l;
|
|
1792
|
+
}, (l) => Promise.reject(l)), f.interceptors.response.use((l) => l, async (l) => {
|
|
1793
|
+
const u = l.config;
|
|
1794
|
+
if (u.url?.includes("/auth/login"))
|
|
1795
|
+
return Promise.reject(l);
|
|
1796
|
+
if (l.response?.status === 401 && !u._retry) {
|
|
1797
|
+
u._retry = !0;
|
|
1797
1798
|
try {
|
|
1798
|
-
const
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
return
|
|
1799
|
+
const h = await a();
|
|
1800
|
+
if (!h)
|
|
1801
|
+
throw new Error("Failed to refresh access token");
|
|
1802
|
+
return u.headers.Authorization = `Bearer ${h}`, c(h), f(u);
|
|
1803
|
+
} catch (h) {
|
|
1804
|
+
return o(), Promise.reject(h);
|
|
1802
1805
|
}
|
|
1803
1806
|
}
|
|
1804
|
-
return Promise.reject(
|
|
1807
|
+
return Promise.reject(l);
|
|
1805
1808
|
}), f), Vn = {
|
|
1806
1809
|
getChatRooms: async (e) => (await f.get(`/speech/chat/rooms/${e}`)).data,
|
|
1807
1810
|
deleteChatRoom: async ({
|