vendor: 25,167 bytes, line 1
1var ps=t=>{throw TypeError(t)};var wr=(t,e,r)=>e.has(t)||ps("Cannot "+r);var v=(t,e,r)=>(wr(t,e,"read from private field"),r?r.call(t):e.get(t)),he=(t,e,r)=>e.has(t)?ps("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),J=(t,e,r,s)=>(wr(t,e,"write to private field"),s?s.call(t,r):e.set(t,r),r),ie=(t,e,r)=>(wr(t,e,"access private method"),r);import{R as G,j as h,H as je,r as fe,t as qn,c as mr,h as Gn,a as Yn,u as lt,S as K,b as ze,M as Jn,C as De,d as Wr,I as Kn,g as $s,e as Bs,f as Xn,s as zs,l as ea,i as ta,k as Hr,O as Ws,m as ra,T as sa,n as na,G as aa}from"./index-C8NiCK7J.js";import{S as ia,p as gs,r as Ie,s as Or,a as tr,n as oa,i as Tr,b as ys,t as ca,f as la,c as ua,d as _s,e as Hs,g as da,u as fa,h as vs,j as wt,k as et,l as Qs,F as kt,Q as ha,m as ma}from"./api-DYJfmEoC.js";import{f as X,e as pa,r as Qr,V as ga,I as ya,E as _a,T as va}from"./form-8dCjSg6w.js";import{i as qs,a as Gs,I as Ys}from"./i18next-c8Y8zinw.js";import{u as pr}from"./media-BcW9SRgY.js";import{u as ba}from"./oauth-P2uueZfj.js";var Yt=t=>t.type==="checkbox",tt=t=>t instanceof Date,be=t=>t==null;const Js=t=>typeof t=="object";var ne=t=>!be(t)&&!Array.isArray(t)&&Js(t)&&!tt(t),Ks=t=>ne(t)&&t.target?Yt(t.target)?t.target.checked:t.target.value:t,xa=t=>t.substring(0,t.search(/\.\d+(\.|$)/))||t,Xs=(t,e)=>t.has(xa(e)),wa=t=>{const e=t.constructor&&t.constructor.prototype;return ne(e)&&e.hasOwnProperty("isPrototypeOf")},qr=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function we(t){let e;const r=Array.isArray(t),s=typeof FileList<"u"?t instanceof FileList:!1;if(t instanceof Date)e=new Date(t);else if(t instanceof Set)e=new Set(t);else if(!(qr&&(t instanceof Blob||s))&&(r||ne(t)))if(e=r?[]:{},!r&&!wa(t))e=t;else for(const n in t)t.hasOwnProperty(n)&&(e[n]=we(t[n]));else return t;return e}var gr=t=>Array.isArray(t)?t.filter(Boolean):[],se=t=>t===void 0,_=(t,e,r)=>{if(!e||!ne(t))return r;const s=gr(e.split(/[,[\].]+?/)).reduce((n,a)=>be(n)?n:n[a],t);return se(s)||s===t?se(t[e])?r:t[e]:s},Ae=t=>typeof t=="boolean",Gr=t=>/^\w*$/.test(t),en=t=>gr(t.replace(/["|']|\]/g,"").split(/\.|\[/)),H=(t,e,r)=>{let s=-1;const n=Gr(e)?[e]:en(e),a=n.length,i=a-1;for(;++s<a;){const o=n[s];let l=r;if(s!==i){const u=t[o];l=ne(u)||Array.isArray(u)?u:isNaN(+n[s+1])?{}:[]}if(o==="__proto__"||o==="constructor"||o==="prototype")return;t[o]=l,t=t[o]}return t};const sr={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},Oe={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Le={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},ka=G.createContext(null),Yr=()=>G.useContext(ka);var tn=(t,e,r,s=!0)=>{const n={defaultValues:e._defaultValues};for(const a in t)Object.defineProperty(n,a,{get:()=>{const i=a;return e._proxyFormState[i]!==Oe.all&&(e._proxyFormState[i]=!s||Oe.all),r&&(r[i]=!0),t[i]}});return n},Se=t=>ne(t)&&!Object.keys(t).length,rn=(t,e,r,s)=>{r(t);const{name:n,...a}=t;return Se(a)||Object.keys(a).length>=Object.keys(e).length||Object.keys(a).find(i=>e[i]===(!s||Oe.all))},It=t=>Array.isArray(t)?t:[t],sn=(t,e,r)=>!t||!e||t===e||It(t).some(s=>s&&(r?s===e:s.startsWith(e)||e.startsWith(s)));function Jr(t){const e=G.useRef(t);e.current=t,G.useEffect(()=>{const r=!t.disabled&&e.current.subject&&e.current.subject.subscribe({next:e.current.next});return()=>{r&&r.unsubscribe()}},[t.disabled])}function Sa(t){const e=Yr(),{control:r=e.control,disabled:s,name:n,exact:a}=t||{},[i,o]=G.useState(r._formState),l=G.useRef(!0),u=G.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),f=G.useRef(n);return f.current=n,Jr({disabled:s,next:p=>l.current&&sn(f.current,p.name,a)&&rn(p,u.current,r._updateFormState)&&o({...r._formState,...p}),subject:r._subjects.state}),G.useEffect(()=>(l.current=!0,u.current.isValid&&r._updateValid(!0),()=>{l.current=!1}),[r]),G.useMemo(()=>tn(i,r,u.current,!1),[i,r])}var Ve=t=>typeof t=="string",nn=(t,e,r,s,n)=>Ve(t)?(s&&e.watch.add(t),_(r,t,n)):Array.isArray(t)?t.map(a=>(s&&e.watch.add(a),_(r,a))):(s&&(e.watchAll=!0),r);function Ea(t){const e=Yr(),{control:r=e.control,name:s,defaultValue:n,disabled:a,exact:i}=t||{},o=G.useRef(s);o.current=s,Jr({disabled:a,subject:r._subjects.values,next:f=>{sn(o.current,f.name,i)&&u(we(nn(o.current,r._names,f.values||r._formValues,!1,n)))}});const[l,u]=G.useState(r._getWatch(s,n));return G.useEffect(()=>r._removeUnmounted()),l}function Aa(t){const e=Yr(),{name:r,disabled:s,control:n=e.control,shouldUnregister:a}=t,i=Xs(n._names.array,r),o=Ea({control:n,name:r,defaultValue:_(n._formValues,r,_(n._defaultValues,r,t.defaultValue)),exact:!0}),l=Sa({control:n,name:r,exact:!0}),u=G.useRef(n.register(r,{...t.rules,value:o,...Ae(t.disabled)?{disabled:t.disabled}:{}})),f=G.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!_(l.errors,r)},isDirty:{enumerable:!0,get:()=>!!_(l.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!_(l.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!_(l.validatingFields,r)},error:{enumerable:!0,get:()=>_(l.errors,r)}}),[l,r]),p=G.useMemo(()=>({name:r,value:o,...Ae(s)||l.disabled?{disabled:l.disabled||s}:{},onChange:A=>u.current.onChange({target:{value:Ks(A),name:r},type:sr.CHANGE}),onBlur:()=>u.current.onBlur({target:{value:_(n._formValues,r),name:r},type:sr.BLUR}),ref:A=>{const S=_(n._fields,r);S&&A&&(S._f.ref={focus:()=>A.focus(),select:()=>A.select(),setCustomValidity:F=>A.setCustomValidity(F),reportValidity:()=>A.reportValidity()})}}),[r,n._formValues,s,l.disabled,o,n._fields]);return G.useEffect(()=>{const A=n._options.shouldUnregister||a,S=(F,L)=>{const O=_(n._fields,F);O&&O._f&&(O._f.mount=L)};if(S(r,!0),A){const F=we(_(n._options.defaultValues,r));H(n._defaultValues,r,F),se(_(n._formValues,r))&&H(n._formValues,r,F)}return!i&&n.register(r),()=>{(i?A&&!n._state.action:A)?n.unregister(r):S(r,!1)}},[r,n,i,a]),G.useEffect(()=>{n._updateDisabledField({disabled:s,fields:n._fields,name:r})},[s,r,n]),G.useMemo(()=>({field:p,formState:l,fieldState:f}),[p,l,f])}const ja=t=>t.render(Aa(t));var an=(t,e,r,s,n)=>e?{...r[t],types:{...r[t]&&r[t].types?r[t].types:{},[s]:n||!0}}:{},bs=t=>({isOnSubmit:!t||t===Oe.onSubmit,isOnBlur:t===Oe.onBlur,isOnChange:t===Oe.onChange,isOnAll:t===Oe.all,isOnTouch:t===Oe.onTouched}),xs=(t,e,r)=>!r&&(e.watchAll||e.watch.has(t)||[...e.watch].some(s=>t.startsWith(s)&&/^\.\w+/.test(t.slice(s.length))));const Nt=(t,e,r,s)=>{for(const n of r||Object.keys(t)){const a=_(t,n);if(a){const{_f:i,...o}=a;if(i){if(i.refs&&i.refs[0]&&e(i.refs[0],n)&&!s)return!0;if(i.ref&&e(i.ref,i.name)&&!s)return!0;if(Nt(o,e))break}else if(ne(o)&&Nt(o,e))break}}};var Oa=(t,e,r)=>{const s=It(_(t,r));return H(s,"root",e[r]),H(t,r,s),t},Kr=t=>t.type==="file",Ne=t=>typeof t=="function",nr=t=>{if(!qr)return!1;const e=t?t.ownerDocument:0;return t instanceof(e&&e.defaultView?e.defaultView.HTMLElement:HTMLElement)},rr=t=>Ve(t),Xr=t=>t.type==="radio",ar=t=>t instanceof RegExp;const ws={value:!1,isValid:!1},ks={value:!0,isValid:!0};var on=t=>{if(Array.isArray(t)){if(t.length>1){const e=t.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:e,isValid:!!e.length}}return t[0].checked&&!t[0].disabled?t[0].attributes&&!se(t[0].attributes.value)?se(t[0].value)||t[0].value===""?ks:{value:t[0].value,isValid:!0}:ks:ws}return ws};const Ss={isValid:!1,value:null};var cn=t=>Array.isArray(t)?t.reduce((e,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:e,Ss):Ss;function Es(t,e,r="validate"){if(rr(t)||Array.isArray(t)&&t.every(rr)||Ae(t)&&!t)return{type:r,message:rr(t)?t:"",ref:e}}var ut=t=>ne(t)&&!ar(t)?t:{value:t,message:""},As=async(t,e,r,s,n,a)=>{const{ref:i,refs:o,required:l,maxLength:u,minLength:f,min:p,max:A,pattern:S,validate:F,name:L,valueAsNumber:O,mount:B}=t._f,j=_(r,L);if(!B||e.has(L))return{};const U=o?o[0]:i,ee=I=>{n&&U.reportValidity&&(U.setCustomValidity(Ae(I)?"":I||""),U.reportValidity())},P={},q=Xr(i),V=Yt(i),ae=q||V,Z=(O||Kr(i))&&se(i.value)&&se(j)||nr(i)&&i.value===""||j===""||Array.isArray(j)&&!j.length,Y=an.bind(null,L,s,P),pe=(I,W,re,ce=Le.maxLength,_e=Le.minLength)=>{const ge=I?W:re;P[L]={type:I?ce:_e,message:ge,ref:i,...Y(I?ce:_e,ge)}};if(a?!Array.isArray(j)||!j.length:l&&(!ae&&(Z||be(j))||Ae(j)&&!j||V&&!on(o).isValid||q&&!cn(o).isValid)){const{value:I,message:W}=rr(l)?{value:!!l,message:l}:ut(l);if(I&&(P[L]={type:Le.required,message:W,ref:U,...Y(Le.required,W)},!s))return ee(W),P}if(!Z&&(!be(p)||!be(A))){let I,W;const re=ut(A),ce=ut(p);if(!be(j)&&!isNaN(j)){const _e=i.valueAsNumber||j&&+j;be(re.value)||(I=_e>re.value),be(ce.value)||(W=_e<ce.value)}else{const _e=i.valueAsDate||new Date(j),ge=jt=>new Date(new Date().toDateString()+" "+jt),Et=i.type=="time",At=i.type=="week";Ve(re.value)&&j&&(I=Et?ge(j)>ge(re.value):At?j>re.value:_e>new Date(re.value)),Ve(ce.value)&&j&&(W=Et?ge(j)<ge(ce.value):At?j<ce.value:_e<new Date(ce.value))}if((I||W)&&(pe(!!I,re.message,ce.message,Le.max,Le.min),!s))return ee(P[L].message),P}if((u||f)&&!Z&&(Ve(j)||a&&Array.isArray(j))){const I=ut(u),W=ut(f),re=!be(I.value)&&j.length>+I.value,ce=!be(W.value)&&j.length<+W.value;if((re||ce)&&(pe(re,I.message,W.message),!s))return ee(P[L].message),P}if(S&&!Z&&Ve(j)){const{value:I,message:W}=ut(S);if(ar(I)&&!j.match(I)&&(P[L]={type:Le.pattern,message:W,ref:i,...Y(Le.pattern,W)},!s))return ee(W),P}if(F){if(Ne(F)){const I=await F(j,r),W=Es(I,U);if(W&&(P[L]={...W,...Y(Le.validate,W.message)},!s))return ee(W.message),P}else if(ne(F)){let I={};for(const W in F){if(!Se(I)&&!s)break;const re=Es(await F[W](j,r),U,W);re&&(I={...re,...Y(W,re.message)},ee(re.message),s&&(P[L]=I))}if(!Se(I)&&(P[L]={ref:U,...I},!s))return P}}return ee(!0),P};function Ta(t,e){const r=e.slice(0,-1).length;let s=0;for(;s<r;)t=se(t)?s++:t[e[s++]];return t}function Ca(t){for(const e in t)if(t.hasOwnProperty(e)&&!se(t[e]))return!1;return!0}function le(t,e){const r=Array.isArray(e)?e:Gr(e)?[e]:en(e),s=r.length===1?t:Ta(t,r),n=r.length-1,a=r[n];return s&&delete s[a],n!==0&&(ne(s)&&Se(s)||Array.isArray(s)&&Ca(s))&&le(t,r.slice(0,-1)),t}var kr=()=>{let t=[];return{get observers(){return t},next:n=>{for(const a of t)a.next&&a.next(n)},subscribe:n=>(t.push(n),{unsubscribe:()=>{t=t.filter(a=>a!==n)}}),unsubscribe:()=>{t=[]}}},Cr=t=>be(t)||!Js(t);function Qe(t,e){if(Cr(t)||Cr(e))return t===e;if(tt(t)&&tt(e))return t.getTime()===e.getTime();const r=Object.keys(t),s=Object.keys(e);if(r.length!==s.length)return!1;for(const n of r){const a=t[n];if(!s.includes(n))return!1;if(n!=="ref"){const i=e[n];if(tt(a)&&tt(i)||ne(a)&&ne(i)||Array.isArray(a)&&Array.isArray(i)?!Qe(a,i):a!==i)return!1}}return!0}var ln=t=>t.type==="select-multiple",Ra=t=>Xr(t)||Yt(t),Sr=t=>nr(t)&&t.isConnected,un=t=>{for(const e in t)if(Ne(t[e]))return!0;return!1};function ir(t,e={}){const r=Array.isArray(t);if(ne(t)||r)for(const s in t)Array.isArray(t[s])||ne(t[s])&&!un(t[s])?(e[s]=Array.isArray(t[s])?[]:{},ir(t[s],e[s])):be(t[s])||(e[s]=!0);return e}function dn(t,e,r){const s=Array.isArray(t);if(ne(t)||s)for(const n in t)Array.isArray(t[n])||ne(t[n])&&!un(t[n])?se(e)||Cr(r[n])?r[n]=Array.isArray(t[n])?ir(t[n],[]):{...ir(t[n])}:dn(t[n],be(e)?{}:e[n],r[n]):r[n]=!Qe(t[n],e[n]);return r}var Ot=(t,e)=>dn(t,e,ir(e)),fn=(t,{valueAsNumber:e,valueAsDate:r,setValueAs:s})=>se(t)?t:e?t===""?NaN:t&&+t:r&&Ve(t)?new Date(t):s?s(t):t;function Er(t){const e=t.ref;return Kr(e)?e.files:Xr(e)?cn(t.refs).value:ln(e)?[...e.selectedOptions].map(({value:r})=>r):Yt(e)?on(t.refs).value:fn(se(e.value)?t.ref.value:e.value,t)}var Fa=(t,e,r,s)=>{const n={};for(const a of t){const i=_(e,a);i&&H(n,a,i._f)}return{criteriaMode:r,names:[...t],fields:n,shouldUseNativeValidation:s}},Tt=t=>se(t)?t:ar(t)?t.source:ne(t)?ar(t.value)?t.value.source:t.value:t;const js="AsyncFunction";var Ia=t=>!!t&&!!t.validate&&!!(Ne(t.validate)&&t.validate.constructor.name===js||ne(t.validate)&&Object.values(t.validate).find(e=>e.constructor.name===js)),Na=t=>t.mount&&(t.required||t.min||t.max||t.maxLength||t.minLength||t.pattern||t.validate);function Os(t,e,r){const s=_(t,r);if(s||Gr(r))return{error:s,name:r};const n=r.split(".");for(;n.length;){const a=n.join("."),i=_(e,a),o=_(t,a);if(i&&!Array.isArray(i)&&r!==a)return{name:r};if(o&&o.type)return{name:a,error:o};n.pop()}return{name:r}}var Va=(t,e,r,s,n)=>n.isOnAll?!1:!r&&n.isOnTouch?!(e||t):(r?s.isOnBlur:n.isOnBlur)?!t:(r?s.isOnChange:n.isOnChange)?t:!0,Da=(t,e)=>!gr(_(t,e)).length&&le(t,e);const Pa={mode:Oe.onSubmit,reValidateMode:Oe.onChange,shouldFocusError:!0};function Ma(t={}){let e={...Pa,...t},r={submitCount:0,isDirty:!1,isLoading:Ne(e.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1},s={},n=ne(e.defaultValues)||ne(e.values)?we(e.defaultValues||e.values)||{}:{},a=e.shouldUnregister?{}:we(n),i={action:!1,mount:!1,watch:!1},o={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},l,u=0;const f={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},p={values:kr(),array:kr(),state:kr()},A=bs(e.mode),S=bs(e.reValidateMode),F=e.criteriaMode===Oe.all,L=c=>d=>{clearTimeout(u),u=setTimeout(c,d)},O=async c=>{if(!e.disabled&&(f.isValid||c)){const d=e.resolver?Se((await ae()).errors):await Y(s,!0);d!==r.isValid&&p.state.next({isValid:d})}},B=(c,d)=>{!e.disabled&&(f.isValidating||f.validatingFields)&&((c||Array.from(o.mount)).forEach(m=>{m&&(d?H(r.validatingFields,m,d):le(r.validatingFields,m))}),p.state.next({validatingFields:r.validatingFields,isValidating:!Se(r.validatingFields)}))},j=(c,d=[],m,w,b=!0,y=!0)=>{if(w&&m&&!e.disabled){if(i.action=!0,y&&Array.isArray(_(s,c))){const T=m(_(s,c),w.argA,w.argB);b&&H(s,c,T)}if(y&&Array.isArray(_(r.errors,c))){const T=m(_(r.errors,c),w.argA,w.argB);b&&H(r.errors,c,T),Da(r.errors,c)}if(f.touchedFields&&y&&Array.isArray(_(r.touchedFields,c))){const T=m(_(r.touchedFields,c),w.argA,w.argB);b&&H(r.touchedFields,c,T)}f.dirtyFields&&(r.dirtyFields=Ot(n,a)),p.state.next({name:c,isDirty:I(c,d),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else H(a,c,d)},U=(c,d)=>{H(r.errors,c,d),p.state.next({errors:r.errors})},ee=c=>{r.errors=c,p.state.next({errors:r.errors,isValid:!1})},P=(c,d,m,w)=>{const b=_(s,c);if(b){const y=_(a,c,se(m)?_(n,c):m);se(y)||w&&w.defaultChecked||d?H(a,c,d?y:Er(b._f)):ce(c,y),i.mount&&O()}},q=(c,d,m,w,b)=>{let y=!1,T=!1;const M={name:c};if(!e.disabled){const ue=!!(_(s,c)&&_(s,c)._f&&_(s,c)._f.disabled);if(!m||w){f.isDirty&&(T=r.isDirty,r.isDirty=M.isDirty=I(),y=T!==M.isDirty);const de=ue||Qe(_(n,c),d);T=!!(!ue&&_(r.dirtyFields,c)),de||ue?le(r.dirtyFields,c):H(r.dirtyFields,c,!0),M.dirtyFields=r.dirtyFields,y=y||f.dirtyFields&&T!==!de}if(m){const de=_(r.touchedFields,c);de||(H(r.touchedFields,c,m),M.touchedFields=r.touchedFields,y=y||f.touchedFields&&de!==m)}y&&b&&p.state.next(M)}return y?M:{}},V=(c,d,m,w)=>{const b=_(r.errors,c),y=f.isValid&&Ae(d)&&r.isValid!==d;if(e.delayError&&m?(l=L(()=>U(c,m)),l(e.delayError)):(clearTimeout(u),l=null,m?H(r.errors,c,m):le(r.errors,c)),(m?!Qe(b,m):b)||!Se(w)||y){const T={...w,...y&&Ae(d)?{isValid:d}:{},errors:r.errors,name:c};r={...r,...T},p.state.next(T)}},ae=async c=>{B(c,!0);const d=await e.resolver(a,e.context,Fa(c||o.mount,s,e.criteriaMode,e.shouldUseNativeValidation));return B(c),d},Z=async c=>{const{errors:d}=await ae(c);if(c)for(const m of c){const w=_(d,m);w?H(r.errors,m,w):le(r.errors,m)}else r.errors=d;return d},Y=async(c,d,m={valid:!0})=>{for(const w in c){const b=c[w];if(b){const{_f:y,...T}=b;if(y){const M=o.array.has(y.name),ue=b._f&&Ia(b._f);ue&&f.validatingFields&&B([w],!0);const de=await As(b,o.disabled,a,F,e.shouldUseNativeValidation&&!d,M);if(ue&&f.validatingFields&&B([w]),de[y.name]&&(m.valid=!1,d))break;!d&&(_(de,y.name)?M?Oa(r.errors,de,y.name):H(r.errors,y.name,de[y.name]):le(r.errors,y.name))}!Se(T)&&await Y(T,d,m)}}return m.valid},pe=()=>{for(const c of o.unMount){const d=_(s,c);d&&(d._f.refs?d._f.refs.every(m=>!Sr(m)):!Sr(d._f.ref))&&_r(c)}o.unMount=new Set},I=(c,d)=>!e.disabled&&(c&&d&&H(a,c,d),!Qe(as(),n)),W=(c,d,m)=>nn(c,o,{...i.mount?a:se(d)?n:Ve(c)?{[c]:d}:d},m,d),re=c=>gr(_(i.mount?a:n,c,e.shouldUnregister?_(n,c,[]):[])),ce=(c,d,m={})=>{const w=_(s,c);let b=d;if(w){const y=w._f;y&&(!y.disabled&&H(a,c,fn(d,y)),b=nr(y.ref)&&be(d)?"":d,ln(y.ref)?[...y.ref.options].forEach(T=>T.selected=b.includes(T.value)):y.refs?Yt(y.ref)?y.refs.length>1?y.refs.forEach(T=>(!T.defaultChecked||!T.disabled)&&(T.checked=Array.isArray(b)?!!b.find(M=>M===T.value):b===T.value)):y.refs[0]&&(y.refs[0].checked=!!b):y.refs.forEach(T=>T.checked=T.value===b):Kr(y.ref)?y.ref.value="":(y.ref.value=b,y.ref.type||p.values.next({name:c,values:{...a}})))}(m.shouldDirty||m.shouldTouch)&&q(c,b,m.shouldTouch,m.shouldDirty,!0),m.shouldValidate&&jt(c)},_e=(c,d,m)=>{for(const w in d){const b=d[w],y=`${c}.${w}`,T=_(s,y);(o.array.has(c)||ne(b)||T&&!T._f)&&!tt(b)?_e(y,b,m):ce(y,b,m)}},ge=(c,d,m={})=>{const w=_(s,c),b=o.array.has(c),y=we(d);H(a,c,y),b?(p.array.next({name:c,values:{...a}}),(f.isDirty||f.dirtyFields)&&m.shouldDirty&&p.state.next({name:c,dirtyFields:Ot(n,a),isDirty:I(c,y)})):w&&!w._f&&!be(y)?_e(c,y,m):ce(c,y,m),xs(c,o)&&p.state.next({...r}),p.values.next({name:i.mount?c:void 0,values:{...a}})},Et=async c=>{i.mount=!0;const d=c.target;let m=d.name,w=!0;const b=_(s,m),y=()=>d.type?Er(b._f):Ks(c),T=M=>{w=Number.isNaN(M)||tt(M)&&isNaN(M.getTime())||Qe(M,_(a,m,M))};if(b){let M,ue;const de=y(),He=c.type===sr.BLUR||c.type===sr.FOCUS_OUT,Wn=!Na(b._f)&&!e.resolver&&!_(r.errors,m)&&!b._f.deps||Va(He,_(r.touchedFields,m),r.isSubmitted,S,A),br=xs(m,o,He);H(a,m,de),He?(b._f.onBlur&&b._f.onBlur(c),l&&l(0)):b._f.onChange&&b._f.onChange(c);const xr=q(m,de,He,!1),Hn=!Se(xr)||br;if(!He&&p.values.next({name:m,type:c.type,values:{...a}}),Wn)return f.isValid&&(e.mode==="onBlur"&&He?O():He||O()),Hn&&p.state.next({name:m,...br?{}:xr});if(!He&&br&&p.state.next({...r}),e.resolver){const{errors:hs}=await ae([m]);if(T(de),w){const Qn=Os(r.errors,s,m),ms=Os(hs,s,Qn.name||m);M=ms.error,m=ms.name,ue=Se(hs)}}else B([m],!0),M=(await As(b,o.disabled,a,F,e.shouldUseNativeValidation))[m],B([m]),T(de),w&&(M?ue=!1:f.isValid&&(ue=await Y(s,!0)));w&&(b._f.deps&&jt(b._f.deps),V(m,ue,M,xr))}},At=(c,d)=>{if(_(r.errors,d)&&c.focus)return c.focus(),1},jt=async(c,d={})=>{let m,w;const b=It(c);if(e.resolver){const y=await Z(se(c)?c:b);m=Se(y),w=c?!b.some(T=>_(y,T)):m}else c?(w=(await Promise.all(b.map(async y=>{const T=_(s,y);return await Y(T&&T._f?{[y]:T}:T)}))).every(Boolean),!(!w&&!r.isValid)&&O()):w=m=await Y(s);return p.state.next({...!Ve(c)||f.isValid&&m!==r.isValid?{}:{name:c},...e.resolver||!c?{isValid:m}:{},errors:r.errors}),d.shouldFocus&&!w&&Nt(s,At,c?b:o.mount),w},as=c=>{const d={...i.mount?a:n};return se(c)?d:Ve(c)?_(d,c):c.map(m=>_(d,m))},is=(c,d)=>({invalid:!!_((d||r).errors,c),isDirty:!!_((d||r).dirtyFields,c),error:_((d||r).errors,c),isValidating:!!_(r.validatingFields,c),isTouched:!!_((d||r).touchedFields,c)}),Un=c=>{c&&It(c).forEach(d=>le(r.errors,d)),p.state.next({errors:c?r.errors:{}})},os=(c,d,m)=>{const w=(_(s,c,{_f:{}})._f||{}).ref,b=_(r.errors,c)||{},{ref:y,message:T,type:M,...ue}=b;H(r.errors,c,{...ue,...d,ref:w}),p.state.next({name:c,errors:r.errors,isValid:!1}),m&&m.shouldFocus&&w&&w.focus&&w.focus()},$n=(c,d)=>Ne(c)?p.values.subscribe({next:m=>c(W(void 0,d),m)}):W(c,d,!0),_r=(c,d={})=>{for(const m of c?It(c):o.mount)o.mount.delete(m),o.array.delete(m),d.keepValue||(le(s,m),le(a,m)),!d.keepError&&le(r.errors,m),!d.keepDirty&&le(r.dirtyFields,m),!d.keepTouched&&le(r.touchedFields,m),!d.keepIsValidating&&le(r.validatingFields,m),!e.shouldUnregister&&!d.keepDefaultValue&&le(n,m);p.values.next({values:{...a}}),p.state.next({...r,...d.keepDirty?{isDirty:I()}:{}}),!d.keepIsValid&&O()},cs=({disabled:c,name:d,field:m,fields:w})=>{(Ae(c)&&i.mount||c||o.disabled.has(d))&&(c?o.disabled.add(d):o.disabled.delete(d),q(d,Er(m?m._f:_(w,d)._f),!1,!1,!0))},vr=(c,d={})=>{let m=_(s,c);const w=Ae(d.disabled)||Ae(e.disabled);return H(s,c,{...m||{},_f:{...m&&m._f?m._f:{ref:{name:c}},name:c,mount:!0,...d}}),o.mount.add(c),m?cs({field:m,disabled:Ae(d.disabled)?d.disabled:e.disabled,name:c}):P(c,!0,d.value),{...w?{disabled:d.disabled||e.disabled}:{},...e.progressive?{required:!!d.required,min:Tt(d.min),max:Tt(d.max),minLength:Tt(d.minLength),maxLength:Tt(d.maxLength),pattern:Tt(d.pattern)}:{},name:c,onChange:Et,onBlur:Et,ref:b=>{if(b){vr(c,d),m=_(s,c);const y=se(b.value)&&b.querySelectorAll&&b.querySelectorAll("input,select,textarea")[0]||b,T=Ra(y),M=m._f.refs||[];if(T?M.find(ue=>ue===y):y===m._f.ref)return;H(s,c,{_f:{...m._f,...T?{refs:[...M.filter(Sr),y,...Array.isArray(_(n,c))?[{}]:[]],ref:{type:y.type,name:c}}:{ref:y}}}),P(c,!1,void 0,y)}else m=_(s,c,{}),m._f&&(m._f.mount=!1),(e.shouldUnregister||d.shouldUnregister)&&!(Xs(o.array,c)&&i.action)&&o.unMount.add(c)}}},ls=()=>e.shouldFocusError&&Nt(s,At,o.mount),Bn=c=>{Ae(c)&&(p.state.next({disabled:c}),Nt(s,(d,m)=>{const w=_(s,m);w&&(d.disabled=w._f.disabled||c,Array.isArray(w._f.refs)&&w._f.refs.forEach(b=>{b.disabled=w._f.disabled||c}))},0,!1))},us=(c,d)=>async m=>{let w;m&&(m.preventDefault&&m.preventDefault(),m.persist&&m.persist());let b=we(a);if(o.disabled.size)for(const y of o.disabled)H(b,y,void 0);if(p.state.next({isSubmitting:!0}),e.resolver){const{errors:y,values:T}=await ae();r.errors=y,b=T}else await Y(s);if(le(r.errors,"root"),Se(r.errors)){p.state.next({errors:{}});try{await c(b,m)}catch(y){w=y}}else d&&await d({...r.errors},m),ls(),setTimeout(ls);if(p.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Se(r.errors)&&!w,submitCount:r.submitCount+1,errors:r.errors}),w)throw w},zn=(c,d={})=>{_(s,c)&&(se(d.defaultValue)?ge(c,we(_(n,c))):(ge(c,d.defaultValue),H(n,c,we(d.defaultValue))),d.keepTouched||le(r.touchedFields,c),d.keepDirty||(le(r.dirtyFields,c),r.isDirty=d.defaultValue?I(c,we(_(n,c))):I()),d.keepError||(le(r.errors,c),f.isValid&&O()),p.state.next({...r}))},ds=(c,d={})=>{const m=c?we(c):n,w=we(m),b=Se(c),y=b?n:w;if(d.keepDefaultValues||(n=m),!d.keepValues){if(d.keepDirtyValues){const T=new Set([...o.mount,...Object.keys(Ot(n,a))]);for(const M of Array.from(T))_(r.dirtyFields,M)?H(y,M,_(a,M)):ge(M,_(y,M))}else{if(qr&&se(c))for(const T of o.mount){const M=_(s,T);if(M&&M._f){const ue=Array.isArray(M._f.refs)?M._f.refs[0]:M._f.ref;if(nr(ue)){const de=ue.closest("form");if(de){de.reset();break}}}}s={}}a=e.shouldUnregister?d.keepDefaultValues?we(n):{}:we(y),p.array.next({values:{...y}}),p.values.next({values:{...y}})}o={mount:d.keepDirtyValues?o.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},i.mount=!f.isValid||!!d.keepIsValid||!!d.keepDirtyValues,i.watch=!!e.shouldUnregister,p.state.next({submitCount:d.keepSubmitCount?r.submitCount:0,isDirty:b?!1:d.keepDirty?r.isDirty:!!(d.keepDefaultValues&&!Qe(c,n)),isSubmitted:d.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:b?{}:d.keepDirtyValues?d.keepDefaultValues&&a?Ot(n,a):r.dirtyFields:d.keepDefaultValues&&c?Ot(n,c):d.keepDirty?r.dirtyFields:{},touchedFields:d.keepTouched?r.touchedFields:{},errors:d.keepErrors?r.errors:{},isSubmitSuccessful:d.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1})},fs=(c,d)=>ds(Ne(c)?c(a):c,d);return{control:{register:vr,unregister:_r,getFieldState:is,handleSubmit:us,setError:os,_executeSchema:ae,_getWatch:W,_getDirty:I,_updateValid:O,_removeUnmounted:pe,_updateFieldArray:j,_updateDisabledField:cs,_getFieldArray:re,_reset:ds,_resetDefaultValues:()=>Ne(e.defaultValues)&&e.defaultValues().then(c=>{fs(c,e.resetOptions),p.state.next({isLoading:!1})}),_updateFormState:c=>{r={...r,...c}},_disableForm:Bn,_subjects:p,_proxyFormState:f,_setErrors:ee,get _fields(){return s},get _formValues(){return a},get _state(){return i},set _state(c){i=c},get _defaultValues(){return n},get _names(){return o},set _names(c){o=c},get _formState(){return r},set _formState(c){r=c},get _options(){return e},set _options(c){e={...e,...c}}},trigger:jt,register:vr,handleSubmit:us,watch:$n,setValue:ge,getValues:as,reset:fs,resetField:zn,clearErrors:Un,unregister:_r,setError:os,setFocus:(c,d={})=>{const m=_(s,c),w=m&&m._f;if(w){const b=w.refs?w.refs[0]:w.ref;b.focus&&(b.focus(),d.shouldSelect&&Ne(b.select)&&b.select())}},getFieldState:is}}function Jt(t={}){const e=G.useRef(void 0),r=G.useRef(void 0),[s,n]=G.useState({isDirty:!1,isValidating:!1,isLoading:Ne(t.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1,defaultValues:Ne(t.defaultValues)?void 0:t.defaultValues});e.current||(e.current={...Ma(t),formState:s});const a=e.current.control;return a._options=t,Jr({subject:a._subjects.state,next:i=>{rn(i,a._proxyFormState,a._updateFormState,!0)&&n({...a._formState})}}),G.useEffect(()=>a._disableForm(t.disabled),[a,t.disabled]),G.useEffect(()=>{if(a._proxyFormState.isDirty){const i=a._getDirty();i!==s.isDirty&&a._subjects.state.next({isDirty:i}
1)}},[a,s.isDirty]),G.useEffect(()=>{t.values&&!Qe(t.values,r.current)?(a._reset(t.values,a._options.resetOptions),r.current=t.values,n(i=>({...i}))):a._resetDefaultValues()},[t.values,a]),G.useEffect(()=>{t.errors&&a._setErrors(t.errors)},[t.errors,a]),G.useEffect(()=>{a._state.mount||(a._updateValid(),a._state.mount=!0),a._state.watch&&(a._state.watch=!1,a._subjects.state.next({...a._formState})),a._removeUnmounted()}),G.useEffect(()=>{t.shouldUnregister&&a._subjects.values.next({values:a._getWatch()})},[t.shouldUnregister,a]),e.current.formState=tn(s,a),e.current}const Ts=(t,e,r)=>{if(t&&"reportValidity"in t){const s=_(r,e);t.setCustomValidity(s&&s.message||""),t.reportValidity()}},hn=(t,e)=>{for(const r in e.fields){const s=e.fields[r];s&&s.ref&&"reportValidity"in s.ref?Ts(s.ref,r,t):s&&s.refs&&s.refs.forEach(n=>Ts(n,r,t))}},Za=(t,e)=>{e.shouldUseNativeValidation&&hn(t,e);const r={};for(const s in t){const n=_(e.fields,s),a=Object.assign(t[s]||{},{ref:n&&n.ref});if(La(e.names||Object.keys(t),s)){const i=Object.assign({},_(r,s));H(i,"root",a),H(r,s,i)}else H(r,s,a)}return r},La=(t,e)=>{const r=Cs(e);return t.some(s=>Cs(s).match(`^${r}\\.\\d+`))};function Cs(t){return t.replace(/\]|\[/g,"")}function Ua(t,e){for(var r={};t.length;){var s=t[0],n=s.code,a=s.message,i=s.path.join(".");if(!r[i])if("unionErrors"in s){var o=s.unionErrors[0].errors[0];r[i]={message:o.message,type:o.code}}else r[i]={message:a,type:n};if("unionErrors"in s&&s.unionErrors.forEach(function(f){return f.errors.forEach(function(p){return t.push(p)})}),e){var l=r[i].types,u=l&&l[s.code];r[i]=an(i,e,r,n,u?[].concat(u,s.message):s.message)}t.shift()}return r}function Kt(t,e,r){return r===void 0&&(r={}),function(s,n,a){try{return Promise.resolve(function(i,o){try{var l=Promise.resolve(t[r.mode==="sync"?"parse":"parseAsync"](s,e)).then(function(u){return a.shouldUseNativeValidation&&hn({},a),{errors:{},values:r.raw?Object.assign({},s):u}})}catch(u){return o(u)}return l&&l.then?l.then(void 0,o):l}(0,function(i){if(function(o){return Array.isArray(o==null?void 0:o.errors)}(i))return{values:{},errors:Za(Ua(i.errors,!a.shouldUseNativeValidation&&a.criteriaMode==="all"),a)};throw i}))}catch(i){return Promise.reject(i)}}}const mn=({label:t})=>h.jsxs(je,{alignItems:"center",children:[h.jsx("img",{src:"/auth-form/login/avatar.svg",alt:"avatar",style:{height:"36px",width:"36px"}}),h.jsx("span",{className:"_fw-600 _fs-400",children:t})]}),$a=t=>{var e,r,s;if(t){const n=(r=(e=t==null?void 0:t.data)==null?void 0:e.error)==null?void 0:r.detail;if(typeof n=="string"||n instanceof String)return n;try{const a=Object.values(n||{});if(a!=null&&a.length)return(s=a.map(i=>i[0]))==null?void 0:s[0]}catch{return"common.error.message.general"}return"common.error.message.general"}return null},Ba=t=>{var e,r;if(t){const s=(r=(e=t==null?void 0:t.data)==null?void 0:e.error)==null?void 0:r.detail;if(typeof s=="string"||s instanceof String)return[s];try{const n=[],a=Object.values(s||{});if(a!=null&&a.length)return a.forEach(i=>i.forEach(o=>{n.push(o)})),n}catch{return["common.error.message.general"]}return["common.error.message.general"]}return null},St={getFirst:$a,getList:Ba},pn=t=>{for(const e in t)if(t.hasOwnProperty(e))return!1;return!0},za=t=>{const{children:e,gap:r=2,className:s,as:n="div",columns:a,onClick:i,onSubmit:o,style:l,...u}=t;return fe.createElement(n,{className:mr(s),style:{display:"grid",gap:qn(r),gridTemplateColumns:`repeat(${a}, minmax(0px, 1fr))`,...u,...l},onClick:i,onSubmit:o},e)};var z;(function(t){t.assertEqual=n=>n;function e(n){}t.assertIs=e;function r(n){throw new Error}t.assertNever=r,t.arrayToEnum=n=>{const a={};for(const i of n)a[i]=i;return a},t.getValidEnumValues=n=>{const a=t.objectKeys(n).filter(o=>typeof n[n[o]]!="number"),i={};for(const o of a)i[o]=n[o];return t.objectValues(i)},t.objectValues=n=>t.objectKeys(n).map(function(a){return n[a]}),t.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{const a=[];for(const i in n)Object.prototype.hasOwnProperty.call(n,i)&&a.push(i);return a},t.find=(n,a)=>{for(const i of n)if(a(i))return i},t.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&isFinite(n)&&Math.floor(n)===n;function s(n,a=" | "){return n.map(i=>typeof i=="string"?`'${i}'`:i).join(a)}t.joinValues=s,t.jsonStringifyReplacer=(n,a)=>typeof a=="bigint"?a.toString():a})(z||(z={}));var Rr;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(Rr||(Rr={}));const k=z.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),$e=t=>{switch(typeof t){case"undefined":return k.undefined;case"string":return k.string;case"number":return isNaN(t)?k.nan:k.number;case"boolean":return k.boolean;case"function":return k.function;case"bigint":return k.bigint;case"symbol":return k.symbol;case"object":return Array.isArray(t)?k.array:t===null?k.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?k.promise:typeof Map<"u"&&t instanceof Map?k.map:typeof Set<"u"&&t instanceof Set?k.set:typeof Date<"u"&&t instanceof Date?k.date:k.object;default:return k.unknown}}
vendor: 53,152 bytes, line 1
1,g=z.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),Wa=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");class Ee extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=s=>{this.issues=[...this.issues,s]},this.addIssues=(s=[])=>{this.issues=[...this.issues,...s]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}format(e){const r=e||function(a){return a.message},s={_errors:[]},n=a=>{for(const i of a.issues)if(i.code==="invalid_union")i.unionErrors.map(n);else if(i.code==="invalid_return_type")n(i.returnTypeError);else if(i.code==="invalid_arguments")n(i.argumentsError);else if(i.path.length===0)s._errors.push(r(i));else{let o=s,l=0;for(;l<i.path.length;){const u=i.path[l];l===i.path.length-1?(o[u]=o[u]||{_errors:[]},o[u]._errors.push(r(i))):o[u]=o[u]||{_errors:[]},o=o[u],l++}}};return n(this),s}static assert(e){if(!(e instanceof Ee))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,z.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){const r={},s=[];for(const n of this.issues)n.path.length>0?(r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(e(n))):s.push(e(n));return{formErrors:s,fieldErrors:r}}get formErrors(){return this.flatten()}}Ee.create=t=>new Ee(t);const vt=(t,e)=>{let r;switch(t.code){case g.invalid_type:t.received===k.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case g.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,z.jsonStringifyReplacer)}`;break;case g.unrecognized_keys:r=`Unrecognized key(s) in object: ${z.joinValues(t.keys,", ")}`;break;case g.invalid_union:r="Invalid input";break;case g.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${z.joinValues(t.options)}`;break;case g.invalid_enum_value:r=`Invalid enum value. Expected ${z.joinValues(t.options)}, received '${t.received}'`;break;case g.invalid_arguments:r="Invalid function arguments";break;case g.invalid_return_type:r="Invalid function return type";break;case g.invalid_date:r="Invalid date";break;case g.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:z.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case g.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case g.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case g.custom:r="Invalid input";break;case g.invalid_intersection_types:r="Intersection results could not be merged";break;case g.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case g.not_finite:r="Number must be finite";break;default:r=e.defaultError,z.assertNever(t)}return{message:r}};let gn=vt;function Ha(t){gn=t}function or(){return gn}const cr=t=>{const{data:e,path:r,errorMaps:s,issueData:n}=t,a=[...r,...n.path||[]],i={...n,path:a};if(n.message!==void 0)return{...n,path:a,message:n.message};let o="";const l=s.filter(u=>!!u).slice().reverse();for(const u of l)o=u(i,{data:e,defaultError:o}).message;return{...n,path:a,message:o}},Qa=[];function x(t,e){const r=or(),s=cr({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===vt?void 0:vt].filter(n=>!!n)});t.common.issues.push(s)}class ye{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){const s=[];for(const n of r){if(n.status==="aborted")return R;n.status==="dirty"&&e.dirty(),s.push(n.value)}return{status:e.value,value:s}}static async mergeObjectAsync(e,r){const s=[];for(const n of r){const a=await n.key,i=await n.value;s.push({key:a,value:i})}return ye.mergeObjectSync(e,s)}static mergeObjectSync(e,r){const s={};for(const n of r){const{key:a,value:i}=n;if(a.status==="aborted"||i.status==="aborted")return R;a.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),a.value!=="__proto__"&&(typeof i.value<"u"||n.alwaysSet)&&(s[a.value]=i.value)}return{status:e.value,value:s}}}const R=Object.freeze({status:"aborted"}),ht=t=>({status:"dirty",value:t}),xe=t=>({status:"valid",value:t}),Fr=t=>t.status==="aborted",Ir=t=>t.status==="dirty",it=t=>t.status==="valid",Vt=t=>typeof Promise<"u"&&t instanceof Promise;function lr(t,e,r,s){if(typeof e=="function"?t!==e||!0:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(t)}function yn(t,e,r,s,n){if(typeof e=="function"?t!==e||!0:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(t,r),r}var E;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(E||(E={}));var Ct,Rt;class Me{constructor(e,r,s,n){this._cachedPath=[],this.parent=e,this.data=r,this._path=s,this._key=n}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Rs=(t,e)=>{if(it(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const r=new Ee(t.common.issues);return this._error=r,this._error}}};function N(t){if(!t)return{};const{errorMap:e,invalid_type_error:r,required_error:s,description:n}=t;if(e&&(r||s))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:n}:{errorMap:(i,o)=>{var l,u;const{message:f}=t;return i.code==="invalid_enum_value"?{message:f??o.defaultError}:typeof o.data>"u"?{message:(l=f??s)!==null&&l!==void 0?l:o.defaultError}:i.code!=="invalid_type"?{message:o.defaultError}:{message:(u=f??r)!==null&&u!==void 0?u:o.defaultError}},description:n}}class D{get description(){return this._def.description}_getType(e){return $e(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:$e(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new ye,ctx:{common:e.parent.common,data:e.data,parsedType:$e(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const r=this._parse(e);if(Vt(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){const r=this._parse(e);return Promise.resolve(r)}parse(e,r){const s=this.safeParse(e,r);if(s.success)return s.data;throw s.error}safeParse(e,r){var s;const n={common:{issues:[],async:(s=r==null?void 0:r.async)!==null&&s!==void 0?s:!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:$e(e)},a=this._parseSync({data:e,path:n.path,parent:n});return Rs(n,a)}"~validate"(e){var r,s;const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:$e(e)};if(!this["~standard"].async)try{const a=this._parseSync({data:e,path:[],parent:n});return it(a)?{value:a.value}:{issues:n.common.issues}}catch(a){!((s=(r=a==null?void 0:a.message)===null||r===void 0?void 0:r.toLowerCase())===null||s===void 0)&&s.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(a=>it(a)?{value:a.value}:{issues:n.common.issues})}async parseAsync(e,r){const s=await this.safeParseAsync(e,r);if(s.success)return s.data;throw s.error}async safeParseAsync(e,r){const s={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:$e(e)},n=this._parse({data:e,path:s.path,parent:s}),a=await(Vt(n)?n:Promise.resolve(n));return Rs(s,a)}refine(e,r){const s=n=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(n):r;return this._refinement((n,a)=>{const i=e(n),o=()=>a.addIssue({code:g.custom,...s(n)});return typeof Promise<"u"&&i instanceof Promise?i.then(l=>l?!0:(o(),!1)):i?!0:(o(),!1)})}refinement(e,r){return this._refinement((s,n)=>e(s)?!0:(n.addIssue(typeof r=="function"?r(s,n):r),!1))}_refinement(e){return new Re({schema:this,typeName:C.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return Pe.create(this,this._def)}nullable(){return Xe.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Ce.create(this)}promise(){return xt.create(this,this._def)}or(e){return Zt.create([this,e],this._def)}and(e){return Lt.create(this,e,this._def)}transform(e){return new Re({...N(this._def),schema:this,typeName:C.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const r=typeof e=="function"?e:()=>e;return new Wt({...N(this._def),innerType:this,defaultValue:r,typeName:C.ZodDefault})}brand(){return new es({typeName:C.ZodBranded,type:this,...N(this._def)})}catch(e){const r=typeof e=="function"?e:()=>e;return new Ht({...N(this._def),innerType:this,catchValue:r,typeName:C.ZodCatch})}describe(e){const r=this.constructor;return new r({...this._def,description:e})}pipe(e){return Xt.create(this,e)}readonly(){return Qt.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const qa=/^c[^\s-]{8,}$/i,Ga=/^[0-9a-z]+$/,Ya=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Ja=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Ka=/^[a-z0-9_-]{21}$/i,Xa=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,ei=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,ti=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,ri="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Ar;const si=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ni=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ai=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,ii=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,oi=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,ci=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,_n="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",li=new RegExp(`^${_n}$`);function vn(t){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`),e}function ui(t){return new RegExp(`^${vn(t)}$`)}function bn(t){let e=`${_n}T${vn(t)}`;const r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function di(t,e){return!!((e==="v4"||!e)&&si.test(t)||(e==="v6"||!e)&&ai.test(t))}function fi(t,e){if(!Xa.test(t))return!1;try{const[r]=t.split("."),s=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),n=JSON.parse(atob(s));return!(typeof n!="object"||n===null||!n.typ||!n.alg||e&&n.alg!==e)}catch{return!1}}function hi(t,e){return!!((e==="v4"||!e)&&ni.test(t)||(e==="v6"||!e)&&ii.test(t))}class Te extends D{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==k.string){const a=this._getOrReturnCtx(e);return x(a,{code:g.invalid_type,expected:k.string,received:a.parsedType}),R}const s=new ye;let n;for(const a of this._def.checks)if(a.kind==="min")e.data.length<a.value&&(n=this._getOrReturnCtx(e,n),x(n,{code:g.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),s.dirty());else if(a.kind==="max")e.data.length>a.value&&(n=this._getOrReturnCtx(e,n),x(n,{code:g.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),s.dirty());else if(a.kind==="length"){const i=e.data.length>a.value,o=e.data.length<a.value;(i||o)&&(n=this._getOrReturnCtx(e,n),i?x(n,{code:g.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):o&&x(n,{code:g.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),s.dirty())}else if(a.kind==="email")ti.test(e.data)||(n=this._getOrReturnCtx(e,n),x(n,{validation:"email",code:g.invalid_string,message:a.message}),s.dirty());else if(a.kind==="emoji")Ar||(Ar=new RegExp(ri,"u")),Ar.test(e.data)||(n=this._getOrReturnCtx(e,n),x(n,{validation:"emoji",code:g.invalid_string,message:a.message}),s.dirty());else if(a.kind==="uuid")Ja.test(e.data)||(n=this._getOrReturnCtx(e,n),x(n,{validation:"uuid",code:g.invalid_string,message:a.message}),s.dirty());else if(a.kind==="nanoid")Ka.test(e.data)||(n=this._getOrReturnCtx(e,n),x(n,{validation:"nanoid",code:g.invalid_string,message:a.message}),s.dirty());else if(a.kind==="cuid")qa.test(e.data)||(n=this._getOrReturnCtx(e,n),x(n,{validation:"cuid",code:g.invalid_string,message:a.message}),s.dirty());else if(a.kind==="cuid2")Ga.test(e.data)||(n=this._getOrReturnCtx(e,n),x(n,{validation:"cuid2",code:g.invalid_string,message:a.message}),s.dirty());else if(a.kind==="ulid")Ya.test(e.data)||(n=this._getOrReturnCtx(e,n),x(n,{validation:"ulid",code:g.invalid_string,message:a.message}),s.dirty());else if(a.kind==="url")try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),x(n,{validation:"url",code:g.invalid_string,message:a.message}),s.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),x(n,{validation:"regex",code:g.invalid_string,message:a.message}),s.dirty())):a.kind==="trim"?e.data=e.data.trim():a.kind==="includes"?e.data.includes(a.value,a.position)||(n=this._getOrReturnCtx(e,n),x(n,{code:g.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),s.dirty()):a.kind==="toLowerCase"?e.data=e.data.toLowerCase():a.kind==="toUpperCase"?e.data=e.data.toUpperCase():a.kind==="startsWith"?e.data.startsWith(a.value)||(n=this._getOrReturnCtx(e,n),x(n,{code:g.invalid_string,validation:{startsWith:a.value},message:a.message}),s.dirty()):a.kind==="endsWith"?e.data.endsWith(a.value)||(n=this._getOrReturnCtx(e,n),x(n,{code:g.invalid_string,validation:{endsWith:a.value},message:a.message}),s.dirty()):a.kind==="datetime"?bn(a).test(e.data)||(n=this._getOrReturnCtx(e,n),x(n,{code:g.invalid_string,validation:"datetime",message:a.message}),s.dirty()):a.kind==="date"?li.test(e.data)||(n=this._getOrReturnCtx(e,n),x(n,{code:g.invalid_string,validation:"date",message:a.message}),s.dirty()):a.kind==="time"?ui(a).test(e.data)||(n=this._getOrReturnCtx(e,n),x(n,{code:g.invalid_string,validation:"time",message:a.message}),s.dirty()):a.kind==="duration"?ei.test(e.data)||(n=this._getOrReturnCtx(e,n),x(n,{validation:"duration",code:g.invalid_string,message:a.message}),s.dirty()):a.kind==="ip"?di(e.data,a.version)||(n=this._getOrReturnCtx(e,n),x(n,{validation:"ip",code:g.invalid_string,message:a.message}),s.dirty()):a.kind==="jwt"?fi(e.data,a.alg)||(n=this._getOrReturnCtx(e,n),x(n,{validation:"jwt",code:g.invalid_string,message:a.message}),s.dirty()):a.kind==="cidr"?hi(e.data,a.version)||(n=this._getOrReturnCtx(e,n),x(n,{validation:"cidr",code:g.invalid_string,message:a.message}),s.dirty()):a.kind==="base64"?oi.test(e.data)||(n=this._getOrReturnCtx(e,n),x(n,{validation:"base64",code:g.invalid_string,message:a.message}),s.dirty()):a.kind==="base64url"?ci.test(e.data)||(n=this._getOrReturnCtx(e,n),x(n,{validation:"base64url",code:g.invalid_string,message:a.message}),s.dirty()):z.assertNever(a);return{status:s.value,value:e.data}}_regex(e,r,s){return this.refinement(n=>e.test(n),{validation:r,code:g.invalid_string,...E.errToObj(s)})}_addCheck(e){return new Te({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...E.errToObj(e)})}url(e){return this._addCheck({kind:"url",...E.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...E.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...E.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...E.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...E.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...E.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...E.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...E.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...E.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...E.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...E.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...E.errToObj(e)})}datetime(e){var r,s;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(r=e==null?void 0:e.offset)!==null&&r!==void 0?r:!1,local:(s=e==null?void 0:e.local)!==null&&s!==void 0?s:!1,...E.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...E.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...E.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...E.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r==null?void 0:r.position,...E.errToObj(r==null?void 0:r.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...E.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...E.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...E.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...E.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...E.errToObj(r)})}nonempty(e){return this.min(1,E.errToObj(e))}trim(){return new Te({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Te({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Te({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}}Te.create=t=>{var e;return new Te({checks:[],typeName:C.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...N(t)})};function mi(t,e){const r=(t.toString().split(".")[1]||"").length,s=(e.toString().split(".")[1]||"").length,n=r>s?r:s,a=parseInt(t.toFixed(n).replace(".","")),i=parseInt(e.toFixed(n).replace(".",""));return a%i/Math.pow(10,n)}class Ye extends D{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==k.number){const a=this._getOrReturnCtx(e);return x(a,{code:g.invalid_type,expected:k.number,received:a.parsedType}),R}let s;const n=new ye;for(const a of this._def.checks)a.kind==="int"?z.isInteger(e.data)||(s=this._getOrReturnCtx(e,s),x(s,{code:g.invalid_type,expected:"integer",received:"float",message:a.message}),n.dirty()):a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(s=this._getOrReturnCtx(e,s),x(s,{code:g.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),n.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(s=this._getOrReturnCtx(e,s),x(s,{code:g.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),n.dirty()):a.kind==="multipleOf"?mi(e.data,a.value)!==0&&(s=this._getOrReturnCtx(e,s),x(s,{code:g.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(s=this._getOrReturnCtx(e,s),x(s,{code:g.not_finite,message:a.message}),n.dirty()):z.assertNever(a);return{status:n.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,E.toString(r))}gt(e,r){return this.setLimit("min",e,!1,E.toString(r))}lte(e,r){return this.setLimit("max",e,!0,E.toString(r))}lt(e,r){return this.setLimit("max",e,!1,E.toString(r))}setLimit(e,r,s,n){return new Ye({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:s,message:E.toString(n)}]})}_addCheck(e){return new Ye({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:E.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:E.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:E.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:E.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:E.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:E.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:E.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:E.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:E.toString(e)})}get minValue(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&z.isInteger(e.value))}get isFinite(){let e=null,r=null;for(const s of this._def.checks){if(s.kind==="finite"||s.kind==="int"||s.kind==="multipleOf")return!0;s.kind==="min"?(r===null||s.value>r)&&(r=s.value):s.kind==="max"&&(e===null||s.value<e)&&(e=s.value)}return Number.isFinite(r)&&Number.isFinite(e)}}Ye.create=t=>new Ye({checks:[],typeName:C.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...N(t)});class Je extends D{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==k.bigint)return this._getInvalidInput(e);let s;const n=new ye;for(const a of this._def.checks)a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(s=this._getOrReturnCtx(e,s),x(s,{code:g.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),n.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(s=this._getOrReturnCtx(e,s),x(s,{code:g.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),n.dirty()):a.kind==="multipleOf"?e.data%a.value!==BigInt(0)&&(s=this._getOrReturnCtx(e,s),x(s,{code:g.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):z.assertNever(a);return{status:n.value,value:e.data}}_getInvalidInput(e){const r=this._getOrReturnCtx(e);return x(r,{code:g.invalid_type,expected:k.bigint,received:r.parsedType}),R}gte(e,r){return this.setLimit("min",e,!0,E.toString(r))}gt(e,r){return this.setLimit("min",e,!1,E.toString(r))}lte(e,r){return this.setLimit("max",e,!0,E.toString(r))}lt(e,r){return this.setLimit("max",e,!1,E.toString(r))}setLimit(e,r,s,n){return new Je({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:s,message:E.toString(n)}]})}_addCheck(e){return new Je({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:E.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:E.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:E.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:E.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:E.toString(r)})}get minValue(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}}Je.create=t=>{var e;return new Je({checks:[],typeName:C.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...N(t)})};class Dt extends D{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==k.boolean){const s=this._getOrReturnCtx(e);return x(s,{code:g.invalid_type,expected:k.boolean,received:s.parsedType}),R}return xe(e.data)}}Dt.create=t=>new Dt({typeName:C.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...N(t)});class ot extends D{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==k.date){const a=this._getOrReturnCtx(e);return x(a,{code:g.invalid_type,expected:k.date,received:a.parsedType}),R}if(isNaN(e.data.getTime())){const a=this._getOrReturnCtx(e);return x(a,{code:g.invalid_date}),R}const s=new ye;let n;for(const a of this._def.checks)a.kind==="min"?e.data.getTime()<a.value&&(n=this._getOrReturnCtx(e,n),x(n,{code:g.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),s.dirty()):a.kind==="max"?e.data.getTime()>a.value&&(n=this._getOrReturnCtx(e,n),x(n,{code:g.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),s.dirty()):z.assertNever(a);return{status:s.value,value:new Date(e.data.getTime())}}_addCheck(e){return new ot({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:E.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:E.toString(r)})}get minDate(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}}ot.create=t=>new ot({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:C.ZodDate,...N(t)});class ur extends D{_parse(e){if(this._getType(e)!==k.symbol){const s=this._getOrReturnCtx(e);return x(s,{code:g.invalid_type,expected:k.symbol,received:s.parsedType}),R}return xe(e.data)}}ur.create=t=>new ur({typeName:C.ZodSymbol,...N(t)});class Pt extends D{_parse(e){if(this._getType(e)!==k.undefined){const s=this._getOrReturnCtx(e);return x(s,{code:g.invalid_type,expected:k.undefined,received:s.parsedType}),R}return xe(e.data)}}Pt.create=t=>new Pt({typeName:C.ZodUndefined,...N(t)});class Mt extends D{_parse(e){if(this._getType(e)!==k.null){const s=this._getOrReturnCtx(e);return x(s,{code:g.invalid_type,expected:k.null,received:s.parsedType}),R}return xe(e.data)}}Mt.create=t=>new Mt({typeName:C.ZodNull,...N(t)});class bt extends D{constructor(){super(...arguments),this._any=!0}_parse(e){return xe(e.data)}}bt.create=t=>new bt({typeName:C.ZodAny,...N(t)});class at extends D{constructor(){super(...arguments),this._unknown=!0}_parse(e){return xe(e.data)}}at.create=t=>new at({typeName:C.ZodUnknown,...N(t)});class We extends D{_parse(e){const r=this._getOrReturnCtx(e);return x(r,{code:g.invalid_type,expected:k.never,received:r.parsedType}),R}}We.create=t=>new We({typeName:C.ZodNever,...N(t)});class dr extends D{_parse(e){if(this._getType(e)!==k.undefined){const s=this._getOrReturnCtx(e);return x(s,{code:g.invalid_type,expected:k.void,received:s.parsedType}),R}return xe(e.data)}}dr.create=t=>new dr({typeName:C.ZodVoid,...N(t)});class Ce extends D{_parse(e){const{ctx:r,status:s}=this._processInputParams(e),n=this._def;if(r.parsedType!==k.array)return x(r,{code:g.invalid_type,expected:k.array,received:r.parsedType}),R;if(n.exactLength!==null){const i=r.data.length>n.exactLength.value,o=r.data.length<n.exactLength.value;(i||o)&&(x(r,{code:i?g.too_big:g.too_small,minimum:o?n.exactLength.value:void 0,maximum:i?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),s.dirty())}if(n.minLength!==null&&r.data.length<n.minLength.value&&(x(r,{code:g.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),s.dirty()),n.maxLength!==null&&r.data.length>n.maxLength.value&&(x(r,{code:g.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),s.dirty()),r.common.async)return Promise.all([...r.data].map((i,o)=>n.type._parseAsync(new Me(r,i,r.path,o)))).then(i=>ye.mergeArray(s,i));const a=[...r.data].map((i,o)=>n.type._parseSync(new Me(r,i,r.path,o)));return ye.mergeArray(s,a)}get element(){return this._def.type}min(e,r){return new Ce({...this._def,minLength:{value:e,message:E.toString(r)}})}max(e,r){return new Ce({...this._def,maxLength:{value:e,message:E.toString(r)}})}length(e,r){return new Ce({...this._def,exactLength:{value:e,message:E.toString(r)}})}nonempty(e){return this.min(1,e)}}Ce.create=(t,e)=>new Ce({type:t,minLength:null,maxLength:null,exactLength:null,typeName:C.ZodArray,...N(e)});function ft(t){if(t instanceof te){const e={};for(const r in t.shape){const s=t.shape[r];e[r]=Pe.create(ft(s))}return new te({...t._def,shape:()=>e})}else return t instanceof Ce?new Ce({...t._def,type:ft(t.element)}):t instanceof Pe?Pe.create(ft(t.unwrap())):t instanceof Xe?Xe.create(ft(t.unwrap())):t instanceof Ze?Ze.create(t.items.map(e=>ft(e))):t}class te extends D{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),r=z.objectKeys(e);return this._cached={shape:e,keys:r}}_parse(e){if(this._getType(e)!==k.object){const u=this._getOrReturnCtx(e);return x(u,{code:g.invalid_type,expected:k.object,received:u.parsedType}),R}const{status:s,ctx:n}=this._processInputParams(e),{shape:a,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof We&&this._def.unknownKeys==="strip"))for(const u in n.data)i.includes(u)||o.push(u);const l=[];for(const u of i){const f=a[u],p=n.data[u];l.push({key:{status:"valid",value:u},value:f._parse(new Me(n,p,n.path,u)),alwaysSet:u in n.data})}if(this._def.catchall instanceof We){const u=this._def.unknownKeys;if(u==="passthrough")for(const f of o)l.push({key:{status:"valid",value:f},value:{status:"valid",value:n.data[f]}});else if(u==="strict")o.length>0&&(x(n,{code:g.unrecognized_keys,keys:o}),s.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const f of o){const p=n.data[f];l.push({key:{status:"valid",value:f},value:u._parse(new Me(n,p,n.path,f)),alwaysSet:f in n.data})}}return n.common.async?Promise.resolve().then(async()=>{const u=[];for(const f of l){const p=await f.key,A=await f.value;u.push({key:p,value:A,alwaysSet:f.alwaysSet})}return u}).then(u=>ye.mergeObjectSync(s,u)):ye.mergeObjectSync(s,l)}get shape(){return this._def.shape()}strict(e){return E.errToObj,new te({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,s)=>{var n,a,i,o;const l=(i=(a=(n=this._def).errorMap)===null||a===void 0?void 0:a.call(n,r,s).message)!==null&&i!==void 0?i:s.defaultError;return r.code==="unrecognized_keys"?{message:(o=E.errToObj(e).message)!==null&&o!==void 0?o:l}:{message:l}}}:{}})}strip(){return new te({...this._def,unknownKeys:"strip"})}passthrough(){return new te({...this._def,unknownKeys:"passthrough"})}extend(e){return new te({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new te({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:C.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new te({...this._def,catchall:e})}pick(e){const r={};return z.objectKeys(e).forEach(s=>{e[s]&&this.shape[s]&&(r[s]=this.shape[s])}),new te({...this._def,shape:()=>r})}omit(e){const r={};return z.objectKeys(this.shape).forEach(s=>{e[s]||(r[s]=this.shape[s])}),new te({...this._def,shape:()=>r})}deepPartial(){return ft(this)}partial(e){const r={};return z.objectKeys(this.shape).forEach(s=>{const n=this.shape[s];e&&!e[s]?r[s]=n:r[s]=n.optional()}),new te({...this._def,shape:()=>r})}required(e){const r={};return z.objectKeys(this.shape).forEach(s=>{if(e&&!e[s])r[s]=this.shape[s];else{let a=this.shape[s];for(;a instanceof Pe;)a=a._def.innerType;r[s]=a}}),new te({...this._def,shape:()=>r})}keyof(){return xn(z.objectKeys(this.shape))}}te.create=(t,e)=>new te({shape:()=>t,unknownKeys:"strip",catchall:We.create(),typeName:C.ZodObject,...N(e)});te.strictCreate=(t,e)=>new te({shape:()=>t,unknownKeys:"strict",catchall:We.create(),typeName:C.ZodObject,...N(e)});te.lazycreate=(t,e)=>new te({shape:t,unknownKeys:"strip",catchall:We.create(),typeName:C.ZodObject,...N(e)});class Zt extends D{_parse(e){const{ctx:r}=this._processInputParams(e),s=this._def.options;function n(a){for(const o of a)if(o.result.status==="valid")return o.result;for(const o of a)if(o.result.status==="dirty")return r.common.issues.push(...o.ctx.common.issues),o.result;const i=a.map(o=>new Ee(o.ctx.common.issues));return x(r,{code:g.invalid_union,unionErrors:i}),R}if(r.common.async)return Promise.all(s.map(async a=>{const i={...r,common:{...r.common,issues:[]},parent:null};return{result:await a._parseAsync({data:r.data,path:r.path,parent:i}),ctx:i}})).then(n);{let a;const i=[];for(const l of s){const u={...r,common:{...r.common,issues:[]},parent:null},f=l._parseSync({data:r.data,path:r.path,parent:u});if(f.status==="valid")return f;f.status==="dirty"&&!a&&(a={result:f,ctx:u}),u.common.issues.length&&i.push(u.common.issues)}if(a)return r.common.issues.push(...a.ctx.common.issues),a.result;const o=i.map(l=>new Ee(l));return x(r,{code:g.invalid_union,unionErrors:o}),R}}get options(){return this._def.options}}Zt.create=(t,e)=>new Zt({options:t,typeName:C.ZodUnion,...N(e)});const Ue=t=>t instanceof $t?Ue(t.schema):t instanceof Re?Ue(t.innerType()):t instanceof Bt?[t.value]:t instanceof Ke?t.options:t instanceof zt?z.objectValues(t.enum):t instanceof Wt?Ue(t._def.innerType):t instanceof Pt?[void 0]:t instanceof Mt?[null]:t instanceof Pe?[void 0,...Ue(t.unwrap())]:t instanceof Xe?[null,...Ue(t.unwrap())]:t instanceof es||t instanceof Qt?Ue(t.unwrap()):t instanceof Ht?Ue(t._def.innerType):[];class yr extends D{_parse(e){const{ctx:r}=this._processInputParams(e);if(r.parsedType!==k.object)return x(r,{code:g.invalid_type,expected:k.object,received:r.parsedType}),R;const s=this.discriminator,n=r.data[s],a=this.optionsMap.get(n);return a?r.common.async?a._parseAsync({data:r.data,path:r.path,parent:r}):a._parseSync({data:r.data,path:r.path,parent:r}):(x(r,{code:g.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[s]}),R)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,s){const n=new Map;for(const a of r){const i=Ue(a.shape[e]);if(!i.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const o of i){if(n.has(o))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);n.set(o,a)}}return new yr({typeName:C.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:n,...N(s)})}}function Nr(t,e){const r=$e(t),s=$e(e);if(t===e)return{valid:!0,data:t};if(r===k.object&&s===k.object){const n=z.objectKeys(e),a=z.objectKeys(t).filter(o=>n.indexOf(o)!==-1),i={...t,...e};for(const o of a){const l=Nr(t[o],e[o]);if(!l.valid)return{valid:!1};i[o]=l.data}return{valid:!0,data:i}}else if(r===k.array&&s===k.array){if(t.length!==e.length)return{valid:!1};const n=[];for(let a=0;a<t.length;a++){const i=t[a],o=e[a],l=Nr(i,o);if(!l.valid)return{valid:!1};n.push(l.data)}return{valid:!0,data:n}}else return r===k.date&&s===k.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class Lt extends D{_parse(e){const{status:r,ctx:s}=this._processInputParams(e),n=(a,i)=>{if(Fr(a)||Fr(i))return R;const o=Nr(a.value,i.value);return o.valid?((Ir(a)||Ir(i))&&r.dirty(),{status:r.value,value:o.data}):(x(s,{code:g.invalid_intersection_types}),R)};return s.common.async?Promise.all([this._def.left._parseAsync({data:s.data,path:s.path,parent:s}),this._def.right._parseAsync({data:s.data,path:s.path,parent:s})]).then(([a,i])=>n(a,i)):n(this._def.left._parseSync({data:s.data,path:s.path,parent:s}),this._def.right._parseSync({data:s.data,path:s.path,parent:s}))}}Lt.create=(t,e,r)=>new Lt({left:t,right:e,typeName:C.ZodIntersection,...N(r)});class Ze extends D{_parse(e){const{status:r,ctx:s}=this._processInputParams(e);if(s.parsedType!==k.array)return x(s,{code:g.invalid_type,expected:k.array,received:s.parsedType}),R;if(s.data.length<this._def.items.length)return x(s,{code:g.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),R;!this._def.rest&&s.data.length>this._def.items.length&&(x(s,{code:g.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const a=[...s.data].map((i,o)=>{const l=this._def.items[o]||this._def.rest;return l?l._parse(new Me(s,i,s.path,o)):null}).filter(i=>!!i);return s.common.async?Promise.all(a).then(i=>ye.mergeArray(r,i)):ye.mergeArray(r,a)}get items(){return this._def.items}rest(e){return new Ze({...this._def,rest:e})}}Ze.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ze({items:t,typeName:C.ZodTuple,rest:null,...N(e)})};class Ut extends D{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:r,ctx:s}=this._processInputParams(e);if(s.parsedType!==k.object)return x(s,{code:g.invalid_type,expected:k.object,received:s.parsedType}),R;const n=[],a=this._def.keyType,i=this._def.valueType;for(const o in s.data)n.push({key:a._parse(new Me(s,o,s.path,o)),value:i._parse(new Me(s,s.data[o],s.path,o)),alwaysSet:o in s.data});return s.common.async?ye.mergeObjectAsync(r,n):ye.mergeObjectSync(r,n)}get element(){return this._def.valueType}static create(e,r,s){return r instanceof D?new Ut({keyType:e,valueType:r,typeName:C.ZodRecord,...N(s)}):new Ut({keyType:Te.create(),valueType:e,typeName:C.ZodRecord,...N(r)})}}class fr extends D{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:r,ctx:s}=this._processInputParams(e);if(s.parsedType!==k.map)return x(s,{code:g.invalid_type,expected:k.map,received:s.parsedType}),R;const n=this._def.keyType,a=this._def.valueType,i=[...s.data.entries()].map(([o,l],u)=>({key:n._parse(new Me(s,o,s.path,[u,"key"])),value:a._parse(new Me(s,l,s.path,[u,"value"]))}));if(s.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const l of i){const u=await l.key,f=await l.value;if(u.status==="aborted"||f.status==="aborted")return R;(u.status==="dirty"||f.status==="dirty")&&r.dirty(),o.set(u.value,f.value)}return{status:r.value,value:o}})}else{const o=new Map;for(const l of i){const u=l.key,f=l.value;if(u.status==="aborted"||f.status==="aborted")return R;(u.status==="dirty"||f.status==="dirty")&&r.dirty(),o.set(u.value,f.value)}return{status:r.value,value:o}}}}fr.create=(t,e,r)=>new fr({valueType:e,keyType:t,typeName:C.ZodMap,...N(r)});class ct extends D{_parse(e){const{status:r,ctx:s}=this._processInputParams(e);if(s.parsedType!==k.set)return x(s,{code:g.invalid_type,expected:k.set,received:s.parsedType}),R;const n=this._def;n.minSize!==null&&s.data.size<n.minSize.value&&(x(s,{code:g.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),r.dirty()),n.maxSize!==null&&s.data.size>n.maxSize.value&&(x(s,{code:g.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),r.dirty());const a=this._def.valueType;function i(l){const u=new Set;for(const f of l){if(f.status==="aborted")return R;f.status==="dirty"&&r.dirty(),u.add(f.value)}return{status:r.value,value:u}}const o=[...s.data.values()].map((l,u)=>a._parse(new Me(s,l,s.path,u)));return s.common.async?Promise.all(o).then(l=>i(l)):i(o)}min(e,r){return new ct({...this._def,minSize:{value:e,message:E.toString(r)}})}max(e,r){return new ct({...this._def,maxSize:{value:e,message:E.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}}ct.create=(t,e)=>new ct({valueType:t,minSize:null,maxSize:null,typeName:C.ZodSet,...N(e)});class mt extends D{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:r}=this._processInputParams(e);if(r.parsedType!==k.function)return x(r,{code:g.invalid_type,expected:k.function,received:r.parsedType}),R;function s(o,l){return cr({data:o,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,or(),vt].filter(u=>!!u),issueData:{code:g.invalid_arguments,argumentsError:l}})}function n(o,l){return cr({data:o,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,or(),vt].filter(u=>!!u),issueData:{code:g.invalid_return_type,returnTypeError:l}})}const a={errorMap:r.common.contextualErrorMap},i=r.data;if(this._def.returns instanceof xt){const o=this;return xe(async function(...l){const u=new Ee([]),f=await o._def.args.parseAsync(l,a).catch(S=>{throw u.addIssue(s(l,S)),u}),p=await Reflect.apply(i,this,f);return await o._def.returns._def.type.parseAsync(p,a).catch(S=>{throw u.addIssue(n(p,S)),u})})}else{const o=this;return xe(function(...l){const u=o._def.args.safeParse(l,a);if(!u.success)throw new Ee([s(l,u.error)]);const f=Reflect.apply(i,this,u.data),p=o._def.returns.safeParse(f,a);if(!p.success)throw new Ee([n(f,p.error)]);return p.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new mt({...this._def,args:Ze.create(e).rest(at.create())})}returns(e){return new mt({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,s){return new mt({args:e||Ze.create([]).rest(at.create()),returns:r||at.create(),typeName:C.ZodFunction,...N(s)})}}class $t extends D{get schema(){return this._def.getter()}_parse(e){const{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}}$t.create=(t,e)=>new $t({getter:t,typeName:C.ZodLazy,...N(e)});class Bt extends D{_parse(e){if(e.data!==this._def.value){const r=this._getOrReturnCtx(e);return x(r,{received:r.data,code:g.invalid_literal,expected:this._def.value}),R}return{status:"valid",value:e.data}}get value(){return this._def.value}}Bt.create=(t,e)=>new Bt({value:t,typeName:C.ZodLiteral,...N(e)});function xn(t,e){return new Ke({values:t,typeName:C.ZodEnum,...N(e)})}class Ke extends D{constructor(){super(...arguments),Ct.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const r=this._getOrReturnCtx(e),s=this._def.values;return x(r,{expected:z.joinValues(s),received:r.parsedType,code:g.invalid_type}),R}if(lr(this,Ct)||yn(this,Ct,new Set(this._def.values)),!lr(this,Ct).has(e.data)){const r=this._getOrReturnCtx(e),s=this._def.values;return x(r,{received:r.data,code:g.invalid_enum_value,options:s}),R}return xe(e.data)}get options(){return this._def.values}get enum(){const e={};for(const r of this._def.values)e[r]=r;return e}get Values(){const e={};for(const r of this._def.values)e[r]=r;return e}get Enum(){const e={};for(const r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return Ke.create(e,{...this._def,...r})}exclude(e,r=this._def){return Ke.create(this.options.filter(s=>!e.includes(s)),{...this._def,...r})}}Ct=new WeakMap;Ke.create=xn;class zt extends D{constructor(){super(...arguments),Rt.set(this,void 0)}_parse(e){const r=z.getValidEnumValues(this._def.values),s=this._getOrReturnCtx(e);if(s.parsedType!==k.string&&s.parsedType!==k.number){const n=z.objectValues(r);return x(s,{expected:z.joinValues(n),received:s.parsedType,code:g.invalid_type}),R}if(lr(this,Rt)||yn(this,Rt,new Set(z.getValidEnumValues(this._def.values))),!lr(this,Rt).has(e.data)){const n=z.objectValues(r);return x(s,{received:s.data,code:g.invalid_enum_value,options:n}),R}return xe(e.data)}get enum(){return this._def.values}}Rt=new WeakMap;zt.create=(t,e)=>new zt({values:t,typeName:C.ZodNativeEnum,...N(e)});class xt extends D{unwrap(){return this._def.type}_parse(e){const{ctx:r}=this._processInputParams(e);if(r.parsedType!==k.promise&&r.common.async===!1)return x(r,{code:g.invalid_type,expected:k.promise,received:r.parsedType}),R;const s=r.parsedType===k.promise?r.data:Promise.resolve(r.data);return xe(s.then(n=>this._def.type.parseAsync(n,{path:r.path,errorMap:r.common.contextualErrorMap})))}}xt.create=(t,e)=>new xt({type:t,typeName:C.ZodPromise,...N(e)});class Re extends D{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===C.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:r,ctx:s}=this._processInputParams(e),n=this._def.effect||null,a={addIssue:i=>{x(s,i),i.fatal?r.abort():r.dirty()},get path(){return s.path}};if(a.addIssue=a.addIssue.bind(a),n.type==="preprocess"){const i=n.transform(s.data,a);if(s.common.async)return Promise.resolve(i).then(async o=>{if(r.value==="aborted")return R;const l=await this._def.schema._parseAsync({data:o,path:s.path,parent:s});return l.status==="aborted"?R:l.status==="dirty"||r.value==="dirty"?ht(l.value):l});{if(r.value==="aborted")return R;const o=this._def.schema._parseSync({data:i,path:s.path,parent:s});return o.status==="aborted"?R:o.status==="dirty"||r.value==="dirty"?ht(o.value):o}}if(n.type==="refinement"){const i=o=>{const l=n.refinement(o,a);if(s.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(s.common.async===!1){const o=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});return o.status==="aborted"?R:(o.status==="dirty"&&r.dirty(),i(o.value),{status:r.value,value:o.value})}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(o=>o.status==="aborted"?R:(o.status==="dirty"&&r.dirty(),i(o.value).then(()=>({status:r.value,value:o.value}))))}if(n.type==="transform")if(s.common.async===!1){const i=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});if(!it(i))return i;const o=n.transform(i.value,a);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:o}}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(i=>it(i)?Promise.resolve(n.transform(i.value,a)).then(o=>({status:r.value,value:o})):i);z.assertNever(n)}}Re.create=(t,e,r)=>new Re({schema:t,typeName:C.ZodEffects,effect:e,...N(r)});Re.createWithPreprocess=(t,e,r)=>new Re({schema:e,effect:{type:"preprocess",transform:t},typeName:C.ZodEffects,...N(r)});class Pe extends D{_parse(e){return this._getType(e)===k.undefined?xe(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Pe.create=(t,e)=>new Pe({innerType:t,typeName:C.ZodOptional,...N(e)});class Xe extends D{_parse(e){return this._getType(e)===k.null?xe(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Xe.create=(t,e)=>new Xe({innerType:t,typeName:C.ZodNullable,...N(e)});class Wt extends D{_parse(e){const{ctx:r}=this._processInputParams(e);let s=r.data;return r.parsedType===k.undefined&&(s=this._def.defaultValue()),this._def.innerType._parse({data:s,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}Wt.create=(t,e)=>
1new Wt({innerType:t,typeName:C.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...N(e)});class Ht extends D{_parse(e){const{ctx:r}=this._processInputParams(e),s={...r,common:{...r.common,issues:[]}},n=this._def.innerType._parse({data:s.data,path:s.path,parent:{...s}});return Vt(n)?n.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new Ee(s.common.issues)},input:s.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new Ee(s.common.issues)},input:s.data})}}removeCatch(){return this._def.innerType}}Ht.create=(t,e)=>new Ht({innerType:t,typeName:C.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...N(e)});class hr extends D{_parse(e){if(this._getType(e)!==k.nan){const s=this._getOrReturnCtx(e);return x(s,{code:g.invalid_type,expected:k.nan,received:s.parsedType}),R}return{status:"valid",value:e.data}}}hr.create=t=>new hr({typeName:C.ZodNaN,...N(t)});const pi=Symbol("zod_brand");class es extends D{_parse(e){const{ctx:r}=this._processInputParams(e),s=r.data;return this._def.type._parse({data:s,path:r.path,parent:r})}unwrap(){return this._def.type}}class Xt extends D{_parse(e){const{status:r,ctx:s}=this._processInputParams(e);if(s.common.async)return(async()=>{const a=await this._def.in._parseAsync({data:s.data,path:s.path,parent:s});return a.status==="aborted"?R:a.status==="dirty"?(r.dirty(),ht(a.value)):this._def.out._parseAsync({data:a.value,path:s.path,parent:s})})();{const n=this._def.in._parseSync({data:s.data,path:s.path,parent:s});return n.status==="aborted"?R:n.status==="dirty"?(r.dirty(),{status:"dirty",value:n.value}):this._def.out._parseSync({data:n.value,path:s.path,parent:s})}}static create(e,r){return new Xt({in:e,out:r,typeName:C.ZodPipeline})}}class Qt extends D{_parse(e){const r=this._def.innerType._parse(e),s=n=>(it(n)&&(n.value=Object.freeze(n.value)),n);return Vt(r)?r.then(n=>s(n)):s(r)}unwrap(){return this._def.innerType}}Qt.create=(t,e)=>new Qt({innerType:t,typeName:C.ZodReadonly,...N(e)});function Fs(t,e){const r=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof r=="string"?{message:r}:r}function wn(t,e={},r){return t?bt.create().superRefine((s,n)=>{var a,i;const o=t(s);if(o instanceof Promise)return o.then(l=>{var u,f;if(!l){const p=Fs(e,s),A=(f=(u=p.fatal)!==null&&u!==void 0?u:r)!==null&&f!==void 0?f:!0;n.addIssue({code:"custom",...p,fatal:A})}});if(!o){const l=Fs(e,s),u=(i=(a=l.fatal)!==null&&a!==void 0?a:r)!==null&&i!==void 0?i:!0;n.addIssue({code:"custom",...l,fatal:u})}}):bt.create()}const gi={object:te.lazycreate};var C;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(C||(C={}));const yi=(t,e={message:`Input not instance of ${t.name}`})=>wn(r=>r instanceof t,e),kn=Te.create,Sn=Ye.create,_i=hr.create,vi=Je.create,En=Dt.create,bi=ot.create,xi=ur.create,wi=Pt.create,ki=Mt.create,Si=bt.create,Ei=at.create,Ai=We.create,ji=dr.create,Oi=Ce.create,Ti=te.create,Ci=te.strictCreate,Ri=Zt.create,Fi=yr.create,Ii=Lt.create,Ni=Ze.create,Vi=Ut.create,Di=fr.create,Pi=ct.create,Mi=mt.create,Zi=$t.create,Li=Bt.create,Ui=Ke.create,$i=zt.create,Bi=xt.create,Is=Re.create,zi=Pe.create,Wi=Xe.create,Hi=Re.createWithPreprocess,Qi=Xt.create,qi=()=>kn().optional(),Gi=()=>Sn().optional(),Yi=()=>En().optional(),Ji={string:t=>Te.create({...t,coerce:!0}),number:t=>Ye.create({...t,coerce:!0}),boolean:t=>Dt.create({...t,coerce:!0}),bigint:t=>Je.create({...t,coerce:!0}),date:t=>ot.create({...t,coerce:!0})},Ki=R;var me=Object.freeze({__proto__:null,defaultErrorMap:vt,setErrorMap:Ha,getErrorMap:or,makeIssue:cr,EMPTY_PATH:Qa,addIssueToContext:x,ParseStatus:ye,INVALID:R,DIRTY:ht,OK:xe,isAborted:Fr,isDirty:Ir,isValid:it,isAsync:Vt,get util(){return z},get objectUtil(){return Rr},ZodParsedType:k,getParsedType:$e,ZodType:D,datetimeRegex:bn,ZodString:Te,ZodNumber:Ye,ZodBigInt:Je,ZodBoolean:Dt,ZodDate:ot,ZodSymbol:ur,ZodUndefined:Pt,ZodNull:Mt,ZodAny:bt,ZodUnknown:at,ZodNever:We,ZodVoid:dr,ZodArray:Ce,ZodObject:te,ZodUnion:Zt,ZodDiscriminatedUnion:yr,ZodIntersection:Lt,ZodTuple:Ze,ZodRecord:Ut,ZodMap:fr,ZodSet:ct,ZodFunction:mt,ZodLazy:$t,ZodLiteral:Bt,ZodEnum:Ke,ZodNativeEnum:zt,ZodPromise:xt,ZodEffects:Re,ZodTransformer:Re,ZodOptional:Pe,ZodNullable:Xe,ZodDefault:Wt,ZodCatch:Ht,ZodNaN:hr,BRAND:pi,ZodBranded:es,ZodPipeline:Xt,ZodReadonly:Qt,custom:wn,Schema:D,ZodSchema:D,late:gi,get ZodFirstPartyTypeKind(){return C},coerce:Ji,any:Si,array:Oi,bigint:vi,boolean:En,date:bi,discriminatedUnion:Fi,effect:Is,enum:Ui,function:Mi,instanceof:yi,intersection:Ii,lazy:Zi,literal:Li,map:Di,nan:_i,nativeEnum:$i,never:Ai,null:ki,nullable:Wi,number:Sn,object:Ti,oboolean:Yi,onumber:Gi,optional:zi,ostring:qi,pipeline:Qi,preprocess:Hi,promise:Bi,record:Vi,set:Pi,strictObject:Ci,string:kn,symbol:xi,transformer:Is,tuple:Ni,undefined:wi,union:Ri,unknown:Ei,void:ji,NEVER:Ki,ZodIssueCode:g,quotelessJson:Wa,ZodError:Ee}),ke,$,qt,ve,rt,pt,qe,Fe,Gt,gt,yt,st,nt,Ge,_t,Q,Ft,Vr,Dr,Pr,Mr,Zr,Lr,Ur,An,Us,Xi=(Us=class extends ia{constructor(e,r){super();he(this,Q);he(this,ke);he(this,$);he(this,qt);he(this,ve);he(this,rt);he(this,pt);he(this,qe);he(this,Fe);he(this,Gt);he(this,gt);he(this,yt);he(this,st);he(this,nt);he(this,Ge);he(this,_t,new Set);this.options=r,J(this,ke,e),J(this,Fe,null),J(this,qe,gs()),this.options.experimental_prefetchInRender||v(this,qe).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(v(this,$).addObserver(this),Ns(v(this,$),this.options)?ie(this,Q,Ft).call(this):this.updateResult(),ie(this,Q,Mr).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return $r(v(this,$),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return $r(v(this,$),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,ie(this,Q,Zr).call(this),ie(this,Q,Lr).call(this),v(this,$).removeObserver(this)}setOptions(e,r){const s=this.options,n=v(this,$);if(this.options=v(this,ke).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Ie(this.options.enabled,v(this,$))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");ie(this,Q,Ur).call(this),v(this,$).setOptions(this.options),s._defaulted&&!Or(this.options,s)&&v(this,ke).getQueryCache().notify({type:"observerOptionsUpdated",query:v(this,$),observer:this});const a=this.hasListeners();a&&Vs(v(this,$),n,this.options,s)&&ie(this,Q,Ft).call(this),this.updateResult(r),a&&(v(this,$)!==n||Ie(this.options.enabled,v(this,$))!==Ie(s.enabled,v(this,$))||tr(this.options.staleTime,v(this,$))!==tr(s.staleTime,v(this,$)))&&ie(this,Q,Vr).call(this);const i=ie(this,Q,Dr).call(this);a&&(v(this,$)!==n||Ie(this.options.enabled,v(this,$))!==Ie(s.enabled,v(this,$))||i!==v(this,Ge))&&ie(this,Q,Pr).call(this,i)}getOptimisticResult(e){const r=v(this,ke).getQueryCache().build(v(this,ke),e),s=this.createResult(r,e);return to(this,s)&&(J(this,ve,s),J(this,pt,this.options),J(this,rt,v(this,$).state)),s}getCurrentResult(){return v(this,ve)}trackResult(e,r){const s={};return Object.keys(e).forEach(n=>{Object.defineProperty(s,n,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(n),r==null||r(n),e[n])})}),s}trackProp(e){v(this,_t).add(e)}getCurrentQuery(){return v(this,$)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const r=v(this,ke).defaultQueryOptions(e),s=v(this,ke).getQueryCache().build(v(this,ke),r);return s.fetch().then(()=>this.createResult(s,r))}fetch(e){return ie(this,Q,Ft).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),v(this,ve)))}createResult(e,r){var ae;const s=v(this,$),n=this.options,a=v(this,ve),i=v(this,rt),o=v(this,pt),u=e!==s?e.state:v(this,qt),{state:f}=e;let p={...f},A=!1,S;if(r._optimisticResults){const Z=this.hasListeners(),Y=!Z&&Ns(e,r),pe=Z&&Vs(e,s,r,n);(Y||pe)&&(p={...p,...ua(f.data,e.options)}),r._optimisticResults==="isRestoring"&&(p.fetchStatus="idle")}let{error:F,errorUpdatedAt:L,status:O}=p;if(r.select&&p.data!==void 0)if(a&&p.data===(i==null?void 0:i.data)&&r.select===v(this,Gt))S=v(this,gt);else try{J(this,Gt,r.select),S=r.select(p.data),S=_s(a==null?void 0:a.data,S,r),J(this,gt,S),J(this,Fe,null)}catch(Z){J(this,Fe,Z)}else S=p.data;if(r.placeholderData!==void 0&&S===void 0&&O==="pending"){let Z;if(a!=null&&a.isPlaceholderData&&r.placeholderData===(o==null?void 0:o.placeholderData))Z=a.data;else if(Z=typeof r.placeholderData=="function"?r.placeholderData((ae=v(this,yt))==null?void 0:ae.state.data,v(this,yt)):r.placeholderData,r.select&&Z!==void 0)try{Z=r.select(Z),J(this,Fe,null)}catch(Y){J(this,Fe,Y)}Z!==void 0&&(O="success",S=_s(a==null?void 0:a.data,Z,r),A=!0)}v(this,Fe)&&(F=v(this,Fe),S=v(this,gt),L=Date.now(),O="error");const B=p.fetchStatus==="fetching",j=O==="pending",U=O==="error",ee=j&&B,P=S!==void 0,V={status:O,fetchStatus:p.fetchStatus,isPending:j,isSuccess:O==="success",isError:U,isInitialLoading:ee,isLoading:ee,data:S,dataUpdatedAt:p.dataUpdatedAt,error:F,errorUpdatedAt:L,failureCount:p.fetchFailureCount,failureReason:p.fetchFailureReason,errorUpdate
1Count:p.errorUpdateCount,isFetched:p.dataUpdateCount>0||p.errorUpdateCount>0,isFetchedAfterMount:p.dataUpdateCount>u.dataUpdateCount||p.errorUpdateCount>u.errorUpdateCount,isFetching:B,isRefetching:B&&!j,isLoadingError:U&&!P,isPaused:p.fetchStatus==="paused",isPlaceholderData:A,isRefetchError:U&&P,isStale:ts(e,r),refetch:this.refetch,promise:v(this,qe)};if(this.options.experimental_prefetchInRender){const Z=I=>{V.status==="error"?I.reject(V.error):V.data!==void 0&&I.resolve(V.data)},Y=()=>{const I=J(this,qe,V.promise=gs());Z(I)},pe=v(this,qe);switch(pe.status){case"pending":e.queryHash===s.queryHash&&Z(pe);break;case"fulfilled":(V.status==="error"||V.data!==pe.value)&&Y();break;case"rejected":(V.status!=="error"||V.error!==pe.reason)&&Y();break}}return V}updateResult(e){const r=v(this,ve),s=this.createResult(v(this,$),this.options);if(J(this,rt,v(this,$).state),J(this,pt,this.options),v(this,rt).data!==void 0&&J(this,yt,v(this,$)),Or(s,r))return;J(this,ve,s);const n={},a=()=>{if(!r)return!0;const{notifyOnChangeProps:i}=this.options,o=typeof i=="function"?i():i;if(o==="all"||!o&&!v(this,_t).size)return!0;const l=new Set(o??v(this,_t));return this.options.throwOnError&&l.add("error"),Object.keys(v(this,ve)).some(u=>{const f=u;return v(this,ve)[f]!==r[f]&&l.has(f)})};(e==null?void 0:e.listeners)!==!1&&a()&&(n.listeners=!0),ie(this,Q,An).call(this,{...n,...e})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&ie(this,Q,Mr).call(this)}},ke=new WeakMap,$=new WeakMap,qt=new WeakMap,ve=new WeakMap,rt=new WeakMap,pt=new WeakMap,qe=new WeakMap,Fe=new WeakMap,Gt=new WeakMap,gt=new WeakMap,yt=new WeakMap,st=new WeakMap,nt=new WeakMap,Ge=new WeakMap,_t=new WeakMap,Q=new WeakSet,Ft=function(e){ie(this,Q,Ur).call(this);let r=v(this,$).fetch(this.options,e);return e!=null&&e.throwOnError||(r=r.catch(oa)),r},Vr=function(){ie(this,Q,Zr).call(this);const e=tr(this.options.staleTime,v(this,$));if(Tr||v(this,ve).isStale||!ys(e))return;const s=ca(v(this,ve).dataUpdatedAt,e)+1;J(this,st,setTimeout(()=>{v(this,ve).isStale||this.updateResult()},s))},Dr=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(v(this,$)):this.options.refetchInterval)??!1},Pr=function(e){ie(this,Q,Lr).call(this),J(this,Ge,e),!(Tr||Ie(this.options.enabled,v(this,$))===!1||!ys(v(this,Ge))||v(this,Ge)===0)&&J(this,nt,setInterval(()=>{(this.options.refetchIntervalInBackground||la.isFocused())&&ie(this,Q,Ft).call(this)},v(this,Ge)))},Mr=function(){ie(this,Q,Vr).call(this),ie(this,Q,Pr).call(this,ie(this,Q,Dr).call(this))},Zr=function(){v(this,st)&&(clearTimeout(v(this,st)),J(this,st,void 0))},Lr=function(){v(this,nt)&&(clearInterval(v(this,nt)),J(this,nt,void 0))},Ur=function(){const e=v(this,ke).getQueryCache().build(v(this,ke),this.options);if(e===v(this,$))return;const r=v(this,$);J(this,$,e),J(this,qt,e.state),this.hasListeners()&&(r==null||r.removeObserver(this),e.addObserver(this))},An=function(e){Hs.batch(()=>{e.listeners&&this.listeners.forEach(r=>{r(v(this,ve))}),v(this,ke).getQueryCache().notify({query:v(this,$),type:"observerResultsUpdated"})})},Us);function eo(t,e){return Ie(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&e.retryOnMount===!1)}function Ns(t,e){return eo(t,e)||t.state.data!==void 0&&$r(t,e,e.refetchOnMount)}function $r(t,e,r){if(Ie(e.enabled,t)!==!1){const s=typeof r=="function"?r(t):r;return s==="always"||s!==!1&&ts(t,e)}return!1}function Vs(t,e,r,s){return(t!==e||Ie(s.enabled,t)===!1)&&(!r.suspense||t.state.status!=="error")&&ts(t,r)}function ts(t,e){return Ie(e.enabled,t)!==!1&&t.isStaleByTime(tr(e.staleTime,t))}function to(t,e){return!Or(t.getCurrentResult(),e)}var jn=fe.createContext(!1),ro=()=>fe.useContext(jn);jn.Provider;function so(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var no=fe.createContext(so()),ao=()=>fe.useContext(no),io=(t,e)=>{(t.suspense||t.throwOnError||t.experimental_prefetchInRender)&&(e.isReset()||(t.retryOnMount=!1))},oo=t=>{fe.useEffect(()=>{t.clearReset()},[t])},co=({result:t,errorResetBoundary:e,throwOnError:r,query:s,suspense:n})=>t.isError&&!e.isReset()&&!t.isFetching&&s&&(n&&t.data===void 0||da(r,[t.error,s])),lo=t=>{const e=t.staleTime;t.suspense&&(t.staleTime=typeof e=="function"?(...r)=>Math.max(e(...r),1e3):Math.max(e??1e3,1e3),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3)))},uo=(t,e)=>t.isLoading&&t.isFetching&&!e,fo=(t,e)=>(t==null?void 0:t.suspense)&&e.isPending,Ds=(t,e,r)=>e.fetchOptimistic(t).catch(()=>{r.clearReset()});function ho(t,e,r){var p,A,S,F,L;const s=fa(),n=ro(),a=ao(),i=s.defaultQueryOptions(t);(A=(p=s.getDefaultOptions().queries)==null?void 0:p._experimental_beforeQuery)==null||A.call(p,i),i._optimisticResults=n?"isRestoring":"optimistic",lo(i),io(i,a),oo(a);const o=!s.getQueryCache().get(i.queryHash),[l]=fe.useState(()=>new e(s,i)),u=l.getOptimisticResult(i),f=!n&&t.subscribed!==!1;if(fe.useSyncExternalStore(fe.useCallback(O=>{const B=f?l.subscribe(Hs.batchCalls(O)):vs;return l.updateResult(),B},[l,f]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),fe.useEffect(()=>{l.setOptions(i,{listeners:!1})},[i,l]),fo(i,u))throw Ds(i,l,a);if(co({result:u,errorResetBoundary:a,throwOnError:i.throwOnError,query:s.getQueryCache().get(i.queryHash),suspense:i.suspense}))throw u.error;if((F=(S=s.getDefaultOptions().queries)==null?void 0:S._experimental_afterQuery)==null||F.call(S,i,u),i.experimental_prefetchInRender&&!Tr&&uo(u,n)){const O=o?Ds(i,l,a):(L=s.getQueryCache().get(i.queryHash))==null?void 0:L.promise;O==null||O.catch(vs).finally(()=>{l.updateResult()})}return i.notifyOnChangeProps?u:l.trackResult(u)}function On(t,e){return ho(t,Xi)}const mo=async t=>{const e=await et({url:"/auth/v2/forgetPassword.sendVerificationCode",method:"post",data:t});return e==null?void 0:e.data},Tn=(t,e)=>On({queryKey:["FORGET_PASSWORD","VERIFY_CODE",t.user_information],queryFn:async()=>{const r=await mo(t);return r==null?void 0:r.data},enabled:!!(t!=null&&t.user_information),gcTime:6e4,placeholderData:Qs,...e}),po=async t=>{const e=await et({url:"/auth/v2/forgetPassword.confirmVerificationCode",method:"post",data:t});return e==null?void 0:e.data},go=()=>wt({mutationFn:e=>po(e)}),yo=async t=>{const e=await et({url:"/auth/v2/resetPassword",method:"post",data:t});return e==null?void 0:e.data},_o=()=>wt({mutationFn:e=>yo(e)}),vo=async t=>{const e=await et({url:"/auth/v2/login.authorize",method:"post",data:t});return e==null?void 0:e.data},bo=()=>wt({mutationFn:e=>vo(e)}),xo=async t=>{const e=await et({url:"/auth/v2/login",method:"post",data:t});return e==null?void 0:e.data},wo=()=>wt({mutationFn:e=>xo(e)}),ko=async t=>{const e=await et({url:"/auth/v2/signup.validate",method:"post",data:t});return e==null?void 0:e.data},So=()=>wt({mutationFn:e=>ko(e)}),Eo=async t=>{const e=await et({url:"/auth/v2/signup.sendVerificationCode",method:"post",data:t});return e==null?void 0:e.data},Cn=(t,e)=>On({queryKey:["VERIFY_CODE",t.email],queryFn:async()=>{const r=await Eo(t);return r==null?void 0:r.data},gcTime:6e4,placeholderData:Qs,enabled:!!(t!=null&&t.email),...e}),Ao=async t=>{const e=await et({url:"/auth/v2/signup",method:"post",data:t});return e==null?void 0:e.data},jo=()=>wt({mutationFn:e=>Ao(e)}),rs=me.object({email:me.string().min(1,"common.validate.required").email("login.validate.email.format"),password:me.string().min(8,"sign-up.validate.password.length").regex(Yn,"sign-up.validate.password.format"),confirm_password:me.string().min(8,"sign-up.validate.password.length"),phone_number:me.string().superRefine((t,e)=>{var r;if(t){const s=Gn.mobilePhoneNumber.validate(t);s.valid||e.addIssue({code:me.ZodIssueCode.custom,message:(r=s.error)==null?void 0:r.details.message})}}),consents:me.string().array().min(1,"common.validate.required")}),dt=[{required:!0,value:"terms",label:"sign-up.consents-1"},{required:!0,value:"privacy",label:"sign-up.consents-2"},{required:!1,value:"marketing",label:"sign-up.consents-3"}],Oo=({transition:t})=>{var F,L,O,B,j,U,ee,P;const{t:e}=lt(),{register:r,formState:s,handleSubmit:n,control:a,watch:i,setError:o}=Jt({resolver:Kt(rs.refine(q=>q.password===q.confirm_password,{message:e("sign-up.validate.password.not-match"),path:["confirm_password"]})),defaultValues:async()=>{var ae;const q=X.get("signup-form"),V=(ae=X.get("auth-choice-form"))==null?void 0:ae.auth_user;if(pn(q)){if(V){let Z="phoneNumber";return Wr.test(V)&&(Z="email"),{email:Z==="email"?V:"",password:"",confirm_password:"",phone_number:Z==="phoneNumber"?V:"",consents:[]}}}else return{...q,password:"",confirm_password:""}}}),{errors:l}=s,u=Cn({email:i("email")},{enabled:!1}),f=So();function p(q){f.mutate({email:q.email,password:q.password,phone_number:q.phone_number},{async onSuccess(V){V.data.success&&(X.store("signup-form",q),await u.refetch(),t("verifyEmail"))},onError(V){var Y,pe,I,W,re,ce;const ae=(I=(pe=(Y=V==null?void 0:V.response)==null?void 0:Y.data)==null?void 0:pe.error)==null?void 0:I.code,Z=(ce=(re=(W=V==null?void 0:V.response)==null?void 0:W.data)==null?void 0:re.error)==null?void 0:ce.detail;
1if(ae==="SCHEMA_VALIDATION_ERROR")Object.entries(Z).forEach(([_e,ge])=>{o(_e,{message:ge==null?void 0:ge[0]})});else{const _e=typeof Z=="string"?Z:"Error: something wrong";Kn.error({text:_e})}}})}const A=i("consents",[]),S=()=>{var q;return!((q=dt==null?void 0:dt.filter(V=>V.required))!=null&&q.every(V=>A==null?void 0:A.includes(V.value)))};return h.jsxs(K,{className:"login-form",gap:12,as:"form",onSubmit:n(p),justifyContent:"center",flex:1,children:[h.jsx("h1",{className:"_fs-800 _tal-ct",children:e("sign-up.title")}),h.jsxs(K,{gap:8,children:[h.jsxs(K,{gap:4,children:[h.jsx(ze,{isFluid:!0,label:e("sign-up.email-input.label"),placeholder:e("sign-up.email-input.placeholder"),info:e((F=l==null?void 0:l.email)==null?void 0:F.message),variant:(L=l==null?void 0:l.email)!=null&&L.message?"negative":"primary",...r("email")}),h.jsx(ze,{isFluid:!0,label:e("sign-up.password-input.label"),placeholder:e("sign-up.password-input.placeholder"),info:e((O=l==null?void 0:l.password)==null?void 0:O.message),type:"password",variant:(B=l==null?void 0:l.password)!=null&&B.message?"negative":"primary",...r("password")}),h.jsx(ze,{isFluid:!0,label:e("sign-up.confirm-password-input.label"),placeholder:e("sign-up.confirm-password-input.placeholder"),info:e((j=l==null?void 0:l.confirm_password)==null?void 0:j.message),type:"password",variant:(U=l==null?void 0:l.confirm_password)!=null&&U.message?"negative":"primary",...r("confirm_password")}),h.jsx(ze,{isFluid:!0,label:e("sign-up.phone-number-input.label"),placeholder:e("sign-up.phone-number-input.placeholder"),info:e((ee=l==null?void 0:l.phone_number)==null?void 0:ee.message),variant:(P=l==null?void 0:l.phone_number)!=null&&P.message?"negative":"primary",...r("phone_number"),type:"number",inputMode:"numeric"})]}),h.jsx(K,{children:h.jsx(ja,{control:a,name:"consents",render:({field:q})=>h.jsx(h.Fragment,{children:dt==null?void 0:dt.map(V=>{const ae=A.includes(V.value);return h.jsx(Jn,{id:V.value,label:h.jsx("div",{className:"_fw-400 _fs-300 _cl-text-default-200",dangerouslySetInnerHTML:{__html:e(V.label)}}),onChange:Z=>{const Y=Z.target.value;Z.target.checked?q.onChange([...A,Y]):q.onChange([...A].filter(pe=>pe!==Y))},value:V.value,checked:ae},V.value)})})})}),h.jsx(K,{gap:2,children:h.jsx(De,{size:"large",isFluid:!0,type:"submit",disabled:S(),isLoading:(f==null?void 0:f.isPending)||(u==null?void 0:u.isLoading),children:e("sign-up.submit-button")})})]})]})};rs.pick({consents:!0});const To={"title-1":"Hire through","title-2":"Secure payment, guaranteed work","advantage-1":"Payment guarantee","advantage-2":"Professional license","advantage-3":"Money-back guarantee if conditions aren't met","advantage-4":"Guidance throughout the hiring process","advantage-5":"Verified freelancers"},Co={"title-1":"Pekerjakan melalui","title-2":"Pembayaran aman, pekerjaan terjamin","advantage-1":"Jaminan pembayaran","advantage-2":"Lisensi profesional","advantage-3":"Garansi uang kembali jika syarat tidak terpenuhi","advantage-4":"Panduan selama proses mempekerjakan","advantage-5":"Freelancer yang terverifikasi"},Ro={"title-1":"à¸à¹à¸²à¸à¸à¹à¸²à¸","title-2":"à¹à¸à¸´à¸à¸à¸¥à¸à¸à¸ ัย à¹à¸à¹à¸à¸²à¸à¸à¸±à¸§à¸£à¹","advantage-1":"รัà¸à¸à¸£à¸°à¸à¸±à¸à¹à¸à¸´à¸à¸à¹à¸²à¸","advantage-2":"มีà¹à¸à¸à¸£à¸°à¸à¸à¸à¸§à¸´à¸à¸²à¸à¸µà¸","advantage-3":"à¸à¸´à¸à¹à¸à¸·à¹à¸à¸à¹à¸ ยิà¸à¸à¸µà¸à¸·à¸à¹à¸à¸´à¸","advantage-4":"à¹à¸«à¹à¸à¸³à¹à¸à¸°à¸à¸³à¸à¸¥à¸à¸à¸à¸²à¸£à¸à¹à¸²à¸","advantage-5":"à¸à¸£à¸µà¹à¸¥à¸à¸à¹à¸à¹à¸²à¸à¸à¸²à¸£à¸à¸£à¸§à¸à¸ªà¸à¸"},Fo={"title-1":"Thuê qua","title-2":"Bảo vá» thanh toán, bảo Äảm công viá»c","advantage-1":"Bảo Äảm thanh toán","advantage-2":"Có chứng chá» hà nh nghá»","advantage-3":"Cam kết hoà n tiá»n nếu vi phạm thá»a thuáºn","advantage-4":"Há» trợ trong suá»t quá trình tuyá»n dụng","advantage-5":"Freelancer Äã xác minh"},Io="vi",Rn=qs.createInstance();Rn.use(Gs).init({lng:$s(),fallbackLng:Io,interpolation:{escapeValue:!1},resources:{th:{"banner-translation":Ro},en:{"banner-translation":To},id:{"banner-translation":Co},vi:{"banner-translation":Fo}}});const jr=[{icon:"/hero-banner/advantage-1.svg",label:"advantage-1"},{icon:"/hero-banner/advantage-2.svg",label:"advantage-2"},{icon:"/hero-banner/advantage-3.svg",label:"advantage-3"},{icon:"/hero-banner/advantage-4.svg",label:"advantage-4"},{icon:"/hero-banner/advantage-5.svg",label:"advantage-5"}],No=({containerClassName:t,containerStyle:e})=>{const{t:r}=Xn();return h.jsxs(K,{className:mr("hero-banner",t),style:e,gap:12,children:[h.jsxs(K,{children:[h.jsxs(je,{children:[h.jsx("h2",{className:"_fs-1100",children:r("title-1")}),h.jsx("img",{src:zs({default:"/logo-default.svg",vn:"/logo-vn.svg"}),alt:"logo"})]}),h.jsx(je,{className:"_fs-1100",children:h.jsx("h2",{children:r("title-2")})})]}),h.jsx(je,{children:h.jsx("img",{src:ea.switch({default:"/hero-banner/concept-banner-vn.svg",en:"/hero-banner/concept-banner-en.svg"}),alt:"concept banner",style:{height:"164px"}})}),h.jsx(za,{columns:2,gap:4,children:jr==null?void 0:jr.map(s=>h.jsxs(je,{children:[h.jsx("img",{src:s.icon,alt:"advantage",style:{height:"48px",width:"48px"}}),h.jsx("span",{className:"_fw-600 _fs-600 _ffml-secondary",children:r(s.label)})]},s.label))})]})},Vo=t=>(Bs(),h.jsx(Ys,{i18n:Rn,defaultNS:"banner-translation",children:h.jsx(No,{...t})}));var Do=function(){return null};
1const Fn="%[a-f0-9]{2}",Ps=new RegExp("("+Fn+")|([^%]+?)","gi"),Ms=new RegExp("("+Fn+")+","gi");function Br(t,e){try{return[decodeURIComponent(t.join(""))]}catch{}if(t.length===1)return t;e=e||1;const r=t.slice(0,e),s=t.slice(e);return Array.prototype.concat.call([],Br(r),Br(s))}function Po(t){try{return decodeURIComponent(t)}catch{let e=t.match(Ps)||[];for(let r=1;r<e.length;r++)t=Br(e,r).join(""),e=t.match(Ps)||[];return t}}function Mo(t){const e={"%FE%FF":"��","%FF%FE":"��"};let r=Ms.exec(t);for(;r;){try{e[r[0]]=decodeURIComponent(r[0])}catch{const n=Po(r[0]);n!==r[0]&&(e[r[0]]=n)}r=Ms.exec(t)}e["%C2"]="�";const s=Object.keys(e);for(const n of s)t=t.replace(new RegExp(n,"g"),e[n]);return t}function Zo(t){if(typeof t!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof t+"`");try{return decodeURIComponent(t)}catch{return Mo(t)}}function Lo(t,e){const r={};if(Array.isArray(e))for(const s of e){const n=Object.getOwnPropertyDescriptor(t,s);n!=null&&n.enumerable&&Object.defineProperty(r,s,n)}else for(const s of Reflect.ownKeys(t)){const n=Object.getOwnPropertyDescriptor(t,s);if(n.enumerable){const a=t[s];e(s,a,t)&&Object.defineProperty(r,s,n)}}return r}function In(t,e){if(!(typeof t=="string"&&typeof e=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(t===""||e==="")return[];const r=t.indexOf(e);return r===-1?[]:[t.slice(0,r),t.slice(r+e.length)]}const Uo=t=>t==null,$o=t=>encodeURIComponent(t).replaceAll(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),zr=Symbol("encodeFragmentIdentifier");function Bo(t){switch(t.arrayFormat){case"index":return e=>(r,s)=>{const n=r.length;return s===void 0||t.skipNull&&s===null||t.skipEmptyString&&s===""?r:s===null?[...r,[oe(e,t),"[",n,"]"].join("")]:[...r,[oe(e,t),"[",oe(n,t),"]=",oe(s,t)].join("")]};case"bracket":return e=>(r,s)=>s===void 0||t.skipNull&&s===null||t.skipEmptyString&&s===""?r:s===null?[...r,[oe(e,t),"[]"].join("")]:[...r,[oe(e,t),"[]=",oe(s,t)].join("")];case"colon-list-separator":return e=>(r,s)=>s===void 0||t.skipNull&&s===null||t.skipEmptyString&&s===""?r:s===null?[...r,[oe(e,t),":list="].join("")]:[...r,[oe(e,t),":list=",oe(s,t)].join("")];case"comma":case"separator":case"bracket-separator":{const e=t.arrayFormat==="bracket-separator"?"[]=":"=";return r=>(s,n)=>n===void 0||t.skipNull&&n===null||t.skipEmptyString&&n===""?s:(n=n===null?"":n,s.length===0?[[oe(r,t),e,oe(n,t)].join("")]:[[s,oe(n,t)].join(t.arrayFormatSeparator)])}default:return e=>(r,s)=>s===void 0||t.skipNull&&s===null||t.skipEmptyString&&s===""?r:s===null?[...r,oe(e,t)]:[...r,[oe(e,t),"=",oe(s,t)].join("")]}}function zo(t){let e;switch(t.arrayFormat){case"index":return(r,s,n)=>{if(e=/\[(\d*)]$/.exec(r),r=r.replace(/\[\d*]$/,""),!e){n[r]=s;return}n[r]===void 0&&(n[r]={}),n[r][e[1]]=s};case"bracket":return(r,s,n)=>{if(e=/(\[])$/.exec(r),r=r.replace(/\[]$/,""),!e){n[r]=s;return}if(n[r]===void 0){n[r]=[s];return}n[r]=[...n[r],s]};case"colon-list-separator":return(r,s,n)=>{if(e=/(:list)$/.exec(r),r=r.replace(/:list$/,""),!e){n[r]=s;return}if(n[r]===void 0){n[r]=[s];return}n[r]=[...n[r],s]};case"comma":case"separator":return(r,s,n)=>{const a=typeof s=="string"&&s.includes(t.arrayFormatSeparator),i=typeof s=="string"&&!a&&Be(s,t).includes(t.arrayFormatSeparator);s=i?Be(s,t):s;const o=a||i?s.split(t.arrayFormatSeparator).map(l=>Be(l,t)):s===null?s:Be(s,t);n[r]=o};case"bracket-separator":return(r,s,n)=>{const a=/(\[])$/.test(r);if(r=r.replace(/\[]$/,""),!a){n[r]=s&&Be(s,t);return}const i=s===null?[]:Be(s,t).split(t.arrayFormatSeparator);if(n[r]===void 0){n[r]=i;return}n[r]=[...n[r],...i]};default:return(r,s,n)=>{if(n[r]===void 0){n[r]=s;return}n[r]=[...[n[r]].flat(),s]}}}function Nn(t){if(typeof t!="string"||t.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function oe(t,e){return e.encode?e.strict?$o(t):encodeURIComponent(t):t}function Be(t,e){return e.decode?Zo(t):t}function Vn(t){return Array.isArray(t)?t.sort():typeof t=="object"?Vn(Object.keys(t)).sort((e,r)=>Number(e)-Number(r)).map(e=>t[e]):t}function Dn(t){const e=t.indexOf("#");
1return e!==-1&&(t=t.slice(0,e)),t}function Wo(t){let e="";const r=t.indexOf("#");return r!==-1&&(e=t.slice(r)),e}function Zs(t,e,r){return r==="string"&&typeof t=="string"?t:typeof r=="function"&&typeof t=="string"?r(t):e.parseBooleans&&t!==null&&(t.toLowerCase()==="true"||t.toLowerCase()==="false")?t.toLowerCase()==="true":r==="number"&&!Number.isNaN(Number(t))&&typeof t=="string"&&t.trim()!==""||e.parseNumbers&&!Number.isNaN(Number(t))&&typeof t=="string"&&t.trim()!==""?Number(t):t}function ss(t){t=Dn(t);const e=t.indexOf("?");return e===-1?"":t.slice(e+1)}function ns(t,e){e={decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1,types:Object.create(null),...e},Nn(e.arrayFormatSeparator);const r=zo(e),s=Object.create(null);if(typeof t!="string"||(t=t.trim().replace(/^[?#&]/,""),!t))return s;for(const n of t.split("&")){if(n==="")continue;const a=e.decode?n.replaceAll("+"," "):n;let[i,o]=In(a,"=");i===void 0&&(i=a),o=o===void 0?null:["comma","separator","bracket-separator"].includes(e.arrayFormat)?o:Be(o,e),r(Be(i,e),o,s)}for(const[n,a]of Object.entries(s))if(typeof a=="object"&&a!==null&&e.types[n]!=="string")for(const[i,o]of Object.entries(a)){const l=e.types[n]?e.types[n].replace("[]",""):void 0;a[i]=Zs(o,e,l)}else typeof a=="object"&&a!==null&&e.types[n]==="string"?s[n]=Object.values(a).join(e.arrayFormatSeparator):s[n]=Zs(a,e,e.types[n]);return e.sort===!1?s:(e.sort===!0?Object.keys(s).sort():Object.keys(s).sort(e.sort)).reduce((n,a)=>{const i=s[a];return n[a]=i&&typeof i=="object"&&!Array.isArray(i)?Vn(i):i,n},Object.create(null))}function Pn(t,e){if(!t)return"";e={encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:",",...e},Nn(e.arrayFormatSeparator);const r=i=>e.skipNull&&Uo(t[i])||e.skipEmptyString&&t[i]==="",s=Bo(e),n={};for(const[i,o]of Object.entries(t))r(i)||(n[i]=o);const a=Object.keys(n);return e.sort!==!1&&a.sort(e.sort),a.map(i=>{const o=t[i];return o===void 0?"":o===null?oe(i,e):Array.isArray(o)?o.length===0&&e.arrayFormat==="bracket-separator"?oe(i,e)+"[]":o.reduce(s(i),[]).join("&"):oe(i,e)+"="+oe(o,e)}).filter(i=>i.length>0).join("&")}function Mn(t,e){var n;e={decode:!0,...e};let[r,s]=In(t,"#");return r===void 0&&(r=t),{url:((n=r==null?void 0:r.split("?"))==null?void 0:n[0])??"",query:ns(ss(t),e),...e&&e.parseFragmentIdentifier&&s?{fragmentIdentifier:Be(s,e)}:{}}}function Zn(t,e){e={encode:!0,strict:!0,[zr]:!0,...e};const r=Dn(t.url).split("?")[0]||"",s=ss(t.url),n={...ns(s,{sort:!1}),...t.query};let a=Pn(n,e);a&&(a=`?${a}`);let i=Wo(t.url);if(typeof t.fragmentIdentifier=="string"){const o=new URL(r);o.hash=t.fragmentIdentifier,i=e[zr]?o.hash:`#${t.fragmentIdentifier}`}return`${r}${a}${i}`}function Ln(t,e,r){r={parseFragmentIdentifier:!0,[zr]:!1,...r};const{url:s,query:n,fragmentIdentifier:a}=Mn(t,r);return Zn({url:s,query:Lo(n,e),fragmentIdentifier:a},r)}function Ho(t,e,r){const s=Array.isArray(e)?n=>!e.includes(n):(n,a)=>!e(n,a);return Ln(t,s,r)}const Ls=Object.freeze(Object.defineProperty({__proto__:null,exclude:Ho,extract:ss,parse:ns,parseUrl:Mn,pick:Ln,stringify:Pn,stringifyUrl:Zn},Symbol.toStringTag,{value:"Module"})),Qo=me.object({auth_user:me.intersection(me.string().min(1,"auth-choice.validate.auth-user.format"),me.union([me.string().regex(ta,"auth-choice.validate.auth-user.format"),me.string().regex(Wr,"auth-choice.validate.auth-user.format")]))}),qo=({transition:t})=>{var p,A;const{isLaptopAndBelow:e}=pr(),[r]=fe.useState(pa()),{register:s,formState:n,handleSubmit:a,setError:i}=Jt({resolver:Kt(Qo),defaultValues:async()=>{var F;return{auth_user:((F=X.get("auth-choice-form"))==null?void 0:F.auth_user)||""}}}),{errors:o}=n,l=bo();function u(S){l.mutate(S,{onSuccess(F){const L=F.data.success,O=X.get("signup-form");if(X.store("auth-choice-form",S),!pn(O)){let B="phoneNumber";Wr.test(S.auth_user)&&(B="email"),X.store("signup-form",{...O,email:B==="email"?S.auth_user:O.email,phone_number:B==="phoneNumber"?S.auth_user:O.phone_number})}t(L?"login":"signUp")},onError(F){i("auth_user",{type:"validate",message:f(St.getFirst(F==null?void 0:F.response))})}})}const{t:f}=lt();return h.jsxs(K,{className:"login-form",gap:12,as:"form",onSubmit:a(u),justifyContent:"center",flex:1,children:[h.jsx("h1",{className:"_fs-800 _tal-ct",children:f("auth-choice.title")}),h.jsxs(K,{gap:2,children:[h.jsxs(K,{gap:e?2:4,children:[h.jsx(ze,{isFluid:!0,label:f("auth-choice.input.label"),placeholder:f("auth-choice.input.placeholder"),info:f((p=o==null?void 0:o.auth_user)==null?void 0:p.message),variant:(A=o==null?void 0:o.auth_user)!=null&&A.message?"negative":"primary",autoF
1ocus:!0,...s("auth_user")}),h.jsxs(K,{gap:3,children:[h.jsx(De,{size:e?"medium":"large",isFluid:!0,type:"submit",isLoading:l==null?void 0:l.isPending,children:f("auth-choice.submit-button")}),h.jsxs(kt,{justifyContent:"space-between",className:"_fs-300",children:[h.jsx(je,{gap:1,children:h.jsx("span",{className:"_cs-pt trb-link _tdcrt-udl",onClick:()=>{t==null||t("signUp")},children:f("auth-choice.create-account.label")})}),h.jsxs("span",{className:"_cs-pt trb-link _tdcrt-udl",onClick:()=>{t==null||t("forgotPassword")},children:[f("auth-choice.forget-password-button"),"?"]})]})]})]}),h.jsx(je,{className:"_mgv-16px _ffml-primary _cl-text-default-200 _pst-rlt divider",children:h.jsx("span",{className:"_mg-at text-divider",children:f("auth-choice.divider")})}),h.jsx("a",{href:Ls.stringifyUrl({url:"https://www.facebook.com/v16.0/dialog/oauth",query:{client_id:"277604635416335",redirect_uri:"https://auth2.fastlance.vn/auth/facebook/callback",state:r,scope:"email"}}),children:h.jsx(De,{className:"_cl-primary-500",isFluid:!0,variant:"white",type:"button",onClick:()=>X.store("social-oauth-csrf-token",r),children:h.jsxs(je,{gap:2,children:[h.jsx("img",{src:"/auth-form/login/fb.svg",alt:"facebook icon",style:{height:"16px"}}),h.jsx("span",{children:f("auth-choice.fb-button")})]})})}),h.jsx("a",{href:Ls.stringifyUrl({url:"https://accounts.google.com/o/oauth2/v2/auth",query:{client_id:"650834919224-ivpm7hkfmted4r8qpshiees23b9r31kp.apps.googleusercontent.com",redirect_uri:"https://auth2.fastlance.vn/auth/google/callback",response_type:"code",scope:"email profile",flowName:"GeneralOAuthFlow",state:r,include_granted_scopes:"true"}}),children:h.jsx(De,{className:"_cl-text-default-200",isFluid:!0,variant:"white",onClick:()=>X.store("social-oauth-csrf-token",r),type:"button",children:h.jsxs(je,{gap:2,children:[h.jsx("img",{src:"/auth-form/login/gg.svg",alt:"facebook icon",style:{height:"14px"}}),f("auth-choice.gg-button")]})})})]})]})},Go=rs.pick({password:!0,confirm_password:!0}),Yo=()=>{var f,p,A,S,F,L;const{t}=lt(),e=(f=X.get("forget-password_confirm-email-form"))==null?void 0:f.user_information,r=(p=X.get("forget-password_verify-email-form"))==null?void 0:p.authorization_code,{register:s,formState:n,handleSubmit:a,setError:i}=Jt({resolver:Kt(Go.refine(O=>O.password===O.confirm_password,{message:"forget-password-change-password.confirm-password-input.not-match",path:["confirm_password"]}))}),{errors:o}=n,l=_o();function u(O){const B=new URLSearchParams(window.location.search),j=B.get("client_id"),U=B.get("callback_url"),ee=Object.fromEntries(B.entries());l.mutate({...ee,client_id:j,callback_url:U,user_information:e,authorization_code:r,new_password:O.password||""},{onSuccess(P){var q;X.removeAll(),Qr((q=P==null?void 0:P.data)==null?void 0:q.authorization_code)},onError(P){i("password",{type:"validate",message:t(St.getFirst(P==null?void 0:P.response))})}})}return l!=null&&l.isPending||l!=null&&l.isSuccess?h.jsx(kt,{flex:"1",width:"100%",height:"350px",alignItems:"center",justifyContent:"center",children:h.jsx(Hr,{variant:"fastwork"})}):h.jsxs(K,{className:"login-form",gap:12,as:"form",onSubmit:a(u),justifyContent:"center",flex:1,children:[h.jsx("h1",{className:"_fs-800 _tal-ct",children:t("forget-password-change-password.title")}),h.jsxs(K,{gap:4,children:[h.jsx(mn,{label:e}),h.jsx("span",{className:"_fs-300 _ffml-primary",children:t("forget-password-change-password.description")}),h.jsx(ze,{isFluid:!0,label:t("forget-password-change-password.password-input.label"),placeholder:t("forget-password-change-password.password-input.placeholder"),info:t((A=o==null?void 0:o.password)==null?void 0:A.message),type:"password",variant:(S=o==null?void 0:o.password)!=null&&S.message?"negative":"primary",...s("password")}),h.jsx(ze,{isFluid:!0,label:t("forget-password-change-password.confirm-password-input.label"),placeholder:t("forget-password-change-password.confirm-password-input.placeholder"),info:t((F=o==null?void 0:o.confirm_password)==null?void 0:F.message),type:"password",variant:(L=o==null?void 0:o.confirm_password)!=null&&L.message?"negative":"primary",...s("confirm_password")})]}),h.jsx(K,{gap:2,children:h.jsx(De,{size:"large",isFluid:!0,type:"submit",children:t("forget-password-change-password.submit-button")})})]})},Jo=me.object({user_information:me.string().min(1,"common.validate.required")}),Ko=({transition:t})=>{var f,p;const{t:e}=lt(),{register:r,formState:s,handleSubmit:n,watch:a}=Jt({resolver:Kt(Jo),defaultValues:async()=>{var S;return{user_information:((S=X.get("forget-password_confirm-email-form"))==null?void 0:S.user_information)||""}}}),{errors:i}=s,o=Tn({user_information:a("user_information")},{enabled:!1});async function l(A){var F;const S=await(o==null?void 0:o.refetch());(F=S==null?void 0:S.data)!=null&&F.reference_code&&(X.store("forget-password_confirm-email-form",A),t("verifyEmailForgotPassword"))}const u=e((f=i==null?void 0:i.user_information)==null?void 0:f.message)||e(St.getFirst((
1p=o==null?void 0:o.error)==null?void 0:p.response)||"");return h.jsxs(K,{className:"login-form",gap:12,as:"form",onSubmit:n(l),justifyContent:"center",flex:1,children:[h.jsx("h1",{className:"_fs-800 _tal-ct",children:e("forget-password-confirm-password.title")}),h.jsx(je,{alignItems:"center",children:h.jsx("span",{className:"_fs-300 _ffml-primary",children:e("forget-password-confirm-password.description")})}),h.jsx(ze,{isFluid:!0,label:e("forget-password-confirm-password.input.label"),placeholder:e("forget-password-confirm-password.input.placeholder"),info:u,variant:u?"negative":"primary",autoFocus:!0,...r("user_information")}),h.jsxs(K,{gap:2,children:[h.jsx(De,{size:"large",isFluid:!0,type:"submit",children:e("forget-password-confirm-password.submit-button")}),h.jsx(De,{className:"_cl-primary-500",isFluid:!0,variant:"ghost",type:"button",onClick:()=>{t("goBack")},children:e("forget-password-confirm-password.login-button")})]})]})},Xo=({transition:t})=>{var l,u,f,p;const{t:e}=lt(),r=fe.useRef(null),s=(l=X.get("forget-password_confirm-email-form"))==null?void 0:l.user_information,n=Tn({user_information:s},{enabled:!1}),a=go();async function i(){var B,j,U;const A=new URLSearchParams(window.location.search),S=A.get("client_id"),F=A.get("callback_url"),L=(B=r.current)==null?void 0:B.getPassCode(),O=await a.mutateAsync({client_id:S,callback_url:F,user_information:s,reference_code:((j=n==null?void 0:n.data)==null?void 0:j.reference_code)||"",verification_code:L||""});O!=null&&O.data&&(X.store("forget-password_verify-email-form",{authorization_code:(U=O==null?void 0:O.data)==null?void 0:U.authorization_code}),t("changePasswordForgotPassword"))}function o(){n.refetch()}return fe.useEffect(()=>{var A,S;(S=(A=r.current)==null?void 0:A.startCountDown)==null||S.call(A)},[]),h.jsxs(K,{className:"login-form",gap:12,as:"form",justifyContent:"center",flex:1,children:[h.jsx("h1",{className:"_fs-800 _tal-ct",children:e("forget-password-verify-email.title")}),h.jsxs(K,{gap:4,children:[h.jsx(je,{alignItems:"center",children:h.jsxs("span",{className:"_ffml-primary _cl-text-default-100 _tal-ct _wsp-pl _lh-150pct",children:[e("forget-password-verify-email.description"),n!=null&&n.data?`${e("forget-password-verify-email.reference-code")} ${(u=n==null?void 0:n.data)==null?void 0:u.reference_code}`:""]})}),h.jsx(K,{gap:4,children:h.jsxs(je,{alignItems:"center",children:[h.jsx("img",{src:"/auth-form/login/avatar.svg",alt:"avatar",style:{height:"36px",width:"36px"}}),h.jsx("span",{className:"_fw-600 _fs-400",children:s})]})}),h.jsx(Ws,{onResend:o,onSubmitAction:i,ref:r,errorMessage:e(St.getFirst(((f=a==null?void 0:a.error)==null?void 0:f.response)||((p=n==null?void 0:n.error)==null?void 0:p.response))),isLoading:a==null?void 0:a.isPending,submitButtonLabel:e("forget-password-verify-email.otp-input.submit-button")})]})]})},er={initial:"AUTH_CHOICE",states:{AUTH_CHOICE:{on:{signUp:"SIGN_UP",login:"LOGIN",forgotPassword:"FORGOT_PASSWORD_CONFIRM_EMAIL"}},SIGN_UP:{on:{verifyEmail:"VERIFY_EMAIL",goBack:"AUTH_CHOICE"}},VERIFY_EMAIL:{on:{goBack:"SIGN_UP"}},LOGIN:{on:{forgotPassword:"FORGOT_PASSWORD_CONFIRM_EMAIL",goBack:"AUTH_CHOICE"}},FORGOT_PASSWORD_CONFIRM_EMAIL:{on:{verifyEmailForgotPassword:"FORGOT_PASSWORD_VERIFY_EMAIL",goBack:"AUTH_CHOICE"}},FORGOT_PASSWORD_VERIFY_EMAIL:{on:{changePasswordForgotPassword:"FORGOT_PASSWORD_CHANGE_PASSWORD",goBack:"FORGOT_PASSWORD_CONFIRM_EMAIL"}},FORGOT_PASSWORD_CHANGE_PASSWORD:{on:{goBack:"FORGOT_PASSWORD_VERIFY_EMAIL"}}}},ec=()=>{var n,a;const[t,e]=fe.useState(er.initial);function r(i){var l,u;const o=(u=(l=er.states[t])==null?void 0:l.on)==null?void 0:u[i];o&&e(o)}function s(){var o,l;const i=(l=(o=er.states[t])==null?void 0:o.on)==null?void 0:l.goBack;i&&e(i)}return{state:t,transition:r,goBack:s,hasPreviousState:!!((a=(n=er.states[t])==null?void 0:n.on)!=null&&a.goBack)}},tc=({children:t,goBack:e})=>{const{isMobile:r,isLaptopAndBelow:s}=pr();return h.jsxs(K,{className:"_mgv-24px _mgh-at",alignItems:"center",justifyContent:"center",flexDirection:"column",gap:8,style:{width:r?"calc(100% - 40px)":"100%",...!r&&{maxWidth:"500px"}},children:[s&&h.jsx("img",{src:zs({default:"/logo-default.svg",vn:"/logo-vn.svg"}),alt:"logo",style:{height:"46px"}}),h.jsxs(kt,{alignSelf:"center",flexDirection:"column",className:mr("_bgcl-white _bdrd-24px _bsd-200 _pst-rlt _ovf-hd",{"_pd-32px":r,"_pd-64px":!r}),gap:8,style:{width:"100%",minHeight:"500px",height:"fit-content"},children:[e&&h.jsx(De,{variant:"ghost",className:"_pst-asl _l-0px _t-0px _pd-32px",onClick:e,children:h.jsx("i",{className:"fa-regular fa-arrow-left _fs-600"})}),t]})]})},rc=me.object({password:me.string().min(1,"common.validate.required")}),sc=({transition:t})=>{var u,f,p;const{t:e}=lt(),{register:r,formState:s,handleSubmit:n,setError:a}=Jt({resolver:Kt(rc)}),{errors:i}=s,o=wo();function l(A){var B,j;const S=new URLSearchParams(window.location.search),F=S.get("client_id"),L=S.get("callback_url"),O=Object.fromEntries(S.entries());o.mutate({...O,client_id:F,callback_url:L,auth_user:(j=(B=X)==null?void 0:B.get("auth-choice-form"))==null?void 0:j.auth_user,password:A==null?void 0:A.password},{onSuccess(U){var ee;X.removeAll(),Qr((ee=U==null?void 0:U.data)==null?void 0:ee.authorization_code)},onError(U){a("password",{type:"validate",message:e(St.getFirst(U==null?void 0:U.response))})}})}return o!=null&&o.isSuccess?h.jsx(kt,{flex:"1",width:"100%",height:"350px",alignItems:"center",justifyContent:"center",children:h.jsx(Hr,{variant:"fastwork"})}):h.jsxs(K,{className:"login-form",gap:12,as:"form",onSubmit:n(l),justifyContent:"center",flex:1,children:[h.jsx("h1",{className:"_fs-800 _tal-ct",children:e("login.title")}),h.jsxs(K,{gap:4,children:[h.jsx(mn,{label:(u=X.get("auth-choice-form"))==null?void 0:u.auth_user}),h.jsx(ze,{isFluid:!0,label:e("login.password-input.label"),placeholder:e("login.password-input.label"),info:e((f=i==null?void 0:i.password)==null?void 0:f.message),type:"password",variant:(p=i==null?void 0:i.password)!=null&&p.message?"negative":"primary",autoF
1ocus:!0,...r("password")})]}),h.jsxs(K,{gap:2,children:[h.jsx(De,{size:"large",isFluid:!0,type:"submit",isLoading:o==null?void 0:o.isPending,children:e("login.submit-button")}),h.jsx(De,{className:"_cl-primary-500",isFluid:!0,variant:"ghost",type:"button",onClick:()=>t("forgotPassword"),children:e("login.forget-password-button")})]})]})},nc=()=>{var p,A,S,F,L,O,B;const{t}=lt(),e=fe.useRef(null),r=(p=X.get("signup-form"))==null?void 0:p.email,s=(A=X.get("signup-form"))==null?void 0:A.password,n=(S=X.get("signup-form"))==null?void 0:S.consents,a=(F=X.get("signup-form"))==null?void 0:F.phone_number,i=Cn({email:r},{enabled:!1}),o=jo();async function l(){var U,ee;const j=(U=e.current)==null?void 0:U.getPassCode();try{const P=new URLSearchParams(window.location.search),q=P.get("client_id"),V=P.get("callback_url"),ae=Object.fromEntries(P.entries());o.mutate({...ae,client_id:q,callback_url:V,email:r,password:s,phone_number:a||"",reference_code:((ee=i==null?void 0:i.data)==null?void 0:ee.reference_code)||"",verification_code:j||"",is_accept_mkt:n==null?void 0:n.includes("marketing")},{onSuccess(Z){var Y;X.removeAll(),Qr((Y=Z==null?void 0:Z.data)==null?void 0:Y.authorization_code)}})}catch(P){console.log(P)}}function u(){i.refetch()}if(fe.useEffect(()=>{var j,U;(U=(j=e.current)==null?void 0:j.startCountDown)==null||U.call(j)},[]),o!=null&&o.isSuccess)return h.jsx(kt,{flex:"1",width:"100%",height:"350px",alignItems:"center",justifyContent:"center",children:h.jsx(Hr,{variant:"fastwork"})});const f=(L=i==null?void 0:i.data)==null?void 0:L.reference_code;return h.jsxs(K,{justifyContent:"center",className:"login-form",gap:12,flex:1,children:[h.jsx("h1",{className:"_fs-800 _tal-ct",children:t("verify-email.title")}),h.jsx(K,{gap:8,children:h.jsxs("span",{className:"_ffml-primary _cl-text-default-100 _tal-ct _wsp-pl _lh-150pct",children:[t("verify-email.description",{emailFormFlashStorage:r}),f&&t("verify-email.reference-code",{referenceCode:f})]})}),h.jsx(Ws,{onResend:u,onSubmitAction:l,ref:e,errorMessage:t(St.getFirst(((O=o==null?void 0:o.error)==null?void 0:O.response)||((B=i==null?void 0:i.error)==null?void 0:B.response))),submitButtonLabel:t("verify-email.otp-input.submit-button"),isLoading:o==null?void 0:o.isPending})]})},ac=()=>{const t=ba(),e=ec(),{transition:r}=e;async function s(){const a=new URLSearchParams(window.location.search),i=a.get("client_id"),o=a.get("callback_url");e.state==="AUTH_CHOICE"&&t.mutate({client_id:i,response_type:"code",callback_url:o},{onSuccess(l){var u;(u=l==null?void 0:l.data)!=null&&u.success||(window.location.href="https://auth2.fastlance.vn/oauth/error")},onError(){window.location.href="https://auth2.fastlance.vn/oauth/error"}})}fe.useEffect(()=>{s()},[]);const n=()=>{switch(e.state){case"AUTH_CHOICE":return h.jsx(qo,{transition:r});case"SIGN_UP":return h.jsx(Oo,{transition:r});case"VERIFY_EMAIL":return h.jsx(nc,{});case"LOGIN":return h.jsx(sc,{transition:r});case"FORGOT_PASSWORD_CONFIRM_EMAIL":return h.jsx(Ko,{transition:r});case"FORGOT_PASSWORD_VERIFY_EMAIL":return h.jsx(Xo,{transition:r});case"FORGOT_PASSWORD_CHANGE_PASSWORD":return h.jsx(Yo,{});default:return null}};return h.jsx(tc,{...e.hasPreviousState&&{goBack:function(){e.transition("goBack")}},children:n()})},ic=t=>{Bs();const{isLaptopAndBelow:e}=pr(),[r]=fe.useState(()=>new ha({defaultOptions:{queries:{retry:!1,refetchOnWindowFocus:!1}}})),s="vi",n=qs.createInstance();return n.use(Gs).init({lng:$s(),fallbackLng:s,interpolation:{escapeValue:!1},resources:{th:{"form-translation":va},en:{"form-translation":_a},id:{"form-translation":ya},vi:{"form-translation":ga}}}),h.jsx(Ys,{i18n:n,defaultNS:"form-translation",children:h.jsxs(ma,{client:r,children:[h.jsx(ac,{...t}),!e&&h.jsx(Do,{initialIsOpen:!1})]})})};ra.createRoot(document.getElementById("root")).render(h.jsx(G.StrictMode,{children:h.jsx(oc,{})}));function oc(){const{isLaptopAndBelow:t}=pr();return h.jsxs("div",{className:mr("container",{"lo-container":!t,"_dp-f _alit-ct _jtfct-ct":t}),children:[h.jsxs(kt,{width:"100%",justifyContent:"space-between",gap:12,children:[!t&&h.jsx(Vo,{containerClassName:"_mg-at"}),h.jsx(ic,{})]}),h.jsx(sa,{})]})}na();aa.initialize();
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.