@opengis/form 0.0.8 → 0.0.9
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 +600 -814
- package/dist/index.umd.cjs +6 -6
- package/package.json +61 -64
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
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,
|
|
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, createStaticVNode, Transition, vShow, inject, nextTick, onUnmounted, Teleport, useAttrs, provide } from "vue";
|
|
2
2
|
const _hoisted_1$z = { class: "w-full relative" }, _hoisted_2$c = {
|
|
3
3
|
key: 0,
|
|
4
4
|
class: "text-[14px] font-medium text-gray-900 mb-2"
|
|
@@ -149,9 +149,9 @@ const _hoisted_1$w = ["placeholder", "disabled"], _sfc_main$B = /* @__PURE__ */
|
|
|
149
149
|
emits: ["update:modelValue"],
|
|
150
150
|
setup(e) {
|
|
151
151
|
const t = e, { inputClass: n } = useStyle(t.style), o = useModel(e, "modelValue");
|
|
152
|
-
return (
|
|
152
|
+
return (r, s) => withDirectives((openBlock(), createElementBlock("input", {
|
|
153
153
|
type: "text",
|
|
154
|
-
"onUpdate:modelValue":
|
|
154
|
+
"onUpdate:modelValue": s[0] || (s[0] = (l) => o.value = l),
|
|
155
155
|
placeholder: e.placeholder,
|
|
156
156
|
disabled: e.disabled,
|
|
157
157
|
class: normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f]", [unref(n), { "!border-red-600": e.error }]]),
|
|
@@ -180,9 +180,9 @@ const _hoisted_1$w = ["placeholder", "disabled"], _sfc_main$B = /* @__PURE__ */
|
|
|
180
180
|
emits: ["update:modelValue"],
|
|
181
181
|
setup(e) {
|
|
182
182
|
const t = e, { inputClass: n } = useStyle(t.style), o = useModel(e, "modelValue");
|
|
183
|
-
return (
|
|
183
|
+
return (r, s) => withDirectives((openBlock(), createElementBlock("input", {
|
|
184
184
|
type: "number",
|
|
185
|
-
"onUpdate:modelValue":
|
|
185
|
+
"onUpdate:modelValue": s[0] || (s[0] = (l) => o.value = l),
|
|
186
186
|
placeholder: e.placeholder,
|
|
187
187
|
class: normalizeClass(["py-1.5 px-3 block w-full", [unref(n)]]),
|
|
188
188
|
style: {
|
|
@@ -194,8 +194,8 @@ const _hoisted_1$w = ["placeholder", "disabled"], _sfc_main$B = /* @__PURE__ */
|
|
|
194
194
|
}
|
|
195
195
|
}), _export_sfc = (e, t) => {
|
|
196
196
|
const n = e.__vccOpts || e;
|
|
197
|
-
for (const [o,
|
|
198
|
-
n[o] =
|
|
197
|
+
for (const [o, r] of t)
|
|
198
|
+
n[o] = r;
|
|
199
199
|
return n;
|
|
200
200
|
}, _sfc_main$z = {}, _hoisted_1$u = {
|
|
201
201
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -230,27 +230,27 @@ 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 n = t, o = e,
|
|
233
|
+
const n = t, o = e, r = computed({
|
|
234
234
|
get: () => o.modelValue,
|
|
235
|
-
set: (
|
|
235
|
+
set: (s) => n("update:modelValue", s)
|
|
236
236
|
});
|
|
237
|
-
return (
|
|
237
|
+
return (s, l) => (openBlock(), createElementBlock("div", _hoisted_1$t, [
|
|
238
238
|
withDirectives(createElementVNode("input", {
|
|
239
239
|
type: "checkbox",
|
|
240
240
|
value: e.value,
|
|
241
|
-
"onUpdate:modelValue": l[0] || (l[0] = (i) =>
|
|
241
|
+
"onUpdate:modelValue": l[0] || (l[0] = (i) => r.value = i),
|
|
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
245
|
}, null, 10, _hoisted_2$9), [
|
|
246
|
-
[vModelCheckbox,
|
|
246
|
+
[vModelCheckbox, r.value]
|
|
247
247
|
]),
|
|
248
248
|
createElementVNode("label", {
|
|
249
249
|
for: e.id,
|
|
250
250
|
class: normalizeClass(["flex flex-1 checkbox-label items-center gap-x-2 cursor-pointer text-sm text-gray-800 dark:text-neutral-300", { "!cursor-not-allowed": e.disabled }])
|
|
251
251
|
}, [
|
|
252
252
|
createElementVNode("div", {
|
|
253
|
-
class: normalizeClass(["h-[16px] text-white w-[16px] flex items-center justify-center shrink-0 border rounded", [
|
|
253
|
+
class: normalizeClass(["h-[16px] text-white w-[16px] flex items-center justify-center shrink-0 border rounded", [r.value ? "bg-blue-600 border-blue-600" : "bg-white border-gray-600", e.error ? "border-red-600" : ""]])
|
|
254
254
|
}, [
|
|
255
255
|
createVNode(IconCheck, {
|
|
256
256
|
height: "12",
|
|
@@ -258,7 +258,7 @@ const IconCheck = /* @__PURE__ */ _export_sfc(_sfc_main$z, [["render", _sfc_rend
|
|
|
258
258
|
})
|
|
259
259
|
], 2),
|
|
260
260
|
createElementVNode("span", _hoisted_4$3, [
|
|
261
|
-
renderSlot(
|
|
261
|
+
renderSlot(s.$slots, "default", {}, () => [
|
|
262
262
|
createTextVNode(toDisplayString(e.label), 1)
|
|
263
263
|
])
|
|
264
264
|
])
|
|
@@ -285,24 +285,24 @@ 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 n = e, o = t,
|
|
288
|
+
const n = e, o = t, r = computed({
|
|
289
289
|
get: () => n.modelValue,
|
|
290
290
|
set: (i) => {
|
|
291
291
|
o("update:modelValue", i);
|
|
292
292
|
}
|
|
293
|
-
}),
|
|
293
|
+
}), s = computed(() => Array.isArray(r.value) ? r.value.includes(n.value) : r.value === !0 || r.value === n.value), l = computed(() => n.style?.size === "xs" ? "p-1.5 text-xs" : n.style?.size === "lg" ? "p-3.5 text-[20px]" : "p-2.5 text-xs");
|
|
294
294
|
return (i, u) => (openBlock(), createElementBlock("label", {
|
|
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,
|
|
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
|
}, [
|
|
297
297
|
withDirectives(createElementVNode("input", {
|
|
298
298
|
type: "checkbox",
|
|
299
299
|
class: "hidden",
|
|
300
300
|
name: e.id,
|
|
301
301
|
value: e.value,
|
|
302
|
-
"onUpdate:modelValue": u[0] || (u[0] = (c) =>
|
|
302
|
+
"onUpdate:modelValue": u[0] || (u[0] = (c) => r.value = c),
|
|
303
303
|
disabled: e.disabled
|
|
304
304
|
}, null, 8, _hoisted_1$s), [
|
|
305
|
-
[vModelCheckbox,
|
|
305
|
+
[vModelCheckbox, r.value]
|
|
306
306
|
]),
|
|
307
307
|
createElementVNode("span", _hoisted_2$8, [
|
|
308
308
|
e.icon || e.imgUrl ? (openBlock(), createElementBlock("span", _hoisted_3$3, [
|
|
@@ -347,7 +347,7 @@ 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 n = e, o = t,
|
|
350
|
+
const n = e, o = t, r = `radio-${Math.floor(Math.random() * 1e4)}`, s = computed({
|
|
351
351
|
get: () => Array.isArray(n.modelValue) ? Array.isArray(n.modelValue) && n.modelValue.includes(n.value) : n.modelValue,
|
|
352
352
|
set: (i) => {
|
|
353
353
|
if (Array.isArray(n.modelValue)) {
|
|
@@ -363,9 +363,9 @@ const IconCheck = /* @__PURE__ */ _export_sfc(_sfc_main$z, [["render", _sfc_rend
|
|
|
363
363
|
label: e.label,
|
|
364
364
|
info: e.option?.info,
|
|
365
365
|
disabled: e.disabled,
|
|
366
|
-
modelValue:
|
|
367
|
-
"onUpdate:modelValue": u[0] || (u[0] = (c) =>
|
|
368
|
-
id:
|
|
366
|
+
modelValue: s.value,
|
|
367
|
+
"onUpdate:modelValue": u[0] || (u[0] = (c) => s.value = c),
|
|
368
|
+
id: r,
|
|
369
369
|
icon: e.icon,
|
|
370
370
|
imgUrl: e.imgUrl,
|
|
371
371
|
style: normalizeStyle(e.style),
|
|
@@ -378,199 +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
|
-
})
|
|
382
|
-
defineComponent({
|
|
383
|
-
props: {
|
|
384
|
-
modelValue: { type: Boolean, default: () => !1 },
|
|
385
|
-
title: { type: String, default: () => "" },
|
|
386
|
-
disabled: { type: Boolean, default: () => !1 }
|
|
387
|
-
},
|
|
388
|
-
data() {
|
|
389
|
-
return {};
|
|
390
|
-
},
|
|
391
|
-
mounted() {
|
|
392
|
-
this.modelValue || this.$emit("update:modelValue", !1);
|
|
393
|
-
},
|
|
394
|
-
computed: {
|
|
395
|
-
modelState: {
|
|
396
|
-
get() {
|
|
397
|
-
return this.modelValue;
|
|
398
|
-
},
|
|
399
|
-
set(e) {
|
|
400
|
-
this.$emit("update:modelValue", e);
|
|
401
|
-
}
|
|
402
|
-
},
|
|
403
|
-
labelCursorClasses() {
|
|
404
|
-
return [
|
|
405
|
-
{ "cursor-not-allowed": this.disabled },
|
|
406
|
-
{ "cursor-pointer": !this.disabled }
|
|
407
|
-
];
|
|
408
|
-
}
|
|
409
|
-
},
|
|
410
|
-
methods: {
|
|
411
|
-
handleEnterDown(e) {
|
|
412
|
-
const { keyCode: t } = e;
|
|
413
|
-
t === 13 && (this.modelState = !this.modelState);
|
|
414
|
-
},
|
|
415
|
-
addKeyHandler() {
|
|
416
|
-
window.addEventListener("keydown", this.handleEnterDown);
|
|
417
|
-
},
|
|
418
|
-
removeKeyHandler() {
|
|
419
|
-
window.removeEventListener("keydown", this.handleEnterDown);
|
|
420
|
-
}
|
|
421
|
-
}
|
|
422
|
-
});
|
|
423
|
-
const I = async (e, t, n, o = 10) => {
|
|
424
|
-
if (!t || !n) return;
|
|
425
|
-
await nextTick();
|
|
426
|
-
const s = await n?.getBoundingClientRect(), r = await t?.getBoundingClientRect();
|
|
427
|
-
if (!r || !s) return;
|
|
428
|
-
const l = await parseInt(t?.getBoundingClientRect()?.height), i = await parseInt(t?.getBoundingClientRect()?.width), u = await parseInt(n?.getBoundingClientRect()?.height), c = await parseInt(n?.getBoundingClientRect()?.width), a = await window.innerHeight, f = await window.innerWidth;
|
|
429
|
-
let d = 0, p = 0;
|
|
430
|
-
const m = r.bottom + o + u;
|
|
431
|
-
switch (e) {
|
|
432
|
-
case "top":
|
|
433
|
-
r.top - s.height - o < 0 ? d = r.top - s.height + o + u + l : d = r.top - s.height - o, f > c + r.right + 30 ? p = r.left - s.width / 2 + r.width / 2 : p = f - 30 - c;
|
|
434
|
-
break;
|
|
435
|
-
case "bottom":
|
|
436
|
-
a > m ? d = r.bottom + o : d = r.bottom - o - u - l, p = r.left - s.width / 2 + r.width / 2;
|
|
437
|
-
break;
|
|
438
|
-
case "left":
|
|
439
|
-
d = r.top - s.height / 2 + r.height / 2, r.left - s.width - o > 0 ? p = r.left - s.width - o : p = 10;
|
|
440
|
-
break;
|
|
441
|
-
case "right":
|
|
442
|
-
d = r.top - s.height / 2 + r.height / 2, f - i > c ? p = r.right + o : p = f - 30 - c;
|
|
443
|
-
break;
|
|
444
|
-
case "top-right":
|
|
445
|
-
r.top - s.height - o < 0 ? d = r.top - s.height + o + u + l : d = r.top - s.height - o, f - i > c ? p = r.right + o : p = f - 30 - c;
|
|
446
|
-
break;
|
|
447
|
-
case "top-left":
|
|
448
|
-
r.top - s.height - o < 0 ? d = r.top - s.height + o + u + l : d = r.top - s.height - o, r.left - s.width - o > 0 ? p = r.left - s.width - o : p = 10;
|
|
449
|
-
break;
|
|
450
|
-
case "top-start":
|
|
451
|
-
r.top - s.height - o < 0 ? d = r.top - s.height + o + u + l : d = r.top - s.height - o, r.left > 0 ? p = r.left : p = 10;
|
|
452
|
-
break;
|
|
453
|
-
case "bottom-right":
|
|
454
|
-
a > m ? d = r.bottom + o : d = r.bottom - o - u - l, f - i > c ? p = r.left : p = f - 30 - c;
|
|
455
|
-
break;
|
|
456
|
-
case "bottom-left":
|
|
457
|
-
a > m ? d = r.bottom + o : d = r.bottom - o - u - l, r.left > 0 ? p = r.right - c : p = 10;
|
|
458
|
-
break;
|
|
459
|
-
case "bottom-start":
|
|
460
|
-
a > m ? d = r.bottom + o : d = r.bottom - o - u - l, r.left > 0 ? p = r.left : p = 10;
|
|
461
|
-
break;
|
|
462
|
-
}
|
|
463
|
-
d + u > a ? d = a - u - o : d < 0 && (d = o), p + c > f ? p = f - c - o : p < 0 && (p = o), n instanceof HTMLElement && (n.style.top = `${d}px`, n.style.left = `${p}px`, n.style.position = "fixed");
|
|
464
|
-
}, Ae = { class: "text-center" }, Ke = { class: "py-2 px-4 w-full text-sm text-stone-800 bg-white shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-lg focus:outline-none focus:bg-stone-100 dark:bg-neutral-900 dark:text-neutral-200 dark:focus:bg-neutral-800 after:h-4 after:absolute after:-bottom-4 after:start-0 after:w-full before:h-4 before:absolute before:-top-4 before:start-0 before:w-full" }, qe = {
|
|
465
|
-
__name: "vs-popover",
|
|
466
|
-
props: {
|
|
467
|
-
isOpen: { type: Boolean, default: () => !1 },
|
|
468
|
-
placement: { type: String, default: "top" },
|
|
469
|
-
gap: { type: Number, default: 8 },
|
|
470
|
-
width: { type: [String, Number], default: "" },
|
|
471
|
-
disabled: { type: Boolean, default: !1 },
|
|
472
|
-
trigger: { type: String, default: "click" },
|
|
473
|
-
teleport: { type: String, default: "body" }
|
|
474
|
-
},
|
|
475
|
-
emits: ["isvisible"],
|
|
476
|
-
setup(e, { expose: t, emit: n }) {
|
|
477
|
-
const o = e, s = n, r = ref(!1), l = ref([]), i = ref(null), u = ref(null), c = ref(null), a = (g) => {
|
|
478
|
-
if (!g) {
|
|
479
|
-
r.value = !1;
|
|
480
|
-
return;
|
|
481
|
-
}
|
|
482
|
-
u.value?.contains(g.target) || c.value?.contains(g.target) || (r.value = !1);
|
|
483
|
-
}, f = (g) => {
|
|
484
|
-
r.value && c.value && !c.value.contains(g.target) && (r.value = !1);
|
|
485
|
-
}, d = () => {
|
|
486
|
-
r.value = !1;
|
|
487
|
-
}, p = () => {
|
|
488
|
-
r.value && (r.value = !1);
|
|
489
|
-
}, m = () => {
|
|
490
|
-
let g = i.value;
|
|
491
|
-
for (; g && g !== document.body; )
|
|
492
|
-
(g.scrollHeight > g.clientHeight || g.scrollWidth > g.clientWidth) && (g.addEventListener("scroll", d), l.value.push(g)), g = g.parentElement;
|
|
493
|
-
document.body && (document.body.addEventListener("scroll", d), l.value.push(document.body));
|
|
494
|
-
}, y = () => {
|
|
495
|
-
l.value.forEach((g) => {
|
|
496
|
-
g.removeEventListener("scroll", d);
|
|
497
|
-
}), l.value = [];
|
|
498
|
-
};
|
|
499
|
-
watch(r, (g) => {
|
|
500
|
-
g ? (m(), window.addEventListener("resize", () => I(o.placement, u.value, c.value)), I(o.placement, u.value, c.value)) : window.removeEventListener("resize", () => I(o.placement, u.value, c.value)), s("isvisible", g);
|
|
501
|
-
}), onMounted(() => {
|
|
502
|
-
window.addEventListener("click", a), window.addEventListener("popstate", p), window.addEventListener("scroll", f, !0), m();
|
|
503
|
-
}), onBeforeUnmount(() => {
|
|
504
|
-
window.removeEventListener("click", a), window.removeEventListener("popstate", p), y();
|
|
505
|
-
});
|
|
506
|
-
const h = () => {
|
|
507
|
-
r.value = !0, I(o.placement, u.value, c.value);
|
|
508
|
-
}, w = () => {
|
|
509
|
-
r.value = !1;
|
|
510
|
-
}, x = async () => {
|
|
511
|
-
await I(o.placement, u.value, c.value), r.value = !r.value;
|
|
512
|
-
};
|
|
513
|
-
return t({
|
|
514
|
-
togglePopover: x
|
|
515
|
-
}), (g, k) => (openBlock(), createElementBlock("div", {
|
|
516
|
-
ref_key: "popover",
|
|
517
|
-
ref: i,
|
|
518
|
-
class: "vs-popover inline-block"
|
|
519
|
-
}, [
|
|
520
|
-
createElementVNode("div", Ae, [
|
|
521
|
-
e.trigger === "click" ? (openBlock(), createElementBlock("div", {
|
|
522
|
-
key: 0,
|
|
523
|
-
ref_key: "popoverRef",
|
|
524
|
-
ref: u,
|
|
525
|
-
onClick: x,
|
|
526
|
-
class: normalizeClass({ "pointer-events-none": e.disabled })
|
|
527
|
-
}, [
|
|
528
|
-
renderSlot(g.$slots, "reference", {}, () => [
|
|
529
|
-
k[0] || (k[0] = createElementVNode("button", null, "Click me!", -1))
|
|
530
|
-
])
|
|
531
|
-
], 2)) : createCommentVNode("", !0),
|
|
532
|
-
e.trigger === "hover" ? (openBlock(), createElementBlock("div", {
|
|
533
|
-
key: 1,
|
|
534
|
-
ref_key: "popoverRef",
|
|
535
|
-
ref: u,
|
|
536
|
-
onMouseover: h,
|
|
537
|
-
onMouseleave: w,
|
|
538
|
-
class: normalizeClass({ "pointer-events-none": e.disabled })
|
|
539
|
-
}, [
|
|
540
|
-
renderSlot(g.$slots, "reference", {}, () => [
|
|
541
|
-
k[1] || (k[1] = createElementVNode("button", null, "Click me!", -1))
|
|
542
|
-
])
|
|
543
|
-
], 34)) : createCommentVNode("", !0),
|
|
544
|
-
(openBlock(), createBlock(Teleport, { to: e.teleport }, [
|
|
545
|
-
createVNode(Transition, { name: "fade" }, {
|
|
546
|
-
default: withCtx(() => [
|
|
547
|
-
withDirectives(createElementVNode("div", {
|
|
548
|
-
class: normalizeClass(["vsTailwind vs-popover__content", e.placement]),
|
|
549
|
-
ref_key: "contentPop",
|
|
550
|
-
ref: c,
|
|
551
|
-
style: normalizeStyle({
|
|
552
|
-
width: e.width ? e.width + "px" : "fit-content",
|
|
553
|
-
zIndex: 10002
|
|
554
|
-
})
|
|
555
|
-
}, [
|
|
556
|
-
createElementVNode("div", Ke, [
|
|
557
|
-
renderSlot(g.$slots, "default", {}, () => [
|
|
558
|
-
k[2] || (k[2] = createElementVNode("span", null, "Popover content", -1))
|
|
559
|
-
])
|
|
560
|
-
])
|
|
561
|
-
], 6), [
|
|
562
|
-
[vShow, r.value]
|
|
563
|
-
])
|
|
564
|
-
]),
|
|
565
|
-
_: 3
|
|
566
|
-
})
|
|
567
|
-
], 8, ["to"]))
|
|
568
|
-
])
|
|
569
|
-
], 512));
|
|
570
|
-
}
|
|
571
|
-
};
|
|
572
|
-
reactive({ visible: !0 });
|
|
573
|
-
const _sfc_main$v = {}, _hoisted_1$q = {
|
|
381
|
+
}), _sfc_main$v = {}, _hoisted_1$q = {
|
|
574
382
|
xmlns: "http://www.w3.org/2000/svg",
|
|
575
383
|
viewBox: "0 0 24 24",
|
|
576
384
|
fill: "none",
|
|
@@ -655,7 +463,7 @@ const IconInfo = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["render", _sfc_rende
|
|
|
655
463
|
}, _hoisted_2$7 = {
|
|
656
464
|
key: 0,
|
|
657
465
|
class: "text-red-500 text-[14px]"
|
|
658
|
-
}, _hoisted_3$2 =
|
|
466
|
+
}, _hoisted_3$2 = ["title"], _hoisted_4$1 = ["disabled"], _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
659
467
|
__name: "vs-input-switcher",
|
|
660
468
|
props: /* @__PURE__ */ mergeModels({
|
|
661
469
|
view: {
|
|
@@ -704,40 +512,32 @@ const IconInfo = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["render", _sfc_rende
|
|
|
704
512
|
return (n, o) => e.view === "checkbox" ? (openBlock(), createElementBlock("div", _hoisted_1$m, [
|
|
705
513
|
createVNode(_sfc_main$w, {
|
|
706
514
|
modelValue: t.value,
|
|
707
|
-
"onUpdate:modelValue": o[0] || (o[0] = (
|
|
515
|
+
"onUpdate:modelValue": o[0] || (o[0] = (r) => t.value = r),
|
|
708
516
|
label: e.text,
|
|
709
517
|
error: e.error
|
|
710
518
|
}, null, 8, ["modelValue", "label", "error"]),
|
|
711
519
|
e.rules?.includes("required") ? (openBlock(), createElementBlock("span", _hoisted_2$7, "*")) : createCommentVNode("", !0),
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
]),
|
|
722
|
-
default: withCtx(() => [
|
|
723
|
-
createElementVNode("div", _hoisted_3$2, [
|
|
724
|
-
createElementVNode("p", _hoisted_4$1, toDisplayString(e.i), 1)
|
|
725
|
-
])
|
|
726
|
-
]),
|
|
727
|
-
_: 1
|
|
728
|
-
})
|
|
520
|
+
e.i ? (openBlock(), createElementBlock("button", {
|
|
521
|
+
key: 1,
|
|
522
|
+
class: "cursor-pointer",
|
|
523
|
+
title: e.i,
|
|
524
|
+
onClick: o[1] || (o[1] = withModifiers(() => {
|
|
525
|
+
}, ["prevent"]))
|
|
526
|
+
}, [
|
|
527
|
+
createVNode(unref(IconInfo), { class: "text-gray-500 w-[14px] h-[14px]" })
|
|
528
|
+
], 8, _hoisted_3$2)) : createCommentVNode("", !0)
|
|
729
529
|
])) : (openBlock(), createElementBlock("button", {
|
|
730
530
|
key: 1,
|
|
731
531
|
type: "button",
|
|
732
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`, e.customClass]]),
|
|
733
533
|
disabled: e.disabled,
|
|
734
|
-
onClick: o[2] || (o[2] = (
|
|
534
|
+
onClick: o[2] || (o[2] = (r) => t.value = !t.value)
|
|
735
535
|
}, [
|
|
736
536
|
createElementVNode("span", {
|
|
737
537
|
"data-state": "checked",
|
|
738
538
|
class: normalizeClass(["pointer-events-none block h-4 w-4 rounded-full bg-white shadow-lg ring-0 transition-transform", [t.value ? "translate-x-4" : "translate-x-0"]])
|
|
739
539
|
}, null, 2)
|
|
740
|
-
], 10,
|
|
540
|
+
], 10, _hoisted_4$1));
|
|
741
541
|
}
|
|
742
542
|
}), _hoisted_1$l = ["innerHTML"], _sfc_main$q = /* @__PURE__ */ defineComponent({
|
|
743
543
|
__name: "vs-input-static",
|
|
@@ -783,9 +583,9 @@ const IconInfo = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["render", _sfc_rende
|
|
|
783
583
|
emits: ["update:modelValue"],
|
|
784
584
|
setup(e) {
|
|
785
585
|
const t = e, { inputClass: n } = useStyle(t.style), o = useModel(e, "modelValue");
|
|
786
|
-
return (
|
|
586
|
+
return (r, s) => withDirectives((openBlock(), createElementBlock("input", {
|
|
787
587
|
type: "text",
|
|
788
|
-
"onUpdate:modelValue":
|
|
588
|
+
"onUpdate:modelValue": s[0] || (s[0] = (l) => o.value = l),
|
|
789
589
|
placeholder: e.placeholder,
|
|
790
590
|
disabled: e.disabled,
|
|
791
591
|
class: normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f]", [unref(n)]]),
|
|
@@ -846,7 +646,7 @@ const IconInfo = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["render", _sfc_rende
|
|
|
846
646
|
class: normalizeClass(["flex items-center gap-0", [e.customClass]])
|
|
847
647
|
}, [
|
|
848
648
|
withDirectives(createElementVNode("input", {
|
|
849
|
-
"onUpdate:modelValue": o[0] || (o[0] = (
|
|
649
|
+
"onUpdate:modelValue": o[0] || (o[0] = (r) => t.value = r),
|
|
850
650
|
type: "radio",
|
|
851
651
|
value: e.value,
|
|
852
652
|
disabled: e.disabled,
|
|
@@ -905,7 +705,7 @@ const IconInfo = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["render", _sfc_rende
|
|
|
905
705
|
]])
|
|
906
706
|
}, [
|
|
907
707
|
withDirectives(createElementVNode("input", {
|
|
908
|
-
"onUpdate:modelValue": o[0] || (o[0] = (
|
|
708
|
+
"onUpdate:modelValue": o[0] || (o[0] = (r) => t.value = r),
|
|
909
709
|
type: "radio",
|
|
910
710
|
value: e.value,
|
|
911
711
|
disabled: e.disabled,
|
|
@@ -941,7 +741,7 @@ const IconInfo = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["render", _sfc_rende
|
|
|
941
741
|
emits: ["update:modelValue"],
|
|
942
742
|
setup(e) {
|
|
943
743
|
const t = e, n = useModel(e, "modelValue"), o = computed(() => layouts[`vs-input-radio-${t.view}`]);
|
|
944
|
-
return (
|
|
744
|
+
return (r, s) => (openBlock(), createElementBlock("div", {
|
|
945
745
|
class: normalizeClass([e.position === "horizontal" ? "flex items-center flex-wrap gap-2" : ""])
|
|
946
746
|
}, [
|
|
947
747
|
(openBlock(!0), createElementBlock(Fragment, null, renderList(e.options, (l) => (openBlock(), createBlock(resolveDynamicComponent(o.value), mergeProps({
|
|
@@ -950,8 +750,8 @@ const IconInfo = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["render", _sfc_rende
|
|
|
950
750
|
value: l.id.toString(),
|
|
951
751
|
checked: n.value === l.id,
|
|
952
752
|
modelValue: n.value,
|
|
953
|
-
"onUpdate:modelValue":
|
|
954
|
-
}, { ref_for: !0 },
|
|
753
|
+
"onUpdate:modelValue": s[0] || (s[0] = (i) => n.value = i)
|
|
754
|
+
}, { ref_for: !0 }, r.$attrs), null, 16, ["text", "value", "checked", "modelValue"]))), 128))
|
|
955
755
|
], 2));
|
|
956
756
|
}
|
|
957
757
|
});
|
|
@@ -977,14 +777,6 @@ const isString = typeOfTest("string"), isFunction = typeOfTest("function"), isNu
|
|
|
977
777
|
return !1;
|
|
978
778
|
const t = getPrototypeOf(e);
|
|
979
779
|
return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(toStringTag in e) && !(iterator in e);
|
|
980
|
-
}, isEmptyObject = (e) => {
|
|
981
|
-
if (!isObject(e) || isBuffer(e))
|
|
982
|
-
return !1;
|
|
983
|
-
try {
|
|
984
|
-
return Object.keys(e).length === 0 && Object.getPrototypeOf(e) === Object.prototype;
|
|
985
|
-
} catch {
|
|
986
|
-
return !1;
|
|
987
|
-
}
|
|
988
780
|
}, isDate = kindOfTest("Date"), isFile = kindOfTest("File"), isBlob = kindOfTest("Blob"), isFileList = kindOfTest("FileList"), isStream = (e) => isObject(e) && isFunction(e.pipe), isFormData = (e) => {
|
|
989
781
|
let t;
|
|
990
782
|
return e && (typeof FormData == "function" && e instanceof FormData || isFunction(e.append) && ((t = kindOf(e)) === "formdata" || // detect form-data instance
|
|
@@ -993,53 +785,49 @@ const isString = typeOfTest("string"), isFunction = typeOfTest("function"), isNu
|
|
|
993
785
|
function forEach(e, t, { allOwnKeys: n = !1 } = {}) {
|
|
994
786
|
if (e === null || typeof e > "u")
|
|
995
787
|
return;
|
|
996
|
-
let o,
|
|
788
|
+
let o, r;
|
|
997
789
|
if (typeof e != "object" && (e = [e]), isArray(e))
|
|
998
|
-
for (o = 0,
|
|
790
|
+
for (o = 0, r = e.length; o < r; o++)
|
|
999
791
|
t.call(null, e[o], o, e);
|
|
1000
792
|
else {
|
|
1001
|
-
|
|
1002
|
-
return;
|
|
1003
|
-
const r = n ? Object.getOwnPropertyNames(e) : Object.keys(e), l = r.length;
|
|
793
|
+
const s = n ? Object.getOwnPropertyNames(e) : Object.keys(e), l = s.length;
|
|
1004
794
|
let i;
|
|
1005
795
|
for (o = 0; o < l; o++)
|
|
1006
|
-
i =
|
|
796
|
+
i = s[o], t.call(null, e[i], i, e);
|
|
1007
797
|
}
|
|
1008
798
|
}
|
|
1009
799
|
function findKey(e, t) {
|
|
1010
|
-
if (isBuffer(e))
|
|
1011
|
-
return null;
|
|
1012
800
|
t = t.toLowerCase();
|
|
1013
801
|
const n = Object.keys(e);
|
|
1014
|
-
let o = n.length,
|
|
802
|
+
let o = n.length, r;
|
|
1015
803
|
for (; o-- > 0; )
|
|
1016
|
-
if (
|
|
1017
|
-
return
|
|
804
|
+
if (r = n[o], t === r.toLowerCase())
|
|
805
|
+
return r;
|
|
1018
806
|
return null;
|
|
1019
807
|
}
|
|
1020
808
|
const _global = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, isContextDefined = (e) => !isUndefined(e) && e !== _global;
|
|
1021
809
|
function merge() {
|
|
1022
|
-
const { caseless: e } = isContextDefined(this) && this || {}, t = {}, n = (o,
|
|
1023
|
-
const
|
|
1024
|
-
isPlainObject(t[
|
|
810
|
+
const { caseless: e } = isContextDefined(this) && this || {}, t = {}, n = (o, r) => {
|
|
811
|
+
const s = e && findKey(t, r) || r;
|
|
812
|
+
isPlainObject(t[s]) && isPlainObject(o) ? t[s] = merge(t[s], o) : isPlainObject(o) ? t[s] = merge({}, o) : isArray(o) ? t[s] = o.slice() : t[s] = o;
|
|
1025
813
|
};
|
|
1026
|
-
for (let o = 0,
|
|
814
|
+
for (let o = 0, r = arguments.length; o < r; o++)
|
|
1027
815
|
arguments[o] && forEach(arguments[o], n);
|
|
1028
816
|
return t;
|
|
1029
817
|
}
|
|
1030
|
-
const extend = (e, t, n, { allOwnKeys: o } = {}) => (forEach(t, (
|
|
1031
|
-
n && isFunction(
|
|
818
|
+
const extend = (e, t, n, { allOwnKeys: o } = {}) => (forEach(t, (r, s) => {
|
|
819
|
+
n && isFunction(r) ? e[s] = bind(r, n) : e[s] = r;
|
|
1032
820
|
}, { allOwnKeys: o }), e), stripBOM = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), inherits = (e, t, n, o) => {
|
|
1033
821
|
e.prototype = Object.create(t.prototype, o), e.prototype.constructor = e, Object.defineProperty(e, "super", {
|
|
1034
822
|
value: t.prototype
|
|
1035
823
|
}), n && Object.assign(e.prototype, n);
|
|
1036
824
|
}, toFlatObject = (e, t, n, o) => {
|
|
1037
|
-
let
|
|
825
|
+
let r, s, l;
|
|
1038
826
|
const i = {};
|
|
1039
827
|
if (t = t || {}, e == null) return t;
|
|
1040
828
|
do {
|
|
1041
|
-
for (
|
|
1042
|
-
l = s
|
|
829
|
+
for (r = Object.getOwnPropertyNames(e), s = r.length; s-- > 0; )
|
|
830
|
+
l = r[s], (!o || o(l, e, t)) && !i[l] && (t[l] = e[l], i[l] = !0);
|
|
1043
831
|
e = n !== !1 && getPrototypeOf(e);
|
|
1044
832
|
} while (e && (!n || n(e, t)) && e !== Object.prototype);
|
|
1045
833
|
return t;
|
|
@@ -1058,10 +846,10 @@ const extend = (e, t, n, { allOwnKeys: o } = {}) => (forEach(t, (s, r) => {
|
|
|
1058
846
|
return n;
|
|
1059
847
|
}, isTypedArray = /* @__PURE__ */ ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" && getPrototypeOf(Uint8Array)), forEachEntry = (e, t) => {
|
|
1060
848
|
const o = (e && e[iterator]).call(e);
|
|
1061
|
-
let
|
|
1062
|
-
for (; (
|
|
1063
|
-
const
|
|
1064
|
-
t.call(e,
|
|
849
|
+
let r;
|
|
850
|
+
for (; (r = o.next()) && !r.done; ) {
|
|
851
|
+
const s = r.value;
|
|
852
|
+
t.call(e, s[0], s[1]);
|
|
1065
853
|
}
|
|
1066
854
|
}, matchAll = (e, t) => {
|
|
1067
855
|
let n;
|
|
@@ -1071,14 +859,14 @@ const extend = (e, t, n, { allOwnKeys: o } = {}) => (forEach(t, (s, r) => {
|
|
|
1071
859
|
return o;
|
|
1072
860
|
}, isHTMLForm = kindOfTest("HTMLFormElement"), toCamelCase = (e) => e.toLowerCase().replace(
|
|
1073
861
|
/[-_\s]([a-z\d])(\w*)/g,
|
|
1074
|
-
function(n, o,
|
|
1075
|
-
return o.toUpperCase() +
|
|
862
|
+
function(n, o, r) {
|
|
863
|
+
return o.toUpperCase() + r;
|
|
1076
864
|
}
|
|
1077
865
|
), hasOwnProperty = (({ hasOwnProperty: e }) => (t, n) => e.call(t, n))(Object.prototype), isRegExp = kindOfTest("RegExp"), reduceDescriptors = (e, t) => {
|
|
1078
866
|
const n = Object.getOwnPropertyDescriptors(e), o = {};
|
|
1079
|
-
forEach(n, (
|
|
867
|
+
forEach(n, (r, s) => {
|
|
1080
868
|
let l;
|
|
1081
|
-
(l = t(
|
|
869
|
+
(l = t(r, s, e)) !== !1 && (o[s] = l || r);
|
|
1082
870
|
}), Object.defineProperties(e, o);
|
|
1083
871
|
}, freezeMethods = (e) => {
|
|
1084
872
|
reduceDescriptors(e, (t, n) => {
|
|
@@ -1096,9 +884,9 @@ const extend = (e, t, n, { allOwnKeys: o } = {}) => (forEach(t, (s, r) => {
|
|
|
1096
884
|
}
|
|
1097
885
|
});
|
|
1098
886
|
}, toObjectSet = (e, t) => {
|
|
1099
|
-
const n = {}, o = (
|
|
1100
|
-
|
|
1101
|
-
n[
|
|
887
|
+
const n = {}, o = (r) => {
|
|
888
|
+
r.forEach((s) => {
|
|
889
|
+
n[s] = !0;
|
|
1102
890
|
});
|
|
1103
891
|
};
|
|
1104
892
|
return isArray(e) ? o(e) : o(String(e).split(t)), n;
|
|
@@ -1108,28 +896,26 @@ function isSpecCompliantForm(e) {
|
|
|
1108
896
|
return !!(e && isFunction(e.append) && e[toStringTag] === "FormData" && e[iterator]);
|
|
1109
897
|
}
|
|
1110
898
|
const toJSONObject = (e) => {
|
|
1111
|
-
const t = new Array(10), n = (o,
|
|
899
|
+
const t = new Array(10), n = (o, r) => {
|
|
1112
900
|
if (isObject(o)) {
|
|
1113
901
|
if (t.indexOf(o) >= 0)
|
|
1114
902
|
return;
|
|
1115
|
-
if (isBuffer(o))
|
|
1116
|
-
return o;
|
|
1117
903
|
if (!("toJSON" in o)) {
|
|
1118
|
-
t[
|
|
1119
|
-
const
|
|
904
|
+
t[r] = o;
|
|
905
|
+
const s = isArray(o) ? [] : {};
|
|
1120
906
|
return forEach(o, (l, i) => {
|
|
1121
|
-
const u = n(l,
|
|
1122
|
-
!isUndefined(u) && (
|
|
1123
|
-
}), t[
|
|
907
|
+
const u = n(l, r + 1);
|
|
908
|
+
!isUndefined(u) && (s[i] = u);
|
|
909
|
+
}), t[r] = void 0, s;
|
|
1124
910
|
}
|
|
1125
911
|
}
|
|
1126
912
|
return o;
|
|
1127
913
|
};
|
|
1128
914
|
return n(e, 0);
|
|
1129
|
-
}, isAsyncFn = kindOfTest("AsyncFunction"), isThenable = (e) => e && (isObject(e) || isFunction(e)) && isFunction(e.then) && isFunction(e.catch), _setImmediate = ((e, t) => e ? setImmediate : t ? ((n, o) => (_global.addEventListener("message", ({ source:
|
|
1130
|
-
|
|
1131
|
-
}, !1), (
|
|
1132
|
-
o.push(
|
|
915
|
+
}, isAsyncFn = kindOfTest("AsyncFunction"), isThenable = (e) => e && (isObject(e) || isFunction(e)) && isFunction(e.then) && isFunction(e.catch), _setImmediate = ((e, t) => e ? setImmediate : t ? ((n, o) => (_global.addEventListener("message", ({ source: r, data: s }) => {
|
|
916
|
+
r === _global && s === n && o.length && o.shift()();
|
|
917
|
+
}, !1), (r) => {
|
|
918
|
+
o.push(r), _global.postMessage(n, "*");
|
|
1133
919
|
}))(`axios@${Math.random()}`, []) : (n) => setTimeout(n))(
|
|
1134
920
|
typeof setImmediate == "function",
|
|
1135
921
|
isFunction(_global.postMessage)
|
|
@@ -1144,7 +930,6 @@ const toJSONObject = (e) => {
|
|
|
1144
930
|
isBoolean,
|
|
1145
931
|
isObject,
|
|
1146
932
|
isPlainObject,
|
|
1147
|
-
isEmptyObject,
|
|
1148
933
|
isReadableStream,
|
|
1149
934
|
isRequest,
|
|
1150
935
|
isResponse,
|
|
@@ -1193,8 +978,8 @@ const toJSONObject = (e) => {
|
|
|
1193
978
|
asap,
|
|
1194
979
|
isIterable
|
|
1195
980
|
};
|
|
1196
|
-
function AxiosError$1(e, t, n, o,
|
|
1197
|
-
Error.call(this), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error().stack, this.message = e, this.name = "AxiosError", t && (this.code = t), n && (this.config = n), o && (this.request = o),
|
|
981
|
+
function AxiosError$1(e, t, n, o, r) {
|
|
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), n && (this.config = n), o && (this.request = o), r && (this.response = r, this.status = r.status ? r.status : null);
|
|
1198
983
|
}
|
|
1199
984
|
utils$1.inherits(AxiosError$1, Error, {
|
|
1200
985
|
toJSON: function() {
|
|
@@ -1237,11 +1022,11 @@ const prototype$1 = AxiosError$1.prototype, descriptors = {};
|
|
|
1237
1022
|
});
|
|
1238
1023
|
Object.defineProperties(AxiosError$1, descriptors);
|
|
1239
1024
|
Object.defineProperty(prototype$1, "isAxiosError", { value: !0 });
|
|
1240
|
-
AxiosError$1.from = (e, t, n, o,
|
|
1025
|
+
AxiosError$1.from = (e, t, n, o, r, s) => {
|
|
1241
1026
|
const l = Object.create(prototype$1);
|
|
1242
1027
|
return utils$1.toFlatObject(e, l, function(u) {
|
|
1243
1028
|
return u !== Error.prototype;
|
|
1244
|
-
}, (i) => i !== "isAxiosError"), AxiosError$1.call(l, e.message, t, n, o,
|
|
1029
|
+
}, (i) => i !== "isAxiosError"), AxiosError$1.call(l, e.message, t, n, o, r), l.cause = e, l.name = e.name, s && Object.assign(l, s), l;
|
|
1245
1030
|
};
|
|
1246
1031
|
const httpAdapter = null;
|
|
1247
1032
|
function isVisitable(e) {
|
|
@@ -1251,8 +1036,8 @@ function removeBrackets(e) {
|
|
|
1251
1036
|
return utils$1.endsWith(e, "[]") ? e.slice(0, -2) : e;
|
|
1252
1037
|
}
|
|
1253
1038
|
function renderKey(e, t, n) {
|
|
1254
|
-
return e ? e.concat(t).map(function(
|
|
1255
|
-
return
|
|
1039
|
+
return e ? e.concat(t).map(function(r, s) {
|
|
1040
|
+
return r = removeBrackets(r), !n && s ? "[" + r + "]" : r;
|
|
1256
1041
|
}).join(n ? "." : "") : t;
|
|
1257
1042
|
}
|
|
1258
1043
|
function isFlatArray(e) {
|
|
@@ -1268,61 +1053,61 @@ function toFormData$1(e, t, n) {
|
|
|
1268
1053
|
metaTokens: !0,
|
|
1269
1054
|
dots: !1,
|
|
1270
1055
|
indexes: !1
|
|
1271
|
-
}, !1, function(y,
|
|
1272
|
-
return !utils$1.isUndefined(
|
|
1056
|
+
}, !1, function(y, m) {
|
|
1057
|
+
return !utils$1.isUndefined(m[y]);
|
|
1273
1058
|
});
|
|
1274
|
-
const o = n.metaTokens,
|
|
1275
|
-
if (!utils$1.isFunction(
|
|
1059
|
+
const o = n.metaTokens, r = n.visitor || a, s = n.dots, l = n.indexes, u = (n.Blob || typeof Blob < "u" && Blob) && utils$1.isSpecCompliantForm(t);
|
|
1060
|
+
if (!utils$1.isFunction(r))
|
|
1276
1061
|
throw new TypeError("visitor must be a function");
|
|
1277
|
-
function c(
|
|
1278
|
-
if (
|
|
1279
|
-
if (utils$1.isDate(
|
|
1280
|
-
return
|
|
1281
|
-
if (utils$1.isBoolean(
|
|
1282
|
-
return
|
|
1283
|
-
if (!u && utils$1.isBlob(
|
|
1062
|
+
function c(p) {
|
|
1063
|
+
if (p === null) return "";
|
|
1064
|
+
if (utils$1.isDate(p))
|
|
1065
|
+
return p.toISOString();
|
|
1066
|
+
if (utils$1.isBoolean(p))
|
|
1067
|
+
return p.toString();
|
|
1068
|
+
if (!u && utils$1.isBlob(p))
|
|
1284
1069
|
throw new AxiosError$1("Blob is not supported. Use a Buffer instead.");
|
|
1285
|
-
return utils$1.isArrayBuffer(
|
|
1070
|
+
return utils$1.isArrayBuffer(p) || utils$1.isTypedArray(p) ? u && typeof Blob == "function" ? new Blob([p]) : Buffer.from(p) : p;
|
|
1286
1071
|
}
|
|
1287
|
-
function a(
|
|
1288
|
-
let
|
|
1289
|
-
if (
|
|
1072
|
+
function a(p, y, m) {
|
|
1073
|
+
let x = p;
|
|
1074
|
+
if (p && !m && typeof p == "object") {
|
|
1290
1075
|
if (utils$1.endsWith(y, "{}"))
|
|
1291
|
-
y = o ? y : y.slice(0, -2),
|
|
1292
|
-
else if (utils$1.isArray(
|
|
1293
|
-
return y = removeBrackets(y),
|
|
1294
|
-
!(utils$1.isUndefined(
|
|
1076
|
+
y = o ? y : y.slice(0, -2), p = JSON.stringify(p);
|
|
1077
|
+
else if (utils$1.isArray(p) && isFlatArray(p) || (utils$1.isFileList(p) || utils$1.endsWith(y, "[]")) && (x = utils$1.toArray(p)))
|
|
1078
|
+
return y = removeBrackets(y), x.forEach(function($, _) {
|
|
1079
|
+
!(utils$1.isUndefined($) || $ === null) && t.append(
|
|
1295
1080
|
// eslint-disable-next-line no-nested-ternary
|
|
1296
|
-
l === !0 ? renderKey([y],
|
|
1297
|
-
c(
|
|
1081
|
+
l === !0 ? renderKey([y], _, s) : l === null ? y : y + "[]",
|
|
1082
|
+
c($)
|
|
1298
1083
|
);
|
|
1299
1084
|
}), !1;
|
|
1300
1085
|
}
|
|
1301
|
-
return isVisitable(
|
|
1086
|
+
return isVisitable(p) ? !0 : (t.append(renderKey(m, y, s), c(p)), !1);
|
|
1302
1087
|
}
|
|
1303
|
-
const
|
|
1088
|
+
const d = [], f = Object.assign(predicates, {
|
|
1304
1089
|
defaultVisitor: a,
|
|
1305
1090
|
convertValue: c,
|
|
1306
1091
|
isVisitable
|
|
1307
1092
|
});
|
|
1308
|
-
function p
|
|
1309
|
-
if (!utils$1.isUndefined(
|
|
1310
|
-
if (
|
|
1093
|
+
function h(p, y) {
|
|
1094
|
+
if (!utils$1.isUndefined(p)) {
|
|
1095
|
+
if (d.indexOf(p) !== -1)
|
|
1311
1096
|
throw Error("Circular reference detected in " + y.join("."));
|
|
1312
|
-
|
|
1313
|
-
(!(utils$1.isUndefined(
|
|
1097
|
+
d.push(p), utils$1.forEach(p, function(x, v) {
|
|
1098
|
+
(!(utils$1.isUndefined(x) || x === null) && r.call(
|
|
1314
1099
|
t,
|
|
1315
|
-
|
|
1316
|
-
utils$1.isString(
|
|
1100
|
+
x,
|
|
1101
|
+
utils$1.isString(v) ? v.trim() : v,
|
|
1317
1102
|
y,
|
|
1318
|
-
|
|
1319
|
-
)) === !0 &&
|
|
1320
|
-
}),
|
|
1103
|
+
f
|
|
1104
|
+
)) === !0 && h(x, y ? y.concat(v) : [v]);
|
|
1105
|
+
}), d.pop();
|
|
1321
1106
|
}
|
|
1322
1107
|
}
|
|
1323
1108
|
if (!utils$1.isObject(e))
|
|
1324
1109
|
throw new TypeError("data must be an object");
|
|
1325
|
-
return
|
|
1110
|
+
return h(e), t;
|
|
1326
1111
|
}
|
|
1327
1112
|
function encode$1(e) {
|
|
1328
1113
|
const t = {
|
|
@@ -1349,8 +1134,8 @@ prototype.toString = function(t) {
|
|
|
1349
1134
|
const n = t ? function(o) {
|
|
1350
1135
|
return t.call(this, o, encode$1);
|
|
1351
1136
|
} : encode$1;
|
|
1352
|
-
return this._pairs.map(function(
|
|
1353
|
-
return n(
|
|
1137
|
+
return this._pairs.map(function(r) {
|
|
1138
|
+
return n(r[0]) + "=" + n(r[1]);
|
|
1354
1139
|
}, "").join("&");
|
|
1355
1140
|
};
|
|
1356
1141
|
function encode(e) {
|
|
@@ -1363,11 +1148,11 @@ function buildURL(e, t, n) {
|
|
|
1363
1148
|
utils$1.isFunction(n) && (n = {
|
|
1364
1149
|
serialize: n
|
|
1365
1150
|
});
|
|
1366
|
-
const
|
|
1367
|
-
let
|
|
1368
|
-
if (
|
|
1151
|
+
const r = n && n.serialize;
|
|
1152
|
+
let s;
|
|
1153
|
+
if (r ? s = r(t, n) : s = utils$1.isURLSearchParams(t) ? t.toString() : new AxiosURLSearchParams(t, n).toString(o), s) {
|
|
1369
1154
|
const l = e.indexOf("#");
|
|
1370
|
-
l !== -1 && (e = e.slice(0, l)), e += (e.indexOf("?") === -1 ? "?" : "&") +
|
|
1155
|
+
l !== -1 && (e = e.slice(0, l)), e += (e.indexOf("?") === -1 ? "?" : "&") + s;
|
|
1371
1156
|
}
|
|
1372
1157
|
return e;
|
|
1373
1158
|
}
|
|
@@ -1450,12 +1235,11 @@ self instanceof WorkerGlobalScope && typeof self.importScripts == "function", or
|
|
|
1450
1235
|
...platform$1
|
|
1451
1236
|
};
|
|
1452
1237
|
function toURLEncodedForm(e, t) {
|
|
1453
|
-
return toFormData$1(e, new platform.classes.URLSearchParams(), {
|
|
1454
|
-
visitor: function(n, o,
|
|
1455
|
-
return platform.isNode && utils$1.isBuffer(n) ? (this.append(o, n.toString("base64")), !1) :
|
|
1456
|
-
}
|
|
1457
|
-
|
|
1458
|
-
});
|
|
1238
|
+
return toFormData$1(e, new platform.classes.URLSearchParams(), Object.assign({
|
|
1239
|
+
visitor: function(n, o, r, s) {
|
|
1240
|
+
return platform.isNode && utils$1.isBuffer(n) ? (this.append(o, n.toString("base64")), !1) : s.defaultVisitor.apply(this, arguments);
|
|
1241
|
+
}
|
|
1242
|
+
}, t));
|
|
1459
1243
|
}
|
|
1460
1244
|
function parsePropPath(e) {
|
|
1461
1245
|
return utils$1.matchAll(/\w+|\[(\w*)]/g, e).map((t) => t[0] === "[]" ? "" : t[1] || t[0]);
|
|
@@ -1463,23 +1247,23 @@ function parsePropPath(e) {
|
|
|
1463
1247
|
function arrayToObject(e) {
|
|
1464
1248
|
const t = {}, n = Object.keys(e);
|
|
1465
1249
|
let o;
|
|
1466
|
-
const
|
|
1467
|
-
let
|
|
1468
|
-
for (o = 0; o <
|
|
1469
|
-
|
|
1250
|
+
const r = n.length;
|
|
1251
|
+
let s;
|
|
1252
|
+
for (o = 0; o < r; o++)
|
|
1253
|
+
s = n[o], t[s] = e[s];
|
|
1470
1254
|
return t;
|
|
1471
1255
|
}
|
|
1472
1256
|
function formDataToJSON(e) {
|
|
1473
|
-
function t(n, o,
|
|
1474
|
-
let l = n[
|
|
1257
|
+
function t(n, o, r, s) {
|
|
1258
|
+
let l = n[s++];
|
|
1475
1259
|
if (l === "__proto__") return !0;
|
|
1476
|
-
const i = Number.isFinite(+l), u =
|
|
1477
|
-
return l = !l && utils$1.isArray(
|
|
1260
|
+
const i = Number.isFinite(+l), u = s >= n.length;
|
|
1261
|
+
return l = !l && utils$1.isArray(r) ? r.length : l, u ? (utils$1.hasOwnProp(r, l) ? r[l] = [r[l], o] : r[l] = o, !i) : ((!r[l] || !utils$1.isObject(r[l])) && (r[l] = []), t(n, o, r[l], s) && utils$1.isArray(r[l]) && (r[l] = arrayToObject(r[l])), !i);
|
|
1478
1262
|
}
|
|
1479
1263
|
if (utils$1.isFormData(e) && utils$1.isFunction(e.entries)) {
|
|
1480
1264
|
const n = {};
|
|
1481
|
-
return utils$1.forEachEntry(e, (o,
|
|
1482
|
-
t(parsePropPath(o),
|
|
1265
|
+
return utils$1.forEachEntry(e, (o, r) => {
|
|
1266
|
+
t(parsePropPath(o), r, n, 0);
|
|
1483
1267
|
}), n;
|
|
1484
1268
|
}
|
|
1485
1269
|
return null;
|
|
@@ -1498,9 +1282,9 @@ const defaults = {
|
|
|
1498
1282
|
transitional: transitionalDefaults,
|
|
1499
1283
|
adapter: ["xhr", "http", "fetch"],
|
|
1500
1284
|
transformRequest: [function(t, n) {
|
|
1501
|
-
const o = n.getContentType() || "",
|
|
1502
|
-
if (
|
|
1503
|
-
return
|
|
1285
|
+
const o = n.getContentType() || "", r = o.indexOf("application/json") > -1, s = utils$1.isObject(t);
|
|
1286
|
+
if (s && utils$1.isHTMLForm(t) && (t = new FormData(t)), utils$1.isFormData(t))
|
|
1287
|
+
return r ? JSON.stringify(formDataToJSON(t)) : t;
|
|
1504
1288
|
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))
|
|
1505
1289
|
return t;
|
|
1506
1290
|
if (utils$1.isArrayBufferView(t))
|
|
@@ -1508,7 +1292,7 @@ const defaults = {
|
|
|
1508
1292
|
if (utils$1.isURLSearchParams(t))
|
|
1509
1293
|
return n.setContentType("application/x-www-form-urlencoded;charset=utf-8", !1), t.toString();
|
|
1510
1294
|
let i;
|
|
1511
|
-
if (
|
|
1295
|
+
if (s) {
|
|
1512
1296
|
if (o.indexOf("application/x-www-form-urlencoded") > -1)
|
|
1513
1297
|
return toURLEncodedForm(t, this.formSerializer).toString();
|
|
1514
1298
|
if ((i = utils$1.isFileList(t)) || o.indexOf("multipart/form-data") > -1) {
|
|
@@ -1520,14 +1304,14 @@ const defaults = {
|
|
|
1520
1304
|
);
|
|
1521
1305
|
}
|
|
1522
1306
|
}
|
|
1523
|
-
return
|
|
1307
|
+
return s || r ? (n.setContentType("application/json", !1), stringifySafely(t)) : t;
|
|
1524
1308
|
}],
|
|
1525
1309
|
transformResponse: [function(t) {
|
|
1526
|
-
const n = this.transitional || defaults.transitional, o = n && n.forcedJSONParsing,
|
|
1310
|
+
const n = this.transitional || defaults.transitional, o = n && n.forcedJSONParsing, r = this.responseType === "json";
|
|
1527
1311
|
if (utils$1.isResponse(t) || utils$1.isReadableStream(t))
|
|
1528
1312
|
return t;
|
|
1529
|
-
if (t && utils$1.isString(t) && (o && !this.responseType ||
|
|
1530
|
-
const l = !(n && n.silentJSONParsing) &&
|
|
1313
|
+
if (t && utils$1.isString(t) && (o && !this.responseType || r)) {
|
|
1314
|
+
const l = !(n && n.silentJSONParsing) && r;
|
|
1531
1315
|
try {
|
|
1532
1316
|
return JSON.parse(t);
|
|
1533
1317
|
} catch (i) {
|
|
@@ -1583,10 +1367,10 @@ const ignoreDuplicateOf = utils$1.toObjectSet([
|
|
|
1583
1367
|
"user-agent"
|
|
1584
1368
|
]), parseHeaders = (e) => {
|
|
1585
1369
|
const t = {};
|
|
1586
|
-
let n, o,
|
|
1370
|
+
let n, o, r;
|
|
1587
1371
|
return e && e.split(`
|
|
1588
1372
|
`).forEach(function(l) {
|
|
1589
|
-
|
|
1373
|
+
r = l.indexOf(":"), n = l.substring(0, r).trim().toLowerCase(), o = l.substring(r + 1).trim(), !(!n || t[n] && ignoreDuplicateOf[n]) && (n === "set-cookie" ? t[n] ? t[n].push(o) : t[n] = [o] : t[n] = t[n] ? t[n] + ", " + o : o);
|
|
1590
1374
|
}), t;
|
|
1591
1375
|
}, $internals = Symbol("internals");
|
|
1592
1376
|
function normalizeHeader(e) {
|
|
@@ -1603,10 +1387,10 @@ function parseTokens(e) {
|
|
|
1603
1387
|
return t;
|
|
1604
1388
|
}
|
|
1605
1389
|
const isValidHeaderName = (e) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());
|
|
1606
|
-
function matchHeaderValue(e, t, n, o,
|
|
1390
|
+
function matchHeaderValue(e, t, n, o, r) {
|
|
1607
1391
|
if (utils$1.isFunction(o))
|
|
1608
1392
|
return o.call(this, t, n);
|
|
1609
|
-
if (
|
|
1393
|
+
if (r && (t = n), !!utils$1.isString(t)) {
|
|
1610
1394
|
if (utils$1.isString(o))
|
|
1611
1395
|
return t.indexOf(o) !== -1;
|
|
1612
1396
|
if (utils$1.isRegExp(o))
|
|
@@ -1620,8 +1404,8 @@ function buildAccessors(e, t) {
|
|
|
1620
1404
|
const n = utils$1.toCamelCase(" " + t);
|
|
1621
1405
|
["get", "set", "has"].forEach((o) => {
|
|
1622
1406
|
Object.defineProperty(e, o + n, {
|
|
1623
|
-
value: function(
|
|
1624
|
-
return this[o].call(this, t,
|
|
1407
|
+
value: function(r, s, l) {
|
|
1408
|
+
return this[o].call(this, t, r, s, l);
|
|
1625
1409
|
},
|
|
1626
1410
|
configurable: !0
|
|
1627
1411
|
});
|
|
@@ -1632,15 +1416,15 @@ let AxiosHeaders$1 = class {
|
|
|
1632
1416
|
t && this.set(t);
|
|
1633
1417
|
}
|
|
1634
1418
|
set(t, n, o) {
|
|
1635
|
-
const
|
|
1636
|
-
function
|
|
1419
|
+
const r = this;
|
|
1420
|
+
function s(i, u, c) {
|
|
1637
1421
|
const a = normalizeHeader(u);
|
|
1638
1422
|
if (!a)
|
|
1639
1423
|
throw new Error("header name must be a non-empty string");
|
|
1640
|
-
const
|
|
1641
|
-
(!
|
|
1424
|
+
const d = utils$1.findKey(r, a);
|
|
1425
|
+
(!d || r[d] === void 0 || c === !0 || c === void 0 && r[d] !== !1) && (r[d || u] = normalizeValue(i));
|
|
1642
1426
|
}
|
|
1643
|
-
const l = (i, u) => utils$1.forEach(i, (c, a) =>
|
|
1427
|
+
const l = (i, u) => utils$1.forEach(i, (c, a) => s(c, a, u));
|
|
1644
1428
|
if (utils$1.isPlainObject(t) || t instanceof this.constructor)
|
|
1645
1429
|
l(t, n);
|
|
1646
1430
|
else if (utils$1.isString(t) && (t = t.trim()) && !isValidHeaderName(t))
|
|
@@ -1654,22 +1438,22 @@ let AxiosHeaders$1 = class {
|
|
|
1654
1438
|
}
|
|
1655
1439
|
l(i, n);
|
|
1656
1440
|
} else
|
|
1657
|
-
t != null &&
|
|
1441
|
+
t != null && s(n, t, o);
|
|
1658
1442
|
return this;
|
|
1659
1443
|
}
|
|
1660
1444
|
get(t, n) {
|
|
1661
1445
|
if (t = normalizeHeader(t), t) {
|
|
1662
1446
|
const o = utils$1.findKey(this, t);
|
|
1663
1447
|
if (o) {
|
|
1664
|
-
const
|
|
1448
|
+
const r = this[o];
|
|
1665
1449
|
if (!n)
|
|
1666
|
-
return
|
|
1450
|
+
return r;
|
|
1667
1451
|
if (n === !0)
|
|
1668
|
-
return parseTokens(
|
|
1452
|
+
return parseTokens(r);
|
|
1669
1453
|
if (utils$1.isFunction(n))
|
|
1670
|
-
return n.call(this,
|
|
1454
|
+
return n.call(this, r, o);
|
|
1671
1455
|
if (utils$1.isRegExp(n))
|
|
1672
|
-
return n.exec(
|
|
1456
|
+
return n.exec(r);
|
|
1673
1457
|
throw new TypeError("parser must be boolean|regexp|function");
|
|
1674
1458
|
}
|
|
1675
1459
|
}
|
|
@@ -1683,34 +1467,34 @@ let AxiosHeaders$1 = class {
|
|
|
1683
1467
|
}
|
|
1684
1468
|
delete(t, n) {
|
|
1685
1469
|
const o = this;
|
|
1686
|
-
let
|
|
1687
|
-
function
|
|
1470
|
+
let r = !1;
|
|
1471
|
+
function s(l) {
|
|
1688
1472
|
if (l = normalizeHeader(l), l) {
|
|
1689
1473
|
const i = utils$1.findKey(o, l);
|
|
1690
|
-
i && (!n || matchHeaderValue(o, o[i], i, n)) && (delete o[i],
|
|
1474
|
+
i && (!n || matchHeaderValue(o, o[i], i, n)) && (delete o[i], r = !0);
|
|
1691
1475
|
}
|
|
1692
1476
|
}
|
|
1693
|
-
return utils$1.isArray(t) ? t.forEach(
|
|
1477
|
+
return utils$1.isArray(t) ? t.forEach(s) : s(t), r;
|
|
1694
1478
|
}
|
|
1695
1479
|
clear(t) {
|
|
1696
1480
|
const n = Object.keys(this);
|
|
1697
|
-
let o = n.length,
|
|
1481
|
+
let o = n.length, r = !1;
|
|
1698
1482
|
for (; o--; ) {
|
|
1699
|
-
const
|
|
1700
|
-
(!t || matchHeaderValue(this, this[
|
|
1483
|
+
const s = n[o];
|
|
1484
|
+
(!t || matchHeaderValue(this, this[s], s, t, !0)) && (delete this[s], r = !0);
|
|
1701
1485
|
}
|
|
1702
|
-
return
|
|
1486
|
+
return r;
|
|
1703
1487
|
}
|
|
1704
1488
|
normalize(t) {
|
|
1705
1489
|
const n = this, o = {};
|
|
1706
|
-
return utils$1.forEach(this, (
|
|
1707
|
-
const l = utils$1.findKey(o,
|
|
1490
|
+
return utils$1.forEach(this, (r, s) => {
|
|
1491
|
+
const l = utils$1.findKey(o, s);
|
|
1708
1492
|
if (l) {
|
|
1709
|
-
n[l] = normalizeValue(
|
|
1493
|
+
n[l] = normalizeValue(r), delete n[s];
|
|
1710
1494
|
return;
|
|
1711
1495
|
}
|
|
1712
|
-
const i = t ? formatHeader(
|
|
1713
|
-
i !==
|
|
1496
|
+
const i = t ? formatHeader(s) : String(s).trim();
|
|
1497
|
+
i !== s && delete n[s], n[i] = normalizeValue(r), o[i] = !0;
|
|
1714
1498
|
}), this;
|
|
1715
1499
|
}
|
|
1716
1500
|
concat(...t) {
|
|
@@ -1718,8 +1502,8 @@ let AxiosHeaders$1 = class {
|
|
|
1718
1502
|
}
|
|
1719
1503
|
toJSON(t) {
|
|
1720
1504
|
const n = /* @__PURE__ */ Object.create(null);
|
|
1721
|
-
return utils$1.forEach(this, (o,
|
|
1722
|
-
o != null && o !== !1 && (n[
|
|
1505
|
+
return utils$1.forEach(this, (o, r) => {
|
|
1506
|
+
o != null && o !== !1 && (n[r] = t && utils$1.isArray(o) ? o.join(", ") : o);
|
|
1723
1507
|
}), n;
|
|
1724
1508
|
}
|
|
1725
1509
|
[Symbol.iterator]() {
|
|
@@ -1740,17 +1524,17 @@ let AxiosHeaders$1 = class {
|
|
|
1740
1524
|
}
|
|
1741
1525
|
static concat(t, ...n) {
|
|
1742
1526
|
const o = new this(t);
|
|
1743
|
-
return n.forEach((
|
|
1527
|
+
return n.forEach((r) => o.set(r)), o;
|
|
1744
1528
|
}
|
|
1745
1529
|
static accessor(t) {
|
|
1746
1530
|
const o = (this[$internals] = this[$internals] = {
|
|
1747
1531
|
accessors: {}
|
|
1748
|
-
}).accessors,
|
|
1749
|
-
function
|
|
1532
|
+
}).accessors, r = this.prototype;
|
|
1533
|
+
function s(l) {
|
|
1750
1534
|
const i = normalizeHeader(l);
|
|
1751
|
-
o[i] || (buildAccessors(
|
|
1535
|
+
o[i] || (buildAccessors(r, l), o[i] = !0);
|
|
1752
1536
|
}
|
|
1753
|
-
return utils$1.isArray(t) ? t.forEach(
|
|
1537
|
+
return utils$1.isArray(t) ? t.forEach(s) : s(t), this;
|
|
1754
1538
|
}
|
|
1755
1539
|
};
|
|
1756
1540
|
AxiosHeaders$1.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
|
|
@@ -1765,11 +1549,11 @@ utils$1.reduceDescriptors(AxiosHeaders$1.prototype, ({ value: e }, t) => {
|
|
|
1765
1549
|
});
|
|
1766
1550
|
utils$1.freezeMethods(AxiosHeaders$1);
|
|
1767
1551
|
function transformData(e, t) {
|
|
1768
|
-
const n = this || defaults, o = t || n,
|
|
1769
|
-
let
|
|
1552
|
+
const n = this || defaults, o = t || n, r = AxiosHeaders$1.from(o.headers);
|
|
1553
|
+
let s = o.data;
|
|
1770
1554
|
return utils$1.forEach(e, function(i) {
|
|
1771
|
-
|
|
1772
|
-
}),
|
|
1555
|
+
s = i.call(n, s, r.normalize(), t ? t.status : void 0);
|
|
1556
|
+
}), r.normalize(), s;
|
|
1773
1557
|
}
|
|
1774
1558
|
function isCancel$1(e) {
|
|
1775
1559
|
return !!(e && e.__CANCEL__);
|
|
@@ -1797,49 +1581,49 @@ function parseProtocol(e) {
|
|
|
1797
1581
|
function speedometer(e, t) {
|
|
1798
1582
|
e = e || 10;
|
|
1799
1583
|
const n = new Array(e), o = new Array(e);
|
|
1800
|
-
let
|
|
1584
|
+
let r = 0, s = 0, l;
|
|
1801
1585
|
return t = t !== void 0 ? t : 1e3, function(u) {
|
|
1802
|
-
const c = Date.now(), a = o[
|
|
1803
|
-
l || (l = c), n[
|
|
1804
|
-
let
|
|
1805
|
-
for (;
|
|
1806
|
-
|
|
1807
|
-
if (
|
|
1586
|
+
const c = Date.now(), a = o[s];
|
|
1587
|
+
l || (l = c), n[r] = u, o[r] = c;
|
|
1588
|
+
let d = s, f = 0;
|
|
1589
|
+
for (; d !== r; )
|
|
1590
|
+
f += n[d++], d = d % e;
|
|
1591
|
+
if (r = (r + 1) % e, r === s && (s = (s + 1) % e), c - l < t)
|
|
1808
1592
|
return;
|
|
1809
|
-
const
|
|
1810
|
-
return
|
|
1593
|
+
const h = a && c - a;
|
|
1594
|
+
return h ? Math.round(f * 1e3 / h) : void 0;
|
|
1811
1595
|
};
|
|
1812
1596
|
}
|
|
1813
1597
|
function throttle(e, t) {
|
|
1814
|
-
let n = 0, o = 1e3 / t,
|
|
1598
|
+
let n = 0, o = 1e3 / t, r, s;
|
|
1815
1599
|
const l = (c, a = Date.now()) => {
|
|
1816
|
-
n = a,
|
|
1600
|
+
n = a, r = null, s && (clearTimeout(s), s = null), e.apply(null, c);
|
|
1817
1601
|
};
|
|
1818
1602
|
return [(...c) => {
|
|
1819
|
-
const a = Date.now(),
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
}, o -
|
|
1823
|
-
}, () =>
|
|
1603
|
+
const a = Date.now(), d = a - n;
|
|
1604
|
+
d >= o ? l(c, a) : (r = c, s || (s = setTimeout(() => {
|
|
1605
|
+
s = null, l(r);
|
|
1606
|
+
}, o - d)));
|
|
1607
|
+
}, () => r && l(r)];
|
|
1824
1608
|
}
|
|
1825
1609
|
const progressEventReducer = (e, t, n = 3) => {
|
|
1826
1610
|
let o = 0;
|
|
1827
|
-
const
|
|
1828
|
-
return throttle((
|
|
1829
|
-
const l =
|
|
1611
|
+
const r = speedometer(50, 250);
|
|
1612
|
+
return throttle((s) => {
|
|
1613
|
+
const l = s.loaded, i = s.lengthComputable ? s.total : void 0, u = l - o, c = r(u), a = l <= i;
|
|
1830
1614
|
o = l;
|
|
1831
|
-
const
|
|
1615
|
+
const d = {
|
|
1832
1616
|
loaded: l,
|
|
1833
1617
|
total: i,
|
|
1834
1618
|
progress: i ? l / i : void 0,
|
|
1835
1619
|
bytes: u,
|
|
1836
1620
|
rate: c || void 0,
|
|
1837
1621
|
estimated: c && i && a ? (i - l) / c : void 0,
|
|
1838
|
-
event:
|
|
1622
|
+
event: s,
|
|
1839
1623
|
lengthComputable: i != null,
|
|
1840
1624
|
[t ? "download" : "upload"]: !0
|
|
1841
1625
|
};
|
|
1842
|
-
e(
|
|
1626
|
+
e(d);
|
|
1843
1627
|
}, n);
|
|
1844
1628
|
}, progressEventDecorator = (e, t) => {
|
|
1845
1629
|
const n = e != null;
|
|
@@ -1854,9 +1638,9 @@ const progressEventReducer = (e, t, n = 3) => {
|
|
|
1854
1638
|
) : () => !0, cookies = platform.hasStandardBrowserEnv ? (
|
|
1855
1639
|
// Standard browser envs support document.cookie
|
|
1856
1640
|
{
|
|
1857
|
-
write(e, t, n, o,
|
|
1641
|
+
write(e, t, n, o, r, s) {
|
|
1858
1642
|
const l = [e + "=" + encodeURIComponent(t)];
|
|
1859
|
-
utils$1.isNumber(n) && l.push("expires=" + new Date(n).toGMTString()), utils$1.isString(o) && l.push("path=" + o), utils$1.isString(
|
|
1643
|
+
utils$1.isNumber(n) && l.push("expires=" + new Date(n).toGMTString()), utils$1.isString(o) && l.push("path=" + o), utils$1.isString(r) && l.push("domain=" + r), s === !0 && l.push("secure"), document.cookie = l.join("; ");
|
|
1860
1644
|
},
|
|
1861
1645
|
read(e) {
|
|
1862
1646
|
const t = document.cookie.match(new RegExp("(^|;\\s*)(" + e + ")=([^;]*)"));
|
|
@@ -1892,16 +1676,16 @@ const headersToObject = (e) => e instanceof AxiosHeaders$1 ? { ...e } : e;
|
|
|
1892
1676
|
function mergeConfig$1(e, t) {
|
|
1893
1677
|
t = t || {};
|
|
1894
1678
|
const n = {};
|
|
1895
|
-
function o(c, a,
|
|
1896
|
-
return utils$1.isPlainObject(c) && utils$1.isPlainObject(a) ? utils$1.merge.call({ caseless:
|
|
1679
|
+
function o(c, a, d, f) {
|
|
1680
|
+
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;
|
|
1897
1681
|
}
|
|
1898
|
-
function
|
|
1682
|
+
function r(c, a, d, f) {
|
|
1899
1683
|
if (utils$1.isUndefined(a)) {
|
|
1900
1684
|
if (!utils$1.isUndefined(c))
|
|
1901
|
-
return o(void 0, c,
|
|
1902
|
-
} else return o(c, a,
|
|
1685
|
+
return o(void 0, c, d, f);
|
|
1686
|
+
} else return o(c, a, d, f);
|
|
1903
1687
|
}
|
|
1904
|
-
function
|
|
1688
|
+
function s(c, a) {
|
|
1905
1689
|
if (!utils$1.isUndefined(a))
|
|
1906
1690
|
return o(void 0, a);
|
|
1907
1691
|
}
|
|
@@ -1911,16 +1695,16 @@ function mergeConfig$1(e, t) {
|
|
|
1911
1695
|
return o(void 0, c);
|
|
1912
1696
|
} else return o(void 0, a);
|
|
1913
1697
|
}
|
|
1914
|
-
function i(c, a,
|
|
1915
|
-
if (
|
|
1698
|
+
function i(c, a, d) {
|
|
1699
|
+
if (d in t)
|
|
1916
1700
|
return o(c, a);
|
|
1917
|
-
if (
|
|
1701
|
+
if (d in e)
|
|
1918
1702
|
return o(void 0, c);
|
|
1919
1703
|
}
|
|
1920
1704
|
const u = {
|
|
1921
|
-
url:
|
|
1922
|
-
method:
|
|
1923
|
-
data:
|
|
1705
|
+
url: s,
|
|
1706
|
+
method: s,
|
|
1707
|
+
data: s,
|
|
1924
1708
|
baseURL: l,
|
|
1925
1709
|
transformRequest: l,
|
|
1926
1710
|
transformResponse: l,
|
|
@@ -1946,16 +1730,16 @@ function mergeConfig$1(e, t) {
|
|
|
1946
1730
|
socketPath: l,
|
|
1947
1731
|
responseEncoding: l,
|
|
1948
1732
|
validateStatus: i,
|
|
1949
|
-
headers: (c, a,
|
|
1733
|
+
headers: (c, a, d) => r(headersToObject(c), headersToObject(a), d, !0)
|
|
1950
1734
|
};
|
|
1951
|
-
return utils$1.forEach(Object.keys({
|
|
1952
|
-
const
|
|
1953
|
-
utils$1.isUndefined(
|
|
1735
|
+
return utils$1.forEach(Object.keys(Object.assign({}, e, t)), function(a) {
|
|
1736
|
+
const d = u[a] || r, f = d(e[a], t[a], a);
|
|
1737
|
+
utils$1.isUndefined(f) && d !== i || (n[a] = f);
|
|
1954
1738
|
}), n;
|
|
1955
1739
|
}
|
|
1956
1740
|
const resolveConfig = (e) => {
|
|
1957
1741
|
const t = mergeConfig$1({}, e);
|
|
1958
|
-
let { data: n, withXSRFToken: o, xsrfHeaderName:
|
|
1742
|
+
let { data: n, withXSRFToken: o, xsrfHeaderName: r, xsrfCookieName: s, headers: l, auth: i } = t;
|
|
1959
1743
|
t.headers = l = AxiosHeaders$1.from(l), t.url = buildURL(buildFullPath(t.baseURL, t.url, t.allowAbsoluteUrls), e.params, e.paramsSerializer), i && l.set(
|
|
1960
1744
|
"Authorization",
|
|
1961
1745
|
"Basic " + btoa((i.username || "") + ":" + (i.password ? unescape(encodeURIComponent(i.password)) : ""))
|
|
@@ -1965,92 +1749,92 @@ const resolveConfig = (e) => {
|
|
|
1965
1749
|
if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv)
|
|
1966
1750
|
l.setContentType(void 0);
|
|
1967
1751
|
else if ((u = l.getContentType()) !== !1) {
|
|
1968
|
-
const [c, ...a] = u ? u.split(";").map((
|
|
1752
|
+
const [c, ...a] = u ? u.split(";").map((d) => d.trim()).filter(Boolean) : [];
|
|
1969
1753
|
l.setContentType([c || "multipart/form-data", ...a].join("; "));
|
|
1970
1754
|
}
|
|
1971
1755
|
}
|
|
1972
1756
|
if (platform.hasStandardBrowserEnv && (o && utils$1.isFunction(o) && (o = o(t)), o || o !== !1 && isURLSameOrigin(t.url))) {
|
|
1973
|
-
const c =
|
|
1974
|
-
c && l.set(
|
|
1757
|
+
const c = r && s && cookies.read(s);
|
|
1758
|
+
c && l.set(r, c);
|
|
1975
1759
|
}
|
|
1976
1760
|
return t;
|
|
1977
1761
|
}, isXHRAdapterSupported = typeof XMLHttpRequest < "u", xhrAdapter = isXHRAdapterSupported && function(e) {
|
|
1978
1762
|
return new Promise(function(n, o) {
|
|
1979
|
-
const
|
|
1980
|
-
let
|
|
1981
|
-
const l = AxiosHeaders$1.from(
|
|
1982
|
-
let { responseType: i, onUploadProgress: u, onDownloadProgress: c } =
|
|
1763
|
+
const r = resolveConfig(e);
|
|
1764
|
+
let s = r.data;
|
|
1765
|
+
const l = AxiosHeaders$1.from(r.headers).normalize();
|
|
1766
|
+
let { responseType: i, onUploadProgress: u, onDownloadProgress: c } = r, a, d, f, h, p;
|
|
1983
1767
|
function y() {
|
|
1984
|
-
|
|
1768
|
+
h && h(), p && p(), r.cancelToken && r.cancelToken.unsubscribe(a), r.signal && r.signal.removeEventListener("abort", a);
|
|
1985
1769
|
}
|
|
1986
|
-
let
|
|
1987
|
-
|
|
1988
|
-
function
|
|
1989
|
-
if (!
|
|
1770
|
+
let m = new XMLHttpRequest();
|
|
1771
|
+
m.open(r.method.toUpperCase(), r.url, !0), m.timeout = r.timeout;
|
|
1772
|
+
function x() {
|
|
1773
|
+
if (!m)
|
|
1990
1774
|
return;
|
|
1991
|
-
const
|
|
1992
|
-
"getAllResponseHeaders" in
|
|
1993
|
-
),
|
|
1994
|
-
data: !i || i === "text" || i === "json" ?
|
|
1995
|
-
status:
|
|
1996
|
-
statusText:
|
|
1997
|
-
headers:
|
|
1775
|
+
const $ = AxiosHeaders$1.from(
|
|
1776
|
+
"getAllResponseHeaders" in m && m.getAllResponseHeaders()
|
|
1777
|
+
), k = {
|
|
1778
|
+
data: !i || i === "text" || i === "json" ? m.responseText : m.response,
|
|
1779
|
+
status: m.status,
|
|
1780
|
+
statusText: m.statusText,
|
|
1781
|
+
headers: $,
|
|
1998
1782
|
config: e,
|
|
1999
|
-
request:
|
|
1783
|
+
request: m
|
|
2000
1784
|
};
|
|
2001
1785
|
settle(function(S) {
|
|
2002
1786
|
n(S), y();
|
|
2003
1787
|
}, function(S) {
|
|
2004
1788
|
o(S), y();
|
|
2005
|
-
},
|
|
1789
|
+
}, k), m = null;
|
|
2006
1790
|
}
|
|
2007
|
-
"onloadend" in
|
|
2008
|
-
!
|
|
2009
|
-
},
|
|
2010
|
-
|
|
2011
|
-
},
|
|
2012
|
-
o(new AxiosError$1("Network Error", AxiosError$1.ERR_NETWORK, e,
|
|
2013
|
-
},
|
|
2014
|
-
let
|
|
2015
|
-
const
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
1791
|
+
"onloadend" in m ? m.onloadend = x : m.onreadystatechange = function() {
|
|
1792
|
+
!m || m.readyState !== 4 || m.status === 0 && !(m.responseURL && m.responseURL.indexOf("file:") === 0) || setTimeout(x);
|
|
1793
|
+
}, m.onabort = function() {
|
|
1794
|
+
m && (o(new AxiosError$1("Request aborted", AxiosError$1.ECONNABORTED, e, m)), m = null);
|
|
1795
|
+
}, m.onerror = function() {
|
|
1796
|
+
o(new AxiosError$1("Network Error", AxiosError$1.ERR_NETWORK, e, m)), m = null;
|
|
1797
|
+
}, m.ontimeout = function() {
|
|
1798
|
+
let _ = r.timeout ? "timeout of " + r.timeout + "ms exceeded" : "timeout exceeded";
|
|
1799
|
+
const k = r.transitional || transitionalDefaults;
|
|
1800
|
+
r.timeoutErrorMessage && (_ = r.timeoutErrorMessage), o(new AxiosError$1(
|
|
1801
|
+
_,
|
|
1802
|
+
k.clarifyTimeoutError ? AxiosError$1.ETIMEDOUT : AxiosError$1.ECONNABORTED,
|
|
2019
1803
|
e,
|
|
2020
|
-
|
|
2021
|
-
)),
|
|
2022
|
-
},
|
|
2023
|
-
|
|
2024
|
-
}), utils$1.isUndefined(
|
|
2025
|
-
|
|
2026
|
-
},
|
|
2027
|
-
const
|
|
2028
|
-
if (
|
|
2029
|
-
o(new AxiosError$1("Unsupported protocol " +
|
|
1804
|
+
m
|
|
1805
|
+
)), m = null;
|
|
1806
|
+
}, s === void 0 && l.setContentType(null), "setRequestHeader" in m && utils$1.forEach(l.toJSON(), function(_, k) {
|
|
1807
|
+
m.setRequestHeader(k, _);
|
|
1808
|
+
}), utils$1.isUndefined(r.withCredentials) || (m.withCredentials = !!r.withCredentials), i && i !== "json" && (m.responseType = r.responseType), c && ([f, p] = progressEventReducer(c, !0), m.addEventListener("progress", f)), u && m.upload && ([d, h] = progressEventReducer(u), m.upload.addEventListener("progress", d), m.upload.addEventListener("loadend", h)), (r.cancelToken || r.signal) && (a = ($) => {
|
|
1809
|
+
m && (o(!$ || $.type ? new CanceledError$1(null, e, m) : $), m.abort(), m = null);
|
|
1810
|
+
}, r.cancelToken && r.cancelToken.subscribe(a), r.signal && (r.signal.aborted ? a() : r.signal.addEventListener("abort", a)));
|
|
1811
|
+
const v = parseProtocol(r.url);
|
|
1812
|
+
if (v && platform.protocols.indexOf(v) === -1) {
|
|
1813
|
+
o(new AxiosError$1("Unsupported protocol " + v + ":", AxiosError$1.ERR_BAD_REQUEST, e));
|
|
2030
1814
|
return;
|
|
2031
1815
|
}
|
|
2032
|
-
|
|
1816
|
+
m.send(s || null);
|
|
2033
1817
|
});
|
|
2034
1818
|
}, composeSignals = (e, t) => {
|
|
2035
1819
|
const { length: n } = e = e ? e.filter(Boolean) : [];
|
|
2036
1820
|
if (t || n) {
|
|
2037
|
-
let o = new AbortController(),
|
|
2038
|
-
const
|
|
2039
|
-
if (!
|
|
2040
|
-
|
|
1821
|
+
let o = new AbortController(), r;
|
|
1822
|
+
const s = function(c) {
|
|
1823
|
+
if (!r) {
|
|
1824
|
+
r = !0, i();
|
|
2041
1825
|
const a = c instanceof Error ? c : this.reason;
|
|
2042
1826
|
o.abort(a instanceof AxiosError$1 ? a : new CanceledError$1(a instanceof Error ? a.message : a));
|
|
2043
1827
|
}
|
|
2044
1828
|
};
|
|
2045
1829
|
let l = t && setTimeout(() => {
|
|
2046
|
-
l = null,
|
|
1830
|
+
l = null, s(new AxiosError$1(`timeout ${t} of ms exceeded`, AxiosError$1.ETIMEDOUT));
|
|
2047
1831
|
}, t);
|
|
2048
1832
|
const i = () => {
|
|
2049
1833
|
e && (l && clearTimeout(l), l = null, e.forEach((c) => {
|
|
2050
|
-
c.unsubscribe ? c.unsubscribe(
|
|
1834
|
+
c.unsubscribe ? c.unsubscribe(s) : c.removeEventListener("abort", s);
|
|
2051
1835
|
}), e = null);
|
|
2052
1836
|
};
|
|
2053
|
-
e.forEach((c) => c.addEventListener("abort",
|
|
1837
|
+
e.forEach((c) => c.addEventListener("abort", s));
|
|
2054
1838
|
const { signal: u } = o;
|
|
2055
1839
|
return u.unsubscribe = () => utils$1.asap(i), u;
|
|
2056
1840
|
}
|
|
@@ -2060,9 +1844,9 @@ const resolveConfig = (e) => {
|
|
|
2060
1844
|
yield e;
|
|
2061
1845
|
return;
|
|
2062
1846
|
}
|
|
2063
|
-
let o = 0,
|
|
1847
|
+
let o = 0, r;
|
|
2064
1848
|
for (; o < n; )
|
|
2065
|
-
|
|
1849
|
+
r = o + t, yield e.slice(o, r), o = r;
|
|
2066
1850
|
}, readBytes = async function* (e, t) {
|
|
2067
1851
|
for await (const n of readStream(e))
|
|
2068
1852
|
yield* streamChunk(n, t);
|
|
@@ -2083,22 +1867,22 @@ const resolveConfig = (e) => {
|
|
|
2083
1867
|
await t.cancel();
|
|
2084
1868
|
}
|
|
2085
1869
|
}, trackStream = (e, t, n, o) => {
|
|
2086
|
-
const
|
|
2087
|
-
let
|
|
1870
|
+
const r = readBytes(e, t);
|
|
1871
|
+
let s = 0, l, i = (u) => {
|
|
2088
1872
|
l || (l = !0, o && o(u));
|
|
2089
1873
|
};
|
|
2090
1874
|
return new ReadableStream({
|
|
2091
1875
|
async pull(u) {
|
|
2092
1876
|
try {
|
|
2093
|
-
const { done: c, value: a } = await
|
|
1877
|
+
const { done: c, value: a } = await r.next();
|
|
2094
1878
|
if (c) {
|
|
2095
1879
|
i(), u.close();
|
|
2096
1880
|
return;
|
|
2097
1881
|
}
|
|
2098
|
-
let
|
|
1882
|
+
let d = a.byteLength;
|
|
2099
1883
|
if (n) {
|
|
2100
|
-
let
|
|
2101
|
-
n(
|
|
1884
|
+
let f = s += d;
|
|
1885
|
+
n(f);
|
|
2102
1886
|
}
|
|
2103
1887
|
u.enqueue(new Uint8Array(a));
|
|
2104
1888
|
} catch (c) {
|
|
@@ -2106,7 +1890,7 @@ const resolveConfig = (e) => {
|
|
|
2106
1890
|
}
|
|
2107
1891
|
},
|
|
2108
1892
|
cancel(u) {
|
|
2109
|
-
return i(u),
|
|
1893
|
+
return i(u), r.return();
|
|
2110
1894
|
}
|
|
2111
1895
|
}, {
|
|
2112
1896
|
highWaterMark: 2
|
|
@@ -2159,85 +1943,85 @@ const getBodyLength = async (e) => {
|
|
|
2159
1943
|
url: t,
|
|
2160
1944
|
method: n,
|
|
2161
1945
|
data: o,
|
|
2162
|
-
signal:
|
|
2163
|
-
cancelToken:
|
|
1946
|
+
signal: r,
|
|
1947
|
+
cancelToken: s,
|
|
2164
1948
|
timeout: l,
|
|
2165
1949
|
onDownloadProgress: i,
|
|
2166
1950
|
onUploadProgress: u,
|
|
2167
1951
|
responseType: c,
|
|
2168
1952
|
headers: a,
|
|
2169
|
-
withCredentials:
|
|
2170
|
-
fetchOptions:
|
|
1953
|
+
withCredentials: d = "same-origin",
|
|
1954
|
+
fetchOptions: f
|
|
2171
1955
|
} = resolveConfig(e);
|
|
2172
1956
|
c = c ? (c + "").toLowerCase() : "text";
|
|
2173
|
-
let
|
|
2174
|
-
const y =
|
|
2175
|
-
|
|
1957
|
+
let h = composeSignals([r, s && s.toAbortSignal()], l), p;
|
|
1958
|
+
const y = h && h.unsubscribe && (() => {
|
|
1959
|
+
h.unsubscribe();
|
|
2176
1960
|
});
|
|
2177
|
-
let
|
|
1961
|
+
let m;
|
|
2178
1962
|
try {
|
|
2179
|
-
if (u && supportsRequestStream && n !== "get" && n !== "head" && (
|
|
2180
|
-
let
|
|
1963
|
+
if (u && supportsRequestStream && n !== "get" && n !== "head" && (m = await resolveBodyLength(a, o)) !== 0) {
|
|
1964
|
+
let k = new Request(t, {
|
|
2181
1965
|
method: "POST",
|
|
2182
1966
|
body: o,
|
|
2183
1967
|
duplex: "half"
|
|
2184
1968
|
}), E;
|
|
2185
|
-
if (utils$1.isFormData(o) && (E =
|
|
1969
|
+
if (utils$1.isFormData(o) && (E = k.headers.get("content-type")) && a.setContentType(E), k.body) {
|
|
2186
1970
|
const [S, C] = progressEventDecorator(
|
|
2187
|
-
|
|
1971
|
+
m,
|
|
2188
1972
|
progressEventReducer(asyncDecorator(u))
|
|
2189
1973
|
);
|
|
2190
|
-
o = trackStream(
|
|
1974
|
+
o = trackStream(k.body, DEFAULT_CHUNK_SIZE, S, C);
|
|
2191
1975
|
}
|
|
2192
1976
|
}
|
|
2193
|
-
utils$1.isString(
|
|
2194
|
-
const
|
|
2195
|
-
|
|
2196
|
-
...
|
|
2197
|
-
signal:
|
|
1977
|
+
utils$1.isString(d) || (d = d ? "include" : "omit");
|
|
1978
|
+
const x = "credentials" in Request.prototype;
|
|
1979
|
+
p = new Request(t, {
|
|
1980
|
+
...f,
|
|
1981
|
+
signal: h,
|
|
2198
1982
|
method: n.toUpperCase(),
|
|
2199
1983
|
headers: a.normalize().toJSON(),
|
|
2200
1984
|
body: o,
|
|
2201
1985
|
duplex: "half",
|
|
2202
|
-
credentials:
|
|
1986
|
+
credentials: x ? d : void 0
|
|
2203
1987
|
});
|
|
2204
|
-
let
|
|
2205
|
-
const
|
|
2206
|
-
if (supportsResponseStream && (i ||
|
|
2207
|
-
const
|
|
2208
|
-
["status", "statusText", "headers"].forEach((
|
|
2209
|
-
|
|
1988
|
+
let v = await fetch(p, f);
|
|
1989
|
+
const $ = supportsResponseStream && (c === "stream" || c === "response");
|
|
1990
|
+
if (supportsResponseStream && (i || $ && y)) {
|
|
1991
|
+
const k = {};
|
|
1992
|
+
["status", "statusText", "headers"].forEach((B) => {
|
|
1993
|
+
k[B] = v[B];
|
|
2210
1994
|
});
|
|
2211
|
-
const E = utils$1.toFiniteNumber(
|
|
1995
|
+
const E = utils$1.toFiniteNumber(v.headers.get("content-length")), [S, C] = i && progressEventDecorator(
|
|
2212
1996
|
E,
|
|
2213
1997
|
progressEventReducer(asyncDecorator(i), !0)
|
|
2214
1998
|
) || [];
|
|
2215
|
-
|
|
2216
|
-
trackStream(
|
|
1999
|
+
v = new Response(
|
|
2000
|
+
trackStream(v.body, DEFAULT_CHUNK_SIZE, S, () => {
|
|
2217
2001
|
C && C(), y && y();
|
|
2218
2002
|
}),
|
|
2219
|
-
|
|
2003
|
+
k
|
|
2220
2004
|
);
|
|
2221
2005
|
}
|
|
2222
2006
|
c = c || "text";
|
|
2223
|
-
let
|
|
2224
|
-
return
|
|
2225
|
-
settle(
|
|
2226
|
-
data:
|
|
2227
|
-
headers: AxiosHeaders$1.from(
|
|
2228
|
-
status:
|
|
2229
|
-
statusText:
|
|
2007
|
+
let _ = await resolvers[utils$1.findKey(resolvers, c) || "text"](v, e);
|
|
2008
|
+
return !$ && y && y(), await new Promise((k, E) => {
|
|
2009
|
+
settle(k, E, {
|
|
2010
|
+
data: _,
|
|
2011
|
+
headers: AxiosHeaders$1.from(v.headers),
|
|
2012
|
+
status: v.status,
|
|
2013
|
+
statusText: v.statusText,
|
|
2230
2014
|
config: e,
|
|
2231
|
-
request:
|
|
2015
|
+
request: p
|
|
2232
2016
|
});
|
|
2233
2017
|
});
|
|
2234
|
-
} catch (
|
|
2235
|
-
throw y && y(),
|
|
2236
|
-
new AxiosError$1("Network Error", AxiosError$1.ERR_NETWORK, e,
|
|
2018
|
+
} catch (x) {
|
|
2019
|
+
throw y && y(), x && x.name === "TypeError" && /Load failed|fetch/i.test(x.message) ? Object.assign(
|
|
2020
|
+
new AxiosError$1("Network Error", AxiosError$1.ERR_NETWORK, e, p),
|
|
2237
2021
|
{
|
|
2238
|
-
cause:
|
|
2022
|
+
cause: x.cause || x
|
|
2239
2023
|
}
|
|
2240
|
-
) : AxiosError$1.from(
|
|
2024
|
+
) : AxiosError$1.from(x, x && x.code, e, p);
|
|
2241
2025
|
}
|
|
2242
2026
|
}), knownAdapters = {
|
|
2243
2027
|
http: httpAdapter,
|
|
@@ -2258,23 +2042,23 @@ const renderReason = (e) => `- ${e}`, isResolvedHandle = (e) => utils$1.isFuncti
|
|
|
2258
2042
|
e = utils$1.isArray(e) ? e : [e];
|
|
2259
2043
|
const { length: t } = e;
|
|
2260
2044
|
let n, o;
|
|
2261
|
-
const
|
|
2262
|
-
for (let
|
|
2263
|
-
n = e[
|
|
2045
|
+
const r = {};
|
|
2046
|
+
for (let s = 0; s < t; s++) {
|
|
2047
|
+
n = e[s];
|
|
2264
2048
|
let l;
|
|
2265
2049
|
if (o = n, !isResolvedHandle(n) && (o = knownAdapters[(l = String(n)).toLowerCase()], o === void 0))
|
|
2266
2050
|
throw new AxiosError$1(`Unknown adapter '${l}'`);
|
|
2267
2051
|
if (o)
|
|
2268
2052
|
break;
|
|
2269
|
-
|
|
2053
|
+
r[l || "#" + s] = o;
|
|
2270
2054
|
}
|
|
2271
2055
|
if (!o) {
|
|
2272
|
-
const
|
|
2056
|
+
const s = Object.entries(r).map(
|
|
2273
2057
|
([i, u]) => `adapter ${i} ` + (u === !1 ? "is not supported by the environment" : "is not available in the build")
|
|
2274
2058
|
);
|
|
2275
|
-
let l = t ?
|
|
2276
|
-
` +
|
|
2277
|
-
`) : " " + renderReason(
|
|
2059
|
+
let l = t ? s.length > 1 ? `since :
|
|
2060
|
+
` + s.map(renderReason).join(`
|
|
2061
|
+
`) : " " + renderReason(s[0]) : "as no adapter specified";
|
|
2278
2062
|
throw new AxiosError$1(
|
|
2279
2063
|
"There is no suitable adapter to dispatch the request " + l,
|
|
2280
2064
|
"ERR_NOT_SUPPORT"
|
|
@@ -2306,7 +2090,7 @@ function dispatchRequest(e) {
|
|
|
2306
2090
|
), o.response.headers = AxiosHeaders$1.from(o.response.headers))), Promise.reject(o);
|
|
2307
2091
|
});
|
|
2308
2092
|
}
|
|
2309
|
-
const VERSION$1 = "1.
|
|
2093
|
+
const VERSION$1 = "1.10.0", validators$1 = {};
|
|
2310
2094
|
["object", "boolean", "number", "function", "string", "symbol"].forEach((e, t) => {
|
|
2311
2095
|
validators$1[e] = function(o) {
|
|
2312
2096
|
return typeof o === e || "a" + (t < 1 ? "n " : " ") + e;
|
|
@@ -2314,21 +2098,21 @@ const VERSION$1 = "1.11.0", validators$1 = {};
|
|
|
2314
2098
|
});
|
|
2315
2099
|
const deprecatedWarnings = {};
|
|
2316
2100
|
validators$1.transitional = function(t, n, o) {
|
|
2317
|
-
function s
|
|
2318
|
-
return "[Axios v" + VERSION$1 + "] Transitional option '" +
|
|
2101
|
+
function r(s, l) {
|
|
2102
|
+
return "[Axios v" + VERSION$1 + "] Transitional option '" + s + "'" + l + (o ? ". " + o : "");
|
|
2319
2103
|
}
|
|
2320
|
-
return (
|
|
2104
|
+
return (s, l, i) => {
|
|
2321
2105
|
if (t === !1)
|
|
2322
2106
|
throw new AxiosError$1(
|
|
2323
|
-
|
|
2107
|
+
r(l, " has been removed" + (n ? " in " + n : "")),
|
|
2324
2108
|
AxiosError$1.ERR_DEPRECATED
|
|
2325
2109
|
);
|
|
2326
2110
|
return n && !deprecatedWarnings[l] && (deprecatedWarnings[l] = !0, console.warn(
|
|
2327
|
-
|
|
2111
|
+
r(
|
|
2328
2112
|
l,
|
|
2329
2113
|
" has been deprecated since v" + n + " and will be removed in the near future"
|
|
2330
2114
|
)
|
|
2331
|
-
)), t ? t(
|
|
2115
|
+
)), t ? t(s, l, i) : !0;
|
|
2332
2116
|
};
|
|
2333
2117
|
};
|
|
2334
2118
|
validators$1.spelling = function(t) {
|
|
@@ -2338,17 +2122,17 @@ function assertOptions(e, t, n) {
|
|
|
2338
2122
|
if (typeof e != "object")
|
|
2339
2123
|
throw new AxiosError$1("options must be an object", AxiosError$1.ERR_BAD_OPTION_VALUE);
|
|
2340
2124
|
const o = Object.keys(e);
|
|
2341
|
-
let
|
|
2342
|
-
for (;
|
|
2343
|
-
const
|
|
2125
|
+
let r = o.length;
|
|
2126
|
+
for (; r-- > 0; ) {
|
|
2127
|
+
const s = o[r], l = t[s];
|
|
2344
2128
|
if (l) {
|
|
2345
|
-
const i = e[
|
|
2129
|
+
const i = e[s], u = i === void 0 || l(i, s, e);
|
|
2346
2130
|
if (u !== !0)
|
|
2347
|
-
throw new AxiosError$1("option " +
|
|
2131
|
+
throw new AxiosError$1("option " + s + " must be " + u, AxiosError$1.ERR_BAD_OPTION_VALUE);
|
|
2348
2132
|
continue;
|
|
2349
2133
|
}
|
|
2350
2134
|
if (n !== !0)
|
|
2351
|
-
throw new AxiosError$1("Unknown option " +
|
|
2135
|
+
throw new AxiosError$1("Unknown option " + s, AxiosError$1.ERR_BAD_OPTION);
|
|
2352
2136
|
}
|
|
2353
2137
|
}
|
|
2354
2138
|
const validator = {
|
|
@@ -2375,12 +2159,12 @@ let Axios$1 = class {
|
|
|
2375
2159
|
return await this._request(t, n);
|
|
2376
2160
|
} catch (o) {
|
|
2377
2161
|
if (o instanceof Error) {
|
|
2378
|
-
let
|
|
2379
|
-
Error.captureStackTrace ? Error.captureStackTrace(
|
|
2380
|
-
const
|
|
2162
|
+
let r = {};
|
|
2163
|
+
Error.captureStackTrace ? Error.captureStackTrace(r) : r = new Error();
|
|
2164
|
+
const s = r.stack ? r.stack.replace(/^.+\n/, "") : "";
|
|
2381
2165
|
try {
|
|
2382
|
-
o.stack ?
|
|
2383
|
-
` +
|
|
2166
|
+
o.stack ? s && !String(o.stack).endsWith(s.replace(/^.+\n.+\n/, "")) && (o.stack += `
|
|
2167
|
+
` + s) : o.stack = s;
|
|
2384
2168
|
} catch {
|
|
2385
2169
|
}
|
|
2386
2170
|
}
|
|
@@ -2389,30 +2173,30 @@ let Axios$1 = class {
|
|
|
2389
2173
|
}
|
|
2390
2174
|
_request(t, n) {
|
|
2391
2175
|
typeof t == "string" ? (n = n || {}, n.url = t) : n = t || {}, n = mergeConfig$1(this.defaults, n);
|
|
2392
|
-
const { transitional: o, paramsSerializer:
|
|
2176
|
+
const { transitional: o, paramsSerializer: r, headers: s } = n;
|
|
2393
2177
|
o !== void 0 && validator.assertOptions(o, {
|
|
2394
2178
|
silentJSONParsing: validators.transitional(validators.boolean),
|
|
2395
2179
|
forcedJSONParsing: validators.transitional(validators.boolean),
|
|
2396
2180
|
clarifyTimeoutError: validators.transitional(validators.boolean)
|
|
2397
|
-
}, !1),
|
|
2398
|
-
serialize:
|
|
2399
|
-
} : validator.assertOptions(
|
|
2181
|
+
}, !1), r != null && (utils$1.isFunction(r) ? n.paramsSerializer = {
|
|
2182
|
+
serialize: r
|
|
2183
|
+
} : validator.assertOptions(r, {
|
|
2400
2184
|
encode: validators.function,
|
|
2401
2185
|
serialize: validators.function
|
|
2402
2186
|
}, !0)), n.allowAbsoluteUrls !== void 0 || (this.defaults.allowAbsoluteUrls !== void 0 ? n.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls : n.allowAbsoluteUrls = !0), validator.assertOptions(n, {
|
|
2403
2187
|
baseUrl: validators.spelling("baseURL"),
|
|
2404
2188
|
withXsrfToken: validators.spelling("withXSRFToken")
|
|
2405
2189
|
}, !0), n.method = (n.method || this.defaults.method || "get").toLowerCase();
|
|
2406
|
-
let l =
|
|
2407
|
-
|
|
2408
|
-
|
|
2190
|
+
let l = s && utils$1.merge(
|
|
2191
|
+
s.common,
|
|
2192
|
+
s[n.method]
|
|
2409
2193
|
);
|
|
2410
|
-
|
|
2194
|
+
s && utils$1.forEach(
|
|
2411
2195
|
["delete", "get", "head", "post", "put", "patch", "common"],
|
|
2412
|
-
(
|
|
2413
|
-
delete
|
|
2196
|
+
(p) => {
|
|
2197
|
+
delete s[p];
|
|
2414
2198
|
}
|
|
2415
|
-
), n.headers = AxiosHeaders$1.concat(l,
|
|
2199
|
+
), n.headers = AxiosHeaders$1.concat(l, s);
|
|
2416
2200
|
const i = [];
|
|
2417
2201
|
let u = !0;
|
|
2418
2202
|
this.interceptors.request.forEach(function(y) {
|
|
@@ -2422,31 +2206,31 @@ let Axios$1 = class {
|
|
|
2422
2206
|
this.interceptors.response.forEach(function(y) {
|
|
2423
2207
|
c.push(y.fulfilled, y.rejected);
|
|
2424
2208
|
});
|
|
2425
|
-
let a,
|
|
2209
|
+
let a, d = 0, f;
|
|
2426
2210
|
if (!u) {
|
|
2427
|
-
const
|
|
2428
|
-
for (
|
|
2429
|
-
a = a.then(
|
|
2211
|
+
const p = [dispatchRequest.bind(this), void 0];
|
|
2212
|
+
for (p.unshift.apply(p, i), p.push.apply(p, c), f = p.length, a = Promise.resolve(n); d < f; )
|
|
2213
|
+
a = a.then(p[d++], p[d++]);
|
|
2430
2214
|
return a;
|
|
2431
2215
|
}
|
|
2432
|
-
|
|
2433
|
-
let
|
|
2434
|
-
for (
|
|
2435
|
-
const
|
|
2216
|
+
f = i.length;
|
|
2217
|
+
let h = n;
|
|
2218
|
+
for (d = 0; d < f; ) {
|
|
2219
|
+
const p = i[d++], y = i[d++];
|
|
2436
2220
|
try {
|
|
2437
|
-
|
|
2438
|
-
} catch (
|
|
2439
|
-
y.call(this,
|
|
2221
|
+
h = p(h);
|
|
2222
|
+
} catch (m) {
|
|
2223
|
+
y.call(this, m);
|
|
2440
2224
|
break;
|
|
2441
2225
|
}
|
|
2442
2226
|
}
|
|
2443
2227
|
try {
|
|
2444
|
-
a = dispatchRequest.call(this,
|
|
2445
|
-
} catch (
|
|
2446
|
-
return Promise.reject(
|
|
2228
|
+
a = dispatchRequest.call(this, h);
|
|
2229
|
+
} catch (p) {
|
|
2230
|
+
return Promise.reject(p);
|
|
2447
2231
|
}
|
|
2448
|
-
for (
|
|
2449
|
-
a = a.then(c[
|
|
2232
|
+
for (d = 0, f = c.length; d < f; )
|
|
2233
|
+
a = a.then(c[d++], c[d++]);
|
|
2450
2234
|
return a;
|
|
2451
2235
|
}
|
|
2452
2236
|
getUri(t) {
|
|
@@ -2466,44 +2250,44 @@ utils$1.forEach(["delete", "get", "head", "options"], function(t) {
|
|
|
2466
2250
|
});
|
|
2467
2251
|
utils$1.forEach(["post", "put", "patch"], function(t) {
|
|
2468
2252
|
function n(o) {
|
|
2469
|
-
return function(
|
|
2253
|
+
return function(s, l, i) {
|
|
2470
2254
|
return this.request(mergeConfig$1(i || {}, {
|
|
2471
2255
|
method: t,
|
|
2472
2256
|
headers: o ? {
|
|
2473
2257
|
"Content-Type": "multipart/form-data"
|
|
2474
2258
|
} : {},
|
|
2475
|
-
url:
|
|
2259
|
+
url: s,
|
|
2476
2260
|
data: l
|
|
2477
2261
|
}));
|
|
2478
2262
|
};
|
|
2479
2263
|
}
|
|
2480
2264
|
Axios$1.prototype[t] = n(), Axios$1.prototype[t + "Form"] = n(!0);
|
|
2481
2265
|
});
|
|
2482
|
-
let CancelToken$1 = class
|
|
2266
|
+
let CancelToken$1 = class R {
|
|
2483
2267
|
constructor(t) {
|
|
2484
2268
|
if (typeof t != "function")
|
|
2485
2269
|
throw new TypeError("executor must be a function.");
|
|
2486
2270
|
let n;
|
|
2487
|
-
this.promise = new Promise(function(
|
|
2488
|
-
n =
|
|
2271
|
+
this.promise = new Promise(function(s) {
|
|
2272
|
+
n = s;
|
|
2489
2273
|
});
|
|
2490
2274
|
const o = this;
|
|
2491
|
-
this.promise.then((
|
|
2275
|
+
this.promise.then((r) => {
|
|
2492
2276
|
if (!o._listeners) return;
|
|
2493
|
-
let
|
|
2494
|
-
for (;
|
|
2495
|
-
o._listeners[
|
|
2277
|
+
let s = o._listeners.length;
|
|
2278
|
+
for (; s-- > 0; )
|
|
2279
|
+
o._listeners[s](r);
|
|
2496
2280
|
o._listeners = null;
|
|
2497
|
-
}), this.promise.then = (
|
|
2498
|
-
let
|
|
2281
|
+
}), this.promise.then = (r) => {
|
|
2282
|
+
let s;
|
|
2499
2283
|
const l = new Promise((i) => {
|
|
2500
|
-
o.subscribe(i),
|
|
2501
|
-
}).then(
|
|
2284
|
+
o.subscribe(i), s = i;
|
|
2285
|
+
}).then(r);
|
|
2502
2286
|
return l.cancel = function() {
|
|
2503
|
-
o.unsubscribe(
|
|
2287
|
+
o.unsubscribe(s);
|
|
2504
2288
|
}, l;
|
|
2505
|
-
}, t(function(
|
|
2506
|
-
o.reason || (o.reason = new CanceledError$1(
|
|
2289
|
+
}, t(function(s, l, i) {
|
|
2290
|
+
o.reason || (o.reason = new CanceledError$1(s, l, i), n(o.reason));
|
|
2507
2291
|
});
|
|
2508
2292
|
}
|
|
2509
2293
|
/**
|
|
@@ -2545,8 +2329,8 @@ let CancelToken$1 = class A {
|
|
|
2545
2329
|
static source() {
|
|
2546
2330
|
let t;
|
|
2547
2331
|
return {
|
|
2548
|
-
token: new
|
|
2549
|
-
t =
|
|
2332
|
+
token: new R(function(r) {
|
|
2333
|
+
t = r;
|
|
2550
2334
|
}),
|
|
2551
2335
|
cancel: t
|
|
2552
2336
|
};
|
|
@@ -2630,8 +2414,8 @@ Object.entries(HttpStatusCode$1).forEach(([e, t]) => {
|
|
|
2630
2414
|
});
|
|
2631
2415
|
function createInstance(e) {
|
|
2632
2416
|
const t = new Axios$1(e), n = bind(Axios$1.prototype.request, t);
|
|
2633
|
-
return utils$1.extend(n, Axios$1.prototype, t, { allOwnKeys: !0 }), utils$1.extend(n, t, null, { allOwnKeys: !0 }), n.create = function(
|
|
2634
|
-
return createInstance(mergeConfig$1(e,
|
|
2417
|
+
return utils$1.extend(n, Axios$1.prototype, t, { allOwnKeys: !0 }), utils$1.extend(n, t, null, { allOwnKeys: !0 }), n.create = function(r) {
|
|
2418
|
+
return createInstance(mergeConfig$1(e, r));
|
|
2635
2419
|
}, n;
|
|
2636
2420
|
}
|
|
2637
2421
|
const axios = createInstance(defaults);
|
|
@@ -2691,10 +2475,10 @@ const {
|
|
|
2691
2475
|
},
|
|
2692
2476
|
emits: ["update:modelValue"],
|
|
2693
2477
|
setup(e, { emit: t }) {
|
|
2694
|
-
const n = e, o = t,
|
|
2478
|
+
const n = e, o = 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 () => {
|
|
2695
2479
|
try {
|
|
2696
2480
|
const { data: a } = await axios.get(`/api/suggest/${n.data}`);
|
|
2697
|
-
|
|
2481
|
+
r.value = a?.data || a;
|
|
2698
2482
|
} catch (a) {
|
|
2699
2483
|
console.error(a);
|
|
2700
2484
|
}
|
|
@@ -2702,73 +2486,73 @@ const {
|
|
|
2702
2486
|
return watch(
|
|
2703
2487
|
() => n.modelValue,
|
|
2704
2488
|
(a) => {
|
|
2705
|
-
if (typeof a == "boolean" &&
|
|
2706
|
-
const
|
|
2707
|
-
|
|
2489
|
+
if (typeof a == "boolean" && r.value.length === 1) {
|
|
2490
|
+
const d = l(r.value[0]);
|
|
2491
|
+
s[d] = a;
|
|
2708
2492
|
} else if (Array.isArray(a)) {
|
|
2709
|
-
const
|
|
2710
|
-
|
|
2711
|
-
if (!
|
|
2712
|
-
const
|
|
2713
|
-
|
|
2493
|
+
const d = new Set(a);
|
|
2494
|
+
r.value.forEach((f) => {
|
|
2495
|
+
if (!f.disabled) {
|
|
2496
|
+
const h = l(f);
|
|
2497
|
+
s[h] = d.has(h);
|
|
2714
2498
|
}
|
|
2715
2499
|
});
|
|
2716
2500
|
}
|
|
2717
2501
|
},
|
|
2718
2502
|
{ immediate: !0 }
|
|
2719
2503
|
), watch(
|
|
2720
|
-
|
|
2504
|
+
s,
|
|
2721
2505
|
() => {
|
|
2722
|
-
if (!
|
|
2506
|
+
if (!r.value.length) {
|
|
2723
2507
|
o("update:modelValue", null);
|
|
2724
2508
|
return;
|
|
2725
2509
|
}
|
|
2726
|
-
const a = Object.entries(
|
|
2510
|
+
const a = Object.entries(s).filter(([, d]) => d).map(([d]) => d);
|
|
2727
2511
|
o("update:modelValue", a.length === 0 ? null : a);
|
|
2728
2512
|
},
|
|
2729
2513
|
{ deep: !0 }
|
|
2730
2514
|
), onMounted(() => {
|
|
2731
2515
|
if (n.data)
|
|
2732
2516
|
c().then(() => {
|
|
2733
|
-
if (typeof n.modelValue == "boolean" &&
|
|
2734
|
-
const a = l(
|
|
2735
|
-
|
|
2517
|
+
if (typeof n.modelValue == "boolean" && r.value.length === 1) {
|
|
2518
|
+
const a = l(r.value[0]);
|
|
2519
|
+
s[a] = n.modelValue;
|
|
2736
2520
|
} else if (Array.isArray(n.modelValue)) {
|
|
2737
2521
|
const a = new Set(n.modelValue);
|
|
2738
|
-
|
|
2739
|
-
if (!
|
|
2740
|
-
const
|
|
2741
|
-
|
|
2522
|
+
r.value.forEach((d) => {
|
|
2523
|
+
if (!d.disabled) {
|
|
2524
|
+
const f = l(d);
|
|
2525
|
+
s[f] = a.has(f);
|
|
2742
2526
|
}
|
|
2743
2527
|
});
|
|
2744
2528
|
}
|
|
2745
2529
|
});
|
|
2746
|
-
else if (
|
|
2747
|
-
const a = l(
|
|
2748
|
-
|
|
2530
|
+
else if (r.value = n.options, typeof n.modelValue == "boolean" && r.value.length === 1) {
|
|
2531
|
+
const a = l(r.value[0]);
|
|
2532
|
+
s[a] = n.modelValue;
|
|
2749
2533
|
} else if (Array.isArray(n.modelValue)) {
|
|
2750
2534
|
const a = new Set(n.modelValue);
|
|
2751
|
-
|
|
2752
|
-
if (!
|
|
2753
|
-
const
|
|
2754
|
-
|
|
2535
|
+
r.value.forEach((d) => {
|
|
2536
|
+
if (!d.disabled) {
|
|
2537
|
+
const f = l(d);
|
|
2538
|
+
s[f] = a.has(f);
|
|
2755
2539
|
}
|
|
2756
2540
|
});
|
|
2757
2541
|
}
|
|
2758
|
-
}), (a,
|
|
2542
|
+
}), (a, d) => (openBlock(), createElementBlock("div", {
|
|
2759
2543
|
class: normalizeClass(["p-0 w-full gap-[6px]", [e.position === "vertical" ? "flex-col" : "", e.colSpan ? "grid" : "flex justify-start"]])
|
|
2760
2544
|
}, [
|
|
2761
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(
|
|
2762
|
-
modelValue:
|
|
2763
|
-
"onUpdate:modelValue": (
|
|
2764
|
-
value: l(
|
|
2545
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(r.value, (f) => (openBlock(), createBlock(_sfc_main$w, {
|
|
2546
|
+
modelValue: s[l(f)],
|
|
2547
|
+
"onUpdate:modelValue": (h) => s[l(f)] = h,
|
|
2548
|
+
value: l(f),
|
|
2765
2549
|
class: normalizeClass(u(e.colSpan)),
|
|
2766
|
-
disabled:
|
|
2767
|
-
label: i(
|
|
2768
|
-
key: l(
|
|
2769
|
-
icon:
|
|
2770
|
-
imgUrl:
|
|
2771
|
-
option:
|
|
2550
|
+
disabled: f.disabled,
|
|
2551
|
+
label: i(f),
|
|
2552
|
+
key: l(f),
|
|
2553
|
+
icon: f?.icon,
|
|
2554
|
+
imgUrl: f?.imgUrl,
|
|
2555
|
+
option: f,
|
|
2772
2556
|
slots: e.slots,
|
|
2773
2557
|
view: e.view
|
|
2774
2558
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "value", "class", "disabled", "label", "icon", "imgUrl", "option", "slots", "view"]))), 128))
|
|
@@ -2800,9 +2584,9 @@ const {
|
|
|
2800
2584
|
emits: ["update:modelValue"],
|
|
2801
2585
|
setup(e) {
|
|
2802
2586
|
const t = e, { inputClass: n } = useStyle(t.style), o = useModel(e, "modelValue");
|
|
2803
|
-
return (
|
|
2587
|
+
return (r, s) => withDirectives((openBlock(), createElementBlock("input", {
|
|
2804
2588
|
type: "date",
|
|
2805
|
-
"onUpdate:modelValue":
|
|
2589
|
+
"onUpdate:modelValue": s[0] || (s[0] = (l) => o.value = l),
|
|
2806
2590
|
placeholder: e.placeholder,
|
|
2807
2591
|
disabled: e.disabled,
|
|
2808
2592
|
class: normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f]", [unref(n)]]),
|
|
@@ -2815,15 +2599,15 @@ const {
|
|
|
2815
2599
|
}
|
|
2816
2600
|
}), fileUpload = async (e, t, n, o) => {
|
|
2817
2601
|
try {
|
|
2818
|
-
const
|
|
2819
|
-
|
|
2820
|
-
const { data:
|
|
2602
|
+
const r = new FormData();
|
|
2603
|
+
r.append("unique", "true"), r.append("file", e);
|
|
2604
|
+
const { data: s } = await axios.post(
|
|
2821
2605
|
`/file/upload/uploads?id=${t || ""}&form=${n || ""}&table=${o || ""}`,
|
|
2822
|
-
|
|
2606
|
+
r
|
|
2823
2607
|
);
|
|
2824
|
-
return
|
|
2825
|
-
} catch (
|
|
2826
|
-
console.error(
|
|
2608
|
+
return s;
|
|
2609
|
+
} catch (r) {
|
|
2610
|
+
console.error(r);
|
|
2827
2611
|
}
|
|
2828
2612
|
}, fileDelete = async (e) => {
|
|
2829
2613
|
try {
|
|
@@ -2838,8 +2622,8 @@ const {
|
|
|
2838
2622
|
headers: {
|
|
2839
2623
|
"Content-Type": "application/json"
|
|
2840
2624
|
}
|
|
2841
|
-
}), n = t.headers["content-type"], o = new TextDecoder("utf-8").decode(t.data),
|
|
2842
|
-
|
|
2625
|
+
}), n = t.headers["content-type"], o = new TextDecoder("utf-8").decode(t.data), r = new Blob([o], { type: n }), s = document.createElement("a");
|
|
2626
|
+
s.setAttribute("download", e), s.href = window.URL.createObjectURL(r), s.click();
|
|
2843
2627
|
} catch (t) {
|
|
2844
2628
|
console.error(t.message);
|
|
2845
2629
|
}
|
|
@@ -2872,7 +2656,7 @@ const IconPlus = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["render", _sfc_rende
|
|
|
2872
2656
|
"stroke-linecap": "round",
|
|
2873
2657
|
"stroke-linejoin": "round"
|
|
2874
2658
|
};
|
|
2875
|
-
function _sfc_render$7(e, t, n, o,
|
|
2659
|
+
function _sfc_render$7(e, t, n, o, r, s) {
|
|
2876
2660
|
return openBlock(), createElementBlock("svg", _hoisted_1$e, t[0] || (t[0] = [
|
|
2877
2661
|
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)
|
|
2878
2662
|
]));
|
|
@@ -2889,7 +2673,7 @@ const iconPdf = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["render", _sfc_render
|
|
|
2889
2673
|
"stroke-linecap": "round",
|
|
2890
2674
|
"stroke-linejoin": "round"
|
|
2891
2675
|
};
|
|
2892
|
-
function _sfc_render$6(e, t, n, o,
|
|
2676
|
+
function _sfc_render$6(e, t, n, o, r, s) {
|
|
2893
2677
|
return openBlock(), createElementBlock("svg", _hoisted_1$d, t[0] || (t[0] = [
|
|
2894
2678
|
createElementVNode("path", {
|
|
2895
2679
|
stroke: "none",
|
|
@@ -2929,7 +2713,7 @@ const IconCsv = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["render", _sfc_render
|
|
|
2929
2713
|
"stroke-linejoin": "round",
|
|
2930
2714
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-file-unknown"
|
|
2931
2715
|
};
|
|
2932
|
-
function _sfc_render$5(e, t, n, o,
|
|
2716
|
+
function _sfc_render$5(e, t, n, o, r, s) {
|
|
2933
2717
|
return openBlock(), createElementBlock("svg", _hoisted_1$c, t[0] || (t[0] = [
|
|
2934
2718
|
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)
|
|
2935
2719
|
]));
|
|
@@ -2946,7 +2730,7 @@ const IconFile = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["render", _sfc_rende
|
|
|
2946
2730
|
"stroke-linecap": "round",
|
|
2947
2731
|
"stroke-linejoin": "round"
|
|
2948
2732
|
};
|
|
2949
|
-
function _sfc_render$4(e, t, n, o,
|
|
2733
|
+
function _sfc_render$4(e, t, n, o, r, s) {
|
|
2950
2734
|
return openBlock(), createElementBlock("svg", _hoisted_1$b, t[0] || (t[0] = [
|
|
2951
2735
|
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)
|
|
2952
2736
|
]));
|
|
@@ -2963,7 +2747,7 @@ const IconZip = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["render", _sfc_render
|
|
|
2963
2747
|
"stroke-linecap": "round",
|
|
2964
2748
|
"stroke-linejoin": "round"
|
|
2965
2749
|
};
|
|
2966
|
-
function _sfc_render$3(e, t, n, o,
|
|
2750
|
+
function _sfc_render$3(e, t, n, o, r, s) {
|
|
2967
2751
|
return openBlock(), createElementBlock("svg", _hoisted_1$a, t[0] || (t[0] = [
|
|
2968
2752
|
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)
|
|
2969
2753
|
]));
|
|
@@ -3035,17 +2819,17 @@ const IconDownload = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["render", _sfc_r
|
|
|
3035
2819
|
emits: ["update:value", "update:item"],
|
|
3036
2820
|
setup(e) {
|
|
3037
2821
|
const t = useModel(e, "value"), n = useModel(e, "item"), o = e;
|
|
3038
|
-
return (
|
|
2822
|
+
return (r, s) => (openBlock(), createElementBlock("div", _hoisted_1$7, [
|
|
3039
2823
|
(openBlock(), createBlock(resolveDynamicComponent(unref(fileFormatPreview)(n.value)), {
|
|
3040
2824
|
src: n.value,
|
|
3041
2825
|
alt: "file",
|
|
3042
2826
|
class: "w-full h-full object-cover cursor-pointer",
|
|
3043
|
-
onClick:
|
|
2827
|
+
onClick: s[0] || (s[0] = (l) => unref(fileDownload)(n.value))
|
|
3044
2828
|
}, null, 8, ["src"])),
|
|
3045
2829
|
createElementVNode("div", _hoisted_2$4, [
|
|
3046
2830
|
createElementVNode("button", {
|
|
3047
2831
|
type: "button",
|
|
3048
|
-
onClick:
|
|
2832
|
+
onClick: s[1] || (s[1] = (l) => {
|
|
3049
2833
|
unref(fileDelete)(n.value), t.value = o.multiple ? t.value?.filter((i) => i !== n.value) : "";
|
|
3050
2834
|
}),
|
|
3051
2835
|
class: "w-6 h-6 flex items-center justify-center text-gray-500 bg-gray-200 rounded-lg hover:text-red-500"
|
|
@@ -3054,7 +2838,7 @@ const IconDownload = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["render", _sfc_r
|
|
|
3054
2838
|
]),
|
|
3055
2839
|
createElementVNode("button", {
|
|
3056
2840
|
type: "button",
|
|
3057
|
-
onClick:
|
|
2841
|
+
onClick: s[2] || (s[2] = (l) => unref(fileDownload)(n.value)),
|
|
3058
2842
|
class: "w-6 h-6 flex items-center justify-center text-gray-500 bg-gray-200 rounded-lg hover:text-blue-500"
|
|
3059
2843
|
}, [
|
|
3060
2844
|
createVNode(IconDownload, { class: "w-4 h-4" })
|
|
@@ -3077,7 +2861,7 @@ const IconDownload = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["render", _sfc_r
|
|
|
3077
2861
|
}),
|
|
3078
2862
|
emits: ["update:modelValue"],
|
|
3079
2863
|
setup(e) {
|
|
3080
|
-
const t = e, n = useModel(e, "modelValue"), o = ref(null),
|
|
2864
|
+
const t = e, n = useModel(e, "modelValue"), o = ref(null), r = (l) => Array.isArray(n.value) && n.value[l] || "", s = async (l) => {
|
|
3081
2865
|
if (t.format) {
|
|
3082
2866
|
const c = l.target.files?.[0];
|
|
3083
2867
|
if (!c || !c.name.endsWith(t.format))
|
|
@@ -3094,7 +2878,7 @@ const IconDownload = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["render", _sfc_r
|
|
|
3094
2878
|
ref_key: "fileInput",
|
|
3095
2879
|
ref: o,
|
|
3096
2880
|
type: "file",
|
|
3097
|
-
onChange:
|
|
2881
|
+
onChange: s
|
|
3098
2882
|
}, null, 544),
|
|
3099
2883
|
!l.multiple && n.value ? (openBlock(), createBlock(VsInputFileListItem, {
|
|
3100
2884
|
key: 0,
|
|
@@ -3108,7 +2892,7 @@ const IconDownload = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["render", _sfc_r
|
|
|
3108
2892
|
key: c,
|
|
3109
2893
|
value: n.value,
|
|
3110
2894
|
"onUpdate:value": i[2] || (i[2] = (a) => n.value = a),
|
|
3111
|
-
item:
|
|
2895
|
+
item: r(c)
|
|
3112
2896
|
}, null, 8, ["multiple", "value", "item"]))), 128)),
|
|
3113
2897
|
createElementVNode("div", {
|
|
3114
2898
|
onClick: i[3] || (i[3] = (u) => !l.disabled && o.value?.click()),
|
|
@@ -3152,12 +2936,12 @@ const IconDownload = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["render", _sfc_r
|
|
|
3152
2936
|
(o) => {
|
|
3153
2937
|
n.value = o;
|
|
3154
2938
|
}
|
|
3155
|
-
), (o,
|
|
2939
|
+
), (o, r) => (openBlock(), createElementBlock("div", null, [
|
|
3156
2940
|
createElementVNode("div", _hoisted_1$5, [
|
|
3157
2941
|
createElementVNode("p", _hoisted_2$2, toDisplayString(e.title), 1),
|
|
3158
2942
|
createVNode(_sfc_main$r, {
|
|
3159
2943
|
modelValue: n.value,
|
|
3160
|
-
"onUpdate:modelValue":
|
|
2944
|
+
"onUpdate:modelValue": r[0] || (r[0] = (s) => n.value = s),
|
|
3161
2945
|
style: normalizeStyle(e.style)
|
|
3162
2946
|
}, null, 8, ["modelValue", "style"])
|
|
3163
2947
|
]),
|
|
@@ -3196,10 +2980,10 @@ const IconDownload = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["render", _sfc_r
|
|
|
3196
2980
|
(o) => {
|
|
3197
2981
|
n.value = o;
|
|
3198
2982
|
}
|
|
3199
|
-
), (o,
|
|
2983
|
+
), (o, r) => (openBlock(), createElementBlock("div", null, [
|
|
3200
2984
|
createElementVNode("button", {
|
|
3201
2985
|
type: "button",
|
|
3202
|
-
onClick:
|
|
2986
|
+
onClick: r[0] || (r[0] = (s) => n.value = !n.value),
|
|
3203
2987
|
class: "flex items-center gap-2"
|
|
3204
2988
|
}, [
|
|
3205
2989
|
createVNode(unref(IconChevronDown), {
|
|
@@ -3307,19 +3091,19 @@ const IconDownload = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["render", _sfc_r
|
|
|
3307
3091
|
}
|
|
3308
3092
|
},
|
|
3309
3093
|
setup(e) {
|
|
3310
|
-
const t = e, n = inject("formValues", { default: {} }), o = inject("form"),
|
|
3094
|
+
const t = e, n = inject("formValues", { default: {} }), o = inject("form"), r = computed(() => t.schema?.filter((l) => {
|
|
3311
3095
|
const i = l?.conditions;
|
|
3312
3096
|
if (!i) return !0;
|
|
3313
3097
|
const u = Array.isArray(i) ? i[0] : i, c = n?.value?.[u];
|
|
3314
3098
|
return isVisible(c, i);
|
|
3315
|
-
})),
|
|
3316
|
-
return (l, i) => e.schema?.length ? (openBlock(), createBlock(resolveDynamicComponent(
|
|
3099
|
+
})), s = computed(() => views[t.view]);
|
|
3100
|
+
return (l, i) => e.schema?.length ? (openBlock(), createBlock(resolveDynamicComponent(s.value), {
|
|
3317
3101
|
key: 0,
|
|
3318
3102
|
title: e.title,
|
|
3319
3103
|
style: normalizeStyle(e.style)
|
|
3320
3104
|
}, {
|
|
3321
3105
|
default: withCtx(() => [
|
|
3322
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(
|
|
3106
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(r.value, (u) => (openBlock(), createBlock(_sfc_main$1, mergeProps({
|
|
3323
3107
|
key: u.name
|
|
3324
3108
|
}, { ref_for: !0 }, u, {
|
|
3325
3109
|
item: u,
|
|
@@ -3335,44 +3119,44 @@ const IconDownload = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["render", _sfc_r
|
|
|
3335
3119
|
}), dynamicPosition = async (e, t, n, o = 10) => {
|
|
3336
3120
|
if (!t || !n) return;
|
|
3337
3121
|
await nextTick();
|
|
3338
|
-
const
|
|
3339
|
-
if (!
|
|
3340
|
-
const l = await parseInt(t?.getBoundingClientRect()?.height.toString()), i = await parseInt(t?.getBoundingClientRect()?.width.toString()), u = await parseInt(n?.getBoundingClientRect()?.height.toString()), c = await parseInt(n?.getBoundingClientRect()?.width.toString()), a = await window.innerHeight,
|
|
3341
|
-
let
|
|
3342
|
-
const
|
|
3122
|
+
const r = await n?.getBoundingClientRect(), s = await t?.getBoundingClientRect();
|
|
3123
|
+
if (!s || !r) return;
|
|
3124
|
+
const l = await parseInt(t?.getBoundingClientRect()?.height.toString()), i = await parseInt(t?.getBoundingClientRect()?.width.toString()), u = await parseInt(n?.getBoundingClientRect()?.height.toString()), c = await parseInt(n?.getBoundingClientRect()?.width.toString()), a = await window.innerHeight, d = await window.innerWidth;
|
|
3125
|
+
let f = 0, h = 0;
|
|
3126
|
+
const p = s.bottom + o + u;
|
|
3343
3127
|
switch (e) {
|
|
3344
3128
|
case "top":
|
|
3345
|
-
|
|
3129
|
+
s.top - r.height - o < 0 ? f = s.top - r.height + o + u + l : f = s.top - r.height - o, d > c + s.right + 30 ? h = s.left - r.width / 2 + s.width / 2 : h = d - 30 - c;
|
|
3346
3130
|
break;
|
|
3347
3131
|
case "bottom":
|
|
3348
|
-
a >
|
|
3132
|
+
a > p ? f = s.bottom + o : f = s.bottom - o - u - l, h = s.left - r.width / 2 + s.width / 2;
|
|
3349
3133
|
break;
|
|
3350
3134
|
case "left":
|
|
3351
|
-
|
|
3135
|
+
f = s.top - r.height / 2 + s.height / 2, s.left - r.width - o > 0 ? h = s.left - r.width - o : h = 10;
|
|
3352
3136
|
break;
|
|
3353
3137
|
case "right":
|
|
3354
|
-
|
|
3138
|
+
f = s.top - r.height / 2 + s.height / 2, d - i > c ? h = s.right + o : h = d - 30 - c;
|
|
3355
3139
|
break;
|
|
3356
3140
|
case "top-right":
|
|
3357
|
-
|
|
3141
|
+
s.top - r.height - o < 0 ? f = s.top - r.height + o + u + l : f = s.top - r.height - o, d - i > c ? h = s.right + o : h = d - 30 - c;
|
|
3358
3142
|
break;
|
|
3359
3143
|
case "top-left":
|
|
3360
|
-
|
|
3144
|
+
s.top - r.height - o < 0 ? f = s.top - r.height + o + u + l : f = s.top - r.height - o, s.left - r.width - o > 0 ? h = s.left - r.width - o : h = 10;
|
|
3361
3145
|
break;
|
|
3362
3146
|
case "top-start":
|
|
3363
|
-
|
|
3147
|
+
s.top - r.height - o < 0 ? f = s.top - r.height + o + u + l : f = s.top - r.height - o, s.left > 0 ? h = s.left : h = 10;
|
|
3364
3148
|
break;
|
|
3365
3149
|
case "bottom-right":
|
|
3366
|
-
a >
|
|
3150
|
+
a > p ? f = s.bottom + o : f = s.bottom - o - u - l, d - i > c ? h = s.left : h = d - 30 - c;
|
|
3367
3151
|
break;
|
|
3368
3152
|
case "bottom-left":
|
|
3369
|
-
a >
|
|
3153
|
+
a > p ? f = s.bottom + o : f = s.bottom - o - u - l, s.left > 0 ? h = s.right - c : h = 10;
|
|
3370
3154
|
break;
|
|
3371
3155
|
case "bottom-start":
|
|
3372
|
-
a >
|
|
3156
|
+
a > p ? f = s.bottom + o : f = s.bottom - o - u - l, s.left > 0 ? h = s.left : h = 10;
|
|
3373
3157
|
break;
|
|
3374
3158
|
}
|
|
3375
|
-
|
|
3159
|
+
f + u > a ? f = a - u - o : f < 0 && (f = o), h + c > d ? h = d - c - o : h < 0 && (h = o), n instanceof HTMLElement && (n.style.top = `${f}px`, n.style.left = `${h}px`, n.style.position = "fixed");
|
|
3376
3160
|
}, _sfc_main$4 = {}, _hoisted_1$2 = {
|
|
3377
3161
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3378
3162
|
viewBox: "0 0 24 24",
|
|
@@ -3414,6 +3198,8 @@ const IconMagnifyingGlass = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render",
|
|
|
3414
3198
|
style: { default: () => ({}) },
|
|
3415
3199
|
disabled: { type: Boolean },
|
|
3416
3200
|
mode: {},
|
|
3201
|
+
api: {},
|
|
3202
|
+
search: { type: Boolean },
|
|
3417
3203
|
error: { default: null }
|
|
3418
3204
|
}, {
|
|
3419
3205
|
modelValue: {
|
|
@@ -3424,93 +3210,93 @@ const IconMagnifyingGlass = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render",
|
|
|
3424
3210
|
}),
|
|
3425
3211
|
emits: ["update:modelValue"],
|
|
3426
3212
|
setup(e) {
|
|
3427
|
-
const t = e, { inputClass:
|
|
3428
|
-
let
|
|
3429
|
-
const
|
|
3430
|
-
if (
|
|
3431
|
-
const b =
|
|
3213
|
+
const t = e, n = computed(() => t.mode || (t.api || t.search ? "search" : null)), { inputClass: o } = 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([]), h = ref(""), p = ref(null);
|
|
3214
|
+
let y = null;
|
|
3215
|
+
const m = computed(() => {
|
|
3216
|
+
if (a.value?.length) {
|
|
3217
|
+
const b = a.value?.filter((g) => g?.id !== c.value?.id);
|
|
3432
3218
|
return [
|
|
3433
|
-
|
|
3434
|
-
].concat(b)?.filter((
|
|
3219
|
+
c.value
|
|
3220
|
+
].concat(b)?.filter((g) => g !== null);
|
|
3435
3221
|
}
|
|
3436
3222
|
return [];
|
|
3437
|
-
}),
|
|
3223
|
+
}), x = async () => {
|
|
3438
3224
|
try {
|
|
3439
3225
|
const { data: b } = await axios.get(
|
|
3440
|
-
`${t.host}/${t.prefix}/suggest/${t.data}?json=1&key=${
|
|
3226
|
+
`${t.host}/${t.prefix}/suggest/${t.data}?json=1&key=${h.value}`
|
|
3441
3227
|
);
|
|
3442
3228
|
return b.data;
|
|
3443
3229
|
} catch {
|
|
3444
3230
|
return [];
|
|
3445
3231
|
}
|
|
3446
|
-
},
|
|
3447
|
-
document.body.click(),
|
|
3448
|
-
},
|
|
3449
|
-
|
|
3450
|
-
}, k = (b,
|
|
3451
|
-
if (!b || !
|
|
3452
|
-
const
|
|
3453
|
-
|
|
3454
|
-
},
|
|
3455
|
-
if (!
|
|
3456
|
-
const { keyCode:
|
|
3457
|
-
if ([38, 40, 13].includes(
|
|
3458
|
-
if (
|
|
3459
|
-
|
|
3460
|
-
} else if (
|
|
3461
|
-
if (
|
|
3462
|
-
|
|
3463
|
-
} else if (
|
|
3464
|
-
const
|
|
3465
|
-
|
|
3232
|
+
}, v = async (b) => {
|
|
3233
|
+
document.body.click(), u.value = b !== void 0 ? b : !u.value, u.value && !a.value?.length && (!t.options?.length && t.data ? a.value = await x() : 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;
|
|
3234
|
+
}, $ = () => u.value ? v(!1) : null, _ = (b) => {
|
|
3235
|
+
c.value = b, r.value = b.id, v(!1);
|
|
3236
|
+
}, k = (b, g) => {
|
|
3237
|
+
if (!b || !g) return;
|
|
3238
|
+
const w = b.offsetTop, A = w + b.offsetHeight, V = g.scrollTop, O = V + g.clientHeight;
|
|
3239
|
+
w < V ? Object.assign(g, { scrollTop: w - 80 }) : A > O && Object.assign(g, { scrollTop: A - g.clientHeight + 4 });
|
|
3240
|
+
}, E = (b) => {
|
|
3241
|
+
if (!u.value) return;
|
|
3242
|
+
const { keyCode: g } = b;
|
|
3243
|
+
if ([38, 40, 13].includes(g) && b.preventDefault(), g === 38) {
|
|
3244
|
+
if (d.value === 0) return;
|
|
3245
|
+
d.value -= 1, k(f.value[d.value], i.value);
|
|
3246
|
+
} else if (g === 40) {
|
|
3247
|
+
if (d.value + 1 >= m.value?.length) return;
|
|
3248
|
+
d.value += 1, k(f.value[d.value], i.value);
|
|
3249
|
+
} else if (g === 13) {
|
|
3250
|
+
const w = m.value[d.value];
|
|
3251
|
+
w && _(w);
|
|
3466
3252
|
}
|
|
3467
|
-
},
|
|
3468
|
-
if (
|
|
3469
|
-
const { keyCode:
|
|
3470
|
-
[38, 40].includes(
|
|
3471
|
-
}, S = (b) => {
|
|
3472
|
-
i.value && r.value && l.value && !l.value.contains(b.target) && (i.value = !1);
|
|
3253
|
+
}, S = async (b) => {
|
|
3254
|
+
if (u.value) return;
|
|
3255
|
+
const { keyCode: g } = b;
|
|
3256
|
+
[38, 40].includes(g) && (await b.preventDefault(), d.value = 0, setTimeout(() => v()));
|
|
3473
3257
|
}, C = (b) => {
|
|
3474
|
-
|
|
3258
|
+
u.value && l.value && i.value && !i.value.contains(b.target) && (u.value = !1);
|
|
3259
|
+
}, B = (b) => {
|
|
3260
|
+
b?.key === "Escape" && u.value && v(!1);
|
|
3475
3261
|
};
|
|
3476
3262
|
return onMounted(async () => {
|
|
3477
|
-
addEventListener("click",
|
|
3263
|
+
addEventListener("click", $), addEventListener("keydown", E), addEventListener("scroll", C, !0), addEventListener("keydown", B), t.options && (a.value = t.options), r.value && !t.options?.length && t.data && (a.value = await x()), c.value = a.value?.find((b) => b?.id.toString() === r.value?.toString()) || null;
|
|
3478
3264
|
}), onUnmounted(() => {
|
|
3479
|
-
removeEventListener("click",
|
|
3480
|
-
}), watch(
|
|
3481
|
-
let
|
|
3482
|
-
(b === "" || b.trimStart().length !== 0) && (
|
|
3483
|
-
!t.options?.length && t.data ?
|
|
3265
|
+
removeEventListener("click", $), removeEventListener("keydown", E), removeEventListener("scroll", C, !0), removeEventListener("keydown", B);
|
|
3266
|
+
}), watch(h, (b) => {
|
|
3267
|
+
let g = !1;
|
|
3268
|
+
(b === "" || b.trimStart().length !== 0) && (g = !0), g && (y && clearTimeout(y), y = setTimeout(async () => {
|
|
3269
|
+
!t.options?.length && t.data ? a.value = await x() : a.value = t.options.filter((w) => w.text.toLowerCase().includes(b.toLowerCase()));
|
|
3484
3270
|
}, 200));
|
|
3485
|
-
}), (b,
|
|
3271
|
+
}), (b, g) => (openBlock(), createElementBlock("div", {
|
|
3486
3272
|
class: "relative w-full",
|
|
3487
3273
|
ref_key: "select",
|
|
3488
|
-
ref:
|
|
3489
|
-
onClick:
|
|
3274
|
+
ref: l,
|
|
3275
|
+
onClick: g[5] || (g[5] = withModifiers(() => {
|
|
3490
3276
|
}, ["stop"]))
|
|
3491
3277
|
}, [
|
|
3492
3278
|
createElementVNode("button", {
|
|
3493
3279
|
type: "button",
|
|
3494
3280
|
class: normalizeClass(["block w-full flex items-center gap-[8px] pl-[16px] py-[5px] bg-white w-[calc(100%)] overflow-ellipsis", [
|
|
3495
|
-
|
|
3496
|
-
|
|
3497
|
-
unref(
|
|
3281
|
+
u.value ? `ring-rind ring-2 ring-${b.style?.primaryColor || "blue"}-500` : "",
|
|
3282
|
+
c.value?.text ? "pr-[50px]" : "pr-[25px]",
|
|
3283
|
+
unref(o),
|
|
3498
3284
|
b.customClass,
|
|
3499
3285
|
{ "!border-red-600": b.error }
|
|
3500
3286
|
]]),
|
|
3501
|
-
onKeydown:
|
|
3502
|
-
onClick:
|
|
3287
|
+
onKeydown: S,
|
|
3288
|
+
onClick: g[0] || (g[0] = (w) => v(!u.value)),
|
|
3503
3289
|
disabled: b.disabled,
|
|
3504
3290
|
style: {
|
|
3505
3291
|
border: "1px solid #CFD9E0"
|
|
3506
3292
|
}
|
|
3507
3293
|
}, [
|
|
3508
|
-
|
|
3294
|
+
c.value?.color ? (openBlock(), createElementBlock("span", {
|
|
3509
3295
|
key: 0,
|
|
3510
3296
|
class: "w-[16px] h-[16px] rounded-md block",
|
|
3511
|
-
style: normalizeStyle({ backgroundColor:
|
|
3297
|
+
style: normalizeStyle({ backgroundColor: c.value?.color })
|
|
3512
3298
|
}, null, 4)) : createCommentVNode("", !0),
|
|
3513
|
-
|
|
3299
|
+
c.value?.text ? (openBlock(), createElementBlock("span", _hoisted_2, toDisplayString(c.value?.text), 1)) : (openBlock(), createElementBlock("span", _hoisted_3, toDisplayString(b.placeholder), 1))
|
|
3514
3300
|
], 42, _hoisted_1$1),
|
|
3515
3301
|
createElementVNode("span", _hoisted_4, [
|
|
3516
3302
|
createVNode(unref(IconChevronTopBottom), {
|
|
@@ -3518,11 +3304,11 @@ const IconMagnifyingGlass = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render",
|
|
|
3518
3304
|
width: "14"
|
|
3519
3305
|
})
|
|
3520
3306
|
]),
|
|
3521
|
-
|
|
3307
|
+
c.value?.text ? (openBlock(), createElementBlock("button", {
|
|
3522
3308
|
key: 0,
|
|
3523
3309
|
type: "button",
|
|
3524
|
-
onClick:
|
|
3525
|
-
|
|
3310
|
+
onClick: g[1] || (g[1] = (w) => {
|
|
3311
|
+
r.value = null, c.value = null;
|
|
3526
3312
|
}),
|
|
3527
3313
|
class: "absolute top-[50%] text-gray-500 translate-y-[-50%] hover:text-red-600 right-[30px]"
|
|
3528
3314
|
}, [
|
|
@@ -3535,59 +3321,59 @@ const IconMagnifyingGlass = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render",
|
|
|
3535
3321
|
withDirectives(createElementVNode("ul", {
|
|
3536
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",
|
|
3537
3323
|
ref_key: "list",
|
|
3538
|
-
ref:
|
|
3324
|
+
ref: i,
|
|
3539
3325
|
style: normalizeStyle({
|
|
3540
3326
|
width: s.value.width,
|
|
3541
3327
|
maxHeight: b.maxHeight + "px",
|
|
3542
3328
|
backgroundColor: "white"
|
|
3543
3329
|
}),
|
|
3544
|
-
onClick:
|
|
3330
|
+
onClick: g[4] || (g[4] = withModifiers(() => {
|
|
3545
3331
|
}, ["stop"]))
|
|
3546
3332
|
}, [
|
|
3547
|
-
|
|
3333
|
+
n.value === "search" ? (openBlock(), createElementBlock("li", _hoisted_5, [
|
|
3548
3334
|
createElementVNode("div", _hoisted_6, [
|
|
3549
3335
|
withDirectives(createElementVNode("input", {
|
|
3550
|
-
"onUpdate:modelValue":
|
|
3336
|
+
"onUpdate:modelValue": g[2] || (g[2] = (w) => h.value = w),
|
|
3551
3337
|
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",
|
|
3552
3338
|
placeholder: "Пошук",
|
|
3553
3339
|
type: "text",
|
|
3554
3340
|
ref_key: "inputRef",
|
|
3555
3341
|
ref: p
|
|
3556
3342
|
}, null, 512), [
|
|
3557
|
-
[vModelText,
|
|
3343
|
+
[vModelText, h.value]
|
|
3558
3344
|
]),
|
|
3559
3345
|
createVNode(IconMagnifyingGlass, {
|
|
3560
3346
|
width: "15px",
|
|
3561
3347
|
height: "15px",
|
|
3562
3348
|
class: "absolute text-gray-400 -translate-y-1/2 left-4 top-1/2"
|
|
3563
3349
|
}),
|
|
3564
|
-
|
|
3350
|
+
h.value != "" ? (openBlock(), createBlock(unref(IconClose), {
|
|
3565
3351
|
key: 0,
|
|
3566
3352
|
width: "15px",
|
|
3567
3353
|
height: "15px",
|
|
3568
|
-
onClick:
|
|
3354
|
+
onClick: g[3] || (g[3] = (w) => h.value = ""),
|
|
3569
3355
|
class: "absolute text-gray-400 -translate-y-1/2 cursor-pointer hover:text-red-500 right-4 top-1/2"
|
|
3570
3356
|
})) : createCommentVNode("", !0)
|
|
3571
3357
|
])
|
|
3572
3358
|
])) : createCommentVNode("", !0),
|
|
3573
|
-
|
|
3574
|
-
|
|
3575
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(
|
|
3576
|
-
onClick: (V) =>
|
|
3577
|
-
key:
|
|
3359
|
+
m.value?.length ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
3360
|
+
g[6] || (g[6] = createElementVNode("li", { class: "sticky top-[-4px] text-[12px] bg-white p-1 z-[2] px-4 text-gray-400" }, " Натисніть Enter для вибору, ↑↓ для навігації, Esc для закриття ", -1)),
|
|
3361
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(m.value, (w, A) => (openBlock(), createElementBlock("li", {
|
|
3362
|
+
onClick: (V) => _(w),
|
|
3363
|
+
key: w?.id,
|
|
3578
3364
|
ref_for: !0,
|
|
3579
|
-
ref: (V) => f.value[
|
|
3580
|
-
class: normalizeClass(["cursor-pointer relative py-2 px-4 w-full text-[14px] text-gray-700 hover:bg-gray-100 rounded-lg", [
|
|
3365
|
+
ref: (V) => f.value[A] = V,
|
|
3366
|
+
class: normalizeClass(["cursor-pointer relative py-2 px-4 w-full text-[14px] text-gray-700 hover:bg-gray-100 rounded-lg", [d.value == A ? "bg-gray-100" : ""]])
|
|
3581
3367
|
}, [
|
|
3582
3368
|
createElementVNode("span", _hoisted_8, [
|
|
3583
|
-
|
|
3369
|
+
w?.color ? (openBlock(), createElementBlock("span", {
|
|
3584
3370
|
key: 0,
|
|
3585
3371
|
class: "w-[16px] h-[16px] rounded-md block",
|
|
3586
|
-
style: normalizeStyle({ backgroundColor:
|
|
3372
|
+
style: normalizeStyle({ backgroundColor: w?.color })
|
|
3587
3373
|
}, null, 4)) : createCommentVNode("", !0),
|
|
3588
|
-
createTextVNode(" " + toDisplayString(
|
|
3374
|
+
createTextVNode(" " + toDisplayString(w?.text), 1)
|
|
3589
3375
|
]),
|
|
3590
|
-
|
|
3376
|
+
r.value == w?.id ? (openBlock(), createBlock(unref(IconCheck), {
|
|
3591
3377
|
key: 0,
|
|
3592
3378
|
height: "14",
|
|
3593
3379
|
width: "14",
|
|
@@ -3597,7 +3383,7 @@ const IconMagnifyingGlass = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render",
|
|
|
3597
3383
|
], 10, _hoisted_7))), 128))
|
|
3598
3384
|
], 64)) : (openBlock(), createElementBlock("li", _hoisted_9, "Дані відсутні"))
|
|
3599
3385
|
], 4), [
|
|
3600
|
-
[vShow,
|
|
3386
|
+
[vShow, u.value]
|
|
3601
3387
|
])
|
|
3602
3388
|
]))
|
|
3603
3389
|
], 512));
|
|
@@ -3628,8 +3414,8 @@ const IconMagnifyingGlass = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render",
|
|
|
3628
3414
|
emits: ["update:modelValue"],
|
|
3629
3415
|
setup(e) {
|
|
3630
3416
|
const t = e, { inputClass: n } = useStyle(t.style), o = useModel(e, "modelValue");
|
|
3631
|
-
return (
|
|
3632
|
-
"onUpdate:modelValue":
|
|
3417
|
+
return (r, s) => withDirectives((openBlock(), createElementBlock("textarea", {
|
|
3418
|
+
"onUpdate:modelValue": s[0] || (s[0] = (l) => o.value = l),
|
|
3633
3419
|
placeholder: e.placeholder,
|
|
3634
3420
|
disabled: e.disabled,
|
|
3635
3421
|
row: "2",
|
|
@@ -3679,12 +3465,12 @@ const IconMagnifyingGlass = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render",
|
|
|
3679
3465
|
},
|
|
3680
3466
|
setup(e) {
|
|
3681
3467
|
const t = e, n = computed(() => layouts$1[`${t.layout}`]), o = computed(() => inputs?.[`vs-input-${t.type}`]);
|
|
3682
|
-
return (
|
|
3468
|
+
return (r, s) => (openBlock(), createBlock(resolveDynamicComponent(n.value), mergeProps(r.$attrs, {
|
|
3683
3469
|
style: e.style,
|
|
3684
3470
|
item: e.item
|
|
3685
3471
|
}), {
|
|
3686
3472
|
default: withCtx(() => [
|
|
3687
|
-
(openBlock(), createBlock(resolveDynamicComponent(o.value), mergeProps(
|
|
3473
|
+
(openBlock(), createBlock(resolveDynamicComponent(o.value), mergeProps(r.$attrs, { style: e.style }), null, 16, ["style"]))
|
|
3688
3474
|
]),
|
|
3689
3475
|
_: 1
|
|
3690
3476
|
}, 16, ["style", "item"]));
|
|
@@ -3736,28 +3522,28 @@ function convertSchema(e) {
|
|
|
3736
3522
|
}
|
|
3737
3523
|
function useForm(e, t) {
|
|
3738
3524
|
const n = convertSchema(t), o = ref({});
|
|
3739
|
-
function
|
|
3525
|
+
function r(u) {
|
|
3740
3526
|
const c = u?.conditions;
|
|
3741
3527
|
if (!c) return !0;
|
|
3742
|
-
const a = Array.isArray(c) ? c[0] : c,
|
|
3743
|
-
return isVisible(
|
|
3528
|
+
const a = Array.isArray(c) ? c[0] : c, d = e?.value?.[a];
|
|
3529
|
+
return isVisible(d, c);
|
|
3744
3530
|
}
|
|
3745
|
-
const
|
|
3531
|
+
const s = (u = n, c = !0) => (u.forEach((a) => {
|
|
3746
3532
|
if (a.rules) {
|
|
3747
|
-
if (!
|
|
3533
|
+
if (!r(a)) {
|
|
3748
3534
|
console.log(a.name, "skip hidden"), delete o.value[a.name];
|
|
3749
3535
|
return;
|
|
3750
3536
|
}
|
|
3751
|
-
a.rules.forEach((
|
|
3752
|
-
const
|
|
3753
|
-
|
|
3537
|
+
a.rules.forEach((d) => {
|
|
3538
|
+
const f = checkFormRules(e.value[a.name], d);
|
|
3539
|
+
f ? o.value[a.name] = f : delete o.value[a.name];
|
|
3754
3540
|
});
|
|
3755
3541
|
}
|
|
3756
|
-
a.schema &&
|
|
3757
|
-
}), c && Object.values(o.value).some(Boolean) ? o.value : null), l = computed(() => n?.filter((u) =>
|
|
3542
|
+
a.schema && s(a.schema, !1);
|
|
3543
|
+
}), c && Object.values(o.value).some(Boolean) ? o.value : null), l = computed(() => n?.filter((u) => r(u)));
|
|
3758
3544
|
return {
|
|
3759
3545
|
errors: o,
|
|
3760
|
-
validate:
|
|
3546
|
+
validate: s,
|
|
3761
3547
|
reset: () => {
|
|
3762
3548
|
e.value = {}, o.value = {};
|
|
3763
3549
|
},
|
|
@@ -3778,30 +3564,30 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
3778
3564
|
}),
|
|
3779
3565
|
emits: /* @__PURE__ */ mergeModels(["handle-submit"], ["update:form", "update:values"]),
|
|
3780
3566
|
setup(e, { emit: t }) {
|
|
3781
|
-
const n = t, o = e,
|
|
3567
|
+
const n = t, o = e, r = useAttrs(), s = useModel(e, "form"), l = useModel(e, "values"), {
|
|
3782
3568
|
errors: i,
|
|
3783
3569
|
validate: u,
|
|
3784
3570
|
reset: c,
|
|
3785
3571
|
visibleSchema: a
|
|
3786
|
-
} = useForm(l, o.schema),
|
|
3572
|
+
} = useForm(l, o.schema), d = () => {
|
|
3787
3573
|
u(), n("handle-submit", l.value);
|
|
3788
3574
|
};
|
|
3789
3575
|
return onMounted(() => {
|
|
3790
|
-
|
|
3791
|
-
}), provide("form",
|
|
3792
|
-
onSubmit: withModifiers(
|
|
3793
|
-
class: normalizeClass(["grid grid-cols-12",
|
|
3576
|
+
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, h) => (openBlock(), createElementBlock("form", {
|
|
3578
|
+
onSubmit: withModifiers(d, ["prevent"]),
|
|
3579
|
+
class: normalizeClass(["grid grid-cols-12", f.layout === "default" ? "gap-6" : "gap-4"])
|
|
3794
3580
|
}, [
|
|
3795
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(a), (
|
|
3796
|
-
key:
|
|
3797
|
-
class:
|
|
3798
|
-
}, { ref_for: !0 }, { ...unref(
|
|
3799
|
-
item:
|
|
3800
|
-
layout:
|
|
3801
|
-
modelValue: l.value[
|
|
3802
|
-
"onUpdate:modelValue": (y) => l.value[
|
|
3803
|
-
style:
|
|
3804
|
-
error: unref(i)[
|
|
3581
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(a), (p) => (openBlock(), createBlock(_sfc_main$1, mergeProps({
|
|
3582
|
+
key: p.name,
|
|
3583
|
+
class: f.layout === "horizontal" ? "col-span-12" : `col-span-${p.col || 12} `
|
|
3584
|
+
}, { ref_for: !0 }, { ...unref(r), ...f.style, ...p }, {
|
|
3585
|
+
item: p,
|
|
3586
|
+
layout: f.layout,
|
|
3587
|
+
modelValue: l.value[p.name],
|
|
3588
|
+
"onUpdate:modelValue": (y) => l.value[p.name] = y,
|
|
3589
|
+
style: f.style,
|
|
3590
|
+
error: unref(i)[p.name]
|
|
3805
3591
|
}), null, 16, ["class", "item", "layout", "modelValue", "onUpdate:modelValue", "style", "error"]))), 128))
|
|
3806
3592
|
], 34));
|
|
3807
3593
|
}
|