create-done-coding 0.11.26 → 0.11.27-alpha.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,4005 @@
1
+ #!/usr/bin/env node
2
+ import { readCliModuleAssetsConfig as ho, outputConsole as R, chalk as et, lookForParentTarget as Un, decryptAES as mo, xPrompts as pe, execSyncHijack as k, generateGetAnswerSwiftFn as go, getSafePath as yo, rmGitCtrlAsync as qt, isHttpGitUrl as _o, http2sshGitUrl as Eo, createSubcommand as jn, getRootScriptName as bo, createMainCommand as Ro } from "@done-coding/cli-utils";
3
+ import So, { existsSync as Kt, rmSync as tt } from "node:fs";
4
+ import Wt, { resolve as Oo } from "node:path";
5
+ import { getConfigPath as wo, batchCompileHandler as vo, MODULE_DEFAULT_CONFIG_RELATIVE_PATH as To } from "@done-coding/cli-template";
6
+ import { getTargetRepoUrl as Ao } from "@done-coding/cli-git";
7
+ const te = {
8
+ name: "create-done-coding",
9
+ version: "0.11.27-alpha.0",
10
+ description: "项目创建命令行工具",
11
+ bin: {
12
+ "create-done-coding": "es/cli.mjs"
13
+ },
14
+ cliConfig: {
15
+ namespaceDir: ".done-coding",
16
+ moduleName: "create"
17
+ }
18
+ }, Ln = "自定义模版路径", In = "某个git平台用户仓库";
19
+ var S = /* @__PURE__ */ ((e) => (e.PROJECT_NAME = "projectName", e.TEMPLATE = "template", e.IS_SAVE_GIT_HISTORY = "saveGitHistory", e.IS_TRANS_HTTP_URL_TO_SSH_URL = "isTransToSshUrl", e.IS_REMOVE_SAME_NAME_DIR = "isRemove", e.IS_CHANGE_BRANCH_NAME = "isChangeBranchName", e.LOCAL_BRANCH_NAME = "localBranchName", e.IS_SHALLOW_CLONE = "shallowClone", e.CUSTOM_GIT_URL_INPUT = "customUrl", e.GIT_COMMIT_MESSAGE = "gitCommitMessage", e.TEMPLATE_GIT_PATH = "templateGitPath", e.TEMPLATE_GIT_BRANCH = "templateGitBranch", e))(S || {}), xn = /* @__PURE__ */ ((e) => (e.CREATE = "create", e))(xn || {}), ve = /* @__PURE__ */ ((e) => (e.ORIGIN = "origin", e.UPSTREAM = "upstream", e))(ve || {});
20
+ let nt;
21
+ const Co = async () => (nt || (nt = (await ho({
22
+ moduleName: te.cliConfig.moduleName,
23
+ onSuccess({ config: t, moduleEntryFileRelativePath: n, repoUrl: r }) {
24
+ if (!Array.isArray(t.templateList)) {
25
+ const o = `配置文件出错, templateList 不是数组, 请检查 ${r} ${n}`;
26
+ throw new Error(o);
27
+ }
28
+ R.success("模板列表拉取成功!");
29
+ }
30
+ })).templateList), nt), Bn = async () => [
31
+ ...await Co(),
32
+ { name: Ln },
33
+ { name: In }
34
+ ], No = {
35
+ type: "text",
36
+ name: S.PROJECT_NAME,
37
+ message: "请输入项目名称",
38
+ format: (e) => e.trim(),
39
+ validate: (e) => e.length > 0 || "项目名称不能为空"
40
+ }, Po = ({
41
+ name: e,
42
+ branch: t
43
+ }) => typeof t === "string" ? `${e}(${et.white(t)})` : `${e}(${Array.isArray(t) && t.length ? et.greenBright(`${t.length}个细分分支`) : et.white("默认分支")})`, Uo = async () => {
44
+ const e = await Bn();
45
+ return {
46
+ type: "select",
47
+ name: S.TEMPLATE,
48
+ message: "请选择模板",
49
+ choices: e.map((t) => {
50
+ var n;
51
+ return {
52
+ title: Po(t),
53
+ value: t.name,
54
+ description: `${t.description || ""}${(n = t.instances) != null && n.length ? `, 已应用于: ${[""].concat(t.instances).join(`
55
+ - `)}` : ""}` || void 0
56
+ };
57
+ }),
58
+ validate: (t) => t.trim().length > 0 || "模板不能为空"
59
+ };
60
+ }, jo = {
61
+ type: "confirm",
62
+ name: S.IS_SAVE_GIT_HISTORY,
63
+ message: "是否保存模板仓库git历史记录",
64
+ initial: !1
65
+ }, Lo = ({
66
+ httpUrl: e,
67
+ sshUrl: t
68
+ }) => ({
69
+ type: "confirm",
70
+ name: S.IS_TRANS_HTTP_URL_TO_SSH_URL,
71
+ message: `是否将模板仓库地址由http形式(${e})转换为ssh形式(${t})`,
72
+ initial: !1
73
+ }), Io = (e = "项目已存在,是否删除") => ({
74
+ type: "confirm",
75
+ name: S.IS_REMOVE_SAME_NAME_DIR,
76
+ message: e
77
+ }), xo = {
78
+ type: "text",
79
+ name: S.CUSTOM_GIT_URL_INPUT,
80
+ message: "请输入自定义模板路径",
81
+ validate: (e) => e.trim().length > 0 || "路径不能为空"
82
+ }, Bo = (e) => ({
83
+ type: "text",
84
+ name: S.GIT_COMMIT_MESSAGE,
85
+ message: "请输入git提交信息",
86
+ initial: `feat: 初始化项目${e}`,
87
+ validate: (t) => t.trim().length > 0 || "提交信息不能为空"
88
+ }), $o = (e) => ({
89
+ type: "confirm",
90
+ name: S.IS_CHANGE_BRANCH_NAME,
91
+ message: `是否要重命名指定克隆分支名(${e})在本地的分支名`,
92
+ initial: !0
93
+ }), Fo = {
94
+ type: "text",
95
+ name: S.LOCAL_BRANCH_NAME,
96
+ message: "请输入克隆到本地后的分支名",
97
+ initial: "master",
98
+ validate: (e) => (e == null ? void 0 : e.trim().length) > 0 || "分支名不能为空"
99
+ // ✅ 添加验证
100
+ }, Do = (e) => ({
101
+ type: "select",
102
+ name: S.TEMPLATE_GIT_BRANCH,
103
+ message: "请选择模板分支",
104
+ choices: e.map((t) => ({
105
+ title: t.name,
106
+ value: t.name,
107
+ description: t.description
108
+ }))
109
+ });
110
+ var $n = /* @__PURE__ */ ((e) => (e.INIT = "init", e.CLONE = "clone", e.HOOKS = "hooks", e.CHECK = "check", e))($n || {}), B = /* @__PURE__ */ ((e) => (e.GITHUB = "github", e.GITEE = "gitee", e))(B || {});
111
+ const zt = [
112
+ { title: "GitHub", value: B.GITHUB },
113
+ { title: "Gitee", value: B.GITEE }
114
+ ], Fn = (e) => {
115
+ let t = 0;
116
+ if (e) {
117
+ const n = zt.findIndex(
118
+ (r) => r.value === e
119
+ );
120
+ n >= 0 && (t = n);
121
+ }
122
+ return {
123
+ type: "select",
124
+ name: "platform",
125
+ message: "选择git平台",
126
+ choices: zt,
127
+ initial: t
128
+ };
129
+ }, Dn = (e) => ({
130
+ type: "text",
131
+ name: "username",
132
+ message: "请输入用户名",
133
+ format: (t) => t.trim(),
134
+ validate: (t) => t.length > 0 || "用户名不能为空",
135
+ initial: e
136
+ }), Mo = {
137
+ name: "@done-coding/cli-git",
138
+ version: "0.6.15",
139
+ description: "git跨平台操作命令行工具",
140
+ bin: {
141
+ "dc-git": "es/cli.mjs"
142
+ },
143
+ cliConfig: {
144
+ namespaceDir: ".done-coding",
145
+ moduleName: "git"
146
+ }
147
+ }, {
148
+ cliConfig: { namespaceDir: Ho, moduleName: ko }
149
+ } = Mo, Go = `./${Ho}/${ko}`, qo = (e) => `${Go}/.${e}`, Ko = ({ platform: e, username: t }) => `${e}/${t}`, Wo = (e) => {
150
+ const { platform: t } = e, n = qo(t), r = Un(n, {
151
+ isFindFarthest: !1
152
+ });
153
+ if (!r) {
154
+ R.warn("配置文件不存在");
155
+ return;
156
+ }
157
+ const o = `${r}/${n}`, s = So.readFileSync(o, "utf-8"), i = Ko(e), a = mo({ encryptedText: s, secretKey: i });
158
+ if (!a) {
159
+ R.warn("配置文件解密失败");
160
+ return;
161
+ }
162
+ return JSON.parse(a);
163
+ };
164
+ var zo = Object.defineProperty, Jo = (e, t, n) => t in e ? zo(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, Q = (e, t, n) => (Jo(e, typeof t != "symbol" ? t + "" : t, n), n), F = /* @__PURE__ */ ((e) => (e.REQUEST_ERROR = "REQUEST_ERROR", e.NO_RESPONSE = "NO_RESPONSE", e.NO_RESPONSE_TIMEOUT = "NO_RESPONSE_TIMEOUT", e.NO_RESPONSE_OFFLINE = "NO_RESPONSE_OFFLINE", e.DISPATCH_RESPONSE = "DISPATCH_RESPONSE", e.DEAL_ERROR = "DEAL_ERROR", e.NO_BUSINESS_CODE = "NO_BUSINESS_CODE", e.NO_NETWORK_CODE = "NO_NETWORK_CODE", e.ABORT = "ABORT", e))(F || {});
165
+ class Z extends Error {
166
+ constructor({ message: t, code: n, isBusinessError: r }) {
167
+ super(t), Q(this, "code"), Q(this, "isBusinessError"), Q(this, "message"), this.message = t, this.code = n, this.isBusinessError = r, this.name = "DC Request ERROR";
168
+ }
169
+ }
170
+ class me extends Z {
171
+ /**
172
+ * @param cause 错误原因
173
+ */
174
+ constructor({
175
+ message: t,
176
+ code: n,
177
+ cause: r
178
+ }) {
179
+ super({ message: t, code: n, isBusinessError: !1 }), Q(this, "cause"), this.cause = r;
180
+ }
181
+ }
182
+ class Mn extends Z {
183
+ constructor({ message: t, code: n }) {
184
+ super({ message: t, code: n, isBusinessError: !0 });
185
+ }
186
+ }
187
+ var D = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
188
+ function _t(e) {
189
+ return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
190
+ }
191
+ var Vo = 200, Et = "__lodash_hash_undefined__", Xo = 1 / 0, Hn = 9007199254740991, Qo = "[object Arguments]", Yo = "[object Function]", Zo = "[object GeneratorFunction]", es = "[object Symbol]", ts = /[\\^$.*+?()[\]{}|]/g, ns = /^\[object .+?Constructor\]$/, rs = /^(?:0|[1-9]\d*)$/, os = typeof D == "object" && D && D.Object === Object && D, ss = typeof self == "object" && self && self.Object === Object && self, bt = os || ss || Function("return this")();
192
+ function is(e, t, n) {
193
+ switch (n.length) {
194
+ case 0:
195
+ return e.call(t);
196
+ case 1:
197
+ return e.call(t, n[0]);
198
+ case 2:
199
+ return e.call(t, n[0], n[1]);
200
+ case 3:
201
+ return e.call(t, n[0], n[1], n[2]);
202
+ }
203
+ return e.apply(t, n);
204
+ }
205
+ function as(e, t) {
206
+ var n = e ? e.length : 0;
207
+ return !!n && ls(e, t, 0) > -1;
208
+ }
209
+ function cs(e, t, n) {
210
+ for (var r = -1, o = e ? e.length : 0; ++r < o; )
211
+ if (n(t, e[r]))
212
+ return !0;
213
+ return !1;
214
+ }
215
+ function kn(e, t) {
216
+ for (var n = -1, r = e ? e.length : 0, o = Array(r); ++n < r; )
217
+ o[n] = t(e[n], n, e);
218
+ return o;
219
+ }
220
+ function Rt(e, t) {
221
+ for (var n = -1, r = t.length, o = e.length; ++n < r; )
222
+ e[o + n] = t[n];
223
+ return e;
224
+ }
225
+ function us(e, t, n, r) {
226
+ for (var o = e.length, s = n + (r ? 1 : -1); r ? s-- : ++s < o; )
227
+ if (t(e[s], s, e))
228
+ return s;
229
+ return -1;
230
+ }
231
+ function ls(e, t, n) {
232
+ if (t !== t)
233
+ return us(e, fs, n);
234
+ for (var r = n - 1, o = e.length; ++r < o; )
235
+ if (e[r] === t)
236
+ return r;
237
+ return -1;
238
+ }
239
+ function fs(e) {
240
+ return e !== e;
241
+ }
242
+ function ps(e, t) {
243
+ for (var n = -1, r = Array(e); ++n < e; )
244
+ r[n] = t(n);
245
+ return r;
246
+ }
247
+ function hs(e) {
248
+ return function(t) {
249
+ return e(t);
250
+ };
251
+ }
252
+ function ds(e, t) {
253
+ return e.has(t);
254
+ }
255
+ function ms(e, t) {
256
+ return e == null ? void 0 : e[t];
257
+ }
258
+ function gs(e) {
259
+ var t = !1;
260
+ if (e != null && typeof e.toString != "function")
261
+ try {
262
+ t = !!(e + "");
263
+ } catch {
264
+ }
265
+ return t;
266
+ }
267
+ function Gn(e, t) {
268
+ return function(n) {
269
+ return e(t(n));
270
+ };
271
+ }
272
+ var ys = Array.prototype, _s = Function.prototype, Be = Object.prototype, rt = bt["__core-js_shared__"], Jt = function() {
273
+ var e = /[^.]+$/.exec(rt && rt.keys && rt.keys.IE_PROTO || "");
274
+ return e ? "Symbol(src)_1." + e : "";
275
+ }(), qn = _s.toString, ne = Be.hasOwnProperty, St = Be.toString, Es = RegExp(
276
+ "^" + qn.call(ne).replace(ts, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
277
+ ), Vt = bt.Symbol, bs = Gn(Object.getPrototypeOf, Object), Rs = Be.propertyIsEnumerable, Ss = ys.splice, Xt = Vt ? Vt.isConcatSpreadable : void 0, lt = Object.getOwnPropertySymbols, Qt = Math.max, Os = Wn(bt, "Map"), ge = Wn(Object, "create");
278
+ function K(e) {
279
+ var t = -1, n = e ? e.length : 0;
280
+ for (this.clear(); ++t < n; ) {
281
+ var r = e[t];
282
+ this.set(r[0], r[1]);
283
+ }
284
+ }
285
+ function ws() {
286
+ this.__data__ = ge ? ge(null) : {};
287
+ }
288
+ function vs(e) {
289
+ return this.has(e) && delete this.__data__[e];
290
+ }
291
+ function Ts(e) {
292
+ var t = this.__data__;
293
+ if (ge) {
294
+ var n = t[e];
295
+ return n === Et ? void 0 : n;
296
+ }
297
+ return ne.call(t, e) ? t[e] : void 0;
298
+ }
299
+ function As(e) {
300
+ var t = this.__data__;
301
+ return ge ? t[e] !== void 0 : ne.call(t, e);
302
+ }
303
+ function Cs(e, t) {
304
+ var n = this.__data__;
305
+ return n[e] = ge && t === void 0 ? Et : t, this;
306
+ }
307
+ K.prototype.clear = ws;
308
+ K.prototype.delete = vs;
309
+ K.prototype.get = Ts;
310
+ K.prototype.has = As;
311
+ K.prototype.set = Cs;
312
+ function re(e) {
313
+ var t = -1, n = e ? e.length : 0;
314
+ for (this.clear(); ++t < n; ) {
315
+ var r = e[t];
316
+ this.set(r[0], r[1]);
317
+ }
318
+ }
319
+ function Ns() {
320
+ this.__data__ = [];
321
+ }
322
+ function Ps(e) {
323
+ var t = this.__data__, n = $e(t, e);
324
+ if (n < 0)
325
+ return !1;
326
+ var r = t.length - 1;
327
+ return n == r ? t.pop() : Ss.call(t, n, 1), !0;
328
+ }
329
+ function Us(e) {
330
+ var t = this.__data__, n = $e(t, e);
331
+ return n < 0 ? void 0 : t[n][1];
332
+ }
333
+ function js(e) {
334
+ return $e(this.__data__, e) > -1;
335
+ }
336
+ function Ls(e, t) {
337
+ var n = this.__data__, r = $e(n, e);
338
+ return r < 0 ? n.push([e, t]) : n[r][1] = t, this;
339
+ }
340
+ re.prototype.clear = Ns;
341
+ re.prototype.delete = Ps;
342
+ re.prototype.get = Us;
343
+ re.prototype.has = js;
344
+ re.prototype.set = Ls;
345
+ function oe(e) {
346
+ var t = -1, n = e ? e.length : 0;
347
+ for (this.clear(); ++t < n; ) {
348
+ var r = e[t];
349
+ this.set(r[0], r[1]);
350
+ }
351
+ }
352
+ function Is() {
353
+ this.__data__ = {
354
+ hash: new K(),
355
+ map: new (Os || re)(),
356
+ string: new K()
357
+ };
358
+ }
359
+ function xs(e) {
360
+ return Fe(this, e).delete(e);
361
+ }
362
+ function Bs(e) {
363
+ return Fe(this, e).get(e);
364
+ }
365
+ function $s(e) {
366
+ return Fe(this, e).has(e);
367
+ }
368
+ function Fs(e, t) {
369
+ return Fe(this, e).set(e, t), this;
370
+ }
371
+ oe.prototype.clear = Is;
372
+ oe.prototype.delete = xs;
373
+ oe.prototype.get = Bs;
374
+ oe.prototype.has = $s;
375
+ oe.prototype.set = Fs;
376
+ function Pe(e) {
377
+ var t = -1, n = e ? e.length : 0;
378
+ for (this.__data__ = new oe(); ++t < n; )
379
+ this.add(e[t]);
380
+ }
381
+ function Ds(e) {
382
+ return this.__data__.set(e, Et), this;
383
+ }
384
+ function Ms(e) {
385
+ return this.__data__.has(e);
386
+ }
387
+ Pe.prototype.add = Pe.prototype.push = Ds;
388
+ Pe.prototype.has = Ms;
389
+ function Hs(e, t) {
390
+ var n = Ot(e) || zn(e) ? ps(e.length, String) : [], r = n.length, o = !!r;
391
+ for (var s in e)
392
+ (t || ne.call(e, s)) && !(o && (s == "length" || Zs(s, r))) && n.push(s);
393
+ return n;
394
+ }
395
+ function $e(e, t) {
396
+ for (var n = e.length; n--; )
397
+ if (ii(e[n][0], t))
398
+ return n;
399
+ return -1;
400
+ }
401
+ function ks(e, t, n, r) {
402
+ var o = -1, s = as, i = !0, a = e.length, f = [], l = t.length;
403
+ if (!a)
404
+ return f;
405
+ n && (t = kn(t, hs(n))), r ? (s = cs, i = !1) : t.length >= Vo && (s = ds, i = !1, t = new Pe(t));
406
+ e:
407
+ for (; ++o < a; ) {
408
+ var c = e[o], p = n ? n(c) : c;
409
+ if (c = r || c !== 0 ? c : 0, i && p === p) {
410
+ for (var g = l; g--; )
411
+ if (t[g] === p)
412
+ continue e;
413
+ f.push(c);
414
+ } else
415
+ s(t, p, r) || f.push(c);
416
+ }
417
+ return f;
418
+ }
419
+ function Kn(e, t, n, r, o) {
420
+ var s = -1, i = e.length;
421
+ for (n || (n = Ys), o || (o = []); ++s < i; ) {
422
+ var a = e[s];
423
+ t > 0 && n(a) ? t > 1 ? Kn(a, t - 1, n, r, o) : Rt(o, a) : r || (o[o.length] = a);
424
+ }
425
+ return o;
426
+ }
427
+ function Gs(e, t, n) {
428
+ var r = t(e);
429
+ return Ot(e) ? r : Rt(r, n(e));
430
+ }
431
+ function qs(e) {
432
+ if (!wt(e) || ti(e))
433
+ return !1;
434
+ var t = Vn(e) || gs(e) ? Es : ns;
435
+ return t.test(si(e));
436
+ }
437
+ function Ks(e) {
438
+ if (!wt(e))
439
+ return ri(e);
440
+ var t = ni(e), n = [];
441
+ for (var r in e)
442
+ r == "constructor" && (t || !ne.call(e, r)) || n.push(r);
443
+ return n;
444
+ }
445
+ function Ws(e, t) {
446
+ return e = Object(e), zs(e, t, function(n, r) {
447
+ return r in e;
448
+ });
449
+ }
450
+ function zs(e, t, n) {
451
+ for (var r = -1, o = t.length, s = {}; ++r < o; ) {
452
+ var i = t[r], a = e[i];
453
+ n(a, i) && (s[i] = a);
454
+ }
455
+ return s;
456
+ }
457
+ function Js(e, t) {
458
+ return t = Qt(t === void 0 ? e.length - 1 : t, 0), function() {
459
+ for (var n = arguments, r = -1, o = Qt(n.length - t, 0), s = Array(o); ++r < o; )
460
+ s[r] = n[t + r];
461
+ r = -1;
462
+ for (var i = Array(t + 1); ++r < t; )
463
+ i[r] = n[r];
464
+ return i[t] = s, is(e, this, i);
465
+ };
466
+ }
467
+ function Vs(e) {
468
+ return Gs(e, li, Qs);
469
+ }
470
+ function Fe(e, t) {
471
+ var n = e.__data__;
472
+ return ei(t) ? n[typeof t == "string" ? "string" : "hash"] : n.map;
473
+ }
474
+ function Wn(e, t) {
475
+ var n = ms(e, t);
476
+ return qs(n) ? n : void 0;
477
+ }
478
+ var Xs = lt ? Gn(lt, Object) : Qn, Qs = lt ? function(e) {
479
+ for (var t = []; e; )
480
+ Rt(t, Xs(e)), e = bs(e);
481
+ return t;
482
+ } : Qn;
483
+ function Ys(e) {
484
+ return Ot(e) || zn(e) || !!(Xt && e && e[Xt]);
485
+ }
486
+ function Zs(e, t) {
487
+ return t = t ?? Hn, !!t && (typeof e == "number" || rs.test(e)) && e > -1 && e % 1 == 0 && e < t;
488
+ }
489
+ function ei(e) {
490
+ var t = typeof e;
491
+ return t == "string" || t == "number" || t == "symbol" || t == "boolean" ? e !== "__proto__" : e === null;
492
+ }
493
+ function ti(e) {
494
+ return !!Jt && Jt in e;
495
+ }
496
+ function ni(e) {
497
+ var t = e && e.constructor, n = typeof t == "function" && t.prototype || Be;
498
+ return e === n;
499
+ }
500
+ function ri(e) {
501
+ var t = [];
502
+ if (e != null)
503
+ for (var n in Object(e))
504
+ t.push(n);
505
+ return t;
506
+ }
507
+ function oi(e) {
508
+ if (typeof e == "string" || ui(e))
509
+ return e;
510
+ var t = e + "";
511
+ return t == "0" && 1 / e == -Xo ? "-0" : t;
512
+ }
513
+ function si(e) {
514
+ if (e != null) {
515
+ try {
516
+ return qn.call(e);
517
+ } catch {
518
+ }
519
+ try {
520
+ return e + "";
521
+ } catch {
522
+ }
523
+ }
524
+ return "";
525
+ }
526
+ function ii(e, t) {
527
+ return e === t || e !== e && t !== t;
528
+ }
529
+ function zn(e) {
530
+ return ai(e) && ne.call(e, "callee") && (!Rs.call(e, "callee") || St.call(e) == Qo);
531
+ }
532
+ var Ot = Array.isArray;
533
+ function Jn(e) {
534
+ return e != null && ci(e.length) && !Vn(e);
535
+ }
536
+ function ai(e) {
537
+ return Xn(e) && Jn(e);
538
+ }
539
+ function Vn(e) {
540
+ var t = wt(e) ? St.call(e) : "";
541
+ return t == Yo || t == Zo;
542
+ }
543
+ function ci(e) {
544
+ return typeof e == "number" && e > -1 && e % 1 == 0 && e <= Hn;
545
+ }
546
+ function wt(e) {
547
+ var t = typeof e;
548
+ return !!e && (t == "object" || t == "function");
549
+ }
550
+ function Xn(e) {
551
+ return !!e && typeof e == "object";
552
+ }
553
+ function ui(e) {
554
+ return typeof e == "symbol" || Xn(e) && St.call(e) == es;
555
+ }
556
+ function li(e) {
557
+ return Jn(e) ? Hs(e, !0) : Ks(e);
558
+ }
559
+ var fi = Js(function(e, t) {
560
+ return e == null ? {} : (t = kn(Kn(t, 1), oi), Ws(e, ks(Vs(e), t)));
561
+ });
562
+ function Qn() {
563
+ return [];
564
+ }
565
+ var pi = fi;
566
+ const hi = /* @__PURE__ */ _t(pi);
567
+ var M = /* @__PURE__ */ ((e) => (e.LOG = "log", e.WARN = "warn", e.ERROR = "error", e))(M || {}), N = /* @__PURE__ */ ((e) => (e.BEFORE = "1 发起请求前阶段", e.BEFORE_ERROR = "1.1 发起请求前阶段出错", e.BEFORE_ERROR_ORIGIN = "1.1.1 发起请求前阶段-原始错误", e.BEFORE_ERROR_PACK = "1.1.2 发起请求前阶段-包装后错误", e.NETWORK = "2 网络阶段", e.NETWORK_SUCCESS = "2.1 网络成功阶段", e.NETWORK_SUCCESS_BUSINESS_SUCCESS = "2.1.1 网路成功且业务成功", e.NETWORK_SUCCESS_BUSINESS_FAIL = "2.1.2 网络成功但业务失败", e.NETWORK_SUCCESS_DISPATCH_ERROR = "2.1.3 网络成功但分发业务结果出错", e.NETWORK_ERROR = "2.2 网络出错阶段", e.NETWORK_ERROR_ORIGIN = "2.2.1 网络出错阶段-原始错误", e.NETWORK_ERROR_PACK = "2.2.2 网络出错阶段-包装后错误", e.DEAL_ERROR = "3 处理错误阶段", e.DEAL_ERROR_ERROR = "3.1 处理错误阶段出错", e.DEAL_ERROR_RESULT = "3.2 处理错误结果", e.DEAL_ERROR_RESULT_RELOAD = "3.2.1 处理错误结果-重新请求", e.DEAL_ERROR_RESULT_CONTINUE = "3.2.2 处理错误结果-正常抛错", e))(N || {});
568
+ const P = ({
569
+ stage: e,
570
+ data: t
571
+ }, n = "log") => {
572
+ console[n](
573
+ e,
574
+ t instanceof Z ? hi({ ...t }, "cause") : t
575
+ );
576
+ }, he = (e) => e instanceof Error ? e.message : "未知错误", di = async (e, {
577
+ getBusinessCode: t,
578
+ getBusinessMsg: n,
579
+ getBusinessData: r,
580
+ businessSuccessCodeList: o = [200],
581
+ isSuccessBusinessCode: s
582
+ }, i) => {
583
+ i && P(
584
+ { stage: N.NETWORK_SUCCESS, data: e },
585
+ M.LOG
586
+ );
587
+ try {
588
+ const a = t(e), f = n(e);
589
+ if (s ? s(a, e) : o.includes(a)) {
590
+ const l = {
591
+ code: a,
592
+ data: r(e),
593
+ message: f,
594
+ _raw: e
595
+ };
596
+ return i && P(
597
+ {
598
+ stage: N.NETWORK_SUCCESS_BUSINESS_SUCCESS,
599
+ data: l
600
+ },
601
+ M.LOG
602
+ ), l;
603
+ } else {
604
+ if (a === void 0)
605
+ throw new Error("业务code未定义");
606
+ const l = new Mn({
607
+ code: a,
608
+ message: f ?? "未知错误"
609
+ });
610
+ return i && P(
611
+ {
612
+ stage: N.NETWORK_SUCCESS_BUSINESS_FAIL,
613
+ data: l
614
+ },
615
+ M.ERROR
616
+ ), Promise.reject(l);
617
+ }
618
+ } catch (a) {
619
+ i && P(
620
+ {
621
+ stage: N.NETWORK_SUCCESS_DISPATCH_ERROR,
622
+ data: a
623
+ },
624
+ M.ERROR
625
+ );
626
+ const f = new me({
627
+ code: F.DISPATCH_RESPONSE,
628
+ message: he(a) ?? "分发响应结果执行出错",
629
+ cause: a
630
+ });
631
+ return Promise.reject(f);
632
+ }
633
+ }, mi = (e, t) => (...n) => {
634
+ try {
635
+ return e(...n);
636
+ } catch (r) {
637
+ return console.error(e.name, r, e), t;
638
+ }
639
+ }, Yt = (e, t) => (...n) => e(...n).catch((r) => (console.error(e.name, r, e), t));
640
+ var Yn = 9007199254740991, gi = "[object Arguments]", yi = "[object Function]", _i = "[object GeneratorFunction]", Ei = /^(?:0|[1-9]\d*)$/;
641
+ function bi(e, t, n) {
642
+ switch (n.length) {
643
+ case 0:
644
+ return e.call(t);
645
+ case 1:
646
+ return e.call(t, n[0]);
647
+ case 2:
648
+ return e.call(t, n[0], n[1]);
649
+ case 3:
650
+ return e.call(t, n[0], n[1], n[2]);
651
+ }
652
+ return e.apply(t, n);
653
+ }
654
+ function Ri(e, t) {
655
+ for (var n = -1, r = Array(e); ++n < e; )
656
+ r[n] = t(n);
657
+ return r;
658
+ }
659
+ function Si(e, t) {
660
+ return function(n) {
661
+ return e(t(n));
662
+ };
663
+ }
664
+ var De = Object.prototype, Se = De.hasOwnProperty, Zn = De.toString, er = De.propertyIsEnumerable, Oi = Si(Object.keys, Object), Zt = Math.max, wi = !er.call({ valueOf: 1 }, "valueOf");
665
+ function vi(e, t) {
666
+ var n = ji(e) || Ui(e) ? Ri(e.length, String) : [], r = n.length, o = !!r;
667
+ for (var s in e)
668
+ (t || Se.call(e, s)) && !(o && (s == "length" || nr(s, r))) && n.push(s);
669
+ return n;
670
+ }
671
+ function tr(e, t, n) {
672
+ var r = e[t];
673
+ (!(Se.call(e, t) && or(r, n)) || n === void 0 && !(t in e)) && (e[t] = n);
674
+ }
675
+ function Ti(e) {
676
+ if (!rr(e))
677
+ return Oi(e);
678
+ var t = [];
679
+ for (var n in Object(e))
680
+ Se.call(e, n) && n != "constructor" && t.push(n);
681
+ return t;
682
+ }
683
+ function Ai(e, t) {
684
+ return t = Zt(t === void 0 ? e.length - 1 : t, 0), function() {
685
+ for (var n = arguments, r = -1, o = Zt(n.length - t, 0), s = Array(o); ++r < o; )
686
+ s[r] = n[t + r];
687
+ r = -1;
688
+ for (var i = Array(t + 1); ++r < t; )
689
+ i[r] = n[r];
690
+ return i[t] = s, bi(e, this, i);
691
+ };
692
+ }
693
+ function Ci(e, t, n, r) {
694
+ n || (n = {});
695
+ for (var o = -1, s = t.length; ++o < s; ) {
696
+ var i = t[o], a = r ? r(n[i], e[i], i, n, e) : void 0;
697
+ tr(n, i, a === void 0 ? e[i] : a);
698
+ }
699
+ return n;
700
+ }
701
+ function Ni(e) {
702
+ return Ai(function(t, n) {
703
+ var r = -1, o = n.length, s = o > 1 ? n[o - 1] : void 0, i = o > 2 ? n[2] : void 0;
704
+ for (s = e.length > 3 && typeof s == "function" ? (o--, s) : void 0, i && Pi(n[0], n[1], i) && (s = o < 3 ? void 0 : s, o = 1), t = Object(t); ++r < o; ) {
705
+ var a = n[r];
706
+ a && e(t, a, r, s);
707
+ }
708
+ return t;
709
+ });
710
+ }
711
+ function nr(e, t) {
712
+ return t = t ?? Yn, !!t && (typeof e == "number" || Ei.test(e)) && e > -1 && e % 1 == 0 && e < t;
713
+ }
714
+ function Pi(e, t, n) {
715
+ if (!sr(n))
716
+ return !1;
717
+ var r = typeof t;
718
+ return (r == "number" ? Me(n) && nr(t, n.length) : r == "string" && t in n) ? or(n[t], e) : !1;
719
+ }
720
+ function rr(e) {
721
+ var t = e && e.constructor, n = typeof t == "function" && t.prototype || De;
722
+ return e === n;
723
+ }
724
+ function or(e, t) {
725
+ return e === t || e !== e && t !== t;
726
+ }
727
+ function Ui(e) {
728
+ return Li(e) && Se.call(e, "callee") && (!er.call(e, "callee") || Zn.call(e) == gi);
729
+ }
730
+ var ji = Array.isArray;
731
+ function Me(e) {
732
+ return e != null && xi(e.length) && !Ii(e);
733
+ }
734
+ function Li(e) {
735
+ return Bi(e) && Me(e);
736
+ }
737
+ function Ii(e) {
738
+ var t = sr(e) ? Zn.call(e) : "";
739
+ return t == yi || t == _i;
740
+ }
741
+ function xi(e) {
742
+ return typeof e == "number" && e > -1 && e % 1 == 0 && e <= Yn;
743
+ }
744
+ function sr(e) {
745
+ var t = typeof e;
746
+ return !!e && (t == "object" || t == "function");
747
+ }
748
+ function Bi(e) {
749
+ return !!e && typeof e == "object";
750
+ }
751
+ var $i = Ni(function(e, t) {
752
+ if (wi || rr(t) || Me(t)) {
753
+ Ci(t, Fi(t), e);
754
+ return;
755
+ }
756
+ for (var n in t)
757
+ Se.call(t, n) && tr(e, n, t[n]);
758
+ });
759
+ function Fi(e) {
760
+ return Me(e) ? vi(e) : Ti(e);
761
+ }
762
+ var Di = $i;
763
+ const en = /* @__PURE__ */ _t(Di);
764
+ var Mi = "Expected a function", tn = "__lodash_placeholder__", W = 1, He = 2, Hi = 4, q = 8, de = 16, Y = 32, ye = 64, ir = 128, ki = 256, ar = 512, nn = 1 / 0, Gi = 9007199254740991, qi = 17976931348623157e292, rn = NaN, Ki = [
765
+ ["ary", ir],
766
+ ["bind", W],
767
+ ["bindKey", He],
768
+ ["curry", q],
769
+ ["curryRight", de],
770
+ ["flip", ar],
771
+ ["partial", Y],
772
+ ["partialRight", ye],
773
+ ["rearg", ki]
774
+ ], Wi = "[object Function]", zi = "[object GeneratorFunction]", Ji = "[object Symbol]", Vi = /[\\^$.*+?()[\]{}|]/g, Xi = /^\s+|\s+$/g, Qi = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, Yi = /\{\n\/\* \[wrapped with (.+)\] \*/, Zi = /,? & /, ea = /^[-+]0x[0-9a-f]+$/i, ta = /^0b[01]+$/i, na = /^\[object .+?Constructor\]$/, ra = /^0o[0-7]+$/i, oa = /^(?:0|[1-9]\d*)$/, sa = parseInt, ia = typeof D == "object" && D && D.Object === Object && D, aa = typeof self == "object" && self && self.Object === Object && self, Oe = ia || aa || Function("return this")();
775
+ function cr(e, t, n) {
776
+ switch (n.length) {
777
+ case 0:
778
+ return e.call(t);
779
+ case 1:
780
+ return e.call(t, n[0]);
781
+ case 2:
782
+ return e.call(t, n[0], n[1]);
783
+ case 3:
784
+ return e.call(t, n[0], n[1], n[2]);
785
+ }
786
+ return e.apply(t, n);
787
+ }
788
+ function ca(e, t) {
789
+ for (var n = -1, r = e ? e.length : 0; ++n < r && t(e[n], n, e) !== !1; )
790
+ ;
791
+ return e;
792
+ }
793
+ function ua(e, t) {
794
+ var n = e ? e.length : 0;
795
+ return !!n && fa(e, t, 0) > -1;
796
+ }
797
+ function la(e, t, n, r) {
798
+ for (var o = e.length, s = n + (r ? 1 : -1); r ? s-- : ++s < o; )
799
+ if (t(e[s], s, e))
800
+ return s;
801
+ return -1;
802
+ }
803
+ function fa(e, t, n) {
804
+ if (t !== t)
805
+ return la(e, pa, n);
806
+ for (var r = n - 1, o = e.length; ++r < o; )
807
+ if (e[r] === t)
808
+ return r;
809
+ return -1;
810
+ }
811
+ function pa(e) {
812
+ return e !== e;
813
+ }
814
+ function ha(e, t) {
815
+ for (var n = e.length, r = 0; n--; )
816
+ e[n] === t && r++;
817
+ return r;
818
+ }
819
+ function da(e, t) {
820
+ return e == null ? void 0 : e[t];
821
+ }
822
+ function ma(e) {
823
+ var t = !1;
824
+ if (e != null && typeof e.toString != "function")
825
+ try {
826
+ t = !!(e + "");
827
+ } catch {
828
+ }
829
+ return t;
830
+ }
831
+ function ur(e, t) {
832
+ for (var n = -1, r = e.length, o = 0, s = []; ++n < r; ) {
833
+ var i = e[n];
834
+ (i === t || i === tn) && (e[n] = tn, s[o++] = n);
835
+ }
836
+ return s;
837
+ }
838
+ var ga = Function.prototype, lr = Object.prototype, ot = Oe["__core-js_shared__"], on = function() {
839
+ var e = /[^.]+$/.exec(ot && ot.keys && ot.keys.IE_PROTO || "");
840
+ return e ? "Symbol(src)_1." + e : "";
841
+ }(), fr = ga.toString, ya = lr.hasOwnProperty, pr = lr.toString, _a = RegExp(
842
+ "^" + fr.call(ya).replace(Vi, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
843
+ ), Ea = Object.create, Ue = Math.max, ba = Math.min, sn = function() {
844
+ var e = an(Object, "defineProperty"), t = an.name;
845
+ return t && t.length > 2 ? e : void 0;
846
+ }();
847
+ function Ra(e) {
848
+ return ee(e) ? Ea(e) : {};
849
+ }
850
+ function Sa(e) {
851
+ if (!ee(e) || La(e))
852
+ return !1;
853
+ var t = $a(e) || ma(e) ? _a : na;
854
+ return t.test(xa(e));
855
+ }
856
+ function Oa(e, t, n, r) {
857
+ for (var o = -1, s = e.length, i = n.length, a = -1, f = t.length, l = Ue(s - i, 0), c = Array(f + l), p = !r; ++a < f; )
858
+ c[a] = t[a];
859
+ for (; ++o < i; )
860
+ (p || o < s) && (c[n[o]] = e[o]);
861
+ for (; l--; )
862
+ c[a++] = e[o++];
863
+ return c;
864
+ }
865
+ function wa(e, t, n, r) {
866
+ for (var o = -1, s = e.length, i = -1, a = n.length, f = -1, l = t.length, c = Ue(s - a, 0), p = Array(c + l), g = !r; ++o < c; )
867
+ p[o] = e[o];
868
+ for (var y = o; ++f < l; )
869
+ p[y + f] = t[f];
870
+ for (; ++i < a; )
871
+ (g || o < s) && (p[y + n[i]] = e[o++]);
872
+ return p;
873
+ }
874
+ function va(e, t) {
875
+ var n = -1, r = e.length;
876
+ for (t || (t = Array(r)); ++n < r; )
877
+ t[n] = e[n];
878
+ return t;
879
+ }
880
+ function Ta(e, t, n) {
881
+ var r = t & W, o = _e(e);
882
+ function s() {
883
+ var i = this && this !== Oe && this instanceof s ? o : e;
884
+ return i.apply(r ? n : this, arguments);
885
+ }
886
+ return s;
887
+ }
888
+ function _e(e) {
889
+ return function() {
890
+ var t = arguments;
891
+ switch (t.length) {
892
+ case 0:
893
+ return new e();
894
+ case 1:
895
+ return new e(t[0]);
896
+ case 2:
897
+ return new e(t[0], t[1]);
898
+ case 3:
899
+ return new e(t[0], t[1], t[2]);
900
+ case 4:
901
+ return new e(t[0], t[1], t[2], t[3]);
902
+ case 5:
903
+ return new e(t[0], t[1], t[2], t[3], t[4]);
904
+ case 6:
905
+ return new e(t[0], t[1], t[2], t[3], t[4], t[5]);
906
+ case 7:
907
+ return new e(t[0], t[1], t[2], t[3], t[4], t[5], t[6]);
908
+ }
909
+ var n = Ra(e.prototype), r = e.apply(n, t);
910
+ return ee(r) ? r : n;
911
+ };
912
+ }
913
+ function Aa(e, t, n) {
914
+ var r = _e(e);
915
+ function o() {
916
+ for (var s = arguments.length, i = Array(s), a = s, f = dr(o); a--; )
917
+ i[a] = arguments[a];
918
+ var l = s < 3 && i[0] !== f && i[s - 1] !== f ? [] : ur(i, f);
919
+ if (s -= l.length, s < n)
920
+ return hr(
921
+ e,
922
+ t,
923
+ vt,
924
+ o.placeholder,
925
+ void 0,
926
+ i,
927
+ l,
928
+ void 0,
929
+ void 0,
930
+ n - s
931
+ );
932
+ var c = this && this !== Oe && this instanceof o ? r : e;
933
+ return cr(c, this, i);
934
+ }
935
+ return o;
936
+ }
937
+ function vt(e, t, n, r, o, s, i, a, f, l) {
938
+ var c = t & ir, p = t & W, g = t & He, y = t & (q | de), h = t & ar, m = g ? void 0 : _e(e);
939
+ function d() {
940
+ for (var b = arguments.length, _ = Array(b), O = b; O--; )
941
+ _[O] = arguments[O];
942
+ if (y)
943
+ var C = dr(d), v = ha(_, C);
944
+ if (r && (_ = Oa(_, r, o, y)), s && (_ = wa(_, s, i, y)), b -= v, y && b < l) {
945
+ var L = ur(_, C);
946
+ return hr(
947
+ e,
948
+ t,
949
+ vt,
950
+ d.placeholder,
951
+ n,
952
+ _,
953
+ L,
954
+ a,
955
+ f,
956
+ l - b
957
+ );
958
+ }
959
+ var I = p ? n : this, $ = g ? I[e] : e;
960
+ return b = _.length, a ? _ = Ia(_, a) : h && b > 1 && _.reverse(), c && f < b && (_.length = f), this && this !== Oe && this instanceof d && ($ = m || _e($)), $.apply(I, _);
961
+ }
962
+ return d;
963
+ }
964
+ function Ca(e, t, n, r) {
965
+ var o = t & W, s = _e(e);
966
+ function i() {
967
+ for (var a = -1, f = arguments.length, l = -1, c = r.length, p = Array(c + f), g = this && this !== Oe && this instanceof i ? s : e; ++l < c; )
968
+ p[l] = r[l];
969
+ for (; f--; )
970
+ p[l++] = arguments[++a];
971
+ return cr(g, o ? n : this, p);
972
+ }
973
+ return i;
974
+ }
975
+ function hr(e, t, n, r, o, s, i, a, f, l) {
976
+ var c = t & q, p = c ? i : void 0, g = c ? void 0 : i, y = c ? s : void 0, h = c ? void 0 : s;
977
+ t |= c ? Y : ye, t &= ~(c ? ye : Y), t & Hi || (t &= ~(W | He));
978
+ var m = n(e, t, o, y, p, h, g, a, f, l);
979
+ return m.placeholder = r, mr(m, e, t);
980
+ }
981
+ function Na(e, t, n, r, o, s, i, a) {
982
+ var f = t & He;
983
+ if (!f && typeof e != "function")
984
+ throw new TypeError(Mi);
985
+ var l = r ? r.length : 0;
986
+ if (l || (t &= ~(Y | ye), r = o = void 0), i = i === void 0 ? i : Ue(cn(i), 0), a = a === void 0 ? a : cn(a), l -= o ? o.length : 0, t & ye) {
987
+ var c = r, p = o;
988
+ r = o = void 0;
989
+ }
990
+ var g = [
991
+ e,
992
+ t,
993
+ n,
994
+ r,
995
+ o,
996
+ c,
997
+ p,
998
+ s,
999
+ i,
1000
+ a
1001
+ ];
1002
+ if (e = g[0], t = g[1], n = g[2], r = g[3], o = g[4], a = g[9] = g[9] == null ? f ? 0 : e.length : Ue(g[9] - l, 0), !a && t & (q | de) && (t &= ~(q | de)), !t || t == W)
1003
+ var y = Ta(e, t, n);
1004
+ else
1005
+ t == q || t == de ? y = Aa(e, t, a) : (t == Y || t == (W | Y)) && !o.length ? y = Ca(e, t, n, r) : y = vt.apply(void 0, g);
1006
+ return mr(y, e, t);
1007
+ }
1008
+ function dr(e) {
1009
+ var t = e;
1010
+ return t.placeholder;
1011
+ }
1012
+ function an(e, t) {
1013
+ var n = da(e, t);
1014
+ return Sa(n) ? n : void 0;
1015
+ }
1016
+ function Pa(e) {
1017
+ var t = e.match(Yi);
1018
+ return t ? t[1].split(Zi) : [];
1019
+ }
1020
+ function Ua(e, t) {
1021
+ var n = t.length, r = n - 1;
1022
+ return t[r] = (n > 1 ? "& " : "") + t[r], t = t.join(n > 2 ? ", " : " "), e.replace(Qi, `{
1023
+ /* [wrapped with ` + t + `] */
1024
+ `);
1025
+ }
1026
+ function ja(e, t) {
1027
+ return t = t ?? Gi, !!t && (typeof e == "number" || oa.test(e)) && e > -1 && e % 1 == 0 && e < t;
1028
+ }
1029
+ function La(e) {
1030
+ return !!on && on in e;
1031
+ }
1032
+ function Ia(e, t) {
1033
+ for (var n = e.length, r = ba(t.length, n), o = va(e); r--; ) {
1034
+ var s = t[r];
1035
+ e[r] = ja(s, n) ? o[s] : void 0;
1036
+ }
1037
+ return e;
1038
+ }
1039
+ var mr = sn ? function(e, t, n) {
1040
+ var r = t + "";
1041
+ return sn(e, "toString", {
1042
+ configurable: !0,
1043
+ enumerable: !1,
1044
+ value: ka(Ua(r, Ba(Pa(r), n)))
1045
+ });
1046
+ } : Ga;
1047
+ function xa(e) {
1048
+ if (e != null) {
1049
+ try {
1050
+ return fr.call(e);
1051
+ } catch {
1052
+ }
1053
+ try {
1054
+ return e + "";
1055
+ } catch {
1056
+ }
1057
+ }
1058
+ return "";
1059
+ }
1060
+ function Ba(e, t) {
1061
+ return ca(Ki, function(n) {
1062
+ var r = "_." + n[0];
1063
+ t & n[1] && !ua(e, r) && e.push(r);
1064
+ }), e.sort();
1065
+ }
1066
+ function Tt(e, t, n) {
1067
+ t = n ? void 0 : t;
1068
+ var r = Na(e, q, void 0, void 0, void 0, void 0, void 0, t);
1069
+ return r.placeholder = Tt.placeholder, r;
1070
+ }
1071
+ function $a(e) {
1072
+ var t = ee(e) ? pr.call(e) : "";
1073
+ return t == Wi || t == zi;
1074
+ }
1075
+ function ee(e) {
1076
+ var t = typeof e;
1077
+ return !!e && (t == "object" || t == "function");
1078
+ }
1079
+ function Fa(e) {
1080
+ return !!e && typeof e == "object";
1081
+ }
1082
+ function Da(e) {
1083
+ return typeof e == "symbol" || Fa(e) && pr.call(e) == Ji;
1084
+ }
1085
+ function Ma(e) {
1086
+ if (!e)
1087
+ return e === 0 ? e : 0;
1088
+ if (e = Ha(e), e === nn || e === -nn) {
1089
+ var t = e < 0 ? -1 : 1;
1090
+ return t * qi;
1091
+ }
1092
+ return e === e ? e : 0;
1093
+ }
1094
+ function cn(e) {
1095
+ var t = Ma(e), n = t % 1;
1096
+ return t === t ? n ? t - n : t : 0;
1097
+ }
1098
+ function Ha(e) {
1099
+ if (typeof e == "number")
1100
+ return e;
1101
+ if (Da(e))
1102
+ return rn;
1103
+ if (ee(e)) {
1104
+ var t = typeof e.valueOf == "function" ? e.valueOf() : e;
1105
+ e = ee(t) ? t + "" : t;
1106
+ }
1107
+ if (typeof e != "string")
1108
+ return e === 0 ? e : +e;
1109
+ e = e.replace(Xi, "");
1110
+ var n = ta.test(e);
1111
+ return n || ra.test(e) ? sa(e.slice(2), n ? 2 : 8) : ea.test(e) ? rn : +e;
1112
+ }
1113
+ function ka(e) {
1114
+ return function() {
1115
+ return e;
1116
+ };
1117
+ }
1118
+ function Ga(e) {
1119
+ return e;
1120
+ }
1121
+ Tt.placeholder = {};
1122
+ var qa = Tt;
1123
+ const Ka = /* @__PURE__ */ _t(qa), Wa = async ({
1124
+ cacheOptions: e,
1125
+ cacheConfig: t,
1126
+ apiConfig: n
1127
+ }) => {
1128
+ const r = t.useCache && !!e;
1129
+ let o = "";
1130
+ r && (o = mi(e.getKey, "")(n));
1131
+ const s = r ? await Yt(
1132
+ e.getCache,
1133
+ Promise.resolve(void 0)
1134
+ )(o) : void 0, i = r ? Yt(
1135
+ Ka(e.setCache)(o),
1136
+ Promise.resolve()
1137
+ ) : void 0;
1138
+ return {
1139
+ cacheEnabled: r,
1140
+ cacheKey: o,
1141
+ cacheResult: s,
1142
+ setCache: i
1143
+ };
1144
+ }, za = (e, t) => {
1145
+ try {
1146
+ return e();
1147
+ } catch (n) {
1148
+ return t && P(
1149
+ {
1150
+ stage: N.DEAL_ERROR_ERROR,
1151
+ data: n
1152
+ },
1153
+ M.ERROR
1154
+ ), {
1155
+ canShowErrorToast: !0,
1156
+ newError: new me({
1157
+ code: F.DEAL_ERROR,
1158
+ message: he(n) ?? "处理RequestFailResult错误时出错",
1159
+ cause: n
1160
+ }),
1161
+ reload: !1
1162
+ };
1163
+ }
1164
+ };
1165
+ class Ja {
1166
+ constructor(t) {
1167
+ Q(this, "options"), Q(this, "request", async (n, r = !1) => {
1168
+ var o;
1169
+ r && P({
1170
+ stage: N.BEFORE,
1171
+ data: n
1172
+ });
1173
+ const { uiConfig: s = {}, cacheConfig: i = {}, ...a } = n, f = en({}, this.uiConfig, s), l = en({}, this.cacheConfig, i), { cacheResult: c, setCache: p } = await Wa({
1174
+ cacheOptions: this.cacheFn,
1175
+ cacheConfig: l,
1176
+ apiConfig: n
1177
+ });
1178
+ if (c)
1179
+ return c;
1180
+ const g = {
1181
+ uiConfig: f,
1182
+ cacheConfig: l
1183
+ }, y = {
1184
+ ...a,
1185
+ BASE_PATH: this.basePath,
1186
+ TIMEOUT: this.timeout,
1187
+ debug: r
1188
+ };
1189
+ try {
1190
+ const h = await this.issue(y, g);
1191
+ return p == null || p(h, l), h;
1192
+ } catch (h) {
1193
+ const m = await za(() => {
1194
+ var d;
1195
+ return r && P({
1196
+ stage: N.DEAL_ERROR,
1197
+ data: h
1198
+ }), ((d = this.beforeError) == null ? void 0 : d.call(this, h, {
1199
+ apiConfig: n,
1200
+ extendConfig: g
1201
+ })) || {
1202
+ canShowErrorToast: !0,
1203
+ newError: h
1204
+ };
1205
+ }, r);
1206
+ if (m.reload)
1207
+ return r && P({
1208
+ stage: N.DEAL_ERROR_RESULT_RELOAD
1209
+ }), this.request(n, r);
1210
+ {
1211
+ const { newError: d, canShowErrorToast: b = !0 } = m;
1212
+ b && (f.errorToast ?? !0) && ((o = this.showToast) == null || o.call(this, d.message));
1213
+ let _;
1214
+ return d instanceof Z ? _ = d : d.isBusinessError ? _ = new Mn(d) : _ = new me(d), r && P({
1215
+ stage: N.DEAL_ERROR_RESULT_CONTINUE,
1216
+ data: _
1217
+ }), Promise.reject(_);
1218
+ }
1219
+ }
1220
+ }), this.options = t;
1221
+ }
1222
+ get basePath() {
1223
+ return this.options.basePath;
1224
+ }
1225
+ get timeout() {
1226
+ return this.options.timeout;
1227
+ }
1228
+ get uiConfig() {
1229
+ return this.options.uiConfig || {};
1230
+ }
1231
+ get cacheConfig() {
1232
+ return this.options.cacheConfig || {};
1233
+ }
1234
+ /** 缓存相关方法 */
1235
+ get cacheFn() {
1236
+ return this.options.cache;
1237
+ }
1238
+ get issue() {
1239
+ return this.options.issue;
1240
+ }
1241
+ get beforeError() {
1242
+ return this.options.beforeError;
1243
+ }
1244
+ get showToast() {
1245
+ return this.options.showToast;
1246
+ }
1247
+ }
1248
+ const Va = (e) => new Ja(e);
1249
+ var H = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
1250
+ function gr(e) {
1251
+ return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
1252
+ }
1253
+ var Xa = 200, At = "__lodash_hash_undefined__", Qa = 1 / 0, yr = 9007199254740991, Ya = "[object Arguments]", Za = "[object Function]", ec = "[object GeneratorFunction]", tc = "[object Symbol]", nc = /[\\^$.*+?()[\]{}|]/g, rc = /^\[object .+?Constructor\]$/, oc = /^(?:0|[1-9]\d*)$/, sc = typeof H == "object" && H && H.Object === Object && H, ic = typeof self == "object" && self && self.Object === Object && self, Ct = sc || ic || Function("return this")();
1254
+ function ac(e, t, n) {
1255
+ switch (n.length) {
1256
+ case 0:
1257
+ return e.call(t);
1258
+ case 1:
1259
+ return e.call(t, n[0]);
1260
+ case 2:
1261
+ return e.call(t, n[0], n[1]);
1262
+ case 3:
1263
+ return e.call(t, n[0], n[1], n[2]);
1264
+ }
1265
+ return e.apply(t, n);
1266
+ }
1267
+ function cc(e, t) {
1268
+ var n = e ? e.length : 0;
1269
+ return !!n && fc(e, t, 0) > -1;
1270
+ }
1271
+ function uc(e, t, n) {
1272
+ for (var r = -1, o = e ? e.length : 0; ++r < o; )
1273
+ if (n(t, e[r]))
1274
+ return !0;
1275
+ return !1;
1276
+ }
1277
+ function _r(e, t) {
1278
+ for (var n = -1, r = e ? e.length : 0, o = Array(r); ++n < r; )
1279
+ o[n] = t(e[n], n, e);
1280
+ return o;
1281
+ }
1282
+ function Nt(e, t) {
1283
+ for (var n = -1, r = t.length, o = e.length; ++n < r; )
1284
+ e[o + n] = t[n];
1285
+ return e;
1286
+ }
1287
+ function lc(e, t, n, r) {
1288
+ for (var o = e.length, s = n + (r ? 1 : -1); r ? s-- : ++s < o; )
1289
+ if (t(e[s], s, e))
1290
+ return s;
1291
+ return -1;
1292
+ }
1293
+ function fc(e, t, n) {
1294
+ if (t !== t)
1295
+ return lc(e, pc, n);
1296
+ for (var r = n - 1, o = e.length; ++r < o; )
1297
+ if (e[r] === t)
1298
+ return r;
1299
+ return -1;
1300
+ }
1301
+ function pc(e) {
1302
+ return e !== e;
1303
+ }
1304
+ function hc(e, t) {
1305
+ for (var n = -1, r = Array(e); ++n < e; )
1306
+ r[n] = t(n);
1307
+ return r;
1308
+ }
1309
+ function dc(e) {
1310
+ return function(t) {
1311
+ return e(t);
1312
+ };
1313
+ }
1314
+ function mc(e, t) {
1315
+ return e.has(t);
1316
+ }
1317
+ function gc(e, t) {
1318
+ return e == null ? void 0 : e[t];
1319
+ }
1320
+ function yc(e) {
1321
+ var t = !1;
1322
+ if (e != null && typeof e.toString != "function")
1323
+ try {
1324
+ t = !!(e + "");
1325
+ } catch {
1326
+ }
1327
+ return t;
1328
+ }
1329
+ function Er(e, t) {
1330
+ return function(n) {
1331
+ return e(t(n));
1332
+ };
1333
+ }
1334
+ var _c = Array.prototype, Ec = Function.prototype, ke = Object.prototype, st = Ct["__core-js_shared__"], un = function() {
1335
+ var e = /[^.]+$/.exec(st && st.keys && st.keys.IE_PROTO || "");
1336
+ return e ? "Symbol(src)_1." + e : "";
1337
+ }(), br = Ec.toString, se = ke.hasOwnProperty, Pt = ke.toString, bc = RegExp(
1338
+ "^" + br.call(se).replace(nc, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
1339
+ ), ln = Ct.Symbol, Rc = Er(Object.getPrototypeOf, Object), Sc = ke.propertyIsEnumerable, Oc = _c.splice, fn = ln ? ln.isConcatSpreadable : void 0, ft = Object.getOwnPropertySymbols, pn = Math.max, wc = Sr(Ct, "Map"), Ee = Sr(Object, "create");
1340
+ function z(e) {
1341
+ var t = -1, n = e ? e.length : 0;
1342
+ for (this.clear(); ++t < n; ) {
1343
+ var r = e[t];
1344
+ this.set(r[0], r[1]);
1345
+ }
1346
+ }
1347
+ function vc() {
1348
+ this.__data__ = Ee ? Ee(null) : {};
1349
+ }
1350
+ function Tc(e) {
1351
+ return this.has(e) && delete this.__data__[e];
1352
+ }
1353
+ function Ac(e) {
1354
+ var t = this.__data__;
1355
+ if (Ee) {
1356
+ var n = t[e];
1357
+ return n === At ? void 0 : n;
1358
+ }
1359
+ return se.call(t, e) ? t[e] : void 0;
1360
+ }
1361
+ function Cc(e) {
1362
+ var t = this.__data__;
1363
+ return Ee ? t[e] !== void 0 : se.call(t, e);
1364
+ }
1365
+ function Nc(e, t) {
1366
+ var n = this.__data__;
1367
+ return n[e] = Ee && t === void 0 ? At : t, this;
1368
+ }
1369
+ z.prototype.clear = vc;
1370
+ z.prototype.delete = Tc;
1371
+ z.prototype.get = Ac;
1372
+ z.prototype.has = Cc;
1373
+ z.prototype.set = Nc;
1374
+ function ie(e) {
1375
+ var t = -1, n = e ? e.length : 0;
1376
+ for (this.clear(); ++t < n; ) {
1377
+ var r = e[t];
1378
+ this.set(r[0], r[1]);
1379
+ }
1380
+ }
1381
+ function Pc() {
1382
+ this.__data__ = [];
1383
+ }
1384
+ function Uc(e) {
1385
+ var t = this.__data__, n = Ge(t, e);
1386
+ if (n < 0)
1387
+ return !1;
1388
+ var r = t.length - 1;
1389
+ return n == r ? t.pop() : Oc.call(t, n, 1), !0;
1390
+ }
1391
+ function jc(e) {
1392
+ var t = this.__data__, n = Ge(t, e);
1393
+ return n < 0 ? void 0 : t[n][1];
1394
+ }
1395
+ function Lc(e) {
1396
+ return Ge(this.__data__, e) > -1;
1397
+ }
1398
+ function Ic(e, t) {
1399
+ var n = this.__data__, r = Ge(n, e);
1400
+ return r < 0 ? n.push([e, t]) : n[r][1] = t, this;
1401
+ }
1402
+ ie.prototype.clear = Pc;
1403
+ ie.prototype.delete = Uc;
1404
+ ie.prototype.get = jc;
1405
+ ie.prototype.has = Lc;
1406
+ ie.prototype.set = Ic;
1407
+ function ae(e) {
1408
+ var t = -1, n = e ? e.length : 0;
1409
+ for (this.clear(); ++t < n; ) {
1410
+ var r = e[t];
1411
+ this.set(r[0], r[1]);
1412
+ }
1413
+ }
1414
+ function xc() {
1415
+ this.__data__ = {
1416
+ hash: new z(),
1417
+ map: new (wc || ie)(),
1418
+ string: new z()
1419
+ };
1420
+ }
1421
+ function Bc(e) {
1422
+ return qe(this, e).delete(e);
1423
+ }
1424
+ function $c(e) {
1425
+ return qe(this, e).get(e);
1426
+ }
1427
+ function Fc(e) {
1428
+ return qe(this, e).has(e);
1429
+ }
1430
+ function Dc(e, t) {
1431
+ return qe(this, e).set(e, t), this;
1432
+ }
1433
+ ae.prototype.clear = xc;
1434
+ ae.prototype.delete = Bc;
1435
+ ae.prototype.get = $c;
1436
+ ae.prototype.has = Fc;
1437
+ ae.prototype.set = Dc;
1438
+ function je(e) {
1439
+ var t = -1, n = e ? e.length : 0;
1440
+ for (this.__data__ = new ae(); ++t < n; )
1441
+ this.add(e[t]);
1442
+ }
1443
+ function Mc(e) {
1444
+ return this.__data__.set(e, At), this;
1445
+ }
1446
+ function Hc(e) {
1447
+ return this.__data__.has(e);
1448
+ }
1449
+ je.prototype.add = je.prototype.push = Mc;
1450
+ je.prototype.has = Hc;
1451
+ function kc(e, t) {
1452
+ var n = Ut(e) || Or(e) ? hc(e.length, String) : [], r = n.length, o = !!r;
1453
+ for (var s in e)
1454
+ (t || se.call(e, s)) && !(o && (s == "length" || eu(s, r))) && n.push(s);
1455
+ return n;
1456
+ }
1457
+ function Ge(e, t) {
1458
+ for (var n = e.length; n--; )
1459
+ if (au(e[n][0], t))
1460
+ return n;
1461
+ return -1;
1462
+ }
1463
+ function Gc(e, t, n, r) {
1464
+ var o = -1, s = cc, i = !0, a = e.length, f = [], l = t.length;
1465
+ if (!a)
1466
+ return f;
1467
+ n && (t = _r(t, dc(n))), r ? (s = uc, i = !1) : t.length >= Xa && (s = mc, i = !1, t = new je(t));
1468
+ e:
1469
+ for (; ++o < a; ) {
1470
+ var c = e[o], p = n ? n(c) : c;
1471
+ if (c = r || c !== 0 ? c : 0, i && p === p) {
1472
+ for (var g = l; g--; )
1473
+ if (t[g] === p)
1474
+ continue e;
1475
+ f.push(c);
1476
+ } else
1477
+ s(t, p, r) || f.push(c);
1478
+ }
1479
+ return f;
1480
+ }
1481
+ function Rr(e, t, n, r, o) {
1482
+ var s = -1, i = e.length;
1483
+ for (n || (n = Zc), o || (o = []); ++s < i; ) {
1484
+ var a = e[s];
1485
+ t > 0 && n(a) ? t > 1 ? Rr(a, t - 1, n, r, o) : Nt(o, a) : r || (o[o.length] = a);
1486
+ }
1487
+ return o;
1488
+ }
1489
+ function qc(e, t, n) {
1490
+ var r = t(e);
1491
+ return Ut(e) ? r : Nt(r, n(e));
1492
+ }
1493
+ function Kc(e) {
1494
+ if (!jt(e) || nu(e))
1495
+ return !1;
1496
+ var t = vr(e) || yc(e) ? bc : rc;
1497
+ return t.test(iu(e));
1498
+ }
1499
+ function Wc(e) {
1500
+ if (!jt(e))
1501
+ return ou(e);
1502
+ var t = ru(e), n = [];
1503
+ for (var r in e)
1504
+ r == "constructor" && (t || !se.call(e, r)) || n.push(r);
1505
+ return n;
1506
+ }
1507
+ function zc(e, t) {
1508
+ return e = Object(e), Jc(e, t, function(n, r) {
1509
+ return r in e;
1510
+ });
1511
+ }
1512
+ function Jc(e, t, n) {
1513
+ for (var r = -1, o = t.length, s = {}; ++r < o; ) {
1514
+ var i = t[r], a = e[i];
1515
+ n(a, i) && (s[i] = a);
1516
+ }
1517
+ return s;
1518
+ }
1519
+ function Vc(e, t) {
1520
+ return t = pn(t === void 0 ? e.length - 1 : t, 0), function() {
1521
+ for (var n = arguments, r = -1, o = pn(n.length - t, 0), s = Array(o); ++r < o; )
1522
+ s[r] = n[t + r];
1523
+ r = -1;
1524
+ for (var i = Array(t + 1); ++r < t; )
1525
+ i[r] = n[r];
1526
+ return i[t] = s, ac(e, this, i);
1527
+ };
1528
+ }
1529
+ function Xc(e) {
1530
+ return qc(e, fu, Yc);
1531
+ }
1532
+ function qe(e, t) {
1533
+ var n = e.__data__;
1534
+ return tu(t) ? n[typeof t == "string" ? "string" : "hash"] : n.map;
1535
+ }
1536
+ function Sr(e, t) {
1537
+ var n = gc(e, t);
1538
+ return Kc(n) ? n : void 0;
1539
+ }
1540
+ var Qc = ft ? Er(ft, Object) : Ar, Yc = ft ? function(e) {
1541
+ for (var t = []; e; )
1542
+ Nt(t, Qc(e)), e = Rc(e);
1543
+ return t;
1544
+ } : Ar;
1545
+ function Zc(e) {
1546
+ return Ut(e) || Or(e) || !!(fn && e && e[fn]);
1547
+ }
1548
+ function eu(e, t) {
1549
+ return t = t ?? yr, !!t && (typeof e == "number" || oc.test(e)) && e > -1 && e % 1 == 0 && e < t;
1550
+ }
1551
+ function tu(e) {
1552
+ var t = typeof e;
1553
+ return t == "string" || t == "number" || t == "symbol" || t == "boolean" ? e !== "__proto__" : e === null;
1554
+ }
1555
+ function nu(e) {
1556
+ return !!un && un in e;
1557
+ }
1558
+ function ru(e) {
1559
+ var t = e && e.constructor, n = typeof t == "function" && t.prototype || ke;
1560
+ return e === n;
1561
+ }
1562
+ function ou(e) {
1563
+ var t = [];
1564
+ if (e != null)
1565
+ for (var n in Object(e))
1566
+ t.push(n);
1567
+ return t;
1568
+ }
1569
+ function su(e) {
1570
+ if (typeof e == "string" || lu(e))
1571
+ return e;
1572
+ var t = e + "";
1573
+ return t == "0" && 1 / e == -Qa ? "-0" : t;
1574
+ }
1575
+ function iu(e) {
1576
+ if (e != null) {
1577
+ try {
1578
+ return br.call(e);
1579
+ } catch {
1580
+ }
1581
+ try {
1582
+ return e + "";
1583
+ } catch {
1584
+ }
1585
+ }
1586
+ return "";
1587
+ }
1588
+ function au(e, t) {
1589
+ return e === t || e !== e && t !== t;
1590
+ }
1591
+ function Or(e) {
1592
+ return cu(e) && se.call(e, "callee") && (!Sc.call(e, "callee") || Pt.call(e) == Ya);
1593
+ }
1594
+ var Ut = Array.isArray;
1595
+ function wr(e) {
1596
+ return e != null && uu(e.length) && !vr(e);
1597
+ }
1598
+ function cu(e) {
1599
+ return Tr(e) && wr(e);
1600
+ }
1601
+ function vr(e) {
1602
+ var t = jt(e) ? Pt.call(e) : "";
1603
+ return t == Za || t == ec;
1604
+ }
1605
+ function uu(e) {
1606
+ return typeof e == "number" && e > -1 && e % 1 == 0 && e <= yr;
1607
+ }
1608
+ function jt(e) {
1609
+ var t = typeof e;
1610
+ return !!e && (t == "object" || t == "function");
1611
+ }
1612
+ function Tr(e) {
1613
+ return !!e && typeof e == "object";
1614
+ }
1615
+ function lu(e) {
1616
+ return typeof e == "symbol" || Tr(e) && Pt.call(e) == tc;
1617
+ }
1618
+ function fu(e) {
1619
+ return wr(e) ? kc(e, !0) : Wc(e);
1620
+ }
1621
+ var pu = Vc(function(e, t) {
1622
+ return e == null ? {} : (t = _r(Rr(t, 1), su), zc(e, Gc(Xc(e), t)));
1623
+ });
1624
+ function Ar() {
1625
+ return [];
1626
+ }
1627
+ var hu = pu;
1628
+ const du = /* @__PURE__ */ gr(hu);
1629
+ var mu = "Expected a function", Cr = "__lodash_hash_undefined__", Nr = 1 / 0, gu = "[object Function]", yu = "[object GeneratorFunction]", _u = "[object Symbol]", Eu = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, bu = /^\w*$/, Ru = /^\./, Su = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, Ou = /[\\^$.*+?()[\]{}|]/g, wu = /\\(\\)?/g, vu = /^\[object .+?Constructor\]$/, Tu = typeof H == "object" && H && H.Object === Object && H, Au = typeof self == "object" && self && self.Object === Object && self, Lt = Tu || Au || Function("return this")();
1630
+ function Cu(e, t) {
1631
+ return e == null ? void 0 : e[t];
1632
+ }
1633
+ function Nu(e) {
1634
+ var t = !1;
1635
+ if (e != null && typeof e.toString != "function")
1636
+ try {
1637
+ t = !!(e + "");
1638
+ } catch {
1639
+ }
1640
+ return t;
1641
+ }
1642
+ var Pu = Array.prototype, Uu = Function.prototype, Pr = Object.prototype, it = Lt["__core-js_shared__"], hn = function() {
1643
+ var e = /[^.]+$/.exec(it && it.keys && it.keys.IE_PROTO || "");
1644
+ return e ? "Symbol(src)_1." + e : "";
1645
+ }(), Ur = Uu.toString, It = Pr.hasOwnProperty, jr = Pr.toString, ju = RegExp(
1646
+ "^" + Ur.call(It).replace(Ou, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
1647
+ ), dn = Lt.Symbol, Lu = Pu.splice, Iu = Lr(Lt, "Map"), be = Lr(Object, "create"), mn = dn ? dn.prototype : void 0, gn = mn ? mn.toString : void 0;
1648
+ function J(e) {
1649
+ var t = -1, n = e ? e.length : 0;
1650
+ for (this.clear(); ++t < n; ) {
1651
+ var r = e[t];
1652
+ this.set(r[0], r[1]);
1653
+ }
1654
+ }
1655
+ function xu() {
1656
+ this.__data__ = be ? be(null) : {};
1657
+ }
1658
+ function Bu(e) {
1659
+ return this.has(e) && delete this.__data__[e];
1660
+ }
1661
+ function $u(e) {
1662
+ var t = this.__data__;
1663
+ if (be) {
1664
+ var n = t[e];
1665
+ return n === Cr ? void 0 : n;
1666
+ }
1667
+ return It.call(t, e) ? t[e] : void 0;
1668
+ }
1669
+ function Fu(e) {
1670
+ var t = this.__data__;
1671
+ return be ? t[e] !== void 0 : It.call(t, e);
1672
+ }
1673
+ function Du(e, t) {
1674
+ var n = this.__data__;
1675
+ return n[e] = be && t === void 0 ? Cr : t, this;
1676
+ }
1677
+ J.prototype.clear = xu;
1678
+ J.prototype.delete = Bu;
1679
+ J.prototype.get = $u;
1680
+ J.prototype.has = Fu;
1681
+ J.prototype.set = Du;
1682
+ function ce(e) {
1683
+ var t = -1, n = e ? e.length : 0;
1684
+ for (this.clear(); ++t < n; ) {
1685
+ var r = e[t];
1686
+ this.set(r[0], r[1]);
1687
+ }
1688
+ }
1689
+ function Mu() {
1690
+ this.__data__ = [];
1691
+ }
1692
+ function Hu(e) {
1693
+ var t = this.__data__, n = Ke(t, e);
1694
+ if (n < 0)
1695
+ return !1;
1696
+ var r = t.length - 1;
1697
+ return n == r ? t.pop() : Lu.call(t, n, 1), !0;
1698
+ }
1699
+ function ku(e) {
1700
+ var t = this.__data__, n = Ke(t, e);
1701
+ return n < 0 ? void 0 : t[n][1];
1702
+ }
1703
+ function Gu(e) {
1704
+ return Ke(this.__data__, e) > -1;
1705
+ }
1706
+ function qu(e, t) {
1707
+ var n = this.__data__, r = Ke(n, e);
1708
+ return r < 0 ? n.push([e, t]) : n[r][1] = t, this;
1709
+ }
1710
+ ce.prototype.clear = Mu;
1711
+ ce.prototype.delete = Hu;
1712
+ ce.prototype.get = ku;
1713
+ ce.prototype.has = Gu;
1714
+ ce.prototype.set = qu;
1715
+ function X(e) {
1716
+ var t = -1, n = e ? e.length : 0;
1717
+ for (this.clear(); ++t < n; ) {
1718
+ var r = e[t];
1719
+ this.set(r[0], r[1]);
1720
+ }
1721
+ }
1722
+ function Ku() {
1723
+ this.__data__ = {
1724
+ hash: new J(),
1725
+ map: new (Iu || ce)(),
1726
+ string: new J()
1727
+ };
1728
+ }
1729
+ function Wu(e) {
1730
+ return We(this, e).delete(e);
1731
+ }
1732
+ function zu(e) {
1733
+ return We(this, e).get(e);
1734
+ }
1735
+ function Ju(e) {
1736
+ return We(this, e).has(e);
1737
+ }
1738
+ function Vu(e, t) {
1739
+ return We(this, e).set(e, t), this;
1740
+ }
1741
+ X.prototype.clear = Ku;
1742
+ X.prototype.delete = Wu;
1743
+ X.prototype.get = zu;
1744
+ X.prototype.has = Ju;
1745
+ X.prototype.set = Vu;
1746
+ function Ke(e, t) {
1747
+ for (var n = e.length; n--; )
1748
+ if (il(e[n][0], t))
1749
+ return n;
1750
+ return -1;
1751
+ }
1752
+ function Xu(e, t) {
1753
+ t = el(t, e) ? [t] : Zu(t);
1754
+ for (var n = 0, r = t.length; e != null && n < r; )
1755
+ e = e[ol(t[n++])];
1756
+ return n && n == r ? e : void 0;
1757
+ }
1758
+ function Qu(e) {
1759
+ if (!xr(e) || nl(e))
1760
+ return !1;
1761
+ var t = al(e) || Nu(e) ? ju : vu;
1762
+ return t.test(sl(e));
1763
+ }
1764
+ function Yu(e) {
1765
+ if (typeof e == "string")
1766
+ return e;
1767
+ if (Bt(e))
1768
+ return gn ? gn.call(e) : "";
1769
+ var t = e + "";
1770
+ return t == "0" && 1 / e == -Nr ? "-0" : t;
1771
+ }
1772
+ function Zu(e) {
1773
+ return Ir(e) ? e : rl(e);
1774
+ }
1775
+ function We(e, t) {
1776
+ var n = e.__data__;
1777
+ return tl(t) ? n[typeof t == "string" ? "string" : "hash"] : n.map;
1778
+ }
1779
+ function Lr(e, t) {
1780
+ var n = Cu(e, t);
1781
+ return Qu(n) ? n : void 0;
1782
+ }
1783
+ function el(e, t) {
1784
+ if (Ir(e))
1785
+ return !1;
1786
+ var n = typeof e;
1787
+ return n == "number" || n == "symbol" || n == "boolean" || e == null || Bt(e) ? !0 : bu.test(e) || !Eu.test(e) || t != null && e in Object(t);
1788
+ }
1789
+ function tl(e) {
1790
+ var t = typeof e;
1791
+ return t == "string" || t == "number" || t == "symbol" || t == "boolean" ? e !== "__proto__" : e === null;
1792
+ }
1793
+ function nl(e) {
1794
+ return !!hn && hn in e;
1795
+ }
1796
+ var rl = xt(function(e) {
1797
+ e = ul(e);
1798
+ var t = [];
1799
+ return Ru.test(e) && t.push(""), e.replace(Su, function(n, r, o, s) {
1800
+ t.push(o ? s.replace(wu, "$1") : r || n);
1801
+ }), t;
1802
+ });
1803
+ function ol(e) {
1804
+ if (typeof e == "string" || Bt(e))
1805
+ return e;
1806
+ var t = e + "";
1807
+ return t == "0" && 1 / e == -Nr ? "-0" : t;
1808
+ }
1809
+ function sl(e) {
1810
+ if (e != null) {
1811
+ try {
1812
+ return Ur.call(e);
1813
+ } catch {
1814
+ }
1815
+ try {
1816
+ return e + "";
1817
+ } catch {
1818
+ }
1819
+ }
1820
+ return "";
1821
+ }
1822
+ function xt(e, t) {
1823
+ if (typeof e != "function" || t && typeof t != "function")
1824
+ throw new TypeError(mu);
1825
+ var n = function() {
1826
+ var r = arguments, o = t ? t.apply(this, r) : r[0], s = n.cache;
1827
+ if (s.has(o))
1828
+ return s.get(o);
1829
+ var i = e.apply(this, r);
1830
+ return n.cache = s.set(o, i), i;
1831
+ };
1832
+ return n.cache = new (xt.Cache || X)(), n;
1833
+ }
1834
+ xt.Cache = X;
1835
+ function il(e, t) {
1836
+ return e === t || e !== e && t !== t;
1837
+ }
1838
+ var Ir = Array.isArray;
1839
+ function al(e) {
1840
+ var t = xr(e) ? jr.call(e) : "";
1841
+ return t == gu || t == yu;
1842
+ }
1843
+ function xr(e) {
1844
+ var t = typeof e;
1845
+ return !!e && (t == "object" || t == "function");
1846
+ }
1847
+ function cl(e) {
1848
+ return !!e && typeof e == "object";
1849
+ }
1850
+ function Bt(e) {
1851
+ return typeof e == "symbol" || cl(e) && jr.call(e) == _u;
1852
+ }
1853
+ function ul(e) {
1854
+ return e == null ? "" : Yu(e);
1855
+ }
1856
+ function ll(e, t, n) {
1857
+ var r = e == null ? void 0 : Xu(e, t);
1858
+ return r === void 0 ? n : r;
1859
+ }
1860
+ var fl = ll;
1861
+ const pl = /* @__PURE__ */ gr(fl), Br = ({
1862
+ basePath: e,
1863
+ timeout: t,
1864
+ beforeRequest: n = (f) => f,
1865
+ networkSuccessCodeList: r,
1866
+ isSuccessNetworkCode: o = (f) => Array.isArray(r) ? r.includes(f) : f >= 200 && f < 300,
1867
+ instanceCreateConfig: s = {},
1868
+ axios: i,
1869
+ ...a
1870
+ }) => {
1871
+ const f = i.create({
1872
+ baseURL: e,
1873
+ timeout: t,
1874
+ ...s,
1875
+ validateStatus: o
1876
+ });
1877
+ f.interceptors.request.use(n, (c) => {
1878
+ if (c instanceof Z)
1879
+ return Promise.reject(c);
1880
+ const p = new me({
1881
+ code: F.REQUEST_ERROR,
1882
+ message: he(c) ?? "发起请求出错",
1883
+ cause: c
1884
+ });
1885
+ return Promise.reject(p);
1886
+ });
1887
+ const { request: l } = Va({
1888
+ ...a,
1889
+ basePath: e,
1890
+ timeout: t,
1891
+ issue: ({ TIMEOUT: c, DEBUG: p, ...g }) => f({
1892
+ timeout: c,
1893
+ ...du(g, ["BASE_PATH"])
1894
+ }).then((y) => di(y, a, p)).catch((y) => {
1895
+ if (y instanceof Z)
1896
+ return p && P(
1897
+ {
1898
+ stage: N.NETWORK_ERROR_ORIGIN,
1899
+ data: y
1900
+ },
1901
+ M.ERROR
1902
+ ), Promise.reject(y);
1903
+ const { response: h, request: m } = y;
1904
+ let d, b;
1905
+ h ? (d = h.status, b = h.statusText) : m ? (d = F.NO_RESPONSE, i.isAxiosError(y) ? y.message.includes("timeout of") ? (d = F.NO_RESPONSE_TIMEOUT, b = "请求超时") : pl(globalThis, "navigator.onLine") === !1 ? (d = F.NO_RESPONSE_OFFLINE, b = "网络未连接") : b = y.message : b = he(y) ?? "未响应") : (d = F.REQUEST_ERROR, b = he(y) ?? "发起请求出错");
1906
+ const _ = new me({
1907
+ code: d,
1908
+ message: b,
1909
+ cause: y
1910
+ });
1911
+ return p && P(
1912
+ {
1913
+ stage: N.NETWORK_ERROR_PACK,
1914
+ data: _
1915
+ },
1916
+ M.ERROR
1917
+ ), Promise.reject(_);
1918
+ })
1919
+ });
1920
+ return l;
1921
+ };
1922
+ function $r(e, t) {
1923
+ return function() {
1924
+ return e.apply(t, arguments);
1925
+ };
1926
+ }
1927
+ const { toString: hl } = Object.prototype, { getPrototypeOf: $t } = Object, ze = ((e) => (t) => {
1928
+ const n = hl.call(t);
1929
+ return e[n] || (e[n] = n.slice(8, -1).toLowerCase());
1930
+ })(/* @__PURE__ */ Object.create(null)), j = (e) => (e = e.toLowerCase(), (t) => ze(t) === e), Je = (e) => (t) => typeof t === e, { isArray: ue } = Array, Re = Je("undefined");
1931
+ function dl(e) {
1932
+ return e !== null && !Re(e) && e.constructor !== null && !Re(e.constructor) && A(e.constructor.isBuffer) && e.constructor.isBuffer(e);
1933
+ }
1934
+ const Fr = j("ArrayBuffer");
1935
+ function ml(e) {
1936
+ let t;
1937
+ return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && Fr(e.buffer), t;
1938
+ }
1939
+ const gl = Je("string"), A = Je("function"), Dr = Je("number"), Ve = (e) => e !== null && typeof e == "object", yl = (e) => e === !0 || e === !1, Te = (e) => {
1940
+ if (ze(e) !== "object")
1941
+ return !1;
1942
+ const t = $t(e);
1943
+ return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(Symbol.toStringTag in e) && !(Symbol.iterator in e);
1944
+ }, _l = j("Date"), El = j("File"), bl = j("Blob"), Rl = j("FileList"), Sl = (e) => Ve(e) && A(e.pipe), Ol = (e) => {
1945
+ let t;
1946
+ return e && (typeof FormData == "function" && e instanceof FormData || A(e.append) && ((t = ze(e)) === "formdata" || // detect form-data instance
1947
+ t === "object" && A(e.toString) && e.toString() === "[object FormData]"));
1948
+ }, wl = j("URLSearchParams"), [vl, Tl, Al, Cl] = ["ReadableStream", "Request", "Response", "Headers"].map(j), Nl = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
1949
+ function we(e, t, { allOwnKeys: n = !1 } = {}) {
1950
+ if (e === null || typeof e > "u")
1951
+ return;
1952
+ let r, o;
1953
+ if (typeof e != "object" && (e = [e]), ue(e))
1954
+ for (r = 0, o = e.length; r < o; r++)
1955
+ t.call(null, e[r], r, e);
1956
+ else {
1957
+ const s = n ? Object.getOwnPropertyNames(e) : Object.keys(e), i = s.length;
1958
+ let a;
1959
+ for (r = 0; r < i; r++)
1960
+ a = s[r], t.call(null, e[a], a, e);
1961
+ }
1962
+ }
1963
+ function Mr(e, t) {
1964
+ t = t.toLowerCase();
1965
+ const n = Object.keys(e);
1966
+ let r = n.length, o;
1967
+ for (; r-- > 0; )
1968
+ if (o = n[r], t === o.toLowerCase())
1969
+ return o;
1970
+ return null;
1971
+ }
1972
+ const G = (() => typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global)(), Hr = (e) => !Re(e) && e !== G;
1973
+ function pt() {
1974
+ const { caseless: e } = Hr(this) && this || {}, t = {}, n = (r, o) => {
1975
+ const s = e && Mr(t, o) || o;
1976
+ Te(t[s]) && Te(r) ? t[s] = pt(t[s], r) : Te(r) ? t[s] = pt({}, r) : ue(r) ? t[s] = r.slice() : t[s] = r;
1977
+ };
1978
+ for (let r = 0, o = arguments.length; r < o; r++)
1979
+ arguments[r] && we(arguments[r], n);
1980
+ return t;
1981
+ }
1982
+ const Pl = (e, t, n, { allOwnKeys: r } = {}) => (we(t, (o, s) => {
1983
+ n && A(o) ? e[s] = $r(o, n) : e[s] = o;
1984
+ }, { allOwnKeys: r }), e), Ul = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), jl = (e, t, n, r) => {
1985
+ e.prototype = Object.create(t.prototype, r), e.prototype.constructor = e, Object.defineProperty(e, "super", {
1986
+ value: t.prototype
1987
+ }), n && Object.assign(e.prototype, n);
1988
+ }, Ll = (e, t, n, r) => {
1989
+ let o, s, i;
1990
+ const a = {};
1991
+ if (t = t || {}, e == null)
1992
+ return t;
1993
+ do {
1994
+ for (o = Object.getOwnPropertyNames(e), s = o.length; s-- > 0; )
1995
+ i = o[s], (!r || r(i, e, t)) && !a[i] && (t[i] = e[i], a[i] = !0);
1996
+ e = n !== !1 && $t(e);
1997
+ } while (e && (!n || n(e, t)) && e !== Object.prototype);
1998
+ return t;
1999
+ }, Il = (e, t, n) => {
2000
+ e = String(e), (n === void 0 || n > e.length) && (n = e.length), n -= t.length;
2001
+ const r = e.indexOf(t, n);
2002
+ return r !== -1 && r === n;
2003
+ }, xl = (e) => {
2004
+ if (!e)
2005
+ return null;
2006
+ if (ue(e))
2007
+ return e;
2008
+ let t = e.length;
2009
+ if (!Dr(t))
2010
+ return null;
2011
+ const n = new Array(t);
2012
+ for (; t-- > 0; )
2013
+ n[t] = e[t];
2014
+ return n;
2015
+ }, Bl = ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" && $t(Uint8Array)), $l = (e, t) => {
2016
+ const r = (e && e[Symbol.iterator]).call(e);
2017
+ let o;
2018
+ for (; (o = r.next()) && !o.done; ) {
2019
+ const s = o.value;
2020
+ t.call(e, s[0], s[1]);
2021
+ }
2022
+ }, Fl = (e, t) => {
2023
+ let n;
2024
+ const r = [];
2025
+ for (; (n = e.exec(t)) !== null; )
2026
+ r.push(n);
2027
+ return r;
2028
+ }, Dl = j("HTMLFormElement"), Ml = (e) => e.toLowerCase().replace(
2029
+ /[-_\s]([a-z\d])(\w*)/g,
2030
+ function(n, r, o) {
2031
+ return r.toUpperCase() + o;
2032
+ }
2033
+ ), yn = (({ hasOwnProperty: e }) => (t, n) => e.call(t, n))(Object.prototype), Hl = j("RegExp"), kr = (e, t) => {
2034
+ const n = Object.getOwnPropertyDescriptors(e), r = {};
2035
+ we(n, (o, s) => {
2036
+ let i;
2037
+ (i = t(o, s, e)) !== !1 && (r[s] = i || o);
2038
+ }), Object.defineProperties(e, r);
2039
+ }, kl = (e) => {
2040
+ kr(e, (t, n) => {
2041
+ if (A(e) && ["arguments", "caller", "callee"].indexOf(n) !== -1)
2042
+ return !1;
2043
+ const r = e[n];
2044
+ if (A(r)) {
2045
+ if (t.enumerable = !1, "writable" in t) {
2046
+ t.writable = !1;
2047
+ return;
2048
+ }
2049
+ t.set || (t.set = () => {
2050
+ throw Error("Can not rewrite read-only method '" + n + "'");
2051
+ });
2052
+ }
2053
+ });
2054
+ }, Gl = (e, t) => {
2055
+ const n = {}, r = (o) => {
2056
+ o.forEach((s) => {
2057
+ n[s] = !0;
2058
+ });
2059
+ };
2060
+ return ue(e) ? r(e) : r(String(e).split(t)), n;
2061
+ }, ql = () => {
2062
+ }, Kl = (e, t) => e != null && Number.isFinite(e = +e) ? e : t;
2063
+ function Wl(e) {
2064
+ return !!(e && A(e.append) && e[Symbol.toStringTag] === "FormData" && e[Symbol.iterator]);
2065
+ }
2066
+ const zl = (e) => {
2067
+ const t = new Array(10), n = (r, o) => {
2068
+ if (Ve(r)) {
2069
+ if (t.indexOf(r) >= 0)
2070
+ return;
2071
+ if (!("toJSON" in r)) {
2072
+ t[o] = r;
2073
+ const s = ue(r) ? [] : {};
2074
+ return we(r, (i, a) => {
2075
+ const f = n(i, o + 1);
2076
+ !Re(f) && (s[a] = f);
2077
+ }), t[o] = void 0, s;
2078
+ }
2079
+ }
2080
+ return r;
2081
+ };
2082
+ return n(e, 0);
2083
+ }, Jl = j("AsyncFunction"), Vl = (e) => e && (Ve(e) || A(e)) && A(e.then) && A(e.catch), Gr = ((e, t) => e ? setImmediate : t ? ((n, r) => (G.addEventListener("message", ({ source: o, data: s }) => {
2084
+ o === G && s === n && r.length && r.shift()();
2085
+ }, !1), (o) => {
2086
+ r.push(o), G.postMessage(n, "*");
2087
+ }))(`axios@${Math.random()}`, []) : (n) => setTimeout(n))(
2088
+ typeof setImmediate == "function",
2089
+ A(G.postMessage)
2090
+ ), Xl = typeof queueMicrotask < "u" ? queueMicrotask.bind(G) : typeof process < "u" && process.nextTick || Gr, u = {
2091
+ isArray: ue,
2092
+ isArrayBuffer: Fr,
2093
+ isBuffer: dl,
2094
+ isFormData: Ol,
2095
+ isArrayBufferView: ml,
2096
+ isString: gl,
2097
+ isNumber: Dr,
2098
+ isBoolean: yl,
2099
+ isObject: Ve,
2100
+ isPlainObject: Te,
2101
+ isReadableStream: vl,
2102
+ isRequest: Tl,
2103
+ isResponse: Al,
2104
+ isHeaders: Cl,
2105
+ isUndefined: Re,
2106
+ isDate: _l,
2107
+ isFile: El,
2108
+ isBlob: bl,
2109
+ isRegExp: Hl,
2110
+ isFunction: A,
2111
+ isStream: Sl,
2112
+ isURLSearchParams: wl,
2113
+ isTypedArray: Bl,
2114
+ isFileList: Rl,
2115
+ forEach: we,
2116
+ merge: pt,
2117
+ extend: Pl,
2118
+ trim: Nl,
2119
+ stripBOM: Ul,
2120
+ inherits: jl,
2121
+ toFlatObject: Ll,
2122
+ kindOf: ze,
2123
+ kindOfTest: j,
2124
+ endsWith: Il,
2125
+ toArray: xl,
2126
+ forEachEntry: $l,
2127
+ matchAll: Fl,
2128
+ isHTMLForm: Dl,
2129
+ hasOwnProperty: yn,
2130
+ hasOwnProp: yn,
2131
+ // an alias to avoid ESLint no-prototype-builtins detection
2132
+ reduceDescriptors: kr,
2133
+ freezeMethods: kl,
2134
+ toObjectSet: Gl,
2135
+ toCamelCase: Ml,
2136
+ noop: ql,
2137
+ toFiniteNumber: Kl,
2138
+ findKey: Mr,
2139
+ global: G,
2140
+ isContextDefined: Hr,
2141
+ isSpecCompliantForm: Wl,
2142
+ toJSONObject: zl,
2143
+ isAsyncFn: Jl,
2144
+ isThenable: Vl,
2145
+ setImmediate: Gr,
2146
+ asap: Xl
2147
+ };
2148
+ function E(e, t, n, r, o) {
2149
+ 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), o && (this.response = o, this.status = o.status ? o.status : null);
2150
+ }
2151
+ u.inherits(E, Error, {
2152
+ toJSON: function() {
2153
+ return {
2154
+ // Standard
2155
+ message: this.message,
2156
+ name: this.name,
2157
+ // Microsoft
2158
+ description: this.description,
2159
+ number: this.number,
2160
+ // Mozilla
2161
+ fileName: this.fileName,
2162
+ lineNumber: this.lineNumber,
2163
+ columnNumber: this.columnNumber,
2164
+ stack: this.stack,
2165
+ // Axios
2166
+ config: u.toJSONObject(this.config),
2167
+ code: this.code,
2168
+ status: this.status
2169
+ };
2170
+ }
2171
+ });
2172
+ const qr = E.prototype, Kr = {};
2173
+ [
2174
+ "ERR_BAD_OPTION_VALUE",
2175
+ "ERR_BAD_OPTION",
2176
+ "ECONNABORTED",
2177
+ "ETIMEDOUT",
2178
+ "ERR_NETWORK",
2179
+ "ERR_FR_TOO_MANY_REDIRECTS",
2180
+ "ERR_DEPRECATED",
2181
+ "ERR_BAD_RESPONSE",
2182
+ "ERR_BAD_REQUEST",
2183
+ "ERR_CANCELED",
2184
+ "ERR_NOT_SUPPORT",
2185
+ "ERR_INVALID_URL"
2186
+ // eslint-disable-next-line func-names
2187
+ ].forEach((e) => {
2188
+ Kr[e] = { value: e };
2189
+ });
2190
+ Object.defineProperties(E, Kr);
2191
+ Object.defineProperty(qr, "isAxiosError", { value: !0 });
2192
+ E.from = (e, t, n, r, o, s) => {
2193
+ const i = Object.create(qr);
2194
+ return u.toFlatObject(e, i, function(f) {
2195
+ return f !== Error.prototype;
2196
+ }, (a) => a !== "isAxiosError"), E.call(i, e.message, t, n, r, o), i.cause = e, i.name = e.name, s && Object.assign(i, s), i;
2197
+ };
2198
+ const Ql = null;
2199
+ function ht(e) {
2200
+ return u.isPlainObject(e) || u.isArray(e);
2201
+ }
2202
+ function Wr(e) {
2203
+ return u.endsWith(e, "[]") ? e.slice(0, -2) : e;
2204
+ }
2205
+ function _n(e, t, n) {
2206
+ return e ? e.concat(t).map(function(o, s) {
2207
+ return o = Wr(o), !n && s ? "[" + o + "]" : o;
2208
+ }).join(n ? "." : "") : t;
2209
+ }
2210
+ function Yl(e) {
2211
+ return u.isArray(e) && !e.some(ht);
2212
+ }
2213
+ const Zl = u.toFlatObject(u, {}, null, function(t) {
2214
+ return /^is[A-Z]/.test(t);
2215
+ });
2216
+ function Xe(e, t, n) {
2217
+ if (!u.isObject(e))
2218
+ throw new TypeError("target must be an object");
2219
+ t = t || new FormData(), n = u.toFlatObject(n, {
2220
+ metaTokens: !0,
2221
+ dots: !1,
2222
+ indexes: !1
2223
+ }, !1, function(m, d) {
2224
+ return !u.isUndefined(d[m]);
2225
+ });
2226
+ const r = n.metaTokens, o = n.visitor || c, s = n.dots, i = n.indexes, f = (n.Blob || typeof Blob < "u" && Blob) && u.isSpecCompliantForm(t);
2227
+ if (!u.isFunction(o))
2228
+ throw new TypeError("visitor must be a function");
2229
+ function l(h) {
2230
+ if (h === null)
2231
+ return "";
2232
+ if (u.isDate(h))
2233
+ return h.toISOString();
2234
+ if (!f && u.isBlob(h))
2235
+ throw new E("Blob is not supported. Use a Buffer instead.");
2236
+ return u.isArrayBuffer(h) || u.isTypedArray(h) ? f && typeof Blob == "function" ? new Blob([h]) : Buffer.from(h) : h;
2237
+ }
2238
+ function c(h, m, d) {
2239
+ let b = h;
2240
+ if (h && !d && typeof h == "object") {
2241
+ if (u.endsWith(m, "{}"))
2242
+ m = r ? m : m.slice(0, -2), h = JSON.stringify(h);
2243
+ else if (u.isArray(h) && Yl(h) || (u.isFileList(h) || u.endsWith(m, "[]")) && (b = u.toArray(h)))
2244
+ return m = Wr(m), b.forEach(function(O, C) {
2245
+ !(u.isUndefined(O) || O === null) && t.append(
2246
+ // eslint-disable-next-line no-nested-ternary
2247
+ i === !0 ? _n([m], C, s) : i === null ? m : m + "[]",
2248
+ l(O)
2249
+ );
2250
+ }), !1;
2251
+ }
2252
+ return ht(h) ? !0 : (t.append(_n(d, m, s), l(h)), !1);
2253
+ }
2254
+ const p = [], g = Object.assign(Zl, {
2255
+ defaultVisitor: c,
2256
+ convertValue: l,
2257
+ isVisitable: ht
2258
+ });
2259
+ function y(h, m) {
2260
+ if (!u.isUndefined(h)) {
2261
+ if (p.indexOf(h) !== -1)
2262
+ throw Error("Circular reference detected in " + m.join("."));
2263
+ p.push(h), u.forEach(h, function(b, _) {
2264
+ (!(u.isUndefined(b) || b === null) && o.call(
2265
+ t,
2266
+ b,
2267
+ u.isString(_) ? _.trim() : _,
2268
+ m,
2269
+ g
2270
+ )) === !0 && y(b, m ? m.concat(_) : [_]);
2271
+ }), p.pop();
2272
+ }
2273
+ }
2274
+ if (!u.isObject(e))
2275
+ throw new TypeError("data must be an object");
2276
+ return y(e), t;
2277
+ }
2278
+ function En(e) {
2279
+ const t = {
2280
+ "!": "%21",
2281
+ "'": "%27",
2282
+ "(": "%28",
2283
+ ")": "%29",
2284
+ "~": "%7E",
2285
+ "%20": "+",
2286
+ "%00": "\0"
2287
+ };
2288
+ return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g, function(r) {
2289
+ return t[r];
2290
+ });
2291
+ }
2292
+ function Ft(e, t) {
2293
+ this._pairs = [], e && Xe(e, this, t);
2294
+ }
2295
+ const zr = Ft.prototype;
2296
+ zr.append = function(t, n) {
2297
+ this._pairs.push([t, n]);
2298
+ };
2299
+ zr.toString = function(t) {
2300
+ const n = t ? function(r) {
2301
+ return t.call(this, r, En);
2302
+ } : En;
2303
+ return this._pairs.map(function(o) {
2304
+ return n(o[0]) + "=" + n(o[1]);
2305
+ }, "").join("&");
2306
+ };
2307
+ function ef(e) {
2308
+ return encodeURIComponent(e).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
2309
+ }
2310
+ function Jr(e, t, n) {
2311
+ if (!t)
2312
+ return e;
2313
+ const r = n && n.encode || ef;
2314
+ u.isFunction(n) && (n = {
2315
+ serialize: n
2316
+ });
2317
+ const o = n && n.serialize;
2318
+ let s;
2319
+ if (o ? s = o(t, n) : s = u.isURLSearchParams(t) ? t.toString() : new Ft(t, n).toString(r), s) {
2320
+ const i = e.indexOf("#");
2321
+ i !== -1 && (e = e.slice(0, i)), e += (e.indexOf("?") === -1 ? "?" : "&") + s;
2322
+ }
2323
+ return e;
2324
+ }
2325
+ class tf {
2326
+ constructor() {
2327
+ this.handlers = [];
2328
+ }
2329
+ /**
2330
+ * Add a new interceptor to the stack
2331
+ *
2332
+ * @param {Function} fulfilled The function to handle `then` for a `Promise`
2333
+ * @param {Function} rejected The function to handle `reject` for a `Promise`
2334
+ *
2335
+ * @return {Number} An ID used to remove interceptor later
2336
+ */
2337
+ use(t, n, r) {
2338
+ return this.handlers.push({
2339
+ fulfilled: t,
2340
+ rejected: n,
2341
+ synchronous: r ? r.synchronous : !1,
2342
+ runWhen: r ? r.runWhen : null
2343
+ }), this.handlers.length - 1;
2344
+ }
2345
+ /**
2346
+ * Remove an interceptor from the stack
2347
+ *
2348
+ * @param {Number} id The ID that was returned by `use`
2349
+ *
2350
+ * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise
2351
+ */
2352
+ eject(t) {
2353
+ this.handlers[t] && (this.handlers[t] = null);
2354
+ }
2355
+ /**
2356
+ * Clear all interceptors from the stack
2357
+ *
2358
+ * @returns {void}
2359
+ */
2360
+ clear() {
2361
+ this.handlers && (this.handlers = []);
2362
+ }
2363
+ /**
2364
+ * Iterate over all the registered interceptors
2365
+ *
2366
+ * This method is particularly useful for skipping over any
2367
+ * interceptors that may have become `null` calling `eject`.
2368
+ *
2369
+ * @param {Function} fn The function to call for each interceptor
2370
+ *
2371
+ * @returns {void}
2372
+ */
2373
+ forEach(t) {
2374
+ u.forEach(this.handlers, function(r) {
2375
+ r !== null && t(r);
2376
+ });
2377
+ }
2378
+ }
2379
+ const bn = tf, Vr = {
2380
+ silentJSONParsing: !0,
2381
+ forcedJSONParsing: !0,
2382
+ clarifyTimeoutError: !1
2383
+ }, nf = typeof URLSearchParams < "u" ? URLSearchParams : Ft, rf = typeof FormData < "u" ? FormData : null, of = typeof Blob < "u" ? Blob : null, sf = {
2384
+ isBrowser: !0,
2385
+ classes: {
2386
+ URLSearchParams: nf,
2387
+ FormData: rf,
2388
+ Blob: of
2389
+ },
2390
+ protocols: ["http", "https", "file", "blob", "url", "data"]
2391
+ }, Dt = typeof window < "u" && typeof document < "u", dt = typeof navigator == "object" && navigator || void 0, af = Dt && (!dt || ["ReactNative", "NativeScript", "NS"].indexOf(dt.product) < 0), cf = (() => typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
2392
+ self instanceof WorkerGlobalScope && typeof self.importScripts == "function")(), uf = Dt && window.location.href || "http://localhost", lf = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2393
+ __proto__: null,
2394
+ hasBrowserEnv: Dt,
2395
+ hasStandardBrowserEnv: af,
2396
+ hasStandardBrowserWebWorkerEnv: cf,
2397
+ navigator: dt,
2398
+ origin: uf
2399
+ }, Symbol.toStringTag, { value: "Module" })), T = {
2400
+ ...lf,
2401
+ ...sf
2402
+ };
2403
+ function ff(e, t) {
2404
+ return Xe(e, new T.classes.URLSearchParams(), Object.assign({
2405
+ visitor: function(n, r, o, s) {
2406
+ return T.isNode && u.isBuffer(n) ? (this.append(r, n.toString("base64")), !1) : s.defaultVisitor.apply(this, arguments);
2407
+ }
2408
+ }, t));
2409
+ }
2410
+ function pf(e) {
2411
+ return u.matchAll(/\w+|\[(\w*)]/g, e).map((t) => t[0] === "[]" ? "" : t[1] || t[0]);
2412
+ }
2413
+ function hf(e) {
2414
+ const t = {}, n = Object.keys(e);
2415
+ let r;
2416
+ const o = n.length;
2417
+ let s;
2418
+ for (r = 0; r < o; r++)
2419
+ s = n[r], t[s] = e[s];
2420
+ return t;
2421
+ }
2422
+ function Xr(e) {
2423
+ function t(n, r, o, s) {
2424
+ let i = n[s++];
2425
+ if (i === "__proto__")
2426
+ return !0;
2427
+ const a = Number.isFinite(+i), f = s >= n.length;
2428
+ return i = !i && u.isArray(o) ? o.length : i, f ? (u.hasOwnProp(o, i) ? o[i] = [o[i], r] : o[i] = r, !a) : ((!o[i] || !u.isObject(o[i])) && (o[i] = []), t(n, r, o[i], s) && u.isArray(o[i]) && (o[i] = hf(o[i])), !a);
2429
+ }
2430
+ if (u.isFormData(e) && u.isFunction(e.entries)) {
2431
+ const n = {};
2432
+ return u.forEachEntry(e, (r, o) => {
2433
+ t(pf(r), o, n, 0);
2434
+ }), n;
2435
+ }
2436
+ return null;
2437
+ }
2438
+ function df(e, t, n) {
2439
+ if (u.isString(e))
2440
+ try {
2441
+ return (t || JSON.parse)(e), u.trim(e);
2442
+ } catch (r) {
2443
+ if (r.name !== "SyntaxError")
2444
+ throw r;
2445
+ }
2446
+ return (n || JSON.stringify)(e);
2447
+ }
2448
+ const Mt = {
2449
+ transitional: Vr,
2450
+ adapter: ["xhr", "http", "fetch"],
2451
+ transformRequest: [function(t, n) {
2452
+ const r = n.getContentType() || "", o = r.indexOf("application/json") > -1, s = u.isObject(t);
2453
+ if (s && u.isHTMLForm(t) && (t = new FormData(t)), u.isFormData(t))
2454
+ return o ? JSON.stringify(Xr(t)) : t;
2455
+ if (u.isArrayBuffer(t) || u.isBuffer(t) || u.isStream(t) || u.isFile(t) || u.isBlob(t) || u.isReadableStream(t))
2456
+ return t;
2457
+ if (u.isArrayBufferView(t))
2458
+ return t.buffer;
2459
+ if (u.isURLSearchParams(t))
2460
+ return n.setContentType("application/x-www-form-urlencoded;charset=utf-8", !1), t.toString();
2461
+ let a;
2462
+ if (s) {
2463
+ if (r.indexOf("application/x-www-form-urlencoded") > -1)
2464
+ return ff(t, this.formSerializer).toString();
2465
+ if ((a = u.isFileList(t)) || r.indexOf("multipart/form-data") > -1) {
2466
+ const f = this.env && this.env.FormData;
2467
+ return Xe(
2468
+ a ? { "files[]": t } : t,
2469
+ f && new f(),
2470
+ this.formSerializer
2471
+ );
2472
+ }
2473
+ }
2474
+ return s || o ? (n.setContentType("application/json", !1), df(t)) : t;
2475
+ }],
2476
+ transformResponse: [function(t) {
2477
+ const n = this.transitional || Mt.transitional, r = n && n.forcedJSONParsing, o = this.responseType === "json";
2478
+ if (u.isResponse(t) || u.isReadableStream(t))
2479
+ return t;
2480
+ if (t && u.isString(t) && (r && !this.responseType || o)) {
2481
+ const i = !(n && n.silentJSONParsing) && o;
2482
+ try {
2483
+ return JSON.parse(t);
2484
+ } catch (a) {
2485
+ if (i)
2486
+ throw a.name === "SyntaxError" ? E.from(a, E.ERR_BAD_RESPONSE, this, null, this.response) : a;
2487
+ }
2488
+ }
2489
+ return t;
2490
+ }],
2491
+ /**
2492
+ * A timeout in milliseconds to abort a request. If set to 0 (default) a
2493
+ * timeout is not created.
2494
+ */
2495
+ timeout: 0,
2496
+ xsrfCookieName: "XSRF-TOKEN",
2497
+ xsrfHeaderName: "X-XSRF-TOKEN",
2498
+ maxContentLength: -1,
2499
+ maxBodyLength: -1,
2500
+ env: {
2501
+ FormData: T.classes.FormData,
2502
+ Blob: T.classes.Blob
2503
+ },
2504
+ validateStatus: function(t) {
2505
+ return t >= 200 && t < 300;
2506
+ },
2507
+ headers: {
2508
+ common: {
2509
+ Accept: "application/json, text/plain, */*",
2510
+ "Content-Type": void 0
2511
+ }
2512
+ }
2513
+ };
2514
+ u.forEach(["delete", "get", "head", "post", "put", "patch"], (e) => {
2515
+ Mt.headers[e] = {};
2516
+ });
2517
+ const Ht = Mt, mf = u.toObjectSet([
2518
+ "age",
2519
+ "authorization",
2520
+ "content-length",
2521
+ "content-type",
2522
+ "etag",
2523
+ "expires",
2524
+ "from",
2525
+ "host",
2526
+ "if-modified-since",
2527
+ "if-unmodified-since",
2528
+ "last-modified",
2529
+ "location",
2530
+ "max-forwards",
2531
+ "proxy-authorization",
2532
+ "referer",
2533
+ "retry-after",
2534
+ "user-agent"
2535
+ ]), gf = (e) => {
2536
+ const t = {};
2537
+ let n, r, o;
2538
+ return e && e.split(`
2539
+ `).forEach(function(i) {
2540
+ o = i.indexOf(":"), n = i.substring(0, o).trim().toLowerCase(), r = i.substring(o + 1).trim(), !(!n || t[n] && mf[n]) && (n === "set-cookie" ? t[n] ? t[n].push(r) : t[n] = [r] : t[n] = t[n] ? t[n] + ", " + r : r);
2541
+ }), t;
2542
+ }, Rn = Symbol("internals");
2543
+ function fe(e) {
2544
+ return e && String(e).trim().toLowerCase();
2545
+ }
2546
+ function Ae(e) {
2547
+ return e === !1 || e == null ? e : u.isArray(e) ? e.map(Ae) : String(e);
2548
+ }
2549
+ function yf(e) {
2550
+ const t = /* @__PURE__ */ Object.create(null), n = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
2551
+ let r;
2552
+ for (; r = n.exec(e); )
2553
+ t[r[1]] = r[2];
2554
+ return t;
2555
+ }
2556
+ const _f = (e) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());
2557
+ function at(e, t, n, r, o) {
2558
+ if (u.isFunction(r))
2559
+ return r.call(this, t, n);
2560
+ if (o && (t = n), !!u.isString(t)) {
2561
+ if (u.isString(r))
2562
+ return t.indexOf(r) !== -1;
2563
+ if (u.isRegExp(r))
2564
+ return r.test(t);
2565
+ }
2566
+ }
2567
+ function Ef(e) {
2568
+ return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (t, n, r) => n.toUpperCase() + r);
2569
+ }
2570
+ function bf(e, t) {
2571
+ const n = u.toCamelCase(" " + t);
2572
+ ["get", "set", "has"].forEach((r) => {
2573
+ Object.defineProperty(e, r + n, {
2574
+ value: function(o, s, i) {
2575
+ return this[r].call(this, t, o, s, i);
2576
+ },
2577
+ configurable: !0
2578
+ });
2579
+ });
2580
+ }
2581
+ class Qe {
2582
+ constructor(t) {
2583
+ t && this.set(t);
2584
+ }
2585
+ set(t, n, r) {
2586
+ const o = this;
2587
+ function s(a, f, l) {
2588
+ const c = fe(f);
2589
+ if (!c)
2590
+ throw new Error("header name must be a non-empty string");
2591
+ const p = u.findKey(o, c);
2592
+ (!p || o[p] === void 0 || l === !0 || l === void 0 && o[p] !== !1) && (o[p || f] = Ae(a));
2593
+ }
2594
+ const i = (a, f) => u.forEach(a, (l, c) => s(l, c, f));
2595
+ if (u.isPlainObject(t) || t instanceof this.constructor)
2596
+ i(t, n);
2597
+ else if (u.isString(t) && (t = t.trim()) && !_f(t))
2598
+ i(gf(t), n);
2599
+ else if (u.isHeaders(t))
2600
+ for (const [a, f] of t.entries())
2601
+ s(f, a, r);
2602
+ else
2603
+ t != null && s(n, t, r);
2604
+ return this;
2605
+ }
2606
+ get(t, n) {
2607
+ if (t = fe(t), t) {
2608
+ const r = u.findKey(this, t);
2609
+ if (r) {
2610
+ const o = this[r];
2611
+ if (!n)
2612
+ return o;
2613
+ if (n === !0)
2614
+ return yf(o);
2615
+ if (u.isFunction(n))
2616
+ return n.call(this, o, r);
2617
+ if (u.isRegExp(n))
2618
+ return n.exec(o);
2619
+ throw new TypeError("parser must be boolean|regexp|function");
2620
+ }
2621
+ }
2622
+ }
2623
+ has(t, n) {
2624
+ if (t = fe(t), t) {
2625
+ const r = u.findKey(this, t);
2626
+ return !!(r && this[r] !== void 0 && (!n || at(this, this[r], r, n)));
2627
+ }
2628
+ return !1;
2629
+ }
2630
+ delete(t, n) {
2631
+ const r = this;
2632
+ let o = !1;
2633
+ function s(i) {
2634
+ if (i = fe(i), i) {
2635
+ const a = u.findKey(r, i);
2636
+ a && (!n || at(r, r[a], a, n)) && (delete r[a], o = !0);
2637
+ }
2638
+ }
2639
+ return u.isArray(t) ? t.forEach(s) : s(t), o;
2640
+ }
2641
+ clear(t) {
2642
+ const n = Object.keys(this);
2643
+ let r = n.length, o = !1;
2644
+ for (; r--; ) {
2645
+ const s = n[r];
2646
+ (!t || at(this, this[s], s, t, !0)) && (delete this[s], o = !0);
2647
+ }
2648
+ return o;
2649
+ }
2650
+ normalize(t) {
2651
+ const n = this, r = {};
2652
+ return u.forEach(this, (o, s) => {
2653
+ const i = u.findKey(r, s);
2654
+ if (i) {
2655
+ n[i] = Ae(o), delete n[s];
2656
+ return;
2657
+ }
2658
+ const a = t ? Ef(s) : String(s).trim();
2659
+ a !== s && delete n[s], n[a] = Ae(o), r[a] = !0;
2660
+ }), this;
2661
+ }
2662
+ concat(...t) {
2663
+ return this.constructor.concat(this, ...t);
2664
+ }
2665
+ toJSON(t) {
2666
+ const n = /* @__PURE__ */ Object.create(null);
2667
+ return u.forEach(this, (r, o) => {
2668
+ r != null && r !== !1 && (n[o] = t && u.isArray(r) ? r.join(", ") : r);
2669
+ }), n;
2670
+ }
2671
+ [Symbol.iterator]() {
2672
+ return Object.entries(this.toJSON())[Symbol.iterator]();
2673
+ }
2674
+ toString() {
2675
+ return Object.entries(this.toJSON()).map(([t, n]) => t + ": " + n).join(`
2676
+ `);
2677
+ }
2678
+ get [Symbol.toStringTag]() {
2679
+ return "AxiosHeaders";
2680
+ }
2681
+ static from(t) {
2682
+ return t instanceof this ? t : new this(t);
2683
+ }
2684
+ static concat(t, ...n) {
2685
+ const r = new this(t);
2686
+ return n.forEach((o) => r.set(o)), r;
2687
+ }
2688
+ static accessor(t) {
2689
+ const r = (this[Rn] = this[Rn] = {
2690
+ accessors: {}
2691
+ }).accessors, o = this.prototype;
2692
+ function s(i) {
2693
+ const a = fe(i);
2694
+ r[a] || (bf(o, i), r[a] = !0);
2695
+ }
2696
+ return u.isArray(t) ? t.forEach(s) : s(t), this;
2697
+ }
2698
+ }
2699
+ Qe.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
2700
+ u.reduceDescriptors(Qe.prototype, ({ value: e }, t) => {
2701
+ let n = t[0].toUpperCase() + t.slice(1);
2702
+ return {
2703
+ get: () => e,
2704
+ set(r) {
2705
+ this[n] = r;
2706
+ }
2707
+ };
2708
+ });
2709
+ u.freezeMethods(Qe);
2710
+ const U = Qe;
2711
+ function ct(e, t) {
2712
+ const n = this || Ht, r = t || n, o = U.from(r.headers);
2713
+ let s = r.data;
2714
+ return u.forEach(e, function(a) {
2715
+ s = a.call(n, s, o.normalize(), t ? t.status : void 0);
2716
+ }), o.normalize(), s;
2717
+ }
2718
+ function Qr(e) {
2719
+ return !!(e && e.__CANCEL__);
2720
+ }
2721
+ function le(e, t, n) {
2722
+ E.call(this, e ?? "canceled", E.ERR_CANCELED, t, n), this.name = "CanceledError";
2723
+ }
2724
+ u.inherits(le, E, {
2725
+ __CANCEL__: !0
2726
+ });
2727
+ function Yr(e, t, n) {
2728
+ const r = n.config.validateStatus;
2729
+ !n.status || !r || r(n.status) ? e(n) : t(new E(
2730
+ "Request failed with status code " + n.status,
2731
+ [E.ERR_BAD_REQUEST, E.ERR_BAD_RESPONSE][Math.floor(n.status / 100) - 4],
2732
+ n.config,
2733
+ n.request,
2734
+ n
2735
+ ));
2736
+ }
2737
+ function Rf(e) {
2738
+ const t = /^([-+\w]{1,25})(:?\/\/|:)/.exec(e);
2739
+ return t && t[1] || "";
2740
+ }
2741
+ function Sf(e, t) {
2742
+ e = e || 10;
2743
+ const n = new Array(e), r = new Array(e);
2744
+ let o = 0, s = 0, i;
2745
+ return t = t !== void 0 ? t : 1e3, function(f) {
2746
+ const l = Date.now(), c = r[s];
2747
+ i || (i = l), n[o] = f, r[o] = l;
2748
+ let p = s, g = 0;
2749
+ for (; p !== o; )
2750
+ g += n[p++], p = p % e;
2751
+ if (o = (o + 1) % e, o === s && (s = (s + 1) % e), l - i < t)
2752
+ return;
2753
+ const y = c && l - c;
2754
+ return y ? Math.round(g * 1e3 / y) : void 0;
2755
+ };
2756
+ }
2757
+ function Of(e, t) {
2758
+ let n = 0, r = 1e3 / t, o, s;
2759
+ const i = (l, c = Date.now()) => {
2760
+ n = c, o = null, s && (clearTimeout(s), s = null), e.apply(null, l);
2761
+ };
2762
+ return [(...l) => {
2763
+ const c = Date.now(), p = c - n;
2764
+ p >= r ? i(l, c) : (o = l, s || (s = setTimeout(() => {
2765
+ s = null, i(o);
2766
+ }, r - p)));
2767
+ }, () => o && i(o)];
2768
+ }
2769
+ const Le = (e, t, n = 3) => {
2770
+ let r = 0;
2771
+ const o = Sf(50, 250);
2772
+ return Of((s) => {
2773
+ const i = s.loaded, a = s.lengthComputable ? s.total : void 0, f = i - r, l = o(f), c = i <= a;
2774
+ r = i;
2775
+ const p = {
2776
+ loaded: i,
2777
+ total: a,
2778
+ progress: a ? i / a : void 0,
2779
+ bytes: f,
2780
+ rate: l || void 0,
2781
+ estimated: l && a && c ? (a - i) / l : void 0,
2782
+ event: s,
2783
+ lengthComputable: a != null,
2784
+ [t ? "download" : "upload"]: !0
2785
+ };
2786
+ e(p);
2787
+ }, n);
2788
+ }, Sn = (e, t) => {
2789
+ const n = e != null;
2790
+ return [(r) => t[0]({
2791
+ lengthComputable: n,
2792
+ total: e,
2793
+ loaded: r
2794
+ }), t[1]];
2795
+ }, On = (e) => (...t) => u.asap(() => e(...t)), wf = T.hasStandardBrowserEnv ? ((e, t) => (n) => (n = new URL(n, T.origin), e.protocol === n.protocol && e.host === n.host && (t || e.port === n.port)))(
2796
+ new URL(T.origin),
2797
+ T.navigator && /(msie|trident)/i.test(T.navigator.userAgent)
2798
+ ) : () => !0, vf = T.hasStandardBrowserEnv ? (
2799
+ // Standard browser envs support document.cookie
2800
+ {
2801
+ write(e, t, n, r, o, s) {
2802
+ const i = [e + "=" + encodeURIComponent(t)];
2803
+ u.isNumber(n) && i.push("expires=" + new Date(n).toGMTString()), u.isString(r) && i.push("path=" + r), u.isString(o) && i.push("domain=" + o), s === !0 && i.push("secure"), document.cookie = i.join("; ");
2804
+ },
2805
+ read(e) {
2806
+ const t = document.cookie.match(new RegExp("(^|;\\s*)(" + e + ")=([^;]*)"));
2807
+ return t ? decodeURIComponent(t[3]) : null;
2808
+ },
2809
+ remove(e) {
2810
+ this.write(e, "", Date.now() - 864e5);
2811
+ }
2812
+ }
2813
+ ) : (
2814
+ // Non-standard browser env (web workers, react-native) lack needed support.
2815
+ {
2816
+ write() {
2817
+ },
2818
+ read() {
2819
+ return null;
2820
+ },
2821
+ remove() {
2822
+ }
2823
+ }
2824
+ );
2825
+ function Tf(e) {
2826
+ return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(e);
2827
+ }
2828
+ function Af(e, t) {
2829
+ return t ? e.replace(/\/?\/$/, "") + "/" + t.replace(/^\/+/, "") : e;
2830
+ }
2831
+ function Zr(e, t, n) {
2832
+ let r = !Tf(t);
2833
+ return e && (r || n == !1) ? Af(e, t) : t;
2834
+ }
2835
+ const wn = (e) => e instanceof U ? { ...e } : e;
2836
+ function V(e, t) {
2837
+ t = t || {};
2838
+ const n = {};
2839
+ function r(l, c, p, g) {
2840
+ return u.isPlainObject(l) && u.isPlainObject(c) ? u.merge.call({ caseless: g }, l, c) : u.isPlainObject(c) ? u.merge({}, c) : u.isArray(c) ? c.slice() : c;
2841
+ }
2842
+ function o(l, c, p, g) {
2843
+ if (u.isUndefined(c)) {
2844
+ if (!u.isUndefined(l))
2845
+ return r(void 0, l, p, g);
2846
+ } else
2847
+ return r(l, c, p, g);
2848
+ }
2849
+ function s(l, c) {
2850
+ if (!u.isUndefined(c))
2851
+ return r(void 0, c);
2852
+ }
2853
+ function i(l, c) {
2854
+ if (u.isUndefined(c)) {
2855
+ if (!u.isUndefined(l))
2856
+ return r(void 0, l);
2857
+ } else
2858
+ return r(void 0, c);
2859
+ }
2860
+ function a(l, c, p) {
2861
+ if (p in t)
2862
+ return r(l, c);
2863
+ if (p in e)
2864
+ return r(void 0, l);
2865
+ }
2866
+ const f = {
2867
+ url: s,
2868
+ method: s,
2869
+ data: s,
2870
+ baseURL: i,
2871
+ transformRequest: i,
2872
+ transformResponse: i,
2873
+ paramsSerializer: i,
2874
+ timeout: i,
2875
+ timeoutMessage: i,
2876
+ withCredentials: i,
2877
+ withXSRFToken: i,
2878
+ adapter: i,
2879
+ responseType: i,
2880
+ xsrfCookieName: i,
2881
+ xsrfHeaderName: i,
2882
+ onUploadProgress: i,
2883
+ onDownloadProgress: i,
2884
+ decompress: i,
2885
+ maxContentLength: i,
2886
+ maxBodyLength: i,
2887
+ beforeRedirect: i,
2888
+ transport: i,
2889
+ httpAgent: i,
2890
+ httpsAgent: i,
2891
+ cancelToken: i,
2892
+ socketPath: i,
2893
+ responseEncoding: i,
2894
+ validateStatus: a,
2895
+ headers: (l, c, p) => o(wn(l), wn(c), p, !0)
2896
+ };
2897
+ return u.forEach(Object.keys(Object.assign({}, e, t)), function(c) {
2898
+ const p = f[c] || o, g = p(e[c], t[c], c);
2899
+ u.isUndefined(g) && p !== a || (n[c] = g);
2900
+ }), n;
2901
+ }
2902
+ const eo = (e) => {
2903
+ const t = V({}, e);
2904
+ let { data: n, withXSRFToken: r, xsrfHeaderName: o, xsrfCookieName: s, headers: i, auth: a } = t;
2905
+ t.headers = i = U.from(i), t.url = Jr(Zr(t.baseURL, t.url, t.allowAbsoluteUrls), e.params, e.paramsSerializer), a && i.set(
2906
+ "Authorization",
2907
+ "Basic " + btoa((a.username || "") + ":" + (a.password ? unescape(encodeURIComponent(a.password)) : ""))
2908
+ );
2909
+ let f;
2910
+ if (u.isFormData(n)) {
2911
+ if (T.hasStandardBrowserEnv || T.hasStandardBrowserWebWorkerEnv)
2912
+ i.setContentType(void 0);
2913
+ else if ((f = i.getContentType()) !== !1) {
2914
+ const [l, ...c] = f ? f.split(";").map((p) => p.trim()).filter(Boolean) : [];
2915
+ i.setContentType([l || "multipart/form-data", ...c].join("; "));
2916
+ }
2917
+ }
2918
+ if (T.hasStandardBrowserEnv && (r && u.isFunction(r) && (r = r(t)), r || r !== !1 && wf(t.url))) {
2919
+ const l = o && s && vf.read(s);
2920
+ l && i.set(o, l);
2921
+ }
2922
+ return t;
2923
+ }, Cf = typeof XMLHttpRequest < "u", Nf = Cf && function(e) {
2924
+ return new Promise(function(n, r) {
2925
+ const o = eo(e);
2926
+ let s = o.data;
2927
+ const i = U.from(o.headers).normalize();
2928
+ let { responseType: a, onUploadProgress: f, onDownloadProgress: l } = o, c, p, g, y, h;
2929
+ function m() {
2930
+ y && y(), h && h(), o.cancelToken && o.cancelToken.unsubscribe(c), o.signal && o.signal.removeEventListener("abort", c);
2931
+ }
2932
+ let d = new XMLHttpRequest();
2933
+ d.open(o.method.toUpperCase(), o.url, !0), d.timeout = o.timeout;
2934
+ function b() {
2935
+ if (!d)
2936
+ return;
2937
+ const O = U.from(
2938
+ "getAllResponseHeaders" in d && d.getAllResponseHeaders()
2939
+ ), v = {
2940
+ data: !a || a === "text" || a === "json" ? d.responseText : d.response,
2941
+ status: d.status,
2942
+ statusText: d.statusText,
2943
+ headers: O,
2944
+ config: e,
2945
+ request: d
2946
+ };
2947
+ Yr(function(I) {
2948
+ n(I), m();
2949
+ }, function(I) {
2950
+ r(I), m();
2951
+ }, v), d = null;
2952
+ }
2953
+ "onloadend" in d ? d.onloadend = b : d.onreadystatechange = function() {
2954
+ !d || d.readyState !== 4 || d.status === 0 && !(d.responseURL && d.responseURL.indexOf("file:") === 0) || setTimeout(b);
2955
+ }, d.onabort = function() {
2956
+ d && (r(new E("Request aborted", E.ECONNABORTED, e, d)), d = null);
2957
+ }, d.onerror = function() {
2958
+ r(new E("Network Error", E.ERR_NETWORK, e, d)), d = null;
2959
+ }, d.ontimeout = function() {
2960
+ let C = o.timeout ? "timeout of " + o.timeout + "ms exceeded" : "timeout exceeded";
2961
+ const v = o.transitional || Vr;
2962
+ o.timeoutErrorMessage && (C = o.timeoutErrorMessage), r(new E(
2963
+ C,
2964
+ v.clarifyTimeoutError ? E.ETIMEDOUT : E.ECONNABORTED,
2965
+ e,
2966
+ d
2967
+ )), d = null;
2968
+ }, s === void 0 && i.setContentType(null), "setRequestHeader" in d && u.forEach(i.toJSON(), function(C, v) {
2969
+ d.setRequestHeader(v, C);
2970
+ }), u.isUndefined(o.withCredentials) || (d.withCredentials = !!o.withCredentials), a && a !== "json" && (d.responseType = o.responseType), l && ([g, h] = Le(l, !0), d.addEventListener("progress", g)), f && d.upload && ([p, y] = Le(f), d.upload.addEventListener("progress", p), d.upload.addEventListener("loadend", y)), (o.cancelToken || o.signal) && (c = (O) => {
2971
+ d && (r(!O || O.type ? new le(null, e, d) : O), d.abort(), d = null);
2972
+ }, o.cancelToken && o.cancelToken.subscribe(c), o.signal && (o.signal.aborted ? c() : o.signal.addEventListener("abort", c)));
2973
+ const _ = Rf(o.url);
2974
+ if (_ && T.protocols.indexOf(_) === -1) {
2975
+ r(new E("Unsupported protocol " + _ + ":", E.ERR_BAD_REQUEST, e));
2976
+ return;
2977
+ }
2978
+ d.send(s || null);
2979
+ });
2980
+ }, Pf = (e, t) => {
2981
+ const { length: n } = e = e ? e.filter(Boolean) : [];
2982
+ if (t || n) {
2983
+ let r = new AbortController(), o;
2984
+ const s = function(l) {
2985
+ if (!o) {
2986
+ o = !0, a();
2987
+ const c = l instanceof Error ? l : this.reason;
2988
+ r.abort(c instanceof E ? c : new le(c instanceof Error ? c.message : c));
2989
+ }
2990
+ };
2991
+ let i = t && setTimeout(() => {
2992
+ i = null, s(new E(`timeout ${t} of ms exceeded`, E.ETIMEDOUT));
2993
+ }, t);
2994
+ const a = () => {
2995
+ e && (i && clearTimeout(i), i = null, e.forEach((l) => {
2996
+ l.unsubscribe ? l.unsubscribe(s) : l.removeEventListener("abort", s);
2997
+ }), e = null);
2998
+ };
2999
+ e.forEach((l) => l.addEventListener("abort", s));
3000
+ const { signal: f } = r;
3001
+ return f.unsubscribe = () => u.asap(a), f;
3002
+ }
3003
+ }, Uf = Pf, jf = function* (e, t) {
3004
+ let n = e.byteLength;
3005
+ if (!t || n < t) {
3006
+ yield e;
3007
+ return;
3008
+ }
3009
+ let r = 0, o;
3010
+ for (; r < n; )
3011
+ o = r + t, yield e.slice(r, o), r = o;
3012
+ }, Lf = async function* (e, t) {
3013
+ for await (const n of If(e))
3014
+ yield* jf(n, t);
3015
+ }, If = async function* (e) {
3016
+ if (e[Symbol.asyncIterator]) {
3017
+ yield* e;
3018
+ return;
3019
+ }
3020
+ const t = e.getReader();
3021
+ try {
3022
+ for (; ; ) {
3023
+ const { done: n, value: r } = await t.read();
3024
+ if (n)
3025
+ break;
3026
+ yield r;
3027
+ }
3028
+ } finally {
3029
+ await t.cancel();
3030
+ }
3031
+ }, vn = (e, t, n, r) => {
3032
+ const o = Lf(e, t);
3033
+ let s = 0, i, a = (f) => {
3034
+ i || (i = !0, r && r(f));
3035
+ };
3036
+ return new ReadableStream({
3037
+ async pull(f) {
3038
+ try {
3039
+ const { done: l, value: c } = await o.next();
3040
+ if (l) {
3041
+ a(), f.close();
3042
+ return;
3043
+ }
3044
+ let p = c.byteLength;
3045
+ if (n) {
3046
+ let g = s += p;
3047
+ n(g);
3048
+ }
3049
+ f.enqueue(new Uint8Array(c));
3050
+ } catch (l) {
3051
+ throw a(l), l;
3052
+ }
3053
+ },
3054
+ cancel(f) {
3055
+ return a(f), o.return();
3056
+ }
3057
+ }, {
3058
+ highWaterMark: 2
3059
+ });
3060
+ }, Ye = typeof fetch == "function" && typeof Request == "function" && typeof Response == "function", to = Ye && typeof ReadableStream == "function", xf = Ye && (typeof TextEncoder == "function" ? ((e) => (t) => e.encode(t))(new TextEncoder()) : async (e) => new Uint8Array(await new Response(e).arrayBuffer())), no = (e, ...t) => {
3061
+ try {
3062
+ return !!e(...t);
3063
+ } catch {
3064
+ return !1;
3065
+ }
3066
+ }, Bf = to && no(() => {
3067
+ let e = !1;
3068
+ const t = new Request(T.origin, {
3069
+ body: new ReadableStream(),
3070
+ method: "POST",
3071
+ get duplex() {
3072
+ return e = !0, "half";
3073
+ }
3074
+ }).headers.has("Content-Type");
3075
+ return e && !t;
3076
+ }), Tn = 64 * 1024, mt = to && no(() => u.isReadableStream(new Response("").body)), Ie = {
3077
+ stream: mt && ((e) => e.body)
3078
+ };
3079
+ Ye && ((e) => {
3080
+ ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((t) => {
3081
+ !Ie[t] && (Ie[t] = u.isFunction(e[t]) ? (n) => n[t]() : (n, r) => {
3082
+ throw new E(`Response type '${t}' is not supported`, E.ERR_NOT_SUPPORT, r);
3083
+ });
3084
+ });
3085
+ })(new Response());
3086
+ const $f = async (e) => {
3087
+ if (e == null)
3088
+ return 0;
3089
+ if (u.isBlob(e))
3090
+ return e.size;
3091
+ if (u.isSpecCompliantForm(e))
3092
+ return (await new Request(T.origin, {
3093
+ method: "POST",
3094
+ body: e
3095
+ }).arrayBuffer()).byteLength;
3096
+ if (u.isArrayBufferView(e) || u.isArrayBuffer(e))
3097
+ return e.byteLength;
3098
+ if (u.isURLSearchParams(e) && (e = e + ""), u.isString(e))
3099
+ return (await xf(e)).byteLength;
3100
+ }, Ff = async (e, t) => {
3101
+ const n = u.toFiniteNumber(e.getContentLength());
3102
+ return n ?? $f(t);
3103
+ }, Df = Ye && (async (e) => {
3104
+ let {
3105
+ url: t,
3106
+ method: n,
3107
+ data: r,
3108
+ signal: o,
3109
+ cancelToken: s,
3110
+ timeout: i,
3111
+ onDownloadProgress: a,
3112
+ onUploadProgress: f,
3113
+ responseType: l,
3114
+ headers: c,
3115
+ withCredentials: p = "same-origin",
3116
+ fetchOptions: g
3117
+ } = eo(e);
3118
+ l = l ? (l + "").toLowerCase() : "text";
3119
+ let y = Uf([o, s && s.toAbortSignal()], i), h;
3120
+ const m = y && y.unsubscribe && (() => {
3121
+ y.unsubscribe();
3122
+ });
3123
+ let d;
3124
+ try {
3125
+ if (f && Bf && n !== "get" && n !== "head" && (d = await Ff(c, r)) !== 0) {
3126
+ let v = new Request(t, {
3127
+ method: "POST",
3128
+ body: r,
3129
+ duplex: "half"
3130
+ }), L;
3131
+ if (u.isFormData(r) && (L = v.headers.get("content-type")) && c.setContentType(L), v.body) {
3132
+ const [I, $] = Sn(
3133
+ d,
3134
+ Le(On(f))
3135
+ );
3136
+ r = vn(v.body, Tn, I, $);
3137
+ }
3138
+ }
3139
+ u.isString(p) || (p = p ? "include" : "omit");
3140
+ const b = "credentials" in Request.prototype;
3141
+ h = new Request(t, {
3142
+ ...g,
3143
+ signal: y,
3144
+ method: n.toUpperCase(),
3145
+ headers: c.normalize().toJSON(),
3146
+ body: r,
3147
+ duplex: "half",
3148
+ credentials: b ? p : void 0
3149
+ });
3150
+ let _ = await fetch(h);
3151
+ const O = mt && (l === "stream" || l === "response");
3152
+ if (mt && (a || O && m)) {
3153
+ const v = {};
3154
+ ["status", "statusText", "headers"].forEach((Gt) => {
3155
+ v[Gt] = _[Gt];
3156
+ });
3157
+ const L = u.toFiniteNumber(_.headers.get("content-length")), [I, $] = a && Sn(
3158
+ L,
3159
+ Le(On(a), !0)
3160
+ ) || [];
3161
+ _ = new Response(
3162
+ vn(_.body, Tn, I, () => {
3163
+ $ && $(), m && m();
3164
+ }),
3165
+ v
3166
+ );
3167
+ }
3168
+ l = l || "text";
3169
+ let C = await Ie[u.findKey(Ie, l) || "text"](_, e);
3170
+ return !O && m && m(), await new Promise((v, L) => {
3171
+ Yr(v, L, {
3172
+ data: C,
3173
+ headers: U.from(_.headers),
3174
+ status: _.status,
3175
+ statusText: _.statusText,
3176
+ config: e,
3177
+ request: h
3178
+ });
3179
+ });
3180
+ } catch (b) {
3181
+ throw m && m(), b && b.name === "TypeError" && /fetch/i.test(b.message) ? Object.assign(
3182
+ new E("Network Error", E.ERR_NETWORK, e, h),
3183
+ {
3184
+ cause: b.cause || b
3185
+ }
3186
+ ) : E.from(b, b && b.code, e, h);
3187
+ }
3188
+ }), gt = {
3189
+ http: Ql,
3190
+ xhr: Nf,
3191
+ fetch: Df
3192
+ };
3193
+ u.forEach(gt, (e, t) => {
3194
+ if (e) {
3195
+ try {
3196
+ Object.defineProperty(e, "name", { value: t });
3197
+ } catch {
3198
+ }
3199
+ Object.defineProperty(e, "adapterName", { value: t });
3200
+ }
3201
+ });
3202
+ const An = (e) => `- ${e}`, Mf = (e) => u.isFunction(e) || e === null || e === !1, ro = {
3203
+ getAdapter: (e) => {
3204
+ e = u.isArray(e) ? e : [e];
3205
+ const { length: t } = e;
3206
+ let n, r;
3207
+ const o = {};
3208
+ for (let s = 0; s < t; s++) {
3209
+ n = e[s];
3210
+ let i;
3211
+ if (r = n, !Mf(n) && (r = gt[(i = String(n)).toLowerCase()], r === void 0))
3212
+ throw new E(`Unknown adapter '${i}'`);
3213
+ if (r)
3214
+ break;
3215
+ o[i || "#" + s] = r;
3216
+ }
3217
+ if (!r) {
3218
+ const s = Object.entries(o).map(
3219
+ ([a, f]) => `adapter ${a} ` + (f === !1 ? "is not supported by the environment" : "is not available in the build")
3220
+ );
3221
+ let i = t ? s.length > 1 ? `since :
3222
+ ` + s.map(An).join(`
3223
+ `) : " " + An(s[0]) : "as no adapter specified";
3224
+ throw new E(
3225
+ "There is no suitable adapter to dispatch the request " + i,
3226
+ "ERR_NOT_SUPPORT"
3227
+ );
3228
+ }
3229
+ return r;
3230
+ },
3231
+ adapters: gt
3232
+ };
3233
+ function ut(e) {
3234
+ if (e.cancelToken && e.cancelToken.throwIfRequested(), e.signal && e.signal.aborted)
3235
+ throw new le(null, e);
3236
+ }
3237
+ function Cn(e) {
3238
+ return ut(e), e.headers = U.from(e.headers), e.data = ct.call(
3239
+ e,
3240
+ e.transformRequest
3241
+ ), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1), ro.getAdapter(e.adapter || Ht.adapter)(e).then(function(r) {
3242
+ return ut(e), r.data = ct.call(
3243
+ e,
3244
+ e.transformResponse,
3245
+ r
3246
+ ), r.headers = U.from(r.headers), r;
3247
+ }, function(r) {
3248
+ return Qr(r) || (ut(e), r && r.response && (r.response.data = ct.call(
3249
+ e,
3250
+ e.transformResponse,
3251
+ r.response
3252
+ ), r.response.headers = U.from(r.response.headers))), Promise.reject(r);
3253
+ });
3254
+ }
3255
+ const oo = "1.8.4", Ze = {};
3256
+ ["object", "boolean", "number", "function", "string", "symbol"].forEach((e, t) => {
3257
+ Ze[e] = function(r) {
3258
+ return typeof r === e || "a" + (t < 1 ? "n " : " ") + e;
3259
+ };
3260
+ });
3261
+ const Nn = {};
3262
+ Ze.transitional = function(t, n, r) {
3263
+ function o(s, i) {
3264
+ return "[Axios v" + oo + "] Transitional option '" + s + "'" + i + (r ? ". " + r : "");
3265
+ }
3266
+ return (s, i, a) => {
3267
+ if (t === !1)
3268
+ throw new E(
3269
+ o(i, " has been removed" + (n ? " in " + n : "")),
3270
+ E.ERR_DEPRECATED
3271
+ );
3272
+ return n && !Nn[i] && (Nn[i] = !0, console.warn(
3273
+ o(
3274
+ i,
3275
+ " has been deprecated since v" + n + " and will be removed in the near future"
3276
+ )
3277
+ )), t ? t(s, i, a) : !0;
3278
+ };
3279
+ };
3280
+ Ze.spelling = function(t) {
3281
+ return (n, r) => (console.warn(`${r} is likely a misspelling of ${t}`), !0);
3282
+ };
3283
+ function Hf(e, t, n) {
3284
+ if (typeof e != "object")
3285
+ throw new E("options must be an object", E.ERR_BAD_OPTION_VALUE);
3286
+ const r = Object.keys(e);
3287
+ let o = r.length;
3288
+ for (; o-- > 0; ) {
3289
+ const s = r[o], i = t[s];
3290
+ if (i) {
3291
+ const a = e[s], f = a === void 0 || i(a, s, e);
3292
+ if (f !== !0)
3293
+ throw new E("option " + s + " must be " + f, E.ERR_BAD_OPTION_VALUE);
3294
+ continue;
3295
+ }
3296
+ if (n !== !0)
3297
+ throw new E("Unknown option " + s, E.ERR_BAD_OPTION);
3298
+ }
3299
+ }
3300
+ const Ce = {
3301
+ assertOptions: Hf,
3302
+ validators: Ze
3303
+ }, x = Ce.validators;
3304
+ class xe {
3305
+ constructor(t) {
3306
+ this.defaults = t, this.interceptors = {
3307
+ request: new bn(),
3308
+ response: new bn()
3309
+ };
3310
+ }
3311
+ /**
3312
+ * Dispatch a request
3313
+ *
3314
+ * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
3315
+ * @param {?Object} config
3316
+ *
3317
+ * @returns {Promise} The Promise to be fulfilled
3318
+ */
3319
+ async request(t, n) {
3320
+ try {
3321
+ return await this._request(t, n);
3322
+ } catch (r) {
3323
+ if (r instanceof Error) {
3324
+ let o = {};
3325
+ Error.captureStackTrace ? Error.captureStackTrace(o) : o = new Error();
3326
+ const s = o.stack ? o.stack.replace(/^.+\n/, "") : "";
3327
+ try {
3328
+ r.stack ? s && !String(r.stack).endsWith(s.replace(/^.+\n.+\n/, "")) && (r.stack += `
3329
+ ` + s) : r.stack = s;
3330
+ } catch {
3331
+ }
3332
+ }
3333
+ throw r;
3334
+ }
3335
+ }
3336
+ _request(t, n) {
3337
+ typeof t == "string" ? (n = n || {}, n.url = t) : n = t || {}, n = V(this.defaults, n);
3338
+ const { transitional: r, paramsSerializer: o, headers: s } = n;
3339
+ r !== void 0 && Ce.assertOptions(r, {
3340
+ silentJSONParsing: x.transitional(x.boolean),
3341
+ forcedJSONParsing: x.transitional(x.boolean),
3342
+ clarifyTimeoutError: x.transitional(x.boolean)
3343
+ }, !1), o != null && (u.isFunction(o) ? n.paramsSerializer = {
3344
+ serialize: o
3345
+ } : Ce.assertOptions(o, {
3346
+ encode: x.function,
3347
+ serialize: x.function
3348
+ }, !0)), n.allowAbsoluteUrls !== void 0 || (this.defaults.allowAbsoluteUrls !== void 0 ? n.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls : n.allowAbsoluteUrls = !0), Ce.assertOptions(n, {
3349
+ baseUrl: x.spelling("baseURL"),
3350
+ withXsrfToken: x.spelling("withXSRFToken")
3351
+ }, !0), n.method = (n.method || this.defaults.method || "get").toLowerCase();
3352
+ let i = s && u.merge(
3353
+ s.common,
3354
+ s[n.method]
3355
+ );
3356
+ s && u.forEach(
3357
+ ["delete", "get", "head", "post", "put", "patch", "common"],
3358
+ (h) => {
3359
+ delete s[h];
3360
+ }
3361
+ ), n.headers = U.concat(i, s);
3362
+ const a = [];
3363
+ let f = !0;
3364
+ this.interceptors.request.forEach(function(m) {
3365
+ typeof m.runWhen == "function" && m.runWhen(n) === !1 || (f = f && m.synchronous, a.unshift(m.fulfilled, m.rejected));
3366
+ });
3367
+ const l = [];
3368
+ this.interceptors.response.forEach(function(m) {
3369
+ l.push(m.fulfilled, m.rejected);
3370
+ });
3371
+ let c, p = 0, g;
3372
+ if (!f) {
3373
+ const h = [Cn.bind(this), void 0];
3374
+ for (h.unshift.apply(h, a), h.push.apply(h, l), g = h.length, c = Promise.resolve(n); p < g; )
3375
+ c = c.then(h[p++], h[p++]);
3376
+ return c;
3377
+ }
3378
+ g = a.length;
3379
+ let y = n;
3380
+ for (p = 0; p < g; ) {
3381
+ const h = a[p++], m = a[p++];
3382
+ try {
3383
+ y = h(y);
3384
+ } catch (d) {
3385
+ m.call(this, d);
3386
+ break;
3387
+ }
3388
+ }
3389
+ try {
3390
+ c = Cn.call(this, y);
3391
+ } catch (h) {
3392
+ return Promise.reject(h);
3393
+ }
3394
+ for (p = 0, g = l.length; p < g; )
3395
+ c = c.then(l[p++], l[p++]);
3396
+ return c;
3397
+ }
3398
+ getUri(t) {
3399
+ t = V(this.defaults, t);
3400
+ const n = Zr(t.baseURL, t.url, t.allowAbsoluteUrls);
3401
+ return Jr(n, t.params, t.paramsSerializer);
3402
+ }
3403
+ }
3404
+ u.forEach(["delete", "get", "head", "options"], function(t) {
3405
+ xe.prototype[t] = function(n, r) {
3406
+ return this.request(V(r || {}, {
3407
+ method: t,
3408
+ url: n,
3409
+ data: (r || {}).data
3410
+ }));
3411
+ };
3412
+ });
3413
+ u.forEach(["post", "put", "patch"], function(t) {
3414
+ function n(r) {
3415
+ return function(s, i, a) {
3416
+ return this.request(V(a || {}, {
3417
+ method: t,
3418
+ headers: r ? {
3419
+ "Content-Type": "multipart/form-data"
3420
+ } : {},
3421
+ url: s,
3422
+ data: i
3423
+ }));
3424
+ };
3425
+ }
3426
+ xe.prototype[t] = n(), xe.prototype[t + "Form"] = n(!0);
3427
+ });
3428
+ const Ne = xe;
3429
+ class kt {
3430
+ constructor(t) {
3431
+ if (typeof t != "function")
3432
+ throw new TypeError("executor must be a function.");
3433
+ let n;
3434
+ this.promise = new Promise(function(s) {
3435
+ n = s;
3436
+ });
3437
+ const r = this;
3438
+ this.promise.then((o) => {
3439
+ if (!r._listeners)
3440
+ return;
3441
+ let s = r._listeners.length;
3442
+ for (; s-- > 0; )
3443
+ r._listeners[s](o);
3444
+ r._listeners = null;
3445
+ }), this.promise.then = (o) => {
3446
+ let s;
3447
+ const i = new Promise((a) => {
3448
+ r.subscribe(a), s = a;
3449
+ }).then(o);
3450
+ return i.cancel = function() {
3451
+ r.unsubscribe(s);
3452
+ }, i;
3453
+ }, t(function(s, i, a) {
3454
+ r.reason || (r.reason = new le(s, i, a), n(r.reason));
3455
+ });
3456
+ }
3457
+ /**
3458
+ * Throws a `CanceledError` if cancellation has been requested.
3459
+ */
3460
+ throwIfRequested() {
3461
+ if (this.reason)
3462
+ throw this.reason;
3463
+ }
3464
+ /**
3465
+ * Subscribe to the cancel signal
3466
+ */
3467
+ subscribe(t) {
3468
+ if (this.reason) {
3469
+ t(this.reason);
3470
+ return;
3471
+ }
3472
+ this._listeners ? this._listeners.push(t) : this._listeners = [t];
3473
+ }
3474
+ /**
3475
+ * Unsubscribe from the cancel signal
3476
+ */
3477
+ unsubscribe(t) {
3478
+ if (!this._listeners)
3479
+ return;
3480
+ const n = this._listeners.indexOf(t);
3481
+ n !== -1 && this._listeners.splice(n, 1);
3482
+ }
3483
+ toAbortSignal() {
3484
+ const t = new AbortController(), n = (r) => {
3485
+ t.abort(r);
3486
+ };
3487
+ return this.subscribe(n), t.signal.unsubscribe = () => this.unsubscribe(n), t.signal;
3488
+ }
3489
+ /**
3490
+ * Returns an object that contains a new `CancelToken` and a function that, when called,
3491
+ * cancels the `CancelToken`.
3492
+ */
3493
+ static source() {
3494
+ let t;
3495
+ return {
3496
+ token: new kt(function(o) {
3497
+ t = o;
3498
+ }),
3499
+ cancel: t
3500
+ };
3501
+ }
3502
+ }
3503
+ const kf = kt;
3504
+ function Gf(e) {
3505
+ return function(n) {
3506
+ return e.apply(null, n);
3507
+ };
3508
+ }
3509
+ function qf(e) {
3510
+ return u.isObject(e) && e.isAxiosError === !0;
3511
+ }
3512
+ const yt = {
3513
+ Continue: 100,
3514
+ SwitchingProtocols: 101,
3515
+ Processing: 102,
3516
+ EarlyHints: 103,
3517
+ Ok: 200,
3518
+ Created: 201,
3519
+ Accepted: 202,
3520
+ NonAuthoritativeInformation: 203,
3521
+ NoContent: 204,
3522
+ ResetContent: 205,
3523
+ PartialContent: 206,
3524
+ MultiStatus: 207,
3525
+ AlreadyReported: 208,
3526
+ ImUsed: 226,
3527
+ MultipleChoices: 300,
3528
+ MovedPermanently: 301,
3529
+ Found: 302,
3530
+ SeeOther: 303,
3531
+ NotModified: 304,
3532
+ UseProxy: 305,
3533
+ Unused: 306,
3534
+ TemporaryRedirect: 307,
3535
+ PermanentRedirect: 308,
3536
+ BadRequest: 400,
3537
+ Unauthorized: 401,
3538
+ PaymentRequired: 402,
3539
+ Forbidden: 403,
3540
+ NotFound: 404,
3541
+ MethodNotAllowed: 405,
3542
+ NotAcceptable: 406,
3543
+ ProxyAuthenticationRequired: 407,
3544
+ RequestTimeout: 408,
3545
+ Conflict: 409,
3546
+ Gone: 410,
3547
+ LengthRequired: 411,
3548
+ PreconditionFailed: 412,
3549
+ PayloadTooLarge: 413,
3550
+ UriTooLong: 414,
3551
+ UnsupportedMediaType: 415,
3552
+ RangeNotSatisfiable: 416,
3553
+ ExpectationFailed: 417,
3554
+ ImATeapot: 418,
3555
+ MisdirectedRequest: 421,
3556
+ UnprocessableEntity: 422,
3557
+ Locked: 423,
3558
+ FailedDependency: 424,
3559
+ TooEarly: 425,
3560
+ UpgradeRequired: 426,
3561
+ PreconditionRequired: 428,
3562
+ TooManyRequests: 429,
3563
+ RequestHeaderFieldsTooLarge: 431,
3564
+ UnavailableForLegalReasons: 451,
3565
+ InternalServerError: 500,
3566
+ NotImplemented: 501,
3567
+ BadGateway: 502,
3568
+ ServiceUnavailable: 503,
3569
+ GatewayTimeout: 504,
3570
+ HttpVersionNotSupported: 505,
3571
+ VariantAlsoNegotiates: 506,
3572
+ InsufficientStorage: 507,
3573
+ LoopDetected: 508,
3574
+ NotExtended: 510,
3575
+ NetworkAuthenticationRequired: 511
3576
+ };
3577
+ Object.entries(yt).forEach(([e, t]) => {
3578
+ yt[t] = e;
3579
+ });
3580
+ const Kf = yt;
3581
+ function so(e) {
3582
+ const t = new Ne(e), n = $r(Ne.prototype.request, t);
3583
+ return u.extend(n, Ne.prototype, t, { allOwnKeys: !0 }), u.extend(n, t, null, { allOwnKeys: !0 }), n.create = function(o) {
3584
+ return so(V(e, o));
3585
+ }, n;
3586
+ }
3587
+ const w = so(Ht);
3588
+ w.Axios = Ne;
3589
+ w.CanceledError = le;
3590
+ w.CancelToken = kf;
3591
+ w.isCancel = Qr;
3592
+ w.VERSION = oo;
3593
+ w.toFormData = Xe;
3594
+ w.AxiosError = E;
3595
+ w.Cancel = w.CanceledError;
3596
+ w.all = function(t) {
3597
+ return Promise.all(t);
3598
+ };
3599
+ w.spread = Gf;
3600
+ w.isAxiosError = qf;
3601
+ w.mergeConfig = V;
3602
+ w.AxiosHeaders = U;
3603
+ w.formToJSON = (e) => Xr(u.isHTMLForm(e) ? new FormData(e) : e);
3604
+ w.getAdapter = ro.getAdapter;
3605
+ w.HttpStatusCode = Kf;
3606
+ w.default = w;
3607
+ const Wf = w, zf = 3e4, Pn = Math.random(), io = {
3608
+ timeout: zf,
3609
+ getBusinessCode() {
3610
+ return Pn;
3611
+ },
3612
+ getBusinessMsg(e) {
3613
+ return e.statusText;
3614
+ },
3615
+ getBusinessData(e) {
3616
+ return e.data;
3617
+ },
3618
+ businessSuccessCodeList: [Pn],
3619
+ axios: Wf
3620
+ }, ao = Br({
3621
+ basePath: " https://gitee.com",
3622
+ ...io
3623
+ }), co = Br({
3624
+ basePath: "https://api.github.com",
3625
+ ...io
3626
+ }), Jf = ({
3627
+ username: e
3628
+ }) => ao({
3629
+ url: `/api/v5/users/${e}/repos`,
3630
+ method: "GET"
3631
+ }), Vf = ({
3632
+ accessToken: e
3633
+ }) => ao({
3634
+ url: "/api/v5/user/repos",
3635
+ method: "GET",
3636
+ params: {
3637
+ access_token: e,
3638
+ per_page: 100,
3639
+ page: 1,
3640
+ sort: "updated"
3641
+ }
3642
+ }), Xf = ({
3643
+ username: e
3644
+ }) => co({
3645
+ url: `/users/${e}/repos`,
3646
+ method: "GET"
3647
+ }), Qf = ({
3648
+ accessToken: e
3649
+ }) => co({
3650
+ url: "/user/repos",
3651
+ method: "GET",
3652
+ headers: {
3653
+ Authorization: `Bearer ${e}`
3654
+ },
3655
+ params: {
3656
+ per_page: 100,
3657
+ page: 1,
3658
+ sort: "updated"
3659
+ }
3660
+ }), Yf = async ({
3661
+ platform: e,
3662
+ username: t
3663
+ } = {}) => {
3664
+ const n = {
3665
+ platform: e,
3666
+ username: t
3667
+ };
3668
+ e || (n.platform = (await pe(Fn())).platform), t || (n.username = (await pe(Dn())).username);
3669
+ const { platform: r, username: o } = n;
3670
+ let s = [];
3671
+ const i = Wo({
3672
+ username: o,
3673
+ platform: r
3674
+ });
3675
+ let a = i == null ? void 0 : i.accessToken;
3676
+ R.stage(`正在获取${o}的${r}仓库列表...`);
3677
+ const f = {
3678
+ username: o,
3679
+ accessToken: a
3680
+ };
3681
+ switch (n.platform) {
3682
+ case B.GITHUB: {
3683
+ s = (await (f.accessToken ? Qf : Xf)(f)).data.map((c) => ({
3684
+ name: c.name,
3685
+ httpUrl: c.clone_url,
3686
+ sshUrl: c.ssh_url,
3687
+ description: c.description || ""
3688
+ }));
3689
+ break;
3690
+ }
3691
+ case B.GITEE: {
3692
+ s = (await (f.accessToken ? Vf : Jf)(f)).data.map((c) => ({
3693
+ name: c.name,
3694
+ httpUrl: c.html_url,
3695
+ sshUrl: c.ssh_url,
3696
+ description: c.description || ""
3697
+ }));
3698
+ break;
3699
+ }
3700
+ default:
3701
+ return R.error(`未知平台${r}`), process.exit(1);
3702
+ }
3703
+ if (R.success(`获取${o}的${r}仓库列表成功`), s.length === 0) {
3704
+ R.warn(`${o} 可获取${r}仓库列表为空`);
3705
+ return;
3706
+ } else
3707
+ R.stage(`共${s.length}个仓库`);
3708
+ const { repoUrl: l } = await pe({
3709
+ name: "repoUrl",
3710
+ type: "select",
3711
+ message: "选择仓库",
3712
+ choices: s.map((c) => ({
3713
+ title: `${c.name} ${c.description}`,
3714
+ value: c.sshUrl
3715
+ }))
3716
+ });
3717
+ return l;
3718
+ }, Zf = () => ({
3719
+ projectName: {
3720
+ type: "string",
3721
+ alias: "p",
3722
+ describe: "项目名称"
3723
+ }
3724
+ }), ep = () => ({
3725
+ platform: {
3726
+ describe: "选择git平台",
3727
+ type: "string",
3728
+ choices: [B.GITHUB, B.GITEE]
3729
+ },
3730
+ username: {
3731
+ describe: "git平台用户名",
3732
+ type: "string"
3733
+ }
3734
+ }), uo = async (e) => {
3735
+ const t = await Yf(e), { projectName: n } = e;
3736
+ k(
3737
+ `git clone ${t} ${n ? `${n} ` : ""}--depth=1`,
3738
+ { stdio: "inherit" }
3739
+ ), R.success(`克隆${t}成功`);
3740
+ };
3741
+ `${$n.CLONE}`, Zf(), ep();
3742
+ const tp = async (e) => {
3743
+ R.info("克隆done-coding系列项目"), R.stage("选择平台:");
3744
+ const { platform: t } = await pe(Fn(B.GITEE));
3745
+ R.stage("选择用户名:");
3746
+ const { username: n } = await pe(
3747
+ Dn(
3748
+ {
3749
+ [B.GITHUB]: "done-coding",
3750
+ [B.GITEE]: "justsosu"
3751
+ }[t]
3752
+ )
3753
+ );
3754
+ R.info("platform:", t), R.info("username:", n), await uo({
3755
+ platform: t,
3756
+ username: n,
3757
+ projectName: e
3758
+ });
3759
+ }, np = () => ({
3760
+ [S.PROJECT_NAME]: {
3761
+ alias: "n",
3762
+ type: "string",
3763
+ describe: "项目名称"
3764
+ },
3765
+ justCloneFromDoneCoding: {
3766
+ alias: "clone",
3767
+ type: "boolean",
3768
+ describe: "是否仅仅(从done-coding系列项目列表中)克隆远程仓库",
3769
+ default: !1,
3770
+ hidden: !0
3771
+ },
3772
+ [S.TEMPLATE_GIT_PATH]: {
3773
+ alias: "p",
3774
+ type: "string",
3775
+ describe: "模板仓库地址"
3776
+ },
3777
+ [S.TEMPLATE_GIT_BRANCH]: {
3778
+ alias: "b",
3779
+ type: "string",
3780
+ describe: "模板仓库分支"
3781
+ },
3782
+ skipTemplateCompile: {
3783
+ type: "boolean",
3784
+ describe: "是否跳过模板编译",
3785
+ default: !1,
3786
+ hidden: !0
3787
+ },
3788
+ openGitDetailOptimize: {
3789
+ type: "boolean",
3790
+ describe: "开启git细节优化",
3791
+ default: !0
3792
+ },
3793
+ [S.IS_CHANGE_BRANCH_NAME]: {
3794
+ type: "boolean",
3795
+ describe: "git细节优化:是否更改分支名",
3796
+ default: !1
3797
+ },
3798
+ [S.LOCAL_BRANCH_NAME]: {
3799
+ type: "string",
3800
+ describe: "git细节优化:需要更改本地分支名时的更改值"
3801
+ },
3802
+ [S.IS_SAVE_GIT_HISTORY]: {
3803
+ type: "boolean",
3804
+ describe: "git细节优化:是否保存模板仓库git历史记录",
3805
+ default: !1
3806
+ },
3807
+ [S.IS_TRANS_HTTP_URL_TO_SSH_URL]: {
3808
+ type: "boolean",
3809
+ describe: "git细节优化:是否将http url转换为ssh url"
3810
+ },
3811
+ [S.GIT_COMMIT_MESSAGE]: {
3812
+ alias: "m",
3813
+ type: "string",
3814
+ describe: "git细节优化:git提交信息"
3815
+ }
3816
+ }), lo = async (e) => {
3817
+ R.info(`版本: ${te.version}`);
3818
+ const {
3819
+ [S.PROJECT_NAME]: t,
3820
+ justCloneFromDoneCoding: n
3821
+ } = e;
3822
+ if (n) {
3823
+ R.info("仅仅(从done-coding系列项目列表中)克隆远程仓库"), await tp(t);
3824
+ return;
3825
+ }
3826
+ const r = go({
3827
+ presetAnswer: e
3828
+ }), o = await r(
3829
+ S.PROJECT_NAME,
3830
+ No,
3831
+ t
3832
+ );
3833
+ let s = o == null ? void 0 : o.trim();
3834
+ if (!s)
3835
+ return R.error("项目名称不能为空"), process.exit(1);
3836
+ const i = yo(s);
3837
+ i !== s && (R.warn(
3838
+ `项目名称\`${s}\`包含非法字符,已自动转换为\`${i}\``
3839
+ ), s = i);
3840
+ const a = Oo(process.cwd(), s);
3841
+ if (Kt(a))
3842
+ if (await r(
3843
+ S.IS_REMOVE_SAME_NAME_DIR,
3844
+ Io()
3845
+ ) === !0)
3846
+ tt(a, { recursive: !0, force: !0 });
3847
+ else
3848
+ return R.error(`项目${s}已存在`), process.exit(1);
3849
+ let f = await r(
3850
+ S.TEMPLATE_GIT_PATH
3851
+ ), l = await r(
3852
+ S.TEMPLATE_GIT_BRANCH
3853
+ );
3854
+ if (!f) {
3855
+ const h = await r(
3856
+ S.TEMPLATE,
3857
+ await Uo()
3858
+ );
3859
+ if (h === Ln)
3860
+ f = await r(
3861
+ S.CUSTOM_GIT_URL_INPUT,
3862
+ xo
3863
+ );
3864
+ else if (h === In)
3865
+ f = await Ao();
3866
+ else {
3867
+ const m = (await Bn()).find(
3868
+ (d) => d.name === h
3869
+ );
3870
+ if (!m)
3871
+ return R.error(`模板${h}不存在`), process.exit(1);
3872
+ if (!m.url)
3873
+ return R.error(`模板${h}仓库地址不存在`), process.exit(1);
3874
+ f = m.url, typeof m.branch == "string" ? l = m.branch : Array.isArray(m.branch) && m.branch.length > 0 && (l = await r(
3875
+ S.TEMPLATE_GIT_BRANCH,
3876
+ Do(m.branch)
3877
+ ));
3878
+ }
3879
+ }
3880
+ if (!f)
3881
+ return R.error("模板仓库地址不存在"), process.exit(1);
3882
+ const c = Un(".git");
3883
+ if (R.stage("正在初始化项目,请稍等..."), k(
3884
+ `git clone${l ? ` -b ${l}` : ""} ${f} ${s} --depth=1`,
3885
+ { stdio: "inherit" }
3886
+ ), e.openGitDetailOptimize && !c && l && await r(
3887
+ S.IS_CHANGE_BRANCH_NAME,
3888
+ $o(l)
3889
+ )) {
3890
+ const m = await r(
3891
+ S.LOCAL_BRANCH_NAME,
3892
+ Fo
3893
+ );
3894
+ k(`git branch -m ${m}`, {
3895
+ cwd: a,
3896
+ stdio: "inherit"
3897
+ });
3898
+ }
3899
+ const p = To, g = wo({
3900
+ rootDir: a,
3901
+ configPath: p
3902
+ });
3903
+ if (g && (R.stage("当前模板项目配置了预设问题"), e.skipTemplateCompile ? R.stage("用户设置:跳过模板编译") : (R.stage("开始进行模板编译"), await vo({
3904
+ rootDir: a,
3905
+ configPath: p,
3906
+ extraEnvData: {
3907
+ $projectName: s
3908
+ }
3909
+ }), tt(g, { force: !0 }), R.stage("模板项目配置编译成功, 编译配置文件已删除"))), !e.openGitDetailOptimize)
3910
+ return R.stage("移除克隆仓库的git控制"), await qt(a), R.success("项目创建成功,移除克隆仓库的git控制成功"), process.exit(0);
3911
+ if (R.stage("项目初始化完成"), c) {
3912
+ const h = Wt.resolve(a), m = Wt.resolve(h, ".git");
3913
+ if (!Kt(m))
3914
+ throw new Error("git目录不存在");
3915
+ tt(m, { recursive: !0, force: !0 }), R.stage(
3916
+ `项目创建在父级git仓库${c}中,已删除${s}目录下的.git(${m})`
3917
+ );
3918
+ } else if (await r(
3919
+ S.IS_SAVE_GIT_HISTORY,
3920
+ jo
3921
+ )) {
3922
+ if (k(
3923
+ `git remote rename ${ve.ORIGIN} ${ve.UPSTREAM} && git fetch --unshallow`,
3924
+ {
3925
+ cwd: a,
3926
+ stdio: "inherit"
3927
+ }
3928
+ ), R.stage(
3929
+ "已经将origin重命名为upstream,后续可以与模板git仓库有完整的交互"
3930
+ ), R.success("已保存git历史记录"), _o(f)) {
3931
+ const m = Eo(f);
3932
+ await r(
3933
+ S.IS_TRANS_HTTP_URL_TO_SSH_URL,
3934
+ Lo({
3935
+ httpUrl: f,
3936
+ sshUrl: m
3937
+ })
3938
+ ) && k(
3939
+ `git remote set-url ${ve.UPSTREAM} ${m}`,
3940
+ {
3941
+ cwd: a,
3942
+ stdio: "inherit"
3943
+ }
3944
+ ), R.success(`已将模板远程仓库地址更换为${m}`);
3945
+ }
3946
+ } else
3947
+ await qt(a), k("git init", {
3948
+ cwd: a,
3949
+ stdio: "inherit"
3950
+ });
3951
+ const y = await r(
3952
+ S.GIT_COMMIT_MESSAGE,
3953
+ Bo(s)
3954
+ );
3955
+ k(`git add . && git commit -m '${y}'`, {
3956
+ cwd: a,
3957
+ stdio: "inherit"
3958
+ }), R.success(`项目${s}初始化完成`), R.info(`
3959
+ 使用步骤:
3960
+ 1. cd ${s}
3961
+ 2. pnpm install
3962
+ 3. pnpm run dev
3963
+ `);
3964
+ }, rp = {
3965
+ command: "$0",
3966
+ describe: te.description,
3967
+ options: np(),
3968
+ // positionals: getPositionals(),
3969
+ handler: lo
3970
+ }, pp = async (e, t) => {
3971
+ switch (e) {
3972
+ case xn.CREATE:
3973
+ default:
3974
+ return lo(t);
3975
+ }
3976
+ }, { version: op, description: sp } = te, fo = {
3977
+ describe: sp,
3978
+ version: op,
3979
+ subcommands: [rp].map(jn),
3980
+ demandCommandCount: 1,
3981
+ rootScriptName: bo({ packageJson: te })
3982
+ }, {
3983
+ cliConfig: { moduleName: ip }
3984
+ } = te, po = (e = !1) => {
3985
+ const t = `${e ? `${ip} ` : ""}`, n = `$0 ${t.trim()}`;
3986
+ return { command: t, usage: n };
3987
+ }, hp = async () => Ro({
3988
+ ...fo,
3989
+ ...po()
3990
+ }), dp = () => jn({
3991
+ ...fo,
3992
+ ...po(!0)
3993
+ });
3994
+ export {
3995
+ S as F,
3996
+ ve as G,
3997
+ xn as S,
3998
+ dp as a,
3999
+ rp as b,
4000
+ hp as c,
4001
+ pp as d,
4002
+ fo as e,
4003
+ lo as h,
4004
+ te as i
4005
+ };