@opengis/form 0.0.9 → 0.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1269 -841
- package/dist/index.umd.cjs +5 -5
- package/package.json +63 -61
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent, createElementBlock, openBlock, createCommentVNode, renderSlot, createElementVNode, toDisplayString, normalizeProps, guardReactiveProps, createTextVNode, computed, mergeModels, useModel, withDirectives, normalizeClass, unref, vModelText, vModelCheckbox, createVNode, ref, createBlock, resolveDynamicComponent, normalizeStyle, withCtx, withModifiers, vModelRadio, Fragment, renderList, mergeProps, reactive, watch, onMounted,
|
|
2
|
-
const _hoisted_1$
|
|
1
|
+
import { defineComponent, createElementBlock, openBlock, createCommentVNode, renderSlot, createElementVNode, toDisplayString, normalizeProps, guardReactiveProps, createTextVNode, computed, mergeModels, useModel, withDirectives, normalizeClass, unref, vModelText, vModelCheckbox, createVNode, ref, createBlock, resolveDynamicComponent, normalizeStyle, withCtx, withModifiers, createStaticVNode, vModelRadio, Fragment, renderList, mergeProps, reactive, watch, onMounted, createApp, h, Transition, vShow, inject, nextTick, onUnmounted, Teleport, useAttrs, provide } from "vue";
|
|
2
|
+
const _hoisted_1$A = { class: "w-full relative" }, _hoisted_2$d = {
|
|
3
3
|
key: 0,
|
|
4
4
|
class: "text-[14px] font-medium text-gray-900 mb-2"
|
|
5
5
|
}, _hoisted_3$6 = {
|
|
@@ -8,7 +8,7 @@ const _hoisted_1$z = { class: "w-full relative" }, _hoisted_2$c = {
|
|
|
8
8
|
}, _hoisted_4$5 = {
|
|
9
9
|
key: 1,
|
|
10
10
|
class: "text-red-500 text-[10px] absolute bottom-[-14px]"
|
|
11
|
-
}, _sfc_main$
|
|
11
|
+
}, _sfc_main$F = /* @__PURE__ */ defineComponent({
|
|
12
12
|
__name: "vs-layout-default",
|
|
13
13
|
props: {
|
|
14
14
|
ua: {
|
|
@@ -29,8 +29,8 @@ const _hoisted_1$z = { class: "w-full relative" }, _hoisted_2$c = {
|
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
31
|
setup(e) {
|
|
32
|
-
return (t,
|
|
33
|
-
e.ua || e.label ? (openBlock(), createElementBlock("div", _hoisted_2$
|
|
32
|
+
return (t, o) => (openBlock(), createElementBlock("div", _hoisted_1$A, [
|
|
33
|
+
e.ua || e.label ? (openBlock(), createElementBlock("div", _hoisted_2$d, [
|
|
34
34
|
createElementVNode("span", null, toDisplayString(e.ua || e.label), 1),
|
|
35
35
|
e.item?.rules?.includes("required") ? (openBlock(), createElementBlock("span", _hoisted_3$6, "*")) : createCommentVNode("", !0)
|
|
36
36
|
])) : createCommentVNode("", !0),
|
|
@@ -38,16 +38,16 @@ const _hoisted_1$z = { class: "w-full relative" }, _hoisted_2$c = {
|
|
|
38
38
|
e.error ? (openBlock(), createElementBlock("span", _hoisted_4$5, toDisplayString(e.error), 1)) : createCommentVNode("", !0)
|
|
39
39
|
]));
|
|
40
40
|
}
|
|
41
|
-
}), _hoisted_1$
|
|
41
|
+
}), _hoisted_1$z = { class: "w-full relative flex flex-row items-center gap-2" }, _hoisted_2$c = {
|
|
42
42
|
key: 0,
|
|
43
|
-
class: "text-sm text-gray-900 font-medium flex shrink-0 w-3/12"
|
|
43
|
+
class: "text-sm text-gray-900 font-medium flex shrink-0 w-3/12 max-w-[250px]"
|
|
44
44
|
}, _hoisted_3$5 = {
|
|
45
45
|
key: 0,
|
|
46
46
|
class: "text-red-500 text-[14px]"
|
|
47
47
|
}, _hoisted_4$4 = {
|
|
48
48
|
key: 1,
|
|
49
49
|
class: "text-red-500 text-[10px] absolute bottom-[-14px]"
|
|
50
|
-
}, _sfc_main$
|
|
50
|
+
}, _sfc_main$E = /* @__PURE__ */ defineComponent({
|
|
51
51
|
__name: "vs-layout-horizontal",
|
|
52
52
|
props: {
|
|
53
53
|
ua: {
|
|
@@ -68,8 +68,8 @@ const _hoisted_1$z = { class: "w-full relative" }, _hoisted_2$c = {
|
|
|
68
68
|
}
|
|
69
69
|
},
|
|
70
70
|
setup(e) {
|
|
71
|
-
return (t,
|
|
72
|
-
e.item?.type !== "html" ? (openBlock(), createElementBlock("span", _hoisted_2$
|
|
71
|
+
return (t, o) => (openBlock(), createElementBlock("div", _hoisted_1$z, [
|
|
72
|
+
e.item?.type !== "html" ? (openBlock(), createElementBlock("span", _hoisted_2$c, [
|
|
73
73
|
createTextVNode(toDisplayString(e.ua || e.label) + " ", 1),
|
|
74
74
|
e.item?.rules?.includes("required") && (e.ua || e.label) ? (openBlock(), createElementBlock("span", _hoisted_3$5, "*")) : createCommentVNode("", !0)
|
|
75
75
|
])) : createCommentVNode("", !0),
|
|
@@ -77,10 +77,10 @@ const _hoisted_1$z = { class: "w-full relative" }, _hoisted_2$c = {
|
|
|
77
77
|
e.error ? (openBlock(), createElementBlock("span", _hoisted_4$4, toDisplayString(e.error), 1)) : createCommentVNode("", !0)
|
|
78
78
|
]));
|
|
79
79
|
}
|
|
80
|
-
}), _hoisted_1$
|
|
80
|
+
}), _hoisted_1$y = { class: "w-full relative" }, _hoisted_2$b = {
|
|
81
81
|
key: 0,
|
|
82
82
|
class: "text-red-500 text-[10px] absolute bottom-[-14px]"
|
|
83
|
-
}, _sfc_main$
|
|
83
|
+
}, _sfc_main$D = /* @__PURE__ */ defineComponent({
|
|
84
84
|
__name: "vs-layout-inline",
|
|
85
85
|
props: {
|
|
86
86
|
ua: {
|
|
@@ -101,25 +101,25 @@ const _hoisted_1$z = { class: "w-full relative" }, _hoisted_2$c = {
|
|
|
101
101
|
}
|
|
102
102
|
},
|
|
103
103
|
setup(e) {
|
|
104
|
-
return (t,
|
|
104
|
+
return (t, o) => (openBlock(), createElementBlock("div", _hoisted_1$y, [
|
|
105
105
|
renderSlot(t.$slots, "default", normalizeProps(guardReactiveProps(t.$attrs))),
|
|
106
|
-
e.error ? (openBlock(), createElementBlock("span", _hoisted_2$
|
|
106
|
+
e.error ? (openBlock(), createElementBlock("span", _hoisted_2$b, toDisplayString(e.error), 1)) : createCommentVNode("", !0)
|
|
107
107
|
]));
|
|
108
108
|
}
|
|
109
109
|
}), layouts$1 = {
|
|
110
|
-
default: _sfc_main$
|
|
111
|
-
horizontal: _sfc_main$
|
|
112
|
-
inline: _sfc_main$
|
|
110
|
+
default: _sfc_main$F,
|
|
111
|
+
horizontal: _sfc_main$E,
|
|
112
|
+
inline: _sfc_main$D
|
|
113
113
|
};
|
|
114
114
|
function useStyle(e) {
|
|
115
115
|
return {
|
|
116
116
|
inputClass: computed(() => {
|
|
117
|
-
const
|
|
118
|
-
return e?.size === "sm" ?
|
|
117
|
+
const o = `disabled:opacity-50 disabled:cursor-not-allowed outline-none focus:ring-2 focus:ring-ring focus:ring-${e?.primaryColor || "blue"}-500 border border-solid border-stone-200 rounded-md text-sm text-stone-800 placeholder:text-stone-400 `;
|
|
118
|
+
return e?.size === "sm" ? o + "h-[32px]" : o + "h-[38px]";
|
|
119
119
|
})
|
|
120
120
|
};
|
|
121
121
|
}
|
|
122
|
-
const _hoisted_1$
|
|
122
|
+
const _hoisted_1$x = ["placeholder", "disabled"], _sfc_main$C = /* @__PURE__ */ defineComponent({
|
|
123
123
|
__name: "vs-input-text",
|
|
124
124
|
props: /* @__PURE__ */ mergeModels({
|
|
125
125
|
style: {
|
|
@@ -148,21 +148,21 @@ const _hoisted_1$w = ["placeholder", "disabled"], _sfc_main$B = /* @__PURE__ */
|
|
|
148
148
|
}),
|
|
149
149
|
emits: ["update:modelValue"],
|
|
150
150
|
setup(e) {
|
|
151
|
-
const t = e, { inputClass:
|
|
151
|
+
const t = e, { inputClass: o } = useStyle(t.style), n = useModel(e, "modelValue");
|
|
152
152
|
return (r, s) => withDirectives((openBlock(), createElementBlock("input", {
|
|
153
153
|
type: "text",
|
|
154
|
-
"onUpdate:modelValue": s[0] || (s[0] = (l) =>
|
|
154
|
+
"onUpdate:modelValue": s[0] || (s[0] = (l) => n.value = l),
|
|
155
155
|
placeholder: e.placeholder,
|
|
156
156
|
disabled: e.disabled,
|
|
157
|
-
class: normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f]", [unref(
|
|
157
|
+
class: normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f]", [unref(o), { "!border-red-600": e.error }]]),
|
|
158
158
|
style: {
|
|
159
159
|
border: "1px solid #CFD9E0"
|
|
160
160
|
}
|
|
161
|
-
}, null, 10, _hoisted_1$
|
|
162
|
-
[vModelText,
|
|
161
|
+
}, null, 10, _hoisted_1$x)), [
|
|
162
|
+
[vModelText, n.value]
|
|
163
163
|
]);
|
|
164
164
|
}
|
|
165
|
-
}), _hoisted_1$
|
|
165
|
+
}), _hoisted_1$w = ["placeholder"], _sfc_main$B = /* @__PURE__ */ defineComponent({
|
|
166
166
|
__name: "vs-input-number",
|
|
167
167
|
props: /* @__PURE__ */ mergeModels({
|
|
168
168
|
style: {
|
|
@@ -179,25 +179,25 @@ const _hoisted_1$w = ["placeholder", "disabled"], _sfc_main$B = /* @__PURE__ */
|
|
|
179
179
|
}),
|
|
180
180
|
emits: ["update:modelValue"],
|
|
181
181
|
setup(e) {
|
|
182
|
-
const t = e, { inputClass:
|
|
182
|
+
const t = e, { inputClass: o } = useStyle(t.style), n = useModel(e, "modelValue");
|
|
183
183
|
return (r, s) => withDirectives((openBlock(), createElementBlock("input", {
|
|
184
184
|
type: "number",
|
|
185
|
-
"onUpdate:modelValue": s[0] || (s[0] = (l) =>
|
|
185
|
+
"onUpdate:modelValue": s[0] || (s[0] = (l) => n.value = l),
|
|
186
186
|
placeholder: e.placeholder,
|
|
187
|
-
class: normalizeClass(["py-1.5 px-3 block w-full", [unref(
|
|
187
|
+
class: normalizeClass(["py-1.5 px-3 block w-full", [unref(o)]]),
|
|
188
188
|
style: {
|
|
189
189
|
border: "1px solid #CFD9E0"
|
|
190
190
|
}
|
|
191
|
-
}, null, 10, _hoisted_1$
|
|
192
|
-
[vModelText,
|
|
191
|
+
}, null, 10, _hoisted_1$w)), [
|
|
192
|
+
[vModelText, n.value]
|
|
193
193
|
]);
|
|
194
194
|
}
|
|
195
195
|
}), _export_sfc = (e, t) => {
|
|
196
|
-
const
|
|
197
|
-
for (const [
|
|
198
|
-
n
|
|
199
|
-
return
|
|
200
|
-
}, _sfc_main$
|
|
196
|
+
const o = e.__vccOpts || e;
|
|
197
|
+
for (const [n, r] of t)
|
|
198
|
+
o[n] = r;
|
|
199
|
+
return o;
|
|
200
|
+
}, _sfc_main$A = {}, _hoisted_1$v = {
|
|
201
201
|
xmlns: "http://www.w3.org/2000/svg",
|
|
202
202
|
viewBox: "0 0 24 24",
|
|
203
203
|
fill: "none",
|
|
@@ -208,7 +208,7 @@ const _hoisted_1$w = ["placeholder", "disabled"], _sfc_main$B = /* @__PURE__ */
|
|
|
208
208
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-check"
|
|
209
209
|
};
|
|
210
210
|
function _sfc_render$d(e, t) {
|
|
211
|
-
return openBlock(), createElementBlock("svg", _hoisted_1$
|
|
211
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$v, t[0] || (t[0] = [
|
|
212
212
|
createElementVNode("path", {
|
|
213
213
|
stroke: "none",
|
|
214
214
|
d: "M0 0h24v24H0z",
|
|
@@ -217,7 +217,7 @@ function _sfc_render$d(e, t) {
|
|
|
217
217
|
createElementVNode("path", { d: "M5 12l5 5l10 -10" }, null, -1)
|
|
218
218
|
]));
|
|
219
219
|
}
|
|
220
|
-
const IconCheck = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
220
|
+
const IconCheck = /* @__PURE__ */ _export_sfc(_sfc_main$A, [["render", _sfc_render$d]]), _hoisted_1$u = { class: "flex items-center gap-[4px]" }, _hoisted_2$a = ["value", "id", "disabled"], _hoisted_3$4 = ["for"], _hoisted_4$3 = { class: "text-[14px] text-gray-700 flex items-center gap-x-1 ml-1 dark:text-neutral-400" }, _sfc_main$z = /* @__PURE__ */ defineComponent({
|
|
221
221
|
__name: "vs-checkbox-default",
|
|
222
222
|
props: {
|
|
223
223
|
value: { type: [String, Number], default: "" },
|
|
@@ -230,11 +230,11 @@ const IconCheck = /* @__PURE__ */ _export_sfc(_sfc_main$z, [["render", _sfc_rend
|
|
|
230
230
|
},
|
|
231
231
|
emits: ["update:modelValue"],
|
|
232
232
|
setup(e, { emit: t }) {
|
|
233
|
-
const
|
|
234
|
-
get: () =>
|
|
235
|
-
set: (s) =>
|
|
233
|
+
const o = t, n = e, r = computed({
|
|
234
|
+
get: () => n.modelValue,
|
|
235
|
+
set: (s) => o("update:modelValue", s)
|
|
236
236
|
});
|
|
237
|
-
return (s, l) => (openBlock(), createElementBlock("div", _hoisted_1$
|
|
237
|
+
return (s, l) => (openBlock(), createElementBlock("div", _hoisted_1$u, [
|
|
238
238
|
withDirectives(createElementVNode("input", {
|
|
239
239
|
type: "checkbox",
|
|
240
240
|
value: e.value,
|
|
@@ -242,7 +242,7 @@ const IconCheck = /* @__PURE__ */ _export_sfc(_sfc_main$z, [["render", _sfc_rend
|
|
|
242
242
|
class: normalizeClass(["shrink-0 border border-solid hidden border-gray-700 w-3.5 h-3.5 rounded text-blue-600 focus:ring-offset-0 dark:bg-neutral-800 dark:border-neutral-700 cursor-pointer", { "!cursor-not-allowed": e.disabled }]),
|
|
243
243
|
id: e.id,
|
|
244
244
|
disabled: e.disabled
|
|
245
|
-
}, null, 10, _hoisted_2$
|
|
245
|
+
}, null, 10, _hoisted_2$a), [
|
|
246
246
|
[vModelCheckbox, r.value]
|
|
247
247
|
]),
|
|
248
248
|
createElementVNode("label", {
|
|
@@ -265,10 +265,10 @@ const IconCheck = /* @__PURE__ */ _export_sfc(_sfc_main$z, [["render", _sfc_rend
|
|
|
265
265
|
], 10, _hoisted_3$4)
|
|
266
266
|
]));
|
|
267
267
|
}
|
|
268
|
-
}), _hoisted_1$
|
|
268
|
+
}), _hoisted_1$t = ["name", "value", "disabled"], _hoisted_2$9 = { class: "flex items-center gap-[6px] text-[14px]" }, _hoisted_3$3 = {
|
|
269
269
|
key: 0,
|
|
270
270
|
class: "text-[16px]"
|
|
271
|
-
}, _hoisted_4$2 = ["src"], _sfc_main$
|
|
271
|
+
}, _hoisted_4$2 = ["src"], _sfc_main$y = /* @__PURE__ */ defineComponent({
|
|
272
272
|
__name: "vs-checkbox-buttons",
|
|
273
273
|
props: {
|
|
274
274
|
value: { type: [String, Number, Boolean], default: "" },
|
|
@@ -285,12 +285,12 @@ const IconCheck = /* @__PURE__ */ _export_sfc(_sfc_main$z, [["render", _sfc_rend
|
|
|
285
285
|
},
|
|
286
286
|
emits: ["update:modelValue"],
|
|
287
287
|
setup(e, { emit: t }) {
|
|
288
|
-
const
|
|
289
|
-
get: () =>
|
|
288
|
+
const o = e, n = t, r = computed({
|
|
289
|
+
get: () => o.modelValue,
|
|
290
290
|
set: (i) => {
|
|
291
|
-
|
|
291
|
+
n("update:modelValue", i);
|
|
292
292
|
}
|
|
293
|
-
}), s = computed(() => Array.isArray(r.value) ? r.value.includes(
|
|
293
|
+
}), s = computed(() => Array.isArray(r.value) ? r.value.includes(o.value) : r.value === !0 || r.value === o.value), l = computed(() => o.style?.size === "xs" ? "p-1.5 text-xs" : o.style?.size === "lg" ? "p-3.5 text-[20px]" : "p-2.5 text-xs");
|
|
294
294
|
return (i, u) => (openBlock(), createElementBlock("label", {
|
|
295
295
|
class: normalizeClass(["group relative flex justify-center items-center gap-x-3 text-center bg-white text-gray-800 ring-ring ring-2 cursor-pointer rounded-lg", [l.value, s.value ? "ring-blue-500" : "border border-gray-200 ring-transparent"]])
|
|
296
296
|
}, [
|
|
@@ -301,10 +301,10 @@ const IconCheck = /* @__PURE__ */ _export_sfc(_sfc_main$z, [["render", _sfc_rend
|
|
|
301
301
|
value: e.value,
|
|
302
302
|
"onUpdate:modelValue": u[0] || (u[0] = (c) => r.value = c),
|
|
303
303
|
disabled: e.disabled
|
|
304
|
-
}, null, 8, _hoisted_1$
|
|
304
|
+
}, null, 8, _hoisted_1$t), [
|
|
305
305
|
[vModelCheckbox, r.value]
|
|
306
306
|
]),
|
|
307
|
-
createElementVNode("span", _hoisted_2$
|
|
307
|
+
createElementVNode("span", _hoisted_2$9, [
|
|
308
308
|
e.icon || e.imgUrl ? (openBlock(), createElementBlock("span", _hoisted_3$3, [
|
|
309
309
|
e.icon ? (openBlock(), createElementBlock("i", {
|
|
310
310
|
key: 0,
|
|
@@ -325,9 +325,9 @@ const IconCheck = /* @__PURE__ */ _export_sfc(_sfc_main$z, [["render", _sfc_rend
|
|
|
325
325
|
], 2));
|
|
326
326
|
}
|
|
327
327
|
}), VsCheckboxViews = {
|
|
328
|
-
"vs-checkbox-default": _sfc_main$
|
|
329
|
-
"vs-checkbox-buttons": _sfc_main$
|
|
330
|
-
}, _hoisted_1$
|
|
328
|
+
"vs-checkbox-default": _sfc_main$z,
|
|
329
|
+
"vs-checkbox-buttons": _sfc_main$y
|
|
330
|
+
}, _hoisted_1$s = { class: "flex items-center" }, _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
331
331
|
__name: "vs-input-checkbox-item",
|
|
332
332
|
props: {
|
|
333
333
|
value: { type: [String, Number], default: "" },
|
|
@@ -347,17 +347,17 @@ const IconCheck = /* @__PURE__ */ _export_sfc(_sfc_main$z, [["render", _sfc_rend
|
|
|
347
347
|
},
|
|
348
348
|
emits: ["update:modelValue"],
|
|
349
349
|
setup(e, { emit: t }) {
|
|
350
|
-
const
|
|
351
|
-
get: () => Array.isArray(
|
|
350
|
+
const o = e, n = t, r = `radio-${Math.floor(Math.random() * 1e4)}`, s = computed({
|
|
351
|
+
get: () => Array.isArray(o.modelValue) ? Array.isArray(o.modelValue) && o.modelValue.includes(o.value) : o.modelValue,
|
|
352
352
|
set: (i) => {
|
|
353
|
-
if (Array.isArray(
|
|
354
|
-
let u = [...
|
|
355
|
-
i ? u.includes(
|
|
353
|
+
if (Array.isArray(o.modelValue)) {
|
|
354
|
+
let u = [...o.modelValue];
|
|
355
|
+
i ? u.includes(o.value) || u.push(o.value) : u = u.filter((c) => c !== o.value), n("update:modelValue", u);
|
|
356
356
|
} else
|
|
357
|
-
|
|
357
|
+
n("update:modelValue", i);
|
|
358
358
|
}
|
|
359
|
-
}), l = ref(`vs-checkbox-${
|
|
360
|
-
return (i, u) => (openBlock(), createElementBlock("div", _hoisted_1$
|
|
359
|
+
}), l = ref(`vs-checkbox-${o.view || "default"}`);
|
|
360
|
+
return (i, u) => (openBlock(), createElementBlock("div", _hoisted_1$s, [
|
|
361
361
|
(openBlock(), createBlock(resolveDynamicComponent(unref(VsCheckboxViews)?.[l.value]), {
|
|
362
362
|
value: e.value,
|
|
363
363
|
label: e.label,
|
|
@@ -378,7 +378,7 @@ const IconCheck = /* @__PURE__ */ _export_sfc(_sfc_main$z, [["render", _sfc_rend
|
|
|
378
378
|
}, 8, ["value", "label", "info", "disabled", "modelValue", "icon", "imgUrl", "style", "error"]))
|
|
379
379
|
]));
|
|
380
380
|
}
|
|
381
|
-
}), _sfc_main$
|
|
381
|
+
}), _sfc_main$w = {}, _hoisted_1$r = {
|
|
382
382
|
xmlns: "http://www.w3.org/2000/svg",
|
|
383
383
|
viewBox: "0 0 24 24",
|
|
384
384
|
fill: "none",
|
|
@@ -389,7 +389,7 @@ const IconCheck = /* @__PURE__ */ _export_sfc(_sfc_main$z, [["render", _sfc_rend
|
|
|
389
389
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-chevron-down"
|
|
390
390
|
};
|
|
391
391
|
function _sfc_render$c(e, t) {
|
|
392
|
-
return openBlock(), createElementBlock("svg", _hoisted_1$
|
|
392
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$r, t[0] || (t[0] = [
|
|
393
393
|
createElementVNode("path", {
|
|
394
394
|
stroke: "none",
|
|
395
395
|
d: "M0 0h24v24H0z",
|
|
@@ -398,7 +398,7 @@ function _sfc_render$c(e, t) {
|
|
|
398
398
|
createElementVNode("path", { d: "M6 9l6 6l6 -6" }, null, -1)
|
|
399
399
|
]));
|
|
400
400
|
}
|
|
401
|
-
const IconChevronDown = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
401
|
+
const IconChevronDown = /* @__PURE__ */ _export_sfc(_sfc_main$w, [["render", _sfc_render$c]]), _sfc_main$v = {}, _hoisted_1$q = {
|
|
402
402
|
xmlns: "http://www.w3.org/2000/svg",
|
|
403
403
|
viewBox: "0 0 24 24",
|
|
404
404
|
fill: "none",
|
|
@@ -408,12 +408,12 @@ const IconChevronDown = /* @__PURE__ */ _export_sfc(_sfc_main$v, [["render", _sf
|
|
|
408
408
|
"stroke-linejoin": "round"
|
|
409
409
|
};
|
|
410
410
|
function _sfc_render$b(e, t) {
|
|
411
|
-
return openBlock(), createElementBlock("svg", _hoisted_1$
|
|
411
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$q, t[0] || (t[0] = [
|
|
412
412
|
createElementVNode("path", { d: "m7 15 5 5 5-5" }, null, -1),
|
|
413
413
|
createElementVNode("path", { d: "m7 9 5-5 5 5" }, null, -1)
|
|
414
414
|
]));
|
|
415
415
|
}
|
|
416
|
-
const IconChevronTopBottom = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
416
|
+
const IconChevronTopBottom = /* @__PURE__ */ _export_sfc(_sfc_main$v, [["render", _sfc_render$b]]), _sfc_main$u = {}, _hoisted_1$p = {
|
|
417
417
|
xmlns: "http://www.w3.org/2000/svg",
|
|
418
418
|
viewBox: "0 0 24 24",
|
|
419
419
|
fill: "none",
|
|
@@ -424,7 +424,7 @@ const IconChevronTopBottom = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["render"
|
|
|
424
424
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-x"
|
|
425
425
|
};
|
|
426
426
|
function _sfc_render$a(e, t) {
|
|
427
|
-
return openBlock(), createElementBlock("svg", _hoisted_1$
|
|
427
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$p, t[0] || (t[0] = [
|
|
428
428
|
createElementVNode("path", {
|
|
429
429
|
stroke: "none",
|
|
430
430
|
d: "M0 0h24v24H0z",
|
|
@@ -434,7 +434,7 @@ function _sfc_render$a(e, t) {
|
|
|
434
434
|
createElementVNode("path", { d: "M6 6l12 12" }, null, -1)
|
|
435
435
|
]));
|
|
436
436
|
}
|
|
437
|
-
const IconClose = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
437
|
+
const IconClose = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["render", _sfc_render$a]]), _sfc_main$t = {}, _hoisted_1$o = {
|
|
438
438
|
xmlns: "http://www.w3.org/2000/svg",
|
|
439
439
|
width: "24",
|
|
440
440
|
height: "24",
|
|
@@ -446,7 +446,7 @@ const IconClose = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["render", _sfc_rend
|
|
|
446
446
|
"stroke-linejoin": "round"
|
|
447
447
|
};
|
|
448
448
|
function _sfc_render$9(e, t) {
|
|
449
|
-
return openBlock(), createElementBlock("svg", _hoisted_1$
|
|
449
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$o, t[0] || (t[0] = [
|
|
450
450
|
createElementVNode("path", {
|
|
451
451
|
stroke: "none",
|
|
452
452
|
d: "M0 0h24v24H0z",
|
|
@@ -457,13 +457,13 @@ function _sfc_render$9(e, t) {
|
|
|
457
457
|
createElementVNode("path", { d: "M12 3c7.2 0 9 1.8 9 9s-1.8 9 -9 9s-9 -1.8 -9 -9s1.8 -9 9 -9z" }, null, -1)
|
|
458
458
|
]));
|
|
459
459
|
}
|
|
460
|
-
const IconInfo = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
460
|
+
const IconInfo = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["render", _sfc_render$9]]), _hoisted_1$n = {
|
|
461
461
|
key: 0,
|
|
462
462
|
class: "flex items-start gap-x-1"
|
|
463
|
-
}, _hoisted_2$
|
|
463
|
+
}, _hoisted_2$8 = {
|
|
464
464
|
key: 0,
|
|
465
465
|
class: "text-red-500 text-[14px]"
|
|
466
|
-
}, _hoisted_3$2 = ["title"], _hoisted_4$1 = ["disabled"], _sfc_main$
|
|
466
|
+
}, _hoisted_3$2 = ["title"], _hoisted_4$1 = ["disabled"], _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
467
467
|
__name: "vs-input-switcher",
|
|
468
468
|
props: /* @__PURE__ */ mergeModels({
|
|
469
469
|
view: {
|
|
@@ -509,19 +509,19 @@ const IconInfo = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["render", _sfc_rende
|
|
|
509
509
|
emits: ["update:modelValue"],
|
|
510
510
|
setup(e) {
|
|
511
511
|
const t = useModel(e, "modelValue");
|
|
512
|
-
return (
|
|
513
|
-
createVNode(_sfc_main$
|
|
512
|
+
return (o, n) => e.view === "checkbox" ? (openBlock(), createElementBlock("div", _hoisted_1$n, [
|
|
513
|
+
createVNode(_sfc_main$x, {
|
|
514
514
|
modelValue: t.value,
|
|
515
|
-
"onUpdate:modelValue":
|
|
515
|
+
"onUpdate:modelValue": n[0] || (n[0] = (r) => t.value = r),
|
|
516
516
|
label: e.text,
|
|
517
517
|
error: e.error
|
|
518
518
|
}, null, 8, ["modelValue", "label", "error"]),
|
|
519
|
-
e.rules?.includes("required") ? (openBlock(), createElementBlock("span", _hoisted_2$
|
|
519
|
+
e.rules?.includes("required") ? (openBlock(), createElementBlock("span", _hoisted_2$8, "*")) : createCommentVNode("", !0),
|
|
520
520
|
e.i ? (openBlock(), createElementBlock("button", {
|
|
521
521
|
key: 1,
|
|
522
522
|
class: "cursor-pointer",
|
|
523
523
|
title: e.i,
|
|
524
|
-
onClick:
|
|
524
|
+
onClick: n[1] || (n[1] = withModifiers(() => {
|
|
525
525
|
}, ["prevent"]))
|
|
526
526
|
}, [
|
|
527
527
|
createVNode(unref(IconInfo), { class: "text-gray-500 w-[14px] h-[14px]" })
|
|
@@ -529,9 +529,9 @@ const IconInfo = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["render", _sfc_rende
|
|
|
529
529
|
])) : (openBlock(), createElementBlock("button", {
|
|
530
530
|
key: 1,
|
|
531
531
|
type: "button",
|
|
532
|
-
class: normalizeClass(["inline-flex h-5 w-9 shrink-0 px-[2px] cursor-pointer items-center rounded-full shadow-sm disabled:cursor-not-allowed disabled:opacity-50", [`bg-${e.style?.primaryColor || "blue"}-500
|
|
532
|
+
class: normalizeClass(["inline-flex h-5 w-9 shrink-0 px-[2px] cursor-pointer items-center rounded-full shadow-sm disabled:cursor-not-allowed disabled:opacity-50", [t.value ? `bg-${e.style?.primaryColor || "blue"}-500` : "bg-stone-200", e.customClass]]),
|
|
533
533
|
disabled: e.disabled,
|
|
534
|
-
onClick:
|
|
534
|
+
onClick: n[2] || (n[2] = (r) => t.value = !t.value)
|
|
535
535
|
}, [
|
|
536
536
|
createElementVNode("span", {
|
|
537
537
|
"data-state": "checked",
|
|
@@ -539,25 +539,29 @@ const IconInfo = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["render", _sfc_rende
|
|
|
539
539
|
}, null, 2)
|
|
540
540
|
], 10, _hoisted_4$1));
|
|
541
541
|
}
|
|
542
|
-
}), _hoisted_1$
|
|
542
|
+
}), _hoisted_1$m = ["innerHTML"], _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
543
543
|
__name: "vs-input-static",
|
|
544
544
|
props: {
|
|
545
545
|
html: {
|
|
546
546
|
type: String,
|
|
547
547
|
default: ""
|
|
548
548
|
},
|
|
549
|
+
text: {
|
|
550
|
+
type: String,
|
|
551
|
+
default: ""
|
|
552
|
+
},
|
|
549
553
|
customClass: {
|
|
550
554
|
type: String,
|
|
551
555
|
default: ""
|
|
552
556
|
}
|
|
553
557
|
},
|
|
554
558
|
setup(e) {
|
|
555
|
-
return (t,
|
|
559
|
+
return (t, o) => (openBlock(), createElementBlock("div", {
|
|
556
560
|
class: normalizeClass(e.customClass),
|
|
557
|
-
innerHTML: e.html
|
|
558
|
-
}, null, 10, _hoisted_1$
|
|
561
|
+
innerHTML: (e.html === "", e.text)
|
|
562
|
+
}, null, 10, _hoisted_1$m));
|
|
559
563
|
}
|
|
560
|
-
}), _hoisted_1$
|
|
564
|
+
}), _hoisted_1$l = ["placeholder", "disabled"], _sfc_main$q = /* @__PURE__ */ defineComponent({
|
|
561
565
|
__name: "vs-input-mask",
|
|
562
566
|
props: /* @__PURE__ */ mergeModels({
|
|
563
567
|
style: {
|
|
@@ -575,28 +579,86 @@ const IconInfo = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["render", _sfc_rende
|
|
|
575
579
|
disabled: {
|
|
576
580
|
type: Boolean,
|
|
577
581
|
default: !1
|
|
578
|
-
}
|
|
582
|
+
},
|
|
583
|
+
mask: {
|
|
584
|
+
type: String,
|
|
585
|
+
default: ""
|
|
586
|
+
},
|
|
587
|
+
placeholderChar: { type: String, default: "_" }
|
|
579
588
|
}, {
|
|
580
589
|
modelValue: { default: "" },
|
|
581
590
|
modelModifiers: {}
|
|
582
591
|
}),
|
|
583
592
|
emits: ["update:modelValue"],
|
|
584
593
|
setup(e) {
|
|
585
|
-
const t = e, { inputClass:
|
|
586
|
-
|
|
594
|
+
const t = e, { inputClass: o } = useStyle(t.style), n = useModel(e, "modelValue"), r = ref(""), s = {
|
|
595
|
+
9: /\d/,
|
|
596
|
+
A: /[a-zA-Z]/,
|
|
597
|
+
"*": /[a-zA-Z0-9]/
|
|
598
|
+
}, l = computed(() => t.mask.split("")), i = computed(() => l.value.filter((d) => s[d]).length), u = computed({
|
|
599
|
+
get() {
|
|
600
|
+
let d = "", f = 0;
|
|
601
|
+
const m = i.value, p = r.value.slice(0, m);
|
|
602
|
+
for (const g of l.value)
|
|
603
|
+
s[g] ? f < p.length ? (d += p[f], f++) : d += t.placeholderChar : d += g;
|
|
604
|
+
return d;
|
|
605
|
+
},
|
|
606
|
+
set(d) {
|
|
607
|
+
const f = [], m = l.value, p = i.value;
|
|
608
|
+
let g = 0;
|
|
609
|
+
for (let y = 0; y < m.length; y++) {
|
|
610
|
+
const x = m[y];
|
|
611
|
+
if (s[x]) {
|
|
612
|
+
for (; g < d.length; ) {
|
|
613
|
+
const w = d[g];
|
|
614
|
+
if (g++, s[x].test(w)) {
|
|
615
|
+
f.push(w);
|
|
616
|
+
break;
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
if (f.length >= p) break;
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
r.value = f.join(""), n.value = d;
|
|
623
|
+
}
|
|
624
|
+
});
|
|
625
|
+
function c(d) {
|
|
626
|
+
const f = d.target, m = [], p = l.value, g = i.value;
|
|
627
|
+
let y = 0;
|
|
628
|
+
for (let x = 0; x < p.length; x++) {
|
|
629
|
+
const w = p[x];
|
|
630
|
+
if (s[w]) {
|
|
631
|
+
for (; y < f.value.length; ) {
|
|
632
|
+
const E = f.value[y];
|
|
633
|
+
if (y++, s[w].test(E)) {
|
|
634
|
+
m.push(E);
|
|
635
|
+
break;
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
if (m.length >= g) break;
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
r.value = m.join(""), console.log(r.value), n.value = u.value;
|
|
642
|
+
}
|
|
643
|
+
function a(d) {
|
|
644
|
+
d.key === "Backspace" && (d.preventDefault(), r.value = r.value.slice(0, -1), n.value = u.value);
|
|
645
|
+
}
|
|
646
|
+
return (d, f) => withDirectives((openBlock(), createElementBlock("input", {
|
|
587
647
|
type: "text",
|
|
588
|
-
"onUpdate:modelValue":
|
|
648
|
+
"onUpdate:modelValue": f[0] || (f[0] = (m) => u.value = m),
|
|
589
649
|
placeholder: e.placeholder,
|
|
590
650
|
disabled: e.disabled,
|
|
591
|
-
class: normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f]", [unref(
|
|
651
|
+
class: normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f]", [unref(o)]]),
|
|
592
652
|
style: {
|
|
593
653
|
border: "1px solid #CFD9E0"
|
|
594
|
-
}
|
|
595
|
-
|
|
596
|
-
|
|
654
|
+
},
|
|
655
|
+
onInput: c,
|
|
656
|
+
onKeydown: a
|
|
657
|
+
}, null, 42, _hoisted_1$l)), [
|
|
658
|
+
[vModelText, u.value]
|
|
597
659
|
]);
|
|
598
660
|
}
|
|
599
|
-
}), _hoisted_1$
|
|
661
|
+
}), _hoisted_1$k = ["innerHTML"], _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
600
662
|
__name: "vs-input-html",
|
|
601
663
|
props: {
|
|
602
664
|
text: {
|
|
@@ -606,10 +668,56 @@ const IconInfo = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["render", _sfc_rende
|
|
|
606
668
|
},
|
|
607
669
|
setup(e) {
|
|
608
670
|
const t = e;
|
|
609
|
-
return (
|
|
671
|
+
return (o, n) => (openBlock(), createElementBlock("div", null, [
|
|
610
672
|
createElementVNode("div", {
|
|
611
673
|
innerHTML: t?.text
|
|
612
|
-
}, null, 8, _hoisted_1$
|
|
674
|
+
}, null, 8, _hoisted_1$k)
|
|
675
|
+
]));
|
|
676
|
+
}
|
|
677
|
+
}), _hoisted_1$j = { class: "relative w-full bg-white rounded-lg" }, _hoisted_2$7 = ["placeholder", "disabled"], _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
678
|
+
__name: "vs-input-email",
|
|
679
|
+
props: /* @__PURE__ */ mergeModels({
|
|
680
|
+
style: {
|
|
681
|
+
type: Object,
|
|
682
|
+
default: () => ({})
|
|
683
|
+
},
|
|
684
|
+
customClass: {
|
|
685
|
+
type: String,
|
|
686
|
+
default: ""
|
|
687
|
+
},
|
|
688
|
+
placeholder: {
|
|
689
|
+
type: String,
|
|
690
|
+
default: ""
|
|
691
|
+
},
|
|
692
|
+
disabled: {
|
|
693
|
+
type: Boolean,
|
|
694
|
+
default: !1
|
|
695
|
+
},
|
|
696
|
+
error: {
|
|
697
|
+
type: String,
|
|
698
|
+
default: null
|
|
699
|
+
}
|
|
700
|
+
}, {
|
|
701
|
+
modelValue: { default: "" },
|
|
702
|
+
modelModifiers: {}
|
|
703
|
+
}),
|
|
704
|
+
emits: ["update:modelValue"],
|
|
705
|
+
setup(e) {
|
|
706
|
+
const t = e, { inputClass: o } = useStyle(t.style), n = useModel(e, "modelValue");
|
|
707
|
+
return (r, s) => (openBlock(), createElementBlock("div", _hoisted_1$j, [
|
|
708
|
+
s[1] || (s[1] = createStaticVNode('<div class="absolute bottom-2/4 translate-y-2/4 left-[10px] cursor-pointer"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="stroke-gray-500 transition-all"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M3 7a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v10a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-10z"></path><path d="M3 7l9 6l9 -6"></path></svg></div>', 1)),
|
|
709
|
+
withDirectives(createElementVNode("input", {
|
|
710
|
+
type: "email",
|
|
711
|
+
"onUpdate:modelValue": s[0] || (s[0] = (l) => n.value = l),
|
|
712
|
+
placeholder: e.placeholder,
|
|
713
|
+
disabled: e.disabled,
|
|
714
|
+
class: normalizeClass(["!pl-8 py-1.5 px-3 block w-full placeholder:text[#767f8f]", [unref(o), { "!border-red-600": e.error }]]),
|
|
715
|
+
style: {
|
|
716
|
+
border: "1px solid #CFD9E0"
|
|
717
|
+
}
|
|
718
|
+
}, null, 10, _hoisted_2$7), [
|
|
719
|
+
[vModelText, n.value]
|
|
720
|
+
])
|
|
613
721
|
]));
|
|
614
722
|
}
|
|
615
723
|
}), _hoisted_1$i = ["value", "disabled"], _hoisted_2$6 = { class: "text-[13px] text-gray-700" }, _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
@@ -642,11 +750,11 @@ const IconInfo = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["render", _sfc_rende
|
|
|
642
750
|
emits: ["update:modelValue"],
|
|
643
751
|
setup(e) {
|
|
644
752
|
const t = useModel(e, "modelValue");
|
|
645
|
-
return (
|
|
753
|
+
return (o, n) => (openBlock(), createElementBlock("label", {
|
|
646
754
|
class: normalizeClass(["flex items-center gap-0", [e.customClass]])
|
|
647
755
|
}, [
|
|
648
756
|
withDirectives(createElementVNode("input", {
|
|
649
|
-
"onUpdate:modelValue":
|
|
757
|
+
"onUpdate:modelValue": n[0] || (n[0] = (r) => t.value = r),
|
|
650
758
|
type: "radio",
|
|
651
759
|
value: e.value,
|
|
652
760
|
disabled: e.disabled,
|
|
@@ -698,14 +806,14 @@ const IconInfo = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["render", _sfc_rende
|
|
|
698
806
|
emits: ["update:modelValue"],
|
|
699
807
|
setup(e) {
|
|
700
808
|
const t = useModel(e, "modelValue");
|
|
701
|
-
return (
|
|
809
|
+
return (o, n) => (openBlock(), createElementBlock("label", {
|
|
702
810
|
class: normalizeClass(["flex items-center border rounded-lg px-2 py-1", [
|
|
703
811
|
t.value == e.value ? `ring-2 ring-ring ring-${e.style?.primaryColor || "blue"}-500` : "",
|
|
704
812
|
e.customClass
|
|
705
813
|
]])
|
|
706
814
|
}, [
|
|
707
815
|
withDirectives(createElementVNode("input", {
|
|
708
|
-
"onUpdate:modelValue":
|
|
816
|
+
"onUpdate:modelValue": n[0] || (n[0] = (r) => t.value = r),
|
|
709
817
|
type: "radio",
|
|
710
818
|
value: e.value,
|
|
711
819
|
disabled: e.disabled,
|
|
@@ -740,17 +848,17 @@ const IconInfo = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["render", _sfc_rende
|
|
|
740
848
|
}),
|
|
741
849
|
emits: ["update:modelValue"],
|
|
742
850
|
setup(e) {
|
|
743
|
-
const t = e,
|
|
851
|
+
const t = e, o = useModel(e, "modelValue"), n = computed(() => layouts[`vs-input-radio-${t.view}`]);
|
|
744
852
|
return (r, s) => (openBlock(), createElementBlock("div", {
|
|
745
853
|
class: normalizeClass([e.position === "horizontal" ? "flex items-center flex-wrap gap-2" : ""])
|
|
746
854
|
}, [
|
|
747
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(e.options, (l) => (openBlock(), createBlock(resolveDynamicComponent(
|
|
855
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(e.options, (l) => (openBlock(), createBlock(resolveDynamicComponent(n.value), mergeProps({
|
|
748
856
|
key: l?.id,
|
|
749
857
|
text: l.text,
|
|
750
858
|
value: l.id.toString(),
|
|
751
|
-
checked:
|
|
752
|
-
modelValue:
|
|
753
|
-
"onUpdate:modelValue": s[0] || (s[0] = (i) =>
|
|
859
|
+
checked: o.value === l.id,
|
|
860
|
+
modelValue: o.value,
|
|
861
|
+
"onUpdate:modelValue": s[0] || (s[0] = (i) => o.value = i)
|
|
754
862
|
}, { ref_for: !0 }, r.$attrs), null, 16, ["text", "value", "checked", "modelValue"]))), 128))
|
|
755
863
|
], 2));
|
|
756
864
|
}
|
|
@@ -761,8 +869,8 @@ function bind(e, t) {
|
|
|
761
869
|
};
|
|
762
870
|
}
|
|
763
871
|
const { toString } = Object.prototype, { getPrototypeOf } = Object, { iterator, toStringTag } = Symbol, kindOf = /* @__PURE__ */ ((e) => (t) => {
|
|
764
|
-
const
|
|
765
|
-
return e[
|
|
872
|
+
const o = toString.call(t);
|
|
873
|
+
return e[o] || (e[o] = o.slice(8, -1).toLowerCase());
|
|
766
874
|
})(/* @__PURE__ */ Object.create(null)), kindOfTest = (e) => (e = e.toLowerCase(), (t) => kindOf(t) === e), typeOfTest = (e) => (t) => typeof t === e, { isArray } = Array, isUndefined = typeOfTest("undefined");
|
|
767
875
|
function isBuffer(e) {
|
|
768
876
|
return e !== null && !isUndefined(e) && e.constructor !== null && !isUndefined(e.constructor) && isFunction(e.constructor.isBuffer) && e.constructor.isBuffer(e);
|
|
@@ -777,146 +885,160 @@ const isString = typeOfTest("string"), isFunction = typeOfTest("function"), isNu
|
|
|
777
885
|
return !1;
|
|
778
886
|
const t = getPrototypeOf(e);
|
|
779
887
|
return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(toStringTag in e) && !(iterator in e);
|
|
888
|
+
}, isEmptyObject = (e) => {
|
|
889
|
+
if (!isObject(e) || isBuffer(e))
|
|
890
|
+
return !1;
|
|
891
|
+
try {
|
|
892
|
+
return Object.keys(e).length === 0 && Object.getPrototypeOf(e) === Object.prototype;
|
|
893
|
+
} catch {
|
|
894
|
+
return !1;
|
|
895
|
+
}
|
|
780
896
|
}, isDate = kindOfTest("Date"), isFile = kindOfTest("File"), isBlob = kindOfTest("Blob"), isFileList = kindOfTest("FileList"), isStream = (e) => isObject(e) && isFunction(e.pipe), isFormData = (e) => {
|
|
781
897
|
let t;
|
|
782
898
|
return e && (typeof FormData == "function" && e instanceof FormData || isFunction(e.append) && ((t = kindOf(e)) === "formdata" || // detect form-data instance
|
|
783
899
|
t === "object" && isFunction(e.toString) && e.toString() === "[object FormData]"));
|
|
784
900
|
}, isURLSearchParams = kindOfTest("URLSearchParams"), [isReadableStream, isRequest, isResponse, isHeaders] = ["ReadableStream", "Request", "Response", "Headers"].map(kindOfTest), trim = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
|
|
785
|
-
function forEach(e, t, { allOwnKeys:
|
|
901
|
+
function forEach(e, t, { allOwnKeys: o = !1 } = {}) {
|
|
786
902
|
if (e === null || typeof e > "u")
|
|
787
903
|
return;
|
|
788
|
-
let
|
|
904
|
+
let n, r;
|
|
789
905
|
if (typeof e != "object" && (e = [e]), isArray(e))
|
|
790
|
-
for (
|
|
791
|
-
t.call(null, e[
|
|
906
|
+
for (n = 0, r = e.length; n < r; n++)
|
|
907
|
+
t.call(null, e[n], n, e);
|
|
792
908
|
else {
|
|
793
|
-
|
|
909
|
+
if (isBuffer(e))
|
|
910
|
+
return;
|
|
911
|
+
const s = o ? Object.getOwnPropertyNames(e) : Object.keys(e), l = s.length;
|
|
794
912
|
let i;
|
|
795
|
-
for (
|
|
796
|
-
i = s[
|
|
913
|
+
for (n = 0; n < l; n++)
|
|
914
|
+
i = s[n], t.call(null, e[i], i, e);
|
|
797
915
|
}
|
|
798
916
|
}
|
|
799
917
|
function findKey(e, t) {
|
|
918
|
+
if (isBuffer(e))
|
|
919
|
+
return null;
|
|
800
920
|
t = t.toLowerCase();
|
|
801
|
-
const
|
|
802
|
-
let
|
|
803
|
-
for (;
|
|
804
|
-
if (r = n
|
|
921
|
+
const o = Object.keys(e);
|
|
922
|
+
let n = o.length, r;
|
|
923
|
+
for (; n-- > 0; )
|
|
924
|
+
if (r = o[n], t === r.toLowerCase())
|
|
805
925
|
return r;
|
|
806
926
|
return null;
|
|
807
927
|
}
|
|
808
928
|
const _global = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, isContextDefined = (e) => !isUndefined(e) && e !== _global;
|
|
809
929
|
function merge() {
|
|
810
|
-
const { caseless: e } = isContextDefined(this) && this || {}, t = {},
|
|
930
|
+
const { caseless: e } = isContextDefined(this) && this || {}, t = {}, o = (n, r) => {
|
|
811
931
|
const s = e && findKey(t, r) || r;
|
|
812
|
-
isPlainObject(t[s]) && isPlainObject(
|
|
932
|
+
isPlainObject(t[s]) && isPlainObject(n) ? t[s] = merge(t[s], n) : isPlainObject(n) ? t[s] = merge({}, n) : isArray(n) ? t[s] = n.slice() : t[s] = n;
|
|
813
933
|
};
|
|
814
|
-
for (let
|
|
815
|
-
arguments[
|
|
934
|
+
for (let n = 0, r = arguments.length; n < r; n++)
|
|
935
|
+
arguments[n] && forEach(arguments[n], o);
|
|
816
936
|
return t;
|
|
817
937
|
}
|
|
818
|
-
const extend = (e, t,
|
|
819
|
-
|
|
820
|
-
}, { allOwnKeys:
|
|
821
|
-
e.prototype = Object.create(t.prototype,
|
|
938
|
+
const extend = (e, t, o, { allOwnKeys: n } = {}) => (forEach(t, (r, s) => {
|
|
939
|
+
o && isFunction(r) ? e[s] = bind(r, o) : e[s] = r;
|
|
940
|
+
}, { allOwnKeys: n }), e), stripBOM = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), inherits = (e, t, o, n) => {
|
|
941
|
+
e.prototype = Object.create(t.prototype, n), e.prototype.constructor = e, Object.defineProperty(e, "super", {
|
|
822
942
|
value: t.prototype
|
|
823
|
-
}),
|
|
824
|
-
}, toFlatObject = (e, t,
|
|
943
|
+
}), o && Object.assign(e.prototype, o);
|
|
944
|
+
}, toFlatObject = (e, t, o, n) => {
|
|
825
945
|
let r, s, l;
|
|
826
946
|
const i = {};
|
|
827
947
|
if (t = t || {}, e == null) return t;
|
|
828
948
|
do {
|
|
829
949
|
for (r = Object.getOwnPropertyNames(e), s = r.length; s-- > 0; )
|
|
830
|
-
l = r[s], (!
|
|
831
|
-
e =
|
|
832
|
-
} while (e && (!
|
|
950
|
+
l = r[s], (!n || n(l, e, t)) && !i[l] && (t[l] = e[l], i[l] = !0);
|
|
951
|
+
e = o !== !1 && getPrototypeOf(e);
|
|
952
|
+
} while (e && (!o || o(e, t)) && e !== Object.prototype);
|
|
833
953
|
return t;
|
|
834
|
-
}, endsWith = (e, t,
|
|
835
|
-
e = String(e), (
|
|
836
|
-
const
|
|
837
|
-
return
|
|
954
|
+
}, endsWith = (e, t, o) => {
|
|
955
|
+
e = String(e), (o === void 0 || o > e.length) && (o = e.length), o -= t.length;
|
|
956
|
+
const n = e.indexOf(t, o);
|
|
957
|
+
return n !== -1 && n === o;
|
|
838
958
|
}, toArray = (e) => {
|
|
839
959
|
if (!e) return null;
|
|
840
960
|
if (isArray(e)) return e;
|
|
841
961
|
let t = e.length;
|
|
842
962
|
if (!isNumber(t)) return null;
|
|
843
|
-
const
|
|
963
|
+
const o = new Array(t);
|
|
844
964
|
for (; t-- > 0; )
|
|
845
|
-
|
|
846
|
-
return
|
|
965
|
+
o[t] = e[t];
|
|
966
|
+
return o;
|
|
847
967
|
}, isTypedArray = /* @__PURE__ */ ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" && getPrototypeOf(Uint8Array)), forEachEntry = (e, t) => {
|
|
848
|
-
const
|
|
968
|
+
const n = (e && e[iterator]).call(e);
|
|
849
969
|
let r;
|
|
850
|
-
for (; (r =
|
|
970
|
+
for (; (r = n.next()) && !r.done; ) {
|
|
851
971
|
const s = r.value;
|
|
852
972
|
t.call(e, s[0], s[1]);
|
|
853
973
|
}
|
|
854
974
|
}, matchAll = (e, t) => {
|
|
855
|
-
let
|
|
856
|
-
const
|
|
857
|
-
for (; (
|
|
858
|
-
|
|
859
|
-
return
|
|
975
|
+
let o;
|
|
976
|
+
const n = [];
|
|
977
|
+
for (; (o = e.exec(t)) !== null; )
|
|
978
|
+
n.push(o);
|
|
979
|
+
return n;
|
|
860
980
|
}, isHTMLForm = kindOfTest("HTMLFormElement"), toCamelCase = (e) => e.toLowerCase().replace(
|
|
861
981
|
/[-_\s]([a-z\d])(\w*)/g,
|
|
862
|
-
function(
|
|
863
|
-
return
|
|
982
|
+
function(o, n, r) {
|
|
983
|
+
return n.toUpperCase() + r;
|
|
864
984
|
}
|
|
865
|
-
), hasOwnProperty = (({ hasOwnProperty: e }) => (t,
|
|
866
|
-
const
|
|
867
|
-
forEach(
|
|
985
|
+
), hasOwnProperty = (({ hasOwnProperty: e }) => (t, o) => e.call(t, o))(Object.prototype), isRegExp = kindOfTest("RegExp"), reduceDescriptors = (e, t) => {
|
|
986
|
+
const o = Object.getOwnPropertyDescriptors(e), n = {};
|
|
987
|
+
forEach(o, (r, s) => {
|
|
868
988
|
let l;
|
|
869
|
-
(l = t(r, s, e)) !== !1 && (
|
|
870
|
-
}), Object.defineProperties(e,
|
|
989
|
+
(l = t(r, s, e)) !== !1 && (n[s] = l || r);
|
|
990
|
+
}), Object.defineProperties(e, n);
|
|
871
991
|
}, freezeMethods = (e) => {
|
|
872
|
-
reduceDescriptors(e, (t,
|
|
873
|
-
if (isFunction(e) && ["arguments", "caller", "callee"].indexOf(
|
|
992
|
+
reduceDescriptors(e, (t, o) => {
|
|
993
|
+
if (isFunction(e) && ["arguments", "caller", "callee"].indexOf(o) !== -1)
|
|
874
994
|
return !1;
|
|
875
|
-
const
|
|
876
|
-
if (isFunction(
|
|
995
|
+
const n = e[o];
|
|
996
|
+
if (isFunction(n)) {
|
|
877
997
|
if (t.enumerable = !1, "writable" in t) {
|
|
878
998
|
t.writable = !1;
|
|
879
999
|
return;
|
|
880
1000
|
}
|
|
881
1001
|
t.set || (t.set = () => {
|
|
882
|
-
throw Error("Can not rewrite read-only method '" +
|
|
1002
|
+
throw Error("Can not rewrite read-only method '" + o + "'");
|
|
883
1003
|
});
|
|
884
1004
|
}
|
|
885
1005
|
});
|
|
886
1006
|
}, toObjectSet = (e, t) => {
|
|
887
|
-
const
|
|
1007
|
+
const o = {}, n = (r) => {
|
|
888
1008
|
r.forEach((s) => {
|
|
889
|
-
|
|
1009
|
+
o[s] = !0;
|
|
890
1010
|
});
|
|
891
1011
|
};
|
|
892
|
-
return isArray(e) ?
|
|
1012
|
+
return isArray(e) ? n(e) : n(String(e).split(t)), o;
|
|
893
1013
|
}, noop = () => {
|
|
894
1014
|
}, toFiniteNumber = (e, t) => e != null && Number.isFinite(e = +e) ? e : t;
|
|
895
1015
|
function isSpecCompliantForm(e) {
|
|
896
1016
|
return !!(e && isFunction(e.append) && e[toStringTag] === "FormData" && e[iterator]);
|
|
897
1017
|
}
|
|
898
1018
|
const toJSONObject = (e) => {
|
|
899
|
-
const t = new Array(10),
|
|
900
|
-
if (isObject(
|
|
901
|
-
if (t.indexOf(
|
|
1019
|
+
const t = new Array(10), o = (n, r) => {
|
|
1020
|
+
if (isObject(n)) {
|
|
1021
|
+
if (t.indexOf(n) >= 0)
|
|
902
1022
|
return;
|
|
903
|
-
if (
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
1023
|
+
if (isBuffer(n))
|
|
1024
|
+
return n;
|
|
1025
|
+
if (!("toJSON" in n)) {
|
|
1026
|
+
t[r] = n;
|
|
1027
|
+
const s = isArray(n) ? [] : {};
|
|
1028
|
+
return forEach(n, (l, i) => {
|
|
1029
|
+
const u = o(l, r + 1);
|
|
908
1030
|
!isUndefined(u) && (s[i] = u);
|
|
909
1031
|
}), t[r] = void 0, s;
|
|
910
1032
|
}
|
|
911
1033
|
}
|
|
912
|
-
return
|
|
1034
|
+
return n;
|
|
913
1035
|
};
|
|
914
|
-
return
|
|
915
|
-
}, isAsyncFn = kindOfTest("AsyncFunction"), isThenable = (e) => e && (isObject(e) || isFunction(e)) && isFunction(e.then) && isFunction(e.catch), _setImmediate = ((e, t) => e ? setImmediate : t ? ((
|
|
916
|
-
r === _global && s ===
|
|
1036
|
+
return o(e, 0);
|
|
1037
|
+
}, isAsyncFn = kindOfTest("AsyncFunction"), isThenable = (e) => e && (isObject(e) || isFunction(e)) && isFunction(e.then) && isFunction(e.catch), _setImmediate = ((e, t) => e ? setImmediate : t ? ((o, n) => (_global.addEventListener("message", ({ source: r, data: s }) => {
|
|
1038
|
+
r === _global && s === o && n.length && n.shift()();
|
|
917
1039
|
}, !1), (r) => {
|
|
918
|
-
|
|
919
|
-
}))(`axios@${Math.random()}`, []) : (
|
|
1040
|
+
n.push(r), _global.postMessage(o, "*");
|
|
1041
|
+
}))(`axios@${Math.random()}`, []) : (o) => setTimeout(o))(
|
|
920
1042
|
typeof setImmediate == "function",
|
|
921
1043
|
isFunction(_global.postMessage)
|
|
922
1044
|
), asap = typeof queueMicrotask < "u" ? queueMicrotask.bind(_global) : typeof process < "u" && process.nextTick || _setImmediate, isIterable = (e) => e != null && isFunction(e[iterator]), utils$1 = {
|
|
@@ -930,6 +1052,7 @@ const toJSONObject = (e) => {
|
|
|
930
1052
|
isBoolean,
|
|
931
1053
|
isObject,
|
|
932
1054
|
isPlainObject,
|
|
1055
|
+
isEmptyObject,
|
|
933
1056
|
isReadableStream,
|
|
934
1057
|
isRequest,
|
|
935
1058
|
isResponse,
|
|
@@ -978,8 +1101,8 @@ const toJSONObject = (e) => {
|
|
|
978
1101
|
asap,
|
|
979
1102
|
isIterable
|
|
980
1103
|
};
|
|
981
|
-
function AxiosError$1(e, t,
|
|
982
|
-
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),
|
|
1104
|
+
function AxiosError$1(e, t, o, n, r) {
|
|
1105
|
+
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), o && (this.config = o), n && (this.request = n), r && (this.response = r, this.status = r.status ? r.status : null);
|
|
983
1106
|
}
|
|
984
1107
|
utils$1.inherits(AxiosError$1, Error, {
|
|
985
1108
|
toJSON: function() {
|
|
@@ -1022,11 +1145,11 @@ const prototype$1 = AxiosError$1.prototype, descriptors = {};
|
|
|
1022
1145
|
});
|
|
1023
1146
|
Object.defineProperties(AxiosError$1, descriptors);
|
|
1024
1147
|
Object.defineProperty(prototype$1, "isAxiosError", { value: !0 });
|
|
1025
|
-
AxiosError$1.from = (e, t,
|
|
1148
|
+
AxiosError$1.from = (e, t, o, n, r, s) => {
|
|
1026
1149
|
const l = Object.create(prototype$1);
|
|
1027
1150
|
return utils$1.toFlatObject(e, l, function(u) {
|
|
1028
1151
|
return u !== Error.prototype;
|
|
1029
|
-
}, (i) => i !== "isAxiosError"), AxiosError$1.call(l, e.message, t,
|
|
1152
|
+
}, (i) => i !== "isAxiosError"), AxiosError$1.call(l, e.message, t, o, n, r), l.cause = e, l.name = e.name, s && Object.assign(l, s), l;
|
|
1030
1153
|
};
|
|
1031
1154
|
const httpAdapter = null;
|
|
1032
1155
|
function isVisitable(e) {
|
|
@@ -1035,10 +1158,10 @@ function isVisitable(e) {
|
|
|
1035
1158
|
function removeBrackets(e) {
|
|
1036
1159
|
return utils$1.endsWith(e, "[]") ? e.slice(0, -2) : e;
|
|
1037
1160
|
}
|
|
1038
|
-
function renderKey(e, t,
|
|
1161
|
+
function renderKey(e, t, o) {
|
|
1039
1162
|
return e ? e.concat(t).map(function(r, s) {
|
|
1040
|
-
return r = removeBrackets(r), !
|
|
1041
|
-
}).join(
|
|
1163
|
+
return r = removeBrackets(r), !o && s ? "[" + r + "]" : r;
|
|
1164
|
+
}).join(o ? "." : "") : t;
|
|
1042
1165
|
}
|
|
1043
1166
|
function isFlatArray(e) {
|
|
1044
1167
|
return utils$1.isArray(e) && !e.some(isVisitable);
|
|
@@ -1046,17 +1169,17 @@ function isFlatArray(e) {
|
|
|
1046
1169
|
const predicates = utils$1.toFlatObject(utils$1, {}, null, function(t) {
|
|
1047
1170
|
return /^is[A-Z]/.test(t);
|
|
1048
1171
|
});
|
|
1049
|
-
function toFormData$1(e, t,
|
|
1172
|
+
function toFormData$1(e, t, o) {
|
|
1050
1173
|
if (!utils$1.isObject(e))
|
|
1051
1174
|
throw new TypeError("target must be an object");
|
|
1052
|
-
t = t || new FormData(),
|
|
1175
|
+
t = t || new FormData(), o = utils$1.toFlatObject(o, {
|
|
1053
1176
|
metaTokens: !0,
|
|
1054
1177
|
dots: !1,
|
|
1055
1178
|
indexes: !1
|
|
1056
|
-
}, !1, function(
|
|
1057
|
-
return !utils$1.isUndefined(
|
|
1179
|
+
}, !1, function(g, y) {
|
|
1180
|
+
return !utils$1.isUndefined(y[g]);
|
|
1058
1181
|
});
|
|
1059
|
-
const
|
|
1182
|
+
const n = o.metaTokens, r = o.visitor || a, s = o.dots, l = o.indexes, u = (o.Blob || typeof Blob < "u" && Blob) && utils$1.isSpecCompliantForm(t);
|
|
1060
1183
|
if (!utils$1.isFunction(r))
|
|
1061
1184
|
throw new TypeError("visitor must be a function");
|
|
1062
1185
|
function c(p) {
|
|
@@ -1069,45 +1192,45 @@ function toFormData$1(e, t, n) {
|
|
|
1069
1192
|
throw new AxiosError$1("Blob is not supported. Use a Buffer instead.");
|
|
1070
1193
|
return utils$1.isArrayBuffer(p) || utils$1.isTypedArray(p) ? u && typeof Blob == "function" ? new Blob([p]) : Buffer.from(p) : p;
|
|
1071
1194
|
}
|
|
1072
|
-
function a(p,
|
|
1195
|
+
function a(p, g, y) {
|
|
1073
1196
|
let x = p;
|
|
1074
|
-
if (p && !
|
|
1075
|
-
if (utils$1.endsWith(
|
|
1076
|
-
|
|
1077
|
-
else if (utils$1.isArray(p) && isFlatArray(p) || (utils$1.isFileList(p) || utils$1.endsWith(
|
|
1078
|
-
return
|
|
1079
|
-
!(utils$1.isUndefined(
|
|
1197
|
+
if (p && !y && typeof p == "object") {
|
|
1198
|
+
if (utils$1.endsWith(g, "{}"))
|
|
1199
|
+
g = n ? g : g.slice(0, -2), p = JSON.stringify(p);
|
|
1200
|
+
else if (utils$1.isArray(p) && isFlatArray(p) || (utils$1.isFileList(p) || utils$1.endsWith(g, "[]")) && (x = utils$1.toArray(p)))
|
|
1201
|
+
return g = removeBrackets(g), x.forEach(function(E, C) {
|
|
1202
|
+
!(utils$1.isUndefined(E) || E === null) && t.append(
|
|
1080
1203
|
// eslint-disable-next-line no-nested-ternary
|
|
1081
|
-
l === !0 ? renderKey([
|
|
1082
|
-
c(
|
|
1204
|
+
l === !0 ? renderKey([g], C, s) : l === null ? g : g + "[]",
|
|
1205
|
+
c(E)
|
|
1083
1206
|
);
|
|
1084
1207
|
}), !1;
|
|
1085
1208
|
}
|
|
1086
|
-
return isVisitable(p) ? !0 : (t.append(renderKey(
|
|
1209
|
+
return isVisitable(p) ? !0 : (t.append(renderKey(y, g, s), c(p)), !1);
|
|
1087
1210
|
}
|
|
1088
1211
|
const d = [], f = Object.assign(predicates, {
|
|
1089
1212
|
defaultVisitor: a,
|
|
1090
1213
|
convertValue: c,
|
|
1091
1214
|
isVisitable
|
|
1092
1215
|
});
|
|
1093
|
-
function
|
|
1216
|
+
function m(p, g) {
|
|
1094
1217
|
if (!utils$1.isUndefined(p)) {
|
|
1095
1218
|
if (d.indexOf(p) !== -1)
|
|
1096
|
-
throw Error("Circular reference detected in " +
|
|
1097
|
-
d.push(p), utils$1.forEach(p, function(x,
|
|
1219
|
+
throw Error("Circular reference detected in " + g.join("."));
|
|
1220
|
+
d.push(p), utils$1.forEach(p, function(x, w) {
|
|
1098
1221
|
(!(utils$1.isUndefined(x) || x === null) && r.call(
|
|
1099
1222
|
t,
|
|
1100
1223
|
x,
|
|
1101
|
-
utils$1.isString(
|
|
1102
|
-
|
|
1224
|
+
utils$1.isString(w) ? w.trim() : w,
|
|
1225
|
+
g,
|
|
1103
1226
|
f
|
|
1104
|
-
)) === !0 &&
|
|
1227
|
+
)) === !0 && m(x, g ? g.concat(w) : [w]);
|
|
1105
1228
|
}), d.pop();
|
|
1106
1229
|
}
|
|
1107
1230
|
}
|
|
1108
1231
|
if (!utils$1.isObject(e))
|
|
1109
1232
|
throw new TypeError("data must be an object");
|
|
1110
|
-
return
|
|
1233
|
+
return m(e), t;
|
|
1111
1234
|
}
|
|
1112
1235
|
function encode$1(e) {
|
|
1113
1236
|
const t = {
|
|
@@ -1119,38 +1242,38 @@ function encode$1(e) {
|
|
|
1119
1242
|
"%20": "+",
|
|
1120
1243
|
"%00": "\0"
|
|
1121
1244
|
};
|
|
1122
|
-
return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g, function(
|
|
1123
|
-
return t[
|
|
1245
|
+
return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g, function(n) {
|
|
1246
|
+
return t[n];
|
|
1124
1247
|
});
|
|
1125
1248
|
}
|
|
1126
1249
|
function AxiosURLSearchParams(e, t) {
|
|
1127
1250
|
this._pairs = [], e && toFormData$1(e, this, t);
|
|
1128
1251
|
}
|
|
1129
1252
|
const prototype = AxiosURLSearchParams.prototype;
|
|
1130
|
-
prototype.append = function(t,
|
|
1131
|
-
this._pairs.push([t,
|
|
1253
|
+
prototype.append = function(t, o) {
|
|
1254
|
+
this._pairs.push([t, o]);
|
|
1132
1255
|
};
|
|
1133
1256
|
prototype.toString = function(t) {
|
|
1134
|
-
const
|
|
1135
|
-
return t.call(this,
|
|
1257
|
+
const o = t ? function(n) {
|
|
1258
|
+
return t.call(this, n, encode$1);
|
|
1136
1259
|
} : encode$1;
|
|
1137
1260
|
return this._pairs.map(function(r) {
|
|
1138
|
-
return
|
|
1261
|
+
return o(r[0]) + "=" + o(r[1]);
|
|
1139
1262
|
}, "").join("&");
|
|
1140
1263
|
};
|
|
1141
1264
|
function encode(e) {
|
|
1142
1265
|
return encodeURIComponent(e).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
|
|
1143
1266
|
}
|
|
1144
|
-
function buildURL(e, t,
|
|
1267
|
+
function buildURL(e, t, o) {
|
|
1145
1268
|
if (!t)
|
|
1146
1269
|
return e;
|
|
1147
|
-
const
|
|
1148
|
-
utils$1.isFunction(
|
|
1149
|
-
serialize:
|
|
1270
|
+
const n = o && o.encode || encode;
|
|
1271
|
+
utils$1.isFunction(o) && (o = {
|
|
1272
|
+
serialize: o
|
|
1150
1273
|
});
|
|
1151
|
-
const r =
|
|
1274
|
+
const r = o && o.serialize;
|
|
1152
1275
|
let s;
|
|
1153
|
-
if (r ? s = r(t,
|
|
1276
|
+
if (r ? s = r(t, o) : s = utils$1.isURLSearchParams(t) ? t.toString() : new AxiosURLSearchParams(t, o).toString(n), s) {
|
|
1154
1277
|
const l = e.indexOf("#");
|
|
1155
1278
|
l !== -1 && (e = e.slice(0, l)), e += (e.indexOf("?") === -1 ? "?" : "&") + s;
|
|
1156
1279
|
}
|
|
@@ -1168,12 +1291,12 @@ class InterceptorManager {
|
|
|
1168
1291
|
*
|
|
1169
1292
|
* @return {Number} An ID used to remove interceptor later
|
|
1170
1293
|
*/
|
|
1171
|
-
use(t,
|
|
1294
|
+
use(t, o, n) {
|
|
1172
1295
|
return this.handlers.push({
|
|
1173
1296
|
fulfilled: t,
|
|
1174
|
-
rejected:
|
|
1175
|
-
synchronous:
|
|
1176
|
-
runWhen:
|
|
1297
|
+
rejected: o,
|
|
1298
|
+
synchronous: n ? n.synchronous : !1,
|
|
1299
|
+
runWhen: n ? n.runWhen : null
|
|
1177
1300
|
}), this.handlers.length - 1;
|
|
1178
1301
|
}
|
|
1179
1302
|
/**
|
|
@@ -1205,8 +1328,8 @@ class InterceptorManager {
|
|
|
1205
1328
|
* @returns {void}
|
|
1206
1329
|
*/
|
|
1207
1330
|
forEach(t) {
|
|
1208
|
-
utils$1.forEach(this.handlers, function(
|
|
1209
|
-
|
|
1331
|
+
utils$1.forEach(this.handlers, function(n) {
|
|
1332
|
+
n !== null && t(n);
|
|
1210
1333
|
});
|
|
1211
1334
|
}
|
|
1212
1335
|
}
|
|
@@ -1235,54 +1358,55 @@ self instanceof WorkerGlobalScope && typeof self.importScripts == "function", or
|
|
|
1235
1358
|
...platform$1
|
|
1236
1359
|
};
|
|
1237
1360
|
function toURLEncodedForm(e, t) {
|
|
1238
|
-
return toFormData$1(e, new platform.classes.URLSearchParams(),
|
|
1239
|
-
visitor: function(
|
|
1240
|
-
return platform.isNode && utils$1.isBuffer(
|
|
1241
|
-
}
|
|
1242
|
-
|
|
1361
|
+
return toFormData$1(e, new platform.classes.URLSearchParams(), {
|
|
1362
|
+
visitor: function(o, n, r, s) {
|
|
1363
|
+
return platform.isNode && utils$1.isBuffer(o) ? (this.append(n, o.toString("base64")), !1) : s.defaultVisitor.apply(this, arguments);
|
|
1364
|
+
},
|
|
1365
|
+
...t
|
|
1366
|
+
});
|
|
1243
1367
|
}
|
|
1244
1368
|
function parsePropPath(e) {
|
|
1245
1369
|
return utils$1.matchAll(/\w+|\[(\w*)]/g, e).map((t) => t[0] === "[]" ? "" : t[1] || t[0]);
|
|
1246
1370
|
}
|
|
1247
1371
|
function arrayToObject(e) {
|
|
1248
|
-
const t = {},
|
|
1249
|
-
let
|
|
1250
|
-
const r =
|
|
1372
|
+
const t = {}, o = Object.keys(e);
|
|
1373
|
+
let n;
|
|
1374
|
+
const r = o.length;
|
|
1251
1375
|
let s;
|
|
1252
|
-
for (
|
|
1253
|
-
s = n
|
|
1376
|
+
for (n = 0; n < r; n++)
|
|
1377
|
+
s = o[n], t[s] = e[s];
|
|
1254
1378
|
return t;
|
|
1255
1379
|
}
|
|
1256
1380
|
function formDataToJSON(e) {
|
|
1257
|
-
function t(
|
|
1258
|
-
let l =
|
|
1381
|
+
function t(o, n, r, s) {
|
|
1382
|
+
let l = o[s++];
|
|
1259
1383
|
if (l === "__proto__") return !0;
|
|
1260
|
-
const i = Number.isFinite(+l), u = s >=
|
|
1261
|
-
return l = !l && utils$1.isArray(r) ? r.length : l, u ? (utils$1.hasOwnProp(r, l) ? r[l] = [r[l],
|
|
1384
|
+
const i = Number.isFinite(+l), u = s >= o.length;
|
|
1385
|
+
return l = !l && utils$1.isArray(r) ? r.length : l, u ? (utils$1.hasOwnProp(r, l) ? r[l] = [r[l], n] : r[l] = n, !i) : ((!r[l] || !utils$1.isObject(r[l])) && (r[l] = []), t(o, n, r[l], s) && utils$1.isArray(r[l]) && (r[l] = arrayToObject(r[l])), !i);
|
|
1262
1386
|
}
|
|
1263
1387
|
if (utils$1.isFormData(e) && utils$1.isFunction(e.entries)) {
|
|
1264
|
-
const
|
|
1265
|
-
return utils$1.forEachEntry(e, (
|
|
1266
|
-
t(parsePropPath(
|
|
1267
|
-
}),
|
|
1388
|
+
const o = {};
|
|
1389
|
+
return utils$1.forEachEntry(e, (n, r) => {
|
|
1390
|
+
t(parsePropPath(n), r, o, 0);
|
|
1391
|
+
}), o;
|
|
1268
1392
|
}
|
|
1269
1393
|
return null;
|
|
1270
1394
|
}
|
|
1271
|
-
function stringifySafely(e, t,
|
|
1395
|
+
function stringifySafely(e, t, o) {
|
|
1272
1396
|
if (utils$1.isString(e))
|
|
1273
1397
|
try {
|
|
1274
1398
|
return (t || JSON.parse)(e), utils$1.trim(e);
|
|
1275
|
-
} catch (
|
|
1276
|
-
if (
|
|
1277
|
-
throw
|
|
1399
|
+
} catch (n) {
|
|
1400
|
+
if (n.name !== "SyntaxError")
|
|
1401
|
+
throw n;
|
|
1278
1402
|
}
|
|
1279
|
-
return (
|
|
1403
|
+
return (o || JSON.stringify)(e);
|
|
1280
1404
|
}
|
|
1281
1405
|
const defaults = {
|
|
1282
1406
|
transitional: transitionalDefaults,
|
|
1283
1407
|
adapter: ["xhr", "http", "fetch"],
|
|
1284
|
-
transformRequest: [function(t,
|
|
1285
|
-
const
|
|
1408
|
+
transformRequest: [function(t, o) {
|
|
1409
|
+
const n = o.getContentType() || "", r = n.indexOf("application/json") > -1, s = utils$1.isObject(t);
|
|
1286
1410
|
if (s && utils$1.isHTMLForm(t) && (t = new FormData(t)), utils$1.isFormData(t))
|
|
1287
1411
|
return r ? JSON.stringify(formDataToJSON(t)) : t;
|
|
1288
1412
|
if (utils$1.isArrayBuffer(t) || utils$1.isBuffer(t) || utils$1.isStream(t) || utils$1.isFile(t) || utils$1.isBlob(t) || utils$1.isReadableStream(t))
|
|
@@ -1290,12 +1414,12 @@ const defaults = {
|
|
|
1290
1414
|
if (utils$1.isArrayBufferView(t))
|
|
1291
1415
|
return t.buffer;
|
|
1292
1416
|
if (utils$1.isURLSearchParams(t))
|
|
1293
|
-
return
|
|
1417
|
+
return o.setContentType("application/x-www-form-urlencoded;charset=utf-8", !1), t.toString();
|
|
1294
1418
|
let i;
|
|
1295
1419
|
if (s) {
|
|
1296
|
-
if (
|
|
1420
|
+
if (n.indexOf("application/x-www-form-urlencoded") > -1)
|
|
1297
1421
|
return toURLEncodedForm(t, this.formSerializer).toString();
|
|
1298
|
-
if ((i = utils$1.isFileList(t)) ||
|
|
1422
|
+
if ((i = utils$1.isFileList(t)) || n.indexOf("multipart/form-data") > -1) {
|
|
1299
1423
|
const u = this.env && this.env.FormData;
|
|
1300
1424
|
return toFormData$1(
|
|
1301
1425
|
i ? { "files[]": t } : t,
|
|
@@ -1304,14 +1428,14 @@ const defaults = {
|
|
|
1304
1428
|
);
|
|
1305
1429
|
}
|
|
1306
1430
|
}
|
|
1307
|
-
return s || r ? (
|
|
1431
|
+
return s || r ? (o.setContentType("application/json", !1), stringifySafely(t)) : t;
|
|
1308
1432
|
}],
|
|
1309
1433
|
transformResponse: [function(t) {
|
|
1310
|
-
const
|
|
1434
|
+
const o = this.transitional || defaults.transitional, n = o && o.forcedJSONParsing, r = this.responseType === "json";
|
|
1311
1435
|
if (utils$1.isResponse(t) || utils$1.isReadableStream(t))
|
|
1312
1436
|
return t;
|
|
1313
|
-
if (t && utils$1.isString(t) && (
|
|
1314
|
-
const l = !(
|
|
1437
|
+
if (t && utils$1.isString(t) && (n && !this.responseType || r)) {
|
|
1438
|
+
const l = !(o && o.silentJSONParsing) && r;
|
|
1315
1439
|
try {
|
|
1316
1440
|
return JSON.parse(t);
|
|
1317
1441
|
} catch (i) {
|
|
@@ -1367,10 +1491,10 @@ const ignoreDuplicateOf = utils$1.toObjectSet([
|
|
|
1367
1491
|
"user-agent"
|
|
1368
1492
|
]), parseHeaders = (e) => {
|
|
1369
1493
|
const t = {};
|
|
1370
|
-
let
|
|
1494
|
+
let o, n, r;
|
|
1371
1495
|
return e && e.split(`
|
|
1372
1496
|
`).forEach(function(l) {
|
|
1373
|
-
r = l.indexOf(":"),
|
|
1497
|
+
r = l.indexOf(":"), o = l.substring(0, r).trim().toLowerCase(), n = l.substring(r + 1).trim(), !(!o || t[o] && ignoreDuplicateOf[o]) && (o === "set-cookie" ? t[o] ? t[o].push(n) : t[o] = [n] : t[o] = t[o] ? t[o] + ", " + n : n);
|
|
1374
1498
|
}), t;
|
|
1375
1499
|
}, $internals = Symbol("internals");
|
|
1376
1500
|
function normalizeHeader(e) {
|
|
@@ -1380,32 +1504,32 @@ function normalizeValue(e) {
|
|
|
1380
1504
|
return e === !1 || e == null ? e : utils$1.isArray(e) ? e.map(normalizeValue) : String(e);
|
|
1381
1505
|
}
|
|
1382
1506
|
function parseTokens(e) {
|
|
1383
|
-
const t = /* @__PURE__ */ Object.create(null),
|
|
1384
|
-
let
|
|
1385
|
-
for (;
|
|
1386
|
-
t[
|
|
1507
|
+
const t = /* @__PURE__ */ Object.create(null), o = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
|
|
1508
|
+
let n;
|
|
1509
|
+
for (; n = o.exec(e); )
|
|
1510
|
+
t[n[1]] = n[2];
|
|
1387
1511
|
return t;
|
|
1388
1512
|
}
|
|
1389
1513
|
const isValidHeaderName = (e) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());
|
|
1390
|
-
function matchHeaderValue(e, t,
|
|
1391
|
-
if (utils$1.isFunction(
|
|
1392
|
-
return
|
|
1393
|
-
if (r && (t =
|
|
1394
|
-
if (utils$1.isString(
|
|
1395
|
-
return t.indexOf(
|
|
1396
|
-
if (utils$1.isRegExp(
|
|
1397
|
-
return
|
|
1514
|
+
function matchHeaderValue(e, t, o, n, r) {
|
|
1515
|
+
if (utils$1.isFunction(n))
|
|
1516
|
+
return n.call(this, t, o);
|
|
1517
|
+
if (r && (t = o), !!utils$1.isString(t)) {
|
|
1518
|
+
if (utils$1.isString(n))
|
|
1519
|
+
return t.indexOf(n) !== -1;
|
|
1520
|
+
if (utils$1.isRegExp(n))
|
|
1521
|
+
return n.test(t);
|
|
1398
1522
|
}
|
|
1399
1523
|
}
|
|
1400
1524
|
function formatHeader(e) {
|
|
1401
|
-
return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (t,
|
|
1525
|
+
return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (t, o, n) => o.toUpperCase() + n);
|
|
1402
1526
|
}
|
|
1403
1527
|
function buildAccessors(e, t) {
|
|
1404
|
-
const
|
|
1405
|
-
["get", "set", "has"].forEach((
|
|
1406
|
-
Object.defineProperty(e,
|
|
1528
|
+
const o = utils$1.toCamelCase(" " + t);
|
|
1529
|
+
["get", "set", "has"].forEach((n) => {
|
|
1530
|
+
Object.defineProperty(e, n + o, {
|
|
1407
1531
|
value: function(r, s, l) {
|
|
1408
|
-
return this[
|
|
1532
|
+
return this[n].call(this, t, r, s, l);
|
|
1409
1533
|
},
|
|
1410
1534
|
configurable: !0
|
|
1411
1535
|
});
|
|
@@ -1415,7 +1539,7 @@ let AxiosHeaders$1 = class {
|
|
|
1415
1539
|
constructor(t) {
|
|
1416
1540
|
t && this.set(t);
|
|
1417
1541
|
}
|
|
1418
|
-
set(t,
|
|
1542
|
+
set(t, o, n) {
|
|
1419
1543
|
const r = this;
|
|
1420
1544
|
function s(i, u, c) {
|
|
1421
1545
|
const a = normalizeHeader(u);
|
|
@@ -1426,9 +1550,9 @@ let AxiosHeaders$1 = class {
|
|
|
1426
1550
|
}
|
|
1427
1551
|
const l = (i, u) => utils$1.forEach(i, (c, a) => s(c, a, u));
|
|
1428
1552
|
if (utils$1.isPlainObject(t) || t instanceof this.constructor)
|
|
1429
|
-
l(t,
|
|
1553
|
+
l(t, o);
|
|
1430
1554
|
else if (utils$1.isString(t) && (t = t.trim()) && !isValidHeaderName(t))
|
|
1431
|
-
l(parseHeaders(t),
|
|
1555
|
+
l(parseHeaders(t), o);
|
|
1432
1556
|
else if (utils$1.isObject(t) && utils$1.isIterable(t)) {
|
|
1433
1557
|
let i = {}, u, c;
|
|
1434
1558
|
for (const a of t) {
|
|
@@ -1436,81 +1560,81 @@ let AxiosHeaders$1 = class {
|
|
|
1436
1560
|
throw TypeError("Object iterator must return a key-value pair");
|
|
1437
1561
|
i[c = a[0]] = (u = i[c]) ? utils$1.isArray(u) ? [...u, a[1]] : [u, a[1]] : a[1];
|
|
1438
1562
|
}
|
|
1439
|
-
l(i,
|
|
1563
|
+
l(i, o);
|
|
1440
1564
|
} else
|
|
1441
|
-
t != null && s(
|
|
1565
|
+
t != null && s(o, t, n);
|
|
1442
1566
|
return this;
|
|
1443
1567
|
}
|
|
1444
|
-
get(t,
|
|
1568
|
+
get(t, o) {
|
|
1445
1569
|
if (t = normalizeHeader(t), t) {
|
|
1446
|
-
const
|
|
1447
|
-
if (
|
|
1448
|
-
const r = this[
|
|
1449
|
-
if (!
|
|
1570
|
+
const n = utils$1.findKey(this, t);
|
|
1571
|
+
if (n) {
|
|
1572
|
+
const r = this[n];
|
|
1573
|
+
if (!o)
|
|
1450
1574
|
return r;
|
|
1451
|
-
if (
|
|
1575
|
+
if (o === !0)
|
|
1452
1576
|
return parseTokens(r);
|
|
1453
|
-
if (utils$1.isFunction(
|
|
1454
|
-
return
|
|
1455
|
-
if (utils$1.isRegExp(
|
|
1456
|
-
return
|
|
1577
|
+
if (utils$1.isFunction(o))
|
|
1578
|
+
return o.call(this, r, n);
|
|
1579
|
+
if (utils$1.isRegExp(o))
|
|
1580
|
+
return o.exec(r);
|
|
1457
1581
|
throw new TypeError("parser must be boolean|regexp|function");
|
|
1458
1582
|
}
|
|
1459
1583
|
}
|
|
1460
1584
|
}
|
|
1461
|
-
has(t,
|
|
1585
|
+
has(t, o) {
|
|
1462
1586
|
if (t = normalizeHeader(t), t) {
|
|
1463
|
-
const
|
|
1464
|
-
return !!(
|
|
1587
|
+
const n = utils$1.findKey(this, t);
|
|
1588
|
+
return !!(n && this[n] !== void 0 && (!o || matchHeaderValue(this, this[n], n, o)));
|
|
1465
1589
|
}
|
|
1466
1590
|
return !1;
|
|
1467
1591
|
}
|
|
1468
|
-
delete(t,
|
|
1469
|
-
const
|
|
1592
|
+
delete(t, o) {
|
|
1593
|
+
const n = this;
|
|
1470
1594
|
let r = !1;
|
|
1471
1595
|
function s(l) {
|
|
1472
1596
|
if (l = normalizeHeader(l), l) {
|
|
1473
|
-
const i = utils$1.findKey(
|
|
1474
|
-
i && (!
|
|
1597
|
+
const i = utils$1.findKey(n, l);
|
|
1598
|
+
i && (!o || matchHeaderValue(n, n[i], i, o)) && (delete n[i], r = !0);
|
|
1475
1599
|
}
|
|
1476
1600
|
}
|
|
1477
1601
|
return utils$1.isArray(t) ? t.forEach(s) : s(t), r;
|
|
1478
1602
|
}
|
|
1479
1603
|
clear(t) {
|
|
1480
|
-
const
|
|
1481
|
-
let
|
|
1482
|
-
for (;
|
|
1483
|
-
const s = n
|
|
1604
|
+
const o = Object.keys(this);
|
|
1605
|
+
let n = o.length, r = !1;
|
|
1606
|
+
for (; n--; ) {
|
|
1607
|
+
const s = o[n];
|
|
1484
1608
|
(!t || matchHeaderValue(this, this[s], s, t, !0)) && (delete this[s], r = !0);
|
|
1485
1609
|
}
|
|
1486
1610
|
return r;
|
|
1487
1611
|
}
|
|
1488
1612
|
normalize(t) {
|
|
1489
|
-
const
|
|
1613
|
+
const o = this, n = {};
|
|
1490
1614
|
return utils$1.forEach(this, (r, s) => {
|
|
1491
|
-
const l = utils$1.findKey(
|
|
1615
|
+
const l = utils$1.findKey(n, s);
|
|
1492
1616
|
if (l) {
|
|
1493
|
-
|
|
1617
|
+
o[l] = normalizeValue(r), delete o[s];
|
|
1494
1618
|
return;
|
|
1495
1619
|
}
|
|
1496
1620
|
const i = t ? formatHeader(s) : String(s).trim();
|
|
1497
|
-
i !== s && delete
|
|
1621
|
+
i !== s && delete o[s], o[i] = normalizeValue(r), n[i] = !0;
|
|
1498
1622
|
}), this;
|
|
1499
1623
|
}
|
|
1500
1624
|
concat(...t) {
|
|
1501
1625
|
return this.constructor.concat(this, ...t);
|
|
1502
1626
|
}
|
|
1503
1627
|
toJSON(t) {
|
|
1504
|
-
const
|
|
1505
|
-
return utils$1.forEach(this, (
|
|
1506
|
-
|
|
1507
|
-
}),
|
|
1628
|
+
const o = /* @__PURE__ */ Object.create(null);
|
|
1629
|
+
return utils$1.forEach(this, (n, r) => {
|
|
1630
|
+
n != null && n !== !1 && (o[r] = t && utils$1.isArray(n) ? n.join(", ") : n);
|
|
1631
|
+
}), o;
|
|
1508
1632
|
}
|
|
1509
1633
|
[Symbol.iterator]() {
|
|
1510
1634
|
return Object.entries(this.toJSON())[Symbol.iterator]();
|
|
1511
1635
|
}
|
|
1512
1636
|
toString() {
|
|
1513
|
-
return Object.entries(this.toJSON()).map(([t,
|
|
1637
|
+
return Object.entries(this.toJSON()).map(([t, o]) => t + ": " + o).join(`
|
|
1514
1638
|
`);
|
|
1515
1639
|
}
|
|
1516
1640
|
getSetCookie() {
|
|
@@ -1522,56 +1646,56 @@ let AxiosHeaders$1 = class {
|
|
|
1522
1646
|
static from(t) {
|
|
1523
1647
|
return t instanceof this ? t : new this(t);
|
|
1524
1648
|
}
|
|
1525
|
-
static concat(t, ...
|
|
1526
|
-
const
|
|
1527
|
-
return
|
|
1649
|
+
static concat(t, ...o) {
|
|
1650
|
+
const n = new this(t);
|
|
1651
|
+
return o.forEach((r) => n.set(r)), n;
|
|
1528
1652
|
}
|
|
1529
1653
|
static accessor(t) {
|
|
1530
|
-
const
|
|
1654
|
+
const n = (this[$internals] = this[$internals] = {
|
|
1531
1655
|
accessors: {}
|
|
1532
1656
|
}).accessors, r = this.prototype;
|
|
1533
1657
|
function s(l) {
|
|
1534
1658
|
const i = normalizeHeader(l);
|
|
1535
|
-
|
|
1659
|
+
n[i] || (buildAccessors(r, l), n[i] = !0);
|
|
1536
1660
|
}
|
|
1537
1661
|
return utils$1.isArray(t) ? t.forEach(s) : s(t), this;
|
|
1538
1662
|
}
|
|
1539
1663
|
};
|
|
1540
1664
|
AxiosHeaders$1.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
|
|
1541
1665
|
utils$1.reduceDescriptors(AxiosHeaders$1.prototype, ({ value: e }, t) => {
|
|
1542
|
-
let
|
|
1666
|
+
let o = t[0].toUpperCase() + t.slice(1);
|
|
1543
1667
|
return {
|
|
1544
1668
|
get: () => e,
|
|
1545
|
-
set(
|
|
1546
|
-
this[
|
|
1669
|
+
set(n) {
|
|
1670
|
+
this[o] = n;
|
|
1547
1671
|
}
|
|
1548
1672
|
};
|
|
1549
1673
|
});
|
|
1550
1674
|
utils$1.freezeMethods(AxiosHeaders$1);
|
|
1551
1675
|
function transformData(e, t) {
|
|
1552
|
-
const
|
|
1553
|
-
let s =
|
|
1676
|
+
const o = this || defaults, n = t || o, r = AxiosHeaders$1.from(n.headers);
|
|
1677
|
+
let s = n.data;
|
|
1554
1678
|
return utils$1.forEach(e, function(i) {
|
|
1555
|
-
s = i.call(
|
|
1679
|
+
s = i.call(o, s, r.normalize(), t ? t.status : void 0);
|
|
1556
1680
|
}), r.normalize(), s;
|
|
1557
1681
|
}
|
|
1558
1682
|
function isCancel$1(e) {
|
|
1559
1683
|
return !!(e && e.__CANCEL__);
|
|
1560
1684
|
}
|
|
1561
|
-
function CanceledError$1(e, t,
|
|
1562
|
-
AxiosError$1.call(this, e ?? "canceled", AxiosError$1.ERR_CANCELED, t,
|
|
1685
|
+
function CanceledError$1(e, t, o) {
|
|
1686
|
+
AxiosError$1.call(this, e ?? "canceled", AxiosError$1.ERR_CANCELED, t, o), this.name = "CanceledError";
|
|
1563
1687
|
}
|
|
1564
1688
|
utils$1.inherits(CanceledError$1, AxiosError$1, {
|
|
1565
1689
|
__CANCEL__: !0
|
|
1566
1690
|
});
|
|
1567
|
-
function settle(e, t,
|
|
1568
|
-
const
|
|
1569
|
-
!
|
|
1570
|
-
"Request failed with status code " +
|
|
1571
|
-
[AxiosError$1.ERR_BAD_REQUEST, AxiosError$1.ERR_BAD_RESPONSE][Math.floor(
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1691
|
+
function settle(e, t, o) {
|
|
1692
|
+
const n = o.config.validateStatus;
|
|
1693
|
+
!o.status || !n || n(o.status) ? e(o) : t(new AxiosError$1(
|
|
1694
|
+
"Request failed with status code " + o.status,
|
|
1695
|
+
[AxiosError$1.ERR_BAD_REQUEST, AxiosError$1.ERR_BAD_RESPONSE][Math.floor(o.status / 100) - 4],
|
|
1696
|
+
o.config,
|
|
1697
|
+
o.request,
|
|
1698
|
+
o
|
|
1575
1699
|
));
|
|
1576
1700
|
}
|
|
1577
1701
|
function parseProtocol(e) {
|
|
@@ -1580,38 +1704,38 @@ function parseProtocol(e) {
|
|
|
1580
1704
|
}
|
|
1581
1705
|
function speedometer(e, t) {
|
|
1582
1706
|
e = e || 10;
|
|
1583
|
-
const
|
|
1707
|
+
const o = new Array(e), n = new Array(e);
|
|
1584
1708
|
let r = 0, s = 0, l;
|
|
1585
1709
|
return t = t !== void 0 ? t : 1e3, function(u) {
|
|
1586
|
-
const c = Date.now(), a =
|
|
1587
|
-
l || (l = c),
|
|
1710
|
+
const c = Date.now(), a = n[s];
|
|
1711
|
+
l || (l = c), o[r] = u, n[r] = c;
|
|
1588
1712
|
let d = s, f = 0;
|
|
1589
1713
|
for (; d !== r; )
|
|
1590
|
-
f +=
|
|
1714
|
+
f += o[d++], d = d % e;
|
|
1591
1715
|
if (r = (r + 1) % e, r === s && (s = (s + 1) % e), c - l < t)
|
|
1592
1716
|
return;
|
|
1593
|
-
const
|
|
1594
|
-
return
|
|
1717
|
+
const m = a && c - a;
|
|
1718
|
+
return m ? Math.round(f * 1e3 / m) : void 0;
|
|
1595
1719
|
};
|
|
1596
1720
|
}
|
|
1597
1721
|
function throttle(e, t) {
|
|
1598
|
-
let
|
|
1722
|
+
let o = 0, n = 1e3 / t, r, s;
|
|
1599
1723
|
const l = (c, a = Date.now()) => {
|
|
1600
|
-
|
|
1724
|
+
o = a, r = null, s && (clearTimeout(s), s = null), e(...c);
|
|
1601
1725
|
};
|
|
1602
1726
|
return [(...c) => {
|
|
1603
|
-
const a = Date.now(), d = a -
|
|
1604
|
-
d >=
|
|
1727
|
+
const a = Date.now(), d = a - o;
|
|
1728
|
+
d >= n ? l(c, a) : (r = c, s || (s = setTimeout(() => {
|
|
1605
1729
|
s = null, l(r);
|
|
1606
|
-
},
|
|
1730
|
+
}, n - d)));
|
|
1607
1731
|
}, () => r && l(r)];
|
|
1608
1732
|
}
|
|
1609
|
-
const progressEventReducer = (e, t,
|
|
1610
|
-
let
|
|
1733
|
+
const progressEventReducer = (e, t, o = 3) => {
|
|
1734
|
+
let n = 0;
|
|
1611
1735
|
const r = speedometer(50, 250);
|
|
1612
1736
|
return throttle((s) => {
|
|
1613
|
-
const l = s.loaded, i = s.lengthComputable ? s.total : void 0, u = l -
|
|
1614
|
-
|
|
1737
|
+
const l = s.loaded, i = s.lengthComputable ? s.total : void 0, u = l - n, c = r(u), a = l <= i;
|
|
1738
|
+
n = l;
|
|
1615
1739
|
const d = {
|
|
1616
1740
|
loaded: l,
|
|
1617
1741
|
total: i,
|
|
@@ -1624,23 +1748,23 @@ const progressEventReducer = (e, t, n = 3) => {
|
|
|
1624
1748
|
[t ? "download" : "upload"]: !0
|
|
1625
1749
|
};
|
|
1626
1750
|
e(d);
|
|
1627
|
-
},
|
|
1751
|
+
}, o);
|
|
1628
1752
|
}, progressEventDecorator = (e, t) => {
|
|
1629
|
-
const
|
|
1630
|
-
return [(
|
|
1631
|
-
lengthComputable:
|
|
1753
|
+
const o = e != null;
|
|
1754
|
+
return [(n) => t[0]({
|
|
1755
|
+
lengthComputable: o,
|
|
1632
1756
|
total: e,
|
|
1633
|
-
loaded:
|
|
1757
|
+
loaded: n
|
|
1634
1758
|
}), t[1]];
|
|
1635
|
-
}, asyncDecorator = (e) => (...t) => utils$1.asap(() => e(...t)), isURLSameOrigin = platform.hasStandardBrowserEnv ? /* @__PURE__ */ ((e, t) => (
|
|
1759
|
+
}, asyncDecorator = (e) => (...t) => utils$1.asap(() => e(...t)), isURLSameOrigin = platform.hasStandardBrowserEnv ? /* @__PURE__ */ ((e, t) => (o) => (o = new URL(o, platform.origin), e.protocol === o.protocol && e.host === o.host && (t || e.port === o.port)))(
|
|
1636
1760
|
new URL(platform.origin),
|
|
1637
1761
|
platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent)
|
|
1638
1762
|
) : () => !0, cookies = platform.hasStandardBrowserEnv ? (
|
|
1639
1763
|
// Standard browser envs support document.cookie
|
|
1640
1764
|
{
|
|
1641
|
-
write(e, t,
|
|
1765
|
+
write(e, t, o, n, r, s) {
|
|
1642
1766
|
const l = [e + "=" + encodeURIComponent(t)];
|
|
1643
|
-
utils$1.isNumber(
|
|
1767
|
+
utils$1.isNumber(o) && l.push("expires=" + new Date(o).toGMTString()), utils$1.isString(n) && l.push("path=" + n), utils$1.isString(r) && l.push("domain=" + r), s === !0 && l.push("secure"), document.cookie = l.join("; ");
|
|
1644
1768
|
},
|
|
1645
1769
|
read(e) {
|
|
1646
1770
|
const t = document.cookie.match(new RegExp("(^|;\\s*)(" + e + ")=([^;]*)"));
|
|
@@ -1668,38 +1792,38 @@ function isAbsoluteURL(e) {
|
|
|
1668
1792
|
function combineURLs(e, t) {
|
|
1669
1793
|
return t ? e.replace(/\/?\/$/, "") + "/" + t.replace(/^\/+/, "") : e;
|
|
1670
1794
|
}
|
|
1671
|
-
function buildFullPath(e, t,
|
|
1672
|
-
let
|
|
1673
|
-
return e && (
|
|
1795
|
+
function buildFullPath(e, t, o) {
|
|
1796
|
+
let n = !isAbsoluteURL(t);
|
|
1797
|
+
return e && (n || o == !1) ? combineURLs(e, t) : t;
|
|
1674
1798
|
}
|
|
1675
1799
|
const headersToObject = (e) => e instanceof AxiosHeaders$1 ? { ...e } : e;
|
|
1676
1800
|
function mergeConfig$1(e, t) {
|
|
1677
1801
|
t = t || {};
|
|
1678
|
-
const
|
|
1679
|
-
function
|
|
1802
|
+
const o = {};
|
|
1803
|
+
function n(c, a, d, f) {
|
|
1680
1804
|
return utils$1.isPlainObject(c) && utils$1.isPlainObject(a) ? utils$1.merge.call({ caseless: f }, c, a) : utils$1.isPlainObject(a) ? utils$1.merge({}, a) : utils$1.isArray(a) ? a.slice() : a;
|
|
1681
1805
|
}
|
|
1682
1806
|
function r(c, a, d, f) {
|
|
1683
1807
|
if (utils$1.isUndefined(a)) {
|
|
1684
1808
|
if (!utils$1.isUndefined(c))
|
|
1685
|
-
return
|
|
1686
|
-
} else return
|
|
1809
|
+
return n(void 0, c, d, f);
|
|
1810
|
+
} else return n(c, a, d, f);
|
|
1687
1811
|
}
|
|
1688
1812
|
function s(c, a) {
|
|
1689
1813
|
if (!utils$1.isUndefined(a))
|
|
1690
|
-
return
|
|
1814
|
+
return n(void 0, a);
|
|
1691
1815
|
}
|
|
1692
1816
|
function l(c, a) {
|
|
1693
1817
|
if (utils$1.isUndefined(a)) {
|
|
1694
1818
|
if (!utils$1.isUndefined(c))
|
|
1695
|
-
return
|
|
1696
|
-
} else return
|
|
1819
|
+
return n(void 0, c);
|
|
1820
|
+
} else return n(void 0, a);
|
|
1697
1821
|
}
|
|
1698
1822
|
function i(c, a, d) {
|
|
1699
1823
|
if (d in t)
|
|
1700
|
-
return
|
|
1824
|
+
return n(c, a);
|
|
1701
1825
|
if (d in e)
|
|
1702
|
-
return
|
|
1826
|
+
return n(void 0, c);
|
|
1703
1827
|
}
|
|
1704
1828
|
const u = {
|
|
1705
1829
|
url: s,
|
|
@@ -1732,20 +1856,20 @@ function mergeConfig$1(e, t) {
|
|
|
1732
1856
|
validateStatus: i,
|
|
1733
1857
|
headers: (c, a, d) => r(headersToObject(c), headersToObject(a), d, !0)
|
|
1734
1858
|
};
|
|
1735
|
-
return utils$1.forEach(Object.keys(
|
|
1859
|
+
return utils$1.forEach(Object.keys({ ...e, ...t }), function(a) {
|
|
1736
1860
|
const d = u[a] || r, f = d(e[a], t[a], a);
|
|
1737
|
-
utils$1.isUndefined(f) && d !== i || (
|
|
1738
|
-
}),
|
|
1861
|
+
utils$1.isUndefined(f) && d !== i || (o[a] = f);
|
|
1862
|
+
}), o;
|
|
1739
1863
|
}
|
|
1740
1864
|
const resolveConfig = (e) => {
|
|
1741
1865
|
const t = mergeConfig$1({}, e);
|
|
1742
|
-
let { data:
|
|
1866
|
+
let { data: o, withXSRFToken: n, xsrfHeaderName: r, xsrfCookieName: s, headers: l, auth: i } = t;
|
|
1743
1867
|
t.headers = l = AxiosHeaders$1.from(l), t.url = buildURL(buildFullPath(t.baseURL, t.url, t.allowAbsoluteUrls), e.params, e.paramsSerializer), i && l.set(
|
|
1744
1868
|
"Authorization",
|
|
1745
1869
|
"Basic " + btoa((i.username || "") + ":" + (i.password ? unescape(encodeURIComponent(i.password)) : ""))
|
|
1746
1870
|
);
|
|
1747
1871
|
let u;
|
|
1748
|
-
if (utils$1.isFormData(
|
|
1872
|
+
if (utils$1.isFormData(o)) {
|
|
1749
1873
|
if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv)
|
|
1750
1874
|
l.setContentType(void 0);
|
|
1751
1875
|
else if ((u = l.getContentType()) !== !1) {
|
|
@@ -1753,77 +1877,77 @@ const resolveConfig = (e) => {
|
|
|
1753
1877
|
l.setContentType([c || "multipart/form-data", ...a].join("; "));
|
|
1754
1878
|
}
|
|
1755
1879
|
}
|
|
1756
|
-
if (platform.hasStandardBrowserEnv && (
|
|
1880
|
+
if (platform.hasStandardBrowserEnv && (n && utils$1.isFunction(n) && (n = n(t)), n || n !== !1 && isURLSameOrigin(t.url))) {
|
|
1757
1881
|
const c = r && s && cookies.read(s);
|
|
1758
1882
|
c && l.set(r, c);
|
|
1759
1883
|
}
|
|
1760
1884
|
return t;
|
|
1761
1885
|
}, isXHRAdapterSupported = typeof XMLHttpRequest < "u", xhrAdapter = isXHRAdapterSupported && function(e) {
|
|
1762
|
-
return new Promise(function(
|
|
1886
|
+
return new Promise(function(o, n) {
|
|
1763
1887
|
const r = resolveConfig(e);
|
|
1764
1888
|
let s = r.data;
|
|
1765
1889
|
const l = AxiosHeaders$1.from(r.headers).normalize();
|
|
1766
|
-
let { responseType: i, onUploadProgress: u, onDownloadProgress: c } = r, a, d, f,
|
|
1767
|
-
function
|
|
1768
|
-
|
|
1890
|
+
let { responseType: i, onUploadProgress: u, onDownloadProgress: c } = r, a, d, f, m, p;
|
|
1891
|
+
function g() {
|
|
1892
|
+
m && m(), p && p(), r.cancelToken && r.cancelToken.unsubscribe(a), r.signal && r.signal.removeEventListener("abort", a);
|
|
1769
1893
|
}
|
|
1770
|
-
let
|
|
1771
|
-
|
|
1894
|
+
let y = new XMLHttpRequest();
|
|
1895
|
+
y.open(r.method.toUpperCase(), r.url, !0), y.timeout = r.timeout;
|
|
1772
1896
|
function x() {
|
|
1773
|
-
if (!
|
|
1897
|
+
if (!y)
|
|
1774
1898
|
return;
|
|
1775
|
-
const
|
|
1776
|
-
"getAllResponseHeaders" in
|
|
1777
|
-
),
|
|
1778
|
-
data: !i || i === "text" || i === "json" ?
|
|
1779
|
-
status:
|
|
1780
|
-
statusText:
|
|
1781
|
-
headers:
|
|
1899
|
+
const E = AxiosHeaders$1.from(
|
|
1900
|
+
"getAllResponseHeaders" in y && y.getAllResponseHeaders()
|
|
1901
|
+
), _ = {
|
|
1902
|
+
data: !i || i === "text" || i === "json" ? y.responseText : y.response,
|
|
1903
|
+
status: y.status,
|
|
1904
|
+
statusText: y.statusText,
|
|
1905
|
+
headers: E,
|
|
1782
1906
|
config: e,
|
|
1783
|
-
request:
|
|
1907
|
+
request: y
|
|
1784
1908
|
};
|
|
1785
|
-
settle(function(
|
|
1786
|
-
|
|
1787
|
-
}, function(
|
|
1788
|
-
|
|
1789
|
-
},
|
|
1909
|
+
settle(function(B) {
|
|
1910
|
+
o(B), g();
|
|
1911
|
+
}, function(B) {
|
|
1912
|
+
n(B), g();
|
|
1913
|
+
}, _), y = null;
|
|
1790
1914
|
}
|
|
1791
|
-
"onloadend" in
|
|
1792
|
-
!
|
|
1793
|
-
},
|
|
1794
|
-
|
|
1795
|
-
},
|
|
1796
|
-
|
|
1797
|
-
},
|
|
1798
|
-
let
|
|
1799
|
-
const
|
|
1800
|
-
r.timeoutErrorMessage && (
|
|
1801
|
-
|
|
1802
|
-
|
|
1915
|
+
"onloadend" in y ? y.onloadend = x : y.onreadystatechange = function() {
|
|
1916
|
+
!y || y.readyState !== 4 || y.status === 0 && !(y.responseURL && y.responseURL.indexOf("file:") === 0) || setTimeout(x);
|
|
1917
|
+
}, y.onabort = function() {
|
|
1918
|
+
y && (n(new AxiosError$1("Request aborted", AxiosError$1.ECONNABORTED, e, y)), y = null);
|
|
1919
|
+
}, y.onerror = function() {
|
|
1920
|
+
n(new AxiosError$1("Network Error", AxiosError$1.ERR_NETWORK, e, y)), y = null;
|
|
1921
|
+
}, y.ontimeout = function() {
|
|
1922
|
+
let C = r.timeout ? "timeout of " + r.timeout + "ms exceeded" : "timeout exceeded";
|
|
1923
|
+
const _ = r.transitional || transitionalDefaults;
|
|
1924
|
+
r.timeoutErrorMessage && (C = r.timeoutErrorMessage), n(new AxiosError$1(
|
|
1925
|
+
C,
|
|
1926
|
+
_.clarifyTimeoutError ? AxiosError$1.ETIMEDOUT : AxiosError$1.ECONNABORTED,
|
|
1803
1927
|
e,
|
|
1804
|
-
|
|
1805
|
-
)),
|
|
1806
|
-
}, s === void 0 && l.setContentType(null), "setRequestHeader" in
|
|
1807
|
-
|
|
1808
|
-
}), utils$1.isUndefined(r.withCredentials) || (
|
|
1809
|
-
|
|
1928
|
+
y
|
|
1929
|
+
)), y = null;
|
|
1930
|
+
}, s === void 0 && l.setContentType(null), "setRequestHeader" in y && utils$1.forEach(l.toJSON(), function(C, _) {
|
|
1931
|
+
y.setRequestHeader(_, C);
|
|
1932
|
+
}), utils$1.isUndefined(r.withCredentials) || (y.withCredentials = !!r.withCredentials), i && i !== "json" && (y.responseType = r.responseType), c && ([f, p] = progressEventReducer(c, !0), y.addEventListener("progress", f)), u && y.upload && ([d, m] = progressEventReducer(u), y.upload.addEventListener("progress", d), y.upload.addEventListener("loadend", m)), (r.cancelToken || r.signal) && (a = (E) => {
|
|
1933
|
+
y && (n(!E || E.type ? new CanceledError$1(null, e, y) : E), y.abort(), y = null);
|
|
1810
1934
|
}, r.cancelToken && r.cancelToken.subscribe(a), r.signal && (r.signal.aborted ? a() : r.signal.addEventListener("abort", a)));
|
|
1811
|
-
const
|
|
1812
|
-
if (
|
|
1813
|
-
|
|
1935
|
+
const w = parseProtocol(r.url);
|
|
1936
|
+
if (w && platform.protocols.indexOf(w) === -1) {
|
|
1937
|
+
n(new AxiosError$1("Unsupported protocol " + w + ":", AxiosError$1.ERR_BAD_REQUEST, e));
|
|
1814
1938
|
return;
|
|
1815
1939
|
}
|
|
1816
|
-
|
|
1940
|
+
y.send(s || null);
|
|
1817
1941
|
});
|
|
1818
1942
|
}, composeSignals = (e, t) => {
|
|
1819
|
-
const { length:
|
|
1820
|
-
if (t ||
|
|
1821
|
-
let
|
|
1943
|
+
const { length: o } = e = e ? e.filter(Boolean) : [];
|
|
1944
|
+
if (t || o) {
|
|
1945
|
+
let n = new AbortController(), r;
|
|
1822
1946
|
const s = function(c) {
|
|
1823
1947
|
if (!r) {
|
|
1824
1948
|
r = !0, i();
|
|
1825
1949
|
const a = c instanceof Error ? c : this.reason;
|
|
1826
|
-
|
|
1950
|
+
n.abort(a instanceof AxiosError$1 ? a : new CanceledError$1(a instanceof Error ? a.message : a));
|
|
1827
1951
|
}
|
|
1828
1952
|
};
|
|
1829
1953
|
let l = t && setTimeout(() => {
|
|
@@ -1835,21 +1959,21 @@ const resolveConfig = (e) => {
|
|
|
1835
1959
|
}), e = null);
|
|
1836
1960
|
};
|
|
1837
1961
|
e.forEach((c) => c.addEventListener("abort", s));
|
|
1838
|
-
const { signal: u } =
|
|
1962
|
+
const { signal: u } = n;
|
|
1839
1963
|
return u.unsubscribe = () => utils$1.asap(i), u;
|
|
1840
1964
|
}
|
|
1841
1965
|
}, streamChunk = function* (e, t) {
|
|
1842
|
-
let
|
|
1843
|
-
if (
|
|
1966
|
+
let o = e.byteLength;
|
|
1967
|
+
if (o < t) {
|
|
1844
1968
|
yield e;
|
|
1845
1969
|
return;
|
|
1846
1970
|
}
|
|
1847
|
-
let
|
|
1848
|
-
for (;
|
|
1849
|
-
r =
|
|
1971
|
+
let n = 0, r;
|
|
1972
|
+
for (; n < o; )
|
|
1973
|
+
r = n + t, yield e.slice(n, r), n = r;
|
|
1850
1974
|
}, readBytes = async function* (e, t) {
|
|
1851
|
-
for await (const
|
|
1852
|
-
yield* streamChunk(
|
|
1975
|
+
for await (const o of readStream(e))
|
|
1976
|
+
yield* streamChunk(o, t);
|
|
1853
1977
|
}, readStream = async function* (e) {
|
|
1854
1978
|
if (e[Symbol.asyncIterator]) {
|
|
1855
1979
|
yield* e;
|
|
@@ -1858,18 +1982,18 @@ const resolveConfig = (e) => {
|
|
|
1858
1982
|
const t = e.getReader();
|
|
1859
1983
|
try {
|
|
1860
1984
|
for (; ; ) {
|
|
1861
|
-
const { done:
|
|
1862
|
-
if (
|
|
1985
|
+
const { done: o, value: n } = await t.read();
|
|
1986
|
+
if (o)
|
|
1863
1987
|
break;
|
|
1864
|
-
yield
|
|
1988
|
+
yield n;
|
|
1865
1989
|
}
|
|
1866
1990
|
} finally {
|
|
1867
1991
|
await t.cancel();
|
|
1868
1992
|
}
|
|
1869
|
-
}, trackStream = (e, t,
|
|
1993
|
+
}, trackStream = (e, t, o, n) => {
|
|
1870
1994
|
const r = readBytes(e, t);
|
|
1871
1995
|
let s = 0, l, i = (u) => {
|
|
1872
|
-
l || (l = !0,
|
|
1996
|
+
l || (l = !0, n && n(u));
|
|
1873
1997
|
};
|
|
1874
1998
|
return new ReadableStream({
|
|
1875
1999
|
async pull(u) {
|
|
@@ -1880,9 +2004,9 @@ const resolveConfig = (e) => {
|
|
|
1880
2004
|
return;
|
|
1881
2005
|
}
|
|
1882
2006
|
let d = a.byteLength;
|
|
1883
|
-
if (
|
|
2007
|
+
if (o) {
|
|
1884
2008
|
let f = s += d;
|
|
1885
|
-
|
|
2009
|
+
o(f);
|
|
1886
2010
|
}
|
|
1887
2011
|
u.enqueue(new Uint8Array(a));
|
|
1888
2012
|
} catch (c) {
|
|
@@ -1916,8 +2040,8 @@ const resolveConfig = (e) => {
|
|
|
1916
2040
|
};
|
|
1917
2041
|
isFetchSupported && ((e) => {
|
|
1918
2042
|
["text", "arrayBuffer", "blob", "formData", "stream"].forEach((t) => {
|
|
1919
|
-
!resolvers[t] && (resolvers[t] = utils$1.isFunction(e[t]) ? (
|
|
1920
|
-
throw new AxiosError$1(`Response type '${t}' is not supported`, AxiosError$1.ERR_NOT_SUPPORT,
|
|
2043
|
+
!resolvers[t] && (resolvers[t] = utils$1.isFunction(e[t]) ? (o) => o[t]() : (o, n) => {
|
|
2044
|
+
throw new AxiosError$1(`Response type '${t}' is not supported`, AxiosError$1.ERR_NOT_SUPPORT, n);
|
|
1921
2045
|
});
|
|
1922
2046
|
});
|
|
1923
2047
|
})(new Response());
|
|
@@ -1936,13 +2060,13 @@ const getBodyLength = async (e) => {
|
|
|
1936
2060
|
if (utils$1.isURLSearchParams(e) && (e = e + ""), utils$1.isString(e))
|
|
1937
2061
|
return (await encodeText(e)).byteLength;
|
|
1938
2062
|
}, resolveBodyLength = async (e, t) => {
|
|
1939
|
-
const
|
|
1940
|
-
return
|
|
2063
|
+
const o = utils$1.toFiniteNumber(e.getContentLength());
|
|
2064
|
+
return o ?? getBodyLength(t);
|
|
1941
2065
|
}, fetchAdapter = isFetchSupported && (async (e) => {
|
|
1942
2066
|
let {
|
|
1943
2067
|
url: t,
|
|
1944
|
-
method:
|
|
1945
|
-
data:
|
|
2068
|
+
method: o,
|
|
2069
|
+
data: n,
|
|
1946
2070
|
signal: r,
|
|
1947
2071
|
cancelToken: s,
|
|
1948
2072
|
timeout: l,
|
|
@@ -1954,69 +2078,69 @@ const getBodyLength = async (e) => {
|
|
|
1954
2078
|
fetchOptions: f
|
|
1955
2079
|
} = resolveConfig(e);
|
|
1956
2080
|
c = c ? (c + "").toLowerCase() : "text";
|
|
1957
|
-
let
|
|
1958
|
-
const
|
|
1959
|
-
|
|
2081
|
+
let m = composeSignals([r, s && s.toAbortSignal()], l), p;
|
|
2082
|
+
const g = m && m.unsubscribe && (() => {
|
|
2083
|
+
m.unsubscribe();
|
|
1960
2084
|
});
|
|
1961
|
-
let
|
|
2085
|
+
let y;
|
|
1962
2086
|
try {
|
|
1963
|
-
if (u && supportsRequestStream &&
|
|
1964
|
-
let
|
|
2087
|
+
if (u && supportsRequestStream && o !== "get" && o !== "head" && (y = await resolveBodyLength(a, n)) !== 0) {
|
|
2088
|
+
let _ = new Request(t, {
|
|
1965
2089
|
method: "POST",
|
|
1966
|
-
body:
|
|
2090
|
+
body: n,
|
|
1967
2091
|
duplex: "half"
|
|
1968
|
-
}),
|
|
1969
|
-
if (utils$1.isFormData(
|
|
1970
|
-
const [
|
|
1971
|
-
|
|
2092
|
+
}), S;
|
|
2093
|
+
if (utils$1.isFormData(n) && (S = _.headers.get("content-type")) && a.setContentType(S), _.body) {
|
|
2094
|
+
const [B, V] = progressEventDecorator(
|
|
2095
|
+
y,
|
|
1972
2096
|
progressEventReducer(asyncDecorator(u))
|
|
1973
2097
|
);
|
|
1974
|
-
|
|
2098
|
+
n = trackStream(_.body, DEFAULT_CHUNK_SIZE, B, V);
|
|
1975
2099
|
}
|
|
1976
2100
|
}
|
|
1977
2101
|
utils$1.isString(d) || (d = d ? "include" : "omit");
|
|
1978
2102
|
const x = "credentials" in Request.prototype;
|
|
1979
2103
|
p = new Request(t, {
|
|
1980
2104
|
...f,
|
|
1981
|
-
signal:
|
|
1982
|
-
method:
|
|
2105
|
+
signal: m,
|
|
2106
|
+
method: o.toUpperCase(),
|
|
1983
2107
|
headers: a.normalize().toJSON(),
|
|
1984
|
-
body:
|
|
2108
|
+
body: n,
|
|
1985
2109
|
duplex: "half",
|
|
1986
2110
|
credentials: x ? d : void 0
|
|
1987
2111
|
});
|
|
1988
|
-
let
|
|
1989
|
-
const
|
|
1990
|
-
if (supportsResponseStream && (i ||
|
|
1991
|
-
const
|
|
1992
|
-
["status", "statusText", "headers"].forEach((
|
|
1993
|
-
|
|
2112
|
+
let w = await fetch(p, f);
|
|
2113
|
+
const E = supportsResponseStream && (c === "stream" || c === "response");
|
|
2114
|
+
if (supportsResponseStream && (i || E && g)) {
|
|
2115
|
+
const _ = {};
|
|
2116
|
+
["status", "statusText", "headers"].forEach((A) => {
|
|
2117
|
+
_[A] = w[A];
|
|
1994
2118
|
});
|
|
1995
|
-
const
|
|
1996
|
-
|
|
2119
|
+
const S = utils$1.toFiniteNumber(w.headers.get("content-length")), [B, V] = i && progressEventDecorator(
|
|
2120
|
+
S,
|
|
1997
2121
|
progressEventReducer(asyncDecorator(i), !0)
|
|
1998
2122
|
) || [];
|
|
1999
|
-
|
|
2000
|
-
trackStream(
|
|
2001
|
-
|
|
2123
|
+
w = new Response(
|
|
2124
|
+
trackStream(w.body, DEFAULT_CHUNK_SIZE, B, () => {
|
|
2125
|
+
V && V(), g && g();
|
|
2002
2126
|
}),
|
|
2003
|
-
|
|
2127
|
+
_
|
|
2004
2128
|
);
|
|
2005
2129
|
}
|
|
2006
2130
|
c = c || "text";
|
|
2007
|
-
let
|
|
2008
|
-
return
|
|
2009
|
-
settle(
|
|
2010
|
-
data:
|
|
2011
|
-
headers: AxiosHeaders$1.from(
|
|
2012
|
-
status:
|
|
2013
|
-
statusText:
|
|
2131
|
+
let C = await resolvers[utils$1.findKey(resolvers, c) || "text"](w, e);
|
|
2132
|
+
return !E && g && g(), await new Promise((_, S) => {
|
|
2133
|
+
settle(_, S, {
|
|
2134
|
+
data: C,
|
|
2135
|
+
headers: AxiosHeaders$1.from(w.headers),
|
|
2136
|
+
status: w.status,
|
|
2137
|
+
statusText: w.statusText,
|
|
2014
2138
|
config: e,
|
|
2015
2139
|
request: p
|
|
2016
2140
|
});
|
|
2017
2141
|
});
|
|
2018
2142
|
} catch (x) {
|
|
2019
|
-
throw
|
|
2143
|
+
throw g && g(), x && x.name === "TypeError" && /Load failed|fetch/i.test(x.message) ? Object.assign(
|
|
2020
2144
|
new AxiosError$1("Network Error", AxiosError$1.ERR_NETWORK, e, p),
|
|
2021
2145
|
{
|
|
2022
2146
|
cause: x.cause || x
|
|
@@ -2041,18 +2165,18 @@ const renderReason = (e) => `- ${e}`, isResolvedHandle = (e) => utils$1.isFuncti
|
|
|
2041
2165
|
getAdapter: (e) => {
|
|
2042
2166
|
e = utils$1.isArray(e) ? e : [e];
|
|
2043
2167
|
const { length: t } = e;
|
|
2044
|
-
let
|
|
2168
|
+
let o, n;
|
|
2045
2169
|
const r = {};
|
|
2046
2170
|
for (let s = 0; s < t; s++) {
|
|
2047
|
-
|
|
2171
|
+
o = e[s];
|
|
2048
2172
|
let l;
|
|
2049
|
-
if (
|
|
2173
|
+
if (n = o, !isResolvedHandle(o) && (n = knownAdapters[(l = String(o)).toLowerCase()], n === void 0))
|
|
2050
2174
|
throw new AxiosError$1(`Unknown adapter '${l}'`);
|
|
2051
|
-
if (
|
|
2175
|
+
if (n)
|
|
2052
2176
|
break;
|
|
2053
|
-
r[l || "#" + s] =
|
|
2177
|
+
r[l || "#" + s] = n;
|
|
2054
2178
|
}
|
|
2055
|
-
if (!
|
|
2179
|
+
if (!n) {
|
|
2056
2180
|
const s = Object.entries(r).map(
|
|
2057
2181
|
([i, u]) => `adapter ${i} ` + (u === !1 ? "is not supported by the environment" : "is not available in the build")
|
|
2058
2182
|
);
|
|
@@ -2064,7 +2188,7 @@ const renderReason = (e) => `- ${e}`, isResolvedHandle = (e) => utils$1.isFuncti
|
|
|
2064
2188
|
"ERR_NOT_SUPPORT"
|
|
2065
2189
|
);
|
|
2066
2190
|
}
|
|
2067
|
-
return
|
|
2191
|
+
return n;
|
|
2068
2192
|
},
|
|
2069
2193
|
adapters: knownAdapters
|
|
2070
2194
|
};
|
|
@@ -2076,62 +2200,62 @@ function dispatchRequest(e) {
|
|
|
2076
2200
|
return throwIfCancellationRequested(e), e.headers = AxiosHeaders$1.from(e.headers), e.data = transformData.call(
|
|
2077
2201
|
e,
|
|
2078
2202
|
e.transformRequest
|
|
2079
|
-
), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1), adapters.getAdapter(e.adapter || defaults.adapter)(e).then(function(
|
|
2080
|
-
return throwIfCancellationRequested(e),
|
|
2203
|
+
), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1), adapters.getAdapter(e.adapter || defaults.adapter)(e).then(function(n) {
|
|
2204
|
+
return throwIfCancellationRequested(e), n.data = transformData.call(
|
|
2081
2205
|
e,
|
|
2082
2206
|
e.transformResponse,
|
|
2083
|
-
|
|
2084
|
-
),
|
|
2085
|
-
}, function(
|
|
2086
|
-
return isCancel$1(
|
|
2207
|
+
n
|
|
2208
|
+
), n.headers = AxiosHeaders$1.from(n.headers), n;
|
|
2209
|
+
}, function(n) {
|
|
2210
|
+
return isCancel$1(n) || (throwIfCancellationRequested(e), n && n.response && (n.response.data = transformData.call(
|
|
2087
2211
|
e,
|
|
2088
2212
|
e.transformResponse,
|
|
2089
|
-
|
|
2090
|
-
),
|
|
2213
|
+
n.response
|
|
2214
|
+
), n.response.headers = AxiosHeaders$1.from(n.response.headers))), Promise.reject(n);
|
|
2091
2215
|
});
|
|
2092
2216
|
}
|
|
2093
|
-
const VERSION$1 = "1.
|
|
2217
|
+
const VERSION$1 = "1.11.0", validators$1 = {};
|
|
2094
2218
|
["object", "boolean", "number", "function", "string", "symbol"].forEach((e, t) => {
|
|
2095
|
-
validators$1[e] = function(
|
|
2096
|
-
return typeof
|
|
2219
|
+
validators$1[e] = function(n) {
|
|
2220
|
+
return typeof n === e || "a" + (t < 1 ? "n " : " ") + e;
|
|
2097
2221
|
};
|
|
2098
2222
|
});
|
|
2099
2223
|
const deprecatedWarnings = {};
|
|
2100
|
-
validators$1.transitional = function(t,
|
|
2224
|
+
validators$1.transitional = function(t, o, n) {
|
|
2101
2225
|
function r(s, l) {
|
|
2102
|
-
return "[Axios v" + VERSION$1 + "] Transitional option '" + s + "'" + l + (
|
|
2226
|
+
return "[Axios v" + VERSION$1 + "] Transitional option '" + s + "'" + l + (n ? ". " + n : "");
|
|
2103
2227
|
}
|
|
2104
2228
|
return (s, l, i) => {
|
|
2105
2229
|
if (t === !1)
|
|
2106
2230
|
throw new AxiosError$1(
|
|
2107
|
-
r(l, " has been removed" + (
|
|
2231
|
+
r(l, " has been removed" + (o ? " in " + o : "")),
|
|
2108
2232
|
AxiosError$1.ERR_DEPRECATED
|
|
2109
2233
|
);
|
|
2110
|
-
return
|
|
2234
|
+
return o && !deprecatedWarnings[l] && (deprecatedWarnings[l] = !0, console.warn(
|
|
2111
2235
|
r(
|
|
2112
2236
|
l,
|
|
2113
|
-
" has been deprecated since v" +
|
|
2237
|
+
" has been deprecated since v" + o + " and will be removed in the near future"
|
|
2114
2238
|
)
|
|
2115
2239
|
)), t ? t(s, l, i) : !0;
|
|
2116
2240
|
};
|
|
2117
2241
|
};
|
|
2118
2242
|
validators$1.spelling = function(t) {
|
|
2119
|
-
return (
|
|
2243
|
+
return (o, n) => (console.warn(`${n} is likely a misspelling of ${t}`), !0);
|
|
2120
2244
|
};
|
|
2121
|
-
function assertOptions(e, t,
|
|
2245
|
+
function assertOptions(e, t, o) {
|
|
2122
2246
|
if (typeof e != "object")
|
|
2123
2247
|
throw new AxiosError$1("options must be an object", AxiosError$1.ERR_BAD_OPTION_VALUE);
|
|
2124
|
-
const
|
|
2125
|
-
let r =
|
|
2248
|
+
const n = Object.keys(e);
|
|
2249
|
+
let r = n.length;
|
|
2126
2250
|
for (; r-- > 0; ) {
|
|
2127
|
-
const s =
|
|
2251
|
+
const s = n[r], l = t[s];
|
|
2128
2252
|
if (l) {
|
|
2129
2253
|
const i = e[s], u = i === void 0 || l(i, s, e);
|
|
2130
2254
|
if (u !== !0)
|
|
2131
2255
|
throw new AxiosError$1("option " + s + " must be " + u, AxiosError$1.ERR_BAD_OPTION_VALUE);
|
|
2132
2256
|
continue;
|
|
2133
2257
|
}
|
|
2134
|
-
if (
|
|
2258
|
+
if (o !== !0)
|
|
2135
2259
|
throw new AxiosError$1("Unknown option " + s, AxiosError$1.ERR_BAD_OPTION);
|
|
2136
2260
|
}
|
|
2137
2261
|
}
|
|
@@ -2154,78 +2278,78 @@ let Axios$1 = class {
|
|
|
2154
2278
|
*
|
|
2155
2279
|
* @returns {Promise} The Promise to be fulfilled
|
|
2156
2280
|
*/
|
|
2157
|
-
async request(t,
|
|
2281
|
+
async request(t, o) {
|
|
2158
2282
|
try {
|
|
2159
|
-
return await this._request(t,
|
|
2160
|
-
} catch (
|
|
2161
|
-
if (
|
|
2283
|
+
return await this._request(t, o);
|
|
2284
|
+
} catch (n) {
|
|
2285
|
+
if (n instanceof Error) {
|
|
2162
2286
|
let r = {};
|
|
2163
2287
|
Error.captureStackTrace ? Error.captureStackTrace(r) : r = new Error();
|
|
2164
2288
|
const s = r.stack ? r.stack.replace(/^.+\n/, "") : "";
|
|
2165
2289
|
try {
|
|
2166
|
-
|
|
2167
|
-
` + s) :
|
|
2290
|
+
n.stack ? s && !String(n.stack).endsWith(s.replace(/^.+\n.+\n/, "")) && (n.stack += `
|
|
2291
|
+
` + s) : n.stack = s;
|
|
2168
2292
|
} catch {
|
|
2169
2293
|
}
|
|
2170
2294
|
}
|
|
2171
|
-
throw
|
|
2295
|
+
throw n;
|
|
2172
2296
|
}
|
|
2173
2297
|
}
|
|
2174
|
-
_request(t,
|
|
2175
|
-
typeof t == "string" ? (
|
|
2176
|
-
const { transitional:
|
|
2177
|
-
|
|
2298
|
+
_request(t, o) {
|
|
2299
|
+
typeof t == "string" ? (o = o || {}, o.url = t) : o = t || {}, o = mergeConfig$1(this.defaults, o);
|
|
2300
|
+
const { transitional: n, paramsSerializer: r, headers: s } = o;
|
|
2301
|
+
n !== void 0 && validator.assertOptions(n, {
|
|
2178
2302
|
silentJSONParsing: validators.transitional(validators.boolean),
|
|
2179
2303
|
forcedJSONParsing: validators.transitional(validators.boolean),
|
|
2180
2304
|
clarifyTimeoutError: validators.transitional(validators.boolean)
|
|
2181
|
-
}, !1), r != null && (utils$1.isFunction(r) ?
|
|
2305
|
+
}, !1), r != null && (utils$1.isFunction(r) ? o.paramsSerializer = {
|
|
2182
2306
|
serialize: r
|
|
2183
2307
|
} : validator.assertOptions(r, {
|
|
2184
2308
|
encode: validators.function,
|
|
2185
2309
|
serialize: validators.function
|
|
2186
|
-
}, !0)),
|
|
2310
|
+
}, !0)), o.allowAbsoluteUrls !== void 0 || (this.defaults.allowAbsoluteUrls !== void 0 ? o.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls : o.allowAbsoluteUrls = !0), validator.assertOptions(o, {
|
|
2187
2311
|
baseUrl: validators.spelling("baseURL"),
|
|
2188
2312
|
withXsrfToken: validators.spelling("withXSRFToken")
|
|
2189
|
-
}, !0),
|
|
2313
|
+
}, !0), o.method = (o.method || this.defaults.method || "get").toLowerCase();
|
|
2190
2314
|
let l = s && utils$1.merge(
|
|
2191
2315
|
s.common,
|
|
2192
|
-
s[
|
|
2316
|
+
s[o.method]
|
|
2193
2317
|
);
|
|
2194
2318
|
s && utils$1.forEach(
|
|
2195
2319
|
["delete", "get", "head", "post", "put", "patch", "common"],
|
|
2196
2320
|
(p) => {
|
|
2197
2321
|
delete s[p];
|
|
2198
2322
|
}
|
|
2199
|
-
),
|
|
2323
|
+
), o.headers = AxiosHeaders$1.concat(l, s);
|
|
2200
2324
|
const i = [];
|
|
2201
2325
|
let u = !0;
|
|
2202
|
-
this.interceptors.request.forEach(function(
|
|
2203
|
-
typeof
|
|
2326
|
+
this.interceptors.request.forEach(function(g) {
|
|
2327
|
+
typeof g.runWhen == "function" && g.runWhen(o) === !1 || (u = u && g.synchronous, i.unshift(g.fulfilled, g.rejected));
|
|
2204
2328
|
});
|
|
2205
2329
|
const c = [];
|
|
2206
|
-
this.interceptors.response.forEach(function(
|
|
2207
|
-
c.push(
|
|
2330
|
+
this.interceptors.response.forEach(function(g) {
|
|
2331
|
+
c.push(g.fulfilled, g.rejected);
|
|
2208
2332
|
});
|
|
2209
2333
|
let a, d = 0, f;
|
|
2210
2334
|
if (!u) {
|
|
2211
2335
|
const p = [dispatchRequest.bind(this), void 0];
|
|
2212
|
-
for (p.unshift
|
|
2336
|
+
for (p.unshift(...i), p.push(...c), f = p.length, a = Promise.resolve(o); d < f; )
|
|
2213
2337
|
a = a.then(p[d++], p[d++]);
|
|
2214
2338
|
return a;
|
|
2215
2339
|
}
|
|
2216
2340
|
f = i.length;
|
|
2217
|
-
let
|
|
2341
|
+
let m = o;
|
|
2218
2342
|
for (d = 0; d < f; ) {
|
|
2219
|
-
const p = i[d++],
|
|
2343
|
+
const p = i[d++], g = i[d++];
|
|
2220
2344
|
try {
|
|
2221
|
-
|
|
2222
|
-
} catch (
|
|
2223
|
-
|
|
2345
|
+
m = p(m);
|
|
2346
|
+
} catch (y) {
|
|
2347
|
+
g.call(this, y);
|
|
2224
2348
|
break;
|
|
2225
2349
|
}
|
|
2226
2350
|
}
|
|
2227
2351
|
try {
|
|
2228
|
-
a = dispatchRequest.call(this,
|
|
2352
|
+
a = dispatchRequest.call(this, m);
|
|
2229
2353
|
} catch (p) {
|
|
2230
2354
|
return Promise.reject(p);
|
|
2231
2355
|
}
|
|
@@ -2235,25 +2359,25 @@ let Axios$1 = class {
|
|
|
2235
2359
|
}
|
|
2236
2360
|
getUri(t) {
|
|
2237
2361
|
t = mergeConfig$1(this.defaults, t);
|
|
2238
|
-
const
|
|
2239
|
-
return buildURL(
|
|
2362
|
+
const o = buildFullPath(t.baseURL, t.url, t.allowAbsoluteUrls);
|
|
2363
|
+
return buildURL(o, t.params, t.paramsSerializer);
|
|
2240
2364
|
}
|
|
2241
2365
|
};
|
|
2242
2366
|
utils$1.forEach(["delete", "get", "head", "options"], function(t) {
|
|
2243
|
-
Axios$1.prototype[t] = function(
|
|
2244
|
-
return this.request(mergeConfig$1(
|
|
2367
|
+
Axios$1.prototype[t] = function(o, n) {
|
|
2368
|
+
return this.request(mergeConfig$1(n || {}, {
|
|
2245
2369
|
method: t,
|
|
2246
|
-
url:
|
|
2247
|
-
data: (
|
|
2370
|
+
url: o,
|
|
2371
|
+
data: (n || {}).data
|
|
2248
2372
|
}));
|
|
2249
2373
|
};
|
|
2250
2374
|
});
|
|
2251
2375
|
utils$1.forEach(["post", "put", "patch"], function(t) {
|
|
2252
|
-
function n
|
|
2376
|
+
function o(n) {
|
|
2253
2377
|
return function(s, l, i) {
|
|
2254
2378
|
return this.request(mergeConfig$1(i || {}, {
|
|
2255
2379
|
method: t,
|
|
2256
|
-
headers:
|
|
2380
|
+
headers: n ? {
|
|
2257
2381
|
"Content-Type": "multipart/form-data"
|
|
2258
2382
|
} : {},
|
|
2259
2383
|
url: s,
|
|
@@ -2261,33 +2385,33 @@ utils$1.forEach(["post", "put", "patch"], function(t) {
|
|
|
2261
2385
|
}));
|
|
2262
2386
|
};
|
|
2263
2387
|
}
|
|
2264
|
-
Axios$1.prototype[t] =
|
|
2388
|
+
Axios$1.prototype[t] = o(), Axios$1.prototype[t + "Form"] = o(!0);
|
|
2265
2389
|
});
|
|
2266
|
-
let CancelToken$1 = class
|
|
2390
|
+
let CancelToken$1 = class M {
|
|
2267
2391
|
constructor(t) {
|
|
2268
2392
|
if (typeof t != "function")
|
|
2269
2393
|
throw new TypeError("executor must be a function.");
|
|
2270
|
-
let
|
|
2394
|
+
let o;
|
|
2271
2395
|
this.promise = new Promise(function(s) {
|
|
2272
|
-
|
|
2396
|
+
o = s;
|
|
2273
2397
|
});
|
|
2274
|
-
const
|
|
2398
|
+
const n = this;
|
|
2275
2399
|
this.promise.then((r) => {
|
|
2276
|
-
if (!
|
|
2277
|
-
let s =
|
|
2400
|
+
if (!n._listeners) return;
|
|
2401
|
+
let s = n._listeners.length;
|
|
2278
2402
|
for (; s-- > 0; )
|
|
2279
|
-
|
|
2280
|
-
|
|
2403
|
+
n._listeners[s](r);
|
|
2404
|
+
n._listeners = null;
|
|
2281
2405
|
}), this.promise.then = (r) => {
|
|
2282
2406
|
let s;
|
|
2283
2407
|
const l = new Promise((i) => {
|
|
2284
|
-
|
|
2408
|
+
n.subscribe(i), s = i;
|
|
2285
2409
|
}).then(r);
|
|
2286
2410
|
return l.cancel = function() {
|
|
2287
|
-
|
|
2411
|
+
n.unsubscribe(s);
|
|
2288
2412
|
}, l;
|
|
2289
2413
|
}, t(function(s, l, i) {
|
|
2290
|
-
|
|
2414
|
+
n.reason || (n.reason = new CanceledError$1(s, l, i), o(n.reason));
|
|
2291
2415
|
});
|
|
2292
2416
|
}
|
|
2293
2417
|
/**
|
|
@@ -2313,14 +2437,14 @@ let CancelToken$1 = class R {
|
|
|
2313
2437
|
unsubscribe(t) {
|
|
2314
2438
|
if (!this._listeners)
|
|
2315
2439
|
return;
|
|
2316
|
-
const
|
|
2317
|
-
|
|
2440
|
+
const o = this._listeners.indexOf(t);
|
|
2441
|
+
o !== -1 && this._listeners.splice(o, 1);
|
|
2318
2442
|
}
|
|
2319
2443
|
toAbortSignal() {
|
|
2320
|
-
const t = new AbortController(),
|
|
2321
|
-
t.abort(
|
|
2444
|
+
const t = new AbortController(), o = (n) => {
|
|
2445
|
+
t.abort(n);
|
|
2322
2446
|
};
|
|
2323
|
-
return this.subscribe(
|
|
2447
|
+
return this.subscribe(o), t.signal.unsubscribe = () => this.unsubscribe(o), t.signal;
|
|
2324
2448
|
}
|
|
2325
2449
|
/**
|
|
2326
2450
|
* Returns an object that contains a new `CancelToken` and a function that, when called,
|
|
@@ -2329,7 +2453,7 @@ let CancelToken$1 = class R {
|
|
|
2329
2453
|
static source() {
|
|
2330
2454
|
let t;
|
|
2331
2455
|
return {
|
|
2332
|
-
token: new
|
|
2456
|
+
token: new M(function(r) {
|
|
2333
2457
|
t = r;
|
|
2334
2458
|
}),
|
|
2335
2459
|
cancel: t
|
|
@@ -2337,8 +2461,8 @@ let CancelToken$1 = class R {
|
|
|
2337
2461
|
}
|
|
2338
2462
|
};
|
|
2339
2463
|
function spread$1(e) {
|
|
2340
|
-
return function(
|
|
2341
|
-
return e.apply(null,
|
|
2464
|
+
return function(o) {
|
|
2465
|
+
return e.apply(null, o);
|
|
2342
2466
|
};
|
|
2343
2467
|
}
|
|
2344
2468
|
function isAxiosError$1(e) {
|
|
@@ -2413,10 +2537,10 @@ Object.entries(HttpStatusCode$1).forEach(([e, t]) => {
|
|
|
2413
2537
|
HttpStatusCode$1[t] = e;
|
|
2414
2538
|
});
|
|
2415
2539
|
function createInstance(e) {
|
|
2416
|
-
const t = new Axios$1(e),
|
|
2417
|
-
return utils$1.extend(
|
|
2540
|
+
const t = new Axios$1(e), o = bind(Axios$1.prototype.request, t);
|
|
2541
|
+
return utils$1.extend(o, Axios$1.prototype, t, { allOwnKeys: !0 }), utils$1.extend(o, t, null, { allOwnKeys: !0 }), o.create = function(r) {
|
|
2418
2542
|
return createInstance(mergeConfig$1(e, r));
|
|
2419
|
-
},
|
|
2543
|
+
}, o;
|
|
2420
2544
|
}
|
|
2421
2545
|
const axios = createInstance(defaults);
|
|
2422
2546
|
axios.Axios = Axios$1;
|
|
@@ -2475,16 +2599,16 @@ const {
|
|
|
2475
2599
|
},
|
|
2476
2600
|
emits: ["update:modelValue"],
|
|
2477
2601
|
setup(e, { emit: t }) {
|
|
2478
|
-
const
|
|
2602
|
+
const o = e, n = t, r = ref([]), s = reactive({}), l = (a) => a?.value || a?.id || a?.text || a, i = (a) => a.text || String(a), u = (a) => `lg:col-span-${a || 12}`, c = async () => {
|
|
2479
2603
|
try {
|
|
2480
|
-
const { data: a } = await axios.get(`/api/suggest/${
|
|
2604
|
+
const { data: a } = await axios.get(`/api/suggest/${o.data}`);
|
|
2481
2605
|
r.value = a?.data || a;
|
|
2482
2606
|
} catch (a) {
|
|
2483
2607
|
console.error(a);
|
|
2484
2608
|
}
|
|
2485
2609
|
};
|
|
2486
2610
|
return watch(
|
|
2487
|
-
() =>
|
|
2611
|
+
() => o.modelValue,
|
|
2488
2612
|
(a) => {
|
|
2489
2613
|
if (typeof a == "boolean" && r.value.length === 1) {
|
|
2490
2614
|
const d = l(r.value[0]);
|
|
@@ -2493,8 +2617,8 @@ const {
|
|
|
2493
2617
|
const d = new Set(a);
|
|
2494
2618
|
r.value.forEach((f) => {
|
|
2495
2619
|
if (!f.disabled) {
|
|
2496
|
-
const
|
|
2497
|
-
s[
|
|
2620
|
+
const m = l(f);
|
|
2621
|
+
s[m] = d.has(m);
|
|
2498
2622
|
}
|
|
2499
2623
|
});
|
|
2500
2624
|
}
|
|
@@ -2504,21 +2628,21 @@ const {
|
|
|
2504
2628
|
s,
|
|
2505
2629
|
() => {
|
|
2506
2630
|
if (!r.value.length) {
|
|
2507
|
-
|
|
2631
|
+
n("update:modelValue", null);
|
|
2508
2632
|
return;
|
|
2509
2633
|
}
|
|
2510
2634
|
const a = Object.entries(s).filter(([, d]) => d).map(([d]) => d);
|
|
2511
|
-
|
|
2635
|
+
n("update:modelValue", a.length === 0 ? null : a);
|
|
2512
2636
|
},
|
|
2513
2637
|
{ deep: !0 }
|
|
2514
2638
|
), onMounted(() => {
|
|
2515
|
-
if (
|
|
2639
|
+
if (o.data)
|
|
2516
2640
|
c().then(() => {
|
|
2517
|
-
if (typeof
|
|
2641
|
+
if (typeof o.modelValue == "boolean" && r.value.length === 1) {
|
|
2518
2642
|
const a = l(r.value[0]);
|
|
2519
|
-
s[a] =
|
|
2520
|
-
} else if (Array.isArray(
|
|
2521
|
-
const a = new Set(
|
|
2643
|
+
s[a] = o.modelValue;
|
|
2644
|
+
} else if (Array.isArray(o.modelValue)) {
|
|
2645
|
+
const a = new Set(o.modelValue);
|
|
2522
2646
|
r.value.forEach((d) => {
|
|
2523
2647
|
if (!d.disabled) {
|
|
2524
2648
|
const f = l(d);
|
|
@@ -2527,11 +2651,11 @@ const {
|
|
|
2527
2651
|
});
|
|
2528
2652
|
}
|
|
2529
2653
|
});
|
|
2530
|
-
else if (r.value =
|
|
2654
|
+
else if (r.value = o.options, typeof o.modelValue == "boolean" && r.value.length === 1) {
|
|
2531
2655
|
const a = l(r.value[0]);
|
|
2532
|
-
s[a] =
|
|
2533
|
-
} else if (Array.isArray(
|
|
2534
|
-
const a = new Set(
|
|
2656
|
+
s[a] = o.modelValue;
|
|
2657
|
+
} else if (Array.isArray(o.modelValue)) {
|
|
2658
|
+
const a = new Set(o.modelValue);
|
|
2535
2659
|
r.value.forEach((d) => {
|
|
2536
2660
|
if (!d.disabled) {
|
|
2537
2661
|
const f = l(d);
|
|
@@ -2542,9 +2666,9 @@ const {
|
|
|
2542
2666
|
}), (a, d) => (openBlock(), createElementBlock("div", {
|
|
2543
2667
|
class: normalizeClass(["p-0 w-full gap-[6px]", [e.position === "vertical" ? "flex-col" : "", e.colSpan ? "grid" : "flex justify-start"]])
|
|
2544
2668
|
}, [
|
|
2545
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(r.value, (f) => (openBlock(), createBlock(_sfc_main$
|
|
2669
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(r.value, (f) => (openBlock(), createBlock(_sfc_main$x, {
|
|
2546
2670
|
modelValue: s[l(f)],
|
|
2547
|
-
"onUpdate:modelValue": (
|
|
2671
|
+
"onUpdate:modelValue": (m) => s[l(f)] = m,
|
|
2548
2672
|
value: l(f),
|
|
2549
2673
|
class: normalizeClass(u(e.colSpan)),
|
|
2550
2674
|
disabled: f.disabled,
|
|
@@ -2583,31 +2707,237 @@ const {
|
|
|
2583
2707
|
}),
|
|
2584
2708
|
emits: ["update:modelValue"],
|
|
2585
2709
|
setup(e) {
|
|
2586
|
-
const t = e, { inputClass:
|
|
2710
|
+
const t = e, { inputClass: o } = useStyle(t.style), n = useModel(e, "modelValue");
|
|
2587
2711
|
return (r, s) => withDirectives((openBlock(), createElementBlock("input", {
|
|
2588
2712
|
type: "date",
|
|
2589
|
-
"onUpdate:modelValue": s[0] || (s[0] = (l) =>
|
|
2713
|
+
"onUpdate:modelValue": s[0] || (s[0] = (l) => n.value = l),
|
|
2590
2714
|
placeholder: e.placeholder,
|
|
2591
2715
|
disabled: e.disabled,
|
|
2592
|
-
class: normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f]", [unref(
|
|
2716
|
+
class: normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f]", [unref(o)]]),
|
|
2593
2717
|
style: {
|
|
2594
2718
|
border: "1px solid #CFD9E0"
|
|
2595
2719
|
}
|
|
2596
2720
|
}, null, 10, _hoisted_1$g)), [
|
|
2597
|
-
[vModelText,
|
|
2721
|
+
[vModelText, n.value]
|
|
2598
2722
|
]);
|
|
2599
2723
|
}
|
|
2600
|
-
}),
|
|
2724
|
+
}), $ = (e, t) => {
|
|
2725
|
+
const o = e.__vccOpts || e;
|
|
2726
|
+
for (const [n, r] of t)
|
|
2727
|
+
o[n] = r;
|
|
2728
|
+
return o;
|
|
2729
|
+
};
|
|
2730
|
+
defineComponent({
|
|
2731
|
+
props: {
|
|
2732
|
+
modelValue: { type: Boolean, default: () => !1 },
|
|
2733
|
+
title: { type: String, default: () => "" },
|
|
2734
|
+
disabled: { type: Boolean, default: () => !1 }
|
|
2735
|
+
},
|
|
2736
|
+
data() {
|
|
2737
|
+
return {};
|
|
2738
|
+
},
|
|
2739
|
+
mounted() {
|
|
2740
|
+
this.modelValue || this.$emit("update:modelValue", !1);
|
|
2741
|
+
},
|
|
2742
|
+
computed: {
|
|
2743
|
+
modelState: {
|
|
2744
|
+
get() {
|
|
2745
|
+
return this.modelValue;
|
|
2746
|
+
},
|
|
2747
|
+
set(e) {
|
|
2748
|
+
this.$emit("update:modelValue", e);
|
|
2749
|
+
}
|
|
2750
|
+
},
|
|
2751
|
+
labelCursorClasses() {
|
|
2752
|
+
return [
|
|
2753
|
+
{ "cursor-not-allowed": this.disabled },
|
|
2754
|
+
{ "cursor-pointer": !this.disabled }
|
|
2755
|
+
];
|
|
2756
|
+
}
|
|
2757
|
+
},
|
|
2758
|
+
methods: {
|
|
2759
|
+
handleEnterDown(e) {
|
|
2760
|
+
const { keyCode: t } = e;
|
|
2761
|
+
t === 13 && (this.modelState = !this.modelState);
|
|
2762
|
+
},
|
|
2763
|
+
addKeyHandler() {
|
|
2764
|
+
window.addEventListener("keydown", this.handleEnterDown);
|
|
2765
|
+
},
|
|
2766
|
+
removeKeyHandler() {
|
|
2767
|
+
window.removeEventListener("keydown", this.handleEnterDown);
|
|
2768
|
+
}
|
|
2769
|
+
}
|
|
2770
|
+
});
|
|
2771
|
+
const Vt = {}, zt = {
|
|
2772
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2773
|
+
fill: "none",
|
|
2774
|
+
viewBox: "0 0 24 24",
|
|
2775
|
+
"stroke-width": "1.5",
|
|
2776
|
+
stroke: "currentColor",
|
|
2777
|
+
class: "size-6 text-green-600"
|
|
2778
|
+
};
|
|
2779
|
+
function Et(e, t) {
|
|
2780
|
+
return openBlock(), createElementBlock("svg", zt, t[0] || (t[0] = [
|
|
2781
|
+
createElementVNode("path", {
|
|
2782
|
+
"stroke-linecap": "round",
|
|
2783
|
+
"stroke-linejoin": "round",
|
|
2784
|
+
d: "M9 12.75L11.25 15 15 9.75M21 12a9 9 0 11-18 0 9 9 0 0118 0z"
|
|
2785
|
+
}, null, -1)
|
|
2786
|
+
]));
|
|
2787
|
+
}
|
|
2788
|
+
const Lt = /* @__PURE__ */ $(Vt, [["render", Et]]), jt = {}, Mt = {
|
|
2789
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2790
|
+
fill: "none",
|
|
2791
|
+
viewBox: "0 0 24 24",
|
|
2792
|
+
"stroke-width": "1.5",
|
|
2793
|
+
stroke: "orange",
|
|
2794
|
+
class: "size-6 text-orange-600"
|
|
2795
|
+
};
|
|
2796
|
+
function Pt(e, t) {
|
|
2797
|
+
return openBlock(), createElementBlock("svg", Mt, t[0] || (t[0] = [
|
|
2798
|
+
createElementVNode("path", {
|
|
2799
|
+
"stroke-linecap": "round",
|
|
2800
|
+
"stroke-linejoin": "round",
|
|
2801
|
+
d: "M12 9v3m0 3h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"
|
|
2802
|
+
}, null, -1)
|
|
2803
|
+
]));
|
|
2804
|
+
}
|
|
2805
|
+
const Tt = /* @__PURE__ */ $(jt, [["render", Pt]]), It = {}, Rt = {
|
|
2806
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2807
|
+
fill: "none",
|
|
2808
|
+
viewBox: "0 0 24 24",
|
|
2809
|
+
"stroke-width": "1.5",
|
|
2810
|
+
stroke: "currentColor",
|
|
2811
|
+
class: "size-6 text-blue-600"
|
|
2812
|
+
};
|
|
2813
|
+
function Ot(e, t) {
|
|
2814
|
+
return openBlock(), createElementBlock("svg", Rt, t[0] || (t[0] = [
|
|
2815
|
+
createElementVNode("path", {
|
|
2816
|
+
"stroke-linecap": "round",
|
|
2817
|
+
"stroke-linejoin": "round",
|
|
2818
|
+
d: "m11.25 11.25.041-.02a.75.75 0 0 1 1.063.852l-.708 2.836a.75.75 0 0 0 1.063.853l.041-.021M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9-3.75h.008v.008H12V8.25Z"
|
|
2819
|
+
}, null, -1)
|
|
2820
|
+
]));
|
|
2821
|
+
}
|
|
2822
|
+
const Dt = /* @__PURE__ */ $(It, [["render", Ot]]), Ht = {}, Nt = {
|
|
2823
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2824
|
+
fill: "none",
|
|
2825
|
+
viewBox: "0 0 24 24",
|
|
2826
|
+
"stroke-width": "1.5",
|
|
2827
|
+
stroke: "red",
|
|
2828
|
+
class: "size-6 text-red-600"
|
|
2829
|
+
};
|
|
2830
|
+
function At(e, t) {
|
|
2831
|
+
return openBlock(), createElementBlock("svg", Nt, t[0] || (t[0] = [
|
|
2832
|
+
createElementVNode("path", {
|
|
2833
|
+
"stroke-linecap": "round",
|
|
2834
|
+
"stroke-linejoin": "round",
|
|
2835
|
+
d: "M6 18L18 6M6 6l12 12"
|
|
2836
|
+
}, null, -1)
|
|
2837
|
+
]));
|
|
2838
|
+
}
|
|
2839
|
+
const Kt = /* @__PURE__ */ $(Ht, [["render", At]]), qt = { class: "rounded-md border border-gray-300 bg-white p-4 shadow-sm" }, Ut = { class: "flex items-start gap-4 opacity-100 scale-5 transition-all duration-300" }, Wt = { class: "flex-1" }, Gt = { class: "font-medium text-gray-900" }, Zt = { class: "mt-0.5 text-sm text-gray-700" }, le = /* @__PURE__ */ defineComponent({
|
|
2840
|
+
__name: "vs-notify",
|
|
2841
|
+
props: {
|
|
2842
|
+
type: {},
|
|
2843
|
+
title: {},
|
|
2844
|
+
message: {}
|
|
2845
|
+
},
|
|
2846
|
+
setup(e) {
|
|
2847
|
+
const t = {
|
|
2848
|
+
success: Lt,
|
|
2849
|
+
warning: Tt,
|
|
2850
|
+
error: Kt,
|
|
2851
|
+
info: Dt
|
|
2852
|
+
};
|
|
2853
|
+
return (o, n) => (openBlock(), createElementBlock("div", qt, [
|
|
2854
|
+
createElementVNode("div", Ut, [
|
|
2855
|
+
(openBlock(), createBlock(resolveDynamicComponent(t[o.type]))),
|
|
2856
|
+
createElementVNode("div", Wt, [
|
|
2857
|
+
createElementVNode("strong", Gt, toDisplayString(o.title), 1),
|
|
2858
|
+
createElementVNode("p", Zt, toDisplayString(o.message), 1)
|
|
2859
|
+
]),
|
|
2860
|
+
n[0] || (n[0] = createElementVNode("button", {
|
|
2861
|
+
class: "m-3 rounded-full p-1.5 text-gray-500 transition-colors hover:bg-gray-50 hover:text-gray-700",
|
|
2862
|
+
type: "button",
|
|
2863
|
+
"aria-label": "Dismiss notify"
|
|
2864
|
+
}, [
|
|
2865
|
+
createElementVNode("span", { class: "sr-only" }, "Dismiss popup"),
|
|
2866
|
+
createElementVNode("svg", {
|
|
2867
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2868
|
+
fill: "none",
|
|
2869
|
+
viewBox: "0 0 24 24",
|
|
2870
|
+
"stroke-width": "1.5",
|
|
2871
|
+
stroke: "currentColor",
|
|
2872
|
+
class: "size-5"
|
|
2873
|
+
}, [
|
|
2874
|
+
createElementVNode("path", {
|
|
2875
|
+
"stroke-linecap": "round",
|
|
2876
|
+
"stroke-linejoin": "round",
|
|
2877
|
+
d: "M6 18L18 6M6 6l12 12"
|
|
2878
|
+
})
|
|
2879
|
+
])
|
|
2880
|
+
], -1))
|
|
2881
|
+
])
|
|
2882
|
+
]));
|
|
2883
|
+
}
|
|
2884
|
+
});
|
|
2885
|
+
reactive({ visible: !0 });
|
|
2886
|
+
const H = {
|
|
2887
|
+
top: "top-4 left-1/2 transform -translate-x-1/2",
|
|
2888
|
+
"left-bottom": "bottom-4 left-4 transform",
|
|
2889
|
+
"right-bottom": "bottom-4 right-4 transform",
|
|
2890
|
+
bottom: "bottom-4 left-1/2 transform -translate-x-1/2"
|
|
2891
|
+
}, jo = (e) => {
|
|
2892
|
+
const {
|
|
2893
|
+
type: t = "info",
|
|
2894
|
+
title: o,
|
|
2895
|
+
message: n,
|
|
2896
|
+
position: r = "right-bottom"
|
|
2897
|
+
} = e || {};
|
|
2898
|
+
let s = document.querySelector("#notify-root");
|
|
2899
|
+
s || (s = document.createElement("div"), s.id = "notify-root", s.className = `fixed z-[100] flex flex-col gap-3 ${H[r]} p-6 max-w-md mx-auto font-sans antialiased`, document.body.appendChild(s)), s.className.includes(H[r]) || (Object.values(H).forEach((u) => {
|
|
2900
|
+
s.classList.remove(...u.split(" "));
|
|
2901
|
+
}), s.classList.add(...H[r].split(" ")));
|
|
2902
|
+
const l = document.createElement("div");
|
|
2903
|
+
s.appendChild(l);
|
|
2904
|
+
const i = createApp({
|
|
2905
|
+
render() {
|
|
2906
|
+
return h(le, {
|
|
2907
|
+
type: t,
|
|
2908
|
+
title: o,
|
|
2909
|
+
message: n,
|
|
2910
|
+
onClose: () => {
|
|
2911
|
+
i.unmount(), l.remove();
|
|
2912
|
+
}
|
|
2913
|
+
});
|
|
2914
|
+
}
|
|
2915
|
+
});
|
|
2916
|
+
i.mount(l), l.querySelector("button")?.addEventListener("click", () => {
|
|
2917
|
+
l.classList.add("opacity-0", "scale-95", "transition-all", "duration-300"), setTimeout(() => {
|
|
2918
|
+
i.unmount(), l.remove();
|
|
2919
|
+
}, 350);
|
|
2920
|
+
}), setTimeout(() => {
|
|
2921
|
+
l.classList.add("opacity-0", "scale-95", "transition-all", "duration-300"), setTimeout(() => {
|
|
2922
|
+
i.unmount(), l.remove();
|
|
2923
|
+
}, 350);
|
|
2924
|
+
}, 3500);
|
|
2925
|
+
}, fileUpload = async (e, t, o, n) => {
|
|
2601
2926
|
try {
|
|
2602
2927
|
const r = new FormData();
|
|
2603
2928
|
r.append("unique", "true"), r.append("file", e);
|
|
2604
2929
|
const { data: s } = await axios.post(
|
|
2605
|
-
`/file/upload/uploads?id=${t || ""}&form=${
|
|
2930
|
+
`/file/upload/uploads?id=${t || ""}&form=${o || ""}&table=${n || ""}`,
|
|
2606
2931
|
r
|
|
2607
2932
|
);
|
|
2608
2933
|
return s;
|
|
2609
2934
|
} catch (r) {
|
|
2610
|
-
|
|
2935
|
+
jo({
|
|
2936
|
+
type: "error",
|
|
2937
|
+
title: "Помилка!",
|
|
2938
|
+
message: "Сталась помилка під час завантаження файлу",
|
|
2939
|
+
position: "right-bottom"
|
|
2940
|
+
}), console.error("Сталась помилка завантаження файлу", r);
|
|
2611
2941
|
}
|
|
2612
2942
|
}, fileDelete = async (e) => {
|
|
2613
2943
|
try {
|
|
@@ -2622,7 +2952,7 @@ const {
|
|
|
2622
2952
|
headers: {
|
|
2623
2953
|
"Content-Type": "application/json"
|
|
2624
2954
|
}
|
|
2625
|
-
}),
|
|
2955
|
+
}), o = t.headers["content-type"], n = new TextDecoder("utf-8").decode(t.data), r = new Blob([n], { type: o }), s = document.createElement("a");
|
|
2626
2956
|
s.setAttribute("download", e), s.href = window.URL.createObjectURL(r), s.click();
|
|
2627
2957
|
} catch (t) {
|
|
2628
2958
|
console.error(t.message);
|
|
@@ -2656,7 +2986,7 @@ const IconPlus = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["render", _sfc_rende
|
|
|
2656
2986
|
"stroke-linecap": "round",
|
|
2657
2987
|
"stroke-linejoin": "round"
|
|
2658
2988
|
};
|
|
2659
|
-
function _sfc_render$7(e, t,
|
|
2989
|
+
function _sfc_render$7(e, t, o, n, r, s) {
|
|
2660
2990
|
return openBlock(), createElementBlock("svg", _hoisted_1$e, t[0] || (t[0] = [
|
|
2661
2991
|
createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M14 3v4a1 1 0 0 0 1 1h4"></path><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"></path><line x1="9" y1="9" x2="10" y2="9"></line><line x1="9" y1="13" x2="15" y2="13"></line><line x1="9" y1="17" x2="15" y2="17"></line>', 6)
|
|
2662
2992
|
]));
|
|
@@ -2673,7 +3003,7 @@ const iconPdf = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["render", _sfc_render
|
|
|
2673
3003
|
"stroke-linecap": "round",
|
|
2674
3004
|
"stroke-linejoin": "round"
|
|
2675
3005
|
};
|
|
2676
|
-
function _sfc_render$6(e, t,
|
|
3006
|
+
function _sfc_render$6(e, t, o, n, r, s) {
|
|
2677
3007
|
return openBlock(), createElementBlock("svg", _hoisted_1$d, t[0] || (t[0] = [
|
|
2678
3008
|
createElementVNode("path", {
|
|
2679
3009
|
stroke: "none",
|
|
@@ -2713,7 +3043,7 @@ const IconCsv = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["render", _sfc_render
|
|
|
2713
3043
|
"stroke-linejoin": "round",
|
|
2714
3044
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-file-unknown"
|
|
2715
3045
|
};
|
|
2716
|
-
function _sfc_render$5(e, t,
|
|
3046
|
+
function _sfc_render$5(e, t, o, n, r, s) {
|
|
2717
3047
|
return openBlock(), createElementBlock("svg", _hoisted_1$c, t[0] || (t[0] = [
|
|
2718
3048
|
createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M14 3v4a1 1 0 0 0 1 1h4"></path><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"></path><path d="M12 17v.01"></path><path d="M12 14a1.5 1.5 0 1 0 -1.14 -2.474"></path>', 5)
|
|
2719
3049
|
]));
|
|
@@ -2730,7 +3060,7 @@ const IconFile = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["render", _sfc_rende
|
|
|
2730
3060
|
"stroke-linecap": "round",
|
|
2731
3061
|
"stroke-linejoin": "round"
|
|
2732
3062
|
};
|
|
2733
|
-
function _sfc_render$4(e, t,
|
|
3063
|
+
function _sfc_render$4(e, t, o, n, r, s) {
|
|
2734
3064
|
return openBlock(), createElementBlock("svg", _hoisted_1$b, t[0] || (t[0] = [
|
|
2735
3065
|
createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M6 20.735a2 2 0 0 1 -1 -1.735v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2h-1"></path><path d="M11 17a2 2 0 0 1 2 2v2a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1v-2a2 2 0 0 1 2 -2z"></path><line x1="11" y1="5" x2="10" y2="5"></line><line x1="13" y1="7" x2="12" y2="7"></line><line x1="11" y1="9" x2="10" y2="9"></line><line x1="13" y1="11" x2="12" y2="11"></line><line x1="11" y1="13" x2="10" y2="13"></line><line x1="13" y1="15" x2="12" y2="15"></line>', 9)
|
|
2736
3066
|
]));
|
|
@@ -2747,7 +3077,7 @@ const IconZip = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["render", _sfc_render
|
|
|
2747
3077
|
"stroke-linecap": "round",
|
|
2748
3078
|
"stroke-linejoin": "round"
|
|
2749
3079
|
};
|
|
2750
|
-
function _sfc_render$3(e, t,
|
|
3080
|
+
function _sfc_render$3(e, t, o, n, r, s) {
|
|
2751
3081
|
return openBlock(), createElementBlock("svg", _hoisted_1$a, t[0] || (t[0] = [
|
|
2752
3082
|
createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M14 3v4a1 1 0 0 0 1 1h4"></path><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"></path><path d="M10 13l-1 2l1 2"></path><path d="M14 13l1 2l-1 2"></path>', 5)
|
|
2753
3083
|
]));
|
|
@@ -2757,14 +3087,14 @@ const IconGeojson = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["render", _sfc_re
|
|
|
2757
3087
|
const t = e?.split(".");
|
|
2758
3088
|
return t[t.length - 1];
|
|
2759
3089
|
}, fileFormatPreview = (e) => {
|
|
2760
|
-
const t = getFileType(e),
|
|
3090
|
+
const t = getFileType(e), o = {
|
|
2761
3091
|
imageFormat: ["tiff", "jpg", "jpeg", "png", "svg", "ico", "webp"],
|
|
2762
3092
|
sheetsFormat: ["xls", "csv", "xlsx"],
|
|
2763
3093
|
archivesFormat: ["zip", "rar"],
|
|
2764
3094
|
textsFormat: ["json", "geojson", "txt", "yml", "yaml", "shp"],
|
|
2765
3095
|
documentsFormat: ["pdf"]
|
|
2766
3096
|
};
|
|
2767
|
-
return
|
|
3097
|
+
return o.imageFormat.includes(t) ? "img" : o.sheetsFormat.includes(t) ? IconCsv : o.textsFormat.includes(t) ? IconGeojson : o.documentsFormat.includes(t) ? iconPdf : o.archivesFormat.includes(t) ? IconZip : IconFile;
|
|
2768
3098
|
}, _sfc_main$c = {}, _hoisted_1$9 = {
|
|
2769
3099
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2770
3100
|
width: "24",
|
|
@@ -2818,19 +3148,19 @@ const IconDownload = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["render", _sfc_r
|
|
|
2818
3148
|
}),
|
|
2819
3149
|
emits: ["update:value", "update:item"],
|
|
2820
3150
|
setup(e) {
|
|
2821
|
-
const t = useModel(e, "value"),
|
|
3151
|
+
const t = useModel(e, "value"), o = useModel(e, "item"), n = e;
|
|
2822
3152
|
return (r, s) => (openBlock(), createElementBlock("div", _hoisted_1$7, [
|
|
2823
|
-
(openBlock(), createBlock(resolveDynamicComponent(unref(fileFormatPreview)(
|
|
2824
|
-
src:
|
|
3153
|
+
(openBlock(), createBlock(resolveDynamicComponent(unref(fileFormatPreview)(o.value)), {
|
|
3154
|
+
src: o.value,
|
|
2825
3155
|
alt: "file",
|
|
2826
3156
|
class: "w-full h-full object-cover cursor-pointer",
|
|
2827
|
-
onClick: s[0] || (s[0] = (l) => unref(fileDownload)(
|
|
3157
|
+
onClick: s[0] || (s[0] = (l) => unref(fileDownload)(o.value))
|
|
2828
3158
|
}, null, 8, ["src"])),
|
|
2829
3159
|
createElementVNode("div", _hoisted_2$4, [
|
|
2830
3160
|
createElementVNode("button", {
|
|
2831
3161
|
type: "button",
|
|
2832
3162
|
onClick: s[1] || (s[1] = (l) => {
|
|
2833
|
-
unref(fileDelete)(
|
|
3163
|
+
unref(fileDelete)(o.value), t.value = n.multiple ? t.value?.filter((i) => i !== o.value) : "";
|
|
2834
3164
|
}),
|
|
2835
3165
|
class: "w-6 h-6 flex items-center justify-center text-gray-500 bg-gray-200 rounded-lg hover:text-red-500"
|
|
2836
3166
|
}, [
|
|
@@ -2838,7 +3168,7 @@ const IconDownload = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["render", _sfc_r
|
|
|
2838
3168
|
]),
|
|
2839
3169
|
createElementVNode("button", {
|
|
2840
3170
|
type: "button",
|
|
2841
|
-
onClick: s[2] || (s[2] = (l) => unref(fileDownload)(
|
|
3171
|
+
onClick: s[2] || (s[2] = (l) => unref(fileDownload)(o.value)),
|
|
2842
3172
|
class: "w-6 h-6 flex items-center justify-center text-gray-500 bg-gray-200 rounded-lg hover:text-blue-500"
|
|
2843
3173
|
}, [
|
|
2844
3174
|
createVNode(IconDownload, { class: "w-4 h-4" })
|
|
@@ -2861,7 +3191,7 @@ const IconDownload = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["render", _sfc_r
|
|
|
2861
3191
|
}),
|
|
2862
3192
|
emits: ["update:modelValue"],
|
|
2863
3193
|
setup(e) {
|
|
2864
|
-
const t = e,
|
|
3194
|
+
const t = e, o = useModel(e, "modelValue"), n = ref(null), r = (l) => Array.isArray(o.value) && o.value[l] || "", s = async (l) => {
|
|
2865
3195
|
if (t.format) {
|
|
2866
3196
|
const c = l.target.files?.[0];
|
|
2867
3197
|
if (!c || !c.name.endsWith(t.format))
|
|
@@ -2870,32 +3200,32 @@ const IconDownload = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["render", _sfc_r
|
|
|
2870
3200
|
const i = l.target.files?.[0];
|
|
2871
3201
|
if (!i) return;
|
|
2872
3202
|
const u = await fileUpload(i, "1", "form", "table");
|
|
2873
|
-
|
|
3203
|
+
o.value = t.multiple ? [...o.value || [], u.result?.file_path] : u.result?.file_path;
|
|
2874
3204
|
};
|
|
2875
3205
|
return (l, i) => (openBlock(), createElementBlock("div", _hoisted_1$6, [
|
|
2876
3206
|
createElementVNode("input", {
|
|
2877
3207
|
class: "hidden",
|
|
2878
3208
|
ref_key: "fileInput",
|
|
2879
|
-
ref:
|
|
3209
|
+
ref: n,
|
|
2880
3210
|
type: "file",
|
|
2881
3211
|
onChange: s
|
|
2882
3212
|
}, null, 544),
|
|
2883
|
-
!l.multiple &&
|
|
3213
|
+
!l.multiple && o.value ? (openBlock(), createBlock(VsInputFileListItem, {
|
|
2884
3214
|
key: 0,
|
|
2885
|
-
item:
|
|
2886
|
-
"onUpdate:item": i[0] || (i[0] = (u) =>
|
|
2887
|
-
value:
|
|
2888
|
-
"onUpdate:value": i[1] || (i[1] = (u) =>
|
|
3215
|
+
item: o.value,
|
|
3216
|
+
"onUpdate:item": i[0] || (i[0] = (u) => o.value = u),
|
|
3217
|
+
value: o.value,
|
|
3218
|
+
"onUpdate:value": i[1] || (i[1] = (u) => o.value = u)
|
|
2889
3219
|
}, null, 8, ["item", "value"])) : l.multiple ? (openBlock(), createElementBlock("div", _hoisted_2$3, [
|
|
2890
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(
|
|
3220
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(o.value, (u, c) => (openBlock(), createBlock(VsInputFileListItem, {
|
|
2891
3221
|
multiple: l.multiple,
|
|
2892
3222
|
key: c,
|
|
2893
|
-
value:
|
|
2894
|
-
"onUpdate:value": i[2] || (i[2] = (a) =>
|
|
3223
|
+
value: o.value,
|
|
3224
|
+
"onUpdate:value": i[2] || (i[2] = (a) => o.value = a),
|
|
2895
3225
|
item: r(c)
|
|
2896
3226
|
}, null, 8, ["multiple", "value", "item"]))), 128)),
|
|
2897
3227
|
createElementVNode("div", {
|
|
2898
|
-
onClick: i[3] || (i[3] = (u) => !l.disabled &&
|
|
3228
|
+
onClick: i[3] || (i[3] = (u) => !l.disabled && n.value?.click()),
|
|
2899
3229
|
class: normalizeClass([
|
|
2900
3230
|
"h-[120px] w-[120px] border text-gray-300 hover:text-blue-500 border-dashed border-[#CFD9E0] rounded-lg flex items-center justify-center transition-all duration-300",
|
|
2901
3231
|
l.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer hover:border-blue-500 hover:bg-blue-50"
|
|
@@ -2906,7 +3236,7 @@ const IconDownload = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["render", _sfc_r
|
|
|
2906
3236
|
])) : createCommentVNode("", !0),
|
|
2907
3237
|
l.multiple ? createCommentVNode("", !0) : (openBlock(), createElementBlock("div", {
|
|
2908
3238
|
key: 2,
|
|
2909
|
-
onClick: i[4] || (i[4] = (u) =>
|
|
3239
|
+
onClick: i[4] || (i[4] = (u) => n.value?.click()),
|
|
2910
3240
|
class: normalizeClass([l.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer hover:border-blue-500", "h-[120px] w-[120px] border text-gray-300 hover:text-blue-500 border-dashed border-gray-300 rounded-lg flex items-center justify-center cursor-pointer hover:border-blue-500 transition-all duration-300 hover:bg-blue-50"])
|
|
2911
3241
|
}, [
|
|
2912
3242
|
createVNode(IconPlus, { class: "w-6 h-6" })
|
|
@@ -2930,27 +3260,27 @@ const IconDownload = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["render", _sfc_r
|
|
|
2930
3260
|
}
|
|
2931
3261
|
},
|
|
2932
3262
|
setup(e) {
|
|
2933
|
-
const t = e,
|
|
3263
|
+
const t = e, o = ref(t.isOpen);
|
|
2934
3264
|
return watch(
|
|
2935
3265
|
() => t.isOpen,
|
|
2936
|
-
(
|
|
2937
|
-
|
|
3266
|
+
(n) => {
|
|
3267
|
+
o.value = n;
|
|
2938
3268
|
}
|
|
2939
|
-
), (
|
|
3269
|
+
), (n, r) => (openBlock(), createElementBlock("div", null, [
|
|
2940
3270
|
createElementVNode("div", _hoisted_1$5, [
|
|
2941
3271
|
createElementVNode("p", _hoisted_2$2, toDisplayString(e.title), 1),
|
|
2942
|
-
createVNode(_sfc_main$
|
|
2943
|
-
modelValue:
|
|
2944
|
-
"onUpdate:modelValue": r[0] || (r[0] = (s) =>
|
|
3272
|
+
createVNode(_sfc_main$s, {
|
|
3273
|
+
modelValue: o.value,
|
|
3274
|
+
"onUpdate:modelValue": r[0] || (r[0] = (s) => o.value = s),
|
|
2945
3275
|
style: normalizeStyle(e.style)
|
|
2946
3276
|
}, null, 8, ["modelValue", "style"])
|
|
2947
3277
|
]),
|
|
2948
3278
|
createVNode(Transition, { name: "slide-fade" }, {
|
|
2949
3279
|
default: withCtx(() => [
|
|
2950
3280
|
withDirectives(createElementVNode("div", _hoisted_3$1, [
|
|
2951
|
-
renderSlot(
|
|
3281
|
+
renderSlot(n.$slots, "default", {}, void 0, !0)
|
|
2952
3282
|
], 512), [
|
|
2953
|
-
[vShow,
|
|
3283
|
+
[vShow, o.value]
|
|
2954
3284
|
])
|
|
2955
3285
|
]),
|
|
2956
3286
|
_: 3
|
|
@@ -2974,29 +3304,29 @@ const IconDownload = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["render", _sfc_r
|
|
|
2974
3304
|
}
|
|
2975
3305
|
},
|
|
2976
3306
|
setup(e) {
|
|
2977
|
-
const t = e,
|
|
3307
|
+
const t = e, o = ref(t.isOpen);
|
|
2978
3308
|
return watch(
|
|
2979
3309
|
() => t.isOpen,
|
|
2980
|
-
(
|
|
2981
|
-
|
|
3310
|
+
(n) => {
|
|
3311
|
+
o.value = n;
|
|
2982
3312
|
}
|
|
2983
|
-
), (
|
|
3313
|
+
), (n, r) => (openBlock(), createElementBlock("div", null, [
|
|
2984
3314
|
createElementVNode("button", {
|
|
2985
3315
|
type: "button",
|
|
2986
|
-
onClick: r[0] || (r[0] = (s) =>
|
|
3316
|
+
onClick: r[0] || (r[0] = (s) => o.value = !o.value),
|
|
2987
3317
|
class: "flex items-center gap-2"
|
|
2988
3318
|
}, [
|
|
2989
3319
|
createVNode(unref(IconChevronDown), {
|
|
2990
|
-
class: normalizeClass(["h-4 w-4 duration-300", [
|
|
3320
|
+
class: normalizeClass(["h-4 w-4 duration-300", [o.value ? "-rotate-180" : ""]])
|
|
2991
3321
|
}, null, 8, ["class"]),
|
|
2992
3322
|
createElementVNode("span", _hoisted_1$4, toDisplayString(e.title), 1)
|
|
2993
3323
|
]),
|
|
2994
3324
|
createVNode(Transition, { name: "slide-fade" }, {
|
|
2995
3325
|
default: withCtx(() => [
|
|
2996
3326
|
withDirectives(createElementVNode("div", _hoisted_2$1, [
|
|
2997
|
-
renderSlot(
|
|
3327
|
+
renderSlot(n.$slots, "default", {}, void 0, !0)
|
|
2998
3328
|
], 512), [
|
|
2999
|
-
[vShow,
|
|
3329
|
+
[vShow, o.value]
|
|
3000
3330
|
])
|
|
3001
3331
|
]),
|
|
3002
3332
|
_: 3
|
|
@@ -3016,7 +3346,7 @@ const IconDownload = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["render", _sfc_r
|
|
|
3016
3346
|
}
|
|
3017
3347
|
},
|
|
3018
3348
|
setup(e) {
|
|
3019
|
-
return (t,
|
|
3349
|
+
return (t, o) => (openBlock(), createElementBlock("div", null, [
|
|
3020
3350
|
createElementVNode("div", _hoisted_1$3, [
|
|
3021
3351
|
createElementVNode("p", null, toDisplayString(e.title), 1)
|
|
3022
3352
|
]),
|
|
@@ -3091,10 +3421,10 @@ const IconDownload = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["render", _sfc_r
|
|
|
3091
3421
|
}
|
|
3092
3422
|
},
|
|
3093
3423
|
setup(e) {
|
|
3094
|
-
const t = e,
|
|
3424
|
+
const t = e, o = inject("formValues", { default: {} }), n = inject("form"), r = computed(() => t.schema?.filter((l) => {
|
|
3095
3425
|
const i = l?.conditions;
|
|
3096
3426
|
if (!i) return !0;
|
|
3097
|
-
const u = Array.isArray(i) ? i[0] : i, c =
|
|
3427
|
+
const u = Array.isArray(i) ? i[0] : i, c = o?.value?.[u];
|
|
3098
3428
|
return isVisible(c, i);
|
|
3099
3429
|
})), s = computed(() => views[t.view]);
|
|
3100
3430
|
return (l, i) => e.schema?.length ? (openBlock(), createBlock(resolveDynamicComponent(s.value), {
|
|
@@ -3107,56 +3437,56 @@ const IconDownload = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["render", _sfc_r
|
|
|
3107
3437
|
key: u.name
|
|
3108
3438
|
}, { ref_for: !0 }, u, {
|
|
3109
3439
|
item: u,
|
|
3110
|
-
modelValue: unref(
|
|
3111
|
-
"onUpdate:modelValue": (c) => unref(
|
|
3440
|
+
modelValue: unref(o)[u.name],
|
|
3441
|
+
"onUpdate:modelValue": (c) => unref(o)[u.name] = c,
|
|
3112
3442
|
style: e.style,
|
|
3113
|
-
error: unref(
|
|
3443
|
+
error: unref(n)?.errors?.[u.name]
|
|
3114
3444
|
}), null, 16, ["item", "modelValue", "onUpdate:modelValue", "style", "error"]))), 128))
|
|
3115
3445
|
]),
|
|
3116
3446
|
_: 1
|
|
3117
3447
|
}, 8, ["title", "style"])) : createCommentVNode("", !0);
|
|
3118
3448
|
}
|
|
3119
|
-
}), dynamicPosition = async (e, t,
|
|
3120
|
-
if (!t || !
|
|
3449
|
+
}), dynamicPosition = async (e, t, o, n = 10) => {
|
|
3450
|
+
if (!t || !o) return;
|
|
3121
3451
|
await nextTick();
|
|
3122
|
-
const r = await
|
|
3452
|
+
const r = await o?.getBoundingClientRect(), s = await t?.getBoundingClientRect();
|
|
3123
3453
|
if (!s || !r) return;
|
|
3124
|
-
const l = await parseInt(t?.getBoundingClientRect()?.height.toString()), i = await parseInt(t?.getBoundingClientRect()?.width.toString()), u = await parseInt(
|
|
3125
|
-
let f = 0,
|
|
3126
|
-
const p = s.bottom +
|
|
3454
|
+
const l = await parseInt(t?.getBoundingClientRect()?.height.toString()), i = await parseInt(t?.getBoundingClientRect()?.width.toString()), u = await parseInt(o?.getBoundingClientRect()?.height.toString()), c = await parseInt(o?.getBoundingClientRect()?.width.toString()), a = await window.innerHeight, d = await window.innerWidth;
|
|
3455
|
+
let f = 0, m = 0;
|
|
3456
|
+
const p = s.bottom + n + u;
|
|
3127
3457
|
switch (e) {
|
|
3128
3458
|
case "top":
|
|
3129
|
-
s.top - r.height -
|
|
3459
|
+
s.top - r.height - n < 0 ? f = s.top - r.height + n + u + l : f = s.top - r.height - n, d > c + s.right + 30 ? m = s.left - r.width / 2 + s.width / 2 : m = d - 30 - c;
|
|
3130
3460
|
break;
|
|
3131
3461
|
case "bottom":
|
|
3132
|
-
a > p ? f = s.bottom +
|
|
3462
|
+
a > p ? f = s.bottom + n : f = s.bottom - n - u - l, m = s.left - r.width / 2 + s.width / 2;
|
|
3133
3463
|
break;
|
|
3134
3464
|
case "left":
|
|
3135
|
-
f = s.top - r.height / 2 + s.height / 2, s.left - r.width -
|
|
3465
|
+
f = s.top - r.height / 2 + s.height / 2, s.left - r.width - n > 0 ? m = s.left - r.width - n : m = 10;
|
|
3136
3466
|
break;
|
|
3137
3467
|
case "right":
|
|
3138
|
-
f = s.top - r.height / 2 + s.height / 2, d - i > c ?
|
|
3468
|
+
f = s.top - r.height / 2 + s.height / 2, d - i > c ? m = s.right + n : m = d - 30 - c;
|
|
3139
3469
|
break;
|
|
3140
3470
|
case "top-right":
|
|
3141
|
-
s.top - r.height -
|
|
3471
|
+
s.top - r.height - n < 0 ? f = s.top - r.height + n + u + l : f = s.top - r.height - n, d - i > c ? m = s.right + n : m = d - 30 - c;
|
|
3142
3472
|
break;
|
|
3143
3473
|
case "top-left":
|
|
3144
|
-
s.top - r.height -
|
|
3474
|
+
s.top - r.height - n < 0 ? f = s.top - r.height + n + u + l : f = s.top - r.height - n, s.left - r.width - n > 0 ? m = s.left - r.width - n : m = 10;
|
|
3145
3475
|
break;
|
|
3146
3476
|
case "top-start":
|
|
3147
|
-
s.top - r.height -
|
|
3477
|
+
s.top - r.height - n < 0 ? f = s.top - r.height + n + u + l : f = s.top - r.height - n, s.left > 0 ? m = s.left : m = 10;
|
|
3148
3478
|
break;
|
|
3149
3479
|
case "bottom-right":
|
|
3150
|
-
a > p ? f = s.bottom +
|
|
3480
|
+
a > p ? f = s.bottom + n : f = s.bottom - n - u - l, d - i > c ? m = s.left : m = d - 30 - c;
|
|
3151
3481
|
break;
|
|
3152
3482
|
case "bottom-left":
|
|
3153
|
-
a > p ? f = s.bottom +
|
|
3483
|
+
a > p ? f = s.bottom + n : f = s.bottom - n - u - l, s.left > 0 ? m = s.right - c : m = 10;
|
|
3154
3484
|
break;
|
|
3155
3485
|
case "bottom-start":
|
|
3156
|
-
a > p ? f = s.bottom +
|
|
3486
|
+
a > p ? f = s.bottom + n : f = s.bottom - n - u - l, s.left > 0 ? m = s.left : m = 10;
|
|
3157
3487
|
break;
|
|
3158
3488
|
}
|
|
3159
|
-
f + u > a ? f = a - u -
|
|
3489
|
+
f + u > a ? f = a - u - n : f < 0 && (f = n), m + c > d ? m = d - c - n : m < 0 && (m = n), o instanceof HTMLElement && (o.style.top = `${f}px`, o.style.left = `${m}px`, o.style.position = "fixed");
|
|
3160
3490
|
}, _sfc_main$4 = {}, _hoisted_1$2 = {
|
|
3161
3491
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3162
3492
|
viewBox: "0 0 24 24",
|
|
@@ -3184,7 +3514,7 @@ const IconMagnifyingGlass = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render",
|
|
|
3184
3514
|
}, _hoisted_4 = { class: "absolute top-[50%] text-gray-500 translate-y-[-50%] right-[10px] pointer-events-none" }, _hoisted_5 = {
|
|
3185
3515
|
key: 0,
|
|
3186
3516
|
class: "sticky top-[-4px] text-[12px] bg-white p-1 z-[2] px-4 text-gray-400"
|
|
3187
|
-
}, _hoisted_6 = { class: "h-[30px] shrink-0 flex items-center relative justify-center" }, _hoisted_7 = ["onClick"], _hoisted_8 = { class: "flex items-center gap-[8px] w-full" }, _hoisted_9 = { key: 2 }, _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
3517
|
+
}, _hoisted_6 = { class: "h-[30px] shrink-0 flex items-center relative justify-center" }, _hoisted_7 = ["onClick"], _hoisted_8 = { class: "flex items-center gap-[8px] w-full" }, _hoisted_9 = { key: 2 }, _hoisted_10 = { class: "relative" }, _hoisted_11 = { class: "w-full h-full fixed top-0 start-0 z-[80] bg-black bg-opacity-50" }, _hoisted_12 = { class: "m-[10px] fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 min-h-0 h-fit max-h-[80vh] overflow-hidden opacity-1 flex flex-col bg-white dark:bg-[#1A1A1A] border dark:border-[#454545] pointer-events-auto shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-xl lg:w-7/12 w-11/12" }, _hoisted_13 = { class: "py-2.5 px-4 flex justify-between items-center border-0 border-b border-solid border-gray-200 dark:border-b-[#454545]" }, _hoisted_14 = { class: "p-4 mim-h-0 h-full overflow-auto" }, _hoisted_15 = { class: "vs-form__head mb-5 flex items-center justify-end sticky top-0 left-0 z-[60] bg-white" }, _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
3188
3518
|
__name: "vs-input-select",
|
|
3189
3519
|
props: /* @__PURE__ */ mergeModels({
|
|
3190
3520
|
placeholder: { default: "Оберіть значення" },
|
|
@@ -3198,6 +3528,7 @@ const IconMagnifyingGlass = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render",
|
|
|
3198
3528
|
style: { default: () => ({}) },
|
|
3199
3529
|
disabled: { type: Boolean },
|
|
3200
3530
|
mode: {},
|
|
3531
|
+
add: {},
|
|
3201
3532
|
api: {},
|
|
3202
3533
|
search: { type: Boolean },
|
|
3203
3534
|
error: { default: null }
|
|
@@ -3210,183 +3541,278 @@ const IconMagnifyingGlass = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render",
|
|
|
3210
3541
|
}),
|
|
3211
3542
|
emits: ["update:modelValue"],
|
|
3212
3543
|
setup(e) {
|
|
3213
|
-
const t = e,
|
|
3214
|
-
let
|
|
3215
|
-
const
|
|
3544
|
+
const t = e, o = computed(() => t.mode || (t.api || t.search ? "search" : null)), { inputClass: n } = useStyle(t.style), r = useModel(e, "modelValue"), s = ref({}), l = ref(null), i = ref(null), u = ref(!1), c = ref(null), a = ref([]), d = ref(-1), f = ref([]), m = ref(""), p = ref(null);
|
|
3545
|
+
let g = null;
|
|
3546
|
+
const y = ref(!1), x = ref(null), w = ref({}), E = ref({}), C = computed(() => {
|
|
3216
3547
|
if (a.value?.length) {
|
|
3217
|
-
const
|
|
3548
|
+
const v = a.value?.filter((b) => b?.id !== c.value?.id);
|
|
3218
3549
|
return [
|
|
3219
3550
|
c.value
|
|
3220
|
-
].concat(
|
|
3551
|
+
].concat(v)?.filter((b) => b !== null);
|
|
3221
3552
|
}
|
|
3222
3553
|
return [];
|
|
3223
|
-
}),
|
|
3554
|
+
}), _ = async () => {
|
|
3224
3555
|
try {
|
|
3225
|
-
const { data:
|
|
3226
|
-
`${t.host}/${t.prefix}/suggest/${t.data}?json=1&key=${
|
|
3556
|
+
const { data: v } = await axios.get(
|
|
3557
|
+
`${t.host}/${t.prefix}/suggest/${t.data}?json=1&key=${m.value}`
|
|
3227
3558
|
);
|
|
3228
|
-
return
|
|
3559
|
+
return v.data;
|
|
3229
3560
|
} catch {
|
|
3230
3561
|
return [];
|
|
3231
3562
|
}
|
|
3232
|
-
},
|
|
3233
|
-
document.body.click(), u.value =
|
|
3234
|
-
},
|
|
3235
|
-
c.value =
|
|
3236
|
-
},
|
|
3237
|
-
if (!
|
|
3238
|
-
const
|
|
3239
|
-
|
|
3240
|
-
},
|
|
3563
|
+
}, S = async (v) => {
|
|
3564
|
+
document.body.click(), u.value = v !== void 0 ? v : !u.value, u.value && !a.value?.length && (!t.options?.length && t.data ? a.value = await _() : t.options?.length && (a.value = [...t.options])), u.value && l.value ? (s.value.width = `${l.value.getBoundingClientRect()?.width}px`, t.mode === "search" && p.value?.focus(), i.value && dynamicPosition("bottom-start", l.value, i.value)) : d.value = -1;
|
|
3565
|
+
}, B = () => u.value ? S(!1) : null, V = (v) => {
|
|
3566
|
+
c.value = v, r.value = v.id, S(!1);
|
|
3567
|
+
}, A = (v, b) => {
|
|
3568
|
+
if (!v || !b) return;
|
|
3569
|
+
const k = v.offsetTop, N = k + v.offsetHeight, O = b.scrollTop, U = O + b.clientHeight;
|
|
3570
|
+
k < O ? Object.assign(b, { scrollTop: k - 80 }) : N > U && Object.assign(b, { scrollTop: N - b.clientHeight + 4 });
|
|
3571
|
+
}, R = (v) => {
|
|
3241
3572
|
if (!u.value) return;
|
|
3242
|
-
const { keyCode:
|
|
3243
|
-
if ([38, 40, 13].includes(
|
|
3573
|
+
const { keyCode: b } = v;
|
|
3574
|
+
if ([38, 40, 13].includes(b) && v.preventDefault(), b === 38) {
|
|
3244
3575
|
if (d.value === 0) return;
|
|
3245
|
-
d.value -= 1,
|
|
3246
|
-
} else if (
|
|
3247
|
-
if (d.value + 1 >=
|
|
3248
|
-
d.value += 1,
|
|
3249
|
-
} else if (
|
|
3250
|
-
const
|
|
3251
|
-
|
|
3576
|
+
d.value -= 1, A(f.value[d.value], i.value);
|
|
3577
|
+
} else if (b === 40) {
|
|
3578
|
+
if (d.value + 1 >= C.value?.length) return;
|
|
3579
|
+
d.value += 1, A(f.value[d.value], i.value);
|
|
3580
|
+
} else if (b === 13) {
|
|
3581
|
+
const k = C.value[d.value];
|
|
3582
|
+
k && V(k);
|
|
3252
3583
|
}
|
|
3253
|
-
},
|
|
3584
|
+
}, D = async (v) => {
|
|
3254
3585
|
if (u.value) return;
|
|
3255
|
-
const { keyCode:
|
|
3256
|
-
[38, 40].includes(
|
|
3257
|
-
},
|
|
3258
|
-
u.value && l.value && i.value && !i.value.contains(
|
|
3259
|
-
},
|
|
3260
|
-
|
|
3586
|
+
const { keyCode: b } = v;
|
|
3587
|
+
[38, 40].includes(b) && (await v.preventDefault(), d.value = 0, setTimeout(() => S()));
|
|
3588
|
+
}, T = (v) => {
|
|
3589
|
+
u.value && l.value && i.value && !i.value.contains(v.target) && (u.value = !1);
|
|
3590
|
+
}, F = (v) => {
|
|
3591
|
+
v?.key === "Escape" && u.value && S(!1);
|
|
3261
3592
|
};
|
|
3262
|
-
|
|
3263
|
-
addEventListener("click",
|
|
3593
|
+
onMounted(async () => {
|
|
3594
|
+
addEventListener("click", B), addEventListener("keydown", R), addEventListener("scroll", T, !0), addEventListener("keydown", F), t.options && (a.value = t.options), r.value && !t.options?.length && t.data && (a.value = await _()), c.value = a.value?.find((v) => v?.id.toString() === r.value?.toString()) || null;
|
|
3264
3595
|
}), onUnmounted(() => {
|
|
3265
|
-
removeEventListener("click",
|
|
3266
|
-
}), watch(
|
|
3267
|
-
let
|
|
3268
|
-
(
|
|
3269
|
-
!t.options?.length && t.data ? a.value = await
|
|
3596
|
+
removeEventListener("click", B), removeEventListener("keydown", R), removeEventListener("scroll", T, !0), removeEventListener("keydown", F);
|
|
3597
|
+
}), watch(m, (v) => {
|
|
3598
|
+
let b = !1;
|
|
3599
|
+
(v === "" || v.trimStart().length !== 0) && (b = !0), b && (g && clearTimeout(g), g = setTimeout(async () => {
|
|
3600
|
+
!t.options?.length && t.data ? a.value = await _() : a.value = t.options.filter((k) => k.text.toLowerCase().includes(v.toLowerCase()));
|
|
3270
3601
|
}, 200));
|
|
3271
|
-
})
|
|
3272
|
-
|
|
3273
|
-
|
|
3274
|
-
|
|
3275
|
-
|
|
3276
|
-
|
|
3277
|
-
|
|
3278
|
-
|
|
3279
|
-
|
|
3280
|
-
|
|
3281
|
-
|
|
3282
|
-
|
|
3283
|
-
|
|
3284
|
-
|
|
3285
|
-
|
|
3286
|
-
|
|
3287
|
-
|
|
3288
|
-
|
|
3289
|
-
|
|
3290
|
-
|
|
3291
|
-
|
|
3292
|
-
}
|
|
3602
|
+
});
|
|
3603
|
+
async function j() {
|
|
3604
|
+
y.value = !0;
|
|
3605
|
+
const v = await fetch(`/api/template/form/${t.add.form}`).then((b) => b.json());
|
|
3606
|
+
x.value = v.schema;
|
|
3607
|
+
}
|
|
3608
|
+
async function L() {
|
|
3609
|
+
E.value.validate() || (await fetch("/api/table/" + t.add.token, {
|
|
3610
|
+
method: "POST",
|
|
3611
|
+
headers: {
|
|
3612
|
+
"Content-Type": "application/json"
|
|
3613
|
+
},
|
|
3614
|
+
body: JSON.stringify(w.value)
|
|
3615
|
+
}).then((b) => b.json()), y.value = !1);
|
|
3616
|
+
}
|
|
3617
|
+
return (v, b) => (openBlock(), createElementBlock(Fragment, null, [
|
|
3618
|
+
createElementVNode("div", {
|
|
3619
|
+
class: "relative w-full",
|
|
3620
|
+
ref_key: "select",
|
|
3621
|
+
ref: l,
|
|
3622
|
+
onClick: b[5] || (b[5] = withModifiers(() => {
|
|
3623
|
+
}, ["stop"]))
|
|
3293
3624
|
}, [
|
|
3294
|
-
|
|
3625
|
+
createElementVNode("button", {
|
|
3626
|
+
type: "button",
|
|
3627
|
+
class: normalizeClass(["block w-full flex items-center gap-[8px] pl-[16px] py-[5px] bg-white w-[calc(100%)] overflow-ellipsis", [
|
|
3628
|
+
u.value ? `ring-rind ring-2 ring-${v.style?.primaryColor || "blue"}-500` : "",
|
|
3629
|
+
c.value?.text ? "pr-[50px]" : "pr-[25px]",
|
|
3630
|
+
unref(n),
|
|
3631
|
+
v.customClass,
|
|
3632
|
+
{ "!border-red-600": v.error }
|
|
3633
|
+
]]),
|
|
3634
|
+
onKeydown: D,
|
|
3635
|
+
onClick: b[0] || (b[0] = (k) => S(!u.value)),
|
|
3636
|
+
disabled: v.disabled,
|
|
3637
|
+
style: {
|
|
3638
|
+
border: "1px solid #CFD9E0"
|
|
3639
|
+
}
|
|
3640
|
+
}, [
|
|
3641
|
+
c.value?.color ? (openBlock(), createElementBlock("span", {
|
|
3642
|
+
key: 0,
|
|
3643
|
+
class: "w-[16px] h-[16px] rounded-md block",
|
|
3644
|
+
style: normalizeStyle({ backgroundColor: c.value?.color })
|
|
3645
|
+
}, null, 4)) : createCommentVNode("", !0),
|
|
3646
|
+
c.value?.text ? (openBlock(), createElementBlock("span", _hoisted_2, toDisplayString(c.value?.text), 1)) : (openBlock(), createElementBlock("span", _hoisted_3, toDisplayString(v.placeholder), 1))
|
|
3647
|
+
], 42, _hoisted_1$1),
|
|
3648
|
+
createElementVNode("span", _hoisted_4, [
|
|
3649
|
+
createVNode(unref(IconChevronTopBottom), {
|
|
3650
|
+
height: "14",
|
|
3651
|
+
width: "14"
|
|
3652
|
+
})
|
|
3653
|
+
]),
|
|
3654
|
+
c.value?.text ? (openBlock(), createElementBlock("button", {
|
|
3295
3655
|
key: 0,
|
|
3296
|
-
|
|
3297
|
-
|
|
3298
|
-
|
|
3299
|
-
c.value?.text ? (openBlock(), createElementBlock("span", _hoisted_2, toDisplayString(c.value?.text), 1)) : (openBlock(), createElementBlock("span", _hoisted_3, toDisplayString(b.placeholder), 1))
|
|
3300
|
-
], 42, _hoisted_1$1),
|
|
3301
|
-
createElementVNode("span", _hoisted_4, [
|
|
3302
|
-
createVNode(unref(IconChevronTopBottom), {
|
|
3303
|
-
height: "14",
|
|
3304
|
-
width: "14"
|
|
3305
|
-
})
|
|
3306
|
-
]),
|
|
3307
|
-
c.value?.text ? (openBlock(), createElementBlock("button", {
|
|
3308
|
-
key: 0,
|
|
3309
|
-
type: "button",
|
|
3310
|
-
onClick: g[1] || (g[1] = (w) => {
|
|
3311
|
-
r.value = null, c.value = null;
|
|
3312
|
-
}),
|
|
3313
|
-
class: "absolute top-[50%] text-gray-500 translate-y-[-50%] hover:text-red-600 right-[30px]"
|
|
3314
|
-
}, [
|
|
3315
|
-
createVNode(unref(IconClose), {
|
|
3316
|
-
height: "14",
|
|
3317
|
-
width: "14"
|
|
3318
|
-
})
|
|
3319
|
-
])) : createCommentVNode("", !0),
|
|
3320
|
-
(openBlock(), createBlock(Teleport, { to: "body" }, [
|
|
3321
|
-
withDirectives(createElementVNode("ul", {
|
|
3322
|
-
class: "z-[90] border rounded-lg fixed flex flex-col gap-[2px] p-1 bg-white overflow-auto [&::-webkit-scrollbar]:h-2 [&::-webkit-scrollbar]:w-[6px] [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-stone-100 [&::-webkit-scrollbar-thumb]:bg-stone-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500",
|
|
3323
|
-
ref_key: "list",
|
|
3324
|
-
ref: i,
|
|
3325
|
-
style: normalizeStyle({
|
|
3326
|
-
width: s.value.width,
|
|
3327
|
-
maxHeight: b.maxHeight + "px",
|
|
3328
|
-
backgroundColor: "white"
|
|
3656
|
+
type: "button",
|
|
3657
|
+
onClick: b[1] || (b[1] = (k) => {
|
|
3658
|
+
r.value = null, c.value = null;
|
|
3329
3659
|
}),
|
|
3330
|
-
|
|
3331
|
-
}, ["stop"]))
|
|
3660
|
+
class: "absolute top-[50%] text-gray-500 translate-y-[-50%] hover:text-red-600 right-[30px]"
|
|
3332
3661
|
}, [
|
|
3333
|
-
|
|
3334
|
-
|
|
3335
|
-
|
|
3336
|
-
|
|
3337
|
-
|
|
3338
|
-
|
|
3339
|
-
|
|
3340
|
-
|
|
3341
|
-
|
|
3342
|
-
|
|
3343
|
-
|
|
3344
|
-
|
|
3345
|
-
|
|
3346
|
-
|
|
3347
|
-
|
|
3348
|
-
|
|
3349
|
-
|
|
3350
|
-
|
|
3351
|
-
|
|
3352
|
-
|
|
3353
|
-
|
|
3354
|
-
|
|
3355
|
-
|
|
3356
|
-
|
|
3357
|
-
|
|
3358
|
-
|
|
3359
|
-
|
|
3360
|
-
|
|
3361
|
-
|
|
3362
|
-
|
|
3363
|
-
|
|
3364
|
-
|
|
3365
|
-
|
|
3366
|
-
|
|
3367
|
-
|
|
3368
|
-
|
|
3369
|
-
w?.color ? (openBlock(), createElementBlock("span", {
|
|
3662
|
+
createVNode(unref(IconClose), {
|
|
3663
|
+
height: "14",
|
|
3664
|
+
width: "14"
|
|
3665
|
+
})
|
|
3666
|
+
])) : createCommentVNode("", !0),
|
|
3667
|
+
(openBlock(), createBlock(Teleport, { to: "body" }, [
|
|
3668
|
+
withDirectives(createElementVNode("ul", {
|
|
3669
|
+
class: "z-[90] border rounded-lg fixed flex flex-col gap-[2px] p-1 bg-white overflow-auto [&::-webkit-scrollbar]:h-2 [&::-webkit-scrollbar]:w-[6px] [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-stone-100 [&::-webkit-scrollbar-thumb]:bg-stone-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500",
|
|
3670
|
+
ref_key: "list",
|
|
3671
|
+
ref: i,
|
|
3672
|
+
style: normalizeStyle({
|
|
3673
|
+
width: s.value.width,
|
|
3674
|
+
maxHeight: v.maxHeight + "px",
|
|
3675
|
+
backgroundColor: "white"
|
|
3676
|
+
}),
|
|
3677
|
+
onClick: b[4] || (b[4] = withModifiers(() => {
|
|
3678
|
+
}, ["stop"]))
|
|
3679
|
+
}, [
|
|
3680
|
+
o.value === "search" ? (openBlock(), createElementBlock("li", _hoisted_5, [
|
|
3681
|
+
createElementVNode("div", _hoisted_6, [
|
|
3682
|
+
withDirectives(createElementVNode("input", {
|
|
3683
|
+
"onUpdate:modelValue": b[2] || (b[2] = (k) => m.value = k),
|
|
3684
|
+
class: "w-full h-full text-[13px] px-4 border rounded-sm pl-9 focus:outline-none focus:ring-ring focus:ring-1 focus:ring-blue-500",
|
|
3685
|
+
placeholder: "Пошук",
|
|
3686
|
+
type: "text",
|
|
3687
|
+
ref_key: "inputRef",
|
|
3688
|
+
ref: p
|
|
3689
|
+
}, null, 512), [
|
|
3690
|
+
[vModelText, m.value]
|
|
3691
|
+
]),
|
|
3692
|
+
createVNode(IconMagnifyingGlass, {
|
|
3693
|
+
width: "15px",
|
|
3694
|
+
height: "15px",
|
|
3695
|
+
class: "absolute text-gray-400 -translate-y-1/2 left-4 top-1/2"
|
|
3696
|
+
}),
|
|
3697
|
+
m.value != "" ? (openBlock(), createBlock(unref(IconClose), {
|
|
3370
3698
|
key: 0,
|
|
3371
|
-
|
|
3372
|
-
|
|
3373
|
-
|
|
3374
|
-
|
|
3699
|
+
width: "15px",
|
|
3700
|
+
height: "15px",
|
|
3701
|
+
onClick: b[3] || (b[3] = (k) => m.value = ""),
|
|
3702
|
+
class: "absolute text-gray-400 -translate-y-1/2 cursor-pointer hover:text-red-500 right-4 top-1/2"
|
|
3703
|
+
})) : createCommentVNode("", !0)
|
|
3704
|
+
])
|
|
3705
|
+
])) : createCommentVNode("", !0),
|
|
3706
|
+
C.value?.length ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
3707
|
+
b[10] || (b[10] = createElementVNode("li", { class: "sticky top-[-4px] text-[12px] bg-white p-1 z-[2] px-4 text-gray-400" }, " Натисніть Enter для вибору, ↑↓ для навігації, Esc для закриття ", -1)),
|
|
3708
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(C.value, (k, N) => (openBlock(), createElementBlock("li", {
|
|
3709
|
+
onClick: (O) => V(k),
|
|
3710
|
+
key: k?.id,
|
|
3711
|
+
ref_for: !0,
|
|
3712
|
+
ref: (O) => f.value[N] = O,
|
|
3713
|
+
class: normalizeClass(["cursor-pointer relative py-2 px-4 w-full text-[14px] text-gray-700 hover:bg-gray-100 rounded-lg", [d.value == N ? "bg-gray-100" : ""]])
|
|
3714
|
+
}, [
|
|
3715
|
+
createElementVNode("span", _hoisted_8, [
|
|
3716
|
+
k?.color ? (openBlock(), createElementBlock("span", {
|
|
3717
|
+
key: 0,
|
|
3718
|
+
class: "w-[16px] h-[16px] rounded-md block",
|
|
3719
|
+
style: normalizeStyle({ backgroundColor: k?.color })
|
|
3720
|
+
}, null, 4)) : createCommentVNode("", !0),
|
|
3721
|
+
createTextVNode(" " + toDisplayString(k?.text), 1)
|
|
3722
|
+
]),
|
|
3723
|
+
r.value == k?.id ? (openBlock(), createBlock(unref(IconCheck), {
|
|
3724
|
+
key: 0,
|
|
3725
|
+
height: "14",
|
|
3726
|
+
width: "14",
|
|
3727
|
+
"stroke-width": "2",
|
|
3728
|
+
class: "absolute right-[16px] top-[50%] translate-y-[-50%] text-blue-600"
|
|
3729
|
+
})) : createCommentVNode("", !0)
|
|
3730
|
+
], 10, _hoisted_7))), 128))
|
|
3731
|
+
], 64)) : (openBlock(), createElementBlock("li", _hoisted_9, "Дані відсутні"))
|
|
3732
|
+
], 4), [
|
|
3733
|
+
[vShow, u.value]
|
|
3734
|
+
])
|
|
3735
|
+
]))
|
|
3736
|
+
], 512),
|
|
3737
|
+
t.add ? (openBlock(), createElementBlock("button", {
|
|
3738
|
+
key: 0,
|
|
3739
|
+
onClick: j,
|
|
3740
|
+
class: "ml-auto bg-white hover:bg-gray-100 text-sm text-gray-900 leadig-[18.5px] py-[10px] px-[12px] border border-solid border-stone-200 rounded-md h-[38px] max-h-[40px] gap-[8px] flex items-center"
|
|
3741
|
+
}, b[11] || (b[11] = [
|
|
3742
|
+
createElementVNode("svg", {
|
|
3743
|
+
class: "vpbnr cp61q",
|
|
3744
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
3745
|
+
width: "16",
|
|
3746
|
+
height: "16",
|
|
3747
|
+
fill: "currentColor",
|
|
3748
|
+
viewBox: "0 0 16 16"
|
|
3749
|
+
}, [
|
|
3750
|
+
createElementVNode("path", {
|
|
3751
|
+
"fill-rule": "evenodd",
|
|
3752
|
+
"clip-rule": "evenodd",
|
|
3753
|
+
d: "M8 1C8.55228 1 9 1.44772 9 2V7L14 7C14.5523 7 15 7.44771 15 8C15 8.55228 14.5523 9 14 9L9 9V14C9 14.5523 8.55228 15 8 15C7.44772 15 7 14.5523 7 14V9.00001L2 9.00001C1.44772 9.00001 1 8.5523 1 8.00001C0.999999 7.44773 1.44771 7.00001 2 7.00001L7 7.00001V2C7 1.44772 7.44772 1 8 1Z"
|
|
3754
|
+
})
|
|
3755
|
+
], -1),
|
|
3756
|
+
createElementVNode("span", null, "Додати", -1)
|
|
3757
|
+
]))) : createCommentVNode("", !0),
|
|
3758
|
+
(openBlock(), createBlock(Teleport, { to: "body" }, [
|
|
3759
|
+
withDirectives(createElementVNode("div", _hoisted_10, [
|
|
3760
|
+
createElementVNode("div", _hoisted_11, [
|
|
3761
|
+
createElementVNode("div", _hoisted_12, [
|
|
3762
|
+
createElementVNode("div", _hoisted_13, [
|
|
3763
|
+
b[13] || (b[13] = createElementVNode("h3", { class: "font-medium text-gray-800 dark:text-[#ffffff]" }, "Додати", -1)),
|
|
3764
|
+
createElementVNode("button", {
|
|
3765
|
+
onClick: b[6] || (b[6] = (k) => y.value = !1),
|
|
3766
|
+
type: "button",
|
|
3767
|
+
class: "size-8 inline-flex justify-center items-center gap-x-2 rounded-full border border-transparent bg-gray-100 text-gray-800 hover:bg-gray-200 focus:outline-none focus:bg-gray-200 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-700 dark:hover:bg-neutral-600 dark:text-neutral-400 dark:focus:bg-neutral-600"
|
|
3768
|
+
}, b[12] || (b[12] = [
|
|
3769
|
+
createElementVNode("span", { class: "sr-only" }, "Close", -1),
|
|
3770
|
+
createElementVNode("svg", {
|
|
3771
|
+
class: "flex-shrink-0 w-4 h-4",
|
|
3772
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
3773
|
+
width: "24",
|
|
3774
|
+
height: "24",
|
|
3775
|
+
viewBox: "0 0 24 24",
|
|
3776
|
+
fill: "none",
|
|
3777
|
+
stroke: "currentColor",
|
|
3778
|
+
"stroke-width": "2",
|
|
3779
|
+
"stroke-linecap": "round",
|
|
3780
|
+
"stroke-linejoin": "round"
|
|
3781
|
+
}, [
|
|
3782
|
+
createElementVNode("path", { d: "M18 6 6 18" }),
|
|
3783
|
+
createElementVNode("path", { d: "m6 6 12 12" })
|
|
3784
|
+
], -1)
|
|
3785
|
+
]))
|
|
3375
3786
|
]),
|
|
3376
|
-
|
|
3377
|
-
|
|
3378
|
-
|
|
3379
|
-
|
|
3380
|
-
|
|
3381
|
-
|
|
3382
|
-
|
|
3383
|
-
|
|
3384
|
-
|
|
3385
|
-
|
|
3386
|
-
|
|
3787
|
+
createElementVNode("div", _hoisted_14, [
|
|
3788
|
+
x.value ? (openBlock(), createBlock(_sfc_main, {
|
|
3789
|
+
key: 0,
|
|
3790
|
+
schema: x.value,
|
|
3791
|
+
values: w.value,
|
|
3792
|
+
"onUpdate:values": b[7] || (b[7] = (k) => w.value = k),
|
|
3793
|
+
form: E.value,
|
|
3794
|
+
"onUpdate:form": b[8] || (b[8] = (k) => E.value = k)
|
|
3795
|
+
}, null, 8, ["schema", "values", "form"])) : createCommentVNode("", !0),
|
|
3796
|
+
createElementVNode("div", _hoisted_15, [
|
|
3797
|
+
createElementVNode("button", {
|
|
3798
|
+
type: "button",
|
|
3799
|
+
onClick: b[9] || (b[9] = (k) => y.value = !1),
|
|
3800
|
+
class: "vs-button inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border !border-gray-200 hover:text-white bg-white text-red-500 hover:border-red-500 hover:bg-red-500 focus:ring-red-500 py-1.5 px-5 focus:ring-1 focus:ring-offset-1 mr-2"
|
|
3801
|
+
}, " Скасувати "),
|
|
3802
|
+
createElementVNode("button", {
|
|
3803
|
+
onClick: L,
|
|
3804
|
+
type: "button",
|
|
3805
|
+
class: "vs-button inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border-1 border-transparent text-white bg-blue-500 hover:bg-blue-600 focus:ring-blue-500 py-1.5 px-5 focus:ring-1 focus:ring-offset-1"
|
|
3806
|
+
}, " Зберегти ")
|
|
3807
|
+
])
|
|
3808
|
+
])
|
|
3809
|
+
])
|
|
3810
|
+
])
|
|
3811
|
+
], 512), [
|
|
3812
|
+
[vShow, y.value]
|
|
3387
3813
|
])
|
|
3388
3814
|
]))
|
|
3389
|
-
],
|
|
3815
|
+
], 64));
|
|
3390
3816
|
}
|
|
3391
3817
|
}), _hoisted_1 = ["placeholder", "disabled"], _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
3392
3818
|
__name: "vs-input-textarea",
|
|
@@ -3413,36 +3839,37 @@ const IconMagnifyingGlass = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render",
|
|
|
3413
3839
|
}),
|
|
3414
3840
|
emits: ["update:modelValue"],
|
|
3415
3841
|
setup(e) {
|
|
3416
|
-
const t = e, { inputClass:
|
|
3842
|
+
const t = e, { inputClass: o } = useStyle(t.style), n = useModel(e, "modelValue");
|
|
3417
3843
|
return (r, s) => withDirectives((openBlock(), createElementBlock("textarea", {
|
|
3418
|
-
"onUpdate:modelValue": s[0] || (s[0] = (l) =>
|
|
3844
|
+
"onUpdate:modelValue": s[0] || (s[0] = (l) => n.value = l),
|
|
3419
3845
|
placeholder: e.placeholder,
|
|
3420
3846
|
disabled: e.disabled,
|
|
3421
3847
|
row: "2",
|
|
3422
|
-
class: normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f] h-auto", [unref(
|
|
3848
|
+
class: normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f] h-auto", [unref(o)]]),
|
|
3423
3849
|
style: {
|
|
3424
3850
|
border: "1px solid #CFD9E0"
|
|
3425
3851
|
}
|
|
3426
3852
|
}, null, 10, _hoisted_1)), [
|
|
3427
|
-
[vModelText,
|
|
3853
|
+
[vModelText, n.value]
|
|
3428
3854
|
]);
|
|
3429
3855
|
}
|
|
3430
3856
|
}), inputs = {
|
|
3431
|
-
VsInputText: _sfc_main$
|
|
3857
|
+
VsInputText: _sfc_main$C,
|
|
3432
3858
|
VsInputRadio: _sfc_main$l,
|
|
3433
|
-
"vs-input-text": _sfc_main$
|
|
3859
|
+
"vs-input-text": _sfc_main$C,
|
|
3434
3860
|
"vs-input-textarea": _sfc_main$2,
|
|
3435
|
-
"vs-input-mask": _sfc_main$
|
|
3436
|
-
"vs-input-number": _sfc_main$
|
|
3861
|
+
"vs-input-mask": _sfc_main$q,
|
|
3862
|
+
"vs-input-number": _sfc_main$B,
|
|
3437
3863
|
"vs-input-radio": _sfc_main$l,
|
|
3438
3864
|
"vs-input-select": _sfc_main$3,
|
|
3439
|
-
"vs-input-switcher": _sfc_main$
|
|
3440
|
-
"vs-input-static": _sfc_main$
|
|
3865
|
+
"vs-input-switcher": _sfc_main$s,
|
|
3866
|
+
"vs-input-static": _sfc_main$r,
|
|
3441
3867
|
"vs-input-container": _sfc_main$5,
|
|
3442
3868
|
"vs-input-date": _sfc_main$j,
|
|
3443
3869
|
"vs-input-checkbox": VsInputCheckbox,
|
|
3444
3870
|
"vs-input-file": _sfc_main$9,
|
|
3445
|
-
"vs-input-html": _sfc_main$
|
|
3871
|
+
"vs-input-html": _sfc_main$p,
|
|
3872
|
+
"vs-input-email": _sfc_main$o
|
|
3446
3873
|
}, _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
3447
3874
|
__name: "vs-compact-form-layout",
|
|
3448
3875
|
props: {
|
|
@@ -3464,13 +3891,13 @@ const IconMagnifyingGlass = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render",
|
|
|
3464
3891
|
}
|
|
3465
3892
|
},
|
|
3466
3893
|
setup(e) {
|
|
3467
|
-
const t = e,
|
|
3468
|
-
return (r, s) => (openBlock(), createBlock(resolveDynamicComponent(
|
|
3894
|
+
const t = e, o = computed(() => layouts$1[`${t.layout}`]), n = computed(() => inputs?.[`vs-input-${t.type}`]);
|
|
3895
|
+
return (r, s) => (openBlock(), createBlock(resolveDynamicComponent(o.value), mergeProps(r.$attrs, {
|
|
3469
3896
|
style: e.style,
|
|
3470
3897
|
item: e.item
|
|
3471
3898
|
}), {
|
|
3472
3899
|
default: withCtx(() => [
|
|
3473
|
-
(openBlock(), createBlock(resolveDynamicComponent(
|
|
3900
|
+
(openBlock(), createBlock(resolveDynamicComponent(n.value), mergeProps(r.$attrs, { style: e.style }), null, 16, ["style"]))
|
|
3474
3901
|
]),
|
|
3475
3902
|
_: 1
|
|
3476
3903
|
}, 16, ["style", "item"]));
|
|
@@ -3497,9 +3924,10 @@ const IconMagnifyingGlass = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render",
|
|
|
3497
3924
|
}, mathTable = {
|
|
3498
3925
|
autocomplete: "select",
|
|
3499
3926
|
combobox: "select",
|
|
3500
|
-
email: "text",
|
|
3501
3927
|
datepicker: "date",
|
|
3502
|
-
markedtext: "
|
|
3928
|
+
markedtext: "mask",
|
|
3929
|
+
html: "static",
|
|
3930
|
+
filelist: "file"
|
|
3503
3931
|
// mask: 'text',
|
|
3504
3932
|
};
|
|
3505
3933
|
function convertType(e) {
|
|
@@ -3509,43 +3937,43 @@ function convertType(e) {
|
|
|
3509
3937
|
function convertSchema(e) {
|
|
3510
3938
|
if (Array.isArray(e)) return e;
|
|
3511
3939
|
const t = [];
|
|
3512
|
-
return Object.entries(e).forEach((
|
|
3513
|
-
const
|
|
3514
|
-
name:
|
|
3515
|
-
...
|
|
3516
|
-
type: convertType(
|
|
3517
|
-
label:
|
|
3518
|
-
rules:
|
|
3940
|
+
return Object.entries(e).forEach((o) => {
|
|
3941
|
+
const n = {
|
|
3942
|
+
name: o[0],
|
|
3943
|
+
...o[1],
|
|
3944
|
+
type: convertType(o[1].type),
|
|
3945
|
+
label: o[1].label || o[1].ua,
|
|
3946
|
+
rules: o[1].rules || o[1].validators
|
|
3519
3947
|
};
|
|
3520
|
-
n[1].data && (
|
|
3948
|
+
o[1].type.includes("list") && (n.multiple = !0), o[1].data && (n.api = `/api/suggest/${o[1].data}`), t.push(n);
|
|
3521
3949
|
}), t;
|
|
3522
3950
|
}
|
|
3523
3951
|
function useForm(e, t) {
|
|
3524
|
-
const
|
|
3952
|
+
const o = convertSchema(t), n = ref({});
|
|
3525
3953
|
function r(u) {
|
|
3526
3954
|
const c = u?.conditions;
|
|
3527
3955
|
if (!c) return !0;
|
|
3528
3956
|
const a = Array.isArray(c) ? c[0] : c, d = e?.value?.[a];
|
|
3529
3957
|
return isVisible(d, c);
|
|
3530
3958
|
}
|
|
3531
|
-
const s = (u =
|
|
3959
|
+
const s = (u = o, c = !0) => (u.forEach((a) => {
|
|
3532
3960
|
if (a.rules) {
|
|
3533
3961
|
if (!r(a)) {
|
|
3534
|
-
console.log(a.name, "skip hidden"), delete
|
|
3962
|
+
console.log(a.name, "skip hidden"), delete n.value[a.name];
|
|
3535
3963
|
return;
|
|
3536
3964
|
}
|
|
3537
3965
|
a.rules.forEach((d) => {
|
|
3538
3966
|
const f = checkFormRules(e.value[a.name], d);
|
|
3539
|
-
f ?
|
|
3967
|
+
f ? n.value[a.name] = f : delete n.value[a.name];
|
|
3540
3968
|
});
|
|
3541
3969
|
}
|
|
3542
3970
|
a.schema && s(a.schema, !1);
|
|
3543
|
-
}), c && Object.values(
|
|
3971
|
+
}), c && Object.values(n.value).some(Boolean) ? n.value : null), l = computed(() => o?.filter((u) => r(u)));
|
|
3544
3972
|
return {
|
|
3545
|
-
errors:
|
|
3973
|
+
errors: n,
|
|
3546
3974
|
validate: s,
|
|
3547
3975
|
reset: () => {
|
|
3548
|
-
e.value = {},
|
|
3976
|
+
e.value = {}, n.value = {};
|
|
3549
3977
|
},
|
|
3550
3978
|
visibleSchema: l
|
|
3551
3979
|
};
|
|
@@ -3564,17 +3992,17 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
3564
3992
|
}),
|
|
3565
3993
|
emits: /* @__PURE__ */ mergeModels(["handle-submit"], ["update:form", "update:values"]),
|
|
3566
3994
|
setup(e, { emit: t }) {
|
|
3567
|
-
const
|
|
3995
|
+
const o = t, n = e, r = useAttrs(), s = useModel(e, "form"), l = useModel(e, "values"), {
|
|
3568
3996
|
errors: i,
|
|
3569
3997
|
validate: u,
|
|
3570
3998
|
reset: c,
|
|
3571
3999
|
visibleSchema: a
|
|
3572
|
-
} = useForm(l,
|
|
3573
|
-
u(),
|
|
4000
|
+
} = useForm(l, n.schema), d = () => {
|
|
4001
|
+
u(), o("handle-submit", l.value);
|
|
3574
4002
|
};
|
|
3575
4003
|
return onMounted(() => {
|
|
3576
4004
|
s.value.value = l.value, s.value.errors = i.value, s.value.reset = c, s.value.validate = u;
|
|
3577
|
-
}), provide("form", s), provide("values", l), (f,
|
|
4005
|
+
}), provide("form", s), provide("values", l), (f, m) => (openBlock(), createElementBlock("form", {
|
|
3578
4006
|
onSubmit: withModifiers(d, ["prevent"]),
|
|
3579
4007
|
class: normalizeClass(["grid grid-cols-12", f.layout === "default" ? "gap-6" : "gap-4"])
|
|
3580
4008
|
}, [
|
|
@@ -3585,7 +4013,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
3585
4013
|
item: p,
|
|
3586
4014
|
layout: f.layout,
|
|
3587
4015
|
modelValue: l.value[p.name],
|
|
3588
|
-
"onUpdate:modelValue": (
|
|
4016
|
+
"onUpdate:modelValue": (g) => l.value[p.name] = g,
|
|
3589
4017
|
style: f.style,
|
|
3590
4018
|
error: unref(i)[p.name]
|
|
3591
4019
|
}), null, 16, ["class", "item", "layout", "modelValue", "onUpdate:modelValue", "style", "error"]))), 128))
|
|
@@ -3597,6 +4025,6 @@ _sfc_main.install = function e(t) {
|
|
|
3597
4025
|
};
|
|
3598
4026
|
export {
|
|
3599
4027
|
_sfc_main as VForm,
|
|
3600
|
-
_sfc_main$
|
|
4028
|
+
_sfc_main$C as VsInputText,
|
|
3601
4029
|
_sfc_main as default
|
|
3602
4030
|
};
|