@splitty-test/validation 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +3 -33
- package/dist/FieldValidation.vue.d.ts +54 -0
- package/dist/FieldValidatorClass.d.ts +22 -0
- package/dist/ValidatorClass.d.ts +24 -0
- package/{lib/index.ts → dist/index.d.ts} +1 -2
- package/dist/index.mjs +1994 -0
- package/dist/index.umd.js +1 -0
- package/dist/rules/index.d.ts +2 -0
- package/dist/rules/match.d.ts +1 -0
- package/package.json +15 -15
- package/vite.config.ts +9 -8
- package/.editorconfig +0 -8
- package/.vscode/extensions.json +0 -8
- package/lib/FieldValidation.vue +0 -96
- package/lib/FieldValidatorClass.ts +0 -96
- package/lib/ValidatorClass.ts +0 -106
- package/lib/rules/index.ts +0 -0
- package/lib/rules/match.ts +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(I,$){typeof exports=="object"&&typeof module<"u"?$(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],$):(I=typeof globalThis<"u"?globalThis:I||self,$(I.Validation={},I.Vue))})(this,(function(I,$){"use strict";var Yr=typeof global=="object"&&global&&global.Object===Object&&global,mi=typeof self=="object"&&self&&self.Object===Object&&self,M=Yr||mi||Function("return this")(),U=M.Symbol,Xr=Object.prototype,_i=Xr.hasOwnProperty,Oi=Xr.toString,Z=U?U.toStringTag:void 0;function Ti(e){var r=_i.call(e,Z),t=e[Z];try{e[Z]=void 0;var n=!0}catch{}var i=Oi.call(e);return n&&(r?e[Z]=t:delete e[Z]),i}var wi=Object.prototype,Si=wi.toString;function Ei(e){return Si.call(e)}var Pi="[object Null]",qi="[object Undefined]",Zr=U?U.toStringTag:void 0;function H(e){return e==null?e===void 0?qi:Pi:Zr&&Zr in Object(e)?Ti(e):Ei(e)}function Y(e){return e!=null&&typeof e=="object"}var Ii="[object Symbol]";function pe(e){return typeof e=="symbol"||Y(e)&&H(e)==Ii}function Ri(e,r){for(var t=-1,n=e==null?0:e.length,i=Array(n);++t<n;)i[t]=r(e[t],t,e);return i}var F=Array.isArray,Jr=U?U.prototype:void 0,et=Jr?Jr.toString:void 0;function rt(e){if(typeof e=="string")return e;if(F(e))return Ri(e,rt)+"";if(pe(e))return et?et.call(e):"";var r=e+"";return r=="0"&&1/e==-1/0?"-0":r}function ae(e){var r=typeof e;return e!=null&&(r=="object"||r=="function")}function tt(e){return e}var Ai="[object AsyncFunction]",ji="[object Function]",Ci="[object GeneratorFunction]",$i="[object Proxy]";function nt(e){if(!ae(e))return!1;var r=H(e);return r==ji||r==Ci||r==Ai||r==$i}var ye=M["__core-js_shared__"],it=(function(){var e=/[^.]+$/.exec(ye&&ye.keys&&ye.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""})();function Di(e){return!!it&&it in e}var Mi=Function.prototype,Fi=Mi.toString;function V(e){if(e!=null){try{return Fi.call(e)}catch{}try{return e+""}catch{}}return""}var Ni=/[\\^$.*+?()[\]{}|]/g,Li=/^\[object .+?Constructor\]$/,xi=Function.prototype,Bi=Object.prototype,Ui=xi.toString,Gi=Bi.hasOwnProperty,ki=RegExp("^"+Ui.call(Gi).replace(Ni,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Vi(e){if(!ae(e)||Di(e))return!1;var r=nt(e)?ki:Li;return r.test(V(e))}function zi(e,r){return e?.[r]}function X(e,r){var t=zi(e,r);return Vi(t)?t:void 0}var ge=X(M,"WeakMap"),Wi=9007199254740991,Qi=/^(?:0|[1-9]\d*)$/;function be(e,r){var t=typeof e;return r=r??Wi,!!r&&(t=="number"||t!="symbol"&&Qi.test(e))&&e>-1&&e%1==0&&e<r}function at(e,r){return e===r||e!==e&&r!==r}var Ki=9007199254740991;function me(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Ki}function ot(e){return e!=null&&me(e.length)&&!nt(e)}var Hi=Object.prototype;function ut(e){var r=e&&e.constructor,t=typeof r=="function"&&r.prototype||Hi;return e===t}function Yi(e,r){for(var t=-1,n=Array(e);++t<e;)n[t]=r(t);return n}var Xi="[object Arguments]";function st(e){return Y(e)&&H(e)==Xi}var lt=Object.prototype,Zi=lt.hasOwnProperty,Ji=lt.propertyIsEnumerable,ct=st((function(){return arguments})())?st:function(e){return Y(e)&&Zi.call(e,"callee")&&!Ji.call(e,"callee")};function ea(){return!1}var ft=typeof I=="object"&&I&&!I.nodeType&&I,dt=ft&&typeof module=="object"&&module&&!module.nodeType&&module,ra=dt&&dt.exports===ft,vt=ra?M.Buffer:void 0,ta=vt?vt.isBuffer:void 0,_e=ta||ea,na="[object Arguments]",ia="[object Array]",aa="[object Boolean]",oa="[object Date]",ua="[object Error]",sa="[object Function]",la="[object Map]",ca="[object Number]",fa="[object Object]",da="[object RegExp]",va="[object Set]",ha="[object String]",pa="[object WeakMap]",ya="[object ArrayBuffer]",ga="[object DataView]",ba="[object Float32Array]",ma="[object Float64Array]",_a="[object Int8Array]",Oa="[object Int16Array]",Ta="[object Int32Array]",wa="[object Uint8Array]",Sa="[object Uint8ClampedArray]",Ea="[object Uint16Array]",Pa="[object Uint32Array]",_={};_[ba]=_[ma]=_[_a]=_[Oa]=_[Ta]=_[wa]=_[Sa]=_[Ea]=_[Pa]=!0,_[na]=_[ia]=_[ya]=_[aa]=_[ga]=_[oa]=_[ua]=_[sa]=_[la]=_[ca]=_[fa]=_[da]=_[va]=_[ha]=_[pa]=!1;function qa(e){return Y(e)&&me(e.length)&&!!_[H(e)]}function Ia(e){return function(r){return e(r)}}var ht=typeof I=="object"&&I&&!I.nodeType&&I,J=ht&&typeof module=="object"&&module&&!module.nodeType&&module,Ra=J&&J.exports===ht,Oe=Ra&&Yr.process,pt=(function(){try{var e=J&&J.require&&J.require("util").types;return e||Oe&&Oe.binding&&Oe.binding("util")}catch{}})(),yt=pt&&pt.isTypedArray,gt=yt?Ia(yt):qa,Aa=Object.prototype,ja=Aa.hasOwnProperty;function bt(e,r){var t=F(e),n=!t&&ct(e),i=!t&&!n&&_e(e),a=!t&&!n&&!i&>(e),o=t||n||i||a,u=o?Yi(e.length,String):[],l=u.length;for(var s in e)(r||ja.call(e,s))&&!(o&&(s=="length"||i&&(s=="offset"||s=="parent")||a&&(s=="buffer"||s=="byteLength"||s=="byteOffset")||be(s,l)))&&u.push(s);return u}function Ca(e,r){return function(t){return e(r(t))}}var $a=Ca(Object.keys,Object),Da=Object.prototype,Ma=Da.hasOwnProperty;function Fa(e){if(!ut(e))return $a(e);var r=[];for(var t in Object(e))Ma.call(e,t)&&t!="constructor"&&r.push(t);return r}function mt(e){return ot(e)?bt(e):Fa(e)}function Na(e){var r=[];if(e!=null)for(var t in Object(e))r.push(t);return r}var La=Object.prototype,xa=La.hasOwnProperty;function Ba(e){if(!ae(e))return Na(e);var r=ut(e),t=[];for(var n in e)n=="constructor"&&(r||!xa.call(e,n))||t.push(n);return t}function Ua(e){return ot(e)?bt(e,!0):Ba(e)}var Ga=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ka=/^\w*$/;function Te(e,r){if(F(e))return!1;var t=typeof e;return t=="number"||t=="symbol"||t=="boolean"||e==null||pe(e)?!0:ka.test(e)||!Ga.test(e)||r!=null&&e in Object(r)}var ee=X(Object,"create");function Va(){this.__data__=ee?ee(null):{},this.size=0}function za(e){var r=this.has(e)&&delete this.__data__[e];return this.size-=r?1:0,r}var Wa="__lodash_hash_undefined__",Qa=Object.prototype,Ka=Qa.hasOwnProperty;function Ha(e){var r=this.__data__;if(ee){var t=r[e];return t===Wa?void 0:t}return Ka.call(r,e)?r[e]:void 0}var Ya=Object.prototype,Xa=Ya.hasOwnProperty;function Za(e){var r=this.__data__;return ee?r[e]!==void 0:Xa.call(r,e)}var Ja="__lodash_hash_undefined__";function eo(e,r){var t=this.__data__;return this.size+=this.has(e)?0:1,t[e]=ee&&r===void 0?Ja:r,this}function z(e){var r=-1,t=e==null?0:e.length;for(this.clear();++r<t;){var n=e[r];this.set(n[0],n[1])}}z.prototype.clear=Va,z.prototype.delete=za,z.prototype.get=Ha,z.prototype.has=Za,z.prototype.set=eo;function ro(){this.__data__=[],this.size=0}function oe(e,r){for(var t=e.length;t--;)if(at(e[t][0],r))return t;return-1}var to=Array.prototype,no=to.splice;function io(e){var r=this.__data__,t=oe(r,e);if(t<0)return!1;var n=r.length-1;return t==n?r.pop():no.call(r,t,1),--this.size,!0}function ao(e){var r=this.__data__,t=oe(r,e);return t<0?void 0:r[t][1]}function oo(e){return oe(this.__data__,e)>-1}function uo(e,r){var t=this.__data__,n=oe(t,e);return n<0?(++this.size,t.push([e,r])):t[n][1]=r,this}function N(e){var r=-1,t=e==null?0:e.length;for(this.clear();++r<t;){var n=e[r];this.set(n[0],n[1])}}N.prototype.clear=ro,N.prototype.delete=io,N.prototype.get=ao,N.prototype.has=oo,N.prototype.set=uo;var re=X(M,"Map");function so(){this.size=0,this.__data__={hash:new z,map:new(re||N),string:new z}}function lo(e){var r=typeof e;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?e!=="__proto__":e===null}function ue(e,r){var t=e.__data__;return lo(r)?t[typeof r=="string"?"string":"hash"]:t.map}function co(e){var r=ue(this,e).delete(e);return this.size-=r?1:0,r}function fo(e){return ue(this,e).get(e)}function vo(e){return ue(this,e).has(e)}function ho(e,r){var t=ue(this,e),n=t.size;return t.set(e,r),this.size+=t.size==n?0:1,this}function L(e){var r=-1,t=e==null?0:e.length;for(this.clear();++r<t;){var n=e[r];this.set(n[0],n[1])}}L.prototype.clear=so,L.prototype.delete=co,L.prototype.get=fo,L.prototype.has=vo,L.prototype.set=ho;var po="Expected a function";function we(e,r){if(typeof e!="function"||r!=null&&typeof r!="function")throw new TypeError(po);var t=function(){var n=arguments,i=r?r.apply(this,n):n[0],a=t.cache;if(a.has(i))return a.get(i);var o=e.apply(this,n);return t.cache=a.set(i,o)||a,o};return t.cache=new(we.Cache||L),t}we.Cache=L;var yo=500;function go(e){var r=we(e,function(n){return t.size===yo&&t.clear(),n}),t=r.cache;return r}var bo=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,mo=/\\(\\)?/g,_o=go(function(e){var r=[];return e.charCodeAt(0)===46&&r.push(""),e.replace(bo,function(t,n,i,a){r.push(i?a.replace(mo,"$1"):n||t)}),r});function Oo(e){return e==null?"":rt(e)}function Se(e,r){return F(e)?e:Te(e,r)?[e]:_o(Oo(e))}function te(e){if(typeof e=="string"||pe(e))return e;var r=e+"";return r=="0"&&1/e==-1/0?"-0":r}function Ee(e,r){r=Se(r,e);for(var t=0,n=r.length;e!=null&&t<n;)e=e[te(r[t++])];return t&&t==n?e:void 0}function To(e,r,t){var n=e==null?void 0:Ee(e,r);return n===void 0?t:n}function wo(e,r){for(var t=-1,n=r.length,i=e.length;++t<n;)e[i+t]=r[t];return e}function So(e,r,t){var n=-1,i=e.length;r<0&&(r=-r>i?0:i+r),t=t>i?i:t,t<0&&(t+=i),i=r>t?0:t-r>>>0,r>>>=0;for(var a=Array(i);++n<i;)a[n]=e[n+r];return a}function Eo(){this.__data__=new N,this.size=0}function Po(e){var r=this.__data__,t=r.delete(e);return this.size=r.size,t}function qo(e){return this.__data__.get(e)}function Io(e){return this.__data__.has(e)}var Ro=200;function Ao(e,r){var t=this.__data__;if(t instanceof N){var n=t.__data__;if(!re||n.length<Ro-1)return n.push([e,r]),this.size=++t.size,this;t=this.__data__=new L(n)}return t.set(e,r),this.size=t.size,this}function x(e){var r=this.__data__=new N(e);this.size=r.size}x.prototype.clear=Eo,x.prototype.delete=Po,x.prototype.get=qo,x.prototype.has=Io,x.prototype.set=Ao;function jo(e,r){for(var t=-1,n=e==null?0:e.length,i=0,a=[];++t<n;){var o=e[t];r(o,t,e)&&(a[i++]=o)}return a}function Co(){return[]}var $o=Object.prototype,Do=$o.propertyIsEnumerable,_t=Object.getOwnPropertySymbols,Mo=_t?function(e){return e==null?[]:(e=Object(e),jo(_t(e),function(r){return Do.call(e,r)}))}:Co;function Fo(e,r,t){var n=r(e);return F(e)?n:wo(n,t(e))}function Ot(e){return Fo(e,mt,Mo)}var Pe=X(M,"DataView"),qe=X(M,"Promise"),Ie=X(M,"Set"),Tt="[object Map]",No="[object Object]",wt="[object Promise]",St="[object Set]",Et="[object WeakMap]",Pt="[object DataView]",Lo=V(Pe),xo=V(re),Bo=V(qe),Uo=V(Ie),Go=V(ge),G=H;(Pe&&G(new Pe(new ArrayBuffer(1)))!=Pt||re&&G(new re)!=Tt||qe&&G(qe.resolve())!=wt||Ie&&G(new Ie)!=St||ge&&G(new ge)!=Et)&&(G=function(e){var r=H(e),t=r==No?e.constructor:void 0,n=t?V(t):"";if(n)switch(n){case Lo:return Pt;case xo:return Tt;case Bo:return wt;case Uo:return St;case Go:return Et}return r});var qt=M.Uint8Array,ko="__lodash_hash_undefined__";function Vo(e){return this.__data__.set(e,ko),this}function zo(e){return this.__data__.has(e)}function se(e){var r=-1,t=e==null?0:e.length;for(this.__data__=new L;++r<t;)this.add(e[r])}se.prototype.add=se.prototype.push=Vo,se.prototype.has=zo;function Wo(e,r){for(var t=-1,n=e==null?0:e.length;++t<n;)if(r(e[t],t,e))return!0;return!1}function Qo(e,r){return e.has(r)}var Ko=1,Ho=2;function It(e,r,t,n,i,a){var o=t&Ko,u=e.length,l=r.length;if(u!=l&&!(o&&l>u))return!1;var s=a.get(e),h=a.get(r);if(s&&h)return s==r&&h==e;var c=-1,d=!0,v=t&Ho?new se:void 0;for(a.set(e,r),a.set(r,e);++c<u;){var f=e[c],y=r[c];if(n)var T=o?n(y,f,c,r,e,a):n(f,y,c,e,r,a);if(T!==void 0){if(T)continue;d=!1;break}if(v){if(!Wo(r,function(S,R){if(!Qo(v,R)&&(f===S||i(f,S,t,n,a)))return v.push(R)})){d=!1;break}}else if(!(f===y||i(f,y,t,n,a))){d=!1;break}}return a.delete(e),a.delete(r),d}function Yo(e){var r=-1,t=Array(e.size);return e.forEach(function(n,i){t[++r]=[i,n]}),t}function Xo(e){var r=-1,t=Array(e.size);return e.forEach(function(n){t[++r]=n}),t}var Zo=1,Jo=2,eu="[object Boolean]",ru="[object Date]",tu="[object Error]",nu="[object Map]",iu="[object Number]",au="[object RegExp]",ou="[object Set]",uu="[object String]",su="[object Symbol]",lu="[object ArrayBuffer]",cu="[object DataView]",Rt=U?U.prototype:void 0,Re=Rt?Rt.valueOf:void 0;function fu(e,r,t,n,i,a,o){switch(t){case cu:if(e.byteLength!=r.byteLength||e.byteOffset!=r.byteOffset)return!1;e=e.buffer,r=r.buffer;case lu:return!(e.byteLength!=r.byteLength||!a(new qt(e),new qt(r)));case eu:case ru:case iu:return at(+e,+r);case tu:return e.name==r.name&&e.message==r.message;case au:case uu:return e==r+"";case nu:var u=Yo;case ou:var l=n&Zo;if(u||(u=Xo),e.size!=r.size&&!l)return!1;var s=o.get(e);if(s)return s==r;n|=Jo,o.set(e,r);var h=It(u(e),u(r),n,i,a,o);return o.delete(e),h;case su:if(Re)return Re.call(e)==Re.call(r)}return!1}var du=1,vu=Object.prototype,hu=vu.hasOwnProperty;function pu(e,r,t,n,i,a){var o=t&du,u=Ot(e),l=u.length,s=Ot(r),h=s.length;if(l!=h&&!o)return!1;for(var c=l;c--;){var d=u[c];if(!(o?d in r:hu.call(r,d)))return!1}var v=a.get(e),f=a.get(r);if(v&&f)return v==r&&f==e;var y=!0;a.set(e,r),a.set(r,e);for(var T=o;++c<l;){d=u[c];var S=e[d],R=r[d];if(n)var q=o?n(R,S,d,r,e,a):n(S,R,d,e,r,a);if(!(q===void 0?S===R||i(S,R,t,n,a):q)){y=!1;break}T||(T=d=="constructor")}if(y&&!T){var m=e.constructor,E=r.constructor;m!=E&&"constructor"in e&&"constructor"in r&&!(typeof m=="function"&&m instanceof m&&typeof E=="function"&&E instanceof E)&&(y=!1)}return a.delete(e),a.delete(r),y}var yu=1,At="[object Arguments]",jt="[object Array]",le="[object Object]",gu=Object.prototype,Ct=gu.hasOwnProperty;function bu(e,r,t,n,i,a){var o=F(e),u=F(r),l=o?jt:G(e),s=u?jt:G(r);l=l==At?le:l,s=s==At?le:s;var h=l==le,c=s==le,d=l==s;if(d&&_e(e)){if(!_e(r))return!1;o=!0,h=!1}if(d&&!h)return a||(a=new x),o||gt(e)?It(e,r,t,n,i,a):fu(e,r,l,t,n,i,a);if(!(t&yu)){var v=h&&Ct.call(e,"__wrapped__"),f=c&&Ct.call(r,"__wrapped__");if(v||f){var y=v?e.value():e,T=f?r.value():r;return a||(a=new x),i(y,T,t,n,a)}}return d?(a||(a=new x),pu(e,r,t,n,i,a)):!1}function ce(e,r,t,n,i){return e===r?!0:e==null||r==null||!Y(e)&&!Y(r)?e!==e&&r!==r:bu(e,r,t,n,ce,i)}var mu=1,_u=2;function Ou(e,r,t,n){var i=t.length,a=i;if(e==null)return!a;for(e=Object(e);i--;){var o=t[i];if(o[2]?o[1]!==e[o[0]]:!(o[0]in e))return!1}for(;++i<a;){o=t[i];var u=o[0],l=e[u],s=o[1];if(o[2]){if(l===void 0&&!(u in e))return!1}else{var h=new x,c;if(!(c===void 0?ce(s,l,mu|_u,n,h):c))return!1}}return!0}function $t(e){return e===e&&!ae(e)}function Tu(e){for(var r=mt(e),t=r.length;t--;){var n=r[t],i=e[n];r[t]=[n,i,$t(i)]}return r}function Dt(e,r){return function(t){return t==null?!1:t[e]===r&&(r!==void 0||e in Object(t))}}function wu(e){var r=Tu(e);return r.length==1&&r[0][2]?Dt(r[0][0],r[0][1]):function(t){return t===e||Ou(t,e,r)}}function Su(e,r){return e!=null&&r in Object(e)}function Eu(e,r,t){r=Se(r,e);for(var n=-1,i=r.length,a=!1;++n<i;){var o=te(r[n]);if(!(a=e!=null&&t(e,o)))break;e=e[o]}return a||++n!=i?a:(i=e==null?0:e.length,!!i&&me(i)&&be(o,i)&&(F(e)||ct(e)))}function Pu(e,r){return e!=null&&Eu(e,r,Su)}var qu=1,Iu=2;function Ru(e,r){return Te(e)&&$t(r)?Dt(te(e),r):function(t){var n=To(t,e);return n===void 0&&n===r?Pu(t,e):ce(r,n,qu|Iu)}}function Au(e){return function(r){return r?.[e]}}function ju(e){return function(r){return Ee(r,e)}}function Cu(e){return Te(e)?Au(te(e)):ju(e)}function $u(e){return typeof e=="function"?e:e==null?tt:typeof e=="object"?F(e)?Ru(e[0],e[1]):wu(e):Cu(e)}function Du(e){return function(r,t,n){for(var i=-1,a=Object(r),o=n(r),u=o.length;u--;){var l=o[++i];if(t(a[l],l,a)===!1)break}return r}}var Mu=Du();function Fu(e){var r=e==null?0:e.length;return r?e[r-1]:void 0}function Nu(e){return typeof e=="function"?e:tt}function Ae(e,r){return e==null?e:Mu(e,Nu(r),Ua)}function Lu(e,r){return r.length<2?e:Ee(e,So(r,0,-1))}function xu(e,r){return ce(e,r)}function Bu(e,r){return r=Se(r,e),e=Lu(e,r),e==null||delete e[te(Fu(r))]}var Uu=Array.prototype,Gu=Uu.splice;function ku(e,r){for(var t=e?r.length:0,n=t-1;t--;){var i=r[t];if(t==n||i!==a){var a=i;be(i)?Gu.call(e,i,1):Bu(e,i)}}return e}function Vu(e,r){var t=[];if(!(e&&e.length))return t;var n=-1,i=[],a=e.length;for(r=$u(r);++n<a;){var o=e[n];r(o,n,e)&&(t.push(o),i.push(n))}return ku(e,i),t}async function*zu(e){for await(const r of e)yield r}var Mt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ft(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var je,Nt;function Wu(){if(Nt)return je;Nt=1,je=r;class e extends Error{}e.prototype.name="AssertionError";function r(t,n){if(!t){var i=new e(n);throw Error.captureStackTrace&&Error.captureStackTrace(i,r),i}}return je}var Qu=Wu();const w=Ft(Qu);function Lt(e){return w(typeof e=="function","fct must be a function"),async function(){return e(...arguments)}}class xt extends Error{constructor(r){super(r),this.name=this.constructor.name}}class Ku{constructor(){this._promise=new Promise((r,t)=>{this._resolve=r,this._reject=t})}get promise(){return this._promise}get resolve(){return this._resolve}get reject(){return this._reject}}var ne,Bt;function C(){if(Bt)return ne;Bt=1;var e=function(r){return r&&r.Math===Math&&r};return ne=e(typeof globalThis=="object"&&globalThis)||e(typeof window=="object"&&window)||e(typeof self=="object"&&self)||e(typeof Mt=="object"&&Mt)||e(typeof ne=="object"&&ne)||(function(){return this})()||Function("return this")(),ne}var Ce,Ut;function B(){return Ut||(Ut=1,Ce=function(e){try{return!!e()}catch{return!0}}),Ce}var $e,Gt;function fe(){if(Gt)return $e;Gt=1;var e=B();return $e=!e(function(){var r=(function(){}).bind();return typeof r!="function"||r.hasOwnProperty("prototype")}),$e}var De,kt;function Vt(){if(kt)return De;kt=1;var e=fe(),r=Function.prototype,t=r.apply,n=r.call;return De=typeof Reflect=="object"&&Reflect.apply||(e?n.bind(t):function(){return n.apply(t,arguments)}),De}var Me,zt;function W(){if(zt)return Me;zt=1;var e=fe(),r=Function.prototype,t=r.call,n=e&&r.bind.bind(t,t);return Me=e?n:function(i){return function(){return t.apply(i,arguments)}},Me}var Fe,Wt;function Ne(){if(Wt)return Fe;Wt=1;var e=W(),r=e({}.toString),t=e("".slice);return Fe=function(n){return t(r(n),8,-1)},Fe}var Le,Qt;function Kt(){if(Qt)return Le;Qt=1;var e=Ne(),r=W();return Le=function(t){if(e(t)==="Function")return r(t)},Le}var xe,Ht;function k(){if(Ht)return xe;Ht=1;var e=typeof document=="object"&&document.all;return xe=typeof e>"u"&&e!==void 0?function(r){return typeof r=="function"||r===e}:function(r){return typeof r=="function"},xe}var Be={},Ue,Yt;function Q(){if(Yt)return Ue;Yt=1;var e=B();return Ue=!e(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),Ue}var Ge,Xt;function ke(){if(Xt)return Ge;Xt=1;var e=fe(),r=Function.prototype.call;return Ge=e?r.bind(r):function(){return r.apply(r,arguments)},Ge}var Ve={},Zt;function Hu(){if(Zt)return Ve;Zt=1;var e={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor,t=r&&!e.call({1:2},1);return Ve.f=t?function(i){var a=r(this,i);return!!a&&a.enumerable}:e,Ve}var ze,Jt;function en(){return Jt||(Jt=1,ze=function(e,r){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:r}}),ze}var We,rn;function Yu(){if(rn)return We;rn=1;var e=W(),r=B(),t=Ne(),n=Object,i=e("".split);return We=r(function(){return!n("z").propertyIsEnumerable(0)})?function(a){return t(a)==="String"?i(a,""):n(a)}:n,We}var Qe,tn;function nn(){return tn||(tn=1,Qe=function(e){return e==null}),Qe}var Ke,an;function on(){if(an)return Ke;an=1;var e=nn(),r=TypeError;return Ke=function(t){if(e(t))throw new r("Can't call method on "+t);return t},Ke}var He,un;function Xu(){if(un)return He;un=1;var e=Yu(),r=on();return He=function(t){return e(r(t))},He}var Ye,sn;function de(){if(sn)return Ye;sn=1;var e=k();return Ye=function(r){return typeof r=="object"?r!==null:e(r)},Ye}var Xe,ln;function Ze(){return ln||(ln=1,Xe={}),Xe}var Je,cn;function fn(){if(cn)return Je;cn=1;var e=Ze(),r=C(),t=k(),n=function(i){return t(i)?i:void 0};return Je=function(i,a){return arguments.length<2?n(e[i])||n(r[i]):e[i]&&e[i][a]||r[i]&&r[i][a]},Je}var er,dn;function Zu(){if(dn)return er;dn=1;var e=W();return er=e({}.isPrototypeOf),er}var rr,vn;function ie(){if(vn)return rr;vn=1;var e=C(),r=e.navigator,t=r&&r.userAgent;return rr=t?String(t):"",rr}var tr,hn;function Ju(){if(hn)return tr;hn=1;var e=C(),r=ie(),t=e.process,n=e.Deno,i=t&&t.versions||n&&n.version,a=i&&i.v8,o,u;return a&&(o=a.split("."),u=o[0]>0&&o[0]<4?1:+(o[0]+o[1])),!u&&r&&(o=r.match(/Edge\/(\d+)/),(!o||o[1]>=74)&&(o=r.match(/Chrome\/(\d+)/),o&&(u=+o[1]))),tr=u,tr}var nr,pn;function yn(){if(pn)return nr;pn=1;var e=Ju(),r=B(),t=C(),n=t.String;return nr=!!Object.getOwnPropertySymbols&&!r(function(){var i=Symbol("symbol detection");return!n(i)||!(Object(i)instanceof Symbol)||!Symbol.sham&&e&&e<41}),nr}var ir,gn;function bn(){if(gn)return ir;gn=1;var e=yn();return ir=e&&!Symbol.sham&&typeof Symbol.iterator=="symbol",ir}var ar,mn;function _n(){if(mn)return ar;mn=1;var e=fn(),r=k(),t=Zu(),n=bn(),i=Object;return ar=n?function(a){return typeof a=="symbol"}:function(a){var o=e("Symbol");return r(o)&&t(o.prototype,i(a))},ar}var or,On;function es(){if(On)return or;On=1;var e=String;return or=function(r){try{return e(r)}catch{return"Object"}},or}var ur,Tn;function sr(){if(Tn)return ur;Tn=1;var e=k(),r=es(),t=TypeError;return ur=function(n){if(e(n))return n;throw new t(r(n)+" is not a function")},ur}var lr,wn;function rs(){if(wn)return lr;wn=1;var e=sr(),r=nn();return lr=function(t,n){var i=t[n];return r(i)?void 0:e(i)},lr}var cr,Sn;function ts(){if(Sn)return cr;Sn=1;var e=ke(),r=k(),t=de(),n=TypeError;return cr=function(i,a){var o,u;if(a==="string"&&r(o=i.toString)&&!t(u=e(o,i))||r(o=i.valueOf)&&!t(u=e(o,i))||a!=="string"&&r(o=i.toString)&&!t(u=e(o,i)))return u;throw new n("Can't convert object to primitive value")},cr}var fr={exports:{}},dr,En;function ns(){return En||(En=1,dr=!0),dr}var vr,Pn;function is(){if(Pn)return vr;Pn=1;var e=C(),r=Object.defineProperty;return vr=function(t,n){try{r(e,t,{value:n,configurable:!0,writable:!0})}catch{e[t]=n}return n},vr}var qn;function as(){if(qn)return fr.exports;qn=1;var e=ns(),r=C(),t=is(),n="__core-js_shared__",i=fr.exports=r[n]||t(n,{});return(i.versions||(i.versions=[])).push({version:"3.45.1",mode:e?"pure":"global",copyright:"© 2014-2025 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.45.1/LICENSE",source:"https://github.com/zloirock/core-js"}),fr.exports}var hr,In;function os(){if(In)return hr;In=1;var e=as();return hr=function(r,t){return e[r]||(e[r]=t||{})},hr}var pr,Rn;function us(){if(Rn)return pr;Rn=1;var e=on(),r=Object;return pr=function(t){return r(e(t))},pr}var yr,An;function ve(){if(An)return yr;An=1;var e=W(),r=us(),t=e({}.hasOwnProperty);return yr=Object.hasOwn||function(i,a){return t(r(i),a)},yr}var gr,jn;function ss(){if(jn)return gr;jn=1;var e=W(),r=0,t=Math.random(),n=e(1.1.toString);return gr=function(i){return"Symbol("+(i===void 0?"":i)+")_"+n(++r+t,36)},gr}var br,Cn;function ls(){if(Cn)return br;Cn=1;var e=C(),r=os(),t=ve(),n=ss(),i=yn(),a=bn(),o=e.Symbol,u=r("wks"),l=a?o.for||o:o&&o.withoutSetter||n;return br=function(s){return t(u,s)||(u[s]=i&&t(o,s)?o[s]:l("Symbol."+s)),u[s]},br}var mr,$n;function cs(){if($n)return mr;$n=1;var e=ke(),r=de(),t=_n(),n=rs(),i=ts(),a=ls(),o=TypeError,u=a("toPrimitive");return mr=function(l,s){if(!r(l)||t(l))return l;var h=n(l,u),c;if(h){if(s===void 0&&(s="default"),c=e(h,l,s),!r(c)||t(c))return c;throw new o("Can't convert object to primitive value")}return s===void 0&&(s="number"),i(l,s)},mr}var _r,Dn;function Mn(){if(Dn)return _r;Dn=1;var e=cs(),r=_n();return _r=function(t){var n=e(t,"string");return r(n)?n:n+""},_r}var Or,Fn;function Nn(){if(Fn)return Or;Fn=1;var e=C(),r=de(),t=e.document,n=r(t)&&r(t.createElement);return Or=function(i){return n?t.createElement(i):{}},Or}var Tr,Ln;function xn(){if(Ln)return Tr;Ln=1;var e=Q(),r=B(),t=Nn();return Tr=!e&&!r(function(){return Object.defineProperty(t("div"),"a",{get:function(){return 7}}).a!==7}),Tr}var Bn;function fs(){if(Bn)return Be;Bn=1;var e=Q(),r=ke(),t=Hu(),n=en(),i=Xu(),a=Mn(),o=ve(),u=xn(),l=Object.getOwnPropertyDescriptor;return Be.f=e?l:function(h,c){if(h=i(h),c=a(c),u)try{return l(h,c)}catch{}if(o(h,c))return n(!r(t.f,h,c),h[c])},Be}var wr,Un;function ds(){if(Un)return wr;Un=1;var e=B(),r=k(),t=/#|\.prototype\./,n=function(l,s){var h=a[i(l)];return h===u?!0:h===o?!1:r(s)?e(s):!!s},i=n.normalize=function(l){return String(l).replace(t,".").toLowerCase()},a=n.data={},o=n.NATIVE="N",u=n.POLYFILL="P";return wr=n,wr}var Sr,Gn;function Er(){if(Gn)return Sr;Gn=1;var e=Kt(),r=sr(),t=fe(),n=e(e.bind);return Sr=function(i,a){return r(i),a===void 0?i:t?n(i,a):function(){return i.apply(a,arguments)}},Sr}var Pr={},qr,kn;function vs(){if(kn)return qr;kn=1;var e=Q(),r=B();return qr=e&&r(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),qr}var Ir,Vn;function hs(){if(Vn)return Ir;Vn=1;var e=de(),r=String,t=TypeError;return Ir=function(n){if(e(n))return n;throw new t(r(n)+" is not an object")},Ir}var zn;function ps(){if(zn)return Pr;zn=1;var e=Q(),r=xn(),t=vs(),n=hs(),i=Mn(),a=TypeError,o=Object.defineProperty,u=Object.getOwnPropertyDescriptor,l="enumerable",s="configurable",h="writable";return Pr.f=e?t?function(d,v,f){if(n(d),v=i(v),n(f),typeof d=="function"&&v==="prototype"&&"value"in f&&h in f&&!f[h]){var y=u(d,v);y&&y[h]&&(d[v]=f.value,f={configurable:s in f?f[s]:y[s],enumerable:l in f?f[l]:y[l],writable:!1})}return o(d,v,f)}:o:function(d,v,f){if(n(d),v=i(v),n(f),r)try{return o(d,v,f)}catch{}if("get"in f||"set"in f)throw new a("Accessors not supported");return"value"in f&&(d[v]=f.value),d},Pr}var Rr,Wn;function ys(){if(Wn)return Rr;Wn=1;var e=Q(),r=ps(),t=en();return Rr=e?function(n,i,a){return r.f(n,i,t(1,a))}:function(n,i,a){return n[i]=a,n},Rr}var Ar,Qn;function gs(){if(Qn)return Ar;Qn=1;var e=C(),r=Vt(),t=Kt(),n=k(),i=fs().f,a=ds(),o=Ze(),u=Er(),l=ys(),s=ve(),h=function(c){var d=function(v,f,y){if(this instanceof d){switch(arguments.length){case 0:return new c;case 1:return new c(v);case 2:return new c(v,f)}return new c(v,f,y)}return r(c,this,arguments)};return d.prototype=c.prototype,d};return Ar=function(c,d){var v=c.target,f=c.global,y=c.stat,T=c.proto,S=f?e:y?e[v]:e[v]&&e[v].prototype,R=f?o:o[v]||l(o,v,{})[v],q=R.prototype,m,E,j,O,A,p,g,b,D;for(O in d)m=a(f?O:v+(y?".":"#")+O,c.forced),E=!m&&S&&s(S,O),p=R[O],E&&(c.dontCallGetSet?(D=i(S,O),g=D&&D.value):g=S[O]),A=E&&g?g:d[O],!(!m&&!T&&typeof p==typeof A)&&(c.bind&&E?b=u(A,e):c.wrap&&E?b=h(A):T&&n(A)?b=t(A):b=A,(c.sham||A&&A.sham||p&&p.sham)&&l(b,"sham",!0),l(R,O,b),T&&(j=v+"Prototype",s(o,j)||l(o,j,{}),l(o[j],O,A),c.real&&q&&(m||!q[O])&&l(q,O,A)))},Ar}var jr,Kn;function bs(){if(Kn)return jr;Kn=1;var e=fn();return jr=e("document","documentElement"),jr}var Cr,Hn;function ms(){if(Hn)return Cr;Hn=1;var e=W();return Cr=e([].slice),Cr}var $r,Yn;function Xn(){if(Yn)return $r;Yn=1;var e=TypeError;return $r=function(r,t){if(r<t)throw new e("Not enough arguments");return r},$r}var Dr,Zn;function Jn(){if(Zn)return Dr;Zn=1;var e=ie();return Dr=/(?:ipad|iphone|ipod).*applewebkit/i.test(e),Dr}var Mr,ei;function _s(){if(ei)return Mr;ei=1;var e=C(),r=ie(),t=Ne(),n=function(i){return r.slice(0,i.length)===i};return Mr=(function(){return n("Bun/")?"BUN":n("Cloudflare-Workers")?"CLOUDFLARE":n("Deno/")?"DENO":n("Node.js/")?"NODE":e.Bun&&typeof Bun.version=="string"?"BUN":e.Deno&&typeof Deno.version=="object"?"DENO":t(e.process)==="process"?"NODE":e.window&&e.document?"BROWSER":"REST"})(),Mr}var Fr,ri;function ti(){if(ri)return Fr;ri=1;var e=_s();return Fr=e==="NODE",Fr}var Nr,ni;function Os(){if(ni)return Nr;ni=1;var e=C(),r=Vt(),t=Er(),n=k(),i=ve(),a=B(),o=bs(),u=ms(),l=Nn(),s=Xn(),h=Jn(),c=ti(),d=e.setImmediate,v=e.clearImmediate,f=e.process,y=e.Dispatch,T=e.Function,S=e.MessageChannel,R=e.String,q=0,m={},E="onreadystatechange",j,O,A,p;a(function(){j=e.location});var g=function(P){if(i(m,P)){var K=m[P];delete m[P],K()}},b=function(P){return function(){g(P)}},D=function(P){g(P.data)},he=function(P){e.postMessage(R(P),j.protocol+"//"+j.host)};return(!d||!v)&&(d=function(K){s(arguments.length,1);var Vs=n(K)?K:T(K),zs=u(arguments,1);return m[++q]=function(){r(Vs,void 0,zs)},O(q),q},v=function(K){delete m[K]},c?O=function(P){f.nextTick(b(P))}:y&&y.now?O=function(P){y.now(b(P))}:S&&!h?(A=new S,p=A.port2,A.port1.onmessage=D,O=t(p.postMessage,p)):e.addEventListener&&n(e.postMessage)&&!e.importScripts&&j&&j.protocol!=="file:"&&!a(he)?(O=he,e.addEventListener("message",D,!1)):E in l("script")?O=function(P){o.appendChild(l("script"))[E]=function(){o.removeChild(this),g(P)}}:O=function(P){setTimeout(b(P),0)}),Nr={set:d,clear:v},Nr}var ii={},Lr,ai;function Ts(){if(ai)return Lr;ai=1;var e=C(),r=Q(),t=Object.getOwnPropertyDescriptor;return Lr=function(n){if(!r)return e[n];var i=t(e,n);return i&&i.value},Lr}var xr,oi;function ws(){if(oi)return xr;oi=1;var e=function(){this.head=null,this.tail=null};return e.prototype={add:function(r){var t={item:r,next:null},n=this.tail;n?n.next=t:this.head=t,this.tail=t},get:function(){var r=this.head;if(r){var t=this.head=r.next;return t===null&&(this.tail=null),r.item}}},xr=e,xr}var Br,ui;function Ss(){if(ui)return Br;ui=1;var e=ie();return Br=/ipad|iphone|ipod/i.test(e)&&typeof Pebble<"u",Br}var Ur,si;function Es(){if(si)return Ur;si=1;var e=ie();return Ur=/web0s(?!.*chrome)/i.test(e),Ur}var Gr,li;function Ps(){if(li)return Gr;li=1;var e=C(),r=Ts(),t=Er(),n=Os().set,i=ws(),a=Jn(),o=Ss(),u=Es(),l=ti(),s=e.MutationObserver||e.WebKitMutationObserver,h=e.document,c=e.process,d=e.Promise,v=r("queueMicrotask"),f,y,T,S,R;if(!v){var q=new i,m=function(){var E,j;for(l&&(E=c.domain)&&E.exit();j=q.get();)try{j()}catch(O){throw q.head&&f(),O}E&&E.enter()};!a&&!l&&!u&&s&&h?(y=!0,T=h.createTextNode(""),new s(m).observe(T,{characterData:!0}),f=function(){T.data=y=!y}):!o&&d&&d.resolve?(S=d.resolve(void 0),S.constructor=d,R=t(S.then,S),f=function(){R(m)}):l?f=function(){c.nextTick(m)}:(n=t(n,e),f=function(){n(m)}),v=function(E){q.head||f(),q.add(E)}}return Gr=v,Gr}var ci;function qs(){if(ci)return ii;ci=1;var e=gs(),r=C(),t=Ps(),n=sr(),i=Xn(),a=B(),o=Q(),u=a(function(){return o&&Object.getOwnPropertyDescriptor(r,"queueMicrotask").value.length!==1});return e({global:!0,enumerable:!0,dontCallGetSet:!0,forced:u},{queueMicrotask:function(s){i(arguments.length,1),t(n(s))}}),ii}var kr,fi;function Is(){if(fi)return kr;fi=1,qs();var e=Ze();return kr=e.queueMicrotask,kr}var Vr,di;function Rs(){if(di)return Vr;di=1;var e=Is();return Vr=e,Vr}var zr,vi;function As(){if(vi)return zr;vi=1;var e=Rs();return zr=e,zr}var Wr,hi;function js(){if(hi)return Wr;hi=1;var e=As();return Wr=e,Wr}var Qr,pi;function Cs(){return pi||(pi=1,Qr=js()),Qr}var $s=Cs();const Ds=Ft($s);function yi(e){Ds(e)}class Ms{constructor(r){w(Number.isInteger(r)||r===Number.POSITIVE_INFINITY,"concurrency must be an integer or positive infinity"),w(r>0,"concurrency must be greater than 0"),this._concurrency=r,this._iqueue=[],this._running=0,this._checkQueueScheduled=!1}get concurrency(){return this._concurrency}get running(){return this._running}get pending(){return this._iqueue.length-this.running}async exec(r,t=0){return this.execCancellable(r,t)[0]}execCancellable(r,t=0){w(typeof r=="function","fct must be a function"),w(typeof t=="number","priority must be a number");const n=new Ku;let i=this._iqueue.length;for(;i>=1&&!(this._iqueue[i-1].priority>=t);)i-=1;const a={asyncFct:Lt(r),deferred:n,priority:t,state:"pending"};return this._iqueue.splice(i,0,a),this._scheduleCheckQueue(),[n.promise,()=>{if(a.state!=="pending")return!1;{const o=this._iqueue.filter(u=>u!==a);return w(o.length<this._iqueue.length),this._iqueue=o,a.state="cancelled",n.reject(new xt),!0}}]}_scheduleCheckQueue(){this._checkQueueScheduled||(this._checkQueueScheduled=!0,yi(()=>{this._checkQueueScheduled=!1,this._checkQueue()}))}_checkQueue(){for(;;){if(w(this.running>=0,"invalid state"),w(this.running<=this.concurrency,"invalid state"),this.running===this.concurrency)return;const r=this._iqueue.find(t=>t.state==="pending");if(r===void 0)return;this._running+=1,r.state="running",yi(()=>{r.asyncFct().finally(()=>{this._running-=1,this._iqueue=this._iqueue.filter(t=>t!==r)}).then(r.deferred.resolve,r.deferred.reject).then(()=>{this._scheduleCheckQueue()})})}}cancelAllPending(){const r=this._iqueue.filter(t=>t.state==="pending");return this._iqueue=this._iqueue.filter(t=>t.state!=="pending"),r.forEach(t=>{t.deferred.reject(new xt)}),r.length}}function Fs(e){return typeof e=="number"?new Ms(e):e}async function Kr(e){try{return{status:"fulfilled",value:await e()}}catch(r){return{status:"rejected",reason:r}}}async function*Ns(e,r,t=1,n=!0){w(typeof r=="function","iteratee must be a function"),r=Lt(r);const i=zu(e),a=Fs(t);class o extends Error{}let u=-1,l=!1,s=!1,h=null,c=!1,d=!1,v=-1;const f=[];let y=0;const T=new Map,S=p=>{const g=y;y+=1;const b=(async()=>[g,await Kr(p)])();w(!T.has(g),"waitList contains identifier"),T.set(g,b)},R=async()=>{w(T.size>=1,"Can not race on empty list");const[p]=await Promise.race([...T.values()]),g=T.delete(p);w(g,"waitList does not contain identifier")};let q=0;const m=new Map,E=(p,g)=>{q+=1;const b={value:g,index:p,cancel:null,state:null};m.set(p,b),S(async()=>{const D=a.exec(async()=>{if(b.state==="cancelled")throw new o;w(b.state==="scheduled","invalid task state");const he=m.delete(p);w(he,"Couldn't find index in scheduledList for removal");const P=await Kr(()=>r(g,p,e));q-=1,A(p,g,P),P.status==="rejected"&&(d=!0,j(n?p:0))});return w(b.cancel===null,"task already has cancel"),b.cancel=()=>{w(b.state==="scheduled","task should be scheduled"),b.state="cancelled"},w(b.state===null,"task should have no state"),b.state="scheduled",D})},j=p=>{for(const g of[...m.keys()].filter(b=>b>=p)){const b=m.get(g);w(b.cancel,"task does not have cancel"),b.cancel();const D=m.delete(g);w(D,"Couldn't find index in scheduledList for removal")}},O=()=>{l=!0,S(async()=>{const p=await Kr(()=>i.next());if(l=!1,p.status==="fulfilled"){const{value:g,done:b}=p.value;b?c=!0:(u+=1,w(h===null,"fetchedValue should be null"),h=g,w(!s,"hasFetchedValue should be false"),s=!0)}else{c=!0,u+=1;const g=u;A(g,void 0,p),j(n?g:0)}})},A=(p,g,b)=>{n?(w(p-v-1>=0,"invalid index to insert"),w(f[p-v-1]===void 0,"already inserted result"),f[p-v-1]={index:p,value:g,snapshot:b}):f.push({index:p,value:g,snapshot:b})};for(O();;){for(await R();f.length>=1&&f[0]!==void 0;){const p=f.shift();if(v+=1,p.snapshot.status==="rejected")throw p.snapshot.reason;{let g=!1;try{yield p.snapshot.value,g=!0}finally{g||await i.return()}}}if(c&&u===v)return;s&&!d&&(E(u,h),s=!1,h=null),!l&&!c&&!d&&q<a.concurrency&&O()}}async function Hr(e,r,t=1){for await(const n of Ns(e,r,t));}class gi{controls;dirty;errors;group;rules;touched;validated;validator;value;constructor(r,t){this.controls=[],this.dirty=!1,this.errors=[],this.rules=r.rules,this.touched=!1,this.validated=!1,this.validator=t,this.value=r.value,r.group&&(this.group=r.group)}get isValid(){return this.errors.length===0}reset(){this.touched=!1,this.dirty=!1,this.validated=!1,this.errors=[]}async validate(){this.errors=[];let r=!1;return this.controls.length>0&&this.controls?.every(t=>!t.getAttribute("disabled"))&&(r=!0),r&&await Hr(this.rules,async t=>{const n=await t(this.value);n!==null&&this.errors.push(n)}),this.isValid}}class bi{dirty;errors;fields;groups;touched;validated;constructor(r={}){this.dirty=!1,this.errors=[],this.fields={},this.groups={},this.touched=!1,this.validated=!1,r.fields&&Ae(r.fields,(t,n)=>{this.addField(n,t)})}isValid(r){let t=Object.keys(this.fields);return r&&(t=Object.keys(this.groups[r].fields)),t.every(n=>this.fields[n].errors.length===0)}reset(r){this.validated=!1,this.errors=[],r?Ae(this.groups[r].fields,t=>{t.reset()}):Ae(this.fields,t=>{t.reset()})}addField(r,t){const n=new gi(t,this);this.fields[r]=n,t.group&&(this.groups[t.group]||(this.groups[t.group]={dirty:!1,fields:$.reactive({}),touched:!1,validated:!1}),this.groups[t.group].fields[r]=n)}removeField(r){this.fields[r].group&&delete this.groups[this.fields[r].group].fields[r],delete this.fields[r]}async validate(r){if(r&&this.groups[r]){const t=this.groups[r];await Hr(Object.keys(t.fields),async n=>{await t.fields[n].validate()}),this.groups[r].validated=!0}else await Hr(Object.keys(this.fields),async t=>{await this.fields[t].validate()}),this.validated=!0}}const Ls=$.defineComponent({name:"FieldValidation",props:{name:{type:String,required:!0},hideError:Boolean,modelValue:{type:null},modelModifiers:{default:()=>({})},rules:{type:Array,default(){return[]}},validator:{type:bi,required:!0}},data(){return{form_fields:[]}},computed:{field(){return this.validator.fields[this.name]},error(){return this.field&&this.field.errors.length?this.field.errors[0]:null}},watch:{modelValue:{async handler(e,r){xu(e,r)||(this.field&&(this.field.value=e,this.field.dirty=!0),this.validator.dirty=!0,this.field.group&&(this.validator.groups[this.field.group].dirty=!0),this.field.touched&&await this.field.validate())},deep:!0}},mounted(){if(!this.field){let e;Object.keys(this.modelModifiers).length===1&&(e=Object.keys(this.modelModifiers)[0]),this.validator.addField(this.name,{value:this.modelValue,rules:this.rules,group:e})}$.nextTick(()=>{const e=this.$refs.root,r=e.querySelectorAll("input, select, textarea");this.form_fields=Array.from(r),this.form_fields.forEach(t=>{t.getAttribute("has-validation")!=="true"&&(this.validator.fields[this.name]?.controls.push(t),t.addEventListener("blur",n=>{if(!e.contains(n.relatedTarget)){if(this.validator.touched=!0,this.validator.fields[this.name].group){const i=this.validator.fields[this.name].group;this.validator.groups[i].touched=!0}this.validator.fields[this.name].touched=!0,this.validator.fields[this.name].validate()}}),t.setAttribute("has-validation","true"))})})},beforeUnmount(){this.form_fields.forEach(e=>{Vu(this.validator.fields[this.name].controls,e)})}}),xs=(e,r)=>{const t=e.__vccOpts||e;for(const[n,i]of r)t[n]=i;return t};function Bs(e,r,t,n,i,a){return $.openBlock(),$.createElementBlock("div",{ref:"root",class:$.normalizeClass({invalid:e.error})},[$.renderSlot(e.$slots,"default",{invalid:!!e.error,error_message:e.error})],2)}const Us=xs(Ls,[["render",Bs]]);async function Gs(e,r){return function(t){return!e||t===e?null:r||"The value does not match"}}const ks=Object.freeze(Object.defineProperty({__proto__:null,match:Gs},Symbol.toStringTag,{value:"Module"}));I.FieldValidation=Us,I.FieldValidator=gi,I.Validator=bi,I.rules=ks,Object.defineProperty(I,Symbol.toStringTag,{value:"Module"})}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function match(match_value: any, message: string): Promise<(value: any) => string | null>;
|
package/package.json
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@splitty-test/validation",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
7
|
-
},
|
|
3
|
+
"version": "0.1.2",
|
|
4
|
+
"main": "dist/index.umd.js",
|
|
5
|
+
"module": "dist/index.mjs",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
8
7
|
"scripts": {
|
|
9
8
|
"dev": "vite",
|
|
10
9
|
"build": "run-p type-check \"build-only {@}\" --",
|
|
@@ -17,24 +16,25 @@
|
|
|
17
16
|
"dependencies": {
|
|
18
17
|
"lodash-es": "^4.17.21",
|
|
19
18
|
"modern-async": "^2.0.4",
|
|
20
|
-
"vue": "^3.5.
|
|
19
|
+
"vue": "^3.5.21"
|
|
21
20
|
},
|
|
22
21
|
"devDependencies": {
|
|
23
22
|
"@tsconfig/node22": "^22.0.2",
|
|
24
23
|
"@types/lodash-es": "^4.17.12",
|
|
25
|
-
"@types/node": "^
|
|
24
|
+
"@types/node": "^24.5.2",
|
|
26
25
|
"@vitejs/plugin-vue": "^6.0.1",
|
|
27
26
|
"@vue/eslint-config-prettier": "^10.2.0",
|
|
28
27
|
"@vue/eslint-config-typescript": "^14.6.0",
|
|
29
|
-
"@vue/tsconfig": "^0.
|
|
30
|
-
"eslint": "^9.
|
|
31
|
-
"eslint-plugin-vue": "~10.
|
|
32
|
-
"jiti": "^2.
|
|
28
|
+
"@vue/tsconfig": "^0.8.1",
|
|
29
|
+
"eslint": "^9.36.0",
|
|
30
|
+
"eslint-plugin-vue": "~10.4.0",
|
|
31
|
+
"jiti": "^2.5.1",
|
|
33
32
|
"npm-run-all2": "^8.0.4",
|
|
34
33
|
"prettier": "3.6.2",
|
|
35
|
-
"typescript": "~5.
|
|
36
|
-
"vite": "^7.
|
|
37
|
-
"vite-plugin-
|
|
38
|
-
"vue-
|
|
34
|
+
"typescript": "~5.9.2",
|
|
35
|
+
"vite": "^7.1.6",
|
|
36
|
+
"vite-plugin-dts": "^4.5.4",
|
|
37
|
+
"vite-plugin-vue-devtools": "^8.0.2",
|
|
38
|
+
"vue-tsc": "^3.0.7"
|
|
39
39
|
}
|
|
40
40
|
}
|
package/vite.config.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { fileURLToPath, URL } from 'node:url';
|
|
2
1
|
import { defineConfig } from 'vite';
|
|
3
2
|
import vue from '@vitejs/plugin-vue';
|
|
4
3
|
import vueDevTools from 'vite-plugin-vue-devtools';
|
|
5
4
|
import { resolve } from 'node:path';
|
|
5
|
+
import dts from 'vite-plugin-dts';
|
|
6
6
|
|
|
7
7
|
// https://vite.dev/config/
|
|
8
8
|
export default defineConfig({
|
|
9
9
|
build: {
|
|
10
10
|
lib: {
|
|
11
|
-
entry: resolve(__dirname, './
|
|
11
|
+
entry: resolve(__dirname, './src/index.ts'),
|
|
12
12
|
name: 'Validation',
|
|
13
13
|
fileName: 'index',
|
|
14
14
|
},
|
|
@@ -21,10 +21,11 @@ export default defineConfig({
|
|
|
21
21
|
},
|
|
22
22
|
},
|
|
23
23
|
},
|
|
24
|
-
plugins: [
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
24
|
+
plugins: [
|
|
25
|
+
vue(),
|
|
26
|
+
vueDevTools(),
|
|
27
|
+
dts({
|
|
28
|
+
tsconfigPath: './tsconfig.app.json',
|
|
29
|
+
}),
|
|
30
|
+
],
|
|
30
31
|
});
|
package/.editorconfig
DELETED
package/.vscode/extensions.json
DELETED
package/lib/FieldValidation.vue
DELETED
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div ref="root" :class="{ invalid: error }">
|
|
3
|
-
<slot></slot>
|
|
4
|
-
<div v-if="!hideError" class="validation-error">{{ error }}</div>
|
|
5
|
-
</div>
|
|
6
|
-
</template>
|
|
7
|
-
|
|
8
|
-
<script lang="ts">
|
|
9
|
-
import { defineComponent, nextTick, type PropType } from 'vue';
|
|
10
|
-
import { Validator } from './ValidatorClass';
|
|
11
|
-
import { remove } from 'lodash-es';
|
|
12
|
-
import type { ValidationRule } from './FieldValidatorClass';
|
|
13
|
-
|
|
14
|
-
export default defineComponent({
|
|
15
|
-
name: 'FieldValidation',
|
|
16
|
-
props: {
|
|
17
|
-
name: {
|
|
18
|
-
type: String,
|
|
19
|
-
required: true,
|
|
20
|
-
},
|
|
21
|
-
hideError: Boolean,
|
|
22
|
-
modelValue: {
|
|
23
|
-
type: null,
|
|
24
|
-
},
|
|
25
|
-
modelModifiers: {
|
|
26
|
-
default: () => ({}),
|
|
27
|
-
},
|
|
28
|
-
rules: {
|
|
29
|
-
type: Array as PropType<ValidationRule[]>,
|
|
30
|
-
default() {
|
|
31
|
-
return [];
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
validator: {
|
|
35
|
-
type: Validator,
|
|
36
|
-
required: true,
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
data() {
|
|
40
|
-
return {
|
|
41
|
-
form_fields: [] as HTMLElement[],
|
|
42
|
-
};
|
|
43
|
-
},
|
|
44
|
-
computed: {
|
|
45
|
-
error() {
|
|
46
|
-
if (this.validator.fields[this.name]?.errors.length) {
|
|
47
|
-
return this.validator.fields[this.name].errors[0];
|
|
48
|
-
}
|
|
49
|
-
return null;
|
|
50
|
-
},
|
|
51
|
-
},
|
|
52
|
-
mounted() {
|
|
53
|
-
// Add the field to the validator
|
|
54
|
-
if (!this.validator.fields[this.name]) {
|
|
55
|
-
let group;
|
|
56
|
-
if (Object.keys(this.modelModifiers).length === 1) {
|
|
57
|
-
group = Object.keys(this.modelModifiers)[0];
|
|
58
|
-
}
|
|
59
|
-
this.validator.addField(this.name, {
|
|
60
|
-
value: this.modelValue,
|
|
61
|
-
rules: this.rules,
|
|
62
|
-
group,
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
nextTick(() => {
|
|
67
|
-
// Add control elements to the validation methods
|
|
68
|
-
const root = this.$refs.root as HTMLElement;
|
|
69
|
-
const form_fields = root.querySelectorAll<HTMLElement>('input, select, textarea');
|
|
70
|
-
this.form_fields = Array.from(form_fields);
|
|
71
|
-
this.form_fields.forEach((form_field) => {
|
|
72
|
-
if (form_field.getAttribute('has-validation') !== 'true') {
|
|
73
|
-
this.validator.fields[this.name].controls.push(form_field);
|
|
74
|
-
form_field.addEventListener('blur', (event: FocusEvent) => {
|
|
75
|
-
if (!root.contains(event.relatedTarget as Node)) {
|
|
76
|
-
this.validator.touched.value = true;
|
|
77
|
-
if (this.validator.fields[this.name].group) {
|
|
78
|
-
const group_name = this.validator.fields[this.name]?.group;
|
|
79
|
-
this.validator.groups[group_name].touched.value = true;
|
|
80
|
-
}
|
|
81
|
-
this.validator.fields[this.name].touched.value = true;
|
|
82
|
-
this.validator.fields[this.name].validate();
|
|
83
|
-
}
|
|
84
|
-
});
|
|
85
|
-
form_field.setAttribute('has-validation', 'true');
|
|
86
|
-
}
|
|
87
|
-
});
|
|
88
|
-
});
|
|
89
|
-
},
|
|
90
|
-
beforeUnmount() {
|
|
91
|
-
this.form_fields.forEach((form_field) => {
|
|
92
|
-
remove(this.validator.fields[this.name].controls, form_field);
|
|
93
|
-
});
|
|
94
|
-
},
|
|
95
|
-
});
|
|
96
|
-
</script>
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import { isEqual, isPlainObject } from 'lodash-es';
|
|
2
|
-
import { asyncForEach } from 'modern-async';
|
|
3
|
-
import { reactive, ref, watch, type Ref } from 'vue';
|
|
4
|
-
import { type Validator } from './ValidatorClass';
|
|
5
|
-
|
|
6
|
-
export interface FieldValidatorConfig {
|
|
7
|
-
value: any;
|
|
8
|
-
rules: ValidationRule[];
|
|
9
|
-
group?: string;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export type ValidationRule = (value: any, ...args: any) => Promise<string | null> | (string | null);
|
|
13
|
-
|
|
14
|
-
export class FieldValidator {
|
|
15
|
-
controls: HTMLElement[];
|
|
16
|
-
dirty: Ref<boolean, boolean>;
|
|
17
|
-
errors: string[];
|
|
18
|
-
group?: string;
|
|
19
|
-
rules: ValidationRule[];
|
|
20
|
-
touched: Ref<boolean, boolean>;
|
|
21
|
-
validated: Ref<boolean, boolean>;
|
|
22
|
-
validator: Validator;
|
|
23
|
-
value: Ref<any, any>;
|
|
24
|
-
|
|
25
|
-
constructor(config: FieldValidatorConfig, validator: Validator) {
|
|
26
|
-
this.controls = reactive([]);
|
|
27
|
-
this.dirty = ref(false);
|
|
28
|
-
this.errors = reactive([]);
|
|
29
|
-
this.rules = reactive(config.rules);
|
|
30
|
-
this.touched = ref(false);
|
|
31
|
-
this.validated = ref(false);
|
|
32
|
-
this.validator = validator;
|
|
33
|
-
this.value = ref(config.value);
|
|
34
|
-
|
|
35
|
-
if (config.group) {
|
|
36
|
-
this.group = config.group;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
// Watch the value
|
|
40
|
-
watch(
|
|
41
|
-
this.value,
|
|
42
|
-
async (new_value, old_value) => {
|
|
43
|
-
if (!isEqual(new_value, old_value)) {
|
|
44
|
-
this.dirty.value = true;
|
|
45
|
-
this.validator.dirty.value = true;
|
|
46
|
-
if (this.group) {
|
|
47
|
-
this.validator.groups[this.group].dirty.value = true;
|
|
48
|
-
}
|
|
49
|
-
if (this.touched) {
|
|
50
|
-
await this.validate();
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
deep: isPlainObject(this.value),
|
|
56
|
-
},
|
|
57
|
-
);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
get isValid() {
|
|
61
|
-
return this.errors.length === 0;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
reset() {
|
|
65
|
-
this.touched.value = false;
|
|
66
|
-
this.dirty.value = false;
|
|
67
|
-
this.validated.value = false;
|
|
68
|
-
this.errors = [];
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
async validate() {
|
|
72
|
-
this.errors = [];
|
|
73
|
-
|
|
74
|
-
// Only validate if the controls are not disabled or hidden
|
|
75
|
-
let should_validate = false;
|
|
76
|
-
if (
|
|
77
|
-
this.controls.length > 0 &&
|
|
78
|
-
this.controls?.every((control_element) => {
|
|
79
|
-
return !control_element.getAttribute('disabled');
|
|
80
|
-
})
|
|
81
|
-
) {
|
|
82
|
-
should_validate = true;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
if (should_validate) {
|
|
86
|
-
await asyncForEach(this.rules, async (rule: ValidationRule) => {
|
|
87
|
-
const error = await rule(this.value);
|
|
88
|
-
if (error !== null) {
|
|
89
|
-
this.errors.push(error);
|
|
90
|
-
}
|
|
91
|
-
});
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
return this.isValid;
|
|
95
|
-
}
|
|
96
|
-
}
|
package/lib/ValidatorClass.ts
DELETED
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
import { reactive, ref, type Ref } from 'vue';
|
|
2
|
-
import { forIn } from 'lodash-es';
|
|
3
|
-
import { FieldValidator, type FieldValidatorConfig } from './FieldValidatorClass';
|
|
4
|
-
import { asyncForEach } from 'modern-async';
|
|
5
|
-
|
|
6
|
-
export interface ValidatorConfig {
|
|
7
|
-
fields?: Record<string, FieldValidatorConfig>;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export interface ValidationGroup {
|
|
11
|
-
dirty: Ref<boolean, boolean>;
|
|
12
|
-
fields: Record<string, FieldValidator>;
|
|
13
|
-
touched: Ref<boolean, boolean>;
|
|
14
|
-
validated: Ref<boolean, boolean>;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export class Validator {
|
|
18
|
-
dirty: Ref<boolean, boolean>;
|
|
19
|
-
errors: string[];
|
|
20
|
-
fields: Record<string, FieldValidator>;
|
|
21
|
-
groups: Record<string, ValidationGroup>;
|
|
22
|
-
touched: Ref<boolean, boolean>;
|
|
23
|
-
validated: Ref<boolean, boolean>;
|
|
24
|
-
|
|
25
|
-
constructor(config: ValidatorConfig = {}) {
|
|
26
|
-
this.dirty = ref(false);
|
|
27
|
-
this.errors = reactive([]);
|
|
28
|
-
this.fields = reactive({});
|
|
29
|
-
this.groups = reactive({});
|
|
30
|
-
this.touched = ref(false);
|
|
31
|
-
this.validated = ref(false);
|
|
32
|
-
|
|
33
|
-
if (config.fields) {
|
|
34
|
-
forIn(config.fields, (field_config, field_name) => {
|
|
35
|
-
this.addField(field_name, field_config);
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
isValid(group_name?: string) {
|
|
41
|
-
let field_names = Object.keys(this.fields);
|
|
42
|
-
if (group_name) {
|
|
43
|
-
field_names = Object.keys(this.groups[group_name].fields);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
return field_names.every((field) => {
|
|
47
|
-
return this.fields[field].errors.length === 0;
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
reset(group_name?: string) {
|
|
52
|
-
this.validated.value = false;
|
|
53
|
-
this.errors = [];
|
|
54
|
-
|
|
55
|
-
if (group_name) {
|
|
56
|
-
forIn(this.groups[group_name].fields, (field) => {
|
|
57
|
-
field.reset();
|
|
58
|
-
});
|
|
59
|
-
} else {
|
|
60
|
-
forIn(this.fields, (field) => {
|
|
61
|
-
field.reset();
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
addField(field_name: string, field_config: FieldValidatorConfig) {
|
|
67
|
-
const new_field = new FieldValidator(field_config, this);
|
|
68
|
-
this.fields[field_name] = new_field;
|
|
69
|
-
|
|
70
|
-
if (field_config.group) {
|
|
71
|
-
if (!this.groups[field_config.group]) {
|
|
72
|
-
this.groups[field_config.group] = {
|
|
73
|
-
dirty: ref(false),
|
|
74
|
-
fields: reactive({}),
|
|
75
|
-
touched: ref(false),
|
|
76
|
-
validated: ref(false),
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
this.groups[field_config.group].fields[field_name] = new_field;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
removeField(field_name: string) {
|
|
84
|
-
if (this.fields[field_name].group) {
|
|
85
|
-
delete this.groups[this.fields[field_name].group!].fields[field_name];
|
|
86
|
-
}
|
|
87
|
-
delete this.fields[field_name];
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
async validate(group_name?: string) {
|
|
91
|
-
if (group_name && this.groups[group_name]) {
|
|
92
|
-
const group = this.groups[group_name];
|
|
93
|
-
|
|
94
|
-
await asyncForEach(Object.keys(group.fields), async (field) => {
|
|
95
|
-
await group.fields[field].validate();
|
|
96
|
-
});
|
|
97
|
-
|
|
98
|
-
this.groups[group_name].validated.value = true;
|
|
99
|
-
} else {
|
|
100
|
-
await asyncForEach(Object.keys(this.fields), async (field) => {
|
|
101
|
-
await this.fields[field].validate();
|
|
102
|
-
});
|
|
103
|
-
this.validated.value = true;
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
}
|
package/lib/rules/index.ts
DELETED
|
File without changes
|
package/lib/rules/match.ts
DELETED
|
File without changes
|