bold-peaches-cheer/apps/client/dist/assets/index-BQ4ZA0YV.js
2026-05-13 12:22:02 +05:00

59 lines
592 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

function Qx(t,r){for(var a=0;a<r.length;a++){const l=r[a];if(typeof l!="string"&&!Array.isArray(l)){for(const s in l)if(s!=="default"&&!(s in t)){const c=Object.getOwnPropertyDescriptor(l,s);c&&Object.defineProperty(t,s,c.get?c:{enumerable:!0,get:()=>l[s]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))l(s);new MutationObserver(s=>{for(const c of s)if(c.type==="childList")for(const u of c.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&l(u)}).observe(document,{childList:!0,subtree:!0});function a(s){const c={};return s.integrity&&(c.integrity=s.integrity),s.referrerPolicy&&(c.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?c.credentials="include":s.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function l(s){if(s.ep)return;s.ep=!0;const c=a(s);fetch(s.href,c)}})();function Vx(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Fh={exports:{}},$o={};var Yb;function Jj(){if(Yb)return $o;Yb=1;var t=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function a(l,s,c){var u=null;if(c!==void 0&&(u=""+c),s.key!==void 0&&(u=""+s.key),"key"in s){c={};for(var d in s)d!=="key"&&(c[d]=s[d])}else c=s;return s=c.ref,{$$typeof:t,type:l,key:u,ref:s!==void 0?s:null,props:c}}return $o.Fragment=r,$o.jsx=a,$o.jsxs=a,$o}var Kb;function Wj(){return Kb||(Kb=1,Fh.exports=Jj()),Fh.exports}var h=Wj(),Gh={exports:{}},Le={};var Xb;function e2(){if(Xb)return Le;Xb=1;var t=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),u=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),v=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),w=Symbol.iterator;function C(D){return D===null||typeof D!="object"?null:(D=w&&D[w]||D["@@iterator"],typeof D=="function"?D:null)}var E={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,R={};function M(D,Q,J){this.props=D,this.context=Q,this.refs=R,this.updater=J||E}M.prototype.isReactComponent={},M.prototype.setState=function(D,Q){if(typeof D!="object"&&typeof D!="function"&&D!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,D,Q,"setState")},M.prototype.forceUpdate=function(D){this.updater.enqueueForceUpdate(this,D,"forceUpdate")};function O(){}O.prototype=M.prototype;function _(D,Q,J){this.props=D,this.context=Q,this.refs=R,this.updater=J||E}var z=_.prototype=new O;z.constructor=_,S(z,M.prototype),z.isPureReactComponent=!0;var k=Array.isArray;function I(){}var N={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function A(D,Q,J){var ne=J.ref;return{$$typeof:t,type:D,key:Q,ref:ne!==void 0?ne:null,props:J}}function q(D,Q){return A(D.type,Q,D.props)}function K(D){return typeof D=="object"&&D!==null&&D.$$typeof===t}function W(D){var Q={"=":"=0",":":"=2"};return"$"+D.replace(/[=:]/g,function(J){return Q[J]})}var ue=/\/+/g;function le(D,Q){return typeof D=="object"&&D!==null&&D.key!=null?W(""+D.key):Q.toString(36)}function de(D){switch(D.status){case"fulfilled":return D.value;case"rejected":throw D.reason;default:switch(typeof D.status=="string"?D.then(I,I):(D.status="pending",D.then(function(Q){D.status==="pending"&&(D.status="fulfilled",D.value=Q)},function(Q){D.status==="pending"&&(D.status="rejected",D.reason=Q)})),D.status){case"fulfilled":return D.value;case"rejected":throw D.reason}}throw D}function L(D,Q,J,ne,fe){var me=typeof D;(me==="undefined"||me==="boolean")&&(D=null);var re=!1;if(D===null)re=!0;else switch(me){case"bigint":case"string":case"number":re=!0;break;case"object":switch(D.$$typeof){case t:case r:re=!0;break;case b:return re=D._init,L(re(D._payload),Q,J,ne,fe)}}if(re)return fe=fe(D),re=ne===""?"."+le(D,0):ne,k(fe)?(J="",re!=null&&(J=re.replace(ue,"$&/")+"/"),L(fe,Q,J,"",function(Te){return Te})):fe!=null&&(K(fe)&&(fe=q(fe,J+(fe.key==null||D&&D.key===fe.key?"":(""+fe.key).replace(ue,"$&/")+"/")+re)),Q.push(fe)),1;re=0;var De=ne===""?".":ne+":";if(k(D))for(var Ae=0;Ae<D.length;Ae++)ne=D[Ae],me=De+le(ne,Ae),re+=L(ne,Q,J,me,fe);else if(Ae=C(D),typeof Ae=="function")for(D=Ae.call(D),Ae=0;!(ne=D.next()).done;)ne=ne.value,me=De+le(ne,Ae++),re+=L(ne,Q,J,me,fe);else if(me==="object"){if(typeof D.then=="function")return L(de(D),Q,J,ne,fe);throw Q=String(D),Error("Objects are not valid as a React child (found: "+(Q==="[object Object]"?"object with keys {"+Object.keys(D).join(", ")+"}":Q)+"). If you meant to render a collection of children, use an array instead.")}return re}function G(D,Q,J){if(D==null)return D;var ne=[],fe=0;return L(D,ne,"","",function(me){return Q.call(J,me,fe++)}),ne}function B(D){if(D._status===-1){var Q=D._result;Q=Q(),Q.then(function(J){(D._status===0||D._status===-1)&&(D._status=1,D._result=J)},function(J){(D._status===0||D._status===-1)&&(D._status=2,D._result=J)}),D._status===-1&&(D._status=0,D._result=Q)}if(D._status===1)return D._result.default;throw D._result}var ee=typeof reportError=="function"?reportError:function(D){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var Q=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof D=="object"&&D!==null&&typeof D.message=="string"?String(D.message):String(D),error:D});if(!window.dispatchEvent(Q))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",D);return}console.error(D)},ie={map:G,forEach:function(D,Q,J){G(D,function(){Q.apply(this,arguments)},J)},count:function(D){var Q=0;return G(D,function(){Q++}),Q},toArray:function(D){return G(D,function(Q){return Q})||[]},only:function(D){if(!K(D))throw Error("React.Children.only expected to receive a single React element child.");return D}};return Le.Activity=y,Le.Children=ie,Le.Component=M,Le.Fragment=a,Le.Profiler=s,Le.PureComponent=_,Le.StrictMode=l,Le.Suspense=m,Le.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=N,Le.__COMPILER_RUNTIME={__proto__:null,c:function(D){return N.H.useMemoCache(D)}},Le.cache=function(D){return function(){return D.apply(null,arguments)}},Le.cacheSignal=function(){return null},Le.cloneElement=function(D,Q,J){if(D==null)throw Error("The argument must be a React element, but you passed "+D+".");var ne=S({},D.props),fe=D.key;if(Q!=null)for(me in Q.key!==void 0&&(fe=""+Q.key),Q)!T.call(Q,me)||me==="key"||me==="__self"||me==="__source"||me==="ref"&&Q.ref===void 0||(ne[me]=Q[me]);var me=arguments.length-2;if(me===1)ne.children=J;else if(1<me){for(var re=Array(me),De=0;De<me;De++)re[De]=arguments[De+2];ne.children=re}return A(D.type,fe,ne)},Le.createContext=function(D){return D={$$typeof:u,_currentValue:D,_currentValue2:D,_threadCount:0,Provider:null,Consumer:null},D.Provider=D,D.Consumer={$$typeof:c,_context:D},D},Le.createElement=function(D,Q,J){var ne,fe={},me=null;if(Q!=null)for(ne in Q.key!==void 0&&(me=""+Q.key),Q)T.call(Q,ne)&&ne!=="key"&&ne!=="__self"&&ne!=="__source"&&(fe[ne]=Q[ne]);var re=arguments.length-2;if(re===1)fe.children=J;else if(1<re){for(var De=Array(re),Ae=0;Ae<re;Ae++)De[Ae]=arguments[Ae+2];fe.children=De}if(D&&D.defaultProps)for(ne in re=D.defaultProps,re)fe[ne]===void 0&&(fe[ne]=re[ne]);return A(D,me,fe)},Le.createRef=function(){return{current:null}},Le.forwardRef=function(D){return{$$typeof:d,render:D}},Le.isValidElement=K,Le.lazy=function(D){return{$$typeof:b,_payload:{_status:-1,_result:D},_init:B}},Le.memo=function(D,Q){return{$$typeof:v,type:D,compare:Q===void 0?null:Q}},Le.startTransition=function(D){var Q=N.T,J={};N.T=J;try{var ne=D(),fe=N.S;fe!==null&&fe(J,ne),typeof ne=="object"&&ne!==null&&typeof ne.then=="function"&&ne.then(I,ee)}catch(me){ee(me)}finally{Q!==null&&J.types!==null&&(Q.types=J.types),N.T=Q}},Le.unstable_useCacheRefresh=function(){return N.H.useCacheRefresh()},Le.use=function(D){return N.H.use(D)},Le.useActionState=function(D,Q,J){return N.H.useActionState(D,Q,J)},Le.useCallback=function(D,Q){return N.H.useCallback(D,Q)},Le.useContext=function(D){return N.H.useContext(D)},Le.useDebugValue=function(){},Le.useDeferredValue=function(D,Q){return N.H.useDeferredValue(D,Q)},Le.useEffect=function(D,Q){return N.H.useEffect(D,Q)},Le.useEffectEvent=function(D){return N.H.useEffectEvent(D)},Le.useId=function(){return N.H.useId()},Le.useImperativeHandle=function(D,Q,J){return N.H.useImperativeHandle(D,Q,J)},Le.useInsertionEffect=function(D,Q){return N.H.useInsertionEffect(D,Q)},Le.useLayoutEffect=function(D,Q){return N.H.useLayoutEffect(D,Q)},Le.useMemo=function(D,Q){return N.H.useMemo(D,Q)},Le.useOptimistic=function(D,Q){return N.H.useOptimistic(D,Q)},Le.useReducer=function(D,Q,J){return N.H.useReducer(D,Q,J)},Le.useRef=function(D){return N.H.useRef(D)},Le.useState=function(D){return N.H.useState(D)},Le.useSyncExternalStore=function(D,Q,J){return N.H.useSyncExternalStore(D,Q,J)},Le.useTransition=function(){return N.H.useTransition()},Le.version="19.2.0",Le}var $b;function rp(){return $b||($b=1,Gh.exports=e2()),Gh.exports}var g=rp();const ot=Vx(g),Cs=Qx({__proto__:null,default:ot},[g]);var Yh={exports:{}},Zo={},Kh={exports:{}},Xh={};var Zb;function t2(){return Zb||(Zb=1,(function(t){function r(L,G){var B=L.length;L.push(G);e:for(;0<B;){var ee=B-1>>>1,ie=L[ee];if(0<s(ie,G))L[ee]=G,L[B]=ie,B=ee;else break e}}function a(L){return L.length===0?null:L[0]}function l(L){if(L.length===0)return null;var G=L[0],B=L.pop();if(B!==G){L[0]=B;e:for(var ee=0,ie=L.length,D=ie>>>1;ee<D;){var Q=2*(ee+1)-1,J=L[Q],ne=Q+1,fe=L[ne];if(0>s(J,B))ne<ie&&0>s(fe,J)?(L[ee]=fe,L[ne]=B,ee=ne):(L[ee]=J,L[Q]=B,ee=Q);else if(ne<ie&&0>s(fe,B))L[ee]=fe,L[ne]=B,ee=ne;else break e}}return G}function s(L,G){var B=L.sortIndex-G.sortIndex;return B!==0?B:L.id-G.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;t.unstable_now=function(){return c.now()}}else{var u=Date,d=u.now();t.unstable_now=function(){return u.now()-d}}var m=[],v=[],b=1,y=null,w=3,C=!1,E=!1,S=!1,R=!1,M=typeof setTimeout=="function"?setTimeout:null,O=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;function z(L){for(var G=a(v);G!==null;){if(G.callback===null)l(v);else if(G.startTime<=L)l(v),G.sortIndex=G.expirationTime,r(m,G);else break;G=a(v)}}function k(L){if(S=!1,z(L),!E)if(a(m)!==null)E=!0,I||(I=!0,W());else{var G=a(v);G!==null&&de(k,G.startTime-L)}}var I=!1,N=-1,T=5,A=-1;function q(){return R?!0:!(t.unstable_now()-A<T)}function K(){if(R=!1,I){var L=t.unstable_now();A=L;var G=!0;try{e:{E=!1,S&&(S=!1,O(N),N=-1),C=!0;var B=w;try{t:{for(z(L),y=a(m);y!==null&&!(y.expirationTime>L&&q());){var ee=y.callback;if(typeof ee=="function"){y.callback=null,w=y.priorityLevel;var ie=ee(y.expirationTime<=L);if(L=t.unstable_now(),typeof ie=="function"){y.callback=ie,z(L),G=!0;break t}y===a(m)&&l(m),z(L)}else l(m);y=a(m)}if(y!==null)G=!0;else{var D=a(v);D!==null&&de(k,D.startTime-L),G=!1}}break e}finally{y=null,w=B,C=!1}G=void 0}}finally{G?W():I=!1}}}var W;if(typeof _=="function")W=function(){_(K)};else if(typeof MessageChannel<"u"){var ue=new MessageChannel,le=ue.port2;ue.port1.onmessage=K,W=function(){le.postMessage(null)}}else W=function(){M(K,0)};function de(L,G){N=M(function(){L(t.unstable_now())},G)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(L){L.callback=null},t.unstable_forceFrameRate=function(L){0>L||125<L?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):T=0<L?Math.floor(1e3/L):5},t.unstable_getCurrentPriorityLevel=function(){return w},t.unstable_next=function(L){switch(w){case 1:case 2:case 3:var G=3;break;default:G=w}var B=w;w=G;try{return L()}finally{w=B}},t.unstable_requestPaint=function(){R=!0},t.unstable_runWithPriority=function(L,G){switch(L){case 1:case 2:case 3:case 4:case 5:break;default:L=3}var B=w;w=L;try{return G()}finally{w=B}},t.unstable_scheduleCallback=function(L,G,B){var ee=t.unstable_now();switch(typeof B=="object"&&B!==null?(B=B.delay,B=typeof B=="number"&&0<B?ee+B:ee):B=ee,L){case 1:var ie=-1;break;case 2:ie=250;break;case 5:ie=1073741823;break;case 4:ie=1e4;break;default:ie=5e3}return ie=B+ie,L={id:b++,callback:G,priorityLevel:L,startTime:B,expirationTime:ie,sortIndex:-1},B>ee?(L.sortIndex=B,r(v,L),a(m)===null&&L===a(v)&&(S?(O(N),N=-1):S=!0,de(k,B-ee))):(L.sortIndex=ie,r(m,L),E||C||(E=!0,I||(I=!0,W()))),L},t.unstable_shouldYield=q,t.unstable_wrapCallback=function(L){var G=w;return function(){var B=w;w=G;try{return L.apply(this,arguments)}finally{w=B}}}})(Xh)),Xh}var Jb;function n2(){return Jb||(Jb=1,Kh.exports=t2()),Kh.exports}var $h={exports:{}},dn={};var Wb;function r2(){if(Wb)return dn;Wb=1;var t=rp();function r(m){var v="https://react.dev/errors/"+m;if(1<arguments.length){v+="?args[]="+encodeURIComponent(arguments[1]);for(var b=2;b<arguments.length;b++)v+="&args[]="+encodeURIComponent(arguments[b])}return"Minified React error #"+m+"; visit "+v+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(){}var l={d:{f:a,r:function(){throw Error(r(522))},D:a,C:a,L:a,m:a,X:a,S:a,M:a},p:0,findDOMNode:null},s=Symbol.for("react.portal");function c(m,v,b){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:y==null?null:""+y,children:m,containerInfo:v,implementation:b}}var u=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(m,v){if(m==="font")return"";if(typeof v=="string")return v==="use-credentials"?v:""}return dn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=l,dn.createPortal=function(m,v){var b=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!v||v.nodeType!==1&&v.nodeType!==9&&v.nodeType!==11)throw Error(r(299));return c(m,v,null,b)},dn.flushSync=function(m){var v=u.T,b=l.p;try{if(u.T=null,l.p=2,m)return m()}finally{u.T=v,l.p=b,l.d.f()}},dn.preconnect=function(m,v){typeof m=="string"&&(v?(v=v.crossOrigin,v=typeof v=="string"?v==="use-credentials"?v:"":void 0):v=null,l.d.C(m,v))},dn.prefetchDNS=function(m){typeof m=="string"&&l.d.D(m)},dn.preinit=function(m,v){if(typeof m=="string"&&v&&typeof v.as=="string"){var b=v.as,y=d(b,v.crossOrigin),w=typeof v.integrity=="string"?v.integrity:void 0,C=typeof v.fetchPriority=="string"?v.fetchPriority:void 0;b==="style"?l.d.S(m,typeof v.precedence=="string"?v.precedence:void 0,{crossOrigin:y,integrity:w,fetchPriority:C}):b==="script"&&l.d.X(m,{crossOrigin:y,integrity:w,fetchPriority:C,nonce:typeof v.nonce=="string"?v.nonce:void 0})}},dn.preinitModule=function(m,v){if(typeof m=="string")if(typeof v=="object"&&v!==null){if(v.as==null||v.as==="script"){var b=d(v.as,v.crossOrigin);l.d.M(m,{crossOrigin:b,integrity:typeof v.integrity=="string"?v.integrity:void 0,nonce:typeof v.nonce=="string"?v.nonce:void 0})}}else v==null&&l.d.M(m)},dn.preload=function(m,v){if(typeof m=="string"&&typeof v=="object"&&v!==null&&typeof v.as=="string"){var b=v.as,y=d(b,v.crossOrigin);l.d.L(m,b,{crossOrigin:y,integrity:typeof v.integrity=="string"?v.integrity:void 0,nonce:typeof v.nonce=="string"?v.nonce:void 0,type:typeof v.type=="string"?v.type:void 0,fetchPriority:typeof v.fetchPriority=="string"?v.fetchPriority:void 0,referrerPolicy:typeof v.referrerPolicy=="string"?v.referrerPolicy:void 0,imageSrcSet:typeof v.imageSrcSet=="string"?v.imageSrcSet:void 0,imageSizes:typeof v.imageSizes=="string"?v.imageSizes:void 0,media:typeof v.media=="string"?v.media:void 0})}},dn.preloadModule=function(m,v){if(typeof m=="string")if(v){var b=d(v.as,v.crossOrigin);l.d.m(m,{as:typeof v.as=="string"&&v.as!=="script"?v.as:void 0,crossOrigin:b,integrity:typeof v.integrity=="string"?v.integrity:void 0})}else l.d.m(m)},dn.requestFormReset=function(m){l.d.r(m)},dn.unstable_batchedUpdates=function(m,v){return m(v)},dn.useFormState=function(m,v,b){return u.H.useFormState(m,v,b)},dn.useFormStatus=function(){return u.H.useHostTransitionStatus()},dn.version="19.2.0",dn}var e0;function Fx(){if(e0)return $h.exports;e0=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(r){console.error(r)}}return t(),$h.exports=r2(),$h.exports}var t0;function a2(){if(t0)return Zo;t0=1;var t=n2(),r=rp(),a=Fx();function l(e){var n="https://react.dev/errors/"+e;if(1<arguments.length){n+="?args[]="+encodeURIComponent(arguments[1]);for(var i=2;i<arguments.length;i++)n+="&args[]="+encodeURIComponent(arguments[i])}return"Minified React error #"+e+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function c(e){var n=e,i=e;if(e.alternate)for(;n.return;)n=n.return;else{e=n;do n=e,(n.flags&4098)!==0&&(i=n.return),e=n.return;while(e)}return n.tag===3?i:null}function u(e){if(e.tag===13){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function d(e){if(e.tag===31){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function m(e){if(c(e)!==e)throw Error(l(188))}function v(e){var n=e.alternate;if(!n){if(n=c(e),n===null)throw Error(l(188));return n!==e?null:e}for(var i=e,o=n;;){var f=i.return;if(f===null)break;var p=f.alternate;if(p===null){if(o=f.return,o!==null){i=o;continue}break}if(f.child===p.child){for(p=f.child;p;){if(p===i)return m(f),e;if(p===o)return m(f),n;p=p.sibling}throw Error(l(188))}if(i.return!==o.return)i=f,o=p;else{for(var x=!1,j=f.child;j;){if(j===i){x=!0,i=f,o=p;break}if(j===o){x=!0,o=f,i=p;break}j=j.sibling}if(!x){for(j=p.child;j;){if(j===i){x=!0,i=p,o=f;break}if(j===o){x=!0,o=p,i=f;break}j=j.sibling}if(!x)throw Error(l(189))}}if(i.alternate!==o)throw Error(l(190))}if(i.tag!==3)throw Error(l(188));return i.stateNode.current===i?e:n}function b(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e;for(e=e.child;e!==null;){if(n=b(e),n!==null)return n;e=e.sibling}return null}var y=Object.assign,w=Symbol.for("react.element"),C=Symbol.for("react.transitional.element"),E=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),R=Symbol.for("react.strict_mode"),M=Symbol.for("react.profiler"),O=Symbol.for("react.consumer"),_=Symbol.for("react.context"),z=Symbol.for("react.forward_ref"),k=Symbol.for("react.suspense"),I=Symbol.for("react.suspense_list"),N=Symbol.for("react.memo"),T=Symbol.for("react.lazy"),A=Symbol.for("react.activity"),q=Symbol.for("react.memo_cache_sentinel"),K=Symbol.iterator;function W(e){return e===null||typeof e!="object"?null:(e=K&&e[K]||e["@@iterator"],typeof e=="function"?e:null)}var ue=Symbol.for("react.client.reference");function le(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ue?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case S:return"Fragment";case M:return"Profiler";case R:return"StrictMode";case k:return"Suspense";case I:return"SuspenseList";case A:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case E:return"Portal";case _:return e.displayName||"Context";case O:return(e._context.displayName||"Context")+".Consumer";case z:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case N:return n=e.displayName||null,n!==null?n:le(e.type)||"Memo";case T:n=e._payload,e=e._init;try{return le(e(n))}catch{}}return null}var de=Array.isArray,L=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,G=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,B={pending:!1,data:null,method:null,action:null},ee=[],ie=-1;function D(e){return{current:e}}function Q(e){0>ie||(e.current=ee[ie],ee[ie]=null,ie--)}function J(e,n){ie++,ee[ie]=e.current,e.current=n}var ne=D(null),fe=D(null),me=D(null),re=D(null);function De(e,n){switch(J(me,n),J(fe,e),J(ne,null),n.nodeType){case 9:case 11:e=(e=n.documentElement)&&(e=e.namespaceURI)?vb(e):0;break;default:if(e=n.tagName,n=n.namespaceURI)n=vb(n),e=gb(n,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Q(ne),J(ne,e)}function Ae(){Q(ne),Q(fe),Q(me)}function Te(e){e.memoizedState!==null&&J(re,e);var n=ne.current,i=gb(n,e.type);n!==i&&(J(fe,e),J(ne,i))}function Ue(e){fe.current===e&&(Q(ne),Q(fe)),re.current===e&&(Q(re),Go._currentValue=B)}var he,dt;function pt(e){if(he===void 0)try{throw Error()}catch(i){var n=i.stack.trim().match(/\n( *(at )?)/);he=n&&n[1]||"",dt=-1<i.stack.indexOf(`
at`)?" (<anonymous>)":-1<i.stack.indexOf("@")?"@unknown:0:0":""}return`
`+he+e+dt}var Sn=!1;function jt(e,n){if(!e||Sn)return"";Sn=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var o={DetermineComponentFrameRoot:function(){try{if(n){var se=function(){throw Error()};if(Object.defineProperty(se.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(se,[])}catch(te){var Z=te}Reflect.construct(e,[],se)}else{try{se.call()}catch(te){Z=te}e.call(se.prototype)}}else{try{throw Error()}catch(te){Z=te}(se=e())&&typeof se.catch=="function"&&se.catch(function(){})}}catch(te){if(te&&Z&&typeof te.stack=="string")return[te.stack,Z.stack]}return[null,null]}};o.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var f=Object.getOwnPropertyDescriptor(o.DetermineComponentFrameRoot,"name");f&&f.configurable&&Object.defineProperty(o.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var p=o.DetermineComponentFrameRoot(),x=p[0],j=p[1];if(x&&j){var P=x.split(`
`),X=j.split(`
`);for(f=o=0;o<P.length&&!P[o].includes("DetermineComponentFrameRoot");)o++;for(;f<X.length&&!X[f].includes("DetermineComponentFrameRoot");)f++;if(o===P.length||f===X.length)for(o=P.length-1,f=X.length-1;1<=o&&0<=f&&P[o]!==X[f];)f--;for(;1<=o&&0<=f;o--,f--)if(P[o]!==X[f]){if(o!==1||f!==1)do if(o--,f--,0>f||P[o]!==X[f]){var ae=`
`+P[o].replace(" at new "," at ");return e.displayName&&ae.includes("<anonymous>")&&(ae=ae.replace("<anonymous>",e.displayName)),ae}while(1<=o&&0<=f);break}}}finally{Sn=!1,Error.prepareStackTrace=i}return(i=e?e.displayName||e.name:"")?pt(i):""}function Rr(e,n){switch(e.tag){case 26:case 27:case 5:return pt(e.type);case 16:return pt("Lazy");case 13:return e.child!==n&&n!==null?pt("Suspense Fallback"):pt("Suspense");case 19:return pt("SuspenseList");case 0:case 15:return jt(e.type,!1);case 11:return jt(e.type.render,!1);case 1:return jt(e.type,!0);case 31:return pt("Activity");default:return""}}function fi(e){try{var n="",i=null;do n+=Rr(e,i),i=e,e=e.return;while(e);return n}catch(o){return`
Error generating stack: `+o.message+`
`+o.stack}}var Mr=Object.prototype.hasOwnProperty,wn=t.unstable_scheduleCallback,Or=t.unstable_cancelCallback,Ca=t.unstable_shouldYield,tl=t.unstable_requestPaint,wt=t.unstable_now,Fr=t.unstable_getCurrentPriorityLevel,hi=t.unstable_ImmediatePriority,Ln=t.unstable_UserBlockingPriority,Ut=t.unstable_NormalPriority,tn=t.unstable_LowPriority,Na=t.unstable_IdlePriority,mn=t.log,nl=t.unstable_setDisableYieldValue,cn=null,Jt=null;function pn(e){if(typeof mn=="function"&&nl(e),Jt&&typeof Jt.setStrictMode=="function")try{Jt.setStrictMode(cn,e)}catch{}}var Vt=Math.clz32?Math.clz32:Ea,oo=Math.log,mi=Math.LN2;function Ea(e){return e>>>=0,e===0?32:31-(oo(e)/mi|0)|0}var Gr=256,Dr=262144,gt=4194304;function Et(e){var n=e&42;if(n!==0)return n;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Tt(e,n,i){var o=e.pendingLanes;if(o===0)return 0;var f=0,p=e.suspendedLanes,x=e.pingedLanes;e=e.warmLanes;var j=o&134217727;return j!==0?(o=j&~p,o!==0?f=Et(o):(x&=j,x!==0?f=Et(x):i||(i=j&~e,i!==0&&(f=Et(i))))):(j=o&~p,j!==0?f=Et(j):x!==0?f=Et(x):i||(i=o&~e,i!==0&&(f=Et(i)))),f===0?0:n!==0&&n!==f&&(n&p)===0&&(p=f&-f,i=n&-n,p>=i||p===32&&(i&4194048)!==0)?n:f}function un(e,n){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&n)===0}function nn(e,n){switch(e){case 1:case 2:case 4:case 8:case 64:return n+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return n+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function _t(){var e=gt;return gt<<=1,(gt&62914560)===0&&(gt=4194304),e}function Ft(e){for(var n=[],i=0;31>i;i++)n.push(e);return n}function Cn(e,n){e.pendingLanes|=n,n!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function At(e,n,i,o,f,p){var x=e.pendingLanes;e.pendingLanes=i,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=i,e.entangledLanes&=i,e.errorRecoveryDisabledLanes&=i,e.shellSuspendCounter=0;var j=e.entanglements,P=e.expirationTimes,X=e.hiddenUpdates;for(i=x&~i;0<i;){var ae=31-Vt(i),se=1<<ae;j[ae]=0,P[ae]=-1;var Z=X[ae];if(Z!==null)for(X[ae]=null,ae=0;ae<Z.length;ae++){var te=Z[ae];te!==null&&(te.lane&=-536870913)}i&=~se}o!==0&&U(e,o,0),p!==0&&f===0&&e.tag!==0&&(e.suspendedLanes|=p&~(x&~n))}function U(e,n,i){e.pendingLanes|=n,e.suspendedLanes&=~n;var o=31-Vt(n);e.entangledLanes|=n,e.entanglements[o]=e.entanglements[o]|1073741824|i&261930}function V(e,n){var i=e.entangledLanes|=n;for(e=e.entanglements;i;){var o=31-Vt(i),f=1<<o;f&n|e[o]&n&&(e[o]|=n),i&=~f}}function $(e,n){var i=n&-n;return i=(i&42)!==0?1:ce(i),(i&(e.suspendedLanes|n))!==0?0:i}function ce(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function pe(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Se(){var e=G.p;return e!==0?e:(e=window.event,e===void 0?32:Hb(e.type))}function Me(e,n){var i=G.p;try{return G.p=e,n()}finally{G.p=i}}var be=Math.random().toString(36).slice(2),ge="__reactFiber$"+be,ve="__reactProps$"+be,Ce="__reactContainer$"+be,ze="__reactEvents$"+be,Ye="__reactListeners$"+be,Gt="__reactHandles$"+be,rt="__reactResources$"+be,Qe="__reactMarker$"+be;function vt(e){delete e[ge],delete e[ve],delete e[ze],delete e[Ye],delete e[Gt]}function kn(e){var n=e[ge];if(n)return n;for(var i=e.parentNode;i;){if(n=i[Ce]||i[ge]){if(i=n.alternate,n.child!==null||i!==null&&i.child!==null)for(e=Nb(e);e!==null;){if(i=e[ge])return i;e=Nb(e)}return n}e=i,i=e.parentNode}return null}function Xn(e){if(e=e[ge]||e[Ce]){var n=e.tag;if(n===5||n===6||n===13||n===31||n===26||n===27||n===3)return e}return null}function vn(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e.stateNode;throw Error(l(33))}function rn(e){var n=e[rt];return n||(n=e[rt]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function Rt(e){e[Qe]=!0}var ja=new Set,Tr={};function $n(e,n){mr(e,n),mr(e+"Capture",n)}function mr(e,n){for(Tr[e]=n,e=0;e<n.length;e++)ja.add(n[e])}var Je=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),yt={},Yr={};function pi(e){return Mr.call(Yr,e)?!0:Mr.call(yt,e)?!1:Je.test(e)?Yr[e]=!0:(yt[e]=!0,!1)}function bt(e,n,i){if(pi(n))if(i===null)e.removeAttribute(n);else{switch(typeof i){case"undefined":case"function":case"symbol":e.removeAttribute(n);return;case"boolean":var o=n.toLowerCase().slice(0,5);if(o!=="data-"&&o!=="aria-"){e.removeAttribute(n);return}}e.setAttribute(n,""+i)}}function pr(e,n,i){if(i===null)e.removeAttribute(n);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttribute(n,""+i)}}function Zn(e,n,i,o){if(o===null)e.removeAttribute(i);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(i);return}e.setAttributeNS(n,i,""+o)}}function Nn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function sv(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function FN(e,n,i){var o=Object.getOwnPropertyDescriptor(e.constructor.prototype,n);if(!e.hasOwnProperty(n)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var f=o.get,p=o.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return f.call(this)},set:function(x){i=""+x,p.call(this,x)}}),Object.defineProperty(e,n,{enumerable:o.enumerable}),{getValue:function(){return i},setValue:function(x){i=""+x},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function Pd(e){if(!e._valueTracker){var n=sv(e)?"checked":"value";e._valueTracker=FN(e,n,""+e[n])}}function cv(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var i=n.getValue(),o="";return e&&(o=sv(e)?e.checked?"true":"false":e.value),e=o,e!==i?(n.setValue(e),!0):!1}function Gs(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var GN=/[\n"\\]/g;function Jn(e){return e.replace(GN,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function Ud(e,n,i,o,f,p,x,j){e.name="",x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"?e.type=x:e.removeAttribute("type"),n!=null?x==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+Nn(n)):e.value!==""+Nn(n)&&(e.value=""+Nn(n)):x!=="submit"&&x!=="reset"||e.removeAttribute("value"),n!=null?Bd(e,x,Nn(n)):i!=null?Bd(e,x,Nn(i)):o!=null&&e.removeAttribute("value"),f==null&&p!=null&&(e.defaultChecked=!!p),f!=null&&(e.checked=f&&typeof f!="function"&&typeof f!="symbol"),j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"?e.name=""+Nn(j):e.removeAttribute("name")}function uv(e,n,i,o,f,p,x,j){if(p!=null&&typeof p!="function"&&typeof p!="symbol"&&typeof p!="boolean"&&(e.type=p),n!=null||i!=null){if(!(p!=="submit"&&p!=="reset"||n!=null)){Pd(e);return}i=i!=null?""+Nn(i):"",n=n!=null?""+Nn(n):i,j||n===e.value||(e.value=n),e.defaultValue=n}o=o??f,o=typeof o!="function"&&typeof o!="symbol"&&!!o,e.checked=j?e.checked:!!o,e.defaultChecked=!!o,x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(e.name=x),Pd(e)}function Bd(e,n,i){n==="number"&&Gs(e.ownerDocument)===e||e.defaultValue===""+i||(e.defaultValue=""+i)}function rl(e,n,i,o){if(e=e.options,n){n={};for(var f=0;f<i.length;f++)n["$"+i[f]]=!0;for(i=0;i<e.length;i++)f=n.hasOwnProperty("$"+e[i].value),e[i].selected!==f&&(e[i].selected=f),f&&o&&(e[i].defaultSelected=!0)}else{for(i=""+Nn(i),n=null,f=0;f<e.length;f++){if(e[f].value===i){e[f].selected=!0,o&&(e[f].defaultSelected=!0);return}n!==null||e[f].disabled||(n=e[f])}n!==null&&(n.selected=!0)}}function dv(e,n,i){if(n!=null&&(n=""+Nn(n),n!==e.value&&(e.value=n),i==null)){e.defaultValue!==n&&(e.defaultValue=n);return}e.defaultValue=i!=null?""+Nn(i):""}function fv(e,n,i,o){if(n==null){if(o!=null){if(i!=null)throw Error(l(92));if(de(o)){if(1<o.length)throw Error(l(93));o=o[0]}i=o}i==null&&(i=""),n=i}i=Nn(n),e.defaultValue=i,o=e.textContent,o===i&&o!==""&&o!==null&&(e.value=o),Pd(e)}function al(e,n){if(n){var i=e.firstChild;if(i&&i===e.lastChild&&i.nodeType===3){i.nodeValue=n;return}}e.textContent=n}var YN=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function hv(e,n,i){var o=n.indexOf("--")===0;i==null||typeof i=="boolean"||i===""?o?e.setProperty(n,""):n==="float"?e.cssFloat="":e[n]="":o?e.setProperty(n,i):typeof i!="number"||i===0||YN.has(n)?n==="float"?e.cssFloat=i:e[n]=(""+i).trim():e[n]=i+"px"}function mv(e,n,i){if(n!=null&&typeof n!="object")throw Error(l(62));if(e=e.style,i!=null){for(var o in i)!i.hasOwnProperty(o)||n!=null&&n.hasOwnProperty(o)||(o.indexOf("--")===0?e.setProperty(o,""):o==="float"?e.cssFloat="":e[o]="");for(var f in n)o=n[f],n.hasOwnProperty(f)&&i[f]!==o&&hv(e,f,o)}else for(var p in n)n.hasOwnProperty(p)&&hv(e,p,n[p])}function Hd(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var KN=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),XN=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Ys(e){return XN.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Kr(){}var qd=null;function Id(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var il=null,ll=null;function pv(e){var n=Xn(e);if(n&&(e=n.stateNode)){var i=e[ve]||null;e:switch(e=n.stateNode,n.type){case"input":if(Ud(e,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name),n=i.name,i.type==="radio"&&n!=null){for(i=e;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll('input[name="'+Jn(""+n)+'"][type="radio"]'),n=0;n<i.length;n++){var o=i[n];if(o!==e&&o.form===e.form){var f=o[ve]||null;if(!f)throw Error(l(90));Ud(o,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name)}}for(n=0;n<i.length;n++)o=i[n],o.form===e.form&&cv(o)}break e;case"textarea":dv(e,i.value,i.defaultValue);break e;case"select":n=i.value,n!=null&&rl(e,!!i.multiple,n,!1)}}}var Qd=!1;function vv(e,n,i){if(Qd)return e(n,i);Qd=!0;try{var o=e(n);return o}finally{if(Qd=!1,(il!==null||ll!==null)&&(zc(),il&&(n=il,e=ll,ll=il=null,pv(n),e)))for(n=0;n<e.length;n++)pv(e[n])}}function so(e,n){var i=e.stateNode;if(i===null)return null;var o=i[ve]||null;if(o===null)return null;i=o[n];e:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(o=!o.disabled)||(e=e.type,o=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!o;break e;default:e=!1}if(e)return null;if(i&&typeof i!="function")throw Error(l(231,n,typeof i));return i}var Xr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Vd=!1;if(Xr)try{var co={};Object.defineProperty(co,"passive",{get:function(){Vd=!0}}),window.addEventListener("test",co,co),window.removeEventListener("test",co,co)}catch{Vd=!1}var Ra=null,Fd=null,Ks=null;function gv(){if(Ks)return Ks;var e,n=Fd,i=n.length,o,f="value"in Ra?Ra.value:Ra.textContent,p=f.length;for(e=0;e<i&&n[e]===f[e];e++);var x=i-e;for(o=1;o<=x&&n[i-o]===f[p-o];o++);return Ks=f.slice(e,1<o?1-o:void 0)}function Xs(e){var n=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&n===13&&(e=13)):e=n,e===10&&(e=13),32<=e||e===13?e:0}function $s(){return!0}function yv(){return!1}function En(e){function n(i,o,f,p,x){this._reactName=i,this._targetInst=f,this.type=o,this.nativeEvent=p,this.target=x,this.currentTarget=null;for(var j in e)e.hasOwnProperty(j)&&(i=e[j],this[j]=i?i(p):p[j]);return this.isDefaultPrevented=(p.defaultPrevented!=null?p.defaultPrevented:p.returnValue===!1)?$s:yv,this.isPropagationStopped=yv,this}return y(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var i=this.nativeEvent;i&&(i.preventDefault?i.preventDefault():typeof i.returnValue!="unknown"&&(i.returnValue=!1),this.isDefaultPrevented=$s)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=$s)},persist:function(){},isPersistent:$s}),n}var vi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Zs=En(vi),uo=y({},vi,{view:0,detail:0}),$N=En(uo),Gd,Yd,fo,Js=y({},uo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Xd,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==fo&&(fo&&e.type==="mousemove"?(Gd=e.screenX-fo.screenX,Yd=e.screenY-fo.screenY):Yd=Gd=0,fo=e),Gd)},movementY:function(e){return"movementY"in e?e.movementY:Yd}}),bv=En(Js),ZN=y({},Js,{dataTransfer:0}),JN=En(ZN),WN=y({},uo,{relatedTarget:0}),Kd=En(WN),eE=y({},vi,{animationName:0,elapsedTime:0,pseudoElement:0}),tE=En(eE),nE=y({},vi,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),rE=En(nE),aE=y({},vi,{data:0}),xv=En(aE),iE={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},lE={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},oE={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function sE(e){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(e):(e=oE[e])?!!n[e]:!1}function Xd(){return sE}var cE=y({},uo,{key:function(e){if(e.key){var n=iE[e.key]||e.key;if(n!=="Unidentified")return n}return e.type==="keypress"?(e=Xs(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?lE[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Xd,charCode:function(e){return e.type==="keypress"?Xs(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Xs(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),uE=En(cE),dE=y({},Js,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Sv=En(dE),fE=y({},uo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Xd}),hE=En(fE),mE=y({},vi,{propertyName:0,elapsedTime:0,pseudoElement:0}),pE=En(mE),vE=y({},Js,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),gE=En(vE),yE=y({},vi,{newState:0,oldState:0}),bE=En(yE),xE=[9,13,27,32],$d=Xr&&"CompositionEvent"in window,ho=null;Xr&&"documentMode"in document&&(ho=document.documentMode);var SE=Xr&&"TextEvent"in window&&!ho,wv=Xr&&(!$d||ho&&8<ho&&11>=ho),Cv=" ",Nv=!1;function Ev(e,n){switch(e){case"keyup":return xE.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function jv(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ol=!1;function wE(e,n){switch(e){case"compositionend":return jv(n);case"keypress":return n.which!==32?null:(Nv=!0,Cv);case"textInput":return e=n.data,e===Cv&&Nv?null:e;default:return null}}function CE(e,n){if(ol)return e==="compositionend"||!$d&&Ev(e,n)?(e=gv(),Ks=Fd=Ra=null,ol=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return wv&&n.locale!=="ko"?null:n.data;default:return null}}var NE={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Rv(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n==="input"?!!NE[e.type]:n==="textarea"}function Mv(e,n,i,o){il?ll?ll.push(o):ll=[o]:il=o,n=qc(n,"onChange"),0<n.length&&(i=new Zs("onChange","change",null,i,o),e.push({event:i,listeners:n}))}var mo=null,po=null;function EE(e){ub(e,0)}function Ws(e){var n=vn(e);if(cv(n))return e}function Ov(e,n){if(e==="change")return n}var Dv=!1;if(Xr){var Zd;if(Xr){var Jd="oninput"in document;if(!Jd){var Tv=document.createElement("div");Tv.setAttribute("oninput","return;"),Jd=typeof Tv.oninput=="function"}Zd=Jd}else Zd=!1;Dv=Zd&&(!document.documentMode||9<document.documentMode)}function _v(){mo&&(mo.detachEvent("onpropertychange",Av),po=mo=null)}function Av(e){if(e.propertyName==="value"&&Ws(po)){var n=[];Mv(n,po,e,Id(e)),vv(EE,n)}}function jE(e,n,i){e==="focusin"?(_v(),mo=n,po=i,mo.attachEvent("onpropertychange",Av)):e==="focusout"&&_v()}function RE(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ws(po)}function ME(e,n){if(e==="click")return Ws(n)}function OE(e,n){if(e==="input"||e==="change")return Ws(n)}function DE(e,n){return e===n&&(e!==0||1/e===1/n)||e!==e&&n!==n}var Pn=typeof Object.is=="function"?Object.is:DE;function vo(e,n){if(Pn(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;var i=Object.keys(e),o=Object.keys(n);if(i.length!==o.length)return!1;for(o=0;o<i.length;o++){var f=i[o];if(!Mr.call(n,f)||!Pn(e[f],n[f]))return!1}return!0}function zv(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Lv(e,n){var i=zv(e);e=0;for(var o;i;){if(i.nodeType===3){if(o=e+i.textContent.length,e<=n&&o>=n)return{node:i,offset:n-e};e=o}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=zv(i)}}function kv(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?kv(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function Pv(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var n=Gs(e.document);n instanceof e.HTMLIFrameElement;){try{var i=typeof n.contentWindow.location.href=="string"}catch{i=!1}if(i)e=n.contentWindow;else break;n=Gs(e.document)}return n}function Wd(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n&&(n==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||n==="textarea"||e.contentEditable==="true")}var TE=Xr&&"documentMode"in document&&11>=document.documentMode,sl=null,ef=null,go=null,tf=!1;function Uv(e,n,i){var o=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;tf||sl==null||sl!==Gs(o)||(o=sl,"selectionStart"in o&&Wd(o)?o={start:o.selectionStart,end:o.selectionEnd}:(o=(o.ownerDocument&&o.ownerDocument.defaultView||window).getSelection(),o={anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset}),go&&vo(go,o)||(go=o,o=qc(ef,"onSelect"),0<o.length&&(n=new Zs("onSelect","select",null,n,i),e.push({event:n,listeners:o}),n.target=sl)))}function gi(e,n){var i={};return i[e.toLowerCase()]=n.toLowerCase(),i["Webkit"+e]="webkit"+n,i["Moz"+e]="moz"+n,i}var cl={animationend:gi("Animation","AnimationEnd"),animationiteration:gi("Animation","AnimationIteration"),animationstart:gi("Animation","AnimationStart"),transitionrun:gi("Transition","TransitionRun"),transitionstart:gi("Transition","TransitionStart"),transitioncancel:gi("Transition","TransitionCancel"),transitionend:gi("Transition","TransitionEnd")},nf={},Bv={};Xr&&(Bv=document.createElement("div").style,"AnimationEvent"in window||(delete cl.animationend.animation,delete cl.animationiteration.animation,delete cl.animationstart.animation),"TransitionEvent"in window||delete cl.transitionend.transition);function yi(e){if(nf[e])return nf[e];if(!cl[e])return e;var n=cl[e],i;for(i in n)if(n.hasOwnProperty(i)&&i in Bv)return nf[e]=n[i];return e}var Hv=yi("animationend"),qv=yi("animationiteration"),Iv=yi("animationstart"),_E=yi("transitionrun"),AE=yi("transitionstart"),zE=yi("transitioncancel"),Qv=yi("transitionend"),Vv=new Map,rf="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");rf.push("scrollEnd");function vr(e,n){Vv.set(e,n),$n(n,[e])}var ec=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var n=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(n))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Wn=[],ul=0,af=0;function tc(){for(var e=ul,n=af=ul=0;n<e;){var i=Wn[n];Wn[n++]=null;var o=Wn[n];Wn[n++]=null;var f=Wn[n];Wn[n++]=null;var p=Wn[n];if(Wn[n++]=null,o!==null&&f!==null){var x=o.pending;x===null?f.next=f:(f.next=x.next,x.next=f),o.pending=f}p!==0&&Fv(i,f,p)}}function nc(e,n,i,o){Wn[ul++]=e,Wn[ul++]=n,Wn[ul++]=i,Wn[ul++]=o,af|=o,e.lanes|=o,e=e.alternate,e!==null&&(e.lanes|=o)}function lf(e,n,i,o){return nc(e,n,i,o),rc(e)}function bi(e,n){return nc(e,null,null,n),rc(e)}function Fv(e,n,i){e.lanes|=i;var o=e.alternate;o!==null&&(o.lanes|=i);for(var f=!1,p=e.return;p!==null;)p.childLanes|=i,o=p.alternate,o!==null&&(o.childLanes|=i),p.tag===22&&(e=p.stateNode,e===null||e._visibility&1||(f=!0)),e=p,p=p.return;return e.tag===3?(p=e.stateNode,f&&n!==null&&(f=31-Vt(i),e=p.hiddenUpdates,o=e[f],o===null?e[f]=[n]:o.push(n),n.lane=i|536870912),p):null}function rc(e){if(50<Bo)throw Bo=0,ph=null,Error(l(185));for(var n=e.return;n!==null;)e=n,n=e.return;return e.tag===3?e.stateNode:null}var dl={};function LE(e,n,i,o){this.tag=e,this.key=i,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=o,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Un(e,n,i,o){return new LE(e,n,i,o)}function of(e){return e=e.prototype,!(!e||!e.isReactComponent)}function $r(e,n){var i=e.alternate;return i===null?(i=Un(e.tag,n,e.key,e.mode),i.elementType=e.elementType,i.type=e.type,i.stateNode=e.stateNode,i.alternate=e,e.alternate=i):(i.pendingProps=n,i.type=e.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=e.flags&65011712,i.childLanes=e.childLanes,i.lanes=e.lanes,i.child=e.child,i.memoizedProps=e.memoizedProps,i.memoizedState=e.memoizedState,i.updateQueue=e.updateQueue,n=e.dependencies,i.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},i.sibling=e.sibling,i.index=e.index,i.ref=e.ref,i.refCleanup=e.refCleanup,i}function Gv(e,n){e.flags&=65011714;var i=e.alternate;return i===null?(e.childLanes=0,e.lanes=n,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=i.childLanes,e.lanes=i.lanes,e.child=i.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=i.memoizedProps,e.memoizedState=i.memoizedState,e.updateQueue=i.updateQueue,e.type=i.type,n=i.dependencies,e.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),e}function ac(e,n,i,o,f,p){var x=0;if(o=e,typeof e=="function")of(e)&&(x=1);else if(typeof e=="string")x=Hj(e,i,ne.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case A:return e=Un(31,i,n,f),e.elementType=A,e.lanes=p,e;case S:return xi(i.children,f,p,n);case R:x=8,f|=24;break;case M:return e=Un(12,i,n,f|2),e.elementType=M,e.lanes=p,e;case k:return e=Un(13,i,n,f),e.elementType=k,e.lanes=p,e;case I:return e=Un(19,i,n,f),e.elementType=I,e.lanes=p,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case _:x=10;break e;case O:x=9;break e;case z:x=11;break e;case N:x=14;break e;case T:x=16,o=null;break e}x=29,i=Error(l(130,e===null?"null":typeof e,"")),o=null}return n=Un(x,i,n,f),n.elementType=e,n.type=o,n.lanes=p,n}function xi(e,n,i,o){return e=Un(7,e,o,n),e.lanes=i,e}function sf(e,n,i){return e=Un(6,e,null,n),e.lanes=i,e}function Yv(e){var n=Un(18,null,null,0);return n.stateNode=e,n}function cf(e,n,i){return n=Un(4,e.children!==null?e.children:[],e.key,n),n.lanes=i,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}var Kv=new WeakMap;function er(e,n){if(typeof e=="object"&&e!==null){var i=Kv.get(e);return i!==void 0?i:(n={value:e,source:n,stack:fi(n)},Kv.set(e,n),n)}return{value:e,source:n,stack:fi(n)}}var fl=[],hl=0,ic=null,yo=0,tr=[],nr=0,Ma=null,_r=1,Ar="";function Zr(e,n){fl[hl++]=yo,fl[hl++]=ic,ic=e,yo=n}function Xv(e,n,i){tr[nr++]=_r,tr[nr++]=Ar,tr[nr++]=Ma,Ma=e;var o=_r;e=Ar;var f=32-Vt(o)-1;o&=~(1<<f),i+=1;var p=32-Vt(n)+f;if(30<p){var x=f-f%5;p=(o&(1<<x)-1).toString(32),o>>=x,f-=x,_r=1<<32-Vt(n)+f|i<<f|o,Ar=p+e}else _r=1<<p|i<<f|o,Ar=e}function uf(e){e.return!==null&&(Zr(e,1),Xv(e,1,0))}function df(e){for(;e===ic;)ic=fl[--hl],fl[hl]=null,yo=fl[--hl],fl[hl]=null;for(;e===Ma;)Ma=tr[--nr],tr[nr]=null,Ar=tr[--nr],tr[nr]=null,_r=tr[--nr],tr[nr]=null}function $v(e,n){tr[nr++]=_r,tr[nr++]=Ar,tr[nr++]=Ma,_r=n.id,Ar=n.overflow,Ma=e}var an=null,xt=null,Ze=!1,Oa=null,rr=!1,ff=Error(l(519));function Da(e){var n=Error(l(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw bo(er(n,e)),ff}function Zv(e){var n=e.stateNode,i=e.type,o=e.memoizedProps;switch(n[ge]=e,n[ve]=o,i){case"dialog":Fe("cancel",n),Fe("close",n);break;case"iframe":case"object":case"embed":Fe("load",n);break;case"video":case"audio":for(i=0;i<qo.length;i++)Fe(qo[i],n);break;case"source":Fe("error",n);break;case"img":case"image":case"link":Fe("error",n),Fe("load",n);break;case"details":Fe("toggle",n);break;case"input":Fe("invalid",n),uv(n,o.value,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name,!0);break;case"select":Fe("invalid",n);break;case"textarea":Fe("invalid",n),fv(n,o.value,o.defaultValue,o.children)}i=o.children,typeof i!="string"&&typeof i!="number"&&typeof i!="bigint"||n.textContent===""+i||o.suppressHydrationWarning===!0||mb(n.textContent,i)?(o.popover!=null&&(Fe("beforetoggle",n),Fe("toggle",n)),o.onScroll!=null&&Fe("scroll",n),o.onScrollEnd!=null&&Fe("scrollend",n),o.onClick!=null&&(n.onclick=Kr),n=!0):n=!1,n||Da(e,!0)}function Jv(e){for(an=e.return;an;)switch(an.tag){case 5:case 31:case 13:rr=!1;return;case 27:case 3:rr=!0;return;default:an=an.return}}function ml(e){if(e!==an)return!1;if(!Ze)return Jv(e),Ze=!0,!1;var n=e.tag,i;if((i=n!==3&&n!==27)&&((i=n===5)&&(i=e.type,i=!(i!=="form"&&i!=="button")||Dh(e.type,e.memoizedProps)),i=!i),i&&xt&&Da(e),Jv(e),n===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(317));xt=Cb(e)}else if(n===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(317));xt=Cb(e)}else n===27?(n=xt,Va(e.type)?(e=Lh,Lh=null,xt=e):xt=n):xt=an?ir(e.stateNode.nextSibling):null;return!0}function Si(){xt=an=null,Ze=!1}function hf(){var e=Oa;return e!==null&&(On===null?On=e:On.push.apply(On,e),Oa=null),e}function bo(e){Oa===null?Oa=[e]:Oa.push(e)}var mf=D(null),wi=null,Jr=null;function Ta(e,n,i){J(mf,n._currentValue),n._currentValue=i}function Wr(e){e._currentValue=mf.current,Q(mf)}function pf(e,n,i){for(;e!==null;){var o=e.alternate;if((e.childLanes&n)!==n?(e.childLanes|=n,o!==null&&(o.childLanes|=n)):o!==null&&(o.childLanes&n)!==n&&(o.childLanes|=n),e===i)break;e=e.return}}function vf(e,n,i,o){var f=e.child;for(f!==null&&(f.return=e);f!==null;){var p=f.dependencies;if(p!==null){var x=f.child;p=p.firstContext;e:for(;p!==null;){var j=p;p=f;for(var P=0;P<n.length;P++)if(j.context===n[P]){p.lanes|=i,j=p.alternate,j!==null&&(j.lanes|=i),pf(p.return,i,e),o||(x=null);break e}p=j.next}}else if(f.tag===18){if(x=f.return,x===null)throw Error(l(341));x.lanes|=i,p=x.alternate,p!==null&&(p.lanes|=i),pf(x,i,e),x=null}else x=f.child;if(x!==null)x.return=f;else for(x=f;x!==null;){if(x===e){x=null;break}if(f=x.sibling,f!==null){f.return=x.return,x=f;break}x=x.return}f=x}}function pl(e,n,i,o){e=null;for(var f=n,p=!1;f!==null;){if(!p){if((f.flags&524288)!==0)p=!0;else if((f.flags&262144)!==0)break}if(f.tag===10){var x=f.alternate;if(x===null)throw Error(l(387));if(x=x.memoizedProps,x!==null){var j=f.type;Pn(f.pendingProps.value,x.value)||(e!==null?e.push(j):e=[j])}}else if(f===re.current){if(x=f.alternate,x===null)throw Error(l(387));x.memoizedState.memoizedState!==f.memoizedState.memoizedState&&(e!==null?e.push(Go):e=[Go])}f=f.return}e!==null&&vf(n,e,i,o),n.flags|=262144}function lc(e){for(e=e.firstContext;e!==null;){if(!Pn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ci(e){wi=e,Jr=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function ln(e){return Wv(wi,e)}function oc(e,n){return wi===null&&Ci(e),Wv(e,n)}function Wv(e,n){var i=n._currentValue;if(n={context:n,memoizedValue:i,next:null},Jr===null){if(e===null)throw Error(l(308));Jr=n,e.dependencies={lanes:0,firstContext:n},e.flags|=524288}else Jr=Jr.next=n;return i}var kE=typeof AbortController<"u"?AbortController:function(){var e=[],n=this.signal={aborted:!1,addEventListener:function(i,o){e.push(o)}};this.abort=function(){n.aborted=!0,e.forEach(function(i){return i()})}},PE=t.unstable_scheduleCallback,UE=t.unstable_NormalPriority,Bt={$$typeof:_,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function gf(){return{controller:new kE,data:new Map,refCount:0}}function xo(e){e.refCount--,e.refCount===0&&PE(UE,function(){e.controller.abort()})}var So=null,yf=0,vl=0,gl=null;function BE(e,n){if(So===null){var i=So=[];yf=0,vl=Sh(),gl={status:"pending",value:void 0,then:function(o){i.push(o)}}}return yf++,n.then(eg,eg),n}function eg(){if(--yf===0&&So!==null){gl!==null&&(gl.status="fulfilled");var e=So;So=null,vl=0,gl=null;for(var n=0;n<e.length;n++)(0,e[n])()}}function HE(e,n){var i=[],o={status:"pending",value:null,reason:null,then:function(f){i.push(f)}};return e.then(function(){o.status="fulfilled",o.value=n;for(var f=0;f<i.length;f++)(0,i[f])(n)},function(f){for(o.status="rejected",o.reason=f,f=0;f<i.length;f++)(0,i[f])(void 0)}),o}var tg=L.S;L.S=function(e,n){Uy=wt(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&BE(e,n),tg!==null&&tg(e,n)};var Ni=D(null);function bf(){var e=Ni.current;return e!==null?e:ft.pooledCache}function sc(e,n){n===null?J(Ni,Ni.current):J(Ni,n.pool)}function ng(){var e=bf();return e===null?null:{parent:Bt._currentValue,pool:e}}var yl=Error(l(460)),xf=Error(l(474)),cc=Error(l(542)),uc={then:function(){}};function rg(e){return e=e.status,e==="fulfilled"||e==="rejected"}function ag(e,n,i){switch(i=e[i],i===void 0?e.push(n):i!==n&&(n.then(Kr,Kr),n=i),n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,lg(e),e;default:if(typeof n.status=="string")n.then(Kr,Kr);else{if(e=ft,e!==null&&100<e.shellSuspendCounter)throw Error(l(482));e=n,e.status="pending",e.then(function(o){if(n.status==="pending"){var f=n;f.status="fulfilled",f.value=o}},function(o){if(n.status==="pending"){var f=n;f.status="rejected",f.reason=o}})}switch(n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,lg(e),e}throw ji=n,yl}}function Ei(e){try{var n=e._init;return n(e._payload)}catch(i){throw i!==null&&typeof i=="object"&&typeof i.then=="function"?(ji=i,yl):i}}var ji=null;function ig(){if(ji===null)throw Error(l(459));var e=ji;return ji=null,e}function lg(e){if(e===yl||e===cc)throw Error(l(483))}var bl=null,wo=0;function dc(e){var n=wo;return wo+=1,bl===null&&(bl=[]),ag(bl,e,n)}function Co(e,n){n=n.props.ref,e.ref=n!==void 0?n:null}function fc(e,n){throw n.$$typeof===w?Error(l(525)):(e=Object.prototype.toString.call(n),Error(l(31,e==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":e)))}function og(e){function n(F,H){if(e){var Y=F.deletions;Y===null?(F.deletions=[H],F.flags|=16):Y.push(H)}}function i(F,H){if(!e)return null;for(;H!==null;)n(F,H),H=H.sibling;return null}function o(F){for(var H=new Map;F!==null;)F.key!==null?H.set(F.key,F):H.set(F.index,F),F=F.sibling;return H}function f(F,H){return F=$r(F,H),F.index=0,F.sibling=null,F}function p(F,H,Y){return F.index=Y,e?(Y=F.alternate,Y!==null?(Y=Y.index,Y<H?(F.flags|=67108866,H):Y):(F.flags|=67108866,H)):(F.flags|=1048576,H)}function x(F){return e&&F.alternate===null&&(F.flags|=67108866),F}function j(F,H,Y,oe){return H===null||H.tag!==6?(H=sf(Y,F.mode,oe),H.return=F,H):(H=f(H,Y),H.return=F,H)}function P(F,H,Y,oe){var Oe=Y.type;return Oe===S?ae(F,H,Y.props.children,oe,Y.key):H!==null&&(H.elementType===Oe||typeof Oe=="object"&&Oe!==null&&Oe.$$typeof===T&&Ei(Oe)===H.type)?(H=f(H,Y.props),Co(H,Y),H.return=F,H):(H=ac(Y.type,Y.key,Y.props,null,F.mode,oe),Co(H,Y),H.return=F,H)}function X(F,H,Y,oe){return H===null||H.tag!==4||H.stateNode.containerInfo!==Y.containerInfo||H.stateNode.implementation!==Y.implementation?(H=cf(Y,F.mode,oe),H.return=F,H):(H=f(H,Y.children||[]),H.return=F,H)}function ae(F,H,Y,oe,Oe){return H===null||H.tag!==7?(H=xi(Y,F.mode,oe,Oe),H.return=F,H):(H=f(H,Y),H.return=F,H)}function se(F,H,Y){if(typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint")return H=sf(""+H,F.mode,Y),H.return=F,H;if(typeof H=="object"&&H!==null){switch(H.$$typeof){case C:return Y=ac(H.type,H.key,H.props,null,F.mode,Y),Co(Y,H),Y.return=F,Y;case E:return H=cf(H,F.mode,Y),H.return=F,H;case T:return H=Ei(H),se(F,H,Y)}if(de(H)||W(H))return H=xi(H,F.mode,Y,null),H.return=F,H;if(typeof H.then=="function")return se(F,dc(H),Y);if(H.$$typeof===_)return se(F,oc(F,H),Y);fc(F,H)}return null}function Z(F,H,Y,oe){var Oe=H!==null?H.key:null;if(typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint")return Oe!==null?null:j(F,H,""+Y,oe);if(typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case C:return Y.key===Oe?P(F,H,Y,oe):null;case E:return Y.key===Oe?X(F,H,Y,oe):null;case T:return Y=Ei(Y),Z(F,H,Y,oe)}if(de(Y)||W(Y))return Oe!==null?null:ae(F,H,Y,oe,null);if(typeof Y.then=="function")return Z(F,H,dc(Y),oe);if(Y.$$typeof===_)return Z(F,H,oc(F,Y),oe);fc(F,Y)}return null}function te(F,H,Y,oe,Oe){if(typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint")return F=F.get(Y)||null,j(H,F,""+oe,Oe);if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case C:return F=F.get(oe.key===null?Y:oe.key)||null,P(H,F,oe,Oe);case E:return F=F.get(oe.key===null?Y:oe.key)||null,X(H,F,oe,Oe);case T:return oe=Ei(oe),te(F,H,Y,oe,Oe)}if(de(oe)||W(oe))return F=F.get(Y)||null,ae(H,F,oe,Oe,null);if(typeof oe.then=="function")return te(F,H,Y,dc(oe),Oe);if(oe.$$typeof===_)return te(F,H,Y,oc(H,oe),Oe);fc(H,oe)}return null}function we(F,H,Y,oe){for(var Oe=null,We=null,je=H,Be=H=0,Xe=null;je!==null&&Be<Y.length;Be++){je.index>Be?(Xe=je,je=null):Xe=je.sibling;var et=Z(F,je,Y[Be],oe);if(et===null){je===null&&(je=Xe);break}e&&je&&et.alternate===null&&n(F,je),H=p(et,H,Be),We===null?Oe=et:We.sibling=et,We=et,je=Xe}if(Be===Y.length)return i(F,je),Ze&&Zr(F,Be),Oe;if(je===null){for(;Be<Y.length;Be++)je=se(F,Y[Be],oe),je!==null&&(H=p(je,H,Be),We===null?Oe=je:We.sibling=je,We=je);return Ze&&Zr(F,Be),Oe}for(je=o(je);Be<Y.length;Be++)Xe=te(je,F,Be,Y[Be],oe),Xe!==null&&(e&&Xe.alternate!==null&&je.delete(Xe.key===null?Be:Xe.key),H=p(Xe,H,Be),We===null?Oe=Xe:We.sibling=Xe,We=Xe);return e&&je.forEach(function(Xa){return n(F,Xa)}),Ze&&Zr(F,Be),Oe}function _e(F,H,Y,oe){if(Y==null)throw Error(l(151));for(var Oe=null,We=null,je=H,Be=H=0,Xe=null,et=Y.next();je!==null&&!et.done;Be++,et=Y.next()){je.index>Be?(Xe=je,je=null):Xe=je.sibling;var Xa=Z(F,je,et.value,oe);if(Xa===null){je===null&&(je=Xe);break}e&&je&&Xa.alternate===null&&n(F,je),H=p(Xa,H,Be),We===null?Oe=Xa:We.sibling=Xa,We=Xa,je=Xe}if(et.done)return i(F,je),Ze&&Zr(F,Be),Oe;if(je===null){for(;!et.done;Be++,et=Y.next())et=se(F,et.value,oe),et!==null&&(H=p(et,H,Be),We===null?Oe=et:We.sibling=et,We=et);return Ze&&Zr(F,Be),Oe}for(je=o(je);!et.done;Be++,et=Y.next())et=te(je,F,Be,et.value,oe),et!==null&&(e&&et.alternate!==null&&je.delete(et.key===null?Be:et.key),H=p(et,H,Be),We===null?Oe=et:We.sibling=et,We=et);return e&&je.forEach(function(Zj){return n(F,Zj)}),Ze&&Zr(F,Be),Oe}function ut(F,H,Y,oe){if(typeof Y=="object"&&Y!==null&&Y.type===S&&Y.key===null&&(Y=Y.props.children),typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case C:e:{for(var Oe=Y.key;H!==null;){if(H.key===Oe){if(Oe=Y.type,Oe===S){if(H.tag===7){i(F,H.sibling),oe=f(H,Y.props.children),oe.return=F,F=oe;break e}}else if(H.elementType===Oe||typeof Oe=="object"&&Oe!==null&&Oe.$$typeof===T&&Ei(Oe)===H.type){i(F,H.sibling),oe=f(H,Y.props),Co(oe,Y),oe.return=F,F=oe;break e}i(F,H);break}else n(F,H);H=H.sibling}Y.type===S?(oe=xi(Y.props.children,F.mode,oe,Y.key),oe.return=F,F=oe):(oe=ac(Y.type,Y.key,Y.props,null,F.mode,oe),Co(oe,Y),oe.return=F,F=oe)}return x(F);case E:e:{for(Oe=Y.key;H!==null;){if(H.key===Oe)if(H.tag===4&&H.stateNode.containerInfo===Y.containerInfo&&H.stateNode.implementation===Y.implementation){i(F,H.sibling),oe=f(H,Y.children||[]),oe.return=F,F=oe;break e}else{i(F,H);break}else n(F,H);H=H.sibling}oe=cf(Y,F.mode,oe),oe.return=F,F=oe}return x(F);case T:return Y=Ei(Y),ut(F,H,Y,oe)}if(de(Y))return we(F,H,Y,oe);if(W(Y)){if(Oe=W(Y),typeof Oe!="function")throw Error(l(150));return Y=Oe.call(Y),_e(F,H,Y,oe)}if(typeof Y.then=="function")return ut(F,H,dc(Y),oe);if(Y.$$typeof===_)return ut(F,H,oc(F,Y),oe);fc(F,Y)}return typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint"?(Y=""+Y,H!==null&&H.tag===6?(i(F,H.sibling),oe=f(H,Y),oe.return=F,F=oe):(i(F,H),oe=sf(Y,F.mode,oe),oe.return=F,F=oe),x(F)):i(F,H)}return function(F,H,Y,oe){try{wo=0;var Oe=ut(F,H,Y,oe);return bl=null,Oe}catch(je){if(je===yl||je===cc)throw je;var We=Un(29,je,null,F.mode);return We.lanes=oe,We.return=F,We}finally{}}}var Ri=og(!0),sg=og(!1),_a=!1;function Sf(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function wf(e,n){e=e.updateQueue,n.updateQueue===e&&(n.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Aa(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function za(e,n,i){var o=e.updateQueue;if(o===null)return null;if(o=o.shared,(nt&2)!==0){var f=o.pending;return f===null?n.next=n:(n.next=f.next,f.next=n),o.pending=n,n=rc(e),Fv(e,null,i),n}return nc(e,o,n,i),rc(e)}function No(e,n,i){if(n=n.updateQueue,n!==null&&(n=n.shared,(i&4194048)!==0)){var o=n.lanes;o&=e.pendingLanes,i|=o,n.lanes=i,V(e,i)}}function Cf(e,n){var i=e.updateQueue,o=e.alternate;if(o!==null&&(o=o.updateQueue,i===o)){var f=null,p=null;if(i=i.firstBaseUpdate,i!==null){do{var x={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};p===null?f=p=x:p=p.next=x,i=i.next}while(i!==null);p===null?f=p=n:p=p.next=n}else f=p=n;i={baseState:o.baseState,firstBaseUpdate:f,lastBaseUpdate:p,shared:o.shared,callbacks:o.callbacks},e.updateQueue=i;return}e=i.lastBaseUpdate,e===null?i.firstBaseUpdate=n:e.next=n,i.lastBaseUpdate=n}var Nf=!1;function Eo(){if(Nf){var e=gl;if(e!==null)throw e}}function jo(e,n,i,o){Nf=!1;var f=e.updateQueue;_a=!1;var p=f.firstBaseUpdate,x=f.lastBaseUpdate,j=f.shared.pending;if(j!==null){f.shared.pending=null;var P=j,X=P.next;P.next=null,x===null?p=X:x.next=X,x=P;var ae=e.alternate;ae!==null&&(ae=ae.updateQueue,j=ae.lastBaseUpdate,j!==x&&(j===null?ae.firstBaseUpdate=X:j.next=X,ae.lastBaseUpdate=P))}if(p!==null){var se=f.baseState;x=0,ae=X=P=null,j=p;do{var Z=j.lane&-536870913,te=Z!==j.lane;if(te?(Ke&Z)===Z:(o&Z)===Z){Z!==0&&Z===vl&&(Nf=!0),ae!==null&&(ae=ae.next={lane:0,tag:j.tag,payload:j.payload,callback:null,next:null});e:{var we=e,_e=j;Z=n;var ut=i;switch(_e.tag){case 1:if(we=_e.payload,typeof we=="function"){se=we.call(ut,se,Z);break e}se=we;break e;case 3:we.flags=we.flags&-65537|128;case 0:if(we=_e.payload,Z=typeof we=="function"?we.call(ut,se,Z):we,Z==null)break e;se=y({},se,Z);break e;case 2:_a=!0}}Z=j.callback,Z!==null&&(e.flags|=64,te&&(e.flags|=8192),te=f.callbacks,te===null?f.callbacks=[Z]:te.push(Z))}else te={lane:Z,tag:j.tag,payload:j.payload,callback:j.callback,next:null},ae===null?(X=ae=te,P=se):ae=ae.next=te,x|=Z;if(j=j.next,j===null){if(j=f.shared.pending,j===null)break;te=j,j=te.next,te.next=null,f.lastBaseUpdate=te,f.shared.pending=null}}while(!0);ae===null&&(P=se),f.baseState=P,f.firstBaseUpdate=X,f.lastBaseUpdate=ae,p===null&&(f.shared.lanes=0),Ba|=x,e.lanes=x,e.memoizedState=se}}function cg(e,n){if(typeof e!="function")throw Error(l(191,e));e.call(n)}function ug(e,n){var i=e.callbacks;if(i!==null)for(e.callbacks=null,e=0;e<i.length;e++)cg(i[e],n)}var xl=D(null),hc=D(0);function dg(e,n){e=sa,J(hc,e),J(xl,n),sa=e|n.baseLanes}function Ef(){J(hc,sa),J(xl,xl.current)}function jf(){sa=hc.current,Q(xl),Q(hc)}var Bn=D(null),ar=null;function La(e){var n=e.alternate;J(zt,zt.current&1),J(Bn,e),ar===null&&(n===null||xl.current!==null||n.memoizedState!==null)&&(ar=e)}function Rf(e){J(zt,zt.current),J(Bn,e),ar===null&&(ar=e)}function fg(e){e.tag===22?(J(zt,zt.current),J(Bn,e),ar===null&&(ar=e)):ka()}function ka(){J(zt,zt.current),J(Bn,Bn.current)}function Hn(e){Q(Bn),ar===e&&(ar=null),Q(zt)}var zt=D(0);function mc(e){for(var n=e;n!==null;){if(n.tag===13){var i=n.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||Ah(i)||zh(i)))return n}else if(n.tag===19&&(n.memoizedProps.revealOrder==="forwards"||n.memoizedProps.revealOrder==="backwards"||n.memoizedProps.revealOrder==="unstable_legacy-backwards"||n.memoizedProps.revealOrder==="together")){if((n.flags&128)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var ea=0,ke=null,st=null,Ht=null,pc=!1,Sl=!1,Mi=!1,vc=0,Ro=0,wl=null,qE=0;function Mt(){throw Error(l(321))}function Mf(e,n){if(n===null)return!1;for(var i=0;i<n.length&&i<e.length;i++)if(!Pn(e[i],n[i]))return!1;return!0}function Of(e,n,i,o,f,p){return ea=p,ke=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,L.H=e===null||e.memoizedState===null?Xg:Vf,Mi=!1,p=i(o,f),Mi=!1,Sl&&(p=mg(n,i,o,f)),hg(e),p}function hg(e){L.H=Do;var n=st!==null&&st.next!==null;if(ea=0,Ht=st=ke=null,pc=!1,Ro=0,wl=null,n)throw Error(l(300));e===null||qt||(e=e.dependencies,e!==null&&lc(e)&&(qt=!0))}function mg(e,n,i,o){ke=e;var f=0;do{if(Sl&&(wl=null),Ro=0,Sl=!1,25<=f)throw Error(l(301));if(f+=1,Ht=st=null,e.updateQueue!=null){var p=e.updateQueue;p.lastEffect=null,p.events=null,p.stores=null,p.memoCache!=null&&(p.memoCache.index=0)}L.H=$g,p=n(i,o)}while(Sl);return p}function IE(){var e=L.H,n=e.useState()[0];return n=typeof n.then=="function"?Mo(n):n,e=e.useState()[0],(st!==null?st.memoizedState:null)!==e&&(ke.flags|=1024),n}function Df(){var e=vc!==0;return vc=0,e}function Tf(e,n,i){n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~i}function _f(e){if(pc){for(e=e.memoizedState;e!==null;){var n=e.queue;n!==null&&(n.pending=null),e=e.next}pc=!1}ea=0,Ht=st=ke=null,Sl=!1,Ro=vc=0,wl=null}function gn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ht===null?ke.memoizedState=Ht=e:Ht=Ht.next=e,Ht}function Lt(){if(st===null){var e=ke.alternate;e=e!==null?e.memoizedState:null}else e=st.next;var n=Ht===null?ke.memoizedState:Ht.next;if(n!==null)Ht=n,st=e;else{if(e===null)throw ke.alternate===null?Error(l(467)):Error(l(310));st=e,e={memoizedState:st.memoizedState,baseState:st.baseState,baseQueue:st.baseQueue,queue:st.queue,next:null},Ht===null?ke.memoizedState=Ht=e:Ht=Ht.next=e}return Ht}function gc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Mo(e){var n=Ro;return Ro+=1,wl===null&&(wl=[]),e=ag(wl,e,n),n=ke,(Ht===null?n.memoizedState:Ht.next)===null&&(n=n.alternate,L.H=n===null||n.memoizedState===null?Xg:Vf),e}function yc(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Mo(e);if(e.$$typeof===_)return ln(e)}throw Error(l(438,String(e)))}function Af(e){var n=null,i=ke.updateQueue;if(i!==null&&(n=i.memoCache),n==null){var o=ke.alternate;o!==null&&(o=o.updateQueue,o!==null&&(o=o.memoCache,o!=null&&(n={data:o.data.map(function(f){return f.slice()}),index:0})))}if(n==null&&(n={data:[],index:0}),i===null&&(i=gc(),ke.updateQueue=i),i.memoCache=n,i=n.data[n.index],i===void 0)for(i=n.data[n.index]=Array(e),o=0;o<e;o++)i[o]=q;return n.index++,i}function ta(e,n){return typeof n=="function"?n(e):n}function bc(e){var n=Lt();return zf(n,st,e)}function zf(e,n,i){var o=e.queue;if(o===null)throw Error(l(311));o.lastRenderedReducer=i;var f=e.baseQueue,p=o.pending;if(p!==null){if(f!==null){var x=f.next;f.next=p.next,p.next=x}n.baseQueue=f=p,o.pending=null}if(p=e.baseState,f===null)e.memoizedState=p;else{n=f.next;var j=x=null,P=null,X=n,ae=!1;do{var se=X.lane&-536870913;if(se!==X.lane?(Ke&se)===se:(ea&se)===se){var Z=X.revertLane;if(Z===0)P!==null&&(P=P.next={lane:0,revertLane:0,gesture:null,action:X.action,hasEagerState:X.hasEagerState,eagerState:X.eagerState,next:null}),se===vl&&(ae=!0);else if((ea&Z)===Z){X=X.next,Z===vl&&(ae=!0);continue}else se={lane:0,revertLane:X.revertLane,gesture:null,action:X.action,hasEagerState:X.hasEagerState,eagerState:X.eagerState,next:null},P===null?(j=P=se,x=p):P=P.next=se,ke.lanes|=Z,Ba|=Z;se=X.action,Mi&&i(p,se),p=X.hasEagerState?X.eagerState:i(p,se)}else Z={lane:se,revertLane:X.revertLane,gesture:X.gesture,action:X.action,hasEagerState:X.hasEagerState,eagerState:X.eagerState,next:null},P===null?(j=P=Z,x=p):P=P.next=Z,ke.lanes|=se,Ba|=se;X=X.next}while(X!==null&&X!==n);if(P===null?x=p:P.next=j,!Pn(p,e.memoizedState)&&(qt=!0,ae&&(i=gl,i!==null)))throw i;e.memoizedState=p,e.baseState=x,e.baseQueue=P,o.lastRenderedState=p}return f===null&&(o.lanes=0),[e.memoizedState,o.dispatch]}function Lf(e){var n=Lt(),i=n.queue;if(i===null)throw Error(l(311));i.lastRenderedReducer=e;var o=i.dispatch,f=i.pending,p=n.memoizedState;if(f!==null){i.pending=null;var x=f=f.next;do p=e(p,x.action),x=x.next;while(x!==f);Pn(p,n.memoizedState)||(qt=!0),n.memoizedState=p,n.baseQueue===null&&(n.baseState=p),i.lastRenderedState=p}return[p,o]}function pg(e,n,i){var o=ke,f=Lt(),p=Ze;if(p){if(i===void 0)throw Error(l(407));i=i()}else i=n();var x=!Pn((st||f).memoizedState,i);if(x&&(f.memoizedState=i,qt=!0),f=f.queue,Uf(yg.bind(null,o,f,e),[e]),f.getSnapshot!==n||x||Ht!==null&&Ht.memoizedState.tag&1){if(o.flags|=2048,Cl(9,{destroy:void 0},gg.bind(null,o,f,i,n),null),ft===null)throw Error(l(349));p||(ea&127)!==0||vg(o,n,i)}return i}function vg(e,n,i){e.flags|=16384,e={getSnapshot:n,value:i},n=ke.updateQueue,n===null?(n=gc(),ke.updateQueue=n,n.stores=[e]):(i=n.stores,i===null?n.stores=[e]:i.push(e))}function gg(e,n,i,o){n.value=i,n.getSnapshot=o,bg(n)&&xg(e)}function yg(e,n,i){return i(function(){bg(n)&&xg(e)})}function bg(e){var n=e.getSnapshot;e=e.value;try{var i=n();return!Pn(e,i)}catch{return!0}}function xg(e){var n=bi(e,2);n!==null&&Dn(n,e,2)}function kf(e){var n=gn();if(typeof e=="function"){var i=e;if(e=i(),Mi){pn(!0);try{i()}finally{pn(!1)}}}return n.memoizedState=n.baseState=e,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ta,lastRenderedState:e},n}function Sg(e,n,i,o){return e.baseState=i,zf(e,st,typeof o=="function"?o:ta)}function QE(e,n,i,o,f){if(wc(e))throw Error(l(485));if(e=n.action,e!==null){var p={payload:f,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(x){p.listeners.push(x)}};L.T!==null?i(!0):p.isTransition=!1,o(p),i=n.pending,i===null?(p.next=n.pending=p,wg(n,p)):(p.next=i.next,n.pending=i.next=p)}}function wg(e,n){var i=n.action,o=n.payload,f=e.state;if(n.isTransition){var p=L.T,x={};L.T=x;try{var j=i(f,o),P=L.S;P!==null&&P(x,j),Cg(e,n,j)}catch(X){Pf(e,n,X)}finally{p!==null&&x.types!==null&&(p.types=x.types),L.T=p}}else try{p=i(f,o),Cg(e,n,p)}catch(X){Pf(e,n,X)}}function Cg(e,n,i){i!==null&&typeof i=="object"&&typeof i.then=="function"?i.then(function(o){Ng(e,n,o)},function(o){return Pf(e,n,o)}):Ng(e,n,i)}function Ng(e,n,i){n.status="fulfilled",n.value=i,Eg(n),e.state=i,n=e.pending,n!==null&&(i=n.next,i===n?e.pending=null:(i=i.next,n.next=i,wg(e,i)))}function Pf(e,n,i){var o=e.pending;if(e.pending=null,o!==null){o=o.next;do n.status="rejected",n.reason=i,Eg(n),n=n.next;while(n!==o)}e.action=null}function Eg(e){e=e.listeners;for(var n=0;n<e.length;n++)(0,e[n])()}function jg(e,n){return n}function Rg(e,n){if(Ze){var i=ft.formState;if(i!==null){e:{var o=ke;if(Ze){if(xt){t:{for(var f=xt,p=rr;f.nodeType!==8;){if(!p){f=null;break t}if(f=ir(f.nextSibling),f===null){f=null;break t}}p=f.data,f=p==="F!"||p==="F"?f:null}if(f){xt=ir(f.nextSibling),o=f.data==="F!";break e}}Da(o)}o=!1}o&&(n=i[0])}}return i=gn(),i.memoizedState=i.baseState=n,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:jg,lastRenderedState:n},i.queue=o,i=Gg.bind(null,ke,o),o.dispatch=i,o=kf(!1),p=Qf.bind(null,ke,!1,o.queue),o=gn(),f={state:n,dispatch:null,action:e,pending:null},o.queue=f,i=QE.bind(null,ke,f,p,i),f.dispatch=i,o.memoizedState=e,[n,i,!1]}function Mg(e){var n=Lt();return Og(n,st,e)}function Og(e,n,i){if(n=zf(e,n,jg)[0],e=bc(ta)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var o=Mo(n)}catch(x){throw x===yl?cc:x}else o=n;n=Lt();var f=n.queue,p=f.dispatch;return i!==n.memoizedState&&(ke.flags|=2048,Cl(9,{destroy:void 0},VE.bind(null,f,i),null)),[o,p,e]}function VE(e,n){e.action=n}function Dg(e){var n=Lt(),i=st;if(i!==null)return Og(n,i,e);Lt(),n=n.memoizedState,i=Lt();var o=i.queue.dispatch;return i.memoizedState=e,[n,o,!1]}function Cl(e,n,i,o){return e={tag:e,create:i,deps:o,inst:n,next:null},n=ke.updateQueue,n===null&&(n=gc(),ke.updateQueue=n),i=n.lastEffect,i===null?n.lastEffect=e.next=e:(o=i.next,i.next=e,e.next=o,n.lastEffect=e),e}function Tg(){return Lt().memoizedState}function xc(e,n,i,o){var f=gn();ke.flags|=e,f.memoizedState=Cl(1|n,{destroy:void 0},i,o===void 0?null:o)}function Sc(e,n,i,o){var f=Lt();o=o===void 0?null:o;var p=f.memoizedState.inst;st!==null&&o!==null&&Mf(o,st.memoizedState.deps)?f.memoizedState=Cl(n,p,i,o):(ke.flags|=e,f.memoizedState=Cl(1|n,p,i,o))}function _g(e,n){xc(8390656,8,e,n)}function Uf(e,n){Sc(2048,8,e,n)}function FE(e){ke.flags|=4;var n=ke.updateQueue;if(n===null)n=gc(),ke.updateQueue=n,n.events=[e];else{var i=n.events;i===null?n.events=[e]:i.push(e)}}function Ag(e){var n=Lt().memoizedState;return FE({ref:n,nextImpl:e}),function(){if((nt&2)!==0)throw Error(l(440));return n.impl.apply(void 0,arguments)}}function zg(e,n){return Sc(4,2,e,n)}function Lg(e,n){return Sc(4,4,e,n)}function kg(e,n){if(typeof n=="function"){e=e();var i=n(e);return function(){typeof i=="function"?i():n(null)}}if(n!=null)return e=e(),n.current=e,function(){n.current=null}}function Pg(e,n,i){i=i!=null?i.concat([e]):null,Sc(4,4,kg.bind(null,n,e),i)}function Bf(){}function Ug(e,n){var i=Lt();n=n===void 0?null:n;var o=i.memoizedState;return n!==null&&Mf(n,o[1])?o[0]:(i.memoizedState=[e,n],e)}function Bg(e,n){var i=Lt();n=n===void 0?null:n;var o=i.memoizedState;if(n!==null&&Mf(n,o[1]))return o[0];if(o=e(),Mi){pn(!0);try{e()}finally{pn(!1)}}return i.memoizedState=[o,n],o}function Hf(e,n,i){return i===void 0||(ea&1073741824)!==0&&(Ke&261930)===0?e.memoizedState=n:(e.memoizedState=i,e=Hy(),ke.lanes|=e,Ba|=e,i)}function Hg(e,n,i,o){return Pn(i,n)?i:xl.current!==null?(e=Hf(e,i,o),Pn(e,n)||(qt=!0),e):(ea&42)===0||(ea&1073741824)!==0&&(Ke&261930)===0?(qt=!0,e.memoizedState=i):(e=Hy(),ke.lanes|=e,Ba|=e,n)}function qg(e,n,i,o,f){var p=G.p;G.p=p!==0&&8>p?p:8;var x=L.T,j={};L.T=j,Qf(e,!1,n,i);try{var P=f(),X=L.S;if(X!==null&&X(j,P),P!==null&&typeof P=="object"&&typeof P.then=="function"){var ae=HE(P,o);Oo(e,n,ae,Qn(e))}else Oo(e,n,o,Qn(e))}catch(se){Oo(e,n,{then:function(){},status:"rejected",reason:se},Qn())}finally{G.p=p,x!==null&&j.types!==null&&(x.types=j.types),L.T=x}}function GE(){}function qf(e,n,i,o){if(e.tag!==5)throw Error(l(476));var f=Ig(e).queue;qg(e,f,n,B,i===null?GE:function(){return Qg(e),i(o)})}function Ig(e){var n=e.memoizedState;if(n!==null)return n;n={memoizedState:B,baseState:B,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ta,lastRenderedState:B},next:null};var i={};return n.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ta,lastRenderedState:i},next:null},e.memoizedState=n,e=e.alternate,e!==null&&(e.memoizedState=n),n}function Qg(e){var n=Ig(e);n.next===null&&(n=e.alternate.memoizedState),Oo(e,n.next.queue,{},Qn())}function If(){return ln(Go)}function Vg(){return Lt().memoizedState}function Fg(){return Lt().memoizedState}function YE(e){for(var n=e.return;n!==null;){switch(n.tag){case 24:case 3:var i=Qn();e=Aa(i);var o=za(n,e,i);o!==null&&(Dn(o,n,i),No(o,n,i)),n={cache:gf()},e.payload=n;return}n=n.return}}function KE(e,n,i){var o=Qn();i={lane:o,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},wc(e)?Yg(n,i):(i=lf(e,n,i,o),i!==null&&(Dn(i,e,o),Kg(i,n,o)))}function Gg(e,n,i){var o=Qn();Oo(e,n,i,o)}function Oo(e,n,i,o){var f={lane:o,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null};if(wc(e))Yg(n,f);else{var p=e.alternate;if(e.lanes===0&&(p===null||p.lanes===0)&&(p=n.lastRenderedReducer,p!==null))try{var x=n.lastRenderedState,j=p(x,i);if(f.hasEagerState=!0,f.eagerState=j,Pn(j,x))return nc(e,n,f,0),ft===null&&tc(),!1}catch{}finally{}if(i=lf(e,n,f,o),i!==null)return Dn(i,e,o),Kg(i,n,o),!0}return!1}function Qf(e,n,i,o){if(o={lane:2,revertLane:Sh(),gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},wc(e)){if(n)throw Error(l(479))}else n=lf(e,i,o,2),n!==null&&Dn(n,e,2)}function wc(e){var n=e.alternate;return e===ke||n!==null&&n===ke}function Yg(e,n){Sl=pc=!0;var i=e.pending;i===null?n.next=n:(n.next=i.next,i.next=n),e.pending=n}function Kg(e,n,i){if((i&4194048)!==0){var o=n.lanes;o&=e.pendingLanes,i|=o,n.lanes=i,V(e,i)}}var Do={readContext:ln,use:yc,useCallback:Mt,useContext:Mt,useEffect:Mt,useImperativeHandle:Mt,useLayoutEffect:Mt,useInsertionEffect:Mt,useMemo:Mt,useReducer:Mt,useRef:Mt,useState:Mt,useDebugValue:Mt,useDeferredValue:Mt,useTransition:Mt,useSyncExternalStore:Mt,useId:Mt,useHostTransitionStatus:Mt,useFormState:Mt,useActionState:Mt,useOptimistic:Mt,useMemoCache:Mt,useCacheRefresh:Mt};Do.useEffectEvent=Mt;var Xg={readContext:ln,use:yc,useCallback:function(e,n){return gn().memoizedState=[e,n===void 0?null:n],e},useContext:ln,useEffect:_g,useImperativeHandle:function(e,n,i){i=i!=null?i.concat([e]):null,xc(4194308,4,kg.bind(null,n,e),i)},useLayoutEffect:function(e,n){return xc(4194308,4,e,n)},useInsertionEffect:function(e,n){xc(4,2,e,n)},useMemo:function(e,n){var i=gn();n=n===void 0?null:n;var o=e();if(Mi){pn(!0);try{e()}finally{pn(!1)}}return i.memoizedState=[o,n],o},useReducer:function(e,n,i){var o=gn();if(i!==void 0){var f=i(n);if(Mi){pn(!0);try{i(n)}finally{pn(!1)}}}else f=n;return o.memoizedState=o.baseState=f,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:f},o.queue=e,e=e.dispatch=KE.bind(null,ke,e),[o.memoizedState,e]},useRef:function(e){var n=gn();return e={current:e},n.memoizedState=e},useState:function(e){e=kf(e);var n=e.queue,i=Gg.bind(null,ke,n);return n.dispatch=i,[e.memoizedState,i]},useDebugValue:Bf,useDeferredValue:function(e,n){var i=gn();return Hf(i,e,n)},useTransition:function(){var e=kf(!1);return e=qg.bind(null,ke,e.queue,!0,!1),gn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,n,i){var o=ke,f=gn();if(Ze){if(i===void 0)throw Error(l(407));i=i()}else{if(i=n(),ft===null)throw Error(l(349));(Ke&127)!==0||vg(o,n,i)}f.memoizedState=i;var p={value:i,getSnapshot:n};return f.queue=p,_g(yg.bind(null,o,p,e),[e]),o.flags|=2048,Cl(9,{destroy:void 0},gg.bind(null,o,p,i,n),null),i},useId:function(){var e=gn(),n=ft.identifierPrefix;if(Ze){var i=Ar,o=_r;i=(o&~(1<<32-Vt(o)-1)).toString(32)+i,n="_"+n+"R_"+i,i=vc++,0<i&&(n+="H"+i.toString(32)),n+="_"}else i=qE++,n="_"+n+"r_"+i.toString(32)+"_";return e.memoizedState=n},useHostTransitionStatus:If,useFormState:Rg,useActionState:Rg,useOptimistic:function(e){var n=gn();n.memoizedState=n.baseState=e;var i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=i,n=Qf.bind(null,ke,!0,i),i.dispatch=n,[e,n]},useMemoCache:Af,useCacheRefresh:function(){return gn().memoizedState=YE.bind(null,ke)},useEffectEvent:function(e){var n=gn(),i={impl:e};return n.memoizedState=i,function(){if((nt&2)!==0)throw Error(l(440));return i.impl.apply(void 0,arguments)}}},Vf={readContext:ln,use:yc,useCallback:Ug,useContext:ln,useEffect:Uf,useImperativeHandle:Pg,useInsertionEffect:zg,useLayoutEffect:Lg,useMemo:Bg,useReducer:bc,useRef:Tg,useState:function(){return bc(ta)},useDebugValue:Bf,useDeferredValue:function(e,n){var i=Lt();return Hg(i,st.memoizedState,e,n)},useTransition:function(){var e=bc(ta)[0],n=Lt().memoizedState;return[typeof e=="boolean"?e:Mo(e),n]},useSyncExternalStore:pg,useId:Vg,useHostTransitionStatus:If,useFormState:Mg,useActionState:Mg,useOptimistic:function(e,n){var i=Lt();return Sg(i,st,e,n)},useMemoCache:Af,useCacheRefresh:Fg};Vf.useEffectEvent=Ag;var $g={readContext:ln,use:yc,useCallback:Ug,useContext:ln,useEffect:Uf,useImperativeHandle:Pg,useInsertionEffect:zg,useLayoutEffect:Lg,useMemo:Bg,useReducer:Lf,useRef:Tg,useState:function(){return Lf(ta)},useDebugValue:Bf,useDeferredValue:function(e,n){var i=Lt();return st===null?Hf(i,e,n):Hg(i,st.memoizedState,e,n)},useTransition:function(){var e=Lf(ta)[0],n=Lt().memoizedState;return[typeof e=="boolean"?e:Mo(e),n]},useSyncExternalStore:pg,useId:Vg,useHostTransitionStatus:If,useFormState:Dg,useActionState:Dg,useOptimistic:function(e,n){var i=Lt();return st!==null?Sg(i,st,e,n):(i.baseState=e,[e,i.queue.dispatch])},useMemoCache:Af,useCacheRefresh:Fg};$g.useEffectEvent=Ag;function Ff(e,n,i,o){n=e.memoizedState,i=i(o,n),i=i==null?n:y({},n,i),e.memoizedState=i,e.lanes===0&&(e.updateQueue.baseState=i)}var Gf={enqueueSetState:function(e,n,i){e=e._reactInternals;var o=Qn(),f=Aa(o);f.payload=n,i!=null&&(f.callback=i),n=za(e,f,o),n!==null&&(Dn(n,e,o),No(n,e,o))},enqueueReplaceState:function(e,n,i){e=e._reactInternals;var o=Qn(),f=Aa(o);f.tag=1,f.payload=n,i!=null&&(f.callback=i),n=za(e,f,o),n!==null&&(Dn(n,e,o),No(n,e,o))},enqueueForceUpdate:function(e,n){e=e._reactInternals;var i=Qn(),o=Aa(i);o.tag=2,n!=null&&(o.callback=n),n=za(e,o,i),n!==null&&(Dn(n,e,i),No(n,e,i))}};function Zg(e,n,i,o,f,p,x){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(o,p,x):n.prototype&&n.prototype.isPureReactComponent?!vo(i,o)||!vo(f,p):!0}function Jg(e,n,i,o){e=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(i,o),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(i,o),n.state!==e&&Gf.enqueueReplaceState(n,n.state,null)}function Oi(e,n){var i=n;if("ref"in n){i={};for(var o in n)o!=="ref"&&(i[o]=n[o])}if(e=e.defaultProps){i===n&&(i=y({},i));for(var f in e)i[f]===void 0&&(i[f]=e[f])}return i}function Wg(e){ec(e)}function ey(e){console.error(e)}function ty(e){ec(e)}function Cc(e,n){try{var i=e.onUncaughtError;i(n.value,{componentStack:n.stack})}catch(o){setTimeout(function(){throw o})}}function ny(e,n,i){try{var o=e.onCaughtError;o(i.value,{componentStack:i.stack,errorBoundary:n.tag===1?n.stateNode:null})}catch(f){setTimeout(function(){throw f})}}function Yf(e,n,i){return i=Aa(i),i.tag=3,i.payload={element:null},i.callback=function(){Cc(e,n)},i}function ry(e){return e=Aa(e),e.tag=3,e}function ay(e,n,i,o){var f=i.type.getDerivedStateFromError;if(typeof f=="function"){var p=o.value;e.payload=function(){return f(p)},e.callback=function(){ny(n,i,o)}}var x=i.stateNode;x!==null&&typeof x.componentDidCatch=="function"&&(e.callback=function(){ny(n,i,o),typeof f!="function"&&(Ha===null?Ha=new Set([this]):Ha.add(this));var j=o.stack;this.componentDidCatch(o.value,{componentStack:j!==null?j:""})})}function XE(e,n,i,o,f){if(i.flags|=32768,o!==null&&typeof o=="object"&&typeof o.then=="function"){if(n=i.alternate,n!==null&&pl(n,i,f,!0),i=Bn.current,i!==null){switch(i.tag){case 31:case 13:return ar===null?Lc():i.alternate===null&&Ot===0&&(Ot=3),i.flags&=-257,i.flags|=65536,i.lanes=f,o===uc?i.flags|=16384:(n=i.updateQueue,n===null?i.updateQueue=new Set([o]):n.add(o),yh(e,o,f)),!1;case 22:return i.flags|=65536,o===uc?i.flags|=16384:(n=i.updateQueue,n===null?(n={transitions:null,markerInstances:null,retryQueue:new Set([o])},i.updateQueue=n):(i=n.retryQueue,i===null?n.retryQueue=new Set([o]):i.add(o)),yh(e,o,f)),!1}throw Error(l(435,i.tag))}return yh(e,o,f),Lc(),!1}if(Ze)return n=Bn.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=f,o!==ff&&(e=Error(l(422),{cause:o}),bo(er(e,i)))):(o!==ff&&(n=Error(l(423),{cause:o}),bo(er(n,i))),e=e.current.alternate,e.flags|=65536,f&=-f,e.lanes|=f,o=er(o,i),f=Yf(e.stateNode,o,f),Cf(e,f),Ot!==4&&(Ot=2)),!1;var p=Error(l(520),{cause:o});if(p=er(p,i),Uo===null?Uo=[p]:Uo.push(p),Ot!==4&&(Ot=2),n===null)return!0;o=er(o,i),i=n;do{switch(i.tag){case 3:return i.flags|=65536,e=f&-f,i.lanes|=e,e=Yf(i.stateNode,o,e),Cf(i,e),!1;case 1:if(n=i.type,p=i.stateNode,(i.flags&128)===0&&(typeof n.getDerivedStateFromError=="function"||p!==null&&typeof p.componentDidCatch=="function"&&(Ha===null||!Ha.has(p))))return i.flags|=65536,f&=-f,i.lanes|=f,f=ry(f),ay(f,e,i,o),Cf(i,f),!1}i=i.return}while(i!==null);return!1}var Kf=Error(l(461)),qt=!1;function on(e,n,i,o){n.child=e===null?sg(n,null,i,o):Ri(n,e.child,i,o)}function iy(e,n,i,o,f){i=i.render;var p=n.ref;if("ref"in o){var x={};for(var j in o)j!=="ref"&&(x[j]=o[j])}else x=o;return Ci(n),o=Of(e,n,i,x,p,f),j=Df(),e!==null&&!qt?(Tf(e,n,f),na(e,n,f)):(Ze&&j&&uf(n),n.flags|=1,on(e,n,o,f),n.child)}function ly(e,n,i,o,f){if(e===null){var p=i.type;return typeof p=="function"&&!of(p)&&p.defaultProps===void 0&&i.compare===null?(n.tag=15,n.type=p,oy(e,n,p,o,f)):(e=ac(i.type,null,o,n,n.mode,f),e.ref=n.ref,e.return=n,n.child=e)}if(p=e.child,!nh(e,f)){var x=p.memoizedProps;if(i=i.compare,i=i!==null?i:vo,i(x,o)&&e.ref===n.ref)return na(e,n,f)}return n.flags|=1,e=$r(p,o),e.ref=n.ref,e.return=n,n.child=e}function oy(e,n,i,o,f){if(e!==null){var p=e.memoizedProps;if(vo(p,o)&&e.ref===n.ref)if(qt=!1,n.pendingProps=o=p,nh(e,f))(e.flags&131072)!==0&&(qt=!0);else return n.lanes=e.lanes,na(e,n,f)}return Xf(e,n,i,o,f)}function sy(e,n,i,o){var f=o.children,p=e!==null?e.memoizedState:null;if(e===null&&n.stateNode===null&&(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.mode==="hidden"){if((n.flags&128)!==0){if(p=p!==null?p.baseLanes|i:i,e!==null){for(o=n.child=e.child,f=0;o!==null;)f=f|o.lanes|o.childLanes,o=o.sibling;o=f&~p}else o=0,n.child=null;return cy(e,n,p,i,o)}if((i&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},e!==null&&sc(n,p!==null?p.cachePool:null),p!==null?dg(n,p):Ef(),fg(n);else return o=n.lanes=536870912,cy(e,n,p!==null?p.baseLanes|i:i,i,o)}else p!==null?(sc(n,p.cachePool),dg(n,p),ka(),n.memoizedState=null):(e!==null&&sc(n,null),Ef(),ka());return on(e,n,f,i),n.child}function To(e,n){return e!==null&&e.tag===22||n.stateNode!==null||(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function cy(e,n,i,o,f){var p=bf();return p=p===null?null:{parent:Bt._currentValue,pool:p},n.memoizedState={baseLanes:i,cachePool:p},e!==null&&sc(n,null),Ef(),fg(n),e!==null&&pl(e,n,o,!0),n.childLanes=f,null}function Nc(e,n){return n=jc({mode:n.mode,children:n.children},e.mode),n.ref=e.ref,e.child=n,n.return=e,n}function uy(e,n,i){return Ri(n,e.child,null,i),e=Nc(n,n.pendingProps),e.flags|=2,Hn(n),n.memoizedState=null,e}function $E(e,n,i){var o=n.pendingProps,f=(n.flags&128)!==0;if(n.flags&=-129,e===null){if(Ze){if(o.mode==="hidden")return e=Nc(n,o),n.lanes=536870912,To(null,e);if(Rf(n),(e=xt)?(e=wb(e,rr),e=e!==null&&e.data==="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:Ma!==null?{id:_r,overflow:Ar}:null,retryLane:536870912,hydrationErrors:null},i=Yv(e),i.return=n,n.child=i,an=n,xt=null)):e=null,e===null)throw Da(n);return n.lanes=536870912,null}return Nc(n,o)}var p=e.memoizedState;if(p!==null){var x=p.dehydrated;if(Rf(n),f)if(n.flags&256)n.flags&=-257,n=uy(e,n,i);else if(n.memoizedState!==null)n.child=e.child,n.flags|=128,n=null;else throw Error(l(558));else if(qt||pl(e,n,i,!1),f=(i&e.childLanes)!==0,qt||f){if(o=ft,o!==null&&(x=$(o,i),x!==0&&x!==p.retryLane))throw p.retryLane=x,bi(e,x),Dn(o,e,x),Kf;Lc(),n=uy(e,n,i)}else e=p.treeContext,xt=ir(x.nextSibling),an=n,Ze=!0,Oa=null,rr=!1,e!==null&&$v(n,e),n=Nc(n,o),n.flags|=4096;return n}return e=$r(e.child,{mode:o.mode,children:o.children}),e.ref=n.ref,n.child=e,e.return=n,e}function Ec(e,n){var i=n.ref;if(i===null)e!==null&&e.ref!==null&&(n.flags|=4194816);else{if(typeof i!="function"&&typeof i!="object")throw Error(l(284));(e===null||e.ref!==i)&&(n.flags|=4194816)}}function Xf(e,n,i,o,f){return Ci(n),i=Of(e,n,i,o,void 0,f),o=Df(),e!==null&&!qt?(Tf(e,n,f),na(e,n,f)):(Ze&&o&&uf(n),n.flags|=1,on(e,n,i,f),n.child)}function dy(e,n,i,o,f,p){return Ci(n),n.updateQueue=null,i=mg(n,o,i,f),hg(e),o=Df(),e!==null&&!qt?(Tf(e,n,p),na(e,n,p)):(Ze&&o&&uf(n),n.flags|=1,on(e,n,i,p),n.child)}function fy(e,n,i,o,f){if(Ci(n),n.stateNode===null){var p=dl,x=i.contextType;typeof x=="object"&&x!==null&&(p=ln(x)),p=new i(o,p),n.memoizedState=p.state!==null&&p.state!==void 0?p.state:null,p.updater=Gf,n.stateNode=p,p._reactInternals=n,p=n.stateNode,p.props=o,p.state=n.memoizedState,p.refs={},Sf(n),x=i.contextType,p.context=typeof x=="object"&&x!==null?ln(x):dl,p.state=n.memoizedState,x=i.getDerivedStateFromProps,typeof x=="function"&&(Ff(n,i,x,o),p.state=n.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof p.getSnapshotBeforeUpdate=="function"||typeof p.UNSAFE_componentWillMount!="function"&&typeof p.componentWillMount!="function"||(x=p.state,typeof p.componentWillMount=="function"&&p.componentWillMount(),typeof p.UNSAFE_componentWillMount=="function"&&p.UNSAFE_componentWillMount(),x!==p.state&&Gf.enqueueReplaceState(p,p.state,null),jo(n,o,p,f),Eo(),p.state=n.memoizedState),typeof p.componentDidMount=="function"&&(n.flags|=4194308),o=!0}else if(e===null){p=n.stateNode;var j=n.memoizedProps,P=Oi(i,j);p.props=P;var X=p.context,ae=i.contextType;x=dl,typeof ae=="object"&&ae!==null&&(x=ln(ae));var se=i.getDerivedStateFromProps;ae=typeof se=="function"||typeof p.getSnapshotBeforeUpdate=="function",j=n.pendingProps!==j,ae||typeof p.UNSAFE_componentWillReceiveProps!="function"&&typeof p.componentWillReceiveProps!="function"||(j||X!==x)&&Jg(n,p,o,x),_a=!1;var Z=n.memoizedState;p.state=Z,jo(n,o,p,f),Eo(),X=n.memoizedState,j||Z!==X||_a?(typeof se=="function"&&(Ff(n,i,se,o),X=n.memoizedState),(P=_a||Zg(n,i,P,o,Z,X,x))?(ae||typeof p.UNSAFE_componentWillMount!="function"&&typeof p.componentWillMount!="function"||(typeof p.componentWillMount=="function"&&p.componentWillMount(),typeof p.UNSAFE_componentWillMount=="function"&&p.UNSAFE_componentWillMount()),typeof p.componentDidMount=="function"&&(n.flags|=4194308)):(typeof p.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=o,n.memoizedState=X),p.props=o,p.state=X,p.context=x,o=P):(typeof p.componentDidMount=="function"&&(n.flags|=4194308),o=!1)}else{p=n.stateNode,wf(e,n),x=n.memoizedProps,ae=Oi(i,x),p.props=ae,se=n.pendingProps,Z=p.context,X=i.contextType,P=dl,typeof X=="object"&&X!==null&&(P=ln(X)),j=i.getDerivedStateFromProps,(X=typeof j=="function"||typeof p.getSnapshotBeforeUpdate=="function")||typeof p.UNSAFE_componentWillReceiveProps!="function"&&typeof p.componentWillReceiveProps!="function"||(x!==se||Z!==P)&&Jg(n,p,o,P),_a=!1,Z=n.memoizedState,p.state=Z,jo(n,o,p,f),Eo();var te=n.memoizedState;x!==se||Z!==te||_a||e!==null&&e.dependencies!==null&&lc(e.dependencies)?(typeof j=="function"&&(Ff(n,i,j,o),te=n.memoizedState),(ae=_a||Zg(n,i,ae,o,Z,te,P)||e!==null&&e.dependencies!==null&&lc(e.dependencies))?(X||typeof p.UNSAFE_componentWillUpdate!="function"&&typeof p.componentWillUpdate!="function"||(typeof p.componentWillUpdate=="function"&&p.componentWillUpdate(o,te,P),typeof p.UNSAFE_componentWillUpdate=="function"&&p.UNSAFE_componentWillUpdate(o,te,P)),typeof p.componentDidUpdate=="function"&&(n.flags|=4),typeof p.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof p.componentDidUpdate!="function"||x===e.memoizedProps&&Z===e.memoizedState||(n.flags|=4),typeof p.getSnapshotBeforeUpdate!="function"||x===e.memoizedProps&&Z===e.memoizedState||(n.flags|=1024),n.memoizedProps=o,n.memoizedState=te),p.props=o,p.state=te,p.context=P,o=ae):(typeof p.componentDidUpdate!="function"||x===e.memoizedProps&&Z===e.memoizedState||(n.flags|=4),typeof p.getSnapshotBeforeUpdate!="function"||x===e.memoizedProps&&Z===e.memoizedState||(n.flags|=1024),o=!1)}return p=o,Ec(e,n),o=(n.flags&128)!==0,p||o?(p=n.stateNode,i=o&&typeof i.getDerivedStateFromError!="function"?null:p.render(),n.flags|=1,e!==null&&o?(n.child=Ri(n,e.child,null,f),n.child=Ri(n,null,i,f)):on(e,n,i,f),n.memoizedState=p.state,e=n.child):e=na(e,n,f),e}function hy(e,n,i,o){return Si(),n.flags|=256,on(e,n,i,o),n.child}var $f={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Zf(e){return{baseLanes:e,cachePool:ng()}}function Jf(e,n,i){return e=e!==null?e.childLanes&~i:0,n&&(e|=In),e}function my(e,n,i){var o=n.pendingProps,f=!1,p=(n.flags&128)!==0,x;if((x=p)||(x=e!==null&&e.memoizedState===null?!1:(zt.current&2)!==0),x&&(f=!0,n.flags&=-129),x=(n.flags&32)!==0,n.flags&=-33,e===null){if(Ze){if(f?La(n):ka(),(e=xt)?(e=wb(e,rr),e=e!==null&&e.data!=="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:Ma!==null?{id:_r,overflow:Ar}:null,retryLane:536870912,hydrationErrors:null},i=Yv(e),i.return=n,n.child=i,an=n,xt=null)):e=null,e===null)throw Da(n);return zh(e)?n.lanes=32:n.lanes=536870912,null}var j=o.children;return o=o.fallback,f?(ka(),f=n.mode,j=jc({mode:"hidden",children:j},f),o=xi(o,f,i,null),j.return=n,o.return=n,j.sibling=o,n.child=j,o=n.child,o.memoizedState=Zf(i),o.childLanes=Jf(e,x,i),n.memoizedState=$f,To(null,o)):(La(n),Wf(n,j))}var P=e.memoizedState;if(P!==null&&(j=P.dehydrated,j!==null)){if(p)n.flags&256?(La(n),n.flags&=-257,n=eh(e,n,i)):n.memoizedState!==null?(ka(),n.child=e.child,n.flags|=128,n=null):(ka(),j=o.fallback,f=n.mode,o=jc({mode:"visible",children:o.children},f),j=xi(j,f,i,null),j.flags|=2,o.return=n,j.return=n,o.sibling=j,n.child=o,Ri(n,e.child,null,i),o=n.child,o.memoizedState=Zf(i),o.childLanes=Jf(e,x,i),n.memoizedState=$f,n=To(null,o));else if(La(n),zh(j)){if(x=j.nextSibling&&j.nextSibling.dataset,x)var X=x.dgst;x=X,o=Error(l(419)),o.stack="",o.digest=x,bo({value:o,source:null,stack:null}),n=eh(e,n,i)}else if(qt||pl(e,n,i,!1),x=(i&e.childLanes)!==0,qt||x){if(x=ft,x!==null&&(o=$(x,i),o!==0&&o!==P.retryLane))throw P.retryLane=o,bi(e,o),Dn(x,e,o),Kf;Ah(j)||Lc(),n=eh(e,n,i)}else Ah(j)?(n.flags|=192,n.child=e.child,n=null):(e=P.treeContext,xt=ir(j.nextSibling),an=n,Ze=!0,Oa=null,rr=!1,e!==null&&$v(n,e),n=Wf(n,o.children),n.flags|=4096);return n}return f?(ka(),j=o.fallback,f=n.mode,P=e.child,X=P.sibling,o=$r(P,{mode:"hidden",children:o.children}),o.subtreeFlags=P.subtreeFlags&65011712,X!==null?j=$r(X,j):(j=xi(j,f,i,null),j.flags|=2),j.return=n,o.return=n,o.sibling=j,n.child=o,To(null,o),o=n.child,j=e.child.memoizedState,j===null?j=Zf(i):(f=j.cachePool,f!==null?(P=Bt._currentValue,f=f.parent!==P?{parent:P,pool:P}:f):f=ng(),j={baseLanes:j.baseLanes|i,cachePool:f}),o.memoizedState=j,o.childLanes=Jf(e,x,i),n.memoizedState=$f,To(e.child,o)):(La(n),i=e.child,e=i.sibling,i=$r(i,{mode:"visible",children:o.children}),i.return=n,i.sibling=null,e!==null&&(x=n.deletions,x===null?(n.deletions=[e],n.flags|=16):x.push(e)),n.child=i,n.memoizedState=null,i)}function Wf(e,n){return n=jc({mode:"visible",children:n},e.mode),n.return=e,e.child=n}function jc(e,n){return e=Un(22,e,null,n),e.lanes=0,e}function eh(e,n,i){return Ri(n,e.child,null,i),e=Wf(n,n.pendingProps.children),e.flags|=2,n.memoizedState=null,e}function py(e,n,i){e.lanes|=n;var o=e.alternate;o!==null&&(o.lanes|=n),pf(e.return,n,i)}function th(e,n,i,o,f,p){var x=e.memoizedState;x===null?e.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:o,tail:i,tailMode:f,treeForkCount:p}:(x.isBackwards=n,x.rendering=null,x.renderingStartTime=0,x.last=o,x.tail=i,x.tailMode=f,x.treeForkCount=p)}function vy(e,n,i){var o=n.pendingProps,f=o.revealOrder,p=o.tail;o=o.children;var x=zt.current,j=(x&2)!==0;if(j?(x=x&1|2,n.flags|=128):x&=1,J(zt,x),on(e,n,o,i),o=Ze?yo:0,!j&&e!==null&&(e.flags&128)!==0)e:for(e=n.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&py(e,i,n);else if(e.tag===19)py(e,i,n);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===n)break e;for(;e.sibling===null;){if(e.return===null||e.return===n)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(f){case"forwards":for(i=n.child,f=null;i!==null;)e=i.alternate,e!==null&&mc(e)===null&&(f=i),i=i.sibling;i=f,i===null?(f=n.child,n.child=null):(f=i.sibling,i.sibling=null),th(n,!1,f,i,p,o);break;case"backwards":case"unstable_legacy-backwards":for(i=null,f=n.child,n.child=null;f!==null;){if(e=f.alternate,e!==null&&mc(e)===null){n.child=f;break}e=f.sibling,f.sibling=i,i=f,f=e}th(n,!0,i,null,p,o);break;case"together":th(n,!1,null,null,void 0,o);break;default:n.memoizedState=null}return n.child}function na(e,n,i){if(e!==null&&(n.dependencies=e.dependencies),Ba|=n.lanes,(i&n.childLanes)===0)if(e!==null){if(pl(e,n,i,!1),(i&n.childLanes)===0)return null}else return null;if(e!==null&&n.child!==e.child)throw Error(l(153));if(n.child!==null){for(e=n.child,i=$r(e,e.pendingProps),n.child=i,i.return=n;e.sibling!==null;)e=e.sibling,i=i.sibling=$r(e,e.pendingProps),i.return=n;i.sibling=null}return n.child}function nh(e,n){return(e.lanes&n)!==0?!0:(e=e.dependencies,!!(e!==null&&lc(e)))}function ZE(e,n,i){switch(n.tag){case 3:De(n,n.stateNode.containerInfo),Ta(n,Bt,e.memoizedState.cache),Si();break;case 27:case 5:Te(n);break;case 4:De(n,n.stateNode.containerInfo);break;case 10:Ta(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,Rf(n),null;break;case 13:var o=n.memoizedState;if(o!==null)return o.dehydrated!==null?(La(n),n.flags|=128,null):(i&n.child.childLanes)!==0?my(e,n,i):(La(n),e=na(e,n,i),e!==null?e.sibling:null);La(n);break;case 19:var f=(e.flags&128)!==0;if(o=(i&n.childLanes)!==0,o||(pl(e,n,i,!1),o=(i&n.childLanes)!==0),f){if(o)return vy(e,n,i);n.flags|=128}if(f=n.memoizedState,f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),J(zt,zt.current),o)break;return null;case 22:return n.lanes=0,sy(e,n,i,n.pendingProps);case 24:Ta(n,Bt,e.memoizedState.cache)}return na(e,n,i)}function gy(e,n,i){if(e!==null)if(e.memoizedProps!==n.pendingProps)qt=!0;else{if(!nh(e,i)&&(n.flags&128)===0)return qt=!1,ZE(e,n,i);qt=(e.flags&131072)!==0}else qt=!1,Ze&&(n.flags&1048576)!==0&&Xv(n,yo,n.index);switch(n.lanes=0,n.tag){case 16:e:{var o=n.pendingProps;if(e=Ei(n.elementType),n.type=e,typeof e=="function")of(e)?(o=Oi(e,o),n.tag=1,n=fy(null,n,e,o,i)):(n.tag=0,n=Xf(null,n,e,o,i));else{if(e!=null){var f=e.$$typeof;if(f===z){n.tag=11,n=iy(null,n,e,o,i);break e}else if(f===N){n.tag=14,n=ly(null,n,e,o,i);break e}}throw n=le(e)||e,Error(l(306,n,""))}}return n;case 0:return Xf(e,n,n.type,n.pendingProps,i);case 1:return o=n.type,f=Oi(o,n.pendingProps),fy(e,n,o,f,i);case 3:e:{if(De(n,n.stateNode.containerInfo),e===null)throw Error(l(387));o=n.pendingProps;var p=n.memoizedState;f=p.element,wf(e,n),jo(n,o,null,i);var x=n.memoizedState;if(o=x.cache,Ta(n,Bt,o),o!==p.cache&&vf(n,[Bt],i,!0),Eo(),o=x.element,p.isDehydrated)if(p={element:o,isDehydrated:!1,cache:x.cache},n.updateQueue.baseState=p,n.memoizedState=p,n.flags&256){n=hy(e,n,o,i);break e}else if(o!==f){f=er(Error(l(424)),n),bo(f),n=hy(e,n,o,i);break e}else{switch(e=n.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(xt=ir(e.firstChild),an=n,Ze=!0,Oa=null,rr=!0,i=sg(n,null,o,i),n.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling}else{if(Si(),o===f){n=na(e,n,i);break e}on(e,n,o,i)}n=n.child}return n;case 26:return Ec(e,n),e===null?(i=Mb(n.type,null,n.pendingProps,null))?n.memoizedState=i:Ze||(i=n.type,e=n.pendingProps,o=Ic(me.current).createElement(i),o[ge]=n,o[ve]=e,sn(o,i,e),Rt(o),n.stateNode=o):n.memoizedState=Mb(n.type,e.memoizedProps,n.pendingProps,e.memoizedState),null;case 27:return Te(n),e===null&&Ze&&(o=n.stateNode=Eb(n.type,n.pendingProps,me.current),an=n,rr=!0,f=xt,Va(n.type)?(Lh=f,xt=ir(o.firstChild)):xt=f),on(e,n,n.pendingProps.children,i),Ec(e,n),e===null&&(n.flags|=4194304),n.child;case 5:return e===null&&Ze&&((f=o=xt)&&(o=Rj(o,n.type,n.pendingProps,rr),o!==null?(n.stateNode=o,an=n,xt=ir(o.firstChild),rr=!1,f=!0):f=!1),f||Da(n)),Te(n),f=n.type,p=n.pendingProps,x=e!==null?e.memoizedProps:null,o=p.children,Dh(f,p)?o=null:x!==null&&Dh(f,x)&&(n.flags|=32),n.memoizedState!==null&&(f=Of(e,n,IE,null,null,i),Go._currentValue=f),Ec(e,n),on(e,n,o,i),n.child;case 6:return e===null&&Ze&&((e=i=xt)&&(i=Mj(i,n.pendingProps,rr),i!==null?(n.stateNode=i,an=n,xt=null,e=!0):e=!1),e||Da(n)),null;case 13:return my(e,n,i);case 4:return De(n,n.stateNode.containerInfo),o=n.pendingProps,e===null?n.child=Ri(n,null,o,i):on(e,n,o,i),n.child;case 11:return iy(e,n,n.type,n.pendingProps,i);case 7:return on(e,n,n.pendingProps,i),n.child;case 8:return on(e,n,n.pendingProps.children,i),n.child;case 12:return on(e,n,n.pendingProps.children,i),n.child;case 10:return o=n.pendingProps,Ta(n,n.type,o.value),on(e,n,o.children,i),n.child;case 9:return f=n.type._context,o=n.pendingProps.children,Ci(n),f=ln(f),o=o(f),n.flags|=1,on(e,n,o,i),n.child;case 14:return ly(e,n,n.type,n.pendingProps,i);case 15:return oy(e,n,n.type,n.pendingProps,i);case 19:return vy(e,n,i);case 31:return $E(e,n,i);case 22:return sy(e,n,i,n.pendingProps);case 24:return Ci(n),o=ln(Bt),e===null?(f=bf(),f===null&&(f=ft,p=gf(),f.pooledCache=p,p.refCount++,p!==null&&(f.pooledCacheLanes|=i),f=p),n.memoizedState={parent:o,cache:f},Sf(n),Ta(n,Bt,f)):((e.lanes&i)!==0&&(wf(e,n),jo(n,null,null,i),Eo()),f=e.memoizedState,p=n.memoizedState,f.parent!==o?(f={parent:o,cache:o},n.memoizedState=f,n.lanes===0&&(n.memoizedState=n.updateQueue.baseState=f),Ta(n,Bt,o)):(o=p.cache,Ta(n,Bt,o),o!==f.cache&&vf(n,[Bt],i,!0))),on(e,n,n.pendingProps.children,i),n.child;case 29:throw n.pendingProps}throw Error(l(156,n.tag))}function ra(e){e.flags|=4}function rh(e,n,i,o,f){if((n=(e.mode&32)!==0)&&(n=!1),n){if(e.flags|=16777216,(f&335544128)===f)if(e.stateNode.complete)e.flags|=8192;else if(Vy())e.flags|=8192;else throw ji=uc,xf}else e.flags&=-16777217}function yy(e,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Ab(n))if(Vy())e.flags|=8192;else throw ji=uc,xf}function Rc(e,n){n!==null&&(e.flags|=4),e.flags&16384&&(n=e.tag!==22?_t():536870912,e.lanes|=n,Rl|=n)}function _o(e,n){if(!Ze)switch(e.tailMode){case"hidden":n=e.tail;for(var i=null;n!==null;)n.alternate!==null&&(i=n),n=n.sibling;i===null?e.tail=null:i.sibling=null;break;case"collapsed":i=e.tail;for(var o=null;i!==null;)i.alternate!==null&&(o=i),i=i.sibling;o===null?n||e.tail===null?e.tail=null:e.tail.sibling=null:o.sibling=null}}function St(e){var n=e.alternate!==null&&e.alternate.child===e.child,i=0,o=0;if(n)for(var f=e.child;f!==null;)i|=f.lanes|f.childLanes,o|=f.subtreeFlags&65011712,o|=f.flags&65011712,f.return=e,f=f.sibling;else for(f=e.child;f!==null;)i|=f.lanes|f.childLanes,o|=f.subtreeFlags,o|=f.flags,f.return=e,f=f.sibling;return e.subtreeFlags|=o,e.childLanes=i,n}function JE(e,n,i){var o=n.pendingProps;switch(df(n),n.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return St(n),null;case 1:return St(n),null;case 3:return i=n.stateNode,o=null,e!==null&&(o=e.memoizedState.cache),n.memoizedState.cache!==o&&(n.flags|=2048),Wr(Bt),Ae(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(ml(n)?ra(n):e===null||e.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,hf())),St(n),null;case 26:var f=n.type,p=n.memoizedState;return e===null?(ra(n),p!==null?(St(n),yy(n,p)):(St(n),rh(n,f,null,o,i))):p?p!==e.memoizedState?(ra(n),St(n),yy(n,p)):(St(n),n.flags&=-16777217):(e=e.memoizedProps,e!==o&&ra(n),St(n),rh(n,f,e,o,i)),null;case 27:if(Ue(n),i=me.current,f=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==o&&ra(n);else{if(!o){if(n.stateNode===null)throw Error(l(166));return St(n),null}e=ne.current,ml(n)?Zv(n):(e=Eb(f,o,i),n.stateNode=e,ra(n))}return St(n),null;case 5:if(Ue(n),f=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==o&&ra(n);else{if(!o){if(n.stateNode===null)throw Error(l(166));return St(n),null}if(p=ne.current,ml(n))Zv(n);else{var x=Ic(me.current);switch(p){case 1:p=x.createElementNS("http://www.w3.org/2000/svg",f);break;case 2:p=x.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;default:switch(f){case"svg":p=x.createElementNS("http://www.w3.org/2000/svg",f);break;case"math":p=x.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;case"script":p=x.createElement("div"),p.innerHTML="<script><\/script>",p=p.removeChild(p.firstChild);break;case"select":p=typeof o.is=="string"?x.createElement("select",{is:o.is}):x.createElement("select"),o.multiple?p.multiple=!0:o.size&&(p.size=o.size);break;default:p=typeof o.is=="string"?x.createElement(f,{is:o.is}):x.createElement(f)}}p[ge]=n,p[ve]=o;e:for(x=n.child;x!==null;){if(x.tag===5||x.tag===6)p.appendChild(x.stateNode);else if(x.tag!==4&&x.tag!==27&&x.child!==null){x.child.return=x,x=x.child;continue}if(x===n)break e;for(;x.sibling===null;){if(x.return===null||x.return===n)break e;x=x.return}x.sibling.return=x.return,x=x.sibling}n.stateNode=p;e:switch(sn(p,f,o),f){case"button":case"input":case"select":case"textarea":o=!!o.autoFocus;break e;case"img":o=!0;break e;default:o=!1}o&&ra(n)}}return St(n),rh(n,n.type,e===null?null:e.memoizedProps,n.pendingProps,i),null;case 6:if(e&&n.stateNode!=null)e.memoizedProps!==o&&ra(n);else{if(typeof o!="string"&&n.stateNode===null)throw Error(l(166));if(e=me.current,ml(n)){if(e=n.stateNode,i=n.memoizedProps,o=null,f=an,f!==null)switch(f.tag){case 27:case 5:o=f.memoizedProps}e[ge]=n,e=!!(e.nodeValue===i||o!==null&&o.suppressHydrationWarning===!0||mb(e.nodeValue,i)),e||Da(n,!0)}else e=Ic(e).createTextNode(o),e[ge]=n,n.stateNode=e}return St(n),null;case 31:if(i=n.memoizedState,e===null||e.memoizedState!==null){if(o=ml(n),i!==null){if(e===null){if(!o)throw Error(l(318));if(e=n.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(557));e[ge]=n}else Si(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;St(n),e=!1}else i=hf(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),e=!0;if(!e)return n.flags&256?(Hn(n),n):(Hn(n),null);if((n.flags&128)!==0)throw Error(l(558))}return St(n),null;case 13:if(o=n.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(f=ml(n),o!==null&&o.dehydrated!==null){if(e===null){if(!f)throw Error(l(318));if(f=n.memoizedState,f=f!==null?f.dehydrated:null,!f)throw Error(l(317));f[ge]=n}else Si(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;St(n),f=!1}else f=hf(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=f),f=!0;if(!f)return n.flags&256?(Hn(n),n):(Hn(n),null)}return Hn(n),(n.flags&128)!==0?(n.lanes=i,n):(i=o!==null,e=e!==null&&e.memoizedState!==null,i&&(o=n.child,f=null,o.alternate!==null&&o.alternate.memoizedState!==null&&o.alternate.memoizedState.cachePool!==null&&(f=o.alternate.memoizedState.cachePool.pool),p=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(p=o.memoizedState.cachePool.pool),p!==f&&(o.flags|=2048)),i!==e&&i&&(n.child.flags|=8192),Rc(n,n.updateQueue),St(n),null);case 4:return Ae(),e===null&&Eh(n.stateNode.containerInfo),St(n),null;case 10:return Wr(n.type),St(n),null;case 19:if(Q(zt),o=n.memoizedState,o===null)return St(n),null;if(f=(n.flags&128)!==0,p=o.rendering,p===null)if(f)_o(o,!1);else{if(Ot!==0||e!==null&&(e.flags&128)!==0)for(e=n.child;e!==null;){if(p=mc(e),p!==null){for(n.flags|=128,_o(o,!1),e=p.updateQueue,n.updateQueue=e,Rc(n,e),n.subtreeFlags=0,e=i,i=n.child;i!==null;)Gv(i,e),i=i.sibling;return J(zt,zt.current&1|2),Ze&&Zr(n,o.treeForkCount),n.child}e=e.sibling}o.tail!==null&&wt()>_c&&(n.flags|=128,f=!0,_o(o,!1),n.lanes=4194304)}else{if(!f)if(e=mc(p),e!==null){if(n.flags|=128,f=!0,e=e.updateQueue,n.updateQueue=e,Rc(n,e),_o(o,!0),o.tail===null&&o.tailMode==="hidden"&&!p.alternate&&!Ze)return St(n),null}else 2*wt()-o.renderingStartTime>_c&&i!==536870912&&(n.flags|=128,f=!0,_o(o,!1),n.lanes=4194304);o.isBackwards?(p.sibling=n.child,n.child=p):(e=o.last,e!==null?e.sibling=p:n.child=p,o.last=p)}return o.tail!==null?(e=o.tail,o.rendering=e,o.tail=e.sibling,o.renderingStartTime=wt(),e.sibling=null,i=zt.current,J(zt,f?i&1|2:i&1),Ze&&Zr(n,o.treeForkCount),e):(St(n),null);case 22:case 23:return Hn(n),jf(),o=n.memoizedState!==null,e!==null?e.memoizedState!==null!==o&&(n.flags|=8192):o&&(n.flags|=8192),o?(i&536870912)!==0&&(n.flags&128)===0&&(St(n),n.subtreeFlags&6&&(n.flags|=8192)):St(n),i=n.updateQueue,i!==null&&Rc(n,i.retryQueue),i=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),o=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(o=n.memoizedState.cachePool.pool),o!==i&&(n.flags|=2048),e!==null&&Q(Ni),null;case 24:return i=null,e!==null&&(i=e.memoizedState.cache),n.memoizedState.cache!==i&&(n.flags|=2048),Wr(Bt),St(n),null;case 25:return null;case 30:return null}throw Error(l(156,n.tag))}function WE(e,n){switch(df(n),n.tag){case 1:return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return Wr(Bt),Ae(),e=n.flags,(e&65536)!==0&&(e&128)===0?(n.flags=e&-65537|128,n):null;case 26:case 27:case 5:return Ue(n),null;case 31:if(n.memoizedState!==null){if(Hn(n),n.alternate===null)throw Error(l(340));Si()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 13:if(Hn(n),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(l(340));Si()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return Q(zt),null;case 4:return Ae(),null;case 10:return Wr(n.type),null;case 22:case 23:return Hn(n),jf(),e!==null&&Q(Ni),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 24:return Wr(Bt),null;case 25:return null;default:return null}}function by(e,n){switch(df(n),n.tag){case 3:Wr(Bt),Ae();break;case 26:case 27:case 5:Ue(n);break;case 4:Ae();break;case 31:n.memoizedState!==null&&Hn(n);break;case 13:Hn(n);break;case 19:Q(zt);break;case 10:Wr(n.type);break;case 22:case 23:Hn(n),jf(),e!==null&&Q(Ni);break;case 24:Wr(Bt)}}function Ao(e,n){try{var i=n.updateQueue,o=i!==null?i.lastEffect:null;if(o!==null){var f=o.next;i=f;do{if((i.tag&e)===e){o=void 0;var p=i.create,x=i.inst;o=p(),x.destroy=o}i=i.next}while(i!==f)}}catch(j){it(n,n.return,j)}}function Pa(e,n,i){try{var o=n.updateQueue,f=o!==null?o.lastEffect:null;if(f!==null){var p=f.next;o=p;do{if((o.tag&e)===e){var x=o.inst,j=x.destroy;if(j!==void 0){x.destroy=void 0,f=n;var P=i,X=j;try{X()}catch(ae){it(f,P,ae)}}}o=o.next}while(o!==p)}}catch(ae){it(n,n.return,ae)}}function xy(e){var n=e.updateQueue;if(n!==null){var i=e.stateNode;try{ug(n,i)}catch(o){it(e,e.return,o)}}}function Sy(e,n,i){i.props=Oi(e.type,e.memoizedProps),i.state=e.memoizedState;try{i.componentWillUnmount()}catch(o){it(e,n,o)}}function zo(e,n){try{var i=e.ref;if(i!==null){switch(e.tag){case 26:case 27:case 5:var o=e.stateNode;break;case 30:o=e.stateNode;break;default:o=e.stateNode}typeof i=="function"?e.refCleanup=i(o):i.current=o}}catch(f){it(e,n,f)}}function zr(e,n){var i=e.ref,o=e.refCleanup;if(i!==null)if(typeof o=="function")try{o()}catch(f){it(e,n,f)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof i=="function")try{i(null)}catch(f){it(e,n,f)}else i.current=null}function wy(e){var n=e.type,i=e.memoizedProps,o=e.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":i.autoFocus&&o.focus();break e;case"img":i.src?o.src=i.src:i.srcSet&&(o.srcset=i.srcSet)}}catch(f){it(e,e.return,f)}}function ah(e,n,i){try{var o=e.stateNode;Sj(o,e.type,i,n),o[ve]=n}catch(f){it(e,e.return,f)}}function Cy(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Va(e.type)||e.tag===4}function ih(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Cy(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Va(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function lh(e,n,i){var o=e.tag;if(o===5||o===6)e=e.stateNode,n?(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i).insertBefore(e,n):(n=i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,n.appendChild(e),i=i._reactRootContainer,i!=null||n.onclick!==null||(n.onclick=Kr));else if(o!==4&&(o===27&&Va(e.type)&&(i=e.stateNode,n=null),e=e.child,e!==null))for(lh(e,n,i),e=e.sibling;e!==null;)lh(e,n,i),e=e.sibling}function Mc(e,n,i){var o=e.tag;if(o===5||o===6)e=e.stateNode,n?i.insertBefore(e,n):i.appendChild(e);else if(o!==4&&(o===27&&Va(e.type)&&(i=e.stateNode),e=e.child,e!==null))for(Mc(e,n,i),e=e.sibling;e!==null;)Mc(e,n,i),e=e.sibling}function Ny(e){var n=e.stateNode,i=e.memoizedProps;try{for(var o=e.type,f=n.attributes;f.length;)n.removeAttributeNode(f[0]);sn(n,o,i),n[ge]=e,n[ve]=i}catch(p){it(e,e.return,p)}}var aa=!1,It=!1,oh=!1,Ey=typeof WeakSet=="function"?WeakSet:Set,Wt=null;function ej(e,n){if(e=e.containerInfo,Mh=Xc,e=Pv(e),Wd(e)){if("selectionStart"in e)var i={start:e.selectionStart,end:e.selectionEnd};else e:{i=(i=e.ownerDocument)&&i.defaultView||window;var o=i.getSelection&&i.getSelection();if(o&&o.rangeCount!==0){i=o.anchorNode;var f=o.anchorOffset,p=o.focusNode;o=o.focusOffset;try{i.nodeType,p.nodeType}catch{i=null;break e}var x=0,j=-1,P=-1,X=0,ae=0,se=e,Z=null;t:for(;;){for(var te;se!==i||f!==0&&se.nodeType!==3||(j=x+f),se!==p||o!==0&&se.nodeType!==3||(P=x+o),se.nodeType===3&&(x+=se.nodeValue.length),(te=se.firstChild)!==null;)Z=se,se=te;for(;;){if(se===e)break t;if(Z===i&&++X===f&&(j=x),Z===p&&++ae===o&&(P=x),(te=se.nextSibling)!==null)break;se=Z,Z=se.parentNode}se=te}i=j===-1||P===-1?null:{start:j,end:P}}else i=null}i=i||{start:0,end:0}}else i=null;for(Oh={focusedElem:e,selectionRange:i},Xc=!1,Wt=n;Wt!==null;)if(n=Wt,e=n.child,(n.subtreeFlags&1028)!==0&&e!==null)e.return=n,Wt=e;else for(;Wt!==null;){switch(n=Wt,p=n.alternate,e=n.flags,n.tag){case 0:if((e&4)!==0&&(e=n.updateQueue,e=e!==null?e.events:null,e!==null))for(i=0;i<e.length;i++)f=e[i],f.ref.impl=f.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&p!==null){e=void 0,i=n,f=p.memoizedProps,p=p.memoizedState,o=i.stateNode;try{var we=Oi(i.type,f);e=o.getSnapshotBeforeUpdate(we,p),o.__reactInternalSnapshotBeforeUpdate=e}catch(_e){it(i,i.return,_e)}}break;case 3:if((e&1024)!==0){if(e=n.stateNode.containerInfo,i=e.nodeType,i===9)_h(e);else if(i===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":_h(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(l(163))}if(e=n.sibling,e!==null){e.return=n.return,Wt=e;break}Wt=n.return}}function jy(e,n,i){var o=i.flags;switch(i.tag){case 0:case 11:case 15:la(e,i),o&4&&Ao(5,i);break;case 1:if(la(e,i),o&4)if(e=i.stateNode,n===null)try{e.componentDidMount()}catch(x){it(i,i.return,x)}else{var f=Oi(i.type,n.memoizedProps);n=n.memoizedState;try{e.componentDidUpdate(f,n,e.__reactInternalSnapshotBeforeUpdate)}catch(x){it(i,i.return,x)}}o&64&&xy(i),o&512&&zo(i,i.return);break;case 3:if(la(e,i),o&64&&(e=i.updateQueue,e!==null)){if(n=null,i.child!==null)switch(i.child.tag){case 27:case 5:n=i.child.stateNode;break;case 1:n=i.child.stateNode}try{ug(e,n)}catch(x){it(i,i.return,x)}}break;case 27:n===null&&o&4&&Ny(i);case 26:case 5:la(e,i),n===null&&o&4&&wy(i),o&512&&zo(i,i.return);break;case 12:la(e,i);break;case 31:la(e,i),o&4&&Oy(e,i);break;case 13:la(e,i),o&4&&Dy(e,i),o&64&&(e=i.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(i=cj.bind(null,i),Oj(e,i))));break;case 22:if(o=i.memoizedState!==null||aa,!o){n=n!==null&&n.memoizedState!==null||It,f=aa;var p=It;aa=o,(It=n)&&!p?oa(e,i,(i.subtreeFlags&8772)!==0):la(e,i),aa=f,It=p}break;case 30:break;default:la(e,i)}}function Ry(e){var n=e.alternate;n!==null&&(e.alternate=null,Ry(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&vt(n)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Ct=null,jn=!1;function ia(e,n,i){for(i=i.child;i!==null;)My(e,n,i),i=i.sibling}function My(e,n,i){if(Jt&&typeof Jt.onCommitFiberUnmount=="function")try{Jt.onCommitFiberUnmount(cn,i)}catch{}switch(i.tag){case 26:It||zr(i,n),ia(e,n,i),i.memoizedState?i.memoizedState.count--:i.stateNode&&(i=i.stateNode,i.parentNode.removeChild(i));break;case 27:It||zr(i,n);var o=Ct,f=jn;Va(i.type)&&(Ct=i.stateNode,jn=!1),ia(e,n,i),Qo(i.stateNode),Ct=o,jn=f;break;case 5:It||zr(i,n);case 6:if(o=Ct,f=jn,Ct=null,ia(e,n,i),Ct=o,jn=f,Ct!==null)if(jn)try{(Ct.nodeType===9?Ct.body:Ct.nodeName==="HTML"?Ct.ownerDocument.body:Ct).removeChild(i.stateNode)}catch(p){it(i,n,p)}else try{Ct.removeChild(i.stateNode)}catch(p){it(i,n,p)}break;case 18:Ct!==null&&(jn?(e=Ct,xb(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,i.stateNode),Ll(e)):xb(Ct,i.stateNode));break;case 4:o=Ct,f=jn,Ct=i.stateNode.containerInfo,jn=!0,ia(e,n,i),Ct=o,jn=f;break;case 0:case 11:case 14:case 15:Pa(2,i,n),It||Pa(4,i,n),ia(e,n,i);break;case 1:It||(zr(i,n),o=i.stateNode,typeof o.componentWillUnmount=="function"&&Sy(i,n,o)),ia(e,n,i);break;case 21:ia(e,n,i);break;case 22:It=(o=It)||i.memoizedState!==null,ia(e,n,i),It=o;break;default:ia(e,n,i)}}function Oy(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Ll(e)}catch(i){it(n,n.return,i)}}}function Dy(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Ll(e)}catch(i){it(n,n.return,i)}}function tj(e){switch(e.tag){case 31:case 13:case 19:var n=e.stateNode;return n===null&&(n=e.stateNode=new Ey),n;case 22:return e=e.stateNode,n=e._retryCache,n===null&&(n=e._retryCache=new Ey),n;default:throw Error(l(435,e.tag))}}function Oc(e,n){var i=tj(e);n.forEach(function(o){if(!i.has(o)){i.add(o);var f=uj.bind(null,e,o);o.then(f,f)}})}function Rn(e,n){var i=n.deletions;if(i!==null)for(var o=0;o<i.length;o++){var f=i[o],p=e,x=n,j=x;e:for(;j!==null;){switch(j.tag){case 27:if(Va(j.type)){Ct=j.stateNode,jn=!1;break e}break;case 5:Ct=j.stateNode,jn=!1;break e;case 3:case 4:Ct=j.stateNode.containerInfo,jn=!0;break e}j=j.return}if(Ct===null)throw Error(l(160));My(p,x,f),Ct=null,jn=!1,p=f.alternate,p!==null&&(p.return=null),f.return=null}if(n.subtreeFlags&13886)for(n=n.child;n!==null;)Ty(n,e),n=n.sibling}var gr=null;function Ty(e,n){var i=e.alternate,o=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Rn(n,e),Mn(e),o&4&&(Pa(3,e,e.return),Ao(3,e),Pa(5,e,e.return));break;case 1:Rn(n,e),Mn(e),o&512&&(It||i===null||zr(i,i.return)),o&64&&aa&&(e=e.updateQueue,e!==null&&(o=e.callbacks,o!==null&&(i=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=i===null?o:i.concat(o))));break;case 26:var f=gr;if(Rn(n,e),Mn(e),o&512&&(It||i===null||zr(i,i.return)),o&4){var p=i!==null?i.memoizedState:null;if(o=e.memoizedState,i===null)if(o===null)if(e.stateNode===null){e:{o=e.type,i=e.memoizedProps,f=f.ownerDocument||f;t:switch(o){case"title":p=f.getElementsByTagName("title")[0],(!p||p[Qe]||p[ge]||p.namespaceURI==="http://www.w3.org/2000/svg"||p.hasAttribute("itemprop"))&&(p=f.createElement(o),f.head.insertBefore(p,f.querySelector("head > title"))),sn(p,o,i),p[ge]=e,Rt(p),o=p;break e;case"link":var x=Tb("link","href",f).get(o+(i.href||""));if(x){for(var j=0;j<x.length;j++)if(p=x[j],p.getAttribute("href")===(i.href==null||i.href===""?null:i.href)&&p.getAttribute("rel")===(i.rel==null?null:i.rel)&&p.getAttribute("title")===(i.title==null?null:i.title)&&p.getAttribute("crossorigin")===(i.crossOrigin==null?null:i.crossOrigin)){x.splice(j,1);break t}}p=f.createElement(o),sn(p,o,i),f.head.appendChild(p);break;case"meta":if(x=Tb("meta","content",f).get(o+(i.content||""))){for(j=0;j<x.length;j++)if(p=x[j],p.getAttribute("content")===(i.content==null?null:""+i.content)&&p.getAttribute("name")===(i.name==null?null:i.name)&&p.getAttribute("property")===(i.property==null?null:i.property)&&p.getAttribute("http-equiv")===(i.httpEquiv==null?null:i.httpEquiv)&&p.getAttribute("charset")===(i.charSet==null?null:i.charSet)){x.splice(j,1);break t}}p=f.createElement(o),sn(p,o,i),f.head.appendChild(p);break;default:throw Error(l(468,o))}p[ge]=e,Rt(p),o=p}e.stateNode=o}else _b(f,e.type,e.stateNode);else e.stateNode=Db(f,o,e.memoizedProps);else p!==o?(p===null?i.stateNode!==null&&(i=i.stateNode,i.parentNode.removeChild(i)):p.count--,o===null?_b(f,e.type,e.stateNode):Db(f,o,e.memoizedProps)):o===null&&e.stateNode!==null&&ah(e,e.memoizedProps,i.memoizedProps)}break;case 27:Rn(n,e),Mn(e),o&512&&(It||i===null||zr(i,i.return)),i!==null&&o&4&&ah(e,e.memoizedProps,i.memoizedProps);break;case 5:if(Rn(n,e),Mn(e),o&512&&(It||i===null||zr(i,i.return)),e.flags&32){f=e.stateNode;try{al(f,"")}catch(we){it(e,e.return,we)}}o&4&&e.stateNode!=null&&(f=e.memoizedProps,ah(e,f,i!==null?i.memoizedProps:f)),o&1024&&(oh=!0);break;case 6:if(Rn(n,e),Mn(e),o&4){if(e.stateNode===null)throw Error(l(162));o=e.memoizedProps,i=e.stateNode;try{i.nodeValue=o}catch(we){it(e,e.return,we)}}break;case 3:if(Fc=null,f=gr,gr=Qc(n.containerInfo),Rn(n,e),gr=f,Mn(e),o&4&&i!==null&&i.memoizedState.isDehydrated)try{Ll(n.containerInfo)}catch(we){it(e,e.return,we)}oh&&(oh=!1,_y(e));break;case 4:o=gr,gr=Qc(e.stateNode.containerInfo),Rn(n,e),Mn(e),gr=o;break;case 12:Rn(n,e),Mn(e);break;case 31:Rn(n,e),Mn(e),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,Oc(e,o)));break;case 13:Rn(n,e),Mn(e),e.child.flags&8192&&e.memoizedState!==null!=(i!==null&&i.memoizedState!==null)&&(Tc=wt()),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,Oc(e,o)));break;case 22:f=e.memoizedState!==null;var P=i!==null&&i.memoizedState!==null,X=aa,ae=It;if(aa=X||f,It=ae||P,Rn(n,e),It=ae,aa=X,Mn(e),o&8192)e:for(n=e.stateNode,n._visibility=f?n._visibility&-2:n._visibility|1,f&&(i===null||P||aa||It||Di(e)),i=null,n=e;;){if(n.tag===5||n.tag===26){if(i===null){P=i=n;try{if(p=P.stateNode,f)x=p.style,typeof x.setProperty=="function"?x.setProperty("display","none","important"):x.display="none";else{j=P.stateNode;var se=P.memoizedProps.style,Z=se!=null&&se.hasOwnProperty("display")?se.display:null;j.style.display=Z==null||typeof Z=="boolean"?"":(""+Z).trim()}}catch(we){it(P,P.return,we)}}}else if(n.tag===6){if(i===null){P=n;try{P.stateNode.nodeValue=f?"":P.memoizedProps}catch(we){it(P,P.return,we)}}}else if(n.tag===18){if(i===null){P=n;try{var te=P.stateNode;f?Sb(te,!0):Sb(P.stateNode,!1)}catch(we){it(P,P.return,we)}}}else if((n.tag!==22&&n.tag!==23||n.memoizedState===null||n===e)&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break e;for(;n.sibling===null;){if(n.return===null||n.return===e)break e;i===n&&(i=null),n=n.return}i===n&&(i=null),n.sibling.return=n.return,n=n.sibling}o&4&&(o=e.updateQueue,o!==null&&(i=o.retryQueue,i!==null&&(o.retryQueue=null,Oc(e,i))));break;case 19:Rn(n,e),Mn(e),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,Oc(e,o)));break;case 30:break;case 21:break;default:Rn(n,e),Mn(e)}}function Mn(e){var n=e.flags;if(n&2){try{for(var i,o=e.return;o!==null;){if(Cy(o)){i=o;break}o=o.return}if(i==null)throw Error(l(160));switch(i.tag){case 27:var f=i.stateNode,p=ih(e);Mc(e,p,f);break;case 5:var x=i.stateNode;i.flags&32&&(al(x,""),i.flags&=-33);var j=ih(e);Mc(e,j,x);break;case 3:case 4:var P=i.stateNode.containerInfo,X=ih(e);lh(e,X,P);break;default:throw Error(l(161))}}catch(ae){it(e,e.return,ae)}e.flags&=-3}n&4096&&(e.flags&=-4097)}function _y(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var n=e;_y(n),n.tag===5&&n.flags&1024&&n.stateNode.reset(),e=e.sibling}}function la(e,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)jy(e,n.alternate,n),n=n.sibling}function Di(e){for(e=e.child;e!==null;){var n=e;switch(n.tag){case 0:case 11:case 14:case 15:Pa(4,n,n.return),Di(n);break;case 1:zr(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount=="function"&&Sy(n,n.return,i),Di(n);break;case 27:Qo(n.stateNode);case 26:case 5:zr(n,n.return),Di(n);break;case 22:n.memoizedState===null&&Di(n);break;case 30:Di(n);break;default:Di(n)}e=e.sibling}}function oa(e,n,i){for(i=i&&(n.subtreeFlags&8772)!==0,n=n.child;n!==null;){var o=n.alternate,f=e,p=n,x=p.flags;switch(p.tag){case 0:case 11:case 15:oa(f,p,i),Ao(4,p);break;case 1:if(oa(f,p,i),o=p,f=o.stateNode,typeof f.componentDidMount=="function")try{f.componentDidMount()}catch(X){it(o,o.return,X)}if(o=p,f=o.updateQueue,f!==null){var j=o.stateNode;try{var P=f.shared.hiddenCallbacks;if(P!==null)for(f.shared.hiddenCallbacks=null,f=0;f<P.length;f++)cg(P[f],j)}catch(X){it(o,o.return,X)}}i&&x&64&&xy(p),zo(p,p.return);break;case 27:Ny(p);case 26:case 5:oa(f,p,i),i&&o===null&&x&4&&wy(p),zo(p,p.return);break;case 12:oa(f,p,i);break;case 31:oa(f,p,i),i&&x&4&&Oy(f,p);break;case 13:oa(f,p,i),i&&x&4&&Dy(f,p);break;case 22:p.memoizedState===null&&oa(f,p,i),zo(p,p.return);break;case 30:break;default:oa(f,p,i)}n=n.sibling}}function sh(e,n){var i=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),e=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(e=n.memoizedState.cachePool.pool),e!==i&&(e!=null&&e.refCount++,i!=null&&xo(i))}function ch(e,n){e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&xo(e))}function yr(e,n,i,o){if(n.subtreeFlags&10256)for(n=n.child;n!==null;)Ay(e,n,i,o),n=n.sibling}function Ay(e,n,i,o){var f=n.flags;switch(n.tag){case 0:case 11:case 15:yr(e,n,i,o),f&2048&&Ao(9,n);break;case 1:yr(e,n,i,o);break;case 3:yr(e,n,i,o),f&2048&&(e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&xo(e)));break;case 12:if(f&2048){yr(e,n,i,o),e=n.stateNode;try{var p=n.memoizedProps,x=p.id,j=p.onPostCommit;typeof j=="function"&&j(x,n.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(P){it(n,n.return,P)}}else yr(e,n,i,o);break;case 31:yr(e,n,i,o);break;case 13:yr(e,n,i,o);break;case 23:break;case 22:p=n.stateNode,x=n.alternate,n.memoizedState!==null?p._visibility&2?yr(e,n,i,o):Lo(e,n):p._visibility&2?yr(e,n,i,o):(p._visibility|=2,Nl(e,n,i,o,(n.subtreeFlags&10256)!==0||!1)),f&2048&&sh(x,n);break;case 24:yr(e,n,i,o),f&2048&&ch(n.alternate,n);break;default:yr(e,n,i,o)}}function Nl(e,n,i,o,f){for(f=f&&((n.subtreeFlags&10256)!==0||!1),n=n.child;n!==null;){var p=e,x=n,j=i,P=o,X=x.flags;switch(x.tag){case 0:case 11:case 15:Nl(p,x,j,P,f),Ao(8,x);break;case 23:break;case 22:var ae=x.stateNode;x.memoizedState!==null?ae._visibility&2?Nl(p,x,j,P,f):Lo(p,x):(ae._visibility|=2,Nl(p,x,j,P,f)),f&&X&2048&&sh(x.alternate,x);break;case 24:Nl(p,x,j,P,f),f&&X&2048&&ch(x.alternate,x);break;default:Nl(p,x,j,P,f)}n=n.sibling}}function Lo(e,n){if(n.subtreeFlags&10256)for(n=n.child;n!==null;){var i=e,o=n,f=o.flags;switch(o.tag){case 22:Lo(i,o),f&2048&&sh(o.alternate,o);break;case 24:Lo(i,o),f&2048&&ch(o.alternate,o);break;default:Lo(i,o)}n=n.sibling}}var ko=8192;function El(e,n,i){if(e.subtreeFlags&ko)for(e=e.child;e!==null;)zy(e,n,i),e=e.sibling}function zy(e,n,i){switch(e.tag){case 26:El(e,n,i),e.flags&ko&&e.memoizedState!==null&&qj(i,gr,e.memoizedState,e.memoizedProps);break;case 5:El(e,n,i);break;case 3:case 4:var o=gr;gr=Qc(e.stateNode.containerInfo),El(e,n,i),gr=o;break;case 22:e.memoizedState===null&&(o=e.alternate,o!==null&&o.memoizedState!==null?(o=ko,ko=16777216,El(e,n,i),ko=o):El(e,n,i));break;default:El(e,n,i)}}function Ly(e){var n=e.alternate;if(n!==null&&(e=n.child,e!==null)){n.child=null;do n=e.sibling,e.sibling=null,e=n;while(e!==null)}}function Po(e){var n=e.deletions;if((e.flags&16)!==0){if(n!==null)for(var i=0;i<n.length;i++){var o=n[i];Wt=o,Py(o,e)}Ly(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)ky(e),e=e.sibling}function ky(e){switch(e.tag){case 0:case 11:case 15:Po(e),e.flags&2048&&Pa(9,e,e.return);break;case 3:Po(e);break;case 12:Po(e);break;case 22:var n=e.stateNode;e.memoizedState!==null&&n._visibility&2&&(e.return===null||e.return.tag!==13)?(n._visibility&=-3,Dc(e)):Po(e);break;default:Po(e)}}function Dc(e){var n=e.deletions;if((e.flags&16)!==0){if(n!==null)for(var i=0;i<n.length;i++){var o=n[i];Wt=o,Py(o,e)}Ly(e)}for(e=e.child;e!==null;){switch(n=e,n.tag){case 0:case 11:case 15:Pa(8,n,n.return),Dc(n);break;case 22:i=n.stateNode,i._visibility&2&&(i._visibility&=-3,Dc(n));break;default:Dc(n)}e=e.sibling}}function Py(e,n){for(;Wt!==null;){var i=Wt;switch(i.tag){case 0:case 11:case 15:Pa(8,i,n);break;case 23:case 22:if(i.memoizedState!==null&&i.memoizedState.cachePool!==null){var o=i.memoizedState.cachePool.pool;o!=null&&o.refCount++}break;case 24:xo(i.memoizedState.cache)}if(o=i.child,o!==null)o.return=i,Wt=o;else e:for(i=e;Wt!==null;){o=Wt;var f=o.sibling,p=o.return;if(Ry(o),o===i){Wt=null;break e}if(f!==null){f.return=p,Wt=f;break e}Wt=p}}}var nj={getCacheForType:function(e){var n=ln(Bt),i=n.data.get(e);return i===void 0&&(i=e(),n.data.set(e,i)),i},cacheSignal:function(){return ln(Bt).controller.signal}},rj=typeof WeakMap=="function"?WeakMap:Map,nt=0,ft=null,Ve=null,Ke=0,at=0,qn=null,Ua=!1,jl=!1,uh=!1,sa=0,Ot=0,Ba=0,Ti=0,dh=0,In=0,Rl=0,Uo=null,On=null,fh=!1,Tc=0,Uy=0,_c=1/0,Ac=null,Ha=null,Yt=0,qa=null,Ml=null,ca=0,hh=0,mh=null,By=null,Bo=0,ph=null;function Qn(){return(nt&2)!==0&&Ke!==0?Ke&-Ke:L.T!==null?Sh():Se()}function Hy(){if(In===0)if((Ke&536870912)===0||Ze){var e=Dr;Dr<<=1,(Dr&3932160)===0&&(Dr=262144),In=e}else In=536870912;return e=Bn.current,e!==null&&(e.flags|=32),In}function Dn(e,n,i){(e===ft&&(at===2||at===9)||e.cancelPendingCommit!==null)&&(Ol(e,0),Ia(e,Ke,In,!1)),Cn(e,i),((nt&2)===0||e!==ft)&&(e===ft&&((nt&2)===0&&(Ti|=i),Ot===4&&Ia(e,Ke,In,!1)),Lr(e))}function qy(e,n,i){if((nt&6)!==0)throw Error(l(327));var o=!i&&(n&127)===0&&(n&e.expiredLanes)===0||un(e,n),f=o?lj(e,n):gh(e,n,!0),p=o;do{if(f===0){jl&&!o&&Ia(e,n,0,!1);break}else{if(i=e.current.alternate,p&&!aj(i)){f=gh(e,n,!1),p=!1;continue}if(f===2){if(p=n,e.errorRecoveryDisabledLanes&p)var x=0;else x=e.pendingLanes&-536870913,x=x!==0?x:x&536870912?536870912:0;if(x!==0){n=x;e:{var j=e;f=Uo;var P=j.current.memoizedState.isDehydrated;if(P&&(Ol(j,x).flags|=256),x=gh(j,x,!1),x!==2){if(uh&&!P){j.errorRecoveryDisabledLanes|=p,Ti|=p,f=4;break e}p=On,On=f,p!==null&&(On===null?On=p:On.push.apply(On,p))}f=x}if(p=!1,f!==2)continue}}if(f===1){Ol(e,0),Ia(e,n,0,!0);break}e:{switch(o=e,p=f,p){case 0:case 1:throw Error(l(345));case 4:if((n&4194048)!==n)break;case 6:Ia(o,n,In,!Ua);break e;case 2:On=null;break;case 3:case 5:break;default:throw Error(l(329))}if((n&62914560)===n&&(f=Tc+300-wt(),10<f)){if(Ia(o,n,In,!Ua),Tt(o,0,!0)!==0)break e;ca=n,o.timeoutHandle=yb(Iy.bind(null,o,i,On,Ac,fh,n,In,Ti,Rl,Ua,p,"Throttled",-0,0),f);break e}Iy(o,i,On,Ac,fh,n,In,Ti,Rl,Ua,p,null,-0,0)}}break}while(!0);Lr(e)}function Iy(e,n,i,o,f,p,x,j,P,X,ae,se,Z,te){if(e.timeoutHandle=-1,se=n.subtreeFlags,se&8192||(se&16785408)===16785408){se={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Kr},zy(n,p,se);var we=(p&62914560)===p?Tc-wt():(p&4194048)===p?Uy-wt():0;if(we=Ij(se,we),we!==null){ca=p,e.cancelPendingCommit=we($y.bind(null,e,n,p,i,o,f,x,j,P,ae,se,null,Z,te)),Ia(e,p,x,!X);return}}$y(e,n,p,i,o,f,x,j,P)}function aj(e){for(var n=e;;){var i=n.tag;if((i===0||i===11||i===15)&&n.flags&16384&&(i=n.updateQueue,i!==null&&(i=i.stores,i!==null)))for(var o=0;o<i.length;o++){var f=i[o],p=f.getSnapshot;f=f.value;try{if(!Pn(p(),f))return!1}catch{return!1}}if(i=n.child,n.subtreeFlags&16384&&i!==null)i.return=n,n=i;else{if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function Ia(e,n,i,o){n&=~dh,n&=~Ti,e.suspendedLanes|=n,e.pingedLanes&=~n,o&&(e.warmLanes|=n),o=e.expirationTimes;for(var f=n;0<f;){var p=31-Vt(f),x=1<<p;o[p]=-1,f&=~x}i!==0&&U(e,i,n)}function zc(){return(nt&6)===0?(Ho(0),!1):!0}function vh(){if(Ve!==null){if(at===0)var e=Ve.return;else e=Ve,Jr=wi=null,_f(e),bl=null,wo=0,e=Ve;for(;e!==null;)by(e.alternate,e),e=e.return;Ve=null}}function Ol(e,n){var i=e.timeoutHandle;i!==-1&&(e.timeoutHandle=-1,Nj(i)),i=e.cancelPendingCommit,i!==null&&(e.cancelPendingCommit=null,i()),ca=0,vh(),ft=e,Ve=i=$r(e.current,null),Ke=n,at=0,qn=null,Ua=!1,jl=un(e,n),uh=!1,Rl=In=dh=Ti=Ba=Ot=0,On=Uo=null,fh=!1,(n&8)!==0&&(n|=n&32);var o=e.entangledLanes;if(o!==0)for(e=e.entanglements,o&=n;0<o;){var f=31-Vt(o),p=1<<f;n|=e[f],o&=~p}return sa=n,tc(),i}function Qy(e,n){ke=null,L.H=Do,n===yl||n===cc?(n=ig(),at=3):n===xf?(n=ig(),at=4):at=n===Kf?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,qn=n,Ve===null&&(Ot=1,Cc(e,er(n,e.current)))}function Vy(){var e=Bn.current;return e===null?!0:(Ke&4194048)===Ke?ar===null:(Ke&62914560)===Ke||(Ke&536870912)!==0?e===ar:!1}function Fy(){var e=L.H;return L.H=Do,e===null?Do:e}function Gy(){var e=L.A;return L.A=nj,e}function Lc(){Ot=4,Ua||(Ke&4194048)!==Ke&&Bn.current!==null||(jl=!0),(Ba&134217727)===0&&(Ti&134217727)===0||ft===null||Ia(ft,Ke,In,!1)}function gh(e,n,i){var o=nt;nt|=2;var f=Fy(),p=Gy();(ft!==e||Ke!==n)&&(Ac=null,Ol(e,n)),n=!1;var x=Ot;e:do try{if(at!==0&&Ve!==null){var j=Ve,P=qn;switch(at){case 8:vh(),x=6;break e;case 3:case 2:case 9:case 6:Bn.current===null&&(n=!0);var X=at;if(at=0,qn=null,Dl(e,j,P,X),i&&jl){x=0;break e}break;default:X=at,at=0,qn=null,Dl(e,j,P,X)}}ij(),x=Ot;break}catch(ae){Qy(e,ae)}while(!0);return n&&e.shellSuspendCounter++,Jr=wi=null,nt=o,L.H=f,L.A=p,Ve===null&&(ft=null,Ke=0,tc()),x}function ij(){for(;Ve!==null;)Yy(Ve)}function lj(e,n){var i=nt;nt|=2;var o=Fy(),f=Gy();ft!==e||Ke!==n?(Ac=null,_c=wt()+500,Ol(e,n)):jl=un(e,n);e:do try{if(at!==0&&Ve!==null){n=Ve;var p=qn;t:switch(at){case 1:at=0,qn=null,Dl(e,n,p,1);break;case 2:case 9:if(rg(p)){at=0,qn=null,Ky(n);break}n=function(){at!==2&&at!==9||ft!==e||(at=7),Lr(e)},p.then(n,n);break e;case 3:at=7;break e;case 4:at=5;break e;case 7:rg(p)?(at=0,qn=null,Ky(n)):(at=0,qn=null,Dl(e,n,p,7));break;case 5:var x=null;switch(Ve.tag){case 26:x=Ve.memoizedState;case 5:case 27:var j=Ve;if(x?Ab(x):j.stateNode.complete){at=0,qn=null;var P=j.sibling;if(P!==null)Ve=P;else{var X=j.return;X!==null?(Ve=X,kc(X)):Ve=null}break t}}at=0,qn=null,Dl(e,n,p,5);break;case 6:at=0,qn=null,Dl(e,n,p,6);break;case 8:vh(),Ot=6;break e;default:throw Error(l(462))}}oj();break}catch(ae){Qy(e,ae)}while(!0);return Jr=wi=null,L.H=o,L.A=f,nt=i,Ve!==null?0:(ft=null,Ke=0,tc(),Ot)}function oj(){for(;Ve!==null&&!Ca();)Yy(Ve)}function Yy(e){var n=gy(e.alternate,e,sa);e.memoizedProps=e.pendingProps,n===null?kc(e):Ve=n}function Ky(e){var n=e,i=n.alternate;switch(n.tag){case 15:case 0:n=dy(i,n,n.pendingProps,n.type,void 0,Ke);break;case 11:n=dy(i,n,n.pendingProps,n.type.render,n.ref,Ke);break;case 5:_f(n);default:by(i,n),n=Ve=Gv(n,sa),n=gy(i,n,sa)}e.memoizedProps=e.pendingProps,n===null?kc(e):Ve=n}function Dl(e,n,i,o){Jr=wi=null,_f(n),bl=null,wo=0;var f=n.return;try{if(XE(e,f,n,i,Ke)){Ot=1,Cc(e,er(i,e.current)),Ve=null;return}}catch(p){if(f!==null)throw Ve=f,p;Ot=1,Cc(e,er(i,e.current)),Ve=null;return}n.flags&32768?(Ze||o===1?e=!0:jl||(Ke&536870912)!==0?e=!1:(Ua=e=!0,(o===2||o===9||o===3||o===6)&&(o=Bn.current,o!==null&&o.tag===13&&(o.flags|=16384))),Xy(n,e)):kc(n)}function kc(e){var n=e;do{if((n.flags&32768)!==0){Xy(n,Ua);return}e=n.return;var i=JE(n.alternate,n,sa);if(i!==null){Ve=i;return}if(n=n.sibling,n!==null){Ve=n;return}Ve=n=e}while(n!==null);Ot===0&&(Ot=5)}function Xy(e,n){do{var i=WE(e.alternate,e);if(i!==null){i.flags&=32767,Ve=i;return}if(i=e.return,i!==null&&(i.flags|=32768,i.subtreeFlags=0,i.deletions=null),!n&&(e=e.sibling,e!==null)){Ve=e;return}Ve=e=i}while(e!==null);Ot=6,Ve=null}function $y(e,n,i,o,f,p,x,j,P){e.cancelPendingCommit=null;do Pc();while(Yt!==0);if((nt&6)!==0)throw Error(l(327));if(n!==null){if(n===e.current)throw Error(l(177));if(p=n.lanes|n.childLanes,p|=af,At(e,i,p,x,j,P),e===ft&&(Ve=ft=null,Ke=0),Ml=n,qa=e,ca=i,hh=p,mh=f,By=o,(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,dj(Ut,function(){return tb(),null})):(e.callbackNode=null,e.callbackPriority=0),o=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||o){o=L.T,L.T=null,f=G.p,G.p=2,x=nt,nt|=4;try{ej(e,n,i)}finally{nt=x,G.p=f,L.T=o}}Yt=1,Zy(),Jy(),Wy()}}function Zy(){if(Yt===1){Yt=0;var e=qa,n=Ml,i=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||i){i=L.T,L.T=null;var o=G.p;G.p=2;var f=nt;nt|=4;try{Ty(n,e);var p=Oh,x=Pv(e.containerInfo),j=p.focusedElem,P=p.selectionRange;if(x!==j&&j&&j.ownerDocument&&kv(j.ownerDocument.documentElement,j)){if(P!==null&&Wd(j)){var X=P.start,ae=P.end;if(ae===void 0&&(ae=X),"selectionStart"in j)j.selectionStart=X,j.selectionEnd=Math.min(ae,j.value.length);else{var se=j.ownerDocument||document,Z=se&&se.defaultView||window;if(Z.getSelection){var te=Z.getSelection(),we=j.textContent.length,_e=Math.min(P.start,we),ut=P.end===void 0?_e:Math.min(P.end,we);!te.extend&&_e>ut&&(x=ut,ut=_e,_e=x);var F=Lv(j,_e),H=Lv(j,ut);if(F&&H&&(te.rangeCount!==1||te.anchorNode!==F.node||te.anchorOffset!==F.offset||te.focusNode!==H.node||te.focusOffset!==H.offset)){var Y=se.createRange();Y.setStart(F.node,F.offset),te.removeAllRanges(),_e>ut?(te.addRange(Y),te.extend(H.node,H.offset)):(Y.setEnd(H.node,H.offset),te.addRange(Y))}}}}for(se=[],te=j;te=te.parentNode;)te.nodeType===1&&se.push({element:te,left:te.scrollLeft,top:te.scrollTop});for(typeof j.focus=="function"&&j.focus(),j=0;j<se.length;j++){var oe=se[j];oe.element.scrollLeft=oe.left,oe.element.scrollTop=oe.top}}Xc=!!Mh,Oh=Mh=null}finally{nt=f,G.p=o,L.T=i}}e.current=n,Yt=2}}function Jy(){if(Yt===2){Yt=0;var e=qa,n=Ml,i=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||i){i=L.T,L.T=null;var o=G.p;G.p=2;var f=nt;nt|=4;try{jy(e,n.alternate,n)}finally{nt=f,G.p=o,L.T=i}}Yt=3}}function Wy(){if(Yt===4||Yt===3){Yt=0,tl();var e=qa,n=Ml,i=ca,o=By;(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?Yt=5:(Yt=0,Ml=qa=null,eb(e,e.pendingLanes));var f=e.pendingLanes;if(f===0&&(Ha=null),pe(i),n=n.stateNode,Jt&&typeof Jt.onCommitFiberRoot=="function")try{Jt.onCommitFiberRoot(cn,n,void 0,(n.current.flags&128)===128)}catch{}if(o!==null){n=L.T,f=G.p,G.p=2,L.T=null;try{for(var p=e.onRecoverableError,x=0;x<o.length;x++){var j=o[x];p(j.value,{componentStack:j.stack})}}finally{L.T=n,G.p=f}}(ca&3)!==0&&Pc(),Lr(e),f=e.pendingLanes,(i&261930)!==0&&(f&42)!==0?e===ph?Bo++:(Bo=0,ph=e):Bo=0,Ho(0)}}function eb(e,n){(e.pooledCacheLanes&=n)===0&&(n=e.pooledCache,n!=null&&(e.pooledCache=null,xo(n)))}function Pc(){return Zy(),Jy(),Wy(),tb()}function tb(){if(Yt!==5)return!1;var e=qa,n=hh;hh=0;var i=pe(ca),o=L.T,f=G.p;try{G.p=32>i?32:i,L.T=null,i=mh,mh=null;var p=qa,x=ca;if(Yt=0,Ml=qa=null,ca=0,(nt&6)!==0)throw Error(l(331));var j=nt;if(nt|=4,ky(p.current),Ay(p,p.current,x,i),nt=j,Ho(0,!1),Jt&&typeof Jt.onPostCommitFiberRoot=="function")try{Jt.onPostCommitFiberRoot(cn,p)}catch{}return!0}finally{G.p=f,L.T=o,eb(e,n)}}function nb(e,n,i){n=er(i,n),n=Yf(e.stateNode,n,2),e=za(e,n,2),e!==null&&(Cn(e,2),Lr(e))}function it(e,n,i){if(e.tag===3)nb(e,e,i);else for(;n!==null;){if(n.tag===3){nb(n,e,i);break}else if(n.tag===1){var o=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof o.componentDidCatch=="function"&&(Ha===null||!Ha.has(o))){e=er(i,e),i=ry(2),o=za(n,i,2),o!==null&&(ay(i,o,n,e),Cn(o,2),Lr(o));break}}n=n.return}}function yh(e,n,i){var o=e.pingCache;if(o===null){o=e.pingCache=new rj;var f=new Set;o.set(n,f)}else f=o.get(n),f===void 0&&(f=new Set,o.set(n,f));f.has(i)||(uh=!0,f.add(i),e=sj.bind(null,e,n,i),n.then(e,e))}function sj(e,n,i){var o=e.pingCache;o!==null&&o.delete(n),e.pingedLanes|=e.suspendedLanes&i,e.warmLanes&=~i,ft===e&&(Ke&i)===i&&(Ot===4||Ot===3&&(Ke&62914560)===Ke&&300>wt()-Tc?(nt&2)===0&&Ol(e,0):dh|=i,Rl===Ke&&(Rl=0)),Lr(e)}function rb(e,n){n===0&&(n=_t()),e=bi(e,n),e!==null&&(Cn(e,n),Lr(e))}function cj(e){var n=e.memoizedState,i=0;n!==null&&(i=n.retryLane),rb(e,i)}function uj(e,n){var i=0;switch(e.tag){case 31:case 13:var o=e.stateNode,f=e.memoizedState;f!==null&&(i=f.retryLane);break;case 19:o=e.stateNode;break;case 22:o=e.stateNode._retryCache;break;default:throw Error(l(314))}o!==null&&o.delete(n),rb(e,i)}function dj(e,n){return wn(e,n)}var Uc=null,Tl=null,bh=!1,Bc=!1,xh=!1,Qa=0;function Lr(e){e!==Tl&&e.next===null&&(Tl===null?Uc=Tl=e:Tl=Tl.next=e),Bc=!0,bh||(bh=!0,hj())}function Ho(e,n){if(!xh&&Bc){xh=!0;do for(var i=!1,o=Uc;o!==null;){if(e!==0){var f=o.pendingLanes;if(f===0)var p=0;else{var x=o.suspendedLanes,j=o.pingedLanes;p=(1<<31-Vt(42|e)+1)-1,p&=f&~(x&~j),p=p&201326741?p&201326741|1:p?p|2:0}p!==0&&(i=!0,ob(o,p))}else p=Ke,p=Tt(o,o===ft?p:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),(p&3)===0||un(o,p)||(i=!0,ob(o,p));o=o.next}while(i);xh=!1}}function fj(){ab()}function ab(){Bc=bh=!1;var e=0;Qa!==0&&Cj()&&(e=Qa);for(var n=wt(),i=null,o=Uc;o!==null;){var f=o.next,p=ib(o,n);p===0?(o.next=null,i===null?Uc=f:i.next=f,f===null&&(Tl=i)):(i=o,(e!==0||(p&3)!==0)&&(Bc=!0)),o=f}Yt!==0&&Yt!==5||Ho(e),Qa!==0&&(Qa=0)}function ib(e,n){for(var i=e.suspendedLanes,o=e.pingedLanes,f=e.expirationTimes,p=e.pendingLanes&-62914561;0<p;){var x=31-Vt(p),j=1<<x,P=f[x];P===-1?((j&i)===0||(j&o)!==0)&&(f[x]=nn(j,n)):P<=n&&(e.expiredLanes|=j),p&=~j}if(n=ft,i=Ke,i=Tt(e,e===n?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),o=e.callbackNode,i===0||e===n&&(at===2||at===9)||e.cancelPendingCommit!==null)return o!==null&&o!==null&&Or(o),e.callbackNode=null,e.callbackPriority=0;if((i&3)===0||un(e,i)){if(n=i&-i,n===e.callbackPriority)return n;switch(o!==null&&Or(o),pe(i)){case 2:case 8:i=Ln;break;case 32:i=Ut;break;case 268435456:i=Na;break;default:i=Ut}return o=lb.bind(null,e),i=wn(i,o),e.callbackPriority=n,e.callbackNode=i,n}return o!==null&&o!==null&&Or(o),e.callbackPriority=2,e.callbackNode=null,2}function lb(e,n){if(Yt!==0&&Yt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var i=e.callbackNode;if(Pc()&&e.callbackNode!==i)return null;var o=Ke;return o=Tt(e,e===ft?o:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),o===0?null:(qy(e,o,n),ib(e,wt()),e.callbackNode!=null&&e.callbackNode===i?lb.bind(null,e):null)}function ob(e,n){if(Pc())return null;qy(e,n,!0)}function hj(){Ej(function(){(nt&6)!==0?wn(hi,fj):ab()})}function Sh(){if(Qa===0){var e=vl;e===0&&(e=Gr,Gr<<=1,(Gr&261888)===0&&(Gr=256)),Qa=e}return Qa}function sb(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Ys(""+e)}function cb(e,n){var i=n.ownerDocument.createElement("input");return i.name=n.name,i.value=n.value,e.id&&i.setAttribute("form",e.id),n.parentNode.insertBefore(i,n),e=new FormData(e),i.parentNode.removeChild(i),e}function mj(e,n,i,o,f){if(n==="submit"&&i&&i.stateNode===f){var p=sb((f[ve]||null).action),x=o.submitter;x&&(n=(n=x[ve]||null)?sb(n.formAction):x.getAttribute("formAction"),n!==null&&(p=n,x=null));var j=new Zs("action","action",null,o,f);e.push({event:j,listeners:[{instance:null,listener:function(){if(o.defaultPrevented){if(Qa!==0){var P=x?cb(f,x):new FormData(f);qf(i,{pending:!0,data:P,method:f.method,action:p},null,P)}}else typeof p=="function"&&(j.preventDefault(),P=x?cb(f,x):new FormData(f),qf(i,{pending:!0,data:P,method:f.method,action:p},p,P))},currentTarget:f}]})}}for(var wh=0;wh<rf.length;wh++){var Ch=rf[wh],pj=Ch.toLowerCase(),vj=Ch[0].toUpperCase()+Ch.slice(1);vr(pj,"on"+vj)}vr(Hv,"onAnimationEnd"),vr(qv,"onAnimationIteration"),vr(Iv,"onAnimationStart"),vr("dblclick","onDoubleClick"),vr("focusin","onFocus"),vr("focusout","onBlur"),vr(_E,"onTransitionRun"),vr(AE,"onTransitionStart"),vr(zE,"onTransitionCancel"),vr(Qv,"onTransitionEnd"),mr("onMouseEnter",["mouseout","mouseover"]),mr("onMouseLeave",["mouseout","mouseover"]),mr("onPointerEnter",["pointerout","pointerover"]),mr("onPointerLeave",["pointerout","pointerover"]),$n("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),$n("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),$n("onBeforeInput",["compositionend","keypress","textInput","paste"]),$n("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),$n("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),$n("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var qo="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),gj=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(qo));function ub(e,n){n=(n&4)!==0;for(var i=0;i<e.length;i++){var o=e[i],f=o.event;o=o.listeners;e:{var p=void 0;if(n)for(var x=o.length-1;0<=x;x--){var j=o[x],P=j.instance,X=j.currentTarget;if(j=j.listener,P!==p&&f.isPropagationStopped())break e;p=j,f.currentTarget=X;try{p(f)}catch(ae){ec(ae)}f.currentTarget=null,p=P}else for(x=0;x<o.length;x++){if(j=o[x],P=j.instance,X=j.currentTarget,j=j.listener,P!==p&&f.isPropagationStopped())break e;p=j,f.currentTarget=X;try{p(f)}catch(ae){ec(ae)}f.currentTarget=null,p=P}}}}function Fe(e,n){var i=n[ze];i===void 0&&(i=n[ze]=new Set);var o=e+"__bubble";i.has(o)||(db(n,e,2,!1),i.add(o))}function Nh(e,n,i){var o=0;n&&(o|=4),db(i,e,o,n)}var Hc="_reactListening"+Math.random().toString(36).slice(2);function Eh(e){if(!e[Hc]){e[Hc]=!0,ja.forEach(function(i){i!=="selectionchange"&&(gj.has(i)||Nh(i,!1,e),Nh(i,!0,e))});var n=e.nodeType===9?e:e.ownerDocument;n===null||n[Hc]||(n[Hc]=!0,Nh("selectionchange",!1,n))}}function db(e,n,i,o){switch(Hb(n)){case 2:var f=Fj;break;case 8:f=Gj;break;default:f=Hh}i=f.bind(null,n,i,e),f=void 0,!Vd||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(f=!0),o?f!==void 0?e.addEventListener(n,i,{capture:!0,passive:f}):e.addEventListener(n,i,!0):f!==void 0?e.addEventListener(n,i,{passive:f}):e.addEventListener(n,i,!1)}function jh(e,n,i,o,f){var p=o;if((n&1)===0&&(n&2)===0&&o!==null)e:for(;;){if(o===null)return;var x=o.tag;if(x===3||x===4){var j=o.stateNode.containerInfo;if(j===f)break;if(x===4)for(x=o.return;x!==null;){var P=x.tag;if((P===3||P===4)&&x.stateNode.containerInfo===f)return;x=x.return}for(;j!==null;){if(x=kn(j),x===null)return;if(P=x.tag,P===5||P===6||P===26||P===27){o=p=x;continue e}j=j.parentNode}}o=o.return}vv(function(){var X=p,ae=Id(i),se=[];e:{var Z=Vv.get(e);if(Z!==void 0){var te=Zs,we=e;switch(e){case"keypress":if(Xs(i)===0)break e;case"keydown":case"keyup":te=uE;break;case"focusin":we="focus",te=Kd;break;case"focusout":we="blur",te=Kd;break;case"beforeblur":case"afterblur":te=Kd;break;case"click":if(i.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":te=bv;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":te=JN;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":te=hE;break;case Hv:case qv:case Iv:te=tE;break;case Qv:te=pE;break;case"scroll":case"scrollend":te=$N;break;case"wheel":te=gE;break;case"copy":case"cut":case"paste":te=rE;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":te=Sv;break;case"toggle":case"beforetoggle":te=bE}var _e=(n&4)!==0,ut=!_e&&(e==="scroll"||e==="scrollend"),F=_e?Z!==null?Z+"Capture":null:Z;_e=[];for(var H=X,Y;H!==null;){var oe=H;if(Y=oe.stateNode,oe=oe.tag,oe!==5&&oe!==26&&oe!==27||Y===null||F===null||(oe=so(H,F),oe!=null&&_e.push(Io(H,oe,Y))),ut)break;H=H.return}0<_e.length&&(Z=new te(Z,we,null,i,ae),se.push({event:Z,listeners:_e}))}}if((n&7)===0){e:{if(Z=e==="mouseover"||e==="pointerover",te=e==="mouseout"||e==="pointerout",Z&&i!==qd&&(we=i.relatedTarget||i.fromElement)&&(kn(we)||we[Ce]))break e;if((te||Z)&&(Z=ae.window===ae?ae:(Z=ae.ownerDocument)?Z.defaultView||Z.parentWindow:window,te?(we=i.relatedTarget||i.toElement,te=X,we=we?kn(we):null,we!==null&&(ut=c(we),_e=we.tag,we!==ut||_e!==5&&_e!==27&&_e!==6)&&(we=null)):(te=null,we=X),te!==we)){if(_e=bv,oe="onMouseLeave",F="onMouseEnter",H="mouse",(e==="pointerout"||e==="pointerover")&&(_e=Sv,oe="onPointerLeave",F="onPointerEnter",H="pointer"),ut=te==null?Z:vn(te),Y=we==null?Z:vn(we),Z=new _e(oe,H+"leave",te,i,ae),Z.target=ut,Z.relatedTarget=Y,oe=null,kn(ae)===X&&(_e=new _e(F,H+"enter",we,i,ae),_e.target=Y,_e.relatedTarget=ut,oe=_e),ut=oe,te&&we)t:{for(_e=yj,F=te,H=we,Y=0,oe=F;oe;oe=_e(oe))Y++;oe=0;for(var Oe=H;Oe;Oe=_e(Oe))oe++;for(;0<Y-oe;)F=_e(F),Y--;for(;0<oe-Y;)H=_e(H),oe--;for(;Y--;){if(F===H||H!==null&&F===H.alternate){_e=F;break t}F=_e(F),H=_e(H)}_e=null}else _e=null;te!==null&&fb(se,Z,te,_e,!1),we!==null&&ut!==null&&fb(se,ut,we,_e,!0)}}e:{if(Z=X?vn(X):window,te=Z.nodeName&&Z.nodeName.toLowerCase(),te==="select"||te==="input"&&Z.type==="file")var We=Ov;else if(Rv(Z))if(Dv)We=OE;else{We=RE;var je=jE}else te=Z.nodeName,!te||te.toLowerCase()!=="input"||Z.type!=="checkbox"&&Z.type!=="radio"?X&&Hd(X.elementType)&&(We=Ov):We=ME;if(We&&(We=We(e,X))){Mv(se,We,i,ae);break e}je&&je(e,Z,X),e==="focusout"&&X&&Z.type==="number"&&X.memoizedProps.value!=null&&Bd(Z,"number",Z.value)}switch(je=X?vn(X):window,e){case"focusin":(Rv(je)||je.contentEditable==="true")&&(sl=je,ef=X,go=null);break;case"focusout":go=ef=sl=null;break;case"mousedown":tf=!0;break;case"contextmenu":case"mouseup":case"dragend":tf=!1,Uv(se,i,ae);break;case"selectionchange":if(TE)break;case"keydown":case"keyup":Uv(se,i,ae)}var Be;if($d)e:{switch(e){case"compositionstart":var Xe="onCompositionStart";break e;case"compositionend":Xe="onCompositionEnd";break e;case"compositionupdate":Xe="onCompositionUpdate";break e}Xe=void 0}else ol?Ev(e,i)&&(Xe="onCompositionEnd"):e==="keydown"&&i.keyCode===229&&(Xe="onCompositionStart");Xe&&(wv&&i.locale!=="ko"&&(ol||Xe!=="onCompositionStart"?Xe==="onCompositionEnd"&&ol&&(Be=gv()):(Ra=ae,Fd="value"in Ra?Ra.value:Ra.textContent,ol=!0)),je=qc(X,Xe),0<je.length&&(Xe=new xv(Xe,e,null,i,ae),se.push({event:Xe,listeners:je}),Be?Xe.data=Be:(Be=jv(i),Be!==null&&(Xe.data=Be)))),(Be=SE?wE(e,i):CE(e,i))&&(Xe=qc(X,"onBeforeInput"),0<Xe.length&&(je=new xv("onBeforeInput","beforeinput",null,i,ae),se.push({event:je,listeners:Xe}),je.data=Be)),mj(se,e,X,i,ae)}ub(se,n)})}function Io(e,n,i){return{instance:e,listener:n,currentTarget:i}}function qc(e,n){for(var i=n+"Capture",o=[];e!==null;){var f=e,p=f.stateNode;if(f=f.tag,f!==5&&f!==26&&f!==27||p===null||(f=so(e,i),f!=null&&o.unshift(Io(e,f,p)),f=so(e,n),f!=null&&o.push(Io(e,f,p))),e.tag===3)return o;e=e.return}return[]}function yj(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function fb(e,n,i,o,f){for(var p=n._reactName,x=[];i!==null&&i!==o;){var j=i,P=j.alternate,X=j.stateNode;if(j=j.tag,P!==null&&P===o)break;j!==5&&j!==26&&j!==27||X===null||(P=X,f?(X=so(i,p),X!=null&&x.unshift(Io(i,X,P))):f||(X=so(i,p),X!=null&&x.push(Io(i,X,P)))),i=i.return}x.length!==0&&e.push({event:n,listeners:x})}var bj=/\r\n?/g,xj=/\u0000|\uFFFD/g;function hb(e){return(typeof e=="string"?e:""+e).replace(bj,`
`).replace(xj,"")}function mb(e,n){return n=hb(n),hb(e)===n}function ct(e,n,i,o,f,p){switch(i){case"children":typeof o=="string"?n==="body"||n==="textarea"&&o===""||al(e,o):(typeof o=="number"||typeof o=="bigint")&&n!=="body"&&al(e,""+o);break;case"className":pr(e,"class",o);break;case"tabIndex":pr(e,"tabindex",o);break;case"dir":case"role":case"viewBox":case"width":case"height":pr(e,i,o);break;case"style":mv(e,o,p);break;case"data":if(n!=="object"){pr(e,"data",o);break}case"src":case"href":if(o===""&&(n!=="a"||i!=="href")){e.removeAttribute(i);break}if(o==null||typeof o=="function"||typeof o=="symbol"||typeof o=="boolean"){e.removeAttribute(i);break}o=Ys(""+o),e.setAttribute(i,o);break;case"action":case"formAction":if(typeof o=="function"){e.setAttribute(i,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof p=="function"&&(i==="formAction"?(n!=="input"&&ct(e,n,"name",f.name,f,null),ct(e,n,"formEncType",f.formEncType,f,null),ct(e,n,"formMethod",f.formMethod,f,null),ct(e,n,"formTarget",f.formTarget,f,null)):(ct(e,n,"encType",f.encType,f,null),ct(e,n,"method",f.method,f,null),ct(e,n,"target",f.target,f,null)));if(o==null||typeof o=="symbol"||typeof o=="boolean"){e.removeAttribute(i);break}o=Ys(""+o),e.setAttribute(i,o);break;case"onClick":o!=null&&(e.onclick=Kr);break;case"onScroll":o!=null&&Fe("scroll",e);break;case"onScrollEnd":o!=null&&Fe("scrollend",e);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(l(61));if(i=o.__html,i!=null){if(f.children!=null)throw Error(l(60));e.innerHTML=i}}break;case"multiple":e.multiple=o&&typeof o!="function"&&typeof o!="symbol";break;case"muted":e.muted=o&&typeof o!="function"&&typeof o!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(o==null||typeof o=="function"||typeof o=="boolean"||typeof o=="symbol"){e.removeAttribute("xlink:href");break}i=Ys(""+o),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",i);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":o!=null&&typeof o!="function"&&typeof o!="symbol"?e.setAttribute(i,""+o):e.removeAttribute(i);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":o&&typeof o!="function"&&typeof o!="symbol"?e.setAttribute(i,""):e.removeAttribute(i);break;case"capture":case"download":o===!0?e.setAttribute(i,""):o!==!1&&o!=null&&typeof o!="function"&&typeof o!="symbol"?e.setAttribute(i,o):e.removeAttribute(i);break;case"cols":case"rows":case"size":case"span":o!=null&&typeof o!="function"&&typeof o!="symbol"&&!isNaN(o)&&1<=o?e.setAttribute(i,o):e.removeAttribute(i);break;case"rowSpan":case"start":o==null||typeof o=="function"||typeof o=="symbol"||isNaN(o)?e.removeAttribute(i):e.setAttribute(i,o);break;case"popover":Fe("beforetoggle",e),Fe("toggle",e),bt(e,"popover",o);break;case"xlinkActuate":Zn(e,"http://www.w3.org/1999/xlink","xlink:actuate",o);break;case"xlinkArcrole":Zn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",o);break;case"xlinkRole":Zn(e,"http://www.w3.org/1999/xlink","xlink:role",o);break;case"xlinkShow":Zn(e,"http://www.w3.org/1999/xlink","xlink:show",o);break;case"xlinkTitle":Zn(e,"http://www.w3.org/1999/xlink","xlink:title",o);break;case"xlinkType":Zn(e,"http://www.w3.org/1999/xlink","xlink:type",o);break;case"xmlBase":Zn(e,"http://www.w3.org/XML/1998/namespace","xml:base",o);break;case"xmlLang":Zn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",o);break;case"xmlSpace":Zn(e,"http://www.w3.org/XML/1998/namespace","xml:space",o);break;case"is":bt(e,"is",o);break;case"innerText":case"textContent":break;default:(!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")&&(i=KN.get(i)||i,bt(e,i,o))}}function Rh(e,n,i,o,f,p){switch(i){case"style":mv(e,o,p);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(l(61));if(i=o.__html,i!=null){if(f.children!=null)throw Error(l(60));e.innerHTML=i}}break;case"children":typeof o=="string"?al(e,o):(typeof o=="number"||typeof o=="bigint")&&al(e,""+o);break;case"onScroll":o!=null&&Fe("scroll",e);break;case"onScrollEnd":o!=null&&Fe("scrollend",e);break;case"onClick":o!=null&&(e.onclick=Kr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Tr.hasOwnProperty(i))e:{if(i[0]==="o"&&i[1]==="n"&&(f=i.endsWith("Capture"),n=i.slice(2,f?i.length-7:void 0),p=e[ve]||null,p=p!=null?p[i]:null,typeof p=="function"&&e.removeEventListener(n,p,f),typeof o=="function")){typeof p!="function"&&p!==null&&(i in e?e[i]=null:e.hasAttribute(i)&&e.removeAttribute(i)),e.addEventListener(n,o,f);break e}i in e?e[i]=o:o===!0?e.setAttribute(i,""):bt(e,i,o)}}}function sn(e,n,i){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Fe("error",e),Fe("load",e);var o=!1,f=!1,p;for(p in i)if(i.hasOwnProperty(p)){var x=i[p];if(x!=null)switch(p){case"src":o=!0;break;case"srcSet":f=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(l(137,n));default:ct(e,n,p,x,i,null)}}f&&ct(e,n,"srcSet",i.srcSet,i,null),o&&ct(e,n,"src",i.src,i,null);return;case"input":Fe("invalid",e);var j=p=x=f=null,P=null,X=null;for(o in i)if(i.hasOwnProperty(o)){var ae=i[o];if(ae!=null)switch(o){case"name":f=ae;break;case"type":x=ae;break;case"checked":P=ae;break;case"defaultChecked":X=ae;break;case"value":p=ae;break;case"defaultValue":j=ae;break;case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(l(137,n));break;default:ct(e,n,o,ae,i,null)}}uv(e,p,j,P,X,x,f,!1);return;case"select":Fe("invalid",e),o=x=p=null;for(f in i)if(i.hasOwnProperty(f)&&(j=i[f],j!=null))switch(f){case"value":p=j;break;case"defaultValue":x=j;break;case"multiple":o=j;default:ct(e,n,f,j,i,null)}n=p,i=x,e.multiple=!!o,n!=null?rl(e,!!o,n,!1):i!=null&&rl(e,!!o,i,!0);return;case"textarea":Fe("invalid",e),p=f=o=null;for(x in i)if(i.hasOwnProperty(x)&&(j=i[x],j!=null))switch(x){case"value":o=j;break;case"defaultValue":f=j;break;case"children":p=j;break;case"dangerouslySetInnerHTML":if(j!=null)throw Error(l(91));break;default:ct(e,n,x,j,i,null)}fv(e,o,f,p);return;case"option":for(P in i)if(i.hasOwnProperty(P)&&(o=i[P],o!=null))switch(P){case"selected":e.selected=o&&typeof o!="function"&&typeof o!="symbol";break;default:ct(e,n,P,o,i,null)}return;case"dialog":Fe("beforetoggle",e),Fe("toggle",e),Fe("cancel",e),Fe("close",e);break;case"iframe":case"object":Fe("load",e);break;case"video":case"audio":for(o=0;o<qo.length;o++)Fe(qo[o],e);break;case"image":Fe("error",e),Fe("load",e);break;case"details":Fe("toggle",e);break;case"embed":case"source":case"link":Fe("error",e),Fe("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(X in i)if(i.hasOwnProperty(X)&&(o=i[X],o!=null))switch(X){case"children":case"dangerouslySetInnerHTML":throw Error(l(137,n));default:ct(e,n,X,o,i,null)}return;default:if(Hd(n)){for(ae in i)i.hasOwnProperty(ae)&&(o=i[ae],o!==void 0&&Rh(e,n,ae,o,i,void 0));return}}for(j in i)i.hasOwnProperty(j)&&(o=i[j],o!=null&&ct(e,n,j,o,i,null))}function Sj(e,n,i,o){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var f=null,p=null,x=null,j=null,P=null,X=null,ae=null;for(te in i){var se=i[te];if(i.hasOwnProperty(te)&&se!=null)switch(te){case"checked":break;case"value":break;case"defaultValue":P=se;default:o.hasOwnProperty(te)||ct(e,n,te,null,o,se)}}for(var Z in o){var te=o[Z];if(se=i[Z],o.hasOwnProperty(Z)&&(te!=null||se!=null))switch(Z){case"type":p=te;break;case"name":f=te;break;case"checked":X=te;break;case"defaultChecked":ae=te;break;case"value":x=te;break;case"defaultValue":j=te;break;case"children":case"dangerouslySetInnerHTML":if(te!=null)throw Error(l(137,n));break;default:te!==se&&ct(e,n,Z,te,o,se)}}Ud(e,x,j,P,X,ae,p,f);return;case"select":te=x=j=Z=null;for(p in i)if(P=i[p],i.hasOwnProperty(p)&&P!=null)switch(p){case"value":break;case"multiple":te=P;default:o.hasOwnProperty(p)||ct(e,n,p,null,o,P)}for(f in o)if(p=o[f],P=i[f],o.hasOwnProperty(f)&&(p!=null||P!=null))switch(f){case"value":Z=p;break;case"defaultValue":j=p;break;case"multiple":x=p;default:p!==P&&ct(e,n,f,p,o,P)}n=j,i=x,o=te,Z!=null?rl(e,!!i,Z,!1):!!o!=!!i&&(n!=null?rl(e,!!i,n,!0):rl(e,!!i,i?[]:"",!1));return;case"textarea":te=Z=null;for(j in i)if(f=i[j],i.hasOwnProperty(j)&&f!=null&&!o.hasOwnProperty(j))switch(j){case"value":break;case"children":break;default:ct(e,n,j,null,o,f)}for(x in o)if(f=o[x],p=i[x],o.hasOwnProperty(x)&&(f!=null||p!=null))switch(x){case"value":Z=f;break;case"defaultValue":te=f;break;case"children":break;case"dangerouslySetInnerHTML":if(f!=null)throw Error(l(91));break;default:f!==p&&ct(e,n,x,f,o,p)}dv(e,Z,te);return;case"option":for(var we in i)if(Z=i[we],i.hasOwnProperty(we)&&Z!=null&&!o.hasOwnProperty(we))switch(we){case"selected":e.selected=!1;break;default:ct(e,n,we,null,o,Z)}for(P in o)if(Z=o[P],te=i[P],o.hasOwnProperty(P)&&Z!==te&&(Z!=null||te!=null))switch(P){case"selected":e.selected=Z&&typeof Z!="function"&&typeof Z!="symbol";break;default:ct(e,n,P,Z,o,te)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var _e in i)Z=i[_e],i.hasOwnProperty(_e)&&Z!=null&&!o.hasOwnProperty(_e)&&ct(e,n,_e,null,o,Z);for(X in o)if(Z=o[X],te=i[X],o.hasOwnProperty(X)&&Z!==te&&(Z!=null||te!=null))switch(X){case"children":case"dangerouslySetInnerHTML":if(Z!=null)throw Error(l(137,n));break;default:ct(e,n,X,Z,o,te)}return;default:if(Hd(n)){for(var ut in i)Z=i[ut],i.hasOwnProperty(ut)&&Z!==void 0&&!o.hasOwnProperty(ut)&&Rh(e,n,ut,void 0,o,Z);for(ae in o)Z=o[ae],te=i[ae],!o.hasOwnProperty(ae)||Z===te||Z===void 0&&te===void 0||Rh(e,n,ae,Z,o,te);return}}for(var F in i)Z=i[F],i.hasOwnProperty(F)&&Z!=null&&!o.hasOwnProperty(F)&&ct(e,n,F,null,o,Z);for(se in o)Z=o[se],te=i[se],!o.hasOwnProperty(se)||Z===te||Z==null&&te==null||ct(e,n,se,Z,o,te)}function pb(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function wj(){if(typeof performance.getEntriesByType=="function"){for(var e=0,n=0,i=performance.getEntriesByType("resource"),o=0;o<i.length;o++){var f=i[o],p=f.transferSize,x=f.initiatorType,j=f.duration;if(p&&j&&pb(x)){for(x=0,j=f.responseEnd,o+=1;o<i.length;o++){var P=i[o],X=P.startTime;if(X>j)break;var ae=P.transferSize,se=P.initiatorType;ae&&pb(se)&&(P=P.responseEnd,x+=ae*(P<j?1:(j-X)/(P-X)))}if(--o,n+=8*(p+x)/(f.duration/1e3),e++,10<e)break}}if(0<e)return n/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Mh=null,Oh=null;function Ic(e){return e.nodeType===9?e:e.ownerDocument}function vb(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function gb(e,n){if(e===0)switch(n){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&n==="foreignObject"?0:e}function Dh(e,n){return e==="textarea"||e==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.children=="bigint"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var Th=null;function Cj(){var e=window.event;return e&&e.type==="popstate"?e===Th?!1:(Th=e,!0):(Th=null,!1)}var yb=typeof setTimeout=="function"?setTimeout:void 0,Nj=typeof clearTimeout=="function"?clearTimeout:void 0,bb=typeof Promise=="function"?Promise:void 0,Ej=typeof queueMicrotask=="function"?queueMicrotask:typeof bb<"u"?function(e){return bb.resolve(null).then(e).catch(jj)}:yb;function jj(e){setTimeout(function(){throw e})}function Va(e){return e==="head"}function xb(e,n){var i=n,o=0;do{var f=i.nextSibling;if(e.removeChild(i),f&&f.nodeType===8)if(i=f.data,i==="/$"||i==="/&"){if(o===0){e.removeChild(f),Ll(n);return}o--}else if(i==="$"||i==="$?"||i==="$~"||i==="$!"||i==="&")o++;else if(i==="html")Qo(e.ownerDocument.documentElement);else if(i==="head"){i=e.ownerDocument.head,Qo(i);for(var p=i.firstChild;p;){var x=p.nextSibling,j=p.nodeName;p[Qe]||j==="SCRIPT"||j==="STYLE"||j==="LINK"&&p.rel.toLowerCase()==="stylesheet"||i.removeChild(p),p=x}}else i==="body"&&Qo(e.ownerDocument.body);i=f}while(i);Ll(n)}function Sb(e,n){var i=e;e=0;do{var o=i.nextSibling;if(i.nodeType===1?n?(i._stashedDisplay=i.style.display,i.style.display="none"):(i.style.display=i._stashedDisplay||"",i.getAttribute("style")===""&&i.removeAttribute("style")):i.nodeType===3&&(n?(i._stashedText=i.nodeValue,i.nodeValue=""):i.nodeValue=i._stashedText||""),o&&o.nodeType===8)if(i=o.data,i==="/$"){if(e===0)break;e--}else i!=="$"&&i!=="$?"&&i!=="$~"&&i!=="$!"||e++;i=o}while(i)}function _h(e){var n=e.firstChild;for(n&&n.nodeType===10&&(n=n.nextSibling);n;){var i=n;switch(n=n.nextSibling,i.nodeName){case"HTML":case"HEAD":case"BODY":_h(i),vt(i);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(i.rel.toLowerCase()==="stylesheet")continue}e.removeChild(i)}}function Rj(e,n,i,o){for(;e.nodeType===1;){var f=i;if(e.nodeName.toLowerCase()!==n.toLowerCase()){if(!o&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(o){if(!e[Qe])switch(n){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(p=e.getAttribute("rel"),p==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(p!==f.rel||e.getAttribute("href")!==(f.href==null||f.href===""?null:f.href)||e.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin)||e.getAttribute("title")!==(f.title==null?null:f.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(p=e.getAttribute("src"),(p!==(f.src==null?null:f.src)||e.getAttribute("type")!==(f.type==null?null:f.type)||e.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin))&&p&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(n==="input"&&e.type==="hidden"){var p=f.name==null?null:""+f.name;if(f.type==="hidden"&&e.getAttribute("name")===p)return e}else return e;if(e=ir(e.nextSibling),e===null)break}return null}function Mj(e,n,i){if(n==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!i||(e=ir(e.nextSibling),e===null))return null;return e}function wb(e,n){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=ir(e.nextSibling),e===null))return null;return e}function Ah(e){return e.data==="$?"||e.data==="$~"}function zh(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Oj(e,n){var i=e.ownerDocument;if(e.data==="$~")e._reactRetry=n;else if(e.data!=="$?"||i.readyState!=="loading")n();else{var o=function(){n(),i.removeEventListener("DOMContentLoaded",o)};i.addEventListener("DOMContentLoaded",o),e._reactRetry=o}}function ir(e){for(;e!=null;e=e.nextSibling){var n=e.nodeType;if(n===1||n===3)break;if(n===8){if(n=e.data,n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"||n==="F!"||n==="F")break;if(n==="/$"||n==="/&")return null}}return e}var Lh=null;function Cb(e){e=e.nextSibling;for(var n=0;e;){if(e.nodeType===8){var i=e.data;if(i==="/$"||i==="/&"){if(n===0)return ir(e.nextSibling);n--}else i!=="$"&&i!=="$!"&&i!=="$?"&&i!=="$~"&&i!=="&"||n++}e=e.nextSibling}return null}function Nb(e){e=e.previousSibling;for(var n=0;e;){if(e.nodeType===8){var i=e.data;if(i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"){if(n===0)return e;n--}else i!=="/$"&&i!=="/&"||n++}e=e.previousSibling}return null}function Eb(e,n,i){switch(n=Ic(i),e){case"html":if(e=n.documentElement,!e)throw Error(l(452));return e;case"head":if(e=n.head,!e)throw Error(l(453));return e;case"body":if(e=n.body,!e)throw Error(l(454));return e;default:throw Error(l(451))}}function Qo(e){for(var n=e.attributes;n.length;)e.removeAttributeNode(n[0]);vt(e)}var lr=new Map,jb=new Set;function Qc(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var ua=G.d;G.d={f:Dj,r:Tj,D:_j,C:Aj,L:zj,m:Lj,X:Pj,S:kj,M:Uj};function Dj(){var e=ua.f(),n=zc();return e||n}function Tj(e){var n=Xn(e);n!==null&&n.tag===5&&n.type==="form"?Qg(n):ua.r(e)}var _l=typeof document>"u"?null:document;function Rb(e,n,i){var o=_l;if(o&&typeof n=="string"&&n){var f=Jn(n);f='link[rel="'+e+'"][href="'+f+'"]',typeof i=="string"&&(f+='[crossorigin="'+i+'"]'),jb.has(f)||(jb.add(f),e={rel:e,crossOrigin:i,href:n},o.querySelector(f)===null&&(n=o.createElement("link"),sn(n,"link",e),Rt(n),o.head.appendChild(n)))}}function _j(e){ua.D(e),Rb("dns-prefetch",e,null)}function Aj(e,n){ua.C(e,n),Rb("preconnect",e,n)}function zj(e,n,i){ua.L(e,n,i);var o=_l;if(o&&e&&n){var f='link[rel="preload"][as="'+Jn(n)+'"]';n==="image"&&i&&i.imageSrcSet?(f+='[imagesrcset="'+Jn(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(f+='[imagesizes="'+Jn(i.imageSizes)+'"]')):f+='[href="'+Jn(e)+'"]';var p=f;switch(n){case"style":p=Al(e);break;case"script":p=zl(e)}lr.has(p)||(e=y({rel:"preload",href:n==="image"&&i&&i.imageSrcSet?void 0:e,as:n},i),lr.set(p,e),o.querySelector(f)!==null||n==="style"&&o.querySelector(Vo(p))||n==="script"&&o.querySelector(Fo(p))||(n=o.createElement("link"),sn(n,"link",e),Rt(n),o.head.appendChild(n)))}}function Lj(e,n){ua.m(e,n);var i=_l;if(i&&e){var o=n&&typeof n.as=="string"?n.as:"script",f='link[rel="modulepreload"][as="'+Jn(o)+'"][href="'+Jn(e)+'"]',p=f;switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":p=zl(e)}if(!lr.has(p)&&(e=y({rel:"modulepreload",href:e},n),lr.set(p,e),i.querySelector(f)===null)){switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector(Fo(p)))return}o=i.createElement("link"),sn(o,"link",e),Rt(o),i.head.appendChild(o)}}}function kj(e,n,i){ua.S(e,n,i);var o=_l;if(o&&e){var f=rn(o).hoistableStyles,p=Al(e);n=n||"default";var x=f.get(p);if(!x){var j={loading:0,preload:null};if(x=o.querySelector(Vo(p)))j.loading=5;else{e=y({rel:"stylesheet",href:e,"data-precedence":n},i),(i=lr.get(p))&&kh(e,i);var P=x=o.createElement("link");Rt(P),sn(P,"link",e),P._p=new Promise(function(X,ae){P.onload=X,P.onerror=ae}),P.addEventListener("load",function(){j.loading|=1}),P.addEventListener("error",function(){j.loading|=2}),j.loading|=4,Vc(x,n,o)}x={type:"stylesheet",instance:x,count:1,state:j},f.set(p,x)}}}function Pj(e,n){ua.X(e,n);var i=_l;if(i&&e){var o=rn(i).hoistableScripts,f=zl(e),p=o.get(f);p||(p=i.querySelector(Fo(f)),p||(e=y({src:e,async:!0},n),(n=lr.get(f))&&Ph(e,n),p=i.createElement("script"),Rt(p),sn(p,"link",e),i.head.appendChild(p)),p={type:"script",instance:p,count:1,state:null},o.set(f,p))}}function Uj(e,n){ua.M(e,n);var i=_l;if(i&&e){var o=rn(i).hoistableScripts,f=zl(e),p=o.get(f);p||(p=i.querySelector(Fo(f)),p||(e=y({src:e,async:!0,type:"module"},n),(n=lr.get(f))&&Ph(e,n),p=i.createElement("script"),Rt(p),sn(p,"link",e),i.head.appendChild(p)),p={type:"script",instance:p,count:1,state:null},o.set(f,p))}}function Mb(e,n,i,o){var f=(f=me.current)?Qc(f):null;if(!f)throw Error(l(446));switch(e){case"meta":case"title":return null;case"style":return typeof i.precedence=="string"&&typeof i.href=="string"?(n=Al(i.href),i=rn(f).hoistableStyles,o=i.get(n),o||(o={type:"style",instance:null,count:0,state:null},i.set(n,o)),o):{type:"void",instance:null,count:0,state:null};case"link":if(i.rel==="stylesheet"&&typeof i.href=="string"&&typeof i.precedence=="string"){e=Al(i.href);var p=rn(f).hoistableStyles,x=p.get(e);if(x||(f=f.ownerDocument||f,x={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},p.set(e,x),(p=f.querySelector(Vo(e)))&&!p._p&&(x.instance=p,x.state.loading=5),lr.has(e)||(i={rel:"preload",as:"style",href:i.href,crossOrigin:i.crossOrigin,integrity:i.integrity,media:i.media,hrefLang:i.hrefLang,referrerPolicy:i.referrerPolicy},lr.set(e,i),p||Bj(f,e,i,x.state))),n&&o===null)throw Error(l(528,""));return x}if(n&&o!==null)throw Error(l(529,""));return null;case"script":return n=i.async,i=i.src,typeof i=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(n=zl(i),i=rn(f).hoistableScripts,o=i.get(n),o||(o={type:"script",instance:null,count:0,state:null},i.set(n,o)),o):{type:"void",instance:null,count:0,state:null};default:throw Error(l(444,e))}}function Al(e){return'href="'+Jn(e)+'"'}function Vo(e){return'link[rel="stylesheet"]['+e+"]"}function Ob(e){return y({},e,{"data-precedence":e.precedence,precedence:null})}function Bj(e,n,i,o){e.querySelector('link[rel="preload"][as="style"]['+n+"]")?o.loading=1:(n=e.createElement("link"),o.preload=n,n.addEventListener("load",function(){return o.loading|=1}),n.addEventListener("error",function(){return o.loading|=2}),sn(n,"link",i),Rt(n),e.head.appendChild(n))}function zl(e){return'[src="'+Jn(e)+'"]'}function Fo(e){return"script[async]"+e}function Db(e,n,i){if(n.count++,n.instance===null)switch(n.type){case"style":var o=e.querySelector('style[data-href~="'+Jn(i.href)+'"]');if(o)return n.instance=o,Rt(o),o;var f=y({},i,{"data-href":i.href,"data-precedence":i.precedence,href:null,precedence:null});return o=(e.ownerDocument||e).createElement("style"),Rt(o),sn(o,"style",f),Vc(o,i.precedence,e),n.instance=o;case"stylesheet":f=Al(i.href);var p=e.querySelector(Vo(f));if(p)return n.state.loading|=4,n.instance=p,Rt(p),p;o=Ob(i),(f=lr.get(f))&&kh(o,f),p=(e.ownerDocument||e).createElement("link"),Rt(p);var x=p;return x._p=new Promise(function(j,P){x.onload=j,x.onerror=P}),sn(p,"link",o),n.state.loading|=4,Vc(p,i.precedence,e),n.instance=p;case"script":return p=zl(i.src),(f=e.querySelector(Fo(p)))?(n.instance=f,Rt(f),f):(o=i,(f=lr.get(p))&&(o=y({},i),Ph(o,f)),e=e.ownerDocument||e,f=e.createElement("script"),Rt(f),sn(f,"link",o),e.head.appendChild(f),n.instance=f);case"void":return null;default:throw Error(l(443,n.type))}else n.type==="stylesheet"&&(n.state.loading&4)===0&&(o=n.instance,n.state.loading|=4,Vc(o,i.precedence,e));return n.instance}function Vc(e,n,i){for(var o=i.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),f=o.length?o[o.length-1]:null,p=f,x=0;x<o.length;x++){var j=o[x];if(j.dataset.precedence===n)p=j;else if(p!==f)break}p?p.parentNode.insertBefore(e,p.nextSibling):(n=i.nodeType===9?i.head:i,n.insertBefore(e,n.firstChild))}function kh(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.title==null&&(e.title=n.title)}function Ph(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.integrity==null&&(e.integrity=n.integrity)}var Fc=null;function Tb(e,n,i){if(Fc===null){var o=new Map,f=Fc=new Map;f.set(i,o)}else f=Fc,o=f.get(i),o||(o=new Map,f.set(i,o));if(o.has(e))return o;for(o.set(e,null),i=i.getElementsByTagName(e),f=0;f<i.length;f++){var p=i[f];if(!(p[Qe]||p[ge]||e==="link"&&p.getAttribute("rel")==="stylesheet")&&p.namespaceURI!=="http://www.w3.org/2000/svg"){var x=p.getAttribute(n)||"";x=e+x;var j=o.get(x);j?j.push(p):o.set(x,[p])}}return o}function _b(e,n,i){e=e.ownerDocument||e,e.head.insertBefore(i,n==="title"?e.querySelector("head > title"):null)}function Hj(e,n,i){if(i===1||n.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof n.precedence!="string"||typeof n.href!="string"||n.href==="")break;return!0;case"link":if(typeof n.rel!="string"||typeof n.href!="string"||n.href===""||n.onLoad||n.onError)break;switch(n.rel){case"stylesheet":return e=n.disabled,typeof n.precedence=="string"&&e==null;default:return!0}case"script":if(n.async&&typeof n.async!="function"&&typeof n.async!="symbol"&&!n.onLoad&&!n.onError&&n.src&&typeof n.src=="string")return!0}return!1}function Ab(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function qj(e,n,i,o){if(i.type==="stylesheet"&&(typeof o.media!="string"||matchMedia(o.media).matches!==!1)&&(i.state.loading&4)===0){if(i.instance===null){var f=Al(o.href),p=n.querySelector(Vo(f));if(p){n=p._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(e.count++,e=Gc.bind(e),n.then(e,e)),i.state.loading|=4,i.instance=p,Rt(p);return}p=n.ownerDocument||n,o=Ob(o),(f=lr.get(f))&&kh(o,f),p=p.createElement("link"),Rt(p);var x=p;x._p=new Promise(function(j,P){x.onload=j,x.onerror=P}),sn(p,"link",o),i.instance=p}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(i,n),(n=i.state.preload)&&(i.state.loading&3)===0&&(e.count++,i=Gc.bind(e),n.addEventListener("load",i),n.addEventListener("error",i))}}var Uh=0;function Ij(e,n){return e.stylesheets&&e.count===0&&Kc(e,e.stylesheets),0<e.count||0<e.imgCount?function(i){var o=setTimeout(function(){if(e.stylesheets&&Kc(e,e.stylesheets),e.unsuspend){var p=e.unsuspend;e.unsuspend=null,p()}},6e4+n);0<e.imgBytes&&Uh===0&&(Uh=62500*wj());var f=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Kc(e,e.stylesheets),e.unsuspend)){var p=e.unsuspend;e.unsuspend=null,p()}},(e.imgBytes>Uh?50:800)+n);return e.unsuspend=i,function(){e.unsuspend=null,clearTimeout(o),clearTimeout(f)}}:null}function Gc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Kc(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Yc=null;function Kc(e,n){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Yc=new Map,n.forEach(Qj,e),Yc=null,Gc.call(e))}function Qj(e,n){if(!(n.state.loading&4)){var i=Yc.get(e);if(i)var o=i.get(null);else{i=new Map,Yc.set(e,i);for(var f=e.querySelectorAll("link[data-precedence],style[data-precedence]"),p=0;p<f.length;p++){var x=f[p];(x.nodeName==="LINK"||x.getAttribute("media")!=="not all")&&(i.set(x.dataset.precedence,x),o=x)}o&&i.set(null,o)}f=n.instance,x=f.getAttribute("data-precedence"),p=i.get(x)||o,p===o&&i.set(null,f),i.set(x,f),this.count++,o=Gc.bind(this),f.addEventListener("load",o),f.addEventListener("error",o),p?p.parentNode.insertBefore(f,p.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(f,e.firstChild)),n.state.loading|=4}}var Go={$$typeof:_,Provider:null,Consumer:null,_currentValue:B,_currentValue2:B,_threadCount:0};function Vj(e,n,i,o,f,p,x,j,P){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Ft(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ft(0),this.hiddenUpdates=Ft(null),this.identifierPrefix=o,this.onUncaughtError=f,this.onCaughtError=p,this.onRecoverableError=x,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=P,this.incompleteTransitions=new Map}function zb(e,n,i,o,f,p,x,j,P,X,ae,se){return e=new Vj(e,n,i,x,P,X,ae,se,j),n=1,p===!0&&(n|=24),p=Un(3,null,null,n),e.current=p,p.stateNode=e,n=gf(),n.refCount++,e.pooledCache=n,n.refCount++,p.memoizedState={element:o,isDehydrated:i,cache:n},Sf(p),e}function Lb(e){return e?(e=dl,e):dl}function kb(e,n,i,o,f,p){f=Lb(f),o.context===null?o.context=f:o.pendingContext=f,o=Aa(n),o.payload={element:i},p=p===void 0?null:p,p!==null&&(o.callback=p),i=za(e,o,n),i!==null&&(Dn(i,e,n),No(i,e,n))}function Pb(e,n){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var i=e.retryLane;e.retryLane=i!==0&&i<n?i:n}}function Bh(e,n){Pb(e,n),(e=e.alternate)&&Pb(e,n)}function Ub(e){if(e.tag===13||e.tag===31){var n=bi(e,67108864);n!==null&&Dn(n,e,67108864),Bh(e,67108864)}}function Bb(e){if(e.tag===13||e.tag===31){var n=Qn();n=ce(n);var i=bi(e,n);i!==null&&Dn(i,e,n),Bh(e,n)}}var Xc=!0;function Fj(e,n,i,o){var f=L.T;L.T=null;var p=G.p;try{G.p=2,Hh(e,n,i,o)}finally{G.p=p,L.T=f}}function Gj(e,n,i,o){var f=L.T;L.T=null;var p=G.p;try{G.p=8,Hh(e,n,i,o)}finally{G.p=p,L.T=f}}function Hh(e,n,i,o){if(Xc){var f=qh(o);if(f===null)jh(e,n,o,$c,i),qb(e,o);else if(Kj(f,e,n,i,o))o.stopPropagation();else if(qb(e,o),n&4&&-1<Yj.indexOf(e)){for(;f!==null;){var p=Xn(f);if(p!==null)switch(p.tag){case 3:if(p=p.stateNode,p.current.memoizedState.isDehydrated){var x=Et(p.pendingLanes);if(x!==0){var j=p;for(j.pendingLanes|=2,j.entangledLanes|=2;x;){var P=1<<31-Vt(x);j.entanglements[1]|=P,x&=~P}Lr(p),(nt&6)===0&&(_c=wt()+500,Ho(0))}}break;case 31:case 13:j=bi(p,2),j!==null&&Dn(j,p,2),zc(),Bh(p,2)}if(p=qh(o),p===null&&jh(e,n,o,$c,i),p===f)break;f=p}f!==null&&o.stopPropagation()}else jh(e,n,o,null,i)}}function qh(e){return e=Id(e),Ih(e)}var $c=null;function Ih(e){if($c=null,e=kn(e),e!==null){var n=c(e);if(n===null)e=null;else{var i=n.tag;if(i===13){if(e=u(n),e!==null)return e;e=null}else if(i===31){if(e=d(n),e!==null)return e;e=null}else if(i===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;e=null}else n!==e&&(e=null)}}return $c=e,null}function Hb(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Fr()){case hi:return 2;case Ln:return 8;case Ut:case tn:return 32;case Na:return 268435456;default:return 32}default:return 32}}var Qh=!1,Fa=null,Ga=null,Ya=null,Yo=new Map,Ko=new Map,Ka=[],Yj="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function qb(e,n){switch(e){case"focusin":case"focusout":Fa=null;break;case"dragenter":case"dragleave":Ga=null;break;case"mouseover":case"mouseout":Ya=null;break;case"pointerover":case"pointerout":Yo.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ko.delete(n.pointerId)}}function Xo(e,n,i,o,f,p){return e===null||e.nativeEvent!==p?(e={blockedOn:n,domEventName:i,eventSystemFlags:o,nativeEvent:p,targetContainers:[f]},n!==null&&(n=Xn(n),n!==null&&Ub(n)),e):(e.eventSystemFlags|=o,n=e.targetContainers,f!==null&&n.indexOf(f)===-1&&n.push(f),e)}function Kj(e,n,i,o,f){switch(n){case"focusin":return Fa=Xo(Fa,e,n,i,o,f),!0;case"dragenter":return Ga=Xo(Ga,e,n,i,o,f),!0;case"mouseover":return Ya=Xo(Ya,e,n,i,o,f),!0;case"pointerover":var p=f.pointerId;return Yo.set(p,Xo(Yo.get(p)||null,e,n,i,o,f)),!0;case"gotpointercapture":return p=f.pointerId,Ko.set(p,Xo(Ko.get(p)||null,e,n,i,o,f)),!0}return!1}function Ib(e){var n=kn(e.target);if(n!==null){var i=c(n);if(i!==null){if(n=i.tag,n===13){if(n=u(i),n!==null){e.blockedOn=n,Me(e.priority,function(){Bb(i)});return}}else if(n===31){if(n=d(i),n!==null){e.blockedOn=n,Me(e.priority,function(){Bb(i)});return}}else if(n===3&&i.stateNode.current.memoizedState.isDehydrated){e.blockedOn=i.tag===3?i.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Zc(e){if(e.blockedOn!==null)return!1;for(var n=e.targetContainers;0<n.length;){var i=qh(e.nativeEvent);if(i===null){i=e.nativeEvent;var o=new i.constructor(i.type,i);qd=o,i.target.dispatchEvent(o),qd=null}else return n=Xn(i),n!==null&&Ub(n),e.blockedOn=i,!1;n.shift()}return!0}function Qb(e,n,i){Zc(e)&&i.delete(n)}function Xj(){Qh=!1,Fa!==null&&Zc(Fa)&&(Fa=null),Ga!==null&&Zc(Ga)&&(Ga=null),Ya!==null&&Zc(Ya)&&(Ya=null),Yo.forEach(Qb),Ko.forEach(Qb)}function Jc(e,n){e.blockedOn===n&&(e.blockedOn=null,Qh||(Qh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Xj)))}var Wc=null;function Vb(e){Wc!==e&&(Wc=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Wc===e&&(Wc=null);for(var n=0;n<e.length;n+=3){var i=e[n],o=e[n+1],f=e[n+2];if(typeof o!="function"){if(Ih(o||i)===null)continue;break}var p=Xn(i);p!==null&&(e.splice(n,3),n-=3,qf(p,{pending:!0,data:f,method:i.method,action:o},o,f))}}))}function Ll(e){function n(P){return Jc(P,e)}Fa!==null&&Jc(Fa,e),Ga!==null&&Jc(Ga,e),Ya!==null&&Jc(Ya,e),Yo.forEach(n),Ko.forEach(n);for(var i=0;i<Ka.length;i++){var o=Ka[i];o.blockedOn===e&&(o.blockedOn=null)}for(;0<Ka.length&&(i=Ka[0],i.blockedOn===null);)Ib(i),i.blockedOn===null&&Ka.shift();if(i=(e.ownerDocument||e).$$reactFormReplay,i!=null)for(o=0;o<i.length;o+=3){var f=i[o],p=i[o+1],x=f[ve]||null;if(typeof p=="function")x||Vb(i);else if(x){var j=null;if(p&&p.hasAttribute("formAction")){if(f=p,x=p[ve]||null)j=x.formAction;else if(Ih(f)!==null)continue}else j=x.action;typeof j=="function"?i[o+1]=j:(i.splice(o,3),o-=3),Vb(i)}}}function Fb(){function e(p){p.canIntercept&&p.info==="react-transition"&&p.intercept({handler:function(){return new Promise(function(x){return f=x})},focusReset:"manual",scroll:"manual"})}function n(){f!==null&&(f(),f=null),o||setTimeout(i,20)}function i(){if(!o&&!navigation.transition){var p=navigation.currentEntry;p&&p.url!=null&&navigation.navigate(p.url,{state:p.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var o=!1,f=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",n),navigation.addEventListener("navigateerror",n),setTimeout(i,100),function(){o=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",n),navigation.removeEventListener("navigateerror",n),f!==null&&(f(),f=null)}}}function Vh(e){this._internalRoot=e}eu.prototype.render=Vh.prototype.render=function(e){var n=this._internalRoot;if(n===null)throw Error(l(409));var i=n.current,o=Qn();kb(i,o,e,n,null,null)},eu.prototype.unmount=Vh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var n=e.containerInfo;kb(e.current,2,null,e,null,null),zc(),n[Ce]=null}};function eu(e){this._internalRoot=e}eu.prototype.unstable_scheduleHydration=function(e){if(e){var n=Se();e={blockedOn:null,target:e,priority:n};for(var i=0;i<Ka.length&&n!==0&&n<Ka[i].priority;i++);Ka.splice(i,0,e),i===0&&Ib(e)}};var Gb=r.version;if(Gb!=="19.2.0")throw Error(l(527,Gb,"19.2.0"));G.findDOMNode=function(e){var n=e._reactInternals;if(n===void 0)throw typeof e.render=="function"?Error(l(188)):(e=Object.keys(e).join(","),Error(l(268,e)));return e=v(n),e=e!==null?b(e):null,e=e===null?null:e.stateNode,e};var $j={bundleType:0,version:"19.2.0",rendererPackageName:"react-dom",currentDispatcherRef:L,reconcilerVersion:"19.2.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var tu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!tu.isDisabled&&tu.supportsFiber)try{cn=tu.inject($j),Jt=tu}catch{}}return Zo.createRoot=function(e,n){if(!s(e))throw Error(l(299));var i=!1,o="",f=Wg,p=ey,x=ty;return n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onUncaughtError!==void 0&&(f=n.onUncaughtError),n.onCaughtError!==void 0&&(p=n.onCaughtError),n.onRecoverableError!==void 0&&(x=n.onRecoverableError)),n=zb(e,1,!1,null,null,i,o,null,f,p,x,Fb),e[Ce]=n.current,Eh(e),new Vh(n)},Zo.hydrateRoot=function(e,n,i){if(!s(e))throw Error(l(299));var o=!1,f="",p=Wg,x=ey,j=ty,P=null;return i!=null&&(i.unstable_strictMode===!0&&(o=!0),i.identifierPrefix!==void 0&&(f=i.identifierPrefix),i.onUncaughtError!==void 0&&(p=i.onUncaughtError),i.onCaughtError!==void 0&&(x=i.onCaughtError),i.onRecoverableError!==void 0&&(j=i.onRecoverableError),i.formState!==void 0&&(P=i.formState)),n=zb(e,1,!0,n,i??null,o,f,P,p,x,j,Fb),n.context=Lb(null),i=n.current,o=Qn(),o=ce(o),f=Aa(o),f.callback=null,za(i,f,o),i=o,n.current.lanes=i,Cn(n,i),Lr(n),e[Ce]=n.current,Eh(e),new eu(n)},Zo.version="19.2.0",Zo}var n0;function i2(){if(n0)return Yh.exports;n0=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(r){console.error(r)}}return t(),Yh.exports=a2(),Yh.exports}var l2=i2(),Sr=Fx();const Gx=Vx(Sr),o2=Qx({__proto__:null,default:Gx},[Sr]);function Nt(){return Nt=Object.assign?Object.assign.bind():function(t){for(var r=1;r<arguments.length;r++){var a=arguments[r];for(var l in a)Object.prototype.hasOwnProperty.call(a,l)&&(t[l]=a[l])}return t},Nt.apply(this,arguments)}var Qt;(function(t){t.Pop="POP",t.Push="PUSH",t.Replace="REPLACE"})(Qt||(Qt={}));const r0="popstate";function s2(t){t===void 0&&(t={});function r(l,s){let{pathname:c,search:u,hash:d}=l.location;return us("",{pathname:c,search:u,hash:d},s.state&&s.state.usr||null,s.state&&s.state.key||"default")}function a(l,s){return typeof s=="string"?s:Hi(s)}return u2(r,a,null,t)}function qe(t,r){if(t===!1||t===null||typeof t>"u")throw new Error(r)}function Bi(t,r){if(!t){typeof console<"u"&&console.warn(r);try{throw new Error(r)}catch{}}}function c2(){return Math.random().toString(36).substr(2,8)}function a0(t,r){return{usr:t.state,key:t.key,idx:r}}function us(t,r,a,l){return a===void 0&&(a=null),Nt({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof r=="string"?li(r):r,{state:a,key:r&&r.key||l||c2()})}function Hi(t){let{pathname:r="/",search:a="",hash:l=""}=t;return a&&a!=="?"&&(r+=a.charAt(0)==="?"?a:"?"+a),l&&l!=="#"&&(r+=l.charAt(0)==="#"?l:"#"+l),r}function li(t){let r={};if(t){let a=t.indexOf("#");a>=0&&(r.hash=t.substr(a),t=t.substr(0,a));let l=t.indexOf("?");l>=0&&(r.search=t.substr(l),t=t.substr(0,l)),t&&(r.pathname=t)}return r}function u2(t,r,a,l){l===void 0&&(l={});let{window:s=document.defaultView,v5Compat:c=!1}=l,u=s.history,d=Qt.Pop,m=null,v=b();v==null&&(v=0,u.replaceState(Nt({},u.state,{idx:v}),""));function b(){return(u.state||{idx:null}).idx}function y(){d=Qt.Pop;let R=b(),M=R==null?null:R-v;v=R,m&&m({action:d,location:S.location,delta:M})}function w(R,M){d=Qt.Push;let O=us(S.location,R,M);v=b()+1;let _=a0(O,v),z=S.createHref(O);try{u.pushState(_,"",z)}catch(k){if(k instanceof DOMException&&k.name==="DataCloneError")throw k;s.location.assign(z)}c&&m&&m({action:d,location:S.location,delta:1})}function C(R,M){d=Qt.Replace;let O=us(S.location,R,M);v=b();let _=a0(O,v),z=S.createHref(O);u.replaceState(_,"",z),c&&m&&m({action:d,location:S.location,delta:0})}function E(R){let M=s.location.origin!=="null"?s.location.origin:s.location.href,O=typeof R=="string"?R:Hi(R);return O=O.replace(/ $/,"%20"),qe(M,"No window.location.(origin|href) available to create URL for href: "+O),new URL(O,M)}let S={get action(){return d},get location(){return t(s,u)},listen(R){if(m)throw new Error("A history only accepts one active listener");return s.addEventListener(r0,y),m=R,()=>{s.removeEventListener(r0,y),m=null}},createHref(R){return r(s,R)},createURL:E,encodeLocation(R){let M=E(R);return{pathname:M.pathname,search:M.search,hash:M.hash}},push:w,replace:C,go(R){return u.go(R)}};return S}var lt;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(lt||(lt={}));const d2=new Set(["lazy","caseSensitive","path","id","index","children"]);function f2(t){return t.index===!0}function Cu(t,r,a,l){return a===void 0&&(a=[]),l===void 0&&(l={}),t.map((s,c)=>{let u=[...a,String(c)],d=typeof s.id=="string"?s.id:u.join("-");if(qe(s.index!==!0||!s.children,"Cannot specify children on an index route"),qe(!l[d],'Found a route id collision on id "'+d+`". Route id's must be globally unique within Data Router usages`),f2(s)){let m=Nt({},s,r(s),{id:d});return l[d]=m,m}else{let m=Nt({},s,r(s),{id:d,children:void 0});return l[d]=m,s.children&&(m.children=Cu(s.children,r,u,l)),m}})}function zi(t,r,a){return a===void 0&&(a="/"),pu(t,r,a,!1)}function pu(t,r,a,l){let s=typeof r=="string"?li(r):r,c=ha(s.pathname||"/",a);if(c==null)return null;let u=Yx(t);m2(u);let d=null;for(let m=0;d==null&&m<u.length;++m){let v=E2(c);d=C2(u[m],v,l)}return d}function h2(t,r){let{route:a,pathname:l,params:s}=t;return{id:a.id,pathname:l,params:s,data:r[a.id],handle:a.handle}}function Yx(t,r,a,l){r===void 0&&(r=[]),a===void 0&&(a=[]),l===void 0&&(l="");let s=(c,u,d)=>{let m={relativePath:d===void 0?c.path||"":d,caseSensitive:c.caseSensitive===!0,childrenIndex:u,route:c};m.relativePath.startsWith("/")&&(qe(m.relativePath.startsWith(l),'Absolute route path "'+m.relativePath+'" nested under path '+('"'+l+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),m.relativePath=m.relativePath.slice(l.length));let v=fa([l,m.relativePath]),b=a.concat(m);c.children&&c.children.length>0&&(qe(c.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+v+'".')),Yx(c.children,r,b,v)),!(c.path==null&&!c.index)&&r.push({path:v,score:S2(v,c.index),routesMeta:b})};return t.forEach((c,u)=>{var d;if(c.path===""||!((d=c.path)!=null&&d.includes("?")))s(c,u);else for(let m of Kx(c.path))s(c,u,m)}),r}function Kx(t){let r=t.split("/");if(r.length===0)return[];let[a,...l]=r,s=a.endsWith("?"),c=a.replace(/\?$/,"");if(l.length===0)return s?[c,""]:[c];let u=Kx(l.join("/")),d=[];return d.push(...u.map(m=>m===""?c:[c,m].join("/"))),s&&d.push(...u),d.map(m=>t.startsWith("/")&&m===""?"/":m)}function m2(t){t.sort((r,a)=>r.score!==a.score?a.score-r.score:w2(r.routesMeta.map(l=>l.childrenIndex),a.routesMeta.map(l=>l.childrenIndex)))}const p2=/^:[\w-]+$/,v2=3,g2=2,y2=1,b2=10,x2=-2,i0=t=>t==="*";function S2(t,r){let a=t.split("/"),l=a.length;return a.some(i0)&&(l+=x2),r&&(l+=g2),a.filter(s=>!i0(s)).reduce((s,c)=>s+(p2.test(c)?v2:c===""?y2:b2),l)}function w2(t,r){return t.length===r.length&&t.slice(0,-1).every((l,s)=>l===r[s])?t[t.length-1]-r[r.length-1]:0}function C2(t,r,a){a===void 0&&(a=!1);let{routesMeta:l}=t,s={},c="/",u=[];for(let d=0;d<l.length;++d){let m=l[d],v=d===l.length-1,b=c==="/"?r:r.slice(c.length)||"/",y=Nu({path:m.relativePath,caseSensitive:m.caseSensitive,end:v},b),w=m.route;if(!y&&v&&a&&!l[l.length-1].route.index&&(y=Nu({path:m.relativePath,caseSensitive:m.caseSensitive,end:!1},b)),!y)return null;Object.assign(s,y.params),u.push({params:s,pathname:fa([c,y.pathname]),pathnameBase:O2(fa([c,y.pathnameBase])),route:w}),y.pathnameBase!=="/"&&(c=fa([c,y.pathnameBase]))}return u}function Nu(t,r){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[a,l]=N2(t.path,t.caseSensitive,t.end),s=r.match(a);if(!s)return null;let c=s[0],u=c.replace(/(.)\/+$/,"$1"),d=s.slice(1);return{params:l.reduce((v,b,y)=>{let{paramName:w,isOptional:C}=b;if(w==="*"){let S=d[y]||"";u=c.slice(0,c.length-S.length).replace(/(.)\/+$/,"$1")}const E=d[y];return C&&!E?v[w]=void 0:v[w]=(E||"").replace(/%2F/g,"/"),v},{}),pathname:c,pathnameBase:u,pattern:t}}function N2(t,r,a){r===void 0&&(r=!1),a===void 0&&(a=!0),Bi(t==="*"||!t.endsWith("*")||t.endsWith("/*"),'Route path "'+t+'" will be treated as if it were '+('"'+t.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+t.replace(/\*$/,"/*")+'".'));let l=[],s="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(u,d,m)=>(l.push({paramName:d,isOptional:m!=null}),m?"/?([^\\/]+)?":"/([^\\/]+)"));return t.endsWith("*")?(l.push({paramName:"*"}),s+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):a?s+="\\/*$":t!==""&&t!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,r?void 0:"i"),l]}function E2(t){try{return t.split("/").map(r=>decodeURIComponent(r).replace(/\//g,"%2F")).join("/")}catch(r){return Bi(!1,'The URL path "'+t+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+r+").")),t}}function ha(t,r){if(r==="/")return t;if(!t.toLowerCase().startsWith(r.toLowerCase()))return null;let a=r.endsWith("/")?r.length-1:r.length,l=t.charAt(a);return l&&l!=="/"?null:t.slice(a)||"/"}const j2=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,R2=t=>j2.test(t);function M2(t,r){r===void 0&&(r="/");let{pathname:a,search:l="",hash:s=""}=typeof t=="string"?li(t):t,c;if(a)if(R2(a))c=a;else{if(a.includes("//")){let u=a;a=a.replace(/\/\/+/g,"/"),Bi(!1,"Pathnames cannot have embedded double slashes - normalizing "+(u+" -> "+a))}a.startsWith("/")?c=l0(a.substring(1),"/"):c=l0(a,r)}else c=r;return{pathname:c,search:D2(l),hash:T2(s)}}function l0(t,r){let a=r.replace(/\/+$/,"").split("/");return t.split("/").forEach(s=>{s===".."?a.length>1&&a.pop():s!=="."&&a.push(s)}),a.length>1?a.join("/"):"/"}function Zh(t,r,a,l){return"Cannot include a '"+t+"' character in a manually specified "+("`to."+r+"` field ["+JSON.stringify(l)+"]. Please separate it out to the ")+("`to."+a+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function Xx(t){return t.filter((r,a)=>a===0||r.route.path&&r.route.path.length>0)}function ap(t,r){let a=Xx(t);return r?a.map((l,s)=>s===a.length-1?l.pathname:l.pathnameBase):a.map(l=>l.pathnameBase)}function ip(t,r,a,l){l===void 0&&(l=!1);let s;typeof t=="string"?s=li(t):(s=Nt({},t),qe(!s.pathname||!s.pathname.includes("?"),Zh("?","pathname","search",s)),qe(!s.pathname||!s.pathname.includes("#"),Zh("#","pathname","hash",s)),qe(!s.search||!s.search.includes("#"),Zh("#","search","hash",s)));let c=t===""||s.pathname==="",u=c?"/":s.pathname,d;if(u==null)d=a;else{let y=r.length-1;if(!l&&u.startsWith("..")){let w=u.split("/");for(;w[0]==="..";)w.shift(),y-=1;s.pathname=w.join("/")}d=y>=0?r[y]:"/"}let m=M2(s,d),v=u&&u!=="/"&&u.endsWith("/"),b=(c||u===".")&&a.endsWith("/");return!m.pathname.endsWith("/")&&(v||b)&&(m.pathname+="/"),m}const fa=t=>t.join("/").replace(/\/\/+/g,"/"),O2=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),D2=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,T2=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;class Eu{constructor(r,a,l,s){s===void 0&&(s=!1),this.status=r,this.statusText=a||"",this.internal=s,l instanceof Error?(this.data=l.toString(),this.error=l):this.data=l}}function ds(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}const $x=["post","put","patch","delete"],_2=new Set($x),A2=["get",...$x],z2=new Set(A2),L2=new Set([301,302,303,307,308]),k2=new Set([307,308]),Jh={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},P2={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Jo={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},lp=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,U2=t=>({hasErrorBoundary:!!t.hasErrorBoundary}),Zx="remix-router-transitions";function B2(t){const r=t.window?t.window:typeof window<"u"?window:void 0,a=typeof r<"u"&&typeof r.document<"u"&&typeof r.document.createElement<"u",l=!a;qe(t.routes.length>0,"You must provide a non-empty routes array to createRouter");let s;if(t.mapRouteProperties)s=t.mapRouteProperties;else if(t.detectErrorBoundary){let U=t.detectErrorBoundary;s=V=>({hasErrorBoundary:U(V)})}else s=U2;let c={},u=Cu(t.routes,s,void 0,c),d,m=t.basename||"/",v=t.dataStrategy||Q2,b=t.patchRoutesOnNavigation,y=Nt({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,v7_skipActionErrorRevalidation:!1},t.future),w=null,C=new Set,E=null,S=null,R=null,M=t.hydrationData!=null,O=zi(u,t.history.location,m),_=!1,z=null;if(O==null&&!b){let U=Tn(404,{pathname:t.history.location.pathname}),{matches:V,route:$}=g0(u);O=V,z={[$.id]:U}}O&&!t.hydrationData&&_t(O,u,t.history.location.pathname).active&&(O=null);let k;if(O)if(O.some(U=>U.route.lazy))k=!1;else if(!O.some(U=>U.route.loader))k=!0;else if(y.v7_partialHydration){let U=t.hydrationData?t.hydrationData.loaderData:null,V=t.hydrationData?t.hydrationData.errors:null;if(V){let $=O.findIndex(ce=>V[ce.route.id]!==void 0);k=O.slice(0,$+1).every(ce=>!Sm(ce.route,U,V))}else k=O.every($=>!Sm($.route,U,V))}else k=t.hydrationData!=null;else if(k=!1,O=[],y.v7_partialHydration){let U=_t(null,u,t.history.location.pathname);U.active&&U.matches&&(_=!0,O=U.matches)}let I,N={historyAction:t.history.action,location:t.history.location,matches:O,initialized:k,navigation:Jh,restoreScrollPosition:t.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:t.hydrationData&&t.hydrationData.loaderData||{},actionData:t.hydrationData&&t.hydrationData.actionData||null,errors:t.hydrationData&&t.hydrationData.errors||z,fetchers:new Map,blockers:new Map},T=Qt.Pop,A=!1,q,K=!1,W=new Map,ue=null,le=!1,de=!1,L=[],G=new Set,B=new Map,ee=0,ie=-1,D=new Map,Q=new Set,J=new Map,ne=new Map,fe=new Set,me=new Map,re=new Map,De;function Ae(){if(w=t.history.listen(U=>{let{action:V,location:$,delta:ce}=U;if(De){De(),De=void 0;return}Bi(re.size===0||ce!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let pe=Gr({currentLocation:N.location,nextLocation:$,historyAction:V});if(pe&&ce!=null){let Se=new Promise(Me=>{De=Me});t.history.go(ce*-1),Ea(pe,{state:"blocked",location:$,proceed(){Ea(pe,{state:"proceeding",proceed:void 0,reset:void 0,location:$}),Se.then(()=>t.history.go(ce))},reset(){let Me=new Map(N.blockers);Me.set(pe,Jo),he({blockers:Me})}});return}return jt(V,$)}),a){rR(r,W);let U=()=>aR(r,W);r.addEventListener("pagehide",U),ue=()=>r.removeEventListener("pagehide",U)}return N.initialized||jt(Qt.Pop,N.location,{initialHydration:!0}),I}function Te(){w&&w(),ue&&ue(),C.clear(),q&&q.abort(),N.fetchers.forEach((U,V)=>mn(V)),N.blockers.forEach((U,V)=>mi(V))}function Ue(U){return C.add(U),()=>C.delete(U)}function he(U,V){V===void 0&&(V={}),N=Nt({},N,U);let $=[],ce=[];y.v7_fetcherPersist&&N.fetchers.forEach((pe,Se)=>{pe.state==="idle"&&(fe.has(Se)?ce.push(Se):$.push(Se))}),fe.forEach(pe=>{!N.fetchers.has(pe)&&!B.has(pe)&&ce.push(pe)}),[...C].forEach(pe=>pe(N,{deletedFetchers:ce,viewTransitionOpts:V.viewTransitionOpts,flushSync:V.flushSync===!0})),y.v7_fetcherPersist?($.forEach(pe=>N.fetchers.delete(pe)),ce.forEach(pe=>mn(pe))):ce.forEach(pe=>fe.delete(pe))}function dt(U,V,$){var ce,pe;let{flushSync:Se}=$===void 0?{}:$,Me=N.actionData!=null&&N.navigation.formMethod!=null&&xr(N.navigation.formMethod)&&N.navigation.state==="loading"&&((ce=U.state)==null?void 0:ce._isRedirect)!==!0,be;V.actionData?Object.keys(V.actionData).length>0?be=V.actionData:be=null:Me?be=N.actionData:be=null;let ge=V.loaderData?p0(N.loaderData,V.loaderData,V.matches||[],V.errors):N.loaderData,ve=N.blockers;ve.size>0&&(ve=new Map(ve),ve.forEach((Ye,Gt)=>ve.set(Gt,Jo)));let Ce=A===!0||N.navigation.formMethod!=null&&xr(N.navigation.formMethod)&&((pe=U.state)==null?void 0:pe._isRedirect)!==!0;d&&(u=d,d=void 0),le||T===Qt.Pop||(T===Qt.Push?t.history.push(U,U.state):T===Qt.Replace&&t.history.replace(U,U.state));let ze;if(T===Qt.Pop){let Ye=W.get(N.location.pathname);Ye&&Ye.has(U.pathname)?ze={currentLocation:N.location,nextLocation:U}:W.has(U.pathname)&&(ze={currentLocation:U,nextLocation:N.location})}else if(K){let Ye=W.get(N.location.pathname);Ye?Ye.add(U.pathname):(Ye=new Set([U.pathname]),W.set(N.location.pathname,Ye)),ze={currentLocation:N.location,nextLocation:U}}he(Nt({},V,{actionData:be,loaderData:ge,historyAction:T,location:U,initialized:!0,navigation:Jh,revalidation:"idle",restoreScrollPosition:nn(U,V.matches||N.matches),preventScrollReset:Ce,blockers:ve}),{viewTransitionOpts:ze,flushSync:Se===!0}),T=Qt.Pop,A=!1,K=!1,le=!1,de=!1,L=[]}async function pt(U,V){if(typeof U=="number"){t.history.go(U);return}let $=xm(N.location,N.matches,m,y.v7_prependBasename,U,y.v7_relativeSplatPath,V?.fromRouteId,V?.relative),{path:ce,submission:pe,error:Se}=o0(y.v7_normalizeFormMethod,!1,$,V),Me=N.location,be=us(N.location,ce,V&&V.state);be=Nt({},be,t.history.encodeLocation(be));let ge=V&&V.replace!=null?V.replace:void 0,ve=Qt.Push;ge===!0?ve=Qt.Replace:ge===!1||pe!=null&&xr(pe.formMethod)&&pe.formAction===N.location.pathname+N.location.search&&(ve=Qt.Replace);let Ce=V&&"preventScrollReset"in V?V.preventScrollReset===!0:void 0,ze=(V&&V.flushSync)===!0,Ye=Gr({currentLocation:Me,nextLocation:be,historyAction:ve});if(Ye){Ea(Ye,{state:"blocked",location:be,proceed(){Ea(Ye,{state:"proceeding",proceed:void 0,reset:void 0,location:be}),pt(U,V)},reset(){let Gt=new Map(N.blockers);Gt.set(Ye,Jo),he({blockers:Gt})}});return}return await jt(ve,be,{submission:pe,pendingError:Se,preventScrollReset:Ce,replace:V&&V.replace,enableViewTransition:V&&V.viewTransition,flushSync:ze})}function Sn(){if(Ln(),he({revalidation:"loading"}),N.navigation.state!=="submitting"){if(N.navigation.state==="idle"){jt(N.historyAction,N.location,{startUninterruptedRevalidation:!0});return}jt(T||N.historyAction,N.navigation.location,{overrideNavigation:N.navigation,enableViewTransition:K===!0})}}async function jt(U,V,$){q&&q.abort(),q=null,T=U,le=($&&$.startUninterruptedRevalidation)===!0,un(N.location,N.matches),A=($&&$.preventScrollReset)===!0,K=($&&$.enableViewTransition)===!0;let ce=d||u,pe=$&&$.overrideNavigation,Se=$!=null&&$.initialHydration&&N.matches&&N.matches.length>0&&!_?N.matches:zi(ce,V,m),Me=($&&$.flushSync)===!0;if(Se&&N.initialized&&!de&&X2(N.location,V)&&!($&&$.submission&&xr($.submission.formMethod))){dt(V,{matches:Se},{flushSync:Me});return}let be=_t(Se,ce,V.pathname);if(be.active&&be.matches&&(Se=be.matches),!Se){let{error:rt,notFoundMatches:Qe,route:vt}=Dr(V.pathname);dt(V,{matches:Qe,loaderData:{},errors:{[vt.id]:rt}},{flushSync:Me});return}q=new AbortController;let ge=kl(t.history,V,q.signal,$&&$.submission),ve;if($&&$.pendingError)ve=[Li(Se).route.id,{type:lt.error,error:$.pendingError}];else if($&&$.submission&&xr($.submission.formMethod)){let rt=await Rr(ge,V,$.submission,Se,be.active,{replace:$.replace,flushSync:Me});if(rt.shortCircuited)return;if(rt.pendingActionResult){let[Qe,vt]=rt.pendingActionResult;if(Vn(vt)&&ds(vt.error)&&vt.error.status===404){q=null,dt(V,{matches:rt.matches,loaderData:{},errors:{[Qe]:vt.error}});return}}Se=rt.matches||Se,ve=rt.pendingActionResult,pe=Wh(V,$.submission),Me=!1,be.active=!1,ge=kl(t.history,ge.url,ge.signal)}let{shortCircuited:Ce,matches:ze,loaderData:Ye,errors:Gt}=await fi(ge,V,Se,be.active,pe,$&&$.submission,$&&$.fetcherSubmission,$&&$.replace,$&&$.initialHydration===!0,Me,ve);Ce||(q=null,dt(V,Nt({matches:ze||Se},v0(ve),{loaderData:Ye,errors:Gt})))}async function Rr(U,V,$,ce,pe,Se){Se===void 0&&(Se={}),Ln();let Me=tR(V,$);if(he({navigation:Me},{flushSync:Se.flushSync===!0}),pe){let ve=await Ft(ce,V.pathname,U.signal);if(ve.type==="aborted")return{shortCircuited:!0};if(ve.type==="error"){let Ce=Li(ve.partialMatches).route.id;return{matches:ve.partialMatches,pendingActionResult:[Ce,{type:lt.error,error:ve.error}]}}else if(ve.matches)ce=ve.matches;else{let{notFoundMatches:Ce,error:ze,route:Ye}=Dr(V.pathname);return{matches:Ce,pendingActionResult:[Ye.id,{type:lt.error,error:ze}]}}}let be,ge=rs(ce,V);if(!ge.route.action&&!ge.route.lazy)be={type:lt.error,error:Tn(405,{method:U.method,pathname:V.pathname,routeId:ge.route.id})};else if(be=(await Fr("action",N,U,[ge],ce,null))[ge.route.id],U.signal.aborted)return{shortCircuited:!0};if(ki(be)){let ve;return Se&&Se.replace!=null?ve=Se.replace:ve=f0(be.response.headers.get("Location"),new URL(U.url),m)===N.location.pathname+N.location.search,await wt(U,be,!0,{submission:$,replace:ve}),{shortCircuited:!0}}if(ei(be))throw Tn(400,{type:"defer-action"});if(Vn(be)){let ve=Li(ce,ge.route.id);return(Se&&Se.replace)!==!0&&(T=Qt.Push),{matches:ce,pendingActionResult:[ve.route.id,be]}}return{matches:ce,pendingActionResult:[ge.route.id,be]}}async function fi(U,V,$,ce,pe,Se,Me,be,ge,ve,Ce){let ze=pe||Wh(V,Se),Ye=Se||Me||b0(ze),Gt=!le&&(!y.v7_partialHydration||!ge);if(ce){if(Gt){let yt=Mr(Ce);he(Nt({navigation:ze},yt!==void 0?{actionData:yt}:{}),{flushSync:ve})}let Je=await Ft($,V.pathname,U.signal);if(Je.type==="aborted")return{shortCircuited:!0};if(Je.type==="error"){let yt=Li(Je.partialMatches).route.id;return{matches:Je.partialMatches,loaderData:{},errors:{[yt]:Je.error}}}else if(Je.matches)$=Je.matches;else{let{error:yt,notFoundMatches:Yr,route:pi}=Dr(V.pathname);return{matches:Yr,loaderData:{},errors:{[pi.id]:yt}}}}let rt=d||u,[Qe,vt]=c0(t.history,N,$,Ye,V,y.v7_partialHydration&&ge===!0,y.v7_skipActionErrorRevalidation,de,L,G,fe,J,Q,rt,m,Ce);if(gt(Je=>!($&&$.some(yt=>yt.route.id===Je))||Qe&&Qe.some(yt=>yt.route.id===Je)),ie=++ee,Qe.length===0&&vt.length===0){let Je=pn();return dt(V,Nt({matches:$,loaderData:{},errors:Ce&&Vn(Ce[1])?{[Ce[0]]:Ce[1].error}:null},v0(Ce),Je?{fetchers:new Map(N.fetchers)}:{}),{flushSync:ve}),{shortCircuited:!0}}if(Gt){let Je={};if(!ce){Je.navigation=ze;let yt=Mr(Ce);yt!==void 0&&(Je.actionData=yt)}vt.length>0&&(Je.fetchers=wn(vt)),he(Je,{flushSync:ve})}vt.forEach(Je=>{cn(Je.key),Je.controller&&B.set(Je.key,Je.controller)});let kn=()=>vt.forEach(Je=>cn(Je.key));q&&q.signal.addEventListener("abort",kn);let{loaderResults:Xn,fetcherResults:vn}=await hi(N,$,Qe,vt,U);if(U.signal.aborted)return{shortCircuited:!0};q&&q.signal.removeEventListener("abort",kn),vt.forEach(Je=>B.delete(Je.key));let rn=nu(Xn);if(rn)return await wt(U,rn.result,!0,{replace:be}),{shortCircuited:!0};if(rn=nu(vn),rn)return Q.add(rn.key),await wt(U,rn.result,!0,{replace:be}),{shortCircuited:!0};let{loaderData:Rt,errors:ja}=m0(N,$,Xn,Ce,vt,vn,me);me.forEach((Je,yt)=>{Je.subscribe(Yr=>{(Yr||Je.done)&&me.delete(yt)})}),y.v7_partialHydration&&ge&&N.errors&&(ja=Nt({},N.errors,ja));let Tr=pn(),$n=Vt(ie),mr=Tr||$n||vt.length>0;return Nt({matches:$,loaderData:Rt,errors:ja},mr?{fetchers:new Map(N.fetchers)}:{})}function Mr(U){if(U&&!Vn(U[1]))return{[U[0]]:U[1].data};if(N.actionData)return Object.keys(N.actionData).length===0?null:N.actionData}function wn(U){return U.forEach(V=>{let $=N.fetchers.get(V.key),ce=Wo(void 0,$?$.data:void 0);N.fetchers.set(V.key,ce)}),new Map(N.fetchers)}function Or(U,V,$,ce){if(l)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");cn(U);let pe=(ce&&ce.flushSync)===!0,Se=d||u,Me=xm(N.location,N.matches,m,y.v7_prependBasename,$,y.v7_relativeSplatPath,V,ce?.relative),be=zi(Se,Me,m),ge=_t(be,Se,Me);if(ge.active&&ge.matches&&(be=ge.matches),!be){tn(U,V,Tn(404,{pathname:Me}),{flushSync:pe});return}let{path:ve,submission:Ce,error:ze}=o0(y.v7_normalizeFormMethod,!0,Me,ce);if(ze){tn(U,V,ze,{flushSync:pe});return}let Ye=rs(be,ve),Gt=(ce&&ce.preventScrollReset)===!0;if(Ce&&xr(Ce.formMethod)){Ca(U,V,ve,Ye,be,ge.active,pe,Gt,Ce);return}J.set(U,{routeId:V,path:ve}),tl(U,V,ve,Ye,be,ge.active,pe,Gt,Ce)}async function Ca(U,V,$,ce,pe,Se,Me,be,ge){Ln(),J.delete(U);function ve(bt){if(!bt.route.action&&!bt.route.lazy){let pr=Tn(405,{method:ge.formMethod,pathname:$,routeId:V});return tn(U,V,pr,{flushSync:Me}),!0}return!1}if(!Se&&ve(ce))return;let Ce=N.fetchers.get(U);Ut(U,nR(ge,Ce),{flushSync:Me});let ze=new AbortController,Ye=kl(t.history,$,ze.signal,ge);if(Se){let bt=await Ft(pe,new URL(Ye.url).pathname,Ye.signal,U);if(bt.type==="aborted")return;if(bt.type==="error"){tn(U,V,bt.error,{flushSync:Me});return}else if(bt.matches){if(pe=bt.matches,ce=rs(pe,$),ve(ce))return}else{tn(U,V,Tn(404,{pathname:$}),{flushSync:Me});return}}B.set(U,ze);let Gt=ee,Qe=(await Fr("action",N,Ye,[ce],pe,U))[ce.route.id];if(Ye.signal.aborted){B.get(U)===ze&&B.delete(U);return}if(y.v7_fetcherPersist&&fe.has(U)){if(ki(Qe)||Vn(Qe)){Ut(U,Za(void 0));return}}else{if(ki(Qe))if(B.delete(U),ie>Gt){Ut(U,Za(void 0));return}else return Q.add(U),Ut(U,Wo(ge)),wt(Ye,Qe,!1,{fetcherSubmission:ge,preventScrollReset:be});if(Vn(Qe)){tn(U,V,Qe.error);return}}if(ei(Qe))throw Tn(400,{type:"defer-action"});let vt=N.navigation.location||N.location,kn=kl(t.history,vt,ze.signal),Xn=d||u,vn=N.navigation.state!=="idle"?zi(Xn,N.navigation.location,m):N.matches;qe(vn,"Didn't find any matches after fetcher action");let rn=++ee;D.set(U,rn);let Rt=Wo(ge,Qe.data);N.fetchers.set(U,Rt);let[ja,Tr]=c0(t.history,N,vn,ge,vt,!1,y.v7_skipActionErrorRevalidation,de,L,G,fe,J,Q,Xn,m,[ce.route.id,Qe]);Tr.filter(bt=>bt.key!==U).forEach(bt=>{let pr=bt.key,Zn=N.fetchers.get(pr),Nn=Wo(void 0,Zn?Zn.data:void 0);N.fetchers.set(pr,Nn),cn(pr),bt.controller&&B.set(pr,bt.controller)}),he({fetchers:new Map(N.fetchers)});let $n=()=>Tr.forEach(bt=>cn(bt.key));ze.signal.addEventListener("abort",$n);let{loaderResults:mr,fetcherResults:Je}=await hi(N,vn,ja,Tr,kn);if(ze.signal.aborted)return;ze.signal.removeEventListener("abort",$n),D.delete(U),B.delete(U),Tr.forEach(bt=>B.delete(bt.key));let yt=nu(mr);if(yt)return wt(kn,yt.result,!1,{preventScrollReset:be});if(yt=nu(Je),yt)return Q.add(yt.key),wt(kn,yt.result,!1,{preventScrollReset:be});let{loaderData:Yr,errors:pi}=m0(N,vn,mr,void 0,Tr,Je,me);if(N.fetchers.has(U)){let bt=Za(Qe.data);N.fetchers.set(U,bt)}Vt(rn),N.navigation.state==="loading"&&rn>ie?(qe(T,"Expected pending action"),q&&q.abort(),dt(N.navigation.location,{matches:vn,loaderData:Yr,errors:pi,fetchers:new Map(N.fetchers)})):(he({errors:pi,loaderData:p0(N.loaderData,Yr,vn,pi),fetchers:new Map(N.fetchers)}),de=!1)}async function tl(U,V,$,ce,pe,Se,Me,be,ge){let ve=N.fetchers.get(U);Ut(U,Wo(ge,ve?ve.data:void 0),{flushSync:Me});let Ce=new AbortController,ze=kl(t.history,$,Ce.signal);if(Se){let Qe=await Ft(pe,new URL(ze.url).pathname,ze.signal,U);if(Qe.type==="aborted")return;if(Qe.type==="error"){tn(U,V,Qe.error,{flushSync:Me});return}else if(Qe.matches)pe=Qe.matches,ce=rs(pe,$);else{tn(U,V,Tn(404,{pathname:$}),{flushSync:Me});return}}B.set(U,Ce);let Ye=ee,rt=(await Fr("loader",N,ze,[ce],pe,U))[ce.route.id];if(ei(rt)&&(rt=await op(rt,ze.signal,!0)||rt),B.get(U)===Ce&&B.delete(U),!ze.signal.aborted){if(fe.has(U)){Ut(U,Za(void 0));return}if(ki(rt))if(ie>Ye){Ut(U,Za(void 0));return}else{Q.add(U),await wt(ze,rt,!1,{preventScrollReset:be});return}if(Vn(rt)){tn(U,V,rt.error);return}qe(!ei(rt),"Unhandled fetcher deferred data"),Ut(U,Za(rt.data))}}async function wt(U,V,$,ce){let{submission:pe,fetcherSubmission:Se,preventScrollReset:Me,replace:be}=ce===void 0?{}:ce;V.response.headers.has("X-Remix-Revalidate")&&(de=!0);let ge=V.response.headers.get("Location");qe(ge,"Expected a Location header on the redirect Response"),ge=f0(ge,new URL(U.url),m);let ve=us(N.location,ge,{_isRedirect:!0});if(a){let Qe=!1;if(V.response.headers.has("X-Remix-Reload-Document"))Qe=!0;else if(lp.test(ge)){const vt=t.history.createURL(ge);Qe=vt.origin!==r.location.origin||ha(vt.pathname,m)==null}if(Qe){be?r.location.replace(ge):r.location.assign(ge);return}}q=null;let Ce=be===!0||V.response.headers.has("X-Remix-Replace")?Qt.Replace:Qt.Push,{formMethod:ze,formAction:Ye,formEncType:Gt}=N.navigation;!pe&&!Se&&ze&&Ye&&Gt&&(pe=b0(N.navigation));let rt=pe||Se;if(k2.has(V.response.status)&&rt&&xr(rt.formMethod))await jt(Ce,ve,{submission:Nt({},rt,{formAction:ge}),preventScrollReset:Me||A,enableViewTransition:$?K:void 0});else{let Qe=Wh(ve,pe);await jt(Ce,ve,{overrideNavigation:Qe,fetcherSubmission:Se,preventScrollReset:Me||A,enableViewTransition:$?K:void 0})}}async function Fr(U,V,$,ce,pe,Se){let Me,be={};try{Me=await V2(v,U,V,$,ce,pe,Se,c,s)}catch(ge){return ce.forEach(ve=>{be[ve.route.id]={type:lt.error,error:ge}}),be}for(let[ge,ve]of Object.entries(Me))if($2(ve)){let Ce=ve.result;be[ge]={type:lt.redirect,response:Y2(Ce,$,ge,pe,m,y.v7_relativeSplatPath)}}else be[ge]=await G2(ve);return be}async function hi(U,V,$,ce,pe){let Se=U.matches,Me=Fr("loader",U,pe,$,V,null),be=Promise.all(ce.map(async Ce=>{if(Ce.matches&&Ce.match&&Ce.controller){let Ye=(await Fr("loader",U,kl(t.history,Ce.path,Ce.controller.signal),[Ce.match],Ce.matches,Ce.key))[Ce.match.route.id];return{[Ce.key]:Ye}}else return Promise.resolve({[Ce.key]:{type:lt.error,error:Tn(404,{pathname:Ce.path})}})})),ge=await Me,ve=(await be).reduce((Ce,ze)=>Object.assign(Ce,ze),{});return await Promise.all([W2(V,ge,pe.signal,Se,U.loaderData),eR(V,ve,ce)]),{loaderResults:ge,fetcherResults:ve}}function Ln(){de=!0,L.push(...gt()),J.forEach((U,V)=>{B.has(V)&&G.add(V),cn(V)})}function Ut(U,V,$){$===void 0&&($={}),N.fetchers.set(U,V),he({fetchers:new Map(N.fetchers)},{flushSync:($&&$.flushSync)===!0})}function tn(U,V,$,ce){ce===void 0&&(ce={});let pe=Li(N.matches,V);mn(U),he({errors:{[pe.route.id]:$},fetchers:new Map(N.fetchers)},{flushSync:(ce&&ce.flushSync)===!0})}function Na(U){return ne.set(U,(ne.get(U)||0)+1),fe.has(U)&&fe.delete(U),N.fetchers.get(U)||P2}function mn(U){let V=N.fetchers.get(U);B.has(U)&&!(V&&V.state==="loading"&&D.has(U))&&cn(U),J.delete(U),D.delete(U),Q.delete(U),y.v7_fetcherPersist&&fe.delete(U),G.delete(U),N.fetchers.delete(U)}function nl(U){let V=(ne.get(U)||0)-1;V<=0?(ne.delete(U),fe.add(U),y.v7_fetcherPersist||mn(U)):ne.set(U,V),he({fetchers:new Map(N.fetchers)})}function cn(U){let V=B.get(U);V&&(V.abort(),B.delete(U))}function Jt(U){for(let V of U){let $=Na(V),ce=Za($.data);N.fetchers.set(V,ce)}}function pn(){let U=[],V=!1;for(let $ of Q){let ce=N.fetchers.get($);qe(ce,"Expected fetcher: "+$),ce.state==="loading"&&(Q.delete($),U.push($),V=!0)}return Jt(U),V}function Vt(U){let V=[];for(let[$,ce]of D)if(ce<U){let pe=N.fetchers.get($);qe(pe,"Expected fetcher: "+$),pe.state==="loading"&&(cn($),D.delete($),V.push($))}return Jt(V),V.length>0}function oo(U,V){let $=N.blockers.get(U)||Jo;return re.get(U)!==V&&re.set(U,V),$}function mi(U){N.blockers.delete(U),re.delete(U)}function Ea(U,V){let $=N.blockers.get(U)||Jo;qe($.state==="unblocked"&&V.state==="blocked"||$.state==="blocked"&&V.state==="blocked"||$.state==="blocked"&&V.state==="proceeding"||$.state==="blocked"&&V.state==="unblocked"||$.state==="proceeding"&&V.state==="unblocked","Invalid blocker state transition: "+$.state+" -> "+V.state);let ce=new Map(N.blockers);ce.set(U,V),he({blockers:ce})}function Gr(U){let{currentLocation:V,nextLocation:$,historyAction:ce}=U;if(re.size===0)return;re.size>1&&Bi(!1,"A router only supports one blocker at a time");let pe=Array.from(re.entries()),[Se,Me]=pe[pe.length-1],be=N.blockers.get(Se);if(!(be&&be.state==="proceeding")&&Me({currentLocation:V,nextLocation:$,historyAction:ce}))return Se}function Dr(U){let V=Tn(404,{pathname:U}),$=d||u,{matches:ce,route:pe}=g0($);return gt(),{notFoundMatches:ce,route:pe,error:V}}function gt(U){let V=[];return me.forEach(($,ce)=>{(!U||U(ce))&&($.cancel(),V.push(ce),me.delete(ce))}),V}function Et(U,V,$){if(E=U,R=V,S=$||null,!M&&N.navigation===Jh){M=!0;let ce=nn(N.location,N.matches);ce!=null&&he({restoreScrollPosition:ce})}return()=>{E=null,R=null,S=null}}function Tt(U,V){return S&&S(U,V.map(ce=>h2(ce,N.loaderData)))||U.key}function un(U,V){if(E&&R){let $=Tt(U,V);E[$]=R()}}function nn(U,V){if(E){let $=Tt(U,V),ce=E[$];if(typeof ce=="number")return ce}return null}function _t(U,V,$){if(b)if(U){if(Object.keys(U[0].params).length>0)return{active:!0,matches:pu(V,$,m,!0)}}else return{active:!0,matches:pu(V,$,m,!0)||[]};return{active:!1,matches:null}}async function Ft(U,V,$,ce){if(!b)return{type:"success",matches:U};let pe=U;for(;;){let Se=d==null,Me=d||u,be=c;try{await b({signal:$,path:V,matches:pe,fetcherKey:ce,patch:(Ce,ze)=>{$.aborted||d0(Ce,ze,Me,be,s)}})}catch(Ce){return{type:"error",error:Ce,partialMatches:pe}}finally{Se&&!$.aborted&&(u=[...u])}if($.aborted)return{type:"aborted"};let ge=zi(Me,V,m);if(ge)return{type:"success",matches:ge};let ve=pu(Me,V,m,!0);if(!ve||pe.length===ve.length&&pe.every((Ce,ze)=>Ce.route.id===ve[ze].route.id))return{type:"success",matches:null};pe=ve}}function Cn(U){c={},d=Cu(U,s,void 0,c)}function At(U,V){let $=d==null;d0(U,V,d||u,c,s),$&&(u=[...u],he({}))}return I={get basename(){return m},get future(){return y},get state(){return N},get routes(){return u},get window(){return r},initialize:Ae,subscribe:Ue,enableScrollRestoration:Et,navigate:pt,fetch:Or,revalidate:Sn,createHref:U=>t.history.createHref(U),encodeLocation:U=>t.history.encodeLocation(U),getFetcher:Na,deleteFetcher:nl,dispose:Te,getBlocker:oo,deleteBlocker:mi,patchRoutes:At,_internalFetchControllers:B,_internalActiveDeferreds:me,_internalSetRoutes:Cn},I}function H2(t){return t!=null&&("formData"in t&&t.formData!=null||"body"in t&&t.body!==void 0)}function xm(t,r,a,l,s,c,u,d){let m,v;if(u){m=[];for(let y of r)if(m.push(y),y.route.id===u){v=y;break}}else m=r,v=r[r.length-1];let b=ip(s||".",ap(m,c),ha(t.pathname,a)||t.pathname,d==="path");if(s==null&&(b.search=t.search,b.hash=t.hash),(s==null||s===""||s===".")&&v){let y=sp(b.search);if(v.route.index&&!y)b.search=b.search?b.search.replace(/^\?/,"?index&"):"?index";else if(!v.route.index&&y){let w=new URLSearchParams(b.search),C=w.getAll("index");w.delete("index"),C.filter(S=>S).forEach(S=>w.append("index",S));let E=w.toString();b.search=E?"?"+E:""}}return l&&a!=="/"&&(b.pathname=b.pathname==="/"?a:fa([a,b.pathname])),Hi(b)}function o0(t,r,a,l){if(!l||!H2(l))return{path:a};if(l.formMethod&&!J2(l.formMethod))return{path:a,error:Tn(405,{method:l.formMethod})};let s=()=>({path:a,error:Tn(400,{type:"invalid-body"})}),c=l.formMethod||"get",u=t?c.toUpperCase():c.toLowerCase(),d=eS(a);if(l.body!==void 0){if(l.formEncType==="text/plain"){if(!xr(u))return s();let w=typeof l.body=="string"?l.body:l.body instanceof FormData||l.body instanceof URLSearchParams?Array.from(l.body.entries()).reduce((C,E)=>{let[S,R]=E;return""+C+S+"="+R+`
`},""):String(l.body);return{path:a,submission:{formMethod:u,formAction:d,formEncType:l.formEncType,formData:void 0,json:void 0,text:w}}}else if(l.formEncType==="application/json"){if(!xr(u))return s();try{let w=typeof l.body=="string"?JSON.parse(l.body):l.body;return{path:a,submission:{formMethod:u,formAction:d,formEncType:l.formEncType,formData:void 0,json:w,text:void 0}}}catch{return s()}}}qe(typeof FormData=="function","FormData is not available in this environment");let m,v;if(l.formData)m=wm(l.formData),v=l.formData;else if(l.body instanceof FormData)m=wm(l.body),v=l.body;else if(l.body instanceof URLSearchParams)m=l.body,v=h0(m);else if(l.body==null)m=new URLSearchParams,v=new FormData;else try{m=new URLSearchParams(l.body),v=h0(m)}catch{return s()}let b={formMethod:u,formAction:d,formEncType:l&&l.formEncType||"application/x-www-form-urlencoded",formData:v,json:void 0,text:void 0};if(xr(b.formMethod))return{path:a,submission:b};let y=li(a);return r&&y.search&&sp(y.search)&&m.append("index",""),y.search="?"+m,{path:Hi(y),submission:b}}function s0(t,r,a){a===void 0&&(a=!1);let l=t.findIndex(s=>s.route.id===r);return l>=0?t.slice(0,a?l+1:l):t}function c0(t,r,a,l,s,c,u,d,m,v,b,y,w,C,E,S){let R=S?Vn(S[1])?S[1].error:S[1].data:void 0,M=t.createURL(r.location),O=t.createURL(s),_=a;c&&r.errors?_=s0(a,Object.keys(r.errors)[0],!0):S&&Vn(S[1])&&(_=s0(a,S[0]));let z=S?S[1].statusCode:void 0,k=u&&z&&z>=400,I=_.filter((T,A)=>{let{route:q}=T;if(q.lazy)return!0;if(q.loader==null)return!1;if(c)return Sm(q,r.loaderData,r.errors);if(q2(r.loaderData,r.matches[A],T)||m.some(ue=>ue===T.route.id))return!0;let K=r.matches[A],W=T;return u0(T,Nt({currentUrl:M,currentParams:K.params,nextUrl:O,nextParams:W.params},l,{actionResult:R,actionStatus:z,defaultShouldRevalidate:k?!1:d||M.pathname+M.search===O.pathname+O.search||M.search!==O.search||Jx(K,W)}))}),N=[];return y.forEach((T,A)=>{if(c||!a.some(le=>le.route.id===T.routeId)||b.has(A))return;let q=zi(C,T.path,E);if(!q){N.push({key:A,routeId:T.routeId,path:T.path,matches:null,match:null,controller:null});return}let K=r.fetchers.get(A),W=rs(q,T.path),ue=!1;w.has(A)?ue=!1:v.has(A)?(v.delete(A),ue=!0):K&&K.state!=="idle"&&K.data===void 0?ue=d:ue=u0(W,Nt({currentUrl:M,currentParams:r.matches[r.matches.length-1].params,nextUrl:O,nextParams:a[a.length-1].params},l,{actionResult:R,actionStatus:z,defaultShouldRevalidate:k?!1:d})),ue&&N.push({key:A,routeId:T.routeId,path:T.path,matches:q,match:W,controller:new AbortController})}),[I,N]}function Sm(t,r,a){if(t.lazy)return!0;if(!t.loader)return!1;let l=r!=null&&r[t.id]!==void 0,s=a!=null&&a[t.id]!==void 0;return!l&&s?!1:typeof t.loader=="function"&&t.loader.hydrate===!0?!0:!l&&!s}function q2(t,r,a){let l=!r||a.route.id!==r.route.id,s=t[a.route.id]===void 0;return l||s}function Jx(t,r){let a=t.route.path;return t.pathname!==r.pathname||a!=null&&a.endsWith("*")&&t.params["*"]!==r.params["*"]}function u0(t,r){if(t.route.shouldRevalidate){let a=t.route.shouldRevalidate(r);if(typeof a=="boolean")return a}return r.defaultShouldRevalidate}function d0(t,r,a,l,s){var c;let u;if(t){let v=l[t];qe(v,"No route found to patch children into: routeId = "+t),v.children||(v.children=[]),u=v.children}else u=a;let d=r.filter(v=>!u.some(b=>Wx(v,b))),m=Cu(d,s,[t||"_","patch",String(((c=u)==null?void 0:c.length)||"0")],l);u.push(...m)}function Wx(t,r){return"id"in t&&"id"in r&&t.id===r.id?!0:t.index===r.index&&t.path===r.path&&t.caseSensitive===r.caseSensitive?(!t.children||t.children.length===0)&&(!r.children||r.children.length===0)?!0:t.children.every((a,l)=>{var s;return(s=r.children)==null?void 0:s.some(c=>Wx(a,c))}):!1}async function I2(t,r,a){if(!t.lazy)return;let l=await t.lazy();if(!t.lazy)return;let s=a[t.id];qe(s,"No route found in manifest");let c={};for(let u in l){let m=s[u]!==void 0&&u!=="hasErrorBoundary";Bi(!m,'Route "'+s.id+'" has a static property "'+u+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+u+'" will be ignored.')),!m&&!d2.has(u)&&(c[u]=l[u])}Object.assign(s,c),Object.assign(s,Nt({},r(s),{lazy:void 0}))}async function Q2(t){let{matches:r}=t,a=r.filter(s=>s.shouldLoad);return(await Promise.all(a.map(s=>s.resolve()))).reduce((s,c,u)=>Object.assign(s,{[a[u].route.id]:c}),{})}async function V2(t,r,a,l,s,c,u,d,m,v){let b=c.map(C=>C.route.lazy?I2(C.route,m,d):void 0),y=c.map((C,E)=>{let S=b[E],R=s.some(O=>O.route.id===C.route.id);return Nt({},C,{shouldLoad:R,resolve:async O=>(O&&l.method==="GET"&&(C.route.lazy||C.route.loader)&&(R=!0),R?F2(r,l,C,S,O,v):Promise.resolve({type:lt.data,result:void 0}))})}),w=await t({matches:y,request:l,params:c[0].params,fetcherKey:u,context:v});try{await Promise.all(b)}catch{}return w}async function F2(t,r,a,l,s,c){let u,d,m=v=>{let b,y=new Promise((E,S)=>b=S);d=()=>b(),r.signal.addEventListener("abort",d);let w=E=>typeof v!="function"?Promise.reject(new Error("You cannot call the handler for a route which defines a boolean "+('"'+t+'" [routeId: '+a.route.id+"]"))):v({request:r,params:a.params,context:c},...E!==void 0?[E]:[]),C=(async()=>{try{return{type:"data",result:await(s?s(S=>w(S)):w())}}catch(E){return{type:"error",result:E}}})();return Promise.race([C,y])};try{let v=a.route[t];if(l)if(v){let b,[y]=await Promise.all([m(v).catch(w=>{b=w}),l]);if(b!==void 0)throw b;u=y}else if(await l,v=a.route[t],v)u=await m(v);else if(t==="action"){let b=new URL(r.url),y=b.pathname+b.search;throw Tn(405,{method:r.method,pathname:y,routeId:a.route.id})}else return{type:lt.data,result:void 0};else if(v)u=await m(v);else{let b=new URL(r.url),y=b.pathname+b.search;throw Tn(404,{pathname:y})}qe(u.result!==void 0,"You defined "+(t==="action"?"an action":"a loader")+" for route "+('"'+a.route.id+"\" but didn't return anything from your `"+t+"` ")+"function. Please return a value or `null`.")}catch(v){return{type:lt.error,result:v}}finally{d&&r.signal.removeEventListener("abort",d)}return u}async function G2(t){let{result:r,type:a}=t;if(tS(r)){let y;try{let w=r.headers.get("Content-Type");w&&/\bapplication\/json\b/.test(w)?r.body==null?y=null:y=await r.json():y=await r.text()}catch(w){return{type:lt.error,error:w}}return a===lt.error?{type:lt.error,error:new Eu(r.status,r.statusText,y),statusCode:r.status,headers:r.headers}:{type:lt.data,data:y,statusCode:r.status,headers:r.headers}}if(a===lt.error){if(y0(r)){var l,s;if(r.data instanceof Error){var c,u;return{type:lt.error,error:r.data,statusCode:(c=r.init)==null?void 0:c.status,headers:(u=r.init)!=null&&u.headers?new Headers(r.init.headers):void 0}}return{type:lt.error,error:new Eu(((l=r.init)==null?void 0:l.status)||500,void 0,r.data),statusCode:ds(r)?r.status:void 0,headers:(s=r.init)!=null&&s.headers?new Headers(r.init.headers):void 0}}return{type:lt.error,error:r,statusCode:ds(r)?r.status:void 0}}if(Z2(r)){var d,m;return{type:lt.deferred,deferredData:r,statusCode:(d=r.init)==null?void 0:d.status,headers:((m=r.init)==null?void 0:m.headers)&&new Headers(r.init.headers)}}if(y0(r)){var v,b;return{type:lt.data,data:r.data,statusCode:(v=r.init)==null?void 0:v.status,headers:(b=r.init)!=null&&b.headers?new Headers(r.init.headers):void 0}}return{type:lt.data,data:r}}function Y2(t,r,a,l,s,c){let u=t.headers.get("Location");if(qe(u,"Redirects returned/thrown from loaders/actions must have a Location header"),!lp.test(u)){let d=l.slice(0,l.findIndex(m=>m.route.id===a)+1);u=xm(new URL(r.url),d,s,!0,u,c),t.headers.set("Location",u)}return t}function f0(t,r,a){if(lp.test(t)){let l=t,s=l.startsWith("//")?new URL(r.protocol+l):new URL(l),c=ha(s.pathname,a)!=null;if(s.origin===r.origin&&c)return s.pathname+s.search+s.hash}return t}function kl(t,r,a,l){let s=t.createURL(eS(r)).toString(),c={signal:a};if(l&&xr(l.formMethod)){let{formMethod:u,formEncType:d}=l;c.method=u.toUpperCase(),d==="application/json"?(c.headers=new Headers({"Content-Type":d}),c.body=JSON.stringify(l.json)):d==="text/plain"?c.body=l.text:d==="application/x-www-form-urlencoded"&&l.formData?c.body=wm(l.formData):c.body=l.formData}return new Request(s,c)}function wm(t){let r=new URLSearchParams;for(let[a,l]of t.entries())r.append(a,typeof l=="string"?l:l.name);return r}function h0(t){let r=new FormData;for(let[a,l]of t.entries())r.append(a,l);return r}function K2(t,r,a,l,s){let c={},u=null,d,m=!1,v={},b=a&&Vn(a[1])?a[1].error:void 0;return t.forEach(y=>{if(!(y.route.id in r))return;let w=y.route.id,C=r[w];if(qe(!ki(C),"Cannot handle redirect results in processLoaderData"),Vn(C)){let E=C.error;b!==void 0&&(E=b,b=void 0),u=u||{};{let S=Li(t,w);u[S.route.id]==null&&(u[S.route.id]=E)}c[w]=void 0,m||(m=!0,d=ds(C.error)?C.error.status:500),C.headers&&(v[w]=C.headers)}else ei(C)?(l.set(w,C.deferredData),c[w]=C.deferredData.data,C.statusCode!=null&&C.statusCode!==200&&!m&&(d=C.statusCode),C.headers&&(v[w]=C.headers)):(c[w]=C.data,C.statusCode&&C.statusCode!==200&&!m&&(d=C.statusCode),C.headers&&(v[w]=C.headers))}),b!==void 0&&a&&(u={[a[0]]:b},c[a[0]]=void 0),{loaderData:c,errors:u,statusCode:d||200,loaderHeaders:v}}function m0(t,r,a,l,s,c,u){let{loaderData:d,errors:m}=K2(r,a,l,u);return s.forEach(v=>{let{key:b,match:y,controller:w}=v,C=c[b];if(qe(C,"Did not find corresponding fetcher result"),!(w&&w.signal.aborted))if(Vn(C)){let E=Li(t.matches,y?.route.id);m&&m[E.route.id]||(m=Nt({},m,{[E.route.id]:C.error})),t.fetchers.delete(b)}else if(ki(C))qe(!1,"Unhandled fetcher revalidation redirect");else if(ei(C))qe(!1,"Unhandled fetcher deferred data");else{let E=Za(C.data);t.fetchers.set(b,E)}}),{loaderData:d,errors:m}}function p0(t,r,a,l){let s=Nt({},r);for(let c of a){let u=c.route.id;if(r.hasOwnProperty(u)?r[u]!==void 0&&(s[u]=r[u]):t[u]!==void 0&&c.route.loader&&(s[u]=t[u]),l&&l.hasOwnProperty(u))break}return s}function v0(t){return t?Vn(t[1])?{actionData:{}}:{actionData:{[t[0]]:t[1].data}}:{}}function Li(t,r){return(r?t.slice(0,t.findIndex(l=>l.route.id===r)+1):[...t]).reverse().find(l=>l.route.hasErrorBoundary===!0)||t[0]}function g0(t){let r=t.length===1?t[0]:t.find(a=>a.index||!a.path||a.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:r}],route:r}}function Tn(t,r){let{pathname:a,routeId:l,method:s,type:c,message:u}=r===void 0?{}:r,d="Unknown Server Error",m="Unknown @remix-run/router error";return t===400?(d="Bad Request",s&&a&&l?m="You made a "+s+' request to "'+a+'" but '+('did not provide a `loader` for route "'+l+'", ')+"so there is no way to handle the request.":c==="defer-action"?m="defer() is not supported in actions":c==="invalid-body"&&(m="Unable to encode submission body")):t===403?(d="Forbidden",m='Route "'+l+'" does not match URL "'+a+'"'):t===404?(d="Not Found",m='No route matches URL "'+a+'"'):t===405&&(d="Method Not Allowed",s&&a&&l?m="You made a "+s.toUpperCase()+' request to "'+a+'" but '+('did not provide an `action` for route "'+l+'", ')+"so there is no way to handle the request.":s&&(m='Invalid request method "'+s.toUpperCase()+'"')),new Eu(t||500,d,new Error(m),!0)}function nu(t){let r=Object.entries(t);for(let a=r.length-1;a>=0;a--){let[l,s]=r[a];if(ki(s))return{key:l,result:s}}}function eS(t){let r=typeof t=="string"?li(t):t;return Hi(Nt({},r,{hash:""}))}function X2(t,r){return t.pathname!==r.pathname||t.search!==r.search?!1:t.hash===""?r.hash!=="":t.hash===r.hash?!0:r.hash!==""}function $2(t){return tS(t.result)&&L2.has(t.result.status)}function ei(t){return t.type===lt.deferred}function Vn(t){return t.type===lt.error}function ki(t){return(t&&t.type)===lt.redirect}function y0(t){return typeof t=="object"&&t!=null&&"type"in t&&"data"in t&&"init"in t&&t.type==="DataWithResponseInit"}function Z2(t){let r=t;return r&&typeof r=="object"&&typeof r.data=="object"&&typeof r.subscribe=="function"&&typeof r.cancel=="function"&&typeof r.resolveData=="function"}function tS(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.headers=="object"&&typeof t.body<"u"}function J2(t){return z2.has(t.toLowerCase())}function xr(t){return _2.has(t.toLowerCase())}async function W2(t,r,a,l,s){let c=Object.entries(r);for(let u=0;u<c.length;u++){let[d,m]=c[u],v=t.find(w=>w?.route.id===d);if(!v)continue;let b=l.find(w=>w.route.id===v.route.id),y=b!=null&&!Jx(b,v)&&(s&&s[v.route.id])!==void 0;ei(m)&&y&&await op(m,a,!1).then(w=>{w&&(r[d]=w)})}}async function eR(t,r,a){for(let l=0;l<a.length;l++){let{key:s,routeId:c,controller:u}=a[l],d=r[s];t.find(v=>v?.route.id===c)&&ei(d)&&(qe(u,"Expected an AbortController for revalidating fetcher deferred result"),await op(d,u.signal,!0).then(v=>{v&&(r[s]=v)}))}}async function op(t,r,a){if(a===void 0&&(a=!1),!await t.deferredData.resolveData(r)){if(a)try{return{type:lt.data,data:t.deferredData.unwrappedData}}catch(s){return{type:lt.error,error:s}}return{type:lt.data,data:t.deferredData.data}}}function sp(t){return new URLSearchParams(t).getAll("index").some(r=>r==="")}function rs(t,r){let a=typeof r=="string"?li(r).search:r.search;if(t[t.length-1].route.index&&sp(a||""))return t[t.length-1];let l=Xx(t);return l[l.length-1]}function b0(t){let{formMethod:r,formAction:a,formEncType:l,text:s,formData:c,json:u}=t;if(!(!r||!a||!l)){if(s!=null)return{formMethod:r,formAction:a,formEncType:l,formData:void 0,json:void 0,text:s};if(c!=null)return{formMethod:r,formAction:a,formEncType:l,formData:c,json:void 0,text:void 0};if(u!==void 0)return{formMethod:r,formAction:a,formEncType:l,formData:void 0,json:u,text:void 0}}}function Wh(t,r){return r?{state:"loading",location:t,formMethod:r.formMethod,formAction:r.formAction,formEncType:r.formEncType,formData:r.formData,json:r.json,text:r.text}:{state:"loading",location:t,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function tR(t,r){return{state:"submitting",location:t,formMethod:r.formMethod,formAction:r.formAction,formEncType:r.formEncType,formData:r.formData,json:r.json,text:r.text}}function Wo(t,r){return t?{state:"loading",formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text,data:r}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:r}}function nR(t,r){return{state:"submitting",formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text,data:r?r.data:void 0}}function Za(t){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function rR(t,r){try{let a=t.sessionStorage.getItem(Zx);if(a){let l=JSON.parse(a);for(let[s,c]of Object.entries(l||{}))c&&Array.isArray(c)&&r.set(s,new Set(c||[]))}}catch{}}function aR(t,r){if(r.size>0){let a={};for(let[l,s]of r)a[l]=[...s];try{t.sessionStorage.setItem(Zx,JSON.stringify(a))}catch(l){Bi(!1,"Failed to save applied view transitions in sessionStorage ("+l+").")}}}function ju(){return ju=Object.assign?Object.assign.bind():function(t){for(var r=1;r<arguments.length;r++){var a=arguments[r];for(var l in a)Object.prototype.hasOwnProperty.call(a,l)&&(t[l]=a[l])}return t},ju.apply(this,arguments)}const Ns=g.createContext(null),cp=g.createContext(null),oi=g.createContext(null),up=g.createContext(null),xa=g.createContext({outlet:null,matches:[],isDataRoute:!1}),nS=g.createContext(null);function iR(t,r){let{relative:a}=r===void 0?{}:r;Es()||qe(!1);let{basename:l,navigator:s}=g.useContext(oi),{hash:c,pathname:u,search:d}=Ku(t,{relative:a}),m=u;return l!=="/"&&(m=u==="/"?l:fa([l,u])),s.createHref({pathname:m,search:d,hash:c})}function Es(){return g.useContext(up)!=null}function Sa(){return Es()||qe(!1),g.useContext(up).location}function rS(t){g.useContext(oi).static||g.useLayoutEffect(t)}function js(){let{isDataRoute:t}=g.useContext(xa);return t?xR():lR()}function lR(){Es()||qe(!1);let t=g.useContext(Ns),{basename:r,future:a,navigator:l}=g.useContext(oi),{matches:s}=g.useContext(xa),{pathname:c}=Sa(),u=JSON.stringify(ap(s,a.v7_relativeSplatPath)),d=g.useRef(!1);return rS(()=>{d.current=!0}),g.useCallback(function(v,b){if(b===void 0&&(b={}),!d.current)return;if(typeof v=="number"){l.go(v);return}let y=ip(v,JSON.parse(u),c,b.relative==="path");t==null&&r!=="/"&&(y.pathname=y.pathname==="/"?r:fa([r,y.pathname])),(b.replace?l.replace:l.push)(y,b.state,b)},[r,l,u,c,t])}const oR=g.createContext(null);function sR(t){let r=g.useContext(xa).outlet;return r&&g.createElement(oR.Provider,{value:t},r)}function cR(){let{matches:t}=g.useContext(xa),r=t[t.length-1];return r?r.params:{}}function Ku(t,r){let{relative:a}=r===void 0?{}:r,{future:l}=g.useContext(oi),{matches:s}=g.useContext(xa),{pathname:c}=Sa(),u=JSON.stringify(ap(s,l.v7_relativeSplatPath));return g.useMemo(()=>ip(t,JSON.parse(u),c,a==="path"),[t,u,c,a])}function uR(t,r,a,l){Es()||qe(!1);let{navigator:s}=g.useContext(oi),{matches:c}=g.useContext(xa),u=c[c.length-1],d=u?u.params:{};u&&u.pathname;let m=u?u.pathnameBase:"/";u&&u.route;let v=Sa(),b;b=v;let y=b.pathname||"/",w=y;if(m!=="/"){let S=m.replace(/^\//,"").split("/");w="/"+y.replace(/^\//,"").split("/").slice(S.length).join("/")}let C=zi(t,{pathname:w});return pR(C&&C.map(S=>Object.assign({},S,{params:Object.assign({},d,S.params),pathname:fa([m,s.encodeLocation?s.encodeLocation(S.pathname).pathname:S.pathname]),pathnameBase:S.pathnameBase==="/"?m:fa([m,s.encodeLocation?s.encodeLocation(S.pathnameBase).pathname:S.pathnameBase])})),c,a,l)}function dR(){let t=bR(),r=ds(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),a=t instanceof Error?t.stack:null,s={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return g.createElement(g.Fragment,null,g.createElement("h2",null,"Unexpected Application Error!"),g.createElement("h3",{style:{fontStyle:"italic"}},r),a?g.createElement("pre",{style:s},a):null,null)}const fR=g.createElement(dR,null);class hR extends g.Component{constructor(r){super(r),this.state={location:r.location,revalidation:r.revalidation,error:r.error}}static getDerivedStateFromError(r){return{error:r}}static getDerivedStateFromProps(r,a){return a.location!==r.location||a.revalidation!=="idle"&&r.revalidation==="idle"?{error:r.error,location:r.location,revalidation:r.revalidation}:{error:r.error!==void 0?r.error:a.error,location:a.location,revalidation:r.revalidation||a.revalidation}}componentDidCatch(r,a){console.error("React Router caught the following error during render",r,a)}render(){return this.state.error!==void 0?g.createElement(xa.Provider,{value:this.props.routeContext},g.createElement(nS.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function mR(t){let{routeContext:r,match:a,children:l}=t,s=g.useContext(Ns);return s&&s.static&&s.staticContext&&(a.route.errorElement||a.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=a.route.id),g.createElement(xa.Provider,{value:r},l)}function pR(t,r,a,l){var s;if(r===void 0&&(r=[]),a===void 0&&(a=null),l===void 0&&(l=null),t==null){var c;if(!a)return null;if(a.errors)t=a.matches;else if((c=l)!=null&&c.v7_partialHydration&&r.length===0&&!a.initialized&&a.matches.length>0)t=a.matches;else return null}let u=t,d=(s=a)==null?void 0:s.errors;if(d!=null){let b=u.findIndex(y=>y.route.id&&d?.[y.route.id]!==void 0);b>=0||qe(!1),u=u.slice(0,Math.min(u.length,b+1))}let m=!1,v=-1;if(a&&l&&l.v7_partialHydration)for(let b=0;b<u.length;b++){let y=u[b];if((y.route.HydrateFallback||y.route.hydrateFallbackElement)&&(v=b),y.route.id){let{loaderData:w,errors:C}=a,E=y.route.loader&&w[y.route.id]===void 0&&(!C||C[y.route.id]===void 0);if(y.route.lazy||E){m=!0,v>=0?u=u.slice(0,v+1):u=[u[0]];break}}}return u.reduceRight((b,y,w)=>{let C,E=!1,S=null,R=null;a&&(C=d&&y.route.id?d[y.route.id]:void 0,S=y.route.errorElement||fR,m&&(v<0&&w===0?(SR("route-fallback"),E=!0,R=null):v===w&&(E=!0,R=y.route.hydrateFallbackElement||null)));let M=r.concat(u.slice(0,w+1)),O=()=>{let _;return C?_=S:E?_=R:y.route.Component?_=g.createElement(y.route.Component,null):y.route.element?_=y.route.element:_=b,g.createElement(mR,{match:y,routeContext:{outlet:b,matches:M,isDataRoute:a!=null},children:_})};return a&&(y.route.ErrorBoundary||y.route.errorElement||w===0)?g.createElement(hR,{location:a.location,revalidation:a.revalidation,component:S,error:C,children:O(),routeContext:{outlet:null,matches:M,isDataRoute:!0}}):O()},null)}var aS=(function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t})(aS||{}),iS=(function(t){return t.UseBlocker="useBlocker",t.UseLoaderData="useLoaderData",t.UseActionData="useActionData",t.UseRouteError="useRouteError",t.UseNavigation="useNavigation",t.UseRouteLoaderData="useRouteLoaderData",t.UseMatches="useMatches",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t.UseRouteId="useRouteId",t})(iS||{});function vR(t){let r=g.useContext(Ns);return r||qe(!1),r}function gR(t){let r=g.useContext(cp);return r||qe(!1),r}function yR(t){let r=g.useContext(xa);return r||qe(!1),r}function lS(t){let r=yR(),a=r.matches[r.matches.length-1];return a.route.id||qe(!1),a.route.id}function bR(){var t;let r=g.useContext(nS),a=gR(iS.UseRouteError),l=lS();return r!==void 0?r:(t=a.errors)==null?void 0:t[l]}function xR(){let{router:t}=vR(aS.UseNavigateStable),r=lS(),a=g.useRef(!1);return rS(()=>{a.current=!0}),g.useCallback(function(s,c){c===void 0&&(c={}),a.current&&(typeof s=="number"?t.navigate(s):t.navigate(s,ju({fromRouteId:r},c)))},[t,r])}const x0={};function SR(t,r,a){x0[t]||(x0[t]=!0)}function wR(t,r){t?.v7_startTransition,t?.v7_relativeSplatPath===void 0&&(!r||r.v7_relativeSplatPath),r&&(r.v7_fetcherPersist,r.v7_normalizeFormMethod,r.v7_partialHydration,r.v7_skipActionErrorRevalidation)}function CR(t){return sR(t.context)}function NR(t){let{basename:r="/",children:a=null,location:l,navigationType:s=Qt.Pop,navigator:c,static:u=!1,future:d}=t;Es()&&qe(!1);let m=r.replace(/^\/*/,"/"),v=g.useMemo(()=>({basename:m,navigator:c,static:u,future:ju({v7_relativeSplatPath:!1},d)}),[m,d,c,u]);typeof l=="string"&&(l=li(l));let{pathname:b="/",search:y="",hash:w="",state:C=null,key:E="default"}=l,S=g.useMemo(()=>{let R=ha(b,m);return R==null?null:{location:{pathname:R,search:y,hash:w,state:C,key:E},navigationType:s}},[m,b,y,w,C,E,s]);return S==null?null:g.createElement(oi.Provider,{value:v},g.createElement(up.Provider,{children:a,value:S}))}new Promise(()=>{});function ER(t){let r={hasErrorBoundary:t.ErrorBoundary!=null||t.errorElement!=null};return t.Component&&Object.assign(r,{element:g.createElement(t.Component),Component:void 0}),t.HydrateFallback&&Object.assign(r,{hydrateFallbackElement:g.createElement(t.HydrateFallback),HydrateFallback:void 0}),t.ErrorBoundary&&Object.assign(r,{errorElement:g.createElement(t.ErrorBoundary),ErrorBoundary:void 0}),r}function Fl(){return Fl=Object.assign?Object.assign.bind():function(t){for(var r=1;r<arguments.length;r++){var a=arguments[r];for(var l in a)Object.prototype.hasOwnProperty.call(a,l)&&(t[l]=a[l])}return t},Fl.apply(this,arguments)}function oS(t,r){if(t==null)return{};var a={},l=Object.keys(t),s,c;for(c=0;c<l.length;c++)s=l[c],!(r.indexOf(s)>=0)&&(a[s]=t[s]);return a}function jR(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function RR(t,r){return t.button===0&&(!r||r==="_self")&&!jR(t)}const MR=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],OR=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],DR="6";try{window.__reactRouterVersion=DR}catch{}function TR(t,r){return B2({basename:void 0,future:Fl({},void 0,{v7_prependBasename:!0}),history:s2({window:void 0}),hydrationData:_R(),routes:t,mapRouteProperties:ER,dataStrategy:void 0,patchRoutesOnNavigation:void 0,window:void 0}).initialize()}function _R(){var t;let r=(t=window)==null?void 0:t.__staticRouterHydrationData;return r&&r.errors&&(r=Fl({},r,{errors:AR(r.errors)})),r}function AR(t){if(!t)return null;let r=Object.entries(t),a={};for(let[l,s]of r)if(s&&s.__type==="RouteErrorResponse")a[l]=new Eu(s.status,s.statusText,s.data,s.internal===!0);else if(s&&s.__type==="Error"){if(s.__subType){let c=window[s.__subType];if(typeof c=="function")try{let u=new c(s.message);u.stack="",a[l]=u}catch{}}if(a[l]==null){let c=new Error(s.message);c.stack="",a[l]=c}}else a[l]=s;return a}const sS=g.createContext({isTransitioning:!1}),zR=g.createContext(new Map),LR="startTransition",S0=Cs[LR],kR="flushSync",w0=o2[kR];function PR(t){S0?S0(t):t()}function es(t){w0?w0(t):t()}class UR{constructor(){this.status="pending",this.promise=new Promise((r,a)=>{this.resolve=l=>{this.status==="pending"&&(this.status="resolved",r(l))},this.reject=l=>{this.status==="pending"&&(this.status="rejected",a(l))}})}}function BR(t){let{fallbackElement:r,router:a,future:l}=t,[s,c]=g.useState(a.state),[u,d]=g.useState(),[m,v]=g.useState({isTransitioning:!1}),[b,y]=g.useState(),[w,C]=g.useState(),[E,S]=g.useState(),R=g.useRef(new Map),{v7_startTransition:M}=l||{},O=g.useCallback(T=>{M?PR(T):T()},[M]),_=g.useCallback((T,A)=>{let{deletedFetchers:q,flushSync:K,viewTransitionOpts:W}=A;T.fetchers.forEach((le,de)=>{le.data!==void 0&&R.current.set(de,le.data)}),q.forEach(le=>R.current.delete(le));let ue=a.window==null||a.window.document==null||typeof a.window.document.startViewTransition!="function";if(!W||ue){K?es(()=>c(T)):O(()=>c(T));return}if(K){es(()=>{w&&(b&&b.resolve(),w.skipTransition()),v({isTransitioning:!0,flushSync:!0,currentLocation:W.currentLocation,nextLocation:W.nextLocation})});let le=a.window.document.startViewTransition(()=>{es(()=>c(T))});le.finished.finally(()=>{es(()=>{y(void 0),C(void 0),d(void 0),v({isTransitioning:!1})})}),es(()=>C(le));return}w?(b&&b.resolve(),w.skipTransition(),S({state:T,currentLocation:W.currentLocation,nextLocation:W.nextLocation})):(d(T),v({isTransitioning:!0,flushSync:!1,currentLocation:W.currentLocation,nextLocation:W.nextLocation}))},[a.window,w,b,R,O]);g.useLayoutEffect(()=>a.subscribe(_),[a,_]),g.useEffect(()=>{m.isTransitioning&&!m.flushSync&&y(new UR)},[m]),g.useEffect(()=>{if(b&&u&&a.window){let T=u,A=b.promise,q=a.window.document.startViewTransition(async()=>{O(()=>c(T)),await A});q.finished.finally(()=>{y(void 0),C(void 0),d(void 0),v({isTransitioning:!1})}),C(q)}},[O,u,b,a.window]),g.useEffect(()=>{b&&u&&s.location.key===u.location.key&&b.resolve()},[b,w,s.location,u]),g.useEffect(()=>{!m.isTransitioning&&E&&(d(E.state),v({isTransitioning:!0,flushSync:!1,currentLocation:E.currentLocation,nextLocation:E.nextLocation}),S(void 0))},[m.isTransitioning,E]),g.useEffect(()=>{},[]);let z=g.useMemo(()=>({createHref:a.createHref,encodeLocation:a.encodeLocation,go:T=>a.navigate(T),push:(T,A,q)=>a.navigate(T,{state:A,preventScrollReset:q?.preventScrollReset}),replace:(T,A,q)=>a.navigate(T,{replace:!0,state:A,preventScrollReset:q?.preventScrollReset})}),[a]),k=a.basename||"/",I=g.useMemo(()=>({router:a,navigator:z,static:!1,basename:k}),[a,z,k]),N=g.useMemo(()=>({v7_relativeSplatPath:a.future.v7_relativeSplatPath}),[a.future.v7_relativeSplatPath]);return g.useEffect(()=>wR(l,a.future),[l,a.future]),g.createElement(g.Fragment,null,g.createElement(Ns.Provider,{value:I},g.createElement(cp.Provider,{value:s},g.createElement(zR.Provider,{value:R.current},g.createElement(sS.Provider,{value:m},g.createElement(NR,{basename:k,location:s.location,navigationType:s.historyAction,navigator:z,future:N},s.initialized||a.future.v7_partialHydration?g.createElement(HR,{routes:a.routes,future:a.future,state:s}):r))))),null)}const HR=g.memo(qR);function qR(t){let{routes:r,future:a,state:l}=t;return uR(r,void 0,l,a)}const IR=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",QR=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,cS=g.forwardRef(function(r,a){let{onClick:l,relative:s,reloadDocument:c,replace:u,state:d,target:m,to:v,preventScrollReset:b,viewTransition:y}=r,w=oS(r,MR),{basename:C}=g.useContext(oi),E,S=!1;if(typeof v=="string"&&QR.test(v)&&(E=v,IR))try{let _=new URL(window.location.href),z=v.startsWith("//")?new URL(_.protocol+v):new URL(v),k=ha(z.pathname,C);z.origin===_.origin&&k!=null?v=k+z.search+z.hash:S=!0}catch{}let R=iR(v,{relative:s}),M=FR(v,{replace:u,state:d,target:m,preventScrollReset:b,relative:s,viewTransition:y});function O(_){l&&l(_),_.defaultPrevented||M(_)}return g.createElement("a",Fl({},w,{href:E||R,onClick:S||c?l:O,ref:a,target:m}))}),C0=g.forwardRef(function(r,a){let{"aria-current":l="page",caseSensitive:s=!1,className:c="",end:u=!1,style:d,to:m,viewTransition:v,children:b}=r,y=oS(r,OR),w=Ku(m,{relative:y.relative}),C=Sa(),E=g.useContext(cp),{navigator:S,basename:R}=g.useContext(oi),M=E!=null&&GR(w)&&v===!0,O=S.encodeLocation?S.encodeLocation(w).pathname:w.pathname,_=C.pathname,z=E&&E.navigation&&E.navigation.location?E.navigation.location.pathname:null;s||(_=_.toLowerCase(),z=z?z.toLowerCase():null,O=O.toLowerCase()),z&&R&&(z=ha(z,R)||z);const k=O!=="/"&&O.endsWith("/")?O.length-1:O.length;let I=_===O||!u&&_.startsWith(O)&&_.charAt(k)==="/",N=z!=null&&(z===O||!u&&z.startsWith(O)&&z.charAt(O.length)==="/"),T={isActive:I,isPending:N,isTransitioning:M},A=I?l:void 0,q;typeof c=="function"?q=c(T):q=[c,I?"active":null,N?"pending":null,M?"transitioning":null].filter(Boolean).join(" ");let K=typeof d=="function"?d(T):d;return g.createElement(cS,Fl({},y,{"aria-current":A,className:q,ref:a,style:K,to:m,viewTransition:v}),typeof b=="function"?b(T):b)});var Cm;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(Cm||(Cm={}));var N0;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(N0||(N0={}));function VR(t){let r=g.useContext(Ns);return r||qe(!1),r}function FR(t,r){let{target:a,replace:l,state:s,preventScrollReset:c,relative:u,viewTransition:d}=r===void 0?{}:r,m=js(),v=Sa(),b=Ku(t,{relative:u});return g.useCallback(y=>{if(RR(y,a)){y.preventDefault();let w=l!==void 0?l:Hi(v)===Hi(b);m(t,{replace:w,state:s,preventScrollReset:c,relative:u,viewTransition:d})}},[v,m,b,l,s,a,t,c,u,d])}function GR(t,r){r===void 0&&(r={});let a=g.useContext(sS);a==null&&qe(!1);let{basename:l}=VR(Cm.useViewTransitionState),s=Ku(t,{relative:r.relative});if(!a.isTransitioning)return!1;let c=ha(a.currentLocation.pathname,l)||a.currentLocation.pathname,u=ha(a.nextLocation.pathname,l)||a.nextLocation.pathname;return Nu(s.pathname,u)!=null||Nu(s.pathname,c)!=null}var Xi=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},YR={setTimeout:(t,r)=>setTimeout(t,r),clearTimeout:t=>clearTimeout(t),setInterval:(t,r)=>setInterval(t,r),clearInterval:t=>clearInterval(t)},KR=class{#t=YR;#e=!1;setTimeoutProvider(t){this.#t=t}setTimeout(t,r){return this.#t.setTimeout(t,r)}clearTimeout(t){this.#t.clearTimeout(t)}setInterval(t,r){return this.#t.setInterval(t,r)}clearInterval(t){this.#t.clearInterval(t)}},Pi=new KR;function XR(t){setTimeout(t,0)}var qi=typeof window>"u"||"Deno"in globalThis;function fn(){}function $R(t,r){return typeof t=="function"?t(r):t}function Nm(t){return typeof t=="number"&&t>=0&&t!==1/0}function uS(t,r){return Math.max(t+(r||0)-Date.now(),0)}function ti(t,r){return typeof t=="function"?t(r):t}function or(t,r){return typeof t=="function"?t(r):t}function E0(t,r){const{type:a="all",exact:l,fetchStatus:s,predicate:c,queryKey:u,stale:d}=t;if(u){if(l){if(r.queryHash!==dp(u,r.options))return!1}else if(!fs(r.queryKey,u))return!1}if(a!=="all"){const m=r.isActive();if(a==="active"&&!m||a==="inactive"&&m)return!1}return!(typeof d=="boolean"&&r.isStale()!==d||s&&s!==r.state.fetchStatus||c&&!c(r))}function j0(t,r){const{exact:a,status:l,predicate:s,mutationKey:c}=t;if(c){if(!r.options.mutationKey)return!1;if(a){if(ri(r.options.mutationKey)!==ri(c))return!1}else if(!fs(r.options.mutationKey,c))return!1}return!(l&&r.state.status!==l||s&&!s(r))}function dp(t,r){return(r?.queryKeyHashFn||ri)(t)}function ri(t){return JSON.stringify(t,(r,a)=>Em(a)?Object.keys(a).sort().reduce((l,s)=>(l[s]=a[s],l),{}):a)}function fs(t,r){return t===r?!0:typeof t!=typeof r?!1:t&&r&&typeof t=="object"&&typeof r=="object"?Object.keys(r).every(a=>fs(t[a],r[a])):!1}var ZR=Object.prototype.hasOwnProperty;function fp(t,r){if(t===r)return t;const a=R0(t)&&R0(r);if(!a&&!(Em(t)&&Em(r)))return r;const s=(a?t:Object.keys(t)).length,c=a?r:Object.keys(r),u=c.length,d=a?new Array(u):{};let m=0;for(let v=0;v<u;v++){const b=a?v:c[v],y=t[b],w=r[b];if(y===w){d[b]=y,(a?v<s:ZR.call(t,b))&&m++;continue}if(y===null||w===null||typeof y!="object"||typeof w!="object"){d[b]=w;continue}const C=fp(y,w);d[b]=C,C===y&&m++}return s===u&&m===s?t:d}function hs(t,r){if(!r||Object.keys(t).length!==Object.keys(r).length)return!1;for(const a in t)if(t[a]!==r[a])return!1;return!0}function R0(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function Em(t){if(!M0(t))return!1;const r=t.constructor;if(r===void 0)return!0;const a=r.prototype;return!(!M0(a)||!a.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function M0(t){return Object.prototype.toString.call(t)==="[object Object]"}function JR(t){return new Promise(r=>{Pi.setTimeout(r,t)})}function jm(t,r,a){return typeof a.structuralSharing=="function"?a.structuralSharing(t,r):a.structuralSharing!==!1?fp(t,r):r}function WR(t,r,a=0){const l=[...t,r];return a&&l.length>a?l.slice(1):l}function eM(t,r,a=0){const l=[r,...t];return a&&l.length>a?l.slice(0,-1):l}var Gn=Symbol();function dS(t,r){return!t.queryFn&&r?.initialPromise?()=>r.initialPromise:!t.queryFn||t.queryFn===Gn?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function hp(t,r){return typeof t=="function"?t(...r):!!t}function tM(t,r,a){let l=!1,s;return Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(s??=r(),l||(l=!0,s.aborted?a():s.addEventListener("abort",a,{once:!0})),s)}),t}var nM=class extends Xi{#t;#e;#n;constructor(){super(),this.#n=t=>{if(!qi&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}}}onSubscribe(){this.#e||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(t){this.#n=t,this.#e?.(),this.#e=t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()})}setFocused(t){this.#t!==t&&(this.#t=t,this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(r=>{r(t)})}isFocused(){return typeof this.#t=="boolean"?this.#t:globalThis.document?.visibilityState!=="hidden"}},mp=new nM;function Rm(){let t,r;const a=new Promise((s,c)=>{t=s,r=c});a.status="pending",a.catch(()=>{});function l(s){Object.assign(a,s),delete a.resolve,delete a.reject}return a.resolve=s=>{l({status:"fulfilled",value:s}),t(s)},a.reject=s=>{l({status:"rejected",reason:s}),r(s)},a}var rM=XR;function aM(){let t=[],r=0,a=d=>{d()},l=d=>{d()},s=rM;const c=d=>{r?t.push(d):s(()=>{a(d)})},u=()=>{const d=t;t=[],d.length&&s(()=>{l(()=>{d.forEach(m=>{a(m)})})})};return{batch:d=>{let m;r++;try{m=d()}finally{r--,r||u()}return m},batchCalls:d=>(...m)=>{c(()=>{d(...m)})},schedule:c,setNotifyFunction:d=>{a=d},setBatchNotifyFunction:d=>{l=d},setScheduler:d=>{s=d}}}var Dt=aM(),iM=class extends Xi{#t=!0;#e;#n;constructor(){super(),this.#n=t=>{if(!qi&&window.addEventListener){const r=()=>t(!0),a=()=>t(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",a,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",a)}}}}onSubscribe(){this.#e||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(t){this.#n=t,this.#e?.(),this.#e=t(this.setOnline.bind(this))}setOnline(t){this.#t!==t&&(this.#t=t,this.listeners.forEach(a=>{a(t)}))}isOnline(){return this.#t}},Ru=new iM;function lM(t){return Math.min(1e3*2**t,3e4)}function fS(t){return(t??"online")==="online"?Ru.isOnline():!0}var Mm=class extends Error{constructor(t){super("CancelledError"),this.revert=t?.revert,this.silent=t?.silent}};function hS(t){let r=!1,a=0,l;const s=Rm(),c=()=>s.status!=="pending",u=S=>{if(!c()){const R=new Mm(S);w(R),t.onCancel?.(R)}},d=()=>{r=!0},m=()=>{r=!1},v=()=>mp.isFocused()&&(t.networkMode==="always"||Ru.isOnline())&&t.canRun(),b=()=>fS(t.networkMode)&&t.canRun(),y=S=>{c()||(l?.(),s.resolve(S))},w=S=>{c()||(l?.(),s.reject(S))},C=()=>new Promise(S=>{l=R=>{(c()||v())&&S(R)},t.onPause?.()}).then(()=>{l=void 0,c()||t.onContinue?.()}),E=()=>{if(c())return;let S;const R=a===0?t.initialPromise:void 0;try{S=R??t.fn()}catch(M){S=Promise.reject(M)}Promise.resolve(S).then(y).catch(M=>{if(c())return;const O=t.retry??(qi?0:3),_=t.retryDelay??lM,z=typeof _=="function"?_(a,M):_,k=O===!0||typeof O=="number"&&a<O||typeof O=="function"&&O(a,M);if(r||!k){w(M);return}a++,t.onFail?.(a,M),JR(z).then(()=>v()?void 0:C()).then(()=>{r?w(M):E()})})};return{promise:s,status:()=>s.status,cancel:u,continue:()=>(l?.(),s),cancelRetry:d,continueRetry:m,canStart:b,start:()=>(b()?E():C().then(E),s)}}var mS=class{#t;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Nm(this.gcTime)&&(this.#t=Pi.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(qi?1/0:300*1e3))}clearGcTimeout(){this.#t&&(Pi.clearTimeout(this.#t),this.#t=void 0)}},oM=class extends mS{#t;#e;#n;#a;#r;#i;#o;constructor(t){super(),this.#o=!1,this.#i=t.defaultOptions,this.setOptions(t.options),this.observers=[],this.#a=t.client,this.#n=this.#a.getQueryCache(),this.queryKey=t.queryKey,this.queryHash=t.queryHash,this.#t=D0(this.options),this.state=t.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#r?.promise}setOptions(t){if(this.options={...this.#i,...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const r=D0(this.options);r.data!==void 0&&(this.setState(O0(r.data,r.dataUpdatedAt)),this.#t=r)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(t,r){const a=jm(this.state.data,t,this.options);return this.#l({data:a,type:"success",dataUpdatedAt:r?.updatedAt,manual:r?.manual}),a}setState(t,r){this.#l({type:"setState",state:t,setStateOptions:r})}cancel(t){const r=this.#r?.promise;return this.#r?.cancel(t),r?r.then(fn).catch(fn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#t)}isActive(){return this.observers.some(t=>or(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Gn||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>ti(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!uS(this.state.dataUpdatedAt,t)}onFocus(){this.observers.find(r=>r.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(r=>r.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(r=>r!==t),this.observers.length||(this.#r&&(this.#o?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#l({type:"invalidate"})}async fetch(t,r){if(this.state.fetchStatus!=="idle"&&this.#r?.status()!=="rejected"){if(this.state.data!==void 0&&r?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(t&&this.setOptions(t),!this.options.queryFn){const d=this.observers.find(m=>m.options.queryFn);d&&this.setOptions(d.options)}const a=new AbortController,l=d=>{Object.defineProperty(d,"signal",{enumerable:!0,get:()=>(this.#o=!0,a.signal)})},s=()=>{const d=dS(this.options,r),v=(()=>{const b={client:this.#a,queryKey:this.queryKey,meta:this.meta};return l(b),b})();return this.#o=!1,this.options.persister?this.options.persister(d,v,this):d(v)},u=(()=>{const d={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:this.#a,state:this.state,fetchFn:s};return l(d),d})();this.options.behavior?.onFetch(u,this),this.#e=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==u.fetchOptions?.meta)&&this.#l({type:"fetch",meta:u.fetchOptions?.meta}),this.#r=hS({initialPromise:r?.initialPromise,fn:u.fetchFn,onCancel:d=>{d instanceof Mm&&d.revert&&this.setState({...this.#e,fetchStatus:"idle"}),a.abort()},onFail:(d,m)=>{this.#l({type:"failed",failureCount:d,error:m})},onPause:()=>{this.#l({type:"pause"})},onContinue:()=>{this.#l({type:"continue"})},retry:u.options.retry,retryDelay:u.options.retryDelay,networkMode:u.options.networkMode,canRun:()=>!0});try{const d=await this.#r.start();if(d===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(d),this.#n.config.onSuccess?.(d,this),this.#n.config.onSettled?.(d,this.state.error,this),d}catch(d){if(d instanceof Mm){if(d.silent)return this.#r.promise;if(d.revert){if(this.state.data===void 0)throw d;return this.state.data}}throw this.#l({type:"error",error:d}),this.#n.config.onError?.(d,this),this.#n.config.onSettled?.(this.state.data,d,this),d}finally{this.scheduleGc()}}#l(t){const r=a=>{switch(t.type){case"failed":return{...a,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...a,fetchStatus:"paused"};case"continue":return{...a,fetchStatus:"fetching"};case"fetch":return{...a,...pS(a.data,this.options),fetchMeta:t.meta??null};case"success":const l={...a,...O0(t.data,t.dataUpdatedAt),dataUpdateCount:a.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#e=t.manual?l:void 0,l;case"error":const s=t.error;return{...a,error:s,errorUpdateCount:a.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:a.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...a,isInvalidated:!0};case"setState":return{...a,...t.state}}};this.state=r(this.state),Dt.batch(()=>{this.observers.forEach(a=>{a.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:t})})}};function pS(t,r){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:fS(r.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function O0(t,r){return{data:t,dataUpdatedAt:r??Date.now(),error:null,isInvalidated:!1,status:"success"}}function D0(t){const r=typeof t.initialData=="function"?t.initialData():t.initialData,a=r!==void 0,l=a?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:r,dataUpdateCount:0,dataUpdatedAt:a?l??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:a?"success":"pending",fetchStatus:"idle"}}var Rs=class extends Xi{constructor(t,r){super(),this.options=r,this.#t=t,this.#l=null,this.#o=Rm(),this.bindMethods(),this.setOptions(r)}#t;#e=void 0;#n=void 0;#a=void 0;#r;#i;#o;#l;#h;#d;#f;#c;#u;#s;#p=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#e.addObserver(this),T0(this.#e,this.options)?this.#m():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Om(this.#e,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Om(this.#e,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#x(),this.#S(),this.#e.removeObserver(this)}setOptions(t){const r=this.options,a=this.#e;if(this.options=this.#t.defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof or(this.options.enabled,this.#e)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#w(),this.#e.setOptions(this.options),r._defaulted&&!hs(this.options,r)&&this.#t.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#e,observer:this});const l=this.hasListeners();l&&_0(this.#e,a,this.options,r)&&this.#m(),this.updateResult(),l&&(this.#e!==a||or(this.options.enabled,this.#e)!==or(r.enabled,this.#e)||ti(this.options.staleTime,this.#e)!==ti(r.staleTime,this.#e))&&this.#v();const s=this.#g();l&&(this.#e!==a||or(this.options.enabled,this.#e)!==or(r.enabled,this.#e)||s!==this.#s)&&this.#y(s)}getOptimisticResult(t){const r=this.#t.getQueryCache().build(this.#t,t),a=this.createResult(r,t);return cM(this,a)&&(this.#a=a,this.#i=this.options,this.#r=this.#e.state),a}getCurrentResult(){return this.#a}trackResult(t,r){return new Proxy(t,{get:(a,l)=>(this.trackProp(l),r?.(l),l==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#o.status==="pending"&&this.#o.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(a,l))})}trackProp(t){this.#p.add(t)}getCurrentQuery(){return this.#e}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const r=this.#t.defaultQueryOptions(t),a=this.#t.getQueryCache().build(this.#t,r);return a.fetch().then(()=>this.createResult(a,r))}fetch(t){return this.#m({...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#a))}#m(t){this.#w();let r=this.#e.fetch(this.options,t);return t?.throwOnError||(r=r.catch(fn)),r}#v(){this.#x();const t=ti(this.options.staleTime,this.#e);if(qi||this.#a.isStale||!Nm(t))return;const a=uS(this.#a.dataUpdatedAt,t)+1;this.#c=Pi.setTimeout(()=>{this.#a.isStale||this.updateResult()},a)}#g(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#e):this.options.refetchInterval)??!1}#y(t){this.#S(),this.#s=t,!(qi||or(this.options.enabled,this.#e)===!1||!Nm(this.#s)||this.#s===0)&&(this.#u=Pi.setInterval(()=>{(this.options.refetchIntervalInBackground||mp.isFocused())&&this.#m()},this.#s))}#b(){this.#v(),this.#y(this.#g())}#x(){this.#c&&(Pi.clearTimeout(this.#c),this.#c=void 0)}#S(){this.#u&&(Pi.clearInterval(this.#u),this.#u=void 0)}createResult(t,r){const a=this.#e,l=this.options,s=this.#a,c=this.#r,u=this.#i,m=t!==a?t.state:this.#n,{state:v}=t;let b={...v},y=!1,w;if(r._optimisticResults){const T=this.hasListeners(),A=!T&&T0(t,r),q=T&&_0(t,a,r,l);(A||q)&&(b={...b,...pS(v.data,t.options)}),r._optimisticResults==="isRestoring"&&(b.fetchStatus="idle")}let{error:C,errorUpdatedAt:E,status:S}=b;w=b.data;let R=!1;if(r.placeholderData!==void 0&&w===void 0&&S==="pending"){let T;s?.isPlaceholderData&&r.placeholderData===u?.placeholderData?(T=s.data,R=!0):T=typeof r.placeholderData=="function"?r.placeholderData(this.#f?.state.data,this.#f):r.placeholderData,T!==void 0&&(S="success",w=jm(s?.data,T,r),y=!0)}if(r.select&&w!==void 0&&!R)if(s&&w===c?.data&&r.select===this.#h)w=this.#d;else try{this.#h=r.select,w=r.select(w),w=jm(s?.data,w,r),this.#d=w,this.#l=null}catch(T){this.#l=T}this.#l&&(C=this.#l,w=this.#d,E=Date.now(),S="error");const M=b.fetchStatus==="fetching",O=S==="pending",_=S==="error",z=O&&M,k=w!==void 0,N={status:S,fetchStatus:b.fetchStatus,isPending:O,isSuccess:S==="success",isError:_,isInitialLoading:z,isLoading:z,data:w,dataUpdatedAt:b.dataUpdatedAt,error:C,errorUpdatedAt:E,failureCount:b.fetchFailureCount,failureReason:b.fetchFailureReason,errorUpdateCount:b.errorUpdateCount,isFetched:b.dataUpdateCount>0||b.errorUpdateCount>0,isFetchedAfterMount:b.dataUpdateCount>m.dataUpdateCount||b.errorUpdateCount>m.errorUpdateCount,isFetching:M,isRefetching:M&&!O,isLoadingError:_&&!k,isPaused:b.fetchStatus==="paused",isPlaceholderData:y,isRefetchError:_&&k,isStale:pp(t,r),refetch:this.refetch,promise:this.#o,isEnabled:or(r.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const T=K=>{N.status==="error"?K.reject(N.error):N.data!==void 0&&K.resolve(N.data)},A=()=>{const K=this.#o=N.promise=Rm();T(K)},q=this.#o;switch(q.status){case"pending":t.queryHash===a.queryHash&&T(q);break;case"fulfilled":(N.status==="error"||N.data!==q.value)&&A();break;case"rejected":(N.status!=="error"||N.error!==q.reason)&&A();break}}return N}updateResult(){const t=this.#a,r=this.createResult(this.#e,this.options);if(this.#r=this.#e.state,this.#i=this.options,this.#r.data!==void 0&&(this.#f=this.#e),hs(r,t))return;this.#a=r;const a=()=>{if(!t)return!0;const{notifyOnChangeProps:l}=this.options,s=typeof l=="function"?l():l;if(s==="all"||!s&&!this.#p.size)return!0;const c=new Set(s??this.#p);return this.options.throwOnError&&c.add("error"),Object.keys(this.#a).some(u=>{const d=u;return this.#a[d]!==t[d]&&c.has(d)})};this.#C({listeners:a()})}#w(){const t=this.#t.getQueryCache().build(this.#t,this.options);if(t===this.#e)return;const r=this.#e;this.#e=t,this.#n=t.state,this.hasListeners()&&(r?.removeObserver(this),t.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#C(t){Dt.batch(()=>{t.listeners&&this.listeners.forEach(r=>{r(this.#a)}),this.#t.getQueryCache().notify({query:this.#e,type:"observerResultsUpdated"})})}};function sM(t,r){return or(r.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&r.retryOnMount===!1)}function T0(t,r){return sM(t,r)||t.state.data!==void 0&&Om(t,r,r.refetchOnMount)}function Om(t,r,a){if(or(r.enabled,t)!==!1&&ti(r.staleTime,t)!=="static"){const l=typeof a=="function"?a(t):a;return l==="always"||l!==!1&&pp(t,r)}return!1}function _0(t,r,a,l){return(t!==r||or(l.enabled,t)===!1)&&(!a.suspense||t.state.status!=="error")&&pp(t,a)}function pp(t,r){return or(r.enabled,t)!==!1&&t.isStaleByTime(ti(r.staleTime,t))}function cM(t,r){return!hs(t.getCurrentResult(),r)}function Mu(t){return{onFetch:(r,a)=>{const l=r.options,s=r.fetchOptions?.meta?.fetchMore?.direction,c=r.state.data?.pages||[],u=r.state.data?.pageParams||[];let d={pages:[],pageParams:[]},m=0;const v=async()=>{let b=!1;const y=E=>{tM(E,()=>r.signal,()=>b=!0)},w=dS(r.options,r.fetchOptions),C=async(E,S,R)=>{if(b)return Promise.reject();if(S==null&&E.pages.length)return Promise.resolve(E);const O=(()=>{const I={client:r.client,queryKey:r.queryKey,pageParam:S,direction:R?"backward":"forward",meta:r.options.meta};return y(I),I})(),_=await w(O),{maxPages:z}=r.options,k=R?eM:WR;return{pages:k(E.pages,_,z),pageParams:k(E.pageParams,S,z)}};if(s&&c.length){const E=s==="backward",S=E?vS:Dm,R={pages:c,pageParams:u},M=S(l,R);d=await C(R,M,E)}else{const E=t??c.length;do{const S=m===0?u[0]??l.initialPageParam:Dm(l,d);if(m>0&&S==null)break;d=await C(d,S),m++}while(m<E)}return d};r.options.persister?r.fetchFn=()=>r.options.persister?.(v,{client:r.client,queryKey:r.queryKey,meta:r.options.meta,signal:r.signal},a):r.fetchFn=v}}}function Dm(t,{pages:r,pageParams:a}){const l=r.length-1;return r.length>0?t.getNextPageParam(r[l],r,a[l],a):void 0}function vS(t,{pages:r,pageParams:a}){return r.length>0?t.getPreviousPageParam?.(r[0],r,a[0],a):void 0}function uM(t,r){return r?Dm(t,r)!=null:!1}function dM(t,r){return!r||!t.getPreviousPageParam?!1:vS(t,r)!=null}var gS=class extends Rs{constructor(t,r){super(t,r)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(t){super.setOptions({...t,behavior:Mu()})}getOptimisticResult(t){return t.behavior=Mu(),super.getOptimisticResult(t)}fetchNextPage(t){return this.fetch({...t,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(t){return this.fetch({...t,meta:{fetchMore:{direction:"backward"}}})}createResult(t,r){const{state:a}=t,l=super.createResult(t,r),{isFetching:s,isRefetching:c,isError:u,isRefetchError:d}=l,m=a.fetchMeta?.fetchMore?.direction,v=u&&m==="forward",b=s&&m==="forward",y=u&&m==="backward",w=s&&m==="backward";return{...l,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:uM(r,a.data),hasPreviousPage:dM(r,a.data),isFetchNextPageError:v,isFetchingNextPage:b,isFetchPreviousPageError:y,isFetchingPreviousPage:w,isRefetchError:d&&!v&&!y,isRefetching:c&&!b&&!w}}},fM=class extends mS{#t;#e;#n;#a;constructor(t){super(),this.#t=t.client,this.mutationId=t.mutationId,this.#n=t.mutationCache,this.#e=[],this.state=t.state||yS(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){this.#e.includes(t)||(this.#e.push(t),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.#e=this.#e.filter(r=>r!==t),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.#e.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#a?.continue()??this.execute(this.state.variables)}async execute(t){const r=()=>{this.#r({type:"continue"})},a={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#a=hS({fn:()=>this.options.mutationFn?this.options.mutationFn(t,a):Promise.reject(new Error("No mutationFn found")),onFail:(c,u)=>{this.#r({type:"failed",failureCount:c,error:u})},onPause:()=>{this.#r({type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const l=this.state.status==="pending",s=!this.#a.canStart();try{if(l)r();else{this.#r({type:"pending",variables:t,isPaused:s}),await this.#n.config.onMutate?.(t,this,a);const u=await this.options.onMutate?.(t,a);u!==this.state.context&&this.#r({type:"pending",context:u,variables:t,isPaused:s})}const c=await this.#a.start();return await this.#n.config.onSuccess?.(c,t,this.state.context,this,a),await this.options.onSuccess?.(c,t,this.state.context,a),await this.#n.config.onSettled?.(c,null,this.state.variables,this.state.context,this,a),await this.options.onSettled?.(c,null,t,this.state.context,a),this.#r({type:"success",data:c}),c}catch(c){try{await this.#n.config.onError?.(c,t,this.state.context,this,a)}catch(u){Promise.reject(u)}try{await this.options.onError?.(c,t,this.state.context,a)}catch(u){Promise.reject(u)}try{await this.#n.config.onSettled?.(void 0,c,this.state.variables,this.state.context,this,a)}catch(u){Promise.reject(u)}try{await this.options.onSettled?.(void 0,c,t,this.state.context,a)}catch(u){Promise.reject(u)}throw this.#r({type:"error",error:c}),c}finally{this.#n.runNext(this)}}#r(t){const r=a=>{switch(t.type){case"failed":return{...a,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...a,isPaused:!0};case"continue":return{...a,isPaused:!1};case"pending":return{...a,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...a,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...a,data:void 0,error:t.error,failureCount:a.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=r(this.state),Dt.batch(()=>{this.#e.forEach(a=>{a.onMutationUpdate(t)}),this.#n.notify({mutation:this,type:"updated",action:t})})}};function yS(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var hM=class extends Xi{constructor(t={}){super(),this.config=t,this.#t=new Set,this.#e=new Map,this.#n=0}#t;#e;#n;build(t,r,a){const l=new fM({client:t,mutationCache:this,mutationId:++this.#n,options:t.defaultMutationOptions(r),state:a});return this.add(l),l}add(t){this.#t.add(t);const r=ru(t);if(typeof r=="string"){const a=this.#e.get(r);a?a.push(t):this.#e.set(r,[t])}this.notify({type:"added",mutation:t})}remove(t){if(this.#t.delete(t)){const r=ru(t);if(typeof r=="string"){const a=this.#e.get(r);if(a)if(a.length>1){const l=a.indexOf(t);l!==-1&&a.splice(l,1)}else a[0]===t&&this.#e.delete(r)}}this.notify({type:"removed",mutation:t})}canRun(t){const r=ru(t);if(typeof r=="string"){const l=this.#e.get(r)?.find(s=>s.state.status==="pending");return!l||l===t}else return!0}runNext(t){const r=ru(t);return typeof r=="string"?this.#e.get(r)?.find(l=>l!==t&&l.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Dt.batch(()=>{this.#t.forEach(t=>{this.notify({type:"removed",mutation:t})}),this.#t.clear(),this.#e.clear()})}getAll(){return Array.from(this.#t)}find(t){const r={exact:!0,...t};return this.getAll().find(a=>j0(r,a))}findAll(t={}){return this.getAll().filter(r=>j0(t,r))}notify(t){Dt.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){const t=this.getAll().filter(r=>r.state.isPaused);return Dt.batch(()=>Promise.all(t.map(r=>r.continue().catch(fn))))}};function ru(t){return t.options.scope?.id}var mM=class extends Xi{#t;#e=void 0;#n;#a;constructor(r,a){super(),this.#t=r,this.setOptions(a),this.bindMethods(),this.#r()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(r){const a=this.options;this.options=this.#t.defaultMutationOptions(r),hs(this.options,a)||this.#t.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),a?.mutationKey&&this.options.mutationKey&&ri(a.mutationKey)!==ri(this.options.mutationKey)?this.reset():this.#n?.state.status==="pending"&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(r){this.#r(),this.#i(r)}getCurrentResult(){return this.#e}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#r(),this.#i()}mutate(r,a){return this.#a=a,this.#n?.removeObserver(this),this.#n=this.#t.getMutationCache().build(this.#t,this.options),this.#n.addObserver(this),this.#n.execute(r)}#r(){const r=this.#n?.state??yS();this.#e={...r,isPending:r.status==="pending",isSuccess:r.status==="success",isError:r.status==="error",isIdle:r.status==="idle",mutate:this.mutate,reset:this.reset}}#i(r){Dt.batch(()=>{if(this.#a&&this.hasListeners()){const a=this.#e.variables,l=this.#e.context,s={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};if(r?.type==="success"){try{this.#a.onSuccess?.(r.data,a,l,s)}catch(c){Promise.reject(c)}try{this.#a.onSettled?.(r.data,null,a,l,s)}catch(c){Promise.reject(c)}}else if(r?.type==="error"){try{this.#a.onError?.(r.error,a,l,s)}catch(c){Promise.reject(c)}try{this.#a.onSettled?.(void 0,r.error,a,l,s)}catch(c){Promise.reject(c)}}}this.listeners.forEach(a=>{a(this.#e)})})}};function A0(t,r){const a=new Set(r);return t.filter(l=>!a.has(l))}function pM(t,r,a){const l=t.slice(0);return l[r]=a,l}var vM=class extends Xi{#t;#e;#n;#a;#r;#i;#o;#l;#h=[];constructor(t,r,a){super(),this.#t=t,this.#a=a,this.#n=[],this.#r=[],this.#e=[],this.setQueries(r)}onSubscribe(){this.listeners.size===1&&this.#r.forEach(t=>{t.subscribe(r=>{this.#u(t,r)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#r.forEach(t=>{t.destroy()})}setQueries(t,r){this.#n=t,this.#a=r,Dt.batch(()=>{const a=this.#r,l=this.#c(this.#n);l.forEach(b=>b.observer.setOptions(b.defaultedQueryOptions));const s=l.map(b=>b.observer),c=s.map(b=>b.getCurrentResult()),u=a.length!==s.length,d=s.some((b,y)=>b!==a[y]),m=u||d,v=m?!0:c.some((b,y)=>{const w=this.#e[y];return!w||!hs(b,w)});!m&&!v||(m&&(this.#h=l,this.#r=s),this.#e=c,this.hasListeners()&&(m&&(A0(a,s).forEach(b=>{b.destroy()}),A0(s,a).forEach(b=>{b.subscribe(y=>{this.#u(b,y)})})),this.#s()))})}getCurrentResult(){return this.#e}getQueries(){return this.#r.map(t=>t.getCurrentQuery())}getObservers(){return this.#r}getOptimisticResult(t,r){const a=this.#c(t),l=a.map(s=>s.observer.getOptimisticResult(s.defaultedQueryOptions));return[l,s=>this.#f(s??l,r),()=>this.#d(l,a)]}#d(t,r){return r.map((a,l)=>{const s=t[l];return a.defaultedQueryOptions.notifyOnChangeProps?s:a.observer.trackResult(s,c=>{r.forEach(u=>{u.observer.trackProp(c)})})})}#f(t,r){return r?((!this.#i||this.#e!==this.#l||r!==this.#o)&&(this.#o=r,this.#l=this.#e,this.#i=fp(this.#i,r(t))),this.#i):t}#c(t){const r=new Map;this.#r.forEach(l=>{const s=l.options.queryHash;if(!s)return;const c=r.get(s);c?c.push(l):r.set(s,[l])});const a=[];return t.forEach(l=>{const s=this.#t.defaultQueryOptions(l),u=r.get(s.queryHash)?.shift()??new Rs(this.#t,s);a.push({defaultedQueryOptions:s,observer:u})}),a}#u(t,r){const a=this.#r.indexOf(t);a!==-1&&(this.#e=pM(this.#e,a,r),this.#s())}#s(){if(this.hasListeners()){const t=this.#i,r=this.#d(this.#e,this.#h),a=this.#f(r,this.#a?.combine);t!==a&&Dt.batch(()=>{this.listeners.forEach(l=>{l(this.#e)})})}}},gM=class extends Xi{constructor(t={}){super(),this.config=t,this.#t=new Map}#t;build(t,r,a){const l=r.queryKey,s=r.queryHash??dp(l,r);let c=this.get(s);return c||(c=new oM({client:t,queryKey:l,queryHash:s,options:t.defaultQueryOptions(r),state:a,defaultOptions:t.getQueryDefaults(l)}),this.add(c)),c}add(t){this.#t.has(t.queryHash)||(this.#t.set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=this.#t.get(t.queryHash);r&&(t.destroy(),r===t&&this.#t.delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Dt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return this.#t.get(t)}getAll(){return[...this.#t.values()]}find(t){const r={exact:!0,...t};return this.getAll().find(a=>E0(r,a))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(a=>E0(t,a)):r}notify(t){Dt.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){Dt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Dt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},yM=class{#t;#e;#n;#a;#r;#i;#o;#l;constructor(t={}){this.#t=t.queryCache||new gM,this.#e=t.mutationCache||new hM,this.#n=t.defaultOptions||{},this.#a=new Map,this.#r=new Map,this.#i=0}mount(){this.#i++,this.#i===1&&(this.#o=mp.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#t.onFocus())}),this.#l=Ru.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#t.onOnline())}))}unmount(){this.#i--,this.#i===0&&(this.#o?.(),this.#o=void 0,this.#l?.(),this.#l=void 0)}isFetching(t){return this.#t.findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return this.#e.findAll({...t,status:"pending"}).length}getQueryData(t){const r=this.defaultQueryOptions({queryKey:t});return this.#t.get(r.queryHash)?.state.data}ensureQueryData(t){const r=this.defaultQueryOptions(t),a=this.#t.build(this,r),l=a.state.data;return l===void 0?this.fetchQuery(t):(t.revalidateIfStale&&a.isStaleByTime(ti(r.staleTime,a))&&this.prefetchQuery(r),Promise.resolve(l))}getQueriesData(t){return this.#t.findAll(t).map(({queryKey:r,state:a})=>{const l=a.data;return[r,l]})}setQueryData(t,r,a){const l=this.defaultQueryOptions({queryKey:t}),c=this.#t.get(l.queryHash)?.state.data,u=$R(r,c);if(u!==void 0)return this.#t.build(this,l).setData(u,{...a,manual:!0})}setQueriesData(t,r,a){return Dt.batch(()=>this.#t.findAll(t).map(({queryKey:l})=>[l,this.setQueryData(l,r,a)]))}getQueryState(t){const r=this.defaultQueryOptions({queryKey:t});return this.#t.get(r.queryHash)?.state}removeQueries(t){const r=this.#t;Dt.batch(()=>{r.findAll(t).forEach(a=>{r.remove(a)})})}resetQueries(t,r){const a=this.#t;return Dt.batch(()=>(a.findAll(t).forEach(l=>{l.reset()}),this.refetchQueries({type:"active",...t},r)))}cancelQueries(t,r={}){const a={revert:!0,...r},l=Dt.batch(()=>this.#t.findAll(t).map(s=>s.cancel(a)));return Promise.all(l).then(fn).catch(fn)}invalidateQueries(t,r={}){return Dt.batch(()=>(this.#t.findAll(t).forEach(a=>{a.invalidate()}),t?.refetchType==="none"?Promise.resolve():this.refetchQueries({...t,type:t?.refetchType??t?.type??"active"},r)))}refetchQueries(t,r={}){const a={...r,cancelRefetch:r.cancelRefetch??!0},l=Dt.batch(()=>this.#t.findAll(t).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let c=s.fetch(void 0,a);return a.throwOnError||(c=c.catch(fn)),s.state.fetchStatus==="paused"?Promise.resolve():c}));return Promise.all(l).then(fn)}fetchQuery(t){const r=this.defaultQueryOptions(t);r.retry===void 0&&(r.retry=!1);const a=this.#t.build(this,r);return a.isStaleByTime(ti(r.staleTime,a))?a.fetch(r):Promise.resolve(a.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(fn).catch(fn)}fetchInfiniteQuery(t){return t.behavior=Mu(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(fn).catch(fn)}ensureInfiniteQueryData(t){return t.behavior=Mu(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return Ru.isOnline()?this.#e.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#t}getMutationCache(){return this.#e}getDefaultOptions(){return this.#n}setDefaultOptions(t){this.#n=t}setQueryDefaults(t,r){this.#a.set(ri(t),{queryKey:t,defaultOptions:r})}getQueryDefaults(t){const r=[...this.#a.values()],a={};return r.forEach(l=>{fs(t,l.queryKey)&&Object.assign(a,l.defaultOptions)}),a}setMutationDefaults(t,r){this.#r.set(ri(t),{mutationKey:t,defaultOptions:r})}getMutationDefaults(t){const r=[...this.#r.values()],a={};return r.forEach(l=>{fs(t,l.mutationKey)&&Object.assign(a,l.defaultOptions)}),a}defaultQueryOptions(t){if(t._defaulted)return t;const r={...this.#n.queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return r.queryHash||(r.queryHash=dp(r.queryKey,r)),r.refetchOnReconnect===void 0&&(r.refetchOnReconnect=r.networkMode!=="always"),r.throwOnError===void 0&&(r.throwOnError=!!r.suspense),!r.networkMode&&r.persister&&(r.networkMode="offlineFirst"),r.queryFn===Gn&&(r.enabled=!1),r}defaultMutationOptions(t){return t?._defaulted?t:{...this.#n.mutations,...t?.mutationKey&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){this.#t.clear(),this.#e.clear()}},bS=g.createContext(void 0),Ms=t=>{const r=g.useContext(bS);if(t)return t;if(!r)throw new Error("No QueryClient set, use QueryClientProvider to set one");return r},bM=({client:t,children:r})=>(g.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),h.jsx(bS.Provider,{value:t,children:r})),xS=g.createContext(!1),SS=()=>g.useContext(xS);xS.Provider;function xM(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var SM=g.createContext(xM()),wS=()=>g.useContext(SM),CS=(t,r,a)=>{const l=a?.state.error&&typeof t.throwOnError=="function"?hp(t.throwOnError,[a.state.error,a]):t.throwOnError;(t.suspense||t.experimental_prefetchInRender||l)&&(r.isReset()||(t.retryOnMount=!1))},NS=t=>{g.useEffect(()=>{t.clearReset()},[t])},ES=({result:t,errorResetBoundary:r,throwOnError:a,query:l,suspense:s})=>t.isError&&!r.isReset()&&!t.isFetching&&l&&(s&&t.data===void 0||hp(a,[t.error,l])),vp=(t,r)=>r.state.data===void 0,jS=t=>{if(t.suspense){const a=s=>s==="static"?s:Math.max(s??1e3,1e3),l=t.staleTime;t.staleTime=typeof l=="function"?(...s)=>a(l(...s)):a(l),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3))}},RS=(t,r)=>t.isLoading&&t.isFetching&&!r,Tm=(t,r)=>t?.suspense&&r.isPending,Ou=(t,r,a)=>r.fetchOptimistic(t).catch(()=>{a.clearReset()});function MS({queries:t,...r},a){const l=Ms(a),s=SS(),c=wS(),u=g.useMemo(()=>t.map(S=>{const R=l.defaultQueryOptions(S);return R._optimisticResults=s?"isRestoring":"optimistic",R}),[t,l,s]);u.forEach(S=>{jS(S);const R=l.getQueryCache().get(S.queryHash);CS(S,c,R)}),NS(c);const[d]=g.useState(()=>new vM(l,u,r)),[m,v,b]=d.getOptimisticResult(u,r.combine),y=!s&&r.subscribed!==!1;g.useSyncExternalStore(g.useCallback(S=>y?d.subscribe(Dt.batchCalls(S)):fn,[d,y]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),g.useEffect(()=>{d.setQueries(u,r)},[u,r,d]);const C=m.some((S,R)=>Tm(u[R],S))?m.flatMap((S,R)=>{const M=u[R];if(M){const O=new Rs(l,M);if(Tm(M,S))return Ou(M,O,c);RS(S,s)&&Ou(M,O,c)}return[]}):[];if(C.length>0)throw Promise.all(C);const E=m.find((S,R)=>{const M=u[R];return M&&ES({result:S,errorResetBoundary:c,throwOnError:M.throwOnError,query:l.getQueryCache().get(M.queryHash),suspense:M.suspense})});if(E?.error)throw E.error;return v(b())}function Xu(t,r,a){const l=SS(),s=wS(),c=Ms(a),u=c.defaultQueryOptions(t);c.getDefaultOptions().queries?._experimental_beforeQuery?.(u);const d=c.getQueryCache().get(u.queryHash);u._optimisticResults=l?"isRestoring":"optimistic",jS(u),CS(u,s,d),NS(s);const m=!c.getQueryCache().get(u.queryHash),[v]=g.useState(()=>new r(c,u)),b=v.getOptimisticResult(u),y=!l&&t.subscribed!==!1;if(g.useSyncExternalStore(g.useCallback(w=>{const C=y?v.subscribe(Dt.batchCalls(w)):fn;return v.updateResult(),C},[v,y]),()=>v.getCurrentResult(),()=>v.getCurrentResult()),g.useEffect(()=>{v.setOptions(u)},[u,v]),Tm(u,b))throw Ou(u,v,s);if(ES({result:b,errorResetBoundary:s,throwOnError:u.throwOnError,query:d,suspense:u.suspense}))throw b.error;return c.getDefaultOptions().queries?._experimental_afterQuery?.(u,b),u.experimental_prefetchInRender&&!qi&&RS(b,l)&&(m?Ou(u,v,s):d?.promise)?.catch(fn).finally(()=>{v.updateResult()}),u.notifyOnChangeProps?b:v.trackResult(b)}function wM(t,r){return Xu(t,Rs,r)}function CM(t,r){return Xu({...t,enabled:!0,suspense:!0,throwOnError:vp,placeholderData:void 0},Rs,r)}function NM(t,r){return Xu({...t,enabled:!0,suspense:!0,throwOnError:vp},gS,r)}function EM(t,r){return MS({...t,queries:t.queries.map(a=>({...a,suspense:!0,throwOnError:vp,enabled:!0,placeholderData:void 0}))},r)}function jM(t,r){const a=Ms(r);a.getQueryState(t.queryKey)||a.prefetchQuery(t)}function RM(t,r){const a=Ms(r);a.getQueryState(t.queryKey)||a.prefetchInfiniteQuery(t)}function MM(t,r){const a=Ms(r),[l]=g.useState(()=>new mM(a,t));g.useEffect(()=>{l.setOptions(t)},[l,t]);const s=g.useSyncExternalStore(g.useCallback(u=>l.subscribe(Dt.batchCalls(u)),[l]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),c=g.useCallback((u,d)=>{l.mutate(u,d).catch(fn)},[l]);if(s.error&&hp(l.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:c,mutateAsync:s.mutate}}function OM(t,r){return Xu(t,gS,r)}const DM=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),TM=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(r,a,l)=>l?l.toUpperCase():a.toLowerCase()),z0=t=>{const r=TM(t);return r.charAt(0).toUpperCase()+r.slice(1)},OS=(...t)=>t.filter((r,a,l)=>!!r&&r.trim()!==""&&l.indexOf(r)===a).join(" ").trim(),_M=t=>{for(const r in t)if(r.startsWith("aria-")||r==="role"||r==="title")return!0};var AM={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 zM=g.forwardRef(({color:t="currentColor",size:r=24,strokeWidth:a=2,absoluteStrokeWidth:l,className:s="",children:c,iconNode:u,...d},m)=>g.createElement("svg",{ref:m,...AM,width:r,height:r,stroke:t,strokeWidth:l?Number(a)*24/Number(r):a,className:OS("lucide",s),...!c&&!_M(d)&&{"aria-hidden":"true"},...d},[...u.map(([v,b])=>g.createElement(v,b)),...Array.isArray(c)?c:[c]]));const Pe=(t,r)=>{const a=g.forwardRef(({className:l,...s},c)=>g.createElement(zM,{ref:c,iconNode:r,className:OS(`lucide-${DM(z0(t))}`,`lucide-${t}`,l),...s}));return a.displayName=z0(t),a};const LM=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],kM=Pe("arrow-left",LM);const PM=[["path",{d:"M10 12h4",key:"a56b0p"}],["path",{d:"M10 8h4",key:"1sr2af"}],["path",{d:"M14 21v-3a2 2 0 0 0-4 0v3",key:"1rgiei"}],["path",{d:"M6 10H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-2",key:"secmi2"}],["path",{d:"M6 21V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v16",key:"16ra0t"}]],ma=Pe("building-2",PM);const UM=[["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"}],["path",{d:"m9 16 2 2 4-4",key:"19s6y9"}]],ms=Pe("calendar-check",UM);const BM=[["path",{d:"M16 19h6",key:"xwg31i"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M19 16v6",key:"tddt3s"}],["path",{d:"M21 12.598V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h8.5",key:"1glfrc"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 2v4",key:"1cmpym"}]],HM=Pe("calendar-plus",BM);const qM=[["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"}]],Os=Pe("calendar",qM);const IM=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],DS=Pe("check",IM);const QM=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],$u=Pe("chevron-down",QM);const VM=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],TS=Pe("chevron-right",VM);const FM=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],GM=Pe("chevron-up",FM);const YM=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],ps=Pe("circle-check",YM);const KM=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],XM=Pe("circle-x",KM);const $M=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],gp=Pe("circle",$M);const ZM=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]],Ui=Pe("clipboard-list",ZM);const JM=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],WM=Pe("clock",JM);const eO=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],tO=Pe("database",eO);const nO=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],rO=Pe("ellipsis",nO);const aO=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],_S=Pe("external-link",aO);const iO=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],lO=Pe("eye",iO);const oO=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m9 15 2 2 4-4",key:"1grp1n"}]],sO=Pe("file-check",oO);const cO=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],uO=Pe("file-text",cO);const dO=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],yp=Pe("globe",dO);const fO=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],hO=Pe("grip-vertical",fO);const mO=[["path",{d:"m11 17 2 2a1 1 0 1 0 3-3",key:"efffak"}],["path",{d:"m14 14 2.5 2.5a1 1 0 1 0 3-3l-3.88-3.88a3 3 0 0 0-4.24 0l-.88.88a1 1 0 1 1-3-3l2.81-2.81a5.79 5.79 0 0 1 7.06-.87l.47.28a2 2 0 0 0 1.42.25L21 4",key:"9pr0kb"}],["path",{d:"m21 3 1 11h-2",key:"1tisrp"}],["path",{d:"M3 3 2 14l6.5 6.5a1 1 0 1 0 3-3",key:"1uvwmv"}],["path",{d:"M3 4h8",key:"1ep09j"}]],ni=Pe("handshake",mO);const pO=[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]],vO=Pe("layout-grid",pO);const gO=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Yn=Pe("loader-circle",gO);const yO=[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]],bp=Pe("mail",yO);const bO=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],xO=Pe("message-square",bO);const SO=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],wO=Pe("moon",SO);const CO=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]],NO=Pe("panel-left-close",CO);const EO=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],jO=Pe("panel-left",EO);const RO=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],MO=Pe("pencil",RO);const OO=[["path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",key:"9njp5v"}]],pa=Pe("phone",OO);const DO=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],$i=Pe("plus",DO);const TO=[["path",{d:"M2 3h20",key:"91anmk"}],["path",{d:"M21 3v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V3",key:"2k9sn8"}],["path",{d:"m7 21 5-5 5 5",key:"bip4we"}]],Zu=Pe("presentation",TO);const _O=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],AO=Pe("search",_O);const zO=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],LO=Pe("sparkles",zO);const kO=[["path",{d:"M21 9a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 15 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2z",key:"1dfntj"}],["path",{d:"M15 3v5a1 1 0 0 0 1 1h5",key:"6s6qgf"}]],PO=Pe("sticky-note",kO);const UO=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],BO=Pe("sun",UO);const HO=[["path",{d:"M12 3v18",key:"108xh3"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}]],qO=Pe("table",HO);const IO=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],AS=Pe("trash-2",IO);const QO=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],zn=Pe("users",QO);const VO=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],xp=Pe("x",VO);function L0(t,r){if(typeof t=="function")return t(r);t!=null&&(t.current=r)}function Ds(...t){return r=>{let a=!1;const l=t.map(s=>{const c=L0(s,r);return!a&&typeof c=="function"&&(a=!0),c});if(a)return()=>{for(let s=0;s<l.length;s++){const c=l[s];typeof c=="function"?c():L0(t[s],null)}}}}function mt(...t){return g.useCallback(Ds(...t),t)}var FO=Symbol.for("react.lazy"),Du=Cs[" use ".trim().toString()];function GO(t){return typeof t=="object"&&t!==null&&"then"in t}function zS(t){return t!=null&&typeof t=="object"&&"$$typeof"in t&&t.$$typeof===FO&&"_payload"in t&&GO(t._payload)}function LS(t){const r=KO(t),a=g.forwardRef((l,s)=>{let{children:c,...u}=l;zS(c)&&typeof Du=="function"&&(c=Du(c._payload));const d=g.Children.toArray(c),m=d.find($O);if(m){const v=m.props.children,b=d.map(y=>y===m?g.Children.count(v)>1?g.Children.only(null):g.isValidElement(v)?v.props.children:null:y);return h.jsx(r,{...u,ref:s,children:g.isValidElement(v)?g.cloneElement(v,void 0,b):null})}return h.jsx(r,{...u,ref:s,children:c})});return a.displayName=`${t}.Slot`,a}var YO=LS("Slot");function KO(t){const r=g.forwardRef((a,l)=>{let{children:s,...c}=a;if(zS(s)&&typeof Du=="function"&&(s=Du(s._payload)),g.isValidElement(s)){const u=JO(s),d=ZO(c,s.props);return s.type!==g.Fragment&&(d.ref=l?Ds(l,u):u),g.cloneElement(s,d)}return g.Children.count(s)>1?g.Children.only(null):null});return r.displayName=`${t}.SlotClone`,r}var XO=Symbol("radix.slottable");function $O(t){return g.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===XO}function ZO(t,r){const a={...r};for(const l in r){const s=t[l],c=r[l];/^on[A-Z]/.test(l)?s&&c?a[l]=(...d)=>{const m=c(...d);return s(...d),m}:s&&(a[l]=s):l==="style"?a[l]={...s,...c}:l==="className"&&(a[l]=[s,c].filter(Boolean).join(" "))}return{...t,...a}}function JO(t){let r=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,a=r&&"isReactWarning"in r&&r.isReactWarning;return a?t.ref:(r=Object.getOwnPropertyDescriptor(t,"ref")?.get,a=r&&"isReactWarning"in r&&r.isReactWarning,a?t.props.ref:t.props.ref||t.ref)}function kS(t){var r,a,l="";if(typeof t=="string"||typeof t=="number")l+=t;else if(typeof t=="object")if(Array.isArray(t)){var s=t.length;for(r=0;r<s;r++)t[r]&&(a=kS(t[r]))&&(l&&(l+=" "),l+=a)}else for(a in t)t[a]&&(l&&(l+=" "),l+=a);return l}function PS(){for(var t,r,a=0,l="",s=arguments.length;a<s;a++)(t=arguments[a])&&(r=kS(t))&&(l&&(l+=" "),l+=r);return l}const k0=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,P0=PS,Ts=(t,r)=>a=>{var l;if(r?.variants==null)return P0(t,a?.class,a?.className);const{variants:s,defaultVariants:c}=r,u=Object.keys(s).map(v=>{const b=a?.[v],y=c?.[v];if(b===null)return null;const w=k0(b)||k0(y);return s[v][w]}),d=a&&Object.entries(a).reduce((v,b)=>{let[y,w]=b;return w===void 0||(v[y]=w),v},{}),m=r==null||(l=r.compoundVariants)===null||l===void 0?void 0:l.reduce((v,b)=>{let{class:y,className:w,...C}=b;return Object.entries(C).every(E=>{let[S,R]=E;return Array.isArray(R)?R.includes({...c,...d}[S]):{...c,...d}[S]===R})?[...v,y,w]:v},[]);return P0(t,u,m,a?.class,a?.className)},WO=(t,r)=>{const a=new Array(t.length+r.length);for(let l=0;l<t.length;l++)a[l]=t[l];for(let l=0;l<r.length;l++)a[t.length+l]=r[l];return a},eD=(t,r)=>({classGroupId:t,validator:r}),US=(t=new Map,r=null,a)=>({nextPart:t,validators:r,classGroupId:a}),Tu="-",U0=[],tD="arbitrary..",nD=t=>{const r=aD(t),{conflictingClassGroups:a,conflictingClassGroupModifiers:l}=t;return{getClassGroupId:u=>{if(u.startsWith("[")&&u.endsWith("]"))return rD(u);const d=u.split(Tu),m=d[0]===""&&d.length>1?1:0;return BS(d,m,r)},getConflictingClassGroupIds:(u,d)=>{if(d){const m=l[u],v=a[u];return m?v?WO(v,m):m:v||U0}return a[u]||U0}}},BS=(t,r,a)=>{if(t.length-r===0)return a.classGroupId;const s=t[r],c=a.nextPart.get(s);if(c){const v=BS(t,r+1,c);if(v)return v}const u=a.validators;if(u===null)return;const d=r===0?t.join(Tu):t.slice(r).join(Tu),m=u.length;for(let v=0;v<m;v++){const b=u[v];if(b.validator(d))return b.classGroupId}},rD=t=>t.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const r=t.slice(1,-1),a=r.indexOf(":"),l=r.slice(0,a);return l?tD+l:void 0})(),aD=t=>{const{theme:r,classGroups:a}=t;return iD(a,r)},iD=(t,r)=>{const a=US();for(const l in t){const s=t[l];Sp(s,a,l,r)}return a},Sp=(t,r,a,l)=>{const s=t.length;for(let c=0;c<s;c++){const u=t[c];lD(u,r,a,l)}},lD=(t,r,a,l)=>{if(typeof t=="string"){oD(t,r,a);return}if(typeof t=="function"){sD(t,r,a,l);return}cD(t,r,a,l)},oD=(t,r,a)=>{const l=t===""?r:HS(r,t);l.classGroupId=a},sD=(t,r,a,l)=>{if(uD(t)){Sp(t(l),r,a,l);return}r.validators===null&&(r.validators=[]),r.validators.push(eD(a,t))},cD=(t,r,a,l)=>{const s=Object.entries(t),c=s.length;for(let u=0;u<c;u++){const[d,m]=s[u];Sp(m,HS(r,d),a,l)}},HS=(t,r)=>{let a=t;const l=r.split(Tu),s=l.length;for(let c=0;c<s;c++){const u=l[c];let d=a.nextPart.get(u);d||(d=US(),a.nextPart.set(u,d)),a=d}return a},uD=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,dD=t=>{if(t<1)return{get:()=>{},set:()=>{}};let r=0,a=Object.create(null),l=Object.create(null);const s=(c,u)=>{a[c]=u,r++,r>t&&(r=0,l=a,a=Object.create(null))};return{get(c){let u=a[c];if(u!==void 0)return u;if((u=l[c])!==void 0)return s(c,u),u},set(c,u){c in a?a[c]=u:s(c,u)}}},_m="!",B0=":",fD=[],H0=(t,r,a,l,s)=>({modifiers:t,hasImportantModifier:r,baseClassName:a,maybePostfixModifierPosition:l,isExternal:s}),hD=t=>{const{prefix:r,experimentalParseClassName:a}=t;let l=s=>{const c=[];let u=0,d=0,m=0,v;const b=s.length;for(let S=0;S<b;S++){const R=s[S];if(u===0&&d===0){if(R===B0){c.push(s.slice(m,S)),m=S+1;continue}if(R==="/"){v=S;continue}}R==="["?u++:R==="]"?u--:R==="("?d++:R===")"&&d--}const y=c.length===0?s:s.slice(m);let w=y,C=!1;y.endsWith(_m)?(w=y.slice(0,-1),C=!0):y.startsWith(_m)&&(w=y.slice(1),C=!0);const E=v&&v>m?v-m:void 0;return H0(c,C,w,E)};if(r){const s=r+B0,c=l;l=u=>u.startsWith(s)?c(u.slice(s.length)):H0(fD,!1,u,void 0,!0)}if(a){const s=l;l=c=>a({className:c,parseClassName:s})}return l},mD=t=>{const r=new Map;return t.orderSensitiveModifiers.forEach((a,l)=>{r.set(a,1e6+l)}),a=>{const l=[];let s=[];for(let c=0;c<a.length;c++){const u=a[c],d=u[0]==="[",m=r.has(u);d||m?(s.length>0&&(s.sort(),l.push(...s),s=[]),l.push(u)):s.push(u)}return s.length>0&&(s.sort(),l.push(...s)),l}},pD=t=>({cache:dD(t.cacheSize),parseClassName:hD(t),sortModifiers:mD(t),...nD(t)}),vD=/\s+/,gD=(t,r)=>{const{parseClassName:a,getClassGroupId:l,getConflictingClassGroupIds:s,sortModifiers:c}=r,u=[],d=t.trim().split(vD);let m="";for(let v=d.length-1;v>=0;v-=1){const b=d[v],{isExternal:y,modifiers:w,hasImportantModifier:C,baseClassName:E,maybePostfixModifierPosition:S}=a(b);if(y){m=b+(m.length>0?" "+m:m);continue}let R=!!S,M=l(R?E.substring(0,S):E);if(!M){if(!R){m=b+(m.length>0?" "+m:m);continue}if(M=l(E),!M){m=b+(m.length>0?" "+m:m);continue}R=!1}const O=w.length===0?"":w.length===1?w[0]:c(w).join(":"),_=C?O+_m:O,z=_+M;if(u.indexOf(z)>-1)continue;u.push(z);const k=s(M,R);for(let I=0;I<k.length;++I){const N=k[I];u.push(_+N)}m=b+(m.length>0?" "+m:m)}return m},yD=(...t)=>{let r=0,a,l,s="";for(;r<t.length;)(a=t[r++])&&(l=qS(a))&&(s&&(s+=" "),s+=l);return s},qS=t=>{if(typeof t=="string")return t;let r,a="";for(let l=0;l<t.length;l++)t[l]&&(r=qS(t[l]))&&(a&&(a+=" "),a+=r);return a},bD=(t,...r)=>{let a,l,s,c;const u=m=>{const v=r.reduce((b,y)=>y(b),t());return a=pD(v),l=a.cache.get,s=a.cache.set,c=d,d(m)},d=m=>{const v=l(m);if(v)return v;const b=gD(m,a);return s(m,b),b};return c=u,(...m)=>c(yD(...m))},xD=[],Kt=t=>{const r=a=>a[t]||xD;return r.isThemeGetter=!0,r},IS=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,QS=/^\((?:(\w[\w-]*):)?(.+)\)$/i,SD=/^\d+\/\d+$/,wD=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,CD=/\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$/,ND=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ED=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,jD=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Pl=t=>SD.test(t),He=t=>!!t&&!Number.isNaN(Number(t)),$a=t=>!!t&&Number.isInteger(Number(t)),em=t=>t.endsWith("%")&&He(t.slice(0,-1)),da=t=>wD.test(t),RD=()=>!0,MD=t=>CD.test(t)&&!ND.test(t),VS=()=>!1,OD=t=>ED.test(t),DD=t=>jD.test(t),TD=t=>!Ne(t)&&!Ee(t),_D=t=>Jl(t,YS,VS),Ne=t=>IS.test(t),_i=t=>Jl(t,KS,MD),tm=t=>Jl(t,PD,He),q0=t=>Jl(t,FS,VS),AD=t=>Jl(t,GS,DD),au=t=>Jl(t,XS,OD),Ee=t=>QS.test(t),ts=t=>Wl(t,KS),zD=t=>Wl(t,UD),I0=t=>Wl(t,FS),LD=t=>Wl(t,YS),kD=t=>Wl(t,GS),iu=t=>Wl(t,XS,!0),Jl=(t,r,a)=>{const l=IS.exec(t);return l?l[1]?r(l[1]):a(l[2]):!1},Wl=(t,r,a=!1)=>{const l=QS.exec(t);return l?l[1]?r(l[1]):a:!1},FS=t=>t==="position"||t==="percentage",GS=t=>t==="image"||t==="url",YS=t=>t==="length"||t==="size"||t==="bg-size",KS=t=>t==="length",PD=t=>t==="number",UD=t=>t==="family-name",XS=t=>t==="shadow",BD=()=>{const t=Kt("color"),r=Kt("font"),a=Kt("text"),l=Kt("font-weight"),s=Kt("tracking"),c=Kt("leading"),u=Kt("breakpoint"),d=Kt("container"),m=Kt("spacing"),v=Kt("radius"),b=Kt("shadow"),y=Kt("inset-shadow"),w=Kt("text-shadow"),C=Kt("drop-shadow"),E=Kt("blur"),S=Kt("perspective"),R=Kt("aspect"),M=Kt("ease"),O=Kt("animate"),_=()=>["auto","avoid","all","avoid-page","page","left","right","column"],z=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],k=()=>[...z(),Ee,Ne],I=()=>["auto","hidden","clip","visible","scroll"],N=()=>["auto","contain","none"],T=()=>[Ee,Ne,m],A=()=>[Pl,"full","auto",...T()],q=()=>[$a,"none","subgrid",Ee,Ne],K=()=>["auto",{span:["full",$a,Ee,Ne]},$a,Ee,Ne],W=()=>[$a,"auto",Ee,Ne],ue=()=>["auto","min","max","fr",Ee,Ne],le=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],de=()=>["start","end","center","stretch","center-safe","end-safe"],L=()=>["auto",...T()],G=()=>[Pl,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...T()],B=()=>[t,Ee,Ne],ee=()=>[...z(),I0,q0,{position:[Ee,Ne]}],ie=()=>["no-repeat",{repeat:["","x","y","space","round"]}],D=()=>["auto","cover","contain",LD,_D,{size:[Ee,Ne]}],Q=()=>[em,ts,_i],J=()=>["","none","full",v,Ee,Ne],ne=()=>["",He,ts,_i],fe=()=>["solid","dashed","dotted","double"],me=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],re=()=>[He,em,I0,q0],De=()=>["","none",E,Ee,Ne],Ae=()=>["none",He,Ee,Ne],Te=()=>["none",He,Ee,Ne],Ue=()=>[He,Ee,Ne],he=()=>[Pl,"full",...T()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[da],breakpoint:[da],color:[RD],container:[da],"drop-shadow":[da],ease:["in","out","in-out"],font:[TD],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[da],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[da],shadow:[da],spacing:["px",He],text:[da],"text-shadow":[da],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Pl,Ne,Ee,R]}],container:["container"],columns:[{columns:[He,Ne,Ee,d]}],"break-after":[{"break-after":_()}],"break-before":[{"break-before":_()}],"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:k()}],overflow:[{overflow:I()}],"overflow-x":[{"overflow-x":I()}],"overflow-y":[{"overflow-y":I()}],overscroll:[{overscroll:N()}],"overscroll-x":[{"overscroll-x":N()}],"overscroll-y":[{"overscroll-y":N()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:A()}],"inset-x":[{"inset-x":A()}],"inset-y":[{"inset-y":A()}],start:[{start:A()}],end:[{end:A()}],top:[{top:A()}],right:[{right:A()}],bottom:[{bottom:A()}],left:[{left:A()}],visibility:["visible","invisible","collapse"],z:[{z:[$a,"auto",Ee,Ne]}],basis:[{basis:[Pl,"full","auto",d,...T()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[He,Pl,"auto","initial","none",Ne]}],grow:[{grow:["",He,Ee,Ne]}],shrink:[{shrink:["",He,Ee,Ne]}],order:[{order:[$a,"first","last","none",Ee,Ne]}],"grid-cols":[{"grid-cols":q()}],"col-start-end":[{col:K()}],"col-start":[{"col-start":W()}],"col-end":[{"col-end":W()}],"grid-rows":[{"grid-rows":q()}],"row-start-end":[{row:K()}],"row-start":[{"row-start":W()}],"row-end":[{"row-end":W()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":ue()}],"auto-rows":[{"auto-rows":ue()}],gap:[{gap:T()}],"gap-x":[{"gap-x":T()}],"gap-y":[{"gap-y":T()}],"justify-content":[{justify:[...le(),"normal"]}],"justify-items":[{"justify-items":[...de(),"normal"]}],"justify-self":[{"justify-self":["auto",...de()]}],"align-content":[{content:["normal",...le()]}],"align-items":[{items:[...de(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...de(),{baseline:["","last"]}]}],"place-content":[{"place-content":le()}],"place-items":[{"place-items":[...de(),"baseline"]}],"place-self":[{"place-self":["auto",...de()]}],p:[{p:T()}],px:[{px:T()}],py:[{py:T()}],ps:[{ps:T()}],pe:[{pe:T()}],pt:[{pt:T()}],pr:[{pr:T()}],pb:[{pb:T()}],pl:[{pl:T()}],m:[{m:L()}],mx:[{mx:L()}],my:[{my:L()}],ms:[{ms:L()}],me:[{me:L()}],mt:[{mt:L()}],mr:[{mr:L()}],mb:[{mb:L()}],ml:[{ml:L()}],"space-x":[{"space-x":T()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":T()}],"space-y-reverse":["space-y-reverse"],size:[{size:G()}],w:[{w:[d,"screen",...G()]}],"min-w":[{"min-w":[d,"screen","none",...G()]}],"max-w":[{"max-w":[d,"screen","none","prose",{screen:[u]},...G()]}],h:[{h:["screen","lh",...G()]}],"min-h":[{"min-h":["screen","lh","none",...G()]}],"max-h":[{"max-h":["screen","lh",...G()]}],"font-size":[{text:["base",a,ts,_i]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[l,Ee,tm]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",em,Ne]}],"font-family":[{font:[zD,Ne,r]}],"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:[s,Ee,Ne]}],"line-clamp":[{"line-clamp":[He,"none",Ee,tm]}],leading:[{leading:[c,...T()]}],"list-image":[{"list-image":["none",Ee,Ne]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ee,Ne]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:B()}],"text-color":[{text:B()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...fe(),"wavy"]}],"text-decoration-thickness":[{decoration:[He,"from-font","auto",Ee,_i]}],"text-decoration-color":[{decoration:B()}],"underline-offset":[{"underline-offset":[He,"auto",Ee,Ne]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:T()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ee,Ne]}],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",Ee,Ne]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:ee()}],"bg-repeat":[{bg:ie()}],"bg-size":[{bg:D()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},$a,Ee,Ne],radial:["",Ee,Ne],conic:[$a,Ee,Ne]},kD,AD]}],"bg-color":[{bg:B()}],"gradient-from-pos":[{from:Q()}],"gradient-via-pos":[{via:Q()}],"gradient-to-pos":[{to:Q()}],"gradient-from":[{from:B()}],"gradient-via":[{via:B()}],"gradient-to":[{to:B()}],rounded:[{rounded:J()}],"rounded-s":[{"rounded-s":J()}],"rounded-e":[{"rounded-e":J()}],"rounded-t":[{"rounded-t":J()}],"rounded-r":[{"rounded-r":J()}],"rounded-b":[{"rounded-b":J()}],"rounded-l":[{"rounded-l":J()}],"rounded-ss":[{"rounded-ss":J()}],"rounded-se":[{"rounded-se":J()}],"rounded-ee":[{"rounded-ee":J()}],"rounded-es":[{"rounded-es":J()}],"rounded-tl":[{"rounded-tl":J()}],"rounded-tr":[{"rounded-tr":J()}],"rounded-br":[{"rounded-br":J()}],"rounded-bl":[{"rounded-bl":J()}],"border-w":[{border:ne()}],"border-w-x":[{"border-x":ne()}],"border-w-y":[{"border-y":ne()}],"border-w-s":[{"border-s":ne()}],"border-w-e":[{"border-e":ne()}],"border-w-t":[{"border-t":ne()}],"border-w-r":[{"border-r":ne()}],"border-w-b":[{"border-b":ne()}],"border-w-l":[{"border-l":ne()}],"divide-x":[{"divide-x":ne()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ne()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...fe(),"hidden","none"]}],"divide-style":[{divide:[...fe(),"hidden","none"]}],"border-color":[{border:B()}],"border-color-x":[{"border-x":B()}],"border-color-y":[{"border-y":B()}],"border-color-s":[{"border-s":B()}],"border-color-e":[{"border-e":B()}],"border-color-t":[{"border-t":B()}],"border-color-r":[{"border-r":B()}],"border-color-b":[{"border-b":B()}],"border-color-l":[{"border-l":B()}],"divide-color":[{divide:B()}],"outline-style":[{outline:[...fe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[He,Ee,Ne]}],"outline-w":[{outline:["",He,ts,_i]}],"outline-color":[{outline:B()}],shadow:[{shadow:["","none",b,iu,au]}],"shadow-color":[{shadow:B()}],"inset-shadow":[{"inset-shadow":["none",y,iu,au]}],"inset-shadow-color":[{"inset-shadow":B()}],"ring-w":[{ring:ne()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:B()}],"ring-offset-w":[{"ring-offset":[He,_i]}],"ring-offset-color":[{"ring-offset":B()}],"inset-ring-w":[{"inset-ring":ne()}],"inset-ring-color":[{"inset-ring":B()}],"text-shadow":[{"text-shadow":["none",w,iu,au]}],"text-shadow-color":[{"text-shadow":B()}],opacity:[{opacity:[He,Ee,Ne]}],"mix-blend":[{"mix-blend":[...me(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":me()}],"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":[He]}],"mask-image-linear-from-pos":[{"mask-linear-from":re()}],"mask-image-linear-to-pos":[{"mask-linear-to":re()}],"mask-image-linear-from-color":[{"mask-linear-from":B()}],"mask-image-linear-to-color":[{"mask-linear-to":B()}],"mask-image-t-from-pos":[{"mask-t-from":re()}],"mask-image-t-to-pos":[{"mask-t-to":re()}],"mask-image-t-from-color":[{"mask-t-from":B()}],"mask-image-t-to-color":[{"mask-t-to":B()}],"mask-image-r-from-pos":[{"mask-r-from":re()}],"mask-image-r-to-pos":[{"mask-r-to":re()}],"mask-image-r-from-color":[{"mask-r-from":B()}],"mask-image-r-to-color":[{"mask-r-to":B()}],"mask-image-b-from-pos":[{"mask-b-from":re()}],"mask-image-b-to-pos":[{"mask-b-to":re()}],"mask-image-b-from-color":[{"mask-b-from":B()}],"mask-image-b-to-color":[{"mask-b-to":B()}],"mask-image-l-from-pos":[{"mask-l-from":re()}],"mask-image-l-to-pos":[{"mask-l-to":re()}],"mask-image-l-from-color":[{"mask-l-from":B()}],"mask-image-l-to-color":[{"mask-l-to":B()}],"mask-image-x-from-pos":[{"mask-x-from":re()}],"mask-image-x-to-pos":[{"mask-x-to":re()}],"mask-image-x-from-color":[{"mask-x-from":B()}],"mask-image-x-to-color":[{"mask-x-to":B()}],"mask-image-y-from-pos":[{"mask-y-from":re()}],"mask-image-y-to-pos":[{"mask-y-to":re()}],"mask-image-y-from-color":[{"mask-y-from":B()}],"mask-image-y-to-color":[{"mask-y-to":B()}],"mask-image-radial":[{"mask-radial":[Ee,Ne]}],"mask-image-radial-from-pos":[{"mask-radial-from":re()}],"mask-image-radial-to-pos":[{"mask-radial-to":re()}],"mask-image-radial-from-color":[{"mask-radial-from":B()}],"mask-image-radial-to-color":[{"mask-radial-to":B()}],"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":z()}],"mask-image-conic-pos":[{"mask-conic":[He]}],"mask-image-conic-from-pos":[{"mask-conic-from":re()}],"mask-image-conic-to-pos":[{"mask-conic-to":re()}],"mask-image-conic-from-color":[{"mask-conic-from":B()}],"mask-image-conic-to-color":[{"mask-conic-to":B()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:ee()}],"mask-repeat":[{mask:ie()}],"mask-size":[{mask:D()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ee,Ne]}],filter:[{filter:["","none",Ee,Ne]}],blur:[{blur:De()}],brightness:[{brightness:[He,Ee,Ne]}],contrast:[{contrast:[He,Ee,Ne]}],"drop-shadow":[{"drop-shadow":["","none",C,iu,au]}],"drop-shadow-color":[{"drop-shadow":B()}],grayscale:[{grayscale:["",He,Ee,Ne]}],"hue-rotate":[{"hue-rotate":[He,Ee,Ne]}],invert:[{invert:["",He,Ee,Ne]}],saturate:[{saturate:[He,Ee,Ne]}],sepia:[{sepia:["",He,Ee,Ne]}],"backdrop-filter":[{"backdrop-filter":["","none",Ee,Ne]}],"backdrop-blur":[{"backdrop-blur":De()}],"backdrop-brightness":[{"backdrop-brightness":[He,Ee,Ne]}],"backdrop-contrast":[{"backdrop-contrast":[He,Ee,Ne]}],"backdrop-grayscale":[{"backdrop-grayscale":["",He,Ee,Ne]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[He,Ee,Ne]}],"backdrop-invert":[{"backdrop-invert":["",He,Ee,Ne]}],"backdrop-opacity":[{"backdrop-opacity":[He,Ee,Ne]}],"backdrop-saturate":[{"backdrop-saturate":[He,Ee,Ne]}],"backdrop-sepia":[{"backdrop-sepia":["",He,Ee,Ne]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":T()}],"border-spacing-x":[{"border-spacing-x":T()}],"border-spacing-y":[{"border-spacing-y":T()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ee,Ne]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[He,"initial",Ee,Ne]}],ease:[{ease:["linear","initial",M,Ee,Ne]}],delay:[{delay:[He,Ee,Ne]}],animate:[{animate:["none",O,Ee,Ne]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,Ee,Ne]}],"perspective-origin":[{"perspective-origin":k()}],rotate:[{rotate:Ae()}],"rotate-x":[{"rotate-x":Ae()}],"rotate-y":[{"rotate-y":Ae()}],"rotate-z":[{"rotate-z":Ae()}],scale:[{scale:Te()}],"scale-x":[{"scale-x":Te()}],"scale-y":[{"scale-y":Te()}],"scale-z":[{"scale-z":Te()}],"scale-3d":["scale-3d"],skew:[{skew:Ue()}],"skew-x":[{"skew-x":Ue()}],"skew-y":[{"skew-y":Ue()}],transform:[{transform:[Ee,Ne,"","none","gpu","cpu"]}],"transform-origin":[{origin:k()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:he()}],"translate-x":[{"translate-x":he()}],"translate-y":[{"translate-y":he()}],"translate-z":[{"translate-z":he()}],"translate-none":["translate-none"],accent:[{accent:B()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:B()}],"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",Ee,Ne]}],"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":T()}],"scroll-mx":[{"scroll-mx":T()}],"scroll-my":[{"scroll-my":T()}],"scroll-ms":[{"scroll-ms":T()}],"scroll-me":[{"scroll-me":T()}],"scroll-mt":[{"scroll-mt":T()}],"scroll-mr":[{"scroll-mr":T()}],"scroll-mb":[{"scroll-mb":T()}],"scroll-ml":[{"scroll-ml":T()}],"scroll-p":[{"scroll-p":T()}],"scroll-px":[{"scroll-px":T()}],"scroll-py":[{"scroll-py":T()}],"scroll-ps":[{"scroll-ps":T()}],"scroll-pe":[{"scroll-pe":T()}],"scroll-pt":[{"scroll-pt":T()}],"scroll-pr":[{"scroll-pr":T()}],"scroll-pb":[{"scroll-pb":T()}],"scroll-pl":[{"scroll-pl":T()}],"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",Ee,Ne]}],fill:[{fill:["none",...B()]}],"stroke-w":[{stroke:[He,ts,_i,tm]}],stroke:[{stroke:["none",...B()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","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","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","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-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-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-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-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"]}},HD=bD(BD);function ye(...t){return HD(PS(t))}const qD=Ts("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-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 ring-offset-background",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),Ge=g.forwardRef(({className:t,variant:r,size:a,asChild:l=!1,...s},c)=>{const u=l?YO:"button";return h.jsx(u,{className:ye(qD({variant:r,size:a,className:t})),ref:c,...s})});Ge.displayName="Button";function Re(t,r,{checkForDefaultPrevented:a=!0}={}){return function(s){if(t?.(s),a===!1||!s.defaultPrevented)return r?.(s)}}function ID(t,r){const a=g.createContext(r),l=c=>{const{children:u,...d}=c,m=g.useMemo(()=>d,Object.values(d));return h.jsx(a.Provider,{value:m,children:u})};l.displayName=t+"Provider";function s(c){const u=g.useContext(a);if(u)return u;if(r!==void 0)return r;throw new Error(`\`${c}\` must be used within \`${t}\``)}return[l,s]}function si(t,r=[]){let a=[];function l(c,u){const d=g.createContext(u),m=a.length;a=[...a,u];const v=y=>{const{scope:w,children:C,...E}=y,S=w?.[t]?.[m]||d,R=g.useMemo(()=>E,Object.values(E));return h.jsx(S.Provider,{value:R,children:C})};v.displayName=c+"Provider";function b(y,w){const C=w?.[t]?.[m]||d,E=g.useContext(C);if(E)return E;if(u!==void 0)return u;throw new Error(`\`${y}\` must be used within \`${c}\``)}return[v,b]}const s=()=>{const c=a.map(u=>g.createContext(u));return function(d){const m=d?.[t]||c;return g.useMemo(()=>({[`__scope${t}`]:{...d,[t]:m}}),[d,m])}};return s.scopeName=t,[l,QD(s,...r)]}function QD(...t){const r=t[0];if(t.length===1)return r;const a=()=>{const l=t.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(c){const u=l.reduce((d,{useScope:m,scopeName:v})=>{const y=m(c)[`__scope${v}`];return{...d,...y}},{});return g.useMemo(()=>({[`__scope${r.scopeName}`]:u}),[u])}};return a.scopeName=r.scopeName,a}var hn=globalThis?.document?g.useLayoutEffect:()=>{},VD=Cs[" useInsertionEffect ".trim().toString()]||hn;function Gl({prop:t,defaultProp:r,onChange:a=()=>{},caller:l}){const[s,c,u]=FD({defaultProp:r,onChange:a}),d=t!==void 0,m=d?t:s;{const b=g.useRef(t!==void 0);g.useEffect(()=>{const y=b.current;y!==d&&console.warn(`${l} is changing from ${y?"controlled":"uncontrolled"} to ${d?"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.`),b.current=d},[d,l])}const v=g.useCallback(b=>{if(d){const y=GD(b)?b(t):b;y!==t&&u.current?.(y)}else c(b)},[d,t,c,u]);return[m,v]}function FD({defaultProp:t,onChange:r}){const[a,l]=g.useState(t),s=g.useRef(a),c=g.useRef(r);return VD(()=>{c.current=r},[r]),g.useEffect(()=>{s.current!==a&&(c.current?.(a),s.current=a)},[a,s]),[a,l,c]}function GD(t){return typeof t=="function"}function Yl(t){const r=YD(t),a=g.forwardRef((l,s)=>{const{children:c,...u}=l,d=g.Children.toArray(c),m=d.find(XD);if(m){const v=m.props.children,b=d.map(y=>y===m?g.Children.count(v)>1?g.Children.only(null):g.isValidElement(v)?v.props.children:null:y);return h.jsx(r,{...u,ref:s,children:g.isValidElement(v)?g.cloneElement(v,void 0,b):null})}return h.jsx(r,{...u,ref:s,children:c})});return a.displayName=`${t}.Slot`,a}function YD(t){const r=g.forwardRef((a,l)=>{const{children:s,...c}=a;if(g.isValidElement(s)){const u=ZD(s),d=$D(c,s.props);return s.type!==g.Fragment&&(d.ref=l?Ds(l,u):u),g.cloneElement(s,d)}return g.Children.count(s)>1?g.Children.only(null):null});return r.displayName=`${t}.SlotClone`,r}var KD=Symbol("radix.slottable");function XD(t){return g.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===KD}function $D(t,r){const a={...r};for(const l in r){const s=t[l],c=r[l];/^on[A-Z]/.test(l)?s&&c?a[l]=(...d)=>{const m=c(...d);return s(...d),m}:s&&(a[l]=s):l==="style"?a[l]={...s,...c}:l==="className"&&(a[l]=[s,c].filter(Boolean).join(" "))}return{...t,...a}}function ZD(t){let r=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,a=r&&"isReactWarning"in r&&r.isReactWarning;return a?t.ref:(r=Object.getOwnPropertyDescriptor(t,"ref")?.get,a=r&&"isReactWarning"in r&&r.isReactWarning,a?t.props.ref:t.props.ref||t.ref)}var JD=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ie=JD.reduce((t,r)=>{const a=Yl(`Primitive.${r}`),l=g.forwardRef((s,c)=>{const{asChild:u,...d}=s,m=u?a:r;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),h.jsx(m,{...d,ref:c})});return l.displayName=`Primitive.${r}`,{...t,[r]:l}},{});function $S(t,r){t&&Sr.flushSync(()=>t.dispatchEvent(r))}function wp(t){const r=t+"CollectionProvider",[a,l]=si(r),[s,c]=a(r,{collectionRef:{current:null},itemMap:new Map}),u=S=>{const{scope:R,children:M}=S,O=ot.useRef(null),_=ot.useRef(new Map).current;return h.jsx(s,{scope:R,itemMap:_,collectionRef:O,children:M})};u.displayName=r;const d=t+"CollectionSlot",m=Yl(d),v=ot.forwardRef((S,R)=>{const{scope:M,children:O}=S,_=c(d,M),z=mt(R,_.collectionRef);return h.jsx(m,{ref:z,children:O})});v.displayName=d;const b=t+"CollectionItemSlot",y="data-radix-collection-item",w=Yl(b),C=ot.forwardRef((S,R)=>{const{scope:M,children:O,..._}=S,z=ot.useRef(null),k=mt(R,z),I=c(b,M);return ot.useEffect(()=>(I.itemMap.set(z,{ref:z,..._}),()=>void I.itemMap.delete(z))),h.jsx(w,{[y]:"",ref:k,children:O})});C.displayName=b;function E(S){const R=c(t+"CollectionConsumer",S);return ot.useCallback(()=>{const O=R.collectionRef.current;if(!O)return[];const _=Array.from(O.querySelectorAll(`[${y}]`));return Array.from(R.itemMap.values()).sort((I,N)=>_.indexOf(I.ref.current)-_.indexOf(N.ref.current))},[R.collectionRef,R.itemMap])}return[{Provider:u,Slot:v,ItemSlot:C},E,l]}var WD=g.createContext(void 0);function Ju(t){const r=g.useContext(WD);return t||r||"ltr"}function qr(t){const r=g.useRef(t);return g.useEffect(()=>{r.current=t}),g.useMemo(()=>(...a)=>r.current?.(...a),[])}function eT(t,r=globalThis?.document){const a=qr(t);g.useEffect(()=>{const l=s=>{s.key==="Escape"&&a(s)};return r.addEventListener("keydown",l,{capture:!0}),()=>r.removeEventListener("keydown",l,{capture:!0})},[a,r])}var tT="DismissableLayer",Am="dismissableLayer.update",nT="dismissableLayer.pointerDownOutside",rT="dismissableLayer.focusOutside",Q0,ZS=g.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Wu=g.forwardRef((t,r)=>{const{disableOutsidePointerEvents:a=!1,onEscapeKeyDown:l,onPointerDownOutside:s,onFocusOutside:c,onInteractOutside:u,onDismiss:d,...m}=t,v=g.useContext(ZS),[b,y]=g.useState(null),w=b?.ownerDocument??globalThis?.document,[,C]=g.useState({}),E=mt(r,N=>y(N)),S=Array.from(v.layers),[R]=[...v.layersWithOutsidePointerEventsDisabled].slice(-1),M=S.indexOf(R),O=b?S.indexOf(b):-1,_=v.layersWithOutsidePointerEventsDisabled.size>0,z=O>=M,k=lT(N=>{const T=N.target,A=[...v.branches].some(q=>q.contains(T));!z||A||(s?.(N),u?.(N),N.defaultPrevented||d?.())},w),I=oT(N=>{const T=N.target;[...v.branches].some(q=>q.contains(T))||(c?.(N),u?.(N),N.defaultPrevented||d?.())},w);return eT(N=>{O===v.layers.size-1&&(l?.(N),!N.defaultPrevented&&d&&(N.preventDefault(),d()))},w),g.useEffect(()=>{if(b)return a&&(v.layersWithOutsidePointerEventsDisabled.size===0&&(Q0=w.body.style.pointerEvents,w.body.style.pointerEvents="none"),v.layersWithOutsidePointerEventsDisabled.add(b)),v.layers.add(b),V0(),()=>{a&&v.layersWithOutsidePointerEventsDisabled.size===1&&(w.body.style.pointerEvents=Q0)}},[b,w,a,v]),g.useEffect(()=>()=>{b&&(v.layers.delete(b),v.layersWithOutsidePointerEventsDisabled.delete(b),V0())},[b,v]),g.useEffect(()=>{const N=()=>C({});return document.addEventListener(Am,N),()=>document.removeEventListener(Am,N)},[]),h.jsx(Ie.div,{...m,ref:E,style:{pointerEvents:_?z?"auto":"none":void 0,...t.style},onFocusCapture:Re(t.onFocusCapture,I.onFocusCapture),onBlurCapture:Re(t.onBlurCapture,I.onBlurCapture),onPointerDownCapture:Re(t.onPointerDownCapture,k.onPointerDownCapture)})});Wu.displayName=tT;var aT="DismissableLayerBranch",iT=g.forwardRef((t,r)=>{const a=g.useContext(ZS),l=g.useRef(null),s=mt(r,l);return g.useEffect(()=>{const c=l.current;if(c)return a.branches.add(c),()=>{a.branches.delete(c)}},[a.branches]),h.jsx(Ie.div,{...t,ref:s})});iT.displayName=aT;function lT(t,r=globalThis?.document){const a=qr(t),l=g.useRef(!1),s=g.useRef(()=>{});return g.useEffect(()=>{const c=d=>{if(d.target&&!l.current){let m=function(){JS(nT,a,v,{discrete:!0})};const v={originalEvent:d};d.pointerType==="touch"?(r.removeEventListener("click",s.current),s.current=m,r.addEventListener("click",s.current,{once:!0})):m()}else r.removeEventListener("click",s.current);l.current=!1},u=window.setTimeout(()=>{r.addEventListener("pointerdown",c)},0);return()=>{window.clearTimeout(u),r.removeEventListener("pointerdown",c),r.removeEventListener("click",s.current)}},[r,a]),{onPointerDownCapture:()=>l.current=!0}}function oT(t,r=globalThis?.document){const a=qr(t),l=g.useRef(!1);return g.useEffect(()=>{const s=c=>{c.target&&!l.current&&JS(rT,a,{originalEvent:c},{discrete:!1})};return r.addEventListener("focusin",s),()=>r.removeEventListener("focusin",s)},[r,a]),{onFocusCapture:()=>l.current=!0,onBlurCapture:()=>l.current=!1}}function V0(){const t=new CustomEvent(Am);document.dispatchEvent(t)}function JS(t,r,a,{discrete:l}){const s=a.originalEvent.target,c=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:a});r&&s.addEventListener(t,r,{once:!0}),l?$S(s,c):s.dispatchEvent(c)}var nm=0;function Cp(){g.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??F0()),document.body.insertAdjacentElement("beforeend",t[1]??F0()),nm++,()=>{nm===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),nm--}},[])}function F0(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var rm="focusScope.autoFocusOnMount",am="focusScope.autoFocusOnUnmount",G0={bubbles:!1,cancelable:!0},sT="FocusScope",ed=g.forwardRef((t,r)=>{const{loop:a=!1,trapped:l=!1,onMountAutoFocus:s,onUnmountAutoFocus:c,...u}=t,[d,m]=g.useState(null),v=qr(s),b=qr(c),y=g.useRef(null),w=mt(r,S=>m(S)),C=g.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;g.useEffect(()=>{if(l){let S=function(_){if(C.paused||!d)return;const z=_.target;d.contains(z)?y.current=z:Ja(y.current,{select:!0})},R=function(_){if(C.paused||!d)return;const z=_.relatedTarget;z!==null&&(d.contains(z)||Ja(y.current,{select:!0}))},M=function(_){if(document.activeElement===document.body)for(const k of _)k.removedNodes.length>0&&Ja(d)};document.addEventListener("focusin",S),document.addEventListener("focusout",R);const O=new MutationObserver(M);return d&&O.observe(d,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",S),document.removeEventListener("focusout",R),O.disconnect()}}},[l,d,C.paused]),g.useEffect(()=>{if(d){K0.add(C);const S=document.activeElement;if(!d.contains(S)){const M=new CustomEvent(rm,G0);d.addEventListener(rm,v),d.dispatchEvent(M),M.defaultPrevented||(cT(mT(WS(d)),{select:!0}),document.activeElement===S&&Ja(d))}return()=>{d.removeEventListener(rm,v),setTimeout(()=>{const M=new CustomEvent(am,G0);d.addEventListener(am,b),d.dispatchEvent(M),M.defaultPrevented||Ja(S??document.body,{select:!0}),d.removeEventListener(am,b),K0.remove(C)},0)}}},[d,v,b,C]);const E=g.useCallback(S=>{if(!a&&!l||C.paused)return;const R=S.key==="Tab"&&!S.altKey&&!S.ctrlKey&&!S.metaKey,M=document.activeElement;if(R&&M){const O=S.currentTarget,[_,z]=uT(O);_&&z?!S.shiftKey&&M===z?(S.preventDefault(),a&&Ja(_,{select:!0})):S.shiftKey&&M===_&&(S.preventDefault(),a&&Ja(z,{select:!0})):M===O&&S.preventDefault()}},[a,l,C.paused]);return h.jsx(Ie.div,{tabIndex:-1,...u,ref:w,onKeyDown:E})});ed.displayName=sT;function cT(t,{select:r=!1}={}){const a=document.activeElement;for(const l of t)if(Ja(l,{select:r}),document.activeElement!==a)return}function uT(t){const r=WS(t),a=Y0(r,t),l=Y0(r.reverse(),t);return[a,l]}function WS(t){const r=[],a=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:l=>{const s=l.tagName==="INPUT"&&l.type==="hidden";return l.disabled||l.hidden||s?NodeFilter.FILTER_SKIP:l.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;a.nextNode();)r.push(a.currentNode);return r}function Y0(t,r){for(const a of t)if(!dT(a,{upTo:r}))return a}function dT(t,{upTo:r}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(r!==void 0&&t===r)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function fT(t){return t instanceof HTMLInputElement&&"select"in t}function Ja(t,{select:r=!1}={}){if(t&&t.focus){const a=document.activeElement;t.focus({preventScroll:!0}),t!==a&&fT(t)&&r&&t.select()}}var K0=hT();function hT(){let t=[];return{add(r){const a=t[0];r!==a&&a?.pause(),t=X0(t,r),t.unshift(r)},remove(r){t=X0(t,r),t[0]?.resume()}}}function X0(t,r){const a=[...t],l=a.indexOf(r);return l!==-1&&a.splice(l,1),a}function mT(t){return t.filter(r=>r.tagName!=="A")}var pT=Cs[" useId ".trim().toString()]||(()=>{}),vT=0;function Br(t){const[r,a]=g.useState(pT());return hn(()=>{a(l=>l??String(vT++))},[t]),r?`radix-${r}`:""}const gT=["top","right","bottom","left"],ai=Math.min,Fn=Math.max,_u=Math.round,lu=Math.floor,Hr=t=>({x:t,y:t}),yT={left:"right",right:"left",bottom:"top",top:"bottom"},bT={start:"end",end:"start"};function zm(t,r,a){return Fn(t,ai(r,a))}function va(t,r){return typeof t=="function"?t(r):t}function ga(t){return t.split("-")[0]}function eo(t){return t.split("-")[1]}function Np(t){return t==="x"?"y":"x"}function Ep(t){return t==="y"?"height":"width"}const xT=new Set(["top","bottom"]);function Ur(t){return xT.has(ga(t))?"y":"x"}function jp(t){return Np(Ur(t))}function ST(t,r,a){a===void 0&&(a=!1);const l=eo(t),s=jp(t),c=Ep(s);let u=s==="x"?l===(a?"end":"start")?"right":"left":l==="start"?"bottom":"top";return r.reference[c]>r.floating[c]&&(u=Au(u)),[u,Au(u)]}function wT(t){const r=Au(t);return[Lm(t),r,Lm(r)]}function Lm(t){return t.replace(/start|end/g,r=>bT[r])}const $0=["left","right"],Z0=["right","left"],CT=["top","bottom"],NT=["bottom","top"];function ET(t,r,a){switch(t){case"top":case"bottom":return a?r?Z0:$0:r?$0:Z0;case"left":case"right":return r?CT:NT;default:return[]}}function jT(t,r,a,l){const s=eo(t);let c=ET(ga(t),a==="start",l);return s&&(c=c.map(u=>u+"-"+s),r&&(c=c.concat(c.map(Lm)))),c}function Au(t){return t.replace(/left|right|bottom|top/g,r=>yT[r])}function RT(t){return{top:0,right:0,bottom:0,left:0,...t}}function ew(t){return typeof t!="number"?RT(t):{top:t,right:t,bottom:t,left:t}}function zu(t){const{x:r,y:a,width:l,height:s}=t;return{width:l,height:s,top:a,left:r,right:r+l,bottom:a+s,x:r,y:a}}function J0(t,r,a){let{reference:l,floating:s}=t;const c=Ur(r),u=jp(r),d=Ep(u),m=ga(r),v=c==="y",b=l.x+l.width/2-s.width/2,y=l.y+l.height/2-s.height/2,w=l[d]/2-s[d]/2;let C;switch(m){case"top":C={x:b,y:l.y-s.height};break;case"bottom":C={x:b,y:l.y+l.height};break;case"right":C={x:l.x+l.width,y};break;case"left":C={x:l.x-s.width,y};break;default:C={x:l.x,y:l.y}}switch(eo(r)){case"start":C[u]-=w*(a&&v?-1:1);break;case"end":C[u]+=w*(a&&v?-1:1);break}return C}const MT=async(t,r,a)=>{const{placement:l="bottom",strategy:s="absolute",middleware:c=[],platform:u}=a,d=c.filter(Boolean),m=await(u.isRTL==null?void 0:u.isRTL(r));let v=await u.getElementRects({reference:t,floating:r,strategy:s}),{x:b,y}=J0(v,l,m),w=l,C={},E=0;for(let S=0;S<d.length;S++){const{name:R,fn:M}=d[S],{x:O,y:_,data:z,reset:k}=await M({x:b,y,initialPlacement:l,placement:w,strategy:s,middlewareData:C,rects:v,platform:u,elements:{reference:t,floating:r}});b=O??b,y=_??y,C={...C,[R]:{...C[R],...z}},k&&E<=50&&(E++,typeof k=="object"&&(k.placement&&(w=k.placement),k.rects&&(v=k.rects===!0?await u.getElementRects({reference:t,floating:r,strategy:s}):k.rects),{x:b,y}=J0(v,w,m)),S=-1)}return{x:b,y,placement:w,strategy:s,middlewareData:C}};async function vs(t,r){var a;r===void 0&&(r={});const{x:l,y:s,platform:c,rects:u,elements:d,strategy:m}=t,{boundary:v="clippingAncestors",rootBoundary:b="viewport",elementContext:y="floating",altBoundary:w=!1,padding:C=0}=va(r,t),E=ew(C),R=d[w?y==="floating"?"reference":"floating":y],M=zu(await c.getClippingRect({element:(a=await(c.isElement==null?void 0:c.isElement(R)))==null||a?R:R.contextElement||await(c.getDocumentElement==null?void 0:c.getDocumentElement(d.floating)),boundary:v,rootBoundary:b,strategy:m})),O=y==="floating"?{x:l,y:s,width:u.floating.width,height:u.floating.height}:u.reference,_=await(c.getOffsetParent==null?void 0:c.getOffsetParent(d.floating)),z=await(c.isElement==null?void 0:c.isElement(_))?await(c.getScale==null?void 0:c.getScale(_))||{x:1,y:1}:{x:1,y:1},k=zu(c.convertOffsetParentRelativeRectToViewportRelativeRect?await c.convertOffsetParentRelativeRectToViewportRelativeRect({elements:d,rect:O,offsetParent:_,strategy:m}):O);return{top:(M.top-k.top+E.top)/z.y,bottom:(k.bottom-M.bottom+E.bottom)/z.y,left:(M.left-k.left+E.left)/z.x,right:(k.right-M.right+E.right)/z.x}}const OT=t=>({name:"arrow",options:t,async fn(r){const{x:a,y:l,placement:s,rects:c,platform:u,elements:d,middlewareData:m}=r,{element:v,padding:b=0}=va(t,r)||{};if(v==null)return{};const y=ew(b),w={x:a,y:l},C=jp(s),E=Ep(C),S=await u.getDimensions(v),R=C==="y",M=R?"top":"left",O=R?"bottom":"right",_=R?"clientHeight":"clientWidth",z=c.reference[E]+c.reference[C]-w[C]-c.floating[E],k=w[C]-c.reference[C],I=await(u.getOffsetParent==null?void 0:u.getOffsetParent(v));let N=I?I[_]:0;(!N||!await(u.isElement==null?void 0:u.isElement(I)))&&(N=d.floating[_]||c.floating[E]);const T=z/2-k/2,A=N/2-S[E]/2-1,q=ai(y[M],A),K=ai(y[O],A),W=q,ue=N-S[E]-K,le=N/2-S[E]/2+T,de=zm(W,le,ue),L=!m.arrow&&eo(s)!=null&&le!==de&&c.reference[E]/2-(le<W?q:K)-S[E]/2<0,G=L?le<W?le-W:le-ue:0;return{[C]:w[C]+G,data:{[C]:de,centerOffset:le-de-G,...L&&{alignmentOffset:G}},reset:L}}}),DT=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(r){var a,l;const{placement:s,middlewareData:c,rects:u,initialPlacement:d,platform:m,elements:v}=r,{mainAxis:b=!0,crossAxis:y=!0,fallbackPlacements:w,fallbackStrategy:C="bestFit",fallbackAxisSideDirection:E="none",flipAlignment:S=!0,...R}=va(t,r);if((a=c.arrow)!=null&&a.alignmentOffset)return{};const M=ga(s),O=Ur(d),_=ga(d)===d,z=await(m.isRTL==null?void 0:m.isRTL(v.floating)),k=w||(_||!S?[Au(d)]:wT(d)),I=E!=="none";!w&&I&&k.push(...jT(d,S,E,z));const N=[d,...k],T=await vs(r,R),A=[];let q=((l=c.flip)==null?void 0:l.overflows)||[];if(b&&A.push(T[M]),y){const le=ST(s,u,z);A.push(T[le[0]],T[le[1]])}if(q=[...q,{placement:s,overflows:A}],!A.every(le=>le<=0)){var K,W;const le=(((K=c.flip)==null?void 0:K.index)||0)+1,de=N[le];if(de&&(!(y==="alignment"?O!==Ur(de):!1)||q.every(B=>Ur(B.placement)===O?B.overflows[0]>0:!0)))return{data:{index:le,overflows:q},reset:{placement:de}};let L=(W=q.filter(G=>G.overflows[0]<=0).sort((G,B)=>G.overflows[1]-B.overflows[1])[0])==null?void 0:W.placement;if(!L)switch(C){case"bestFit":{var ue;const G=(ue=q.filter(B=>{if(I){const ee=Ur(B.placement);return ee===O||ee==="y"}return!0}).map(B=>[B.placement,B.overflows.filter(ee=>ee>0).reduce((ee,ie)=>ee+ie,0)]).sort((B,ee)=>B[1]-ee[1])[0])==null?void 0:ue[0];G&&(L=G);break}case"initialPlacement":L=d;break}if(s!==L)return{reset:{placement:L}}}return{}}}};function W0(t,r){return{top:t.top-r.height,right:t.right-r.width,bottom:t.bottom-r.height,left:t.left-r.width}}function ex(t){return gT.some(r=>t[r]>=0)}const TT=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(r){const{rects:a}=r,{strategy:l="referenceHidden",...s}=va(t,r);switch(l){case"referenceHidden":{const c=await vs(r,{...s,elementContext:"reference"}),u=W0(c,a.reference);return{data:{referenceHiddenOffsets:u,referenceHidden:ex(u)}}}case"escaped":{const c=await vs(r,{...s,altBoundary:!0}),u=W0(c,a.floating);return{data:{escapedOffsets:u,escaped:ex(u)}}}default:return{}}}}},tw=new Set(["left","top"]);async function _T(t,r){const{placement:a,platform:l,elements:s}=t,c=await(l.isRTL==null?void 0:l.isRTL(s.floating)),u=ga(a),d=eo(a),m=Ur(a)==="y",v=tw.has(u)?-1:1,b=c&&m?-1:1,y=va(r,t);let{mainAxis:w,crossAxis:C,alignmentAxis:E}=typeof y=="number"?{mainAxis:y,crossAxis:0,alignmentAxis:null}:{mainAxis:y.mainAxis||0,crossAxis:y.crossAxis||0,alignmentAxis:y.alignmentAxis};return d&&typeof E=="number"&&(C=d==="end"?E*-1:E),m?{x:C*b,y:w*v}:{x:w*v,y:C*b}}const AT=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(r){var a,l;const{x:s,y:c,placement:u,middlewareData:d}=r,m=await _T(r,t);return u===((a=d.offset)==null?void 0:a.placement)&&(l=d.arrow)!=null&&l.alignmentOffset?{}:{x:s+m.x,y:c+m.y,data:{...m,placement:u}}}}},zT=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(r){const{x:a,y:l,placement:s}=r,{mainAxis:c=!0,crossAxis:u=!1,limiter:d={fn:R=>{let{x:M,y:O}=R;return{x:M,y:O}}},...m}=va(t,r),v={x:a,y:l},b=await vs(r,m),y=Ur(ga(s)),w=Np(y);let C=v[w],E=v[y];if(c){const R=w==="y"?"top":"left",M=w==="y"?"bottom":"right",O=C+b[R],_=C-b[M];C=zm(O,C,_)}if(u){const R=y==="y"?"top":"left",M=y==="y"?"bottom":"right",O=E+b[R],_=E-b[M];E=zm(O,E,_)}const S=d.fn({...r,[w]:C,[y]:E});return{...S,data:{x:S.x-a,y:S.y-l,enabled:{[w]:c,[y]:u}}}}}},LT=function(t){return t===void 0&&(t={}),{options:t,fn(r){const{x:a,y:l,placement:s,rects:c,middlewareData:u}=r,{offset:d=0,mainAxis:m=!0,crossAxis:v=!0}=va(t,r),b={x:a,y:l},y=Ur(s),w=Np(y);let C=b[w],E=b[y];const S=va(d,r),R=typeof S=="number"?{mainAxis:S,crossAxis:0}:{mainAxis:0,crossAxis:0,...S};if(m){const _=w==="y"?"height":"width",z=c.reference[w]-c.floating[_]+R.mainAxis,k=c.reference[w]+c.reference[_]-R.mainAxis;C<z?C=z:C>k&&(C=k)}if(v){var M,O;const _=w==="y"?"width":"height",z=tw.has(ga(s)),k=c.reference[y]-c.floating[_]+(z&&((M=u.offset)==null?void 0:M[y])||0)+(z?0:R.crossAxis),I=c.reference[y]+c.reference[_]+(z?0:((O=u.offset)==null?void 0:O[y])||0)-(z?R.crossAxis:0);E<k?E=k:E>I&&(E=I)}return{[w]:C,[y]:E}}}},kT=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(r){var a,l;const{placement:s,rects:c,platform:u,elements:d}=r,{apply:m=()=>{},...v}=va(t,r),b=await vs(r,v),y=ga(s),w=eo(s),C=Ur(s)==="y",{width:E,height:S}=c.floating;let R,M;y==="top"||y==="bottom"?(R=y,M=w===(await(u.isRTL==null?void 0:u.isRTL(d.floating))?"start":"end")?"left":"right"):(M=y,R=w==="end"?"top":"bottom");const O=S-b.top-b.bottom,_=E-b.left-b.right,z=ai(S-b[R],O),k=ai(E-b[M],_),I=!r.middlewareData.shift;let N=z,T=k;if((a=r.middlewareData.shift)!=null&&a.enabled.x&&(T=_),(l=r.middlewareData.shift)!=null&&l.enabled.y&&(N=O),I&&!w){const q=Fn(b.left,0),K=Fn(b.right,0),W=Fn(b.top,0),ue=Fn(b.bottom,0);C?T=E-2*(q!==0||K!==0?q+K:Fn(b.left,b.right)):N=S-2*(W!==0||ue!==0?W+ue:Fn(b.top,b.bottom))}await m({...r,availableWidth:T,availableHeight:N});const A=await u.getDimensions(d.floating);return E!==A.width||S!==A.height?{reset:{rects:!0}}:{}}}};function td(){return typeof window<"u"}function to(t){return nw(t)?(t.nodeName||"").toLowerCase():"#document"}function Kn(t){var r;return(t==null||(r=t.ownerDocument)==null?void 0:r.defaultView)||window}function Qr(t){var r;return(r=(nw(t)?t.ownerDocument:t.document)||window.document)==null?void 0:r.documentElement}function nw(t){return td()?t instanceof Node||t instanceof Kn(t).Node:!1}function wr(t){return td()?t instanceof Element||t instanceof Kn(t).Element:!1}function Ir(t){return td()?t instanceof HTMLElement||t instanceof Kn(t).HTMLElement:!1}function tx(t){return!td()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Kn(t).ShadowRoot}const PT=new Set(["inline","contents"]);function _s(t){const{overflow:r,overflowX:a,overflowY:l,display:s}=Cr(t);return/auto|scroll|overlay|hidden|clip/.test(r+l+a)&&!PT.has(s)}const UT=new Set(["table","td","th"]);function BT(t){return UT.has(to(t))}const HT=[":popover-open",":modal"];function nd(t){return HT.some(r=>{try{return t.matches(r)}catch{return!1}})}const qT=["transform","translate","scale","rotate","perspective"],IT=["transform","translate","scale","rotate","perspective","filter"],QT=["paint","layout","strict","content"];function Rp(t){const r=Mp(),a=wr(t)?Cr(t):t;return qT.some(l=>a[l]?a[l]!=="none":!1)||(a.containerType?a.containerType!=="normal":!1)||!r&&(a.backdropFilter?a.backdropFilter!=="none":!1)||!r&&(a.filter?a.filter!=="none":!1)||IT.some(l=>(a.willChange||"").includes(l))||QT.some(l=>(a.contain||"").includes(l))}function VT(t){let r=ii(t);for(;Ir(r)&&!Kl(r);){if(Rp(r))return r;if(nd(r))return null;r=ii(r)}return null}function Mp(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const FT=new Set(["html","body","#document"]);function Kl(t){return FT.has(to(t))}function Cr(t){return Kn(t).getComputedStyle(t)}function rd(t){return wr(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function ii(t){if(to(t)==="html")return t;const r=t.assignedSlot||t.parentNode||tx(t)&&t.host||Qr(t);return tx(r)?r.host:r}function rw(t){const r=ii(t);return Kl(r)?t.ownerDocument?t.ownerDocument.body:t.body:Ir(r)&&_s(r)?r:rw(r)}function gs(t,r,a){var l;r===void 0&&(r=[]),a===void 0&&(a=!0);const s=rw(t),c=s===((l=t.ownerDocument)==null?void 0:l.body),u=Kn(s);if(c){const d=km(u);return r.concat(u,u.visualViewport||[],_s(s)?s:[],d&&a?gs(d):[])}return r.concat(s,gs(s,[],a))}function km(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function aw(t){const r=Cr(t);let a=parseFloat(r.width)||0,l=parseFloat(r.height)||0;const s=Ir(t),c=s?t.offsetWidth:a,u=s?t.offsetHeight:l,d=_u(a)!==c||_u(l)!==u;return d&&(a=c,l=u),{width:a,height:l,$:d}}function Op(t){return wr(t)?t:t.contextElement}function Il(t){const r=Op(t);if(!Ir(r))return Hr(1);const a=r.getBoundingClientRect(),{width:l,height:s,$:c}=aw(r);let u=(c?_u(a.width):a.width)/l,d=(c?_u(a.height):a.height)/s;return(!u||!Number.isFinite(u))&&(u=1),(!d||!Number.isFinite(d))&&(d=1),{x:u,y:d}}const GT=Hr(0);function iw(t){const r=Kn(t);return!Mp()||!r.visualViewport?GT:{x:r.visualViewport.offsetLeft,y:r.visualViewport.offsetTop}}function YT(t,r,a){return r===void 0&&(r=!1),!a||r&&a!==Kn(t)?!1:r}function Ii(t,r,a,l){r===void 0&&(r=!1),a===void 0&&(a=!1);const s=t.getBoundingClientRect(),c=Op(t);let u=Hr(1);r&&(l?wr(l)&&(u=Il(l)):u=Il(t));const d=YT(c,a,l)?iw(c):Hr(0);let m=(s.left+d.x)/u.x,v=(s.top+d.y)/u.y,b=s.width/u.x,y=s.height/u.y;if(c){const w=Kn(c),C=l&&wr(l)?Kn(l):l;let E=w,S=km(E);for(;S&&l&&C!==E;){const R=Il(S),M=S.getBoundingClientRect(),O=Cr(S),_=M.left+(S.clientLeft+parseFloat(O.paddingLeft))*R.x,z=M.top+(S.clientTop+parseFloat(O.paddingTop))*R.y;m*=R.x,v*=R.y,b*=R.x,y*=R.y,m+=_,v+=z,E=Kn(S),S=km(E)}}return zu({width:b,height:y,x:m,y:v})}function ad(t,r){const a=rd(t).scrollLeft;return r?r.left+a:Ii(Qr(t)).left+a}function lw(t,r){const a=t.getBoundingClientRect(),l=a.left+r.scrollLeft-ad(t,a),s=a.top+r.scrollTop;return{x:l,y:s}}function KT(t){let{elements:r,rect:a,offsetParent:l,strategy:s}=t;const c=s==="fixed",u=Qr(l),d=r?nd(r.floating):!1;if(l===u||d&&c)return a;let m={scrollLeft:0,scrollTop:0},v=Hr(1);const b=Hr(0),y=Ir(l);if((y||!y&&!c)&&((to(l)!=="body"||_s(u))&&(m=rd(l)),Ir(l))){const C=Ii(l);v=Il(l),b.x=C.x+l.clientLeft,b.y=C.y+l.clientTop}const w=u&&!y&&!c?lw(u,m):Hr(0);return{width:a.width*v.x,height:a.height*v.y,x:a.x*v.x-m.scrollLeft*v.x+b.x+w.x,y:a.y*v.y-m.scrollTop*v.y+b.y+w.y}}function XT(t){return Array.from(t.getClientRects())}function $T(t){const r=Qr(t),a=rd(t),l=t.ownerDocument.body,s=Fn(r.scrollWidth,r.clientWidth,l.scrollWidth,l.clientWidth),c=Fn(r.scrollHeight,r.clientHeight,l.scrollHeight,l.clientHeight);let u=-a.scrollLeft+ad(t);const d=-a.scrollTop;return Cr(l).direction==="rtl"&&(u+=Fn(r.clientWidth,l.clientWidth)-s),{width:s,height:c,x:u,y:d}}const nx=25;function ZT(t,r){const a=Kn(t),l=Qr(t),s=a.visualViewport;let c=l.clientWidth,u=l.clientHeight,d=0,m=0;if(s){c=s.width,u=s.height;const b=Mp();(!b||b&&r==="fixed")&&(d=s.offsetLeft,m=s.offsetTop)}const v=ad(l);if(v<=0){const b=l.ownerDocument,y=b.body,w=getComputedStyle(y),C=b.compatMode==="CSS1Compat"&&parseFloat(w.marginLeft)+parseFloat(w.marginRight)||0,E=Math.abs(l.clientWidth-y.clientWidth-C);E<=nx&&(c-=E)}else v<=nx&&(c+=v);return{width:c,height:u,x:d,y:m}}const JT=new Set(["absolute","fixed"]);function WT(t,r){const a=Ii(t,!0,r==="fixed"),l=a.top+t.clientTop,s=a.left+t.clientLeft,c=Ir(t)?Il(t):Hr(1),u=t.clientWidth*c.x,d=t.clientHeight*c.y,m=s*c.x,v=l*c.y;return{width:u,height:d,x:m,y:v}}function rx(t,r,a){let l;if(r==="viewport")l=ZT(t,a);else if(r==="document")l=$T(Qr(t));else if(wr(r))l=WT(r,a);else{const s=iw(t);l={x:r.x-s.x,y:r.y-s.y,width:r.width,height:r.height}}return zu(l)}function ow(t,r){const a=ii(t);return a===r||!wr(a)||Kl(a)?!1:Cr(a).position==="fixed"||ow(a,r)}function e_(t,r){const a=r.get(t);if(a)return a;let l=gs(t,[],!1).filter(d=>wr(d)&&to(d)!=="body"),s=null;const c=Cr(t).position==="fixed";let u=c?ii(t):t;for(;wr(u)&&!Kl(u);){const d=Cr(u),m=Rp(u);!m&&d.position==="fixed"&&(s=null),(c?!m&&!s:!m&&d.position==="static"&&!!s&&JT.has(s.position)||_s(u)&&!m&&ow(t,u))?l=l.filter(b=>b!==u):s=d,u=ii(u)}return r.set(t,l),l}function t_(t){let{element:r,boundary:a,rootBoundary:l,strategy:s}=t;const u=[...a==="clippingAncestors"?nd(r)?[]:e_(r,this._c):[].concat(a),l],d=u[0],m=u.reduce((v,b)=>{const y=rx(r,b,s);return v.top=Fn(y.top,v.top),v.right=ai(y.right,v.right),v.bottom=ai(y.bottom,v.bottom),v.left=Fn(y.left,v.left),v},rx(r,d,s));return{width:m.right-m.left,height:m.bottom-m.top,x:m.left,y:m.top}}function n_(t){const{width:r,height:a}=aw(t);return{width:r,height:a}}function r_(t,r,a){const l=Ir(r),s=Qr(r),c=a==="fixed",u=Ii(t,!0,c,r);let d={scrollLeft:0,scrollTop:0};const m=Hr(0);function v(){m.x=ad(s)}if(l||!l&&!c)if((to(r)!=="body"||_s(s))&&(d=rd(r)),l){const C=Ii(r,!0,c,r);m.x=C.x+r.clientLeft,m.y=C.y+r.clientTop}else s&&v();c&&!l&&s&&v();const b=s&&!l&&!c?lw(s,d):Hr(0),y=u.left+d.scrollLeft-m.x-b.x,w=u.top+d.scrollTop-m.y-b.y;return{x:y,y:w,width:u.width,height:u.height}}function im(t){return Cr(t).position==="static"}function ax(t,r){if(!Ir(t)||Cr(t).position==="fixed")return null;if(r)return r(t);let a=t.offsetParent;return Qr(t)===a&&(a=a.ownerDocument.body),a}function sw(t,r){const a=Kn(t);if(nd(t))return a;if(!Ir(t)){let s=ii(t);for(;s&&!Kl(s);){if(wr(s)&&!im(s))return s;s=ii(s)}return a}let l=ax(t,r);for(;l&&BT(l)&&im(l);)l=ax(l,r);return l&&Kl(l)&&im(l)&&!Rp(l)?a:l||VT(t)||a}const a_=async function(t){const r=this.getOffsetParent||sw,a=this.getDimensions,l=await a(t.floating);return{reference:r_(t.reference,await r(t.floating),t.strategy),floating:{x:0,y:0,width:l.width,height:l.height}}};function i_(t){return Cr(t).direction==="rtl"}const l_={convertOffsetParentRelativeRectToViewportRelativeRect:KT,getDocumentElement:Qr,getClippingRect:t_,getOffsetParent:sw,getElementRects:a_,getClientRects:XT,getDimensions:n_,getScale:Il,isElement:wr,isRTL:i_};function cw(t,r){return t.x===r.x&&t.y===r.y&&t.width===r.width&&t.height===r.height}function o_(t,r){let a=null,l;const s=Qr(t);function c(){var d;clearTimeout(l),(d=a)==null||d.disconnect(),a=null}function u(d,m){d===void 0&&(d=!1),m===void 0&&(m=1),c();const v=t.getBoundingClientRect(),{left:b,top:y,width:w,height:C}=v;if(d||r(),!w||!C)return;const E=lu(y),S=lu(s.clientWidth-(b+w)),R=lu(s.clientHeight-(y+C)),M=lu(b),_={rootMargin:-E+"px "+-S+"px "+-R+"px "+-M+"px",threshold:Fn(0,ai(1,m))||1};let z=!0;function k(I){const N=I[0].intersectionRatio;if(N!==m){if(!z)return u();N?u(!1,N):l=setTimeout(()=>{u(!1,1e-7)},1e3)}N===1&&!cw(v,t.getBoundingClientRect())&&u(),z=!1}try{a=new IntersectionObserver(k,{..._,root:s.ownerDocument})}catch{a=new IntersectionObserver(k,_)}a.observe(t)}return u(!0),c}function s_(t,r,a,l){l===void 0&&(l={});const{ancestorScroll:s=!0,ancestorResize:c=!0,elementResize:u=typeof ResizeObserver=="function",layoutShift:d=typeof IntersectionObserver=="function",animationFrame:m=!1}=l,v=Op(t),b=s||c?[...v?gs(v):[],...gs(r)]:[];b.forEach(M=>{s&&M.addEventListener("scroll",a,{passive:!0}),c&&M.addEventListener("resize",a)});const y=v&&d?o_(v,a):null;let w=-1,C=null;u&&(C=new ResizeObserver(M=>{let[O]=M;O&&O.target===v&&C&&(C.unobserve(r),cancelAnimationFrame(w),w=requestAnimationFrame(()=>{var _;(_=C)==null||_.observe(r)})),a()}),v&&!m&&C.observe(v),C.observe(r));let E,S=m?Ii(t):null;m&&R();function R(){const M=Ii(t);S&&!cw(S,M)&&a(),S=M,E=requestAnimationFrame(R)}return a(),()=>{var M;b.forEach(O=>{s&&O.removeEventListener("scroll",a),c&&O.removeEventListener("resize",a)}),y?.(),(M=C)==null||M.disconnect(),C=null,m&&cancelAnimationFrame(E)}}const c_=AT,u_=zT,d_=DT,f_=kT,h_=TT,ix=OT,m_=LT,p_=(t,r,a)=>{const l=new Map,s={platform:l_,...a},c={...s.platform,_c:l};return MT(t,r,{...s,platform:c})};var v_=typeof document<"u",g_=function(){},vu=v_?g.useLayoutEffect:g_;function Lu(t,r){if(t===r)return!0;if(typeof t!=typeof r)return!1;if(typeof t=="function"&&t.toString()===r.toString())return!0;let a,l,s;if(t&&r&&typeof t=="object"){if(Array.isArray(t)){if(a=t.length,a!==r.length)return!1;for(l=a;l--!==0;)if(!Lu(t[l],r[l]))return!1;return!0}if(s=Object.keys(t),a=s.length,a!==Object.keys(r).length)return!1;for(l=a;l--!==0;)if(!{}.hasOwnProperty.call(r,s[l]))return!1;for(l=a;l--!==0;){const c=s[l];if(!(c==="_owner"&&t.$$typeof)&&!Lu(t[c],r[c]))return!1}return!0}return t!==t&&r!==r}function uw(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function lx(t,r){const a=uw(t);return Math.round(r*a)/a}function lm(t){const r=g.useRef(t);return vu(()=>{r.current=t}),r}function y_(t){t===void 0&&(t={});const{placement:r="bottom",strategy:a="absolute",middleware:l=[],platform:s,elements:{reference:c,floating:u}={},transform:d=!0,whileElementsMounted:m,open:v}=t,[b,y]=g.useState({x:0,y:0,strategy:a,placement:r,middlewareData:{},isPositioned:!1}),[w,C]=g.useState(l);Lu(w,l)||C(l);const[E,S]=g.useState(null),[R,M]=g.useState(null),O=g.useCallback(B=>{B!==I.current&&(I.current=B,S(B))},[]),_=g.useCallback(B=>{B!==N.current&&(N.current=B,M(B))},[]),z=c||E,k=u||R,I=g.useRef(null),N=g.useRef(null),T=g.useRef(b),A=m!=null,q=lm(m),K=lm(s),W=lm(v),ue=g.useCallback(()=>{if(!I.current||!N.current)return;const B={placement:r,strategy:a,middleware:w};K.current&&(B.platform=K.current),p_(I.current,N.current,B).then(ee=>{const ie={...ee,isPositioned:W.current!==!1};le.current&&!Lu(T.current,ie)&&(T.current=ie,Sr.flushSync(()=>{y(ie)}))})},[w,r,a,K,W]);vu(()=>{v===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,y(B=>({...B,isPositioned:!1})))},[v]);const le=g.useRef(!1);vu(()=>(le.current=!0,()=>{le.current=!1}),[]),vu(()=>{if(z&&(I.current=z),k&&(N.current=k),z&&k){if(q.current)return q.current(z,k,ue);ue()}},[z,k,ue,q,A]);const de=g.useMemo(()=>({reference:I,floating:N,setReference:O,setFloating:_}),[O,_]),L=g.useMemo(()=>({reference:z,floating:k}),[z,k]),G=g.useMemo(()=>{const B={position:a,left:0,top:0};if(!L.floating)return B;const ee=lx(L.floating,b.x),ie=lx(L.floating,b.y);return d?{...B,transform:"translate("+ee+"px, "+ie+"px)",...uw(L.floating)>=1.5&&{willChange:"transform"}}:{position:a,left:ee,top:ie}},[a,d,L.floating,b.x,b.y]);return g.useMemo(()=>({...b,update:ue,refs:de,elements:L,floatingStyles:G}),[b,ue,de,L,G])}const b_=t=>{function r(a){return{}.hasOwnProperty.call(a,"current")}return{name:"arrow",options:t,fn(a){const{element:l,padding:s}=typeof t=="function"?t(a):t;return l&&r(l)?l.current!=null?ix({element:l.current,padding:s}).fn(a):{}:l?ix({element:l,padding:s}).fn(a):{}}}},x_=(t,r)=>({...c_(t),options:[t,r]}),S_=(t,r)=>({...u_(t),options:[t,r]}),w_=(t,r)=>({...m_(t),options:[t,r]}),C_=(t,r)=>({...d_(t),options:[t,r]}),N_=(t,r)=>({...f_(t),options:[t,r]}),E_=(t,r)=>({...h_(t),options:[t,r]}),j_=(t,r)=>({...b_(t),options:[t,r]});var R_="Arrow",dw=g.forwardRef((t,r)=>{const{children:a,width:l=10,height:s=5,...c}=t;return h.jsx(Ie.svg,{...c,ref:r,width:l,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?a:h.jsx("polygon",{points:"0,0 30,0 15,10"})})});dw.displayName=R_;var M_=dw;function O_(t){const[r,a]=g.useState(void 0);return hn(()=>{if(t){a({width:t.offsetWidth,height:t.offsetHeight});const l=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const c=s[0];let u,d;if("borderBoxSize"in c){const m=c.borderBoxSize,v=Array.isArray(m)?m[0]:m;u=v.inlineSize,d=v.blockSize}else u=t.offsetWidth,d=t.offsetHeight;a({width:u,height:d})});return l.observe(t,{box:"border-box"}),()=>l.unobserve(t)}else a(void 0)},[t]),r}var Dp="Popper",[fw,id]=si(Dp),[D_,hw]=fw(Dp),mw=t=>{const{__scopePopper:r,children:a}=t,[l,s]=g.useState(null);return h.jsx(D_,{scope:r,anchor:l,onAnchorChange:s,children:a})};mw.displayName=Dp;var pw="PopperAnchor",vw=g.forwardRef((t,r)=>{const{__scopePopper:a,virtualRef:l,...s}=t,c=hw(pw,a),u=g.useRef(null),d=mt(r,u),m=g.useRef(null);return g.useEffect(()=>{const v=m.current;m.current=l?.current||u.current,v!==m.current&&c.onAnchorChange(m.current)}),l?null:h.jsx(Ie.div,{...s,ref:d})});vw.displayName=pw;var Tp="PopperContent",[T_,__]=fw(Tp),gw=g.forwardRef((t,r)=>{const{__scopePopper:a,side:l="bottom",sideOffset:s=0,align:c="center",alignOffset:u=0,arrowPadding:d=0,avoidCollisions:m=!0,collisionBoundary:v=[],collisionPadding:b=0,sticky:y="partial",hideWhenDetached:w=!1,updatePositionStrategy:C="optimized",onPlaced:E,...S}=t,R=hw(Tp,a),[M,O]=g.useState(null),_=mt(r,re=>O(re)),[z,k]=g.useState(null),I=O_(z),N=I?.width??0,T=I?.height??0,A=l+(c!=="center"?"-"+c:""),q=typeof b=="number"?b:{top:0,right:0,bottom:0,left:0,...b},K=Array.isArray(v)?v:[v],W=K.length>0,ue={padding:q,boundary:K.filter(z_),altBoundary:W},{refs:le,floatingStyles:de,placement:L,isPositioned:G,middlewareData:B}=y_({strategy:"fixed",placement:A,whileElementsMounted:(...re)=>s_(...re,{animationFrame:C==="always"}),elements:{reference:R.anchor},middleware:[x_({mainAxis:s+T,alignmentAxis:u}),m&&S_({mainAxis:!0,crossAxis:!1,limiter:y==="partial"?w_():void 0,...ue}),m&&C_({...ue}),N_({...ue,apply:({elements:re,rects:De,availableWidth:Ae,availableHeight:Te})=>{const{width:Ue,height:he}=De.reference,dt=re.floating.style;dt.setProperty("--radix-popper-available-width",`${Ae}px`),dt.setProperty("--radix-popper-available-height",`${Te}px`),dt.setProperty("--radix-popper-anchor-width",`${Ue}px`),dt.setProperty("--radix-popper-anchor-height",`${he}px`)}}),z&&j_({element:z,padding:d}),L_({arrowWidth:N,arrowHeight:T}),w&&E_({strategy:"referenceHidden",...ue})]}),[ee,ie]=xw(L),D=qr(E);hn(()=>{G&&D?.()},[G,D]);const Q=B.arrow?.x,J=B.arrow?.y,ne=B.arrow?.centerOffset!==0,[fe,me]=g.useState();return hn(()=>{M&&me(window.getComputedStyle(M).zIndex)},[M]),h.jsx("div",{ref:le.setFloating,"data-radix-popper-content-wrapper":"",style:{...de,transform:G?de.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:fe,"--radix-popper-transform-origin":[B.transformOrigin?.x,B.transformOrigin?.y].join(" "),...B.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:h.jsx(T_,{scope:a,placedSide:ee,onArrowChange:k,arrowX:Q,arrowY:J,shouldHideArrow:ne,children:h.jsx(Ie.div,{"data-side":ee,"data-align":ie,...S,ref:_,style:{...S.style,animation:G?void 0:"none"}})})})});gw.displayName=Tp;var yw="PopperArrow",A_={top:"bottom",right:"left",bottom:"top",left:"right"},bw=g.forwardRef(function(r,a){const{__scopePopper:l,...s}=r,c=__(yw,l),u=A_[c.placedSide];return h.jsx("span",{ref:c.onArrowChange,style:{position:"absolute",left:c.arrowX,top:c.arrowY,[u]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[c.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[c.placedSide],visibility:c.shouldHideArrow?"hidden":void 0},children:h.jsx(M_,{...s,ref:a,style:{...s.style,display:"block"}})})});bw.displayName=yw;function z_(t){return t!==null}var L_=t=>({name:"transformOrigin",options:t,fn(r){const{placement:a,rects:l,middlewareData:s}=r,u=s.arrow?.centerOffset!==0,d=u?0:t.arrowWidth,m=u?0:t.arrowHeight,[v,b]=xw(a),y={start:"0%",center:"50%",end:"100%"}[b],w=(s.arrow?.x??0)+d/2,C=(s.arrow?.y??0)+m/2;let E="",S="";return v==="bottom"?(E=u?y:`${w}px`,S=`${-m}px`):v==="top"?(E=u?y:`${w}px`,S=`${l.floating.height+m}px`):v==="right"?(E=`${-m}px`,S=u?y:`${C}px`):v==="left"&&(E=`${l.floating.width+m}px`,S=u?y:`${C}px`),{data:{x:E,y:S}}}});function xw(t){const[r,a="center"]=t.split("-");return[r,a]}var Sw=mw,ww=vw,Cw=gw,Nw=bw,k_="Portal",ld=g.forwardRef((t,r)=>{const{container:a,...l}=t,[s,c]=g.useState(!1);hn(()=>c(!0),[]);const u=a||s&&globalThis?.document?.body;return u?Gx.createPortal(h.jsx(Ie.div,{...l,ref:r}),u):null});ld.displayName=k_;function P_(t,r){return g.useReducer((a,l)=>r[a][l]??a,t)}var wa=t=>{const{present:r,children:a}=t,l=U_(r),s=typeof a=="function"?a({present:l.isPresent}):g.Children.only(a),c=mt(l.ref,B_(s));return typeof a=="function"||l.isPresent?g.cloneElement(s,{ref:c}):null};wa.displayName="Presence";function U_(t){const[r,a]=g.useState(),l=g.useRef(null),s=g.useRef(t),c=g.useRef("none"),u=t?"mounted":"unmounted",[d,m]=P_(u,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return g.useEffect(()=>{const v=ou(l.current);c.current=d==="mounted"?v:"none"},[d]),hn(()=>{const v=l.current,b=s.current;if(b!==t){const w=c.current,C=ou(v);t?m("MOUNT"):C==="none"||v?.display==="none"?m("UNMOUNT"):m(b&&w!==C?"ANIMATION_OUT":"UNMOUNT"),s.current=t}},[t,m]),hn(()=>{if(r){let v;const b=r.ownerDocument.defaultView??window,y=C=>{const S=ou(l.current).includes(CSS.escape(C.animationName));if(C.target===r&&S&&(m("ANIMATION_END"),!s.current)){const R=r.style.animationFillMode;r.style.animationFillMode="forwards",v=b.setTimeout(()=>{r.style.animationFillMode==="forwards"&&(r.style.animationFillMode=R)})}},w=C=>{C.target===r&&(c.current=ou(l.current))};return r.addEventListener("animationstart",w),r.addEventListener("animationcancel",y),r.addEventListener("animationend",y),()=>{b.clearTimeout(v),r.removeEventListener("animationstart",w),r.removeEventListener("animationcancel",y),r.removeEventListener("animationend",y)}}else m("ANIMATION_END")},[r,m]),{isPresent:["mounted","unmountSuspended"].includes(d),ref:g.useCallback(v=>{l.current=v?getComputedStyle(v):null,a(v)},[])}}function ou(t){return t?.animationName||"none"}function B_(t){let r=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,a=r&&"isReactWarning"in r&&r.isReactWarning;return a?t.ref:(r=Object.getOwnPropertyDescriptor(t,"ref")?.get,a=r&&"isReactWarning"in r&&r.isReactWarning,a?t.props.ref:t.props.ref||t.ref)}var om="rovingFocusGroup.onEntryFocus",H_={bubbles:!1,cancelable:!0},As="RovingFocusGroup",[Pm,Ew,q_]=wp(As),[I_,od]=si(As,[q_]),[Q_,V_]=I_(As),jw=g.forwardRef((t,r)=>h.jsx(Pm.Provider,{scope:t.__scopeRovingFocusGroup,children:h.jsx(Pm.Slot,{scope:t.__scopeRovingFocusGroup,children:h.jsx(F_,{...t,ref:r})})}));jw.displayName=As;var F_=g.forwardRef((t,r)=>{const{__scopeRovingFocusGroup:a,orientation:l,loop:s=!1,dir:c,currentTabStopId:u,defaultCurrentTabStopId:d,onCurrentTabStopIdChange:m,onEntryFocus:v,preventScrollOnEntryFocus:b=!1,...y}=t,w=g.useRef(null),C=mt(r,w),E=Ju(c),[S,R]=Gl({prop:u,defaultProp:d??null,onChange:m,caller:As}),[M,O]=g.useState(!1),_=qr(v),z=Ew(a),k=g.useRef(!1),[I,N]=g.useState(0);return g.useEffect(()=>{const T=w.current;if(T)return T.addEventListener(om,_),()=>T.removeEventListener(om,_)},[_]),h.jsx(Q_,{scope:a,orientation:l,dir:E,loop:s,currentTabStopId:S,onItemFocus:g.useCallback(T=>R(T),[R]),onItemShiftTab:g.useCallback(()=>O(!0),[]),onFocusableItemAdd:g.useCallback(()=>N(T=>T+1),[]),onFocusableItemRemove:g.useCallback(()=>N(T=>T-1),[]),children:h.jsx(Ie.div,{tabIndex:M||I===0?-1:0,"data-orientation":l,...y,ref:C,style:{outline:"none",...t.style},onMouseDown:Re(t.onMouseDown,()=>{k.current=!0}),onFocus:Re(t.onFocus,T=>{const A=!k.current;if(T.target===T.currentTarget&&A&&!M){const q=new CustomEvent(om,H_);if(T.currentTarget.dispatchEvent(q),!q.defaultPrevented){const K=z().filter(L=>L.focusable),W=K.find(L=>L.active),ue=K.find(L=>L.id===S),de=[W,ue,...K].filter(Boolean).map(L=>L.ref.current);Ow(de,b)}}k.current=!1}),onBlur:Re(t.onBlur,()=>O(!1))})})}),Rw="RovingFocusGroupItem",Mw=g.forwardRef((t,r)=>{const{__scopeRovingFocusGroup:a,focusable:l=!0,active:s=!1,tabStopId:c,children:u,...d}=t,m=Br(),v=c||m,b=V_(Rw,a),y=b.currentTabStopId===v,w=Ew(a),{onFocusableItemAdd:C,onFocusableItemRemove:E,currentTabStopId:S}=b;return g.useEffect(()=>{if(l)return C(),()=>E()},[l,C,E]),h.jsx(Pm.ItemSlot,{scope:a,id:v,focusable:l,active:s,children:h.jsx(Ie.span,{tabIndex:y?0:-1,"data-orientation":b.orientation,...d,ref:r,onMouseDown:Re(t.onMouseDown,R=>{l?b.onItemFocus(v):R.preventDefault()}),onFocus:Re(t.onFocus,()=>b.onItemFocus(v)),onKeyDown:Re(t.onKeyDown,R=>{if(R.key==="Tab"&&R.shiftKey){b.onItemShiftTab();return}if(R.target!==R.currentTarget)return;const M=K_(R,b.orientation,b.dir);if(M!==void 0){if(R.metaKey||R.ctrlKey||R.altKey||R.shiftKey)return;R.preventDefault();let _=w().filter(z=>z.focusable).map(z=>z.ref.current);if(M==="last")_.reverse();else if(M==="prev"||M==="next"){M==="prev"&&_.reverse();const z=_.indexOf(R.currentTarget);_=b.loop?X_(_,z+1):_.slice(z+1)}setTimeout(()=>Ow(_))}}),children:typeof u=="function"?u({isCurrentTabStop:y,hasTabStop:S!=null}):u})})});Mw.displayName=Rw;var G_={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Y_(t,r){return r!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function K_(t,r,a){const l=Y_(t.key,a);if(!(r==="vertical"&&["ArrowLeft","ArrowRight"].includes(l))&&!(r==="horizontal"&&["ArrowUp","ArrowDown"].includes(l)))return G_[l]}function Ow(t,r=!1){const a=document.activeElement;for(const l of t)if(l===a||(l.focus({preventScroll:r}),document.activeElement!==a))return}function X_(t,r){return t.map((a,l)=>t[(r+l)%t.length])}var Dw=jw,Tw=Mw,$_=function(t){if(typeof document>"u")return null;var r=Array.isArray(t)?t[0]:t;return r.ownerDocument.body},Ul=new WeakMap,su=new WeakMap,cu={},sm=0,_w=function(t){return t&&(t.host||_w(t.parentNode))},Z_=function(t,r){return r.map(function(a){if(t.contains(a))return a;var l=_w(a);return l&&t.contains(l)?l:(console.error("aria-hidden",a,"in not contained inside",t,". Doing nothing"),null)}).filter(function(a){return!!a})},J_=function(t,r,a,l){var s=Z_(r,Array.isArray(t)?t:[t]);cu[a]||(cu[a]=new WeakMap);var c=cu[a],u=[],d=new Set,m=new Set(s),v=function(y){!y||d.has(y)||(d.add(y),v(y.parentNode))};s.forEach(v);var b=function(y){!y||m.has(y)||Array.prototype.forEach.call(y.children,function(w){if(d.has(w))b(w);else try{var C=w.getAttribute(l),E=C!==null&&C!=="false",S=(Ul.get(w)||0)+1,R=(c.get(w)||0)+1;Ul.set(w,S),c.set(w,R),u.push(w),S===1&&E&&su.set(w,!0),R===1&&w.setAttribute(a,"true"),E||w.setAttribute(l,"true")}catch(M){console.error("aria-hidden: cannot operate on ",w,M)}})};return b(r),d.clear(),sm++,function(){u.forEach(function(y){var w=Ul.get(y)-1,C=c.get(y)-1;Ul.set(y,w),c.set(y,C),w||(su.has(y)||y.removeAttribute(l),su.delete(y)),C||y.removeAttribute(a)}),sm--,sm||(Ul=new WeakMap,Ul=new WeakMap,su=new WeakMap,cu={})}},_p=function(t,r,a){a===void 0&&(a="data-aria-hidden");var l=Array.from(Array.isArray(t)?t:[t]),s=$_(t);return s?(l.push.apply(l,Array.from(s.querySelectorAll("[aria-live], script"))),J_(l,s,a,"aria-hidden")):function(){return null}},Pr=function(){return Pr=Object.assign||function(r){for(var a,l=1,s=arguments.length;l<s;l++){a=arguments[l];for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(r[c]=a[c])}return r},Pr.apply(this,arguments)};function Aw(t,r){var a={};for(var l in t)Object.prototype.hasOwnProperty.call(t,l)&&r.indexOf(l)<0&&(a[l]=t[l]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,l=Object.getOwnPropertySymbols(t);s<l.length;s++)r.indexOf(l[s])<0&&Object.prototype.propertyIsEnumerable.call(t,l[s])&&(a[l[s]]=t[l[s]]);return a}function W_(t,r,a){if(a||arguments.length===2)for(var l=0,s=r.length,c;l<s;l++)(c||!(l in r))&&(c||(c=Array.prototype.slice.call(r,0,l)),c[l]=r[l]);return t.concat(c||Array.prototype.slice.call(r))}var gu="right-scroll-bar-position",yu="width-before-scroll-bar",eA="with-scroll-bars-hidden",tA="--removed-body-scroll-bar-size";function cm(t,r){return typeof t=="function"?t(r):t&&(t.current=r),t}function nA(t,r){var a=g.useState(function(){return{value:t,callback:r,facade:{get current(){return a.value},set current(l){var s=a.value;s!==l&&(a.value=l,a.callback(l,s))}}}})[0];return a.callback=r,a.facade}var rA=typeof window<"u"?g.useLayoutEffect:g.useEffect,ox=new WeakMap;function aA(t,r){var a=nA(null,function(l){return t.forEach(function(s){return cm(s,l)})});return rA(function(){var l=ox.get(a);if(l){var s=new Set(l),c=new Set(t),u=a.current;s.forEach(function(d){c.has(d)||cm(d,null)}),c.forEach(function(d){s.has(d)||cm(d,u)})}ox.set(a,t)},[t]),a}function iA(t){return t}function lA(t,r){r===void 0&&(r=iA);var a=[],l=!1,s={read:function(){if(l)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return a.length?a[a.length-1]:t},useMedium:function(c){var u=r(c,l);return a.push(u),function(){a=a.filter(function(d){return d!==u})}},assignSyncMedium:function(c){for(l=!0;a.length;){var u=a;a=[],u.forEach(c)}a={push:function(d){return c(d)},filter:function(){return a}}},assignMedium:function(c){l=!0;var u=[];if(a.length){var d=a;a=[],d.forEach(c),u=a}var m=function(){var b=u;u=[],b.forEach(c)},v=function(){return Promise.resolve().then(m)};v(),a={push:function(b){u.push(b),v()},filter:function(b){return u=u.filter(b),a}}}};return s}function oA(t){t===void 0&&(t={});var r=lA(null);return r.options=Pr({async:!0,ssr:!1},t),r}var zw=function(t){var r=t.sideCar,a=Aw(t,["sideCar"]);if(!r)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var l=r.read();if(!l)throw new Error("Sidecar medium not found");return g.createElement(l,Pr({},a))};zw.isSideCarExport=!0;function sA(t,r){return t.useMedium(r),zw}var Lw=oA(),um=function(){},sd=g.forwardRef(function(t,r){var a=g.useRef(null),l=g.useState({onScrollCapture:um,onWheelCapture:um,onTouchMoveCapture:um}),s=l[0],c=l[1],u=t.forwardProps,d=t.children,m=t.className,v=t.removeScrollBar,b=t.enabled,y=t.shards,w=t.sideCar,C=t.noRelative,E=t.noIsolation,S=t.inert,R=t.allowPinchZoom,M=t.as,O=M===void 0?"div":M,_=t.gapMode,z=Aw(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),k=w,I=aA([a,r]),N=Pr(Pr({},z),s);return g.createElement(g.Fragment,null,b&&g.createElement(k,{sideCar:Lw,removeScrollBar:v,shards:y,noRelative:C,noIsolation:E,inert:S,setCallbacks:c,allowPinchZoom:!!R,lockRef:a,gapMode:_}),u?g.cloneElement(g.Children.only(d),Pr(Pr({},N),{ref:I})):g.createElement(O,Pr({},N,{className:m,ref:I}),d))});sd.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};sd.classNames={fullWidth:yu,zeroRight:gu};var cA=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function uA(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var r=cA();return r&&t.setAttribute("nonce",r),t}function dA(t,r){t.styleSheet?t.styleSheet.cssText=r:t.appendChild(document.createTextNode(r))}function fA(t){var r=document.head||document.getElementsByTagName("head")[0];r.appendChild(t)}var hA=function(){var t=0,r=null;return{add:function(a){t==0&&(r=uA())&&(dA(r,a),fA(r)),t++},remove:function(){t--,!t&&r&&(r.parentNode&&r.parentNode.removeChild(r),r=null)}}},mA=function(){var t=hA();return function(r,a){g.useEffect(function(){return t.add(r),function(){t.remove()}},[r&&a])}},kw=function(){var t=mA(),r=function(a){var l=a.styles,s=a.dynamic;return t(l,s),null};return r},pA={left:0,top:0,right:0,gap:0},dm=function(t){return parseInt(t||"",10)||0},vA=function(t){var r=window.getComputedStyle(document.body),a=r[t==="padding"?"paddingLeft":"marginLeft"],l=r[t==="padding"?"paddingTop":"marginTop"],s=r[t==="padding"?"paddingRight":"marginRight"];return[dm(a),dm(l),dm(s)]},gA=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return pA;var r=vA(t),a=document.documentElement.clientWidth,l=window.innerWidth;return{left:r[0],top:r[1],right:r[2],gap:Math.max(0,l-a+r[2]-r[0])}},yA=kw(),Ql="data-scroll-locked",bA=function(t,r,a,l){var s=t.left,c=t.top,u=t.right,d=t.gap;return a===void 0&&(a="margin"),`
.`.concat(eA,` {
overflow: hidden `).concat(l,`;
padding-right: `).concat(d,"px ").concat(l,`;
}
body[`).concat(Ql,`] {
overflow: hidden `).concat(l,`;
overscroll-behavior: contain;
`).concat([r&&"position: relative ".concat(l,";"),a==="margin"&&`
padding-left: `.concat(s,`px;
padding-top: `).concat(c,`px;
padding-right: `).concat(u,`px;
margin-left:0;
margin-top:0;
margin-right: `).concat(d,"px ").concat(l,`;
`),a==="padding"&&"padding-right: ".concat(d,"px ").concat(l,";")].filter(Boolean).join(""),`
}
.`).concat(gu,` {
right: `).concat(d,"px ").concat(l,`;
}
.`).concat(yu,` {
margin-right: `).concat(d,"px ").concat(l,`;
}
.`).concat(gu," .").concat(gu,` {
right: 0 `).concat(l,`;
}
.`).concat(yu," .").concat(yu,` {
margin-right: 0 `).concat(l,`;
}
body[`).concat(Ql,`] {
`).concat(tA,": ").concat(d,`px;
}
`)},sx=function(){var t=parseInt(document.body.getAttribute(Ql)||"0",10);return isFinite(t)?t:0},xA=function(){g.useEffect(function(){return document.body.setAttribute(Ql,(sx()+1).toString()),function(){var t=sx()-1;t<=0?document.body.removeAttribute(Ql):document.body.setAttribute(Ql,t.toString())}},[])},SA=function(t){var r=t.noRelative,a=t.noImportant,l=t.gapMode,s=l===void 0?"margin":l;xA();var c=g.useMemo(function(){return gA(s)},[s]);return g.createElement(yA,{styles:bA(c,!r,s,a?"":"!important")})},Um=!1;if(typeof window<"u")try{var uu=Object.defineProperty({},"passive",{get:function(){return Um=!0,!0}});window.addEventListener("test",uu,uu),window.removeEventListener("test",uu,uu)}catch{Um=!1}var Bl=Um?{passive:!1}:!1,wA=function(t){return t.tagName==="TEXTAREA"},Pw=function(t,r){if(!(t instanceof Element))return!1;var a=window.getComputedStyle(t);return a[r]!=="hidden"&&!(a.overflowY===a.overflowX&&!wA(t)&&a[r]==="visible")},CA=function(t){return Pw(t,"overflowY")},NA=function(t){return Pw(t,"overflowX")},cx=function(t,r){var a=r.ownerDocument,l=r;do{typeof ShadowRoot<"u"&&l instanceof ShadowRoot&&(l=l.host);var s=Uw(t,l);if(s){var c=Bw(t,l),u=c[1],d=c[2];if(u>d)return!0}l=l.parentNode}while(l&&l!==a.body);return!1},EA=function(t){var r=t.scrollTop,a=t.scrollHeight,l=t.clientHeight;return[r,a,l]},jA=function(t){var r=t.scrollLeft,a=t.scrollWidth,l=t.clientWidth;return[r,a,l]},Uw=function(t,r){return t==="v"?CA(r):NA(r)},Bw=function(t,r){return t==="v"?EA(r):jA(r)},RA=function(t,r){return t==="h"&&r==="rtl"?-1:1},MA=function(t,r,a,l,s){var c=RA(t,window.getComputedStyle(r).direction),u=c*l,d=a.target,m=r.contains(d),v=!1,b=u>0,y=0,w=0;do{if(!d)break;var C=Bw(t,d),E=C[0],S=C[1],R=C[2],M=S-R-c*E;(E||M)&&Uw(t,d)&&(y+=M,w+=E);var O=d.parentNode;d=O&&O.nodeType===Node.DOCUMENT_FRAGMENT_NODE?O.host:O}while(!m&&d!==document.body||m&&(r.contains(d)||r===d));return(b&&Math.abs(y)<1||!b&&Math.abs(w)<1)&&(v=!0),v},du=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},ux=function(t){return[t.deltaX,t.deltaY]},dx=function(t){return t&&"current"in t?t.current:t},OA=function(t,r){return t[0]===r[0]&&t[1]===r[1]},DA=function(t){return`
.block-interactivity-`.concat(t,` {pointer-events: none;}
.allow-interactivity-`).concat(t,` {pointer-events: all;}
`)},TA=0,Hl=[];function _A(t){var r=g.useRef([]),a=g.useRef([0,0]),l=g.useRef(),s=g.useState(TA++)[0],c=g.useState(kw)[0],u=g.useRef(t);g.useEffect(function(){u.current=t},[t]),g.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(s));var S=W_([t.lockRef.current],(t.shards||[]).map(dx),!0).filter(Boolean);return S.forEach(function(R){return R.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),S.forEach(function(R){return R.classList.remove("allow-interactivity-".concat(s))})}}},[t.inert,t.lockRef.current,t.shards]);var d=g.useCallback(function(S,R){if("touches"in S&&S.touches.length===2||S.type==="wheel"&&S.ctrlKey)return!u.current.allowPinchZoom;var M=du(S),O=a.current,_="deltaX"in S?S.deltaX:O[0]-M[0],z="deltaY"in S?S.deltaY:O[1]-M[1],k,I=S.target,N=Math.abs(_)>Math.abs(z)?"h":"v";if("touches"in S&&N==="h"&&I.type==="range")return!1;var T=window.getSelection(),A=T&&T.anchorNode,q=A?A===I||A.contains(I):!1;if(q)return!1;var K=cx(N,I);if(!K)return!0;if(K?k=N:(k=N==="v"?"h":"v",K=cx(N,I)),!K)return!1;if(!l.current&&"changedTouches"in S&&(_||z)&&(l.current=k),!k)return!0;var W=l.current||k;return MA(W,R,S,W==="h"?_:z)},[]),m=g.useCallback(function(S){var R=S;if(!(!Hl.length||Hl[Hl.length-1]!==c)){var M="deltaY"in R?ux(R):du(R),O=r.current.filter(function(k){return k.name===R.type&&(k.target===R.target||R.target===k.shadowParent)&&OA(k.delta,M)})[0];if(O&&O.should){R.cancelable&&R.preventDefault();return}if(!O){var _=(u.current.shards||[]).map(dx).filter(Boolean).filter(function(k){return k.contains(R.target)}),z=_.length>0?d(R,_[0]):!u.current.noIsolation;z&&R.cancelable&&R.preventDefault()}}},[]),v=g.useCallback(function(S,R,M,O){var _={name:S,delta:R,target:M,should:O,shadowParent:AA(M)};r.current.push(_),setTimeout(function(){r.current=r.current.filter(function(z){return z!==_})},1)},[]),b=g.useCallback(function(S){a.current=du(S),l.current=void 0},[]),y=g.useCallback(function(S){v(S.type,ux(S),S.target,d(S,t.lockRef.current))},[]),w=g.useCallback(function(S){v(S.type,du(S),S.target,d(S,t.lockRef.current))},[]);g.useEffect(function(){return Hl.push(c),t.setCallbacks({onScrollCapture:y,onWheelCapture:y,onTouchMoveCapture:w}),document.addEventListener("wheel",m,Bl),document.addEventListener("touchmove",m,Bl),document.addEventListener("touchstart",b,Bl),function(){Hl=Hl.filter(function(S){return S!==c}),document.removeEventListener("wheel",m,Bl),document.removeEventListener("touchmove",m,Bl),document.removeEventListener("touchstart",b,Bl)}},[]);var C=t.removeScrollBar,E=t.inert;return g.createElement(g.Fragment,null,E?g.createElement(c,{styles:DA(s)}):null,C?g.createElement(SA,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function AA(t){for(var r=null;t!==null;)t instanceof ShadowRoot&&(r=t.host,t=t.host),t=t.parentNode;return r}const zA=sA(Lw,_A);var cd=g.forwardRef(function(t,r){return g.createElement(sd,Pr({},t,{ref:r,sideCar:zA}))});cd.classNames=sd.classNames;var Bm=["Enter"," "],LA=["ArrowDown","PageUp","Home"],Hw=["ArrowUp","PageDown","End"],kA=[...LA,...Hw],PA={ltr:[...Bm,"ArrowRight"],rtl:[...Bm,"ArrowLeft"]},UA={ltr:["ArrowLeft"],rtl:["ArrowRight"]},zs="Menu",[ys,BA,HA]=wp(zs),[Zi,qw]=si(zs,[HA,id,od]),ud=id(),Iw=od(),[qA,Ji]=Zi(zs),[IA,Ls]=Zi(zs),Qw=t=>{const{__scopeMenu:r,open:a=!1,children:l,dir:s,onOpenChange:c,modal:u=!0}=t,d=ud(r),[m,v]=g.useState(null),b=g.useRef(!1),y=qr(c),w=Ju(s);return g.useEffect(()=>{const C=()=>{b.current=!0,document.addEventListener("pointerdown",E,{capture:!0,once:!0}),document.addEventListener("pointermove",E,{capture:!0,once:!0})},E=()=>b.current=!1;return document.addEventListener("keydown",C,{capture:!0}),()=>{document.removeEventListener("keydown",C,{capture:!0}),document.removeEventListener("pointerdown",E,{capture:!0}),document.removeEventListener("pointermove",E,{capture:!0})}},[]),h.jsx(Sw,{...d,children:h.jsx(qA,{scope:r,open:a,onOpenChange:y,content:m,onContentChange:v,children:h.jsx(IA,{scope:r,onClose:g.useCallback(()=>y(!1),[y]),isUsingKeyboardRef:b,dir:w,modal:u,children:l})})})};Qw.displayName=zs;var QA="MenuAnchor",Ap=g.forwardRef((t,r)=>{const{__scopeMenu:a,...l}=t,s=ud(a);return h.jsx(ww,{...s,...l,ref:r})});Ap.displayName=QA;var zp="MenuPortal",[VA,Vw]=Zi(zp,{forceMount:void 0}),Fw=t=>{const{__scopeMenu:r,forceMount:a,children:l,container:s}=t,c=Ji(zp,r);return h.jsx(VA,{scope:r,forceMount:a,children:h.jsx(wa,{present:a||c.open,children:h.jsx(ld,{asChild:!0,container:s,children:l})})})};Fw.displayName=zp;var hr="MenuContent",[FA,Lp]=Zi(hr),Gw=g.forwardRef((t,r)=>{const a=Vw(hr,t.__scopeMenu),{forceMount:l=a.forceMount,...s}=t,c=Ji(hr,t.__scopeMenu),u=Ls(hr,t.__scopeMenu);return h.jsx(ys.Provider,{scope:t.__scopeMenu,children:h.jsx(wa,{present:l||c.open,children:h.jsx(ys.Slot,{scope:t.__scopeMenu,children:u.modal?h.jsx(GA,{...s,ref:r}):h.jsx(YA,{...s,ref:r})})})})}),GA=g.forwardRef((t,r)=>{const a=Ji(hr,t.__scopeMenu),l=g.useRef(null),s=mt(r,l);return g.useEffect(()=>{const c=l.current;if(c)return _p(c)},[]),h.jsx(kp,{...t,ref:s,trapFocus:a.open,disableOutsidePointerEvents:a.open,disableOutsideScroll:!0,onFocusOutside:Re(t.onFocusOutside,c=>c.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>a.onOpenChange(!1)})}),YA=g.forwardRef((t,r)=>{const a=Ji(hr,t.__scopeMenu);return h.jsx(kp,{...t,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>a.onOpenChange(!1)})}),KA=Yl("MenuContent.ScrollLock"),kp=g.forwardRef((t,r)=>{const{__scopeMenu:a,loop:l=!1,trapFocus:s,onOpenAutoFocus:c,onCloseAutoFocus:u,disableOutsidePointerEvents:d,onEntryFocus:m,onEscapeKeyDown:v,onPointerDownOutside:b,onFocusOutside:y,onInteractOutside:w,onDismiss:C,disableOutsideScroll:E,...S}=t,R=Ji(hr,a),M=Ls(hr,a),O=ud(a),_=Iw(a),z=BA(a),[k,I]=g.useState(null),N=g.useRef(null),T=mt(r,N,R.onContentChange),A=g.useRef(0),q=g.useRef(""),K=g.useRef(0),W=g.useRef(null),ue=g.useRef("right"),le=g.useRef(0),de=E?cd:g.Fragment,L=E?{as:KA,allowPinchZoom:!0}:void 0,G=ee=>{const ie=q.current+ee,D=z().filter(re=>!re.disabled),Q=document.activeElement,J=D.find(re=>re.ref.current===Q)?.textValue,ne=D.map(re=>re.textValue),fe=l4(ne,ie,J),me=D.find(re=>re.textValue===fe)?.ref.current;(function re(De){q.current=De,window.clearTimeout(A.current),De!==""&&(A.current=window.setTimeout(()=>re(""),1e3))})(ie),me&&setTimeout(()=>me.focus())};g.useEffect(()=>()=>window.clearTimeout(A.current),[]),Cp();const B=g.useCallback(ee=>ue.current===W.current?.side&&s4(ee,W.current?.area),[]);return h.jsx(FA,{scope:a,searchRef:q,onItemEnter:g.useCallback(ee=>{B(ee)&&ee.preventDefault()},[B]),onItemLeave:g.useCallback(ee=>{B(ee)||(N.current?.focus(),I(null))},[B]),onTriggerLeave:g.useCallback(ee=>{B(ee)&&ee.preventDefault()},[B]),pointerGraceTimerRef:K,onPointerGraceIntentChange:g.useCallback(ee=>{W.current=ee},[]),children:h.jsx(de,{...L,children:h.jsx(ed,{asChild:!0,trapped:s,onMountAutoFocus:Re(c,ee=>{ee.preventDefault(),N.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:u,children:h.jsx(Wu,{asChild:!0,disableOutsidePointerEvents:d,onEscapeKeyDown:v,onPointerDownOutside:b,onFocusOutside:y,onInteractOutside:w,onDismiss:C,children:h.jsx(Dw,{asChild:!0,..._,dir:M.dir,orientation:"vertical",loop:l,currentTabStopId:k,onCurrentTabStopIdChange:I,onEntryFocus:Re(m,ee=>{M.isUsingKeyboardRef.current||ee.preventDefault()}),preventScrollOnEntryFocus:!0,children:h.jsx(Cw,{role:"menu","aria-orientation":"vertical","data-state":s1(R.open),"data-radix-menu-content":"",dir:M.dir,...O,...S,ref:T,style:{outline:"none",...S.style},onKeyDown:Re(S.onKeyDown,ee=>{const D=ee.target.closest("[data-radix-menu-content]")===ee.currentTarget,Q=ee.ctrlKey||ee.altKey||ee.metaKey,J=ee.key.length===1;D&&(ee.key==="Tab"&&ee.preventDefault(),!Q&&J&&G(ee.key));const ne=N.current;if(ee.target!==ne||!kA.includes(ee.key))return;ee.preventDefault();const me=z().filter(re=>!re.disabled).map(re=>re.ref.current);Hw.includes(ee.key)&&me.reverse(),a4(me)}),onBlur:Re(t.onBlur,ee=>{ee.currentTarget.contains(ee.target)||(window.clearTimeout(A.current),q.current="")}),onPointerMove:Re(t.onPointerMove,bs(ee=>{const ie=ee.target,D=le.current!==ee.clientX;if(ee.currentTarget.contains(ie)&&D){const Q=ee.clientX>le.current?"right":"left";ue.current=Q,le.current=ee.clientX}}))})})})})})})});Gw.displayName=hr;var XA="MenuGroup",Pp=g.forwardRef((t,r)=>{const{__scopeMenu:a,...l}=t;return h.jsx(Ie.div,{role:"group",...l,ref:r})});Pp.displayName=XA;var $A="MenuLabel",Yw=g.forwardRef((t,r)=>{const{__scopeMenu:a,...l}=t;return h.jsx(Ie.div,{...l,ref:r})});Yw.displayName=$A;var ku="MenuItem",fx="menu.itemSelect",dd=g.forwardRef((t,r)=>{const{disabled:a=!1,onSelect:l,...s}=t,c=g.useRef(null),u=Ls(ku,t.__scopeMenu),d=Lp(ku,t.__scopeMenu),m=mt(r,c),v=g.useRef(!1),b=()=>{const y=c.current;if(!a&&y){const w=new CustomEvent(fx,{bubbles:!0,cancelable:!0});y.addEventListener(fx,C=>l?.(C),{once:!0}),$S(y,w),w.defaultPrevented?v.current=!1:u.onClose()}};return h.jsx(Kw,{...s,ref:m,disabled:a,onClick:Re(t.onClick,b),onPointerDown:y=>{t.onPointerDown?.(y),v.current=!0},onPointerUp:Re(t.onPointerUp,y=>{v.current||y.currentTarget?.click()}),onKeyDown:Re(t.onKeyDown,y=>{const w=d.searchRef.current!=="";a||w&&y.key===" "||Bm.includes(y.key)&&(y.currentTarget.click(),y.preventDefault())})})});dd.displayName=ku;var Kw=g.forwardRef((t,r)=>{const{__scopeMenu:a,disabled:l=!1,textValue:s,...c}=t,u=Lp(ku,a),d=Iw(a),m=g.useRef(null),v=mt(r,m),[b,y]=g.useState(!1),[w,C]=g.useState("");return g.useEffect(()=>{const E=m.current;E&&C((E.textContent??"").trim())},[c.children]),h.jsx(ys.ItemSlot,{scope:a,disabled:l,textValue:s??w,children:h.jsx(Tw,{asChild:!0,...d,focusable:!l,children:h.jsx(Ie.div,{role:"menuitem","data-highlighted":b?"":void 0,"aria-disabled":l||void 0,"data-disabled":l?"":void 0,...c,ref:v,onPointerMove:Re(t.onPointerMove,bs(E=>{l?u.onItemLeave(E):(u.onItemEnter(E),E.defaultPrevented||E.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Re(t.onPointerLeave,bs(E=>u.onItemLeave(E))),onFocus:Re(t.onFocus,()=>y(!0)),onBlur:Re(t.onBlur,()=>y(!1))})})})}),ZA="MenuCheckboxItem",Xw=g.forwardRef((t,r)=>{const{checked:a=!1,onCheckedChange:l,...s}=t;return h.jsx(e1,{scope:t.__scopeMenu,checked:a,children:h.jsx(dd,{role:"menuitemcheckbox","aria-checked":Pu(a)?"mixed":a,...s,ref:r,"data-state":Bp(a),onSelect:Re(s.onSelect,()=>l?.(Pu(a)?!0:!a),{checkForDefaultPrevented:!1})})})});Xw.displayName=ZA;var $w="MenuRadioGroup",[JA,WA]=Zi($w,{value:void 0,onValueChange:()=>{}}),Zw=g.forwardRef((t,r)=>{const{value:a,onValueChange:l,...s}=t,c=qr(l);return h.jsx(JA,{scope:t.__scopeMenu,value:a,onValueChange:c,children:h.jsx(Pp,{...s,ref:r})})});Zw.displayName=$w;var Jw="MenuRadioItem",Ww=g.forwardRef((t,r)=>{const{value:a,...l}=t,s=WA(Jw,t.__scopeMenu),c=a===s.value;return h.jsx(e1,{scope:t.__scopeMenu,checked:c,children:h.jsx(dd,{role:"menuitemradio","aria-checked":c,...l,ref:r,"data-state":Bp(c),onSelect:Re(l.onSelect,()=>s.onValueChange?.(a),{checkForDefaultPrevented:!1})})})});Ww.displayName=Jw;var Up="MenuItemIndicator",[e1,e4]=Zi(Up,{checked:!1}),t1=g.forwardRef((t,r)=>{const{__scopeMenu:a,forceMount:l,...s}=t,c=e4(Up,a);return h.jsx(wa,{present:l||Pu(c.checked)||c.checked===!0,children:h.jsx(Ie.span,{...s,ref:r,"data-state":Bp(c.checked)})})});t1.displayName=Up;var t4="MenuSeparator",n1=g.forwardRef((t,r)=>{const{__scopeMenu:a,...l}=t;return h.jsx(Ie.div,{role:"separator","aria-orientation":"horizontal",...l,ref:r})});n1.displayName=t4;var n4="MenuArrow",r1=g.forwardRef((t,r)=>{const{__scopeMenu:a,...l}=t,s=ud(a);return h.jsx(Nw,{...s,...l,ref:r})});r1.displayName=n4;var r4="MenuSub",[kk,a1]=Zi(r4),as="MenuSubTrigger",i1=g.forwardRef((t,r)=>{const a=Ji(as,t.__scopeMenu),l=Ls(as,t.__scopeMenu),s=a1(as,t.__scopeMenu),c=Lp(as,t.__scopeMenu),u=g.useRef(null),{pointerGraceTimerRef:d,onPointerGraceIntentChange:m}=c,v={__scopeMenu:t.__scopeMenu},b=g.useCallback(()=>{u.current&&window.clearTimeout(u.current),u.current=null},[]);return g.useEffect(()=>b,[b]),g.useEffect(()=>{const y=d.current;return()=>{window.clearTimeout(y),m(null)}},[d,m]),h.jsx(Ap,{asChild:!0,...v,children:h.jsx(Kw,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":a.open,"aria-controls":s.contentId,"data-state":s1(a.open),...t,ref:Ds(r,s.onTriggerChange),onClick:y=>{t.onClick?.(y),!(t.disabled||y.defaultPrevented)&&(y.currentTarget.focus(),a.open||a.onOpenChange(!0))},onPointerMove:Re(t.onPointerMove,bs(y=>{c.onItemEnter(y),!y.defaultPrevented&&!t.disabled&&!a.open&&!u.current&&(c.onPointerGraceIntentChange(null),u.current=window.setTimeout(()=>{a.onOpenChange(!0),b()},100))})),onPointerLeave:Re(t.onPointerLeave,bs(y=>{b();const w=a.content?.getBoundingClientRect();if(w){const C=a.content?.dataset.side,E=C==="right",S=E?-5:5,R=w[E?"left":"right"],M=w[E?"right":"left"];c.onPointerGraceIntentChange({area:[{x:y.clientX+S,y:y.clientY},{x:R,y:w.top},{x:M,y:w.top},{x:M,y:w.bottom},{x:R,y:w.bottom}],side:C}),window.clearTimeout(d.current),d.current=window.setTimeout(()=>c.onPointerGraceIntentChange(null),300)}else{if(c.onTriggerLeave(y),y.defaultPrevented)return;c.onPointerGraceIntentChange(null)}})),onKeyDown:Re(t.onKeyDown,y=>{const w=c.searchRef.current!=="";t.disabled||w&&y.key===" "||PA[l.dir].includes(y.key)&&(a.onOpenChange(!0),a.content?.focus(),y.preventDefault())})})})});i1.displayName=as;var l1="MenuSubContent",o1=g.forwardRef((t,r)=>{const a=Vw(hr,t.__scopeMenu),{forceMount:l=a.forceMount,...s}=t,c=Ji(hr,t.__scopeMenu),u=Ls(hr,t.__scopeMenu),d=a1(l1,t.__scopeMenu),m=g.useRef(null),v=mt(r,m);return h.jsx(ys.Provider,{scope:t.__scopeMenu,children:h.jsx(wa,{present:l||c.open,children:h.jsx(ys.Slot,{scope:t.__scopeMenu,children:h.jsx(kp,{id:d.contentId,"aria-labelledby":d.triggerId,...s,ref:v,align:"start",side:u.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:b=>{u.isUsingKeyboardRef.current&&m.current?.focus(),b.preventDefault()},onCloseAutoFocus:b=>b.preventDefault(),onFocusOutside:Re(t.onFocusOutside,b=>{b.target!==d.trigger&&c.onOpenChange(!1)}),onEscapeKeyDown:Re(t.onEscapeKeyDown,b=>{u.onClose(),b.preventDefault()}),onKeyDown:Re(t.onKeyDown,b=>{const y=b.currentTarget.contains(b.target),w=UA[u.dir].includes(b.key);y&&w&&(c.onOpenChange(!1),d.trigger?.focus(),b.preventDefault())})})})})})});o1.displayName=l1;function s1(t){return t?"open":"closed"}function Pu(t){return t==="indeterminate"}function Bp(t){return Pu(t)?"indeterminate":t?"checked":"unchecked"}function a4(t){const r=document.activeElement;for(const a of t)if(a===r||(a.focus(),document.activeElement!==r))return}function i4(t,r){return t.map((a,l)=>t[(r+l)%t.length])}function l4(t,r,a){const s=r.length>1&&Array.from(r).every(v=>v===r[0])?r[0]:r,c=a?t.indexOf(a):-1;let u=i4(t,Math.max(c,0));s.length===1&&(u=u.filter(v=>v!==a));const m=u.find(v=>v.toLowerCase().startsWith(s.toLowerCase()));return m!==a?m:void 0}function o4(t,r){const{x:a,y:l}=t;let s=!1;for(let c=0,u=r.length-1;c<r.length;u=c++){const d=r[c],m=r[u],v=d.x,b=d.y,y=m.x,w=m.y;b>l!=w>l&&a<(y-v)*(l-b)/(w-b)+v&&(s=!s)}return s}function s4(t,r){if(!r)return!1;const a={x:t.clientX,y:t.clientY};return o4(a,r)}function bs(t){return r=>r.pointerType==="mouse"?t(r):void 0}var c4=Qw,u4=Ap,d4=Fw,f4=Gw,h4=Pp,m4=Yw,p4=dd,v4=Xw,g4=Zw,y4=Ww,b4=t1,x4=n1,S4=r1,w4=i1,C4=o1,fd="DropdownMenu",[N4]=si(fd,[qw]),bn=qw(),[E4,c1]=N4(fd),u1=t=>{const{__scopeDropdownMenu:r,children:a,dir:l,open:s,defaultOpen:c,onOpenChange:u,modal:d=!0}=t,m=bn(r),v=g.useRef(null),[b,y]=Gl({prop:s,defaultProp:c??!1,onChange:u,caller:fd});return h.jsx(E4,{scope:r,triggerId:Br(),triggerRef:v,contentId:Br(),open:b,onOpenChange:y,onOpenToggle:g.useCallback(()=>y(w=>!w),[y]),modal:d,children:h.jsx(c4,{...m,open:b,onOpenChange:y,dir:l,modal:d,children:a})})};u1.displayName=fd;var d1="DropdownMenuTrigger",f1=g.forwardRef((t,r)=>{const{__scopeDropdownMenu:a,disabled:l=!1,...s}=t,c=c1(d1,a),u=bn(a);return h.jsx(u4,{asChild:!0,...u,children:h.jsx(Ie.button,{type:"button",id:c.triggerId,"aria-haspopup":"menu","aria-expanded":c.open,"aria-controls":c.open?c.contentId:void 0,"data-state":c.open?"open":"closed","data-disabled":l?"":void 0,disabled:l,...s,ref:Ds(r,c.triggerRef),onPointerDown:Re(t.onPointerDown,d=>{!l&&d.button===0&&d.ctrlKey===!1&&(c.onOpenToggle(),c.open||d.preventDefault())}),onKeyDown:Re(t.onKeyDown,d=>{l||(["Enter"," "].includes(d.key)&&c.onOpenToggle(),d.key==="ArrowDown"&&c.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(d.key)&&d.preventDefault())})})})});f1.displayName=d1;var j4="DropdownMenuPortal",h1=t=>{const{__scopeDropdownMenu:r,...a}=t,l=bn(r);return h.jsx(d4,{...l,...a})};h1.displayName=j4;var m1="DropdownMenuContent",p1=g.forwardRef((t,r)=>{const{__scopeDropdownMenu:a,...l}=t,s=c1(m1,a),c=bn(a),u=g.useRef(!1);return h.jsx(f4,{id:s.contentId,"aria-labelledby":s.triggerId,...c,...l,ref:r,onCloseAutoFocus:Re(t.onCloseAutoFocus,d=>{u.current||s.triggerRef.current?.focus(),u.current=!1,d.preventDefault()}),onInteractOutside:Re(t.onInteractOutside,d=>{const m=d.detail.originalEvent,v=m.button===0&&m.ctrlKey===!0,b=m.button===2||v;(!s.modal||b)&&(u.current=!0)}),style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});p1.displayName=m1;var R4="DropdownMenuGroup",M4=g.forwardRef((t,r)=>{const{__scopeDropdownMenu:a,...l}=t,s=bn(a);return h.jsx(h4,{...s,...l,ref:r})});M4.displayName=R4;var O4="DropdownMenuLabel",v1=g.forwardRef((t,r)=>{const{__scopeDropdownMenu:a,...l}=t,s=bn(a);return h.jsx(m4,{...s,...l,ref:r})});v1.displayName=O4;var D4="DropdownMenuItem",g1=g.forwardRef((t,r)=>{const{__scopeDropdownMenu:a,...l}=t,s=bn(a);return h.jsx(p4,{...s,...l,ref:r})});g1.displayName=D4;var T4="DropdownMenuCheckboxItem",y1=g.forwardRef((t,r)=>{const{__scopeDropdownMenu:a,...l}=t,s=bn(a);return h.jsx(v4,{...s,...l,ref:r})});y1.displayName=T4;var _4="DropdownMenuRadioGroup",A4=g.forwardRef((t,r)=>{const{__scopeDropdownMenu:a,...l}=t,s=bn(a);return h.jsx(g4,{...s,...l,ref:r})});A4.displayName=_4;var z4="DropdownMenuRadioItem",b1=g.forwardRef((t,r)=>{const{__scopeDropdownMenu:a,...l}=t,s=bn(a);return h.jsx(y4,{...s,...l,ref:r})});b1.displayName=z4;var L4="DropdownMenuItemIndicator",x1=g.forwardRef((t,r)=>{const{__scopeDropdownMenu:a,...l}=t,s=bn(a);return h.jsx(b4,{...s,...l,ref:r})});x1.displayName=L4;var k4="DropdownMenuSeparator",S1=g.forwardRef((t,r)=>{const{__scopeDropdownMenu:a,...l}=t,s=bn(a);return h.jsx(x4,{...s,...l,ref:r})});S1.displayName=k4;var P4="DropdownMenuArrow",U4=g.forwardRef((t,r)=>{const{__scopeDropdownMenu:a,...l}=t,s=bn(a);return h.jsx(S4,{...s,...l,ref:r})});U4.displayName=P4;var B4="DropdownMenuSubTrigger",w1=g.forwardRef((t,r)=>{const{__scopeDropdownMenu:a,...l}=t,s=bn(a);return h.jsx(w4,{...s,...l,ref:r})});w1.displayName=B4;var H4="DropdownMenuSubContent",C1=g.forwardRef((t,r)=>{const{__scopeDropdownMenu:a,...l}=t,s=bn(a);return h.jsx(C4,{...s,...l,ref:r,style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});C1.displayName=H4;var q4=u1,I4=f1,Q4=h1,N1=p1,E1=v1,j1=g1,R1=y1,M1=b1,O1=x1,D1=S1,T1=w1,_1=C1;const Hm=q4,qm=I4,V4=g.forwardRef(({className:t,inset:r,children:a,...l},s)=>h.jsxs(T1,{ref:s,className:ye("flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",r&&"pl-8",t),...l,children:[a,h.jsx(TS,{className:"ml-auto"})]}));V4.displayName=T1.displayName;const F4=g.forwardRef(({className:t,...r},a)=>h.jsx(_1,{ref:a,className:ye("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg 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-dropdown-menu-content-transform-origin]",t),...r}));F4.displayName=_1.displayName;const Uu=g.forwardRef(({className:t,sideOffset:r=4,...a},l)=>h.jsx(Q4,{children:h.jsx(N1,{ref:l,sideOffset:r,className:ye("z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md 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-dropdown-menu-content-transform-origin]",t),...a})}));Uu.displayName=N1.displayName;const xs=g.forwardRef(({className:t,inset:r,...a},l)=>h.jsx(j1,{ref:l,className:ye("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",r&&"pl-8",t),...a}));xs.displayName=j1.displayName;const G4=g.forwardRef(({className:t,children:r,checked:a,...l},s)=>h.jsxs(R1,{ref:s,className:ye("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),checked:a,...l,children:[h.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:h.jsx(O1,{children:h.jsx(DS,{className:"h-4 w-4"})})}),r]}));G4.displayName=R1.displayName;const Y4=g.forwardRef(({className:t,children:r,...a},l)=>h.jsxs(M1,{ref:l,className:ye("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...a,children:[h.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:h.jsx(O1,{children:h.jsx(gp,{className:"h-2 w-2 fill-current"})})}),r]}));Y4.displayName=M1.displayName;const Im=g.forwardRef(({className:t,inset:r,...a},l)=>h.jsx(E1,{ref:l,className:ye("px-2 py-1.5 text-sm font-semibold",r&&"pl-8",t),...a}));Im.displayName=E1.displayName;const Qm=g.forwardRef(({className:t,...r},a)=>h.jsx(D1,{ref:a,className:ye("-mx-1 my-1 h-px bg-muted",t),...r}));Qm.displayName=D1.displayName;const bu=[{id:"purple",name:"Purple",color:"hsl(270 80% 60%)"},{id:"ocean",name:"Ocean",color:"hsl(210 90% 55%)"},{id:"sunset",name:"Sunset",color:"hsl(25 95% 55%)"},{id:"forest",name:"Forest",color:"hsl(145 70% 40%)"},{id:"rose",name:"Rose",color:"hsl(350 80% 60%)"},{id:"slate",name:"Slate",color:"hsl(220 15% 35%)"}],K4=()=>{if(typeof window>"u")return"purple";const t=localStorage.getItem("color-theme");return bu.some(r=>r.id===t)?t:"purple"},X4=()=>{if(typeof window>"u")return"light";const t=localStorage.getItem("mode");return t==="light"||t==="dark"?t:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"},$4=()=>typeof window>"u"?!0:localStorage.getItem("sidebar-expanded")!=="false",Z4=[{to:"/companies",label:"Companies",icon:ma},{to:"/contacts",label:"Contacts",icon:zn},{to:"/deals",label:"Deals",icon:ni},{to:"/activities",label:"Activities",icon:ms}],J4=[{label:"New Company",icon:ma,path:"/companies",action:"create-company"},{label:"New Contact",icon:zn,path:"/contacts",action:"create-contact"},{label:"New Deal",icon:ni,path:"/deals",action:"create-deal"},{label:"New Activity",icon:ms,path:"/activities",action:"create-activity"}];function W4(){const[t,r]=g.useState(K4),[a,l]=g.useState(X4),[s,c]=g.useState($4),u=js();g.useEffect(()=>{const v=document.documentElement;bu.forEach(b=>v.classList.remove(`theme-${b.id}`)),v.classList.add(`theme-${t}`),v.classList.toggle("dark",a==="dark"),localStorage.setItem("color-theme",t),localStorage.setItem("mode",a)},[t,a]),g.useEffect(()=>{localStorage.setItem("sidebar-expanded",String(s))},[s]);const d=v=>{u(v.path,{state:{openCreate:!0}})},m=bu.find(v=>v.id===t);return h.jsxs("div",{className:"h-screen bg-background text-foreground flex overflow-hidden",children:[h.jsxs("aside",{className:ye("fixed inset-y-0 left-0 z-50 flex flex-col border-r border-border/50 bg-card/50 backdrop-blur-sm transition-all duration-300",s?"w-56":"w-16"),children:[h.jsxs("div",{className:ye("flex items-center h-14 border-b border-border/50 px-3",s?"justify-between":"justify-center"),children:[h.jsxs(C0,{to:"/",className:"flex items-center gap-2.5",children:[h.jsx("div",{className:"p-1.5 rounded-lg bg-gradient-to-br from-primary to-accent",children:h.jsx(tO,{className:"h-4 w-4 text-white"})}),s&&h.jsx("span",{className:"text-base font-semibold gradient-text",children:"CRM"})]}),s&&h.jsx(Ge,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>c(!1),children:h.jsx(NO,{className:"h-4 w-4"})})]}),h.jsxs("nav",{className:"flex-1 flex flex-col gap-1 p-2 overflow-y-auto",children:[!s&&h.jsx(Ge,{variant:"ghost",size:"icon",className:"h-9 w-full mb-2",onClick:()=>c(!0),children:h.jsx(jO,{className:"h-4 w-4"})}),Z4.map(v=>h.jsxs(C0,{to:v.to,className:({isActive:b})=>ye("flex items-center gap-3 rounded-lg text-sm font-medium transition-all duration-200",s?"px-3 py-2.5":"px-0 py-2.5 justify-center",b?"bg-primary/10 text-primary":"text-muted-foreground hover:text-foreground hover:bg-muted"),title:s?void 0:v.label,children:[h.jsx(v.icon,{className:"h-4 w-4 shrink-0"}),s&&h.jsx("span",{children:v.label})]},v.to))]}),h.jsxs("div",{className:ye("border-t border-border/50 p-2 space-y-1",!s&&"flex flex-col items-center"),children:[h.jsxs(Hm,{children:[h.jsx(qm,{asChild:!0,children:h.jsxs(Ge,{variant:"ghost",className:ye("h-9 gap-2",s?"w-full justify-start px-3":"w-9 p-0"),children:[h.jsx("div",{className:"w-4 h-4 rounded-full shrink-0 border border-border",style:{backgroundColor:m?.color}}),s&&h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"flex-1 text-left text-sm",children:m?.name}),h.jsx($u,{className:"h-3 w-3 opacity-50"})]})]})}),h.jsxs(Uu,{side:s?"top":"right",align:s?"start":"center",className:"w-40",children:[h.jsx(Im,{className:"text-xs",children:"Theme Color"}),h.jsx(Qm,{}),bu.map(v=>h.jsxs(xs,{onClick:()=>r(v.id),className:"flex items-center gap-2.5 cursor-pointer",children:[h.jsx("div",{className:"w-3.5 h-3.5 rounded-full shrink-0 border border-border",style:{backgroundColor:v.color}}),h.jsx("span",{className:t===v.id?"font-medium":"",children:v.name})]},v.id))]})]}),h.jsxs(Ge,{variant:"ghost",className:ye("h-9 gap-2",s?"w-full justify-start px-3":"w-9 p-0"),onClick:()=>l(v=>v==="dark"?"light":"dark"),children:[a==="dark"?h.jsx(BO,{className:"h-4 w-4 shrink-0"}):h.jsx(wO,{className:"h-4 w-4 shrink-0"}),s&&h.jsx("span",{className:"text-sm",children:a==="dark"?"Light Mode":"Dark Mode"})]})]})]}),h.jsxs("div",{className:ye("flex-1 flex flex-col min-w-0 transition-all duration-300",s?"ml-56":"ml-16"),children:[h.jsx("header",{className:"flex-shrink-0 z-40 h-14 border-b border-border/50 bg-background/80 backdrop-blur-sm flex items-center justify-end px-6",children:h.jsxs(Hm,{children:[h.jsx(qm,{asChild:!0,children:h.jsx(Ge,{size:"icon",className:"h-9 w-9",children:h.jsx($i,{className:"h-4 w-4"})})}),h.jsxs(Uu,{align:"end",className:"w-48",children:[h.jsx(Im,{className:"text-xs",children:"Quick Create"}),h.jsx(Qm,{}),J4.map(v=>h.jsxs(xs,{onClick:()=>d(v),className:"flex items-center gap-2.5 cursor-pointer",children:[h.jsx(v.icon,{className:"h-4 w-4 text-muted-foreground"}),h.jsx("span",{children:v.label})]},v.action))]})]})}),h.jsx("main",{className:"flex-1 min-h-0 overflow-auto",children:h.jsx(CR,{})})]})]})}function Qi(t){return!!t&&!Array.isArray(t)&&typeof t=="object"}function e3(){return Object.create(null)}const t3=typeof Symbol=="function"&&!!Symbol.asyncIterator;function A1(t){return t3&&Qi(t)&&Symbol.asyncIterator in t}var n3=Object.create,z1=Object.defineProperty,r3=Object.getOwnPropertyDescriptor,L1=Object.getOwnPropertyNames,a3=Object.getPrototypeOf,i3=Object.prototype.hasOwnProperty,ks=(t,r)=>function(){return r||(0,t[L1(t)[0]])((r={exports:{}}).exports,r),r.exports},l3=(t,r,a,l)=>{if(r&&typeof r=="object"||typeof r=="function")for(var s=L1(r),c=0,u=s.length,d;c<u;c++)d=s[c],!i3.call(t,d)&&d!==a&&z1(t,d,{get:(m=>r[m]).bind(null,d),enumerable:!(l=r3(r,d))||l.enumerable});return t},hd=(t,r,a)=>(a=t!=null?n3(a3(t)):{},l3(z1(a,"default",{value:t,enumerable:!0}),t));const k1=()=>{},hx=t=>{Object.freeze&&Object.freeze(t)};function P1(t,r,a){var l;const s=r.join(".");return(l=a[s])!==null&&l!==void 0||(a[s]=new Proxy(k1,{get(c,u){if(!(typeof u!="string"||u==="then"))return P1(t,[...r,u],a)},apply(c,u,d){const m=r[r.length-1];let v={args:d,path:r};return m==="call"?v={args:d.length>=2?[d[1]]:[],path:r.slice(0,-1)}:m==="apply"&&(v={args:d.length>=2?d[1]:[],path:r.slice(0,-1)}),hx(v.args),hx(v.path),t(v)}})),a[s]}const md=t=>P1(t,[],e3()),Hp=t=>new Proxy(k1,{get(r,a){if(a!=="then")return t(a)}});var U1=ks({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js"(t,r){function a(l){"@babel/helpers - typeof";return r.exports=a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(s){return typeof s}:function(s){return s&&typeof Symbol=="function"&&s.constructor===Symbol&&s!==Symbol.prototype?"symbol":typeof s},r.exports.__esModule=!0,r.exports.default=r.exports,a(l)}r.exports=a,r.exports.__esModule=!0,r.exports.default=r.exports}}),o3=ks({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(t,r){var a=U1().default;function l(s,c){if(a(s)!="object"||!s)return s;var u=s[Symbol.toPrimitive];if(u!==void 0){var d=u.call(s,c||"default");if(a(d)!="object")return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return(c==="string"?String:Number)(s)}r.exports=l,r.exports.__esModule=!0,r.exports.default=r.exports}}),s3=ks({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(t,r){var a=U1().default,l=o3();function s(c){var u=l(c,"string");return a(u)=="symbol"?u:u+""}r.exports=s,r.exports.__esModule=!0,r.exports.default=r.exports}}),B1=ks({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(t,r){var a=s3();function l(s,c,u){return(c=a(c))in s?Object.defineProperty(s,c,{value:u,enumerable:!0,configurable:!0,writable:!0}):s[c]=u,s}r.exports=l,r.exports.__esModule=!0,r.exports.default=r.exports}}),qp=ks({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(t,r){var a=B1();function l(c,u){var d=Object.keys(c);if(Object.getOwnPropertySymbols){var m=Object.getOwnPropertySymbols(c);u&&(m=m.filter(function(v){return Object.getOwnPropertyDescriptor(c,v).enumerable})),d.push.apply(d,m)}return d}function s(c){for(var u=1;u<arguments.length;u++){var d=arguments[u]!=null?arguments[u]:{};u%2?l(Object(d),!0).forEach(function(m){a(c,m,d[m])}):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):l(Object(d)).forEach(function(m){Object.defineProperty(c,m,Object.getOwnPropertyDescriptor(d,m))})}return c}r.exports=s,r.exports.__esModule=!0,r.exports.default=r.exports}});hd(qp());hd(B1());var fu=hd(qp());function c3(t,r){if("error"in t){const l=r.deserialize(t.error);return{ok:!1,error:(0,fu.default)((0,fu.default)({},t),{},{error:l})}}return{ok:!0,result:(0,fu.default)((0,fu.default)({},t.result),(!t.result.type||t.result.type==="data")&&{type:"data",data:r.deserialize(t.result.data)})}}var fm=class extends Error{constructor(){super("Unable to transform response from server")}};function u3(t,r){let a;try{a=c3(t,r)}catch{throw new fm}if(!a.ok&&(!Qi(a.error.error)||typeof a.error.error.code!="number"))throw new fm;if(a.ok&&!Qi(a.result))throw new fm;return a}hd(qp());function pd(t){const r={subscribe(a){let l=null,s=!1,c=!1,u=!1;function d(){if(l===null){u=!0;return}c||(c=!0,typeof l=="function"?l():l&&l.unsubscribe())}return l=t({next(m){var v;s||(v=a.next)===null||v===void 0||v.call(a,m)},error(m){var v;s||(s=!0,(v=a.error)===null||v===void 0||v.call(a,m),d())},complete(){var m;s||(s=!0,(m=a.complete)===null||m===void 0||m.call(a),d())}}),u&&d(),{unsubscribe:d}},pipe(...a){return a.reduce(d3,r)}};return r}function d3(t,r){return r(t)}function f3(t){const r=new AbortController;return new Promise((l,s)=>{let c=!1;function u(){c||(c=!0,d.unsubscribe())}r.signal.addEventListener("abort",()=>{s(r.signal.reason)});const d=t.subscribe({next(m){c=!0,l(m),u()},error(m){s(m)},complete(){r.abort(),u()}})})}var h3=Object.create,H1=Object.defineProperty,m3=Object.getOwnPropertyDescriptor,q1=Object.getOwnPropertyNames,p3=Object.getPrototypeOf,v3=Object.prototype.hasOwnProperty,ci=(t,r)=>function(){return r||(0,t[q1(t)[0]])((r={exports:{}}).exports,r),r.exports},g3=(t,r,a,l)=>{if(r&&typeof r=="object"||typeof r=="function")for(var s=q1(r),c=0,u=s.length,d;c<u;c++)d=s[c],!v3.call(t,d)&&d!==a&&H1(t,d,{get:(m=>r[m]).bind(null,d),enumerable:!(l=m3(r,d))||l.enumerable});return t},Wi=(t,r,a)=>(a=t!=null?h3(p3(t)):{},g3(r||!t||!t.__esModule?H1(a,"default",{value:t,enumerable:!0}):a,t)),y3=ci({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectWithoutPropertiesLoose.js"(t,r){function a(l,s){if(l==null)return{};var c={};for(var u in l)if({}.hasOwnProperty.call(l,u)){if(s.includes(u))continue;c[u]=l[u]}return c}r.exports=a,r.exports.__esModule=!0,r.exports.default=r.exports}}),b3=ci({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectWithoutProperties.js"(t,r){var a=y3();function l(s,c){if(s==null)return{};var u,d,m=a(s,c);if(Object.getOwnPropertySymbols){var v=Object.getOwnPropertySymbols(s);for(d=0;d<v.length;d++)u=v[d],c.includes(u)||{}.propertyIsEnumerable.call(s,u)&&(m[u]=s[u])}return m}r.exports=l,r.exports.__esModule=!0,r.exports.default=r.exports}}),I1=ci({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js"(t,r){function a(l){"@babel/helpers - typeof";return r.exports=a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(s){return typeof s}:function(s){return s&&typeof Symbol=="function"&&s.constructor===Symbol&&s!==Symbol.prototype?"symbol":typeof s},r.exports.__esModule=!0,r.exports.default=r.exports,a(l)}r.exports=a,r.exports.__esModule=!0,r.exports.default=r.exports}}),x3=ci({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(t,r){var a=I1().default;function l(s,c){if(a(s)!="object"||!s)return s;var u=s[Symbol.toPrimitive];if(u!==void 0){var d=u.call(s,c||"default");if(a(d)!="object")return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return(c==="string"?String:Number)(s)}r.exports=l,r.exports.__esModule=!0,r.exports.default=r.exports}}),S3=ci({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(t,r){var a=I1().default,l=x3();function s(c){var u=l(c,"string");return a(u)=="symbol"?u:u+""}r.exports=s,r.exports.__esModule=!0,r.exports.default=r.exports}}),w3=ci({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(t,r){var a=S3();function l(s,c,u){return(c=a(c))in s?Object.defineProperty(s,c,{value:u,enumerable:!0,configurable:!0,writable:!0}):s[c]=u,s}r.exports=l,r.exports.__esModule=!0,r.exports.default=r.exports}}),Ps=ci({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(t,r){var a=w3();function l(c,u){var d=Object.keys(c);if(Object.getOwnPropertySymbols){var m=Object.getOwnPropertySymbols(c);u&&(m=m.filter(function(v){return Object.getOwnPropertyDescriptor(c,v).enumerable})),d.push.apply(d,m)}return d}function s(c){for(var u=1;u<arguments.length;u++){var d=arguments[u]!=null?arguments[u]:{};u%2?l(Object(d),!0).forEach(function(m){a(c,m,d[m])}):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):l(Object(d)).forEach(function(m){Object.defineProperty(c,m,Object.getOwnPropertyDescriptor(d,m))})}return c}r.exports=s,r.exports.__esModule=!0,r.exports.default=r.exports}}),C3=Wi(b3(),1),mx=Wi(Ps(),1);const N3=["cursor","direction"];function kr(t,r,a){const l=t.flatMap(s=>s.split("."));if(!r&&(!a||a==="any"))return l.length?[l]:[];if(a==="infinite"&&Qi(r)&&("direction"in r||"cursor"in r)){const{cursor:s,direction:c}=r,u=(0,C3.default)(r,N3);return[l,{input:u,type:"infinite"}]}return[l,(0,mx.default)((0,mx.default)({},typeof r<"u"&&r!==Gn&&{input:r}),a&&a!=="any"&&{type:a})]}function xu(t){return kr(t,void 0,"any")}var E3=Object.create,Q1=Object.defineProperty,j3=Object.getOwnPropertyDescriptor,V1=Object.getOwnPropertyNames,R3=Object.getPrototypeOf,M3=Object.prototype.hasOwnProperty,Vr=(t,r)=>function(){return r||(0,t[V1(t)[0]])((r={exports:{}}).exports,r),r.exports},O3=(t,r,a,l)=>{if(r&&typeof r=="object"||typeof r=="function")for(var s=V1(r),c=0,u=s.length,d;c<u;c++)d=s[c],!M3.call(t,d)&&d!==a&&Q1(t,d,{get:(m=>r[m]).bind(null,d),enumerable:!(l=j3(r,d))||l.enumerable});return t},Pt=(t,r,a)=>(a=t!=null?E3(R3(t)):{},O3(Q1(a,"default",{value:t,enumerable:!0}),t)),F1=Vr({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js"(t,r){function a(l){"@babel/helpers - typeof";return r.exports=a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(s){return typeof s}:function(s){return s&&typeof Symbol=="function"&&s.constructor===Symbol&&s!==Symbol.prototype?"symbol":typeof s},r.exports.__esModule=!0,r.exports.default=r.exports,a(l)}r.exports=a,r.exports.__esModule=!0,r.exports.default=r.exports}}),D3=Vr({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(t,r){var a=F1().default;function l(s,c){if(a(s)!="object"||!s)return s;var u=s[Symbol.toPrimitive];if(u!==void 0){var d=u.call(s,c||"default");if(a(d)!="object")return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return(c==="string"?String:Number)(s)}r.exports=l,r.exports.__esModule=!0,r.exports.default=r.exports}}),T3=Vr({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(t,r){var a=F1().default,l=D3();function s(c){var u=l(c,"string");return a(u)=="symbol"?u:u+""}r.exports=s,r.exports.__esModule=!0,r.exports.default=r.exports}}),el=Vr({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(t,r){var a=T3();function l(s,c,u){return(c=a(c))in s?Object.defineProperty(s,c,{value:u,enumerable:!0,configurable:!0,writable:!0}):s[c]=u,s}r.exports=l,r.exports.__esModule=!0,r.exports.default=r.exports}}),Er=Vr({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(t,r){var a=el();function l(c,u){var d=Object.keys(c);if(Object.getOwnPropertySymbols){var m=Object.getOwnPropertySymbols(c);u&&(m=m.filter(function(v){return Object.getOwnPropertyDescriptor(c,v).enumerable})),d.push.apply(d,m)}return d}function s(c){for(var u=1;u<arguments.length;u++){var d=arguments[u]!=null?arguments[u]:{};u%2?l(Object(d),!0).forEach(function(m){a(c,m,d[m])}):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):l(Object(d)).forEach(function(m){Object.defineProperty(c,m,Object.getOwnPropertyDescriptor(d,m))})}return c}r.exports=s,r.exports.__esModule=!0,r.exports.default=r.exports}});function _3(t){return r=>{let a=0,l=null;const s=[];function c(){l||(l=r.subscribe({next(d){for(const v of s){var m;(m=v.next)===null||m===void 0||m.call(v,d)}},error(d){for(const v of s){var m;(m=v.error)===null||m===void 0||m.call(v,d)}},complete(){for(const m of s){var d;(d=m.complete)===null||d===void 0||d.call(m)}}}))}function u(){if(a===0&&l){const d=l;l=null,d.unsubscribe()}}return pd(d=>(a++,s.push(d),c(),{unsubscribe(){a--,u();const m=s.findIndex(v=>v===d);m>-1&&s.splice(m,1)}}))}}function A3(t){let r=t;const a=[],l=u=>{r!==void 0&&u.next(r),a.push(u)},s=u=>{a.splice(a.indexOf(u),1)},c=pd(u=>(l(u),()=>{s(u)}));return c.next=u=>{if(r!==u){r=u;for(const d of a)d.next(u)}},c.get=()=>r,c}function z3(t){return pd(r=>{function a(s=0,c=t.op){const u=t.links[s];if(!u)throw new Error("No more links to execute - did you forget to add an ending link?");return u({op:c,next(m){return a(s+1,m)}})}return a().subscribe(r)})}var hu=Pt(el()),ql=Pt(Er());function L3(t){return t instanceof Bu}function k3(t){return Qi(t)&&Qi(t.error)&&typeof t.error.code=="number"&&typeof t.error.message=="string"}function P3(t,r){return typeof t=="string"?t:Qi(t)&&typeof t.message=="string"?t.message:r}var Bu=class Su extends Error{constructor(r,a){var l,s;const c=a?.cause;super(r,{cause:c}),(0,hu.default)(this,"cause",void 0),(0,hu.default)(this,"shape",void 0),(0,hu.default)(this,"data",void 0),(0,hu.default)(this,"meta",void 0),this.meta=a?.meta,this.cause=c,this.shape=a==null||(l=a.result)===null||l===void 0?void 0:l.error,this.data=a==null||(s=a.result)===null||s===void 0?void 0:s.error.data,this.name="TRPCClientError",Object.setPrototypeOf(this,Su.prototype)}static from(r,a={}){const l=r;return L3(l)?(a.meta&&(l.meta=(0,ql.default)((0,ql.default)({},l.meta),a.meta)),l):k3(l)?new Su(l.error.message,(0,ql.default)((0,ql.default)({},a),{},{result:l})):new Su(P3(l,"Unknown error"),(0,ql.default)((0,ql.default)({},a),{},{cause:l}))}};function U3(t){const r=t;return r?"input"in r?r:{input:r,output:r}:{input:{serialize:a=>a,deserialize:a=>a},output:{serialize:a=>a,deserialize:a=>a}}}const px=t=>typeof t=="function";function B3(t){if(t)return t;if(typeof window<"u"&&px(window.fetch))return window.fetch;if(typeof globalThis<"u"&&px(globalThis.fetch))return globalThis.fetch;throw new Error("No fetch implementation found")}var ls=Pt(Er());function H3(t){return{url:t.url.toString(),fetch:t.fetch,transformer:U3(t.transformer),methodOverride:t.methodOverride}}function q3(t){const r={};for(let a=0;a<t.length;a++){const l=t[a];r[a]=l}return r}const I3={query:"GET",mutation:"POST",subscription:"PATCH"};function G1(t){return"input"in t?t.transformer.input.serialize(t.input):q3(t.inputs.map(r=>t.transformer.input.serialize(r)))}const Y1=t=>{const r=t.url.split("?");let l=r[0].replace(/\/$/,"")+"/"+t.path;const s=[];if(r[1]&&s.push(r[1]),"inputs"in t&&s.push("batch=1"),t.type==="query"||t.type==="subscription"){const c=G1(t);c!==void 0&&t.methodOverride!=="POST"&&s.push(`input=${encodeURIComponent(JSON.stringify(c))}`)}return s.length&&(l+="?"+s.join("&")),l},Q3=t=>{if(t.type==="query"&&t.methodOverride!=="POST")return;const r=G1(t);return r!==void 0?JSON.stringify(r):void 0},V3=t=>K3((0,ls.default)((0,ls.default)({},t),{},{contentTypeHeader:"application/json",getUrl:Y1,getBody:Q3}));var F3=class extends Error{constructor(){const t="AbortError";super(t),this.name=t,this.message=t}};const G3=t=>{var r;if(t?.aborted)throw(r=t.throwIfAborted)===null||r===void 0||r.call(t),typeof DOMException<"u"?new DOMException("AbortError","AbortError"):new F3};async function Y3(t){var r;G3(t.signal);const a=t.getUrl(t),l=t.getBody(t),s=(r=t.methodOverride)!==null&&r!==void 0?r:I3[t.type],c=await(async()=>{const d=await t.headers();return Symbol.iterator in d?Object.fromEntries(d):d})(),u=(0,ls.default)((0,ls.default)((0,ls.default)({},t.contentTypeHeader&&s!=="GET"?{"content-type":t.contentTypeHeader}:{}),t.trpcAcceptHeader?{"trpc-accept":t.trpcAcceptHeader}:void 0),c);return B3(t.fetch)(a,{method:s,signal:t.signal,body:l,headers:u})}async function K3(t){const r={},a=await Y3(t);r.response=a;const l=await a.json();return r.responseJSON=l,{json:l,meta:r}}Pt(Er());const vx=()=>{throw new Error("Something went wrong. Please submit an issue at https://github.com/trpc/trpc/issues/new")};function gx(t){let r=null,a=null;const l=()=>{clearTimeout(a),a=null,r=null};function s(d){const m=[[]];let v=0;for(;;){const w=d[v];if(!w)break;const C=m[m.length-1];if(w.aborted){var b;(b=w.reject)===null||b===void 0||b.call(w,new Error("Aborted")),v++;continue}if(t.validate(C.concat(w).map(S=>S.key))){C.push(w),v++;continue}if(C.length===0){var y;(y=w.reject)===null||y===void 0||y.call(w,new Error("Input is too big for a single dispatch")),v++;continue}m.push([])}return m}function c(){const d=s(r);l();for(const m of d){if(!m.length)continue;const v={items:m};for(const y of m)y.batch=v;t.fetch(v.items.map(y=>y.key)).then(async y=>{await Promise.all(y.map(async(C,E)=>{const S=v.items[E];try{var R;const O=await Promise.resolve(C);(R=S.resolve)===null||R===void 0||R.call(S,O)}catch(O){var M;(M=S.reject)===null||M===void 0||M.call(S,O)}S.batch=null,S.reject=null,S.resolve=null}));for(const C of v.items){var w;(w=C.reject)===null||w===void 0||w.call(C,new Error("Missing result")),C.batch=null}}).catch(y=>{for(const C of v.items){var w;(w=C.reject)===null||w===void 0||w.call(C,y),C.batch=null}})}}function u(d){var m;const v={aborted:!1,key:d,batch:null,resolve:vx,reject:vx},b=new Promise((y,w)=>{var C;v.reject=w,v.resolve=y,(C=r)!==null&&C!==void 0||(r=[]),r.push(v)});return(m=a)!==null&&m!==void 0||(a=setTimeout(c)),b}return{load:u}}function X3(...t){const r=new AbortController,a=t.length;let l=0;const s=()=>{++l===a&&r.abort()};for(const c of t)c?.aborted?s():c?.addEventListener("abort",s,{once:!0});return r.signal}var mu=Pt(Er());function $3(t){var r,a;const l=H3(t),s=(r=t.maxURLLength)!==null&&r!==void 0?r:1/0,c=(a=t.maxItems)!==null&&a!==void 0?a:1/0;return()=>{const u=b=>({validate(y){if(s===1/0&&c===1/0)return!0;if(y.length>c)return!1;const w=y.map(S=>S.path).join(","),C=y.map(S=>S.input);return Y1((0,mu.default)((0,mu.default)({},l),{},{type:b,path:w,inputs:C,signal:null})).length<=s},async fetch(y){const w=y.map(O=>O.path).join(","),C=y.map(O=>O.input),E=X3(...y.map(O=>O.signal)),S=await V3((0,mu.default)((0,mu.default)({},l),{},{path:w,inputs:C,type:b,headers(){return t.headers?typeof t.headers=="function"?t.headers({opList:y}):t.headers:{}},signal:E}));return(Array.isArray(S.json)?S.json:y.map(()=>S.json)).map(O=>({meta:S.meta,json:O}))}}),d=gx(u("query")),m=gx(u("mutation")),v={query:d,mutation:m};return({op:b})=>pd(y=>{if(b.type==="subscription")throw new Error("Subscriptions are unsupported by `httpLink` - use `httpSubscriptionLink` or `wsLink`");const C=v[b.type].load(b);let E;return C.then(S=>{E=S;const R=u3(S.json,l.transformer.output);if(!R.ok){y.error(Bu.from(R.error,{meta:S.meta}));return}y.next({context:S.meta,result:R.result}),y.complete()}).catch(S=>{y.error(Bu.from(S,{meta:E?.meta}))}),()=>{}})}}Pt(Er());const K1=(t,...r)=>typeof t=="function"?t(...r):t;Pt(el());function Z3(){let t,r;return{promise:new Promise((l,s)=>{t=l,r=s}),resolve:t,reject:r}}async function J3(t){const r=await K1(t.url);if(!t.connectionParams)return r;const l=`${r.includes("?")?"&":"?"}connectionParams=1`;return r+l}async function W3(t){const r={method:"connectionParams",data:await K1(t)};return JSON.stringify(r)}Pt(el());var Ai=Pt(el());function e5(t){const{promise:r,resolve:a,reject:l}=Z3();return t.addEventListener("open",()=>{t.removeEventListener("error",l),a()}),t.addEventListener("error",l),r}function t5(t,{intervalMs:r,pongTimeoutMs:a}){let l,s;function c(){l=setTimeout(()=>{t.send("PING"),s=setTimeout(()=>{t.close()},a)},r)}function u(){clearTimeout(l),c()}function d(){clearTimeout(s),u()}t.addEventListener("open",c),t.addEventListener("message",({data:m})=>{clearTimeout(l),c(),m==="PONG"&&d()}),t.addEventListener("close",()=>{clearTimeout(l),clearTimeout(s)})}var n5=class Vm{constructor(r){var a;if((0,Ai.default)(this,"id",++Vm.connectCount),(0,Ai.default)(this,"WebSocketPonyfill",void 0),(0,Ai.default)(this,"urlOptions",void 0),(0,Ai.default)(this,"keepAliveOpts",void 0),(0,Ai.default)(this,"wsObservable",A3(null)),(0,Ai.default)(this,"openPromise",null),this.WebSocketPonyfill=(a=r.WebSocketPonyfill)!==null&&a!==void 0?a:WebSocket,!this.WebSocketPonyfill)throw new Error("No WebSocket implementation found - you probably don't want to use this on the server, but if you do you need to pass a `WebSocket`-ponyfill");this.urlOptions=r.urlOptions,this.keepAliveOpts=r.keepAlive}get ws(){return this.wsObservable.get()}set ws(r){this.wsObservable.next(r)}isOpen(){return!!this.ws&&this.ws.readyState===this.WebSocketPonyfill.OPEN&&!this.openPromise}isClosed(){return!!this.ws&&(this.ws.readyState===this.WebSocketPonyfill.CLOSING||this.ws.readyState===this.WebSocketPonyfill.CLOSED)}async open(){var r=this;if(r.openPromise)return r.openPromise;r.id=++Vm.connectCount;const a=J3(r.urlOptions).then(l=>new r.WebSocketPonyfill(l));r.openPromise=a.then(async l=>{r.ws=l,l.addEventListener("message",function({data:s}){s==="PING"&&this.send("PONG")}),r.keepAliveOpts.enabled&&t5(l,r.keepAliveOpts),l.addEventListener("close",()=>{r.ws===l&&(r.ws=null)}),await e5(l),r.urlOptions.connectionParams&&l.send(await W3(r.urlOptions.connectionParams))});try{await r.openPromise}finally{r.openPromise=null}}async close(){var r=this;try{await r.openPromise}finally{var a;(a=r.ws)===null||a===void 0||a.close()}}};(0,Ai.default)(n5,"connectCount",0);Pt(el());Pt(Er());var hm=Pt(el()),yx=Pt(Er()),vd=class{constructor(t){(0,hm.default)(this,"links",void 0),(0,hm.default)(this,"runtime",void 0),(0,hm.default)(this,"requestId",void 0),this.requestId=0,this.runtime={},this.links=t.links.map(r=>r(this.runtime))}$request(t){var r;return z3({links:this.links,op:(0,yx.default)((0,yx.default)({},t),{},{context:(r=t.context)!==null&&r!==void 0?r:{},id:++this.requestId})}).pipe(_3())}async requestAsPromise(t){var r=this;try{const a=r.$request(t);return(await f3(a)).result.data}catch(a){throw Bu.from(a)}}query(t,r,a){return this.requestAsPromise({type:"query",path:t,input:r,context:a?.context,signal:a?.signal})}mutation(t,r,a){return this.requestAsPromise({type:"mutation",path:t,input:r,context:a?.context,signal:a?.signal})}subscription(t,r,a){return this.$request({type:"subscription",path:t,input:r,context:a.context,signal:a.signal}).subscribe({next(s){switch(s.result.type){case"state":{var c;(c=a.onConnectionStateChange)===null||c===void 0||c.call(a,s.result);break}case"started":{var u;(u=a.onStarted)===null||u===void 0||u.call(a,{context:s.context});break}case"stopped":{var d;(d=a.onStopped)===null||d===void 0||d.call(a);break}case"data":case void 0:{var m;(m=a.onData)===null||m===void 0||m.call(a,s.result.data);break}}},error(s){var c;(c=a.onError)===null||c===void 0||c.call(a,s)},complete(){var s;(s=a.onComplete)===null||s===void 0||s.call(a)}})}};const X1=Symbol.for("trpc_untypedClient"),r5={query:"query",mutate:"mutation",subscribe:"subscription"},a5=t=>r5[t];function $1(t){const r=md(({path:a,args:l})=>{const s=[...a],c=a5(s.pop()),u=s.join(".");return t[c](u,...l)});return Hp(a=>a===X1?t:r[a])}function i5(t){const r=new vd(t);return $1(r)}function Ip(t){return t[X1]}Pt(Er());Pt(Er());var l5=Vr({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/asyncIterator.js"(t,r){function a(s){var c,u,d,m=2;for(typeof Symbol<"u"&&(u=Symbol.asyncIterator,d=Symbol.iterator);m--;){if(u&&(c=s[u])!=null)return c.call(s);if(d&&(c=s[d])!=null)return new l(c.call(s));u="@@asyncIterator",d="@@iterator"}throw new TypeError("Object is not async iterable")}function l(s){function c(u){if(Object(u)!==u)return Promise.reject(new TypeError(u+" is not an object."));var d=u.done;return Promise.resolve(u.value).then(function(m){return{value:m,done:d}})}return l=function(d){this.s=d,this.n=d.next},l.prototype={s:null,n:null,next:function(){return c(this.n.apply(this.s,arguments))},return:function(d){var m=this.s.return;return m===void 0?Promise.resolve({value:d,done:!0}):c(m.apply(this.s,arguments))},throw:function(d){var m=this.s.return;return m===void 0?Promise.reject(d):c(m.apply(this.s,arguments))}},new l(s)}r.exports=a,r.exports.__esModule=!0,r.exports.default=r.exports}});Pt(l5());Pt(Er());var o5=Vr({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/usingCtx.js"(t,r){function a(){var l=typeof SuppressedError=="function"?SuppressedError:function(d,m){var v=Error();return v.name="SuppressedError",v.error=d,v.suppressed=m,v},s={},c=[];function u(d,m){if(m!=null){if(Object(m)!==m)throw new TypeError("using declarations can only be used with objects, functions, null, or undefined.");if(d)var v=m[Symbol.asyncDispose||Symbol.for("Symbol.asyncDispose")];if(v===void 0&&(v=m[Symbol.dispose||Symbol.for("Symbol.dispose")],d))var b=v;if(typeof v!="function")throw new TypeError("Object is not disposable.");b&&(v=function(){try{b.call(m)}catch(w){return Promise.reject(w)}}),c.push({v:m,d:v,a:d})}else d&&c.push({d:m,a:d});return m}return{e:s,u:u.bind(null,!1),a:u.bind(null,!0),d:function(){var m,v=this.e,b=0;function y(){for(;m=c.pop();)try{if(!m.a&&b===1)return b=0,c.push(m),Promise.resolve().then(y);if(m.d){var C=m.d.call(m.v);if(m.a)return b|=2,Promise.resolve(C).then(y,w)}else b|=1}catch(E){return w(E)}if(b===1)return v!==s?Promise.reject(v):Promise.resolve();if(v!==s)throw v}function w(C){return v=v!==s?new l(C,v):C,y()}return y()}}}r.exports=a,r.exports.__esModule=!0,r.exports.default=r.exports}}),Z1=Vr({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/OverloadYield.js"(t,r){function a(l,s){this.v=l,this.k=s}r.exports=a,r.exports.__esModule=!0,r.exports.default=r.exports}}),s5=Vr({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/awaitAsyncGenerator.js"(t,r){var a=Z1();function l(s){return new a(s,0)}r.exports=l,r.exports.__esModule=!0,r.exports.default=r.exports}}),c5=Vr({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/wrapAsyncGenerator.js"(t,r){var a=Z1();function l(c){return function(){return new s(c.apply(this,arguments))}}function s(c){var u,d;function m(b,y){try{var w=c[b](y),C=w.value,E=C instanceof a;Promise.resolve(E?C.v:C).then(function(S){if(E){var R=b==="return"?"return":"next";if(!C.k||S.done)return m(R,S);S=c[R](S).value}v(w.done?"return":"normal",S)},function(S){m("throw",S)})}catch(S){v("throw",S)}}function v(b,y){switch(b){case"return":u.resolve({value:y,done:!0});break;case"throw":u.reject(y);break;default:u.resolve({value:y,done:!1})}(u=u.next)?m(u.key,u.arg):d=null}this._invoke=function(b,y){return new Promise(function(w,C){var E={key:b,arg:y,resolve:w,reject:C,next:null};d?d=d.next=E:(u=d=E,m(b,y))})},typeof c.return!="function"&&(this.return=void 0)}s.prototype[typeof Symbol=="function"&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},s.prototype.next=function(c){return this._invoke("next",c)},s.prototype.throw=function(c){return this._invoke("throw",c)},s.prototype.return=function(c){return this._invoke("return",c)},r.exports=l,r.exports.__esModule=!0,r.exports.default=r.exports}});Pt(o5());Pt(s5());Pt(c5());Pt(Er());function u5(t){return md(({path:r,args:a})=>{var l;const s=[...r],c=s.pop();if(c==="useMutation")return t[c](s,...a);if(c==="_def")return{path:s};const[u,...d]=a,m=(l=d[0])!==null&&l!==void 0?l:{};return t[c](s,u,m)})}var mm;const d5=["client","ssrContext","ssrState","abortOnUnmount"],f5=(mm=g.createContext)===null||mm===void 0?void 0:mm.call(Cs,null),h5=t=>{switch(t){case"queryOptions":case"fetch":case"ensureData":case"prefetch":case"getData":case"setData":case"setQueriesData":return"query";case"infiniteQueryOptions":case"fetchInfinite":case"prefetchInfinite":case"getInfiniteData":case"setInfiniteData":return"infinite";case"setMutationDefaults":case"getMutationDefaults":case"isMutating":case"cancel":case"invalidate":case"refetch":case"reset":return"any"}};function m5(t){return md(r=>{const a=[...r.path],l=a.pop(),s=[...r.args],c=s.shift(),u=h5(l),d=kr(a,c,u);return{infiniteQueryOptions:()=>t.infiniteQueryOptions(a,d,s[0]),queryOptions:()=>t.queryOptions(a,d,...s),fetch:()=>t.fetchQuery(d,...s),fetchInfinite:()=>t.fetchInfiniteQuery(d,s[0]),prefetch:()=>t.prefetchQuery(d,...s),prefetchInfinite:()=>t.prefetchInfiniteQuery(d,s[0]),ensureData:()=>t.ensureQueryData(d,...s),invalidate:()=>t.invalidateQueries(d,...s),reset:()=>t.resetQueries(d,...s),refetch:()=>t.refetchQueries(d,...s),cancel:()=>t.cancelQuery(d,...s),setData:()=>{t.setQueryData(d,s[0],s[1])},setQueriesData:()=>t.setQueriesData(d,s[0],s[1],s[2]),setInfiniteData:()=>{t.setInfiniteQueryData(d,s[0],s[1])},getData:()=>t.getQueryData(d),getInfiniteData:()=>t.getInfiniteQueryData(d),setMutationDefaults:()=>t.setMutationDefaults(xu(a),c),getMutationDefaults:()=>t.getMutationDefaults(xu(a)),isMutating:()=>t.isMutating({mutationKey:xu(a)})}[l]()})}function p5(t){const r=$1(t.client),a=m5(t);return Hp(l=>{const s=l;return s==="client"?r:d5.includes(s)?t[s]:a[l]})}var v5=Wi(Ps(),1);function bx(t){const r=t instanceof vd?t:Ip(t);return md(a=>{const l=a.path,s=l.join("."),[c,u]=a.args;return(0,v5.default)({queryKey:kr(l,c,"query"),queryFn:()=>r.query(s,c,u?.trpc)},u)})}var pm=Wi(Ps(),1);function yn(t,r,a){var l;const s=t[0];let c=(l=t[1])===null||l===void 0?void 0:l.input;if(a){var u;c=(0,pm.default)((0,pm.default)((0,pm.default)({},(u=c)!==null&&u!==void 0?u:{}),a.pageParam?{cursor:a.pageParam}:{}),{},{direction:a.direction})}return[s.join("."),c,r?.trpc]}var g5=ci({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/asyncIterator.js"(t,r){function a(s){var c,u,d,m=2;for(typeof Symbol<"u"&&(u=Symbol.asyncIterator,d=Symbol.iterator);m--;){if(u&&(c=s[u])!=null)return c.call(s);if(d&&(c=s[d])!=null)return new l(c.call(s));u="@@asyncIterator",d="@@iterator"}throw new TypeError("Object is not async iterable")}function l(s){function c(u){if(Object(u)!==u)return Promise.reject(new TypeError(u+" is not an object."));var d=u.done;return Promise.resolve(u.value).then(function(m){return{value:m,done:d}})}return l=function(d){this.s=d,this.n=d.next},l.prototype={s:null,n:null,next:function(){return c(this.n.apply(this.s,arguments))},return:function(d){var m=this.s.return;return m===void 0?Promise.resolve({value:d,done:!0}):c(m.apply(this.s,arguments))},throw:function(d){var m=this.s.return;return m===void 0?Promise.reject(d):c(m.apply(this.s,arguments))}},new l(s)}r.exports=a,r.exports.__esModule=!0,r.exports.default=r.exports}}),y5=Wi(g5(),1);function Fm(t){return{path:t.path.join(".")}}function ns(t){const r=Fm(t);return g.useMemo(()=>r,[r])}async function J1(t,r,a){const s=r.getQueryCache().build(r,{queryKey:a});s.setState({data:[],status:"success"});const c=[];var u=!1,d=!1,m;try{for(var v=(0,y5.default)(t),b;u=!(b=await v.next()).done;u=!1){const y=b.value;c.push(y),s.setState({data:[...c]})}}catch(y){d=!0,m=y}finally{try{u&&v.return!=null&&await v.return()}finally{if(d)throw m}}return c}var tt=Wi(Ps(),1);function b5(t){const{client:r,queryClient:a}=t,l=r instanceof vd?r:Ip(r);return{infiniteQueryOptions:(s,c,u)=>{var d,m;const v=((d=c[1])===null||d===void 0?void 0:d.input)===Gn,b=async y=>{var w;const C=(0,tt.default)((0,tt.default)({},u),{},{trpc:(0,tt.default)((0,tt.default)({},u?.trpc),!(u==null||(w=u.trpc)===null||w===void 0)&&w.abortOnUnmount?{signal:y.signal}:{signal:null})});return await l.query(...yn(c,C,{direction:y.direction,pageParam:y.pageParam}))};return Object.assign((0,tt.default)((0,tt.default)({},u),{},{initialData:u?.initialData,queryKey:c,queryFn:v?Gn:b,initialPageParam:(m=u?.initialCursor)!==null&&m!==void 0?m:null}),{trpc:Fm({path:s})})},queryOptions:(s,c,u)=>{var d;const m=((d=c[1])===null||d===void 0?void 0:d.input)===Gn,v=async b=>{var y;const w=(0,tt.default)((0,tt.default)({},u),{},{trpc:(0,tt.default)((0,tt.default)({},u?.trpc),!(u==null||(y=u.trpc)===null||y===void 0)&&y.abortOnUnmount?{signal:b.signal}:{signal:null})}),C=await l.query(...yn(c,w));return A1(C)?J1(C,a,c):C};return Object.assign((0,tt.default)((0,tt.default)({},u),{},{initialData:u?.initialData,queryKey:c,queryFn:m?Gn:v}),{trpc:Fm({path:s})})},fetchQuery:(s,c)=>a.fetchQuery((0,tt.default)((0,tt.default)({},c),{},{queryKey:s,queryFn:()=>l.query(...yn(s,c))})),fetchInfiniteQuery:(s,c)=>{var u;return a.fetchInfiniteQuery((0,tt.default)((0,tt.default)({},c),{},{queryKey:s,queryFn:({pageParam:d,direction:m})=>l.query(...yn(s,c,{pageParam:d,direction:m})),initialPageParam:(u=c?.initialCursor)!==null&&u!==void 0?u:null}))},prefetchQuery:(s,c)=>a.prefetchQuery((0,tt.default)((0,tt.default)({},c),{},{queryKey:s,queryFn:()=>l.query(...yn(s,c))})),prefetchInfiniteQuery:(s,c)=>{var u;return a.prefetchInfiniteQuery((0,tt.default)((0,tt.default)({},c),{},{queryKey:s,queryFn:({pageParam:d,direction:m})=>l.query(...yn(s,c,{pageParam:d,direction:m})),initialPageParam:(u=c?.initialCursor)!==null&&u!==void 0?u:null}))},ensureQueryData:(s,c)=>a.ensureQueryData((0,tt.default)((0,tt.default)({},c),{},{queryKey:s,queryFn:()=>l.query(...yn(s,c))})),invalidateQueries:(s,c,u)=>a.invalidateQueries((0,tt.default)((0,tt.default)({},c),{},{queryKey:s}),u),resetQueries:(s,c,u)=>a.resetQueries((0,tt.default)((0,tt.default)({},c),{},{queryKey:s}),u),refetchQueries:(s,c,u)=>a.refetchQueries((0,tt.default)((0,tt.default)({},c),{},{queryKey:s}),u),cancelQuery:(s,c)=>a.cancelQueries({queryKey:s},c),setQueryData:(s,c,u)=>a.setQueryData(s,c,u),setQueriesData:(s,c,u,d)=>a.setQueriesData((0,tt.default)((0,tt.default)({},c),{},{queryKey:s}),u,d),getQueryData:s=>a.getQueryData(s),setInfiniteQueryData:(s,c,u)=>a.setQueryData(s,c,u),getInfiniteQueryData:s=>a.getQueryData(s),setMutationDefaults:(s,c)=>{const u=s[0],d=m=>l.mutation(...yn([u,{input:m}],t));return a.setMutationDefaults(s,typeof c=="function"?c({canonicalMutationFn:d}):c)},getMutationDefaults:s=>a.getMutationDefaults(s),isMutating:s=>a.isMutating((0,tt.default)((0,tt.default)({},s),{},{exact:!0}))}}var xe=Wi(Ps());const xx=(t,r)=>new Proxy(t,{get(l,s){return r(s),l[s]}});function x5(t){var r,a;const l=(r=void 0)!==null&&r!==void 0?r:k=>k.originalFn(),s=(a=void 0)!==null&&a!==void 0?a:f5,c=i5,u=k=>{var I;const{abortOnUnmount:N=!1,queryClient:T,ssrContext:A}=k,[q,K]=g.useState((I=k.ssrState)!==null&&I!==void 0?I:!1),W=k.client instanceof vd?k.client:Ip(k.client),ue=g.useMemo(()=>b5({client:W,queryClient:T}),[W,T]),le=g.useMemo(()=>(0,xe.default)({abortOnUnmount:N,queryClient:T,client:W,ssrContext:A??null,ssrState:q},ue),[N,W,ue,T,A,q]);return g.useEffect(()=>{K(de=>de?"mounted":!1)},[]),h.jsx(s.Provider,{value:le,children:k.children})};function d(){const k=g.useContext(s);if(!k)throw new Error("Unable to find tRPC Context. Did you forget to wrap your App inside `withTRPC` HoC?");return k}function m(k,I){var N;const{queryClient:T,ssrState:A}=d();return A&&A!=="mounted"&&((N=T.getQueryCache().find({queryKey:k}))===null||N===void 0?void 0:N.state.status)==="error"?(0,xe.default)({retryOnMount:!1},I):I}function v(k,I,N){var T,A,q,K,W;const ue=d(),{abortOnUnmount:le,client:de,ssrState:L,queryClient:G,prefetchQuery:B}=ue,ee=kr(k,I,"query"),ie=G.getQueryDefaults(ee),D=I===Gn;typeof window>"u"&&L==="prepass"&&(N==null||(T=N.trpc)===null||T===void 0?void 0:T.ssr)!==!1&&((A=N?.enabled)!==null&&A!==void 0?A:ie?.enabled)!==!1&&!D&&!G.getQueryCache().find({queryKey:ee})&&B(ee,N);const Q=m(ee,(0,xe.default)((0,xe.default)({},ie),N)),J=(q=(K=N==null||(W=N.trpc)===null||W===void 0?void 0:W.abortOnUnmount)!==null&&K!==void 0?K:void 0)!==null&&q!==void 0?q:le,ne=wM((0,xe.default)((0,xe.default)({},Q),{},{queryKey:ee,queryFn:D?I:async fe=>{const me=(0,xe.default)((0,xe.default)({},Q),{},{trpc:(0,xe.default)((0,xe.default)({},Q?.trpc),J?{signal:fe.signal}:{signal:null})}),re=await de.query(...yn(ee,me));return A1(re)?J1(re,G,ee):re}}),G);return ne.trpc=ns({path:k}),ne}function b(k,I,N){var T,A,q;const K=d(),W=kr(k,I,"query"),ue=I===Gn,le=(T=(A=N==null||(q=N.trpc)===null||q===void 0?void 0:q.abortOnUnmount)!==null&&A!==void 0?A:void 0)!==null&&T!==void 0?T:K.abortOnUnmount;jM((0,xe.default)((0,xe.default)({},N),{},{queryKey:W,queryFn:ue?I:de=>{const L={trpc:(0,xe.default)((0,xe.default)({},N?.trpc),le?{signal:de.signal}:{})};return K.client.query(...yn(W,L))}}))}function y(k,I,N){var T,A,q;const K=d(),W=kr(k,I,"query"),ue=(T=(A=N==null||(q=N.trpc)===null||q===void 0?void 0:q.abortOnUnmount)!==null&&A!==void 0?A:void 0)!==null&&T!==void 0?T:K.abortOnUnmount,le=CM((0,xe.default)((0,xe.default)({},N),{},{queryKey:W,queryFn:de=>{const L=(0,xe.default)((0,xe.default)({},N),{},{trpc:(0,xe.default)((0,xe.default)({},N?.trpc),ue?{signal:de.signal}:{signal:null})});return K.client.query(...yn(W,L))}}),K.queryClient);return le.trpc=ns({path:k}),[le.data,le]}function w(k,I){const{client:N,queryClient:T}=d(),A=xu(k),q=T.defaultMutationOptions(T.getMutationDefaults(A)),K=MM((0,xe.default)((0,xe.default)({},I),{},{mutationKey:A,mutationFn:W=>N.mutation(...yn([k,{input:W}],I)),onSuccess(...W){var ue,le;return l({originalFn:()=>{var L,G,B;return(L=I==null||(G=I.onSuccess)===null||G===void 0?void 0:G.call(I,...W))!==null&&L!==void 0?L:q==null||(B=q.onSuccess)===null||B===void 0?void 0:B.call(q,...W)},queryClient:T,meta:(ue=(le=I?.meta)!==null&&le!==void 0?le:q?.meta)!==null&&ue!==void 0?ue:{}})}}),T);return K.trpc=ns({path:k}),K}const C={data:void 0,error:null,status:"idle"},E={data:void 0,error:null,status:"connecting"};function S(k,I,N){var T;const A=(T=N?.enabled)!==null&&T!==void 0?T:I!==Gn,q=ri(kr(k,I,"any")),{client:K}=d(),W=g.useRef(N);g.useEffect(()=>{W.current=N});const[ue]=g.useState(new Set([])),le=g.useCallback(D=>{ue.add(D)},[ue]),de=g.useRef(null),L=g.useCallback(D=>{const Q=B.current,J=B.current=D(Q);let ne=!1;for(const fe of ue)if(Q[fe]!==J[fe]){ne=!0;break}ne&&ie(xx(J,le))},[le,ue]),G=g.useCallback(()=>{var D;if((D=de.current)===null||D===void 0||D.unsubscribe(),!A){L(()=>(0,xe.default)((0,xe.default)({},C),{},{reset:G}));return}L(()=>(0,xe.default)((0,xe.default)({},E),{},{reset:G}));const Q=K.subscription(k.join("."),I??void 0,{onStarted:()=>{var J,ne;(J=(ne=W.current).onStarted)===null||J===void 0||J.call(ne),L(fe=>(0,xe.default)((0,xe.default)({},fe),{},{status:"pending",error:null}))},onData:J=>{var ne,fe;(ne=(fe=W.current).onData)===null||ne===void 0||ne.call(fe,J),L(me=>(0,xe.default)((0,xe.default)({},me),{},{status:"pending",data:J,error:null}))},onError:J=>{var ne,fe;(ne=(fe=W.current).onError)===null||ne===void 0||ne.call(fe,J),L(me=>(0,xe.default)((0,xe.default)({},me),{},{status:"error",error:J}))},onConnectionStateChange:J=>{L(ne=>{switch(J.state){case"idle":return(0,xe.default)((0,xe.default)({},ne),{},{status:J.state,error:null,data:void 0});case"connecting":return(0,xe.default)((0,xe.default)({},ne),{},{error:J.error,status:J.state});case"pending":return ne}})},onComplete:()=>{var J,ne;(J=(ne=W.current).onComplete)===null||J===void 0||J.call(ne),L(fe=>(0,xe.default)((0,xe.default)({},fe),{},{status:"idle",error:null,data:void 0}))}});de.current=Q},[K,q,A,L]);g.useEffect(()=>(G(),()=>{var D;(D=de.current)===null||D===void 0||D.unsubscribe()}),[G]);const B=g.useRef(A?(0,xe.default)((0,xe.default)({},E),{},{reset:G}):(0,xe.default)((0,xe.default)({},C),{},{reset:G})),[ee,ie]=g.useState(xx(B.current,le));return ee}function R(k,I,N){var T,A,q,K,W;const{client:ue,ssrState:le,prefetchInfiniteQuery:de,queryClient:L,abortOnUnmount:G}=d(),B=kr(k,I,"infinite"),ee=L.getQueryDefaults(B),ie=I===Gn;typeof window>"u"&&le==="prepass"&&(N==null||(T=N.trpc)===null||T===void 0?void 0:T.ssr)!==!1&&((A=N?.enabled)!==null&&A!==void 0?A:ee?.enabled)!==!1&&!ie&&!L.getQueryCache().find({queryKey:B})&&de(B,(0,xe.default)((0,xe.default)({},ee),N));const D=m(B,(0,xe.default)((0,xe.default)({},ee),N)),Q=(q=N==null||(K=N.trpc)===null||K===void 0?void 0:K.abortOnUnmount)!==null&&q!==void 0?q:G,J=OM((0,xe.default)((0,xe.default)({},D),{},{initialPageParam:(W=N.initialCursor)!==null&&W!==void 0?W:null,persister:N.persister,queryKey:B,queryFn:ie?I:ne=>{var fe;const me=(0,xe.default)((0,xe.default)({},D),{},{trpc:(0,xe.default)((0,xe.default)({},D?.trpc),Q?{signal:ne.signal}:{signal:null})});return ue.query(...yn(B,me,{pageParam:(fe=ne.pageParam)!==null&&fe!==void 0?fe:N.initialCursor,direction:ne.direction}))}}),L);return J.trpc=ns({path:k}),J}function M(k,I,N){var T,A,q;const K=d(),W=kr(k,I,"infinite"),ue=K.queryClient.getQueryDefaults(W),le=I===Gn,de=m(W,(0,xe.default)((0,xe.default)({},ue),N)),L=(T=N==null||(A=N.trpc)===null||A===void 0?void 0:A.abortOnUnmount)!==null&&T!==void 0?T:K.abortOnUnmount;RM((0,xe.default)((0,xe.default)({},N),{},{initialPageParam:(q=N.initialCursor)!==null&&q!==void 0?q:null,queryKey:W,queryFn:le?I:G=>{var B;const ee=(0,xe.default)((0,xe.default)({},de),{},{trpc:(0,xe.default)((0,xe.default)({},de?.trpc),L?{signal:G.signal}:{})});return K.client.query(...yn(W,ee,{pageParam:(B=G.pageParam)!==null&&B!==void 0?B:N.initialCursor,direction:G.direction}))}}))}function O(k,I,N){var T,A,q;const K=d(),W=kr(k,I,"infinite"),ue=K.queryClient.getQueryDefaults(W),le=m(W,(0,xe.default)((0,xe.default)({},ue),N)),de=(T=N==null||(A=N.trpc)===null||A===void 0?void 0:A.abortOnUnmount)!==null&&T!==void 0?T:K.abortOnUnmount,L=NM((0,xe.default)((0,xe.default)({},N),{},{initialPageParam:(q=N.initialCursor)!==null&&q!==void 0?q:null,queryKey:W,queryFn:G=>{var B;const ee=(0,xe.default)((0,xe.default)({},le),{},{trpc:(0,xe.default)((0,xe.default)({},le?.trpc),de?{signal:G.signal}:{})});return K.client.query(...yn(W,ee,{pageParam:(B=G.pageParam)!==null&&B!==void 0?B:N.initialCursor,direction:G.direction}))}}),K.queryClient);return L.trpc=ns({path:k}),[L.data,L]}return{Provider:u,createClient:c,useContext:d,useUtils:d,useQuery:v,usePrefetchQuery:b,useSuspenseQuery:y,useQueries:(k,I)=>{const{ssrState:N,queryClient:T,prefetchQuery:A,client:q}=d(),K=bx(q),W=k(K);if(typeof window>"u"&&N==="prepass")for(const le of W){var ue;const de=le;((ue=de.trpc)===null||ue===void 0?void 0:ue.ssr)!==!1&&!T.getQueryCache().find({queryKey:de.queryKey})&&A(de.queryKey,de)}return MS({queries:W.map(le=>(0,xe.default)((0,xe.default)({},le),{},{queryKey:le.queryKey})),combine:I?.combine},T)},useSuspenseQueries:k=>{const{queryClient:I,client:N}=d(),T=bx(N),A=k(T),q=EM({queries:A.map(K=>(0,xe.default)((0,xe.default)({},K),{},{queryFn:K.queryFn,queryKey:K.queryKey}))},I);return[q.map(K=>K.data),q]},useMutation:w,useSubscription:S,useInfiniteQuery:R,usePrefetchInfiniteQuery:M,useSuspenseInfiniteQuery:O}}function S5(t){const r=u5(t);return Hp(a=>a==="useContext"||a==="useUtils"?()=>{const l=t.useUtils();return g.useMemo(()=>p5(l),[l])}:t.hasOwnProperty(a)?t[a]:r[a])}function w5(t){const r=x5();return S5(r)}var C5={};const $e=w5(),N5=typeof globalThis.process<"u"&&C5?.VITE_TRPC_URL||"https://honest-dolls-move.preview-develop.taylordb.ai/api",E5=$e.createClient({links:[$3({url:`${N5}/trpc`})]}),Us=g.forwardRef(({className:t,...r},a)=>h.jsx("div",{className:"relative w-full overflow-auto",children:h.jsx("table",{ref:a,className:ye("w-full caption-bottom text-sm",t),...r})}));Us.displayName="Table";const Bs=g.forwardRef(({className:t,...r},a)=>h.jsx("thead",{ref:a,className:ye("[&_tr]:border-b",t),...r}));Bs.displayName="TableHeader";const Hs=g.forwardRef(({className:t,...r},a)=>h.jsx("tbody",{ref:a,className:ye("[&_tr:last-child]:border-0",t),...r}));Hs.displayName="TableBody";const j5=g.forwardRef(({className:t,...r},a)=>h.jsx("tfoot",{ref:a,className:ye("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",t),...r}));j5.displayName="TableFooter";const ya=g.forwardRef(({className:t,...r},a)=>h.jsx("tr",{ref:a,className:ye("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",t),...r}));ya.displayName="TableRow";const $t=g.forwardRef(({className:t,...r},a)=>h.jsx("th",{ref:a,className:ye("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",t),...r}));$t.displayName="TableHead";const Zt=g.forwardRef(({className:t,...r},a)=>h.jsx("td",{ref:a,className:ye("p-4 align-middle [&:has([role=checkbox])]:pr-0",t),...r}));Zt.displayName="TableCell";const R5=g.forwardRef(({className:t,...r},a)=>h.jsx("caption",{ref:a,className:ye("mt-4 text-sm text-muted-foreground",t),...r}));R5.displayName="TableCaption";const cr=g.forwardRef(({className:t,...r},a)=>h.jsx("div",{ref:a,className:ye("rounded-lg border bg-card text-card-foreground shadow-sm",t),...r}));cr.displayName="Card";const ur=g.forwardRef(({className:t,...r},a)=>h.jsx("div",{ref:a,className:ye("flex flex-col space-y-1.5 p-6",t),...r}));ur.displayName="CardHeader";const dr=g.forwardRef(({className:t,...r},a)=>h.jsx("div",{ref:a,className:ye("text-2xl font-semibold leading-none tracking-tight",t),...r}));dr.displayName="CardTitle";const no=g.forwardRef(({className:t,...r},a)=>h.jsx("div",{ref:a,className:ye("text-sm text-muted-foreground",t),...r}));no.displayName="CardDescription";const fr=g.forwardRef(({className:t,...r},a)=>h.jsx("div",{ref:a,className:ye("p-6 pt-0",t),...r}));fr.displayName="CardContent";const M5=g.forwardRef(({className:t,...r},a)=>h.jsx("div",{ref:a,className:ye("flex items-center p-6 pt-0",t),...r}));M5.displayName="CardFooter";const An=g.forwardRef(({className:t,type:r,...a},l)=>h.jsx("input",{type:r,className:ye("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:border-primary/50 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm transition-colors",t),ref:l,...a}));An.displayName="Input";var O5=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],D5=O5.reduce((t,r)=>{const a=LS(`Primitive.${r}`),l=g.forwardRef((s,c)=>{const{asChild:u,...d}=s,m=u?a:r;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),h.jsx(m,{...d,ref:c})});return l.displayName=`Primitive.${r}`,{...t,[r]:l}},{}),T5="Label",W1=g.forwardRef((t,r)=>h.jsx(D5.label,{...t,ref:r,onMouseDown:a=>{a.target.closest("button, input, select, textarea")||(t.onMouseDown?.(a),!a.defaultPrevented&&a.detail>1&&a.preventDefault())}}));W1.displayName=T5;var eC=W1;const _5=Ts("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),kt=g.forwardRef(({className:t,...r},a)=>h.jsx(eC,{ref:a,className:ye(_5(),t),...r}));kt.displayName=eC.displayName;const gd=g.forwardRef(({className:t,...r},a)=>h.jsx("textarea",{className:ye("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-base placeholder:text-muted-foreground focus-visible:outline-none focus-visible:border-primary/50 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm transition-colors",t),ref:a,...r}));gd.displayName="Textarea";var yd="Dialog",[tC]=si(yd),[A5,jr]=tC(yd),nC=t=>{const{__scopeDialog:r,children:a,open:l,defaultOpen:s,onOpenChange:c,modal:u=!0}=t,d=g.useRef(null),m=g.useRef(null),[v,b]=Gl({prop:l,defaultProp:s??!1,onChange:c,caller:yd});return h.jsx(A5,{scope:r,triggerRef:d,contentRef:m,contentId:Br(),titleId:Br(),descriptionId:Br(),open:v,onOpenChange:b,onOpenToggle:g.useCallback(()=>b(y=>!y),[b]),modal:u,children:a})};nC.displayName=yd;var rC="DialogTrigger",z5=g.forwardRef((t,r)=>{const{__scopeDialog:a,...l}=t,s=jr(rC,a),c=mt(r,s.triggerRef);return h.jsx(Ie.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":Fp(s.open),...l,ref:c,onClick:Re(t.onClick,s.onOpenToggle)})});z5.displayName=rC;var Qp="DialogPortal",[L5,aC]=tC(Qp,{forceMount:void 0}),iC=t=>{const{__scopeDialog:r,forceMount:a,children:l,container:s}=t,c=jr(Qp,r);return h.jsx(L5,{scope:r,forceMount:a,children:g.Children.map(l,u=>h.jsx(wa,{present:a||c.open,children:h.jsx(ld,{asChild:!0,container:s,children:u})}))})};iC.displayName=Qp;var Hu="DialogOverlay",lC=g.forwardRef((t,r)=>{const a=aC(Hu,t.__scopeDialog),{forceMount:l=a.forceMount,...s}=t,c=jr(Hu,t.__scopeDialog);return c.modal?h.jsx(wa,{present:l||c.open,children:h.jsx(P5,{...s,ref:r})}):null});lC.displayName=Hu;var k5=Yl("DialogOverlay.RemoveScroll"),P5=g.forwardRef((t,r)=>{const{__scopeDialog:a,...l}=t,s=jr(Hu,a);return h.jsx(cd,{as:k5,allowPinchZoom:!0,shards:[s.contentRef],children:h.jsx(Ie.div,{"data-state":Fp(s.open),...l,ref:r,style:{pointerEvents:"auto",...l.style}})})}),Vi="DialogContent",oC=g.forwardRef((t,r)=>{const a=aC(Vi,t.__scopeDialog),{forceMount:l=a.forceMount,...s}=t,c=jr(Vi,t.__scopeDialog);return h.jsx(wa,{present:l||c.open,children:c.modal?h.jsx(U5,{...s,ref:r}):h.jsx(B5,{...s,ref:r})})});oC.displayName=Vi;var U5=g.forwardRef((t,r)=>{const a=jr(Vi,t.__scopeDialog),l=g.useRef(null),s=mt(r,a.contentRef,l);return g.useEffect(()=>{const c=l.current;if(c)return _p(c)},[]),h.jsx(sC,{...t,ref:s,trapFocus:a.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Re(t.onCloseAutoFocus,c=>{c.preventDefault(),a.triggerRef.current?.focus()}),onPointerDownOutside:Re(t.onPointerDownOutside,c=>{const u=c.detail.originalEvent,d=u.button===0&&u.ctrlKey===!0;(u.button===2||d)&&c.preventDefault()}),onFocusOutside:Re(t.onFocusOutside,c=>c.preventDefault())})}),B5=g.forwardRef((t,r)=>{const a=jr(Vi,t.__scopeDialog),l=g.useRef(!1),s=g.useRef(!1);return h.jsx(sC,{...t,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:c=>{t.onCloseAutoFocus?.(c),c.defaultPrevented||(l.current||a.triggerRef.current?.focus(),c.preventDefault()),l.current=!1,s.current=!1},onInteractOutside:c=>{t.onInteractOutside?.(c),c.defaultPrevented||(l.current=!0,c.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const u=c.target;a.triggerRef.current?.contains(u)&&c.preventDefault(),c.detail.originalEvent.type==="focusin"&&s.current&&c.preventDefault()}})}),sC=g.forwardRef((t,r)=>{const{__scopeDialog:a,trapFocus:l,onOpenAutoFocus:s,onCloseAutoFocus:c,...u}=t,d=jr(Vi,a),m=g.useRef(null),v=mt(r,m);return Cp(),h.jsxs(h.Fragment,{children:[h.jsx(ed,{asChild:!0,loop:!0,trapped:l,onMountAutoFocus:s,onUnmountAutoFocus:c,children:h.jsx(Wu,{role:"dialog",id:d.contentId,"aria-describedby":d.descriptionId,"aria-labelledby":d.titleId,"data-state":Fp(d.open),...u,ref:v,onDismiss:()=>d.onOpenChange(!1)})}),h.jsxs(h.Fragment,{children:[h.jsx(H5,{titleId:d.titleId}),h.jsx(I5,{contentRef:m,descriptionId:d.descriptionId})]})]})}),Vp="DialogTitle",cC=g.forwardRef((t,r)=>{const{__scopeDialog:a,...l}=t,s=jr(Vp,a);return h.jsx(Ie.h2,{id:s.titleId,...l,ref:r})});cC.displayName=Vp;var uC="DialogDescription",dC=g.forwardRef((t,r)=>{const{__scopeDialog:a,...l}=t,s=jr(uC,a);return h.jsx(Ie.p,{id:s.descriptionId,...l,ref:r})});dC.displayName=uC;var fC="DialogClose",hC=g.forwardRef((t,r)=>{const{__scopeDialog:a,...l}=t,s=jr(fC,a);return h.jsx(Ie.button,{type:"button",...l,ref:r,onClick:Re(t.onClick,()=>s.onOpenChange(!1))})});hC.displayName=fC;function Fp(t){return t?"open":"closed"}var mC="DialogTitleWarning",[Pk,pC]=ID(mC,{contentName:Vi,titleName:Vp,docsSlug:"dialog"}),H5=({titleId:t})=>{const r=pC(mC),a=`\`${r.contentName}\` requires a \`${r.titleName}\` for the component to be accessible for screen reader users.
If you want to hide the \`${r.titleName}\`, you can wrap it with our VisuallyHidden component.
For more information, see https://radix-ui.com/primitives/docs/components/${r.docsSlug}`;return g.useEffect(()=>{t&&(document.getElementById(t)||console.error(a))},[a,t]),null},q5="DialogDescriptionWarning",I5=({contentRef:t,descriptionId:r})=>{const l=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${pC(q5).contentName}}.`;return g.useEffect(()=>{const s=t.current?.getAttribute("aria-describedby");r&&s&&(document.getElementById(r)||console.warn(l))},[l,t,r]),null},vC=nC,gC=iC,bd=lC,qs=oC,xd=cC,Sd=dC,Gp=hC;const Q5=vC,yC=gC,Yp=g.forwardRef(({className:t,...r},a)=>h.jsx(bd,{className:ye("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",t),...r,ref:a}));Yp.displayName=bd.displayName;const V5=Ts("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),F5=g.forwardRef(({side:t="right",className:r,children:a,...l},s)=>h.jsxs(yC,{children:[h.jsx(Yp,{}),h.jsxs(qs,{ref:s,className:ye(V5({side:t}),r),...l,children:[a,h.jsxs(Gp,{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-secondary",children:[h.jsx(xp,{className:"h-4 w-4"}),h.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));F5.displayName=qs.displayName;const bC=({className:t,...r})=>h.jsx("div",{className:ye("flex flex-col space-y-2 text-center sm:text-left",t),...r});bC.displayName="SheetHeader";const xC=g.forwardRef(({className:t,...r},a)=>h.jsx(xd,{ref:a,className:ye("text-lg font-semibold text-foreground",t),...r}));xC.displayName=xd.displayName;const SC=g.forwardRef(({className:t,...r},a)=>h.jsx(Sd,{ref:a,className:ye("text-sm text-muted-foreground",t),...r}));SC.displayName=Sd.displayName;const Kp=vC,G5=gC,wC=g.forwardRef(({className:t,...r},a)=>h.jsx(bd,{ref:a,className:ye("fixed inset-0 z-[300] 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",t),...r}));wC.displayName=bd.displayName;const wd=g.forwardRef(({className:t,children:r,...a},l)=>h.jsxs(G5,{children:[h.jsx(wC,{}),h.jsxs(qs,{ref:l,className:ye("fixed left-[50%] top-[50%] z-[301] 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",t),...a,children:[r,h.jsxs(Gp,{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:[h.jsx(xp,{className:"h-4 w-4"}),h.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));wd.displayName=qs.displayName;const Cd=({className:t,...r})=>h.jsx("div",{className:ye("flex flex-col space-y-1.5 text-center sm:text-left",t),...r});Cd.displayName="DialogHeader";const Nd=({className:t,...r})=>h.jsx("div",{className:ye("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...r});Nd.displayName="DialogFooter";const Ed=g.forwardRef(({className:t,...r},a)=>h.jsx(xd,{ref:a,className:ye("text-lg font-semibold leading-none tracking-tight",t),...r}));Ed.displayName=xd.displayName;const jd=g.forwardRef(({className:t,...r},a)=>h.jsx(Sd,{ref:a,className:ye("text-sm text-muted-foreground",t),...r}));jd.displayName=Sd.displayName;const Y5=Ts("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}});function Rd({open:t,onOpenChange:r,title:a,description:l,icon:s,isCreateMode:c,isLoading:u=!1,hasChanges:d,isPending:m,isDeletePending:v=!1,onSave:b,onDelete:y,children:w,footer:C,className:E,layer:S=0}){const[R,M]=g.useState(!1),O=50+S*10,_=O,z=O+1,k=g.useCallback(A=>{!A&&d?M(!0):(M(!1),r(A))},[d,r]),I=g.useCallback(()=>{M(!1)},[]),N=g.useCallback(()=>{M(!1),r(!1)},[r]),T=g.useCallback(()=>{y&&confirm("Are you sure you want to delete this item?")&&y()},[y]);return h.jsxs(h.Fragment,{children:[h.jsx(Q5,{open:t,onOpenChange:k,children:h.jsxs(yC,{children:[h.jsx(Yp,{className:ye(S>0&&"bg-black/60"),style:{zIndex:_},onClick:A=>{d&&(A.preventDefault(),A.stopPropagation(),M(!0))}}),h.jsxs(qs,{className:ye(Y5({side:"right"}),"sm:max-w-[480px] flex flex-col",E),style:{zIndex:z},onPointerDownOutside:A=>{d&&A.preventDefault()},onEscapeKeyDown:A=>{d&&(A.preventDefault(),M(!0))},onInteractOutside:A=>{d&&A.preventDefault()},children:[h.jsx(bC,{className:"space-y-3",children:h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("div",{className:"p-2 rounded-lg bg-gradient-to-br from-primary/20 to-primary/5 border border-primary/20",children:s}),h.jsxs("div",{className:"flex-1",children:[h.jsx(xC,{children:a}),h.jsx(SC,{children:l})]})]})}),u&&!c?h.jsx("div",{className:"flex-1 flex items-center justify-center",children:h.jsx(Yn,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):h.jsx("div",{className:"flex-1 flex flex-col gap-6 py-6 overflow-y-auto",children:w}),C,h.jsxs("div",{className:"flex items-center gap-3 pt-4 border-t",children:[!c&&y&&h.jsxs(Ge,{variant:"destructive",size:"sm",onClick:T,disabled:v,children:[v?h.jsx(Yn,{className:"h-4 w-4 animate-spin"}):h.jsx(AS,{className:"h-4 w-4"}),h.jsx("span",{className:"ml-2",children:"Delete"})]}),h.jsx("div",{className:"flex-1"}),h.jsx(Ge,{variant:"outline",onClick:()=>k(!1),children:"Cancel"}),h.jsxs(Ge,{onClick:b,disabled:m||!d,children:[m&&h.jsx(Yn,{className:"h-4 w-4 animate-spin mr-2"}),c?"Create":"Save Changes"]})]}),h.jsxs(Gp,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none disabled:pointer-events-none data-[state=open]:bg-secondary",children:[h.jsx("span",{className:"h-4 w-4 flex items-center justify-center text-lg",children:"×"}),h.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}),h.jsx(Kp,{open:R,onOpenChange:M,children:h.jsxs(wd,{className:"sm:max-w-[425px]",children:[h.jsxs(Cd,{children:[h.jsx(Ed,{children:"Unsaved Changes"}),h.jsx(jd,{children:"You have unsaved changes. Do you want to continue editing or discard your changes?"})]}),h.jsxs(Nd,{className:"gap-2 sm:gap-0",children:[h.jsx(Ge,{variant:"outline",onClick:N,children:"Discard Changes"}),h.jsx(Ge,{onClick:I,children:"Continue Editing"})]})]})})]})}function CC({open:t,onOpenChange:r,companyId:a,onSuccess:l,layer:s=0}){const c=!a,{data:u,isLoading:d}=$e.companies.getById.useQuery({id:a},{enabled:!!a&&t}),m=c?"":u?.name||"",v=c?"":u?.website||"",b=c?"":u?.notes||"",[y,w]=g.useState(""),[C,E]=g.useState(""),[S,R]=g.useState(""),[M,O]=g.useState(!1);t&&!d&&!M&&(w(m),E(v),R(b),O(!0)),!t&&M&&O(!1);const _=c?y.trim().length>0:y!==m||C!==v||S!==b,z=$e.companies.create.useMutation({onSuccess:q=>{const K=q?.id?{id:q.id,name:y,website:C||void 0}:void 0;l?.(K),r(!1)}}),k=$e.companies.update.useMutation({onSuccess:()=>{l?.(),r(!1)}}),I=$e.companies.delete.useMutation({onSuccess:()=>{l?.(),r(!1)}}),N=()=>{c?y.trim()&&z.mutate({name:y,website:C||void 0,notes:S||void 0}):a&&_&&k.mutate({id:a,name:y||void 0,website:C||void 0,notes:S||void 0})},T=()=>{a&&I.mutate({id:a})},A=z.isPending||k.isPending;return h.jsxs(Rd,{open:t,onOpenChange:r,title:c?"New Company":"Company Details",description:c?"Create a new company record":"View and edit company information",icon:h.jsx(ma,{className:"h-5 w-5 text-primary"}),isCreateMode:c,isLoading:d,hasChanges:_,isPending:A,isDeletePending:I.isPending,onSave:N,onDelete:c?void 0:T,layer:s,footer:!c&&u?h.jsx("div",{className:"pt-4 border-t",children:h.jsxs("p",{className:"text-xs text-muted-foreground",children:["Created: ",u.createdAt?new Date(u.createdAt).toLocaleDateString():"-",u.updatedAt&&h.jsxs(h.Fragment,{children:[" | Updated: ",new Date(u.updatedAt).toLocaleDateString()]})]})}):void 0,children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(kt,{htmlFor:"name",children:"Company Name *"}),h.jsx(An,{id:"name",value:y,onChange:q=>w(q.target.value),placeholder:"Acme Inc."})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(kt,{htmlFor:"website",children:"Website"}),h.jsxs("div",{className:"relative",children:[h.jsx(yp,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),h.jsx(An,{id:"website",value:C,onChange:q=>E(q.target.value),placeholder:"https://example.com",className:"pl-10"})]})]}),h.jsxs("div",{className:"space-y-2 flex-1",children:[h.jsx(kt,{htmlFor:"notes",children:"Notes"}),h.jsx(gd,{id:"notes",value:S,onChange:q=>R(q.target.value),placeholder:"Add any notes about this company...",className:"min-h-[120px] resize-none"})]})]})}function Sx(){const r=!!Sa().state?.openCreate,[a,l]=g.useState(r),[s,c]=g.useState(null);g.useLayoutEffect(()=>{r&&window.history.replaceState({},document.title)},[r]);const{data:u,isLoading:d,refetch:m}=$e.companies.getAll.useQuery(),v=C=>C?new Date(C).toLocaleDateString():"-",b=C=>{c(C),l(!0)},y=()=>{c(null),l(!0)},w=()=>{m()};return h.jsxs("div",{className:"container mx-auto p-6 max-w-6xl space-y-6",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("div",{className:"p-2.5 rounded-xl bg-gradient-to-br from-primary/20 to-primary/5 border border-primary/20",children:h.jsx(ma,{className:"h-6 w-6 text-primary"})}),h.jsxs("div",{children:[h.jsx("h1",{className:"text-2xl font-bold",children:"Companies"}),h.jsx("p",{className:"text-sm text-muted-foreground",children:"Manage your company records"})]})]}),h.jsxs(Ge,{onClick:y,children:[h.jsx($i,{className:"h-4 w-4 mr-2"}),"New Company"]})]}),h.jsxs(cr,{children:[h.jsxs(ur,{className:"pb-4",children:[h.jsx(dr,{className:"text-lg",children:"All Companies"}),h.jsxs(no,{children:[u?.length??0," ",u?.length===1?"company":"companies"]})]}),h.jsx(fr,{children:d?h.jsx("div",{className:"flex items-center justify-center py-12",children:h.jsx(Yn,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):u&&u.length>0?h.jsx("div",{className:"rounded-lg border",children:h.jsxs(Us,{children:[h.jsx(Bs,{children:h.jsxs(ya,{children:[h.jsx($t,{children:"Name"}),h.jsx($t,{children:"Website"}),h.jsx($t,{children:"Created"})]})}),h.jsx(Hs,{children:u.map(C=>h.jsxs(ya,{className:"cursor-pointer hover:bg-muted/50 transition-colors",onClick:()=>C.id&&b(C.id),children:[h.jsx(Zt,{className:"font-medium",children:C.name||"-"}),h.jsx(Zt,{children:C.website?h.jsxs("span",{className:"inline-flex items-center gap-1.5 text-primary",onClick:E=>{E.stopPropagation(),window.open(C.website,"_blank")},children:[h.jsx(yp,{className:"h-3.5 w-3.5"}),h.jsx("span",{className:"truncate max-w-[200px] hover:underline",children:C.website}),h.jsx(_S,{className:"h-3 w-3"})]}):h.jsx("span",{className:"text-muted-foreground",children:"-"})}),h.jsx(Zt,{className:"text-muted-foreground",children:v(C.createdAt)})]},C.id))})]})}):h.jsxs("div",{className:"text-center py-12 text-muted-foreground",children:[h.jsx(ma,{className:"h-12 w-12 mx-auto mb-4 opacity-20"}),h.jsx("p",{children:"No companies yet."}),h.jsx(Ge,{variant:"link",onClick:y,className:"mt-2",children:"Create your first company"})]})})]}),h.jsx(CC,{open:a,onOpenChange:l,companyId:s,onSuccess:w})]})}function wx({text:t,highlight:r}){if(!r.trim())return h.jsx(h.Fragment,{children:t});const a=new RegExp(`(${r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")})`,"gi"),l=t.split(a);return h.jsx(h.Fragment,{children:l.map((s,c)=>a.test(s)?h.jsx("mark",{className:"bg-primary/20 text-foreground rounded-sm px-0.5",children:s},c):h.jsx("span",{children:s},c))})}function Xp({value:t,onChange:r,onSearch:a,onCreateNew:l,options:s,isLoading:c=!1,placeholder:u="Search...",icon:d,entityName:m,disabled:v=!1}){const[b,y]=g.useState(!1),[w,C]=g.useState(""),E=g.useRef(null),S=g.useRef(null),R=z=>{const k=z.target.value;C(k),a(k)},M=z=>{r(z),y(!1),C("")},O=z=>{z.stopPropagation(),r(null),C("")},_=()=>{y(!1),C(""),l()};return g.useEffect(()=>{const z=k=>{E.current&&!E.current.contains(k.target)&&y(!1)};return document.addEventListener("mousedown",z),()=>document.removeEventListener("mousedown",z)},[]),g.useEffect(()=>{b&&S.current&&S.current.focus()},[b]),g.useEffect(()=>{b&&a(w)},[b]),h.jsxs("div",{ref:E,className:"relative",children:[t?h.jsxs("div",{className:ye("flex items-center gap-2 h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm",!v&&"cursor-pointer hover:bg-muted/50",v&&"opacity-50 cursor-not-allowed"),onClick:()=>!v&&y(!0),children:[h.jsx(d,{className:"h-4 w-4 text-muted-foreground flex-shrink-0"}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsx("span",{className:"truncate block",children:t.name}),t.subtitle&&h.jsx("span",{className:"text-xs text-muted-foreground truncate block",children:t.subtitle})]}),!v&&h.jsx(Ge,{type:"button",variant:"ghost",size:"sm",className:"h-5 w-5 p-0 hover:bg-muted",onClick:O,children:h.jsx(xp,{className:"h-3 w-3"})})]}):h.jsxs("div",{className:ye("flex items-center gap-2 h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm text-muted-foreground",!v&&"cursor-pointer hover:bg-muted/50",v&&"opacity-50 cursor-not-allowed"),onClick:()=>!v&&y(!0),children:[h.jsx(d,{className:"h-4 w-4 flex-shrink-0"}),h.jsx("span",{children:u})]}),b&&h.jsxs("div",{className:"absolute z-[100] top-full left-0 right-0 mt-1 bg-popover border border-border rounded-md shadow-lg overflow-hidden",children:[h.jsx("div",{className:"p-2 border-b",children:h.jsxs("div",{className:"relative",children:[h.jsx(AO,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),h.jsx(An,{ref:S,value:w,onChange:R,placeholder:"Search by name or email...",className:"pl-8 h-9"})]})}),h.jsx("div",{className:"max-h-[200px] overflow-y-auto",children:c?h.jsx("div",{className:"flex items-center justify-center py-4",children:h.jsx(Yn,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):s.length>0?h.jsx("div",{className:"py-1",children:s.map(z=>h.jsxs("button",{type:"button",className:"w-full flex items-center gap-2 px-3 py-2 text-sm hover:bg-muted/50 transition-colors text-left",onClick:()=>M(z),children:[h.jsx(d,{className:"h-4 w-4 text-muted-foreground flex-shrink-0"}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsx("span",{className:"block truncate",children:h.jsx(wx,{text:z.name,highlight:w})}),z.subtitle&&h.jsx("span",{className:"text-xs text-muted-foreground truncate block",children:h.jsx(wx,{text:z.subtitle,highlight:w})})]})]},z.id))}):h.jsxs("div",{className:"py-4 text-center text-sm text-muted-foreground",children:["No ",m.toLowerCase()," found"]})}),h.jsx("div",{className:"p-2 border-t",children:h.jsxs(Ge,{type:"button",variant:"ghost",size:"sm",className:"w-full justify-start gap-2 text-primary hover:text-primary hover:bg-primary/10",onClick:_,children:[h.jsx($i,{className:"h-4 w-4"}),"Create new ",m.toLowerCase()]})})]})]})}function $p({open:t,onOpenChange:r,contactId:a,onSuccess:l,layer:s=0}){const c=!a,[u,d]=g.useState(""),[m,v]=g.useState(!1),{data:b,isLoading:y}=$e.contacts.getById.useQuery({id:a},{enabled:!!a&&t}),{data:w,isLoading:C}=$e.companies.search.useQuery({query:u,limit:5},{enabled:t}),E=()=>{if(c||!b?.company?.[0])return null;const he=b.company[0];return!he.id||!he.name?null:{id:he.id,name:he.name,subtitle:he.website}},S=c?"":b?.firstName||"",R=c?"":b?.lastName||"",M=c?"":b?.mail||"",O=c?"":b?.phone1||"",_=c?"":b?.phone2||"",z=c?"":b?.notes||"",k=E(),[I,N]=g.useState(""),[T,A]=g.useState(""),[q,K]=g.useState(""),[W,ue]=g.useState(""),[le,de]=g.useState(""),[L,G]=g.useState(""),[B,ee]=g.useState(null),[ie,D]=g.useState(!1);t&&!y&&!ie&&(N(S),A(R),K(M),ue(O),de(_),G(z),ee(k),D(!0)),!t&&ie&&D(!1);const Q=c?B!==null:B?.id!==k?.id,J=c?I.trim().length>0||T.trim().length>0:I!==S||T!==R||q!==M||W!==O||le!==_||L!==z||Q,ne=$e.contacts.create.useMutation({onSuccess:he=>{const dt=he?.id?{id:he.id,firstName:I,lastName:T,mail:q||void 0}:void 0;l?.(dt),r(!1)}}),fe=$e.contacts.update.useMutation({onSuccess:()=>{l?.(),r(!1)}}),me=$e.contacts.delete.useMutation({onSuccess:()=>{l?.(),r(!1)}}),re=()=>{c?I.trim()&&T.trim()&&ne.mutate({firstName:I,lastName:T,mail:q||void 0,phone1:W||void 0,phone2:le||void 0,notes:L||void 0,company:B?[B.id]:void 0}):a&&J&&fe.mutate({id:a,firstName:I||void 0,lastName:T||void 0,mail:q||void 0,phone1:W||void 0,phone2:le||void 0,notes:L||void 0,company:B?[B.id]:[]})},De=()=>{a&&me.mutate({id:a})},Ae=()=>{d("")},Te=ne.isPending||fe.isPending,Ue=(w||[]).filter(he=>he.id!==void 0&&he.name!==void 0).map(he=>({id:he.id,name:he.name,subtitle:he.website}));return h.jsxs(h.Fragment,{children:[h.jsxs(Rd,{open:t,onOpenChange:r,title:c?"New Contact":"Contact Details",description:c?"Create a new contact record":"View and edit contact information",icon:h.jsx(zn,{className:"h-5 w-5 text-primary"}),isCreateMode:c,isLoading:y,hasChanges:J,isPending:Te,isDeletePending:me.isPending,onSave:re,onDelete:c?void 0:De,layer:s,footer:!c&&b?h.jsx("div",{className:"pt-4 border-t",children:h.jsxs("p",{className:"text-xs text-muted-foreground",children:["Created: ",b.createdAt?new Date(b.createdAt).toLocaleDateString():"-",b.updatedAt&&h.jsxs(h.Fragment,{children:[" | Updated: ",new Date(b.updatedAt).toLocaleDateString()]})]})}):void 0,children:[h.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(kt,{htmlFor:"firstName",children:"First Name *"}),h.jsx(An,{id:"firstName",value:I,onChange:he=>N(he.target.value),placeholder:"John"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(kt,{htmlFor:"lastName",children:"Last Name *"}),h.jsx(An,{id:"lastName",value:T,onChange:he=>A(he.target.value),placeholder:"Doe"})]})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(kt,{htmlFor:"mail",children:"Email"}),h.jsxs("div",{className:"relative",children:[h.jsx(bp,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),h.jsx(An,{id:"mail",type:"email",value:q,onChange:he=>K(he.target.value),placeholder:"john@example.com",className:"pl-10"})]})]}),h.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(kt,{htmlFor:"phone1",children:"Phone 1"}),h.jsxs("div",{className:"relative",children:[h.jsx(pa,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),h.jsx(An,{id:"phone1",value:W,onChange:he=>ue(he.target.value),placeholder:"+1 234 567 890",className:"pl-10"})]})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(kt,{htmlFor:"phone2",children:"Phone 2"}),h.jsxs("div",{className:"relative",children:[h.jsx(pa,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),h.jsx(An,{id:"phone2",value:le,onChange:he=>de(he.target.value),placeholder:"+1 234 567 890",className:"pl-10"})]})]})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(kt,{children:"Company"}),h.jsx(Xp,{value:B,onChange:ee,onSearch:d,onCreateNew:()=>v(!0),options:Ue,isLoading:C,placeholder:"Select a company...",icon:ma,entityName:"Company"})]}),h.jsxs("div",{className:"space-y-2 flex-1",children:[h.jsx(kt,{htmlFor:"notes",children:"Notes"}),h.jsx(gd,{id:"notes",value:L,onChange:he=>G(he.target.value),placeholder:"Add any notes about this contact...",className:"min-h-[120px] resize-none"})]})]}),h.jsx(CC,{open:m,onOpenChange:v,companyId:null,layer:s+1,onSuccess:he=>{Ae(),he&&ee({id:he.id,name:he.name,subtitle:he.website}),v(!1)}})]})}function K5(){const r=!!Sa().state?.openCreate,[a,l]=g.useState(r),[s,c]=g.useState(null);g.useLayoutEffect(()=>{r&&window.history.replaceState({},document.title)},[r]);const{data:u,isLoading:d,refetch:m}=$e.contacts.getAll.useQuery(),v=C=>C?new Date(C).toLocaleDateString():"-",b=C=>{c(C),l(!0)},y=()=>{c(null),l(!0)},w=()=>{m()};return h.jsxs("div",{className:"container mx-auto p-6 max-w-6xl space-y-6",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("div",{className:"p-2.5 rounded-xl bg-gradient-to-br from-primary/20 to-primary/5 border border-primary/20",children:h.jsx(zn,{className:"h-6 w-6 text-primary"})}),h.jsxs("div",{children:[h.jsx("h1",{className:"text-2xl font-bold",children:"Contacts"}),h.jsx("p",{className:"text-sm text-muted-foreground",children:"Manage your contact records"})]})]}),h.jsxs(Ge,{onClick:y,children:[h.jsx($i,{className:"h-4 w-4 mr-2"}),"New Contact"]})]}),h.jsxs(cr,{children:[h.jsxs(ur,{className:"pb-4",children:[h.jsx(dr,{className:"text-lg",children:"All Contacts"}),h.jsxs(no,{children:[u?.length??0," ",u?.length===1?"contact":"contacts"]})]}),h.jsx(fr,{children:d?h.jsx("div",{className:"flex items-center justify-center py-12",children:h.jsx(Yn,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):u&&u.length>0?h.jsx("div",{className:"rounded-lg border",children:h.jsxs(Us,{children:[h.jsx(Bs,{children:h.jsxs(ya,{children:[h.jsx($t,{children:"Name"}),h.jsx($t,{children:"Email"}),h.jsx($t,{children:"Phone"}),h.jsx($t,{children:"Created"})]})}),h.jsx(Hs,{children:u.map(C=>h.jsxs(ya,{className:"cursor-pointer hover:bg-muted/50 transition-colors",onClick:()=>C.id&&b(C.id),children:[h.jsx(Zt,{className:"font-medium",children:[C.firstName,C.lastName].filter(Boolean).join(" ")||"-"}),h.jsx(Zt,{children:C.mail?h.jsxs("span",{className:"inline-flex items-center gap-1.5 text-primary",onClick:E=>{E.stopPropagation(),window.location.href=`mailto:${C.mail}`},children:[h.jsx(bp,{className:"h-3.5 w-3.5"}),h.jsx("span",{className:"hover:underline",children:C.mail})]}):h.jsx("span",{className:"text-muted-foreground",children:"-"})}),h.jsx(Zt,{children:C.phone1?h.jsxs("span",{className:"inline-flex items-center gap-1.5 text-primary",onClick:E=>{E.stopPropagation(),window.location.href=`tel:${C.phone1}`},children:[h.jsx(pa,{className:"h-3.5 w-3.5"}),h.jsx("span",{className:"hover:underline",children:C.phone1})]}):h.jsx("span",{className:"text-muted-foreground",children:"-"})}),h.jsx(Zt,{className:"text-muted-foreground",children:v(C.createdAt)})]},C.id))})]})}):h.jsxs("div",{className:"text-center py-12 text-muted-foreground",children:[h.jsx(zn,{className:"h-12 w-12 mx-auto mb-4 opacity-20"}),h.jsx("p",{children:"No contacts yet."}),h.jsx(Ge,{variant:"link",onClick:y,className:"mt-2",children:"Create your first contact"})]})})]}),h.jsx($p,{open:a,onOpenChange:l,contactId:s,onSuccess:w})]})}function Cx(t,[r,a]){return Math.min(a,Math.max(r,t))}function X5(t){const r=g.useRef({value:t,previous:t});return g.useMemo(()=>(r.current.value!==t&&(r.current.previous=r.current.value,r.current.value=t),r.current.previous),[t])}var NC=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"}),$5="VisuallyHidden",Z5=g.forwardRef((t,r)=>h.jsx(Ie.span,{...t,ref:r,style:{...NC,...t.style}}));Z5.displayName=$5;var J5=[" ","Enter","ArrowUp","ArrowDown"],W5=[" ","Enter"],Fi="Select",[Md,Od,ez]=wp(Fi),[ro]=si(Fi,[ez,id]),Dd=id(),[tz,ui]=ro(Fi),[nz,rz]=ro(Fi),EC=t=>{const{__scopeSelect:r,children:a,open:l,defaultOpen:s,onOpenChange:c,value:u,defaultValue:d,onValueChange:m,dir:v,name:b,autoComplete:y,disabled:w,required:C,form:E}=t,S=Dd(r),[R,M]=g.useState(null),[O,_]=g.useState(null),[z,k]=g.useState(!1),I=Ju(v),[N,T]=Gl({prop:l,defaultProp:s??!1,onChange:c,caller:Fi}),[A,q]=Gl({prop:u,defaultProp:d,onChange:m,caller:Fi}),K=g.useRef(null),W=R?E||!!R.closest("form"):!0,[ue,le]=g.useState(new Set),de=Array.from(ue).map(L=>L.props.value).join(";");return h.jsx(Sw,{...S,children:h.jsxs(tz,{required:C,scope:r,trigger:R,onTriggerChange:M,valueNode:O,onValueNodeChange:_,valueNodeHasChildren:z,onValueNodeHasChildrenChange:k,contentId:Br(),value:A,onValueChange:q,open:N,onOpenChange:T,dir:I,triggerPointerDownPosRef:K,disabled:w,children:[h.jsx(Md.Provider,{scope:r,children:h.jsx(nz,{scope:t.__scopeSelect,onNativeOptionAdd:g.useCallback(L=>{le(G=>new Set(G).add(L))},[]),onNativeOptionRemove:g.useCallback(L=>{le(G=>{const B=new Set(G);return B.delete(L),B})},[]),children:a})}),W?h.jsxs(XC,{"aria-hidden":!0,required:C,tabIndex:-1,name:b,autoComplete:y,value:A,onChange:L=>q(L.target.value),disabled:w,form:E,children:[A===void 0?h.jsx("option",{value:""}):null,Array.from(ue)]},de):null]})})};EC.displayName=Fi;var jC="SelectTrigger",RC=g.forwardRef((t,r)=>{const{__scopeSelect:a,disabled:l=!1,...s}=t,c=Dd(a),u=ui(jC,a),d=u.disabled||l,m=mt(r,u.onTriggerChange),v=Od(a),b=g.useRef("touch"),[y,w,C]=ZC(S=>{const R=v().filter(_=>!_.disabled),M=R.find(_=>_.value===u.value),O=JC(R,S,M);O!==void 0&&u.onValueChange(O.value)}),E=S=>{d||(u.onOpenChange(!0),C()),S&&(u.triggerPointerDownPosRef.current={x:Math.round(S.pageX),y:Math.round(S.pageY)})};return h.jsx(ww,{asChild:!0,...c,children:h.jsx(Ie.button,{type:"button",role:"combobox","aria-controls":u.contentId,"aria-expanded":u.open,"aria-required":u.required,"aria-autocomplete":"none",dir:u.dir,"data-state":u.open?"open":"closed",disabled:d,"data-disabled":d?"":void 0,"data-placeholder":$C(u.value)?"":void 0,...s,ref:m,onClick:Re(s.onClick,S=>{S.currentTarget.focus(),b.current!=="mouse"&&E(S)}),onPointerDown:Re(s.onPointerDown,S=>{b.current=S.pointerType;const R=S.target;R.hasPointerCapture(S.pointerId)&&R.releasePointerCapture(S.pointerId),S.button===0&&S.ctrlKey===!1&&S.pointerType==="mouse"&&(E(S),S.preventDefault())}),onKeyDown:Re(s.onKeyDown,S=>{const R=y.current!=="";!(S.ctrlKey||S.altKey||S.metaKey)&&S.key.length===1&&w(S.key),!(R&&S.key===" ")&&J5.includes(S.key)&&(E(),S.preventDefault())})})})});RC.displayName=jC;var MC="SelectValue",OC=g.forwardRef((t,r)=>{const{__scopeSelect:a,className:l,style:s,children:c,placeholder:u="",...d}=t,m=ui(MC,a),{onValueNodeHasChildrenChange:v}=m,b=c!==void 0,y=mt(r,m.onValueNodeChange);return hn(()=>{v(b)},[v,b]),h.jsx(Ie.span,{...d,ref:y,style:{pointerEvents:"none"},children:$C(m.value)?h.jsx(h.Fragment,{children:u}):c})});OC.displayName=MC;var az="SelectIcon",DC=g.forwardRef((t,r)=>{const{__scopeSelect:a,children:l,...s}=t;return h.jsx(Ie.span,{"aria-hidden":!0,...s,ref:r,children:l||"▼"})});DC.displayName=az;var iz="SelectPortal",TC=t=>h.jsx(ld,{asChild:!0,...t});TC.displayName=iz;var Gi="SelectContent",_C=g.forwardRef((t,r)=>{const a=ui(Gi,t.__scopeSelect),[l,s]=g.useState();if(hn(()=>{s(new DocumentFragment)},[]),!a.open){const c=l;return c?Sr.createPortal(h.jsx(AC,{scope:t.__scopeSelect,children:h.jsx(Md.Slot,{scope:t.__scopeSelect,children:h.jsx("div",{children:t.children})})}),c):null}return h.jsx(zC,{...t,ref:r})});_C.displayName=Gi;var br=10,[AC,di]=ro(Gi),lz="SelectContentImpl",oz=Yl("SelectContent.RemoveScroll"),zC=g.forwardRef((t,r)=>{const{__scopeSelect:a,position:l="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:c,onPointerDownOutside:u,side:d,sideOffset:m,align:v,alignOffset:b,arrowPadding:y,collisionBoundary:w,collisionPadding:C,sticky:E,hideWhenDetached:S,avoidCollisions:R,...M}=t,O=ui(Gi,a),[_,z]=g.useState(null),[k,I]=g.useState(null),N=mt(r,re=>z(re)),[T,A]=g.useState(null),[q,K]=g.useState(null),W=Od(a),[ue,le]=g.useState(!1),de=g.useRef(!1);g.useEffect(()=>{if(_)return _p(_)},[_]),Cp();const L=g.useCallback(re=>{const[De,...Ae]=W().map(he=>he.ref.current),[Te]=Ae.slice(-1),Ue=document.activeElement;for(const he of re)if(he===Ue||(he?.scrollIntoView({block:"nearest"}),he===De&&k&&(k.scrollTop=0),he===Te&&k&&(k.scrollTop=k.scrollHeight),he?.focus(),document.activeElement!==Ue))return},[W,k]),G=g.useCallback(()=>L([T,_]),[L,T,_]);g.useEffect(()=>{ue&&G()},[ue,G]);const{onOpenChange:B,triggerPointerDownPosRef:ee}=O;g.useEffect(()=>{if(_){let re={x:0,y:0};const De=Te=>{re={x:Math.abs(Math.round(Te.pageX)-(ee.current?.x??0)),y:Math.abs(Math.round(Te.pageY)-(ee.current?.y??0))}},Ae=Te=>{re.x<=10&&re.y<=10?Te.preventDefault():_.contains(Te.target)||B(!1),document.removeEventListener("pointermove",De),ee.current=null};return ee.current!==null&&(document.addEventListener("pointermove",De),document.addEventListener("pointerup",Ae,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",De),document.removeEventListener("pointerup",Ae,{capture:!0})}}},[_,B,ee]),g.useEffect(()=>{const re=()=>B(!1);return window.addEventListener("blur",re),window.addEventListener("resize",re),()=>{window.removeEventListener("blur",re),window.removeEventListener("resize",re)}},[B]);const[ie,D]=ZC(re=>{const De=W().filter(Ue=>!Ue.disabled),Ae=De.find(Ue=>Ue.ref.current===document.activeElement),Te=JC(De,re,Ae);Te&&setTimeout(()=>Te.ref.current.focus())}),Q=g.useCallback((re,De,Ae)=>{const Te=!de.current&&!Ae;(O.value!==void 0&&O.value===De||Te)&&(A(re),Te&&(de.current=!0))},[O.value]),J=g.useCallback(()=>_?.focus(),[_]),ne=g.useCallback((re,De,Ae)=>{const Te=!de.current&&!Ae;(O.value!==void 0&&O.value===De||Te)&&K(re)},[O.value]),fe=l==="popper"?Gm:LC,me=fe===Gm?{side:d,sideOffset:m,align:v,alignOffset:b,arrowPadding:y,collisionBoundary:w,collisionPadding:C,sticky:E,hideWhenDetached:S,avoidCollisions:R}:{};return h.jsx(AC,{scope:a,content:_,viewport:k,onViewportChange:I,itemRefCallback:Q,selectedItem:T,onItemLeave:J,itemTextRefCallback:ne,focusSelectedItem:G,selectedItemText:q,position:l,isPositioned:ue,searchRef:ie,children:h.jsx(cd,{as:oz,allowPinchZoom:!0,children:h.jsx(ed,{asChild:!0,trapped:O.open,onMountAutoFocus:re=>{re.preventDefault()},onUnmountAutoFocus:Re(s,re=>{O.trigger?.focus({preventScroll:!0}),re.preventDefault()}),children:h.jsx(Wu,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:re=>re.preventDefault(),onDismiss:()=>O.onOpenChange(!1),children:h.jsx(fe,{role:"listbox",id:O.contentId,"data-state":O.open?"open":"closed",dir:O.dir,onContextMenu:re=>re.preventDefault(),...M,...me,onPlaced:()=>le(!0),ref:N,style:{display:"flex",flexDirection:"column",outline:"none",...M.style},onKeyDown:Re(M.onKeyDown,re=>{const De=re.ctrlKey||re.altKey||re.metaKey;if(re.key==="Tab"&&re.preventDefault(),!De&&re.key.length===1&&D(re.key),["ArrowUp","ArrowDown","Home","End"].includes(re.key)){let Te=W().filter(Ue=>!Ue.disabled).map(Ue=>Ue.ref.current);if(["ArrowUp","End"].includes(re.key)&&(Te=Te.slice().reverse()),["ArrowUp","ArrowDown"].includes(re.key)){const Ue=re.target,he=Te.indexOf(Ue);Te=Te.slice(he+1)}setTimeout(()=>L(Te)),re.preventDefault()}})})})})})})});zC.displayName=lz;var sz="SelectItemAlignedPosition",LC=g.forwardRef((t,r)=>{const{__scopeSelect:a,onPlaced:l,...s}=t,c=ui(Gi,a),u=di(Gi,a),[d,m]=g.useState(null),[v,b]=g.useState(null),y=mt(r,N=>b(N)),w=Od(a),C=g.useRef(!1),E=g.useRef(!0),{viewport:S,selectedItem:R,selectedItemText:M,focusSelectedItem:O}=u,_=g.useCallback(()=>{if(c.trigger&&c.valueNode&&d&&v&&S&&R&&M){const N=c.trigger.getBoundingClientRect(),T=v.getBoundingClientRect(),A=c.valueNode.getBoundingClientRect(),q=M.getBoundingClientRect();if(c.dir!=="rtl"){const Ue=q.left-T.left,he=A.left-Ue,dt=N.left-he,pt=N.width+dt,Sn=Math.max(pt,T.width),jt=window.innerWidth-br,Rr=Cx(he,[br,Math.max(br,jt-Sn)]);d.style.minWidth=pt+"px",d.style.left=Rr+"px"}else{const Ue=T.right-q.right,he=window.innerWidth-A.right-Ue,dt=window.innerWidth-N.right-he,pt=N.width+dt,Sn=Math.max(pt,T.width),jt=window.innerWidth-br,Rr=Cx(he,[br,Math.max(br,jt-Sn)]);d.style.minWidth=pt+"px",d.style.right=Rr+"px"}const K=w(),W=window.innerHeight-br*2,ue=S.scrollHeight,le=window.getComputedStyle(v),de=parseInt(le.borderTopWidth,10),L=parseInt(le.paddingTop,10),G=parseInt(le.borderBottomWidth,10),B=parseInt(le.paddingBottom,10),ee=de+L+ue+B+G,ie=Math.min(R.offsetHeight*5,ee),D=window.getComputedStyle(S),Q=parseInt(D.paddingTop,10),J=parseInt(D.paddingBottom,10),ne=N.top+N.height/2-br,fe=W-ne,me=R.offsetHeight/2,re=R.offsetTop+me,De=de+L+re,Ae=ee-De;if(De<=ne){const Ue=K.length>0&&R===K[K.length-1].ref.current;d.style.bottom="0px";const he=v.clientHeight-S.offsetTop-S.offsetHeight,dt=Math.max(fe,me+(Ue?J:0)+he+G),pt=De+dt;d.style.height=pt+"px"}else{const Ue=K.length>0&&R===K[0].ref.current;d.style.top="0px";const dt=Math.max(ne,de+S.offsetTop+(Ue?Q:0)+me)+Ae;d.style.height=dt+"px",S.scrollTop=De-ne+S.offsetTop}d.style.margin=`${br}px 0`,d.style.minHeight=ie+"px",d.style.maxHeight=W+"px",l?.(),requestAnimationFrame(()=>C.current=!0)}},[w,c.trigger,c.valueNode,d,v,S,R,M,c.dir,l]);hn(()=>_(),[_]);const[z,k]=g.useState();hn(()=>{v&&k(window.getComputedStyle(v).zIndex)},[v]);const I=g.useCallback(N=>{N&&E.current===!0&&(_(),O?.(),E.current=!1)},[_,O]);return h.jsx(uz,{scope:a,contentWrapper:d,shouldExpandOnScrollRef:C,onScrollButtonChange:I,children:h.jsx("div",{ref:m,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:z},children:h.jsx(Ie.div,{...s,ref:y,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});LC.displayName=sz;var cz="SelectPopperPosition",Gm=g.forwardRef((t,r)=>{const{__scopeSelect:a,align:l="start",collisionPadding:s=br,...c}=t,u=Dd(a);return h.jsx(Cw,{...u,...c,ref:r,align:l,collisionPadding:s,style:{boxSizing:"border-box",...c.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)"}})});Gm.displayName=cz;var[uz,Zp]=ro(Gi,{}),Ym="SelectViewport",kC=g.forwardRef((t,r)=>{const{__scopeSelect:a,nonce:l,...s}=t,c=di(Ym,a),u=Zp(Ym,a),d=mt(r,c.onViewportChange),m=g.useRef(0);return h.jsxs(h.Fragment,{children:[h.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:l}),h.jsx(Md.Slot,{scope:a,children:h.jsx(Ie.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:d,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:Re(s.onScroll,v=>{const b=v.currentTarget,{contentWrapper:y,shouldExpandOnScrollRef:w}=u;if(w?.current&&y){const C=Math.abs(m.current-b.scrollTop);if(C>0){const E=window.innerHeight-br*2,S=parseFloat(y.style.minHeight),R=parseFloat(y.style.height),M=Math.max(S,R);if(M<E){const O=M+C,_=Math.min(E,O),z=O-_;y.style.height=_+"px",y.style.bottom==="0px"&&(b.scrollTop=z>0?z:0,y.style.justifyContent="flex-end")}}}m.current=b.scrollTop})})})]})});kC.displayName=Ym;var PC="SelectGroup",[dz,fz]=ro(PC),hz=g.forwardRef((t,r)=>{const{__scopeSelect:a,...l}=t,s=Br();return h.jsx(dz,{scope:a,id:s,children:h.jsx(Ie.div,{role:"group","aria-labelledby":s,...l,ref:r})})});hz.displayName=PC;var UC="SelectLabel",BC=g.forwardRef((t,r)=>{const{__scopeSelect:a,...l}=t,s=fz(UC,a);return h.jsx(Ie.div,{id:s.id,...l,ref:r})});BC.displayName=UC;var qu="SelectItem",[mz,HC]=ro(qu),qC=g.forwardRef((t,r)=>{const{__scopeSelect:a,value:l,disabled:s=!1,textValue:c,...u}=t,d=ui(qu,a),m=di(qu,a),v=d.value===l,[b,y]=g.useState(c??""),[w,C]=g.useState(!1),E=mt(r,O=>m.itemRefCallback?.(O,l,s)),S=Br(),R=g.useRef("touch"),M=()=>{s||(d.onValueChange(l),d.onOpenChange(!1))};if(l==="")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 h.jsx(mz,{scope:a,value:l,disabled:s,textId:S,isSelected:v,onItemTextChange:g.useCallback(O=>{y(_=>_||(O?.textContent??"").trim())},[]),children:h.jsx(Md.ItemSlot,{scope:a,value:l,disabled:s,textValue:b,children:h.jsx(Ie.div,{role:"option","aria-labelledby":S,"data-highlighted":w?"":void 0,"aria-selected":v&&w,"data-state":v?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...u,ref:E,onFocus:Re(u.onFocus,()=>C(!0)),onBlur:Re(u.onBlur,()=>C(!1)),onClick:Re(u.onClick,()=>{R.current!=="mouse"&&M()}),onPointerUp:Re(u.onPointerUp,()=>{R.current==="mouse"&&M()}),onPointerDown:Re(u.onPointerDown,O=>{R.current=O.pointerType}),onPointerMove:Re(u.onPointerMove,O=>{R.current=O.pointerType,s?m.onItemLeave?.():R.current==="mouse"&&O.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Re(u.onPointerLeave,O=>{O.currentTarget===document.activeElement&&m.onItemLeave?.()}),onKeyDown:Re(u.onKeyDown,O=>{m.searchRef?.current!==""&&O.key===" "||(W5.includes(O.key)&&M(),O.key===" "&&O.preventDefault())})})})})});qC.displayName=qu;var is="SelectItemText",IC=g.forwardRef((t,r)=>{const{__scopeSelect:a,className:l,style:s,...c}=t,u=ui(is,a),d=di(is,a),m=HC(is,a),v=rz(is,a),[b,y]=g.useState(null),w=mt(r,M=>y(M),m.onItemTextChange,M=>d.itemTextRefCallback?.(M,m.value,m.disabled)),C=b?.textContent,E=g.useMemo(()=>h.jsx("option",{value:m.value,disabled:m.disabled,children:C},m.value),[m.disabled,m.value,C]),{onNativeOptionAdd:S,onNativeOptionRemove:R}=v;return hn(()=>(S(E),()=>R(E)),[S,R,E]),h.jsxs(h.Fragment,{children:[h.jsx(Ie.span,{id:m.textId,...c,ref:w}),m.isSelected&&u.valueNode&&!u.valueNodeHasChildren?Sr.createPortal(c.children,u.valueNode):null]})});IC.displayName=is;var QC="SelectItemIndicator",VC=g.forwardRef((t,r)=>{const{__scopeSelect:a,...l}=t;return HC(QC,a).isSelected?h.jsx(Ie.span,{"aria-hidden":!0,...l,ref:r}):null});VC.displayName=QC;var Km="SelectScrollUpButton",FC=g.forwardRef((t,r)=>{const a=di(Km,t.__scopeSelect),l=Zp(Km,t.__scopeSelect),[s,c]=g.useState(!1),u=mt(r,l.onScrollButtonChange);return hn(()=>{if(a.viewport&&a.isPositioned){let d=function(){const v=m.scrollTop>0;c(v)};const m=a.viewport;return d(),m.addEventListener("scroll",d),()=>m.removeEventListener("scroll",d)}},[a.viewport,a.isPositioned]),s?h.jsx(YC,{...t,ref:u,onAutoScroll:()=>{const{viewport:d,selectedItem:m}=a;d&&m&&(d.scrollTop=d.scrollTop-m.offsetHeight)}}):null});FC.displayName=Km;var Xm="SelectScrollDownButton",GC=g.forwardRef((t,r)=>{const a=di(Xm,t.__scopeSelect),l=Zp(Xm,t.__scopeSelect),[s,c]=g.useState(!1),u=mt(r,l.onScrollButtonChange);return hn(()=>{if(a.viewport&&a.isPositioned){let d=function(){const v=m.scrollHeight-m.clientHeight,b=Math.ceil(m.scrollTop)<v;c(b)};const m=a.viewport;return d(),m.addEventListener("scroll",d),()=>m.removeEventListener("scroll",d)}},[a.viewport,a.isPositioned]),s?h.jsx(YC,{...t,ref:u,onAutoScroll:()=>{const{viewport:d,selectedItem:m}=a;d&&m&&(d.scrollTop=d.scrollTop+m.offsetHeight)}}):null});GC.displayName=Xm;var YC=g.forwardRef((t,r)=>{const{__scopeSelect:a,onAutoScroll:l,...s}=t,c=di("SelectScrollButton",a),u=g.useRef(null),d=Od(a),m=g.useCallback(()=>{u.current!==null&&(window.clearInterval(u.current),u.current=null)},[]);return g.useEffect(()=>()=>m(),[m]),hn(()=>{d().find(b=>b.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[d]),h.jsx(Ie.div,{"aria-hidden":!0,...s,ref:r,style:{flexShrink:0,...s.style},onPointerDown:Re(s.onPointerDown,()=>{u.current===null&&(u.current=window.setInterval(l,50))}),onPointerMove:Re(s.onPointerMove,()=>{c.onItemLeave?.(),u.current===null&&(u.current=window.setInterval(l,50))}),onPointerLeave:Re(s.onPointerLeave,()=>{m()})})}),pz="SelectSeparator",KC=g.forwardRef((t,r)=>{const{__scopeSelect:a,...l}=t;return h.jsx(Ie.div,{"aria-hidden":!0,...l,ref:r})});KC.displayName=pz;var $m="SelectArrow",vz=g.forwardRef((t,r)=>{const{__scopeSelect:a,...l}=t,s=Dd(a),c=ui($m,a),u=di($m,a);return c.open&&u.position==="popper"?h.jsx(Nw,{...s,...l,ref:r}):null});vz.displayName=$m;var gz="SelectBubbleInput",XC=g.forwardRef(({__scopeSelect:t,value:r,...a},l)=>{const s=g.useRef(null),c=mt(l,s),u=X5(r);return g.useEffect(()=>{const d=s.current;if(!d)return;const m=window.HTMLSelectElement.prototype,b=Object.getOwnPropertyDescriptor(m,"value").set;if(u!==r&&b){const y=new Event("change",{bubbles:!0});b.call(d,r),d.dispatchEvent(y)}},[u,r]),h.jsx(Ie.select,{...a,style:{...NC,...a.style},ref:c,defaultValue:r})});XC.displayName=gz;function $C(t){return t===""||t===void 0}function ZC(t){const r=qr(t),a=g.useRef(""),l=g.useRef(0),s=g.useCallback(u=>{const d=a.current+u;r(d),(function m(v){a.current=v,window.clearTimeout(l.current),v!==""&&(l.current=window.setTimeout(()=>m(""),1e3))})(d)},[r]),c=g.useCallback(()=>{a.current="",window.clearTimeout(l.current)},[]);return g.useEffect(()=>()=>window.clearTimeout(l.current),[]),[a,s,c]}function JC(t,r,a){const s=r.length>1&&Array.from(r).every(v=>v===r[0])?r[0]:r,c=a?t.indexOf(a):-1;let u=yz(t,Math.max(c,0));s.length===1&&(u=u.filter(v=>v!==a));const m=u.find(v=>v.textValue.toLowerCase().startsWith(s.toLowerCase()));return m!==a?m:void 0}function yz(t,r){return t.map((a,l)=>t[(r+l)%t.length])}var bz=EC,WC=RC,xz=OC,Sz=DC,wz=TC,eN=_C,Cz=kC,tN=BC,nN=qC,Nz=IC,Ez=VC,rN=FC,aN=GC,iN=KC;const Xl=bz,$l=xz,Yi=g.forwardRef(({className:t,children:r,...a},l)=>h.jsxs(WC,{ref:l,className:ye("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",t),...a,children:[r,h.jsx(Sz,{asChild:!0,children:h.jsx($u,{className:"h-4 w-4 opacity-50"})})]}));Yi.displayName=WC.displayName;const lN=g.forwardRef(({className:t,...r},a)=>h.jsx(rN,{ref:a,className:ye("flex cursor-default items-center justify-center py-1",t),...r,children:h.jsx(GM,{className:"h-4 w-4"})}));lN.displayName=rN.displayName;const oN=g.forwardRef(({className:t,...r},a)=>h.jsx(aN,{ref:a,className:ye("flex cursor-default items-center justify-center py-1",t),...r,children:h.jsx($u,{className:"h-4 w-4"})}));oN.displayName=aN.displayName;const Ki=g.forwardRef(({className:t,children:r,position:a="popper",...l},s)=>h.jsx(wz,{children:h.jsxs(eN,{ref:s,className:ye("relative z-[350] max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover text-popover-foreground shadow-md 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-select-content-transform-origin]",a==="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",t),position:a,...l,children:[h.jsx(lN,{}),h.jsx(Cz,{className:ye("p-1",a==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:r}),h.jsx(oN,{})]})}));Ki.displayName=eN.displayName;const jz=g.forwardRef(({className:t,...r},a)=>h.jsx(tN,{ref:a,className:ye("py-1.5 pl-8 pr-2 text-sm font-semibold",t),...r}));jz.displayName=tN.displayName;const _n=g.forwardRef(({className:t,children:r,...a},l)=>h.jsxs(nN,{ref:l,className:ye("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...a,children:[h.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:h.jsx(Ez,{children:h.jsx(DS,{className:"h-4 w-4"})})}),h.jsx(Nz,{children:r})]}));_n.displayName=nN.displayName;const Rz=g.forwardRef(({className:t,...r},a)=>h.jsx(iN,{ref:a,className:ye("-mx-1 my-1 h-px bg-muted",t),...r}));Rz.displayName=iN.displayName;const ao={New:{label:"New",icon:LO,color:"text-blue-500",bgColor:"bg-blue-500/10"},"Demo scheduled":{label:"Demo scheduled",icon:Os,color:"text-amber-500",bgColor:"bg-amber-500/10"},"Contract signed":{label:"Contract signed",icon:sO,color:"text-green-500",bgColor:"bg-green-500/10"},Lost:{label:"Lost",icon:XM,color:"text-red-500",bgColor:"bg-red-500/10"}},sN=Object.keys(ao);function Mz({phase:t}){const r=ao[t];if(!r)return h.jsx("span",{children:t});const a=r.icon;return h.jsxs("div",{className:"inline-flex items-center gap-1.5",children:[h.jsx("div",{className:`p-1 rounded ${r.bgColor}`,children:h.jsx(a,{className:`h-3.5 w-3.5 ${r.color}`})}),h.jsx("span",{className:r.color,children:r.label})]})}function Nx({phase:t}){const r=ao[t];if(!r)return h.jsx("span",{children:t});const a=r.icon;return h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("div",{className:`p-1 rounded ${r.bgColor}`,children:h.jsx(a,{className:`h-3.5 w-3.5 ${r.color}`})}),h.jsx("span",{children:r.label})]})}function Oz(t){return[t.firstName,t.lastName].filter(Boolean).join(" ")||"Unknown"}function Dz({open:t,onOpenChange:r,dealId:a,onSuccess:l,layer:s=0}){const c=!a,[u,d]=g.useState(""),[m,v]=g.useState(!1),{data:b,isLoading:y}=$e.deals.getById.useQuery({id:a},{enabled:!!a&&t}),{data:w,isLoading:C}=$e.contacts.search.useQuery({query:u,limit:5},{enabled:t}),E=b,S=()=>{if(c||!E?.mainContact?.[0])return null;const D=E.mainContact[0];return D.id?{id:D.id,name:Oz(D),subtitle:D.mail}:null},R=c?"":E?.name||"",M=c?"New":E?.phase||"New",O=S(),[_,z]=g.useState(""),[k,I]=g.useState("New"),[N,T]=g.useState(null),[A,q]=g.useState(!1);t&&!y&&!A&&(z(R),I(M),T(O),q(!0)),!t&&A&&q(!1);const K=c?N!==null:N?.id!==O?.id,W=c?_.trim().length>0:_!==R||k!==M||K,ue=$e.deals.create.useMutation({onSuccess:()=>{l?.(),r(!1)}}),le=$e.deals.update.useMutation({onSuccess:()=>{l?.(),r(!1)}}),de=$e.deals.delete.useMutation({onSuccess:()=>{l?.(),r(!1)}}),L=()=>{c?_.trim()&&ue.mutate({name:_,phase:k,mainContact:N?[N.id]:void 0}):a&&W&&le.mutate({id:a,name:_||void 0,phase:k,mainContact:N?[N.id]:[]})},G=()=>{a&&de.mutate({id:a})},B=()=>{d("")},ee=ue.isPending||le.isPending,ie=(w||[]).filter(D=>D.id!==void 0&&D.firstName!==void 0&&D.lastName!==void 0).map(D=>({id:D.id,name:`${D.firstName} ${D.lastName}`,subtitle:D.mail}));return h.jsxs(h.Fragment,{children:[h.jsxs(Rd,{open:t,onOpenChange:r,title:c?"New Deal":"Deal Details",description:c?"Create a new deal record":"View and edit deal information",icon:h.jsx(ni,{className:"h-5 w-5 text-primary"}),isCreateMode:c,isLoading:y,hasChanges:W,isPending:ee,isDeletePending:de.isPending,onSave:L,onDelete:c?void 0:G,layer:s,footer:!c&&E?h.jsx("div",{className:"pt-4 border-t",children:h.jsxs("p",{className:"text-xs text-muted-foreground",children:["Created: ",E.createdAt?new Date(E.createdAt).toLocaleDateString():"-",E.updatedAt&&h.jsxs(h.Fragment,{children:[" | Updated: ",new Date(E.updatedAt).toLocaleDateString()]})]})}):void 0,children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(kt,{htmlFor:"name",children:"Deal Name *"}),h.jsx(An,{id:"name",value:_,onChange:D=>z(D.target.value),placeholder:"Enterprise Contract Q1"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(kt,{htmlFor:"phase",children:"Phase *"}),h.jsxs(Xl,{value:k,onValueChange:D=>I(D),children:[h.jsx(Yi,{id:"phase",children:h.jsx($l,{children:h.jsx(Nx,{phase:k})})}),h.jsx(Ki,{children:sN.map(D=>h.jsx(_n,{value:D,children:h.jsx(Nx,{phase:D})},D))})]})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(kt,{children:"Main Contact"}),h.jsx(Xp,{value:N,onChange:T,onSearch:d,onCreateNew:()=>v(!0),options:ie,isLoading:C,placeholder:"Select a contact...",icon:zn,entityName:"Contact"})]})]}),h.jsx($p,{open:m,onOpenChange:v,contactId:null,layer:s+1,onSuccess:D=>{B(),D&&T({id:D.id,name:`${D.firstName} ${D.lastName}`,subtitle:D.mail}),v(!1)}})]})}const Td=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function io(t){const r=Object.prototype.toString.call(t);return r==="[object Window]"||r==="[object global]"}function Jp(t){return"nodeType"in t}function xn(t){var r,a;return t?io(t)?t:Jp(t)&&(r=(a=t.ownerDocument)==null?void 0:a.defaultView)!=null?r:window:window}function Wp(t){const{Document:r}=xn(t);return t instanceof r}function Is(t){return io(t)?!1:t instanceof xn(t).HTMLElement}function cN(t){return t instanceof xn(t).SVGElement}function lo(t){return t?io(t)?t.document:Jp(t)?Wp(t)?t:Is(t)||cN(t)?t.ownerDocument:document:document:document}const ba=Td?g.useLayoutEffect:g.useEffect;function _d(t){const r=g.useRef(t);return ba(()=>{r.current=t}),g.useCallback(function(){for(var a=arguments.length,l=new Array(a),s=0;s<a;s++)l[s]=arguments[s];return r.current==null?void 0:r.current(...l)},[])}function Tz(){const t=g.useRef(null),r=g.useCallback((l,s)=>{t.current=setInterval(l,s)},[]),a=g.useCallback(()=>{t.current!==null&&(clearInterval(t.current),t.current=null)},[]);return[r,a]}function Ss(t,r){r===void 0&&(r=[t]);const a=g.useRef(t);return ba(()=>{a.current!==t&&(a.current=t)},r),a}function Qs(t,r){const a=g.useRef();return g.useMemo(()=>{const l=t(a.current);return a.current=l,l},[...r])}function Iu(t){const r=_d(t),a=g.useRef(null),l=g.useCallback(s=>{s!==a.current&&r?.(s,a.current),a.current=s},[]);return[a,l]}function Qu(t){const r=g.useRef();return g.useEffect(()=>{r.current=t},[t]),r.current}let vm={};function Ad(t,r){return g.useMemo(()=>{if(r)return r;const a=vm[t]==null?0:vm[t]+1;return vm[t]=a,t+"-"+a},[t,r])}function uN(t){return function(r){for(var a=arguments.length,l=new Array(a>1?a-1:0),s=1;s<a;s++)l[s-1]=arguments[s];return l.reduce((c,u)=>{const d=Object.entries(u);for(const[m,v]of d){const b=c[m];b!=null&&(c[m]=b+t*v)}return c},{...r})}}const Vl=uN(1),Vu=uN(-1);function _z(t){return"clientX"in t&&"clientY"in t}function ev(t){if(!t)return!1;const{KeyboardEvent:r}=xn(t.target);return r&&t instanceof r}function Az(t){if(!t)return!1;const{TouchEvent:r}=xn(t.target);return r&&t instanceof r}function Fu(t){if(Az(t)){if(t.touches&&t.touches.length){const{clientX:r,clientY:a}=t.touches[0];return{x:r,y:a}}else if(t.changedTouches&&t.changedTouches.length){const{clientX:r,clientY:a}=t.changedTouches[0];return{x:r,y:a}}}return _z(t)?{x:t.clientX,y:t.clientY}:null}const Zl=Object.freeze({Translate:{toString(t){if(!t)return;const{x:r,y:a}=t;return"translate3d("+(r?Math.round(r):0)+"px, "+(a?Math.round(a):0)+"px, 0)"}},Scale:{toString(t){if(!t)return;const{scaleX:r,scaleY:a}=t;return"scaleX("+r+") scaleY("+a+")"}},Transform:{toString(t){if(t)return[Zl.Translate.toString(t),Zl.Scale.toString(t)].join(" ")}},Transition:{toString(t){let{property:r,duration:a,easing:l}=t;return r+" "+a+"ms "+l}}}),Ex="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function zz(t){return t.matches(Ex)?t:t.querySelector(Ex)}const Lz={display:"none"};function kz(t){let{id:r,value:a}=t;return ot.createElement("div",{id:r,style:Lz},a)}function Pz(t){let{id:r,announcement:a,ariaLiveType:l="assertive"}=t;const s={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return ot.createElement("div",{id:r,style:s,role:"status","aria-live":l,"aria-atomic":!0},a)}function Uz(){const[t,r]=g.useState("");return{announce:g.useCallback(l=>{l!=null&&r(l)},[]),announcement:t}}const dN=g.createContext(null);function Bz(t){const r=g.useContext(dN);g.useEffect(()=>{if(!r)throw new Error("useDndMonitor must be used within a children of <DndContext>");return r(t)},[t,r])}function Hz(){const[t]=g.useState(()=>new Set),r=g.useCallback(l=>(t.add(l),()=>t.delete(l)),[t]);return[g.useCallback(l=>{let{type:s,event:c}=l;t.forEach(u=>{var d;return(d=u[s])==null?void 0:d.call(u,c)})},[t]),r]}const qz={draggable:`
To pick up a draggable item, press the space bar.
While dragging, use the arrow keys to move the item.
Press space again to drop the item in its new position, or press escape to cancel.
`},Iz={onDragStart(t){let{active:r}=t;return"Picked up draggable item "+r.id+"."},onDragOver(t){let{active:r,over:a}=t;return a?"Draggable item "+r.id+" was moved over droppable area "+a.id+".":"Draggable item "+r.id+" is no longer over a droppable area."},onDragEnd(t){let{active:r,over:a}=t;return a?"Draggable item "+r.id+" was dropped over droppable area "+a.id:"Draggable item "+r.id+" was dropped."},onDragCancel(t){let{active:r}=t;return"Dragging was cancelled. Draggable item "+r.id+" was dropped."}};function Qz(t){let{announcements:r=Iz,container:a,hiddenTextDescribedById:l,screenReaderInstructions:s=qz}=t;const{announce:c,announcement:u}=Uz(),d=Ad("DndLiveRegion"),[m,v]=g.useState(!1);if(g.useEffect(()=>{v(!0)},[]),Bz(g.useMemo(()=>({onDragStart(y){let{active:w}=y;c(r.onDragStart({active:w}))},onDragMove(y){let{active:w,over:C}=y;r.onDragMove&&c(r.onDragMove({active:w,over:C}))},onDragOver(y){let{active:w,over:C}=y;c(r.onDragOver({active:w,over:C}))},onDragEnd(y){let{active:w,over:C}=y;c(r.onDragEnd({active:w,over:C}))},onDragCancel(y){let{active:w,over:C}=y;c(r.onDragCancel({active:w,over:C}))}}),[c,r])),!m)return null;const b=ot.createElement(ot.Fragment,null,ot.createElement(kz,{id:l,value:s.draggable}),ot.createElement(Pz,{id:d,announcement:u}));return a?Sr.createPortal(b,a):b}var Xt;(function(t){t.DragStart="dragStart",t.DragMove="dragMove",t.DragEnd="dragEnd",t.DragCancel="dragCancel",t.DragOver="dragOver",t.RegisterDroppable="registerDroppable",t.SetDroppableDisabled="setDroppableDisabled",t.UnregisterDroppable="unregisterDroppable"})(Xt||(Xt={}));function Gu(){}function Vz(t,r){return g.useMemo(()=>({sensor:t,options:r??{}}),[t,r])}function Fz(){for(var t=arguments.length,r=new Array(t),a=0;a<t;a++)r[a]=arguments[a];return g.useMemo(()=>[...r].filter(l=>l!=null),[...r])}const Nr=Object.freeze({x:0,y:0});function Gz(t,r){const a=Fu(t);if(!a)return"0 0";const l={x:(a.x-r.left)/r.width*100,y:(a.y-r.top)/r.height*100};return l.x+"% "+l.y+"%"}function Yz(t,r){let{data:{value:a}}=t,{data:{value:l}}=r;return l-a}function Kz(t,r){if(!t||t.length===0)return null;const[a]=t;return a[r]}function Xz(t,r){const a=Math.max(r.top,t.top),l=Math.max(r.left,t.left),s=Math.min(r.left+r.width,t.left+t.width),c=Math.min(r.top+r.height,t.top+t.height),u=s-l,d=c-a;if(l<s&&a<c){const m=r.width*r.height,v=t.width*t.height,b=u*d,y=b/(m+v-b);return Number(y.toFixed(4))}return 0}const $z=t=>{let{collisionRect:r,droppableRects:a,droppableContainers:l}=t;const s=[];for(const c of l){const{id:u}=c,d=a.get(u);if(d){const m=Xz(d,r);m>0&&s.push({id:u,data:{droppableContainer:c,value:m}})}}return s.sort(Yz)};function Zz(t,r,a){return{...t,scaleX:r&&a?r.width/a.width:1,scaleY:r&&a?r.height/a.height:1}}function fN(t,r){return t&&r?{x:t.left-r.left,y:t.top-r.top}:Nr}function Jz(t){return function(a){for(var l=arguments.length,s=new Array(l>1?l-1:0),c=1;c<l;c++)s[c-1]=arguments[c];return s.reduce((u,d)=>({...u,top:u.top+t*d.y,bottom:u.bottom+t*d.y,left:u.left+t*d.x,right:u.right+t*d.x}),{...a})}}const Wz=Jz(1);function hN(t){if(t.startsWith("matrix3d(")){const r=t.slice(9,-1).split(/, /);return{x:+r[12],y:+r[13],scaleX:+r[0],scaleY:+r[5]}}else if(t.startsWith("matrix(")){const r=t.slice(7,-1).split(/, /);return{x:+r[4],y:+r[5],scaleX:+r[0],scaleY:+r[3]}}return null}function eL(t,r,a){const l=hN(r);if(!l)return t;const{scaleX:s,scaleY:c,x:u,y:d}=l,m=t.left-u-(1-s)*parseFloat(a),v=t.top-d-(1-c)*parseFloat(a.slice(a.indexOf(" ")+1)),b=s?t.width/s:t.width,y=c?t.height/c:t.height;return{width:b,height:y,top:v,right:m+b,bottom:v+y,left:m}}const tL={ignoreTransform:!1};function Vs(t,r){r===void 0&&(r=tL);let a=t.getBoundingClientRect();if(r.ignoreTransform){const{transform:v,transformOrigin:b}=xn(t).getComputedStyle(t);v&&(a=eL(a,v,b))}const{top:l,left:s,width:c,height:u,bottom:d,right:m}=a;return{top:l,left:s,width:c,height:u,bottom:d,right:m}}function jx(t){return Vs(t,{ignoreTransform:!0})}function nL(t){const r=t.innerWidth,a=t.innerHeight;return{top:0,left:0,right:r,bottom:a,width:r,height:a}}function rL(t,r){return r===void 0&&(r=xn(t).getComputedStyle(t)),r.position==="fixed"}function aL(t,r){r===void 0&&(r=xn(t).getComputedStyle(t));const a=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(s=>{const c=r[s];return typeof c=="string"?a.test(c):!1})}function tv(t,r){const a=[];function l(s){if(r!=null&&a.length>=r||!s)return a;if(Wp(s)&&s.scrollingElement!=null&&!a.includes(s.scrollingElement))return a.push(s.scrollingElement),a;if(!Is(s)||cN(s)||a.includes(s))return a;const c=xn(t).getComputedStyle(s);return s!==t&&aL(s,c)&&a.push(s),rL(s,c)?a:l(s.parentNode)}return t?l(t):a}function mN(t){const[r]=tv(t,1);return r??null}function gm(t){return!Td||!t?null:io(t)?t:Jp(t)?Wp(t)||t===lo(t).scrollingElement?window:Is(t)?t:null:null}function pN(t){return io(t)?t.scrollX:t.scrollLeft}function vN(t){return io(t)?t.scrollY:t.scrollTop}function Zm(t){return{x:pN(t),y:vN(t)}}var en;(function(t){t[t.Forward=1]="Forward",t[t.Backward=-1]="Backward"})(en||(en={}));function gN(t){return!Td||!t?!1:t===document.scrollingElement}function yN(t){const r={x:0,y:0},a=gN(t)?{height:window.innerHeight,width:window.innerWidth}:{height:t.clientHeight,width:t.clientWidth},l={x:t.scrollWidth-a.width,y:t.scrollHeight-a.height},s=t.scrollTop<=r.y,c=t.scrollLeft<=r.x,u=t.scrollTop>=l.y,d=t.scrollLeft>=l.x;return{isTop:s,isLeft:c,isBottom:u,isRight:d,maxScroll:l,minScroll:r}}const iL={x:.2,y:.2};function lL(t,r,a,l,s){let{top:c,left:u,right:d,bottom:m}=a;l===void 0&&(l=10),s===void 0&&(s=iL);const{isTop:v,isBottom:b,isLeft:y,isRight:w}=yN(t),C={x:0,y:0},E={x:0,y:0},S={height:r.height*s.y,width:r.width*s.x};return!v&&c<=r.top+S.height?(C.y=en.Backward,E.y=l*Math.abs((r.top+S.height-c)/S.height)):!b&&m>=r.bottom-S.height&&(C.y=en.Forward,E.y=l*Math.abs((r.bottom-S.height-m)/S.height)),!w&&d>=r.right-S.width?(C.x=en.Forward,E.x=l*Math.abs((r.right-S.width-d)/S.width)):!y&&u<=r.left+S.width&&(C.x=en.Backward,E.x=l*Math.abs((r.left+S.width-u)/S.width)),{direction:C,speed:E}}function oL(t){if(t===document.scrollingElement){const{innerWidth:c,innerHeight:u}=window;return{top:0,left:0,right:c,bottom:u,width:c,height:u}}const{top:r,left:a,right:l,bottom:s}=t.getBoundingClientRect();return{top:r,left:a,right:l,bottom:s,width:t.clientWidth,height:t.clientHeight}}function bN(t){return t.reduce((r,a)=>Vl(r,Zm(a)),Nr)}function sL(t){return t.reduce((r,a)=>r+pN(a),0)}function cL(t){return t.reduce((r,a)=>r+vN(a),0)}function xN(t,r){if(r===void 0&&(r=Vs),!t)return;const{top:a,left:l,bottom:s,right:c}=r(t);mN(t)&&(s<=0||c<=0||a>=window.innerHeight||l>=window.innerWidth)&&t.scrollIntoView({block:"center",inline:"center"})}const uL=[["x",["left","right"],sL],["y",["top","bottom"],cL]];class nv{constructor(r,a){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const l=tv(a),s=bN(l);this.rect={...r},this.width=r.width,this.height=r.height;for(const[c,u,d]of uL)for(const m of u)Object.defineProperty(this,m,{get:()=>{const v=d(l),b=s[c]-v;return this.rect[m]+b},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class os{constructor(r){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(a=>{var l;return(l=this.target)==null?void 0:l.removeEventListener(...a)})},this.target=r}add(r,a,l){var s;(s=this.target)==null||s.addEventListener(r,a,l),this.listeners.push([r,a,l])}}function dL(t){const{EventTarget:r}=xn(t);return t instanceof r?t:lo(t)}function ym(t,r){const a=Math.abs(t.x),l=Math.abs(t.y);return typeof r=="number"?Math.sqrt(a**2+l**2)>r:"x"in r&&"y"in r?a>r.x&&l>r.y:"x"in r?a>r.x:"y"in r?l>r.y:!1}var sr;(function(t){t.Click="click",t.DragStart="dragstart",t.Keydown="keydown",t.ContextMenu="contextmenu",t.Resize="resize",t.SelectionChange="selectionchange",t.VisibilityChange="visibilitychange"})(sr||(sr={}));function Rx(t){t.preventDefault()}function fL(t){t.stopPropagation()}var ht;(function(t){t.Space="Space",t.Down="ArrowDown",t.Right="ArrowRight",t.Left="ArrowLeft",t.Up="ArrowUp",t.Esc="Escape",t.Enter="Enter",t.Tab="Tab"})(ht||(ht={}));const SN={start:[ht.Space,ht.Enter],cancel:[ht.Esc],end:[ht.Space,ht.Enter,ht.Tab]},hL=(t,r)=>{let{currentCoordinates:a}=r;switch(t.code){case ht.Right:return{...a,x:a.x+25};case ht.Left:return{...a,x:a.x-25};case ht.Down:return{...a,y:a.y+25};case ht.Up:return{...a,y:a.y-25}}};class wN{constructor(r){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=r;const{event:{target:a}}=r;this.props=r,this.listeners=new os(lo(a)),this.windowListeners=new os(xn(a)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(sr.Resize,this.handleCancel),this.windowListeners.add(sr.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(sr.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:r,onStart:a}=this.props,l=r.node.current;l&&xN(l),a(Nr)}handleKeyDown(r){if(ev(r)){const{active:a,context:l,options:s}=this.props,{keyboardCodes:c=SN,coordinateGetter:u=hL,scrollBehavior:d="smooth"}=s,{code:m}=r;if(c.end.includes(m)){this.handleEnd(r);return}if(c.cancel.includes(m)){this.handleCancel(r);return}const{collisionRect:v}=l.current,b=v?{x:v.left,y:v.top}:Nr;this.referenceCoordinates||(this.referenceCoordinates=b);const y=u(r,{active:a,context:l.current,currentCoordinates:b});if(y){const w=Vu(y,b),C={x:0,y:0},{scrollableAncestors:E}=l.current;for(const S of E){const R=r.code,{isTop:M,isRight:O,isLeft:_,isBottom:z,maxScroll:k,minScroll:I}=yN(S),N=oL(S),T={x:Math.min(R===ht.Right?N.right-N.width/2:N.right,Math.max(R===ht.Right?N.left:N.left+N.width/2,y.x)),y:Math.min(R===ht.Down?N.bottom-N.height/2:N.bottom,Math.max(R===ht.Down?N.top:N.top+N.height/2,y.y))},A=R===ht.Right&&!O||R===ht.Left&&!_,q=R===ht.Down&&!z||R===ht.Up&&!M;if(A&&T.x!==y.x){const K=S.scrollLeft+w.x,W=R===ht.Right&&K<=k.x||R===ht.Left&&K>=I.x;if(W&&!w.y){S.scrollTo({left:K,behavior:d});return}W?C.x=S.scrollLeft-K:C.x=R===ht.Right?S.scrollLeft-k.x:S.scrollLeft-I.x,C.x&&S.scrollBy({left:-C.x,behavior:d});break}else if(q&&T.y!==y.y){const K=S.scrollTop+w.y,W=R===ht.Down&&K<=k.y||R===ht.Up&&K>=I.y;if(W&&!w.x){S.scrollTo({top:K,behavior:d});return}W?C.y=S.scrollTop-K:C.y=R===ht.Down?S.scrollTop-k.y:S.scrollTop-I.y,C.y&&S.scrollBy({top:-C.y,behavior:d});break}}this.handleMove(r,Vl(Vu(y,this.referenceCoordinates),C))}}}handleMove(r,a){const{onMove:l}=this.props;r.preventDefault(),l(a)}handleEnd(r){const{onEnd:a}=this.props;r.preventDefault(),this.detach(),a()}handleCancel(r){const{onCancel:a}=this.props;r.preventDefault(),this.detach(),a()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}wN.activators=[{eventName:"onKeyDown",handler:(t,r,a)=>{let{keyboardCodes:l=SN,onActivation:s}=r,{active:c}=a;const{code:u}=t.nativeEvent;if(l.start.includes(u)){const d=c.activatorNode.current;return d&&t.target!==d?!1:(t.preventDefault(),s?.({event:t.nativeEvent}),!0)}return!1}}];function Mx(t){return!!(t&&"distance"in t)}function Ox(t){return!!(t&&"delay"in t)}class rv{constructor(r,a,l){var s;l===void 0&&(l=dL(r.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=r,this.events=a;const{event:c}=r,{target:u}=c;this.props=r,this.events=a,this.document=lo(u),this.documentListeners=new os(this.document),this.listeners=new os(l),this.windowListeners=new os(xn(u)),this.initialCoordinates=(s=Fu(c))!=null?s:Nr,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:r,props:{options:{activationConstraint:a,bypassActivationConstraint:l}}}=this;if(this.listeners.add(r.move.name,this.handleMove,{passive:!1}),this.listeners.add(r.end.name,this.handleEnd),r.cancel&&this.listeners.add(r.cancel.name,this.handleCancel),this.windowListeners.add(sr.Resize,this.handleCancel),this.windowListeners.add(sr.DragStart,Rx),this.windowListeners.add(sr.VisibilityChange,this.handleCancel),this.windowListeners.add(sr.ContextMenu,Rx),this.documentListeners.add(sr.Keydown,this.handleKeydown),a){if(l!=null&&l({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Ox(a)){this.timeoutId=setTimeout(this.handleStart,a.delay),this.handlePending(a);return}if(Mx(a)){this.handlePending(a);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(r,a){const{active:l,onPending:s}=this.props;s(l,r,this.initialCoordinates,a)}handleStart(){const{initialCoordinates:r}=this,{onStart:a}=this.props;r&&(this.activated=!0,this.documentListeners.add(sr.Click,fL,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(sr.SelectionChange,this.removeTextSelection),a(r))}handleMove(r){var a;const{activated:l,initialCoordinates:s,props:c}=this,{onMove:u,options:{activationConstraint:d}}=c;if(!s)return;const m=(a=Fu(r))!=null?a:Nr,v=Vu(s,m);if(!l&&d){if(Mx(d)){if(d.tolerance!=null&&ym(v,d.tolerance))return this.handleCancel();if(ym(v,d.distance))return this.handleStart()}if(Ox(d)&&ym(v,d.tolerance))return this.handleCancel();this.handlePending(d,v);return}r.cancelable&&r.preventDefault(),u(m)}handleEnd(){const{onAbort:r,onEnd:a}=this.props;this.detach(),this.activated||r(this.props.active),a()}handleCancel(){const{onAbort:r,onCancel:a}=this.props;this.detach(),this.activated||r(this.props.active),a()}handleKeydown(r){r.code===ht.Esc&&this.handleCancel()}removeTextSelection(){var r;(r=this.document.getSelection())==null||r.removeAllRanges()}}const mL={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class av extends rv{constructor(r){const{event:a}=r,l=lo(a.target);super(r,mL,l)}}av.activators=[{eventName:"onPointerDown",handler:(t,r)=>{let{nativeEvent:a}=t,{onActivation:l}=r;return!a.isPrimary||a.button!==0?!1:(l?.({event:a}),!0)}}];const pL={move:{name:"mousemove"},end:{name:"mouseup"}};var Jm;(function(t){t[t.RightClick=2]="RightClick"})(Jm||(Jm={}));class vL extends rv{constructor(r){super(r,pL,lo(r.event.target))}}vL.activators=[{eventName:"onMouseDown",handler:(t,r)=>{let{nativeEvent:a}=t,{onActivation:l}=r;return a.button===Jm.RightClick?!1:(l?.({event:a}),!0)}}];const bm={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class gL extends rv{constructor(r){super(r,bm)}static setup(){return window.addEventListener(bm.move.name,r,{capture:!1,passive:!1}),function(){window.removeEventListener(bm.move.name,r)};function r(){}}}gL.activators=[{eventName:"onTouchStart",handler:(t,r)=>{let{nativeEvent:a}=t,{onActivation:l}=r;const{touches:s}=a;return s.length>1?!1:(l?.({event:a}),!0)}}];var ss;(function(t){t[t.Pointer=0]="Pointer",t[t.DraggableRect=1]="DraggableRect"})(ss||(ss={}));var Yu;(function(t){t[t.TreeOrder=0]="TreeOrder",t[t.ReversedTreeOrder=1]="ReversedTreeOrder"})(Yu||(Yu={}));function yL(t){let{acceleration:r,activator:a=ss.Pointer,canScroll:l,draggingRect:s,enabled:c,interval:u=5,order:d=Yu.TreeOrder,pointerCoordinates:m,scrollableAncestors:v,scrollableAncestorRects:b,delta:y,threshold:w}=t;const C=xL({delta:y,disabled:!c}),[E,S]=Tz(),R=g.useRef({x:0,y:0}),M=g.useRef({x:0,y:0}),O=g.useMemo(()=>{switch(a){case ss.Pointer:return m?{top:m.y,bottom:m.y,left:m.x,right:m.x}:null;case ss.DraggableRect:return s}},[a,s,m]),_=g.useRef(null),z=g.useCallback(()=>{const I=_.current;if(!I)return;const N=R.current.x*M.current.x,T=R.current.y*M.current.y;I.scrollBy(N,T)},[]),k=g.useMemo(()=>d===Yu.TreeOrder?[...v].reverse():v,[d,v]);g.useEffect(()=>{if(!c||!v.length||!O){S();return}for(const I of k){if(l?.(I)===!1)continue;const N=v.indexOf(I),T=b[N];if(!T)continue;const{direction:A,speed:q}=lL(I,T,O,r,w);for(const K of["x","y"])C[K][A[K]]||(q[K]=0,A[K]=0);if(q.x>0||q.y>0){S(),_.current=I,E(z,u),R.current=q,M.current=A;return}}R.current={x:0,y:0},M.current={x:0,y:0},S()},[r,z,l,S,c,u,JSON.stringify(O),JSON.stringify(C),E,v,k,b,JSON.stringify(w)])}const bL={x:{[en.Backward]:!1,[en.Forward]:!1},y:{[en.Backward]:!1,[en.Forward]:!1}};function xL(t){let{delta:r,disabled:a}=t;const l=Qu(r);return Qs(s=>{if(a||!l||!s)return bL;const c={x:Math.sign(r.x-l.x),y:Math.sign(r.y-l.y)};return{x:{[en.Backward]:s.x[en.Backward]||c.x===-1,[en.Forward]:s.x[en.Forward]||c.x===1},y:{[en.Backward]:s.y[en.Backward]||c.y===-1,[en.Forward]:s.y[en.Forward]||c.y===1}}},[a,r,l])}function SL(t,r){const a=r!=null?t.get(r):void 0,l=a?a.node.current:null;return Qs(s=>{var c;return r==null?null:(c=l??s)!=null?c:null},[l,r])}function wL(t,r){return g.useMemo(()=>t.reduce((a,l)=>{const{sensor:s}=l,c=s.activators.map(u=>({eventName:u.eventName,handler:r(u.handler,l)}));return[...a,...c]},[]),[t,r])}var ws;(function(t){t[t.Always=0]="Always",t[t.BeforeDragging=1]="BeforeDragging",t[t.WhileDragging=2]="WhileDragging"})(ws||(ws={}));var Wm;(function(t){t.Optimized="optimized"})(Wm||(Wm={}));const Dx=new Map;function CL(t,r){let{dragging:a,dependencies:l,config:s}=r;const[c,u]=g.useState(null),{frequency:d,measure:m,strategy:v}=s,b=g.useRef(t),y=R(),w=Ss(y),C=g.useCallback(function(M){M===void 0&&(M=[]),!w.current&&u(O=>O===null?M:O.concat(M.filter(_=>!O.includes(_))))},[w]),E=g.useRef(null),S=Qs(M=>{if(y&&!a)return Dx;if(!M||M===Dx||b.current!==t||c!=null){const O=new Map;for(let _ of t){if(!_)continue;if(c&&c.length>0&&!c.includes(_.id)&&_.rect.current){O.set(_.id,_.rect.current);continue}const z=_.node.current,k=z?new nv(m(z),z):null;_.rect.current=k,k&&O.set(_.id,k)}return O}return M},[t,c,a,y,m]);return g.useEffect(()=>{b.current=t},[t]),g.useEffect(()=>{y||C()},[a,y]),g.useEffect(()=>{c&&c.length>0&&u(null)},[JSON.stringify(c)]),g.useEffect(()=>{y||typeof d!="number"||E.current!==null||(E.current=setTimeout(()=>{C(),E.current=null},d))},[d,y,C,...l]),{droppableRects:S,measureDroppableContainers:C,measuringScheduled:c!=null};function R(){switch(v){case ws.Always:return!1;case ws.BeforeDragging:return a;default:return!a}}}function iv(t,r){return Qs(a=>t?a||(typeof r=="function"?r(t):t):null,[r,t])}function NL(t,r){return iv(t,r)}function EL(t){let{callback:r,disabled:a}=t;const l=_d(r),s=g.useMemo(()=>{if(a||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:c}=window;return new c(l)},[l,a]);return g.useEffect(()=>()=>s?.disconnect(),[s]),s}function zd(t){let{callback:r,disabled:a}=t;const l=_d(r),s=g.useMemo(()=>{if(a||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:c}=window;return new c(l)},[a]);return g.useEffect(()=>()=>s?.disconnect(),[s]),s}function jL(t){return new nv(Vs(t),t)}function Tx(t,r,a){r===void 0&&(r=jL);const[l,s]=g.useState(null);function c(){s(m=>{if(!t)return null;if(t.isConnected===!1){var v;return(v=m??a)!=null?v:null}const b=r(t);return JSON.stringify(m)===JSON.stringify(b)?m:b})}const u=EL({callback(m){if(t)for(const v of m){const{type:b,target:y}=v;if(b==="childList"&&y instanceof HTMLElement&&y.contains(t)){c();break}}}}),d=zd({callback:c});return ba(()=>{c(),t?(d?.observe(t),u?.observe(document.body,{childList:!0,subtree:!0})):(d?.disconnect(),u?.disconnect())},[t]),l}function RL(t){const r=iv(t);return fN(t,r)}const _x=[];function ML(t){const r=g.useRef(t),a=Qs(l=>t?l&&l!==_x&&t&&r.current&&t.parentNode===r.current.parentNode?l:tv(t):_x,[t]);return g.useEffect(()=>{r.current=t},[t]),a}function OL(t){const[r,a]=g.useState(null),l=g.useRef(t),s=g.useCallback(c=>{const u=gm(c.target);u&&a(d=>d?(d.set(u,Zm(u)),new Map(d)):null)},[]);return g.useEffect(()=>{const c=l.current;if(t!==c){u(c);const d=t.map(m=>{const v=gm(m);return v?(v.addEventListener("scroll",s,{passive:!0}),[v,Zm(v)]):null}).filter(m=>m!=null);a(d.length?new Map(d):null),l.current=t}return()=>{u(t),u(c)};function u(d){d.forEach(m=>{const v=gm(m);v?.removeEventListener("scroll",s)})}},[s,t]),g.useMemo(()=>t.length?r?Array.from(r.values()).reduce((c,u)=>Vl(c,u),Nr):bN(t):Nr,[t,r])}function Ax(t,r){r===void 0&&(r=[]);const a=g.useRef(null);return g.useEffect(()=>{a.current=null},r),g.useEffect(()=>{const l=t!==Nr;l&&!a.current&&(a.current=t),!l&&a.current&&(a.current=null)},[t]),a.current?Vu(t,a.current):Nr}function DL(t){g.useEffect(()=>{if(!Td)return;const r=t.map(a=>{let{sensor:l}=a;return l.setup==null?void 0:l.setup()});return()=>{for(const a of r)a?.()}},t.map(r=>{let{sensor:a}=r;return a}))}function TL(t,r){return g.useMemo(()=>t.reduce((a,l)=>{let{eventName:s,handler:c}=l;return a[s]=u=>{c(u,r)},a},{}),[t,r])}function CN(t){return g.useMemo(()=>t?nL(t):null,[t])}const zx=[];function _L(t,r){r===void 0&&(r=Vs);const[a]=t,l=CN(a?xn(a):null),[s,c]=g.useState(zx);function u(){c(()=>t.length?t.map(m=>gN(m)?l:new nv(r(m),m)):zx)}const d=zd({callback:u});return ba(()=>{d?.disconnect(),u(),t.forEach(m=>d?.observe(m))},[t]),s}function NN(t){if(!t)return null;if(t.children.length>1)return t;const r=t.children[0];return Is(r)?r:t}function AL(t){let{measure:r}=t;const[a,l]=g.useState(null),s=g.useCallback(v=>{for(const{target:b}of v)if(Is(b)){l(y=>{const w=r(b);return y?{...y,width:w.width,height:w.height}:w});break}},[r]),c=zd({callback:s}),u=g.useCallback(v=>{const b=NN(v);c?.disconnect(),b&&c?.observe(b),l(b?r(b):null)},[r,c]),[d,m]=Iu(u);return g.useMemo(()=>({nodeRef:d,rect:a,setRef:m}),[a,d,m])}const zL=[{sensor:av,options:{}},{sensor:wN,options:{}}],LL={current:{}},wu={draggable:{measure:jx},droppable:{measure:jx,strategy:ws.WhileDragging,frequency:Wm.Optimized},dragOverlay:{measure:Vs}};class cs extends Map{get(r){var a;return r!=null&&(a=super.get(r))!=null?a:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(r=>{let{disabled:a}=r;return!a})}getNodeFor(r){var a,l;return(a=(l=this.get(r))==null?void 0:l.node.current)!=null?a:void 0}}const kL={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new cs,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Gu},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:wu,measureDroppableContainers:Gu,windowRect:null,measuringScheduled:!1},EN={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Gu,draggableNodes:new Map,over:null,measureDroppableContainers:Gu},Fs=g.createContext(EN),jN=g.createContext(kL);function PL(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new cs}}}function UL(t,r){switch(r.type){case Xt.DragStart:return{...t,draggable:{...t.draggable,initialCoordinates:r.initialCoordinates,active:r.active}};case Xt.DragMove:return t.draggable.active==null?t:{...t,draggable:{...t.draggable,translate:{x:r.coordinates.x-t.draggable.initialCoordinates.x,y:r.coordinates.y-t.draggable.initialCoordinates.y}}};case Xt.DragEnd:case Xt.DragCancel:return{...t,draggable:{...t.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Xt.RegisterDroppable:{const{element:a}=r,{id:l}=a,s=new cs(t.droppable.containers);return s.set(l,a),{...t,droppable:{...t.droppable,containers:s}}}case Xt.SetDroppableDisabled:{const{id:a,key:l,disabled:s}=r,c=t.droppable.containers.get(a);if(!c||l!==c.key)return t;const u=new cs(t.droppable.containers);return u.set(a,{...c,disabled:s}),{...t,droppable:{...t.droppable,containers:u}}}case Xt.UnregisterDroppable:{const{id:a,key:l}=r,s=t.droppable.containers.get(a);if(!s||l!==s.key)return t;const c=new cs(t.droppable.containers);return c.delete(a),{...t,droppable:{...t.droppable,containers:c}}}default:return t}}function BL(t){let{disabled:r}=t;const{active:a,activatorEvent:l,draggableNodes:s}=g.useContext(Fs),c=Qu(l),u=Qu(a?.id);return g.useEffect(()=>{if(!r&&!l&&c&&u!=null){if(!ev(c)||document.activeElement===c.target)return;const d=s.get(u);if(!d)return;const{activatorNode:m,node:v}=d;if(!m.current&&!v.current)return;requestAnimationFrame(()=>{for(const b of[m.current,v.current]){if(!b)continue;const y=zz(b);if(y){y.focus();break}}})}},[l,r,s,u,c]),null}function RN(t,r){let{transform:a,...l}=r;return t!=null&&t.length?t.reduce((s,c)=>c({transform:s,...l}),a):a}function HL(t){return g.useMemo(()=>({draggable:{...wu.draggable,...t?.draggable},droppable:{...wu.droppable,...t?.droppable},dragOverlay:{...wu.dragOverlay,...t?.dragOverlay}}),[t?.draggable,t?.droppable,t?.dragOverlay])}function qL(t){let{activeNode:r,measure:a,initialRect:l,config:s=!0}=t;const c=g.useRef(!1),{x:u,y:d}=typeof s=="boolean"?{x:s,y:s}:s;ba(()=>{if(!u&&!d||!r){c.current=!1;return}if(c.current||!l)return;const v=r?.node.current;if(!v||v.isConnected===!1)return;const b=a(v),y=fN(b,l);if(u||(y.x=0),d||(y.y=0),c.current=!0,Math.abs(y.x)>0||Math.abs(y.y)>0){const w=mN(v);w&&w.scrollBy({top:y.y,left:y.x})}},[r,u,d,l,a])}const Ld=g.createContext({...Nr,scaleX:1,scaleY:1});var Wa;(function(t){t[t.Uninitialized=0]="Uninitialized",t[t.Initializing=1]="Initializing",t[t.Initialized=2]="Initialized"})(Wa||(Wa={}));const IL=g.memo(function(r){var a,l,s,c;let{id:u,accessibility:d,autoScroll:m=!0,children:v,sensors:b=zL,collisionDetection:y=$z,measuring:w,modifiers:C,...E}=r;const S=g.useReducer(UL,void 0,PL),[R,M]=S,[O,_]=Hz(),[z,k]=g.useState(Wa.Uninitialized),I=z===Wa.Initialized,{draggable:{active:N,nodes:T,translate:A},droppable:{containers:q}}=R,K=N!=null?T.get(N):null,W=g.useRef({initial:null,translated:null}),ue=g.useMemo(()=>{var gt;return N!=null?{id:N,data:(gt=K?.data)!=null?gt:LL,rect:W}:null},[N,K]),le=g.useRef(null),[de,L]=g.useState(null),[G,B]=g.useState(null),ee=Ss(E,Object.values(E)),ie=Ad("DndDescribedBy",u),D=g.useMemo(()=>q.getEnabled(),[q]),Q=HL(w),{droppableRects:J,measureDroppableContainers:ne,measuringScheduled:fe}=CL(D,{dragging:I,dependencies:[A.x,A.y],config:Q.droppable}),me=SL(T,N),re=g.useMemo(()=>G?Fu(G):null,[G]),De=Dr(),Ae=NL(me,Q.draggable.measure);qL({activeNode:N!=null?T.get(N):null,config:De.layoutShiftCompensation,initialRect:Ae,measure:Q.draggable.measure});const Te=Tx(me,Q.draggable.measure,Ae),Ue=Tx(me?me.parentElement:null),he=g.useRef({activatorEvent:null,active:null,activeNode:me,collisionRect:null,collisions:null,droppableRects:J,draggableNodes:T,draggingNode:null,draggingNodeRect:null,droppableContainers:q,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),dt=q.getNodeFor((a=he.current.over)==null?void 0:a.id),pt=AL({measure:Q.dragOverlay.measure}),Sn=(l=pt.nodeRef.current)!=null?l:me,jt=I?(s=pt.rect)!=null?s:Te:null,Rr=!!(pt.nodeRef.current&&pt.rect),fi=RL(Rr?null:Te),Mr=CN(Sn?xn(Sn):null),wn=ML(I?dt??me:null),Or=_L(wn),Ca=RN(C,{transform:{x:A.x-fi.x,y:A.y-fi.y,scaleX:1,scaleY:1},activatorEvent:G,active:ue,activeNodeRect:Te,containerNodeRect:Ue,draggingNodeRect:jt,over:he.current.over,overlayNodeRect:pt.rect,scrollableAncestors:wn,scrollableAncestorRects:Or,windowRect:Mr}),tl=re?Vl(re,A):null,wt=OL(wn),Fr=Ax(wt),hi=Ax(wt,[Te]),Ln=Vl(Ca,Fr),Ut=jt?Wz(jt,Ca):null,tn=ue&&Ut?y({active:ue,collisionRect:Ut,droppableRects:J,droppableContainers:D,pointerCoordinates:tl}):null,Na=Kz(tn,"id"),[mn,nl]=g.useState(null),cn=Rr?Ca:Vl(Ca,hi),Jt=Zz(cn,(c=mn?.rect)!=null?c:null,Te),pn=g.useRef(null),Vt=g.useCallback((gt,Et)=>{let{sensor:Tt,options:un}=Et;if(le.current==null)return;const nn=T.get(le.current);if(!nn)return;const _t=gt.nativeEvent,Ft=new Tt({active:le.current,activeNode:nn,event:_t,options:un,context:he,onAbort(At){if(!T.get(At))return;const{onDragAbort:V}=ee.current,$={id:At};V?.($),O({type:"onDragAbort",event:$})},onPending(At,U,V,$){if(!T.get(At))return;const{onDragPending:pe}=ee.current,Se={id:At,constraint:U,initialCoordinates:V,offset:$};pe?.(Se),O({type:"onDragPending",event:Se})},onStart(At){const U=le.current;if(U==null)return;const V=T.get(U);if(!V)return;const{onDragStart:$}=ee.current,ce={activatorEvent:_t,active:{id:U,data:V.data,rect:W}};Sr.unstable_batchedUpdates(()=>{$?.(ce),k(Wa.Initializing),M({type:Xt.DragStart,initialCoordinates:At,active:U}),O({type:"onDragStart",event:ce}),L(pn.current),B(_t)})},onMove(At){M({type:Xt.DragMove,coordinates:At})},onEnd:Cn(Xt.DragEnd),onCancel:Cn(Xt.DragCancel)});pn.current=Ft;function Cn(At){return async function(){const{active:V,collisions:$,over:ce,scrollAdjustedTranslate:pe}=he.current;let Se=null;if(V&&pe){const{cancelDrop:Me}=ee.current;Se={activatorEvent:_t,active:V,collisions:$,delta:pe,over:ce},At===Xt.DragEnd&&typeof Me=="function"&&await Promise.resolve(Me(Se))&&(At=Xt.DragCancel)}le.current=null,Sr.unstable_batchedUpdates(()=>{M({type:At}),k(Wa.Uninitialized),nl(null),L(null),B(null),pn.current=null;const Me=At===Xt.DragEnd?"onDragEnd":"onDragCancel";if(Se){const be=ee.current[Me];be?.(Se),O({type:Me,event:Se})}})}}},[T]),oo=g.useCallback((gt,Et)=>(Tt,un)=>{const nn=Tt.nativeEvent,_t=T.get(un);if(le.current!==null||!_t||nn.dndKit||nn.defaultPrevented)return;const Ft={active:_t};gt(Tt,Et.options,Ft)===!0&&(nn.dndKit={capturedBy:Et.sensor},le.current=un,Vt(Tt,Et))},[T,Vt]),mi=wL(b,oo);DL(b),ba(()=>{Te&&z===Wa.Initializing&&k(Wa.Initialized)},[Te,z]),g.useEffect(()=>{const{onDragMove:gt}=ee.current,{active:Et,activatorEvent:Tt,collisions:un,over:nn}=he.current;if(!Et||!Tt)return;const _t={active:Et,activatorEvent:Tt,collisions:un,delta:{x:Ln.x,y:Ln.y},over:nn};Sr.unstable_batchedUpdates(()=>{gt?.(_t),O({type:"onDragMove",event:_t})})},[Ln.x,Ln.y]),g.useEffect(()=>{const{active:gt,activatorEvent:Et,collisions:Tt,droppableContainers:un,scrollAdjustedTranslate:nn}=he.current;if(!gt||le.current==null||!Et||!nn)return;const{onDragOver:_t}=ee.current,Ft=un.get(Na),Cn=Ft&&Ft.rect.current?{id:Ft.id,rect:Ft.rect.current,data:Ft.data,disabled:Ft.disabled}:null,At={active:gt,activatorEvent:Et,collisions:Tt,delta:{x:nn.x,y:nn.y},over:Cn};Sr.unstable_batchedUpdates(()=>{nl(Cn),_t?.(At),O({type:"onDragOver",event:At})})},[Na]),ba(()=>{he.current={activatorEvent:G,active:ue,activeNode:me,collisionRect:Ut,collisions:tn,droppableRects:J,draggableNodes:T,draggingNode:Sn,draggingNodeRect:jt,droppableContainers:q,over:mn,scrollableAncestors:wn,scrollAdjustedTranslate:Ln},W.current={initial:jt,translated:Ut}},[ue,me,tn,Ut,T,Sn,jt,J,q,mn,wn,Ln]),yL({...De,delta:A,draggingRect:Ut,pointerCoordinates:tl,scrollableAncestors:wn,scrollableAncestorRects:Or});const Ea=g.useMemo(()=>({active:ue,activeNode:me,activeNodeRect:Te,activatorEvent:G,collisions:tn,containerNodeRect:Ue,dragOverlay:pt,draggableNodes:T,droppableContainers:q,droppableRects:J,over:mn,measureDroppableContainers:ne,scrollableAncestors:wn,scrollableAncestorRects:Or,measuringConfiguration:Q,measuringScheduled:fe,windowRect:Mr}),[ue,me,Te,G,tn,Ue,pt,T,q,J,mn,ne,wn,Or,Q,fe,Mr]),Gr=g.useMemo(()=>({activatorEvent:G,activators:mi,active:ue,activeNodeRect:Te,ariaDescribedById:{draggable:ie},dispatch:M,draggableNodes:T,over:mn,measureDroppableContainers:ne}),[G,mi,ue,Te,M,ie,T,mn,ne]);return ot.createElement(dN.Provider,{value:_},ot.createElement(Fs.Provider,{value:Gr},ot.createElement(jN.Provider,{value:Ea},ot.createElement(Ld.Provider,{value:Jt},v)),ot.createElement(BL,{disabled:d?.restoreFocus===!1})),ot.createElement(Qz,{...d,hiddenTextDescribedById:ie}));function Dr(){const gt=de?.autoScrollEnabled===!1,Et=typeof m=="object"?m.enabled===!1:m===!1,Tt=I&&!gt&&!Et;return typeof m=="object"?{...m,enabled:Tt}:{enabled:Tt}}}),QL=g.createContext(null),Lx="button",VL="Draggable";function FL(t){let{id:r,data:a,disabled:l=!1,attributes:s}=t;const c=Ad(VL),{activators:u,activatorEvent:d,active:m,activeNodeRect:v,ariaDescribedById:b,draggableNodes:y,over:w}=g.useContext(Fs),{role:C=Lx,roleDescription:E="draggable",tabIndex:S=0}=s??{},R=m?.id===r,M=g.useContext(R?Ld:QL),[O,_]=Iu(),[z,k]=Iu(),I=TL(u,r),N=Ss(a);ba(()=>(y.set(r,{id:r,key:c,node:O,activatorNode:z,data:N}),()=>{const A=y.get(r);A&&A.key===c&&y.delete(r)}),[y,r]);const T=g.useMemo(()=>({role:C,tabIndex:S,"aria-disabled":l,"aria-pressed":R&&C===Lx?!0:void 0,"aria-roledescription":E,"aria-describedby":b.draggable}),[l,C,S,R,E,b.draggable]);return{active:m,activatorEvent:d,activeNodeRect:v,attributes:T,isDragging:R,listeners:l?void 0:I,node:O,over:w,setNodeRef:_,setActivatorNodeRef:k,transform:M}}function GL(){return g.useContext(jN)}const YL="Droppable",KL={timeout:25};function XL(t){let{data:r,disabled:a=!1,id:l,resizeObserverConfig:s}=t;const c=Ad(YL),{active:u,dispatch:d,over:m,measureDroppableContainers:v}=g.useContext(Fs),b=g.useRef({disabled:a}),y=g.useRef(!1),w=g.useRef(null),C=g.useRef(null),{disabled:E,updateMeasurementsFor:S,timeout:R}={...KL,...s},M=Ss(S??l),O=g.useCallback(()=>{if(!y.current){y.current=!0;return}C.current!=null&&clearTimeout(C.current),C.current=setTimeout(()=>{v(Array.isArray(M.current)?M.current:[M.current]),C.current=null},R)},[R]),_=zd({callback:O,disabled:E||!u}),z=g.useCallback((T,A)=>{_&&(A&&(_.unobserve(A),y.current=!1),T&&_.observe(T))},[_]),[k,I]=Iu(z),N=Ss(r);return g.useEffect(()=>{!_||!k.current||(_.disconnect(),y.current=!1,_.observe(k.current))},[k,_]),g.useEffect(()=>(d({type:Xt.RegisterDroppable,element:{id:l,key:c,disabled:a,node:k,rect:w,data:N}}),()=>d({type:Xt.UnregisterDroppable,key:c,id:l})),[l]),g.useEffect(()=>{a!==b.current.disabled&&(d({type:Xt.SetDroppableDisabled,id:l,key:c,disabled:a}),b.current.disabled=a)},[l,c,a,d]),{active:u,rect:w,isOver:m?.id===l,node:k,over:m,setNodeRef:I}}function $L(t){let{animation:r,children:a}=t;const[l,s]=g.useState(null),[c,u]=g.useState(null),d=Qu(a);return!a&&!l&&d&&s(d),ba(()=>{if(!c)return;const m=l?.key,v=l?.props.id;if(m==null||v==null){s(null);return}Promise.resolve(r(v,c)).then(()=>{s(null)})},[r,l,c]),ot.createElement(ot.Fragment,null,a,l?g.cloneElement(l,{ref:u}):null)}const ZL={x:0,y:0,scaleX:1,scaleY:1};function JL(t){let{children:r}=t;return ot.createElement(Fs.Provider,{value:EN},ot.createElement(Ld.Provider,{value:ZL},r))}const WL={position:"fixed",touchAction:"none"},ek=t=>ev(t)?"transform 250ms ease":void 0,tk=g.forwardRef((t,r)=>{let{as:a,activatorEvent:l,adjustScale:s,children:c,className:u,rect:d,style:m,transform:v,transition:b=ek}=t;if(!d)return null;const y=s?v:{...v,scaleX:1,scaleY:1},w={...WL,width:d.width,height:d.height,top:d.top,left:d.left,transform:Zl.Transform.toString(y),transformOrigin:s&&l?Gz(l,d):void 0,transition:typeof b=="function"?b(l):b,...m};return ot.createElement(a,{className:u,style:w,ref:r},c)}),nk=t=>r=>{let{active:a,dragOverlay:l}=r;const s={},{styles:c,className:u}=t;if(c!=null&&c.active)for(const[d,m]of Object.entries(c.active))m!==void 0&&(s[d]=a.node.style.getPropertyValue(d),a.node.style.setProperty(d,m));if(c!=null&&c.dragOverlay)for(const[d,m]of Object.entries(c.dragOverlay))m!==void 0&&l.node.style.setProperty(d,m);return u!=null&&u.active&&a.node.classList.add(u.active),u!=null&&u.dragOverlay&&l.node.classList.add(u.dragOverlay),function(){for(const[m,v]of Object.entries(s))a.node.style.setProperty(m,v);u!=null&&u.active&&a.node.classList.remove(u.active)}},rk=t=>{let{transform:{initial:r,final:a}}=t;return[{transform:Zl.Transform.toString(r)},{transform:Zl.Transform.toString(a)}]},ak={duration:250,easing:"ease",keyframes:rk,sideEffects:nk({styles:{active:{opacity:"0"}}})};function ik(t){let{config:r,draggableNodes:a,droppableContainers:l,measuringConfiguration:s}=t;return _d((c,u)=>{if(r===null)return;const d=a.get(c);if(!d)return;const m=d.node.current;if(!m)return;const v=NN(u);if(!v)return;const{transform:b}=xn(u).getComputedStyle(u),y=hN(b);if(!y)return;const w=typeof r=="function"?r:lk(r);return xN(m,s.draggable.measure),w({active:{id:c,data:d.data,node:m,rect:s.draggable.measure(m)},draggableNodes:a,dragOverlay:{node:u,rect:s.dragOverlay.measure(v)},droppableContainers:l,measuringConfiguration:s,transform:y})})}function lk(t){const{duration:r,easing:a,sideEffects:l,keyframes:s}={...ak,...t};return c=>{let{active:u,dragOverlay:d,transform:m,...v}=c;if(!r)return;const b={x:d.rect.left-u.rect.left,y:d.rect.top-u.rect.top},y={scaleX:m.scaleX!==1?u.rect.width*m.scaleX/d.rect.width:1,scaleY:m.scaleY!==1?u.rect.height*m.scaleY/d.rect.height:1},w={x:m.x-b.x,y:m.y-b.y,...y},C=s({...v,active:u,dragOverlay:d,transform:{initial:m,final:w}}),[E]=C,S=C[C.length-1];if(JSON.stringify(E)===JSON.stringify(S))return;const R=l?.({active:u,dragOverlay:d,...v}),M=d.node.animate(C,{duration:r,easing:a,fill:"forwards"});return new Promise(O=>{M.onfinish=()=>{R?.(),O()}})}}let kx=0;function ok(t){return g.useMemo(()=>{if(t!=null)return kx++,kx},[t])}const sk=ot.memo(t=>{let{adjustScale:r=!1,children:a,dropAnimation:l,style:s,transition:c,modifiers:u,wrapperElement:d="div",className:m,zIndex:v=999}=t;const{activatorEvent:b,active:y,activeNodeRect:w,containerNodeRect:C,draggableNodes:E,droppableContainers:S,dragOverlay:R,over:M,measuringConfiguration:O,scrollableAncestors:_,scrollableAncestorRects:z,windowRect:k}=GL(),I=g.useContext(Ld),N=ok(y?.id),T=RN(u,{activatorEvent:b,active:y,activeNodeRect:w,containerNodeRect:C,draggingNodeRect:R.rect,over:M,overlayNodeRect:R.rect,scrollableAncestors:_,scrollableAncestorRects:z,transform:I,windowRect:k}),A=iv(w),q=ik({config:l,draggableNodes:E,droppableContainers:S,measuringConfiguration:O}),K=A?R.setRef:void 0;return ot.createElement(JL,null,ot.createElement($L,{animation:q},y&&N?ot.createElement(tk,{key:N,id:y.id,ref:K,as:d,activatorEvent:b,adjustScale:r,className:m,transition:c,rect:A,style:{zIndex:v,...s},transform:T},a):null))}),Px=["New","Demo scheduled","Contract signed","Lost"];function ck({phase:t,deals:r,onDealClick:a,onContactClick:l}){const{setNodeRef:s,isOver:c}=XL({id:t}),u=ao[t],d=u.icon;return h.jsxs("div",{ref:s,className:ye("flex flex-col w-[280px] flex-shrink-0 rounded-xl border bg-muted/30 transition-colors",c&&"ring-2 ring-primary/50 bg-primary/5"),children:[h.jsxs("div",{className:ye("flex items-center gap-2 p-3 border-b",u.bgColor),children:[h.jsx("div",{className:ye("p-1.5 rounded-lg",u.bgColor),children:h.jsx(d,{className:ye("h-4 w-4",u.color)})}),h.jsx("span",{className:"font-semibold text-sm",children:u.label}),h.jsx("span",{className:"ml-auto text-xs text-muted-foreground bg-background/50 px-2 py-0.5 rounded-full",children:r.length})]}),h.jsx("div",{className:"flex-1 p-2 space-y-2 overflow-y-auto min-h-[200px] max-h-[calc(100vh-300px)]",children:r.length===0?h.jsx("div",{className:"flex items-center justify-center h-24 text-muted-foreground text-sm opacity-50",children:"Drop deals here"}):r.map(m=>h.jsx(uk,{deal:m,onDealClick:a,onContactClick:l},m.id))})]})}function uk({deal:t,onDealClick:r,onContactClick:a}){const{attributes:l,listeners:s,setNodeRef:c,transform:u,isDragging:d}=FL({id:t.id,data:{deal:t}}),m={transform:Zl.Translate.toString(u),opacity:d?.5:1};return h.jsx("div",{ref:c,style:m,children:h.jsx(MN,{deal:t,onDealClick:r,onContactClick:a,isDragging:d,dragHandleProps:{...l,...s}})})}function MN({deal:t,onDealClick:r,onContactClick:a,isDragging:l,dragHandleProps:s}){const c=js(),u=t.mainContact?.[0],d=v=>[v.firstName,v.lastName].filter(Boolean).join(" ")||"Unknown",m=v=>v?new Date(v).toLocaleDateString("en-US",{month:"short",day:"numeric"}):"";return h.jsx("div",{className:ye("bg-background rounded-lg border shadow-sm p-3 cursor-pointer hover:shadow-md hover:border-primary/30 transition-all group",l&&"shadow-lg ring-2 ring-primary/30"),onClick:()=>t.id&&r(t.id),children:h.jsxs("div",{className:"flex items-start gap-2",children:[h.jsx("div",{...s,className:"opacity-0 group-hover:opacity-100 transition-opacity cursor-grab active:cursor-grabbing mt-0.5 -ml-1",onClick:v=>v.stopPropagation(),children:h.jsx(hO,{className:"h-4 w-4 text-muted-foreground"})}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsxs("div",{className:"flex items-center justify-between gap-2",children:[h.jsx("h4",{className:"font-medium text-sm truncate",children:t.name||"Untitled Deal"}),h.jsx("button",{onClick:v=>{v.stopPropagation(),t.id&&c(`/deals/${t.id}`)},className:"opacity-0 group-hover:opacity-100 transition-opacity p-1 rounded hover:bg-muted",title:"View deal details",children:h.jsx(lO,{className:"h-3.5 w-3.5 text-muted-foreground"})})]}),u?.id&&h.jsxs("button",{onClick:v=>{v.stopPropagation(),a(v,u.id)},className:"inline-flex items-center gap-1 mt-2 px-2 py-0.5 rounded bg-blue-500/10 text-blue-600 hover:bg-blue-500/20 transition-colors text-xs",children:[h.jsx(zn,{className:"h-3 w-3"}),h.jsx("span",{className:"truncate max-w-[120px]",children:d(u)})]}),t.createdAt&&h.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:m(t.createdAt)})]})]})})}function dk({deal:t,onDealClick:r,onContactClick:a}){return h.jsx("div",{className:"w-[280px]",children:h.jsx(MN,{deal:t,onDealClick:r,onContactClick:a,isDragging:!0})})}function fk({deals:t,onDealClick:r,onContactClick:a,onPhaseChange:l}){const[s,c]=g.useState(null),[u,d]=g.useState({}),m=Fz(Vz(av,{activationConstraint:{distance:8}})),v=g.useMemo(()=>t.map(C=>C.id&&u[C.id]?{...C,phase:u[C.id]}:C),[t,u]);g.useMemo(()=>{const C={};for(const[E,S]of Object.entries(u)){const R=Number(E),M=t.find(O=>O.id===R);M&&M.phase!==S&&(C[R]=S)}Object.keys(C).length!==Object.keys(u).length&&d(C)},[t,u]);const b=g.useMemo(()=>{const C={};return Px.forEach(E=>{C[E]=[]}),v.forEach(E=>{const S=E.phase||"New";C[S]?C[S].push(E):C.New.push(E)}),C},[v]),y=C=>{const{active:E}=C,S=v.find(R=>R.id===E.id);S&&c(S)},w=C=>{const{active:E,over:S}=C;if(c(null),!S)return;const R=E.id,M=S.id,O=v.find(_=>_.id===R);O&&O.phase!==M&&(d(_=>({..._,[R]:M})),l(R,M))};return h.jsxs(IL,{sensors:m,onDragStart:y,onDragEnd:w,children:[h.jsx("div",{className:"inline-flex gap-4 pb-4 h-full",children:Px.map(C=>h.jsx(ck,{phase:C,deals:b[C]||[],onDealClick:r,onContactClick:a},C))}),h.jsx(sk,{children:s?h.jsx(dk,{deal:s,onDealClick:r,onContactClick:a}):null})]})}function hk(){const t=js(),a=!!Sa().state?.openCreate,[l,s]=g.useState("kanban"),[c,u]=g.useState(a),[d,m]=g.useState(null),[v,b]=g.useState(!1),[y,w]=g.useState(null);g.useLayoutEffect(()=>{a&&window.history.replaceState({},document.title)},[a]);const{data:C,isLoading:E,refetch:S}=$e.deals.getAll.useQuery(),R=$e.deals.update.useMutation({onSuccess:()=>{S()}}),M=C,O=A=>A?new Date(A).toLocaleDateString():"-",_=A=>{m(A),u(!0)},z=()=>{m(null),u(!0)},k=(A,q)=>{A.stopPropagation(),w(q),b(!0)},I=()=>{S()},N=(A,q)=>{R.mutate({id:A,phase:q})},T=A=>[A.firstName,A.lastName].filter(Boolean).join(" ")||"Unknown";return h.jsxs("div",{className:"p-6 h-full flex flex-col gap-6 min-w-0",children:[h.jsxs("div",{className:"flex items-center justify-between flex-shrink-0 flex-wrap gap-4 min-w-0",children:[h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("div",{className:"p-2.5 rounded-xl bg-gradient-to-br from-primary/20 to-primary/5 border border-primary/20",children:h.jsx(ni,{className:"h-6 w-6 text-primary"})}),h.jsxs("div",{children:[h.jsx("h1",{className:"text-2xl font-bold",children:"Deals"}),h.jsx("p",{className:"text-sm text-muted-foreground",children:"Manage your deal pipeline"})]})]}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsxs("div",{className:"flex items-center rounded-lg border bg-muted/30 p-1",children:[h.jsxs("button",{onClick:()=>s("kanban"),className:ye("flex items-center gap-1.5 px-3 py-1.5 rounded-md text-sm font-medium transition-colors",l==="kanban"?"bg-background shadow-sm text-foreground":"text-muted-foreground hover:text-foreground"),children:[h.jsx(vO,{className:"h-4 w-4"}),"Kanban"]}),h.jsxs("button",{onClick:()=>s("table"),className:ye("flex items-center gap-1.5 px-3 py-1.5 rounded-md text-sm font-medium transition-colors",l==="table"?"bg-background shadow-sm text-foreground":"text-muted-foreground hover:text-foreground"),children:[h.jsx(qO,{className:"h-4 w-4"}),"Table"]})]}),h.jsxs(Ge,{onClick:z,children:[h.jsx($i,{className:"h-4 w-4 mr-2"}),"New Deal"]})]})]}),E?h.jsx("div",{className:"flex items-center justify-center py-12 flex-1",children:h.jsx(Yn,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):l==="kanban"?M&&M.length>0?h.jsx("div",{className:"flex-1 min-h-0 min-w-0 overflow-x-auto overflow-y-hidden",children:h.jsx(fk,{deals:M,onDealClick:_,onContactClick:k,onPhaseChange:N})}):h.jsxs("div",{className:"text-center py-12 text-muted-foreground flex-1",children:[h.jsx(ni,{className:"h-12 w-12 mx-auto mb-4 opacity-20"}),h.jsx("p",{children:"No deals yet."}),h.jsx(Ge,{variant:"link",onClick:z,className:"mt-2",children:"Create your first deal"})]}):h.jsxs(cr,{children:[h.jsxs(ur,{className:"pb-4",children:[h.jsx(dr,{className:"text-lg",children:"All Deals"}),h.jsxs(no,{children:[M?.length??0," ",M?.length===1?"deal":"deals"]})]}),h.jsx(fr,{children:M&&M.length>0?h.jsx("div",{className:"rounded-lg border",children:h.jsxs(Us,{children:[h.jsx(Bs,{children:h.jsxs(ya,{children:[h.jsx($t,{children:"Name"}),h.jsx($t,{children:"Phase"}),h.jsx($t,{children:"Contact"}),h.jsx($t,{children:"Created"}),h.jsx($t,{className:"w-[80px]"})]})}),h.jsx(Hs,{children:M.map(A=>{const q=A.mainContact?.[0];return h.jsxs(ya,{className:"cursor-pointer hover:bg-muted/50 transition-colors",onClick:()=>A.id&&_(A.id),children:[h.jsx(Zt,{className:"font-medium",children:A.name||"-"}),h.jsx(Zt,{children:A.phase?h.jsx(Mz,{phase:A.phase}):h.jsx("span",{className:"text-muted-foreground",children:"-"})}),h.jsx(Zt,{children:q?.id?h.jsxs("button",{onClick:K=>k(K,q.id),className:"inline-flex items-center gap-1.5 px-2 py-1 rounded-md bg-blue-500/10 text-blue-600 hover:bg-blue-500/20 transition-colors text-sm",children:[h.jsx(zn,{className:"h-3.5 w-3.5"}),h.jsx("span",{children:T(q)})]}):h.jsx("span",{className:"text-muted-foreground",children:"-"})}),h.jsx(Zt,{className:"text-muted-foreground",children:O(A.createdAt)}),h.jsx(Zt,{children:h.jsx(Ge,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:K=>{K.stopPropagation(),A.id&&t(`/deals/${A.id}`)},children:h.jsx(_S,{className:"h-4 w-4"})})})]},A.id)})})]})}):h.jsxs("div",{className:"text-center py-12 text-muted-foreground",children:[h.jsx(ni,{className:"h-12 w-12 mx-auto mb-4 opacity-20"}),h.jsx("p",{children:"No deals yet."}),h.jsx(Ge,{variant:"link",onClick:z,className:"mt-2",children:"Create your first deal"})]})})]}),h.jsx(Dz,{open:c,onOpenChange:u,dealId:d,onSuccess:I}),h.jsx($p,{open:v,onOpenChange:b,contactId:y,onSuccess:I})]})}const mk=Ts("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function lv({className:t,variant:r,...a}){return h.jsx("div",{className:ye(mk({variant:r}),t),...a})}var kd="Tabs",[pk]=si(kd,[od]),ON=od(),[vk,ov]=pk(kd),DN=g.forwardRef((t,r)=>{const{__scopeTabs:a,value:l,onValueChange:s,defaultValue:c,orientation:u="horizontal",dir:d,activationMode:m="automatic",...v}=t,b=Ju(d),[y,w]=Gl({prop:l,onChange:s,defaultProp:c??"",caller:kd});return h.jsx(vk,{scope:a,baseId:Br(),value:y,onValueChange:w,orientation:u,dir:b,activationMode:m,children:h.jsx(Ie.div,{dir:b,"data-orientation":u,...v,ref:r})})});DN.displayName=kd;var TN="TabsList",_N=g.forwardRef((t,r)=>{const{__scopeTabs:a,loop:l=!0,...s}=t,c=ov(TN,a),u=ON(a);return h.jsx(Dw,{asChild:!0,...u,orientation:c.orientation,dir:c.dir,loop:l,children:h.jsx(Ie.div,{role:"tablist","aria-orientation":c.orientation,...s,ref:r})})});_N.displayName=TN;var AN="TabsTrigger",zN=g.forwardRef((t,r)=>{const{__scopeTabs:a,value:l,disabled:s=!1,...c}=t,u=ov(AN,a),d=ON(a),m=PN(u.baseId,l),v=UN(u.baseId,l),b=l===u.value;return h.jsx(Tw,{asChild:!0,...d,focusable:!s,active:b,children:h.jsx(Ie.button,{type:"button",role:"tab","aria-selected":b,"aria-controls":v,"data-state":b?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:m,...c,ref:r,onMouseDown:Re(t.onMouseDown,y=>{!s&&y.button===0&&y.ctrlKey===!1?u.onValueChange(l):y.preventDefault()}),onKeyDown:Re(t.onKeyDown,y=>{[" ","Enter"].includes(y.key)&&u.onValueChange(l)}),onFocus:Re(t.onFocus,()=>{const y=u.activationMode!=="manual";!b&&!s&&y&&u.onValueChange(l)})})})});zN.displayName=AN;var LN="TabsContent",kN=g.forwardRef((t,r)=>{const{__scopeTabs:a,value:l,forceMount:s,children:c,...u}=t,d=ov(LN,a),m=PN(d.baseId,l),v=UN(d.baseId,l),b=l===d.value,y=g.useRef(b);return g.useEffect(()=>{const w=requestAnimationFrame(()=>y.current=!1);return()=>cancelAnimationFrame(w)},[]),h.jsx(wa,{present:s||b,children:({present:w})=>h.jsx(Ie.div,{"data-state":b?"active":"inactive","data-orientation":d.orientation,role:"tabpanel","aria-labelledby":m,hidden:!w,id:v,tabIndex:0,...u,ref:r,style:{...t.style,animationDuration:y.current?"0s":void 0},children:w&&c})})});kN.displayName=LN;function PN(t,r){return`${t}-trigger-${r}`}function UN(t,r){return`${t}-content-${r}`}var gk=DN,BN=_N,HN=zN,qN=kN;const yk=gk,IN=g.forwardRef(({className:t,...r},a)=>h.jsx(BN,{ref:a,className:ye("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",t),...r}));IN.displayName=BN.displayName;const ep=g.forwardRef(({className:t,...r},a)=>h.jsx(HN,{ref:a,className:ye("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",t),...r}));ep.displayName=HN.displayName;const tp=g.forwardRef(({className:t,...r},a)=>h.jsx(qN,{ref:a,className:ye("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",t),...r}));tp.displayName=qN.displayName;function bk(t){return[t.firstName,t.lastName].filter(Boolean).join(" ")||"Unknown"}function np(t){return t?new Date(t).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}):"-"}function xk(t){return t?new Date(t).toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"}):"-"}function Ux(t){if(!t)return"";const r=new Date(t),a=new Date,l=r.getTime()-a.getTime(),s=Math.ceil(l/(1e3*60*60*24));return s===0?"Today":s===1?"Tomorrow":s===-1?"Yesterday":s>0&&s<=7?`In ${s} days`:s<0&&s>=-7?`${Math.abs(s)} days ago`:np(t)}function QN(t,r){return!t||r?!1:new Date(t)<new Date}function Bx({activity:t,onComplete:r,onUncomplete:a,onEdit:l,onDelete:s,onAddNote:c,isCompleting:u,expanded:d,onToggleExpand:m}){const v=!!t.doneAt,b=QN(t.plannedAt,t.doneAt),y=t.notes&&t.notes.length>0,w=Nk(t.type),C=t.type?Ck[t.type]:"";return h.jsx("div",{className:ye("group border rounded-lg transition-all",v?"bg-muted/30 border-muted":b?"bg-red-50/50 border-red-200 dark:bg-red-950/20 dark:border-red-800":"bg-background hover:border-primary/30"),children:h.jsx("div",{className:"p-4",children:h.jsxs("div",{className:"flex items-start gap-3",children:[h.jsx("button",{onClick:()=>t.id&&(v?a(t.id):r(t.id)),disabled:u,className:ye("mt-0.5 flex-shrink-0 transition-colors",v?"text-green-500 hover:text-green-600":b?"text-red-400 hover:text-red-500":"text-muted-foreground hover:text-primary"),children:u?h.jsx(Yn,{className:"h-5 w-5 animate-spin"}):v?h.jsx(ps,{className:"h-5 w-5"}):h.jsx(gp,{className:"h-5 w-5"})}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsxs("div",{className:"flex items-start justify-between gap-2",children:[h.jsxs("div",{className:"flex-1",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("p",{className:ye("font-medium",v&&"line-through text-muted-foreground"),children:t.name||"Untitled Activity"}),t.type&&h.jsxs("span",{className:ye("inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium border",C),children:[h.jsx(w,{className:"h-3 w-3"}),t.type]})]}),h.jsxs("div",{className:"flex items-center gap-3 mt-1",children:[t.plannedAt&&h.jsxs("span",{className:ye("text-sm flex items-center gap-1",v?"text-muted-foreground":b?"text-red-500 font-medium":"text-muted-foreground"),children:[h.jsx(Os,{className:"h-3.5 w-3.5"}),Ux(t.plannedAt)]}),v&&t.doneAt&&h.jsxs("span",{className:"text-sm text-green-600 flex items-center gap-1",children:[h.jsx(ps,{className:"h-3.5 w-3.5"}),"Completed ",Ux(t.doneAt)]})]})]}),h.jsxs("div",{className:"flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[h.jsx(Ge,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:()=>t.id&&c(t.id),children:h.jsx(PO,{className:"h-4 w-4"})}),h.jsxs(Hm,{children:[h.jsx(qm,{asChild:!0,children:h.jsx(Ge,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",children:h.jsx(rO,{className:"h-4 w-4"})})}),h.jsxs(Uu,{align:"end",children:[h.jsxs(xs,{onClick:()=>l(t),children:[h.jsx(MO,{className:"h-4 w-4 mr-2"}),"Edit"]}),h.jsxs(xs,{className:"text-destructive",onClick:()=>t.id&&s(t.id),children:[h.jsx(AS,{className:"h-4 w-4 mr-2"}),"Delete"]})]})]})]})]}),y&&h.jsxs("div",{className:"mt-3",children:[h.jsxs("button",{onClick:m,className:"flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground transition-colors",children:[d?h.jsx($u,{className:"h-4 w-4"}):h.jsx(TS,{className:"h-4 w-4"}),h.jsx(xO,{className:"h-3.5 w-3.5"}),t.notes?.length," note",t.notes?.length!==1&&"s"]}),d&&h.jsx("div",{className:"mt-2 space-y-2 pl-5 border-l-2 border-muted",children:t.notes?.map(E=>h.jsxs("div",{className:"p-2 bg-muted/50 rounded text-sm",children:[h.jsx("p",{children:E.name}),h.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:xk(E.createdAt)})]},E.id))})]})]})]})})})}function Sk({contact:t,onViewContact:r}){const a=t.company?.[0];return h.jsxs(cr,{children:[h.jsx(ur,{className:"pb-3",children:h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("div",{className:"p-2 rounded-lg bg-blue-500/10",children:h.jsx(zn,{className:"h-4 w-4 text-blue-500"})}),h.jsx(dr,{className:"text-base",children:"Contact"})]}),r&&h.jsx(Ge,{variant:"ghost",size:"sm",onClick:r,children:"View"})]})}),h.jsxs(fr,{className:"space-y-4",children:[h.jsxs("div",{children:[h.jsx("p",{className:"font-semibold text-lg",children:bk(t)}),a&&h.jsxs("p",{className:"text-sm text-muted-foreground flex items-center gap-1.5 mt-0.5",children:[h.jsx(ma,{className:"h-3.5 w-3.5"}),a.name]})]}),h.jsxs("div",{className:"space-y-2",children:[t.mail&&h.jsxs("a",{href:`mailto:${t.mail}`,className:"flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground transition-colors",children:[h.jsx(bp,{className:"h-4 w-4"}),t.mail]}),t.phone1&&h.jsxs("a",{href:`tel:${t.phone1}`,className:"flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground transition-colors",children:[h.jsx(pa,{className:"h-4 w-4"}),t.phone1]}),t.phone2&&h.jsxs("a",{href:`tel:${t.phone2}`,className:"flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground transition-colors",children:[h.jsx(pa,{className:"h-4 w-4"}),t.phone2]})]}),t.notes&&h.jsxs("div",{className:"pt-2 border-t",children:[h.jsx("p",{className:"text-xs text-muted-foreground mb-1",children:"Notes"}),h.jsx("p",{className:"text-sm",children:t.notes})]})]})]})}function wk({company:t,onViewCompany:r}){return h.jsxs(cr,{children:[h.jsx(ur,{className:"pb-3",children:h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("div",{className:"p-2 rounded-lg bg-purple-500/10",children:h.jsx(ma,{className:"h-4 w-4 text-purple-500"})}),h.jsx(dr,{className:"text-base",children:"Company"})]}),r&&h.jsx(Ge,{variant:"ghost",size:"sm",onClick:r,children:"View"})]})}),h.jsxs(fr,{className:"space-y-3",children:[h.jsx("p",{className:"font-semibold text-lg",children:t.name}),t.website&&h.jsxs("a",{href:t.website.startsWith("http")?t.website:`https://${t.website}`,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground transition-colors",children:[h.jsx(yp,{className:"h-4 w-4"}),t.website]}),t.notes&&h.jsxs("div",{className:"pt-2 border-t",children:[h.jsx("p",{className:"text-xs text-muted-foreground mb-1",children:"Notes"}),h.jsx("p",{className:"text-sm",children:t.notes})]})]})]})}const VN=[{value:"Call",label:"Call",icon:pa},{value:"Meeting",label:"Meeting",icon:zn},{value:"Task",label:"Task",icon:Ui},{value:"Demo",label:"Demo",icon:Zu}],Ck={Call:"bg-blue-500/10 text-blue-600 border-blue-500/20",Meeting:"bg-purple-500/10 text-purple-600 border-purple-500/20",Task:"bg-amber-500/10 text-amber-600 border-amber-500/20",Demo:"bg-emerald-500/10 text-emerald-600 border-emerald-500/20"};function Nk(t){return VN.find(a=>a.value===t)?.icon||Ui}function Ek({open:t,onOpenChange:r,activity:a,dealId:l,onSuccess:s}){const c=!a,[u,d]=g.useState(""),[m,v]=g.useState(""),[b,y]=g.useState(""),[w,C]=g.useState(!1);t&&!w&&(a?(d(a.name||""),v(a.type||""),y(a.plannedAt?a.plannedAt.split("T")[0]:"")):(d(""),v(""),y("")),C(!0)),!t&&w&&C(!1);const E=z=>{r(z)},S=$e.activities.create.useMutation({onSuccess:()=>{s(),r(!1)}}),R=$e.activities.update.useMutation({onSuccess:()=>{s(),r(!1)}}),M=()=>{c?u.trim()&&m&&S.mutate({name:u,type:m,deal:[l],plannedAt:b||void 0}):a?.id&&R.mutate({id:a.id,name:u,type:m||void 0,plannedAt:b||void 0})},O=S.isPending||R.isPending,_=c?u.trim()&&m:u.trim();return h.jsx(Kp,{open:t,onOpenChange:E,children:h.jsxs(wd,{children:[h.jsxs(Cd,{children:[h.jsx(Ed,{children:c?"New Activity":"Edit Activity"}),h.jsx(jd,{children:c?"Create a new activity for this deal":"Update the activity details"})]}),h.jsxs("div",{className:"space-y-4 py-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(kt,{htmlFor:"activity-name",children:"Activity Name *"}),h.jsx(An,{id:"activity-name",value:u,onChange:z=>d(z.target.value),placeholder:"e.g., Follow-up call, Send proposal..."})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(kt,{htmlFor:"activity-type",children:"Type *"}),h.jsxs(Xl,{value:m,onValueChange:z=>v(z),children:[h.jsx(Yi,{id:"activity-type",children:h.jsx($l,{placeholder:"Select activity type..."})}),h.jsx(Ki,{children:VN.map(z=>{const k=z.icon;return h.jsx(_n,{value:z.value,children:h.jsxs("span",{className:"flex items-center gap-2",children:[h.jsx(k,{className:"h-4 w-4"}),z.label]})},z.value)})})]})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(kt,{htmlFor:"planned-at",children:"Planned Date"}),h.jsx(An,{id:"planned-at",type:"date",value:b,onChange:z=>y(z.target.value)})]})]}),h.jsxs(Nd,{children:[h.jsx(Ge,{variant:"outline",onClick:()=>r(!1),children:"Cancel"}),h.jsxs(Ge,{onClick:M,disabled:O||!_,children:[O&&h.jsx(Yn,{className:"h-4 w-4 animate-spin mr-2"}),c?"Create":"Save"]})]})]})})}function jk({open:t,onOpenChange:r,activityId:a,onSuccess:l}){const[s,c]=g.useState(""),u=$e.notes.create.useMutation({onSuccess:()=>{c(""),l(),r(!1)}}),d=()=>{a&&s.trim()&&u.mutate({name:s,activities1:[a]})};return h.jsx(Kp,{open:t,onOpenChange:r,children:h.jsxs(wd,{children:[h.jsxs(Cd,{children:[h.jsx(Ed,{children:"Add Note"}),h.jsx(jd,{children:"Add a note to this activity"})]}),h.jsx("div",{className:"py-4",children:h.jsx(gd,{value:s,onChange:m=>c(m.target.value),placeholder:"Write your note here...",className:"min-h-[120px]"})}),h.jsxs(Nd,{children:[h.jsx(Ge,{variant:"outline",onClick:()=>r(!1),children:"Cancel"}),h.jsxs(Ge,{onClick:d,disabled:u.isPending||!s.trim(),children:[u.isPending&&h.jsx(Yn,{className:"h-4 w-4 animate-spin mr-2"}),"Add Note"]})]})]})})}function Rk({phase:t}){const r=ao[t];if(!r)return h.jsx(lv,{variant:"outline",children:t});const a=r.icon;return h.jsxs("div",{className:ye("inline-flex items-center gap-2 px-3 py-1.5 rounded-full",r.bgColor),children:[h.jsx(a,{className:ye("h-4 w-4",r.color)}),h.jsx("span",{className:ye("font-medium",r.color),children:r.label})]})}function Mk(){const{id:t}=cR(),r=js(),a=t?parseInt(t,10):null,[l,s]=g.useState(!1),[c,u]=g.useState(null),[d,m]=g.useState(!1),[v,b]=g.useState(null),[y,w]=g.useState(new Set),[C,E]=g.useState(null),[S,R]=g.useState(!1),{data:M,isLoading:O,refetch:_}=$e.deals.getDetails.useQuery({id:a},{enabled:!!a}),z=M,k=$e.activities.complete.useMutation({onSuccess:()=>{E(null),_()}}),I=$e.activities.uncomplete.useMutation({onSuccess:()=>{E(null),_()}}),N=$e.activities.delete.useMutation({onSuccess:()=>_()}),T=$e.deals.update.useMutation({onSuccess:()=>{R(!1),_()}}),A=ie=>{E(ie),k.mutate({id:ie})},q=ie=>{E(ie),I.mutate({id:ie})},K=ie=>{confirm("Are you sure you want to delete this activity?")&&N.mutate({id:ie})},W=ie=>{u(ie),s(!0)},ue=ie=>{b(ie),m(!0)},le=ie=>{w(D=>{const Q=new Set(D);return Q.has(ie)?Q.delete(ie):Q.add(ie),Q})},de=ie=>{a&&T.mutate({id:a,phase:ie})},L=z?.activities?.filter(ie=>!ie.doneAt)||[],G=z?.activities?.filter(ie=>ie.doneAt)||[],B=z?.mainContact?.[0],ee=B?.company?.[0];return a?O?h.jsx("div",{className:"container mx-auto p-6 max-w-7xl",children:h.jsx("div",{className:"flex items-center justify-center py-20",children:h.jsx(Yn,{className:"h-8 w-8 animate-spin text-muted-foreground"})})}):z?h.jsxs("div",{className:"container mx-auto p-6 max-w-7xl space-y-6",children:[h.jsxs("div",{className:"flex items-start justify-between gap-4",children:[h.jsxs("div",{className:"flex items-start gap-4",children:[h.jsx(Ge,{variant:"ghost",size:"icon",onClick:()=>r("/deals"),className:"mt-1",children:h.jsx(kM,{className:"h-5 w-5"})}),h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("div",{className:"p-2.5 rounded-xl bg-gradient-to-br from-primary/20 to-primary/5 border border-primary/20",children:h.jsx(ni,{className:"h-6 w-6 text-primary"})}),h.jsx("h1",{className:"text-2xl font-bold",children:z.name})]})]}),h.jsxs("div",{className:"flex items-center gap-4",children:[S?h.jsxs(Xl,{value:z.phase||"New",onValueChange:ie=>{de(ie)},children:[h.jsx(Yi,{className:"w-[200px]",children:h.jsx($l,{})}),h.jsx(Ki,{children:sN.map(ie=>{const D=ao[ie],Q=D.icon;return h.jsx(_n,{value:ie,children:h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(Q,{className:ye("h-4 w-4",D.color)}),h.jsx("span",{children:D.label})]})},ie)})})]}):h.jsx("button",{onClick:()=>R(!0),className:"hover:opacity-80 transition-opacity",children:h.jsx(Rk,{phase:z.phase||"New"})}),h.jsxs("span",{className:"text-sm text-muted-foreground",children:["Created ",np(z.createdAt)]})]})]}),h.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[h.jsxs("div",{className:"lg:col-span-2 space-y-6",children:[h.jsxs(cr,{children:[h.jsxs(ur,{children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(HM,{className:"h-5 w-5 text-primary"}),h.jsx(dr,{className:"text-lg",children:"Activities"}),h.jsxs(lv,{variant:"secondary",className:"ml-2",children:[L.length," pending"]})]}),h.jsxs(Ge,{onClick:()=>{u(null),s(!0)},size:"sm",children:[h.jsx($i,{className:"h-4 w-4 mr-2"}),"Add Activity"]})]}),h.jsx(no,{children:"Manage tasks and follow-ups for this deal"})]}),h.jsx(fr,{children:h.jsxs(yk,{defaultValue:"pending",className:"w-full",children:[h.jsxs(IN,{className:"mb-4",children:[h.jsxs(ep,{value:"pending",className:"gap-2",children:[h.jsx(WM,{className:"h-4 w-4"}),"Pending (",L.length,")"]}),h.jsxs(ep,{value:"completed",className:"gap-2",children:[h.jsx(ps,{className:"h-4 w-4"}),"Completed (",G.length,")"]})]}),h.jsx(tp,{value:"pending",className:"space-y-3",children:L.length===0?h.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[h.jsx(Os,{className:"h-12 w-12 mx-auto mb-3 opacity-20"}),h.jsx("p",{children:"No pending activities"}),h.jsx(Ge,{variant:"link",onClick:()=>{u(null),s(!0)},className:"mt-2",children:"Create your first activity"})]}):L.map(ie=>h.jsx(Bx,{activity:ie,onComplete:A,onUncomplete:q,onEdit:W,onDelete:K,onAddNote:ue,isCompleting:C===ie.id,expanded:y.has(ie.id||0),onToggleExpand:()=>ie.id&&le(ie.id)},ie.id))}),h.jsx(tp,{value:"completed",className:"space-y-3",children:G.length===0?h.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[h.jsx(ps,{className:"h-12 w-12 mx-auto mb-3 opacity-20"}),h.jsx("p",{children:"No completed activities yet"})]}):G.map(ie=>h.jsx(Bx,{activity:ie,onComplete:A,onUncomplete:q,onEdit:W,onDelete:K,onAddNote:ue,isCompleting:C===ie.id,expanded:y.has(ie.id||0),onToggleExpand:()=>ie.id&&le(ie.id)},ie.id))})]})})]}),z.notes&&h.jsxs(cr,{children:[h.jsx(ur,{className:"pb-3",children:h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(uO,{className:"h-5 w-5 text-primary"}),h.jsx(dr,{className:"text-lg",children:"Deal Notes"})]})}),h.jsx(fr,{children:h.jsx("p",{className:"text-sm whitespace-pre-wrap",children:z.notes})})]})]}),h.jsxs("div",{className:"space-y-6",children:[B?h.jsx(Sk,{contact:B}):h.jsxs(cr,{children:[h.jsx(ur,{className:"pb-3",children:h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("div",{className:"p-2 rounded-lg bg-blue-500/10",children:h.jsx(zn,{className:"h-4 w-4 text-blue-500"})}),h.jsx(dr,{className:"text-base",children:"Contact"})]})}),h.jsx(fr,{children:h.jsx("p",{className:"text-sm text-muted-foreground",children:"No contact assigned to this deal"})})]}),ee?h.jsx(wk,{company:ee}):B?h.jsxs(cr,{children:[h.jsx(ur,{className:"pb-3",children:h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("div",{className:"p-2 rounded-lg bg-purple-500/10",children:h.jsx(ma,{className:"h-4 w-4 text-purple-500"})}),h.jsx(dr,{className:"text-base",children:"Company"})]})}),h.jsx(fr,{children:h.jsx("p",{className:"text-sm text-muted-foreground",children:"No company linked to this contact"})})]}):null,h.jsxs(cr,{children:[h.jsx(ur,{className:"pb-3",children:h.jsx(dr,{className:"text-base",children:"Summary"})}),h.jsxs(fr,{className:"space-y-3",children:[h.jsxs("div",{className:"flex items-center justify-between text-sm",children:[h.jsx("span",{className:"text-muted-foreground",children:"Total Activities"}),h.jsx("span",{className:"font-medium",children:z.activities?.length||0})]}),h.jsxs("div",{className:"flex items-center justify-between text-sm",children:[h.jsx("span",{className:"text-muted-foreground",children:"Pending"}),h.jsx("span",{className:"font-medium text-amber-600",children:L.length})]}),h.jsxs("div",{className:"flex items-center justify-between text-sm",children:[h.jsx("span",{className:"text-muted-foreground",children:"Completed"}),h.jsx("span",{className:"font-medium text-green-600",children:G.length})]}),h.jsxs("div",{className:"flex items-center justify-between text-sm",children:[h.jsx("span",{className:"text-muted-foreground",children:"Overdue"}),h.jsx("span",{className:"font-medium text-red-600",children:L.filter(ie=>QN(ie.plannedAt,ie.doneAt)).length})]}),h.jsx("div",{className:"pt-3 border-t",children:h.jsxs("div",{className:"flex items-center justify-between text-sm",children:[h.jsx("span",{className:"text-muted-foreground",children:"Last Updated"}),h.jsx("span",{children:np(z.updatedAt)})]})})]})]})]})]}),h.jsx(Ek,{open:l,onOpenChange:s,activity:c,dealId:a,onSuccess:_}),h.jsx(jk,{open:d,onOpenChange:m,activityId:v,onSuccess:_})]}):h.jsxs("div",{className:"container mx-auto p-6 max-w-7xl",children:[h.jsx("p",{className:"text-muted-foreground",children:"Deal not found"}),h.jsx(Ge,{variant:"link",onClick:()=>r("/deals"),className:"mt-2",children:"Back to Deals"})]}):h.jsx("div",{className:"container mx-auto p-6 max-w-7xl",children:h.jsx("p",{className:"text-muted-foreground",children:"Invalid deal ID"})})}const Ok=[{value:"Call",label:"Call",icon:pa},{value:"Meeting",label:"Meeting",icon:zn},{value:"Task",label:"Task",icon:Ui},{value:"Demo",label:"Demo",icon:Zu}];function Dk({open:t,onOpenChange:r,activityId:a,dealId:l,onSuccess:s,layer:c=0}){const u=!a,[d,m]=g.useState(""),{data:v,isLoading:b}=$e.activities.getById.useQuery({id:a},{enabled:!!a&&t}),{data:y,isLoading:w}=$e.deals.search.useQuery({query:d,limit:5},{enabled:t}),C=()=>{if(u){if(l){const J=y?.find(ne=>ne.id===l);if(J?.id&&J?.name)return{id:J.id,name:J.name}}return null}if(!v?.deal?.[0])return null;const Q=v.deal[0];return!Q.id||!Q.name?null:{id:Q.id,name:Q.name}},E=u?"":v?.name||"",S=u?void 0:v?.type,R=u?"":v?.plannedAt?Tk(v.plannedAt):"",M=C(),[O,_]=g.useState(""),[z,k]=g.useState(void 0),[I,N]=g.useState(""),[T,A]=g.useState(null),[q,K]=g.useState(!1);t&&!b&&!q&&(_(E),k(S),N(R),A(M),K(!0)),!t&&q&&K(!1);const W=u?T!==null:T?.id!==M?.id,ue=u?O.trim().length>0||z!==void 0||I!==""||T!==null:O!==E||z!==S||I!==R||W,le=u?O.trim().length>0&&z!==void 0:ue,de=$e.activities.create.useMutation({onSuccess:()=>{s?.(),r(!1)}}),L=$e.activities.update.useMutation({onSuccess:()=>{s?.(),r(!1)}}),G=$e.activities.delete.useMutation({onSuccess:()=>{s?.(),r(!1)}}),B=()=>{u?O.trim()&&z&&de.mutate({name:O,type:z,plannedAt:I?new Date(I).toISOString():void 0,deal:T?[T.id]:void 0}):a&&ue&&L.mutate({id:a,name:O||void 0,type:z,plannedAt:I?new Date(I).toISOString():void 0})},ee=()=>{a&&G.mutate({id:a})},ie=de.isPending||L.isPending,D=(y||[]).filter(Q=>Q.id!==void 0&&Q.name!==void 0).map(Q=>({id:Q.id,name:Q.name}));return h.jsxs(Rd,{open:t,onOpenChange:r,title:u?"New Activity":"Activity Details",description:u?"Create a new activity":"View and edit activity information",icon:h.jsx(ms,{className:"h-5 w-5 text-primary"}),isCreateMode:u,isLoading:b,hasChanges:le,isPending:ie,isDeletePending:G.isPending,onSave:B,onDelete:u?void 0:ee,layer:c,footer:!u&&v?h.jsx("div",{className:"pt-4 border-t",children:h.jsxs("p",{className:"text-xs text-muted-foreground",children:["Created: ",v.createdAt?new Date(v.createdAt).toLocaleDateString():"-",v.updatedAt&&h.jsxs(h.Fragment,{children:[" | Updated: ",new Date(v.updatedAt).toLocaleDateString()]})]})}):void 0,children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(kt,{htmlFor:"name",children:"Activity Name *"}),h.jsx(An,{id:"name",value:O,onChange:Q=>_(Q.target.value),placeholder:"e.g., Follow-up call with client"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(kt,{htmlFor:"type",children:"Type *"}),h.jsxs(Xl,{value:z,onValueChange:Q=>k(Q),children:[h.jsx(Yi,{id:"type",children:h.jsx($l,{placeholder:"Select activity type..."})}),h.jsx(Ki,{children:Ok.map(Q=>{const J=Q.icon;return h.jsx(_n,{value:Q.value,children:h.jsxs("span",{className:"flex items-center gap-2",children:[h.jsx(J,{className:"h-4 w-4"}),Q.label]})},Q.value)})})]})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(kt,{htmlFor:"plannedAt",children:"Planned Date & Time"}),h.jsxs("div",{className:"relative",children:[h.jsx(Os,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),h.jsx(An,{id:"plannedAt",type:"datetime-local",value:I,onChange:Q=>N(Q.target.value),className:"pl-10"})]})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(kt,{children:"Related Deal"}),h.jsx(Xp,{value:T,onChange:A,onSearch:m,onCreateNew:()=>{},options:D,isLoading:w,placeholder:"Select a deal...",icon:ni,entityName:"Deal",disabled:!u}),!u&&h.jsx("p",{className:"text-xs text-muted-foreground",children:"Deal association cannot be changed after creation"})]})]})}function Tk(t){const r=new Date(t),a=r.getFullYear(),l=String(r.getMonth()+1).padStart(2,"0"),s=String(r.getDate()).padStart(2,"0"),c=String(r.getHours()).padStart(2,"0"),u=String(r.getMinutes()).padStart(2,"0");return`${a}-${l}-${s}T${c}:${u}`}const Hx={Call:pa,Meeting:zn,Task:Ui,Demo:Zu},qx={Call:"bg-blue-500/10 text-blue-600 border-blue-500/20",Meeting:"bg-purple-500/10 text-purple-600 border-purple-500/20",Task:"bg-amber-500/10 text-amber-600 border-amber-500/20",Demo:"bg-emerald-500/10 text-emerald-600 border-emerald-500/20"};function _k(){const r=!!Sa().state?.openCreate,[a,l]=g.useState(r),[s,c]=g.useState(null),[u,d]=g.useState("all"),[m,v]=g.useState("all"),[b,y]=g.useState(null);g.useLayoutEffect(()=>{r&&window.history.replaceState({},document.title)},[r]);const{data:w,isLoading:C,refetch:E}=$e.activities.getAll.useQuery({dateFilter:u,typeFilter:m}),S=$e.activities.complete.useMutation({onSuccess:()=>{E(),y(null)},onError:()=>y(null)}),R=$e.activities.uncomplete.useMutation({onSuccess:()=>{E(),y(null)},onError:()=>y(null)}),M=A=>A?new Date(A).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}):"-",O=A=>A?new Date(A).toLocaleString("en-US",{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"}):"-",_=A=>{c(A),l(!0)},z=()=>{c(null),l(!0)},k=()=>{E()},I=(A,q,K)=>{A.stopPropagation(),y(q),K?R.mutate({id:q}):S.mutate({id:q})},N=A=>A&&A in Hx?Hx[A]:Ui,T=A=>A&&A in qx?qx[A]:"bg-muted text-muted-foreground border-muted";return h.jsxs("div",{className:"container mx-auto p-6 max-w-6xl space-y-6",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("div",{className:"p-2.5 rounded-xl bg-gradient-to-br from-primary/20 to-primary/5 border border-primary/20",children:h.jsx(ms,{className:"h-6 w-6 text-primary"})}),h.jsxs("div",{children:[h.jsx("h1",{className:"text-2xl font-bold",children:"Activities"}),h.jsx("p",{className:"text-sm text-muted-foreground",children:"Track calls, meetings, tasks and demos"})]})]}),h.jsxs(Ge,{onClick:z,children:[h.jsx($i,{className:"h-4 w-4 mr-2"}),"New Activity"]})]}),h.jsxs(cr,{children:[h.jsx(ur,{className:"pb-4",children:h.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4",children:[h.jsxs("div",{children:[h.jsx(dr,{className:"text-lg",children:"All Activities"}),h.jsxs(no,{children:[w?.length??0," ",w?.length===1?"activity":"activities"]})]}),h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsxs(Xl,{value:u,onValueChange:A=>d(A),children:[h.jsxs(Yi,{className:"w-[140px]",children:[h.jsx(Os,{className:"h-4 w-4 mr-2 text-muted-foreground"}),h.jsx($l,{placeholder:"Date filter"})]}),h.jsxs(Ki,{children:[h.jsx(_n,{value:"all",children:"All Dates"}),h.jsx(_n,{value:"today",children:"Today"}),h.jsx(_n,{value:"thisWeek",children:"This Week"}),h.jsx(_n,{value:"thisMonth",children:"This Month"})]})]}),h.jsxs(Xl,{value:m,onValueChange:A=>v(A),children:[h.jsxs(Yi,{className:"w-[140px]",children:[h.jsx(Ui,{className:"h-4 w-4 mr-2 text-muted-foreground"}),h.jsx($l,{placeholder:"Type filter"})]}),h.jsxs(Ki,{children:[h.jsx(_n,{value:"all",children:"All Types"}),h.jsx(_n,{value:"Call",children:h.jsxs("span",{className:"flex items-center gap-2",children:[h.jsx(pa,{className:"h-3.5 w-3.5"}),"Call"]})}),h.jsx(_n,{value:"Meeting",children:h.jsxs("span",{className:"flex items-center gap-2",children:[h.jsx(zn,{className:"h-3.5 w-3.5"}),"Meeting"]})}),h.jsx(_n,{value:"Task",children:h.jsxs("span",{className:"flex items-center gap-2",children:[h.jsx(Ui,{className:"h-3.5 w-3.5"}),"Task"]})}),h.jsx(_n,{value:"Demo",children:h.jsxs("span",{className:"flex items-center gap-2",children:[h.jsx(Zu,{className:"h-3.5 w-3.5"}),"Demo"]})})]})]})]})]})}),h.jsx(fr,{children:C?h.jsx("div",{className:"flex items-center justify-center py-12",children:h.jsx(Yn,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):w&&w.length>0?h.jsx("div",{className:"rounded-lg border",children:h.jsxs(Us,{children:[h.jsx(Bs,{children:h.jsxs(ya,{children:[h.jsx($t,{className:"w-[50px]",children:"Status"}),h.jsx($t,{children:"Activity"}),h.jsx($t,{children:"Type"}),h.jsx($t,{children:"Deal"}),h.jsx($t,{children:"Planned"}),h.jsx($t,{children:"Completed"})]})}),h.jsx(Hs,{children:w.map(A=>{const q=N(A.type),K=!!A.doneAt;return h.jsxs(ya,{className:"cursor-pointer hover:bg-muted/50 transition-colors",onClick:()=>A.id&&_(A.id),children:[h.jsx(Zt,{children:h.jsx("button",{onClick:W=>A.id&&I(W,A.id,K),className:"p-1 rounded-md hover:bg-muted transition-colors disabled:opacity-50",disabled:b===A.id,children:b===A.id?h.jsx(Yn,{className:"h-5 w-5 animate-spin text-primary"}):K?h.jsx(ps,{className:"h-5 w-5 text-emerald-500 transition-all duration-300 animate-in zoom-in-50"}):h.jsx(gp,{className:"h-5 w-5 text-muted-foreground hover:text-primary transition-colors"})})}),h.jsx(Zt,{className:`font-medium ${K?"line-through text-muted-foreground":""}`,children:A.name||"-"}),h.jsx(Zt,{children:A.type?h.jsxs(lv,{variant:"outline",className:`${T(A.type)} gap-1.5`,children:[h.jsx(q,{className:"h-3 w-3"}),A.type]}):h.jsx("span",{className:"text-muted-foreground",children:"-"})}),h.jsx(Zt,{children:A.deal&&A.deal.length>0?h.jsx("span",{className:"text-primary font-medium",children:A.deal[0].name}):h.jsx("span",{className:"text-muted-foreground",children:"-"})}),h.jsx(Zt,{className:"text-muted-foreground",children:O(A.plannedAt)}),h.jsx(Zt,{className:"text-muted-foreground",children:A.doneAt?h.jsx("span",{className:"text-emerald-600",children:M(A.doneAt)}):"-"})]},A.id)})})]})}):h.jsxs("div",{className:"text-center py-12 text-muted-foreground",children:[h.jsx(ms,{className:"h-12 w-12 mx-auto mb-4 opacity-20"}),h.jsx("p",{children:"No activities found."}),u!=="all"||m!=="all"?h.jsx(Ge,{variant:"link",onClick:()=>{d("all"),v("all")},className:"mt-2",children:"Clear filters"}):h.jsx(Ge,{variant:"link",onClick:z,className:"mt-2",children:"Create your first activity"})]})})]}),h.jsx(Dk,{open:a,onOpenChange:l,activityId:s,onSuccess:k})]})}const Ak=()=>h.jsxs("section",{className:"space-y-4 text-center",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx("p",{className:"text-sm uppercase tracking-wide text-muted-foreground",children:"404"}),h.jsx("h1",{className:"text-2xl font-semibold",children:"Page not found"}),h.jsx("p",{className:"text-muted-foreground",children:"The page you are looking for does not exist or has moved."})]}),h.jsx("div",{className:"flex justify-center",children:h.jsx(Ge,{asChild:!0,children:h.jsx(cS,{to:"/",children:"Go back home"})})})]}),Ix=new yM({defaultOptions:{queries:{staleTime:5*1e3}}}),zk=TR([{path:"/",element:h.jsx(W4,{}),children:[{index:!0,element:h.jsx(Sx,{})},{path:"companies",element:h.jsx(Sx,{})},{path:"contacts",element:h.jsx(K5,{})},{path:"deals",element:h.jsx(hk,{})},{path:"deals/:id",element:h.jsx(Mk,{})},{path:"activities",element:h.jsx(_k,{})}]},{path:"*",element:h.jsx(Ak,{})}]);l2.createRoot(document.getElementById("root")).render(h.jsx(g.StrictMode,{children:h.jsx($e.Provider,{client:E5,queryClient:Ix,children:h.jsx(bM,{client:Ix,children:h.jsx(BR,{router:zk})})})}));