@solfacil/girassol
Version:
Girassol design system
1,339 lines • 815 kB
JavaScript
import { defineComponent as ne, openBlock as u, createElementBlock as v, normalizeClass as F, createElementVNode as m, toDisplayString as H, useSlots as $t, computed as S, unref as s, renderSlot as A, createCommentVNode as x, createVNode as T, createBlock as E, withCtx as $, ref as V, withDirectives as qe, getCurrentInstance as an, version as ef, watch as Pe, onMounted as ht, provide as Nc, isRef as bt, onBeforeUnmount as xc, toRef as _t, resolveDynamicComponent as je, h as ha, inject as Sc, reactive as Ct, onUnmounted as Bn, nextTick as At, warn as jc, watchEffect as Dc, markRaw as tf, mergeProps as Oe, vShow as lt, vModelText as nf, Fragment as se, renderList as he, createTextVNode as ue, getCurrentScope as Tc, onScopeDispose as Rl, withModifiers as Be, shallowRef as af, triggerRef as Ns, normalizeStyle as Pt, withKeys as ve, Transition as Ot, createSlots as ft, normalizeProps as Ue, Teleport as si, guardReactiveProps as gt, onBeforeUpdate as of, defineAsyncComponent as Je, pushScopeId as et, popScopeId as tt, createStaticVNode as rf, toRaw as kn, render as kc } from "vue";
const lf = /* @__PURE__ */ m("path", {
class: "path",
d: "M16.0008 1.5C17.905 1.5 19.7905 1.87506 21.5497 2.60375C23.3089 3.33244 24.9074 4.4005 26.2538 5.74695C27.6003 7.0934 28.6684 8.69187 29.397 10.4511C30.1257 12.2103 30.5008 14.0958 30.5008 16C30.5008 17.9042 30.1257 19.7897 29.397 21.5489C28.6684 23.3081 27.6003 24.9066 26.2538 26.2531C24.9074 27.5995 23.3089 28.6676 21.5497 29.3963C19.7905 30.1249 17.905 30.5 16.0008 30.5C14.0966 30.5 12.2111 30.1249 10.4519 29.3963C8.69266 28.6676 7.09419 27.5995 5.74774 26.253C4.4013 24.9066 3.33323 23.3081 2.60454 21.5489C1.87585 19.7897 1.50079 17.9042 1.50079 16C1.5008 14.0958 1.87585 12.2103 2.60454 10.4511C3.33324 8.69187 4.4013 7.0934 5.74775 5.74695C7.0942 4.4005 8.69267 3.33244 10.4519 2.60375C12.2111 1.87505 14.0966 1.5 16.0008 1.5L16.0008 1.5Z"
}, null, -1), Mn = /* @__PURE__ */ ne({
__name: "CircleLoader",
props: {
size: { default: "large" },
dark: { type: Boolean },
title: { default: "Carregando" }
},
setup(e) {
return (t, n) => (u(), v("svg", {
class: F(["sol-inner-loader", `icon-size-${e.size}`]),
viewBox: "0 0 32 32",
fill: "none",
xmlns: "http://www.w3.org/2000/svg"
}, [
m("title", null, H(e.title), 1),
lf
], 2));
}
});
const sf = ["id", "data-testid", "disabled"], uf = {
key: 0,
class: "icon -left"
}, cf = {
key: 1,
class: "icon -right"
}, df = {
key: 2,
class: "loading"
}, ke = /* @__PURE__ */ ne({
__name: "Button",
props: {
id: null,
loading: { type: Boolean },
onColor: { type: Boolean, default: !1 },
disabled: { type: Boolean },
size: { default: "large" },
variant: { default: "primary" }
},
setup(e) {
function t(r, l) {
return r ? l : "";
}
function n() {
return !!(i != null && i["icon-right"]) || !!(i != null && i["icon-left"]) || !!(i != null && i["icon:right"]) || !!(i != null && i["icon:left"]);
}
const i = $t(), a = S(() => !!(i != null && i.default) && n()), o = S(() => !(i != null && i.default) && n());
return (r, l) => {
var c, d, y, f;
return u(), v("button", {
id: `button-${e.id}`,
"data-testid": `button-${e.id}`,
class: F(["sol-button-core", `-${e.variant} -${e.size}
${t(e.loading, "-loading")}
${t(e.onColor, "-on-color")}
${t(s(a), "-has-icon")}
${t(s(o), "-only-icon")}
`]),
type: "button",
disabled: e.disabled || e.loading
}, [
!!((c = s(i)) != null && c["icon-left"]) || !!((d = s(i)) != null && d["icon:left"]) ? (u(), v("div", uf, [
A(r.$slots, "icon-left"),
A(r.$slots, "icon:left")
])) : x("", !0),
A(r.$slots, "default"),
!!((y = s(i)) != null && y["icon-right"]) || !!((f = s(i)) != null && f["icon:right"]) ? (u(), v("div", cf, [
A(r.$slots, "icon-right"),
A(r.$slots, "icon:right")
])) : x("", !0),
e.loading ? (u(), v("div", df, [
T(Mn, {
"data-testid": `button-loader-${e.id}`,
size: e.size === "small" ? "small" : "medium",
dark: e.onColor
}, null, 8, ["data-testid", "size", "dark"])
])) : x("", !0)
], 10, sf);
};
}
});
const ff = {
viewBox: "0 0 24 24",
width: "1em",
height: "1em"
}, mf = /* @__PURE__ */ m("path", {
fill: "currentColor",
d: "M7 21q-.825 0-1.412-.587Q5 19.825 5 19V6H4V4h5V3h6v1h5v2h-1v13q0 .825-.587 1.413Q17.825 21 17 21ZM17 6H7v13h10ZM9 17h2V8H9Zm4 0h2V8h-2ZM7 6v13Z"
}, null, -1), hf = [
mf
];
function yf(e, t) {
return u(), v("svg", ff, hf);
}
const vf = { name: "material-symbols-delete-outline", render: yf }, _c = /* @__PURE__ */ ne({
__name: "ButtonDestructive",
props: {
id: null,
size: null,
loading: { type: Boolean },
hideIcon: { type: Boolean, default: !1 }
},
setup(e) {
return (t, n) => (u(), E(ke, {
id: `destructive-${e.id}`,
size: e.size,
loading: e.loading,
variant: "primary",
class: "button-destructive"
}, {
"icon-left": $(() => [
e.hideIcon ? (u(), E(s(vf), {
key: 0,
"aria-hidden": "true"
})) : x("", !0)
]),
default: $(() => [
A(t.$slots, "default")
]),
_: 3
}, 8, ["id", "size", "loading"]));
}
});
ke.install = (e) => {
e.component("SolButton", ke);
};
_c.install = (e) => {
e.component("SolButton", ke);
};
/*!
* maska v1.5.2
* (c) 2019-2022 Alexander Shabunevich
* Released under the MIT License.
*/
function xs(e, t) {
var n = Object.keys(e);
if (Object.getOwnPropertySymbols) {
var i = Object.getOwnPropertySymbols(e);
t && (i = i.filter(function(a) {
return Object.getOwnPropertyDescriptor(e, a).enumerable;
})), n.push.apply(n, i);
}
return n;
}
function Si(e) {
for (var t = 1; t < arguments.length; t++) {
var n = arguments[t] != null ? arguments[t] : {};
t % 2 ? xs(Object(n), !0).forEach(function(i) {
If(e, i, n[i]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : xs(Object(n)).forEach(function(i) {
Object.defineProperty(e, i, Object.getOwnPropertyDescriptor(n, i));
});
}
return e;
}
function gf(e, t) {
if (!(e instanceof t))
throw new TypeError("Cannot call a class as a function");
}
function pf(e, t) {
for (var n = 0; n < t.length; n++) {
var i = t[n];
i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(e, Ac(i.key), i);
}
}
function If(e, t, n) {
return (t = Ac(t)) in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = n, e;
}
function Ac(e) {
var t = function(n, i) {
if (typeof n != "object" || n === null)
return n;
var a = n[Symbol.toPrimitive];
if (a !== void 0) {
var o = a.call(n, i || "default");
if (typeof o != "object")
return o;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return (i === "string" ? String : Number)(n);
}(e, "string");
return typeof t == "symbol" ? t : String(t);
}
var Cc = { "#": { pattern: /[0-9]/ }, X: { pattern: /[0-9a-zA-Z]/ }, S: { pattern: /[a-zA-Z]/ }, A: { pattern: /[a-zA-Z]/, uppercase: !0 }, a: { pattern: /[a-zA-Z]/, lowercase: !0 }, "!": { escape: !0 }, "*": { repeat: !0 } };
function Ss(e, t) {
var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : Cc, i = !(arguments.length > 3 && arguments[3] !== void 0) || arguments[3];
return Lc(t).length > 1 ? Mf(t)(e, t, n, i) : Uo(e, t, n, i);
}
function Lc(e) {
try {
return JSON.parse(e);
} catch {
return [e];
}
}
function Mf(e) {
var t = Lc(e).sort(function(i, a) {
return i.length - a.length;
});
return function(i, a, o) {
var r = !(arguments.length > 3 && arguments[3] !== void 0) || arguments[3], l = t.map(function(y) {
return Uo(i, y, o, !1);
}), c = l.pop();
for (var d in t)
if (n(c, t[d], o))
return Uo(i, t[d], o, r);
return "";
};
function n(i, a, o) {
for (var r in o)
o[r].escape && (a = a.replace(new RegExp(r + ".{1}", "g"), ""));
return a.split("").filter(function(l) {
return o[l] && o[l].pattern;
}).length >= i.length;
}
}
function Uo(e, t, n) {
for (var i = !(arguments.length > 3 && arguments[3] !== void 0) || arguments[3], a = 0, o = 0, r = "", l = ""; a < t.length && o < e.length; ) {
var c = t[a], d = e[o], y = n[c];
if (y && y.pattern)
y.pattern.test(d) && (r += bf(d, y), a++, i && t[a] && (n[t[a]] ? n[t[a]] && n[t[a]].escape && (r += t[a + 1], a += 2) : (r += t[a], a++))), o++;
else if (y && y.repeat) {
var f = n[t[a - 1]];
f && !f.pattern.test(d) ? a++ : a--;
} else
y && y.escape && (c = t[++a]), i && (r += c), d === c && o++, a++;
}
for (; i && a < t.length; ) {
var h = t[a];
if (n[h]) {
l = "";
break;
}
l += h, a++;
}
return r + l;
}
function bf(e, t) {
return t.transform && (e = t.transform(e)), t.uppercase ? e.toLocaleUpperCase() : t.lowercase ? e.toLocaleLowerCase() : e;
}
function js(e) {
return e instanceof HTMLInputElement ? e : e.querySelector("input") || e;
}
function Vo(e) {
return Object.prototype.toString.call(e) === "[object String]";
}
var wf = function() {
function e(i) {
var a = this, o = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
if (gf(this, e), !i)
throw new Error("Maska: no element for mask");
if (o.preprocessor != null && typeof o.preprocessor != "function")
throw new Error("Maska: preprocessor must be a function");
if (o.tokens)
for (var r in o.tokens)
o.tokens[r] = Si({}, o.tokens[r]), o.tokens[r].pattern && Vo(o.tokens[r].pattern) && (o.tokens[r].pattern = new RegExp(o.tokens[r].pattern));
this._opts = { mask: o.mask, tokens: Si(Si({}, Cc), o.tokens), preprocessor: o.preprocessor }, this._el = Vo(i) ? document.querySelectorAll(i) : i.length ? i : [i], this.inputEvent = function(l) {
return a.updateValue(l.target, l);
}, this.init();
}
var t, n;
return t = e, n = [{ key: "init", value: function() {
for (var i = this, a = function(r) {
var l = js(i._el[r]);
!i._opts.mask || l.dataset.mask && l.dataset.mask === i._opts.mask || (l.dataset.mask = i._opts.mask), setTimeout(function() {
return i.updateValue(l);
}, 0), l.dataset.maskInited || (l.dataset.maskInited = !0, l.addEventListener("input", i.inputEvent), l.addEventListener("beforeinput", i.beforeInput));
}, o = 0; o < this._el.length; o++)
a(o);
} }, { key: "destroy", value: function() {
for (var i = 0; i < this._el.length; i++) {
var a = js(this._el[i]);
a.removeEventListener("input", this.inputEvent), a.removeEventListener("beforeinput", this.beforeInput), delete a.dataset.mask, delete a.dataset.maskInited;
}
} }, { key: "updateValue", value: function(i, a) {
if (i && i.type) {
var o = i.type.match(/^number$/i) && i.validity.badInput;
if (!i.value && !o || !i.dataset.mask)
return i.dataset.maskRawValue = "", void this.dispatch("maska", i, a);
var r = i.selectionEnd, l = i.value, c = l[r - 1];
i.dataset.maskRawValue = Ss(i.value, i.dataset.mask, this._opts.tokens, !1);
var d = i.value;
this._opts.preprocessor && (d = this._opts.preprocessor(d)), i.value = Ss(d, i.dataset.mask, this._opts.tokens), a && a.inputType === "insertText" && r === l.length && (r = i.value.length), function(y, f, h) {
for (; f && f < y.value.length && y.value.charAt(f - 1) !== h; )
f++;
(y.type ? y.type.match(/^(text|search|password|tel|url)$/i) : !y.type) && y === document.activeElement && (y.setSelectionRange(f, f), setTimeout(function() {
y.setSelectionRange(f, f);
}, 0));
}(i, r, c), this.dispatch("maska", i, a), i.value !== l && this.dispatch("input", i, a);
}
} }, { key: "beforeInput", value: function(i) {
i && i.target && i.target.type && i.target.type.match(/^number$/i) && i.data && isNaN(i.target.value + i.data) && i.preventDefault();
} }, { key: "dispatch", value: function(i, a, o) {
a.dispatchEvent(function(r) {
var l = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : null, c = document.createEvent("Event");
return c.initEvent(r, !0, !0), l && (c.inputType = l), c;
}(i, o && o.inputType || null));
} }], n && pf(t.prototype, n), Object.defineProperty(t, "prototype", { writable: !1 }), e;
}(), No, Wl = (No = /* @__PURE__ */ new WeakMap(), function(e, t) {
t.value && (No.has(e) && !function(n) {
return !(Vo(n.value) && n.value === n.oldValue || Array.isArray(n.value) && JSON.stringify(n.value) === JSON.stringify(n.oldValue) || n.value && n.value.mask && n.oldValue && n.oldValue.mask && n.value.mask === n.oldValue.mask);
}(t) || No.set(e, new wf(e, function(n) {
var i = {};
return n.mask ? (i.mask = Array.isArray(n.mask) ? JSON.stringify(n.mask) : n.mask, i.tokens = n.tokens ? Si({}, n.tokens) : {}, i.preprocessor = n.preprocessor) : i.mask = Array.isArray(n) ? JSON.stringify(n) : n, i;
}(t.value))));
});
function Nf(e) {
e.directive("maska", Wl);
}
typeof window < "u" && window.Vue && window.Vue.use && window.Vue.use(Nf);
const xf = {
CPF: "###.###.###-##",
CNPJ: "##.###.###/####-##",
CPF_CNPJ: ["###.###.###-##", "##.###.###/####-##"],
MobilePhoneDDD: "(##) # ####-####"
}, ok = Wl;
function Sf(e) {
const t = Wl, n = S(() => {
if (e != null && e.hasOwnProperty("preset")) {
const { preset: i } = e;
return xf[i];
}
return e;
});
return {
vMask: t,
maskValue: n
};
}
const jf = ["id", "data-testid", "value"], ui = /* @__PURE__ */ ne({
__name: "Input",
props: {
id: null,
modelValue: null,
error: null,
mask: null,
hasLeftIcon: null,
hasRightIcon: null,
size: { default: "medium" },
hasFeedbackIcon: null
},
emits: ["update:modelValue"],
setup(e, { expose: t, emit: n }) {
const i = e, { maskValue: a, vMask: o } = Sf(i.mask);
function r({ target: c }) {
n("update:modelValue", c == null ? void 0 : c.value);
}
const l = V("");
return t({
input: l
}), (c, d) => qe((u(), v("input", {
id: `input-${e.id}`,
ref_key: "input",
ref: l,
"data-testid": `input-${e.id}`,
value: e.modelValue,
class: F(["sol-input-core", [`-${e.size}`, { "-error": e.error, "-feedback-icon": e.hasFeedbackIcon, "-left-icon": e.hasLeftIcon, "-right-icon": e.hasRightIcon }]]),
onInput: r
}, null, 42, jf)), [
[s(o), s(a)]
]);
}
});
/**
* Vue Currency Input 3.0.3
* (c) 2018-2022 Matthias Stiller
* @license MIT
*/
var Kt;
(function(e) {
e.symbol = "symbol", e.narrowSymbol = "narrowSymbol", e.code = "code", e.name = "name", e.hidden = "hidden";
})(Kt || (Kt = {}));
var mn;
(function(e) {
e.precision = "precision", e.thousands = "thousands", e.millions = "millions", e.billions = "billions";
})(mn || (mn = {}));
const ji = (e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), Pc = (e) => e.replace(/^0+(0$|[^0])/, "$1"), xo = (e, t) => (e.match(new RegExp(ji(t), "g")) || []).length, Df = (e, t) => e.substring(0, e.indexOf(t)), zc = [",", ".", "\u066B"], Ds = "(0|[1-9]\\d*)";
class Tf {
constructor(t) {
var n, i, a, o, r, l;
const { currency: c, currencyDisplay: d, locale: y, precision: f, accountingSign: h, useGrouping: g } = t;
this.locale = y, this.options = {
currency: c,
useGrouping: g,
style: "currency",
currencySign: h ? "accounting" : void 0,
currencyDisplay: d !== Kt.hidden ? d : void 0
};
const I = new Intl.NumberFormat(y, this.options), M = I.formatToParts(123456);
this.currency = (n = M.find(({ type: N }) => N === "currency")) === null || n === void 0 ? void 0 : n.value, this.digits = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9].map((N) => N.toLocaleString(y)), this.decimalSymbol = (i = M.find(({ type: N }) => N === "decimal")) === null || i === void 0 ? void 0 : i.value, this.groupingSymbol = (a = M.find(({ type: N }) => N === "group")) === null || a === void 0 ? void 0 : a.value, this.minusSign = (o = I.formatToParts(-1).find(({ type: N }) => N === "minusSign")) === null || o === void 0 ? void 0 : o.value, this.decimalSymbol === void 0 ? this.minimumFractionDigits = this.maximumFractionDigits = 0 : typeof f == "number" ? this.minimumFractionDigits = this.maximumFractionDigits = f : (this.minimumFractionDigits = (r = f == null ? void 0 : f.min) !== null && r !== void 0 ? r : I.resolvedOptions().minimumFractionDigits, this.maximumFractionDigits = (l = f == null ? void 0 : f.max) !== null && l !== void 0 ? l : I.resolvedOptions().maximumFractionDigits);
const w = (N) => Df(N, this.digits[1]), O = (N) => N.substring(N.lastIndexOf(this.decimalSymbol ? this.digits[0] : this.digits[1]) + 1);
this.prefix = w(I.format(1)), this.suffix = O(I.format(1)), this.negativePrefix = w(I.format(-1)), this.negativeSuffix = O(I.format(-1));
}
parse(t) {
if (t) {
const n = this.isNegative(t);
t = this.normalizeDigits(t), t = this.stripCurrency(t, n), t = this.stripSignLiterals(t);
const i = this.decimalSymbol ? `(?:${ji(this.decimalSymbol)}(\\d*))?` : "", a = this.stripGroupingSeparator(t).match(new RegExp(`^${Ds}${i}$`));
if (a && this.isValidIntegerFormat(this.decimalSymbol ? t.split(this.decimalSymbol)[0] : t, Number(a[1])))
return Number(`${n ? "-" : ""}${this.onlyDigits(a[1])}.${this.onlyDigits(a[2] || "")}`);
}
return null;
}
isValidIntegerFormat(t, n) {
const i = { ...this.options, minimumFractionDigits: 0 };
return [
this.stripCurrency(this.normalizeDigits(n.toLocaleString(this.locale, { ...i, useGrouping: !0 })), !1),
this.stripCurrency(this.normalizeDigits(n.toLocaleString(this.locale, { ...i, useGrouping: !1 })), !1)
].includes(t);
}
format(t, n = {
minimumFractionDigits: this.minimumFractionDigits,
maximumFractionDigits: this.maximumFractionDigits
}) {
return t != null ? t.toLocaleString(this.locale, { ...this.options, ...n }) : "";
}
toFraction(t) {
return `${this.digits[0]}${this.decimalSymbol}${this.onlyLocaleDigits(t.substr(1)).substr(0, this.maximumFractionDigits)}`;
}
isFractionIncomplete(t) {
return !!this.normalizeDigits(this.stripGroupingSeparator(t)).match(new RegExp(`^${Ds}${ji(this.decimalSymbol)}$`));
}
isNegative(t) {
return t.startsWith(this.negativePrefix) || this.minusSign === void 0 && (t.startsWith("(") || t.startsWith("-")) || this.minusSign !== void 0 && t.replace("-", this.minusSign).startsWith(this.minusSign);
}
insertCurrency(t, n) {
return `${n ? this.negativePrefix : this.prefix}${t}${n ? this.negativeSuffix : this.suffix}`;
}
stripGroupingSeparator(t) {
return this.groupingSymbol !== void 0 ? t.replace(new RegExp(ji(this.groupingSymbol), "g"), "") : t;
}
stripSignLiterals(t) {
return this.minusSign !== void 0 ? t.replace("-", this.minusSign).replace(this.minusSign, "") : t.replace(/[-()]/g, "");
}
stripCurrency(t, n) {
return t.replace(n ? this.negativePrefix : this.prefix, "").replace(n ? this.negativeSuffix : this.suffix, "");
}
normalizeDecimalSeparator(t, n) {
return zc.forEach((i) => {
t = t.substr(0, n) + t.substr(n).replace(i, this.decimalSymbol);
}), t;
}
normalizeDigits(t) {
return this.digits[0] !== "0" && this.digits.forEach((n, i) => {
t = t.replace(new RegExp(n, "g"), String(i));
}), t;
}
onlyDigits(t) {
return this.normalizeDigits(t).replace(/\D+/g, "");
}
onlyLocaleDigits(t) {
return t.replace(new RegExp(`[^${this.digits.join("")}]*`, "g"), "");
}
}
class $c {
constructor(t) {
this.currencyFormat = t;
}
}
class kf extends $c {
conformToMask(t, n = "") {
const i = this.currencyFormat.isNegative(t), a = (I) => I === "" && i && !(this.currencyFormat.minusSign === void 0 ? n === this.currencyFormat.negativePrefix + this.currencyFormat.negativeSuffix : n === this.currencyFormat.negativePrefix), o = (I) => {
if (a(I))
return "";
if (this.currencyFormat.maximumFractionDigits > 0) {
if (this.currencyFormat.isFractionIncomplete(I))
return I;
if (I.startsWith(this.currencyFormat.decimalSymbol))
return this.currencyFormat.toFraction(I);
}
return null;
};
let r = t;
r = this.currencyFormat.stripCurrency(r, i), r = this.currencyFormat.stripSignLiterals(r);
const l = o(r);
if (l != null)
return this.currencyFormat.insertCurrency(l, i);
const [c, ...d] = r.split(this.currencyFormat.decimalSymbol), y = Pc(this.currencyFormat.onlyDigits(c)), f = this.currencyFormat.onlyDigits(d.join("")).substr(0, this.currencyFormat.maximumFractionDigits), h = d.length > 0 && f.length === 0, g = y === "" && i && (this.currencyFormat.minusSign === void 0 ? n === t.slice(0, -2) + this.currencyFormat.negativeSuffix : n === t.slice(0, -1));
return h || g || a(y) ? n : y.match(/\d+/) ? {
numberValue: Number(`${i ? "-" : ""}${y}.${f}`),
fractionDigits: f
} : "";
}
}
class _f extends $c {
conformToMask(t, n = "") {
if (t === "" || this.currencyFormat.parse(n) === 0 && this.currencyFormat.stripCurrency(n, !0).slice(0, -1) === this.currencyFormat.stripCurrency(t, !0))
return "";
const i = this.currencyFormat.isNegative(t), a = this.currencyFormat.stripSignLiterals(t) === "" ? -0 : Number(`${i ? "-" : ""}${Pc(this.currencyFormat.onlyDigits(t))}`) / Math.pow(10, this.currencyFormat.maximumFractionDigits);
return {
numberValue: a,
fractionDigits: a.toFixed(this.currencyFormat.maximumFractionDigits).slice(-this.currencyFormat.maximumFractionDigits)
};
}
}
const Af = {
locale: void 0,
currency: void 0,
currencyDisplay: void 0,
hideGroupingSeparatorOnFocus: !0,
hideCurrencySymbolOnFocus: !0,
hideNegligibleDecimalDigitsOnFocus: !0,
precision: void 0,
autoDecimalDigits: !1,
valueRange: void 0,
useGrouping: void 0,
valueScaling: void 0
};
class Cf {
constructor(t) {
this.el = t.el, this.onInput = t.onInput, this.onChange = t.onChange, this.addEventListener(), this.init(t.options);
}
setOptions(t) {
this.init(t), this.applyFixedFractionFormat(this.numberValue, !0);
}
getValue() {
return { number: this.valueScaling && this.numberValue != null ? this.toInteger(this.numberValue, this.valueScaling) : this.numberValue, formatted: this.formattedValue };
}
setValue(t) {
const n = this.valueScaling !== void 0 && t != null ? this.toFloat(t, this.valueScaling) : t;
n !== this.numberValue && this.applyFixedFractionFormat(n);
}
init(t) {
this.options = {
...Af,
...t
}, this.options.autoDecimalDigits ? (this.options.hideNegligibleDecimalDigitsOnFocus = !1, this.el.setAttribute("inputmode", "numeric")) : this.el.setAttribute("inputmode", "decimal"), this.currencyFormat = new Tf(this.options), this.numberMask = this.options.autoDecimalDigits ? new _f(this.currencyFormat) : new kf(this.currencyFormat);
const n = {
[mn.precision]: this.currencyFormat.maximumFractionDigits,
[mn.thousands]: 3,
[mn.millions]: 6,
[mn.billions]: 9
};
this.valueScaling = this.options.valueScaling ? n[this.options.valueScaling] : void 0, this.valueScalingFractionDigits = this.valueScaling !== void 0 && this.options.valueScaling !== mn.precision ? this.valueScaling + this.currencyFormat.maximumFractionDigits : this.currencyFormat.maximumFractionDigits, this.minValue = this.getMinValue(), this.maxValue = this.getMaxValue();
}
getMinValue() {
var t, n;
let i = this.toFloat(-Number.MAX_SAFE_INTEGER);
return ((t = this.options.valueRange) === null || t === void 0 ? void 0 : t.min) !== void 0 && (i = Math.max((n = this.options.valueRange) === null || n === void 0 ? void 0 : n.min, this.toFloat(-Number.MAX_SAFE_INTEGER))), i;
}
getMaxValue() {
var t, n;
let i = this.toFloat(Number.MAX_SAFE_INTEGER);
return ((t = this.options.valueRange) === null || t === void 0 ? void 0 : t.max) !== void 0 && (i = Math.min((n = this.options.valueRange) === null || n === void 0 ? void 0 : n.max, this.toFloat(Number.MAX_SAFE_INTEGER))), i;
}
toFloat(t, n) {
return t / Math.pow(10, n != null ? n : this.valueScalingFractionDigits);
}
toInteger(t, n) {
return Number(t.toFixed(n != null ? n : this.valueScalingFractionDigits).split(".").join(""));
}
validateValueRange(t) {
return t != null ? Math.min(Math.max(t, this.minValue), this.maxValue) : t;
}
applyFixedFractionFormat(t, n = !1) {
this.format(this.currencyFormat.format(this.validateValueRange(t))), (t !== this.numberValue || n) && this.onChange(this.getValue());
}
format(t, n = !1) {
if (t != null) {
this.decimalSymbolInsertedAt !== void 0 && (t = this.currencyFormat.normalizeDecimalSeparator(t, this.decimalSymbolInsertedAt), this.decimalSymbolInsertedAt = void 0);
const i = this.numberMask.conformToMask(t, this.formattedValue);
let a;
if (typeof i == "object") {
const { numberValue: o, fractionDigits: r } = i;
let { maximumFractionDigits: l, minimumFractionDigits: c } = this.currencyFormat;
this.focus ? c = n ? r.replace(/0+$/, "").length : Math.min(l, r.length) : Number.isInteger(o) && !this.options.autoDecimalDigits && (this.options.precision === void 0 || c === 0) && (c = l = 0), a = this.toInteger(Math.abs(o)) > Number.MAX_SAFE_INTEGER ? this.formattedValue : this.currencyFormat.format(o, {
useGrouping: this.options.useGrouping !== !1 && !(this.focus && this.options.hideGroupingSeparatorOnFocus),
minimumFractionDigits: c,
maximumFractionDigits: l
});
} else
a = i;
this.maxValue <= 0 && !this.currencyFormat.isNegative(a) && this.currencyFormat.parse(a) !== 0 && (a = a.replace(this.currencyFormat.prefix, this.currencyFormat.negativePrefix)), this.minValue >= 0 && (a = a.replace(this.currencyFormat.negativePrefix, this.currencyFormat.prefix)), (this.options.currencyDisplay === Kt.hidden || this.focus && this.options.hideCurrencySymbolOnFocus) && (a = a.replace(this.currencyFormat.negativePrefix, this.currencyFormat.minusSign !== void 0 ? this.currencyFormat.minusSign : "(").replace(this.currencyFormat.negativeSuffix, this.currencyFormat.minusSign !== void 0 ? "" : ")").replace(this.currencyFormat.prefix, "").replace(this.currencyFormat.suffix, "")), this.el.value = a, this.numberValue = this.currencyFormat.parse(a);
} else
this.el.value = "", this.numberValue = null;
this.formattedValue = this.el.value, this.onInput(this.getValue());
}
addEventListener() {
this.el.addEventListener("input", (t) => {
const { value: n, selectionStart: i } = this.el, a = t;
if (i && a.data && zc.includes(a.data) && (this.decimalSymbolInsertedAt = i - 1), this.format(n), this.focus && i != null) {
const o = () => {
const { prefix: r, suffix: l, decimalSymbol: c, maximumFractionDigits: d, groupingSymbol: y } = this.currencyFormat;
let f = n.length - i;
const h = this.formattedValue.length;
if (this.currencyFormat.minusSign === void 0 && (n.startsWith("(") || n.startsWith("-")) && !n.endsWith(")"))
return h - this.currencyFormat.negativeSuffix.length > 1 ? this.formattedValue.substring(i).length : 1;
if (this.formattedValue.substr(i, 1) === y && xo(this.formattedValue, y) === xo(n, y) + 1)
return h - f - 1;
if (h < f)
return i;
if (c !== void 0 && n.indexOf(c) !== -1) {
const g = n.indexOf(c) + 1;
if (Math.abs(h - n.length) > 1 && i <= g)
return this.formattedValue.indexOf(c) + 1;
!this.options.autoDecimalDigits && i > g && this.currencyFormat.onlyDigits(n.substr(g)).length - 1 === d && (f -= 1);
}
return this.options.hideCurrencySymbolOnFocus || this.options.currencyDisplay === Kt.hidden ? h - f : Math.max(h - Math.max(f, l.length), r.length);
};
this.setCaretPosition(o());
}
}), this.el.addEventListener("focus", () => {
this.focus = !0, setTimeout(() => {
const { value: t, selectionStart: n, selectionEnd: i } = this.el;
if (this.format(t, this.options.hideNegligibleDecimalDigitsOnFocus), n != null && i != null && Math.abs(n - i) > 0)
this.setCaretPosition(0, this.el.value.length);
else if (n != null) {
const a = this.getCaretPositionOnFocus(t, n);
this.setCaretPosition(a);
}
});
}), this.el.addEventListener("blur", () => {
this.focus = !1, this.applyFixedFractionFormat(this.numberValue);
}), this.el.addEventListener("change", () => {
this.onChange(this.getValue());
});
}
getCaretPositionOnFocus(t, n) {
if (this.numberValue == null)
return n;
const { prefix: i, negativePrefix: a, suffix: o, negativeSuffix: r, groupingSymbol: l, currency: c } = this.currencyFormat, d = this.numberValue < 0, y = d ? a : i, f = y.length;
if (this.options.hideCurrencySymbolOnFocus || this.options.currencyDisplay === Kt.hidden) {
if (d) {
if (n <= 1)
return 1;
if (t.endsWith(")") && n > t.indexOf(")"))
return this.formattedValue.length - 1;
}
} else {
const g = d ? r.length : o.length;
if (n >= t.length - g)
return this.formattedValue.length - g;
if (n < f)
return f;
}
let h = n;
return this.options.hideCurrencySymbolOnFocus && this.options.currencyDisplay !== Kt.hidden && n >= f && c !== void 0 && y.includes(c) && (h -= f, d && (h += 1)), this.options.hideGroupingSeparatorOnFocus && l !== void 0 && (h -= xo(t.substring(0, n), l)), h;
}
setCaretPosition(t, n = t) {
this.el.setSelectionRange(t, n);
}
}
const Lf = (e) => e != null && e.matches("input") ? e : e == null ? void 0 : e.querySelector("input");
function Pf(e, t) {
var n, i, a, o;
let r;
const l = V(null), c = V(null), d = V(null), y = an(), f = (y == null ? void 0 : y.emit) || ((i = (n = y == null ? void 0 : y.proxy) === null || n === void 0 ? void 0 : n.$emit) === null || i === void 0 ? void 0 : i.bind(y == null ? void 0 : y.proxy)), h = (y == null ? void 0 : y.props) || ((a = y == null ? void 0 : y.proxy) === null || a === void 0 ? void 0 : a.$props), g = ef.startsWith("3"), I = g && ((o = y == null ? void 0 : y.attrs.modelModifiers) === null || o === void 0 ? void 0 : o.lazy), M = S(() => h == null ? void 0 : h[g ? "modelValue" : "value"]), w = g ? "update:modelValue" : "input", O = I ? "update:modelValue" : "change";
return Pe(l, (N) => {
var b;
if (N) {
const j = Lf((b = N == null ? void 0 : N.$el) !== null && b !== void 0 ? b : N);
j ? (r = new Cf({
el: j,
options: e,
onInput: (W) => {
!I && t !== !1 && M.value !== W.number && (f == null || f(w, W.number)), d.value = W.number, c.value = W.formatted;
},
onChange: (W) => {
f == null || f(O, W.number);
}
}), r.setValue(M.value)) : console.error('No input element found. Please make sure that the "inputRef" template ref is properly assigned.');
} else
r = null;
}), {
inputRef: l,
numberValue: d,
formattedValue: c,
setValue: (N) => r == null ? void 0 : r.setValue(N),
setOptions: (N) => r == null ? void 0 : r.setOptions(N)
};
}
function zf() {
return Oc().__VUE_DEVTOOLS_GLOBAL_HOOK__;
}
function Oc() {
return typeof navigator < "u" && typeof window < "u" ? window : typeof global < "u" ? global : {};
}
const $f = typeof Proxy == "function", Of = "devtools-plugin:setup", Ef = "plugin:settings:set";
let jn, Ro;
function Zf() {
var e;
return jn !== void 0 || (typeof window < "u" && window.performance ? (jn = !0, Ro = window.performance) : typeof global < "u" && ((e = global.perf_hooks) === null || e === void 0 ? void 0 : e.performance) ? (jn = !0, Ro = global.perf_hooks.performance) : jn = !1), jn;
}
function Gf() {
return Zf() ? Ro.now() : Date.now();
}
class Bf {
constructor(t, n) {
this.target = null, this.targetQueue = [], this.onQueue = [], this.plugin = t, this.hook = n;
const i = {};
if (t.settings)
for (const r in t.settings) {
const l = t.settings[r];
i[r] = l.defaultValue;
}
const a = `__vue-devtools-plugin-settings__${t.id}`;
let o = Object.assign({}, i);
try {
const r = localStorage.getItem(a), l = JSON.parse(r);
Object.assign(o, l);
} catch {
}
this.fallbacks = {
getSettings() {
return o;
},
setSettings(r) {
try {
localStorage.setItem(a, JSON.stringify(r));
} catch {
}
o = r;
},
now() {
return Gf();
}
}, n && n.on(Ef, (r, l) => {
r === this.plugin.id && this.fallbacks.setSettings(l);
}), this.proxiedOn = new Proxy({}, {
get: (r, l) => this.target ? this.target.on[l] : (...c) => {
this.onQueue.push({
method: l,
args: c
});
}
}), this.proxiedTarget = new Proxy({}, {
get: (r, l) => this.target ? this.target[l] : l === "on" ? this.proxiedOn : Object.keys(this.fallbacks).includes(l) ? (...c) => (this.targetQueue.push({
method: l,
args: c,
resolve: () => {
}
}), this.fallbacks[l](...c)) : (...c) => new Promise((d) => {
this.targetQueue.push({
method: l,
args: c,
resolve: d
});
})
});
}
async setRealTarget(t) {
this.target = t;
for (const n of this.onQueue)
this.target.on[n.method](...n.args);
for (const n of this.targetQueue)
n.resolve(await this.target[n.method](...n.args));
}
}
function Yf(e, t) {
const n = e, i = Oc(), a = zf(), o = $f && n.enableEarlyProxy;
if (a && (i.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__ || !o))
a.emit(Of, e, t);
else {
const r = o ? new Bf(n, a) : null;
(i.__VUE_DEVTOOLS_PLUGINS__ = i.__VUE_DEVTOOLS_PLUGINS__ || []).push({
pluginDescriptor: n,
setupFn: t,
proxy: r
}), r && t(r.proxiedTarget);
}
}
/**
* vee-validate v4.7.3
* (c) 2022 Abdelrahman Awad
* @license MIT
*/
function Pn(e) {
return typeof e == "function";
}
function Jn(e) {
return e == null;
}
const tn = (e) => e !== null && !!e && typeof e == "object" && !Array.isArray(e);
function Ec(e) {
return Number(e) >= 0;
}
function Uf(e) {
const t = parseFloat(e);
return isNaN(t) ? e : t;
}
const Vf = {};
function Rf(e) {
return Vf[e];
}
const ci = Symbol("vee-validate-form"), Wf = Symbol("vee-validate-field-instance"), ya = Symbol("Default empty value"), Qf = typeof window < "u";
function Wo(e) {
return Pn(e) && !!e.__locatorRef;
}
function qn(e) {
return !!e && Pn(e.validate);
}
function zn(e) {
return e === "checkbox" || e === "radio";
}
function Hf(e) {
return tn(e) || Array.isArray(e);
}
function Zc(e) {
return Array.isArray(e) ? e.length === 0 : tn(e) && Object.keys(e).length === 0;
}
function uo(e) {
return /^\[.+\]$/i.test(e);
}
function Ff(e) {
return Gc(e) && e.multiple;
}
function Gc(e) {
return e.tagName === "SELECT";
}
function Xf(e, t) {
const n = ![!1, null, void 0, 0].includes(t.multiple) && !Number.isNaN(t.multiple);
return e === "select" && "multiple" in t && n;
}
function Jf(e, t) {
return !Xf(e, t) && t.type !== "file" && !zn(t.type);
}
function Bc(e) {
return Ql(e) && e.target && "submit" in e.target;
}
function Ql(e) {
return e ? !!(typeof Event < "u" && Pn(Event) && e instanceof Event || e && e.srcElement) : !1;
}
function Ts(e, t) {
return t in e && e[t] !== ya;
}
function ct(e, t) {
if (e === t)
return !0;
if (e && t && typeof e == "object" && typeof t == "object") {
if (e.constructor !== t.constructor)
return !1;
var n, i, a;
if (Array.isArray(e)) {
if (n = e.length, n != t.length)
return !1;
for (i = n; i-- !== 0; )
if (!ct(e[i], t[i]))
return !1;
return !0;
}
if (e instanceof Map && t instanceof Map) {
if (e.size !== t.size)
return !1;
for (i of e.entries())
if (!t.has(i[0]))
return !1;
for (i of e.entries())
if (!ct(i[1], t.get(i[0])))
return !1;
return !0;
}
if (ks(e) && ks(t))
return !(e.size !== t.size || e.name !== t.name || e.lastModified !== t.lastModified || e.type !== t.type);
if (e instanceof Set && t instanceof Set) {
if (e.size !== t.size)
return !1;
for (i of e.entries())
if (!t.has(i[0]))
return !1;
return !0;
}
if (ArrayBuffer.isView(e) && ArrayBuffer.isView(t)) {
if (n = e.length, n != t.length)
return !1;
for (i = n; i-- !== 0; )
if (e[i] !== t[i])
return !1;
return !0;
}
if (e.constructor === RegExp)
return e.source === t.source && e.flags === t.flags;
if (e.valueOf !== Object.prototype.valueOf)
return e.valueOf() === t.valueOf();
if (e.toString !== Object.prototype.toString)
return e.toString() === t.toString();
if (a = Object.keys(e), n = a.length, n !== Object.keys(t).length)
return !1;
for (i = n; i-- !== 0; )
if (!Object.prototype.hasOwnProperty.call(t, a[i]))
return !1;
for (i = n; i-- !== 0; ) {
var o = a[i];
if (!ct(e[o], t[o]))
return !1;
}
return !0;
}
return e !== e && t !== t;
}
function ks(e) {
return Qf ? e instanceof File : !1;
}
function _s(e, t, n) {
typeof n.value == "object" && (n.value = Re(n.value)), !n.enumerable || n.get || n.set || !n.configurable || !n.writable || t === "__proto__" ? Object.defineProperty(e, t, n) : e[t] = n.value;
}
function Re(e) {
if (typeof e != "object")
return e;
var t = 0, n, i, a, o = Object.prototype.toString.call(e);
if (o === "[object Object]" ? a = Object.create(e.__proto__ || null) : o === "[object Array]" ? a = Array(e.length) : o === "[object Set]" ? (a = /* @__PURE__ */ new Set(), e.forEach(function(r) {
a.add(Re(r));
})) : o === "[object Map]" ? (a = /* @__PURE__ */ new Map(), e.forEach(function(r, l) {
a.set(Re(l), Re(r));
})) : o === "[object Date]" ? a = new Date(+e) : o === "[object RegExp]" ? a = new RegExp(e.source, e.flags) : o === "[object DataView]" ? a = new e.constructor(Re(e.buffer)) : o === "[object ArrayBuffer]" ? a = e.slice(0) : o.slice(-6) === "Array]" && (a = new e.constructor(e)), a) {
for (i = Object.getOwnPropertySymbols(e); t < i.length; t++)
_s(a, i[t], Object.getOwnPropertyDescriptor(e, i[t]));
for (t = 0, i = Object.getOwnPropertyNames(e); t < i.length; t++)
Object.hasOwnProperty.call(a, n = i[t]) && a[n] === e[n] || _s(a, n, Object.getOwnPropertyDescriptor(e, n));
}
return a || e;
}
function Hl(e) {
return uo(e) ? e.replace(/\[|\]/gi, "") : e;
}
function it(e, t, n) {
return e ? uo(t) ? e[Hl(t)] : (t || "").split(/\.|\[(\d+)\]/).filter(Boolean).reduce((a, o) => Hf(a) && o in a ? a[o] : n, e) : n;
}
function Qt(e, t, n) {
if (uo(t)) {
e[Hl(t)] = n;
return;
}
const i = t.split(/\.|\[(\d+)\]/).filter(Boolean);
let a = e;
for (let o = 0; o < i.length; o++) {
if (o === i.length - 1) {
a[i[o]] = n;
return;
}
(!(i[o] in a) || Jn(a[i[o]])) && (a[i[o]] = Ec(i[o + 1]) ? [] : {}), a = a[i[o]];
}
}
function So(e, t) {
if (Array.isArray(e) && Ec(t)) {
e.splice(Number(t), 1);
return;
}
tn(e) && delete e[t];
}
function Mi(e, t) {
if (uo(t)) {
delete e[Hl(t)];
return;
}
const n = t.split(/\.|\[(\d+)\]/).filter(Boolean);
let i = e;
for (let o = 0; o < n.length; o++) {
if (o === n.length - 1) {
So(i, n[o]);
break;
}
if (!(n[o] in i) || Jn(i[n[o]]))
break;
i = i[n[o]];
}
const a = n.map((o, r) => it(e, n.slice(0, r).join(".")));
for (let o = a.length - 1; o >= 0; o--)
if (!!Zc(a[o])) {
if (o === 0) {
So(e, n[0]);
continue;
}
So(a[o - 1], n[o - 1]);
}
}
function ut(e) {
return Object.keys(e);
}
function Fl(e, t = void 0) {
const n = an();
return (n == null ? void 0 : n.provides[e]) || Sc(e, t);
}
function jo(e) {
jc(`[vee-validate]: ${e}`);
}
function qf(e) {
return Array.isArray(e) ? e[0] : e;
}
function Qo(e, t, n) {
if (Array.isArray(e)) {
const i = [...e], a = i.findIndex((o) => ct(o, t));
return a >= 0 ? i.splice(a, 1) : i.push(t), i;
}
return ct(e, t) ? n : t;
}
function Kf(e, t) {
let n, i;
return function(...a) {
const o = this;
return n || (n = !0, setTimeout(() => n = !1, t), i = e.apply(o, a)), i;
};
}
function As(e, t = 0) {
let n = null, i = [];
return function(...a) {
return n && window.clearTimeout(n), n = window.setTimeout(() => {
const o = e(...a);
i.forEach((r) => r(o)), i = [];
}, t), new Promise((o) => i.push(o));
};
}
function em(e, t) {
return tn(t) && t.number ? Uf(e) : e;
}
function Ho(e, t) {
let n;
return async function(...a) {
const o = e(...a);
n = o;
const r = await o;
return o !== n || (n = void 0, t(r, a)), r;
};
}
function tm({ get: e, set: t }) {
const n = V(Re(e()));
return Pe(e, (i) => {
ct(i, n.value) || (n.value = Re(i));
}, {
deep: !0
}), Pe(n, (i) => {
ct(i, e()) || t(Re(i));
}, {
deep: !0
}), n;
}
const co = (e, t, n) => t.slots.default ? typeof e == "string" || !e ? t.slots.default(n()) : {
default: () => {
var i, a;
return (a = (i = t.slots).default) === null || a === void 0 ? void 0 : a.call(i, n());
}
} : t.slots.default;
function Do(e) {
if (Yc(e))
return e._value;
}
function Yc(e) {
return "_value" in e;
}
function Xl(e) {
if (!Ql(e))
return e;
const t = e.target;
if (zn(t.type) && Yc(t))
return Do(t);
if (t.type === "file" && t.files) {
const n = Array.from(t.files);
return t.multiple ? n : n[0];
}
if (Ff(t))
return Array.from(t.options).filter((n) => n.selected && !n.disabled).map(Do);
if (Gc(t)) {
const n = Array.from(t.options).find((i) => i.selected);
return n ? Do(n) : t.value;
}
return t.value;
}
function Uc(e) {
const t = {};
return Object.defineProperty(t, "_$$isNormalized", {
value: !0,
writable: !1,
enumerable: !1,
configurable: !1
}), e ? tn(e) && e._$$isNormalized ? e : tn(e) ? Object.keys(e).reduce((n, i) => {
const a = nm(e[i]);
return e[i] !== !1 && (n[i] = Cs(a)), n;
}, t) : typeof e != "string" ? t : e.split("|").reduce((n, i) => {
const a = im(i);
return a.name && (n[a.name] = Cs(a.params)), n;
}, t) : t;
}
function nm(e) {
return e === !0 ? [] : Array.isArray(e) || tn(e) ? e : [e];
}
function Cs(e) {
const t = (n) => typeof n == "string" && n[0] === "@" ? am(n.slice(1)) : n;
return Array.isArray(e) ? e.map(t) : e instanceof RegExp ? [e] : Object.keys(e).reduce((n, i) => (n[i] = t(e[i]), n), {});
}
const im = (e) => {
let t = [];
const n = e.split(":")[0];
return e.includes(":") && (t = e.split(":").slice(1).join(":").split(",")), { name: n, params: t };
};
function am(e) {
const t = (n) => it(n, e) || n[e];
return t.__locatorRef = e, t;
}
function om(e) {
return Array.isArray(e) ? e.filter(Wo) : ut(e).filter((t) => Wo(e[t])).map((t) => e[t]);
}
const rm = {
generateMessage: ({ field: e }) => `${e} is not valid.`,
bails: !0,
validateOnBlur: !0,
validateOnChange: !0,
validateOnInput: !1,
validateOnModelUpdate: !0
};
let lm = Object.assign({}, rm);
const Jl = () => lm;
async function Vc(e, t, n = {}) {
const i = n == null ? void 0 : n.bails, a = {
name: (n == null ? void 0 : n.name) || "{field}",
rules: t,
bails: i != null ? i : !0,
formData: (n == null ? void 0 : n.values) || {}
}, r = (await sm(a, e)).errors;
return {
errors: r,
valid: !r.length
};
}
async function sm(e, t) {
if (qn(e.rules))
return um(t, e.rules, { bails: e.bails });
if (Pn(e.rules) || Array.isArray(e.rules)) {
const r = {
field: e.name,
form: e.formData,
value: t
}, l = Array.isArray(e.rules) ? e.rules : [e.rules], c = l.length, d = [];
for (let y = 0; y < c; y++) {
const f = l[y], h = await f(t, r);
if (typeof h != "string" && h)
continue;
const I = typeof h == "string" ? h : Rc(r);
if (d.push(I), e.bails)
return {
errors: d
};
}
return {
errors: d
};
}
const n = Object.assign(Object.assign({}, e), { rules: Uc(e.rules) }), i = [], a = Object.keys(n.rules), o = a.length;
for (let r = 0; r < o; r++) {
const l = a[r], c = await cm(n, t, {
name: l,
params: n.rules[l]
});
if (c.error && (i.push(c.error), e.bails))
return {
errors: i
};
}
return {
errors: i
};
}
async function um(e, t, n) {
var i;
return {
errors: await t.validate(e, {
abortEarly: (i = n.bails) !== null && i !== void 0 ? i : !0
}).then(() => []).catch((o) => {
if (o.name === "ValidationError")
return o.errors;
throw o;
})
};
}
async function cm(e, t, n) {
const i = Rf(n.name);
if (!i)
throw new Error(`No such validator '${n.name}' exists.`);
const a = dm(n.params, e.formData), o = {
field: e.name,
value: t,
form: e.formData,
rule: Object.assign(Object.assign({}, n), { params: a })
}, r = await i(t, a, o);
return typeof r == "string" ? {
error: r
} : {
error: r ? void 0 : Rc(o)
};
}
function Rc(e) {
const t = Jl().generateMessage;
return t ? t(e) : "Field is invalid";
}
function dm(e, t) {
const n = (i) => Wo(i) ? i(t) : i;
return Array.isArray(e) ? e.map(n) : Object.keys(e).reduce((i, a) => (i[a] = n(e[a]), i), {});
}
async function fm(e, t) {
const n = await e.validate(t, { abortEarly: !1 }).then(() => []).catch((o) => {
if (o.name !== "ValidationError")
throw o;
return o.inner || [];
}), i = {}, a = {};
for (const o of n) {
const r = o.errors;
i[o.path] = { valid: !r.length, errors: r }, r.length && (a[o.path] = r[0]);
}
return {
valid: !n.length,
results: i,
errors: a
};
}
async function mm(e, t, n) {
const a = ut(e).map(async (d) => {
var y, f, h;
const g = await Vc(it(t, d), e[d], {
name: ((y = n == null ? void 0 : n.names) === null || y === void 0 ? void 0 : y[d]) || d,
values: t,
bails: (h = (f = n == null ? void 0 : n.bailsMap) === null || f === void 0 ? void 0 : f[d]) !== null && h !== void 0 ? h : !0
});
return Object.assign(Object.assign({}, g), { path: d });
});
let o = !0;
const r = await Promise.all(a), l = {}, c = {};
for (const d of r)
l[d.path] = {
valid: d.valid,
errors: d.errors
}, d.valid || (o = !1, c[d.path] = d.errors[0]);
return {
valid: o,
results: l,
errors: c
};
}
let Ls = 0;
function hm(e, t) {
const { value: n, initialValue: i, setInitialValue: a } = Wc(e, t.modelValue, t.form), { errorMessage: o, errors: r, setErrors: l } = vm(e, t.form), c = ym(n, i, r), d = Ls >= Number.MAX_SAFE_INTEGER ? 0 : ++Ls;
function y(f) {
var h;
"value" in f && (n.value = f.value), "errors" in f && l(f.errors), "touched" in f && (c.touched = (h = f.touched) !== null && h !== void 0 ? h : c.touched), "initialValue" in f && a(f.initialValue);
}
return {
id: d,
path: e,
value: n,
initialValue: i,
meta: c,
errors: r,
errorMessage: o,
setState: y
};
}
function Wc(e, t, n) {
const i = V(s(t));
function a() {
return n ? it(n.meta.value.initialValues, s(e), s(i)) : s(i);
}
function o(d) {
if (!n) {
i.value = d;
return;
}
n.stageInitialValue(s(e), d, !0);
}
const r = S(a);
if (!n)
return {
value: V(a()),
initialValue: r,
setInitialValue: o
};
const l = t ? s(t) : it(n.values, s(e), s(r));
return n.stageInitialValue(s(e), l, !0), {
value: S({
get() {
return it(n.values, s(e));
},
set(d) {
n.setFieldValue(s(e), d);
}
}),
initialValue: r,
setInitialValue: o
};
}
function ym(e, t, n) {
const i = Ct({
touched: !1,
pending: !1,
valid: !0,
validated: !!s(n).length,
initialValue: S(() => s(t)),
dirty: S(() => !ct(s(e), s(t)))
});
return Pe(n, (a) => {
i.valid = !a.length;
}, {
immediate: !0,
flush: "sync"
}), i;
}
function vm(e, t) {
function n(a) {
return a ? Array.isArray(a) ? a : [a] : [];
}
if (!t) {
const a = V([]);
return {
errors: a,
errorMessage: S(() => a.value[0]),
setErrors: (o) => {
a.value = n(o);
}
};
}
const i = S(() => t.errorBag.value[s(e)] || []);
return {
errors: i,
errorMessage: S(() => i.value[0]),
setErrors: (a) => {
t.setFieldErrorBag(s(e), n(a));
}
};
}
function Qc(e) {
process.env.NODE_ENV !== "production" && Yf({
id: "vee-validate-devtools-plugin",
label: "VeeValidate Plugin",
packageName: "vee-validate",
homepage: "https://vee-validate.logaretm.com/v4",
app: e,
logo: "https://vee-validate.logaretm.com/v4/logo.png"
}, Im);
}
const Kn = {}, ei = {};
let Ht;
const $n = Kf(() => {
setTimeout(async () => {
await At(), Ht == null || Ht.sendInspectorState(_n), Ht == null || Ht.sendInspectorTree(_n);
}, 100);
}, 100);
function gm(e) {
const t = an();
if (!Ht) {
const n = t == null ? void 0 : t.appContext.ap