{"version":3,"sources":["webpack:///./node_modules/@vuelidate/core/node_modules/vue-demi/lib/index.mjs","webpack:///./node_modules/@vuelidate/core/dist/index.esm.js","webpack:///./node_modules/@vuelidate/validators/dist/index.esm.js"],"names":["isVue3","unwrapObj","obj","ignoreKeys","Object","keys","reduce","o","k","includes","isFunction","val","isProxy","value","callRule","rule","siblingState","instance","call","normalizeValidatorResponse","result","undefined","$valid","createAsyncResult","model","$pending","$dirty","$lazy","$rewardEarly","$response","watchTargets","$lastInvalidState","$lastCommittedOn","$invalid","$pendingCounter","$unwatch","concat","ruleResult","err","Promise","reject","resolve","then","data","catch","error","immediate","deep","createSyncResult","returnValue","createValidatorResult","config","validatorName","propertyKey","propertyPath","$params","$async","$validator","$watchTargets","message","$message","$model","$propertyPath","$property","sortValidations","validationsRaw","validations","validationKeys","rules","nestedValidators","forEach","key","v","startsWith","_empty","ROOT_PATH","_call","body","direct","e","_callIgnored","_invoke","_async","f","args","i","arguments","length","apply","this","createValidationResults","resultsCache","path","externalResults","ruleKeys","cachedResult","get","$partial","$path","$touch","$reset","$commit","ruleKey","$externalResults","map","stringError","index","$uid","r","some","$error","$silentErrors","filter","res","$errors","Date","now","set","collectNestedValidationResults","nestedState","nestedExternalResults","nestedValidationKeys","results","nestedKey","setValidations","state","parentKey","globalConfig","createMetaFields","nestedResults","childResults","allResults","allRes","values","every","modelErrors","nestedErrors","errors","$anyDirty","nr","$validate","mergedConfig","unwatch","assign","s","cachedExternalResults","external","$getResultsForChild","$clearExternalResults","$autoDirty","flush","storage","Map","storedRules","storedRulesKeys","newRulesKeys","hasAllValidators","paramKey","storedRuleResultPair","isValidCache","checkRulesValidity","CollectFlag","COLLECT_ALL","COLLECT_NONE","VuelidateInjectChildResults","Symbol","VuelidateRemoveChildResults","nestedValidations","$scope","childResultsRaw","childResultsKeys","injectChildResultsIntoParent","$registerAs","childScope","$stopPropagation","push","removeChildResultsFromParent","childKey","__vuelidateInjectInstances","__vuelidateRemoveInstances","sendValidationResultsToParent","removeValidationResultsFromParent","ComputedProxyFactory","target","Proxy","prop","useVuelidate","componentOptions","type","proxy","$options","uid","_uid","validationResults","vuelidateExternalResults","validationsConfig","validationsWatchTarget","newValidationRules","isObject","Array","isArray","normalizeValidatorObject","validator","unwrapValidatorResponse","unwrapNormalizedValidator","withParams","Error","validatorObj","withMessage","withAsync","validators","collection","others","previous","collectionItem","collectionEntryResult","entries","all","property","innerValidators","propertyResult","currentValidator","validatorFunction","$data","context","a","b","req","isNaN","getTime","_","String","len","regex","expr","test","numeric$1","numeric","emailRegex","email$1","email","required$1","trim","required","urlRegex","maxValue$1","max","maxValue","decimal$1","decimal"],"mappings":"oKAGIA,GAAS,ECDb,SAASC,EAAUC,EAAKC,EAAa,IACnC,OAAOC,OAAOC,KAAKH,GAAKI,OAAO,CAACC,EAAGC,KAC7BL,EAAWM,SAASD,KACxBD,EAAEC,GAAK,mBAAMN,EAAIM,KADkBD,GAGlC,IAEL,SAASG,EAAWC,GAClB,MAAsB,oBAARA,EAEhB,SAASC,EAAQC,GACf,OAAO,wBAAWA,IAAU,wBAAWA,GAkBzC,SAASC,EAASC,EAAMF,EAAOG,EAAcC,GAC3C,OAAOF,EAAKG,KAAKD,EAAU,mBAAMJ,GAAQ,mBAAMG,GAAeC,GAUhE,SAASE,EAA2BC,GAClC,YAAyBC,IAAlBD,EAAOE,QAAwBF,EAAOE,QAAUF,EAoBzD,SAASG,EAAkBR,EAAMS,EAAOC,EAAUC,GAAQ,MACxDC,EAAK,aACLC,GACCC,EAAWZ,EAAUa,EAAe,GAAId,EAAce,EAAmBC,GAC1E,MAAMC,EAAW,mBAAMP,EAAOb,OACxBqB,EAAkB,iBAAI,GAC5BT,EAASZ,OAAQ,EACjB,MAAMsB,EAAW,mBAAM,CAACX,EAAOE,GAAQU,OAAON,EAAcE,GAAmB,KAC7E,GACAL,IAAUD,EAAOb,OAASe,IAAiBG,EAAkBlB,QAAUY,EAASZ,MAC9E,OAGF,IAAIwB,EAEJ,IACEA,EAAav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AIC,EAAYD,IAAO,CACrB7L,WAAY4L,EAAWC,GACvB1L,SAAU,EACRL,aACI,wBAAwBA,EAAQ+L,IACtC/L,QAAS,CACP+L,MACA1D,KAAM,cAqBN4D,GAfYf,EAAM,0BAeNA,EAAM,sBAOlBgB,EAAU,CACZhM,WAAY+L,EACZ5L,SAAU,wBACVL,QAAS,CACPqI,KAAM","file":"js/chunk-77a300d1.addd4716.js","sourcesContent":["import * as Vue from 'vue'\n\nvar isVue2 = false\nvar isVue3 = true\nvar Vue2 = undefined\n\nfunction install() {}\n\nexport function set(target, key, val) {\n if (Array.isArray(target)) {\n target.length = Math.max(target.length, key)\n target.splice(key, 1, val)\n return val\n }\n target[key] = val\n return val\n}\n\nexport function del(target, key) {\n if (Array.isArray(target)) {\n target.splice(key, 1)\n return\n }\n delete target[key]\n}\n\nexport * from 'vue'\nexport {\n Vue,\n Vue2,\n isVue2,\n isVue3,\n install,\n}\n","import { isReactive, isReadonly, unref, ref, computed, watch, reactive, isRef, nextTick, inject, provide, getCurrentInstance, isVue3, onBeforeMount, onBeforeUnmount } from 'vue-demi';\n\nfunction unwrapObj(obj, ignoreKeys = []) {\n return Object.keys(obj).reduce((o, k) => {\n if (ignoreKeys.includes(k)) return o;\n o[k] = unref(obj[k]);\n return o;\n }, {});\n}\nfunction isFunction(val) {\n return typeof val === 'function';\n}\nfunction isProxy(value) {\n return isReactive(value) || isReadonly(value);\n}\n\n/**\n * Response form a raw Validator function.\n * Should return a Boolean or an object with $invalid property.\n * @typedef {Boolean | { $valid: Boolean }} ValidatorResponse\n */\n\n/**\n * Calls a validation rule by unwrapping its value first from a ref.\n * @param {Validator} rule\n * @param {Ref} value\n * @param {VueInstance} instance\n * @param {Object} siblingState\n * @return {Promise | ValidatorResponse}\n */\n\nfunction callRule(rule, value, siblingState, instance) {\n return rule.call(instance, unref(value), unref(siblingState), instance);\n}\n/**\n * Normalizes the validator result\n * Allows passing a boolean of an object like `{ $valid: Boolean }`\n * @param {ValidatorResponse} result - Validator result\n * @return {boolean}\n */\n\n\nfunction normalizeValidatorResponse(result) {\n return result.$valid !== undefined ? !result.$valid : !result;\n}\n/**\n * Returns the result of an async validator.\n * @param {Validator} rule\n * @param {Ref<*>} model\n * @param {Ref} $pending\n * @param {Ref} $dirty\n * @param {GlobalConfig} config\n * @param {boolean} config.$lazy\n * @param {Ref<*>} $response\n * @param {VueInstance} instance\n * @param {Ref<*>[]} watchTargets\n * @param {Object} siblingState\n * @param {Ref} $lastInvalidState\n * @param {Ref} $lastCommittedOn\n * @return {{ $invalid: Ref, $unwatch: WatchStopHandle }}\n */\n\n\nfunction createAsyncResult(rule, model, $pending, $dirty, {\n $lazy,\n $rewardEarly\n}, $response, instance, watchTargets = [], siblingState, $lastInvalidState, $lastCommittedOn) {\n const $invalid = ref(!!$dirty.value);\n const $pendingCounter = ref(0);\n $pending.value = false;\n const $unwatch = watch([model, $dirty].concat(watchTargets, $lastCommittedOn), () => {\n if ( // if $lazy and not dirty, return\n $lazy && !$dirty.value || $rewardEarly && !$lastInvalidState.value && !$pending.value) {\n return;\n }\n\n let ruleResult; // make sure we dont break if a validator throws\n\n try {\n ruleResult = callRule(rule, model, siblingState, instance);\n } catch (err) {\n // convert to a promise, so we can handle it async\n ruleResult = Promise.reject(err);\n }\n\n $pendingCounter.value++;\n $pending.value = !!$pendingCounter.value; // ensure $invalid is false, while validator is resolving\n\n $invalid.value = false;\n Promise.resolve(ruleResult).then(data => {\n $pendingCounter.value--;\n $pending.value = !!$pendingCounter.value;\n $response.value = data;\n $invalid.value = normalizeValidatorResponse(data);\n }).catch(error => {\n $pendingCounter.value--;\n $pending.value = !!$pendingCounter.value;\n $response.value = error;\n $invalid.value = true;\n });\n }, {\n immediate: true,\n deep: typeof model === 'object'\n });\n return {\n $invalid,\n $unwatch\n };\n}\n/**\n * Returns the result of a sync validator\n * @param {Validator} rule\n * @param {Ref<*>} model\n * @param {Ref} $dirty\n * @param {GlobalConfig} config\n * @param {Boolean} config.$lazy\n * @param {Ref<*>} $response\n * @param {VueInstance} instance\n * @param {Object} siblingState\n * @param {Ref} $lastInvalidState\n * @return {{$unwatch: (function(): {}), $invalid: ComputedRef}}\n */\n\n\nfunction createSyncResult(rule, model, $dirty, {\n $lazy,\n $rewardEarly\n}, $response, instance, siblingState, $lastInvalidState) {\n const $unwatch = () => ({});\n\n const $invalid = computed(() => {\n if ( // return early if $lazy mode and not touched\n $lazy && !$dirty.value || $rewardEarly && !$lastInvalidState.value) {\n return false;\n }\n\n let returnValue = true;\n\n try {\n const result = callRule(rule, model, siblingState, instance);\n $response.value = result;\n returnValue = normalizeValidatorResponse(result);\n } catch (err) {\n $response.value = err;\n }\n\n return returnValue;\n });\n return {\n $unwatch,\n $invalid\n };\n}\n/**\n * Returns the validation result.\n * Detects async and sync validators.\n * @param {NormalizedValidator} rule\n * @param {Ref<*>} model\n * @param {Ref} $dirty\n * @param {GlobalConfig} config - Vuelidate config\n * @param {VueInstance} instance - component instance\n * @param {string} validatorName - name of the current validator\n * @param {string} propertyKey - the current property we are validating\n * @param {string} propertyPath - the deep path to the validated property\n * @param {Object} siblingState\n * @param {Ref} $lastInvalidState - the last invalid state\n * @param {Ref} $lastCommittedOn - the last time $commit was called\n * @return {{ $params: *, $message: Ref, $pending: Ref, $invalid: Ref, $response: Ref<*>, $unwatch: WatchStopHandle }}\n */\n\n\nfunction createValidatorResult(rule, model, $dirty, config, instance, validatorName, propertyKey, propertyPath, siblingState, $lastInvalidState, $lastCommittedOn) {\n const $pending = ref(false);\n const $params = rule.$params || {};\n const $response = ref(null);\n let $invalid;\n let $unwatch;\n\n if (rule.$async) {\n ({\n $invalid,\n $unwatch\n } = createAsyncResult(rule.$validator, model, $pending, $dirty, config, $response, instance, rule.$watchTargets, siblingState, $lastInvalidState, $lastCommittedOn));\n } else {\n ({\n $invalid,\n $unwatch\n } = createSyncResult(rule.$validator, model, $dirty, config, $response, instance, siblingState, $lastInvalidState));\n }\n\n const message = rule.$message;\n const $message = isFunction(message) ? computed(() => message(unwrapObj({\n $pending,\n $invalid,\n $params: unwrapObj($params),\n // $params can hold refs, so we unwrap them for easy access\n $model: model,\n $response,\n $validator: validatorName,\n $propertyPath: propertyPath,\n $property: propertyKey\n }))) : message || '';\n return {\n $message,\n $params,\n $pending,\n $invalid,\n $response,\n $unwatch\n };\n}\n\n/**\n * Sorts a validation definition into rules, configs and nested validators.\n * @param {Object} validationsRaw\n * @return {{ rules: Object, nestedValidators: Object, config: GlobalConfig }}\n */\n\nfunction sortValidations(validationsRaw = {}) {\n const validations = unref(validationsRaw);\n const validationKeys = Object.keys(validations);\n const rules = {};\n const nestedValidators = {};\n const config = {};\n validationKeys.forEach(key => {\n const v = validations[key];\n\n switch (true) {\n // If it is already normalized, use it\n case isFunction(v.$validator):\n rules[key] = v;\n break;\n // If it is just a function, normalize it first\n // into { $validator: }\n\n case isFunction(v):\n rules[key] = {\n $validator: v\n };\n break;\n // Catch $-prefixed properties as config\n\n case key.startsWith('$'):\n config[key] = v;\n break;\n // If it doesn’t match any of the above,\n // treat as nestedValidators state property\n\n default:\n nestedValidators[key] = v;\n }\n });\n return {\n rules,\n nestedValidators,\n config\n };\n}\n\nfunction _empty() {}\n\nconst ROOT_PATH = '__root';\n/** @typedef {import('vue-demi').ComponentPublicInstance} VueInstance */\n\n/** @typedef {import('vue-demi').ComputedRef} ComputedRef */\n\n/** @typedef {import('vue-demi').UnwrapRef} UnwrapRef */\n\n/** @typedef {import('vue-demi').WatchStopHandle} WatchStopHandle */\n\n/** @typedef {import('vue-demi').WritableComputedRef} WritableComputedRef */\n\n/** @typedef {import('vue-demi').UnwrapNestedRefs} UnwrapNestedRefs */\n\n/**\n * @typedef NormalizedValidator\n * @property {Validator} $validator\n * @property {String | Ref | function(*): string} [$message]\n * @property {Object | Ref} [$params]\n * @property {Object | Ref} [$async]\n * @property {Ref<*>[]} [$watchTargets]\n */\n\n/**\n * Raw validator function, before being normalized\n * Can return a Promise or a {@see ValidatorResponse}\n * @typedef {function(*): ((Promise | ValidatorResponse))} Validator\n */\n\n/**\n * @typedef ErrorObject\n * @property {Ref} $message - Reactive error message\n * @property {Ref} $params - Params passed from withParams\n * @property {Ref} $pending - If validation is pending\n * @property {String} $property - State key\n * @property {String} $propertyPath - Dot notation path to state\n * @property {String} $validator - Validator name\n * @property {String} $uid - Unique identifier\n */\n\n/**\n * @typedef ValidationResult\n * @property {Ref} $pending\n * @property {Ref} $dirty\n * @property {Ref} $invalid\n * @property {Ref} $error\n * @property {Ref} $path\n * @property {Function} $touch\n * @property {Function} $reset\n * @property {ComputedRef} $errors\n * @property {ComputedRef} $silentErrors\n * @property {Function} $commit\n */\n\n/**\n * Creates the main Validation Results object for a state tree\n * Walks the tree's top level branches\n * @param {Object} rules - Rules for the current state tree\n * @param {Object} model - Current state value\n * @param {String} key - Key for the current state tree\n * @param {ResultsStorage} [resultsCache] - A cache map of all the validators\n * @param {String} [path] - the current property path\n * @param {GlobalConfig} [config] - the config object\n * @param {VueInstance} instance\n * @param {ComputedRef} externalResults\n * @param {Object} siblingState\n * @return {ValidationResult | {}}\n */\n\nfunction _call(body, then, direct) {\n if (direct) {\n return then ? then(body()) : body();\n }\n\n try {\n var result = Promise.resolve(body());\n return then ? result.then(then) : result;\n } catch (e) {\n return Promise.reject(e);\n }\n}\n/**\n * Collects the validation results of all nested state properties\n * @param {Object} validations - The validation\n * @param {Object} nestedState - Current state\n * @param {String} path - Path to current property\n * @param {ResultsStorage} resultsCache - Validations cache map\n * @param {GlobalConfig} config - The config object\n * @param {VueInstance} instance - The current Vue instance\n * @param {ComputedRef} nestedExternalResults - The external results for this nested collection\n * @return {Object}\n */\n\n\nfunction _callIgnored(body, direct) {\n return _call(body, _empty, direct);\n}\n\nfunction _invoke(body, then) {\n var result = body();\n\n if (result && result.then) {\n return result.then(then);\n }\n\n return then(result);\n}\n\nfunction _async(f) {\n return function () {\n for (var args = [], i = 0; i < arguments.length; i++) {\n args[i] = arguments[i];\n }\n\n try {\n return Promise.resolve(f.apply(this, args));\n } catch (e) {\n return Promise.reject(e);\n }\n };\n}\n\nfunction createValidationResults(rules, model, key, resultsCache, path, config, instance, externalResults, siblingState) {\n // collect the property keys\n const ruleKeys = Object.keys(rules);\n const cachedResult = resultsCache.get(path, rules);\n const $dirty = ref(false); // state for the $rewardEarly option\n\n /** The last invalid state of this property */\n\n const $lastInvalidState = ref(false);\n /** The last time $commit was called. Used to re-trigger async calls */\n\n const $lastCommittedOn = ref(0);\n\n if (cachedResult) {\n // if the rules are the same as before, use the cached results\n if (!cachedResult.$partial) return cachedResult; // remove old watchers\n\n cachedResult.$unwatch(); // use the `$dirty.value`, so we dont save references by accident\n\n $dirty.value = cachedResult.$dirty.value;\n }\n\n const result = {\n // restore $dirty from cache\n $dirty,\n $path: path,\n $touch: () => {\n if (!$dirty.value) $dirty.value = true;\n },\n $reset: () => {\n if ($dirty.value) $dirty.value = false;\n },\n $commit: () => {}\n };\n /**\n * If there are no validation rules, it is most likely\n * a top level state, aka root\n */\n\n if (!ruleKeys.length) {\n // if there are cached results, we should overwrite them with the new ones\n cachedResult && resultsCache.set(path, rules, result);\n return result;\n }\n\n ruleKeys.forEach(ruleKey => {\n result[ruleKey] = createValidatorResult(rules[ruleKey], model, result.$dirty, config, instance, ruleKey, key, path, siblingState, $lastInvalidState, $lastCommittedOn);\n });\n result.$externalResults = computed(() => {\n if (!externalResults.value) return [];\n return [].concat(externalResults.value).map((stringError, index) => ({\n $propertyPath: path,\n $property: key,\n $validator: '$externalResults',\n $uid: `${path}-externalResult-${index}`,\n $message: stringError,\n $params: {},\n $response: null,\n $pending: false\n }));\n });\n result.$invalid = computed(() => {\n const r = ruleKeys.some(ruleKey => unref(result[ruleKey].$invalid)); // cache the last invalid state\n\n $lastInvalidState.value = r;\n return !!result.$externalResults.value.length || r;\n });\n result.$pending = computed(() => ruleKeys.some(ruleKey => unref(result[ruleKey].$pending)));\n result.$error = computed(() => result.$dirty.value ? result.$pending.value || result.$invalid.value : false);\n result.$silentErrors = computed(() => ruleKeys.filter(ruleKey => unref(result[ruleKey].$invalid)).map(ruleKey => {\n const res = result[ruleKey];\n return reactive({\n $propertyPath: path,\n $property: key,\n $validator: ruleKey,\n $uid: `${path}-${ruleKey}`,\n $message: res.$message,\n $params: res.$params,\n $response: res.$response,\n $pending: res.$pending\n });\n }).concat(result.$externalResults.value));\n result.$errors = computed(() => result.$dirty.value ? result.$silentErrors.value : []);\n\n result.$unwatch = () => ruleKeys.forEach(ruleKey => {\n result[ruleKey].$unwatch();\n });\n\n result.$commit = () => {\n $lastInvalidState.value = true;\n $lastCommittedOn.value = Date.now();\n };\n\n resultsCache.set(path, rules, result);\n return result;\n}\n\nfunction collectNestedValidationResults(validations, nestedState, path, resultsCache, config, instance, nestedExternalResults) {\n const nestedValidationKeys = Object.keys(validations); // if we have no state, return empty object\n\n if (!nestedValidationKeys.length) return {};\n return nestedValidationKeys.reduce((results, nestedKey) => {\n // build validation results for nested state\n results[nestedKey] = setValidations({\n validations: validations[nestedKey],\n state: nestedState,\n key: nestedKey,\n parentKey: path,\n resultsCache,\n globalConfig: config,\n instance,\n externalResults: nestedExternalResults\n });\n return results;\n }, {});\n}\n/**\n * Generates the Meta fields from the results\n * @param {ValidationResult|{}} results\n * @param {Object.} nestedResults\n * @param {Object.} childResults\n * @return {{$anyDirty: Ref, $error: Ref, $invalid: Ref, $errors: Ref, $dirty: Ref, $touch: Function, $reset: Function }}\n */\n\n\nfunction createMetaFields(results, nestedResults, childResults) {\n const allResults = computed(() => [nestedResults, childResults].filter(res => res).reduce((allRes, res) => {\n return allRes.concat(Object.values(unref(res)));\n }, [])); // returns `$dirty` as true, if all children are dirty\n\n const $dirty = computed({\n get() {\n return results.$dirty.value || (allResults.value.length ? allResults.value.every(r => r.$dirty) : false);\n },\n\n set(v) {\n results.$dirty.value = v;\n }\n\n });\n const $silentErrors = computed(() => {\n // current state level errors, fallback to empty array if root\n const modelErrors = unref(results.$silentErrors) || []; // collect all nested and child $silentErrors\n\n const nestedErrors = allResults.value.filter(result => (unref(result).$silentErrors || []).length).reduce((errors, result) => {\n return errors.concat(...result.$silentErrors);\n }, []); // merge the $silentErrors\n\n return modelErrors.concat(nestedErrors);\n });\n const $errors = computed(() => {\n // current state level errors, fallback to empty array if root\n const modelErrors = unref(results.$errors) || []; // collect all nested and child $errors\n\n const nestedErrors = allResults.value.filter(result => (unref(result).$errors || []).length).reduce((errors, result) => {\n return errors.concat(...result.$errors);\n }, []); // merge the $errors\n\n return modelErrors.concat(nestedErrors);\n });\n const $invalid = computed(() => // if any of the nested values is invalid\n allResults.value.some(r => r.$invalid) || // or if the current state is invalid\n unref(results.$invalid) || // fallback to false if is root\n false);\n const $pending = computed(() => // if any of the nested values is pending\n allResults.value.some(r => unref(r.$pending)) || // if any of the current state validators is pending\n unref(results.$pending) || // fallback to false if is root\n false);\n const $anyDirty = computed(() => allResults.value.some(r => r.$dirty) || allResults.value.some(r => r.$anyDirty) || $dirty.value);\n const $error = computed(() => $dirty.value ? $pending.value || $invalid.value : false);\n\n const $touch = () => {\n // call the root $touch\n results.$touch(); // call all nested level $touch\n\n allResults.value.forEach(result => {\n result.$touch();\n });\n };\n\n const $commit = () => {\n // call the root $touch\n results.$commit(); // call all nested level $touch\n\n allResults.value.forEach(result => {\n result.$commit();\n });\n };\n\n const $reset = () => {\n // reset the root $dirty state\n results.$reset(); // reset all the children $dirty states\n\n allResults.value.forEach(result => {\n result.$reset();\n });\n }; // Ensure that if all child and nested results are $dirty, this also becomes $dirty\n\n\n if (allResults.value.length && allResults.value.every(nr => nr.$dirty)) $touch();\n return {\n $dirty,\n $errors,\n $invalid,\n $anyDirty,\n $error,\n $pending,\n $touch,\n $reset,\n $silentErrors,\n $commit\n };\n}\n/**\n * @typedef VuelidateState\n * @property {WritableComputedRef} $model\n * @property {ComputedRef} $dirty\n * @property {ComputedRef} $error\n * @property {ComputedRef} $errors\n * @property {ComputedRef} $invalid\n * @property {ComputedRef} $anyDirty\n * @property {ComputedRef} $pending\n * @property {Function} $touch\n * @property {Function} $reset\n * @property {String} $path\n * @property {ComputedRef} $silentErrors\n * @property {Function} [$validate]\n * @property {Function} [$getResultsForChild]\n * @property {Object.}\n */\n\n/**\n * Main Vuelidate bootstrap function.\n * Used both for Composition API in `setup` and for Global App usage.\n * Used to collect validation state, when walking recursively down the state tree\n * @param {Object} params\n * @param {Object} params.validations\n * @param {Object} params.state\n * @param {String} [params.key] - Current state property key. Used when being called on nested items\n * @param {String} [params.parentKey] - Parent state property key. Used when being called recursively\n * @param {Object} [params.childResults] - Used to collect child results.\n * @param {ResultsStorage} params.resultsCache - The cached validation results\n * @param {VueInstance} params.instance - The current Vue instance\n * @param {GlobalConfig} params.globalConfig - The validation config, passed to this setValidations instance.\n * @param {UnwrapNestedRefs | Ref} params.externalResults - External validation results\n * @return {UnwrapNestedRefs}\n */\n\n\nfunction setValidations({\n validations,\n state,\n key,\n parentKey,\n childResults,\n resultsCache,\n globalConfig = {},\n instance,\n externalResults\n}) {\n /**\n * Executes the validators and returns the result.\n * @return {Promise}\n */\n const $validate = _async(function () {\n if (!$dirty.value) $touch();\n return _invoke(function () {\n if (mergedConfig.$rewardEarly) {\n $commit(); // await the watchers\n\n return _callIgnored(nextTick);\n }\n }, function () {\n // await the watchers\n return _call(nextTick, function () {\n return new Promise(resolve => {\n // return whether it is valid or not\n if (!$pending.value) return resolve(!$invalid.value);\n const unwatch = watch($pending, () => {\n resolve(!$invalid.value);\n unwatch();\n });\n });\n });\n });\n });\n /**\n * Returns a child component's results, based on registration name\n * @param {string} key\n * @return {VuelidateState}\n */\n\n\n const path = parentKey ? `${parentKey}.${key}` : key; // Sort out the validation object into:\n // – rules = validators for current state tree fragment\n // — nestedValidators = nested state fragments keys that might contain more validators\n // – config = configuration properties that affect this state fragment\n\n const {\n rules,\n nestedValidators,\n config\n } = sortValidations(validations);\n const mergedConfig = Object.assign({}, globalConfig, config); // create protected state for cases when the state branch does not exist yet.\n // This protects when using the OptionsAPI as the data is bound after the setup method\n\n const nestedState = key ? computed(() => {\n const s = unref(state);\n return s ? unref(s[key]) : undefined;\n }) : state; // cache the external results, so we can revert back to them\n\n const cachedExternalResults = Object.assign({}, unref(externalResults) || {});\n const nestedExternalResults = computed(() => {\n const results = unref(externalResults);\n if (!key) return results;\n return results ? unref(results[key]) : undefined;\n }); // Use rules for the current state fragment and validate it\n\n const results = createValidationResults(rules, nestedState, key, resultsCache, path, mergedConfig, instance, nestedExternalResults, state); // Use nested keys to repeat the process\n // *WARN*: This is recursive\n\n const nestedResults = collectNestedValidationResults(nestedValidators, nestedState, path, resultsCache, mergedConfig, instance, nestedExternalResults); // Collect and merge this level validation results\n // with all nested validation results\n\n const {\n $dirty,\n $errors,\n $invalid,\n $anyDirty,\n $error,\n $pending,\n $touch,\n $reset,\n $silentErrors,\n $commit\n } = createMetaFields(results, nestedResults, childResults);\n /**\n * If we have no `key`, this is the top level state\n * We dont need `$model` there.\n */\n\n const $model = key ? computed({\n get: () => unref(nestedState),\n set: val => {\n $dirty.value = true;\n const s = unref(state);\n const external = unref(externalResults);\n\n if (external) {\n external[key] = cachedExternalResults[key];\n }\n\n if (isRef(s[key])) {\n s[key].value = val;\n } else {\n s[key] = val;\n }\n }\n }) : null;\n\n if (key && mergedConfig.$autoDirty) {\n watch(nestedState, () => {\n if (!$dirty.value) $touch();\n const external = unref(externalResults);\n\n if (external) {\n external[key] = cachedExternalResults[key];\n }\n }, {\n flush: 'sync'\n });\n }\n\n function $getResultsForChild(key) {\n return (childResults.value || {})[key];\n }\n\n function $clearExternalResults() {\n if (isRef(externalResults)) {\n externalResults.value = cachedExternalResults;\n } else {\n // if the external results state was empty, we need to delete every property, one by one\n if (Object.keys(cachedExternalResults).length === 0) {\n Object.keys(externalResults).forEach(k => {\n delete externalResults[k];\n });\n } else {\n // state was not empty, so we just assign it back into the current state\n Object.assign(externalResults, cachedExternalResults);\n }\n }\n }\n\n return reactive(Object.assign({}, results, {\n // NOTE: The order here is very important, since we want to override\n // some of the *results* meta fields with the collective version of it\n // that includes the results of nested state validation results\n $model,\n $dirty,\n $error,\n $errors,\n $invalid,\n $anyDirty,\n $pending,\n $touch,\n $reset,\n $path: path || ROOT_PATH,\n $silentErrors,\n $validate,\n $commit\n }, childResults && {\n $getResultsForChild,\n $clearExternalResults\n }, nestedResults));\n}\n\nclass ResultsStorage {\n constructor() {\n this.storage = new Map();\n }\n /**\n * Stores a validation result, and its rules by its path\n * @param {String} path\n * @param {Object} rules\n * @param {ValidationResult} result\n */\n\n\n set(path, rules, result) {\n this.storage.set(path, {\n rules,\n result\n });\n }\n /**\n * Check if the stored `results` for the provided `path` have the same `rules` compared to 'storedRules'\n * @param {String} path\n * @param {Object} rules\n * @param {Object} storedRules\n * @return {Boolean}\n */\n\n\n checkRulesValidity(path, rules, storedRules) {\n const storedRulesKeys = Object.keys(storedRules);\n const newRulesKeys = Object.keys(rules);\n if (newRulesKeys.length !== storedRulesKeys.length) return false;\n const hasAllValidators = newRulesKeys.every(ruleKey => storedRulesKeys.includes(ruleKey));\n if (!hasAllValidators) return false;\n return newRulesKeys.every(ruleKey => {\n if (!rules[ruleKey].$params) return true;\n return Object.keys(rules[ruleKey].$params).every(paramKey => {\n // make sure to unwrap before comparing\n return unref(storedRules[ruleKey].$params[paramKey]) === unref(rules[ruleKey].$params[paramKey]);\n });\n });\n }\n /**\n * Returns the matched result if catche is valid\n * @param {String} path\n * @param {Object} rules\n * @return {{$partial: boolean, $dirty: Ref, $unwatch: function}|undefined|ValidationResult}\n */\n\n\n get(path, rules) {\n const storedRuleResultPair = this.storage.get(path);\n if (!storedRuleResultPair) return undefined;\n const {\n rules: storedRules,\n result\n } = storedRuleResultPair;\n const isValidCache = this.checkRulesValidity(path, rules, storedRules);\n const $unwatch = result.$unwatch ? result.$unwatch : () => ({});\n if (!isValidCache) return {\n $dirty: result.$dirty,\n $partial: true,\n $unwatch\n };\n return result;\n }\n\n}\n\nconst CollectFlag = {\n COLLECT_ALL: true,\n COLLECT_NONE: false\n};\nconst VuelidateInjectChildResults = Symbol('vuelidate#injectChiildResults');\nconst VuelidateRemoveChildResults = Symbol('vuelidate#removeChiildResults');\n/**\n * Create helpers to collect validation state from child components\n * @param {Object} params\n * @param {String | Number | Boolean} params.$scope - Parent component scope\n * @return {{sendValidationResultsToParent: function[], childResults: ComputedRef, removeValidationResultsFromParent: function[]}}\n */\n\nfunction nestedValidations({\n $scope,\n instance\n}) {\n const childResultsRaw = {};\n const childResultsKeys = ref([]);\n const childResults = computed(() => childResultsKeys.value.reduce((results, key) => {\n results[key] = unref(childResultsRaw[key]);\n return results;\n }, {}));\n /**\n * Allows children to send validation data up to their parent.\n * @param {Object} results - the results\n * @param {Object} args\n * @param {String} args.$registerAs - the $registeredAs key\n * @param {String | Number | Boolean} args.$scope - the $scope key\n */\n\n function injectChildResultsIntoParent(results, {\n $registerAs: key,\n $scope: childScope,\n $stopPropagation\n }) {\n if ($stopPropagation || $scope === CollectFlag.COLLECT_NONE || childScope === CollectFlag.COLLECT_NONE || $scope !== CollectFlag.COLLECT_ALL && $scope !== childScope) return;\n childResultsRaw[key] = results;\n childResultsKeys.value.push(key);\n } // combine with other `injectChildResultsIntoParent` from vuelidate instances in this Vue component instance\n\n\n instance.__vuelidateInjectInstances = [].concat(instance.__vuelidateInjectInstances || [], injectChildResultsIntoParent);\n /**\n * Allows children to remove the validation data from their parent, before getting destroyed.\n * @param {String} key - the registeredAs key\n */\n\n function removeChildResultsFromParent(key) {\n // remove the key\n childResultsKeys.value = childResultsKeys.value.filter(childKey => childKey !== key); // remove the stored data for the key\n\n delete childResultsRaw[key];\n } // combine with other `removeChildResultsFromParent` from vuelidate instances in this Vue component instance\n\n\n instance.__vuelidateRemoveInstances = [].concat(instance.__vuelidateRemoveInstances || [], removeChildResultsFromParent); // inject the `injectChildResultsIntoParent` method, into the current scope\n\n const sendValidationResultsToParent = inject(VuelidateInjectChildResults, []); // provide to all of its children the send results to parent function\n\n provide(VuelidateInjectChildResults, instance.__vuelidateInjectInstances);\n const removeValidationResultsFromParent = inject(VuelidateRemoveChildResults, []); // provide to all of its children the remove results function\n\n provide(VuelidateRemoveChildResults, instance.__vuelidateRemoveInstances);\n return {\n childResults,\n sendValidationResultsToParent,\n removeValidationResultsFromParent\n };\n}\n\n/**\n * Helper proxy for instance property access. It makes every reference\n * reactive for the validation function\n * @param target\n * @return {*|ComputedRef<*>}\n */\n\nfunction ComputedProxyFactory(target) {\n return new Proxy(target, {\n get(target, prop) {\n return typeof target[prop] === 'object' ? ComputedProxyFactory(target[prop]) : computed(() => target[prop]);\n }\n\n });\n}\n\n/**\n * @typedef GlobalConfig\n * @property {String} [$registerAs] - Config Object\n * @property {String | Number | Symbol} [$scope] - A scope to limit child component registration\n * @property {Boolean} [$stopPropagation] - Tells a Vue component to stop sending its results up to the parent\n * @property {Ref} [$externalResults] - External error messages, like from server validation.\n * @property {Boolean} [$autoDirty] - Should the form watch for state changed, and automatically set `$dirty` to true.\n * @property {Boolean} [$lazy] - Should the validations be lazy, and run only after they are dirty\n * @property {Boolean} [$rewardEarly] - Once valid, re-runs property validators only on manual calls of $commit\n */\n\n/**\n * Composition API compatible Vuelidate\n * Use inside the `setup` lifecycle hook\n * @param {Object | GlobalConfig} [validations] - Validations Object or the globalConfig.\n * @param {Object} [state] - State object - required if `validations` is a validation object.\n * @param {GlobalConfig} [globalConfig] - Config Object\n * @return {ComputedRef<*>}\n */\n\nfunction useVuelidate(validations, state, globalConfig = {}) {\n // if we pass only one argument, its most probably the globalConfig.\n // This use case is so parents can just collect results of child forms.\n if (arguments.length === 1) {\n globalConfig = validations;\n validations = undefined;\n state = undefined;\n }\n\n let {\n $registerAs,\n $scope = CollectFlag.COLLECT_ALL,\n $stopPropagation,\n $externalResults\n } = globalConfig;\n const instance = getCurrentInstance();\n const componentOptions = instance ? isVue3 ? instance.type : instance.proxy.$options : {}; // if there is no registration name, add one.\n\n if (!$registerAs && instance) {\n // NOTE:\n // ._uid // Vue 2.x Composition-API plugin\n // .uid // Vue 3.0\n const uid = instance.uid || instance._uid;\n $registerAs = `_vuelidate_${uid}`;\n }\n\n const validationResults = ref({});\n const resultsCache = new ResultsStorage();\n const {\n childResults,\n sendValidationResultsToParent,\n removeValidationResultsFromParent\n } = instance ? nestedValidations({\n $scope,\n instance\n }) : {\n childResults: ref({})\n }; // Options API\n\n if (!validations && componentOptions.validations) {\n const rules = componentOptions.validations;\n state = ref({});\n onBeforeMount(() => {\n // Delay binding state to validations defined with the Options API until mounting, when the data\n // has been attached to the component instance. From that point on it will be reactive.\n state.value = instance.proxy;\n watch(() => isFunction(rules) ? rules.call(state.value, new ComputedProxyFactory(state.value)) : rules, validations => {\n validationResults.value = setValidations({\n validations,\n state,\n childResults,\n resultsCache,\n globalConfig,\n instance: instance.proxy,\n externalResults: $externalResults || instance.proxy.vuelidateExternalResults\n });\n }, {\n immediate: true\n });\n });\n globalConfig = componentOptions.validationsConfig || globalConfig;\n } else {\n const validationsWatchTarget = isRef(validations) || isProxy(validations) ? validations // wrap plain objects in a reactive, so we can track changes if they have computed in them.\n : reactive(validations || {});\n watch(validationsWatchTarget, newValidationRules => {\n validationResults.value = setValidations({\n validations: newValidationRules,\n state,\n childResults,\n resultsCache,\n globalConfig,\n instance: instance ? instance.proxy : {},\n externalResults: $externalResults\n });\n }, {\n immediate: true\n });\n }\n\n if (instance) {\n // send all the data to the parent when the function is invoked inside setup.\n sendValidationResultsToParent.forEach(f => f(validationResults, {\n $registerAs,\n $scope,\n $stopPropagation\n })); // before this component is destroyed, remove all the data from the parent.\n\n onBeforeUnmount(() => removeValidationResultsFromParent.forEach(f => f($registerAs)));\n }\n\n return computed(() => {\n return Object.assign({}, unref(validationResults.value), childResults.value);\n });\n}\n\nexport { CollectFlag, useVuelidate as default, useVuelidate };\n","import { unref } from 'vue-demi';\n\nfunction isFunction(val) {\n return typeof val === 'function';\n}\nfunction isObject(o) {\n return o !== null && typeof o === 'object' && !Array.isArray(o);\n}\n/**\n * Returns a standard ValidatorObject\n * Wraps a plain function into a ValidatorObject\n * @param {NormalizedValidator|Function} validator\n * @return {NormalizedValidator}\n */\n\nfunction normalizeValidatorObject(validator) {\n return isFunction(validator.$validator) ? Object.assign({}, validator) : {\n $validator: validator\n };\n}\nfunction isPromise(object) {\n return isObject(object) && isFunction(object.then);\n}\n/**\n * Unwraps a ValidatorResponse object, into a boolean.\n * @param {ValidatorResponse} result\n * @return {boolean}\n */\n\nfunction unwrapValidatorResponse(result) {\n if (typeof result === 'object') return result.$valid;\n return result;\n}\n/**\n * Unwraps a `NormalizedValidator` object, returning its validator function.\n * @param {NormalizedValidator | Function} validator\n * @return {function}\n */\n\nfunction unwrapNormalizedValidator(validator) {\n return validator.$validator || validator;\n}\n\n/**\n * Allows attaching parameters to a validator\n * @param {Object} $params\n * @param {NormalizedValidator|Function} $validator\n * @return {NormalizedValidator}\n */\n\nfunction withParams($params, $validator) {\n if (!isObject($params)) throw new Error(`[@vuelidate/validators]: First parameter to \"withParams\" should be an object, provided ${typeof $params}`);\n if (!isObject($validator) && !isFunction($validator)) throw new Error(`[@vuelidate/validators]: Validator must be a function or object with $validator parameter`);\n const validatorObj = normalizeValidatorObject($validator);\n validatorObj.$params = Object.assign({}, validatorObj.$params || {}, $params);\n return validatorObj;\n}\n\n/**\n * @callback MessageCallback\n * @param {Object} params\n * @return String\n */\n\n/**\n * Attaches a message to a validator\n * @param {MessageCallback | String} $message\n * @param {NormalizedValidator|Function} $validator\n * @return {NormalizedValidator}\n */\n\nfunction withMessage($message, $validator) {\n if (!isFunction($message) && typeof unref($message) !== 'string') throw new Error(`[@vuelidate/validators]: First parameter to \"withMessage\" should be string or a function returning a string, provided ${typeof $message}`);\n if (!isObject($validator) && !isFunction($validator)) throw new Error(`[@vuelidate/validators]: Validator must be a function or object with $validator parameter`);\n const validatorObj = normalizeValidatorObject($validator);\n validatorObj.$message = $message;\n return validatorObj;\n}\n\n/**\n * @typedef {function(*): Promise} asyncValidator\n */\n\n/**\n * @typedef {Ref<*>[]|function(*): *} watchTargets\n */\n\n/**\n * Wraps validators that returns a Promise.\n * @param {asyncValidator} $validator\n * @param {watchTargets} $watchTargets\n * @return {{$async: boolean, $validator: asyncValidator, $watchTargets: watchTargets}}\n */\n\nfunction withAsync($validator, $watchTargets = []) {\n const validatorObj = normalizeValidatorObject($validator);\n return Object.assign({}, validatorObj, {\n $async: true,\n $watchTargets\n });\n}\n\nfunction forEach(validators) {\n return {\n $validator(collection, ...others) {\n // go over the collection. It can be a ref as well.\n return unref(collection).reduce((previous, collectionItem) => {\n // go over each property\n const collectionEntryResult = Object.entries(collectionItem).reduce((all, [property, $model]) => {\n // get the validators for this property\n const innerValidators = validators[property] || {}; // go over each validator and run it\n\n const propertyResult = Object.entries(innerValidators).reduce((all, [validatorName, currentValidator]) => {\n // extract the validator. Supports simple and extended validators.\n const validatorFunction = unwrapNormalizedValidator(currentValidator); // Call the validator, passing the VM as this, the value, current iterated object and the rest.\n\n const $response = validatorFunction.call(this, $model, collectionItem, ...others); // extract the valid from the result\n\n const $valid = unwrapValidatorResponse($response); // store the entire response for later\n\n all.$data[validatorName] = $response;\n all.$data.$invalid = !$valid || !!all.$data.$invalid;\n all.$data.$error = all.$data.$invalid; // if not valid, get the $message\n\n if (!$valid) {\n let $message = currentValidator.$message || '';\n const $params = currentValidator.$params || {}; // If $message is a function, we call it with the appropriate parameters\n\n if (typeof $message === 'function') {\n $message = $message({\n $pending: false,\n $invalid: !$valid,\n $params,\n $model,\n $response\n });\n } // save the error object\n\n\n all.$errors.push({\n $property: property,\n $message,\n $params,\n $response,\n $model,\n $pending: false,\n $validator: validatorName\n });\n }\n\n return {\n $valid: all.$valid && $valid,\n $data: all.$data,\n $errors: all.$errors\n };\n }, {\n $valid: true,\n $data: {},\n $errors: []\n });\n all.$data[property] = propertyResult.$data;\n all.$errors[property] = propertyResult.$errors;\n return {\n $valid: all.$valid && propertyResult.$valid,\n $data: all.$data,\n $errors: all.$errors\n };\n }, {\n $valid: true,\n $data: {},\n $errors: {}\n });\n return {\n $valid: previous.$valid && collectionEntryResult.$valid,\n $data: previous.$data.concat(collectionEntryResult.$data),\n $errors: previous.$errors.concat(collectionEntryResult.$errors)\n };\n }, {\n $valid: true,\n $data: [],\n $errors: []\n });\n },\n\n // collect all the validation errors into a 2 dimensional array, for each entry in the collection, you have an array of error messages.\n $message: ({\n $response\n }) => $response ? $response.$errors.map(context => {\n return Object.values(context).map(errors => errors.map(error => error.$message)).reduce((a, b) => a.concat(b), []);\n }) : []\n };\n}\n\n// \"required\" core, used in almost every validator to allow empty values\nconst req = value => {\n value = unref(value);\n if (Array.isArray(value)) return !!value.length;\n\n if (value === undefined || value === null) {\n return false;\n }\n\n if (value === false) {\n return true;\n }\n\n if (value instanceof Date) {\n // invalid date won't pass\n return !isNaN(value.getTime());\n }\n\n if (typeof value === 'object') {\n for (let _ in value) return true;\n\n return false;\n }\n\n return !!String(value).length;\n};\n/**\n * Returns the length of an arbitrary value\n * @param {Array|Object|String} value\n * @return {number}\n */\n\nconst len = value => {\n value = unref(value);\n if (Array.isArray(value)) return value.length;\n\n if (typeof value === 'object') {\n return Object.keys(value).length;\n }\n\n return String(value).length;\n};\n/**\n * Regex based validator template\n * @param {RegExp} expr\n * @return {function(*=): boolean}\n */\n\nfunction regex(expr) {\n return value => {\n value = unref(value);\n return !req(value) || expr.test(value);\n };\n}\n\nvar common = /*#__PURE__*/Object.freeze({\n __proto__: null,\n withParams: withParams,\n withMessage: withMessage,\n withAsync: withAsync,\n forEach: forEach,\n req: req,\n len: len,\n regex: regex,\n unwrap: unref,\n unwrapNormalizedValidator: unwrapNormalizedValidator,\n unwrapValidatorResponse: unwrapValidatorResponse,\n normalizeValidatorObject: normalizeValidatorObject\n});\n\nvar alpha$1 = regex(/^[a-zA-Z]*$/);\n\n/**\n * Validate if value is alphabetical string.\n * @type {NormalizedValidator}\n */\n\nvar alpha = {\n $validator: alpha$1,\n $message: 'The value is not alphabetical',\n $params: {\n type: 'alpha'\n }\n};\n\nvar alphaNum$1 = regex(/^[a-zA-Z0-9]*$/);\n\n/**\n * Validate if value is alpha-numeric string.\n * @type {NormalizedValidator}\n */\n\nvar alphaNum = {\n $validator: alphaNum$1,\n $message: 'The value must be alpha-numeric',\n $params: {\n type: 'alphaNum'\n }\n};\n\nvar numeric$1 = regex(/^\\d*(\\.\\d+)?$/);\n\n/**\n * Check whether a value is numeric.\n * @type NormalizedValidator\n */\n\nvar numeric = {\n $validator: numeric$1,\n $message: 'Value must be numeric',\n $params: {\n type: 'numeric'\n }\n};\n\n/**\n * Check if a numeric value is between two values.\n * @param {Ref | Number} min\n * @param {Ref | Number} max\n * @return {function(*=): boolean}\n */\n\nfunction between$1 (min, max) {\n return value => !req(value) || (!/\\s/.test(value) || value instanceof Date) && +unref(min) <= +value && +unref(max) >= +value;\n}\n\n/**\n * Checks if a value is between two values.\n * @param {Ref | Number} min\n * @param {Ref | Number} max\n * @return {NormalizedValidator}\n */\n\nfunction between (min, max) {\n return {\n $validator: between$1(min, max),\n $message: ({\n $params\n }) => `The value must be between ${$params.min} and ${$params.max}`,\n $params: {\n min,\n max,\n type: 'between'\n }\n };\n}\n\nconst emailRegex = /^(?:[A-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[A-z0-9!#$%&'*+/=?^_`{|}~-]+)*|\"(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21\\x23-\\x5b\\x5d-\\x7f]|[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])*\")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9]{2,}(?:[a-z0-9-]*[a-z0-9])?|\\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21-\\x5a\\x53-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])+)\\])$/i;\nvar email$1 = regex(emailRegex);\n\n/**\n * Validate if value is an email.\n * @type {NormalizedValidator}\n */\n\nvar email = {\n $validator: email$1,\n $message: 'Value is not a valid email address',\n $params: {\n type: 'email'\n }\n};\n\n/**\n * Check if a string is an IP Address\n * @param {String} value\n * @returns {boolean}\n */\n\nfunction ipAddress$1 (value) {\n if (!req(value)) {\n return true;\n }\n\n if (typeof value !== 'string') {\n return false;\n }\n\n const nibbles = value.split('.');\n return nibbles.length === 4 && nibbles.every(nibbleValid);\n}\n\nconst nibbleValid = nibble => {\n if (nibble.length > 3 || nibble.length === 0) {\n return false;\n }\n\n if (nibble[0] === '0' && nibble !== '0') {\n return false;\n }\n\n if (!nibble.match(/^\\d+$/)) {\n return false;\n }\n\n const numeric = +nibble | 0;\n return numeric >= 0 && numeric <= 255;\n};\n\n/**\n * Validate if value is an ipAddress string.\n * @type {NormalizedValidator}\n */\n\nvar ipAddress = {\n $validator: ipAddress$1,\n $message: 'The value is not a valid IP address',\n $params: {\n type: 'ipAddress'\n }\n};\n\n/**\n * Check if value is a properly formatted Mac Address.\n * @param {String | Ref} [separator]\n * @returns {function(*): boolean}\n */\n\nfunction macAddress$1 (separator = ':') {\n return value => {\n separator = unref(separator);\n\n if (!req(value)) {\n return true;\n }\n\n if (typeof value !== 'string') {\n return false;\n }\n\n const parts = typeof separator === 'string' && separator !== '' ? value.split(separator) : value.length === 12 || value.length === 16 ? value.match(/.{2}/g) : null;\n return parts !== null && (parts.length === 6 || parts.length === 8) && parts.every(hexValid);\n };\n}\n\nconst hexValid = hex => hex.toLowerCase().match(/^[0-9a-f]{2}$/);\n\n/**\n * Validate if value is a valid Mac Address string.\n * @returns {NormalizedValidator}\n */\n\nfunction macAddress (separator) {\n return {\n $validator: macAddress$1(separator),\n $message: 'The value is not a valid MAC Address',\n $params: {\n type: 'macAddress'\n }\n };\n}\n\n/**\n * Check if provided value has a maximum length\n * @param {Number | Ref} length\n * @returns {function(Array|Object|String): boolean}\n */\n\nfunction maxLength$1 (length) {\n return value => !req(value) || len(value) <= unref(length);\n}\n\n/**\n * Validate the max length of a string.\n * @param {Number} max\n * @return {NormalizedValidator}\n */\n\nfunction maxLength (max) {\n return {\n $validator: maxLength$1(max),\n $message: ({\n $params\n }) => `The maximum length allowed is ${$params.max}`,\n $params: {\n max,\n type: 'maxLength'\n }\n };\n}\n\n/**\n * Check if value is above a threshold.\n * @param {Number | Ref} length\n * @returns {function(Array|Object|String): boolean}\n */\n\nfunction minLength$1 (length) {\n return value => !req(value) || len(value) >= unref(length);\n}\n\n/**\n * Check if value is above a threshold.\n * @param {Number | Ref} min\n * @returns {NormalizedValidator}\n */\n\nfunction minLength (min) {\n return {\n $validator: minLength$1(min),\n $message: ({\n $params\n }) => `This field should be at least ${$params.min} long`,\n $params: {\n min,\n type: 'minLength'\n }\n };\n}\n\n/**\n * Validates if a value is empty.\n * @param {String | Array | Date | Object} value\n * @returns {boolean}\n */\n\nfunction required$1 (value) {\n if (typeof value === 'string') {\n value = value.trim();\n }\n\n return req(value);\n}\n\n/**\n * Check if a value is empty or not.\n * @type {NormalizedValidator}\n */\n\nvar required = {\n $validator: required$1,\n $message: 'Value is required',\n $params: {\n type: 'required'\n }\n};\n\nconst validate$1 = (prop, val) => prop ? req(val) : true;\n/**\n * Returns required if the passed property is truthy\n * @param {Boolean | String | function(any): Boolean | Ref} propOrFunction\n * @return {function(value: *, parentVM: object): Boolean}\n */\n\n\nfunction requiredIf$1(propOrFunction) {\n return function (value, parentVM) {\n if (typeof propOrFunction !== 'function') {\n return validate$1(unref(propOrFunction), value);\n }\n\n const result = propOrFunction.call(this, value, parentVM);\n return validate$1(result, value);\n };\n}\n\n/**\n * Returns required if the passed property is truthy\n * @param {Boolean | String | function(): (Boolean | Promise)} prop\n * @return {NormalizedValidator}\n */\n\nfunction requiredIf (prop) {\n return {\n $validator: requiredIf$1(prop),\n $message: 'The value is required',\n $params: {\n type: 'requiredIf',\n prop\n }\n };\n}\n\nconst validate = (prop, val) => !prop ? req(val) : true;\n/**\n * Returns required if the passed property is falsy.\n * @param {Boolean | String | function(any): Boolean | Ref} propOrFunction\n * @return {function(value: *, parentVM: object): Boolean}\n */\n\n\nfunction requiredUnless$1(propOrFunction) {\n return function (value, parentVM) {\n if (typeof propOrFunction !== 'function') {\n return validate(unref(propOrFunction), value);\n }\n\n const result = propOrFunction.call(this, value, parentVM);\n return validate(result, value);\n };\n}\n\n/**\n * Returns required unless the passed property is truthy\n * @param {Boolean | String | function(): (Boolean | Promise)} prop\n * @return {NormalizedValidator}\n */\n\nfunction requiredUnless (prop) {\n return {\n $validator: requiredUnless$1(prop),\n $message: 'The value is required',\n $params: {\n type: 'requiredUnless',\n prop\n }\n };\n}\n\n/**\n * Check if two values are identical.\n * @param {*} equalTo\n * @return {function(*=): boolean}\n */\n\nfunction sameAs$1 (equalTo) {\n return value => unref(value) === unref(equalTo);\n}\n\n/**\n * Check if two values are identical\n * @param {*} equalTo\n * @param {String} [otherName]\n * @return {NormalizedValidator}\n */\n\nfunction sameAs (equalTo, otherName = 'other') {\n return {\n $validator: sameAs$1(equalTo),\n $message: ({\n $params\n }) => `The value must be equal to the ${otherName} value`,\n $params: {\n equalTo,\n otherName,\n type: 'sameAs'\n }\n };\n}\n\n/**\n * Regex taken from {@link https://gist.github.com/dperini/729294}\n */\n\nconst urlRegex = /^(?:(?:(?:https?|ftp):)?\\/\\/)(?:\\S+(?::\\S*)?@)?(?:(?!(?:10|127)(?:\\.\\d{1,3}){3})(?!(?:169\\.254|192\\.168)(?:\\.\\d{1,3}){2})(?!172\\.(?:1[6-9]|2\\d|3[0-1])(?:\\.\\d{1,3}){2})(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z0-9\\u00a1-\\uffff][a-z0-9\\u00a1-\\uffff_-]{0,62})?[a-z0-9\\u00a1-\\uffff]\\.)+(?:[a-z\\u00a1-\\uffff]{2,}\\.?))(?::\\d{2,5})?(?:[/?#]\\S*)?$/i;\nvar url$1 = regex(urlRegex);\n\n/**\n * Check if a value is a url\n * @type {NormalizedValidator}\n */\n\nvar url = {\n $validator: url$1,\n $message: 'The value is not a valid URL address',\n $params: {\n type: 'url'\n }\n};\n\nfunction _await$1(value, then, direct) {\n if (direct) {\n return then ? then(value) : value;\n }\n\n if (!value || !value.then) {\n value = Promise.resolve(value);\n }\n\n return then ? value.then(then) : value;\n}\n\nfunction syncOr(validators) {\n return function (...args) {\n return validators.reduce((valid, fn) => {\n if (unwrapValidatorResponse(valid)) return valid;\n return unwrapNormalizedValidator(fn).apply(this, args);\n }, false);\n };\n}\n\nfunction asyncOr(validators) {\n return function (...args) {\n const _this = this;\n\n return validators.reduce(function (valid, fn) {\n return _await$1(valid, function (r) {\n return unwrapValidatorResponse(r) ? r : unwrapNormalizedValidator(fn).apply(_this, args);\n });\n }, Promise.resolve(false));\n };\n}\n/**\n * Returns true when one of the provided functions returns true.\n * @param {...(NormalizedValidator|Function)} validators\n * @return {{$validator: function(...[*]=): (boolean | Promise), $async: boolean, $watchTargets: any[]}}\n */\n\n\nfunction or$1(...validators) {\n const $async = validators.some(v => v.$async);\n const $watchTargets = validators.reduce((all, v) => {\n if (!v.$watchTargets) return all;\n return all.concat(v.$watchTargets);\n }, []);\n\n let $validator = () => false;\n\n if (validators.length) $validator = $async ? asyncOr(validators) : syncOr(validators);\n return {\n $async,\n $validator,\n $watchTargets\n };\n}\n\n/**\n * Returns true when one of the provided functions returns true.\n * @param {...(NormalizedValidator|Function)} validators\n * @return {NormalizedValidator}\n */\n\nfunction or (...validators) {\n return withParams({\n type: 'or'\n }, withMessage('The value does not match any of the provided validators', or$1(...validators)));\n}\n\nfunction _await(value, then, direct) {\n if (direct) {\n return then ? then(value) : value;\n }\n\n if (!value || !value.then) {\n value = Promise.resolve(value);\n }\n\n return then ? value.then(then) : value;\n}\n/**\n *\n * @param validators\n * @return {function(...[*]=): Promise}\n */\n\n\nfunction syncAnd(validators) {\n return function (...args) {\n return validators.reduce((valid, fn) => {\n if (!unwrapValidatorResponse(valid)) return valid;\n return unwrapNormalizedValidator(fn).apply(this, args);\n }, true);\n };\n}\n\nfunction asyncAnd(validators) {\n return function (...args) {\n const _this = this;\n\n return validators.reduce(function (valid, fn) {\n return _await(valid, function (r) {\n return unwrapValidatorResponse(r) ? unwrapNormalizedValidator(fn).apply(_this, args) : r;\n });\n }, Promise.resolve(true));\n };\n}\n/**\n * Returns true when all validators are truthy\n * @param {...(NormalizedValidator | Function)} validators\n * @return {{$validator: function(...[*]=): (boolean | Promise), $async: boolean, $watchTargets: any[]}}\n */\n\n\nfunction and$1(...validators) {\n const $async = validators.some(v => v.$async);\n const $watchTargets = validators.reduce((all, v) => {\n if (!v.$watchTargets) return all;\n return all.concat(v.$watchTargets);\n }, []);\n\n let $validator = () => false;\n\n if (validators.length) $validator = $async ? asyncAnd(validators) : syncAnd(validators);\n return {\n $async,\n $validator,\n $watchTargets\n };\n}\n\n/**\n * Validate if all validators match.\n * @param {...*} validators\n * @returns {NormalizedValidator}\n */\n\nfunction and (...validators) {\n return withParams({\n type: 'and'\n }, withMessage('The value does not match all of the provided validators', and$1(...validators)));\n}\n\n/**\n * Swaps the result of a value\n * @param {NormalizedValidator|Function} validator\n * @returns {function(*=, *=): boolean}\n */\n\nfunction not$1 (validator) {\n return function (value, vm) {\n if (!req(value)) return true;\n const response = unwrapNormalizedValidator(validator).call(this, value, vm);\n if (!isPromise(response)) return !unwrapValidatorResponse(response);\n return response.then(r => !unwrapValidatorResponse(r));\n };\n}\n\n/**\n * Swaps the result of a value\n * @param {NormalizedValidator|Function} validator\n * @returns {NormalizedValidator}\n */\n\nfunction not (validator) {\n return {\n $validator: not$1(validator),\n $message: `The value does not match the provided validator`,\n $params: {\n type: 'not'\n }\n };\n}\n\n/**\n * Check if a value is above a threshold.\n * @param {String | Number | Ref | Ref} min\n * @returns {function(*=): boolean}\n */\n\nfunction minValue$1 (min) {\n return value => !req(value) || (!/\\s/.test(value) || value instanceof Date) && +value >= +unref(min);\n}\n\n/**\n * Check if a value is above a threshold.\n * @param {String | Number | Ref | Ref} min\n * @returns {NormalizedValidator}\n */\n\nfunction minValue (min) {\n return {\n $validator: minValue$1(min),\n $message: ({\n $params\n }) => `The minimum value allowed is ${$params.min}`,\n $params: {\n min,\n type: 'minValue'\n }\n };\n}\n\n/**\n * Check if value is below a threshold.\n * @param {Number | Ref | Ref} max\n * @returns {function(*=): boolean}\n */\n\nfunction maxValue$1 (max) {\n return value => !req(value) || (!/\\s/.test(value) || value instanceof Date) && +value <= +unref(max);\n}\n\n/**\n * Check if value is below a threshold.\n * @param {Number | Ref | Ref} max\n * @return {NormalizedValidator}\n */\n\nvar maxValue = (max => ({\n $validator: maxValue$1(max),\n $message: ({\n $params\n }) => `The maximum value is ${$params.max}`,\n $params: {\n max,\n type: 'maxValue'\n }\n}));\n\n// ^-[0-9]+$ - only for negative integer (minus sign without at least 1 digit is not a number)\n\nvar integer$1 = regex(/(^[0-9]*$)|(^-[0-9]+$)/);\n\n/**\n * Validate if value is integer.\n * @type {NormalizedValidator}\n */\n\nvar integer = {\n $validator: integer$1,\n $message: 'Value is not an integer',\n $params: {\n type: 'integer'\n }\n};\n\nvar decimal$1 = regex(/^[-]?\\d*(\\.\\d+)?$/);\n\n/**\n * Validate if value is decimal number.\n * @type {NormalizedValidator}\n */\n\nvar decimal = {\n $validator: decimal$1,\n $message: 'Value must be decimal',\n $params: {\n type: 'decimal'\n }\n};\n\n/**\n * Creates a translatable version of `withMessage` helper.\n * @param {function} t - the translation function of your choice\n * @param {function} [messagePath] - a function to generate the message path, passed to `t` for each message. By default it is `validations.${$validator}`\n * @param {function} [messageParams] - a function to augment the params, passed to `t` for each message.\n */\n\nfunction createI18nMessage({\n t,\n messagePath = ({\n $validator\n }) => `validations.${$validator}`,\n messageParams = params => params\n}) {\n return function withI18nMessage(validator, {\n withArguments = false,\n messagePath: localMessagePath = messagePath,\n messageParams: localMessageParams = messageParams\n } = {}) {\n function message(props) {\n return t(localMessagePath(props), localMessageParams(Object.assign({\n model: props.$model,\n property: props.$property,\n pending: props.$pending,\n invalid: props.$invalid,\n response: props.$response,\n validator: props.$validator,\n propertyPath: props.$propertyPath\n }, props.$params)));\n }\n\n if (withArguments && typeof validator === 'function') {\n return (...args) => withMessage(message, validator(...args));\n }\n\n return withMessage(message, validator);\n };\n}\n\nexport { alpha, alphaNum, and, between, createI18nMessage, decimal, email, common as helpers, integer, ipAddress, macAddress, maxLength, maxValue, minLength, minValue, not, numeric, or, required, requiredIf, requiredUnless, sameAs, url };\n"],"sourceRoot":""}