Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vee-validate

Package Overview
Dependencies
Maintainers
1
Versions
342
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vee-validate - npm Package Compare versions

Comparing version 4.6.10 to 4.7.0

83

dist/vee-validate.d.ts

@@ -130,2 +130,3 @@ import * as vue from 'vue';

evt?: Event;
controlledValues: Partial<TValues>;
}

@@ -145,5 +146,7 @@ declare type SubmissionHandler<TValues extends GenericFormValues = GenericFormValues, TReturn = unknown> = (values: TValues, ctx: SubmissionContext<TValues>) => TReturn;

};
declare type HandleSubmitFactory<TValues extends GenericFormValues> = <TReturn = unknown>(cb: SubmissionHandler<TValues, TReturn>, onSubmitValidationErrorCb?: InvalidSubmissionHandler<TValues>) => (e?: Event) => Promise<TReturn | undefined>;
interface PrivateFormContext<TValues extends Record<string, any> = Record<string, any>> extends FormActions<TValues> {
formId: number;
values: TValues;
controlledValues: Ref<TValues>;
fieldsByPath: Ref<FieldPathLookup>;

@@ -166,3 +169,5 @@ fieldArrays: PrivateFieldArrayContext[];

unregister(field: PrivateFieldContext): void;
handleSubmit<TReturn = unknown>(cb: SubmissionHandler<TValues, TReturn>, onSubmitValidationErrorCb?: InvalidSubmissionHandler<TValues>): (e?: Event) => Promise<TReturn | undefined>;
handleSubmit: HandleSubmitFactory<TValues> & {
withControlled: HandleSubmitFactory<TValues>;
};
setFieldInitialValue(path: string, value: unknown): void;

@@ -212,2 +217,3 @@ useFieldModel<TPath extends keyof TValues>(path: MaybeRef<TPath>): Ref<TValues[TPath]>;

label?: MaybeRef<string | undefined>;
controlled?: boolean;
standalone?: boolean;

@@ -217,2 +223,3 @@ keepValueOnUnmount?: MaybeRef<boolean | undefined>;

syncVModel?: boolean;
form?: FormContext;
}

@@ -256,4 +263,4 @@ declare type RuleExpression<TValue> = string | Record<string, unknown> | GenericValidateFunction<TValue> | GenericValidateFunction<TValue>[] | YupValidator<TValue> | undefined;

modelValue: any;
validateOnMount: boolean;
standalone: boolean;
validateOnMount: boolean;
modelModifiers: any;

@@ -328,3 +335,3 @@ rules: RuleExpression<unknown>;

};
}>> & vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, "label" | "as" | "bails" | "uncheckedValue" | "validateOnInput" | "validateOnChange" | "validateOnBlur" | "validateOnModelUpdate" | "modelValue" | "standalone" | "validateOnMount" | "modelModifiers" | "rules" | "onUpdate:modelValue" | "keepValue">;
}>> & vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, "label" | "as" | "bails" | "uncheckedValue" | "validateOnInput" | "validateOnChange" | "validateOnBlur" | "validateOnModelUpdate" | "modelValue" | "validateOnMount" | "standalone" | "modelModifiers" | "rules" | "onUpdate:modelValue" | "keepValue">;
$attrs: {

@@ -410,9 +417,9 @@ [x: string]: unknown;

[key: string]: any;
}> | vue.Slot | VNode<vue.RendererNode, vue.RendererElement, {
}> | VNode<vue.RendererNode, vue.RendererElement, {
[key: string]: any;
}>[] | {
}>[] | vue.Slot | {
default: () => VNode<vue.RendererNode, vue.RendererElement, {
[key: string]: any;
}>[];
}, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, Record<string, any>, string, {
}, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, {
label: string;

@@ -427,4 +434,4 @@ as: string | Record<string, any>;

modelValue: any;
validateOnMount: boolean;
standalone: boolean;
validateOnMount: boolean;
modelModifiers: any;

@@ -521,5 +528,5 @@ rules: RuleExpression<unknown>;

[key: string]: any;
}> | vue.Slot | VNode<vue.RendererNode, vue.RendererElement, {
}> | VNode<vue.RendererNode, vue.RendererElement, {
[key: string]: any;
}>[] | {
}>[] | vue.Slot | {
default: () => VNode<vue.RendererNode, vue.RendererElement, {

@@ -599,9 +606,9 @@ [key: string]: any;

[key: string]: any;
}> | vue.Slot | VNode<vue.RendererNode, vue.RendererElement, {
}> | VNode<vue.RendererNode, vue.RendererElement, {
[key: string]: any;
}>[] | {
}>[] | vue.Slot | {
default: () => VNode<vue.RendererNode, vue.RendererElement, {
[key: string]: any;
}>[];
}, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, Record<string, any>, string, {
}, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, {
label: string;

@@ -616,4 +623,4 @@ as: string | Record<string, any>;

modelValue: any;
validateOnMount: boolean;
standalone: boolean;
validateOnMount: boolean;
modelModifiers: any;

@@ -634,3 +641,3 @@ rules: RuleExpression<unknown>;

declare type FormSlotProps = UnwrapRef<Pick<FormContext, 'meta' | 'errors' | 'values' | 'isSubmitting' | 'submitCount' | 'validate' | 'validateField' | 'handleReset' | 'setErrors' | 'setFieldError' | 'setFieldValue' | 'setValues' | 'setFieldTouched' | 'setTouched' | 'resetForm'>> & {
declare type FormSlotProps = UnwrapRef<Pick<FormContext, 'meta' | 'errors' | 'values' | 'isSubmitting' | 'submitCount' | 'validate' | 'validateField' | 'handleReset' | 'setErrors' | 'setFieldError' | 'setFieldValue' | 'setValues' | 'setFieldTouched' | 'setTouched' | 'resetForm' | 'controlledValues'>> & {
handleSubmit: (evt: Event | SubmissionHandler, onSubmit?: SubmissionHandler) => Promise<unknown>;

@@ -743,9 +750,9 @@ submitForm(evt?: Event): void;

[key: string]: any;
}> | vue.Slot | VNode<vue.RendererNode, vue.RendererElement, {
}> | VNode<vue.RendererNode, vue.RendererElement, {
[key: string]: any;
}>[] | {
}>[] | vue.Slot | {
default: () => VNode<vue.RendererNode, vue.RendererElement, {
[key: string]: any;
}>[];
}, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, Record<string, any>, string, {
}, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, {
onSubmit: SubmissionHandler<GenericFormValues, unknown>;

@@ -819,5 +826,5 @@ as: string;

[key: string]: any;
}> | vue.Slot | VNode<vue.RendererNode, vue.RendererElement, {
}> | VNode<vue.RendererNode, vue.RendererElement, {
[key: string]: any;
}>[] | {
}>[] | vue.Slot | {
default: () => VNode<vue.RendererNode, vue.RendererElement, {

@@ -869,9 +876,9 @@ [key: string]: any;

[key: string]: any;
}> | vue.Slot | VNode<vue.RendererNode, vue.RendererElement, {
}> | VNode<vue.RendererNode, vue.RendererElement, {
[key: string]: any;
}>[] | {
}>[] | vue.Slot | {
default: () => VNode<vue.RendererNode, vue.RendererElement, {
[key: string]: any;
}>[];
}, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, Record<string, any>, string, {
}, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, {
onSubmit: SubmissionHandler<GenericFormValues, unknown>;

@@ -929,9 +936,9 @@ as: string;

};
}>>, () => vue.Slot | VNode<vue.RendererNode, vue.RendererElement, {
}>>, () => VNode<vue.RendererNode, vue.RendererElement, {
[key: string]: any;
}>[] | {
}>[] | vue.Slot | {
default: () => VNode<vue.RendererNode, vue.RendererElement, {
[key: string]: any;
}>[];
}, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, Record<string, any>, string, {}> & {
}, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, {}> & {
beforeCreate?: (() => void) | (() => void)[];

@@ -961,5 +968,5 @@ created?: (() => void) | (() => void)[];

};
}>> & vue.ShallowUnwrapRef<() => vue.Slot | VNode<vue.RendererNode, vue.RendererElement, {
}>> & vue.ShallowUnwrapRef<() => VNode<vue.RendererNode, vue.RendererElement, {
[key: string]: any;
}>[] | {
}>[] | vue.Slot | {
default: () => VNode<vue.RendererNode, vue.RendererElement, {

@@ -977,9 +984,9 @@ [key: string]: any;

};
}>>, () => vue.Slot | VNode<vue.RendererNode, vue.RendererElement, {
}>>, () => VNode<vue.RendererNode, vue.RendererElement, {
[key: string]: any;
}>[] | {
}>[] | vue.Slot | {
default: () => VNode<vue.RendererNode, vue.RendererElement, {
[key: string]: any;
}>[];
}, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, Record<string, any>, string, {}> & vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps & (new () => {
}, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, {}> & vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps & (new () => {
push: FieldArrayContext['push'];

@@ -1041,9 +1048,9 @@ remove: FieldArrayContext['remove'];

[key: string]: any;
}> | vue.Slot | VNode<vue.RendererNode, vue.RendererElement, {
}> | VNode<vue.RendererNode, vue.RendererElement, {
[key: string]: any;
}>[] | {
}>[] | vue.Slot | {
default: () => VNode<vue.RendererNode, vue.RendererElement, {
[key: string]: any;
}>[];
}, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, Record<string, any>, string, {
}, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, {
as: string;

@@ -1081,5 +1088,5 @@ }> & {

[key: string]: any;
}> | vue.Slot | VNode<vue.RendererNode, vue.RendererElement, {
}> | VNode<vue.RendererNode, vue.RendererElement, {
[key: string]: any;
}>[] | {
}>[] | vue.Slot | {
default: () => VNode<vue.RendererNode, vue.RendererElement, {

@@ -1103,9 +1110,9 @@ [key: string]: any;

[key: string]: any;
}> | vue.Slot | VNode<vue.RendererNode, vue.RendererElement, {
}> | VNode<vue.RendererNode, vue.RendererElement, {
[key: string]: any;
}>[] | {
}>[] | vue.Slot | {
default: () => VNode<vue.RendererNode, vue.RendererElement, {
[key: string]: any;
}>[];
}, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, Record<string, any>, string, {
}, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, {
as: string;

@@ -1112,0 +1119,0 @@ }> & vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps & (new () => {

/**
* vee-validate v4.6.10
* vee-validate v4.7.0
* (c) 2022 Abdelrahman Awad
* @license MIT
*/
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vue")):"function"==typeof define&&define.amd?define(["exports","vue"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).VeeValidate={},e.Vue)}(this,(function(e,t){"use strict";function n(e){return"function"==typeof e}function r(e){return null==e}const a=e=>null!==e&&!!e&&"object"==typeof e&&!Array.isArray(e);function i(e){return Number(e)>=0}const u={};const o=Symbol("vee-validate-form"),l=Symbol("vee-validate-field-instance"),s=Symbol("Default empty value"),d="undefined"!=typeof window;function c(e){return n(e)&&!!e.__locatorRef}function f(e){return!!e&&n(e.validate)}function v(e){return"checkbox"===e||"radio"===e}function p(e){return Array.isArray(e)?0===e.length:a(e)&&0===Object.keys(e).length}function m(e){return/^\[.+\]$/i.test(e)}function y(e){return"SELECT"===e.tagName}function h(e,t){return!function(e,t){const n=![!1,null,void 0,0].includes(t.multiple)&&!Number.isNaN(t.multiple);return"select"===e&&"multiple"in t&&n}(e,t)&&"file"!==t.type&&!v(t.type)}function g(e){return b(e)&&e.target&&"submit"in e.target}function b(e){return!!e&&(!!("undefined"!=typeof Event&&n(Event)&&e instanceof Event)||!(!e||!e.srcElement))}function O(e,t){return t in e&&e[t]!==s}function V(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){if(e.constructor!==t.constructor)return!1;var n,r,a;if(Array.isArray(e)){if((n=e.length)!=t.length)return!1;for(r=n;0!=r--;)if(!V(e[r],t[r]))return!1;return!0}if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(r of e.entries())if(!t.has(r[0]))return!1;for(r of e.entries())if(!V(r[1],t.get(r[0])))return!1;return!0}if(F(e)&&F(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(r of e.entries())if(!t.has(r[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if((n=e.length)!=t.length)return!1;for(r=n;0!=r--;)if(e[r]!==t[r])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((n=(a=Object.keys(e)).length)!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!Object.prototype.hasOwnProperty.call(t,a[r]))return!1;for(r=n;0!=r--;){var i=a[r];if(!V(e[i],t[i]))return!1}return!0}return e!=e&&t!=t}function F(e){return!!d&&e instanceof File}var A=function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;var r,a,i;if(Array.isArray(t)){if((r=t.length)!=n.length)return!1;for(a=r;0!=a--;)if(!e(t[a],n[a]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((r=(i=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(a=r;0!=a--;)if(!Object.prototype.hasOwnProperty.call(n,i[a]))return!1;for(a=r;0!=a--;){var u=i[a];if(!e(t[u],n[u]))return!1}return!0}return t!=t&&n!=n};function j(e){return m(e)?e.replace(/\[|\]/gi,""):e}function w(e,t,n){if(!e)return n;if(m(t))return e[j(t)];return(t||"").split(/\.|\[(\d+)\]/).filter(Boolean).reduce(((e,t)=>{return(a(r=e)||Array.isArray(r))&&t in e?e[t]:n;var r}),e)}function E(e,t,n){if(m(t))return void(e[j(t)]=n);const a=t.split(/\.|\[(\d+)\]/).filter(Boolean);let u=e;for(let e=0;e<a.length;e++){if(e===a.length-1)return void(u[a[e]]=n);a[e]in u&&!r(u[a[e]])||(u[a[e]]=i(a[e+1])?[]:{}),u=u[a[e]]}}function S(e,t){Array.isArray(e)&&i(t)?e.splice(Number(t),1):a(e)&&delete e[t]}function k(e,t){if(m(t))return void delete e[j(t)];const n=t.split(/\.|\[(\d+)\]/).filter(Boolean);let a=e;for(let e=0;e<n.length;e++){if(e===n.length-1){S(a,n[e]);break}if(!(n[e]in a)||r(a[n[e]]))break;a=a[n[e]]}const i=n.map(((t,r)=>w(e,n.slice(0,r).join("."))));for(let t=i.length-1;t>=0;t--)p(i[t])&&(0!==t?S(i[t-1],n[t-1]):S(e,n[0]))}function B(e){return Object.keys(e)}function I(e,n){const r=t.getCurrentInstance();return(null==r?void 0:r.provides[e])||t.inject(e,n)}function M(e){t.warn(`[vee-validate]: ${e}`)}function T(e){return Array.isArray(e)?e[0]:e}function C(e,t,n){if(Array.isArray(e)){const n=[...e],r=n.findIndex((e=>A(e,t)));return r>=0?n.splice(r,1):n.push(t),n}return A(e,t)?n:t}function R(e,t=0){let n=null,r=[];return function(...a){return n&&window.clearTimeout(n),n=window.setTimeout((()=>{const t=e(...a);r.forEach((e=>e(t))),r=[]}),t),new Promise((e=>r.push(e)))}}function x(e,t){return a(t)&&t.number?function(e){const t=parseFloat(e);return isNaN(t)?e:t}(e):e}function P(e,t){let n;return async function(...r){const a=e(...r);n=a;const i=await a;return a!==n||(n=void 0,t(i,r)),i}}const N=(e,t,n)=>t.slots.default?"string"!=typeof e&&e?{default:()=>{var e,r;return null===(r=(e=t.slots).default)||void 0===r?void 0:r.call(e,n())}}:t.slots.default(n()):t.slots.default;function _(e){if(U(e))return e._value}function U(e){return"_value"in e}function $(e){if(!b(e))return e;const t=e.target;if(v(t.type)&&U(t))return _(t);if("file"===t.type&&t.files){const e=Array.from(t.files);return t.multiple?e:e[0]}if(y(n=t)&&n.multiple)return Array.from(t.options).filter((e=>e.selected&&!e.disabled)).map(_);var n;if(y(t)){const e=Array.from(t.options).find((e=>e.selected));return e?_(e):t.value}return t.value}function D(e){const t={};return Object.defineProperty(t,"_$$isNormalized",{value:!0,writable:!1,enumerable:!1,configurable:!1}),e?a(e)&&e._$$isNormalized?e:a(e)?Object.keys(e).reduce(((t,n)=>{const r=function(e){if(!0===e)return[];if(Array.isArray(e))return e;if(a(e))return e;return[e]}(e[n]);return!1!==e[n]&&(t[n]=z(r)),t}),t):"string"!=typeof e?t:e.split("|").reduce(((e,t)=>{const n=q(t);return n.name?(e[n.name]=z(n.params),e):e}),t):t}function z(e){const t=e=>"string"==typeof e&&"@"===e[0]?function(e){const t=t=>w(t,e)||t[e];return t.__locatorRef=e,t}(e.slice(1)):e;return Array.isArray(e)?e.map(t):e instanceof RegExp?[e]:Object.keys(e).reduce(((n,r)=>(n[r]=t(e[r]),n)),{})}const q=e=>{let t=[];const n=e.split(":")[0];return e.includes(":")&&(t=e.split(":").slice(1).join(":").split(",")),{name:n,params:t}};let L=Object.assign({},{generateMessage:({field:e})=>`${e} is not valid.`,bails:!0,validateOnBlur:!0,validateOnChange:!0,validateOnInput:!1,validateOnModelUpdate:!0});const K=()=>L,G=e=>{L=Object.assign(Object.assign({},L),e)};async function X(e,t,r={}){const a=null==r?void 0:r.bails,i={name:(null==r?void 0:r.name)||"{field}",rules:t,bails:null==a||a,formData:(null==r?void 0:r.values)||{}},u=await async function(e,t){if(f(e.rules))return async function(e,t,n){var r;return{errors:await t.validate(e,{abortEarly:null===(r=n.bails)||void 0===r||r}).then((()=>[])).catch((e=>{if("ValidationError"===e.name)return e.errors;throw e}))}}(t,e.rules,{bails:e.bails});if(n(e.rules)||Array.isArray(e.rules)){const n={field:e.name,form:e.formData,value:t},r=Array.isArray(e.rules)?e.rules:[e.rules],a=r.length,i=[];for(let u=0;u<a;u++){const a=r[u],o=await a(t,n);if("string"!=typeof o&&o)continue;const l="string"==typeof o?o:J(n);if(i.push(l),e.bails)return{errors:i}}return{errors:i}}const r=Object.assign(Object.assign({},e),{rules:D(e.rules)}),a=[],i=Object.keys(r.rules),u=i.length;for(let n=0;n<u;n++){const u=i[n],o=await H(r,t,{name:u,params:r.rules[u]});if(o.error&&(a.push(o.error),e.bails))return{errors:a}}return{errors:a}}(i,e),o=u.errors;return{errors:o,valid:!o.length}}async function H(e,t,n){const r=(a=n.name,u[a]);var a;if(!r)throw new Error(`No such validator '${n.name}' exists.`);const i=function(e,t){const n=e=>c(e)?e(t):e;if(Array.isArray(e))return e.map(n);return Object.keys(e).reduce(((t,r)=>(t[r]=n(e[r]),t)),{})}(n.params,e.formData),o={field:e.name,value:t,form:e.formData,rule:Object.assign(Object.assign({},n),{params:i})},l=await r(t,i,o);return"string"==typeof l?{error:l}:{error:l?void 0:J(o)}}function J(e){const t=K().generateMessage;return t?t(e):"Field is invalid"}async function Q(e,t,n){const r=B(e).map((async r=>{var a,i,u;const o=await X(w(t,r),e[r],{name:(null===(a=null==n?void 0:n.names)||void 0===a?void 0:a[r])||r,values:t,bails:null===(u=null===(i=null==n?void 0:n.bailsMap)||void 0===i?void 0:i[r])||void 0===u||u});return Object.assign(Object.assign({},o),{path:r})}));let a=!0;const i=await Promise.all(r),u={},o={};for(const e of i)u[e.path]={valid:e.valid,errors:e.errors},e.valid||(a=!1,o[e.path]=e.errors[0]);return{valid:a,results:u,errors:o}}function W(e,t,n){"object"==typeof n.value&&(n.value=Y(n.value)),n.enumerable&&!n.get&&!n.set&&n.configurable&&n.writable&&"__proto__"!==t?e[t]=n.value:Object.defineProperty(e,t,n)}function Y(e){if("object"!=typeof e)return e;var t,n,r,a=0,i=Object.prototype.toString.call(e);if("[object Object]"===i?r=Object.create(e.__proto__||null):"[object Array]"===i?r=Array(e.length):"[object Set]"===i?(r=new Set,e.forEach((function(e){r.add(Y(e))}))):"[object Map]"===i?(r=new Map,e.forEach((function(e,t){r.set(Y(t),Y(e))}))):"[object Date]"===i?r=new Date(+e):"[object RegExp]"===i?r=new RegExp(e.source,e.flags):"[object DataView]"===i?r=new e.constructor(Y(e.buffer)):"[object ArrayBuffer]"===i?r=e.slice(0):"Array]"===i.slice(-6)&&(r=new e.constructor(e)),r){for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)W(r,n[a],Object.getOwnPropertyDescriptor(e,n[a]));for(a=0,n=Object.getOwnPropertyNames(e);a<n.length;a++)Object.hasOwnProperty.call(r,t=n[a])&&r[t]===e[t]||W(r,t,Object.getOwnPropertyDescriptor(e,t))}return r||e}let Z=0;function ee(e,n){const{value:r,initialValue:a,setInitialValue:i}=te(e,n.modelValue,!n.standalone),{errorMessage:u,errors:l,setErrors:s}=function(e,n){const r=n?I(o,void 0):void 0;function a(e){return e?Array.isArray(e)?e:[e]:[]}if(!r){const e=t.ref([]);return{errors:e,errorMessage:t.computed((()=>e.value[0])),setErrors:t=>{e.value=a(t)}}}const i=t.computed((()=>r.errorBag.value[t.unref(e)]||[]));return{errors:i,errorMessage:t.computed((()=>i.value[0])),setErrors:n=>{r.setFieldErrorBag(t.unref(e),a(n))}}}(e,!n.standalone),d=function(e,n,r){const a=t.reactive({touched:!1,pending:!1,valid:!0,validated:!!t.unref(r).length,initialValue:t.computed((()=>t.unref(n))),dirty:t.computed((()=>!V(t.unref(e),t.unref(n))))});return t.watch(r,(e=>{a.valid=!e.length}),{immediate:!0,flush:"sync"}),a}(r,a,l);return{id:Z>=Number.MAX_SAFE_INTEGER?0:++Z,path:e,value:r,initialValue:a,meta:d,errors:l,errorMessage:u,setState:function(e){var t;"value"in e&&(r.value=e.value),"errors"in e&&s(e.errors),"touched"in e&&(d.touched=null!==(t=e.touched)&&void 0!==t?t:d.touched),"initialValue"in e&&i(e.initialValue)}}}function te(e,n,r=!0){const a=!0===r?I(o,void 0):void 0,i=t.ref(t.unref(n));function u(){return a?w(a.meta.value.initialValues,t.unref(e),t.unref(i)):t.unref(i)}function l(n){a?a.stageInitialValue(t.unref(e),n,!0):i.value=n}const s=t.computed(u);if(!a){return{value:t.ref(u()),initialValue:s,setInitialValue:l}}const d=n?t.unref(n):w(a.values,t.unref(e),t.unref(s));a.stageInitialValue(t.unref(e),d,!0);return{value:t.computed({get:()=>w(a.values,t.unref(e)),set(n){a.setFieldValue(t.unref(e),n)}}),initialValue:s,setInitialValue:l}}function ne(e,n,r){return v(null==r?void 0:r.type)?function(e,n,r){const a=(null==r?void 0:r.standalone)?void 0:I(o),i=null==r?void 0:r.checkedValue,u=null==r?void 0:r.uncheckedValue;function l(e){const n=e.handleChange,r=t.computed((()=>{const n=t.unref(e.value),r=t.unref(i);return Array.isArray(n)?n.findIndex((e=>V(e,r)))>=0:V(r,n)}));function o(o,l=!0){var s;if(r.value===(null===(s=null==o?void 0:o.target)||void 0===s?void 0:s.checked))return void(l&&e.validate());let d=$(o);a||(d=C(t.unref(e.value),t.unref(i),t.unref(u))),n(d,l)}return Object.assign(Object.assign({},e),{checked:r,checkedValue:i,uncheckedValue:u,handleChange:o})}return l(re(e,n,r))}(e,n,r):re(e,n,r)}function re(e,r,a){const{initialValue:i,validateOnMount:u,bails:d,type:v,checkedValue:p,label:m,validateOnValueUpdate:y,uncheckedValue:h,standalone:g,keepValueOnUnmount:b,modelPropName:O,syncVModel:F}=function(e,t){const n=()=>({initialValue:void 0,validateOnMount:!1,bails:!0,rules:"",label:e,validateOnValueUpdate:!0,standalone:!1,keepValueOnUnmount:void 0,modelPropName:"modelValue",syncVModel:!0});if(!t)return n();const r="valueProp"in t?t.valueProp:t.checkedValue;return Object.assign(Object.assign(Object.assign({},n()),t||{}),{checkedValue:r})}(t.unref(e),a),A=g?void 0:I(o);let j=!1;const{id:E,value:S,initialValue:k,meta:M,setState:T,errors:C,errorMessage:R}=ee(e,{modelValue:i,standalone:g});F&&function({prop:e,value:n,handleChange:r}){const a=t.getCurrentInstance();if(!a)return;const i=e||"modelValue",u=`update:${i}`;if(!(i in a.props))return;t.watch(n,(e=>{V(e,ae(a,i))||a.emit(u,e)})),t.watch((()=>ae(a,i)),(e=>{if(e===s&&void 0===n.value)return;const t=e===s?void 0:e;V(t,x(n.value,a.props.modelModifiers))||r(t)}))}({value:S,prop:O,handleChange:q});const N=t.computed((()=>{let a=t.unref(r);const i=t.unref(null==A?void 0:A.schema);return i&&!f(i)&&(a=function(e,t){if(!e)return;return e[t]}(i,t.unref(e))||a),f(a)||n(a)||Array.isArray(a)?a:D(a)}));async function _(n){var r,a;return(null==A?void 0:A.validateSchema)?null!==(r=(await A.validateSchema(n)).results[t.unref(e)])&&void 0!==r?r:{valid:!0,errors:[]}:X(S.value,N.value,{name:t.unref(m)||t.unref(e),values:null!==(a=null==A?void 0:A.values)&&void 0!==a?a:{},bails:d})}const U=P((async()=>(M.pending=!0,M.validated=!0,_("validated-only"))),(e=>(j&&(e.valid=!0,e.errors=[]),T({errors:e.errors}),M.pending=!1,e))),z=P((async()=>_("silent")),(e=>(j&&(e.valid=!0),M.valid=e.valid,e)));function q(e,t=!0){const n=$(e);S.value=n,!y&&t&&U()}let L;t.onMounted((()=>{if(u)return U();A&&A.validateSchema||z()}));let K=Y(S.value);function G(){L=t.watch(S,((e,t)=>{if(V(e,t)&&V(e,K))return;(y?U:z)(),K=Y(e)}),{deep:!0})}function H(e){var n;null==L||L();const r=e&&"value"in e?e.value:k.value;T({value:Y(r),initialValue:Y(r),touched:null!==(n=null==e?void 0:e.touched)&&void 0!==n&&n,errors:(null==e?void 0:e.errors)||[]}),M.pending=!1,M.validated=!1,z(),t.nextTick((()=>{G()}))}G();const J={id:E,name:e,label:m,value:S,meta:M,errors:C,errorMessage:R,type:v,checkedValue:p,uncheckedValue:h,bails:d,keepValueOnUnmount:b,resetField:H,handleReset:()=>H(),validate:function(e){return"silent"===(null==e?void 0:e.mode)?z():U()},handleChange:q,handleBlur:()=>{M.touched=!0},setState:T,setTouched:function(e){M.touched=e},setErrors:function(e){T({errors:Array.isArray(e)?e:[e]})},setValue:function(e){S.value=e}};if(t.provide(l,J),t.isRef(r)&&"function"!=typeof t.unref(r)&&t.watch(r,((e,t)=>{V(e,t)||(M.validated?U():z())}),{deep:!0}),!A)return J;A.register(J),t.onBeforeUnmount((()=>{j=!0,A.unregister(J)}));const Q=t.computed((()=>{const e=N.value;return!e||n(e)||f(e)||Array.isArray(e)?{}:Object.keys(e).reduce(((t,n)=>{const r=(a=e[n],Array.isArray(a)?a.filter(c):B(a).filter((e=>c(a[e]))).map((e=>a[e]))).map((e=>e.__locatorRef)).reduce(((e,t)=>{const n=w(A.values,t)||A.values[t];return void 0!==n&&(e[t]=n),e}),{});var a;return Object.assign(t,r),t}),{})}));return t.watch(Q,((e,t)=>{if(!Object.keys(e).length)return;!V(e,t)&&(M.validated?U():z())})),J}function ae(e,t){return e.props[t]}function ie(e,t){let n=e.as||"";return e.as||t.slots.default||(n="input"),n}function ue(e,t){return v(t.attrs.type)?O(e,"modelValue")?e.modelValue:void 0:O(e,"modelValue")?e.modelValue:t.attrs.value}const oe=t.defineComponent({name:"Field",inheritAttrs:!1,props:{as:{type:[String,Object],default:void 0},name:{type:String,required:!0},rules:{type:[Object,String,Function],default:void 0},validateOnMount:{type:Boolean,default:!1},validateOnBlur:{type:Boolean,default:void 0},validateOnChange:{type:Boolean,default:void 0},validateOnInput:{type:Boolean,default:void 0},validateOnModelUpdate:{type:Boolean,default:void 0},bails:{type:Boolean,default:()=>K().bails},label:{type:String,default:void 0},uncheckedValue:{type:null,default:void 0},modelValue:{type:null,default:s},modelModifiers:{type:null,default:()=>({})},"onUpdate:modelValue":{type:null,default:void 0},standalone:{type:Boolean,default:!1},keepValue:{type:Boolean,default:void 0}},setup(e,n){const r=t.toRef(e,"rules"),a=t.toRef(e,"name"),i=t.toRef(e,"label"),u=t.toRef(e,"uncheckedValue"),o=t.toRef(e,"keepValue"),{errors:l,value:s,errorMessage:d,validate:c,handleChange:f,handleBlur:p,setTouched:m,resetField:y,handleReset:g,meta:b,checked:O,setErrors:V}=ne(a,r,{validateOnMount:e.validateOnMount,bails:e.bails,standalone:e.standalone,type:n.attrs.type,initialValue:ue(e,n),checkedValue:n.attrs.value,uncheckedValue:u,label:i,validateOnValueUpdate:!1,keepValueOnUnmount:o}),F=function(e,t=!0){f(e,t),n.emit("update:modelValue",s.value)},A=function(e){(e=>{v(n.attrs.type)||(s.value=$(e))})(e),n.emit("update:modelValue",s.value)},j=t.computed((()=>{const{validateOnInput:t,validateOnChange:r,validateOnBlur:a,validateOnModelUpdate:i}=function(e){var t,n,r,a;const{validateOnInput:i,validateOnChange:u,validateOnBlur:o,validateOnModelUpdate:l}=K();return{validateOnInput:null!==(t=e.validateOnInput)&&void 0!==t?t:i,validateOnChange:null!==(n=e.validateOnChange)&&void 0!==n?n:u,validateOnBlur:null!==(r=e.validateOnBlur)&&void 0!==r?r:o,validateOnModelUpdate:null!==(a=e.validateOnModelUpdate)&&void 0!==a?a:l}}(e),u=[p,n.attrs.onBlur,a?c:void 0].filter(Boolean),o=[e=>F(e,t),n.attrs.onInput].filter(Boolean),l=[e=>F(e,r),n.attrs.onChange].filter(Boolean),d={name:e.name,onBlur:u,onInput:o,onChange:l,"onUpdate:modelValue":e=>F(e,i)};v(n.attrs.type)&&O&&(d.checked=O.value);return h(ie(e,n),n.attrs)&&(d.value=s.value),d}));function w(){return{field:j.value,value:s.value,meta:b,errors:l.value,errorMessage:d.value,validate:c,resetField:y,handleChange:F,handleInput:A,handleReset:g,handleBlur:p,setTouched:m,setErrors:V}}return n.expose({setErrors:V,setTouched:m,reset:y,validate:c,handleChange:f}),()=>{const r=t.resolveDynamicComponent(ie(e,n)),a=N(r,n,w);return r?t.h(r,Object.assign(Object.assign({},n.attrs),j.value),a):a}}});let le=0;function se(e){var n;const r=le++;let a=!1;const i=t.ref({}),u=t.ref(!1),l=t.ref(0),s=[],d=t.reactive(Y(t.unref(null==e?void 0:e.initialValues)||{})),{errorBag:c,setErrorBag:v,setFieldErrorBag:m}=function(e){const n=t.ref({});function r(e){return Array.isArray(e)?e:e?[e]:[]}function a(e,t){t?n.value[e]=r(t):delete n.value[e]}function i(e){n.value=B(e).reduce(((t,n)=>{const a=e[n];return a&&(t[n]=r(a)),t}),{})}e&&i(e);return{errorBag:n,setErrorBag:i,setFieldErrorBag:a}}(null==e?void 0:e.initialErrors),y=t.computed((()=>B(c.value).reduce(((e,t)=>{const n=c.value[t];return n&&n.length&&(e[t]=n[0]),e}),{})));function h(e){const t=i.value[e];return Array.isArray(t)?t[0]:t}function b(e){return!!i.value[e]}const O=t.computed((()=>B(i.value).reduce(((e,n)=>{const r=h(n);return r&&(e[n]=t.unref(r.label||r.name)||""),e}),{}))),F=t.computed((()=>B(i.value).reduce(((e,t)=>{var n;const r=h(t);return r&&(e[t]=null===(n=r.bails)||void 0===n||n),e}),{}))),A=Object.assign({},(null==e?void 0:e.initialErrors)||{}),j=null!==(n=null==e?void 0:e.keepValuesOnUnmount)&&void 0!==n&&n,{initialValues:S,originalInitialValues:I,setInitialValues:M}=function(e,n,r){const a=t.ref(Y(t.unref(r))||{}),i=t.ref(Y(t.unref(r))||{});function u(t,r=!1){a.value=Y(t),i.value=Y(t),r&&B(e.value).forEach((t=>{const r=e.value[t],i=Array.isArray(r)?r.some((e=>e.meta.touched)):null==r?void 0:r.meta.touched;if(!r||i)return;const u=w(a.value,t);E(n,t,Y(u))}))}t.isRef(r)&&t.watch(r,(e=>{u(e,!0)}),{deep:!0});return{initialValues:a,originalInitialValues:i,setInitialValues:u}}(i,d,null==e?void 0:e.initialValues),T=function(e,n,r,a){const i={touched:"some",pending:"some",valid:"every"},u=t.computed((()=>!V(n,t.unref(r))));function o(){const t=Object.values(e.value).flat(1).filter(Boolean);return B(i).reduce(((e,n)=>{const r=i[n];return e[n]=t[r]((e=>e.meta[n])),e}),{})}const l=t.reactive(o());return t.watchEffect((()=>{const e=o();l.touched=e.touched,l.valid=e.valid,l.pending=e.pending})),t.computed((()=>Object.assign(Object.assign({initialValues:t.unref(r)},l),{valid:l.valid&&!B(a.value).length,dirty:u.value})))}(i,d,I,y),x=null==e?void 0:e.validationSchema,N=R(se,5),_=R(se,5),U=P((async e=>"silent"===await e?N():_()),((e,[t])=>{const n=$.fieldsByPath.value||{},r=B($.errorBag.value);return[...new Set([...B(e.results),...B(n),...r])].reduce(((r,a)=>{const i=n[a],u=(e.results[a]||{errors:[]}).errors,o={errors:u,valid:!u.length};if(r.results[a]=o,o.valid||(r.errors[a]=o.errors[0]),!i)return L(a,u),r;if(z(i,(e=>e.meta.valid=o.valid)),"silent"===t)return r;const l=Array.isArray(i)?i.some((e=>e.meta.validated)):i.meta.validated;return"validated-only"!==t||l?(z(i,(e=>e.setState({errors:o.errors}))),r):r}),{valid:e.valid,results:{},errors:{}})})),$={formId:r,fieldsByPath:i,values:d,errorBag:c,errors:y,schema:x,submitCount:l,meta:T,isSubmitting:u,fieldArrays:s,keepValuesOnUnmount:j,validateSchema:t.unref(x)?U:void 0,validate:ae,register:function(e){const n=t.unref(e.name);ne(e,n),t.isRef(e.name)&&t.watch(e.name,(async(n,r)=>{await t.nextTick(),re(e,r),ne(e,n),(y.value[r]||y.value[n])&&(L(r,void 0),ie(n)),await t.nextTick(),b(r)||k(d,r)}));const r=t.unref(e.errorMessage);r&&(null==A?void 0:A[n])!==r&&ie(n);delete A[n]},unregister:function(e){const n=t.unref(e.name),r=i.value[n],a=!!r&&D(r);re(e,n),t.nextTick((()=>{var u;const o=null!==(u=t.unref(e.keepValueOnUnmount))&&void 0!==u?u:t.unref(j),l=w(d,n);if(a&&(r===i.value[n]||!i.value[n])&&Array.isArray(l)&&!o){const r=l.findIndex((n=>V(n,t.unref(e.checkedValue))));if(r>-1){const e=[...l];e.splice(r,1),G(n,e,{force:!0})}}if(!b(n)){if(L(n,void 0),o)return;if(a&&!p(w(d,n)))return;k(d,n)}}))},setFieldErrorBag:m,validateField:ie,setFieldValue:G,setValues:X,setErrors:K,setFieldError:L,setFieldTouched:W,setTouched:Z,resetForm:ee,handleSubmit:ue,stageInitialValue:function(t,n,r=!1){E(d,t,n),oe(t,n),r&&!(null==e?void 0:e.initialValues)&&E(I.value,t,Y(n))},unsetInitialValue:function(e){k(S.value,e)},setFieldInitialValue:oe,useFieldModel:J};function D(e){return Array.isArray(e)}function z(e,t){return Array.isArray(e)?e.forEach(t):t(e)}function q(e){Object.values(i.value).forEach((t=>{t&&z(t,e)}))}function L(e,t){m(e,t)}function K(e){v(e)}function G(e,n,{force:r}={force:!1}){var u;const o=i.value[e],l=Y(n);if(!o)return void E(d,e,l);if(D(o)&&"checkbox"===(null===(u=o[0])||void 0===u?void 0:u.type)&&!Array.isArray(n)){const t=Y(C(w(d,e)||[],n,void 0));return void E(d,e,t)}let s=n;D(o)||"checkbox"!==o.type||r||a||(s=Y(C(w(d,e),n,t.unref(o.uncheckedValue)))),E(d,e,s)}function X(e){B(d).forEach((e=>{delete d[e]})),B(e).forEach((t=>{G(t,e[t])})),s.forEach((e=>e&&e.reset()))}function H(e){const{value:n}=te(e);return t.watch(n,(()=>{b(t.unref(e))||ae({mode:"validated-only"})}),{deep:!0}),n}function J(e){return Array.isArray(e)?e.map(H):H(e)}function W(e,t){const n=i.value[e];n&&z(n,(e=>e.setTouched(t)))}function Z(e){B(e).forEach((t=>{W(t,!!e[t])}))}function ee(e){a=!0,q((e=>e.resetField())),(null==e?void 0:e.values)?(M(e.values),X(null==e?void 0:e.values)):(M(I.value),X(I.value)),(null==e?void 0:e.touched)&&Z(e.touched),K((null==e?void 0:e.errors)||{}),l.value=(null==e?void 0:e.submitCount)||0,t.nextTick((()=>{a=!1}))}function ne(e,n){const r=t.markRaw(e),a=n;if(!i.value[a])return void(i.value[a]=r);const u=i.value[a];u&&!Array.isArray(u)&&(i.value[a]=[u]),i.value[a]=[...i.value[a],r]}function re(e,t){const n=t,r=i.value[n];if(r)if(D(r)||e.id!==r.id){if(D(r)){const t=r.findIndex((t=>t.id===e.id));if(-1===t)return;r.splice(t,1),r.length||delete i.value[n]}}else delete i.value[n]}async function ae(e){if(q((e=>e.meta.validated=!0)),$.validateSchema)return $.validateSchema((null==e?void 0:e.mode)||"force");const n=await Promise.all(Object.values(i.value).map((n=>{const r=Array.isArray(n)?n[0]:n;return r?r.validate(e).then((e=>({key:t.unref(r.name),valid:e.valid,errors:e.errors}))):Promise.resolve({key:"",valid:!0,errors:[]})}))),r={},a={};for(const e of n)r[e.key]={valid:e.valid,errors:e.errors},e.errors.length&&(a[e.key]=e.errors[0]);return{valid:n.every((e=>e.valid)),results:r,errors:a}}async function ie(e){const n=i.value[e];return n?Array.isArray(n)?n.map((e=>e.validate()))[0]:n.validate():(t.warn(`field with name ${e} was not found`),Promise.resolve({errors:[],valid:!0}))}function ue(e,t){return function(n){return n instanceof Event&&(n.preventDefault(),n.stopPropagation()),Z(B(i.value).reduce(((e,t)=>(e[t]=!0,e)),{})),u.value=!0,l.value++,ae().then((r=>{if(r.valid&&"function"==typeof e)return e(Y(d),{evt:n,setErrors:K,setFieldError:L,setTouched:Z,setFieldTouched:W,setValues:X,setFieldValue:G,resetForm:ee});r.valid||"function"!=typeof t||t({values:Y(d),evt:n,errors:r.errors,results:r.results})})).then((e=>(u.value=!1,e)),(e=>{throw u.value=!1,e}))}}function oe(e,t){E(S.value,e,Y(t))}async function se(){const e=t.unref(x);if(!e)return{valid:!0,results:{},errors:{}};const n=f(e)?await async function(e,t){const n=await e.validate(t,{abortEarly:!1}).then((()=>[])).catch((e=>{if("ValidationError"!==e.name)throw e;return e.inner||[]})),r={},a={};for(const e of n){const t=e.errors;r[e.path]={valid:!t.length,errors:t},t.length&&(a[e.path]=t[0])}return{valid:!n.length,results:r,errors:a}}(e,d):await Q(e,d,{names:O.value,bailsMap:F.value});return n}const de=ue(((e,{evt:t})=>{g(t)&&t.target.submit()}));return t.onMounted((()=>{(null==e?void 0:e.initialErrors)&&K(e.initialErrors),(null==e?void 0:e.initialTouched)&&Z(e.initialTouched),(null==e?void 0:e.validateOnMount)?ae():$.validateSchema&&$.validateSchema("silent")})),t.isRef(x)&&t.watch(x,(()=>{var e;null===(e=$.validateSchema)||void 0===e||e.call($,"validated-only")})),t.provide(o,$),{errors:y,meta:T,values:d,isSubmitting:u,submitCount:l,validate:ae,validateField:ie,handleReset:()=>ee(),resetForm:ee,handleSubmit:ue,submitForm:de,setFieldError:L,setErrors:K,setFieldValue:G,setValues:X,setFieldTouched:W,setTouched:Z,useFieldModel:J}}const de=t.defineComponent({name:"Form",inheritAttrs:!1,props:{as:{type:String,default:"form"},validationSchema:{type:Object,default:void 0},initialValues:{type:Object,default:void 0},initialErrors:{type:Object,default:void 0},initialTouched:{type:Object,default:void 0},validateOnMount:{type:Boolean,default:!1},onSubmit:{type:Function,default:void 0},onInvalidSubmit:{type:Function,default:void 0},keepValues:{type:Boolean,default:!1}},setup(e,n){const r=t.toRef(e,"initialValues"),a=t.toRef(e,"validationSchema"),i=t.toRef(e,"keepValues"),{errors:u,values:o,meta:l,isSubmitting:s,submitCount:d,validate:c,validateField:f,handleReset:v,resetForm:p,handleSubmit:m,setErrors:y,setFieldError:h,setFieldValue:O,setValues:V,setFieldTouched:F,setTouched:A}=se({validationSchema:a.value?a:void 0,initialValues:r,initialErrors:e.initialErrors,initialTouched:e.initialTouched,validateOnMount:e.validateOnMount,keepValuesOnUnmount:i}),j=m(((e,{evt:t})=>{g(t)&&t.target.submit()}),e.onInvalidSubmit),w=e.onSubmit?m(e.onSubmit,e.onInvalidSubmit):j;function E(e){b(e)&&e.preventDefault(),v(),"function"==typeof n.attrs.onReset&&n.attrs.onReset()}function S(t,n){return m("function"!=typeof t||n?n:t,e.onInvalidSubmit)(t)}function k(){return{meta:l.value,errors:u.value,values:o,isSubmitting:s.value,submitCount:d.value,validate:c,validateField:f,handleSubmit:S,handleReset:v,submitForm:j,setErrors:y,setFieldError:h,setFieldValue:O,setValues:V,setFieldTouched:F,setTouched:A,resetForm:p}}return n.expose({setFieldError:h,setErrors:y,setFieldValue:O,setValues:V,setFieldTouched:F,setTouched:A,resetForm:p,validate:c,validateField:f}),function(){const r="form"===e.as?e.as:t.resolveDynamicComponent(e.as),a=N(r,n,k);if(!e.as)return a;const i="form"===e.as?{novalidate:!0}:{};return t.h(r,Object.assign(Object.assign(Object.assign({},i),n.attrs),{onSubmit:w,onReset:E}),a)}}}),ce=de;function fe(e){const n=I(o,void 0),a=t.ref([]),i=()=>{},u={fields:a,remove:i,push:i,swap:i,insert:i,update:i,replace:i,prepend:i,move:i};if(!n)return M("FieldArray requires being a child of `<Form/>` or `useForm` being called before it. Array fields may not work correctly"),u;if(!t.unref(e))return M("FieldArray requires a field path to be provided, did you forget to pass the `name` prop?"),u;const l=n.fieldArrays.find((n=>t.unref(n.path)===t.unref(e)));if(l)return l;let s=0;function d(){const r=w(null==n?void 0:n.values,t.unref(e),[])||[];a.value=r.map(f),c()}function c(){const e=a.value.length;for(let t=0;t<e;t++){const n=a.value[t];n.isFirst=0===t,n.isLast=t===e-1}}function f(r){const i=s++,u={key:i,value:t.computed({get(){const u=w(null==n?void 0:n.values,t.unref(e),[])||[],o=a.value.findIndex((e=>e.key===i));return-1===o?r:u[o]},set(e){const t=a.value.findIndex((e=>e.key===i));-1!==t?v(t,e):M("Attempting to update a non-existent array item")}}),isFirst:!1,isLast:!1};return u}function v(r,a){const i=t.unref(e),u=w(null==n?void 0:n.values,i);!Array.isArray(u)||u.length-1<r||null==n||n.setFieldValue(`${i}[${r}]`,a)}d();const p={fields:a,remove:function(r){const i=t.unref(e),u=w(null==n?void 0:n.values,i);if(!u||!Array.isArray(u))return;const o=[...u];o.splice(r,1),null==n||n.unsetInitialValue(i+`[${r}]`),null==n||n.setFieldValue(i,o),a.value.splice(r,1),c()},push:function(i){const u=t.unref(e),o=w(null==n?void 0:n.values,u),l=r(o)?[]:o;if(!Array.isArray(l))return;const s=[...l];s.push(i),null==n||n.stageInitialValue(u+`[${s.length-1}]`,i),null==n||n.setFieldValue(u,s),a.value.push(f(i)),c()},swap:function(r,i){const u=t.unref(e),o=w(null==n?void 0:n.values,u);if(!Array.isArray(o)||!(r in o)||!(i in o))return;const l=[...o],s=[...a.value],d=l[r];l[r]=l[i],l[i]=d;const f=s[r];s[r]=s[i],s[i]=f,null==n||n.setFieldValue(u,l),a.value=s,c()},insert:function(r,i){const u=t.unref(e),o=w(null==n?void 0:n.values,u);if(!Array.isArray(o)||o.length<r)return;const l=[...o],s=[...a.value];l.splice(r,0,i),s.splice(r,0,f(i)),null==n||n.setFieldValue(u,l),a.value=s,c()},update:v,replace:function(r){const a=t.unref(e);null==n||n.setFieldValue(a,r),d()},prepend:function(i){const u=t.unref(e),o=w(null==n?void 0:n.values,u),l=r(o)?[]:o;if(!Array.isArray(l))return;const s=[i,...l];null==n||n.stageInitialValue(u+`[${s.length-1}]`,i),null==n||n.setFieldValue(u,s),a.value.unshift(f(i)),c()},move:function(i,u){const o=t.unref(e),l=w(null==n?void 0:n.values,o),s=r(l)?[]:[...l];if(!Array.isArray(l)||!(i in l)||!(u in l))return;const d=[...a.value],f=d[i];d.splice(i,1),d.splice(u,0,f);const v=s[i];s.splice(i,1),s.splice(u,0,v),null==n||n.setFieldValue(o,s),a.value=d,c()}};return n.fieldArrays.push(Object.assign({path:e,reset:d},p)),t.onBeforeUnmount((()=>{const r=n.fieldArrays.findIndex((n=>t.unref(n.path)===t.unref(e)));r>=0&&n.fieldArrays.splice(r,1)})),p}const ve=t.defineComponent({name:"FieldArray",inheritAttrs:!1,props:{name:{type:String,required:!0}},setup(e,n){const{push:r,remove:a,swap:i,insert:u,replace:o,update:l,prepend:s,move:d,fields:c}=fe(t.toRef(e,"name"));function f(){return{fields:c.value,push:r,remove:a,swap:i,insert:u,update:l,replace:o,prepend:s,move:d}}return n.expose({push:r,remove:a,swap:i,insert:u,update:l,replace:o,prepend:s,move:d}),()=>N(void 0,n,f)}}),pe=t.defineComponent({name:"ErrorMessage",props:{as:{type:String,default:void 0},name:{type:String,required:!0}},setup(e,n){const r=t.inject(o,void 0),a=t.computed((()=>null==r?void 0:r.errors.value[e.name]));function i(){return{message:a.value}}return()=>{if(!a.value)return;const r=e.as?t.resolveDynamicComponent(e.as):e.as,u=N(r,n,i),o=Object.assign({role:"alert"},n.attrs);return r||!Array.isArray(u)&&u||!(null==u?void 0:u.length)?!Array.isArray(u)&&u||(null==u?void 0:u.length)?t.h(r,o,u):t.h(r||"span",o,a.value):u}}});e.ErrorMessage=pe,e.Field=oe,e.FieldArray=ve,e.FieldContextKey=l,e.Form=ce,e.FormContextKey=o,e.IS_ABSENT=s,e.configure=G,e.defineRule=function(e,t){!function(e,t){if(n(t))return;throw new Error(`Extension Error: The validator '${e}' must be a function.`)}(e,t),u[e]=t},e.useField=ne,e.useFieldArray=fe,e.useFieldError=function(e){const n=I(o),r=e?void 0:t.inject(l);return t.computed((()=>e?null==n?void 0:n.errors.value[t.unref(e)]:null==r?void 0:r.errorMessage.value))},e.useFieldValue=function(e){const n=I(o),r=e?void 0:t.inject(l);return t.computed((()=>e?w(null==n?void 0:n.values,t.unref(e)):t.unref(null==r?void 0:r.value)))},e.useForm=se,e.useFormErrors=function(){const e=I(o);return e||M("No vee-validate <Form /> or `useForm` was detected in the component tree"),t.computed((()=>(null==e?void 0:e.errors.value)||{}))},e.useFormValues=function(){const e=I(o);return e||M("No vee-validate <Form /> or `useForm` was detected in the component tree"),t.computed((()=>(null==e?void 0:e.values)||{}))},e.useIsFieldDirty=function(e){const n=I(o);let r=e?void 0:t.inject(l);return t.computed((()=>(e&&(r=T(null==n?void 0:n.fieldsByPath.value[t.unref(e)])),r?r.meta.dirty:(M(`field with name ${t.unref(e)} was not found`),!1))))},e.useIsFieldTouched=function(e){const n=I(o);let r=e?void 0:t.inject(l);return t.computed((()=>(e&&(r=T(null==n?void 0:n.fieldsByPath.value[t.unref(e)])),r?r.meta.touched:(M(`field with name ${t.unref(e)} was not found`),!1))))},e.useIsFieldValid=function(e){const n=I(o);let r=e?void 0:t.inject(l);return t.computed((()=>(e&&(r=T(null==n?void 0:n.fieldsByPath.value[t.unref(e)])),r?r.meta.valid:(M(`field with name ${t.unref(e)} was not found`),!1))))},e.useIsFormDirty=function(){const e=I(o);return e||M("No vee-validate <Form /> or `useForm` was detected in the component tree"),t.computed((()=>{var t;return null!==(t=null==e?void 0:e.meta.value.dirty)&&void 0!==t&&t}))},e.useIsFormTouched=function(){const e=I(o);return e||M("No vee-validate <Form /> or `useForm` was detected in the component tree"),t.computed((()=>{var t;return null!==(t=null==e?void 0:e.meta.value.touched)&&void 0!==t&&t}))},e.useIsFormValid=function(){const e=I(o);return e||M("No vee-validate <Form /> or `useForm` was detected in the component tree"),t.computed((()=>{var t;return null!==(t=null==e?void 0:e.meta.value.valid)&&void 0!==t&&t}))},e.useIsSubmitting=function(){const e=I(o);return e||M("No vee-validate <Form /> or `useForm` was detected in the component tree"),t.computed((()=>{var t;return null!==(t=null==e?void 0:e.isSubmitting.value)&&void 0!==t&&t}))},e.useResetForm=function(){const e=I(o);return e||M("No vee-validate <Form /> or `useForm` was detected in the component tree"),function(t){if(e)return e.resetForm(t)}},e.useSubmitCount=function(){const e=I(o);return e||M("No vee-validate <Form /> or `useForm` was detected in the component tree"),t.computed((()=>{var t;return null!==(t=null==e?void 0:e.submitCount.value)&&void 0!==t?t:0}))},e.useSubmitForm=function(e){const t=I(o);t||M("No vee-validate <Form /> or `useForm` was detected in the component tree");const n=t?t.handleSubmit(e):void 0;return function(e){if(n)return n(e)}},e.useValidateField=function(e){const n=I(o);let r=e?void 0:t.inject(l);return function(){return e&&(r=T(null==n?void 0:n.fieldsByPath.value[t.unref(e)])),r?r.validate():(M(`field with name ${t.unref(e)} was not found`),Promise.resolve({errors:[],valid:!0}))}},e.useValidateForm=function(){const e=I(o);return e||M("No vee-validate <Form /> or `useForm` was detected in the component tree"),function(){return e?e.validate():Promise.resolve({results:{},errors:{},valid:!0})}},e.validate=X,Object.defineProperty(e,"__esModule",{value:!0})}));
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vue")):"function"==typeof define&&define.amd?define(["exports","vue"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).VeeValidate={},e.Vue)}(this,(function(e,t){"use strict";function n(e){return"function"==typeof e}function r(e){return null==e}const a=e=>null!==e&&!!e&&"object"==typeof e&&!Array.isArray(e);function u(e){return Number(e)>=0}const i={};const o=Symbol("vee-validate-form"),l=Symbol("vee-validate-field-instance"),s=Symbol("Default empty value"),c="undefined"!=typeof window;function d(e){return n(e)&&!!e.__locatorRef}function f(e){return!!e&&n(e.validate)}function v(e){return"checkbox"===e||"radio"===e}function p(e){return Array.isArray(e)?0===e.length:a(e)&&0===Object.keys(e).length}function m(e){return/^\[.+\]$/i.test(e)}function y(e){return"SELECT"===e.tagName}function h(e,t){return!function(e,t){const n=![!1,null,void 0,0].includes(t.multiple)&&!Number.isNaN(t.multiple);return"select"===e&&"multiple"in t&&n}(e,t)&&"file"!==t.type&&!v(t.type)}function g(e){return b(e)&&e.target&&"submit"in e.target}function b(e){return!!e&&(!!("undefined"!=typeof Event&&n(Event)&&e instanceof Event)||!(!e||!e.srcElement))}function O(e,t){return t in e&&e[t]!==s}function V(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){if(e.constructor!==t.constructor)return!1;var n,r,a;if(Array.isArray(e)){if((n=e.length)!=t.length)return!1;for(r=n;0!=r--;)if(!V(e[r],t[r]))return!1;return!0}if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(r of e.entries())if(!t.has(r[0]))return!1;for(r of e.entries())if(!V(r[1],t.get(r[0])))return!1;return!0}if(A(e)&&A(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(r of e.entries())if(!t.has(r[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if((n=e.length)!=t.length)return!1;for(r=n;0!=r--;)if(e[r]!==t[r])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((n=(a=Object.keys(e)).length)!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!Object.prototype.hasOwnProperty.call(t,a[r]))return!1;for(r=n;0!=r--;){var u=a[r];if(!V(e[u],t[u]))return!1}return!0}return e!=e&&t!=t}function A(e){return!!c&&e instanceof File}var F=function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;var r,a,u;if(Array.isArray(t)){if((r=t.length)!=n.length)return!1;for(a=r;0!=a--;)if(!e(t[a],n[a]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((r=(u=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(a=r;0!=a--;)if(!Object.prototype.hasOwnProperty.call(n,u[a]))return!1;for(a=r;0!=a--;){var i=u[a];if(!e(t[i],n[i]))return!1}return!0}return t!=t&&n!=n};function j(e){return m(e)?e.replace(/\[|\]/gi,""):e}function w(e,t,n){if(!e)return n;if(m(t))return e[j(t)];return(t||"").split(/\.|\[(\d+)\]/).filter(Boolean).reduce(((e,t)=>{return(a(r=e)||Array.isArray(r))&&t in e?e[t]:n;var r}),e)}function E(e,t,n){if(m(t))return void(e[j(t)]=n);const a=t.split(/\.|\[(\d+)\]/).filter(Boolean);let i=e;for(let e=0;e<a.length;e++){if(e===a.length-1)return void(i[a[e]]=n);a[e]in i&&!r(i[a[e]])||(i[a[e]]=u(a[e+1])?[]:{}),i=i[a[e]]}}function S(e,t){Array.isArray(e)&&u(t)?e.splice(Number(t),1):a(e)&&delete e[t]}function k(e,t){if(m(t))return void delete e[j(t)];const n=t.split(/\.|\[(\d+)\]/).filter(Boolean);let a=e;for(let e=0;e<n.length;e++){if(e===n.length-1){S(a,n[e]);break}if(!(n[e]in a)||r(a[n[e]]))break;a=a[n[e]]}const u=n.map(((t,r)=>w(e,n.slice(0,r).join("."))));for(let t=u.length-1;t>=0;t--)p(u[t])&&(0!==t?S(u[t-1],n[t-1]):S(e,n[0]))}function B(e){return Object.keys(e)}function I(e,n){const r=t.getCurrentInstance();return(null==r?void 0:r.provides[e])||t.inject(e,n)}function M(e){t.warn(`[vee-validate]: ${e}`)}function C(e){return Array.isArray(e)?e[0]:e}function T(e,t,n){if(Array.isArray(e)){const n=[...e],r=n.findIndex((e=>F(e,t)));return r>=0?n.splice(r,1):n.push(t),n}return F(e,t)?n:t}function R(e,t=0){let n=null,r=[];return function(...a){return n&&window.clearTimeout(n),n=window.setTimeout((()=>{const t=e(...a);r.forEach((e=>e(t))),r=[]}),t),new Promise((e=>r.push(e)))}}function x(e,t){return a(t)&&t.number?function(e){const t=parseFloat(e);return isNaN(t)?e:t}(e):e}function P(e,t){let n;return async function(...r){const a=e(...r);n=a;const u=await a;return a!==n||(n=void 0,t(u,r)),u}}const N=(e,t,n)=>t.slots.default?"string"!=typeof e&&e?{default:()=>{var e,r;return null===(r=(e=t.slots).default)||void 0===r?void 0:r.call(e,n())}}:t.slots.default(n()):t.slots.default;function _(e){if(U(e))return e._value}function U(e){return"_value"in e}function $(e){if(!b(e))return e;const t=e.target;if(v(t.type)&&U(t))return _(t);if("file"===t.type&&t.files){const e=Array.from(t.files);return t.multiple?e:e[0]}if(y(n=t)&&n.multiple)return Array.from(t.options).filter((e=>e.selected&&!e.disabled)).map(_);var n;if(y(t)){const e=Array.from(t.options).find((e=>e.selected));return e?_(e):t.value}return t.value}function D(e){const t={};return Object.defineProperty(t,"_$$isNormalized",{value:!0,writable:!1,enumerable:!1,configurable:!1}),e?a(e)&&e._$$isNormalized?e:a(e)?Object.keys(e).reduce(((t,n)=>{const r=function(e){if(!0===e)return[];if(Array.isArray(e))return e;if(a(e))return e;return[e]}(e[n]);return!1!==e[n]&&(t[n]=z(r)),t}),t):"string"!=typeof e?t:e.split("|").reduce(((e,t)=>{const n=q(t);return n.name?(e[n.name]=z(n.params),e):e}),t):t}function z(e){const t=e=>"string"==typeof e&&"@"===e[0]?function(e){const t=t=>w(t,e)||t[e];return t.__locatorRef=e,t}(e.slice(1)):e;return Array.isArray(e)?e.map(t):e instanceof RegExp?[e]:Object.keys(e).reduce(((n,r)=>(n[r]=t(e[r]),n)),{})}const q=e=>{let t=[];const n=e.split(":")[0];return e.includes(":")&&(t=e.split(":").slice(1).join(":").split(",")),{name:n,params:t}};let L=Object.assign({},{generateMessage:({field:e})=>`${e} is not valid.`,bails:!0,validateOnBlur:!0,validateOnChange:!0,validateOnInput:!1,validateOnModelUpdate:!0});const K=()=>L,G=e=>{L=Object.assign(Object.assign({},L),e)};async function X(e,t,r={}){const a=null==r?void 0:r.bails,u={name:(null==r?void 0:r.name)||"{field}",rules:t,bails:null==a||a,formData:(null==r?void 0:r.values)||{}},i=await async function(e,t){if(f(e.rules))return async function(e,t,n){var r;return{errors:await t.validate(e,{abortEarly:null===(r=n.bails)||void 0===r||r}).then((()=>[])).catch((e=>{if("ValidationError"===e.name)return e.errors;throw e}))}}(t,e.rules,{bails:e.bails});if(n(e.rules)||Array.isArray(e.rules)){const n={field:e.name,form:e.formData,value:t},r=Array.isArray(e.rules)?e.rules:[e.rules],a=r.length,u=[];for(let i=0;i<a;i++){const a=r[i],o=await a(t,n);if("string"!=typeof o&&o)continue;const l="string"==typeof o?o:J(n);if(u.push(l),e.bails)return{errors:u}}return{errors:u}}const r=Object.assign(Object.assign({},e),{rules:D(e.rules)}),a=[],u=Object.keys(r.rules),i=u.length;for(let n=0;n<i;n++){const i=u[n],o=await H(r,t,{name:i,params:r.rules[i]});if(o.error&&(a.push(o.error),e.bails))return{errors:a}}return{errors:a}}(u,e),o=i.errors;return{errors:o,valid:!o.length}}async function H(e,t,n){const r=(a=n.name,i[a]);var a;if(!r)throw new Error(`No such validator '${n.name}' exists.`);const u=function(e,t){const n=e=>d(e)?e(t):e;if(Array.isArray(e))return e.map(n);return Object.keys(e).reduce(((t,r)=>(t[r]=n(e[r]),t)),{})}(n.params,e.formData),o={field:e.name,value:t,form:e.formData,rule:Object.assign(Object.assign({},n),{params:u})},l=await r(t,u,o);return"string"==typeof l?{error:l}:{error:l?void 0:J(o)}}function J(e){const t=K().generateMessage;return t?t(e):"Field is invalid"}async function Q(e,t,n){const r=B(e).map((async r=>{var a,u,i;const o=await X(w(t,r),e[r],{name:(null===(a=null==n?void 0:n.names)||void 0===a?void 0:a[r])||r,values:t,bails:null===(i=null===(u=null==n?void 0:n.bailsMap)||void 0===u?void 0:u[r])||void 0===i||i});return Object.assign(Object.assign({},o),{path:r})}));let a=!0;const u=await Promise.all(r),i={},o={};for(const e of u)i[e.path]={valid:e.valid,errors:e.errors},e.valid||(a=!1,o[e.path]=e.errors[0]);return{valid:a,results:i,errors:o}}function W(e,t,n){"object"==typeof n.value&&(n.value=Y(n.value)),n.enumerable&&!n.get&&!n.set&&n.configurable&&n.writable&&"__proto__"!==t?e[t]=n.value:Object.defineProperty(e,t,n)}function Y(e){if("object"!=typeof e)return e;var t,n,r,a=0,u=Object.prototype.toString.call(e);if("[object Object]"===u?r=Object.create(e.__proto__||null):"[object Array]"===u?r=Array(e.length):"[object Set]"===u?(r=new Set,e.forEach((function(e){r.add(Y(e))}))):"[object Map]"===u?(r=new Map,e.forEach((function(e,t){r.set(Y(t),Y(e))}))):"[object Date]"===u?r=new Date(+e):"[object RegExp]"===u?r=new RegExp(e.source,e.flags):"[object DataView]"===u?r=new e.constructor(Y(e.buffer)):"[object ArrayBuffer]"===u?r=e.slice(0):"Array]"===u.slice(-6)&&(r=new e.constructor(e)),r){for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)W(r,n[a],Object.getOwnPropertyDescriptor(e,n[a]));for(a=0,n=Object.getOwnPropertyNames(e);a<n.length;a++)Object.hasOwnProperty.call(r,t=n[a])&&r[t]===e[t]||W(r,t,Object.getOwnPropertyDescriptor(e,t))}return r||e}let Z=0;function ee(e,n){const{value:r,initialValue:a,setInitialValue:u}=te(e,n.modelValue,n.form),{errorMessage:i,errors:o,setErrors:l}=function(e,n){function r(e){return e?Array.isArray(e)?e:[e]:[]}if(!n){const e=t.ref([]);return{errors:e,errorMessage:t.computed((()=>e.value[0])),setErrors:t=>{e.value=r(t)}}}const a=t.computed((()=>n.errorBag.value[t.unref(e)]||[]));return{errors:a,errorMessage:t.computed((()=>a.value[0])),setErrors:a=>{n.setFieldErrorBag(t.unref(e),r(a))}}}(e,n.form),s=function(e,n,r){const a=t.reactive({touched:!1,pending:!1,valid:!0,validated:!!t.unref(r).length,initialValue:t.computed((()=>t.unref(n))),dirty:t.computed((()=>!V(t.unref(e),t.unref(n))))});return t.watch(r,(e=>{a.valid=!e.length}),{immediate:!0,flush:"sync"}),a}(r,a,o);return{id:Z>=Number.MAX_SAFE_INTEGER?0:++Z,path:e,value:r,initialValue:a,meta:s,errors:o,errorMessage:i,setState:function(e){var t;"value"in e&&(r.value=e.value),"errors"in e&&l(e.errors),"touched"in e&&(s.touched=null!==(t=e.touched)&&void 0!==t?t:s.touched),"initialValue"in e&&u(e.initialValue)}}}function te(e,n,r){const a=t.ref(t.unref(n));function u(){return r?w(r.meta.value.initialValues,t.unref(e),t.unref(a)):t.unref(a)}function i(n){r?r.stageInitialValue(t.unref(e),n,!0):a.value=n}const o=t.computed(u);if(!r){return{value:t.ref(u()),initialValue:o,setInitialValue:i}}const l=n?t.unref(n):w(r.values,t.unref(e),t.unref(o));r.stageInitialValue(t.unref(e),l,!0);return{value:t.computed({get:()=>w(r.values,t.unref(e)),set(n){r.setFieldValue(t.unref(e),n)}}),initialValue:o,setInitialValue:i}}function ne(e,n,r){return v(null==r?void 0:r.type)?function(e,n,r){const a=(null==r?void 0:r.standalone)?void 0:I(o),u=null==r?void 0:r.checkedValue,i=null==r?void 0:r.uncheckedValue;function l(e){const n=e.handleChange,r=t.computed((()=>{const n=t.unref(e.value),r=t.unref(u);return Array.isArray(n)?n.findIndex((e=>V(e,r)))>=0:V(r,n)}));function o(o,l=!0){var s;if(r.value===(null===(s=null==o?void 0:o.target)||void 0===s?void 0:s.checked))return void(l&&e.validate());let c=$(o);a||(c=T(t.unref(e.value),t.unref(u),t.unref(i))),n(c,l)}return Object.assign(Object.assign({},e),{checked:r,checkedValue:u,uncheckedValue:i,handleChange:o})}return l(re(e,n,r))}(e,n,r):re(e,n,r)}function re(e,r,a){const{initialValue:u,validateOnMount:i,bails:c,type:v,checkedValue:p,label:m,validateOnValueUpdate:y,uncheckedValue:h,controlled:g,keepValueOnUnmount:b,modelPropName:O,syncVModel:A,form:F}=function(e,t){const n=()=>({initialValue:void 0,validateOnMount:!1,bails:!0,label:e,validateOnValueUpdate:!0,keepValueOnUnmount:void 0,modelPropName:"modelValue",syncVModel:!0,controlled:!0});if(!t)return n();const r="valueProp"in t?t.valueProp:t.checkedValue,a="standalone"in t?!t.standalone:t.controlled;return Object.assign(Object.assign(Object.assign({},n()),t||{}),{controlled:null==a||a,checkedValue:r})}(t.unref(e),a),j=g?I(o):void 0,E=F||j;let S=!1;const{id:k,value:M,initialValue:C,meta:T,setState:R,errors:N,errorMessage:_}=ee(e,{modelValue:u,form:E});A&&function({prop:e,value:n,handleChange:r}){const a=t.getCurrentInstance();if(!a)return;const u=e||"modelValue",i=`update:${u}`;if(!(u in a.props))return;t.watch(n,(e=>{V(e,ae(a,u))||a.emit(i,e)})),t.watch((()=>ae(a,u)),(e=>{if(e===s&&void 0===n.value)return;const t=e===s?void 0:e;V(t,x(n.value,a.props.modelModifiers))||r(t)}))}({value:M,prop:O,handleChange:K});const U=t.computed((()=>{let a=t.unref(r);const u=t.unref(null==E?void 0:E.schema);return u&&!f(u)&&(a=function(e,t){if(!e)return;return e[t]}(u,t.unref(e))||a),f(a)||n(a)||Array.isArray(a)?a:D(a)}));async function z(n){var r,a;return(null==E?void 0:E.validateSchema)?null!==(r=(await E.validateSchema(n)).results[t.unref(e)])&&void 0!==r?r:{valid:!0,errors:[]}:X(M.value,U.value,{name:t.unref(m)||t.unref(e),values:null!==(a=null==E?void 0:E.values)&&void 0!==a?a:{},bails:c})}const q=P((async()=>(T.pending=!0,T.validated=!0,z("validated-only"))),(e=>(S&&(e.valid=!0,e.errors=[]),R({errors:e.errors}),T.pending=!1,e))),L=P((async()=>z("silent")),(e=>(S&&(e.valid=!0),T.valid=e.valid,e)));function K(e,t=!0){const n=$(e);M.value=n,!y&&t&&q()}let G;t.onMounted((()=>{if(i)return q();E&&E.validateSchema||L()}));let H=Y(M.value);function J(){G=t.watch(M,((e,t)=>{if(V(e,t)&&V(e,H))return;(y?q:L)(),H=Y(e)}),{deep:!0})}function Q(e){var n;null==G||G();const r=e&&"value"in e?e.value:C.value;R({value:Y(r),initialValue:Y(r),touched:null!==(n=null==e?void 0:e.touched)&&void 0!==n&&n,errors:(null==e?void 0:e.errors)||[]}),T.pending=!1,T.validated=!1,L(),t.nextTick((()=>{J()}))}J();const W={id:k,name:e,label:m,value:M,meta:T,errors:N,errorMessage:_,type:v,checkedValue:p,uncheckedValue:h,bails:c,keepValueOnUnmount:b,resetField:Q,handleReset:()=>Q(),validate:function(e){return"silent"===(null==e?void 0:e.mode)?L():q()},handleChange:K,handleBlur:()=>{T.touched=!0},setState:R,setTouched:function(e){T.touched=e},setErrors:function(e){R({errors:Array.isArray(e)?e:[e]})},setValue:function(e){M.value=e}};if(t.provide(l,W),t.isRef(r)&&"function"!=typeof t.unref(r)&&t.watch(r,((e,t)=>{V(e,t)||(T.validated?q():L())}),{deep:!0}),!E)return W;E.register(W),t.onBeforeUnmount((()=>{S=!0,E.unregister(W)}));const Z=t.computed((()=>{const e=U.value;return!e||n(e)||f(e)||Array.isArray(e)?{}:Object.keys(e).reduce(((t,n)=>{const r=(a=e[n],Array.isArray(a)?a.filter(d):B(a).filter((e=>d(a[e]))).map((e=>a[e]))).map((e=>e.__locatorRef)).reduce(((e,t)=>{const n=w(E.values,t)||E.values[t];return void 0!==n&&(e[t]=n),e}),{});var a;return Object.assign(t,r),t}),{})}));return t.watch(Z,((e,t)=>{if(!Object.keys(e).length)return;!V(e,t)&&(T.validated?q():L())})),W}function ae(e,t){return e.props[t]}function ue(e,t){let n=e.as||"";return e.as||t.slots.default||(n="input"),n}function ie(e,t){return v(t.attrs.type)?O(e,"modelValue")?e.modelValue:void 0:O(e,"modelValue")?e.modelValue:t.attrs.value}const oe=t.defineComponent({name:"Field",inheritAttrs:!1,props:{as:{type:[String,Object],default:void 0},name:{type:String,required:!0},rules:{type:[Object,String,Function],default:void 0},validateOnMount:{type:Boolean,default:!1},validateOnBlur:{type:Boolean,default:void 0},validateOnChange:{type:Boolean,default:void 0},validateOnInput:{type:Boolean,default:void 0},validateOnModelUpdate:{type:Boolean,default:void 0},bails:{type:Boolean,default:()=>K().bails},label:{type:String,default:void 0},uncheckedValue:{type:null,default:void 0},modelValue:{type:null,default:s},modelModifiers:{type:null,default:()=>({})},"onUpdate:modelValue":{type:null,default:void 0},standalone:{type:Boolean,default:!1},keepValue:{type:Boolean,default:void 0}},setup(e,n){const r=t.toRef(e,"rules"),a=t.toRef(e,"name"),u=t.toRef(e,"label"),i=t.toRef(e,"uncheckedValue"),o=t.toRef(e,"keepValue"),{errors:l,value:s,errorMessage:c,validate:d,handleChange:f,handleBlur:p,setTouched:m,resetField:y,handleReset:g,meta:b,checked:O,setErrors:V}=ne(a,r,{validateOnMount:e.validateOnMount,bails:e.bails,standalone:e.standalone,type:n.attrs.type,initialValue:ie(e,n),checkedValue:n.attrs.value,uncheckedValue:i,label:u,validateOnValueUpdate:!1,keepValueOnUnmount:o}),A=function(e,t=!0){f(e,t),n.emit("update:modelValue",s.value)},F=function(e){(e=>{v(n.attrs.type)||(s.value=$(e))})(e),n.emit("update:modelValue",s.value)},j=t.computed((()=>{const{validateOnInput:t,validateOnChange:r,validateOnBlur:a,validateOnModelUpdate:u}=function(e){var t,n,r,a;const{validateOnInput:u,validateOnChange:i,validateOnBlur:o,validateOnModelUpdate:l}=K();return{validateOnInput:null!==(t=e.validateOnInput)&&void 0!==t?t:u,validateOnChange:null!==(n=e.validateOnChange)&&void 0!==n?n:i,validateOnBlur:null!==(r=e.validateOnBlur)&&void 0!==r?r:o,validateOnModelUpdate:null!==(a=e.validateOnModelUpdate)&&void 0!==a?a:l}}(e),i=[p,n.attrs.onBlur,a?d:void 0].filter(Boolean),o=[e=>A(e,t),n.attrs.onInput].filter(Boolean),l=[e=>A(e,r),n.attrs.onChange].filter(Boolean),c={name:e.name,onBlur:i,onInput:o,onChange:l,"onUpdate:modelValue":e=>A(e,u)};v(n.attrs.type)&&O&&(c.checked=O.value);return h(ue(e,n),n.attrs)&&(c.value=s.value),c}));function w(){return{field:j.value,value:s.value,meta:b,errors:l.value,errorMessage:c.value,validate:d,resetField:y,handleChange:A,handleInput:F,handleReset:g,handleBlur:p,setTouched:m,setErrors:V}}return n.expose({setErrors:V,setTouched:m,reset:y,validate:d,handleChange:f}),()=>{const r=t.resolveDynamicComponent(ue(e,n)),a=N(r,n,w);return r?t.h(r,Object.assign(Object.assign({},n.attrs),j.value),a):a}}});let le=0;function se(e){var n;const r=le++,a=new Set;let u=!1;const i=t.ref({}),l=t.ref(!1),s=t.ref(0),c=[],d=t.reactive(Y(t.unref(null==e?void 0:e.initialValues)||{})),{errorBag:v,setErrorBag:m,setFieldErrorBag:y}=function(e){const n=t.ref({});function r(e){return Array.isArray(e)?e:e?[e]:[]}function a(e,t){t?n.value[e]=r(t):delete n.value[e]}function u(e){n.value=B(e).reduce(((t,n)=>{const a=e[n];return a&&(t[n]=r(a)),t}),{})}e&&u(e);return{errorBag:n,setErrorBag:u,setFieldErrorBag:a}}(null==e?void 0:e.initialErrors),h=t.computed((()=>B(v.value).reduce(((e,t)=>{const n=v.value[t];return n&&n.length&&(e[t]=n[0]),e}),{})));function b(e){const t=i.value[e];return Array.isArray(t)?t[0]:t}function O(e){return!!i.value[e]}const A=t.computed((()=>B(i.value).reduce(((e,n)=>{const r=b(n);return r&&(e[n]=t.unref(r.label||r.name)||""),e}),{}))),F=t.computed((()=>B(i.value).reduce(((e,t)=>{var n;const r=b(t);return r&&(e[t]=null===(n=r.bails)||void 0===n||n),e}),{}))),j=Object.assign({},(null==e?void 0:e.initialErrors)||{}),S=null!==(n=null==e?void 0:e.keepValuesOnUnmount)&&void 0!==n&&n,{initialValues:I,originalInitialValues:M,setInitialValues:C}=function(e,n,r){const a=t.ref(Y(t.unref(r))||{}),u=t.ref(Y(t.unref(r))||{});function i(t,r=!1){a.value=Y(t),u.value=Y(t),r&&B(e.value).forEach((t=>{const r=e.value[t],u=Array.isArray(r)?r.some((e=>e.meta.touched)):null==r?void 0:r.meta.touched;if(!r||u)return;const i=w(a.value,t);E(n,t,Y(i))}))}t.isRef(r)&&t.watch(r,(e=>{i(e,!0)}),{deep:!0});return{initialValues:a,originalInitialValues:u,setInitialValues:i}}(i,d,null==e?void 0:e.initialValues),x=function(e,n,r,a){const u={touched:"some",pending:"some",valid:"every"},i=t.computed((()=>!V(n,t.unref(r))));function o(){const t=Object.values(e.value).flat(1).filter(Boolean);return B(u).reduce(((e,n)=>{const r=u[n];return e[n]=t[r]((e=>e.meta[n])),e}),{})}const l=t.reactive(o());return t.watchEffect((()=>{const e=o();l.touched=e.touched,l.valid=e.valid,l.pending=e.pending})),t.computed((()=>Object.assign(Object.assign({initialValues:t.unref(r)},l),{valid:l.valid&&!B(a.value).length,dirty:i.value})))}(i,d,M,h),N=t.computed((()=>[...a,...B(i.value)].reduce(((e,t)=>(E(e,t,w(d,t)),e)),{}))),_=null==e?void 0:e.validationSchema,U=R(de,5),$=R(de,5),D=P((async e=>"silent"===await e?U():$()),((e,[t])=>{const n=L.fieldsByPath.value||{},r=B(L.errorBag.value);return[...new Set([...B(e.results),...B(n),...r])].reduce(((r,a)=>{const u=n[a],i=(e.results[a]||{errors:[]}).errors,o={errors:i,valid:!i.length};if(r.results[a]=o,o.valid||(r.errors[a]=o.errors[0]),!u)return H(a,i),r;if(G(u,(e=>e.meta.valid=o.valid)),"silent"===t)return r;const l=Array.isArray(u)?u.some((e=>e.meta.validated)):u.meta.validated;return"validated-only"!==t||l?(G(u,(e=>e.setState({errors:o.errors}))),r):r}),{valid:e.valid,results:{},errors:{}})}));function z(e){return function(t,n){return function(r){return r instanceof Event&&(r.preventDefault(),r.stopPropagation()),re(B(i.value).reduce(((e,t)=>(e[t]=!0,e)),{})),l.value=!0,s.value++,oe().then((a=>{const u=Y(d);if(a.valid&&"function"==typeof t){const n=Y(N.value);return t(e?n:u,{evt:r,controlledValues:n,setErrors:J,setFieldError:H,setTouched:re,setFieldTouched:ne,setValues:Z,setFieldValue:W,resetForm:ae})}a.valid||"function"!=typeof n||n({values:u,evt:r,errors:a.errors,results:a.results})})).then((e=>(l.value=!1,e)),(e=>{throw l.value=!1,e}))}}}const q=z(!1);q.withControlled=z(!0);const L={formId:r,fieldsByPath:i,values:d,controlledValues:N,errorBag:v,errors:h,schema:_,submitCount:s,meta:x,isSubmitting:l,fieldArrays:c,keepValuesOnUnmount:S,validateSchema:t.unref(_)?D:void 0,validate:oe,register:function(e){const n=t.unref(e.name);ue(e,n),t.isRef(e.name)&&t.watch(e.name,(async(n,r)=>{await t.nextTick(),ie(e,r),ue(e,n),(h.value[r]||h.value[n])&&(H(r,void 0),se(n)),await t.nextTick(),O(r)||k(d,r)}));const r=t.unref(e.errorMessage);r&&(null==j?void 0:j[n])!==r&&se(n);delete j[n]},unregister:function(e){const n=t.unref(e.name),r=i.value[n],a=!!r&&K(r);ie(e,n),t.nextTick((()=>{var u;const o=null!==(u=t.unref(e.keepValueOnUnmount))&&void 0!==u?u:t.unref(S),l=w(d,n);if(a&&(r===i.value[n]||!i.value[n])&&Array.isArray(l)&&!o){const r=l.findIndex((n=>V(n,t.unref(e.checkedValue))));if(r>-1){const e=[...l];e.splice(r,1),W(n,e,{force:!0})}}if(!O(n)){if(H(n,void 0),o)return;if(a&&!p(w(d,n)))return;k(d,n)}}))},setFieldErrorBag:y,validateField:se,setFieldValue:W,setValues:Z,setErrors:J,setFieldError:H,setFieldTouched:ne,setTouched:re,resetForm:ae,handleSubmit:q,stageInitialValue:function(t,n,r=!1){E(d,t,n),ce(t,n),r&&!(null==e?void 0:e.initialValues)&&E(M.value,t,Y(n))},unsetInitialValue:function(e){k(I.value,e)},setFieldInitialValue:ce,useFieldModel:function(e){if(!Array.isArray(e))return ee(e);return e.map(ee)}};function K(e){return Array.isArray(e)}function G(e,t){return Array.isArray(e)?e.forEach(t):t(e)}function X(e){Object.values(i.value).forEach((t=>{t&&G(t,e)}))}function H(e,t){y(e,t)}function J(e){m(e)}function W(e,n,{force:r}={force:!1}){var a;const o=i.value[e],l=Y(n);if(!o)return void E(d,e,l);if(K(o)&&"checkbox"===(null===(a=o[0])||void 0===a?void 0:a.type)&&!Array.isArray(n)){const t=Y(T(w(d,e)||[],n,void 0));return void E(d,e,t)}let s=n;K(o)||"checkbox"!==o.type||r||u||(s=Y(T(w(d,e),n,t.unref(o.uncheckedValue)))),E(d,e,s)}function Z(e){B(d).forEach((e=>{delete d[e]})),B(e).forEach((t=>{W(t,e[t])})),c.forEach((e=>e&&e.reset()))}function ee(e){const{value:n}=te(e,void 0,L);return t.watch(n,(()=>{O(t.unref(e))||oe({mode:"validated-only"})}),{deep:!0}),a.add(t.unref(e)),n}function ne(e,t){const n=i.value[e];n&&G(n,(e=>e.setTouched(t)))}function re(e){B(e).forEach((t=>{ne(t,!!e[t])}))}function ae(e){u=!0,X((e=>e.resetField())),(null==e?void 0:e.values)?(C(e.values),Z(null==e?void 0:e.values)):(C(M.value),Z(M.value)),(null==e?void 0:e.touched)&&re(e.touched),J((null==e?void 0:e.errors)||{}),s.value=(null==e?void 0:e.submitCount)||0,t.nextTick((()=>{u=!1}))}function ue(e,n){const r=t.markRaw(e),a=n;if(!i.value[a])return void(i.value[a]=r);const u=i.value[a];u&&!Array.isArray(u)&&(i.value[a]=[u]),i.value[a]=[...i.value[a],r]}function ie(e,t){const n=t,r=i.value[n];if(r)if(K(r)||e.id!==r.id){if(K(r)){const t=r.findIndex((t=>t.id===e.id));if(-1===t)return;r.splice(t,1),r.length||delete i.value[n]}}else delete i.value[n]}async function oe(e){if(X((e=>e.meta.validated=!0)),L.validateSchema)return L.validateSchema((null==e?void 0:e.mode)||"force");const n=await Promise.all(Object.values(i.value).map((n=>{const r=Array.isArray(n)?n[0]:n;return r?r.validate(e).then((e=>({key:t.unref(r.name),valid:e.valid,errors:e.errors}))):Promise.resolve({key:"",valid:!0,errors:[]})}))),r={},a={};for(const e of n)r[e.key]={valid:e.valid,errors:e.errors},e.errors.length&&(a[e.key]=e.errors[0]);return{valid:n.every((e=>e.valid)),results:r,errors:a}}async function se(e){const n=i.value[e];return n?Array.isArray(n)?n.map((e=>e.validate()))[0]:n.validate():(t.warn(`field with name ${e} was not found`),Promise.resolve({errors:[],valid:!0}))}function ce(e,t){E(I.value,e,Y(t))}async function de(){const e=t.unref(_);if(!e)return{valid:!0,results:{},errors:{}};const n=f(e)?await async function(e,t){const n=await e.validate(t,{abortEarly:!1}).then((()=>[])).catch((e=>{if("ValidationError"!==e.name)throw e;return e.inner||[]})),r={},a={};for(const e of n){const t=e.errors;r[e.path]={valid:!t.length,errors:t},t.length&&(a[e.path]=t[0])}return{valid:!n.length,results:r,errors:a}}(e,d):await Q(e,d,{names:A.value,bailsMap:F.value});return n}const fe=q(((e,{evt:t})=>{g(t)&&t.target.submit()}));return t.onMounted((()=>{(null==e?void 0:e.initialErrors)&&J(e.initialErrors),(null==e?void 0:e.initialTouched)&&re(e.initialTouched),(null==e?void 0:e.validateOnMount)?oe():L.validateSchema&&L.validateSchema("silent")})),t.isRef(_)&&t.watch(_,(()=>{var e;null===(e=L.validateSchema)||void 0===e||e.call(L,"validated-only")})),t.provide(o,L),Object.assign(Object.assign({},L),{handleReset:()=>ae(),submitForm:fe})}const ce=t.defineComponent({name:"Form",inheritAttrs:!1,props:{as:{type:String,default:"form"},validationSchema:{type:Object,default:void 0},initialValues:{type:Object,default:void 0},initialErrors:{type:Object,default:void 0},initialTouched:{type:Object,default:void 0},validateOnMount:{type:Boolean,default:!1},onSubmit:{type:Function,default:void 0},onInvalidSubmit:{type:Function,default:void 0},keepValues:{type:Boolean,default:!1}},setup(e,n){const r=t.toRef(e,"initialValues"),a=t.toRef(e,"validationSchema"),u=t.toRef(e,"keepValues"),{errors:i,values:o,meta:l,isSubmitting:s,submitCount:c,controlledValues:d,validate:f,validateField:v,handleReset:p,resetForm:m,handleSubmit:y,setErrors:h,setFieldError:O,setFieldValue:V,setValues:A,setFieldTouched:F,setTouched:j}=se({validationSchema:a.value?a:void 0,initialValues:r,initialErrors:e.initialErrors,initialTouched:e.initialTouched,validateOnMount:e.validateOnMount,keepValuesOnUnmount:u}),w=y(((e,{evt:t})=>{g(t)&&t.target.submit()}),e.onInvalidSubmit),E=e.onSubmit?y(e.onSubmit,e.onInvalidSubmit):w;function S(e){b(e)&&e.preventDefault(),p(),"function"==typeof n.attrs.onReset&&n.attrs.onReset()}function k(t,n){return y("function"!=typeof t||n?n:t,e.onInvalidSubmit)(t)}function B(){return{meta:l.value,errors:i.value,values:o,isSubmitting:s.value,submitCount:c.value,controlledValues:d.value,validate:f,validateField:v,handleSubmit:k,handleReset:p,submitForm:w,setErrors:h,setFieldError:O,setFieldValue:V,setValues:A,setFieldTouched:F,setTouched:j,resetForm:m}}return n.expose({setFieldError:O,setErrors:h,setFieldValue:V,setValues:A,setFieldTouched:F,setTouched:j,resetForm:m,validate:f,validateField:v}),function(){const r="form"===e.as?e.as:t.resolveDynamicComponent(e.as),a=N(r,n,B);if(!e.as)return a;const u="form"===e.as?{novalidate:!0}:{};return t.h(r,Object.assign(Object.assign(Object.assign({},u),n.attrs),{onSubmit:E,onReset:S}),a)}}}),de=ce;function fe(e){const n=I(o,void 0),a=t.ref([]),u=()=>{},i={fields:a,remove:u,push:u,swap:u,insert:u,update:u,replace:u,prepend:u,move:u};if(!n)return M("FieldArray requires being a child of `<Form/>` or `useForm` being called before it. Array fields may not work correctly"),i;if(!t.unref(e))return M("FieldArray requires a field path to be provided, did you forget to pass the `name` prop?"),i;const l=n.fieldArrays.find((n=>t.unref(n.path)===t.unref(e)));if(l)return l;let s=0;function c(){const r=w(null==n?void 0:n.values,t.unref(e),[])||[];a.value=r.map(f),d()}function d(){const e=a.value.length;for(let t=0;t<e;t++){const n=a.value[t];n.isFirst=0===t,n.isLast=t===e-1}}function f(r){const u=s++,i={key:u,value:t.computed({get(){const i=w(null==n?void 0:n.values,t.unref(e),[])||[],o=a.value.findIndex((e=>e.key===u));return-1===o?r:i[o]},set(e){const t=a.value.findIndex((e=>e.key===u));-1!==t?v(t,e):M("Attempting to update a non-existent array item")}}),isFirst:!1,isLast:!1};return i}function v(r,a){const u=t.unref(e),i=w(null==n?void 0:n.values,u);!Array.isArray(i)||i.length-1<r||null==n||n.setFieldValue(`${u}[${r}]`,a)}c();const p={fields:a,remove:function(r){const u=t.unref(e),i=w(null==n?void 0:n.values,u);if(!i||!Array.isArray(i))return;const o=[...i];o.splice(r,1),null==n||n.unsetInitialValue(u+`[${r}]`),null==n||n.setFieldValue(u,o),a.value.splice(r,1),d()},push:function(u){const i=t.unref(e),o=w(null==n?void 0:n.values,i),l=r(o)?[]:o;if(!Array.isArray(l))return;const s=[...l];s.push(u),null==n||n.stageInitialValue(i+`[${s.length-1}]`,u),null==n||n.setFieldValue(i,s),a.value.push(f(u)),d()},swap:function(r,u){const i=t.unref(e),o=w(null==n?void 0:n.values,i);if(!Array.isArray(o)||!(r in o)||!(u in o))return;const l=[...o],s=[...a.value],c=l[r];l[r]=l[u],l[u]=c;const f=s[r];s[r]=s[u],s[u]=f,null==n||n.setFieldValue(i,l),a.value=s,d()},insert:function(r,u){const i=t.unref(e),o=w(null==n?void 0:n.values,i);if(!Array.isArray(o)||o.length<r)return;const l=[...o],s=[...a.value];l.splice(r,0,u),s.splice(r,0,f(u)),null==n||n.setFieldValue(i,l),a.value=s,d()},update:v,replace:function(r){const a=t.unref(e);null==n||n.setFieldValue(a,r),c()},prepend:function(u){const i=t.unref(e),o=w(null==n?void 0:n.values,i),l=r(o)?[]:o;if(!Array.isArray(l))return;const s=[u,...l];null==n||n.stageInitialValue(i+`[${s.length-1}]`,u),null==n||n.setFieldValue(i,s),a.value.unshift(f(u)),d()},move:function(u,i){const o=t.unref(e),l=w(null==n?void 0:n.values,o),s=r(l)?[]:[...l];if(!Array.isArray(l)||!(u in l)||!(i in l))return;const c=[...a.value],f=c[u];c.splice(u,1),c.splice(i,0,f);const v=s[u];s.splice(u,1),s.splice(i,0,v),null==n||n.setFieldValue(o,s),a.value=c,d()}};return n.fieldArrays.push(Object.assign({path:e,reset:c},p)),t.onBeforeUnmount((()=>{const r=n.fieldArrays.findIndex((n=>t.unref(n.path)===t.unref(e)));r>=0&&n.fieldArrays.splice(r,1)})),p}const ve=t.defineComponent({name:"FieldArray",inheritAttrs:!1,props:{name:{type:String,required:!0}},setup(e,n){const{push:r,remove:a,swap:u,insert:i,replace:o,update:l,prepend:s,move:c,fields:d}=fe(t.toRef(e,"name"));function f(){return{fields:d.value,push:r,remove:a,swap:u,insert:i,update:l,replace:o,prepend:s,move:c}}return n.expose({push:r,remove:a,swap:u,insert:i,update:l,replace:o,prepend:s,move:c}),()=>N(void 0,n,f)}}),pe=t.defineComponent({name:"ErrorMessage",props:{as:{type:String,default:void 0},name:{type:String,required:!0}},setup(e,n){const r=t.inject(o,void 0),a=t.computed((()=>null==r?void 0:r.errors.value[e.name]));function u(){return{message:a.value}}return()=>{if(!a.value)return;const r=e.as?t.resolveDynamicComponent(e.as):e.as,i=N(r,n,u),o=Object.assign({role:"alert"},n.attrs);return r||!Array.isArray(i)&&i||!(null==i?void 0:i.length)?!Array.isArray(i)&&i||(null==i?void 0:i.length)?t.h(r,o,i):t.h(r||"span",o,a.value):i}}});e.ErrorMessage=pe,e.Field=oe,e.FieldArray=ve,e.FieldContextKey=l,e.Form=de,e.FormContextKey=o,e.IS_ABSENT=s,e.configure=G,e.defineRule=function(e,t){!function(e,t){if(n(t))return;throw new Error(`Extension Error: The validator '${e}' must be a function.`)}(e,t),i[e]=t},e.useField=ne,e.useFieldArray=fe,e.useFieldError=function(e){const n=I(o),r=e?void 0:t.inject(l);return t.computed((()=>e?null==n?void 0:n.errors.value[t.unref(e)]:null==r?void 0:r.errorMessage.value))},e.useFieldValue=function(e){const n=I(o),r=e?void 0:t.inject(l);return t.computed((()=>e?w(null==n?void 0:n.values,t.unref(e)):t.unref(null==r?void 0:r.value)))},e.useForm=se,e.useFormErrors=function(){const e=I(o);return e||M("No vee-validate <Form /> or `useForm` was detected in the component tree"),t.computed((()=>(null==e?void 0:e.errors.value)||{}))},e.useFormValues=function(){const e=I(o);return e||M("No vee-validate <Form /> or `useForm` was detected in the component tree"),t.computed((()=>(null==e?void 0:e.values)||{}))},e.useIsFieldDirty=function(e){const n=I(o);let r=e?void 0:t.inject(l);return t.computed((()=>(e&&(r=C(null==n?void 0:n.fieldsByPath.value[t.unref(e)])),r?r.meta.dirty:(M(`field with name ${t.unref(e)} was not found`),!1))))},e.useIsFieldTouched=function(e){const n=I(o);let r=e?void 0:t.inject(l);return t.computed((()=>(e&&(r=C(null==n?void 0:n.fieldsByPath.value[t.unref(e)])),r?r.meta.touched:(M(`field with name ${t.unref(e)} was not found`),!1))))},e.useIsFieldValid=function(e){const n=I(o);let r=e?void 0:t.inject(l);return t.computed((()=>(e&&(r=C(null==n?void 0:n.fieldsByPath.value[t.unref(e)])),r?r.meta.valid:(M(`field with name ${t.unref(e)} was not found`),!1))))},e.useIsFormDirty=function(){const e=I(o);return e||M("No vee-validate <Form /> or `useForm` was detected in the component tree"),t.computed((()=>{var t;return null!==(t=null==e?void 0:e.meta.value.dirty)&&void 0!==t&&t}))},e.useIsFormTouched=function(){const e=I(o);return e||M("No vee-validate <Form /> or `useForm` was detected in the component tree"),t.computed((()=>{var t;return null!==(t=null==e?void 0:e.meta.value.touched)&&void 0!==t&&t}))},e.useIsFormValid=function(){const e=I(o);return e||M("No vee-validate <Form /> or `useForm` was detected in the component tree"),t.computed((()=>{var t;return null!==(t=null==e?void 0:e.meta.value.valid)&&void 0!==t&&t}))},e.useIsSubmitting=function(){const e=I(o);return e||M("No vee-validate <Form /> or `useForm` was detected in the component tree"),t.computed((()=>{var t;return null!==(t=null==e?void 0:e.isSubmitting.value)&&void 0!==t&&t}))},e.useResetForm=function(){const e=I(o);return e||M("No vee-validate <Form /> or `useForm` was detected in the component tree"),function(t){if(e)return e.resetForm(t)}},e.useSubmitCount=function(){const e=I(o);return e||M("No vee-validate <Form /> or `useForm` was detected in the component tree"),t.computed((()=>{var t;return null!==(t=null==e?void 0:e.submitCount.value)&&void 0!==t?t:0}))},e.useSubmitForm=function(e){const t=I(o);t||M("No vee-validate <Form /> or `useForm` was detected in the component tree");const n=t?t.handleSubmit(e):void 0;return function(e){if(n)return n(e)}},e.useValidateField=function(e){const n=I(o);let r=e?void 0:t.inject(l);return function(){return e&&(r=C(null==n?void 0:n.fieldsByPath.value[t.unref(e)])),r?r.validate():(M(`field with name ${t.unref(e)} was not found`),Promise.resolve({errors:[],valid:!0}))}},e.useValidateForm=function(){const e=I(o);return e||M("No vee-validate <Form /> or `useForm` was detected in the component tree"),function(){return e?e.validate():Promise.resolve({results:{},errors:{},valid:!0})}},e.validate=X,Object.defineProperty(e,"__esModule",{value:!0})}));
{
"name": "vee-validate",
"version": "4.6.10",
"version": "4.7.0",
"description": "Form Validation for Vue.js",

@@ -36,3 +36,3 @@ "author": "Abdelrahman Awad <logaretm1@gmail.com>",

},
"gitHead": "844faec4d8937fbb1a68f4e6667ed3851a0a3e9e"
"gitHead": "45e0b22343b4bb60422b21179b156b9a2c342054"
}

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc