1import{b1 as A,bw as k,bn as f,bt as p,cU as j}from"./szcXUDxO.js";function F(n,e={},t={}){const{t:s}=A(),u=j(n),l=f(()=>Object.keys(a.value)),a=p({}),o=p({}),y=()=>{a.value={},o.value={}},m=async r=>{a.value[r]=[];for(const i of e[r]||[]){const c=await i(u.value[r],r,u.value,s);c&&a.value[r].push(c)}o.value[r]=[];for(const i of t[r]||[]){const c=await i(u.value[r],r,u.value,s);c&&o.value[r].push(c)}},d=(r,i)=>!r[i]||!r[i].length?null:r[i][0],L=r=>l.value.includes(r),h=r=>d(a.value,r),g=r=>d(o.value,r),w=f(()=>Object.keys(o.value).flatMap(r=>o.value[r]||[])),b=f(()=>Object.keys(a.value).flatMap(r=>a.value[r]||[])),v={touched:l,errors:a,warnings:o,touch:m,isTouched:L,getFirstError:h,getFirstWarning:g,validate:async()=>{for(const r of Object.keys(u.value))await m(r);for(const r of Object.keys(u.value))if(h(r))return!1;return!0},removeErrorsAndWarnings:y,warningsAsList:w,errorsAsList:b};return{form:u,formInfo:v,...v}}function O(n,e=null){return async(t,s,u,l)=>{if(!t)return null;const a=await k(n(t));return!a.data.value||!a.data.value.total?null:e||l("'{value}' existe déjà ")}}function U(n=null){return(e,t,s,u)=>!e||Array.isArray(e)&&!e.length?n||u("Le champ est requis."):null}function I(n,e){return(t,s,u,l)=>n.value?e(t,s,u,l):null}function R(n,e=null){return(t,s,u,l)=>(!t||Array.isArray(t)&&!t.length)&&!u[n]?e||l("Le champ est requis."):null}function S(n,e=null){return(t,s,u,l)=>t&&t.length>=n?null:e||l("Le champ doit être de {min} caractères minimum",{min:n})}function z(n,e=null){return(t,s,u,l)=>!t||t.length<=n?null:e||l("Le champ doit être de {max} caractères maximum",{max:n})}function C(n,e=null){return(t,s,u,l)=>n&&t&&t.toLowerCase().split(" ").includes("test")?e||l("Si vous voulez faire des tests, utilisez «â¯{demoServer}â¯Â».",{demoServer:n}):null}function E(n=null){return(e,t,s,u)=>{if(!e)return null;try{return new URL(e),null}catch{return n||u("Le champ doit être une URL valide")}}}function M(n=null){return(e,t,s,u)=>{if(!e)return null;try{return new URL(e),n||u("Ce champ semble contenir un lien.")}catch{return null}}}function T(n=null){return(e,t,s,u)=>!e||/^\S+@\S+\.\S+$/.exec(e)?null:n||u("Le champ doit être une adresse e-mail valide")}export{I as a,E as b,R as c,z as d,T as e,O as f,M as l,S as m,U as r,C as t,F as u};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.