import{a as st,i as xs,t as $,j as f,u as nt,A as _s,P as vs,e as ws,E as Fs,f as Ss}from"./index-CzTQZzQy.js";import{r as W,R as E,g as Es}from"./vendor-L5FivjNr.js";import{T as de,N as vr}from"./index-Dm0I4kYC.js";import{H as _e,S as ks}from"./index-CTAc7x3r.js";import{F as Ue,c as ve,C as Ke,a as Xe,b as Je,I as Ts}from"./index-BrpHLgnY.js";import{T as Os}from"./index--b4sRF-y.js";import{B as Vs}from"./index-qcynDQwW.js";/**
 * 2026 Paysera
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Academic Free License (AFL 3.0)
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/afl-3.0.php
 *
 * @author Paysera <plugins@paysera.com>
 * @copyright 2026 Paysera
 * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
 */var bt=(r=>(r.NEW_WINDOW="new_window",r.SAME_PAGE="same_page",r))(bt||{});const Ds=({tabs:r,defaultTab:t,syncWithHash:e=!0})=>{const s=W.useCallback(()=>{var d;if(!e)return t||r[0];const u=(d=window.location.hash)==null?void 0:d.replace("#","");return r.includes(u)?u:t||r[0]},[r,t,e]),[n,i]=W.useState(s),a=W.useCallback(u=>{i(u),e&&window.history.replaceState(null,"",`#${u}`)},[e]);return W.useEffect(()=>{if(!e)return;const u=()=>{const d=s();i(d)};return window.addEventListener("hashchange",u),()=>window.removeEventListener("hashchange",u)},[s,e]),{selectedTab:n,setSelectedTab:a}};var ze=r=>r.type==="checkbox",ke=r=>r instanceof Date,K=r=>r==null;const wr=r=>typeof r=="object";var U=r=>!K(r)&&!Array.isArray(r)&&wr(r)&&!ke(r),xt=r=>U(r)&&r.target?ze(r.target)?r.target.checked:r.target.value:r,Fr=(r,t)=>t.split(".").some((e,s,n)=>!isNaN(Number(e))&&r.has(n.slice(0,s).join("."))),Sr=r=>{const t=r.constructor&&r.constructor.prototype;return U(t)&&t.hasOwnProperty("isPrototypeOf")},it=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function B(r){if(r instanceof Date)return new Date(r);const t=typeof FileList<"u"&&r instanceof FileList;if(it&&(r instanceof Blob||t))return r;const e=Array.isArray(r);if(!e&&!(U(r)&&Sr(r)))return r;const s=e?[]:Object.create(Object.getPrototypeOf(r));for(const n in r)Object.prototype.hasOwnProperty.call(r,n)&&(s[n]=B(r[n]));return s}const xe={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change",SUBMIT:"submit",TRIGGER:"trigger",VALID:"valid"},ce={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},oe={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},ht="form",Er="root",kr=["__proto__","constructor","prototype"];var Le=r=>/^\w*$/.test(r),P=r=>r===void 0,at=r=>r.split(/[.[\]'"]/g).filter(Boolean),p=(r,t,e)=>{if(!t||!U(r))return e;const s=Le(t)?[t]:at(t);if(s.some(i=>kr.includes(i)))return e;const n=s.reduce((i,a)=>K(i)?void 0:i[a],r);return P(n)||n===r?P(r[t])?e:r[t]:n},re=r=>typeof r=="boolean",X=r=>typeof r=="function",N=(r,t,e)=>{let s=-1;const n=Le(t)?[t]:at(t),i=n.length,a=i-1;for(;++s<i;){const u=n[s];let d=e;if(s!==a){const h=r[u];d=U(h)||Array.isArray(h)?h:isNaN(+n[s+1])?{}:[]}if(kr.includes(u))return;r[u]=d,r=r[u]}};const Vt=E.createContext(null);Vt.displayName="HookFormControlContext";const Dt=()=>E.useContext(Vt);var Tr=(r,t,e,s=!0)=>{const n={};for(const i in r)Object.defineProperty(n,i,{get:()=>{const a=i;return t._proxyFormState[a]!==ce.all&&(t._proxyFormState[a]=!s||ce.all),e&&(e[a]=!0),r[a]}});return n};const At=it?E.useLayoutEffect:E.useEffect;function As(r){const t=Dt(),{control:e=t,disabled:s,name:n,exact:i}=r||{},[a,u]=E.useState(()=>({...e._formState,defaultValues:e._defaultValues})),d=E.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return At(()=>e._subscribe({name:n,formState:d.current,exact:i,callback:h=>{!s&&u({...e._formState,...h,defaultValues:e._defaultValues})}}),[n,s,i]),E.useEffect(()=>{d.current.isValid&&e._setValid(!0)},[e]),E.useMemo(()=>Tr(a,e,d.current,!1),[a,e])}var J=r=>typeof r=="string",_t=(r,t,e,s,n)=>J(r)?(s&&t.watch.add(r),p(e,r,n)):Array.isArray(r)?r.map(i=>(s&&t.watch.add(i),p(e,i))):(s&&(t.watchAll=!0),e),vt=r=>K(r)||!wr(r);const Qt=(r,t)=>t.length===0&&!Array.isArray(r)&&!Sr(r);function se(r,t,e=new WeakMap){if(r===t)return!0;if(vt(r)||vt(t))return Object.is(r,t);if(ke(r)&&ke(t))return Object.is(r.getTime(),t.getTime());const s=Object.keys(r),n=Object.keys(t);if(s.length!==n.length)return!1;if(Qt(r,s)||Qt(t,n))return Object.is(r,t);const i=e.get(r);if(i&&i.has(t))return!0;i?i.add(t):e.set(r,new WeakSet([t]));for(const a of s){const u=r[a];if(!(a in t))return!1;if(a!=="ref"){const d=t[a];if(ke(u)&&ke(d)||(U(u)||Array.isArray(u))&&(U(d)||Array.isArray(d))?!se(u,d,e):!Object.is(u,d))return!1}}return!0}function $s(r){const t=Dt(),{control:e=t,name:s,defaultValue:n,disabled:i,exact:a,compute:u}=r||{},d=E.useRef(n),h=E.useRef(u),_=E.useRef(void 0),y=E.useRef(e),v=E.useRef(s);h.current=u;const[w,j]=E.useState(()=>{const k=e._getWatch(s,d.current);return h.current?h.current(k):k}),V=E.useCallback(k=>{const O=_t(s,e._names,k||e._formValues,!1,d.current);return h.current?h.current(O):O},[e._formValues,e._names,s]),C=E.useCallback(k=>{if(!i){const O=_t(s,e._names,k||e._formValues,!1,d.current);if(h.current){const M=h.current(O);se(M,_.current)||(j(M),_.current=M)}else j(O)}},[e._formValues,e._names,i,s]);At(()=>((y.current!==e||!se(v.current,s))&&(y.current=e,v.current=s,C()),e._subscribe({name:s,formState:{values:!0},exact:a,callback:k=>{C(k.values)}})),[e,a,s,C]),E.useEffect(()=>e._removeUnmounted());const R=y.current!==e,S=v.current,Z=E.useMemo(()=>{if(i)return null;const k=!R&&!se(S,s);return R||k?V():null},[i,R,s,S,V]);return Z!==null?Z:w}function js(r){const t=Dt(),{name:e,disabled:s,control:n=t,shouldUnregister:i,defaultValue:a,exact:u=!0}=r,d=Fr(n._names.array,e),h=E.useMemo(()=>p(n._formValues,e,p(n._defaultValues,e,a)),[n,e,a]),_=$s({control:n,name:e,defaultValue:h,exact:u}),y=As({control:n,name:e,exact:u}),v=E.useRef(r),w=E.useRef(null),j=E.useRef(n.register(e,{...r.rules,value:_,...re(r.disabled)?{disabled:r.disabled}:{}}));v.current=r;const V=E.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!p(y.errors,e)},isDirty:{enumerable:!0,get:()=>!!p(y.dirtyFields,e)},isTouched:{enumerable:!0,get:()=>!!p(y.touchedFields,e)},isValidating:{enumerable:!0,get:()=>!!p(y.validatingFields,e)},error:{enumerable:!0,get:()=>p(y.errors,e)}}),[y,e]),C=E.useCallback(k=>{const O=xt(k);return p(n._fields,e)||(j.current=n.register(e,{...v.current.rules,value:O})),j.current.onChange({target:{value:xt(k),name:e},type:xe.CHANGE})},[e,n]),R=E.useCallback(()=>j.current.onBlur({target:{value:p(n._formValues,e),name:e},type:xe.BLUR}),[e,n._formValues]),S=E.useCallback(k=>{k&&(w.current={focus:()=>X(k.focus)&&k.focus(),select:()=>X(k.select)&&k.select(),setCustomValidity:M=>X(k.setCustomValidity)&&k.setCustomValidity(M),reportValidity:()=>X(k.reportValidity)&&k.reportValidity()});const O=p(n._fields,e);O&&O._f&&k&&(O._f.ref=w.current)},[n._fields,e]),Z=E.useMemo(()=>({name:e,value:_,...re(s)||y.disabled?{disabled:y.disabled||s}:{},onChange:C,onBlur:R,ref:S}),[e,s,y.disabled,C,R,S,_]);return E.useEffect(()=>{const k=n._options.shouldUnregister||i;n.register(e,{...v.current.rules,...re(v.current.disabled)?{disabled:v.current.disabled}:{}});const O=(M,fe)=>{const me=p(n._fields,M);me&&me._f&&(me._f.mount=fe)};if(O(e,!0),k){const M=B(p(i?n._defaultValues:n._options.values||n._defaultValues,e,p(n._options.defaultValues,e,v.current.defaultValue)));N(n._defaultValues,e,M),P(p(n._formValues,e))&&N(n._formValues,e,M)}if(!d&&n.register(e),w.current){const M=p(n._fields,e);M&&M._f&&(M._f.ref=w.current)}return()=>{(d?k&&!n._state.action:k)?n.unregister(e):O(e,!1)}},[e,n,d,i]),E.useEffect(()=>{n._setDisabledField({disabled:s,name:e})},[s,e,n]),E.useMemo(()=>({field:Z,formState:y,fieldState:V}),[Z,y,V])}const wt=r=>r.render(js(r)),$t=E.createContext(null);$t.displayName="HookFormContext";const lt=()=>E.useContext($t),Cs=({children:r,watch:t,getValues:e,getFieldState:s,setError:n,clearErrors:i,setValue:a,setValues:u,trigger:d,formState:h,resetField:_,reset:y,handleSubmit:v,unregister:w,control:j,register:V,setFocus:C,subscribe:R})=>{const S=E.useMemo(()=>({watch:t,getValues:e,getFieldState:s,setError:n,clearErrors:i,setValue:a,setValues:u,trigger:d,formState:h,resetField:_,reset:y,handleSubmit:v,unregister:w,control:j,register:V,setFocus:C,subscribe:R}),[i,j,h,s,e,v,V,y,_,n,C,a,u,R,d,w,t]);return E.createElement($t.Provider,{value:S},E.createElement(Vt.Provider,{value:S.control},r))};var Or=(r,t,e,s,n)=>t?{...e[r],types:{...e[r]&&e[r].types?e[r].types:{},[s]:n||!0}}:{},Vr=r=>Array.isArray(r)?r.filter(Boolean):[],We=r=>Array.isArray(r)?r:[r],er=()=>{let r=[];return{get observers(){return r},next:n=>{for(const i of r)i.next&&i.next(n)},subscribe:n=>(r.push(n),{unsubscribe:()=>{r=r.filter(i=>i!==n)}}),unsubscribe:()=>{r=[]}}};function Dr(r,t){const e={};for(const s in r)if(r.hasOwnProperty(s)){const n=r[s],i=t[s];if(n&&U(n)&&i){const a=Dr(n,i);U(a)&&(e[s]=a)}else r[s]&&(e[s]=i)}return e}var Y=r=>U(r)&&!Object.keys(r).length,jt=r=>r.type==="file",Qe=r=>{if(!it)return!1;const t=r?r.ownerDocument:0;return r instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Ar=r=>r.type==="select-multiple",Ct=r=>r.type==="radio",Ns=r=>Ct(r)||ze(r),mt=r=>Qe(r)&&r.isConnected;function Rs(r,t){const e=t.slice(0,-1).length;let s=0;for(;s<e;){if(K(r)){r=void 0;break}r=r[t[s]],s++}return r}function Ps(r){for(const t in r)if(r.hasOwnProperty(t)&&!P(r[t]))return!1;return!0}function H(r,t){if(J(t)&&Object.prototype.hasOwnProperty.call(r,t))return delete r[t],r;const e=Array.isArray(t)?t:Le(t)?[t]:at(t),s=e.length===1?r:Rs(r,e),n=e.length-1,i=e[n];return s&&delete s[i],n!==0&&(U(s)&&Y(s)||Array.isArray(s)&&Ps(s))&&H(r,e.slice(0,-1)),r}var Is=r=>{for(const t in r)if(X(r[t]))return!0;return!1};function $r(r){return Array.isArray(r)||U(r)&&!Is(r)}function Ft(r,t={}){for(const e in r){const s=r[e];$r(s)?(t[e]=Array.isArray(s)?[]:{},Ft(s,t[e])):P(s)||(t[e]=!0)}return t}function St(r){if(r!==!1){if(r===!0)return!0;if(Array.isArray(r)){const t=r.map(e=>St(e));return t.some(e=>e!==void 0)?t:void 0}if(U(r)){const t={};for(const e in r){const s=St(r[e]);P(s)||(t[e]=s)}return Object.keys(t).length?t:void 0}}}function Ee(r,t,e){e||(e=Ft(t));for(const s in r){const n=r[s];if($r(n))P(t)||vt(e[s])?e[s]=Ft(n,Array.isArray(n)?[]:{}):Ee(n,K(t)?{}:t[s],e[s]);else{const i=t[s];e[s]=!se(n,i)}}return St(e)||{}}const tr={value:!1,isValid:!1},rr={value:!0,isValid:!0};var jr=r=>{if(Array.isArray(r)){if(r.length>1){const t=r.filter(e=>e&&e.checked&&!e.disabled).map(e=>e.value);return{value:t,isValid:!!t.length}}return r[0].checked&&!r[0].disabled?r[0].attributes&&!P(r[0].attributes.value)?P(r[0].value)||r[0].value===""?rr:{value:r[0].value,isValid:!0}:rr:tr}return tr},Cr=(r,{valueAsNumber:t,valueAsDate:e,setValueAs:s})=>P(r)?r:t?r===""?NaN:r&&+r:e&&J(r)?new Date(r):s?s(r):r;const sr={isValid:!1,value:null};var Nr=r=>Array.isArray(r)?r.reduce((t,e)=>e&&e.checked&&!e.disabled?{isValid:!0,value:e.value}:t,sr):sr;function nr(r){const t=r.ref;return jt(t)?t.files:Ct(t)?Nr(r.refs).value:Ar(t)?[...t.selectedOptions].map(({value:e})=>e):ze(t)?jr(r.refs).value:Cr(P(t.value)?r.ref.value:t.value,r)}var Ms=(r,t,e,s)=>{const n={};for(const i of r){const a=p(t,i);a&&N(n,i,a._f)}return{criteriaMode:e,names:[...r],fields:n,shouldUseNativeValidation:s}},et=r=>r instanceof RegExp,Pe=r=>P(r)?r:et(r)?r.source:U(r)?et(r.value)?r.value.source:r.value:r,ir=r=>({isOnSubmit:!r||r===ce.onSubmit,isOnBlur:r===ce.onBlur,isOnChange:r===ce.onChange,isOnAll:r===ce.all,isOnTouch:r===ce.onTouched});const ar="AsyncFunction";var Us=r=>!!r&&!!r.validate&&!!(X(r.validate)&&r.validate.constructor.name===ar||U(r.validate)&&Object.values(r.validate).find(t=>t.constructor.name===ar)),zs=r=>r.mount&&(r.required||r.min||r.max||r.maxLength||r.minLength||r.pattern||r.validate),pt=(r,t,e)=>!e&&(t.watchAll||t.watch.has(r)||[...t.watch].some(s=>r.startsWith(`${s}.`)));const Me=(r,t,e,s)=>{for(const n of e||Object.keys(r)){const i=p(r,n);if(i){const{_f:a,...u}=i;if(a){if(a.refs&&a.refs[0]&&t(a.refs[0],n)&&!s)return!0;if(a.ref&&t(a.ref,a.name)&&!s)return!0;if(Me(u,t))break}else if(U(u)&&Me(u,t))break}}};function lr(r,t,e){const s=p(r,e);if(s||Le(e))return{error:s,name:e};const n=e.split(".");for(;n.length;){const i=n.join("."),a=p(t,i),u=p(r,i);if(a&&!Array.isArray(a)&&e!==i)return{name:e};if(u&&u.type)return{name:i,error:u};if(u&&u.root&&u.root.type)return{name:`${i}.root`,error:u.root};n.pop()}return{name:e}}var Ls=(r,t,e,s)=>{e(r);const{name:n,...i}=r;return Y(i)||s&&Object.keys(i).length>=Object.keys(t).length||Object.keys(i).find(a=>t[a]===(!s||ce.all))},Bs=(r,t,e)=>!r||!t||r===t||We(r).some(s=>s&&(e?s===t:s.startsWith(t)||t.startsWith(s))),Gs=(r,t,e,s,n)=>n.isOnAll?!1:!e&&n.isOnTouch?!(t||r):(e?s.isOnBlur:n.isOnBlur)?!r:(e?s.isOnChange:n.isOnChange)?r:!0,qs=(r,t)=>!Vr(p(r,t)).length&&H(r,t),ur=(r,t,e)=>{const s=p(r,e),n=Array.isArray(s)?s:[];return N(n,Er,t[e]),N(r,e,n),r};function or(r,t,e="validate"){if(J(r)||Array.isArray(r)&&r.every(J)||re(r)&&!r)return{type:e,message:J(r)?r:"",ref:t}}var De=r=>U(r)&&!et(r)?r:{value:r,message:""},cr=async(r,t,e,s,n,i)=>{const{ref:a,refs:u,required:d,maxLength:h,minLength:_,min:y,max:v,pattern:w,validate:j,name:V,valueAsNumber:C,mount:R}=r._f,S=p(e,V);if(!R||t.has(V))return{};const Z=u?u[0]:a,k=D=>{if(n&&Z.reportValidity){const T=re(D)?"":D||"";u?u.forEach(G=>G.setCustomValidity(T)):Z.setCustomValidity(T),Z.reportValidity()}},O={},M=Ct(a),fe=ze(a),me=M||fe,le=(C||jt(a))&&P(a.value)&&P(S)||Qe(a)&&a.value===""||S===""||Array.isArray(S)&&!S.length,ee=Or.bind(null,V,s,O),z=(D,T,G,L=oe.maxLength,ne=oe.minLength)=>{const pe=D?T:G;O[V]={type:D?L:ne,message:pe,ref:a,...ee(D?L:ne,pe)}};if(i?!Array.isArray(S)||!S.length:d&&(!me&&(le||K(S))||re(S)&&!S||fe&&!jr(u).isValid||M&&!Nr(u).isValid)){const{value:D,message:T}=J(d)?{value:!!d,message:d}:De(d);if(D&&(O[V]={type:oe.required,message:T,ref:Z,...ee(oe.required,T)},!s))return k(T),O}if(!le&&(!K(y)||!K(v))){let D,T;const G=De(v),L=De(y);if(!K(S)&&!isNaN(S)){const ne=a.valueAsNumber||S&&+S;K(G.value)||(D=ne>G.value),K(L.value)||(T=ne<L.value)}else{const ne=a.valueAsDate||new Date(S),pe=Be=>new Date(new Date().toDateString()+" "+Be),Ve=a.type=="time",Ce=a.type=="week";J(G.value)&&S&&(D=Ve?pe(S)>pe(G.value):Ce?S>G.value:ne>new Date(G.value)),J(L.value)&&S&&(T=Ve?pe(S)<pe(L.value):Ce?S<L.value:ne<new Date(L.value))}if((D||T)&&(z(!!D,G.message,L.message,oe.max,oe.min),!s))return k(O[V].message),O}if((h||_)&&!le&&(J(S)||i&&Array.isArray(S))){const D=De(h),T=De(_),G=!K(D.value)&&S.length>+D.value,L=!K(T.value)&&S.length<+T.value;if((G||L)&&(z(G,D.message,T.message),!s))return k(O[V].message),O}if(w&&!le&&J(S)){const{value:D,message:T}=De(w);if(et(D)&&!S.match(D)&&(O[V]={type:oe.pattern,message:T,ref:a,...ee(oe.pattern,T)},!s))return k(T),O}if(j){if(X(j)){const D=await j(S,e),T=or(D,Z);if(T&&(O[V]={...T,...ee(oe.validate,T.message)},!s))return k(T.message),O}else if(U(j)){let D={};for(const T in j){if(!Y(D)&&!s)break;const G=or(await j[T](S,e),Z,T);G&&(D={...G,...ee(T,G.message)},k(G.message),s&&(O[V]=D))}if(!Y(D)&&(O[V]={ref:Z,...D},!s))return O}}return k(!0),O};const Hs={mode:ce.onSubmit,reValidateMode:ce.onChange,shouldFocusError:!0},Rr={submitCount:0,isDirty:!1,isReady:!1,isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{}};function Ws(r={}){let t={...Hs,...r},e={...B(Rr),isLoading:X(t.defaultValues),errors:t.errors||{},disabled:t.disabled||!1},s={},n=U(t.defaultValues)||U(t.values)?B(t.defaultValues||t.values)||{}:{},i=t.shouldUnregister?{}:B(n),a={action:!1,mount:!1,watch:!1,keepIsValid:!1},u={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set,registerName:new Set},d,h=0;const _={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},y={..._};let v={...y};const w={array:er(),state:er()},j=t.criteriaMode===ce.all,V=l=>o=>{clearTimeout(h),h=setTimeout(l,o)},C=async l=>{if(!a.keepIsValid&&!t.disabled&&(y.isValid||v.isValid||l)){let o;t.resolver?(o=Y((await ee()).errors),R()):o=await T({fields:s,onlyCheckValid:!0,eventType:xe.VALID}),o!==e.isValid&&w.state.next({isValid:o})}},R=(l,o)=>{!t.disabled&&(y.isValidating||y.validatingFields||v.isValidating||v.validatingFields)&&((l||Array.from(u.mount)).forEach(c=>{c&&(o?N(e.validatingFields,c,o):H(e.validatingFields,c))}),w.state.next({validatingFields:e.validatingFields,isValidating:!Y(e.validatingFields)}))},S=()=>{e.dirtyFields=Ee(n,i)},Z=(l,o=[],c,m,b=!0,x=!0)=>{if(m&&c&&!t.disabled){if(a.action=!0,x&&Array.isArray(p(s,l))){const g=c(p(s,l),m.argA,m.argB);b&&N(s,l,g)}if(x&&Array.isArray(p(e.errors,l))){const g=c(p(e.errors,l),m.argA,m.argB);b&&N(e.errors,l,g),qs(e.errors,l)}if((y.touchedFields||v.touchedFields)&&x&&Array.isArray(p(e.touchedFields,l))){const g=c(p(e.touchedFields,l),m.argA,m.argB);b&&N(e.touchedFields,l,g)}(y.dirtyFields||v.dirtyFields)&&S(),w.state.next({name:l,isDirty:L(l,o),dirtyFields:e.dirtyFields,errors:e.errors,isValid:e.isValid})}else N(i,l,o)},k=(l,o)=>{N(e.errors,l,o),e.errors={...e.errors},w.state.next({errors:e.errors})},O=l=>{e.errors=l,w.state.next({errors:e.errors,isValid:!1})},M=l=>{const o=Le(l)?[l]:at(l);let c=i,m=n;for(let b=0;b<o.length-1;b++){const x=o[b];if(c=K(c)?c:c[x],m=K(m)?m:m[x],c===null&&m!==null)return!0}return!1},fe=(l,o,c,m)=>{const b=p(s,l);if(b){if(M(l))return;const x=P(p(i,l)),g=p(i,l,P(c)?p(n,l):c);P(g)||m&&m.defaultChecked||o?N(i,l,o?g:nr(b._f)):Ve(l,g),a.mount&&!a.action&&(C(),x&&e.isDirty&&(y.isDirty||v.isDirty)&&(L()||(e.isDirty=!1,w.state.next({...e}))),r.shouldUnregister&&x&&!P(p(i,l))&&pt(l,u)&&(a.watch=!0))}},me=(l,o,c,m,b)=>{let x=!1,g=!1;const F={name:l};if(!t.disabled){if(!c||m){(y.isDirty||v.isDirty)&&(g=e.isDirty,e.isDirty=F.isDirty=L(),x=g!==F.isDirty);const A=se(p(n,l),o);g=!!p(e.dirtyFields,l),A!==e.isDirty?e.dirtyFields=Ee(n,i):A?H(e.dirtyFields,l):N(e.dirtyFields,l,!0),F.dirtyFields=e.dirtyFields,x=x||(y.dirtyFields||v.dirtyFields)&&g!==!A}if(c){const A=p(e.touchedFields,l);A||(N(e.touchedFields,l,c),F.touchedFields=e.touchedFields,x=x||(y.touchedFields||v.touchedFields)&&A!==c)}x&&b&&w.state.next(F)}return x?F:{}},le=(l,o,c,m)=>{const b=p(e.errors,l),x=(y.isValid||v.isValid)&&re(o)&&e.isValid!==o;if(t.delayError&&c?(d=V(()=>k(l,c)),d(t.delayError)):(clearTimeout(h),d=null,c?N(e.errors,l,c):H(e.errors,l),e.errors={...e.errors}),(c?!se(b,c):b)||!Y(m)||x){const g={...m,...x&&re(o)?{isValid:o}:{},errors:e.errors,name:l};e={...e,...g},w.state.next(g)}},ee=async l=>(R(l,!0),await t.resolver(i,t.context,Ms(l||u.mount,s,t.criteriaMode,t.shouldUseNativeValidation))),z=async l=>{const{errors:o}=await ee(l);if(R(l),l){for(const c of l){const m=p(o,c);m?u.array.has(c)&&U(m)&&!Object.keys(m).some(b=>!Number.isNaN(Number(b)))?ur(e.errors,{[c]:m},c):N(e.errors,c,m):H(e.errors,c)}e.errors={...e.errors}}else e.errors=o;return o},D=async({name:l,eventType:o})=>{if(r.validate){const c=await r.validate({formValues:i,formState:e,name:l,eventType:o});if(U(c))for(const m in c){const b=c[m];b&&Ge(`${ht}.${m}`,{message:J(b.message)?b.message:"",type:b.type||oe.validate})}else J(c)||!c?Ge(ht,{message:c||"",type:oe.validate}):Gt(ht);return c}return!0},T=async({fields:l,onlyCheckValid:o,name:c,eventType:m,context:b={valid:!0,runRootValidation:!1}})=>{if(r.validate&&(b.runRootValidation=!0,!await D({name:c,eventType:m})&&(b.valid=!1,o)))return b.valid;for(const x in l){const g=l[x];if(g){const{_f:F,...A}=g;if(F){const q=u.array.has(F.name),ie=g._f&&Us(g._f),ue=y.validatingFields||y.isValidating||v.validatingFields||v.isValidating;ie&&ue&&R([F.name],!0);const Fe=await cr(g,u.disabled,i,j,t.shouldUseNativeValidation&&!o,q);if(ie&&ue&&R([F.name]),Fe[F.name]&&(b.valid=!1,o)||(!o&&(p(Fe,F.name)?q?ur(e.errors,Fe,F.name):N(e.errors,F.name,Fe[F.name]):H(e.errors,F.name)),r.shouldUseNativeValidation&&Fe[F.name]))break}!Y(A)&&await T({context:b,onlyCheckValid:o,fields:A,name:x,eventType:m})}}return b.valid},G=()=>{for(const l of u.unMount){const o=p(s,l);o&&(o._f.refs?o._f.refs.every(c=>!mt(c)):!mt(o._f.ref))&&ot(l)}u.unMount=new Set},L=(l,o)=>!t.disabled&&(l&&o&&N(i,l,o),!se(Lt(),n)),ne=(l,o,c)=>_t(l,u,{...a.mount?i:P(o)?n:J(l)?{[l]:o}:o},c,o),pe=l=>Vr(p(a.mount?i:n,l,t.shouldUnregister?p(n,l,[]):[])),Ve=(l,o,c={},m=!1)=>{const b=p(s,l);let x=o;if(b){const g=b._f;g&&(!g.disabled&&N(i,l,Cr(o,g)),x=Qe(g.ref)&&K(o)?"":o,Ar(g.ref)?[...g.ref.options].forEach(F=>F.selected=x.includes(F.value)):g.refs?ze(g.ref)?g.refs.forEach(F=>{(!F.defaultChecked||!F.disabled)&&(Array.isArray(x)?F.checked=!!x.find(A=>A===F.value):F.checked=x===F.value||!!x)}):g.refs.forEach(F=>F.checked=F.value===x):jt(g.ref)?g.ref.value="":(g.ref.value=x,g.ref.type||w.state.next({name:l,values:m?i:B(i)})))}(c.shouldDirty||c.shouldTouch)&&me(l,x,c.shouldTouch,c.shouldDirty,!0),c.shouldValidate&&ut(l)},Ce=(l,o,c,m=!1)=>{for(const b in o){if(!o.hasOwnProperty(b))return;const x=o[b],g=l+"."+b,F=p(s,g);(u.array.has(l)||U(x)||F&&!F._f)&&!ke(x)?Ce(g,x,c,m):Ve(g,x,c,m)}},Be=(l,o,c,m)=>{const b=p(s,l),x=u.array.has(l),g=m?o:B(o),F=p(i,l),A=se(F,g);if(A||N(i,l,g),x)w.array.next({name:l,values:m?i:B(i)}),(y.isDirty||y.dirtyFields||v.isDirty||v.dirtyFields)&&c.shouldDirty&&(S(),w.state.next({name:l,dirtyFields:e.dirtyFields,isDirty:L(l,g)}));else{const q=Array.isArray(g)&&!g.length||Y(g);!b||b._f||K(g)||q?Ve(l,g,c,m):Ce(l,g,c,m)}if(!A){const q=pt(l,u),ie=m?i:B(i);w.state.next({...q&&e,name:a.mount||q?l:void 0,values:ie})}},Ne=(l,o,c={})=>Be(l,o,c,!1),cs=(l,o={})=>{const c=X(l)?l(i):l;if(!se(i,c)){i={...i,...c};for(const m of u.mount)Be(m,p(c,m),o,!0);w.state.next({...e,name:void 0,type:void 0,values:i}),o.shouldValidate&&C()}},Ut=async l=>{a.mount=!0;const o=l.target;let c=o.name,m=!0;const b=p(s,c),x=A=>{m=Number.isNaN(A)||ke(A)&&isNaN(A.getTime())||se(A,p(i,c,A))},g=ir(t.mode),F=ir(t.reValidateMode);if(b){let A,q;const ie=o.type?nr(b._f):xt(l),ue=l.type===xe.BLUR||l.type===xe.FOCUS_OUT,Fe=!zs(b._f)&&!r.validate&&!t.resolver&&!p(e.errors,c)&&!b._f.deps||Gs(ue,p(e.touchedFields,c),e.isSubmitted,F,g),ft=pt(c,u,ue);N(i,c,ie),ue?(!o||!o.readOnly)&&(b._f.onBlur&&b._f.onBlur(l),d&&d(0)):b._f.onChange&&b._f.onChange(l);const Re=me(c,ie,ue),gs=!Y(Re)||ft;if(!ue&&w.state.next({name:c,type:l.type,values:B(i)}),Fe)return(y.isValid||v.isValid)&&(t.mode==="onBlur"?ue&&C():ue||C()),gs&&w.state.next({name:c,...ft?{}:Re});if(!t.resolver&&r.validate&&await D({name:c,eventType:l.type}),!ue&&ft&&w.state.next({...e}),t.resolver){const{errors:Xt}=await ee([c]);if(R([c]),x(ie),!m){!Y(Re)&&w.state.next(Re);return}const bs=lr(e.errors,s,c),Jt=lr(Xt,s,bs.name||c);A=Jt.error,c=Jt.name,q=Y(Xt)}else R([c],!0),A=(await cr(b,u.disabled,i,j,t.shouldUseNativeValidation))[c],R([c]),x(ie),m&&(A?q=!1:(y.isValid||v.isValid)&&(q=await T({fields:s,onlyCheckValid:!0,name:c,eventType:l.type})));m&&(b._f.deps&&(!Array.isArray(b._f.deps)||b._f.deps.length>0)&&ut(b._f.deps),le(c,q,A,Re))}},zt=(l,o)=>{if(p(e.errors,o)&&l.focus)return l.focus(),1},ut=async(l,o={})=>{let c,m;const b=We(l);if(t.resolver){const x=await z(P(l)?l:b);c=Y(x),m=l?!b.some(g=>p(x,g)):c}else l?(m=(await Promise.all(b.map(async x=>{const g=p(s,x);return await T({fields:g&&g._f?{[x]:g}:g,eventType:xe.TRIGGER})}))).every(Boolean),!(!m&&!e.isValid)&&C()):m=c=await T({fields:s,name:l,eventType:xe.TRIGGER});return w.state.next({...!J(l)||(y.isValid||v.isValid)&&c!==e.isValid?{}:{name:l},...t.resolver||!l?{isValid:c}:{},errors:e.errors}),o.shouldFocus&&!m&&Me(s,zt,l?b:u.mount),m},Lt=(l,o)=>{let c={...a.mount?i:n};return o&&(c=Dr(o.dirtyFields?e.dirtyFields:e.touchedFields,c)),P(l)?c:J(l)?p(c,l):l.map(m=>p(c,m))},Bt=(l,o)=>({invalid:!!p((o||e).errors,l),isDirty:!!p((o||e).dirtyFields,l),error:p((o||e).errors,l),isValidating:!!p(e.validatingFields,l),isTouched:!!p((o||e).touchedFields,l)}),Gt=l=>{const o=l?We(l):void 0;o==null||o.forEach(c=>H(e.errors,c)),o?o.forEach(c=>{w.state.next({name:c,errors:e.errors})}):w.state.next({errors:{}})},Ge=(l,o,c)=>{const m=(p(s,l,{_f:{}})._f||{}).ref,b=p(e.errors,l)||{},{ref:x,message:g,type:F,...A}=b;N(e.errors,l,{...A,...o,ref:m}),w.state.next({name:l,errors:e.errors,isValid:!1}),c&&c.shouldFocus&&m&&m.focus&&m.focus()},ds=(l,o)=>X(l)?w.state.subscribe({next:c=>"values"in c&&l(c.values||ne(void 0,o),c)}):ne(l,o,!0),qt=l=>w.state.subscribe({next:o=>{if(Bs(l.name,o.name,l.exact)&&Ls(o,l.formState||y,ys,l.reRenderRoot)){const c={...i};l.callback({values:c,...e,...o,defaultValues:n})}}}).unsubscribe,fs=l=>(a.mount=!0,v={...v,...l.formState},qt({...l,formState:{..._,...l.formState}})),ot=(l,o={})=>{for(const c of l?We(l):u.mount)u.mount.delete(c),u.array.delete(c),o.keepValue||(H(s,c),H(i,c)),!o.keepError&&H(e.errors,c),!o.keepDirty&&H(e.dirtyFields,c),!o.keepTouched&&H(e.touchedFields,c),!o.keepIsValidating&&H(e.validatingFields,c),!t.shouldUnregister&&!o.keepDefaultValue&&H(n,c);w.state.next({values:B(i)}),w.state.next({...e,...o.keepDirty?{isDirty:L()}:{}}),!o.keepIsValid&&C()},Ht=({disabled:l,name:o})=>{if(re(l)&&a.mount||l||u.disabled.has(o)){const b=u.disabled.has(o)!==!!l;l?u.disabled.add(o):u.disabled.delete(o),b&&a.mount&&!a.action&&C()}},ct=(l,o={})=>{let c=p(s,l);const m=re(o.disabled)||re(t.disabled),b=!u.registerName.has(l)&&c&&c._f&&!c._f.mount;return N(s,l,{...c||{},_f:{...c&&c._f?c._f:{ref:{name:l}},name:l,mount:!0,...o}}),u.mount.add(l),c&&!b?Ht({disabled:re(o.disabled)?o.disabled:t.disabled,name:l}):fe(l,!0,o.value),{...m?{disabled:o.disabled||t.disabled}:{},...t.progressive?{required:!!o.required,min:Pe(o.min),max:Pe(o.max),minLength:Pe(o.minLength),maxLength:Pe(o.maxLength),pattern:Pe(o.pattern)}:{},name:l,onChange:Ut,onBlur:Ut,ref:x=>{if(x){u.registerName.add(l),ct(l,o),u.registerName.delete(l),c=p(s,l);const g=P(x.value)&&x.querySelectorAll&&x.querySelectorAll("input,select,textarea")[0]||x,F=Ns(g),A=c._f.refs||[];if(F?A.find(q=>q===g):g===c._f.ref)return;N(s,l,{_f:{...c._f,...F?{refs:[...A.filter(mt),g,...Array.isArray(p(n,l))?[{}]:[]],ref:{type:g.type,name:l}}:{ref:g}}}),fe(l,!1,void 0,g)}else c=p(s,l,{}),c._f&&(c._f.mount=!1),(t.shouldUnregister||o.shouldUnregister)&&!(Fr(u.array,l)&&a.action)&&u.unMount.add(l)}}},dt=()=>t.shouldFocusError&&!t.shouldUseNativeValidation&&Me(s,zt,u.mount),hs=l=>{re(l)&&(w.state.next({disabled:l}),Me(s,(o,c)=>{const m=p(s,c);m&&(o.disabled=m._f.disabled||l,Array.isArray(m._f.refs)&&m._f.refs.forEach(b=>{b.disabled=m._f.disabled||l}))},0,!1))},Wt=(l,o)=>async c=>{let m;c&&(c.preventDefault&&c.preventDefault(),c.persist&&c.persist());let b=B(i);if(w.state.next({isSubmitting:!0}),t.resolver){const{errors:x,values:g}=await ee();R(),e.errors=x,b=B(g)}else await T({fields:s,eventType:xe.SUBMIT});if(u.disabled.size)for(const x of u.disabled)H(b,x);if(H(e.errors,Er),Y(e.errors)){w.state.next({errors:{}});try{await l(b,c)}catch(x){m=x}}else o&&await o({...e.errors},c),dt(),setTimeout(dt);if(w.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Y(e.errors)&&!m,submitCount:e.submitCount+1,errors:e.errors}),m)throw m},ms=(l,o={})=>{p(s,l)&&(P(o.defaultValue)?Ne(l,B(p(n,l))):(Ne(l,o.defaultValue),N(n,l,B(o.defaultValue))),o.keepTouched||H(e.touchedFields,l),o.keepDirty||(H(e.dirtyFields,l),e.isDirty=o.defaultValue?L(l,B(p(n,l))):L()),o.keepError||(H(e.errors,l),y.isValid&&C()),w.state.next({...e}))},Zt=(l,o={})=>{const c=l?B(l):n,m=B(c),b=Y(l),x=m;if(o.keepDefaultValues||(n=c),!o.keepValues){if(o.keepDirtyValues){const g=new Set([...u.mount,...Object.keys(Ee(n,i))]);for(const F of Array.from(g)){const A=p(e.dirtyFields,F),q=p(i,F),ie=p(x,F);A&&!P(q)?N(x,F,q):!A&&!P(ie)&&Ne(F,ie)}}else{if(it&&P(l))for(const g of u.mount){const F=p(s,g);if(F&&F._f){const A=Array.isArray(F._f.refs)?F._f.refs[0]:F._f.ref;if(Qe(A)){const q=A.closest("form");if(q){q.reset();break}}}}if(o.keepFieldsRef)for(const g of u.mount)Ne(g,p(x,g));else s={}}if(t.shouldUnregister){if(i=o.keepDefaultValues?B(n):{},o.keepFieldsRef)for(const g of u.mount)N(i,g,p(x,g))}else i=B(x);w.array.next({values:{...x}}),w.state.next({values:{...x}})}u={mount:o.keepDirtyValues?u.mount:new Set,unMount:new Set,array:new Set,registerName:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},a.mount=!y.isValid||!!o.keepIsValid||!!o.keepDirtyValues||!t.shouldUnregister&&!Y(x),a.watch=!!t.shouldUnregister,a.keepIsValid=!!o.keepIsValid,a.action=!1,o.keepErrors||(e.errors={}),w.state.next({submitCount:o.keepSubmitCount?e.submitCount:0,isDirty:b?!1:o.keepDirty?e.isDirty:o.keepValues?L():!!(o.keepDefaultValues&&!se(l,n)),isSubmitted:o.keepIsSubmitted?e.isSubmitted:!1,dirtyFields:b?{}:o.keepDirtyValues?o.keepDefaultValues&&i?Ee(n,i):e.dirtyFields:o.keepDefaultValues&&l?Ee(n,l):o.keepDirty?e.dirtyFields:{},touchedFields:o.keepTouched?e.touchedFields:{},errors:o.keepErrors?e.errors:{},isSubmitSuccessful:o.keepIsSubmitSuccessful?e.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:n})},Yt=(l,o)=>Zt(X(l)?l(i):l,{...t.resetOptions,...o}),ps=(l,o={})=>{const c=p(s,l),m=c&&c._f;if(m){const b=m.refs?m.refs[0]:m.ref;b.focus&&setTimeout(()=>{b.focus(),o.shouldSelect&&X(b.select)&&b.select()})}},ys=l=>{e={...e,...l}},Kt={control:{register:ct,unregister:ot,getFieldState:Bt,handleSubmit:Wt,setError:Ge,_subscribe:qt,_runSchema:ee,_updateIsValidating:R,_focusError:dt,_getWatch:ne,_getDirty:L,_setValid:C,_setFieldArray:Z,_setDisabledField:Ht,_setErrors:O,_getFieldArray:pe,_reset:Zt,_resetDefaultValues:()=>X(t.defaultValues)&&t.defaultValues().then(l=>{Yt(l,t.resetOptions),w.state.next({isLoading:!1})}),_removeUnmounted:G,_disableForm:hs,_subjects:w,_proxyFormState:y,get _fields(){return s},get _formValues(){return i},get _state(){return a},set _state(l){a=l},get _defaultValues(){return n},get _names(){return u},set _names(l){u=l},get _formState(){return e},get _options(){return t},set _options(l){t={...t,...l}}},subscribe:fs,trigger:ut,register:ct,handleSubmit:Wt,watch:ds,setValue:Ne,setValues:cs,getValues:Lt,reset:Yt,resetField:ms,resetDefaultValues:(l,o={})=>{if(n=B(l),!o.keepDirty){const c=Ee(n,i);e.dirtyFields=c,e.isDirty=!Y(c)}o.keepIsValid||C(),w.state.next({...e,defaultValues:n})},clearErrors:Gt,unregister:ot,setError:Ge,setFocus:ps,getFieldState:Bt};return{...Kt,formControl:Kt}}function Zs(r={}){const t=E.useRef(void 0),e=E.useRef(void 0),s=E.useRef(r.formControl),[n,i]=E.useState(()=>({...B(Rr),isLoading:X(r.defaultValues),errors:r.errors||{},disabled:r.disabled||!1,defaultValues:X(r.defaultValues)?void 0:r.defaultValues}));if(!t.current||r.formControl&&s.current!==r.formControl)if(s.current=r.formControl,r.formControl)t.current={...r.formControl,formState:n},r.defaultValues&&!X(r.defaultValues)&&r.formControl.reset(r.defaultValues,r.resetOptions);else{const{formControl:u,...d}=Ws(r);t.current={...d,formState:n}}const a=t.current.control;return a._options=r,At(()=>{const u=a._subscribe({formState:a._proxyFormState,callback:()=>i({...a._formState,defaultValues:a._defaultValues}),reRenderRoot:!0});return i(d=>({...d,isReady:!0})),a._formState.isReady=!0,u},[a]),E.useEffect(()=>a._disableForm(r.disabled),[a,r.disabled]),E.useEffect(()=>{r.mode&&(a._options.mode=r.mode),r.reValidateMode&&(a._options.reValidateMode=r.reValidateMode)},[a,r.mode,r.reValidateMode]),E.useEffect(()=>{r.errors&&(a._setErrors(r.errors),a._focusError())},[a,r.errors]),E.useEffect(()=>{r.shouldUnregister&&a._subjects.state.next({values:a._getWatch()})},[a,r.shouldUnregister]),E.useEffect(()=>{if(a._proxyFormState.isDirty){const u=a._getDirty();u!==n.isDirty&&a._subjects.state.next({isDirty:u})}},[a,n.isDirty]),E.useEffect(()=>{var u;r.values&&!se(r.values,e.current)?(a._reset(r.values,{keepFieldsRef:!0,...a._options.resetOptions}),!((u=a._options.resetOptions)===null||u===void 0)&&u.keepIsValid||a._setValid(),e.current=r.values,i(d=>({...d}))):a._resetDefaultValues()},[a,r.values]),E.useEffect(()=>{a._state.mount||(a._setValid(),a._state.mount=!0),a._state.watch&&(a._state.watch=!1,a._subjects.state.next({...a._formState})),a._removeUnmounted()}),t.current.formState=E.useMemo(()=>Tr(n,a),[a,n]),t.current}const dr=(r,t,e)=>{if(r&&"reportValidity"in r){const s=p(e,t);r.setCustomValidity(s&&s.message||""),r.reportValidity()}},Pr=(r,t)=>{for(const e in t.fields){const s=t.fields[e];s&&s.ref&&"reportValidity"in s.ref?dr(s.ref,e,r):s.refs&&s.refs.forEach(n=>dr(n,e,r))}},Ys=(r,t)=>{t.shouldUseNativeValidation&&Pr(r,t);const e={};for(const s in r){const n=p(t.fields,s),i=Object.assign(r[s]||{},{ref:n&&n.ref});if(Ks(t.names||Object.keys(r),s)){const a=Object.assign({},p(e,s));N(a,"root",i),N(e,s,a)}else N(e,s,i)}return e},Ks=(r,t)=>r.some(e=>e.startsWith(t+"."));function Xs(r,t,e){return t===void 0&&(t={}),e===void 0&&(e={}),function(s,n,i){try{return Promise.resolve(function(a,u){try{var d=(t.context,Promise.resolve(r[e.mode==="sync"?"validateSync":"validate"](s,Object.assign({abortEarly:!1},t,{context:n}))).then(function(h){return i.shouldUseNativeValidation&&Pr({},i),{values:e.raw?s:h,errors:{}}}))}catch(h){return u(h)}return d&&d.then?d.then(void 0,u):d}(0,function(a){if(!a.inner)throw a;return{values:{},errors:Ys((u=a,d=!i.shouldUseNativeValidation&&i.criteriaMode==="all",(u.inner||[]).reduce(function(h,_){if(h[_.path]||(h[_.path]={message:_.message,type:_.type}),d){var y=h[_.path].types,v=y&&y[_.type];h[_.path]=Or(_.path,d,h,_.type,v?[].concat(v,_.message):_.message)}return h},{})),i)};var u,d}))}catch(a){return Promise.reject(a)}}}function je(r){this._maxSize=r,this.clear()}je.prototype.clear=function(){this._size=0,this._values=Object.create(null)};je.prototype.get=function(r){return this._values[r]};je.prototype.set=function(r,t){return this._size>=this._maxSize&&this.clear(),r in this._values||this._size++,this._values[r]=t};var Js=/[^.^\]^[]+|(?=\[\]|\.\.)/g,Ir=/^\d+$/,Qs=/^\d/,en=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,tn=/^\s*(['"]?)(.*?)(\1)\s*$/,Nt=512,fr=new je(Nt);new je(Nt);var hr=new je(Nt),Te={split:Et,normalizePath:mr,getter:function(r,t){var e=mr(r);return hr.get(r)||hr.set(r,function(n){for(var i=0,a=e.length;i<a;)if(n!=null||!t)n=n[e[i++]];else return;return n})},join:function(r){return r.reduce(function(t,e){return t+(Rt(e)||Ir.test(e)?"["+e+"]":(t?".":"")+e)},"")},forEach:function(r,t,e){rn(Array.isArray(r)?r:Et(r),t,e)}};function mr(r){return fr.get(r)||fr.set(r,Et(r).map(function(t){return t.replace(tn,"$2")}))}function Et(r){return r.match(Js)||[""]}function rn(r,t,e){var s=r.length,n,i,a,u;for(i=0;i<s;i++)n=r[i],n&&(an(n)&&(n='"'+n+'"'),u=Rt(n),a=!u&&/^\d+$/.test(n),t.call(e,n,u,a,i,r))}function Rt(r){return typeof r=="string"&&r&&["'",'"'].indexOf(r.charAt(0))!==-1}function sn(r){return r.match(Qs)&&!r.match(Ir)}function nn(r){return en.test(r)}function an(r){return!Rt(r)&&(sn(r)||nn(r))}const ln=/[A-Z\xc0-\xd6\xd8-\xde]?[a-z\xdf-\xf6\xf8-\xff]+(?:['’](?:d|ll|m|re|s|t|ve))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde]|$)|(?:[A-Z\xc0-\xd6\xd8-\xde]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:D|LL|M|RE|S|T|VE))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde](?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])|$)|[A-Z\xc0-\xd6\xd8-\xde]?(?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:d|ll|m|re|s|t|ve))?|[A-Z\xc0-\xd6\xd8-\xde]+(?:['’](?:D|LL|M|RE|S|T|VE))?|\d*(?:1ST|2ND|3RD|(?![123])\dTH)(?=\b|[a-z_])|\d*(?:1st|2nd|3rd|(?![123])\dth)(?=\b|[A-Z_])|\d+|(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?)*/g,Mr=r=>r.match(ln)||[],un=(r,t)=>Mr(r).join(t).toLowerCase(),on=r=>Mr(r).reduce((t,e)=>`${t}${t?e[0].toUpperCase()+e.slice(1).toLowerCase():e.toLowerCase()}`,""),cn=r=>un(r,"_");var yt={camelCase:on,snakeCase:cn},Pt={exports:{}};Pt.exports=function(r){return Ur(dn(r),r)};Pt.exports.array=Ur;function Ur(r,t){var e=r.length,s=new Array(e),n={},i=e,a=fn(t),u=hn(r);for(t.forEach(function(h){if(!u.has(h[0])||!u.has(h[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});i--;)n[i]||d(r[i],i,new Set);return s;function d(h,_,y){if(y.has(h)){var v;try{v=", node was:"+JSON.stringify(h)}catch{v=""}throw new Error("Cyclic dependency"+v)}if(!u.has(h))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(h));if(!n[_]){n[_]=!0;var w=a.get(h)||new Set;if(w=Array.from(w),_=w.length){y.add(h);do{var j=w[--_];d(j,u.get(j),y)}while(_);y.delete(h)}s[--e]=h}}}function dn(r){for(var t=new Set,e=0,s=r.length;e<s;e++){var n=r[e];t.add(n[0]),t.add(n[1])}return Array.from(t)}function fn(r){for(var t=new Map,e=0,s=r.length;e<s;e++){var n=r[e];t.has(n[0])||t.set(n[0],new Set),t.has(n[1])||t.set(n[1],new Set),t.get(n[0]).add(n[1])}return t}function hn(r){for(var t=new Map,e=0,s=r.length;e<s;e++)t.set(r[e],e);return t}var mn=Pt.exports;const pn=Es(mn),yn=Object.prototype.toString,gn=Error.prototype.toString,bn=RegExp.prototype.toString,xn=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",_n=/^Symbol\((.*)\)(.*)$/;function vn(r){return r!=+r?"NaN":r===0&&1/r<0?"-0":""+r}function pr(r,t=!1){if(r==null||r===!0||r===!1)return""+r;const e=typeof r;if(e==="number")return vn(r);if(e==="string")return t?`"${r}"`:r;if(e==="function")return"[Function "+(r.name||"anonymous")+"]";if(e==="symbol")return xn.call(r).replace(_n,"Symbol($1)");const s=yn.call(r).slice(8,-1);return s==="Date"?isNaN(r.getTime())?""+r:r.toISOString(r):s==="Error"||r instanceof Error?"["+gn.call(r)+"]":s==="RegExp"?bn.call(r):null}function we(r,t){let e=pr(r,t);return e!==null?e:JSON.stringify(r,function(s,n){let i=pr(this[s],t);return i!==null?i:n},2)}function zr(r){return r==null?[]:[].concat(r)}let Lr,Br,Gr,wn=/\$\{\s*(\w+)\s*\}/g;Lr=Symbol.toStringTag;class yr{constructor(t,e,s,n){this.name=void 0,this.message=void 0,this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=void 0,this.inner=void 0,this[Lr]="Error",this.name="ValidationError",this.value=e,this.path=s,this.type=n,this.errors=[],this.inner=[],zr(t).forEach(i=>{if(Q.isError(i)){this.errors.push(...i.errors);const a=i.inner.length?i.inner:[i];this.inner.push(...a)}else this.errors.push(i)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0]}}Br=Symbol.hasInstance;Gr=Symbol.toStringTag;class Q extends Error{static formatError(t,e){const s=e.label||e.path||"this";return e=Object.assign({},e,{path:s,originalPath:e.path}),typeof t=="string"?t.replace(wn,(n,i)=>we(e[i])):typeof t=="function"?t(e):t}static isError(t){return t&&t.name==="ValidationError"}constructor(t,e,s,n,i){const a=new yr(t,e,s,n);if(i)return a;super(),this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=[],this.inner=[],this[Gr]="Error",this.name=a.name,this.message=a.message,this.type=a.type,this.value=a.value,this.path=a.path,this.errors=a.errors,this.inner=a.inner,Error.captureStackTrace&&Error.captureStackTrace(this,Q)}static[Br](t){return yr[Symbol.hasInstance](t)||super[Symbol.hasInstance](t)}}let he={default:"${path} is invalid",required:"${path} is a required field",defined:"${path} must be defined",notNull:"${path} cannot be null",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:r,type:t,value:e,originalValue:s})=>{const n=s!=null&&s!==e?` (cast from the value \`${we(s,!0)}\`).`:".";return t!=="mixed"?`${r} must be a \`${t}\` type, but the final value was: \`${we(e,!0)}\``+n:`${r} must match the configured type. The validated value was: \`${we(e,!0)}\``+n}},te={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",datetime:"${path} must be a valid ISO date-time",datetime_precision:"${path} must be a valid ISO date-time with a sub-second precision of exactly ${precision} digits",datetime_offset:'${path} must be a valid ISO date-time with UTC "Z" timezone',trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},Fn={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},kt={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},Tt={isValue:"${path} field must be ${value}"},Ze={noUnknown:"${path} field has unspecified keys: ${unknown}",exact:"${path} object contains unknown properties: ${properties}"},Sn={min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must have ${length} items"},En={notType:r=>{const{path:t,value:e,spec:s}=r,n=s.types.length;if(Array.isArray(e)){if(e.length<n)return`${t} tuple value has too few items, expected a length of ${n} but got ${e.length} for value: \`${we(e,!0)}\``;if(e.length>n)return`${t} tuple value has too many items, expected a length of ${n} but got ${e.length} for value: \`${we(e,!0)}\``}return Q.formatError(he.notType,r)}};Object.assign(Object.create(null),{mixed:he,string:te,number:Fn,date:kt,object:Ze,array:Sn,boolean:Tt,tuple:En});const It=r=>r&&r.__isYupSchema__;class tt{static fromOptions(t,e){if(!e.then&&!e.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:s,then:n,otherwise:i}=e,a=typeof s=="function"?s:(...u)=>u.every(d=>d===s);return new tt(t,(u,d)=>{var h;let _=a(...u)?n:i;return(h=_==null?void 0:_(d))!=null?h:d})}constructor(t,e){this.fn=void 0,this.refs=t,this.refs=t,this.fn=e}resolve(t,e){let s=this.refs.map(i=>i.getValue(e==null?void 0:e.value,e==null?void 0:e.parent,e==null?void 0:e.context)),n=this.fn(s,t,e);if(n===void 0||n===t)return t;if(!It(n))throw new TypeError("conditions must return a schema object");return n.resolve(e)}}const qe={context:"$",value:"."};class Oe{constructor(t,e={}){if(this.key=void 0,this.isContext=void 0,this.isValue=void 0,this.isSibling=void 0,this.path=void 0,this.getter=void 0,this.map=void 0,typeof t!="string")throw new TypeError("ref must be a string, got: "+t);if(this.key=t.trim(),t==="")throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===qe.context,this.isValue=this.key[0]===qe.value,this.isSibling=!this.isContext&&!this.isValue;let s=this.isContext?qe.context:this.isValue?qe.value:"";this.path=this.key.slice(s.length),this.getter=this.path&&Te.getter(this.path,!0),this.map=e.map}getValue(t,e,s){let n=this.isContext?s:this.isValue?t:e;return this.getter&&(n=this.getter(n||{})),this.map&&(n=this.map(n)),n}cast(t,e){return this.getValue(t,e==null?void 0:e.parent,e==null?void 0:e.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(t){return t&&t.__isYupRef}}Oe.prototype.__isYupRef=!0;const be=r=>r==null;function Ae(r){function t({value:e,path:s="",options:n,originalValue:i,schema:a},u,d){const{name:h,test:_,params:y,message:v,skipAbsent:w}=r;let{parent:j,context:V,abortEarly:C=a.spec.abortEarly,disableStackTrace:R=a.spec.disableStackTrace}=n;const S={value:e,parent:j,context:V};function Z(z={}){const D=qr(Object.assign({value:e,originalValue:i,label:a.spec.label,path:z.path||s,spec:a.spec,disableStackTrace:z.disableStackTrace||R},y,z.params),S),T=new Q(Q.formatError(z.message||v,D),e,D.path,z.type||h,D.disableStackTrace);return T.params=D,T}const k=C?u:d;let O={path:s,parent:j,type:h,from:n.from,createError:Z,resolve(z){return Hr(z,S)},options:n,originalValue:i,schema:a};const M=z=>{Q.isError(z)?k(z):z?d(null):k(Z())},fe=z=>{Q.isError(z)?k(z):u(z)};if(w&&be(e))return M(!0);let le;try{var ee;if(le=_.call(O,e,O),typeof((ee=le)==null?void 0:ee.then)=="function"){if(n.sync)throw new Error(`Validation test of type: "${O.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);return Promise.resolve(le).then(M,fe)}}catch(z){fe(z);return}M(le)}return t.OPTIONS=r,t}function qr(r,t){if(!r)return r;for(const e of Object.keys(r))r[e]=Hr(r[e],t);return r}function Hr(r,t){return Oe.isRef(r)?r.getValue(t.value,t.parent,t.context):r}function kn(r,t,e,s=e){let n,i,a;return t?(Te.forEach(t,(u,d,h)=>{let _=d?u.slice(1,u.length-1):u;r=r.resolve({context:s,parent:n,value:e});let y=r.type==="tuple",v=h?parseInt(_,10):0;if(r.innerType||y){if(y&&!h)throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${a}" must contain an index to the tuple element, e.g. "${a}[0]"`);if(e&&v>=e.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${u}, in the path: ${t}. because there is no value at that index. `);n=e,e=e&&e[v],r=y?r.spec.types[v]:r.innerType}if(!h){if(!r.fields||!r.fields[_])throw new Error(`The schema does not contain the path: ${t}. (failed at: ${a} which is a type: "${r.type}")`);n=e,e=e&&e[_],r=r.fields[_]}i=_,a=d?"["+u+"]":"."+u}),{schema:r,parent:n,parentPath:i}):{parent:n,parentPath:t,schema:r}}class rt extends Set{describe(){const t=[];for(const e of this.values())t.push(Oe.isRef(e)?e.describe():e);return t}resolveAll(t){let e=[];for(const s of this.values())e.push(t(s));return e}clone(){return new rt(this.values())}merge(t,e){const s=this.clone();return t.forEach(n=>s.add(n)),e.forEach(n=>s.delete(n)),s}}function $e(r,t=new Map){if(It(r)||!r||typeof r!="object")return r;if(t.has(r))return t.get(r);let e;if(r instanceof Date)e=new Date(r.getTime()),t.set(r,e);else if(r instanceof RegExp)e=new RegExp(r),t.set(r,e);else if(Array.isArray(r)){e=new Array(r.length),t.set(r,e);for(let s=0;s<r.length;s++)e[s]=$e(r[s],t)}else if(r instanceof Map){e=new Map,t.set(r,e);for(const[s,n]of r.entries())e.set(s,$e(n,t))}else if(r instanceof Set){e=new Set,t.set(r,e);for(const s of r)e.add($e(s,t))}else if(r instanceof Object){e={},t.set(r,e);for(const[s,n]of Object.entries(r))e[s]=$e(n,t)}else throw Error(`Unable to clone ${r}`);return e}function Tn(r){if(!(r!=null&&r.length))return;const t=[];let e="",s=!1,n=!1;for(let i=0;i<r.length;i++){const a=r[i];if(a==="["&&!n){e&&(t.push(...e.split(".").filter(Boolean)),e=""),s=!0;continue}if(a==="]"&&!n){e&&(/^\d+$/.test(e)?t.push(e):t.push(e.replace(/^"|"$/g,"")),e=""),s=!1;continue}if(a==='"'){n=!n;continue}if(a==="."&&!s&&!n){e&&(t.push(e),e="");continue}e+=a}return e&&t.push(...e.split(".").filter(Boolean)),t}function On(r,t){const e=t?`${t}.${r.path}`:r.path;return r.errors.map(s=>({message:s,path:Tn(e)}))}function Wr(r,t){var e;if(!((e=r.inner)!=null&&e.length)&&r.errors.length)return On(r,t);const s=t?`${t}.${r.path}`:r.path;return r.inner.flatMap(n=>Wr(n,s))}class ae{constructor(t){this.type=void 0,this.deps=[],this.tests=void 0,this.transforms=void 0,this.conditions=[],this._mutate=void 0,this.internalTests={},this._whitelist=new rt,this._blacklist=new rt,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(he.notType)}),this.type=t.type,this._typeCheck=t.check,this.spec=Object.assign({strip:!1,strict:!1,abortEarly:!0,recursive:!0,disableStackTrace:!1,nullable:!1,optional:!0,coerce:!0},t==null?void 0:t.spec),this.withMutation(e=>{e.nonNullable()})}get _type(){return this.type}clone(t){if(this._mutate)return t&&Object.assign(this.spec,t),this;const e=Object.create(Object.getPrototypeOf(this));return e.type=this.type,e._typeCheck=this._typeCheck,e._whitelist=this._whitelist.clone(),e._blacklist=this._blacklist.clone(),e.internalTests=Object.assign({},this.internalTests),e.exclusiveTests=Object.assign({},this.exclusiveTests),e.deps=[...this.deps],e.conditions=[...this.conditions],e.tests=[...this.tests],e.transforms=[...this.transforms],e.spec=$e(Object.assign({},this.spec,t)),e}label(t){let e=this.clone();return e.spec.label=t,e}meta(...t){if(t.length===0)return this.spec.meta;let e=this.clone();return e.spec.meta=Object.assign(e.spec.meta||{},t[0]),e}withMutation(t){let e=this._mutate;this._mutate=!0;let s=t(this);return this._mutate=e,s}concat(t){if(!t||t===this)return this;if(t.type!==this.type&&this.type!=="mixed")throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${t.type}`);let e=this,s=t.clone();const n=Object.assign({},e.spec,s.spec);return s.spec=n,s.internalTests=Object.assign({},e.internalTests,s.internalTests),s._whitelist=e._whitelist.merge(t._whitelist,t._blacklist),s._blacklist=e._blacklist.merge(t._blacklist,t._whitelist),s.tests=e.tests,s.exclusiveTests=e.exclusiveTests,s.withMutation(i=>{t.tests.forEach(a=>{i.test(a.OPTIONS)})}),s.transforms=[...e.transforms,...s.transforms],s}isType(t){return t==null?!!(this.spec.nullable&&t===null||this.spec.optional&&t===void 0):this._typeCheck(t)}resolve(t){let e=this;if(e.conditions.length){let s=e.conditions;e=e.clone(),e.conditions=[],e=s.reduce((n,i)=>i.resolve(n,t),e),e=e.resolve(t)}return e}resolveOptions(t){var e,s,n,i;return Object.assign({},t,{from:t.from||[],strict:(e=t.strict)!=null?e:this.spec.strict,abortEarly:(s=t.abortEarly)!=null?s:this.spec.abortEarly,recursive:(n=t.recursive)!=null?n:this.spec.recursive,disableStackTrace:(i=t.disableStackTrace)!=null?i:this.spec.disableStackTrace})}cast(t,e={}){let s=this.resolve(Object.assign({},e,{value:t})),n=e.assert==="ignore-optionality",i=s._cast(t,e);if(e.assert!==!1&&!s.isType(i)){if(n&&be(i))return i;let a=we(t),u=we(i);throw new TypeError(`The value of ${e.path||"field"} could not be cast to a value that satisfies the schema type: "${s.type}". 

attempted value: ${a} 
`+(u!==a?`result of cast: ${u}`:""))}return i}_cast(t,e){let s=t===void 0?t:this.transforms.reduce((n,i)=>i.call(this,n,t,this,e),t);return s===void 0&&(s=this.getDefault(e)),s}_validate(t,e={},s,n){let{path:i,originalValue:a=t,strict:u=this.spec.strict}=e,d=t;u||(d=this._cast(d,Object.assign({assert:!1},e)));let h=[];for(let _ of Object.values(this.internalTests))_&&h.push(_);this.runTests({path:i,value:d,originalValue:a,options:e,tests:h},s,_=>{if(_.length)return n(_,d);this.runTests({path:i,value:d,originalValue:a,options:e,tests:this.tests},s,n)})}runTests(t,e,s){let n=!1,{tests:i,value:a,originalValue:u,path:d,options:h}=t,_=V=>{n||(n=!0,e(V,a))},y=V=>{n||(n=!0,s(V,a))},v=i.length,w=[];if(!v)return y([]);let j={value:a,originalValue:u,path:d,options:h,schema:this};for(let V=0;V<i.length;V++){const C=i[V];C(j,_,function(S){S&&(Array.isArray(S)?w.push(...S):w.push(S)),--v<=0&&y(w)})}}asNestedTest({key:t,index:e,parent:s,parentPath:n,originalParent:i,options:a}){const u=t??e;if(u==null)throw TypeError("Must include `key` or `index` for nested validations");const d=typeof u=="number";let h=s[u];const _=Object.assign({},a,{strict:!0,parent:s,value:h,originalValue:i[u],key:void 0,[d?"index":"key"]:u,path:d||u.includes(".")?`${n||""}[${d?u:`"${u}"`}]`:(n?`${n}.`:"")+t});return(y,v,w)=>this.resolve(_)._validate(h,_,v,w)}validate(t,e){var s;let n=this.resolve(Object.assign({},e,{value:t})),i=(s=e==null?void 0:e.disableStackTrace)!=null?s:n.spec.disableStackTrace;return new Promise((a,u)=>n._validate(t,e,(d,h)=>{Q.isError(d)&&(d.value=h),u(d)},(d,h)=>{d.length?u(new Q(d,h,void 0,void 0,i)):a(h)}))}validateSync(t,e){var s;let n=this.resolve(Object.assign({},e,{value:t})),i,a=(s=e==null?void 0:e.disableStackTrace)!=null?s:n.spec.disableStackTrace;return n._validate(t,Object.assign({},e,{sync:!0}),(u,d)=>{throw Q.isError(u)&&(u.value=d),u},(u,d)=>{if(u.length)throw new Q(u,t,void 0,void 0,a);i=d}),i}isValid(t,e){return this.validate(t,e).then(()=>!0,s=>{if(Q.isError(s))return!1;throw s})}isValidSync(t,e){try{return this.validateSync(t,e),!0}catch(s){if(Q.isError(s))return!1;throw s}}_getDefault(t){let e=this.spec.default;return e==null?e:typeof e=="function"?e.call(this,t):$e(e)}getDefault(t){return this.resolve(t||{})._getDefault(t)}default(t){return arguments.length===0?this._getDefault():this.clone({default:t})}strict(t=!0){return this.clone({strict:t})}nullability(t,e){const s=this.clone({nullable:t});return s.internalTests.nullable=Ae({message:e,name:"nullable",test(n){return n===null?this.schema.spec.nullable:!0}}),s}optionality(t,e){const s=this.clone({optional:t});return s.internalTests.optionality=Ae({message:e,name:"optionality",test(n){return n===void 0?this.schema.spec.optional:!0}}),s}optional(){return this.optionality(!0)}defined(t=he.defined){return this.optionality(!1,t)}nullable(){return this.nullability(!0)}nonNullable(t=he.notNull){return this.nullability(!1,t)}required(t=he.required){return this.clone().withMutation(e=>e.nonNullable(t).defined(t))}notRequired(){return this.clone().withMutation(t=>t.nullable().optional())}transform(t){let e=this.clone();return e.transforms.push(t),e}test(...t){let e;if(t.length===1?typeof t[0]=="function"?e={test:t[0]}:e=t[0]:t.length===2?e={name:t[0],test:t[1]}:e={name:t[0],message:t[1],test:t[2]},e.message===void 0&&(e.message=he.default),typeof e.test!="function")throw new TypeError("`test` is a required parameters");let s=this.clone(),n=Ae(e),i=e.exclusive||e.name&&s.exclusiveTests[e.name]===!0;if(e.exclusive&&!e.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return e.name&&(s.exclusiveTests[e.name]=!!e.exclusive),s.tests=s.tests.filter(a=>!(a.OPTIONS.name===e.name&&(i||a.OPTIONS.test===n.OPTIONS.test))),s.tests.push(n),s}when(t,e){!Array.isArray(t)&&typeof t!="string"&&(e=t,t=".");let s=this.clone(),n=zr(t).map(i=>new Oe(i));return n.forEach(i=>{i.isSibling&&s.deps.push(i.key)}),s.conditions.push(typeof e=="function"?new tt(n,e):tt.fromOptions(n,e)),s}typeError(t){let e=this.clone();return e.internalTests.typeError=Ae({message:t,name:"typeError",skipAbsent:!0,test(s){return this.schema._typeCheck(s)?!0:this.createError({params:{type:this.schema.type}})}}),e}oneOf(t,e=he.oneOf){let s=this.clone();return t.forEach(n=>{s._whitelist.add(n),s._blacklist.delete(n)}),s.internalTests.whiteList=Ae({message:e,name:"oneOf",skipAbsent:!0,test(n){let i=this.schema._whitelist,a=i.resolveAll(this.resolve);return a.includes(n)?!0:this.createError({params:{values:Array.from(i).join(", "),resolved:a}})}}),s}notOneOf(t,e=he.notOneOf){let s=this.clone();return t.forEach(n=>{s._blacklist.add(n),s._whitelist.delete(n)}),s.internalTests.blacklist=Ae({message:e,name:"notOneOf",test(n){let i=this.schema._blacklist,a=i.resolveAll(this.resolve);return a.includes(n)?this.createError({params:{values:Array.from(i).join(", "),resolved:a}}):!0}}),s}strip(t=!0){let e=this.clone();return e.spec.strip=t,e}describe(t){const e=(t?this.resolve(t):this).clone(),{label:s,meta:n,optional:i,nullable:a}=e.spec;return{meta:n,label:s,optional:i,nullable:a,default:e.getDefault(t),type:e.type,oneOf:e._whitelist.describe(),notOneOf:e._blacklist.describe(),tests:e.tests.filter((d,h,_)=>_.findIndex(y=>y.OPTIONS.name===d.OPTIONS.name)===h).map(d=>{const h=d.OPTIONS.params&&t?qr(Object.assign({},d.OPTIONS.params),t):d.OPTIONS.params;return{name:d.OPTIONS.name,params:h}})}}get"~standard"(){const t=this;return{version:1,vendor:"yup",async validate(s){try{return{value:await t.validate(s,{abortEarly:!1})}}catch(n){if(n instanceof Q)return{issues:Wr(n)};throw n}}}}}ae.prototype.__isYupSchema__=!0;for(const r of["validate","validateSync"])ae.prototype[`${r}At`]=function(t,e,s={}){const{parent:n,parentPath:i,schema:a}=kn(this,t,e,s.context);return a[r](n&&n[i],Object.assign({},s,{parent:n,path:t}))};for(const r of["equals","is"])ae.prototype[r]=ae.prototype.oneOf;for(const r of["not","nope"])ae.prototype[r]=ae.prototype.notOneOf;const Vn=()=>!0;function Zr(r){return new Yr(r)}class Yr extends ae{constructor(t){super(typeof t=="function"?{type:"mixed",check:t}:Object.assign({type:"mixed",check:Vn},t))}}Zr.prototype=Yr.prototype;function Kr(){return new Xr}class Xr extends ae{constructor(){super({type:"boolean",check(t){return t instanceof Boolean&&(t=t.valueOf()),typeof t=="boolean"}}),this.withMutation(()=>{this.transform((t,e)=>{if(this.spec.coerce&&!this.isType(t)){if(/^(true|1)$/i.test(String(t)))return!0;if(/^(false|0)$/i.test(String(t)))return!1}return t})})}isTrue(t=Tt.isValue){return this.test({message:t,name:"is-value",exclusive:!0,params:{value:"true"},test(e){return be(e)||e===!0}})}isFalse(t=Tt.isValue){return this.test({message:t,name:"is-value",exclusive:!0,params:{value:"false"},test(e){return be(e)||e===!1}})}default(t){return super.default(t)}defined(t){return super.defined(t)}optional(){return super.optional()}required(t){return super.required(t)}notRequired(){return super.notRequired()}nullable(){return super.nullable()}nonNullable(t){return super.nonNullable(t)}strip(t){return super.strip(t)}}Kr.prototype=Xr.prototype;const Dn=/^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;function An(r){const t=Ot(r);if(!t)return Date.parse?Date.parse(r):Number.NaN;if(t.z===void 0&&t.plusMinus===void 0)return new Date(t.year,t.month,t.day,t.hour,t.minute,t.second,t.millisecond).valueOf();let e=0;return t.z!=="Z"&&t.plusMinus!==void 0&&(e=t.hourOffset*60+t.minuteOffset,t.plusMinus==="+"&&(e=0-e)),Date.UTC(t.year,t.month,t.day,t.hour,t.minute+e,t.second,t.millisecond)}function Ot(r){var t,e;const s=Dn.exec(r);return s?{year:ye(s[1]),month:ye(s[2],1)-1,day:ye(s[3],1),hour:ye(s[4]),minute:ye(s[5]),second:ye(s[6]),millisecond:s[7]?ye(s[7].substring(0,3)):0,precision:(t=(e=s[7])==null?void 0:e.length)!=null?t:void 0,z:s[8]||void 0,plusMinus:s[9]||void 0,hourOffset:ye(s[10]),minuteOffset:ye(s[11])}:null}function ye(r,t=0){return Number(r)||t}let $n=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,jn=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,Cn=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,Nn="^\\d{4}-\\d{2}-\\d{2}",Rn="\\d{2}:\\d{2}:\\d{2}",Pn="(([+-]\\d{2}(:?\\d{2})?)|Z)",In=new RegExp(`${Nn}T${Rn}(\\.\\d+)?${Pn}$`),Mn=r=>be(r)||r===r.trim(),Un={}.toString();function Ie(){return new Jr}class Jr extends ae{constructor(){super({type:"string",check(t){return t instanceof String&&(t=t.valueOf()),typeof t=="string"}}),this.withMutation(()=>{this.transform((t,e)=>{if(!this.spec.coerce||this.isType(t)||Array.isArray(t))return t;const s=t!=null&&t.toString?t.toString():t;return s===Un?t:s})})}required(t){return super.required(t).withMutation(e=>e.test({message:t||he.required,name:"required",skipAbsent:!0,test:s=>!!s.length}))}notRequired(){return super.notRequired().withMutation(t=>(t.tests=t.tests.filter(e=>e.OPTIONS.name!=="required"),t))}length(t,e=te.length){return this.test({message:e,name:"length",exclusive:!0,params:{length:t},skipAbsent:!0,test(s){return s.length===this.resolve(t)}})}min(t,e=te.min){return this.test({message:e,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(s){return s.length>=this.resolve(t)}})}max(t,e=te.max){return this.test({name:"max",exclusive:!0,message:e,params:{max:t},skipAbsent:!0,test(s){return s.length<=this.resolve(t)}})}matches(t,e){let s=!1,n,i;return e&&(typeof e=="object"?{excludeEmptyString:s=!1,message:n,name:i}=e:n=e),this.test({name:i||"matches",message:n||te.matches,params:{regex:t},skipAbsent:!0,test:a=>a===""&&s||a.search(t)!==-1})}email(t=te.email){return this.matches($n,{name:"email",message:t,excludeEmptyString:!0})}url(t=te.url){return this.matches(jn,{name:"url",message:t,excludeEmptyString:!0})}uuid(t=te.uuid){return this.matches(Cn,{name:"uuid",message:t,excludeEmptyString:!1})}datetime(t){let e="",s,n;return t&&(typeof t=="object"?{message:e="",allowOffset:s=!1,precision:n=void 0}=t:e=t),this.matches(In,{name:"datetime",message:e||te.datetime,excludeEmptyString:!0}).test({name:"datetime_offset",message:e||te.datetime_offset,params:{allowOffset:s},skipAbsent:!0,test:i=>{if(!i||s)return!0;const a=Ot(i);return a?!!a.z:!1}}).test({name:"datetime_precision",message:e||te.datetime_precision,params:{precision:n},skipAbsent:!0,test:i=>{if(!i||n==null)return!0;const a=Ot(i);return a?a.precision===n:!1}})}ensure(){return this.default("").transform(t=>t===null?"":t)}trim(t=te.trim){return this.transform(e=>e!=null?e.trim():e).test({message:t,name:"trim",test:Mn})}lowercase(t=te.lowercase){return this.transform(e=>be(e)?e:e.toLowerCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:e=>be(e)||e===e.toLowerCase()})}uppercase(t=te.uppercase){return this.transform(e=>be(e)?e:e.toUpperCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:e=>be(e)||e===e.toUpperCase()})}}Ie.prototype=Jr.prototype;let zn=new Date(""),Ln=r=>Object.prototype.toString.call(r)==="[object Date]";class Mt extends ae{constructor(){super({type:"date",check(t){return Ln(t)&&!isNaN(t.getTime())}}),this.withMutation(()=>{this.transform((t,e)=>!this.spec.coerce||this.isType(t)||t===null?t:(t=An(t),isNaN(t)?Mt.INVALID_DATE:new Date(t)))})}prepareParam(t,e){let s;if(Oe.isRef(t))s=t;else{let n=this.cast(t);if(!this._typeCheck(n))throw new TypeError(`\`${e}\` must be a Date or a value that can be \`cast()\` to a Date`);s=n}return s}min(t,e=kt.min){let s=this.prepareParam(t,"min");return this.test({message:e,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(n){return n>=this.resolve(s)}})}max(t,e=kt.max){let s=this.prepareParam(t,"max");return this.test({message:e,name:"max",exclusive:!0,params:{max:t},skipAbsent:!0,test(n){return n<=this.resolve(s)}})}}Mt.INVALID_DATE=zn;function Bn(r,t=[]){let e=[],s=new Set,n=new Set(t.map(([a,u])=>`${a}-${u}`));function i(a,u){let d=Te.split(a)[0];s.add(d),n.has(`${u}-${d}`)||e.push([u,d])}for(const a of Object.keys(r)){let u=r[a];s.add(a),Oe.isRef(u)&&u.isSibling?i(u.path,a):It(u)&&"deps"in u&&u.deps.forEach(d=>i(d,a))}return pn.array(Array.from(s),e).reverse()}function gr(r,t){let e=1/0;return r.some((s,n)=>{var i;if((i=t.path)!=null&&i.includes(s))return e=n,!0}),e}function Qr(r){return(t,e)=>gr(r,t)-gr(r,e)}const Gn=(r,t,e)=>{if(typeof r!="string")return r;let s=r;try{s=JSON.parse(r)}catch{}return e.isType(s)?s:r};function Ye(r){if("fields"in r){const t={};for(const[e,s]of Object.entries(r.fields))t[e]=Ye(s);return r.setFields(t)}if(r.type==="array"){const t=r.optional();return t.innerType&&(t.innerType=Ye(t.innerType)),t}return r.type==="tuple"?r.optional().clone({types:r.spec.types.map(Ye)}):"optional"in r?r.optional():r}const qn=(r,t)=>{const e=[...Te.normalizePath(t)];if(e.length===1)return e[0]in r;let s=e.pop(),n=Te.getter(Te.join(e),!0)(r);return!!(n&&s in n)};let br=r=>Object.prototype.toString.call(r)==="[object Object]";function xr(r,t){let e=Object.keys(r.fields);return Object.keys(t).filter(s=>e.indexOf(s)===-1)}const Hn=Qr([]);function es(r){return new ts(r)}class ts extends ae{constructor(t){super({type:"object",check(e){return br(e)||typeof e=="function"}}),this.fields=Object.create(null),this._sortErrors=Hn,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{t&&this.shape(t)})}_cast(t,e={}){var s;let n=super._cast(t,e);if(n===void 0)return this.getDefault(e);if(!this._typeCheck(n))return n;let i=this.fields,a=(s=e.stripUnknown)!=null?s:this.spec.noUnknown,u=[].concat(this._nodes,Object.keys(n).filter(y=>!this._nodes.includes(y))),d={},h=Object.assign({},e,{parent:d,__validating:e.__validating||!1}),_=!1;for(const y of u){let v=i[y],w=y in n,j=n[y];if(v){let V;h.path=(e.path?`${e.path}.`:"")+y,v=v.resolve({value:j,context:e.context,parent:d});let C=v instanceof ae?v.spec:void 0,R=C==null?void 0:C.strict;if(C!=null&&C.strip){_=_||y in n;continue}V=!e.__validating||!R?v.cast(j,h):j,V!==void 0&&(d[y]=V)}else w&&!a&&(d[y]=j);(w!==y in d||d[y]!==j)&&(_=!0)}return _?d:n}_validate(t,e={},s,n){let{from:i=[],originalValue:a=t,recursive:u=this.spec.recursive}=e;e.from=[{schema:this,value:a},...i],e.__validating=!0,e.originalValue=a,super._validate(t,e,s,(d,h)=>{if(!u||!br(h)){n(d,h);return}a=a||h;let _=[];for(let y of this._nodes){let v=this.fields[y];!v||Oe.isRef(v)||_.push(v.asNestedTest({options:e,key:y,parent:h,parentPath:e.path,originalParent:a}))}this.runTests({tests:_,value:h,originalValue:a,options:e},s,y=>{n(y.sort(this._sortErrors).concat(d),h)})})}clone(t){const e=super.clone(t);return e.fields=Object.assign({},this.fields),e._nodes=this._nodes,e._excludedEdges=this._excludedEdges,e._sortErrors=this._sortErrors,e}concat(t){let e=super.concat(t),s=e.fields;for(let[n,i]of Object.entries(this.fields)){const a=s[n];s[n]=a===void 0?i:a}return e.withMutation(n=>n.setFields(s,[...this._excludedEdges,...t._excludedEdges]))}_getDefault(t){if("default"in this.spec)return super._getDefault(t);if(!this._nodes.length)return;let e={};return this._nodes.forEach(s=>{var n;const i=this.fields[s];let a=t;(n=a)!=null&&n.value&&(a=Object.assign({},a,{parent:a.value,value:a.value[s]})),e[s]=i&&"getDefault"in i?i.getDefault(a):void 0}),e}setFields(t,e){let s=this.clone();return s.fields=t,s._nodes=Bn(t,e),s._sortErrors=Qr(Object.keys(t)),e&&(s._excludedEdges=e),s}shape(t,e=[]){return this.clone().withMutation(s=>{let n=s._excludedEdges;return e.length&&(Array.isArray(e[0])||(e=[e]),n=[...s._excludedEdges,...e]),s.setFields(Object.assign(s.fields,t),n)})}partial(){const t={};for(const[e,s]of Object.entries(this.fields))t[e]="optional"in s&&s.optional instanceof Function?s.optional():s;return this.setFields(t)}deepPartial(){return Ye(this)}pick(t){const e={};for(const s of t)this.fields[s]&&(e[s]=this.fields[s]);return this.setFields(e,this._excludedEdges.filter(([s,n])=>t.includes(s)&&t.includes(n)))}omit(t){const e=[];for(const s of Object.keys(this.fields))t.includes(s)||e.push(s);return this.pick(e)}from(t,e,s){let n=Te.getter(t,!0);return this.transform(i=>{if(!i)return i;let a=i;return qn(i,t)&&(a=Object.assign({},i),s||delete a[t],a[e]=n(i)),a})}json(){return this.transform(Gn)}exact(t){return this.test({name:"exact",exclusive:!0,message:t||Ze.exact,test(e){if(e==null)return!0;const s=xr(this.schema,e);return s.length===0||this.createError({params:{properties:s.join(", ")}})}})}stripUnknown(){return this.clone({noUnknown:!0})}noUnknown(t=!0,e=Ze.noUnknown){typeof t!="boolean"&&(e=t,t=!0);let s=this.test({name:"noUnknown",exclusive:!0,message:e,test(n){if(n==null)return!0;const i=xr(this.schema,n);return!t||i.length===0||this.createError({params:{unknown:i.join(", ")}})}});return s.spec.noUnknown=t,s}unknown(t=!0,e=Ze.noUnknown){return this.noUnknown(!t,e)}transformKeys(t){return this.transform(e=>{if(!e)return e;const s={};for(const n of Object.keys(e))s[t(n)]=e[n];return s})}camelCase(){return this.transformKeys(yt.camelCase)}snakeCase(){return this.transformKeys(yt.snakeCase)}constantCase(){return this.transformKeys(t=>yt.snakeCase(t).toUpperCase())}describe(t){const e=(t?this.resolve(t):this).clone(),s=super.describe(t);s.fields={};for(const[i,a]of Object.entries(e.fields)){var n;let u=t;(n=u)!=null&&n.value&&(u=Object.assign({},u,{parent:u.value,value:u.value[i]})),s.fields[i]=a.describe(u)}return s}}es.prototype=ts.prototype;const Wn=es().shape({enable_payments:Kr().required(),payment_window_mode:Zr().oneOf(["new_window","same_page"]).required(),payment_title:Ie().required(),status_awaiting_payment:Ie().required(),status_awaiting_confirmation:Ie().required(),status_confirmed_payment:Ie().required()}),Zn=r=>Zs({resolver:Xs(Wn),defaultValues:r,mode:"onChange"}),Yn=()=>{const{setUser:r}=st(),[t,e]=W.useState(null),[s,{isLoading:n}]=xs(),i=W.useCallback(async(u,d)=>{e(null);try{const h=await s(u).unwrap();return r(_=>({..._,paymentSettings:h})),e({status:"success",message:$("Your settings have been saved successfully.")}),d&&d(),h}catch(h){const _=h&&typeof h=="object"&&"data"in h?String(h.data):null;throw e({status:"error",message:_?$(_):$("Failed to save settings. Please try again.")}),Error("Failed to save payment settings")}},[r,s]),a=W.useCallback(()=>{e(null)},[]);return{isSaving:n,updatePaymentSettings:i,notice:t,hideNotice:a}},Kn="_wrapper_1ezwi_1",Xn="_control_1ezwi_7",Jn="_toggle_1ezwi_14",Qn="_toggleChecked_1ezwi_35",ei="_knob_1ezwi_39",ti="_label_1ezwi_53",ri="_help_1ezwi_59",Se={wrapper:Kn,control:Xn,toggle:Jn,toggleChecked:Qn,knob:ei,label:ti,help:ri},si=({label:r,help:t,checked:e=!1,onChange:s,disabled:n=!1,className:i=""})=>{const a=()=>{n||s==null||s(!e)};return f.jsxs("div",{className:`${Se.wrapper} ${i}`.trim(),children:[f.jsxs("label",{className:Se.control,children:[f.jsx("button",{type:"button",role:"switch","aria-checked":e,className:`${Se.toggle} ${e?Se.toggleChecked:""}`.trim(),onClick:a,disabled:n,children:f.jsx("span",{className:Se.knob})}),r&&f.jsx("span",{className:Se.label,children:r})]}),t&&f.jsx("p",{className:Se.help,children:t})]})},ni="_fieldset_1ra97_1",ii="_legend_1ra97_7",ai="_options_1ra97_14",li="_radio_1ra97_20",ui="_input_1ra97_26",oi="_label_1ra97_66",ci="_labelText_1ra97_77",di="_description_1ra97_84",fi="_help_1ra97_90",ge={fieldset:ni,legend:ii,options:ai,radio:li,input:ui,label:oi,labelText:ci,description:di,help:fi},hi=({label:r,help:t,selected:e,options:s=[],onChange:n,disabled:i=!1,className:a=""})=>f.jsxs("fieldset",{className:`${ge.fieldset} ${a}`.trim(),disabled:i,children:[r&&f.jsx("legend",{className:ge.legend,children:r}),f.jsx("div",{className:ge.options,children:s.map(u=>f.jsxs("div",{className:ge.radio,children:[f.jsx("input",{id:`radio-${u.value}`,className:ge.input,type:"radio",value:u.value,checked:e===u.value,onChange:()=>n==null?void 0:n(u.value),disabled:i}),f.jsxs("label",{htmlFor:`radio-${u.value}`,className:ge.label,children:[f.jsx("span",{className:ge.labelText,children:u.label}),u.description&&f.jsx("span",{className:ge.description,children:u.description})]})]},u.value))}),t&&f.jsx("p",{className:ge.help,children:t})]}),mi="_cardHeaderContent_5z2yc_1",pi="_cardHeaderSubtitle_5z2yc_9",yi="_noticeContent_5z2yc_17",gi="_noticeSpacing_5z2yc_32",bi="_formGroupToggle_5z2yc_36",xi="_formGroupToggleInfo_5z2yc_43",_i="_formGroup_5z2yc_36",vi="_formGroupLabel_5z2yc_59",wi="_formGroupDescription_5z2yc_66",Fi="_statusSelectWrapper_5z2yc_74",Si="_inputField_5z2yc_78",Ei="_disabledSection_5z2yc_101",ki="_disclaimer_5z2yc_106",Ti="_footerWrapper_5z2yc_125",Oi="_saveButton_5z2yc_130",I={cardHeaderContent:mi,cardHeaderSubtitle:pi,noticeContent:yi,noticeSpacing:gi,formGroupToggle:bi,formGroupToggleInfo:xi,formGroup:_i,formGroupLabel:vi,formGroupDescription:wi,statusSelectWrapper:Fi,inputField:Si,disabledSection:Ei,disclaimer:ki,footerWrapper:Ti,saveButton:Oi},rs=W.memo(()=>{const r=nt(),{control:t,watch:e}=lt(),s=e("enable_payments");return f.jsxs(Ue,{gap:r.spacing.xl,direction:"column",children:[f.jsx(ve,{children:f.jsxs(Ke,{children:[f.jsx(Xe,{children:f.jsxs("div",{className:I.cardHeaderContent,children:[f.jsx(_e,{level:"3",children:$("Payment processing")}),f.jsx(de,{as:"p",className:I.cardHeaderSubtitle,children:$("Enable or disable payment processing for your store")})]})}),f.jsx(Je,{children:f.jsxs("div",{className:I.formGroupToggle,children:[f.jsxs("div",{className:I.formGroupToggleInfo,children:[f.jsx(_e,{level:"4",children:$("Enable payments")}),f.jsx(de,{as:"p",className:I.formGroupDescription,children:$("When disabled, Paysera will be hidden from the checkout page and no payments can be processed.")})]}),f.jsx(wt,{name:"enable_payments",control:t,render:({field:n})=>f.jsx(si,{checked:n.value,onChange:n.onChange})})]})})]})}),f.jsx(ve,{children:f.jsx("div",{className:s?"":I.disabledSection,title:s?void 0:$("Enable payments to change display mode."),children:f.jsxs(Ke,{children:[f.jsx(Xe,{children:f.jsxs("div",{className:I.cardHeaderContent,children:[f.jsx(_e,{level:"3",children:$("Payment window mode")}),f.jsx(de,{as:"p",className:I.cardHeaderSubtitle,children:$("Determine how the payment page will be displayed when a customer proceeds to payment.")})]})}),f.jsx(Je,{children:f.jsx(wt,{name:"payment_window_mode",control:t,render:({field:n})=>f.jsx(hi,{selected:n.value,onChange:n.onChange,disabled:!s,options:[{label:$("New tab"),description:$("The payment page opens in a new browser tab. After payment, customers are automatically returned to your store."),value:bt.SAME_PAGE},{label:$("Pop-up window"),description:$("The payment page opens in a pop-up window with the selected payment method, while your store stays open in the background."),value:bt.NEW_WINDOW}]})})})]})})})]})});rs.displayName="MainSettingsTab";const Vi="_wrapper_12xml_1",Di="_label_12xml_7",Ai="_select_12xml_13",$i="_help_12xml_37",He={wrapper:Vi,label:Di,select:Ai,help:$i},ji=({label:r=null,options:t=[],value:e,onChange:s,className:n="",disabled:i=!1,help:a,multiple:u=!1})=>f.jsxs("div",{className:`${He.wrapper} ${n}`.trim(),children:[r&&f.jsx("label",{className:He.label,children:r}),f.jsx("select",{className:He.select,value:e,onChange:d=>s==null?void 0:s(d.target.value),disabled:i,multiple:u,children:t.map(d=>f.jsx("option",{value:d.value,children:d.label},d.value))}),a&&f.jsx("p",{className:He.help,children:a})]}),Ci=()=>{const r=payseraData.orderStatuses||{};return Object.keys(r).map(t=>({label:r[t],value:t}))},ss=W.memo(({value:r,onChange:t,disabled:e=!1})=>{const s=Ci();return f.jsx(ji,{options:s,value:r,onChange:t,disabled:e})});ss.displayName="OrderStatusSelect";const Ni=[{key:"status_awaiting_payment",label:"Awaiting Paysera payment",description:"Order status for pending payment"},{key:"status_awaiting_confirmation",label:"Awaiting Paysera Confirmation",description:"Order status after finishing checkout"},{key:"status_confirmed_payment",label:"Paysera confirmed payment",description:"Order status for confirmed payment"}],ns=W.memo(()=>{const r=nt(),{watch:t,setValue:e}=lt(),[s,n]=W.useState(!0);return f.jsxs(Ue,{gap:r.spacing.xl,direction:"column",children:[s&&f.jsx(ve,{children:f.jsx(vr,{status:"warning",className:"paysera-custom-notice",onDismiss:()=>n(!1),children:f.jsxs("div",{className:I.noticeContent,children:[f.jsx(_e,{level:"3",children:$("About status mapping")}),f.jsx("div",{className:I.noticeSpacing,children:f.jsx(de,{as:"p",children:$("Order status mapping allows you to define how payment status changes in Paysera affect order statuses in your store. This ensures your order management system stays synchronized with payment processing.")})})]})})}),f.jsx(ve,{children:f.jsxs(Ke,{children:[f.jsx(Xe,{children:f.jsxs("div",{className:I.cardHeaderContent,children:[f.jsx(_e,{level:"3",children:$("Order status mapping")}),f.jsx(de,{as:"p",className:I.cardHeaderSubtitle,children:$("Define how Paysera payment statuses map to your store order statuses")})]})}),f.jsx(Je,{children:f.jsx(Ue,{gap:r.spacing.lg,direction:"column",children:Ni.map(({key:i,label:a,description:u})=>f.jsx(ve,{children:f.jsxs("div",{className:I.formGroup,children:[f.jsx(de,{as:"p",className:I.formGroupLabel,children:$(a)}),f.jsx(de,{as:"p",className:I.formGroupDescription,children:$(u)}),f.jsx("div",{className:I.statusSelectWrapper,children:f.jsx(ss,{value:t(i),onChange:d=>e(i,d,{shouldDirty:!0,shouldValidate:!0})})})]})},i))})})]})})]})});ns.displayName="OrderStatusTab";const is=W.memo(()=>{const r=nt(),{control:t,formState:{errors:e}}=lt();return f.jsxs(Ke,{children:[f.jsx(Xe,{children:f.jsxs("div",{className:I.cardHeaderContent,children:[f.jsx(_e,{level:"3",children:$("Customer checkout experience")}),f.jsx(de,{as:"p",className:I.cardHeaderSubtitle,children:$("Customise how payments appear to your customers")})]})}),f.jsx(Je,{children:f.jsx(Ue,{gap:r.spacing.lg,direction:"column",children:f.jsx(ve,{children:f.jsxs("div",{className:I.formGroup,children:[f.jsx(de,{as:"p",className:I.formGroupDescription,children:$("This title will be displayed on the checkout page")}),f.jsx(wt,{name:"payment_title",control:t,render:({field:s})=>{var n;return f.jsx(Ts,{className:I.inputField,placeholder:$("Payment title"),value:s.value,onChange:i=>s.onChange(i),error:(n=e.payment_title)==null?void 0:n.message})}})]})})})})]})});is.displayName="DisplaySettingsTab";const gt=[{name:"main_settings",title:$("Main settings"),children:f.jsx(rs,{})},{name:"order_status",title:$("Order status"),children:f.jsx(ns,{})},{name:"display_settings",title:$("Display settings"),children:f.jsx(is,{})}],Ri=()=>f.jsxs("div",{className:I.disclaimer,children:[f.jsx(_e,{level:"4",children:$("Authorisation required")}),f.jsx(de,{as:"p",children:$("Please connect your Paysera account to access this feature.")})]}),as=W.memo(()=>{const{user:r}=st(),t=gt.map(n=>n.name),{selectedTab:e,setSelectedTab:s}=Ds({tabs:t,defaultTab:gt[0].name,syncWithHash:!0});return f.jsx(Os,{tabs:gt,initialTabName:e,onSelect:s,disabled:!r.authorized,disabledDisclaimer:f.jsx(Ri,{})})});as.displayName="Tabs";const ls=W.memo(({isSaving:r=!1,isDisabled:t=!1})=>f.jsx("div",{className:I.footerWrapper,children:f.jsx(Vs,{type:"submit",variant:"primary",isBusy:r,disabled:t,className:I.saveButton,children:r?f.jsx(ks,{}):$("Save changes")})}));ls.displayName="SaveSettingsFooter";const us=W.memo(()=>{const{user:r}=st(),t=nt(),{handleSubmit:e,reset:s,formState:{isDirty:n}}=lt(),{isSaving:i,updatePaymentSettings:a,notice:u,hideNotice:d}=Yn(),h=W.useRef(!1);W.useEffect(()=>{h.current&&s(r.paymentSettings)},[s,r.paymentSettings]);const _=W.useCallback(async y=>{try{await a(y,()=>{h.current=!0})}catch{s(r.paymentSettings)}},[a,s,r.paymentSettings]);return f.jsxs(_s,{className:"paysera-payment-settings-page",children:[f.jsx(vs,{title:$("Payment Settings"),subtitle:$("Configure how payments are processed in your store")}),u&&f.jsx(vr,{className:"paysera-custom-notice",status:u.status,onDismiss:d,children:f.jsxs("div",{className:I.noticeContent,children:[f.jsx(_e,{level:"3",children:u.status==="success"?$("Settings saved"):$("Settings error")}),f.jsx("div",{className:I.noticeSpacing,children:f.jsx(de,{as:"p",children:u.message})})]})}),f.jsx("form",{onSubmit:e(_),children:f.jsxs(Ue,{gap:t.spacing.xl,direction:"column",children:[f.jsx(ve,{children:f.jsx(as,{})}),f.jsx(ve,{children:f.jsx(ls,{isSaving:i,isDisabled:!r.authorized||!n})})]})})]})});us.displayName="PageContent";const Pi=()=>{const{user:r}=st(),t=Zn(r.paymentSettings);return f.jsx(Cs,{...t,children:f.jsx(us,{})})},os=W.memo(Pi);os.displayName="PaymentSettingsPage";const _r=document.getElementById("paysera-react-root");_r&&ws(_r).render(f.jsx(Fs,{children:f.jsx(Ss,{children:f.jsx(os,{})})}));
