Files
equalityrecord_frontend_client/dist/assets/react-hook-form-67ae4fc1.js
T

2 lines
21 KiB
JavaScript
Raw Normal View History

2025-04-04 07:29:59 +01:00
import{R as B}from"./vendor-8efd6c0a.js";var fe=e=>e.type==="checkbox",ee=e=>e instanceof Date,L=e=>e==null;const Ze=e=>typeof e=="object";var D=e=>!L(e)&&!Array.isArray(e)&&Ze(e)&&!ee(e),gr=e=>D(e)&&e.target?fe(e.target)?e.target.checked:e.target.value:e,hr=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,vr=(e,s)=>e.has(hr(s)),_r=e=>{const s=e.constructor&&e.constructor.prototype;return D(s)&&s.hasOwnProperty("isPrototypeOf")},Te=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function M(e){let s;const t=Array.isArray(e);if(e instanceof Date)s=new Date(e);else if(e instanceof Set)s=new Set(e);else if(!(Te&&(e instanceof Blob||e instanceof FileList))&&(t||D(e)))if(s=t?[]:{},!t&&!_r(e))s=e;else for(const l in e)e.hasOwnProperty(l)&&(s[l]=M(e[l]));else return e;return s}var Fe=e=>Array.isArray(e)?e.filter(Boolean):[],w=e=>e===void 0,d=(e,s,t)=>{if(!s||!D(e))return t;const l=Fe(s.split(/[,[\].]+?/)).reduce((n,u)=>L(n)?n:n[u],e);return w(l)||l===e?w(e[s])?t:e[s]:l},W=e=>typeof e=="boolean",Oe=e=>/^\w*$/.test(e),er=e=>Fe(e.replace(/["|']|\]/g,"").split(/\.|\[/)),V=(e,s,t)=>{let l=-1;const n=Oe(s)?[s]:er(s),u=n.length,y=u-1;for(;++l<u;){const h=n[l];let p=t;if(l!==y){const q=e[h];p=D(q)||Array.isArray(q)?q:isNaN(+n[l+1])?{}:[]}if(h==="__proto__")return;e[h]=p,e=e[h]}return e};const He={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},I={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},z={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"};B.createContext(null);var br=(e,s,t,l=!0)=>{const n={defaultValues:s._defaultValues};for(const u in e)Object.defineProperty(n,u,{get:()=>{const y=u;return s._proxyFormState[y]!==I.all&&(s._proxyFormState[y]=!l||I.all),t&&(t[y]=!0),e[y]}});return n},C=e=>D(e)&&!Object.keys(e).length,Fr=(e,s,t,l)=>{t(e);const{name:n,...u}=e;return C(u)||Object.keys(u).length>=Object.keys(s).length||Object.keys(u).find(y=>s[y]===(!l||I.all))},ge=e=>Array.isArray(e)?e:[e];function Ar(e){const s=B.useRef(e);s.current=e,B.useEffect(()=>{const t=!e.disabled&&s.current.subject&&s.current.subject.subscribe({next:s.current.next});return()=>{t&&t.unsubscribe()}},[e.disabled])}var $=e=>typeof e=="string",Vr=(e,s,t,l,n)=>$(e)?(l&&s.watch.add(e),d(t,e,n)):Array.isArray(e)?e.map(u=>(l&&s.watch.add(u),d(t,u))):(l&&(s.watchAll=!0),t),xr=(e,s,t,l,n)=>s?{...t[e],types:{...t[e]&&t[e].types?t[e].types:{},[l]:n||!0}}:{},$e=e=>({isOnSubmit:!e||e===I.onSubmit,isOnBlur:e===I.onBlur,isOnChange:e===I.onChange,isOnAll:e===I.all,isOnTouch:e===I.onTouched}),je=(e,s,t)=>!t&&(s.watchAll||s.watch.has(e)||[...s.watch].some(l=>e.startsWith(l)&&/^\.\w+/.test(e.slice(l.length))));const oe=(e,s,t,l)=>{for(const n of t||Object.keys(e)){const u=d(e,n);if(u){const{_f:y,...h}=u;if(y){if(y.refs&&y.refs[0]&&s(y.refs[0],n)&&!l)return!0;if(y.ref&&s(y.ref,y.name)&&!l)return!0;if(oe(h,s))break}else if(D(h)&&oe(h,s))break}}};var wr=(e,s,t)=>{const l=ge(d(e,t));return V(l,"root",s[t]),V(e,t,l),e},Le=e=>e.type==="file",H=e=>typeof e=="function",ve=e=>{if(!Te)return!1;const s=e?e.ownerDocument:0;return e instanceof(s&&s.defaultView?s.defaultView.HTMLElement:HTMLElement)},he=e=>$(e),Ce=e=>e.type==="radio",_e=e=>e instanceof RegExp;const Ke={value:!1,isValid:!1},Ye={value:!0,isValid:!0};var rr=e=>{if(Array.isArray(e)){if(e.length>1){const s=e.filter(t=>t&&t.checked&&!t.disabled).map(t=>t.value);return{value:s,isValid:!!s.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!w(e[0].attributes.value)?w(e[0].value)||e[0].value===""?Ye:{value:e[0].value,isValid:!0}:Ye:Ke}return Ke};const ze={isValid:!1,value:null};var tr=e=>Array.isArray(e)?e.reduce((s,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:s,ze):ze;function Ge(e,s,t="validate"){if(he(e)||Array.isArray(e)&&e.every(he)||W(e)&&!e)return{type:t,message:he(e)?e:"",ref:s}}var se=e=>D(e)&&!_e(e)?e:{value:e,message:""},Je=async(e,s,t,l,n)=>{const{ref:u,refs:y,required:h,maxLength:p,minLength:q,min:x,max:b,pattern:ce,validate:G,name:N,valueAsNumber:Ae,mount:j,disabled: