ss-component-new 1.1.64 → 1.1.65

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.
@@ -1,3352 +0,0 @@
1
- import { ref as U, onMounted as Ln, watch as de, createElementBlock as re, openBlock as X, createBlock as Be, createVNode as Y, createSlots as qn, withCtx as ce, Fragment as Ze, renderList as Qe, createElementVNode as M, normalizeStyle as Jn, toDisplayString as Z, createCommentVNode as Yt, resolveComponent as We, createTextVNode as Ue, unref as en, resolveDynamicComponent as Et } from "vue";
2
- import { g as Mn, c as zn, d as tn, s as Ee, E as Hn, u as In } from "./menu-D6yKPqgS.js";
3
- import { u as Ye } from "./modelComp-Cr1QF6ip.js";
4
- import { c as v, _ as Re } from "./_plugin-vue_export-helper-B7R8Jogt.js";
5
- import { s as Oe, a as Vn, b as et, f as Wn, E as Fe } from "./index-zogzyMot.js";
6
- import { _ as Kn } from "./index.vue_vue_type_script_setup_true_lang-DQ2k4Z7D.js";
7
- const Lt = (e, t) => {
8
- const n = e.storage || sessionStorage, r = e.key || t.$id;
9
- if (e.paths) {
10
- const o = e.paths.reduce((s, a) => (s[a] = t.$state[a], s), {});
11
- n.setItem(r, JSON.stringify(o));
12
- } else
13
- n.setItem(r, JSON.stringify(t.$state));
14
- };
15
- var Gn = ({ options: e, store: t }) => {
16
- var n, r, o, s;
17
- if ((n = e.persist) != null && n.enabled) {
18
- const a = [{
19
- key: t.$id,
20
- storage: sessionStorage
21
- }], l = (o = (r = e.persist) == null ? void 0 : r.strategies) != null && o.length ? (s = e.persist) == null ? void 0 : s.strategies : a;
22
- l.forEach((d) => {
23
- const i = d.storage || sessionStorage, y = d.key || t.$id, c = i.getItem(y);
24
- c && (t.$patch(JSON.parse(c)), Lt(d, t));
25
- }), t.$subscribe(() => {
26
- l.forEach((d) => {
27
- Lt(d, t);
28
- });
29
- });
30
- }
31
- };
32
- const he = Mn() || zn();
33
- he.use(Gn);
34
- const nn = tn("formToTableComp", {
35
- state: () => ({
36
- selectArray: [],
37
- selectString: ""
38
- }),
39
- actions: {
40
- setSelectArray(e) {
41
- this.selectArray = e;
42
- },
43
- setSelectString(e) {
44
- this.selectString = e;
45
- }
46
- }
47
- }), Xn = tn("unit", {
48
- state: () => ({
49
- selectIndex: "",
50
- selectMenu: "",
51
- selectTitle: []
52
- }),
53
- actions: {
54
- setSelectIndex(e) {
55
- this.selectIndex = e;
56
- },
57
- setSelectMenu(e) {
58
- this.selectMenu = e;
59
- },
60
- setSelectTitle(e) {
61
- this.selectTitle = e;
62
- }
63
- }
64
- }), Zn = (e, t) => {
65
- const n = t == null ? void 0 : t.split("-");
66
- return rn(e, n);
67
- }, rn = (e, t) => {
68
- var o;
69
- let n = e, r = t;
70
- return Array.isArray(n) ? n = n == null ? void 0 : n[parseInt(v(r == null ? void 0 : r[0]))] : Array.isArray(n == null ? void 0 : n.children) && (n = (o = n == null ? void 0 : n.children) == null ? void 0 : o[parseInt(v(r == null ? void 0 : r[0]))]), r == null || r.shift(), (r == null ? void 0 : r.length) > 0 && (n = rn(n, r)), n;
71
- }, on = (e, t) => {
72
- let n = e, r = t == null ? void 0 : t.filter((o) => (o == null ? void 0 : o.prop) !== "index");
73
- return Array.isArray(n) && (n = n == null ? void 0 : n.map((o, s) => {
74
- if (Array.isArray(o)) {
75
- let a = {};
76
- return o = o == null ? void 0 : o.forEach((l, d) => {
77
- var i;
78
- (i = r == null ? void 0 : r[d]) != null && i.prop ? a[r[d].prop] = l : Array.isArray(l) && (a.children = on(l, r));
79
- }), Object.assign(a, { id: s });
80
- } else
81
- return o;
82
- })), n;
83
- }, Qn = (e, t, n) => {
84
- if (t === "")
85
- return e == null ? void 0 : e.filter((r) => (r == null ? void 0 : r.id) === n);
86
- {
87
- const r = t.split("-");
88
- return Yn(e, r, n);
89
- }
90
- }, Yn = (e, t, n) => {
91
- let r = e, o = t;
92
- return (o == null ? void 0 : o.length) === 0 ? r = r == null ? void 0 : r.filter((s) => s.id !== n) : r = r == null ? void 0 : r.map((s) => (s.id.toString() === (o == null ? void 0 : o[0]) && (o == null || o.shift(), s = sn(s, o, n)), s)), r;
93
- }, sn = (e, t, n) => {
94
- var s, a;
95
- let r = e, o = t;
96
- return (o == null ? void 0 : o.length) === 0 ? r.children = (s = r.children) == null ? void 0 : s.filter((l) => l.id !== n) : r.children = (a = r.children) == null ? void 0 : a.map((l) => (l.id.toString() === (o == null ? void 0 : o[0]) && (o == null || o.shift(), l = sn(l, o, n)), l)), r;
97
- }, er = (e, t, n) => {
98
- if (t === "")
99
- return n;
100
- {
101
- const r = t.split("-");
102
- return tr(e, r, n);
103
- }
104
- }, tr = (e, t, n) => {
105
- let r = e, o = t;
106
- return (o == null ? void 0 : o.length) === 0 ? r = n : r = r == null ? void 0 : r.map((s) => (s.id.toString() === (o == null ? void 0 : o[0]) && (o == null || o.shift(), s = an(s, o, n)), s)), r;
107
- }, an = (e, t, n) => {
108
- var s;
109
- let r = e, o = t;
110
- return (o == null ? void 0 : o.length) === 0 ? r.children = n : r.children = (s = r.children) == null ? void 0 : s.map((a) => (a.id.toString() === (o == null ? void 0 : o[0]) && (o == null || o.shift(), a = an(a, o, n)), a)), r;
111
- }, nr = { class: "table-content" }, rr = ["onClick"], or = {
112
- key: 0,
113
- class: "dialog-footer"
114
- }, sr = {
115
- __name: "index",
116
- props: {
117
- itemData: {
118
- type: Array,
119
- default: () => []
120
- },
121
- childItemData: {
122
- type: Array,
123
- default: () => []
124
- },
125
- index: Number
126
- },
127
- emits: ["change", "contentChange"],
128
- setup(e, { emit: t }) {
129
- const n = e, r = t, o = U([]), s = U([]), a = U(""), l = U(), d = U(!0), i = U(0), y = U(!1), c = U(""), O = U(!1), _ = U([]), g = U(!1), A = U([]), p = U([]), h = U(), u = U(), R = nn(he), b = U(), m = Xn(he), { selectIndex: E, selectMenu: S, selectTitle: D } = Ee(m), { selectString: N } = Ee(R), w = U(720), K = () => {
130
- O.value = !1;
131
- }, F = (T) => {
132
- var j, $, x, L, W;
133
- if (J(T), T != null && T.children && Array.isArray(T == null ? void 0 : T.children)) {
134
- const q = D.value;
135
- q.push({ key: S.value === "" ? (j = T == null ? void 0 : T.id) == null ? void 0 : j.toString() : S.value + "-" + (($ = T == null ? void 0 : T.id) == null ? void 0 : $.toString()), value: T[(x = Object.keys(T)) == null ? void 0 : x.filter((V) => V !== "index" && V !== "id")[0]] }), m.setSelectMenu(S.value === "" ? (L = T == null ? void 0 : T.id) == null ? void 0 : L.toString() : S.value + "-" + ((W = T == null ? void 0 : T.id) == null ? void 0 : W.toString())), m.setSelectTitle(q), m.setSelectIndex(n != null && n.index ? n == null ? void 0 : n.index.toString() : "");
136
- }
137
- }, J = (T) => {
138
- var j, $, x;
139
- if (T != null && T.children && Array.isArray(T == null ? void 0 : T.children)) {
140
- let L = [];
141
- const W = (j = v(h.value)) == null ? void 0 : j.filter((q) => (q == null ? void 0 : q.prop) !== "index");
142
- ($ = T == null ? void 0 : T.children) == null || $.forEach((q, V) => {
143
- if (!Array.isArray(q))
144
- L.push(q);
145
- else {
146
- let ae = {};
147
- q == null || q.forEach((le, Ce) => {
148
- var xe;
149
- (xe = W == null ? void 0 : W[Ce]) != null && xe.prop ? ae[W[Ce].prop] = le : Array.isArray(le) && (ae.children = le);
150
- }), L.push(Object.assign(ae, { id: V }));
151
- }
152
- }), o.value = (x = v(o.value)) == null ? void 0 : x.filter((q) => (q == null ? void 0 : q.prop) !== "index"), s.value = L;
153
- }
154
- }, z = (T, j) => {
155
- var $;
156
- if (a.value = "", g.value = !0, d.value = !0, T === "删除") {
157
- s.value = ($ = v(s.value)) == null ? void 0 : $.filter((L) => (L == null ? void 0 : L.id) !== (j == null ? void 0 : j.id));
158
- const x = Qn(b.value, S.value, j == null ? void 0 : j.id);
159
- k(x), r("change", {
160
- content: x,
161
- index: n == null ? void 0 : n.index,
162
- buttonName: T
163
- });
164
- } else T === "新增" ? (c.value = "新增", H(""), O.value = !0) : T === "编辑" ? (c.value = "编辑", H(j), O.value = !0) : T === "详情" && (c.value = "详情", H(j), g.value = !1, d.value = !1, O.value = !0);
165
- }, H = (T) => {
166
- var $;
167
- const j = [];
168
- ($ = v(o.value)) == null || $.forEach((x, L) => {
169
- x.label !== "" && (x == null ? void 0 : x.label) !== "操作" && j.push({
170
- label: (x == null ? void 0 : x.label) ?? "",
171
- name: (x == null ? void 0 : x.prop) ?? "t" + L,
172
- type: !(x != null && x.type) || (x == null ? void 0 : x.type) === "" ? "Input" : x == null ? void 0 : x.type,
173
- value: (T == null ? void 0 : T[x == null ? void 0 : x.prop]) ?? "",
174
- id: (x == null ? void 0 : x.id) ?? L,
175
- contents: (x == null ? void 0 : x.options) ?? [],
176
- width: 1
177
- });
178
- }), T === "" || !T || (a.value = T == null ? void 0 : T.id), p.value = j;
179
- };
180
- Ln(() => {
181
- });
182
- const I = () => {
183
- let T = v(s.value);
184
- a.value === "" ? (i.value++, T.push(Object.assign(u.value, { id: i.value }))) : T = T == null ? void 0 : T.map(($) => (($ == null ? void 0 : $.id) === a.value && ($ = Object.assign($, u.value)), $)), s.value = T;
185
- const j = er(b.value, S.value, T);
186
- k(j), O.value = !1, r("change", {
187
- content: j,
188
- index: n == null ? void 0 : n.index,
189
- buttonName: c.value
190
- });
191
- }, k = (T) => {
192
- var $;
193
- const j = ($ = v(n.itemData)) == null ? void 0 : $.map((x) => ((x == null ? void 0 : x.key) === "tableContents" && (x.contents = T), x));
194
- r("contentChange", {
195
- contents: j,
196
- index: n.index
197
- });
198
- }, Q = (T) => {
199
- u.value = T;
200
- };
201
- return de(
202
- () => [n.itemData, N.value, E.value, S.value],
203
- () => {
204
- var ae, le, Ce, xe, wt, Ot, Tt, At, Ct, xt, Dt, Ft, Nt, Pt, Ut, Bt, jt, $t;
205
- const T = (ae = v(n.itemData)) == null ? void 0 : ae.filter((P) => (P == null ? void 0 : P.key) === "header"), j = (le = v(n.itemData)) == null ? void 0 : le.find((P) => (P == null ? void 0 : P.key) === "page"), $ = (Ce = v(n.itemData)) == null ? void 0 : Ce.find((P) => (P == null ? void 0 : P.key) === "rowButton"), x = (xe = v(n.itemData)) == null ? void 0 : xe.find((P) => (P == null ? void 0 : P.key) === "extraButton"), L = (wt = v(n.itemData)) == null ? void 0 : wt.filter((P) => (P == null ? void 0 : P.key) === "tableContents"), W = (Ot = v(n.itemData)) == null ? void 0 : Ot.filter((P) => (P == null ? void 0 : P.key) === "tableIndex");
206
- y.value = (j == null ? void 0 : j.contents) ?? !0;
207
- let q = [];
208
- N.value === "" ? q = T == null ? void 0 : T[0] : q = (T == null ? void 0 : T.find((P) => (P == null ? void 0 : P.selectLabel) === "(" + N.value + ")")) ?? (T == null ? void 0 : T.find((P) => !(P != null && P.selectLabel)));
209
- let V = [];
210
- if (N.value === "" ? V = W == null ? void 0 : W[0] : V = (W == null ? void 0 : W.find((P) => (P == null ? void 0 : P.selectLabel) === "(" + N.value + ")")) ?? (W == null ? void 0 : W.find((P) => !(P != null && P.selectLabel))), ((Tt = q == null ? void 0 : q.contents) == null ? void 0 : Tt.length) > 0) {
211
- const P = [];
212
- V != null && V.contents && ((At = V == null ? void 0 : V.contents) == null ? void 0 : At.length) !== 0 && P.push({
213
- label: "",
214
- prop: "index",
215
- sortable: !1
216
- }), (Ct = q == null ? void 0 : q.contents) == null || Ct.forEach((C, fe) => {
217
- (C == null ? void 0 : C.label) !== "" && P.push({
218
- label: (C == null ? void 0 : C.label) ?? "",
219
- prop: (C == null ? void 0 : C.label) === "操作" ? "operate" : (C == null ? void 0 : C.prop) ?? "a" + fe,
220
- width: C != null && C.width ? parseInt(C.width) : "",
221
- fixed: (C == null ? void 0 : C.fixed) ?? void 0,
222
- sortable: (C == null ? void 0 : C.sortable) ?? !1,
223
- align: (C == null ? void 0 : C.align) ?? "center",
224
- showOverflowTooltip: (C == null ? void 0 : C.showOverflowTooltip) ?? !0,
225
- isNotDrag: (C == null ? void 0 : C.isNotDrag) ?? !1,
226
- isEditCol: (C == null ? void 0 : C.isEditCol) ?? !1,
227
- isOperate: (C == null ? void 0 : C.isOperate) ?? !1,
228
- id: (C == null ? void 0 : C.id) ?? fe,
229
- type: (C == null ? void 0 : C.label) === "操作" ? "operate" : void 0
230
- });
231
- }), o.value = P;
232
- let ye = (Dt = (xt = v(o.value)) == null ? void 0 : xt.filter((C) => (C == null ? void 0 : C.type) !== "operate")) == null ? void 0 : Dt.map((C, fe) => ({
233
- prop: (C == null ? void 0 : C.prop) ?? "a" + fe
234
- }));
235
- h.value = ye;
236
- let me = [];
237
- if (N.value === "" ? me = L == null ? void 0 : L[0] : me = (L == null ? void 0 : L.find((C) => (C == null ? void 0 : C.selectLabel) === "(" + N.value + ")")) ?? (L == null ? void 0 : L.find((C) => !(C != null && C.selectLabel))), ((Ft = me == null ? void 0 : me.contents) == null ? void 0 : Ft.length) !== 0) {
238
- let C = v(me == null ? void 0 : me.contents);
239
- V != null && V.contents && ((Nt = V == null ? void 0 : V.contents) == null ? void 0 : Nt.length) !== 0 && (C = (Pt = v(C)) == null ? void 0 : Pt.map((ie, it) => {
240
- var _e, we;
241
- if (!Array.isArray(ie)) {
242
- let De = {};
243
- for (let be in ie)
244
- be !== "id" && be !== "index" && (De[be] = ie[be]);
245
- ie = Object.values(De);
246
- }
247
- return ie.unshift(((we = (_e = V == null ? void 0 : V.contents) == null ? void 0 : _e[it]) == null ? void 0 : we.label) ?? ""), ie;
248
- }));
249
- const fe = [];
250
- C == null || C.forEach((ie, it) => {
251
- let _e = {};
252
- ie == null || ie.forEach((we, De) => {
253
- var be;
254
- (be = ye == null ? void 0 : ye[De]) != null && be.prop ? _e[ye[De].prop] = we : Array.isArray(we) && (_e.children = on(we, ye));
255
- }), fe.push(Object.assign(_e, { id: it }));
256
- }), s.value = fe;
257
- } else {
258
- let C = (Ut = v(ye)) == null ? void 0 : Ut.reduce((fe, ie) => (fe[ie.prop] = "测试数据", fe), {});
259
- l.value = C, s.value = [Object.assign({}, l.value, { id: i.value })];
260
- }
261
- } else
262
- o.value = [], s.value = [];
263
- if (((Bt = $ == null ? void 0 : $.contents) == null ? void 0 : Bt.length) > 0 ? _.value = $ == null ? void 0 : $.contents : _.value = [], ((jt = x == null ? void 0 : x.contents) == null ? void 0 : jt.length) > 0 ? A.value = x == null ? void 0 : x.contents : A.value = [], i.value = (($t = s == null ? void 0 : s.value) == null ? void 0 : $t.length) ?? 0, E.value !== "") {
264
- const P = Zn(v(s.value), S.value);
265
- b.value = s.value, J(P);
266
- }
267
- },
268
- { deep: !0, immediate: !0 }
269
- ), (T, j) => {
270
- var $;
271
- return X(), re("div", nr, [
272
- (X(), Be(Oe, {
273
- columns: o.value,
274
- key: o.value,
275
- tableData: s.value,
276
- isShowPagination: y.value,
277
- isShowEdit: !1,
278
- isShowDelete: !1,
279
- onDbClickRow: F,
280
- extraButton: A.value,
281
- onButtonClick: j[0] || (j[0] = (x) => z(x, ""))
282
- }, qn({ _: 2 }, [
283
- (($ = _.value) == null ? void 0 : $.length) > 0 ? {
284
- name: "actions",
285
- fn: ce(({ item: x }) => [
286
- (X(!0), re(Ze, null, Qe(_.value, (L, W) => (X(), re("div", { key: W }, [
287
- M("div", {
288
- style: Jn({ color: L == null ? void 0 : L.textColor }),
289
- class: "extra-button-label",
290
- onClick: (q) => z(L == null ? void 0 : L.label, x)
291
- }, Z(L == null ? void 0 : L.label), 13, rr)
292
- ]))), 128))
293
- ]),
294
- key: "0"
295
- } : void 0
296
- ]), 1032, ["columns", "tableData", "isShowPagination", "extraButton"])),
297
- Y(Vn, {
298
- title: c.value,
299
- visible: O.value,
300
- width: w.value,
301
- onBeforeDestroy: K
302
- }, {
303
- default: ce(() => [
304
- Y(et, {
305
- rowContents: p.value,
306
- isEnableWrap: !1,
307
- onChange: Q,
308
- isEdit: d.value
309
- }, null, 8, ["rowContents", "isEdit"])
310
- ]),
311
- footer: ce(() => [
312
- g.value ? (X(), re("div", or, [
313
- M("div", {
314
- onClick: j[1] || (j[1] = (x) => O.value = !1),
315
- class: "cancel-button"
316
- }, Z("取消")),
317
- M("div", {
318
- class: "ok-button",
319
- onClick: I
320
- }, Z("确认"))
321
- ])) : Yt("", !0)
322
- ]),
323
- _: 1
324
- }, 8, ["title", "visible", "width"])
325
- ]);
326
- };
327
- }
328
- }, ar = /* @__PURE__ */ Re(sr, [["__scopeId", "data-v-781eace3"]]), qe = [
329
- {
330
- key: "单选",
331
- value: "Select"
332
- },
333
- {
334
- key: "日期",
335
- value: "Date"
336
- },
337
- {
338
- key: "长文本",
339
- value: "TextArea"
340
- },
341
- {
342
- key: "上传",
343
- value: "Upload"
344
- }
345
- ], lr = { class: "form-content" }, ir = {
346
- __name: "index",
347
- props: {
348
- itemData: {
349
- type: Array,
350
- default: () => []
351
- },
352
- childItemData: {
353
- type: Array,
354
- default: () => []
355
- },
356
- index: Number
357
- },
358
- emits: ["change", "contentChange"],
359
- setup(e, { emit: t }) {
360
- const n = e, r = t, o = U([]), s = U(!1), a = U([]), l = nn(he), d = U(), i = (c) => {
361
- var p, h, u, R;
362
- const O = (h = (p = v(n.itemData)) == null ? void 0 : p.find((b) => (b == null ? void 0 : b.key) === "formContent")) == null ? void 0 : h.contents, _ = v(c.content);
363
- let g = {};
364
- _ && ((u = Object.values(_)) == null ? void 0 : u.length) > 0 && ((R = Object.values(_)) == null || R.forEach((b, m) => {
365
- g[O[m].key] = b;
366
- }));
367
- const A = {
368
- content: g,
369
- index: n == null ? void 0 : n.index,
370
- buttonName: c == null ? void 0 : c.buttonName
371
- };
372
- r("change", A);
373
- }, y = (c) => {
374
- var g, A;
375
- if (!c) return;
376
- if (((g = Object.values(v(c))) == null ? void 0 : g.length) > 0) {
377
- const p = (A = Object.values(v(c))) == null ? void 0 : A.map((u) => u);
378
- let h = "";
379
- p == null || p.forEach((u) => {
380
- u !== "" && u !== void 0 && (h = h === "" ? u : h + "/" + u);
381
- }), l.setSelectArray(p), l.setSelectString(h);
382
- }
383
- const O = v(n.itemData), _ = O == null ? void 0 : O.map((p) => {
384
- var h;
385
- return (p == null ? void 0 : p.key) === "formContent" && ((h = p.contents) == null || h.map((u, R) => {
386
- var b, m, E, S, D, N, w, K, F, J, z, H, I, k;
387
- return u.type = u != null && u.type ? u.type : (E = (m = (b = u == null ? void 0 : u.key.split("$")) == null ? void 0 : b[1]) == null ? void 0 : m.split("(")) != null && E[0] ? (S = qe == null ? void 0 : qe.find((Q) => {
388
- var T, j, $;
389
- return (Q == null ? void 0 : Q.key) === (($ = (j = (T = u == null ? void 0 : u.key.split("$")) == null ? void 0 : T[1]) == null ? void 0 : j.split("(")) == null ? void 0 : $[0]);
390
- })) == null ? void 0 : S.value : "Input", u.options = u != null && u.options ? u.options : ((N = (D = u == null ? void 0 : u.key.split("$")) == null ? void 0 : D[1]) == null ? void 0 : N.length) > 0 ? (F = (K = Wn((w = u == null ? void 0 : u.key.split("$")) == null ? void 0 : w[1])) == null ? void 0 : K.split(",")) == null ? void 0 : F.map((Q) => ({
391
- label: Q,
392
- value: Q
393
- })) : [], u != null && u.key.includes("$") && (u.key = (J = u == null ? void 0 : u.key.split("$")) == null ? void 0 : J[0]), u.value = u != null && u.value ? u.value : Array.isArray((z = Object.values(c)) == null ? void 0 : z[R]) ? (I = (H = Object.values(c)) == null ? void 0 : H[R]) == null ? void 0 : I[0] : (k = Object.values(c)) == null ? void 0 : k[R], u;
394
- })), p;
395
- });
396
- r("contentChange", {
397
- contents: _,
398
- index: n.index
399
- });
400
- };
401
- return de(
402
- () => n.itemData,
403
- () => {
404
- var A, p, h, u, R, b, m, E, S, D;
405
- const c = (A = v(n.itemData)) == null ? void 0 : A.find((N) => (N == null ? void 0 : N.key) === "formContent"), O = (p = v(n.itemData)) == null ? void 0 : p.find((N) => (N == null ? void 0 : N.key) === "formButton"), _ = (h = v(n.itemData)) == null ? void 0 : h.find((N) => (N == null ? void 0 : N.key) === "formFlex"), g = (u = v(n.itemData)) == null ? void 0 : u.find((N) => (N == null ? void 0 : N.key) === "formWrap");
406
- if ((g == null ? void 0 : g.contents) === "纵向" ? s.value = !1 : s.value = !0, d.value = typeof (_ == null ? void 0 : _.contents) != "boolean" ? !(!(_ != null && _.contents) === "" || ((R = _ == null ? void 0 : _.contents) == null ? void 0 : R.toUpperCase()) === "VERTICAL") : _ == null ? void 0 : _.contents, ((b = c == null ? void 0 : c.contents) == null ? void 0 : b.length) > 0 && Array.isArray(c == null ? void 0 : c.contents)) {
407
- const N = [];
408
- (m = c == null ? void 0 : c.contents) == null || m.forEach((F, J) => {
409
- var z, H, I, k, Q, T, j, $, x;
410
- if ((F == null ? void 0 : F.label) !== "") {
411
- let L = (F == null ? void 0 : F.key) ?? "", W = (F == null ? void 0 : F.type) ?? "", q = (F == null ? void 0 : F.options) ?? [];
412
- if (F != null && F.key.includes("$") && (L = (z = v(F == null ? void 0 : F.key).split("$")) == null ? void 0 : z[0], ((I = (H = v(F == null ? void 0 : F.key).split("$")) == null ? void 0 : H[1]) == null ? void 0 : I.length) > 0)) {
413
- const [V, ae] = (Q = (k = v(F == null ? void 0 : F.key).split("$")) == null ? void 0 : k[1]) == null ? void 0 : Q.split(/[()]/);
414
- W = ((T = qe.find((le) => (le == null ? void 0 : le.key) === V)) == null ? void 0 : T.value) ?? "", ((j = ae == null ? void 0 : ae.split(",")) == null ? void 0 : j.length) > 0 && (q = ($ = ae == null ? void 0 : ae.split(",")) == null ? void 0 : $.map((le) => ({
415
- label: le,
416
- value: le
417
- })));
418
- }
419
- N.push({
420
- label: L ?? "",
421
- name: "t" + J,
422
- type: W === "" ? "Input" : W,
423
- value: F != null && F.value ? F.value : (q == null ? void 0 : q.length) > 0 ? (x = q == null ? void 0 : q[0]) == null ? void 0 : x.value : (F == null ? void 0 : F.value) ?? "",
424
- id: (F == null ? void 0 : F.id) ?? J,
425
- contents: q ?? [],
426
- width: (F == null ? void 0 : F.width) ?? 1
427
- });
428
- }
429
- });
430
- const w = (E = v(N)) == null ? void 0 : E.map((F) => F.value);
431
- let K = "";
432
- w == null || w.forEach((F) => {
433
- F !== "" && F !== void 0 && (K = K === "" ? F : K + "/" + F);
434
- }), l.setSelectArray(w), l.setSelectString(K), o.value = N;
435
- } else
436
- o.value = [];
437
- if (((S = O == null ? void 0 : O.contents) == null ? void 0 : S.length) > 0) {
438
- const N = [];
439
- (D = O == null ? void 0 : O.contents) == null || D.forEach((w, K) => {
440
- (w == null ? void 0 : w.label) !== "" && N.push({
441
- label: (w == null ? void 0 : w.label) ?? "",
442
- id: (w == null ? void 0 : w.id) ?? K,
443
- type: (w == null ? void 0 : w.type) ?? "",
444
- background: w == null ? void 0 : w.background
445
- });
446
- }), a.value = N;
447
- } else
448
- a.value = [];
449
- },
450
- { deep: !0, immediate: !0 }
451
- ), (c, O) => (X(), re("div", lr, [
452
- Y(et, {
453
- rowContents: o.value,
454
- buttonValue: a.value,
455
- isRowFlex: d.value,
456
- isEnableWrap: !1,
457
- onOnButtonClick: i,
458
- onChange: y,
459
- isButtonRow: s.value
460
- }, null, 8, ["rowContents", "buttonValue", "isRowFlex", "isButtonRow"])
461
- ]));
462
- }
463
- }, cr = /* @__PURE__ */ Re(ir, [["__scopeId", "data-v-156885e4"]]), ur = { class: "table-operate-content" }, fr = { class: "table-operate-item" }, pr = { class: "operate-title" }, dr = { class: "operate-content" }, hr = { class: "operate-title" }, mr = { class: "operate-content" }, yr = { class: "operate-title" }, br = { class: "operate-content" }, gr = { class: "operate-content" }, vr = {
464
- __name: "operate",
465
- props: {
466
- itemContents: {
467
- type: Array,
468
- default: () => []
469
- },
470
- originalItemContents: {
471
- type: Array,
472
- default: () => []
473
- }
474
- },
475
- emits: ["change"],
476
- setup(e, { emit: t }) {
477
- const n = e, r = t, o = U([]), s = U([]), a = U([]), l = U([{
478
- label: "按钮名称",
479
- prop: "label",
480
- type: "edit"
481
- }, {
482
- label: "按钮类型",
483
- prop: "type",
484
- type: "edit"
485
- }, {
486
- label: "按钮背景颜色",
487
- prop: "background",
488
- type: "edit",
489
- columnType: "Color"
490
- }, {
491
- label: "操作",
492
- prop: "operate",
493
- type: "operate",
494
- sortable: !1
495
- }]), d = U([{
496
- label: "标签名称",
497
- prop: "label",
498
- type: "edit"
499
- }, {
500
- label: "标签类型",
501
- prop: "type",
502
- type: "edit"
503
- }, {
504
- label: "按钮文字颜色",
505
- prop: "textColor",
506
- type: "edit",
507
- columnType: "Color"
508
- }, {
509
- label: "操作",
510
- prop: "operate",
511
- type: "operate",
512
- sortable: !1
513
- }]), i = U([]), y = U(0), c = U([{
514
- name: "isPagination",
515
- label: "是否显示分页",
516
- type: "Switch",
517
- value: !0
518
- }]), O = [{
519
- label: "标签名",
520
- prop: "label",
521
- type: "edit"
522
- }, {
523
- label: "属性名",
524
- prop: "prop",
525
- type: "edit"
526
- }, {
527
- label: "宽度",
528
- prop: "width",
529
- type: "edit",
530
- columnType: "Number"
531
- }, {
532
- label: "是否固定列",
533
- prop: "fixed",
534
- type: "edit",
535
- columnType: "Radio",
536
- contents: [{
537
- label: "left",
538
- value: "左"
539
- }, {
540
- label: "right",
541
- value: "右"
542
- }]
543
- }, {
544
- label: "是否支持排序",
545
- prop: "sortable",
546
- type: "edit",
547
- columnType: "Switch"
548
- }, {
549
- label: "文本所在位置",
550
- prop: "align",
551
- type: "edit",
552
- columnType: "Radio",
553
- contents: [{
554
- label: "left",
555
- value: "左"
556
- }, {
557
- label: "center",
558
- value: "中"
559
- }, {
560
- label: "right",
561
- value: "右"
562
- }]
563
- }, {
564
- label: "溢出悬浮文字",
565
- prop: "showOverflowTooltip",
566
- type: "edit",
567
- columnType: "Switch"
568
- }, {
569
- label: "是否不可拖动",
570
- prop: "isNotDrag",
571
- type: "edit",
572
- columnType: "Switch"
573
- }, {
574
- label: "是否可编辑列名",
575
- //暂不支持
576
- prop: "isEditCol",
577
- type: "edit",
578
- columnType: "Switch"
579
- }, {
580
- label: "是否出现在附属界面",
581
- //暂不支持
582
- prop: "isOperate",
583
- type: "edit",
584
- columnType: "Switch"
585
- }, {
586
- label: "操作",
587
- prop: "operate",
588
- type: "operate",
589
- sortable: !1
590
- }], _ = (b) => {
591
- let m = v(o.value);
592
- const E = m == null ? void 0 : m.find((S) => S.key === "page");
593
- (E == null ? void 0 : E.contents) !== void 0 ? m = m == null ? void 0 : m.map((S) => ((S == null ? void 0 : S.key) === "page" && (S.contents = b == null ? void 0 : b.isPagination), S)) : m.push({
594
- key: "page",
595
- contents: b == null ? void 0 : b.isPagination
596
- }), o.value = m;
597
- };
598
- de(
599
- () => n.originalItemContents,
600
- () => {
601
- var b, m, E, S, D, N, w, K, F, J, z, H, I;
602
- !n.originalItemContents || n.originalItemContents.length === 0 || (o.value = v(n.originalItemContents), s.value = (m = (b = o.value) == null ? void 0 : b.find((k) => (k == null ? void 0 : k.key) === "header")) == null ? void 0 : m.contents, a.value = (S = (E = o.value) == null ? void 0 : E.find((k) => (k == null ? void 0 : k.key) === "rowButton")) == null ? void 0 : S.contents, l.value = (N = (D = o.value) == null ? void 0 : D.find((k) => (k == null ? void 0 : k.key) === "extraButton")) == null ? void 0 : N.contents, c.value = (K = (w = o.value) == null ? void 0 : w.find((k) => (k == null ? void 0 : k.key) === "page")) != null && K.contents ? [{
603
- name: "isPagination",
604
- label: "是否显示分页",
605
- type: "Switch",
606
- value: (J = (F = o.value) == null ? void 0 : F.find((k) => (k == null ? void 0 : k.key) === "page")) == null ? void 0 : J.contents
607
- }] : [{
608
- name: "isPagination",
609
- label: "是否显示分页",
610
- type: "Switch",
611
- value: !0
612
- }], s.value = (z = s.value) == null ? void 0 : z.map((k, Q) => k = {
613
- label: (k == null ? void 0 : k.label) ?? "",
614
- prop: (k == null ? void 0 : k.label) === "操作" ? "operate" : k == null ? void 0 : k.prop,
615
- width: k != null && k.width ? parseInt(k.width) : "",
616
- fixed: (k == null ? void 0 : k.fixed) ?? void 0,
617
- sortable: (k == null ? void 0 : k.sortable) ?? !1,
618
- align: (k == null ? void 0 : k.align) ?? "center",
619
- showOverflowTooltip: (k == null ? void 0 : k.showOverflowTooltip) ?? !0,
620
- isNotDrag: (k == null ? void 0 : k.isNotDrag) ?? !1,
621
- isEditCol: (k == null ? void 0 : k.isEditCol) ?? !1,
622
- isOperate: (k == null ? void 0 : k.isOperate) ?? !1,
623
- id: (k == null ? void 0 : k.id) ?? Q
624
- }), a.value = (H = a.value) == null ? void 0 : H.map((k, Q) => k = {
625
- label: (k == null ? void 0 : k.label) ?? "",
626
- type: (k == null ? void 0 : k.type) ?? "",
627
- textColor: (k == null ? void 0 : k.textColor) ?? "#000000",
628
- id: (k == null ? void 0 : k.id) ?? Q
629
- }), l.value = (I = l.value) == null ? void 0 : I.map((k, Q) => k = {
630
- label: (k == null ? void 0 : k.label) ?? "",
631
- type: (k == null ? void 0 : k.type) ?? "",
632
- background: (k == null ? void 0 : k.textColor) ?? "#FFFFFF",
633
- id: (k == null ? void 0 : k.id) ?? Q
634
- }));
635
- },
636
- { deep: !0, immediate: !0 }
637
- ), de(
638
- () => c.value,
639
- () => {
640
- var E;
641
- let b = v(o.value);
642
- const m = b == null ? void 0 : b.find((S) => S.key === "page");
643
- m != null && m.contents ? b = b == null ? void 0 : b.map((S) => {
644
- var D;
645
- return (S == null ? void 0 : S.key) === "page" && (S.contents = (D = c.value) == null ? void 0 : D[0].value), S;
646
- }) : b.push({
647
- key: "page",
648
- contents: (E = c.value) == null ? void 0 : E[0].value
649
- }), o.value = b;
650
- },
651
- { immediate: !0, deep: !0 }
652
- );
653
- const g = () => {
654
- const b = v(s.value);
655
- let m = v(o.value);
656
- b.push({
657
- label: "",
658
- prop: "",
659
- width: "",
660
- fixed: void 0,
661
- sortable: !1,
662
- align: "center",
663
- showOverflowTooltip: !0,
664
- isNotDrag: !1,
665
- isEditCol: !1,
666
- isOperate: !1,
667
- id: y.value
668
- }), s.value = b, y.value++;
669
- const E = m == null ? void 0 : m.find((S) => (S == null ? void 0 : S.key) === "header");
670
- E != null && E.contents ? (E.contents = b, m = m == null ? void 0 : m.map((S) => ((S == null ? void 0 : S.key) === "header" && (S.contents = b), S))) : m.push({
671
- key: "header",
672
- contents: b
673
- }), o.value = m;
674
- }, A = () => {
675
- const b = v(a.value);
676
- let m = v(o.value);
677
- b.push({
678
- label: "",
679
- type: "",
680
- textColor: "#000000",
681
- id: y.value
682
- }), a.value = b, y.value++;
683
- const E = m == null ? void 0 : m.find((S) => (S == null ? void 0 : S.key) === "rowButton");
684
- E != null && E.contents ? (E.contents = b, m = m == null ? void 0 : m.map((S) => ((S == null ? void 0 : S.key) === "rowButton" && (S.contents = b), S))) : m.push({
685
- key: "rowButton",
686
- contents: b
687
- }), o.value = m;
688
- }, p = () => {
689
- const b = v(i.value);
690
- let m = v(o.value);
691
- b.push({
692
- label: "",
693
- type: "",
694
- background: "#FFFFFF",
695
- id: y.value
696
- }), i.value = b, y.value++;
697
- const E = m == null ? void 0 : m.find((S) => (S == null ? void 0 : S.key) === "extraButton");
698
- E != null && E.contents ? (E.contents = b, m = m == null ? void 0 : m.map((S) => ((S == null ? void 0 : S.key) === "extraButton" && (S.contents = b), S))) : m.push({
699
- key: "extraButton",
700
- contents: b
701
- }), o.value = m;
702
- }, h = (b) => {
703
- const m = v(a.value);
704
- let E = v(o.value);
705
- a.value = m.filter((D) => D.id !== b.id);
706
- const S = E == null ? void 0 : E.find((D) => D.key === "rowButton");
707
- S != null && S.contents && (E = E == null ? void 0 : E.map((D) => ((D == null ? void 0 : D.key) === "rowButton" && (D.contents = m.filter((N) => N.id !== b.id)), D))), o.value = E;
708
- }, u = (b) => {
709
- const m = v(i.value);
710
- let E = v(o.value);
711
- i.value = m.filter((D) => D.id !== b.id);
712
- const S = E == null ? void 0 : E.find((D) => D.key === "extraButton");
713
- S != null && S.contents && (E = E == null ? void 0 : E.map((D) => ((D == null ? void 0 : D.key) === "extraButton" && (D.contents = m.filter((N) => N.id !== b.id)), D))), o.value = E;
714
- }, R = (b) => {
715
- const m = v(s.value);
716
- let E = v(o.value);
717
- s.value = m.filter((D) => D.id !== b.id);
718
- const S = E == null ? void 0 : E.find((D) => D.key === "header");
719
- S != null && S.contents && (E = E == null ? void 0 : E.map((D) => ((D == null ? void 0 : D.key) === "header" && (D.contents = m.filter((N) => N.id !== b.id)), D))), o.value = E;
720
- };
721
- return de(
722
- () => [o.value, s.value],
723
- () => {
724
- let b = v(o.value);
725
- const m = b == null ? void 0 : b.find((E) => (E == null ? void 0 : E.key) === "header");
726
- m != null && m.contents ? (m.contents = s.value, b = b == null ? void 0 : b.map((E) => ((E == null ? void 0 : E.key) === "header" && (E.contents = s.value), E))) : b.push({
727
- key: "header",
728
- contents: s.value
729
- }), r("change", b);
730
- },
731
- { deep: !0, immediate: !0 }
732
- ), (b, m) => {
733
- const E = We("el-button");
734
- return X(), re("div", ur, [
735
- M("div", fr, [
736
- M("div", pr, [
737
- m[1] || (m[1] = M("div", null, Z("表头"), -1)),
738
- Y(E, {
739
- class: "blue-operate-button",
740
- icon: "ele-Plus",
741
- onClick: g
742
- }, {
743
- default: ce(() => m[0] || (m[0] = [
744
- Ue(Z("新建"))
745
- ])),
746
- _: 1,
747
- __: [0]
748
- })
749
- ]),
750
- M("div", dr, [
751
- Y(Oe, {
752
- columns: O,
753
- isShowPagination: !1,
754
- isShowEdit: !1,
755
- isMoveColumn: !1,
756
- tableData: s.value,
757
- onDeleteRow: R
758
- }, null, 8, ["tableData"])
759
- ]),
760
- M("div", hr, [
761
- m[3] || (m[3] = M("div", null, Z("行内按钮"), -1)),
762
- Y(E, {
763
- class: "blue-operate-button",
764
- icon: "ele-Plus",
765
- onClick: A
766
- }, {
767
- default: ce(() => m[2] || (m[2] = [
768
- Ue(Z("新建"))
769
- ])),
770
- _: 1,
771
- __: [2]
772
- })
773
- ]),
774
- M("div", mr, [
775
- Y(Oe, {
776
- columns: d.value,
777
- isShowPagination: !1,
778
- isShowEdit: !1,
779
- isMoveColumn: !1,
780
- tableData: a.value,
781
- onDeleteRow: h
782
- }, null, 8, ["columns", "tableData"])
783
- ]),
784
- M("div", yr, [
785
- m[5] || (m[5] = M("div", null, Z("表格外部按钮"), -1)),
786
- Y(E, {
787
- class: "blue-operate-button",
788
- icon: "ele-Plus",
789
- onClick: p
790
- }, {
791
- default: ce(() => m[4] || (m[4] = [
792
- Ue(Z("新建"))
793
- ])),
794
- _: 1,
795
- __: [4]
796
- })
797
- ]),
798
- M("div", br, [
799
- Y(Oe, {
800
- columns: l.value,
801
- isShowPagination: !1,
802
- isShowEdit: !1,
803
- isMoveColumn: !1,
804
- tableData: i.value,
805
- onDeleteRow: u
806
- }, null, 8, ["columns", "tableData"])
807
- ]),
808
- m[6] || (m[6] = M("div", { class: "operate-title" }, [
809
- M("div", null, Z("分页"))
810
- ], -1)),
811
- M("div", gr, [
812
- Y(et, {
813
- rowContents: c.value,
814
- onChange: _
815
- }, null, 8, ["rowContents"])
816
- ])
817
- ])
818
- ]);
819
- };
820
- }
821
- }, kr = /* @__PURE__ */ Re(vr, [["__scopeId", "data-v-877911eb"]]), Er = { class: "form-operate-content" }, Sr = { class: "form-operate-item" }, Rr = { class: "operate-title" }, _r = { class: "operate-content" }, wr = { class: "operate-title" }, Or = { class: "operate-content" }, Tr = { class: "operate-content" }, Ar = {
822
- __name: "operate",
823
- props: {
824
- itemContents: {
825
- type: Array,
826
- default: () => []
827
- },
828
- originalItemContents: {
829
- type: Array,
830
- default: () => []
831
- }
832
- },
833
- emits: ["change"],
834
- setup(e, { emit: t }) {
835
- const n = e, r = t, o = U([{
836
- name: "isRowFlex",
837
- label: "是否横向布局",
838
- type: "Switch",
839
- value: !0
840
- }]), s = U([{
841
- label: "字段名称",
842
- prop: "label",
843
- type: "edit"
844
- }, {
845
- label: "字段类型",
846
- prop: "type",
847
- type: "edit"
848
- }, {
849
- label: "字段值",
850
- prop: "key",
851
- type: "edit"
852
- }, {
853
- label: "字段选项值",
854
- prop: "options",
855
- type: "edit"
856
- }, {
857
- label: "操作",
858
- prop: "operate",
859
- type: "operate",
860
- sortable: !1
861
- }]), a = U([{
862
- label: "字段名称",
863
- prop: "label",
864
- type: "edit"
865
- }, {
866
- label: "字段类型",
867
- prop: "type",
868
- type: "edit"
869
- }, {
870
- label: "按钮背景颜色",
871
- prop: "background",
872
- type: "edit",
873
- columnType: "Color"
874
- }, {
875
- label: "操作",
876
- prop: "operate",
877
- type: "operate",
878
- sortable: !1
879
- }]), l = U([]), d = U([]), i = U([]), y = U(0);
880
- de(
881
- () => n.originalItemContents,
882
- () => {
883
- var p, h, u, R, b, m, E, S, D, N;
884
- !n.originalItemContents || n.originalItemContents.length === 0 || (d.value = v(n.originalItemContents), i.value = (h = (p = d.value) == null ? void 0 : p.find((w) => (w == null ? void 0 : w.key) === "formContent")) == null ? void 0 : h.contents, l.value = (R = (u = d.value) == null ? void 0 : u.find((w) => (w == null ? void 0 : w.key) === "formButton")) == null ? void 0 : R.contents, i.value = (b = i.value) == null ? void 0 : b.map((w, K) => w = {
885
- label: (w == null ? void 0 : w.label) ?? "",
886
- type: (w == null ? void 0 : w.type) ?? "",
887
- key: (w == null ? void 0 : w.key) ?? "",
888
- options: (w == null ? void 0 : w.options) ?? "",
889
- id: (w == null ? void 0 : w.id) ?? K
890
- }), l.value = (m = l.value) == null ? void 0 : m.map((w, K) => w = {
891
- label: (w == null ? void 0 : w.label) ?? "",
892
- type: (w == null ? void 0 : w.type) ?? "",
893
- background: (w == null ? void 0 : w.background) ?? "#000000",
894
- id: (w == null ? void 0 : w.id) ?? K
895
- }), o.value = (S = (E = d.value) == null ? void 0 : E.find((w) => (w == null ? void 0 : w.key) === "formFlex")) != null && S.contents ? [{
896
- name: "isRowFlex",
897
- label: "是否横向布局",
898
- type: "Switch",
899
- value: (N = (D = d.value) == null ? void 0 : D.find((w) => (w == null ? void 0 : w.key) === "formFlex")) == null ? void 0 : N.contents
900
- }] : [{
901
- name: "isRowFlex",
902
- label: "是否横向布局",
903
- type: "Switch",
904
- value: !0
905
- }]);
906
- },
907
- { deep: !0, immediate: !0 }
908
- );
909
- const c = () => {
910
- const p = v(l.value);
911
- let h = v(d.value);
912
- p.push({
913
- label: "",
914
- type: "",
915
- background: "#000000",
916
- id: y.value
917
- }), l.value = p, y.value++;
918
- const u = h == null ? void 0 : h.find((R) => (R == null ? void 0 : R.key) === "formButton");
919
- u != null && u.contents ? (u.contents = p, h = h == null ? void 0 : h.map((R) => ((R == null ? void 0 : R.key) === "formButton" && (R.contents = p), R))) : h.push({
920
- key: "formButton",
921
- contents: p
922
- }), d.value = h;
923
- }, O = () => {
924
- const p = v(i.value);
925
- let h = v(d.value);
926
- p.push({
927
- label: "",
928
- type: "",
929
- key: "",
930
- options: "",
931
- id: y.value
932
- }), i.value = p, y.value++;
933
- const u = h == null ? void 0 : h.find((R) => (R == null ? void 0 : R.key) === "formContent");
934
- u != null && u.contents ? (u.contents = p, h = h == null ? void 0 : h.map((R) => ((R == null ? void 0 : R.key) === "formContent" && (R.contents = p), R))) : h.push({
935
- key: "formContent",
936
- contents: p
937
- }), d.value = h;
938
- }, _ = (p) => {
939
- const h = v(l.value);
940
- let u = v(d.value);
941
- l.value = h.filter((b) => b.id !== p.id);
942
- const R = u == null ? void 0 : u.find((b) => b.key === "formButton");
943
- R != null && R.contents && (u = u == null ? void 0 : u.map((b) => ((b == null ? void 0 : b.key) === "formButton" && (b.contents = h.filter((m) => m.id !== p.id)), b))), d.value = u;
944
- }, g = (p) => {
945
- const h = v(i.value);
946
- let u = v(d.value);
947
- i.value = h.filter((b) => b.id !== p.id);
948
- const R = u == null ? void 0 : u.find((b) => b.key === "formContent");
949
- R != null && R.contents && (u = u == null ? void 0 : u.map((b) => ((b == null ? void 0 : b.key) === "formContent" && (b.contents = h.filter((m) => m.id !== p.id)), b))), d.value = u;
950
- }, A = (p) => {
951
- let h = v(d.value);
952
- const u = h == null ? void 0 : h.find((R) => R.key === "formFlex");
953
- (u == null ? void 0 : u.contents) !== void 0 ? h = h == null ? void 0 : h.map((R) => ((R == null ? void 0 : R.key) === "formFlex" && (R.contents = p == null ? void 0 : p.isRowFlex), R)) : h.push({
954
- key: "formFlex",
955
- contents: p == null ? void 0 : p.isRowFlex
956
- }), d.value = h;
957
- };
958
- return de(
959
- () => [d.value, i.value],
960
- () => {
961
- let p = v(d.value);
962
- const h = p == null ? void 0 : p.find((u) => (u == null ? void 0 : u.key) === "formContent");
963
- h != null && h.contents ? (h.contents = i.value, p = p == null ? void 0 : p.map((u) => ((u == null ? void 0 : u.key) === "formContent" && (u.contents = i.value), u))) : p.push({
964
- key: "formContent",
965
- contents: i.value
966
- }), r("change", p);
967
- },
968
- { deep: !0, immediate: !0 }
969
- ), (p, h) => {
970
- const u = We("el-button");
971
- return X(), re("div", Er, [
972
- M("div", Sr, [
973
- M("div", Rr, [
974
- h[1] || (h[1] = M("div", null, Z("表单信息"), -1)),
975
- Y(u, {
976
- class: "blue-operate-button",
977
- icon: "ele-Plus",
978
- onClick: O
979
- }, {
980
- default: ce(() => h[0] || (h[0] = [
981
- Ue(Z("新建"))
982
- ])),
983
- _: 1,
984
- __: [0]
985
- })
986
- ]),
987
- M("div", _r, [
988
- Y(Oe, {
989
- columns: s.value,
990
- isShowPagination: !1,
991
- isShowEdit: !1,
992
- isMoveColumn: !1,
993
- tableData: i.value,
994
- onDeleteRow: g
995
- }, null, 8, ["columns", "tableData"])
996
- ]),
997
- M("div", wr, [
998
- h[3] || (h[3] = M("div", null, Z("表单按钮"), -1)),
999
- Y(u, {
1000
- class: "blue-operate-button",
1001
- icon: "ele-Plus",
1002
- onClick: c
1003
- }, {
1004
- default: ce(() => h[2] || (h[2] = [
1005
- Ue(Z("新建"))
1006
- ])),
1007
- _: 1,
1008
- __: [2]
1009
- })
1010
- ]),
1011
- M("div", Or, [
1012
- Y(Oe, {
1013
- columns: a.value,
1014
- isShowPagination: !1,
1015
- isShowEdit: !1,
1016
- isMoveColumn: !1,
1017
- tableData: l.value,
1018
- onDeleteRow: _
1019
- }, null, 8, ["columns", "tableData"])
1020
- ]),
1021
- h[4] || (h[4] = M("div", { class: "operate-title" }, [
1022
- M("div", null, Z("表单布局"))
1023
- ], -1)),
1024
- M("div", Tr, [
1025
- Y(et, {
1026
- rowContents: o.value,
1027
- onChange: A
1028
- }, null, 8, ["rowContents"])
1029
- ])
1030
- ])
1031
- ]);
1032
- };
1033
- }
1034
- }, Cr = /* @__PURE__ */ Re(Ar, [["__scopeId", "data-v-a36b8468"]]), xr = U([
1035
- {
1036
- name: "表格",
1037
- type: "table",
1038
- comp: "Table",
1039
- icon: "Grid"
1040
- },
1041
- {
1042
- name: "表单",
1043
- type: "form",
1044
- comp: "Form",
1045
- icon: "Film"
1046
- },
1047
- {
1048
- name: "折叠",
1049
- type: "fold",
1050
- comp: "Fold",
1051
- icon: "Fold"
1052
- }
1053
- ]), Dr = {
1054
- Table: ar,
1055
- Form: cr,
1056
- TableOperate: kr,
1057
- FormOperate: Cr,
1058
- Fold: Kn
1059
- // 添加其他组件...
1060
- };
1061
- function ln(e) {
1062
- return Dr[e] || null;
1063
- }
1064
- const Fr = { class: "type-select" }, Nr = ["onClick"], Pr = { class: "list-icon" }, Ur = {
1065
- __name: "index",
1066
- setup(e) {
1067
- const t = Ye(he), { itemData: n } = Ee(t), r = (s) => Hn[s], o = (s) => {
1068
- const a = v(n.value);
1069
- a.push({
1070
- comp: s.comp,
1071
- name: s.name,
1072
- compData: []
1073
- }), t.setItemData(a);
1074
- };
1075
- return (s, a) => (X(), re("div", Fr, [
1076
- (X(!0), re(Ze, null, Qe(en(xr), (l, d) => (X(), re("div", {
1077
- class: "type-list",
1078
- key: d
1079
- }, [
1080
- M("div", {
1081
- class: "list-content",
1082
- onClick: (i) => o(l)
1083
- }, [
1084
- M("div", Pr, [
1085
- (X(), Be(Et(r(l.icon))))
1086
- ]),
1087
- M("div", null, Z(l.name), 1)
1088
- ], 8, Nr)
1089
- ]))), 128))
1090
- ]));
1091
- }
1092
- }, $s = /* @__PURE__ */ Re(Ur, [["__scopeId", "data-v-fe4aecc8"]]), Br = { class: "fill-content" }, jr = { class: "operate-content" }, $r = { class: "collapse-title" }, Lr = { class: "comp-child" }, qr = {
1093
- __name: "index",
1094
- setup(e) {
1095
- const t = Ye(he), { itemData: n, originalData: r } = Ee(t), o = U([]), s = U([]);
1096
- de(
1097
- () => n.value,
1098
- () => {
1099
- var d;
1100
- !n.value || ((d = n.value) == null ? void 0 : d.length) === 0 || (o.value = v(n.value));
1101
- },
1102
- { deep: !0, immediate: !0 }
1103
- );
1104
- const a = (d) => ln(d), l = (d, i, y) => {
1105
- if (!d || d.length === 0) return;
1106
- let c = v(n.value);
1107
- const O = v(i);
1108
- O.compData = d, c = c == null ? void 0 : c.map((_, g) => (g === y && (_ = O), _)), t.setItemData(c);
1109
- };
1110
- return (d, i) => {
1111
- const y = We("el-collapse-item"), c = We("el-collapse");
1112
- return X(), re("div", Br, [
1113
- i[1] || (i[1] = M("div", { class: "fill-operate" }, Z("操作栏"), -1)),
1114
- M("div", jr, [
1115
- Y(c, {
1116
- modelValue: s.value,
1117
- "onUpdate:modelValue": i[0] || (i[0] = (O) => s.value = O),
1118
- class: "collapse-content"
1119
- }, {
1120
- default: ce(() => [
1121
- (X(!0), re(Ze, null, Qe(o.value, (O, _) => (X(), Be(y, {
1122
- key: _,
1123
- name: _
1124
- }, {
1125
- title: ce(() => [
1126
- M("div", $r, Z(O.name), 1)
1127
- ]),
1128
- default: ce(() => {
1129
- var g, A;
1130
- return [
1131
- M("div", Lr, [
1132
- (X(), Be(Et(a(O.comp + "Operate")), {
1133
- itemContents: O == null ? void 0 : O.compData,
1134
- originalItemContents: (A = (g = en(r)) == null ? void 0 : g.find((p, h) => h === _)) == null ? void 0 : A.compData,
1135
- onChange: (p) => l(p, O, _)
1136
- }, null, 40, ["itemContents", "originalItemContents", "onChange"]))
1137
- ])
1138
- ];
1139
- }),
1140
- _: 2
1141
- }, 1032, ["name"]))), 128))
1142
- ]),
1143
- _: 1
1144
- }, 8, ["modelValue"])
1145
- ])
1146
- ]);
1147
- };
1148
- }
1149
- }, Ls = /* @__PURE__ */ Re(qr, [["__scopeId", "data-v-a216b035"]]), Jr = {
1150
- key: 0,
1151
- class: "show-content"
1152
- }, Mr = {
1153
- __name: "index",
1154
- setup(e) {
1155
- const t = Ye(he), { itemData: n } = Ee(t), r = U([]);
1156
- de(
1157
- () => n.value,
1158
- () => {
1159
- var s;
1160
- !n.value || ((s = n.value) == null ? void 0 : s.length) === 0 || (r.value = v(n.value));
1161
- },
1162
- { deep: !0, immediate: !0 }
1163
- );
1164
- const o = (s) => ln(s);
1165
- return (s, a) => {
1166
- var l;
1167
- return ((l = r.value) == null ? void 0 : l.length) > 0 ? (X(), re("div", Jr, [
1168
- (X(!0), re(Ze, null, Qe(r.value, (d, i) => (X(), re("div", {
1169
- class: "item-content",
1170
- key: i
1171
- }, [
1172
- M("div", null, Z(d.name), 1),
1173
- (X(), Be(Et(o(d.comp)), {
1174
- itemData: d == null ? void 0 : d.compData,
1175
- childItemData: d == null ? void 0 : d.itemChildData,
1176
- key: i
1177
- }, null, 8, ["itemData", "childItemData"]))
1178
- ]))), 128))
1179
- ])) : Yt("", !0);
1180
- };
1181
- }
1182
- }, qs = /* @__PURE__ */ Re(Mr, [["__scopeId", "data-v-79320497"]]), ne = [
1183
- {
1184
- key: "FormName",
1185
- value: "Form"
1186
- },
1187
- {
1188
- key: "TableName",
1189
- value: "Table"
1190
- },
1191
- {
1192
- key: "MenuName",
1193
- value: "Menu"
1194
- },
1195
- {
1196
- key: "GroupName",
1197
- value: "Group"
1198
- },
1199
- {
1200
- key: "SystemKey",
1201
- value: "System"
1202
- }
1203
- ], te = [
1204
- {
1205
- key: "FormDirect",
1206
- value: "formFlex"
1207
- },
1208
- {
1209
- key: "Form",
1210
- value: "formContent"
1211
- },
1212
- {
1213
- key: "FormButton",
1214
- value: "formButton"
1215
- },
1216
- {
1217
- key: "FormFlex",
1218
- value: "formWrap"
1219
- },
1220
- {
1221
- key: "TableColumns",
1222
- value: "header"
1223
- },
1224
- {
1225
- key: "TableButton",
1226
- value: "extraButton"
1227
- },
1228
- {
1229
- key: "TableLineButton",
1230
- value: "rowButton"
1231
- },
1232
- {
1233
- key: "Table",
1234
- value: "tableContents"
1235
- },
1236
- {
1237
- key: "TableIndex",
1238
- value: "tableIndex"
1239
- },
1240
- {
1241
- key: "Menus",
1242
- value: "menuContents"
1243
- },
1244
- {
1245
- key: "GroupContents",
1246
- value: "groupContents"
1247
- }
1248
- ], Je = U(0), ct = U(0), zr = (e) => {
1249
- let t;
1250
- e.includes(`\r
1251
- `) ? t = e.split(`\r
1252
- `).filter((o) => o.trim() !== "") : t = e.split(`
1253
- `).filter((o) => o.trim() !== "");
1254
- const n = [];
1255
- let r = "";
1256
- for (const o of t)
1257
- o.includes("{") || r.includes("{") || o.includes("[") || r.includes("[") || o.includes("【") || r.includes("【") || o.includes("(") || r.includes("(") || o.includes("(") || r.includes("(") ? (r += o.trim(), v(r).split("{").length - 1 === v(r).split("}").length - 1 && v(r).split("【").length - 1 === v(r).split("】").length - 1 && v(r).split("[").length - 1 === v(r).split("]").length - 1 && v(r).split("(").length - 1 === v(r).split(")").length - 1 && v(r).split("(").length - 1 === v(r).split(")").length - 1 && (n.push(r), r = "")) : n.push(o.trim());
1258
- return n;
1259
- }, Hr = (e) => {
1260
- const t = e.trim().replace(/^'|'$/g, ""), n = /((?:\$?[a-zA-Z_][a-zA-Z0-9_]*\$?\([^)]*\))|[a-zA-Z_][a-zA-Z0-9_]*)\s*=\s*(.*?)(?=\s*(?:(?:\$?[a-zA-Z_][a-zA-Z0-9_]*\$?\([^)]*\))|[a-zA-Z_][a-zA-Z0-9_]*)\s*=|$)/g, r = {};
1261
- let o;
1262
- for (; (o = n.exec(t)) !== null; ) {
1263
- const s = o[1];
1264
- let a = o[2].trim();
1265
- (a.match(/\[/g) || []).length !== (a.match(/\]/g) || []).length && (a = a == null ? void 0 : a.replace(/]$/, "")), r[s] ? (r[s + ct.value] && ct.value++, r[s + ct.value] = s + "=" + a) : r[s] = s + "=" + a;
1266
- }
1267
- return r;
1268
- }, cn = (e) => {
1269
- const [t, n] = e.split("=").map((s) => s.trim()), r = t.replace(/['"]/g, ""), o = n.replace(/^['"]|['"]$/g, "");
1270
- return { key: r, value: o };
1271
- }, Ir = (e) => {
1272
- var a;
1273
- let t = [];
1274
- const [n, r] = e.split(/=(.+)/), o = n.replace(/['"]/g, "").trim(), s = r.replace(/^['"]|['"]$/g, "");
1275
- return (a = Object.values(Hr(s))) == null || a.forEach((l) => {
1276
- t.push(cn(l));
1277
- }), { key: o, value: t };
1278
- }, ze = (e) => {
1279
- try {
1280
- return JSON.parse(e), !0;
1281
- } catch {
1282
- return !1;
1283
- }
1284
- }, un = (e) => {
1285
- try {
1286
- const t = e.replace(/[’]|[‘]|[']/g, '"').replace(/,/g, ",").replace(/:/g, ":").replace(/:\s*(?=,|}|$)/g, ': ""');
1287
- if (v(t).split("{").length - 1 > 1) {
1288
- let n = v(t).replace(/^\{(.*)\}$/, "[$1]");
1289
- if (ze(n) && !n.includes("$") || (n = n.replace(/"([^"]+)"\$([\w\u4e00-\u9fa5]+\([^)]*\))/g, '"$1$$$2"')), ze(n)) {
1290
- const r = JSON.parse(n);
1291
- let o = [];
1292
- return r == null || r.forEach((s) => {
1293
- var a;
1294
- (a = Object.entries(v(s))) == null || a.forEach((l) => {
1295
- Je.value++, o.push({
1296
- id: Je.value,
1297
- key: (l == null ? void 0 : l[0]) ?? "",
1298
- value: (l == null ? void 0 : l[1]) === "" ? "" : l == null ? void 0 : l[1],
1299
- // 如果值为空,则key设为空字符串,否则保留原值
1300
- width: Object.keys(v(s)).length
1301
- });
1302
- });
1303
- }), o;
1304
- } else
1305
- return console.error("转换类型不正确:"), [];
1306
- } else if (ze(t)) {
1307
- const n = JSON.parse(t);
1308
- return Object.entries(n).map(([r, o]) => (Je.value++, {
1309
- id: Je.value,
1310
- key: r,
1311
- value: o === "" ? "" : o,
1312
- // 如果值为空,则key设为空字符串,否则保留原值
1313
- width: 1
1314
- }));
1315
- } else
1316
- return t;
1317
- } catch (t) {
1318
- return console.error("转换失败:", t), [];
1319
- }
1320
- }, Vr = (e, t) => {
1321
- try {
1322
- if (ne != null && ne.find((n) => (n == null ? void 0 : n.key) === t))
1323
- return JSON.parse(e.replace(/[’]|[‘]|[']/g, '"'));
1324
- if (v(e).split("[").length - 1 > 1) {
1325
- const n = v(e).replace(/[’]|[‘]|[']/g, '"').replaceAll(/,/g, ",").replaceAll("(", "[").replaceAll(")", "]").replaceAll("],]", "]]");
1326
- return JSON.parse(n);
1327
- } else {
1328
- const n = v(e).replace(/[’]|[‘]|[']/g, '"').replace(/,/g, ",");
1329
- if (ze(n)) {
1330
- const r = JSON.parse(n);
1331
- return Array.isArray(r) ? r.map((o) => ({ label: o })) : r;
1332
- } else
1333
- return un(v(e));
1334
- }
1335
- } catch (n) {
1336
- return console.error("解析失败:", n), e;
1337
- }
1338
- }, Wr = (e) => ({ [e == null ? void 0 : e.key]: Vr(e == null ? void 0 : e.value, e == null ? void 0 : e.key) }), Kr = (e) => {
1339
- try {
1340
- if (v(e).split("[").length - 1 > 1) {
1341
- const t = v(e).replace(/[’]|[‘]|[']/g, '"').replaceAll(/,/g, ",").replaceAll("(", "[").replaceAll(")", "]").replaceAll("],]", "]]");
1342
- return JSON.parse(t);
1343
- } else
1344
- return JSON.parse(v(e).replace(/[’]|[‘]|[']/g, '"').replace(/,/g, ",")).map((n) => ({ label: n }));
1345
- } catch (t) {
1346
- return console.error("解析失败:", t), e;
1347
- }
1348
- }, fn = (e) => {
1349
- var t, n, r, o, s, a;
1350
- try {
1351
- const l = zr((n = (t = v(e)) == null ? void 0 : t.replace("(", "(")) == null ? void 0 : n.replace(")", ")")), d = (r = v(l)) == null ? void 0 : r.map((c) => {
1352
- var _, g;
1353
- let O = (g = (_ = v(c)) == null ? void 0 : _.split("=")) == null ? void 0 : g[0];
1354
- return O != null && O.includes("GroupContents") ? Ir(c) : cn(c);
1355
- }), i = [];
1356
- (o = v(d)) == null || o.forEach((c) => {
1357
- var O, _, g, A, p;
1358
- ne != null && ne.find((h) => {
1359
- var u, R;
1360
- return ((u = h == null ? void 0 : h.key) == null ? void 0 : u.toUpperCase()) === ((R = c == null ? void 0 : c.key) == null ? void 0 : R.toUpperCase());
1361
- }) ? i.push({
1362
- comp: ((O = ne == null ? void 0 : ne.find((h) => {
1363
- var u, R;
1364
- return ((u = h == null ? void 0 : h.key) == null ? void 0 : u.toUpperCase()) === ((R = c == null ? void 0 : c.key) == null ? void 0 : R.toUpperCase());
1365
- })) == null ? void 0 : O.value) ?? "",
1366
- name: (_ = c == null ? void 0 : c.value) == null ? void 0 : _.replace(/[’]|[‘]|[']/g, ""),
1367
- compData: []
1368
- }) : te != null && te.find((h) => {
1369
- var u, R;
1370
- return ((u = h == null ? void 0 : h.key) == null ? void 0 : u.toUpperCase()) === ((R = c == null ? void 0 : c.key) == null ? void 0 : R.toUpperCase());
1371
- }) && ((i == null ? void 0 : i.length) === 0 && (g = c.key) != null && g.includes("Menus") && i.push({
1372
- comp: "Menu",
1373
- name: "",
1374
- compData: []
1375
- }), (A = i == null ? void 0 : i[(i == null ? void 0 : i.length) - 1]) != null && A.compData && i[(i == null ? void 0 : i.length) - 1].compData.push({
1376
- key: (p = te == null ? void 0 : te.find((h) => {
1377
- var u, R;
1378
- return ((u = h == null ? void 0 : h.key) == null ? void 0 : u.toUpperCase()) === ((R = c == null ? void 0 : c.key) == null ? void 0 : R.toUpperCase());
1379
- })) == null ? void 0 : p.value,
1380
- contents: c == null ? void 0 : c.value
1381
- }));
1382
- }), console.log("newContents", i);
1383
- let y = (s = v(i)) == null ? void 0 : s.map((c) => {
1384
- var O;
1385
- return c != null && c.compData && (c.compData = (O = c == null ? void 0 : c.compData) == null ? void 0 : O.map((_) => {
1386
- var g, A, p, h, u, R, b, m, E, S, D;
1387
- if ((_ == null ? void 0 : _.key) === "formFlex")
1388
- _.contents = ((A = (g = _.contents) == null ? void 0 : g.replace(/[’]|[‘]|[']/g, "")) == null ? void 0 : A.toUpperCase()) !== "Vertical".toUpperCase();
1389
- else if ((_ == null ? void 0 : _.key) === "groupContents")
1390
- _.contents = (p = v(_.contents)) == null ? void 0 : p.map((N) => Wr(v(N)));
1391
- else if (((u = (h = _.contents) == null ? void 0 : h.trim()) != null && u.startsWith("[") || (b = (R = _.contents) == null ? void 0 : R.trim()) != null && b.startsWith("【")) && ((E = (m = _.contents) == null ? void 0 : m.trim()) != null && E.endsWith("]") || (D = (S = _.contents) == null ? void 0 : S.trim()) != null && D.endsWith("】")))
1392
- _.contents = Kr(v(_.contents));
1393
- else {
1394
- if (!_.contents) return;
1395
- _.contents = un(v(_.contents));
1396
- }
1397
- return _;
1398
- })), c;
1399
- });
1400
- return y = (a = v(y)) == null ? void 0 : a.map((c) => {
1401
- var O;
1402
- return (c == null ? void 0 : c.comp) === "Group" && (c.compData = (O = c.compData) == null ? void 0 : O.map((_) => {
1403
- var A;
1404
- let g = [];
1405
- return (A = _.contents) == null || A.forEach((p) => {
1406
- var h, u, R, b, m, E, S, D, N, w, K, F;
1407
- if (ne != null && ne.find((J) => {
1408
- var z, H, I;
1409
- return ((z = J == null ? void 0 : J.key) == null ? void 0 : z.toUpperCase()) === ((I = (H = Object.keys(p)) == null ? void 0 : H[0]) == null ? void 0 : I.toUpperCase());
1410
- }))
1411
- g.push({
1412
- comp: (h = ne == null ? void 0 : ne.find((J) => {
1413
- var z, H, I;
1414
- return ((z = J == null ? void 0 : J.key) == null ? void 0 : z.toUpperCase()) === ((I = (H = Object.keys(p)) == null ? void 0 : H[0]) == null ? void 0 : I.toUpperCase());
1415
- })) == null ? void 0 : h.value,
1416
- name: (R = (u = Object.values(p)) == null ? void 0 : u[0]) == null ? void 0 : R.replace(/[’]|[‘]|[']/g, ""),
1417
- compData: []
1418
- });
1419
- else if (te != null && te.find((J) => {
1420
- var z, H, I;
1421
- return ((z = J == null ? void 0 : J.key) == null ? void 0 : z.toUpperCase()) === ((I = (H = Object.keys(p)) == null ? void 0 : H[0]) == null ? void 0 : I.toUpperCase());
1422
- })) {
1423
- if ((g == null ? void 0 : g.length) === 0) return;
1424
- (b = g == null ? void 0 : g[(g == null ? void 0 : g.length) - 1]) != null && b.compData && g[(g == null ? void 0 : g.length) - 1].compData.push({
1425
- key: (m = te == null ? void 0 : te.find((J) => {
1426
- var z, H, I;
1427
- return ((z = J == null ? void 0 : J.key) == null ? void 0 : z.toUpperCase()) === ((I = (H = Object.keys(p)) == null ? void 0 : H[0]) == null ? void 0 : I.toUpperCase());
1428
- })) == null ? void 0 : m.value,
1429
- contents: (E = Object.values(p)) == null ? void 0 : E[0]
1430
- });
1431
- } else if ((D = (S = Object.keys(p)) == null ? void 0 : S[0]) != null && D.includes("$")) {
1432
- const J = (w = (N = Object.keys(v(p))) == null ? void 0 : N[0]) == null ? void 0 : w.split("$");
1433
- g[(g == null ? void 0 : g.length) - 1].compData.push({
1434
- key: (K = te == null ? void 0 : te.find((z) => {
1435
- var H, I;
1436
- return ((H = z == null ? void 0 : z.key) == null ? void 0 : H.toUpperCase()) === ((I = J == null ? void 0 : J[0]) == null ? void 0 : I.toUpperCase());
1437
- })) == null ? void 0 : K.value,
1438
- contents: (F = Object.values(p)) == null ? void 0 : F[0],
1439
- selectLabel: J == null ? void 0 : J[1]
1440
- });
1441
- }
1442
- return p;
1443
- }), _.contents = g, _;
1444
- })), c;
1445
- }), y;
1446
- } catch {
1447
- return !1;
1448
- }
1449
- }, Js = (e) => fn(e), Ms = (e) => !!fn(e);
1450
- function pn(e, t) {
1451
- return function() {
1452
- return e.apply(t, arguments);
1453
- };
1454
- }
1455
- const { toString: Gr } = Object.prototype, { getPrototypeOf: St } = Object, { iterator: tt, toStringTag: dn } = Symbol, nt = /* @__PURE__ */ ((e) => (t) => {
1456
- const n = Gr.call(t);
1457
- return e[n] || (e[n] = n.slice(8, -1).toLowerCase());
1458
- })(/* @__PURE__ */ Object.create(null)), ue = (e) => (e = e.toLowerCase(), (t) => nt(t) === e), rt = (e) => (t) => typeof t === e, { isArray: Te } = Array, je = rt("undefined");
1459
- function Xr(e) {
1460
- return e !== null && !je(e) && e.constructor !== null && !je(e.constructor) && oe(e.constructor.isBuffer) && e.constructor.isBuffer(e);
1461
- }
1462
- const hn = ue("ArrayBuffer");
1463
- function Zr(e) {
1464
- let t;
1465
- return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && hn(e.buffer), t;
1466
- }
1467
- const Qr = rt("string"), oe = rt("function"), mn = rt("number"), ot = (e) => e !== null && typeof e == "object", Yr = (e) => e === !0 || e === !1, He = (e) => {
1468
- if (nt(e) !== "object")
1469
- return !1;
1470
- const t = St(e);
1471
- return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(dn in e) && !(tt in e);
1472
- }, eo = ue("Date"), to = ue("File"), no = ue("Blob"), ro = ue("FileList"), oo = (e) => ot(e) && oe(e.pipe), so = (e) => {
1473
- let t;
1474
- return e && (typeof FormData == "function" && e instanceof FormData || oe(e.append) && ((t = nt(e)) === "formdata" || // detect form-data instance
1475
- t === "object" && oe(e.toString) && e.toString() === "[object FormData]"));
1476
- }, ao = ue("URLSearchParams"), [lo, io, co, uo] = ["ReadableStream", "Request", "Response", "Headers"].map(ue), fo = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
1477
- function $e(e, t, { allOwnKeys: n = !1 } = {}) {
1478
- if (e === null || typeof e > "u")
1479
- return;
1480
- let r, o;
1481
- if (typeof e != "object" && (e = [e]), Te(e))
1482
- for (r = 0, o = e.length; r < o; r++)
1483
- t.call(null, e[r], r, e);
1484
- else {
1485
- const s = n ? Object.getOwnPropertyNames(e) : Object.keys(e), a = s.length;
1486
- let l;
1487
- for (r = 0; r < a; r++)
1488
- l = s[r], t.call(null, e[l], l, e);
1489
- }
1490
- }
1491
- function yn(e, t) {
1492
- t = t.toLowerCase();
1493
- const n = Object.keys(e);
1494
- let r = n.length, o;
1495
- for (; r-- > 0; )
1496
- if (o = n[r], t === o.toLowerCase())
1497
- return o;
1498
- return null;
1499
- }
1500
- const ge = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, bn = (e) => !je(e) && e !== ge;
1501
- function dt() {
1502
- const { caseless: e } = bn(this) && this || {}, t = {}, n = (r, o) => {
1503
- const s = e && yn(t, o) || o;
1504
- He(t[s]) && He(r) ? t[s] = dt(t[s], r) : He(r) ? t[s] = dt({}, r) : Te(r) ? t[s] = r.slice() : t[s] = r;
1505
- };
1506
- for (let r = 0, o = arguments.length; r < o; r++)
1507
- arguments[r] && $e(arguments[r], n);
1508
- return t;
1509
- }
1510
- const po = (e, t, n, { allOwnKeys: r } = {}) => ($e(t, (o, s) => {
1511
- n && oe(o) ? e[s] = pn(o, n) : e[s] = o;
1512
- }, { allOwnKeys: r }), e), ho = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), mo = (e, t, n, r) => {
1513
- e.prototype = Object.create(t.prototype, r), e.prototype.constructor = e, Object.defineProperty(e, "super", {
1514
- value: t.prototype
1515
- }), n && Object.assign(e.prototype, n);
1516
- }, yo = (e, t, n, r) => {
1517
- let o, s, a;
1518
- const l = {};
1519
- if (t = t || {}, e == null) return t;
1520
- do {
1521
- for (o = Object.getOwnPropertyNames(e), s = o.length; s-- > 0; )
1522
- a = o[s], (!r || r(a, e, t)) && !l[a] && (t[a] = e[a], l[a] = !0);
1523
- e = n !== !1 && St(e);
1524
- } while (e && (!n || n(e, t)) && e !== Object.prototype);
1525
- return t;
1526
- }, bo = (e, t, n) => {
1527
- e = String(e), (n === void 0 || n > e.length) && (n = e.length), n -= t.length;
1528
- const r = e.indexOf(t, n);
1529
- return r !== -1 && r === n;
1530
- }, go = (e) => {
1531
- if (!e) return null;
1532
- if (Te(e)) return e;
1533
- let t = e.length;
1534
- if (!mn(t)) return null;
1535
- const n = new Array(t);
1536
- for (; t-- > 0; )
1537
- n[t] = e[t];
1538
- return n;
1539
- }, vo = /* @__PURE__ */ ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" && St(Uint8Array)), ko = (e, t) => {
1540
- const r = (e && e[tt]).call(e);
1541
- let o;
1542
- for (; (o = r.next()) && !o.done; ) {
1543
- const s = o.value;
1544
- t.call(e, s[0], s[1]);
1545
- }
1546
- }, Eo = (e, t) => {
1547
- let n;
1548
- const r = [];
1549
- for (; (n = e.exec(t)) !== null; )
1550
- r.push(n);
1551
- return r;
1552
- }, So = ue("HTMLFormElement"), Ro = (e) => e.toLowerCase().replace(
1553
- /[-_\s]([a-z\d])(\w*)/g,
1554
- function(n, r, o) {
1555
- return r.toUpperCase() + o;
1556
- }
1557
- ), qt = (({ hasOwnProperty: e }) => (t, n) => e.call(t, n))(Object.prototype), _o = ue("RegExp"), gn = (e, t) => {
1558
- const n = Object.getOwnPropertyDescriptors(e), r = {};
1559
- $e(n, (o, s) => {
1560
- let a;
1561
- (a = t(o, s, e)) !== !1 && (r[s] = a || o);
1562
- }), Object.defineProperties(e, r);
1563
- }, wo = (e) => {
1564
- gn(e, (t, n) => {
1565
- if (oe(e) && ["arguments", "caller", "callee"].indexOf(n) !== -1)
1566
- return !1;
1567
- const r = e[n];
1568
- if (oe(r)) {
1569
- if (t.enumerable = !1, "writable" in t) {
1570
- t.writable = !1;
1571
- return;
1572
- }
1573
- t.set || (t.set = () => {
1574
- throw Error("Can not rewrite read-only method '" + n + "'");
1575
- });
1576
- }
1577
- });
1578
- }, Oo = (e, t) => {
1579
- const n = {}, r = (o) => {
1580
- o.forEach((s) => {
1581
- n[s] = !0;
1582
- });
1583
- };
1584
- return Te(e) ? r(e) : r(String(e).split(t)), n;
1585
- }, To = () => {
1586
- }, Ao = (e, t) => e != null && Number.isFinite(e = +e) ? e : t;
1587
- function Co(e) {
1588
- return !!(e && oe(e.append) && e[dn] === "FormData" && e[tt]);
1589
- }
1590
- const xo = (e) => {
1591
- const t = new Array(10), n = (r, o) => {
1592
- if (ot(r)) {
1593
- if (t.indexOf(r) >= 0)
1594
- return;
1595
- if (!("toJSON" in r)) {
1596
- t[o] = r;
1597
- const s = Te(r) ? [] : {};
1598
- return $e(r, (a, l) => {
1599
- const d = n(a, o + 1);
1600
- !je(d) && (s[l] = d);
1601
- }), t[o] = void 0, s;
1602
- }
1603
- }
1604
- return r;
1605
- };
1606
- return n(e, 0);
1607
- }, Do = ue("AsyncFunction"), Fo = (e) => e && (ot(e) || oe(e)) && oe(e.then) && oe(e.catch), vn = ((e, t) => e ? setImmediate : t ? ((n, r) => (ge.addEventListener("message", ({ source: o, data: s }) => {
1608
- o === ge && s === n && r.length && r.shift()();
1609
- }, !1), (o) => {
1610
- r.push(o), ge.postMessage(n, "*");
1611
- }))(`axios@${Math.random()}`, []) : (n) => setTimeout(n))(
1612
- typeof setImmediate == "function",
1613
- oe(ge.postMessage)
1614
- ), No = typeof queueMicrotask < "u" ? queueMicrotask.bind(ge) : typeof process < "u" && process.nextTick || vn, Po = (e) => e != null && oe(e[tt]), f = {
1615
- isArray: Te,
1616
- isArrayBuffer: hn,
1617
- isBuffer: Xr,
1618
- isFormData: so,
1619
- isArrayBufferView: Zr,
1620
- isString: Qr,
1621
- isNumber: mn,
1622
- isBoolean: Yr,
1623
- isObject: ot,
1624
- isPlainObject: He,
1625
- isReadableStream: lo,
1626
- isRequest: io,
1627
- isResponse: co,
1628
- isHeaders: uo,
1629
- isUndefined: je,
1630
- isDate: eo,
1631
- isFile: to,
1632
- isBlob: no,
1633
- isRegExp: _o,
1634
- isFunction: oe,
1635
- isStream: oo,
1636
- isURLSearchParams: ao,
1637
- isTypedArray: vo,
1638
- isFileList: ro,
1639
- forEach: $e,
1640
- merge: dt,
1641
- extend: po,
1642
- trim: fo,
1643
- stripBOM: ho,
1644
- inherits: mo,
1645
- toFlatObject: yo,
1646
- kindOf: nt,
1647
- kindOfTest: ue,
1648
- endsWith: bo,
1649
- toArray: go,
1650
- forEachEntry: ko,
1651
- matchAll: Eo,
1652
- isHTMLForm: So,
1653
- hasOwnProperty: qt,
1654
- hasOwnProp: qt,
1655
- // an alias to avoid ESLint no-prototype-builtins detection
1656
- reduceDescriptors: gn,
1657
- freezeMethods: wo,
1658
- toObjectSet: Oo,
1659
- toCamelCase: Ro,
1660
- noop: To,
1661
- toFiniteNumber: Ao,
1662
- findKey: yn,
1663
- global: ge,
1664
- isContextDefined: bn,
1665
- isSpecCompliantForm: Co,
1666
- toJSONObject: xo,
1667
- isAsyncFn: Do,
1668
- isThenable: Fo,
1669
- setImmediate: vn,
1670
- asap: No,
1671
- isIterable: Po
1672
- };
1673
- function B(e, t, n, r, o) {
1674
- 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);
1675
- }
1676
- f.inherits(B, Error, {
1677
- toJSON: function() {
1678
- return {
1679
- // Standard
1680
- message: this.message,
1681
- name: this.name,
1682
- // Microsoft
1683
- description: this.description,
1684
- number: this.number,
1685
- // Mozilla
1686
- fileName: this.fileName,
1687
- lineNumber: this.lineNumber,
1688
- columnNumber: this.columnNumber,
1689
- stack: this.stack,
1690
- // Axios
1691
- config: f.toJSONObject(this.config),
1692
- code: this.code,
1693
- status: this.status
1694
- };
1695
- }
1696
- });
1697
- const kn = B.prototype, En = {};
1698
- [
1699
- "ERR_BAD_OPTION_VALUE",
1700
- "ERR_BAD_OPTION",
1701
- "ECONNABORTED",
1702
- "ETIMEDOUT",
1703
- "ERR_NETWORK",
1704
- "ERR_FR_TOO_MANY_REDIRECTS",
1705
- "ERR_DEPRECATED",
1706
- "ERR_BAD_RESPONSE",
1707
- "ERR_BAD_REQUEST",
1708
- "ERR_CANCELED",
1709
- "ERR_NOT_SUPPORT",
1710
- "ERR_INVALID_URL"
1711
- // eslint-disable-next-line func-names
1712
- ].forEach((e) => {
1713
- En[e] = { value: e };
1714
- });
1715
- Object.defineProperties(B, En);
1716
- Object.defineProperty(kn, "isAxiosError", { value: !0 });
1717
- B.from = (e, t, n, r, o, s) => {
1718
- const a = Object.create(kn);
1719
- return f.toFlatObject(e, a, function(d) {
1720
- return d !== Error.prototype;
1721
- }, (l) => l !== "isAxiosError"), B.call(a, e.message, t, n, r, o), a.cause = e, a.name = e.name, s && Object.assign(a, s), a;
1722
- };
1723
- const Uo = null;
1724
- function ht(e) {
1725
- return f.isPlainObject(e) || f.isArray(e);
1726
- }
1727
- function Sn(e) {
1728
- return f.endsWith(e, "[]") ? e.slice(0, -2) : e;
1729
- }
1730
- function Jt(e, t, n) {
1731
- return e ? e.concat(t).map(function(o, s) {
1732
- return o = Sn(o), !n && s ? "[" + o + "]" : o;
1733
- }).join(n ? "." : "") : t;
1734
- }
1735
- function Bo(e) {
1736
- return f.isArray(e) && !e.some(ht);
1737
- }
1738
- const jo = f.toFlatObject(f, {}, null, function(t) {
1739
- return /^is[A-Z]/.test(t);
1740
- });
1741
- function st(e, t, n) {
1742
- if (!f.isObject(e))
1743
- throw new TypeError("target must be an object");
1744
- t = t || new FormData(), n = f.toFlatObject(n, {
1745
- metaTokens: !0,
1746
- dots: !1,
1747
- indexes: !1
1748
- }, !1, function(A, p) {
1749
- return !f.isUndefined(p[A]);
1750
- });
1751
- const r = n.metaTokens, o = n.visitor || y, s = n.dots, a = n.indexes, d = (n.Blob || typeof Blob < "u" && Blob) && f.isSpecCompliantForm(t);
1752
- if (!f.isFunction(o))
1753
- throw new TypeError("visitor must be a function");
1754
- function i(g) {
1755
- if (g === null) return "";
1756
- if (f.isDate(g))
1757
- return g.toISOString();
1758
- if (!d && f.isBlob(g))
1759
- throw new B("Blob is not supported. Use a Buffer instead.");
1760
- return f.isArrayBuffer(g) || f.isTypedArray(g) ? d && typeof Blob == "function" ? new Blob([g]) : Buffer.from(g) : g;
1761
- }
1762
- function y(g, A, p) {
1763
- let h = g;
1764
- if (g && !p && typeof g == "object") {
1765
- if (f.endsWith(A, "{}"))
1766
- A = r ? A : A.slice(0, -2), g = JSON.stringify(g);
1767
- else if (f.isArray(g) && Bo(g) || (f.isFileList(g) || f.endsWith(A, "[]")) && (h = f.toArray(g)))
1768
- return A = Sn(A), h.forEach(function(R, b) {
1769
- !(f.isUndefined(R) || R === null) && t.append(
1770
- // eslint-disable-next-line no-nested-ternary
1771
- a === !0 ? Jt([A], b, s) : a === null ? A : A + "[]",
1772
- i(R)
1773
- );
1774
- }), !1;
1775
- }
1776
- return ht(g) ? !0 : (t.append(Jt(p, A, s), i(g)), !1);
1777
- }
1778
- const c = [], O = Object.assign(jo, {
1779
- defaultVisitor: y,
1780
- convertValue: i,
1781
- isVisitable: ht
1782
- });
1783
- function _(g, A) {
1784
- if (!f.isUndefined(g)) {
1785
- if (c.indexOf(g) !== -1)
1786
- throw Error("Circular reference detected in " + A.join("."));
1787
- c.push(g), f.forEach(g, function(h, u) {
1788
- (!(f.isUndefined(h) || h === null) && o.call(
1789
- t,
1790
- h,
1791
- f.isString(u) ? u.trim() : u,
1792
- A,
1793
- O
1794
- )) === !0 && _(h, A ? A.concat(u) : [u]);
1795
- }), c.pop();
1796
- }
1797
- }
1798
- if (!f.isObject(e))
1799
- throw new TypeError("data must be an object");
1800
- return _(e), t;
1801
- }
1802
- function Mt(e) {
1803
- const t = {
1804
- "!": "%21",
1805
- "'": "%27",
1806
- "(": "%28",
1807
- ")": "%29",
1808
- "~": "%7E",
1809
- "%20": "+",
1810
- "%00": "\0"
1811
- };
1812
- return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g, function(r) {
1813
- return t[r];
1814
- });
1815
- }
1816
- function Rt(e, t) {
1817
- this._pairs = [], e && st(e, this, t);
1818
- }
1819
- const Rn = Rt.prototype;
1820
- Rn.append = function(t, n) {
1821
- this._pairs.push([t, n]);
1822
- };
1823
- Rn.toString = function(t) {
1824
- const n = t ? function(r) {
1825
- return t.call(this, r, Mt);
1826
- } : Mt;
1827
- return this._pairs.map(function(o) {
1828
- return n(o[0]) + "=" + n(o[1]);
1829
- }, "").join("&");
1830
- };
1831
- function $o(e) {
1832
- return encodeURIComponent(e).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
1833
- }
1834
- function _n(e, t, n) {
1835
- if (!t)
1836
- return e;
1837
- const r = n && n.encode || $o;
1838
- f.isFunction(n) && (n = {
1839
- serialize: n
1840
- });
1841
- const o = n && n.serialize;
1842
- let s;
1843
- if (o ? s = o(t, n) : s = f.isURLSearchParams(t) ? t.toString() : new Rt(t, n).toString(r), s) {
1844
- const a = e.indexOf("#");
1845
- a !== -1 && (e = e.slice(0, a)), e += (e.indexOf("?") === -1 ? "?" : "&") + s;
1846
- }
1847
- return e;
1848
- }
1849
- class zt {
1850
- constructor() {
1851
- this.handlers = [];
1852
- }
1853
- /**
1854
- * Add a new interceptor to the stack
1855
- *
1856
- * @param {Function} fulfilled The function to handle `then` for a `Promise`
1857
- * @param {Function} rejected The function to handle `reject` for a `Promise`
1858
- *
1859
- * @return {Number} An ID used to remove interceptor later
1860
- */
1861
- use(t, n, r) {
1862
- return this.handlers.push({
1863
- fulfilled: t,
1864
- rejected: n,
1865
- synchronous: r ? r.synchronous : !1,
1866
- runWhen: r ? r.runWhen : null
1867
- }), this.handlers.length - 1;
1868
- }
1869
- /**
1870
- * Remove an interceptor from the stack
1871
- *
1872
- * @param {Number} id The ID that was returned by `use`
1873
- *
1874
- * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise
1875
- */
1876
- eject(t) {
1877
- this.handlers[t] && (this.handlers[t] = null);
1878
- }
1879
- /**
1880
- * Clear all interceptors from the stack
1881
- *
1882
- * @returns {void}
1883
- */
1884
- clear() {
1885
- this.handlers && (this.handlers = []);
1886
- }
1887
- /**
1888
- * Iterate over all the registered interceptors
1889
- *
1890
- * This method is particularly useful for skipping over any
1891
- * interceptors that may have become `null` calling `eject`.
1892
- *
1893
- * @param {Function} fn The function to call for each interceptor
1894
- *
1895
- * @returns {void}
1896
- */
1897
- forEach(t) {
1898
- f.forEach(this.handlers, function(r) {
1899
- r !== null && t(r);
1900
- });
1901
- }
1902
- }
1903
- const wn = {
1904
- silentJSONParsing: !0,
1905
- forcedJSONParsing: !0,
1906
- clarifyTimeoutError: !1
1907
- }, Lo = typeof URLSearchParams < "u" ? URLSearchParams : Rt, qo = typeof FormData < "u" ? FormData : null, Jo = typeof Blob < "u" ? Blob : null, Mo = {
1908
- isBrowser: !0,
1909
- classes: {
1910
- URLSearchParams: Lo,
1911
- FormData: qo,
1912
- Blob: Jo
1913
- },
1914
- protocols: ["http", "https", "file", "blob", "url", "data"]
1915
- }, _t = typeof window < "u" && typeof document < "u", mt = typeof navigator == "object" && navigator || void 0, zo = _t && (!mt || ["ReactNative", "NativeScript", "NS"].indexOf(mt.product) < 0), Ho = typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
1916
- self instanceof WorkerGlobalScope && typeof self.importScripts == "function", Io = _t && window.location.href || "http://localhost", Vo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1917
- __proto__: null,
1918
- hasBrowserEnv: _t,
1919
- hasStandardBrowserEnv: zo,
1920
- hasStandardBrowserWebWorkerEnv: Ho,
1921
- navigator: mt,
1922
- origin: Io
1923
- }, Symbol.toStringTag, { value: "Module" })), ee = {
1924
- ...Vo,
1925
- ...Mo
1926
- };
1927
- function Wo(e, t) {
1928
- return st(e, new ee.classes.URLSearchParams(), Object.assign({
1929
- visitor: function(n, r, o, s) {
1930
- return ee.isNode && f.isBuffer(n) ? (this.append(r, n.toString("base64")), !1) : s.defaultVisitor.apply(this, arguments);
1931
- }
1932
- }, t));
1933
- }
1934
- function Ko(e) {
1935
- return f.matchAll(/\w+|\[(\w*)]/g, e).map((t) => t[0] === "[]" ? "" : t[1] || t[0]);
1936
- }
1937
- function Go(e) {
1938
- const t = {}, n = Object.keys(e);
1939
- let r;
1940
- const o = n.length;
1941
- let s;
1942
- for (r = 0; r < o; r++)
1943
- s = n[r], t[s] = e[s];
1944
- return t;
1945
- }
1946
- function On(e) {
1947
- function t(n, r, o, s) {
1948
- let a = n[s++];
1949
- if (a === "__proto__") return !0;
1950
- const l = Number.isFinite(+a), d = s >= n.length;
1951
- return a = !a && f.isArray(o) ? o.length : a, d ? (f.hasOwnProp(o, a) ? o[a] = [o[a], r] : o[a] = r, !l) : ((!o[a] || !f.isObject(o[a])) && (o[a] = []), t(n, r, o[a], s) && f.isArray(o[a]) && (o[a] = Go(o[a])), !l);
1952
- }
1953
- if (f.isFormData(e) && f.isFunction(e.entries)) {
1954
- const n = {};
1955
- return f.forEachEntry(e, (r, o) => {
1956
- t(Ko(r), o, n, 0);
1957
- }), n;
1958
- }
1959
- return null;
1960
- }
1961
- function Xo(e, t, n) {
1962
- if (f.isString(e))
1963
- try {
1964
- return (t || JSON.parse)(e), f.trim(e);
1965
- } catch (r) {
1966
- if (r.name !== "SyntaxError")
1967
- throw r;
1968
- }
1969
- return (n || JSON.stringify)(e);
1970
- }
1971
- const Le = {
1972
- transitional: wn,
1973
- adapter: ["xhr", "http", "fetch"],
1974
- transformRequest: [function(t, n) {
1975
- const r = n.getContentType() || "", o = r.indexOf("application/json") > -1, s = f.isObject(t);
1976
- if (s && f.isHTMLForm(t) && (t = new FormData(t)), f.isFormData(t))
1977
- return o ? JSON.stringify(On(t)) : t;
1978
- if (f.isArrayBuffer(t) || f.isBuffer(t) || f.isStream(t) || f.isFile(t) || f.isBlob(t) || f.isReadableStream(t))
1979
- return t;
1980
- if (f.isArrayBufferView(t))
1981
- return t.buffer;
1982
- if (f.isURLSearchParams(t))
1983
- return n.setContentType("application/x-www-form-urlencoded;charset=utf-8", !1), t.toString();
1984
- let l;
1985
- if (s) {
1986
- if (r.indexOf("application/x-www-form-urlencoded") > -1)
1987
- return Wo(t, this.formSerializer).toString();
1988
- if ((l = f.isFileList(t)) || r.indexOf("multipart/form-data") > -1) {
1989
- const d = this.env && this.env.FormData;
1990
- return st(
1991
- l ? { "files[]": t } : t,
1992
- d && new d(),
1993
- this.formSerializer
1994
- );
1995
- }
1996
- }
1997
- return s || o ? (n.setContentType("application/json", !1), Xo(t)) : t;
1998
- }],
1999
- transformResponse: [function(t) {
2000
- const n = this.transitional || Le.transitional, r = n && n.forcedJSONParsing, o = this.responseType === "json";
2001
- if (f.isResponse(t) || f.isReadableStream(t))
2002
- return t;
2003
- if (t && f.isString(t) && (r && !this.responseType || o)) {
2004
- const a = !(n && n.silentJSONParsing) && o;
2005
- try {
2006
- return JSON.parse(t);
2007
- } catch (l) {
2008
- if (a)
2009
- throw l.name === "SyntaxError" ? B.from(l, B.ERR_BAD_RESPONSE, this, null, this.response) : l;
2010
- }
2011
- }
2012
- return t;
2013
- }],
2014
- /**
2015
- * A timeout in milliseconds to abort a request. If set to 0 (default) a
2016
- * timeout is not created.
2017
- */
2018
- timeout: 0,
2019
- xsrfCookieName: "XSRF-TOKEN",
2020
- xsrfHeaderName: "X-XSRF-TOKEN",
2021
- maxContentLength: -1,
2022
- maxBodyLength: -1,
2023
- env: {
2024
- FormData: ee.classes.FormData,
2025
- Blob: ee.classes.Blob
2026
- },
2027
- validateStatus: function(t) {
2028
- return t >= 200 && t < 300;
2029
- },
2030
- headers: {
2031
- common: {
2032
- Accept: "application/json, text/plain, */*",
2033
- "Content-Type": void 0
2034
- }
2035
- }
2036
- };
2037
- f.forEach(["delete", "get", "head", "post", "put", "patch"], (e) => {
2038
- Le.headers[e] = {};
2039
- });
2040
- const Zo = f.toObjectSet([
2041
- "age",
2042
- "authorization",
2043
- "content-length",
2044
- "content-type",
2045
- "etag",
2046
- "expires",
2047
- "from",
2048
- "host",
2049
- "if-modified-since",
2050
- "if-unmodified-since",
2051
- "last-modified",
2052
- "location",
2053
- "max-forwards",
2054
- "proxy-authorization",
2055
- "referer",
2056
- "retry-after",
2057
- "user-agent"
2058
- ]), Qo = (e) => {
2059
- const t = {};
2060
- let n, r, o;
2061
- return e && e.split(`
2062
- `).forEach(function(a) {
2063
- o = a.indexOf(":"), n = a.substring(0, o).trim().toLowerCase(), r = a.substring(o + 1).trim(), !(!n || t[n] && Zo[n]) && (n === "set-cookie" ? t[n] ? t[n].push(r) : t[n] = [r] : t[n] = t[n] ? t[n] + ", " + r : r);
2064
- }), t;
2065
- }, Ht = Symbol("internals");
2066
- function Ne(e) {
2067
- return e && String(e).trim().toLowerCase();
2068
- }
2069
- function Ie(e) {
2070
- return e === !1 || e == null ? e : f.isArray(e) ? e.map(Ie) : String(e);
2071
- }
2072
- function Yo(e) {
2073
- const t = /* @__PURE__ */ Object.create(null), n = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
2074
- let r;
2075
- for (; r = n.exec(e); )
2076
- t[r[1]] = r[2];
2077
- return t;
2078
- }
2079
- const es = (e) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());
2080
- function ut(e, t, n, r, o) {
2081
- if (f.isFunction(r))
2082
- return r.call(this, t, n);
2083
- if (o && (t = n), !!f.isString(t)) {
2084
- if (f.isString(r))
2085
- return t.indexOf(r) !== -1;
2086
- if (f.isRegExp(r))
2087
- return r.test(t);
2088
- }
2089
- }
2090
- function ts(e) {
2091
- return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (t, n, r) => n.toUpperCase() + r);
2092
- }
2093
- function ns(e, t) {
2094
- const n = f.toCamelCase(" " + t);
2095
- ["get", "set", "has"].forEach((r) => {
2096
- Object.defineProperty(e, r + n, {
2097
- value: function(o, s, a) {
2098
- return this[r].call(this, t, o, s, a);
2099
- },
2100
- configurable: !0
2101
- });
2102
- });
2103
- }
2104
- let se = class {
2105
- constructor(t) {
2106
- t && this.set(t);
2107
- }
2108
- set(t, n, r) {
2109
- const o = this;
2110
- function s(l, d, i) {
2111
- const y = Ne(d);
2112
- if (!y)
2113
- throw new Error("header name must be a non-empty string");
2114
- const c = f.findKey(o, y);
2115
- (!c || o[c] === void 0 || i === !0 || i === void 0 && o[c] !== !1) && (o[c || d] = Ie(l));
2116
- }
2117
- const a = (l, d) => f.forEach(l, (i, y) => s(i, y, d));
2118
- if (f.isPlainObject(t) || t instanceof this.constructor)
2119
- a(t, n);
2120
- else if (f.isString(t) && (t = t.trim()) && !es(t))
2121
- a(Qo(t), n);
2122
- else if (f.isObject(t) && f.isIterable(t)) {
2123
- let l = {}, d, i;
2124
- for (const y of t) {
2125
- if (!f.isArray(y))
2126
- throw TypeError("Object iterator must return a key-value pair");
2127
- l[i = y[0]] = (d = l[i]) ? f.isArray(d) ? [...d, y[1]] : [d, y[1]] : y[1];
2128
- }
2129
- a(l, n);
2130
- } else
2131
- t != null && s(n, t, r);
2132
- return this;
2133
- }
2134
- get(t, n) {
2135
- if (t = Ne(t), t) {
2136
- const r = f.findKey(this, t);
2137
- if (r) {
2138
- const o = this[r];
2139
- if (!n)
2140
- return o;
2141
- if (n === !0)
2142
- return Yo(o);
2143
- if (f.isFunction(n))
2144
- return n.call(this, o, r);
2145
- if (f.isRegExp(n))
2146
- return n.exec(o);
2147
- throw new TypeError("parser must be boolean|regexp|function");
2148
- }
2149
- }
2150
- }
2151
- has(t, n) {
2152
- if (t = Ne(t), t) {
2153
- const r = f.findKey(this, t);
2154
- return !!(r && this[r] !== void 0 && (!n || ut(this, this[r], r, n)));
2155
- }
2156
- return !1;
2157
- }
2158
- delete(t, n) {
2159
- const r = this;
2160
- let o = !1;
2161
- function s(a) {
2162
- if (a = Ne(a), a) {
2163
- const l = f.findKey(r, a);
2164
- l && (!n || ut(r, r[l], l, n)) && (delete r[l], o = !0);
2165
- }
2166
- }
2167
- return f.isArray(t) ? t.forEach(s) : s(t), o;
2168
- }
2169
- clear(t) {
2170
- const n = Object.keys(this);
2171
- let r = n.length, o = !1;
2172
- for (; r--; ) {
2173
- const s = n[r];
2174
- (!t || ut(this, this[s], s, t, !0)) && (delete this[s], o = !0);
2175
- }
2176
- return o;
2177
- }
2178
- normalize(t) {
2179
- const n = this, r = {};
2180
- return f.forEach(this, (o, s) => {
2181
- const a = f.findKey(r, s);
2182
- if (a) {
2183
- n[a] = Ie(o), delete n[s];
2184
- return;
2185
- }
2186
- const l = t ? ts(s) : String(s).trim();
2187
- l !== s && delete n[s], n[l] = Ie(o), r[l] = !0;
2188
- }), this;
2189
- }
2190
- concat(...t) {
2191
- return this.constructor.concat(this, ...t);
2192
- }
2193
- toJSON(t) {
2194
- const n = /* @__PURE__ */ Object.create(null);
2195
- return f.forEach(this, (r, o) => {
2196
- r != null && r !== !1 && (n[o] = t && f.isArray(r) ? r.join(", ") : r);
2197
- }), n;
2198
- }
2199
- [Symbol.iterator]() {
2200
- return Object.entries(this.toJSON())[Symbol.iterator]();
2201
- }
2202
- toString() {
2203
- return Object.entries(this.toJSON()).map(([t, n]) => t + ": " + n).join(`
2204
- `);
2205
- }
2206
- getSetCookie() {
2207
- return this.get("set-cookie") || [];
2208
- }
2209
- get [Symbol.toStringTag]() {
2210
- return "AxiosHeaders";
2211
- }
2212
- static from(t) {
2213
- return t instanceof this ? t : new this(t);
2214
- }
2215
- static concat(t, ...n) {
2216
- const r = new this(t);
2217
- return n.forEach((o) => r.set(o)), r;
2218
- }
2219
- static accessor(t) {
2220
- const r = (this[Ht] = this[Ht] = {
2221
- accessors: {}
2222
- }).accessors, o = this.prototype;
2223
- function s(a) {
2224
- const l = Ne(a);
2225
- r[l] || (ns(o, a), r[l] = !0);
2226
- }
2227
- return f.isArray(t) ? t.forEach(s) : s(t), this;
2228
- }
2229
- };
2230
- se.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
2231
- f.reduceDescriptors(se.prototype, ({ value: e }, t) => {
2232
- let n = t[0].toUpperCase() + t.slice(1);
2233
- return {
2234
- get: () => e,
2235
- set(r) {
2236
- this[n] = r;
2237
- }
2238
- };
2239
- });
2240
- f.freezeMethods(se);
2241
- function ft(e, t) {
2242
- const n = this || Le, r = t || n, o = se.from(r.headers);
2243
- let s = r.data;
2244
- return f.forEach(e, function(l) {
2245
- s = l.call(n, s, o.normalize(), t ? t.status : void 0);
2246
- }), o.normalize(), s;
2247
- }
2248
- function Tn(e) {
2249
- return !!(e && e.__CANCEL__);
2250
- }
2251
- function Ae(e, t, n) {
2252
- B.call(this, e ?? "canceled", B.ERR_CANCELED, t, n), this.name = "CanceledError";
2253
- }
2254
- f.inherits(Ae, B, {
2255
- __CANCEL__: !0
2256
- });
2257
- function An(e, t, n) {
2258
- const r = n.config.validateStatus;
2259
- !n.status || !r || r(n.status) ? e(n) : t(new B(
2260
- "Request failed with status code " + n.status,
2261
- [B.ERR_BAD_REQUEST, B.ERR_BAD_RESPONSE][Math.floor(n.status / 100) - 4],
2262
- n.config,
2263
- n.request,
2264
- n
2265
- ));
2266
- }
2267
- function rs(e) {
2268
- const t = /^([-+\w]{1,25})(:?\/\/|:)/.exec(e);
2269
- return t && t[1] || "";
2270
- }
2271
- function os(e, t) {
2272
- e = e || 10;
2273
- const n = new Array(e), r = new Array(e);
2274
- let o = 0, s = 0, a;
2275
- return t = t !== void 0 ? t : 1e3, function(d) {
2276
- const i = Date.now(), y = r[s];
2277
- a || (a = i), n[o] = d, r[o] = i;
2278
- let c = s, O = 0;
2279
- for (; c !== o; )
2280
- O += n[c++], c = c % e;
2281
- if (o = (o + 1) % e, o === s && (s = (s + 1) % e), i - a < t)
2282
- return;
2283
- const _ = y && i - y;
2284
- return _ ? Math.round(O * 1e3 / _) : void 0;
2285
- };
2286
- }
2287
- function ss(e, t) {
2288
- let n = 0, r = 1e3 / t, o, s;
2289
- const a = (i, y = Date.now()) => {
2290
- n = y, o = null, s && (clearTimeout(s), s = null), e.apply(null, i);
2291
- };
2292
- return [(...i) => {
2293
- const y = Date.now(), c = y - n;
2294
- c >= r ? a(i, y) : (o = i, s || (s = setTimeout(() => {
2295
- s = null, a(o);
2296
- }, r - c)));
2297
- }, () => o && a(o)];
2298
- }
2299
- const Ke = (e, t, n = 3) => {
2300
- let r = 0;
2301
- const o = os(50, 250);
2302
- return ss((s) => {
2303
- const a = s.loaded, l = s.lengthComputable ? s.total : void 0, d = a - r, i = o(d), y = a <= l;
2304
- r = a;
2305
- const c = {
2306
- loaded: a,
2307
- total: l,
2308
- progress: l ? a / l : void 0,
2309
- bytes: d,
2310
- rate: i || void 0,
2311
- estimated: i && l && y ? (l - a) / i : void 0,
2312
- event: s,
2313
- lengthComputable: l != null,
2314
- [t ? "download" : "upload"]: !0
2315
- };
2316
- e(c);
2317
- }, n);
2318
- }, It = (e, t) => {
2319
- const n = e != null;
2320
- return [(r) => t[0]({
2321
- lengthComputable: n,
2322
- total: e,
2323
- loaded: r
2324
- }), t[1]];
2325
- }, Vt = (e) => (...t) => f.asap(() => e(...t)), as = ee.hasStandardBrowserEnv ? /* @__PURE__ */ ((e, t) => (n) => (n = new URL(n, ee.origin), e.protocol === n.protocol && e.host === n.host && (t || e.port === n.port)))(
2326
- new URL(ee.origin),
2327
- ee.navigator && /(msie|trident)/i.test(ee.navigator.userAgent)
2328
- ) : () => !0, ls = ee.hasStandardBrowserEnv ? (
2329
- // Standard browser envs support document.cookie
2330
- {
2331
- write(e, t, n, r, o, s) {
2332
- const a = [e + "=" + encodeURIComponent(t)];
2333
- f.isNumber(n) && a.push("expires=" + new Date(n).toGMTString()), f.isString(r) && a.push("path=" + r), f.isString(o) && a.push("domain=" + o), s === !0 && a.push("secure"), document.cookie = a.join("; ");
2334
- },
2335
- read(e) {
2336
- const t = document.cookie.match(new RegExp("(^|;\\s*)(" + e + ")=([^;]*)"));
2337
- return t ? decodeURIComponent(t[3]) : null;
2338
- },
2339
- remove(e) {
2340
- this.write(e, "", Date.now() - 864e5);
2341
- }
2342
- }
2343
- ) : (
2344
- // Non-standard browser env (web workers, react-native) lack needed support.
2345
- {
2346
- write() {
2347
- },
2348
- read() {
2349
- return null;
2350
- },
2351
- remove() {
2352
- }
2353
- }
2354
- );
2355
- function is(e) {
2356
- return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(e);
2357
- }
2358
- function cs(e, t) {
2359
- return t ? e.replace(/\/?\/$/, "") + "/" + t.replace(/^\/+/, "") : e;
2360
- }
2361
- function Cn(e, t, n) {
2362
- let r = !is(t);
2363
- return e && (r || n == !1) ? cs(e, t) : t;
2364
- }
2365
- const Wt = (e) => e instanceof se ? { ...e } : e;
2366
- function Se(e, t) {
2367
- t = t || {};
2368
- const n = {};
2369
- function r(i, y, c, O) {
2370
- return f.isPlainObject(i) && f.isPlainObject(y) ? f.merge.call({ caseless: O }, i, y) : f.isPlainObject(y) ? f.merge({}, y) : f.isArray(y) ? y.slice() : y;
2371
- }
2372
- function o(i, y, c, O) {
2373
- if (f.isUndefined(y)) {
2374
- if (!f.isUndefined(i))
2375
- return r(void 0, i, c, O);
2376
- } else return r(i, y, c, O);
2377
- }
2378
- function s(i, y) {
2379
- if (!f.isUndefined(y))
2380
- return r(void 0, y);
2381
- }
2382
- function a(i, y) {
2383
- if (f.isUndefined(y)) {
2384
- if (!f.isUndefined(i))
2385
- return r(void 0, i);
2386
- } else return r(void 0, y);
2387
- }
2388
- function l(i, y, c) {
2389
- if (c in t)
2390
- return r(i, y);
2391
- if (c in e)
2392
- return r(void 0, i);
2393
- }
2394
- const d = {
2395
- url: s,
2396
- method: s,
2397
- data: s,
2398
- baseURL: a,
2399
- transformRequest: a,
2400
- transformResponse: a,
2401
- paramsSerializer: a,
2402
- timeout: a,
2403
- timeoutMessage: a,
2404
- withCredentials: a,
2405
- withXSRFToken: a,
2406
- adapter: a,
2407
- responseType: a,
2408
- xsrfCookieName: a,
2409
- xsrfHeaderName: a,
2410
- onUploadProgress: a,
2411
- onDownloadProgress: a,
2412
- decompress: a,
2413
- maxContentLength: a,
2414
- maxBodyLength: a,
2415
- beforeRedirect: a,
2416
- transport: a,
2417
- httpAgent: a,
2418
- httpsAgent: a,
2419
- cancelToken: a,
2420
- socketPath: a,
2421
- responseEncoding: a,
2422
- validateStatus: l,
2423
- headers: (i, y, c) => o(Wt(i), Wt(y), c, !0)
2424
- };
2425
- return f.forEach(Object.keys(Object.assign({}, e, t)), function(y) {
2426
- const c = d[y] || o, O = c(e[y], t[y], y);
2427
- f.isUndefined(O) && c !== l || (n[y] = O);
2428
- }), n;
2429
- }
2430
- const xn = (e) => {
2431
- const t = Se({}, e);
2432
- let { data: n, withXSRFToken: r, xsrfHeaderName: o, xsrfCookieName: s, headers: a, auth: l } = t;
2433
- t.headers = a = se.from(a), t.url = _n(Cn(t.baseURL, t.url, t.allowAbsoluteUrls), e.params, e.paramsSerializer), l && a.set(
2434
- "Authorization",
2435
- "Basic " + btoa((l.username || "") + ":" + (l.password ? unescape(encodeURIComponent(l.password)) : ""))
2436
- );
2437
- let d;
2438
- if (f.isFormData(n)) {
2439
- if (ee.hasStandardBrowserEnv || ee.hasStandardBrowserWebWorkerEnv)
2440
- a.setContentType(void 0);
2441
- else if ((d = a.getContentType()) !== !1) {
2442
- const [i, ...y] = d ? d.split(";").map((c) => c.trim()).filter(Boolean) : [];
2443
- a.setContentType([i || "multipart/form-data", ...y].join("; "));
2444
- }
2445
- }
2446
- if (ee.hasStandardBrowserEnv && (r && f.isFunction(r) && (r = r(t)), r || r !== !1 && as(t.url))) {
2447
- const i = o && s && ls.read(s);
2448
- i && a.set(o, i);
2449
- }
2450
- return t;
2451
- }, us = typeof XMLHttpRequest < "u", fs = us && function(e) {
2452
- return new Promise(function(n, r) {
2453
- const o = xn(e);
2454
- let s = o.data;
2455
- const a = se.from(o.headers).normalize();
2456
- let { responseType: l, onUploadProgress: d, onDownloadProgress: i } = o, y, c, O, _, g;
2457
- function A() {
2458
- _ && _(), g && g(), o.cancelToken && o.cancelToken.unsubscribe(y), o.signal && o.signal.removeEventListener("abort", y);
2459
- }
2460
- let p = new XMLHttpRequest();
2461
- p.open(o.method.toUpperCase(), o.url, !0), p.timeout = o.timeout;
2462
- function h() {
2463
- if (!p)
2464
- return;
2465
- const R = se.from(
2466
- "getAllResponseHeaders" in p && p.getAllResponseHeaders()
2467
- ), m = {
2468
- data: !l || l === "text" || l === "json" ? p.responseText : p.response,
2469
- status: p.status,
2470
- statusText: p.statusText,
2471
- headers: R,
2472
- config: e,
2473
- request: p
2474
- };
2475
- An(function(S) {
2476
- n(S), A();
2477
- }, function(S) {
2478
- r(S), A();
2479
- }, m), p = null;
2480
- }
2481
- "onloadend" in p ? p.onloadend = h : p.onreadystatechange = function() {
2482
- !p || p.readyState !== 4 || p.status === 0 && !(p.responseURL && p.responseURL.indexOf("file:") === 0) || setTimeout(h);
2483
- }, p.onabort = function() {
2484
- p && (r(new B("Request aborted", B.ECONNABORTED, e, p)), p = null);
2485
- }, p.onerror = function() {
2486
- r(new B("Network Error", B.ERR_NETWORK, e, p)), p = null;
2487
- }, p.ontimeout = function() {
2488
- let b = o.timeout ? "timeout of " + o.timeout + "ms exceeded" : "timeout exceeded";
2489
- const m = o.transitional || wn;
2490
- o.timeoutErrorMessage && (b = o.timeoutErrorMessage), r(new B(
2491
- b,
2492
- m.clarifyTimeoutError ? B.ETIMEDOUT : B.ECONNABORTED,
2493
- e,
2494
- p
2495
- )), p = null;
2496
- }, s === void 0 && a.setContentType(null), "setRequestHeader" in p && f.forEach(a.toJSON(), function(b, m) {
2497
- p.setRequestHeader(m, b);
2498
- }), f.isUndefined(o.withCredentials) || (p.withCredentials = !!o.withCredentials), l && l !== "json" && (p.responseType = o.responseType), i && ([O, g] = Ke(i, !0), p.addEventListener("progress", O)), d && p.upload && ([c, _] = Ke(d), p.upload.addEventListener("progress", c), p.upload.addEventListener("loadend", _)), (o.cancelToken || o.signal) && (y = (R) => {
2499
- p && (r(!R || R.type ? new Ae(null, e, p) : R), p.abort(), p = null);
2500
- }, o.cancelToken && o.cancelToken.subscribe(y), o.signal && (o.signal.aborted ? y() : o.signal.addEventListener("abort", y)));
2501
- const u = rs(o.url);
2502
- if (u && ee.protocols.indexOf(u) === -1) {
2503
- r(new B("Unsupported protocol " + u + ":", B.ERR_BAD_REQUEST, e));
2504
- return;
2505
- }
2506
- p.send(s || null);
2507
- });
2508
- }, ps = (e, t) => {
2509
- const { length: n } = e = e ? e.filter(Boolean) : [];
2510
- if (t || n) {
2511
- let r = new AbortController(), o;
2512
- const s = function(i) {
2513
- if (!o) {
2514
- o = !0, l();
2515
- const y = i instanceof Error ? i : this.reason;
2516
- r.abort(y instanceof B ? y : new Ae(y instanceof Error ? y.message : y));
2517
- }
2518
- };
2519
- let a = t && setTimeout(() => {
2520
- a = null, s(new B(`timeout ${t} of ms exceeded`, B.ETIMEDOUT));
2521
- }, t);
2522
- const l = () => {
2523
- e && (a && clearTimeout(a), a = null, e.forEach((i) => {
2524
- i.unsubscribe ? i.unsubscribe(s) : i.removeEventListener("abort", s);
2525
- }), e = null);
2526
- };
2527
- e.forEach((i) => i.addEventListener("abort", s));
2528
- const { signal: d } = r;
2529
- return d.unsubscribe = () => f.asap(l), d;
2530
- }
2531
- }, ds = function* (e, t) {
2532
- let n = e.byteLength;
2533
- if (n < t) {
2534
- yield e;
2535
- return;
2536
- }
2537
- let r = 0, o;
2538
- for (; r < n; )
2539
- o = r + t, yield e.slice(r, o), r = o;
2540
- }, hs = async function* (e, t) {
2541
- for await (const n of ms(e))
2542
- yield* ds(n, t);
2543
- }, ms = async function* (e) {
2544
- if (e[Symbol.asyncIterator]) {
2545
- yield* e;
2546
- return;
2547
- }
2548
- const t = e.getReader();
2549
- try {
2550
- for (; ; ) {
2551
- const { done: n, value: r } = await t.read();
2552
- if (n)
2553
- break;
2554
- yield r;
2555
- }
2556
- } finally {
2557
- await t.cancel();
2558
- }
2559
- }, Kt = (e, t, n, r) => {
2560
- const o = hs(e, t);
2561
- let s = 0, a, l = (d) => {
2562
- a || (a = !0, r && r(d));
2563
- };
2564
- return new ReadableStream({
2565
- async pull(d) {
2566
- try {
2567
- const { done: i, value: y } = await o.next();
2568
- if (i) {
2569
- l(), d.close();
2570
- return;
2571
- }
2572
- let c = y.byteLength;
2573
- if (n) {
2574
- let O = s += c;
2575
- n(O);
2576
- }
2577
- d.enqueue(new Uint8Array(y));
2578
- } catch (i) {
2579
- throw l(i), i;
2580
- }
2581
- },
2582
- cancel(d) {
2583
- return l(d), o.return();
2584
- }
2585
- }, {
2586
- highWaterMark: 2
2587
- });
2588
- }, at = typeof fetch == "function" && typeof Request == "function" && typeof Response == "function", Dn = at && typeof ReadableStream == "function", ys = at && (typeof TextEncoder == "function" ? /* @__PURE__ */ ((e) => (t) => e.encode(t))(new TextEncoder()) : async (e) => new Uint8Array(await new Response(e).arrayBuffer())), Fn = (e, ...t) => {
2589
- try {
2590
- return !!e(...t);
2591
- } catch {
2592
- return !1;
2593
- }
2594
- }, bs = Dn && Fn(() => {
2595
- let e = !1;
2596
- const t = new Request(ee.origin, {
2597
- body: new ReadableStream(),
2598
- method: "POST",
2599
- get duplex() {
2600
- return e = !0, "half";
2601
- }
2602
- }).headers.has("Content-Type");
2603
- return e && !t;
2604
- }), Gt = 64 * 1024, yt = Dn && Fn(() => f.isReadableStream(new Response("").body)), Ge = {
2605
- stream: yt && ((e) => e.body)
2606
- };
2607
- at && ((e) => {
2608
- ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((t) => {
2609
- !Ge[t] && (Ge[t] = f.isFunction(e[t]) ? (n) => n[t]() : (n, r) => {
2610
- throw new B(`Response type '${t}' is not supported`, B.ERR_NOT_SUPPORT, r);
2611
- });
2612
- });
2613
- })(new Response());
2614
- const gs = async (e) => {
2615
- if (e == null)
2616
- return 0;
2617
- if (f.isBlob(e))
2618
- return e.size;
2619
- if (f.isSpecCompliantForm(e))
2620
- return (await new Request(ee.origin, {
2621
- method: "POST",
2622
- body: e
2623
- }).arrayBuffer()).byteLength;
2624
- if (f.isArrayBufferView(e) || f.isArrayBuffer(e))
2625
- return e.byteLength;
2626
- if (f.isURLSearchParams(e) && (e = e + ""), f.isString(e))
2627
- return (await ys(e)).byteLength;
2628
- }, vs = async (e, t) => {
2629
- const n = f.toFiniteNumber(e.getContentLength());
2630
- return n ?? gs(t);
2631
- }, ks = at && (async (e) => {
2632
- let {
2633
- url: t,
2634
- method: n,
2635
- data: r,
2636
- signal: o,
2637
- cancelToken: s,
2638
- timeout: a,
2639
- onDownloadProgress: l,
2640
- onUploadProgress: d,
2641
- responseType: i,
2642
- headers: y,
2643
- withCredentials: c = "same-origin",
2644
- fetchOptions: O
2645
- } = xn(e);
2646
- i = i ? (i + "").toLowerCase() : "text";
2647
- let _ = ps([o, s && s.toAbortSignal()], a), g;
2648
- const A = _ && _.unsubscribe && (() => {
2649
- _.unsubscribe();
2650
- });
2651
- let p;
2652
- try {
2653
- if (d && bs && n !== "get" && n !== "head" && (p = await vs(y, r)) !== 0) {
2654
- let m = new Request(t, {
2655
- method: "POST",
2656
- body: r,
2657
- duplex: "half"
2658
- }), E;
2659
- if (f.isFormData(r) && (E = m.headers.get("content-type")) && y.setContentType(E), m.body) {
2660
- const [S, D] = It(
2661
- p,
2662
- Ke(Vt(d))
2663
- );
2664
- r = Kt(m.body, Gt, S, D);
2665
- }
2666
- }
2667
- f.isString(c) || (c = c ? "include" : "omit");
2668
- const h = "credentials" in Request.prototype;
2669
- g = new Request(t, {
2670
- ...O,
2671
- signal: _,
2672
- method: n.toUpperCase(),
2673
- headers: y.normalize().toJSON(),
2674
- body: r,
2675
- duplex: "half",
2676
- credentials: h ? c : void 0
2677
- });
2678
- let u = await fetch(g);
2679
- const R = yt && (i === "stream" || i === "response");
2680
- if (yt && (l || R && A)) {
2681
- const m = {};
2682
- ["status", "statusText", "headers"].forEach((N) => {
2683
- m[N] = u[N];
2684
- });
2685
- const E = f.toFiniteNumber(u.headers.get("content-length")), [S, D] = l && It(
2686
- E,
2687
- Ke(Vt(l), !0)
2688
- ) || [];
2689
- u = new Response(
2690
- Kt(u.body, Gt, S, () => {
2691
- D && D(), A && A();
2692
- }),
2693
- m
2694
- );
2695
- }
2696
- i = i || "text";
2697
- let b = await Ge[f.findKey(Ge, i) || "text"](u, e);
2698
- return !R && A && A(), await new Promise((m, E) => {
2699
- An(m, E, {
2700
- data: b,
2701
- headers: se.from(u.headers),
2702
- status: u.status,
2703
- statusText: u.statusText,
2704
- config: e,
2705
- request: g
2706
- });
2707
- });
2708
- } catch (h) {
2709
- throw A && A(), h && h.name === "TypeError" && /Load failed|fetch/i.test(h.message) ? Object.assign(
2710
- new B("Network Error", B.ERR_NETWORK, e, g),
2711
- {
2712
- cause: h.cause || h
2713
- }
2714
- ) : B.from(h, h && h.code, e, g);
2715
- }
2716
- }), bt = {
2717
- http: Uo,
2718
- xhr: fs,
2719
- fetch: ks
2720
- };
2721
- f.forEach(bt, (e, t) => {
2722
- if (e) {
2723
- try {
2724
- Object.defineProperty(e, "name", { value: t });
2725
- } catch {
2726
- }
2727
- Object.defineProperty(e, "adapterName", { value: t });
2728
- }
2729
- });
2730
- const Xt = (e) => `- ${e}`, Es = (e) => f.isFunction(e) || e === null || e === !1, Nn = {
2731
- getAdapter: (e) => {
2732
- e = f.isArray(e) ? e : [e];
2733
- const { length: t } = e;
2734
- let n, r;
2735
- const o = {};
2736
- for (let s = 0; s < t; s++) {
2737
- n = e[s];
2738
- let a;
2739
- if (r = n, !Es(n) && (r = bt[(a = String(n)).toLowerCase()], r === void 0))
2740
- throw new B(`Unknown adapter '${a}'`);
2741
- if (r)
2742
- break;
2743
- o[a || "#" + s] = r;
2744
- }
2745
- if (!r) {
2746
- const s = Object.entries(o).map(
2747
- ([l, d]) => `adapter ${l} ` + (d === !1 ? "is not supported by the environment" : "is not available in the build")
2748
- );
2749
- let a = t ? s.length > 1 ? `since :
2750
- ` + s.map(Xt).join(`
2751
- `) : " " + Xt(s[0]) : "as no adapter specified";
2752
- throw new B(
2753
- "There is no suitable adapter to dispatch the request " + a,
2754
- "ERR_NOT_SUPPORT"
2755
- );
2756
- }
2757
- return r;
2758
- },
2759
- adapters: bt
2760
- };
2761
- function pt(e) {
2762
- if (e.cancelToken && e.cancelToken.throwIfRequested(), e.signal && e.signal.aborted)
2763
- throw new Ae(null, e);
2764
- }
2765
- function Zt(e) {
2766
- return pt(e), e.headers = se.from(e.headers), e.data = ft.call(
2767
- e,
2768
- e.transformRequest
2769
- ), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1), Nn.getAdapter(e.adapter || Le.adapter)(e).then(function(r) {
2770
- return pt(e), r.data = ft.call(
2771
- e,
2772
- e.transformResponse,
2773
- r
2774
- ), r.headers = se.from(r.headers), r;
2775
- }, function(r) {
2776
- return Tn(r) || (pt(e), r && r.response && (r.response.data = ft.call(
2777
- e,
2778
- e.transformResponse,
2779
- r.response
2780
- ), r.response.headers = se.from(r.response.headers))), Promise.reject(r);
2781
- });
2782
- }
2783
- const Pn = "1.9.0", lt = {};
2784
- ["object", "boolean", "number", "function", "string", "symbol"].forEach((e, t) => {
2785
- lt[e] = function(r) {
2786
- return typeof r === e || "a" + (t < 1 ? "n " : " ") + e;
2787
- };
2788
- });
2789
- const Qt = {};
2790
- lt.transitional = function(t, n, r) {
2791
- function o(s, a) {
2792
- return "[Axios v" + Pn + "] Transitional option '" + s + "'" + a + (r ? ". " + r : "");
2793
- }
2794
- return (s, a, l) => {
2795
- if (t === !1)
2796
- throw new B(
2797
- o(a, " has been removed" + (n ? " in " + n : "")),
2798
- B.ERR_DEPRECATED
2799
- );
2800
- return n && !Qt[a] && (Qt[a] = !0, console.warn(
2801
- o(
2802
- a,
2803
- " has been deprecated since v" + n + " and will be removed in the near future"
2804
- )
2805
- )), t ? t(s, a, l) : !0;
2806
- };
2807
- };
2808
- lt.spelling = function(t) {
2809
- return (n, r) => (console.warn(`${r} is likely a misspelling of ${t}`), !0);
2810
- };
2811
- function Ss(e, t, n) {
2812
- if (typeof e != "object")
2813
- throw new B("options must be an object", B.ERR_BAD_OPTION_VALUE);
2814
- const r = Object.keys(e);
2815
- let o = r.length;
2816
- for (; o-- > 0; ) {
2817
- const s = r[o], a = t[s];
2818
- if (a) {
2819
- const l = e[s], d = l === void 0 || a(l, s, e);
2820
- if (d !== !0)
2821
- throw new B("option " + s + " must be " + d, B.ERR_BAD_OPTION_VALUE);
2822
- continue;
2823
- }
2824
- if (n !== !0)
2825
- throw new B("Unknown option " + s, B.ERR_BAD_OPTION);
2826
- }
2827
- }
2828
- const Ve = {
2829
- assertOptions: Ss,
2830
- validators: lt
2831
- }, pe = Ve.validators;
2832
- let ve = class {
2833
- constructor(t) {
2834
- this.defaults = t || {}, this.interceptors = {
2835
- request: new zt(),
2836
- response: new zt()
2837
- };
2838
- }
2839
- /**
2840
- * Dispatch a request
2841
- *
2842
- * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
2843
- * @param {?Object} config
2844
- *
2845
- * @returns {Promise} The Promise to be fulfilled
2846
- */
2847
- async request(t, n) {
2848
- try {
2849
- return await this._request(t, n);
2850
- } catch (r) {
2851
- if (r instanceof Error) {
2852
- let o = {};
2853
- Error.captureStackTrace ? Error.captureStackTrace(o) : o = new Error();
2854
- const s = o.stack ? o.stack.replace(/^.+\n/, "") : "";
2855
- try {
2856
- r.stack ? s && !String(r.stack).endsWith(s.replace(/^.+\n.+\n/, "")) && (r.stack += `
2857
- ` + s) : r.stack = s;
2858
- } catch {
2859
- }
2860
- }
2861
- throw r;
2862
- }
2863
- }
2864
- _request(t, n) {
2865
- typeof t == "string" ? (n = n || {}, n.url = t) : n = t || {}, n = Se(this.defaults, n);
2866
- const { transitional: r, paramsSerializer: o, headers: s } = n;
2867
- r !== void 0 && Ve.assertOptions(r, {
2868
- silentJSONParsing: pe.transitional(pe.boolean),
2869
- forcedJSONParsing: pe.transitional(pe.boolean),
2870
- clarifyTimeoutError: pe.transitional(pe.boolean)
2871
- }, !1), o != null && (f.isFunction(o) ? n.paramsSerializer = {
2872
- serialize: o
2873
- } : Ve.assertOptions(o, {
2874
- encode: pe.function,
2875
- serialize: pe.function
2876
- }, !0)), n.allowAbsoluteUrls !== void 0 || (this.defaults.allowAbsoluteUrls !== void 0 ? n.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls : n.allowAbsoluteUrls = !0), Ve.assertOptions(n, {
2877
- baseUrl: pe.spelling("baseURL"),
2878
- withXsrfToken: pe.spelling("withXSRFToken")
2879
- }, !0), n.method = (n.method || this.defaults.method || "get").toLowerCase();
2880
- let a = s && f.merge(
2881
- s.common,
2882
- s[n.method]
2883
- );
2884
- s && f.forEach(
2885
- ["delete", "get", "head", "post", "put", "patch", "common"],
2886
- (g) => {
2887
- delete s[g];
2888
- }
2889
- ), n.headers = se.concat(a, s);
2890
- const l = [];
2891
- let d = !0;
2892
- this.interceptors.request.forEach(function(A) {
2893
- typeof A.runWhen == "function" && A.runWhen(n) === !1 || (d = d && A.synchronous, l.unshift(A.fulfilled, A.rejected));
2894
- });
2895
- const i = [];
2896
- this.interceptors.response.forEach(function(A) {
2897
- i.push(A.fulfilled, A.rejected);
2898
- });
2899
- let y, c = 0, O;
2900
- if (!d) {
2901
- const g = [Zt.bind(this), void 0];
2902
- for (g.unshift.apply(g, l), g.push.apply(g, i), O = g.length, y = Promise.resolve(n); c < O; )
2903
- y = y.then(g[c++], g[c++]);
2904
- return y;
2905
- }
2906
- O = l.length;
2907
- let _ = n;
2908
- for (c = 0; c < O; ) {
2909
- const g = l[c++], A = l[c++];
2910
- try {
2911
- _ = g(_);
2912
- } catch (p) {
2913
- A.call(this, p);
2914
- break;
2915
- }
2916
- }
2917
- try {
2918
- y = Zt.call(this, _);
2919
- } catch (g) {
2920
- return Promise.reject(g);
2921
- }
2922
- for (c = 0, O = i.length; c < O; )
2923
- y = y.then(i[c++], i[c++]);
2924
- return y;
2925
- }
2926
- getUri(t) {
2927
- t = Se(this.defaults, t);
2928
- const n = Cn(t.baseURL, t.url, t.allowAbsoluteUrls);
2929
- return _n(n, t.params, t.paramsSerializer);
2930
- }
2931
- };
2932
- f.forEach(["delete", "get", "head", "options"], function(t) {
2933
- ve.prototype[t] = function(n, r) {
2934
- return this.request(Se(r || {}, {
2935
- method: t,
2936
- url: n,
2937
- data: (r || {}).data
2938
- }));
2939
- };
2940
- });
2941
- f.forEach(["post", "put", "patch"], function(t) {
2942
- function n(r) {
2943
- return function(s, a, l) {
2944
- return this.request(Se(l || {}, {
2945
- method: t,
2946
- headers: r ? {
2947
- "Content-Type": "multipart/form-data"
2948
- } : {},
2949
- url: s,
2950
- data: a
2951
- }));
2952
- };
2953
- }
2954
- ve.prototype[t] = n(), ve.prototype[t + "Form"] = n(!0);
2955
- });
2956
- let Rs = class Un {
2957
- constructor(t) {
2958
- if (typeof t != "function")
2959
- throw new TypeError("executor must be a function.");
2960
- let n;
2961
- this.promise = new Promise(function(s) {
2962
- n = s;
2963
- });
2964
- const r = this;
2965
- this.promise.then((o) => {
2966
- if (!r._listeners) return;
2967
- let s = r._listeners.length;
2968
- for (; s-- > 0; )
2969
- r._listeners[s](o);
2970
- r._listeners = null;
2971
- }), this.promise.then = (o) => {
2972
- let s;
2973
- const a = new Promise((l) => {
2974
- r.subscribe(l), s = l;
2975
- }).then(o);
2976
- return a.cancel = function() {
2977
- r.unsubscribe(s);
2978
- }, a;
2979
- }, t(function(s, a, l) {
2980
- r.reason || (r.reason = new Ae(s, a, l), n(r.reason));
2981
- });
2982
- }
2983
- /**
2984
- * Throws a `CanceledError` if cancellation has been requested.
2985
- */
2986
- throwIfRequested() {
2987
- if (this.reason)
2988
- throw this.reason;
2989
- }
2990
- /**
2991
- * Subscribe to the cancel signal
2992
- */
2993
- subscribe(t) {
2994
- if (this.reason) {
2995
- t(this.reason);
2996
- return;
2997
- }
2998
- this._listeners ? this._listeners.push(t) : this._listeners = [t];
2999
- }
3000
- /**
3001
- * Unsubscribe from the cancel signal
3002
- */
3003
- unsubscribe(t) {
3004
- if (!this._listeners)
3005
- return;
3006
- const n = this._listeners.indexOf(t);
3007
- n !== -1 && this._listeners.splice(n, 1);
3008
- }
3009
- toAbortSignal() {
3010
- const t = new AbortController(), n = (r) => {
3011
- t.abort(r);
3012
- };
3013
- return this.subscribe(n), t.signal.unsubscribe = () => this.unsubscribe(n), t.signal;
3014
- }
3015
- /**
3016
- * Returns an object that contains a new `CancelToken` and a function that, when called,
3017
- * cancels the `CancelToken`.
3018
- */
3019
- static source() {
3020
- let t;
3021
- return {
3022
- token: new Un(function(o) {
3023
- t = o;
3024
- }),
3025
- cancel: t
3026
- };
3027
- }
3028
- };
3029
- function _s(e) {
3030
- return function(n) {
3031
- return e.apply(null, n);
3032
- };
3033
- }
3034
- function ws(e) {
3035
- return f.isObject(e) && e.isAxiosError === !0;
3036
- }
3037
- const gt = {
3038
- Continue: 100,
3039
- SwitchingProtocols: 101,
3040
- Processing: 102,
3041
- EarlyHints: 103,
3042
- Ok: 200,
3043
- Created: 201,
3044
- Accepted: 202,
3045
- NonAuthoritativeInformation: 203,
3046
- NoContent: 204,
3047
- ResetContent: 205,
3048
- PartialContent: 206,
3049
- MultiStatus: 207,
3050
- AlreadyReported: 208,
3051
- ImUsed: 226,
3052
- MultipleChoices: 300,
3053
- MovedPermanently: 301,
3054
- Found: 302,
3055
- SeeOther: 303,
3056
- NotModified: 304,
3057
- UseProxy: 305,
3058
- Unused: 306,
3059
- TemporaryRedirect: 307,
3060
- PermanentRedirect: 308,
3061
- BadRequest: 400,
3062
- Unauthorized: 401,
3063
- PaymentRequired: 402,
3064
- Forbidden: 403,
3065
- NotFound: 404,
3066
- MethodNotAllowed: 405,
3067
- NotAcceptable: 406,
3068
- ProxyAuthenticationRequired: 407,
3069
- RequestTimeout: 408,
3070
- Conflict: 409,
3071
- Gone: 410,
3072
- LengthRequired: 411,
3073
- PreconditionFailed: 412,
3074
- PayloadTooLarge: 413,
3075
- UriTooLong: 414,
3076
- UnsupportedMediaType: 415,
3077
- RangeNotSatisfiable: 416,
3078
- ExpectationFailed: 417,
3079
- ImATeapot: 418,
3080
- MisdirectedRequest: 421,
3081
- UnprocessableEntity: 422,
3082
- Locked: 423,
3083
- FailedDependency: 424,
3084
- TooEarly: 425,
3085
- UpgradeRequired: 426,
3086
- PreconditionRequired: 428,
3087
- TooManyRequests: 429,
3088
- RequestHeaderFieldsTooLarge: 431,
3089
- UnavailableForLegalReasons: 451,
3090
- InternalServerError: 500,
3091
- NotImplemented: 501,
3092
- BadGateway: 502,
3093
- ServiceUnavailable: 503,
3094
- GatewayTimeout: 504,
3095
- HttpVersionNotSupported: 505,
3096
- VariantAlsoNegotiates: 506,
3097
- InsufficientStorage: 507,
3098
- LoopDetected: 508,
3099
- NotExtended: 510,
3100
- NetworkAuthenticationRequired: 511
3101
- };
3102
- Object.entries(gt).forEach(([e, t]) => {
3103
- gt[t] = e;
3104
- });
3105
- function Bn(e) {
3106
- const t = new ve(e), n = pn(ve.prototype.request, t);
3107
- return f.extend(n, ve.prototype, t, { allOwnKeys: !0 }), f.extend(n, t, null, { allOwnKeys: !0 }), n.create = function(o) {
3108
- return Bn(Se(e, o));
3109
- }, n;
3110
- }
3111
- const G = Bn(Le);
3112
- G.Axios = ve;
3113
- G.CanceledError = Ae;
3114
- G.CancelToken = Rs;
3115
- G.isCancel = Tn;
3116
- G.VERSION = Pn;
3117
- G.toFormData = st;
3118
- G.AxiosError = B;
3119
- G.Cancel = G.CanceledError;
3120
- G.all = function(t) {
3121
- return Promise.all(t);
3122
- };
3123
- G.spread = _s;
3124
- G.isAxiosError = ws;
3125
- G.mergeConfig = Se;
3126
- G.AxiosHeaders = se;
3127
- G.formToJSON = (e) => On(f.isHTMLForm(e) ? new FormData(e) : e);
3128
- G.getAdapter = Nn.getAdapter;
3129
- G.HttpStatusCode = gt;
3130
- G.default = G;
3131
- const {
3132
- Axios: Is,
3133
- AxiosError: Vs,
3134
- CanceledError: Ws,
3135
- isCancel: Ks,
3136
- CancelToken: Gs,
3137
- VERSION: Xs,
3138
- all: Zs,
3139
- Cancel: Qs,
3140
- isAxiosError: Ys,
3141
- spread: ea,
3142
- toFormData: ta,
3143
- AxiosHeaders: na,
3144
- HttpStatusCode: ra,
3145
- formToJSON: oa,
3146
- getAdapter: sa,
3147
- mergeConfig: aa
3148
- } = G;
3149
- /*! js-cookie v3.0.5 | MIT */
3150
- function Me(e) {
3151
- for (var t = 1; t < arguments.length; t++) {
3152
- var n = arguments[t];
3153
- for (var r in n)
3154
- e[r] = n[r];
3155
- }
3156
- return e;
3157
- }
3158
- var Os = {
3159
- read: function(e) {
3160
- return e[0] === '"' && (e = e.slice(1, -1)), e.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent);
3161
- },
3162
- write: function(e) {
3163
- return encodeURIComponent(e).replace(
3164
- /%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,
3165
- decodeURIComponent
3166
- );
3167
- }
3168
- };
3169
- function vt(e, t) {
3170
- function n(o, s, a) {
3171
- if (!(typeof document > "u")) {
3172
- a = Me({}, t, a), typeof a.expires == "number" && (a.expires = new Date(Date.now() + a.expires * 864e5)), a.expires && (a.expires = a.expires.toUTCString()), o = encodeURIComponent(o).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape);
3173
- var l = "";
3174
- for (var d in a)
3175
- a[d] && (l += "; " + d, a[d] !== !0 && (l += "=" + a[d].split(";")[0]));
3176
- return document.cookie = o + "=" + e.write(s, o) + l;
3177
- }
3178
- }
3179
- function r(o) {
3180
- if (!(typeof document > "u" || arguments.length && !o)) {
3181
- for (var s = document.cookie ? document.cookie.split("; ") : [], a = {}, l = 0; l < s.length; l++) {
3182
- var d = s[l].split("="), i = d.slice(1).join("=");
3183
- try {
3184
- var y = decodeURIComponent(d[0]);
3185
- if (a[y] = e.read(i, y), o === y)
3186
- break;
3187
- } catch {
3188
- }
3189
- }
3190
- return o ? a[o] : a;
3191
- }
3192
- }
3193
- return Object.create(
3194
- {
3195
- set: n,
3196
- get: r,
3197
- remove: function(o, s) {
3198
- n(
3199
- o,
3200
- "",
3201
- Me({}, s, {
3202
- expires: -1
3203
- })
3204
- );
3205
- },
3206
- withAttributes: function(o) {
3207
- return vt(this.converter, Me({}, this.attributes, o));
3208
- },
3209
- withConverter: function(o) {
3210
- return vt(Me({}, this.converter, o), this.attributes);
3211
- }
3212
- },
3213
- {
3214
- attributes: { value: Object.freeze(t) },
3215
- converter: { value: Object.freeze(e) }
3216
- }
3217
- );
3218
- }
3219
- vt(Os, { path: "/" });
3220
- const ke = {
3221
- // 查看 v2.4.3版本更新日志
3222
- setKey(e) {
3223
- return `ss-component-new:${e}`;
3224
- },
3225
- // 设置永久缓存
3226
- set(e, t) {
3227
- window.localStorage.setItem(ke.setKey(e), JSON.stringify(t));
3228
- },
3229
- // 获取永久缓存
3230
- get(e) {
3231
- let t = window.localStorage.getItem(ke.setKey(e));
3232
- return JSON.parse(t);
3233
- },
3234
- // 移除永久缓存
3235
- remove(e) {
3236
- window.localStorage.removeItem(ke.setKey(e));
3237
- },
3238
- // 移除全部永久缓存
3239
- clear() {
3240
- window.localStorage.clear();
3241
- }
3242
- }, jn = /* @__PURE__ */ new Map();
3243
- console.log("import.meta.env.VITE_API_URL", "http://139.196.154.85:20013");
3244
- const $n = G.create({
3245
- baseURL: "http://139.196.154.85:20013",
3246
- timeout: 5e4
3247
- //headers: { 'Content-Type': 'application/json' }, 这个会导致生成代码的上传文件 file为空
3248
- }), Xe = "access-token", kt = `x-${Xe}`;
3249
- $n.interceptors.request.use(
3250
- (e) => {
3251
- var o;
3252
- const t = new AbortController();
3253
- e.signal = t.signal;
3254
- const n = e.url || "";
3255
- jn.set(n, t);
3256
- const r = ke.get(Xe);
3257
- if (r) {
3258
- e.headers.Authorization = `Bearer ${r}`;
3259
- const s = As(r), a = Cs(s.exp);
3260
- if (/* @__PURE__ */ new Date() >= a) {
3261
- const l = ke.get(kt);
3262
- l && (e.headers["X-Authorization"] = `Bearer ${l}`);
3263
- }
3264
- if (((o = e.method) == null ? void 0 : o.toLowerCase()) === "get" && e.data) {
3265
- let l = e.url + "?" + Ts(e.data);
3266
- l = l.slice(0, -1), e.data = {}, e.url = l;
3267
- }
3268
- }
3269
- return e;
3270
- },
3271
- (e) => Promise.reject(e)
3272
- );
3273
- $n.interceptors.response.use(
3274
- (e) => {
3275
- const t = e.config.url || "";
3276
- jn.delete(t);
3277
- var n = e.status, r = e.data;
3278
- if (n === 401)
3279
- throw new Error(e.statusText || "Request Error.");
3280
- if (n >= 400)
3281
- throw new Error(e.statusText || "Request Error.");
3282
- if (r && r.hasOwnProperty("errors") && r.errors)
3283
- throw new Error(JSON.stringify(r.errors || "Request Error."));
3284
- var o = e.headers[Xe], s = e.headers[kt];
3285
- if (o === "invalid_token")
3286
- throw new Error(e.statusText || "Request Error.");
3287
- if (s && o && (ke.set(Xe, o), ke.set(kt, s)), r.code === 401)
3288
- throw new Error(e.statusText || "Request Error.");
3289
- if (r.code === void 0)
3290
- return Promise.resolve(e);
3291
- if (r.code !== 200) {
3292
- var a;
3293
- throw r.message && typeof r.message == "object" ? a = JSON.stringify(r.message) : a = r.message, Fe({
3294
- dangerouslyUseHTMLString: !0,
3295
- message: a,
3296
- type: "error"
3297
- }), new Error(a);
3298
- }
3299
- return e;
3300
- },
3301
- (e) => {
3302
- var t, n;
3303
- if (e.response && e.response.status === 401)
3304
- throw new Error(res.statusText || "Request Error.");
3305
- return e.message.indexOf("timeout") != -1 ? Fe.error("网络超时") : e.message == "Network Error" ? Fe.error("网络连接错误") : (t = e.response) != null && t.data ? Fe.error((n = e.response) == null ? void 0 : n.statusText) : Fe.error("接口路径找不到"), Promise.reject(e);
3306
- }
3307
- );
3308
- function Ts(e) {
3309
- let t = "";
3310
- for (const o of Object.keys(e)) {
3311
- const s = e[o];
3312
- var n = encodeURIComponent(o) + "=";
3313
- if (s !== null && s !== "" && typeof s < "u")
3314
- if (typeof s == "object") {
3315
- for (const a of Object.keys(s))
3316
- if (s[a] !== null && s[a] !== "" && typeof s[a] < "u") {
3317
- let l = o + "[" + a + "]";
3318
- var r = encodeURIComponent(l) + "=";
3319
- t += r + encodeURIComponent(s[a]) + "&";
3320
- }
3321
- } else
3322
- t += n + encodeURIComponent(s) + "&";
3323
- }
3324
- return t;
3325
- }
3326
- function As(e) {
3327
- e = e.replace(/_/g, "/").replace(/-/g, "+");
3328
- var t = decodeURIComponent(escape(window.atob(e.split(".")[1])));
3329
- return JSON.parse(t);
3330
- }
3331
- function Cs(e) {
3332
- return new Date(e * 1e3);
3333
- }
3334
- const xs = Ye(he), { itemData: la } = Ee(xs), Ds = In(he), { systemKey: ia, activeMenuPath: ca } = Ee(Ds), Pe = U(0), ua = (e) => e.reduce((n, r) => {
3335
- var s, a;
3336
- const o = Object.values(n);
3337
- return (((s = Object.keys(n)) == null ? void 0 : s.length) === 0 || o[o.length - 1].length >= (r == null ? void 0 : r.width)) && (n[Pe.value] = [], Pe.value++), n[Pe.value - 1].push(r), ((a = Object.keys(n)) == null ? void 0 : a.length) === (r == null ? void 0 : r.width) && (n[Pe.value] = [], Pe.value++), n;
3338
- }, {});
3339
- export {
3340
- qs as a,
3341
- Ls as b,
3342
- ua as c,
3343
- te as d,
3344
- Js as e,
3345
- Xn as f,
3346
- ln as g,
3347
- Ms as i,
3348
- $s as m,
3349
- he as p,
3350
- nn as u,
3351
- ne as v
3352
- };