@das-fed/utils 1.0.2 → 1.0.3

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