brauz-questionnaire-ui 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,107 @@
1
+ (function(T,j){typeof exports=="object"&&typeof module<"u"?module.exports=j(require("react/jsx-runtime"),require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["react/jsx-runtime","react","react-dom"],j):(T=typeof globalThis<"u"?globalThis:T||self,T["brauz-questionnaire-ui"]=j(T["react/jsx-runtime"],T.React,T.reactDOM))})(this,(function(T,j,Pu){"use strict";function Nu(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const b=Nu(j),ms=Nu(Pu),qv={with_section_title:!0,with_label:!0,form_config:{},renderFooter:null},Iu=j.createContext();function Kv({children:e,config:t={}}){return T.jsx(Iu.Provider,{value:{...qv,...t},children:e})}function ia(){return j.useContext(Iu)}function Fu(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Or(...e){return t=>{let n=!1;const r=e.map(o=>{const s=Fu(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():Fu(e[o],null)}}}}function Ve(...e){return b.useCallback(Or(...e),e)}var Xv=Symbol.for("react.lazy"),gs=b[" use ".trim().toString()];function Jv(e){return typeof e=="object"&&e!==null&&"then"in e}function Ru(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===Xv&&"_payload"in e&&Jv(e._payload)}function Wu(e){const t=Qv(e),n=b.forwardRef((r,o)=>{let{children:s,...i}=r;Ru(s)&&typeof gs=="function"&&(s=gs(s._payload));const a=b.Children.toArray(s),c=a.find(tb);if(c){const u=c.props.children,l=a.map(f=>f===c?b.Children.count(u)>1?b.Children.only(null):b.isValidElement(u)?u.props.children:null:f);return T.jsx(t,{...i,ref:o,children:b.isValidElement(u)?b.cloneElement(u,void 0,l):null})}return T.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}var zu=Wu("Slot");function Qv(e){const t=b.forwardRef((n,r)=>{let{children:o,...s}=n;if(Ru(o)&&typeof gs=="function"&&(o=gs(o._payload)),b.isValidElement(o)){const i=rb(o),a=nb(s,o.props);return o.type!==b.Fragment&&(a.ref=r?Or(r,i):i),b.cloneElement(o,a)}return b.Children.count(o)>1?b.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var eb=Symbol("radix.slottable");function tb(e){return b.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===eb}function nb(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{const c=s(...a);return o(...a),c}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function rb(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Co=e=>e.type==="checkbox",Er=e=>e instanceof Date,$t=e=>e==null;const Lu=e=>typeof e=="object";var yt=e=>!$t(e)&&!Array.isArray(e)&&Lu(e)&&!Er(e),$u=e=>yt(e)&&e.target?Co(e.target)?e.target.checked:e.target.value:e,ob=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,Uu=(e,t)=>e.has(ob(t)),sb=e=>{const t=e.constructor&&e.constructor.prototype;return yt(t)&&t.hasOwnProperty("isPrototypeOf")},aa=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function vt(e){if(e instanceof Date)return new Date(e);const t=typeof FileList<"u"&&e instanceof FileList;if(aa&&(e instanceof Blob||t))return e;const n=Array.isArray(e);if(!n&&!(yt(e)&&sb(e)))return e;const r=n?[]:Object.create(Object.getPrototypeOf(e));for(const o in e)Object.prototype.hasOwnProperty.call(e,o)&&(r[o]=vt(e[o]));return r}var ys=e=>/^\w*$/.test(e),st=e=>e===void 0,ca=e=>Array.isArray(e)?e.filter(Boolean):[],la=e=>ca(e.replace(/["|']|\]/g,"").split(/\.|\[/)),ae=(e,t,n)=>{if(!t||!yt(e))return n;const r=(ys(t)?[t]:la(t)).reduce((o,s)=>$t(o)?o:o[s],e);return st(r)||r===e?st(e[t])?n:e[t]:r},Bt=e=>typeof e=="boolean",It=e=>typeof e=="function",Be=(e,t,n)=>{let r=-1;const o=ys(t)?[t]:la(t),s=o.length,i=s-1;for(;++r<s;){const a=o[r];let c=n;if(r!==i){const u=e[a];c=yt(u)||Array.isArray(u)?u:isNaN(+o[r+1])?{}:[]}if(a==="__proto__"||a==="constructor"||a==="prototype")return;e[a]=c,e=e[a]}};const vs={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},cn={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Ln={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},ua=j.createContext(null);ua.displayName="HookFormControlContext";const fa=()=>j.useContext(ua);var Yu=(e,t,n,r=!0)=>{const o={defaultValues:t._defaultValues};for(const s in e)Object.defineProperty(o,s,{get:()=>{const i=s;return t._proxyFormState[i]!==cn.all&&(t._proxyFormState[i]=!r||cn.all),n&&(n[i]=!0),e[i]}});return o};const da=typeof window<"u"?j.useLayoutEffect:j.useEffect;function ju(e){const t=fa(),{control:n=t,disabled:r,name:o,exact:s}=e||{},[i,a]=j.useState(n._formState),c=j.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return da(()=>n._subscribe({name:o,formState:c.current,exact:s,callback:u=>{!r&&a({...n._formState,...u})}}),[o,r,s]),j.useEffect(()=>{c.current.isValid&&n._setValid(!0)},[n]),j.useMemo(()=>Yu(i,n,c.current,!1),[i,n])}var Ht=e=>typeof e=="string",ha=(e,t,n,r,o)=>Ht(e)?(r&&t.watch.add(e),ae(n,e,o)):Array.isArray(e)?e.map(s=>(r&&t.watch.add(s),ae(n,s))):(r&&(t.watchAll=!0),n),pa=e=>$t(e)||!Lu(e);function ln(e,t,n=new WeakSet){if(pa(e)||pa(t))return Object.is(e,t);if(Er(e)&&Er(t))return Object.is(e.getTime(),t.getTime());const r=Object.keys(e),o=Object.keys(t);if(r.length!==o.length)return!1;if(n.has(e)||n.has(t))return!0;n.add(e),n.add(t);for(const s of r){const i=e[s];if(!o.includes(s))return!1;if(s!=="ref"){const a=t[s];if(Er(i)&&Er(a)||yt(i)&&yt(a)||Array.isArray(i)&&Array.isArray(a)?!ln(i,a,n):!Object.is(i,a))return!1}}return!0}function ib(e){const t=fa(),{control:n=t,name:r,defaultValue:o,disabled:s,exact:i,compute:a}=e||{},c=j.useRef(o),u=j.useRef(a),l=j.useRef(void 0),f=j.useRef(n),d=j.useRef(r);u.current=a;const[h,m]=j.useState(()=>{const w=n._getWatch(r,c.current);return u.current?u.current(w):w}),p=j.useCallback(w=>{const _=ha(r,n._names,w||n._formValues,!1,c.current);return u.current?u.current(_):_},[n._formValues,n._names,r]),y=j.useCallback(w=>{if(!s){const _=ha(r,n._names,w||n._formValues,!1,c.current);if(u.current){const S=u.current(_);ln(S,l.current)||(m(S),l.current=S)}else m(_)}},[n._formValues,n._names,s,r]);da(()=>((f.current!==n||!ln(d.current,r))&&(f.current=n,d.current=r,y()),n._subscribe({name:r,formState:{values:!0},exact:i,callback:w=>{y(w.values)}})),[n,i,r,y]),j.useEffect(()=>n._removeUnmounted());const g=f.current!==n,C=d.current,O=j.useMemo(()=>{if(s)return null;const w=!g&&!ln(C,r);return g||w?p():null},[s,g,r,C,p]);return O!==null?O:h}function ab(e){const t=fa(),{name:n,disabled:r,control:o=t,shouldUnregister:s,defaultValue:i,exact:a=!0}=e,c=Uu(o._names.array,n),u=j.useMemo(()=>ae(o._formValues,n,ae(o._defaultValues,n,i)),[o,n,i]),l=ib({control:o,name:n,defaultValue:u,exact:a}),f=ju({control:o,name:n,exact:a}),d=j.useRef(e),h=j.useRef(void 0),m=j.useRef(o.register(n,{...e.rules,value:l,...Bt(e.disabled)?{disabled:e.disabled}:{}}));d.current=e;const p=j.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!ae(f.errors,n)},isDirty:{enumerable:!0,get:()=>!!ae(f.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!ae(f.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!ae(f.validatingFields,n)},error:{enumerable:!0,get:()=>ae(f.errors,n)}}),[f,n]),y=j.useCallback(w=>m.current.onChange({target:{value:$u(w),name:n},type:vs.CHANGE}),[n]),g=j.useCallback(()=>m.current.onBlur({target:{value:ae(o._formValues,n),name:n},type:vs.BLUR}),[n,o._formValues]),C=j.useCallback(w=>{const _=ae(o._fields,n);_&&_._f&&w&&(_._f.ref={focus:()=>It(w.focus)&&w.focus(),select:()=>It(w.select)&&w.select(),setCustomValidity:S=>It(w.setCustomValidity)&&w.setCustomValidity(S),reportValidity:()=>It(w.reportValidity)&&w.reportValidity()})},[o._fields,n]),O=j.useMemo(()=>({name:n,value:l,...Bt(r)||f.disabled?{disabled:f.disabled||r}:{},onChange:y,onBlur:g,ref:C}),[n,r,f.disabled,y,g,C,l]);return j.useEffect(()=>{const w=o._options.shouldUnregister||s,_=h.current;_&&_!==n&&!c&&o.unregister(_),o.register(n,{...d.current.rules,...Bt(d.current.disabled)?{disabled:d.current.disabled}:{}});const S=(I,v)=>{const x=ae(o._fields,I);x&&x._f&&(x._f.mount=v)};if(S(n,!0),w){const I=vt(ae(o._options.defaultValues,n,d.current.defaultValue));Be(o._defaultValues,n,I),st(ae(o._formValues,n))&&Be(o._formValues,n,I)}return!c&&o.register(n),h.current=n,()=>{(c?w&&!o._state.action:w)?o.unregister(n):S(n,!1)}},[n,o,c,s]),j.useEffect(()=>{o._setDisabledField({disabled:r,name:n})},[r,n,o]),j.useMemo(()=>({field:O,formState:f,fieldState:p}),[O,f,p])}const cb=e=>e.render(ab(e)),ma=j.createContext(null);ma.displayName="HookFormContext";const lb=()=>j.useContext(ma),ub=e=>{const{children:t,watch:n,getValues:r,getFieldState:o,setError:s,clearErrors:i,setValue:a,trigger:c,formState:u,resetField:l,reset:f,handleSubmit:d,unregister:h,control:m,register:p,setFocus:y,subscribe:g}=e;return j.createElement(ma.Provider,{value:j.useMemo(()=>({watch:n,getValues:r,getFieldState:o,setError:s,clearErrors:i,setValue:a,trigger:c,formState:u,resetField:l,reset:f,handleSubmit:d,unregister:h,control:m,register:p,setFocus:y,subscribe:g}),[i,m,u,o,r,d,p,f,l,s,y,a,g,c,h,n])},j.createElement(ua.Provider,{value:m},t))};var ga=(e,t,n,r,o)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:o||!0}}:{},To=e=>Array.isArray(e)?e:[e],Vu=()=>{let e=[];return{get observers(){return e},next:o=>{for(const s of e)s.next&&s.next(o)},subscribe:o=>(e.push(o),{unsubscribe:()=>{e=e.filter(s=>s!==o)}}),unsubscribe:()=>{e=[]}}};function Bu(e,t){const n={};for(const r in e)if(e.hasOwnProperty(r)){const o=e[r],s=t[r];if(o&&yt(o)&&s){const i=Bu(o,s);yt(i)&&(n[r]=i)}else e[r]&&(n[r]=s)}return n}var Ft=e=>yt(e)&&!Object.keys(e).length,ya=e=>e.type==="file",bs=e=>{if(!aa)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Hu=e=>e.type==="select-multiple",va=e=>e.type==="radio",fb=e=>va(e)||Co(e),ba=e=>bs(e)&&e.isConnected;function db(e,t){const n=t.slice(0,-1).length;let r=0;for(;r<n;)e=st(e)?r++:e[t[r++]];return e}function hb(e){for(const t in e)if(e.hasOwnProperty(t)&&!st(e[t]))return!1;return!0}function bt(e,t){const n=Array.isArray(t)?t:ys(t)?[t]:la(t),r=n.length===1?e:db(e,n),o=n.length-1,s=n[o];return r&&delete r[s],o!==0&&(yt(r)&&Ft(r)||Array.isArray(r)&&hb(r))&&bt(e,n.slice(0,-1)),e}var pb=e=>{for(const t in e)if(It(e[t]))return!0;return!1};function Zu(e){return Array.isArray(e)||yt(e)&&!pb(e)}function wa(e,t={}){for(const n in e){const r=e[n];Zu(r)?(t[n]=Array.isArray(r)?[]:{},wa(r,t[n])):st(r)||(t[n]=!0)}return t}function Hr(e,t,n){n||(n=wa(t));for(const r in e){const o=e[r];if(Zu(o))st(t)||pa(n[r])?n[r]=wa(o,Array.isArray(o)?[]:{}):Hr(o,$t(t)?{}:t[r],n[r]);else{const s=t[r];n[r]=!ln(o,s)}}return n}const Gu={value:!1,isValid:!1},qu={value:!0,isValid:!0};var Ku=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!st(e[0].attributes.value)?st(e[0].value)||e[0].value===""?qu:{value:e[0].value,isValid:!0}:qu:Gu}return Gu},Xu=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>st(e)?e:t?e===""?NaN:e&&+e:n&&Ht(e)?new Date(e):r?r(e):e;const Ju={isValid:!1,value:null};var Qu=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,Ju):Ju;function ef(e){const t=e.ref;return ya(t)?t.files:va(t)?Qu(e.refs).value:Hu(t)?[...t.selectedOptions].map(({value:n})=>n):Co(t)?Ku(e.refs).value:Xu(st(t.value)?e.ref.value:t.value,e)}var mb=(e,t,n,r)=>{const o={};for(const s of e){const i=ae(t,s);i&&Be(o,s,i._f)}return{criteriaMode:n,names:[...e],fields:o,shouldUseNativeValidation:r}},ws=e=>e instanceof RegExp,Do=e=>st(e)?e:ws(e)?e.source:yt(e)?ws(e.value)?e.value.source:e.value:e,tf=e=>({isOnSubmit:!e||e===cn.onSubmit,isOnBlur:e===cn.onBlur,isOnChange:e===cn.onChange,isOnAll:e===cn.all,isOnTouch:e===cn.onTouched});const nf="AsyncFunction";var gb=e=>!!e&&!!e.validate&&!!(It(e.validate)&&e.validate.constructor.name===nf||yt(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===nf)),yb=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),rf=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const Ao=(e,t,n,r)=>{for(const o of n||Object.keys(e)){const s=ae(e,o);if(s){const{_f:i,...a}=s;if(i){if(i.refs&&i.refs[0]&&t(i.refs[0],o)&&!r)return!0;if(i.ref&&t(i.ref,i.name)&&!r)return!0;if(Ao(a,t))break}else if(yt(a)&&Ao(a,t))break}}};function of(e,t,n){const r=ae(e,n);if(r||ys(n))return{error:r,name:n};const o=n.split(".");for(;o.length;){const s=o.join("."),i=ae(t,s),a=ae(e,s);if(i&&!Array.isArray(i)&&n!==s)return{name:n};if(a&&a.type)return{name:s,error:a};if(a&&a.root&&a.root.type)return{name:`${s}.root`,error:a.root};o.pop()}return{name:n}}var vb=(e,t,n,r)=>{n(e);const{name:o,...s}=e;return Ft(s)||Object.keys(s).length>=Object.keys(t).length||Object.keys(s).find(i=>t[i]===(!r||cn.all))},bb=(e,t,n)=>!e||!t||e===t||To(e).some(r=>r&&(n?r===t:r.startsWith(t)||t.startsWith(r))),wb=(e,t,n,r,o)=>o.isOnAll?!1:!n&&o.isOnTouch?!(t||e):(n?r.isOnBlur:o.isOnBlur)?!e:(n?r.isOnChange:o.isOnChange)?e:!0,_b=(e,t)=>!ca(ae(e,t)).length&&bt(e,t),Sb=(e,t,n)=>{const r=To(ae(e,n));return Be(r,"root",t[n]),Be(e,n,r),e};function sf(e,t,n="validate"){if(Ht(e)||Array.isArray(e)&&e.every(Ht)||Bt(e)&&!e)return{type:n,message:Ht(e)?e:"",ref:t}}var Zr=e=>yt(e)&&!ws(e)?e:{value:e,message:""},af=async(e,t,n,r,o,s)=>{const{ref:i,refs:a,required:c,maxLength:u,minLength:l,min:f,max:d,pattern:h,validate:m,name:p,valueAsNumber:y,mount:g}=e._f,C=ae(n,p);if(!g||t.has(p))return{};const O=a?a[0]:i,w=M=>{o&&O.reportValidity&&(O.setCustomValidity(Bt(M)?"":M||""),O.reportValidity())},_={},S=va(i),I=Co(i),v=S||I,x=(y||ya(i))&&st(i.value)&&st(C)||bs(i)&&i.value===""||C===""||Array.isArray(C)&&!C.length,P=ga.bind(null,p,r,_),A=(M,F,N,W=Ln.maxLength,E=Ln.minLength)=>{const k=M?F:N;_[p]={type:M?W:E,message:k,ref:i,...P(M?W:E,k)}};if(s?!Array.isArray(C)||!C.length:c&&(!v&&(x||$t(C))||Bt(C)&&!C||I&&!Ku(a).isValid||S&&!Qu(a).isValid)){const{value:M,message:F}=Ht(c)?{value:!!c,message:c}:Zr(c);if(M&&(_[p]={type:Ln.required,message:F,ref:O,...P(Ln.required,F)},!r))return w(F),_}if(!x&&(!$t(f)||!$t(d))){let M,F;const N=Zr(d),W=Zr(f);if(!$t(C)&&!isNaN(C)){const E=i.valueAsNumber||C&&+C;$t(N.value)||(M=E>N.value),$t(W.value)||(F=E<W.value)}else{const E=i.valueAsDate||new Date(C),k=D=>new Date(new Date().toDateString()+" "+D),U=i.type=="time",$=i.type=="week";Ht(N.value)&&C&&(M=U?k(C)>k(N.value):$?C>N.value:E>new Date(N.value)),Ht(W.value)&&C&&(F=U?k(C)<k(W.value):$?C<W.value:E<new Date(W.value))}if((M||F)&&(A(!!M,N.message,W.message,Ln.max,Ln.min),!r))return w(_[p].message),_}if((u||l)&&!x&&(Ht(C)||s&&Array.isArray(C))){const M=Zr(u),F=Zr(l),N=!$t(M.value)&&C.length>+M.value,W=!$t(F.value)&&C.length<+F.value;if((N||W)&&(A(N,M.message,F.message),!r))return w(_[p].message),_}if(h&&!x&&Ht(C)){const{value:M,message:F}=Zr(h);if(ws(M)&&!C.match(M)&&(_[p]={type:Ln.pattern,message:F,ref:i,...P(Ln.pattern,F)},!r))return w(F),_}if(m){if(It(m)){const M=await m(C,n),F=sf(M,O);if(F&&(_[p]={...F,...P(Ln.validate,F.message)},!r))return w(F.message),_}else if(yt(m)){let M={};for(const F in m){if(!Ft(M)&&!r)break;const N=sf(await m[F](C,n),O,F);N&&(M={...N,...P(F,N.message)},w(N.message),r&&(_[p]=M))}if(!Ft(M)&&(_[p]={ref:O,...M},!r))return _}}return w(!0),_};const kb={mode:cn.onSubmit,reValidateMode:cn.onChange,shouldFocusError:!0};function xb(e={}){let t={...kb,...e},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:It(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},r={},o=yt(t.defaultValues)||yt(t.values)?vt(t.defaultValues||t.values)||{}:{},s=t.shouldUnregister?{}:vt(o),i={action:!1,mount:!1,watch:!1,keepIsValid:!1},a={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},c,u=0;const l={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},f={...l};let d={...f};const h={array:Vu(),state:Vu()},m=t.criteriaMode===cn.all,p=R=>Y=>{clearTimeout(u),u=setTimeout(R,Y)},y=async R=>{if(!i.keepIsValid&&!t.disabled&&(f.isValid||d.isValid||R)){let Y;t.resolver?(Y=Ft((await v()).errors),g()):Y=await P(r,!0),Y!==n.isValid&&h.state.next({isValid:Y})}},g=(R,Y)=>{!t.disabled&&(f.isValidating||f.validatingFields||d.isValidating||d.validatingFields)&&((R||Array.from(a.mount)).forEach(H=>{H&&(Y?Be(n.validatingFields,H,Y):bt(n.validatingFields,H))}),h.state.next({validatingFields:n.validatingFields,isValidating:!Ft(n.validatingFields)}))},C=(R,Y=[],H,ee,te=!0,ne=!0)=>{if(ee&&H&&!t.disabled){if(i.action=!0,ne&&Array.isArray(ae(r,R))){const ue=H(ae(r,R),ee.argA,ee.argB);te&&Be(r,R,ue)}if(ne&&Array.isArray(ae(n.errors,R))){const ue=H(ae(n.errors,R),ee.argA,ee.argB);te&&Be(n.errors,R,ue),_b(n.errors,R)}if((f.touchedFields||d.touchedFields)&&ne&&Array.isArray(ae(n.touchedFields,R))){const ue=H(ae(n.touchedFields,R),ee.argA,ee.argB);te&&Be(n.touchedFields,R,ue)}(f.dirtyFields||d.dirtyFields)&&(n.dirtyFields=Hr(o,s)),h.state.next({name:R,isDirty:M(R,Y),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else Be(s,R,Y)},O=(R,Y)=>{Be(n.errors,R,Y),h.state.next({errors:n.errors})},w=R=>{n.errors=R,h.state.next({errors:n.errors,isValid:!1})},_=(R,Y,H,ee)=>{const te=ae(r,R);if(te){const ne=ae(s,R,st(H)?ae(o,R):H);st(ne)||ee&&ee.defaultChecked||Y?Be(s,R,Y?ne:ef(te._f)):W(R,ne),i.mount&&!i.action&&y()}},S=(R,Y,H,ee,te)=>{let ne=!1,ue=!1;const be={name:R};if(!t.disabled){if(!H||ee){(f.isDirty||d.isDirty)&&(ue=n.isDirty,n.isDirty=be.isDirty=M(),ne=ue!==be.isDirty);const Oe=ln(ae(o,R),Y);ue=!!ae(n.dirtyFields,R),Oe?bt(n.dirtyFields,R):Be(n.dirtyFields,R,!0),be.dirtyFields=n.dirtyFields,ne=ne||(f.dirtyFields||d.dirtyFields)&&ue!==!Oe}if(H){const Oe=ae(n.touchedFields,R);Oe||(Be(n.touchedFields,R,H),be.touchedFields=n.touchedFields,ne=ne||(f.touchedFields||d.touchedFields)&&Oe!==H)}ne&&te&&h.state.next(be)}return ne?be:{}},I=(R,Y,H,ee)=>{const te=ae(n.errors,R),ne=(f.isValid||d.isValid)&&Bt(Y)&&n.isValid!==Y;if(t.delayError&&H?(c=p(()=>O(R,H)),c(t.delayError)):(clearTimeout(u),c=null,H?Be(n.errors,R,H):bt(n.errors,R)),(H?!ln(te,H):te)||!Ft(ee)||ne){const ue={...ee,...ne&&Bt(Y)?{isValid:Y}:{},errors:n.errors,name:R};n={...n,...ue},h.state.next(ue)}},v=async R=>(g(R,!0),await t.resolver(s,t.context,mb(R||a.mount,r,t.criteriaMode,t.shouldUseNativeValidation))),x=async R=>{const{errors:Y}=await v(R);if(g(R),R)for(const H of R){const ee=ae(Y,H);ee?Be(n.errors,H,ee):bt(n.errors,H)}else n.errors=Y;return Y},P=async(R,Y,H={valid:!0})=>{for(const ee in R){const te=R[ee];if(te){const{_f:ne,...ue}=te;if(ne){const be=a.array.has(ne.name),Oe=te._f&&gb(te._f);Oe&&f.validatingFields&&g([ne.name],!0);const ze=await af(te,a.disabled,s,m,t.shouldUseNativeValidation&&!Y,be);if(Oe&&f.validatingFields&&g([ne.name]),ze[ne.name]&&(H.valid=!1,Y||e.shouldUseNativeValidation))break;!Y&&(ae(ze,ne.name)?be?Sb(n.errors,ze,ne.name):Be(n.errors,ne.name,ze[ne.name]):bt(n.errors,ne.name))}!Ft(ue)&&await P(ue,Y,H)}}return H.valid},A=()=>{for(const R of a.unMount){const Y=ae(r,R);Y&&(Y._f.refs?Y._f.refs.every(H=>!ba(H)):!ba(Y._f.ref))&&oe(R)}a.unMount=new Set},M=(R,Y)=>!t.disabled&&(R&&Y&&Be(s,R,Y),!ln(V(),o)),F=(R,Y,H)=>ha(R,a,{...i.mount?s:st(Y)?o:Ht(R)?{[R]:Y}:Y},H,Y),N=R=>ca(ae(i.mount?s:o,R,t.shouldUnregister?ae(o,R,[]):[])),W=(R,Y,H={})=>{const ee=ae(r,R);let te=Y;if(ee){const ne=ee._f;ne&&(!ne.disabled&&Be(s,R,Xu(Y,ne)),te=bs(ne.ref)&&$t(Y)?"":Y,Hu(ne.ref)?[...ne.ref.options].forEach(ue=>ue.selected=te.includes(ue.value)):ne.refs?Co(ne.ref)?ne.refs.forEach(ue=>{(!ue.defaultChecked||!ue.disabled)&&(Array.isArray(te)?ue.checked=!!te.find(be=>be===ue.value):ue.checked=te===ue.value||!!te)}):ne.refs.forEach(ue=>ue.checked=ue.value===te):ya(ne.ref)?ne.ref.value="":(ne.ref.value=te,ne.ref.type||h.state.next({name:R,values:vt(s)})))}(H.shouldDirty||H.shouldTouch)&&S(R,te,H.shouldTouch,H.shouldDirty,!0),H.shouldValidate&&D(R)},E=(R,Y,H)=>{for(const ee in Y){if(!Y.hasOwnProperty(ee))return;const te=Y[ee],ne=R+"."+ee,ue=ae(r,ne);(a.array.has(R)||yt(te)||ue&&!ue._f)&&!Er(te)?E(ne,te,H):W(ne,te,H)}},k=(R,Y,H={})=>{const ee=ae(r,R),te=a.array.has(R),ne=vt(Y);Be(s,R,ne),te?(h.array.next({name:R,values:vt(s)}),(f.isDirty||f.dirtyFields||d.isDirty||d.dirtyFields)&&H.shouldDirty&&h.state.next({name:R,dirtyFields:Hr(o,s),isDirty:M(R,ne)})):ee&&!ee._f&&!$t(ne)?E(R,ne,H):W(R,ne,H),rf(R,a)?h.state.next({...n,name:R,values:vt(s)}):h.state.next({name:i.mount?R:void 0,values:vt(s)})},U=async R=>{i.mount=!0;const Y=R.target;let H=Y.name,ee=!0;const te=ae(r,H),ne=Oe=>{ee=Number.isNaN(Oe)||Er(Oe)&&isNaN(Oe.getTime())||ln(Oe,ae(s,H,Oe))},ue=tf(t.mode),be=tf(t.reValidateMode);if(te){let Oe,ze;const ot=Y.type?ef(te._f):$u(R),Qe=R.type===vs.BLUR||R.type===vs.FOCUS_OUT,xt=!yb(te._f)&&!t.resolver&&!ae(n.errors,H)&&!te._f.deps||wb(Qe,ae(n.touchedFields,H),n.isSubmitted,be,ue),gt=rf(H,a,Qe);Be(s,H,ot),Qe?(!Y||!Y.readOnly)&&(te._f.onBlur&&te._f.onBlur(R),c&&c(0)):te._f.onChange&&te._f.onChange(R);const dt=S(H,ot,Qe),jt=!Ft(dt)||gt;if(!Qe&&h.state.next({name:H,type:R.type,values:vt(s)}),xt)return(f.isValid||d.isValid)&&(t.mode==="onBlur"?Qe&&y():Qe||y()),jt&&h.state.next({name:H,...gt?{}:dt});if(!Qe&&gt&&h.state.next({...n}),t.resolver){const{errors:Sn}=await v([H]);if(g([H]),ne(ot),ee){const kn=of(n.errors,r,H),_e=of(Sn,r,kn.name||H);Oe=_e.error,H=_e.name,ze=Ft(Sn)}}else g([H],!0),Oe=(await af(te,a.disabled,s,m,t.shouldUseNativeValidation))[H],g([H]),ne(ot),ee&&(Oe?ze=!1:(f.isValid||d.isValid)&&(ze=await P(r,!0)));ee&&(te._f.deps&&(!Array.isArray(te._f.deps)||te._f.deps.length>0)&&D(te._f.deps),I(H,ze,Oe,dt))}},$=(R,Y)=>{if(ae(n.errors,Y)&&R.focus)return R.focus(),1},D=async(R,Y={})=>{let H,ee;const te=To(R);if(t.resolver){const ne=await x(st(R)?R:te);H=Ft(ne),ee=R?!te.some(ue=>ae(ne,ue)):H}else R?(ee=(await Promise.all(te.map(async ne=>{const ue=ae(r,ne);return await P(ue&&ue._f?{[ne]:ue}:ue)}))).every(Boolean),!(!ee&&!n.isValid)&&y()):ee=H=await P(r);return h.state.next({...!Ht(R)||(f.isValid||d.isValid)&&H!==n.isValid?{}:{name:R},...t.resolver||!R?{isValid:H}:{},errors:n.errors}),Y.shouldFocus&&!ee&&Ao(r,$,R?te:a.mount),ee},V=(R,Y)=>{let H={...i.mount?s:o};return Y&&(H=Bu(Y.dirtyFields?n.dirtyFields:n.touchedFields,H)),st(R)?H:Ht(R)?ae(H,R):R.map(ee=>ae(H,ee))},Z=(R,Y)=>({invalid:!!ae((Y||n).errors,R),isDirty:!!ae((Y||n).dirtyFields,R),error:ae((Y||n).errors,R),isValidating:!!ae(n.validatingFields,R),isTouched:!!ae((Y||n).touchedFields,R)}),G=R=>{R&&To(R).forEach(Y=>bt(n.errors,Y)),h.state.next({errors:R?n.errors:{}})},B=(R,Y,H)=>{const ee=(ae(r,R,{_f:{}})._f||{}).ref,te=ae(n.errors,R)||{},{ref:ne,message:ue,type:be,...Oe}=te;Be(n.errors,R,{...Oe,...Y,ref:ee}),h.state.next({name:R,errors:n.errors,isValid:!1}),H&&H.shouldFocus&&ee&&ee.focus&&ee.focus()},z=(R,Y)=>It(R)?h.state.subscribe({next:H=>"values"in H&&R(F(void 0,Y),H)}):F(R,Y,!0),X=R=>h.state.subscribe({next:Y=>{bb(R.name,Y.name,R.exact)&&vb(Y,R.formState||f,We,R.reRenderRoot)&&R.callback({values:{...s},...n,...Y,defaultValues:o})}}).unsubscribe,q=R=>(i.mount=!0,d={...d,...R.formState},X({...R,formState:{...l,...R.formState}})),oe=(R,Y={})=>{for(const H of R?To(R):a.mount)a.mount.delete(H),a.array.delete(H),Y.keepValue||(bt(r,H),bt(s,H)),!Y.keepError&&bt(n.errors,H),!Y.keepDirty&&bt(n.dirtyFields,H),!Y.keepTouched&&bt(n.touchedFields,H),!Y.keepIsValidating&&bt(n.validatingFields,H),!t.shouldUnregister&&!Y.keepDefaultValue&&bt(o,H);h.state.next({values:vt(s)}),h.state.next({...n,...Y.keepDirty?{isDirty:M()}:{}}),!Y.keepIsValid&&y()},Q=({disabled:R,name:Y})=>{if(Bt(R)&&i.mount||R||a.disabled.has(Y)){const te=a.disabled.has(Y)!==!!R;R?a.disabled.add(Y):a.disabled.delete(Y),te&&i.mount&&!i.action&&y()}},re=(R,Y={})=>{let H=ae(r,R);const ee=Bt(Y.disabled)||Bt(t.disabled);return Be(r,R,{...H||{},_f:{...H&&H._f?H._f:{ref:{name:R}},name:R,mount:!0,...Y}}),a.mount.add(R),H?Q({disabled:Bt(Y.disabled)?Y.disabled:t.disabled,name:R}):_(R,!0,Y.value),{...ee?{disabled:Y.disabled||t.disabled}:{},...t.progressive?{required:!!Y.required,min:Do(Y.min),max:Do(Y.max),minLength:Do(Y.minLength),maxLength:Do(Y.maxLength),pattern:Do(Y.pattern)}:{},name:R,onChange:U,onBlur:U,ref:te=>{if(te){re(R,Y),H=ae(r,R);const ne=st(te.value)&&te.querySelectorAll&&te.querySelectorAll("input,select,textarea")[0]||te,ue=fb(ne),be=H._f.refs||[];if(ue?be.find(Oe=>Oe===ne):ne===H._f.ref)return;Be(r,R,{_f:{...H._f,...ue?{refs:[...be.filter(ba),ne,...Array.isArray(ae(o,R))?[{}]:[]],ref:{type:ne.type,name:R}}:{ref:ne}}}),_(R,!1,void 0,ne)}else H=ae(r,R,{}),H._f&&(H._f.mount=!1),(t.shouldUnregister||Y.shouldUnregister)&&!(Uu(a.array,R)&&i.action)&&a.unMount.add(R)}}},le=()=>t.shouldFocusError&&Ao(r,$,a.mount),K=R=>{Bt(R)&&(h.state.next({disabled:R}),Ao(r,(Y,H)=>{const ee=ae(r,H);ee&&(Y.disabled=ee._f.disabled||R,Array.isArray(ee._f.refs)&&ee._f.refs.forEach(te=>{te.disabled=ee._f.disabled||R}))},0,!1))},Se=(R,Y)=>async H=>{let ee;H&&(H.preventDefault&&H.preventDefault(),H.persist&&H.persist());let te=vt(s);if(h.state.next({isSubmitting:!0}),t.resolver){const{errors:ne,values:ue}=await v();g(),n.errors=ne,te=vt(ue)}else await P(r);if(a.disabled.size)for(const ne of a.disabled)bt(te,ne);if(bt(n.errors,"root"),Ft(n.errors)){h.state.next({errors:{}});try{await R(te,H)}catch(ne){ee=ne}}else Y&&await Y({...n.errors},H),le(),setTimeout(le);if(h.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Ft(n.errors)&&!ee,submitCount:n.submitCount+1,errors:n.errors}),ee)throw ee},Ie=(R,Y={})=>{ae(r,R)&&(st(Y.defaultValue)?k(R,vt(ae(o,R))):(k(R,Y.defaultValue),Be(o,R,vt(Y.defaultValue))),Y.keepTouched||bt(n.touchedFields,R),Y.keepDirty||(bt(n.dirtyFields,R),n.isDirty=Y.defaultValue?M(R,vt(ae(o,R))):M()),Y.keepError||(bt(n.errors,R),f.isValid&&y()),h.state.next({...n}))},ke=(R,Y={})=>{const H=R?vt(R):o,ee=vt(H),te=Ft(R),ne=te?o:ee;if(Y.keepDefaultValues||(o=H),!Y.keepValues){if(Y.keepDirtyValues){const ue=new Set([...a.mount,...Object.keys(Hr(o,s))]);for(const be of Array.from(ue)){const Oe=ae(n.dirtyFields,be),ze=ae(s,be),ot=ae(ne,be);Oe&&!st(ze)?Be(ne,be,ze):!Oe&&!st(ot)&&k(be,ot)}}else{if(aa&&st(R))for(const ue of a.mount){const be=ae(r,ue);if(be&&be._f){const Oe=Array.isArray(be._f.refs)?be._f.refs[0]:be._f.ref;if(bs(Oe)){const ze=Oe.closest("form");if(ze){ze.reset();break}}}}if(Y.keepFieldsRef)for(const ue of a.mount)k(ue,ae(ne,ue));else r={}}s=t.shouldUnregister?Y.keepDefaultValues?vt(o):{}:vt(ne),h.array.next({values:{...ne}}),h.state.next({values:{...ne}})}a={mount:Y.keepDirtyValues?a.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},i.mount=!f.isValid||!!Y.keepIsValid||!!Y.keepDirtyValues||!t.shouldUnregister&&!Ft(ne),i.watch=!!t.shouldUnregister,i.keepIsValid=!!Y.keepIsValid,i.action=!1,Y.keepErrors||(n.errors={}),h.state.next({submitCount:Y.keepSubmitCount?n.submitCount:0,isDirty:te?!1:Y.keepDirty?n.isDirty:!!(Y.keepDefaultValues&&!ln(R,o)),isSubmitted:Y.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:te?{}:Y.keepDirtyValues?Y.keepDefaultValues&&s?Hr(o,s):n.dirtyFields:Y.keepDefaultValues&&R?Hr(o,R):Y.keepDirty?n.dirtyFields:{},touchedFields:Y.keepTouched?n.touchedFields:{},errors:Y.keepErrors?n.errors:{},isSubmitSuccessful:Y.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:o})},Ge=(R,Y)=>ke(It(R)?R(s):R,{...t.resetOptions,...Y}),Re=(R,Y={})=>{const H=ae(r,R),ee=H&&H._f;if(ee){const te=ee.refs?ee.refs[0]:ee.ref;te.focus&&setTimeout(()=>{te.focus(),Y.shouldSelect&&It(te.select)&&te.select()})}},We=R=>{n={...n,...R}},rt={control:{register:re,unregister:oe,getFieldState:Z,handleSubmit:Se,setError:B,_subscribe:X,_runSchema:v,_updateIsValidating:g,_focusError:le,_getWatch:F,_getDirty:M,_setValid:y,_setFieldArray:C,_setDisabledField:Q,_setErrors:w,_getFieldArray:N,_reset:ke,_resetDefaultValues:()=>It(t.defaultValues)&&t.defaultValues().then(R=>{Ge(R,t.resetOptions),h.state.next({isLoading:!1})}),_removeUnmounted:A,_disableForm:K,_subjects:h,_proxyFormState:f,get _fields(){return r},get _formValues(){return s},get _state(){return i},set _state(R){i=R},get _defaultValues(){return o},get _names(){return a},set _names(R){a=R},get _formState(){return n},get _options(){return t},set _options(R){t={...t,...R}}},subscribe:q,trigger:D,register:re,handleSubmit:Se,watch:z,setValue:k,getValues:V,reset:Ge,resetField:Ie,clearErrors:G,unregister:oe,setError:B,setFocus:Re,getFieldState:Z};return{...rt,formControl:rt}}function Ob(e={}){const t=j.useRef(void 0),n=j.useRef(void 0),[r,o]=j.useState({isDirty:!1,isValidating:!1,isLoading:It(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:It(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:r},e.defaultValues&&!It(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:i,...a}=xb(e);t.current={...a,formState:r}}const s=t.current.control;return s._options=e,da(()=>{const i=s._subscribe({formState:s._proxyFormState,callback:()=>o({...s._formState}),reRenderRoot:!0});return o(a=>({...a,isReady:!0})),s._formState.isReady=!0,i},[s]),j.useEffect(()=>s._disableForm(e.disabled),[s,e.disabled]),j.useEffect(()=>{e.mode&&(s._options.mode=e.mode),e.reValidateMode&&(s._options.reValidateMode=e.reValidateMode)},[s,e.mode,e.reValidateMode]),j.useEffect(()=>{e.errors&&(s._setErrors(e.errors),s._focusError())},[s,e.errors]),j.useEffect(()=>{e.shouldUnregister&&s._subjects.state.next({values:s._getWatch()})},[s,e.shouldUnregister]),j.useEffect(()=>{if(s._proxyFormState.isDirty){const i=s._getDirty();i!==r.isDirty&&s._subjects.state.next({isDirty:i})}},[s,r.isDirty]),j.useEffect(()=>{var i;e.values&&!ln(e.values,n.current)?(s._reset(e.values,{keepFieldsRef:!0,...s._options.resetOptions}),!((i=s._options.resetOptions)===null||i===void 0)&&i.keepIsValid||s._setValid(),n.current=e.values,o(a=>({...a}))):s._resetDefaultValues()},[s,e.values]),j.useEffect(()=>{s._state.mount||(s._setValid(),s._state.mount=!0),s._state.watch&&(s._state.watch=!1,s._subjects.state.next({...s._formState})),s._removeUnmounted()}),t.current.formState=j.useMemo(()=>Yu(r,s),[s,r]),t.current}function cf(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=cf(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function _s(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=cf(e))&&(r&&(r+=" "),r+=t);return r}const Eb=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},Cb=(e,t)=>({classGroupId:e,validator:t}),lf=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Ss="-",uf=[],Tb="arbitrary..",Db=e=>{const t=Mb(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return Ab(i);const a=i.split(Ss),c=a[0]===""&&a.length>1?1:0;return ff(a,c,t)},getConflictingClassGroupIds:(i,a)=>{if(a){const c=r[i],u=n[i];return c?u?Eb(u,c):c:u||uf}return n[i]||uf}}},ff=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const o=e[t],s=n.nextPart.get(o);if(s){const u=ff(e,t+1,s);if(u)return u}const i=n.validators;if(i===null)return;const a=t===0?e.join(Ss):e.slice(t).join(Ss),c=i.length;for(let u=0;u<c;u++){const l=i[u];if(l.validator(a))return l.classGroupId}},Ab=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?Tb+r:void 0})(),Mb=e=>{const{theme:t,classGroups:n}=e;return Pb(n,t)},Pb=(e,t)=>{const n=lf();for(const r in e){const o=e[r];_a(o,n,r,t)}return n},_a=(e,t,n,r)=>{const o=e.length;for(let s=0;s<o;s++){const i=e[s];Nb(i,t,n,r)}},Nb=(e,t,n,r)=>{if(typeof e=="string"){Ib(e,t,n);return}if(typeof e=="function"){Fb(e,t,n,r);return}Rb(e,t,n,r)},Ib=(e,t,n)=>{const r=e===""?t:df(t,e);r.classGroupId=n},Fb=(e,t,n,r)=>{if(Wb(e)){_a(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Cb(n,e))},Rb=(e,t,n,r)=>{const o=Object.entries(e),s=o.length;for(let i=0;i<s;i++){const[a,c]=o[i];_a(c,df(t,a),n,r)}},df=(e,t)=>{let n=e;const r=t.split(Ss),o=r.length;for(let s=0;s<o;s++){const i=r[s];let a=n.nextPart.get(i);a||(a=lf(),n.nextPart.set(i,a)),n=a}return n},Wb=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,zb=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const o=(s,i)=>{n[s]=i,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(s){let i=n[s];if(i!==void 0)return i;if((i=r[s])!==void 0)return o(s,i),i},set(s,i){s in n?n[s]=i:o(s,i)}}},Sa="!",hf=":",Lb=[],pf=(e,t,n,r,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:o}),$b=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=o=>{const s=[];let i=0,a=0,c=0,u;const l=o.length;for(let p=0;p<l;p++){const y=o[p];if(i===0&&a===0){if(y===hf){s.push(o.slice(c,p)),c=p+1;continue}if(y==="/"){u=p;continue}}y==="["?i++:y==="]"?i--:y==="("?a++:y===")"&&a--}const f=s.length===0?o:o.slice(c);let d=f,h=!1;f.endsWith(Sa)?(d=f.slice(0,-1),h=!0):f.startsWith(Sa)&&(d=f.slice(1),h=!0);const m=u&&u>c?u-c:void 0;return pf(s,h,d,m)};if(t){const o=t+hf,s=r;r=i=>i.startsWith(o)?s(i.slice(o.length)):pf(Lb,!1,i,void 0,!0)}if(n){const o=r;r=s=>n({className:s,parseClassName:o})}return r},Ub=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let o=[];for(let s=0;s<n.length;s++){const i=n[s],a=i[0]==="[",c=t.has(i);a||c?(o.length>0&&(o.sort(),r.push(...o),o=[]),r.push(i)):o.push(i)}return o.length>0&&(o.sort(),r.push(...o)),r}},Yb=e=>({cache:zb(e.cacheSize),parseClassName:$b(e),sortModifiers:Ub(e),...Db(e)}),jb=/\s+/,Vb=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:s}=t,i=[],a=e.trim().split(jb);let c="";for(let u=a.length-1;u>=0;u-=1){const l=a[u],{isExternal:f,modifiers:d,hasImportantModifier:h,baseClassName:m,maybePostfixModifierPosition:p}=n(l);if(f){c=l+(c.length>0?" "+c:c);continue}let y=!!p,g=r(y?m.substring(0,p):m);if(!g){if(!y){c=l+(c.length>0?" "+c:c);continue}if(g=r(m),!g){c=l+(c.length>0?" "+c:c);continue}y=!1}const C=d.length===0?"":d.length===1?d[0]:s(d).join(":"),O=h?C+Sa:C,w=O+g;if(i.indexOf(w)>-1)continue;i.push(w);const _=o(g,y);for(let S=0;S<_.length;++S){const I=_[S];i.push(O+I)}c=l+(c.length>0?" "+c:c)}return c},Bb=(...e)=>{let t=0,n,r,o="";for(;t<e.length;)(n=e[t++])&&(r=mf(n))&&(o&&(o+=" "),o+=r);return o},mf=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=mf(e[r]))&&(n&&(n+=" "),n+=t);return n},Hb=(e,...t)=>{let n,r,o,s;const i=c=>{const u=t.reduce((l,f)=>f(l),e());return n=Yb(u),r=n.cache.get,o=n.cache.set,s=a,a(c)},a=c=>{const u=r(c);if(u)return u;const l=Vb(c,n);return o(c,l),l};return s=i,(...c)=>s(Bb(...c))},Zb=[],St=e=>{const t=n=>n[e]||Zb;return t.isThemeGetter=!0,t},gf=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,yf=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Gb=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,qb=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Kb=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Xb=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Jb=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Qb=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,or=e=>Gb.test(e),Me=e=>!!e&&!Number.isNaN(Number(e)),sr=e=>!!e&&Number.isInteger(Number(e)),ka=e=>e.endsWith("%")&&Me(e.slice(0,-1)),$n=e=>qb.test(e),vf=()=>!0,ew=e=>Kb.test(e)&&!Xb.test(e),xa=()=>!1,tw=e=>Jb.test(e),nw=e=>Qb.test(e),rw=e=>!de(e)&&!he(e),ow=e=>ir(e,xf,xa),de=e=>gf.test(e),Cr=e=>ir(e,Of,ew),bf=e=>ir(e,dw,Me),sw=e=>ir(e,Cf,vf),iw=e=>ir(e,Ef,xa),wf=e=>ir(e,Sf,xa),aw=e=>ir(e,kf,nw),ks=e=>ir(e,Tf,tw),he=e=>yf.test(e),Mo=e=>Tr(e,Of),cw=e=>Tr(e,Ef),_f=e=>Tr(e,Sf),lw=e=>Tr(e,xf),uw=e=>Tr(e,kf),xs=e=>Tr(e,Tf,!0),fw=e=>Tr(e,Cf,!0),ir=(e,t,n)=>{const r=gf.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Tr=(e,t,n=!1)=>{const r=yf.exec(e);return r?r[1]?t(r[1]):n:!1},Sf=e=>e==="position"||e==="percentage",kf=e=>e==="image"||e==="url",xf=e=>e==="length"||e==="size"||e==="bg-size",Of=e=>e==="length",dw=e=>e==="number",Ef=e=>e==="family-name",Cf=e=>e==="number"||e==="weight",Tf=e=>e==="shadow",Oa=Hb(()=>{const e=St("color"),t=St("font"),n=St("text"),r=St("font-weight"),o=St("tracking"),s=St("leading"),i=St("breakpoint"),a=St("container"),c=St("spacing"),u=St("radius"),l=St("shadow"),f=St("inset-shadow"),d=St("text-shadow"),h=St("drop-shadow"),m=St("blur"),p=St("perspective"),y=St("aspect"),g=St("ease"),C=St("animate"),O=()=>["auto","avoid","all","avoid-page","page","left","right","column"],w=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],_=()=>[...w(),he,de],S=()=>["auto","hidden","clip","visible","scroll"],I=()=>["auto","contain","none"],v=()=>[he,de,c],x=()=>[or,"full","auto",...v()],P=()=>[sr,"none","subgrid",he,de],A=()=>["auto",{span:["full",sr,he,de]},sr,he,de],M=()=>[sr,"auto",he,de],F=()=>["auto","min","max","fr",he,de],N=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],W=()=>["start","end","center","stretch","center-safe","end-safe"],E=()=>["auto",...v()],k=()=>[or,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...v()],U=()=>[or,"screen","full","dvw","lvw","svw","min","max","fit",...v()],$=()=>[or,"screen","full","lh","dvh","lvh","svh","min","max","fit",...v()],D=()=>[e,he,de],V=()=>[...w(),_f,wf,{position:[he,de]}],Z=()=>["no-repeat",{repeat:["","x","y","space","round"]}],G=()=>["auto","cover","contain",lw,ow,{size:[he,de]}],B=()=>[ka,Mo,Cr],z=()=>["","none","full",u,he,de],X=()=>["",Me,Mo,Cr],q=()=>["solid","dashed","dotted","double"],oe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Q=()=>[Me,ka,_f,wf],re=()=>["","none",m,he,de],le=()=>["none",Me,he,de],K=()=>["none",Me,he,de],Se=()=>[Me,he,de],Ie=()=>[or,"full",...v()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[$n],breakpoint:[$n],color:[vf],container:[$n],"drop-shadow":[$n],ease:["in","out","in-out"],font:[rw],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[$n],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[$n],shadow:[$n],spacing:["px",Me],text:[$n],"text-shadow":[$n],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",or,de,he,y]}],container:["container"],columns:[{columns:[Me,de,he,a]}],"break-after":[{"break-after":O()}],"break-before":[{"break-before":O()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:_()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:I()}],"overscroll-x":[{"overscroll-x":I()}],"overscroll-y":[{"overscroll-y":I()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:x()}],"inset-x":[{"inset-x":x()}],"inset-y":[{"inset-y":x()}],start:[{"inset-s":x(),start:x()}],end:[{"inset-e":x(),end:x()}],"inset-bs":[{"inset-bs":x()}],"inset-be":[{"inset-be":x()}],top:[{top:x()}],right:[{right:x()}],bottom:[{bottom:x()}],left:[{left:x()}],visibility:["visible","invisible","collapse"],z:[{z:[sr,"auto",he,de]}],basis:[{basis:[or,"full","auto",a,...v()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Me,or,"auto","initial","none",de]}],grow:[{grow:["",Me,he,de]}],shrink:[{shrink:["",Me,he,de]}],order:[{order:[sr,"first","last","none",he,de]}],"grid-cols":[{"grid-cols":P()}],"col-start-end":[{col:A()}],"col-start":[{"col-start":M()}],"col-end":[{"col-end":M()}],"grid-rows":[{"grid-rows":P()}],"row-start-end":[{row:A()}],"row-start":[{"row-start":M()}],"row-end":[{"row-end":M()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":F()}],"auto-rows":[{"auto-rows":F()}],gap:[{gap:v()}],"gap-x":[{"gap-x":v()}],"gap-y":[{"gap-y":v()}],"justify-content":[{justify:[...N(),"normal"]}],"justify-items":[{"justify-items":[...W(),"normal"]}],"justify-self":[{"justify-self":["auto",...W()]}],"align-content":[{content:["normal",...N()]}],"align-items":[{items:[...W(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...W(),{baseline:["","last"]}]}],"place-content":[{"place-content":N()}],"place-items":[{"place-items":[...W(),"baseline"]}],"place-self":[{"place-self":["auto",...W()]}],p:[{p:v()}],px:[{px:v()}],py:[{py:v()}],ps:[{ps:v()}],pe:[{pe:v()}],pbs:[{pbs:v()}],pbe:[{pbe:v()}],pt:[{pt:v()}],pr:[{pr:v()}],pb:[{pb:v()}],pl:[{pl:v()}],m:[{m:E()}],mx:[{mx:E()}],my:[{my:E()}],ms:[{ms:E()}],me:[{me:E()}],mbs:[{mbs:E()}],mbe:[{mbe:E()}],mt:[{mt:E()}],mr:[{mr:E()}],mb:[{mb:E()}],ml:[{ml:E()}],"space-x":[{"space-x":v()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":v()}],"space-y-reverse":["space-y-reverse"],size:[{size:k()}],"inline-size":[{inline:["auto",...U()]}],"min-inline-size":[{"min-inline":["auto",...U()]}],"max-inline-size":[{"max-inline":["none",...U()]}],"block-size":[{block:["auto",...$()]}],"min-block-size":[{"min-block":["auto",...$()]}],"max-block-size":[{"max-block":["none",...$()]}],w:[{w:[a,"screen",...k()]}],"min-w":[{"min-w":[a,"screen","none",...k()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[i]},...k()]}],h:[{h:["screen","lh",...k()]}],"min-h":[{"min-h":["screen","lh","none",...k()]}],"max-h":[{"max-h":["screen","lh",...k()]}],"font-size":[{text:["base",n,Mo,Cr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,fw,sw]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",ka,de]}],"font-family":[{font:[cw,iw,t]}],"font-features":[{"font-features":[de]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,he,de]}],"line-clamp":[{"line-clamp":[Me,"none",he,bf]}],leading:[{leading:[s,...v()]}],"list-image":[{"list-image":["none",he,de]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",he,de]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:D()}],"text-color":[{text:D()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...q(),"wavy"]}],"text-decoration-thickness":[{decoration:[Me,"from-font","auto",he,Cr]}],"text-decoration-color":[{decoration:D()}],"underline-offset":[{"underline-offset":[Me,"auto",he,de]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:v()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",he,de]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",he,de]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:V()}],"bg-repeat":[{bg:Z()}],"bg-size":[{bg:G()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},sr,he,de],radial:["",he,de],conic:[sr,he,de]},uw,aw]}],"bg-color":[{bg:D()}],"gradient-from-pos":[{from:B()}],"gradient-via-pos":[{via:B()}],"gradient-to-pos":[{to:B()}],"gradient-from":[{from:D()}],"gradient-via":[{via:D()}],"gradient-to":[{to:D()}],rounded:[{rounded:z()}],"rounded-s":[{"rounded-s":z()}],"rounded-e":[{"rounded-e":z()}],"rounded-t":[{"rounded-t":z()}],"rounded-r":[{"rounded-r":z()}],"rounded-b":[{"rounded-b":z()}],"rounded-l":[{"rounded-l":z()}],"rounded-ss":[{"rounded-ss":z()}],"rounded-se":[{"rounded-se":z()}],"rounded-ee":[{"rounded-ee":z()}],"rounded-es":[{"rounded-es":z()}],"rounded-tl":[{"rounded-tl":z()}],"rounded-tr":[{"rounded-tr":z()}],"rounded-br":[{"rounded-br":z()}],"rounded-bl":[{"rounded-bl":z()}],"border-w":[{border:X()}],"border-w-x":[{"border-x":X()}],"border-w-y":[{"border-y":X()}],"border-w-s":[{"border-s":X()}],"border-w-e":[{"border-e":X()}],"border-w-bs":[{"border-bs":X()}],"border-w-be":[{"border-be":X()}],"border-w-t":[{"border-t":X()}],"border-w-r":[{"border-r":X()}],"border-w-b":[{"border-b":X()}],"border-w-l":[{"border-l":X()}],"divide-x":[{"divide-x":X()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":X()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...q(),"hidden","none"]}],"divide-style":[{divide:[...q(),"hidden","none"]}],"border-color":[{border:D()}],"border-color-x":[{"border-x":D()}],"border-color-y":[{"border-y":D()}],"border-color-s":[{"border-s":D()}],"border-color-e":[{"border-e":D()}],"border-color-bs":[{"border-bs":D()}],"border-color-be":[{"border-be":D()}],"border-color-t":[{"border-t":D()}],"border-color-r":[{"border-r":D()}],"border-color-b":[{"border-b":D()}],"border-color-l":[{"border-l":D()}],"divide-color":[{divide:D()}],"outline-style":[{outline:[...q(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Me,he,de]}],"outline-w":[{outline:["",Me,Mo,Cr]}],"outline-color":[{outline:D()}],shadow:[{shadow:["","none",l,xs,ks]}],"shadow-color":[{shadow:D()}],"inset-shadow":[{"inset-shadow":["none",f,xs,ks]}],"inset-shadow-color":[{"inset-shadow":D()}],"ring-w":[{ring:X()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:D()}],"ring-offset-w":[{"ring-offset":[Me,Cr]}],"ring-offset-color":[{"ring-offset":D()}],"inset-ring-w":[{"inset-ring":X()}],"inset-ring-color":[{"inset-ring":D()}],"text-shadow":[{"text-shadow":["none",d,xs,ks]}],"text-shadow-color":[{"text-shadow":D()}],opacity:[{opacity:[Me,he,de]}],"mix-blend":[{"mix-blend":[...oe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":oe()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Me]}],"mask-image-linear-from-pos":[{"mask-linear-from":Q()}],"mask-image-linear-to-pos":[{"mask-linear-to":Q()}],"mask-image-linear-from-color":[{"mask-linear-from":D()}],"mask-image-linear-to-color":[{"mask-linear-to":D()}],"mask-image-t-from-pos":[{"mask-t-from":Q()}],"mask-image-t-to-pos":[{"mask-t-to":Q()}],"mask-image-t-from-color":[{"mask-t-from":D()}],"mask-image-t-to-color":[{"mask-t-to":D()}],"mask-image-r-from-pos":[{"mask-r-from":Q()}],"mask-image-r-to-pos":[{"mask-r-to":Q()}],"mask-image-r-from-color":[{"mask-r-from":D()}],"mask-image-r-to-color":[{"mask-r-to":D()}],"mask-image-b-from-pos":[{"mask-b-from":Q()}],"mask-image-b-to-pos":[{"mask-b-to":Q()}],"mask-image-b-from-color":[{"mask-b-from":D()}],"mask-image-b-to-color":[{"mask-b-to":D()}],"mask-image-l-from-pos":[{"mask-l-from":Q()}],"mask-image-l-to-pos":[{"mask-l-to":Q()}],"mask-image-l-from-color":[{"mask-l-from":D()}],"mask-image-l-to-color":[{"mask-l-to":D()}],"mask-image-x-from-pos":[{"mask-x-from":Q()}],"mask-image-x-to-pos":[{"mask-x-to":Q()}],"mask-image-x-from-color":[{"mask-x-from":D()}],"mask-image-x-to-color":[{"mask-x-to":D()}],"mask-image-y-from-pos":[{"mask-y-from":Q()}],"mask-image-y-to-pos":[{"mask-y-to":Q()}],"mask-image-y-from-color":[{"mask-y-from":D()}],"mask-image-y-to-color":[{"mask-y-to":D()}],"mask-image-radial":[{"mask-radial":[he,de]}],"mask-image-radial-from-pos":[{"mask-radial-from":Q()}],"mask-image-radial-to-pos":[{"mask-radial-to":Q()}],"mask-image-radial-from-color":[{"mask-radial-from":D()}],"mask-image-radial-to-color":[{"mask-radial-to":D()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":w()}],"mask-image-conic-pos":[{"mask-conic":[Me]}],"mask-image-conic-from-pos":[{"mask-conic-from":Q()}],"mask-image-conic-to-pos":[{"mask-conic-to":Q()}],"mask-image-conic-from-color":[{"mask-conic-from":D()}],"mask-image-conic-to-color":[{"mask-conic-to":D()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:V()}],"mask-repeat":[{mask:Z()}],"mask-size":[{mask:G()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",he,de]}],filter:[{filter:["","none",he,de]}],blur:[{blur:re()}],brightness:[{brightness:[Me,he,de]}],contrast:[{contrast:[Me,he,de]}],"drop-shadow":[{"drop-shadow":["","none",h,xs,ks]}],"drop-shadow-color":[{"drop-shadow":D()}],grayscale:[{grayscale:["",Me,he,de]}],"hue-rotate":[{"hue-rotate":[Me,he,de]}],invert:[{invert:["",Me,he,de]}],saturate:[{saturate:[Me,he,de]}],sepia:[{sepia:["",Me,he,de]}],"backdrop-filter":[{"backdrop-filter":["","none",he,de]}],"backdrop-blur":[{"backdrop-blur":re()}],"backdrop-brightness":[{"backdrop-brightness":[Me,he,de]}],"backdrop-contrast":[{"backdrop-contrast":[Me,he,de]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Me,he,de]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Me,he,de]}],"backdrop-invert":[{"backdrop-invert":["",Me,he,de]}],"backdrop-opacity":[{"backdrop-opacity":[Me,he,de]}],"backdrop-saturate":[{"backdrop-saturate":[Me,he,de]}],"backdrop-sepia":[{"backdrop-sepia":["",Me,he,de]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":v()}],"border-spacing-x":[{"border-spacing-x":v()}],"border-spacing-y":[{"border-spacing-y":v()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",he,de]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Me,"initial",he,de]}],ease:[{ease:["linear","initial",g,he,de]}],delay:[{delay:[Me,he,de]}],animate:[{animate:["none",C,he,de]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[p,he,de]}],"perspective-origin":[{"perspective-origin":_()}],rotate:[{rotate:le()}],"rotate-x":[{"rotate-x":le()}],"rotate-y":[{"rotate-y":le()}],"rotate-z":[{"rotate-z":le()}],scale:[{scale:K()}],"scale-x":[{"scale-x":K()}],"scale-y":[{"scale-y":K()}],"scale-z":[{"scale-z":K()}],"scale-3d":["scale-3d"],skew:[{skew:Se()}],"skew-x":[{"skew-x":Se()}],"skew-y":[{"skew-y":Se()}],transform:[{transform:[he,de,"","none","gpu","cpu"]}],"transform-origin":[{origin:_()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ie()}],"translate-x":[{"translate-x":Ie()}],"translate-y":[{"translate-y":Ie()}],"translate-z":[{"translate-z":Ie()}],"translate-none":["translate-none"],accent:[{accent:D()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:D()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",he,de]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":v()}],"scroll-mx":[{"scroll-mx":v()}],"scroll-my":[{"scroll-my":v()}],"scroll-ms":[{"scroll-ms":v()}],"scroll-me":[{"scroll-me":v()}],"scroll-mbs":[{"scroll-mbs":v()}],"scroll-mbe":[{"scroll-mbe":v()}],"scroll-mt":[{"scroll-mt":v()}],"scroll-mr":[{"scroll-mr":v()}],"scroll-mb":[{"scroll-mb":v()}],"scroll-ml":[{"scroll-ml":v()}],"scroll-p":[{"scroll-p":v()}],"scroll-px":[{"scroll-px":v()}],"scroll-py":[{"scroll-py":v()}],"scroll-ps":[{"scroll-ps":v()}],"scroll-pe":[{"scroll-pe":v()}],"scroll-pbs":[{"scroll-pbs":v()}],"scroll-pbe":[{"scroll-pbe":v()}],"scroll-pt":[{"scroll-pt":v()}],"scroll-pr":[{"scroll-pr":v()}],"scroll-pb":[{"scroll-pb":v()}],"scroll-pl":[{"scroll-pl":v()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",he,de]}],fill:[{fill:["none",...D()]}],"stroke-w":[{stroke:[Me,Mo,Cr,bf]}],stroke:[{stroke:["none",...D()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function Tt(...e){return Oa(_s(e))}var hw=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],pw=hw.reduce((e,t)=>{const n=Wu(`Primitive.${t}`),r=b.forwardRef((o,s)=>{const{asChild:i,...a}=o,c=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),T.jsx(c,{...a,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),mw="Label",Df=b.forwardRef((e,t)=>T.jsx(pw.label,{...e,ref:t,onMouseDown:n=>{n.target.closest("button, input, select, textarea")||(e.onMouseDown?.(n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));Df.displayName=mw;var gw=Df;function yw({className:e,...t}){return T.jsx(gw,{"data-slot":"label",className:Tt("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}const vw=ub,Af=b.createContext({}),bw=({...e})=>T.jsx(Af.Provider,{value:{name:e.name},children:T.jsx(cb,{...e})}),Os=()=>{const e=b.useContext(Af),t=b.useContext(Mf),{getFieldState:n}=lb(),r=ju({name:e.name}),o=n(e.name,r);if(!e)throw new Error("useFormField should be used within <FormField>");const{id:s}=t;return{id:s,name:e.name,formItemId:`${s}-form-item`,formDescriptionId:`${s}-form-item-description`,formMessageId:`${s}-form-item-message`,...o}},Mf=b.createContext({});function Ea({className:e,...t}){const n=b.useId();return T.jsx(Mf.Provider,{value:{id:n},children:T.jsx("div",{"data-slot":"form-item",className:Tt("grid gap-2",e),...t})})}function Ca({className:e,...t}){const{error:n,formItemId:r}=Os();return T.jsx(yw,{"data-slot":"form-label","data-error":!!n,className:Tt("data-[error=true]:text-destructive",e),htmlFor:r,...t})}function Es({...e}){const{error:t,formItemId:n,formDescriptionId:r,formMessageId:o}=Os();return T.jsx(zu,{"data-slot":"form-control",id:n,"aria-describedby":t?`${r} ${o}`:`${r}`,"aria-invalid":!!t,...e})}function ww({className:e,...t}){const{formDescriptionId:n}=Os();return T.jsx("p",{"data-slot":"form-description",id:n,className:Tt("text-muted-foreground text-sm",e),...t})}function _w({className:e,...t}){const{error:n,formMessageId:r}=Os(),o=n?String(n?.message??""):t.children;return o?T.jsx("p",{"data-slot":"form-message",id:r,className:Tt("text-destructive text-sm",e),...t,children:o}):null}function Sw({className:e,type:t,...n}){return T.jsx("input",{type:t,"data-slot":"input",className:Tt("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...n})}function Pf(...e){return Oa(_s(e))}const kw=(e={})=>{const{field:t={},form:n={},question:r={},disabled:o=!1}=e;return T.jsx(Sw,{...t,type:r.validation?.type==="email"?"email":r?.id?.includes("phone")?"tel":"text",placeholder:r.placeholder||"Your answer here...",className:Pf("bq-input",n.formState.errors[r.reference_id]?"border-destructive focus-visible:ring-destructive":""),disabled:o})};function xw({className:e,...t}){return T.jsx("textarea",{"data-slot":"textarea",className:Tt("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),...t})}const Ow=(e={})=>{const{field:t={},form:n={},question:r={},disabled:o=!1}=e;return T.jsx(xw,{...t,rows:4,placeholder:"Your detailed answer...",className:Pf("bq-textarea",n.formState.errors[r.reference_id]?"border-destructive focus-visible:ring-destructive":""),disabled:o})};function Ce(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e?.(o),n===!1||!o.defaultPrevented)return t?.(o)}}function Ew(e,t){const n=b.createContext(t),r=s=>{const{children:i,...a}=s,c=b.useMemo(()=>a,Object.values(a));return T.jsx(n.Provider,{value:c,children:i})};r.displayName=e+"Provider";function o(s){const i=b.useContext(n);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[r,o]}function Un(e,t=[]){let n=[];function r(s,i){const a=b.createContext(i),c=n.length;n=[...n,i];const u=f=>{const{scope:d,children:h,...m}=f,p=d?.[e]?.[c]||a,y=b.useMemo(()=>m,Object.values(m));return T.jsx(p.Provider,{value:y,children:h})};u.displayName=s+"Provider";function l(f,d){const h=d?.[e]?.[c]||a,m=b.useContext(h);if(m)return m;if(i!==void 0)return i;throw new Error(`\`${f}\` must be used within \`${s}\``)}return[u,l]}const o=()=>{const s=n.map(i=>b.createContext(i));return function(a){const c=a?.[e]||s;return b.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])}};return o.scopeName=e,[r,Cw(o,...t)]}function Cw(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=r.reduce((a,{useScope:c,scopeName:u})=>{const f=c(s)[`__scope${u}`];return{...a,...f}},{});return b.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}function Tw(e){const t=Dw(e),n=b.forwardRef((r,o)=>{const{children:s,...i}=r,a=b.Children.toArray(s),c=a.find(Mw);if(c){const u=c.props.children,l=a.map(f=>f===c?b.Children.count(u)>1?b.Children.only(null):b.isValidElement(u)?u.props.children:null:f);return T.jsx(t,{...i,ref:o,children:b.isValidElement(u)?b.cloneElement(u,void 0,l):null})}return T.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function Dw(e){const t=b.forwardRef((n,r)=>{const{children:o,...s}=n;if(b.isValidElement(o)){const i=Nw(o),a=Pw(s,o.props);return o.type!==b.Fragment&&(a.ref=r?Or(r,i):i),b.cloneElement(o,a)}return b.Children.count(o)>1?b.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Aw=Symbol("radix.slottable");function Mw(e){return b.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Aw}function Pw(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{const c=s(...a);return o(...a),c}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function Nw(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Iw=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ne=Iw.reduce((e,t)=>{const n=Tw(`Primitive.${t}`),r=b.forwardRef((o,s)=>{const{asChild:i,...a}=o,c=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),T.jsx(c,{...a,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Fw(e,t){e&&ms.flushSync(()=>e.dispatchEvent(t))}function Nf(e){const t=Rw(e),n=b.forwardRef((r,o)=>{const{children:s,...i}=r,a=b.Children.toArray(s),c=a.find(zw);if(c){const u=c.props.children,l=a.map(f=>f===c?b.Children.count(u)>1?b.Children.only(null):b.isValidElement(u)?u.props.children:null:f);return T.jsx(t,{...i,ref:o,children:b.isValidElement(u)?b.cloneElement(u,void 0,l):null})}return T.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function Rw(e){const t=b.forwardRef((n,r)=>{const{children:o,...s}=n;if(b.isValidElement(o)){const i=$w(o),a=Lw(s,o.props);return o.type!==b.Fragment&&(a.ref=r?Or(r,i):i),b.cloneElement(o,a)}return b.Children.count(o)>1?b.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Ww=Symbol("radix.slottable");function zw(e){return b.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Ww}function Lw(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{const c=s(...a);return o(...a),c}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function $w(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function If(e){const t=e+"CollectionProvider",[n,r]=Un(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=p=>{const{scope:y,children:g}=p,C=j.useRef(null),O=j.useRef(new Map).current;return T.jsx(o,{scope:y,itemMap:O,collectionRef:C,children:g})};i.displayName=t;const a=e+"CollectionSlot",c=Nf(a),u=j.forwardRef((p,y)=>{const{scope:g,children:C}=p,O=s(a,g),w=Ve(y,O.collectionRef);return T.jsx(c,{ref:w,children:C})});u.displayName=a;const l=e+"CollectionItemSlot",f="data-radix-collection-item",d=Nf(l),h=j.forwardRef((p,y)=>{const{scope:g,children:C,...O}=p,w=j.useRef(null),_=Ve(y,w),S=s(l,g);return j.useEffect(()=>(S.itemMap.set(w,{ref:w,...O}),()=>{S.itemMap.delete(w)})),T.jsx(d,{[f]:"",ref:_,children:C})});h.displayName=l;function m(p){const y=s(e+"CollectionConsumer",p);return j.useCallback(()=>{const C=y.collectionRef.current;if(!C)return[];const O=Array.from(C.querySelectorAll(`[${f}]`));return Array.from(y.itemMap.values()).sort((S,I)=>O.indexOf(S.ref.current)-O.indexOf(I.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:i,Slot:u,ItemSlot:h},m,r]}var Dt=globalThis?.document?b.useLayoutEffect:()=>{},Uw=b[" useId ".trim().toString()]||(()=>{}),Yw=0;function ar(e){const[t,n]=b.useState(Uw());return Dt(()=>{n(r=>r??String(Yw++))},[e]),e||(t?`radix-${t}`:"")}function cr(e){const t=b.useRef(e);return b.useEffect(()=>{t.current=e}),b.useMemo(()=>(...n)=>t.current?.(...n),[])}var jw=b[" useInsertionEffect ".trim().toString()]||Dt;function Dr({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,s,i]=Vw({defaultProp:t,onChange:n}),a=e!==void 0,c=a?e:o;{const l=b.useRef(e!==void 0);b.useEffect(()=>{const f=l.current;f!==a&&console.warn(`${r} is changing from ${f?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),l.current=a},[a,r])}const u=b.useCallback(l=>{if(a){const f=Bw(l)?l(e):l;f!==e&&i.current?.(f)}else s(l)},[a,e,s,i]);return[c,u]}function Vw({defaultProp:e,onChange:t}){const[n,r]=b.useState(e),o=b.useRef(n),s=b.useRef(t);return jw(()=>{s.current=t},[t]),b.useEffect(()=>{o.current!==n&&(s.current?.(n),o.current=n)},[n,o]),[n,r,s]}function Bw(e){return typeof e=="function"}var Hw=b.createContext(void 0);function Ta(e){const t=b.useContext(Hw);return e||t||"ltr"}var Da="rovingFocusGroup.onEntryFocus",Zw={bubbles:!1,cancelable:!0},Po="RovingFocusGroup",[Aa,Ff,Gw]=If(Po),[qw,Rf]=Un(Po,[Gw]),[Kw,Xw]=qw(Po),Wf=b.forwardRef((e,t)=>T.jsx(Aa.Provider,{scope:e.__scopeRovingFocusGroup,children:T.jsx(Aa.Slot,{scope:e.__scopeRovingFocusGroup,children:T.jsx(Jw,{...e,ref:t})})}));Wf.displayName=Po;var Jw=b.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:s,currentTabStopId:i,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:c,onEntryFocus:u,preventScrollOnEntryFocus:l=!1,...f}=e,d=b.useRef(null),h=Ve(t,d),m=Ta(s),[p,y]=Dr({prop:i,defaultProp:a??null,onChange:c,caller:Po}),[g,C]=b.useState(!1),O=cr(u),w=Ff(n),_=b.useRef(!1),[S,I]=b.useState(0);return b.useEffect(()=>{const v=d.current;if(v)return v.addEventListener(Da,O),()=>v.removeEventListener(Da,O)},[O]),T.jsx(Kw,{scope:n,orientation:r,dir:m,loop:o,currentTabStopId:p,onItemFocus:b.useCallback(v=>y(v),[y]),onItemShiftTab:b.useCallback(()=>C(!0),[]),onFocusableItemAdd:b.useCallback(()=>I(v=>v+1),[]),onFocusableItemRemove:b.useCallback(()=>I(v=>v-1),[]),children:T.jsx(Ne.div,{tabIndex:g||S===0?-1:0,"data-orientation":r,...f,ref:h,style:{outline:"none",...e.style},onMouseDown:Ce(e.onMouseDown,()=>{_.current=!0}),onFocus:Ce(e.onFocus,v=>{const x=!_.current;if(v.target===v.currentTarget&&x&&!g){const P=new CustomEvent(Da,Zw);if(v.currentTarget.dispatchEvent(P),!P.defaultPrevented){const A=w().filter(E=>E.focusable),M=A.find(E=>E.active),F=A.find(E=>E.id===p),W=[M,F,...A].filter(Boolean).map(E=>E.ref.current);$f(W,l)}}_.current=!1}),onBlur:Ce(e.onBlur,()=>C(!1))})})}),zf="RovingFocusGroupItem",Lf=b.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:s,children:i,...a}=e,c=ar(),u=s||c,l=Xw(zf,n),f=l.currentTabStopId===u,d=Ff(n),{onFocusableItemAdd:h,onFocusableItemRemove:m,currentTabStopId:p}=l;return b.useEffect(()=>{if(r)return h(),()=>m()},[r,h,m]),T.jsx(Aa.ItemSlot,{scope:n,id:u,focusable:r,active:o,children:T.jsx(Ne.span,{tabIndex:f?0:-1,"data-orientation":l.orientation,...a,ref:t,onMouseDown:Ce(e.onMouseDown,y=>{r?l.onItemFocus(u):y.preventDefault()}),onFocus:Ce(e.onFocus,()=>l.onItemFocus(u)),onKeyDown:Ce(e.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){l.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const g=t_(y,l.orientation,l.dir);if(g!==void 0){if(y.metaKey||y.ctrlKey||y.altKey||y.shiftKey)return;y.preventDefault();let O=d().filter(w=>w.focusable).map(w=>w.ref.current);if(g==="last")O.reverse();else if(g==="prev"||g==="next"){g==="prev"&&O.reverse();const w=O.indexOf(y.currentTarget);O=l.loop?n_(O,w+1):O.slice(w+1)}setTimeout(()=>$f(O))}}),children:typeof i=="function"?i({isCurrentTabStop:f,hasTabStop:p!=null}):i})})});Lf.displayName=zf;var Qw={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function e_(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function t_(e,t,n){const r=e_(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Qw[r]}function $f(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function n_(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var r_=Wf,o_=Lf;function Ma(e){const[t,n]=b.useState(void 0);return Dt(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let i,a;if("borderBoxSize"in s){const c=s.borderBoxSize,u=Array.isArray(c)?c[0]:c;i=u.inlineSize,a=u.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}function Pa(e){const t=b.useRef({value:e,previous:e});return b.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function s_(e,t){return b.useReducer((n,r)=>t[n][r]??n,e)}var lr=e=>{const{present:t,children:n}=e,r=i_(t),o=typeof n=="function"?n({present:r.isPresent}):b.Children.only(n),s=Ve(r.ref,a_(o));return typeof n=="function"||r.isPresent?b.cloneElement(o,{ref:s}):null};lr.displayName="Presence";function i_(e){const[t,n]=b.useState(),r=b.useRef(null),o=b.useRef(e),s=b.useRef("none"),i=e?"mounted":"unmounted",[a,c]=s_(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return b.useEffect(()=>{const u=Cs(r.current);s.current=a==="mounted"?u:"none"},[a]),Dt(()=>{const u=r.current,l=o.current;if(l!==e){const d=s.current,h=Cs(u);e?c("MOUNT"):h==="none"||u?.display==="none"?c("UNMOUNT"):c(l&&d!==h?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,c]),Dt(()=>{if(t){let u;const l=t.ownerDocument.defaultView??window,f=h=>{const p=Cs(r.current).includes(CSS.escape(h.animationName));if(h.target===t&&p&&(c("ANIMATION_END"),!o.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",u=l.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},d=h=>{h.target===t&&(s.current=Cs(r.current))};return t.addEventListener("animationstart",d),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{l.clearTimeout(u),t.removeEventListener("animationstart",d),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:b.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function Cs(e){return e?.animationName||"none"}function a_(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Na="Radio",[c_,Uf]=Un(Na),[l_,u_]=c_(Na),Yf=b.forwardRef((e,t)=>{const{__scopeRadio:n,name:r,checked:o=!1,required:s,disabled:i,value:a="on",onCheck:c,form:u,...l}=e,[f,d]=b.useState(null),h=Ve(t,y=>d(y)),m=b.useRef(!1),p=f?u||!!f.closest("form"):!0;return T.jsxs(l_,{scope:n,checked:o,disabled:i,children:[T.jsx(Ne.button,{type:"button",role:"radio","aria-checked":o,"data-state":Hf(o),"data-disabled":i?"":void 0,disabled:i,value:a,...l,ref:h,onClick:Ce(e.onClick,y=>{o||c?.(),p&&(m.current=y.isPropagationStopped(),m.current||y.stopPropagation())})}),p&&T.jsx(Bf,{control:f,bubbles:!m.current,name:r,value:a,checked:o,required:s,disabled:i,form:u,style:{transform:"translateX(-100%)"}})]})});Yf.displayName=Na;var jf="RadioIndicator",Vf=b.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:r,...o}=e,s=u_(jf,n);return T.jsx(lr,{present:r||s.checked,children:T.jsx(Ne.span,{"data-state":Hf(s.checked),"data-disabled":s.disabled?"":void 0,...o,ref:t})})});Vf.displayName=jf;var f_="RadioBubbleInput",Bf=b.forwardRef(({__scopeRadio:e,control:t,checked:n,bubbles:r=!0,...o},s)=>{const i=b.useRef(null),a=Ve(i,s),c=Pa(n),u=Ma(t);return b.useEffect(()=>{const l=i.current;if(!l)return;const f=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(f,"checked").set;if(c!==n&&h){const m=new Event("click",{bubbles:r});h.call(l,n),l.dispatchEvent(m)}},[c,n,r]),T.jsx(Ne.input,{type:"radio","aria-hidden":!0,defaultChecked:n,...o,tabIndex:-1,ref:a,style:{...o.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});Bf.displayName=f_;function Hf(e){return e?"checked":"unchecked"}var d_=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Ts="RadioGroup",[h_]=Un(Ts,[Rf,Uf]),Zf=Rf(),Gf=Uf(),[p_,m_]=h_(Ts),qf=b.forwardRef((e,t)=>{const{__scopeRadioGroup:n,name:r,defaultValue:o,value:s,required:i=!1,disabled:a=!1,orientation:c,dir:u,loop:l=!0,onValueChange:f,...d}=e,h=Zf(n),m=Ta(u),[p,y]=Dr({prop:s,defaultProp:o??null,onChange:f,caller:Ts});return T.jsx(p_,{scope:n,name:r,required:i,disabled:a,value:p,onValueChange:y,children:T.jsx(r_,{asChild:!0,...h,orientation:c,dir:m,loop:l,children:T.jsx(Ne.div,{role:"radiogroup","aria-required":i,"aria-orientation":c,"data-disabled":a?"":void 0,dir:m,...d,ref:t})})})});qf.displayName=Ts;var Kf="RadioGroupItem",Xf=b.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:r,...o}=e,s=m_(Kf,n),i=s.disabled||r,a=Zf(n),c=Gf(n),u=b.useRef(null),l=Ve(t,u),f=s.value===o.value,d=b.useRef(!1);return b.useEffect(()=>{const h=p=>{d_.includes(p.key)&&(d.current=!0)},m=()=>d.current=!1;return document.addEventListener("keydown",h),document.addEventListener("keyup",m),()=>{document.removeEventListener("keydown",h),document.removeEventListener("keyup",m)}},[]),T.jsx(o_,{asChild:!0,...a,focusable:!i,active:f,children:T.jsx(Yf,{disabled:i,required:s.required,checked:f,...c,...o,name:s.name,ref:l,onCheck:()=>s.onValueChange(o.value),onKeyDown:Ce(h=>{h.key==="Enter"&&h.preventDefault()}),onFocus:Ce(o.onFocus,()=>{d.current&&u.current?.click()})})})});Xf.displayName=Kf;var g_="RadioGroupIndicator",Jf=b.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...r}=e,o=Gf(n);return T.jsx(Vf,{...o,...r,ref:t})});Jf.displayName=g_;var y_=qf,v_=Xf,b_=Jf;const Qf=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();const w_=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const __=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase());const ed=e=>{const t=__(e);return t.charAt(0).toUpperCase()+t.slice(1)};var S_={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const k_=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};const x_=j.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:s,iconNode:i,...a},c)=>j.createElement("svg",{ref:c,...S_,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Qf("lucide",o),...!s&&!k_(a)&&{"aria-hidden":"true"},...a},[...i.map(([u,l])=>j.createElement(u,l)),...Array.isArray(s)?s:[s]]));const ur=(e,t)=>{const n=j.forwardRef(({className:r,...o},s)=>j.createElement(x_,{ref:s,iconNode:t,className:Qf(`lucide-${w_(ed(e))}`,`lucide-${e}`,r),...o}));return n.displayName=ed(e),n};const O_=ur("calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);const td=ur("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);const Ia=ur("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const E_=ur("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);const C_=ur("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);const T_=ur("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);const D_=ur("circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);const A_=ur("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function M_({className:e,...t}){return T.jsx(y_,{"data-slot":"radio-group",className:Tt("grid gap-3",e),...t})}function P_({className:e,...t}){return T.jsx(v_,{"data-slot":"radio-group-item",className:Tt("border-input text-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:T.jsx(b_,{"data-slot":"radio-group-indicator",className:"relative flex items-center justify-center",children:T.jsx(D_,{className:"fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2"})})})}const N_=(e={})=>{const{field:t={},form:n={},question:r={},disabled:o=!1}=e;return T.jsx(M_,{onValueChange:t.onChange,value:t.value,className:`bq-radio-group space-y-1 ${n.formState.errors[r.reference_id]?"rounded-md border border-destructive p-3":""}`,children:r.options.map(s=>{const i=`${r.reference_id}-${s.value}`;return T.jsxs(Ea,{className:"flex items-center space-x-2 hover:bg-muted/50 rounded-md transition-colors",children:[T.jsx(Es,{children:T.jsx(P_,{className:"bq-radio-item w-4! h-4! border! border-input! focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",value:s.value,id:i,disabled:o})}),T.jsx(Ca,{htmlFor:i,className:"font-normal cursor-pointer",children:s.label})]},s.value)})})};var Ds="Checkbox",[I_]=Un(Ds),[F_,Fa]=I_(Ds);function R_(e){const{__scopeCheckbox:t,checked:n,children:r,defaultChecked:o,disabled:s,form:i,name:a,onCheckedChange:c,required:u,value:l="on",internal_do_not_use_render:f}=e,[d,h]=Dr({prop:n,defaultProp:o??!1,onChange:c,caller:Ds}),[m,p]=b.useState(null),[y,g]=b.useState(null),C=b.useRef(!1),O=m?!!i||!!m.closest("form"):!0,w={checked:d,disabled:s,setChecked:h,control:m,setControl:p,name:a,form:i,value:l,hasConsumerStoppedPropagationRef:C,required:u,defaultChecked:fr(o)?!1:o,isFormControl:O,bubbleInput:y,setBubbleInput:g};return T.jsx(F_,{scope:t,...w,children:W_(f)?f(w):r})}var nd="CheckboxTrigger",rd=b.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},o)=>{const{control:s,value:i,disabled:a,checked:c,required:u,setControl:l,setChecked:f,hasConsumerStoppedPropagationRef:d,isFormControl:h,bubbleInput:m}=Fa(nd,e),p=Ve(o,l),y=b.useRef(c);return b.useEffect(()=>{const g=s?.form;if(g){const C=()=>f(y.current);return g.addEventListener("reset",C),()=>g.removeEventListener("reset",C)}},[s,f]),T.jsx(Ne.button,{type:"button",role:"checkbox","aria-checked":fr(c)?"mixed":c,"aria-required":u,"data-state":ld(c),"data-disabled":a?"":void 0,disabled:a,value:i,...r,ref:p,onKeyDown:Ce(t,g=>{g.key==="Enter"&&g.preventDefault()}),onClick:Ce(n,g=>{f(C=>fr(C)?!0:!C),m&&h&&(d.current=g.isPropagationStopped(),d.current||g.stopPropagation())})})});rd.displayName=nd;var od=b.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:o,defaultChecked:s,required:i,disabled:a,value:c,onCheckedChange:u,form:l,...f}=e;return T.jsx(R_,{__scopeCheckbox:n,checked:o,defaultChecked:s,disabled:a,required:i,onCheckedChange:u,name:r,form:l,value:c,internal_do_not_use_render:({isFormControl:d})=>T.jsxs(T.Fragment,{children:[T.jsx(rd,{...f,ref:t,__scopeCheckbox:n}),d&&T.jsx(cd,{__scopeCheckbox:n})]})})});od.displayName=Ds;var sd="CheckboxIndicator",id=b.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...o}=e,s=Fa(sd,n);return T.jsx(lr,{present:r||fr(s.checked)||s.checked===!0,children:T.jsx(Ne.span,{"data-state":ld(s.checked),"data-disabled":s.disabled?"":void 0,...o,ref:t,style:{pointerEvents:"none",...e.style}})})});id.displayName=sd;var ad="CheckboxBubbleInput",cd=b.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:o,checked:s,defaultChecked:i,required:a,disabled:c,name:u,value:l,form:f,bubbleInput:d,setBubbleInput:h}=Fa(ad,e),m=Ve(n,h),p=Pa(s),y=Ma(r);b.useEffect(()=>{const C=d;if(!C)return;const O=window.HTMLInputElement.prototype,_=Object.getOwnPropertyDescriptor(O,"checked").set,S=!o.current;if(p!==s&&_){const I=new Event("click",{bubbles:S});C.indeterminate=fr(s),_.call(C,fr(s)?!1:s),C.dispatchEvent(I)}},[d,p,s,o]);const g=b.useRef(fr(s)?!1:s);return T.jsx(Ne.input,{type:"checkbox","aria-hidden":!0,defaultChecked:i??g.current,required:a,disabled:c,name:u,value:l,form:f,...t,tabIndex:-1,ref:m,style:{...t.style,...y,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});cd.displayName=ad;function W_(e){return typeof e=="function"}function fr(e){return e==="indeterminate"}function ld(e){return fr(e)?"indeterminate":e?"checked":"unchecked"}function z_({className:e,...t}){return T.jsx(od,{"data-slot":"checkbox",className:Tt("peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:T.jsx(id,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current transition-none",children:T.jsx(td,{className:"size-3.5"})})})}const L_=(e={})=>{const{field:t={},question:n={},disabled:r=!1}=e,{options:o=[]}=n;return o.map((s,i)=>T.jsxs(Ea,{className:"flex items-center space-x-1 hover:bg-muted/50 rounded-md transition-colors",children:[T.jsx(Es,{children:T.jsx(z_,{className:"bq-checkbox w-4! h-4! border! border-input! focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",checked:t.value?.includes(s.value),onCheckedChange:a=>a?t.onChange([...t.value||[],s.value]):t.onChange((t.value||[]).filter(c=>c!==s.value)),id:`${n.reference_id}-${s.value}`,disabled:r})}),T.jsx(Ca,{htmlFor:`${n.reference_id}-${s.value}`,className:"flex-1 font-normal cursor-pointer text-sm leading-relaxed",children:s.label})]},i))};function ud(e,[t,n]){return Math.min(n,Math.max(t,e))}function $_(e,t=globalThis?.document){const n=cr(e);b.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var U_="DismissableLayer",Ra="dismissableLayer.update",Y_="dismissableLayer.pointerDownOutside",j_="dismissableLayer.focusOutside",fd,dd=b.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),As=b.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:i,onDismiss:a,...c}=e,u=b.useContext(dd),[l,f]=b.useState(null),d=l?.ownerDocument??globalThis?.document,[,h]=b.useState({}),m=Ve(t,I=>f(I)),p=Array.from(u.layers),[y]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),g=p.indexOf(y),C=l?p.indexOf(l):-1,O=u.layersWithOutsidePointerEventsDisabled.size>0,w=C>=g,_=H_(I=>{const v=I.target,x=[...u.branches].some(P=>P.contains(v));!w||x||(o?.(I),i?.(I),I.defaultPrevented||a?.())},d),S=Z_(I=>{const v=I.target;[...u.branches].some(P=>P.contains(v))||(s?.(I),i?.(I),I.defaultPrevented||a?.())},d);return $_(I=>{C===u.layers.size-1&&(r?.(I),!I.defaultPrevented&&a&&(I.preventDefault(),a()))},d),b.useEffect(()=>{if(l)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(fd=d.body.style.pointerEvents,d.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(l)),u.layers.add(l),hd(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(d.body.style.pointerEvents=fd)}},[l,d,n,u]),b.useEffect(()=>()=>{l&&(u.layers.delete(l),u.layersWithOutsidePointerEventsDisabled.delete(l),hd())},[l,u]),b.useEffect(()=>{const I=()=>h({});return document.addEventListener(Ra,I),()=>document.removeEventListener(Ra,I)},[]),T.jsx(Ne.div,{...c,ref:m,style:{pointerEvents:O?w?"auto":"none":void 0,...e.style},onFocusCapture:Ce(e.onFocusCapture,S.onFocusCapture),onBlurCapture:Ce(e.onBlurCapture,S.onBlurCapture),onPointerDownCapture:Ce(e.onPointerDownCapture,_.onPointerDownCapture)})});As.displayName=U_;var V_="DismissableLayerBranch",B_=b.forwardRef((e,t)=>{const n=b.useContext(dd),r=b.useRef(null),o=Ve(t,r);return b.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),T.jsx(Ne.div,{...e,ref:o})});B_.displayName=V_;function H_(e,t=globalThis?.document){const n=cr(e),r=b.useRef(!1),o=b.useRef(()=>{});return b.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let c=function(){pd(Y_,n,u,{discrete:!0})};const u={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=c,t.addEventListener("click",o.current,{once:!0})):c()}else t.removeEventListener("click",o.current);r.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Z_(e,t=globalThis?.document){const n=cr(e),r=b.useRef(!1);return b.useEffect(()=>{const o=s=>{s.target&&!r.current&&pd(j_,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function hd(){const e=new CustomEvent(Ra);document.dispatchEvent(e)}function pd(e,t,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?Fw(o,s):o.dispatchEvent(s)}var Wa=0;function za(){b.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??md()),document.body.insertAdjacentElement("beforeend",e[1]??md()),Wa++,()=>{Wa===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Wa--}},[])}function md(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var La="focusScope.autoFocusOnMount",$a="focusScope.autoFocusOnUnmount",gd={bubbles:!1,cancelable:!0},G_="FocusScope",Ms=b.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...i}=e,[a,c]=b.useState(null),u=cr(o),l=cr(s),f=b.useRef(null),d=Ve(t,p=>c(p)),h=b.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;b.useEffect(()=>{if(r){let p=function(O){if(h.paused||!a)return;const w=O.target;a.contains(w)?f.current=w:dr(f.current,{select:!0})},y=function(O){if(h.paused||!a)return;const w=O.relatedTarget;w!==null&&(a.contains(w)||dr(f.current,{select:!0}))},g=function(O){if(document.activeElement===document.body)for(const _ of O)_.removedNodes.length>0&&dr(a)};document.addEventListener("focusin",p),document.addEventListener("focusout",y);const C=new MutationObserver(g);return a&&C.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",p),document.removeEventListener("focusout",y),C.disconnect()}}},[r,a,h.paused]),b.useEffect(()=>{if(a){bd.add(h);const p=document.activeElement;if(!a.contains(p)){const g=new CustomEvent(La,gd);a.addEventListener(La,u),a.dispatchEvent(g),g.defaultPrevented||(q_(e0(yd(a)),{select:!0}),document.activeElement===p&&dr(a))}return()=>{a.removeEventListener(La,u),setTimeout(()=>{const g=new CustomEvent($a,gd);a.addEventListener($a,l),a.dispatchEvent(g),g.defaultPrevented||dr(p??document.body,{select:!0}),a.removeEventListener($a,l),bd.remove(h)},0)}}},[a,u,l,h]);const m=b.useCallback(p=>{if(!n&&!r||h.paused)return;const y=p.key==="Tab"&&!p.altKey&&!p.ctrlKey&&!p.metaKey,g=document.activeElement;if(y&&g){const C=p.currentTarget,[O,w]=K_(C);O&&w?!p.shiftKey&&g===w?(p.preventDefault(),n&&dr(O,{select:!0})):p.shiftKey&&g===O&&(p.preventDefault(),n&&dr(w,{select:!0})):g===C&&p.preventDefault()}},[n,r,h.paused]);return T.jsx(Ne.div,{tabIndex:-1,...i,ref:d,onKeyDown:m})});Ms.displayName=G_;function q_(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(dr(r,{select:t}),document.activeElement!==n)return}function K_(e){const t=yd(e),n=vd(t,e),r=vd(t.reverse(),e);return[n,r]}function yd(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function vd(e,t){for(const n of e)if(!X_(n,{upTo:t}))return n}function X_(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function J_(e){return e instanceof HTMLInputElement&&"select"in e}function dr(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&J_(e)&&t&&e.select()}}var bd=Q_();function Q_(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=wd(e,t),e.unshift(t)},remove(t){e=wd(e,t),e[0]?.resume()}}}function wd(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function e0(e){return e.filter(t=>t.tagName!=="A")}const t0=["top","right","bottom","left"],hr=Math.min,Zt=Math.max,Ps=Math.round,Ns=Math.floor,xn=e=>({x:e,y:e}),n0={left:"right",right:"left",bottom:"top",top:"bottom"},r0={start:"end",end:"start"};function Ua(e,t,n){return Zt(e,hr(t,n))}function Yn(e,t){return typeof e=="function"?e(t):e}function jn(e){return e.split("-")[0]}function Gr(e){return e.split("-")[1]}function Ya(e){return e==="x"?"y":"x"}function ja(e){return e==="y"?"height":"width"}const o0=new Set(["top","bottom"]);function On(e){return o0.has(jn(e))?"y":"x"}function Va(e){return Ya(On(e))}function s0(e,t,n){n===void 0&&(n=!1);const r=Gr(e),o=Va(e),s=ja(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=Is(i)),[i,Is(i)]}function i0(e){const t=Is(e);return[Ba(e),t,Ba(t)]}function Ba(e){return e.replace(/start|end/g,t=>r0[t])}const _d=["left","right"],Sd=["right","left"],a0=["top","bottom"],c0=["bottom","top"];function l0(e,t,n){switch(e){case"top":case"bottom":return n?t?Sd:_d:t?_d:Sd;case"left":case"right":return t?a0:c0;default:return[]}}function u0(e,t,n,r){const o=Gr(e);let s=l0(jn(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(Ba)))),s}function Is(e){return e.replace(/left|right|bottom|top/g,t=>n0[t])}function f0(e){return{top:0,right:0,bottom:0,left:0,...e}}function kd(e){return typeof e!="number"?f0(e):{top:e,right:e,bottom:e,left:e}}function Fs(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function xd(e,t,n){let{reference:r,floating:o}=e;const s=On(t),i=Va(t),a=ja(i),c=jn(t),u=s==="y",l=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,d=r[a]/2-o[a]/2;let h;switch(c){case"top":h={x:l,y:r.y-o.height};break;case"bottom":h={x:l,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:f};break;case"left":h={x:r.x-o.width,y:f};break;default:h={x:r.x,y:r.y}}switch(Gr(t)){case"start":h[i]-=d*(n&&u?-1:1);break;case"end":h[i]+=d*(n&&u?-1:1);break}return h}async function d0(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:a,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:l="viewport",elementContext:f="floating",altBoundary:d=!1,padding:h=0}=Yn(t,e),m=kd(h),y=a[d?f==="floating"?"reference":"floating":f],g=Fs(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(y)))==null||n?y:y.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:u,rootBoundary:l,strategy:c})),C=f==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,O=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),w=await(s.isElement==null?void 0:s.isElement(O))?await(s.getScale==null?void 0:s.getScale(O))||{x:1,y:1}:{x:1,y:1},_=Fs(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:C,offsetParent:O,strategy:c}):C);return{top:(g.top-_.top+m.top)/w.y,bottom:(_.bottom-g.bottom+m.bottom)/w.y,left:(g.left-_.left+m.left)/w.x,right:(_.right-g.right+m.right)/w.x}}const h0=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,a=s.filter(Boolean),c=await(i.isRTL==null?void 0:i.isRTL(t));let u=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:l,y:f}=xd(u,r,c),d=r,h={},m=0;for(let y=0;y<a.length;y++){var p;const{name:g,fn:C}=a[y],{x:O,y:w,data:_,reset:S}=await C({x:l,y:f,initialPlacement:r,placement:d,strategy:o,middlewareData:h,rects:u,platform:{...i,detectOverflow:(p=i.detectOverflow)!=null?p:d0},elements:{reference:e,floating:t}});l=O??l,f=w??f,h={...h,[g]:{...h[g],..._}},S&&m<=50&&(m++,typeof S=="object"&&(S.placement&&(d=S.placement),S.rects&&(u=S.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):S.rects),{x:l,y:f}=xd(u,d,c)),y=-1)}return{x:l,y:f,placement:d,strategy:o,middlewareData:h}},p0=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:i,elements:a,middlewareData:c}=t,{element:u,padding:l=0}=Yn(e,t)||{};if(u==null)return{};const f=kd(l),d={x:n,y:r},h=Va(o),m=ja(h),p=await i.getDimensions(u),y=h==="y",g=y?"top":"left",C=y?"bottom":"right",O=y?"clientHeight":"clientWidth",w=s.reference[m]+s.reference[h]-d[h]-s.floating[m],_=d[h]-s.reference[h],S=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u));let I=S?S[O]:0;(!I||!await(i.isElement==null?void 0:i.isElement(S)))&&(I=a.floating[O]||s.floating[m]);const v=w/2-_/2,x=I/2-p[m]/2-1,P=hr(f[g],x),A=hr(f[C],x),M=P,F=I-p[m]-A,N=I/2-p[m]/2+v,W=Ua(M,N,F),E=!c.arrow&&Gr(o)!=null&&N!==W&&s.reference[m]/2-(N<M?P:A)-p[m]/2<0,k=E?N<M?N-M:N-F:0;return{[h]:d[h]+k,data:{[h]:W,centerOffset:N-W-k,...E&&{alignmentOffset:k}},reset:E}}}),m0=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:i,initialPlacement:a,platform:c,elements:u}=t,{mainAxis:l=!0,crossAxis:f=!0,fallbackPlacements:d,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:p=!0,...y}=Yn(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const g=jn(o),C=On(a),O=jn(a)===a,w=await(c.isRTL==null?void 0:c.isRTL(u.floating)),_=d||(O||!p?[Is(a)]:i0(a)),S=m!=="none";!d&&S&&_.push(...u0(a,p,m,w));const I=[a,..._],v=await c.detectOverflow(t,y),x=[];let P=((r=s.flip)==null?void 0:r.overflows)||[];if(l&&x.push(v[g]),f){const N=s0(o,i,w);x.push(v[N[0]],v[N[1]])}if(P=[...P,{placement:o,overflows:x}],!x.every(N=>N<=0)){var A,M;const N=(((A=s.flip)==null?void 0:A.index)||0)+1,W=I[N];if(W&&(!(f==="alignment"?C!==On(W):!1)||P.every(U=>On(U.placement)===C?U.overflows[0]>0:!0)))return{data:{index:N,overflows:P},reset:{placement:W}};let E=(M=P.filter(k=>k.overflows[0]<=0).sort((k,U)=>k.overflows[1]-U.overflows[1])[0])==null?void 0:M.placement;if(!E)switch(h){case"bestFit":{var F;const k=(F=P.filter(U=>{if(S){const $=On(U.placement);return $===C||$==="y"}return!0}).map(U=>[U.placement,U.overflows.filter($=>$>0).reduce(($,D)=>$+D,0)]).sort((U,$)=>U[1]-$[1])[0])==null?void 0:F[0];k&&(E=k);break}case"initialPlacement":E=a;break}if(o!==E)return{reset:{placement:E}}}return{}}}};function Od(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Ed(e){return t0.some(t=>e[t]>=0)}const g0=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:o="referenceHidden",...s}=Yn(e,t);switch(o){case"referenceHidden":{const i=await r.detectOverflow(t,{...s,elementContext:"reference"}),a=Od(i,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:Ed(a)}}}case"escaped":{const i=await r.detectOverflow(t,{...s,altBoundary:!0}),a=Od(i,n.floating);return{data:{escapedOffsets:a,escaped:Ed(a)}}}default:return{}}}}},Cd=new Set(["left","top"]);async function y0(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=jn(n),a=Gr(n),c=On(n)==="y",u=Cd.has(i)?-1:1,l=s&&c?-1:1,f=Yn(t,e);let{mainAxis:d,crossAxis:h,alignmentAxis:m}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&typeof m=="number"&&(h=a==="end"?m*-1:m),c?{x:h*l,y:d*u}:{x:d*u,y:h*l}}const v0=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:i,middlewareData:a}=t,c=await y0(t,e);return i===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+c.x,y:s+c.y,data:{...c,placement:i}}}}},b0=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:s}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:c={fn:g=>{let{x:C,y:O}=g;return{x:C,y:O}}},...u}=Yn(e,t),l={x:n,y:r},f=await s.detectOverflow(t,u),d=On(jn(o)),h=Ya(d);let m=l[h],p=l[d];if(i){const g=h==="y"?"top":"left",C=h==="y"?"bottom":"right",O=m+f[g],w=m-f[C];m=Ua(O,m,w)}if(a){const g=d==="y"?"top":"left",C=d==="y"?"bottom":"right",O=p+f[g],w=p-f[C];p=Ua(O,p,w)}const y=c.fn({...t,[h]:m,[d]:p});return{...y,data:{x:y.x-n,y:y.y-r,enabled:{[h]:i,[d]:a}}}}}},w0=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:s,middlewareData:i}=t,{offset:a=0,mainAxis:c=!0,crossAxis:u=!0}=Yn(e,t),l={x:n,y:r},f=On(o),d=Ya(f);let h=l[d],m=l[f];const p=Yn(a,t),y=typeof p=="number"?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(c){const O=d==="y"?"height":"width",w=s.reference[d]-s.floating[O]+y.mainAxis,_=s.reference[d]+s.reference[O]-y.mainAxis;h<w?h=w:h>_&&(h=_)}if(u){var g,C;const O=d==="y"?"width":"height",w=Cd.has(jn(o)),_=s.reference[f]-s.floating[O]+(w&&((g=i.offset)==null?void 0:g[f])||0)+(w?0:y.crossAxis),S=s.reference[f]+s.reference[O]+(w?0:((C=i.offset)==null?void 0:C[f])||0)-(w?y.crossAxis:0);m<_?m=_:m>S&&(m=S)}return{[d]:h,[f]:m}}}},_0=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:s,platform:i,elements:a}=t,{apply:c=()=>{},...u}=Yn(e,t),l=await i.detectOverflow(t,u),f=jn(o),d=Gr(o),h=On(o)==="y",{width:m,height:p}=s.floating;let y,g;f==="top"||f==="bottom"?(y=f,g=d===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(g=f,y=d==="end"?"top":"bottom");const C=p-l.top-l.bottom,O=m-l.left-l.right,w=hr(p-l[y],C),_=hr(m-l[g],O),S=!t.middlewareData.shift;let I=w,v=_;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(v=O),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(I=C),S&&!d){const P=Zt(l.left,0),A=Zt(l.right,0),M=Zt(l.top,0),F=Zt(l.bottom,0);h?v=m-2*(P!==0||A!==0?P+A:Zt(l.left,l.right)):I=p-2*(M!==0||F!==0?M+F:Zt(l.top,l.bottom))}await c({...t,availableWidth:v,availableHeight:I});const x=await i.getDimensions(a.floating);return m!==x.width||p!==x.height?{reset:{rects:!0}}:{}}}};function Rs(){return typeof window<"u"}function qr(e){return Td(e)?(e.nodeName||"").toLowerCase():"#document"}function Gt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function En(e){var t;return(t=(Td(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Td(e){return Rs()?e instanceof Node||e instanceof Gt(e).Node:!1}function un(e){return Rs()?e instanceof Element||e instanceof Gt(e).Element:!1}function Cn(e){return Rs()?e instanceof HTMLElement||e instanceof Gt(e).HTMLElement:!1}function Dd(e){return!Rs()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Gt(e).ShadowRoot}const S0=new Set(["inline","contents"]);function No(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=fn(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!S0.has(o)}const k0=new Set(["table","td","th"]);function x0(e){return k0.has(qr(e))}const O0=[":popover-open",":modal"];function Ws(e){return O0.some(t=>{try{return e.matches(t)}catch{return!1}})}const E0=["transform","translate","scale","rotate","perspective"],C0=["transform","translate","scale","rotate","perspective","filter"],T0=["paint","layout","strict","content"];function Ha(e){const t=Za(),n=un(e)?fn(e):e;return E0.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||C0.some(r=>(n.willChange||"").includes(r))||T0.some(r=>(n.contain||"").includes(r))}function D0(e){let t=pr(e);for(;Cn(t)&&!Kr(t);){if(Ha(t))return t;if(Ws(t))return null;t=pr(t)}return null}function Za(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const A0=new Set(["html","body","#document"]);function Kr(e){return A0.has(qr(e))}function fn(e){return Gt(e).getComputedStyle(e)}function zs(e){return un(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function pr(e){if(qr(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Dd(e)&&e.host||En(e);return Dd(t)?t.host:t}function Ad(e){const t=pr(e);return Kr(t)?e.ownerDocument?e.ownerDocument.body:e.body:Cn(t)&&No(t)?t:Ad(t)}function Io(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Ad(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),i=Gt(o);if(s){const a=Ga(i);return t.concat(i,i.visualViewport||[],No(o)?o:[],a&&n?Io(a):[])}return t.concat(o,Io(o,[],n))}function Ga(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Md(e){const t=fn(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Cn(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,a=Ps(n)!==s||Ps(r)!==i;return a&&(n=s,r=i),{width:n,height:r,$:a}}function qa(e){return un(e)?e:e.contextElement}function Xr(e){const t=qa(e);if(!Cn(t))return xn(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=Md(t);let i=(s?Ps(n.width):n.width)/r,a=(s?Ps(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const M0=xn(0);function Pd(e){const t=Gt(e);return!Za()||!t.visualViewport?M0:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function P0(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Gt(e)?!1:t}function Ar(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=qa(e);let i=xn(1);t&&(r?un(r)&&(i=Xr(r)):i=Xr(e));const a=P0(s,n,r)?Pd(s):xn(0);let c=(o.left+a.x)/i.x,u=(o.top+a.y)/i.y,l=o.width/i.x,f=o.height/i.y;if(s){const d=Gt(s),h=r&&un(r)?Gt(r):r;let m=d,p=Ga(m);for(;p&&r&&h!==m;){const y=Xr(p),g=p.getBoundingClientRect(),C=fn(p),O=g.left+(p.clientLeft+parseFloat(C.paddingLeft))*y.x,w=g.top+(p.clientTop+parseFloat(C.paddingTop))*y.y;c*=y.x,u*=y.y,l*=y.x,f*=y.y,c+=O,u+=w,m=Gt(p),p=Ga(m)}}return Fs({width:l,height:f,x:c,y:u})}function Ls(e,t){const n=zs(e).scrollLeft;return t?t.left+n:Ar(En(e)).left+n}function Nd(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Ls(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function N0(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=En(r),a=t?Ws(t.floating):!1;if(r===i||a&&s)return n;let c={scrollLeft:0,scrollTop:0},u=xn(1);const l=xn(0),f=Cn(r);if((f||!f&&!s)&&((qr(r)!=="body"||No(i))&&(c=zs(r)),Cn(r))){const h=Ar(r);u=Xr(r),l.x=h.x+r.clientLeft,l.y=h.y+r.clientTop}const d=i&&!f&&!s?Nd(i,c):xn(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-c.scrollLeft*u.x+l.x+d.x,y:n.y*u.y-c.scrollTop*u.y+l.y+d.y}}function I0(e){return Array.from(e.getClientRects())}function F0(e){const t=En(e),n=zs(e),r=e.ownerDocument.body,o=Zt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=Zt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+Ls(e);const a=-n.scrollTop;return fn(r).direction==="rtl"&&(i+=Zt(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:a}}const Id=25;function R0(e,t){const n=Gt(e),r=En(e),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,a=0,c=0;if(o){s=o.width,i=o.height;const l=Za();(!l||l&&t==="fixed")&&(a=o.offsetLeft,c=o.offsetTop)}const u=Ls(r);if(u<=0){const l=r.ownerDocument,f=l.body,d=getComputedStyle(f),h=l.compatMode==="CSS1Compat"&&parseFloat(d.marginLeft)+parseFloat(d.marginRight)||0,m=Math.abs(r.clientWidth-f.clientWidth-h);m<=Id&&(s-=m)}else u<=Id&&(s+=u);return{width:s,height:i,x:a,y:c}}const W0=new Set(["absolute","fixed"]);function z0(e,t){const n=Ar(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=Cn(e)?Xr(e):xn(1),i=e.clientWidth*s.x,a=e.clientHeight*s.y,c=o*s.x,u=r*s.y;return{width:i,height:a,x:c,y:u}}function Fd(e,t,n){let r;if(t==="viewport")r=R0(e,n);else if(t==="document")r=F0(En(e));else if(un(t))r=z0(t,n);else{const o=Pd(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Fs(r)}function Rd(e,t){const n=pr(e);return n===t||!un(n)||Kr(n)?!1:fn(n).position==="fixed"||Rd(n,t)}function L0(e,t){const n=t.get(e);if(n)return n;let r=Io(e,[],!1).filter(a=>un(a)&&qr(a)!=="body"),o=null;const s=fn(e).position==="fixed";let i=s?pr(e):e;for(;un(i)&&!Kr(i);){const a=fn(i),c=Ha(i);!c&&a.position==="fixed"&&(o=null),(s?!c&&!o:!c&&a.position==="static"&&!!o&&W0.has(o.position)||No(i)&&!c&&Rd(e,i))?r=r.filter(l=>l!==i):o=a,i=pr(i)}return t.set(e,r),r}function $0(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?Ws(t)?[]:L0(t,this._c):[].concat(n),r],a=i[0],c=i.reduce((u,l)=>{const f=Fd(t,l,o);return u.top=Zt(f.top,u.top),u.right=hr(f.right,u.right),u.bottom=hr(f.bottom,u.bottom),u.left=Zt(f.left,u.left),u},Fd(t,a,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function U0(e){const{width:t,height:n}=Md(e);return{width:t,height:n}}function Y0(e,t,n){const r=Cn(t),o=En(t),s=n==="fixed",i=Ar(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const c=xn(0);function u(){c.x=Ls(o)}if(r||!r&&!s)if((qr(t)!=="body"||No(o))&&(a=zs(t)),r){const h=Ar(t,!0,s,t);c.x=h.x+t.clientLeft,c.y=h.y+t.clientTop}else o&&u();s&&!r&&o&&u();const l=o&&!r&&!s?Nd(o,a):xn(0),f=i.left+a.scrollLeft-c.x-l.x,d=i.top+a.scrollTop-c.y-l.y;return{x:f,y:d,width:i.width,height:i.height}}function Ka(e){return fn(e).position==="static"}function Wd(e,t){if(!Cn(e)||fn(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return En(e)===n&&(n=n.ownerDocument.body),n}function zd(e,t){const n=Gt(e);if(Ws(e))return n;if(!Cn(e)){let o=pr(e);for(;o&&!Kr(o);){if(un(o)&&!Ka(o))return o;o=pr(o)}return n}let r=Wd(e,t);for(;r&&x0(r)&&Ka(r);)r=Wd(r,t);return r&&Kr(r)&&Ka(r)&&!Ha(r)?n:r||D0(e)||n}const j0=async function(e){const t=this.getOffsetParent||zd,n=this.getDimensions,r=await n(e.floating);return{reference:Y0(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function V0(e){return fn(e).direction==="rtl"}const B0={convertOffsetParentRelativeRectToViewportRelativeRect:N0,getDocumentElement:En,getClippingRect:$0,getOffsetParent:zd,getElementRects:j0,getClientRects:I0,getDimensions:U0,getScale:Xr,isElement:un,isRTL:V0};function Ld(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function H0(e,t){let n=null,r;const o=En(e);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function i(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),s();const u=e.getBoundingClientRect(),{left:l,top:f,width:d,height:h}=u;if(a||t(),!d||!h)return;const m=Ns(f),p=Ns(o.clientWidth-(l+d)),y=Ns(o.clientHeight-(f+h)),g=Ns(l),O={rootMargin:-m+"px "+-p+"px "+-y+"px "+-g+"px",threshold:Zt(0,hr(1,c))||1};let w=!0;function _(S){const I=S[0].intersectionRatio;if(I!==c){if(!w)return i();I?i(!1,I):r=setTimeout(()=>{i(!1,1e-7)},1e3)}I===1&&!Ld(u,e.getBoundingClientRect())&&i(),w=!1}try{n=new IntersectionObserver(_,{...O,root:o.ownerDocument})}catch{n=new IntersectionObserver(_,O)}n.observe(e)}return i(!0),s}function Z0(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,u=qa(e),l=o||s?[...u?Io(u):[],...Io(t)]:[];l.forEach(g=>{o&&g.addEventListener("scroll",n,{passive:!0}),s&&g.addEventListener("resize",n)});const f=u&&a?H0(u,n):null;let d=-1,h=null;i&&(h=new ResizeObserver(g=>{let[C]=g;C&&C.target===u&&h&&(h.unobserve(t),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var O;(O=h)==null||O.observe(t)})),n()}),u&&!c&&h.observe(u),h.observe(t));let m,p=c?Ar(e):null;c&&y();function y(){const g=Ar(e);p&&!Ld(p,g)&&n(),p=g,m=requestAnimationFrame(y)}return n(),()=>{var g;l.forEach(C=>{o&&C.removeEventListener("scroll",n),s&&C.removeEventListener("resize",n)}),f?.(),(g=h)==null||g.disconnect(),h=null,c&&cancelAnimationFrame(m)}}const G0=v0,q0=b0,K0=m0,X0=_0,J0=g0,$d=p0,Q0=w0,e1=(e,t,n)=>{const r=new Map,o={platform:B0,...n},s={...o.platform,_c:r};return h0(e,t,{...o,platform:s})};var t1=typeof document<"u",n1=function(){},$s=t1?j.useLayoutEffect:n1;function Us(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Us(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!Us(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Ud(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Yd(e,t){const n=Ud(e);return Math.round(t*n)/n}function Xa(e){const t=b.useRef(e);return $s(()=>{t.current=e}),t}function r1(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:a=!0,whileElementsMounted:c,open:u}=e,[l,f]=b.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[d,h]=b.useState(r);Us(d,r)||h(r);const[m,p]=b.useState(null),[y,g]=b.useState(null),C=b.useCallback(U=>{U!==S.current&&(S.current=U,p(U))},[]),O=b.useCallback(U=>{U!==I.current&&(I.current=U,g(U))},[]),w=s||m,_=i||y,S=b.useRef(null),I=b.useRef(null),v=b.useRef(l),x=c!=null,P=Xa(c),A=Xa(o),M=Xa(u),F=b.useCallback(()=>{if(!S.current||!I.current)return;const U={placement:t,strategy:n,middleware:d};A.current&&(U.platform=A.current),e1(S.current,I.current,U).then($=>{const D={...$,isPositioned:M.current!==!1};N.current&&!Us(v.current,D)&&(v.current=D,ms.flushSync(()=>{f(D)}))})},[d,t,n,A,M]);$s(()=>{u===!1&&v.current.isPositioned&&(v.current.isPositioned=!1,f(U=>({...U,isPositioned:!1})))},[u]);const N=b.useRef(!1);$s(()=>(N.current=!0,()=>{N.current=!1}),[]),$s(()=>{if(w&&(S.current=w),_&&(I.current=_),w&&_){if(P.current)return P.current(w,_,F);F()}},[w,_,F,P,x]);const W=b.useMemo(()=>({reference:S,floating:I,setReference:C,setFloating:O}),[C,O]),E=b.useMemo(()=>({reference:w,floating:_}),[w,_]),k=b.useMemo(()=>{const U={position:n,left:0,top:0};if(!E.floating)return U;const $=Yd(E.floating,l.x),D=Yd(E.floating,l.y);return a?{...U,transform:"translate("+$+"px, "+D+"px)",...Ud(E.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:$,top:D}},[n,a,E.floating,l.x,l.y]);return b.useMemo(()=>({...l,update:F,refs:W,elements:E,floatingStyles:k}),[l,F,W,E,k])}const o1=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?$d({element:r.current,padding:o}).fn(n):{}:r?$d({element:r,padding:o}).fn(n):{}}}},s1=(e,t)=>({...G0(e),options:[e,t]}),i1=(e,t)=>({...q0(e),options:[e,t]}),a1=(e,t)=>({...Q0(e),options:[e,t]}),c1=(e,t)=>({...K0(e),options:[e,t]}),l1=(e,t)=>({...X0(e),options:[e,t]}),u1=(e,t)=>({...J0(e),options:[e,t]}),f1=(e,t)=>({...o1(e),options:[e,t]});var d1="Arrow",jd=b.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...s}=e;return T.jsx(Ne.svg,{...s,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:T.jsx("polygon",{points:"0,0 30,0 15,10"})})});jd.displayName=d1;var h1=jd,Ja="Popper",[Vd,Ys]=Un(Ja),[p1,Bd]=Vd(Ja),Hd=e=>{const{__scopePopper:t,children:n}=e,[r,o]=b.useState(null);return T.jsx(p1,{scope:t,anchor:r,onAnchorChange:o,children:n})};Hd.displayName=Ja;var Zd="PopperAnchor",Gd=b.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,s=Bd(Zd,n),i=b.useRef(null),a=Ve(t,i),c=b.useRef(null);return b.useEffect(()=>{const u=c.current;c.current=r?.current||i.current,u!==c.current&&s.onAnchorChange(c.current)}),r?null:T.jsx(Ne.div,{...o,ref:a})});Gd.displayName=Zd;var Qa="PopperContent",[m1,g1]=Vd(Qa),qd=b.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:s="center",alignOffset:i=0,arrowPadding:a=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:l=0,sticky:f="partial",hideWhenDetached:d=!1,updatePositionStrategy:h="optimized",onPlaced:m,...p}=e,y=Bd(Qa,n),[g,C]=b.useState(null),O=Ve(t,q=>C(q)),[w,_]=b.useState(null),S=Ma(w),I=S?.width??0,v=S?.height??0,x=r+(s!=="center"?"-"+s:""),P=typeof l=="number"?l:{top:0,right:0,bottom:0,left:0,...l},A=Array.isArray(u)?u:[u],M=A.length>0,F={padding:P,boundary:A.filter(v1),altBoundary:M},{refs:N,floatingStyles:W,placement:E,isPositioned:k,middlewareData:U}=r1({strategy:"fixed",placement:x,whileElementsMounted:(...q)=>Z0(...q,{animationFrame:h==="always"}),elements:{reference:y.anchor},middleware:[s1({mainAxis:o+v,alignmentAxis:i}),c&&i1({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?a1():void 0,...F}),c&&c1({...F}),l1({...F,apply:({elements:q,rects:oe,availableWidth:Q,availableHeight:re})=>{const{width:le,height:K}=oe.reference,Se=q.floating.style;Se.setProperty("--radix-popper-available-width",`${Q}px`),Se.setProperty("--radix-popper-available-height",`${re}px`),Se.setProperty("--radix-popper-anchor-width",`${le}px`),Se.setProperty("--radix-popper-anchor-height",`${K}px`)}}),w&&f1({element:w,padding:a}),b1({arrowWidth:I,arrowHeight:v}),d&&u1({strategy:"referenceHidden",...F})]}),[$,D]=Jd(E),V=cr(m);Dt(()=>{k&&V?.()},[k,V]);const Z=U.arrow?.x,G=U.arrow?.y,B=U.arrow?.centerOffset!==0,[z,X]=b.useState();return Dt(()=>{g&&X(window.getComputedStyle(g).zIndex)},[g]),T.jsx("div",{ref:N.setFloating,"data-radix-popper-content-wrapper":"",style:{...W,transform:k?W.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:z,"--radix-popper-transform-origin":[U.transformOrigin?.x,U.transformOrigin?.y].join(" "),...U.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:T.jsx(m1,{scope:n,placedSide:$,onArrowChange:_,arrowX:Z,arrowY:G,shouldHideArrow:B,children:T.jsx(Ne.div,{"data-side":$,"data-align":D,...p,ref:O,style:{...p.style,animation:k?void 0:"none"}})})})});qd.displayName=Qa;var Kd="PopperArrow",y1={top:"bottom",right:"left",bottom:"top",left:"right"},Xd=b.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,s=g1(Kd,r),i=y1[s.placedSide];return T.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:T.jsx(h1,{...o,ref:n,style:{...o.style,display:"block"}})})});Xd.displayName=Kd;function v1(e){return e!==null}var b1=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:o}=t,i=o.arrow?.centerOffset!==0,a=i?0:e.arrowWidth,c=i?0:e.arrowHeight,[u,l]=Jd(n),f={start:"0%",center:"50%",end:"100%"}[l],d=(o.arrow?.x??0)+a/2,h=(o.arrow?.y??0)+c/2;let m="",p="";return u==="bottom"?(m=i?f:`${d}px`,p=`${-c}px`):u==="top"?(m=i?f:`${d}px`,p=`${r.floating.height+c}px`):u==="right"?(m=`${-c}px`,p=i?f:`${h}px`):u==="left"&&(m=`${r.floating.width+c}px`,p=i?f:`${h}px`),{data:{x:m,y:p}}}});function Jd(e){const[t,n="center"]=e.split("-");return[t,n]}var Qd=Hd,ec=Gd,eh=qd,th=Xd,w1="Portal",js=b.forwardRef((e,t)=>{const{container:n,...r}=e,[o,s]=b.useState(!1);Dt(()=>s(!0),[]);const i=n||o&&globalThis?.document?.body;return i?Pu.createPortal(T.jsx(Ne.div,{...r,ref:t}),i):null});js.displayName=w1;function _1(e){const t=S1(e),n=b.forwardRef((r,o)=>{const{children:s,...i}=r,a=b.Children.toArray(s),c=a.find(x1);if(c){const u=c.props.children,l=a.map(f=>f===c?b.Children.count(u)>1?b.Children.only(null):b.isValidElement(u)?u.props.children:null:f);return T.jsx(t,{...i,ref:o,children:b.isValidElement(u)?b.cloneElement(u,void 0,l):null})}return T.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function S1(e){const t=b.forwardRef((n,r)=>{const{children:o,...s}=n;if(b.isValidElement(o)){const i=E1(o),a=O1(s,o.props);return o.type!==b.Fragment&&(a.ref=r?Or(r,i):i),b.cloneElement(o,a)}return b.Children.count(o)>1?b.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var k1=Symbol("radix.slottable");function x1(e){return b.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===k1}function O1(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{const c=s(...a);return o(...a),c}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function E1(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var nh=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),C1="VisuallyHidden",T1=b.forwardRef((e,t)=>T.jsx(Ne.span,{...e,ref:t,style:{...nh,...e.style}}));T1.displayName=C1;var D1=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Jr=new WeakMap,Vs=new WeakMap,Bs={},tc=0,rh=function(e){return e&&(e.host||rh(e.parentNode))},A1=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=rh(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},M1=function(e,t,n,r){var o=A1(t,Array.isArray(e)?e:[e]);Bs[n]||(Bs[n]=new WeakMap);var s=Bs[n],i=[],a=new Set,c=new Set(o),u=function(f){!f||a.has(f)||(a.add(f),u(f.parentNode))};o.forEach(u);var l=function(f){!f||c.has(f)||Array.prototype.forEach.call(f.children,function(d){if(a.has(d))l(d);else try{var h=d.getAttribute(r),m=h!==null&&h!=="false",p=(Jr.get(d)||0)+1,y=(s.get(d)||0)+1;Jr.set(d,p),s.set(d,y),i.push(d),p===1&&m&&Vs.set(d,!0),y===1&&d.setAttribute(n,"true"),m||d.setAttribute(r,"true")}catch(g){console.error("aria-hidden: cannot operate on ",d,g)}})};return l(t),a.clear(),tc++,function(){i.forEach(function(f){var d=Jr.get(f)-1,h=s.get(f)-1;Jr.set(f,d),s.set(f,h),d||(Vs.has(f)||f.removeAttribute(r),Vs.delete(f)),h||f.removeAttribute(n)}),tc--,tc||(Jr=new WeakMap,Jr=new WeakMap,Vs=new WeakMap,Bs={})}},nc=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=D1(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),M1(r,o,n,"aria-hidden")):function(){return null}},Tn=function(){return Tn=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},Tn.apply(this,arguments)};function oh(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function P1(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,s;r<o;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var Hs="right-scroll-bar-position",Zs="width-before-scroll-bar",N1="with-scroll-bars-hidden",I1="--removed-body-scroll-bar-size";function rc(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function F1(e,t){var n=j.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var R1=typeof window<"u"?b.useLayoutEffect:b.useEffect,sh=new WeakMap;function W1(e,t){var n=F1(null,function(r){return e.forEach(function(o){return rc(o,r)})});return R1(function(){var r=sh.get(n);if(r){var o=new Set(r),s=new Set(e),i=n.current;o.forEach(function(a){s.has(a)||rc(a,null)}),s.forEach(function(a){o.has(a)||rc(a,i)})}sh.set(n,e)},[e]),n}function z1(e){return e}function L1(e,t){t===void 0&&(t=z1);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(s){var i=t(s,r);return n.push(i),function(){n=n.filter(function(a){return a!==i})}},assignSyncMedium:function(s){for(r=!0;n.length;){var i=n;n=[],i.forEach(s)}n={push:function(a){return s(a)},filter:function(){return n}}},assignMedium:function(s){r=!0;var i=[];if(n.length){var a=n;n=[],a.forEach(s),i=n}var c=function(){var l=i;i=[],l.forEach(s)},u=function(){return Promise.resolve().then(c)};u(),n={push:function(l){i.push(l),u()},filter:function(l){return i=i.filter(l),n}}}};return o}function $1(e){e===void 0&&(e={});var t=L1(null);return t.options=Tn({async:!0,ssr:!1},e),t}var ih=function(e){var t=e.sideCar,n=oh(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return b.createElement(r,Tn({},n))};ih.isSideCarExport=!0;function U1(e,t){return e.useMedium(t),ih}var ah=$1(),oc=function(){},Gs=b.forwardRef(function(e,t){var n=b.useRef(null),r=b.useState({onScrollCapture:oc,onWheelCapture:oc,onTouchMoveCapture:oc}),o=r[0],s=r[1],i=e.forwardProps,a=e.children,c=e.className,u=e.removeScrollBar,l=e.enabled,f=e.shards,d=e.sideCar,h=e.noRelative,m=e.noIsolation,p=e.inert,y=e.allowPinchZoom,g=e.as,C=g===void 0?"div":g,O=e.gapMode,w=oh(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),_=d,S=W1([n,t]),I=Tn(Tn({},w),o);return b.createElement(b.Fragment,null,l&&b.createElement(_,{sideCar:ah,removeScrollBar:u,shards:f,noRelative:h,noIsolation:m,inert:p,setCallbacks:s,allowPinchZoom:!!y,lockRef:n,gapMode:O}),i?b.cloneElement(b.Children.only(a),Tn(Tn({},I),{ref:S})):b.createElement(C,Tn({},I,{className:c,ref:S}),a))});Gs.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Gs.classNames={fullWidth:Zs,zeroRight:Hs};var Y1=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function j1(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Y1();return t&&e.setAttribute("nonce",t),e}function V1(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function B1(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var H1=function(){var e=0,t=null;return{add:function(n){e==0&&(t=j1())&&(V1(t,n),B1(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Z1=function(){var e=H1();return function(t,n){b.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},ch=function(){var e=Z1(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},G1={left:0,top:0,right:0,gap:0},sc=function(e){return parseInt(e||"",10)||0},q1=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[sc(n),sc(r),sc(o)]},K1=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return G1;var t=q1(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},X1=ch(),Qr="data-scroll-locked",J1=function(e,t,n,r){var o=e.left,s=e.top,i=e.right,a=e.gap;return n===void 0&&(n="margin"),`
2
+ .`.concat(N1,` {
3
+ overflow: hidden `).concat(r,`;
4
+ padding-right: `).concat(a,"px ").concat(r,`;
5
+ }
6
+ body[`).concat(Qr,`] {
7
+ overflow: hidden `).concat(r,`;
8
+ overscroll-behavior: contain;
9
+ `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
10
+ padding-left: `.concat(o,`px;
11
+ padding-top: `).concat(s,`px;
12
+ padding-right: `).concat(i,`px;
13
+ margin-left:0;
14
+ margin-top:0;
15
+ margin-right: `).concat(a,"px ").concat(r,`;
16
+ `),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),`
17
+ }
18
+
19
+ .`).concat(Hs,` {
20
+ right: `).concat(a,"px ").concat(r,`;
21
+ }
22
+
23
+ .`).concat(Zs,` {
24
+ margin-right: `).concat(a,"px ").concat(r,`;
25
+ }
26
+
27
+ .`).concat(Hs," .").concat(Hs,` {
28
+ right: 0 `).concat(r,`;
29
+ }
30
+
31
+ .`).concat(Zs," .").concat(Zs,` {
32
+ margin-right: 0 `).concat(r,`;
33
+ }
34
+
35
+ body[`).concat(Qr,`] {
36
+ `).concat(I1,": ").concat(a,`px;
37
+ }
38
+ `)},lh=function(){var e=parseInt(document.body.getAttribute(Qr)||"0",10);return isFinite(e)?e:0},Q1=function(){b.useEffect(function(){return document.body.setAttribute(Qr,(lh()+1).toString()),function(){var e=lh()-1;e<=0?document.body.removeAttribute(Qr):document.body.setAttribute(Qr,e.toString())}},[])},eS=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;Q1();var s=b.useMemo(function(){return K1(o)},[o]);return b.createElement(X1,{styles:J1(s,!t,o,n?"":"!important")})},ic=!1;if(typeof window<"u")try{var qs=Object.defineProperty({},"passive",{get:function(){return ic=!0,!0}});window.addEventListener("test",qs,qs),window.removeEventListener("test",qs,qs)}catch{ic=!1}var eo=ic?{passive:!1}:!1,tS=function(e){return e.tagName==="TEXTAREA"},uh=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!tS(e)&&n[t]==="visible")},nS=function(e){return uh(e,"overflowY")},rS=function(e){return uh(e,"overflowX")},fh=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=dh(e,r);if(o){var s=hh(e,r),i=s[1],a=s[2];if(i>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},oS=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},sS=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},dh=function(e,t){return e==="v"?nS(t):rS(t)},hh=function(e,t){return e==="v"?oS(t):sS(t)},iS=function(e,t){return e==="h"&&t==="rtl"?-1:1},aS=function(e,t,n,r,o){var s=iS(e,window.getComputedStyle(t).direction),i=s*r,a=n.target,c=t.contains(a),u=!1,l=i>0,f=0,d=0;do{if(!a)break;var h=hh(e,a),m=h[0],p=h[1],y=h[2],g=p-y-s*m;(m||g)&&dh(e,a)&&(f+=g,d+=m);var C=a.parentNode;a=C&&C.nodeType===Node.DOCUMENT_FRAGMENT_NODE?C.host:C}while(!c&&a!==document.body||c&&(t.contains(a)||t===a));return(l&&Math.abs(f)<1||!l&&Math.abs(d)<1)&&(u=!0),u},Ks=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},ph=function(e){return[e.deltaX,e.deltaY]},mh=function(e){return e&&"current"in e?e.current:e},cS=function(e,t){return e[0]===t[0]&&e[1]===t[1]},lS=function(e){return`
39
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
40
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
41
+ `)},uS=0,to=[];function fS(e){var t=b.useRef([]),n=b.useRef([0,0]),r=b.useRef(),o=b.useState(uS++)[0],s=b.useState(ch)[0],i=b.useRef(e);b.useEffect(function(){i.current=e},[e]),b.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var p=P1([e.lockRef.current],(e.shards||[]).map(mh),!0).filter(Boolean);return p.forEach(function(y){return y.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),p.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=b.useCallback(function(p,y){if("touches"in p&&p.touches.length===2||p.type==="wheel"&&p.ctrlKey)return!i.current.allowPinchZoom;var g=Ks(p),C=n.current,O="deltaX"in p?p.deltaX:C[0]-g[0],w="deltaY"in p?p.deltaY:C[1]-g[1],_,S=p.target,I=Math.abs(O)>Math.abs(w)?"h":"v";if("touches"in p&&I==="h"&&S.type==="range")return!1;var v=window.getSelection(),x=v&&v.anchorNode,P=x?x===S||x.contains(S):!1;if(P)return!1;var A=fh(I,S);if(!A)return!0;if(A?_=I:(_=I==="v"?"h":"v",A=fh(I,S)),!A)return!1;if(!r.current&&"changedTouches"in p&&(O||w)&&(r.current=_),!_)return!0;var M=r.current||_;return aS(M,y,p,M==="h"?O:w)},[]),c=b.useCallback(function(p){var y=p;if(!(!to.length||to[to.length-1]!==s)){var g="deltaY"in y?ph(y):Ks(y),C=t.current.filter(function(_){return _.name===y.type&&(_.target===y.target||y.target===_.shadowParent)&&cS(_.delta,g)})[0];if(C&&C.should){y.cancelable&&y.preventDefault();return}if(!C){var O=(i.current.shards||[]).map(mh).filter(Boolean).filter(function(_){return _.contains(y.target)}),w=O.length>0?a(y,O[0]):!i.current.noIsolation;w&&y.cancelable&&y.preventDefault()}}},[]),u=b.useCallback(function(p,y,g,C){var O={name:p,delta:y,target:g,should:C,shadowParent:dS(g)};t.current.push(O),setTimeout(function(){t.current=t.current.filter(function(w){return w!==O})},1)},[]),l=b.useCallback(function(p){n.current=Ks(p),r.current=void 0},[]),f=b.useCallback(function(p){u(p.type,ph(p),p.target,a(p,e.lockRef.current))},[]),d=b.useCallback(function(p){u(p.type,Ks(p),p.target,a(p,e.lockRef.current))},[]);b.useEffect(function(){return to.push(s),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:d}),document.addEventListener("wheel",c,eo),document.addEventListener("touchmove",c,eo),document.addEventListener("touchstart",l,eo),function(){to=to.filter(function(p){return p!==s}),document.removeEventListener("wheel",c,eo),document.removeEventListener("touchmove",c,eo),document.removeEventListener("touchstart",l,eo)}},[]);var h=e.removeScrollBar,m=e.inert;return b.createElement(b.Fragment,null,m?b.createElement(s,{styles:lS(o)}):null,h?b.createElement(eS,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function dS(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const hS=U1(ah,fS);var Xs=b.forwardRef(function(e,t){return b.createElement(Gs,Tn({},e,{ref:t,sideCar:hS}))});Xs.classNames=Gs.classNames;var pS=[" ","Enter","ArrowUp","ArrowDown"],mS=[" ","Enter"],Mr="Select",[Js,Qs,gS]=If(Mr),[no]=Un(Mr,[gS,Ys]),ei=Ys(),[yS,mr]=no(Mr),[vS,bS]=no(Mr),gh=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:s,value:i,defaultValue:a,onValueChange:c,dir:u,name:l,autoComplete:f,disabled:d,required:h,form:m}=e,p=ei(t),[y,g]=b.useState(null),[C,O]=b.useState(null),[w,_]=b.useState(!1),S=Ta(u),[I,v]=Dr({prop:r,defaultProp:o??!1,onChange:s,caller:Mr}),[x,P]=Dr({prop:i,defaultProp:a,onChange:c,caller:Mr}),A=b.useRef(null),M=y?m||!!y.closest("form"):!0,[F,N]=b.useState(new Set),W=Array.from(F).map(E=>E.props.value).join(";");return T.jsx(Qd,{...p,children:T.jsxs(yS,{required:h,scope:t,trigger:y,onTriggerChange:g,valueNode:C,onValueNodeChange:O,valueNodeHasChildren:w,onValueNodeHasChildrenChange:_,contentId:ar(),value:x,onValueChange:P,open:I,onOpenChange:v,dir:S,triggerPointerDownPosRef:A,disabled:d,children:[T.jsx(Js.Provider,{scope:t,children:T.jsx(vS,{scope:e.__scopeSelect,onNativeOptionAdd:b.useCallback(E=>{N(k=>new Set(k).add(E))},[]),onNativeOptionRemove:b.useCallback(E=>{N(k=>{const U=new Set(k);return U.delete(E),U})},[]),children:n})}),M?T.jsxs(zh,{"aria-hidden":!0,required:h,tabIndex:-1,name:l,autoComplete:f,value:x,onChange:E=>P(E.target.value),disabled:d,form:m,children:[x===void 0?T.jsx("option",{value:""}):null,Array.from(F)]},W):null]})})};gh.displayName=Mr;var yh="SelectTrigger",vh=b.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,s=ei(n),i=mr(yh,n),a=i.disabled||r,c=Ve(t,i.onTriggerChange),u=Qs(n),l=b.useRef("touch"),[f,d,h]=$h(p=>{const y=u().filter(O=>!O.disabled),g=y.find(O=>O.value===i.value),C=Uh(y,p,g);C!==void 0&&i.onValueChange(C.value)}),m=p=>{a||(i.onOpenChange(!0),h()),p&&(i.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return T.jsx(ec,{asChild:!0,...s,children:T.jsx(Ne.button,{type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":Lh(i.value)?"":void 0,...o,ref:c,onClick:Ce(o.onClick,p=>{p.currentTarget.focus(),l.current!=="mouse"&&m(p)}),onPointerDown:Ce(o.onPointerDown,p=>{l.current=p.pointerType;const y=p.target;y.hasPointerCapture(p.pointerId)&&y.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(m(p),p.preventDefault())}),onKeyDown:Ce(o.onKeyDown,p=>{const y=f.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&d(p.key),!(y&&p.key===" ")&&pS.includes(p.key)&&(m(),p.preventDefault())})})})});vh.displayName=yh;var bh="SelectValue",wh=b.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:s,placeholder:i="",...a}=e,c=mr(bh,n),{onValueNodeHasChildrenChange:u}=c,l=s!==void 0,f=Ve(t,c.onValueNodeChange);return Dt(()=>{u(l)},[u,l]),T.jsx(Ne.span,{...a,ref:f,style:{pointerEvents:"none"},children:Lh(c.value)?T.jsx(T.Fragment,{children:i}):s})});wh.displayName=bh;var wS="SelectIcon",_h=b.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return T.jsx(Ne.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});_h.displayName=wS;var _S="SelectPortal",Sh=e=>T.jsx(js,{asChild:!0,...e});Sh.displayName=_S;var Pr="SelectContent",kh=b.forwardRef((e,t)=>{const n=mr(Pr,e.__scopeSelect),[r,o]=b.useState();if(Dt(()=>{o(new DocumentFragment)},[]),!n.open){const s=r;return s?ms.createPortal(T.jsx(xh,{scope:e.__scopeSelect,children:T.jsx(Js.Slot,{scope:e.__scopeSelect,children:T.jsx("div",{children:e.children})})}),s):null}return T.jsx(Oh,{...e,ref:t})});kh.displayName=Pr;var dn=10,[xh,gr]=no(Pr),SS="SelectContentImpl",kS=_1("SelectContent.RemoveScroll"),Oh=b.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:s,onPointerDownOutside:i,side:a,sideOffset:c,align:u,alignOffset:l,arrowPadding:f,collisionBoundary:d,collisionPadding:h,sticky:m,hideWhenDetached:p,avoidCollisions:y,...g}=e,C=mr(Pr,n),[O,w]=b.useState(null),[_,S]=b.useState(null),I=Ve(t,q=>w(q)),[v,x]=b.useState(null),[P,A]=b.useState(null),M=Qs(n),[F,N]=b.useState(!1),W=b.useRef(!1);b.useEffect(()=>{if(O)return nc(O)},[O]),za();const E=b.useCallback(q=>{const[oe,...Q]=M().map(K=>K.ref.current),[re]=Q.slice(-1),le=document.activeElement;for(const K of q)if(K===le||(K?.scrollIntoView({block:"nearest"}),K===oe&&_&&(_.scrollTop=0),K===re&&_&&(_.scrollTop=_.scrollHeight),K?.focus(),document.activeElement!==le))return},[M,_]),k=b.useCallback(()=>E([v,O]),[E,v,O]);b.useEffect(()=>{F&&k()},[F,k]);const{onOpenChange:U,triggerPointerDownPosRef:$}=C;b.useEffect(()=>{if(O){let q={x:0,y:0};const oe=re=>{q={x:Math.abs(Math.round(re.pageX)-($.current?.x??0)),y:Math.abs(Math.round(re.pageY)-($.current?.y??0))}},Q=re=>{q.x<=10&&q.y<=10?re.preventDefault():O.contains(re.target)||U(!1),document.removeEventListener("pointermove",oe),$.current=null};return $.current!==null&&(document.addEventListener("pointermove",oe),document.addEventListener("pointerup",Q,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",oe),document.removeEventListener("pointerup",Q,{capture:!0})}}},[O,U,$]),b.useEffect(()=>{const q=()=>U(!1);return window.addEventListener("blur",q),window.addEventListener("resize",q),()=>{window.removeEventListener("blur",q),window.removeEventListener("resize",q)}},[U]);const[D,V]=$h(q=>{const oe=M().filter(le=>!le.disabled),Q=oe.find(le=>le.ref.current===document.activeElement),re=Uh(oe,q,Q);re&&setTimeout(()=>re.ref.current.focus())}),Z=b.useCallback((q,oe,Q)=>{const re=!W.current&&!Q;(C.value!==void 0&&C.value===oe||re)&&(x(q),re&&(W.current=!0))},[C.value]),G=b.useCallback(()=>O?.focus(),[O]),B=b.useCallback((q,oe,Q)=>{const re=!W.current&&!Q;(C.value!==void 0&&C.value===oe||re)&&A(q)},[C.value]),z=r==="popper"?ac:Eh,X=z===ac?{side:a,sideOffset:c,align:u,alignOffset:l,arrowPadding:f,collisionBoundary:d,collisionPadding:h,sticky:m,hideWhenDetached:p,avoidCollisions:y}:{};return T.jsx(xh,{scope:n,content:O,viewport:_,onViewportChange:S,itemRefCallback:Z,selectedItem:v,onItemLeave:G,itemTextRefCallback:B,focusSelectedItem:k,selectedItemText:P,position:r,isPositioned:F,searchRef:D,children:T.jsx(Xs,{as:kS,allowPinchZoom:!0,children:T.jsx(Ms,{asChild:!0,trapped:C.open,onMountAutoFocus:q=>{q.preventDefault()},onUnmountAutoFocus:Ce(o,q=>{C.trigger?.focus({preventScroll:!0}),q.preventDefault()}),children:T.jsx(As,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:q=>q.preventDefault(),onDismiss:()=>C.onOpenChange(!1),children:T.jsx(z,{role:"listbox",id:C.contentId,"data-state":C.open?"open":"closed",dir:C.dir,onContextMenu:q=>q.preventDefault(),...g,...X,onPlaced:()=>N(!0),ref:I,style:{display:"flex",flexDirection:"column",outline:"none",...g.style},onKeyDown:Ce(g.onKeyDown,q=>{const oe=q.ctrlKey||q.altKey||q.metaKey;if(q.key==="Tab"&&q.preventDefault(),!oe&&q.key.length===1&&V(q.key),["ArrowUp","ArrowDown","Home","End"].includes(q.key)){let re=M().filter(le=>!le.disabled).map(le=>le.ref.current);if(["ArrowUp","End"].includes(q.key)&&(re=re.slice().reverse()),["ArrowUp","ArrowDown"].includes(q.key)){const le=q.target,K=re.indexOf(le);re=re.slice(K+1)}setTimeout(()=>E(re)),q.preventDefault()}})})})})})})});Oh.displayName=SS;var xS="SelectItemAlignedPosition",Eh=b.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,s=mr(Pr,n),i=gr(Pr,n),[a,c]=b.useState(null),[u,l]=b.useState(null),f=Ve(t,I=>l(I)),d=Qs(n),h=b.useRef(!1),m=b.useRef(!0),{viewport:p,selectedItem:y,selectedItemText:g,focusSelectedItem:C}=i,O=b.useCallback(()=>{if(s.trigger&&s.valueNode&&a&&u&&p&&y&&g){const I=s.trigger.getBoundingClientRect(),v=u.getBoundingClientRect(),x=s.valueNode.getBoundingClientRect(),P=g.getBoundingClientRect();if(s.dir!=="rtl"){const le=P.left-v.left,K=x.left-le,Se=I.left-K,Ie=I.width+Se,ke=Math.max(Ie,v.width),Ge=window.innerWidth-dn,Re=ud(K,[dn,Math.max(dn,Ge-ke)]);a.style.minWidth=Ie+"px",a.style.left=Re+"px"}else{const le=v.right-P.right,K=window.innerWidth-x.right-le,Se=window.innerWidth-I.right-K,Ie=I.width+Se,ke=Math.max(Ie,v.width),Ge=window.innerWidth-dn,Re=ud(K,[dn,Math.max(dn,Ge-ke)]);a.style.minWidth=Ie+"px",a.style.right=Re+"px"}const A=d(),M=window.innerHeight-dn*2,F=p.scrollHeight,N=window.getComputedStyle(u),W=parseInt(N.borderTopWidth,10),E=parseInt(N.paddingTop,10),k=parseInt(N.borderBottomWidth,10),U=parseInt(N.paddingBottom,10),$=W+E+F+U+k,D=Math.min(y.offsetHeight*5,$),V=window.getComputedStyle(p),Z=parseInt(V.paddingTop,10),G=parseInt(V.paddingBottom,10),B=I.top+I.height/2-dn,z=M-B,X=y.offsetHeight/2,q=y.offsetTop+X,oe=W+E+q,Q=$-oe;if(oe<=B){const le=A.length>0&&y===A[A.length-1].ref.current;a.style.bottom="0px";const K=u.clientHeight-p.offsetTop-p.offsetHeight,Se=Math.max(z,X+(le?G:0)+K+k),Ie=oe+Se;a.style.height=Ie+"px"}else{const le=A.length>0&&y===A[0].ref.current;a.style.top="0px";const Se=Math.max(B,W+p.offsetTop+(le?Z:0)+X)+Q;a.style.height=Se+"px",p.scrollTop=oe-B+p.offsetTop}a.style.margin=`${dn}px 0`,a.style.minHeight=D+"px",a.style.maxHeight=M+"px",r?.(),requestAnimationFrame(()=>h.current=!0)}},[d,s.trigger,s.valueNode,a,u,p,y,g,s.dir,r]);Dt(()=>O(),[O]);const[w,_]=b.useState();Dt(()=>{u&&_(window.getComputedStyle(u).zIndex)},[u]);const S=b.useCallback(I=>{I&&m.current===!0&&(O(),C?.(),m.current=!1)},[O,C]);return T.jsx(ES,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:h,onScrollButtonChange:S,children:T.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:w},children:T.jsx(Ne.div,{...o,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});Eh.displayName=xS;var OS="SelectPopperPosition",ac=b.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=dn,...s}=e,i=ei(n);return T.jsx(eh,{...i,...s,ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...s.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});ac.displayName=OS;var[ES,cc]=no(Pr,{}),lc="SelectViewport",Ch=b.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,s=gr(lc,n),i=cc(lc,n),a=Ve(t,s.onViewportChange),c=b.useRef(0);return T.jsxs(T.Fragment,{children:[T.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),T.jsx(Js.Slot,{scope:n,children:T.jsx(Ne.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:Ce(o.onScroll,u=>{const l=u.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:d}=i;if(d?.current&&f){const h=Math.abs(c.current-l.scrollTop);if(h>0){const m=window.innerHeight-dn*2,p=parseFloat(f.style.minHeight),y=parseFloat(f.style.height),g=Math.max(p,y);if(g<m){const C=g+h,O=Math.min(m,C),w=C-O;f.style.height=O+"px",f.style.bottom==="0px"&&(l.scrollTop=w>0?w:0,f.style.justifyContent="flex-end")}}}c.current=l.scrollTop})})})]})});Ch.displayName=lc;var Th="SelectGroup",[CS,TS]=no(Th),DS=b.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=ar();return T.jsx(CS,{scope:n,id:o,children:T.jsx(Ne.div,{role:"group","aria-labelledby":o,...r,ref:t})})});DS.displayName=Th;var Dh="SelectLabel",AS=b.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=TS(Dh,n);return T.jsx(Ne.div,{id:o.id,...r,ref:t})});AS.displayName=Dh;var ti="SelectItem",[MS,Ah]=no(ti),Mh=b.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:s,...i}=e,a=mr(ti,n),c=gr(ti,n),u=a.value===r,[l,f]=b.useState(s??""),[d,h]=b.useState(!1),m=Ve(t,C=>c.itemRefCallback?.(C,r,o)),p=ar(),y=b.useRef("touch"),g=()=>{o||(a.onValueChange(r),a.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return T.jsx(MS,{scope:n,value:r,disabled:o,textId:p,isSelected:u,onItemTextChange:b.useCallback(C=>{f(O=>O||(C?.textContent??"").trim())},[]),children:T.jsx(Js.ItemSlot,{scope:n,value:r,disabled:o,textValue:l,children:T.jsx(Ne.div,{role:"option","aria-labelledby":p,"data-highlighted":d?"":void 0,"aria-selected":u&&d,"data-state":u?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...i,ref:m,onFocus:Ce(i.onFocus,()=>h(!0)),onBlur:Ce(i.onBlur,()=>h(!1)),onClick:Ce(i.onClick,()=>{y.current!=="mouse"&&g()}),onPointerUp:Ce(i.onPointerUp,()=>{y.current==="mouse"&&g()}),onPointerDown:Ce(i.onPointerDown,C=>{y.current=C.pointerType}),onPointerMove:Ce(i.onPointerMove,C=>{y.current=C.pointerType,o?c.onItemLeave?.():y.current==="mouse"&&C.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ce(i.onPointerLeave,C=>{C.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:Ce(i.onKeyDown,C=>{c.searchRef?.current!==""&&C.key===" "||(mS.includes(C.key)&&g(),C.key===" "&&C.preventDefault())})})})})});Mh.displayName=ti;var Fo="SelectItemText",Ph=b.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...s}=e,i=mr(Fo,n),a=gr(Fo,n),c=Ah(Fo,n),u=bS(Fo,n),[l,f]=b.useState(null),d=Ve(t,g=>f(g),c.onItemTextChange,g=>a.itemTextRefCallback?.(g,c.value,c.disabled)),h=l?.textContent,m=b.useMemo(()=>T.jsx("option",{value:c.value,disabled:c.disabled,children:h},c.value),[c.disabled,c.value,h]),{onNativeOptionAdd:p,onNativeOptionRemove:y}=u;return Dt(()=>(p(m),()=>y(m)),[p,y,m]),T.jsxs(T.Fragment,{children:[T.jsx(Ne.span,{id:c.textId,...s,ref:d}),c.isSelected&&i.valueNode&&!i.valueNodeHasChildren?ms.createPortal(s.children,i.valueNode):null]})});Ph.displayName=Fo;var Nh="SelectItemIndicator",Ih=b.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return Ah(Nh,n).isSelected?T.jsx(Ne.span,{"aria-hidden":!0,...r,ref:t}):null});Ih.displayName=Nh;var uc="SelectScrollUpButton",Fh=b.forwardRef((e,t)=>{const n=gr(uc,e.__scopeSelect),r=cc(uc,e.__scopeSelect),[o,s]=b.useState(!1),i=Ve(t,r.onScrollButtonChange);return Dt(()=>{if(n.viewport&&n.isPositioned){let a=function(){const u=c.scrollTop>0;s(u)};const c=n.viewport;return a(),c.addEventListener("scroll",a),()=>c.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?T.jsx(Wh,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=n;a&&c&&(a.scrollTop=a.scrollTop-c.offsetHeight)}}):null});Fh.displayName=uc;var fc="SelectScrollDownButton",Rh=b.forwardRef((e,t)=>{const n=gr(fc,e.__scopeSelect),r=cc(fc,e.__scopeSelect),[o,s]=b.useState(!1),i=Ve(t,r.onScrollButtonChange);return Dt(()=>{if(n.viewport&&n.isPositioned){let a=function(){const u=c.scrollHeight-c.clientHeight,l=Math.ceil(c.scrollTop)<u;s(l)};const c=n.viewport;return a(),c.addEventListener("scroll",a),()=>c.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?T.jsx(Wh,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=n;a&&c&&(a.scrollTop=a.scrollTop+c.offsetHeight)}}):null});Rh.displayName=fc;var Wh=b.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,s=gr("SelectScrollButton",n),i=b.useRef(null),a=Qs(n),c=b.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return b.useEffect(()=>()=>c(),[c]),Dt(()=>{a().find(l=>l.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[a]),T.jsx(Ne.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:Ce(o.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(r,50))}),onPointerMove:Ce(o.onPointerMove,()=>{s.onItemLeave?.(),i.current===null&&(i.current=window.setInterval(r,50))}),onPointerLeave:Ce(o.onPointerLeave,()=>{c()})})}),PS="SelectSeparator",NS=b.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return T.jsx(Ne.div,{"aria-hidden":!0,...r,ref:t})});NS.displayName=PS;var dc="SelectArrow",IS=b.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=ei(n),s=mr(dc,n),i=gr(dc,n);return s.open&&i.position==="popper"?T.jsx(th,{...o,...r,ref:t}):null});IS.displayName=dc;var FS="SelectBubbleInput",zh=b.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const o=b.useRef(null),s=Ve(r,o),i=Pa(t);return b.useEffect(()=>{const a=o.current;if(!a)return;const c=window.HTMLSelectElement.prototype,l=Object.getOwnPropertyDescriptor(c,"value").set;if(i!==t&&l){const f=new Event("change",{bubbles:!0});l.call(a,t),a.dispatchEvent(f)}},[i,t]),T.jsx(Ne.select,{...n,style:{...nh,...n.style},ref:s,defaultValue:t})});zh.displayName=FS;function Lh(e){return e===""||e===void 0}function $h(e){const t=cr(e),n=b.useRef(""),r=b.useRef(0),o=b.useCallback(i=>{const a=n.current+i;t(a),(function c(u){n.current=u,window.clearTimeout(r.current),u!==""&&(r.current=window.setTimeout(()=>c(""),1e3))})(a)},[t]),s=b.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return b.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,s]}function Uh(e,t,n){const o=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let i=RS(e,Math.max(s,0));o.length===1&&(i=i.filter(u=>u!==n));const c=i.find(u=>u.textValue.toLowerCase().startsWith(o.toLowerCase()));return c!==n?c:void 0}function RS(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var WS=gh,zS=vh,LS=wh,$S=_h,US=Sh,YS=kh,jS=Ch,VS=Mh,BS=Ph,HS=Ih,ZS=Fh,GS=Rh;function qS({...e}){return T.jsx(WS,{"data-slot":"select",...e})}function KS({...e}){return T.jsx(LS,{"data-slot":"select-value",...e})}function XS({className:e,size:t="default",children:n,...r}){return T.jsxs(zS,{"data-slot":"select-trigger","data-size":t,className:Tt("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r,children:[n,T.jsx($S,{asChild:!0,children:T.jsx(Ia,{className:"size-4 opacity-50"})})]})}function JS({className:e,children:t,position:n="popper",...r}){return T.jsx(US,{children:T.jsxs(YS,{"data-slot":"select-content",className:Tt("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[T.jsx(ek,{}),T.jsx(jS,{className:Tt("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),T.jsx(tk,{})]})})}function QS({className:e,children:t,...n}){return T.jsxs(VS,{"data-slot":"select-item",className:Tt("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...n,children:[T.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:T.jsx(HS,{children:T.jsx(td,{className:"size-4"})})}),T.jsx(BS,{children:t})]})}function ek({className:e,...t}){return T.jsx(ZS,{"data-slot":"select-scroll-up-button",className:Tt("flex cursor-default items-center justify-center py-1",e),...t,children:T.jsx(T_,{className:"size-4"})})}function tk({className:e,...t}){return T.jsx(GS,{"data-slot":"select-scroll-down-button",className:Tt("flex cursor-default items-center justify-center py-1",e),...t,children:T.jsx(Ia,{className:"size-4"})})}const nk=(e={})=>{const{field:t={},form:n={},question:r={},disabled:o=!1}=e,{options:s=[]}=r;return T.jsxs(qS,{onValueChange:t.onChange,value:t.value,disabled:o,className:"bq-select",children:[T.jsx(Es,{className:"w-full",children:T.jsx(XS,{children:T.jsx(KS,{placeholder:r.placeholder||"Please select"})})}),T.jsx(JS,{children:s.map((i,a)=>T.jsx(QS,{value:i.value,children:i.label},a))})]})};var Yh;function ce(){return Yh.apply(null,arguments)}function rk(e){Yh=e}function hn(e){return e instanceof Array||Object.prototype.toString.call(e)==="[object Array]"}function Nr(e){return e!=null&&Object.prototype.toString.call(e)==="[object Object]"}function $e(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function hc(e){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(e).length===0;var t;for(t in e)if($e(e,t))return!1;return!0}function Ut(e){return e===void 0}function Vn(e){return typeof e=="number"||Object.prototype.toString.call(e)==="[object Number]"}function Ro(e){return e instanceof Date||Object.prototype.toString.call(e)==="[object Date]"}function jh(e,t){var n=[],r,o=e.length;for(r=0;r<o;++r)n.push(t(e[r],r));return n}function yr(e,t){for(var n in t)$e(t,n)&&(e[n]=t[n]);return $e(t,"toString")&&(e.toString=t.toString),$e(t,"valueOf")&&(e.valueOf=t.valueOf),e}function Dn(e,t,n,r){return gp(e,t,n,r,!0).utc()}function ok(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function Te(e){return e._pf==null&&(e._pf=ok()),e._pf}var pc;Array.prototype.some?pc=Array.prototype.some:pc=function(e){var t=Object(this),n=t.length>>>0,r;for(r=0;r<n;r++)if(r in t&&e.call(this,t[r],r,t))return!0;return!1};function mc(e){var t=null,n=!1,r=e._d&&!isNaN(e._d.getTime());if(r&&(t=Te(e),n=pc.call(t.parsedDateParts,function(o){return o!=null}),r=t.overflow<0&&!t.empty&&!t.invalidEra&&!t.invalidMonth&&!t.invalidWeekday&&!t.weekdayMismatch&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&n),e._strict&&(r=r&&t.charsLeftOver===0&&t.unusedTokens.length===0&&t.bigHour===void 0)),Object.isFrozen==null||!Object.isFrozen(e))e._isValid=r;else return r;return e._isValid}function ni(e){var t=Dn(NaN);return e!=null?yr(Te(t),e):Te(t).userInvalidated=!0,t}var Vh=ce.momentProperties=[],gc=!1;function yc(e,t){var n,r,o,s=Vh.length;if(Ut(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),Ut(t._i)||(e._i=t._i),Ut(t._f)||(e._f=t._f),Ut(t._l)||(e._l=t._l),Ut(t._strict)||(e._strict=t._strict),Ut(t._tzm)||(e._tzm=t._tzm),Ut(t._isUTC)||(e._isUTC=t._isUTC),Ut(t._offset)||(e._offset=t._offset),Ut(t._pf)||(e._pf=Te(t)),Ut(t._locale)||(e._locale=t._locale),s>0)for(n=0;n<s;n++)r=Vh[n],o=t[r],Ut(o)||(e[r]=o);return e}function Wo(e){yc(this,e),this._d=new Date(e._d!=null?e._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),gc===!1&&(gc=!0,ce.updateOffset(this),gc=!1)}function pn(e){return e instanceof Wo||e!=null&&e._isAMomentObject!=null}function Bh(e){ce.suppressDeprecationWarnings===!1&&typeof console<"u"&&console.warn&&console.warn("Deprecation warning: "+e)}function en(e,t){var n=!0;return yr(function(){if(ce.deprecationHandler!=null&&ce.deprecationHandler(null,e),n){var r=[],o,s,i,a=arguments.length;for(s=0;s<a;s++){if(o="",typeof arguments[s]=="object"){o+=`
42
+ [`+s+"] ";for(i in arguments[0])$e(arguments[0],i)&&(o+=i+": "+arguments[0][i]+", ");o=o.slice(0,-2)}else o=arguments[s];r.push(o)}Bh(e+`
43
+ Arguments: `+Array.prototype.slice.call(r).join("")+`
44
+ `+new Error().stack),n=!1}return t.apply(this,arguments)},t)}var Hh={};function Zh(e,t){ce.deprecationHandler!=null&&ce.deprecationHandler(e,t),Hh[e]||(Bh(t),Hh[e]=!0)}ce.suppressDeprecationWarnings=!1,ce.deprecationHandler=null;function An(e){return typeof Function<"u"&&e instanceof Function||Object.prototype.toString.call(e)==="[object Function]"}function sk(e){var t,n;for(n in e)$e(e,n)&&(t=e[n],An(t)?this[n]=t:this["_"+n]=t);this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function vc(e,t){var n=yr({},e),r;for(r in t)$e(t,r)&&(Nr(e[r])&&Nr(t[r])?(n[r]={},yr(n[r],e[r]),yr(n[r],t[r])):t[r]!=null?n[r]=t[r]:delete n[r]);for(r in e)$e(e,r)&&!$e(t,r)&&Nr(e[r])&&(n[r]=yr({},n[r]));return n}function bc(e){e!=null&&this.set(e)}var wc;Object.keys?wc=Object.keys:wc=function(e){var t,n=[];for(t in e)$e(e,t)&&n.push(t);return n};var ik={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function ak(e,t,n){var r=this._calendar[e]||this._calendar.sameElse;return An(r)?r.call(t,n):r}function Mn(e,t,n){var r=""+Math.abs(e),o=t-r.length,s=e>=0;return(s?n?"+":"":"-")+Math.pow(10,Math.max(0,o)).toString().substr(1)+r}var _c=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,ri=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Sc={},ro={};function ge(e,t,n,r){var o=r;typeof r=="string"&&(o=function(){return this[r]()}),e&&(ro[e]=o),t&&(ro[t[0]]=function(){return Mn(o.apply(this,arguments),t[1],t[2])}),n&&(ro[n]=function(){return this.localeData().ordinal(o.apply(this,arguments),e)})}function ck(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function lk(e){var t=e.match(_c),n,r;for(n=0,r=t.length;n<r;n++)ro[t[n]]?t[n]=ro[t[n]]:t[n]=ck(t[n]);return function(o){var s="",i;for(i=0;i<r;i++)s+=An(t[i])?t[i].call(o,e):t[i];return s}}function oi(e,t){return e.isValid()?(t=Gh(t,e.localeData()),Sc[t]=Sc[t]||lk(t),Sc[t](e)):e.localeData().invalidDate()}function Gh(e,t){var n=5;function r(o){return t.longDateFormat(o)||o}for(ri.lastIndex=0;n>=0&&ri.test(e);)e=e.replace(ri,r),ri.lastIndex=0,n-=1;return e}var uk={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function fk(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.match(_c).map(function(r){return r==="MMMM"||r==="MM"||r==="DD"||r==="dddd"?r.slice(1):r}).join(""),this._longDateFormat[e])}var dk="Invalid date";function hk(){return this._invalidDate}var pk="%d",mk=/\d{1,2}/;function gk(e){return this._ordinal.replace("%d",e)}var yk={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function vk(e,t,n,r){var o=this._relativeTime[n];return An(o)?o(e,t,n,r):o.replace(/%d/i,e)}function bk(e,t){var n=this._relativeTime[e>0?"future":"past"];return An(n)?n(t):n.replace(/%s/i,t)}var qh={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function tn(e){return typeof e=="string"?qh[e]||qh[e.toLowerCase()]:void 0}function kc(e){var t={},n,r;for(r in e)$e(e,r)&&(n=tn(r),n&&(t[n]=e[r]));return t}var wk={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function _k(e){var t=[],n;for(n in e)$e(e,n)&&t.push({unit:n,priority:wk[n]});return t.sort(function(r,o){return r.priority-o.priority}),t}var Kh=/\d/,qt=/\d\d/,Xh=/\d{3}/,xc=/\d{4}/,si=/[+-]?\d{6}/,et=/\d\d?/,Jh=/\d\d\d\d?/,Qh=/\d\d\d\d\d\d?/,ii=/\d{1,3}/,Oc=/\d{1,4}/,ai=/[+-]?\d{1,6}/,oo=/\d+/,ci=/[+-]?\d+/,Sk=/Z|[+-]\d\d:?\d\d/gi,li=/Z|[+-]\d\d(?::?\d\d)?/gi,kk=/[+-]?\d+(\.\d{1,3})?/,zo=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,so=/^[1-9]\d?/,Ec=/^([1-9]\d|\d)/,ui;ui={};function fe(e,t,n){ui[e]=An(t)?t:function(r,o){return r&&n?n:t}}function xk(e,t){return $e(ui,e)?ui[e](t._strict,t._locale):new RegExp(Ok(e))}function Ok(e){return Bn(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,n,r,o,s){return n||r||o||s}))}function Bn(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function nn(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function Fe(e){var t=+e,n=0;return t!==0&&isFinite(t)&&(n=nn(t)),n}var Cc={};function qe(e,t){var n,r=t,o;for(typeof e=="string"&&(e=[e]),Vn(t)&&(r=function(s,i){i[t]=Fe(s)}),o=e.length,n=0;n<o;n++)Cc[e[n]]=r}function Lo(e,t){qe(e,function(n,r,o,s){o._w=o._w||{},t(n,o._w,o,s)})}function Ek(e,t,n){t!=null&&$e(Cc,e)&&Cc[e](t,n._a,n,e)}function fi(e){return e%4===0&&e%100!==0||e%400===0}var At=0,Hn=1,Pn=2,kt=3,mn=4,Zn=5,Ir=6,Ck=7,Tk=8;ge("Y",0,0,function(){var e=this.year();return e<=9999?Mn(e,4):"+"+e}),ge(0,["YY",2],0,function(){return this.year()%100}),ge(0,["YYYY",4],0,"year"),ge(0,["YYYYY",5],0,"year"),ge(0,["YYYYYY",6,!0],0,"year"),fe("Y",ci),fe("YY",et,qt),fe("YYYY",Oc,xc),fe("YYYYY",ai,si),fe("YYYYYY",ai,si),qe(["YYYYY","YYYYYY"],At),qe("YYYY",function(e,t){t[At]=e.length===2?ce.parseTwoDigitYear(e):Fe(e)}),qe("YY",function(e,t){t[At]=ce.parseTwoDigitYear(e)}),qe("Y",function(e,t){t[At]=parseInt(e,10)});function $o(e){return fi(e)?366:365}ce.parseTwoDigitYear=function(e){return Fe(e)+(Fe(e)>68?1900:2e3)};var ep=io("FullYear",!0);function Dk(){return fi(this.year())}function io(e,t){return function(n){return n!=null?(tp(this,e,n),ce.updateOffset(this,t),this):Uo(this,e)}}function Uo(e,t){if(!e.isValid())return NaN;var n=e._d,r=e._isUTC;switch(t){case"Milliseconds":return r?n.getUTCMilliseconds():n.getMilliseconds();case"Seconds":return r?n.getUTCSeconds():n.getSeconds();case"Minutes":return r?n.getUTCMinutes():n.getMinutes();case"Hours":return r?n.getUTCHours():n.getHours();case"Date":return r?n.getUTCDate():n.getDate();case"Day":return r?n.getUTCDay():n.getDay();case"Month":return r?n.getUTCMonth():n.getMonth();case"FullYear":return r?n.getUTCFullYear():n.getFullYear();default:return NaN}}function tp(e,t,n){var r,o,s,i,a;if(!(!e.isValid()||isNaN(n))){switch(r=e._d,o=e._isUTC,t){case"Milliseconds":return void(o?r.setUTCMilliseconds(n):r.setMilliseconds(n));case"Seconds":return void(o?r.setUTCSeconds(n):r.setSeconds(n));case"Minutes":return void(o?r.setUTCMinutes(n):r.setMinutes(n));case"Hours":return void(o?r.setUTCHours(n):r.setHours(n));case"Date":return void(o?r.setUTCDate(n):r.setDate(n));case"FullYear":break;default:return}s=n,i=e.month(),a=e.date(),a=a===29&&i===1&&!fi(s)?28:a,o?r.setUTCFullYear(s,i,a):r.setFullYear(s,i,a)}}function Ak(e){return e=tn(e),An(this[e])?this[e]():this}function Mk(e,t){if(typeof e=="object"){e=kc(e);var n=_k(e),r,o=n.length;for(r=0;r<o;r++)this[n[r].unit](e[n[r].unit])}else if(e=tn(e),An(this[e]))return this[e](t);return this}function Pk(e,t){return(e%t+t)%t}var mt;Array.prototype.indexOf?mt=Array.prototype.indexOf:mt=function(e){var t;for(t=0;t<this.length;++t)if(this[t]===e)return t;return-1};function Tc(e,t){if(isNaN(e)||isNaN(t))return NaN;var n=Pk(t,12);return e+=(t-n)/12,n===1?fi(e)?29:28:31-n%7%2}ge("M",["MM",2],"Mo",function(){return this.month()+1}),ge("MMM",0,0,function(e){return this.localeData().monthsShort(this,e)}),ge("MMMM",0,0,function(e){return this.localeData().months(this,e)}),fe("M",et,so),fe("MM",et,qt),fe("MMM",function(e,t){return t.monthsShortRegex(e)}),fe("MMMM",function(e,t){return t.monthsRegex(e)}),qe(["M","MM"],function(e,t){t[Hn]=Fe(e)-1}),qe(["MMM","MMMM"],function(e,t,n,r){var o=n._locale.monthsParse(e,r,n._strict);o!=null?t[Hn]=o:Te(n).invalidMonth=e});var Nk="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),np="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),rp=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,Ik=zo,Fk=zo;function Rk(e,t){return e?hn(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||rp).test(t)?"format":"standalone"][e.month()]:hn(this._months)?this._months:this._months.standalone}function Wk(e,t){return e?hn(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[rp.test(t)?"format":"standalone"][e.month()]:hn(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function zk(e,t,n){var r,o,s,i=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],r=0;r<12;++r)s=Dn([2e3,r]),this._shortMonthsParse[r]=this.monthsShort(s,"").toLocaleLowerCase(),this._longMonthsParse[r]=this.months(s,"").toLocaleLowerCase();return n?t==="MMM"?(o=mt.call(this._shortMonthsParse,i),o!==-1?o:null):(o=mt.call(this._longMonthsParse,i),o!==-1?o:null):t==="MMM"?(o=mt.call(this._shortMonthsParse,i),o!==-1?o:(o=mt.call(this._longMonthsParse,i),o!==-1?o:null)):(o=mt.call(this._longMonthsParse,i),o!==-1?o:(o=mt.call(this._shortMonthsParse,i),o!==-1?o:null))}function Lk(e,t,n){var r,o,s;if(this._monthsParseExact)return zk.call(this,e,t,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),r=0;r<12;r++){if(o=Dn([2e3,r]),n&&!this._longMonthsParse[r]&&(this._longMonthsParse[r]=new RegExp("^"+this.months(o,"").replace(".","")+"$","i"),this._shortMonthsParse[r]=new RegExp("^"+this.monthsShort(o,"").replace(".","")+"$","i")),!n&&!this._monthsParse[r]&&(s="^"+this.months(o,"")+"|^"+this.monthsShort(o,""),this._monthsParse[r]=new RegExp(s.replace(".",""),"i")),n&&t==="MMMM"&&this._longMonthsParse[r].test(e))return r;if(n&&t==="MMM"&&this._shortMonthsParse[r].test(e))return r;if(!n&&this._monthsParse[r].test(e))return r}}function op(e,t){if(!e.isValid())return e;if(typeof t=="string"){if(/^\d+$/.test(t))t=Fe(t);else if(t=e.localeData().monthsParse(t),!Vn(t))return e}var n=t,r=e.date();return r=r<29?r:Math.min(r,Tc(e.year(),n)),e._isUTC?e._d.setUTCMonth(n,r):e._d.setMonth(n,r),e}function sp(e){return e!=null?(op(this,e),ce.updateOffset(this,!0),this):Uo(this,"Month")}function $k(){return Tc(this.year(),this.month())}function Uk(e){return this._monthsParseExact?($e(this,"_monthsRegex")||ip.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):($e(this,"_monthsShortRegex")||(this._monthsShortRegex=Ik),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)}function Yk(e){return this._monthsParseExact?($e(this,"_monthsRegex")||ip.call(this),e?this._monthsStrictRegex:this._monthsRegex):($e(this,"_monthsRegex")||(this._monthsRegex=Fk),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)}function ip(){function e(c,u){return u.length-c.length}var t=[],n=[],r=[],o,s,i,a;for(o=0;o<12;o++)s=Dn([2e3,o]),i=Bn(this.monthsShort(s,"")),a=Bn(this.months(s,"")),t.push(i),n.push(a),r.push(a),r.push(i);t.sort(e),n.sort(e),r.sort(e),this._monthsRegex=new RegExp("^("+r.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+t.join("|")+")","i")}function jk(e,t,n,r,o,s,i){var a;return e<100&&e>=0?(a=new Date(e+400,t,n,r,o,s,i),isFinite(a.getFullYear())&&a.setFullYear(e)):a=new Date(e,t,n,r,o,s,i),a}function Yo(e){var t,n;return e<100&&e>=0?(n=Array.prototype.slice.call(arguments),n[0]=e+400,t=new Date(Date.UTC.apply(null,n)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)):t=new Date(Date.UTC.apply(null,arguments)),t}function di(e,t,n){var r=7+t-n,o=(7+Yo(e,0,r).getUTCDay()-t)%7;return-o+r-1}function ap(e,t,n,r,o){var s=(7+n-r)%7,i=di(e,r,o),a=1+7*(t-1)+s+i,c,u;return a<=0?(c=e-1,u=$o(c)+a):a>$o(e)?(c=e+1,u=a-$o(e)):(c=e,u=a),{year:c,dayOfYear:u}}function jo(e,t,n){var r=di(e.year(),t,n),o=Math.floor((e.dayOfYear()-r-1)/7)+1,s,i;return o<1?(i=e.year()-1,s=o+Gn(i,t,n)):o>Gn(e.year(),t,n)?(s=o-Gn(e.year(),t,n),i=e.year()+1):(i=e.year(),s=o),{week:s,year:i}}function Gn(e,t,n){var r=di(e,t,n),o=di(e+1,t,n);return($o(e)-r+o)/7}ge("w",["ww",2],"wo","week"),ge("W",["WW",2],"Wo","isoWeek"),fe("w",et,so),fe("ww",et,qt),fe("W",et,so),fe("WW",et,qt),Lo(["w","ww","W","WW"],function(e,t,n,r){t[r.substr(0,1)]=Fe(e)});function Vk(e){return jo(e,this._week.dow,this._week.doy).week}var Bk={dow:0,doy:6};function Hk(){return this._week.dow}function Zk(){return this._week.doy}function Gk(e){var t=this.localeData().week(this);return e==null?t:this.add((e-t)*7,"d")}function qk(e){var t=jo(this,1,4).week;return e==null?t:this.add((e-t)*7,"d")}ge("d",0,"do","day"),ge("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),ge("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),ge("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),ge("e",0,0,"weekday"),ge("E",0,0,"isoWeekday"),fe("d",et),fe("e",et),fe("E",et),fe("dd",function(e,t){return t.weekdaysMinRegex(e)}),fe("ddd",function(e,t){return t.weekdaysShortRegex(e)}),fe("dddd",function(e,t){return t.weekdaysRegex(e)}),Lo(["dd","ddd","dddd"],function(e,t,n,r){var o=n._locale.weekdaysParse(e,r,n._strict);o!=null?t.d=o:Te(n).invalidWeekday=e}),Lo(["d","e","E"],function(e,t,n,r){t[r]=Fe(e)});function Kk(e,t){return typeof e!="string"?e:isNaN(e)?(e=t.weekdaysParse(e),typeof e=="number"?e:null):parseInt(e,10)}function Xk(e,t){return typeof e=="string"?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}function Dc(e,t){return e.slice(t,7).concat(e.slice(0,t))}var Jk="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),cp="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Qk="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),ex=zo,tx=zo,nx=zo;function rx(e,t){var n=hn(this._weekdays)?this._weekdays:this._weekdays[e&&e!==!0&&this._weekdays.isFormat.test(t)?"format":"standalone"];return e===!0?Dc(n,this._week.dow):e?n[e.day()]:n}function ox(e){return e===!0?Dc(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort}function sx(e){return e===!0?Dc(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin}function ix(e,t,n){var r,o,s,i=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],r=0;r<7;++r)s=Dn([2e3,1]).day(r),this._minWeekdaysParse[r]=this.weekdaysMin(s,"").toLocaleLowerCase(),this._shortWeekdaysParse[r]=this.weekdaysShort(s,"").toLocaleLowerCase(),this._weekdaysParse[r]=this.weekdays(s,"").toLocaleLowerCase();return n?t==="dddd"?(o=mt.call(this._weekdaysParse,i),o!==-1?o:null):t==="ddd"?(o=mt.call(this._shortWeekdaysParse,i),o!==-1?o:null):(o=mt.call(this._minWeekdaysParse,i),o!==-1?o:null):t==="dddd"?(o=mt.call(this._weekdaysParse,i),o!==-1||(o=mt.call(this._shortWeekdaysParse,i),o!==-1)?o:(o=mt.call(this._minWeekdaysParse,i),o!==-1?o:null)):t==="ddd"?(o=mt.call(this._shortWeekdaysParse,i),o!==-1||(o=mt.call(this._weekdaysParse,i),o!==-1)?o:(o=mt.call(this._minWeekdaysParse,i),o!==-1?o:null)):(o=mt.call(this._minWeekdaysParse,i),o!==-1||(o=mt.call(this._weekdaysParse,i),o!==-1)?o:(o=mt.call(this._shortWeekdaysParse,i),o!==-1?o:null))}function ax(e,t,n){var r,o,s;if(this._weekdaysParseExact)return ix.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),r=0;r<7;r++){if(o=Dn([2e3,1]).day(r),n&&!this._fullWeekdaysParse[r]&&(this._fullWeekdaysParse[r]=new RegExp("^"+this.weekdays(o,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[r]=new RegExp("^"+this.weekdaysShort(o,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[r]=new RegExp("^"+this.weekdaysMin(o,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[r]||(s="^"+this.weekdays(o,"")+"|^"+this.weekdaysShort(o,"")+"|^"+this.weekdaysMin(o,""),this._weekdaysParse[r]=new RegExp(s.replace(".",""),"i")),n&&t==="dddd"&&this._fullWeekdaysParse[r].test(e))return r;if(n&&t==="ddd"&&this._shortWeekdaysParse[r].test(e))return r;if(n&&t==="dd"&&this._minWeekdaysParse[r].test(e))return r;if(!n&&this._weekdaysParse[r].test(e))return r}}function cx(e){if(!this.isValid())return e!=null?this:NaN;var t=Uo(this,"Day");return e!=null?(e=Kk(e,this.localeData()),this.add(e-t,"d")):t}function lx(e){if(!this.isValid())return e!=null?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return e==null?t:this.add(e-t,"d")}function ux(e){if(!this.isValid())return e!=null?this:NaN;if(e!=null){var t=Xk(e,this.localeData());return this.day(this.day()%7?t:t-7)}else return this.day()||7}function fx(e){return this._weekdaysParseExact?($e(this,"_weekdaysRegex")||Ac.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):($e(this,"_weekdaysRegex")||(this._weekdaysRegex=ex),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)}function dx(e){return this._weekdaysParseExact?($e(this,"_weekdaysRegex")||Ac.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):($e(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=tx),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function hx(e){return this._weekdaysParseExact?($e(this,"_weekdaysRegex")||Ac.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):($e(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=nx),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Ac(){function e(l,f){return f.length-l.length}var t=[],n=[],r=[],o=[],s,i,a,c,u;for(s=0;s<7;s++)i=Dn([2e3,1]).day(s),a=Bn(this.weekdaysMin(i,"")),c=Bn(this.weekdaysShort(i,"")),u=Bn(this.weekdays(i,"")),t.push(a),n.push(c),r.push(u),o.push(a),o.push(c),o.push(u);t.sort(e),n.sort(e),r.sort(e),o.sort(e),this._weekdaysRegex=new RegExp("^("+o.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+r.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+t.join("|")+")","i")}function Mc(){return this.hours()%12||12}function px(){return this.hours()||24}ge("H",["HH",2],0,"hour"),ge("h",["hh",2],0,Mc),ge("k",["kk",2],0,px),ge("hmm",0,0,function(){return""+Mc.apply(this)+Mn(this.minutes(),2)}),ge("hmmss",0,0,function(){return""+Mc.apply(this)+Mn(this.minutes(),2)+Mn(this.seconds(),2)}),ge("Hmm",0,0,function(){return""+this.hours()+Mn(this.minutes(),2)}),ge("Hmmss",0,0,function(){return""+this.hours()+Mn(this.minutes(),2)+Mn(this.seconds(),2)});function lp(e,t){ge(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}lp("a",!0),lp("A",!1);function up(e,t){return t._meridiemParse}fe("a",up),fe("A",up),fe("H",et,Ec),fe("h",et,so),fe("k",et,so),fe("HH",et,qt),fe("hh",et,qt),fe("kk",et,qt),fe("hmm",Jh),fe("hmmss",Qh),fe("Hmm",Jh),fe("Hmmss",Qh),qe(["H","HH"],kt),qe(["k","kk"],function(e,t,n){var r=Fe(e);t[kt]=r===24?0:r}),qe(["a","A"],function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e}),qe(["h","hh"],function(e,t,n){t[kt]=Fe(e),Te(n).bigHour=!0}),qe("hmm",function(e,t,n){var r=e.length-2;t[kt]=Fe(e.substr(0,r)),t[mn]=Fe(e.substr(r)),Te(n).bigHour=!0}),qe("hmmss",function(e,t,n){var r=e.length-4,o=e.length-2;t[kt]=Fe(e.substr(0,r)),t[mn]=Fe(e.substr(r,2)),t[Zn]=Fe(e.substr(o)),Te(n).bigHour=!0}),qe("Hmm",function(e,t,n){var r=e.length-2;t[kt]=Fe(e.substr(0,r)),t[mn]=Fe(e.substr(r))}),qe("Hmmss",function(e,t,n){var r=e.length-4,o=e.length-2;t[kt]=Fe(e.substr(0,r)),t[mn]=Fe(e.substr(r,2)),t[Zn]=Fe(e.substr(o))});function mx(e){return(e+"").toLowerCase().charAt(0)==="p"}var gx=/[ap]\.?m?\.?/i,yx=io("Hours",!0);function vx(e,t,n){return e>11?n?"pm":"PM":n?"am":"AM"}var fp={calendar:ik,longDateFormat:uk,invalidDate:dk,ordinal:pk,dayOfMonthOrdinalParse:mk,relativeTime:yk,months:Nk,monthsShort:np,week:Bk,weekdays:Jk,weekdaysMin:Qk,weekdaysShort:cp,meridiemParse:gx},it={},Vo={},Bo;function bx(e,t){var n,r=Math.min(e.length,t.length);for(n=0;n<r;n+=1)if(e[n]!==t[n])return n;return r}function dp(e){return e&&e.toLowerCase().replace("_","-")}function wx(e){for(var t=0,n,r,o,s;t<e.length;){for(s=dp(e[t]).split("-"),n=s.length,r=dp(e[t+1]),r=r?r.split("-"):null;n>0;){if(o=hi(s.slice(0,n).join("-")),o)return o;if(r&&r.length>=n&&bx(s,r)>=n-1)break;n--}t++}return Bo}function _x(e){return!!(e&&e.match("^[^/\\\\]*$"))}function hi(e){var t=null,n;if(it[e]===void 0&&typeof module<"u"&&module&&module.exports&&_x(e))try{t=Bo._abbr,n=require,n("./locale/"+e),vr(t)}catch{it[e]=null}return it[e]}function vr(e,t){var n;return e&&(Ut(t)?n=qn(e):n=Pc(e,t),n?Bo=n:typeof console<"u"&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),Bo._abbr}function Pc(e,t){if(t!==null){var n,r=fp;if(t.abbr=e,it[e]!=null)Zh("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),r=it[e]._config;else if(t.parentLocale!=null)if(it[t.parentLocale]!=null)r=it[t.parentLocale]._config;else if(n=hi(t.parentLocale),n!=null)r=n._config;else return Vo[t.parentLocale]||(Vo[t.parentLocale]=[]),Vo[t.parentLocale].push({name:e,config:t}),null;return it[e]=new bc(vc(r,t)),Vo[e]&&Vo[e].forEach(function(o){Pc(o.name,o.config)}),vr(e),it[e]}else return delete it[e],null}function Sx(e,t){if(t!=null){var n,r,o=fp;it[e]!=null&&it[e].parentLocale!=null?it[e].set(vc(it[e]._config,t)):(r=hi(e),r!=null&&(o=r._config),t=vc(o,t),r==null&&(t.abbr=e),n=new bc(t),n.parentLocale=it[e],it[e]=n),vr(e)}else it[e]!=null&&(it[e].parentLocale!=null?(it[e]=it[e].parentLocale,e===vr()&&vr(e)):it[e]!=null&&delete it[e]);return it[e]}function qn(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return Bo;if(!hn(e)){if(t=hi(e),t)return t;e=[e]}return wx(e)}function kx(){return wc(it)}function Nc(e){var t,n=e._a;return n&&Te(e).overflow===-2&&(t=n[Hn]<0||n[Hn]>11?Hn:n[Pn]<1||n[Pn]>Tc(n[At],n[Hn])?Pn:n[kt]<0||n[kt]>24||n[kt]===24&&(n[mn]!==0||n[Zn]!==0||n[Ir]!==0)?kt:n[mn]<0||n[mn]>59?mn:n[Zn]<0||n[Zn]>59?Zn:n[Ir]<0||n[Ir]>999?Ir:-1,Te(e)._overflowDayOfYear&&(t<At||t>Pn)&&(t=Pn),Te(e)._overflowWeeks&&t===-1&&(t=Ck),Te(e)._overflowWeekday&&t===-1&&(t=Tk),Te(e).overflow=t),e}var xx=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Ox=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Ex=/Z|[+-]\d\d(?::?\d\d)?/,pi=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],Ic=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Cx=/^\/?Date\((-?\d+)/i,Tx=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,Dx={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function hp(e){var t,n,r=e._i,o=xx.exec(r)||Ox.exec(r),s,i,a,c,u=pi.length,l=Ic.length;if(o){for(Te(e).iso=!0,t=0,n=u;t<n;t++)if(pi[t][1].exec(o[1])){i=pi[t][0],s=pi[t][2]!==!1;break}if(i==null){e._isValid=!1;return}if(o[3]){for(t=0,n=l;t<n;t++)if(Ic[t][1].exec(o[3])){a=(o[2]||" ")+Ic[t][0];break}if(a==null){e._isValid=!1;return}}if(!s&&a!=null){e._isValid=!1;return}if(o[4])if(Ex.exec(o[4]))c="Z";else{e._isValid=!1;return}e._f=i+(a||"")+(c||""),Rc(e)}else e._isValid=!1}function Ax(e,t,n,r,o,s){var i=[Mx(e),np.indexOf(t),parseInt(n,10),parseInt(r,10),parseInt(o,10)];return s&&i.push(parseInt(s,10)),i}function Mx(e){var t=parseInt(e,10);return t<=49?2e3+t:t<=999?1900+t:t}function Px(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function Nx(e,t,n){if(e){var r=cp.indexOf(e),o=new Date(t[0],t[1],t[2]).getDay();if(r!==o)return Te(n).weekdayMismatch=!0,n._isValid=!1,!1}return!0}function Ix(e,t,n){if(e)return Dx[e];if(t)return 0;var r=parseInt(n,10),o=r%100,s=(r-o)/100;return s*60+o}function pp(e){var t=Tx.exec(Px(e._i)),n;if(t){if(n=Ax(t[4],t[3],t[2],t[5],t[6],t[7]),!Nx(t[1],n,e))return;e._a=n,e._tzm=Ix(t[8],t[9],t[10]),e._d=Yo.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),Te(e).rfc2822=!0}else e._isValid=!1}function Fx(e){var t=Cx.exec(e._i);if(t!==null){e._d=new Date(+t[1]);return}if(hp(e),e._isValid===!1)delete e._isValid;else return;if(pp(e),e._isValid===!1)delete e._isValid;else return;e._strict?e._isValid=!1:ce.createFromInputFallback(e)}ce.createFromInputFallback=en("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))});function ao(e,t,n){return e??t??n}function Rx(e){var t=new Date(ce.now());return e._useUTC?[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()]:[t.getFullYear(),t.getMonth(),t.getDate()]}function Fc(e){var t,n,r=[],o,s,i;if(!e._d){for(o=Rx(e),e._w&&e._a[Pn]==null&&e._a[Hn]==null&&Wx(e),e._dayOfYear!=null&&(i=ao(e._a[At],o[At]),(e._dayOfYear>$o(i)||e._dayOfYear===0)&&(Te(e)._overflowDayOfYear=!0),n=Yo(i,0,e._dayOfYear),e._a[Hn]=n.getUTCMonth(),e._a[Pn]=n.getUTCDate()),t=0;t<3&&e._a[t]==null;++t)e._a[t]=r[t]=o[t];for(;t<7;t++)e._a[t]=r[t]=e._a[t]==null?t===2?1:0:e._a[t];e._a[kt]===24&&e._a[mn]===0&&e._a[Zn]===0&&e._a[Ir]===0&&(e._nextDay=!0,e._a[kt]=0),e._d=(e._useUTC?Yo:jk).apply(null,r),s=e._useUTC?e._d.getUTCDay():e._d.getDay(),e._tzm!=null&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[kt]=24),e._w&&typeof e._w.d<"u"&&e._w.d!==s&&(Te(e).weekdayMismatch=!0)}}function Wx(e){var t,n,r,o,s,i,a,c,u;t=e._w,t.GG!=null||t.W!=null||t.E!=null?(s=1,i=4,n=ao(t.GG,e._a[At],jo(tt(),1,4).year),r=ao(t.W,1),o=ao(t.E,1),(o<1||o>7)&&(c=!0)):(s=e._locale._week.dow,i=e._locale._week.doy,u=jo(tt(),s,i),n=ao(t.gg,e._a[At],u.year),r=ao(t.w,u.week),t.d!=null?(o=t.d,(o<0||o>6)&&(c=!0)):t.e!=null?(o=t.e+s,(t.e<0||t.e>6)&&(c=!0)):o=s),r<1||r>Gn(n,s,i)?Te(e)._overflowWeeks=!0:c!=null?Te(e)._overflowWeekday=!0:(a=ap(n,r,o,s,i),e._a[At]=a.year,e._dayOfYear=a.dayOfYear)}ce.ISO_8601=function(){},ce.RFC_2822=function(){};function Rc(e){if(e._f===ce.ISO_8601){hp(e);return}if(e._f===ce.RFC_2822){pp(e);return}e._a=[],Te(e).empty=!0;var t=""+e._i,n,r,o,s,i,a=t.length,c=0,u,l;for(o=Gh(e._f,e._locale).match(_c)||[],l=o.length,n=0;n<l;n++)s=o[n],r=(t.match(xk(s,e))||[])[0],r&&(i=t.substr(0,t.indexOf(r)),i.length>0&&Te(e).unusedInput.push(i),t=t.slice(t.indexOf(r)+r.length),c+=r.length),ro[s]?(r?Te(e).empty=!1:Te(e).unusedTokens.push(s),Ek(s,r,e)):e._strict&&!r&&Te(e).unusedTokens.push(s);Te(e).charsLeftOver=a-c,t.length>0&&Te(e).unusedInput.push(t),e._a[kt]<=12&&Te(e).bigHour===!0&&e._a[kt]>0&&(Te(e).bigHour=void 0),Te(e).parsedDateParts=e._a.slice(0),Te(e).meridiem=e._meridiem,e._a[kt]=zx(e._locale,e._a[kt],e._meridiem),u=Te(e).era,u!==null&&(e._a[At]=e._locale.erasConvertYear(u,e._a[At])),Fc(e),Nc(e)}function zx(e,t,n){var r;return n==null?t:e.meridiemHour!=null?e.meridiemHour(t,n):(e.isPM!=null&&(r=e.isPM(n),r&&t<12&&(t+=12),!r&&t===12&&(t=0)),t)}function Lx(e){var t,n,r,o,s,i,a=!1,c=e._f.length;if(c===0){Te(e).invalidFormat=!0,e._d=new Date(NaN);return}for(o=0;o<c;o++)s=0,i=!1,t=yc({},e),e._useUTC!=null&&(t._useUTC=e._useUTC),t._f=e._f[o],Rc(t),mc(t)&&(i=!0),s+=Te(t).charsLeftOver,s+=Te(t).unusedTokens.length*10,Te(t).score=s,a?s<r&&(r=s,n=t):(r==null||s<r||i)&&(r=s,n=t,i&&(a=!0));yr(e,n||t)}function $x(e){if(!e._d){var t=kc(e._i),n=t.day===void 0?t.date:t.day;e._a=jh([t.year,t.month,n,t.hour,t.minute,t.second,t.millisecond],function(r){return r&&parseInt(r,10)}),Fc(e)}}function Ux(e){var t=new Wo(Nc(mp(e)));return t._nextDay&&(t.add(1,"d"),t._nextDay=void 0),t}function mp(e){var t=e._i,n=e._f;return e._locale=e._locale||qn(e._l),t===null||n===void 0&&t===""?ni({nullInput:!0}):(typeof t=="string"&&(e._i=t=e._locale.preparse(t)),pn(t)?new Wo(Nc(t)):(Ro(t)?e._d=t:hn(n)?Lx(e):n?Rc(e):Yx(e),mc(e)||(e._d=null),e))}function Yx(e){var t=e._i;Ut(t)?e._d=new Date(ce.now()):Ro(t)?e._d=new Date(t.valueOf()):typeof t=="string"?Fx(e):hn(t)?(e._a=jh(t.slice(0),function(n){return parseInt(n,10)}),Fc(e)):Nr(t)?$x(e):Vn(t)?e._d=new Date(t):ce.createFromInputFallback(e)}function gp(e,t,n,r,o){var s={};return(t===!0||t===!1)&&(r=t,t=void 0),(n===!0||n===!1)&&(r=n,n=void 0),(Nr(e)&&hc(e)||hn(e)&&e.length===0)&&(e=void 0),s._isAMomentObject=!0,s._useUTC=s._isUTC=o,s._l=n,s._i=e,s._f=t,s._strict=r,Ux(s)}function tt(e,t,n,r){return gp(e,t,n,r,!1)}var jx=en("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=tt.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:ni()}),Vx=en("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=tt.apply(null,arguments);return this.isValid()&&e.isValid()?e>this?this:e:ni()});function yp(e,t){var n,r;if(t.length===1&&hn(t[0])&&(t=t[0]),!t.length)return tt();for(n=t[0],r=1;r<t.length;++r)(!t[r].isValid()||t[r][e](n))&&(n=t[r]);return n}function Bx(){var e=[].slice.call(arguments,0);return yp("isBefore",e)}function Hx(){var e=[].slice.call(arguments,0);return yp("isAfter",e)}var Zx=function(){return Date.now?Date.now():+new Date},Ho=["year","quarter","month","week","day","hour","minute","second","millisecond"];function Gx(e){var t,n=!1,r,o=Ho.length;for(t in e)if($e(e,t)&&!(mt.call(Ho,t)!==-1&&(e[t]==null||!isNaN(e[t]))))return!1;for(r=0;r<o;++r)if(e[Ho[r]]){if(n)return!1;parseFloat(e[Ho[r]])!==Fe(e[Ho[r]])&&(n=!0)}return!0}function qx(){return this._isValid}function Kx(){return gn(NaN)}function mi(e){var t=kc(e),n=t.year||0,r=t.quarter||0,o=t.month||0,s=t.week||t.isoWeek||0,i=t.day||0,a=t.hour||0,c=t.minute||0,u=t.second||0,l=t.millisecond||0;this._isValid=Gx(t),this._milliseconds=+l+u*1e3+c*6e4+a*1e3*60*60,this._days=+i+s*7,this._months=+o+r*3+n*12,this._data={},this._locale=qn(),this._bubble()}function gi(e){return e instanceof mi}function Wc(e){return e<0?Math.round(-1*e)*-1:Math.round(e)}function Xx(e,t,n){var r=Math.min(e.length,t.length),o=Math.abs(e.length-t.length),s=0,i;for(i=0;i<r;i++)Fe(e[i])!==Fe(t[i])&&s++;return s+o}function vp(e,t){ge(e,0,0,function(){var n=this.utcOffset(),r="+";return n<0&&(n=-n,r="-"),r+Mn(~~(n/60),2)+t+Mn(~~n%60,2)})}vp("Z",":"),vp("ZZ",""),fe("Z",li),fe("ZZ",li),qe(["Z","ZZ"],function(e,t,n){n._useUTC=!0,n._tzm=zc(li,e)});var Jx=/([\+\-]|\d\d)/gi;function zc(e,t){var n=(t||"").match(e),r,o,s;return n===null?null:(r=n[n.length-1]||[],o=(r+"").match(Jx)||["-",0,0],s=+(o[1]*60)+Fe(o[2]),s===0?0:o[0]==="+"?s:-s)}function Lc(e,t){var n,r;return t._isUTC?(n=t.clone(),r=(pn(e)||Ro(e)?e.valueOf():tt(e).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+r),ce.updateOffset(n,!1),n):tt(e).local()}function $c(e){return-Math.round(e._d.getTimezoneOffset())}ce.updateOffset=function(){};function Qx(e,t,n){var r=this._offset||0,o;if(!this.isValid())return e!=null?this:NaN;if(e!=null){if(typeof e=="string"){if(e=zc(li,e),e===null)return this}else Math.abs(e)<16&&!n&&(e=e*60);return!this._isUTC&&t&&(o=$c(this)),this._offset=e,this._isUTC=!0,o!=null&&this.add(o,"m"),r!==e&&(!t||this._changeInProgress?Sp(this,gn(e-r,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,ce.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?r:$c(this)}function eO(e,t){return e!=null?(typeof e!="string"&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}function tO(e){return this.utcOffset(0,e)}function nO(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract($c(this),"m")),this}function rO(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var e=zc(Sk,this._i);e!=null?this.utcOffset(e):this.utcOffset(0,!0)}return this}function oO(e){return this.isValid()?(e=e?tt(e).utcOffset():0,(this.utcOffset()-e)%60===0):!1}function sO(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function iO(){if(!Ut(this._isDSTShifted))return this._isDSTShifted;var e={},t;return yc(e,this),e=mp(e),e._a?(t=e._isUTC?Dn(e._a):tt(e._a),this._isDSTShifted=this.isValid()&&Xx(e._a,t.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function aO(){return this.isValid()?!this._isUTC:!1}function cO(){return this.isValid()?this._isUTC:!1}function bp(){return this.isValid()?this._isUTC&&this._offset===0:!1}var lO=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,uO=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function gn(e,t){var n=e,r=null,o,s,i;return gi(e)?n={ms:e._milliseconds,d:e._days,M:e._months}:Vn(e)||!isNaN(+e)?(n={},t?n[t]=+e:n.milliseconds=+e):(r=lO.exec(e))?(o=r[1]==="-"?-1:1,n={y:0,d:Fe(r[Pn])*o,h:Fe(r[kt])*o,m:Fe(r[mn])*o,s:Fe(r[Zn])*o,ms:Fe(Wc(r[Ir]*1e3))*o}):(r=uO.exec(e))?(o=r[1]==="-"?-1:1,n={y:Fr(r[2],o),M:Fr(r[3],o),w:Fr(r[4],o),d:Fr(r[5],o),h:Fr(r[6],o),m:Fr(r[7],o),s:Fr(r[8],o)}):n==null?n={}:typeof n=="object"&&("from"in n||"to"in n)&&(i=fO(tt(n.from),tt(n.to)),n={},n.ms=i.milliseconds,n.M=i.months),s=new mi(n),gi(e)&&$e(e,"_locale")&&(s._locale=e._locale),gi(e)&&$e(e,"_isValid")&&(s._isValid=e._isValid),s}gn.fn=mi.prototype,gn.invalid=Kx;function Fr(e,t){var n=e&&parseFloat(e.replace(",","."));return(isNaN(n)?0:n)*t}function wp(e,t){var n={};return n.months=t.month()-e.month()+(t.year()-e.year())*12,e.clone().add(n.months,"M").isAfter(t)&&--n.months,n.milliseconds=+t-+e.clone().add(n.months,"M"),n}function fO(e,t){var n;return e.isValid()&&t.isValid()?(t=Lc(t,e),e.isBefore(t)?n=wp(e,t):(n=wp(t,e),n.milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function _p(e,t){return function(n,r){var o,s;return r!==null&&!isNaN(+r)&&(Zh(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),s=n,n=r,r=s),o=gn(n,r),Sp(this,o,e),this}}function Sp(e,t,n,r){var o=t._milliseconds,s=Wc(t._days),i=Wc(t._months);e.isValid()&&(r=r??!0,i&&op(e,Uo(e,"Month")+i*n),s&&tp(e,"Date",Uo(e,"Date")+s*n),o&&e._d.setTime(e._d.valueOf()+o*n),r&&ce.updateOffset(e,s||i))}var dO=_p(1,"add"),hO=_p(-1,"subtract");function kp(e){return typeof e=="string"||e instanceof String}function pO(e){return pn(e)||Ro(e)||kp(e)||Vn(e)||gO(e)||mO(e)||e===null||e===void 0}function mO(e){var t=Nr(e)&&!hc(e),n=!1,r=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],o,s,i=r.length;for(o=0;o<i;o+=1)s=r[o],n=n||$e(e,s);return t&&n}function gO(e){var t=hn(e),n=!1;return t&&(n=e.filter(function(r){return!Vn(r)&&kp(e)}).length===0),t&&n}function yO(e){var t=Nr(e)&&!hc(e),n=!1,r=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],o,s;for(o=0;o<r.length;o+=1)s=r[o],n=n||$e(e,s);return t&&n}function vO(e,t){var n=e.diff(t,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"}function bO(e,t){arguments.length===1&&(arguments[0]?pO(arguments[0])?(e=arguments[0],t=void 0):yO(arguments[0])&&(t=arguments[0],e=void 0):(e=void 0,t=void 0));var n=e||tt(),r=Lc(n,this).startOf("day"),o=ce.calendarFormat(this,r)||"sameElse",s=t&&(An(t[o])?t[o].call(this,n):t[o]);return this.format(s||this.localeData().calendar(o,this,tt(n)))}function wO(){return new Wo(this)}function _O(e,t){var n=pn(e)?e:tt(e);return this.isValid()&&n.isValid()?(t=tn(t)||"millisecond",t==="millisecond"?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(t).valueOf()):!1}function SO(e,t){var n=pn(e)?e:tt(e);return this.isValid()&&n.isValid()?(t=tn(t)||"millisecond",t==="millisecond"?this.valueOf()<n.valueOf():this.clone().endOf(t).valueOf()<n.valueOf()):!1}function kO(e,t,n,r){var o=pn(e)?e:tt(e),s=pn(t)?t:tt(t);return this.isValid()&&o.isValid()&&s.isValid()?(r=r||"()",(r[0]==="("?this.isAfter(o,n):!this.isBefore(o,n))&&(r[1]===")"?this.isBefore(s,n):!this.isAfter(s,n))):!1}function xO(e,t){var n=pn(e)?e:tt(e),r;return this.isValid()&&n.isValid()?(t=tn(t)||"millisecond",t==="millisecond"?this.valueOf()===n.valueOf():(r=n.valueOf(),this.clone().startOf(t).valueOf()<=r&&r<=this.clone().endOf(t).valueOf())):!1}function OO(e,t){return this.isSame(e,t)||this.isAfter(e,t)}function EO(e,t){return this.isSame(e,t)||this.isBefore(e,t)}function CO(e,t,n){var r,o,s;if(!this.isValid())return NaN;if(r=Lc(e,this),!r.isValid())return NaN;switch(o=(r.utcOffset()-this.utcOffset())*6e4,t=tn(t),t){case"year":s=yi(this,r)/12;break;case"month":s=yi(this,r);break;case"quarter":s=yi(this,r)/3;break;case"second":s=(this-r)/1e3;break;case"minute":s=(this-r)/6e4;break;case"hour":s=(this-r)/36e5;break;case"day":s=(this-r-o)/864e5;break;case"week":s=(this-r-o)/6048e5;break;default:s=this-r}return n?s:nn(s)}function yi(e,t){if(e.date()<t.date())return-yi(t,e);var n=(t.year()-e.year())*12+(t.month()-e.month()),r=e.clone().add(n,"months"),o,s;return t-r<0?(o=e.clone().add(n-1,"months"),s=(t-r)/(r-o)):(o=e.clone().add(n+1,"months"),s=(t-r)/(o-r)),-(n+s)||0}ce.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",ce.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function TO(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function DO(e){if(!this.isValid())return null;var t=e!==!0,n=t?this.clone().utc():this;return n.year()<0||n.year()>9999?oi(n,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):An(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",oi(n,"Z")):oi(n,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function AO(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e="moment",t="",n,r,o,s;return this.isLocal()||(e=this.utcOffset()===0?"moment.utc":"moment.parseZone",t="Z"),n="["+e+'("]',r=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",o="-MM-DD[T]HH:mm:ss.SSS",s=t+'[")]',this.format(n+r+o+s)}function MO(e){e||(e=this.isUtc()?ce.defaultFormatUtc:ce.defaultFormat);var t=oi(this,e);return this.localeData().postformat(t)}function PO(e,t){return this.isValid()&&(pn(e)&&e.isValid()||tt(e).isValid())?gn({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function NO(e){return this.from(tt(),e)}function IO(e,t){return this.isValid()&&(pn(e)&&e.isValid()||tt(e).isValid())?gn({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function FO(e){return this.to(tt(),e)}function xp(e){var t;return e===void 0?this._locale._abbr:(t=qn(e),t!=null&&(this._locale=t),this)}var Op=en("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return e===void 0?this.localeData():this.locale(e)});function Ep(){return this._locale}var vi=1e3,co=60*vi,bi=60*co,Cp=(365*400+97)*24*bi;function lo(e,t){return(e%t+t)%t}function Tp(e,t,n){return e<100&&e>=0?new Date(e+400,t,n)-Cp:new Date(e,t,n).valueOf()}function Dp(e,t,n){return e<100&&e>=0?Date.UTC(e+400,t,n)-Cp:Date.UTC(e,t,n)}function RO(e){var t,n;if(e=tn(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?Dp:Tp,e){case"year":t=n(this.year(),0,1);break;case"quarter":t=n(this.year(),this.month()-this.month()%3,1);break;case"month":t=n(this.year(),this.month(),1);break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":t=n(this.year(),this.month(),this.date());break;case"hour":t=this._d.valueOf(),t-=lo(t+(this._isUTC?0:this.utcOffset()*co),bi);break;case"minute":t=this._d.valueOf(),t-=lo(t,co);break;case"second":t=this._d.valueOf(),t-=lo(t,vi);break}return this._d.setTime(t),ce.updateOffset(this,!0),this}function WO(e){var t,n;if(e=tn(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?Dp:Tp,e){case"year":t=n(this.year()+1,0,1)-1;break;case"quarter":t=n(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=n(this.year(),this.month()+1,1)-1;break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=n(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=bi-lo(t+(this._isUTC?0:this.utcOffset()*co),bi)-1;break;case"minute":t=this._d.valueOf(),t+=co-lo(t,co)-1;break;case"second":t=this._d.valueOf(),t+=vi-lo(t,vi)-1;break}return this._d.setTime(t),ce.updateOffset(this,!0),this}function zO(){return this._d.valueOf()-(this._offset||0)*6e4}function LO(){return Math.floor(this.valueOf()/1e3)}function $O(){return new Date(this.valueOf())}function UO(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]}function YO(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}}function jO(){return this.isValid()?this.toISOString():null}function VO(){return mc(this)}function BO(){return yr({},Te(this))}function HO(){return Te(this).overflow}function ZO(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}ge("N",0,0,"eraAbbr"),ge("NN",0,0,"eraAbbr"),ge("NNN",0,0,"eraAbbr"),ge("NNNN",0,0,"eraName"),ge("NNNNN",0,0,"eraNarrow"),ge("y",["y",1],"yo","eraYear"),ge("y",["yy",2],0,"eraYear"),ge("y",["yyy",3],0,"eraYear"),ge("y",["yyyy",4],0,"eraYear"),fe("N",Uc),fe("NN",Uc),fe("NNN",Uc),fe("NNNN",oE),fe("NNNNN",sE),qe(["N","NN","NNN","NNNN","NNNNN"],function(e,t,n,r){var o=n._locale.erasParse(e,r,n._strict);o?Te(n).era=o:Te(n).invalidEra=e}),fe("y",oo),fe("yy",oo),fe("yyy",oo),fe("yyyy",oo),fe("yo",iE),qe(["y","yy","yyy","yyyy"],At),qe(["yo"],function(e,t,n,r){var o;n._locale._eraYearOrdinalRegex&&(o=e.match(n._locale._eraYearOrdinalRegex)),n._locale.eraYearOrdinalParse?t[At]=n._locale.eraYearOrdinalParse(e,o):t[At]=parseInt(e,10)});function GO(e,t){var n,r,o,s=this._eras||qn("en")._eras;for(n=0,r=s.length;n<r;++n)switch(typeof s[n].since==="string"&&(o=ce(s[n].since).startOf("day"),s[n].since=o.valueOf()),typeof s[n].until){case"undefined":s[n].until=1/0;break;case"string":o=ce(s[n].until).startOf("day").valueOf(),s[n].until=o.valueOf();break}return s}function qO(e,t,n){var r,o,s=this.eras(),i,a,c;for(e=e.toUpperCase(),r=0,o=s.length;r<o;++r)if(i=s[r].name.toUpperCase(),a=s[r].abbr.toUpperCase(),c=s[r].narrow.toUpperCase(),n)switch(t){case"N":case"NN":case"NNN":if(a===e)return s[r];break;case"NNNN":if(i===e)return s[r];break;case"NNNNN":if(c===e)return s[r];break}else if([i,a,c].indexOf(e)>=0)return s[r]}function KO(e,t){var n=e.since<=e.until?1:-1;return t===void 0?ce(e.since).year():ce(e.since).year()+(t-e.offset)*n}function XO(){var e,t,n,r=this.localeData().eras();for(e=0,t=r.length;e<t;++e)if(n=this.clone().startOf("day").valueOf(),r[e].since<=n&&n<=r[e].until||r[e].until<=n&&n<=r[e].since)return r[e].name;return""}function JO(){var e,t,n,r=this.localeData().eras();for(e=0,t=r.length;e<t;++e)if(n=this.clone().startOf("day").valueOf(),r[e].since<=n&&n<=r[e].until||r[e].until<=n&&n<=r[e].since)return r[e].narrow;return""}function QO(){var e,t,n,r=this.localeData().eras();for(e=0,t=r.length;e<t;++e)if(n=this.clone().startOf("day").valueOf(),r[e].since<=n&&n<=r[e].until||r[e].until<=n&&n<=r[e].since)return r[e].abbr;return""}function eE(){var e,t,n,r,o=this.localeData().eras();for(e=0,t=o.length;e<t;++e)if(n=o[e].since<=o[e].until?1:-1,r=this.clone().startOf("day").valueOf(),o[e].since<=r&&r<=o[e].until||o[e].until<=r&&r<=o[e].since)return(this.year()-ce(o[e].since).year())*n+o[e].offset;return this.year()}function tE(e){return $e(this,"_erasNameRegex")||Yc.call(this),e?this._erasNameRegex:this._erasRegex}function nE(e){return $e(this,"_erasAbbrRegex")||Yc.call(this),e?this._erasAbbrRegex:this._erasRegex}function rE(e){return $e(this,"_erasNarrowRegex")||Yc.call(this),e?this._erasNarrowRegex:this._erasRegex}function Uc(e,t){return t.erasAbbrRegex(e)}function oE(e,t){return t.erasNameRegex(e)}function sE(e,t){return t.erasNarrowRegex(e)}function iE(e,t){return t._eraYearOrdinalRegex||oo}function Yc(){var e=[],t=[],n=[],r=[],o,s,i,a,c,u=this.eras();for(o=0,s=u.length;o<s;++o)i=Bn(u[o].name),a=Bn(u[o].abbr),c=Bn(u[o].narrow),t.push(i),e.push(a),n.push(c),r.push(i),r.push(a),r.push(c);this._erasRegex=new RegExp("^("+r.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+t.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+e.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+n.join("|")+")","i")}ge(0,["gg",2],0,function(){return this.weekYear()%100}),ge(0,["GG",2],0,function(){return this.isoWeekYear()%100});function wi(e,t){ge(0,[e,e.length],0,t)}wi("gggg","weekYear"),wi("ggggg","weekYear"),wi("GGGG","isoWeekYear"),wi("GGGGG","isoWeekYear"),fe("G",ci),fe("g",ci),fe("GG",et,qt),fe("gg",et,qt),fe("GGGG",Oc,xc),fe("gggg",Oc,xc),fe("GGGGG",ai,si),fe("ggggg",ai,si),Lo(["gggg","ggggg","GGGG","GGGGG"],function(e,t,n,r){t[r.substr(0,2)]=Fe(e)}),Lo(["gg","GG"],function(e,t,n,r){t[r]=ce.parseTwoDigitYear(e)});function aE(e){return Ap.call(this,e,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function cE(e){return Ap.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)}function lE(){return Gn(this.year(),1,4)}function uE(){return Gn(this.isoWeekYear(),1,4)}function fE(){var e=this.localeData()._week;return Gn(this.year(),e.dow,e.doy)}function dE(){var e=this.localeData()._week;return Gn(this.weekYear(),e.dow,e.doy)}function Ap(e,t,n,r,o){var s;return e==null?jo(this,r,o).year:(s=Gn(e,r,o),t>s&&(t=s),hE.call(this,e,t,n,r,o))}function hE(e,t,n,r,o){var s=ap(e,t,n,r,o),i=Yo(s.year,0,s.dayOfYear);return this.year(i.getUTCFullYear()),this.month(i.getUTCMonth()),this.date(i.getUTCDate()),this}ge("Q",0,"Qo","quarter"),fe("Q",Kh),qe("Q",function(e,t){t[Hn]=(Fe(e)-1)*3});function pE(e){return e==null?Math.ceil((this.month()+1)/3):this.month((e-1)*3+this.month()%3)}ge("D",["DD",2],"Do","date"),fe("D",et,so),fe("DD",et,qt),fe("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient}),qe(["D","DD"],Pn),qe("Do",function(e,t){t[Pn]=Fe(e.match(et)[0])});var Mp=io("Date",!0);ge("DDD",["DDDD",3],"DDDo","dayOfYear"),fe("DDD",ii),fe("DDDD",Xh),qe(["DDD","DDDD"],function(e,t,n){n._dayOfYear=Fe(e)});function mE(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return e==null?t:this.add(e-t,"d")}ge("m",["mm",2],0,"minute"),fe("m",et,Ec),fe("mm",et,qt),qe(["m","mm"],mn);var gE=io("Minutes",!1);ge("s",["ss",2],0,"second"),fe("s",et,Ec),fe("ss",et,qt),qe(["s","ss"],Zn);var yE=io("Seconds",!1);ge("S",0,0,function(){return~~(this.millisecond()/100)}),ge(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),ge(0,["SSS",3],0,"millisecond"),ge(0,["SSSS",4],0,function(){return this.millisecond()*10}),ge(0,["SSSSS",5],0,function(){return this.millisecond()*100}),ge(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),ge(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),ge(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),ge(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),fe("S",ii,Kh),fe("SS",ii,qt),fe("SSS",ii,Xh);var br,Pp;for(br="SSSS";br.length<=9;br+="S")fe(br,oo);function vE(e,t){t[Ir]=Fe(("0."+e)*1e3)}for(br="S";br.length<=9;br+="S")qe(br,vE);Pp=io("Milliseconds",!1),ge("z",0,0,"zoneAbbr"),ge("zz",0,0,"zoneName");function bE(){return this._isUTC?"UTC":""}function wE(){return this._isUTC?"Coordinated Universal Time":""}var se=Wo.prototype;se.add=dO,se.calendar=bO,se.clone=wO,se.diff=CO,se.endOf=WO,se.format=MO,se.from=PO,se.fromNow=NO,se.to=IO,se.toNow=FO,se.get=Ak,se.invalidAt=HO,se.isAfter=_O,se.isBefore=SO,se.isBetween=kO,se.isSame=xO,se.isSameOrAfter=OO,se.isSameOrBefore=EO,se.isValid=VO,se.lang=Op,se.locale=xp,se.localeData=Ep,se.max=Vx,se.min=jx,se.parsingFlags=BO,se.set=Mk,se.startOf=RO,se.subtract=hO,se.toArray=UO,se.toObject=YO,se.toDate=$O,se.toISOString=DO,se.inspect=AO,typeof Symbol<"u"&&Symbol.for!=null&&(se[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),se.toJSON=jO,se.toString=TO,se.unix=LO,se.valueOf=zO,se.creationData=ZO,se.eraName=XO,se.eraNarrow=JO,se.eraAbbr=QO,se.eraYear=eE,se.year=ep,se.isLeapYear=Dk,se.weekYear=aE,se.isoWeekYear=cE,se.quarter=se.quarters=pE,se.month=sp,se.daysInMonth=$k,se.week=se.weeks=Gk,se.isoWeek=se.isoWeeks=qk,se.weeksInYear=fE,se.weeksInWeekYear=dE,se.isoWeeksInYear=lE,se.isoWeeksInISOWeekYear=uE,se.date=Mp,se.day=se.days=cx,se.weekday=lx,se.isoWeekday=ux,se.dayOfYear=mE,se.hour=se.hours=yx,se.minute=se.minutes=gE,se.second=se.seconds=yE,se.millisecond=se.milliseconds=Pp,se.utcOffset=Qx,se.utc=tO,se.local=nO,se.parseZone=rO,se.hasAlignedHourOffset=oO,se.isDST=sO,se.isLocal=aO,se.isUtcOffset=cO,se.isUtc=bp,se.isUTC=bp,se.zoneAbbr=bE,se.zoneName=wE,se.dates=en("dates accessor is deprecated. Use date instead.",Mp),se.months=en("months accessor is deprecated. Use month instead",sp),se.years=en("years accessor is deprecated. Use year instead",ep),se.zone=en("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",eO),se.isDSTShifted=en("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",iO);function _E(e){return tt(e*1e3)}function SE(){return tt.apply(null,arguments).parseZone()}function Np(e){return e}var Ue=bc.prototype;Ue.calendar=ak,Ue.longDateFormat=fk,Ue.invalidDate=hk,Ue.ordinal=gk,Ue.preparse=Np,Ue.postformat=Np,Ue.relativeTime=vk,Ue.pastFuture=bk,Ue.set=sk,Ue.eras=GO,Ue.erasParse=qO,Ue.erasConvertYear=KO,Ue.erasAbbrRegex=nE,Ue.erasNameRegex=tE,Ue.erasNarrowRegex=rE,Ue.months=Rk,Ue.monthsShort=Wk,Ue.monthsParse=Lk,Ue.monthsRegex=Yk,Ue.monthsShortRegex=Uk,Ue.week=Vk,Ue.firstDayOfYear=Zk,Ue.firstDayOfWeek=Hk,Ue.weekdays=rx,Ue.weekdaysMin=sx,Ue.weekdaysShort=ox,Ue.weekdaysParse=ax,Ue.weekdaysRegex=fx,Ue.weekdaysShortRegex=dx,Ue.weekdaysMinRegex=hx,Ue.isPM=mx,Ue.meridiem=vx;function _i(e,t,n,r){var o=qn(),s=Dn().set(r,t);return o[n](s,e)}function Ip(e,t,n){if(Vn(e)&&(t=e,e=void 0),e=e||"",t!=null)return _i(e,t,n,"month");var r,o=[];for(r=0;r<12;r++)o[r]=_i(e,r,n,"month");return o}function jc(e,t,n,r){typeof e=="boolean"?(Vn(t)&&(n=t,t=void 0),t=t||""):(t=e,n=t,e=!1,Vn(t)&&(n=t,t=void 0),t=t||"");var o=qn(),s=e?o._week.dow:0,i,a=[];if(n!=null)return _i(t,(n+s)%7,r,"day");for(i=0;i<7;i++)a[i]=_i(t,(i+s)%7,r,"day");return a}function kE(e,t){return Ip(e,t,"months")}function xE(e,t){return Ip(e,t,"monthsShort")}function OE(e,t,n){return jc(e,t,n,"weekdays")}function EE(e,t,n){return jc(e,t,n,"weekdaysShort")}function CE(e,t,n){return jc(e,t,n,"weekdaysMin")}vr("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10,n=Fe(e%100/10)===1?"th":t===1?"st":t===2?"nd":t===3?"rd":"th";return e+n}}),ce.lang=en("moment.lang is deprecated. Use moment.locale instead.",vr),ce.langData=en("moment.langData is deprecated. Use moment.localeData instead.",qn);var Kn=Math.abs;function TE(){var e=this._data;return this._milliseconds=Kn(this._milliseconds),this._days=Kn(this._days),this._months=Kn(this._months),e.milliseconds=Kn(e.milliseconds),e.seconds=Kn(e.seconds),e.minutes=Kn(e.minutes),e.hours=Kn(e.hours),e.months=Kn(e.months),e.years=Kn(e.years),this}function Fp(e,t,n,r){var o=gn(t,n);return e._milliseconds+=r*o._milliseconds,e._days+=r*o._days,e._months+=r*o._months,e._bubble()}function DE(e,t){return Fp(this,e,t,1)}function AE(e,t){return Fp(this,e,t,-1)}function Rp(e){return e<0?Math.floor(e):Math.ceil(e)}function ME(){var e=this._milliseconds,t=this._days,n=this._months,r=this._data,o,s,i,a,c;return e>=0&&t>=0&&n>=0||e<=0&&t<=0&&n<=0||(e+=Rp(Vc(n)+t)*864e5,t=0,n=0),r.milliseconds=e%1e3,o=nn(e/1e3),r.seconds=o%60,s=nn(o/60),r.minutes=s%60,i=nn(s/60),r.hours=i%24,t+=nn(i/24),c=nn(Wp(t)),n+=c,t-=Rp(Vc(c)),a=nn(n/12),n%=12,r.days=t,r.months=n,r.years=a,this}function Wp(e){return e*4800/146097}function Vc(e){return e*146097/4800}function PE(e){if(!this.isValid())return NaN;var t,n,r=this._milliseconds;if(e=tn(e),e==="month"||e==="quarter"||e==="year")switch(t=this._days+r/864e5,n=this._months+Wp(t),e){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(t=this._days+Math.round(Vc(this._months)),e){case"week":return t/7+r/6048e5;case"day":return t+r/864e5;case"hour":return t*24+r/36e5;case"minute":return t*1440+r/6e4;case"second":return t*86400+r/1e3;case"millisecond":return Math.floor(t*864e5)+r;default:throw new Error("Unknown unit "+e)}}function Xn(e){return function(){return this.as(e)}}var zp=Xn("ms"),NE=Xn("s"),IE=Xn("m"),FE=Xn("h"),RE=Xn("d"),WE=Xn("w"),zE=Xn("M"),LE=Xn("Q"),$E=Xn("y"),UE=zp;function YE(){return gn(this)}function jE(e){return e=tn(e),this.isValid()?this[e+"s"]():NaN}function Rr(e){return function(){return this.isValid()?this._data[e]:NaN}}var VE=Rr("milliseconds"),BE=Rr("seconds"),HE=Rr("minutes"),ZE=Rr("hours"),GE=Rr("days"),qE=Rr("months"),KE=Rr("years");function XE(){return nn(this.days()/7)}var Jn=Math.round,uo={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function JE(e,t,n,r,o){return o.relativeTime(t||1,!!n,e,r)}function QE(e,t,n,r){var o=gn(e).abs(),s=Jn(o.as("s")),i=Jn(o.as("m")),a=Jn(o.as("h")),c=Jn(o.as("d")),u=Jn(o.as("M")),l=Jn(o.as("w")),f=Jn(o.as("y")),d=s<=n.ss&&["s",s]||s<n.s&&["ss",s]||i<=1&&["m"]||i<n.m&&["mm",i]||a<=1&&["h"]||a<n.h&&["hh",a]||c<=1&&["d"]||c<n.d&&["dd",c];return n.w!=null&&(d=d||l<=1&&["w"]||l<n.w&&["ww",l]),d=d||u<=1&&["M"]||u<n.M&&["MM",u]||f<=1&&["y"]||["yy",f],d[2]=t,d[3]=+e>0,d[4]=r,JE.apply(null,d)}function eC(e){return e===void 0?Jn:typeof e=="function"?(Jn=e,!0):!1}function tC(e,t){return uo[e]===void 0?!1:t===void 0?uo[e]:(uo[e]=t,e==="s"&&(uo.ss=t-1),!0)}function nC(e,t){if(!this.isValid())return this.localeData().invalidDate();var n=!1,r=uo,o,s;return typeof e=="object"&&(t=e,e=!1),typeof e=="boolean"&&(n=e),typeof t=="object"&&(r=Object.assign({},uo,t),t.s!=null&&t.ss==null&&(r.ss=t.s-1)),o=this.localeData(),s=QE(this,!n,r,o),n&&(s=o.pastFuture(+this,s)),o.postformat(s)}var Bc=Math.abs;function fo(e){return(e>0)-(e<0)||+e}function Si(){if(!this.isValid())return this.localeData().invalidDate();var e=Bc(this._milliseconds)/1e3,t=Bc(this._days),n=Bc(this._months),r,o,s,i,a=this.asSeconds(),c,u,l,f;return a?(r=nn(e/60),o=nn(r/60),e%=60,r%=60,s=nn(n/12),n%=12,i=e?e.toFixed(3).replace(/\.?0+$/,""):"",c=a<0?"-":"",u=fo(this._months)!==fo(a)?"-":"",l=fo(this._days)!==fo(a)?"-":"",f=fo(this._milliseconds)!==fo(a)?"-":"",c+"P"+(s?u+s+"Y":"")+(n?u+n+"M":"")+(t?l+t+"D":"")+(o||r||e?"T":"")+(o?f+o+"H":"")+(r?f+r+"M":"")+(e?f+i+"S":"")):"P0D"}var Le=mi.prototype;Le.isValid=qx,Le.abs=TE,Le.add=DE,Le.subtract=AE,Le.as=PE,Le.asMilliseconds=zp,Le.asSeconds=NE,Le.asMinutes=IE,Le.asHours=FE,Le.asDays=RE,Le.asWeeks=WE,Le.asMonths=zE,Le.asQuarters=LE,Le.asYears=$E,Le.valueOf=UE,Le._bubble=ME,Le.clone=YE,Le.get=jE,Le.milliseconds=VE,Le.seconds=BE,Le.minutes=HE,Le.hours=ZE,Le.days=GE,Le.weeks=XE,Le.months=qE,Le.years=KE,Le.humanize=nC,Le.toISOString=Si,Le.toString=Si,Le.toJSON=Si,Le.locale=xp,Le.localeData=Ep,Le.toIsoString=en("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Si),Le.lang=Op,ge("X",0,0,"unix"),ge("x",0,0,"valueOf"),fe("x",ci),fe("X",kk),qe("X",function(e,t,n){n._d=new Date(parseFloat(e)*1e3)}),qe("x",function(e,t,n){n._d=new Date(Fe(e))});ce.version="2.30.1",rk(tt),ce.fn=se,ce.min=Bx,ce.max=Hx,ce.now=Zx,ce.utc=Dn,ce.unix=_E,ce.months=kE,ce.isDate=Ro,ce.locale=vr,ce.invalid=ni,ce.duration=gn,ce.isMoment=pn,ce.weekdays=OE,ce.parseZone=SE,ce.localeData=qn,ce.isDuration=gi,ce.monthsShort=xE,ce.weekdaysMin=CE,ce.defineLocale=Pc,ce.updateLocale=Sx,ce.locales=kx,ce.weekdaysShort=EE,ce.normalizeUnits=tn,ce.relativeTimeRounding=eC,ce.relativeTimeThreshold=tC,ce.calendarFormat=vO,ce.prototype=se,ce.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"};const Lp=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,$p=_s,rC=(e,t)=>n=>{var r;if(t?.variants==null)return $p(e,n?.class,n?.className);const{variants:o,defaultVariants:s}=t,i=Object.keys(o).map(u=>{const l=n?.[u],f=s?.[u];if(l===null)return null;const d=Lp(l)||Lp(f);return o[u][d]}),a=n&&Object.entries(n).reduce((u,l)=>{let[f,d]=l;return d===void 0||(u[f]=d),u},{}),c=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,l)=>{let{class:f,className:d,...h}=l;return Object.entries(h).every(m=>{let[p,y]=m;return Array.isArray(y)?y.includes({...s,...a}[p]):{...s,...a}[p]===y})?[...u,f,d]:u},[]);return $p(e,i,c,n?.class,n?.className)};function oC(e,t){return t.forEach((function(n){n&&typeof n!="string"&&!Array.isArray(n)&&Object.keys(n).forEach((function(r){if(r!=="default"&&!(r in e)){var o=Object.getOwnPropertyDescriptor(n,r);Object.defineProperty(e,r,o.get?o:{enumerable:!0,get:function(){return n[r]}})}}))})),Object.freeze(e)}function Up(e,t){return new Promise((function(n,r){let o;return sC(e).then((function(s){try{return o=s,n(new Blob([t.slice(0,2),o,t.slice(2)],{type:"image/jpeg"}))}catch(i){return r(i)}}),r)}))}const sC=e=>new Promise(((t,n)=>{const r=new FileReader;r.addEventListener("load",(({target:{result:o}})=>{const s=new DataView(o);let i=0;if(s.getUint16(i)!==65496)return n("not a valid JPEG");for(i+=2;;){const a=s.getUint16(i);if(a===65498)break;const c=s.getUint16(i+2);if(a===65505&&s.getUint32(i+4)===1165519206){const u=i+10;let l;switch(s.getUint16(u)){case 18761:l=!0;break;case 19789:l=!1;break;default:return n("TIFF header contains invalid endian")}if(s.getUint16(u+2,l)!==42)return n("TIFF header contains invalid version");const f=s.getUint32(u+4,l),d=u+f+2+12*s.getUint16(u+f,l);for(let h=u+f+2;h<d;h+=12)if(s.getUint16(h,l)==274){if(s.getUint16(h+2,l)!==3)return n("Orientation data type is invalid");if(s.getUint32(h+4,l)!==1)return n("Orientation data count is invalid");s.setUint16(h+8,1,l);break}return t(o.slice(i,i+2+c))}i+=2+c}return t(new Blob)})),r.readAsArrayBuffer(e)}));var ki={},iC={get exports(){return ki},set exports(e){ki=e}};(function(e){var t,n,r={};iC.exports=r,r.parse=function(o,s){for(var i=r.bin.readUshort,a=r.bin.readUint,c=0,u={},l=new Uint8Array(o),f=l.length-4;a(l,f)!=101010256;)f--;c=f,c+=4;var d=i(l,c+=4);i(l,c+=2);var h=a(l,c+=2),m=a(l,c+=4);c+=4,c=m;for(var p=0;p<d;p++){a(l,c),c+=4,c+=4,c+=4,a(l,c+=4),h=a(l,c+=4);var y=a(l,c+=4),g=i(l,c+=4),C=i(l,c+2),O=i(l,c+4);c+=6;var w=a(l,c+=8);c+=4,c+=g+C+O,r._readLocal(l,w,u,h,y,s)}return u},r._readLocal=function(o,s,i,a,c,u){var l=r.bin.readUshort,f=r.bin.readUint;f(o,s),l(o,s+=4),l(o,s+=2);var d=l(o,s+=2);f(o,s+=2),f(o,s+=4),s+=4;var h=l(o,s+=8),m=l(o,s+=2);s+=2;var p=r.bin.readUTF8(o,s,h);if(s+=h,s+=m,u)i[p]={size:c,csize:a};else{var y=new Uint8Array(o.buffer,s);if(d==0)i[p]=new Uint8Array(y.buffer.slice(s,s+a));else{if(d!=8)throw"unknown compression method: "+d;var g=new Uint8Array(c);r.inflateRaw(y,g),i[p]=g}}},r.inflateRaw=function(o,s){return r.F.inflate(o,s)},r.inflate=function(o,s){return o[0],o[1],r.inflateRaw(new Uint8Array(o.buffer,o.byteOffset+2,o.length-6),s)},r.deflate=function(o,s){s==null&&(s={level:6});var i=0,a=new Uint8Array(50+Math.floor(1.1*o.length));a[i]=120,a[i+1]=156,i+=2,i=r.F.deflateRaw(o,a,i,s.level);var c=r.adler(o,0,o.length);return a[i+0]=c>>>24&255,a[i+1]=c>>>16&255,a[i+2]=c>>>8&255,a[i+3]=c>>>0&255,new Uint8Array(a.buffer,0,i+4)},r.deflateRaw=function(o,s){s==null&&(s={level:6});var i=new Uint8Array(50+Math.floor(1.1*o.length)),a=r.F.deflateRaw(o,i,a,s.level);return new Uint8Array(i.buffer,0,a)},r.encode=function(o,s){s==null&&(s=!1);var i=0,a=r.bin.writeUint,c=r.bin.writeUshort,u={};for(var l in o){var f=!r._noNeed(l)&&!s,d=o[l],h=r.crc.crc(d,0,d.length);u[l]={cpr:f,usize:d.length,crc:h,file:f?r.deflateRaw(d):d}}for(var l in u)i+=u[l].file.length+30+46+2*r.bin.sizeUTF8(l);i+=22;var m=new Uint8Array(i),p=0,y=[];for(var l in u){var g=u[l];y.push(p),p=r._writeHeader(m,p,l,g,0)}var C=0,O=p;for(var l in u)g=u[l],y.push(p),p=r._writeHeader(m,p,l,g,1,y[C++]);var w=p-O;return a(m,p,101010256),p+=4,c(m,p+=4,C),c(m,p+=2,C),a(m,p+=2,w),a(m,p+=4,O),p+=4,p+=2,m.buffer},r._noNeed=function(o){var s=o.split(".").pop().toLowerCase();return"png,jpg,jpeg,zip".indexOf(s)!=-1},r._writeHeader=function(o,s,i,a,c,u){var l=r.bin.writeUint,f=r.bin.writeUshort,d=a.file;return l(o,s,c==0?67324752:33639248),s+=4,c==1&&(s+=2),f(o,s,20),f(o,s+=2,0),f(o,s+=2,a.cpr?8:0),l(o,s+=2,0),l(o,s+=4,a.crc),l(o,s+=4,d.length),l(o,s+=4,a.usize),f(o,s+=4,r.bin.sizeUTF8(i)),f(o,s+=2,0),s+=2,c==1&&(s+=2,s+=2,l(o,s+=6,u),s+=4),s+=r.bin.writeUTF8(o,s,i),c==0&&(o.set(d,s),s+=d.length),s},r.crc={table:(function(){for(var o=new Uint32Array(256),s=0;s<256;s++){for(var i=s,a=0;a<8;a++)1&i?i=3988292384^i>>>1:i>>>=1;o[s]=i}return o})(),update:function(o,s,i,a){for(var c=0;c<a;c++)o=r.crc.table[255&(o^s[i+c])]^o>>>8;return o},crc:function(o,s,i){return 4294967295^r.crc.update(4294967295,o,s,i)}},r.adler=function(o,s,i){for(var a=1,c=0,u=s,l=s+i;u<l;){for(var f=Math.min(u+5552,l);u<f;)c+=a+=o[u++];a%=65521,c%=65521}return c<<16|a},r.bin={readUshort:function(o,s){return o[s]|o[s+1]<<8},writeUshort:function(o,s,i){o[s]=255&i,o[s+1]=i>>8&255},readUint:function(o,s){return 16777216*o[s+3]+(o[s+2]<<16|o[s+1]<<8|o[s])},writeUint:function(o,s,i){o[s]=255&i,o[s+1]=i>>8&255,o[s+2]=i>>16&255,o[s+3]=i>>24&255},readASCII:function(o,s,i){for(var a="",c=0;c<i;c++)a+=String.fromCharCode(o[s+c]);return a},writeASCII:function(o,s,i){for(var a=0;a<i.length;a++)o[s+a]=i.charCodeAt(a)},pad:function(o){return o.length<2?"0"+o:o},readUTF8:function(o,s,i){for(var a,c="",u=0;u<i;u++)c+="%"+r.bin.pad(o[s+u].toString(16));try{a=decodeURIComponent(c)}catch{return r.bin.readASCII(o,s,i)}return a},writeUTF8:function(o,s,i){for(var a=i.length,c=0,u=0;u<a;u++){var l=i.charCodeAt(u);if((4294967168&l)==0)o[s+c]=l,c++;else if((4294965248&l)==0)o[s+c]=192|l>>6,o[s+c+1]=128|l>>0&63,c+=2;else if((4294901760&l)==0)o[s+c]=224|l>>12,o[s+c+1]=128|l>>6&63,o[s+c+2]=128|l>>0&63,c+=3;else{if((4292870144&l)!=0)throw"e";o[s+c]=240|l>>18,o[s+c+1]=128|l>>12&63,o[s+c+2]=128|l>>6&63,o[s+c+3]=128|l>>0&63,c+=4}}return c},sizeUTF8:function(o){for(var s=o.length,i=0,a=0;a<s;a++){var c=o.charCodeAt(a);if((4294967168&c)==0)i++;else if((4294965248&c)==0)i+=2;else if((4294901760&c)==0)i+=3;else{if((4292870144&c)!=0)throw"e";i+=4}}return i}},r.F={},r.F.deflateRaw=function(o,s,i,a){var c=[[0,0,0,0,0],[4,4,8,4,0],[4,5,16,8,0],[4,6,16,16,0],[4,10,16,32,0],[8,16,32,32,0],[8,16,128,128,0],[8,32,128,256,0],[32,128,258,1024,1],[32,258,258,4096,1]][a],u=r.F.U,l=r.F._goodIndex;r.F._hash;var f=r.F._putsE,d=0,h=i<<3,m=0,p=o.length;if(a==0){for(;d<p;)f(s,h,d+(A=Math.min(65535,p-d))==p?1:0),h=r.F._copyExact(o,d,A,s,h+8),d+=A;return h>>>3}var y=u.lits,g=u.strt,C=u.prev,O=0,w=0,_=0,S=0,I=0,v=0;for(p>2&&(g[v=r.F._hash(o,0)]=0),d=0;d<p;d++){if(I=v,d+1<p-2){v=r.F._hash(o,d+1);var x=d+1&32767;C[x]=g[v],g[v]=x}if(m<=d){(O>14e3||w>26697)&&p-d>100&&(m<d&&(y[O]=d-m,O+=2,m=d),h=r.F._writeBlock(d==p-1||m==p?1:0,y,O,S,o,_,d-_,s,h),O=w=S=0,_=d);var P=0;d<p-2&&(P=r.F._bestMatch(o,d,C,I,Math.min(c[2],p-d),c[3]));var A=P>>>16,M=65535&P;if(P!=0){M=65535&P;var F=l(A=P>>>16,u.of0);u.lhst[257+F]++;var N=l(M,u.df0);u.dhst[N]++,S+=u.exb[F]+u.dxb[N],y[O]=A<<23|d-m,y[O+1]=M<<16|F<<8|N,O+=2,m=d+A}else u.lhst[o[d]]++;w++}}for(_==d&&o.length!=0||(m<d&&(y[O]=d-m,O+=2,m=d),h=r.F._writeBlock(1,y,O,S,o,_,d-_,s,h),O=0,w=0,O=w=S=0,_=d);(7&h)!=0;)h++;return h>>>3},r.F._bestMatch=function(o,s,i,a,c,u){var l=32767&s,f=i[l],d=l-f+32768&32767;if(f==l||a!=r.F._hash(o,s-d))return 0;for(var h=0,m=0,p=Math.min(32767,s);d<=p&&--u!=0&&f!=l;){if(h==0||o[s+h]==o[s+h-d]){var y=r.F._howLong(o,s,d);if(y>h){if(m=d,(h=y)>=c)break;d+2<y&&(y=d+2);for(var g=0,C=0;C<y-2;C++){var O=s-d+C+32768&32767,w=O-i[O]+32768&32767;w>g&&(g=w,f=O)}}}d+=(l=f)-(f=i[l])+32768&32767}return h<<16|m},r.F._howLong=function(o,s,i){if(o[s]!=o[s-i]||o[s+1]!=o[s+1-i]||o[s+2]!=o[s+2-i])return 0;var a=s,c=Math.min(o.length,s+258);for(s+=3;s<c&&o[s]==o[s-i];)s++;return s-a},r.F._hash=function(o,s){return(o[s]<<8|o[s+1])+(o[s+2]<<4)&65535},r.saved=0,r.F._writeBlock=function(o,s,i,a,c,u,l,f,d){var h,m,p,y,g,C,O,w,_,S=r.F.U,I=r.F._putsF,v=r.F._putsE;S.lhst[256]++,m=(h=r.F.getTrees())[0],p=h[1],y=h[2],g=h[3],C=h[4],O=h[5],w=h[6],_=h[7];var x=32+((d+3&7)==0?0:8-(d+3&7))+(l<<3),P=a+r.F.contSize(S.fltree,S.lhst)+r.F.contSize(S.fdtree,S.dhst),A=a+r.F.contSize(S.ltree,S.lhst)+r.F.contSize(S.dtree,S.dhst);A+=14+3*O+r.F.contSize(S.itree,S.ihst)+(2*S.ihst[16]+3*S.ihst[17]+7*S.ihst[18]);for(var M=0;M<286;M++)S.lhst[M]=0;for(M=0;M<30;M++)S.dhst[M]=0;for(M=0;M<19;M++)S.ihst[M]=0;var F=x<P&&x<A?0:P<A?1:2;if(I(f,d,o),I(f,d+1,F),d+=3,F==0){for(;(7&d)!=0;)d++;d=r.F._copyExact(c,u,l,f,d)}else{var N,W;if(F==1&&(N=S.fltree,W=S.fdtree),F==2){r.F.makeCodes(S.ltree,m),r.F.revCodes(S.ltree,m),r.F.makeCodes(S.dtree,p),r.F.revCodes(S.dtree,p),r.F.makeCodes(S.itree,y),r.F.revCodes(S.itree,y),N=S.ltree,W=S.dtree,v(f,d,g-257),v(f,d+=5,C-1),v(f,d+=5,O-4),d+=4;for(var E=0;E<O;E++)v(f,d+3*E,S.itree[1+(S.ordr[E]<<1)]);d+=3*O,d=r.F._codeTiny(w,S.itree,f,d),d=r.F._codeTiny(_,S.itree,f,d)}for(var k=u,U=0;U<i;U+=2){for(var $=s[U],D=$>>>23,V=k+(8388607&$);k<V;)d=r.F._writeLit(c[k++],N,f,d);if(D!=0){var Z=s[U+1],G=Z>>16,B=Z>>8&255,z=255&Z;v(f,d=r.F._writeLit(257+B,N,f,d),D-S.of0[B]),d+=S.exb[B],I(f,d=r.F._writeLit(z,W,f,d),G-S.df0[z]),d+=S.dxb[z],k+=D}}d=r.F._writeLit(256,N,f,d)}return d},r.F._copyExact=function(o,s,i,a,c){var u=c>>>3;return a[u]=i,a[u+1]=i>>>8,a[u+2]=255-a[u],a[u+3]=255-a[u+1],u+=4,a.set(new Uint8Array(o.buffer,s,i),u),c+(i+4<<3)},r.F.getTrees=function(){for(var o=r.F.U,s=r.F._hufTree(o.lhst,o.ltree,15),i=r.F._hufTree(o.dhst,o.dtree,15),a=[],c=r.F._lenCodes(o.ltree,a),u=[],l=r.F._lenCodes(o.dtree,u),f=0;f<a.length;f+=2)o.ihst[a[f]]++;for(f=0;f<u.length;f+=2)o.ihst[u[f]]++;for(var d=r.F._hufTree(o.ihst,o.itree,7),h=19;h>4&&o.itree[1+(o.ordr[h-1]<<1)]==0;)h--;return[s,i,d,c,l,h,a,u]},r.F.getSecond=function(o){for(var s=[],i=0;i<o.length;i+=2)s.push(o[i+1]);return s},r.F.nonZero=function(o){for(var s="",i=0;i<o.length;i+=2)o[i+1]!=0&&(s+=(i>>1)+",");return s},r.F.contSize=function(o,s){for(var i=0,a=0;a<s.length;a++)i+=s[a]*o[1+(a<<1)];return i},r.F._codeTiny=function(o,s,i,a){for(var c=0;c<o.length;c+=2){var u=o[c],l=o[c+1];a=r.F._writeLit(u,s,i,a);var f=u==16?2:u==17?3:7;u>15&&(r.F._putsE(i,a,l,f),a+=f)}return a},r.F._lenCodes=function(o,s){for(var i=o.length;i!=2&&o[i-1]==0;)i-=2;for(var a=0;a<i;a+=2){var c=o[a+1],u=a+3<i?o[a+3]:-1,l=a+5<i?o[a+5]:-1,f=a==0?-1:o[a-1];if(c==0&&u==c&&l==c){for(var d=a+5;d+2<i&&o[d+2]==c;)d+=2;(h=Math.min(d+1-a>>>1,138))<11?s.push(17,h-3):s.push(18,h-11),a+=2*h-2}else if(c==f&&u==c&&l==c){for(d=a+5;d+2<i&&o[d+2]==c;)d+=2;var h=Math.min(d+1-a>>>1,6);s.push(16,h-3),a+=2*h-2}else s.push(c,0)}return i>>>1},r.F._hufTree=function(o,s,i){var a=[],c=o.length,u=s.length,l=0;for(l=0;l<u;l+=2)s[l]=0,s[l+1]=0;for(l=0;l<c;l++)o[l]!=0&&a.push({lit:l,f:o[l]});var f=a.length,d=a.slice(0);if(f==0)return 0;if(f==1){var h=a[0].lit;return d=h==0?1:0,s[1+(h<<1)]=1,s[1+(d<<1)]=1,1}a.sort((function(w,_){return w.f-_.f}));var m=a[0],p=a[1],y=0,g=1,C=2;for(a[0]={lit:-1,f:m.f+p.f,l:m,r:p,d:0};g!=f-1;)m=y!=g&&(C==f||a[y].f<a[C].f)?a[y++]:a[C++],p=y!=g&&(C==f||a[y].f<a[C].f)?a[y++]:a[C++],a[g++]={lit:-1,f:m.f+p.f,l:m,r:p};var O=r.F.setDepth(a[g-1],0);for(O>i&&(r.F.restrictDepth(d,i,O),O=i),l=0;l<f;l++)s[1+(d[l].lit<<1)]=d[l].d;return O},r.F.setDepth=function(o,s){return o.lit!=-1?(o.d=s,s):Math.max(r.F.setDepth(o.l,s+1),r.F.setDepth(o.r,s+1))},r.F.restrictDepth=function(o,s,i){var a=0,c=1<<i-s,u=0;for(o.sort((function(f,d){return d.d==f.d?f.f-d.f:d.d-f.d})),a=0;a<o.length&&o[a].d>s;a++){var l=o[a].d;o[a].d=s,u+=c-(1<<i-l)}for(u>>>=i-s;u>0;)(l=o[a].d)<s?(o[a].d++,u-=1<<s-l-1):a++;for(;a>=0;a--)o[a].d==s&&u<0&&(o[a].d--,u++);u!=0&&console.log("debt left")},r.F._goodIndex=function(o,s){var i=0;return s[16|i]<=o&&(i|=16),s[8|i]<=o&&(i|=8),s[4|i]<=o&&(i|=4),s[2|i]<=o&&(i|=2),s[1|i]<=o&&(i|=1),i},r.F._writeLit=function(o,s,i,a){return r.F._putsF(i,a,s[o<<1]),a+s[1+(o<<1)]},r.F.inflate=function(o,s){var i=Uint8Array;if(o[0]==3&&o[1]==0)return s||new i(0);var a=r.F,c=a._bitsF,u=a._bitsE,l=a._decodeTiny,f=a.makeCodes,d=a.codes2map,h=a._get17,m=a.U,p=s==null;p&&(s=new i(o.length>>>2<<3));for(var y,g,C=0,O=0,w=0,_=0,S=0,I=0,v=0,x=0,P=0;C==0;)if(C=c(o,P,1),O=c(o,P+1,2),P+=3,O!=0){if(p&&(s=r.F._check(s,x+(1<<17))),O==1&&(y=m.flmap,g=m.fdmap,I=511,v=31),O==2){w=u(o,P,5)+257,_=u(o,P+5,5)+1,S=u(o,P+10,4)+4,P+=14;for(var A=0;A<38;A+=2)m.itree[A]=0,m.itree[A+1]=0;var M=1;for(A=0;A<S;A++){var F=u(o,P+3*A,3);m.itree[1+(m.ordr[A]<<1)]=F,F>M&&(M=F)}P+=3*S,f(m.itree,M),d(m.itree,M,m.imap),y=m.lmap,g=m.dmap,P=l(m.imap,(1<<M)-1,w+_,o,P,m.ttree);var N=a._copyOut(m.ttree,0,w,m.ltree);I=(1<<N)-1;var W=a._copyOut(m.ttree,w,_,m.dtree);v=(1<<W)-1,f(m.ltree,N),d(m.ltree,N,y),f(m.dtree,W),d(m.dtree,W,g)}for(;;){var E=y[h(o,P)&I];P+=15&E;var k=E>>>4;if(!(k>>>8))s[x++]=k;else{if(k==256)break;var U=x+k-254;if(k>264){var $=m.ldef[k-257];U=x+($>>>3)+u(o,P,7&$),P+=7&$}var D=g[h(o,P)&v];P+=15&D;var V=D>>>4,Z=m.ddef[V],G=(Z>>>4)+c(o,P,15&Z);for(P+=15&Z,p&&(s=r.F._check(s,x+(1<<17)));x<U;)s[x]=s[x++-G],s[x]=s[x++-G],s[x]=s[x++-G],s[x]=s[x++-G];x=U}}}else{(7&P)!=0&&(P+=8-(7&P));var B=4+(P>>>3),z=o[B-4]|o[B-3]<<8;p&&(s=r.F._check(s,x+z)),s.set(new i(o.buffer,o.byteOffset+B,z),x),P=B+z<<3,x+=z}return s.length==x?s:s.slice(0,x)},r.F._check=function(o,s){var i=o.length;if(s<=i)return o;var a=new Uint8Array(Math.max(i<<1,s));return a.set(o,0),a},r.F._decodeTiny=function(o,s,i,a,c,u){for(var l=r.F._bitsE,f=r.F._get17,d=0;d<i;){var h=o[f(a,c)&s];c+=15&h;var m=h>>>4;if(m<=15)u[d]=m,d++;else{var p=0,y=0;m==16?(y=3+l(a,c,2),c+=2,p=u[d-1]):m==17?(y=3+l(a,c,3),c+=3):m==18&&(y=11+l(a,c,7),c+=7);for(var g=d+y;d<g;)u[d]=p,d++}}return c},r.F._copyOut=function(o,s,i,a){for(var c=0,u=0,l=a.length>>>1;u<i;){var f=o[u+s];a[u<<1]=0,a[1+(u<<1)]=f,f>c&&(c=f),u++}for(;u<l;)a[u<<1]=0,a[1+(u<<1)]=0,u++;return c},r.F.makeCodes=function(o,s){for(var i,a,c,u,l=r.F.U,f=o.length,d=l.bl_count,h=0;h<=s;h++)d[h]=0;for(h=1;h<f;h+=2)d[o[h]]++;var m=l.next_code;for(i=0,d[0]=0,a=1;a<=s;a++)i=i+d[a-1]<<1,m[a]=i;for(c=0;c<f;c+=2)(u=o[c+1])!=0&&(o[c]=m[u],m[u]++)},r.F.codes2map=function(o,s,i){for(var a=o.length,c=r.F.U.rev15,u=0;u<a;u+=2)if(o[u+1]!=0)for(var l=u>>1,f=o[u+1],d=l<<4|f,h=s-f,m=o[u]<<h,p=m+(1<<h);m!=p;)i[c[m]>>>15-s]=d,m++},r.F.revCodes=function(o,s){for(var i=r.F.U.rev15,a=15-s,c=0;c<o.length;c+=2){var u=o[c]<<s-o[c+1];o[c]=i[u]>>>a}},r.F._putsE=function(o,s,i){i<<=7&s;var a=s>>>3;o[a]|=i,o[a+1]|=i>>>8},r.F._putsF=function(o,s,i){i<<=7&s;var a=s>>>3;o[a]|=i,o[a+1]|=i>>>8,o[a+2]|=i>>>16},r.F._bitsE=function(o,s,i){return(o[s>>>3]|o[1+(s>>>3)]<<8)>>>(7&s)&(1<<i)-1},r.F._bitsF=function(o,s,i){return(o[s>>>3]|o[1+(s>>>3)]<<8|o[2+(s>>>3)]<<16)>>>(7&s)&(1<<i)-1},r.F._get17=function(o,s){return(o[s>>>3]|o[1+(s>>>3)]<<8|o[2+(s>>>3)]<<16)>>>(7&s)},r.F._get25=function(o,s){return(o[s>>>3]|o[1+(s>>>3)]<<8|o[2+(s>>>3)]<<16|o[3+(s>>>3)]<<24)>>>(7&s)},r.F.U=(t=Uint16Array,n=Uint32Array,{next_code:new t(16),bl_count:new t(16),ordr:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],of0:[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],exb:[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0],ldef:new t(32),df0:[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,65535,65535],dxb:[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0],ddef:new n(32),flmap:new t(512),fltree:[],fdmap:new t(32),fdtree:[],lmap:new t(32768),ltree:[],ttree:[],dmap:new t(32768),dtree:[],imap:new t(512),itree:[],rev15:new t(32768),lhst:new n(286),dhst:new n(30),ihst:new n(19),lits:new n(15e3),strt:new t(65536),prev:new t(32768)}),(function(){for(var o=r.F.U,s=0;s<32768;s++){var i=s;i=(4278255360&(i=(4042322160&(i=(3435973836&(i=(2863311530&i)>>>1|(1431655765&i)<<1))>>>2|(858993459&i)<<2))>>>4|(252645135&i)<<4))>>>8|(16711935&i)<<8,o.rev15[s]=(i>>>16|i<<16)>>>17}function a(c,u,l){for(;u--!=0;)c.push(0,l)}for(s=0;s<32;s++)o.ldef[s]=o.of0[s]<<3|o.exb[s],o.ddef[s]=o.df0[s]<<4|o.dxb[s];a(o.fltree,144,8),a(o.fltree,112,9),a(o.fltree,24,7),a(o.fltree,8,8),r.F.makeCodes(o.fltree,9),r.F.codes2map(o.fltree,9,o.flmap),r.F.revCodes(o.fltree,9),a(o.fdtree,32,5),r.F.makeCodes(o.fdtree,5),r.F.codes2map(o.fdtree,5,o.fdmap),r.F.revCodes(o.fdtree,5),a(o.itree,19,0),a(o.ltree,286,0),a(o.dtree,30,0),a(o.ttree,320,0)})()})();var aC=oC({__proto__:null,default:ki},[ki]);const yn=(function(){var e={nextZero(l,f){for(;l[f]!=0;)f++;return f},readUshort:(l,f)=>l[f]<<8|l[f+1],writeUshort(l,f,d){l[f]=d>>8&255,l[f+1]=255&d},readUint:(l,f)=>16777216*l[f]+(l[f+1]<<16|l[f+2]<<8|l[f+3]),writeUint(l,f,d){l[f]=d>>24&255,l[f+1]=d>>16&255,l[f+2]=d>>8&255,l[f+3]=255&d},readASCII(l,f,d){let h="";for(let m=0;m<d;m++)h+=String.fromCharCode(l[f+m]);return h},writeASCII(l,f,d){for(let h=0;h<d.length;h++)l[f+h]=d.charCodeAt(h)},readBytes(l,f,d){const h=[];for(let m=0;m<d;m++)h.push(l[f+m]);return h},pad:l=>l.length<2?`0${l}`:l,readUTF8(l,f,d){let h,m="";for(let p=0;p<d;p++)m+=`%${e.pad(l[f+p].toString(16))}`;try{h=decodeURIComponent(m)}catch{return e.readASCII(l,f,d)}return h}};function t(l,f,d,h){const m=f*d,p=s(h),y=Math.ceil(f*p/8),g=new Uint8Array(4*m),C=new Uint32Array(g.buffer),{ctype:O}=h,{depth:w}=h,_=e.readUshort;if(O==6){const $=m<<2;if(w==8)for(var S=0;S<$;S+=4)g[S]=l[S],g[S+1]=l[S+1],g[S+2]=l[S+2],g[S+3]=l[S+3];if(w==16)for(S=0;S<$;S++)g[S]=l[S<<1]}else if(O==2){const $=h.tabs.tRNS;if($==null){if(w==8)for(S=0;S<m;S++){var I=3*S;C[S]=255<<24|l[I+2]<<16|l[I+1]<<8|l[I]}if(w==16)for(S=0;S<m;S++)I=6*S,C[S]=255<<24|l[I+4]<<16|l[I+2]<<8|l[I]}else{var v=$[0];const D=$[1],V=$[2];if(w==8)for(S=0;S<m;S++){var x=S<<2;I=3*S,C[S]=255<<24|l[I+2]<<16|l[I+1]<<8|l[I],l[I]==v&&l[I+1]==D&&l[I+2]==V&&(g[x+3]=0)}if(w==16)for(S=0;S<m;S++)x=S<<2,I=6*S,C[S]=255<<24|l[I+4]<<16|l[I+2]<<8|l[I],_(l,I)==v&&_(l,I+2)==D&&_(l,I+4)==V&&(g[x+3]=0)}}else if(O==3){const $=h.tabs.PLTE,D=h.tabs.tRNS,V=D?D.length:0;if(w==1)for(var P=0;P<d;P++){var A=P*y,M=P*f;for(S=0;S<f;S++){x=M+S<<2;var F=3*(N=l[A+(S>>3)]>>7-((7&S)<<0)&1);g[x]=$[F],g[x+1]=$[F+1],g[x+2]=$[F+2],g[x+3]=N<V?D[N]:255}}if(w==2)for(P=0;P<d;P++)for(A=P*y,M=P*f,S=0;S<f;S++)x=M+S<<2,F=3*(N=l[A+(S>>2)]>>6-((3&S)<<1)&3),g[x]=$[F],g[x+1]=$[F+1],g[x+2]=$[F+2],g[x+3]=N<V?D[N]:255;if(w==4)for(P=0;P<d;P++)for(A=P*y,M=P*f,S=0;S<f;S++)x=M+S<<2,F=3*(N=l[A+(S>>1)]>>4-((1&S)<<2)&15),g[x]=$[F],g[x+1]=$[F+1],g[x+2]=$[F+2],g[x+3]=N<V?D[N]:255;if(w==8)for(S=0;S<m;S++){var N;x=S<<2,F=3*(N=l[S]),g[x]=$[F],g[x+1]=$[F+1],g[x+2]=$[F+2],g[x+3]=N<V?D[N]:255}}else if(O==4){if(w==8)for(S=0;S<m;S++){x=S<<2;var W=l[E=S<<1];g[x]=W,g[x+1]=W,g[x+2]=W,g[x+3]=l[E+1]}if(w==16)for(S=0;S<m;S++){var E;x=S<<2,W=l[E=S<<2],g[x]=W,g[x+1]=W,g[x+2]=W,g[x+3]=l[E+2]}}else if(O==0)for(v=h.tabs.tRNS?h.tabs.tRNS:-1,P=0;P<d;P++){const $=P*y,D=P*f;if(w==1)for(var k=0;k<f;k++){var U=(W=255*(l[$+(k>>>3)]>>>7-(7&k)&1))==255*v?0:255;C[D+k]=U<<24|W<<16|W<<8|W}else if(w==2)for(k=0;k<f;k++)U=(W=85*(l[$+(k>>>2)]>>>6-((3&k)<<1)&3))==85*v?0:255,C[D+k]=U<<24|W<<16|W<<8|W;else if(w==4)for(k=0;k<f;k++)U=(W=17*(l[$+(k>>>1)]>>>4-((1&k)<<2)&15))==17*v?0:255,C[D+k]=U<<24|W<<16|W<<8|W;else if(w==8)for(k=0;k<f;k++)U=(W=l[$+k])==v?0:255,C[D+k]=U<<24|W<<16|W<<8|W;else if(w==16)for(k=0;k<f;k++)W=l[$+(k<<1)],U=_(l,$+(k<<1))==v?0:255,C[D+k]=U<<24|W<<16|W<<8|W}return g}function n(l,f,d,h){const m=s(l),p=Math.ceil(d*m/8),y=new Uint8Array((p+1+l.interlace)*h);return f=l.tabs.CgBI?o(f,y):r(f,y),l.interlace==0?f=i(f,l,0,d,h):l.interlace==1&&(f=(function(C,O){const w=O.width,_=O.height,S=s(O),I=S>>3,v=Math.ceil(w*S/8),x=new Uint8Array(_*v);let P=0;const A=[0,0,4,0,2,0,1],M=[0,4,0,2,0,1,0],F=[8,8,8,4,4,2,2],N=[8,8,4,4,2,2,1];let W=0;for(;W<7;){const k=F[W],U=N[W];let $=0,D=0,V=A[W];for(;V<_;)V+=k,D++;let Z=M[W];for(;Z<w;)Z+=U,$++;const G=Math.ceil($*S/8);i(C,O,P,$,D);let B=0,z=A[W];for(;z<_;){let X=M[W],q=P+B*G<<3;for(;X<w;){var E;if(S==1&&(E=(E=C[q>>3])>>7-(7&q)&1,x[z*v+(X>>3)]|=E<<7-((7&X)<<0)),S==2&&(E=(E=C[q>>3])>>6-(7&q)&3,x[z*v+(X>>2)]|=E<<6-((3&X)<<1)),S==4&&(E=(E=C[q>>3])>>4-(7&q)&15,x[z*v+(X>>1)]|=E<<4-((1&X)<<2)),S>=8){const oe=z*v+X*I;for(let Q=0;Q<I;Q++)x[oe+Q]=C[(q>>3)+Q]}q+=S,X+=U}B++,z+=k}$*D!=0&&(P+=D*(1+G)),W+=1}return x})(f,l)),f}function r(l,f){return o(new Uint8Array(l.buffer,2,l.length-6),f)}var o=(function(){const l={H:{}};return l.H.N=function(f,d){const h=Uint8Array;let m,p,y=0,g=0,C=0,O=0,w=0,_=0,S=0,I=0,v=0;if(f[0]==3&&f[1]==0)return d||new h(0);const x=l.H,P=x.b,A=x.e,M=x.R,F=x.n,N=x.A,W=x.Z,E=x.m,k=d==null;for(k&&(d=new h(f.length>>>2<<5));y==0;)if(y=P(f,v,1),g=P(f,v+1,2),v+=3,g!=0){if(k&&(d=l.H.W(d,I+(1<<17))),g==1&&(m=E.J,p=E.h,_=511,S=31),g==2){C=A(f,v,5)+257,O=A(f,v+5,5)+1,w=A(f,v+10,4)+4,v+=14;let $=1;for(var U=0;U<38;U+=2)E.Q[U]=0,E.Q[U+1]=0;for(U=0;U<w;U++){const Z=A(f,v+3*U,3);E.Q[1+(E.X[U]<<1)]=Z,Z>$&&($=Z)}v+=3*w,F(E.Q,$),N(E.Q,$,E.u),m=E.w,p=E.d,v=M(E.u,(1<<$)-1,C+O,f,v,E.v);const D=x.V(E.v,0,C,E.C);_=(1<<D)-1;const V=x.V(E.v,C,O,E.D);S=(1<<V)-1,F(E.C,D),N(E.C,D,m),F(E.D,V),N(E.D,V,p)}for(;;){const $=m[W(f,v)&_];v+=15&$;const D=$>>>4;if(!(D>>>8))d[I++]=D;else{if(D==256)break;{let V=I+D-254;if(D>264){const X=E.q[D-257];V=I+(X>>>3)+A(f,v,7&X),v+=7&X}const Z=p[W(f,v)&S];v+=15&Z;const G=Z>>>4,B=E.c[G],z=(B>>>4)+P(f,v,15&B);for(v+=15&B;I<V;)d[I]=d[I++-z],d[I]=d[I++-z],d[I]=d[I++-z],d[I]=d[I++-z];I=V}}}}else{(7&v)!=0&&(v+=8-(7&v));const $=4+(v>>>3),D=f[$-4]|f[$-3]<<8;k&&(d=l.H.W(d,I+D)),d.set(new h(f.buffer,f.byteOffset+$,D),I),v=$+D<<3,I+=D}return d.length==I?d:d.slice(0,I)},l.H.W=function(f,d){const h=f.length;if(d<=h)return f;const m=new Uint8Array(h<<1);return m.set(f,0),m},l.H.R=function(f,d,h,m,p,y){const g=l.H.e,C=l.H.Z;let O=0;for(;O<h;){const w=f[C(m,p)&d];p+=15&w;const _=w>>>4;if(_<=15)y[O]=_,O++;else{let S=0,I=0;_==16?(I=3+g(m,p,2),p+=2,S=y[O-1]):_==17?(I=3+g(m,p,3),p+=3):_==18&&(I=11+g(m,p,7),p+=7);const v=O+I;for(;O<v;)y[O]=S,O++}}return p},l.H.V=function(f,d,h,m){let p=0,y=0;const g=m.length>>>1;for(;y<h;){const C=f[y+d];m[y<<1]=0,m[1+(y<<1)]=C,C>p&&(p=C),y++}for(;y<g;)m[y<<1]=0,m[1+(y<<1)]=0,y++;return p},l.H.n=function(f,d){const h=l.H.m,m=f.length;let p,y,g,C;const O=h.j;for(var w=0;w<=d;w++)O[w]=0;for(w=1;w<m;w+=2)O[f[w]]++;const _=h.K;for(p=0,O[0]=0,y=1;y<=d;y++)p=p+O[y-1]<<1,_[y]=p;for(g=0;g<m;g+=2)C=f[g+1],C!=0&&(f[g]=_[C],_[C]++)},l.H.A=function(f,d,h){const m=f.length,p=l.H.m.r;for(let y=0;y<m;y+=2)if(f[y+1]!=0){const g=y>>1,C=f[y+1],O=g<<4|C,w=d-C;let _=f[y]<<w;const S=_+(1<<w);for(;_!=S;)h[p[_]>>>15-d]=O,_++}},l.H.l=function(f,d){const h=l.H.m.r,m=15-d;for(let p=0;p<f.length;p+=2){const y=f[p]<<d-f[p+1];f[p]=h[y]>>>m}},l.H.M=function(f,d,h){h<<=7&d;const m=d>>>3;f[m]|=h,f[m+1]|=h>>>8},l.H.I=function(f,d,h){h<<=7&d;const m=d>>>3;f[m]|=h,f[m+1]|=h>>>8,f[m+2]|=h>>>16},l.H.e=function(f,d,h){return(f[d>>>3]|f[1+(d>>>3)]<<8)>>>(7&d)&(1<<h)-1},l.H.b=function(f,d,h){return(f[d>>>3]|f[1+(d>>>3)]<<8|f[2+(d>>>3)]<<16)>>>(7&d)&(1<<h)-1},l.H.Z=function(f,d){return(f[d>>>3]|f[1+(d>>>3)]<<8|f[2+(d>>>3)]<<16)>>>(7&d)},l.H.i=function(f,d){return(f[d>>>3]|f[1+(d>>>3)]<<8|f[2+(d>>>3)]<<16|f[3+(d>>>3)]<<24)>>>(7&d)},l.H.m=(function(){const f=Uint16Array,d=Uint32Array;return{K:new f(16),j:new f(16),X:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],S:[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],T:[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0],q:new f(32),p:[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,65535,65535],z:[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0],c:new d(32),J:new f(512),_:[],h:new f(32),$:[],w:new f(32768),C:[],v:[],d:new f(32768),D:[],u:new f(512),Q:[],r:new f(32768),s:new d(286),Y:new d(30),a:new d(19),t:new d(15e3),k:new f(65536),g:new f(32768)}})(),(function(){const f=l.H.m;for(var d=0;d<32768;d++){let m=d;m=(2863311530&m)>>>1|(1431655765&m)<<1,m=(3435973836&m)>>>2|(858993459&m)<<2,m=(4042322160&m)>>>4|(252645135&m)<<4,m=(4278255360&m)>>>8|(16711935&m)<<8,f.r[d]=(m>>>16|m<<16)>>>17}function h(m,p,y){for(;p--!=0;)m.push(0,y)}for(d=0;d<32;d++)f.q[d]=f.S[d]<<3|f.T[d],f.c[d]=f.p[d]<<4|f.z[d];h(f._,144,8),h(f._,112,9),h(f._,24,7),h(f._,8,8),l.H.n(f._,9),l.H.A(f._,9,f.J),l.H.l(f._,9),h(f.$,32,5),l.H.n(f.$,5),l.H.A(f.$,5,f.h),l.H.l(f.$,5),h(f.Q,19,0),h(f.C,286,0),h(f.D,30,0),h(f.v,320,0)})(),l.H.N})();function s(l){return[1,null,3,1,2,null,4][l.ctype]*l.depth}function i(l,f,d,h,m){let p=s(f);const y=Math.ceil(h*p/8);let g,C;p=Math.ceil(p/8);let O=l[d],w=0;if(O>1&&(l[d]=[0,0,1][O-2]),O==3)for(w=p;w<y;w++)l[w+1]=l[w+1]+(l[w+1-p]>>>1)&255;for(let _=0;_<m;_++)if(g=d+_*y,C=g+_+1,O=l[C-1],w=0,O==0)for(;w<y;w++)l[g+w]=l[C+w];else if(O==1){for(;w<p;w++)l[g+w]=l[C+w];for(;w<y;w++)l[g+w]=l[C+w]+l[g+w-p]}else if(O==2)for(;w<y;w++)l[g+w]=l[C+w]+l[g+w-y];else if(O==3){for(;w<p;w++)l[g+w]=l[C+w]+(l[g+w-y]>>>1);for(;w<y;w++)l[g+w]=l[C+w]+(l[g+w-y]+l[g+w-p]>>>1)}else{for(;w<p;w++)l[g+w]=l[C+w]+a(0,l[g+w-y],0);for(;w<y;w++)l[g+w]=l[C+w]+a(l[g+w-p],l[g+w-y],l[g+w-p-y])}return l}function a(l,f,d){const h=l+f-d,m=h-l,p=h-f,y=h-d;return m*m<=p*p&&m*m<=y*y?l:p*p<=y*y?f:d}function c(l,f,d){d.width=e.readUint(l,f),f+=4,d.height=e.readUint(l,f),f+=4,d.depth=l[f],f++,d.ctype=l[f],f++,d.compress=l[f],f++,d.filter=l[f],f++,d.interlace=l[f],f++}function u(l,f,d,h,m,p,y,g,C){const O=Math.min(f,m),w=Math.min(d,p);let _=0,S=0;for(let W=0;W<w;W++)for(let E=0;E<O;E++)if(y>=0&&g>=0?(_=W*f+E<<2,S=(g+W)*m+y+E<<2):(_=(-g+W)*f-y+E<<2,S=W*m+E<<2),C==0)h[S]=l[_],h[S+1]=l[_+1],h[S+2]=l[_+2],h[S+3]=l[_+3];else if(C==1){var I=l[_+3]*.00392156862745098,v=l[_]*I,x=l[_+1]*I,P=l[_+2]*I,A=h[S+3]*(1/255),M=h[S]*A,F=h[S+1]*A,N=h[S+2]*A;const k=1-I,U=I+A*k,$=U==0?0:1/U;h[S+3]=255*U,h[S+0]=(v+M*k)*$,h[S+1]=(x+F*k)*$,h[S+2]=(P+N*k)*$}else if(C==2)I=l[_+3],v=l[_],x=l[_+1],P=l[_+2],A=h[S+3],M=h[S],F=h[S+1],N=h[S+2],I==A&&v==M&&x==F&&P==N?(h[S]=0,h[S+1]=0,h[S+2]=0,h[S+3]=0):(h[S]=v,h[S+1]=x,h[S+2]=P,h[S+3]=I);else if(C==3){if(I=l[_+3],v=l[_],x=l[_+1],P=l[_+2],A=h[S+3],M=h[S],F=h[S+1],N=h[S+2],I==A&&v==M&&x==F&&P==N)continue;if(I<220&&A>20)return!1}return!0}return{decode:function(f){const d=new Uint8Array(f);let h=8;const m=e,p=m.readUshort,y=m.readUint,g={tabs:{},frames:[]},C=new Uint8Array(d.length);let O,w=0,_=0;const S=[137,80,78,71,13,10,26,10];for(var I=0;I<8;I++)if(d[I]!=S[I])throw"The input is not a PNG file!";for(;h<d.length;){const W=m.readUint(d,h);h+=4;const E=m.readASCII(d,h,4);if(h+=4,E=="IHDR")c(d,h,g);else if(E=="iCCP"){for(var v=h;d[v]!=0;)v++;m.readASCII(d,h,v-h),d[v+1];const k=d.slice(v+2,h+W);let U=null;try{U=r(k)}catch{U=o(k)}g.tabs[E]=U}else if(E=="CgBI")g.tabs[E]=d.slice(h,h+4);else if(E=="IDAT"){for(I=0;I<W;I++)C[w+I]=d[h+I];w+=W}else if(E=="acTL")g.tabs[E]={num_frames:y(d,h),num_plays:y(d,h+4)},O=new Uint8Array(d.length);else if(E=="fcTL"){_!=0&&((N=g.frames[g.frames.length-1]).data=n(g,O.slice(0,_),N.rect.width,N.rect.height),_=0);const k={x:y(d,h+12),y:y(d,h+16),width:y(d,h+4),height:y(d,h+8)};let U=p(d,h+22);U=p(d,h+20)/(U==0?100:U);const $={rect:k,delay:Math.round(1e3*U),dispose:d[h+24],blend:d[h+25]};g.frames.push($)}else if(E=="fdAT"){for(I=0;I<W-4;I++)O[_+I]=d[h+I+4];_+=W-4}else if(E=="pHYs")g.tabs[E]=[m.readUint(d,h),m.readUint(d,h+4),d[h+8]];else if(E=="cHRM")for(g.tabs[E]=[],I=0;I<8;I++)g.tabs[E].push(m.readUint(d,h+4*I));else if(E=="tEXt"||E=="zTXt"){g.tabs[E]==null&&(g.tabs[E]={});var x=m.nextZero(d,h),P=m.readASCII(d,h,x-h),A=h+W-x-1;if(E=="tEXt")F=m.readASCII(d,x+1,A);else{var M=r(d.slice(x+2,x+2+A));F=m.readUTF8(M,0,M.length)}g.tabs[E][P]=F}else if(E=="iTXt"){g.tabs[E]==null&&(g.tabs[E]={}),x=0,v=h,x=m.nextZero(d,v),P=m.readASCII(d,v,x-v);const k=d[v=x+1];var F;d[v+1],v+=2,x=m.nextZero(d,v),m.readASCII(d,v,x-v),v=x+1,x=m.nextZero(d,v),m.readUTF8(d,v,x-v),A=W-((v=x+1)-h),k==0?F=m.readUTF8(d,v,A):(M=r(d.slice(v,v+A)),F=m.readUTF8(M,0,M.length)),g.tabs[E][P]=F}else if(E=="PLTE")g.tabs[E]=m.readBytes(d,h,W);else if(E=="hIST"){const k=g.tabs.PLTE.length/3;for(g.tabs[E]=[],I=0;I<k;I++)g.tabs[E].push(p(d,h+2*I))}else if(E=="tRNS")g.ctype==3?g.tabs[E]=m.readBytes(d,h,W):g.ctype==0?g.tabs[E]=p(d,h):g.ctype==2&&(g.tabs[E]=[p(d,h),p(d,h+2),p(d,h+4)]);else if(E=="gAMA")g.tabs[E]=m.readUint(d,h)/1e5;else if(E=="sRGB")g.tabs[E]=d[h];else if(E=="bKGD")g.ctype==0||g.ctype==4?g.tabs[E]=[p(d,h)]:g.ctype==2||g.ctype==6?g.tabs[E]=[p(d,h),p(d,h+2),p(d,h+4)]:g.ctype==3&&(g.tabs[E]=d[h]);else if(E=="IEND")break;h+=W,m.readUint(d,h),h+=4}var N;return _!=0&&((N=g.frames[g.frames.length-1]).data=n(g,O.slice(0,_),N.rect.width,N.rect.height)),g.data=n(g,C,g.width,g.height),delete g.compress,delete g.interlace,delete g.filter,g},toRGBA8:function(f){const d=f.width,h=f.height;if(f.tabs.acTL==null)return[t(f.data,d,h,f).buffer];const m=[];f.frames[0].data==null&&(f.frames[0].data=f.data);const p=d*h*4,y=new Uint8Array(p),g=new Uint8Array(p),C=new Uint8Array(p);for(let w=0;w<f.frames.length;w++){const _=f.frames[w],S=_.rect.x,I=_.rect.y,v=_.rect.width,x=_.rect.height,P=t(_.data,v,x,f);if(w!=0)for(var O=0;O<p;O++)C[O]=y[O];if(_.blend==0?u(P,v,x,y,d,h,S,I,0):_.blend==1&&u(P,v,x,y,d,h,S,I,1),m.push(y.buffer.slice(0)),_.dispose!=0){if(_.dispose==1)u(g,v,x,y,d,h,S,I,0);else if(_.dispose==2)for(O=0;O<p;O++)y[O]=C[O]}}return m},_paeth:a,_copyTile:u,_bin:e}})();(function(){const{_copyTile:e}=yn,{_bin:t}=yn,n=yn._paeth;var r={table:(function(){const v=new Uint32Array(256);for(let x=0;x<256;x++){let P=x;for(let A=0;A<8;A++)1&P?P=3988292384^P>>>1:P>>>=1;v[x]=P}return v})(),update(v,x,P,A){for(let M=0;M<A;M++)v=r.table[255&(v^x[P+M])]^v>>>8;return v},crc:(v,x,P)=>4294967295^r.update(4294967295,v,x,P)};function o(v,x,P,A){x[P]+=v[0]*A>>4,x[P+1]+=v[1]*A>>4,x[P+2]+=v[2]*A>>4,x[P+3]+=v[3]*A>>4}function s(v){return Math.max(0,Math.min(255,v))}function i(v,x){const P=v[0]-x[0],A=v[1]-x[1],M=v[2]-x[2],F=v[3]-x[3];return P*P+A*A+M*M+F*F}function a(v,x,P,A,M,F,N){N==null&&(N=1);const W=A.length,E=[];for(var k=0;k<W;k++){const z=A[k];E.push([z>>>0&255,z>>>8&255,z>>>16&255,z>>>24&255])}for(k=0;k<W;k++){let z=4294967295;for(var U=0,$=0;$<W;$++){var D=i(E[k],E[$]);$!=k&&D<z&&(z=D,U=$)}}const V=new Uint32Array(M.buffer),Z=new Int16Array(x*P*4),G=[0,8,2,10,12,4,14,6,3,11,1,9,15,7,13,5];for(k=0;k<G.length;k++)G[k]=255*((G[k]+.5)/16-.5);for(let z=0;z<P;z++)for(let X=0;X<x;X++){var B;k=4*(z*x+X),N!=2?B=[s(v[k]+Z[k]),s(v[k+1]+Z[k+1]),s(v[k+2]+Z[k+2]),s(v[k+3]+Z[k+3])]:(D=G[4*(3&z)+(3&X)],B=[s(v[k]+D),s(v[k+1]+D),s(v[k+2]+D),s(v[k+3]+D)]),U=0;let q=16777215;for($=0;$<W;$++){const re=i(B,E[$]);re<q&&(q=re,U=$)}const oe=E[U],Q=[B[0]-oe[0],B[1]-oe[1],B[2]-oe[2],B[3]-oe[3]];N==1&&(X!=x-1&&o(Q,Z,k+4,7),z!=P-1&&(X!=0&&o(Q,Z,k+4*x-4,3),o(Q,Z,k+4*x,5),X!=x-1&&o(Q,Z,k+4*x+4,1))),F[k>>2]=U,V[k>>2]=A[U]}}function c(v,x,P,A,M){M==null&&(M={});const{crc:F}=r,N=t.writeUint,W=t.writeUshort,E=t.writeASCII;let k=8;const U=v.frames.length>1;let $,D=!1,V=33+(U?20:0);if(M.sRGB!=null&&(V+=13),M.pHYs!=null&&(V+=21),M.iCCP!=null&&($=pako.deflate(M.iCCP),V+=21+$.length+4),v.ctype==3){for(var Z=v.plte.length,G=0;G<Z;G++)v.plte[G]>>>24!=255&&(D=!0);V+=8+3*Z+4+(D?8+1*Z+4:0)}for(var B=0;B<v.frames.length;B++)U&&(V+=38),V+=(oe=v.frames[B]).cimg.length+12,B!=0&&(V+=4);V+=12;const z=new Uint8Array(V),X=[137,80,78,71,13,10,26,10];for(G=0;G<8;G++)z[G]=X[G];if(N(z,k,13),k+=4,E(z,k,"IHDR"),k+=4,N(z,k,x),k+=4,N(z,k,P),k+=4,z[k]=v.depth,k++,z[k]=v.ctype,k++,z[k]=0,k++,z[k]=0,k++,z[k]=0,k++,N(z,k,F(z,k-17,17)),k+=4,M.sRGB!=null&&(N(z,k,1),k+=4,E(z,k,"sRGB"),k+=4,z[k]=M.sRGB,k++,N(z,k,F(z,k-5,5)),k+=4),M.iCCP!=null){const Q=13+$.length;N(z,k,Q),k+=4,E(z,k,"iCCP"),k+=4,E(z,k,"ICC profile"),k+=11,k+=2,z.set($,k),k+=$.length,N(z,k,F(z,k-(Q+4),Q+4)),k+=4}if(M.pHYs!=null&&(N(z,k,9),k+=4,E(z,k,"pHYs"),k+=4,N(z,k,M.pHYs[0]),k+=4,N(z,k,M.pHYs[1]),k+=4,z[k]=M.pHYs[2],k++,N(z,k,F(z,k-13,13)),k+=4),U&&(N(z,k,8),k+=4,E(z,k,"acTL"),k+=4,N(z,k,v.frames.length),k+=4,N(z,k,M.loop!=null?M.loop:0),k+=4,N(z,k,F(z,k-12,12)),k+=4),v.ctype==3){for(N(z,k,3*(Z=v.plte.length)),k+=4,E(z,k,"PLTE"),k+=4,G=0;G<Z;G++){const Q=3*G,re=v.plte[G],le=255&re,K=re>>>8&255,Se=re>>>16&255;z[k+Q+0]=le,z[k+Q+1]=K,z[k+Q+2]=Se}if(k+=3*Z,N(z,k,F(z,k-3*Z-4,3*Z+4)),k+=4,D){for(N(z,k,Z),k+=4,E(z,k,"tRNS"),k+=4,G=0;G<Z;G++)z[k+G]=v.plte[G]>>>24&255;k+=Z,N(z,k,F(z,k-Z-4,Z+4)),k+=4}}let q=0;for(B=0;B<v.frames.length;B++){var oe=v.frames[B];U&&(N(z,k,26),k+=4,E(z,k,"fcTL"),k+=4,N(z,k,q++),k+=4,N(z,k,oe.rect.width),k+=4,N(z,k,oe.rect.height),k+=4,N(z,k,oe.rect.x),k+=4,N(z,k,oe.rect.y),k+=4,W(z,k,A[B]),k+=2,W(z,k,1e3),k+=2,z[k]=oe.dispose,k++,z[k]=oe.blend,k++,N(z,k,F(z,k-30,30)),k+=4);const Q=oe.cimg;N(z,k,(Z=Q.length)+(B==0?0:4)),k+=4;const re=k;E(z,k,B==0?"IDAT":"fdAT"),k+=4,B!=0&&(N(z,k,q++),k+=4),z.set(Q,k),k+=Z,N(z,k,F(z,re,k-re)),k+=4}return N(z,k,0),k+=4,E(z,k,"IEND"),k+=4,N(z,k,F(z,k-4,4)),k+=4,z.buffer}function u(v,x,P){for(let A=0;A<v.frames.length;A++){const M=v.frames[A];M.rect.width;const F=M.rect.height,N=new Uint8Array(F*M.bpl+F);M.cimg=h(M.img,F,M.bpp,M.bpl,N,x,P)}}function l(v,x,P,A,M){const F=M[0],N=M[1],W=M[2],E=M[3],k=M[4],U=M[5];let $=6,D=8,V=255;for(var Z=0;Z<v.length;Z++){const Ge=new Uint8Array(v[Z]);for(var G=Ge.length,B=0;B<G;B+=4)V&=Ge[B+3]}const z=V!=255,X=(function(Re,We,nt,rt,R,Y){const H=[];for(var ee=0;ee<Re.length;ee++){const ze=new Uint8Array(Re[ee]),ot=new Uint32Array(ze.buffer);var te;let Qe=0,xt=0,gt=We,dt=nt,jt=rt?1:0;if(ee!=0){const Sn=Y||rt||ee==1||H[ee-2].dispose!=0?1:2;let kn=0,_e=1e9;for(let De=0;De<Sn;De++){var ne=new Uint8Array(Re[ee-1-De]);const ve=new Uint32Array(Re[ee-1-De]);let Ee=We,Xe=nt,xe=-1,tr=-1;for(let Pt=0;Pt<nt;Pt++)for(let Qt=0;Qt<We;Qt++)ot[be=Pt*We+Qt]!=ve[be]&&(Qt<Ee&&(Ee=Qt),Qt>xe&&(xe=Qt),Pt<Xe&&(Xe=Pt),Pt>tr&&(tr=Pt));xe==-1&&(Ee=Xe=xe=tr=0),R&&((1&Ee)==1&&Ee--,(1&Xe)==1&&Xe--);const ct=(xe-Ee+1)*(tr-Xe+1);ct<_e&&(_e=ct,kn=De,Qe=Ee,xt=Xe,gt=xe-Ee+1,dt=tr-Xe+1)}ne=new Uint8Array(Re[ee-1-kn]),kn==1&&(H[ee-1].dispose=2),te=new Uint8Array(gt*dt*4),e(ne,We,nt,te,gt,dt,-Qe,-xt,0),jt=e(ze,We,nt,te,gt,dt,-Qe,-xt,3)?1:0,jt==1?d(ze,We,nt,te,{x:Qe,y:xt,width:gt,height:dt}):e(ze,We,nt,te,gt,dt,-Qe,-xt,0)}else te=ze.slice(0);H.push({rect:{x:Qe,y:xt,width:gt,height:dt},img:te,blend:jt,dispose:0})}if(rt)for(ee=0;ee<H.length;ee++){if((Oe=H[ee]).blend==1)continue;const ze=Oe.rect,ot=H[ee-1].rect,Qe=Math.min(ze.x,ot.x),xt=Math.min(ze.y,ot.y),gt={x:Qe,y:xt,width:Math.max(ze.x+ze.width,ot.x+ot.width)-Qe,height:Math.max(ze.y+ze.height,ot.y+ot.height)-xt};H[ee-1].dispose=1,ee-1!=0&&f(Re,We,nt,H,ee-1,gt,R),f(Re,We,nt,H,ee,gt,R)}let ue=0;if(Re.length!=1)for(var be=0;be<H.length;be++){var Oe;ue+=(Oe=H[be]).rect.width*Oe.rect.height}return H})(v,x,P,F,N,W),q={},oe=[],Q=[];if(A!=0){const Ge=[];for(B=0;B<X.length;B++)Ge.push(X[B].img.buffer);const Re=(function(R){let Y=0;for(var H=0;H<R.length;H++)Y+=R[H].byteLength;const ee=new Uint8Array(Y);let te=0;for(H=0;H<R.length;H++){const ne=new Uint8Array(R[H]),ue=ne.length;for(let be=0;be<ue;be+=4){let Oe=ne[be],ze=ne[be+1],ot=ne[be+2];const Qe=ne[be+3];Qe==0&&(Oe=ze=ot=0),ee[te+be]=Oe,ee[te+be+1]=ze,ee[te+be+2]=ot,ee[te+be+3]=Qe}te+=ue}return ee.buffer})(Ge),We=p(Re,A);for(B=0;B<We.plte.length;B++)oe.push(We.plte[B].est.rgba);let nt=0;for(B=0;B<X.length;B++){const rt=(le=X[B]).img.length;var re=new Uint8Array(We.inds.buffer,nt>>2,rt>>2);Q.push(re);const R=new Uint8Array(We.abuf,nt,rt);U&&a(le.img,le.rect.width,le.rect.height,oe,R,re),le.img.set(R),nt+=rt}}else for(Z=0;Z<X.length;Z++){var le=X[Z];const Ge=new Uint32Array(le.img.buffer);var K=le.rect.width;for(G=Ge.length,re=new Uint8Array(G),Q.push(re),B=0;B<G;B++){const Re=Ge[B];if(B!=0&&Re==Ge[B-1])re[B]=re[B-1];else if(B>K&&Re==Ge[B-K])re[B]=re[B-K];else{let We=q[Re];if(We==null&&(q[Re]=We=oe.length,oe.push(Re),oe.length>=300))break;re[B]=We}}}const Se=oe.length;for(Se<=256&&k==0&&(D=Se<=2?1:Se<=4?2:Se<=16?4:8,D=Math.max(D,E)),Z=0;Z<X.length;Z++){(le=X[Z]).rect.x,le.rect.y,K=le.rect.width;const Ge=le.rect.height;let Re=le.img;new Uint32Array(Re.buffer);let We=4*K,nt=4;if(Se<=256&&k==0){We=Math.ceil(D*K/8);var Ie=new Uint8Array(We*Ge);const rt=Q[Z];for(let R=0;R<Ge;R++){B=R*We;const Y=R*K;if(D==8)for(var ke=0;ke<K;ke++)Ie[B+ke]=rt[Y+ke];else if(D==4)for(ke=0;ke<K;ke++)Ie[B+(ke>>1)]|=rt[Y+ke]<<4-4*(1&ke);else if(D==2)for(ke=0;ke<K;ke++)Ie[B+(ke>>2)]|=rt[Y+ke]<<6-2*(3&ke);else if(D==1)for(ke=0;ke<K;ke++)Ie[B+(ke>>3)]|=rt[Y+ke]<<7-1*(7&ke)}Re=Ie,$=3,nt=1}else if(z==0&&X.length==1){Ie=new Uint8Array(K*Ge*3);const rt=K*Ge;for(B=0;B<rt;B++){const R=3*B,Y=4*B;Ie[R]=Re[Y],Ie[R+1]=Re[Y+1],Ie[R+2]=Re[Y+2]}Re=Ie,$=2,nt=3,We=3*K}le.img=Re,le.bpl=We,le.bpp=nt}return{ctype:$,depth:D,plte:oe,frames:X}}function f(v,x,P,A,M,F,N){const W=Uint8Array,E=Uint32Array,k=new W(v[M-1]),U=new E(v[M-1]),$=M+1<v.length?new W(v[M+1]):null,D=new W(v[M]),V=new E(D.buffer);let Z=x,G=P,B=-1,z=-1;for(let q=0;q<F.height;q++)for(let oe=0;oe<F.width;oe++){const Q=F.x+oe,re=F.y+q,le=re*x+Q,K=V[le];K==0||A[M-1].dispose==0&&U[le]==K&&($==null||$[4*le+3]!=0)||(Q<Z&&(Z=Q),Q>B&&(B=Q),re<G&&(G=re),re>z&&(z=re))}B==-1&&(Z=G=B=z=0),N&&((1&Z)==1&&Z--,(1&G)==1&&G--),F={x:Z,y:G,width:B-Z+1,height:z-G+1};const X=A[M];X.rect=F,X.blend=1,X.img=new Uint8Array(F.width*F.height*4),A[M-1].dispose==0?(e(k,x,P,X.img,F.width,F.height,-F.x,-F.y,0),d(D,x,P,X.img,F)):e(D,x,P,X.img,F.width,F.height,-F.x,-F.y,0)}function d(v,x,P,A,M){e(v,x,P,A,M.width,M.height,-M.x,-M.y,2)}function h(v,x,P,A,M,F,N){const W=[];let E,k=[0,1,2,3,4];F!=-1?k=[F]:(x*A>5e5||P==1)&&(k=[0]),N&&(E={level:0});const U=aC;for(var $=0;$<k.length;$++){for(let Z=0;Z<x;Z++)m(M,v,Z,A,P,k[$]);W.push(U.deflate(M,E))}let D,V=1e9;for($=0;$<W.length;$++)W[$].length<V&&(D=$,V=W[$].length);return W[D]}function m(v,x,P,A,M,F){const N=P*A;let W=N+P;if(v[W]=F,W++,F==0)if(A<500)for(var E=0;E<A;E++)v[W+E]=x[N+E];else v.set(new Uint8Array(x.buffer,N,A),W);else if(F==1){for(E=0;E<M;E++)v[W+E]=x[N+E];for(E=M;E<A;E++)v[W+E]=x[N+E]-x[N+E-M]+256&255}else if(P==0){for(E=0;E<M;E++)v[W+E]=x[N+E];if(F==2)for(E=M;E<A;E++)v[W+E]=x[N+E];if(F==3)for(E=M;E<A;E++)v[W+E]=x[N+E]-(x[N+E-M]>>1)+256&255;if(F==4)for(E=M;E<A;E++)v[W+E]=x[N+E]-n(x[N+E-M],0,0)+256&255}else{if(F==2)for(E=0;E<A;E++)v[W+E]=x[N+E]+256-x[N+E-A]&255;if(F==3){for(E=0;E<M;E++)v[W+E]=x[N+E]+256-(x[N+E-A]>>1)&255;for(E=M;E<A;E++)v[W+E]=x[N+E]+256-(x[N+E-A]+x[N+E-M]>>1)&255}if(F==4){for(E=0;E<M;E++)v[W+E]=x[N+E]+256-n(0,x[N+E-A],0)&255;for(E=M;E<A;E++)v[W+E]=x[N+E]+256-n(x[N+E-M],x[N+E-A],x[N+E-M-A])&255}}}function p(v,x){const P=new Uint8Array(v),A=P.slice(0),M=new Uint32Array(A.buffer),F=y(A,x),N=F[0],W=F[1],E=P.length,k=new Uint8Array(E>>2);let U;if(P.length<2e7)for(var $=0;$<E;$+=4)U=g(N,D=P[$]*(1/255),V=P[$+1]*(1/255),Z=P[$+2]*(1/255),G=P[$+3]*(1/255)),k[$>>2]=U.ind,M[$>>2]=U.est.rgba;else for($=0;$<E;$+=4){var D=P[$]*.00392156862745098,V=P[$+1]*(1/255),Z=P[$+2]*(1/255),G=P[$+3]*(1/255);for(U=N;U.left;)U=C(U.est,D,V,Z,G)<=0?U.left:U.right;k[$>>2]=U.ind,M[$>>2]=U.est.rgba}return{abuf:A.buffer,inds:k,plte:W}}function y(v,x,P){P==null&&(P=1e-4);const A=new Uint32Array(v.buffer),M={i0:0,i1:v.length,bst:null,est:null,tdst:0,left:null,right:null};M.bst=_(v,M.i0,M.i1),M.est=S(M.bst);const F=[M];for(;F.length<x;){let W=0,E=0;for(var N=0;N<F.length;N++)F[N].est.L>W&&(W=F[N].est.L,E=N);if(W<P)break;const k=F[E],U=O(v,A,k.i0,k.i1,k.est.e,k.est.eMq255);if(k.i0>=U||k.i1<=U){k.est.L=0;continue}const $={i0:k.i0,i1:U,bst:null,est:null,tdst:0,left:null,right:null};$.bst=_(v,$.i0,$.i1),$.est=S($.bst);const D={i0:U,i1:k.i1,bst:null,est:null,tdst:0,left:null,right:null};for(D.bst={R:[],m:[],N:k.bst.N-$.bst.N},N=0;N<16;N++)D.bst.R[N]=k.bst.R[N]-$.bst.R[N];for(N=0;N<4;N++)D.bst.m[N]=k.bst.m[N]-$.bst.m[N];D.est=S(D.bst),k.left=$,k.right=D,F[E]=$,F.push(D)}for(F.sort(((W,E)=>E.bst.N-W.bst.N)),N=0;N<F.length;N++)F[N].ind=N;return[M,F]}function g(v,x,P,A,M){if(v.left==null)return v.tdst=(function($,D,V,Z,G){const B=D-$[0],z=V-$[1],X=Z-$[2],q=G-$[3];return B*B+z*z+X*X+q*q})(v.est.q,x,P,A,M),v;const F=C(v.est,x,P,A,M);let N=v.left,W=v.right;F>0&&(N=v.right,W=v.left);const E=g(N,x,P,A,M);if(E.tdst<=F*F)return E;const k=g(W,x,P,A,M);return k.tdst<E.tdst?k:E}function C(v,x,P,A,M){const{e:F}=v;return F[0]*x+F[1]*P+F[2]*A+F[3]*M-v.eMq}function O(v,x,P,A,M,F){for(A-=4;P<A;){for(;w(v,P,M)<=F;)P+=4;for(;w(v,A,M)>F;)A-=4;if(P>=A)break;const N=x[P>>2];x[P>>2]=x[A>>2],x[A>>2]=N,P+=4,A-=4}for(;w(v,P,M)>F;)P-=4;return P+4}function w(v,x,P){return v[x]*P[0]+v[x+1]*P[1]+v[x+2]*P[2]+v[x+3]*P[3]}function _(v,x,P){const A=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],M=[0,0,0,0],F=P-x>>2;for(let N=x;N<P;N+=4){const W=v[N]*.00392156862745098,E=v[N+1]*(1/255),k=v[N+2]*(1/255),U=v[N+3]*(1/255);M[0]+=W,M[1]+=E,M[2]+=k,M[3]+=U,A[0]+=W*W,A[1]+=W*E,A[2]+=W*k,A[3]+=W*U,A[5]+=E*E,A[6]+=E*k,A[7]+=E*U,A[10]+=k*k,A[11]+=k*U,A[15]+=U*U}return A[4]=A[1],A[8]=A[2],A[9]=A[6],A[12]=A[3],A[13]=A[7],A[14]=A[11],{R:A,m:M,N:F}}function S(v){const{R:x}=v,{m:P}=v,{N:A}=v,M=P[0],F=P[1],N=P[2],W=P[3],E=A==0?0:1/A,k=[x[0]-M*M*E,x[1]-M*F*E,x[2]-M*N*E,x[3]-M*W*E,x[4]-F*M*E,x[5]-F*F*E,x[6]-F*N*E,x[7]-F*W*E,x[8]-N*M*E,x[9]-N*F*E,x[10]-N*N*E,x[11]-N*W*E,x[12]-W*M*E,x[13]-W*F*E,x[14]-W*N*E,x[15]-W*W*E],U=k,$=I;let D=[Math.random(),Math.random(),Math.random(),Math.random()],V=0,Z=0;if(A!=0)for(let B=0;B<16&&(D=$.multVec(U,D),Z=Math.sqrt($.dot(D,D)),D=$.sml(1/Z,D),!(B!=0&&Math.abs(Z-V)<1e-9));B++)V=Z;const G=[M*E,F*E,N*E,W*E];return{Cov:k,q:G,e:D,L:V,eMq255:$.dot($.sml(255,G),D),eMq:$.dot(D,G),rgba:(Math.round(255*G[3])<<24|Math.round(255*G[2])<<16|Math.round(255*G[1])<<8|Math.round(255*G[0])<<0)>>>0}}var I={multVec:(v,x)=>[v[0]*x[0]+v[1]*x[1]+v[2]*x[2]+v[3]*x[3],v[4]*x[0]+v[5]*x[1]+v[6]*x[2]+v[7]*x[3],v[8]*x[0]+v[9]*x[1]+v[10]*x[2]+v[11]*x[3],v[12]*x[0]+v[13]*x[1]+v[14]*x[2]+v[15]*x[3]],dot:(v,x)=>v[0]*x[0]+v[1]*x[1]+v[2]*x[2]+v[3]*x[3],sml:(v,x)=>[v*x[0],v*x[1],v*x[2],v*x[3]]};yn.encode=function(x,P,A,M,F,N,W){M==null&&(M=0),W==null&&(W=!1);const E=l(x,P,A,M,[!1,!1,!1,0,W,!1]);return u(E,-1),c(E,P,A,F,N)},yn.encodeLL=function(x,P,A,M,F,N,W,E){const k={ctype:0+(M==1?0:2)+(F==0?0:4),depth:N,frames:[]},U=(M+F)*N,$=U*P;for(let D=0;D<x.length;D++)k.frames.push({rect:{x:0,y:0,width:P,height:A},img:new Uint8Array(x[D]),blend:0,dispose:1,bpp:Math.ceil(U/8),bpl:Math.ceil($/8)});return u(k,0,!0),c(k,P,A,W,E)},yn.encode.compress=l,yn.encode.dither=a,yn.quantize=p,yn.quantize.getKDtree=y,yn.quantize.getNearest=g})();const Yp={toArrayBuffer(e,t){const n=e.width,r=e.height,o=n<<2,s=e.getContext("2d").getImageData(0,0,n,r),i=new Uint32Array(s.data.buffer),a=(32*n+31)/32<<2,c=a*r,u=122+c,l=new ArrayBuffer(u),f=new DataView(l),d=1<<20;let h,m,p,y,g=d,C=0,O=0,w=0;function _(v){f.setUint16(O,v,!0),O+=2}function S(v){f.setUint32(O,v,!0),O+=4}function I(v){O+=v}_(19778),S(u),I(4),S(122),S(108),S(n),S(-r>>>0),_(1),_(32),S(3),S(c),S(2835),S(2835),I(8),S(16711680),S(65280),S(255),S(4278190080),S(1466527264),(function v(){for(;C<r&&g>0;){for(y=122+C*a,h=0;h<o;)g--,m=i[w++],p=m>>>24,f.setUint32(y+h,m<<8|p),h+=4;C++}w<i.length?(g=d,setTimeout(v,Yp._dly)):t(l)})()},toBlob(e,t){this.toArrayBuffer(e,(n=>{t(new Blob([n],{type:"image/bmp"}))}))},_dly:9};var Yt={CHROME:"CHROME",FIREFOX:"FIREFOX",DESKTOP_SAFARI:"DESKTOP_SAFARI",IE:"IE",IOS:"IOS",ETC:"ETC"},cC={[Yt.CHROME]:16384,[Yt.FIREFOX]:11180,[Yt.DESKTOP_SAFARI]:16384,[Yt.IE]:8192,[Yt.IOS]:4096,[Yt.ETC]:8192};const Hc=typeof window<"u",jp=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope,xi=Hc&&window.cordova&&window.cordova.require&&window.cordova.require("cordova/modulemapper"),lC=(Hc||jp)&&(xi&&xi.getOriginalSymbol(window,"File")||typeof File<"u"&&File),Vp=(Hc||jp)&&(xi&&xi.getOriginalSymbol(window,"FileReader")||typeof FileReader<"u"&&FileReader);function Zc(e,t,n=Date.now()){return new Promise((r=>{const o=e.split(","),s=o[0].match(/:(.*?);/)[1],i=globalThis.atob(o[1]);let a=i.length;const c=new Uint8Array(a);for(;a--;)c[a]=i.charCodeAt(a);const u=new Blob([c],{type:s});u.name=t,u.lastModified=n,r(u)}))}function Bp(e){return new Promise(((t,n)=>{const r=new Vp;r.onload=()=>t(r.result),r.onerror=o=>n(o),r.readAsDataURL(e)}))}function Hp(e){return new Promise(((t,n)=>{const r=new Image;r.onload=()=>t(r),r.onerror=o=>n(o),r.src=e}))}function Wr(){if(Wr.cachedResult!==void 0)return Wr.cachedResult;let e=Yt.ETC;const{userAgent:t}=navigator;return/Chrom(e|ium)/i.test(t)?e=Yt.CHROME:/iP(ad|od|hone)/i.test(t)&&/WebKit/i.test(t)?e=Yt.IOS:/Safari/i.test(t)?e=Yt.DESKTOP_SAFARI:/Firefox/i.test(t)?e=Yt.FIREFOX:(/MSIE/i.test(t)||document.documentMode)&&(e=Yt.IE),Wr.cachedResult=e,Wr.cachedResult}function Zp(e,t){const n=Wr(),r=cC[n];let o=e,s=t,i=o*s;const a=o>s?s/o:o/s;for(;i>r*r;){const c=(r+o)/2,u=(r+s)/2;c<u?(s=u,o=u*a):(s=c*a,o=c),i=o*s}return{width:o,height:s}}function Oi(e,t){let n,r;try{if(n=new OffscreenCanvas(e,t),r=n.getContext("2d"),r===null)throw new Error("getContext of OffscreenCanvas returns null")}catch{n=document.createElement("canvas"),r=n.getContext("2d")}return n.width=e,n.height=t,[n,r]}function Gp(e,t){const{width:n,height:r}=Zp(e.width,e.height),[o,s]=Oi(n,r);return t&&/jpe?g/.test(t)&&(s.fillStyle="white",s.fillRect(0,0,o.width,o.height)),s.drawImage(e,0,0,o.width,o.height),o}function Ei(){return Ei.cachedResult!==void 0||(Ei.cachedResult=["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&typeof document<"u"&&"ontouchend"in document),Ei.cachedResult}function Ci(e,t={}){return new Promise((function(n,r){let o,s;var i=function(){try{return s=Gp(o,t.fileType||e.type),n([o,s])}catch(c){return r(c)}},a=function(c){try{var u=function(l){try{throw l}catch(f){return r(f)}};try{let l;return Bp(e).then((function(f){try{return l=f,Hp(l).then((function(d){try{return o=d,(function(){try{return i()}catch(h){return r(h)}})()}catch(h){return u(h)}}),u)}catch(d){return u(d)}}),u)}catch(l){u(l)}}catch(l){return r(l)}};try{if(Ei()||[Yt.DESKTOP_SAFARI,Yt.MOBILE_SAFARI].includes(Wr()))throw new Error("Skip createImageBitmap on IOS and Safari");return createImageBitmap(e).then((function(c){try{return o=c,i()}catch{return a()}}),a)}catch{a()}}))}function Ti(e,t,n,r,o=1){return new Promise((function(s,i){let a;if(t==="image/png"){let u,l,f;return u=e.getContext("2d"),{data:l}=u.getImageData(0,0,e.width,e.height),f=yn.encode([l.buffer],e.width,e.height,4096*o),a=new Blob([f],{type:t}),a.name=n,a.lastModified=r,c.call(this)}{let u=function(){return c.call(this)};if(t==="image/bmp")return new Promise((l=>Yp.toBlob(e,l))).then((function(l){try{return a=l,a.name=n,a.lastModified=r,u.call(this)}catch(f){return i(f)}}).bind(this),i);{let l=function(){return u.call(this)};if(typeof OffscreenCanvas=="function"&&e instanceof OffscreenCanvas)return e.convertToBlob({type:t,quality:o}).then((function(f){try{return a=f,a.name=n,a.lastModified=r,l.call(this)}catch(d){return i(d)}}).bind(this),i);{let f;return f=e.toDataURL(t,o),Zc(f,n,r).then((function(d){try{return a=d,l.call(this)}catch(h){return i(h)}}).bind(this),i)}}}function c(){return s(a)}}))}function Nn(e){e.width=0,e.height=0}function ho(){return new Promise((function(e,t){let n,r,o,s;return ho.cachedResult!==void 0?e(ho.cachedResult):Zc("data:image/jpeg;base64,/9j/4QAiRXhpZgAATU0AKgAAAAgAAQESAAMAAAABAAYAAAAAAAD/2wCEAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAf/AABEIAAEAAgMBEQACEQEDEQH/xABKAAEAAAAAAAAAAAAAAAAAAAALEAEAAAAAAAAAAAAAAAAAAAAAAQEAAAAAAAAAAAAAAAAAAAAAEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwA/8H//2Q==","test.jpg",Date.now()).then((function(i){try{return n=i,Ci(n).then((function(a){try{return r=a[1],Ti(r,n.type,n.name,n.lastModified).then((function(c){try{return o=c,Nn(r),Ci(o).then((function(u){try{return s=u[0],ho.cachedResult=s.width===1&&s.height===2,e(ho.cachedResult)}catch(l){return t(l)}}),t)}catch(u){return t(u)}}),t)}catch(c){return t(c)}}),t)}catch(a){return t(a)}}),t)}))}function qp(e){return new Promise(((t,n)=>{const r=new Vp;r.onload=o=>{const s=new DataView(o.target.result);if(s.getUint16(0,!1)!=65496)return t(-2);const i=s.byteLength;let a=2;for(;a<i;){if(s.getUint16(a+2,!1)<=8)return t(-1);const c=s.getUint16(a,!1);if(a+=2,c==65505){if(s.getUint32(a+=2,!1)!=1165519206)return t(-1);const u=s.getUint16(a+=6,!1)==18761;a+=s.getUint32(a+4,u);const l=s.getUint16(a,u);a+=2;for(let f=0;f<l;f++)if(s.getUint16(a+12*f,u)==274)return t(s.getUint16(a+12*f+8,u))}else{if((65280&c)!=65280)break;a+=s.getUint16(a,!1)}}return t(-1)},r.onerror=o=>n(o),r.readAsArrayBuffer(e)}))}function Kp(e,t){const{width:n}=e,{height:r}=e,{maxWidthOrHeight:o}=t;let s,i=e;return isFinite(o)&&(n>o||r>o)&&([i,s]=Oi(n,r),n>r?(i.width=o,i.height=r/n*o):(i.width=n/r*o,i.height=o),s.drawImage(e,0,0,i.width,i.height),Nn(e)),i}function Xp(e,t){const{width:n}=e,{height:r}=e,[o,s]=Oi(n,r);switch(t>4&&t<9?(o.width=r,o.height=n):(o.width=n,o.height=r),t){case 2:s.transform(-1,0,0,1,n,0);break;case 3:s.transform(-1,0,0,-1,n,r);break;case 4:s.transform(1,0,0,-1,0,r);break;case 5:s.transform(0,1,1,0,0,0);break;case 6:s.transform(0,1,-1,0,r,0);break;case 7:s.transform(0,-1,-1,0,r,n);break;case 8:s.transform(0,-1,1,0,0,n)}return s.drawImage(e,0,0,n,r),Nn(e),o}function Jp(e,t,n=0){return new Promise((function(r,o){let s,i,a,c,u,l,f,d,h,m,p,y,g,C,O,w,_,S,I,v;function x(A=5){if(t.signal&&t.signal.aborted)throw t.signal.reason;s+=A,t.onProgress(Math.min(s,100))}function P(A){if(t.signal&&t.signal.aborted)throw t.signal.reason;s=Math.min(Math.max(A,s),100),t.onProgress(s)}return s=n,i=t.maxIteration||10,a=1024*t.maxSizeMB*1024,x(),Ci(e,t).then((function(A){try{return[,c]=A,x(),u=Kp(c,t),x(),new Promise((function(M,F){var N;if(!(N=t.exifOrientation))return qp(e).then((function(E){try{return N=E,W.call(this)}catch(k){return F(k)}}).bind(this),F);function W(){return M(N)}return W.call(this)})).then((function(M){try{return l=M,x(),ho().then((function(F){try{return f=F?u:Xp(u,l),x(),d=t.initialQuality||1,h=t.fileType||e.type,Ti(f,h,e.name,e.lastModified,d).then((function(N){try{{let E=function(){if(i--&&(O>a||O>g)){let U,$;return U=v?.95*I.width:I.width,$=v?.95*I.height:I.height,[_,S]=Oi(U,$),S.drawImage(I,0,0,U,$),d*=h==="image/png"?.85:.95,Ti(_,h,e.name,e.lastModified,d).then((function(D){try{return w=D,Nn(I),I=_,O=w.size,P(Math.min(99,Math.floor((C-O)/(C-a)*100))),E}catch(V){return o(V)}}),o)}return[1]},k=function(){return Nn(I),Nn(_),Nn(u),Nn(f),Nn(c),P(100),r(w)};if(m=N,x(),p=m.size>a,y=m.size>e.size,!p&&!y)return P(100),r(m);var W;return g=e.size,C=m.size,O=C,I=f,v=!t.alwaysKeepResolution&&p,(W=(function(U){for(;U;){if(U.then)return void U.then(W,o);try{if(U.pop){if(U.length)return U.pop()?k.call(this):U;U=E}else U=U.call(this)}catch($){return o($)}}}).bind(this))(E)}}catch(E){return o(E)}}).bind(this),o)}catch(N){return o(N)}}).bind(this),o)}catch(F){return o(F)}}).bind(this),o)}catch(M){return o(M)}}).bind(this),o)}))}const uC=`
45
+ let scriptImported = false
46
+ self.addEventListener('message', async (e) => {
47
+ const { file, id, imageCompressionLibUrl, options } = e.data
48
+ options.onProgress = (progress) => self.postMessage({ progress, id })
49
+ try {
50
+ if (!scriptImported) {
51
+ // console.log('[worker] importScripts', imageCompressionLibUrl)
52
+ self.importScripts(imageCompressionLibUrl)
53
+ scriptImported = true
54
+ }
55
+ // console.log('[worker] self', self)
56
+ const compressedFile = await imageCompression(file, options)
57
+ self.postMessage({ file: compressedFile, id })
58
+ } catch (e) {
59
+ // console.error('[worker] error', e)
60
+ self.postMessage({ error: e.message + '\\n' + e.stack, id })
61
+ }
62
+ })
63
+ `;let Gc;function fC(e,t){return new Promise(((n,r)=>{Gc||(Gc=(function(i){const a=[];return a.push(i),URL.createObjectURL(new Blob(a))})(uC));const o=new Worker(Gc);o.addEventListener("message",(function(i){if(t.signal&&t.signal.aborted)o.terminate();else if(i.data.progress===void 0){if(i.data.error)return r(new Error(i.data.error)),void o.terminate();n(i.data.file),o.terminate()}else t.onProgress(i.data.progress)})),o.addEventListener("error",r),t.signal&&t.signal.addEventListener("abort",(()=>{r(t.signal.reason),o.terminate()})),o.postMessage({file:e,imageCompressionLibUrl:t.libURL,options:{...t,onProgress:void 0,signal:void 0}})}))}function Ot(e,t){return new Promise((function(n,r){let o,s,i,a,c,u;if(o={...t},i=0,{onProgress:a}=o,o.maxSizeMB=o.maxSizeMB||Number.POSITIVE_INFINITY,c=typeof o.useWebWorker!="boolean"||o.useWebWorker,delete o.useWebWorker,o.onProgress=h=>{i=h,typeof a=="function"&&a(i)},!(e instanceof Blob||e instanceof lC))return r(new Error("The file given is not an instance of Blob or File"));if(!/^image/.test(e.type))return r(new Error("The file given is not an image"));if(u=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope,!c||typeof Worker!="function"||u)return Jp(e,o).then((function(h){try{return s=h,d.call(this)}catch(m){return r(m)}}).bind(this),r);var l=(function(){try{return d.call(this)}catch(h){return r(h)}}).bind(this),f=function(h){try{return Jp(e,o).then((function(m){try{return s=m,l()}catch(p){return r(p)}}),r)}catch(m){return r(m)}};try{return o.libURL=o.libURL||"https://cdn.jsdelivr.net/npm/browser-image-compression@2.0.2/dist/browser-image-compression.js",fC(e,o).then((function(h){try{return s=h,l()}catch{return f()}}),f)}catch{f()}function d(){try{s.name=e.name,s.lastModified=e.lastModified}catch{}try{o.preserveExif&&e.type==="image/jpeg"&&(!o.fileType||o.fileType&&o.fileType===e.type)&&(s=Up(e,s))}catch{}return n(s)}}))}Ot.getDataUrlFromFile=Bp,Ot.getFilefromDataUrl=Zc,Ot.loadImage=Hp,Ot.drawImageInCanvas=Gp,Ot.drawFileInCanvas=Ci,Ot.canvasToFile=Ti,Ot.getExifOrientation=qp,Ot.handleMaxWidthOrHeight=Kp,Ot.followExifOrientation=Xp,Ot.cleanupCanvasMemory=Nn,Ot.isAutoOrientationInBrowser=ho,Ot.approximateBelowMaximumCanvasSizeOfBrowser=Zp,Ot.copyExifWithoutOrientation=Up,Ot.getBrowserName=Wr,Ot.version="2.0.2";function Ae(...e){return Oa(_s(e))}async function dC(e,t=.2,n=1920){try{const r=atob(e.split(",")[1]),o=e.split(",")[0].split(":")[1].split(";")[0],s=new ArrayBuffer(r.length),i=new Uint8Array(s);for(let l=0;l<r.length;l++)i[l]=r.charCodeAt(l);const a=new Blob([s],{type:o}),c=await Ot(a,{maxSizeMB:t,maxWidthOrHeight:n,useWebWorker:!0});return await Ot.getDataUrlFromFile(c)}catch(r){return console.error("Error compressing image:",r),e}}function hC({questionnaire:e={}}){const{sections:t=[]}=e,n=[],r=t.map(o=>{const{items:s=[]}=o,i=s.map(a=>{const{reference_id:c=""}=a;return{...a,id:c,name:c}});return n.push(...i),{...o,items:i}});return{questionnaire:e,sections:r,questions:n}}const qc=rC("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),po=b.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...o},s)=>{const i=r?zu:"button";return T.jsx(i,{className:Ae(qc({variant:t,size:n,className:e})),ref:s,...o})});po.displayName="Button";function pC(e,t,n="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:e,timeZoneName:n}).format(t).split(/\s/g).slice(2).join(" ")}const mC={},Zo={};function zr(e,t){try{const r=(mC[e]||=new Intl.DateTimeFormat("en-US",{timeZone:e,timeZoneName:"longOffset"}).format)(t).split("GMT")[1];return r in Zo?Zo[r]:Qp(r,r.split(":"))}catch{if(e in Zo)return Zo[e];const n=e?.match(gC);return n?Qp(e,n.slice(1)):NaN}}const gC=/([+-]\d\d):?(\d\d)?/;function Qp(e,t){const n=+(t[0]||0),r=+(t[1]||0),o=+(t[2]||0)/60;return Zo[e]=n*60+r>0?n*60+r+o:n*60-r-o}class In extends Date{constructor(...t){super(),t.length>1&&typeof t[t.length-1]=="string"&&(this.timeZone=t.pop()),this.internal=new Date,isNaN(zr(this.timeZone,this))?this.setTime(NaN):t.length?typeof t[0]=="number"&&(t.length===1||t.length===2&&typeof t[1]!="number")?this.setTime(t[0]):typeof t[0]=="string"?this.setTime(+new Date(t[0])):t[0]instanceof Date?this.setTime(+t[0]):(this.setTime(+new Date(...t)),tm(this),Kc(this)):this.setTime(Date.now())}static tz(t,...n){return n.length?new In(...n,t):new In(Date.now(),t)}withTimeZone(t){return new In(+this,t)}getTimezoneOffset(){const t=-zr(this.timeZone,this);return t>0?Math.floor(t):Math.ceil(t)}setTime(t){return Date.prototype.setTime.apply(this,arguments),Kc(this),+this}[Symbol.for("constructDateFrom")](t){return new In(+new Date(t),this.timeZone)}}const em=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!em.test(e))return;const t=e.replace(em,"$1UTC");In.prototype[t]&&(e.startsWith("get")?In.prototype[e]=function(){return this.internal[t]()}:(In.prototype[e]=function(){return Date.prototype[t].apply(this.internal,arguments),yC(this),+this},In.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),Kc(this),+this}))});function Kc(e){e.internal.setTime(+e),e.internal.setUTCSeconds(e.internal.getUTCSeconds()-Math.round(-zr(e.timeZone,e)*60))}function yC(e){Date.prototype.setFullYear.call(e,e.internal.getUTCFullYear(),e.internal.getUTCMonth(),e.internal.getUTCDate()),Date.prototype.setHours.call(e,e.internal.getUTCHours(),e.internal.getUTCMinutes(),e.internal.getUTCSeconds(),e.internal.getUTCMilliseconds()),tm(e)}function tm(e){const t=zr(e.timeZone,e),n=t>0?Math.floor(t):Math.ceil(t),r=new Date(+e);r.setUTCHours(r.getUTCHours()-1);const o=-new Date(+e).getTimezoneOffset(),s=-new Date(+r).getTimezoneOffset(),i=o-s,a=Date.prototype.getHours.apply(e)!==e.internal.getUTCHours();i&&a&&e.internal.setUTCMinutes(e.internal.getUTCMinutes()+i);const c=o-n;c&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+c);const u=new Date(+e);u.setUTCSeconds(0);const l=o>0?u.getSeconds():(u.getSeconds()-60)%60,f=Math.round(-(zr(e.timeZone,e)*60))%60;(f||l)&&(e.internal.setUTCSeconds(e.internal.getUTCSeconds()+f),Date.prototype.setUTCSeconds.call(e,Date.prototype.getUTCSeconds.call(e)+f+l));const d=zr(e.timeZone,e),h=d>0?Math.floor(d):Math.ceil(d),p=-new Date(+e).getTimezoneOffset()-h,y=h!==n,g=p-c;if(y&&g){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+g);const C=zr(e.timeZone,e),O=C>0?Math.floor(C):Math.ceil(C),w=h-O;w&&(e.internal.setUTCMinutes(e.internal.getUTCMinutes()+w),Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+w))}}class Mt extends In{static tz(t,...n){return n.length?new Mt(...n,t):new Mt(Date.now(),t)}toISOString(){const[t,n,r]=this.tzComponents(),o=`${t}${n}:${r}`;return this.internal.toISOString().slice(0,-1)+o}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[t,n,r,o]=this.internal.toUTCString().split(" ");return`${t?.slice(0,-1)} ${r} ${n} ${o}`}toTimeString(){const t=this.internal.toUTCString().split(" ")[4],[n,r,o]=this.tzComponents();return`${t} GMT${n}${r}${o} (${pC(this.timeZone,this)})`}toLocaleString(t,n){return Date.prototype.toLocaleString.call(this,t,{...n,timeZone:n?.timeZone||this.timeZone})}toLocaleDateString(t,n){return Date.prototype.toLocaleDateString.call(this,t,{...n,timeZone:n?.timeZone||this.timeZone})}toLocaleTimeString(t,n){return Date.prototype.toLocaleTimeString.call(this,t,{...n,timeZone:n?.timeZone||this.timeZone})}tzComponents(){const t=this.getTimezoneOffset(),n=t>0?"-":"+",r=String(Math.floor(Math.abs(t)/60)).padStart(2,"0"),o=String(Math.abs(t)%60).padStart(2,"0");return[n,r,o]}withTimeZone(t){return new Mt(+this,t)}[Symbol.for("constructDateFrom")](t){return new Mt(+new Date(t),this.timeZone)}}const nm=6048e5,vC=864e5,rm=Symbol.for("constructDateFrom");function wt(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&rm in e?e[rm](t):e instanceof Date?new e.constructor(t):new Date(t)}function Ke(e,t){return wt(t||e,e)}function om(e,t,n){const r=Ke(e,n?.in);return isNaN(t)?wt(e,NaN):(t&&r.setDate(r.getDate()+t),r)}function sm(e,t,n){const r=Ke(e,n?.in);if(isNaN(t))return wt(e,NaN);if(!t)return r;const o=r.getDate(),s=wt(e,r.getTime());s.setMonth(r.getMonth()+t+1,0);const i=s.getDate();return o>=i?s:(r.setFullYear(s.getFullYear(),s.getMonth(),o),r)}let bC={};function Go(){return bC}function mo(e,t){const n=Go(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,o=Ke(e,t?.in),s=o.getDay(),i=(s<r?7:0)+s-r;return o.setDate(o.getDate()-i),o.setHours(0,0,0,0),o}function qo(e,t){return mo(e,{...t,weekStartsOn:1})}function im(e,t){const n=Ke(e,t?.in),r=n.getFullYear(),o=wt(n,0);o.setFullYear(r+1,0,4),o.setHours(0,0,0,0);const s=qo(o),i=wt(n,0);i.setFullYear(r,0,4),i.setHours(0,0,0,0);const a=qo(i);return n.getTime()>=s.getTime()?r+1:n.getTime()>=a.getTime()?r:r-1}function am(e){const t=Ke(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function go(e,...t){const n=wt.bind(null,t.find(r=>typeof r=="object"));return t.map(n)}function Ko(e,t){const n=Ke(e,t?.in);return n.setHours(0,0,0,0),n}function Xc(e,t,n){const[r,o]=go(n?.in,e,t),s=Ko(r),i=Ko(o),a=+s-am(s),c=+i-am(i);return Math.round((a-c)/vC)}function wC(e,t){const n=im(e,t),r=wt(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),qo(r)}function _C(e,t,n){return om(e,t*7,n)}function SC(e,t,n){return sm(e,t*12,n)}function kC(e,t){let n,r=t?.in;return e.forEach(o=>{!r&&typeof o=="object"&&(r=wt.bind(null,o));const s=Ke(o,r);(!n||n<s||isNaN(+s))&&(n=s)}),wt(r,n||NaN)}function xC(e,t){let n,r=t?.in;return e.forEach(o=>{!r&&typeof o=="object"&&(r=wt.bind(null,o));const s=Ke(o,r);(!n||n>s||isNaN(+s))&&(n=s)}),wt(r,n||NaN)}function OC(e,t,n){const[r,o]=go(n?.in,e,t);return+Ko(r)==+Ko(o)}function cm(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function EC(e){return!(!cm(e)&&typeof e!="number"||isNaN(+Ke(e)))}function lm(e,t,n){const[r,o]=go(n?.in,e,t),s=r.getFullYear()-o.getFullYear(),i=r.getMonth()-o.getMonth();return s*12+i}function CC(e,t){const n=Ke(e,t?.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function um(e,t){const[n,r]=go(e,t.start,t.end);return{start:n,end:r}}function TC(e,t){const{start:n,end:r}=um(t?.in,e);let o=+n>+r;const s=o?+n:+r,i=o?r:n;i.setHours(0,0,0,0),i.setDate(1);let a=1;const c=[];for(;+i<=s;)c.push(wt(n,i)),i.setMonth(i.getMonth()+a);return o?c.reverse():c}function DC(e,t){const n=Ke(e,t?.in);return n.setDate(1),n.setHours(0,0,0,0),n}function AC(e,t){const n=Ke(e,t?.in),r=n.getFullYear();return n.setFullYear(r+1,0,0),n.setHours(23,59,59,999),n}function fm(e,t){const n=Ke(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function MC(e,t){const{start:n,end:r}=um(t?.in,e);let o=+n>+r;const s=o?+n:+r,i=o?r:n;i.setHours(0,0,0,0),i.setMonth(0,1);let a=1;const c=[];for(;+i<=s;)c.push(wt(n,i)),i.setFullYear(i.getFullYear()+a);return o?c.reverse():c}function dm(e,t){const n=Go(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,o=Ke(e,t?.in),s=o.getDay(),i=(s<r?-7:0)+6-(s-r);return o.setDate(o.getDate()+i),o.setHours(23,59,59,999),o}function PC(e,t){return dm(e,{...t,weekStartsOn:1})}const NC={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},IC=(e,t,n)=>{let r;const o=NC[e];return typeof o=="string"?r=o:t===1?r=o.one:r=o.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function Jc(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const FC={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},RC={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},WC={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},zC={date:Jc({formats:FC,defaultWidth:"full"}),time:Jc({formats:RC,defaultWidth:"full"}),dateTime:Jc({formats:WC,defaultWidth:"full"})},LC={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},$C=(e,t,n,r)=>LC[e];function Xo(e){return(t,n)=>{const r=n?.context?String(n.context):"standalone";let o;if(r==="formatting"&&e.formattingValues){const i=e.defaultFormattingWidth||e.defaultWidth,a=n?.width?String(n.width):i;o=e.formattingValues[a]||e.formattingValues[i]}else{const i=e.defaultWidth,a=n?.width?String(n.width):e.defaultWidth;o=e.values[a]||e.values[i]}const s=e.argumentCallback?e.argumentCallback(t):t;return o[s]}}const UC={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},YC={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},jC={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},VC={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},BC={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},HC={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},ZC={ordinalNumber:(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:Xo({values:UC,defaultWidth:"wide"}),quarter:Xo({values:YC,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Xo({values:jC,defaultWidth:"wide"}),day:Xo({values:VC,defaultWidth:"wide"}),dayPeriod:Xo({values:BC,defaultWidth:"wide",formattingValues:HC,defaultFormattingWidth:"wide"})};function Jo(e){return(t,n={})=>{const r=n.width,o=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],s=t.match(o);if(!s)return null;const i=s[0],a=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(a)?qC(a,f=>f.test(i)):GC(a,f=>f.test(i));let u;u=e.valueCallback?e.valueCallback(c):c,u=n.valueCallback?n.valueCallback(u):u;const l=t.slice(i.length);return{value:u,rest:l}}}function GC(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function qC(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function KC(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const o=r[0],s=t.match(e.parsePattern);if(!s)return null;let i=e.valueCallback?e.valueCallback(s[0]):s[0];i=n.valueCallback?n.valueCallback(i):i;const a=t.slice(o.length);return{value:i,rest:a}}}const XC=/^(\d+)(th|st|nd|rd)?/i,JC=/\d+/i,QC={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},eT={any:[/^b/i,/^(a|c)/i]},tT={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},nT={any:[/1/i,/2/i,/3/i,/4/i]},rT={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},oT={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},sT={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},iT={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},aT={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},cT={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},lT={ordinalNumber:KC({matchPattern:XC,parsePattern:JC,valueCallback:e=>parseInt(e,10)}),era:Jo({matchPatterns:QC,defaultMatchWidth:"wide",parsePatterns:eT,defaultParseWidth:"any"}),quarter:Jo({matchPatterns:tT,defaultMatchWidth:"wide",parsePatterns:nT,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Jo({matchPatterns:rT,defaultMatchWidth:"wide",parsePatterns:oT,defaultParseWidth:"any"}),day:Jo({matchPatterns:sT,defaultMatchWidth:"wide",parsePatterns:iT,defaultParseWidth:"any"}),dayPeriod:Jo({matchPatterns:aT,defaultMatchWidth:"any",parsePatterns:cT,defaultParseWidth:"any"})},yo={code:"en-US",formatDistance:IC,formatLong:zC,formatRelative:$C,localize:ZC,match:lT,options:{weekStartsOn:0,firstWeekContainsDate:1}};function uT(e,t){const n=Ke(e,t?.in);return Xc(n,fm(n))+1}function Qc(e,t){const n=Ke(e,t?.in),r=+qo(n)-+wC(n);return Math.round(r/nm)+1}function hm(e,t){const n=Ke(e,t?.in),r=n.getFullYear(),o=Go(),s=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,i=wt(t?.in||e,0);i.setFullYear(r+1,0,s),i.setHours(0,0,0,0);const a=mo(i,t),c=wt(t?.in||e,0);c.setFullYear(r,0,s),c.setHours(0,0,0,0);const u=mo(c,t);return+n>=+a?r+1:+n>=+u?r:r-1}function fT(e,t){const n=Go(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,o=hm(e,t),s=wt(t?.in||e,0);return s.setFullYear(o,0,r),s.setHours(0,0,0,0),mo(s,t)}function el(e,t){const n=Ke(e,t?.in),r=+mo(n,t)-+fT(n,t);return Math.round(r/nm)+1}function He(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const wr={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return He(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):He(n+1,2)},d(e,t){return He(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return n==="am"?"a.m.":"p.m."}},h(e,t){return He(e.getHours()%12||12,t.length)},H(e,t){return He(e.getHours(),t.length)},m(e,t){return He(e.getMinutes(),t.length)},s(e,t){return He(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),o=Math.trunc(r*Math.pow(10,n-3));return He(o,t.length)}},vo={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},pm={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),o=r>0?r:1-r;return n.ordinalNumber(o,{unit:"year"})}return wr.y(e,t)},Y:function(e,t,n,r){const o=hm(e,r),s=o>0?o:1-o;if(t==="YY"){const i=s%100;return He(i,2)}return t==="Yo"?n.ordinalNumber(s,{unit:"year"}):He(s,t.length)},R:function(e,t){const n=im(e);return He(n,t.length)},u:function(e,t){const n=e.getFullYear();return He(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return He(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return He(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return wr.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return He(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const o=el(e,r);return t==="wo"?n.ordinalNumber(o,{unit:"week"}):He(o,t.length)},I:function(e,t,n){const r=Qc(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):He(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):wr.d(e,t)},D:function(e,t,n){const r=uT(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):He(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const o=e.getDay(),s=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return He(s,2);case"eo":return n.ordinalNumber(s,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const o=e.getDay(),s=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return He(s,t.length);case"co":return n.ordinalNumber(s,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),o=r===0?7:r;switch(t){case"i":return String(o);case"ii":return He(o,t.length);case"io":return n.ordinalNumber(o,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const o=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(o,{width:"narrow",context:"formatting"});default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let o;switch(r===12?o=vo.noon:r===0?o=vo.midnight:o=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(o,{width:"narrow",context:"formatting"});default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let o;switch(r>=17?o=vo.evening:r>=12?o=vo.afternoon:r>=4?o=vo.morning:o=vo.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(o,{width:"narrow",context:"formatting"});default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return wr.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):wr.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):He(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):He(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):wr.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):wr.s(e,t)},S:function(e,t){return wr.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return gm(r);case"XXXX":case"XX":return Lr(r);default:return Lr(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return gm(r);case"xxxx":case"xx":return Lr(r);default:return Lr(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+mm(r,":");default:return"GMT"+Lr(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+mm(r,":");default:return"GMT"+Lr(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return He(r,t.length)},T:function(e,t,n){return He(+e,t.length)}};function mm(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=Math.trunc(r/60),s=r%60;return s===0?n+String(o):n+String(o)+t+He(s,2)}function gm(e,t){return e%60===0?(e>0?"-":"+")+He(Math.abs(e)/60,2):Lr(e,t)}function Lr(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=He(Math.trunc(r/60),2),s=He(r%60,2);return n+o+t+s}const ym=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},vm=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},dT={p:vm,P:(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],o=n[2];if(!o)return ym(e,t);let s;switch(r){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",ym(r,t)).replace("{{time}}",vm(o,t))}},hT=/^D+$/,pT=/^Y+$/,mT=["D","DD","YY","YYYY"];function gT(e){return hT.test(e)}function yT(e){return pT.test(e)}function vT(e,t,n){const r=bT(e,t,n);if(console.warn(r),mT.includes(e))throw new RangeError(r)}function bT(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const wT=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,_T=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ST=/^'([^]*?)'?$/,kT=/''/g,xT=/[a-zA-Z]/;function Qo(e,t,n){const r=Go(),o=n?.locale??r.locale??yo,s=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,i=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,a=Ke(e,n?.in);if(!EC(a))throw new RangeError("Invalid time value");let c=t.match(_T).map(l=>{const f=l[0];if(f==="p"||f==="P"){const d=dT[f];return d(l,o.formatLong)}return l}).join("").match(wT).map(l=>{if(l==="''")return{isToken:!1,value:"'"};const f=l[0];if(f==="'")return{isToken:!1,value:OT(l)};if(pm[f])return{isToken:!0,value:l};if(f.match(xT))throw new RangeError("Format string contains an unescaped latin alphabet character `"+f+"`");return{isToken:!1,value:l}});o.localize.preprocessor&&(c=o.localize.preprocessor(a,c));const u={firstWeekContainsDate:s,weekStartsOn:i,locale:o};return c.map(l=>{if(!l.isToken)return l.value;const f=l.value;(!n?.useAdditionalWeekYearTokens&&yT(f)||!n?.useAdditionalDayOfYearTokens&&gT(f))&&vT(f,t,String(e));const d=pm[f[0]];return d(a,f,o.localize,u)}).join("")}function OT(e){const t=e.match(ST);return t?t[1].replace(kT,"'"):e}function ET(e,t){const n=Ke(e,t?.in),r=n.getFullYear(),o=n.getMonth(),s=wt(n,0);return s.setFullYear(r,o+1,0),s.setHours(0,0,0,0),s.getDate()}function CT(e,t){return Ke(e,t?.in).getMonth()}function TT(e,t){return Ke(e,t?.in).getFullYear()}function DT(e,t){return+Ke(e)>+Ke(t)}function AT(e,t){return+Ke(e)<+Ke(t)}function MT(e,t,n){const[r,o]=go(n?.in,e,t);return r.getFullYear()===o.getFullYear()&&r.getMonth()===o.getMonth()}function PT(e,t,n){const[r,o]=go(n?.in,e,t);return r.getFullYear()===o.getFullYear()}function NT(e,t,n){const r=Ke(e,n?.in),o=r.getFullYear(),s=r.getDate(),i=wt(e,0);i.setFullYear(o,t,15),i.setHours(0,0,0,0);const a=ET(i);return r.setMonth(t,Math.min(s,a)),r}function IT(e,t,n){const r=Ke(e,n?.in);return isNaN(+r)?wt(e,NaN):(r.setFullYear(t),r)}const bm=5,FT=4;function RT(e,t){const n=t.startOfMonth(e),r=n.getDay()>0?n.getDay():7,o=t.addDays(e,-r+1),s=t.addDays(o,bm*7-1);return t.getMonth(e)===t.getMonth(s)?bm:FT}function wm(e,t){const n=t.startOfMonth(e),r=n.getDay();return r===1?n:r===0?t.addDays(n,-6):t.addDays(n,-1*(r-1))}function WT(e,t){const n=wm(e,t),r=RT(e,t);return t.addDays(n,r*7-1)}const _m={...yo,labels:{labelDayButton:(e,t,n,r)=>{let o;r&&typeof r.format=="function"?o=r.format.bind(r):o=(i,a)=>Qo(i,a,{locale:yo,...n});let s=o(e,"PPPP");return t.today&&(s=`Today, ${s}`),t.selected&&(s=`${s}, selected`),s},labelMonthDropdown:"Choose the Month",labelNext:"Go to the Next Month",labelPrevious:"Go to the Previous Month",labelWeekNumber:e=>`Week ${e}`,labelYearDropdown:"Choose the Year",labelGrid:(e,t,n)=>{let r;return n&&typeof n.format=="function"?r=n.format.bind(n):r=(o,s)=>Qo(o,s,{locale:yo,...t}),r(e,"LLLL yyyy")},labelGridcell:(e,t,n,r)=>{let o;r&&typeof r.format=="function"?o=r.format.bind(r):o=(i,a)=>Qo(i,a,{locale:yo,...n});let s=o(e,"PPPP");return t?.today&&(s=`Today, ${s}`),s},labelNav:"Navigation bar",labelWeekNumberHeader:"Week Number",labelWeekday:(e,t,n)=>{let r;return n&&typeof n.format=="function"?r=n.format.bind(n):r=(o,s)=>Qo(o,s,{locale:yo,...t}),r(e,"cccc")}}};class Kt{constructor(t,n){this.Date=Date,this.today=()=>this.overrides?.today?this.overrides.today():this.options.timeZone?Mt.tz(this.options.timeZone):new this.Date,this.newDate=(r,o,s)=>this.overrides?.newDate?this.overrides.newDate(r,o,s):this.options.timeZone?new Mt(r,o,s,this.options.timeZone):new Date(r,o,s),this.addDays=(r,o)=>this.overrides?.addDays?this.overrides.addDays(r,o):om(r,o),this.addMonths=(r,o)=>this.overrides?.addMonths?this.overrides.addMonths(r,o):sm(r,o),this.addWeeks=(r,o)=>this.overrides?.addWeeks?this.overrides.addWeeks(r,o):_C(r,o),this.addYears=(r,o)=>this.overrides?.addYears?this.overrides.addYears(r,o):SC(r,o),this.differenceInCalendarDays=(r,o)=>this.overrides?.differenceInCalendarDays?this.overrides.differenceInCalendarDays(r,o):Xc(r,o),this.differenceInCalendarMonths=(r,o)=>this.overrides?.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(r,o):lm(r,o),this.eachMonthOfInterval=r=>this.overrides?.eachMonthOfInterval?this.overrides.eachMonthOfInterval(r):TC(r),this.eachYearOfInterval=r=>{const o=this.overrides?.eachYearOfInterval?this.overrides.eachYearOfInterval(r):MC(r),s=new Set(o.map(a=>this.getYear(a)));if(s.size===o.length)return o;const i=[];return s.forEach(a=>{i.push(new Date(a,0,1))}),i},this.endOfBroadcastWeek=r=>this.overrides?.endOfBroadcastWeek?this.overrides.endOfBroadcastWeek(r):WT(r,this),this.endOfISOWeek=r=>this.overrides?.endOfISOWeek?this.overrides.endOfISOWeek(r):PC(r),this.endOfMonth=r=>this.overrides?.endOfMonth?this.overrides.endOfMonth(r):CC(r),this.endOfWeek=(r,o)=>this.overrides?.endOfWeek?this.overrides.endOfWeek(r,o):dm(r,this.options),this.endOfYear=r=>this.overrides?.endOfYear?this.overrides.endOfYear(r):AC(r),this.format=(r,o,s)=>{const i=this.overrides?.format?this.overrides.format(r,o,this.options):Qo(r,o,this.options);return this.options.numerals&&this.options.numerals!=="latn"?this.replaceDigits(i):i},this.getISOWeek=r=>this.overrides?.getISOWeek?this.overrides.getISOWeek(r):Qc(r),this.getMonth=(r,o)=>this.overrides?.getMonth?this.overrides.getMonth(r,this.options):CT(r,this.options),this.getYear=(r,o)=>this.overrides?.getYear?this.overrides.getYear(r,this.options):TT(r,this.options),this.getWeek=(r,o)=>this.overrides?.getWeek?this.overrides.getWeek(r,this.options):el(r,this.options),this.isAfter=(r,o)=>this.overrides?.isAfter?this.overrides.isAfter(r,o):DT(r,o),this.isBefore=(r,o)=>this.overrides?.isBefore?this.overrides.isBefore(r,o):AT(r,o),this.isDate=r=>this.overrides?.isDate?this.overrides.isDate(r):cm(r),this.isSameDay=(r,o)=>this.overrides?.isSameDay?this.overrides.isSameDay(r,o):OC(r,o),this.isSameMonth=(r,o)=>this.overrides?.isSameMonth?this.overrides.isSameMonth(r,o):MT(r,o),this.isSameYear=(r,o)=>this.overrides?.isSameYear?this.overrides.isSameYear(r,o):PT(r,o),this.max=r=>this.overrides?.max?this.overrides.max(r):kC(r),this.min=r=>this.overrides?.min?this.overrides.min(r):xC(r),this.setMonth=(r,o)=>this.overrides?.setMonth?this.overrides.setMonth(r,o):NT(r,o),this.setYear=(r,o)=>this.overrides?.setYear?this.overrides.setYear(r,o):IT(r,o),this.startOfBroadcastWeek=(r,o)=>this.overrides?.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(r,this):wm(r,this),this.startOfDay=r=>this.overrides?.startOfDay?this.overrides.startOfDay(r):Ko(r),this.startOfISOWeek=r=>this.overrides?.startOfISOWeek?this.overrides.startOfISOWeek(r):qo(r),this.startOfMonth=r=>this.overrides?.startOfMonth?this.overrides.startOfMonth(r):DC(r),this.startOfWeek=(r,o)=>this.overrides?.startOfWeek?this.overrides.startOfWeek(r,this.options):mo(r,this.options),this.startOfYear=r=>this.overrides?.startOfYear?this.overrides.startOfYear(r):fm(r),this.options={locale:_m,...t},this.overrides=n}getDigitMap(){const{numerals:t="latn"}=this.options,n=new Intl.NumberFormat("en-US",{numberingSystem:t}),r={};for(let o=0;o<10;o++)r[o.toString()]=n.format(o);return r}replaceDigits(t){const n=this.getDigitMap();return t.replace(/\d/g,r=>n[r]||r)}formatNumber(t){return this.replaceDigits(t.toString())}getMonthYearOrder(){const t=this.options.locale?.code;return t&&Kt.yearFirstLocales.has(t)?"year-first":"month-first"}formatMonthYear(t){const{locale:n,timeZone:r,numerals:o}=this.options,s=n?.code;if(s&&Kt.yearFirstLocales.has(s))try{return new Intl.DateTimeFormat(s,{month:"long",year:"numeric",timeZone:r,numberingSystem:o}).format(t)}catch{}const i=this.getMonthYearOrder()==="year-first"?"y LLLL":"LLLL y";return this.format(t,i)}}Kt.yearFirstLocales=new Set(["eu","hu","ja","ja-Hira","ja-JP","ko","ko-KR","lt","lt-LT","lv","lv-LV","mn","mn-MN","zh","zh-CN","zh-HK","zh-TW"]);const Fn=new Kt;class Sm{constructor(t,n,r=Fn){this.date=t,this.displayMonth=n,this.outside=!!(n&&!r.isSameMonth(t,n)),this.dateLib=r,this.isoDate=r.format(t,"yyyy-MM-dd"),this.displayMonthId=r.format(n,"yyyy-MM"),this.dateMonthId=r.format(t,"yyyy-MM")}isEqualTo(t){return this.dateLib.isSameDay(t.date,this.date)&&this.dateLib.isSameMonth(t.displayMonth,this.displayMonth)}}class zT{constructor(t,n){this.date=t,this.weeks=n}}class LT{constructor(t,n){this.days=n,this.weekNumber=t}}function $T(e){return j.createElement("button",{...e})}function UT(e){return j.createElement("span",{...e})}function YT(e){const{size:t=24,orientation:n="left",className:r}=e;return j.createElement("svg",{className:r,width:t,height:t,viewBox:"0 0 24 24"},n==="up"&&j.createElement("polygon",{points:"6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28"}),n==="down"&&j.createElement("polygon",{points:"6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72"}),n==="left"&&j.createElement("polygon",{points:"16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20"}),n==="right"&&j.createElement("polygon",{points:"8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20"}))}function jT(e){const{day:t,modifiers:n,...r}=e;return j.createElement("td",{...r})}function VT(e){const{day:t,modifiers:n,...r}=e,o=j.useRef(null);return j.useEffect(()=>{n.focused&&o.current?.focus()},[n.focused]),j.createElement("button",{ref:o,...r})}var me;(function(e){e.Root="root",e.Chevron="chevron",e.Day="day",e.DayButton="day_button",e.CaptionLabel="caption_label",e.Dropdowns="dropdowns",e.Dropdown="dropdown",e.DropdownRoot="dropdown_root",e.Footer="footer",e.MonthGrid="month_grid",e.MonthCaption="month_caption",e.MonthsDropdown="months_dropdown",e.Month="month",e.Months="months",e.Nav="nav",e.NextMonthButton="button_next",e.PreviousMonthButton="button_previous",e.Week="week",e.Weeks="weeks",e.Weekday="weekday",e.Weekdays="weekdays",e.WeekNumber="week_number",e.WeekNumberHeader="week_number_header",e.YearsDropdown="years_dropdown"})(me||(me={}));var ut;(function(e){e.disabled="disabled",e.hidden="hidden",e.outside="outside",e.focused="focused",e.today="today"})(ut||(ut={}));var vn;(function(e){e.range_end="range_end",e.range_middle="range_middle",e.range_start="range_start",e.selected="selected"})(vn||(vn={}));var Xt;(function(e){e.weeks_before_enter="weeks_before_enter",e.weeks_before_exit="weeks_before_exit",e.weeks_after_enter="weeks_after_enter",e.weeks_after_exit="weeks_after_exit",e.caption_after_enter="caption_after_enter",e.caption_after_exit="caption_after_exit",e.caption_before_enter="caption_before_enter",e.caption_before_exit="caption_before_exit"})(Xt||(Xt={}));function BT(e){const{options:t,className:n,components:r,classNames:o,...s}=e,i=[o[me.Dropdown],n].join(" "),a=t?.find(({value:c})=>c===s.value);return j.createElement("span",{"data-disabled":s.disabled,className:o[me.DropdownRoot]},j.createElement(r.Select,{className:i,...s},t?.map(({value:c,label:u,disabled:l})=>j.createElement(r.Option,{key:c,value:c,disabled:l},u))),j.createElement("span",{className:o[me.CaptionLabel],"aria-hidden":!0},a?.label,j.createElement(r.Chevron,{orientation:"down",size:18,className:o[me.Chevron]})))}function HT(e){return j.createElement("div",{...e})}function ZT(e){return j.createElement("div",{...e})}function GT(e){const{calendarMonth:t,displayIndex:n,...r}=e;return j.createElement("div",{...r},e.children)}function qT(e){const{calendarMonth:t,displayIndex:n,...r}=e;return j.createElement("div",{...r})}function KT(e){return j.createElement("table",{...e})}function XT(e){return j.createElement("div",{...e})}const km=j.createContext(void 0);function es(){const e=j.useContext(km);if(e===void 0)throw new Error("useDayPicker() must be used within a custom component.");return e}function JT(e){const{components:t}=es();return j.createElement(t.Dropdown,{...e})}function QT(e){const{onPreviousClick:t,onNextClick:n,previousMonth:r,nextMonth:o,...s}=e,{components:i,classNames:a,labels:{labelPrevious:c,labelNext:u}}=es(),l=j.useCallback(d=>{o&&n?.(d)},[o,n]),f=j.useCallback(d=>{r&&t?.(d)},[r,t]);return j.createElement("nav",{...s},j.createElement(i.PreviousMonthButton,{type:"button",className:a[me.PreviousMonthButton],tabIndex:r?void 0:-1,"aria-disabled":r?void 0:!0,"aria-label":c(r),onClick:f},j.createElement(i.Chevron,{disabled:r?void 0:!0,className:a[me.Chevron],orientation:"left"})),j.createElement(i.NextMonthButton,{type:"button",className:a[me.NextMonthButton],tabIndex:o?void 0:-1,"aria-disabled":o?void 0:!0,"aria-label":u(o),onClick:l},j.createElement(i.Chevron,{disabled:o?void 0:!0,orientation:"right",className:a[me.Chevron]})))}function eD(e){const{components:t}=es();return j.createElement(t.Button,{...e})}function tD(e){return j.createElement("option",{...e})}function nD(e){const{components:t}=es();return j.createElement(t.Button,{...e})}function rD(e){const{rootRef:t,...n}=e;return j.createElement("div",{...n,ref:t})}function oD(e){return j.createElement("select",{...e})}function sD(e){const{week:t,...n}=e;return j.createElement("tr",{...n})}function iD(e){return j.createElement("th",{...e})}function aD(e){return j.createElement("thead",{"aria-hidden":!0},j.createElement("tr",{...e}))}function cD(e){const{week:t,...n}=e;return j.createElement("th",{...n})}function lD(e){return j.createElement("th",{...e})}function uD(e){return j.createElement("tbody",{...e})}function fD(e){const{components:t}=es();return j.createElement(t.Dropdown,{...e})}const dD=Object.freeze(Object.defineProperty({__proto__:null,Button:$T,CaptionLabel:UT,Chevron:YT,Day:jT,DayButton:VT,Dropdown:BT,DropdownNav:HT,Footer:ZT,Month:GT,MonthCaption:qT,MonthGrid:KT,Months:XT,MonthsDropdown:JT,Nav:QT,NextMonthButton:eD,Option:tD,PreviousMonthButton:nD,Root:rD,Select:oD,Week:sD,WeekNumber:cD,WeekNumberHeader:lD,Weekday:iD,Weekdays:aD,Weeks:uD,YearsDropdown:fD},Symbol.toStringTag,{value:"Module"}));function Qn(e,t,n=!1,r=Fn){let{from:o,to:s}=e;const{differenceInCalendarDays:i,isSameDay:a}=r;return o&&s?(i(s,o)<0&&([o,s]=[s,o]),i(t,o)>=(n?1:0)&&i(s,t)>=(n?1:0)):!n&&s?a(s,t):!n&&o?a(o,t):!1}function tl(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function Di(e){return!!(e&&typeof e=="object"&&"from"in e)}function nl(e){return!!(e&&typeof e=="object"&&"after"in e)}function rl(e){return!!(e&&typeof e=="object"&&"before"in e)}function xm(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function Om(e,t){return Array.isArray(e)&&e.every(t.isDate)}function er(e,t,n=Fn){const r=Array.isArray(t)?t:[t],{isSameDay:o,differenceInCalendarDays:s,isAfter:i}=n;return r.some(a=>{if(typeof a=="boolean")return a;if(n.isDate(a))return o(e,a);if(Om(a,n))return a.some(c=>o(e,c));if(Di(a))return Qn(a,e,!1,n);if(xm(a))return Array.isArray(a.dayOfWeek)?a.dayOfWeek.includes(e.getDay()):a.dayOfWeek===e.getDay();if(tl(a)){const c=s(a.before,e),u=s(a.after,e),l=c>0,f=u<0;return i(a.before,a.after)?f&&l:l||f}return nl(a)?s(e,a.after)>0:rl(a)?s(a.before,e)>0:typeof a=="function"?a(e):!1})}function hD(e,t,n,r,o){const{disabled:s,hidden:i,modifiers:a,showOutsideDays:c,broadcastCalendar:u,today:l=o.today()}=t,{isSameDay:f,isSameMonth:d,startOfMonth:h,isBefore:m,endOfMonth:p,isAfter:y}=o,g=n&&h(n),C=r&&p(r),O={[ut.focused]:[],[ut.outside]:[],[ut.disabled]:[],[ut.hidden]:[],[ut.today]:[]},w={};for(const _ of e){const{date:S,displayMonth:I}=_,v=!!(I&&!d(S,I)),x=!!(g&&m(S,g)),P=!!(C&&y(S,C)),A=!!(s&&er(S,s,o)),M=!!(i&&er(S,i,o))||x||P||!u&&!c&&v||u&&c===!1&&v,F=f(S,l);v&&O.outside.push(_),A&&O.disabled.push(_),M&&O.hidden.push(_),F&&O.today.push(_),a&&Object.keys(a).forEach(N=>{const W=a?.[N];W&&er(S,W,o)&&(w[N]?w[N].push(_):w[N]=[_])})}return _=>{const S={[ut.focused]:!1,[ut.disabled]:!1,[ut.hidden]:!1,[ut.outside]:!1,[ut.today]:!1},I={};for(const v in O){const x=O[v];S[v]=x.some(P=>P===_)}for(const v in w)I[v]=w[v].some(x=>x===_);return{...S,...I}}}function pD(e,t,n={}){return Object.entries(e).filter(([,o])=>o===!0).reduce((o,[s])=>(n[s]?o.push(n[s]):t[ut[s]]?o.push(t[ut[s]]):t[vn[s]]&&o.push(t[vn[s]]),o),[t[me.Day]])}function mD(e){return{...dD,...e}}function gD(e){const t={"data-mode":e.mode??void 0,"data-required":"required"in e?e.required:void 0,"data-multiple-months":e.numberOfMonths&&e.numberOfMonths>1||void 0,"data-week-numbers":e.showWeekNumber||void 0,"data-broadcast-calendar":e.broadcastCalendar||void 0,"data-nav-layout":e.navLayout||void 0};return Object.entries(e).forEach(([n,r])=>{n.startsWith("data-")&&(t[n]=r)}),t}function ol(){const e={};for(const t in me)e[me[t]]=`rdp-${me[t]}`;for(const t in ut)e[ut[t]]=`rdp-${ut[t]}`;for(const t in vn)e[vn[t]]=`rdp-${vn[t]}`;for(const t in Xt)e[Xt[t]]=`rdp-${Xt[t]}`;return e}function Em(e,t,n){return(n??new Kt(t)).formatMonthYear(e)}const yD=Em;function vD(e,t,n){return(n??new Kt(t)).format(e,"d")}function bD(e,t=Fn){return t.format(e,"LLLL")}function wD(e,t,n){return(n??new Kt(t)).format(e,"cccccc")}function _D(e,t=Fn){return e<10?t.formatNumber(`0${e.toLocaleString()}`):t.formatNumber(`${e.toLocaleString()}`)}function SD(){return""}function Cm(e,t=Fn){return t.format(e,"yyyy")}const kD=Object.freeze(Object.defineProperty({__proto__:null,formatCaption:Em,formatDay:vD,formatMonthCaption:yD,formatMonthDropdown:bD,formatWeekNumber:_D,formatWeekNumberHeader:SD,formatWeekdayName:wD,formatYearCaption:Cm,formatYearDropdown:Cm},Symbol.toStringTag,{value:"Module"}));function xD(e){return e?.formatMonthCaption&&!e.formatCaption&&(e.formatCaption=e.formatMonthCaption),e?.formatYearCaption&&!e.formatYearDropdown&&(e.formatYearDropdown=e.formatYearCaption),{...kD,...e}}function sl(e,t,n,r){let o=(r??new Kt(n)).format(e,"PPPP");return t.today&&(o=`Today, ${o}`),t.selected&&(o=`${o}, selected`),o}const OD=sl;function il(e,t,n){return(n??new Kt(t)).formatMonthYear(e)}const ED=il;function Tm(e,t,n,r){let o=(r??new Kt(n)).format(e,"PPPP");return t?.today&&(o=`Today, ${o}`),o}function Dm(e){return"Choose the Month"}function Am(){return""}const CD="Go to the Next Month";function Mm(e,t){return CD}function Pm(e){return"Go to the Previous Month"}function Nm(e,t,n){return(n??new Kt(t)).format(e,"cccc")}function Im(e,t){return`Week ${e}`}function Fm(e){return"Week Number"}function Rm(e){return"Choose the Year"}const TD=Object.freeze(Object.defineProperty({__proto__:null,labelCaption:ED,labelDay:OD,labelDayButton:sl,labelGrid:il,labelGridcell:Tm,labelMonthDropdown:Dm,labelNav:Am,labelNext:Mm,labelPrevious:Pm,labelWeekNumber:Im,labelWeekNumberHeader:Fm,labelWeekday:Nm,labelYearDropdown:Rm},Symbol.toStringTag,{value:"Module"})),bn=(e,t,n)=>t||(n?typeof n=="function"?n:(...r)=>n:e);function DD(e,t){const n=t.locale?.labels??{};return{...TD,...e??{},labelDayButton:bn(sl,e?.labelDayButton,n.labelDayButton),labelMonthDropdown:bn(Dm,e?.labelMonthDropdown,n.labelMonthDropdown),labelNext:bn(Mm,e?.labelNext,n.labelNext),labelPrevious:bn(Pm,e?.labelPrevious,n.labelPrevious),labelWeekNumber:bn(Im,e?.labelWeekNumber,n.labelWeekNumber),labelYearDropdown:bn(Rm,e?.labelYearDropdown,n.labelYearDropdown),labelGrid:bn(il,e?.labelGrid,n.labelGrid),labelGridcell:bn(Tm,e?.labelGridcell,n.labelGridcell),labelNav:bn(Am,e?.labelNav,n.labelNav),labelWeekNumberHeader:bn(Fm,e?.labelWeekNumberHeader,n.labelWeekNumberHeader),labelWeekday:bn(Nm,e?.labelWeekday,n.labelWeekday)}}function AD(e,t,n,r,o){const{startOfMonth:s,startOfYear:i,endOfYear:a,eachMonthOfInterval:c,getMonth:u}=o;return c({start:i(e),end:a(e)}).map(d=>{const h=r.formatMonthDropdown(d,o),m=u(d),p=t&&d<s(t)||n&&d>s(n)||!1;return{value:m,label:h,disabled:p}})}function MD(e,t={},n={}){let r={...t?.[me.Day]};return Object.entries(e).filter(([,o])=>o===!0).forEach(([o])=>{r={...r,...n?.[o]}}),r}function PD(e,t,n,r){const o=r??e.today(),s=n?e.startOfBroadcastWeek(o,e):t?e.startOfISOWeek(o):e.startOfWeek(o),i=[];for(let a=0;a<7;a++){const c=e.addDays(s,a);i.push(c)}return i}function ND(e,t,n,r,o=!1){if(!e||!t)return;const{startOfYear:s,endOfYear:i,eachYearOfInterval:a,getYear:c}=r,u=s(e),l=i(t),f=a({start:u,end:l});return o&&f.reverse(),f.map(d=>{const h=n.formatYearDropdown(d,r);return{value:c(d),label:h,disabled:!1}})}function ID(e,t={}){const{weekStartsOn:n,locale:r}=t,o=n??r?.options?.weekStartsOn??0,s=a=>{const c=typeof a=="number"||typeof a=="string"?new Date(a):a;return new Mt(c.getFullYear(),c.getMonth(),c.getDate(),12,0,0,e)},i=a=>{const c=s(a);return new Date(c.getFullYear(),c.getMonth(),c.getDate(),0,0,0,0)};return{today:()=>s(Mt.tz(e)),newDate:(a,c,u)=>new Mt(a,c,u,12,0,0,e),startOfDay:a=>s(a),startOfWeek:(a,c)=>{const u=s(a),l=c?.weekStartsOn??o,f=(u.getDay()-l+7)%7;return u.setDate(u.getDate()-f),u},startOfISOWeek:a=>{const c=s(a),u=(c.getDay()-1+7)%7;return c.setDate(c.getDate()-u),c},startOfMonth:a=>{const c=s(a);return c.setDate(1),c},startOfYear:a=>{const c=s(a);return c.setMonth(0,1),c},endOfWeek:(a,c)=>{const u=s(a),d=(((c?.weekStartsOn??o)+6)%7-u.getDay()+7)%7;return u.setDate(u.getDate()+d),u},endOfISOWeek:a=>{const c=s(a),u=(7-c.getDay())%7;return c.setDate(c.getDate()+u),c},endOfMonth:a=>{const c=s(a);return c.setMonth(c.getMonth()+1,0),c},endOfYear:a=>{const c=s(a);return c.setMonth(11,31),c},eachMonthOfInterval:a=>{const c=s(a.start),u=s(a.end),l=[],f=new Mt(c.getFullYear(),c.getMonth(),1,12,0,0,e),d=u.getFullYear()*12+u.getMonth();for(;f.getFullYear()*12+f.getMonth()<=d;)l.push(new Mt(f,e)),f.setMonth(f.getMonth()+1,1);return l},addDays:(a,c)=>{const u=s(a);return u.setDate(u.getDate()+c),u},addWeeks:(a,c)=>{const u=s(a);return u.setDate(u.getDate()+c*7),u},addMonths:(a,c)=>{const u=s(a);return u.setMonth(u.getMonth()+c),u},addYears:(a,c)=>{const u=s(a);return u.setFullYear(u.getFullYear()+c),u},eachYearOfInterval:a=>{const c=s(a.start),u=s(a.end),l=[],f=new Mt(c.getFullYear(),0,1,12,0,0,e);for(;f.getFullYear()<=u.getFullYear();)l.push(new Mt(f,e)),f.setFullYear(f.getFullYear()+1,0,1);return l},getWeek:(a,c)=>{const u=i(a);return el(u,{weekStartsOn:c?.weekStartsOn??o,firstWeekContainsDate:c?.firstWeekContainsDate??r?.options?.firstWeekContainsDate??1})},getISOWeek:a=>{const c=i(a);return Qc(c)},differenceInCalendarDays:(a,c)=>{const u=i(a),l=i(c);return Xc(u,l)},differenceInCalendarMonths:(a,c)=>{const u=i(a),l=i(c);return lm(u,l)}}}const ts=e=>e instanceof HTMLElement?e:null,al=e=>[...e.querySelectorAll("[data-animated-month]")??[]],FD=e=>ts(e.querySelector("[data-animated-month]")),cl=e=>ts(e.querySelector("[data-animated-caption]")),ll=e=>ts(e.querySelector("[data-animated-weeks]")),RD=e=>ts(e.querySelector("[data-animated-nav]")),WD=e=>ts(e.querySelector("[data-animated-weekdays]"));function zD(e,t,{classNames:n,months:r,focused:o,dateLib:s}){const i=j.useRef(null),a=j.useRef(r),c=j.useRef(!1);j.useLayoutEffect(()=>{const u=a.current;if(a.current=r,!t||!e.current||!(e.current instanceof HTMLElement)||r.length===0||u.length===0||r.length!==u.length)return;const l=s.isSameMonth(r[0].date,u[0].date),f=s.isAfter(r[0].date,u[0].date),d=f?n[Xt.caption_after_enter]:n[Xt.caption_before_enter],h=f?n[Xt.weeks_after_enter]:n[Xt.weeks_before_enter],m=i.current,p=e.current.cloneNode(!0);if(p instanceof HTMLElement?(al(p).forEach(O=>{if(!(O instanceof HTMLElement))return;const w=FD(O);w&&O.contains(w)&&O.removeChild(w);const _=cl(O);_&&_.classList.remove(d);const S=ll(O);S&&S.classList.remove(h)}),i.current=p):i.current=null,c.current||l||o)return;const y=m instanceof HTMLElement?al(m):[],g=al(e.current);if(g?.every(C=>C instanceof HTMLElement)&&y&&y.every(C=>C instanceof HTMLElement)){c.current=!0,e.current.style.isolation="isolate";const C=RD(e.current);C&&(C.style.zIndex="1"),g.forEach((O,w)=>{const _=y[w];if(!_)return;O.style.position="relative",O.style.overflow="hidden";const S=cl(O);S&&S.classList.add(d);const I=ll(O);I&&I.classList.add(h);const v=()=>{c.current=!1,e.current&&(e.current.style.isolation=""),C&&(C.style.zIndex=""),S&&S.classList.remove(d),I&&I.classList.remove(h),O.style.position="",O.style.overflow="",O.contains(_)&&O.removeChild(_)};_.style.pointerEvents="none",_.style.position="absolute",_.style.overflow="hidden",_.setAttribute("aria-hidden","true");const x=WD(_);x&&(x.style.opacity="0");const P=cl(_);P&&(P.classList.add(f?n[Xt.caption_before_exit]:n[Xt.caption_after_exit]),P.addEventListener("animationend",v));const A=ll(_);A&&A.classList.add(f?n[Xt.weeks_before_exit]:n[Xt.weeks_after_exit]),O.insertBefore(_,O.firstChild)})}})}function LD(e,t,n,r){const o=e[0],s=e[e.length-1],{ISOWeek:i,fixedWeeks:a,broadcastCalendar:c}=n??{},{addDays:u,differenceInCalendarDays:l,differenceInCalendarMonths:f,endOfBroadcastWeek:d,endOfISOWeek:h,endOfMonth:m,endOfWeek:p,isAfter:y,startOfBroadcastWeek:g,startOfISOWeek:C,startOfWeek:O}=r,w=c?g(o,r):i?C(o):O(o),_=c?d(s):i?h(m(s)):p(m(s)),S=t&&(c?d(t):i?h(t):p(t)),I=S&&y(_,S)?S:_,v=l(I,w),x=f(s,o)+1,P=[];for(let F=0;F<=v;F++){const N=u(w,F);P.push(N)}const M=(c?35:42)*x;if(a&&P.length<M){const F=M-P.length;for(let N=0;N<F;N++){const W=u(P[P.length-1],1);P.push(W)}}return P}function $D(e){const t=[];return e.reduce((n,r)=>{const o=r.weeks.reduce((s,i)=>s.concat(i.days.slice()),t.slice());return n.concat(o.slice())},t.slice())}function UD(e,t,n,r){const{numberOfMonths:o=1}=n,s=[];for(let i=0;i<o;i++){const a=r.addMonths(e,i);if(t&&a>t)break;s.push(a)}return s}function Wm(e,t,n,r){const{month:o,defaultMonth:s,today:i=r.today(),numberOfMonths:a=1}=e;let c=o||s||i;const{differenceInCalendarMonths:u,addMonths:l,startOfMonth:f}=r;if(n&&u(n,c)<a-1){const d=-1*(a-1);c=l(n,d)}return t&&u(c,t)<0&&(c=t),f(c)}function YD(e,t,n,r){const{addDays:o,endOfBroadcastWeek:s,endOfISOWeek:i,endOfMonth:a,endOfWeek:c,getISOWeek:u,getWeek:l,startOfBroadcastWeek:f,startOfISOWeek:d,startOfWeek:h}=r,m=e.reduce((p,y)=>{const g=n.broadcastCalendar?f(y,r):n.ISOWeek?d(y):h(y),C=n.broadcastCalendar?s(y):n.ISOWeek?i(a(y)):c(a(y)),O=t.filter(I=>I>=g&&I<=C),w=n.broadcastCalendar?35:42;if(n.fixedWeeks&&O.length<w){const I=t.filter(v=>{const x=w-O.length;return v>C&&v<=o(C,x)});O.push(...I)}const _=O.reduce((I,v)=>{const x=n.ISOWeek?u(v):l(v),P=I.find(M=>M.weekNumber===x),A=new Sm(v,y,r);return P?P.days.push(A):I.push(new LT(x,[A])),I},[]),S=new zT(y,_);return p.push(S),p},[]);return n.reverseMonths?m.reverse():m}function jD(e,t){let{startMonth:n,endMonth:r}=e;const{startOfYear:o,startOfDay:s,startOfMonth:i,endOfMonth:a,addYears:c,endOfYear:u,newDate:l,today:f}=t,{fromYear:d,toYear:h,fromMonth:m,toMonth:p}=e;!n&&m&&(n=m),!n&&d&&(n=t.newDate(d,0,1)),!r&&p&&(r=p),!r&&h&&(r=l(h,11,31));const y=e.captionLayout==="dropdown"||e.captionLayout==="dropdown-years";return n?n=i(n):d?n=l(d,0,1):!n&&y&&(n=o(c(e.today??f(),-100))),r?r=a(r):h?r=l(h,11,31):!r&&y&&(r=u(e.today??f())),[n&&s(n),r&&s(r)]}function VD(e,t,n,r){if(n.disableNavigation)return;const{pagedNavigation:o,numberOfMonths:s=1}=n,{startOfMonth:i,addMonths:a,differenceInCalendarMonths:c}=r,u=o?s:1,l=i(e);if(!t)return a(l,u);if(!(c(t,e)<s))return a(l,u)}function BD(e,t,n,r){if(n.disableNavigation)return;const{pagedNavigation:o,numberOfMonths:s}=n,{startOfMonth:i,addMonths:a,differenceInCalendarMonths:c}=r,u=o?s??1:1,l=i(e);if(!t)return a(l,-u);if(!(c(l,t)<=0))return a(l,-u)}function HD(e){const t=[];return e.reduce((n,r)=>n.concat(r.weeks.slice()),t.slice())}function Ai(e,t){const[n,r]=j.useState(e);return[t===void 0?n:t,r]}function ZD(e,t){const[n,r]=jD(e,t),{startOfMonth:o,endOfMonth:s}=t,i=Wm(e,n,r,t),[a,c]=Ai(i,e.month?i:void 0);j.useEffect(()=>{const w=Wm(e,n,r,t);c(w)},[e.timeZone]);const{months:u,weeks:l,days:f,previousMonth:d,nextMonth:h}=j.useMemo(()=>{const w=UD(a,r,{numberOfMonths:e.numberOfMonths},t),_=LD(w,e.endMonth?s(e.endMonth):void 0,{ISOWeek:e.ISOWeek,fixedWeeks:e.fixedWeeks,broadcastCalendar:e.broadcastCalendar},t),S=YD(w,_,{broadcastCalendar:e.broadcastCalendar,fixedWeeks:e.fixedWeeks,ISOWeek:e.ISOWeek,reverseMonths:e.reverseMonths},t),I=HD(S),v=$D(S),x=BD(a,n,e,t),P=VD(a,r,e,t);return{months:S,weeks:I,days:v,previousMonth:x,nextMonth:P}},[t,a.getTime(),r?.getTime(),n?.getTime(),e.disableNavigation,e.broadcastCalendar,e.endMonth?.getTime(),e.fixedWeeks,e.ISOWeek,e.numberOfMonths,e.pagedNavigation,e.reverseMonths]),{disableNavigation:m,onMonthChange:p}=e,y=w=>l.some(_=>_.days.some(S=>S.isEqualTo(w))),g=w=>{if(m)return;let _=o(w);n&&_<o(n)&&(_=o(n)),r&&_>o(r)&&(_=o(r)),c(_),p?.(_)};return{months:u,weeks:l,days:f,navStart:n,navEnd:r,previousMonth:d,nextMonth:h,goToMonth:g,goToDay:w=>{y(w)||g(w.date)}}}var Rn;(function(e){e[e.Today=0]="Today",e[e.Selected=1]="Selected",e[e.LastFocused=2]="LastFocused",e[e.FocusedModifier=3]="FocusedModifier"})(Rn||(Rn={}));function zm(e){return!e[ut.disabled]&&!e[ut.hidden]&&!e[ut.outside]}function GD(e,t,n,r){let o,s=-1;for(const i of e){const a=t(i);zm(a)&&(a[ut.focused]&&s<Rn.FocusedModifier?(o=i,s=Rn.FocusedModifier):r?.isEqualTo(i)&&s<Rn.LastFocused?(o=i,s=Rn.LastFocused):n(i.date)&&s<Rn.Selected?(o=i,s=Rn.Selected):a[ut.today]&&s<Rn.Today&&(o=i,s=Rn.Today))}return o||(o=e.find(i=>zm(t(i)))),o}function qD(e,t,n,r,o,s,i){const{ISOWeek:a,broadcastCalendar:c}=s,{addDays:u,addMonths:l,addWeeks:f,addYears:d,endOfBroadcastWeek:h,endOfISOWeek:m,endOfWeek:p,max:y,min:g,startOfBroadcastWeek:C,startOfISOWeek:O,startOfWeek:w}=i;let S={day:u,week:f,month:l,year:d,startOfWeek:I=>c?C(I,i):a?O(I):w(I),endOfWeek:I=>c?h(I):a?m(I):p(I)}[e](n,t==="after"?1:-1);return t==="before"&&r?S=y([r,S]):t==="after"&&o&&(S=g([o,S])),S}function Lm(e,t,n,r,o,s,i,a=0){if(a>365)return;const c=qD(e,t,n.date,r,o,s,i),u=!!(s.disabled&&er(c,s.disabled,i)),l=!!(s.hidden&&er(c,s.hidden,i)),f=c,d=new Sm(c,f,i);return!u&&!l?d:Lm(e,t,d,r,o,s,i,a+1)}function KD(e,t,n,r,o){const{autoFocus:s}=e,[i,a]=j.useState(),c=GD(t.days,n,r||(()=>!1),i),[u,l]=j.useState(s?c:void 0);return{isFocusTarget:p=>!!c?.isEqualTo(p),setFocused:l,focused:u,blur:()=>{a(u),l(void 0)},moveFocus:(p,y)=>{if(!u)return;const g=Lm(p,y,u,t.navStart,t.navEnd,e,o);g&&(e.disableNavigation&&!t.days.some(O=>O.isEqualTo(g))||(t.goToDay(g),l(g)))}}}function XD(e,t){const{selected:n,required:r,onSelect:o}=e,[s,i]=Ai(n,o?n:void 0),a=o?n:s,{isSameDay:c}=t,u=h=>a?.some(m=>c(m,h))??!1,{min:l,max:f}=e;return{selected:a,select:(h,m,p)=>{let y=[...a??[]];if(u(h)){if(a?.length===l||r&&a?.length===1)return;y=a?.filter(g=>!c(g,h))}else a?.length===f?y=[h]:y=[...y,h];return o||i(y),o?.(y,h,m,p),y},isSelected:u}}function JD(e,t,n=0,r=0,o=!1,s=Fn){const{from:i,to:a}=t||{},{isSameDay:c,isAfter:u,isBefore:l}=s;let f;if(!i&&!a)f={from:e,to:n>0?void 0:e};else if(i&&!a)c(i,e)?n===0?f={from:i,to:e}:o?f={from:i,to:void 0}:f=void 0:l(e,i)?f={from:e,to:i}:f={from:i,to:e};else if(i&&a)if(c(i,e)&&c(a,e))o?f={from:i,to:a}:f=void 0;else if(c(i,e))f={from:i,to:n>0?void 0:e};else if(c(a,e))f={from:e,to:n>0?void 0:e};else if(l(e,i))f={from:e,to:a};else if(u(e,i))f={from:i,to:e};else if(u(e,a))f={from:i,to:e};else throw new Error("Invalid range");if(f?.from&&f?.to){const d=s.differenceInCalendarDays(f.to,f.from);r>0&&d>r?f={from:e,to:void 0}:n>1&&d<n&&(f={from:e,to:void 0})}return f}function QD(e,t,n=Fn){const r=Array.isArray(t)?t:[t];let o=e.from;const s=n.differenceInCalendarDays(e.to,e.from),i=Math.min(s,6);for(let a=0;a<=i;a++){if(r.includes(o.getDay()))return!0;o=n.addDays(o,1)}return!1}function $m(e,t,n=Fn){return Qn(e,t.from,!1,n)||Qn(e,t.to,!1,n)||Qn(t,e.from,!1,n)||Qn(t,e.to,!1,n)}function eA(e,t,n=Fn){const r=Array.isArray(t)?t:[t];if(r.filter(a=>typeof a!="function").some(a=>typeof a=="boolean"?a:n.isDate(a)?Qn(e,a,!1,n):Om(a,n)?a.some(c=>Qn(e,c,!1,n)):Di(a)?a.from&&a.to?$m(e,{from:a.from,to:a.to},n):!1:xm(a)?QD(e,a.dayOfWeek,n):tl(a)?n.isAfter(a.before,a.after)?$m(e,{from:n.addDays(a.after,1),to:n.addDays(a.before,-1)},n):er(e.from,a,n)||er(e.to,a,n):nl(a)||rl(a)?er(e.from,a,n)||er(e.to,a,n):!1))return!0;const i=r.filter(a=>typeof a=="function");if(i.length){let a=e.from;const c=n.differenceInCalendarDays(e.to,e.from);for(let u=0;u<=c;u++){if(i.some(l=>l(a)))return!0;a=n.addDays(a,1)}}return!1}function tA(e,t){const{disabled:n,excludeDisabled:r,selected:o,required:s,onSelect:i}=e,[a,c]=Ai(o,i?o:void 0),u=i?o:a;return{selected:u,select:(d,h,m)=>{const{min:p,max:y}=e,g=d?JD(d,u,p,y,s,t):void 0;return r&&n&&g?.from&&g.to&&eA({from:g.from,to:g.to},n,t)&&(g.from=d,g.to=void 0),i||c(g),i?.(g,d,h,m),g},isSelected:d=>u&&Qn(u,d,!1,t)}}function nA(e,t){const{selected:n,required:r,onSelect:o}=e,[s,i]=Ai(n,o?n:void 0),a=o?n:s,{isSameDay:c}=t;return{selected:a,select:(f,d,h)=>{let m=f;return!r&&a&&a&&c(f,a)&&(m=void 0),o||i(m),o?.(m,f,d,h),m},isSelected:f=>a?c(a,f):!1}}function rA(e,t){const n=nA(e,t),r=XD(e,t),o=tA(e,t);switch(e.mode){case"single":return n;case"multiple":return r;case"range":return o;default:return}}function rn(e,t){return e instanceof Mt&&e.timeZone===t?e:new Mt(e,t)}function bo(e,t,n){return rn(e,t)}function Um(e,t,n){return typeof e=="boolean"||typeof e=="function"?e:e instanceof Date?bo(e,t):Array.isArray(e)?e.map(r=>r instanceof Date?bo(r,t):r):Di(e)?{...e,from:e.from?rn(e.from,t):e.from,to:e.to?rn(e.to,t):e.to}:tl(e)?{before:bo(e.before,t),after:bo(e.after,t)}:nl(e)?{after:bo(e.after,t)}:rl(e)?{before:bo(e.before,t)}:e}function ul(e,t,n){return e&&(Array.isArray(e)?e.map(r=>Um(r,t)):Um(e,t))}function oA(e){let t=e;const n=t.timeZone;if(n&&(t={...e,timeZone:n},t.today&&(t.today=rn(t.today,n)),t.month&&(t.month=rn(t.month,n)),t.defaultMonth&&(t.defaultMonth=rn(t.defaultMonth,n)),t.startMonth&&(t.startMonth=rn(t.startMonth,n)),t.endMonth&&(t.endMonth=rn(t.endMonth,n)),t.mode==="single"&&t.selected?t.selected=rn(t.selected,n):t.mode==="multiple"&&t.selected?t.selected=t.selected?.map(_e=>rn(_e,n)):t.mode==="range"&&t.selected&&(t.selected={from:t.selected.from?rn(t.selected.from,n):t.selected.from,to:t.selected.to?rn(t.selected.to,n):t.selected.to}),t.disabled!==void 0&&(t.disabled=ul(t.disabled,n)),t.hidden!==void 0&&(t.hidden=ul(t.hidden,n)),t.modifiers)){const _e={};Object.keys(t.modifiers).forEach(De=>{_e[De]=ul(t.modifiers?.[De],n)}),t.modifiers=_e}const{components:r,formatters:o,labels:s,dateLib:i,locale:a,classNames:c}=j.useMemo(()=>{const _e={..._m,...t.locale},De=t.broadcastCalendar?1:t.weekStartsOn,ve=t.noonSafe&&t.timeZone?ID(t.timeZone,{weekStartsOn:De,locale:_e}):void 0,Ee=t.dateLib&&ve?{...ve,...t.dateLib}:t.dateLib??ve,Xe=new Kt({locale:_e,weekStartsOn:De,firstWeekContainsDate:t.firstWeekContainsDate,useAdditionalWeekYearTokens:t.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:t.useAdditionalDayOfYearTokens,timeZone:t.timeZone,numerals:t.numerals},Ee);return{dateLib:Xe,components:mD(t.components),formatters:xD(t.formatters),labels:DD(t.labels,Xe.options),locale:_e,classNames:{...ol(),...t.classNames}}},[t.locale,t.broadcastCalendar,t.weekStartsOn,t.firstWeekContainsDate,t.useAdditionalWeekYearTokens,t.useAdditionalDayOfYearTokens,t.timeZone,t.numerals,t.dateLib,t.noonSafe,t.components,t.formatters,t.labels,t.classNames]);t.today||(t={...t,today:i.today()});const{captionLayout:u,mode:l,navLayout:f,numberOfMonths:d=1,onDayBlur:h,onDayClick:m,onDayFocus:p,onDayKeyDown:y,onDayMouseEnter:g,onDayMouseLeave:C,onNextClick:O,onPrevClick:w,showWeekNumber:_,styles:S}=t,{formatCaption:I,formatDay:v,formatMonthDropdown:x,formatWeekNumber:P,formatWeekNumberHeader:A,formatWeekdayName:M,formatYearDropdown:F}=o,N=ZD(t,i),{days:W,months:E,navStart:k,navEnd:U,previousMonth:$,nextMonth:D,goToMonth:V}=N,Z=hD(W,t,k,U,i),{isSelected:G,select:B,selected:z}=rA(t,i)??{},{blur:X,focused:q,isFocusTarget:oe,moveFocus:Q,setFocused:re}=KD(t,N,Z,G??(()=>!1),i),{labelDayButton:le,labelGridcell:K,labelGrid:Se,labelMonthDropdown:Ie,labelNav:ke,labelPrevious:Ge,labelNext:Re,labelWeekday:We,labelWeekNumber:nt,labelWeekNumberHeader:rt,labelYearDropdown:R}=s,Y=j.useMemo(()=>PD(i,t.ISOWeek,t.broadcastCalendar,t.today),[i,t.ISOWeek,t.broadcastCalendar,t.today]),H=l!==void 0||m!==void 0,ee=j.useCallback(()=>{$&&(V($),w?.($))},[$,V,w]),te=j.useCallback(()=>{D&&(V(D),O?.(D))},[V,D,O]),ne=j.useCallback((_e,De)=>ve=>{ve.preventDefault(),ve.stopPropagation(),re(_e),!De.disabled&&(B?.(_e.date,De,ve),m?.(_e.date,De,ve))},[B,m,re]),ue=j.useCallback((_e,De)=>ve=>{re(_e),p?.(_e.date,De,ve)},[p,re]),be=j.useCallback((_e,De)=>ve=>{X(),h?.(_e.date,De,ve)},[X,h]),Oe=j.useCallback((_e,De)=>ve=>{const Ee={ArrowLeft:[ve.shiftKey?"month":"day",t.dir==="rtl"?"after":"before"],ArrowRight:[ve.shiftKey?"month":"day",t.dir==="rtl"?"before":"after"],ArrowDown:[ve.shiftKey?"year":"week","after"],ArrowUp:[ve.shiftKey?"year":"week","before"],PageUp:[ve.shiftKey?"year":"month","before"],PageDown:[ve.shiftKey?"year":"month","after"],Home:["startOfWeek","before"],End:["endOfWeek","after"]};if(Ee[ve.key]){ve.preventDefault(),ve.stopPropagation();const[Xe,xe]=Ee[ve.key];Q(Xe,xe)}y?.(_e.date,De,ve)},[Q,y,t.dir]),ze=j.useCallback((_e,De)=>ve=>{g?.(_e.date,De,ve)},[g]),ot=j.useCallback((_e,De)=>ve=>{C?.(_e.date,De,ve)},[C]),Qe=j.useCallback(_e=>De=>{const ve=Number(De.target.value),Ee=i.setMonth(i.startOfMonth(_e),ve);V(Ee)},[i,V]),xt=j.useCallback(_e=>De=>{const ve=Number(De.target.value),Ee=i.setYear(i.startOfMonth(_e),ve);V(Ee)},[i,V]),{className:gt,style:dt}=j.useMemo(()=>({className:[c[me.Root],t.className].filter(Boolean).join(" "),style:{...S?.[me.Root],...t.style}}),[c,t.className,t.style,S]),jt=gD(t),Sn=j.useRef(null);zD(Sn,!!t.animate,{classNames:c,months:E,focused:q,dateLib:i});const kn={dayPickerProps:t,selected:z,select:B,isSelected:G,months:E,nextMonth:D,previousMonth:$,goToMonth:V,getModifiers:Z,components:r,classNames:c,styles:S,labels:s,formatters:o};return j.createElement(km.Provider,{value:kn},j.createElement(r.Root,{rootRef:t.animate?Sn:void 0,className:gt,style:dt,dir:t.dir,id:t.id,lang:t.lang,nonce:t.nonce,title:t.title,role:t.role,"aria-label":t["aria-label"],"aria-labelledby":t["aria-labelledby"],...jt},j.createElement(r.Months,{className:c[me.Months],style:S?.[me.Months]},!t.hideNavigation&&!f&&j.createElement(r.Nav,{"data-animated-nav":t.animate?"true":void 0,className:c[me.Nav],style:S?.[me.Nav],"aria-label":ke(),onPreviousClick:ee,onNextClick:te,previousMonth:$,nextMonth:D}),E.map((_e,De)=>j.createElement(r.Month,{"data-animated-month":t.animate?"true":void 0,className:c[me.Month],style:S?.[me.Month],key:De,displayIndex:De,calendarMonth:_e},f==="around"&&!t.hideNavigation&&De===0&&j.createElement(r.PreviousMonthButton,{type:"button",className:c[me.PreviousMonthButton],tabIndex:$?void 0:-1,"aria-disabled":$?void 0:!0,"aria-label":Ge($),onClick:ee,"data-animated-button":t.animate?"true":void 0},j.createElement(r.Chevron,{disabled:$?void 0:!0,className:c[me.Chevron],orientation:t.dir==="rtl"?"right":"left"})),j.createElement(r.MonthCaption,{"data-animated-caption":t.animate?"true":void 0,className:c[me.MonthCaption],style:S?.[me.MonthCaption],calendarMonth:_e,displayIndex:De},u?.startsWith("dropdown")?j.createElement(r.DropdownNav,{className:c[me.Dropdowns],style:S?.[me.Dropdowns]},(()=>{const ve=u==="dropdown"||u==="dropdown-months"?j.createElement(r.MonthsDropdown,{key:"month",className:c[me.MonthsDropdown],"aria-label":Ie(),classNames:c,components:r,disabled:!!t.disableNavigation,onChange:Qe(_e.date),options:AD(_e.date,k,U,o,i),style:S?.[me.Dropdown],value:i.getMonth(_e.date)}):j.createElement("span",{key:"month"},x(_e.date,i)),Ee=u==="dropdown"||u==="dropdown-years"?j.createElement(r.YearsDropdown,{key:"year",className:c[me.YearsDropdown],"aria-label":R(i.options),classNames:c,components:r,disabled:!!t.disableNavigation,onChange:xt(_e.date),options:ND(k,U,o,i,!!t.reverseYears),style:S?.[me.Dropdown],value:i.getYear(_e.date)}):j.createElement("span",{key:"year"},F(_e.date,i));return i.getMonthYearOrder()==="year-first"?[Ee,ve]:[ve,Ee]})(),j.createElement("span",{role:"status","aria-live":"polite",style:{border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"}},I(_e.date,i.options,i))):j.createElement(r.CaptionLabel,{className:c[me.CaptionLabel],role:"status","aria-live":"polite"},I(_e.date,i.options,i))),f==="around"&&!t.hideNavigation&&De===d-1&&j.createElement(r.NextMonthButton,{type:"button",className:c[me.NextMonthButton],tabIndex:D?void 0:-1,"aria-disabled":D?void 0:!0,"aria-label":Re(D),onClick:te,"data-animated-button":t.animate?"true":void 0},j.createElement(r.Chevron,{disabled:D?void 0:!0,className:c[me.Chevron],orientation:t.dir==="rtl"?"left":"right"})),De===d-1&&f==="after"&&!t.hideNavigation&&j.createElement(r.Nav,{"data-animated-nav":t.animate?"true":void 0,className:c[me.Nav],style:S?.[me.Nav],"aria-label":ke(),onPreviousClick:ee,onNextClick:te,previousMonth:$,nextMonth:D}),j.createElement(r.MonthGrid,{role:"grid","aria-multiselectable":l==="multiple"||l==="range","aria-label":Se(_e.date,i.options,i)||void 0,className:c[me.MonthGrid],style:S?.[me.MonthGrid]},!t.hideWeekdays&&j.createElement(r.Weekdays,{"data-animated-weekdays":t.animate?"true":void 0,className:c[me.Weekdays],style:S?.[me.Weekdays]},_&&j.createElement(r.WeekNumberHeader,{"aria-label":rt(i.options),className:c[me.WeekNumberHeader],style:S?.[me.WeekNumberHeader],scope:"col"},A()),Y.map(ve=>j.createElement(r.Weekday,{"aria-label":We(ve,i.options,i),className:c[me.Weekday],key:String(ve),style:S?.[me.Weekday],scope:"col"},M(ve,i.options,i)))),j.createElement(r.Weeks,{"data-animated-weeks":t.animate?"true":void 0,className:c[me.Weeks],style:S?.[me.Weeks]},_e.weeks.map(ve=>j.createElement(r.Week,{className:c[me.Week],key:ve.weekNumber,style:S?.[me.Week],week:ve},_&&j.createElement(r.WeekNumber,{week:ve,style:S?.[me.WeekNumber],"aria-label":nt(ve.weekNumber,{locale:a}),className:c[me.WeekNumber],scope:"row",role:"rowheader"},P(ve.weekNumber,i)),ve.days.map(Ee=>{const{date:Xe}=Ee,xe=Z(Ee);if(xe[ut.focused]=!xe.hidden&&!!q?.isEqualTo(Ee),xe[vn.selected]=G?.(Xe)||xe.selected,Di(z)){const{from:Qt,to:Oo}=z;xe[vn.range_start]=!!(Qt&&Oo&&i.isSameDay(Xe,Qt)),xe[vn.range_end]=!!(Qt&&Oo&&i.isSameDay(Xe,Oo)),xe[vn.range_middle]=Qn(z,Xe,!0,i)}const tr=MD(xe,S,t.modifiersStyles),ct=pD(xe,c,t.modifiersClassNames),Pt=!H&&!xe.hidden?K(Xe,xe,i.options,i):void 0;return j.createElement(r.Day,{key:`${Ee.isoDate}_${Ee.displayMonthId}`,day:Ee,modifiers:xe,className:ct.join(" "),style:tr,role:"gridcell","aria-selected":xe.selected||void 0,"aria-label":Pt,"data-day":Ee.isoDate,"data-month":Ee.outside?Ee.dateMonthId:void 0,"data-selected":xe.selected||void 0,"data-disabled":xe.disabled||void 0,"data-hidden":xe.hidden||void 0,"data-outside":Ee.outside||void 0,"data-focused":xe.focused||void 0,"data-today":xe.today||void 0},!xe.hidden&&H?j.createElement(r.DayButton,{className:c[me.DayButton],style:S?.[me.DayButton],type:"button",day:Ee,modifiers:xe,disabled:!xe.focused&&xe.disabled||void 0,"aria-disabled":xe.focused&&xe.disabled||void 0,tabIndex:oe(Ee)?0:-1,"aria-label":le(Xe,xe,i.options,i),onClick:ne(Ee,xe),onBlur:be(Ee,xe),onFocus:ue(Ee,xe),onKeyDown:Oe(Ee,xe),onMouseEnter:ze(Ee,xe),onMouseLeave:ot(Ee,xe)},v(Xe,i.options,i)):!xe.hidden&&v(Ee.date,i.options,i))})))))))),t.footer&&j.createElement(r.Footer,{className:c[me.Footer],style:S?.[me.Footer],role:"status","aria-live":"polite"},t.footer)))}function sA({className:e,classNames:t,showOutsideDays:n=!0,captionLayout:r="label",buttonVariant:o="ghost",formatters:s,components:i,...a}){const c=ol();return T.jsx(oA,{showOutsideDays:n,className:Ae("bg-background group/calendar p-3 [--cell-size:2rem] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,e),captionLayout:r,formatters:{formatMonthDropdown:u=>u.toLocaleString("default",{month:"short"}),...s},classNames:{root:Ae("w-fit",c.root),months:Ae("relative flex flex-col gap-4 md:flex-row",c.months),month:Ae("flex w-full flex-col gap-4",c.month),nav:Ae("absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1",c.nav),button_previous:Ae(qc({variant:o}),"h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50",c.button_previous),button_next:Ae(qc({variant:o}),"h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50",c.button_next),month_caption:Ae("flex h-[--cell-size] w-full items-center justify-center px-[--cell-size]",c.month_caption),dropdowns:Ae("flex h-[--cell-size] w-full items-center justify-center gap-1.5 text-sm font-medium",c.dropdowns),dropdown_root:Ae("has-focus:border-ring border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] relative rounded-md border",c.dropdown_root),dropdown:Ae("bg-popover absolute inset-0 opacity-0",c.dropdown),caption_label:Ae("select-none font-medium",r==="label"?"text-sm":"[&>svg]:text-muted-foreground flex h-8 items-center gap-1 rounded-md pl-2 pr-1 text-sm [&>svg]:size-3.5",c.caption_label),table:"w-full border-collapse",weekdays:Ae("flex",c.weekdays),weekday:Ae("text-muted-foreground flex-1 select-none rounded-md text-[0.8rem] font-normal",c.weekday),week:Ae("mt-2 flex w-full",c.week),week_number_header:Ae("w-[--cell-size] select-none",c.week_number_header),week_number:Ae("text-muted-foreground select-none text-[0.8rem]",c.week_number),day:Ae("group/day relative aspect-square h-full w-full select-none p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md",c.day),range_start:Ae("bg-accent rounded-l-md",c.range_start),range_middle:Ae("rounded-none",c.range_middle),range_end:Ae("bg-accent rounded-r-md",c.range_end),today:Ae("bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",c.today),outside:Ae("text-muted-foreground aria-selected:text-muted-foreground",c.outside),disabled:Ae("text-muted-foreground opacity-50",c.disabled),hidden:Ae("invisible",c.hidden),...t},components:{Root:({className:u,rootRef:l,...f})=>T.jsx("div",{"data-slot":"calendar",ref:l,className:Ae(u),...f}),Chevron:({className:u,orientation:l,...f})=>l==="left"?T.jsx(E_,{className:Ae("size-4",u),...f}):l==="right"?T.jsx(C_,{className:Ae("size-4",u),...f}):T.jsx(Ia,{className:Ae("size-4",u),...f}),DayButton:iA,WeekNumber:({children:u,...l})=>T.jsx("td",{...l,children:T.jsx("div",{className:"flex size-[--cell-size] items-center justify-center text-center",children:u})}),...i},...a})}function iA({className:e,day:t,modifiers:n,...r}){const o=ol(),s=b.useRef(null);return b.useEffect(()=>{n.focused&&s.current?.focus()},[n.focused]),T.jsx(po,{ref:s,variant:"ghost",size:"icon","data-day":t.date.toLocaleDateString(),"data-selected-single":n.selected&&!n.range_start&&!n.range_end&&!n.range_middle,"data-range-start":n.range_start,"data-range-end":n.range_end,"data-range-middle":n.range_middle,className:Ae("data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 flex aspect-square h-auto w-full min-w-[--cell-size] flex-col gap-1 font-normal leading-none data-[range-end=true]:rounded-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] [&>span]:text-xs [&>span]:opacity-70",o.day,e),...r})}function aA(e){const t=cA(e),n=b.forwardRef((r,o)=>{const{children:s,...i}=r,a=b.Children.toArray(s),c=a.find(uA);if(c){const u=c.props.children,l=a.map(f=>f===c?b.Children.count(u)>1?b.Children.only(null):b.isValidElement(u)?u.props.children:null:f);return T.jsx(t,{...i,ref:o,children:b.isValidElement(u)?b.cloneElement(u,void 0,l):null})}return T.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function cA(e){const t=b.forwardRef((n,r)=>{const{children:o,...s}=n;if(b.isValidElement(o)){const i=dA(o),a=fA(s,o.props);return o.type!==b.Fragment&&(a.ref=r?Or(r,i):i),b.cloneElement(o,a)}return b.Children.count(o)>1?b.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var lA=Symbol("radix.slottable");function uA(e){return b.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===lA}function fA(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{const c=s(...a);return o(...a),c}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function dA(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Mi="Popover",[Ym]=Un(Mi,[Ys]),ns=Ys(),[hA,_r]=Ym(Mi),jm=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:i=!1}=e,a=ns(t),c=b.useRef(null),[u,l]=b.useState(!1),[f,d]=Dr({prop:r,defaultProp:o??!1,onChange:s,caller:Mi});return T.jsx(Qd,{...a,children:T.jsx(hA,{scope:t,contentId:ar(),triggerRef:c,open:f,onOpenChange:d,onOpenToggle:b.useCallback(()=>d(h=>!h),[d]),hasCustomAnchor:u,onCustomAnchorAdd:b.useCallback(()=>l(!0),[]),onCustomAnchorRemove:b.useCallback(()=>l(!1),[]),modal:i,children:n})})};jm.displayName=Mi;var Vm="PopoverAnchor",pA=b.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=_r(Vm,n),s=ns(n),{onCustomAnchorAdd:i,onCustomAnchorRemove:a}=o;return b.useEffect(()=>(i(),()=>a()),[i,a]),T.jsx(ec,{...s,...r,ref:t})});pA.displayName=Vm;var Bm="PopoverTrigger",Hm=b.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=_r(Bm,n),s=ns(n),i=Ve(t,o.triggerRef),a=T.jsx(Ne.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Xm(o.open),...r,ref:i,onClick:Ce(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?a:T.jsx(ec,{asChild:!0,...s,children:a})});Hm.displayName=Bm;var fl="PopoverPortal",[mA,gA]=Ym(fl,{forceMount:void 0}),Zm=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,s=_r(fl,t);return T.jsx(mA,{scope:t,forceMount:n,children:T.jsx(lr,{present:n||s.open,children:T.jsx(js,{asChild:!0,container:o,children:r})})})};Zm.displayName=fl;var wo="PopoverContent",Gm=b.forwardRef((e,t)=>{const n=gA(wo,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,s=_r(wo,e.__scopePopover);return T.jsx(lr,{present:r||s.open,children:s.modal?T.jsx(vA,{...o,ref:t}):T.jsx(bA,{...o,ref:t})})});Gm.displayName=wo;var yA=aA("PopoverContent.RemoveScroll"),vA=b.forwardRef((e,t)=>{const n=_r(wo,e.__scopePopover),r=b.useRef(null),o=Ve(t,r),s=b.useRef(!1);return b.useEffect(()=>{const i=r.current;if(i)return nc(i)},[]),T.jsx(Xs,{as:yA,allowPinchZoom:!0,children:T.jsx(qm,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ce(e.onCloseAutoFocus,i=>{i.preventDefault(),s.current||n.triggerRef.current?.focus()}),onPointerDownOutside:Ce(e.onPointerDownOutside,i=>{const a=i.detail.originalEvent,c=a.button===0&&a.ctrlKey===!0,u=a.button===2||c;s.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:Ce(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1})})})}),bA=b.forwardRef((e,t)=>{const n=_r(wo,e.__scopePopover),r=b.useRef(!1),o=b.useRef(!1);return T.jsx(qm,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{e.onCloseAutoFocus?.(s),s.defaultPrevented||(r.current||n.triggerRef.current?.focus(),s.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:s=>{e.onInteractOutside?.(s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const i=s.target;n.triggerRef.current?.contains(i)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),qm=b.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:i,onEscapeKeyDown:a,onPointerDownOutside:c,onFocusOutside:u,onInteractOutside:l,...f}=e,d=_r(wo,n),h=ns(n);return za(),T.jsx(Ms,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:s,children:T.jsx(As,{asChild:!0,disableOutsidePointerEvents:i,onInteractOutside:l,onEscapeKeyDown:a,onPointerDownOutside:c,onFocusOutside:u,onDismiss:()=>d.onOpenChange(!1),children:T.jsx(eh,{"data-state":Xm(d.open),role:"dialog",id:d.contentId,...h,...f,ref:t,style:{...f.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),Km="PopoverClose",wA=b.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=_r(Km,n);return T.jsx(Ne.button,{type:"button",...r,ref:t,onClick:Ce(e.onClick,()=>o.onOpenChange(!1))})});wA.displayName=Km;var _A="PopoverArrow",SA=b.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=ns(n);return T.jsx(th,{...o,...r,ref:t})});SA.displayName=_A;function Xm(e){return e?"open":"closed"}var kA=jm,xA=Hm,OA=Zm,Jm=Gm;const EA=kA,CA=xA,Qm=b.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},o)=>T.jsx(OA,{children:T.jsx(Jm,{ref:o,align:t,sideOffset:n,className:Ae("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-popover-content-transform-origin]",e),...r})}));Qm.displayName=Jm.displayName;const TA=(e={})=>{const{field:t={},form:n={},question:r={},disabled:o=!1}=e,s=t.value||void 0,i=t.onChange,[a,c]=j.useState(!1),u=l=>{l&&(i(l),c(!1))};return T.jsxs(EA,{open:a,onOpenChange:c,children:[T.jsx(CA,{asChild:!0,children:T.jsx("div",{className:"block",children:T.jsxs(po,{...t,type:"button",variant:"outline",className:Ae("bq-date-picker-button w-full justify-start text-left font-normal border! border-input! focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",!t.value&&"text-muted-foreground",n.formState.errors[r.reference_id]&&"border-destructive"),disabled:o,children:[T.jsx(O_,{className:"mr-2 h-4 w-4"}),t.value?ce(t.value).format("DD/MM/YYYY"):T.jsx("span",{children:r.placeholder||"Pick a date"})]})})}),T.jsx(Qm,{className:"bq-date-picker-popover w-auto overflow-hidden p-0",align:"center",children:T.jsx(sA,{className:"w-56",mode:"single",selected:s,defaultMonth:s,captionLayout:"dropdown",onSelect:l=>{u(l),c(!1)}})})]})};function DA(e){const t=AA(e),n=b.forwardRef((r,o)=>{const{children:s,...i}=r,a=b.Children.toArray(s),c=a.find(PA);if(c){const u=c.props.children,l=a.map(f=>f===c?b.Children.count(u)>1?b.Children.only(null):b.isValidElement(u)?u.props.children:null:f);return T.jsx(t,{...i,ref:o,children:b.isValidElement(u)?b.cloneElement(u,void 0,l):null})}return T.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function AA(e){const t=b.forwardRef((n,r)=>{const{children:o,...s}=n;if(b.isValidElement(o)){const i=IA(o),a=NA(s,o.props);return o.type!==b.Fragment&&(a.ref=r?Or(r,i):i),b.cloneElement(o,a)}return b.Children.count(o)>1?b.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var MA=Symbol("radix.slottable");function PA(e){return b.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===MA}function NA(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{const c=s(...a);return o(...a),c}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function IA(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Pi="Dialog",[eg]=Un(Pi),[FA,wn]=eg(Pi),tg=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:i=!0}=e,a=b.useRef(null),c=b.useRef(null),[u,l]=Dr({prop:r,defaultProp:o??!1,onChange:s,caller:Pi});return T.jsx(FA,{scope:t,triggerRef:a,contentRef:c,contentId:ar(),titleId:ar(),descriptionId:ar(),open:u,onOpenChange:l,onOpenToggle:b.useCallback(()=>l(f=>!f),[l]),modal:i,children:n})};tg.displayName=Pi;var ng="DialogTrigger",rg=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=wn(ng,n),s=Ve(t,o.triggerRef);return T.jsx(Ne.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":pl(o.open),...r,ref:s,onClick:Ce(e.onClick,o.onOpenToggle)})});rg.displayName=ng;var dl="DialogPortal",[RA,og]=eg(dl,{forceMount:void 0}),sg=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,s=wn(dl,t);return T.jsx(RA,{scope:t,forceMount:n,children:b.Children.map(r,i=>T.jsx(lr,{present:n||s.open,children:T.jsx(js,{asChild:!0,container:o,children:i})}))})};sg.displayName=dl;var Ni="DialogOverlay",ig=b.forwardRef((e,t)=>{const n=og(Ni,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=wn(Ni,e.__scopeDialog);return s.modal?T.jsx(lr,{present:r||s.open,children:T.jsx(zA,{...o,ref:t})}):null});ig.displayName=Ni;var WA=DA("DialogOverlay.RemoveScroll"),zA=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=wn(Ni,n);return T.jsx(Xs,{as:WA,allowPinchZoom:!0,shards:[o.contentRef],children:T.jsx(Ne.div,{"data-state":pl(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),$r="DialogContent",ag=b.forwardRef((e,t)=>{const n=og($r,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=wn($r,e.__scopeDialog);return T.jsx(lr,{present:r||s.open,children:s.modal?T.jsx(LA,{...o,ref:t}):T.jsx($A,{...o,ref:t})})});ag.displayName=$r;var LA=b.forwardRef((e,t)=>{const n=wn($r,e.__scopeDialog),r=b.useRef(null),o=Ve(t,n.contentRef,r);return b.useEffect(()=>{const s=r.current;if(s)return nc(s)},[]),T.jsx(cg,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ce(e.onCloseAutoFocus,s=>{s.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:Ce(e.onPointerDownOutside,s=>{const i=s.detail.originalEvent,a=i.button===0&&i.ctrlKey===!0;(i.button===2||a)&&s.preventDefault()}),onFocusOutside:Ce(e.onFocusOutside,s=>s.preventDefault())})}),$A=b.forwardRef((e,t)=>{const n=wn($r,e.__scopeDialog),r=b.useRef(!1),o=b.useRef(!1);return T.jsx(cg,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{e.onCloseAutoFocus?.(s),s.defaultPrevented||(r.current||n.triggerRef.current?.focus(),s.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:s=>{e.onInteractOutside?.(s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const i=s.target;n.triggerRef.current?.contains(i)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),cg=b.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:s,...i}=e,a=wn($r,n),c=b.useRef(null),u=Ve(t,c);return za(),T.jsxs(T.Fragment,{children:[T.jsx(Ms,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:s,children:T.jsx(As,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":pl(a.open),...i,ref:u,onDismiss:()=>a.onOpenChange(!1)})}),T.jsxs(T.Fragment,{children:[T.jsx(UA,{titleId:a.titleId}),T.jsx(jA,{contentRef:c,descriptionId:a.descriptionId})]})]})}),hl="DialogTitle",lg=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=wn(hl,n);return T.jsx(Ne.h2,{id:o.titleId,...r,ref:t})});lg.displayName=hl;var ug="DialogDescription",fg=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=wn(ug,n);return T.jsx(Ne.p,{id:o.descriptionId,...r,ref:t})});fg.displayName=ug;var dg="DialogClose",hg=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=wn(dg,n);return T.jsx(Ne.button,{type:"button",...r,ref:t,onClick:Ce(e.onClick,()=>o.onOpenChange(!1))})});hg.displayName=dg;function pl(e){return e?"open":"closed"}var pg="DialogTitleWarning",[_R,mg]=Ew(pg,{contentName:$r,titleName:hl,docsSlug:"dialog"}),UA=({titleId:e})=>{const t=mg(pg),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
64
+
65
+ If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
66
+
67
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return b.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},YA="DialogDescriptionWarning",jA=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${mg(YA).contentName}}.`;return b.useEffect(()=>{const o=e.current?.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},VA=tg,BA=rg,HA=sg,gg=ig,yg=ag,vg=lg,bg=fg,ZA=hg;const GA=VA,qA=BA,KA=HA,wg=b.forwardRef(({className:e,...t},n)=>T.jsx(gg,{ref:n,className:Ae("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));wg.displayName=gg.displayName;const _g=b.forwardRef(({className:e,children:t,...n},r)=>T.jsxs(KA,{children:[T.jsx(wg,{}),T.jsxs(yg,{ref:r,className:Ae("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...n,children:[t,T.jsxs(ZA,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[T.jsx(A_,{className:"h-4 w-4"}),T.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));_g.displayName=yg.displayName;const Sg=({className:e,...t})=>T.jsx("div",{className:Ae("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Sg.displayName="DialogHeader";const kg=({className:e,...t})=>T.jsx("div",{className:Ae("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});kg.displayName="DialogFooter";const xg=b.forwardRef(({className:e,...t},n)=>T.jsx(vg,{ref:n,className:Ae("text-lg font-semibold leading-none tracking-tight",e),...t}));xg.displayName=vg.displayName;const XA=b.forwardRef(({className:e,...t},n)=>T.jsx(bg,{ref:n,className:Ae("text-sm text-muted-foreground",e),...t}));XA.displayName=bg.displayName;function ml(){return ml=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ml.apply(null,arguments)}function JA(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function QA(e,t){if(e==null)return{};var n,r,o=JA(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function gl(e){"@babel/helpers - typeof";return gl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gl(e)}function eM(e,t,n){return Object.defineProperty(e,"prototype",{writable:!1}),e}function tM(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function yl(e,t){return yl=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},yl(e,t)}function nM(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&yl(e,t)}function Ii(e){return Ii=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ii(e)}function Og(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Og=function(){return!!e})()}function rM(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function oM(e,t){if(t&&(gl(t)=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return rM(e)}function sM(e){var t=Og();return function(){var n,r=Ii(e);if(t){var o=Ii(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return oM(this,n)}}var Fi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function vl(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ri={exports:{}},Wi={exports:{}},Ye={};var Eg;function iM(){if(Eg)return Ye;Eg=1;var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,s=e?Symbol.for("react.profiler"):60114,i=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,c=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,l=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,d=e?Symbol.for("react.suspense_list"):60120,h=e?Symbol.for("react.memo"):60115,m=e?Symbol.for("react.lazy"):60116,p=e?Symbol.for("react.block"):60121,y=e?Symbol.for("react.fundamental"):60117,g=e?Symbol.for("react.responder"):60118,C=e?Symbol.for("react.scope"):60119;function O(_){if(typeof _=="object"&&_!==null){var S=_.$$typeof;switch(S){case t:switch(_=_.type,_){case c:case u:case r:case s:case o:case f:return _;default:switch(_=_&&_.$$typeof,_){case a:case l:case m:case h:case i:return _;default:return S}}case n:return S}}}function w(_){return O(_)===u}return Ye.AsyncMode=c,Ye.ConcurrentMode=u,Ye.ContextConsumer=a,Ye.ContextProvider=i,Ye.Element=t,Ye.ForwardRef=l,Ye.Fragment=r,Ye.Lazy=m,Ye.Memo=h,Ye.Portal=n,Ye.Profiler=s,Ye.StrictMode=o,Ye.Suspense=f,Ye.isAsyncMode=function(_){return w(_)||O(_)===c},Ye.isConcurrentMode=w,Ye.isContextConsumer=function(_){return O(_)===a},Ye.isContextProvider=function(_){return O(_)===i},Ye.isElement=function(_){return typeof _=="object"&&_!==null&&_.$$typeof===t},Ye.isForwardRef=function(_){return O(_)===l},Ye.isFragment=function(_){return O(_)===r},Ye.isLazy=function(_){return O(_)===m},Ye.isMemo=function(_){return O(_)===h},Ye.isPortal=function(_){return O(_)===n},Ye.isProfiler=function(_){return O(_)===s},Ye.isStrictMode=function(_){return O(_)===o},Ye.isSuspense=function(_){return O(_)===f},Ye.isValidElementType=function(_){return typeof _=="string"||typeof _=="function"||_===r||_===u||_===s||_===o||_===f||_===d||typeof _=="object"&&_!==null&&(_.$$typeof===m||_.$$typeof===h||_.$$typeof===i||_.$$typeof===a||_.$$typeof===l||_.$$typeof===y||_.$$typeof===g||_.$$typeof===C||_.$$typeof===p)},Ye.typeOf=O,Ye}var je={};var Cg;function aM(){return Cg||(Cg=1,process.env.NODE_ENV!=="production"&&(function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,s=e?Symbol.for("react.profiler"):60114,i=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,c=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,l=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,d=e?Symbol.for("react.suspense_list"):60120,h=e?Symbol.for("react.memo"):60115,m=e?Symbol.for("react.lazy"):60116,p=e?Symbol.for("react.block"):60121,y=e?Symbol.for("react.fundamental"):60117,g=e?Symbol.for("react.responder"):60118,C=e?Symbol.for("react.scope"):60119;function O(K){return typeof K=="string"||typeof K=="function"||K===r||K===u||K===s||K===o||K===f||K===d||typeof K=="object"&&K!==null&&(K.$$typeof===m||K.$$typeof===h||K.$$typeof===i||K.$$typeof===a||K.$$typeof===l||K.$$typeof===y||K.$$typeof===g||K.$$typeof===C||K.$$typeof===p)}function w(K){if(typeof K=="object"&&K!==null){var Se=K.$$typeof;switch(Se){case t:var Ie=K.type;switch(Ie){case c:case u:case r:case s:case o:case f:return Ie;default:var ke=Ie&&Ie.$$typeof;switch(ke){case a:case l:case m:case h:case i:return ke;default:return Se}}case n:return Se}}}var _=c,S=u,I=a,v=i,x=t,P=l,A=r,M=m,F=h,N=n,W=s,E=o,k=f,U=!1;function $(K){return U||(U=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),D(K)||w(K)===c}function D(K){return w(K)===u}function V(K){return w(K)===a}function Z(K){return w(K)===i}function G(K){return typeof K=="object"&&K!==null&&K.$$typeof===t}function B(K){return w(K)===l}function z(K){return w(K)===r}function X(K){return w(K)===m}function q(K){return w(K)===h}function oe(K){return w(K)===n}function Q(K){return w(K)===s}function re(K){return w(K)===o}function le(K){return w(K)===f}je.AsyncMode=_,je.ConcurrentMode=S,je.ContextConsumer=I,je.ContextProvider=v,je.Element=x,je.ForwardRef=P,je.Fragment=A,je.Lazy=M,je.Memo=F,je.Portal=N,je.Profiler=W,je.StrictMode=E,je.Suspense=k,je.isAsyncMode=$,je.isConcurrentMode=D,je.isContextConsumer=V,je.isContextProvider=Z,je.isElement=G,je.isForwardRef=B,je.isFragment=z,je.isLazy=X,je.isMemo=q,je.isPortal=oe,je.isProfiler=Q,je.isStrictMode=re,je.isSuspense=le,je.isValidElementType=O,je.typeOf=w})()),je}var Tg;function Dg(){return Tg||(Tg=1,process.env.NODE_ENV==="production"?Wi.exports=iM():Wi.exports=aM()),Wi.exports}var bl,Ag;function cM(){if(Ag)return bl;Ag=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(s){if(s==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(s)}function o(){try{if(!Object.assign)return!1;var s=new String("abc");if(s[5]="de",Object.getOwnPropertyNames(s)[0]==="5")return!1;for(var i={},a=0;a<10;a++)i["_"+String.fromCharCode(a)]=a;var c=Object.getOwnPropertyNames(i).map(function(l){return i[l]});if(c.join("")!=="0123456789")return!1;var u={};return"abcdefghijklmnopqrst".split("").forEach(function(l){u[l]=l}),Object.keys(Object.assign({},u)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return bl=o()?Object.assign:function(s,i){for(var a,c=r(s),u,l=1;l<arguments.length;l++){a=Object(arguments[l]);for(var f in a)t.call(a,f)&&(c[f]=a[f]);if(e){u=e(a);for(var d=0;d<u.length;d++)n.call(a,u[d])&&(c[u[d]]=a[u[d]])}}return c},bl}var wl,Mg;function _l(){if(Mg)return wl;Mg=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return wl=e,wl}var Sl,Pg;function Ng(){return Pg||(Pg=1,Sl=Function.call.bind(Object.prototype.hasOwnProperty)),Sl}var kl,Ig;function lM(){if(Ig)return kl;Ig=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=_l(),n={},r=Ng();e=function(s){var i="Warning: "+s;typeof console<"u"&&console.error(i);try{throw new Error(i)}catch{}}}function o(s,i,a,c,u){if(process.env.NODE_ENV!=="production"){for(var l in s)if(r(s,l)){var f;try{if(typeof s[l]!="function"){var d=Error((c||"React class")+": "+a+" type `"+l+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof s[l]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw d.name="Invariant Violation",d}f=s[l](i,l,c,a,null,t)}catch(m){f=m}if(f&&!(f instanceof Error)&&e((c||"React class")+": type specification of "+a+" `"+l+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof f+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),f instanceof Error&&!(f.message in n)){n[f.message]=!0;var h=u?u():"";e("Failed "+a+" type: "+f.message+(h??""))}}}}return o.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},kl=o,kl}var xl,Fg;function uM(){if(Fg)return xl;Fg=1;var e=Dg(),t=cM(),n=_l(),r=Ng(),o=lM(),s=function(){};process.env.NODE_ENV!=="production"&&(s=function(a){var c="Warning: "+a;typeof console<"u"&&console.error(c);try{throw new Error(c)}catch{}});function i(){return null}return xl=function(a,c){var u=typeof Symbol=="function"&&Symbol.iterator,l="@@iterator";function f(D){var V=D&&(u&&D[u]||D[l]);if(typeof V=="function")return V}var d="<<anonymous>>",h={array:g("array"),bigint:g("bigint"),bool:g("boolean"),func:g("function"),number:g("number"),object:g("object"),string:g("string"),symbol:g("symbol"),any:C(),arrayOf:O,element:w(),elementType:_(),instanceOf:S,node:P(),objectOf:v,oneOf:I,oneOfType:x,shape:M,exact:F};function m(D,V){return D===V?D!==0||1/D===1/V:D!==D&&V!==V}function p(D,V){this.message=D,this.data=V&&typeof V=="object"?V:{},this.stack=""}p.prototype=Error.prototype;function y(D){if(process.env.NODE_ENV!=="production")var V={},Z=0;function G(z,X,q,oe,Q,re,le){if(oe=oe||d,re=re||q,le!==n){if(c){var K=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw K.name="Invariant Violation",K}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var Se=oe+":"+q;!V[Se]&&Z<3&&(s("You are manually calling a React.PropTypes validation function for the `"+re+"` prop on `"+oe+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),V[Se]=!0,Z++)}}return X[q]==null?z?X[q]===null?new p("The "+Q+" `"+re+"` is marked as required "+("in `"+oe+"`, but its value is `null`.")):new p("The "+Q+" `"+re+"` is marked as required in "+("`"+oe+"`, but its value is `undefined`.")):null:D(X,q,oe,Q,re)}var B=G.bind(null,!1);return B.isRequired=G.bind(null,!0),B}function g(D){function V(Z,G,B,z,X,q){var oe=Z[G],Q=E(oe);if(Q!==D){var re=k(oe);return new p("Invalid "+z+" `"+X+"` of type "+("`"+re+"` supplied to `"+B+"`, expected ")+("`"+D+"`."),{expectedType:D})}return null}return y(V)}function C(){return y(i)}function O(D){function V(Z,G,B,z,X){if(typeof D!="function")return new p("Property `"+X+"` of component `"+B+"` has invalid PropType notation inside arrayOf.");var q=Z[G];if(!Array.isArray(q)){var oe=E(q);return new p("Invalid "+z+" `"+X+"` of type "+("`"+oe+"` supplied to `"+B+"`, expected an array."))}for(var Q=0;Q<q.length;Q++){var re=D(q,Q,B,z,X+"["+Q+"]",n);if(re instanceof Error)return re}return null}return y(V)}function w(){function D(V,Z,G,B,z){var X=V[Z];if(!a(X)){var q=E(X);return new p("Invalid "+B+" `"+z+"` of type "+("`"+q+"` supplied to `"+G+"`, expected a single ReactElement."))}return null}return y(D)}function _(){function D(V,Z,G,B,z){var X=V[Z];if(!e.isValidElementType(X)){var q=E(X);return new p("Invalid "+B+" `"+z+"` of type "+("`"+q+"` supplied to `"+G+"`, expected a single ReactElement type."))}return null}return y(D)}function S(D){function V(Z,G,B,z,X){if(!(Z[G]instanceof D)){var q=D.name||d,oe=$(Z[G]);return new p("Invalid "+z+" `"+X+"` of type "+("`"+oe+"` supplied to `"+B+"`, expected ")+("instance of `"+q+"`."))}return null}return y(V)}function I(D){if(!Array.isArray(D))return process.env.NODE_ENV!=="production"&&(arguments.length>1?s("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):s("Invalid argument supplied to oneOf, expected an array.")),i;function V(Z,G,B,z,X){for(var q=Z[G],oe=0;oe<D.length;oe++)if(m(q,D[oe]))return null;var Q=JSON.stringify(D,function(le,K){var Se=k(K);return Se==="symbol"?String(K):K});return new p("Invalid "+z+" `"+X+"` of value `"+String(q)+"` "+("supplied to `"+B+"`, expected one of "+Q+"."))}return y(V)}function v(D){function V(Z,G,B,z,X){if(typeof D!="function")return new p("Property `"+X+"` of component `"+B+"` has invalid PropType notation inside objectOf.");var q=Z[G],oe=E(q);if(oe!=="object")return new p("Invalid "+z+" `"+X+"` of type "+("`"+oe+"` supplied to `"+B+"`, expected an object."));for(var Q in q)if(r(q,Q)){var re=D(q,Q,B,z,X+"."+Q,n);if(re instanceof Error)return re}return null}return y(V)}function x(D){if(!Array.isArray(D))return process.env.NODE_ENV!=="production"&&s("Invalid argument supplied to oneOfType, expected an instance of array."),i;for(var V=0;V<D.length;V++){var Z=D[V];if(typeof Z!="function")return s("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+U(Z)+" at index "+V+"."),i}function G(B,z,X,q,oe){for(var Q=[],re=0;re<D.length;re++){var le=D[re],K=le(B,z,X,q,oe,n);if(K==null)return null;K.data&&r(K.data,"expectedType")&&Q.push(K.data.expectedType)}var Se=Q.length>0?", expected one of type ["+Q.join(", ")+"]":"";return new p("Invalid "+q+" `"+oe+"` supplied to "+("`"+X+"`"+Se+"."))}return y(G)}function P(){function D(V,Z,G,B,z){return N(V[Z])?null:new p("Invalid "+B+" `"+z+"` supplied to "+("`"+G+"`, expected a ReactNode."))}return y(D)}function A(D,V,Z,G,B){return new p((D||"React class")+": "+V+" type `"+Z+"."+G+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+B+"`.")}function M(D){function V(Z,G,B,z,X){var q=Z[G],oe=E(q);if(oe!=="object")return new p("Invalid "+z+" `"+X+"` of type `"+oe+"` "+("supplied to `"+B+"`, expected `object`."));for(var Q in D){var re=D[Q];if(typeof re!="function")return A(B,z,X,Q,k(re));var le=re(q,Q,B,z,X+"."+Q,n);if(le)return le}return null}return y(V)}function F(D){function V(Z,G,B,z,X){var q=Z[G],oe=E(q);if(oe!=="object")return new p("Invalid "+z+" `"+X+"` of type `"+oe+"` "+("supplied to `"+B+"`, expected `object`."));var Q=t({},Z[G],D);for(var re in Q){var le=D[re];if(r(D,re)&&typeof le!="function")return A(B,z,X,re,k(le));if(!le)return new p("Invalid "+z+" `"+X+"` key `"+re+"` supplied to `"+B+"`.\nBad object: "+JSON.stringify(Z[G],null," ")+`
68
+ Valid keys: `+JSON.stringify(Object.keys(D),null," "));var K=le(q,re,B,z,X+"."+re,n);if(K)return K}return null}return y(V)}function N(D){switch(typeof D){case"number":case"string":case"undefined":return!0;case"boolean":return!D;case"object":if(Array.isArray(D))return D.every(N);if(D===null||a(D))return!0;var V=f(D);if(V){var Z=V.call(D),G;if(V!==D.entries){for(;!(G=Z.next()).done;)if(!N(G.value))return!1}else for(;!(G=Z.next()).done;){var B=G.value;if(B&&!N(B[1]))return!1}}else return!1;return!0;default:return!1}}function W(D,V){return D==="symbol"?!0:V?V["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&V instanceof Symbol:!1}function E(D){var V=typeof D;return Array.isArray(D)?"array":D instanceof RegExp?"object":W(V,D)?"symbol":V}function k(D){if(typeof D>"u"||D===null)return""+D;var V=E(D);if(V==="object"){if(D instanceof Date)return"date";if(D instanceof RegExp)return"regexp"}return V}function U(D){var V=k(D);switch(V){case"array":case"object":return"an "+V;case"boolean":case"date":case"regexp":return"a "+V;default:return V}}function $(D){return!D.constructor||!D.constructor.name?d:D.constructor.name}return h.checkPropTypes=o,h.resetWarningCache=o.resetWarningCache,h.PropTypes=h,h},xl}var Ol,Rg;function fM(){if(Rg)return Ol;Rg=1;var e=_l();function t(){}function n(){}return n.resetWarningCache=t,Ol=function(){function r(i,a,c,u,l,f){if(f!==e){var d=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw d.name="Invariant Violation",d}}r.isRequired=r;function o(){return r}var s={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return s.PropTypes=s,s},Ol}var Wg;function dM(){if(Wg)return Ri.exports;if(Wg=1,process.env.NODE_ENV!=="production"){var e=Dg(),t=!0;Ri.exports=uM()(e.isElement,t)}else Ri.exports=fM()();return Ri.exports}var hM=dM();const Jt=vl(hM);function Ur(e,t,n){this.x=e,this.y=t,this.time=n||new Date().getTime()}Ur.prototype.velocityFrom=function(e){return this.time!==e.time?this.distanceTo(e)/(this.time-e.time):1},Ur.prototype.distanceTo=function(e){return Math.sqrt(Math.pow(this.x-e.x,2)+Math.pow(this.y-e.y,2))},Ur.prototype.equals=function(e){return this.x===e.x&&this.y===e.y&&this.time===e.time};function El(e,t,n,r){this.startPoint=e,this.control1=t,this.control2=n,this.endPoint=r}El.prototype.length=function(){for(var e=10,t=0,n=void 0,r=void 0,o=0;o<=e;o+=1){var s=o/e,i=this._point(s,this.startPoint.x,this.control1.x,this.control2.x,this.endPoint.x),a=this._point(s,this.startPoint.y,this.control1.y,this.control2.y,this.endPoint.y);if(o>0){var c=i-n,u=a-r;t+=Math.sqrt(c*c+u*u)}n=i,r=a}return t},El.prototype._point=function(e,t,n,r,o){return t*(1-e)*(1-e)*(1-e)+3*n*(1-e)*(1-e)*e+3*r*(1-e)*e*e+o*e*e*e};function pM(e,t,n){var r,o,s,i=null,a=0;n||(n={});var c=function(){a=n.leading===!1?0:Date.now(),i=null,s=e.apply(r,o),i||(r=o=null)};return function(){var u=Date.now();!a&&n.leading===!1&&(a=u);var l=t-(u-a);return r=this,o=arguments,l<=0||l>t?(i&&(clearTimeout(i),i=null),a=u,s=e.apply(r,o),i||(r=o=null)):!i&&n.trailing!==!1&&(i=setTimeout(c,l)),s}}function Je(e,t){var n=this,r=t||{};this.velocityFilterWeight=r.velocityFilterWeight||.7,this.minWidth=r.minWidth||.5,this.maxWidth=r.maxWidth||2.5,this.throttle="throttle"in r?r.throttle:16,this.minDistance="minDistance"in r?r.minDistance:5,this.throttle?this._strokeMoveUpdate=pM(Je.prototype._strokeUpdate,this.throttle):this._strokeMoveUpdate=Je.prototype._strokeUpdate,this.dotSize=r.dotSize||function(){return(this.minWidth+this.maxWidth)/2},this.penColor=r.penColor||"black",this.backgroundColor=r.backgroundColor||"rgba(0,0,0,0)",this.onBegin=r.onBegin,this.onEnd=r.onEnd,this._canvas=e,this._ctx=e.getContext("2d"),this.clear(),this._handleMouseDown=function(o){o.which===1&&(n._mouseButtonDown=!0,n._strokeBegin(o))},this._handleMouseMove=function(o){n._mouseButtonDown&&n._strokeMoveUpdate(o)},this._handleMouseUp=function(o){o.which===1&&n._mouseButtonDown&&(n._mouseButtonDown=!1,n._strokeEnd(o))},this._handleTouchStart=function(o){if(o.targetTouches.length===1){var s=o.changedTouches[0];n._strokeBegin(s)}},this._handleTouchMove=function(o){o.preventDefault();var s=o.targetTouches[0];n._strokeMoveUpdate(s)},this._handleTouchEnd=function(o){var s=o.target===n._canvas;s&&(o.preventDefault(),n._strokeEnd(o))},this.on()}Je.prototype.clear=function(){var e=this._ctx,t=this._canvas;e.fillStyle=this.backgroundColor,e.clearRect(0,0,t.width,t.height),e.fillRect(0,0,t.width,t.height),this._data=[],this._reset(),this._isEmpty=!0},Je.prototype.fromDataURL=function(e){var t=this,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=new Image,o=n.ratio||window.devicePixelRatio||1,s=n.width||this._canvas.width/o,i=n.height||this._canvas.height/o;this._reset(),r.src=e,r.onload=function(){t._ctx.drawImage(r,0,0,s,i)},this._isEmpty=!1},Je.prototype.toDataURL=function(e){var t;switch(e){case"image/svg+xml":return this._toSVG();default:for(var n=arguments.length,r=Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return(t=this._canvas).toDataURL.apply(t,[e].concat(r))}},Je.prototype.on=function(){this._handleMouseEvents(),this._handleTouchEvents()},Je.prototype.off=function(){this._canvas.removeEventListener("mousedown",this._handleMouseDown),this._canvas.removeEventListener("mousemove",this._handleMouseMove),document.removeEventListener("mouseup",this._handleMouseUp),this._canvas.removeEventListener("touchstart",this._handleTouchStart),this._canvas.removeEventListener("touchmove",this._handleTouchMove),this._canvas.removeEventListener("touchend",this._handleTouchEnd)},Je.prototype.isEmpty=function(){return this._isEmpty},Je.prototype._strokeBegin=function(e){this._data.push([]),this._reset(),this._strokeUpdate(e),typeof this.onBegin=="function"&&this.onBegin(e)},Je.prototype._strokeUpdate=function(e){var t=e.clientX,n=e.clientY,r=this._createPoint(t,n),o=this._data[this._data.length-1],s=o&&o[o.length-1],i=s&&r.distanceTo(s)<this.minDistance;if(!(s&&i)){var a=this._addPoint(r),c=a.curve,u=a.widths;c&&u&&this._drawCurve(c,u.start,u.end),this._data[this._data.length-1].push({x:r.x,y:r.y,time:r.time,color:this.penColor})}},Je.prototype._strokeEnd=function(e){var t=this.points.length>2,n=this.points[0];if(!t&&n&&this._drawDot(n),n){var r=this._data[this._data.length-1],o=r[r.length-1];n.equals(o)||r.push({x:n.x,y:n.y,time:n.time,color:this.penColor})}typeof this.onEnd=="function"&&this.onEnd(e)},Je.prototype._handleMouseEvents=function(){this._mouseButtonDown=!1,this._canvas.addEventListener("mousedown",this._handleMouseDown),this._canvas.addEventListener("mousemove",this._handleMouseMove),document.addEventListener("mouseup",this._handleMouseUp)},Je.prototype._handleTouchEvents=function(){this._canvas.style.msTouchAction="none",this._canvas.style.touchAction="none",this._canvas.addEventListener("touchstart",this._handleTouchStart),this._canvas.addEventListener("touchmove",this._handleTouchMove),this._canvas.addEventListener("touchend",this._handleTouchEnd)},Je.prototype._reset=function(){this.points=[],this._lastVelocity=0,this._lastWidth=(this.minWidth+this.maxWidth)/2,this._ctx.fillStyle=this.penColor},Je.prototype._createPoint=function(e,t,n){var r=this._canvas.getBoundingClientRect();return new Ur(e-r.left,t-r.top,n||new Date().getTime())},Je.prototype._addPoint=function(e){var t=this.points,n=void 0;if(t.push(e),t.length>2){t.length===3&&t.unshift(t[0]),n=this._calculateCurveControlPoints(t[0],t[1],t[2]);var r=n.c2;n=this._calculateCurveControlPoints(t[1],t[2],t[3]);var o=n.c1,s=new El(t[1],r,o,t[2]),i=this._calculateCurveWidths(s);return t.shift(),{curve:s,widths:i}}return{}},Je.prototype._calculateCurveControlPoints=function(e,t,n){var r=e.x-t.x,o=e.y-t.y,s=t.x-n.x,i=t.y-n.y,a={x:(e.x+t.x)/2,y:(e.y+t.y)/2},c={x:(t.x+n.x)/2,y:(t.y+n.y)/2},u=Math.sqrt(r*r+o*o),l=Math.sqrt(s*s+i*i),f=a.x-c.x,d=a.y-c.y,h=l/(u+l),m={x:c.x+f*h,y:c.y+d*h},p=t.x-m.x,y=t.y-m.y;return{c1:new Ur(a.x+p,a.y+y),c2:new Ur(c.x+p,c.y+y)}},Je.prototype._calculateCurveWidths=function(e){var t=e.startPoint,n=e.endPoint,r={start:null,end:null},o=this.velocityFilterWeight*n.velocityFrom(t)+(1-this.velocityFilterWeight)*this._lastVelocity,s=this._strokeWidth(o);return r.start=this._lastWidth,r.end=s,this._lastVelocity=o,this._lastWidth=s,r},Je.prototype._strokeWidth=function(e){return Math.max(this.maxWidth/(e+1),this.minWidth)},Je.prototype._drawPoint=function(e,t,n){var r=this._ctx;r.moveTo(e,t),r.arc(e,t,n,0,2*Math.PI,!1),this._isEmpty=!1},Je.prototype._drawCurve=function(e,t,n){var r=this._ctx,o=n-t,s=Math.floor(e.length());r.beginPath();for(var i=0;i<s;i+=1){var a=i/s,c=a*a,u=c*a,l=1-a,f=l*l,d=f*l,h=d*e.startPoint.x;h+=3*f*a*e.control1.x,h+=3*l*c*e.control2.x,h+=u*e.endPoint.x;var m=d*e.startPoint.y;m+=3*f*a*e.control1.y,m+=3*l*c*e.control2.y,m+=u*e.endPoint.y;var p=t+u*o;this._drawPoint(h,m,p)}r.closePath(),r.fill()},Je.prototype._drawDot=function(e){var t=this._ctx,n=typeof this.dotSize=="function"?this.dotSize():this.dotSize;t.beginPath(),this._drawPoint(e.x,e.y,n),t.closePath(),t.fill()},Je.prototype._fromData=function(e,t,n){for(var r=0;r<e.length;r+=1){var o=e[r];if(o.length>1)for(var s=0;s<o.length;s+=1){var i=o[s],a=new Ur(i.x,i.y,i.time),c=i.color;if(s===0)this.penColor=c,this._reset(),this._addPoint(a);else if(s!==o.length-1){var u=this._addPoint(a),l=u.curve,f=u.widths;l&&f&&t(l,f,c)}}else{this._reset();var d=o[0];n(d)}}},Je.prototype._toSVG=function(){var e=this,t=this._data,n=this._canvas,r=Math.max(window.devicePixelRatio||1,1),o=0,s=0,i=n.width/r,a=n.height/r,c=document.createElementNS("http://www.w3.org/2000/svg","svg");c.setAttributeNS(null,"width",n.width),c.setAttributeNS(null,"height",n.height),this._fromData(t,function(g,C,O){var w=document.createElement("path");if(!isNaN(g.control1.x)&&!isNaN(g.control1.y)&&!isNaN(g.control2.x)&&!isNaN(g.control2.y)){var _="M "+g.startPoint.x.toFixed(3)+","+g.startPoint.y.toFixed(3)+" "+("C "+g.control1.x.toFixed(3)+","+g.control1.y.toFixed(3)+" ")+(g.control2.x.toFixed(3)+","+g.control2.y.toFixed(3)+" ")+(g.endPoint.x.toFixed(3)+","+g.endPoint.y.toFixed(3));w.setAttribute("d",_),w.setAttribute("stroke-width",(C.end*2.25).toFixed(3)),w.setAttribute("stroke",O),w.setAttribute("fill","none"),w.setAttribute("stroke-linecap","round"),c.appendChild(w)}},function(g){var C=document.createElement("circle"),O=typeof e.dotSize=="function"?e.dotSize():e.dotSize;C.setAttribute("r",O),C.setAttribute("cx",g.x),C.setAttribute("cy",g.y),C.setAttribute("fill",g.color),c.appendChild(C)});var u="data:image/svg+xml;base64,",l='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"'+(' viewBox="'+o+" "+s+" "+i+" "+a+'"')+(' width="'+i+'"')+(' height="'+a+'"')+">",f=c.innerHTML;if(f===void 0){var d=document.createElement("dummy"),h=c.childNodes;d.innerHTML="";for(var m=0;m<h.length;m+=1)d.appendChild(h[m].cloneNode(!0));f=d.innerHTML}var p="</svg>",y=l+f+p;return u+btoa(y)},Je.prototype.fromData=function(e){var t=this;this.clear(),this._fromData(e,function(n,r){return t._drawCurve(n,r.start,r.end)},function(n){return t._drawDot(n)}),this._data=e},Je.prototype.toData=function(){return this._data};var zi={exports:{}},mM=zi.exports,zg;function gM(){return zg||(zg=1,(function(e,t){(function(n,r){e.exports=r()})(mM,function(){return(function(n){function r(s){if(o[s])return o[s].exports;var i=o[s]={exports:{},id:s,loaded:!1};return n[s].call(i.exports,i,i.exports,r),i.loaded=!0,i.exports}var o={};return r.m=n,r.c=o,r.p="",r(0)})([function(n,r){function o(u){var l=u.getContext("2d"),f=u.width,d=u.height,h=l.getImageData(0,0,f,d).data,m=a(!0,f,d,h),p=a(!1,f,d,h),y=c(!0,f,d,h),g=c(!1,f,d,h),C=g-y+1,O=p-m+1,w=l.getImageData(y,m,C,O);return u.width=C,u.height=O,l.clearRect(0,0,C,O),l.putImageData(w,0,0),u}function s(u,l,f,d){return{red:d[4*(f*l+u)],green:d[4*(f*l+u)+1],blue:d[4*(f*l+u)+2],alpha:d[4*(f*l+u)+3]}}function i(u,l,f,d){return s(u,l,f,d).alpha}function a(u,l,f,d){for(var h=u?1:-1,m=u?0:f-1,p=m;u?p<f:p>-1;p+=h)for(var y=0;y<l;y++)if(i(y,p,l,d))return p;return null}function c(u,l,f,d){for(var h=u?1:-1,m=u?0:l-1,p=m;u?p<l:p>-1;p+=h)for(var y=0;y<f;y++)if(i(p,y,l,d))return p;return null}Object.defineProperty(r,"__esModule",{value:!0}),r.default=o}])})})(zi)),zi.exports}var yM=gM();const vM=vl(yM);var bM=["canvasProps","clearOnResize"],Li=(function(e){nM(n,e);var t=sM(n);function n(){var r;tM(this,n);for(var o=arguments.length,s=new Array(o),i=0;i<o;i++)s[i]=arguments[i];return r=t.call.apply(t,[this].concat(s)),r.staticThis=r.constructor,r._sigPad=null,r._canvas=null,r.setRef=function(a){r._canvas=a,r._canvas===null&&(r._sigPad=null)},r._excludeOurProps=function(){var a=r.props;a.canvasProps,a.clearOnResize;var c=QA(a,bM);return c},r.componentDidMount=function(){var a=r.getCanvas();r._sigPad=new Je(a,r._excludeOurProps()),r._resizeCanvas(),r.on()},r.componentWillUnmount=function(){r.off()},r.componentDidUpdate=function(){Object.assign(r._sigPad,r._excludeOurProps())},r.getCanvas=function(){if(r._canvas===null)throw r.staticThis.refNullError;return r._canvas},r.getTrimmedCanvas=function(){var a=r.getCanvas(),c=document.createElement("canvas");return c.width=a.width,c.height=a.height,c.getContext("2d").drawImage(a,0,0),vM(c)},r.getSignaturePad=function(){if(r._sigPad===null)throw r.staticThis.refNullError;return r._sigPad},r._checkClearOnResize=function(){r.props.clearOnResize&&r._resizeCanvas()},r._resizeCanvas=function(){var a,c,u=(a=r.props.canvasProps)!==null&&a!==void 0?a:{},l=u.width,f=u.height;if(!(typeof l<"u"&&typeof f<"u")){var d=r.getCanvas(),h=Math.max((c=window.devicePixelRatio)!==null&&c!==void 0?c:1,1);typeof l>"u"&&(d.width=d.offsetWidth*h),typeof f>"u"&&(d.height=d.offsetHeight*h),d.getContext("2d").scale(h,h),r.clear()}},r.render=function(){var a=r.props.canvasProps;return j.createElement("canvas",ml({ref:r.setRef},a))},r.on=function(){return window.addEventListener("resize",r._checkClearOnResize),r.getSignaturePad().on()},r.off=function(){return window.removeEventListener("resize",r._checkClearOnResize),r.getSignaturePad().off()},r.clear=function(){return r.getSignaturePad().clear()},r.isEmpty=function(){return r.getSignaturePad().isEmpty()},r.fromDataURL=function(a,c){return r.getSignaturePad().fromDataURL(a,c)},r.toDataURL=function(a,c){return r.getSignaturePad().toDataURL(a,c)},r.fromData=function(a){return r.getSignaturePad().fromData(a)},r.toData=function(){return r.getSignaturePad().toData()},r}return eM(n)})(j.Component);Li.propTypes={velocityFilterWeight:Jt.number,minWidth:Jt.number,maxWidth:Jt.number,minDistance:Jt.number,dotSize:Jt.oneOfType([Jt.number,Jt.func]),penColor:Jt.string,throttle:Jt.number,onEnd:Jt.func,onBegin:Jt.func,canvasProps:Jt.object,clearOnResize:Jt.bool},Li.defaultProps={clearOnResize:!0},Li.refNullError=new Error("react-signature-canvas is currently mounting or unmounting: React refs are null during this phase.");const wM=(e={})=>{const{field:t={},form:n={},question:r={},disabled:o=!1}=e,s=j.useRef({}),[i,a]=j.useState(!1);return T.jsxs("div",{children:[T.jsxs(GA,{open:i,onOpenChange:a,children:[T.jsx(qA,{asChild:!0,children:T.jsx(po,{...t,type:"button",variant:"outline",disabled:o,className:Ae("bq-signature-button w-full border! border-input! focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",!t.value&&"text-muted-foreground",n.formState.errors[r.reference_id]&&"border-destructive"),children:"Click here to sign"})}),T.jsxs(_g,{className:"bq-signature-dialog sm:max-w-md",children:[T.jsx(Sg,{children:T.jsx(xg,{children:"Sign here"})}),T.jsx("div",{className:"bq-signature-pad border",children:T.jsx(Li,{ref:s,penColor:"black",canvasProps:{width:400,height:200,className:"sigCanvas"}})}),T.jsxs(kg,{children:[T.jsx(po,{type:"button",variant:"secondary",onClick:()=>{s.current.clear()},children:"Clear"}),T.jsx(po,{type:"button",onClick:async()=>{if(s.current.toData().length>0){const c=s.current.getTrimmedCanvas().toDataURL("image/png"),u=await dC(c);t.onChange(u)}else t.onChange("");a(!1)},children:"Save"})]})]})]}),t.value&&T.jsx("img",{className:"border rounded p-2 mt-2",src:t.value})]})};const{entries:Lg,setPrototypeOf:$g,isFrozen:_M,getPrototypeOf:SM,getOwnPropertyDescriptor:kM}=Object;let{freeze:Rt,seal:on,create:Cl}=Object,{apply:Tl,construct:Dl}=typeof Reflect<"u"&&Reflect;Rt||(Rt=function(t){return t}),on||(on=function(t){return t}),Tl||(Tl=function(t,n){for(var r=arguments.length,o=new Array(r>2?r-2:0),s=2;s<r;s++)o[s-2]=arguments[s];return t.apply(n,o)}),Dl||(Dl=function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return new t(...r)});const $i=zt(Array.prototype.forEach),xM=zt(Array.prototype.lastIndexOf),Ug=zt(Array.prototype.pop),rs=zt(Array.prototype.push),OM=zt(Array.prototype.splice),Ui=zt(String.prototype.toLowerCase),Al=zt(String.prototype.toString),Ml=zt(String.prototype.match),os=zt(String.prototype.replace),EM=zt(String.prototype.indexOf),CM=zt(String.prototype.trim),_n=zt(Object.prototype.hasOwnProperty),Wt=zt(RegExp.prototype.test),ss=TM(TypeError);function zt(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return Tl(e,t,r)}}function TM(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Dl(e,n)}}function Pe(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Ui;$g&&$g(e,null);let r=t.length;for(;r--;){let o=t[r];if(typeof o=="string"){const s=n(o);s!==o&&(_M(t)||(t[r]=s),o=s)}e[o]=!0}return e}function DM(e){for(let t=0;t<e.length;t++)_n(e,t)||(e[t]=null);return e}function Wn(e){const t=Cl(null);for(const[n,r]of Lg(e))_n(e,n)&&(Array.isArray(r)?t[n]=DM(r):r&&typeof r=="object"&&r.constructor===Object?t[n]=Wn(r):t[n]=r);return t}function is(e,t){for(;e!==null;){const r=kM(e,t);if(r){if(r.get)return zt(r.get);if(typeof r.value=="function")return zt(r.value)}e=SM(e)}function n(){return null}return n}const Yg=Rt(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Pl=Rt(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Nl=Rt(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),AM=Rt(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Il=Rt(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),MM=Rt(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),jg=Rt(["#text"]),Vg=Rt(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Fl=Rt(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Bg=Rt(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Yi=Rt(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),PM=on(/\{\{[\w\W]*|[\w\W]*\}\}/gm),NM=on(/<%[\w\W]*|[\w\W]*%>/gm),IM=on(/\$\{[\w\W]*/gm),FM=on(/^data-[\-\w.\u00B7-\uFFFF]+$/),RM=on(/^aria-[\-\w]+$/),Hg=on(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),WM=on(/^(?:\w+script|data):/i),zM=on(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Zg=on(/^html$/i),LM=on(/^[a-z][.\w]*(-[.\w]+)+$/i);var Gg=Object.freeze({__proto__:null,ARIA_ATTR:RM,ATTR_WHITESPACE:zM,CUSTOM_ELEMENT:LM,DATA_ATTR:FM,DOCTYPE_NAME:Zg,ERB_EXPR:NM,IS_ALLOWED_URI:Hg,IS_SCRIPT_OR_DATA:WM,MUSTACHE_EXPR:PM,TMPLIT_EXPR:IM});const as={element:1,text:3,progressingInstruction:7,comment:8,document:9},$M=function(){return typeof window>"u"?null:window},UM=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let r=null;const o="data-tt-policy-suffix";n&&n.hasAttribute(o)&&(r=n.getAttribute(o));const s="dompurify"+(r?"#"+r:"");try{return t.createPolicy(s,{createHTML(i){return i},createScriptURL(i){return i}})}catch{return console.warn("TrustedTypes policy "+s+" could not be created."),null}},qg=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Kg(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:$M();const t=ye=>Kg(ye);if(t.version="3.3.1",t.removed=[],!e||!e.document||e.document.nodeType!==as.document||!e.Element)return t.isSupported=!1,t;let{document:n}=e;const r=n,o=r.currentScript,{DocumentFragment:s,HTMLTemplateElement:i,Node:a,Element:c,NodeFilter:u,NamedNodeMap:l=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:f,DOMParser:d,trustedTypes:h}=e,m=c.prototype,p=is(m,"cloneNode"),y=is(m,"remove"),g=is(m,"nextSibling"),C=is(m,"childNodes"),O=is(m,"parentNode");if(typeof i=="function"){const ye=n.createElement("template");ye.content&&ye.content.ownerDocument&&(n=ye.content.ownerDocument)}let w,_="";const{implementation:S,createNodeIterator:I,createDocumentFragment:v,getElementsByTagName:x}=n,{importNode:P}=r;let A=qg();t.isSupported=typeof Lg=="function"&&typeof O=="function"&&S&&S.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:M,ERB_EXPR:F,TMPLIT_EXPR:N,DATA_ATTR:W,ARIA_ATTR:E,IS_SCRIPT_OR_DATA:k,ATTR_WHITESPACE:U,CUSTOM_ELEMENT:$}=Gg;let{IS_ALLOWED_URI:D}=Gg,V=null;const Z=Pe({},[...Yg,...Pl,...Nl,...Il,...jg]);let G=null;const B=Pe({},[...Vg,...Fl,...Bg,...Yi]);let z=Object.seal(Cl(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),X=null,q=null;const oe=Object.seal(Cl(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Q=!0,re=!0,le=!1,K=!0,Se=!1,Ie=!0,ke=!1,Ge=!1,Re=!1,We=!1,nt=!1,rt=!1,R=!0,Y=!1;const H="user-content-";let ee=!0,te=!1,ne={},ue=null;const be=Pe({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Oe=null;const ze=Pe({},["audio","video","img","source","image","track"]);let ot=null;const Qe=Pe({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),xt="http://www.w3.org/1998/Math/MathML",gt="http://www.w3.org/2000/svg",dt="http://www.w3.org/1999/xhtml";let jt=dt,Sn=!1,kn=null;const _e=Pe({},[xt,gt,dt],Al);let De=Pe({},["mi","mo","mn","ms","mtext"]),ve=Pe({},["annotation-xml"]);const Ee=Pe({},["title","style","font","a","script"]);let Xe=null;const xe=["application/xhtml+xml","text/html"],tr="text/html";let ct=null,Pt=null;const Qt=n.createElement("form"),Oo=function(L){return L instanceof RegExp||L instanceof Function},Du=function(){let L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Pt&&Pt===L)){if((!L||typeof L!="object")&&(L={}),L=Wn(L),Xe=xe.indexOf(L.PARSER_MEDIA_TYPE)===-1?tr:L.PARSER_MEDIA_TYPE,ct=Xe==="application/xhtml+xml"?Al:Ui,V=_n(L,"ALLOWED_TAGS")?Pe({},L.ALLOWED_TAGS,ct):Z,G=_n(L,"ALLOWED_ATTR")?Pe({},L.ALLOWED_ATTR,ct):B,kn=_n(L,"ALLOWED_NAMESPACES")?Pe({},L.ALLOWED_NAMESPACES,Al):_e,ot=_n(L,"ADD_URI_SAFE_ATTR")?Pe(Wn(Qe),L.ADD_URI_SAFE_ATTR,ct):Qe,Oe=_n(L,"ADD_DATA_URI_TAGS")?Pe(Wn(ze),L.ADD_DATA_URI_TAGS,ct):ze,ue=_n(L,"FORBID_CONTENTS")?Pe({},L.FORBID_CONTENTS,ct):be,X=_n(L,"FORBID_TAGS")?Pe({},L.FORBID_TAGS,ct):Wn({}),q=_n(L,"FORBID_ATTR")?Pe({},L.FORBID_ATTR,ct):Wn({}),ne=_n(L,"USE_PROFILES")?L.USE_PROFILES:!1,Q=L.ALLOW_ARIA_ATTR!==!1,re=L.ALLOW_DATA_ATTR!==!1,le=L.ALLOW_UNKNOWN_PROTOCOLS||!1,K=L.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Se=L.SAFE_FOR_TEMPLATES||!1,Ie=L.SAFE_FOR_XML!==!1,ke=L.WHOLE_DOCUMENT||!1,We=L.RETURN_DOM||!1,nt=L.RETURN_DOM_FRAGMENT||!1,rt=L.RETURN_TRUSTED_TYPE||!1,Re=L.FORCE_BODY||!1,R=L.SANITIZE_DOM!==!1,Y=L.SANITIZE_NAMED_PROPS||!1,ee=L.KEEP_CONTENT!==!1,te=L.IN_PLACE||!1,D=L.ALLOWED_URI_REGEXP||Hg,jt=L.NAMESPACE||dt,De=L.MATHML_TEXT_INTEGRATION_POINTS||De,ve=L.HTML_INTEGRATION_POINTS||ve,z=L.CUSTOM_ELEMENT_HANDLING||{},L.CUSTOM_ELEMENT_HANDLING&&Oo(L.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(z.tagNameCheck=L.CUSTOM_ELEMENT_HANDLING.tagNameCheck),L.CUSTOM_ELEMENT_HANDLING&&Oo(L.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(z.attributeNameCheck=L.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),L.CUSTOM_ELEMENT_HANDLING&&typeof L.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(z.allowCustomizedBuiltInElements=L.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Se&&(re=!1),nt&&(We=!0),ne&&(V=Pe({},jg),G=[],ne.html===!0&&(Pe(V,Yg),Pe(G,Vg)),ne.svg===!0&&(Pe(V,Pl),Pe(G,Fl),Pe(G,Yi)),ne.svgFilters===!0&&(Pe(V,Nl),Pe(G,Fl),Pe(G,Yi)),ne.mathMl===!0&&(Pe(V,Il),Pe(G,Bg),Pe(G,Yi))),L.ADD_TAGS&&(typeof L.ADD_TAGS=="function"?oe.tagCheck=L.ADD_TAGS:(V===Z&&(V=Wn(V)),Pe(V,L.ADD_TAGS,ct))),L.ADD_ATTR&&(typeof L.ADD_ATTR=="function"?oe.attributeCheck=L.ADD_ATTR:(G===B&&(G=Wn(G)),Pe(G,L.ADD_ATTR,ct))),L.ADD_URI_SAFE_ATTR&&Pe(ot,L.ADD_URI_SAFE_ATTR,ct),L.FORBID_CONTENTS&&(ue===be&&(ue=Wn(ue)),Pe(ue,L.FORBID_CONTENTS,ct)),L.ADD_FORBID_CONTENTS&&(ue===be&&(ue=Wn(ue)),Pe(ue,L.ADD_FORBID_CONTENTS,ct)),ee&&(V["#text"]=!0),ke&&Pe(V,["html","head","body"]),V.table&&(Pe(V,["tbody"]),delete X.tbody),L.TRUSTED_TYPES_POLICY){if(typeof L.TRUSTED_TYPES_POLICY.createHTML!="function")throw ss('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof L.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw ss('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');w=L.TRUSTED_TYPES_POLICY,_=w.createHTML("")}else w===void 0&&(w=UM(h,o)),w!==null&&typeof _=="string"&&(_=w.createHTML(""));Rt&&Rt(L),Pt=L}},zv=Pe({},[...Pl,...Nl,...AM]),Lv=Pe({},[...Il,...MM]),aR=function(L){let ie=O(L);(!ie||!ie.tagName)&&(ie={namespaceURI:jt,tagName:"template"});const pe=Ui(L.tagName),lt=Ui(ie.tagName);return kn[L.namespaceURI]?L.namespaceURI===gt?ie.namespaceURI===dt?pe==="svg":ie.namespaceURI===xt?pe==="svg"&&(lt==="annotation-xml"||De[lt]):!!zv[pe]:L.namespaceURI===xt?ie.namespaceURI===dt?pe==="math":ie.namespaceURI===gt?pe==="math"&&ve[lt]:!!Lv[pe]:L.namespaceURI===dt?ie.namespaceURI===gt&&!ve[lt]||ie.namespaceURI===xt&&!De[lt]?!1:!Lv[pe]&&(Ee[pe]||!zv[pe]):!!(Xe==="application/xhtml+xml"&&kn[L.namespaceURI]):!1},zn=function(L){rs(t.removed,{element:L});try{O(L).removeChild(L)}catch{y(L)}},Br=function(L,ie){try{rs(t.removed,{attribute:ie.getAttributeNode(L),from:ie})}catch{rs(t.removed,{attribute:null,from:ie})}if(ie.removeAttribute(L),L==="is")if(We||nt)try{zn(ie)}catch{}else try{ie.setAttribute(L,"")}catch{}},$v=function(L){let ie=null,pe=null;if(Re)L="<remove></remove>"+L;else{const _t=Ml(L,/^[\r\n\t ]+/);pe=_t&&_t[0]}Xe==="application/xhtml+xml"&&jt===dt&&(L='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+L+"</body></html>");const lt=w?w.createHTML(L):L;if(jt===dt)try{ie=new d().parseFromString(lt,Xe)}catch{}if(!ie||!ie.documentElement){ie=S.createDocument(jt,"template",null);try{ie.documentElement.innerHTML=Sn?_:lt}catch{}}const Nt=ie.body||ie.documentElement;return L&&pe&&Nt.insertBefore(n.createTextNode(pe),Nt.childNodes[0]||null),jt===dt?x.call(ie,ke?"html":"body")[0]:ke?ie.documentElement:Nt},Uv=function(L){return I.call(L.ownerDocument||L,L,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},Au=function(L){return L instanceof f&&(typeof L.nodeName!="string"||typeof L.textContent!="string"||typeof L.removeChild!="function"||!(L.attributes instanceof l)||typeof L.removeAttribute!="function"||typeof L.setAttribute!="function"||typeof L.namespaceURI!="string"||typeof L.insertBefore!="function"||typeof L.hasChildNodes!="function")},Yv=function(L){return typeof a=="function"&&L instanceof a};function nr(ye,L,ie){$i(ye,pe=>{pe.call(t,L,ie,Pt)})}const jv=function(L){let ie=null;if(nr(A.beforeSanitizeElements,L,null),Au(L))return zn(L),!0;const pe=ct(L.nodeName);if(nr(A.uponSanitizeElement,L,{tagName:pe,allowedTags:V}),Ie&&L.hasChildNodes()&&!Yv(L.firstElementChild)&&Wt(/<[/\w!]/g,L.innerHTML)&&Wt(/<[/\w!]/g,L.textContent)||L.nodeType===as.progressingInstruction||Ie&&L.nodeType===as.comment&&Wt(/<[/\w]/g,L.data))return zn(L),!0;if(!(oe.tagCheck instanceof Function&&oe.tagCheck(pe))&&(!V[pe]||X[pe])){if(!X[pe]&&Bv(pe)&&(z.tagNameCheck instanceof RegExp&&Wt(z.tagNameCheck,pe)||z.tagNameCheck instanceof Function&&z.tagNameCheck(pe)))return!1;if(ee&&!ue[pe]){const lt=O(L)||L.parentNode,Nt=C(L)||L.childNodes;if(Nt&&lt){const _t=Nt.length;for(let Vt=_t-1;Vt>=0;--Vt){const rr=p(Nt[Vt],!0);rr.__removalCount=(L.__removalCount||0)+1,lt.insertBefore(rr,g(L))}}}return zn(L),!0}return L instanceof c&&!aR(L)||(pe==="noscript"||pe==="noembed"||pe==="noframes")&&Wt(/<\/no(script|embed|frames)/i,L.innerHTML)?(zn(L),!0):(Se&&L.nodeType===as.text&&(ie=L.textContent,$i([M,F,N],lt=>{ie=os(ie,lt," ")}),L.textContent!==ie&&(rs(t.removed,{element:L.cloneNode()}),L.textContent=ie)),nr(A.afterSanitizeElements,L,null),!1)},Vv=function(L,ie,pe){if(R&&(ie==="id"||ie==="name")&&(pe in n||pe in Qt))return!1;if(!(re&&!q[ie]&&Wt(W,ie))){if(!(Q&&Wt(E,ie))){if(!(oe.attributeCheck instanceof Function&&oe.attributeCheck(ie,L))){if(!G[ie]||q[ie]){if(!(Bv(L)&&(z.tagNameCheck instanceof RegExp&&Wt(z.tagNameCheck,L)||z.tagNameCheck instanceof Function&&z.tagNameCheck(L))&&(z.attributeNameCheck instanceof RegExp&&Wt(z.attributeNameCheck,ie)||z.attributeNameCheck instanceof Function&&z.attributeNameCheck(ie,L))||ie==="is"&&z.allowCustomizedBuiltInElements&&(z.tagNameCheck instanceof RegExp&&Wt(z.tagNameCheck,pe)||z.tagNameCheck instanceof Function&&z.tagNameCheck(pe))))return!1}else if(!ot[ie]){if(!Wt(D,os(pe,U,""))){if(!((ie==="src"||ie==="xlink:href"||ie==="href")&&L!=="script"&&EM(pe,"data:")===0&&Oe[L])){if(!(le&&!Wt(k,os(pe,U,"")))){if(pe)return!1}}}}}}}return!0},Bv=function(L){return L!=="annotation-xml"&&Ml(L,$)},Hv=function(L){nr(A.beforeSanitizeAttributes,L,null);const{attributes:ie}=L;if(!ie||Au(L))return;const pe={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:G,forceKeepAttr:void 0};let lt=ie.length;for(;lt--;){const Nt=ie[lt],{name:_t,namespaceURI:Vt,value:rr}=Nt,Eo=ct(_t),Mu=rr;let Ct=_t==="value"?Mu:CM(Mu);if(pe.attrName=Eo,pe.attrValue=Ct,pe.keepAttr=!0,pe.forceKeepAttr=void 0,nr(A.uponSanitizeAttribute,L,pe),Ct=pe.attrValue,Y&&(Eo==="id"||Eo==="name")&&(Br(_t,L),Ct=H+Ct),Ie&&Wt(/((--!?|])>)|<\/(style|title|textarea)/i,Ct)){Br(_t,L);continue}if(Eo==="attributename"&&Ml(Ct,"href")){Br(_t,L);continue}if(pe.forceKeepAttr)continue;if(!pe.keepAttr){Br(_t,L);continue}if(!K&&Wt(/\/>/i,Ct)){Br(_t,L);continue}Se&&$i([M,F,N],Gv=>{Ct=os(Ct,Gv," ")});const Zv=ct(L.nodeName);if(!Vv(Zv,Eo,Ct)){Br(_t,L);continue}if(w&&typeof h=="object"&&typeof h.getAttributeType=="function"&&!Vt)switch(h.getAttributeType(Zv,Eo)){case"TrustedHTML":{Ct=w.createHTML(Ct);break}case"TrustedScriptURL":{Ct=w.createScriptURL(Ct);break}}if(Ct!==Mu)try{Vt?L.setAttributeNS(Vt,_t,Ct):L.setAttribute(_t,Ct),Au(L)?zn(L):Ug(t.removed)}catch{Br(_t,L)}}nr(A.afterSanitizeAttributes,L,null)},cR=function ye(L){let ie=null;const pe=Uv(L);for(nr(A.beforeSanitizeShadowDOM,L,null);ie=pe.nextNode();)nr(A.uponSanitizeShadowNode,ie,null),jv(ie),Hv(ie),ie.content instanceof s&&ye(ie.content);nr(A.afterSanitizeShadowDOM,L,null)};return t.sanitize=function(ye){let L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ie=null,pe=null,lt=null,Nt=null;if(Sn=!ye,Sn&&(ye="<!-->"),typeof ye!="string"&&!Yv(ye))if(typeof ye.toString=="function"){if(ye=ye.toString(),typeof ye!="string")throw ss("dirty is not a string, aborting")}else throw ss("toString is not a function");if(!t.isSupported)return ye;if(Ge||Du(L),t.removed=[],typeof ye=="string"&&(te=!1),te){if(ye.nodeName){const rr=ct(ye.nodeName);if(!V[rr]||X[rr])throw ss("root node is forbidden and cannot be sanitized in-place")}}else if(ye instanceof a)ie=$v("<!---->"),pe=ie.ownerDocument.importNode(ye,!0),pe.nodeType===as.element&&pe.nodeName==="BODY"||pe.nodeName==="HTML"?ie=pe:ie.appendChild(pe);else{if(!We&&!Se&&!ke&&ye.indexOf("<")===-1)return w&&rt?w.createHTML(ye):ye;if(ie=$v(ye),!ie)return We?null:rt?_:""}ie&&Re&&zn(ie.firstChild);const _t=Uv(te?ye:ie);for(;lt=_t.nextNode();)jv(lt),Hv(lt),lt.content instanceof s&&cR(lt.content);if(te)return ye;if(We){if(nt)for(Nt=v.call(ie.ownerDocument);ie.firstChild;)Nt.appendChild(ie.firstChild);else Nt=ie;return(G.shadowroot||G.shadowrootmode)&&(Nt=P.call(r,Nt,!0)),Nt}let Vt=ke?ie.outerHTML:ie.innerHTML;return ke&&V["!doctype"]&&ie.ownerDocument&&ie.ownerDocument.doctype&&ie.ownerDocument.doctype.name&&Wt(Zg,ie.ownerDocument.doctype.name)&&(Vt="<!DOCTYPE "+ie.ownerDocument.doctype.name+`>
69
+ `+Vt),Se&&$i([M,F,N],rr=>{Vt=os(Vt,rr," ")}),w&&rt?w.createHTML(Vt):Vt},t.setConfig=function(){let ye=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Du(ye),Ge=!0},t.clearConfig=function(){Pt=null,Ge=!1},t.isValidAttribute=function(ye,L,ie){Pt||Du({});const pe=ct(ye),lt=ct(L);return Vv(pe,lt,ie)},t.addHook=function(ye,L){typeof L=="function"&&rs(A[ye],L)},t.removeHook=function(ye,L){if(L!==void 0){const ie=xM(A[ye],L);return ie===-1?void 0:OM(A[ye],ie,1)[0]}return Ug(A[ye])},t.removeHooks=function(ye){A[ye]=[]},t.removeAllHooks=function(){A=qg()},t}var YM=Kg();const ji="DATE_PICKER",Vi="INPUT",Bi="TEXTAREA",Xg="RADIO",Rl="CHECKBOX",Jg="SELECT",cs="SIGNATURE",jM="CONTENT",VM=(e={})=>{const{field:t={},form:n={},question:r={},index:o=0,disabled:s=!1}=e;if(r.type===jM){const l=YM.sanitize(r.content);return T.jsx("div",{dangerouslySetInnerHTML:{__html:l}})}const{with_label:i}=ia(),a={field:t,form:n,question:r,disabled:s};let c=null;switch(r.type){case Vi:c=T.jsx(kw,{...a});break;case Bi:c=T.jsx(Ow,{...a});break;case Xg:c=T.jsx(N_,{...a});break;case Rl:c=T.jsx(L_,{...a});break;case Jg:c=T.jsx(nk,{...a});break;case ji:c=T.jsx(TA,{...a});break;case cs:c=T.jsx(wM,{...a});break;default:c=null}const u=`question-${r.reference_id}`;return T.jsxs(Ea,{id:u,children:[i&&T.jsx(Ca,{className:"leading-normal",children:T.jsxs("div",{children:[T.jsxs("div",{className:"block",children:[r.label,r.is_required&&T.jsx("span",{className:"text-destructive ml-1",children:"*"})]}),r.sub_label&&T.jsx("div",{className:"mb-1 text-muted-foreground",children:r.sub_label})]})}),r.description&&T.jsx(ww,{children:r.description}),T.jsx(Es,{children:c}),T.jsx(_w,{})]})};function BM({section:e,form:t}){const{with_section_title:n}=ia();return T.jsxs("div",{className:"bq-section space-y-6",children:[n&&T.jsx("h2",{className:"bq-section-title text-xl font-semibold",children:e.title}),e.items?.map(r=>{const o=r.reference_id;return T.jsx(bw,{control:t.control,name:o,render:({field:s})=>{const i={field:s,form:t,question:r};return T.jsx(VM,{...i})}},o)})]})}const Qg=(e,t,n)=>{if(e&&"reportValidity"in e){const r=ae(n,t);e.setCustomValidity(r&&r.message||""),e.reportValidity()}},Wl=(e,t)=>{for(const n in t.fields){const r=t.fields[n];r&&r.ref&&"reportValidity"in r.ref?Qg(r.ref,n,e):r&&r.refs&&r.refs.forEach(o=>Qg(o,n,e))}},ey=(e,t)=>{t.shouldUseNativeValidation&&Wl(e,t);const n={};for(const r in e){const o=ae(t.fields,r),s=Object.assign(e[r]||{},{ref:o&&o.ref});if(HM(t.names||Object.keys(e),r)){const i=Object.assign({},ae(n,r));Be(i,"root",s),Be(n,r,i)}else Be(n,r,s)}return n},HM=(e,t)=>{const n=ty(t);return e.some(r=>ty(r).match(`^${n}\\.\\d+`))};function ty(e){return e.replace(/\]|\[/g,"")}function J(e,t,n){function r(a,c){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:c,constr:i,traits:new Set},enumerable:!1}),a._zod.traits.has(e))return;a._zod.traits.add(e),t(a,c);const u=i.prototype,l=Object.keys(u);for(let f=0;f<l.length;f++){const d=l[f];d in a||(a[d]=u[d].bind(a))}}const o=n?.Parent??Object;class s extends o{}Object.defineProperty(s,"name",{value:e});function i(a){var c;const u=n?.Parent?new s:this;r(u,a),(c=u._zod).deferred??(c.deferred=[]);for(const l of u._zod.deferred)l();return u}return Object.defineProperty(i,"init",{value:r}),Object.defineProperty(i,Symbol.hasInstance,{value:a=>n?.Parent&&a instanceof n.Parent?!0:a?._zod?.traits?.has(e)}),Object.defineProperty(i,"name",{value:e}),i}class _o extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class ny extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const ry={};function Yr(e){return ry}function oy(e){const t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,o])=>t.indexOf(+r)===-1).map(([r,o])=>o)}function zl(e,t){return typeof t=="bigint"?t.toString():t}function Ll(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function $l(e){return e==null}function Ul(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}const sy=Symbol("evaluating");function Ze(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==sy)return r===void 0&&(r=sy,r=n()),r},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function jr(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Sr(...e){const t={};for(const n of e){const r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function iy(e){return JSON.stringify(e)}function ZM(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const ay="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Hi(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const GM=Ll(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function ls(e){if(Hi(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(Hi(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function cy(e){return ls(e)?{...e}:Array.isArray(e)?[...e]:e}const qM=new Set(["string","number","symbol"]);function So(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function kr(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function we(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function KM(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}function XM(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const s=Sr(e._zod.def,{get shape(){const i={};for(const a in t){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&(i[a]=n.shape[a])}return jr(this,"shape",i),i},checks:[]});return kr(e,s)}function JM(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const s=Sr(e._zod.def,{get shape(){const i={...e._zod.def.shape};for(const a in t){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&delete i[a]}return jr(this,"shape",i),i},checks:[]});return kr(e,s)}function QM(e,t){if(!ls(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const s=e._zod.def.shape;for(const i in t)if(Object.getOwnPropertyDescriptor(s,i)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const o=Sr(e._zod.def,{get shape(){const s={...e._zod.def.shape,...t};return jr(this,"shape",s),s}});return kr(e,o)}function eP(e,t){if(!ls(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=Sr(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return jr(this,"shape",r),r}});return kr(e,n)}function tP(e,t){const n=Sr(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return jr(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:[]});return kr(e,n)}function nP(e,t,n){const o=t._zod.def.checks;if(o&&o.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const i=Sr(t._zod.def,{get shape(){const a=t._zod.def.shape,c={...a};if(n)for(const u in n){if(!(u in a))throw new Error(`Unrecognized key: "${u}"`);n[u]&&(c[u]=e?new e({type:"optional",innerType:a[u]}):a[u])}else for(const u in a)c[u]=e?new e({type:"optional",innerType:a[u]}):a[u];return jr(this,"shape",c),c},checks:[]});return kr(t,i)}function rP(e,t,n){const r=Sr(t._zod.def,{get shape(){const o=t._zod.def.shape,s={...o};if(n)for(const i in n){if(!(i in s))throw new Error(`Unrecognized key: "${i}"`);n[i]&&(s[i]=new e({type:"nonoptional",innerType:o[i]}))}else for(const i in o)s[i]=new e({type:"nonoptional",innerType:o[i]});return jr(this,"shape",s),s}});return kr(t,r)}function ko(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function ly(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function Zi(e){return typeof e=="string"?e:e?.message}function Vr(e,t,n){const r={...e,path:e.path??[]};if(!e.message){const o=Zi(e.inst?._zod.def?.error?.(e))??Zi(t?.error?.(e))??Zi(n.customError?.(e))??Zi(n.localeError?.(e))??"Invalid input";r.message=o}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function Yl(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function us(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}const uy=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,zl,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},jl=J("$ZodError",uy),Gi=J("$ZodError",uy,{Parent:Error});function oP(e,t=n=>n.message){const n={},r=[];for(const o of e.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):r.push(t(o));return{formErrors:r,fieldErrors:n}}function sP(e,t=n=>n.message){const n={_errors:[]},r=o=>{for(const s of o.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(i=>r({issues:i}));else if(s.code==="invalid_key")r({issues:s.issues});else if(s.code==="invalid_element")r({issues:s.issues});else if(s.path.length===0)n._errors.push(t(s));else{let i=n,a=0;for(;a<s.path.length;){const c=s.path[a];a===s.path.length-1?(i[c]=i[c]||{_errors:[]},i[c]._errors.push(t(s))):i[c]=i[c]||{_errors:[]},i=i[c],a++}}};return r(e),n}const qi=e=>(t,n,r,o)=>{const s=r?Object.assign(r,{async:!1}):{async:!1},i=t._zod.run({value:n,issues:[]},s);if(i instanceof Promise)throw new _o;if(i.issues.length){const a=new(o?.Err??e)(i.issues.map(c=>Vr(c,s,Yr())));throw ay(a,o?.callee),a}return i.value},iP=qi(Gi),Ki=e=>async(t,n,r,o)=>{const s=r?Object.assign(r,{async:!0}):{async:!0};let i=t._zod.run({value:n,issues:[]},s);if(i instanceof Promise&&(i=await i),i.issues.length){const a=new(o?.Err??e)(i.issues.map(c=>Vr(c,s,Yr())));throw ay(a,o?.callee),a}return i.value},aP=Ki(Gi),Xi=e=>(t,n,r)=>{const o=r?{...r,async:!1}:{async:!1},s=t._zod.run({value:n,issues:[]},o);if(s instanceof Promise)throw new _o;return s.issues.length?{success:!1,error:new(e??jl)(s.issues.map(i=>Vr(i,o,Yr())))}:{success:!0,data:s.value}},cP=Xi(Gi),Ji=e=>async(t,n,r)=>{const o=r?Object.assign(r,{async:!0}):{async:!0};let s=t._zod.run({value:n,issues:[]},o);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(i=>Vr(i,o,Yr())))}:{success:!0,data:s.value}},lP=Ji(Gi),uP=e=>(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return qi(e)(t,n,o)},fP=e=>(t,n,r)=>qi(e)(t,n,r),dP=e=>async(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Ki(e)(t,n,o)},hP=e=>async(t,n,r)=>Ki(e)(t,n,r),pP=e=>(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Xi(e)(t,n,o)},mP=e=>(t,n,r)=>Xi(e)(t,n,r),gP=e=>async(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Ji(e)(t,n,o)},yP=e=>async(t,n,r)=>Ji(e)(t,n,r),vP=/^[cC][^\s-]{8,}$/,bP=/^[0-9a-z]+$/,wP=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,_P=/^[0-9a-vA-V]{20}$/,SP=/^[A-Za-z0-9]{27}$/,kP=/^[a-zA-Z0-9_-]{21}$/,xP=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,OP=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,fy=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,EP=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,CP="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function TP(){return new RegExp(CP,"u")}const DP=/^(?:(?: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])$/,AP=/^(([0-9a-fA-F]{1,4}:){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}|:))$/,MP=/^((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])\/([0-9]|[1-2][0-9]|3[0-2])$/,PP=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,NP=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,dy=/^[A-Za-z0-9_-]*$/,IP=/^\+[1-9]\d{6,14}$/,hy="(?:(?:\\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])))",FP=new RegExp(`^${hy}$`);function py(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function RP(e){return new RegExp(`^${py(e)}$`)}function WP(e){const t=py({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${t}(?:${n.join("|")})`;return new RegExp(`^${hy}T(?:${r})$`)}const zP=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},LP=/^[^A-Z]*$/,$P=/^[^a-z]*$/,sn=J("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),my={number:"number",bigint:"bigint",object:"date"},UP=J("$ZodCheckLessThan",(e,t)=>{sn.init(e,t);const n=my[typeof t.value];e._zod.onattach.push(r=>{const o=r._zod.bag,s=(t.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<s&&(t.inclusive?o.maximum=t.value:o.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),YP=J("$ZodCheckGreaterThan",(e,t)=>{sn.init(e,t);const n=my[typeof t.value];e._zod.onattach.push(r=>{const o=r._zod.bag,s=(t.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>s&&(t.inclusive?o.minimum=t.value:o.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),jP=J("$ZodCheckMaxLength",(e,t)=>{var n;sn.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!$l(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<o&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{const o=r.value;if(o.length<=t.maximum)return;const i=Yl(o);r.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),VP=J("$ZodCheckMinLength",(e,t)=>{var n;sn.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!$l(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{const o=r.value;if(o.length>=t.minimum)return;const i=Yl(o);r.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),BP=J("$ZodCheckLengthEquals",(e,t)=>{var n;sn.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!$l(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag;o.minimum=t.length,o.maximum=t.length,o.length=t.length}),e._zod.check=r=>{const o=r.value,s=o.length;if(s===t.length)return;const i=Yl(o),a=s>t.length;r.issues.push({origin:i,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),Qi=J("$ZodCheckStringFormat",(e,t)=>{var n,r;sn.init(e,t),e._zod.onattach.push(o=>{const s=o._zod.bag;s.format=t.format,t.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),HP=J("$ZodCheckRegex",(e,t)=>{Qi.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),ZP=J("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=LP),Qi.init(e,t)}),GP=J("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=$P),Qi.init(e,t)}),qP=J("$ZodCheckIncludes",(e,t)=>{sn.init(e,t);const n=So(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(o=>{const s=o._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(r)}),e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),KP=J("$ZodCheckStartsWith",(e,t)=>{sn.init(e,t);const n=new RegExp(`^${So(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),XP=J("$ZodCheckEndsWith",(e,t)=>{sn.init(e,t);const n=new RegExp(`.*${So(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}}),JP=J("$ZodCheckOverwrite",(e,t)=>{sn.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class QP{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const r=t.split(`
70
+ `).filter(i=>i),o=Math.min(...r.map(i=>i.length-i.trimStart().length)),s=r.map(i=>i.slice(o)).map(i=>" ".repeat(this.indent*2)+i);for(const i of s)this.content.push(i)}compile(){const t=Function,n=this?.args,o=[...(this?.content??[""]).map(s=>` ${s}`)];return new t(...n,o.join(`
71
+ `))}}const eN={major:4,minor:3,patch:6},ht=J("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=eN;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const o of r)for(const s of o._zod.onattach)s(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const o=(i,a,c)=>{let u=ko(i),l;for(const f of a){if(f._zod.def.when){if(!f._zod.def.when(i))continue}else if(u)continue;const d=i.issues.length,h=f._zod.check(i);if(h instanceof Promise&&c?.async===!1)throw new _o;if(l||h instanceof Promise)l=(l??Promise.resolve()).then(async()=>{await h,i.issues.length!==d&&(u||(u=ko(i,d)))});else{if(i.issues.length===d)continue;u||(u=ko(i,d))}}return l?l.then(()=>i):i},s=(i,a,c)=>{if(ko(i))return i.aborted=!0,i;const u=o(a,r,c);if(u instanceof Promise){if(c.async===!1)throw new _o;return u.then(l=>e._zod.parse(l,c))}return e._zod.parse(u,c)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction==="backward"){const u=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return u instanceof Promise?u.then(l=>s(l,i,a)):s(u,i,a)}const c=e._zod.parse(i,a);if(c instanceof Promise){if(a.async===!1)throw new _o;return c.then(u=>o(u,r,a))}return o(c,r,a)}}Ze(e,"~standard",()=>({validate:o=>{try{const s=cP(e,o);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return lP(e,o).then(i=>i.success?{value:i.data}:{issues:i.error?.issues})}},vendor:"zod",version:1}))}),Vl=J("$ZodString",(e,t)=>{ht.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??zP(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),at=J("$ZodStringFormat",(e,t)=>{Qi.init(e,t),Vl.init(e,t)}),tN=J("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=OP),at.init(e,t)}),nN=J("$ZodUUID",(e,t)=>{if(t.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=fy(r))}else t.pattern??(t.pattern=fy());at.init(e,t)}),rN=J("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=EP),at.init(e,t)}),oN=J("$ZodURL",(e,t)=>{at.init(e,t),e._zod.check=n=>{try{const r=n.value.trim(),o=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=o.href:n.value=r;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),sN=J("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=TP()),at.init(e,t)}),iN=J("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=kP),at.init(e,t)}),aN=J("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=vP),at.init(e,t)}),cN=J("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=bP),at.init(e,t)}),lN=J("$ZodULID",(e,t)=>{t.pattern??(t.pattern=wP),at.init(e,t)}),uN=J("$ZodXID",(e,t)=>{t.pattern??(t.pattern=_P),at.init(e,t)}),fN=J("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=SP),at.init(e,t)}),dN=J("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=WP(t)),at.init(e,t)}),hN=J("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=FP),at.init(e,t)}),pN=J("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=RP(t)),at.init(e,t)}),mN=J("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=xP),at.init(e,t)}),gN=J("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=DP),at.init(e,t),e._zod.bag.format="ipv4"}),yN=J("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=AP),at.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),vN=J("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=MP),at.init(e,t)}),bN=J("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=PP),at.init(e,t),e._zod.check=n=>{const r=n.value.split("/");try{if(r.length!==2)throw new Error;const[o,s]=r;if(!s)throw new Error;const i=Number(s);if(`${i}`!==s)throw new Error;if(i<0||i>128)throw new Error;new URL(`http://[${o}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function gy(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const wN=J("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=NP),at.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{gy(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function _N(e){if(!dy.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return gy(n)}const SN=J("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=dy),at.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{_N(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),kN=J("$ZodE164",(e,t)=>{t.pattern??(t.pattern=IP),at.init(e,t)});function xN(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[r]=n;if(!r)return!1;const o=JSON.parse(atob(r));return!("typ"in o&&o?.typ!=="JWT"||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}}const ON=J("$ZodJWT",(e,t)=>{at.init(e,t),e._zod.check=n=>{xN(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),EN=J("$ZodAny",(e,t)=>{ht.init(e,t),e._zod.parse=n=>n}),CN=J("$ZodUnknown",(e,t)=>{ht.init(e,t),e._zod.parse=n=>n}),TN=J("$ZodNever",(e,t)=>{ht.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)}),DN=J("$ZodDate",(e,t)=>{ht.init(e,t),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=new Date(n.value)}catch{}const o=n.value,s=o instanceof Date;return s&&!Number.isNaN(o.getTime())||n.issues.push({expected:"date",code:"invalid_type",input:o,...s?{received:"Invalid Date"}:{},inst:e}),n}});function yy(e,t,n){e.issues.length&&t.issues.push(...ly(n,e.issues)),t.value[n]=e.value}const AN=J("$ZodArray",(e,t)=>{ht.init(e,t),e._zod.parse=(n,r)=>{const o=n.value;if(!Array.isArray(o))return n.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),n;n.value=Array(o.length);const s=[];for(let i=0;i<o.length;i++){const a=o[i],c=t.element._zod.run({value:a,issues:[]},r);c instanceof Promise?s.push(c.then(u=>yy(u,n,i))):yy(c,n,i)}return s.length?Promise.all(s).then(()=>n):n}});function ea(e,t,n,r,o){if(e.issues.length){if(o&&!(n in r))return;t.issues.push(...ly(n,e.issues))}e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function vy(e){const t=Object.keys(e.shape);for(const r of t)if(!e.shape?.[r]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${r}": expected a Zod schema`);const n=KM(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function by(e,t,n,r,o,s){const i=[],a=o.keySet,c=o.catchall._zod,u=c.def.type,l=c.optout==="optional";for(const f in t){if(a.has(f))continue;if(u==="never"){i.push(f);continue}const d=c.run({value:t[f],issues:[]},r);d instanceof Promise?e.push(d.then(h=>ea(h,n,f,t,l))):ea(d,n,f,t,l)}return i.length&&n.issues.push({code:"unrecognized_keys",keys:i,input:t,inst:s}),e.length?Promise.all(e).then(()=>n):n}const MN=J("$ZodObject",(e,t)=>{if(ht.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const a=t.shape;Object.defineProperty(t,"shape",{get:()=>{const c={...a};return Object.defineProperty(t,"shape",{value:c}),c}})}const r=Ll(()=>vy(t));Ze(e._zod,"propValues",()=>{const a=t.shape,c={};for(const u in a){const l=a[u]._zod;if(l.values){c[u]??(c[u]=new Set);for(const f of l.values)c[u].add(f)}}return c});const o=Hi,s=t.catchall;let i;e._zod.parse=(a,c)=>{i??(i=r.value);const u=a.value;if(!o(u))return a.issues.push({expected:"object",code:"invalid_type",input:u,inst:e}),a;a.value={};const l=[],f=i.shape;for(const d of i.keys){const h=f[d],m=h._zod.optout==="optional",p=h._zod.run({value:u[d],issues:[]},c);p instanceof Promise?l.push(p.then(y=>ea(y,a,d,u,m))):ea(p,a,d,u,m)}return s?by(l,u,a,c,r.value,e):l.length?Promise.all(l).then(()=>a):a}}),PN=J("$ZodObjectJIT",(e,t)=>{MN.init(e,t);const n=e._zod.parse,r=Ll(()=>vy(t)),o=d=>{const h=new QP(["shape","payload","ctx"]),m=r.value,p=O=>{const w=iy(O);return`shape[${w}]._zod.run({ value: input[${w}], issues: [] }, ctx)`};h.write("const input = payload.value;");const y=Object.create(null);let g=0;for(const O of m.keys)y[O]=`key_${g++}`;h.write("const newResult = {};");for(const O of m.keys){const w=y[O],_=iy(O),I=d[O]?._zod?.optout==="optional";h.write(`const ${w} = ${p(O)};`),I?h.write(`
72
+ if (${w}.issues.length) {
73
+ if (${_} in input) {
74
+ payload.issues = payload.issues.concat(${w}.issues.map(iss => ({
75
+ ...iss,
76
+ path: iss.path ? [${_}, ...iss.path] : [${_}]
77
+ })));
78
+ }
79
+ }
80
+
81
+ if (${w}.value === undefined) {
82
+ if (${_} in input) {
83
+ newResult[${_}] = undefined;
84
+ }
85
+ } else {
86
+ newResult[${_}] = ${w}.value;
87
+ }
88
+
89
+ `):h.write(`
90
+ if (${w}.issues.length) {
91
+ payload.issues = payload.issues.concat(${w}.issues.map(iss => ({
92
+ ...iss,
93
+ path: iss.path ? [${_}, ...iss.path] : [${_}]
94
+ })));
95
+ }
96
+
97
+ if (${w}.value === undefined) {
98
+ if (${_} in input) {
99
+ newResult[${_}] = undefined;
100
+ }
101
+ } else {
102
+ newResult[${_}] = ${w}.value;
103
+ }
104
+
105
+ `)}h.write("payload.value = newResult;"),h.write("return payload;");const C=h.compile();return(O,w)=>C(d,O,w)};let s;const i=Hi,a=!ry.jitless,u=a&&GM.value,l=t.catchall;let f;e._zod.parse=(d,h)=>{f??(f=r.value);const m=d.value;return i(m)?a&&u&&h?.async===!1&&h.jitless!==!0?(s||(s=o(t.shape)),d=s(d,h),l?by([],m,d,h,f,e):d):n(d,h):(d.issues.push({expected:"object",code:"invalid_type",input:m,inst:e}),d)}});function wy(e,t,n,r){for(const s of e)if(s.issues.length===0)return t.value=s.value,t;const o=e.filter(s=>!ko(s));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(s=>s.issues.map(i=>Vr(i,r,Yr())))}),t)}const NN=J("$ZodUnion",(e,t)=>{ht.init(e,t),Ze(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),Ze(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),Ze(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),Ze(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){const o=t.options.map(s=>s._zod.pattern);return new RegExp(`^(${o.map(s=>Ul(s.source)).join("|")})$`)}});const n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(o,s)=>{if(n)return r(o,s);let i=!1;const a=[];for(const c of t.options){const u=c._zod.run({value:o.value,issues:[]},s);if(u instanceof Promise)a.push(u),i=!0;else{if(u.issues.length===0)return u;a.push(u)}}return i?Promise.all(a).then(c=>wy(c,o,e,s)):wy(a,o,e,s)}}),IN=J("$ZodIntersection",(e,t)=>{ht.init(e,t),e._zod.parse=(n,r)=>{const o=n.value,s=t.left._zod.run({value:o,issues:[]},r),i=t.right._zod.run({value:o,issues:[]},r);return s instanceof Promise||i instanceof Promise?Promise.all([s,i]).then(([c,u])=>_y(n,c,u)):_y(n,s,i)}});function Bl(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(ls(e)&&ls(t)){const n=Object.keys(t),r=Object.keys(e).filter(s=>n.indexOf(s)!==-1),o={...e,...t};for(const s of r){const i=Bl(e[s],t[s]);if(!i.valid)return{valid:!1,mergeErrorPath:[s,...i.mergeErrorPath]};o[s]=i.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const o=e[r],s=t[r],i=Bl(o,s);if(!i.valid)return{valid:!1,mergeErrorPath:[r,...i.mergeErrorPath]};n.push(i.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function _y(e,t,n){const r=new Map;let o;for(const a of t.issues)if(a.code==="unrecognized_keys"){o??(o=a);for(const c of a.keys)r.has(c)||r.set(c,{}),r.get(c).l=!0}else e.issues.push(a);for(const a of n.issues)if(a.code==="unrecognized_keys")for(const c of a.keys)r.has(c)||r.set(c,{}),r.get(c).r=!0;else e.issues.push(a);const s=[...r].filter(([,a])=>a.l&&a.r).map(([a])=>a);if(s.length&&o&&e.issues.push({...o,keys:s}),ko(e))return e;const i=Bl(t.value,n.value);if(!i.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);return e.value=i.data,e}const FN=J("$ZodEnum",(e,t)=>{ht.init(e,t);const n=oy(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(o=>qM.has(typeof o)).map(o=>typeof o=="string"?So(o):o.toString()).join("|")})$`),e._zod.parse=(o,s)=>{const i=o.value;return r.has(i)||o.issues.push({code:"invalid_value",values:n,input:i,inst:e}),o}}),RN=J("$ZodLiteral",(e,t)=>{if(ht.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const n=new Set(t.values);e._zod.values=n,e._zod.pattern=new RegExp(`^(${t.values.map(r=>typeof r=="string"?So(r):r?So(r.toString()):String(r)).join("|")})$`),e._zod.parse=(r,o)=>{const s=r.value;return n.has(s)||r.issues.push({code:"invalid_value",values:t.values,input:s,inst:e}),r}}),WN=J("$ZodTransform",(e,t)=>{ht.init(e,t),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new ny(e.constructor.name);const o=t.transform(n.value,n);if(r.async)return(o instanceof Promise?o:Promise.resolve(o)).then(i=>(n.value=i,n));if(o instanceof Promise)throw new _o;return n.value=o,n}});function Sy(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const ky=J("$ZodOptional",(e,t)=>{ht.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Ze(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Ze(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Ul(n.source)})?$`):void 0}),e._zod.parse=(n,r)=>{if(t.innerType._zod.optin==="optional"){const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(s=>Sy(s,n.value)):Sy(o,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,r)}}),zN=J("$ZodExactOptional",(e,t)=>{ky.init(e,t),Ze(e._zod,"values",()=>t.innerType._zod.values),Ze(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,r)=>t.innerType._zod.run(n,r)}),LN=J("$ZodNullable",(e,t)=>{ht.init(e,t),Ze(e._zod,"optin",()=>t.innerType._zod.optin),Ze(e._zod,"optout",()=>t.innerType._zod.optout),Ze(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Ul(n.source)}|null)$`):void 0}),Ze(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,r)=>n.value===null?n:t.innerType._zod.run(n,r)}),$N=J("$ZodDefault",(e,t)=>{ht.init(e,t),e._zod.optin="optional",Ze(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);if(n.value===void 0)return n.value=t.defaultValue,n;const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(s=>xy(s,t)):xy(o,t)}});function xy(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const UN=J("$ZodPrefault",(e,t)=>{ht.init(e,t),e._zod.optin="optional",Ze(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>(r.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,r))}),YN=J("$ZodNonOptional",(e,t)=>{ht.init(e,t),Ze(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(r=>r!==void 0)):void 0}),e._zod.parse=(n,r)=>{const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(s=>Oy(s,e)):Oy(o,e)}});function Oy(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const jN=J("$ZodCatch",(e,t)=>{ht.init(e,t),Ze(e._zod,"optin",()=>t.innerType._zod.optin),Ze(e._zod,"optout",()=>t.innerType._zod.optout),Ze(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(s=>(n.value=s.value,s.issues.length&&(n.value=t.catchValue({...n,error:{issues:s.issues.map(i=>Vr(i,r,Yr()))},input:n.value}),n.issues=[]),n)):(n.value=o.value,o.issues.length&&(n.value=t.catchValue({...n,error:{issues:o.issues.map(s=>Vr(s,r,Yr()))},input:n.value}),n.issues=[]),n)}}),VN=J("$ZodPipe",(e,t)=>{ht.init(e,t),Ze(e._zod,"values",()=>t.in._zod.values),Ze(e._zod,"optin",()=>t.in._zod.optin),Ze(e._zod,"optout",()=>t.out._zod.optout),Ze(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,r)=>{if(r.direction==="backward"){const s=t.out._zod.run(n,r);return s instanceof Promise?s.then(i=>ta(i,t.in,r)):ta(s,t.in,r)}const o=t.in._zod.run(n,r);return o instanceof Promise?o.then(s=>ta(s,t.out,r)):ta(o,t.out,r)}});function ta(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const BN=J("$ZodReadonly",(e,t)=>{ht.init(e,t),Ze(e._zod,"propValues",()=>t.innerType._zod.propValues),Ze(e._zod,"values",()=>t.innerType._zod.values),Ze(e._zod,"optin",()=>t.innerType?._zod?.optin),Ze(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(Ey):Ey(o)}});function Ey(e){return e.value=Object.freeze(e.value),e}const HN=J("$ZodCustom",(e,t)=>{sn.init(e,t),ht.init(e,t),e._zod.parse=(n,r)=>n,e._zod.check=n=>{const r=n.value,o=t.fn(r);if(o instanceof Promise)return o.then(s=>Cy(s,n,r,e));Cy(o,n,r,e)}});function Cy(e,t,n,r){if(!e){const o={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(o.params=r._zod.def.params),t.issues.push(us(o))}}var Ty;class ZN{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const r=n[0];return this._map.set(t,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const r={...this.get(n)??{}};delete r.id;const o={...r,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function GN(){return new ZN}(Ty=globalThis).__zod_globalRegistry??(Ty.__zod_globalRegistry=GN());const fs=globalThis.__zod_globalRegistry;function qN(e,t){return new e({type:"string",...we(t)})}function KN(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...we(t)})}function Dy(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...we(t)})}function XN(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...we(t)})}function JN(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...we(t)})}function QN(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...we(t)})}function e2(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...we(t)})}function t2(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...we(t)})}function n2(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...we(t)})}function r2(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...we(t)})}function o2(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...we(t)})}function s2(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...we(t)})}function i2(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...we(t)})}function a2(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...we(t)})}function c2(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...we(t)})}function l2(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...we(t)})}function u2(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...we(t)})}function f2(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...we(t)})}function d2(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...we(t)})}function h2(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...we(t)})}function p2(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...we(t)})}function m2(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...we(t)})}function g2(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...we(t)})}function y2(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...we(t)})}function v2(e,t){return new e({type:"string",format:"date",check:"string_format",...we(t)})}function b2(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...we(t)})}function w2(e,t){return new e({type:"string",format:"duration",check:"string_format",...we(t)})}function _2(e){return new e({type:"any"})}function S2(e){return new e({type:"unknown"})}function k2(e,t){return new e({type:"never",...we(t)})}function x2(e,t){return new e({type:"date",...we(t)})}function O2(e,t){return new UP({check:"less_than",...we(t),value:e,inclusive:!0})}function E2(e,t){return new YP({check:"greater_than",...we(t),value:e,inclusive:!0})}function Ay(e,t){return new jP({check:"max_length",...we(t),maximum:e})}function na(e,t){return new VP({check:"min_length",...we(t),minimum:e})}function My(e,t){return new BP({check:"length_equals",...we(t),length:e})}function C2(e,t){return new HP({check:"string_format",format:"regex",...we(t),pattern:e})}function T2(e){return new ZP({check:"string_format",format:"lowercase",...we(e)})}function D2(e){return new GP({check:"string_format",format:"uppercase",...we(e)})}function A2(e,t){return new qP({check:"string_format",format:"includes",...we(t),includes:e})}function M2(e,t){return new KP({check:"string_format",format:"starts_with",...we(t),prefix:e})}function P2(e,t){return new XP({check:"string_format",format:"ends_with",...we(t),suffix:e})}function xo(e){return new JP({check:"overwrite",tx:e})}function N2(e){return xo(t=>t.normalize(e))}function I2(){return xo(e=>e.trim())}function F2(){return xo(e=>e.toLowerCase())}function R2(){return xo(e=>e.toUpperCase())}function W2(){return xo(e=>ZM(e))}function z2(e,t,n){return new e({type:"array",element:t,...we(n)})}function L2(e,t,n){return new e({type:"custom",check:"custom",fn:t,...we(n)})}function $2(e){const t=U2(n=>(n.addIssue=r=>{if(typeof r=="string")n.issues.push(us(r,n.value,t._zod.def));else{const o=r;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=n.value),o.inst??(o.inst=t),o.continue??(o.continue=!t._zod.def.abort),n.issues.push(us(o))}},e(n.value,n)));return t}function U2(e,t){const n=new sn({check:"custom",...we(t)});return n._zod.check=e,n}function Py(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??fs,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function Et(e,t,n={path:[],schemaPath:[]}){var r;const o=e._zod.def,s=t.seen.get(e);if(s)return s.count++,n.schemaPath.includes(e)&&(s.cycle=n.path),s.schema;const i={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,i);const a=e._zod.toJSONSchema?.();if(a)i.schema=a;else{const l={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,i.schema,l);else{const d=i.schema,h=t.processors[o.type];if(!h)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);h(e,t,d,l)}const f=e._zod.parent;f&&(i.ref||(i.ref=f),Et(f,t,l),t.seen.get(f).isParent=!0)}const c=t.metadataRegistry.get(e);return c&&Object.assign(i.schema,c),t.io==="input"&&Lt(e)&&(delete i.schema.examples,delete i.schema.default),t.io==="input"&&i.schema._prefault&&((r=i.schema).default??(r.default=i.schema._prefault)),delete i.schema._prefault,t.seen.get(e).schema}function Ny(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=new Map;for(const i of e.seen.entries()){const a=e.metadataRegistry.get(i[0])?.id;if(a){const c=r.get(a);if(c&&c!==i[0])throw new Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(a,i[0])}}const o=i=>{const a=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const f=e.external.registry.get(i[0])?.id,d=e.external.uri??(m=>m);if(f)return{ref:d(f)};const h=i[1].defId??i[1].schema.id??`schema${e.counter++}`;return i[1].defId=h,{defId:h,ref:`${d("__shared")}#/${a}/${h}`}}if(i[1]===n)return{ref:"#"};const u=`#/${a}/`,l=i[1].schema.id??`__schema${e.counter++}`;return{defId:l,ref:u+l}},s=i=>{if(i[1].schema.$ref)return;const a=i[1],{ref:c,defId:u}=o(i);a.def={...a.schema},u&&(a.defId=u);const l=a.schema;for(const f in l)delete l[f];l.$ref=c};if(e.cycles==="throw")for(const i of e.seen.entries()){const a=i[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
106
+
107
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const i of e.seen.entries()){const a=i[1];if(t===i[0]){s(i);continue}if(e.external){const u=e.external.registry.get(i[0])?.id;if(t!==i[0]&&u){s(i);continue}}if(e.metadataRegistry.get(i[0])?.id){s(i);continue}if(a.cycle){s(i);continue}if(a.count>1&&e.reused==="ref"){s(i);continue}}}function Iy(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=i=>{const a=e.seen.get(i);if(a.ref===null)return;const c=a.def??a.schema,u={...c},l=a.ref;if(a.ref=null,l){r(l);const d=e.seen.get(l),h=d.schema;if(h.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(c.allOf=c.allOf??[],c.allOf.push(h)):Object.assign(c,h),Object.assign(c,u),i._zod.parent===l)for(const p in c)p==="$ref"||p==="allOf"||p in u||delete c[p];if(h.$ref&&d.def)for(const p in c)p==="$ref"||p==="allOf"||p in d.def&&JSON.stringify(c[p])===JSON.stringify(d.def[p])&&delete c[p]}const f=i._zod.parent;if(f&&f!==l){r(f);const d=e.seen.get(f);if(d?.schema.$ref&&(c.$ref=d.schema.$ref,d.def))for(const h in c)h==="$ref"||h==="allOf"||h in d.def&&JSON.stringify(c[h])===JSON.stringify(d.def[h])&&delete c[h]}e.override({zodSchema:i,jsonSchema:c,path:a.path??[]})};for(const i of[...e.seen.entries()].reverse())r(i[0]);const o={};if(e.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const i=e.external.registry.get(t)?.id;if(!i)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(i)}Object.assign(o,n.def??n.schema);const s=e.external?.defs??{};for(const i of e.seen.entries()){const a=i[1];a.def&&a.defId&&(s[a.defId]=a.def)}e.external||Object.keys(s).length>0&&(e.target==="draft-2020-12"?o.$defs=s:o.definitions=s);try{const i=JSON.parse(JSON.stringify(o));return Object.defineProperty(i,"~standard",{value:{...t["~standard"],jsonSchema:{input:ra(t,"input",e.processors),output:ra(t,"output",e.processors)}},enumerable:!1,writable:!1}),i}catch{throw new Error("Error converting schema to JSON.")}}function Lt(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return Lt(r.element,n);if(r.type==="set")return Lt(r.valueType,n);if(r.type==="lazy")return Lt(r.getter(),n);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault")return Lt(r.innerType,n);if(r.type==="intersection")return Lt(r.left,n)||Lt(r.right,n);if(r.type==="record"||r.type==="map")return Lt(r.keyType,n)||Lt(r.valueType,n);if(r.type==="pipe")return Lt(r.in,n)||Lt(r.out,n);if(r.type==="object"){for(const o in r.shape)if(Lt(r.shape[o],n))return!0;return!1}if(r.type==="union"){for(const o of r.options)if(Lt(o,n))return!0;return!1}if(r.type==="tuple"){for(const o of r.items)if(Lt(o,n))return!0;return!!(r.rest&&Lt(r.rest,n))}return!1}const Y2=(e,t={})=>n=>{const r=Py({...n,processors:t});return Et(e,r),Ny(r,e),Iy(r,e)},ra=(e,t,n={})=>r=>{const{libraryOptions:o,target:s}=r??{},i=Py({...o??{},target:s,io:t,processors:n});return Et(e,i),Ny(i,e),Iy(i,e)},j2={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},V2=(e,t,n,r)=>{const o=n;o.type="string";const{minimum:s,maximum:i,format:a,patterns:c,contentEncoding:u}=e._zod.bag;if(typeof s=="number"&&(o.minLength=s),typeof i=="number"&&(o.maxLength=i),a&&(o.format=j2[a]??a,o.format===""&&delete o.format,a==="time"&&delete o.format),u&&(o.contentEncoding=u),c&&c.size>0){const l=[...c];l.length===1?o.pattern=l[0].source:l.length>1&&(o.allOf=[...l.map(f=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:f.source}))])}},B2=(e,t,n,r)=>{n.not={}},H2=(e,t,n,r)=>{},Z2=(e,t,n,r)=>{},G2=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},q2=(e,t,n,r)=>{const o=e._zod.def,s=oy(o.entries);s.every(i=>typeof i=="number")&&(n.type="number"),s.every(i=>typeof i=="string")&&(n.type="string"),n.enum=s},K2=(e,t,n,r)=>{const o=e._zod.def,s=[];for(const i of o.values)if(i===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof i=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");s.push(Number(i))}else s.push(i);if(s.length!==0)if(s.length===1){const i=s[0];n.type=i===null?"null":typeof i,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[i]:n.const=i}else s.every(i=>typeof i=="number")&&(n.type="number"),s.every(i=>typeof i=="string")&&(n.type="string"),s.every(i=>typeof i=="boolean")&&(n.type="boolean"),s.every(i=>i===null)&&(n.type="null"),n.enum=s},X2=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},J2=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},Q2=(e,t,n,r)=>{const o=n,s=e._zod.def,{minimum:i,maximum:a}=e._zod.bag;typeof i=="number"&&(o.minItems=i),typeof a=="number"&&(o.maxItems=a),o.type="array",o.items=Et(s.element,t,{...r,path:[...r.path,"items"]})},eI=(e,t,n,r)=>{const o=n,s=e._zod.def;o.type="object",o.properties={};const i=s.shape;for(const u in i)o.properties[u]=Et(i[u],t,{...r,path:[...r.path,"properties",u]});const a=new Set(Object.keys(i)),c=new Set([...a].filter(u=>{const l=s.shape[u]._zod;return t.io==="input"?l.optin===void 0:l.optout===void 0}));c.size>0&&(o.required=Array.from(c)),s.catchall?._zod.def.type==="never"?o.additionalProperties=!1:s.catchall?s.catchall&&(o.additionalProperties=Et(s.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(o.additionalProperties=!1)},tI=(e,t,n,r)=>{const o=e._zod.def,s=o.inclusive===!1,i=o.options.map((a,c)=>Et(a,t,{...r,path:[...r.path,s?"oneOf":"anyOf",c]}));s?n.oneOf=i:n.anyOf=i},nI=(e,t,n,r)=>{const o=e._zod.def,s=Et(o.left,t,{...r,path:[...r.path,"allOf",0]}),i=Et(o.right,t,{...r,path:[...r.path,"allOf",1]}),a=u=>"allOf"in u&&Object.keys(u).length===1,c=[...a(s)?s.allOf:[s],...a(i)?i.allOf:[i]];n.allOf=c},rI=(e,t,n,r)=>{const o=e._zod.def,s=Et(o.innerType,t,r),i=t.seen.get(e);t.target==="openapi-3.0"?(i.ref=o.innerType,n.nullable=!0):n.anyOf=[s,{type:"null"}]},oI=(e,t,n,r)=>{const o=e._zod.def;Et(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType},sI=(e,t,n,r)=>{const o=e._zod.def;Et(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType,n.default=JSON.parse(JSON.stringify(o.defaultValue))},iI=(e,t,n,r)=>{const o=e._zod.def;Et(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(o.defaultValue)))},aI=(e,t,n,r)=>{const o=e._zod.def;Et(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType;let i;try{i=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=i},cI=(e,t,n,r)=>{const o=e._zod.def,s=t.io==="input"?o.in._zod.def.type==="transform"?o.out:o.in:o.out;Et(s,t,r);const i=t.seen.get(e);i.ref=s},lI=(e,t,n,r)=>{const o=e._zod.def;Et(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType,n.readOnly=!0},Fy=(e,t,n,r)=>{const o=e._zod.def;Et(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType};function Ry(e,t){try{var n=e()}catch(r){return t(r)}return n&&n.then?n.then(void 0,t):n}function uI(e,t){for(var n={};e.length;){var r=e[0],o=r.code,s=r.message,i=r.path.join(".");if(!n[i])if("unionErrors"in r){var a=r.unionErrors[0].errors[0];n[i]={message:a.message,type:a.code}}else n[i]={message:s,type:o};if("unionErrors"in r&&r.unionErrors.forEach(function(l){return l.errors.forEach(function(f){return e.push(f)})}),t){var c=n[i].types,u=c&&c[r.code];n[i]=ga(i,t,n,o,u?[].concat(u,r.message):r.message)}e.shift()}return n}function fI(e,t){for(var n={};e.length;){var r=e[0],o=r.code,s=r.message,i=r.path.join(".");if(!n[i])if(r.code==="invalid_union"&&r.errors.length>0){var a=r.errors[0][0];n[i]={message:a.message,type:a.code}}else n[i]={message:s,type:o};if(r.code==="invalid_union"&&r.errors.forEach(function(l){return l.forEach(function(f){return e.push(f)})}),t){var c=n[i].types,u=c&&c[r.code];n[i]=ga(i,t,n,o,u?[].concat(u,r.message):r.message)}e.shift()}return n}function dI(e,t,n){if(n===void 0&&(n={}),(function(r){return"_def"in r&&typeof r._def=="object"&&"typeName"in r._def})(e))return function(r,o,s){try{return Promise.resolve(Ry(function(){return Promise.resolve(e[n.mode==="sync"?"parse":"parseAsync"](r,t)).then(function(i){return s.shouldUseNativeValidation&&Wl({},s),{errors:{},values:n.raw?Object.assign({},r):i}})},function(i){if((function(a){return Array.isArray(a?.issues)})(i))return{values:{},errors:ey(uI(i.errors,!s.shouldUseNativeValidation&&s.criteriaMode==="all"),s)};throw i}))}catch(i){return Promise.reject(i)}};if((function(r){return"_zod"in r&&typeof r._zod=="object"})(e))return function(r,o,s){try{return Promise.resolve(Ry(function(){return Promise.resolve((n.mode==="sync"?iP:aP)(e,r,t)).then(function(i){return s.shouldUseNativeValidation&&Wl({},s),{errors:{},values:n.raw?Object.assign({},r):i}})},function(i){if((function(a){return a instanceof jl})(i))return{values:{},errors:ey(fI(i.issues,!s.shouldUseNativeValidation&&s.criteriaMode==="all"),s)};throw i}))}catch(i){return Promise.reject(i)}};throw new Error("Invalid input: not a Zod schema")}const hI=J("ZodISODateTime",(e,t)=>{dN.init(e,t),ft.init(e,t)});function pI(e){return y2(hI,e)}const mI=J("ZodISODate",(e,t)=>{hN.init(e,t),ft.init(e,t)});function gI(e){return v2(mI,e)}const yI=J("ZodISOTime",(e,t)=>{pN.init(e,t),ft.init(e,t)});function vI(e){return b2(yI,e)}const bI=J("ZodISODuration",(e,t)=>{mN.init(e,t),ft.init(e,t)});function wI(e){return w2(bI,e)}const an=J("ZodError",(e,t)=>{jl.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>sP(e,n)},flatten:{value:n=>oP(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,zl,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,zl,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),_I=qi(an),SI=Ki(an),kI=Xi(an),xI=Ji(an),OI=uP(an),EI=fP(an),CI=dP(an),TI=hP(an),DI=pP(an),AI=mP(an),MI=gP(an),PI=yP(an),pt=J("ZodType",(e,t)=>(ht.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:ra(e,"input"),output:ra(e,"output")}}),e.toJSONSchema=Y2(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(Sr(t,{checks:[...t.checks??[],...n.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0}),e.with=e.check,e.clone=(n,r)=>kr(e,n,r),e.brand=()=>e,e.register=((n,r)=>(n.add(e,r),e)),e.parse=(n,r)=>_I(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>kI(e,n,r),e.parseAsync=async(n,r)=>SI(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>xI(e,n,r),e.spa=e.safeParseAsync,e.encode=(n,r)=>OI(e,n,r),e.decode=(n,r)=>EI(e,n,r),e.encodeAsync=async(n,r)=>CI(e,n,r),e.decodeAsync=async(n,r)=>TI(e,n,r),e.safeEncode=(n,r)=>DI(e,n,r),e.safeDecode=(n,r)=>AI(e,n,r),e.safeEncodeAsync=async(n,r)=>MI(e,n,r),e.safeDecodeAsync=async(n,r)=>PI(e,n,r),e.refine=(n,r)=>e.check(DF(n,r)),e.superRefine=n=>e.check(AF(n)),e.overwrite=n=>e.check(xo(n)),e.optional=()=>Vy(e),e.exactOptional=()=>gF(e),e.nullable=()=>By(e),e.nullish=()=>Vy(By(e)),e.nonoptional=n=>SF(e,n),e.array=()=>Uy(e),e.or=n=>aF([e,n]),e.and=n=>lF(e,n),e.transform=n=>Zy(e,pF(n)),e.default=n=>bF(e,n),e.prefault=n=>_F(e,n),e.catch=n=>xF(e,n),e.pipe=n=>Zy(e,n),e.readonly=()=>CF(e),e.describe=n=>{const r=e.clone();return fs.add(r,{description:n}),r},Object.defineProperty(e,"description",{get(){return fs.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return fs.get(e);const r=e.clone();return fs.add(r,n[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),Wy=J("_ZodString",(e,t)=>{Vl.init(e,t),pt.init(e,t),e._zod.processJSONSchema=(r,o,s)=>V2(e,r,o);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...r)=>e.check(C2(...r)),e.includes=(...r)=>e.check(A2(...r)),e.startsWith=(...r)=>e.check(M2(...r)),e.endsWith=(...r)=>e.check(P2(...r)),e.min=(...r)=>e.check(na(...r)),e.max=(...r)=>e.check(Ay(...r)),e.length=(...r)=>e.check(My(...r)),e.nonempty=(...r)=>e.check(na(1,...r)),e.lowercase=r=>e.check(T2(r)),e.uppercase=r=>e.check(D2(r)),e.trim=()=>e.check(I2()),e.normalize=(...r)=>e.check(N2(...r)),e.toLowerCase=()=>e.check(F2()),e.toUpperCase=()=>e.check(R2()),e.slugify=()=>e.check(W2())}),NI=J("ZodString",(e,t)=>{Vl.init(e,t),Wy.init(e,t),e.email=n=>e.check(KN(II,n)),e.url=n=>e.check(t2(FI,n)),e.jwt=n=>e.check(g2(KI,n)),e.emoji=n=>e.check(n2(RI,n)),e.guid=n=>e.check(Dy(Ly,n)),e.uuid=n=>e.check(XN(oa,n)),e.uuidv4=n=>e.check(JN(oa,n)),e.uuidv6=n=>e.check(QN(oa,n)),e.uuidv7=n=>e.check(e2(oa,n)),e.nanoid=n=>e.check(r2(WI,n)),e.guid=n=>e.check(Dy(Ly,n)),e.cuid=n=>e.check(o2(zI,n)),e.cuid2=n=>e.check(s2(LI,n)),e.ulid=n=>e.check(i2($I,n)),e.base64=n=>e.check(h2(ZI,n)),e.base64url=n=>e.check(p2(GI,n)),e.xid=n=>e.check(a2(UI,n)),e.ksuid=n=>e.check(c2(YI,n)),e.ipv4=n=>e.check(l2(jI,n)),e.ipv6=n=>e.check(u2(VI,n)),e.cidrv4=n=>e.check(f2(BI,n)),e.cidrv6=n=>e.check(d2(HI,n)),e.e164=n=>e.check(m2(qI,n)),e.datetime=n=>e.check(pI(n)),e.date=n=>e.check(gI(n)),e.time=n=>e.check(vI(n)),e.duration=n=>e.check(wI(n))});function zy(e){return qN(NI,e)}const ft=J("ZodStringFormat",(e,t)=>{at.init(e,t),Wy.init(e,t)}),II=J("ZodEmail",(e,t)=>{rN.init(e,t),ft.init(e,t)}),Ly=J("ZodGUID",(e,t)=>{tN.init(e,t),ft.init(e,t)}),oa=J("ZodUUID",(e,t)=>{nN.init(e,t),ft.init(e,t)}),FI=J("ZodURL",(e,t)=>{oN.init(e,t),ft.init(e,t)}),RI=J("ZodEmoji",(e,t)=>{sN.init(e,t),ft.init(e,t)}),WI=J("ZodNanoID",(e,t)=>{iN.init(e,t),ft.init(e,t)}),zI=J("ZodCUID",(e,t)=>{aN.init(e,t),ft.init(e,t)}),LI=J("ZodCUID2",(e,t)=>{cN.init(e,t),ft.init(e,t)}),$I=J("ZodULID",(e,t)=>{lN.init(e,t),ft.init(e,t)}),UI=J("ZodXID",(e,t)=>{uN.init(e,t),ft.init(e,t)}),YI=J("ZodKSUID",(e,t)=>{fN.init(e,t),ft.init(e,t)}),jI=J("ZodIPv4",(e,t)=>{gN.init(e,t),ft.init(e,t)}),VI=J("ZodIPv6",(e,t)=>{yN.init(e,t),ft.init(e,t)}),BI=J("ZodCIDRv4",(e,t)=>{vN.init(e,t),ft.init(e,t)}),HI=J("ZodCIDRv6",(e,t)=>{bN.init(e,t),ft.init(e,t)}),ZI=J("ZodBase64",(e,t)=>{wN.init(e,t),ft.init(e,t)}),GI=J("ZodBase64URL",(e,t)=>{SN.init(e,t),ft.init(e,t)}),qI=J("ZodE164",(e,t)=>{kN.init(e,t),ft.init(e,t)}),KI=J("ZodJWT",(e,t)=>{ON.init(e,t),ft.init(e,t)}),XI=J("ZodAny",(e,t)=>{EN.init(e,t),pt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>H2()});function JI(){return _2(XI)}const QI=J("ZodUnknown",(e,t)=>{CN.init(e,t),pt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Z2()});function $y(){return S2(QI)}const eF=J("ZodNever",(e,t)=>{TN.init(e,t),pt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>B2(e,n,r)});function tF(e){return k2(eF,e)}const nF=J("ZodDate",(e,t)=>{DN.init(e,t),pt.init(e,t),e._zod.processJSONSchema=(r,o,s)=>G2(e,r),e.min=(r,o)=>e.check(E2(r,o)),e.max=(r,o)=>e.check(O2(r,o));const n=e._zod.bag;e.minDate=n.minimum?new Date(n.minimum):null,e.maxDate=n.maximum?new Date(n.maximum):null});function rF(e){return x2(nF,e)}const oF=J("ZodArray",(e,t)=>{AN.init(e,t),pt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Q2(e,n,r,o),e.element=t.element,e.min=(n,r)=>e.check(na(n,r)),e.nonempty=n=>e.check(na(1,n)),e.max=(n,r)=>e.check(Ay(n,r)),e.length=(n,r)=>e.check(My(n,r)),e.unwrap=()=>e.element});function Uy(e,t){return z2(oF,e,t)}const sF=J("ZodObject",(e,t)=>{PN.init(e,t),pt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>eI(e,n,r,o),Ze(e,"shape",()=>t.shape),e.keyof=()=>uF(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:$y()}),e.loose=()=>e.clone({...e._zod.def,catchall:$y()}),e.strict=()=>e.clone({...e._zod.def,catchall:tF()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>QM(e,n),e.safeExtend=n=>eP(e,n),e.merge=n=>tP(e,n),e.pick=n=>XM(e,n),e.omit=n=>JM(e,n),e.partial=(...n)=>nP(jy,e,n[0]),e.required=(...n)=>rP(Hy,e,n[0])});function Yy(e,t){const n={type:"object",shape:e??{},...we(t)};return new sF(n)}const iF=J("ZodUnion",(e,t)=>{NN.init(e,t),pt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>tI(e,n,r,o),e.options=t.options});function aF(e,t){return new iF({type:"union",options:e,...we(t)})}const cF=J("ZodIntersection",(e,t)=>{IN.init(e,t),pt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>nI(e,n,r,o)});function lF(e,t){return new cF({type:"intersection",left:e,right:t})}const Hl=J("ZodEnum",(e,t)=>{FN.init(e,t),pt.init(e,t),e._zod.processJSONSchema=(r,o,s)=>q2(e,r,o),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(r,o)=>{const s={};for(const i of r)if(n.has(i))s[i]=t.entries[i];else throw new Error(`Key ${i} not found in enum`);return new Hl({...t,checks:[],...we(o),entries:s})},e.exclude=(r,o)=>{const s={...t.entries};for(const i of r)if(n.has(i))delete s[i];else throw new Error(`Key ${i} not found in enum`);return new Hl({...t,checks:[],...we(o),entries:s})}});function uF(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new Hl({type:"enum",entries:n,...we(t)})}const fF=J("ZodLiteral",(e,t)=>{RN.init(e,t),pt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>K2(e,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function dF(e,t){return new fF({type:"literal",values:Array.isArray(e)?e:[e],...we(t)})}const hF=J("ZodTransform",(e,t)=>{WN.init(e,t),pt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>J2(e,n),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new ny(e.constructor.name);n.addIssue=s=>{if(typeof s=="string")n.issues.push(us(s,n.value,t));else{const i=s;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=n.value),i.inst??(i.inst=e),n.issues.push(us(i))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then(s=>(n.value=s,n)):(n.value=o,n)}});function pF(e){return new hF({type:"transform",transform:e})}const jy=J("ZodOptional",(e,t)=>{ky.init(e,t),pt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Fy(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function Vy(e){return new jy({type:"optional",innerType:e})}const mF=J("ZodExactOptional",(e,t)=>{zN.init(e,t),pt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Fy(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function gF(e){return new mF({type:"optional",innerType:e})}const yF=J("ZodNullable",(e,t)=>{LN.init(e,t),pt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>rI(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function By(e){return new yF({type:"nullable",innerType:e})}const vF=J("ZodDefault",(e,t)=>{$N.init(e,t),pt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>sI(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function bF(e,t){return new vF({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():cy(t)}})}const wF=J("ZodPrefault",(e,t)=>{UN.init(e,t),pt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>iI(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function _F(e,t){return new wF({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():cy(t)}})}const Hy=J("ZodNonOptional",(e,t)=>{YN.init(e,t),pt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>oI(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function SF(e,t){return new Hy({type:"nonoptional",innerType:e,...we(t)})}const kF=J("ZodCatch",(e,t)=>{jN.init(e,t),pt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>aI(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function xF(e,t){return new kF({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const OF=J("ZodPipe",(e,t)=>{VN.init(e,t),pt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>cI(e,n,r,o),e.in=t.in,e.out=t.out});function Zy(e,t){return new OF({type:"pipe",in:e,out:t})}const EF=J("ZodReadonly",(e,t)=>{BN.init(e,t),pt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>lI(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function CF(e){return new EF({type:"readonly",innerType:e})}const TF=J("ZodCustom",(e,t)=>{HN.init(e,t),pt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>X2(e,n)});function DF(e,t={}){return L2(TF,e,t)}function AF(e){return $2(e)}var Zl,Gy;function qy(){if(Gy)return Zl;Gy=1;var e=Object.prototype;function t(n){var r=n&&n.constructor,o=typeof r=="function"&&r.prototype||e;return n===o}return Zl=t,Zl}var Gl,Ky;function MF(){if(Ky)return Gl;Ky=1;function e(t,n){return function(r){return t(n(r))}}return Gl=e,Gl}var ql,Xy;function PF(){if(Xy)return ql;Xy=1;var e=MF(),t=e(Object.keys,Object);return ql=t,ql}var Kl,Jy;function NF(){if(Jy)return Kl;Jy=1;var e=qy(),t=PF(),n=Object.prototype,r=n.hasOwnProperty;function o(s){if(!e(s))return t(s);var i=[];for(var a in Object(s))r.call(s,a)&&a!="constructor"&&i.push(a);return i}return Kl=o,Kl}var Xl,Qy;function ev(){if(Qy)return Xl;Qy=1;var e=typeof Fi=="object"&&Fi&&Fi.Object===Object&&Fi;return Xl=e,Xl}var Jl,tv;function xr(){if(tv)return Jl;tv=1;var e=ev(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return Jl=n,Jl}var Ql,nv;function rv(){if(nv)return Ql;nv=1;var e=xr(),t=e.Symbol;return Ql=t,Ql}var eu,ov;function IF(){if(ov)return eu;ov=1;var e=rv(),t=Object.prototype,n=t.hasOwnProperty,r=t.toString,o=e?e.toStringTag:void 0;function s(i){var a=n.call(i,o),c=i[o];try{i[o]=void 0;var u=!0}catch{}var l=r.call(i);return u&&(a?i[o]=c:delete i[o]),l}return eu=s,eu}var tu,sv;function FF(){if(sv)return tu;sv=1;var e=Object.prototype,t=e.toString;function n(r){return t.call(r)}return tu=n,tu}var nu,iv;function sa(){if(iv)return nu;iv=1;var e=rv(),t=IF(),n=FF(),r="[object Null]",o="[object Undefined]",s=e?e.toStringTag:void 0;function i(a){return a==null?a===void 0?o:r:s&&s in Object(a)?t(a):n(a)}return nu=i,nu}var ru,av;function cv(){if(av)return ru;av=1;function e(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}return ru=e,ru}var ou,lv;function uv(){if(lv)return ou;lv=1;var e=sa(),t=cv(),n="[object AsyncFunction]",r="[object Function]",o="[object GeneratorFunction]",s="[object Proxy]";function i(a){if(!t(a))return!1;var c=e(a);return c==r||c==o||c==n||c==s}return ou=i,ou}var su,fv;function RF(){if(fv)return su;fv=1;var e=xr(),t=e["__core-js_shared__"];return su=t,su}var iu,dv;function WF(){if(dv)return iu;dv=1;var e=RF(),t=(function(){var r=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""})();function n(r){return!!t&&t in r}return iu=n,iu}var au,hv;function pv(){if(hv)return au;hv=1;var e=Function.prototype,t=e.toString;function n(r){if(r!=null){try{return t.call(r)}catch{}try{return r+""}catch{}}return""}return au=n,au}var cu,mv;function zF(){if(mv)return cu;mv=1;var e=uv(),t=WF(),n=cv(),r=pv(),o=/[\\^$.*+?()[\]{}|]/g,s=/^\[object .+?Constructor\]$/,i=Function.prototype,a=Object.prototype,c=i.toString,u=a.hasOwnProperty,l=RegExp("^"+c.call(u).replace(o,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function f(d){if(!n(d)||t(d))return!1;var h=e(d)?l:s;return h.test(r(d))}return cu=f,cu}var lu,gv;function LF(){if(gv)return lu;gv=1;function e(t,n){return t?.[n]}return lu=e,lu}var uu,yv;function ds(){if(yv)return uu;yv=1;var e=zF(),t=LF();function n(r,o){var s=t(r,o);return e(s)?s:void 0}return uu=n,uu}var fu,vv;function $F(){if(vv)return fu;vv=1;var e=ds(),t=xr(),n=e(t,"DataView");return fu=n,fu}var du,bv;function UF(){if(bv)return du;bv=1;var e=ds(),t=xr(),n=e(t,"Map");return du=n,du}var hu,wv;function YF(){if(wv)return hu;wv=1;var e=ds(),t=xr(),n=e(t,"Promise");return hu=n,hu}var pu,_v;function jF(){if(_v)return pu;_v=1;var e=ds(),t=xr(),n=e(t,"Set");return pu=n,pu}var mu,Sv;function VF(){if(Sv)return mu;Sv=1;var e=ds(),t=xr(),n=e(t,"WeakMap");return mu=n,mu}var gu,kv;function BF(){if(kv)return gu;kv=1;var e=$F(),t=UF(),n=YF(),r=jF(),o=VF(),s=sa(),i=pv(),a="[object Map]",c="[object Object]",u="[object Promise]",l="[object Set]",f="[object WeakMap]",d="[object DataView]",h=i(e),m=i(t),p=i(n),y=i(r),g=i(o),C=s;return(e&&C(new e(new ArrayBuffer(1)))!=d||t&&C(new t)!=a||n&&C(n.resolve())!=u||r&&C(new r)!=l||o&&C(new o)!=f)&&(C=function(O){var w=s(O),_=w==c?O.constructor:void 0,S=_?i(_):"";if(S)switch(S){case h:return d;case m:return a;case p:return u;case y:return l;case g:return f}return w}),gu=C,gu}var yu,xv;function vu(){if(xv)return yu;xv=1;function e(t){return t!=null&&typeof t=="object"}return yu=e,yu}var bu,Ov;function HF(){if(Ov)return bu;Ov=1;var e=sa(),t=vu(),n="[object Arguments]";function r(o){return t(o)&&e(o)==n}return bu=r,bu}var wu,Ev;function ZF(){if(Ev)return wu;Ev=1;var e=HF(),t=vu(),n=Object.prototype,r=n.hasOwnProperty,o=n.propertyIsEnumerable,s=e((function(){return arguments})())?e:function(i){return t(i)&&r.call(i,"callee")&&!o.call(i,"callee")};return wu=s,wu}var _u,Cv;function GF(){if(Cv)return _u;Cv=1;var e=Array.isArray;return _u=e,_u}var Su,Tv;function Dv(){if(Tv)return Su;Tv=1;var e=9007199254740991;function t(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=e}return Su=t,Su}var ku,Av;function qF(){if(Av)return ku;Av=1;var e=uv(),t=Dv();function n(r){return r!=null&&t(r.length)&&!e(r)}return ku=n,ku}var hs={exports:{}},xu,Mv;function KF(){if(Mv)return xu;Mv=1;function e(){return!1}return xu=e,xu}hs.exports;var Pv;function XF(){return Pv||(Pv=1,(function(e,t){var n=xr(),r=KF(),o=t&&!t.nodeType&&t,s=o&&!0&&e&&!e.nodeType&&e,i=s&&s.exports===o,a=i?n.Buffer:void 0,c=a?a.isBuffer:void 0,u=c||r;e.exports=u})(hs,hs.exports)),hs.exports}var Ou,Nv;function JF(){if(Nv)return Ou;Nv=1;var e=sa(),t=Dv(),n=vu(),r="[object Arguments]",o="[object Array]",s="[object Boolean]",i="[object Date]",a="[object Error]",c="[object Function]",u="[object Map]",l="[object Number]",f="[object Object]",d="[object RegExp]",h="[object Set]",m="[object String]",p="[object WeakMap]",y="[object ArrayBuffer]",g="[object DataView]",C="[object Float32Array]",O="[object Float64Array]",w="[object Int8Array]",_="[object Int16Array]",S="[object Int32Array]",I="[object Uint8Array]",v="[object Uint8ClampedArray]",x="[object Uint16Array]",P="[object Uint32Array]",A={};A[C]=A[O]=A[w]=A[_]=A[S]=A[I]=A[v]=A[x]=A[P]=!0,A[r]=A[o]=A[y]=A[s]=A[g]=A[i]=A[a]=A[c]=A[u]=A[l]=A[f]=A[d]=A[h]=A[m]=A[p]=!1;function M(F){return n(F)&&t(F.length)&&!!A[e(F)]}return Ou=M,Ou}var Eu,Iv;function QF(){if(Iv)return Eu;Iv=1;function e(t){return function(n){return t(n)}}return Eu=e,Eu}var ps={exports:{}};ps.exports;var Fv;function eR(){return Fv||(Fv=1,(function(e,t){var n=ev(),r=t&&!t.nodeType&&t,o=r&&!0&&e&&!e.nodeType&&e,s=o&&o.exports===r,i=s&&n.process,a=(function(){try{var c=o&&o.require&&o.require("util").types;return c||i&&i.binding&&i.binding("util")}catch{}})();e.exports=a})(ps,ps.exports)),ps.exports}var Cu,Rv;function tR(){if(Rv)return Cu;Rv=1;var e=JF(),t=QF(),n=eR(),r=n&&n.isTypedArray,o=r?t(r):e;return Cu=o,Cu}var Tu,Wv;function nR(){if(Wv)return Tu;Wv=1;var e=NF(),t=BF(),n=ZF(),r=GF(),o=qF(),s=XF(),i=qy(),a=tR(),c="[object Map]",u="[object Set]",l=Object.prototype,f=l.hasOwnProperty;function d(h){if(h==null)return!0;if(o(h)&&(r(h)||typeof h=="string"||typeof h.splice=="function"||s(h)||a(h)||n(h)))return!h.length;var m=t(h);if(m==c||m==u)return!h.size;if(i(h))return!e(h).length;for(var p in h)if(f.call(h,p))return!1;return!0}return Tu=d,Tu}var rR=nR();const oR=vl(rR),sR=({questions:e=[],prefilled_answers:t=new Map}={})=>{const n={},r={};return e.forEach((o={})=>{let s;const i=t.get(o.id);switch(o.type){case Vi:case Bi:case cs:case Xg:case Jg:if(s=zy(),r[o.id]="",i&&i.is_previously_submitted_answer&&!o.allow_prefill)break;i&&i.value&&i.value.length>0&&(r[o.id]=i.value[0]||"");break;case ji:if(s=rF({invalid_type_error:"Invalid date format."}),r[o.id]=void 0,i&&i.is_previously_submitted_answer&&!o.allow_prefill)break;if(i&&i.value&&i.value.length>0&&o.date_format&&ce(i.value[0],o.date_format).isValid()){const a=ce(i.value[0],o.date_format);r[o.id]=a.toDate()}break;case Rl:if(s=Uy(zy()),r[o.id]=[],i&&i.is_previously_submitted_answer&&!o.allow_prefill)break;i&&i.value&&i.value.length>0&&(r[o.id]=i.value||[]);break;default:s=JI(),r[o.id]=""}o.is_required&&([Vi,Bi,cs].includes(o.type)?s=s.min(1,{message:o.type===cs?"Please sign here":`${o.label} is required`}):o.type===ji?s=s.refine(a=>a!=null,{message:`${o.label} is required`}):o.type===Rl&&(s=s.min(1,{message:"Please make at least one selection"}))),oR(o.validation)||(o.validation.type==="email"&&(s=s.email({message:"Invalid email address."})),o.validation.min_length&&(s=s.min(o.validation.min_length,{message:`${o.label} must be at least ${o.validation.min_length} characters`})),o.validation.max_length&&(s=s.max(o.validation.max_length,{message:`${o.label} cannot exceed ${o.validation.max_length} characters`}))),!o.is_required&&[Vi,Bi,cs].includes(o.type)&&(s=s.or(dF(""))),n[o.id]=s}),{schema:Yy(n),default_values:r}},iR=({data:e,onSubmit:t,renderFooter:n})=>{const{sections:r=[],questions:o=[]}=hC({questionnaire:e}),{form_config:s}=ia(),{schema:i,default_values:a}=j.useMemo(()=>!o||o.length===0?{schema:Yy({}),default_values:{}}:sR({questions:o}),[o]),c=Ob({resolver:dI(i),defaultValues:a,...s}),u=l=>{if(c.trigger(),t){const f=o.map(d=>{let h=c.getValues()[d.id];return d.type===ji&&h instanceof Date&&(h=ce(h).format(d.date_format||"DD-MM-YYYY")),{reference_id:d.id,value:Array.isArray(h)?h:[h],section_gid:d.section_gid,item_gid:d.g_id}});t(f)}};return T.jsx(vw,{...c,children:T.jsxs("form",{className:"bq-form-container space-y-4",onSubmit:c.handleSubmit(u),children:[r?.map(l=>T.jsx(BM,{section:l,form:c},l.g_id)),n&&n({form:c})]})})};return({data:e,onSubmit:t,config:n,renderFooter:r})=>T.jsx(Kv,{config:n,children:T.jsx(iR,{data:e,onSubmit:t,renderFooter:r})})}));