fakebase-studio 1.0.8 → 1.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,73 +0,0 @@
1
- function M4(t,e){for(var n=0;n<e.length;n++){const o=e[n];if(typeof o!="string"&&!Array.isArray(o)){for(const s in o)if(s!=="default"&&!(s in t)){const i=Object.getOwnPropertyDescriptor(o,s);i&&Object.defineProperty(t,s,i.get?i:{enumerable:!0,get:()=>o[s]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))o(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const l of i.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&o(l)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function o(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();function N0(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Ag={exports:{}},uc={};var Yb;function R4(){if(Yb)return uc;Yb=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function n(o,s,i){var l=null;if(i!==void 0&&(l=""+i),s.key!==void 0&&(l=""+s.key),"key"in s){i={};for(var u in s)u!=="key"&&(i[u]=s[u])}else i=s;return s=i.ref,{$$typeof:t,type:o,key:l,ref:s!==void 0?s:null,props:i}}return uc.Fragment=e,uc.jsx=n,uc.jsxs=n,uc}var Gb;function D4(){return Gb||(Gb=1,Ag.exports=R4()),Ag.exports}var p=D4(),Og={exports:{}},it={};var qb;function T4(){if(qb)return it;qb=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),l=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),m=Symbol.for("react.activity"),y=Symbol.iterator;function v($){return $===null||typeof $!="object"?null:($=y&&$[y]||$["@@iterator"],typeof $=="function"?$:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,S={};function N($,I,U){this.props=$,this.context=I,this.refs=S,this.updater=U||w}N.prototype.isReactComponent={},N.prototype.setState=function($,I){if(typeof $!="object"&&typeof $!="function"&&$!=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,$,I,"setState")},N.prototype.forceUpdate=function($){this.updater.enqueueForceUpdate(this,$,"forceUpdate")};function M(){}M.prototype=N.prototype;function E($,I,U){this.props=$,this.context=I,this.refs=S,this.updater=U||w}var R=E.prototype=new M;R.constructor=E,C(R,N.prototype),R.isPureReactComponent=!0;var D=Array.isArray;function T(){}var k={H:null,A:null,T:null,S:null},O=Object.prototype.hasOwnProperty;function L($,I,U){var K=U.ref;return{$$typeof:t,type:$,key:I,ref:K!==void 0?K:null,props:U}}function W($,I){return L($.type,I,$.props)}function B($){return typeof $=="object"&&$!==null&&$.$$typeof===t}function Y($){var I={"=":"=0",":":"=2"};return"$"+$.replace(/[=:]/g,function(U){return I[U]})}var q=/\/+/g;function z($,I){return typeof $=="object"&&$!==null&&$.key!=null?Y(""+$.key):I.toString(36)}function V($){switch($.status){case"fulfilled":return $.value;case"rejected":throw $.reason;default:switch(typeof $.status=="string"?$.then(T,T):($.status="pending",$.then(function(I){$.status==="pending"&&($.status="fulfilled",$.value=I)},function(I){$.status==="pending"&&($.status="rejected",$.reason=I)})),$.status){case"fulfilled":return $.value;case"rejected":throw $.reason}}throw $}function A($,I,U,K,J){var ne=typeof $;(ne==="undefined"||ne==="boolean")&&($=null);var X=!1;if($===null)X=!0;else switch(ne){case"bigint":case"string":case"number":X=!0;break;case"object":switch($.$$typeof){case t:case e:X=!0;break;case g:return X=$._init,A(X($._payload),I,U,K,J)}}if(X)return J=J($),X=K===""?"."+z($,0):K,D(J)?(U="",X!=null&&(U=X.replace(q,"$&/")+"/"),A(J,I,U,"",function(le){return le})):J!=null&&(B(J)&&(J=W(J,U+(J.key==null||$&&$.key===J.key?"":(""+J.key).replace(q,"$&/")+"/")+X)),I.push(J)),1;X=0;var ee=K===""?".":K+":";if(D($))for(var se=0;se<$.length;se++)K=$[se],ne=ee+z(K,se),X+=A(K,I,U,ne,J);else if(se=v($),typeof se=="function")for($=se.call($),se=0;!(K=$.next()).done;)K=K.value,ne=ee+z(K,se++),X+=A(K,I,U,ne,J);else if(ne==="object"){if(typeof $.then=="function")return A(V($),I,U,K,J);throw I=String($),Error("Objects are not valid as a React child (found: "+(I==="[object Object]"?"object with keys {"+Object.keys($).join(", ")+"}":I)+"). If you meant to render a collection of children, use an array instead.")}return X}function H($,I,U){if($==null)return $;var K=[],J=0;return A($,K,"","",function(ne){return I.call(U,ne,J++)}),K}function P($){if($._status===-1){var I=$._result;I=I(),I.then(function(U){($._status===0||$._status===-1)&&($._status=1,$._result=U)},function(U){($._status===0||$._status===-1)&&($._status=2,$._result=U)}),$._status===-1&&($._status=0,$._result=I)}if($._status===1)return $._result.default;throw $._result}var F=typeof reportError=="function"?reportError:function($){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var I=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof $=="object"&&$!==null&&typeof $.message=="string"?String($.message):String($),error:$});if(!window.dispatchEvent(I))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",$);return}console.error($)},Q={map:H,forEach:function($,I,U){H($,function(){I.apply(this,arguments)},U)},count:function($){var I=0;return H($,function(){I++}),I},toArray:function($){return H($,function(I){return I})||[]},only:function($){if(!B($))throw Error("React.Children.only expected to receive a single React element child.");return $}};return it.Activity=m,it.Children=Q,it.Component=N,it.Fragment=n,it.Profiler=s,it.PureComponent=E,it.StrictMode=o,it.Suspense=d,it.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=k,it.__COMPILER_RUNTIME={__proto__:null,c:function($){return k.H.useMemoCache($)}},it.cache=function($){return function(){return $.apply(null,arguments)}},it.cacheSignal=function(){return null},it.cloneElement=function($,I,U){if($==null)throw Error("The argument must be a React element, but you passed "+$+".");var K=C({},$.props),J=$.key;if(I!=null)for(ne in I.key!==void 0&&(J=""+I.key),I)!O.call(I,ne)||ne==="key"||ne==="__self"||ne==="__source"||ne==="ref"&&I.ref===void 0||(K[ne]=I[ne]);var ne=arguments.length-2;if(ne===1)K.children=U;else if(1<ne){for(var X=Array(ne),ee=0;ee<ne;ee++)X[ee]=arguments[ee+2];K.children=X}return L($.type,J,K)},it.createContext=function($){return $={$$typeof:l,_currentValue:$,_currentValue2:$,_threadCount:0,Provider:null,Consumer:null},$.Provider=$,$.Consumer={$$typeof:i,_context:$},$},it.createElement=function($,I,U){var K,J={},ne=null;if(I!=null)for(K in I.key!==void 0&&(ne=""+I.key),I)O.call(I,K)&&K!=="key"&&K!=="__self"&&K!=="__source"&&(J[K]=I[K]);var X=arguments.length-2;if(X===1)J.children=U;else if(1<X){for(var ee=Array(X),se=0;se<X;se++)ee[se]=arguments[se+2];J.children=ee}if($&&$.defaultProps)for(K in X=$.defaultProps,X)J[K]===void 0&&(J[K]=X[K]);return L($,ne,J)},it.createRef=function(){return{current:null}},it.forwardRef=function($){return{$$typeof:u,render:$}},it.isValidElement=B,it.lazy=function($){return{$$typeof:g,_payload:{_status:-1,_result:$},_init:P}},it.memo=function($,I){return{$$typeof:f,type:$,compare:I===void 0?null:I}},it.startTransition=function($){var I=k.T,U={};k.T=U;try{var K=$(),J=k.S;J!==null&&J(U,K),typeof K=="object"&&K!==null&&typeof K.then=="function"&&K.then(T,F)}catch(ne){F(ne)}finally{I!==null&&U.types!==null&&(I.types=U.types),k.T=I}},it.unstable_useCacheRefresh=function(){return k.H.useCacheRefresh()},it.use=function($){return k.H.use($)},it.useActionState=function($,I,U){return k.H.useActionState($,I,U)},it.useCallback=function($,I){return k.H.useCallback($,I)},it.useContext=function($){return k.H.useContext($)},it.useDebugValue=function(){},it.useDeferredValue=function($,I){return k.H.useDeferredValue($,I)},it.useEffect=function($,I){return k.H.useEffect($,I)},it.useEffectEvent=function($){return k.H.useEffectEvent($)},it.useId=function(){return k.H.useId()},it.useImperativeHandle=function($,I,U){return k.H.useImperativeHandle($,I,U)},it.useInsertionEffect=function($,I){return k.H.useInsertionEffect($,I)},it.useLayoutEffect=function($,I){return k.H.useLayoutEffect($,I)},it.useMemo=function($,I){return k.H.useMemo($,I)},it.useOptimistic=function($,I){return k.H.useOptimistic($,I)},it.useReducer=function($,I,U){return k.H.useReducer($,I,U)},it.useRef=function($){return k.H.useRef($)},it.useState=function($){return k.H.useState($)},it.useSyncExternalStore=function($,I,U){return k.H.useSyncExternalStore($,I,U)},it.useTransition=function(){return k.H.useTransition()},it.version="19.2.4",it}var Wb;function ll(){return Wb||(Wb=1,Og.exports=T4()),Og.exports}var x=ll();const de=N0(x),q2=M4({__proto__:null,default:de},[x]);var zg={exports:{}},dc={},Ig={exports:{}},Pg={};var Kb;function k4(){return Kb||(Kb=1,(function(t){function e(A,H){var P=A.length;A.push(H);e:for(;0<P;){var F=P-1>>>1,Q=A[F];if(0<s(Q,H))A[F]=H,A[P]=Q,P=F;else break e}}function n(A){return A.length===0?null:A[0]}function o(A){if(A.length===0)return null;var H=A[0],P=A.pop();if(P!==H){A[0]=P;e:for(var F=0,Q=A.length,$=Q>>>1;F<$;){var I=2*(F+1)-1,U=A[I],K=I+1,J=A[K];if(0>s(U,P))K<Q&&0>s(J,U)?(A[F]=J,A[K]=P,F=K):(A[F]=U,A[I]=P,F=I);else if(K<Q&&0>s(J,P))A[F]=J,A[K]=P,F=K;else break e}}return H}function s(A,H){var P=A.sortIndex-H.sortIndex;return P!==0?P:A.id-H.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var i=performance;t.unstable_now=function(){return i.now()}}else{var l=Date,u=l.now();t.unstable_now=function(){return l.now()-u}}var d=[],f=[],g=1,m=null,y=3,v=!1,w=!1,C=!1,S=!1,N=typeof setTimeout=="function"?setTimeout:null,M=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;function R(A){for(var H=n(f);H!==null;){if(H.callback===null)o(f);else if(H.startTime<=A)o(f),H.sortIndex=H.expirationTime,e(d,H);else break;H=n(f)}}function D(A){if(C=!1,R(A),!w)if(n(d)!==null)w=!0,T||(T=!0,Y());else{var H=n(f);H!==null&&V(D,H.startTime-A)}}var T=!1,k=-1,O=5,L=-1;function W(){return S?!0:!(t.unstable_now()-L<O)}function B(){if(S=!1,T){var A=t.unstable_now();L=A;var H=!0;try{e:{w=!1,C&&(C=!1,M(k),k=-1),v=!0;var P=y;try{t:{for(R(A),m=n(d);m!==null&&!(m.expirationTime>A&&W());){var F=m.callback;if(typeof F=="function"){m.callback=null,y=m.priorityLevel;var Q=F(m.expirationTime<=A);if(A=t.unstable_now(),typeof Q=="function"){m.callback=Q,R(A),H=!0;break t}m===n(d)&&o(d),R(A)}else o(d);m=n(d)}if(m!==null)H=!0;else{var $=n(f);$!==null&&V(D,$.startTime-A),H=!1}}break e}finally{m=null,y=P,v=!1}H=void 0}}finally{H?Y():T=!1}}}var Y;if(typeof E=="function")Y=function(){E(B)};else if(typeof MessageChannel<"u"){var q=new MessageChannel,z=q.port2;q.port1.onmessage=B,Y=function(){z.postMessage(null)}}else Y=function(){N(B,0)};function V(A,H){k=N(function(){A(t.unstable_now())},H)}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(A){A.callback=null},t.unstable_forceFrameRate=function(A){0>A||125<A?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):O=0<A?Math.floor(1e3/A):5},t.unstable_getCurrentPriorityLevel=function(){return y},t.unstable_next=function(A){switch(y){case 1:case 2:case 3:var H=3;break;default:H=y}var P=y;y=H;try{return A()}finally{y=P}},t.unstable_requestPaint=function(){S=!0},t.unstable_runWithPriority=function(A,H){switch(A){case 1:case 2:case 3:case 4:case 5:break;default:A=3}var P=y;y=A;try{return H()}finally{y=P}},t.unstable_scheduleCallback=function(A,H,P){var F=t.unstable_now();switch(typeof P=="object"&&P!==null?(P=P.delay,P=typeof P=="number"&&0<P?F+P:F):P=F,A){case 1:var Q=-1;break;case 2:Q=250;break;case 5:Q=1073741823;break;case 4:Q=1e4;break;default:Q=5e3}return Q=P+Q,A={id:g++,callback:H,priorityLevel:A,startTime:P,expirationTime:Q,sortIndex:-1},P>F?(A.sortIndex=P,e(f,A),n(d)===null&&A===n(f)&&(C?(M(k),k=-1):C=!0,V(D,P-F))):(A.sortIndex=Q,e(d,A),w||v||(w=!0,T||(T=!0,Y()))),A},t.unstable_shouldYield=W,t.unstable_wrapCallback=function(A){var H=y;return function(){var P=y;y=H;try{return A.apply(this,arguments)}finally{y=P}}}})(Pg)),Pg}var Xb;function j4(){return Xb||(Xb=1,Ig.exports=k4()),Ig.exports}var $g={exports:{}},Gn={};var Qb;function A4(){if(Qb)return Gn;Qb=1;var t=ll();function e(d){var f="https://react.dev/errors/"+d;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)f+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+d+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var o={d:{f:n,r:function(){throw Error(e(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},s=Symbol.for("react.portal");function i(d,f,g){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:m==null?null:""+m,children:d,containerInfo:f,implementation:g}}var l=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(d,f){if(d==="font")return"";if(typeof f=="string")return f==="use-credentials"?f:""}return Gn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,Gn.createPortal=function(d,f){var g=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!f||f.nodeType!==1&&f.nodeType!==9&&f.nodeType!==11)throw Error(e(299));return i(d,f,null,g)},Gn.flushSync=function(d){var f=l.T,g=o.p;try{if(l.T=null,o.p=2,d)return d()}finally{l.T=f,o.p=g,o.d.f()}},Gn.preconnect=function(d,f){typeof d=="string"&&(f?(f=f.crossOrigin,f=typeof f=="string"?f==="use-credentials"?f:"":void 0):f=null,o.d.C(d,f))},Gn.prefetchDNS=function(d){typeof d=="string"&&o.d.D(d)},Gn.preinit=function(d,f){if(typeof d=="string"&&f&&typeof f.as=="string"){var g=f.as,m=u(g,f.crossOrigin),y=typeof f.integrity=="string"?f.integrity:void 0,v=typeof f.fetchPriority=="string"?f.fetchPriority:void 0;g==="style"?o.d.S(d,typeof f.precedence=="string"?f.precedence:void 0,{crossOrigin:m,integrity:y,fetchPriority:v}):g==="script"&&o.d.X(d,{crossOrigin:m,integrity:y,fetchPriority:v,nonce:typeof f.nonce=="string"?f.nonce:void 0})}},Gn.preinitModule=function(d,f){if(typeof d=="string")if(typeof f=="object"&&f!==null){if(f.as==null||f.as==="script"){var g=u(f.as,f.crossOrigin);o.d.M(d,{crossOrigin:g,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0})}}else f==null&&o.d.M(d)},Gn.preload=function(d,f){if(typeof d=="string"&&typeof f=="object"&&f!==null&&typeof f.as=="string"){var g=f.as,m=u(g,f.crossOrigin);o.d.L(d,g,{crossOrigin:m,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0,type:typeof f.type=="string"?f.type:void 0,fetchPriority:typeof f.fetchPriority=="string"?f.fetchPriority:void 0,referrerPolicy:typeof f.referrerPolicy=="string"?f.referrerPolicy:void 0,imageSrcSet:typeof f.imageSrcSet=="string"?f.imageSrcSet:void 0,imageSizes:typeof f.imageSizes=="string"?f.imageSizes:void 0,media:typeof f.media=="string"?f.media:void 0})}},Gn.preloadModule=function(d,f){if(typeof d=="string")if(f){var g=u(f.as,f.crossOrigin);o.d.m(d,{as:typeof f.as=="string"&&f.as!=="script"?f.as:void 0,crossOrigin:g,integrity:typeof f.integrity=="string"?f.integrity:void 0})}else o.d.m(d)},Gn.requestFormReset=function(d){o.d.r(d)},Gn.unstable_batchedUpdates=function(d,f){return d(f)},Gn.useFormState=function(d,f,g){return l.H.useFormState(d,f,g)},Gn.useFormStatus=function(){return l.H.useHostTransitionStatus()},Gn.version="19.2.4",Gn}var Zb;function W2(){if(Zb)return $g.exports;Zb=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(e){console.error(e)}}return t(),$g.exports=A4(),$g.exports}var Jb;function O4(){if(Jb)return dc;Jb=1;var t=j4(),e=ll(),n=W2();function o(r){var a="https://react.dev/errors/"+r;if(1<arguments.length){a+="?args[]="+encodeURIComponent(arguments[1]);for(var c=2;c<arguments.length;c++)a+="&args[]="+encodeURIComponent(arguments[c])}return"Minified React error #"+r+"; visit "+a+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11)}function i(r){var a=r,c=r;if(r.alternate)for(;a.return;)a=a.return;else{r=a;do a=r,(a.flags&4098)!==0&&(c=a.return),r=a.return;while(r)}return a.tag===3?c:null}function l(r){if(r.tag===13){var a=r.memoizedState;if(a===null&&(r=r.alternate,r!==null&&(a=r.memoizedState)),a!==null)return a.dehydrated}return null}function u(r){if(r.tag===31){var a=r.memoizedState;if(a===null&&(r=r.alternate,r!==null&&(a=r.memoizedState)),a!==null)return a.dehydrated}return null}function d(r){if(i(r)!==r)throw Error(o(188))}function f(r){var a=r.alternate;if(!a){if(a=i(r),a===null)throw Error(o(188));return a!==r?null:r}for(var c=r,h=a;;){var b=c.return;if(b===null)break;var _=b.alternate;if(_===null){if(h=b.return,h!==null){c=h;continue}break}if(b.child===_.child){for(_=b.child;_;){if(_===c)return d(b),r;if(_===h)return d(b),a;_=_.sibling}throw Error(o(188))}if(c.return!==h.return)c=b,h=_;else{for(var j=!1,G=b.child;G;){if(G===c){j=!0,c=b,h=_;break}if(G===h){j=!0,h=b,c=_;break}G=G.sibling}if(!j){for(G=_.child;G;){if(G===c){j=!0,c=_,h=b;break}if(G===h){j=!0,h=_,c=b;break}G=G.sibling}if(!j)throw Error(o(189))}}if(c.alternate!==h)throw Error(o(190))}if(c.tag!==3)throw Error(o(188));return c.stateNode.current===c?r:a}function g(r){var a=r.tag;if(a===5||a===26||a===27||a===6)return r;for(r=r.child;r!==null;){if(a=g(r),a!==null)return a;r=r.sibling}return null}var m=Object.assign,y=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),N=Symbol.for("react.profiler"),M=Symbol.for("react.consumer"),E=Symbol.for("react.context"),R=Symbol.for("react.forward_ref"),D=Symbol.for("react.suspense"),T=Symbol.for("react.suspense_list"),k=Symbol.for("react.memo"),O=Symbol.for("react.lazy"),L=Symbol.for("react.activity"),W=Symbol.for("react.memo_cache_sentinel"),B=Symbol.iterator;function Y(r){return r===null||typeof r!="object"?null:(r=B&&r[B]||r["@@iterator"],typeof r=="function"?r:null)}var q=Symbol.for("react.client.reference");function z(r){if(r==null)return null;if(typeof r=="function")return r.$$typeof===q?null:r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case C:return"Fragment";case N:return"Profiler";case S:return"StrictMode";case D:return"Suspense";case T:return"SuspenseList";case L:return"Activity"}if(typeof r=="object")switch(r.$$typeof){case w:return"Portal";case E:return r.displayName||"Context";case M:return(r._context.displayName||"Context")+".Consumer";case R:var a=r.render;return r=r.displayName,r||(r=a.displayName||a.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case k:return a=r.displayName||null,a!==null?a:z(r.type)||"Memo";case O:a=r._payload,r=r._init;try{return z(r(a))}catch{}}return null}var V=Array.isArray,A=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,H=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P={pending:!1,data:null,method:null,action:null},F=[],Q=-1;function $(r){return{current:r}}function I(r){0>Q||(r.current=F[Q],F[Q]=null,Q--)}function U(r,a){Q++,F[Q]=r.current,r.current=a}var K=$(null),J=$(null),ne=$(null),X=$(null);function ee(r,a){switch(U(ne,a),U(J,r),U(K,null),a.nodeType){case 9:case 11:r=(r=a.documentElement)&&(r=r.namespaceURI)?mb(r):0;break;default:if(r=a.tagName,a=a.namespaceURI)a=mb(a),r=gb(a,r);else switch(r){case"svg":r=1;break;case"math":r=2;break;default:r=0}}I(K),U(K,r)}function se(){I(K),I(J),I(ne)}function le(r){r.memoizedState!==null&&U(X,r);var a=K.current,c=gb(a,r.type);a!==c&&(U(J,r),U(K,c))}function pe(r){J.current===r&&(I(K),I(J)),X.current===r&&(I(X),ac._currentValue=P)}var ie,be;function ke(r){if(ie===void 0)try{throw Error()}catch(c){var a=c.stack.trim().match(/\n( *(at )?)/);ie=a&&a[1]||"",be=-1<c.stack.indexOf(`
2
- at`)?" (<anonymous>)":-1<c.stack.indexOf("@")?"@unknown:0:0":""}return`
3
- `+ie+r+be}var Be=!1;function Ie(r,a){if(!r||Be)return"";Be=!0;var c=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var h={DetermineComponentFrameRoot:function(){try{if(a){var Ee=function(){throw Error()};if(Object.defineProperty(Ee.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Ee,[])}catch(me){var he=me}Reflect.construct(r,[],Ee)}else{try{Ee.call()}catch(me){he=me}r.call(Ee.prototype)}}else{try{throw Error()}catch(me){he=me}(Ee=r())&&typeof Ee.catch=="function"&&Ee.catch(function(){})}}catch(me){if(me&&he&&typeof me.stack=="string")return[me.stack,he.stack]}return[null,null]}};h.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var b=Object.getOwnPropertyDescriptor(h.DetermineComponentFrameRoot,"name");b&&b.configurable&&Object.defineProperty(h.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var _=h.DetermineComponentFrameRoot(),j=_[0],G=_[1];if(j&&G){var te=j.split(`
4
- `),fe=G.split(`
5
- `);for(b=h=0;h<te.length&&!te[h].includes("DetermineComponentFrameRoot");)h++;for(;b<fe.length&&!fe[b].includes("DetermineComponentFrameRoot");)b++;if(h===te.length||b===fe.length)for(h=te.length-1,b=fe.length-1;1<=h&&0<=b&&te[h]!==fe[b];)b--;for(;1<=h&&0<=b;h--,b--)if(te[h]!==fe[b]){if(h!==1||b!==1)do if(h--,b--,0>b||te[h]!==fe[b]){var ye=`
6
- `+te[h].replace(" at new "," at ");return r.displayName&&ye.includes("<anonymous>")&&(ye=ye.replace("<anonymous>",r.displayName)),ye}while(1<=h&&0<=b);break}}}finally{Be=!1,Error.prepareStackTrace=c}return(c=r?r.displayName||r.name:"")?ke(c):""}function lt(r,a){switch(r.tag){case 26:case 27:case 5:return ke(r.type);case 16:return ke("Lazy");case 13:return r.child!==a&&a!==null?ke("Suspense Fallback"):ke("Suspense");case 19:return ke("SuspenseList");case 0:case 15:return Ie(r.type,!1);case 11:return Ie(r.type.render,!1);case 1:return Ie(r.type,!0);case 31:return ke("Activity");default:return""}}function cn(r){try{var a="",c=null;do a+=lt(r,c),c=r,r=r.return;while(r);return a}catch(h){return`
7
- Error generating stack: `+h.message+`
8
- `+h.stack}}var ht=Object.prototype.hasOwnProperty,bn=t.unstable_scheduleCallback,un=t.unstable_cancelCallback,Vt=t.unstable_shouldYield,mn=t.unstable_requestPaint,It=t.unstable_now,Mn=t.unstable_getCurrentPriorityLevel,yn=t.unstable_ImmediatePriority,In=t.unstable_UserBlockingPriority,On=t.unstable_NormalPriority,_e=t.unstable_LowPriority,Ue=t.unstable_IdlePriority,_t=t.log,Qe=t.unstable_setDisableYieldValue,st=null,gt=null;function Wt(r){if(typeof _t=="function"&&Qe(r),gt&&typeof gt.setStrictMode=="function")try{gt.setStrictMode(st,r)}catch{}}var Kt=Math.clz32?Math.clz32:Fe,Zn=Math.log,Nt=Math.LN2;function Fe(r){return r>>>=0,r===0?32:31-(Zn(r)/Nt|0)|0}var nt=256,Ye=262144,at=4194304;function Lt(r){var a=r&42;if(a!==0)return a;switch(r&-r){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 r&261888;case 262144:case 524288:case 1048576:case 2097152:return r&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return r&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return r}}function De(r,a,c){var h=r.pendingLanes;if(h===0)return 0;var b=0,_=r.suspendedLanes,j=r.pingedLanes;r=r.warmLanes;var G=h&134217727;return G!==0?(h=G&~_,h!==0?b=Lt(h):(j&=G,j!==0?b=Lt(j):c||(c=G&~r,c!==0&&(b=Lt(c))))):(G=h&~_,G!==0?b=Lt(G):j!==0?b=Lt(j):c||(c=h&~r,c!==0&&(b=Lt(c)))),b===0?0:a!==0&&a!==b&&(a&_)===0&&(_=b&-b,c=a&-a,_>=c||_===32&&(c&4194048)!==0)?a:b}function At(r,a){return(r.pendingLanes&~(r.suspendedLanes&~r.pingedLanes)&a)===0}function Xt(r,a){switch(r){case 1:case 2:case 4:case 8:case 64:return a+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 a+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 dn(){var r=at;return at<<=1,(at&62914560)===0&&(at=4194304),r}function Pn(r){for(var a=[],c=0;31>c;c++)a.push(r);return a}function Tt(r,a){r.pendingLanes|=a,a!==268435456&&(r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0)}function Rn(r,a,c,h,b,_){var j=r.pendingLanes;r.pendingLanes=c,r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0,r.expiredLanes&=c,r.entangledLanes&=c,r.errorRecoveryDisabledLanes&=c,r.shellSuspendCounter=0;var G=r.entanglements,te=r.expirationTimes,fe=r.hiddenUpdates;for(c=j&~c;0<c;){var ye=31-Kt(c),Ee=1<<ye;G[ye]=0,te[ye]=-1;var he=fe[ye];if(he!==null)for(fe[ye]=null,ye=0;ye<he.length;ye++){var me=he[ye];me!==null&&(me.lane&=-536870913)}c&=~Ee}h!==0&&Yo(r,h,0),_!==0&&b===0&&r.tag!==0&&(r.suspendedLanes|=_&~(j&~a))}function Yo(r,a,c){r.pendingLanes|=a,r.suspendedLanes&=~a;var h=31-Kt(a);r.entangledLanes|=a,r.entanglements[h]=r.entanglements[h]|1073741824|c&261930}function vt(r,a){var c=r.entangledLanes|=a;for(r=r.entanglements;c;){var h=31-Kt(c),b=1<<h;b&a|r[h]&a&&(r[h]|=a),c&=~b}}function Dn(r,a){var c=a&-a;return c=(c&42)!==0?1:Do(c),(c&(r.suspendedLanes|a))!==0?0:c}function Do(r){switch(r){case 2:r=1;break;case 8:r=4;break;case 32:r=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:r=128;break;case 268435456:r=134217728;break;default:r=0}return r}function Un(r){return r&=-r,2<r?8<r?(r&134217727)!==0?32:268435456:8:2}function lo(){var r=H.p;return r!==0?r:(r=window.event,r===void 0?32:$b(r.type))}function Or(r,a){var c=H.p;try{return H.p=r,a()}finally{H.p=c}}var co=Math.random().toString(36).slice(2),fn="__reactFiber$"+co,Tn="__reactProps$"+co,To="__reactContainer$"+co,zr="__reactEvents$"+co,fa="__reactListeners$"+co,Z="__reactHandles$"+co,oe="__reactResources$"+co,ce="__reactMarker$"+co;function ve(r){delete r[fn],delete r[Tn],delete r[zr],delete r[fa],delete r[Z]}function we(r){var a=r[fn];if(a)return a;for(var c=r.parentNode;c;){if(a=c[To]||c[fn]){if(c=a.alternate,a.child!==null||c!==null&&c.child!==null)for(r=Sb(r);r!==null;){if(c=r[fn])return c;r=Sb(r)}return a}r=c,c=r.parentNode}return null}function Me(r){if(r=r[fn]||r[To]){var a=r.tag;if(a===5||a===6||a===13||a===31||a===26||a===27||a===3)return r}return null}function Pe(r){var a=r.tag;if(a===5||a===26||a===27||a===6)return r.stateNode;throw Error(o(33))}function Oe(r){var a=r[oe];return a||(a=r[oe]={hoistableStyles:new Map,hoistableScripts:new Map}),a}function Se(r){r[ce]=!0}var Re=new Set,Te={};function Ae(r,a){xe(r,a),xe(r+"Capture",a)}function xe(r,a){for(Te[r]=a,r=0;r<a.length;r++)Re.add(a[r])}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]*$"),ot={},Et={};function Mt(r){return ht.call(Et,r)?!0:ht.call(ot,r)?!1:je.test(r)?Et[r]=!0:(ot[r]=!0,!1)}function ct(r,a,c){if(Mt(a))if(c===null)r.removeAttribute(a);else{switch(typeof c){case"undefined":case"function":case"symbol":r.removeAttribute(a);return;case"boolean":var h=a.toLowerCase().slice(0,5);if(h!=="data-"&&h!=="aria-"){r.removeAttribute(a);return}}r.setAttribute(a,""+c)}}function Pt(r,a,c){if(c===null)r.removeAttribute(a);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(a);return}r.setAttribute(a,""+c)}}function rt(r,a,c,h){if(h===null)r.removeAttribute(c);else{switch(typeof h){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(c);return}r.setAttributeNS(a,c,""+h)}}function mt(r){switch(typeof r){case"bigint":case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function $t(r){var a=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(a==="checkbox"||a==="radio")}function Yn(r,a,c){var h=Object.getOwnPropertyDescriptor(r.constructor.prototype,a);if(!r.hasOwnProperty(a)&&typeof h<"u"&&typeof h.get=="function"&&typeof h.set=="function"){var b=h.get,_=h.set;return Object.defineProperty(r,a,{configurable:!0,get:function(){return b.call(this)},set:function(j){c=""+j,_.call(this,j)}}),Object.defineProperty(r,a,{enumerable:h.enumerable}),{getValue:function(){return c},setValue:function(j){c=""+j},stopTracking:function(){r._valueTracker=null,delete r[a]}}}}function kn(r){if(!r._valueTracker){var a=$t(r)?"checked":"value";r._valueTracker=Yn(r,a,""+r[a])}}function $n(r){if(!r)return!1;var a=r._valueTracker;if(!a)return!0;var c=a.getValue(),h="";return r&&(h=$t(r)?r.checked?"true":"false":r.value),r=h,r!==c?(a.setValue(r),!0):!1}function en(r){if(r=r||(typeof document<"u"?document:void 0),typeof r>"u")return null;try{return r.activeElement||r.body}catch{return r.body}}var Ir=/[\n"\\]/g;function Ze(r){return r.replace(Ir,function(a){return"\\"+a.charCodeAt(0).toString(16)+" "})}function uo(r,a,c,h,b,_,j,G){r.name="",j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"?r.type=j:r.removeAttribute("type"),a!=null?j==="number"?(a===0&&r.value===""||r.value!=a)&&(r.value=""+mt(a)):r.value!==""+mt(a)&&(r.value=""+mt(a)):j!=="submit"&&j!=="reset"||r.removeAttribute("value"),a!=null?ha(r,j,mt(a)):c!=null?ha(r,j,mt(c)):h!=null&&r.removeAttribute("value"),b==null&&_!=null&&(r.defaultChecked=!!_),b!=null&&(r.checked=b&&typeof b!="function"&&typeof b!="symbol"),G!=null&&typeof G!="function"&&typeof G!="symbol"&&typeof G!="boolean"?r.name=""+mt(G):r.removeAttribute("name")}function cr(r,a,c,h,b,_,j,G){if(_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"&&(r.type=_),a!=null||c!=null){if(!(_!=="submit"&&_!=="reset"||a!=null)){kn(r);return}c=c!=null?""+mt(c):"",a=a!=null?""+mt(a):c,G||a===r.value||(r.value=a),r.defaultValue=a}h=h??b,h=typeof h!="function"&&typeof h!="symbol"&&!!h,r.checked=G?r.checked:!!h,r.defaultChecked=!!h,j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"&&(r.name=j),kn(r)}function ha(r,a,c){a==="number"&&en(r.ownerDocument)===r||r.defaultValue===""+c||(r.defaultValue=""+c)}function Ot(r,a,c,h){if(r=r.options,a){a={};for(var b=0;b<c.length;b++)a["$"+c[b]]=!0;for(c=0;c<r.length;c++)b=a.hasOwnProperty("$"+r[c].value),r[c].selected!==b&&(r[c].selected=b),b&&h&&(r[c].defaultSelected=!0)}else{for(c=""+mt(c),a=null,b=0;b<r.length;b++){if(r[b].value===c){r[b].selected=!0,h&&(r[b].defaultSelected=!0);return}a!==null||r[b].disabled||(a=r[b])}a!==null&&(a.selected=!0)}}function Jn(r,a,c){if(a!=null&&(a=""+mt(a),a!==r.value&&(r.value=a),c==null)){r.defaultValue!==a&&(r.defaultValue=a);return}r.defaultValue=c!=null?""+mt(c):""}function Qt(r,a,c,h){if(a==null){if(h!=null){if(c!=null)throw Error(o(92));if(V(h)){if(1<h.length)throw Error(o(93));h=h[0]}c=h}c==null&&(c=""),a=c}c=mt(a),r.defaultValue=c,h=r.textContent,h===c&&h!==""&&h!==null&&(r.value=h),kn(r)}function Rt(r,a){if(a){var c=r.firstChild;if(c&&c===r.lastChild&&c.nodeType===3){c.nodeValue=a;return}}r.textContent=a}var ws=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 Pr(r,a,c){var h=a.indexOf("--")===0;c==null||typeof c=="boolean"||c===""?h?r.setProperty(a,""):a==="float"?r.cssFloat="":r[a]="":h?r.setProperty(a,c):typeof c!="number"||c===0||ws.has(a)?a==="float"?r.cssFloat=c:r[a]=(""+c).trim():r[a]=c+"px"}function bu(r,a,c){if(a!=null&&typeof a!="object")throw Error(o(62));if(r=r.style,c!=null){for(var h in c)!c.hasOwnProperty(h)||a!=null&&a.hasOwnProperty(h)||(h.indexOf("--")===0?r.setProperty(h,""):h==="float"?r.cssFloat="":r[h]="");for(var b in a)h=a[b],a.hasOwnProperty(b)&&c[b]!==h&&Pr(r,b,h)}else for(var _ in a)a.hasOwnProperty(_)&&Pr(r,_,a[_])}function Dh(r){if(r.indexOf("-")===-1)return!1;switch(r){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 C3=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"]]),E3=/^[\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 wu(r){return E3.test(""+r)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":r}function $r(){}var Th=null;function kh(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var Qa=null,Za=null;function hv(r){var a=Me(r);if(a&&(r=a.stateNode)){var c=r[Tn]||null;e:switch(r=a.stateNode,a.type){case"input":if(uo(r,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name),a=c.name,c.type==="radio"&&a!=null){for(c=r;c.parentNode;)c=c.parentNode;for(c=c.querySelectorAll('input[name="'+Ze(""+a)+'"][type="radio"]'),a=0;a<c.length;a++){var h=c[a];if(h!==r&&h.form===r.form){var b=h[Tn]||null;if(!b)throw Error(o(90));uo(h,b.value,b.defaultValue,b.defaultValue,b.checked,b.defaultChecked,b.type,b.name)}}for(a=0;a<c.length;a++)h=c[a],h.form===r.form&&$n(h)}break e;case"textarea":Jn(r,c.value,c.defaultValue);break e;case"select":a=c.value,a!=null&&Ot(r,!!c.multiple,a,!1)}}}var jh=!1;function mv(r,a,c){if(jh)return r(a,c);jh=!0;try{var h=r(a);return h}finally{if(jh=!1,(Qa!==null||Za!==null)&&(ld(),Qa&&(a=Qa,r=Za,Za=Qa=null,hv(a),r)))for(a=0;a<r.length;a++)hv(r[a])}}function Cl(r,a){var c=r.stateNode;if(c===null)return null;var h=c[Tn]||null;if(h===null)return null;c=h[a];e:switch(a){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(h=!h.disabled)||(r=r.type,h=!(r==="button"||r==="input"||r==="select"||r==="textarea")),r=!h;break e;default:r=!1}if(r)return null;if(c&&typeof c!="function")throw Error(o(231,a,typeof c));return c}var Lr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ah=!1;if(Lr)try{var El={};Object.defineProperty(El,"passive",{get:function(){Ah=!0}}),window.addEventListener("test",El,El),window.removeEventListener("test",El,El)}catch{Ah=!1}var Ss=null,Oh=null,Su=null;function gv(){if(Su)return Su;var r,a=Oh,c=a.length,h,b="value"in Ss?Ss.value:Ss.textContent,_=b.length;for(r=0;r<c&&a[r]===b[r];r++);var j=c-r;for(h=1;h<=j&&a[c-h]===b[_-h];h++);return Su=b.slice(r,1<h?1-h:void 0)}function Cu(r){var a=r.keyCode;return"charCode"in r?(r=r.charCode,r===0&&a===13&&(r=13)):r=a,r===10&&(r=13),32<=r||r===13?r:0}function Eu(){return!0}function pv(){return!1}function eo(r){function a(c,h,b,_,j){this._reactName=c,this._targetInst=b,this.type=h,this.nativeEvent=_,this.target=j,this.currentTarget=null;for(var G in r)r.hasOwnProperty(G)&&(c=r[G],this[G]=c?c(_):_[G]);return this.isDefaultPrevented=(_.defaultPrevented!=null?_.defaultPrevented:_.returnValue===!1)?Eu:pv,this.isPropagationStopped=pv,this}return m(a.prototype,{preventDefault:function(){this.defaultPrevented=!0;var c=this.nativeEvent;c&&(c.preventDefault?c.preventDefault():typeof c.returnValue!="unknown"&&(c.returnValue=!1),this.isDefaultPrevented=Eu)},stopPropagation:function(){var c=this.nativeEvent;c&&(c.stopPropagation?c.stopPropagation():typeof c.cancelBubble!="unknown"&&(c.cancelBubble=!0),this.isPropagationStopped=Eu)},persist:function(){},isPersistent:Eu}),a}var ma={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},_u=eo(ma),_l=m({},ma,{view:0,detail:0}),_3=eo(_l),zh,Ih,Nl,Nu=m({},_l,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:$h,button:0,buttons:0,relatedTarget:function(r){return r.relatedTarget===void 0?r.fromElement===r.srcElement?r.toElement:r.fromElement:r.relatedTarget},movementX:function(r){return"movementX"in r?r.movementX:(r!==Nl&&(Nl&&r.type==="mousemove"?(zh=r.screenX-Nl.screenX,Ih=r.screenY-Nl.screenY):Ih=zh=0,Nl=r),zh)},movementY:function(r){return"movementY"in r?r.movementY:Ih}}),yv=eo(Nu),N3=m({},Nu,{dataTransfer:0}),M3=eo(N3),R3=m({},_l,{relatedTarget:0}),Ph=eo(R3),D3=m({},ma,{animationName:0,elapsedTime:0,pseudoElement:0}),T3=eo(D3),k3=m({},ma,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),j3=eo(k3),A3=m({},ma,{data:0}),vv=eo(A3),O3={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},z3={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"},I3={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function P3(r){var a=this.nativeEvent;return a.getModifierState?a.getModifierState(r):(r=I3[r])?!!a[r]:!1}function $h(){return P3}var $3=m({},_l,{key:function(r){if(r.key){var a=O3[r.key]||r.key;if(a!=="Unidentified")return a}return r.type==="keypress"?(r=Cu(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?z3[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:$h,charCode:function(r){return r.type==="keypress"?Cu(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?Cu(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),L3=eo($3),H3=m({},Nu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),xv=eo(H3),B3=m({},_l,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:$h}),F3=eo(B3),V3=m({},ma,{propertyName:0,elapsedTime:0,pseudoElement:0}),U3=eo(V3),Y3=m({},Nu,{deltaX:function(r){return"deltaX"in r?r.deltaX:"wheelDeltaX"in r?-r.wheelDeltaX:0},deltaY:function(r){return"deltaY"in r?r.deltaY:"wheelDeltaY"in r?-r.wheelDeltaY:"wheelDelta"in r?-r.wheelDelta:0},deltaZ:0,deltaMode:0}),G3=eo(Y3),q3=m({},ma,{newState:0,oldState:0}),W3=eo(q3),K3=[9,13,27,32],Lh=Lr&&"CompositionEvent"in window,Ml=null;Lr&&"documentMode"in document&&(Ml=document.documentMode);var X3=Lr&&"TextEvent"in window&&!Ml,bv=Lr&&(!Lh||Ml&&8<Ml&&11>=Ml),wv=" ",Sv=!1;function Cv(r,a){switch(r){case"keyup":return K3.indexOf(a.keyCode)!==-1;case"keydown":return a.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ev(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var Ja=!1;function Q3(r,a){switch(r){case"compositionend":return Ev(a);case"keypress":return a.which!==32?null:(Sv=!0,wv);case"textInput":return r=a.data,r===wv&&Sv?null:r;default:return null}}function Z3(r,a){if(Ja)return r==="compositionend"||!Lh&&Cv(r,a)?(r=gv(),Su=Oh=Ss=null,Ja=!1,r):null;switch(r){case"paste":return null;case"keypress":if(!(a.ctrlKey||a.altKey||a.metaKey)||a.ctrlKey&&a.altKey){if(a.char&&1<a.char.length)return a.char;if(a.which)return String.fromCharCode(a.which)}return null;case"compositionend":return bv&&a.locale!=="ko"?null:a.data;default:return null}}var J3={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 _v(r){var a=r&&r.nodeName&&r.nodeName.toLowerCase();return a==="input"?!!J3[r.type]:a==="textarea"}function Nv(r,a,c,h){Qa?Za?Za.push(h):Za=[h]:Qa=h,a=gd(a,"onChange"),0<a.length&&(c=new _u("onChange","change",null,c,h),r.push({event:c,listeners:a}))}var Rl=null,Dl=null;function eD(r){lb(r,0)}function Mu(r){var a=Pe(r);if($n(a))return r}function Mv(r,a){if(r==="change")return a}var Rv=!1;if(Lr){var Hh;if(Lr){var Bh="oninput"in document;if(!Bh){var Dv=document.createElement("div");Dv.setAttribute("oninput","return;"),Bh=typeof Dv.oninput=="function"}Hh=Bh}else Hh=!1;Rv=Hh&&(!document.documentMode||9<document.documentMode)}function Tv(){Rl&&(Rl.detachEvent("onpropertychange",kv),Dl=Rl=null)}function kv(r){if(r.propertyName==="value"&&Mu(Dl)){var a=[];Nv(a,Dl,r,kh(r)),mv(eD,a)}}function tD(r,a,c){r==="focusin"?(Tv(),Rl=a,Dl=c,Rl.attachEvent("onpropertychange",kv)):r==="focusout"&&Tv()}function nD(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return Mu(Dl)}function oD(r,a){if(r==="click")return Mu(a)}function rD(r,a){if(r==="input"||r==="change")return Mu(a)}function sD(r,a){return r===a&&(r!==0||1/r===1/a)||r!==r&&a!==a}var fo=typeof Object.is=="function"?Object.is:sD;function Tl(r,a){if(fo(r,a))return!0;if(typeof r!="object"||r===null||typeof a!="object"||a===null)return!1;var c=Object.keys(r),h=Object.keys(a);if(c.length!==h.length)return!1;for(h=0;h<c.length;h++){var b=c[h];if(!ht.call(a,b)||!fo(r[b],a[b]))return!1}return!0}function jv(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function Av(r,a){var c=jv(r);r=0;for(var h;c;){if(c.nodeType===3){if(h=r+c.textContent.length,r<=a&&h>=a)return{node:c,offset:a-r};r=h}e:{for(;c;){if(c.nextSibling){c=c.nextSibling;break e}c=c.parentNode}c=void 0}c=jv(c)}}function Ov(r,a){return r&&a?r===a?!0:r&&r.nodeType===3?!1:a&&a.nodeType===3?Ov(r,a.parentNode):"contains"in r?r.contains(a):r.compareDocumentPosition?!!(r.compareDocumentPosition(a)&16):!1:!1}function zv(r){r=r!=null&&r.ownerDocument!=null&&r.ownerDocument.defaultView!=null?r.ownerDocument.defaultView:window;for(var a=en(r.document);a instanceof r.HTMLIFrameElement;){try{var c=typeof a.contentWindow.location.href=="string"}catch{c=!1}if(c)r=a.contentWindow;else break;a=en(r.document)}return a}function Fh(r){var a=r&&r.nodeName&&r.nodeName.toLowerCase();return a&&(a==="input"&&(r.type==="text"||r.type==="search"||r.type==="tel"||r.type==="url"||r.type==="password")||a==="textarea"||r.contentEditable==="true")}var aD=Lr&&"documentMode"in document&&11>=document.documentMode,ei=null,Vh=null,kl=null,Uh=!1;function Iv(r,a,c){var h=c.window===c?c.document:c.nodeType===9?c:c.ownerDocument;Uh||ei==null||ei!==en(h)||(h=ei,"selectionStart"in h&&Fh(h)?h={start:h.selectionStart,end:h.selectionEnd}:(h=(h.ownerDocument&&h.ownerDocument.defaultView||window).getSelection(),h={anchorNode:h.anchorNode,anchorOffset:h.anchorOffset,focusNode:h.focusNode,focusOffset:h.focusOffset}),kl&&Tl(kl,h)||(kl=h,h=gd(Vh,"onSelect"),0<h.length&&(a=new _u("onSelect","select",null,a,c),r.push({event:a,listeners:h}),a.target=ei)))}function ga(r,a){var c={};return c[r.toLowerCase()]=a.toLowerCase(),c["Webkit"+r]="webkit"+a,c["Moz"+r]="moz"+a,c}var ti={animationend:ga("Animation","AnimationEnd"),animationiteration:ga("Animation","AnimationIteration"),animationstart:ga("Animation","AnimationStart"),transitionrun:ga("Transition","TransitionRun"),transitionstart:ga("Transition","TransitionStart"),transitioncancel:ga("Transition","TransitionCancel"),transitionend:ga("Transition","TransitionEnd")},Yh={},Pv={};Lr&&(Pv=document.createElement("div").style,"AnimationEvent"in window||(delete ti.animationend.animation,delete ti.animationiteration.animation,delete ti.animationstart.animation),"TransitionEvent"in window||delete ti.transitionend.transition);function pa(r){if(Yh[r])return Yh[r];if(!ti[r])return r;var a=ti[r],c;for(c in a)if(a.hasOwnProperty(c)&&c in Pv)return Yh[r]=a[c];return r}var $v=pa("animationend"),Lv=pa("animationiteration"),Hv=pa("animationstart"),iD=pa("transitionrun"),lD=pa("transitionstart"),cD=pa("transitioncancel"),Bv=pa("transitionend"),Fv=new Map,Gh="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(" ");Gh.push("scrollEnd");function Go(r,a){Fv.set(r,a),Ae(a,[r])}var Ru=typeof reportError=="function"?reportError:function(r){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var a=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof r=="object"&&r!==null&&typeof r.message=="string"?String(r.message):String(r),error:r});if(!window.dispatchEvent(a))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",r);return}console.error(r)},ko=[],ni=0,qh=0;function Du(){for(var r=ni,a=qh=ni=0;a<r;){var c=ko[a];ko[a++]=null;var h=ko[a];ko[a++]=null;var b=ko[a];ko[a++]=null;var _=ko[a];if(ko[a++]=null,h!==null&&b!==null){var j=h.pending;j===null?b.next=b:(b.next=j.next,j.next=b),h.pending=b}_!==0&&Vv(c,b,_)}}function Tu(r,a,c,h){ko[ni++]=r,ko[ni++]=a,ko[ni++]=c,ko[ni++]=h,qh|=h,r.lanes|=h,r=r.alternate,r!==null&&(r.lanes|=h)}function Wh(r,a,c,h){return Tu(r,a,c,h),ku(r)}function ya(r,a){return Tu(r,null,null,a),ku(r)}function Vv(r,a,c){r.lanes|=c;var h=r.alternate;h!==null&&(h.lanes|=c);for(var b=!1,_=r.return;_!==null;)_.childLanes|=c,h=_.alternate,h!==null&&(h.childLanes|=c),_.tag===22&&(r=_.stateNode,r===null||r._visibility&1||(b=!0)),r=_,_=_.return;return r.tag===3?(_=r.stateNode,b&&a!==null&&(b=31-Kt(c),r=_.hiddenUpdates,h=r[b],h===null?r[b]=[a]:h.push(a),a.lane=c|536870912),_):null}function ku(r){if(50<Jl)throw Jl=0,og=null,Error(o(185));for(var a=r.return;a!==null;)r=a,a=r.return;return r.tag===3?r.stateNode:null}var oi={};function uD(r,a,c,h){this.tag=r,this.key=c,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=a,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=h,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ho(r,a,c,h){return new uD(r,a,c,h)}function Kh(r){return r=r.prototype,!(!r||!r.isReactComponent)}function Hr(r,a){var c=r.alternate;return c===null?(c=ho(r.tag,a,r.key,r.mode),c.elementType=r.elementType,c.type=r.type,c.stateNode=r.stateNode,c.alternate=r,r.alternate=c):(c.pendingProps=a,c.type=r.type,c.flags=0,c.subtreeFlags=0,c.deletions=null),c.flags=r.flags&65011712,c.childLanes=r.childLanes,c.lanes=r.lanes,c.child=r.child,c.memoizedProps=r.memoizedProps,c.memoizedState=r.memoizedState,c.updateQueue=r.updateQueue,a=r.dependencies,c.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext},c.sibling=r.sibling,c.index=r.index,c.ref=r.ref,c.refCleanup=r.refCleanup,c}function Uv(r,a){r.flags&=65011714;var c=r.alternate;return c===null?(r.childLanes=0,r.lanes=a,r.child=null,r.subtreeFlags=0,r.memoizedProps=null,r.memoizedState=null,r.updateQueue=null,r.dependencies=null,r.stateNode=null):(r.childLanes=c.childLanes,r.lanes=c.lanes,r.child=c.child,r.subtreeFlags=0,r.deletions=null,r.memoizedProps=c.memoizedProps,r.memoizedState=c.memoizedState,r.updateQueue=c.updateQueue,r.type=c.type,a=c.dependencies,r.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext}),r}function ju(r,a,c,h,b,_){var j=0;if(h=r,typeof r=="function")Kh(r)&&(j=1);else if(typeof r=="string")j=g4(r,c,K.current)?26:r==="html"||r==="head"||r==="body"?27:5;else e:switch(r){case L:return r=ho(31,c,a,b),r.elementType=L,r.lanes=_,r;case C:return va(c.children,b,_,a);case S:j=8,b|=24;break;case N:return r=ho(12,c,a,b|2),r.elementType=N,r.lanes=_,r;case D:return r=ho(13,c,a,b),r.elementType=D,r.lanes=_,r;case T:return r=ho(19,c,a,b),r.elementType=T,r.lanes=_,r;default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case E:j=10;break e;case M:j=9;break e;case R:j=11;break e;case k:j=14;break e;case O:j=16,h=null;break e}j=29,c=Error(o(130,r===null?"null":typeof r,"")),h=null}return a=ho(j,c,a,b),a.elementType=r,a.type=h,a.lanes=_,a}function va(r,a,c,h){return r=ho(7,r,h,a),r.lanes=c,r}function Xh(r,a,c){return r=ho(6,r,null,a),r.lanes=c,r}function Yv(r){var a=ho(18,null,null,0);return a.stateNode=r,a}function Qh(r,a,c){return a=ho(4,r.children!==null?r.children:[],r.key,a),a.lanes=c,a.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},a}var Gv=new WeakMap;function jo(r,a){if(typeof r=="object"&&r!==null){var c=Gv.get(r);return c!==void 0?c:(a={value:r,source:a,stack:cn(a)},Gv.set(r,a),a)}return{value:r,source:a,stack:cn(a)}}var ri=[],si=0,Au=null,jl=0,Ao=[],Oo=0,Cs=null,ur=1,dr="";function Br(r,a){ri[si++]=jl,ri[si++]=Au,Au=r,jl=a}function qv(r,a,c){Ao[Oo++]=ur,Ao[Oo++]=dr,Ao[Oo++]=Cs,Cs=r;var h=ur;r=dr;var b=32-Kt(h)-1;h&=~(1<<b),c+=1;var _=32-Kt(a)+b;if(30<_){var j=b-b%5;_=(h&(1<<j)-1).toString(32),h>>=j,b-=j,ur=1<<32-Kt(a)+b|c<<b|h,dr=_+r}else ur=1<<_|c<<b|h,dr=r}function Zh(r){r.return!==null&&(Br(r,1),qv(r,1,0))}function Jh(r){for(;r===Au;)Au=ri[--si],ri[si]=null,jl=ri[--si],ri[si]=null;for(;r===Cs;)Cs=Ao[--Oo],Ao[Oo]=null,dr=Ao[--Oo],Ao[Oo]=null,ur=Ao[--Oo],Ao[Oo]=null}function Wv(r,a){Ao[Oo++]=ur,Ao[Oo++]=dr,Ao[Oo++]=Cs,ur=a.id,dr=a.overflow,Cs=r}var Ln=null,tn=null,wt=!1,Es=null,zo=!1,em=Error(o(519));function _s(r){var a=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Al(jo(a,r)),em}function Kv(r){var a=r.stateNode,c=r.type,h=r.memoizedProps;switch(a[fn]=r,a[Tn]=h,c){case"dialog":yt("cancel",a),yt("close",a);break;case"iframe":case"object":case"embed":yt("load",a);break;case"video":case"audio":for(c=0;c<tc.length;c++)yt(tc[c],a);break;case"source":yt("error",a);break;case"img":case"image":case"link":yt("error",a),yt("load",a);break;case"details":yt("toggle",a);break;case"input":yt("invalid",a),cr(a,h.value,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name,!0);break;case"select":yt("invalid",a);break;case"textarea":yt("invalid",a),Qt(a,h.value,h.defaultValue,h.children)}c=h.children,typeof c!="string"&&typeof c!="number"&&typeof c!="bigint"||a.textContent===""+c||h.suppressHydrationWarning===!0||fb(a.textContent,c)?(h.popover!=null&&(yt("beforetoggle",a),yt("toggle",a)),h.onScroll!=null&&yt("scroll",a),h.onScrollEnd!=null&&yt("scrollend",a),h.onClick!=null&&(a.onclick=$r),a=!0):a=!1,a||_s(r,!0)}function Xv(r){for(Ln=r.return;Ln;)switch(Ln.tag){case 5:case 31:case 13:zo=!1;return;case 27:case 3:zo=!0;return;default:Ln=Ln.return}}function ai(r){if(r!==Ln)return!1;if(!wt)return Xv(r),wt=!0,!1;var a=r.tag,c;if((c=a!==3&&a!==27)&&((c=a===5)&&(c=r.type,c=!(c!=="form"&&c!=="button")||vg(r.type,r.memoizedProps)),c=!c),c&&tn&&_s(r),Xv(r),a===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(o(317));tn=wb(r)}else if(a===31){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(o(317));tn=wb(r)}else a===27?(a=tn,Ls(r.type)?(r=Cg,Cg=null,tn=r):tn=a):tn=Ln?Po(r.stateNode.nextSibling):null;return!0}function xa(){tn=Ln=null,wt=!1}function tm(){var r=Es;return r!==null&&(ro===null?ro=r:ro.push.apply(ro,r),Es=null),r}function Al(r){Es===null?Es=[r]:Es.push(r)}var nm=$(null),ba=null,Fr=null;function Ns(r,a,c){U(nm,a._currentValue),a._currentValue=c}function Vr(r){r._currentValue=nm.current,I(nm)}function om(r,a,c){for(;r!==null;){var h=r.alternate;if((r.childLanes&a)!==a?(r.childLanes|=a,h!==null&&(h.childLanes|=a)):h!==null&&(h.childLanes&a)!==a&&(h.childLanes|=a),r===c)break;r=r.return}}function rm(r,a,c,h){var b=r.child;for(b!==null&&(b.return=r);b!==null;){var _=b.dependencies;if(_!==null){var j=b.child;_=_.firstContext;e:for(;_!==null;){var G=_;_=b;for(var te=0;te<a.length;te++)if(G.context===a[te]){_.lanes|=c,G=_.alternate,G!==null&&(G.lanes|=c),om(_.return,c,r),h||(j=null);break e}_=G.next}}else if(b.tag===18){if(j=b.return,j===null)throw Error(o(341));j.lanes|=c,_=j.alternate,_!==null&&(_.lanes|=c),om(j,c,r),j=null}else j=b.child;if(j!==null)j.return=b;else for(j=b;j!==null;){if(j===r){j=null;break}if(b=j.sibling,b!==null){b.return=j.return,j=b;break}j=j.return}b=j}}function ii(r,a,c,h){r=null;for(var b=a,_=!1;b!==null;){if(!_){if((b.flags&524288)!==0)_=!0;else if((b.flags&262144)!==0)break}if(b.tag===10){var j=b.alternate;if(j===null)throw Error(o(387));if(j=j.memoizedProps,j!==null){var G=b.type;fo(b.pendingProps.value,j.value)||(r!==null?r.push(G):r=[G])}}else if(b===X.current){if(j=b.alternate,j===null)throw Error(o(387));j.memoizedState.memoizedState!==b.memoizedState.memoizedState&&(r!==null?r.push(ac):r=[ac])}b=b.return}r!==null&&rm(a,r,c,h),a.flags|=262144}function Ou(r){for(r=r.firstContext;r!==null;){if(!fo(r.context._currentValue,r.memoizedValue))return!0;r=r.next}return!1}function wa(r){ba=r,Fr=null,r=r.dependencies,r!==null&&(r.firstContext=null)}function Hn(r){return Qv(ba,r)}function zu(r,a){return ba===null&&wa(r),Qv(r,a)}function Qv(r,a){var c=a._currentValue;if(a={context:a,memoizedValue:c,next:null},Fr===null){if(r===null)throw Error(o(308));Fr=a,r.dependencies={lanes:0,firstContext:a},r.flags|=524288}else Fr=Fr.next=a;return c}var dD=typeof AbortController<"u"?AbortController:function(){var r=[],a=this.signal={aborted:!1,addEventListener:function(c,h){r.push(h)}};this.abort=function(){a.aborted=!0,r.forEach(function(c){return c()})}},fD=t.unstable_scheduleCallback,hD=t.unstable_NormalPriority,wn={$$typeof:E,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function sm(){return{controller:new dD,data:new Map,refCount:0}}function Ol(r){r.refCount--,r.refCount===0&&fD(hD,function(){r.controller.abort()})}var zl=null,am=0,li=0,ci=null;function mD(r,a){if(zl===null){var c=zl=[];am=0,li=cg(),ci={status:"pending",value:void 0,then:function(h){c.push(h)}}}return am++,a.then(Zv,Zv),a}function Zv(){if(--am===0&&zl!==null){ci!==null&&(ci.status="fulfilled");var r=zl;zl=null,li=0,ci=null;for(var a=0;a<r.length;a++)(0,r[a])()}}function gD(r,a){var c=[],h={status:"pending",value:null,reason:null,then:function(b){c.push(b)}};return r.then(function(){h.status="fulfilled",h.value=a;for(var b=0;b<c.length;b++)(0,c[b])(a)},function(b){for(h.status="rejected",h.reason=b,b=0;b<c.length;b++)(0,c[b])(void 0)}),h}var Jv=A.S;A.S=function(r,a){I1=It(),typeof a=="object"&&a!==null&&typeof a.then=="function"&&mD(r,a),Jv!==null&&Jv(r,a)};var Sa=$(null);function im(){var r=Sa.current;return r!==null?r:Zt.pooledCache}function Iu(r,a){a===null?U(Sa,Sa.current):U(Sa,a.pool)}function ex(){var r=im();return r===null?null:{parent:wn._currentValue,pool:r}}var ui=Error(o(460)),lm=Error(o(474)),Pu=Error(o(542)),$u={then:function(){}};function tx(r){return r=r.status,r==="fulfilled"||r==="rejected"}function nx(r,a,c){switch(c=r[c],c===void 0?r.push(a):c!==a&&(a.then($r,$r),a=c),a.status){case"fulfilled":return a.value;case"rejected":throw r=a.reason,rx(r),r;default:if(typeof a.status=="string")a.then($r,$r);else{if(r=Zt,r!==null&&100<r.shellSuspendCounter)throw Error(o(482));r=a,r.status="pending",r.then(function(h){if(a.status==="pending"){var b=a;b.status="fulfilled",b.value=h}},function(h){if(a.status==="pending"){var b=a;b.status="rejected",b.reason=h}})}switch(a.status){case"fulfilled":return a.value;case"rejected":throw r=a.reason,rx(r),r}throw Ea=a,ui}}function Ca(r){try{var a=r._init;return a(r._payload)}catch(c){throw c!==null&&typeof c=="object"&&typeof c.then=="function"?(Ea=c,ui):c}}var Ea=null;function ox(){if(Ea===null)throw Error(o(459));var r=Ea;return Ea=null,r}function rx(r){if(r===ui||r===Pu)throw Error(o(483))}var di=null,Il=0;function Lu(r){var a=Il;return Il+=1,di===null&&(di=[]),nx(di,r,a)}function Pl(r,a){a=a.props.ref,r.ref=a!==void 0?a:null}function Hu(r,a){throw a.$$typeof===y?Error(o(525)):(r=Object.prototype.toString.call(a),Error(o(31,r==="[object Object]"?"object with keys {"+Object.keys(a).join(", ")+"}":r)))}function sx(r){function a(ae,re){if(r){var ue=ae.deletions;ue===null?(ae.deletions=[re],ae.flags|=16):ue.push(re)}}function c(ae,re){if(!r)return null;for(;re!==null;)a(ae,re),re=re.sibling;return null}function h(ae){for(var re=new Map;ae!==null;)ae.key!==null?re.set(ae.key,ae):re.set(ae.index,ae),ae=ae.sibling;return re}function b(ae,re){return ae=Hr(ae,re),ae.index=0,ae.sibling=null,ae}function _(ae,re,ue){return ae.index=ue,r?(ue=ae.alternate,ue!==null?(ue=ue.index,ue<re?(ae.flags|=67108866,re):ue):(ae.flags|=67108866,re)):(ae.flags|=1048576,re)}function j(ae){return r&&ae.alternate===null&&(ae.flags|=67108866),ae}function G(ae,re,ue,Ce){return re===null||re.tag!==6?(re=Xh(ue,ae.mode,Ce),re.return=ae,re):(re=b(re,ue),re.return=ae,re)}function te(ae,re,ue,Ce){var We=ue.type;return We===C?ye(ae,re,ue.props.children,Ce,ue.key):re!==null&&(re.elementType===We||typeof We=="object"&&We!==null&&We.$$typeof===O&&Ca(We)===re.type)?(re=b(re,ue.props),Pl(re,ue),re.return=ae,re):(re=ju(ue.type,ue.key,ue.props,null,ae.mode,Ce),Pl(re,ue),re.return=ae,re)}function fe(ae,re,ue,Ce){return re===null||re.tag!==4||re.stateNode.containerInfo!==ue.containerInfo||re.stateNode.implementation!==ue.implementation?(re=Qh(ue,ae.mode,Ce),re.return=ae,re):(re=b(re,ue.children||[]),re.return=ae,re)}function ye(ae,re,ue,Ce,We){return re===null||re.tag!==7?(re=va(ue,ae.mode,Ce,We),re.return=ae,re):(re=b(re,ue),re.return=ae,re)}function Ee(ae,re,ue){if(typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint")return re=Xh(""+re,ae.mode,ue),re.return=ae,re;if(typeof re=="object"&&re!==null){switch(re.$$typeof){case v:return ue=ju(re.type,re.key,re.props,null,ae.mode,ue),Pl(ue,re),ue.return=ae,ue;case w:return re=Qh(re,ae.mode,ue),re.return=ae,re;case O:return re=Ca(re),Ee(ae,re,ue)}if(V(re)||Y(re))return re=va(re,ae.mode,ue,null),re.return=ae,re;if(typeof re.then=="function")return Ee(ae,Lu(re),ue);if(re.$$typeof===E)return Ee(ae,zu(ae,re),ue);Hu(ae,re)}return null}function he(ae,re,ue,Ce){var We=re!==null?re.key:null;if(typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint")return We!==null?null:G(ae,re,""+ue,Ce);if(typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case v:return ue.key===We?te(ae,re,ue,Ce):null;case w:return ue.key===We?fe(ae,re,ue,Ce):null;case O:return ue=Ca(ue),he(ae,re,ue,Ce)}if(V(ue)||Y(ue))return We!==null?null:ye(ae,re,ue,Ce,null);if(typeof ue.then=="function")return he(ae,re,Lu(ue),Ce);if(ue.$$typeof===E)return he(ae,re,zu(ae,ue),Ce);Hu(ae,ue)}return null}function me(ae,re,ue,Ce,We){if(typeof Ce=="string"&&Ce!==""||typeof Ce=="number"||typeof Ce=="bigint")return ae=ae.get(ue)||null,G(re,ae,""+Ce,We);if(typeof Ce=="object"&&Ce!==null){switch(Ce.$$typeof){case v:return ae=ae.get(Ce.key===null?ue:Ce.key)||null,te(re,ae,Ce,We);case w:return ae=ae.get(Ce.key===null?ue:Ce.key)||null,fe(re,ae,Ce,We);case O:return Ce=Ca(Ce),me(ae,re,ue,Ce,We)}if(V(Ce)||Y(Ce))return ae=ae.get(ue)||null,ye(re,ae,Ce,We,null);if(typeof Ce.then=="function")return me(ae,re,ue,Lu(Ce),We);if(Ce.$$typeof===E)return me(ae,re,ue,zu(re,Ce),We);Hu(re,Ce)}return null}function $e(ae,re,ue,Ce){for(var We=null,kt=null,Ve=re,dt=re=0,bt=null;Ve!==null&&dt<ue.length;dt++){Ve.index>dt?(bt=Ve,Ve=null):bt=Ve.sibling;var jt=he(ae,Ve,ue[dt],Ce);if(jt===null){Ve===null&&(Ve=bt);break}r&&Ve&&jt.alternate===null&&a(ae,Ve),re=_(jt,re,dt),kt===null?We=jt:kt.sibling=jt,kt=jt,Ve=bt}if(dt===ue.length)return c(ae,Ve),wt&&Br(ae,dt),We;if(Ve===null){for(;dt<ue.length;dt++)Ve=Ee(ae,ue[dt],Ce),Ve!==null&&(re=_(Ve,re,dt),kt===null?We=Ve:kt.sibling=Ve,kt=Ve);return wt&&Br(ae,dt),We}for(Ve=h(Ve);dt<ue.length;dt++)bt=me(Ve,ae,dt,ue[dt],Ce),bt!==null&&(r&&bt.alternate!==null&&Ve.delete(bt.key===null?dt:bt.key),re=_(bt,re,dt),kt===null?We=bt:kt.sibling=bt,kt=bt);return r&&Ve.forEach(function(Us){return a(ae,Us)}),wt&&Br(ae,dt),We}function Xe(ae,re,ue,Ce){if(ue==null)throw Error(o(151));for(var We=null,kt=null,Ve=re,dt=re=0,bt=null,jt=ue.next();Ve!==null&&!jt.done;dt++,jt=ue.next()){Ve.index>dt?(bt=Ve,Ve=null):bt=Ve.sibling;var Us=he(ae,Ve,jt.value,Ce);if(Us===null){Ve===null&&(Ve=bt);break}r&&Ve&&Us.alternate===null&&a(ae,Ve),re=_(Us,re,dt),kt===null?We=Us:kt.sibling=Us,kt=Us,Ve=bt}if(jt.done)return c(ae,Ve),wt&&Br(ae,dt),We;if(Ve===null){for(;!jt.done;dt++,jt=ue.next())jt=Ee(ae,jt.value,Ce),jt!==null&&(re=_(jt,re,dt),kt===null?We=jt:kt.sibling=jt,kt=jt);return wt&&Br(ae,dt),We}for(Ve=h(Ve);!jt.done;dt++,jt=ue.next())jt=me(Ve,ae,dt,jt.value,Ce),jt!==null&&(r&&jt.alternate!==null&&Ve.delete(jt.key===null?dt:jt.key),re=_(jt,re,dt),kt===null?We=jt:kt.sibling=jt,kt=jt);return r&&Ve.forEach(function(N4){return a(ae,N4)}),wt&&Br(ae,dt),We}function Gt(ae,re,ue,Ce){if(typeof ue=="object"&&ue!==null&&ue.type===C&&ue.key===null&&(ue=ue.props.children),typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case v:e:{for(var We=ue.key;re!==null;){if(re.key===We){if(We=ue.type,We===C){if(re.tag===7){c(ae,re.sibling),Ce=b(re,ue.props.children),Ce.return=ae,ae=Ce;break e}}else if(re.elementType===We||typeof We=="object"&&We!==null&&We.$$typeof===O&&Ca(We)===re.type){c(ae,re.sibling),Ce=b(re,ue.props),Pl(Ce,ue),Ce.return=ae,ae=Ce;break e}c(ae,re);break}else a(ae,re);re=re.sibling}ue.type===C?(Ce=va(ue.props.children,ae.mode,Ce,ue.key),Ce.return=ae,ae=Ce):(Ce=ju(ue.type,ue.key,ue.props,null,ae.mode,Ce),Pl(Ce,ue),Ce.return=ae,ae=Ce)}return j(ae);case w:e:{for(We=ue.key;re!==null;){if(re.key===We)if(re.tag===4&&re.stateNode.containerInfo===ue.containerInfo&&re.stateNode.implementation===ue.implementation){c(ae,re.sibling),Ce=b(re,ue.children||[]),Ce.return=ae,ae=Ce;break e}else{c(ae,re);break}else a(ae,re);re=re.sibling}Ce=Qh(ue,ae.mode,Ce),Ce.return=ae,ae=Ce}return j(ae);case O:return ue=Ca(ue),Gt(ae,re,ue,Ce)}if(V(ue))return $e(ae,re,ue,Ce);if(Y(ue)){if(We=Y(ue),typeof We!="function")throw Error(o(150));return ue=We.call(ue),Xe(ae,re,ue,Ce)}if(typeof ue.then=="function")return Gt(ae,re,Lu(ue),Ce);if(ue.$$typeof===E)return Gt(ae,re,zu(ae,ue),Ce);Hu(ae,ue)}return typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint"?(ue=""+ue,re!==null&&re.tag===6?(c(ae,re.sibling),Ce=b(re,ue),Ce.return=ae,ae=Ce):(c(ae,re),Ce=Xh(ue,ae.mode,Ce),Ce.return=ae,ae=Ce),j(ae)):c(ae,re)}return function(ae,re,ue,Ce){try{Il=0;var We=Gt(ae,re,ue,Ce);return di=null,We}catch(Ve){if(Ve===ui||Ve===Pu)throw Ve;var kt=ho(29,Ve,null,ae.mode);return kt.lanes=Ce,kt.return=ae,kt}}}var _a=sx(!0),ax=sx(!1),Ms=!1;function cm(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function um(r,a){r=r.updateQueue,a.updateQueue===r&&(a.updateQueue={baseState:r.baseState,firstBaseUpdate:r.firstBaseUpdate,lastBaseUpdate:r.lastBaseUpdate,shared:r.shared,callbacks:null})}function Rs(r){return{lane:r,tag:0,payload:null,callback:null,next:null}}function Ds(r,a,c){var h=r.updateQueue;if(h===null)return null;if(h=h.shared,(zt&2)!==0){var b=h.pending;return b===null?a.next=a:(a.next=b.next,b.next=a),h.pending=a,a=ku(r),Vv(r,null,c),a}return Tu(r,h,a,c),ku(r)}function $l(r,a,c){if(a=a.updateQueue,a!==null&&(a=a.shared,(c&4194048)!==0)){var h=a.lanes;h&=r.pendingLanes,c|=h,a.lanes=c,vt(r,c)}}function dm(r,a){var c=r.updateQueue,h=r.alternate;if(h!==null&&(h=h.updateQueue,c===h)){var b=null,_=null;if(c=c.firstBaseUpdate,c!==null){do{var j={lane:c.lane,tag:c.tag,payload:c.payload,callback:null,next:null};_===null?b=_=j:_=_.next=j,c=c.next}while(c!==null);_===null?b=_=a:_=_.next=a}else b=_=a;c={baseState:h.baseState,firstBaseUpdate:b,lastBaseUpdate:_,shared:h.shared,callbacks:h.callbacks},r.updateQueue=c;return}r=c.lastBaseUpdate,r===null?c.firstBaseUpdate=a:r.next=a,c.lastBaseUpdate=a}var fm=!1;function Ll(){if(fm){var r=ci;if(r!==null)throw r}}function Hl(r,a,c,h){fm=!1;var b=r.updateQueue;Ms=!1;var _=b.firstBaseUpdate,j=b.lastBaseUpdate,G=b.shared.pending;if(G!==null){b.shared.pending=null;var te=G,fe=te.next;te.next=null,j===null?_=fe:j.next=fe,j=te;var ye=r.alternate;ye!==null&&(ye=ye.updateQueue,G=ye.lastBaseUpdate,G!==j&&(G===null?ye.firstBaseUpdate=fe:G.next=fe,ye.lastBaseUpdate=te))}if(_!==null){var Ee=b.baseState;j=0,ye=fe=te=null,G=_;do{var he=G.lane&-536870913,me=he!==G.lane;if(me?(xt&he)===he:(h&he)===he){he!==0&&he===li&&(fm=!0),ye!==null&&(ye=ye.next={lane:0,tag:G.tag,payload:G.payload,callback:null,next:null});e:{var $e=r,Xe=G;he=a;var Gt=c;switch(Xe.tag){case 1:if($e=Xe.payload,typeof $e=="function"){Ee=$e.call(Gt,Ee,he);break e}Ee=$e;break e;case 3:$e.flags=$e.flags&-65537|128;case 0:if($e=Xe.payload,he=typeof $e=="function"?$e.call(Gt,Ee,he):$e,he==null)break e;Ee=m({},Ee,he);break e;case 2:Ms=!0}}he=G.callback,he!==null&&(r.flags|=64,me&&(r.flags|=8192),me=b.callbacks,me===null?b.callbacks=[he]:me.push(he))}else me={lane:he,tag:G.tag,payload:G.payload,callback:G.callback,next:null},ye===null?(fe=ye=me,te=Ee):ye=ye.next=me,j|=he;if(G=G.next,G===null){if(G=b.shared.pending,G===null)break;me=G,G=me.next,me.next=null,b.lastBaseUpdate=me,b.shared.pending=null}}while(!0);ye===null&&(te=Ee),b.baseState=te,b.firstBaseUpdate=fe,b.lastBaseUpdate=ye,_===null&&(b.shared.lanes=0),Os|=j,r.lanes=j,r.memoizedState=Ee}}function ix(r,a){if(typeof r!="function")throw Error(o(191,r));r.call(a)}function lx(r,a){var c=r.callbacks;if(c!==null)for(r.callbacks=null,r=0;r<c.length;r++)ix(c[r],a)}var fi=$(null),Bu=$(0);function cx(r,a){r=Zr,U(Bu,r),U(fi,a),Zr=r|a.baseLanes}function hm(){U(Bu,Zr),U(fi,fi.current)}function mm(){Zr=Bu.current,I(fi),I(Bu)}var mo=$(null),Io=null;function Ts(r){var a=r.alternate;U(vn,vn.current&1),U(mo,r),Io===null&&(a===null||fi.current!==null||a.memoizedState!==null)&&(Io=r)}function gm(r){U(vn,vn.current),U(mo,r),Io===null&&(Io=r)}function ux(r){r.tag===22?(U(vn,vn.current),U(mo,r),Io===null&&(Io=r)):ks()}function ks(){U(vn,vn.current),U(mo,mo.current)}function go(r){I(mo),Io===r&&(Io=null),I(vn)}var vn=$(0);function Fu(r){for(var a=r;a!==null;){if(a.tag===13){var c=a.memoizedState;if(c!==null&&(c=c.dehydrated,c===null||wg(c)||Sg(c)))return a}else if(a.tag===19&&(a.memoizedProps.revealOrder==="forwards"||a.memoizedProps.revealOrder==="backwards"||a.memoizedProps.revealOrder==="unstable_legacy-backwards"||a.memoizedProps.revealOrder==="together")){if((a.flags&128)!==0)return a}else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===r)break;for(;a.sibling===null;){if(a.return===null||a.return===r)return null;a=a.return}a.sibling.return=a.return,a=a.sibling}return null}var Ur=0,ut=null,Ut=null,Sn=null,Vu=!1,hi=!1,Na=!1,Uu=0,Bl=0,mi=null,pD=0;function gn(){throw Error(o(321))}function pm(r,a){if(a===null)return!1;for(var c=0;c<a.length&&c<r.length;c++)if(!fo(r[c],a[c]))return!1;return!0}function ym(r,a,c,h,b,_){return Ur=_,ut=a,a.memoizedState=null,a.updateQueue=null,a.lanes=0,A.H=r===null||r.memoizedState===null?qx:jm,Na=!1,_=c(h,b),Na=!1,hi&&(_=fx(a,c,h,b)),dx(r),_}function dx(r){A.H=Ul;var a=Ut!==null&&Ut.next!==null;if(Ur=0,Sn=Ut=ut=null,Vu=!1,Bl=0,mi=null,a)throw Error(o(300));r===null||Cn||(r=r.dependencies,r!==null&&Ou(r)&&(Cn=!0))}function fx(r,a,c,h){ut=r;var b=0;do{if(hi&&(mi=null),Bl=0,hi=!1,25<=b)throw Error(o(301));if(b+=1,Sn=Ut=null,r.updateQueue!=null){var _=r.updateQueue;_.lastEffect=null,_.events=null,_.stores=null,_.memoCache!=null&&(_.memoCache.index=0)}A.H=Wx,_=a(c,h)}while(hi);return _}function yD(){var r=A.H,a=r.useState()[0];return a=typeof a.then=="function"?Fl(a):a,r=r.useState()[0],(Ut!==null?Ut.memoizedState:null)!==r&&(ut.flags|=1024),a}function vm(){var r=Uu!==0;return Uu=0,r}function xm(r,a,c){a.updateQueue=r.updateQueue,a.flags&=-2053,r.lanes&=~c}function bm(r){if(Vu){for(r=r.memoizedState;r!==null;){var a=r.queue;a!==null&&(a.pending=null),r=r.next}Vu=!1}Ur=0,Sn=Ut=ut=null,hi=!1,Bl=Uu=0,mi=null}function Xn(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Sn===null?ut.memoizedState=Sn=r:Sn=Sn.next=r,Sn}function xn(){if(Ut===null){var r=ut.alternate;r=r!==null?r.memoizedState:null}else r=Ut.next;var a=Sn===null?ut.memoizedState:Sn.next;if(a!==null)Sn=a,Ut=r;else{if(r===null)throw ut.alternate===null?Error(o(467)):Error(o(310));Ut=r,r={memoizedState:Ut.memoizedState,baseState:Ut.baseState,baseQueue:Ut.baseQueue,queue:Ut.queue,next:null},Sn===null?ut.memoizedState=Sn=r:Sn=Sn.next=r}return Sn}function Yu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Fl(r){var a=Bl;return Bl+=1,mi===null&&(mi=[]),r=nx(mi,r,a),a=ut,(Sn===null?a.memoizedState:Sn.next)===null&&(a=a.alternate,A.H=a===null||a.memoizedState===null?qx:jm),r}function Gu(r){if(r!==null&&typeof r=="object"){if(typeof r.then=="function")return Fl(r);if(r.$$typeof===E)return Hn(r)}throw Error(o(438,String(r)))}function wm(r){var a=null,c=ut.updateQueue;if(c!==null&&(a=c.memoCache),a==null){var h=ut.alternate;h!==null&&(h=h.updateQueue,h!==null&&(h=h.memoCache,h!=null&&(a={data:h.data.map(function(b){return b.slice()}),index:0})))}if(a==null&&(a={data:[],index:0}),c===null&&(c=Yu(),ut.updateQueue=c),c.memoCache=a,c=a.data[a.index],c===void 0)for(c=a.data[a.index]=Array(r),h=0;h<r;h++)c[h]=W;return a.index++,c}function Yr(r,a){return typeof a=="function"?a(r):a}function qu(r){var a=xn();return Sm(a,Ut,r)}function Sm(r,a,c){var h=r.queue;if(h===null)throw Error(o(311));h.lastRenderedReducer=c;var b=r.baseQueue,_=h.pending;if(_!==null){if(b!==null){var j=b.next;b.next=_.next,_.next=j}a.baseQueue=b=_,h.pending=null}if(_=r.baseState,b===null)r.memoizedState=_;else{a=b.next;var G=j=null,te=null,fe=a,ye=!1;do{var Ee=fe.lane&-536870913;if(Ee!==fe.lane?(xt&Ee)===Ee:(Ur&Ee)===Ee){var he=fe.revertLane;if(he===0)te!==null&&(te=te.next={lane:0,revertLane:0,gesture:null,action:fe.action,hasEagerState:fe.hasEagerState,eagerState:fe.eagerState,next:null}),Ee===li&&(ye=!0);else if((Ur&he)===he){fe=fe.next,he===li&&(ye=!0);continue}else Ee={lane:0,revertLane:fe.revertLane,gesture:null,action:fe.action,hasEagerState:fe.hasEagerState,eagerState:fe.eagerState,next:null},te===null?(G=te=Ee,j=_):te=te.next=Ee,ut.lanes|=he,Os|=he;Ee=fe.action,Na&&c(_,Ee),_=fe.hasEagerState?fe.eagerState:c(_,Ee)}else he={lane:Ee,revertLane:fe.revertLane,gesture:fe.gesture,action:fe.action,hasEagerState:fe.hasEagerState,eagerState:fe.eagerState,next:null},te===null?(G=te=he,j=_):te=te.next=he,ut.lanes|=Ee,Os|=Ee;fe=fe.next}while(fe!==null&&fe!==a);if(te===null?j=_:te.next=G,!fo(_,r.memoizedState)&&(Cn=!0,ye&&(c=ci,c!==null)))throw c;r.memoizedState=_,r.baseState=j,r.baseQueue=te,h.lastRenderedState=_}return b===null&&(h.lanes=0),[r.memoizedState,h.dispatch]}function Cm(r){var a=xn(),c=a.queue;if(c===null)throw Error(o(311));c.lastRenderedReducer=r;var h=c.dispatch,b=c.pending,_=a.memoizedState;if(b!==null){c.pending=null;var j=b=b.next;do _=r(_,j.action),j=j.next;while(j!==b);fo(_,a.memoizedState)||(Cn=!0),a.memoizedState=_,a.baseQueue===null&&(a.baseState=_),c.lastRenderedState=_}return[_,h]}function hx(r,a,c){var h=ut,b=xn(),_=wt;if(_){if(c===void 0)throw Error(o(407));c=c()}else c=a();var j=!fo((Ut||b).memoizedState,c);if(j&&(b.memoizedState=c,Cn=!0),b=b.queue,Nm(px.bind(null,h,b,r),[r]),b.getSnapshot!==a||j||Sn!==null&&Sn.memoizedState.tag&1){if(h.flags|=2048,gi(9,{destroy:void 0},gx.bind(null,h,b,c,a),null),Zt===null)throw Error(o(349));_||(Ur&127)!==0||mx(h,a,c)}return c}function mx(r,a,c){r.flags|=16384,r={getSnapshot:a,value:c},a=ut.updateQueue,a===null?(a=Yu(),ut.updateQueue=a,a.stores=[r]):(c=a.stores,c===null?a.stores=[r]:c.push(r))}function gx(r,a,c,h){a.value=c,a.getSnapshot=h,yx(a)&&vx(r)}function px(r,a,c){return c(function(){yx(a)&&vx(r)})}function yx(r){var a=r.getSnapshot;r=r.value;try{var c=a();return!fo(r,c)}catch{return!0}}function vx(r){var a=ya(r,2);a!==null&&so(a,r,2)}function Em(r){var a=Xn();if(typeof r=="function"){var c=r;if(r=c(),Na){Wt(!0);try{c()}finally{Wt(!1)}}}return a.memoizedState=a.baseState=r,a.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Yr,lastRenderedState:r},a}function xx(r,a,c,h){return r.baseState=c,Sm(r,Ut,typeof h=="function"?h:Yr)}function vD(r,a,c,h,b){if(Xu(r))throw Error(o(485));if(r=a.action,r!==null){var _={payload:b,action:r,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(j){_.listeners.push(j)}};A.T!==null?c(!0):_.isTransition=!1,h(_),c=a.pending,c===null?(_.next=a.pending=_,bx(a,_)):(_.next=c.next,a.pending=c.next=_)}}function bx(r,a){var c=a.action,h=a.payload,b=r.state;if(a.isTransition){var _=A.T,j={};A.T=j;try{var G=c(b,h),te=A.S;te!==null&&te(j,G),wx(r,a,G)}catch(fe){_m(r,a,fe)}finally{_!==null&&j.types!==null&&(_.types=j.types),A.T=_}}else try{_=c(b,h),wx(r,a,_)}catch(fe){_m(r,a,fe)}}function wx(r,a,c){c!==null&&typeof c=="object"&&typeof c.then=="function"?c.then(function(h){Sx(r,a,h)},function(h){return _m(r,a,h)}):Sx(r,a,c)}function Sx(r,a,c){a.status="fulfilled",a.value=c,Cx(a),r.state=c,a=r.pending,a!==null&&(c=a.next,c===a?r.pending=null:(c=c.next,a.next=c,bx(r,c)))}function _m(r,a,c){var h=r.pending;if(r.pending=null,h!==null){h=h.next;do a.status="rejected",a.reason=c,Cx(a),a=a.next;while(a!==h)}r.action=null}function Cx(r){r=r.listeners;for(var a=0;a<r.length;a++)(0,r[a])()}function Ex(r,a){return a}function _x(r,a){if(wt){var c=Zt.formState;if(c!==null){e:{var h=ut;if(wt){if(tn){t:{for(var b=tn,_=zo;b.nodeType!==8;){if(!_){b=null;break t}if(b=Po(b.nextSibling),b===null){b=null;break t}}_=b.data,b=_==="F!"||_==="F"?b:null}if(b){tn=Po(b.nextSibling),h=b.data==="F!";break e}}_s(h)}h=!1}h&&(a=c[0])}}return c=Xn(),c.memoizedState=c.baseState=a,h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ex,lastRenderedState:a},c.queue=h,c=Ux.bind(null,ut,h),h.dispatch=c,h=Em(!1),_=km.bind(null,ut,!1,h.queue),h=Xn(),b={state:a,dispatch:null,action:r,pending:null},h.queue=b,c=vD.bind(null,ut,b,_,c),b.dispatch=c,h.memoizedState=r,[a,c,!1]}function Nx(r){var a=xn();return Mx(a,Ut,r)}function Mx(r,a,c){if(a=Sm(r,a,Ex)[0],r=qu(Yr)[0],typeof a=="object"&&a!==null&&typeof a.then=="function")try{var h=Fl(a)}catch(j){throw j===ui?Pu:j}else h=a;a=xn();var b=a.queue,_=b.dispatch;return c!==a.memoizedState&&(ut.flags|=2048,gi(9,{destroy:void 0},xD.bind(null,b,c),null)),[h,_,r]}function xD(r,a){r.action=a}function Rx(r){var a=xn(),c=Ut;if(c!==null)return Mx(a,c,r);xn(),a=a.memoizedState,c=xn();var h=c.queue.dispatch;return c.memoizedState=r,[a,h,!1]}function gi(r,a,c,h){return r={tag:r,create:c,deps:h,inst:a,next:null},a=ut.updateQueue,a===null&&(a=Yu(),ut.updateQueue=a),c=a.lastEffect,c===null?a.lastEffect=r.next=r:(h=c.next,c.next=r,r.next=h,a.lastEffect=r),r}function Dx(){return xn().memoizedState}function Wu(r,a,c,h){var b=Xn();ut.flags|=r,b.memoizedState=gi(1|a,{destroy:void 0},c,h===void 0?null:h)}function Ku(r,a,c,h){var b=xn();h=h===void 0?null:h;var _=b.memoizedState.inst;Ut!==null&&h!==null&&pm(h,Ut.memoizedState.deps)?b.memoizedState=gi(a,_,c,h):(ut.flags|=r,b.memoizedState=gi(1|a,_,c,h))}function Tx(r,a){Wu(8390656,8,r,a)}function Nm(r,a){Ku(2048,8,r,a)}function bD(r){ut.flags|=4;var a=ut.updateQueue;if(a===null)a=Yu(),ut.updateQueue=a,a.events=[r];else{var c=a.events;c===null?a.events=[r]:c.push(r)}}function kx(r){var a=xn().memoizedState;return bD({ref:a,nextImpl:r}),function(){if((zt&2)!==0)throw Error(o(440));return a.impl.apply(void 0,arguments)}}function jx(r,a){return Ku(4,2,r,a)}function Ax(r,a){return Ku(4,4,r,a)}function Ox(r,a){if(typeof a=="function"){r=r();var c=a(r);return function(){typeof c=="function"?c():a(null)}}if(a!=null)return r=r(),a.current=r,function(){a.current=null}}function zx(r,a,c){c=c!=null?c.concat([r]):null,Ku(4,4,Ox.bind(null,a,r),c)}function Mm(){}function Ix(r,a){var c=xn();a=a===void 0?null:a;var h=c.memoizedState;return a!==null&&pm(a,h[1])?h[0]:(c.memoizedState=[r,a],r)}function Px(r,a){var c=xn();a=a===void 0?null:a;var h=c.memoizedState;if(a!==null&&pm(a,h[1]))return h[0];if(h=r(),Na){Wt(!0);try{r()}finally{Wt(!1)}}return c.memoizedState=[h,a],h}function Rm(r,a,c){return c===void 0||(Ur&1073741824)!==0&&(xt&261930)===0?r.memoizedState=a:(r.memoizedState=c,r=$1(),ut.lanes|=r,Os|=r,c)}function $x(r,a,c,h){return fo(c,a)?c:fi.current!==null?(r=Rm(r,c,h),fo(r,a)||(Cn=!0),r):(Ur&42)===0||(Ur&1073741824)!==0&&(xt&261930)===0?(Cn=!0,r.memoizedState=c):(r=$1(),ut.lanes|=r,Os|=r,a)}function Lx(r,a,c,h,b){var _=H.p;H.p=_!==0&&8>_?_:8;var j=A.T,G={};A.T=G,km(r,!1,a,c);try{var te=b(),fe=A.S;if(fe!==null&&fe(G,te),te!==null&&typeof te=="object"&&typeof te.then=="function"){var ye=gD(te,h);Vl(r,a,ye,vo(r))}else Vl(r,a,h,vo(r))}catch(Ee){Vl(r,a,{then:function(){},status:"rejected",reason:Ee},vo())}finally{H.p=_,j!==null&&G.types!==null&&(j.types=G.types),A.T=j}}function wD(){}function Dm(r,a,c,h){if(r.tag!==5)throw Error(o(476));var b=Hx(r).queue;Lx(r,b,a,P,c===null?wD:function(){return Bx(r),c(h)})}function Hx(r){var a=r.memoizedState;if(a!==null)return a;a={memoizedState:P,baseState:P,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Yr,lastRenderedState:P},next:null};var c={};return a.next={memoizedState:c,baseState:c,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Yr,lastRenderedState:c},next:null},r.memoizedState=a,r=r.alternate,r!==null&&(r.memoizedState=a),a}function Bx(r){var a=Hx(r);a.next===null&&(a=r.alternate.memoizedState),Vl(r,a.next.queue,{},vo())}function Tm(){return Hn(ac)}function Fx(){return xn().memoizedState}function Vx(){return xn().memoizedState}function SD(r){for(var a=r.return;a!==null;){switch(a.tag){case 24:case 3:var c=vo();r=Rs(c);var h=Ds(a,r,c);h!==null&&(so(h,a,c),$l(h,a,c)),a={cache:sm()},r.payload=a;return}a=a.return}}function CD(r,a,c){var h=vo();c={lane:h,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},Xu(r)?Yx(a,c):(c=Wh(r,a,c,h),c!==null&&(so(c,r,h),Gx(c,a,h)))}function Ux(r,a,c){var h=vo();Vl(r,a,c,h)}function Vl(r,a,c,h){var b={lane:h,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null};if(Xu(r))Yx(a,b);else{var _=r.alternate;if(r.lanes===0&&(_===null||_.lanes===0)&&(_=a.lastRenderedReducer,_!==null))try{var j=a.lastRenderedState,G=_(j,c);if(b.hasEagerState=!0,b.eagerState=G,fo(G,j))return Tu(r,a,b,0),Zt===null&&Du(),!1}catch{}if(c=Wh(r,a,b,h),c!==null)return so(c,r,h),Gx(c,a,h),!0}return!1}function km(r,a,c,h){if(h={lane:2,revertLane:cg(),gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},Xu(r)){if(a)throw Error(o(479))}else a=Wh(r,c,h,2),a!==null&&so(a,r,2)}function Xu(r){var a=r.alternate;return r===ut||a!==null&&a===ut}function Yx(r,a){hi=Vu=!0;var c=r.pending;c===null?a.next=a:(a.next=c.next,c.next=a),r.pending=a}function Gx(r,a,c){if((c&4194048)!==0){var h=a.lanes;h&=r.pendingLanes,c|=h,a.lanes=c,vt(r,c)}}var Ul={readContext:Hn,use:Gu,useCallback:gn,useContext:gn,useEffect:gn,useImperativeHandle:gn,useLayoutEffect:gn,useInsertionEffect:gn,useMemo:gn,useReducer:gn,useRef:gn,useState:gn,useDebugValue:gn,useDeferredValue:gn,useTransition:gn,useSyncExternalStore:gn,useId:gn,useHostTransitionStatus:gn,useFormState:gn,useActionState:gn,useOptimistic:gn,useMemoCache:gn,useCacheRefresh:gn};Ul.useEffectEvent=gn;var qx={readContext:Hn,use:Gu,useCallback:function(r,a){return Xn().memoizedState=[r,a===void 0?null:a],r},useContext:Hn,useEffect:Tx,useImperativeHandle:function(r,a,c){c=c!=null?c.concat([r]):null,Wu(4194308,4,Ox.bind(null,a,r),c)},useLayoutEffect:function(r,a){return Wu(4194308,4,r,a)},useInsertionEffect:function(r,a){Wu(4,2,r,a)},useMemo:function(r,a){var c=Xn();a=a===void 0?null:a;var h=r();if(Na){Wt(!0);try{r()}finally{Wt(!1)}}return c.memoizedState=[h,a],h},useReducer:function(r,a,c){var h=Xn();if(c!==void 0){var b=c(a);if(Na){Wt(!0);try{c(a)}finally{Wt(!1)}}}else b=a;return h.memoizedState=h.baseState=b,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:b},h.queue=r,r=r.dispatch=CD.bind(null,ut,r),[h.memoizedState,r]},useRef:function(r){var a=Xn();return r={current:r},a.memoizedState=r},useState:function(r){r=Em(r);var a=r.queue,c=Ux.bind(null,ut,a);return a.dispatch=c,[r.memoizedState,c]},useDebugValue:Mm,useDeferredValue:function(r,a){var c=Xn();return Rm(c,r,a)},useTransition:function(){var r=Em(!1);return r=Lx.bind(null,ut,r.queue,!0,!1),Xn().memoizedState=r,[!1,r]},useSyncExternalStore:function(r,a,c){var h=ut,b=Xn();if(wt){if(c===void 0)throw Error(o(407));c=c()}else{if(c=a(),Zt===null)throw Error(o(349));(xt&127)!==0||mx(h,a,c)}b.memoizedState=c;var _={value:c,getSnapshot:a};return b.queue=_,Tx(px.bind(null,h,_,r),[r]),h.flags|=2048,gi(9,{destroy:void 0},gx.bind(null,h,_,c,a),null),c},useId:function(){var r=Xn(),a=Zt.identifierPrefix;if(wt){var c=dr,h=ur;c=(h&~(1<<32-Kt(h)-1)).toString(32)+c,a="_"+a+"R_"+c,c=Uu++,0<c&&(a+="H"+c.toString(32)),a+="_"}else c=pD++,a="_"+a+"r_"+c.toString(32)+"_";return r.memoizedState=a},useHostTransitionStatus:Tm,useFormState:_x,useActionState:_x,useOptimistic:function(r){var a=Xn();a.memoizedState=a.baseState=r;var c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return a.queue=c,a=km.bind(null,ut,!0,c),c.dispatch=a,[r,a]},useMemoCache:wm,useCacheRefresh:function(){return Xn().memoizedState=SD.bind(null,ut)},useEffectEvent:function(r){var a=Xn(),c={impl:r};return a.memoizedState=c,function(){if((zt&2)!==0)throw Error(o(440));return c.impl.apply(void 0,arguments)}}},jm={readContext:Hn,use:Gu,useCallback:Ix,useContext:Hn,useEffect:Nm,useImperativeHandle:zx,useInsertionEffect:jx,useLayoutEffect:Ax,useMemo:Px,useReducer:qu,useRef:Dx,useState:function(){return qu(Yr)},useDebugValue:Mm,useDeferredValue:function(r,a){var c=xn();return $x(c,Ut.memoizedState,r,a)},useTransition:function(){var r=qu(Yr)[0],a=xn().memoizedState;return[typeof r=="boolean"?r:Fl(r),a]},useSyncExternalStore:hx,useId:Fx,useHostTransitionStatus:Tm,useFormState:Nx,useActionState:Nx,useOptimistic:function(r,a){var c=xn();return xx(c,Ut,r,a)},useMemoCache:wm,useCacheRefresh:Vx};jm.useEffectEvent=kx;var Wx={readContext:Hn,use:Gu,useCallback:Ix,useContext:Hn,useEffect:Nm,useImperativeHandle:zx,useInsertionEffect:jx,useLayoutEffect:Ax,useMemo:Px,useReducer:Cm,useRef:Dx,useState:function(){return Cm(Yr)},useDebugValue:Mm,useDeferredValue:function(r,a){var c=xn();return Ut===null?Rm(c,r,a):$x(c,Ut.memoizedState,r,a)},useTransition:function(){var r=Cm(Yr)[0],a=xn().memoizedState;return[typeof r=="boolean"?r:Fl(r),a]},useSyncExternalStore:hx,useId:Fx,useHostTransitionStatus:Tm,useFormState:Rx,useActionState:Rx,useOptimistic:function(r,a){var c=xn();return Ut!==null?xx(c,Ut,r,a):(c.baseState=r,[r,c.queue.dispatch])},useMemoCache:wm,useCacheRefresh:Vx};Wx.useEffectEvent=kx;function Am(r,a,c,h){a=r.memoizedState,c=c(h,a),c=c==null?a:m({},a,c),r.memoizedState=c,r.lanes===0&&(r.updateQueue.baseState=c)}var Om={enqueueSetState:function(r,a,c){r=r._reactInternals;var h=vo(),b=Rs(h);b.payload=a,c!=null&&(b.callback=c),a=Ds(r,b,h),a!==null&&(so(a,r,h),$l(a,r,h))},enqueueReplaceState:function(r,a,c){r=r._reactInternals;var h=vo(),b=Rs(h);b.tag=1,b.payload=a,c!=null&&(b.callback=c),a=Ds(r,b,h),a!==null&&(so(a,r,h),$l(a,r,h))},enqueueForceUpdate:function(r,a){r=r._reactInternals;var c=vo(),h=Rs(c);h.tag=2,a!=null&&(h.callback=a),a=Ds(r,h,c),a!==null&&(so(a,r,c),$l(a,r,c))}};function Kx(r,a,c,h,b,_,j){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(h,_,j):a.prototype&&a.prototype.isPureReactComponent?!Tl(c,h)||!Tl(b,_):!0}function Xx(r,a,c,h){r=a.state,typeof a.componentWillReceiveProps=="function"&&a.componentWillReceiveProps(c,h),typeof a.UNSAFE_componentWillReceiveProps=="function"&&a.UNSAFE_componentWillReceiveProps(c,h),a.state!==r&&Om.enqueueReplaceState(a,a.state,null)}function Ma(r,a){var c=a;if("ref"in a){c={};for(var h in a)h!=="ref"&&(c[h]=a[h])}if(r=r.defaultProps){c===a&&(c=m({},c));for(var b in r)c[b]===void 0&&(c[b]=r[b])}return c}function Qx(r){Ru(r)}function Zx(r){console.error(r)}function Jx(r){Ru(r)}function Qu(r,a){try{var c=r.onUncaughtError;c(a.value,{componentStack:a.stack})}catch(h){setTimeout(function(){throw h})}}function e1(r,a,c){try{var h=r.onCaughtError;h(c.value,{componentStack:c.stack,errorBoundary:a.tag===1?a.stateNode:null})}catch(b){setTimeout(function(){throw b})}}function zm(r,a,c){return c=Rs(c),c.tag=3,c.payload={element:null},c.callback=function(){Qu(r,a)},c}function t1(r){return r=Rs(r),r.tag=3,r}function n1(r,a,c,h){var b=c.type.getDerivedStateFromError;if(typeof b=="function"){var _=h.value;r.payload=function(){return b(_)},r.callback=function(){e1(a,c,h)}}var j=c.stateNode;j!==null&&typeof j.componentDidCatch=="function"&&(r.callback=function(){e1(a,c,h),typeof b!="function"&&(zs===null?zs=new Set([this]):zs.add(this));var G=h.stack;this.componentDidCatch(h.value,{componentStack:G!==null?G:""})})}function ED(r,a,c,h,b){if(c.flags|=32768,h!==null&&typeof h=="object"&&typeof h.then=="function"){if(a=c.alternate,a!==null&&ii(a,c,b,!0),c=mo.current,c!==null){switch(c.tag){case 31:case 13:return Io===null?cd():c.alternate===null&&pn===0&&(pn=3),c.flags&=-257,c.flags|=65536,c.lanes=b,h===$u?c.flags|=16384:(a=c.updateQueue,a===null?c.updateQueue=new Set([h]):a.add(h),ag(r,h,b)),!1;case 22:return c.flags|=65536,h===$u?c.flags|=16384:(a=c.updateQueue,a===null?(a={transitions:null,markerInstances:null,retryQueue:new Set([h])},c.updateQueue=a):(c=a.retryQueue,c===null?a.retryQueue=new Set([h]):c.add(h)),ag(r,h,b)),!1}throw Error(o(435,c.tag))}return ag(r,h,b),cd(),!1}if(wt)return a=mo.current,a!==null?((a.flags&65536)===0&&(a.flags|=256),a.flags|=65536,a.lanes=b,h!==em&&(r=Error(o(422),{cause:h}),Al(jo(r,c)))):(h!==em&&(a=Error(o(423),{cause:h}),Al(jo(a,c))),r=r.current.alternate,r.flags|=65536,b&=-b,r.lanes|=b,h=jo(h,c),b=zm(r.stateNode,h,b),dm(r,b),pn!==4&&(pn=2)),!1;var _=Error(o(520),{cause:h});if(_=jo(_,c),Zl===null?Zl=[_]:Zl.push(_),pn!==4&&(pn=2),a===null)return!0;h=jo(h,c),c=a;do{switch(c.tag){case 3:return c.flags|=65536,r=b&-b,c.lanes|=r,r=zm(c.stateNode,h,r),dm(c,r),!1;case 1:if(a=c.type,_=c.stateNode,(c.flags&128)===0&&(typeof a.getDerivedStateFromError=="function"||_!==null&&typeof _.componentDidCatch=="function"&&(zs===null||!zs.has(_))))return c.flags|=65536,b&=-b,c.lanes|=b,b=t1(b),n1(b,r,c,h),dm(c,b),!1}c=c.return}while(c!==null);return!1}var Im=Error(o(461)),Cn=!1;function Bn(r,a,c,h){a.child=r===null?ax(a,null,c,h):_a(a,r.child,c,h)}function o1(r,a,c,h,b){c=c.render;var _=a.ref;if("ref"in h){var j={};for(var G in h)G!=="ref"&&(j[G]=h[G])}else j=h;return wa(a),h=ym(r,a,c,j,_,b),G=vm(),r!==null&&!Cn?(xm(r,a,b),Gr(r,a,b)):(wt&&G&&Zh(a),a.flags|=1,Bn(r,a,h,b),a.child)}function r1(r,a,c,h,b){if(r===null){var _=c.type;return typeof _=="function"&&!Kh(_)&&_.defaultProps===void 0&&c.compare===null?(a.tag=15,a.type=_,s1(r,a,_,h,b)):(r=ju(c.type,null,h,a,a.mode,b),r.ref=a.ref,r.return=a,a.child=r)}if(_=r.child,!Um(r,b)){var j=_.memoizedProps;if(c=c.compare,c=c!==null?c:Tl,c(j,h)&&r.ref===a.ref)return Gr(r,a,b)}return a.flags|=1,r=Hr(_,h),r.ref=a.ref,r.return=a,a.child=r}function s1(r,a,c,h,b){if(r!==null){var _=r.memoizedProps;if(Tl(_,h)&&r.ref===a.ref)if(Cn=!1,a.pendingProps=h=_,Um(r,b))(r.flags&131072)!==0&&(Cn=!0);else return a.lanes=r.lanes,Gr(r,a,b)}return Pm(r,a,c,h,b)}function a1(r,a,c,h){var b=h.children,_=r!==null?r.memoizedState:null;if(r===null&&a.stateNode===null&&(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),h.mode==="hidden"){if((a.flags&128)!==0){if(_=_!==null?_.baseLanes|c:c,r!==null){for(h=a.child=r.child,b=0;h!==null;)b=b|h.lanes|h.childLanes,h=h.sibling;h=b&~_}else h=0,a.child=null;return i1(r,a,_,c,h)}if((c&536870912)!==0)a.memoizedState={baseLanes:0,cachePool:null},r!==null&&Iu(a,_!==null?_.cachePool:null),_!==null?cx(a,_):hm(),ux(a);else return h=a.lanes=536870912,i1(r,a,_!==null?_.baseLanes|c:c,c,h)}else _!==null?(Iu(a,_.cachePool),cx(a,_),ks(),a.memoizedState=null):(r!==null&&Iu(a,null),hm(),ks());return Bn(r,a,b,c),a.child}function Yl(r,a){return r!==null&&r.tag===22||a.stateNode!==null||(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.sibling}function i1(r,a,c,h,b){var _=im();return _=_===null?null:{parent:wn._currentValue,pool:_},a.memoizedState={baseLanes:c,cachePool:_},r!==null&&Iu(a,null),hm(),ux(a),r!==null&&ii(r,a,h,!0),a.childLanes=b,null}function Zu(r,a){return a=ed({mode:a.mode,children:a.children},r.mode),a.ref=r.ref,r.child=a,a.return=r,a}function l1(r,a,c){return _a(a,r.child,null,c),r=Zu(a,a.pendingProps),r.flags|=2,go(a),a.memoizedState=null,r}function _D(r,a,c){var h=a.pendingProps,b=(a.flags&128)!==0;if(a.flags&=-129,r===null){if(wt){if(h.mode==="hidden")return r=Zu(a,h),a.lanes=536870912,Yl(null,r);if(gm(a),(r=tn)?(r=bb(r,zo),r=r!==null&&r.data==="&"?r:null,r!==null&&(a.memoizedState={dehydrated:r,treeContext:Cs!==null?{id:ur,overflow:dr}:null,retryLane:536870912,hydrationErrors:null},c=Yv(r),c.return=a,a.child=c,Ln=a,tn=null)):r=null,r===null)throw _s(a);return a.lanes=536870912,null}return Zu(a,h)}var _=r.memoizedState;if(_!==null){var j=_.dehydrated;if(gm(a),b)if(a.flags&256)a.flags&=-257,a=l1(r,a,c);else if(a.memoizedState!==null)a.child=r.child,a.flags|=128,a=null;else throw Error(o(558));else if(Cn||ii(r,a,c,!1),b=(c&r.childLanes)!==0,Cn||b){if(h=Zt,h!==null&&(j=Dn(h,c),j!==0&&j!==_.retryLane))throw _.retryLane=j,ya(r,j),so(h,r,j),Im;cd(),a=l1(r,a,c)}else r=_.treeContext,tn=Po(j.nextSibling),Ln=a,wt=!0,Es=null,zo=!1,r!==null&&Wv(a,r),a=Zu(a,h),a.flags|=4096;return a}return r=Hr(r.child,{mode:h.mode,children:h.children}),r.ref=a.ref,a.child=r,r.return=a,r}function Ju(r,a){var c=a.ref;if(c===null)r!==null&&r.ref!==null&&(a.flags|=4194816);else{if(typeof c!="function"&&typeof c!="object")throw Error(o(284));(r===null||r.ref!==c)&&(a.flags|=4194816)}}function Pm(r,a,c,h,b){return wa(a),c=ym(r,a,c,h,void 0,b),h=vm(),r!==null&&!Cn?(xm(r,a,b),Gr(r,a,b)):(wt&&h&&Zh(a),a.flags|=1,Bn(r,a,c,b),a.child)}function c1(r,a,c,h,b,_){return wa(a),a.updateQueue=null,c=fx(a,h,c,b),dx(r),h=vm(),r!==null&&!Cn?(xm(r,a,_),Gr(r,a,_)):(wt&&h&&Zh(a),a.flags|=1,Bn(r,a,c,_),a.child)}function u1(r,a,c,h,b){if(wa(a),a.stateNode===null){var _=oi,j=c.contextType;typeof j=="object"&&j!==null&&(_=Hn(j)),_=new c(h,_),a.memoizedState=_.state!==null&&_.state!==void 0?_.state:null,_.updater=Om,a.stateNode=_,_._reactInternals=a,_=a.stateNode,_.props=h,_.state=a.memoizedState,_.refs={},cm(a),j=c.contextType,_.context=typeof j=="object"&&j!==null?Hn(j):oi,_.state=a.memoizedState,j=c.getDerivedStateFromProps,typeof j=="function"&&(Am(a,c,j,h),_.state=a.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof _.getSnapshotBeforeUpdate=="function"||typeof _.UNSAFE_componentWillMount!="function"&&typeof _.componentWillMount!="function"||(j=_.state,typeof _.componentWillMount=="function"&&_.componentWillMount(),typeof _.UNSAFE_componentWillMount=="function"&&_.UNSAFE_componentWillMount(),j!==_.state&&Om.enqueueReplaceState(_,_.state,null),Hl(a,h,_,b),Ll(),_.state=a.memoizedState),typeof _.componentDidMount=="function"&&(a.flags|=4194308),h=!0}else if(r===null){_=a.stateNode;var G=a.memoizedProps,te=Ma(c,G);_.props=te;var fe=_.context,ye=c.contextType;j=oi,typeof ye=="object"&&ye!==null&&(j=Hn(ye));var Ee=c.getDerivedStateFromProps;ye=typeof Ee=="function"||typeof _.getSnapshotBeforeUpdate=="function",G=a.pendingProps!==G,ye||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||(G||fe!==j)&&Xx(a,_,h,j),Ms=!1;var he=a.memoizedState;_.state=he,Hl(a,h,_,b),Ll(),fe=a.memoizedState,G||he!==fe||Ms?(typeof Ee=="function"&&(Am(a,c,Ee,h),fe=a.memoizedState),(te=Ms||Kx(a,c,te,h,he,fe,j))?(ye||typeof _.UNSAFE_componentWillMount!="function"&&typeof _.componentWillMount!="function"||(typeof _.componentWillMount=="function"&&_.componentWillMount(),typeof _.UNSAFE_componentWillMount=="function"&&_.UNSAFE_componentWillMount()),typeof _.componentDidMount=="function"&&(a.flags|=4194308)):(typeof _.componentDidMount=="function"&&(a.flags|=4194308),a.memoizedProps=h,a.memoizedState=fe),_.props=h,_.state=fe,_.context=j,h=te):(typeof _.componentDidMount=="function"&&(a.flags|=4194308),h=!1)}else{_=a.stateNode,um(r,a),j=a.memoizedProps,ye=Ma(c,j),_.props=ye,Ee=a.pendingProps,he=_.context,fe=c.contextType,te=oi,typeof fe=="object"&&fe!==null&&(te=Hn(fe)),G=c.getDerivedStateFromProps,(fe=typeof G=="function"||typeof _.getSnapshotBeforeUpdate=="function")||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||(j!==Ee||he!==te)&&Xx(a,_,h,te),Ms=!1,he=a.memoizedState,_.state=he,Hl(a,h,_,b),Ll();var me=a.memoizedState;j!==Ee||he!==me||Ms||r!==null&&r.dependencies!==null&&Ou(r.dependencies)?(typeof G=="function"&&(Am(a,c,G,h),me=a.memoizedState),(ye=Ms||Kx(a,c,ye,h,he,me,te)||r!==null&&r.dependencies!==null&&Ou(r.dependencies))?(fe||typeof _.UNSAFE_componentWillUpdate!="function"&&typeof _.componentWillUpdate!="function"||(typeof _.componentWillUpdate=="function"&&_.componentWillUpdate(h,me,te),typeof _.UNSAFE_componentWillUpdate=="function"&&_.UNSAFE_componentWillUpdate(h,me,te)),typeof _.componentDidUpdate=="function"&&(a.flags|=4),typeof _.getSnapshotBeforeUpdate=="function"&&(a.flags|=1024)):(typeof _.componentDidUpdate!="function"||j===r.memoizedProps&&he===r.memoizedState||(a.flags|=4),typeof _.getSnapshotBeforeUpdate!="function"||j===r.memoizedProps&&he===r.memoizedState||(a.flags|=1024),a.memoizedProps=h,a.memoizedState=me),_.props=h,_.state=me,_.context=te,h=ye):(typeof _.componentDidUpdate!="function"||j===r.memoizedProps&&he===r.memoizedState||(a.flags|=4),typeof _.getSnapshotBeforeUpdate!="function"||j===r.memoizedProps&&he===r.memoizedState||(a.flags|=1024),h=!1)}return _=h,Ju(r,a),h=(a.flags&128)!==0,_||h?(_=a.stateNode,c=h&&typeof c.getDerivedStateFromError!="function"?null:_.render(),a.flags|=1,r!==null&&h?(a.child=_a(a,r.child,null,b),a.child=_a(a,null,c,b)):Bn(r,a,c,b),a.memoizedState=_.state,r=a.child):r=Gr(r,a,b),r}function d1(r,a,c,h){return xa(),a.flags|=256,Bn(r,a,c,h),a.child}var $m={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Lm(r){return{baseLanes:r,cachePool:ex()}}function Hm(r,a,c){return r=r!==null?r.childLanes&~c:0,a&&(r|=yo),r}function f1(r,a,c){var h=a.pendingProps,b=!1,_=(a.flags&128)!==0,j;if((j=_)||(j=r!==null&&r.memoizedState===null?!1:(vn.current&2)!==0),j&&(b=!0,a.flags&=-129),j=(a.flags&32)!==0,a.flags&=-33,r===null){if(wt){if(b?Ts(a):ks(),(r=tn)?(r=bb(r,zo),r=r!==null&&r.data!=="&"?r:null,r!==null&&(a.memoizedState={dehydrated:r,treeContext:Cs!==null?{id:ur,overflow:dr}:null,retryLane:536870912,hydrationErrors:null},c=Yv(r),c.return=a,a.child=c,Ln=a,tn=null)):r=null,r===null)throw _s(a);return Sg(r)?a.lanes=32:a.lanes=536870912,null}var G=h.children;return h=h.fallback,b?(ks(),b=a.mode,G=ed({mode:"hidden",children:G},b),h=va(h,b,c,null),G.return=a,h.return=a,G.sibling=h,a.child=G,h=a.child,h.memoizedState=Lm(c),h.childLanes=Hm(r,j,c),a.memoizedState=$m,Yl(null,h)):(Ts(a),Bm(a,G))}var te=r.memoizedState;if(te!==null&&(G=te.dehydrated,G!==null)){if(_)a.flags&256?(Ts(a),a.flags&=-257,a=Fm(r,a,c)):a.memoizedState!==null?(ks(),a.child=r.child,a.flags|=128,a=null):(ks(),G=h.fallback,b=a.mode,h=ed({mode:"visible",children:h.children},b),G=va(G,b,c,null),G.flags|=2,h.return=a,G.return=a,h.sibling=G,a.child=h,_a(a,r.child,null,c),h=a.child,h.memoizedState=Lm(c),h.childLanes=Hm(r,j,c),a.memoizedState=$m,a=Yl(null,h));else if(Ts(a),Sg(G)){if(j=G.nextSibling&&G.nextSibling.dataset,j)var fe=j.dgst;j=fe,h=Error(o(419)),h.stack="",h.digest=j,Al({value:h,source:null,stack:null}),a=Fm(r,a,c)}else if(Cn||ii(r,a,c,!1),j=(c&r.childLanes)!==0,Cn||j){if(j=Zt,j!==null&&(h=Dn(j,c),h!==0&&h!==te.retryLane))throw te.retryLane=h,ya(r,h),so(j,r,h),Im;wg(G)||cd(),a=Fm(r,a,c)}else wg(G)?(a.flags|=192,a.child=r.child,a=null):(r=te.treeContext,tn=Po(G.nextSibling),Ln=a,wt=!0,Es=null,zo=!1,r!==null&&Wv(a,r),a=Bm(a,h.children),a.flags|=4096);return a}return b?(ks(),G=h.fallback,b=a.mode,te=r.child,fe=te.sibling,h=Hr(te,{mode:"hidden",children:h.children}),h.subtreeFlags=te.subtreeFlags&65011712,fe!==null?G=Hr(fe,G):(G=va(G,b,c,null),G.flags|=2),G.return=a,h.return=a,h.sibling=G,a.child=h,Yl(null,h),h=a.child,G=r.child.memoizedState,G===null?G=Lm(c):(b=G.cachePool,b!==null?(te=wn._currentValue,b=b.parent!==te?{parent:te,pool:te}:b):b=ex(),G={baseLanes:G.baseLanes|c,cachePool:b}),h.memoizedState=G,h.childLanes=Hm(r,j,c),a.memoizedState=$m,Yl(r.child,h)):(Ts(a),c=r.child,r=c.sibling,c=Hr(c,{mode:"visible",children:h.children}),c.return=a,c.sibling=null,r!==null&&(j=a.deletions,j===null?(a.deletions=[r],a.flags|=16):j.push(r)),a.child=c,a.memoizedState=null,c)}function Bm(r,a){return a=ed({mode:"visible",children:a},r.mode),a.return=r,r.child=a}function ed(r,a){return r=ho(22,r,null,a),r.lanes=0,r}function Fm(r,a,c){return _a(a,r.child,null,c),r=Bm(a,a.pendingProps.children),r.flags|=2,a.memoizedState=null,r}function h1(r,a,c){r.lanes|=a;var h=r.alternate;h!==null&&(h.lanes|=a),om(r.return,a,c)}function Vm(r,a,c,h,b,_){var j=r.memoizedState;j===null?r.memoizedState={isBackwards:a,rendering:null,renderingStartTime:0,last:h,tail:c,tailMode:b,treeForkCount:_}:(j.isBackwards=a,j.rendering=null,j.renderingStartTime=0,j.last=h,j.tail=c,j.tailMode=b,j.treeForkCount=_)}function m1(r,a,c){var h=a.pendingProps,b=h.revealOrder,_=h.tail;h=h.children;var j=vn.current,G=(j&2)!==0;if(G?(j=j&1|2,a.flags|=128):j&=1,U(vn,j),Bn(r,a,h,c),h=wt?jl:0,!G&&r!==null&&(r.flags&128)!==0)e:for(r=a.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&h1(r,c,a);else if(r.tag===19)h1(r,c,a);else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===a)break e;for(;r.sibling===null;){if(r.return===null||r.return===a)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}switch(b){case"forwards":for(c=a.child,b=null;c!==null;)r=c.alternate,r!==null&&Fu(r)===null&&(b=c),c=c.sibling;c=b,c===null?(b=a.child,a.child=null):(b=c.sibling,c.sibling=null),Vm(a,!1,b,c,_,h);break;case"backwards":case"unstable_legacy-backwards":for(c=null,b=a.child,a.child=null;b!==null;){if(r=b.alternate,r!==null&&Fu(r)===null){a.child=b;break}r=b.sibling,b.sibling=c,c=b,b=r}Vm(a,!0,c,null,_,h);break;case"together":Vm(a,!1,null,null,void 0,h);break;default:a.memoizedState=null}return a.child}function Gr(r,a,c){if(r!==null&&(a.dependencies=r.dependencies),Os|=a.lanes,(c&a.childLanes)===0)if(r!==null){if(ii(r,a,c,!1),(c&a.childLanes)===0)return null}else return null;if(r!==null&&a.child!==r.child)throw Error(o(153));if(a.child!==null){for(r=a.child,c=Hr(r,r.pendingProps),a.child=c,c.return=a;r.sibling!==null;)r=r.sibling,c=c.sibling=Hr(r,r.pendingProps),c.return=a;c.sibling=null}return a.child}function Um(r,a){return(r.lanes&a)!==0?!0:(r=r.dependencies,!!(r!==null&&Ou(r)))}function ND(r,a,c){switch(a.tag){case 3:ee(a,a.stateNode.containerInfo),Ns(a,wn,r.memoizedState.cache),xa();break;case 27:case 5:le(a);break;case 4:ee(a,a.stateNode.containerInfo);break;case 10:Ns(a,a.type,a.memoizedProps.value);break;case 31:if(a.memoizedState!==null)return a.flags|=128,gm(a),null;break;case 13:var h=a.memoizedState;if(h!==null)return h.dehydrated!==null?(Ts(a),a.flags|=128,null):(c&a.child.childLanes)!==0?f1(r,a,c):(Ts(a),r=Gr(r,a,c),r!==null?r.sibling:null);Ts(a);break;case 19:var b=(r.flags&128)!==0;if(h=(c&a.childLanes)!==0,h||(ii(r,a,c,!1),h=(c&a.childLanes)!==0),b){if(h)return m1(r,a,c);a.flags|=128}if(b=a.memoizedState,b!==null&&(b.rendering=null,b.tail=null,b.lastEffect=null),U(vn,vn.current),h)break;return null;case 22:return a.lanes=0,a1(r,a,c,a.pendingProps);case 24:Ns(a,wn,r.memoizedState.cache)}return Gr(r,a,c)}function g1(r,a,c){if(r!==null)if(r.memoizedProps!==a.pendingProps)Cn=!0;else{if(!Um(r,c)&&(a.flags&128)===0)return Cn=!1,ND(r,a,c);Cn=(r.flags&131072)!==0}else Cn=!1,wt&&(a.flags&1048576)!==0&&qv(a,jl,a.index);switch(a.lanes=0,a.tag){case 16:e:{var h=a.pendingProps;if(r=Ca(a.elementType),a.type=r,typeof r=="function")Kh(r)?(h=Ma(r,h),a.tag=1,a=u1(null,a,r,h,c)):(a.tag=0,a=Pm(null,a,r,h,c));else{if(r!=null){var b=r.$$typeof;if(b===R){a.tag=11,a=o1(null,a,r,h,c);break e}else if(b===k){a.tag=14,a=r1(null,a,r,h,c);break e}}throw a=z(r)||r,Error(o(306,a,""))}}return a;case 0:return Pm(r,a,a.type,a.pendingProps,c);case 1:return h=a.type,b=Ma(h,a.pendingProps),u1(r,a,h,b,c);case 3:e:{if(ee(a,a.stateNode.containerInfo),r===null)throw Error(o(387));h=a.pendingProps;var _=a.memoizedState;b=_.element,um(r,a),Hl(a,h,null,c);var j=a.memoizedState;if(h=j.cache,Ns(a,wn,h),h!==_.cache&&rm(a,[wn],c,!0),Ll(),h=j.element,_.isDehydrated)if(_={element:h,isDehydrated:!1,cache:j.cache},a.updateQueue.baseState=_,a.memoizedState=_,a.flags&256){a=d1(r,a,h,c);break e}else if(h!==b){b=jo(Error(o(424)),a),Al(b),a=d1(r,a,h,c);break e}else for(r=a.stateNode.containerInfo,r.nodeType===9?r=r.body:r=r.nodeName==="HTML"?r.ownerDocument.body:r,tn=Po(r.firstChild),Ln=a,wt=!0,Es=null,zo=!0,c=ax(a,null,h,c),a.child=c;c;)c.flags=c.flags&-3|4096,c=c.sibling;else{if(xa(),h===b){a=Gr(r,a,c);break e}Bn(r,a,h,c)}a=a.child}return a;case 26:return Ju(r,a),r===null?(c=Nb(a.type,null,a.pendingProps,null))?a.memoizedState=c:wt||(c=a.type,r=a.pendingProps,h=pd(ne.current).createElement(c),h[fn]=a,h[Tn]=r,Fn(h,c,r),Se(h),a.stateNode=h):a.memoizedState=Nb(a.type,r.memoizedProps,a.pendingProps,r.memoizedState),null;case 27:return le(a),r===null&&wt&&(h=a.stateNode=Cb(a.type,a.pendingProps,ne.current),Ln=a,zo=!0,b=tn,Ls(a.type)?(Cg=b,tn=Po(h.firstChild)):tn=b),Bn(r,a,a.pendingProps.children,c),Ju(r,a),r===null&&(a.flags|=4194304),a.child;case 5:return r===null&&wt&&((b=h=tn)&&(h=n4(h,a.type,a.pendingProps,zo),h!==null?(a.stateNode=h,Ln=a,tn=Po(h.firstChild),zo=!1,b=!0):b=!1),b||_s(a)),le(a),b=a.type,_=a.pendingProps,j=r!==null?r.memoizedProps:null,h=_.children,vg(b,_)?h=null:j!==null&&vg(b,j)&&(a.flags|=32),a.memoizedState!==null&&(b=ym(r,a,yD,null,null,c),ac._currentValue=b),Ju(r,a),Bn(r,a,h,c),a.child;case 6:return r===null&&wt&&((r=c=tn)&&(c=o4(c,a.pendingProps,zo),c!==null?(a.stateNode=c,Ln=a,tn=null,r=!0):r=!1),r||_s(a)),null;case 13:return f1(r,a,c);case 4:return ee(a,a.stateNode.containerInfo),h=a.pendingProps,r===null?a.child=_a(a,null,h,c):Bn(r,a,h,c),a.child;case 11:return o1(r,a,a.type,a.pendingProps,c);case 7:return Bn(r,a,a.pendingProps,c),a.child;case 8:return Bn(r,a,a.pendingProps.children,c),a.child;case 12:return Bn(r,a,a.pendingProps.children,c),a.child;case 10:return h=a.pendingProps,Ns(a,a.type,h.value),Bn(r,a,h.children,c),a.child;case 9:return b=a.type._context,h=a.pendingProps.children,wa(a),b=Hn(b),h=h(b),a.flags|=1,Bn(r,a,h,c),a.child;case 14:return r1(r,a,a.type,a.pendingProps,c);case 15:return s1(r,a,a.type,a.pendingProps,c);case 19:return m1(r,a,c);case 31:return _D(r,a,c);case 22:return a1(r,a,c,a.pendingProps);case 24:return wa(a),h=Hn(wn),r===null?(b=im(),b===null&&(b=Zt,_=sm(),b.pooledCache=_,_.refCount++,_!==null&&(b.pooledCacheLanes|=c),b=_),a.memoizedState={parent:h,cache:b},cm(a),Ns(a,wn,b)):((r.lanes&c)!==0&&(um(r,a),Hl(a,null,null,c),Ll()),b=r.memoizedState,_=a.memoizedState,b.parent!==h?(b={parent:h,cache:h},a.memoizedState=b,a.lanes===0&&(a.memoizedState=a.updateQueue.baseState=b),Ns(a,wn,h)):(h=_.cache,Ns(a,wn,h),h!==b.cache&&rm(a,[wn],c,!0))),Bn(r,a,a.pendingProps.children,c),a.child;case 29:throw a.pendingProps}throw Error(o(156,a.tag))}function qr(r){r.flags|=4}function Ym(r,a,c,h,b){if((a=(r.mode&32)!==0)&&(a=!1),a){if(r.flags|=16777216,(b&335544128)===b)if(r.stateNode.complete)r.flags|=8192;else if(F1())r.flags|=8192;else throw Ea=$u,lm}else r.flags&=-16777217}function p1(r,a){if(a.type!=="stylesheet"||(a.state.loading&4)!==0)r.flags&=-16777217;else if(r.flags|=16777216,!kb(a))if(F1())r.flags|=8192;else throw Ea=$u,lm}function td(r,a){a!==null&&(r.flags|=4),r.flags&16384&&(a=r.tag!==22?dn():536870912,r.lanes|=a,xi|=a)}function Gl(r,a){if(!wt)switch(r.tailMode){case"hidden":a=r.tail;for(var c=null;a!==null;)a.alternate!==null&&(c=a),a=a.sibling;c===null?r.tail=null:c.sibling=null;break;case"collapsed":c=r.tail;for(var h=null;c!==null;)c.alternate!==null&&(h=c),c=c.sibling;h===null?a||r.tail===null?r.tail=null:r.tail.sibling=null:h.sibling=null}}function nn(r){var a=r.alternate!==null&&r.alternate.child===r.child,c=0,h=0;if(a)for(var b=r.child;b!==null;)c|=b.lanes|b.childLanes,h|=b.subtreeFlags&65011712,h|=b.flags&65011712,b.return=r,b=b.sibling;else for(b=r.child;b!==null;)c|=b.lanes|b.childLanes,h|=b.subtreeFlags,h|=b.flags,b.return=r,b=b.sibling;return r.subtreeFlags|=h,r.childLanes=c,a}function MD(r,a,c){var h=a.pendingProps;switch(Jh(a),a.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return nn(a),null;case 1:return nn(a),null;case 3:return c=a.stateNode,h=null,r!==null&&(h=r.memoizedState.cache),a.memoizedState.cache!==h&&(a.flags|=2048),Vr(wn),se(),c.pendingContext&&(c.context=c.pendingContext,c.pendingContext=null),(r===null||r.child===null)&&(ai(a)?qr(a):r===null||r.memoizedState.isDehydrated&&(a.flags&256)===0||(a.flags|=1024,tm())),nn(a),null;case 26:var b=a.type,_=a.memoizedState;return r===null?(qr(a),_!==null?(nn(a),p1(a,_)):(nn(a),Ym(a,b,null,h,c))):_?_!==r.memoizedState?(qr(a),nn(a),p1(a,_)):(nn(a),a.flags&=-16777217):(r=r.memoizedProps,r!==h&&qr(a),nn(a),Ym(a,b,r,h,c)),null;case 27:if(pe(a),c=ne.current,b=a.type,r!==null&&a.stateNode!=null)r.memoizedProps!==h&&qr(a);else{if(!h){if(a.stateNode===null)throw Error(o(166));return nn(a),null}r=K.current,ai(a)?Kv(a):(r=Cb(b,h,c),a.stateNode=r,qr(a))}return nn(a),null;case 5:if(pe(a),b=a.type,r!==null&&a.stateNode!=null)r.memoizedProps!==h&&qr(a);else{if(!h){if(a.stateNode===null)throw Error(o(166));return nn(a),null}if(_=K.current,ai(a))Kv(a);else{var j=pd(ne.current);switch(_){case 1:_=j.createElementNS("http://www.w3.org/2000/svg",b);break;case 2:_=j.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;default:switch(b){case"svg":_=j.createElementNS("http://www.w3.org/2000/svg",b);break;case"math":_=j.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;case"script":_=j.createElement("div"),_.innerHTML="<script><\/script>",_=_.removeChild(_.firstChild);break;case"select":_=typeof h.is=="string"?j.createElement("select",{is:h.is}):j.createElement("select"),h.multiple?_.multiple=!0:h.size&&(_.size=h.size);break;default:_=typeof h.is=="string"?j.createElement(b,{is:h.is}):j.createElement(b)}}_[fn]=a,_[Tn]=h;e:for(j=a.child;j!==null;){if(j.tag===5||j.tag===6)_.appendChild(j.stateNode);else if(j.tag!==4&&j.tag!==27&&j.child!==null){j.child.return=j,j=j.child;continue}if(j===a)break e;for(;j.sibling===null;){if(j.return===null||j.return===a)break e;j=j.return}j.sibling.return=j.return,j=j.sibling}a.stateNode=_;e:switch(Fn(_,b,h),b){case"button":case"input":case"select":case"textarea":h=!!h.autoFocus;break e;case"img":h=!0;break e;default:h=!1}h&&qr(a)}}return nn(a),Ym(a,a.type,r===null?null:r.memoizedProps,a.pendingProps,c),null;case 6:if(r&&a.stateNode!=null)r.memoizedProps!==h&&qr(a);else{if(typeof h!="string"&&a.stateNode===null)throw Error(o(166));if(r=ne.current,ai(a)){if(r=a.stateNode,c=a.memoizedProps,h=null,b=Ln,b!==null)switch(b.tag){case 27:case 5:h=b.memoizedProps}r[fn]=a,r=!!(r.nodeValue===c||h!==null&&h.suppressHydrationWarning===!0||fb(r.nodeValue,c)),r||_s(a,!0)}else r=pd(r).createTextNode(h),r[fn]=a,a.stateNode=r}return nn(a),null;case 31:if(c=a.memoizedState,r===null||r.memoizedState!==null){if(h=ai(a),c!==null){if(r===null){if(!h)throw Error(o(318));if(r=a.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(o(557));r[fn]=a}else xa(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;nn(a),r=!1}else c=tm(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=c),r=!0;if(!r)return a.flags&256?(go(a),a):(go(a),null);if((a.flags&128)!==0)throw Error(o(558))}return nn(a),null;case 13:if(h=a.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(b=ai(a),h!==null&&h.dehydrated!==null){if(r===null){if(!b)throw Error(o(318));if(b=a.memoizedState,b=b!==null?b.dehydrated:null,!b)throw Error(o(317));b[fn]=a}else xa(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;nn(a),b=!1}else b=tm(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=b),b=!0;if(!b)return a.flags&256?(go(a),a):(go(a),null)}return go(a),(a.flags&128)!==0?(a.lanes=c,a):(c=h!==null,r=r!==null&&r.memoizedState!==null,c&&(h=a.child,b=null,h.alternate!==null&&h.alternate.memoizedState!==null&&h.alternate.memoizedState.cachePool!==null&&(b=h.alternate.memoizedState.cachePool.pool),_=null,h.memoizedState!==null&&h.memoizedState.cachePool!==null&&(_=h.memoizedState.cachePool.pool),_!==b&&(h.flags|=2048)),c!==r&&c&&(a.child.flags|=8192),td(a,a.updateQueue),nn(a),null);case 4:return se(),r===null&&hg(a.stateNode.containerInfo),nn(a),null;case 10:return Vr(a.type),nn(a),null;case 19:if(I(vn),h=a.memoizedState,h===null)return nn(a),null;if(b=(a.flags&128)!==0,_=h.rendering,_===null)if(b)Gl(h,!1);else{if(pn!==0||r!==null&&(r.flags&128)!==0)for(r=a.child;r!==null;){if(_=Fu(r),_!==null){for(a.flags|=128,Gl(h,!1),r=_.updateQueue,a.updateQueue=r,td(a,r),a.subtreeFlags=0,r=c,c=a.child;c!==null;)Uv(c,r),c=c.sibling;return U(vn,vn.current&1|2),wt&&Br(a,h.treeForkCount),a.child}r=r.sibling}h.tail!==null&&It()>ad&&(a.flags|=128,b=!0,Gl(h,!1),a.lanes=4194304)}else{if(!b)if(r=Fu(_),r!==null){if(a.flags|=128,b=!0,r=r.updateQueue,a.updateQueue=r,td(a,r),Gl(h,!0),h.tail===null&&h.tailMode==="hidden"&&!_.alternate&&!wt)return nn(a),null}else 2*It()-h.renderingStartTime>ad&&c!==536870912&&(a.flags|=128,b=!0,Gl(h,!1),a.lanes=4194304);h.isBackwards?(_.sibling=a.child,a.child=_):(r=h.last,r!==null?r.sibling=_:a.child=_,h.last=_)}return h.tail!==null?(r=h.tail,h.rendering=r,h.tail=r.sibling,h.renderingStartTime=It(),r.sibling=null,c=vn.current,U(vn,b?c&1|2:c&1),wt&&Br(a,h.treeForkCount),r):(nn(a),null);case 22:case 23:return go(a),mm(),h=a.memoizedState!==null,r!==null?r.memoizedState!==null!==h&&(a.flags|=8192):h&&(a.flags|=8192),h?(c&536870912)!==0&&(a.flags&128)===0&&(nn(a),a.subtreeFlags&6&&(a.flags|=8192)):nn(a),c=a.updateQueue,c!==null&&td(a,c.retryQueue),c=null,r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(c=r.memoizedState.cachePool.pool),h=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(h=a.memoizedState.cachePool.pool),h!==c&&(a.flags|=2048),r!==null&&I(Sa),null;case 24:return c=null,r!==null&&(c=r.memoizedState.cache),a.memoizedState.cache!==c&&(a.flags|=2048),Vr(wn),nn(a),null;case 25:return null;case 30:return null}throw Error(o(156,a.tag))}function RD(r,a){switch(Jh(a),a.tag){case 1:return r=a.flags,r&65536?(a.flags=r&-65537|128,a):null;case 3:return Vr(wn),se(),r=a.flags,(r&65536)!==0&&(r&128)===0?(a.flags=r&-65537|128,a):null;case 26:case 27:case 5:return pe(a),null;case 31:if(a.memoizedState!==null){if(go(a),a.alternate===null)throw Error(o(340));xa()}return r=a.flags,r&65536?(a.flags=r&-65537|128,a):null;case 13:if(go(a),r=a.memoizedState,r!==null&&r.dehydrated!==null){if(a.alternate===null)throw Error(o(340));xa()}return r=a.flags,r&65536?(a.flags=r&-65537|128,a):null;case 19:return I(vn),null;case 4:return se(),null;case 10:return Vr(a.type),null;case 22:case 23:return go(a),mm(),r!==null&&I(Sa),r=a.flags,r&65536?(a.flags=r&-65537|128,a):null;case 24:return Vr(wn),null;case 25:return null;default:return null}}function y1(r,a){switch(Jh(a),a.tag){case 3:Vr(wn),se();break;case 26:case 27:case 5:pe(a);break;case 4:se();break;case 31:a.memoizedState!==null&&go(a);break;case 13:go(a);break;case 19:I(vn);break;case 10:Vr(a.type);break;case 22:case 23:go(a),mm(),r!==null&&I(Sa);break;case 24:Vr(wn)}}function ql(r,a){try{var c=a.updateQueue,h=c!==null?c.lastEffect:null;if(h!==null){var b=h.next;c=b;do{if((c.tag&r)===r){h=void 0;var _=c.create,j=c.inst;h=_(),j.destroy=h}c=c.next}while(c!==b)}}catch(G){Bt(a,a.return,G)}}function js(r,a,c){try{var h=a.updateQueue,b=h!==null?h.lastEffect:null;if(b!==null){var _=b.next;h=_;do{if((h.tag&r)===r){var j=h.inst,G=j.destroy;if(G!==void 0){j.destroy=void 0,b=a;var te=c,fe=G;try{fe()}catch(ye){Bt(b,te,ye)}}}h=h.next}while(h!==_)}}catch(ye){Bt(a,a.return,ye)}}function v1(r){var a=r.updateQueue;if(a!==null){var c=r.stateNode;try{lx(a,c)}catch(h){Bt(r,r.return,h)}}}function x1(r,a,c){c.props=Ma(r.type,r.memoizedProps),c.state=r.memoizedState;try{c.componentWillUnmount()}catch(h){Bt(r,a,h)}}function Wl(r,a){try{var c=r.ref;if(c!==null){switch(r.tag){case 26:case 27:case 5:var h=r.stateNode;break;case 30:h=r.stateNode;break;default:h=r.stateNode}typeof c=="function"?r.refCleanup=c(h):c.current=h}}catch(b){Bt(r,a,b)}}function fr(r,a){var c=r.ref,h=r.refCleanup;if(c!==null)if(typeof h=="function")try{h()}catch(b){Bt(r,a,b)}finally{r.refCleanup=null,r=r.alternate,r!=null&&(r.refCleanup=null)}else if(typeof c=="function")try{c(null)}catch(b){Bt(r,a,b)}else c.current=null}function b1(r){var a=r.type,c=r.memoizedProps,h=r.stateNode;try{e:switch(a){case"button":case"input":case"select":case"textarea":c.autoFocus&&h.focus();break e;case"img":c.src?h.src=c.src:c.srcSet&&(h.srcset=c.srcSet)}}catch(b){Bt(r,r.return,b)}}function Gm(r,a,c){try{var h=r.stateNode;XD(h,r.type,c,a),h[Tn]=a}catch(b){Bt(r,r.return,b)}}function w1(r){return r.tag===5||r.tag===3||r.tag===26||r.tag===27&&Ls(r.type)||r.tag===4}function qm(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||w1(r.return))return null;r=r.return}for(r.sibling.return=r.return,r=r.sibling;r.tag!==5&&r.tag!==6&&r.tag!==18;){if(r.tag===27&&Ls(r.type)||r.flags&2||r.child===null||r.tag===4)continue e;r.child.return=r,r=r.child}if(!(r.flags&2))return r.stateNode}}function Wm(r,a,c){var h=r.tag;if(h===5||h===6)r=r.stateNode,a?(c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c).insertBefore(r,a):(a=c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c,a.appendChild(r),c=c._reactRootContainer,c!=null||a.onclick!==null||(a.onclick=$r));else if(h!==4&&(h===27&&Ls(r.type)&&(c=r.stateNode,a=null),r=r.child,r!==null))for(Wm(r,a,c),r=r.sibling;r!==null;)Wm(r,a,c),r=r.sibling}function nd(r,a,c){var h=r.tag;if(h===5||h===6)r=r.stateNode,a?c.insertBefore(r,a):c.appendChild(r);else if(h!==4&&(h===27&&Ls(r.type)&&(c=r.stateNode),r=r.child,r!==null))for(nd(r,a,c),r=r.sibling;r!==null;)nd(r,a,c),r=r.sibling}function S1(r){var a=r.stateNode,c=r.memoizedProps;try{for(var h=r.type,b=a.attributes;b.length;)a.removeAttributeNode(b[0]);Fn(a,h,c),a[fn]=r,a[Tn]=c}catch(_){Bt(r,r.return,_)}}var Wr=!1,En=!1,Km=!1,C1=typeof WeakSet=="function"?WeakSet:Set,zn=null;function DD(r,a){if(r=r.containerInfo,pg=Cd,r=zv(r),Fh(r)){if("selectionStart"in r)var c={start:r.selectionStart,end:r.selectionEnd};else e:{c=(c=r.ownerDocument)&&c.defaultView||window;var h=c.getSelection&&c.getSelection();if(h&&h.rangeCount!==0){c=h.anchorNode;var b=h.anchorOffset,_=h.focusNode;h=h.focusOffset;try{c.nodeType,_.nodeType}catch{c=null;break e}var j=0,G=-1,te=-1,fe=0,ye=0,Ee=r,he=null;t:for(;;){for(var me;Ee!==c||b!==0&&Ee.nodeType!==3||(G=j+b),Ee!==_||h!==0&&Ee.nodeType!==3||(te=j+h),Ee.nodeType===3&&(j+=Ee.nodeValue.length),(me=Ee.firstChild)!==null;)he=Ee,Ee=me;for(;;){if(Ee===r)break t;if(he===c&&++fe===b&&(G=j),he===_&&++ye===h&&(te=j),(me=Ee.nextSibling)!==null)break;Ee=he,he=Ee.parentNode}Ee=me}c=G===-1||te===-1?null:{start:G,end:te}}else c=null}c=c||{start:0,end:0}}else c=null;for(yg={focusedElem:r,selectionRange:c},Cd=!1,zn=a;zn!==null;)if(a=zn,r=a.child,(a.subtreeFlags&1028)!==0&&r!==null)r.return=a,zn=r;else for(;zn!==null;){switch(a=zn,_=a.alternate,r=a.flags,a.tag){case 0:if((r&4)!==0&&(r=a.updateQueue,r=r!==null?r.events:null,r!==null))for(c=0;c<r.length;c++)b=r[c],b.ref.impl=b.nextImpl;break;case 11:case 15:break;case 1:if((r&1024)!==0&&_!==null){r=void 0,c=a,b=_.memoizedProps,_=_.memoizedState,h=c.stateNode;try{var $e=Ma(c.type,b);r=h.getSnapshotBeforeUpdate($e,_),h.__reactInternalSnapshotBeforeUpdate=r}catch(Xe){Bt(c,c.return,Xe)}}break;case 3:if((r&1024)!==0){if(r=a.stateNode.containerInfo,c=r.nodeType,c===9)bg(r);else if(c===1)switch(r.nodeName){case"HEAD":case"HTML":case"BODY":bg(r);break;default:r.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((r&1024)!==0)throw Error(o(163))}if(r=a.sibling,r!==null){r.return=a.return,zn=r;break}zn=a.return}}function E1(r,a,c){var h=c.flags;switch(c.tag){case 0:case 11:case 15:Xr(r,c),h&4&&ql(5,c);break;case 1:if(Xr(r,c),h&4)if(r=c.stateNode,a===null)try{r.componentDidMount()}catch(j){Bt(c,c.return,j)}else{var b=Ma(c.type,a.memoizedProps);a=a.memoizedState;try{r.componentDidUpdate(b,a,r.__reactInternalSnapshotBeforeUpdate)}catch(j){Bt(c,c.return,j)}}h&64&&v1(c),h&512&&Wl(c,c.return);break;case 3:if(Xr(r,c),h&64&&(r=c.updateQueue,r!==null)){if(a=null,c.child!==null)switch(c.child.tag){case 27:case 5:a=c.child.stateNode;break;case 1:a=c.child.stateNode}try{lx(r,a)}catch(j){Bt(c,c.return,j)}}break;case 27:a===null&&h&4&&S1(c);case 26:case 5:Xr(r,c),a===null&&h&4&&b1(c),h&512&&Wl(c,c.return);break;case 12:Xr(r,c);break;case 31:Xr(r,c),h&4&&M1(r,c);break;case 13:Xr(r,c),h&4&&R1(r,c),h&64&&(r=c.memoizedState,r!==null&&(r=r.dehydrated,r!==null&&(c=$D.bind(null,c),r4(r,c))));break;case 22:if(h=c.memoizedState!==null||Wr,!h){a=a!==null&&a.memoizedState!==null||En,b=Wr;var _=En;Wr=h,(En=a)&&!_?Qr(r,c,(c.subtreeFlags&8772)!==0):Xr(r,c),Wr=b,En=_}break;case 30:break;default:Xr(r,c)}}function _1(r){var a=r.alternate;a!==null&&(r.alternate=null,_1(a)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(a=r.stateNode,a!==null&&ve(a)),r.stateNode=null,r.return=null,r.dependencies=null,r.memoizedProps=null,r.memoizedState=null,r.pendingProps=null,r.stateNode=null,r.updateQueue=null}var rn=null,to=!1;function Kr(r,a,c){for(c=c.child;c!==null;)N1(r,a,c),c=c.sibling}function N1(r,a,c){if(gt&&typeof gt.onCommitFiberUnmount=="function")try{gt.onCommitFiberUnmount(st,c)}catch{}switch(c.tag){case 26:En||fr(c,a),Kr(r,a,c),c.memoizedState?c.memoizedState.count--:c.stateNode&&(c=c.stateNode,c.parentNode.removeChild(c));break;case 27:En||fr(c,a);var h=rn,b=to;Ls(c.type)&&(rn=c.stateNode,to=!1),Kr(r,a,c),oc(c.stateNode),rn=h,to=b;break;case 5:En||fr(c,a);case 6:if(h=rn,b=to,rn=null,Kr(r,a,c),rn=h,to=b,rn!==null)if(to)try{(rn.nodeType===9?rn.body:rn.nodeName==="HTML"?rn.ownerDocument.body:rn).removeChild(c.stateNode)}catch(_){Bt(c,a,_)}else try{rn.removeChild(c.stateNode)}catch(_){Bt(c,a,_)}break;case 18:rn!==null&&(to?(r=rn,vb(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,c.stateNode),Mi(r)):vb(rn,c.stateNode));break;case 4:h=rn,b=to,rn=c.stateNode.containerInfo,to=!0,Kr(r,a,c),rn=h,to=b;break;case 0:case 11:case 14:case 15:js(2,c,a),En||js(4,c,a),Kr(r,a,c);break;case 1:En||(fr(c,a),h=c.stateNode,typeof h.componentWillUnmount=="function"&&x1(c,a,h)),Kr(r,a,c);break;case 21:Kr(r,a,c);break;case 22:En=(h=En)||c.memoizedState!==null,Kr(r,a,c),En=h;break;default:Kr(r,a,c)}}function M1(r,a){if(a.memoizedState===null&&(r=a.alternate,r!==null&&(r=r.memoizedState,r!==null))){r=r.dehydrated;try{Mi(r)}catch(c){Bt(a,a.return,c)}}}function R1(r,a){if(a.memoizedState===null&&(r=a.alternate,r!==null&&(r=r.memoizedState,r!==null&&(r=r.dehydrated,r!==null))))try{Mi(r)}catch(c){Bt(a,a.return,c)}}function TD(r){switch(r.tag){case 31:case 13:case 19:var a=r.stateNode;return a===null&&(a=r.stateNode=new C1),a;case 22:return r=r.stateNode,a=r._retryCache,a===null&&(a=r._retryCache=new C1),a;default:throw Error(o(435,r.tag))}}function od(r,a){var c=TD(r);a.forEach(function(h){if(!c.has(h)){c.add(h);var b=LD.bind(null,r,h);h.then(b,b)}})}function no(r,a){var c=a.deletions;if(c!==null)for(var h=0;h<c.length;h++){var b=c[h],_=r,j=a,G=j;e:for(;G!==null;){switch(G.tag){case 27:if(Ls(G.type)){rn=G.stateNode,to=!1;break e}break;case 5:rn=G.stateNode,to=!1;break e;case 3:case 4:rn=G.stateNode.containerInfo,to=!0;break e}G=G.return}if(rn===null)throw Error(o(160));N1(_,j,b),rn=null,to=!1,_=b.alternate,_!==null&&(_.return=null),b.return=null}if(a.subtreeFlags&13886)for(a=a.child;a!==null;)D1(a,r),a=a.sibling}var qo=null;function D1(r,a){var c=r.alternate,h=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:no(a,r),oo(r),h&4&&(js(3,r,r.return),ql(3,r),js(5,r,r.return));break;case 1:no(a,r),oo(r),h&512&&(En||c===null||fr(c,c.return)),h&64&&Wr&&(r=r.updateQueue,r!==null&&(h=r.callbacks,h!==null&&(c=r.shared.hiddenCallbacks,r.shared.hiddenCallbacks=c===null?h:c.concat(h))));break;case 26:var b=qo;if(no(a,r),oo(r),h&512&&(En||c===null||fr(c,c.return)),h&4){var _=c!==null?c.memoizedState:null;if(h=r.memoizedState,c===null)if(h===null)if(r.stateNode===null){e:{h=r.type,c=r.memoizedProps,b=b.ownerDocument||b;t:switch(h){case"title":_=b.getElementsByTagName("title")[0],(!_||_[ce]||_[fn]||_.namespaceURI==="http://www.w3.org/2000/svg"||_.hasAttribute("itemprop"))&&(_=b.createElement(h),b.head.insertBefore(_,b.querySelector("head > title"))),Fn(_,h,c),_[fn]=r,Se(_),h=_;break e;case"link":var j=Db("link","href",b).get(h+(c.href||""));if(j){for(var G=0;G<j.length;G++)if(_=j[G],_.getAttribute("href")===(c.href==null||c.href===""?null:c.href)&&_.getAttribute("rel")===(c.rel==null?null:c.rel)&&_.getAttribute("title")===(c.title==null?null:c.title)&&_.getAttribute("crossorigin")===(c.crossOrigin==null?null:c.crossOrigin)){j.splice(G,1);break t}}_=b.createElement(h),Fn(_,h,c),b.head.appendChild(_);break;case"meta":if(j=Db("meta","content",b).get(h+(c.content||""))){for(G=0;G<j.length;G++)if(_=j[G],_.getAttribute("content")===(c.content==null?null:""+c.content)&&_.getAttribute("name")===(c.name==null?null:c.name)&&_.getAttribute("property")===(c.property==null?null:c.property)&&_.getAttribute("http-equiv")===(c.httpEquiv==null?null:c.httpEquiv)&&_.getAttribute("charset")===(c.charSet==null?null:c.charSet)){j.splice(G,1);break t}}_=b.createElement(h),Fn(_,h,c),b.head.appendChild(_);break;default:throw Error(o(468,h))}_[fn]=r,Se(_),h=_}r.stateNode=h}else Tb(b,r.type,r.stateNode);else r.stateNode=Rb(b,h,r.memoizedProps);else _!==h?(_===null?c.stateNode!==null&&(c=c.stateNode,c.parentNode.removeChild(c)):_.count--,h===null?Tb(b,r.type,r.stateNode):Rb(b,h,r.memoizedProps)):h===null&&r.stateNode!==null&&Gm(r,r.memoizedProps,c.memoizedProps)}break;case 27:no(a,r),oo(r),h&512&&(En||c===null||fr(c,c.return)),c!==null&&h&4&&Gm(r,r.memoizedProps,c.memoizedProps);break;case 5:if(no(a,r),oo(r),h&512&&(En||c===null||fr(c,c.return)),r.flags&32){b=r.stateNode;try{Rt(b,"")}catch($e){Bt(r,r.return,$e)}}h&4&&r.stateNode!=null&&(b=r.memoizedProps,Gm(r,b,c!==null?c.memoizedProps:b)),h&1024&&(Km=!0);break;case 6:if(no(a,r),oo(r),h&4){if(r.stateNode===null)throw Error(o(162));h=r.memoizedProps,c=r.stateNode;try{c.nodeValue=h}catch($e){Bt(r,r.return,$e)}}break;case 3:if(xd=null,b=qo,qo=yd(a.containerInfo),no(a,r),qo=b,oo(r),h&4&&c!==null&&c.memoizedState.isDehydrated)try{Mi(a.containerInfo)}catch($e){Bt(r,r.return,$e)}Km&&(Km=!1,T1(r));break;case 4:h=qo,qo=yd(r.stateNode.containerInfo),no(a,r),oo(r),qo=h;break;case 12:no(a,r),oo(r);break;case 31:no(a,r),oo(r),h&4&&(h=r.updateQueue,h!==null&&(r.updateQueue=null,od(r,h)));break;case 13:no(a,r),oo(r),r.child.flags&8192&&r.memoizedState!==null!=(c!==null&&c.memoizedState!==null)&&(sd=It()),h&4&&(h=r.updateQueue,h!==null&&(r.updateQueue=null,od(r,h)));break;case 22:b=r.memoizedState!==null;var te=c!==null&&c.memoizedState!==null,fe=Wr,ye=En;if(Wr=fe||b,En=ye||te,no(a,r),En=ye,Wr=fe,oo(r),h&8192)e:for(a=r.stateNode,a._visibility=b?a._visibility&-2:a._visibility|1,b&&(c===null||te||Wr||En||Ra(r)),c=null,a=r;;){if(a.tag===5||a.tag===26){if(c===null){te=c=a;try{if(_=te.stateNode,b)j=_.style,typeof j.setProperty=="function"?j.setProperty("display","none","important"):j.display="none";else{G=te.stateNode;var Ee=te.memoizedProps.style,he=Ee!=null&&Ee.hasOwnProperty("display")?Ee.display:null;G.style.display=he==null||typeof he=="boolean"?"":(""+he).trim()}}catch($e){Bt(te,te.return,$e)}}}else if(a.tag===6){if(c===null){te=a;try{te.stateNode.nodeValue=b?"":te.memoizedProps}catch($e){Bt(te,te.return,$e)}}}else if(a.tag===18){if(c===null){te=a;try{var me=te.stateNode;b?xb(me,!0):xb(te.stateNode,!1)}catch($e){Bt(te,te.return,$e)}}}else if((a.tag!==22&&a.tag!==23||a.memoizedState===null||a===r)&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===r)break e;for(;a.sibling===null;){if(a.return===null||a.return===r)break e;c===a&&(c=null),a=a.return}c===a&&(c=null),a.sibling.return=a.return,a=a.sibling}h&4&&(h=r.updateQueue,h!==null&&(c=h.retryQueue,c!==null&&(h.retryQueue=null,od(r,c))));break;case 19:no(a,r),oo(r),h&4&&(h=r.updateQueue,h!==null&&(r.updateQueue=null,od(r,h)));break;case 30:break;case 21:break;default:no(a,r),oo(r)}}function oo(r){var a=r.flags;if(a&2){try{for(var c,h=r.return;h!==null;){if(w1(h)){c=h;break}h=h.return}if(c==null)throw Error(o(160));switch(c.tag){case 27:var b=c.stateNode,_=qm(r);nd(r,_,b);break;case 5:var j=c.stateNode;c.flags&32&&(Rt(j,""),c.flags&=-33);var G=qm(r);nd(r,G,j);break;case 3:case 4:var te=c.stateNode.containerInfo,fe=qm(r);Wm(r,fe,te);break;default:throw Error(o(161))}}catch(ye){Bt(r,r.return,ye)}r.flags&=-3}a&4096&&(r.flags&=-4097)}function T1(r){if(r.subtreeFlags&1024)for(r=r.child;r!==null;){var a=r;T1(a),a.tag===5&&a.flags&1024&&a.stateNode.reset(),r=r.sibling}}function Xr(r,a){if(a.subtreeFlags&8772)for(a=a.child;a!==null;)E1(r,a.alternate,a),a=a.sibling}function Ra(r){for(r=r.child;r!==null;){var a=r;switch(a.tag){case 0:case 11:case 14:case 15:js(4,a,a.return),Ra(a);break;case 1:fr(a,a.return);var c=a.stateNode;typeof c.componentWillUnmount=="function"&&x1(a,a.return,c),Ra(a);break;case 27:oc(a.stateNode);case 26:case 5:fr(a,a.return),Ra(a);break;case 22:a.memoizedState===null&&Ra(a);break;case 30:Ra(a);break;default:Ra(a)}r=r.sibling}}function Qr(r,a,c){for(c=c&&(a.subtreeFlags&8772)!==0,a=a.child;a!==null;){var h=a.alternate,b=r,_=a,j=_.flags;switch(_.tag){case 0:case 11:case 15:Qr(b,_,c),ql(4,_);break;case 1:if(Qr(b,_,c),h=_,b=h.stateNode,typeof b.componentDidMount=="function")try{b.componentDidMount()}catch(fe){Bt(h,h.return,fe)}if(h=_,b=h.updateQueue,b!==null){var G=h.stateNode;try{var te=b.shared.hiddenCallbacks;if(te!==null)for(b.shared.hiddenCallbacks=null,b=0;b<te.length;b++)ix(te[b],G)}catch(fe){Bt(h,h.return,fe)}}c&&j&64&&v1(_),Wl(_,_.return);break;case 27:S1(_);case 26:case 5:Qr(b,_,c),c&&h===null&&j&4&&b1(_),Wl(_,_.return);break;case 12:Qr(b,_,c);break;case 31:Qr(b,_,c),c&&j&4&&M1(b,_);break;case 13:Qr(b,_,c),c&&j&4&&R1(b,_);break;case 22:_.memoizedState===null&&Qr(b,_,c),Wl(_,_.return);break;case 30:break;default:Qr(b,_,c)}a=a.sibling}}function Xm(r,a){var c=null;r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(c=r.memoizedState.cachePool.pool),r=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(r=a.memoizedState.cachePool.pool),r!==c&&(r!=null&&r.refCount++,c!=null&&Ol(c))}function Qm(r,a){r=null,a.alternate!==null&&(r=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==r&&(a.refCount++,r!=null&&Ol(r))}function Wo(r,a,c,h){if(a.subtreeFlags&10256)for(a=a.child;a!==null;)k1(r,a,c,h),a=a.sibling}function k1(r,a,c,h){var b=a.flags;switch(a.tag){case 0:case 11:case 15:Wo(r,a,c,h),b&2048&&ql(9,a);break;case 1:Wo(r,a,c,h);break;case 3:Wo(r,a,c,h),b&2048&&(r=null,a.alternate!==null&&(r=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==r&&(a.refCount++,r!=null&&Ol(r)));break;case 12:if(b&2048){Wo(r,a,c,h),r=a.stateNode;try{var _=a.memoizedProps,j=_.id,G=_.onPostCommit;typeof G=="function"&&G(j,a.alternate===null?"mount":"update",r.passiveEffectDuration,-0)}catch(te){Bt(a,a.return,te)}}else Wo(r,a,c,h);break;case 31:Wo(r,a,c,h);break;case 13:Wo(r,a,c,h);break;case 23:break;case 22:_=a.stateNode,j=a.alternate,a.memoizedState!==null?_._visibility&2?Wo(r,a,c,h):Kl(r,a):_._visibility&2?Wo(r,a,c,h):(_._visibility|=2,pi(r,a,c,h,(a.subtreeFlags&10256)!==0||!1)),b&2048&&Xm(j,a);break;case 24:Wo(r,a,c,h),b&2048&&Qm(a.alternate,a);break;default:Wo(r,a,c,h)}}function pi(r,a,c,h,b){for(b=b&&((a.subtreeFlags&10256)!==0||!1),a=a.child;a!==null;){var _=r,j=a,G=c,te=h,fe=j.flags;switch(j.tag){case 0:case 11:case 15:pi(_,j,G,te,b),ql(8,j);break;case 23:break;case 22:var ye=j.stateNode;j.memoizedState!==null?ye._visibility&2?pi(_,j,G,te,b):Kl(_,j):(ye._visibility|=2,pi(_,j,G,te,b)),b&&fe&2048&&Xm(j.alternate,j);break;case 24:pi(_,j,G,te,b),b&&fe&2048&&Qm(j.alternate,j);break;default:pi(_,j,G,te,b)}a=a.sibling}}function Kl(r,a){if(a.subtreeFlags&10256)for(a=a.child;a!==null;){var c=r,h=a,b=h.flags;switch(h.tag){case 22:Kl(c,h),b&2048&&Xm(h.alternate,h);break;case 24:Kl(c,h),b&2048&&Qm(h.alternate,h);break;default:Kl(c,h)}a=a.sibling}}var Xl=8192;function yi(r,a,c){if(r.subtreeFlags&Xl)for(r=r.child;r!==null;)j1(r,a,c),r=r.sibling}function j1(r,a,c){switch(r.tag){case 26:yi(r,a,c),r.flags&Xl&&r.memoizedState!==null&&p4(c,qo,r.memoizedState,r.memoizedProps);break;case 5:yi(r,a,c);break;case 3:case 4:var h=qo;qo=yd(r.stateNode.containerInfo),yi(r,a,c),qo=h;break;case 22:r.memoizedState===null&&(h=r.alternate,h!==null&&h.memoizedState!==null?(h=Xl,Xl=16777216,yi(r,a,c),Xl=h):yi(r,a,c));break;default:yi(r,a,c)}}function A1(r){var a=r.alternate;if(a!==null&&(r=a.child,r!==null)){a.child=null;do a=r.sibling,r.sibling=null,r=a;while(r!==null)}}function Ql(r){var a=r.deletions;if((r.flags&16)!==0){if(a!==null)for(var c=0;c<a.length;c++){var h=a[c];zn=h,z1(h,r)}A1(r)}if(r.subtreeFlags&10256)for(r=r.child;r!==null;)O1(r),r=r.sibling}function O1(r){switch(r.tag){case 0:case 11:case 15:Ql(r),r.flags&2048&&js(9,r,r.return);break;case 3:Ql(r);break;case 12:Ql(r);break;case 22:var a=r.stateNode;r.memoizedState!==null&&a._visibility&2&&(r.return===null||r.return.tag!==13)?(a._visibility&=-3,rd(r)):Ql(r);break;default:Ql(r)}}function rd(r){var a=r.deletions;if((r.flags&16)!==0){if(a!==null)for(var c=0;c<a.length;c++){var h=a[c];zn=h,z1(h,r)}A1(r)}for(r=r.child;r!==null;){switch(a=r,a.tag){case 0:case 11:case 15:js(8,a,a.return),rd(a);break;case 22:c=a.stateNode,c._visibility&2&&(c._visibility&=-3,rd(a));break;default:rd(a)}r=r.sibling}}function z1(r,a){for(;zn!==null;){var c=zn;switch(c.tag){case 0:case 11:case 15:js(8,c,a);break;case 23:case 22:if(c.memoizedState!==null&&c.memoizedState.cachePool!==null){var h=c.memoizedState.cachePool.pool;h!=null&&h.refCount++}break;case 24:Ol(c.memoizedState.cache)}if(h=c.child,h!==null)h.return=c,zn=h;else e:for(c=r;zn!==null;){h=zn;var b=h.sibling,_=h.return;if(_1(h),h===c){zn=null;break e}if(b!==null){b.return=_,zn=b;break e}zn=_}}}var kD={getCacheForType:function(r){var a=Hn(wn),c=a.data.get(r);return c===void 0&&(c=r(),a.data.set(r,c)),c},cacheSignal:function(){return Hn(wn).controller.signal}},jD=typeof WeakMap=="function"?WeakMap:Map,zt=0,Zt=null,pt=null,xt=0,Ht=0,po=null,As=!1,vi=!1,Zm=!1,Zr=0,pn=0,Os=0,Da=0,Jm=0,yo=0,xi=0,Zl=null,ro=null,eg=!1,sd=0,I1=0,ad=1/0,id=null,zs=null,jn=0,Is=null,bi=null,Jr=0,tg=0,ng=null,P1=null,Jl=0,og=null;function vo(){return(zt&2)!==0&&xt!==0?xt&-xt:A.T!==null?cg():lo()}function $1(){if(yo===0)if((xt&536870912)===0||wt){var r=Ye;Ye<<=1,(Ye&3932160)===0&&(Ye=262144),yo=r}else yo=536870912;return r=mo.current,r!==null&&(r.flags|=32),yo}function so(r,a,c){(r===Zt&&(Ht===2||Ht===9)||r.cancelPendingCommit!==null)&&(wi(r,0),Ps(r,xt,yo,!1)),Tt(r,c),((zt&2)===0||r!==Zt)&&(r===Zt&&((zt&2)===0&&(Da|=c),pn===4&&Ps(r,xt,yo,!1)),hr(r))}function L1(r,a,c){if((zt&6)!==0)throw Error(o(327));var h=!c&&(a&127)===0&&(a&r.expiredLanes)===0||At(r,a),b=h?zD(r,a):sg(r,a,!0),_=h;do{if(b===0){vi&&!h&&Ps(r,a,0,!1);break}else{if(c=r.current.alternate,_&&!AD(c)){b=sg(r,a,!1),_=!1;continue}if(b===2){if(_=a,r.errorRecoveryDisabledLanes&_)var j=0;else j=r.pendingLanes&-536870913,j=j!==0?j:j&536870912?536870912:0;if(j!==0){a=j;e:{var G=r;b=Zl;var te=G.current.memoizedState.isDehydrated;if(te&&(wi(G,j).flags|=256),j=sg(G,j,!1),j!==2){if(Zm&&!te){G.errorRecoveryDisabledLanes|=_,Da|=_,b=4;break e}_=ro,ro=b,_!==null&&(ro===null?ro=_:ro.push.apply(ro,_))}b=j}if(_=!1,b!==2)continue}}if(b===1){wi(r,0),Ps(r,a,0,!0);break}e:{switch(h=r,_=b,_){case 0:case 1:throw Error(o(345));case 4:if((a&4194048)!==a)break;case 6:Ps(h,a,yo,!As);break e;case 2:ro=null;break;case 3:case 5:break;default:throw Error(o(329))}if((a&62914560)===a&&(b=sd+300-It(),10<b)){if(Ps(h,a,yo,!As),De(h,0,!0)!==0)break e;Jr=a,h.timeoutHandle=pb(H1.bind(null,h,c,ro,id,eg,a,yo,Da,xi,As,_,"Throttled",-0,0),b);break e}H1(h,c,ro,id,eg,a,yo,Da,xi,As,_,null,-0,0)}}break}while(!0);hr(r)}function H1(r,a,c,h,b,_,j,G,te,fe,ye,Ee,he,me){if(r.timeoutHandle=-1,Ee=a.subtreeFlags,Ee&8192||(Ee&16785408)===16785408){Ee={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:$r},j1(a,_,Ee);var $e=(_&62914560)===_?sd-It():(_&4194048)===_?I1-It():0;if($e=y4(Ee,$e),$e!==null){Jr=_,r.cancelPendingCommit=$e(W1.bind(null,r,a,_,c,h,b,j,G,te,ye,Ee,null,he,me)),Ps(r,_,j,!fe);return}}W1(r,a,_,c,h,b,j,G,te)}function AD(r){for(var a=r;;){var c=a.tag;if((c===0||c===11||c===15)&&a.flags&16384&&(c=a.updateQueue,c!==null&&(c=c.stores,c!==null)))for(var h=0;h<c.length;h++){var b=c[h],_=b.getSnapshot;b=b.value;try{if(!fo(_(),b))return!1}catch{return!1}}if(c=a.child,a.subtreeFlags&16384&&c!==null)c.return=a,a=c;else{if(a===r)break;for(;a.sibling===null;){if(a.return===null||a.return===r)return!0;a=a.return}a.sibling.return=a.return,a=a.sibling}}return!0}function Ps(r,a,c,h){a&=~Jm,a&=~Da,r.suspendedLanes|=a,r.pingedLanes&=~a,h&&(r.warmLanes|=a),h=r.expirationTimes;for(var b=a;0<b;){var _=31-Kt(b),j=1<<_;h[_]=-1,b&=~j}c!==0&&Yo(r,c,a)}function ld(){return(zt&6)===0?(ec(0),!1):!0}function rg(){if(pt!==null){if(Ht===0)var r=pt.return;else r=pt,Fr=ba=null,bm(r),di=null,Il=0,r=pt;for(;r!==null;)y1(r.alternate,r),r=r.return;pt=null}}function wi(r,a){var c=r.timeoutHandle;c!==-1&&(r.timeoutHandle=-1,JD(c)),c=r.cancelPendingCommit,c!==null&&(r.cancelPendingCommit=null,c()),Jr=0,rg(),Zt=r,pt=c=Hr(r.current,null),xt=a,Ht=0,po=null,As=!1,vi=At(r,a),Zm=!1,xi=yo=Jm=Da=Os=pn=0,ro=Zl=null,eg=!1,(a&8)!==0&&(a|=a&32);var h=r.entangledLanes;if(h!==0)for(r=r.entanglements,h&=a;0<h;){var b=31-Kt(h),_=1<<b;a|=r[b],h&=~_}return Zr=a,Du(),c}function B1(r,a){ut=null,A.H=Ul,a===ui||a===Pu?(a=ox(),Ht=3):a===lm?(a=ox(),Ht=4):Ht=a===Im?8:a!==null&&typeof a=="object"&&typeof a.then=="function"?6:1,po=a,pt===null&&(pn=1,Qu(r,jo(a,r.current)))}function F1(){var r=mo.current;return r===null?!0:(xt&4194048)===xt?Io===null:(xt&62914560)===xt||(xt&536870912)!==0?r===Io:!1}function V1(){var r=A.H;return A.H=Ul,r===null?Ul:r}function U1(){var r=A.A;return A.A=kD,r}function cd(){pn=4,As||(xt&4194048)!==xt&&mo.current!==null||(vi=!0),(Os&134217727)===0&&(Da&134217727)===0||Zt===null||Ps(Zt,xt,yo,!1)}function sg(r,a,c){var h=zt;zt|=2;var b=V1(),_=U1();(Zt!==r||xt!==a)&&(id=null,wi(r,a)),a=!1;var j=pn;e:do try{if(Ht!==0&&pt!==null){var G=pt,te=po;switch(Ht){case 8:rg(),j=6;break e;case 3:case 2:case 9:case 6:mo.current===null&&(a=!0);var fe=Ht;if(Ht=0,po=null,Si(r,G,te,fe),c&&vi){j=0;break e}break;default:fe=Ht,Ht=0,po=null,Si(r,G,te,fe)}}OD(),j=pn;break}catch(ye){B1(r,ye)}while(!0);return a&&r.shellSuspendCounter++,Fr=ba=null,zt=h,A.H=b,A.A=_,pt===null&&(Zt=null,xt=0,Du()),j}function OD(){for(;pt!==null;)Y1(pt)}function zD(r,a){var c=zt;zt|=2;var h=V1(),b=U1();Zt!==r||xt!==a?(id=null,ad=It()+500,wi(r,a)):vi=At(r,a);e:do try{if(Ht!==0&&pt!==null){a=pt;var _=po;t:switch(Ht){case 1:Ht=0,po=null,Si(r,a,_,1);break;case 2:case 9:if(tx(_)){Ht=0,po=null,G1(a);break}a=function(){Ht!==2&&Ht!==9||Zt!==r||(Ht=7),hr(r)},_.then(a,a);break e;case 3:Ht=7;break e;case 4:Ht=5;break e;case 7:tx(_)?(Ht=0,po=null,G1(a)):(Ht=0,po=null,Si(r,a,_,7));break;case 5:var j=null;switch(pt.tag){case 26:j=pt.memoizedState;case 5:case 27:var G=pt;if(j?kb(j):G.stateNode.complete){Ht=0,po=null;var te=G.sibling;if(te!==null)pt=te;else{var fe=G.return;fe!==null?(pt=fe,ud(fe)):pt=null}break t}}Ht=0,po=null,Si(r,a,_,5);break;case 6:Ht=0,po=null,Si(r,a,_,6);break;case 8:rg(),pn=6;break e;default:throw Error(o(462))}}ID();break}catch(ye){B1(r,ye)}while(!0);return Fr=ba=null,A.H=h,A.A=b,zt=c,pt!==null?0:(Zt=null,xt=0,Du(),pn)}function ID(){for(;pt!==null&&!Vt();)Y1(pt)}function Y1(r){var a=g1(r.alternate,r,Zr);r.memoizedProps=r.pendingProps,a===null?ud(r):pt=a}function G1(r){var a=r,c=a.alternate;switch(a.tag){case 15:case 0:a=c1(c,a,a.pendingProps,a.type,void 0,xt);break;case 11:a=c1(c,a,a.pendingProps,a.type.render,a.ref,xt);break;case 5:bm(a);default:y1(c,a),a=pt=Uv(a,Zr),a=g1(c,a,Zr)}r.memoizedProps=r.pendingProps,a===null?ud(r):pt=a}function Si(r,a,c,h){Fr=ba=null,bm(a),di=null,Il=0;var b=a.return;try{if(ED(r,b,a,c,xt)){pn=1,Qu(r,jo(c,r.current)),pt=null;return}}catch(_){if(b!==null)throw pt=b,_;pn=1,Qu(r,jo(c,r.current)),pt=null;return}a.flags&32768?(wt||h===1?r=!0:vi||(xt&536870912)!==0?r=!1:(As=r=!0,(h===2||h===9||h===3||h===6)&&(h=mo.current,h!==null&&h.tag===13&&(h.flags|=16384))),q1(a,r)):ud(a)}function ud(r){var a=r;do{if((a.flags&32768)!==0){q1(a,As);return}r=a.return;var c=MD(a.alternate,a,Zr);if(c!==null){pt=c;return}if(a=a.sibling,a!==null){pt=a;return}pt=a=r}while(a!==null);pn===0&&(pn=5)}function q1(r,a){do{var c=RD(r.alternate,r);if(c!==null){c.flags&=32767,pt=c;return}if(c=r.return,c!==null&&(c.flags|=32768,c.subtreeFlags=0,c.deletions=null),!a&&(r=r.sibling,r!==null)){pt=r;return}pt=r=c}while(r!==null);pn=6,pt=null}function W1(r,a,c,h,b,_,j,G,te){r.cancelPendingCommit=null;do dd();while(jn!==0);if((zt&6)!==0)throw Error(o(327));if(a!==null){if(a===r.current)throw Error(o(177));if(_=a.lanes|a.childLanes,_|=qh,Rn(r,c,_,j,G,te),r===Zt&&(pt=Zt=null,xt=0),bi=a,Is=r,Jr=c,tg=_,ng=b,P1=h,(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?(r.callbackNode=null,r.callbackPriority=0,HD(On,function(){return J1(),null})):(r.callbackNode=null,r.callbackPriority=0),h=(a.flags&13878)!==0,(a.subtreeFlags&13878)!==0||h){h=A.T,A.T=null,b=H.p,H.p=2,j=zt,zt|=4;try{DD(r,a,c)}finally{zt=j,H.p=b,A.T=h}}jn=1,K1(),X1(),Q1()}}function K1(){if(jn===1){jn=0;var r=Is,a=bi,c=(a.flags&13878)!==0;if((a.subtreeFlags&13878)!==0||c){c=A.T,A.T=null;var h=H.p;H.p=2;var b=zt;zt|=4;try{D1(a,r);var _=yg,j=zv(r.containerInfo),G=_.focusedElem,te=_.selectionRange;if(j!==G&&G&&G.ownerDocument&&Ov(G.ownerDocument.documentElement,G)){if(te!==null&&Fh(G)){var fe=te.start,ye=te.end;if(ye===void 0&&(ye=fe),"selectionStart"in G)G.selectionStart=fe,G.selectionEnd=Math.min(ye,G.value.length);else{var Ee=G.ownerDocument||document,he=Ee&&Ee.defaultView||window;if(he.getSelection){var me=he.getSelection(),$e=G.textContent.length,Xe=Math.min(te.start,$e),Gt=te.end===void 0?Xe:Math.min(te.end,$e);!me.extend&&Xe>Gt&&(j=Gt,Gt=Xe,Xe=j);var ae=Av(G,Xe),re=Av(G,Gt);if(ae&&re&&(me.rangeCount!==1||me.anchorNode!==ae.node||me.anchorOffset!==ae.offset||me.focusNode!==re.node||me.focusOffset!==re.offset)){var ue=Ee.createRange();ue.setStart(ae.node,ae.offset),me.removeAllRanges(),Xe>Gt?(me.addRange(ue),me.extend(re.node,re.offset)):(ue.setEnd(re.node,re.offset),me.addRange(ue))}}}}for(Ee=[],me=G;me=me.parentNode;)me.nodeType===1&&Ee.push({element:me,left:me.scrollLeft,top:me.scrollTop});for(typeof G.focus=="function"&&G.focus(),G=0;G<Ee.length;G++){var Ce=Ee[G];Ce.element.scrollLeft=Ce.left,Ce.element.scrollTop=Ce.top}}Cd=!!pg,yg=pg=null}finally{zt=b,H.p=h,A.T=c}}r.current=a,jn=2}}function X1(){if(jn===2){jn=0;var r=Is,a=bi,c=(a.flags&8772)!==0;if((a.subtreeFlags&8772)!==0||c){c=A.T,A.T=null;var h=H.p;H.p=2;var b=zt;zt|=4;try{E1(r,a.alternate,a)}finally{zt=b,H.p=h,A.T=c}}jn=3}}function Q1(){if(jn===4||jn===3){jn=0,mn();var r=Is,a=bi,c=Jr,h=P1;(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?jn=5:(jn=0,bi=Is=null,Z1(r,r.pendingLanes));var b=r.pendingLanes;if(b===0&&(zs=null),Un(c),a=a.stateNode,gt&&typeof gt.onCommitFiberRoot=="function")try{gt.onCommitFiberRoot(st,a,void 0,(a.current.flags&128)===128)}catch{}if(h!==null){a=A.T,b=H.p,H.p=2,A.T=null;try{for(var _=r.onRecoverableError,j=0;j<h.length;j++){var G=h[j];_(G.value,{componentStack:G.stack})}}finally{A.T=a,H.p=b}}(Jr&3)!==0&&dd(),hr(r),b=r.pendingLanes,(c&261930)!==0&&(b&42)!==0?r===og?Jl++:(Jl=0,og=r):Jl=0,ec(0)}}function Z1(r,a){(r.pooledCacheLanes&=a)===0&&(a=r.pooledCache,a!=null&&(r.pooledCache=null,Ol(a)))}function dd(){return K1(),X1(),Q1(),J1()}function J1(){if(jn!==5)return!1;var r=Is,a=tg;tg=0;var c=Un(Jr),h=A.T,b=H.p;try{H.p=32>c?32:c,A.T=null,c=ng,ng=null;var _=Is,j=Jr;if(jn=0,bi=Is=null,Jr=0,(zt&6)!==0)throw Error(o(331));var G=zt;if(zt|=4,O1(_.current),k1(_,_.current,j,c),zt=G,ec(0,!1),gt&&typeof gt.onPostCommitFiberRoot=="function")try{gt.onPostCommitFiberRoot(st,_)}catch{}return!0}finally{H.p=b,A.T=h,Z1(r,a)}}function eb(r,a,c){a=jo(c,a),a=zm(r.stateNode,a,2),r=Ds(r,a,2),r!==null&&(Tt(r,2),hr(r))}function Bt(r,a,c){if(r.tag===3)eb(r,r,c);else for(;a!==null;){if(a.tag===3){eb(a,r,c);break}else if(a.tag===1){var h=a.stateNode;if(typeof a.type.getDerivedStateFromError=="function"||typeof h.componentDidCatch=="function"&&(zs===null||!zs.has(h))){r=jo(c,r),c=t1(2),h=Ds(a,c,2),h!==null&&(n1(c,h,a,r),Tt(h,2),hr(h));break}}a=a.return}}function ag(r,a,c){var h=r.pingCache;if(h===null){h=r.pingCache=new jD;var b=new Set;h.set(a,b)}else b=h.get(a),b===void 0&&(b=new Set,h.set(a,b));b.has(c)||(Zm=!0,b.add(c),r=PD.bind(null,r,a,c),a.then(r,r))}function PD(r,a,c){var h=r.pingCache;h!==null&&h.delete(a),r.pingedLanes|=r.suspendedLanes&c,r.warmLanes&=~c,Zt===r&&(xt&c)===c&&(pn===4||pn===3&&(xt&62914560)===xt&&300>It()-sd?(zt&2)===0&&wi(r,0):Jm|=c,xi===xt&&(xi=0)),hr(r)}function tb(r,a){a===0&&(a=dn()),r=ya(r,a),r!==null&&(Tt(r,a),hr(r))}function $D(r){var a=r.memoizedState,c=0;a!==null&&(c=a.retryLane),tb(r,c)}function LD(r,a){var c=0;switch(r.tag){case 31:case 13:var h=r.stateNode,b=r.memoizedState;b!==null&&(c=b.retryLane);break;case 19:h=r.stateNode;break;case 22:h=r.stateNode._retryCache;break;default:throw Error(o(314))}h!==null&&h.delete(a),tb(r,c)}function HD(r,a){return bn(r,a)}var fd=null,Ci=null,ig=!1,hd=!1,lg=!1,$s=0;function hr(r){r!==Ci&&r.next===null&&(Ci===null?fd=Ci=r:Ci=Ci.next=r),hd=!0,ig||(ig=!0,FD())}function ec(r,a){if(!lg&&hd){lg=!0;do for(var c=!1,h=fd;h!==null;){if(r!==0){var b=h.pendingLanes;if(b===0)var _=0;else{var j=h.suspendedLanes,G=h.pingedLanes;_=(1<<31-Kt(42|r)+1)-1,_&=b&~(j&~G),_=_&201326741?_&201326741|1:_?_|2:0}_!==0&&(c=!0,sb(h,_))}else _=xt,_=De(h,h===Zt?_:0,h.cancelPendingCommit!==null||h.timeoutHandle!==-1),(_&3)===0||At(h,_)||(c=!0,sb(h,_));h=h.next}while(c);lg=!1}}function BD(){nb()}function nb(){hd=ig=!1;var r=0;$s!==0&&ZD()&&(r=$s);for(var a=It(),c=null,h=fd;h!==null;){var b=h.next,_=ob(h,a);_===0?(h.next=null,c===null?fd=b:c.next=b,b===null&&(Ci=c)):(c=h,(r!==0||(_&3)!==0)&&(hd=!0)),h=b}jn!==0&&jn!==5||ec(r),$s!==0&&($s=0)}function ob(r,a){for(var c=r.suspendedLanes,h=r.pingedLanes,b=r.expirationTimes,_=r.pendingLanes&-62914561;0<_;){var j=31-Kt(_),G=1<<j,te=b[j];te===-1?((G&c)===0||(G&h)!==0)&&(b[j]=Xt(G,a)):te<=a&&(r.expiredLanes|=G),_&=~G}if(a=Zt,c=xt,c=De(r,r===a?c:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),h=r.callbackNode,c===0||r===a&&(Ht===2||Ht===9)||r.cancelPendingCommit!==null)return h!==null&&h!==null&&un(h),r.callbackNode=null,r.callbackPriority=0;if((c&3)===0||At(r,c)){if(a=c&-c,a===r.callbackPriority)return a;switch(h!==null&&un(h),Un(c)){case 2:case 8:c=In;break;case 32:c=On;break;case 268435456:c=Ue;break;default:c=On}return h=rb.bind(null,r),c=bn(c,h),r.callbackPriority=a,r.callbackNode=c,a}return h!==null&&h!==null&&un(h),r.callbackPriority=2,r.callbackNode=null,2}function rb(r,a){if(jn!==0&&jn!==5)return r.callbackNode=null,r.callbackPriority=0,null;var c=r.callbackNode;if(dd()&&r.callbackNode!==c)return null;var h=xt;return h=De(r,r===Zt?h:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),h===0?null:(L1(r,h,a),ob(r,It()),r.callbackNode!=null&&r.callbackNode===c?rb.bind(null,r):null)}function sb(r,a){if(dd())return null;L1(r,a,!0)}function FD(){e4(function(){(zt&6)!==0?bn(yn,BD):nb()})}function cg(){if($s===0){var r=li;r===0&&(r=nt,nt<<=1,(nt&261888)===0&&(nt=256)),$s=r}return $s}function ab(r){return r==null||typeof r=="symbol"||typeof r=="boolean"?null:typeof r=="function"?r:wu(""+r)}function ib(r,a){var c=a.ownerDocument.createElement("input");return c.name=a.name,c.value=a.value,r.id&&c.setAttribute("form",r.id),a.parentNode.insertBefore(c,a),r=new FormData(r),c.parentNode.removeChild(c),r}function VD(r,a,c,h,b){if(a==="submit"&&c&&c.stateNode===b){var _=ab((b[Tn]||null).action),j=h.submitter;j&&(a=(a=j[Tn]||null)?ab(a.formAction):j.getAttribute("formAction"),a!==null&&(_=a,j=null));var G=new _u("action","action",null,h,b);r.push({event:G,listeners:[{instance:null,listener:function(){if(h.defaultPrevented){if($s!==0){var te=j?ib(b,j):new FormData(b);Dm(c,{pending:!0,data:te,method:b.method,action:_},null,te)}}else typeof _=="function"&&(G.preventDefault(),te=j?ib(b,j):new FormData(b),Dm(c,{pending:!0,data:te,method:b.method,action:_},_,te))},currentTarget:b}]})}}for(var ug=0;ug<Gh.length;ug++){var dg=Gh[ug],UD=dg.toLowerCase(),YD=dg[0].toUpperCase()+dg.slice(1);Go(UD,"on"+YD)}Go($v,"onAnimationEnd"),Go(Lv,"onAnimationIteration"),Go(Hv,"onAnimationStart"),Go("dblclick","onDoubleClick"),Go("focusin","onFocus"),Go("focusout","onBlur"),Go(iD,"onTransitionRun"),Go(lD,"onTransitionStart"),Go(cD,"onTransitionCancel"),Go(Bv,"onTransitionEnd"),xe("onMouseEnter",["mouseout","mouseover"]),xe("onMouseLeave",["mouseout","mouseover"]),xe("onPointerEnter",["pointerout","pointerover"]),xe("onPointerLeave",["pointerout","pointerover"]),Ae("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ae("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ae("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ae("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ae("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ae("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var tc="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(" "),GD=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(tc));function lb(r,a){a=(a&4)!==0;for(var c=0;c<r.length;c++){var h=r[c],b=h.event;h=h.listeners;e:{var _=void 0;if(a)for(var j=h.length-1;0<=j;j--){var G=h[j],te=G.instance,fe=G.currentTarget;if(G=G.listener,te!==_&&b.isPropagationStopped())break e;_=G,b.currentTarget=fe;try{_(b)}catch(ye){Ru(ye)}b.currentTarget=null,_=te}else for(j=0;j<h.length;j++){if(G=h[j],te=G.instance,fe=G.currentTarget,G=G.listener,te!==_&&b.isPropagationStopped())break e;_=G,b.currentTarget=fe;try{_(b)}catch(ye){Ru(ye)}b.currentTarget=null,_=te}}}}function yt(r,a){var c=a[zr];c===void 0&&(c=a[zr]=new Set);var h=r+"__bubble";c.has(h)||(cb(a,r,2,!1),c.add(h))}function fg(r,a,c){var h=0;a&&(h|=4),cb(c,r,h,a)}var md="_reactListening"+Math.random().toString(36).slice(2);function hg(r){if(!r[md]){r[md]=!0,Re.forEach(function(c){c!=="selectionchange"&&(GD.has(c)||fg(c,!1,r),fg(c,!0,r))});var a=r.nodeType===9?r:r.ownerDocument;a===null||a[md]||(a[md]=!0,fg("selectionchange",!1,a))}}function cb(r,a,c,h){switch($b(a)){case 2:var b=b4;break;case 8:b=w4;break;default:b=Rg}c=b.bind(null,a,c,r),b=void 0,!Ah||a!=="touchstart"&&a!=="touchmove"&&a!=="wheel"||(b=!0),h?b!==void 0?r.addEventListener(a,c,{capture:!0,passive:b}):r.addEventListener(a,c,!0):b!==void 0?r.addEventListener(a,c,{passive:b}):r.addEventListener(a,c,!1)}function mg(r,a,c,h,b){var _=h;if((a&1)===0&&(a&2)===0&&h!==null)e:for(;;){if(h===null)return;var j=h.tag;if(j===3||j===4){var G=h.stateNode.containerInfo;if(G===b)break;if(j===4)for(j=h.return;j!==null;){var te=j.tag;if((te===3||te===4)&&j.stateNode.containerInfo===b)return;j=j.return}for(;G!==null;){if(j=we(G),j===null)return;if(te=j.tag,te===5||te===6||te===26||te===27){h=_=j;continue e}G=G.parentNode}}h=h.return}mv(function(){var fe=_,ye=kh(c),Ee=[];e:{var he=Fv.get(r);if(he!==void 0){var me=_u,$e=r;switch(r){case"keypress":if(Cu(c)===0)break e;case"keydown":case"keyup":me=L3;break;case"focusin":$e="focus",me=Ph;break;case"focusout":$e="blur",me=Ph;break;case"beforeblur":case"afterblur":me=Ph;break;case"click":if(c.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":me=yv;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":me=M3;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":me=F3;break;case $v:case Lv:case Hv:me=T3;break;case Bv:me=U3;break;case"scroll":case"scrollend":me=_3;break;case"wheel":me=G3;break;case"copy":case"cut":case"paste":me=j3;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":me=xv;break;case"toggle":case"beforetoggle":me=W3}var Xe=(a&4)!==0,Gt=!Xe&&(r==="scroll"||r==="scrollend"),ae=Xe?he!==null?he+"Capture":null:he;Xe=[];for(var re=fe,ue;re!==null;){var Ce=re;if(ue=Ce.stateNode,Ce=Ce.tag,Ce!==5&&Ce!==26&&Ce!==27||ue===null||ae===null||(Ce=Cl(re,ae),Ce!=null&&Xe.push(nc(re,Ce,ue))),Gt)break;re=re.return}0<Xe.length&&(he=new me(he,$e,null,c,ye),Ee.push({event:he,listeners:Xe}))}}if((a&7)===0){e:{if(he=r==="mouseover"||r==="pointerover",me=r==="mouseout"||r==="pointerout",he&&c!==Th&&($e=c.relatedTarget||c.fromElement)&&(we($e)||$e[To]))break e;if((me||he)&&(he=ye.window===ye?ye:(he=ye.ownerDocument)?he.defaultView||he.parentWindow:window,me?($e=c.relatedTarget||c.toElement,me=fe,$e=$e?we($e):null,$e!==null&&(Gt=i($e),Xe=$e.tag,$e!==Gt||Xe!==5&&Xe!==27&&Xe!==6)&&($e=null)):(me=null,$e=fe),me!==$e)){if(Xe=yv,Ce="onMouseLeave",ae="onMouseEnter",re="mouse",(r==="pointerout"||r==="pointerover")&&(Xe=xv,Ce="onPointerLeave",ae="onPointerEnter",re="pointer"),Gt=me==null?he:Pe(me),ue=$e==null?he:Pe($e),he=new Xe(Ce,re+"leave",me,c,ye),he.target=Gt,he.relatedTarget=ue,Ce=null,we(ye)===fe&&(Xe=new Xe(ae,re+"enter",$e,c,ye),Xe.target=ue,Xe.relatedTarget=Gt,Ce=Xe),Gt=Ce,me&&$e)t:{for(Xe=qD,ae=me,re=$e,ue=0,Ce=ae;Ce;Ce=Xe(Ce))ue++;Ce=0;for(var We=re;We;We=Xe(We))Ce++;for(;0<ue-Ce;)ae=Xe(ae),ue--;for(;0<Ce-ue;)re=Xe(re),Ce--;for(;ue--;){if(ae===re||re!==null&&ae===re.alternate){Xe=ae;break t}ae=Xe(ae),re=Xe(re)}Xe=null}else Xe=null;me!==null&&ub(Ee,he,me,Xe,!1),$e!==null&&Gt!==null&&ub(Ee,Gt,$e,Xe,!0)}}e:{if(he=fe?Pe(fe):window,me=he.nodeName&&he.nodeName.toLowerCase(),me==="select"||me==="input"&&he.type==="file")var kt=Mv;else if(_v(he))if(Rv)kt=rD;else{kt=nD;var Ve=tD}else me=he.nodeName,!me||me.toLowerCase()!=="input"||he.type!=="checkbox"&&he.type!=="radio"?fe&&Dh(fe.elementType)&&(kt=Mv):kt=oD;if(kt&&(kt=kt(r,fe))){Nv(Ee,kt,c,ye);break e}Ve&&Ve(r,he,fe),r==="focusout"&&fe&&he.type==="number"&&fe.memoizedProps.value!=null&&ha(he,"number",he.value)}switch(Ve=fe?Pe(fe):window,r){case"focusin":(_v(Ve)||Ve.contentEditable==="true")&&(ei=Ve,Vh=fe,kl=null);break;case"focusout":kl=Vh=ei=null;break;case"mousedown":Uh=!0;break;case"contextmenu":case"mouseup":case"dragend":Uh=!1,Iv(Ee,c,ye);break;case"selectionchange":if(aD)break;case"keydown":case"keyup":Iv(Ee,c,ye)}var dt;if(Lh)e:{switch(r){case"compositionstart":var bt="onCompositionStart";break e;case"compositionend":bt="onCompositionEnd";break e;case"compositionupdate":bt="onCompositionUpdate";break e}bt=void 0}else Ja?Cv(r,c)&&(bt="onCompositionEnd"):r==="keydown"&&c.keyCode===229&&(bt="onCompositionStart");bt&&(bv&&c.locale!=="ko"&&(Ja||bt!=="onCompositionStart"?bt==="onCompositionEnd"&&Ja&&(dt=gv()):(Ss=ye,Oh="value"in Ss?Ss.value:Ss.textContent,Ja=!0)),Ve=gd(fe,bt),0<Ve.length&&(bt=new vv(bt,r,null,c,ye),Ee.push({event:bt,listeners:Ve}),dt?bt.data=dt:(dt=Ev(c),dt!==null&&(bt.data=dt)))),(dt=X3?Q3(r,c):Z3(r,c))&&(bt=gd(fe,"onBeforeInput"),0<bt.length&&(Ve=new vv("onBeforeInput","beforeinput",null,c,ye),Ee.push({event:Ve,listeners:bt}),Ve.data=dt)),VD(Ee,r,fe,c,ye)}lb(Ee,a)})}function nc(r,a,c){return{instance:r,listener:a,currentTarget:c}}function gd(r,a){for(var c=a+"Capture",h=[];r!==null;){var b=r,_=b.stateNode;if(b=b.tag,b!==5&&b!==26&&b!==27||_===null||(b=Cl(r,c),b!=null&&h.unshift(nc(r,b,_)),b=Cl(r,a),b!=null&&h.push(nc(r,b,_))),r.tag===3)return h;r=r.return}return[]}function qD(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5&&r.tag!==27);return r||null}function ub(r,a,c,h,b){for(var _=a._reactName,j=[];c!==null&&c!==h;){var G=c,te=G.alternate,fe=G.stateNode;if(G=G.tag,te!==null&&te===h)break;G!==5&&G!==26&&G!==27||fe===null||(te=fe,b?(fe=Cl(c,_),fe!=null&&j.unshift(nc(c,fe,te))):b||(fe=Cl(c,_),fe!=null&&j.push(nc(c,fe,te)))),c=c.return}j.length!==0&&r.push({event:a,listeners:j})}var WD=/\r\n?/g,KD=/\u0000|\uFFFD/g;function db(r){return(typeof r=="string"?r:""+r).replace(WD,`
9
- `).replace(KD,"")}function fb(r,a){return a=db(a),db(r)===a}function Yt(r,a,c,h,b,_){switch(c){case"children":typeof h=="string"?a==="body"||a==="textarea"&&h===""||Rt(r,h):(typeof h=="number"||typeof h=="bigint")&&a!=="body"&&Rt(r,""+h);break;case"className":Pt(r,"class",h);break;case"tabIndex":Pt(r,"tabindex",h);break;case"dir":case"role":case"viewBox":case"width":case"height":Pt(r,c,h);break;case"style":bu(r,h,_);break;case"data":if(a!=="object"){Pt(r,"data",h);break}case"src":case"href":if(h===""&&(a!=="a"||c!=="href")){r.removeAttribute(c);break}if(h==null||typeof h=="function"||typeof h=="symbol"||typeof h=="boolean"){r.removeAttribute(c);break}h=wu(""+h),r.setAttribute(c,h);break;case"action":case"formAction":if(typeof h=="function"){r.setAttribute(c,"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 _=="function"&&(c==="formAction"?(a!=="input"&&Yt(r,a,"name",b.name,b,null),Yt(r,a,"formEncType",b.formEncType,b,null),Yt(r,a,"formMethod",b.formMethod,b,null),Yt(r,a,"formTarget",b.formTarget,b,null)):(Yt(r,a,"encType",b.encType,b,null),Yt(r,a,"method",b.method,b,null),Yt(r,a,"target",b.target,b,null)));if(h==null||typeof h=="symbol"||typeof h=="boolean"){r.removeAttribute(c);break}h=wu(""+h),r.setAttribute(c,h);break;case"onClick":h!=null&&(r.onclick=$r);break;case"onScroll":h!=null&&yt("scroll",r);break;case"onScrollEnd":h!=null&&yt("scrollend",r);break;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(o(61));if(c=h.__html,c!=null){if(b.children!=null)throw Error(o(60));r.innerHTML=c}}break;case"multiple":r.multiple=h&&typeof h!="function"&&typeof h!="symbol";break;case"muted":r.muted=h&&typeof h!="function"&&typeof h!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(h==null||typeof h=="function"||typeof h=="boolean"||typeof h=="symbol"){r.removeAttribute("xlink:href");break}c=wu(""+h),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",c);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":h!=null&&typeof h!="function"&&typeof h!="symbol"?r.setAttribute(c,""+h):r.removeAttribute(c);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":h&&typeof h!="function"&&typeof h!="symbol"?r.setAttribute(c,""):r.removeAttribute(c);break;case"capture":case"download":h===!0?r.setAttribute(c,""):h!==!1&&h!=null&&typeof h!="function"&&typeof h!="symbol"?r.setAttribute(c,h):r.removeAttribute(c);break;case"cols":case"rows":case"size":case"span":h!=null&&typeof h!="function"&&typeof h!="symbol"&&!isNaN(h)&&1<=h?r.setAttribute(c,h):r.removeAttribute(c);break;case"rowSpan":case"start":h==null||typeof h=="function"||typeof h=="symbol"||isNaN(h)?r.removeAttribute(c):r.setAttribute(c,h);break;case"popover":yt("beforetoggle",r),yt("toggle",r),ct(r,"popover",h);break;case"xlinkActuate":rt(r,"http://www.w3.org/1999/xlink","xlink:actuate",h);break;case"xlinkArcrole":rt(r,"http://www.w3.org/1999/xlink","xlink:arcrole",h);break;case"xlinkRole":rt(r,"http://www.w3.org/1999/xlink","xlink:role",h);break;case"xlinkShow":rt(r,"http://www.w3.org/1999/xlink","xlink:show",h);break;case"xlinkTitle":rt(r,"http://www.w3.org/1999/xlink","xlink:title",h);break;case"xlinkType":rt(r,"http://www.w3.org/1999/xlink","xlink:type",h);break;case"xmlBase":rt(r,"http://www.w3.org/XML/1998/namespace","xml:base",h);break;case"xmlLang":rt(r,"http://www.w3.org/XML/1998/namespace","xml:lang",h);break;case"xmlSpace":rt(r,"http://www.w3.org/XML/1998/namespace","xml:space",h);break;case"is":ct(r,"is",h);break;case"innerText":case"textContent":break;default:(!(2<c.length)||c[0]!=="o"&&c[0]!=="O"||c[1]!=="n"&&c[1]!=="N")&&(c=C3.get(c)||c,ct(r,c,h))}}function gg(r,a,c,h,b,_){switch(c){case"style":bu(r,h,_);break;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(o(61));if(c=h.__html,c!=null){if(b.children!=null)throw Error(o(60));r.innerHTML=c}}break;case"children":typeof h=="string"?Rt(r,h):(typeof h=="number"||typeof h=="bigint")&&Rt(r,""+h);break;case"onScroll":h!=null&&yt("scroll",r);break;case"onScrollEnd":h!=null&&yt("scrollend",r);break;case"onClick":h!=null&&(r.onclick=$r);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Te.hasOwnProperty(c))e:{if(c[0]==="o"&&c[1]==="n"&&(b=c.endsWith("Capture"),a=c.slice(2,b?c.length-7:void 0),_=r[Tn]||null,_=_!=null?_[c]:null,typeof _=="function"&&r.removeEventListener(a,_,b),typeof h=="function")){typeof _!="function"&&_!==null&&(c in r?r[c]=null:r.hasAttribute(c)&&r.removeAttribute(c)),r.addEventListener(a,h,b);break e}c in r?r[c]=h:h===!0?r.setAttribute(c,""):ct(r,c,h)}}}function Fn(r,a,c){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":yt("error",r),yt("load",r);var h=!1,b=!1,_;for(_ in c)if(c.hasOwnProperty(_)){var j=c[_];if(j!=null)switch(_){case"src":h=!0;break;case"srcSet":b=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,a));default:Yt(r,a,_,j,c,null)}}b&&Yt(r,a,"srcSet",c.srcSet,c,null),h&&Yt(r,a,"src",c.src,c,null);return;case"input":yt("invalid",r);var G=_=j=b=null,te=null,fe=null;for(h in c)if(c.hasOwnProperty(h)){var ye=c[h];if(ye!=null)switch(h){case"name":b=ye;break;case"type":j=ye;break;case"checked":te=ye;break;case"defaultChecked":fe=ye;break;case"value":_=ye;break;case"defaultValue":G=ye;break;case"children":case"dangerouslySetInnerHTML":if(ye!=null)throw Error(o(137,a));break;default:Yt(r,a,h,ye,c,null)}}cr(r,_,G,te,fe,j,b,!1);return;case"select":yt("invalid",r),h=j=_=null;for(b in c)if(c.hasOwnProperty(b)&&(G=c[b],G!=null))switch(b){case"value":_=G;break;case"defaultValue":j=G;break;case"multiple":h=G;default:Yt(r,a,b,G,c,null)}a=_,c=j,r.multiple=!!h,a!=null?Ot(r,!!h,a,!1):c!=null&&Ot(r,!!h,c,!0);return;case"textarea":yt("invalid",r),_=b=h=null;for(j in c)if(c.hasOwnProperty(j)&&(G=c[j],G!=null))switch(j){case"value":h=G;break;case"defaultValue":b=G;break;case"children":_=G;break;case"dangerouslySetInnerHTML":if(G!=null)throw Error(o(91));break;default:Yt(r,a,j,G,c,null)}Qt(r,h,b,_);return;case"option":for(te in c)c.hasOwnProperty(te)&&(h=c[te],h!=null)&&(te==="selected"?r.selected=h&&typeof h!="function"&&typeof h!="symbol":Yt(r,a,te,h,c,null));return;case"dialog":yt("beforetoggle",r),yt("toggle",r),yt("cancel",r),yt("close",r);break;case"iframe":case"object":yt("load",r);break;case"video":case"audio":for(h=0;h<tc.length;h++)yt(tc[h],r);break;case"image":yt("error",r),yt("load",r);break;case"details":yt("toggle",r);break;case"embed":case"source":case"link":yt("error",r),yt("load",r);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(fe in c)if(c.hasOwnProperty(fe)&&(h=c[fe],h!=null))switch(fe){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,a));default:Yt(r,a,fe,h,c,null)}return;default:if(Dh(a)){for(ye in c)c.hasOwnProperty(ye)&&(h=c[ye],h!==void 0&&gg(r,a,ye,h,c,void 0));return}}for(G in c)c.hasOwnProperty(G)&&(h=c[G],h!=null&&Yt(r,a,G,h,c,null))}function XD(r,a,c,h){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var b=null,_=null,j=null,G=null,te=null,fe=null,ye=null;for(me in c){var Ee=c[me];if(c.hasOwnProperty(me)&&Ee!=null)switch(me){case"checked":break;case"value":break;case"defaultValue":te=Ee;default:h.hasOwnProperty(me)||Yt(r,a,me,null,h,Ee)}}for(var he in h){var me=h[he];if(Ee=c[he],h.hasOwnProperty(he)&&(me!=null||Ee!=null))switch(he){case"type":_=me;break;case"name":b=me;break;case"checked":fe=me;break;case"defaultChecked":ye=me;break;case"value":j=me;break;case"defaultValue":G=me;break;case"children":case"dangerouslySetInnerHTML":if(me!=null)throw Error(o(137,a));break;default:me!==Ee&&Yt(r,a,he,me,h,Ee)}}uo(r,j,G,te,fe,ye,_,b);return;case"select":me=j=G=he=null;for(_ in c)if(te=c[_],c.hasOwnProperty(_)&&te!=null)switch(_){case"value":break;case"multiple":me=te;default:h.hasOwnProperty(_)||Yt(r,a,_,null,h,te)}for(b in h)if(_=h[b],te=c[b],h.hasOwnProperty(b)&&(_!=null||te!=null))switch(b){case"value":he=_;break;case"defaultValue":G=_;break;case"multiple":j=_;default:_!==te&&Yt(r,a,b,_,h,te)}a=G,c=j,h=me,he!=null?Ot(r,!!c,he,!1):!!h!=!!c&&(a!=null?Ot(r,!!c,a,!0):Ot(r,!!c,c?[]:"",!1));return;case"textarea":me=he=null;for(G in c)if(b=c[G],c.hasOwnProperty(G)&&b!=null&&!h.hasOwnProperty(G))switch(G){case"value":break;case"children":break;default:Yt(r,a,G,null,h,b)}for(j in h)if(b=h[j],_=c[j],h.hasOwnProperty(j)&&(b!=null||_!=null))switch(j){case"value":he=b;break;case"defaultValue":me=b;break;case"children":break;case"dangerouslySetInnerHTML":if(b!=null)throw Error(o(91));break;default:b!==_&&Yt(r,a,j,b,h,_)}Jn(r,he,me);return;case"option":for(var $e in c)he=c[$e],c.hasOwnProperty($e)&&he!=null&&!h.hasOwnProperty($e)&&($e==="selected"?r.selected=!1:Yt(r,a,$e,null,h,he));for(te in h)he=h[te],me=c[te],h.hasOwnProperty(te)&&he!==me&&(he!=null||me!=null)&&(te==="selected"?r.selected=he&&typeof he!="function"&&typeof he!="symbol":Yt(r,a,te,he,h,me));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 Xe in c)he=c[Xe],c.hasOwnProperty(Xe)&&he!=null&&!h.hasOwnProperty(Xe)&&Yt(r,a,Xe,null,h,he);for(fe in h)if(he=h[fe],me=c[fe],h.hasOwnProperty(fe)&&he!==me&&(he!=null||me!=null))switch(fe){case"children":case"dangerouslySetInnerHTML":if(he!=null)throw Error(o(137,a));break;default:Yt(r,a,fe,he,h,me)}return;default:if(Dh(a)){for(var Gt in c)he=c[Gt],c.hasOwnProperty(Gt)&&he!==void 0&&!h.hasOwnProperty(Gt)&&gg(r,a,Gt,void 0,h,he);for(ye in h)he=h[ye],me=c[ye],!h.hasOwnProperty(ye)||he===me||he===void 0&&me===void 0||gg(r,a,ye,he,h,me);return}}for(var ae in c)he=c[ae],c.hasOwnProperty(ae)&&he!=null&&!h.hasOwnProperty(ae)&&Yt(r,a,ae,null,h,he);for(Ee in h)he=h[Ee],me=c[Ee],!h.hasOwnProperty(Ee)||he===me||he==null&&me==null||Yt(r,a,Ee,he,h,me)}function hb(r){switch(r){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function QD(){if(typeof performance.getEntriesByType=="function"){for(var r=0,a=0,c=performance.getEntriesByType("resource"),h=0;h<c.length;h++){var b=c[h],_=b.transferSize,j=b.initiatorType,G=b.duration;if(_&&G&&hb(j)){for(j=0,G=b.responseEnd,h+=1;h<c.length;h++){var te=c[h],fe=te.startTime;if(fe>G)break;var ye=te.transferSize,Ee=te.initiatorType;ye&&hb(Ee)&&(te=te.responseEnd,j+=ye*(te<G?1:(G-fe)/(te-fe)))}if(--h,a+=8*(_+j)/(b.duration/1e3),r++,10<r)break}}if(0<r)return a/r/1e6}return navigator.connection&&(r=navigator.connection.downlink,typeof r=="number")?r:5}var pg=null,yg=null;function pd(r){return r.nodeType===9?r:r.ownerDocument}function mb(r){switch(r){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function gb(r,a){if(r===0)switch(a){case"svg":return 1;case"math":return 2;default:return 0}return r===1&&a==="foreignObject"?0:r}function vg(r,a){return r==="textarea"||r==="noscript"||typeof a.children=="string"||typeof a.children=="number"||typeof a.children=="bigint"||typeof a.dangerouslySetInnerHTML=="object"&&a.dangerouslySetInnerHTML!==null&&a.dangerouslySetInnerHTML.__html!=null}var xg=null;function ZD(){var r=window.event;return r&&r.type==="popstate"?r===xg?!1:(xg=r,!0):(xg=null,!1)}var pb=typeof setTimeout=="function"?setTimeout:void 0,JD=typeof clearTimeout=="function"?clearTimeout:void 0,yb=typeof Promise=="function"?Promise:void 0,e4=typeof queueMicrotask=="function"?queueMicrotask:typeof yb<"u"?function(r){return yb.resolve(null).then(r).catch(t4)}:pb;function t4(r){setTimeout(function(){throw r})}function Ls(r){return r==="head"}function vb(r,a){var c=a,h=0;do{var b=c.nextSibling;if(r.removeChild(c),b&&b.nodeType===8)if(c=b.data,c==="/$"||c==="/&"){if(h===0){r.removeChild(b),Mi(a);return}h--}else if(c==="$"||c==="$?"||c==="$~"||c==="$!"||c==="&")h++;else if(c==="html")oc(r.ownerDocument.documentElement);else if(c==="head"){c=r.ownerDocument.head,oc(c);for(var _=c.firstChild;_;){var j=_.nextSibling,G=_.nodeName;_[ce]||G==="SCRIPT"||G==="STYLE"||G==="LINK"&&_.rel.toLowerCase()==="stylesheet"||c.removeChild(_),_=j}}else c==="body"&&oc(r.ownerDocument.body);c=b}while(c);Mi(a)}function xb(r,a){var c=r;r=0;do{var h=c.nextSibling;if(c.nodeType===1?a?(c._stashedDisplay=c.style.display,c.style.display="none"):(c.style.display=c._stashedDisplay||"",c.getAttribute("style")===""&&c.removeAttribute("style")):c.nodeType===3&&(a?(c._stashedText=c.nodeValue,c.nodeValue=""):c.nodeValue=c._stashedText||""),h&&h.nodeType===8)if(c=h.data,c==="/$"){if(r===0)break;r--}else c!=="$"&&c!=="$?"&&c!=="$~"&&c!=="$!"||r++;c=h}while(c)}function bg(r){var a=r.firstChild;for(a&&a.nodeType===10&&(a=a.nextSibling);a;){var c=a;switch(a=a.nextSibling,c.nodeName){case"HTML":case"HEAD":case"BODY":bg(c),ve(c);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(c.rel.toLowerCase()==="stylesheet")continue}r.removeChild(c)}}function n4(r,a,c,h){for(;r.nodeType===1;){var b=c;if(r.nodeName.toLowerCase()!==a.toLowerCase()){if(!h&&(r.nodeName!=="INPUT"||r.type!=="hidden"))break}else if(h){if(!r[ce])switch(a){case"meta":if(!r.hasAttribute("itemprop"))break;return r;case"link":if(_=r.getAttribute("rel"),_==="stylesheet"&&r.hasAttribute("data-precedence"))break;if(_!==b.rel||r.getAttribute("href")!==(b.href==null||b.href===""?null:b.href)||r.getAttribute("crossorigin")!==(b.crossOrigin==null?null:b.crossOrigin)||r.getAttribute("title")!==(b.title==null?null:b.title))break;return r;case"style":if(r.hasAttribute("data-precedence"))break;return r;case"script":if(_=r.getAttribute("src"),(_!==(b.src==null?null:b.src)||r.getAttribute("type")!==(b.type==null?null:b.type)||r.getAttribute("crossorigin")!==(b.crossOrigin==null?null:b.crossOrigin))&&_&&r.hasAttribute("async")&&!r.hasAttribute("itemprop"))break;return r;default:return r}}else if(a==="input"&&r.type==="hidden"){var _=b.name==null?null:""+b.name;if(b.type==="hidden"&&r.getAttribute("name")===_)return r}else return r;if(r=Po(r.nextSibling),r===null)break}return null}function o4(r,a,c){if(a==="")return null;for(;r.nodeType!==3;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!c||(r=Po(r.nextSibling),r===null))return null;return r}function bb(r,a){for(;r.nodeType!==8;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!a||(r=Po(r.nextSibling),r===null))return null;return r}function wg(r){return r.data==="$?"||r.data==="$~"}function Sg(r){return r.data==="$!"||r.data==="$?"&&r.ownerDocument.readyState!=="loading"}function r4(r,a){var c=r.ownerDocument;if(r.data==="$~")r._reactRetry=a;else if(r.data!=="$?"||c.readyState!=="loading")a();else{var h=function(){a(),c.removeEventListener("DOMContentLoaded",h)};c.addEventListener("DOMContentLoaded",h),r._reactRetry=h}}function Po(r){for(;r!=null;r=r.nextSibling){var a=r.nodeType;if(a===1||a===3)break;if(a===8){if(a=r.data,a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"||a==="F!"||a==="F")break;if(a==="/$"||a==="/&")return null}}return r}var Cg=null;function wb(r){r=r.nextSibling;for(var a=0;r;){if(r.nodeType===8){var c=r.data;if(c==="/$"||c==="/&"){if(a===0)return Po(r.nextSibling);a--}else c!=="$"&&c!=="$!"&&c!=="$?"&&c!=="$~"&&c!=="&"||a++}r=r.nextSibling}return null}function Sb(r){r=r.previousSibling;for(var a=0;r;){if(r.nodeType===8){var c=r.data;if(c==="$"||c==="$!"||c==="$?"||c==="$~"||c==="&"){if(a===0)return r;a--}else c!=="/$"&&c!=="/&"||a++}r=r.previousSibling}return null}function Cb(r,a,c){switch(a=pd(c),r){case"html":if(r=a.documentElement,!r)throw Error(o(452));return r;case"head":if(r=a.head,!r)throw Error(o(453));return r;case"body":if(r=a.body,!r)throw Error(o(454));return r;default:throw Error(o(451))}}function oc(r){for(var a=r.attributes;a.length;)r.removeAttributeNode(a[0]);ve(r)}var $o=new Map,Eb=new Set;function yd(r){return typeof r.getRootNode=="function"?r.getRootNode():r.nodeType===9?r:r.ownerDocument}var es=H.d;H.d={f:s4,r:a4,D:i4,C:l4,L:c4,m:u4,X:f4,S:d4,M:h4};function s4(){var r=es.f(),a=ld();return r||a}function a4(r){var a=Me(r);a!==null&&a.tag===5&&a.type==="form"?Bx(a):es.r(r)}var Ei=typeof document>"u"?null:document;function _b(r,a,c){var h=Ei;if(h&&typeof a=="string"&&a){var b=Ze(a);b='link[rel="'+r+'"][href="'+b+'"]',typeof c=="string"&&(b+='[crossorigin="'+c+'"]'),Eb.has(b)||(Eb.add(b),r={rel:r,crossOrigin:c,href:a},h.querySelector(b)===null&&(a=h.createElement("link"),Fn(a,"link",r),Se(a),h.head.appendChild(a)))}}function i4(r){es.D(r),_b("dns-prefetch",r,null)}function l4(r,a){es.C(r,a),_b("preconnect",r,a)}function c4(r,a,c){es.L(r,a,c);var h=Ei;if(h&&r&&a){var b='link[rel="preload"][as="'+Ze(a)+'"]';a==="image"&&c&&c.imageSrcSet?(b+='[imagesrcset="'+Ze(c.imageSrcSet)+'"]',typeof c.imageSizes=="string"&&(b+='[imagesizes="'+Ze(c.imageSizes)+'"]')):b+='[href="'+Ze(r)+'"]';var _=b;switch(a){case"style":_=_i(r);break;case"script":_=Ni(r)}$o.has(_)||(r=m({rel:"preload",href:a==="image"&&c&&c.imageSrcSet?void 0:r,as:a},c),$o.set(_,r),h.querySelector(b)!==null||a==="style"&&h.querySelector(rc(_))||a==="script"&&h.querySelector(sc(_))||(a=h.createElement("link"),Fn(a,"link",r),Se(a),h.head.appendChild(a)))}}function u4(r,a){es.m(r,a);var c=Ei;if(c&&r){var h=a&&typeof a.as=="string"?a.as:"script",b='link[rel="modulepreload"][as="'+Ze(h)+'"][href="'+Ze(r)+'"]',_=b;switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":_=Ni(r)}if(!$o.has(_)&&(r=m({rel:"modulepreload",href:r},a),$o.set(_,r),c.querySelector(b)===null)){switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(c.querySelector(sc(_)))return}h=c.createElement("link"),Fn(h,"link",r),Se(h),c.head.appendChild(h)}}}function d4(r,a,c){es.S(r,a,c);var h=Ei;if(h&&r){var b=Oe(h).hoistableStyles,_=_i(r);a=a||"default";var j=b.get(_);if(!j){var G={loading:0,preload:null};if(j=h.querySelector(rc(_)))G.loading=5;else{r=m({rel:"stylesheet",href:r,"data-precedence":a},c),(c=$o.get(_))&&Eg(r,c);var te=j=h.createElement("link");Se(te),Fn(te,"link",r),te._p=new Promise(function(fe,ye){te.onload=fe,te.onerror=ye}),te.addEventListener("load",function(){G.loading|=1}),te.addEventListener("error",function(){G.loading|=2}),G.loading|=4,vd(j,a,h)}j={type:"stylesheet",instance:j,count:1,state:G},b.set(_,j)}}}function f4(r,a){es.X(r,a);var c=Ei;if(c&&r){var h=Oe(c).hoistableScripts,b=Ni(r),_=h.get(b);_||(_=c.querySelector(sc(b)),_||(r=m({src:r,async:!0},a),(a=$o.get(b))&&_g(r,a),_=c.createElement("script"),Se(_),Fn(_,"link",r),c.head.appendChild(_)),_={type:"script",instance:_,count:1,state:null},h.set(b,_))}}function h4(r,a){es.M(r,a);var c=Ei;if(c&&r){var h=Oe(c).hoistableScripts,b=Ni(r),_=h.get(b);_||(_=c.querySelector(sc(b)),_||(r=m({src:r,async:!0,type:"module"},a),(a=$o.get(b))&&_g(r,a),_=c.createElement("script"),Se(_),Fn(_,"link",r),c.head.appendChild(_)),_={type:"script",instance:_,count:1,state:null},h.set(b,_))}}function Nb(r,a,c,h){var b=(b=ne.current)?yd(b):null;if(!b)throw Error(o(446));switch(r){case"meta":case"title":return null;case"style":return typeof c.precedence=="string"&&typeof c.href=="string"?(a=_i(c.href),c=Oe(b).hoistableStyles,h=c.get(a),h||(h={type:"style",instance:null,count:0,state:null},c.set(a,h)),h):{type:"void",instance:null,count:0,state:null};case"link":if(c.rel==="stylesheet"&&typeof c.href=="string"&&typeof c.precedence=="string"){r=_i(c.href);var _=Oe(b).hoistableStyles,j=_.get(r);if(j||(b=b.ownerDocument||b,j={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},_.set(r,j),(_=b.querySelector(rc(r)))&&!_._p&&(j.instance=_,j.state.loading=5),$o.has(r)||(c={rel:"preload",as:"style",href:c.href,crossOrigin:c.crossOrigin,integrity:c.integrity,media:c.media,hrefLang:c.hrefLang,referrerPolicy:c.referrerPolicy},$o.set(r,c),_||m4(b,r,c,j.state))),a&&h===null)throw Error(o(528,""));return j}if(a&&h!==null)throw Error(o(529,""));return null;case"script":return a=c.async,c=c.src,typeof c=="string"&&a&&typeof a!="function"&&typeof a!="symbol"?(a=Ni(c),c=Oe(b).hoistableScripts,h=c.get(a),h||(h={type:"script",instance:null,count:0,state:null},c.set(a,h)),h):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,r))}}function _i(r){return'href="'+Ze(r)+'"'}function rc(r){return'link[rel="stylesheet"]['+r+"]"}function Mb(r){return m({},r,{"data-precedence":r.precedence,precedence:null})}function m4(r,a,c,h){r.querySelector('link[rel="preload"][as="style"]['+a+"]")?h.loading=1:(a=r.createElement("link"),h.preload=a,a.addEventListener("load",function(){return h.loading|=1}),a.addEventListener("error",function(){return h.loading|=2}),Fn(a,"link",c),Se(a),r.head.appendChild(a))}function Ni(r){return'[src="'+Ze(r)+'"]'}function sc(r){return"script[async]"+r}function Rb(r,a,c){if(a.count++,a.instance===null)switch(a.type){case"style":var h=r.querySelector('style[data-href~="'+Ze(c.href)+'"]');if(h)return a.instance=h,Se(h),h;var b=m({},c,{"data-href":c.href,"data-precedence":c.precedence,href:null,precedence:null});return h=(r.ownerDocument||r).createElement("style"),Se(h),Fn(h,"style",b),vd(h,c.precedence,r),a.instance=h;case"stylesheet":b=_i(c.href);var _=r.querySelector(rc(b));if(_)return a.state.loading|=4,a.instance=_,Se(_),_;h=Mb(c),(b=$o.get(b))&&Eg(h,b),_=(r.ownerDocument||r).createElement("link"),Se(_);var j=_;return j._p=new Promise(function(G,te){j.onload=G,j.onerror=te}),Fn(_,"link",h),a.state.loading|=4,vd(_,c.precedence,r),a.instance=_;case"script":return _=Ni(c.src),(b=r.querySelector(sc(_)))?(a.instance=b,Se(b),b):(h=c,(b=$o.get(_))&&(h=m({},c),_g(h,b)),r=r.ownerDocument||r,b=r.createElement("script"),Se(b),Fn(b,"link",h),r.head.appendChild(b),a.instance=b);case"void":return null;default:throw Error(o(443,a.type))}else a.type==="stylesheet"&&(a.state.loading&4)===0&&(h=a.instance,a.state.loading|=4,vd(h,c.precedence,r));return a.instance}function vd(r,a,c){for(var h=c.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),b=h.length?h[h.length-1]:null,_=b,j=0;j<h.length;j++){var G=h[j];if(G.dataset.precedence===a)_=G;else if(_!==b)break}_?_.parentNode.insertBefore(r,_.nextSibling):(a=c.nodeType===9?c.head:c,a.insertBefore(r,a.firstChild))}function Eg(r,a){r.crossOrigin==null&&(r.crossOrigin=a.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=a.referrerPolicy),r.title==null&&(r.title=a.title)}function _g(r,a){r.crossOrigin==null&&(r.crossOrigin=a.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=a.referrerPolicy),r.integrity==null&&(r.integrity=a.integrity)}var xd=null;function Db(r,a,c){if(xd===null){var h=new Map,b=xd=new Map;b.set(c,h)}else b=xd,h=b.get(c),h||(h=new Map,b.set(c,h));if(h.has(r))return h;for(h.set(r,null),c=c.getElementsByTagName(r),b=0;b<c.length;b++){var _=c[b];if(!(_[ce]||_[fn]||r==="link"&&_.getAttribute("rel")==="stylesheet")&&_.namespaceURI!=="http://www.w3.org/2000/svg"){var j=_.getAttribute(a)||"";j=r+j;var G=h.get(j);G?G.push(_):h.set(j,[_])}}return h}function Tb(r,a,c){r=r.ownerDocument||r,r.head.insertBefore(c,a==="title"?r.querySelector("head > title"):null)}function g4(r,a,c){if(c===1||a.itemProp!=null)return!1;switch(r){case"meta":case"title":return!0;case"style":if(typeof a.precedence!="string"||typeof a.href!="string"||a.href==="")break;return!0;case"link":if(typeof a.rel!="string"||typeof a.href!="string"||a.href===""||a.onLoad||a.onError)break;return a.rel==="stylesheet"?(r=a.disabled,typeof a.precedence=="string"&&r==null):!0;case"script":if(a.async&&typeof a.async!="function"&&typeof a.async!="symbol"&&!a.onLoad&&!a.onError&&a.src&&typeof a.src=="string")return!0}return!1}function kb(r){return!(r.type==="stylesheet"&&(r.state.loading&3)===0)}function p4(r,a,c,h){if(c.type==="stylesheet"&&(typeof h.media!="string"||matchMedia(h.media).matches!==!1)&&(c.state.loading&4)===0){if(c.instance===null){var b=_i(h.href),_=a.querySelector(rc(b));if(_){a=_._p,a!==null&&typeof a=="object"&&typeof a.then=="function"&&(r.count++,r=bd.bind(r),a.then(r,r)),c.state.loading|=4,c.instance=_,Se(_);return}_=a.ownerDocument||a,h=Mb(h),(b=$o.get(b))&&Eg(h,b),_=_.createElement("link"),Se(_);var j=_;j._p=new Promise(function(G,te){j.onload=G,j.onerror=te}),Fn(_,"link",h),c.instance=_}r.stylesheets===null&&(r.stylesheets=new Map),r.stylesheets.set(c,a),(a=c.state.preload)&&(c.state.loading&3)===0&&(r.count++,c=bd.bind(r),a.addEventListener("load",c),a.addEventListener("error",c))}}var Ng=0;function y4(r,a){return r.stylesheets&&r.count===0&&Sd(r,r.stylesheets),0<r.count||0<r.imgCount?function(c){var h=setTimeout(function(){if(r.stylesheets&&Sd(r,r.stylesheets),r.unsuspend){var _=r.unsuspend;r.unsuspend=null,_()}},6e4+a);0<r.imgBytes&&Ng===0&&(Ng=62500*QD());var b=setTimeout(function(){if(r.waitingForImages=!1,r.count===0&&(r.stylesheets&&Sd(r,r.stylesheets),r.unsuspend)){var _=r.unsuspend;r.unsuspend=null,_()}},(r.imgBytes>Ng?50:800)+a);return r.unsuspend=c,function(){r.unsuspend=null,clearTimeout(h),clearTimeout(b)}}:null}function bd(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Sd(this,this.stylesheets);else if(this.unsuspend){var r=this.unsuspend;this.unsuspend=null,r()}}}var wd=null;function Sd(r,a){r.stylesheets=null,r.unsuspend!==null&&(r.count++,wd=new Map,a.forEach(v4,r),wd=null,bd.call(r))}function v4(r,a){if(!(a.state.loading&4)){var c=wd.get(r);if(c)var h=c.get(null);else{c=new Map,wd.set(r,c);for(var b=r.querySelectorAll("link[data-precedence],style[data-precedence]"),_=0;_<b.length;_++){var j=b[_];(j.nodeName==="LINK"||j.getAttribute("media")!=="not all")&&(c.set(j.dataset.precedence,j),h=j)}h&&c.set(null,h)}b=a.instance,j=b.getAttribute("data-precedence"),_=c.get(j)||h,_===h&&c.set(null,b),c.set(j,b),this.count++,h=bd.bind(this),b.addEventListener("load",h),b.addEventListener("error",h),_?_.parentNode.insertBefore(b,_.nextSibling):(r=r.nodeType===9?r.head:r,r.insertBefore(b,r.firstChild)),a.state.loading|=4}}var ac={$$typeof:E,Provider:null,Consumer:null,_currentValue:P,_currentValue2:P,_threadCount:0};function x4(r,a,c,h,b,_,j,G,te){this.tag=1,this.containerInfo=r,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=Pn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Pn(0),this.hiddenUpdates=Pn(null),this.identifierPrefix=h,this.onUncaughtError=b,this.onCaughtError=_,this.onRecoverableError=j,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=te,this.incompleteTransitions=new Map}function jb(r,a,c,h,b,_,j,G,te,fe,ye,Ee){return r=new x4(r,a,c,j,te,fe,ye,Ee,G),a=1,_===!0&&(a|=24),_=ho(3,null,null,a),r.current=_,_.stateNode=r,a=sm(),a.refCount++,r.pooledCache=a,a.refCount++,_.memoizedState={element:h,isDehydrated:c,cache:a},cm(_),r}function Ab(r){return r?(r=oi,r):oi}function Ob(r,a,c,h,b,_){b=Ab(b),h.context===null?h.context=b:h.pendingContext=b,h=Rs(a),h.payload={element:c},_=_===void 0?null:_,_!==null&&(h.callback=_),c=Ds(r,h,a),c!==null&&(so(c,r,a),$l(c,r,a))}function zb(r,a){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var c=r.retryLane;r.retryLane=c!==0&&c<a?c:a}}function Mg(r,a){zb(r,a),(r=r.alternate)&&zb(r,a)}function Ib(r){if(r.tag===13||r.tag===31){var a=ya(r,67108864);a!==null&&so(a,r,67108864),Mg(r,67108864)}}function Pb(r){if(r.tag===13||r.tag===31){var a=vo();a=Do(a);var c=ya(r,a);c!==null&&so(c,r,a),Mg(r,a)}}var Cd=!0;function b4(r,a,c,h){var b=A.T;A.T=null;var _=H.p;try{H.p=2,Rg(r,a,c,h)}finally{H.p=_,A.T=b}}function w4(r,a,c,h){var b=A.T;A.T=null;var _=H.p;try{H.p=8,Rg(r,a,c,h)}finally{H.p=_,A.T=b}}function Rg(r,a,c,h){if(Cd){var b=Dg(h);if(b===null)mg(r,a,h,Ed,c),Lb(r,h);else if(C4(b,r,a,c,h))h.stopPropagation();else if(Lb(r,h),a&4&&-1<S4.indexOf(r)){for(;b!==null;){var _=Me(b);if(_!==null)switch(_.tag){case 3:if(_=_.stateNode,_.current.memoizedState.isDehydrated){var j=Lt(_.pendingLanes);if(j!==0){var G=_;for(G.pendingLanes|=2,G.entangledLanes|=2;j;){var te=1<<31-Kt(j);G.entanglements[1]|=te,j&=~te}hr(_),(zt&6)===0&&(ad=It()+500,ec(0))}}break;case 31:case 13:G=ya(_,2),G!==null&&so(G,_,2),ld(),Mg(_,2)}if(_=Dg(h),_===null&&mg(r,a,h,Ed,c),_===b)break;b=_}b!==null&&h.stopPropagation()}else mg(r,a,h,null,c)}}function Dg(r){return r=kh(r),Tg(r)}var Ed=null;function Tg(r){if(Ed=null,r=we(r),r!==null){var a=i(r);if(a===null)r=null;else{var c=a.tag;if(c===13){if(r=l(a),r!==null)return r;r=null}else if(c===31){if(r=u(a),r!==null)return r;r=null}else if(c===3){if(a.stateNode.current.memoizedState.isDehydrated)return a.tag===3?a.stateNode.containerInfo:null;r=null}else a!==r&&(r=null)}}return Ed=r,null}function $b(r){switch(r){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(Mn()){case yn:return 2;case In:return 8;case On:case _e:return 32;case Ue:return 268435456;default:return 32}default:return 32}}var kg=!1,Hs=null,Bs=null,Fs=null,ic=new Map,lc=new Map,Vs=[],S4="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 Lb(r,a){switch(r){case"focusin":case"focusout":Hs=null;break;case"dragenter":case"dragleave":Bs=null;break;case"mouseover":case"mouseout":Fs=null;break;case"pointerover":case"pointerout":ic.delete(a.pointerId);break;case"gotpointercapture":case"lostpointercapture":lc.delete(a.pointerId)}}function cc(r,a,c,h,b,_){return r===null||r.nativeEvent!==_?(r={blockedOn:a,domEventName:c,eventSystemFlags:h,nativeEvent:_,targetContainers:[b]},a!==null&&(a=Me(a),a!==null&&Ib(a)),r):(r.eventSystemFlags|=h,a=r.targetContainers,b!==null&&a.indexOf(b)===-1&&a.push(b),r)}function C4(r,a,c,h,b){switch(a){case"focusin":return Hs=cc(Hs,r,a,c,h,b),!0;case"dragenter":return Bs=cc(Bs,r,a,c,h,b),!0;case"mouseover":return Fs=cc(Fs,r,a,c,h,b),!0;case"pointerover":var _=b.pointerId;return ic.set(_,cc(ic.get(_)||null,r,a,c,h,b)),!0;case"gotpointercapture":return _=b.pointerId,lc.set(_,cc(lc.get(_)||null,r,a,c,h,b)),!0}return!1}function Hb(r){var a=we(r.target);if(a!==null){var c=i(a);if(c!==null){if(a=c.tag,a===13){if(a=l(c),a!==null){r.blockedOn=a,Or(r.priority,function(){Pb(c)});return}}else if(a===31){if(a=u(c),a!==null){r.blockedOn=a,Or(r.priority,function(){Pb(c)});return}}else if(a===3&&c.stateNode.current.memoizedState.isDehydrated){r.blockedOn=c.tag===3?c.stateNode.containerInfo:null;return}}}r.blockedOn=null}function _d(r){if(r.blockedOn!==null)return!1;for(var a=r.targetContainers;0<a.length;){var c=Dg(r.nativeEvent);if(c===null){c=r.nativeEvent;var h=new c.constructor(c.type,c);Th=h,c.target.dispatchEvent(h),Th=null}else return a=Me(c),a!==null&&Ib(a),r.blockedOn=c,!1;a.shift()}return!0}function Bb(r,a,c){_d(r)&&c.delete(a)}function E4(){kg=!1,Hs!==null&&_d(Hs)&&(Hs=null),Bs!==null&&_d(Bs)&&(Bs=null),Fs!==null&&_d(Fs)&&(Fs=null),ic.forEach(Bb),lc.forEach(Bb)}function Nd(r,a){r.blockedOn===a&&(r.blockedOn=null,kg||(kg=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,E4)))}var Md=null;function Fb(r){Md!==r&&(Md=r,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Md===r&&(Md=null);for(var a=0;a<r.length;a+=3){var c=r[a],h=r[a+1],b=r[a+2];if(typeof h!="function"){if(Tg(h||c)===null)continue;break}var _=Me(c);_!==null&&(r.splice(a,3),a-=3,Dm(_,{pending:!0,data:b,method:c.method,action:h},h,b))}}))}function Mi(r){function a(te){return Nd(te,r)}Hs!==null&&Nd(Hs,r),Bs!==null&&Nd(Bs,r),Fs!==null&&Nd(Fs,r),ic.forEach(a),lc.forEach(a);for(var c=0;c<Vs.length;c++){var h=Vs[c];h.blockedOn===r&&(h.blockedOn=null)}for(;0<Vs.length&&(c=Vs[0],c.blockedOn===null);)Hb(c),c.blockedOn===null&&Vs.shift();if(c=(r.ownerDocument||r).$$reactFormReplay,c!=null)for(h=0;h<c.length;h+=3){var b=c[h],_=c[h+1],j=b[Tn]||null;if(typeof _=="function")j||Fb(c);else if(j){var G=null;if(_&&_.hasAttribute("formAction")){if(b=_,j=_[Tn]||null)G=j.formAction;else if(Tg(b)!==null)continue}else G=j.action;typeof G=="function"?c[h+1]=G:(c.splice(h,3),h-=3),Fb(c)}}}function Vb(){function r(_){_.canIntercept&&_.info==="react-transition"&&_.intercept({handler:function(){return new Promise(function(j){return b=j})},focusReset:"manual",scroll:"manual"})}function a(){b!==null&&(b(),b=null),h||setTimeout(c,20)}function c(){if(!h&&!navigation.transition){var _=navigation.currentEntry;_&&_.url!=null&&navigation.navigate(_.url,{state:_.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var h=!1,b=null;return navigation.addEventListener("navigate",r),navigation.addEventListener("navigatesuccess",a),navigation.addEventListener("navigateerror",a),setTimeout(c,100),function(){h=!0,navigation.removeEventListener("navigate",r),navigation.removeEventListener("navigatesuccess",a),navigation.removeEventListener("navigateerror",a),b!==null&&(b(),b=null)}}}function jg(r){this._internalRoot=r}Rd.prototype.render=jg.prototype.render=function(r){var a=this._internalRoot;if(a===null)throw Error(o(409));var c=a.current,h=vo();Ob(c,h,r,a,null,null)},Rd.prototype.unmount=jg.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var a=r.containerInfo;Ob(r.current,2,null,r,null,null),ld(),a[To]=null}};function Rd(r){this._internalRoot=r}Rd.prototype.unstable_scheduleHydration=function(r){if(r){var a=lo();r={blockedOn:null,target:r,priority:a};for(var c=0;c<Vs.length&&a!==0&&a<Vs[c].priority;c++);Vs.splice(c,0,r),c===0&&Hb(r)}};var Ub=e.version;if(Ub!=="19.2.4")throw Error(o(527,Ub,"19.2.4"));H.findDOMNode=function(r){var a=r._reactInternals;if(a===void 0)throw typeof r.render=="function"?Error(o(188)):(r=Object.keys(r).join(","),Error(o(268,r)));return r=f(a),r=r!==null?g(r):null,r=r===null?null:r.stateNode,r};var _4={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:A,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Dd=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Dd.isDisabled&&Dd.supportsFiber)try{st=Dd.inject(_4),gt=Dd}catch{}}return dc.createRoot=function(r,a){if(!s(r))throw Error(o(299));var c=!1,h="",b=Qx,_=Zx,j=Jx;return a!=null&&(a.unstable_strictMode===!0&&(c=!0),a.identifierPrefix!==void 0&&(h=a.identifierPrefix),a.onUncaughtError!==void 0&&(b=a.onUncaughtError),a.onCaughtError!==void 0&&(_=a.onCaughtError),a.onRecoverableError!==void 0&&(j=a.onRecoverableError)),a=jb(r,1,!1,null,null,c,h,null,b,_,j,Vb),r[To]=a.current,hg(r),new jg(a)},dc.hydrateRoot=function(r,a,c){if(!s(r))throw Error(o(299));var h=!1,b="",_=Qx,j=Zx,G=Jx,te=null;return c!=null&&(c.unstable_strictMode===!0&&(h=!0),c.identifierPrefix!==void 0&&(b=c.identifierPrefix),c.onUncaughtError!==void 0&&(_=c.onUncaughtError),c.onCaughtError!==void 0&&(j=c.onCaughtError),c.onRecoverableError!==void 0&&(G=c.onRecoverableError),c.formState!==void 0&&(te=c.formState)),a=jb(r,1,!0,a,c??null,h,b,te,_,j,G,Vb),a.context=Ab(null),c=a.current,h=vo(),h=Do(h),b=Rs(h),b.callback=null,Ds(c,b,h),c=h,a.current.lanes=c,Tt(a,c),hr(a),r[To]=a.current,hg(r),new Rd(a)},dc.version="19.2.4",dc}var ew;function z4(){if(ew)return zg.exports;ew=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(e){console.error(e)}}return t(),zg.exports=O4(),zg.exports}var I4=z4();var tw="popstate";function P4(t={}){function e(o,s){let{pathname:i,search:l,hash:u}=o.location;return zp("",{pathname:i,search:l,hash:u},s.state&&s.state.usr||null,s.state&&s.state.key||"default")}function n(o,s){return typeof s=="string"?s:Tc(s)}return L4(e,n,null,t)}function sn(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function or(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function $4(){return Math.random().toString(36).substring(2,10)}function nw(t,e){return{usr:t.state,key:t.key,idx:e}}function zp(t,e,n=null,o){return{pathname:typeof t=="string"?t:t.pathname,search:"",hash:"",...typeof e=="string"?cl(e):e,state:n,key:e&&e.key||o||$4()}}function Tc({pathname:t="/",search:e="",hash:n=""}){return e&&e!=="?"&&(t+=e.charAt(0)==="?"?e:"?"+e),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function cl(t){let e={};if(t){let n=t.indexOf("#");n>=0&&(e.hash=t.substring(n),t=t.substring(0,n));let o=t.indexOf("?");o>=0&&(e.search=t.substring(o),t=t.substring(0,o)),t&&(e.pathname=t)}return e}function L4(t,e,n,o={}){let{window:s=document.defaultView,v5Compat:i=!1}=o,l=s.history,u="POP",d=null,f=g();f==null&&(f=0,l.replaceState({...l.state,idx:f},""));function g(){return(l.state||{idx:null}).idx}function m(){u="POP";let S=g(),N=S==null?null:S-f;f=S,d&&d({action:u,location:C.location,delta:N})}function y(S,N){u="PUSH";let M=zp(C.location,S,N);f=g()+1;let E=nw(M,f),R=C.createHref(M);try{l.pushState(E,"",R)}catch(D){if(D instanceof DOMException&&D.name==="DataCloneError")throw D;s.location.assign(R)}i&&d&&d({action:u,location:C.location,delta:1})}function v(S,N){u="REPLACE";let M=zp(C.location,S,N);f=g();let E=nw(M,f),R=C.createHref(M);l.replaceState(E,"",R),i&&d&&d({action:u,location:C.location,delta:0})}function w(S){return H4(S)}let C={get action(){return u},get location(){return t(s,l)},listen(S){if(d)throw new Error("A history only accepts one active listener");return s.addEventListener(tw,m),d=S,()=>{s.removeEventListener(tw,m),d=null}},createHref(S){return e(s,S)},createURL:w,encodeLocation(S){let N=w(S);return{pathname:N.pathname,search:N.search,hash:N.hash}},push:y,replace:v,go(S){return l.go(S)}};return C}function H4(t,e=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),sn(n,"No window.location.(origin|href) available to create URL");let o=typeof t=="string"?t:Tc(t);return o=o.replace(/ $/,"%20"),!e&&o.startsWith("//")&&(o=n+o),new URL(o,n)}function K2(t,e,n="/"){return B4(t,e,n,!1)}function B4(t,e,n,o){let s=typeof e=="string"?cl(e):e,i=us(s.pathname||"/",n);if(i==null)return null;let l=X2(t);F4(l);let u=null;for(let d=0;u==null&&d<l.length;++d){let f=J4(i);u=Q4(l[d],f,o)}return u}function X2(t,e=[],n=[],o="",s=!1){let i=(l,u,d=s,f)=>{let g={relativePath:f===void 0?l.path||"":f,caseSensitive:l.caseSensitive===!0,childrenIndex:u,route:l};if(g.relativePath.startsWith("/")){if(!g.relativePath.startsWith(o)&&d)return;sn(g.relativePath.startsWith(o),`Absolute route path "${g.relativePath}" nested under path "${o}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),g.relativePath=g.relativePath.slice(o.length)}let m=ls([o,g.relativePath]),y=n.concat(g);l.children&&l.children.length>0&&(sn(l.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${m}".`),X2(l.children,e,y,m,d)),!(l.path==null&&!l.index)&&e.push({path:m,score:K4(m,l.index),routesMeta:y})};return t.forEach((l,u)=>{if(l.path===""||!l.path?.includes("?"))i(l,u);else for(let d of Q2(l.path))i(l,u,!0,d)}),e}function Q2(t){let e=t.split("/");if(e.length===0)return[];let[n,...o]=e,s=n.endsWith("?"),i=n.replace(/\?$/,"");if(o.length===0)return s?[i,""]:[i];let l=Q2(o.join("/")),u=[];return u.push(...l.map(d=>d===""?i:[i,d].join("/"))),s&&u.push(...l),u.map(d=>t.startsWith("/")&&d===""?"/":d)}function F4(t){t.sort((e,n)=>e.score!==n.score?n.score-e.score:X4(e.routesMeta.map(o=>o.childrenIndex),n.routesMeta.map(o=>o.childrenIndex)))}var V4=/^:[\w-]+$/,U4=3,Y4=2,G4=1,q4=10,W4=-2,ow=t=>t==="*";function K4(t,e){let n=t.split("/"),o=n.length;return n.some(ow)&&(o+=W4),e&&(o+=Y4),n.filter(s=>!ow(s)).reduce((s,i)=>s+(V4.test(i)?U4:i===""?G4:q4),o)}function X4(t,e){return t.length===e.length&&t.slice(0,-1).every((o,s)=>o===e[s])?t[t.length-1]-e[e.length-1]:0}function Q4(t,e,n=!1){let{routesMeta:o}=t,s={},i="/",l=[];for(let u=0;u<o.length;++u){let d=o[u],f=u===o.length-1,g=i==="/"?e:e.slice(i.length)||"/",m=uf({path:d.relativePath,caseSensitive:d.caseSensitive,end:f},g),y=d.route;if(!m&&f&&n&&!o[o.length-1].route.index&&(m=uf({path:d.relativePath,caseSensitive:d.caseSensitive,end:!1},g)),!m)return null;Object.assign(s,m.params),l.push({params:s,pathname:ls([i,m.pathname]),pathnameBase:oT(ls([i,m.pathnameBase])),route:y}),m.pathnameBase!=="/"&&(i=ls([i,m.pathnameBase]))}return l}function uf(t,e){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[n,o]=Z4(t.path,t.caseSensitive,t.end),s=e.match(n);if(!s)return null;let i=s[0],l=i.replace(/(.)\/+$/,"$1"),u=s.slice(1);return{params:o.reduce((f,{paramName:g,isOptional:m},y)=>{if(g==="*"){let w=u[y]||"";l=i.slice(0,i.length-w.length).replace(/(.)\/+$/,"$1")}const v=u[y];return m&&!v?f[g]=void 0:f[g]=(v||"").replace(/%2F/g,"/"),f},{}),pathname:i,pathnameBase:l,pattern:t}}function Z4(t,e=!1,n=!0){or(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 o=[],s="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,u,d)=>(o.push({paramName:u,isOptional:d!=null}),d?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return t.endsWith("*")?(o.push({paramName:"*"}),s+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":t!==""&&t!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,e?void 0:"i"),o]}function J4(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return or(!1,`The URL path "${t}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${e}).`),t}}function us(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let n=e.endsWith("/")?e.length-1:e.length,o=t.charAt(n);return o&&o!=="/"?null:t.slice(n)||"/"}var eT=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function tT(t,e="/"){let{pathname:n,search:o="",hash:s=""}=typeof t=="string"?cl(t):t,i;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?i=rw(n.substring(1),"/"):i=rw(n,e)):i=e,{pathname:i,search:rT(o),hash:sT(s)}}function rw(t,e){let n=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(s=>{s===".."?n.length>1&&n.pop():s!=="."&&n.push(s)}),n.length>1?n.join("/"):"/"}function Lg(t,e,n,o){return`Cannot include a '${t}' character in a manually specified \`to.${e}\` field [${JSON.stringify(o)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function nT(t){return t.filter((e,n)=>n===0||e.route.path&&e.route.path.length>0)}function M0(t){let e=nT(t);return e.map((n,o)=>o===e.length-1?n.pathname:n.pathnameBase)}function R0(t,e,n,o=!1){let s;typeof t=="string"?s=cl(t):(s={...t},sn(!s.pathname||!s.pathname.includes("?"),Lg("?","pathname","search",s)),sn(!s.pathname||!s.pathname.includes("#"),Lg("#","pathname","hash",s)),sn(!s.search||!s.search.includes("#"),Lg("#","search","hash",s)));let i=t===""||s.pathname==="",l=i?"/":s.pathname,u;if(l==null)u=n;else{let m=e.length-1;if(!o&&l.startsWith("..")){let y=l.split("/");for(;y[0]==="..";)y.shift(),m-=1;s.pathname=y.join("/")}u=m>=0?e[m]:"/"}let d=tT(s,u),f=l&&l!=="/"&&l.endsWith("/"),g=(i||l===".")&&n.endsWith("/");return!d.pathname.endsWith("/")&&(f||g)&&(d.pathname+="/"),d}var ls=t=>t.join("/").replace(/\/\/+/g,"/"),oT=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),rT=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,sT=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t,aT=class{constructor(t,e,n,o=!1){this.status=t,this.statusText=e||"",this.internal=o,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function iT(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}function lT(t){return t.map(e=>e.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var Z2=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function J2(t,e){let n=t;if(typeof n!="string"||!eT.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let o=n,s=!1;if(Z2)try{let i=new URL(window.location.href),l=n.startsWith("//")?new URL(i.protocol+n):new URL(n),u=us(l.pathname,e);l.origin===i.origin&&u!=null?n=u+l.search+l.hash:s=!0}catch{or(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:o,isExternal:s,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var eC=["POST","PUT","PATCH","DELETE"];new Set(eC);var cT=["GET",...eC];new Set(cT);var ul=x.createContext(null);ul.displayName="DataRouter";var Af=x.createContext(null);Af.displayName="DataRouterState";var uT=x.createContext(!1),tC=x.createContext({isTransitioning:!1});tC.displayName="ViewTransition";var dT=x.createContext(new Map);dT.displayName="Fetchers";var fT=x.createContext(null);fT.displayName="Await";var Mo=x.createContext(null);Mo.displayName="Navigation";var Xc=x.createContext(null);Xc.displayName="Location";var Rr=x.createContext({outlet:null,matches:[],isDataRoute:!1});Rr.displayName="Route";var D0=x.createContext(null);D0.displayName="RouteError";var nC="REACT_ROUTER_ERROR",hT="REDIRECT",mT="ROUTE_ERROR_RESPONSE";function gT(t){if(t.startsWith(`${nC}:${hT}:{`))try{let e=JSON.parse(t.slice(28));if(typeof e=="object"&&e&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.location=="string"&&typeof e.reloadDocument=="boolean"&&typeof e.replace=="boolean")return e}catch{}}function pT(t){if(t.startsWith(`${nC}:${mT}:{`))try{let e=JSON.parse(t.slice(40));if(typeof e=="object"&&e&&typeof e.status=="number"&&typeof e.statusText=="string")return new aT(e.status,e.statusText,e.data)}catch{}}function yT(t,{relative:e}={}){sn(dl(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:o}=x.useContext(Mo),{hash:s,pathname:i,search:l}=Qc(t,{relative:e}),u=i;return n!=="/"&&(u=i==="/"?n:ls([n,i])),o.createHref({pathname:u,search:l,hash:s})}function dl(){return x.useContext(Xc)!=null}function ys(){return sn(dl(),"useLocation() may be used only in the context of a <Router> component."),x.useContext(Xc).location}var oC="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function rC(t){x.useContext(Mo).static||x.useLayoutEffect(t)}function sC(){let{isDataRoute:t}=x.useContext(Rr);return t?TT():vT()}function vT(){sn(dl(),"useNavigate() may be used only in the context of a <Router> component.");let t=x.useContext(ul),{basename:e,navigator:n}=x.useContext(Mo),{matches:o}=x.useContext(Rr),{pathname:s}=ys(),i=JSON.stringify(M0(o)),l=x.useRef(!1);return rC(()=>{l.current=!0}),x.useCallback((d,f={})=>{if(or(l.current,oC),!l.current)return;if(typeof d=="number"){n.go(d);return}let g=R0(d,JSON.parse(i),s,f.relative==="path");t==null&&e!=="/"&&(g.pathname=g.pathname==="/"?e:ls([e,g.pathname])),(f.replace?n.replace:n.push)(g,f.state,f)},[e,n,i,s,t])}x.createContext(null);function Qc(t,{relative:e}={}){let{matches:n}=x.useContext(Rr),{pathname:o}=ys(),s=JSON.stringify(M0(n));return x.useMemo(()=>R0(t,JSON.parse(s),o,e==="path"),[t,s,o,e])}function xT(t,e){return aC(t,e)}function aC(t,e,n,o,s){sn(dl(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:i}=x.useContext(Mo),{matches:l}=x.useContext(Rr),u=l[l.length-1],d=u?u.params:{},f=u?u.pathname:"/",g=u?u.pathnameBase:"/",m=u&&u.route;{let M=m&&m.path||"";lC(f,!m||M.endsWith("*")||M.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${f}" (under <Route path="${M}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
10
-
11
- Please change the parent <Route path="${M}"> to <Route path="${M==="/"?"*":`${M}/*`}">.`)}let y=ys(),v;if(e){let M=typeof e=="string"?cl(e):e;sn(g==="/"||M.pathname?.startsWith(g),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${g}" but pathname "${M.pathname}" was given in the \`location\` prop.`),v=M}else v=y;let w=v.pathname||"/",C=w;if(g!=="/"){let M=g.replace(/^\//,"").split("/");C="/"+w.replace(/^\//,"").split("/").slice(M.length).join("/")}let S=K2(t,{pathname:C});or(m||S!=null,`No routes matched location "${v.pathname}${v.search}${v.hash}" `),or(S==null||S[S.length-1].route.element!==void 0||S[S.length-1].route.Component!==void 0||S[S.length-1].route.lazy!==void 0,`Matched leaf route at location "${v.pathname}${v.search}${v.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let N=ET(S&&S.map(M=>Object.assign({},M,{params:Object.assign({},d,M.params),pathname:ls([g,i.encodeLocation?i.encodeLocation(M.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:M.pathname]),pathnameBase:M.pathnameBase==="/"?g:ls([g,i.encodeLocation?i.encodeLocation(M.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:M.pathnameBase])})),l,n,o,s);return e&&N?x.createElement(Xc.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...v},navigationType:"POP"}},N):N}function bT(){let t=DT(),e=iT(t)?`${t.status} ${t.statusText}`:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,o="rgba(200,200,200, 0.5)",s={padding:"0.5rem",backgroundColor:o},i={padding:"2px 4px",backgroundColor:o},l=null;return console.error("Error handled by React Router default ErrorBoundary:",t),l=x.createElement(x.Fragment,null,x.createElement("p",null,"💿 Hey developer 👋"),x.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",x.createElement("code",{style:i},"ErrorBoundary")," or"," ",x.createElement("code",{style:i},"errorElement")," prop on your route.")),x.createElement(x.Fragment,null,x.createElement("h2",null,"Unexpected Application Error!"),x.createElement("h3",{style:{fontStyle:"italic"}},e),n?x.createElement("pre",{style:s},n):null,l)}var wT=x.createElement(bT,null),iC=class extends x.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,e){return e.location!==t.location||e.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:e.error,location:e.location,revalidation:t.revalidation||e.revalidation}}componentDidCatch(t,e){this.props.onError?this.props.onError(t,e):console.error("React Router caught the following error during render",t)}render(){let t=this.state.error;if(this.context&&typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){const n=pT(t.digest);n&&(t=n)}let e=t!==void 0?x.createElement(Rr.Provider,{value:this.props.routeContext},x.createElement(D0.Provider,{value:t,children:this.props.component})):this.props.children;return this.context?x.createElement(ST,{error:t},e):e}};iC.contextType=uT;var Hg=new WeakMap;function ST({children:t,error:e}){let{basename:n}=x.useContext(Mo);if(typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){let o=gT(e.digest);if(o){let s=Hg.get(e);if(s)throw s;let i=J2(o.location,n);if(Z2&&!Hg.get(e))if(i.isExternal||o.reloadDocument)window.location.href=i.absoluteURL||i.to;else{const l=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:o.replace}));throw Hg.set(e,l),l}return x.createElement("meta",{httpEquiv:"refresh",content:`0;url=${i.absoluteURL||i.to}`})}}return t}function CT({routeContext:t,match:e,children:n}){let o=x.useContext(ul);return o&&o.static&&o.staticContext&&(e.route.errorElement||e.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=e.route.id),x.createElement(Rr.Provider,{value:t},n)}function ET(t,e=[],n=null,o=null,s=null){if(t==null){if(!n)return null;if(n.errors)t=n.matches;else if(e.length===0&&!n.initialized&&n.matches.length>0)t=n.matches;else return null}let i=t,l=n?.errors;if(l!=null){let g=i.findIndex(m=>m.route.id&&l?.[m.route.id]!==void 0);sn(g>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(l).join(",")}`),i=i.slice(0,Math.min(i.length,g+1))}let u=!1,d=-1;if(n)for(let g=0;g<i.length;g++){let m=i[g];if((m.route.HydrateFallback||m.route.hydrateFallbackElement)&&(d=g),m.route.id){let{loaderData:y,errors:v}=n,w=m.route.loader&&!y.hasOwnProperty(m.route.id)&&(!v||v[m.route.id]===void 0);if(m.route.lazy||w){u=!0,d>=0?i=i.slice(0,d+1):i=[i[0]];break}}}let f=n&&o?(g,m)=>{o(g,{location:n.location,params:n.matches?.[0]?.params??{},unstable_pattern:lT(n.matches),errorInfo:m})}:void 0;return i.reduceRight((g,m,y)=>{let v,w=!1,C=null,S=null;n&&(v=l&&m.route.id?l[m.route.id]:void 0,C=m.route.errorElement||wT,u&&(d<0&&y===0?(lC("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),w=!0,S=null):d===y&&(w=!0,S=m.route.hydrateFallbackElement||null)));let N=e.concat(i.slice(0,y+1)),M=()=>{let E;return v?E=C:w?E=S:m.route.Component?E=x.createElement(m.route.Component,null):m.route.element?E=m.route.element:E=g,x.createElement(CT,{match:m,routeContext:{outlet:g,matches:N,isDataRoute:n!=null},children:E})};return n&&(m.route.ErrorBoundary||m.route.errorElement||y===0)?x.createElement(iC,{location:n.location,revalidation:n.revalidation,component:C,error:v,children:M(),routeContext:{outlet:null,matches:N,isDataRoute:!0},onError:f}):M()},null)}function T0(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function _T(t){let e=x.useContext(ul);return sn(e,T0(t)),e}function NT(t){let e=x.useContext(Af);return sn(e,T0(t)),e}function MT(t){let e=x.useContext(Rr);return sn(e,T0(t)),e}function k0(t){let e=MT(t),n=e.matches[e.matches.length-1];return sn(n.route.id,`${t} can only be used on routes that contain a unique "id"`),n.route.id}function RT(){return k0("useRouteId")}function DT(){let t=x.useContext(D0),e=NT("useRouteError"),n=k0("useRouteError");return t!==void 0?t:e.errors?.[n]}function TT(){let{router:t}=_T("useNavigate"),e=k0("useNavigate"),n=x.useRef(!1);return rC(()=>{n.current=!0}),x.useCallback(async(s,i={})=>{or(n.current,oC),n.current&&(typeof s=="number"?await t.navigate(s):await t.navigate(s,{fromRouteId:e,...i}))},[t,e])}var sw={};function lC(t,e,n){!e&&!sw[t]&&(sw[t]=!0,or(!1,n))}x.memo(kT);function kT({routes:t,future:e,state:n,onError:o}){return aC(t,void 0,n,o,e)}function jT({to:t,replace:e,state:n,relative:o}){sn(dl(),"<Navigate> may be used only in the context of a <Router> component.");let{static:s}=x.useContext(Mo);or(!s,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:i}=x.useContext(Rr),{pathname:l}=ys(),u=sC(),d=R0(t,M0(i),l,o==="path"),f=JSON.stringify(d);return x.useEffect(()=>{u(JSON.parse(f),{replace:e,state:n,relative:o})},[u,f,o,e,n]),null}function $i(t){sn(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function AT({basename:t="/",children:e=null,location:n,navigationType:o="POP",navigator:s,static:i=!1,unstable_useTransitions:l}){sn(!dl(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let u=t.replace(/^\/*/,"/"),d=x.useMemo(()=>({basename:u,navigator:s,static:i,unstable_useTransitions:l,future:{}}),[u,s,i,l]);typeof n=="string"&&(n=cl(n));let{pathname:f="/",search:g="",hash:m="",state:y=null,key:v="default"}=n,w=x.useMemo(()=>{let C=us(f,u);return C==null?null:{location:{pathname:C,search:g,hash:m,state:y,key:v},navigationType:o}},[u,f,g,m,y,v,o]);return or(w!=null,`<Router basename="${u}"> is not able to match the URL "${f}${g}${m}" because it does not start with the basename, so the <Router> won't render anything.`),w==null?null:x.createElement(Mo.Provider,{value:d},x.createElement(Xc.Provider,{children:e,value:w}))}function OT({children:t,location:e}){return xT(Ip(t),e)}function Ip(t,e=[]){let n=[];return x.Children.forEach(t,(o,s)=>{if(!x.isValidElement(o))return;let i=[...e,s];if(o.type===x.Fragment){n.push.apply(n,Ip(o.props.children,i));return}sn(o.type===$i,`[${typeof o.type=="string"?o.type:o.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),sn(!o.props.index||!o.props.children,"An index route cannot have child routes.");let l={id:o.props.id||i.join("-"),caseSensitive:o.props.caseSensitive,element:o.props.element,Component:o.props.Component,index:o.props.index,path:o.props.path,middleware:o.props.middleware,loader:o.props.loader,action:o.props.action,hydrateFallbackElement:o.props.hydrateFallbackElement,HydrateFallback:o.props.HydrateFallback,errorElement:o.props.errorElement,ErrorBoundary:o.props.ErrorBoundary,hasErrorBoundary:o.props.hasErrorBoundary===!0||o.props.ErrorBoundary!=null||o.props.errorElement!=null,shouldRevalidate:o.props.shouldRevalidate,handle:o.props.handle,lazy:o.props.lazy};o.props.children&&(l.children=Ip(o.props.children,i)),n.push(l)}),n}var Zd="get",Jd="application/x-www-form-urlencoded";function Of(t){return typeof HTMLElement<"u"&&t instanceof HTMLElement}function zT(t){return Of(t)&&t.tagName.toLowerCase()==="button"}function IT(t){return Of(t)&&t.tagName.toLowerCase()==="form"}function PT(t){return Of(t)&&t.tagName.toLowerCase()==="input"}function $T(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function LT(t,e){return t.button===0&&(!e||e==="_self")&&!$T(t)}var Td=null;function HT(){if(Td===null)try{new FormData(document.createElement("form"),0),Td=!1}catch{Td=!0}return Td}var BT=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Bg(t){return t!=null&&!BT.has(t)?(or(!1,`"${t}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Jd}"`),null):t}function FT(t,e){let n,o,s,i,l;if(IT(t)){let u=t.getAttribute("action");o=u?us(u,e):null,n=t.getAttribute("method")||Zd,s=Bg(t.getAttribute("enctype"))||Jd,i=new FormData(t)}else if(zT(t)||PT(t)&&(t.type==="submit"||t.type==="image")){let u=t.form;if(u==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let d=t.getAttribute("formaction")||u.getAttribute("action");if(o=d?us(d,e):null,n=t.getAttribute("formmethod")||u.getAttribute("method")||Zd,s=Bg(t.getAttribute("formenctype"))||Bg(u.getAttribute("enctype"))||Jd,i=new FormData(u,t),!HT()){let{name:f,type:g,value:m}=t;if(g==="image"){let y=f?`${f}.`:"";i.append(`${y}x`,"0"),i.append(`${y}y`,"0")}else f&&i.append(f,m)}}else{if(Of(t))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Zd,o=null,s=Jd,l=t}return i&&s==="text/plain"&&(l=i,i=void 0),{action:o,method:n.toLowerCase(),encType:s,formData:i,body:l}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function j0(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function VT(t,e,n,o){let s=typeof t=="string"?new URL(t,typeof window>"u"?"server://singlefetch/":window.location.origin):t;return n?s.pathname.endsWith("/")?s.pathname=`${s.pathname}_.${o}`:s.pathname=`${s.pathname}.${o}`:s.pathname==="/"?s.pathname=`_root.${o}`:e&&us(s.pathname,e)==="/"?s.pathname=`${e.replace(/\/$/,"")}/_root.${o}`:s.pathname=`${s.pathname.replace(/\/$/,"")}.${o}`,s}async function UT(t,e){if(t.id in e)return e[t.id];try{let n=await import(t.module);return e[t.id]=n,n}catch(n){return console.error(`Error loading route module \`${t.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function YT(t){return t==null?!1:t.href==null?t.rel==="preload"&&typeof t.imageSrcSet=="string"&&typeof t.imageSizes=="string":typeof t.rel=="string"&&typeof t.href=="string"}async function GT(t,e,n){let o=await Promise.all(t.map(async s=>{let i=e.routes[s.route.id];if(i){let l=await UT(i,n);return l.links?l.links():[]}return[]}));return XT(o.flat(1).filter(YT).filter(s=>s.rel==="stylesheet"||s.rel==="preload").map(s=>s.rel==="stylesheet"?{...s,rel:"prefetch",as:"style"}:{...s,rel:"prefetch"}))}function aw(t,e,n,o,s,i){let l=(d,f)=>n[f]?d.route.id!==n[f].route.id:!0,u=(d,f)=>n[f].pathname!==d.pathname||n[f].route.path?.endsWith("*")&&n[f].params["*"]!==d.params["*"];return i==="assets"?e.filter((d,f)=>l(d,f)||u(d,f)):i==="data"?e.filter((d,f)=>{let g=o.routes[d.route.id];if(!g||!g.hasLoader)return!1;if(l(d,f)||u(d,f))return!0;if(d.route.shouldRevalidate){let m=d.route.shouldRevalidate({currentUrl:new URL(s.pathname+s.search+s.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(t,window.origin),nextParams:d.params,defaultShouldRevalidate:!0});if(typeof m=="boolean")return m}return!0}):[]}function qT(t,e,{includeHydrateFallback:n}={}){return WT(t.map(o=>{let s=e.routes[o.route.id];if(!s)return[];let i=[s.module];return s.clientActionModule&&(i=i.concat(s.clientActionModule)),s.clientLoaderModule&&(i=i.concat(s.clientLoaderModule)),n&&s.hydrateFallbackModule&&(i=i.concat(s.hydrateFallbackModule)),s.imports&&(i=i.concat(s.imports)),i}).flat(1))}function WT(t){return[...new Set(t)]}function KT(t){let e={},n=Object.keys(t).sort();for(let o of n)e[o]=t[o];return e}function XT(t,e){let n=new Set;return new Set(e),t.reduce((o,s)=>{let i=JSON.stringify(KT(s));return n.has(i)||(n.add(i),o.push({key:i,link:s})),o},[])}function cC(){let t=x.useContext(ul);return j0(t,"You must render this element inside a <DataRouterContext.Provider> element"),t}function QT(){let t=x.useContext(Af);return j0(t,"You must render this element inside a <DataRouterStateContext.Provider> element"),t}var A0=x.createContext(void 0);A0.displayName="FrameworkContext";function uC(){let t=x.useContext(A0);return j0(t,"You must render this element inside a <HydratedRouter> element"),t}function ZT(t,e){let n=x.useContext(A0),[o,s]=x.useState(!1),[i,l]=x.useState(!1),{onFocus:u,onBlur:d,onMouseEnter:f,onMouseLeave:g,onTouchStart:m}=e,y=x.useRef(null);x.useEffect(()=>{if(t==="render"&&l(!0),t==="viewport"){let C=N=>{N.forEach(M=>{l(M.isIntersecting)})},S=new IntersectionObserver(C,{threshold:.5});return y.current&&S.observe(y.current),()=>{S.disconnect()}}},[t]),x.useEffect(()=>{if(o){let C=setTimeout(()=>{l(!0)},100);return()=>{clearTimeout(C)}}},[o]);let v=()=>{s(!0)},w=()=>{s(!1),l(!1)};return n?t!=="intent"?[i,y,{}]:[i,y,{onFocus:fc(u,v),onBlur:fc(d,w),onMouseEnter:fc(f,v),onMouseLeave:fc(g,w),onTouchStart:fc(m,v)}]:[!1,y,{}]}function fc(t,e){return n=>{t&&t(n),n.defaultPrevented||e(n)}}function JT({page:t,...e}){let{router:n}=cC(),o=x.useMemo(()=>K2(n.routes,t,n.basename),[n.routes,t,n.basename]);return o?x.createElement(tk,{page:t,matches:o,...e}):null}function ek(t){let{manifest:e,routeModules:n}=uC(),[o,s]=x.useState([]);return x.useEffect(()=>{let i=!1;return GT(t,e,n).then(l=>{i||s(l)}),()=>{i=!0}},[t,e,n]),o}function tk({page:t,matches:e,...n}){let o=ys(),{future:s,manifest:i,routeModules:l}=uC(),{basename:u}=cC(),{loaderData:d,matches:f}=QT(),g=x.useMemo(()=>aw(t,e,f,i,o,"data"),[t,e,f,i,o]),m=x.useMemo(()=>aw(t,e,f,i,o,"assets"),[t,e,f,i,o]),y=x.useMemo(()=>{if(t===o.pathname+o.search+o.hash)return[];let C=new Set,S=!1;if(e.forEach(M=>{let E=i.routes[M.route.id];!E||!E.hasLoader||(!g.some(R=>R.route.id===M.route.id)&&M.route.id in d&&l[M.route.id]?.shouldRevalidate||E.hasClientLoader?S=!0:C.add(M.route.id))}),C.size===0)return[];let N=VT(t,u,s.unstable_trailingSlashAwareDataRequests,"data");return S&&C.size>0&&N.searchParams.set("_routes",e.filter(M=>C.has(M.route.id)).map(M=>M.route.id).join(",")),[N.pathname+N.search]},[u,s.unstable_trailingSlashAwareDataRequests,d,o,i,g,e,t,l]),v=x.useMemo(()=>qT(m,i),[m,i]),w=ek(m);return x.createElement(x.Fragment,null,y.map(C=>x.createElement("link",{key:C,rel:"prefetch",as:"fetch",href:C,...n})),v.map(C=>x.createElement("link",{key:C,rel:"modulepreload",href:C,...n})),w.map(({key:C,link:S})=>x.createElement("link",{key:C,nonce:n.nonce,...S,crossOrigin:S.crossOrigin??n.crossOrigin})))}function nk(...t){return e=>{t.forEach(n=>{typeof n=="function"?n(e):n!=null&&(n.current=e)})}}var ok=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{ok&&(window.__reactRouterVersion="7.13.0")}catch{}function rk({basename:t,children:e,unstable_useTransitions:n,window:o}){let s=x.useRef();s.current==null&&(s.current=P4({window:o,v5Compat:!0}));let i=s.current,[l,u]=x.useState({action:i.action,location:i.location}),d=x.useCallback(f=>{n===!1?u(f):x.startTransition(()=>u(f))},[n]);return x.useLayoutEffect(()=>i.listen(d),[i,d]),x.createElement(AT,{basename:t,children:e,location:l.location,navigationType:l.action,navigator:i,unstable_useTransitions:n})}var dC=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,O0=x.forwardRef(function({onClick:e,discover:n="render",prefetch:o="none",relative:s,reloadDocument:i,replace:l,state:u,target:d,to:f,preventScrollReset:g,viewTransition:m,unstable_defaultShouldRevalidate:y,...v},w){let{basename:C,unstable_useTransitions:S}=x.useContext(Mo),N=typeof f=="string"&&dC.test(f),M=J2(f,C);f=M.to;let E=yT(f,{relative:s}),[R,D,T]=ZT(o,v),k=lk(f,{replace:l,state:u,target:d,preventScrollReset:g,relative:s,viewTransition:m,unstable_defaultShouldRevalidate:y,unstable_useTransitions:S});function O(W){e&&e(W),W.defaultPrevented||k(W)}let L=x.createElement("a",{...v,...T,href:M.absoluteURL||E,onClick:M.isExternal||i?e:O,ref:nk(w,D),target:d,"data-discover":!N&&n==="render"?"true":void 0});return R&&!N?x.createElement(x.Fragment,null,L,x.createElement(JT,{page:E})):L});O0.displayName="Link";var sk=x.forwardRef(function({"aria-current":e="page",caseSensitive:n=!1,className:o="",end:s=!1,style:i,to:l,viewTransition:u,children:d,...f},g){let m=Qc(l,{relative:f.relative}),y=ys(),v=x.useContext(Af),{navigator:w,basename:C}=x.useContext(Mo),S=v!=null&&hk(m)&&u===!0,N=w.encodeLocation?w.encodeLocation(m).pathname:m.pathname,M=y.pathname,E=v&&v.navigation&&v.navigation.location?v.navigation.location.pathname:null;n||(M=M.toLowerCase(),E=E?E.toLowerCase():null,N=N.toLowerCase()),E&&C&&(E=us(E,C)||E);const R=N!=="/"&&N.endsWith("/")?N.length-1:N.length;let D=M===N||!s&&M.startsWith(N)&&M.charAt(R)==="/",T=E!=null&&(E===N||!s&&E.startsWith(N)&&E.charAt(N.length)==="/"),k={isActive:D,isPending:T,isTransitioning:S},O=D?e:void 0,L;typeof o=="function"?L=o(k):L=[o,D?"active":null,T?"pending":null,S?"transitioning":null].filter(Boolean).join(" ");let W=typeof i=="function"?i(k):i;return x.createElement(O0,{...f,"aria-current":O,className:L,ref:g,style:W,to:l,viewTransition:u},typeof d=="function"?d(k):d)});sk.displayName="NavLink";var ak=x.forwardRef(({discover:t="render",fetcherKey:e,navigate:n,reloadDocument:o,replace:s,state:i,method:l=Zd,action:u,onSubmit:d,relative:f,preventScrollReset:g,viewTransition:m,unstable_defaultShouldRevalidate:y,...v},w)=>{let{unstable_useTransitions:C}=x.useContext(Mo),S=dk(),N=fk(u,{relative:f}),M=l.toLowerCase()==="get"?"get":"post",E=typeof u=="string"&&dC.test(u),R=D=>{if(d&&d(D),D.defaultPrevented)return;D.preventDefault();let T=D.nativeEvent.submitter,k=T?.getAttribute("formmethod")||l,O=()=>S(T||D.currentTarget,{fetcherKey:e,method:k,navigate:n,replace:s,state:i,relative:f,preventScrollReset:g,viewTransition:m,unstable_defaultShouldRevalidate:y});C&&n!==!1?x.startTransition(()=>O()):O()};return x.createElement("form",{ref:w,method:M,action:N,onSubmit:o?d:R,...v,"data-discover":!E&&t==="render"?"true":void 0})});ak.displayName="Form";function ik(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function fC(t){let e=x.useContext(ul);return sn(e,ik(t)),e}function lk(t,{target:e,replace:n,state:o,preventScrollReset:s,relative:i,viewTransition:l,unstable_defaultShouldRevalidate:u,unstable_useTransitions:d}={}){let f=sC(),g=ys(),m=Qc(t,{relative:i});return x.useCallback(y=>{if(LT(y,e)){y.preventDefault();let v=n!==void 0?n:Tc(g)===Tc(m),w=()=>f(t,{replace:v,state:o,preventScrollReset:s,relative:i,viewTransition:l,unstable_defaultShouldRevalidate:u});d?x.startTransition(()=>w()):w()}},[g,f,m,n,o,e,t,s,i,l,u,d])}var ck=0,uk=()=>`__${String(++ck)}__`;function dk(){let{router:t}=fC("useSubmit"),{basename:e}=x.useContext(Mo),n=RT(),o=t.fetch,s=t.navigate;return x.useCallback(async(i,l={})=>{let{action:u,method:d,encType:f,formData:g,body:m}=FT(i,e);if(l.navigate===!1){let y=l.fetcherKey||uk();await o(y,n,l.action||u,{unstable_defaultShouldRevalidate:l.unstable_defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:g,body:m,formMethod:l.method||d,formEncType:l.encType||f,flushSync:l.flushSync})}else await s(l.action||u,{unstable_defaultShouldRevalidate:l.unstable_defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:g,body:m,formMethod:l.method||d,formEncType:l.encType||f,replace:l.replace,state:l.state,fromRouteId:n,flushSync:l.flushSync,viewTransition:l.viewTransition})},[o,s,e,n])}function fk(t,{relative:e}={}){let{basename:n}=x.useContext(Mo),o=x.useContext(Rr);sn(o,"useFormAction must be used inside a RouteContext");let[s]=o.matches.slice(-1),i={...Qc(t||".",{relative:e})},l=ys();if(t==null){i.search=l.search;let u=new URLSearchParams(i.search),d=u.getAll("index");if(d.some(g=>g==="")){u.delete("index"),d.filter(m=>m).forEach(m=>u.append("index",m));let g=u.toString();i.search=g?`?${g}`:""}}return(!t||t===".")&&s.route.index&&(i.search=i.search?i.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(i.pathname=i.pathname==="/"?n:ls([n,i.pathname])),Tc(i)}function hk(t,{relative:e}={}){let n=x.useContext(tC);sn(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:o}=fC("useViewTransitionState"),s=Qc(t,{relative:e});if(!n.isTransitioning)return!1;let i=us(n.currentLocation.pathname,o)||n.currentLocation.pathname,l=us(n.nextLocation.pathname,o)||n.nextLocation.pathname;return uf(s.pathname,l)!=null||uf(s.pathname,i)!=null}var qa=W2();const hC=N0(qa);var Fg={exports:{}},Vg={};var iw;function mk(){if(iw)return Vg;iw=1;var t=ll().__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;return Vg.c=function(e){return t.H.useMemoCache(e)},Vg}var lw;function gk(){return lw||(lw=1,Fg.exports=mk()),Fg.exports}var ge=gk();function pk(t){if(typeof document>"u")return;let e=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",e.appendChild(n),n.styleSheet?n.styleSheet.cssText=t:n.appendChild(document.createTextNode(t))}const yk=t=>{switch(t){case"success":return bk;case"info":return Sk;case"warning":return wk;case"error":return Ck;default:return null}},vk=Array(12).fill(0),xk=({visible:t,className:e})=>de.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":t},de.createElement("div",{className:"sonner-spinner"},vk.map((n,o)=>de.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${o}`})))),bk=de.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},de.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),wk=de.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},de.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),Sk=de.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},de.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),Ck=de.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},de.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),Ek=de.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},de.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),de.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),_k=()=>{const[t,e]=de.useState(document.hidden);return de.useEffect(()=>{const n=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),t};let Pp=1;class Nk{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{const n=this.subscribers.indexOf(e);this.subscribers.splice(n,1)}),this.publish=e=>{this.subscribers.forEach(n=>n(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var n;const{message:o,...s}=e,i=typeof e?.id=="number"||((n=e.id)==null?void 0:n.length)>0?e.id:Pp++,l=this.toasts.find(d=>d.id===i),u=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(i)&&this.dismissedToasts.delete(i),l?this.toasts=this.toasts.map(d=>d.id===i?(this.publish({...d,...e,id:i,title:o}),{...d,...e,id:i,dismissible:u,title:o}):d):this.addToast({title:o,...s,dismissible:u,id:i}),i},this.dismiss=e=>(e?(this.dismissedToasts.add(e),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:e,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(o=>o({id:n.id,dismiss:!0}))}),e),this.message=(e,n)=>this.create({...n,message:e}),this.error=(e,n)=>this.create({...n,message:e,type:"error"}),this.success=(e,n)=>this.create({...n,type:"success",message:e}),this.info=(e,n)=>this.create({...n,type:"info",message:e}),this.warning=(e,n)=>this.create({...n,type:"warning",message:e}),this.loading=(e,n)=>this.create({...n,type:"loading",message:e}),this.promise=(e,n)=>{if(!n)return;let o;n.loading!==void 0&&(o=this.create({...n,promise:e,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const s=Promise.resolve(e instanceof Function?e():e);let i=o!==void 0,l;const u=s.then(async f=>{if(l=["resolve",f],de.isValidElement(f))i=!1,this.create({id:o,type:"default",message:f});else if(Rk(f)&&!f.ok){i=!1;const m=typeof n.error=="function"?await n.error(`HTTP error! status: ${f.status}`):n.error,y=typeof n.description=="function"?await n.description(`HTTP error! status: ${f.status}`):n.description,w=typeof m=="object"&&!de.isValidElement(m)?m:{message:m};this.create({id:o,type:"error",description:y,...w})}else if(f instanceof Error){i=!1;const m=typeof n.error=="function"?await n.error(f):n.error,y=typeof n.description=="function"?await n.description(f):n.description,w=typeof m=="object"&&!de.isValidElement(m)?m:{message:m};this.create({id:o,type:"error",description:y,...w})}else if(n.success!==void 0){i=!1;const m=typeof n.success=="function"?await n.success(f):n.success,y=typeof n.description=="function"?await n.description(f):n.description,w=typeof m=="object"&&!de.isValidElement(m)?m:{message:m};this.create({id:o,type:"success",description:y,...w})}}).catch(async f=>{if(l=["reject",f],n.error!==void 0){i=!1;const g=typeof n.error=="function"?await n.error(f):n.error,m=typeof n.description=="function"?await n.description(f):n.description,v=typeof g=="object"&&!de.isValidElement(g)?g:{message:g};this.create({id:o,type:"error",description:m,...v})}}).finally(()=>{i&&(this.dismiss(o),o=void 0),n.finally==null||n.finally.call(n)}),d=()=>new Promise((f,g)=>u.then(()=>l[0]==="reject"?g(l[1]):f(l[1])).catch(g));return typeof o!="string"&&typeof o!="number"?{unwrap:d}:Object.assign(o,{unwrap:d})},this.custom=(e,n)=>{const o=n?.id||Pp++;return this.create({jsx:e(o),id:o,...n}),o},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const ao=new Nk,Mk=(t,e)=>{const n=e?.id||Pp++;return ao.addToast({title:t,...e,id:n}),n},Rk=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",Dk=Mk,Tk=()=>ao.toasts,kk=()=>ao.getActiveToasts(),Jt=Object.assign(Dk,{success:ao.success,info:ao.info,warning:ao.warning,error:ao.error,custom:ao.custom,message:ao.message,promise:ao.promise,dismiss:ao.dismiss,loading:ao.loading},{getHistory:Tk,getToasts:kk});pk("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function kd(t){return t.label!==void 0}const jk=3,Ak="24px",Ok="16px",cw=4e3,zk=356,Ik=14,Pk=45,$k=200;function mr(...t){return t.filter(Boolean).join(" ")}function Lk(t){const[e,n]=t.split("-"),o=[];return e&&o.push(e),n&&o.push(n),o}const Hk=t=>{var e,n,o,s,i,l,u,d,f;const{invert:g,toast:m,unstyled:y,interacting:v,setHeights:w,visibleToasts:C,heights:S,index:N,toasts:M,expanded:E,removeToast:R,defaultRichColors:D,closeButton:T,style:k,cancelButtonStyle:O,actionButtonStyle:L,className:W="",descriptionClassName:B="",duration:Y,position:q,gap:z,expandByDefault:V,classNames:A,icons:H,closeButtonAriaLabel:P="Close toast"}=t,[F,Q]=de.useState(null),[$,I]=de.useState(null),[U,K]=de.useState(!1),[J,ne]=de.useState(!1),[X,ee]=de.useState(!1),[se,le]=de.useState(!1),[pe,ie]=de.useState(!1),[be,ke]=de.useState(0),[Be,Ie]=de.useState(0),lt=de.useRef(m.duration||Y||cw),cn=de.useRef(null),ht=de.useRef(null),bn=N===0,un=N+1<=C,Vt=m.type,mn=m.dismissible!==!1,It=m.className||"",Mn=m.descriptionClassName||"",yn=de.useMemo(()=>S.findIndex(De=>De.toastId===m.id)||0,[S,m.id]),In=de.useMemo(()=>{var De;return(De=m.closeButton)!=null?De:T},[m.closeButton,T]),On=de.useMemo(()=>m.duration||Y||cw,[m.duration,Y]),_e=de.useRef(0),Ue=de.useRef(0),_t=de.useRef(0),Qe=de.useRef(null),[st,gt]=q.split("-"),Wt=de.useMemo(()=>S.reduce((De,At,Xt)=>Xt>=yn?De:De+At.height,0),[S,yn]),Kt=_k(),Zn=m.invert||g,Nt=Vt==="loading";Ue.current=de.useMemo(()=>yn*z+Wt,[yn,Wt]),de.useEffect(()=>{lt.current=On},[On]),de.useEffect(()=>{K(!0)},[]),de.useEffect(()=>{const De=ht.current;if(De){const At=De.getBoundingClientRect().height;return Ie(At),w(Xt=>[{toastId:m.id,height:At,position:m.position},...Xt]),()=>w(Xt=>Xt.filter(dn=>dn.toastId!==m.id))}},[w,m.id]),de.useLayoutEffect(()=>{if(!U)return;const De=ht.current,At=De.style.height;De.style.height="auto";const Xt=De.getBoundingClientRect().height;De.style.height=At,Ie(Xt),w(dn=>dn.find(Tt=>Tt.toastId===m.id)?dn.map(Tt=>Tt.toastId===m.id?{...Tt,height:Xt}:Tt):[{toastId:m.id,height:Xt,position:m.position},...dn])},[U,m.title,m.description,w,m.id,m.jsx,m.action,m.cancel]);const Fe=de.useCallback(()=>{ne(!0),ke(Ue.current),w(De=>De.filter(At=>At.toastId!==m.id)),setTimeout(()=>{R(m)},$k)},[m,R,w,Ue]);de.useEffect(()=>{if(m.promise&&Vt==="loading"||m.duration===1/0||m.type==="loading")return;let De;return E||v||Kt?(()=>{if(_t.current<_e.current){const dn=new Date().getTime()-_e.current;lt.current=lt.current-dn}_t.current=new Date().getTime()})():lt.current!==1/0&&(_e.current=new Date().getTime(),De=setTimeout(()=>{m.onAutoClose==null||m.onAutoClose.call(m,m),Fe()},lt.current)),()=>clearTimeout(De)},[E,v,m,Vt,Kt,Fe]),de.useEffect(()=>{m.delete&&(Fe(),m.onDismiss==null||m.onDismiss.call(m,m))},[Fe,m.delete]);function nt(){var De;if(H?.loading){var At;return de.createElement("div",{className:mr(A?.loader,m==null||(At=m.classNames)==null?void 0:At.loader,"sonner-loader"),"data-visible":Vt==="loading"},H.loading)}return de.createElement(xk,{className:mr(A?.loader,m==null||(De=m.classNames)==null?void 0:De.loader),visible:Vt==="loading"})}const Ye=m.icon||H?.[Vt]||yk(Vt);var at,Lt;return de.createElement("li",{tabIndex:0,ref:ht,className:mr(W,It,A?.toast,m==null||(e=m.classNames)==null?void 0:e.toast,A?.default,A?.[Vt],m==null||(n=m.classNames)==null?void 0:n[Vt]),"data-sonner-toast":"","data-rich-colors":(at=m.richColors)!=null?at:D,"data-styled":!(m.jsx||m.unstyled||y),"data-mounted":U,"data-promise":!!m.promise,"data-swiped":pe,"data-removed":J,"data-visible":un,"data-y-position":st,"data-x-position":gt,"data-index":N,"data-front":bn,"data-swiping":X,"data-dismissible":mn,"data-type":Vt,"data-invert":Zn,"data-swipe-out":se,"data-swipe-direction":$,"data-expanded":!!(E||V&&U),"data-testid":m.testId,style:{"--index":N,"--toasts-before":N,"--z-index":M.length-N,"--offset":`${J?be:Ue.current}px`,"--initial-height":V?"auto":`${Be}px`,...k,...m.style},onDragEnd:()=>{ee(!1),Q(null),Qe.current=null},onPointerDown:De=>{De.button!==2&&(Nt||!mn||(cn.current=new Date,ke(Ue.current),De.target.setPointerCapture(De.pointerId),De.target.tagName!=="BUTTON"&&(ee(!0),Qe.current={x:De.clientX,y:De.clientY})))},onPointerUp:()=>{var De,At,Xt;if(se||!mn)return;Qe.current=null;const dn=Number(((De=ht.current)==null?void 0:De.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Pn=Number(((At=ht.current)==null?void 0:At.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Tt=new Date().getTime()-((Xt=cn.current)==null?void 0:Xt.getTime()),Rn=F==="x"?dn:Pn,Yo=Math.abs(Rn)/Tt;if(Math.abs(Rn)>=Pk||Yo>.11){ke(Ue.current),m.onDismiss==null||m.onDismiss.call(m,m),I(F==="x"?dn>0?"right":"left":Pn>0?"down":"up"),Fe(),le(!0);return}else{var vt,Dn;(vt=ht.current)==null||vt.style.setProperty("--swipe-amount-x","0px"),(Dn=ht.current)==null||Dn.style.setProperty("--swipe-amount-y","0px")}ie(!1),ee(!1),Q(null)},onPointerMove:De=>{var At,Xt,dn;if(!Qe.current||!mn||((At=window.getSelection())==null?void 0:At.toString().length)>0)return;const Tt=De.clientY-Qe.current.y,Rn=De.clientX-Qe.current.x;var Yo;const vt=(Yo=t.swipeDirections)!=null?Yo:Lk(q);!F&&(Math.abs(Rn)>1||Math.abs(Tt)>1)&&Q(Math.abs(Rn)>Math.abs(Tt)?"x":"y");let Dn={x:0,y:0};const Do=Un=>1/(1.5+Math.abs(Un)/20);if(F==="y"){if(vt.includes("top")||vt.includes("bottom"))if(vt.includes("top")&&Tt<0||vt.includes("bottom")&&Tt>0)Dn.y=Tt;else{const Un=Tt*Do(Tt);Dn.y=Math.abs(Un)<Math.abs(Tt)?Un:Tt}}else if(F==="x"&&(vt.includes("left")||vt.includes("right")))if(vt.includes("left")&&Rn<0||vt.includes("right")&&Rn>0)Dn.x=Rn;else{const Un=Rn*Do(Rn);Dn.x=Math.abs(Un)<Math.abs(Rn)?Un:Rn}(Math.abs(Dn.x)>0||Math.abs(Dn.y)>0)&&ie(!0),(Xt=ht.current)==null||Xt.style.setProperty("--swipe-amount-x",`${Dn.x}px`),(dn=ht.current)==null||dn.style.setProperty("--swipe-amount-y",`${Dn.y}px`)}},In&&!m.jsx&&Vt!=="loading"?de.createElement("button",{"aria-label":P,"data-disabled":Nt,"data-close-button":!0,onClick:Nt||!mn?()=>{}:()=>{Fe(),m.onDismiss==null||m.onDismiss.call(m,m)},className:mr(A?.closeButton,m==null||(o=m.classNames)==null?void 0:o.closeButton)},(Lt=H?.close)!=null?Lt:Ek):null,(Vt||m.icon||m.promise)&&m.icon!==null&&(H?.[Vt]!==null||m.icon)?de.createElement("div",{"data-icon":"",className:mr(A?.icon,m==null||(s=m.classNames)==null?void 0:s.icon)},m.promise||m.type==="loading"&&!m.icon?m.icon||nt():null,m.type!=="loading"?Ye:null):null,de.createElement("div",{"data-content":"",className:mr(A?.content,m==null||(i=m.classNames)==null?void 0:i.content)},de.createElement("div",{"data-title":"",className:mr(A?.title,m==null||(l=m.classNames)==null?void 0:l.title)},m.jsx?m.jsx:typeof m.title=="function"?m.title():m.title),m.description?de.createElement("div",{"data-description":"",className:mr(B,Mn,A?.description,m==null||(u=m.classNames)==null?void 0:u.description)},typeof m.description=="function"?m.description():m.description):null),de.isValidElement(m.cancel)?m.cancel:m.cancel&&kd(m.cancel)?de.createElement("button",{"data-button":!0,"data-cancel":!0,style:m.cancelButtonStyle||O,onClick:De=>{kd(m.cancel)&&mn&&(m.cancel.onClick==null||m.cancel.onClick.call(m.cancel,De),Fe())},className:mr(A?.cancelButton,m==null||(d=m.classNames)==null?void 0:d.cancelButton)},m.cancel.label):null,de.isValidElement(m.action)?m.action:m.action&&kd(m.action)?de.createElement("button",{"data-button":!0,"data-action":!0,style:m.actionButtonStyle||L,onClick:De=>{kd(m.action)&&(m.action.onClick==null||m.action.onClick.call(m.action,De),!De.defaultPrevented&&Fe())},className:mr(A?.actionButton,m==null||(f=m.classNames)==null?void 0:f.actionButton)},m.action.label):null)};function uw(){if(typeof window>"u"||typeof document>"u")return"ltr";const t=document.documentElement.getAttribute("dir");return t==="auto"||!t?window.getComputedStyle(document.documentElement).direction:t}function Bk(t,e){const n={};return[t,e].forEach((o,s)=>{const i=s===1,l=i?"--mobile-offset":"--offset",u=i?Ok:Ak;function d(f){["top","right","bottom","left"].forEach(g=>{n[`${l}-${g}`]=typeof f=="number"?`${f}px`:f})}typeof o=="number"||typeof o=="string"?d(o):typeof o=="object"?["top","right","bottom","left"].forEach(f=>{o[f]===void 0?n[`${l}-${f}`]=u:n[`${l}-${f}`]=typeof o[f]=="number"?`${o[f]}px`:o[f]}):d(u)}),n}const Fk=de.forwardRef(function(e,n){const{id:o,invert:s,position:i="bottom-right",hotkey:l=["altKey","KeyT"],expand:u,closeButton:d,className:f,offset:g,mobileOffset:m,theme:y="light",richColors:v,duration:w,style:C,visibleToasts:S=jk,toastOptions:N,dir:M=uw(),gap:E=Ik,icons:R,containerAriaLabel:D="Notifications"}=e,[T,k]=de.useState([]),O=de.useMemo(()=>o?T.filter(U=>U.toasterId===o):T.filter(U=>!U.toasterId),[T,o]),L=de.useMemo(()=>Array.from(new Set([i].concat(O.filter(U=>U.position).map(U=>U.position)))),[O,i]),[W,B]=de.useState([]),[Y,q]=de.useState(!1),[z,V]=de.useState(!1),[A,H]=de.useState(y!=="system"?y:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),P=de.useRef(null),F=l.join("+").replace(/Key/g,"").replace(/Digit/g,""),Q=de.useRef(null),$=de.useRef(!1),I=de.useCallback(U=>{k(K=>{var J;return(J=K.find(ne=>ne.id===U.id))!=null&&J.delete||ao.dismiss(U.id),K.filter(({id:ne})=>ne!==U.id)})},[]);return de.useEffect(()=>ao.subscribe(U=>{if(U.dismiss){requestAnimationFrame(()=>{k(K=>K.map(J=>J.id===U.id?{...J,delete:!0}:J))});return}setTimeout(()=>{hC.flushSync(()=>{k(K=>{const J=K.findIndex(ne=>ne.id===U.id);return J!==-1?[...K.slice(0,J),{...K[J],...U},...K.slice(J+1)]:[U,...K]})})})}),[T]),de.useEffect(()=>{if(y!=="system"){H(y);return}if(y==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?H("dark"):H("light")),typeof window>"u")return;const U=window.matchMedia("(prefers-color-scheme: dark)");try{U.addEventListener("change",({matches:K})=>{H(K?"dark":"light")})}catch{U.addListener(({matches:J})=>{try{H(J?"dark":"light")}catch(ne){console.error(ne)}})}},[y]),de.useEffect(()=>{T.length<=1&&q(!1)},[T]),de.useEffect(()=>{const U=K=>{var J;if(l.every(ee=>K[ee]||K.code===ee)){var X;q(!0),(X=P.current)==null||X.focus()}K.code==="Escape"&&(document.activeElement===P.current||(J=P.current)!=null&&J.contains(document.activeElement))&&q(!1)};return document.addEventListener("keydown",U),()=>document.removeEventListener("keydown",U)},[l]),de.useEffect(()=>{if(P.current)return()=>{Q.current&&(Q.current.focus({preventScroll:!0}),Q.current=null,$.current=!1)}},[P.current]),de.createElement("section",{ref:n,"aria-label":`${D} ${F}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},L.map((U,K)=>{var J;const[ne,X]=U.split("-");return O.length?de.createElement("ol",{key:U,dir:M==="auto"?uw():M,tabIndex:-1,ref:P,className:f,"data-sonner-toaster":!0,"data-sonner-theme":A,"data-y-position":ne,"data-x-position":X,style:{"--front-toast-height":`${((J=W[0])==null?void 0:J.height)||0}px`,"--width":`${zk}px`,"--gap":`${E}px`,...C,...Bk(g,m)},onBlur:ee=>{$.current&&!ee.currentTarget.contains(ee.relatedTarget)&&($.current=!1,Q.current&&(Q.current.focus({preventScroll:!0}),Q.current=null))},onFocus:ee=>{ee.target instanceof HTMLElement&&ee.target.dataset.dismissible==="false"||$.current||($.current=!0,Q.current=ee.relatedTarget)},onMouseEnter:()=>q(!0),onMouseMove:()=>q(!0),onMouseLeave:()=>{z||q(!1)},onDragEnd:()=>q(!1),onPointerDown:ee=>{ee.target instanceof HTMLElement&&ee.target.dataset.dismissible==="false"||V(!0)},onPointerUp:()=>V(!1)},O.filter(ee=>!ee.position&&K===0||ee.position===U).map((ee,se)=>{var le,pe;return de.createElement(Hk,{key:ee.id,icons:R,index:se,toast:ee,defaultRichColors:v,duration:(le=N?.duration)!=null?le:w,className:N?.className,descriptionClassName:N?.descriptionClassName,invert:s,visibleToasts:S,closeButton:(pe=N?.closeButton)!=null?pe:d,interacting:z,position:U,style:N?.style,unstyled:N?.unstyled,classNames:N?.classNames,cancelButtonStyle:N?.cancelButtonStyle,actionButtonStyle:N?.actionButtonStyle,closeButtonAriaLabel:N?.closeButtonAriaLabel,removeToast:I,toasts:O.filter(ie=>ie.position==ee.position),heights:W.filter(ie=>ie.position==ee.position),setHeights:B,expandByDefault:u,gap:E,expanded:Y,swipeDirections:e.swipeDirections})})):null}))});function mC(t){var e,n,o="";if(typeof t=="string"||typeof t=="number")o+=t;else if(typeof t=="object")if(Array.isArray(t)){var s=t.length;for(e=0;e<s;e++)t[e]&&(n=mC(t[e]))&&(o&&(o+=" "),o+=n)}else for(n in t)t[n]&&(o&&(o+=" "),o+=n);return o}function gC(){for(var t,e,n=0,o="",s=arguments.length;n<s;n++)(t=arguments[n])&&(e=mC(t))&&(o&&(o+=" "),o+=e);return o}const dw=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,fw=gC,zf=(t,e)=>n=>{var o;if(e?.variants==null)return fw(t,n?.class,n?.className);const{variants:s,defaultVariants:i}=e,l=Object.keys(s).map(f=>{const g=n?.[f],m=i?.[f];if(g===null)return null;const y=dw(g)||dw(m);return s[f][y]}),u=n&&Object.entries(n).reduce((f,g)=>{let[m,y]=g;return y===void 0||(f[m]=y),f},{}),d=e==null||(o=e.compoundVariants)===null||o===void 0?void 0:o.reduce((f,g)=>{let{class:m,className:y,...v}=g;return Object.entries(v).every(w=>{let[C,S]=w;return Array.isArray(S)?S.includes({...i,...u}[C]):{...i,...u}[C]===S})?[...f,m,y]:f},[]);return fw(t,l,d,n?.class,n?.className)};function hw(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function ds(...t){return e=>{let n=!1;const o=t.map(s=>{const i=hw(s,e);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let s=0;s<o.length;s++){const i=o[s];typeof i=="function"?i():hw(t[s],null)}}}}function Dt(...t){return x.useCallback(ds(...t),t)}function ea(t){const e=Vk(t),n=x.forwardRef((o,s)=>{const{children:i,...l}=o,u=x.Children.toArray(i),d=u.find(Yk);if(d){const f=d.props.children,g=u.map(m=>m===d?x.Children.count(f)>1?x.Children.only(null):x.isValidElement(f)?f.props.children:null:m);return p.jsx(e,{...l,ref:s,children:x.isValidElement(f)?x.cloneElement(f,void 0,g):null})}return p.jsx(e,{...l,ref:s,children:i})});return n.displayName=`${t}.Slot`,n}var If=ea("Slot");function Vk(t){const e=x.forwardRef((n,o)=>{const{children:s,...i}=n;if(x.isValidElement(s)){const l=qk(s),u=Gk(i,s.props);return s.type!==x.Fragment&&(u.ref=o?ds(o,l):l),x.cloneElement(s,u)}return x.Children.count(s)>1?x.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var pC=Symbol("radix.slottable");function Uk(t){const e=({children:n})=>p.jsx(p.Fragment,{children:n});return e.displayName=`${t}.Slottable`,e.__radixId=pC,e}function Yk(t){return x.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===pC}function Gk(t,e){const n={...e};for(const o in e){const s=t[o],i=e[o];/^on[A-Z]/.test(o)?s&&i?n[o]=(...u)=>{const d=i(...u);return s(...u),d}:s&&(n[o]=s):o==="style"?n[o]={...s,...i}:o==="className"&&(n[o]=[s,i].filter(Boolean).join(" "))}return{...t,...n}}function qk(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var Wk=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],tt=Wk.reduce((t,e)=>{const n=ea(`Primitive.${e}`),o=x.forwardRef((s,i)=>{const{asChild:l,...u}=s,d=l?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),p.jsx(d,{...u,ref:i})});return o.displayName=`Primitive.${e}`,{...t,[e]:o}},{});function yC(t,e){t&&qa.flushSync(()=>t.dispatchEvent(e))}var vC=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"}),Kk="VisuallyHidden",xC=x.forwardRef((t,e)=>p.jsx(tt.span,{...t,ref:e,style:{...vC,...t.style}}));xC.displayName=Kk;var Xk=xC;function Qk(t,e){const n=x.createContext(e),o=i=>{const{children:l,...u}=i,d=x.useMemo(()=>u,Object.values(u));return p.jsx(n.Provider,{value:d,children:l})};o.displayName=t+"Provider";function s(i){const l=x.useContext(n);if(l)return l;if(e!==void 0)return e;throw new Error(`\`${i}\` must be used within \`${t}\``)}return[o,s]}function Dr(t,e=[]){let n=[];function o(i,l){const u=x.createContext(l),d=n.length;n=[...n,l];const f=m=>{const{scope:y,children:v,...w}=m,C=y?.[t]?.[d]||u,S=x.useMemo(()=>w,Object.values(w));return p.jsx(C.Provider,{value:S,children:v})};f.displayName=i+"Provider";function g(m,y){const v=y?.[t]?.[d]||u,w=x.useContext(v);if(w)return w;if(l!==void 0)return l;throw new Error(`\`${m}\` must be used within \`${i}\``)}return[f,g]}const s=()=>{const i=n.map(l=>x.createContext(l));return function(u){const d=u?.[t]||i;return x.useMemo(()=>({[`__scope${t}`]:{...u,[t]:d}}),[u,d])}};return s.scopeName=t,[o,Zk(s,...e)]}function Zk(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const o=t.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(i){const l=o.reduce((u,{useScope:d,scopeName:f})=>{const m=d(i)[`__scope${f}`];return{...u,...m}},{});return x.useMemo(()=>({[`__scope${e.scopeName}`]:l}),[l])}};return n.scopeName=e.scopeName,n}function z0(t){const e=t+"CollectionProvider",[n,o]=Dr(e),[s,i]=n(e,{collectionRef:{current:null},itemMap:new Map}),l=C=>{const{scope:S,children:N}=C,M=de.useRef(null),E=de.useRef(new Map).current;return p.jsx(s,{scope:S,itemMap:E,collectionRef:M,children:N})};l.displayName=e;const u=t+"CollectionSlot",d=ea(u),f=de.forwardRef((C,S)=>{const{scope:N,children:M}=C,E=i(u,N),R=Dt(S,E.collectionRef);return p.jsx(d,{ref:R,children:M})});f.displayName=u;const g=t+"CollectionItemSlot",m="data-radix-collection-item",y=ea(g),v=de.forwardRef((C,S)=>{const{scope:N,children:M,...E}=C,R=de.useRef(null),D=Dt(S,R),T=i(g,N);return de.useEffect(()=>(T.itemMap.set(R,{ref:R,...E}),()=>{T.itemMap.delete(R)})),p.jsx(y,{[m]:"",ref:D,children:M})});v.displayName=g;function w(C){const S=i(t+"CollectionConsumer",C);return de.useCallback(()=>{const M=S.collectionRef.current;if(!M)return[];const E=Array.from(M.querySelectorAll(`[${m}]`));return Array.from(S.itemMap.values()).sort((T,k)=>E.indexOf(T.ref.current)-E.indexOf(k.ref.current))},[S.collectionRef,S.itemMap])}return[{Provider:l,Slot:f,ItemSlot:v},w,o]}function ze(t,e,{checkForDefaultPrevented:n=!0}={}){return function(s){if(t?.(s),n===!1||!s.defaultPrevented)return e?.(s)}}var Kn=globalThis?.document?x.useLayoutEffect:()=>{},Jk=q2[" useInsertionEffect ".trim().toString()]||Kn;function ta({prop:t,defaultProp:e,onChange:n=()=>{},caller:o}){const[s,i,l]=e5({defaultProp:e,onChange:n}),u=t!==void 0,d=u?t:s;{const g=x.useRef(t!==void 0);x.useEffect(()=>{const m=g.current;m!==u&&console.warn(`${o} is changing from ${m?"controlled":"uncontrolled"} to ${u?"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.`),g.current=u},[u,o])}const f=x.useCallback(g=>{if(u){const m=t5(g)?g(t):g;m!==t&&l.current?.(m)}else i(g)},[u,t,i,l]);return[d,f]}function e5({defaultProp:t,onChange:e}){const[n,o]=x.useState(t),s=x.useRef(n),i=x.useRef(e);return Jk(()=>{i.current=e},[e]),x.useEffect(()=>{s.current!==n&&(i.current?.(n),s.current=n)},[n,s]),[n,o,i]}function t5(t){return typeof t=="function"}function n5(t,e){return x.useReducer((n,o)=>e[n][o]??n,t)}var Ro=t=>{const{present:e,children:n}=t,o=o5(e),s=typeof n=="function"?n({present:o.isPresent}):x.Children.only(n),i=Dt(o.ref,r5(s));return typeof n=="function"||o.isPresent?x.cloneElement(s,{ref:i}):null};Ro.displayName="Presence";function o5(t){const[e,n]=x.useState(),o=x.useRef(null),s=x.useRef(t),i=x.useRef("none"),l=t?"mounted":"unmounted",[u,d]=n5(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const f=jd(o.current);i.current=u==="mounted"?f:"none"},[u]),Kn(()=>{const f=o.current,g=s.current;if(g!==t){const y=i.current,v=jd(f);t?d("MOUNT"):v==="none"||f?.display==="none"?d("UNMOUNT"):d(g&&y!==v?"ANIMATION_OUT":"UNMOUNT"),s.current=t}},[t,d]),Kn(()=>{if(e){let f;const g=e.ownerDocument.defaultView??window,m=v=>{const C=jd(o.current).includes(CSS.escape(v.animationName));if(v.target===e&&C&&(d("ANIMATION_END"),!s.current)){const S=e.style.animationFillMode;e.style.animationFillMode="forwards",f=g.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=S)})}},y=v=>{v.target===e&&(i.current=jd(o.current))};return e.addEventListener("animationstart",y),e.addEventListener("animationcancel",m),e.addEventListener("animationend",m),()=>{g.clearTimeout(f),e.removeEventListener("animationstart",y),e.removeEventListener("animationcancel",m),e.removeEventListener("animationend",m)}}else d("ANIMATION_END")},[e,d]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:x.useCallback(f=>{o.current=f?getComputedStyle(f):null,n(f)},[])}}function jd(t){return t?.animationName||"none"}function r5(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var s5=q2[" useId ".trim().toString()]||(()=>{}),a5=0;function Vn(t){const[e,n]=x.useState(s5());return Kn(()=>{n(o=>o??String(a5++))},[t]),t||(e?`radix-${e}`:"")}var i5=x.createContext(void 0);function Pf(t){const e=x.useContext(i5);return t||e||"ltr"}function _r(t){const e=x.useRef(t);return x.useEffect(()=>{e.current=t}),x.useMemo(()=>(...n)=>e.current?.(...n),[])}function l5(t,e=globalThis?.document){const n=_r(t);x.useEffect(()=>{const o=s=>{s.key==="Escape"&&n(s)};return e.addEventListener("keydown",o,{capture:!0}),()=>e.removeEventListener("keydown",o,{capture:!0})},[n,e])}var c5="DismissableLayer",$p="dismissableLayer.update",u5="dismissableLayer.pointerDownOutside",d5="dismissableLayer.focusOutside",mw,bC=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),fl=x.forwardRef((t,e)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:i,onInteractOutside:l,onDismiss:u,...d}=t,f=x.useContext(bC),[g,m]=x.useState(null),y=g?.ownerDocument??globalThis?.document,[,v]=x.useState({}),w=Dt(e,k=>m(k)),C=Array.from(f.layers),[S]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),N=C.indexOf(S),M=g?C.indexOf(g):-1,E=f.layersWithOutsidePointerEventsDisabled.size>0,R=M>=N,D=m5(k=>{const O=k.target,L=[...f.branches].some(W=>W.contains(O));!R||L||(s?.(k),l?.(k),k.defaultPrevented||u?.())},y),T=g5(k=>{const O=k.target;[...f.branches].some(W=>W.contains(O))||(i?.(k),l?.(k),k.defaultPrevented||u?.())},y);return l5(k=>{M===f.layers.size-1&&(o?.(k),!k.defaultPrevented&&u&&(k.preventDefault(),u()))},y),x.useEffect(()=>{if(g)return n&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(mw=y.body.style.pointerEvents,y.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(g)),f.layers.add(g),gw(),()=>{n&&f.layersWithOutsidePointerEventsDisabled.size===1&&(y.body.style.pointerEvents=mw)}},[g,y,n,f]),x.useEffect(()=>()=>{g&&(f.layers.delete(g),f.layersWithOutsidePointerEventsDisabled.delete(g),gw())},[g,f]),x.useEffect(()=>{const k=()=>v({});return document.addEventListener($p,k),()=>document.removeEventListener($p,k)},[]),p.jsx(tt.div,{...d,ref:w,style:{pointerEvents:E?R?"auto":"none":void 0,...t.style},onFocusCapture:ze(t.onFocusCapture,T.onFocusCapture),onBlurCapture:ze(t.onBlurCapture,T.onBlurCapture),onPointerDownCapture:ze(t.onPointerDownCapture,D.onPointerDownCapture)})});fl.displayName=c5;var f5="DismissableLayerBranch",h5=x.forwardRef((t,e)=>{const n=x.useContext(bC),o=x.useRef(null),s=Dt(e,o);return x.useEffect(()=>{const i=o.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),p.jsx(tt.div,{...t,ref:s})});h5.displayName=f5;function m5(t,e=globalThis?.document){const n=_r(t),o=x.useRef(!1),s=x.useRef(()=>{});return x.useEffect(()=>{const i=u=>{if(u.target&&!o.current){let d=function(){wC(u5,n,f,{discrete:!0})};const f={originalEvent:u};u.pointerType==="touch"?(e.removeEventListener("click",s.current),s.current=d,e.addEventListener("click",s.current,{once:!0})):d()}else e.removeEventListener("click",s.current);o.current=!1},l=window.setTimeout(()=>{e.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(l),e.removeEventListener("pointerdown",i),e.removeEventListener("click",s.current)}},[e,n]),{onPointerDownCapture:()=>o.current=!0}}function g5(t,e=globalThis?.document){const n=_r(t),o=x.useRef(!1);return x.useEffect(()=>{const s=i=>{i.target&&!o.current&&wC(d5,n,{originalEvent:i},{discrete:!1})};return e.addEventListener("focusin",s),()=>e.removeEventListener("focusin",s)},[e,n]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function gw(){const t=new CustomEvent($p);document.dispatchEvent(t)}function wC(t,e,n,{discrete:o}){const s=n.originalEvent.target,i=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&s.addEventListener(t,e,{once:!0}),o?yC(s,i):s.dispatchEvent(i)}var Ug="focusScope.autoFocusOnMount",Yg="focusScope.autoFocusOnUnmount",pw={bubbles:!1,cancelable:!0},p5="FocusScope",Zc=x.forwardRef((t,e)=>{const{loop:n=!1,trapped:o=!1,onMountAutoFocus:s,onUnmountAutoFocus:i,...l}=t,[u,d]=x.useState(null),f=_r(s),g=_r(i),m=x.useRef(null),y=Dt(e,C=>d(C)),v=x.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;x.useEffect(()=>{if(o){let C=function(E){if(v.paused||!u)return;const R=E.target;u.contains(R)?m.current=R:Ks(m.current,{select:!0})},S=function(E){if(v.paused||!u)return;const R=E.relatedTarget;R!==null&&(u.contains(R)||Ks(m.current,{select:!0}))},N=function(E){if(document.activeElement===document.body)for(const D of E)D.removedNodes.length>0&&Ks(u)};document.addEventListener("focusin",C),document.addEventListener("focusout",S);const M=new MutationObserver(N);return u&&M.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",C),document.removeEventListener("focusout",S),M.disconnect()}}},[o,u,v.paused]),x.useEffect(()=>{if(u){vw.add(v);const C=document.activeElement;if(!u.contains(C)){const N=new CustomEvent(Ug,pw);u.addEventListener(Ug,f),u.dispatchEvent(N),N.defaultPrevented||(y5(S5(SC(u)),{select:!0}),document.activeElement===C&&Ks(u))}return()=>{u.removeEventListener(Ug,f),setTimeout(()=>{const N=new CustomEvent(Yg,pw);u.addEventListener(Yg,g),u.dispatchEvent(N),N.defaultPrevented||Ks(C??document.body,{select:!0}),u.removeEventListener(Yg,g),vw.remove(v)},0)}}},[u,f,g,v]);const w=x.useCallback(C=>{if(!n&&!o||v.paused)return;const S=C.key==="Tab"&&!C.altKey&&!C.ctrlKey&&!C.metaKey,N=document.activeElement;if(S&&N){const M=C.currentTarget,[E,R]=v5(M);E&&R?!C.shiftKey&&N===R?(C.preventDefault(),n&&Ks(E,{select:!0})):C.shiftKey&&N===E&&(C.preventDefault(),n&&Ks(R,{select:!0})):N===M&&C.preventDefault()}},[n,o,v.paused]);return p.jsx(tt.div,{tabIndex:-1,...l,ref:y,onKeyDown:w})});Zc.displayName=p5;function y5(t,{select:e=!1}={}){const n=document.activeElement;for(const o of t)if(Ks(o,{select:e}),document.activeElement!==n)return}function v5(t){const e=SC(t),n=yw(e,t),o=yw(e.reverse(),t);return[n,o]}function SC(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const s=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||s?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function yw(t,e){for(const n of t)if(!x5(n,{upTo:e}))return n}function x5(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function b5(t){return t instanceof HTMLInputElement&&"select"in t}function Ks(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&b5(t)&&e&&t.select()}}var vw=w5();function w5(){let t=[];return{add(e){const n=t[0];e!==n&&n?.pause(),t=xw(t,e),t.unshift(e)},remove(e){t=xw(t,e),t[0]?.resume()}}}function xw(t,e){const n=[...t],o=n.indexOf(e);return o!==-1&&n.splice(o,1),n}function S5(t){return t.filter(e=>e.tagName!=="A")}var C5="Portal",hl=x.forwardRef((t,e)=>{const{container:n,...o}=t,[s,i]=x.useState(!1);Kn(()=>i(!0),[]);const l=n||s&&globalThis?.document?.body;return l?hC.createPortal(p.jsx(tt.div,{...o,ref:e}),l):null});hl.displayName=C5;var Gg=0;function $f(){x.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??bw()),document.body.insertAdjacentElement("beforeend",t[1]??bw()),Gg++,()=>{Gg===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),Gg--}},[])}function bw(){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 xr=function(){return xr=Object.assign||function(e){for(var n,o=1,s=arguments.length;o<s;o++){n=arguments[o];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},xr.apply(this,arguments)};function CC(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,o=Object.getOwnPropertySymbols(t);s<o.length;s++)e.indexOf(o[s])<0&&Object.prototype.propertyIsEnumerable.call(t,o[s])&&(n[o[s]]=t[o[s]]);return n}function E5(t,e,n){if(n||arguments.length===2)for(var o=0,s=e.length,i;o<s;o++)(i||!(o in e))&&(i||(i=Array.prototype.slice.call(e,0,o)),i[o]=e[o]);return t.concat(i||Array.prototype.slice.call(e))}var ef="right-scroll-bar-position",tf="width-before-scroll-bar",_5="with-scroll-bars-hidden",N5="--removed-body-scroll-bar-size";function qg(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function M5(t,e){var n=x.useState(function(){return{value:t,callback:e,facade:{get current(){return n.value},set current(o){var s=n.value;s!==o&&(n.value=o,n.callback(o,s))}}}})[0];return n.callback=e,n.facade}var R5=typeof window<"u"?x.useLayoutEffect:x.useEffect,ww=new WeakMap;function D5(t,e){var n=M5(null,function(o){return t.forEach(function(s){return qg(s,o)})});return R5(function(){var o=ww.get(n);if(o){var s=new Set(o),i=new Set(t),l=n.current;s.forEach(function(u){i.has(u)||qg(u,null)}),i.forEach(function(u){s.has(u)||qg(u,l)})}ww.set(n,t)},[t]),n}function T5(t){return t}function k5(t,e){e===void 0&&(e=T5);var n=[],o=!1,s={read:function(){if(o)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:t},useMedium:function(i){var l=e(i,o);return n.push(l),function(){n=n.filter(function(u){return u!==l})}},assignSyncMedium:function(i){for(o=!0;n.length;){var l=n;n=[],l.forEach(i)}n={push:function(u){return i(u)},filter:function(){return n}}},assignMedium:function(i){o=!0;var l=[];if(n.length){var u=n;n=[],u.forEach(i),l=n}var d=function(){var g=l;l=[],g.forEach(i)},f=function(){return Promise.resolve().then(d)};f(),n={push:function(g){l.push(g),f()},filter:function(g){return l=l.filter(g),n}}}};return s}function j5(t){t===void 0&&(t={});var e=k5(null);return e.options=xr({async:!0,ssr:!1},t),e}var EC=function(t){var e=t.sideCar,n=CC(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var o=e.read();if(!o)throw new Error("Sidecar medium not found");return x.createElement(o,xr({},n))};EC.isSideCarExport=!0;function A5(t,e){return t.useMedium(e),EC}var _C=j5(),Wg=function(){},Lf=x.forwardRef(function(t,e){var n=x.useRef(null),o=x.useState({onScrollCapture:Wg,onWheelCapture:Wg,onTouchMoveCapture:Wg}),s=o[0],i=o[1],l=t.forwardProps,u=t.children,d=t.className,f=t.removeScrollBar,g=t.enabled,m=t.shards,y=t.sideCar,v=t.noRelative,w=t.noIsolation,C=t.inert,S=t.allowPinchZoom,N=t.as,M=N===void 0?"div":N,E=t.gapMode,R=CC(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),D=y,T=D5([n,e]),k=xr(xr({},R),s);return x.createElement(x.Fragment,null,g&&x.createElement(D,{sideCar:_C,removeScrollBar:f,shards:m,noRelative:v,noIsolation:w,inert:C,setCallbacks:i,allowPinchZoom:!!S,lockRef:n,gapMode:E}),l?x.cloneElement(x.Children.only(u),xr(xr({},k),{ref:T})):x.createElement(M,xr({},k,{className:d,ref:T}),u))});Lf.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Lf.classNames={fullWidth:tf,zeroRight:ef};var O5=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function z5(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=O5();return e&&t.setAttribute("nonce",e),t}function I5(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function P5(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var $5=function(){var t=0,e=null;return{add:function(n){t==0&&(e=z5())&&(I5(e,n),P5(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},L5=function(){var t=$5();return function(e,n){x.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},NC=function(){var t=L5(),e=function(n){var o=n.styles,s=n.dynamic;return t(o,s),null};return e},H5={left:0,top:0,right:0,gap:0},Kg=function(t){return parseInt(t||"",10)||0},B5=function(t){var e=window.getComputedStyle(document.body),n=e[t==="padding"?"paddingLeft":"marginLeft"],o=e[t==="padding"?"paddingTop":"marginTop"],s=e[t==="padding"?"paddingRight":"marginRight"];return[Kg(n),Kg(o),Kg(s)]},F5=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return H5;var e=B5(t),n=document.documentElement.clientWidth,o=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,o-n+e[2]-e[0])}},V5=NC(),Ui="data-scroll-locked",U5=function(t,e,n,o){var s=t.left,i=t.top,l=t.right,u=t.gap;return n===void 0&&(n="margin"),`
12
- .`.concat(_5,` {
13
- overflow: hidden `).concat(o,`;
14
- padding-right: `).concat(u,"px ").concat(o,`;
15
- }
16
- body[`).concat(Ui,`] {
17
- overflow: hidden `).concat(o,`;
18
- overscroll-behavior: contain;
19
- `).concat([e&&"position: relative ".concat(o,";"),n==="margin"&&`
20
- padding-left: `.concat(s,`px;
21
- padding-top: `).concat(i,`px;
22
- padding-right: `).concat(l,`px;
23
- margin-left:0;
24
- margin-top:0;
25
- margin-right: `).concat(u,"px ").concat(o,`;
26
- `),n==="padding"&&"padding-right: ".concat(u,"px ").concat(o,";")].filter(Boolean).join(""),`
27
- }
28
-
29
- .`).concat(ef,` {
30
- right: `).concat(u,"px ").concat(o,`;
31
- }
32
-
33
- .`).concat(tf,` {
34
- margin-right: `).concat(u,"px ").concat(o,`;
35
- }
36
-
37
- .`).concat(ef," .").concat(ef,` {
38
- right: 0 `).concat(o,`;
39
- }
40
-
41
- .`).concat(tf," .").concat(tf,` {
42
- margin-right: 0 `).concat(o,`;
43
- }
44
-
45
- body[`).concat(Ui,`] {
46
- `).concat(N5,": ").concat(u,`px;
47
- }
48
- `)},Sw=function(){var t=parseInt(document.body.getAttribute(Ui)||"0",10);return isFinite(t)?t:0},Y5=function(){x.useEffect(function(){return document.body.setAttribute(Ui,(Sw()+1).toString()),function(){var t=Sw()-1;t<=0?document.body.removeAttribute(Ui):document.body.setAttribute(Ui,t.toString())}},[])},G5=function(t){var e=t.noRelative,n=t.noImportant,o=t.gapMode,s=o===void 0?"margin":o;Y5();var i=x.useMemo(function(){return F5(s)},[s]);return x.createElement(V5,{styles:U5(i,!e,s,n?"":"!important")})},Lp=!1;if(typeof window<"u")try{var Ad=Object.defineProperty({},"passive",{get:function(){return Lp=!0,!0}});window.addEventListener("test",Ad,Ad),window.removeEventListener("test",Ad,Ad)}catch{Lp=!1}var Ri=Lp?{passive:!1}:!1,q5=function(t){return t.tagName==="TEXTAREA"},MC=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!q5(t)&&n[e]==="visible")},W5=function(t){return MC(t,"overflowY")},K5=function(t){return MC(t,"overflowX")},Cw=function(t,e){var n=e.ownerDocument,o=e;do{typeof ShadowRoot<"u"&&o instanceof ShadowRoot&&(o=o.host);var s=RC(t,o);if(s){var i=DC(t,o),l=i[1],u=i[2];if(l>u)return!0}o=o.parentNode}while(o&&o!==n.body);return!1},X5=function(t){var e=t.scrollTop,n=t.scrollHeight,o=t.clientHeight;return[e,n,o]},Q5=function(t){var e=t.scrollLeft,n=t.scrollWidth,o=t.clientWidth;return[e,n,o]},RC=function(t,e){return t==="v"?W5(e):K5(e)},DC=function(t,e){return t==="v"?X5(e):Q5(e)},Z5=function(t,e){return t==="h"&&e==="rtl"?-1:1},J5=function(t,e,n,o,s){var i=Z5(t,window.getComputedStyle(e).direction),l=i*o,u=n.target,d=e.contains(u),f=!1,g=l>0,m=0,y=0;do{if(!u)break;var v=DC(t,u),w=v[0],C=v[1],S=v[2],N=C-S-i*w;(w||N)&&RC(t,u)&&(m+=N,y+=w);var M=u.parentNode;u=M&&M.nodeType===Node.DOCUMENT_FRAGMENT_NODE?M.host:M}while(!d&&u!==document.body||d&&(e.contains(u)||e===u));return(g&&Math.abs(m)<1||!g&&Math.abs(y)<1)&&(f=!0),f},Od=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},Ew=function(t){return[t.deltaX,t.deltaY]},_w=function(t){return t&&"current"in t?t.current:t},ej=function(t,e){return t[0]===e[0]&&t[1]===e[1]},tj=function(t){return`
49
- .block-interactivity-`.concat(t,` {pointer-events: none;}
50
- .allow-interactivity-`).concat(t,` {pointer-events: all;}
51
- `)},nj=0,Di=[];function oj(t){var e=x.useRef([]),n=x.useRef([0,0]),o=x.useRef(),s=x.useState(nj++)[0],i=x.useState(NC)[0],l=x.useRef(t);x.useEffect(function(){l.current=t},[t]),x.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(s));var C=E5([t.lockRef.current],(t.shards||[]).map(_w),!0).filter(Boolean);return C.forEach(function(S){return S.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),C.forEach(function(S){return S.classList.remove("allow-interactivity-".concat(s))})}}},[t.inert,t.lockRef.current,t.shards]);var u=x.useCallback(function(C,S){if("touches"in C&&C.touches.length===2||C.type==="wheel"&&C.ctrlKey)return!l.current.allowPinchZoom;var N=Od(C),M=n.current,E="deltaX"in C?C.deltaX:M[0]-N[0],R="deltaY"in C?C.deltaY:M[1]-N[1],D,T=C.target,k=Math.abs(E)>Math.abs(R)?"h":"v";if("touches"in C&&k==="h"&&T.type==="range")return!1;var O=window.getSelection(),L=O&&O.anchorNode,W=L?L===T||L.contains(T):!1;if(W)return!1;var B=Cw(k,T);if(!B)return!0;if(B?D=k:(D=k==="v"?"h":"v",B=Cw(k,T)),!B)return!1;if(!o.current&&"changedTouches"in C&&(E||R)&&(o.current=D),!D)return!0;var Y=o.current||D;return J5(Y,S,C,Y==="h"?E:R)},[]),d=x.useCallback(function(C){var S=C;if(!(!Di.length||Di[Di.length-1]!==i)){var N="deltaY"in S?Ew(S):Od(S),M=e.current.filter(function(D){return D.name===S.type&&(D.target===S.target||S.target===D.shadowParent)&&ej(D.delta,N)})[0];if(M&&M.should){S.cancelable&&S.preventDefault();return}if(!M){var E=(l.current.shards||[]).map(_w).filter(Boolean).filter(function(D){return D.contains(S.target)}),R=E.length>0?u(S,E[0]):!l.current.noIsolation;R&&S.cancelable&&S.preventDefault()}}},[]),f=x.useCallback(function(C,S,N,M){var E={name:C,delta:S,target:N,should:M,shadowParent:rj(N)};e.current.push(E),setTimeout(function(){e.current=e.current.filter(function(R){return R!==E})},1)},[]),g=x.useCallback(function(C){n.current=Od(C),o.current=void 0},[]),m=x.useCallback(function(C){f(C.type,Ew(C),C.target,u(C,t.lockRef.current))},[]),y=x.useCallback(function(C){f(C.type,Od(C),C.target,u(C,t.lockRef.current))},[]);x.useEffect(function(){return Di.push(i),t.setCallbacks({onScrollCapture:m,onWheelCapture:m,onTouchMoveCapture:y}),document.addEventListener("wheel",d,Ri),document.addEventListener("touchmove",d,Ri),document.addEventListener("touchstart",g,Ri),function(){Di=Di.filter(function(C){return C!==i}),document.removeEventListener("wheel",d,Ri),document.removeEventListener("touchmove",d,Ri),document.removeEventListener("touchstart",g,Ri)}},[]);var v=t.removeScrollBar,w=t.inert;return x.createElement(x.Fragment,null,w?x.createElement(i,{styles:tj(s)}):null,v?x.createElement(G5,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function rj(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const sj=A5(_C,oj);var Jc=x.forwardRef(function(t,e){return x.createElement(Lf,xr({},t,{ref:e,sideCar:sj}))});Jc.classNames=Lf.classNames;var aj=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},Ti=new WeakMap,zd=new WeakMap,Id={},Xg=0,TC=function(t){return t&&(t.host||TC(t.parentNode))},ij=function(t,e){return e.map(function(n){if(t.contains(n))return n;var o=TC(n);return o&&t.contains(o)?o:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)}).filter(function(n){return!!n})},lj=function(t,e,n,o){var s=ij(e,Array.isArray(t)?t:[t]);Id[n]||(Id[n]=new WeakMap);var i=Id[n],l=[],u=new Set,d=new Set(s),f=function(m){!m||u.has(m)||(u.add(m),f(m.parentNode))};s.forEach(f);var g=function(m){!m||d.has(m)||Array.prototype.forEach.call(m.children,function(y){if(u.has(y))g(y);else try{var v=y.getAttribute(o),w=v!==null&&v!=="false",C=(Ti.get(y)||0)+1,S=(i.get(y)||0)+1;Ti.set(y,C),i.set(y,S),l.push(y),C===1&&w&&zd.set(y,!0),S===1&&y.setAttribute(n,"true"),w||y.setAttribute(o,"true")}catch(N){console.error("aria-hidden: cannot operate on ",y,N)}})};return g(e),u.clear(),Xg++,function(){l.forEach(function(m){var y=Ti.get(m)-1,v=i.get(m)-1;Ti.set(m,y),i.set(m,v),y||(zd.has(m)||m.removeAttribute(o),zd.delete(m)),v||m.removeAttribute(n)}),Xg--,Xg||(Ti=new WeakMap,Ti=new WeakMap,zd=new WeakMap,Id={})}},Hf=function(t,e,n){n===void 0&&(n="data-aria-hidden");var o=Array.from(Array.isArray(t)?t:[t]),s=aj(t);return s?(o.push.apply(o,Array.from(s.querySelectorAll("[aria-live], script"))),lj(o,s,n,"aria-hidden")):function(){return null}},Bf="Dialog",[kC]=Dr(Bf),[cj,ir]=kC(Bf),jC=t=>{const{__scopeDialog:e,children:n,open:o,defaultOpen:s,onOpenChange:i,modal:l=!0}=t,u=x.useRef(null),d=x.useRef(null),[f,g]=ta({prop:o,defaultProp:s??!1,onChange:i,caller:Bf});return p.jsx(cj,{scope:e,triggerRef:u,contentRef:d,contentId:Vn(),titleId:Vn(),descriptionId:Vn(),open:f,onOpenChange:g,onOpenToggle:x.useCallback(()=>g(m=>!m),[g]),modal:l,children:n})};jC.displayName=Bf;var AC="DialogTrigger",OC=x.forwardRef((t,e)=>{const{__scopeDialog:n,...o}=t,s=ir(AC,n),i=Dt(e,s.triggerRef);return p.jsx(tt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":$0(s.open),...o,ref:i,onClick:ze(t.onClick,s.onOpenToggle)})});OC.displayName=AC;var I0="DialogPortal",[uj,zC]=kC(I0,{forceMount:void 0}),IC=t=>{const{__scopeDialog:e,forceMount:n,children:o,container:s}=t,i=ir(I0,e);return p.jsx(uj,{scope:e,forceMount:n,children:x.Children.map(o,l=>p.jsx(Ro,{present:n||i.open,children:p.jsx(hl,{asChild:!0,container:s,children:l})}))})};IC.displayName=I0;var df="DialogOverlay",PC=x.forwardRef((t,e)=>{const n=zC(df,t.__scopeDialog),{forceMount:o=n.forceMount,...s}=t,i=ir(df,t.__scopeDialog);return i.modal?p.jsx(Ro,{present:o||i.open,children:p.jsx(fj,{...s,ref:e})}):null});PC.displayName=df;var dj=ea("DialogOverlay.RemoveScroll"),fj=x.forwardRef((t,e)=>{const{__scopeDialog:n,...o}=t,s=ir(df,n);return p.jsx(Jc,{as:dj,allowPinchZoom:!0,shards:[s.contentRef],children:p.jsx(tt.div,{"data-state":$0(s.open),...o,ref:e,style:{pointerEvents:"auto",...o.style}})})}),$a="DialogContent",$C=x.forwardRef((t,e)=>{const n=zC($a,t.__scopeDialog),{forceMount:o=n.forceMount,...s}=t,i=ir($a,t.__scopeDialog);return p.jsx(Ro,{present:o||i.open,children:i.modal?p.jsx(hj,{...s,ref:e}):p.jsx(mj,{...s,ref:e})})});$C.displayName=$a;var hj=x.forwardRef((t,e)=>{const n=ir($a,t.__scopeDialog),o=x.useRef(null),s=Dt(e,n.contentRef,o);return x.useEffect(()=>{const i=o.current;if(i)return Hf(i)},[]),p.jsx(LC,{...t,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ze(t.onCloseAutoFocus,i=>{i.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:ze(t.onPointerDownOutside,i=>{const l=i.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0;(l.button===2||u)&&i.preventDefault()}),onFocusOutside:ze(t.onFocusOutside,i=>i.preventDefault())})}),mj=x.forwardRef((t,e)=>{const n=ir($a,t.__scopeDialog),o=x.useRef(!1),s=x.useRef(!1);return p.jsx(LC,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{t.onCloseAutoFocus?.(i),i.defaultPrevented||(o.current||n.triggerRef.current?.focus(),i.preventDefault()),o.current=!1,s.current=!1},onInteractOutside:i=>{t.onInteractOutside?.(i),i.defaultPrevented||(o.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const l=i.target;n.triggerRef.current?.contains(l)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})}),LC=x.forwardRef((t,e)=>{const{__scopeDialog:n,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:i,...l}=t,u=ir($a,n),d=x.useRef(null),f=Dt(e,d);return $f(),p.jsxs(p.Fragment,{children:[p.jsx(Zc,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:s,onUnmountAutoFocus:i,children:p.jsx(fl,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionId,"aria-labelledby":u.titleId,"data-state":$0(u.open),...l,ref:f,onDismiss:()=>u.onOpenChange(!1)})}),p.jsxs(p.Fragment,{children:[p.jsx(gj,{titleId:u.titleId}),p.jsx(yj,{contentRef:d,descriptionId:u.descriptionId})]})]})}),P0="DialogTitle",HC=x.forwardRef((t,e)=>{const{__scopeDialog:n,...o}=t,s=ir(P0,n);return p.jsx(tt.h2,{id:s.titleId,...o,ref:e})});HC.displayName=P0;var BC="DialogDescription",FC=x.forwardRef((t,e)=>{const{__scopeDialog:n,...o}=t,s=ir(BC,n);return p.jsx(tt.p,{id:s.descriptionId,...o,ref:e})});FC.displayName=BC;var VC="DialogClose",UC=x.forwardRef((t,e)=>{const{__scopeDialog:n,...o}=t,s=ir(VC,n);return p.jsx(tt.button,{type:"button",...o,ref:e,onClick:ze(t.onClick,()=>s.onOpenChange(!1))})});UC.displayName=VC;function $0(t){return t?"open":"closed"}var YC="DialogTitleWarning",[dX,GC]=Qk(YC,{contentName:$a,titleName:P0,docsSlug:"dialog"}),gj=({titleId:t})=>{const e=GC(YC),n=`\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users.
52
-
53
- If you want to hide the \`${e.titleName}\`, you can wrap it with our VisuallyHidden component.
54
-
55
- For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;return x.useEffect(()=>{t&&(document.getElementById(t)||console.error(n))},[n,t]),null},pj="DialogDescriptionWarning",yj=({contentRef:t,descriptionId:e})=>{const o=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${GC(pj).contentName}}.`;return x.useEffect(()=>{const s=t.current?.getAttribute("aria-describedby");e&&s&&(document.getElementById(e)||console.warn(o))},[o,t,e]),null},L0=jC,vj=OC,H0=IC,B0=PC,F0=$C,qC=HC,WC=FC,V0=UC,Qg={exports:{}},Zg={};var Nw;function xj(){if(Nw)return Zg;Nw=1;var t=ll();function e(m,y){return m===y&&(m!==0||1/m===1/y)||m!==m&&y!==y}var n=typeof Object.is=="function"?Object.is:e,o=t.useState,s=t.useEffect,i=t.useLayoutEffect,l=t.useDebugValue;function u(m,y){var v=y(),w=o({inst:{value:v,getSnapshot:y}}),C=w[0].inst,S=w[1];return i(function(){C.value=v,C.getSnapshot=y,d(C)&&S({inst:C})},[m,v,y]),s(function(){return d(C)&&S({inst:C}),m(function(){d(C)&&S({inst:C})})},[m]),l(v),v}function d(m){var y=m.getSnapshot;m=m.value;try{var v=y();return!n(m,v)}catch{return!0}}function f(m,y){return y()}var g=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?f:u;return Zg.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:g,Zg}var Mw;function bj(){return Mw||(Mw=1,Qg.exports=xj()),Qg.exports}function KC(t){const e=x.useRef({value:t,previous:t});return x.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}function XC(t){const[e,n]=x.useState(void 0);return Kn(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const o=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const i=s[0];let l,u;if("borderBoxSize"in i){const d=i.borderBoxSize,f=Array.isArray(d)?d[0]:d;l=f.inlineSize,u=f.blockSize}else l=t.offsetWidth,u=t.offsetHeight;n({width:l,height:u})});return o.observe(t,{box:"border-box"}),()=>o.unobserve(t)}else n(void 0)},[t]),e}var Ff="Checkbox",[wj]=Dr(Ff),[Sj,U0]=wj(Ff);function Cj(t){const{__scopeCheckbox:e,checked:n,children:o,defaultChecked:s,disabled:i,form:l,name:u,onCheckedChange:d,required:f,value:g="on",internal_do_not_use_render:m}=t,[y,v]=ta({prop:n,defaultProp:s??!1,onChange:d,caller:Ff}),[w,C]=x.useState(null),[S,N]=x.useState(null),M=x.useRef(!1),E=w?!!l||!!w.closest("form"):!0,R={checked:y,disabled:i,setChecked:v,control:w,setControl:C,name:u,form:l,value:g,hasConsumerStoppedPropagationRef:M,required:f,defaultChecked:Zs(s)?!1:s,isFormControl:E,bubbleInput:S,setBubbleInput:N};return p.jsx(Sj,{scope:e,...R,children:Ej(m)?m(R):o})}var QC="CheckboxTrigger",ZC=x.forwardRef(({__scopeCheckbox:t,onKeyDown:e,onClick:n,...o},s)=>{const{control:i,value:l,disabled:u,checked:d,required:f,setControl:g,setChecked:m,hasConsumerStoppedPropagationRef:y,isFormControl:v,bubbleInput:w}=U0(QC,t),C=Dt(s,g),S=x.useRef(d);return x.useEffect(()=>{const N=i?.form;if(N){const M=()=>m(S.current);return N.addEventListener("reset",M),()=>N.removeEventListener("reset",M)}},[i,m]),p.jsx(tt.button,{type:"button",role:"checkbox","aria-checked":Zs(d)?"mixed":d,"aria-required":f,"data-state":rE(d),"data-disabled":u?"":void 0,disabled:u,value:l,...o,ref:C,onKeyDown:ze(e,N=>{N.key==="Enter"&&N.preventDefault()}),onClick:ze(n,N=>{m(M=>Zs(M)?!0:!M),w&&v&&(y.current=N.isPropagationStopped(),y.current||N.stopPropagation())})})});ZC.displayName=QC;var JC=x.forwardRef((t,e)=>{const{__scopeCheckbox:n,name:o,checked:s,defaultChecked:i,required:l,disabled:u,value:d,onCheckedChange:f,form:g,...m}=t;return p.jsx(Cj,{__scopeCheckbox:n,checked:s,defaultChecked:i,disabled:u,required:l,onCheckedChange:f,name:o,form:g,value:d,internal_do_not_use_render:({isFormControl:y})=>p.jsxs(p.Fragment,{children:[p.jsx(ZC,{...m,ref:e,__scopeCheckbox:n}),y&&p.jsx(oE,{__scopeCheckbox:n})]})})});JC.displayName=Ff;var eE="CheckboxIndicator",tE=x.forwardRef((t,e)=>{const{__scopeCheckbox:n,forceMount:o,...s}=t,i=U0(eE,n);return p.jsx(Ro,{present:o||Zs(i.checked)||i.checked===!0,children:p.jsx(tt.span,{"data-state":rE(i.checked),"data-disabled":i.disabled?"":void 0,...s,ref:e,style:{pointerEvents:"none",...t.style}})})});tE.displayName=eE;var nE="CheckboxBubbleInput",oE=x.forwardRef(({__scopeCheckbox:t,...e},n)=>{const{control:o,hasConsumerStoppedPropagationRef:s,checked:i,defaultChecked:l,required:u,disabled:d,name:f,value:g,form:m,bubbleInput:y,setBubbleInput:v}=U0(nE,t),w=Dt(n,v),C=KC(i),S=XC(o);x.useEffect(()=>{const M=y;if(!M)return;const E=window.HTMLInputElement.prototype,D=Object.getOwnPropertyDescriptor(E,"checked").set,T=!s.current;if(C!==i&&D){const k=new Event("click",{bubbles:T});M.indeterminate=Zs(i),D.call(M,Zs(i)?!1:i),M.dispatchEvent(k)}},[y,C,i,s]);const N=x.useRef(Zs(i)?!1:i);return p.jsx(tt.input,{type:"checkbox","aria-hidden":!0,defaultChecked:l??N.current,required:u,disabled:d,name:f,value:g,form:m,...e,tabIndex:-1,ref:w,style:{...e.style,...S,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});oE.displayName=nE;function Ej(t){return typeof t=="function"}function Zs(t){return t==="indeterminate"}function rE(t){return Zs(t)?"indeterminate":t?"checked":"unchecked"}const _j=["top","right","bottom","left"],na=Math.min,wo=Math.max,ff=Math.round,Pd=Math.floor,Cr=t=>({x:t,y:t}),Nj={left:"right",right:"left",bottom:"top",top:"bottom"},Mj={start:"end",end:"start"};function Hp(t,e,n){return wo(t,na(e,n))}function fs(t,e){return typeof t=="function"?t(e):t}function hs(t){return t.split("-")[0]}function ml(t){return t.split("-")[1]}function Y0(t){return t==="x"?"y":"x"}function G0(t){return t==="y"?"height":"width"}const Rj=new Set(["top","bottom"]);function wr(t){return Rj.has(hs(t))?"y":"x"}function q0(t){return Y0(wr(t))}function Dj(t,e,n){n===void 0&&(n=!1);const o=ml(t),s=q0(t),i=G0(s);let l=s==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(l=hf(l)),[l,hf(l)]}function Tj(t){const e=hf(t);return[Bp(t),e,Bp(e)]}function Bp(t){return t.replace(/start|end/g,e=>Mj[e])}const Rw=["left","right"],Dw=["right","left"],kj=["top","bottom"],jj=["bottom","top"];function Aj(t,e,n){switch(t){case"top":case"bottom":return n?e?Dw:Rw:e?Rw:Dw;case"left":case"right":return e?kj:jj;default:return[]}}function Oj(t,e,n,o){const s=ml(t);let i=Aj(hs(t),n==="start",o);return s&&(i=i.map(l=>l+"-"+s),e&&(i=i.concat(i.map(Bp)))),i}function hf(t){return t.replace(/left|right|bottom|top/g,e=>Nj[e])}function zj(t){return{top:0,right:0,bottom:0,left:0,...t}}function sE(t){return typeof t!="number"?zj(t):{top:t,right:t,bottom:t,left:t}}function mf(t){const{x:e,y:n,width:o,height:s}=t;return{width:o,height:s,top:n,left:e,right:e+o,bottom:n+s,x:e,y:n}}function Tw(t,e,n){let{reference:o,floating:s}=t;const i=wr(e),l=q0(e),u=G0(l),d=hs(e),f=i==="y",g=o.x+o.width/2-s.width/2,m=o.y+o.height/2-s.height/2,y=o[u]/2-s[u]/2;let v;switch(d){case"top":v={x:g,y:o.y-s.height};break;case"bottom":v={x:g,y:o.y+o.height};break;case"right":v={x:o.x+o.width,y:m};break;case"left":v={x:o.x-s.width,y:m};break;default:v={x:o.x,y:o.y}}switch(ml(e)){case"start":v[l]-=y*(n&&f?-1:1);break;case"end":v[l]+=y*(n&&f?-1:1);break}return v}const Ij=async(t,e,n)=>{const{placement:o="bottom",strategy:s="absolute",middleware:i=[],platform:l}=n,u=i.filter(Boolean),d=await(l.isRTL==null?void 0:l.isRTL(e));let f=await l.getElementRects({reference:t,floating:e,strategy:s}),{x:g,y:m}=Tw(f,o,d),y=o,v={},w=0;for(let C=0;C<u.length;C++){const{name:S,fn:N}=u[C],{x:M,y:E,data:R,reset:D}=await N({x:g,y:m,initialPlacement:o,placement:y,strategy:s,middlewareData:v,rects:f,platform:l,elements:{reference:t,floating:e}});g=M??g,m=E??m,v={...v,[S]:{...v[S],...R}},D&&w<=50&&(w++,typeof D=="object"&&(D.placement&&(y=D.placement),D.rects&&(f=D.rects===!0?await l.getElementRects({reference:t,floating:e,strategy:s}):D.rects),{x:g,y:m}=Tw(f,y,d)),C=-1)}return{x:g,y:m,placement:y,strategy:s,middlewareData:v}};async function kc(t,e){var n;e===void 0&&(e={});const{x:o,y:s,platform:i,rects:l,elements:u,strategy:d}=t,{boundary:f="clippingAncestors",rootBoundary:g="viewport",elementContext:m="floating",altBoundary:y=!1,padding:v=0}=fs(e,t),w=sE(v),S=u[y?m==="floating"?"reference":"floating":m],N=mf(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(S)))==null||n?S:S.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(u.floating)),boundary:f,rootBoundary:g,strategy:d})),M=m==="floating"?{x:o,y:s,width:l.floating.width,height:l.floating.height}:l.reference,E=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u.floating)),R=await(i.isElement==null?void 0:i.isElement(E))?await(i.getScale==null?void 0:i.getScale(E))||{x:1,y:1}:{x:1,y:1},D=mf(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:M,offsetParent:E,strategy:d}):M);return{top:(N.top-D.top+w.top)/R.y,bottom:(D.bottom-N.bottom+w.bottom)/R.y,left:(N.left-D.left+w.left)/R.x,right:(D.right-N.right+w.right)/R.x}}const Pj=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:o,placement:s,rects:i,platform:l,elements:u,middlewareData:d}=e,{element:f,padding:g=0}=fs(t,e)||{};if(f==null)return{};const m=sE(g),y={x:n,y:o},v=q0(s),w=G0(v),C=await l.getDimensions(f),S=v==="y",N=S?"top":"left",M=S?"bottom":"right",E=S?"clientHeight":"clientWidth",R=i.reference[w]+i.reference[v]-y[v]-i.floating[w],D=y[v]-i.reference[v],T=await(l.getOffsetParent==null?void 0:l.getOffsetParent(f));let k=T?T[E]:0;(!k||!await(l.isElement==null?void 0:l.isElement(T)))&&(k=u.floating[E]||i.floating[w]);const O=R/2-D/2,L=k/2-C[w]/2-1,W=na(m[N],L),B=na(m[M],L),Y=W,q=k-C[w]-B,z=k/2-C[w]/2+O,V=Hp(Y,z,q),A=!d.arrow&&ml(s)!=null&&z!==V&&i.reference[w]/2-(z<Y?W:B)-C[w]/2<0,H=A?z<Y?z-Y:z-q:0;return{[v]:y[v]+H,data:{[v]:V,centerOffset:z-V-H,...A&&{alignmentOffset:H}},reset:A}}}),$j=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:s,middlewareData:i,rects:l,initialPlacement:u,platform:d,elements:f}=e,{mainAxis:g=!0,crossAxis:m=!0,fallbackPlacements:y,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:C=!0,...S}=fs(t,e);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const N=hs(s),M=wr(u),E=hs(u)===u,R=await(d.isRTL==null?void 0:d.isRTL(f.floating)),D=y||(E||!C?[hf(u)]:Tj(u)),T=w!=="none";!y&&T&&D.push(...Oj(u,C,w,R));const k=[u,...D],O=await kc(e,S),L=[];let W=((o=i.flip)==null?void 0:o.overflows)||[];if(g&&L.push(O[N]),m){const z=Dj(s,l,R);L.push(O[z[0]],O[z[1]])}if(W=[...W,{placement:s,overflows:L}],!L.every(z=>z<=0)){var B,Y;const z=(((B=i.flip)==null?void 0:B.index)||0)+1,V=k[z];if(V&&(!(m==="alignment"?M!==wr(V):!1)||W.every(P=>wr(P.placement)===M?P.overflows[0]>0:!0)))return{data:{index:z,overflows:W},reset:{placement:V}};let A=(Y=W.filter(H=>H.overflows[0]<=0).sort((H,P)=>H.overflows[1]-P.overflows[1])[0])==null?void 0:Y.placement;if(!A)switch(v){case"bestFit":{var q;const H=(q=W.filter(P=>{if(T){const F=wr(P.placement);return F===M||F==="y"}return!0}).map(P=>[P.placement,P.overflows.filter(F=>F>0).reduce((F,Q)=>F+Q,0)]).sort((P,F)=>P[1]-F[1])[0])==null?void 0:q[0];H&&(A=H);break}case"initialPlacement":A=u;break}if(s!==A)return{reset:{placement:A}}}return{}}}};function kw(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function jw(t){return _j.some(e=>t[e]>=0)}const Lj=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:o="referenceHidden",...s}=fs(t,e);switch(o){case"referenceHidden":{const i=await kc(e,{...s,elementContext:"reference"}),l=kw(i,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:jw(l)}}}case"escaped":{const i=await kc(e,{...s,altBoundary:!0}),l=kw(i,n.floating);return{data:{escapedOffsets:l,escaped:jw(l)}}}default:return{}}}}},aE=new Set(["left","top"]);async function Hj(t,e){const{placement:n,platform:o,elements:s}=t,i=await(o.isRTL==null?void 0:o.isRTL(s.floating)),l=hs(n),u=ml(n),d=wr(n)==="y",f=aE.has(l)?-1:1,g=i&&d?-1:1,m=fs(e,t);let{mainAxis:y,crossAxis:v,alignmentAxis:w}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};return u&&typeof w=="number"&&(v=u==="end"?w*-1:w),d?{x:v*g,y:y*f}:{x:y*f,y:v*g}}const Bj=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:s,y:i,placement:l,middlewareData:u}=e,d=await Hj(e,t);return l===((n=u.offset)==null?void 0:n.placement)&&(o=u.arrow)!=null&&o.alignmentOffset?{}:{x:s+d.x,y:i+d.y,data:{...d,placement:l}}}}},Fj=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:s}=e,{mainAxis:i=!0,crossAxis:l=!1,limiter:u={fn:S=>{let{x:N,y:M}=S;return{x:N,y:M}}},...d}=fs(t,e),f={x:n,y:o},g=await kc(e,d),m=wr(hs(s)),y=Y0(m);let v=f[y],w=f[m];if(i){const S=y==="y"?"top":"left",N=y==="y"?"bottom":"right",M=v+g[S],E=v-g[N];v=Hp(M,v,E)}if(l){const S=m==="y"?"top":"left",N=m==="y"?"bottom":"right",M=w+g[S],E=w-g[N];w=Hp(M,w,E)}const C=u.fn({...e,[y]:v,[m]:w});return{...C,data:{x:C.x-n,y:C.y-o,enabled:{[y]:i,[m]:l}}}}}},Vj=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:o,placement:s,rects:i,middlewareData:l}=e,{offset:u=0,mainAxis:d=!0,crossAxis:f=!0}=fs(t,e),g={x:n,y:o},m=wr(s),y=Y0(m);let v=g[y],w=g[m];const C=fs(u,e),S=typeof C=="number"?{mainAxis:C,crossAxis:0}:{mainAxis:0,crossAxis:0,...C};if(d){const E=y==="y"?"height":"width",R=i.reference[y]-i.floating[E]+S.mainAxis,D=i.reference[y]+i.reference[E]-S.mainAxis;v<R?v=R:v>D&&(v=D)}if(f){var N,M;const E=y==="y"?"width":"height",R=aE.has(hs(s)),D=i.reference[m]-i.floating[E]+(R&&((N=l.offset)==null?void 0:N[m])||0)+(R?0:S.crossAxis),T=i.reference[m]+i.reference[E]+(R?0:((M=l.offset)==null?void 0:M[m])||0)-(R?S.crossAxis:0);w<D?w=D:w>T&&(w=T)}return{[y]:v,[m]:w}}}},Uj=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,o;const{placement:s,rects:i,platform:l,elements:u}=e,{apply:d=()=>{},...f}=fs(t,e),g=await kc(e,f),m=hs(s),y=ml(s),v=wr(s)==="y",{width:w,height:C}=i.floating;let S,N;m==="top"||m==="bottom"?(S=m,N=y===(await(l.isRTL==null?void 0:l.isRTL(u.floating))?"start":"end")?"left":"right"):(N=m,S=y==="end"?"top":"bottom");const M=C-g.top-g.bottom,E=w-g.left-g.right,R=na(C-g[S],M),D=na(w-g[N],E),T=!e.middlewareData.shift;let k=R,O=D;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(O=E),(o=e.middlewareData.shift)!=null&&o.enabled.y&&(k=M),T&&!y){const W=wo(g.left,0),B=wo(g.right,0),Y=wo(g.top,0),q=wo(g.bottom,0);v?O=w-2*(W!==0||B!==0?W+B:wo(g.left,g.right)):k=C-2*(Y!==0||q!==0?Y+q:wo(g.top,g.bottom))}await d({...e,availableWidth:O,availableHeight:k});const L=await l.getDimensions(u.floating);return w!==L.width||C!==L.height?{reset:{rects:!0}}:{}}}};function Vf(){return typeof window<"u"}function gl(t){return iE(t)?(t.nodeName||"").toLowerCase():"#document"}function Co(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Tr(t){var e;return(e=(iE(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function iE(t){return Vf()?t instanceof Node||t instanceof Co(t).Node:!1}function rr(t){return Vf()?t instanceof Element||t instanceof Co(t).Element:!1}function Nr(t){return Vf()?t instanceof HTMLElement||t instanceof Co(t).HTMLElement:!1}function Aw(t){return!Vf()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Co(t).ShadowRoot}const Yj=new Set(["inline","contents"]);function eu(t){const{overflow:e,overflowX:n,overflowY:o,display:s}=sr(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!Yj.has(s)}const Gj=new Set(["table","td","th"]);function qj(t){return Gj.has(gl(t))}const Wj=[":popover-open",":modal"];function Uf(t){return Wj.some(e=>{try{return t.matches(e)}catch{return!1}})}const Kj=["transform","translate","scale","rotate","perspective"],Xj=["transform","translate","scale","rotate","perspective","filter"],Qj=["paint","layout","strict","content"];function W0(t){const e=K0(),n=rr(t)?sr(t):t;return Kj.some(o=>n[o]?n[o]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||Xj.some(o=>(n.willChange||"").includes(o))||Qj.some(o=>(n.contain||"").includes(o))}function Zj(t){let e=oa(t);for(;Nr(e)&&!Wi(e);){if(W0(e))return e;if(Uf(e))return null;e=oa(e)}return null}function K0(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Jj=new Set(["html","body","#document"]);function Wi(t){return Jj.has(gl(t))}function sr(t){return Co(t).getComputedStyle(t)}function Yf(t){return rr(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function oa(t){if(gl(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Aw(t)&&t.host||Tr(t);return Aw(e)?e.host:e}function lE(t){const e=oa(t);return Wi(e)?t.ownerDocument?t.ownerDocument.body:t.body:Nr(e)&&eu(e)?e:lE(e)}function jc(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);const s=lE(t),i=s===((o=t.ownerDocument)==null?void 0:o.body),l=Co(s);if(i){const u=Fp(l);return e.concat(l,l.visualViewport||[],eu(s)?s:[],u&&n?jc(u):[])}return e.concat(s,jc(s,[],n))}function Fp(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function cE(t){const e=sr(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const s=Nr(t),i=s?t.offsetWidth:n,l=s?t.offsetHeight:o,u=ff(n)!==i||ff(o)!==l;return u&&(n=i,o=l),{width:n,height:o,$:u}}function X0(t){return rr(t)?t:t.contextElement}function Yi(t){const e=X0(t);if(!Nr(e))return Cr(1);const n=e.getBoundingClientRect(),{width:o,height:s,$:i}=cE(e);let l=(i?ff(n.width):n.width)/o,u=(i?ff(n.height):n.height)/s;return(!l||!Number.isFinite(l))&&(l=1),(!u||!Number.isFinite(u))&&(u=1),{x:l,y:u}}const eA=Cr(0);function uE(t){const e=Co(t);return!K0()||!e.visualViewport?eA:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function tA(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==Co(t)?!1:e}function La(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);const s=t.getBoundingClientRect(),i=X0(t);let l=Cr(1);e&&(o?rr(o)&&(l=Yi(o)):l=Yi(t));const u=tA(i,n,o)?uE(i):Cr(0);let d=(s.left+u.x)/l.x,f=(s.top+u.y)/l.y,g=s.width/l.x,m=s.height/l.y;if(i){const y=Co(i),v=o&&rr(o)?Co(o):o;let w=y,C=Fp(w);for(;C&&o&&v!==w;){const S=Yi(C),N=C.getBoundingClientRect(),M=sr(C),E=N.left+(C.clientLeft+parseFloat(M.paddingLeft))*S.x,R=N.top+(C.clientTop+parseFloat(M.paddingTop))*S.y;d*=S.x,f*=S.y,g*=S.x,m*=S.y,d+=E,f+=R,w=Co(C),C=Fp(w)}}return mf({width:g,height:m,x:d,y:f})}function Gf(t,e){const n=Yf(t).scrollLeft;return e?e.left+n:La(Tr(t)).left+n}function dE(t,e){const n=t.getBoundingClientRect(),o=n.left+e.scrollLeft-Gf(t,n),s=n.top+e.scrollTop;return{x:o,y:s}}function nA(t){let{elements:e,rect:n,offsetParent:o,strategy:s}=t;const i=s==="fixed",l=Tr(o),u=e?Uf(e.floating):!1;if(o===l||u&&i)return n;let d={scrollLeft:0,scrollTop:0},f=Cr(1);const g=Cr(0),m=Nr(o);if((m||!m&&!i)&&((gl(o)!=="body"||eu(l))&&(d=Yf(o)),Nr(o))){const v=La(o);f=Yi(o),g.x=v.x+o.clientLeft,g.y=v.y+o.clientTop}const y=l&&!m&&!i?dE(l,d):Cr(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-d.scrollLeft*f.x+g.x+y.x,y:n.y*f.y-d.scrollTop*f.y+g.y+y.y}}function oA(t){return Array.from(t.getClientRects())}function rA(t){const e=Tr(t),n=Yf(t),o=t.ownerDocument.body,s=wo(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),i=wo(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let l=-n.scrollLeft+Gf(t);const u=-n.scrollTop;return sr(o).direction==="rtl"&&(l+=wo(e.clientWidth,o.clientWidth)-s),{width:s,height:i,x:l,y:u}}const Ow=25;function sA(t,e){const n=Co(t),o=Tr(t),s=n.visualViewport;let i=o.clientWidth,l=o.clientHeight,u=0,d=0;if(s){i=s.width,l=s.height;const g=K0();(!g||g&&e==="fixed")&&(u=s.offsetLeft,d=s.offsetTop)}const f=Gf(o);if(f<=0){const g=o.ownerDocument,m=g.body,y=getComputedStyle(m),v=g.compatMode==="CSS1Compat"&&parseFloat(y.marginLeft)+parseFloat(y.marginRight)||0,w=Math.abs(o.clientWidth-m.clientWidth-v);w<=Ow&&(i-=w)}else f<=Ow&&(i+=f);return{width:i,height:l,x:u,y:d}}const aA=new Set(["absolute","fixed"]);function iA(t,e){const n=La(t,!0,e==="fixed"),o=n.top+t.clientTop,s=n.left+t.clientLeft,i=Nr(t)?Yi(t):Cr(1),l=t.clientWidth*i.x,u=t.clientHeight*i.y,d=s*i.x,f=o*i.y;return{width:l,height:u,x:d,y:f}}function zw(t,e,n){let o;if(e==="viewport")o=sA(t,n);else if(e==="document")o=rA(Tr(t));else if(rr(e))o=iA(e,n);else{const s=uE(t);o={x:e.x-s.x,y:e.y-s.y,width:e.width,height:e.height}}return mf(o)}function fE(t,e){const n=oa(t);return n===e||!rr(n)||Wi(n)?!1:sr(n).position==="fixed"||fE(n,e)}function lA(t,e){const n=e.get(t);if(n)return n;let o=jc(t,[],!1).filter(u=>rr(u)&&gl(u)!=="body"),s=null;const i=sr(t).position==="fixed";let l=i?oa(t):t;for(;rr(l)&&!Wi(l);){const u=sr(l),d=W0(l);!d&&u.position==="fixed"&&(s=null),(i?!d&&!s:!d&&u.position==="static"&&!!s&&aA.has(s.position)||eu(l)&&!d&&fE(t,l))?o=o.filter(g=>g!==l):s=u,l=oa(l)}return e.set(t,o),o}function cA(t){let{element:e,boundary:n,rootBoundary:o,strategy:s}=t;const l=[...n==="clippingAncestors"?Uf(e)?[]:lA(e,this._c):[].concat(n),o],u=l[0],d=l.reduce((f,g)=>{const m=zw(e,g,s);return f.top=wo(m.top,f.top),f.right=na(m.right,f.right),f.bottom=na(m.bottom,f.bottom),f.left=wo(m.left,f.left),f},zw(e,u,s));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function uA(t){const{width:e,height:n}=cE(t);return{width:e,height:n}}function dA(t,e,n){const o=Nr(e),s=Tr(e),i=n==="fixed",l=La(t,!0,i,e);let u={scrollLeft:0,scrollTop:0};const d=Cr(0);function f(){d.x=Gf(s)}if(o||!o&&!i)if((gl(e)!=="body"||eu(s))&&(u=Yf(e)),o){const v=La(e,!0,i,e);d.x=v.x+e.clientLeft,d.y=v.y+e.clientTop}else s&&f();i&&!o&&s&&f();const g=s&&!o&&!i?dE(s,u):Cr(0),m=l.left+u.scrollLeft-d.x-g.x,y=l.top+u.scrollTop-d.y-g.y;return{x:m,y,width:l.width,height:l.height}}function Jg(t){return sr(t).position==="static"}function Iw(t,e){if(!Nr(t)||sr(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return Tr(t)===n&&(n=n.ownerDocument.body),n}function hE(t,e){const n=Co(t);if(Uf(t))return n;if(!Nr(t)){let s=oa(t);for(;s&&!Wi(s);){if(rr(s)&&!Jg(s))return s;s=oa(s)}return n}let o=Iw(t,e);for(;o&&qj(o)&&Jg(o);)o=Iw(o,e);return o&&Wi(o)&&Jg(o)&&!W0(o)?n:o||Zj(t)||n}const fA=async function(t){const e=this.getOffsetParent||hE,n=this.getDimensions,o=await n(t.floating);return{reference:dA(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function hA(t){return sr(t).direction==="rtl"}const mA={convertOffsetParentRelativeRectToViewportRelativeRect:nA,getDocumentElement:Tr,getClippingRect:cA,getOffsetParent:hE,getElementRects:fA,getClientRects:oA,getDimensions:uA,getScale:Yi,isElement:rr,isRTL:hA};function mE(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function gA(t,e){let n=null,o;const s=Tr(t);function i(){var u;clearTimeout(o),(u=n)==null||u.disconnect(),n=null}function l(u,d){u===void 0&&(u=!1),d===void 0&&(d=1),i();const f=t.getBoundingClientRect(),{left:g,top:m,width:y,height:v}=f;if(u||e(),!y||!v)return;const w=Pd(m),C=Pd(s.clientWidth-(g+y)),S=Pd(s.clientHeight-(m+v)),N=Pd(g),E={rootMargin:-w+"px "+-C+"px "+-S+"px "+-N+"px",threshold:wo(0,na(1,d))||1};let R=!0;function D(T){const k=T[0].intersectionRatio;if(k!==d){if(!R)return l();k?l(!1,k):o=setTimeout(()=>{l(!1,1e-7)},1e3)}k===1&&!mE(f,t.getBoundingClientRect())&&l(),R=!1}try{n=new IntersectionObserver(D,{...E,root:s.ownerDocument})}catch{n=new IntersectionObserver(D,E)}n.observe(t)}return l(!0),i}function pA(t,e,n,o){o===void 0&&(o={});const{ancestorScroll:s=!0,ancestorResize:i=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:d=!1}=o,f=X0(t),g=s||i?[...f?jc(f):[],...jc(e)]:[];g.forEach(N=>{s&&N.addEventListener("scroll",n,{passive:!0}),i&&N.addEventListener("resize",n)});const m=f&&u?gA(f,n):null;let y=-1,v=null;l&&(v=new ResizeObserver(N=>{let[M]=N;M&&M.target===f&&v&&(v.unobserve(e),cancelAnimationFrame(y),y=requestAnimationFrame(()=>{var E;(E=v)==null||E.observe(e)})),n()}),f&&!d&&v.observe(f),v.observe(e));let w,C=d?La(t):null;d&&S();function S(){const N=La(t);C&&!mE(C,N)&&n(),C=N,w=requestAnimationFrame(S)}return n(),()=>{var N;g.forEach(M=>{s&&M.removeEventListener("scroll",n),i&&M.removeEventListener("resize",n)}),m?.(),(N=v)==null||N.disconnect(),v=null,d&&cancelAnimationFrame(w)}}const yA=Bj,vA=Fj,xA=$j,bA=Uj,wA=Lj,Pw=Pj,SA=Vj,CA=(t,e,n)=>{const o=new Map,s={platform:mA,...n},i={...s.platform,_c:o};return Ij(t,e,{...s,platform:i})};var EA=typeof document<"u",_A=function(){},nf=EA?x.useLayoutEffect:_A;function gf(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,o,s;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(o=n;o--!==0;)if(!gf(t[o],e[o]))return!1;return!0}if(s=Object.keys(t),n=s.length,n!==Object.keys(e).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(e,s[o]))return!1;for(o=n;o--!==0;){const i=s[o];if(!(i==="_owner"&&t.$$typeof)&&!gf(t[i],e[i]))return!1}return!0}return t!==t&&e!==e}function gE(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function $w(t,e){const n=gE(t);return Math.round(e*n)/n}function ep(t){const e=x.useRef(t);return nf(()=>{e.current=t}),e}function NA(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:o=[],platform:s,elements:{reference:i,floating:l}={},transform:u=!0,whileElementsMounted:d,open:f}=t,[g,m]=x.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[y,v]=x.useState(o);gf(y,o)||v(o);const[w,C]=x.useState(null),[S,N]=x.useState(null),M=x.useCallback(P=>{P!==T.current&&(T.current=P,C(P))},[]),E=x.useCallback(P=>{P!==k.current&&(k.current=P,N(P))},[]),R=i||w,D=l||S,T=x.useRef(null),k=x.useRef(null),O=x.useRef(g),L=d!=null,W=ep(d),B=ep(s),Y=ep(f),q=x.useCallback(()=>{if(!T.current||!k.current)return;const P={placement:e,strategy:n,middleware:y};B.current&&(P.platform=B.current),CA(T.current,k.current,P).then(F=>{const Q={...F,isPositioned:Y.current!==!1};z.current&&!gf(O.current,Q)&&(O.current=Q,qa.flushSync(()=>{m(Q)}))})},[y,e,n,B,Y]);nf(()=>{f===!1&&O.current.isPositioned&&(O.current.isPositioned=!1,m(P=>({...P,isPositioned:!1})))},[f]);const z=x.useRef(!1);nf(()=>(z.current=!0,()=>{z.current=!1}),[]),nf(()=>{if(R&&(T.current=R),D&&(k.current=D),R&&D){if(W.current)return W.current(R,D,q);q()}},[R,D,q,W,L]);const V=x.useMemo(()=>({reference:T,floating:k,setReference:M,setFloating:E}),[M,E]),A=x.useMemo(()=>({reference:R,floating:D}),[R,D]),H=x.useMemo(()=>{const P={position:n,left:0,top:0};if(!A.floating)return P;const F=$w(A.floating,g.x),Q=$w(A.floating,g.y);return u?{...P,transform:"translate("+F+"px, "+Q+"px)",...gE(A.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:F,top:Q}},[n,u,A.floating,g.x,g.y]);return x.useMemo(()=>({...g,update:q,refs:V,elements:A,floatingStyles:H}),[g,q,V,A,H])}const MA=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:o,padding:s}=typeof t=="function"?t(n):t;return o&&e(o)?o.current!=null?Pw({element:o.current,padding:s}).fn(n):{}:o?Pw({element:o,padding:s}).fn(n):{}}}},RA=(t,e)=>({...yA(t),options:[t,e]}),DA=(t,e)=>({...vA(t),options:[t,e]}),TA=(t,e)=>({...SA(t),options:[t,e]}),kA=(t,e)=>({...xA(t),options:[t,e]}),jA=(t,e)=>({...bA(t),options:[t,e]}),AA=(t,e)=>({...wA(t),options:[t,e]}),OA=(t,e)=>({...MA(t),options:[t,e]});var zA="Arrow",pE=x.forwardRef((t,e)=>{const{children:n,width:o=10,height:s=5,...i}=t;return p.jsx(tt.svg,{...i,ref:e,width:o,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:p.jsx("polygon",{points:"0,0 30,0 15,10"})})});pE.displayName=zA;var IA=pE,Q0="Popper",[yE,ia]=Dr(Q0),[PA,vE]=yE(Q0),xE=t=>{const{__scopePopper:e,children:n}=t,[o,s]=x.useState(null);return p.jsx(PA,{scope:e,anchor:o,onAnchorChange:s,children:n})};xE.displayName=Q0;var bE="PopperAnchor",wE=x.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:o,...s}=t,i=vE(bE,n),l=x.useRef(null),u=Dt(e,l),d=x.useRef(null);return x.useEffect(()=>{const f=d.current;d.current=o?.current||l.current,f!==d.current&&i.onAnchorChange(d.current)}),o?null:p.jsx(tt.div,{...s,ref:u})});wE.displayName=bE;var Z0="PopperContent",[$A,LA]=yE(Z0),SE=x.forwardRef((t,e)=>{const{__scopePopper:n,side:o="bottom",sideOffset:s=0,align:i="center",alignOffset:l=0,arrowPadding:u=0,avoidCollisions:d=!0,collisionBoundary:f=[],collisionPadding:g=0,sticky:m="partial",hideWhenDetached:y=!1,updatePositionStrategy:v="optimized",onPlaced:w,...C}=t,S=vE(Z0,n),[N,M]=x.useState(null),E=Dt(e,X=>M(X)),[R,D]=x.useState(null),T=XC(R),k=T?.width??0,O=T?.height??0,L=o+(i!=="center"?"-"+i:""),W=typeof g=="number"?g:{top:0,right:0,bottom:0,left:0,...g},B=Array.isArray(f)?f:[f],Y=B.length>0,q={padding:W,boundary:B.filter(BA),altBoundary:Y},{refs:z,floatingStyles:V,placement:A,isPositioned:H,middlewareData:P}=NA({strategy:"fixed",placement:L,whileElementsMounted:(...X)=>pA(...X,{animationFrame:v==="always"}),elements:{reference:S.anchor},middleware:[RA({mainAxis:s+O,alignmentAxis:l}),d&&DA({mainAxis:!0,crossAxis:!1,limiter:m==="partial"?TA():void 0,...q}),d&&kA({...q}),jA({...q,apply:({elements:X,rects:ee,availableWidth:se,availableHeight:le})=>{const{width:pe,height:ie}=ee.reference,be=X.floating.style;be.setProperty("--radix-popper-available-width",`${se}px`),be.setProperty("--radix-popper-available-height",`${le}px`),be.setProperty("--radix-popper-anchor-width",`${pe}px`),be.setProperty("--radix-popper-anchor-height",`${ie}px`)}}),R&&OA({element:R,padding:u}),FA({arrowWidth:k,arrowHeight:O}),y&&AA({strategy:"referenceHidden",...q})]}),[F,Q]=_E(A),$=_r(w);Kn(()=>{H&&$?.()},[H,$]);const I=P.arrow?.x,U=P.arrow?.y,K=P.arrow?.centerOffset!==0,[J,ne]=x.useState();return Kn(()=>{N&&ne(window.getComputedStyle(N).zIndex)},[N]),p.jsx("div",{ref:z.setFloating,"data-radix-popper-content-wrapper":"",style:{...V,transform:H?V.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:J,"--radix-popper-transform-origin":[P.transformOrigin?.x,P.transformOrigin?.y].join(" "),...P.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:p.jsx($A,{scope:n,placedSide:F,onArrowChange:D,arrowX:I,arrowY:U,shouldHideArrow:K,children:p.jsx(tt.div,{"data-side":F,"data-align":Q,...C,ref:E,style:{...C.style,animation:H?void 0:"none"}})})})});SE.displayName=Z0;var CE="PopperArrow",HA={top:"bottom",right:"left",bottom:"top",left:"right"},EE=x.forwardRef(function(e,n){const{__scopePopper:o,...s}=e,i=LA(CE,o),l=HA[i.placedSide];return p.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[l]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:p.jsx(IA,{...s,ref:n,style:{...s.style,display:"block"}})})});EE.displayName=CE;function BA(t){return t!==null}var FA=t=>({name:"transformOrigin",options:t,fn(e){const{placement:n,rects:o,middlewareData:s}=e,l=s.arrow?.centerOffset!==0,u=l?0:t.arrowWidth,d=l?0:t.arrowHeight,[f,g]=_E(n),m={start:"0%",center:"50%",end:"100%"}[g],y=(s.arrow?.x??0)+u/2,v=(s.arrow?.y??0)+d/2;let w="",C="";return f==="bottom"?(w=l?m:`${y}px`,C=`${-d}px`):f==="top"?(w=l?m:`${y}px`,C=`${o.floating.height+d}px`):f==="right"?(w=`${-d}px`,C=l?m:`${v}px`):f==="left"&&(w=`${o.floating.width+d}px`,C=l?m:`${v}px`),{data:{x:w,y:C}}}});function _E(t){const[e,n="center"]=t.split("-");return[e,n]}var qf=xE,tu=wE,Wf=SE,Kf=EE,tp="rovingFocusGroup.onEntryFocus",VA={bubbles:!1,cancelable:!0},nu="RovingFocusGroup",[Vp,NE,UA]=z0(nu),[YA,ME]=Dr(nu,[UA]),[GA,qA]=YA(nu),RE=x.forwardRef((t,e)=>p.jsx(Vp.Provider,{scope:t.__scopeRovingFocusGroup,children:p.jsx(Vp.Slot,{scope:t.__scopeRovingFocusGroup,children:p.jsx(WA,{...t,ref:e})})}));RE.displayName=nu;var WA=x.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,orientation:o,loop:s=!1,dir:i,currentTabStopId:l,defaultCurrentTabStopId:u,onCurrentTabStopIdChange:d,onEntryFocus:f,preventScrollOnEntryFocus:g=!1,...m}=t,y=x.useRef(null),v=Dt(e,y),w=Pf(i),[C,S]=ta({prop:l,defaultProp:u??null,onChange:d,caller:nu}),[N,M]=x.useState(!1),E=_r(f),R=NE(n),D=x.useRef(!1),[T,k]=x.useState(0);return x.useEffect(()=>{const O=y.current;if(O)return O.addEventListener(tp,E),()=>O.removeEventListener(tp,E)},[E]),p.jsx(GA,{scope:n,orientation:o,dir:w,loop:s,currentTabStopId:C,onItemFocus:x.useCallback(O=>S(O),[S]),onItemShiftTab:x.useCallback(()=>M(!0),[]),onFocusableItemAdd:x.useCallback(()=>k(O=>O+1),[]),onFocusableItemRemove:x.useCallback(()=>k(O=>O-1),[]),children:p.jsx(tt.div,{tabIndex:N||T===0?-1:0,"data-orientation":o,...m,ref:v,style:{outline:"none",...t.style},onMouseDown:ze(t.onMouseDown,()=>{D.current=!0}),onFocus:ze(t.onFocus,O=>{const L=!D.current;if(O.target===O.currentTarget&&L&&!N){const W=new CustomEvent(tp,VA);if(O.currentTarget.dispatchEvent(W),!W.defaultPrevented){const B=R().filter(A=>A.focusable),Y=B.find(A=>A.active),q=B.find(A=>A.id===C),V=[Y,q,...B].filter(Boolean).map(A=>A.ref.current);kE(V,g)}}D.current=!1}),onBlur:ze(t.onBlur,()=>M(!1))})})}),DE="RovingFocusGroupItem",TE=x.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,focusable:o=!0,active:s=!1,tabStopId:i,children:l,...u}=t,d=Vn(),f=i||d,g=qA(DE,n),m=g.currentTabStopId===f,y=NE(n),{onFocusableItemAdd:v,onFocusableItemRemove:w,currentTabStopId:C}=g;return x.useEffect(()=>{if(o)return v(),()=>w()},[o,v,w]),p.jsx(Vp.ItemSlot,{scope:n,id:f,focusable:o,active:s,children:p.jsx(tt.span,{tabIndex:m?0:-1,"data-orientation":g.orientation,...u,ref:e,onMouseDown:ze(t.onMouseDown,S=>{o?g.onItemFocus(f):S.preventDefault()}),onFocus:ze(t.onFocus,()=>g.onItemFocus(f)),onKeyDown:ze(t.onKeyDown,S=>{if(S.key==="Tab"&&S.shiftKey){g.onItemShiftTab();return}if(S.target!==S.currentTarget)return;const N=QA(S,g.orientation,g.dir);if(N!==void 0){if(S.metaKey||S.ctrlKey||S.altKey||S.shiftKey)return;S.preventDefault();let E=y().filter(R=>R.focusable).map(R=>R.ref.current);if(N==="last")E.reverse();else if(N==="prev"||N==="next"){N==="prev"&&E.reverse();const R=E.indexOf(S.currentTarget);E=g.loop?ZA(E,R+1):E.slice(R+1)}setTimeout(()=>kE(E))}}),children:typeof l=="function"?l({isCurrentTabStop:m,hasTabStop:C!=null}):l})})});TE.displayName=DE;var KA={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function XA(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function QA(t,e,n){const o=XA(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return KA[o]}function kE(t,e=!1){const n=document.activeElement;for(const o of t)if(o===n||(o.focus({preventScroll:e}),document.activeElement!==n))return}function ZA(t,e){return t.map((n,o)=>t[(e+o)%t.length])}var JA=RE,eO=TE,Up=["Enter"," "],tO=["ArrowDown","PageUp","Home"],jE=["ArrowUp","PageDown","End"],nO=[...tO,...jE],oO={ltr:[...Up,"ArrowRight"],rtl:[...Up,"ArrowLeft"]},rO={ltr:["ArrowLeft"],rtl:["ArrowRight"]},ou="Menu",[Ac,sO,aO]=z0(ou),[Wa,AE]=Dr(ou,[aO,ia,ME]),Xf=ia(),OE=ME(),[iO,Ka]=Wa(ou),[lO,ru]=Wa(ou),zE=t=>{const{__scopeMenu:e,open:n=!1,children:o,dir:s,onOpenChange:i,modal:l=!0}=t,u=Xf(e),[d,f]=x.useState(null),g=x.useRef(!1),m=_r(i),y=Pf(s);return x.useEffect(()=>{const v=()=>{g.current=!0,document.addEventListener("pointerdown",w,{capture:!0,once:!0}),document.addEventListener("pointermove",w,{capture:!0,once:!0})},w=()=>g.current=!1;return document.addEventListener("keydown",v,{capture:!0}),()=>{document.removeEventListener("keydown",v,{capture:!0}),document.removeEventListener("pointerdown",w,{capture:!0}),document.removeEventListener("pointermove",w,{capture:!0})}},[]),p.jsx(qf,{...u,children:p.jsx(iO,{scope:e,open:n,onOpenChange:m,content:d,onContentChange:f,children:p.jsx(lO,{scope:e,onClose:x.useCallback(()=>m(!1),[m]),isUsingKeyboardRef:g,dir:y,modal:l,children:o})})})};zE.displayName=ou;var cO="MenuAnchor",J0=x.forwardRef((t,e)=>{const{__scopeMenu:n,...o}=t,s=Xf(n);return p.jsx(tu,{...s,...o,ref:e})});J0.displayName=cO;var ey="MenuPortal",[uO,IE]=Wa(ey,{forceMount:void 0}),PE=t=>{const{__scopeMenu:e,forceMount:n,children:o,container:s}=t,i=Ka(ey,e);return p.jsx(uO,{scope:e,forceMount:n,children:p.jsx(Ro,{present:n||i.open,children:p.jsx(hl,{asChild:!0,container:s,children:o})})})};PE.displayName=ey;var Uo="MenuContent",[dO,ty]=Wa(Uo),$E=x.forwardRef((t,e)=>{const n=IE(Uo,t.__scopeMenu),{forceMount:o=n.forceMount,...s}=t,i=Ka(Uo,t.__scopeMenu),l=ru(Uo,t.__scopeMenu);return p.jsx(Ac.Provider,{scope:t.__scopeMenu,children:p.jsx(Ro,{present:o||i.open,children:p.jsx(Ac.Slot,{scope:t.__scopeMenu,children:l.modal?p.jsx(fO,{...s,ref:e}):p.jsx(hO,{...s,ref:e})})})})}),fO=x.forwardRef((t,e)=>{const n=Ka(Uo,t.__scopeMenu),o=x.useRef(null),s=Dt(e,o);return x.useEffect(()=>{const i=o.current;if(i)return Hf(i)},[]),p.jsx(ny,{...t,ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:ze(t.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),hO=x.forwardRef((t,e)=>{const n=Ka(Uo,t.__scopeMenu);return p.jsx(ny,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),mO=ea("MenuContent.ScrollLock"),ny=x.forwardRef((t,e)=>{const{__scopeMenu:n,loop:o=!1,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:l,disableOutsidePointerEvents:u,onEntryFocus:d,onEscapeKeyDown:f,onPointerDownOutside:g,onFocusOutside:m,onInteractOutside:y,onDismiss:v,disableOutsideScroll:w,...C}=t,S=Ka(Uo,n),N=ru(Uo,n),M=Xf(n),E=OE(n),R=sO(n),[D,T]=x.useState(null),k=x.useRef(null),O=Dt(e,k,S.onContentChange),L=x.useRef(0),W=x.useRef(""),B=x.useRef(0),Y=x.useRef(null),q=x.useRef("right"),z=x.useRef(0),V=w?Jc:x.Fragment,A=w?{as:mO,allowPinchZoom:!0}:void 0,H=F=>{const Q=W.current+F,$=R().filter(X=>!X.disabled),I=document.activeElement,U=$.find(X=>X.ref.current===I)?.textValue,K=$.map(X=>X.textValue),J=NO(K,Q,U),ne=$.find(X=>X.textValue===J)?.ref.current;(function X(ee){W.current=ee,window.clearTimeout(L.current),ee!==""&&(L.current=window.setTimeout(()=>X(""),1e3))})(Q),ne&&setTimeout(()=>ne.focus())};x.useEffect(()=>()=>window.clearTimeout(L.current),[]),$f();const P=x.useCallback(F=>q.current===Y.current?.side&&RO(F,Y.current?.area),[]);return p.jsx(dO,{scope:n,searchRef:W,onItemEnter:x.useCallback(F=>{P(F)&&F.preventDefault()},[P]),onItemLeave:x.useCallback(F=>{P(F)||(k.current?.focus(),T(null))},[P]),onTriggerLeave:x.useCallback(F=>{P(F)&&F.preventDefault()},[P]),pointerGraceTimerRef:B,onPointerGraceIntentChange:x.useCallback(F=>{Y.current=F},[]),children:p.jsx(V,{...A,children:p.jsx(Zc,{asChild:!0,trapped:s,onMountAutoFocus:ze(i,F=>{F.preventDefault(),k.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:l,children:p.jsx(fl,{asChild:!0,disableOutsidePointerEvents:u,onEscapeKeyDown:f,onPointerDownOutside:g,onFocusOutside:m,onInteractOutside:y,onDismiss:v,children:p.jsx(JA,{asChild:!0,...E,dir:N.dir,orientation:"vertical",loop:o,currentTabStopId:D,onCurrentTabStopIdChange:T,onEntryFocus:ze(d,F=>{N.isUsingKeyboardRef.current||F.preventDefault()}),preventScrollOnEntryFocus:!0,children:p.jsx(Wf,{role:"menu","aria-orientation":"vertical","data-state":e_(S.open),"data-radix-menu-content":"",dir:N.dir,...M,...C,ref:O,style:{outline:"none",...C.style},onKeyDown:ze(C.onKeyDown,F=>{const $=F.target.closest("[data-radix-menu-content]")===F.currentTarget,I=F.ctrlKey||F.altKey||F.metaKey,U=F.key.length===1;$&&(F.key==="Tab"&&F.preventDefault(),!I&&U&&H(F.key));const K=k.current;if(F.target!==K||!nO.includes(F.key))return;F.preventDefault();const ne=R().filter(X=>!X.disabled).map(X=>X.ref.current);jE.includes(F.key)&&ne.reverse(),EO(ne)}),onBlur:ze(t.onBlur,F=>{F.currentTarget.contains(F.target)||(window.clearTimeout(L.current),W.current="")}),onPointerMove:ze(t.onPointerMove,Oc(F=>{const Q=F.target,$=z.current!==F.clientX;if(F.currentTarget.contains(Q)&&$){const I=F.clientX>z.current?"right":"left";q.current=I,z.current=F.clientX}}))})})})})})})});$E.displayName=Uo;var gO="MenuGroup",oy=x.forwardRef((t,e)=>{const{__scopeMenu:n,...o}=t;return p.jsx(tt.div,{role:"group",...o,ref:e})});oy.displayName=gO;var pO="MenuLabel",LE=x.forwardRef((t,e)=>{const{__scopeMenu:n,...o}=t;return p.jsx(tt.div,{...o,ref:e})});LE.displayName=pO;var pf="MenuItem",Lw="menu.itemSelect",Qf=x.forwardRef((t,e)=>{const{disabled:n=!1,onSelect:o,...s}=t,i=x.useRef(null),l=ru(pf,t.__scopeMenu),u=ty(pf,t.__scopeMenu),d=Dt(e,i),f=x.useRef(!1),g=()=>{const m=i.current;if(!n&&m){const y=new CustomEvent(Lw,{bubbles:!0,cancelable:!0});m.addEventListener(Lw,v=>o?.(v),{once:!0}),yC(m,y),y.defaultPrevented?f.current=!1:l.onClose()}};return p.jsx(HE,{...s,ref:d,disabled:n,onClick:ze(t.onClick,g),onPointerDown:m=>{t.onPointerDown?.(m),f.current=!0},onPointerUp:ze(t.onPointerUp,m=>{f.current||m.currentTarget?.click()}),onKeyDown:ze(t.onKeyDown,m=>{const y=u.searchRef.current!=="";n||y&&m.key===" "||Up.includes(m.key)&&(m.currentTarget.click(),m.preventDefault())})})});Qf.displayName=pf;var HE=x.forwardRef((t,e)=>{const{__scopeMenu:n,disabled:o=!1,textValue:s,...i}=t,l=ty(pf,n),u=OE(n),d=x.useRef(null),f=Dt(e,d),[g,m]=x.useState(!1),[y,v]=x.useState("");return x.useEffect(()=>{const w=d.current;w&&v((w.textContent??"").trim())},[i.children]),p.jsx(Ac.ItemSlot,{scope:n,disabled:o,textValue:s??y,children:p.jsx(eO,{asChild:!0,...u,focusable:!o,children:p.jsx(tt.div,{role:"menuitem","data-highlighted":g?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...i,ref:f,onPointerMove:ze(t.onPointerMove,Oc(w=>{o?l.onItemLeave(w):(l.onItemEnter(w),w.defaultPrevented||w.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:ze(t.onPointerLeave,Oc(w=>l.onItemLeave(w))),onFocus:ze(t.onFocus,()=>m(!0)),onBlur:ze(t.onBlur,()=>m(!1))})})})}),yO="MenuCheckboxItem",BE=x.forwardRef((t,e)=>{const{checked:n=!1,onCheckedChange:o,...s}=t;return p.jsx(GE,{scope:t.__scopeMenu,checked:n,children:p.jsx(Qf,{role:"menuitemcheckbox","aria-checked":yf(n)?"mixed":n,...s,ref:e,"data-state":sy(n),onSelect:ze(s.onSelect,()=>o?.(yf(n)?!0:!n),{checkForDefaultPrevented:!1})})})});BE.displayName=yO;var FE="MenuRadioGroup",[vO,xO]=Wa(FE,{value:void 0,onValueChange:()=>{}}),VE=x.forwardRef((t,e)=>{const{value:n,onValueChange:o,...s}=t,i=_r(o);return p.jsx(vO,{scope:t.__scopeMenu,value:n,onValueChange:i,children:p.jsx(oy,{...s,ref:e})})});VE.displayName=FE;var UE="MenuRadioItem",YE=x.forwardRef((t,e)=>{const{value:n,...o}=t,s=xO(UE,t.__scopeMenu),i=n===s.value;return p.jsx(GE,{scope:t.__scopeMenu,checked:i,children:p.jsx(Qf,{role:"menuitemradio","aria-checked":i,...o,ref:e,"data-state":sy(i),onSelect:ze(o.onSelect,()=>s.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});YE.displayName=UE;var ry="MenuItemIndicator",[GE,bO]=Wa(ry,{checked:!1}),qE=x.forwardRef((t,e)=>{const{__scopeMenu:n,forceMount:o,...s}=t,i=bO(ry,n);return p.jsx(Ro,{present:o||yf(i.checked)||i.checked===!0,children:p.jsx(tt.span,{...s,ref:e,"data-state":sy(i.checked)})})});qE.displayName=ry;var wO="MenuSeparator",WE=x.forwardRef((t,e)=>{const{__scopeMenu:n,...o}=t;return p.jsx(tt.div,{role:"separator","aria-orientation":"horizontal",...o,ref:e})});WE.displayName=wO;var SO="MenuArrow",KE=x.forwardRef((t,e)=>{const{__scopeMenu:n,...o}=t,s=Xf(n);return p.jsx(Kf,{...s,...o,ref:e})});KE.displayName=SO;var CO="MenuSub",[fX,XE]=Wa(CO),wc="MenuSubTrigger",QE=x.forwardRef((t,e)=>{const n=Ka(wc,t.__scopeMenu),o=ru(wc,t.__scopeMenu),s=XE(wc,t.__scopeMenu),i=ty(wc,t.__scopeMenu),l=x.useRef(null),{pointerGraceTimerRef:u,onPointerGraceIntentChange:d}=i,f={__scopeMenu:t.__scopeMenu},g=x.useCallback(()=>{l.current&&window.clearTimeout(l.current),l.current=null},[]);return x.useEffect(()=>g,[g]),x.useEffect(()=>{const m=u.current;return()=>{window.clearTimeout(m),d(null)}},[u,d]),p.jsx(J0,{asChild:!0,...f,children:p.jsx(HE,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":s.contentId,"data-state":e_(n.open),...t,ref:ds(e,s.onTriggerChange),onClick:m=>{t.onClick?.(m),!(t.disabled||m.defaultPrevented)&&(m.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:ze(t.onPointerMove,Oc(m=>{i.onItemEnter(m),!m.defaultPrevented&&!t.disabled&&!n.open&&!l.current&&(i.onPointerGraceIntentChange(null),l.current=window.setTimeout(()=>{n.onOpenChange(!0),g()},100))})),onPointerLeave:ze(t.onPointerLeave,Oc(m=>{g();const y=n.content?.getBoundingClientRect();if(y){const v=n.content?.dataset.side,w=v==="right",C=w?-5:5,S=y[w?"left":"right"],N=y[w?"right":"left"];i.onPointerGraceIntentChange({area:[{x:m.clientX+C,y:m.clientY},{x:S,y:y.top},{x:N,y:y.top},{x:N,y:y.bottom},{x:S,y:y.bottom}],side:v}),window.clearTimeout(u.current),u.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(m),m.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:ze(t.onKeyDown,m=>{const y=i.searchRef.current!=="";t.disabled||y&&m.key===" "||oO[o.dir].includes(m.key)&&(n.onOpenChange(!0),n.content?.focus(),m.preventDefault())})})})});QE.displayName=wc;var ZE="MenuSubContent",JE=x.forwardRef((t,e)=>{const n=IE(Uo,t.__scopeMenu),{forceMount:o=n.forceMount,...s}=t,i=Ka(Uo,t.__scopeMenu),l=ru(Uo,t.__scopeMenu),u=XE(ZE,t.__scopeMenu),d=x.useRef(null),f=Dt(e,d);return p.jsx(Ac.Provider,{scope:t.__scopeMenu,children:p.jsx(Ro,{present:o||i.open,children:p.jsx(Ac.Slot,{scope:t.__scopeMenu,children:p.jsx(ny,{id:u.contentId,"aria-labelledby":u.triggerId,...s,ref:f,align:"start",side:l.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:g=>{l.isUsingKeyboardRef.current&&d.current?.focus(),g.preventDefault()},onCloseAutoFocus:g=>g.preventDefault(),onFocusOutside:ze(t.onFocusOutside,g=>{g.target!==u.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:ze(t.onEscapeKeyDown,g=>{l.onClose(),g.preventDefault()}),onKeyDown:ze(t.onKeyDown,g=>{const m=g.currentTarget.contains(g.target),y=rO[l.dir].includes(g.key);m&&y&&(i.onOpenChange(!1),u.trigger?.focus(),g.preventDefault())})})})})})});JE.displayName=ZE;function e_(t){return t?"open":"closed"}function yf(t){return t==="indeterminate"}function sy(t){return yf(t)?"indeterminate":t?"checked":"unchecked"}function EO(t){const e=document.activeElement;for(const n of t)if(n===e||(n.focus(),document.activeElement!==e))return}function _O(t,e){return t.map((n,o)=>t[(e+o)%t.length])}function NO(t,e,n){const s=e.length>1&&Array.from(e).every(f=>f===e[0])?e[0]:e,i=n?t.indexOf(n):-1;let l=_O(t,Math.max(i,0));s.length===1&&(l=l.filter(f=>f!==n));const d=l.find(f=>f.toLowerCase().startsWith(s.toLowerCase()));return d!==n?d:void 0}function MO(t,e){const{x:n,y:o}=t;let s=!1;for(let i=0,l=e.length-1;i<e.length;l=i++){const u=e[i],d=e[l],f=u.x,g=u.y,m=d.x,y=d.y;g>o!=y>o&&n<(m-f)*(o-g)/(y-g)+f&&(s=!s)}return s}function RO(t,e){if(!e)return!1;const n={x:t.clientX,y:t.clientY};return MO(n,e)}function Oc(t){return e=>e.pointerType==="mouse"?t(e):void 0}var DO=zE,TO=J0,kO=PE,jO=$E,AO=oy,OO=LE,zO=Qf,IO=BE,PO=VE,$O=YE,LO=qE,HO=WE,BO=KE,FO=QE,VO=JE,Zf="DropdownMenu",[UO]=Dr(Zf,[AE]),Qn=AE(),[YO,t_]=UO(Zf),n_=t=>{const{__scopeDropdownMenu:e,children:n,dir:o,open:s,defaultOpen:i,onOpenChange:l,modal:u=!0}=t,d=Qn(e),f=x.useRef(null),[g,m]=ta({prop:s,defaultProp:i??!1,onChange:l,caller:Zf});return p.jsx(YO,{scope:e,triggerId:Vn(),triggerRef:f,contentId:Vn(),open:g,onOpenChange:m,onOpenToggle:x.useCallback(()=>m(y=>!y),[m]),modal:u,children:p.jsx(DO,{...d,open:g,onOpenChange:m,dir:o,modal:u,children:n})})};n_.displayName=Zf;var o_="DropdownMenuTrigger",r_=x.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,disabled:o=!1,...s}=t,i=t_(o_,n),l=Qn(n);return p.jsx(TO,{asChild:!0,...l,children:p.jsx(tt.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":o?"":void 0,disabled:o,...s,ref:ds(e,i.triggerRef),onPointerDown:ze(t.onPointerDown,u=>{!o&&u.button===0&&u.ctrlKey===!1&&(i.onOpenToggle(),i.open||u.preventDefault())}),onKeyDown:ze(t.onKeyDown,u=>{o||(["Enter"," "].includes(u.key)&&i.onOpenToggle(),u.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(u.key)&&u.preventDefault())})})})});r_.displayName=o_;var GO="DropdownMenuPortal",s_=t=>{const{__scopeDropdownMenu:e,...n}=t,o=Qn(e);return p.jsx(kO,{...o,...n})};s_.displayName=GO;var a_="DropdownMenuContent",i_=x.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...o}=t,s=t_(a_,n),i=Qn(n),l=x.useRef(!1);return p.jsx(jO,{id:s.contentId,"aria-labelledby":s.triggerId,...i,...o,ref:e,onCloseAutoFocus:ze(t.onCloseAutoFocus,u=>{l.current||s.triggerRef.current?.focus(),l.current=!1,u.preventDefault()}),onInteractOutside:ze(t.onInteractOutside,u=>{const d=u.detail.originalEvent,f=d.button===0&&d.ctrlKey===!0,g=d.button===2||f;(!s.modal||g)&&(l.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)"}})});i_.displayName=a_;var qO="DropdownMenuGroup",WO=x.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...o}=t,s=Qn(n);return p.jsx(AO,{...s,...o,ref:e})});WO.displayName=qO;var KO="DropdownMenuLabel",XO=x.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...o}=t,s=Qn(n);return p.jsx(OO,{...s,...o,ref:e})});XO.displayName=KO;var QO="DropdownMenuItem",l_=x.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...o}=t,s=Qn(n);return p.jsx(zO,{...s,...o,ref:e})});l_.displayName=QO;var ZO="DropdownMenuCheckboxItem",c_=x.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...o}=t,s=Qn(n);return p.jsx(IO,{...s,...o,ref:e})});c_.displayName=ZO;var JO="DropdownMenuRadioGroup",e6=x.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...o}=t,s=Qn(n);return p.jsx(PO,{...s,...o,ref:e})});e6.displayName=JO;var t6="DropdownMenuRadioItem",n6=x.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...o}=t,s=Qn(n);return p.jsx($O,{...s,...o,ref:e})});n6.displayName=t6;var o6="DropdownMenuItemIndicator",u_=x.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...o}=t,s=Qn(n);return p.jsx(LO,{...s,...o,ref:e})});u_.displayName=o6;var r6="DropdownMenuSeparator",d_=x.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...o}=t,s=Qn(n);return p.jsx(HO,{...s,...o,ref:e})});d_.displayName=r6;var s6="DropdownMenuArrow",a6=x.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...o}=t,s=Qn(n);return p.jsx(BO,{...s,...o,ref:e})});a6.displayName=s6;var i6="DropdownMenuSubTrigger",l6=x.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...o}=t,s=Qn(n);return p.jsx(FO,{...s,...o,ref:e})});l6.displayName=i6;var c6="DropdownMenuSubContent",u6=x.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...o}=t,s=Qn(n);return p.jsx(VO,{...s,...o,ref:e,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)"}})});u6.displayName=c6;var d6=n_,f6=r_,h6=s_,m6=i_,g6=l_,p6=c_,y6=u_,v6=d_,x6="Label",f_=x.forwardRef((t,e)=>p.jsx(tt.label,{...t,ref:e,onMouseDown:n=>{n.target.closest("button, input, select, textarea")||(t.onMouseDown?.(n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));f_.displayName=x6;var b6=f_;function Hw(t,[e,n]){return Math.min(n,Math.max(e,t))}var Jf="Popover",[h_]=Dr(Jf,[ia]),su=ia(),[w6,la]=h_(Jf),m_=t=>{const{__scopePopover:e,children:n,open:o,defaultOpen:s,onOpenChange:i,modal:l=!1}=t,u=su(e),d=x.useRef(null),[f,g]=x.useState(!1),[m,y]=ta({prop:o,defaultProp:s??!1,onChange:i,caller:Jf});return p.jsx(qf,{...u,children:p.jsx(w6,{scope:e,contentId:Vn(),triggerRef:d,open:m,onOpenChange:y,onOpenToggle:x.useCallback(()=>y(v=>!v),[y]),hasCustomAnchor:f,onCustomAnchorAdd:x.useCallback(()=>g(!0),[]),onCustomAnchorRemove:x.useCallback(()=>g(!1),[]),modal:l,children:n})})};m_.displayName=Jf;var g_="PopoverAnchor",p_=x.forwardRef((t,e)=>{const{__scopePopover:n,...o}=t,s=la(g_,n),i=su(n),{onCustomAnchorAdd:l,onCustomAnchorRemove:u}=s;return x.useEffect(()=>(l(),()=>u()),[l,u]),p.jsx(tu,{...i,...o,ref:e})});p_.displayName=g_;var y_="PopoverTrigger",v_=x.forwardRef((t,e)=>{const{__scopePopover:n,...o}=t,s=la(y_,n),i=su(n),l=Dt(e,s.triggerRef),u=p.jsx(tt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":C_(s.open),...o,ref:l,onClick:ze(t.onClick,s.onOpenToggle)});return s.hasCustomAnchor?u:p.jsx(tu,{asChild:!0,...i,children:u})});v_.displayName=y_;var ay="PopoverPortal",[S6,C6]=h_(ay,{forceMount:void 0}),x_=t=>{const{__scopePopover:e,forceMount:n,children:o,container:s}=t,i=la(ay,e);return p.jsx(S6,{scope:e,forceMount:n,children:p.jsx(Ro,{present:n||i.open,children:p.jsx(hl,{asChild:!0,container:s,children:o})})})};x_.displayName=ay;var Ki="PopoverContent",b_=x.forwardRef((t,e)=>{const n=C6(Ki,t.__scopePopover),{forceMount:o=n.forceMount,...s}=t,i=la(Ki,t.__scopePopover);return p.jsx(Ro,{present:o||i.open,children:i.modal?p.jsx(_6,{...s,ref:e}):p.jsx(N6,{...s,ref:e})})});b_.displayName=Ki;var E6=ea("PopoverContent.RemoveScroll"),_6=x.forwardRef((t,e)=>{const n=la(Ki,t.__scopePopover),o=x.useRef(null),s=Dt(e,o),i=x.useRef(!1);return x.useEffect(()=>{const l=o.current;if(l)return Hf(l)},[]),p.jsx(Jc,{as:E6,allowPinchZoom:!0,children:p.jsx(w_,{...t,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ze(t.onCloseAutoFocus,l=>{l.preventDefault(),i.current||n.triggerRef.current?.focus()}),onPointerDownOutside:ze(t.onPointerDownOutside,l=>{const u=l.detail.originalEvent,d=u.button===0&&u.ctrlKey===!0,f=u.button===2||d;i.current=f},{checkForDefaultPrevented:!1}),onFocusOutside:ze(t.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1})})})}),N6=x.forwardRef((t,e)=>{const n=la(Ki,t.__scopePopover),o=x.useRef(!1),s=x.useRef(!1);return p.jsx(w_,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{t.onCloseAutoFocus?.(i),i.defaultPrevented||(o.current||n.triggerRef.current?.focus(),i.preventDefault()),o.current=!1,s.current=!1},onInteractOutside:i=>{t.onInteractOutside?.(i),i.defaultPrevented||(o.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const l=i.target;n.triggerRef.current?.contains(l)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})}),w_=x.forwardRef((t,e)=>{const{__scopePopover:n,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:l,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:g,...m}=t,y=la(Ki,n),v=su(n);return $f(),p.jsx(Zc,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:s,onUnmountAutoFocus:i,children:p.jsx(fl,{asChild:!0,disableOutsidePointerEvents:l,onInteractOutside:g,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onDismiss:()=>y.onOpenChange(!1),children:p.jsx(Wf,{"data-state":C_(y.open),role:"dialog",id:y.contentId,...v,...m,ref:e,style:{...m.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),S_="PopoverClose",M6=x.forwardRef((t,e)=>{const{__scopePopover:n,...o}=t,s=la(S_,n);return p.jsx(tt.button,{type:"button",...o,ref:e,onClick:ze(t.onClick,()=>s.onOpenChange(!1))})});M6.displayName=S_;var R6="PopoverArrow",D6=x.forwardRef((t,e)=>{const{__scopePopover:n,...o}=t,s=su(n);return p.jsx(Kf,{...s,...o,ref:e})});D6.displayName=R6;function C_(t){return t?"open":"closed"}var T6=m_,k6=p_,j6=v_,A6=x_,O6=b_,z6=[" ","Enter","ArrowUp","ArrowDown"],I6=[" ","Enter"],Ha="Select",[eh,th,P6]=z0(Ha),[pl]=Dr(Ha,[P6,ia]),nh=ia(),[$6,ca]=pl(Ha),[L6,H6]=pl(Ha),E_=t=>{const{__scopeSelect:e,children:n,open:o,defaultOpen:s,onOpenChange:i,value:l,defaultValue:u,onValueChange:d,dir:f,name:g,autoComplete:m,disabled:y,required:v,form:w}=t,C=nh(e),[S,N]=x.useState(null),[M,E]=x.useState(null),[R,D]=x.useState(!1),T=Pf(f),[k,O]=ta({prop:o,defaultProp:s??!1,onChange:i,caller:Ha}),[L,W]=ta({prop:l,defaultProp:u,onChange:d,caller:Ha}),B=x.useRef(null),Y=S?w||!!S.closest("form"):!0,[q,z]=x.useState(new Set),V=Array.from(q).map(A=>A.props.value).join(";");return p.jsx(qf,{...C,children:p.jsxs($6,{required:v,scope:e,trigger:S,onTriggerChange:N,valueNode:M,onValueNodeChange:E,valueNodeHasChildren:R,onValueNodeHasChildrenChange:D,contentId:Vn(),value:L,onValueChange:W,open:k,onOpenChange:O,dir:T,triggerPointerDownPosRef:B,disabled:y,children:[p.jsx(eh.Provider,{scope:e,children:p.jsx(L6,{scope:t.__scopeSelect,onNativeOptionAdd:x.useCallback(A=>{z(H=>new Set(H).add(A))},[]),onNativeOptionRemove:x.useCallback(A=>{z(H=>{const P=new Set(H);return P.delete(A),P})},[]),children:n})}),Y?p.jsxs(G_,{"aria-hidden":!0,required:v,tabIndex:-1,name:g,autoComplete:m,value:L,onChange:A=>W(A.target.value),disabled:y,form:w,children:[L===void 0?p.jsx("option",{value:""}):null,Array.from(q)]},V):null]})})};E_.displayName=Ha;var __="SelectTrigger",N_=x.forwardRef((t,e)=>{const{__scopeSelect:n,disabled:o=!1,...s}=t,i=nh(n),l=ca(__,n),u=l.disabled||o,d=Dt(e,l.onTriggerChange),f=th(n),g=x.useRef("touch"),[m,y,v]=W_(C=>{const S=f().filter(E=>!E.disabled),N=S.find(E=>E.value===l.value),M=K_(S,C,N);M!==void 0&&l.onValueChange(M.value)}),w=C=>{u||(l.onOpenChange(!0),v()),C&&(l.triggerPointerDownPosRef.current={x:Math.round(C.pageX),y:Math.round(C.pageY)})};return p.jsx(tu,{asChild:!0,...i,children:p.jsx(tt.button,{type:"button",role:"combobox","aria-controls":l.contentId,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":"none",dir:l.dir,"data-state":l.open?"open":"closed",disabled:u,"data-disabled":u?"":void 0,"data-placeholder":q_(l.value)?"":void 0,...s,ref:d,onClick:ze(s.onClick,C=>{C.currentTarget.focus(),g.current!=="mouse"&&w(C)}),onPointerDown:ze(s.onPointerDown,C=>{g.current=C.pointerType;const S=C.target;S.hasPointerCapture(C.pointerId)&&S.releasePointerCapture(C.pointerId),C.button===0&&C.ctrlKey===!1&&C.pointerType==="mouse"&&(w(C),C.preventDefault())}),onKeyDown:ze(s.onKeyDown,C=>{const S=m.current!=="";!(C.ctrlKey||C.altKey||C.metaKey)&&C.key.length===1&&y(C.key),!(S&&C.key===" ")&&z6.includes(C.key)&&(w(),C.preventDefault())})})})});N_.displayName=__;var M_="SelectValue",R_=x.forwardRef((t,e)=>{const{__scopeSelect:n,className:o,style:s,children:i,placeholder:l="",...u}=t,d=ca(M_,n),{onValueNodeHasChildrenChange:f}=d,g=i!==void 0,m=Dt(e,d.onValueNodeChange);return Kn(()=>{f(g)},[f,g]),p.jsx(tt.span,{...u,ref:m,style:{pointerEvents:"none"},children:q_(d.value)?p.jsx(p.Fragment,{children:l}):i})});R_.displayName=M_;var B6="SelectIcon",D_=x.forwardRef((t,e)=>{const{__scopeSelect:n,children:o,...s}=t;return p.jsx(tt.span,{"aria-hidden":!0,...s,ref:e,children:o||"▼"})});D_.displayName=B6;var F6="SelectPortal",T_=t=>p.jsx(hl,{asChild:!0,...t});T_.displayName=F6;var Ba="SelectContent",k_=x.forwardRef((t,e)=>{const n=ca(Ba,t.__scopeSelect),[o,s]=x.useState();if(Kn(()=>{s(new DocumentFragment)},[]),!n.open){const i=o;return i?qa.createPortal(p.jsx(j_,{scope:t.__scopeSelect,children:p.jsx(eh.Slot,{scope:t.__scopeSelect,children:p.jsx("div",{children:t.children})})}),i):null}return p.jsx(A_,{...t,ref:e})});k_.displayName=Ba;var Xo=10,[j_,ua]=pl(Ba),V6="SelectContentImpl",U6=ea("SelectContent.RemoveScroll"),A_=x.forwardRef((t,e)=>{const{__scopeSelect:n,position:o="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:i,onPointerDownOutside:l,side:u,sideOffset:d,align:f,alignOffset:g,arrowPadding:m,collisionBoundary:y,collisionPadding:v,sticky:w,hideWhenDetached:C,avoidCollisions:S,...N}=t,M=ca(Ba,n),[E,R]=x.useState(null),[D,T]=x.useState(null),k=Dt(e,X=>R(X)),[O,L]=x.useState(null),[W,B]=x.useState(null),Y=th(n),[q,z]=x.useState(!1),V=x.useRef(!1);x.useEffect(()=>{if(E)return Hf(E)},[E]),$f();const A=x.useCallback(X=>{const[ee,...se]=Y().map(ie=>ie.ref.current),[le]=se.slice(-1),pe=document.activeElement;for(const ie of X)if(ie===pe||(ie?.scrollIntoView({block:"nearest"}),ie===ee&&D&&(D.scrollTop=0),ie===le&&D&&(D.scrollTop=D.scrollHeight),ie?.focus(),document.activeElement!==pe))return},[Y,D]),H=x.useCallback(()=>A([O,E]),[A,O,E]);x.useEffect(()=>{q&&H()},[q,H]);const{onOpenChange:P,triggerPointerDownPosRef:F}=M;x.useEffect(()=>{if(E){let X={x:0,y:0};const ee=le=>{X={x:Math.abs(Math.round(le.pageX)-(F.current?.x??0)),y:Math.abs(Math.round(le.pageY)-(F.current?.y??0))}},se=le=>{X.x<=10&&X.y<=10?le.preventDefault():E.contains(le.target)||P(!1),document.removeEventListener("pointermove",ee),F.current=null};return F.current!==null&&(document.addEventListener("pointermove",ee),document.addEventListener("pointerup",se,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ee),document.removeEventListener("pointerup",se,{capture:!0})}}},[E,P,F]),x.useEffect(()=>{const X=()=>P(!1);return window.addEventListener("blur",X),window.addEventListener("resize",X),()=>{window.removeEventListener("blur",X),window.removeEventListener("resize",X)}},[P]);const[Q,$]=W_(X=>{const ee=Y().filter(pe=>!pe.disabled),se=ee.find(pe=>pe.ref.current===document.activeElement),le=K_(ee,X,se);le&&setTimeout(()=>le.ref.current.focus())}),I=x.useCallback((X,ee,se)=>{const le=!V.current&&!se;(M.value!==void 0&&M.value===ee||le)&&(L(X),le&&(V.current=!0))},[M.value]),U=x.useCallback(()=>E?.focus(),[E]),K=x.useCallback((X,ee,se)=>{const le=!V.current&&!se;(M.value!==void 0&&M.value===ee||le)&&B(X)},[M.value]),J=o==="popper"?Yp:O_,ne=J===Yp?{side:u,sideOffset:d,align:f,alignOffset:g,arrowPadding:m,collisionBoundary:y,collisionPadding:v,sticky:w,hideWhenDetached:C,avoidCollisions:S}:{};return p.jsx(j_,{scope:n,content:E,viewport:D,onViewportChange:T,itemRefCallback:I,selectedItem:O,onItemLeave:U,itemTextRefCallback:K,focusSelectedItem:H,selectedItemText:W,position:o,isPositioned:q,searchRef:Q,children:p.jsx(Jc,{as:U6,allowPinchZoom:!0,children:p.jsx(Zc,{asChild:!0,trapped:M.open,onMountAutoFocus:X=>{X.preventDefault()},onUnmountAutoFocus:ze(s,X=>{M.trigger?.focus({preventScroll:!0}),X.preventDefault()}),children:p.jsx(fl,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:X=>X.preventDefault(),onDismiss:()=>M.onOpenChange(!1),children:p.jsx(J,{role:"listbox",id:M.contentId,"data-state":M.open?"open":"closed",dir:M.dir,onContextMenu:X=>X.preventDefault(),...N,...ne,onPlaced:()=>z(!0),ref:k,style:{display:"flex",flexDirection:"column",outline:"none",...N.style},onKeyDown:ze(N.onKeyDown,X=>{const ee=X.ctrlKey||X.altKey||X.metaKey;if(X.key==="Tab"&&X.preventDefault(),!ee&&X.key.length===1&&$(X.key),["ArrowUp","ArrowDown","Home","End"].includes(X.key)){let le=Y().filter(pe=>!pe.disabled).map(pe=>pe.ref.current);if(["ArrowUp","End"].includes(X.key)&&(le=le.slice().reverse()),["ArrowUp","ArrowDown"].includes(X.key)){const pe=X.target,ie=le.indexOf(pe);le=le.slice(ie+1)}setTimeout(()=>A(le)),X.preventDefault()}})})})})})})});A_.displayName=V6;var Y6="SelectItemAlignedPosition",O_=x.forwardRef((t,e)=>{const{__scopeSelect:n,onPlaced:o,...s}=t,i=ca(Ba,n),l=ua(Ba,n),[u,d]=x.useState(null),[f,g]=x.useState(null),m=Dt(e,k=>g(k)),y=th(n),v=x.useRef(!1),w=x.useRef(!0),{viewport:C,selectedItem:S,selectedItemText:N,focusSelectedItem:M}=l,E=x.useCallback(()=>{if(i.trigger&&i.valueNode&&u&&f&&C&&S&&N){const k=i.trigger.getBoundingClientRect(),O=f.getBoundingClientRect(),L=i.valueNode.getBoundingClientRect(),W=N.getBoundingClientRect();if(i.dir!=="rtl"){const pe=W.left-O.left,ie=L.left-pe,be=k.left-ie,ke=k.width+be,Be=Math.max(ke,O.width),Ie=window.innerWidth-Xo,lt=Hw(ie,[Xo,Math.max(Xo,Ie-Be)]);u.style.minWidth=ke+"px",u.style.left=lt+"px"}else{const pe=O.right-W.right,ie=window.innerWidth-L.right-pe,be=window.innerWidth-k.right-ie,ke=k.width+be,Be=Math.max(ke,O.width),Ie=window.innerWidth-Xo,lt=Hw(ie,[Xo,Math.max(Xo,Ie-Be)]);u.style.minWidth=ke+"px",u.style.right=lt+"px"}const B=y(),Y=window.innerHeight-Xo*2,q=C.scrollHeight,z=window.getComputedStyle(f),V=parseInt(z.borderTopWidth,10),A=parseInt(z.paddingTop,10),H=parseInt(z.borderBottomWidth,10),P=parseInt(z.paddingBottom,10),F=V+A+q+P+H,Q=Math.min(S.offsetHeight*5,F),$=window.getComputedStyle(C),I=parseInt($.paddingTop,10),U=parseInt($.paddingBottom,10),K=k.top+k.height/2-Xo,J=Y-K,ne=S.offsetHeight/2,X=S.offsetTop+ne,ee=V+A+X,se=F-ee;if(ee<=K){const pe=B.length>0&&S===B[B.length-1].ref.current;u.style.bottom="0px";const ie=f.clientHeight-C.offsetTop-C.offsetHeight,be=Math.max(J,ne+(pe?U:0)+ie+H),ke=ee+be;u.style.height=ke+"px"}else{const pe=B.length>0&&S===B[0].ref.current;u.style.top="0px";const be=Math.max(K,V+C.offsetTop+(pe?I:0)+ne)+se;u.style.height=be+"px",C.scrollTop=ee-K+C.offsetTop}u.style.margin=`${Xo}px 0`,u.style.minHeight=Q+"px",u.style.maxHeight=Y+"px",o?.(),requestAnimationFrame(()=>v.current=!0)}},[y,i.trigger,i.valueNode,u,f,C,S,N,i.dir,o]);Kn(()=>E(),[E]);const[R,D]=x.useState();Kn(()=>{f&&D(window.getComputedStyle(f).zIndex)},[f]);const T=x.useCallback(k=>{k&&w.current===!0&&(E(),M?.(),w.current=!1)},[E,M]);return p.jsx(q6,{scope:n,contentWrapper:u,shouldExpandOnScrollRef:v,onScrollButtonChange:T,children:p.jsx("div",{ref:d,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:R},children:p.jsx(tt.div,{...s,ref:m,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});O_.displayName=Y6;var G6="SelectPopperPosition",Yp=x.forwardRef((t,e)=>{const{__scopeSelect:n,align:o="start",collisionPadding:s=Xo,...i}=t,l=nh(n);return p.jsx(Wf,{...l,...i,ref:e,align:o,collisionPadding:s,style:{boxSizing:"border-box",...i.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)"}})});Yp.displayName=G6;var[q6,iy]=pl(Ba,{}),Gp="SelectViewport",z_=x.forwardRef((t,e)=>{const{__scopeSelect:n,nonce:o,...s}=t,i=ua(Gp,n),l=iy(Gp,n),u=Dt(e,i.onViewportChange),d=x.useRef(0);return p.jsxs(p.Fragment,{children:[p.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:o}),p.jsx(eh.Slot,{scope:n,children:p.jsx(tt.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:u,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:ze(s.onScroll,f=>{const g=f.currentTarget,{contentWrapper:m,shouldExpandOnScrollRef:y}=l;if(y?.current&&m){const v=Math.abs(d.current-g.scrollTop);if(v>0){const w=window.innerHeight-Xo*2,C=parseFloat(m.style.minHeight),S=parseFloat(m.style.height),N=Math.max(C,S);if(N<w){const M=N+v,E=Math.min(w,M),R=M-E;m.style.height=E+"px",m.style.bottom==="0px"&&(g.scrollTop=R>0?R:0,m.style.justifyContent="flex-end")}}}d.current=g.scrollTop})})})]})});z_.displayName=Gp;var I_="SelectGroup",[W6,K6]=pl(I_),X6=x.forwardRef((t,e)=>{const{__scopeSelect:n,...o}=t,s=Vn();return p.jsx(W6,{scope:n,id:s,children:p.jsx(tt.div,{role:"group","aria-labelledby":s,...o,ref:e})})});X6.displayName=I_;var P_="SelectLabel",Q6=x.forwardRef((t,e)=>{const{__scopeSelect:n,...o}=t,s=K6(P_,n);return p.jsx(tt.div,{id:s.id,...o,ref:e})});Q6.displayName=P_;var vf="SelectItem",[Z6,$_]=pl(vf),L_=x.forwardRef((t,e)=>{const{__scopeSelect:n,value:o,disabled:s=!1,textValue:i,...l}=t,u=ca(vf,n),d=ua(vf,n),f=u.value===o,[g,m]=x.useState(i??""),[y,v]=x.useState(!1),w=Dt(e,M=>d.itemRefCallback?.(M,o,s)),C=Vn(),S=x.useRef("touch"),N=()=>{s||(u.onValueChange(o),u.onOpenChange(!1))};if(o==="")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 p.jsx(Z6,{scope:n,value:o,disabled:s,textId:C,isSelected:f,onItemTextChange:x.useCallback(M=>{m(E=>E||(M?.textContent??"").trim())},[]),children:p.jsx(eh.ItemSlot,{scope:n,value:o,disabled:s,textValue:g,children:p.jsx(tt.div,{role:"option","aria-labelledby":C,"data-highlighted":y?"":void 0,"aria-selected":f&&y,"data-state":f?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...l,ref:w,onFocus:ze(l.onFocus,()=>v(!0)),onBlur:ze(l.onBlur,()=>v(!1)),onClick:ze(l.onClick,()=>{S.current!=="mouse"&&N()}),onPointerUp:ze(l.onPointerUp,()=>{S.current==="mouse"&&N()}),onPointerDown:ze(l.onPointerDown,M=>{S.current=M.pointerType}),onPointerMove:ze(l.onPointerMove,M=>{S.current=M.pointerType,s?d.onItemLeave?.():S.current==="mouse"&&M.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ze(l.onPointerLeave,M=>{M.currentTarget===document.activeElement&&d.onItemLeave?.()}),onKeyDown:ze(l.onKeyDown,M=>{d.searchRef?.current!==""&&M.key===" "||(I6.includes(M.key)&&N(),M.key===" "&&M.preventDefault())})})})})});L_.displayName=vf;var Sc="SelectItemText",H_=x.forwardRef((t,e)=>{const{__scopeSelect:n,className:o,style:s,...i}=t,l=ca(Sc,n),u=ua(Sc,n),d=$_(Sc,n),f=H6(Sc,n),[g,m]=x.useState(null),y=Dt(e,N=>m(N),d.onItemTextChange,N=>u.itemTextRefCallback?.(N,d.value,d.disabled)),v=g?.textContent,w=x.useMemo(()=>p.jsx("option",{value:d.value,disabled:d.disabled,children:v},d.value),[d.disabled,d.value,v]),{onNativeOptionAdd:C,onNativeOptionRemove:S}=f;return Kn(()=>(C(w),()=>S(w)),[C,S,w]),p.jsxs(p.Fragment,{children:[p.jsx(tt.span,{id:d.textId,...i,ref:y}),d.isSelected&&l.valueNode&&!l.valueNodeHasChildren?qa.createPortal(i.children,l.valueNode):null]})});H_.displayName=Sc;var B_="SelectItemIndicator",F_=x.forwardRef((t,e)=>{const{__scopeSelect:n,...o}=t;return $_(B_,n).isSelected?p.jsx(tt.span,{"aria-hidden":!0,...o,ref:e}):null});F_.displayName=B_;var qp="SelectScrollUpButton",V_=x.forwardRef((t,e)=>{const n=ua(qp,t.__scopeSelect),o=iy(qp,t.__scopeSelect),[s,i]=x.useState(!1),l=Dt(e,o.onScrollButtonChange);return Kn(()=>{if(n.viewport&&n.isPositioned){let u=function(){const f=d.scrollTop>0;i(f)};const d=n.viewport;return u(),d.addEventListener("scroll",u),()=>d.removeEventListener("scroll",u)}},[n.viewport,n.isPositioned]),s?p.jsx(Y_,{...t,ref:l,onAutoScroll:()=>{const{viewport:u,selectedItem:d}=n;u&&d&&(u.scrollTop=u.scrollTop-d.offsetHeight)}}):null});V_.displayName=qp;var Wp="SelectScrollDownButton",U_=x.forwardRef((t,e)=>{const n=ua(Wp,t.__scopeSelect),o=iy(Wp,t.__scopeSelect),[s,i]=x.useState(!1),l=Dt(e,o.onScrollButtonChange);return Kn(()=>{if(n.viewport&&n.isPositioned){let u=function(){const f=d.scrollHeight-d.clientHeight,g=Math.ceil(d.scrollTop)<f;i(g)};const d=n.viewport;return u(),d.addEventListener("scroll",u),()=>d.removeEventListener("scroll",u)}},[n.viewport,n.isPositioned]),s?p.jsx(Y_,{...t,ref:l,onAutoScroll:()=>{const{viewport:u,selectedItem:d}=n;u&&d&&(u.scrollTop=u.scrollTop+d.offsetHeight)}}):null});U_.displayName=Wp;var Y_=x.forwardRef((t,e)=>{const{__scopeSelect:n,onAutoScroll:o,...s}=t,i=ua("SelectScrollButton",n),l=x.useRef(null),u=th(n),d=x.useCallback(()=>{l.current!==null&&(window.clearInterval(l.current),l.current=null)},[]);return x.useEffect(()=>()=>d(),[d]),Kn(()=>{u().find(g=>g.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[u]),p.jsx(tt.div,{"aria-hidden":!0,...s,ref:e,style:{flexShrink:0,...s.style},onPointerDown:ze(s.onPointerDown,()=>{l.current===null&&(l.current=window.setInterval(o,50))}),onPointerMove:ze(s.onPointerMove,()=>{i.onItemLeave?.(),l.current===null&&(l.current=window.setInterval(o,50))}),onPointerLeave:ze(s.onPointerLeave,()=>{d()})})}),J6="SelectSeparator",ez=x.forwardRef((t,e)=>{const{__scopeSelect:n,...o}=t;return p.jsx(tt.div,{"aria-hidden":!0,...o,ref:e})});ez.displayName=J6;var Kp="SelectArrow",tz=x.forwardRef((t,e)=>{const{__scopeSelect:n,...o}=t,s=nh(n),i=ca(Kp,n),l=ua(Kp,n);return i.open&&l.position==="popper"?p.jsx(Kf,{...s,...o,ref:e}):null});tz.displayName=Kp;var nz="SelectBubbleInput",G_=x.forwardRef(({__scopeSelect:t,value:e,...n},o)=>{const s=x.useRef(null),i=Dt(o,s),l=KC(e);return x.useEffect(()=>{const u=s.current;if(!u)return;const d=window.HTMLSelectElement.prototype,g=Object.getOwnPropertyDescriptor(d,"value").set;if(l!==e&&g){const m=new Event("change",{bubbles:!0});g.call(u,e),u.dispatchEvent(m)}},[l,e]),p.jsx(tt.select,{...n,style:{...vC,...n.style},ref:i,defaultValue:e})});G_.displayName=nz;function q_(t){return t===""||t===void 0}function W_(t){const e=_r(t),n=x.useRef(""),o=x.useRef(0),s=x.useCallback(l=>{const u=n.current+l;e(u),(function d(f){n.current=f,window.clearTimeout(o.current),f!==""&&(o.current=window.setTimeout(()=>d(""),1e3))})(u)},[e]),i=x.useCallback(()=>{n.current="",window.clearTimeout(o.current)},[]);return x.useEffect(()=>()=>window.clearTimeout(o.current),[]),[n,s,i]}function K_(t,e,n){const s=e.length>1&&Array.from(e).every(f=>f===e[0])?e[0]:e,i=n?t.indexOf(n):-1;let l=oz(t,Math.max(i,0));s.length===1&&(l=l.filter(f=>f!==n));const d=l.find(f=>f.textValue.toLowerCase().startsWith(s.toLowerCase()));return d!==n?d:void 0}function oz(t,e){return t.map((n,o)=>t[(e+o)%t.length])}var rz=E_,sz=N_,az=R_,iz=D_,lz=T_,cz=k_,uz=z_,dz=L_,fz=H_,hz=F_,mz=V_,gz=U_,[oh]=Dr("Tooltip",[ia]),rh=ia(),X_="TooltipProvider",pz=700,Xp="tooltip.open",[yz,ly]=oh(X_),Q_=t=>{const{__scopeTooltip:e,delayDuration:n=pz,skipDelayDuration:o=300,disableHoverableContent:s=!1,children:i}=t,l=x.useRef(!0),u=x.useRef(!1),d=x.useRef(0);return x.useEffect(()=>{const f=d.current;return()=>window.clearTimeout(f)},[]),p.jsx(yz,{scope:e,isOpenDelayedRef:l,delayDuration:n,onOpen:x.useCallback(()=>{window.clearTimeout(d.current),l.current=!1},[]),onClose:x.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>l.current=!0,o)},[o]),isPointerInTransitRef:u,onPointerInTransitChange:x.useCallback(f=>{u.current=f},[]),disableHoverableContent:s,children:i})};Q_.displayName=X_;var zc="Tooltip",[vz,au]=oh(zc),Z_=t=>{const{__scopeTooltip:e,children:n,open:o,defaultOpen:s,onOpenChange:i,disableHoverableContent:l,delayDuration:u}=t,d=ly(zc,t.__scopeTooltip),f=rh(e),[g,m]=x.useState(null),y=Vn(),v=x.useRef(0),w=l??d.disableHoverableContent,C=u??d.delayDuration,S=x.useRef(!1),[N,M]=ta({prop:o,defaultProp:s??!1,onChange:k=>{k?(d.onOpen(),document.dispatchEvent(new CustomEvent(Xp))):d.onClose(),i?.(k)},caller:zc}),E=x.useMemo(()=>N?S.current?"delayed-open":"instant-open":"closed",[N]),R=x.useCallback(()=>{window.clearTimeout(v.current),v.current=0,S.current=!1,M(!0)},[M]),D=x.useCallback(()=>{window.clearTimeout(v.current),v.current=0,M(!1)},[M]),T=x.useCallback(()=>{window.clearTimeout(v.current),v.current=window.setTimeout(()=>{S.current=!0,M(!0),v.current=0},C)},[C,M]);return x.useEffect(()=>()=>{v.current&&(window.clearTimeout(v.current),v.current=0)},[]),p.jsx(qf,{...f,children:p.jsx(vz,{scope:e,contentId:y,open:N,stateAttribute:E,trigger:g,onTriggerChange:m,onTriggerEnter:x.useCallback(()=>{d.isOpenDelayedRef.current?T():R()},[d.isOpenDelayedRef,T,R]),onTriggerLeave:x.useCallback(()=>{w?D():(window.clearTimeout(v.current),v.current=0)},[D,w]),onOpen:R,onClose:D,disableHoverableContent:w,children:n})})};Z_.displayName=zc;var Qp="TooltipTrigger",J_=x.forwardRef((t,e)=>{const{__scopeTooltip:n,...o}=t,s=au(Qp,n),i=ly(Qp,n),l=rh(n),u=x.useRef(null),d=Dt(e,u,s.onTriggerChange),f=x.useRef(!1),g=x.useRef(!1),m=x.useCallback(()=>f.current=!1,[]);return x.useEffect(()=>()=>document.removeEventListener("pointerup",m),[m]),p.jsx(tu,{asChild:!0,...l,children:p.jsx(tt.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...o,ref:d,onPointerMove:ze(t.onPointerMove,y=>{y.pointerType!=="touch"&&!g.current&&!i.isPointerInTransitRef.current&&(s.onTriggerEnter(),g.current=!0)}),onPointerLeave:ze(t.onPointerLeave,()=>{s.onTriggerLeave(),g.current=!1}),onPointerDown:ze(t.onPointerDown,()=>{s.open&&s.onClose(),f.current=!0,document.addEventListener("pointerup",m,{once:!0})}),onFocus:ze(t.onFocus,()=>{f.current||s.onOpen()}),onBlur:ze(t.onBlur,s.onClose),onClick:ze(t.onClick,s.onClose)})})});J_.displayName=Qp;var cy="TooltipPortal",[xz,bz]=oh(cy,{forceMount:void 0}),eN=t=>{const{__scopeTooltip:e,forceMount:n,children:o,container:s}=t,i=au(cy,e);return p.jsx(xz,{scope:e,forceMount:n,children:p.jsx(Ro,{present:n||i.open,children:p.jsx(hl,{asChild:!0,container:s,children:o})})})};eN.displayName=cy;var Xi="TooltipContent",tN=x.forwardRef((t,e)=>{const n=bz(Xi,t.__scopeTooltip),{forceMount:o=n.forceMount,side:s="top",...i}=t,l=au(Xi,t.__scopeTooltip);return p.jsx(Ro,{present:o||l.open,children:l.disableHoverableContent?p.jsx(nN,{side:s,...i,ref:e}):p.jsx(wz,{side:s,...i,ref:e})})}),wz=x.forwardRef((t,e)=>{const n=au(Xi,t.__scopeTooltip),o=ly(Xi,t.__scopeTooltip),s=x.useRef(null),i=Dt(e,s),[l,u]=x.useState(null),{trigger:d,onClose:f}=n,g=s.current,{onPointerInTransitChange:m}=o,y=x.useCallback(()=>{u(null),m(!1)},[m]),v=x.useCallback((w,C)=>{const S=w.currentTarget,N={x:w.clientX,y:w.clientY},M=_z(N,S.getBoundingClientRect()),E=Nz(N,M),R=Mz(C.getBoundingClientRect()),D=Dz([...E,...R]);u(D),m(!0)},[m]);return x.useEffect(()=>()=>y(),[y]),x.useEffect(()=>{if(d&&g){const w=S=>v(S,g),C=S=>v(S,d);return d.addEventListener("pointerleave",w),g.addEventListener("pointerleave",C),()=>{d.removeEventListener("pointerleave",w),g.removeEventListener("pointerleave",C)}}},[d,g,v,y]),x.useEffect(()=>{if(l){const w=C=>{const S=C.target,N={x:C.clientX,y:C.clientY},M=d?.contains(S)||g?.contains(S),E=!Rz(N,l);M?y():E&&(y(),f())};return document.addEventListener("pointermove",w),()=>document.removeEventListener("pointermove",w)}},[d,g,l,f,y]),p.jsx(nN,{...t,ref:i})}),[Sz,Cz]=oh(zc,{isInside:!1}),Ez=Uk("TooltipContent"),nN=x.forwardRef((t,e)=>{const{__scopeTooltip:n,children:o,"aria-label":s,onEscapeKeyDown:i,onPointerDownOutside:l,...u}=t,d=au(Xi,n),f=rh(n),{onClose:g}=d;return x.useEffect(()=>(document.addEventListener(Xp,g),()=>document.removeEventListener(Xp,g)),[g]),x.useEffect(()=>{if(d.trigger){const m=y=>{y.target?.contains(d.trigger)&&g()};return window.addEventListener("scroll",m,{capture:!0}),()=>window.removeEventListener("scroll",m,{capture:!0})}},[d.trigger,g]),p.jsx(fl,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:m=>m.preventDefault(),onDismiss:g,children:p.jsxs(Wf,{"data-state":d.stateAttribute,...f,...u,ref:e,style:{...u.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[p.jsx(Ez,{children:o}),p.jsx(Sz,{scope:n,isInside:!0,children:p.jsx(Xk,{id:d.contentId,role:"tooltip",children:s||o})})]})})});tN.displayName=Xi;var oN="TooltipArrow",rN=x.forwardRef((t,e)=>{const{__scopeTooltip:n,...o}=t,s=rh(n);return Cz(oN,n).isInside?null:p.jsx(Kf,{...s,...o,ref:e})});rN.displayName=oN;function _z(t,e){const n=Math.abs(e.top-t.y),o=Math.abs(e.bottom-t.y),s=Math.abs(e.right-t.x),i=Math.abs(e.left-t.x);switch(Math.min(n,o,s,i)){case i:return"left";case s:return"right";case n:return"top";case o:return"bottom";default:throw new Error("unreachable")}}function Nz(t,e,n=5){const o=[];switch(e){case"top":o.push({x:t.x-n,y:t.y+n},{x:t.x+n,y:t.y+n});break;case"bottom":o.push({x:t.x-n,y:t.y-n},{x:t.x+n,y:t.y-n});break;case"left":o.push({x:t.x+n,y:t.y-n},{x:t.x+n,y:t.y+n});break;case"right":o.push({x:t.x-n,y:t.y-n},{x:t.x-n,y:t.y+n});break}return o}function Mz(t){const{top:e,right:n,bottom:o,left:s}=t;return[{x:s,y:e},{x:n,y:e},{x:n,y:o},{x:s,y:o}]}function Rz(t,e){const{x:n,y:o}=t;let s=!1;for(let i=0,l=e.length-1;i<e.length;l=i++){const u=e[i],d=e[l],f=u.x,g=u.y,m=d.x,y=d.y;g>o!=y>o&&n<(m-f)*(o-g)/(y-g)+f&&(s=!s)}return s}function Dz(t){const e=t.slice();return e.sort((n,o)=>n.x<o.x?-1:n.x>o.x?1:n.y<o.y?-1:n.y>o.y?1:0),Tz(e)}function Tz(t){if(t.length<=1)return t.slice();const e=[];for(let o=0;o<t.length;o++){const s=t[o];for(;e.length>=2;){const i=e[e.length-1],l=e[e.length-2];if((i.x-l.x)*(s.y-l.y)>=(i.y-l.y)*(s.x-l.x))e.pop();else break}e.push(s)}e.pop();const n=[];for(let o=t.length-1;o>=0;o--){const s=t[o];for(;n.length>=2;){const i=n[n.length-1],l=n[n.length-2];if((i.x-l.x)*(s.y-l.y)>=(i.y-l.y)*(s.x-l.x))n.pop();else break}n.push(s)}return n.pop(),e.length===1&&n.length===1&&e[0].x===n[0].x&&e[0].y===n[0].y?e:e.concat(n)}var kz=Q_,jz=Z_,Az=J_,Oz=eN,zz=tN,Iz=rN;const Pz=(t,e)=>{const n=new Array(t.length+e.length);for(let o=0;o<t.length;o++)n[o]=t[o];for(let o=0;o<e.length;o++)n[t.length+o]=e[o];return n},$z=(t,e)=>({classGroupId:t,validator:e}),sN=(t=new Map,e=null,n)=>({nextPart:t,validators:e,classGroupId:n}),xf="-",Bw=[],Lz="arbitrary..",Hz=t=>{const e=Fz(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:o}=t;return{getClassGroupId:l=>{if(l.startsWith("[")&&l.endsWith("]"))return Bz(l);const u=l.split(xf),d=u[0]===""&&u.length>1?1:0;return aN(u,d,e)},getConflictingClassGroupIds:(l,u)=>{if(u){const d=o[l],f=n[l];return d?f?Pz(f,d):d:f||Bw}return n[l]||Bw}}},aN=(t,e,n)=>{if(t.length-e===0)return n.classGroupId;const s=t[e],i=n.nextPart.get(s);if(i){const f=aN(t,e+1,i);if(f)return f}const l=n.validators;if(l===null)return;const u=e===0?t.join(xf):t.slice(e).join(xf),d=l.length;for(let f=0;f<d;f++){const g=l[f];if(g.validator(u))return g.classGroupId}},Bz=t=>t.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const e=t.slice(1,-1),n=e.indexOf(":"),o=e.slice(0,n);return o?Lz+o:void 0})(),Fz=t=>{const{theme:e,classGroups:n}=t;return Vz(n,e)},Vz=(t,e)=>{const n=sN();for(const o in t){const s=t[o];uy(s,n,o,e)}return n},uy=(t,e,n,o)=>{const s=t.length;for(let i=0;i<s;i++){const l=t[i];Uz(l,e,n,o)}},Uz=(t,e,n,o)=>{if(typeof t=="string"){Yz(t,e,n);return}if(typeof t=="function"){Gz(t,e,n,o);return}qz(t,e,n,o)},Yz=(t,e,n)=>{const o=t===""?e:iN(e,t);o.classGroupId=n},Gz=(t,e,n,o)=>{if(Wz(t)){uy(t(o),e,n,o);return}e.validators===null&&(e.validators=[]),e.validators.push($z(n,t))},qz=(t,e,n,o)=>{const s=Object.entries(t),i=s.length;for(let l=0;l<i;l++){const[u,d]=s[l];uy(d,iN(e,u),n,o)}},iN=(t,e)=>{let n=t;const o=e.split(xf),s=o.length;for(let i=0;i<s;i++){const l=o[i];let u=n.nextPart.get(l);u||(u=sN(),n.nextPart.set(l,u)),n=u}return n},Wz=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,Kz=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=Object.create(null),o=Object.create(null);const s=(i,l)=>{n[i]=l,e++,e>t&&(e=0,o=n,n=Object.create(null))};return{get(i){let l=n[i];if(l!==void 0)return l;if((l=o[i])!==void 0)return s(i,l),l},set(i,l){i in n?n[i]=l:s(i,l)}}},Zp="!",Fw=":",Xz=[],Vw=(t,e,n,o,s)=>({modifiers:t,hasImportantModifier:e,baseClassName:n,maybePostfixModifierPosition:o,isExternal:s}),Qz=t=>{const{prefix:e,experimentalParseClassName:n}=t;let o=s=>{const i=[];let l=0,u=0,d=0,f;const g=s.length;for(let C=0;C<g;C++){const S=s[C];if(l===0&&u===0){if(S===Fw){i.push(s.slice(d,C)),d=C+1;continue}if(S==="/"){f=C;continue}}S==="["?l++:S==="]"?l--:S==="("?u++:S===")"&&u--}const m=i.length===0?s:s.slice(d);let y=m,v=!1;m.endsWith(Zp)?(y=m.slice(0,-1),v=!0):m.startsWith(Zp)&&(y=m.slice(1),v=!0);const w=f&&f>d?f-d:void 0;return Vw(i,v,y,w)};if(e){const s=e+Fw,i=o;o=l=>l.startsWith(s)?i(l.slice(s.length)):Vw(Xz,!1,l,void 0,!0)}if(n){const s=o;o=i=>n({className:i,parseClassName:s})}return o},Zz=t=>{const e=new Map;return t.orderSensitiveModifiers.forEach((n,o)=>{e.set(n,1e6+o)}),n=>{const o=[];let s=[];for(let i=0;i<n.length;i++){const l=n[i],u=l[0]==="[",d=e.has(l);u||d?(s.length>0&&(s.sort(),o.push(...s),s=[]),o.push(l)):s.push(l)}return s.length>0&&(s.sort(),o.push(...s)),o}},Jz=t=>({cache:Kz(t.cacheSize),parseClassName:Qz(t),sortModifiers:Zz(t),...Hz(t)}),e8=/\s+/,t8=(t,e)=>{const{parseClassName:n,getClassGroupId:o,getConflictingClassGroupIds:s,sortModifiers:i}=e,l=[],u=t.trim().split(e8);let d="";for(let f=u.length-1;f>=0;f-=1){const g=u[f],{isExternal:m,modifiers:y,hasImportantModifier:v,baseClassName:w,maybePostfixModifierPosition:C}=n(g);if(m){d=g+(d.length>0?" "+d:d);continue}let S=!!C,N=o(S?w.substring(0,C):w);if(!N){if(!S){d=g+(d.length>0?" "+d:d);continue}if(N=o(w),!N){d=g+(d.length>0?" "+d:d);continue}S=!1}const M=y.length===0?"":y.length===1?y[0]:i(y).join(":"),E=v?M+Zp:M,R=E+N;if(l.indexOf(R)>-1)continue;l.push(R);const D=s(N,S);for(let T=0;T<D.length;++T){const k=D[T];l.push(E+k)}d=g+(d.length>0?" "+d:d)}return d},n8=(...t)=>{let e=0,n,o,s="";for(;e<t.length;)(n=t[e++])&&(o=lN(n))&&(s&&(s+=" "),s+=o);return s},lN=t=>{if(typeof t=="string")return t;let e,n="";for(let o=0;o<t.length;o++)t[o]&&(e=lN(t[o]))&&(n&&(n+=" "),n+=e);return n},o8=(t,...e)=>{let n,o,s,i;const l=d=>{const f=e.reduce((g,m)=>m(g),t());return n=Jz(f),o=n.cache.get,s=n.cache.set,i=u,u(d)},u=d=>{const f=o(d);if(f)return f;const g=t8(d,n);return s(d,g),g};return i=l,(...d)=>i(n8(...d))},r8=[],An=t=>{const e=n=>n[t]||r8;return e.isThemeGetter=!0,e},cN=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,uN=/^\((?:(\w[\w-]*):)?(.+)\)$/i,s8=/^\d+\/\d+$/,a8=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,i8=/\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$/,l8=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,c8=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,u8=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ki=t=>s8.test(t),ft=t=>!!t&&!Number.isNaN(Number(t)),Ys=t=>!!t&&Number.isInteger(Number(t)),np=t=>t.endsWith("%")&&ft(t.slice(0,-1)),ts=t=>a8.test(t),d8=()=>!0,f8=t=>i8.test(t)&&!l8.test(t),dN=()=>!1,h8=t=>c8.test(t),m8=t=>u8.test(t),g8=t=>!Le(t)&&!He(t),p8=t=>yl(t,mN,dN),Le=t=>cN.test(t),Ta=t=>yl(t,gN,f8),op=t=>yl(t,w8,ft),Uw=t=>yl(t,fN,dN),y8=t=>yl(t,hN,m8),$d=t=>yl(t,pN,h8),He=t=>uN.test(t),hc=t=>vl(t,gN),v8=t=>vl(t,S8),Yw=t=>vl(t,fN),x8=t=>vl(t,mN),b8=t=>vl(t,hN),Ld=t=>vl(t,pN,!0),yl=(t,e,n)=>{const o=cN.exec(t);return o?o[1]?e(o[1]):n(o[2]):!1},vl=(t,e,n=!1)=>{const o=uN.exec(t);return o?o[1]?e(o[1]):n:!1},fN=t=>t==="position"||t==="percentage",hN=t=>t==="image"||t==="url",mN=t=>t==="length"||t==="size"||t==="bg-size",gN=t=>t==="length",w8=t=>t==="number",S8=t=>t==="family-name",pN=t=>t==="shadow",C8=()=>{const t=An("color"),e=An("font"),n=An("text"),o=An("font-weight"),s=An("tracking"),i=An("leading"),l=An("breakpoint"),u=An("container"),d=An("spacing"),f=An("radius"),g=An("shadow"),m=An("inset-shadow"),y=An("text-shadow"),v=An("drop-shadow"),w=An("blur"),C=An("perspective"),S=An("aspect"),N=An("ease"),M=An("animate"),E=()=>["auto","avoid","all","avoid-page","page","left","right","column"],R=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],D=()=>[...R(),He,Le],T=()=>["auto","hidden","clip","visible","scroll"],k=()=>["auto","contain","none"],O=()=>[He,Le,d],L=()=>[ki,"full","auto",...O()],W=()=>[Ys,"none","subgrid",He,Le],B=()=>["auto",{span:["full",Ys,He,Le]},Ys,He,Le],Y=()=>[Ys,"auto",He,Le],q=()=>["auto","min","max","fr",He,Le],z=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],V=()=>["start","end","center","stretch","center-safe","end-safe"],A=()=>["auto",...O()],H=()=>[ki,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...O()],P=()=>[t,He,Le],F=()=>[...R(),Yw,Uw,{position:[He,Le]}],Q=()=>["no-repeat",{repeat:["","x","y","space","round"]}],$=()=>["auto","cover","contain",x8,p8,{size:[He,Le]}],I=()=>[np,hc,Ta],U=()=>["","none","full",f,He,Le],K=()=>["",ft,hc,Ta],J=()=>["solid","dashed","dotted","double"],ne=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],X=()=>[ft,np,Yw,Uw],ee=()=>["","none",w,He,Le],se=()=>["none",ft,He,Le],le=()=>["none",ft,He,Le],pe=()=>[ft,He,Le],ie=()=>[ki,"full",...O()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ts],breakpoint:[ts],color:[d8],container:[ts],"drop-shadow":[ts],ease:["in","out","in-out"],font:[g8],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ts],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ts],shadow:[ts],spacing:["px",ft],text:[ts],"text-shadow":[ts],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ki,Le,He,S]}],container:["container"],columns:[{columns:[ft,Le,He,u]}],"break-after":[{"break-after":E()}],"break-before":[{"break-before":E()}],"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:D()}],overflow:[{overflow:T()}],"overflow-x":[{"overflow-x":T()}],"overflow-y":[{"overflow-y":T()}],overscroll:[{overscroll:k()}],"overscroll-x":[{"overscroll-x":k()}],"overscroll-y":[{"overscroll-y":k()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:L()}],"inset-x":[{"inset-x":L()}],"inset-y":[{"inset-y":L()}],start:[{start:L()}],end:[{end:L()}],top:[{top:L()}],right:[{right:L()}],bottom:[{bottom:L()}],left:[{left:L()}],visibility:["visible","invisible","collapse"],z:[{z:[Ys,"auto",He,Le]}],basis:[{basis:[ki,"full","auto",u,...O()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[ft,ki,"auto","initial","none",Le]}],grow:[{grow:["",ft,He,Le]}],shrink:[{shrink:["",ft,He,Le]}],order:[{order:[Ys,"first","last","none",He,Le]}],"grid-cols":[{"grid-cols":W()}],"col-start-end":[{col:B()}],"col-start":[{"col-start":Y()}],"col-end":[{"col-end":Y()}],"grid-rows":[{"grid-rows":W()}],"row-start-end":[{row:B()}],"row-start":[{"row-start":Y()}],"row-end":[{"row-end":Y()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":q()}],"auto-rows":[{"auto-rows":q()}],gap:[{gap:O()}],"gap-x":[{"gap-x":O()}],"gap-y":[{"gap-y":O()}],"justify-content":[{justify:[...z(),"normal"]}],"justify-items":[{"justify-items":[...V(),"normal"]}],"justify-self":[{"justify-self":["auto",...V()]}],"align-content":[{content:["normal",...z()]}],"align-items":[{items:[...V(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...V(),{baseline:["","last"]}]}],"place-content":[{"place-content":z()}],"place-items":[{"place-items":[...V(),"baseline"]}],"place-self":[{"place-self":["auto",...V()]}],p:[{p:O()}],px:[{px:O()}],py:[{py:O()}],ps:[{ps:O()}],pe:[{pe:O()}],pt:[{pt:O()}],pr:[{pr:O()}],pb:[{pb:O()}],pl:[{pl:O()}],m:[{m:A()}],mx:[{mx:A()}],my:[{my:A()}],ms:[{ms:A()}],me:[{me:A()}],mt:[{mt:A()}],mr:[{mr:A()}],mb:[{mb:A()}],ml:[{ml:A()}],"space-x":[{"space-x":O()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":O()}],"space-y-reverse":["space-y-reverse"],size:[{size:H()}],w:[{w:[u,"screen",...H()]}],"min-w":[{"min-w":[u,"screen","none",...H()]}],"max-w":[{"max-w":[u,"screen","none","prose",{screen:[l]},...H()]}],h:[{h:["screen","lh",...H()]}],"min-h":[{"min-h":["screen","lh","none",...H()]}],"max-h":[{"max-h":["screen","lh",...H()]}],"font-size":[{text:["base",n,hc,Ta]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,He,op]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",np,Le]}],"font-family":[{font:[v8,Le,e]}],"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,He,Le]}],"line-clamp":[{"line-clamp":[ft,"none",He,op]}],leading:[{leading:[i,...O()]}],"list-image":[{"list-image":["none",He,Le]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",He,Le]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:P()}],"text-color":[{text:P()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...J(),"wavy"]}],"text-decoration-thickness":[{decoration:[ft,"from-font","auto",He,Ta]}],"text-decoration-color":[{decoration:P()}],"underline-offset":[{"underline-offset":[ft,"auto",He,Le]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:O()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",He,Le]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",He,Le]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:F()}],"bg-repeat":[{bg:Q()}],"bg-size":[{bg:$()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ys,He,Le],radial:["",He,Le],conic:[Ys,He,Le]},b8,y8]}],"bg-color":[{bg:P()}],"gradient-from-pos":[{from:I()}],"gradient-via-pos":[{via:I()}],"gradient-to-pos":[{to:I()}],"gradient-from":[{from:P()}],"gradient-via":[{via:P()}],"gradient-to":[{to:P()}],rounded:[{rounded:U()}],"rounded-s":[{"rounded-s":U()}],"rounded-e":[{"rounded-e":U()}],"rounded-t":[{"rounded-t":U()}],"rounded-r":[{"rounded-r":U()}],"rounded-b":[{"rounded-b":U()}],"rounded-l":[{"rounded-l":U()}],"rounded-ss":[{"rounded-ss":U()}],"rounded-se":[{"rounded-se":U()}],"rounded-ee":[{"rounded-ee":U()}],"rounded-es":[{"rounded-es":U()}],"rounded-tl":[{"rounded-tl":U()}],"rounded-tr":[{"rounded-tr":U()}],"rounded-br":[{"rounded-br":U()}],"rounded-bl":[{"rounded-bl":U()}],"border-w":[{border:K()}],"border-w-x":[{"border-x":K()}],"border-w-y":[{"border-y":K()}],"border-w-s":[{"border-s":K()}],"border-w-e":[{"border-e":K()}],"border-w-t":[{"border-t":K()}],"border-w-r":[{"border-r":K()}],"border-w-b":[{"border-b":K()}],"border-w-l":[{"border-l":K()}],"divide-x":[{"divide-x":K()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":K()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...J(),"hidden","none"]}],"divide-style":[{divide:[...J(),"hidden","none"]}],"border-color":[{border:P()}],"border-color-x":[{"border-x":P()}],"border-color-y":[{"border-y":P()}],"border-color-s":[{"border-s":P()}],"border-color-e":[{"border-e":P()}],"border-color-t":[{"border-t":P()}],"border-color-r":[{"border-r":P()}],"border-color-b":[{"border-b":P()}],"border-color-l":[{"border-l":P()}],"divide-color":[{divide:P()}],"outline-style":[{outline:[...J(),"none","hidden"]}],"outline-offset":[{"outline-offset":[ft,He,Le]}],"outline-w":[{outline:["",ft,hc,Ta]}],"outline-color":[{outline:P()}],shadow:[{shadow:["","none",g,Ld,$d]}],"shadow-color":[{shadow:P()}],"inset-shadow":[{"inset-shadow":["none",m,Ld,$d]}],"inset-shadow-color":[{"inset-shadow":P()}],"ring-w":[{ring:K()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:P()}],"ring-offset-w":[{"ring-offset":[ft,Ta]}],"ring-offset-color":[{"ring-offset":P()}],"inset-ring-w":[{"inset-ring":K()}],"inset-ring-color":[{"inset-ring":P()}],"text-shadow":[{"text-shadow":["none",y,Ld,$d]}],"text-shadow-color":[{"text-shadow":P()}],opacity:[{opacity:[ft,He,Le]}],"mix-blend":[{"mix-blend":[...ne(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ne()}],"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":[ft]}],"mask-image-linear-from-pos":[{"mask-linear-from":X()}],"mask-image-linear-to-pos":[{"mask-linear-to":X()}],"mask-image-linear-from-color":[{"mask-linear-from":P()}],"mask-image-linear-to-color":[{"mask-linear-to":P()}],"mask-image-t-from-pos":[{"mask-t-from":X()}],"mask-image-t-to-pos":[{"mask-t-to":X()}],"mask-image-t-from-color":[{"mask-t-from":P()}],"mask-image-t-to-color":[{"mask-t-to":P()}],"mask-image-r-from-pos":[{"mask-r-from":X()}],"mask-image-r-to-pos":[{"mask-r-to":X()}],"mask-image-r-from-color":[{"mask-r-from":P()}],"mask-image-r-to-color":[{"mask-r-to":P()}],"mask-image-b-from-pos":[{"mask-b-from":X()}],"mask-image-b-to-pos":[{"mask-b-to":X()}],"mask-image-b-from-color":[{"mask-b-from":P()}],"mask-image-b-to-color":[{"mask-b-to":P()}],"mask-image-l-from-pos":[{"mask-l-from":X()}],"mask-image-l-to-pos":[{"mask-l-to":X()}],"mask-image-l-from-color":[{"mask-l-from":P()}],"mask-image-l-to-color":[{"mask-l-to":P()}],"mask-image-x-from-pos":[{"mask-x-from":X()}],"mask-image-x-to-pos":[{"mask-x-to":X()}],"mask-image-x-from-color":[{"mask-x-from":P()}],"mask-image-x-to-color":[{"mask-x-to":P()}],"mask-image-y-from-pos":[{"mask-y-from":X()}],"mask-image-y-to-pos":[{"mask-y-to":X()}],"mask-image-y-from-color":[{"mask-y-from":P()}],"mask-image-y-to-color":[{"mask-y-to":P()}],"mask-image-radial":[{"mask-radial":[He,Le]}],"mask-image-radial-from-pos":[{"mask-radial-from":X()}],"mask-image-radial-to-pos":[{"mask-radial-to":X()}],"mask-image-radial-from-color":[{"mask-radial-from":P()}],"mask-image-radial-to-color":[{"mask-radial-to":P()}],"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":R()}],"mask-image-conic-pos":[{"mask-conic":[ft]}],"mask-image-conic-from-pos":[{"mask-conic-from":X()}],"mask-image-conic-to-pos":[{"mask-conic-to":X()}],"mask-image-conic-from-color":[{"mask-conic-from":P()}],"mask-image-conic-to-color":[{"mask-conic-to":P()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:F()}],"mask-repeat":[{mask:Q()}],"mask-size":[{mask:$()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",He,Le]}],filter:[{filter:["","none",He,Le]}],blur:[{blur:ee()}],brightness:[{brightness:[ft,He,Le]}],contrast:[{contrast:[ft,He,Le]}],"drop-shadow":[{"drop-shadow":["","none",v,Ld,$d]}],"drop-shadow-color":[{"drop-shadow":P()}],grayscale:[{grayscale:["",ft,He,Le]}],"hue-rotate":[{"hue-rotate":[ft,He,Le]}],invert:[{invert:["",ft,He,Le]}],saturate:[{saturate:[ft,He,Le]}],sepia:[{sepia:["",ft,He,Le]}],"backdrop-filter":[{"backdrop-filter":["","none",He,Le]}],"backdrop-blur":[{"backdrop-blur":ee()}],"backdrop-brightness":[{"backdrop-brightness":[ft,He,Le]}],"backdrop-contrast":[{"backdrop-contrast":[ft,He,Le]}],"backdrop-grayscale":[{"backdrop-grayscale":["",ft,He,Le]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ft,He,Le]}],"backdrop-invert":[{"backdrop-invert":["",ft,He,Le]}],"backdrop-opacity":[{"backdrop-opacity":[ft,He,Le]}],"backdrop-saturate":[{"backdrop-saturate":[ft,He,Le]}],"backdrop-sepia":[{"backdrop-sepia":["",ft,He,Le]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":O()}],"border-spacing-x":[{"border-spacing-x":O()}],"border-spacing-y":[{"border-spacing-y":O()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",He,Le]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[ft,"initial",He,Le]}],ease:[{ease:["linear","initial",N,He,Le]}],delay:[{delay:[ft,He,Le]}],animate:[{animate:["none",M,He,Le]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[C,He,Le]}],"perspective-origin":[{"perspective-origin":D()}],rotate:[{rotate:se()}],"rotate-x":[{"rotate-x":se()}],"rotate-y":[{"rotate-y":se()}],"rotate-z":[{"rotate-z":se()}],scale:[{scale:le()}],"scale-x":[{"scale-x":le()}],"scale-y":[{"scale-y":le()}],"scale-z":[{"scale-z":le()}],"scale-3d":["scale-3d"],skew:[{skew:pe()}],"skew-x":[{"skew-x":pe()}],"skew-y":[{"skew-y":pe()}],transform:[{transform:[He,Le,"","none","gpu","cpu"]}],"transform-origin":[{origin:D()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ie()}],"translate-x":[{"translate-x":ie()}],"translate-y":[{"translate-y":ie()}],"translate-z":[{"translate-z":ie()}],"translate-none":["translate-none"],accent:[{accent:P()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:P()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",He,Le]}],"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":O()}],"scroll-mx":[{"scroll-mx":O()}],"scroll-my":[{"scroll-my":O()}],"scroll-ms":[{"scroll-ms":O()}],"scroll-me":[{"scroll-me":O()}],"scroll-mt":[{"scroll-mt":O()}],"scroll-mr":[{"scroll-mr":O()}],"scroll-mb":[{"scroll-mb":O()}],"scroll-ml":[{"scroll-ml":O()}],"scroll-p":[{"scroll-p":O()}],"scroll-px":[{"scroll-px":O()}],"scroll-py":[{"scroll-py":O()}],"scroll-ps":[{"scroll-ps":O()}],"scroll-pe":[{"scroll-pe":O()}],"scroll-pt":[{"scroll-pt":O()}],"scroll-pr":[{"scroll-pr":O()}],"scroll-pb":[{"scroll-pb":O()}],"scroll-pl":[{"scroll-pl":O()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",He,Le]}],fill:[{fill:["none",...P()]}],"stroke-w":[{stroke:[ft,hc,Ta,op]}],stroke:[{stroke:["none",...P()]}],"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"]}},E8=o8(C8);function Ne(...t){return E8(gC(t))}const Jp=zf("focus-visible:border-ring cursor-pointer focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 rounded-md border border-transparent bg-clip-padding text-sm font-medium focus-visible:ring-[3px] aria-invalid:ring-[3px] [&_svg:not([class*='size-'])]:size-4 inline-flex items-center justify-center whitespace-nowrap transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none shrink-0 [&_svg]:shrink-0 outline-none group/button select-none",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/80",outline:"border-border bg-background hover:bg-muted hover:text-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50 aria-expanded:bg-muted aria-expanded:text-foreground shadow-xs",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground dark:hover:bg-muted/50 aria-expanded:bg-muted aria-expanded:text-foreground",destructive:"bg-destructive/10 hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/20 text-destructive focus-visible:border-destructive/40 dark:hover:bg-destructive/30",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 gap-1.5 px-2.5 in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",xs:"h-6 gap-1 rounded-[min(var(--radius-md),8px)] px-2 text-xs in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-8 gap-1 rounded-[min(var(--radius-md),10px)] px-2.5 in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5",lg:"h-10 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3",icon:"size-9","icon-xs":"size-6 rounded-[min(var(--radius-md),8px)] in-data-[slot=button-group]:rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-8 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-md","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function St(t){const e=ge.c(16);let n,o,s,i,l;e[0]!==t?({className:n,variant:s,size:i,asChild:l,...o}=t,e[0]=t,e[1]=n,e[2]=o,e[3]=s,e[4]=i,e[5]=l):(n=e[1],o=e[2],s=e[3],i=e[4],l=e[5]);const u=s===void 0?"default":s,d=i===void 0?"default":i,g=(l===void 0?!1:l)?If:"button";let m;e[6]!==n||e[7]!==d||e[8]!==u?(m=Ne(Jp({variant:u,size:d,className:n})),e[6]=n,e[7]=d,e[8]=u,e[9]=m):m=e[9];let y;return e[10]!==g||e[11]!==o||e[12]!==d||e[13]!==m||e[14]!==u?(y=p.jsx(g,{"data-slot":"button","data-variant":u,"data-size":d,className:m,...o}),e[10]=g,e[11]=o,e[12]=d,e[13]=m,e[14]=u,e[15]=y):y=e[15],y}function ar(t){const e=ge.c(10);let n,o,s;e[0]!==t?({className:n,type:s,...o}=t,e[0]=t,e[1]=n,e[2]=o,e[3]=s):(n=e[1],o=e[2],s=e[3]);let i;e[4]!==n?(i=Ne("dark:bg-input/30 border-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 h-9 rounded-md border bg-transparent px-2.5 py-1 text-base shadow-xs transition-[color,box-shadow] file:h-7 file:text-sm file:font-medium focus-visible:ring-[3px] aria-invalid:ring-[3px] md:text-sm file:text-foreground placeholder:text-muted-foreground w-full min-w-0 outline-none file:inline-flex file:border-0 file:bg-transparent disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50",n),e[4]=n,e[5]=i):i=e[5];let l;return e[6]!==o||e[7]!==i||e[8]!==s?(l=p.jsx("input",{type:s,"data-slot":"input",className:i,...o}),e[6]=o,e[7]=i,e[8]=s,e[9]=l):l=e[9],l}const yN=(...t)=>t.filter((e,n,o)=>!!e&&e.trim()!==""&&o.indexOf(e)===n).join(" ").trim();const _8=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const N8=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,n,o)=>o?o.toUpperCase():n.toLowerCase());const Gw=t=>{const e=N8(t);return e.charAt(0).toUpperCase()+e.slice(1)};var M8={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 R8=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0;return!1};const D8=x.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:n=2,absoluteStrokeWidth:o,className:s="",children:i,iconNode:l,...u},d)=>x.createElement("svg",{ref:d,...M8,width:e,height:e,stroke:t,strokeWidth:o?Number(n)*24/Number(e):n,className:yN("lucide",s),...!i&&!R8(u)&&{"aria-hidden":"true"},...u},[...l.map(([f,g])=>x.createElement(f,g)),...Array.isArray(i)?i:[i]]));const Ke=(t,e)=>{const n=x.forwardRef(({className:o,...s},i)=>x.createElement(D8,{ref:i,iconNode:e,className:yN(`lucide-${_8(Gw(t))}`,`lucide-${t}`,o),...s}));return n.displayName=Gw(t),n};const T8=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],k8=Ke("arrow-right",T8);const j8=[["path",{d:"M4 20h16",key:"14thso"}],["path",{d:"m6 16 6-12 6 12",key:"1b4byz"}],["path",{d:"M8 12h8",key:"1wcyev"}]],A8=Ke("baseline",j8);const O8=[["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"}]],z8=Ke("calendar",O8);const I8=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],da=Ke("check",I8);const P8=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],ms=Ke("chevron-down",P8);const $8=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],dy=Ke("chevron-left",$8);const L8=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],vN=Ke("chevron-right",L8);const H8=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],sh=Ke("chevron-up",H8);const B8=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],F8=Ke("code",B8);const V8=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],fy=Ke("copy",V8);const U8=[["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"}]],ah=Ke("database",U8);const Y8=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],G8=Ke("download",Y8);const q8=[["path",{d:"M21 21H8a2 2 0 0 1-1.42-.587l-3.994-3.999a2 2 0 0 1 0-2.828l10-10a2 2 0 0 1 2.829 0l5.999 6a2 2 0 0 1 0 2.828L12.834 21",key:"g5wo59"}],["path",{d:"m5.082 11.09 8.828 8.828",key:"1wx5vj"}]],W8=Ke("eraser",q8);const K8=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],xN=Ke("eye-off",K8);const X8=[["path",{d:"M13.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v11.5",key:"4pqfef"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M8 12v-1",key:"1ej8lb"}],["path",{d:"M8 18v-2",key:"qcmpov"}],["path",{d:"M8 7V6",key:"1nbb54"}],["circle",{cx:"8",cy:"20",r:"2",key:"ckkr5m"}]],Q8=Ke("file-archive",X8);const Z8=[["path",{d:"M4 12.15V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-3.35",key:"1wthlu"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m5 16-3 3 3 3",key:"331omg"}],["path",{d:"m9 22 3-3-3-3",key:"lsp7cz"}]],e0=Ke("file-code-corner",Z8);const J8=[["path",{d:"M4 6.835V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-.343",key:"1vfytu"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M2 19a2 2 0 0 1 4 0v1a2 2 0 0 1-4 0v-4a6 6 0 0 1 12 0v4a2 2 0 0 1-4 0v-1a2 2 0 0 1 4 0",key:"1etmh7"}]],eI=Ke("file-headphone",J8);const tI=[["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"}],["circle",{cx:"10",cy:"12",r:"2",key:"737tya"}],["path",{d:"m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22",key:"wt3hpn"}]],nI=Ke("file-image",tI);const oI=[["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:"M15.033 13.44a.647.647 0 0 1 0 1.12l-4.065 2.352a.645.645 0 0 1-.968-.56v-4.704a.645.645 0 0 1 .967-.56z",key:"1tzo1f"}]],rI=Ke("file-play",oI);const sI=[["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:"M8 13h2",key:"yr2amv"}],["path",{d:"M14 13h2",key:"un5t4a"}],["path",{d:"M8 17h2",key:"2yhykz"}],["path",{d:"M14 17h2",key:"10kma7"}]],aI=Ke("file-spreadsheet",sI);const iI=[["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"}]],qw=Ke("file-text",iI);const lI=[["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"}]],bN=Ke("file",lI);const cI=[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]],uI=Ke("git-branch",cI);const dI=[["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"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]],fI=Ke("grid-3x3",dI);const hI=[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]],mI=Ke("hash",hI);const gI=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],wN=Ke("key",gI);const pI=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]],yI=Ke("link",pI);const vI=[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}]],xI=Ke("list-checks",vI);const bI=[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]],wI=Ke("list",bI);const SI=[["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m16.2 7.8 2.9-2.9",key:"r700ao"}],["path",{d:"M18 12h4",key:"wj9ykh"}],["path",{d:"m16.2 16.2 2.9 2.9",key:"1bxg5t"}],["path",{d:"M12 18v4",key:"jadmvz"}],["path",{d:"m4.9 19.1 2.9-2.9",key:"bwix9q"}],["path",{d:"M2 12h4",key:"j09sii"}],["path",{d:"m4.9 4.9 2.9 2.9",key:"giyufr"}]],hy=Ke("loader",SI);const CI=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 9.9-1",key:"1mm8w8"}]],EI=Ke("lock-open",CI);const _I=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],NI=Ke("lock",_I);const MI=[["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"}]],SN=Ke("pencil",MI);const RI=[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89",key:"znwnzq"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11",key:"c9qhm2"}]],Ww=Ke("pin-off",RI);const DI=[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z",key:"1nkz8b"}]],Kw=Ke("pin",DI);const TI=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],kI=Ke("play",TI);const jI=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],ra=Ke("plus",jI);const AI=[["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"}]],OI=Ke("presentation",AI);const zI=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],II=Ke("refresh-cw",zI);const PI=[["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M8.12 8.12 12 12",key:"1alkpv"}],["path",{d:"M20 4 8.12 15.88",key:"xgtan2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M14.8 14.8 20 20",key:"ptml3r"}]],$I=Ke("scissors",PI);const LI=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],iu=Ke("search",LI);const HI=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],BI=Ke("shield-check",HI);const FI=[["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M5 5a1 1 0 0 0-1 1v7c0 5 3.5 7.5 7.67 8.94a1 1 0 0 0 .67.01c2.35-.82 4.48-1.97 5.9-3.71",key:"1jlk70"}],["path",{d:"M9.309 3.652A12.252 12.252 0 0 0 11.24 2.28a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1v7a9.784 9.784 0 0 1-.08 1.264",key:"18rp1v"}]],VI=Ke("shield-off",FI);const UI=[["path",{d:"M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344",key:"2acyp4"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],YI=Ke("square-check-big",UI);const GI=[["path",{d:"M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18",key:"gugj83"}]],ih=Ke("table-2",GI);const qI=[["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"}]],WI=Ke("table",qI);const KI=[["path",{d:"M15 5h6",key:"1pr8yx"}],["path",{d:"M15 12h6",key:"upa0zy"}],["path",{d:"M3 19h18",key:"awlh7x"}],["path",{d:"m3 12 3.553-7.724a.5.5 0 0 1 .894 0L11 12",key:"6lvno8"}],["path",{d:"M3.92 10h6.16",key:"1tl8ex"}]],XI=Ke("text-initial",KI);const QI=[["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"}]],my=Ke("trash-2",QI);const ZI=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],JI=Ke("trending-up",ZI);const e7=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],Xw=Ke("upload",e7);const t7=[["path",{d:"M2 6c.6.5 1.2 1 2.5 1C7 7 7 5 9.5 5c2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1",key:"knzxuh"}],["path",{d:"M2 12c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1",key:"2jd2cc"}],["path",{d:"M2 18c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1",key:"rd2r6e"}]],n7=Ke("waves",t7);const o7=[["path",{d:"m10.586 5.414-5.172 5.172",key:"4mc350"}],["path",{d:"m18.586 13.414-5.172 5.172",key:"8c96vv"}],["path",{d:"M6 12h12",key:"8npq4p"}],["circle",{cx:"12",cy:"20",r:"2",key:"144qzu"}],["circle",{cx:"12",cy:"4",r:"2",key:"muu5ef"}],["circle",{cx:"20",cy:"12",r:"2",key:"1xzzfp"}],["circle",{cx:"4",cy:"12",r:"2",key:"1hvhnz"}]],r7=Ke("waypoints",o7);const s7=[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]],a7=Ke("workflow",s7);const i7=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],vs=Ke("x",i7);function gy(t){const e=ge.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let o;return e[2]!==n?(o=p.jsx(L0,{"data-slot":"sheet",...n}),e[2]=n,e[3]=o):o=e[3],o}function l7(t){const e=ge.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let o;return e[2]!==n?(o=p.jsx(H0,{"data-slot":"sheet-portal",...n}),e[2]=n,e[3]=o):o=e[3],o}function c7(t){const e=ge.c(8);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let s;e[3]!==n?(s=Ne("data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 bg-black/10 duration-100 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 z-[100]",n),e[3]=n,e[4]=s):s=e[4];let i;return e[5]!==o||e[6]!==s?(i=p.jsx(B0,{"data-slot":"sheet-overlay",className:s,...o}),e[5]=o,e[6]=s,e[7]=i):i=e[7],i}function py(t){const e=ge.c(17);let n,o,s,i,l;e[0]!==t?({className:o,children:n,side:i,showCloseButton:l,...s}=t,e[0]=t,e[1]=n,e[2]=o,e[3]=s,e[4]=i,e[5]=l):(n=e[1],o=e[2],s=e[3],i=e[4],l=e[5]);const u=i===void 0?"right":i,d=l===void 0?!0:l;let f;e[6]===Symbol.for("react.memo_cache_sentinel")?(f=p.jsx(c7,{}),e[6]=f):f=e[6];let g;e[7]!==o?(g=Ne("bg-background data-open:animate-in data-closed:animate-out data-[side=right]:data-closed:slide-out-to-right-10 data-[side=right]:data-open:slide-in-from-right-10 data-[side=left]:data-closed:slide-out-to-left-10 data-[side=left]:data-open:slide-in-from-left-10 data-[side=top]:data-closed:slide-out-to-top-10 data-[side=top]:data-open:slide-in-from-top-10 data-closed:fade-out-0 data-open:fade-in-0 data-[side=bottom]:data-closed:slide-out-to-bottom-10 data-[side=bottom]:data-open:slide-in-from-bottom-10 fixed z-[100] flex flex-col gap-4 bg-clip-padding text-sm shadow-lg transition duration-200 ease-in-out data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm",o),e[7]=o,e[8]=g):g=e[8];let m;e[9]!==d?(m=d&&p.jsx(V0,{"data-slot":"sheet-close",asChild:!0,children:p.jsxs(St,{variant:"ghost",className:"absolute top-4 right-4",size:"icon-sm",children:[p.jsx(vs,{}),p.jsx("span",{className:"sr-only",children:"Close"})]})}),e[9]=d,e[10]=m):m=e[10];let y;return e[11]!==n||e[12]!==s||e[13]!==u||e[14]!==g||e[15]!==m?(y=p.jsxs(l7,{children:[f,p.jsxs(F0,{"data-slot":"sheet-content","data-side":u,className:g,...s,children:[n,m]})]}),e[11]=n,e[12]=s,e[13]=u,e[14]=g,e[15]=m,e[16]=y):y=e[16],y}function yy(t){const e=ge.c(8);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let s;e[3]!==n?(s=Ne("gap-1.5 p-4 flex flex-col",n),e[3]=n,e[4]=s):s=e[4];let i;return e[5]!==o||e[6]!==s?(i=p.jsx("div",{"data-slot":"sheet-header",className:s,...o}),e[5]=o,e[6]=s,e[7]=i):i=e[7],i}function u7(t){const e=ge.c(8);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let s;e[3]!==n?(s=Ne("gap-2 p-4 mt-auto flex flex-col",n),e[3]=n,e[4]=s):s=e[4];let i;return e[5]!==o||e[6]!==s?(i=p.jsx("div",{"data-slot":"sheet-footer",className:s,...o}),e[5]=o,e[6]=s,e[7]=i):i=e[7],i}function vy(t){const e=ge.c(8);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let s;e[3]!==n?(s=Ne("text-foreground font-medium",n),e[3]=n,e[4]=s):s=e[4];let i;return e[5]!==o||e[6]!==s?(i=p.jsx(qC,{"data-slot":"sheet-title",className:s,...o}),e[5]=o,e[6]=s,e[7]=i):i=e[7],i}function d7(t){const e=ge.c(8);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let s;e[3]!==n?(s=Ne("text-muted-foreground text-sm",n),e[3]=n,e[4]=s):s=e[4];let i;return e[5]!==o||e[6]!==s?(i=p.jsx(WC,{"data-slot":"sheet-description",className:s,...o}),e[5]=o,e[6]=s,e[7]=i):i=e[7],i}function f7(t){const e=ge.c(8);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let s;e[3]!==n?(s=Ne("bg-muted rounded-md animate-pulse",n),e[3]=n,e[4]=s):s=e[4];let i;return e[5]!==o||e[6]!==s?(i=p.jsx("div",{"data-slot":"skeleton",className:s,...o}),e[5]=o,e[6]=s,e[7]=i):i=e[7],i}function h7(t){const e=ge.c(6);let n,o;e[0]!==t?({delayDuration:o,...n}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);const s=o===void 0?0:o;let i;return e[3]!==s||e[4]!==n?(i=p.jsx(kz,{"data-slot":"tooltip-provider",delayDuration:s,...n}),e[3]=s,e[4]=n,e[5]=i):i=e[5],i}function xy(t){const e=ge.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let o;return e[2]!==n?(o=p.jsx(h7,{children:p.jsx(jz,{"data-slot":"tooltip",...n})}),e[2]=n,e[3]=o):o=e[3],o}function by(t){const e=ge.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let o;return e[2]!==n?(o=p.jsx(Az,{"data-slot":"tooltip-trigger",...n}),e[2]=n,e[3]=o):o=e[3],o}function wy(t){const e=ge.c(13);let n,o,s,i;e[0]!==t?({className:o,sideOffset:i,children:n,...s}=t,e[0]=t,e[1]=n,e[2]=o,e[3]=s,e[4]=i):(n=e[1],o=e[2],s=e[3],i=e[4]);const l=i===void 0?0:i;let u;e[5]!==o?(u=Ne("data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-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 rounded-md px-3 py-1.5 text-xs bg-popover text-popover-foreground border border-border ring-1 ring-foreground/10 z-50 w-fit max-w-xs origin-(--radix-tooltip-content-transform-origin)",o),e[5]=o,e[6]=u):u=e[6];let d;e[7]===Symbol.for("react.memo_cache_sentinel")?(d=p.jsx(Iz,{className:"size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-popover fill-popover border-border z-50 translate-y-[calc(-50%_-_2px)]"}),e[7]=d):d=e[7];let f;return e[8]!==n||e[9]!==s||e[10]!==l||e[11]!==u?(f=p.jsx(Oz,{children:p.jsxs(zz,{"data-slot":"tooltip-content",sideOffset:l,className:u,...s,children:[n,d]})}),e[8]=n,e[9]=s,e[10]=l,e[11]=u,e[12]=f):f=e[12],f}const rp=768;function m7(){const t=ge.c(2),[e,n]=x.useState(void 0);let o,s;return t[0]===Symbol.for("react.memo_cache_sentinel")?(o=()=>{const i=window.matchMedia(`(max-width: ${rp-1}px)`),l=()=>{n(window.innerWidth<rp)};return i.addEventListener("change",l),n(window.innerWidth<rp),()=>i.removeEventListener("change",l)},s=[],t[0]=o,t[1]=s):(o=t[0],s=t[1]),x.useEffect(o,s),!!e}const g7="sidebar_state",p7=3600*24*7,y7="16rem",v7="18rem",x7="3rem",b7="b",CN=x.createContext(null);function EN(){const t=x.useContext(CN);if(!t)throw new Error("useSidebar must be used within a SidebarProvider.");return t}function w7(t){const e=ge.c(36);let n,o,s,i,l,u,d;e[0]!==t?({defaultOpen:d,open:s,onOpenChange:l,className:o,style:u,children:n,...i}=t,e[0]=t,e[1]=n,e[2]=o,e[3]=s,e[4]=i,e[5]=l,e[6]=u,e[7]=d):(n=e[1],o=e[2],s=e[3],i=e[4],l=e[5],u=e[6],d=e[7]);const f=d===void 0?!0:d,g=m7(),[m,y]=x.useState(!1),[v,w]=x.useState(f),C=s??v;let S;e[8]!==C||e[9]!==l?(S=z=>{const V=typeof z=="function"?z(C):z;l?l(V):w(V),document.cookie=`${g7}=${V}; path=/; max-age=${p7}`},e[8]=C,e[9]=l,e[10]=S):S=e[10];const N=S;let M;e[11]!==g||e[12]!==N?(M=()=>g?y(C7):N(S7),e[11]=g,e[12]=N,e[13]=M):M=e[13];const E=M;let R,D;e[14]!==E?(R=()=>{const z=V=>{V.key===b7&&(V.metaKey||V.ctrlKey)&&(V.preventDefault(),E())};return window.addEventListener("keydown",z),()=>window.removeEventListener("keydown",z)},D=[E],e[14]=E,e[15]=R,e[16]=D):(R=e[15],D=e[16]),x.useEffect(R,D);const T=C?"expanded":"collapsed";let k;e[17]!==g||e[18]!==C||e[19]!==m||e[20]!==N||e[21]!==T||e[22]!==E?(k={state:T,open:C,setOpen:N,isMobile:g,openMobile:m,setOpenMobile:y,toggleSidebar:E},e[17]=g,e[18]=C,e[19]=m,e[20]=N,e[21]=T,e[22]=E,e[23]=k):k=e[23];const O=k;let L;e[24]!==u?(L={"--sidebar-width":y7,"--sidebar-width-icon":x7,...u},e[24]=u,e[25]=L):L=e[25];const W=L;let B;e[26]!==o?(B=Ne("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",o),e[26]=o,e[27]=B):B=e[27];let Y;e[28]!==n||e[29]!==i||e[30]!==W||e[31]!==B?(Y=p.jsx("div",{"data-slot":"sidebar-wrapper",style:W,className:B,...i,children:n}),e[28]=n,e[29]=i,e[30]=W,e[31]=B,e[32]=Y):Y=e[32];let q;return e[33]!==O||e[34]!==Y?(q=p.jsx(CN.Provider,{value:O,children:Y}),e[33]=O,e[34]=Y,e[35]=q):q=e[35],q}function S7(t){return!t}function C7(t){return!t}function E7(t){const e=ge.c(54);let n,o,s,i,l,u;e[0]!==t?({side:i,variant:l,collapsible:u,className:o,children:n,...s}=t,e[0]=t,e[1]=n,e[2]=o,e[3]=s,e[4]=i,e[5]=l,e[6]=u):(n=e[1],o=e[2],s=e[3],i=e[4],l=e[5],u=e[6]);const d=i===void 0?"left":i,f=l===void 0?"sidebar":l,g=u===void 0?"offcanvas":u,{isMobile:m,state:y,setOpen:v,openMobile:w,setOpenMobile:C}=EN(),S=x.useRef(!1);let N;e[7]!==g||e[8]!==v||e[9]!==y?(N=()=>{g==="icon"&&y==="collapsed"&&(S.current=!0,v(!0))},e[7]=g,e[8]=v,e[9]=y,e[10]=N):N=e[10];const M=N;let E;e[11]!==v?(E=()=>{S.current&&(S.current=!1,v(!1))},e[11]=v,e[12]=E):E=e[12];const R=E;if(g==="none"){let H;e[13]!==o?(H=Ne("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",o),e[13]=o,e[14]=H):H=e[14];let P;return e[15]!==n||e[16]!==s||e[17]!==H?(P=p.jsx("div",{"data-slot":"sidebar",className:H,...s,children:n}),e[15]=n,e[16]=s,e[17]=H,e[18]=P):P=e[18],P}if(m){let H;e[19]===Symbol.for("react.memo_cache_sentinel")?(H={"--sidebar-width":v7},e[19]=H):H=e[19];let P;e[20]===Symbol.for("react.memo_cache_sentinel")?(P=p.jsxs(yy,{className:"sr-only",children:[p.jsx(vy,{children:"Sidebar"}),p.jsx(d7,{children:"Displays the mobile sidebar."})]}),e[20]=P):P=e[20];let F;e[21]!==n?(F=p.jsx("div",{className:"flex h-full w-full flex-col",children:n}),e[21]=n,e[22]=F):F=e[22];let Q;e[23]!==d||e[24]!==F?(Q=p.jsxs(py,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:H,side:d,children:[P,F]}),e[23]=d,e[24]=F,e[25]=Q):Q=e[25];let $;return e[26]!==w||e[27]!==s||e[28]!==C||e[29]!==Q?($=p.jsx(gy,{open:w,onOpenChange:C,...s,children:Q}),e[26]=w,e[27]=s,e[28]=C,e[29]=Q,e[30]=$):$=e[30],$}const D=y==="collapsed"?g:"",T=f==="floating"||f==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)";let k;e[31]!==T?(k=Ne("transition-[width] duration-200 ease-linear relative w-(--sidebar-width) bg-transparent","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",T),e[31]=T,e[32]=k):k=e[32];let O;e[33]!==k?(O=p.jsx("div",{"data-slot":"sidebar-gap",className:k}),e[33]=k,e[34]=O):O=e[34];const L=d==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",W=f==="floating"||f==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l";let B;e[35]!==o||e[36]!==L||e[37]!==W?(B=Ne("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",L,W,o),e[35]=o,e[36]=L,e[37]=W,e[38]=B):B=e[38];const Y=g==="icon"?M:void 0,q=g==="icon"?R:void 0;let z;e[39]!==n?(z=p.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar group-data-[variant=floating]:ring-sidebar-border group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1 flex size-full flex-col",children:n}),e[39]=n,e[40]=z):z=e[40];let V;e[41]!==s||e[42]!==B||e[43]!==Y||e[44]!==q||e[45]!==z?(V=p.jsx("div",{"data-slot":"sidebar-container",className:B,onMouseEnter:Y,onMouseLeave:q,...s,children:z}),e[41]=s,e[42]=B,e[43]=Y,e[44]=q,e[45]=z,e[46]=V):V=e[46];let A;return e[47]!==d||e[48]!==y||e[49]!==V||e[50]!==D||e[51]!==O||e[52]!==f?(A=p.jsxs("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":y,"data-collapsible":D,"data-variant":f,"data-side":d,"data-slot":"sidebar",children:[O,V]}),e[47]=d,e[48]=y,e[49]=V,e[50]=D,e[51]=O,e[52]=f,e[53]=A):A=e[53],A}function _7(t){const e=ge.c(8);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let s;e[3]!==n?(s=Ne("gap-2 p-2 flex flex-col",n),e[3]=n,e[4]=s):s=e[4];let i;return e[5]!==o||e[6]!==s?(i=p.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:s,...o}),e[5]=o,e[6]=s,e[7]=i):i=e[7],i}function N7(t){const e=ge.c(8);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let s;e[3]!==n?(s=Ne("no-scrollbar gap-2 flex min-h-0 flex-1 flex-col overflow-auto group-data-[collapsible=icon]:overflow-hidden",n),e[3]=n,e[4]=s):s=e[4];let i;return e[5]!==o||e[6]!==s?(i=p.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:s,...o}),e[5]=o,e[6]=s,e[7]=i):i=e[7],i}function M7(t){const e=ge.c(8);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let s;e[3]!==n?(s=Ne("p-2 relative flex w-full min-w-0 flex-col",n),e[3]=n,e[4]=s):s=e[4];let i;return e[5]!==o||e[6]!==s?(i=p.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:s,...o}),e[5]=o,e[6]=s,e[7]=i):i=e[7],i}function R7(t){const e=ge.c(10);let n,o,s;e[0]!==t?({className:n,asChild:s,...o}=t,e[0]=t,e[1]=n,e[2]=o,e[3]=s):(n=e[1],o=e[2],s=e[3]);const l=(s===void 0?!1:s)?If:"div";let u;e[4]!==n?(u=Ne("text-sidebar-foreground/70 ring-sidebar-ring h-8 rounded-md px-2 text-xs font-medium transition-[margin,opacity] duration-200 ease-linear group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0 focus-visible:ring-2 [&>svg]:size-4 flex shrink-0 items-center outline-hidden [&>svg]:shrink-0",n),e[4]=n,e[5]=u):u=e[5];let d;return e[6]!==l||e[7]!==o||e[8]!==u?(d=p.jsx(l,{"data-slot":"sidebar-group-label","data-sidebar":"group-label",className:u,...o}),e[6]=l,e[7]=o,e[8]=u,e[9]=d):d=e[9],d}function D7(t){const e=ge.c(8);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let s;e[3]!==n?(s=Ne("text-sm w-full",n),e[3]=n,e[4]=s):s=e[4];let i;return e[5]!==o||e[6]!==s?(i=p.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:s,...o}),e[5]=o,e[6]=s,e[7]=i):i=e[7],i}function Qw(t){const e=ge.c(8);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let s;e[3]!==n?(s=Ne("gap-1 flex w-full min-w-0 flex-col",n),e[3]=n,e[4]=s):s=e[4];let i;return e[5]!==o||e[6]!==s?(i=p.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:s,...o}),e[5]=o,e[6]=s,e[7]=i):i=e[7],i}function Zw(t){const e=ge.c(8);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let s;e[3]!==n?(s=Ne("group/menu-item relative",n),e[3]=n,e[4]=s):s=e[4];let i;return e[5]!==o||e[6]!==s?(i=p.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:s,...o}),e[5]=o,e[6]=s,e[7]=i):i=e[7],i}const T7=zf("ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:text-sidebar-accent-foreground data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground gap-2 rounded-md p-2 text-left text-sm transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! focus-visible:ring-2 data-active:font-medium peer/menu-button flex w-full items-center overflow-hidden outline-hidden disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background hover:bg-sidebar-accent hover:text-sidebar-accent-foreground shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function sp(t){const e=ge.c(28);let n,o,s,i,l,u,d;e[0]!==t?({asChild:s,isActive:i,variant:l,size:u,tooltip:d,className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o,e[3]=s,e[4]=i,e[5]=l,e[6]=u,e[7]=d):(n=e[1],o=e[2],s=e[3],i=e[4],l=e[5],u=e[6],d=e[7]);const f=s===void 0?!1:s,g=i===void 0?!1:i,m=l===void 0?"default":l,y=u===void 0?"default":u,v=f?If:"button",{isMobile:w,state:C}=EN();let S;e[8]!==n||e[9]!==y||e[10]!==m?(S=Ne(T7({variant:m,size:y}),n),e[8]=n,e[9]=y,e[10]=m,e[11]=S):S=e[11];let N;e[12]!==v||e[13]!==g||e[14]!==o||e[15]!==y||e[16]!==S?(N=p.jsx(v,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":y,"data-active":g,className:S,...o}),e[12]=v,e[13]=g,e[14]=o,e[15]=y,e[16]=S,e[17]=N):N=e[17];const M=N;if(!d)return M;if(typeof d=="string"){let k;e[18]!==d?(k={children:d},e[18]=d,e[19]=k):k=e[19],d=k}let E;e[20]!==M?(E=p.jsx(by,{asChild:!0,children:M}),e[20]=M,e[21]=E):E=e[21];const R=C!=="collapsed"||w;let D;e[22]!==R||e[23]!==d?(D=p.jsx(wy,{side:"right",align:"center",hidden:R,...d}),e[22]=R,e[23]=d,e[24]=D):D=e[24];let T;return e[25]!==E||e[26]!==D?(T=p.jsxs(xy,{children:[E,D]}),e[25]=E,e[26]=D,e[27]=T):T=e[27],T}function Sy(t){const e=ge.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let o;return e[2]!==n?(o=p.jsx(L0,{"data-slot":"dialog",...n}),e[2]=n,e[3]=o):o=e[3],o}function k7(t){const e=ge.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let o;return e[2]!==n?(o=p.jsx(vj,{"data-slot":"dialog-trigger",...n}),e[2]=n,e[3]=o):o=e[3],o}function j7(t){const e=ge.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let o;return e[2]!==n?(o=p.jsx(H0,{"data-slot":"dialog-portal",...n}),e[2]=n,e[3]=o):o=e[3],o}function A7(t){const e=ge.c(8);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let s;e[3]!==n?(s=Ne("data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 isolate z-50",n),e[3]=n,e[4]=s):s=e[4];let i;return e[5]!==o||e[6]!==s?(i=p.jsx(B0,{"data-slot":"dialog-overlay",className:s,...o}),e[5]=o,e[6]=s,e[7]=i):i=e[7],i}function Cy(t){const e=ge.c(15);let n,o,s,i;e[0]!==t?({className:o,children:n,showCloseButton:i,...s}=t,e[0]=t,e[1]=n,e[2]=o,e[3]=s,e[4]=i):(n=e[1],o=e[2],s=e[3],i=e[4]);const l=i===void 0?!0:i;let u;e[5]===Symbol.for("react.memo_cache_sentinel")?(u=p.jsx(A7,{}),e[5]=u):u=e[5];let d;e[6]!==o?(d=Ne("bg-background data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 ring-foreground/10 grid max-w-[calc(100%-2rem)] gap-6 rounded-xl p-6 text-sm ring-1 duration-100 sm:max-w-md fixed top-1/2 left-1/2 z-50 w-full -translate-x-1/2 -translate-y-1/2",o),e[6]=o,e[7]=d):d=e[7];let f;e[8]!==l?(f=l&&p.jsx(V0,{"data-slot":"dialog-close",asChild:!0,children:p.jsxs(St,{variant:"ghost",className:"absolute top-4 right-4",size:"icon-sm",children:[p.jsx(vs,{}),p.jsx("span",{className:"sr-only",children:"Close"})]})}),e[8]=l,e[9]=f):f=e[9];let g;return e[10]!==n||e[11]!==s||e[12]!==d||e[13]!==f?(g=p.jsxs(j7,{children:[u,p.jsxs(F0,{"data-slot":"dialog-content",className:d,...s,children:[n,f]})]}),e[10]=n,e[11]=s,e[12]=d,e[13]=f,e[14]=g):g=e[14],g}function Ey(t){const e=ge.c(8);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let s;e[3]!==n?(s=Ne("gap-2 flex flex-col",n),e[3]=n,e[4]=s):s=e[4];let i;return e[5]!==o||e[6]!==s?(i=p.jsx("div",{"data-slot":"dialog-header",className:s,...o}),e[5]=o,e[6]=s,e[7]=i):i=e[7],i}function _N(t){const e=ge.c(14);let n,o,s,i;e[0]!==t?({className:o,showCloseButton:i,children:n,...s}=t,e[0]=t,e[1]=n,e[2]=o,e[3]=s,e[4]=i):(n=e[1],o=e[2],s=e[3],i=e[4]);const l=i===void 0?!1:i;let u;e[5]!==o?(u=Ne("gap-2 flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",o),e[5]=o,e[6]=u):u=e[6];let d;e[7]!==l?(d=l&&p.jsx(V0,{asChild:!0,children:p.jsx(St,{variant:"outline",children:"Close"})}),e[7]=l,e[8]=d):d=e[8];let f;return e[9]!==n||e[10]!==s||e[11]!==u||e[12]!==d?(f=p.jsxs("div",{"data-slot":"dialog-footer",className:u,...s,children:[n,d]}),e[9]=n,e[10]=s,e[11]=u,e[12]=d,e[13]=f):f=e[13],f}function _y(t){const e=ge.c(8);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let s;e[3]!==n?(s=Ne("leading-none font-medium",n),e[3]=n,e[4]=s):s=e[4];let i;return e[5]!==o||e[6]!==s?(i=p.jsx(qC,{"data-slot":"dialog-title",className:s,...o}),e[5]=o,e[6]=s,e[7]=i):i=e[7],i}function Ny(t){const e=ge.c(8);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let s;e[3]!==n?(s=Ne("text-muted-foreground *:[a]:hover:text-foreground text-sm *:[a]:underline *:[a]:underline-offset-3",n),e[3]=n,e[4]=s):s=e[4];let i;return e[5]!==o||e[6]!==s?(i=p.jsx(WC,{"data-slot":"dialog-description",className:s,...o}),e[5]=o,e[6]=s,e[7]=i):i=e[7],i}const O7=zf("h-5 gap-1 rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium transition-all has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&>svg]:size-3! inline-flex items-center justify-center w-fit whitespace-nowrap shrink-0 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive overflow-hidden group/badge",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 [a]:hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 text-destructive dark:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});function cs(t){const e=ge.c(13);let n,o,s,i;e[0]!==t?({className:n,variant:s,asChild:i,...o}=t,e[0]=t,e[1]=n,e[2]=o,e[3]=s,e[4]=i):(n=e[1],o=e[2],s=e[3],i=e[4]);const l=s===void 0?"default":s,d=(i===void 0?!1:i)?If:"span";let f;e[5]!==n||e[6]!==l?(f=Ne(O7({variant:l}),n),e[5]=n,e[6]=l,e[7]=f):f=e[7];let g;return e[8]!==d||e[9]!==o||e[10]!==f||e[11]!==l?(g=p.jsx(d,{"data-slot":"badge","data-variant":l,className:f,...o}),e[8]=d,e[9]=o,e[10]=f,e[11]=l,e[12]=g):g=e[12],g}const lh="";let Qi=null,mc=null;async function z7(){try{const e=await(await fetch(`${lh}/api/connections`)).json();return e.success?(Qi=e.data,e.data):(console.error("Failed to fetch connections:",e.error),[])}catch(t){return console.error("Failed to fetch connections:",t),[]}}async function gs(){if(Qi!==null)return Qi;if(mc)return mc;mc=z7();const t=await mc;return mc=null,t}async function br(t,e=!1,n,o){try{const i=await(await fetch(`${lh}/api/connections`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({connectionString:t,success:e,databaseName:n,name:o})})).json();i.success?Qi=null:console.error("Failed to save connection:",i.error)}catch(s){console.error("Failed to save connection:",s)}}async function I7(t){const e=await fetch(`${lh}/api/connections/${encodeURIComponent(t)}`,{method:"DELETE"});let n={};try{n=await e.json()}catch{}if(e.ok&&n.success)Qi=null;else throw new Error(n.error||"Failed to remove connection")}async function P7(t,e){const n=await fetch(`${lh}/api/connections`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({connectionString:t,name:e})});let o={};try{o=await n.json()}catch{}if(n.ok&&o.success)Qi=null;else throw new Error(o.error||"Failed to update connection name")}const NN=x.createContext(void 0);function $7({children:t}){const[e,n]=x.useState(null),[o,s]=x.useState(!0);return x.useEffect(()=>{async function i(){console.log("ConnectionProvider: Loading connections..."),s(!0);try{const l=await gs();if(console.log("ConnectionProvider: Found connections:",l.length),l.length>0){const d=l.find(f=>f.success)||l[0];console.log("ConnectionProvider: Setting selected connection:",d.name||d.databaseName||"unnamed"),n(d)}else console.log("ConnectionProvider: No connections found")}catch(l){console.error("ConnectionProvider: Failed to load connections:",l)}finally{s(!1)}}i()},[]),p.jsx(NN.Provider,{value:{selectedConnection:e,setSelectedConnection:n,isLoadingConnections:o},children:t})}function kr(){const t=x.useContext(NN);if(t===void 0)throw new Error("useConnection must be used within a ConnectionProvider");return t}function L7({open:t,onOpenChange:e,trigger:n}){const{selectedConnection:o,setSelectedConnection:s}=kr(),[i,l]=x.useState([]),[u,d]=x.useState(null),[f,g]=x.useState(null),[m,y]=x.useState(""),v=x.useCallback(E=>{navigator.clipboard.writeText(E),Jt.success("URL Copied")},[]),w=x.useCallback(async()=>{const E=await gs();l(E)},[]),C=x.useCallback(async E=>{try{await I7(E),d(null);const R=await gs();l(R),R.length===0?s(null):o?.id===E&&s(R[0]),Jt.success("Connection removed")}catch(R){Jt.error(R instanceof Error?R.message:"Failed to remove connection")}},[o?.id,s]),S=x.useCallback(E=>{g(E.id),y(E.name?.trim()||"Unnamed")},[]),N=x.useCallback(()=>{g(null)},[]),M=x.useCallback(async E=>{const R=m.trim()||"Unnamed";try{await P7(E.connectionString,R),g(null),await w(),Jt.success("Connection name updated")}catch(D){Jt.error(D instanceof Error?D.message:"Failed to update name")}},[m,w]);return x.useEffect(()=>{t?w():(d(null),g(null))},[t,w]),p.jsxs(Sy,{open:t,onOpenChange:e,children:[p.jsx(k7,{asChild:!0,children:n}),p.jsxs(Cy,{className:"w-[calc(100%-2rem)] sm:max-w-2xl ",children:[p.jsxs(Ey,{children:[p.jsx(_y,{children:"Saved Database Connections"}),p.jsx(Ny,{children:"View and manage your saved database connections."})]}),p.jsx("div",{className:"space-y-2 max-h-[60vh] overflow-y-auto",children:i.length===0?p.jsx("p",{className:"text-sm text-muted-foreground text-center py-8",children:"No saved connections yet"}):i.map(E=>p.jsxs("div",{className:"p-4 rounded-md border text-card-foreground cursor-pointer",children:[p.jsx("div",{className:"flex items-center justify-between gap-4 mb-2",children:f===E.id?p.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[p.jsx(ar,{value:m,onChange:R=>y(R.target.value),onKeyDown:R=>{R.key==="Enter"&&M(E),R.key==="Escape"&&N()},className:"flex-1 min-w-0",autoFocus:!0,"aria-label":"Connection name"}),p.jsx(St,{variant:"default",size:"sm",onClick:()=>M(E),children:"Save"}),p.jsx(St,{variant:"ghost",size:"sm",onClick:N,children:"Cancel"})]}):p.jsxs(p.Fragment,{children:[p.jsx("div",{className:"text-base font-medium text-foreground",children:E.name||"Unnamed"}),p.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[p.jsx(St,{variant:"ghost",size:"icon",className:"text-muted-foreground hover:text-foreground","aria-label":"Edit connection name",onClick:()=>S(E),children:p.jsx(SN,{className:"size-4"})}),u===E.id?p.jsx(St,{variant:"destructive",size:"sm",onClick:()=>C(E.id),children:"Confirm removal"}):p.jsx(St,{variant:"ghost",size:"icon",className:"text-muted-foreground hover:text-destructive","aria-label":"Delete connection",onClick:()=>d(E.id),children:p.jsx(my,{className:"size-4"})})]})]})}),p.jsxs("div",{className:"flex-1 min-w-0",children:[p.jsx("div",{className:"mb-2",children:E.success?p.jsx(cs,{variant:"secondary",className:"bg-primary/10 text-primary",children:"Success"}):p.jsx(cs,{variant:"secondary",className:"bg-destructive/10 text-destructive",children:"Failed"})}),p.jsxs(xy,{children:[p.jsx(by,{asChild:!0,children:p.jsx("button",{type:"button",onClick:()=>v(E.connectionString),className:"text-sm font-mono text-muted-foreground hover:text-foreground truncate text-left w-full transition-colors cursor-pointer",children:E.connectionString})}),p.jsx(wy,{children:"Copy"})]}),E.databaseName&&p.jsxs("div",{className:"text-xs text-muted-foreground mt-2",children:["Database: ",E.databaseName]}),p.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["Last used:"," ",new Date(E.lastUsed||E.timestamp).toLocaleString()]})]})]},E.id))})]})]})}function bf(t){const e=ge.c(8);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let s;e[3]!==n?(s=Ne("gap-2 text-sm leading-none font-medium group-data-[disabled=true]:opacity-50 peer-disabled:opacity-50 flex items-center select-none group-data-[disabled=true]:pointer-events-none peer-disabled:cursor-not-allowed",n),e[3]=n,e[4]=s):s=e[4];let i;return e[5]!==o||e[6]!==s?(i=p.jsx(b6,{"data-slot":"label",className:s,...o}),e[5]=o,e[6]=s,e[7]=i):i=e[7],i}function t0({open:t,onOpenChange:e,onSuccess:n,onConnectionSaved:o}){const[s,i]=x.useState(""),[l,u]=x.useState(""),[d,f]=x.useState(null),[g,m]=x.useState(!1),[y,v]=x.useState(!1),w=t!==void 0?t:y,C=e||v,S=async N=>{N.preventDefault(),f(null),m(!0),await br(s,!1,void 0,l||void 0),o?.();try{const M=await fetch("/api/connect",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({connectionString:s})});let E;try{E=await M.json()}catch{throw new Error(`Server error: ${M.status} ${M.statusText}`)}E.success?(f(null),await br(s,!0,E.databaseName,l||void 0),o?.(),C(!1),u(""),i(""),n?.(E.databaseName)):(f(E.error||"Failed to connect to database"),await br(s,!1,void 0,l||void 0),o?.())}catch(M){const E=M instanceof Error?M.message:"Failed to connect to database";f(E),await br(s,!1,void 0,l||void 0),o?.()}finally{m(!1)}};return p.jsx(Sy,{open:w,onOpenChange:C,children:p.jsxs(Cy,{children:[p.jsxs(Ey,{children:[p.jsx(_y,{children:"Connect to Database"}),p.jsx(Ny,{children:"Enter your PostgreSQL connection string to connect to your database."})]}),p.jsxs("form",{onSubmit:S,children:[p.jsxs("div",{className:"space-y-4",children:[p.jsxs("div",{className:"space-y-2",children:[p.jsx(bf,{htmlFor:"connection-name",children:"Connection Name (Optional)"}),p.jsx(ar,{id:"connection-name",type:"text",value:l,onChange:N=>u(N.target.value),placeholder:"My Database Connection",disabled:g})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsx(bf,{htmlFor:"connection-string",children:"Connection String"}),p.jsx(ar,{id:"connection-string",type:"text",value:s,onChange:N=>i(N.target.value),placeholder:"postgresql://user:password@host:5432/database",required:!0,disabled:g})]}),d&&p.jsx("div",{className:"bg-destructive/10 border border-destructive/20 text-destructive px-4 py-3 rounded-md text-sm",children:d})]}),p.jsxs(_N,{className:"mt-6",children:[p.jsx(St,{type:"button",variant:"outline",onClick:()=>C(!1),disabled:g,children:"Cancel"}),p.jsx(St,{type:"submit",disabled:g,children:g?"Connecting...":"Connect"})]})]})]})})}const H7=[{title:"SQL Editor",icon:F8,url:"/queries"},{title:"Schema",icon:ah,url:"/schema"},{title:"Tables",icon:WI,url:"/tables"},{title:"Indexes",icon:wN,url:"/indexes"}];function B7(){const t=ge.c(17),e=ys(),{setSelectedConnection:n}=kr(),[o,s]=x.useState(!1),[i,l]=x.useState(null),[u,d]=x.useState(!1);let f,g;t[0]===Symbol.for("react.memo_cache_sentinel")?(f=()=>{gs().then(M=>l(M.length>0))},g=[],t[0]=f,t[1]=g):(f=t[0],g=t[1]),x.useEffect(f,g);let m;t[2]!==n?(m=async()=>{const M=await gs();l(M.length>0),M.length>0&&n(M[0])},t[2]=n,t[3]=m):m=t[3];const y=m;let v;t[4]===Symbol.for("react.memo_cache_sentinel")?(v=p.jsx(R7,{children:"Database"}),t[4]=v):v=t[4];let w;t[5]!==e?(w=H7.map(M=>p.jsx(Zw,{children:p.jsx(sp,{asChild:!0,isActive:e.pathname===M.url,children:p.jsxs(O0,{to:M.url,children:[p.jsx(M.icon,{}),p.jsx("span",{children:M.title})]})})},M.title)),t[5]=e,t[6]=w):w=t[6];let C;t[7]!==w?(C=p.jsx(N7,{children:p.jsxs(M7,{children:[v,p.jsx(D7,{children:p.jsx(Qw,{children:w})})]})}),t[7]=w,t[8]=C):C=t[8];let S;t[9]!==y||t[10]!==i||t[11]!==u||t[12]!==o?(S=p.jsx(_7,{children:p.jsx(Qw,{children:p.jsx(Zw,{children:i!==!0?p.jsxs(p.Fragment,{children:[p.jsx(sp,{asChild:!0,children:p.jsxs("button",{type:"button",className:"cursor-pointer",onClick:()=>d(!0),children:[p.jsx(ra,{}),p.jsx("span",{children:"Add connection"})]})}),p.jsx(t0,{open:u,onOpenChange:d,onConnectionSaved:y})]}):p.jsx(L7,{open:o,onOpenChange:s,trigger:p.jsx(sp,{asChild:!0,children:p.jsxs("button",{type:"button",className:"cursor-pointer",children:[p.jsx(ah,{}),p.jsx("span",{children:"My Connections"})]})})})})})}),t[9]=y,t[10]=i,t[11]=u,t[12]=o,t[13]=S):S=t[13];let N;return t[14]!==C||t[15]!==S?(N=p.jsxs(E7,{collapsible:"icon",className:"!top-14 !h-[calc(100vh-3.5rem)]",children:[C,S]}),t[14]=C,t[15]=S,t[16]=N):N=t[16],N}function My(t){const e=ge.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let o;return e[2]!==n?(o=p.jsx(d6,{"data-slot":"dropdown-menu",...n}),e[2]=n,e[3]=o):o=e[3],o}function Ry(t){const e=ge.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let o;return e[2]!==n?(o=p.jsx(f6,{"data-slot":"dropdown-menu-trigger",...n}),e[2]=n,e[3]=o):o=e[3],o}function Dy(t){const e=ge.c(12);let n,o,s,i;e[0]!==t?({className:n,align:s,sideOffset:i,...o}=t,e[0]=t,e[1]=n,e[2]=o,e[3]=s,e[4]=i):(n=e[1],o=e[2],s=e[3],i=e[4]);const l=s===void 0?"start":s,u=i===void 0?4:i;let d;e[5]!==n?(d=Ne("data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-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 ring-foreground/10 bg-popover text-popover-foreground min-w-32 rounded-md p-1 shadow-md ring-1 duration-100 z-50 max-h-(--radix-dropdown-menu-content-available-height) w-(--radix-dropdown-menu-trigger-width) origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto data-[state=closed]:overflow-hidden",n),e[5]=n,e[6]=d):d=e[6];let f;return e[7]!==l||e[8]!==o||e[9]!==u||e[10]!==d?(f=p.jsx(h6,{children:p.jsx(m6,{"data-slot":"dropdown-menu-content",sideOffset:u,align:l,className:d,...o})}),e[7]=l,e[8]=o,e[9]=u,e[10]=d,e[11]=f):f=e[11],f}function Vo(t){const e=ge.c(12);let n,o,s,i;e[0]!==t?({className:n,inset:o,variant:i,...s}=t,e[0]=t,e[1]=n,e[2]=o,e[3]=s,e[4]=i):(n=e[1],o=e[2],s=e[3],i=e[4]);const l=i===void 0?"default":i;let u;e[5]!==n?(u=Ne("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:text-destructive not-data-[variant=destructive]:focus:**:text-accent-foreground gap-2 rounded-sm px-2 py-1.5 text-sm [&_svg:not([class*='size-'])]:size-4 group/dropdown-menu-item relative flex cursor-default items-center outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0",n),e[5]=n,e[6]=u):u=e[6];let d;return e[7]!==o||e[8]!==s||e[9]!==u||e[10]!==l?(d=p.jsx(g6,{"data-slot":"dropdown-menu-item","data-inset":o,"data-variant":l,className:u,...s}),e[7]=o,e[8]=s,e[9]=u,e[10]=l,e[11]=d):d=e[11],d}function Jw(t){const e=ge.c(13);let n,o,s,i;e[0]!==t?({className:s,children:o,checked:n,...i}=t,e[0]=t,e[1]=n,e[2]=o,e[3]=s,e[4]=i):(n=e[1],o=e[2],s=e[3],i=e[4]);let l;e[5]!==s?(l=Ne("focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm [&_svg:not([class*='size-'])]:size-4 relative flex cursor-default items-center outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",s),e[5]=s,e[6]=l):l=e[6];let u;e[7]===Symbol.for("react.memo_cache_sentinel")?(u=p.jsx("span",{className:"pointer-events-none absolute right-2 flex items-center justify-center pointer-events-none","data-slot":"dropdown-menu-checkbox-item-indicator",children:p.jsx(y6,{children:p.jsx(da,{})})}),e[7]=u):u=e[7];let d;return e[8]!==n||e[9]!==o||e[10]!==i||e[11]!==l?(d=p.jsxs(p6,{"data-slot":"dropdown-menu-checkbox-item",className:l,checked:n,...i,children:[u,o]}),e[8]=n,e[9]=o,e[10]=i,e[11]=l,e[12]=d):d=e[12],d}function wf(t){const e=ge.c(8);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let s;e[3]!==n?(s=Ne("bg-border -mx-1 my-1 h-px",n),e[3]=n,e[4]=s):s=e[4];let i;return e[5]!==o||e[6]!==s?(i=p.jsx(v6,{"data-slot":"dropdown-menu-separator",className:s,...o}),e[5]=o,e[6]=s,e[7]=i):i=e[7],i}function F7(t){const e=ge.c(54),{selectedConnection:n,onConnectionSelect:o}=t,[s,i]=x.useState(!1),[l,u]=x.useState("");let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=[],e[0]=d):d=e[0];const[f,g]=x.useState(d),[m,y]=x.useState(!1);let v;e[1]===Symbol.for("react.memo_cache_sentinel")?(v=async()=>{const ne=await gs();g(ne)},e[1]=v):v=e[1];const w=v;let C;e[2]===Symbol.for("react.memo_cache_sentinel")?(C=()=>{w()},e[2]=C):C=e[2];let S;e[3]!==m||e[4]!==s?(S=[w,s,m],e[3]=m,e[4]=s,e[5]=S):S=e[5],x.useEffect(C,S);let N;e:{if(!l){N=f;break e}let ne;if(e[6]!==f||e[7]!==l){const X=l.toLowerCase();ne=f.filter(ee=>ee.name?.toLowerCase().includes(X)||ee.connectionString.toLowerCase().includes(X)||ee.databaseName?.toLowerCase().includes(X)),e[6]=f,e[7]=l,e[8]=ne}else ne=e[8];N=ne}const M=N;let E;e[9]!==o?(E=async ne=>{await br(ne.connectionString,ne.success||!1,ne.databaseName,ne.name),o?.(ne),i(!1),u(""),await w()},e[9]=o,e[10]=E):E=e[10];const R=E,D=n?.name||n?.databaseName||"No connection",T=f.length>0;let k;e[11]!==o?(k=async()=>{const ne=await gs();g(ne),ne.length===1&&o?.(ne[0])},e[11]=o,e[12]=k):k=e[12];const O=k;if(!n)return null;if(!T){let ne;e[13]===Symbol.for("react.memo_cache_sentinel")?(ne=p.jsx("span",{className:"text-muted-foreground",children:"/"}),e[13]=ne):ne=e[13];let X;e[14]===Symbol.for("react.memo_cache_sentinel")?(X=p.jsxs("div",{className:"flex items-center gap-1 text-sm",children:[ne,p.jsxs(St,{variant:"ghost",className:"h-auto px-2 py-1 text-sm font-normal hover:bg-accent flex items-center gap-1.5",onClick:()=>y(!0),children:[p.jsx(ra,{className:"h-4 w-4"}),p.jsx("span",{children:"Add connection"})]})]}),e[14]=X):X=e[14];let ee;return e[15]!==O||e[16]!==m?(ee=p.jsxs(p.Fragment,{children:[X,p.jsx(t0,{open:m,onOpenChange:y,onConnectionSaved:O})]}),e[15]=O,e[16]=m,e[17]=ee):ee=e[17],ee}let L;e[18]===Symbol.for("react.memo_cache_sentinel")?(L=p.jsx("span",{className:"text-muted-foreground",children:"/"}),e[18]=L):L=e[18];let W;e[19]===Symbol.for("react.memo_cache_sentinel")?(W=p.jsx(ah,{className:"h-4 w-4"}),e[19]=W):W=e[19];let B;e[20]!==D?(B=p.jsx("span",{children:D}),e[20]=D,e[21]=B):B=e[21];let Y;e[22]!==s?(Y=s?p.jsx(sh,{className:"h-4 w-4"}):p.jsx(ms,{className:"h-4 w-4"}),e[22]=s,e[23]=Y):Y=e[23];let q;e[24]!==B||e[25]!==Y?(q=p.jsx(Ry,{asChild:!0,children:p.jsxs(St,{variant:"ghost",className:"h-auto px-2 py-1 text-sm font-normal hover:bg-accent flex items-center gap-1.5",children:[W,B,Y]})}),e[24]=B,e[25]=Y,e[26]=q):q=e[26];let z;e[27]===Symbol.for("react.memo_cache_sentinel")?(z=p.jsx(iu,{className:"absolute left-2 top-1/2 transform -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e[27]=z):z=e[27];let V;e[28]===Symbol.for("react.memo_cache_sentinel")?(V=ne=>u(ne.target.value),e[28]=V):V=e[28];let A;e[29]!==l?(A=p.jsx("div",{className:"p-2 border-b",children:p.jsxs("div",{className:"relative",children:[z,p.jsx(ar,{placeholder:"Find connection...",value:l,onChange:V,className:"pl-8 h-8",autoFocus:!0})]})}),e[29]=l,e[30]=A):A=e[30];let H;e[31]!==M||e[32]!==R||e[33]!==l||e[34]!==n?.connectionString?(H=M.length===0?p.jsx("div",{className:"p-4 text-center text-sm text-muted-foreground",children:l?"No connections found":"No saved connections"}):M.map((ne,X)=>p.jsxs(Vo,{onClick:()=>R(ne),className:"flex items-center justify-between cursor-pointer",children:[p.jsxs("div",{className:"flex-1 min-w-0",children:[ne.name&&p.jsx("div",{className:"font-medium truncate",children:ne.name}),p.jsx("div",{className:"text-xs text-muted-foreground truncate",children:ne.databaseName||ne.connectionString})]}),n?.connectionString===ne.connectionString&&p.jsx(da,{className:"h-4 w-4 ml-2 shrink-0"})]},X)),e[31]=M,e[32]=R,e[33]=l,e[34]=n?.connectionString,e[35]=H):H=e[35];let P;e[36]!==H?(P=p.jsx("div",{className:"max-h-64 overflow-y-auto",children:H}),e[36]=H,e[37]=P):P=e[37];let F;e[38]===Symbol.for("react.memo_cache_sentinel")?(F=p.jsx(wf,{}),e[38]=F):F=e[38];let Q;e[39]===Symbol.for("react.memo_cache_sentinel")?(Q=()=>{i(!1),y(!0)},e[39]=Q):Q=e[39];let $;e[40]===Symbol.for("react.memo_cache_sentinel")?($=p.jsxs(Vo,{onClick:Q,className:"cursor-pointer",children:[p.jsx(ra,{className:"h-4 w-4 mr-2"}),p.jsx("span",{children:"New connection"})]}),e[40]=$):$=e[40];let I;e[41]!==A||e[42]!==P?(I=p.jsxs(Dy,{align:"start",className:"w-80 p-0 z-[70]",onCloseAutoFocus:V7,children:[A,P,F,$]}),e[41]=A,e[42]=P,e[43]=I):I=e[43];let U;e[44]!==s||e[45]!==q||e[46]!==I?(U=p.jsxs("div",{className:"flex items-center gap-1 text-sm",children:[L,p.jsxs(My,{open:s,onOpenChange:i,children:[q,I]})]}),e[44]=s,e[45]=q,e[46]=I,e[47]=U):U=e[47];let K;e[48]!==O||e[49]!==m?(K=p.jsx(t0,{open:m,onOpenChange:y,onConnectionSaved:O}),e[48]=O,e[49]=m,e[50]=K):K=e[50];let J;return e[51]!==U||e[52]!==K?(J=p.jsxs(p.Fragment,{children:[U,K]}),e[51]=U,e[52]=K,e[53]=J):J=e[53],J}function V7(t){return t.preventDefault()}function eS(){const t=ge.c(4),{selectedConnection:e,setSelectedConnection:n}=kr();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=p.jsx("div",{className:"flex items-center gap-2",children:p.jsx("h1",{className:"text-sm font-semibold",children:"Fakebase Studio"})}),t[0]=o):o=t[0];let s;return t[1]!==e||t[2]!==n?(s=p.jsx("header",{className:"fixed top-0 left-0 right-0 z-[60] w-full border-b bg-background",children:p.jsxs("div",{className:"flex h-14 items-center px-4 gap-4",children:[o,p.jsx(F7,{selectedConnection:e,onConnectionSelect:n})]})}),t[1]=e,t[2]=n,t[3]=s):s=t[3],s}function U7(){const{setSelectedConnection:t}=kr(),[e,n]=x.useState([]),[o,s]=x.useState(!0),[i,l]=x.useState(!1),[u,d]=x.useState(""),[f,g]=x.useState(""),[m,y]=x.useState(null),[v,w]=x.useState(!1),C=x.useCallback(async()=>{s(!0);const M=await gs();n(M),s(!1)},[]);x.useEffect(()=>{C()},[C]);const S=x.useCallback(async M=>{await br(M.connectionString,M.success??!1,M.databaseName,M.name),t(M),Jt.success(`Connected to ${M.name||M.databaseName||"database"}`)},[t]),N=async M=>{if(M.preventDefault(),y(null),!f.trim()){y("Connection string is required");return}w(!0),await br(f.trim(),!1,void 0,u.trim()||void 0);try{const R=await(await fetch("/api/connect",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({connectionString:f.trim()})})).json();if(R.success){await br(f.trim(),!0,R.databaseName,u.trim()||void 0);const T=(await gs()).find(k=>k.connectionString===f.trim());T&&t(T),d(""),g(""),l(!1),y(null),Jt.success("Connected successfully")}else y(R.error||"Failed to connect"),await br(f.trim(),!1,void 0,u.trim()||void 0)}catch(E){const R=E instanceof Error?E.message:"Failed to connect";y(R),await br(f.trim(),!1,void 0,u.trim()||void 0)}finally{w(!1)}};return o?p.jsx("div",{className:"h-full flex items-center justify-center",children:p.jsx("p",{className:"text-muted-foreground",children:"Loading connections…"})}):e.length===0||i?p.jsx("div",{className:"h-full flex items-center justify-center p-6",children:p.jsxs("div",{className:"w-full max-w-md space-y-6",children:[p.jsxs("div",{className:"text-center space-y-1",children:[p.jsx("h2",{className:"text-lg font-semibold text-foreground",children:e.length===0?"Add your first database connection":"Add a new connection"}),p.jsx("p",{className:"text-sm text-muted-foreground",children:"Enter a name and PostgreSQL connection string to get started."})]}),p.jsxs("form",{onSubmit:N,className:"space-y-4",children:[p.jsxs("div",{className:"space-y-2",children:[p.jsx(bf,{htmlFor:"select-conn-name",children:"Name (optional)"}),p.jsx(ar,{id:"select-conn-name",type:"text",value:u,onChange:M=>d(M.target.value),placeholder:"My Database",disabled:v})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsx(bf,{htmlFor:"select-conn-string",children:"Connection string"}),p.jsx(ar,{id:"select-conn-string",type:"text",value:f,onChange:M=>g(M.target.value),placeholder:"postgresql://user:password@host:5432/database",disabled:v,required:!0})]}),m&&p.jsx("div",{className:"bg-destructive/10 border border-destructive/20 text-destructive text-sm px-3 py-2 rounded-md",children:m}),p.jsxs("div",{className:"flex gap-2",children:[e.length>0&&p.jsx(St,{type:"button",variant:"outline",onClick:()=>{l(!1),y(null)},disabled:v,children:"Cancel"}),p.jsx(St,{type:"submit",disabled:v,className:"flex-1",children:v?"Connecting…":"Connect"})]})]}),e.length>0&&p.jsx("p",{className:"text-center text-sm text-muted-foreground",children:"Or select an existing connection below."})]})}):p.jsx("div",{className:"h-full flex items-center justify-center p-6",children:p.jsxs("div",{className:"w-full max-w-lg space-y-6",children:[p.jsxs("div",{className:"text-center space-y-1",children:[p.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"Select a database connection"}),p.jsx("p",{className:"text-sm text-muted-foreground",children:"Choose a saved connection to continue."})]}),p.jsx("ul",{className:"space-y-2",children:e.map(M=>p.jsx("li",{children:p.jsxs("button",{type:"button",onClick:()=>S(M),className:"w-full flex items-center gap-3 p-4 rounded-lg border border-border bg-card text-left hover:bg-accent/50 transition-colors",children:[p.jsx(ah,{className:"h-5 w-5 text-muted-foreground shrink-0"}),p.jsxs("div",{className:"flex-1 min-w-0",children:[p.jsx("div",{className:"font-medium text-foreground truncate",children:M.name||"Unnamed"}),p.jsx("div",{className:"text-xs text-muted-foreground truncate mt-0.5",children:M.databaseName||M.connectionString})]})]})},M.id))}),p.jsx("div",{className:"flex justify-center",children:p.jsxs(St,{type:"button",variant:"outline",onClick:()=>l(!0),className:"gap-2",children:[p.jsx(ra,{className:"h-4 w-4"}),"Add new connection"]})})]})})}function Y7(t){const e=ge.c(6),{children:n}=t,{selectedConnection:o}=kr();if(!o){let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u=p.jsx(eS,{}),e[0]=u):u=e[0];let d;return e[1]===Symbol.for("react.memo_cache_sentinel")?(d=p.jsxs(p.Fragment,{children:[u,p.jsx("div",{className:"flex pt-14 min-h-screen w-full overflow-hidden",children:p.jsx("div",{className:"w-full h-[calc(100vh-3.5rem)] flex flex-col overflow-hidden",children:p.jsx(U7,{})})})]}),e[1]=d):d=e[1],d}let s,i;e[2]===Symbol.for("react.memo_cache_sentinel")?(s=p.jsx(eS,{}),i=p.jsx(B7,{}),e[2]=s,e[3]=i):(s=e[2],i=e[3]);let l;return e[4]!==n?(l=p.jsxs(w7,{defaultOpen:!1,children:[s,i,p.jsx("div",{className:"flex pt-14 min-h-screen w-full overflow-hidden",children:p.jsx("div",{className:"w-full h-[calc(100vh-3.5rem)] flex flex-col overflow-hidden",children:n})})]}),e[4]=n,e[5]=l):l=e[5],l}function G7(t){const e=ge.c(3),{children:n}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=p.jsx(Fk,{}),e[0]=o):o=e[0];let s;return e[1]!==n?(s=p.jsxs($7,{children:[o,p.jsx(Y7,{children:n})]}),e[1]=n,e[2]=s):s=e[2],s}function Nn(t){if(typeof t=="string"||typeof t=="number")return""+t;let e="";if(Array.isArray(t))for(let n=0,o;n<t.length;n++)(o=Nn(t[n]))!==""&&(e+=(e&&" ")+o);else for(let n in t)t[n]&&(e+=(e&&" ")+n);return e}var q7={value:()=>{}};function ch(){for(var t=0,e=arguments.length,n={},o;t<e;++t){if(!(o=arguments[t]+"")||o in n||/[\s.]/.test(o))throw new Error("illegal type: "+o);n[o]=[]}return new of(n)}function of(t){this._=t}function W7(t,e){return t.trim().split(/^|\s+/).map(function(n){var o="",s=n.indexOf(".");if(s>=0&&(o=n.slice(s+1),n=n.slice(0,s)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:o}})}of.prototype=ch.prototype={constructor:of,on:function(t,e){var n=this._,o=W7(t+"",n),s,i=-1,l=o.length;if(arguments.length<2){for(;++i<l;)if((s=(t=o[i]).type)&&(s=K7(n[s],t.name)))return s;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++i<l;)if(s=(t=o[i]).type)n[s]=tS(n[s],t.name,e);else if(e==null)for(s in n)n[s]=tS(n[s],t.name,null);return this},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new of(t)},call:function(t,e){if((s=arguments.length-2)>0)for(var n=new Array(s),o=0,s,i;o<s;++o)n[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(i=this._[t],o=0,s=i.length;o<s;++o)i[o].value.apply(e,n)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var o=this._[t],s=0,i=o.length;s<i;++s)o[s].value.apply(e,n)}};function K7(t,e){for(var n=0,o=t.length,s;n<o;++n)if((s=t[n]).name===e)return s.value}function tS(t,e,n){for(var o=0,s=t.length;o<s;++o)if(t[o].name===e){t[o]=q7,t=t.slice(0,o).concat(t.slice(o+1));break}return n!=null&&t.push({name:e,value:n}),t}var n0="http://www.w3.org/1999/xhtml";const nS={svg:"http://www.w3.org/2000/svg",xhtml:n0,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function uh(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),nS.hasOwnProperty(e)?{space:nS[e],local:t}:t}function X7(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===n0&&e.documentElement.namespaceURI===n0?e.createElement(t):e.createElementNS(n,t)}}function Q7(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function MN(t){var e=uh(t);return(e.local?Q7:X7)(e)}function Z7(){}function Ty(t){return t==null?Z7:function(){return this.querySelector(t)}}function J7(t){typeof t!="function"&&(t=Ty(t));for(var e=this._groups,n=e.length,o=new Array(n),s=0;s<n;++s)for(var i=e[s],l=i.length,u=o[s]=new Array(l),d,f,g=0;g<l;++g)(d=i[g])&&(f=t.call(d,d.__data__,g,i))&&("__data__"in d&&(f.__data__=d.__data__),u[g]=f);return new Eo(o,this._parents)}function eP(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function tP(){return[]}function RN(t){return t==null?tP:function(){return this.querySelectorAll(t)}}function nP(t){return function(){return eP(t.apply(this,arguments))}}function oP(t){typeof t=="function"?t=nP(t):t=RN(t);for(var e=this._groups,n=e.length,o=[],s=[],i=0;i<n;++i)for(var l=e[i],u=l.length,d,f=0;f<u;++f)(d=l[f])&&(o.push(t.call(d,d.__data__,f,l)),s.push(d));return new Eo(o,s)}function DN(t){return function(){return this.matches(t)}}function TN(t){return function(e){return e.matches(t)}}var rP=Array.prototype.find;function sP(t){return function(){return rP.call(this.children,t)}}function aP(){return this.firstElementChild}function iP(t){return this.select(t==null?aP:sP(typeof t=="function"?t:TN(t)))}var lP=Array.prototype.filter;function cP(){return Array.from(this.children)}function uP(t){return function(){return lP.call(this.children,t)}}function dP(t){return this.selectAll(t==null?cP:uP(typeof t=="function"?t:TN(t)))}function fP(t){typeof t!="function"&&(t=DN(t));for(var e=this._groups,n=e.length,o=new Array(n),s=0;s<n;++s)for(var i=e[s],l=i.length,u=o[s]=[],d,f=0;f<l;++f)(d=i[f])&&t.call(d,d.__data__,f,i)&&u.push(d);return new Eo(o,this._parents)}function kN(t){return new Array(t.length)}function hP(){return new Eo(this._enter||this._groups.map(kN),this._parents)}function Sf(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}Sf.prototype={constructor:Sf,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function mP(t){return function(){return t}}function gP(t,e,n,o,s,i){for(var l=0,u,d=e.length,f=i.length;l<f;++l)(u=e[l])?(u.__data__=i[l],o[l]=u):n[l]=new Sf(t,i[l]);for(;l<d;++l)(u=e[l])&&(s[l]=u)}function pP(t,e,n,o,s,i,l){var u,d,f=new Map,g=e.length,m=i.length,y=new Array(g),v;for(u=0;u<g;++u)(d=e[u])&&(y[u]=v=l.call(d,d.__data__,u,e)+"",f.has(v)?s[u]=d:f.set(v,d));for(u=0;u<m;++u)v=l.call(t,i[u],u,i)+"",(d=f.get(v))?(o[u]=d,d.__data__=i[u],f.delete(v)):n[u]=new Sf(t,i[u]);for(u=0;u<g;++u)(d=e[u])&&f.get(y[u])===d&&(s[u]=d)}function yP(t){return t.__data__}function vP(t,e){if(!arguments.length)return Array.from(this,yP);var n=e?pP:gP,o=this._parents,s=this._groups;typeof t!="function"&&(t=mP(t));for(var i=s.length,l=new Array(i),u=new Array(i),d=new Array(i),f=0;f<i;++f){var g=o[f],m=s[f],y=m.length,v=xP(t.call(g,g&&g.__data__,f,o)),w=v.length,C=u[f]=new Array(w),S=l[f]=new Array(w),N=d[f]=new Array(y);n(g,m,C,S,N,v,e);for(var M=0,E=0,R,D;M<w;++M)if(R=C[M]){for(M>=E&&(E=M+1);!(D=S[E])&&++E<w;);R._next=D||null}}return l=new Eo(l,o),l._enter=u,l._exit=d,l}function xP(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function bP(){return new Eo(this._exit||this._groups.map(kN),this._parents)}function wP(t,e,n){var o=this.enter(),s=this,i=this.exit();return typeof t=="function"?(o=t(o),o&&(o=o.selection())):o=o.append(t+""),e!=null&&(s=e(s),s&&(s=s.selection())),n==null?i.remove():n(i),o&&s?o.merge(s).order():s}function SP(t){for(var e=t.selection?t.selection():t,n=this._groups,o=e._groups,s=n.length,i=o.length,l=Math.min(s,i),u=new Array(s),d=0;d<l;++d)for(var f=n[d],g=o[d],m=f.length,y=u[d]=new Array(m),v,w=0;w<m;++w)(v=f[w]||g[w])&&(y[w]=v);for(;d<s;++d)u[d]=n[d];return new Eo(u,this._parents)}function CP(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var o=t[e],s=o.length-1,i=o[s],l;--s>=0;)(l=o[s])&&(i&&l.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(l,i),i=l);return this}function EP(t){t||(t=_P);function e(m,y){return m&&y?t(m.__data__,y.__data__):!m-!y}for(var n=this._groups,o=n.length,s=new Array(o),i=0;i<o;++i){for(var l=n[i],u=l.length,d=s[i]=new Array(u),f,g=0;g<u;++g)(f=l[g])&&(d[g]=f);d.sort(e)}return new Eo(s,this._parents).order()}function _P(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function NP(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function MP(){return Array.from(this)}function RP(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var o=t[e],s=0,i=o.length;s<i;++s){var l=o[s];if(l)return l}return null}function DP(){let t=0;for(const e of this)++t;return t}function TP(){return!this.node()}function kP(t){for(var e=this._groups,n=0,o=e.length;n<o;++n)for(var s=e[n],i=0,l=s.length,u;i<l;++i)(u=s[i])&&t.call(u,u.__data__,i,s);return this}function jP(t){return function(){this.removeAttribute(t)}}function AP(t){return function(){this.removeAttributeNS(t.space,t.local)}}function OP(t,e){return function(){this.setAttribute(t,e)}}function zP(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function IP(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function PP(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function $P(t,e){var n=uh(t);if(arguments.length<2){var o=this.node();return n.local?o.getAttributeNS(n.space,n.local):o.getAttribute(n)}return this.each((e==null?n.local?AP:jP:typeof e=="function"?n.local?PP:IP:n.local?zP:OP)(n,e))}function jN(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function LP(t){return function(){this.style.removeProperty(t)}}function HP(t,e,n){return function(){this.style.setProperty(t,e,n)}}function BP(t,e,n){return function(){var o=e.apply(this,arguments);o==null?this.style.removeProperty(t):this.style.setProperty(t,o,n)}}function FP(t,e,n){return arguments.length>1?this.each((e==null?LP:typeof e=="function"?BP:HP)(t,e,n??"")):Zi(this.node(),t)}function Zi(t,e){return t.style.getPropertyValue(e)||jN(t).getComputedStyle(t,null).getPropertyValue(e)}function VP(t){return function(){delete this[t]}}function UP(t,e){return function(){this[t]=e}}function YP(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function GP(t,e){return arguments.length>1?this.each((e==null?VP:typeof e=="function"?YP:UP)(t,e)):this.node()[t]}function AN(t){return t.trim().split(/^|\s+/)}function ky(t){return t.classList||new ON(t)}function ON(t){this._node=t,this._names=AN(t.getAttribute("class")||"")}ON.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function zN(t,e){for(var n=ky(t),o=-1,s=e.length;++o<s;)n.add(e[o])}function IN(t,e){for(var n=ky(t),o=-1,s=e.length;++o<s;)n.remove(e[o])}function qP(t){return function(){zN(this,t)}}function WP(t){return function(){IN(this,t)}}function KP(t,e){return function(){(e.apply(this,arguments)?zN:IN)(this,t)}}function XP(t,e){var n=AN(t+"");if(arguments.length<2){for(var o=ky(this.node()),s=-1,i=n.length;++s<i;)if(!o.contains(n[s]))return!1;return!0}return this.each((typeof e=="function"?KP:e?qP:WP)(n,e))}function QP(){this.textContent=""}function ZP(t){return function(){this.textContent=t}}function JP(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function e9(t){return arguments.length?this.each(t==null?QP:(typeof t=="function"?JP:ZP)(t)):this.node().textContent}function t9(){this.innerHTML=""}function n9(t){return function(){this.innerHTML=t}}function o9(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function r9(t){return arguments.length?this.each(t==null?t9:(typeof t=="function"?o9:n9)(t)):this.node().innerHTML}function s9(){this.nextSibling&&this.parentNode.appendChild(this)}function a9(){return this.each(s9)}function i9(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function l9(){return this.each(i9)}function c9(t){var e=typeof t=="function"?t:MN(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function u9(){return null}function d9(t,e){var n=typeof t=="function"?t:MN(t),o=e==null?u9:typeof e=="function"?e:Ty(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),o.apply(this,arguments)||null)})}function f9(){var t=this.parentNode;t&&t.removeChild(this)}function h9(){return this.each(f9)}function m9(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function g9(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function p9(t){return this.select(t?g9:m9)}function y9(t){return arguments.length?this.property("__data__",t):this.node().__data__}function v9(t){return function(e){t.call(this,e,this.__data__)}}function x9(t){return t.trim().split(/^|\s+/).map(function(e){var n="",o=e.indexOf(".");return o>=0&&(n=e.slice(o+1),e=e.slice(0,o)),{type:e,name:n}})}function b9(t){return function(){var e=this.__on;if(e){for(var n=0,o=-1,s=e.length,i;n<s;++n)i=e[n],(!t.type||i.type===t.type)&&i.name===t.name?this.removeEventListener(i.type,i.listener,i.options):e[++o]=i;++o?e.length=o:delete this.__on}}}function w9(t,e,n){return function(){var o=this.__on,s,i=v9(e);if(o){for(var l=0,u=o.length;l<u;++l)if((s=o[l]).type===t.type&&s.name===t.name){this.removeEventListener(s.type,s.listener,s.options),this.addEventListener(s.type,s.listener=i,s.options=n),s.value=e;return}}this.addEventListener(t.type,i,n),s={type:t.type,name:t.name,value:e,listener:i,options:n},o?o.push(s):this.__on=[s]}}function S9(t,e,n){var o=x9(t+""),s,i=o.length,l;if(arguments.length<2){var u=this.node().__on;if(u){for(var d=0,f=u.length,g;d<f;++d)for(s=0,g=u[d];s<i;++s)if((l=o[s]).type===g.type&&l.name===g.name)return g.value}return}for(u=e?w9:b9,s=0;s<i;++s)this.each(u(o[s],e,n));return this}function PN(t,e,n){var o=jN(t),s=o.CustomEvent;typeof s=="function"?s=new s(e,n):(s=o.document.createEvent("Event"),n?(s.initEvent(e,n.bubbles,n.cancelable),s.detail=n.detail):s.initEvent(e,!1,!1)),t.dispatchEvent(s)}function C9(t,e){return function(){return PN(this,t,e)}}function E9(t,e){return function(){return PN(this,t,e.apply(this,arguments))}}function _9(t,e){return this.each((typeof e=="function"?E9:C9)(t,e))}function*N9(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var o=t[e],s=0,i=o.length,l;s<i;++s)(l=o[s])&&(yield l)}var $N=[null];function Eo(t,e){this._groups=t,this._parents=e}function lu(){return new Eo([[document.documentElement]],$N)}function M9(){return this}Eo.prototype=lu.prototype={constructor:Eo,select:J7,selectAll:oP,selectChild:iP,selectChildren:dP,filter:fP,data:vP,enter:hP,exit:bP,join:wP,merge:SP,selection:M9,order:CP,sort:EP,call:NP,nodes:MP,node:RP,size:DP,empty:TP,each:kP,attr:$P,style:FP,property:GP,classed:XP,text:e9,html:r9,raise:a9,lower:l9,append:c9,insert:d9,remove:h9,clone:p9,datum:y9,on:S9,dispatch:_9,[Symbol.iterator]:N9};function So(t){return typeof t=="string"?new Eo([[document.querySelector(t)]],[document.documentElement]):new Eo([[t]],$N)}function R9(t){let e;for(;e=t.sourceEvent;)t=e;return t}function Qo(t,e){if(t=R9(t),e===void 0&&(e=t.currentTarget),e){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var o=n.createSVGPoint();return o.x=t.clientX,o.y=t.clientY,o=o.matrixTransform(e.getScreenCTM().inverse()),[o.x,o.y]}if(e.getBoundingClientRect){var s=e.getBoundingClientRect();return[t.clientX-s.left-e.clientLeft,t.clientY-s.top-e.clientTop]}}return[t.pageX,t.pageY]}const D9={passive:!1},Ic={capture:!0,passive:!1};function ap(t){t.stopImmediatePropagation()}function Gi(t){t.preventDefault(),t.stopImmediatePropagation()}function LN(t){var e=t.document.documentElement,n=So(t).on("dragstart.drag",Gi,Ic);"onselectstart"in e?n.on("selectstart.drag",Gi,Ic):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function HN(t,e){var n=t.document.documentElement,o=So(t).on("dragstart.drag",null);e&&(o.on("click.drag",Gi,Ic),setTimeout(function(){o.on("click.drag",null)},0)),"onselectstart"in n?o.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const Hd=t=>()=>t;function o0(t,{sourceEvent:e,subject:n,target:o,identifier:s,active:i,x:l,y:u,dx:d,dy:f,dispatch:g}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:o,enumerable:!0,configurable:!0},identifier:{value:s,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:l,enumerable:!0,configurable:!0},y:{value:u,enumerable:!0,configurable:!0},dx:{value:d,enumerable:!0,configurable:!0},dy:{value:f,enumerable:!0,configurable:!0},_:{value:g}})}o0.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};function T9(t){return!t.ctrlKey&&!t.button}function k9(){return this.parentNode}function j9(t,e){return e??{x:t.x,y:t.y}}function A9(){return navigator.maxTouchPoints||"ontouchstart"in this}function BN(){var t=T9,e=k9,n=j9,o=A9,s={},i=ch("start","drag","end"),l=0,u,d,f,g,m=0;function y(R){R.on("mousedown.drag",v).filter(o).on("touchstart.drag",S).on("touchmove.drag",N,D9).on("touchend.drag touchcancel.drag",M).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function v(R,D){if(!(g||!t.call(this,R,D))){var T=E(this,e.call(this,R,D),R,D,"mouse");T&&(So(R.view).on("mousemove.drag",w,Ic).on("mouseup.drag",C,Ic),LN(R.view),ap(R),f=!1,u=R.clientX,d=R.clientY,T("start",R))}}function w(R){if(Gi(R),!f){var D=R.clientX-u,T=R.clientY-d;f=D*D+T*T>m}s.mouse("drag",R)}function C(R){So(R.view).on("mousemove.drag mouseup.drag",null),HN(R.view,f),Gi(R),s.mouse("end",R)}function S(R,D){if(t.call(this,R,D)){var T=R.changedTouches,k=e.call(this,R,D),O=T.length,L,W;for(L=0;L<O;++L)(W=E(this,k,R,D,T[L].identifier,T[L]))&&(ap(R),W("start",R,T[L]))}}function N(R){var D=R.changedTouches,T=D.length,k,O;for(k=0;k<T;++k)(O=s[D[k].identifier])&&(Gi(R),O("drag",R,D[k]))}function M(R){var D=R.changedTouches,T=D.length,k,O;for(g&&clearTimeout(g),g=setTimeout(function(){g=null},500),k=0;k<T;++k)(O=s[D[k].identifier])&&(ap(R),O("end",R,D[k]))}function E(R,D,T,k,O,L){var W=i.copy(),B=Qo(L||T,D),Y,q,z;if((z=n.call(R,new o0("beforestart",{sourceEvent:T,target:y,identifier:O,active:l,x:B[0],y:B[1],dx:0,dy:0,dispatch:W}),k))!=null)return Y=z.x-B[0]||0,q=z.y-B[1]||0,function V(A,H,P){var F=B,Q;switch(A){case"start":s[O]=V,Q=l++;break;case"end":delete s[O],--l;case"drag":B=Qo(P||H,D),Q=l;break}W.call(A,R,new o0(A,{sourceEvent:H,subject:z,target:y,identifier:O,active:Q,x:B[0]+Y,y:B[1]+q,dx:B[0]-F[0],dy:B[1]-F[1],dispatch:W}),k)}}return y.filter=function(R){return arguments.length?(t=typeof R=="function"?R:Hd(!!R),y):t},y.container=function(R){return arguments.length?(e=typeof R=="function"?R:Hd(R),y):e},y.subject=function(R){return arguments.length?(n=typeof R=="function"?R:Hd(R),y):n},y.touchable=function(R){return arguments.length?(o=typeof R=="function"?R:Hd(!!R),y):o},y.on=function(){var R=i.on.apply(i,arguments);return R===i?y:R},y.clickDistance=function(R){return arguments.length?(m=(R=+R)*R,y):Math.sqrt(m)},y}function jy(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function FN(t,e){var n=Object.create(t.prototype);for(var o in e)n[o]=e[o];return n}function cu(){}var Pc=.7,Cf=1/Pc,qi="\\s*([+-]?\\d+)\\s*",$c="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Er="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",O9=/^#([0-9a-f]{3,8})$/,z9=new RegExp(`^rgb\\(${qi},${qi},${qi}\\)$`),I9=new RegExp(`^rgb\\(${Er},${Er},${Er}\\)$`),P9=new RegExp(`^rgba\\(${qi},${qi},${qi},${$c}\\)$`),$9=new RegExp(`^rgba\\(${Er},${Er},${Er},${$c}\\)$`),L9=new RegExp(`^hsl\\(${$c},${Er},${Er}\\)$`),H9=new RegExp(`^hsla\\(${$c},${Er},${Er},${$c}\\)$`),oS={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};jy(cu,Fa,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:rS,formatHex:rS,formatHex8:B9,formatHsl:F9,formatRgb:sS,toString:sS});function rS(){return this.rgb().formatHex()}function B9(){return this.rgb().formatHex8()}function F9(){return VN(this).formatHsl()}function sS(){return this.rgb().formatRgb()}function Fa(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=O9.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?aS(e):n===3?new io(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?Bd(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?Bd(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=z9.exec(t))?new io(e[1],e[2],e[3],1):(e=I9.exec(t))?new io(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=P9.exec(t))?Bd(e[1],e[2],e[3],e[4]):(e=$9.exec(t))?Bd(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=L9.exec(t))?cS(e[1],e[2]/100,e[3]/100,1):(e=H9.exec(t))?cS(e[1],e[2]/100,e[3]/100,e[4]):oS.hasOwnProperty(t)?aS(oS[t]):t==="transparent"?new io(NaN,NaN,NaN,0):null}function aS(t){return new io(t>>16&255,t>>8&255,t&255,1)}function Bd(t,e,n,o){return o<=0&&(t=e=n=NaN),new io(t,e,n,o)}function V9(t){return t instanceof cu||(t=Fa(t)),t?(t=t.rgb(),new io(t.r,t.g,t.b,t.opacity)):new io}function r0(t,e,n,o){return arguments.length===1?V9(t):new io(t,e,n,o??1)}function io(t,e,n,o){this.r=+t,this.g=+e,this.b=+n,this.opacity=+o}jy(io,r0,FN(cu,{brighter(t){return t=t==null?Cf:Math.pow(Cf,t),new io(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Pc:Math.pow(Pc,t),new io(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new io(Ia(this.r),Ia(this.g),Ia(this.b),Ef(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:iS,formatHex:iS,formatHex8:U9,formatRgb:lS,toString:lS}));function iS(){return`#${Oa(this.r)}${Oa(this.g)}${Oa(this.b)}`}function U9(){return`#${Oa(this.r)}${Oa(this.g)}${Oa(this.b)}${Oa((isNaN(this.opacity)?1:this.opacity)*255)}`}function lS(){const t=Ef(this.opacity);return`${t===1?"rgb(":"rgba("}${Ia(this.r)}, ${Ia(this.g)}, ${Ia(this.b)}${t===1?")":`, ${t})`}`}function Ef(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Ia(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Oa(t){return t=Ia(t),(t<16?"0":"")+t.toString(16)}function cS(t,e,n,o){return o<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Zo(t,e,n,o)}function VN(t){if(t instanceof Zo)return new Zo(t.h,t.s,t.l,t.opacity);if(t instanceof cu||(t=Fa(t)),!t)return new Zo;if(t instanceof Zo)return t;t=t.rgb();var e=t.r/255,n=t.g/255,o=t.b/255,s=Math.min(e,n,o),i=Math.max(e,n,o),l=NaN,u=i-s,d=(i+s)/2;return u?(e===i?l=(n-o)/u+(n<o)*6:n===i?l=(o-e)/u+2:l=(e-n)/u+4,u/=d<.5?i+s:2-i-s,l*=60):u=d>0&&d<1?0:l,new Zo(l,u,d,t.opacity)}function Y9(t,e,n,o){return arguments.length===1?VN(t):new Zo(t,e,n,o??1)}function Zo(t,e,n,o){this.h=+t,this.s=+e,this.l=+n,this.opacity=+o}jy(Zo,Y9,FN(cu,{brighter(t){return t=t==null?Cf:Math.pow(Cf,t),new Zo(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Pc:Math.pow(Pc,t),new Zo(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,o=n+(n<.5?n:1-n)*e,s=2*n-o;return new io(ip(t>=240?t-240:t+120,s,o),ip(t,s,o),ip(t<120?t+240:t-120,s,o),this.opacity)},clamp(){return new Zo(uS(this.h),Fd(this.s),Fd(this.l),Ef(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=Ef(this.opacity);return`${t===1?"hsl(":"hsla("}${uS(this.h)}, ${Fd(this.s)*100}%, ${Fd(this.l)*100}%${t===1?")":`, ${t})`}`}}));function uS(t){return t=(t||0)%360,t<0?t+360:t}function Fd(t){return Math.max(0,Math.min(1,t||0))}function ip(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}const Ay=t=>()=>t;function G9(t,e){return function(n){return t+n*e}}function q9(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(o){return Math.pow(t+o*e,n)}}function W9(t){return(t=+t)==1?UN:function(e,n){return n-e?q9(e,n,t):Ay(isNaN(e)?n:e)}}function UN(t,e){var n=e-t;return n?G9(t,n):Ay(isNaN(t)?e:t)}const _f=(function t(e){var n=W9(e);function o(s,i){var l=n((s=r0(s)).r,(i=r0(i)).r),u=n(s.g,i.g),d=n(s.b,i.b),f=UN(s.opacity,i.opacity);return function(g){return s.r=l(g),s.g=u(g),s.b=d(g),s.opacity=f(g),s+""}}return o.gamma=t,o})(1);function K9(t,e){e||(e=[]);var n=t?Math.min(e.length,t.length):0,o=e.slice(),s;return function(i){for(s=0;s<n;++s)o[s]=t[s]*(1-i)+e[s]*i;return o}}function X9(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Q9(t,e){var n=e?e.length:0,o=t?Math.min(n,t.length):0,s=new Array(o),i=new Array(n),l;for(l=0;l<o;++l)s[l]=Mc(t[l],e[l]);for(;l<n;++l)i[l]=e[l];return function(u){for(l=0;l<o;++l)i[l]=s[l](u);return i}}function Z9(t,e){var n=new Date;return t=+t,e=+e,function(o){return n.setTime(t*(1-o)+e*o),n}}function yr(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function J9(t,e){var n={},o={},s;(t===null||typeof t!="object")&&(t={}),(e===null||typeof e!="object")&&(e={});for(s in e)s in t?n[s]=Mc(t[s],e[s]):o[s]=e[s];return function(i){for(s in n)o[s]=n[s](i);return o}}var s0=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,lp=new RegExp(s0.source,"g");function e$(t){return function(){return t}}function t$(t){return function(e){return t(e)+""}}function YN(t,e){var n=s0.lastIndex=lp.lastIndex=0,o,s,i,l=-1,u=[],d=[];for(t=t+"",e=e+"";(o=s0.exec(t))&&(s=lp.exec(e));)(i=s.index)>n&&(i=e.slice(n,i),u[l]?u[l]+=i:u[++l]=i),(o=o[0])===(s=s[0])?u[l]?u[l]+=s:u[++l]=s:(u[++l]=null,d.push({i:l,x:yr(o,s)})),n=lp.lastIndex;return n<e.length&&(i=e.slice(n),u[l]?u[l]+=i:u[++l]=i),u.length<2?d[0]?t$(d[0].x):e$(e):(e=d.length,function(f){for(var g=0,m;g<e;++g)u[(m=d[g]).i]=m.x(f);return u.join("")})}function Mc(t,e){var n=typeof e,o;return e==null||n==="boolean"?Ay(e):(n==="number"?yr:n==="string"?(o=Fa(e))?(e=o,_f):YN:e instanceof Fa?_f:e instanceof Date?Z9:X9(e)?K9:Array.isArray(e)?Q9:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?J9:yr)(t,e)}var dS=180/Math.PI,a0={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function GN(t,e,n,o,s,i){var l,u,d;return(l=Math.sqrt(t*t+e*e))&&(t/=l,e/=l),(d=t*n+e*o)&&(n-=t*d,o-=e*d),(u=Math.sqrt(n*n+o*o))&&(n/=u,o/=u,d/=u),t*o<e*n&&(t=-t,e=-e,d=-d,l=-l),{translateX:s,translateY:i,rotate:Math.atan2(e,t)*dS,skewX:Math.atan(d)*dS,scaleX:l,scaleY:u}}var Vd;function n$(t){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?a0:GN(e.a,e.b,e.c,e.d,e.e,e.f)}function o$(t){return t==null||(Vd||(Vd=document.createElementNS("http://www.w3.org/2000/svg","g")),Vd.setAttribute("transform",t),!(t=Vd.transform.baseVal.consolidate()))?a0:(t=t.matrix,GN(t.a,t.b,t.c,t.d,t.e,t.f))}function qN(t,e,n,o){function s(f){return f.length?f.pop()+" ":""}function i(f,g,m,y,v,w){if(f!==m||g!==y){var C=v.push("translate(",null,e,null,n);w.push({i:C-4,x:yr(f,m)},{i:C-2,x:yr(g,y)})}else(m||y)&&v.push("translate("+m+e+y+n)}function l(f,g,m,y){f!==g?(f-g>180?g+=360:g-f>180&&(f+=360),y.push({i:m.push(s(m)+"rotate(",null,o)-2,x:yr(f,g)})):g&&m.push(s(m)+"rotate("+g+o)}function u(f,g,m,y){f!==g?y.push({i:m.push(s(m)+"skewX(",null,o)-2,x:yr(f,g)}):g&&m.push(s(m)+"skewX("+g+o)}function d(f,g,m,y,v,w){if(f!==m||g!==y){var C=v.push(s(v)+"scale(",null,",",null,")");w.push({i:C-4,x:yr(f,m)},{i:C-2,x:yr(g,y)})}else(m!==1||y!==1)&&v.push(s(v)+"scale("+m+","+y+")")}return function(f,g){var m=[],y=[];return f=t(f),g=t(g),i(f.translateX,f.translateY,g.translateX,g.translateY,m,y),l(f.rotate,g.rotate,m,y),u(f.skewX,g.skewX,m,y),d(f.scaleX,f.scaleY,g.scaleX,g.scaleY,m,y),f=g=null,function(v){for(var w=-1,C=y.length,S;++w<C;)m[(S=y[w]).i]=S.x(v);return m.join("")}}}var r$=qN(n$,"px, ","px)","deg)"),s$=qN(o$,", ",")",")"),a$=1e-12;function fS(t){return((t=Math.exp(t))+1/t)/2}function i$(t){return((t=Math.exp(t))-1/t)/2}function l$(t){return((t=Math.exp(2*t))-1)/(t+1)}const rf=(function t(e,n,o){function s(i,l){var u=i[0],d=i[1],f=i[2],g=l[0],m=l[1],y=l[2],v=g-u,w=m-d,C=v*v+w*w,S,N;if(C<a$)N=Math.log(y/f)/e,S=function(k){return[u+k*v,d+k*w,f*Math.exp(e*k*N)]};else{var M=Math.sqrt(C),E=(y*y-f*f+o*C)/(2*f*n*M),R=(y*y-f*f-o*C)/(2*y*n*M),D=Math.log(Math.sqrt(E*E+1)-E),T=Math.log(Math.sqrt(R*R+1)-R);N=(T-D)/e,S=function(k){var O=k*N,L=fS(D),W=f/(n*M)*(L*l$(e*O+D)-i$(D));return[u+W*v,d+W*w,f*L/fS(e*O+D)]}}return S.duration=N*1e3*e/Math.SQRT2,S}return s.rho=function(i){var l=Math.max(.001,+i),u=l*l,d=u*u;return t(l,u,d)},s})(Math.SQRT2,2,4);var Ji=0,Cc=0,gc=0,WN=1e3,Nf,Ec,Mf=0,Va=0,dh=0,Lc=typeof performance=="object"&&performance.now?performance:Date,KN=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Oy(){return Va||(KN(c$),Va=Lc.now()+dh)}function c$(){Va=0}function Rf(){this._call=this._time=this._next=null}Rf.prototype=XN.prototype={constructor:Rf,restart:function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?Oy():+n)+(e==null?0:+e),!this._next&&Ec!==this&&(Ec?Ec._next=this:Nf=this,Ec=this),this._call=t,this._time=n,i0()},stop:function(){this._call&&(this._call=null,this._time=1/0,i0())}};function XN(t,e,n){var o=new Rf;return o.restart(t,e,n),o}function u$(){Oy(),++Ji;for(var t=Nf,e;t;)(e=Va-t._time)>=0&&t._call.call(void 0,e),t=t._next;--Ji}function hS(){Va=(Mf=Lc.now())+dh,Ji=Cc=0;try{u$()}finally{Ji=0,f$(),Va=0}}function d$(){var t=Lc.now(),e=t-Mf;e>WN&&(dh-=e,Mf=t)}function f$(){for(var t,e=Nf,n,o=1/0;e;)e._call?(o>e._time&&(o=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:Nf=n);Ec=t,i0(o)}function i0(t){if(!Ji){Cc&&(Cc=clearTimeout(Cc));var e=t-Va;e>24?(t<1/0&&(Cc=setTimeout(hS,t-Lc.now()-dh)),gc&&(gc=clearInterval(gc))):(gc||(Mf=Lc.now(),gc=setInterval(d$,WN)),Ji=1,KN(hS))}}function mS(t,e,n){var o=new Rf;return e=e==null?0:+e,o.restart(s=>{o.stop(),t(s+e)},e,n),o}var h$=ch("start","end","cancel","interrupt"),m$=[],QN=0,gS=1,l0=2,sf=3,pS=4,c0=5,af=6;function fh(t,e,n,o,s,i){var l=t.__transition;if(!l)t.__transition={};else if(n in l)return;g$(t,n,{name:e,index:o,group:s,on:h$,tween:m$,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:QN})}function zy(t,e){var n=lr(t,e);if(n.state>QN)throw new Error("too late; already scheduled");return n}function jr(t,e){var n=lr(t,e);if(n.state>sf)throw new Error("too late; already running");return n}function lr(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function g$(t,e,n){var o=t.__transition,s;o[e]=n,n.timer=XN(i,0,n.time);function i(f){n.state=gS,n.timer.restart(l,n.delay,n.time),n.delay<=f&&l(f-n.delay)}function l(f){var g,m,y,v;if(n.state!==gS)return d();for(g in o)if(v=o[g],v.name===n.name){if(v.state===sf)return mS(l);v.state===pS?(v.state=af,v.timer.stop(),v.on.call("interrupt",t,t.__data__,v.index,v.group),delete o[g]):+g<e&&(v.state=af,v.timer.stop(),v.on.call("cancel",t,t.__data__,v.index,v.group),delete o[g])}if(mS(function(){n.state===sf&&(n.state=pS,n.timer.restart(u,n.delay,n.time),u(f))}),n.state=l0,n.on.call("start",t,t.__data__,n.index,n.group),n.state===l0){for(n.state=sf,s=new Array(y=n.tween.length),g=0,m=-1;g<y;++g)(v=n.tween[g].value.call(t,t.__data__,n.index,n.group))&&(s[++m]=v);s.length=m+1}}function u(f){for(var g=f<n.duration?n.ease.call(null,f/n.duration):(n.timer.restart(d),n.state=c0,1),m=-1,y=s.length;++m<y;)s[m].call(t,g);n.state===c0&&(n.on.call("end",t,t.__data__,n.index,n.group),d())}function d(){n.state=af,n.timer.stop(),delete o[e];for(var f in o)return;delete t.__transition}}function lf(t,e){var n=t.__transition,o,s,i=!0,l;if(n){e=e==null?null:e+"";for(l in n){if((o=n[l]).name!==e){i=!1;continue}s=o.state>l0&&o.state<c0,o.state=af,o.timer.stop(),o.on.call(s?"interrupt":"cancel",t,t.__data__,o.index,o.group),delete n[l]}i&&delete t.__transition}}function p$(t){return this.each(function(){lf(this,t)})}function y$(t,e){var n,o;return function(){var s=jr(this,t),i=s.tween;if(i!==n){o=n=i;for(var l=0,u=o.length;l<u;++l)if(o[l].name===e){o=o.slice(),o.splice(l,1);break}}s.tween=o}}function v$(t,e,n){var o,s;if(typeof n!="function")throw new Error;return function(){var i=jr(this,t),l=i.tween;if(l!==o){s=(o=l).slice();for(var u={name:e,value:n},d=0,f=s.length;d<f;++d)if(s[d].name===e){s[d]=u;break}d===f&&s.push(u)}i.tween=s}}function x$(t,e){var n=this._id;if(t+="",arguments.length<2){for(var o=lr(this.node(),n).tween,s=0,i=o.length,l;s<i;++s)if((l=o[s]).name===t)return l.value;return null}return this.each((e==null?y$:v$)(n,t,e))}function Iy(t,e,n){var o=t._id;return t.each(function(){var s=jr(this,o);(s.value||(s.value={}))[e]=n.apply(this,arguments)}),function(s){return lr(s,o).value[e]}}function ZN(t,e){var n;return(typeof e=="number"?yr:e instanceof Fa?_f:(n=Fa(e))?(e=n,_f):YN)(t,e)}function b$(t){return function(){this.removeAttribute(t)}}function w$(t){return function(){this.removeAttributeNS(t.space,t.local)}}function S$(t,e,n){var o,s=n+"",i;return function(){var l=this.getAttribute(t);return l===s?null:l===o?i:i=e(o=l,n)}}function C$(t,e,n){var o,s=n+"",i;return function(){var l=this.getAttributeNS(t.space,t.local);return l===s?null:l===o?i:i=e(o=l,n)}}function E$(t,e,n){var o,s,i;return function(){var l,u=n(this),d;return u==null?void this.removeAttribute(t):(l=this.getAttribute(t),d=u+"",l===d?null:l===o&&d===s?i:(s=d,i=e(o=l,u)))}}function _$(t,e,n){var o,s,i;return function(){var l,u=n(this),d;return u==null?void this.removeAttributeNS(t.space,t.local):(l=this.getAttributeNS(t.space,t.local),d=u+"",l===d?null:l===o&&d===s?i:(s=d,i=e(o=l,u)))}}function N$(t,e){var n=uh(t),o=n==="transform"?s$:ZN;return this.attrTween(t,typeof e=="function"?(n.local?_$:E$)(n,o,Iy(this,"attr."+t,e)):e==null?(n.local?w$:b$)(n):(n.local?C$:S$)(n,o,e))}function M$(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function R$(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function D$(t,e){var n,o;function s(){var i=e.apply(this,arguments);return i!==o&&(n=(o=i)&&R$(t,i)),n}return s._value=e,s}function T$(t,e){var n,o;function s(){var i=e.apply(this,arguments);return i!==o&&(n=(o=i)&&M$(t,i)),n}return s._value=e,s}function k$(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;var o=uh(t);return this.tween(n,(o.local?D$:T$)(o,e))}function j$(t,e){return function(){zy(this,t).delay=+e.apply(this,arguments)}}function A$(t,e){return e=+e,function(){zy(this,t).delay=e}}function O$(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?j$:A$)(e,t)):lr(this.node(),e).delay}function z$(t,e){return function(){jr(this,t).duration=+e.apply(this,arguments)}}function I$(t,e){return e=+e,function(){jr(this,t).duration=e}}function P$(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?z$:I$)(e,t)):lr(this.node(),e).duration}function $$(t,e){if(typeof e!="function")throw new Error;return function(){jr(this,t).ease=e}}function L$(t){var e=this._id;return arguments.length?this.each($$(e,t)):lr(this.node(),e).ease}function H$(t,e){return function(){var n=e.apply(this,arguments);if(typeof n!="function")throw new Error;jr(this,t).ease=n}}function B$(t){if(typeof t!="function")throw new Error;return this.each(H$(this._id,t))}function F$(t){typeof t!="function"&&(t=DN(t));for(var e=this._groups,n=e.length,o=new Array(n),s=0;s<n;++s)for(var i=e[s],l=i.length,u=o[s]=[],d,f=0;f<l;++f)(d=i[f])&&t.call(d,d.__data__,f,i)&&u.push(d);return new ps(o,this._parents,this._name,this._id)}function V$(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,o=e.length,s=n.length,i=Math.min(o,s),l=new Array(o),u=0;u<i;++u)for(var d=e[u],f=n[u],g=d.length,m=l[u]=new Array(g),y,v=0;v<g;++v)(y=d[v]||f[v])&&(m[v]=y);for(;u<o;++u)l[u]=e[u];return new ps(l,this._parents,this._name,this._id)}function U$(t){return(t+"").trim().split(/^|\s+/).every(function(e){var n=e.indexOf(".");return n>=0&&(e=e.slice(0,n)),!e||e==="start"})}function Y$(t,e,n){var o,s,i=U$(e)?zy:jr;return function(){var l=i(this,t),u=l.on;u!==o&&(s=(o=u).copy()).on(e,n),l.on=s}}function G$(t,e){var n=this._id;return arguments.length<2?lr(this.node(),n).on.on(t):this.each(Y$(n,t,e))}function q$(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}function W$(){return this.on("end.remove",q$(this._id))}function K$(t){var e=this._name,n=this._id;typeof t!="function"&&(t=Ty(t));for(var o=this._groups,s=o.length,i=new Array(s),l=0;l<s;++l)for(var u=o[l],d=u.length,f=i[l]=new Array(d),g,m,y=0;y<d;++y)(g=u[y])&&(m=t.call(g,g.__data__,y,u))&&("__data__"in g&&(m.__data__=g.__data__),f[y]=m,fh(f[y],e,n,y,f,lr(g,n)));return new ps(i,this._parents,e,n)}function X$(t){var e=this._name,n=this._id;typeof t!="function"&&(t=RN(t));for(var o=this._groups,s=o.length,i=[],l=[],u=0;u<s;++u)for(var d=o[u],f=d.length,g,m=0;m<f;++m)if(g=d[m]){for(var y=t.call(g,g.__data__,m,d),v,w=lr(g,n),C=0,S=y.length;C<S;++C)(v=y[C])&&fh(v,e,n,C,y,w);i.push(y),l.push(g)}return new ps(i,l,e,n)}var Q$=lu.prototype.constructor;function Z$(){return new Q$(this._groups,this._parents)}function J$(t,e){var n,o,s;return function(){var i=Zi(this,t),l=(this.style.removeProperty(t),Zi(this,t));return i===l?null:i===n&&l===o?s:s=e(n=i,o=l)}}function JN(t){return function(){this.style.removeProperty(t)}}function eL(t,e,n){var o,s=n+"",i;return function(){var l=Zi(this,t);return l===s?null:l===o?i:i=e(o=l,n)}}function tL(t,e,n){var o,s,i;return function(){var l=Zi(this,t),u=n(this),d=u+"";return u==null&&(d=u=(this.style.removeProperty(t),Zi(this,t))),l===d?null:l===o&&d===s?i:(s=d,i=e(o=l,u))}}function nL(t,e){var n,o,s,i="style."+e,l="end."+i,u;return function(){var d=jr(this,t),f=d.on,g=d.value[i]==null?u||(u=JN(e)):void 0;(f!==n||s!==g)&&(o=(n=f).copy()).on(l,s=g),d.on=o}}function oL(t,e,n){var o=(t+="")=="transform"?r$:ZN;return e==null?this.styleTween(t,J$(t,o)).on("end.style."+t,JN(t)):typeof e=="function"?this.styleTween(t,tL(t,o,Iy(this,"style."+t,e))).each(nL(this._id,t)):this.styleTween(t,eL(t,o,e),n).on("end.style."+t,null)}function rL(t,e,n){return function(o){this.style.setProperty(t,e.call(this,o),n)}}function sL(t,e,n){var o,s;function i(){var l=e.apply(this,arguments);return l!==s&&(o=(s=l)&&rL(t,l,n)),o}return i._value=e,i}function aL(t,e,n){var o="style."+(t+="");if(arguments.length<2)return(o=this.tween(o))&&o._value;if(e==null)return this.tween(o,null);if(typeof e!="function")throw new Error;return this.tween(o,sL(t,e,n??""))}function iL(t){return function(){this.textContent=t}}function lL(t){return function(){var e=t(this);this.textContent=e??""}}function cL(t){return this.tween("text",typeof t=="function"?lL(Iy(this,"text",t)):iL(t==null?"":t+""))}function uL(t){return function(e){this.textContent=t.call(this,e)}}function dL(t){var e,n;function o(){var s=t.apply(this,arguments);return s!==n&&(e=(n=s)&&uL(s)),e}return o._value=t,o}function fL(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(t==null)return this.tween(e,null);if(typeof t!="function")throw new Error;return this.tween(e,dL(t))}function hL(){for(var t=this._name,e=this._id,n=eM(),o=this._groups,s=o.length,i=0;i<s;++i)for(var l=o[i],u=l.length,d,f=0;f<u;++f)if(d=l[f]){var g=lr(d,e);fh(d,t,n,f,l,{time:g.time+g.delay+g.duration,delay:0,duration:g.duration,ease:g.ease})}return new ps(o,this._parents,t,n)}function mL(){var t,e,n=this,o=n._id,s=n.size();return new Promise(function(i,l){var u={value:l},d={value:function(){--s===0&&i()}};n.each(function(){var f=jr(this,o),g=f.on;g!==t&&(e=(t=g).copy(),e._.cancel.push(u),e._.interrupt.push(u),e._.end.push(d)),f.on=e}),s===0&&i()})}var gL=0;function ps(t,e,n,o){this._groups=t,this._parents=e,this._name=n,this._id=o}function eM(){return++gL}var ns=lu.prototype;ps.prototype={constructor:ps,select:K$,selectAll:X$,selectChild:ns.selectChild,selectChildren:ns.selectChildren,filter:F$,merge:V$,selection:Z$,transition:hL,call:ns.call,nodes:ns.nodes,node:ns.node,size:ns.size,empty:ns.empty,each:ns.each,on:G$,attr:N$,attrTween:k$,style:oL,styleTween:aL,text:cL,textTween:fL,remove:W$,tween:x$,delay:O$,duration:P$,ease:L$,easeVarying:B$,end:mL,[Symbol.iterator]:ns[Symbol.iterator]};function pL(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var yL={time:null,delay:0,duration:250,ease:pL};function vL(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return n}function xL(t){var e,n;t instanceof ps?(e=t._id,t=t._name):(e=eM(),(n=yL).time=Oy(),t=t==null?null:t+"");for(var o=this._groups,s=o.length,i=0;i<s;++i)for(var l=o[i],u=l.length,d,f=0;f<u;++f)(d=l[f])&&fh(d,t,e,f,l,n||vL(d,e));return new ps(o,this._parents,t,e)}lu.prototype.interrupt=p$;lu.prototype.transition=xL;const Ud=t=>()=>t;function bL(t,{sourceEvent:e,target:n,transform:o,dispatch:s}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:o,enumerable:!0,configurable:!0},_:{value:s}})}function ss(t,e,n){this.k=t,this.x=e,this.y=n}ss.prototype={constructor:ss,scale:function(t){return t===1?this:new ss(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new ss(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var hh=new ss(1,0,0);tM.prototype=ss.prototype;function tM(t){for(;!t.__zoom;)if(!(t=t.parentNode))return hh;return t.__zoom}function cp(t){t.stopImmediatePropagation()}function pc(t){t.preventDefault(),t.stopImmediatePropagation()}function wL(t){return(!t.ctrlKey||t.type==="wheel")&&!t.button}function SL(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t,t.hasAttribute("viewBox")?(t=t.viewBox.baseVal,[[t.x,t.y],[t.x+t.width,t.y+t.height]]):[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]):[[0,0],[t.clientWidth,t.clientHeight]]}function yS(){return this.__zoom||hh}function CL(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function EL(){return navigator.maxTouchPoints||"ontouchstart"in this}function _L(t,e,n){var o=t.invertX(e[0][0])-n[0][0],s=t.invertX(e[1][0])-n[1][0],i=t.invertY(e[0][1])-n[0][1],l=t.invertY(e[1][1])-n[1][1];return t.translate(s>o?(o+s)/2:Math.min(0,o)||Math.max(0,s),l>i?(i+l)/2:Math.min(0,i)||Math.max(0,l))}function nM(){var t=wL,e=SL,n=_L,o=CL,s=EL,i=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],u=250,d=rf,f=ch("start","zoom","end"),g,m,y,v=500,w=150,C=0,S=10;function N(z){z.property("__zoom",yS).on("wheel.zoom",O,{passive:!1}).on("mousedown.zoom",L).on("dblclick.zoom",W).filter(s).on("touchstart.zoom",B).on("touchmove.zoom",Y).on("touchend.zoom touchcancel.zoom",q).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}N.transform=function(z,V,A,H){var P=z.selection?z.selection():z;P.property("__zoom",yS),z!==P?D(z,V,A,H):P.interrupt().each(function(){T(this,arguments).event(H).start().zoom(null,typeof V=="function"?V.apply(this,arguments):V).end()})},N.scaleBy=function(z,V,A,H){N.scaleTo(z,function(){var P=this.__zoom.k,F=typeof V=="function"?V.apply(this,arguments):V;return P*F},A,H)},N.scaleTo=function(z,V,A,H){N.transform(z,function(){var P=e.apply(this,arguments),F=this.__zoom,Q=A==null?R(P):typeof A=="function"?A.apply(this,arguments):A,$=F.invert(Q),I=typeof V=="function"?V.apply(this,arguments):V;return n(E(M(F,I),Q,$),P,l)},A,H)},N.translateBy=function(z,V,A,H){N.transform(z,function(){return n(this.__zoom.translate(typeof V=="function"?V.apply(this,arguments):V,typeof A=="function"?A.apply(this,arguments):A),e.apply(this,arguments),l)},null,H)},N.translateTo=function(z,V,A,H,P){N.transform(z,function(){var F=e.apply(this,arguments),Q=this.__zoom,$=H==null?R(F):typeof H=="function"?H.apply(this,arguments):H;return n(hh.translate($[0],$[1]).scale(Q.k).translate(typeof V=="function"?-V.apply(this,arguments):-V,typeof A=="function"?-A.apply(this,arguments):-A),F,l)},H,P)};function M(z,V){return V=Math.max(i[0],Math.min(i[1],V)),V===z.k?z:new ss(V,z.x,z.y)}function E(z,V,A){var H=V[0]-A[0]*z.k,P=V[1]-A[1]*z.k;return H===z.x&&P===z.y?z:new ss(z.k,H,P)}function R(z){return[(+z[0][0]+ +z[1][0])/2,(+z[0][1]+ +z[1][1])/2]}function D(z,V,A,H){z.on("start.zoom",function(){T(this,arguments).event(H).start()}).on("interrupt.zoom end.zoom",function(){T(this,arguments).event(H).end()}).tween("zoom",function(){var P=this,F=arguments,Q=T(P,F).event(H),$=e.apply(P,F),I=A==null?R($):typeof A=="function"?A.apply(P,F):A,U=Math.max($[1][0]-$[0][0],$[1][1]-$[0][1]),K=P.__zoom,J=typeof V=="function"?V.apply(P,F):V,ne=d(K.invert(I).concat(U/K.k),J.invert(I).concat(U/J.k));return function(X){if(X===1)X=J;else{var ee=ne(X),se=U/ee[2];X=new ss(se,I[0]-ee[0]*se,I[1]-ee[1]*se)}Q.zoom(null,X)}})}function T(z,V,A){return!A&&z.__zooming||new k(z,V)}function k(z,V){this.that=z,this.args=V,this.active=0,this.sourceEvent=null,this.extent=e.apply(z,V),this.taps=0}k.prototype={event:function(z){return z&&(this.sourceEvent=z),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(z,V){return this.mouse&&z!=="mouse"&&(this.mouse[1]=V.invert(this.mouse[0])),this.touch0&&z!=="touch"&&(this.touch0[1]=V.invert(this.touch0[0])),this.touch1&&z!=="touch"&&(this.touch1[1]=V.invert(this.touch1[0])),this.that.__zoom=V,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(z){var V=So(this.that).datum();f.call(z,this.that,new bL(z,{sourceEvent:this.sourceEvent,target:N,transform:this.that.__zoom,dispatch:f}),V)}};function O(z,...V){if(!t.apply(this,arguments))return;var A=T(this,V).event(z),H=this.__zoom,P=Math.max(i[0],Math.min(i[1],H.k*Math.pow(2,o.apply(this,arguments)))),F=Qo(z);if(A.wheel)(A.mouse[0][0]!==F[0]||A.mouse[0][1]!==F[1])&&(A.mouse[1]=H.invert(A.mouse[0]=F)),clearTimeout(A.wheel);else{if(H.k===P)return;A.mouse=[F,H.invert(F)],lf(this),A.start()}pc(z),A.wheel=setTimeout(Q,w),A.zoom("mouse",n(E(M(H,P),A.mouse[0],A.mouse[1]),A.extent,l));function Q(){A.wheel=null,A.end()}}function L(z,...V){if(y||!t.apply(this,arguments))return;var A=z.currentTarget,H=T(this,V,!0).event(z),P=So(z.view).on("mousemove.zoom",I,!0).on("mouseup.zoom",U,!0),F=Qo(z,A),Q=z.clientX,$=z.clientY;LN(z.view),cp(z),H.mouse=[F,this.__zoom.invert(F)],lf(this),H.start();function I(K){if(pc(K),!H.moved){var J=K.clientX-Q,ne=K.clientY-$;H.moved=J*J+ne*ne>C}H.event(K).zoom("mouse",n(E(H.that.__zoom,H.mouse[0]=Qo(K,A),H.mouse[1]),H.extent,l))}function U(K){P.on("mousemove.zoom mouseup.zoom",null),HN(K.view,H.moved),pc(K),H.event(K).end()}}function W(z,...V){if(t.apply(this,arguments)){var A=this.__zoom,H=Qo(z.changedTouches?z.changedTouches[0]:z,this),P=A.invert(H),F=A.k*(z.shiftKey?.5:2),Q=n(E(M(A,F),H,P),e.apply(this,V),l);pc(z),u>0?So(this).transition().duration(u).call(D,Q,H,z):So(this).call(N.transform,Q,H,z)}}function B(z,...V){if(t.apply(this,arguments)){var A=z.touches,H=A.length,P=T(this,V,z.changedTouches.length===H).event(z),F,Q,$,I;for(cp(z),Q=0;Q<H;++Q)$=A[Q],I=Qo($,this),I=[I,this.__zoom.invert(I),$.identifier],P.touch0?!P.touch1&&P.touch0[2]!==I[2]&&(P.touch1=I,P.taps=0):(P.touch0=I,F=!0,P.taps=1+!!g);g&&(g=clearTimeout(g)),F&&(P.taps<2&&(m=I[0],g=setTimeout(function(){g=null},v)),lf(this),P.start())}}function Y(z,...V){if(this.__zooming){var A=T(this,V).event(z),H=z.changedTouches,P=H.length,F,Q,$,I;for(pc(z),F=0;F<P;++F)Q=H[F],$=Qo(Q,this),A.touch0&&A.touch0[2]===Q.identifier?A.touch0[0]=$:A.touch1&&A.touch1[2]===Q.identifier&&(A.touch1[0]=$);if(Q=A.that.__zoom,A.touch1){var U=A.touch0[0],K=A.touch0[1],J=A.touch1[0],ne=A.touch1[1],X=(X=J[0]-U[0])*X+(X=J[1]-U[1])*X,ee=(ee=ne[0]-K[0])*ee+(ee=ne[1]-K[1])*ee;Q=M(Q,Math.sqrt(X/ee)),$=[(U[0]+J[0])/2,(U[1]+J[1])/2],I=[(K[0]+ne[0])/2,(K[1]+ne[1])/2]}else if(A.touch0)$=A.touch0[0],I=A.touch0[1];else return;A.zoom("touch",n(E(Q,$,I),A.extent,l))}}function q(z,...V){if(this.__zooming){var A=T(this,V).event(z),H=z.changedTouches,P=H.length,F,Q;for(cp(z),y&&clearTimeout(y),y=setTimeout(function(){y=null},v),F=0;F<P;++F)Q=H[F],A.touch0&&A.touch0[2]===Q.identifier?delete A.touch0:A.touch1&&A.touch1[2]===Q.identifier&&delete A.touch1;if(A.touch1&&!A.touch0&&(A.touch0=A.touch1,delete A.touch1),A.touch0)A.touch0[1]=this.__zoom.invert(A.touch0[0]);else if(A.end(),A.taps===2&&(Q=Qo(Q,this),Math.hypot(m[0]-Q[0],m[1]-Q[1])<S)){var $=So(this).on("dblclick.zoom");$&&$.apply(this,arguments)}}}return N.wheelDelta=function(z){return arguments.length?(o=typeof z=="function"?z:Ud(+z),N):o},N.filter=function(z){return arguments.length?(t=typeof z=="function"?z:Ud(!!z),N):t},N.touchable=function(z){return arguments.length?(s=typeof z=="function"?z:Ud(!!z),N):s},N.extent=function(z){return arguments.length?(e=typeof z=="function"?z:Ud([[+z[0][0],+z[0][1]],[+z[1][0],+z[1][1]]]),N):e},N.scaleExtent=function(z){return arguments.length?(i[0]=+z[0],i[1]=+z[1],N):[i[0],i[1]]},N.translateExtent=function(z){return arguments.length?(l[0][0]=+z[0][0],l[1][0]=+z[1][0],l[0][1]=+z[0][1],l[1][1]=+z[1][1],N):[[l[0][0],l[0][1]],[l[1][0],l[1][1]]]},N.constrain=function(z){return arguments.length?(n=z,N):n},N.duration=function(z){return arguments.length?(u=+z,N):u},N.interpolate=function(z){return arguments.length?(d=z,N):d},N.on=function(){var z=f.on.apply(f,arguments);return z===f?N:z},N.clickDistance=function(z){return arguments.length?(C=(z=+z)*z,N):Math.sqrt(C)},N.tapDistance=function(z){return arguments.length?(S=+z,N):S},N}const Mr={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:t=>`Node type "${t}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:t=>`The old edge with id=${t} does not exist.`,error009:t=>`Marker type "${t}" doesn't exist.`,error008:(t,{id:e,sourceHandle:n,targetHandle:o})=>`Couldn't create edge for ${t} handle id: "${t==="source"?n:o}", edge id: ${e}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:t=>`Edge type "${t}" not found. Using fallback type "default".`,error012:t=>`Node with id "${t}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(t="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${t}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},Hc=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],oM=["Enter"," ","Escape"],rM={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:t,x:e,y:n})=>`Moved selected node ${t}. New position, x: ${e}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var el;(function(t){t.Strict="strict",t.Loose="loose"})(el||(el={}));var Pa;(function(t){t.Free="free",t.Vertical="vertical",t.Horizontal="horizontal"})(Pa||(Pa={}));var Bc;(function(t){t.Partial="partial",t.Full="full"})(Bc||(Bc={}));const sM={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Xs;(function(t){t.Bezier="default",t.Straight="straight",t.Step="step",t.SmoothStep="smoothstep",t.SimpleBezier="simplebezier"})(Xs||(Xs={}));var Df;(function(t){t.Arrow="arrow",t.ArrowClosed="arrowclosed"})(Df||(Df={}));var qe;(function(t){t.Left="left",t.Top="top",t.Right="right",t.Bottom="bottom"})(qe||(qe={}));const vS={[qe.Left]:qe.Right,[qe.Right]:qe.Left,[qe.Top]:qe.Bottom,[qe.Bottom]:qe.Top};function aM(t){return t===null?null:t?"valid":"invalid"}const iM=t=>"id"in t&&"source"in t&&"target"in t,NL=t=>"id"in t&&"position"in t&&!("source"in t)&&!("target"in t),Py=t=>"id"in t&&"internals"in t&&!("source"in t)&&!("target"in t),uu=(t,e=[0,0])=>{const{width:n,height:o}=xs(t),s=t.origin??e,i=n*s[0],l=o*s[1];return{x:t.position.x-i,y:t.position.y-l}},ML=(t,e={nodeOrigin:[0,0]})=>{if(t.length===0)return{x:0,y:0,width:0,height:0};const n=t.reduce((o,s)=>{const i=typeof s=="string";let l=!e.nodeLookup&&!i?s:void 0;e.nodeLookup&&(l=i?e.nodeLookup.get(s):Py(s)?s:e.nodeLookup.get(s.id));const u=l?Tf(l,e.nodeOrigin):{x:0,y:0,x2:0,y2:0};return mh(o,u)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return gh(n)},du=(t,e={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},o=!1;return t.forEach(s=>{(e.filter===void 0||e.filter(s))&&(n=mh(n,Tf(s)),o=!0)}),o?gh(n):{x:0,y:0,width:0,height:0}},$y=(t,e,[n,o,s]=[0,0,1],i=!1,l=!1)=>{const u={...hu(e,[n,o,s]),width:e.width/s,height:e.height/s},d=[];for(const f of t.values()){const{measured:g,selectable:m=!0,hidden:y=!1}=f;if(l&&!m||y)continue;const v=g.width??f.width??f.initialWidth??null,w=g.height??f.height??f.initialHeight??null,C=Fc(u,nl(f)),S=(v??0)*(w??0),N=i&&C>0;(!f.internals.handleBounds||N||C>=S||f.dragging)&&d.push(f)}return d},RL=(t,e)=>{const n=new Set;return t.forEach(o=>{n.add(o.id)}),e.filter(o=>n.has(o.source)||n.has(o.target))};function DL(t,e){const n=new Map,o=e?.nodes?new Set(e.nodes.map(s=>s.id)):null;return t.forEach(s=>{s.measured.width&&s.measured.height&&(e?.includeHiddenNodes||!s.hidden)&&(!o||o.has(s.id))&&n.set(s.id,s)}),n}async function TL({nodes:t,width:e,height:n,panZoom:o,minZoom:s,maxZoom:i},l){if(t.size===0)return Promise.resolve(!0);const u=DL(t,l),d=du(u),f=Ly(d,e,n,l?.minZoom??s,l?.maxZoom??i,l?.padding??.1);return await o.setViewport(f,{duration:l?.duration,ease:l?.ease,interpolate:l?.interpolate}),Promise.resolve(!0)}function lM({nodeId:t,nextPosition:e,nodeLookup:n,nodeOrigin:o=[0,0],nodeExtent:s,onError:i}){const l=n.get(t),u=l.parentId?n.get(l.parentId):void 0,{x:d,y:f}=u?u.internals.positionAbsolute:{x:0,y:0},g=l.origin??o;let m=l.extent||s;if(l.extent==="parent"&&!l.expandParent)if(!u)i?.("005",Mr.error005());else{const v=u.measured.width,w=u.measured.height;v&&w&&(m=[[d,f],[d+v,f+w]])}else u&&ol(l.extent)&&(m=[[l.extent[0][0]+d,l.extent[0][1]+f],[l.extent[1][0]+d,l.extent[1][1]+f]]);const y=ol(m)?Ua(e,m,l.measured):e;return(l.measured.width===void 0||l.measured.height===void 0)&&i?.("015",Mr.error015()),{position:{x:y.x-d+(l.measured.width??0)*g[0],y:y.y-f+(l.measured.height??0)*g[1]},positionAbsolute:y}}async function kL({nodesToRemove:t=[],edgesToRemove:e=[],nodes:n,edges:o,onBeforeDelete:s}){const i=new Set(t.map(y=>y.id)),l=[];for(const y of n){if(y.deletable===!1)continue;const v=i.has(y.id),w=!v&&y.parentId&&l.find(C=>C.id===y.parentId);(v||w)&&l.push(y)}const u=new Set(e.map(y=>y.id)),d=o.filter(y=>y.deletable!==!1),g=RL(l,d);for(const y of d)u.has(y.id)&&!g.find(w=>w.id===y.id)&&g.push(y);if(!s)return{edges:g,nodes:l};const m=await s({nodes:l,edges:g});return typeof m=="boolean"?m?{edges:g,nodes:l}:{edges:[],nodes:[]}:m}const tl=(t,e=0,n=1)=>Math.min(Math.max(t,e),n),Ua=(t={x:0,y:0},e,n)=>({x:tl(t.x,e[0][0],e[1][0]-(n?.width??0)),y:tl(t.y,e[0][1],e[1][1]-(n?.height??0))});function cM(t,e,n){const{width:o,height:s}=xs(n),{x:i,y:l}=n.internals.positionAbsolute;return Ua(t,[[i,l],[i+o,l+s]],e)}const xS=(t,e,n)=>t<e?tl(Math.abs(t-e),1,e)/e:t>n?-tl(Math.abs(t-n),1,e)/e:0,uM=(t,e,n=15,o=40)=>{const s=xS(t.x,o,e.width-o)*n,i=xS(t.y,o,e.height-o)*n;return[s,i]},mh=(t,e)=>({x:Math.min(t.x,e.x),y:Math.min(t.y,e.y),x2:Math.max(t.x2,e.x2),y2:Math.max(t.y2,e.y2)}),u0=({x:t,y:e,width:n,height:o})=>({x:t,y:e,x2:t+n,y2:e+o}),gh=({x:t,y:e,x2:n,y2:o})=>({x:t,y:e,width:n-t,height:o-e}),nl=(t,e=[0,0])=>{const{x:n,y:o}=Py(t)?t.internals.positionAbsolute:uu(t,e);return{x:n,y:o,width:t.measured?.width??t.width??t.initialWidth??0,height:t.measured?.height??t.height??t.initialHeight??0}},Tf=(t,e=[0,0])=>{const{x:n,y:o}=Py(t)?t.internals.positionAbsolute:uu(t,e);return{x:n,y:o,x2:n+(t.measured?.width??t.width??t.initialWidth??0),y2:o+(t.measured?.height??t.height??t.initialHeight??0)}},dM=(t,e)=>gh(mh(u0(t),u0(e))),Fc=(t,e)=>{const n=Math.max(0,Math.min(t.x+t.width,e.x+e.width)-Math.max(t.x,e.x)),o=Math.max(0,Math.min(t.y+t.height,e.y+e.height)-Math.max(t.y,e.y));return Math.ceil(n*o)},bS=t=>Jo(t.width)&&Jo(t.height)&&Jo(t.x)&&Jo(t.y),Jo=t=>!isNaN(t)&&isFinite(t),jL=(t,e)=>{},fu=(t,e=[1,1])=>({x:e[0]*Math.round(t.x/e[0]),y:e[1]*Math.round(t.y/e[1])}),hu=({x:t,y:e},[n,o,s],i=!1,l=[1,1])=>{const u={x:(t-n)/s,y:(e-o)/s};return i?fu(u,l):u},kf=({x:t,y:e},[n,o,s])=>({x:t*s+n,y:e*s+o});function ji(t,e){if(typeof t=="number")return Math.floor((e-e/(1+t))*.5);if(typeof t=="string"&&t.endsWith("px")){const n=parseFloat(t);if(!Number.isNaN(n))return Math.floor(n)}if(typeof t=="string"&&t.endsWith("%")){const n=parseFloat(t);if(!Number.isNaN(n))return Math.floor(e*n*.01)}return console.error(`[React Flow] The padding value "${t}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function AL(t,e,n){if(typeof t=="string"||typeof t=="number"){const o=ji(t,n),s=ji(t,e);return{top:o,right:s,bottom:o,left:s,x:s*2,y:o*2}}if(typeof t=="object"){const o=ji(t.top??t.y??0,n),s=ji(t.bottom??t.y??0,n),i=ji(t.left??t.x??0,e),l=ji(t.right??t.x??0,e);return{top:o,right:l,bottom:s,left:i,x:i+l,y:o+s}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function OL(t,e,n,o,s,i){const{x:l,y:u}=kf(t,[e,n,o]),{x:d,y:f}=kf({x:t.x+t.width,y:t.y+t.height},[e,n,o]),g=s-d,m=i-f;return{left:Math.floor(l),top:Math.floor(u),right:Math.floor(g),bottom:Math.floor(m)}}const Ly=(t,e,n,o,s,i)=>{const l=AL(i,e,n),u=(e-l.x)/t.width,d=(n-l.y)/t.height,f=Math.min(u,d),g=tl(f,o,s),m=t.x+t.width/2,y=t.y+t.height/2,v=e/2-m*g,w=n/2-y*g,C=OL(t,v,w,g,e,n),S={left:Math.min(C.left-l.left,0),top:Math.min(C.top-l.top,0),right:Math.min(C.right-l.right,0),bottom:Math.min(C.bottom-l.bottom,0)};return{x:v-S.left+S.right,y:w-S.top+S.bottom,zoom:g}},Vc=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0;function ol(t){return t!=null&&t!=="parent"}function xs(t){return{width:t.measured?.width??t.width??t.initialWidth??0,height:t.measured?.height??t.height??t.initialHeight??0}}function Hy(t){return(t.measured?.width??t.width??t.initialWidth)!==void 0&&(t.measured?.height??t.height??t.initialHeight)!==void 0}function fM(t,e={width:0,height:0},n,o,s){const i={...t},l=o.get(n);if(l){const u=l.origin||s;i.x+=l.internals.positionAbsolute.x-(e.width??0)*u[0],i.y+=l.internals.positionAbsolute.y-(e.height??0)*u[1]}return i}function wS(t,e){if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;return!0}function zL(){let t,e;return{promise:new Promise((o,s)=>{t=o,e=s}),resolve:t,reject:e}}function IL(t){return{...rM,...t||{}}}function Rc(t,{snapGrid:e=[0,0],snapToGrid:n=!1,transform:o,containerBounds:s}){const{x:i,y:l}=er(t),u=hu({x:i-(s?.left??0),y:l-(s?.top??0)},o),{x:d,y:f}=n?fu(u,e):u;return{xSnapped:d,ySnapped:f,...u}}const By=t=>({width:t.offsetWidth,height:t.offsetHeight}),hM=t=>t?.getRootNode?.()||window?.document,PL=["INPUT","SELECT","TEXTAREA"];function mM(t){const e=t.composedPath?.()?.[0]||t.target;return e?.nodeType!==1?!1:PL.includes(e.nodeName)||e.hasAttribute("contenteditable")||!!e.closest(".nokey")}const gM=t=>"clientX"in t,er=(t,e)=>{const n=gM(t),o=n?t.clientX:t.touches?.[0].clientX,s=n?t.clientY:t.touches?.[0].clientY;return{x:o-(e?.left??0),y:s-(e?.top??0)}},SS=(t,e,n,o,s)=>{const i=e.querySelectorAll(`.${t}`);return!i||!i.length?null:Array.from(i).map(l=>{const u=l.getBoundingClientRect();return{id:l.getAttribute("data-handleid"),type:t,nodeId:s,position:l.getAttribute("data-handlepos"),x:(u.left-n.left)/o,y:(u.top-n.top)/o,...By(l)}})};function pM({sourceX:t,sourceY:e,targetX:n,targetY:o,sourceControlX:s,sourceControlY:i,targetControlX:l,targetControlY:u}){const d=t*.125+s*.375+l*.375+n*.125,f=e*.125+i*.375+u*.375+o*.125,g=Math.abs(d-t),m=Math.abs(f-e);return[d,f,g,m]}function Yd(t,e){return t>=0?.5*t:e*25*Math.sqrt(-t)}function CS({pos:t,x1:e,y1:n,x2:o,y2:s,c:i}){switch(t){case qe.Left:return[e-Yd(e-o,i),n];case qe.Right:return[e+Yd(o-e,i),n];case qe.Top:return[e,n-Yd(n-s,i)];case qe.Bottom:return[e,n+Yd(s-n,i)]}}function yM({sourceX:t,sourceY:e,sourcePosition:n=qe.Bottom,targetX:o,targetY:s,targetPosition:i=qe.Top,curvature:l=.25}){const[u,d]=CS({pos:n,x1:t,y1:e,x2:o,y2:s,c:l}),[f,g]=CS({pos:i,x1:o,y1:s,x2:t,y2:e,c:l}),[m,y,v,w]=pM({sourceX:t,sourceY:e,targetX:o,targetY:s,sourceControlX:u,sourceControlY:d,targetControlX:f,targetControlY:g});return[`M${t},${e} C${u},${d} ${f},${g} ${o},${s}`,m,y,v,w]}function vM({sourceX:t,sourceY:e,targetX:n,targetY:o}){const s=Math.abs(n-t)/2,i=n<t?n+s:n-s,l=Math.abs(o-e)/2,u=o<e?o+l:o-l;return[i,u,s,l]}function $L({sourceNode:t,targetNode:e,selected:n=!1,zIndex:o=0,elevateOnSelect:s=!1,zIndexMode:i="basic"}){if(i==="manual")return o;const l=s&&n?o+1e3:o,u=Math.max(t.parentId||s&&t.selected?t.internals.z:0,e.parentId||s&&e.selected?e.internals.z:0);return l+u}function LL({sourceNode:t,targetNode:e,width:n,height:o,transform:s}){const i=mh(Tf(t),Tf(e));i.x===i.x2&&(i.x2+=1),i.y===i.y2&&(i.y2+=1);const l={x:-s[0]/s[2],y:-s[1]/s[2],width:n/s[2],height:o/s[2]};return Fc(l,gh(i))>0}const HL=({source:t,sourceHandle:e,target:n,targetHandle:o})=>`xy-edge__${t}${e||""}-${n}${o||""}`,BL=(t,e)=>e.some(n=>n.source===t.source&&n.target===t.target&&(n.sourceHandle===t.sourceHandle||!n.sourceHandle&&!t.sourceHandle)&&(n.targetHandle===t.targetHandle||!n.targetHandle&&!t.targetHandle)),FL=(t,e,n={})=>{if(!t.source||!t.target)return e;const o=n.getEdgeId||HL;let s;return iM(t)?s={...t}:s={...t,id:o(t)},BL(s,e)?e:(s.sourceHandle===null&&delete s.sourceHandle,s.targetHandle===null&&delete s.targetHandle,e.concat(s))};function xM({sourceX:t,sourceY:e,targetX:n,targetY:o}){const[s,i,l,u]=vM({sourceX:t,sourceY:e,targetX:n,targetY:o});return[`M ${t},${e}L ${n},${o}`,s,i,l,u]}const ES={[qe.Left]:{x:-1,y:0},[qe.Right]:{x:1,y:0},[qe.Top]:{x:0,y:-1},[qe.Bottom]:{x:0,y:1}},VL=({source:t,sourcePosition:e=qe.Bottom,target:n})=>e===qe.Left||e===qe.Right?t.x<n.x?{x:1,y:0}:{x:-1,y:0}:t.y<n.y?{x:0,y:1}:{x:0,y:-1},_S=(t,e)=>Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2));function UL({source:t,sourcePosition:e=qe.Bottom,target:n,targetPosition:o=qe.Top,center:s,offset:i,stepPosition:l}){const u=ES[e],d=ES[o],f={x:t.x+u.x*i,y:t.y+u.y*i},g={x:n.x+d.x*i,y:n.y+d.y*i},m=VL({source:f,sourcePosition:e,target:g}),y=m.x!==0?"x":"y",v=m[y];let w=[],C,S;const N={x:0,y:0},M={x:0,y:0},[,,E,R]=vM({sourceX:t.x,sourceY:t.y,targetX:n.x,targetY:n.y});if(u[y]*d[y]===-1){y==="x"?(C=s.x??f.x+(g.x-f.x)*l,S=s.y??(f.y+g.y)/2):(C=s.x??(f.x+g.x)/2,S=s.y??f.y+(g.y-f.y)*l);const T=[{x:C,y:f.y},{x:C,y:g.y}],k=[{x:f.x,y:S},{x:g.x,y:S}];u[y]===v?w=y==="x"?T:k:w=y==="x"?k:T}else{const T=[{x:f.x,y:g.y}],k=[{x:g.x,y:f.y}];if(y==="x"?w=u.x===v?k:T:w=u.y===v?T:k,e===o){const Y=Math.abs(t[y]-n[y]);if(Y<=i){const q=Math.min(i-1,i-Y);u[y]===v?N[y]=(f[y]>t[y]?-1:1)*q:M[y]=(g[y]>n[y]?-1:1)*q}}if(e!==o){const Y=y==="x"?"y":"x",q=u[y]===d[Y],z=f[Y]>g[Y],V=f[Y]<g[Y];(u[y]===1&&(!q&&z||q&&V)||u[y]!==1&&(!q&&V||q&&z))&&(w=y==="x"?T:k)}const O={x:f.x+N.x,y:f.y+N.y},L={x:g.x+M.x,y:g.y+M.y},W=Math.max(Math.abs(O.x-w[0].x),Math.abs(L.x-w[0].x)),B=Math.max(Math.abs(O.y-w[0].y),Math.abs(L.y-w[0].y));W>=B?(C=(O.x+L.x)/2,S=w[0].y):(C=w[0].x,S=(O.y+L.y)/2)}return[[t,{x:f.x+N.x,y:f.y+N.y},...w,{x:g.x+M.x,y:g.y+M.y},n],C,S,E,R]}function YL(t,e,n,o){const s=Math.min(_S(t,e)/2,_S(e,n)/2,o),{x:i,y:l}=e;if(t.x===i&&i===n.x||t.y===l&&l===n.y)return`L${i} ${l}`;if(t.y===l){const f=t.x<n.x?-1:1,g=t.y<n.y?1:-1;return`L ${i+s*f},${l}Q ${i},${l} ${i},${l+s*g}`}const u=t.x<n.x?1:-1,d=t.y<n.y?-1:1;return`L ${i},${l+s*d}Q ${i},${l} ${i+s*u},${l}`}function d0({sourceX:t,sourceY:e,sourcePosition:n=qe.Bottom,targetX:o,targetY:s,targetPosition:i=qe.Top,borderRadius:l=5,centerX:u,centerY:d,offset:f=20,stepPosition:g=.5}){const[m,y,v,w,C]=UL({source:{x:t,y:e},sourcePosition:n,target:{x:o,y:s},targetPosition:i,center:{x:u,y:d},offset:f,stepPosition:g});return[m.reduce((N,M,E)=>{let R="";return E>0&&E<m.length-1?R=YL(m[E-1],M,m[E+1],l):R=`${E===0?"M":"L"}${M.x} ${M.y}`,N+=R,N},""),y,v,w,C]}function NS(t){return t&&!!(t.internals.handleBounds||t.handles?.length)&&!!(t.measured.width||t.width||t.initialWidth)}function GL(t){const{sourceNode:e,targetNode:n}=t;if(!NS(e)||!NS(n))return null;const o=e.internals.handleBounds||MS(e.handles),s=n.internals.handleBounds||MS(n.handles),i=RS(o?.source??[],t.sourceHandle),l=RS(t.connectionMode===el.Strict?s?.target??[]:(s?.target??[]).concat(s?.source??[]),t.targetHandle);if(!i||!l)return t.onError?.("008",Mr.error008(i?"target":"source",{id:t.id,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle})),null;const u=i?.position||qe.Bottom,d=l?.position||qe.Top,f=Ya(e,i,u),g=Ya(n,l,d);return{sourceX:f.x,sourceY:f.y,targetX:g.x,targetY:g.y,sourcePosition:u,targetPosition:d}}function MS(t){if(!t)return null;const e=[],n=[];for(const o of t)o.width=o.width??1,o.height=o.height??1,o.type==="source"?e.push(o):o.type==="target"&&n.push(o);return{source:e,target:n}}function Ya(t,e,n=qe.Left,o=!1){const s=(e?.x??0)+t.internals.positionAbsolute.x,i=(e?.y??0)+t.internals.positionAbsolute.y,{width:l,height:u}=e??xs(t);if(o)return{x:s+l/2,y:i+u/2};switch(e?.position??n){case qe.Top:return{x:s+l/2,y:i};case qe.Right:return{x:s+l,y:i+u/2};case qe.Bottom:return{x:s+l/2,y:i+u};case qe.Left:return{x:s,y:i+u/2}}}function RS(t,e){return t&&(e?t.find(n=>n.id===e):t[0])||null}function f0(t,e){return t?typeof t=="string"?t:`${e?`${e}__`:""}${Object.keys(t).sort().map(o=>`${o}=${t[o]}`).join("&")}`:""}function qL(t,{id:e,defaultColor:n,defaultMarkerStart:o,defaultMarkerEnd:s}){const i=new Set;return t.reduce((l,u)=>([u.markerStart||o,u.markerEnd||s].forEach(d=>{if(d&&typeof d=="object"){const f=f0(d,e);i.has(f)||(l.push({id:f,color:d.color||n,...d}),i.add(f))}}),l),[]).sort((l,u)=>l.id.localeCompare(u.id))}const bM=1e3,WL=10,Fy={nodeOrigin:[0,0],nodeExtent:Hc,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},KL={...Fy,checkEquality:!0};function Vy(t,e){const n={...t};for(const o in e)e[o]!==void 0&&(n[o]=e[o]);return n}function XL(t,e,n){const o=Vy(Fy,n);for(const s of t.values())if(s.parentId)Yy(s,t,e,o);else{const i=uu(s,o.nodeOrigin),l=ol(s.extent)?s.extent:o.nodeExtent,u=Ua(i,l,xs(s));s.internals.positionAbsolute=u}}function QL(t,e){if(!t.handles)return t.measured?e?.internals.handleBounds:void 0;const n=[],o=[];for(const s of t.handles){const i={id:s.id,width:s.width??1,height:s.height??1,nodeId:t.id,x:s.x,y:s.y,position:s.position,type:s.type};s.type==="source"?n.push(i):s.type==="target"&&o.push(i)}return{source:n,target:o}}function Uy(t){return t==="manual"}function h0(t,e,n,o={}){const s=Vy(KL,o),i={i:0},l=new Map(e),u=s?.elevateNodesOnSelect&&!Uy(s.zIndexMode)?bM:0;let d=t.length>0;e.clear(),n.clear();for(const f of t){let g=l.get(f.id);if(s.checkEquality&&f===g?.internals.userNode)e.set(f.id,g);else{const m=uu(f,s.nodeOrigin),y=ol(f.extent)?f.extent:s.nodeExtent,v=Ua(m,y,xs(f));g={...s.defaults,...f,measured:{width:f.measured?.width,height:f.measured?.height},internals:{positionAbsolute:v,handleBounds:QL(f,g),z:wM(f,u,s.zIndexMode),userNode:f}},e.set(f.id,g)}(g.measured===void 0||g.measured.width===void 0||g.measured.height===void 0)&&!g.hidden&&(d=!1),f.parentId&&Yy(g,e,n,o,i)}return d}function ZL(t,e){if(!t.parentId)return;const n=e.get(t.parentId);n?n.set(t.id,t):e.set(t.parentId,new Map([[t.id,t]]))}function Yy(t,e,n,o,s){const{elevateNodesOnSelect:i,nodeOrigin:l,nodeExtent:u,zIndexMode:d}=Vy(Fy,o),f=t.parentId,g=e.get(f);if(!g){console.warn(`Parent node ${f} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}ZL(t,n),s&&!g.parentId&&g.internals.rootParentIndex===void 0&&d==="auto"&&(g.internals.rootParentIndex=++s.i,g.internals.z=g.internals.z+s.i*WL),s&&g.internals.rootParentIndex!==void 0&&(s.i=g.internals.rootParentIndex);const m=i&&!Uy(d)?bM:0,{x:y,y:v,z:w}=JL(t,g,l,u,m,d),{positionAbsolute:C}=t.internals,S=y!==C.x||v!==C.y;(S||w!==t.internals.z)&&e.set(t.id,{...t,internals:{...t.internals,positionAbsolute:S?{x:y,y:v}:C,z:w}})}function wM(t,e,n){const o=Jo(t.zIndex)?t.zIndex:0;return Uy(n)?o:o+(t.selected?e:0)}function JL(t,e,n,o,s,i){const{x:l,y:u}=e.internals.positionAbsolute,d=xs(t),f=uu(t,n),g=ol(t.extent)?Ua(f,t.extent,d):f;let m=Ua({x:l+g.x,y:u+g.y},o,d);t.extent==="parent"&&(m=cM(m,d,e));const y=wM(t,s,i),v=e.internals.z??0;return{x:m.x,y:m.y,z:v>=y?v+1:y}}function Gy(t,e,n,o=[0,0]){const s=[],i=new Map;for(const l of t){const u=e.get(l.parentId);if(!u)continue;const d=i.get(l.parentId)?.expandedRect??nl(u),f=dM(d,l.rect);i.set(l.parentId,{expandedRect:f,parent:u})}return i.size>0&&i.forEach(({expandedRect:l,parent:u},d)=>{const f=u.internals.positionAbsolute,g=xs(u),m=u.origin??o,y=l.x<f.x?Math.round(Math.abs(f.x-l.x)):0,v=l.y<f.y?Math.round(Math.abs(f.y-l.y)):0,w=Math.max(g.width,Math.round(l.width)),C=Math.max(g.height,Math.round(l.height)),S=(w-g.width)*m[0],N=(C-g.height)*m[1];(y>0||v>0||S||N)&&(s.push({id:d,type:"position",position:{x:u.position.x-y+S,y:u.position.y-v+N}}),n.get(d)?.forEach(M=>{t.some(E=>E.id===M.id)||s.push({id:M.id,type:"position",position:{x:M.position.x+y,y:M.position.y+v}})})),(g.width<l.width||g.height<l.height||y||v)&&s.push({id:d,type:"dimensions",setAttributes:!0,dimensions:{width:w+(y?m[0]*y-S:0),height:C+(v?m[1]*v-N:0)}})}),s}function eH(t,e,n,o,s,i,l){const u=o?.querySelector(".xyflow__viewport");let d=!1;if(!u)return{changes:[],updatedInternals:d};const f=[],g=window.getComputedStyle(u),{m22:m}=new window.DOMMatrixReadOnly(g.transform),y=[];for(const v of t.values()){const w=e.get(v.id);if(!w)continue;if(w.hidden){e.set(w.id,{...w,internals:{...w.internals,handleBounds:void 0}}),d=!0;continue}const C=By(v.nodeElement),S=w.measured.width!==C.width||w.measured.height!==C.height;if(!!(C.width&&C.height&&(S||!w.internals.handleBounds||v.force))){const M=v.nodeElement.getBoundingClientRect(),E=ol(w.extent)?w.extent:i;let{positionAbsolute:R}=w.internals;w.parentId&&w.extent==="parent"?R=cM(R,C,e.get(w.parentId)):E&&(R=Ua(R,E,C));const D={...w,measured:C,internals:{...w.internals,positionAbsolute:R,handleBounds:{source:SS("source",v.nodeElement,M,m,w.id),target:SS("target",v.nodeElement,M,m,w.id)}}};e.set(w.id,D),w.parentId&&Yy(D,e,n,{nodeOrigin:s,zIndexMode:l}),d=!0,S&&(f.push({id:w.id,type:"dimensions",dimensions:C}),w.expandParent&&w.parentId&&y.push({id:w.id,parentId:w.parentId,rect:nl(D,s)}))}}if(y.length>0){const v=Gy(y,e,n,s);f.push(...v)}return{changes:f,updatedInternals:d}}async function tH({delta:t,panZoom:e,transform:n,translateExtent:o,width:s,height:i}){if(!e||!t.x&&!t.y)return Promise.resolve(!1);const l=await e.setViewportConstrained({x:n[0]+t.x,y:n[1]+t.y,zoom:n[2]},[[0,0],[s,i]],o),u=!!l&&(l.x!==n[0]||l.y!==n[1]||l.k!==n[2]);return Promise.resolve(u)}function DS(t,e,n,o,s,i){let l=s;const u=o.get(l)||new Map;o.set(l,u.set(n,e)),l=`${s}-${t}`;const d=o.get(l)||new Map;if(o.set(l,d.set(n,e)),i){l=`${s}-${t}-${i}`;const f=o.get(l)||new Map;o.set(l,f.set(n,e))}}function SM(t,e,n){t.clear(),e.clear();for(const o of n){const{source:s,target:i,sourceHandle:l=null,targetHandle:u=null}=o,d={edgeId:o.id,source:s,target:i,sourceHandle:l,targetHandle:u},f=`${s}-${l}--${i}-${u}`,g=`${i}-${u}--${s}-${l}`;DS("source",d,g,t,s,l),DS("target",d,f,t,i,u),e.set(o.id,o)}}function CM(t,e){if(!t.parentId)return!1;const n=e.get(t.parentId);return n?n.selected?!0:CM(n,e):!1}function TS(t,e,n){let o=t;do{if(o?.matches?.(e))return!0;if(o===n)return!1;o=o?.parentElement}while(o);return!1}function nH(t,e,n,o){const s=new Map;for(const[i,l]of t)if((l.selected||l.id===o)&&(!l.parentId||!CM(l,t))&&(l.draggable||e&&typeof l.draggable>"u")){const u=t.get(i);u&&s.set(i,{id:i,position:u.position||{x:0,y:0},distance:{x:n.x-u.internals.positionAbsolute.x,y:n.y-u.internals.positionAbsolute.y},extent:u.extent,parentId:u.parentId,origin:u.origin,expandParent:u.expandParent,internals:{positionAbsolute:u.internals.positionAbsolute||{x:0,y:0}},measured:{width:u.measured.width??0,height:u.measured.height??0}})}return s}function up({nodeId:t,dragItems:e,nodeLookup:n,dragging:o=!0}){const s=[];for(const[l,u]of e){const d=n.get(l)?.internals.userNode;d&&s.push({...d,position:u.position,dragging:o})}if(!t)return[s[0],s];const i=n.get(t)?.internals.userNode;return[i?{...i,position:e.get(t)?.position||i.position,dragging:o}:s[0],s]}function oH({dragItems:t,snapGrid:e,x:n,y:o}){const s=t.values().next().value;if(!s)return null;const i={x:n-s.distance.x,y:o-s.distance.y},l=fu(i,e);return{x:l.x-i.x,y:l.y-i.y}}function rH({onNodeMouseDown:t,getStoreItems:e,onDragStart:n,onDrag:o,onDragStop:s}){let i={x:null,y:null},l=0,u=new Map,d=!1,f={x:0,y:0},g=null,m=!1,y=null,v=!1,w=!1,C=null;function S({noDragClassName:M,handleSelector:E,domNode:R,isSelectable:D,nodeId:T,nodeClickDistance:k=0}){y=So(R);function O({x:Y,y:q}){const{nodeLookup:z,nodeExtent:V,snapGrid:A,snapToGrid:H,nodeOrigin:P,onNodeDrag:F,onSelectionDrag:Q,onError:$,updateNodePositions:I}=e();i={x:Y,y:q};let U=!1;const K=u.size>1,J=K&&V?u0(du(u)):null,ne=K&&H?oH({dragItems:u,snapGrid:A,x:Y,y:q}):null;for(const[X,ee]of u){if(!z.has(X))continue;let se={x:Y-ee.distance.x,y:q-ee.distance.y};H&&(se=ne?{x:Math.round(se.x+ne.x),y:Math.round(se.y+ne.y)}:fu(se,A));let le=null;if(K&&V&&!ee.extent&&J){const{positionAbsolute:be}=ee.internals,ke=be.x-J.x+V[0][0],Be=be.x+ee.measured.width-J.x2+V[1][0],Ie=be.y-J.y+V[0][1],lt=be.y+ee.measured.height-J.y2+V[1][1];le=[[ke,Ie],[Be,lt]]}const{position:pe,positionAbsolute:ie}=lM({nodeId:X,nextPosition:se,nodeLookup:z,nodeExtent:le||V,nodeOrigin:P,onError:$});U=U||ee.position.x!==pe.x||ee.position.y!==pe.y,ee.position=pe,ee.internals.positionAbsolute=ie}if(w=w||U,!!U&&(I(u,!0),C&&(o||F||!T&&Q))){const[X,ee]=up({nodeId:T,dragItems:u,nodeLookup:z});o?.(C,u,X,ee),F?.(C,X,ee),T||Q?.(C,ee)}}async function L(){if(!g)return;const{transform:Y,panBy:q,autoPanSpeed:z,autoPanOnNodeDrag:V}=e();if(!V){d=!1,cancelAnimationFrame(l);return}const[A,H]=uM(f,g,z);(A!==0||H!==0)&&(i.x=(i.x??0)-A/Y[2],i.y=(i.y??0)-H/Y[2],await q({x:A,y:H})&&O(i)),l=requestAnimationFrame(L)}function W(Y){const{nodeLookup:q,multiSelectionActive:z,nodesDraggable:V,transform:A,snapGrid:H,snapToGrid:P,selectNodesOnDrag:F,onNodeDragStart:Q,onSelectionDragStart:$,unselectNodesAndEdges:I}=e();m=!0,(!F||!D)&&!z&&T&&(q.get(T)?.selected||I()),D&&F&&T&&t?.(T);const U=Rc(Y.sourceEvent,{transform:A,snapGrid:H,snapToGrid:P,containerBounds:g});if(i=U,u=nH(q,V,U,T),u.size>0&&(n||Q||!T&&$)){const[K,J]=up({nodeId:T,dragItems:u,nodeLookup:q});n?.(Y.sourceEvent,u,K,J),Q?.(Y.sourceEvent,K,J),T||$?.(Y.sourceEvent,J)}}const B=BN().clickDistance(k).on("start",Y=>{const{domNode:q,nodeDragThreshold:z,transform:V,snapGrid:A,snapToGrid:H}=e();g=q?.getBoundingClientRect()||null,v=!1,w=!1,C=Y.sourceEvent,z===0&&W(Y),i=Rc(Y.sourceEvent,{transform:V,snapGrid:A,snapToGrid:H,containerBounds:g}),f=er(Y.sourceEvent,g)}).on("drag",Y=>{const{autoPanOnNodeDrag:q,transform:z,snapGrid:V,snapToGrid:A,nodeDragThreshold:H,nodeLookup:P}=e(),F=Rc(Y.sourceEvent,{transform:z,snapGrid:V,snapToGrid:A,containerBounds:g});if(C=Y.sourceEvent,(Y.sourceEvent.type==="touchmove"&&Y.sourceEvent.touches.length>1||T&&!P.has(T))&&(v=!0),!v){if(!d&&q&&m&&(d=!0,L()),!m){const Q=er(Y.sourceEvent,g),$=Q.x-f.x,I=Q.y-f.y;Math.sqrt($*$+I*I)>H&&W(Y)}(i.x!==F.xSnapped||i.y!==F.ySnapped)&&u&&m&&(f=er(Y.sourceEvent,g),O(F))}}).on("end",Y=>{if(!(!m||v)&&(d=!1,m=!1,cancelAnimationFrame(l),u.size>0)){const{nodeLookup:q,updateNodePositions:z,onNodeDragStop:V,onSelectionDragStop:A}=e();if(w&&(z(u,!1),w=!1),s||V||!T&&A){const[H,P]=up({nodeId:T,dragItems:u,nodeLookup:q,dragging:!1});s?.(Y.sourceEvent,u,H,P),V?.(Y.sourceEvent,H,P),T||A?.(Y.sourceEvent,P)}}}).filter(Y=>{const q=Y.target;return!Y.button&&(!M||!TS(q,`.${M}`,R))&&(!E||TS(q,E,R))});y.call(B)}function N(){y?.on(".drag",null)}return{update:S,destroy:N}}function sH(t,e,n){const o=[],s={x:t.x-n,y:t.y-n,width:n*2,height:n*2};for(const i of e.values())Fc(s,nl(i))>0&&o.push(i);return o}const aH=250;function iH(t,e,n,o){let s=[],i=1/0;const l=sH(t,n,e+aH);for(const u of l){const d=[...u.internals.handleBounds?.source??[],...u.internals.handleBounds?.target??[]];for(const f of d){if(o.nodeId===f.nodeId&&o.type===f.type&&o.id===f.id)continue;const{x:g,y:m}=Ya(u,f,f.position,!0),y=Math.sqrt(Math.pow(g-t.x,2)+Math.pow(m-t.y,2));y>e||(y<i?(s=[{...f,x:g,y:m}],i=y):y===i&&s.push({...f,x:g,y:m}))}}if(!s.length)return null;if(s.length>1){const u=o.type==="source"?"target":"source";return s.find(d=>d.type===u)??s[0]}return s[0]}function EM(t,e,n,o,s,i=!1){const l=o.get(t);if(!l)return null;const u=s==="strict"?l.internals.handleBounds?.[e]:[...l.internals.handleBounds?.source??[],...l.internals.handleBounds?.target??[]],d=(n?u?.find(f=>f.id===n):u?.[0])??null;return d&&i?{...d,...Ya(l,d,d.position,!0)}:d}function _M(t,e){return t||(e?.classList.contains("target")?"target":e?.classList.contains("source")?"source":null)}function lH(t,e){let n=null;return e?n=!0:t&&!e&&(n=!1),n}const NM=()=>!0;function cH(t,{connectionMode:e,connectionRadius:n,handleId:o,nodeId:s,edgeUpdaterType:i,isTarget:l,domNode:u,nodeLookup:d,lib:f,autoPanOnConnect:g,flowId:m,panBy:y,cancelConnection:v,onConnectStart:w,onConnect:C,onConnectEnd:S,isValidConnection:N=NM,onReconnectEnd:M,updateConnection:E,getTransform:R,getFromHandle:D,autoPanSpeed:T,dragThreshold:k=1,handleDomNode:O}){const L=hM(t.target);let W=0,B;const{x:Y,y:q}=er(t),z=_M(i,O),V=u?.getBoundingClientRect();let A=!1;if(!V||!z)return;const H=EM(s,z,o,d,e);if(!H)return;let P=er(t,V),F=!1,Q=null,$=!1,I=null;function U(){if(!g||!V)return;const[pe,ie]=uM(P,V,T);y({x:pe,y:ie}),W=requestAnimationFrame(U)}const K={...H,nodeId:s,type:z,position:H.position},J=d.get(s);let X={inProgress:!0,isValid:null,from:Ya(J,K,qe.Left,!0),fromHandle:K,fromPosition:K.position,fromNode:J,to:P,toHandle:null,toPosition:vS[K.position],toNode:null,pointer:P};function ee(){A=!0,E(X),w?.(t,{nodeId:s,handleId:o,handleType:z})}k===0&&ee();function se(pe){if(!A){const{x:lt,y:cn}=er(pe),ht=lt-Y,bn=cn-q;if(!(ht*ht+bn*bn>k*k))return;ee()}if(!D()||!K){le(pe);return}const ie=R();P=er(pe,V),B=iH(hu(P,ie,!1,[1,1]),n,d,K),F||(U(),F=!0);const be=MM(pe,{handle:B,connectionMode:e,fromNodeId:s,fromHandleId:o,fromType:l?"target":"source",isValidConnection:N,doc:L,lib:f,flowId:m,nodeLookup:d});I=be.handleDomNode,Q=be.connection,$=lH(!!B,be.isValid);const ke=d.get(s),Be=ke?Ya(ke,K,qe.Left,!0):X.from,Ie={...X,from:Be,isValid:$,to:be.toHandle&&$?kf({x:be.toHandle.x,y:be.toHandle.y},ie):P,toHandle:be.toHandle,toPosition:$&&be.toHandle?be.toHandle.position:vS[K.position],toNode:be.toHandle?d.get(be.toHandle.nodeId):null,pointer:P};E(Ie),X=Ie}function le(pe){if(!("touches"in pe&&pe.touches.length>0)){if(A){(B||I)&&Q&&$&&C?.(Q);const{inProgress:ie,...be}=X,ke={...be,toPosition:X.toHandle?X.toPosition:null};S?.(pe,ke),i&&M?.(pe,ke)}v(),cancelAnimationFrame(W),F=!1,$=!1,Q=null,I=null,L.removeEventListener("mousemove",se),L.removeEventListener("mouseup",le),L.removeEventListener("touchmove",se),L.removeEventListener("touchend",le)}}L.addEventListener("mousemove",se),L.addEventListener("mouseup",le),L.addEventListener("touchmove",se),L.addEventListener("touchend",le)}function MM(t,{handle:e,connectionMode:n,fromNodeId:o,fromHandleId:s,fromType:i,doc:l,lib:u,flowId:d,isValidConnection:f=NM,nodeLookup:g}){const m=i==="target",y=e?l.querySelector(`.${u}-flow__handle[data-id="${d}-${e?.nodeId}-${e?.id}-${e?.type}"]`):null,{x:v,y:w}=er(t),C=l.elementFromPoint(v,w),S=C?.classList.contains(`${u}-flow__handle`)?C:y,N={handleDomNode:S,isValid:!1,connection:null,toHandle:null};if(S){const M=_M(void 0,S),E=S.getAttribute("data-nodeid"),R=S.getAttribute("data-handleid"),D=S.classList.contains("connectable"),T=S.classList.contains("connectableend");if(!E||!M)return N;const k={source:m?E:o,sourceHandle:m?R:s,target:m?o:E,targetHandle:m?s:R};N.connection=k;const L=D&&T&&(n===el.Strict?m&&M==="source"||!m&&M==="target":E!==o||R!==s);N.isValid=L&&f(k),N.toHandle=EM(E,M,R,g,n,!0)}return N}const m0={onPointerDown:cH,isValid:MM};function uH({domNode:t,panZoom:e,getTransform:n,getViewScale:o}){const s=So(t);function i({translateExtent:u,width:d,height:f,zoomStep:g=1,pannable:m=!0,zoomable:y=!0,inversePan:v=!1}){const w=E=>{if(E.sourceEvent.type!=="wheel"||!e)return;const R=n(),D=E.sourceEvent.ctrlKey&&Vc()?10:1,T=-E.sourceEvent.deltaY*(E.sourceEvent.deltaMode===1?.05:E.sourceEvent.deltaMode?1:.002)*g,k=R[2]*Math.pow(2,T*D);e.scaleTo(k)};let C=[0,0];const S=E=>{(E.sourceEvent.type==="mousedown"||E.sourceEvent.type==="touchstart")&&(C=[E.sourceEvent.clientX??E.sourceEvent.touches[0].clientX,E.sourceEvent.clientY??E.sourceEvent.touches[0].clientY])},N=E=>{const R=n();if(E.sourceEvent.type!=="mousemove"&&E.sourceEvent.type!=="touchmove"||!e)return;const D=[E.sourceEvent.clientX??E.sourceEvent.touches[0].clientX,E.sourceEvent.clientY??E.sourceEvent.touches[0].clientY],T=[D[0]-C[0],D[1]-C[1]];C=D;const k=o()*Math.max(R[2],Math.log(R[2]))*(v?-1:1),O={x:R[0]-T[0]*k,y:R[1]-T[1]*k},L=[[0,0],[d,f]];e.setViewportConstrained({x:O.x,y:O.y,zoom:R[2]},L,u)},M=nM().on("start",S).on("zoom",m?N:null).on("zoom.wheel",y?w:null);s.call(M,{})}function l(){s.on("zoom",null)}return{update:i,destroy:l,pointer:Qo}}const ph=t=>({x:t.x,y:t.y,zoom:t.k}),dp=({x:t,y:e,zoom:n})=>hh.translate(t,e).scale(n),Fi=(t,e)=>t.target.closest(`.${e}`),RM=(t,e)=>e===2&&Array.isArray(t)&&t.includes(2),dH=t=>((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2,fp=(t,e=0,n=dH,o=()=>{})=>{const s=typeof e=="number"&&e>0;return s||o(),s?t.transition().duration(e).ease(n).on("end",o):t},DM=t=>{const e=t.ctrlKey&&Vc()?10:1;return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*e};function fH({zoomPanValues:t,noWheelClassName:e,d3Selection:n,d3Zoom:o,panOnScrollMode:s,panOnScrollSpeed:i,zoomOnPinch:l,onPanZoomStart:u,onPanZoom:d,onPanZoomEnd:f}){return g=>{if(Fi(g,e))return g.ctrlKey&&g.preventDefault(),!1;g.preventDefault(),g.stopImmediatePropagation();const m=n.property("__zoom").k||1;if(g.ctrlKey&&l){const S=Qo(g),N=DM(g),M=m*Math.pow(2,N);o.scaleTo(n,M,S,g);return}const y=g.deltaMode===1?20:1;let v=s===Pa.Vertical?0:g.deltaX*y,w=s===Pa.Horizontal?0:g.deltaY*y;!Vc()&&g.shiftKey&&s!==Pa.Vertical&&(v=g.deltaY*y,w=0),o.translateBy(n,-(v/m)*i,-(w/m)*i,{internal:!0});const C=ph(n.property("__zoom"));clearTimeout(t.panScrollTimeout),t.isPanScrolling?(d?.(g,C),t.panScrollTimeout=setTimeout(()=>{f?.(g,C),t.isPanScrolling=!1},150)):(t.isPanScrolling=!0,u?.(g,C))}}function hH({noWheelClassName:t,preventScrolling:e,d3ZoomHandler:n}){return function(o,s){const i=o.type==="wheel",l=!e&&i&&!o.ctrlKey,u=Fi(o,t);if(o.ctrlKey&&i&&u&&o.preventDefault(),l||u)return null;o.preventDefault(),n.call(this,o,s)}}function mH({zoomPanValues:t,onDraggingChange:e,onPanZoomStart:n}){return o=>{if(o.sourceEvent?.internal)return;const s=ph(o.transform);t.mouseButton=o.sourceEvent?.button||0,t.isZoomingOrPanning=!0,t.prevViewport=s,o.sourceEvent?.type==="mousedown"&&e(!0),n&&n?.(o.sourceEvent,s)}}function gH({zoomPanValues:t,panOnDrag:e,onPaneContextMenu:n,onTransformChange:o,onPanZoom:s}){return i=>{t.usedRightMouseButton=!!(n&&RM(e,t.mouseButton??0)),i.sourceEvent?.sync||o([i.transform.x,i.transform.y,i.transform.k]),s&&!i.sourceEvent?.internal&&s?.(i.sourceEvent,ph(i.transform))}}function pH({zoomPanValues:t,panOnDrag:e,panOnScroll:n,onDraggingChange:o,onPanZoomEnd:s,onPaneContextMenu:i}){return l=>{if(!l.sourceEvent?.internal&&(t.isZoomingOrPanning=!1,i&&RM(e,t.mouseButton??0)&&!t.usedRightMouseButton&&l.sourceEvent&&i(l.sourceEvent),t.usedRightMouseButton=!1,o(!1),s)){const u=ph(l.transform);t.prevViewport=u,clearTimeout(t.timerId),t.timerId=setTimeout(()=>{s?.(l.sourceEvent,u)},n?150:0)}}}function yH({zoomActivationKeyPressed:t,zoomOnScroll:e,zoomOnPinch:n,panOnDrag:o,panOnScroll:s,zoomOnDoubleClick:i,userSelectionActive:l,noWheelClassName:u,noPanClassName:d,lib:f,connectionInProgress:g}){return m=>{const y=t||e,v=n&&m.ctrlKey,w=m.type==="wheel";if(m.button===1&&m.type==="mousedown"&&(Fi(m,`${f}-flow__node`)||Fi(m,`${f}-flow__edge`)))return!0;if(!o&&!y&&!s&&!i&&!n||l||g&&!w||Fi(m,u)&&w||Fi(m,d)&&(!w||s&&w&&!t)||!n&&m.ctrlKey&&w)return!1;if(!n&&m.type==="touchstart"&&m.touches?.length>1)return m.preventDefault(),!1;if(!y&&!s&&!v&&w||!o&&(m.type==="mousedown"||m.type==="touchstart")||Array.isArray(o)&&!o.includes(m.button)&&m.type==="mousedown")return!1;const C=Array.isArray(o)&&o.includes(m.button)||!m.button||m.button<=1;return(!m.ctrlKey||w)&&C}}function vH({domNode:t,minZoom:e,maxZoom:n,translateExtent:o,viewport:s,onPanZoom:i,onPanZoomStart:l,onPanZoomEnd:u,onDraggingChange:d}){const f={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},g=t.getBoundingClientRect(),m=nM().scaleExtent([e,n]).translateExtent(o),y=So(t).call(m);M({x:s.x,y:s.y,zoom:tl(s.zoom,e,n)},[[0,0],[g.width,g.height]],o);const v=y.on("wheel.zoom"),w=y.on("dblclick.zoom");m.wheelDelta(DM);function C(B,Y){return y?new Promise(q=>{m?.interpolate(Y?.interpolate==="linear"?Mc:rf).transform(fp(y,Y?.duration,Y?.ease,()=>q(!0)),B)}):Promise.resolve(!1)}function S({noWheelClassName:B,noPanClassName:Y,onPaneContextMenu:q,userSelectionActive:z,panOnScroll:V,panOnDrag:A,panOnScrollMode:H,panOnScrollSpeed:P,preventScrolling:F,zoomOnPinch:Q,zoomOnScroll:$,zoomOnDoubleClick:I,zoomActivationKeyPressed:U,lib:K,onTransformChange:J,connectionInProgress:ne,paneClickDistance:X,selectionOnDrag:ee}){z&&!f.isZoomingOrPanning&&N();const se=V&&!U&&!z;m.clickDistance(ee?1/0:!Jo(X)||X<0?0:X);const le=se?fH({zoomPanValues:f,noWheelClassName:B,d3Selection:y,d3Zoom:m,panOnScrollMode:H,panOnScrollSpeed:P,zoomOnPinch:Q,onPanZoomStart:l,onPanZoom:i,onPanZoomEnd:u}):hH({noWheelClassName:B,preventScrolling:F,d3ZoomHandler:v});if(y.on("wheel.zoom",le,{passive:!1}),!z){const ie=mH({zoomPanValues:f,onDraggingChange:d,onPanZoomStart:l});m.on("start",ie);const be=gH({zoomPanValues:f,panOnDrag:A,onPaneContextMenu:!!q,onPanZoom:i,onTransformChange:J});m.on("zoom",be);const ke=pH({zoomPanValues:f,panOnDrag:A,panOnScroll:V,onPaneContextMenu:q,onPanZoomEnd:u,onDraggingChange:d});m.on("end",ke)}const pe=yH({zoomActivationKeyPressed:U,panOnDrag:A,zoomOnScroll:$,panOnScroll:V,zoomOnDoubleClick:I,zoomOnPinch:Q,userSelectionActive:z,noPanClassName:Y,noWheelClassName:B,lib:K,connectionInProgress:ne});m.filter(pe),I?y.on("dblclick.zoom",w):y.on("dblclick.zoom",null)}function N(){m.on("zoom",null)}async function M(B,Y,q){const z=dp(B),V=m?.constrain()(z,Y,q);return V&&await C(V),new Promise(A=>A(V))}async function E(B,Y){const q=dp(B);return await C(q,Y),new Promise(z=>z(q))}function R(B){if(y){const Y=dp(B),q=y.property("__zoom");(q.k!==B.zoom||q.x!==B.x||q.y!==B.y)&&m?.transform(y,Y,null,{sync:!0})}}function D(){const B=y?tM(y.node()):{x:0,y:0,k:1};return{x:B.x,y:B.y,zoom:B.k}}function T(B,Y){return y?new Promise(q=>{m?.interpolate(Y?.interpolate==="linear"?Mc:rf).scaleTo(fp(y,Y?.duration,Y?.ease,()=>q(!0)),B)}):Promise.resolve(!1)}function k(B,Y){return y?new Promise(q=>{m?.interpolate(Y?.interpolate==="linear"?Mc:rf).scaleBy(fp(y,Y?.duration,Y?.ease,()=>q(!0)),B)}):Promise.resolve(!1)}function O(B){m?.scaleExtent(B)}function L(B){m?.translateExtent(B)}function W(B){const Y=!Jo(B)||B<0?0:B;m?.clickDistance(Y)}return{update:S,destroy:N,setViewport:E,setViewportConstrained:M,getViewport:D,scaleTo:T,scaleBy:k,setScaleExtent:O,setTranslateExtent:L,syncViewport:R,setClickDistance:W}}var rl;(function(t){t.Line="line",t.Handle="handle"})(rl||(rl={}));function xH({width:t,prevWidth:e,height:n,prevHeight:o,affectsX:s,affectsY:i}){const l=t-e,u=n-o,d=[l>0?1:l<0?-1:0,u>0?1:u<0?-1:0];return l&&s&&(d[0]=d[0]*-1),u&&i&&(d[1]=d[1]*-1),d}function kS(t){const e=t.includes("right")||t.includes("left"),n=t.includes("bottom")||t.includes("top"),o=t.includes("left"),s=t.includes("top");return{isHorizontal:e,isVertical:n,affectsX:o,affectsY:s}}function Gs(t,e){return Math.max(0,e-t)}function qs(t,e){return Math.max(0,t-e)}function Gd(t,e,n){return Math.max(0,e-t,t-n)}function jS(t,e){return t?!e:e}function bH(t,e,n,o,s,i,l,u){let{affectsX:d,affectsY:f}=e;const{isHorizontal:g,isVertical:m}=e,y=g&&m,{xSnapped:v,ySnapped:w}=n,{minWidth:C,maxWidth:S,minHeight:N,maxHeight:M}=o,{x:E,y:R,width:D,height:T,aspectRatio:k}=t;let O=Math.floor(g?v-t.pointerX:0),L=Math.floor(m?w-t.pointerY:0);const W=D+(d?-O:O),B=T+(f?-L:L),Y=-i[0]*D,q=-i[1]*T;let z=Gd(W,C,S),V=Gd(B,N,M);if(l){let P=0,F=0;d&&O<0?P=Gs(E+O+Y,l[0][0]):!d&&O>0&&(P=qs(E+W+Y,l[1][0])),f&&L<0?F=Gs(R+L+q,l[0][1]):!f&&L>0&&(F=qs(R+B+q,l[1][1])),z=Math.max(z,P),V=Math.max(V,F)}if(u){let P=0,F=0;d&&O>0?P=qs(E+O,u[0][0]):!d&&O<0&&(P=Gs(E+W,u[1][0])),f&&L>0?F=qs(R+L,u[0][1]):!f&&L<0&&(F=Gs(R+B,u[1][1])),z=Math.max(z,P),V=Math.max(V,F)}if(s){if(g){const P=Gd(W/k,N,M)*k;if(z=Math.max(z,P),l){let F=0;!d&&!f||d&&!f&&y?F=qs(R+q+W/k,l[1][1])*k:F=Gs(R+q+(d?O:-O)/k,l[0][1])*k,z=Math.max(z,F)}if(u){let F=0;!d&&!f||d&&!f&&y?F=Gs(R+W/k,u[1][1])*k:F=qs(R+(d?O:-O)/k,u[0][1])*k,z=Math.max(z,F)}}if(m){const P=Gd(B*k,C,S)/k;if(V=Math.max(V,P),l){let F=0;!d&&!f||f&&!d&&y?F=qs(E+B*k+Y,l[1][0])/k:F=Gs(E+(f?L:-L)*k+Y,l[0][0])/k,V=Math.max(V,F)}if(u){let F=0;!d&&!f||f&&!d&&y?F=Gs(E+B*k,u[1][0])/k:F=qs(E+(f?L:-L)*k,u[0][0])/k,V=Math.max(V,F)}}}L=L+(L<0?V:-V),O=O+(O<0?z:-z),s&&(y?W>B*k?L=(jS(d,f)?-O:O)/k:O=(jS(d,f)?-L:L)*k:g?(L=O/k,f=d):(O=L*k,d=f));const A=d?E+O:E,H=f?R+L:R;return{width:D+(d?-O:O),height:T+(f?-L:L),x:i[0]*O*(d?-1:1)+A,y:i[1]*L*(f?-1:1)+H}}const TM={width:0,height:0,x:0,y:0},wH={...TM,pointerX:0,pointerY:0,aspectRatio:1};function SH(t){return[[0,0],[t.measured.width,t.measured.height]]}function CH(t,e,n){const o=e.position.x+t.position.x,s=e.position.y+t.position.y,i=t.measured.width??0,l=t.measured.height??0,u=n[0]*i,d=n[1]*l;return[[o-u,s-d],[o+i-u,s+l-d]]}function EH({domNode:t,nodeId:e,getStoreItems:n,onChange:o,onEnd:s}){const i=So(t);let l={controlDirection:kS("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function u({controlPosition:f,boundaries:g,keepAspectRatio:m,resizeDirection:y,onResizeStart:v,onResize:w,onResizeEnd:C,shouldResize:S}){let N={...TM},M={...wH};l={boundaries:g,resizeDirection:y,keepAspectRatio:m,controlDirection:kS(f)};let E,R=null,D=[],T,k,O,L=!1;const W=BN().on("start",B=>{const{nodeLookup:Y,transform:q,snapGrid:z,snapToGrid:V,nodeOrigin:A,paneDomNode:H}=n();if(E=Y.get(e),!E)return;R=H?.getBoundingClientRect()??null;const{xSnapped:P,ySnapped:F}=Rc(B.sourceEvent,{transform:q,snapGrid:z,snapToGrid:V,containerBounds:R});N={width:E.measured.width??0,height:E.measured.height??0,x:E.position.x??0,y:E.position.y??0},M={...N,pointerX:P,pointerY:F,aspectRatio:N.width/N.height},T=void 0,E.parentId&&(E.extent==="parent"||E.expandParent)&&(T=Y.get(E.parentId),k=T&&E.extent==="parent"?SH(T):void 0),D=[],O=void 0;for(const[Q,$]of Y)if($.parentId===e&&(D.push({id:Q,position:{...$.position},extent:$.extent}),$.extent==="parent"||$.expandParent)){const I=CH($,E,$.origin??A);O?O=[[Math.min(I[0][0],O[0][0]),Math.min(I[0][1],O[0][1])],[Math.max(I[1][0],O[1][0]),Math.max(I[1][1],O[1][1])]]:O=I}v?.(B,{...N})}).on("drag",B=>{const{transform:Y,snapGrid:q,snapToGrid:z,nodeOrigin:V}=n(),A=Rc(B.sourceEvent,{transform:Y,snapGrid:q,snapToGrid:z,containerBounds:R}),H=[];if(!E)return;const{x:P,y:F,width:Q,height:$}=N,I={},U=E.origin??V,{width:K,height:J,x:ne,y:X}=bH(M,l.controlDirection,A,l.boundaries,l.keepAspectRatio,U,k,O),ee=K!==Q,se=J!==$,le=ne!==P&&ee,pe=X!==F&&se;if(!le&&!pe&&!ee&&!se)return;if((le||pe||U[0]===1||U[1]===1)&&(I.x=le?ne:N.x,I.y=pe?X:N.y,N.x=I.x,N.y=I.y,D.length>0)){const Be=ne-P,Ie=X-F;for(const lt of D)lt.position={x:lt.position.x-Be+U[0]*(K-Q),y:lt.position.y-Ie+U[1]*(J-$)},H.push(lt)}if((ee||se)&&(I.width=ee&&(!l.resizeDirection||l.resizeDirection==="horizontal")?K:N.width,I.height=se&&(!l.resizeDirection||l.resizeDirection==="vertical")?J:N.height,N.width=I.width,N.height=I.height),T&&E.expandParent){const Be=U[0]*(I.width??0);I.x&&I.x<Be&&(N.x=Be,M.x=M.x-(I.x-Be));const Ie=U[1]*(I.height??0);I.y&&I.y<Ie&&(N.y=Ie,M.y=M.y-(I.y-Ie))}const ie=xH({width:N.width,prevWidth:Q,height:N.height,prevHeight:$,affectsX:l.controlDirection.affectsX,affectsY:l.controlDirection.affectsY}),be={...N,direction:ie};S?.(B,be)!==!1&&(L=!0,w?.(B,be),o(I,H))}).on("end",B=>{L&&(C?.(B,{...N}),s?.({...N}),L=!1)});i.call(W)}function d(){i.on(".drag",null)}return{update:u,destroy:d}}var hp={exports:{}},mp={};var AS;function _H(){if(AS)return mp;AS=1;var t=ll(),e=bj();function n(f,g){return f===g&&(f!==0||1/f===1/g)||f!==f&&g!==g}var o=typeof Object.is=="function"?Object.is:n,s=e.useSyncExternalStore,i=t.useRef,l=t.useEffect,u=t.useMemo,d=t.useDebugValue;return mp.useSyncExternalStoreWithSelector=function(f,g,m,y,v){var w=i(null);if(w.current===null){var C={hasValue:!1,value:null};w.current=C}else C=w.current;w=u(function(){function N(T){if(!M){if(M=!0,E=T,T=y(T),v!==void 0&&C.hasValue){var k=C.value;if(v(k,T))return R=k}return R=T}if(k=R,o(E,T))return k;var O=y(T);return v!==void 0&&v(k,O)?(E=T,k):(E=T,R=O)}var M=!1,E,R,D=m===void 0?null:m;return[function(){return N(g())},D===null?void 0:function(){return N(D())}]},[g,m,y,v]);var S=s(f,w[0],w[1]);return l(function(){C.hasValue=!0,C.value=S},[S]),d(S),S},mp}var OS;function NH(){return OS||(OS=1,hp.exports=_H()),hp.exports}var MH=NH();const RH=N0(MH),DH={},zS=t=>{let e;const n=new Set,o=(g,m)=>{const y=typeof g=="function"?g(e):g;if(!Object.is(y,e)){const v=e;e=m??(typeof y!="object"||y===null)?y:Object.assign({},e,y),n.forEach(w=>w(e,v))}},s=()=>e,d={setState:o,getState:s,getInitialState:()=>f,subscribe:g=>(n.add(g),()=>n.delete(g)),destroy:()=>{(DH?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},f=e=t(o,s,d);return d},TH=t=>t?zS(t):zS,{useDebugValue:kH}=de,{useSyncExternalStoreWithSelector:jH}=RH,AH=t=>t;function kM(t,e=AH,n){const o=jH(t.subscribe,t.getState,t.getServerState||t.getInitialState,e,n);return kH(o),o}const IS=(t,e)=>{const n=TH(t),o=(s,i=e)=>kM(n,s,i);return Object.assign(o,n),o},OH=(t,e)=>t?IS(t,e):IS;function an(t,e){if(Object.is(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(const[o,s]of t)if(!Object.is(s,e.get(o)))return!1;return!0}if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(const o of t)if(!e.has(o))return!1;return!0}const n=Object.keys(t);if(n.length!==Object.keys(e).length)return!1;for(const o of n)if(!Object.prototype.hasOwnProperty.call(e,o)||!Object.is(t[o],e[o]))return!1;return!0}const yh=x.createContext(null),zH=yh.Provider,jM=Mr.error001();function Ct(t,e){const n=x.useContext(yh);if(n===null)throw new Error(jM);return kM(n,t,e)}function ln(){const t=x.useContext(yh);if(t===null)throw new Error(jM);return x.useMemo(()=>({getState:t.getState,setState:t.setState,subscribe:t.subscribe}),[t])}const PS={display:"none"},IH={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},AM="react-flow__node-desc",OM="react-flow__edge-desc",PH="react-flow__aria-live",$H=t=>t.ariaLiveMessage,LH=t=>t.ariaLabelConfig;function HH({rfId:t}){const e=Ct($H);return p.jsx("div",{id:`${PH}-${t}`,"aria-live":"assertive","aria-atomic":"true",style:IH,children:e})}function BH({rfId:t,disableKeyboardA11y:e}){const n=Ct(LH);return p.jsxs(p.Fragment,{children:[p.jsx("div",{id:`${AM}-${t}`,style:PS,children:e?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),p.jsx("div",{id:`${OM}-${t}`,style:PS,children:n["edge.a11yDescription.default"]}),!e&&p.jsx(HH,{rfId:t})]})}const vh=x.forwardRef(({position:t="top-left",children:e,className:n,style:o,...s},i)=>{const l=`${t}`.split("-");return p.jsx("div",{className:Nn(["react-flow__panel",n,...l]),style:o,ref:i,...s,children:e})});vh.displayName="Panel";function FH({proOptions:t,position:e="bottom-right"}){return t?.hideAttribution?null:p.jsx(vh,{position:e,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:p.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const VH=t=>{const e=[],n=[];for(const[,o]of t.nodeLookup)o.selected&&e.push(o.internals.userNode);for(const[,o]of t.edgeLookup)o.selected&&n.push(o);return{selectedNodes:e,selectedEdges:n}},qd=t=>t.id;function UH(t,e){return an(t.selectedNodes.map(qd),e.selectedNodes.map(qd))&&an(t.selectedEdges.map(qd),e.selectedEdges.map(qd))}function YH({onSelectionChange:t}){const e=ln(),{selectedNodes:n,selectedEdges:o}=Ct(VH,UH);return x.useEffect(()=>{const s={nodes:n,edges:o};t?.(s),e.getState().onSelectionChangeHandlers.forEach(i=>i(s))},[n,o,t]),null}const GH=t=>!!t.onSelectionChangeHandlers;function qH({onSelectionChange:t}){const e=Ct(GH);return t||e?p.jsx(YH,{onSelectionChange:t}):null}const zM=[0,0],WH={x:0,y:0,zoom:1},KH=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],$S=[...KH,"rfId"],XH=t=>({setNodes:t.setNodes,setEdges:t.setEdges,setMinZoom:t.setMinZoom,setMaxZoom:t.setMaxZoom,setTranslateExtent:t.setTranslateExtent,setNodeExtent:t.setNodeExtent,reset:t.reset,setDefaultNodesAndEdges:t.setDefaultNodesAndEdges}),LS={translateExtent:Hc,nodeOrigin:zM,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function QH(t){const{setNodes:e,setEdges:n,setMinZoom:o,setMaxZoom:s,setTranslateExtent:i,setNodeExtent:l,reset:u,setDefaultNodesAndEdges:d}=Ct(XH,an),f=ln();x.useEffect(()=>(d(t.defaultNodes,t.defaultEdges),()=>{g.current=LS,u()}),[]);const g=x.useRef(LS);return x.useEffect(()=>{for(const m of $S){const y=t[m],v=g.current[m];y!==v&&(typeof t[m]>"u"||(m==="nodes"?e(y):m==="edges"?n(y):m==="minZoom"?o(y):m==="maxZoom"?s(y):m==="translateExtent"?i(y):m==="nodeExtent"?l(y):m==="ariaLabelConfig"?f.setState({ariaLabelConfig:IL(y)}):m==="fitView"?f.setState({fitViewQueued:y}):m==="fitViewOptions"?f.setState({fitViewOptions:y}):f.setState({[m]:y})))}g.current=t},$S.map(m=>t[m])),null}function HS(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function ZH(t){const[e,n]=x.useState(t==="system"?null:t);return x.useEffect(()=>{if(t!=="system"){n(t);return}const o=HS(),s=()=>n(o?.matches?"dark":"light");return s(),o?.addEventListener("change",s),()=>{o?.removeEventListener("change",s)}},[t]),e!==null?e:HS()?.matches?"dark":"light"}const BS=typeof document<"u"?document:null;function Uc(t=null,e={target:BS,actInsideInputWithModifier:!0}){const[n,o]=x.useState(!1),s=x.useRef(!1),i=x.useRef(new Set([])),[l,u]=x.useMemo(()=>{if(t!==null){const f=(Array.isArray(t)?t:[t]).filter(m=>typeof m=="string").map(m=>m.replace("+",`
56
- `).replace(`
57
-
58
- `,`
59
- +`).split(`
60
- `)),g=f.reduce((m,y)=>m.concat(...y),[]);return[f,g]}return[[],[]]},[t]);return x.useEffect(()=>{const d=e?.target??BS,f=e?.actInsideInputWithModifier??!0;if(t!==null){const g=v=>{if(s.current=v.ctrlKey||v.metaKey||v.shiftKey||v.altKey,(!s.current||s.current&&!f)&&mM(v))return!1;const C=VS(v.code,u);if(i.current.add(v[C]),FS(l,i.current,!1)){const S=v.composedPath?.()?.[0]||v.target,N=S?.nodeName==="BUTTON"||S?.nodeName==="A";e.preventDefault!==!1&&(s.current||!N)&&v.preventDefault(),o(!0)}},m=v=>{const w=VS(v.code,u);FS(l,i.current,!0)?(o(!1),i.current.clear()):i.current.delete(v[w]),v.key==="Meta"&&i.current.clear(),s.current=!1},y=()=>{i.current.clear(),o(!1)};return d?.addEventListener("keydown",g),d?.addEventListener("keyup",m),window.addEventListener("blur",y),window.addEventListener("contextmenu",y),()=>{d?.removeEventListener("keydown",g),d?.removeEventListener("keyup",m),window.removeEventListener("blur",y),window.removeEventListener("contextmenu",y)}}},[t,o]),n}function FS(t,e,n){return t.filter(o=>n||o.length===e.size).some(o=>o.every(s=>e.has(s)))}function VS(t,e){return e.includes(t)?"code":"key"}const JH=()=>{const t=ln();return x.useMemo(()=>({zoomIn:e=>{const{panZoom:n}=t.getState();return n?n.scaleBy(1.2,{duration:e?.duration}):Promise.resolve(!1)},zoomOut:e=>{const{panZoom:n}=t.getState();return n?n.scaleBy(1/1.2,{duration:e?.duration}):Promise.resolve(!1)},zoomTo:(e,n)=>{const{panZoom:o}=t.getState();return o?o.scaleTo(e,{duration:n?.duration}):Promise.resolve(!1)},getZoom:()=>t.getState().transform[2],setViewport:async(e,n)=>{const{transform:[o,s,i],panZoom:l}=t.getState();return l?(await l.setViewport({x:e.x??o,y:e.y??s,zoom:e.zoom??i},n),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[e,n,o]=t.getState().transform;return{x:e,y:n,zoom:o}},setCenter:async(e,n,o)=>t.getState().setCenter(e,n,o),fitBounds:async(e,n)=>{const{width:o,height:s,minZoom:i,maxZoom:l,panZoom:u}=t.getState(),d=Ly(e,o,s,i,l,n?.padding??.1);return u?(await u.setViewport(d,{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(e,n={})=>{const{transform:o,snapGrid:s,snapToGrid:i,domNode:l}=t.getState();if(!l)return e;const{x:u,y:d}=l.getBoundingClientRect(),f={x:e.x-u,y:e.y-d},g=n.snapGrid??s,m=n.snapToGrid??i;return hu(f,o,m,g)},flowToScreenPosition:e=>{const{transform:n,domNode:o}=t.getState();if(!o)return e;const{x:s,y:i}=o.getBoundingClientRect(),l=kf(e,n);return{x:l.x+s,y:l.y+i}}}),[])};function IM(t,e){const n=[],o=new Map,s=[];for(const i of t)if(i.type==="add"){s.push(i);continue}else if(i.type==="remove"||i.type==="replace")o.set(i.id,[i]);else{const l=o.get(i.id);l?l.push(i):o.set(i.id,[i])}for(const i of e){const l=o.get(i.id);if(!l){n.push(i);continue}if(l[0].type==="remove")continue;if(l[0].type==="replace"){n.push({...l[0].item});continue}const u={...i};for(const d of l)eB(d,u);n.push(u)}return s.length&&s.forEach(i=>{i.index!==void 0?n.splice(i.index,0,{...i.item}):n.push({...i.item})}),n}function eB(t,e){switch(t.type){case"select":{e.selected=t.selected;break}case"position":{typeof t.position<"u"&&(e.position=t.position),typeof t.dragging<"u"&&(e.dragging=t.dragging);break}case"dimensions":{typeof t.dimensions<"u"&&(e.measured={...t.dimensions},t.setAttributes&&((t.setAttributes===!0||t.setAttributes==="width")&&(e.width=t.dimensions.width),(t.setAttributes===!0||t.setAttributes==="height")&&(e.height=t.dimensions.height))),typeof t.resizing=="boolean"&&(e.resizing=t.resizing);break}}}function PM(t,e){return IM(t,e)}function $M(t,e){return IM(t,e)}function ka(t,e){return{id:t,type:"select",selected:e}}function Vi(t,e=new Set,n=!1){const o=[];for(const[s,i]of t){const l=e.has(s);!(i.selected===void 0&&!l)&&i.selected!==l&&(n&&(i.selected=l),o.push(ka(i.id,l)))}return o}function US({items:t=[],lookup:e}){const n=[],o=new Map(t.map(s=>[s.id,s]));for(const[s,i]of t.entries()){const l=e.get(i.id),u=l?.internals?.userNode??l;u!==void 0&&u!==i&&n.push({id:i.id,item:i,type:"replace"}),u===void 0&&n.push({item:i,type:"add",index:s})}for(const[s]of e)o.get(s)===void 0&&n.push({id:s,type:"remove"});return n}function YS(t){return{id:t.id,type:"remove"}}const GS=t=>NL(t),tB=t=>iM(t);function LM(t){return x.forwardRef(t)}const nB=typeof window<"u"?x.useLayoutEffect:x.useEffect;function qS(t){const[e,n]=x.useState(BigInt(0)),[o]=x.useState(()=>oB(()=>n(s=>s+BigInt(1))));return nB(()=>{const s=o.get();s.length&&(t(s),o.reset())},[e]),o}function oB(t){let e=[];return{get:()=>e,reset:()=>{e=[]},push:n=>{e.push(n),t()}}}const HM=x.createContext(null);function rB({children:t}){const e=ln(),n=x.useCallback(u=>{const{nodes:d=[],setNodes:f,hasDefaultNodes:g,onNodesChange:m,nodeLookup:y,fitViewQueued:v,onNodesChangeMiddlewareMap:w}=e.getState();let C=d;for(const N of u)C=typeof N=="function"?N(C):N;let S=US({items:C,lookup:y});for(const N of w.values())S=N(S);g&&f(C),S.length>0?m?.(S):v&&window.requestAnimationFrame(()=>{const{fitViewQueued:N,nodes:M,setNodes:E}=e.getState();N&&E(M)})},[]),o=qS(n),s=x.useCallback(u=>{const{edges:d=[],setEdges:f,hasDefaultEdges:g,onEdgesChange:m,edgeLookup:y}=e.getState();let v=d;for(const w of u)v=typeof w=="function"?w(v):w;g?f(v):m&&m(US({items:v,lookup:y}))},[]),i=qS(s),l=x.useMemo(()=>({nodeQueue:o,edgeQueue:i}),[]);return p.jsx(HM.Provider,{value:l,children:t})}function sB(){const t=x.useContext(HM);if(!t)throw new Error("useBatchContext must be used within a BatchProvider");return t}const aB=t=>!!t.panZoom;function xh(){const t=JH(),e=ln(),n=sB(),o=Ct(aB),s=x.useMemo(()=>{const i=m=>e.getState().nodeLookup.get(m),l=m=>{n.nodeQueue.push(m)},u=m=>{n.edgeQueue.push(m)},d=m=>{const{nodeLookup:y,nodeOrigin:v}=e.getState(),w=GS(m)?m:y.get(m.id),C=w.parentId?fM(w.position,w.measured,w.parentId,y,v):w.position,S={...w,position:C,width:w.measured?.width??w.width,height:w.measured?.height??w.height};return nl(S)},f=(m,y,v={replace:!1})=>{l(w=>w.map(C=>{if(C.id===m){const S=typeof y=="function"?y(C):y;return v.replace&&GS(S)?S:{...C,...S}}return C}))},g=(m,y,v={replace:!1})=>{u(w=>w.map(C=>{if(C.id===m){const S=typeof y=="function"?y(C):y;return v.replace&&tB(S)?S:{...C,...S}}return C}))};return{getNodes:()=>e.getState().nodes.map(m=>({...m})),getNode:m=>i(m)?.internals.userNode,getInternalNode:i,getEdges:()=>{const{edges:m=[]}=e.getState();return m.map(y=>({...y}))},getEdge:m=>e.getState().edgeLookup.get(m),setNodes:l,setEdges:u,addNodes:m=>{const y=Array.isArray(m)?m:[m];n.nodeQueue.push(v=>[...v,...y])},addEdges:m=>{const y=Array.isArray(m)?m:[m];n.edgeQueue.push(v=>[...v,...y])},toObject:()=>{const{nodes:m=[],edges:y=[],transform:v}=e.getState(),[w,C,S]=v;return{nodes:m.map(N=>({...N})),edges:y.map(N=>({...N})),viewport:{x:w,y:C,zoom:S}}},deleteElements:async({nodes:m=[],edges:y=[]})=>{const{nodes:v,edges:w,onNodesDelete:C,onEdgesDelete:S,triggerNodeChanges:N,triggerEdgeChanges:M,onDelete:E,onBeforeDelete:R}=e.getState(),{nodes:D,edges:T}=await kL({nodesToRemove:m,edgesToRemove:y,nodes:v,edges:w,onBeforeDelete:R}),k=T.length>0,O=D.length>0;if(k){const L=T.map(YS);S?.(T),M(L)}if(O){const L=D.map(YS);C?.(D),N(L)}return(O||k)&&E?.({nodes:D,edges:T}),{deletedNodes:D,deletedEdges:T}},getIntersectingNodes:(m,y=!0,v)=>{const w=bS(m),C=w?m:d(m),S=v!==void 0;return C?(v||e.getState().nodes).filter(N=>{const M=e.getState().nodeLookup.get(N.id);if(M&&!w&&(N.id===m.id||!M.internals.positionAbsolute))return!1;const E=nl(S?N:M),R=Fc(E,C);return y&&R>0||R>=E.width*E.height||R>=C.width*C.height}):[]},isNodeIntersecting:(m,y,v=!0)=>{const C=bS(m)?m:d(m);if(!C)return!1;const S=Fc(C,y);return v&&S>0||S>=y.width*y.height||S>=C.width*C.height},updateNode:f,updateNodeData:(m,y,v={replace:!1})=>{f(m,w=>{const C=typeof y=="function"?y(w):y;return v.replace?{...w,data:C}:{...w,data:{...w.data,...C}}},v)},updateEdge:g,updateEdgeData:(m,y,v={replace:!1})=>{g(m,w=>{const C=typeof y=="function"?y(w):y;return v.replace?{...w,data:C}:{...w,data:{...w.data,...C}}},v)},getNodesBounds:m=>{const{nodeLookup:y,nodeOrigin:v}=e.getState();return ML(m,{nodeLookup:y,nodeOrigin:v})},getHandleConnections:({type:m,id:y,nodeId:v})=>Array.from(e.getState().connectionLookup.get(`${v}-${m}${y?`-${y}`:""}`)?.values()??[]),getNodeConnections:({type:m,handleId:y,nodeId:v})=>Array.from(e.getState().connectionLookup.get(`${v}${m?y?`-${m}-${y}`:`-${m}`:""}`)?.values()??[]),fitView:async m=>{const y=e.getState().fitViewResolver??zL();return e.setState({fitViewQueued:!0,fitViewOptions:m,fitViewResolver:y}),n.nodeQueue.push(v=>[...v]),y.promise}}},[]);return x.useMemo(()=>({...s,...t,viewportInitialized:o}),[o])}const WS=t=>t.selected,iB=typeof window<"u"?window:void 0;function lB({deleteKeyCode:t,multiSelectionKeyCode:e}){const n=ln(),{deleteElements:o}=xh(),s=Uc(t,{actInsideInputWithModifier:!1}),i=Uc(e,{target:iB});x.useEffect(()=>{if(s){const{edges:l,nodes:u}=n.getState();o({nodes:u.filter(WS),edges:l.filter(WS)}),n.setState({nodesSelectionActive:!1})}},[s]),x.useEffect(()=>{n.setState({multiSelectionActive:i})},[i])}function cB(t){const e=ln();x.useEffect(()=>{const n=()=>{if(!t.current||!(t.current.checkVisibility?.()??!0))return!1;const o=By(t.current);(o.height===0||o.width===0)&&e.getState().onError?.("004",Mr.error004()),e.setState({width:o.width||500,height:o.height||500})};if(t.current){n(),window.addEventListener("resize",n);const o=new ResizeObserver(()=>n());return o.observe(t.current),()=>{window.removeEventListener("resize",n),o&&t.current&&o.unobserve(t.current)}}},[])}const bh={position:"absolute",width:"100%",height:"100%",top:0,left:0},uB=t=>({userSelectionActive:t.userSelectionActive,lib:t.lib,connectionInProgress:t.connection.inProgress});function dB({onPaneContextMenu:t,zoomOnScroll:e=!0,zoomOnPinch:n=!0,panOnScroll:o=!1,panOnScrollSpeed:s=.5,panOnScrollMode:i=Pa.Free,zoomOnDoubleClick:l=!0,panOnDrag:u=!0,defaultViewport:d,translateExtent:f,minZoom:g,maxZoom:m,zoomActivationKeyCode:y,preventScrolling:v=!0,children:w,noWheelClassName:C,noPanClassName:S,onViewportChange:N,isControlledViewport:M,paneClickDistance:E,selectionOnDrag:R}){const D=ln(),T=x.useRef(null),{userSelectionActive:k,lib:O,connectionInProgress:L}=Ct(uB,an),W=Uc(y),B=x.useRef();cB(T);const Y=x.useCallback(q=>{N?.({x:q[0],y:q[1],zoom:q[2]}),M||D.setState({transform:q})},[N,M]);return x.useEffect(()=>{if(T.current){B.current=vH({domNode:T.current,minZoom:g,maxZoom:m,translateExtent:f,viewport:d,onDraggingChange:A=>D.setState({paneDragging:A}),onPanZoomStart:(A,H)=>{const{onViewportChangeStart:P,onMoveStart:F}=D.getState();F?.(A,H),P?.(H)},onPanZoom:(A,H)=>{const{onViewportChange:P,onMove:F}=D.getState();F?.(A,H),P?.(H)},onPanZoomEnd:(A,H)=>{const{onViewportChangeEnd:P,onMoveEnd:F}=D.getState();F?.(A,H),P?.(H)}});const{x:q,y:z,zoom:V}=B.current.getViewport();return D.setState({panZoom:B.current,transform:[q,z,V],domNode:T.current.closest(".react-flow")}),()=>{B.current?.destroy()}}},[]),x.useEffect(()=>{B.current?.update({onPaneContextMenu:t,zoomOnScroll:e,zoomOnPinch:n,panOnScroll:o,panOnScrollSpeed:s,panOnScrollMode:i,zoomOnDoubleClick:l,panOnDrag:u,zoomActivationKeyPressed:W,preventScrolling:v,noPanClassName:S,userSelectionActive:k,noWheelClassName:C,lib:O,onTransformChange:Y,connectionInProgress:L,selectionOnDrag:R,paneClickDistance:E})},[t,e,n,o,s,i,l,u,W,v,S,k,C,O,Y,L,R,E]),p.jsx("div",{className:"react-flow__renderer",ref:T,style:bh,children:w})}const fB=t=>({userSelectionActive:t.userSelectionActive,userSelectionRect:t.userSelectionRect});function hB(){const{userSelectionActive:t,userSelectionRect:e}=Ct(fB,an);return t&&e?p.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:e.width,height:e.height,transform:`translate(${e.x}px, ${e.y}px)`}}):null}const gp=(t,e)=>n=>{n.target===e.current&&t?.(n)},mB=t=>({userSelectionActive:t.userSelectionActive,elementsSelectable:t.elementsSelectable,connectionInProgress:t.connection.inProgress,dragging:t.paneDragging});function gB({isSelecting:t,selectionKeyPressed:e,selectionMode:n=Bc.Full,panOnDrag:o,paneClickDistance:s,selectionOnDrag:i,onSelectionStart:l,onSelectionEnd:u,onPaneClick:d,onPaneContextMenu:f,onPaneScroll:g,onPaneMouseEnter:m,onPaneMouseMove:y,onPaneMouseLeave:v,children:w}){const C=ln(),{userSelectionActive:S,elementsSelectable:N,dragging:M,connectionInProgress:E}=Ct(mB,an),R=N&&(t||S),D=x.useRef(null),T=x.useRef(),k=x.useRef(new Set),O=x.useRef(new Set),L=x.useRef(!1),W=P=>{if(L.current||E){L.current=!1;return}d?.(P),C.getState().resetSelectedElements(),C.setState({nodesSelectionActive:!1})},B=P=>{if(Array.isArray(o)&&o?.includes(2)){P.preventDefault();return}f?.(P)},Y=g?P=>g(P):void 0,q=P=>{L.current&&(P.stopPropagation(),L.current=!1)},z=P=>{const{domNode:F}=C.getState();if(T.current=F?.getBoundingClientRect(),!T.current)return;const Q=P.target===D.current;if(!Q&&!!P.target.closest(".nokey")||!t||!(i&&Q||e)||P.button!==0||!P.isPrimary)return;P.target?.setPointerCapture?.(P.pointerId),L.current=!1;const{x:U,y:K}=er(P.nativeEvent,T.current);C.setState({userSelectionRect:{width:0,height:0,startX:U,startY:K,x:U,y:K}}),Q||(P.stopPropagation(),P.preventDefault())},V=P=>{const{userSelectionRect:F,transform:Q,nodeLookup:$,edgeLookup:I,connectionLookup:U,triggerNodeChanges:K,triggerEdgeChanges:J,defaultEdgeOptions:ne,resetSelectedElements:X}=C.getState();if(!T.current||!F)return;const{x:ee,y:se}=er(P.nativeEvent,T.current),{startX:le,startY:pe}=F;if(!L.current){const Ie=e?0:s;if(Math.hypot(ee-le,se-pe)<=Ie)return;X(),l?.(P)}L.current=!0;const ie={startX:le,startY:pe,x:ee<le?ee:le,y:se<pe?se:pe,width:Math.abs(ee-le),height:Math.abs(se-pe)},be=k.current,ke=O.current;k.current=new Set($y($,ie,Q,n===Bc.Partial,!0).map(Ie=>Ie.id)),O.current=new Set;const Be=ne?.selectable??!0;for(const Ie of k.current){const lt=U.get(Ie);if(lt)for(const{edgeId:cn}of lt.values()){const ht=I.get(cn);ht&&(ht.selectable??Be)&&O.current.add(cn)}}if(!wS(be,k.current)){const Ie=Vi($,k.current,!0);K(Ie)}if(!wS(ke,O.current)){const Ie=Vi(I,O.current);J(Ie)}C.setState({userSelectionRect:ie,userSelectionActive:!0,nodesSelectionActive:!1})},A=P=>{P.button===0&&(P.target?.releasePointerCapture?.(P.pointerId),!S&&P.target===D.current&&C.getState().userSelectionRect&&W?.(P),C.setState({userSelectionActive:!1,userSelectionRect:null}),L.current&&(u?.(P),C.setState({nodesSelectionActive:k.current.size>0})))},H=o===!0||Array.isArray(o)&&o.includes(0);return p.jsxs("div",{className:Nn(["react-flow__pane",{draggable:H,dragging:M,selection:t}]),onClick:R?void 0:gp(W,D),onContextMenu:gp(B,D),onWheel:gp(Y,D),onPointerEnter:R?void 0:m,onPointerMove:R?V:y,onPointerUp:R?A:void 0,onPointerDownCapture:R?z:void 0,onClickCapture:R?q:void 0,onPointerLeave:v,ref:D,style:bh,children:[w,p.jsx(hB,{})]})}function g0({id:t,store:e,unselect:n=!1,nodeRef:o}){const{addSelectedNodes:s,unselectNodesAndEdges:i,multiSelectionActive:l,nodeLookup:u,onError:d}=e.getState(),f=u.get(t);if(!f){d?.("012",Mr.error012(t));return}e.setState({nodesSelectionActive:!1}),f.selected?(n||f.selected&&l)&&(i({nodes:[f],edges:[]}),requestAnimationFrame(()=>o?.current?.blur())):s([t])}function BM({nodeRef:t,disabled:e=!1,noDragClassName:n,handleSelector:o,nodeId:s,isSelectable:i,nodeClickDistance:l}){const u=ln(),[d,f]=x.useState(!1),g=x.useRef();return x.useEffect(()=>{g.current=rH({getStoreItems:()=>u.getState(),onNodeMouseDown:m=>{g0({id:m,store:u,nodeRef:t})},onDragStart:()=>{f(!0)},onDragStop:()=>{f(!1)}})},[]),x.useEffect(()=>{if(e)g.current?.destroy();else if(t.current)return g.current?.update({noDragClassName:n,handleSelector:o,domNode:t.current,isSelectable:i,nodeId:s,nodeClickDistance:l}),()=>{g.current?.destroy()}},[n,o,e,i,t,s]),d}const pB=t=>e=>e.selected&&(e.draggable||t&&typeof e.draggable>"u");function FM(){const t=ln();return x.useCallback(n=>{const{nodeExtent:o,snapToGrid:s,snapGrid:i,nodesDraggable:l,onError:u,updateNodePositions:d,nodeLookup:f,nodeOrigin:g}=t.getState(),m=new Map,y=pB(l),v=s?i[0]:5,w=s?i[1]:5,C=n.direction.x*v*n.factor,S=n.direction.y*w*n.factor;for(const[,N]of f){if(!y(N))continue;let M={x:N.internals.positionAbsolute.x+C,y:N.internals.positionAbsolute.y+S};s&&(M=fu(M,i));const{position:E,positionAbsolute:R}=lM({nodeId:N.id,nextPosition:M,nodeLookup:f,nodeExtent:o,nodeOrigin:g,onError:u});N.position=E,N.internals.positionAbsolute=R,m.set(N.id,N)}d(m)},[])}const qy=x.createContext(null),yB=qy.Provider;qy.Consumer;const VM=()=>x.useContext(qy),vB=t=>({connectOnClick:t.connectOnClick,noPanClassName:t.noPanClassName,rfId:t.rfId}),xB=(t,e,n)=>o=>{const{connectionClickStartHandle:s,connectionMode:i,connection:l}=o,{fromHandle:u,toHandle:d,isValid:f}=l,g=d?.nodeId===t&&d?.id===e&&d?.type===n;return{connectingFrom:u?.nodeId===t&&u?.id===e&&u?.type===n,connectingTo:g,clickConnecting:s?.nodeId===t&&s?.id===e&&s?.type===n,isPossibleEndHandle:i===el.Strict?u?.type!==n:t!==u?.nodeId||e!==u?.id,connectionInProcess:!!u,clickConnectionInProcess:!!s,valid:g&&f}};function bB({type:t="source",position:e=qe.Top,isValidConnection:n,isConnectable:o=!0,isConnectableStart:s=!0,isConnectableEnd:i=!0,id:l,onConnect:u,children:d,className:f,onMouseDown:g,onTouchStart:m,...y},v){const w=l||null,C=t==="target",S=ln(),N=VM(),{connectOnClick:M,noPanClassName:E,rfId:R}=Ct(vB,an),{connectingFrom:D,connectingTo:T,clickConnecting:k,isPossibleEndHandle:O,connectionInProcess:L,clickConnectionInProcess:W,valid:B}=Ct(xB(N,w,t),an);N||S.getState().onError?.("010",Mr.error010());const Y=V=>{const{defaultEdgeOptions:A,onConnect:H,hasDefaultEdges:P}=S.getState(),F={...A,...V};if(P){const{edges:Q,setEdges:$}=S.getState();$(FL(F,Q))}H?.(F),u?.(F)},q=V=>{if(!N)return;const A=gM(V.nativeEvent);if(s&&(A&&V.button===0||!A)){const H=S.getState();m0.onPointerDown(V.nativeEvent,{handleDomNode:V.currentTarget,autoPanOnConnect:H.autoPanOnConnect,connectionMode:H.connectionMode,connectionRadius:H.connectionRadius,domNode:H.domNode,nodeLookup:H.nodeLookup,lib:H.lib,isTarget:C,handleId:w,nodeId:N,flowId:H.rfId,panBy:H.panBy,cancelConnection:H.cancelConnection,onConnectStart:H.onConnectStart,onConnectEnd:H.onConnectEnd,updateConnection:H.updateConnection,onConnect:Y,isValidConnection:n||H.isValidConnection,getTransform:()=>S.getState().transform,getFromHandle:()=>S.getState().connection.fromHandle,autoPanSpeed:H.autoPanSpeed,dragThreshold:H.connectionDragThreshold})}A?g?.(V):m?.(V)},z=V=>{const{onClickConnectStart:A,onClickConnectEnd:H,connectionClickStartHandle:P,connectionMode:F,isValidConnection:Q,lib:$,rfId:I,nodeLookup:U,connection:K}=S.getState();if(!N||!P&&!s)return;if(!P){A?.(V.nativeEvent,{nodeId:N,handleId:w,handleType:t}),S.setState({connectionClickStartHandle:{nodeId:N,type:t,id:w}});return}const J=hM(V.target),ne=n||Q,{connection:X,isValid:ee}=m0.isValid(V.nativeEvent,{handle:{nodeId:N,id:w,type:t},connectionMode:F,fromNodeId:P.nodeId,fromHandleId:P.id||null,fromType:P.type,isValidConnection:ne,flowId:I,doc:J,lib:$,nodeLookup:U});ee&&X&&Y(X);const se=structuredClone(K);delete se.inProgress,se.toPosition=se.toHandle?se.toHandle.position:null,H?.(V,se),S.setState({connectionClickStartHandle:null})};return p.jsx("div",{"data-handleid":w,"data-nodeid":N,"data-handlepos":e,"data-id":`${R}-${N}-${w}-${t}`,className:Nn(["react-flow__handle",`react-flow__handle-${e}`,"nodrag",E,f,{source:!C,target:C,connectable:o,connectablestart:s,connectableend:i,clickconnecting:k,connectingfrom:D,connectingto:T,valid:B,connectionindicator:o&&(!L||O)&&(L||W?i:s)}]),onMouseDown:q,onTouchStart:q,onClick:M?z:void 0,ref:v,...y,children:d})}const sl=x.memo(LM(bB));function wB({data:t,isConnectable:e,sourcePosition:n=qe.Bottom}){return p.jsxs(p.Fragment,{children:[t?.label,p.jsx(sl,{type:"source",position:n,isConnectable:e})]})}function SB({data:t,isConnectable:e,targetPosition:n=qe.Top,sourcePosition:o=qe.Bottom}){return p.jsxs(p.Fragment,{children:[p.jsx(sl,{type:"target",position:n,isConnectable:e}),t?.label,p.jsx(sl,{type:"source",position:o,isConnectable:e})]})}function CB(){return null}function EB({data:t,isConnectable:e,targetPosition:n=qe.Top}){return p.jsxs(p.Fragment,{children:[p.jsx(sl,{type:"target",position:n,isConnectable:e}),t?.label]})}const jf={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},KS={input:wB,default:SB,output:EB,group:CB};function _B(t){return t.internals.handleBounds===void 0?{width:t.width??t.initialWidth??t.style?.width,height:t.height??t.initialHeight??t.style?.height}:{width:t.width??t.style?.width,height:t.height??t.style?.height}}const NB=t=>{const{width:e,height:n,x:o,y:s}=du(t.nodeLookup,{filter:i=>!!i.selected});return{width:Jo(e)?e:null,height:Jo(n)?n:null,userSelectionActive:t.userSelectionActive,transformString:`translate(${t.transform[0]}px,${t.transform[1]}px) scale(${t.transform[2]}) translate(${o}px,${s}px)`}};function MB({onSelectionContextMenu:t,noPanClassName:e,disableKeyboardA11y:n}){const o=ln(),{width:s,height:i,transformString:l,userSelectionActive:u}=Ct(NB,an),d=FM(),f=x.useRef(null);if(x.useEffect(()=>{n||f.current?.focus({preventScroll:!0})},[n]),BM({nodeRef:f}),u||!s||!i)return null;const g=t?y=>{const v=o.getState().nodes.filter(w=>w.selected);t(y,v)}:void 0,m=y=>{Object.prototype.hasOwnProperty.call(jf,y.key)&&(y.preventDefault(),d({direction:jf[y.key],factor:y.shiftKey?4:1}))};return p.jsx("div",{className:Nn(["react-flow__nodesselection","react-flow__container",e]),style:{transform:l},children:p.jsx("div",{ref:f,className:"react-flow__nodesselection-rect",onContextMenu:g,tabIndex:n?void 0:-1,onKeyDown:n?void 0:m,style:{width:s,height:i}})})}const XS=typeof window<"u"?window:void 0,RB=t=>({nodesSelectionActive:t.nodesSelectionActive,userSelectionActive:t.userSelectionActive});function UM({children:t,onPaneClick:e,onPaneMouseEnter:n,onPaneMouseMove:o,onPaneMouseLeave:s,onPaneContextMenu:i,onPaneScroll:l,paneClickDistance:u,deleteKeyCode:d,selectionKeyCode:f,selectionOnDrag:g,selectionMode:m,onSelectionStart:y,onSelectionEnd:v,multiSelectionKeyCode:w,panActivationKeyCode:C,zoomActivationKeyCode:S,elementsSelectable:N,zoomOnScroll:M,zoomOnPinch:E,panOnScroll:R,panOnScrollSpeed:D,panOnScrollMode:T,zoomOnDoubleClick:k,panOnDrag:O,defaultViewport:L,translateExtent:W,minZoom:B,maxZoom:Y,preventScrolling:q,onSelectionContextMenu:z,noWheelClassName:V,noPanClassName:A,disableKeyboardA11y:H,onViewportChange:P,isControlledViewport:F}){const{nodesSelectionActive:Q,userSelectionActive:$}=Ct(RB,an),I=Uc(f,{target:XS}),U=Uc(C,{target:XS}),K=U||O,J=U||R,ne=g&&K!==!0,X=I||$||ne;return lB({deleteKeyCode:d,multiSelectionKeyCode:w}),p.jsx(dB,{onPaneContextMenu:i,elementsSelectable:N,zoomOnScroll:M,zoomOnPinch:E,panOnScroll:J,panOnScrollSpeed:D,panOnScrollMode:T,zoomOnDoubleClick:k,panOnDrag:!I&&K,defaultViewport:L,translateExtent:W,minZoom:B,maxZoom:Y,zoomActivationKeyCode:S,preventScrolling:q,noWheelClassName:V,noPanClassName:A,onViewportChange:P,isControlledViewport:F,paneClickDistance:u,selectionOnDrag:ne,children:p.jsxs(gB,{onSelectionStart:y,onSelectionEnd:v,onPaneClick:e,onPaneMouseEnter:n,onPaneMouseMove:o,onPaneMouseLeave:s,onPaneContextMenu:i,onPaneScroll:l,panOnDrag:K,isSelecting:!!X,selectionMode:m,selectionKeyPressed:I,paneClickDistance:u,selectionOnDrag:ne,children:[t,Q&&p.jsx(MB,{onSelectionContextMenu:z,noPanClassName:A,disableKeyboardA11y:H})]})})}UM.displayName="FlowRenderer";const DB=x.memo(UM),TB=t=>e=>t?$y(e.nodeLookup,{x:0,y:0,width:e.width,height:e.height},e.transform,!0).map(n=>n.id):Array.from(e.nodeLookup.keys());function kB(t){return Ct(x.useCallback(TB(t),[t]),an)}const jB=t=>t.updateNodeInternals;function AB(){const t=Ct(jB),[e]=x.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const o=new Map;n.forEach(s=>{const i=s.target.getAttribute("data-id");o.set(i,{id:i,nodeElement:s.target,force:!0})}),t(o)}));return x.useEffect(()=>()=>{e?.disconnect()},[e]),e}function OB({node:t,nodeType:e,hasDimensions:n,resizeObserver:o}){const s=ln(),i=x.useRef(null),l=x.useRef(null),u=x.useRef(t.sourcePosition),d=x.useRef(t.targetPosition),f=x.useRef(e),g=n&&!!t.internals.handleBounds;return x.useEffect(()=>{i.current&&!t.hidden&&(!g||l.current!==i.current)&&(l.current&&o?.unobserve(l.current),o?.observe(i.current),l.current=i.current)},[g,t.hidden]),x.useEffect(()=>()=>{l.current&&(o?.unobserve(l.current),l.current=null)},[]),x.useEffect(()=>{if(i.current){const m=f.current!==e,y=u.current!==t.sourcePosition,v=d.current!==t.targetPosition;(m||y||v)&&(f.current=e,u.current=t.sourcePosition,d.current=t.targetPosition,s.getState().updateNodeInternals(new Map([[t.id,{id:t.id,nodeElement:i.current,force:!0}]])))}},[t.id,e,t.sourcePosition,t.targetPosition]),i}function zB({id:t,onClick:e,onMouseEnter:n,onMouseMove:o,onMouseLeave:s,onContextMenu:i,onDoubleClick:l,nodesDraggable:u,elementsSelectable:d,nodesConnectable:f,nodesFocusable:g,resizeObserver:m,noDragClassName:y,noPanClassName:v,disableKeyboardA11y:w,rfId:C,nodeTypes:S,nodeClickDistance:N,onError:M}){const{node:E,internals:R,isParent:D}=Ct(ee=>{const se=ee.nodeLookup.get(t),le=ee.parentLookup.has(t);return{node:se,internals:se.internals,isParent:le}},an);let T=E.type||"default",k=S?.[T]||KS[T];k===void 0&&(M?.("003",Mr.error003(T)),T="default",k=S?.default||KS.default);const O=!!(E.draggable||u&&typeof E.draggable>"u"),L=!!(E.selectable||d&&typeof E.selectable>"u"),W=!!(E.connectable||f&&typeof E.connectable>"u"),B=!!(E.focusable||g&&typeof E.focusable>"u"),Y=ln(),q=Hy(E),z=OB({node:E,nodeType:T,hasDimensions:q,resizeObserver:m}),V=BM({nodeRef:z,disabled:E.hidden||!O,noDragClassName:y,handleSelector:E.dragHandle,nodeId:t,isSelectable:L,nodeClickDistance:N}),A=FM();if(E.hidden)return null;const H=xs(E),P=_B(E),F=L||O||e||n||o||s,Q=n?ee=>n(ee,{...R.userNode}):void 0,$=o?ee=>o(ee,{...R.userNode}):void 0,I=s?ee=>s(ee,{...R.userNode}):void 0,U=i?ee=>i(ee,{...R.userNode}):void 0,K=l?ee=>l(ee,{...R.userNode}):void 0,J=ee=>{const{selectNodesOnDrag:se,nodeDragThreshold:le}=Y.getState();L&&(!se||!O||le>0)&&g0({id:t,store:Y,nodeRef:z}),e&&e(ee,{...R.userNode})},ne=ee=>{if(!(mM(ee.nativeEvent)||w)){if(oM.includes(ee.key)&&L){const se=ee.key==="Escape";g0({id:t,store:Y,unselect:se,nodeRef:z})}else if(O&&E.selected&&Object.prototype.hasOwnProperty.call(jf,ee.key)){ee.preventDefault();const{ariaLabelConfig:se}=Y.getState();Y.setState({ariaLiveMessage:se["node.a11yDescription.ariaLiveMessage"]({direction:ee.key.replace("Arrow","").toLowerCase(),x:~~R.positionAbsolute.x,y:~~R.positionAbsolute.y})}),A({direction:jf[ee.key],factor:ee.shiftKey?4:1})}}},X=()=>{if(w||!z.current?.matches(":focus-visible"))return;const{transform:ee,width:se,height:le,autoPanOnNodeFocus:pe,setCenter:ie}=Y.getState();if(!pe)return;$y(new Map([[t,E]]),{x:0,y:0,width:se,height:le},ee,!0).length>0||ie(E.position.x+H.width/2,E.position.y+H.height/2,{zoom:ee[2]})};return p.jsx("div",{className:Nn(["react-flow__node",`react-flow__node-${T}`,{[v]:O},E.className,{selected:E.selected,selectable:L,parent:D,draggable:O,dragging:V}]),ref:z,style:{zIndex:R.z,transform:`translate(${R.positionAbsolute.x}px,${R.positionAbsolute.y}px)`,pointerEvents:F?"all":"none",visibility:q?"visible":"hidden",...E.style,...P},"data-id":t,"data-testid":`rf__node-${t}`,onMouseEnter:Q,onMouseMove:$,onMouseLeave:I,onContextMenu:U,onClick:J,onDoubleClick:K,onKeyDown:B?ne:void 0,tabIndex:B?0:void 0,onFocus:B?X:void 0,role:E.ariaRole??(B?"group":void 0),"aria-roledescription":"node","aria-describedby":w?void 0:`${AM}-${C}`,"aria-label":E.ariaLabel,...E.domAttributes,children:p.jsx(yB,{value:t,children:p.jsx(k,{id:t,data:E.data,type:T,positionAbsoluteX:R.positionAbsolute.x,positionAbsoluteY:R.positionAbsolute.y,selected:E.selected??!1,selectable:L,draggable:O,deletable:E.deletable??!0,isConnectable:W,sourcePosition:E.sourcePosition,targetPosition:E.targetPosition,dragging:V,dragHandle:E.dragHandle,zIndex:R.z,parentId:E.parentId,...H})})})}var IB=x.memo(zB);const PB=t=>({nodesDraggable:t.nodesDraggable,nodesConnectable:t.nodesConnectable,nodesFocusable:t.nodesFocusable,elementsSelectable:t.elementsSelectable,onError:t.onError});function YM(t){const{nodesDraggable:e,nodesConnectable:n,nodesFocusable:o,elementsSelectable:s,onError:i}=Ct(PB,an),l=kB(t.onlyRenderVisibleElements),u=AB();return p.jsx("div",{className:"react-flow__nodes",style:bh,children:l.map(d=>p.jsx(IB,{id:d,nodeTypes:t.nodeTypes,nodeExtent:t.nodeExtent,onClick:t.onNodeClick,onMouseEnter:t.onNodeMouseEnter,onMouseMove:t.onNodeMouseMove,onMouseLeave:t.onNodeMouseLeave,onContextMenu:t.onNodeContextMenu,onDoubleClick:t.onNodeDoubleClick,noDragClassName:t.noDragClassName,noPanClassName:t.noPanClassName,rfId:t.rfId,disableKeyboardA11y:t.disableKeyboardA11y,resizeObserver:u,nodesDraggable:e,nodesConnectable:n,nodesFocusable:o,elementsSelectable:s,nodeClickDistance:t.nodeClickDistance,onError:i},d))})}YM.displayName="NodeRenderer";const $B=x.memo(YM);function LB(t){return Ct(x.useCallback(n=>{if(!t)return n.edges.map(s=>s.id);const o=[];if(n.width&&n.height)for(const s of n.edges){const i=n.nodeLookup.get(s.source),l=n.nodeLookup.get(s.target);i&&l&&LL({sourceNode:i,targetNode:l,width:n.width,height:n.height,transform:n.transform})&&o.push(s.id)}return o},[t]),an)}const HB=({color:t="none",strokeWidth:e=1})=>{const n={strokeWidth:e,...t&&{stroke:t}};return p.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},BB=({color:t="none",strokeWidth:e=1})=>{const n={strokeWidth:e,...t&&{stroke:t,fill:t}};return p.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},QS={[Df.Arrow]:HB,[Df.ArrowClosed]:BB};function FB(t){const e=ln();return x.useMemo(()=>Object.prototype.hasOwnProperty.call(QS,t)?QS[t]:(e.getState().onError?.("009",Mr.error009(t)),null),[t])}const VB=({id:t,type:e,color:n,width:o=12.5,height:s=12.5,markerUnits:i="strokeWidth",strokeWidth:l,orient:u="auto-start-reverse"})=>{const d=FB(e);return d?p.jsx("marker",{className:"react-flow__arrowhead",id:t,markerWidth:`${o}`,markerHeight:`${s}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:u,refX:"0",refY:"0",children:p.jsx(d,{color:n,strokeWidth:l})}):null},GM=({defaultColor:t,rfId:e})=>{const n=Ct(i=>i.edges),o=Ct(i=>i.defaultEdgeOptions),s=x.useMemo(()=>qL(n,{id:e,defaultColor:t,defaultMarkerStart:o?.markerStart,defaultMarkerEnd:o?.markerEnd}),[n,o,e,t]);return s.length?p.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:p.jsx("defs",{children:s.map(i=>p.jsx(VB,{id:i.id,type:i.type,color:i.color,width:i.width,height:i.height,markerUnits:i.markerUnits,strokeWidth:i.strokeWidth,orient:i.orient},i.id))})}):null};GM.displayName="MarkerDefinitions";var UB=x.memo(GM);function qM({x:t,y:e,label:n,labelStyle:o,labelShowBg:s=!0,labelBgStyle:i,labelBgPadding:l=[2,4],labelBgBorderRadius:u=2,children:d,className:f,...g}){const[m,y]=x.useState({x:1,y:0,width:0,height:0}),v=Nn(["react-flow__edge-textwrapper",f]),w=x.useRef(null);return x.useEffect(()=>{if(w.current){const C=w.current.getBBox();y({x:C.x,y:C.y,width:C.width,height:C.height})}},[n]),n?p.jsxs("g",{transform:`translate(${t-m.width/2} ${e-m.height/2})`,className:v,visibility:m.width?"visible":"hidden",...g,children:[s&&p.jsx("rect",{width:m.width+2*l[0],x:-l[0],y:-l[1],height:m.height+2*l[1],className:"react-flow__edge-textbg",style:i,rx:u,ry:u}),p.jsx("text",{className:"react-flow__edge-text",y:m.height/2,dy:"0.3em",ref:w,style:o,children:n}),d]}):null}qM.displayName="EdgeText";const YB=x.memo(qM);function wh({path:t,labelX:e,labelY:n,label:o,labelStyle:s,labelShowBg:i,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,interactionWidth:f=20,...g}){return p.jsxs(p.Fragment,{children:[p.jsx("path",{...g,d:t,fill:"none",className:Nn(["react-flow__edge-path",g.className])}),f?p.jsx("path",{d:t,fill:"none",strokeOpacity:0,strokeWidth:f,className:"react-flow__edge-interaction"}):null,o&&Jo(e)&&Jo(n)?p.jsx(YB,{x:e,y:n,label:o,labelStyle:s,labelShowBg:i,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d}):null]})}function ZS({pos:t,x1:e,y1:n,x2:o,y2:s}){return t===qe.Left||t===qe.Right?[.5*(e+o),n]:[e,.5*(n+s)]}function WM({sourceX:t,sourceY:e,sourcePosition:n=qe.Bottom,targetX:o,targetY:s,targetPosition:i=qe.Top}){const[l,u]=ZS({pos:n,x1:t,y1:e,x2:o,y2:s}),[d,f]=ZS({pos:i,x1:o,y1:s,x2:t,y2:e}),[g,m,y,v]=pM({sourceX:t,sourceY:e,targetX:o,targetY:s,sourceControlX:l,sourceControlY:u,targetControlX:d,targetControlY:f});return[`M${t},${e} C${l},${u} ${d},${f} ${o},${s}`,g,m,y,v]}function KM(t){return x.memo(({id:e,sourceX:n,sourceY:o,targetX:s,targetY:i,sourcePosition:l,targetPosition:u,label:d,labelStyle:f,labelShowBg:g,labelBgStyle:m,labelBgPadding:y,labelBgBorderRadius:v,style:w,markerEnd:C,markerStart:S,interactionWidth:N})=>{const[M,E,R]=WM({sourceX:n,sourceY:o,sourcePosition:l,targetX:s,targetY:i,targetPosition:u}),D=t.isInternal?void 0:e;return p.jsx(wh,{id:D,path:M,labelX:E,labelY:R,label:d,labelStyle:f,labelShowBg:g,labelBgStyle:m,labelBgPadding:y,labelBgBorderRadius:v,style:w,markerEnd:C,markerStart:S,interactionWidth:N})})}const GB=KM({isInternal:!1}),XM=KM({isInternal:!0});GB.displayName="SimpleBezierEdge";XM.displayName="SimpleBezierEdgeInternal";function QM(t){return x.memo(({id:e,sourceX:n,sourceY:o,targetX:s,targetY:i,label:l,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:g,labelBgBorderRadius:m,style:y,sourcePosition:v=qe.Bottom,targetPosition:w=qe.Top,markerEnd:C,markerStart:S,pathOptions:N,interactionWidth:M})=>{const[E,R,D]=d0({sourceX:n,sourceY:o,sourcePosition:v,targetX:s,targetY:i,targetPosition:w,borderRadius:N?.borderRadius,offset:N?.offset,stepPosition:N?.stepPosition}),T=t.isInternal?void 0:e;return p.jsx(wh,{id:T,path:E,labelX:R,labelY:D,label:l,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:g,labelBgBorderRadius:m,style:y,markerEnd:C,markerStart:S,interactionWidth:M})})}const ZM=QM({isInternal:!1}),JM=QM({isInternal:!0});ZM.displayName="SmoothStepEdge";JM.displayName="SmoothStepEdgeInternal";function eR(t){return x.memo(({id:e,...n})=>{const o=t.isInternal?void 0:e;return p.jsx(ZM,{...n,id:o,pathOptions:x.useMemo(()=>({borderRadius:0,offset:n.pathOptions?.offset}),[n.pathOptions?.offset])})})}const qB=eR({isInternal:!1}),tR=eR({isInternal:!0});qB.displayName="StepEdge";tR.displayName="StepEdgeInternal";function nR(t){return x.memo(({id:e,sourceX:n,sourceY:o,targetX:s,targetY:i,label:l,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:g,labelBgBorderRadius:m,style:y,markerEnd:v,markerStart:w,interactionWidth:C})=>{const[S,N,M]=xM({sourceX:n,sourceY:o,targetX:s,targetY:i}),E=t.isInternal?void 0:e;return p.jsx(wh,{id:E,path:S,labelX:N,labelY:M,label:l,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:g,labelBgBorderRadius:m,style:y,markerEnd:v,markerStart:w,interactionWidth:C})})}const WB=nR({isInternal:!1}),oR=nR({isInternal:!0});WB.displayName="StraightEdge";oR.displayName="StraightEdgeInternal";function rR(t){return x.memo(({id:e,sourceX:n,sourceY:o,targetX:s,targetY:i,sourcePosition:l=qe.Bottom,targetPosition:u=qe.Top,label:d,labelStyle:f,labelShowBg:g,labelBgStyle:m,labelBgPadding:y,labelBgBorderRadius:v,style:w,markerEnd:C,markerStart:S,pathOptions:N,interactionWidth:M})=>{const[E,R,D]=yM({sourceX:n,sourceY:o,sourcePosition:l,targetX:s,targetY:i,targetPosition:u,curvature:N?.curvature}),T=t.isInternal?void 0:e;return p.jsx(wh,{id:T,path:E,labelX:R,labelY:D,label:d,labelStyle:f,labelShowBg:g,labelBgStyle:m,labelBgPadding:y,labelBgBorderRadius:v,style:w,markerEnd:C,markerStart:S,interactionWidth:M})})}const KB=rR({isInternal:!1}),sR=rR({isInternal:!0});KB.displayName="BezierEdge";sR.displayName="BezierEdgeInternal";const JS={default:sR,straight:oR,step:tR,smoothstep:JM,simplebezier:XM},e2={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},XB=(t,e,n)=>n===qe.Left?t-e:n===qe.Right?t+e:t,QB=(t,e,n)=>n===qe.Top?t-e:n===qe.Bottom?t+e:t,t2="react-flow__edgeupdater";function n2({position:t,centerX:e,centerY:n,radius:o=10,onMouseDown:s,onMouseEnter:i,onMouseOut:l,type:u}){return p.jsx("circle",{onMouseDown:s,onMouseEnter:i,onMouseOut:l,className:Nn([t2,`${t2}-${u}`]),cx:XB(e,o,t),cy:QB(n,o,t),r:o,stroke:"transparent",fill:"transparent"})}function ZB({isReconnectable:t,reconnectRadius:e,edge:n,sourceX:o,sourceY:s,targetX:i,targetY:l,sourcePosition:u,targetPosition:d,onReconnect:f,onReconnectStart:g,onReconnectEnd:m,setReconnecting:y,setUpdateHover:v}){const w=ln(),C=(R,D)=>{if(R.button!==0)return;const{autoPanOnConnect:T,domNode:k,isValidConnection:O,connectionMode:L,connectionRadius:W,lib:B,onConnectStart:Y,onConnectEnd:q,cancelConnection:z,nodeLookup:V,rfId:A,panBy:H,updateConnection:P}=w.getState(),F=D.type==="target",Q=(U,K)=>{y(!1),m?.(U,n,D.type,K)},$=U=>f?.(n,U),I=(U,K)=>{y(!0),g?.(R,n,D.type),Y?.(U,K)};m0.onPointerDown(R.nativeEvent,{autoPanOnConnect:T,connectionMode:L,connectionRadius:W,domNode:k,handleId:D.id,nodeId:D.nodeId,nodeLookup:V,isTarget:F,edgeUpdaterType:D.type,lib:B,flowId:A,cancelConnection:z,panBy:H,isValidConnection:O,onConnect:$,onConnectStart:I,onConnectEnd:q,onReconnectEnd:Q,updateConnection:P,getTransform:()=>w.getState().transform,getFromHandle:()=>w.getState().connection.fromHandle,dragThreshold:w.getState().connectionDragThreshold,handleDomNode:R.currentTarget})},S=R=>C(R,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),N=R=>C(R,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),M=()=>v(!0),E=()=>v(!1);return p.jsxs(p.Fragment,{children:[(t===!0||t==="source")&&p.jsx(n2,{position:u,centerX:o,centerY:s,radius:e,onMouseDown:S,onMouseEnter:M,onMouseOut:E,type:"source"}),(t===!0||t==="target")&&p.jsx(n2,{position:d,centerX:i,centerY:l,radius:e,onMouseDown:N,onMouseEnter:M,onMouseOut:E,type:"target"})]})}function JB({id:t,edgesFocusable:e,edgesReconnectable:n,elementsSelectable:o,onClick:s,onDoubleClick:i,onContextMenu:l,onMouseEnter:u,onMouseMove:d,onMouseLeave:f,reconnectRadius:g,onReconnect:m,onReconnectStart:y,onReconnectEnd:v,rfId:w,edgeTypes:C,noPanClassName:S,onError:N,disableKeyboardA11y:M}){let E=Ct(ie=>ie.edgeLookup.get(t));const R=Ct(ie=>ie.defaultEdgeOptions);E=R?{...R,...E}:E;let D=E.type||"default",T=C?.[D]||JS[D];T===void 0&&(N?.("011",Mr.error011(D)),D="default",T=C?.default||JS.default);const k=!!(E.focusable||e&&typeof E.focusable>"u"),O=typeof m<"u"&&(E.reconnectable||n&&typeof E.reconnectable>"u"),L=!!(E.selectable||o&&typeof E.selectable>"u"),W=x.useRef(null),[B,Y]=x.useState(!1),[q,z]=x.useState(!1),V=ln(),{zIndex:A,sourceX:H,sourceY:P,targetX:F,targetY:Q,sourcePosition:$,targetPosition:I}=Ct(x.useCallback(ie=>{const be=ie.nodeLookup.get(E.source),ke=ie.nodeLookup.get(E.target);if(!be||!ke)return{zIndex:E.zIndex,...e2};const Be=GL({id:t,sourceNode:be,targetNode:ke,sourceHandle:E.sourceHandle||null,targetHandle:E.targetHandle||null,connectionMode:ie.connectionMode,onError:N});return{zIndex:$L({selected:E.selected,zIndex:E.zIndex,sourceNode:be,targetNode:ke,elevateOnSelect:ie.elevateEdgesOnSelect,zIndexMode:ie.zIndexMode}),...Be||e2}},[E.source,E.target,E.sourceHandle,E.targetHandle,E.selected,E.zIndex]),an),U=x.useMemo(()=>E.markerStart?`url('#${f0(E.markerStart,w)}')`:void 0,[E.markerStart,w]),K=x.useMemo(()=>E.markerEnd?`url('#${f0(E.markerEnd,w)}')`:void 0,[E.markerEnd,w]);if(E.hidden||H===null||P===null||F===null||Q===null)return null;const J=ie=>{const{addSelectedEdges:be,unselectNodesAndEdges:ke,multiSelectionActive:Be}=V.getState();L&&(V.setState({nodesSelectionActive:!1}),E.selected&&Be?(ke({nodes:[],edges:[E]}),W.current?.blur()):be([t])),s&&s(ie,E)},ne=i?ie=>{i(ie,{...E})}:void 0,X=l?ie=>{l(ie,{...E})}:void 0,ee=u?ie=>{u(ie,{...E})}:void 0,se=d?ie=>{d(ie,{...E})}:void 0,le=f?ie=>{f(ie,{...E})}:void 0,pe=ie=>{if(!M&&oM.includes(ie.key)&&L){const{unselectNodesAndEdges:be,addSelectedEdges:ke}=V.getState();ie.key==="Escape"?(W.current?.blur(),be({edges:[E]})):ke([t])}};return p.jsx("svg",{style:{zIndex:A},children:p.jsxs("g",{className:Nn(["react-flow__edge",`react-flow__edge-${D}`,E.className,S,{selected:E.selected,animated:E.animated,inactive:!L&&!s,updating:B,selectable:L}]),onClick:J,onDoubleClick:ne,onContextMenu:X,onMouseEnter:ee,onMouseMove:se,onMouseLeave:le,onKeyDown:k?pe:void 0,tabIndex:k?0:void 0,role:E.ariaRole??(k?"group":"img"),"aria-roledescription":"edge","data-id":t,"data-testid":`rf__edge-${t}`,"aria-label":E.ariaLabel===null?void 0:E.ariaLabel||`Edge from ${E.source} to ${E.target}`,"aria-describedby":k?`${OM}-${w}`:void 0,ref:W,...E.domAttributes,children:[!q&&p.jsx(T,{id:t,source:E.source,target:E.target,type:E.type,selected:E.selected,animated:E.animated,selectable:L,deletable:E.deletable??!0,label:E.label,labelStyle:E.labelStyle,labelShowBg:E.labelShowBg,labelBgStyle:E.labelBgStyle,labelBgPadding:E.labelBgPadding,labelBgBorderRadius:E.labelBgBorderRadius,sourceX:H,sourceY:P,targetX:F,targetY:Q,sourcePosition:$,targetPosition:I,data:E.data,style:E.style,sourceHandleId:E.sourceHandle,targetHandleId:E.targetHandle,markerStart:U,markerEnd:K,pathOptions:"pathOptions"in E?E.pathOptions:void 0,interactionWidth:E.interactionWidth}),O&&p.jsx(ZB,{edge:E,isReconnectable:O,reconnectRadius:g,onReconnect:m,onReconnectStart:y,onReconnectEnd:v,sourceX:H,sourceY:P,targetX:F,targetY:Q,sourcePosition:$,targetPosition:I,setUpdateHover:Y,setReconnecting:z})]})})}var eF=x.memo(JB);const tF=t=>({edgesFocusable:t.edgesFocusable,edgesReconnectable:t.edgesReconnectable,elementsSelectable:t.elementsSelectable,connectionMode:t.connectionMode,onError:t.onError});function aR({defaultMarkerColor:t,onlyRenderVisibleElements:e,rfId:n,edgeTypes:o,noPanClassName:s,onReconnect:i,onEdgeContextMenu:l,onEdgeMouseEnter:u,onEdgeMouseMove:d,onEdgeMouseLeave:f,onEdgeClick:g,reconnectRadius:m,onEdgeDoubleClick:y,onReconnectStart:v,onReconnectEnd:w,disableKeyboardA11y:C}){const{edgesFocusable:S,edgesReconnectable:N,elementsSelectable:M,onError:E}=Ct(tF,an),R=LB(e);return p.jsxs("div",{className:"react-flow__edges",children:[p.jsx(UB,{defaultColor:t,rfId:n}),R.map(D=>p.jsx(eF,{id:D,edgesFocusable:S,edgesReconnectable:N,elementsSelectable:M,noPanClassName:s,onReconnect:i,onContextMenu:l,onMouseEnter:u,onMouseMove:d,onMouseLeave:f,onClick:g,reconnectRadius:m,onDoubleClick:y,onReconnectStart:v,onReconnectEnd:w,rfId:n,onError:E,edgeTypes:o,disableKeyboardA11y:C},D))]})}aR.displayName="EdgeRenderer";const nF=x.memo(aR),oF=t=>`translate(${t.transform[0]}px,${t.transform[1]}px) scale(${t.transform[2]})`;function rF({children:t}){const e=Ct(oF);return p.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:e},children:t})}function sF(t){const e=xh(),n=x.useRef(!1);x.useEffect(()=>{!n.current&&e.viewportInitialized&&t&&(setTimeout(()=>t(e),1),n.current=!0)},[t,e.viewportInitialized])}const aF=t=>t.panZoom?.syncViewport;function iF(t){const e=Ct(aF),n=ln();return x.useEffect(()=>{t&&(e?.(t),n.setState({transform:[t.x,t.y,t.zoom]}))},[t,e]),null}function lF(t){return t.connection.inProgress?{...t.connection,to:hu(t.connection.to,t.transform)}:{...t.connection}}function cF(t){return lF}function uF(t){const e=cF();return Ct(e,an)}const dF=t=>({nodesConnectable:t.nodesConnectable,isValid:t.connection.isValid,inProgress:t.connection.inProgress,width:t.width,height:t.height});function fF({containerStyle:t,style:e,type:n,component:o}){const{nodesConnectable:s,width:i,height:l,isValid:u,inProgress:d}=Ct(dF,an);return!(i&&s&&d)?null:p.jsx("svg",{style:t,width:i,height:l,className:"react-flow__connectionline react-flow__container",children:p.jsx("g",{className:Nn(["react-flow__connection",aM(u)]),children:p.jsx(iR,{style:e,type:n,CustomComponent:o,isValid:u})})})}const iR=({style:t,type:e=Xs.Bezier,CustomComponent:n,isValid:o})=>{const{inProgress:s,from:i,fromNode:l,fromHandle:u,fromPosition:d,to:f,toNode:g,toHandle:m,toPosition:y,pointer:v}=uF();if(!s)return;if(n)return p.jsx(n,{connectionLineType:e,connectionLineStyle:t,fromNode:l,fromHandle:u,fromX:i.x,fromY:i.y,toX:f.x,toY:f.y,fromPosition:d,toPosition:y,connectionStatus:aM(o),toNode:g,toHandle:m,pointer:v});let w="";const C={sourceX:i.x,sourceY:i.y,sourcePosition:d,targetX:f.x,targetY:f.y,targetPosition:y};switch(e){case Xs.Bezier:[w]=yM(C);break;case Xs.SimpleBezier:[w]=WM(C);break;case Xs.Step:[w]=d0({...C,borderRadius:0});break;case Xs.SmoothStep:[w]=d0(C);break;default:[w]=xM(C)}return p.jsx("path",{d:w,fill:"none",className:"react-flow__connection-path",style:t})};iR.displayName="ConnectionLine";const hF={};function o2(t=hF){x.useRef(t),ln(),x.useEffect(()=>{},[t])}function mF(){ln(),x.useRef(!1),x.useEffect(()=>{},[])}function lR({nodeTypes:t,edgeTypes:e,onInit:n,onNodeClick:o,onEdgeClick:s,onNodeDoubleClick:i,onEdgeDoubleClick:l,onNodeMouseEnter:u,onNodeMouseMove:d,onNodeMouseLeave:f,onNodeContextMenu:g,onSelectionContextMenu:m,onSelectionStart:y,onSelectionEnd:v,connectionLineType:w,connectionLineStyle:C,connectionLineComponent:S,connectionLineContainerStyle:N,selectionKeyCode:M,selectionOnDrag:E,selectionMode:R,multiSelectionKeyCode:D,panActivationKeyCode:T,zoomActivationKeyCode:k,deleteKeyCode:O,onlyRenderVisibleElements:L,elementsSelectable:W,defaultViewport:B,translateExtent:Y,minZoom:q,maxZoom:z,preventScrolling:V,defaultMarkerColor:A,zoomOnScroll:H,zoomOnPinch:P,panOnScroll:F,panOnScrollSpeed:Q,panOnScrollMode:$,zoomOnDoubleClick:I,panOnDrag:U,onPaneClick:K,onPaneMouseEnter:J,onPaneMouseMove:ne,onPaneMouseLeave:X,onPaneScroll:ee,onPaneContextMenu:se,paneClickDistance:le,nodeClickDistance:pe,onEdgeContextMenu:ie,onEdgeMouseEnter:be,onEdgeMouseMove:ke,onEdgeMouseLeave:Be,reconnectRadius:Ie,onReconnect:lt,onReconnectStart:cn,onReconnectEnd:ht,noDragClassName:bn,noWheelClassName:un,noPanClassName:Vt,disableKeyboardA11y:mn,nodeExtent:It,rfId:Mn,viewport:yn,onViewportChange:In}){return o2(t),o2(e),mF(),sF(n),iF(yn),p.jsx(DB,{onPaneClick:K,onPaneMouseEnter:J,onPaneMouseMove:ne,onPaneMouseLeave:X,onPaneContextMenu:se,onPaneScroll:ee,paneClickDistance:le,deleteKeyCode:O,selectionKeyCode:M,selectionOnDrag:E,selectionMode:R,onSelectionStart:y,onSelectionEnd:v,multiSelectionKeyCode:D,panActivationKeyCode:T,zoomActivationKeyCode:k,elementsSelectable:W,zoomOnScroll:H,zoomOnPinch:P,zoomOnDoubleClick:I,panOnScroll:F,panOnScrollSpeed:Q,panOnScrollMode:$,panOnDrag:U,defaultViewport:B,translateExtent:Y,minZoom:q,maxZoom:z,onSelectionContextMenu:m,preventScrolling:V,noDragClassName:bn,noWheelClassName:un,noPanClassName:Vt,disableKeyboardA11y:mn,onViewportChange:In,isControlledViewport:!!yn,children:p.jsxs(rF,{children:[p.jsx(nF,{edgeTypes:e,onEdgeClick:s,onEdgeDoubleClick:l,onReconnect:lt,onReconnectStart:cn,onReconnectEnd:ht,onlyRenderVisibleElements:L,onEdgeContextMenu:ie,onEdgeMouseEnter:be,onEdgeMouseMove:ke,onEdgeMouseLeave:Be,reconnectRadius:Ie,defaultMarkerColor:A,noPanClassName:Vt,disableKeyboardA11y:mn,rfId:Mn}),p.jsx(fF,{style:C,type:w,component:S,containerStyle:N}),p.jsx("div",{className:"react-flow__edgelabel-renderer"}),p.jsx($B,{nodeTypes:t,onNodeClick:o,onNodeDoubleClick:i,onNodeMouseEnter:u,onNodeMouseMove:d,onNodeMouseLeave:f,onNodeContextMenu:g,nodeClickDistance:pe,onlyRenderVisibleElements:L,noPanClassName:Vt,noDragClassName:bn,disableKeyboardA11y:mn,nodeExtent:It,rfId:Mn}),p.jsx("div",{className:"react-flow__viewport-portal"})]})})}lR.displayName="GraphView";const gF=x.memo(lR),r2=({nodes:t,edges:e,defaultNodes:n,defaultEdges:o,width:s,height:i,fitView:l,fitViewOptions:u,minZoom:d=.5,maxZoom:f=2,nodeOrigin:g,nodeExtent:m,zIndexMode:y="basic"}={})=>{const v=new Map,w=new Map,C=new Map,S=new Map,N=o??e??[],M=n??t??[],E=g??[0,0],R=m??Hc;SM(C,S,N);const D=h0(M,v,w,{nodeOrigin:E,nodeExtent:R,zIndexMode:y});let T=[0,0,1];if(l&&s&&i){const k=du(v,{filter:B=>!!((B.width||B.initialWidth)&&(B.height||B.initialHeight))}),{x:O,y:L,zoom:W}=Ly(k,s,i,d,f,u?.padding??.1);T=[O,L,W]}return{rfId:"1",width:s??0,height:i??0,transform:T,nodes:M,nodesInitialized:D,nodeLookup:v,parentLookup:w,edges:N,edgeLookup:S,connectionLookup:C,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:o!==void 0,panZoom:null,minZoom:d,maxZoom:f,translateExtent:Hc,nodeExtent:R,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:el.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:E,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:l??!1,fitViewOptions:u,fitViewResolver:null,connection:{...sM},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:jL,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:rM,zIndexMode:y,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},pF=({nodes:t,edges:e,defaultNodes:n,defaultEdges:o,width:s,height:i,fitView:l,fitViewOptions:u,minZoom:d,maxZoom:f,nodeOrigin:g,nodeExtent:m,zIndexMode:y})=>OH((v,w)=>{async function C(){const{nodeLookup:S,panZoom:N,fitViewOptions:M,fitViewResolver:E,width:R,height:D,minZoom:T,maxZoom:k}=w();N&&(await TL({nodes:S,width:R,height:D,panZoom:N,minZoom:T,maxZoom:k},M),E?.resolve(!0),v({fitViewResolver:null}))}return{...r2({nodes:t,edges:e,width:s,height:i,fitView:l,fitViewOptions:u,minZoom:d,maxZoom:f,nodeOrigin:g,nodeExtent:m,defaultNodes:n,defaultEdges:o,zIndexMode:y}),setNodes:S=>{const{nodeLookup:N,parentLookup:M,nodeOrigin:E,elevateNodesOnSelect:R,fitViewQueued:D,zIndexMode:T}=w(),k=h0(S,N,M,{nodeOrigin:E,nodeExtent:m,elevateNodesOnSelect:R,checkEquality:!0,zIndexMode:T});D&&k?(C(),v({nodes:S,nodesInitialized:k,fitViewQueued:!1,fitViewOptions:void 0})):v({nodes:S,nodesInitialized:k})},setEdges:S=>{const{connectionLookup:N,edgeLookup:M}=w();SM(N,M,S),v({edges:S})},setDefaultNodesAndEdges:(S,N)=>{if(S){const{setNodes:M}=w();M(S),v({hasDefaultNodes:!0})}if(N){const{setEdges:M}=w();M(N),v({hasDefaultEdges:!0})}},updateNodeInternals:S=>{const{triggerNodeChanges:N,nodeLookup:M,parentLookup:E,domNode:R,nodeOrigin:D,nodeExtent:T,debug:k,fitViewQueued:O,zIndexMode:L}=w(),{changes:W,updatedInternals:B}=eH(S,M,E,R,D,T,L);B&&(XL(M,E,{nodeOrigin:D,nodeExtent:T,zIndexMode:L}),O?(C(),v({fitViewQueued:!1,fitViewOptions:void 0})):v({}),W?.length>0&&(k&&console.log("React Flow: trigger node changes",W),N?.(W)))},updateNodePositions:(S,N=!1)=>{const M=[];let E=[];const{nodeLookup:R,triggerNodeChanges:D,connection:T,updateConnection:k,onNodesChangeMiddlewareMap:O}=w();for(const[L,W]of S){const B=R.get(L),Y=!!(B?.expandParent&&B?.parentId&&W?.position),q={id:L,type:"position",position:Y?{x:Math.max(0,W.position.x),y:Math.max(0,W.position.y)}:W.position,dragging:N};if(B&&T.inProgress&&T.fromNode.id===B.id){const z=Ya(B,T.fromHandle,qe.Left,!0);k({...T,from:z})}Y&&B.parentId&&M.push({id:L,parentId:B.parentId,rect:{...W.internals.positionAbsolute,width:W.measured.width??0,height:W.measured.height??0}}),E.push(q)}if(M.length>0){const{parentLookup:L,nodeOrigin:W}=w(),B=Gy(M,R,L,W);E.push(...B)}for(const L of O.values())E=L(E);D(E)},triggerNodeChanges:S=>{const{onNodesChange:N,setNodes:M,nodes:E,hasDefaultNodes:R,debug:D}=w();if(S?.length){if(R){const T=PM(S,E);M(T)}D&&console.log("React Flow: trigger node changes",S),N?.(S)}},triggerEdgeChanges:S=>{const{onEdgesChange:N,setEdges:M,edges:E,hasDefaultEdges:R,debug:D}=w();if(S?.length){if(R){const T=$M(S,E);M(T)}D&&console.log("React Flow: trigger edge changes",S),N?.(S)}},addSelectedNodes:S=>{const{multiSelectionActive:N,edgeLookup:M,nodeLookup:E,triggerNodeChanges:R,triggerEdgeChanges:D}=w();if(N){const T=S.map(k=>ka(k,!0));R(T);return}R(Vi(E,new Set([...S]),!0)),D(Vi(M))},addSelectedEdges:S=>{const{multiSelectionActive:N,edgeLookup:M,nodeLookup:E,triggerNodeChanges:R,triggerEdgeChanges:D}=w();if(N){const T=S.map(k=>ka(k,!0));D(T);return}D(Vi(M,new Set([...S]))),R(Vi(E,new Set,!0))},unselectNodesAndEdges:({nodes:S,edges:N}={})=>{const{edges:M,nodes:E,nodeLookup:R,triggerNodeChanges:D,triggerEdgeChanges:T}=w(),k=S||E,O=N||M,L=k.map(B=>{const Y=R.get(B.id);return Y&&(Y.selected=!1),ka(B.id,!1)}),W=O.map(B=>ka(B.id,!1));D(L),T(W)},setMinZoom:S=>{const{panZoom:N,maxZoom:M}=w();N?.setScaleExtent([S,M]),v({minZoom:S})},setMaxZoom:S=>{const{panZoom:N,minZoom:M}=w();N?.setScaleExtent([M,S]),v({maxZoom:S})},setTranslateExtent:S=>{w().panZoom?.setTranslateExtent(S),v({translateExtent:S})},resetSelectedElements:()=>{const{edges:S,nodes:N,triggerNodeChanges:M,triggerEdgeChanges:E,elementsSelectable:R}=w();if(!R)return;const D=N.reduce((k,O)=>O.selected?[...k,ka(O.id,!1)]:k,[]),T=S.reduce((k,O)=>O.selected?[...k,ka(O.id,!1)]:k,[]);M(D),E(T)},setNodeExtent:S=>{const{nodes:N,nodeLookup:M,parentLookup:E,nodeOrigin:R,elevateNodesOnSelect:D,nodeExtent:T,zIndexMode:k}=w();S[0][0]===T[0][0]&&S[0][1]===T[0][1]&&S[1][0]===T[1][0]&&S[1][1]===T[1][1]||(h0(N,M,E,{nodeOrigin:R,nodeExtent:S,elevateNodesOnSelect:D,checkEquality:!1,zIndexMode:k}),v({nodeExtent:S}))},panBy:S=>{const{transform:N,width:M,height:E,panZoom:R,translateExtent:D}=w();return tH({delta:S,panZoom:R,transform:N,translateExtent:D,width:M,height:E})},setCenter:async(S,N,M)=>{const{width:E,height:R,maxZoom:D,panZoom:T}=w();if(!T)return Promise.resolve(!1);const k=typeof M?.zoom<"u"?M.zoom:D;return await T.setViewport({x:E/2-S*k,y:R/2-N*k,zoom:k},{duration:M?.duration,ease:M?.ease,interpolate:M?.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{v({connection:{...sM}})},updateConnection:S=>{v({connection:S})},reset:()=>v({...r2()})}},Object.is);function yF({initialNodes:t,initialEdges:e,defaultNodes:n,defaultEdges:o,initialWidth:s,initialHeight:i,initialMinZoom:l,initialMaxZoom:u,initialFitViewOptions:d,fitView:f,nodeOrigin:g,nodeExtent:m,zIndexMode:y,children:v}){const[w]=x.useState(()=>pF({nodes:t,edges:e,defaultNodes:n,defaultEdges:o,width:s,height:i,fitView:f,minZoom:l,maxZoom:u,fitViewOptions:d,nodeOrigin:g,nodeExtent:m,zIndexMode:y}));return p.jsx(zH,{value:w,children:p.jsx(rB,{children:v})})}function vF({children:t,nodes:e,edges:n,defaultNodes:o,defaultEdges:s,width:i,height:l,fitView:u,fitViewOptions:d,minZoom:f,maxZoom:g,nodeOrigin:m,nodeExtent:y,zIndexMode:v}){return x.useContext(yh)?p.jsx(p.Fragment,{children:t}):p.jsx(yF,{initialNodes:e,initialEdges:n,defaultNodes:o,defaultEdges:s,initialWidth:i,initialHeight:l,fitView:u,initialFitViewOptions:d,initialMinZoom:f,initialMaxZoom:g,nodeOrigin:m,nodeExtent:y,zIndexMode:v,children:t})}const xF={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function bF({nodes:t,edges:e,defaultNodes:n,defaultEdges:o,className:s,nodeTypes:i,edgeTypes:l,onNodeClick:u,onEdgeClick:d,onInit:f,onMove:g,onMoveStart:m,onMoveEnd:y,onConnect:v,onConnectStart:w,onConnectEnd:C,onClickConnectStart:S,onClickConnectEnd:N,onNodeMouseEnter:M,onNodeMouseMove:E,onNodeMouseLeave:R,onNodeContextMenu:D,onNodeDoubleClick:T,onNodeDragStart:k,onNodeDrag:O,onNodeDragStop:L,onNodesDelete:W,onEdgesDelete:B,onDelete:Y,onSelectionChange:q,onSelectionDragStart:z,onSelectionDrag:V,onSelectionDragStop:A,onSelectionContextMenu:H,onSelectionStart:P,onSelectionEnd:F,onBeforeDelete:Q,connectionMode:$,connectionLineType:I=Xs.Bezier,connectionLineStyle:U,connectionLineComponent:K,connectionLineContainerStyle:J,deleteKeyCode:ne="Backspace",selectionKeyCode:X="Shift",selectionOnDrag:ee=!1,selectionMode:se=Bc.Full,panActivationKeyCode:le="Space",multiSelectionKeyCode:pe=Vc()?"Meta":"Control",zoomActivationKeyCode:ie=Vc()?"Meta":"Control",snapToGrid:be,snapGrid:ke,onlyRenderVisibleElements:Be=!1,selectNodesOnDrag:Ie,nodesDraggable:lt,autoPanOnNodeFocus:cn,nodesConnectable:ht,nodesFocusable:bn,nodeOrigin:un=zM,edgesFocusable:Vt,edgesReconnectable:mn,elementsSelectable:It=!0,defaultViewport:Mn=WH,minZoom:yn=.5,maxZoom:In=2,translateExtent:On=Hc,preventScrolling:_e=!0,nodeExtent:Ue,defaultMarkerColor:_t="#b1b1b7",zoomOnScroll:Qe=!0,zoomOnPinch:st=!0,panOnScroll:gt=!1,panOnScrollSpeed:Wt=.5,panOnScrollMode:Kt=Pa.Free,zoomOnDoubleClick:Zn=!0,panOnDrag:Nt=!0,onPaneClick:Fe,onPaneMouseEnter:nt,onPaneMouseMove:Ye,onPaneMouseLeave:at,onPaneScroll:Lt,onPaneContextMenu:De,paneClickDistance:At=1,nodeClickDistance:Xt=0,children:dn,onReconnect:Pn,onReconnectStart:Tt,onReconnectEnd:Rn,onEdgeContextMenu:Yo,onEdgeDoubleClick:vt,onEdgeMouseEnter:Dn,onEdgeMouseMove:Do,onEdgeMouseLeave:Un,reconnectRadius:lo=10,onNodesChange:Or,onEdgesChange:co,noDragClassName:fn="nodrag",noWheelClassName:Tn="nowheel",noPanClassName:To="nopan",fitView:zr,fitViewOptions:fa,connectOnClick:Z,attributionPosition:oe,proOptions:ce,defaultEdgeOptions:ve,elevateNodesOnSelect:we=!0,elevateEdgesOnSelect:Me=!1,disableKeyboardA11y:Pe=!1,autoPanOnConnect:Oe,autoPanOnNodeDrag:Se,autoPanSpeed:Re,connectionRadius:Te,isValidConnection:Ae,onError:xe,style:je,id:ot,nodeDragThreshold:Et,connectionDragThreshold:Mt,viewport:ct,onViewportChange:Pt,width:rt,height:mt,colorMode:$t="light",debug:Yn,onScroll:kn,ariaLabelConfig:$n,zIndexMode:en="basic",...Ir},Ze){const uo=ot||"1",cr=ZH($t),ha=x.useCallback(Ot=>{Ot.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),kn?.(Ot)},[kn]);return p.jsx("div",{"data-testid":"rf__wrapper",...Ir,onScroll:ha,style:{...je,...xF},ref:Ze,className:Nn(["react-flow",s,cr]),id:ot,role:"application",children:p.jsxs(vF,{nodes:t,edges:e,width:rt,height:mt,fitView:zr,fitViewOptions:fa,minZoom:yn,maxZoom:In,nodeOrigin:un,nodeExtent:Ue,zIndexMode:en,children:[p.jsx(gF,{onInit:f,onNodeClick:u,onEdgeClick:d,onNodeMouseEnter:M,onNodeMouseMove:E,onNodeMouseLeave:R,onNodeContextMenu:D,onNodeDoubleClick:T,nodeTypes:i,edgeTypes:l,connectionLineType:I,connectionLineStyle:U,connectionLineComponent:K,connectionLineContainerStyle:J,selectionKeyCode:X,selectionOnDrag:ee,selectionMode:se,deleteKeyCode:ne,multiSelectionKeyCode:pe,panActivationKeyCode:le,zoomActivationKeyCode:ie,onlyRenderVisibleElements:Be,defaultViewport:Mn,translateExtent:On,minZoom:yn,maxZoom:In,preventScrolling:_e,zoomOnScroll:Qe,zoomOnPinch:st,zoomOnDoubleClick:Zn,panOnScroll:gt,panOnScrollSpeed:Wt,panOnScrollMode:Kt,panOnDrag:Nt,onPaneClick:Fe,onPaneMouseEnter:nt,onPaneMouseMove:Ye,onPaneMouseLeave:at,onPaneScroll:Lt,onPaneContextMenu:De,paneClickDistance:At,nodeClickDistance:Xt,onSelectionContextMenu:H,onSelectionStart:P,onSelectionEnd:F,onReconnect:Pn,onReconnectStart:Tt,onReconnectEnd:Rn,onEdgeContextMenu:Yo,onEdgeDoubleClick:vt,onEdgeMouseEnter:Dn,onEdgeMouseMove:Do,onEdgeMouseLeave:Un,reconnectRadius:lo,defaultMarkerColor:_t,noDragClassName:fn,noWheelClassName:Tn,noPanClassName:To,rfId:uo,disableKeyboardA11y:Pe,nodeExtent:Ue,viewport:ct,onViewportChange:Pt}),p.jsx(QH,{nodes:t,edges:e,defaultNodes:n,defaultEdges:o,onConnect:v,onConnectStart:w,onConnectEnd:C,onClickConnectStart:S,onClickConnectEnd:N,nodesDraggable:lt,autoPanOnNodeFocus:cn,nodesConnectable:ht,nodesFocusable:bn,edgesFocusable:Vt,edgesReconnectable:mn,elementsSelectable:It,elevateNodesOnSelect:we,elevateEdgesOnSelect:Me,minZoom:yn,maxZoom:In,nodeExtent:Ue,onNodesChange:Or,onEdgesChange:co,snapToGrid:be,snapGrid:ke,connectionMode:$,translateExtent:On,connectOnClick:Z,defaultEdgeOptions:ve,fitView:zr,fitViewOptions:fa,onNodesDelete:W,onEdgesDelete:B,onDelete:Y,onNodeDragStart:k,onNodeDrag:O,onNodeDragStop:L,onSelectionDrag:V,onSelectionDragStart:z,onSelectionDragStop:A,onMove:g,onMoveStart:m,onMoveEnd:y,noPanClassName:To,nodeOrigin:un,rfId:uo,autoPanOnConnect:Oe,autoPanOnNodeDrag:Se,autoPanSpeed:Re,onError:xe,connectionRadius:Te,isValidConnection:Ae,selectNodesOnDrag:Ie,nodeDragThreshold:Et,connectionDragThreshold:Mt,onBeforeDelete:Q,debug:Yn,ariaLabelConfig:$n,zIndexMode:en}),p.jsx(qH,{onSelectionChange:q}),dn,p.jsx(FH,{proOptions:ce,position:oe}),p.jsx(BH,{rfId:uo,disableKeyboardA11y:Pe})]})})}var wF=LM(bF);function SF(t){const[e,n]=x.useState(t),o=x.useCallback(s=>n(i=>PM(s,i)),[]);return[e,n,o]}function CF(t){const[e,n]=x.useState(t),o=x.useCallback(s=>n(i=>$M(s,i)),[]);return[e,n,o]}const EF=t=>e=>{if(!t.includeHiddenNodes)return e.nodesInitialized;if(e.nodeLookup.size===0)return!1;for(const[,{internals:n}]of e.nodeLookup)if(n.handleBounds===void 0||!Hy(n.userNode))return!1;return!0};function _F(t={includeHiddenNodes:!1}){return Ct(EF(t))}function NF({dimensions:t,lineWidth:e,variant:n,className:o}){return p.jsx("path",{strokeWidth:e,d:`M${t[0]/2} 0 V${t[1]} M0 ${t[1]/2} H${t[0]}`,className:Nn(["react-flow__background-pattern",n,o])})}function MF({radius:t,className:e}){return p.jsx("circle",{cx:t,cy:t,r:t,className:Nn(["react-flow__background-pattern","dots",e])})}var Js;(function(t){t.Lines="lines",t.Dots="dots",t.Cross="cross"})(Js||(Js={}));const RF={[Js.Dots]:1,[Js.Lines]:1,[Js.Cross]:6},DF=t=>({transform:t.transform,patternId:`pattern-${t.rfId}`});function cR({id:t,variant:e=Js.Dots,gap:n=20,size:o,lineWidth:s=1,offset:i=0,color:l,bgColor:u,style:d,className:f,patternClassName:g}){const m=x.useRef(null),{transform:y,patternId:v}=Ct(DF,an),w=o||RF[e],C=e===Js.Dots,S=e===Js.Cross,N=Array.isArray(n)?n:[n,n],M=[N[0]*y[2]||1,N[1]*y[2]||1],E=w*y[2],R=Array.isArray(i)?i:[i,i],D=S?[E,E]:M,T=[R[0]*y[2]||1+D[0]/2,R[1]*y[2]||1+D[1]/2],k=`${v}${t||""}`;return p.jsxs("svg",{className:Nn(["react-flow__background",f]),style:{...d,...bh,"--xy-background-color-props":u,"--xy-background-pattern-color-props":l},ref:m,"data-testid":"rf__background",children:[p.jsx("pattern",{id:k,x:y[0]%M[0],y:y[1]%M[1],width:M[0],height:M[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${T[0]},-${T[1]})`,children:C?p.jsx(MF,{radius:E/2,className:g}):p.jsx(NF,{dimensions:D,lineWidth:s,variant:e,className:g})}),p.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${k})`})]})}cR.displayName="Background";const TF=x.memo(cR);function kF(){return p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:p.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function jF(){return p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:p.jsx("path",{d:"M0 0h32v4.2H0z"})})}function AF(){return p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:p.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function OF(){return p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:p.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function zF(){return p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:p.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function Wd({children:t,className:e,...n}){return p.jsx("button",{type:"button",className:Nn(["react-flow__controls-button",e]),...n,children:t})}const IF=t=>({isInteractive:t.nodesDraggable||t.nodesConnectable||t.elementsSelectable,minZoomReached:t.transform[2]<=t.minZoom,maxZoomReached:t.transform[2]>=t.maxZoom,ariaLabelConfig:t.ariaLabelConfig});function uR({style:t,showZoom:e=!0,showFitView:n=!0,showInteractive:o=!0,fitViewOptions:s,onZoomIn:i,onZoomOut:l,onFitView:u,onInteractiveChange:d,className:f,children:g,position:m="bottom-left",orientation:y="vertical","aria-label":v}){const w=ln(),{isInteractive:C,minZoomReached:S,maxZoomReached:N,ariaLabelConfig:M}=Ct(IF,an),{zoomIn:E,zoomOut:R,fitView:D}=xh(),T=()=>{E(),i?.()},k=()=>{R(),l?.()},O=()=>{D(s),u?.()},L=()=>{w.setState({nodesDraggable:!C,nodesConnectable:!C,elementsSelectable:!C}),d?.(!C)},W=y==="horizontal"?"horizontal":"vertical";return p.jsxs(vh,{className:Nn(["react-flow__controls",W,f]),position:m,style:t,"data-testid":"rf__controls","aria-label":v??M["controls.ariaLabel"],children:[e&&p.jsxs(p.Fragment,{children:[p.jsx(Wd,{onClick:T,className:"react-flow__controls-zoomin",title:M["controls.zoomIn.ariaLabel"],"aria-label":M["controls.zoomIn.ariaLabel"],disabled:N,children:p.jsx(kF,{})}),p.jsx(Wd,{onClick:k,className:"react-flow__controls-zoomout",title:M["controls.zoomOut.ariaLabel"],"aria-label":M["controls.zoomOut.ariaLabel"],disabled:S,children:p.jsx(jF,{})})]}),n&&p.jsx(Wd,{className:"react-flow__controls-fitview",onClick:O,title:M["controls.fitView.ariaLabel"],"aria-label":M["controls.fitView.ariaLabel"],children:p.jsx(AF,{})}),o&&p.jsx(Wd,{className:"react-flow__controls-interactive",onClick:L,title:M["controls.interactive.ariaLabel"],"aria-label":M["controls.interactive.ariaLabel"],children:C?p.jsx(zF,{}):p.jsx(OF,{})}),g]})}uR.displayName="Controls";x.memo(uR);function PF({id:t,x:e,y:n,width:o,height:s,style:i,color:l,strokeColor:u,strokeWidth:d,className:f,borderRadius:g,shapeRendering:m,selected:y,onClick:v}){const{background:w,backgroundColor:C}=i||{},S=l||w||C;return p.jsx("rect",{className:Nn(["react-flow__minimap-node",{selected:y},f]),x:e,y:n,rx:g,ry:g,width:o,height:s,style:{fill:S,stroke:u,strokeWidth:d},shapeRendering:m,onClick:v?N=>v(N,t):void 0})}const $F=x.memo(PF),LF=t=>t.nodes.map(e=>e.id),pp=t=>t instanceof Function?t:()=>t;function HF({nodeStrokeColor:t,nodeColor:e,nodeClassName:n="",nodeBorderRadius:o=5,nodeStrokeWidth:s,nodeComponent:i=$F,onClick:l}){const u=Ct(LF,an),d=pp(e),f=pp(t),g=pp(n),m=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return p.jsx(p.Fragment,{children:u.map(y=>p.jsx(FF,{id:y,nodeColorFunc:d,nodeStrokeColorFunc:f,nodeClassNameFunc:g,nodeBorderRadius:o,nodeStrokeWidth:s,NodeComponent:i,onClick:l,shapeRendering:m},y))})}function BF({id:t,nodeColorFunc:e,nodeStrokeColorFunc:n,nodeClassNameFunc:o,nodeBorderRadius:s,nodeStrokeWidth:i,shapeRendering:l,NodeComponent:u,onClick:d}){const{node:f,x:g,y:m,width:y,height:v}=Ct(w=>{const{internals:C}=w.nodeLookup.get(t),S=C.userNode,{x:N,y:M}=C.positionAbsolute,{width:E,height:R}=xs(S);return{node:S,x:N,y:M,width:E,height:R}},an);return!f||f.hidden||!Hy(f)?null:p.jsx(u,{x:g,y:m,width:y,height:v,style:f.style,selected:!!f.selected,className:o(f),color:e(f),borderRadius:s,strokeColor:n(f),strokeWidth:i,shapeRendering:l,onClick:d,id:f.id})}const FF=x.memo(BF);var VF=x.memo(HF);const UF=200,YF=150,GF=t=>!t.hidden,qF=t=>{const e={x:-t.transform[0]/t.transform[2],y:-t.transform[1]/t.transform[2],width:t.width/t.transform[2],height:t.height/t.transform[2]};return{viewBB:e,boundingRect:t.nodeLookup.size>0?dM(du(t.nodeLookup,{filter:GF}),e):e,rfId:t.rfId,panZoom:t.panZoom,translateExtent:t.translateExtent,flowWidth:t.width,flowHeight:t.height,ariaLabelConfig:t.ariaLabelConfig}},WF="react-flow__minimap-desc";function dR({style:t,className:e,nodeStrokeColor:n,nodeColor:o,nodeClassName:s="",nodeBorderRadius:i=5,nodeStrokeWidth:l,nodeComponent:u,bgColor:d,maskColor:f,maskStrokeColor:g,maskStrokeWidth:m,position:y="bottom-right",onClick:v,onNodeClick:w,pannable:C=!1,zoomable:S=!1,ariaLabel:N,inversePan:M,zoomStep:E=1,offsetScale:R=5}){const D=ln(),T=x.useRef(null),{boundingRect:k,viewBB:O,rfId:L,panZoom:W,translateExtent:B,flowWidth:Y,flowHeight:q,ariaLabelConfig:z}=Ct(qF,an),V=t?.width??UF,A=t?.height??YF,H=k.width/V,P=k.height/A,F=Math.max(H,P),Q=F*V,$=F*A,I=R*F,U=k.x-(Q-k.width)/2-I,K=k.y-($-k.height)/2-I,J=Q+I*2,ne=$+I*2,X=`${WF}-${L}`,ee=x.useRef(0),se=x.useRef();ee.current=F,x.useEffect(()=>{if(T.current&&W)return se.current=uH({domNode:T.current,panZoom:W,getTransform:()=>D.getState().transform,getViewScale:()=>ee.current}),()=>{se.current?.destroy()}},[W]),x.useEffect(()=>{se.current?.update({translateExtent:B,width:Y,height:q,inversePan:M,pannable:C,zoomStep:E,zoomable:S})},[C,S,M,E,B,Y,q]);const le=v?be=>{const[ke,Be]=se.current?.pointer(be)||[0,0];v(be,{x:ke,y:Be})}:void 0,pe=w?x.useCallback((be,ke)=>{const Be=D.getState().nodeLookup.get(ke).internals.userNode;w(be,Be)},[]):void 0,ie=N??z["minimap.ariaLabel"];return p.jsx(vh,{position:y,style:{...t,"--xy-minimap-background-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-background-color-props":typeof f=="string"?f:void 0,"--xy-minimap-mask-stroke-color-props":typeof g=="string"?g:void 0,"--xy-minimap-mask-stroke-width-props":typeof m=="number"?m*F:void 0,"--xy-minimap-node-background-color-props":typeof o=="string"?o:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof l=="number"?l:void 0},className:Nn(["react-flow__minimap",e]),"data-testid":"rf__minimap",children:p.jsxs("svg",{width:V,height:A,viewBox:`${U} ${K} ${J} ${ne}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":X,ref:T,onClick:le,children:[ie&&p.jsx("title",{id:X,children:ie}),p.jsx(VF,{onClick:pe,nodeColor:o,nodeStrokeColor:n,nodeBorderRadius:i,nodeClassName:s,nodeStrokeWidth:l,nodeComponent:u}),p.jsx("path",{className:"react-flow__minimap-mask",d:`M${U-I},${K-I}h${J+I*2}v${ne+I*2}h${-J-I*2}z
61
- M${O.x},${O.y}h${O.width}v${O.height}h${-O.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}dR.displayName="MiniMap";x.memo(dR);const KF=t=>e=>t?`${Math.max(1/e.transform[2],1)}`:void 0,XF={[rl.Line]:"right",[rl.Handle]:"bottom-right"};function QF({nodeId:t,position:e,variant:n=rl.Handle,className:o,style:s=void 0,children:i,color:l,minWidth:u=10,minHeight:d=10,maxWidth:f=Number.MAX_VALUE,maxHeight:g=Number.MAX_VALUE,keepAspectRatio:m=!1,resizeDirection:y,autoScale:v=!0,shouldResize:w,onResizeStart:C,onResize:S,onResizeEnd:N}){const M=VM(),E=typeof t=="string"?t:M,R=ln(),D=x.useRef(null),T=n===rl.Handle,k=Ct(x.useCallback(KF(T&&v),[T,v]),an),O=x.useRef(null),L=e??XF[n];x.useEffect(()=>{if(!(!D.current||!E))return O.current||(O.current=EH({domNode:D.current,nodeId:E,getStoreItems:()=>{const{nodeLookup:B,transform:Y,snapGrid:q,snapToGrid:z,nodeOrigin:V,domNode:A}=R.getState();return{nodeLookup:B,transform:Y,snapGrid:q,snapToGrid:z,nodeOrigin:V,paneDomNode:A}},onChange:(B,Y)=>{const{triggerNodeChanges:q,nodeLookup:z,parentLookup:V,nodeOrigin:A}=R.getState(),H=[],P={x:B.x,y:B.y},F=z.get(E);if(F&&F.expandParent&&F.parentId){const Q=F.origin??A,$=B.width??F.measured.width??0,I=B.height??F.measured.height??0,U={id:F.id,parentId:F.parentId,rect:{width:$,height:I,...fM({x:B.x??F.position.x,y:B.y??F.position.y},{width:$,height:I},F.parentId,z,Q)}},K=Gy([U],z,V,A);H.push(...K),P.x=B.x?Math.max(Q[0]*$,B.x):void 0,P.y=B.y?Math.max(Q[1]*I,B.y):void 0}if(P.x!==void 0&&P.y!==void 0){const Q={id:E,type:"position",position:{...P}};H.push(Q)}if(B.width!==void 0&&B.height!==void 0){const $={id:E,type:"dimensions",resizing:!0,setAttributes:y?y==="horizontal"?"width":"height":!0,dimensions:{width:B.width,height:B.height}};H.push($)}for(const Q of Y){const $={...Q,type:"position"};H.push($)}q(H)},onEnd:({width:B,height:Y})=>{const q={id:E,type:"dimensions",resizing:!1,dimensions:{width:B,height:Y}};R.getState().triggerNodeChanges([q])}})),O.current.update({controlPosition:L,boundaries:{minWidth:u,minHeight:d,maxWidth:f,maxHeight:g},keepAspectRatio:m,resizeDirection:y,onResizeStart:C,onResize:S,onResizeEnd:N,shouldResize:w}),()=>{O.current?.destroy()}},[L,u,d,f,g,m,C,S,N,w]);const W=L.split("-");return p.jsx("div",{className:Nn(["react-flow__resize-control","nodrag",...W,n,o]),ref:D,style:{...s,scale:k,...l&&{[T?"backgroundColor":"borderColor"]:l}},children:i})}x.memo(QF);const ZF={timestamptz:"timestamp with time zone",bool:"boolean",bytea:"bytea",jsonb:"jsonb",text:"text",varchar:"character varying",uuid:"uuid",date:"date",time:"time without time zone",timetz:"time with time zone",timestamp:"timestamp without time zone",int2:"smallint",int4:"integer",int8:"bigint",float4:"real",float8:"double precision",numeric:"numeric"};function mu(t){if(t==null||t==="")return"";const e=t.trim().toLowerCase();return ZF[e]??t}function JF(t){const e=ge.c(14),{data:n}=t,{table:o}=n;let s;e[0]!==o.schema?(s=p.jsx("div",{className:"text-xs opacity-80",children:o.schema}),e[0]=o.schema,e[1]=s):s=e[1];let i;e[2]!==o.name?(i=p.jsx("div",{className:"text-base",children:o.name}),e[2]=o.name,e[3]=i):i=e[3];let l;e[4]!==s||e[5]!==i?(l=p.jsxs("div",{className:"bg-primary text-primary-foreground px-3 py-2 rounded-t-lg font-semibold",children:[s,i]}),e[4]=s,e[5]=i,e[6]=l):l=e[6];let u;e[7]!==o.columns?(u=o.columns.map(eV),e[7]=o.columns,e[8]=u):u=e[8];let d;e[9]!==u?(d=p.jsx("div",{className:"divide-y divide-border",children:u}),e[9]=u,e[10]=d):d=e[10];let f;return e[11]!==l||e[12]!==d?(f=p.jsxs("div",{className:"bg-card border border-border rounded-lg shadow-lg w-[250px]",children:[l,d]}),e[11]=l,e[12]=d,e[13]=f):f=e[13],f}function eV(t){return p.jsxs("div",{className:"px-3 py-1.5 text-sm flex items-center justify-between gap-2 hover:bg-accent/50 transition-colors relative",children:[p.jsxs("div",{className:"min-w-0 flex-1",children:[p.jsx("div",{className:"font-medium truncate text-card-foreground",children:t.name}),p.jsxs("div",{className:"text-xs text-muted-foreground truncate",children:[mu(t.type),t.nullable?" (nullable)":" (not null)"]})]}),p.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[t.isPrimaryKey&&p.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-emerald-500",style:{boxShadow:"0 0 4px 1px rgba(16, 185, 129, 0.6), 0 0 8px 3px rgba(16, 185, 129, 0.3)"},title:"Primary Key"}),t.foreignKey&&p.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-400",style:{boxShadow:"0 0 4px 1px rgba(251, 191, 36, 0.6), 0 0 8px 3px rgba(251, 191, 36, 0.3)"},title:"Foreign Key"})]}),t.foreignKey&&p.jsx(sl,{type:"source",position:qe.Right,id:`${t.name}-source`,className:"!w-2 !h-2 !border-0 !opacity-0",style:{background:"transparent",top:"50%",transform:"translateY(-50%)",right:0}}),t.isPrimaryKey&&p.jsx(sl,{type:"target",position:qe.Left,id:`${t.name}-target`,className:"!w-2 !h-2 !border-0 !opacity-0",style:{background:"transparent",top:"50%",transform:"translateY(-50%)",left:0}})]},t.name)}function Yc(t){const e=ge.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let o;return e[2]!==n?(o=p.jsx(rz,{"data-slot":"select",...n}),e[2]=n,e[3]=o):o=e[3],o}function al(t){const e=ge.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let o;return e[2]!==n?(o=p.jsx(az,{"data-slot":"select-value",...n}),e[2]=n,e[3]=o):o=e[3],o}function Gc(t){const e=ge.c(13);let n,o,s,i;e[0]!==t?({className:o,size:i,children:n,...s}=t,e[0]=t,e[1]=n,e[2]=o,e[3]=s,e[4]=i):(n=e[1],o=e[2],s=e[3],i=e[4]);const l=i===void 0?"default":i;let u;e[5]!==o?(u=Ne("border-input data-[placeholder]:text-muted-foreground dark:bg-input/30 dark:hover:bg-input/50 focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 gap-1.5 rounded-md border bg-transparent py-2 pr-2 pl-2.5 text-sm shadow-xs transition-[color,box-shadow] focus-visible:ring-[3px] aria-invalid:ring-[3px] data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:flex *:data-[slot=select-value]:gap-1.5 [&_svg:not([class*='size-'])]:size-4 flex w-fit items-center justify-between whitespace-nowrap outline-none disabled:cursor-not-allowed disabled:opacity-50 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center [&_svg]:pointer-events-none [&_svg]:shrink-0",o),e[5]=o,e[6]=u):u=e[6];let d;e[7]===Symbol.for("react.memo_cache_sentinel")?(d=p.jsx(iz,{asChild:!0,children:p.jsx(ms,{className:"text-muted-foreground size-4 pointer-events-none"})}),e[7]=d):d=e[7];let f;return e[8]!==n||e[9]!==s||e[10]!==l||e[11]!==u?(f=p.jsxs(sz,{"data-slot":"select-trigger","data-size":l,className:u,...s,children:[n,d]}),e[8]=n,e[9]=s,e[10]=l,e[11]=u,e[12]=f):f=e[12],f}function qc(t){const e=ge.c(28);let n,o,s,i,l,u,d;e[0]!==t?({className:o,children:n,position:i,align:l,side:u,avoidCollisions:d,...s}=t,e[0]=t,e[1]=n,e[2]=o,e[3]=s,e[4]=i,e[5]=l,e[6]=u,e[7]=d):(n=e[1],o=e[2],s=e[3],i=e[4],l=e[5],u=e[6],d=e[7]);const f=i===void 0?"popper":i,g=l===void 0?"start":l,m=u===void 0?"bottom":u,y=d===void 0?!1:d,v=f==="item-aligned",w=f==="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";let C;e[8]!==o||e[9]!==w?(C=Ne("bg-popover text-popover-foreground data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-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 ring-foreground/10 min-w-36 rounded-md shadow-md ring-1 duration-100 relative z-50 max-h-(--radix-select-content-available-height) origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto data-[align-trigger=true]:animate-none",w,o),e[8]=o,e[9]=w,e[10]=C):C=e[10];let S;e[11]===Symbol.for("react.memo_cache_sentinel")?(S=p.jsx(tV,{}),e[11]=S):S=e[11];const N=f==="popper"&&"";let M;e[12]!==N?(M=Ne("data-[position=popper]:h-[var(--radix-select-trigger-height)] data-[position=popper]:w-full data-[position=popper]:min-w-[var(--radix-select-trigger-width)]",N),e[12]=N,e[13]=M):M=e[13];let E;e[14]!==n||e[15]!==f||e[16]!==M?(E=p.jsx(uz,{"data-position":f,className:M,children:n}),e[14]=n,e[15]=f,e[16]=M,e[17]=E):E=e[17];let R;e[18]===Symbol.for("react.memo_cache_sentinel")?(R=p.jsx(nV,{}),e[18]=R):R=e[18];let D;return e[19]!==g||e[20]!==y||e[21]!==f||e[22]!==s||e[23]!==m||e[24]!==E||e[25]!==v||e[26]!==C?(D=p.jsx(lz,{children:p.jsxs(cz,{"data-slot":"select-content","data-align-trigger":v,className:C,position:f,align:g,side:m,avoidCollisions:y,...s,children:[S,E,R]})}),e[19]=g,e[20]=y,e[21]=f,e[22]=s,e[23]=m,e[24]=E,e[25]=v,e[26]=C,e[27]=D):D=e[27],D}function vr(t){const e=ge.c(13);let n,o,s;e[0]!==t?({className:o,children:n,...s}=t,e[0]=t,e[1]=n,e[2]=o,e[3]=s):(n=e[1],o=e[2],s=e[3]);let i;e[4]!==o?(i=Ne("focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground gap-2 rounded-sm py-1 pr-8 pl-2 text-sm [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2 relative flex w-full cursor-default items-center outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",o),e[4]=o,e[5]=i):i=e[5];let l;e[6]===Symbol.for("react.memo_cache_sentinel")?(l=p.jsx("span",{className:"pointer-events-none absolute right-2 flex size-4 items-center justify-center",children:p.jsx(hz,{children:p.jsx(da,{className:"pointer-events-none"})})}),e[6]=l):l=e[6];let u;e[7]!==n?(u=p.jsx(fz,{children:n}),e[7]=n,e[8]=u):u=e[8];let d;return e[9]!==s||e[10]!==i||e[11]!==u?(d=p.jsxs(dz,{"data-slot":"select-item",className:i,...s,children:[l,u]}),e[9]=s,e[10]=i,e[11]=u,e[12]=d):d=e[12],d}function tV(t){const e=ge.c(9);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let s;e[3]!==n?(s=Ne("bg-popover z-10 flex cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-4",n),e[3]=n,e[4]=s):s=e[4];let i;e[5]===Symbol.for("react.memo_cache_sentinel")?(i=p.jsx(sh,{}),e[5]=i):i=e[5];let l;return e[6]!==o||e[7]!==s?(l=p.jsx(mz,{"data-slot":"select-scroll-up-button",className:s,...o,children:i}),e[6]=o,e[7]=s,e[8]=l):l=e[8],l}function nV(t){const e=ge.c(9);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let s;e[3]!==n?(s=Ne("bg-popover z-10 flex cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-4",n),e[3]=n,e[4]=s):s=e[4];let i;e[5]===Symbol.for("react.memo_cache_sentinel")?(i=p.jsx(ms,{}),e[5]=i):i=e[5];let l;return e[6]!==o||e[7]!==s?(l=p.jsx(gz,{"data-slot":"select-scroll-down-button",className:s,...o,children:i}),e[6]=o,e[7]=s,e[8]=l):l=e[8],l}function oV(t){const e=ge.c(43),{nodesDraggable:n,onNodesDraggableChange:o,edgeType:s,onEdgeTypeChange:i,layoutType:l,onLayoutTypeChange:u,onAutoLayout:d,onHide:f}=t;let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=p.jsx("div",{className:"text-xs font-semibold text-card-foreground uppercase tracking-wide",children:"Layout Controls"}),e[0]=g):g=e[0];let m;e[1]===Symbol.for("react.memo_cache_sentinel")?(m=p.jsx("span",{className:"text-sm text-muted-foreground",children:"Draggable"}),e[1]=m):m=e[1];const y=n?"default":"secondary";let v;e[2]!==n||e[3]!==o?(v=()=>o(!n),e[2]=n,e[3]=o,e[4]=v):v=e[4];let w;e[5]!==n?(w=n?p.jsx(EI,{className:"h-4 w-4"}):p.jsx(NI,{className:"h-4 w-4"}),e[5]=n,e[6]=w):w=e[6];let C;e[7]!==y||e[8]!==v||e[9]!==w?(C=p.jsxs("div",{className:"flex items-center justify-between",children:[m,p.jsx(St,{size:"sm",variant:y,onClick:v,className:"h-8 w-8 p-0",children:w})]}),e[7]=y,e[8]=v,e[9]=w,e[10]=C):C=e[10];let S;e[11]===Symbol.for("react.memo_cache_sentinel")?(S=p.jsx("span",{className:"text-sm text-muted-foreground",children:"Layout Mode"}),e[11]=S):S=e[11];let N;e[12]!==u?(N=F=>u(F),e[12]=u,e[13]=N):N=e[13];let M;e[14]===Symbol.for("react.memo_cache_sentinel")?(M=p.jsx(Gc,{size:"sm",className:"w-full",children:p.jsx(al,{})}),e[14]=M):M=e[14];let E;e[15]===Symbol.for("react.memo_cache_sentinel")?(E=p.jsx(vr,{value:"strict",children:p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(fI,{className:"h-3 w-3"}),p.jsx("span",{children:"Strict Grid"})]})}),e[15]=E):E=e[15];let R;e[16]===Symbol.for("react.memo_cache_sentinel")?(R=p.jsxs(qc,{position:"popper",children:[E,p.jsx(vr,{value:"adapted",children:p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(uI,{className:"h-3 w-3"}),p.jsx("span",{children:"Adapted"})]})})]}),e[16]=R):R=e[16];let D;e[17]!==l||e[18]!==N?(D=p.jsxs("div",{className:"space-y-1.5",children:[S,p.jsxs(Yc,{value:l,onValueChange:N,children:[M,R]})]}),e[17]=l,e[18]=N,e[19]=D):D=e[19];let T;e[20]===Symbol.for("react.memo_cache_sentinel")?(T=p.jsx("span",{className:"text-sm text-muted-foreground",children:"Edge Type"}),e[20]=T):T=e[20];let k;e[21]!==i?(k=F=>i(F),e[21]=i,e[22]=k):k=e[22];let O;e[23]===Symbol.for("react.memo_cache_sentinel")?(O=p.jsx(Gc,{size:"sm",className:"w-full",children:p.jsx(al,{})}),e[23]=O):O=e[23];let L;e[24]===Symbol.for("react.memo_cache_sentinel")?(L=p.jsx(vr,{value:"default",children:p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(n7,{className:"h-3 w-3"}),p.jsx("span",{children:"Bezier"})]})}),e[24]=L):L=e[24];let W;e[25]===Symbol.for("react.memo_cache_sentinel")?(W=p.jsx(vr,{value:"straight",children:p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(k8,{className:"h-3 w-3"}),p.jsx("span",{children:"Straight"})]})}),e[25]=W):W=e[25];let B;e[26]===Symbol.for("react.memo_cache_sentinel")?(B=p.jsx(vr,{value:"step",children:p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(JI,{className:"h-3 w-3"}),p.jsx("span",{children:"Step"})]})}),e[26]=B):B=e[26];let Y;e[27]===Symbol.for("react.memo_cache_sentinel")?(Y=p.jsxs(qc,{position:"popper",children:[L,W,B,p.jsx(vr,{value:"smoothstep",children:p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(r7,{className:"h-3 w-3"}),p.jsx("span",{children:"Smooth Step"})]})})]}),e[27]=Y):Y=e[27];let q;e[28]!==s||e[29]!==k?(q=p.jsxs("div",{className:"space-y-1.5",children:[T,p.jsxs(Yc,{value:s,onValueChange:k,children:[O,Y]})]}),e[28]=s,e[29]=k,e[30]=q):q=e[30];let z;e[31]===Symbol.for("react.memo_cache_sentinel")?(z=p.jsx(a7,{className:"h-4 w-4 mr-2"}),e[31]=z):z=e[31];let V;e[32]!==d?(V=p.jsxs(St,{size:"sm",variant:"secondary",onClick:d,className:"w-full",children:[z,"Auto Layout"]}),e[32]=d,e[33]=V):V=e[33];let A;e[34]===Symbol.for("react.memo_cache_sentinel")?(A=p.jsx(xN,{className:"h-4 w-4 mr-2"}),e[34]=A):A=e[34];let H;e[35]!==f?(H=p.jsxs(St,{size:"sm",variant:"outline",onClick:f,className:"w-full",children:[A,"Hide"]}),e[35]=f,e[36]=H):H=e[36];let P;return e[37]!==D||e[38]!==q||e[39]!==V||e[40]!==H||e[41]!==C?(P=p.jsx("div",{className:"absolute top-4 right-4 z-10",children:p.jsxs("div",{className:"bg-card/80 backdrop-blur-md border border-border/50 rounded-lg shadow-lg p-3 space-y-3 min-w-[200px]",children:[g,C,D,q,V,H]})}),e[37]=D,e[38]=q,e[39]=V,e[40]=H,e[41]=C,e[42]=P):P=e[42],P}function fR(){const t=ge.c(3);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=p.jsx("div",{className:"text-xs font-medium text-muted-foreground mb-2",children:"Legend"}),t[0]=e):e=t[0];let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-emerald-500 shrink-0",style:{boxShadow:"0 0 4px 1px rgba(16, 185, 129, 0.6), 0 0 8px 3px rgba(16, 185, 129, 0.3)"}}),p.jsx("span",{className:"text-xs text-card-foreground",children:"Primary Key"})]}),t[1]=n):n=t[1];let o;return t[2]===Symbol.for("react.memo_cache_sentinel")?(o=p.jsxs("div",{className:"bg-card/80 backdrop-blur-md border border-border/50 rounded-lg shadow-lg px-3 py-2",children:[e,p.jsxs("div",{className:"flex flex-col gap-1.5",children:[n,p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-400 shrink-0",style:{boxShadow:"0 0 4px 1px rgba(251, 191, 36, 0.6), 0 0 8px 3px rgba(251, 191, 36, 0.3)"}}),p.jsx("span",{className:"text-xs text-card-foreground",children:"Foreign Key"})]})]})]}),t[2]=o):o=t[2],o}function rV(t){const e=ge.c(39),{table:n,onClose:o,onVisibilityChange:s,showLegend:i}=t,[l,u]=x.useState(!1),[d,f]=x.useState(!1),[g,m]=x.useState(null);let y,v;e[0]!==s||e[1]!==n?(y=()=>{n&&(m(n),requestAnimationFrame(()=>{u(!0),f(!1),s?.(!0)}))},v=[n,s],e[0]=s,e[1]=n,e[2]=y,e[3]=v):(y=e[2],v=e[3]),x.useEffect(y,v);let w;e[4]!==o||e[5]!==s?(w=()=>{f(!0),u(!1),s?.(!1),setTimeout(()=>{m(null),o()},200)},e[4]=o,e[5]=s,e[6]=w):w=e[6];const C=w;if(!g)return null;const S=`absolute bottom-0 left-0 right-0 z-20 transition-transform duration-200 ease-out ${l&&!d?"translate-y-0":"translate-y-full"}`;let N;e[7]!==i?(N=i&&p.jsx("div",{className:"absolute bottom-full left-4 mb-4",children:p.jsx(fR,{})}),e[7]=i,e[8]=N):N=e[8];let M;e[9]===Symbol.for("react.memo_cache_sentinel")?(M={maxHeight:"60vh",minHeight:"250px"},e[9]=M):M=e[9];let E;e[10]!==g.schema?(E=p.jsx("span",{className:"text-xs text-muted-foreground",children:g.schema}),e[10]=g.schema,e[11]=E):E=e[11];let R;e[12]!==g.name?(R=p.jsx("h2",{className:"text-lg font-semibold text-card-foreground",children:g.name}),e[12]=g.name,e[13]=R):R=e[13];let D;e[14]!==E||e[15]!==R?(D=p.jsxs("div",{children:[E,R]}),e[14]=E,e[15]=R,e[16]=D):D=e[16];let T;e[17]===Symbol.for("react.memo_cache_sentinel")?(T=p.jsx(vs,{className:"w-5 h-5 text-muted-foreground"}),e[17]=T):T=e[17];let k;e[18]!==C?(k=p.jsx("button",{onClick:C,className:"p-2 rounded-md hover:bg-accent transition-colors","aria-label":"Close panel",children:T}),e[18]=C,e[19]=k):k=e[19];let O;e[20]!==k||e[21]!==D?(O=p.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border shrink-0",children:[D,k]}),e[20]=k,e[21]=D,e[22]=O):O=e[22];let L;e[23]!==g.columns.length?(L=p.jsxs("div",{className:"text-sm text-muted-foreground mb-4",children:[g.columns.length," columns"]}),e[23]=g.columns.length,e[24]=L):L=e[24];let W;e[25]!==g.columns?(W=g.columns.map(sV),e[25]=g.columns,e[26]=W):W=e[26];let B;e[27]!==W?(B=p.jsx("div",{className:"space-y-2",children:W}),e[27]=W,e[28]=B):B=e[28];let Y;e[29]!==L||e[30]!==B?(Y=p.jsxs("div",{className:"flex-1 overflow-y-auto p-4 min-h-0",children:[L,B]}),e[29]=L,e[30]=B,e[31]=Y):Y=e[31];let q;e[32]!==O||e[33]!==Y?(q=p.jsxs("div",{className:"bg-card border-t border-border shadow-2xl flex flex-col",style:M,children:[O,Y]}),e[32]=O,e[33]=Y,e[34]=q):q=e[34];let z;return e[35]!==q||e[36]!==S||e[37]!==N?(z=p.jsxs("div",{className:S,children:[N,q]}),e[35]=q,e[36]=S,e[37]=N,e[38]=z):z=e[38],z}function sV(t){return p.jsxs("div",{className:"flex items-center justify-between py-2 px-3 rounded-md bg-accent/30 hover:bg-accent/60 transition-colors cursor-default",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("span",{className:"font-medium text-card-foreground",children:t.name}),p.jsxs("div",{className:"flex items-center gap-1",children:[t.isPrimaryKey&&p.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-emerald-500",style:{boxShadow:"0 0 4px 1px rgba(16, 185, 129, 0.6)"},title:"Primary Key"}),t.foreignKey&&p.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-400",style:{boxShadow:"0 0 4px 1px rgba(251, 191, 36, 0.6)"},title:"Foreign Key"})]})]}),p.jsxs("div",{className:"text-sm text-muted-foreground",children:[mu(t.type),t.nullable&&p.jsx("span",{className:"ml-1 opacity-60",children:"(nullable)"})]})]},t.name)}const aV={table:JF};function p0(t){return 60+t.columns.length*52+20}function s2(t,e){const n=new Map;if(t.length===0)return n;const o=240,s=40,i=40,l=o+s,u=50,d=50,f=t.map(y=>({id:`${y.schema}.${y.name}`,table:y,height:p0(y)}));f.sort((y,v)=>v.height-y.height);const g=Math.max(4,Math.ceil(Math.sqrt(t.length*1.5))),m=new Array(g).fill(d);return f.forEach(({id:y,height:v})=>{let w=0,C=m[0];for(let M=1;M<g;M++)m[M]<C&&(C=m[M],w=M);const S=u+w*l,N=m[w];n.set(y,{x:S,y:N}),m[w]=N+v+i}),n}const a2={padding:1};function iV(t){const e=ge.c(8),{layoutVersion:n}=t,{fitView:o}=xh(),s=_F();let i,l;e[0]!==o||e[1]!==s?(i=()=>{if(!s)return;const f=requestAnimationFrame(()=>{o(a2)});return()=>cancelAnimationFrame(f)},l=[s,o],e[0]=o,e[1]=s,e[2]=i,e[3]=l):(i=e[2],l=e[3]),x.useEffect(i,l);let u,d;return e[4]!==o||e[5]!==n?(u=()=>{if(n===0)return;const f=requestAnimationFrame(()=>{o(a2)});return()=>cancelAnimationFrame(f)},d=[n,o],e[4]=o,e[5]=n,e[6]=u,e[7]=d):(u=e[6],d=e[7]),x.useEffect(u,d),null}function lV(t){const e=ge.c(60),{schemaData:n,nodesDraggable:o,onNodesDraggableChange:s,edgeType:i,onEdgeTypeChange:l,layoutType:u,onLayoutTypeChange:d,controlsVisible:f,onControlsVisibleChange:g}=t;let m;e:{if(u==="adapted"){let pe;if(e[0]!==n.foreignKeys||e[1]!==n.tables){const ie=s2(n.tables,n.foreignKeys);pe=n.tables.map(be=>{const ke=`${be.schema}.${be.name}`,Be=ie.get(ke)||{x:50,y:50};return{id:ke,type:"table",position:Be,data:{table:be}}}),e[0]=n.foreignKeys,e[1]=n.tables,e[2]=pe}else pe=e[2];m=pe;break e}let ee;e[3]!==n.tables.length?(ee=Math.sqrt(n.tables.length),e[3]=n.tables.length,e[4]=ee):ee=e[4];const se=Math.ceil(ee);let le;if(e[5]!==se||e[6]!==n.tables){const pe=[];for(let be=0;be<se;be++)pe.push([]);n.tables.forEach((be,ke)=>{pe[ke%se].push(be)});const ie=new Map;pe.forEach((be,ke)=>{let Be=50;be.forEach(Ie=>{const lt=`${Ie.schema}.${Ie.name}`;ie.set(lt,{x:ke*320+50,y:Be}),Be=Be+(p0(Ie)+60)})}),le=n.tables.map(be=>{const ke=`${be.schema}.${be.name}`,Be=ie.get(ke)||{x:50,y:50};return{id:ke,type:"table",position:Be,data:{table:be}}}),e[5]=se,e[6]=n.tables,e[7]=le}else le=e[7];m=le}const y=m;let v;if(e[8]!==i||e[9]!==n.foreignKeys||e[10]!==n.tables){let ee;e[12]!==n.tables?(ee=le=>{const pe=n.tables.find(be=>`${be.schema}.${be.name}`===le.fromTable),ie=n.tables.find(be=>`${be.schema}.${be.name}`===le.toTable);return!pe||!ie?(console.warn(`Skipping edge: table not found for FK ${le.constraintName}`),!1):!0},e[12]=n.tables,e[13]=ee):ee=e[13];let se;e[14]!==i?(se=(le,pe)=>({id:`edge-${pe}-${le.constraintName}`,source:le.fromTable,target:le.toTable,sourceHandle:`${le.fromColumn}-source`,targetHandle:`${le.toColumn}-target`,type:i,style:{stroke:"oklch(1 0 0 / 25%)",strokeWidth:2},animated:!0}),e[14]=i,e[15]=se):se=e[15],v=n.foreignKeys.filter(ee).map(se),e[8]=i,e[9]=n.foreignKeys,e[10]=n.tables,e[11]=v}else v=e[11];const w=v,[C,S,N]=SF(y),[M,E,R]=CF(w),[D,T]=x.useState(null),[k,O]=x.useState(!1),[L,W]=x.useState(0);let B,Y;e[16]!==y||e[17]!==S?(B=()=>{S(y)},Y=[y,S],e[16]=y,e[17]=S,e[18]=B,e[19]=Y):(B=e[18],Y=e[19]),x.useEffect(B,Y);let q,z;e[20]!==w||e[21]!==E?(q=()=>{E(w)},z=[w,E],e[20]=w,e[21]=E,e[22]=q,e[23]=z):(q=e[22],z=e[23]),x.useEffect(q,z);let V;e[24]===Symbol.for("react.memo_cache_sentinel")?(V=(ee,se)=>{const le=se.data.table;T(le)},e[24]=V):V=e[24];const A=V;let H;e[25]===Symbol.for("react.memo_cache_sentinel")?(H=()=>{T(null)},e[25]=H):H=e[25];const P=H;let F;e[26]!==u||e[27]!==n.foreignKeys||e[28]!==n.tables||e[29]!==S?(F=()=>{if(u==="adapted"){const ee=s2(n.tables,n.foreignKeys);S(se=>se.map(le=>({...le,position:ee.get(le.id)||le.position})))}else{const ee=Math.ceil(Math.sqrt(n.tables.length)),se=new Map;n.tables.forEach(le=>{se.set(`${le.schema}.${le.name}`,le)}),S(le=>{const pe=[];for(let be=0;be<ee;be++)pe.push([]);le.forEach((be,ke)=>{pe[ke%ee].push(be)});const ie=new Map;return pe.forEach((be,ke)=>{let Be=50;be.forEach(Ie=>{ie.set(Ie.id,{x:ke*320+50,y:Be});const lt=se.get(Ie.id);lt?Be=Be+(p0(lt)+60):Be=Be+260})}),le.map(be=>({...be,position:ie.get(be.id)||be.position}))})}W(cV)},e[26]=u,e[27]=n.foreignKeys,e[28]=n.tables,e[29]=S,e[30]=F):F=e[30];const Q=F;let $;e[31]===Symbol.for("react.memo_cache_sentinel")?($={hideAttribution:!0},e[31]=$):$=e[31];let I;e[32]!==L?(I=p.jsx(iV,{layoutVersion:L}),e[32]=L,e[33]=I):I=e[33];let U;e[34]===Symbol.for("react.memo_cache_sentinel")?(U=p.jsx(TF,{gap:20,size:1,color:"var(--muted-foreground)"}),e[34]=U):U=e[34];let K;e[35]!==M||e[36]!==C||e[37]!==o||e[38]!==R||e[39]!==N||e[40]!==I?(K=p.jsxs(wF,{nodes:C,edges:M,nodeTypes:aV,onNodesChange:N,onEdgesChange:R,onNodeClick:A,nodesDraggable:o,nodesConnectable:!1,proOptions:$,className:"bg-background",children:[I,U]}),e[35]=M,e[36]=C,e[37]=o,e[38]=R,e[39]=N,e[40]=I,e[41]=K):K=e[41];let J;e[42]!==f||e[43]!==i||e[44]!==Q||e[45]!==k||e[46]!==u||e[47]!==o||e[48]!==g||e[49]!==l||e[50]!==d||e[51]!==s?(J=f&&p.jsxs(p.Fragment,{children:[p.jsx(oV,{nodesDraggable:o,onNodesDraggableChange:s,edgeType:i,onEdgeTypeChange:l,layoutType:u,onLayoutTypeChange:d,onAutoLayout:Q,onHide:()=>g(!1)}),p.jsx("div",{className:`absolute left-4 z-20 transition-all duration-200 ease-out ${k?"opacity-0 pointer-events-none":"bottom-4 opacity-100"}`,children:p.jsx(fR,{})})]}),e[42]=f,e[43]=i,e[44]=Q,e[45]=k,e[46]=u,e[47]=o,e[48]=g,e[49]=l,e[50]=d,e[51]=s,e[52]=J):J=e[52];let ne;e[53]!==k||e[54]!==D?(ne=p.jsx(rV,{table:D,onClose:P,onVisibilityChange:O,showLegend:k}),e[53]=k,e[54]=D,e[55]=ne):ne=e[55];let X;return e[56]!==K||e[57]!==J||e[58]!==ne?(X=p.jsxs("div",{className:"w-full h-full bg-background relative",children:[K,J,ne]}),e[56]=K,e[57]=J,e[58]=ne,e[59]=X):X=e[59],X}function cV(t){return t+1}function xl(t){const e=ge.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let o;return e[2]!==n?(o=p.jsx(T6,{"data-slot":"popover",...n}),e[2]=n,e[3]=o):o=e[3],o}function hR(t){const e=ge.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let o;return e[2]!==n?(o=p.jsx(j6,{"data-slot":"popover-trigger",...n}),e[2]=n,e[3]=o):o=e[3],o}function bl(t){const e=ge.c(12);let n,o,s,i;e[0]!==t?({className:n,align:s,sideOffset:i,...o}=t,e[0]=t,e[1]=n,e[2]=o,e[3]=s,e[4]=i):(n=e[1],o=e[2],s=e[3],i=e[4]);const l=s===void 0?"center":s,u=i===void 0?4:i;let d;e[5]!==n?(d=Ne("bg-popover text-popover-foreground data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-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 ring-foreground/10 flex flex-col gap-4 rounded-md p-4 text-sm shadow-md ring-1 duration-100 z-50 w-72 origin-(--radix-popover-content-transform-origin) outline-hidden",n),e[5]=n,e[6]=d):d=e[6];let f;return e[7]!==l||e[8]!==o||e[9]!==u||e[10]!==d?(f=p.jsx(A6,{children:p.jsx(O6,{"data-slot":"popover-content",align:l,sideOffset:u,className:d,...o})}),e[7]=l,e[8]=o,e[9]=u,e[10]=d,e[11]=f):f=e[11],f}function Sh(t){const e=ge.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let o;return e[2]!==n?(o=p.jsx(k6,{"data-slot":"popover-anchor",...n}),e[2]=n,e[3]=o):o=e[3],o}function Wy(t){const e=ge.c(9);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let s;e[3]!==n?(s=Ne("border-input dark:bg-input/30 data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary data-checked:border-primary aria-invalid:aria-checked:border-primary aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 flex size-4 items-center justify-center rounded-[4px] border shadow-xs transition-shadow group-has-disabled/field:opacity-50 focus-visible:ring-[3px] aria-invalid:ring-[3px] peer relative shrink-0 outline-none after:absolute after:-inset-x-3 after:-inset-y-2 disabled:cursor-not-allowed disabled:opacity-50",n),e[3]=n,e[4]=s):s=e[4];let i;e[5]===Symbol.for("react.memo_cache_sentinel")?(i=p.jsx(tE,{"data-slot":"checkbox-indicator",className:"[&>svg]:size-3.5 grid place-content-center text-current transition-none",children:p.jsx(da,{})}),e[5]=i):i=e[5];let l;return e[6]!==o||e[7]!==s?(l=p.jsx(JC,{"data-slot":"checkbox",className:s,...o,children:i}),e[6]=o,e[7]=s,e[8]=l):l=e[8],l}function uV(t){const e=ge.c(17),{connectionName:n,availableSchemas:o,selectedSchemas:s,onSelectedSchemasChange:i,filteredTableCount:l,relationshipCount:u}=t;let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=p.jsx("h1",{className:"text-xl font-bold text-card-foreground",children:"Database Schema"}),e[0]=d):d=e[0];let f;e[1]!==o||e[2]!==i||e[3]!==s?(f=o.length>1&&p.jsxs(xl,{children:[p.jsx(hR,{asChild:!0,children:p.jsxs(St,{variant:"outline",size:"sm",className:Ne("w-[200px] justify-between font-normal",s.length>0&&"border-primary/50"),children:[p.jsx("span",{className:"truncate",children:s.length===0||s.length===o.length?"All schemas":s.length===1?s[0]:`${s.length} schemas`}),p.jsx(ms,{className:"ml-2 size-4 shrink-0 opacity-50"})]})}),p.jsx(bl,{className:"w-[200px] p-2",align:"start",children:p.jsx("div",{className:"flex flex-col gap-1",children:o.map(C=>{const S=s.length===0||s.includes(C);return p.jsxs("label",{className:"flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-sm hover:bg-accent",children:[p.jsx(Wy,{checked:S,onCheckedChange:N=>{i(N?M=>{const E=M.length===0?[C]:[...M,C];return E.length===o.length?[]:E}:M=>M.length===0?o.filter(E=>E!==C):M.filter(E=>E!==C))}}),p.jsx("span",{children:C})]},C)})})})]}),e[1]=o,e[2]=i,e[3]=s,e[4]=f):f=e[4];let g;e[5]!==f?(g=p.jsxs("div",{className:"flex items-center justify-between gap-4 mb-2",children:[d,f]}),e[5]=f,e[6]=g):g=e[6];const m=l===1?"table":"tables";let y;e[7]!==l||e[8]!==u||e[9]!==m?(y=p.jsxs("span",{className:"ml-1",children:["• ",l," ",m," • ",u," relationships"]}),e[7]=l,e[8]=u,e[9]=m,e[10]=y):y=e[10];let v;e[11]!==n||e[12]!==y?(v=p.jsxs("p",{className:"text-sm text-muted-foreground",children:[n,y]}),e[11]=n,e[12]=y,e[13]=v):v=e[13];let w;return e[14]!==g||e[15]!==v?(w=p.jsx("div",{className:"absolute top-4 left-4 z-10",children:p.jsxs("div",{className:"bg-card/80 backdrop-blur-md border border-border/50 rounded-lg shadow-lg px-4 py-3",children:[g,v]})}),e[14]=g,e[15]=v,e[16]=w):w=e[16],w}function dV(t){const e=ge.c(2),{onShowControls:n}=t;let o;return e[0]!==n?(o=p.jsx("div",{className:"absolute top-4 right-4 z-10",children:p.jsx(St,{variant:"outline",size:"sm",onClick:n,className:"bg-card/80 backdrop-blur-md border-border/50",children:"Show Controller"})}),e[0]=n,e[1]=o):o=e[1],o}async function fV(t){const e=await fetch("/api/schema",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({connectionString:t})});if(!e.ok){let o=`HTTP error! status: ${e.status}`;try{const s=await e.json();o=s.error||o,console.error("API error response:",s)}catch{const i=await e.text().catch(()=>"");console.error("Failed to parse error response. Raw response:",i)}throw new Error(o)}const n=await e.json();if(!n.success||!n.data)throw new Error(n.error||"Failed to fetch schema data");return n.data}function mR({connection:t}){const[e,n]=x.useState(null),[o,s]=x.useState(!1),[i,l]=x.useState(null),u=x.useCallback(async()=>{if(t?.connectionString){s(!0),l(null);try{const d=await fV(t.connectionString);n(d)}catch(d){const f=d instanceof Error?d.message:"Failed to load schema data";l(f),console.error("Error loading schema data:",d),n(null)}finally{s(!1)}}},[t?.connectionString]);return x.useEffect(()=>{t?.connectionString&&u()},[t?.connectionString,u]),{schemaData:e,loading:o,error:i,refetch:u}}function hV(t){const e=ge.c(28),{schemaData:n,selectedSchemas:o,setSelectedSchemas:s}=t;let i;e:{if(!n){let w;e[0]===Symbol.for("react.memo_cache_sentinel")?(w=[],e[0]=w):w=e[0],i=w;break e}let v;if(e[1]!==n.tables){const w=new Set(n.tables.map(pV));v=Array.from(w).sort(),e[1]=n.tables,e[2]=v}else v=e[2];i=v}const l=i;let u,d;e[3]!==n||e[4]!==o||e[5]!==s?(u=()=>{if(!n||o.length===0)return;const v=new Set(n.tables.map(gV));o.some(C=>!v.has(C))&&s(C=>C.filter(S=>v.has(S)))},d=[n,o,s],e[3]=n,e[4]=o,e[5]=s,e[6]=u,e[7]=d):(u=e[6],d=e[7]),x.useEffect(u,d);let f;e:{if(!n){f=null;break e}if(o.length===0){f=n;break e}let v;e[8]!==o?(v=new Set(o),e[8]=o,e[9]=v):v=e[9];const w=v;let C,S;if(e[10]!==n.tables||e[11]!==w){let D;e[14]!==w?(D=T=>w.has(T.schema),e[14]=w,e[15]=D):D=e[15],C=n.tables.filter(D),S=new Set(C.map(mV)),e[10]=n.tables,e[11]=w,e[12]=C,e[13]=S}else C=e[12],S=e[13];const N=S;let M;if(e[16]!==n.foreignKeys||e[17]!==N){let D;e[19]!==N?(D=T=>N.has(T.fromTable)&&N.has(T.toTable),e[19]=N,e[20]=D):D=e[20],M=n.foreignKeys.filter(D),e[16]=n.foreignKeys,e[17]=N,e[18]=M}else M=e[18];const E=M;let R;e[21]!==E||e[22]!==C?(R={tables:C,foreignKeys:E},e[21]=E,e[22]=C,e[23]=R):R=e[23],f=R}const g=f,m=g?.tables.length??0;let y;return e[24]!==l||e[25]!==g||e[26]!==m?(y={availableSchemas:l,filteredSchemaData:g,filteredTableCount:m},e[24]=l,e[25]=g,e[26]=m,e[27]=y):y=e[27],y}function mV(t){return`${t.schema}.${t.name}`}function gV(t){return t.schema}function pV(t){return t.schema}function Ch(t,e,n){const o=JSON.stringify,s=JSON.parse,i=n?.validate,[l,u]=x.useState(()=>{try{const f=localStorage.getItem(t);if(f!==null){const g=s(f);return i&&i(g),g}}catch(f){console.warn(`Failed to read localStorage key "${t}":`,f)}return e});x.useEffect(()=>{try{localStorage.setItem(t,o(l))}catch(f){console.warn(`Failed to write localStorage key "${t}":`,f)}},[t,l,o]);const d=x.useCallback(f=>{u(g=>f instanceof Function?f(g):f)},[]);return[l,d]}const yV=["default","straight","step","smoothstep"],vV=["strict","adapted"],ja={selectedSchemas:[],nodesDraggable:!0,edgeType:"default",layoutType:"strict",controlsVisible:!0};function Ai(t){if(!t||typeof t!="object")return ja;const e=t;let n=ja.selectedSchemas;return Array.isArray(e.selectedSchemas)&&e.selectedSchemas.every(o=>typeof o=="string")?n=e.selectedSchemas:typeof e.selectedSchema=="string"&&e.selectedSchema!=="all"&&(n=[e.selectedSchema]),{selectedSchemas:n,nodesDraggable:typeof e.nodesDraggable=="boolean"?e.nodesDraggable:ja.nodesDraggable,edgeType:yV.includes(e.edgeType)?e.edgeType:ja.edgeType,layoutType:vV.includes(e.layoutType)?e.layoutType:ja.layoutType,controlsVisible:typeof e.controlsVisible=="boolean"?e.controlsVisible:ja.controlsVisible}}function xV(){const t=ge.c(19),[e,n]=Ch("fb-schema-view",ja);let o;t[0]!==e?(o=Ai(e),t[0]=e,t[1]=o):o=t[1];const s=o;let i;t[2]!==n?(i=S=>{n(N=>{const M=Ai(N),E=typeof S=="function"?S(M.selectedSchemas):S;return{...M,selectedSchemas:E}})},t[2]=n,t[3]=i):i=t[3];const l=i;let u;t[4]!==n?(u=S=>{n(N=>({...Ai(N),nodesDraggable:S}))},t[4]=n,t[5]=u):u=t[5];const d=u;let f;t[6]!==n?(f=S=>{n(N=>({...Ai(N),edgeType:S}))},t[6]=n,t[7]=f):f=t[7];const g=f;let m;t[8]!==n?(m=S=>{n(N=>({...Ai(N),layoutType:S}))},t[8]=n,t[9]=m):m=t[9];const y=m;let v;t[10]!==n?(v=S=>{n(N=>({...Ai(N),controlsVisible:S}))},t[10]=n,t[11]=v):v=t[11];const w=v;let C;return t[12]!==w||t[13]!==g||t[14]!==y||t[15]!==d||t[16]!==l||t[17]!==s?(C={viewState:s,setSelectedSchemas:l,setNodesDraggable:d,setEdgeType:g,setLayoutType:y,setControlsVisible:w},t[12]=w,t[13]=g,t[14]=y,t[15]=d,t[16]=l,t[17]=s,t[18]=C):C=t[18],C}function bV(t){const e=ge.c(8);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let s;e[3]!==n?(s=Ne("size-4 animate-spin",n),e[3]=n,e[4]=s):s=e[4];let i;return e[5]!==o||e[6]!==s?(i=p.jsx(hy,{role:"status","aria-label":"Loading",className:s,...o}),e[5]=o,e[6]=s,e[7]=i):i=e[7],i}function wl(){const t=ge.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=p.jsx("div",{className:"flex items-center gap-4",children:p.jsx(bV,{})}),t[0]=e):e=t[0],e}function wV(){const t=ge.c(35),{selectedConnection:e}=kr();let n;t[0]!==e?(n={connection:e},t[0]=e,t[1]=n):n=t[1];const{schemaData:o,loading:s,error:i}=mR(n),{viewState:l,setSelectedSchemas:u,setNodesDraggable:d,setEdgeType:f,setLayoutType:g,setControlsVisible:m}=xV();let y;t[2]!==o||t[3]!==u||t[4]!==l.selectedSchemas?(y={schemaData:o,selectedSchemas:l.selectedSchemas,setSelectedSchemas:u},t[2]=o,t[3]=u,t[4]=l.selectedSchemas,t[5]=y):y=t[5];const{availableSchemas:v,filteredSchemaData:w,filteredTableCount:C}=hV(y);if(!e?.connectionString){let D;return t[6]===Symbol.for("react.memo_cache_sentinel")?(D=p.jsx("div",{className:"h-full flex items-center justify-center",children:p.jsx("p",{className:"text-muted-foreground",children:"Connection selected but missing connection string"})}),t[6]=D):D=t[6],D}if(s){let D;return t[7]===Symbol.for("react.memo_cache_sentinel")?(D=p.jsx("div",{className:"h-full flex items-center justify-center",children:p.jsx(wl,{})}),t[7]=D):D=t[7],D}if(i){let D;return t[8]!==i?(D=p.jsx("div",{className:"h-full flex items-center justify-center p-6",children:p.jsx("div",{className:"bg-destructive/10 border border-destructive/20 text-destructive px-4 py-3 rounded-md",children:i})}),t[8]=i,t[9]=D):D=t[9],D}if(!w)return null;const S=e.name||e.databaseName||"Unnamed connection";let N;t[10]!==w||t[11]!==m||t[12]!==f||t[13]!==g||t[14]!==d||t[15]!==l.controlsVisible||t[16]!==l.edgeType||t[17]!==l.layoutType||t[18]!==l.nodesDraggable?(N=p.jsx(lV,{schemaData:w,nodesDraggable:l.nodesDraggable,onNodesDraggableChange:d,edgeType:l.edgeType,onEdgeTypeChange:f,layoutType:l.layoutType,onLayoutTypeChange:g,controlsVisible:l.controlsVisible,onControlsVisibleChange:m}),t[10]=w,t[11]=m,t[12]=f,t[13]=g,t[14]=d,t[15]=l.controlsVisible,t[16]=l.edgeType,t[17]=l.layoutType,t[18]=l.nodesDraggable,t[19]=N):N=t[19];let M;t[20]!==v||t[21]!==S||t[22]!==w||t[23]!==C||t[24]!==u||t[25]!==l.controlsVisible||t[26]!==l.selectedSchemas?(M=l.controlsVisible&&p.jsx(uV,{connectionName:S,availableSchemas:v,selectedSchemas:l.selectedSchemas,onSelectedSchemasChange:u,filteredTableCount:C,relationshipCount:w.foreignKeys.length}),t[20]=v,t[21]=S,t[22]=w,t[23]=C,t[24]=u,t[25]=l.controlsVisible,t[26]=l.selectedSchemas,t[27]=M):M=t[27];let E;t[28]!==m||t[29]!==l.controlsVisible?(E=!l.controlsVisible&&p.jsx(dV,{onShowControls:()=>m(!0)}),t[28]=m,t[29]=l.controlsVisible,t[30]=E):E=t[30];let R;return t[31]!==N||t[32]!==M||t[33]!==E?(R=p.jsxs("div",{className:"h-full w-full relative",children:[N,M,E]}),t[31]=N,t[32]=M,t[33]=E,t[34]=R):R=t[34],R}function SV(t){const e=ge.c(48),{tables:n,selectedTable:o,selectedSchema:s,onSchemaChange:i,onSingleClick:l,onDoubleClick:u}=t,[d,f]=x.useState("");let g;if(e[0]!==n){const k=new Set(n.map(_V));g=Array.from(k).sort(),e[0]=n,e[1]=g}else g=e[1];const m=g;let y;if(e[2]!==d||e[3]!==s||e[4]!==n){let k;e[6]!==d||e[7]!==s?(k=O=>{const L=O.name.toLowerCase().includes(d.toLowerCase()),W=s==="all"||O.schema===s;return L&&W},e[6]=d,e[7]=s,e[8]=k):k=e[8],y=n.filter(k),e[2]=d,e[3]=s,e[4]=n,e[5]=y}else y=e[5];const v=y;let w,C,S,N;if(e[9]!==m||e[10]!==v||e[11]!==u||e[12]!==i||e[13]!==l||e[14]!==d||e[15]!==s||e[16]!==o?.name||e[17]!==o?.schema){const k=v.reduce(EV,{}),O=Object.keys(k).sort();S="h-full flex flex-col bg-card border-r border-border";let L;e[22]===Symbol.for("react.memo_cache_sentinel")?(L=p.jsx("h2",{className:"text-sm font-semibold text-card-foreground",children:"Tables"}),e[22]=L):L=e[22];let W;e[23]!==m||e[24]!==i||e[25]!==s?(W=m.length>1&&p.jsxs(Yc,{value:s,onValueChange:i,children:[p.jsx(Gc,{className:"w-full h-8 text-sm",children:p.jsx(al,{placeholder:"All schemas"})}),p.jsxs(qc,{position:"popper",sideOffset:4,align:"start",children:[p.jsx(vr,{value:"all",children:"All schemas"}),m.map(CV)]})]}),e[23]=m,e[24]=i,e[25]=s,e[26]=W):W=e[26];let B;e[27]===Symbol.for("react.memo_cache_sentinel")?(B=p.jsx(iu,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),e[27]=B):B=e[27];let Y;e[28]===Symbol.for("react.memo_cache_sentinel")?(Y=z=>f(z.target.value),e[28]=Y):Y=e[28];let q;e[29]!==d?(q=p.jsxs("div",{className:"relative",children:[B,p.jsx(ar,{placeholder:"Search tables...",value:d,onChange:Y,className:"pl-8 h-8 text-sm"})]}),e[29]=d,e[30]=q):q=e[30],e[31]!==q||e[32]!==W?(N=p.jsxs("div",{className:"p-3 border-b border-border shrink-0 space-y-2",children:[L,W,q]}),e[31]=q,e[32]=W,e[33]=N):N=e[33],w="flex-1 overflow-y-auto p-2",C=O.map(z=>p.jsxs("div",{className:"mb-2",children:[O.length>1&&p.jsx("div",{className:"px-2 py-1 text-xs font-medium text-muted-foreground uppercase tracking-wider",children:z}),p.jsx("div",{className:"space-y-0.5",children:k[z].map(V=>{const A=o?.name===V.name&&o?.schema===V.schema;return p.jsxs("button",{onClick:()=>l(V),onDoubleClick:()=>u(V),className:`w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-sm transition-colors text-left ${A?"bg-primary text-primary-foreground":"hover:bg-accent text-card-foreground"}`,children:[p.jsx(ih,{className:"w-4 h-4 shrink-0"}),p.jsx("span",{className:"truncate flex-1",children:V.name}),A&&p.jsx(vN,{className:"w-4 h-4 shrink-0"})]},`${V.schema}.${V.name}`)})})]},z)),e[9]=m,e[10]=v,e[11]=u,e[12]=i,e[13]=l,e[14]=d,e[15]=s,e[16]=o?.name,e[17]=o?.schema,e[18]=w,e[19]=C,e[20]=S,e[21]=N}else w=e[18],C=e[19],S=e[20],N=e[21];let M;e[34]!==v.length?(M=v.length===0&&p.jsx("div",{className:"px-2 py-4 text-sm text-muted-foreground text-center",children:"No tables found"}),e[34]=v.length,e[35]=M):M=e[35];let E;e[36]!==w||e[37]!==C||e[38]!==M?(E=p.jsxs("div",{className:w,children:[C,M]}),e[36]=w,e[37]=C,e[38]=M,e[39]=E):E=e[39];const R=v.length===1?"table":"tables";let D;e[40]!==v.length||e[41]!==R?(D=p.jsx("div",{className:"p-3 border-t border-border shrink-0",children:p.jsxs("p",{className:"text-xs text-muted-foreground",children:[v.length," ",R]})}),e[40]=v.length,e[41]=R,e[42]=D):D=e[42];let T;return e[43]!==D||e[44]!==S||e[45]!==N||e[46]!==E?(T=p.jsxs("div",{className:S,children:[N,E,D]}),e[43]=D,e[44]=S,e[45]=N,e[46]=E,e[47]=T):T=e[47],T}function CV(t){return p.jsx(vr,{value:t,children:t},t)}function EV(t,e){return t[e.schema]||(t[e.schema]=[]),t[e.schema].push(e),t}function _V(t){return t.schema}function gR(t,e){return typeof t=="string"?t:t?.(e)}function i2(t){return!!t&&typeof t=="object"&&"id"in t&&"name"in t&&"size"in t&&"type"in t}function l2(t,e){return e.find(n=>n.value===t||n.value.toLowerCase()===t.toLowerCase()||n.label.toLowerCase()===t.toLowerCase())?.value}function on(t,e){return`${t}:${e}`}function Ho(t){const e=t.split(":"),n=e[0],o=e[1];if(n&&o){const s=parseInt(n,10);if(!Number.isNaN(s))return{rowIndex:s,columnId:o}}return{rowIndex:0,columnId:""}}function y0(t){return{short:36,medium:56,tall:76,"extra-tall":96}[t]}function pR(t){return{short:1,medium:2,tall:3,"extra-tall":4}[t]}function yR(t){const{column:e,nextColumn:n,isLastColumn:o}=t,s=e.getIsPinned(),i=s==="right"&&e.getIsFirstColumn("right"),l=s==="right"&&e.getIsLastColumn("right");return{showEndBorder:!(n?.getIsPinned()==="right"&&n?.getIsFirstColumn("right"))&&(o||!l),showStartBorder:i}}function vR(t){const{column:e,dir:n="ltr",withBorder:o=!1}=t,s=e.getIsPinned(),i=s==="left"&&e.getIsLastColumn("left"),l=s==="right"&&e.getIsFirstColumn("right"),u=n==="rtl",d=s==="left"?`${e.getStart("left")}px`:void 0,f=s==="right"?`${e.getAfter("right")}px`:void 0;return{boxShadow:o?i?u?"4px 0 4px -4px var(--border) inset":"-4px 0 4px -4px var(--border) inset":l?u?"-4px 0 4px -4px var(--border) inset":"4px 0 4px -4px var(--border) inset":void 0:void 0,left:u?f:d,right:u?d:f,opacity:s?.97:1,position:s?"sticky":"relative",background:"var(--background)",width:e.getSize(),zIndex:s?1:void 0}}function c2(t){if(t==="left"||t==="right"||t==="home"||t==="end")return t;if(t==="pageleft")return"left";if(t==="pageright")return"right"}function Oi(t){const{container:e,targetCell:n,tableRef:o,direction:s,viewportOffset:i,isRtl:l}=t,u=e.getBoundingClientRect(),d=n.getBoundingClientRect(),f=e.scrollLeft<0,g=l||f,m=o.current,y=m?.getLeftVisibleLeafColumns()??[],v=m?.getRightVisibleLeafColumns()??[],w=y.reduce((T,k)=>T+k.getSize(),0),C=v.reduce((T,k)=>T+k.getSize(),0),S=g?u.left+C+i:u.left+w+i,N=g?u.right-w-i:u.right-C-i;if(d.left>=S&&d.right<=N)return;const E=d.left<S,R=d.right>N;let D=0;s?(g?s==="right"||s==="home":s==="right"||s==="end")?D=d.right-N:D=-(S-d.left):R?D=d.right-N:E&&(D=-(S-d.left)),e.scrollLeft+=D}function u2(t){return t instanceof Element&&(t.closest("[data-grid-cell-editor]")||t.closest("[data-grid-popover]"))!==null}function NV(t){switch(t){case"short-text":return{label:"Short text",icon:A8};case"long-text":return{label:"Long text",icon:XI};case"number":return{label:"Number",icon:mI};case"url":return{label:"URL",icon:yI};case"checkbox":return{label:"Checkbox",icon:YI};case"select":return{label:"Select",icon:wI};case"multi-select":return{label:"Multi-select",icon:xI};case"date":return{label:"Date",icon:z8};case"file":return{label:"File",icon:bN};default:return null}}function d2(t){if(!t||t.trim()==="")return"";const e=t.trim();return/^(javascript|data|vbscript|file):/i.test(e)?"":e.startsWith("http://")||e.startsWith("https://")?e:`http://${e}`}function xR(t){if(!t)return null;if(t instanceof Date)return t;if(typeof t!="string")return null;const[e,n,o]=t.split("-").map(Number);if(!e||!n||!o)return null;const s=new Date(e,n-1,o);return s.getFullYear()!==e||s.getMonth()!==n-1||s.getDate()!==o?null:s}function MV(t){const e=t.getFullYear(),n=String(t.getMonth()+1).padStart(2,"0"),o=String(t.getDate()).padStart(2,"0");return`${e}-${n}-${o}`}function RV(t){if(!t)return"";const e=xR(t);return e?e.toLocaleDateString():typeof t=="string"?t:""}function yp(t){if(t<=0||!Number.isFinite(t))return"0 B";const e=1024,n=["B","KB","MB","GB"],o=Math.min(n.length-1,Math.floor(Math.log(t)/Math.log(e)));return`${Number.parseFloat((t/e**o).toFixed(1))} ${n[o]}`}function f2(t){return t.startsWith("image/")?nI:t.startsWith("video/")?rI:t.startsWith("audio/")?eI:t.includes("pdf")?qw:t.includes("zip")||t.includes("rar")?Q8:t.includes("word")||t.includes("document")||t.includes("doc")?qw:t.includes("sheet")||t.includes("excel")||t.includes("xls")?aI:t.includes("presentation")||t.includes("powerpoint")||t.includes("ppt")?OI:bN}function DV(t){const e=ge.c(88);let n,o,s,i,l;e[0]!==t?({header:o,table:l,className:n,onPointerDown:s,...i}=t,e[0]=t,e[1]=n,e[2]=o,e[3]=s,e[4]=i,e[5]=l):(n=e[1],o=e[2],s=e[3],i=e[4],l=e[5]);const u=o.column,d=u.columnDef.meta?.label?u.columnDef.meta.label:typeof u.columnDef.header=="string"?u.columnDef.header:u.id;let f,g,m,y,v,w,C,S,N,M,E,R,D,T;if(e[6]!==n||e[7]!==u||e[8]!==s||e[9]!==l){const F=l.getState().columnSizingInfo.isResizingColumn,$=u.columnDef.meta?.cell?.variant;let I;e[24]!==$?(I=NV($),e[24]=$,e[25]=I):I=e[25],y=I,m=u.columnDef.meta?.columnType;let U;e[26]!==u?(U=u.getIsPinned(),e[26]=u,e[27]=U):U=e[27];const K=U;v=K==="left",w=K==="right";let J;e[28]!==u.id||e[29]!==l?(J=pe=>{l.setSorting(ie=>{const be=ie.findIndex(Be=>Be.id===u.id),ke={id:u.id,desc:pe==="desc"};if(be>=0){const Be=[...ie];return Be[be]=ke,Be}else return[...ie,ke]})},e[28]=u.id,e[29]=l,e[30]=J):J=e[30],M=J;let ne;e[31]!==u.id||e[32]!==l?(ne=()=>{l.setSorting(pe=>pe.filter(ie=>ie.id!==u.id))},e[31]=u.id,e[32]=l,e[33]=ne):ne=e[33],N=ne;let X;e[34]!==u?(X=()=>{u.pin("left")},e[34]=u,e[35]=X):X=e[35],C=X;let ee;e[36]!==u?(ee=()=>{u.pin("right")},e[36]=u,e[37]=ee):ee=e[37],S=ee;let se;e[38]!==u?(se=()=>{u.pin(!1)},e[38]=u,e[39]=se):se=e[39],R=se;let le;e[40]!==u.id||e[41]!==s||e[42]!==l.options.meta?(le=pe=>{s?.(pe),!pe.defaultPrevented&&pe.button===0&&l.options.meta?.onColumnClick?.(u.id)},e[40]=u.id,e[41]=s,e[42]=l.options.meta,e[43]=le):le=e[43],E=le,g=My,T=!1,f=Ry,D=Ne("flex size-full items-center justify-between gap-2 p-2 text-sm hover:bg-accent/40 data-[state=open]:bg-accent/40 [&_svg]:size-4",F&&"pointer-events-none",n),e[6]=n,e[7]=u,e[8]=s,e[9]=l,e[10]=f,e[11]=g,e[12]=m,e[13]=y,e[14]=v,e[15]=w,e[16]=C,e[17]=S,e[18]=N,e[19]=M,e[20]=E,e[21]=R,e[22]=D,e[23]=T}else f=e[10],g=e[11],m=e[12],y=e[13],v=e[14],w=e[15],C=e[16],S=e[17],N=e[18],M=e[19],E=e[20],R=e[21],D=e[22],T=e[23];let k;e[44]!==d?(k=p.jsx("span",{className:"shrink-0 whitespace-nowrap font-medium",children:d}),e[44]=d,e[45]=k):k=e[45];let O;e[46]!==m||e[47]!==y?(O=m?p.jsx("span",{className:"min-w-0 shrink truncate text-xs text-muted-foreground",children:mu(m)}):y&&p.jsxs(xy,{delayDuration:100,children:[p.jsx(by,{asChild:!0,children:p.jsx(y.icon,{className:"size-3.5 shrink-0 text-muted-foreground"})}),p.jsx(wy,{side:"top",children:p.jsx("p",{children:y.label})})]}),e[46]=m,e[47]=y,e[48]=O):O=e[48];let L;e[49]!==k||e[50]!==O?(L=p.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-1.5 overflow-hidden",children:[k,O]}),e[49]=k,e[50]=O,e[51]=L):L=e[51];let W;e[52]===Symbol.for("react.memo_cache_sentinel")?(W=p.jsx(ms,{className:"shrink-0 text-muted-foreground"}),e[52]=W):W=e[52];let B;e[53]!==f||e[54]!==E||e[55]!==i||e[56]!==D||e[57]!==L?(B=p.jsxs(f,{className:D,onPointerDown:E,...i,children:[L,W]}),e[53]=f,e[54]=E,e[55]=i,e[56]=D,e[57]=L,e[58]=B):B=e[58];let Y;e[59]!==u||e[60]!==N||e[61]!==M?(Y=u.getCanSort()&&p.jsxs(p.Fragment,{children:[p.jsxs(Jw,{className:"relative ltr:pr-8 ltr:pl-2 rtl:pr-2 rtl:pl-8 [&>span:first-child]:ltr:right-2 [&>span:first-child]:ltr:left-auto [&>span:first-child]:rtl:right-auto [&>span:first-child]:rtl:left-2 [&_svg]:text-muted-foreground",checked:u.getIsSorted()==="asc",onSelect:()=>M("asc"),children:[p.jsx(sh,{}),"Sort asc"]}),p.jsxs(Jw,{className:"relative ltr:pr-8 ltr:pl-2 rtl:pr-2 rtl:pl-8 [&>span:first-child]:ltr:right-2 [&>span:first-child]:ltr:left-auto [&>span:first-child]:rtl:right-auto [&>span:first-child]:rtl:left-2 [&_svg]:text-muted-foreground",checked:u.getIsSorted()==="desc",onSelect:()=>M("desc"),children:[p.jsx(ms,{}),"Sort desc"]}),u.getIsSorted()&&p.jsxs(Vo,{onSelect:N,children:[p.jsx(vs,{}),"Remove sort"]})]}),e[59]=u,e[60]=N,e[61]=M,e[62]=Y):Y=e[62];let q;e[63]!==u||e[64]!==v||e[65]!==w||e[66]!==C||e[67]!==S||e[68]!==R?(q=u.getCanPin()&&p.jsxs(p.Fragment,{children:[u.getCanSort()&&p.jsx(wf,{}),v?p.jsxs(Vo,{className:"[&_svg]:text-muted-foreground",onSelect:R,children:[p.jsx(Ww,{}),"Unpin from left"]}):p.jsxs(Vo,{className:"[&_svg]:text-muted-foreground",onSelect:C,children:[p.jsx(Kw,{}),"Pin to left"]}),w?p.jsxs(Vo,{className:"[&_svg]:text-muted-foreground",onSelect:R,children:[p.jsx(Ww,{}),"Unpin from right"]}):p.jsxs(Vo,{className:"[&_svg]:text-muted-foreground",onSelect:S,children:[p.jsx(Kw,{}),"Pin to right"]})]}),e[63]=u,e[64]=v,e[65]=w,e[66]=C,e[67]=S,e[68]=R,e[69]=q):q=e[69];let z;e[70]!==u?(z=u.getCanHide()&&p.jsxs(p.Fragment,{children:[p.jsx(wf,{}),p.jsxs(Vo,{className:"[&_svg]:text-muted-foreground",onSelect:()=>u.toggleVisibility(!1),children:[p.jsx(xN,{}),"Hide column"]})]}),e[70]=u,e[71]=z):z=e[71];let V;e[72]!==z||e[73]!==Y||e[74]!==q?(V=p.jsxs(Dy,{align:"start",sideOffset:0,className:"w-60",children:[Y,q,z]}),e[72]=z,e[73]=Y,e[74]=q,e[75]=V):V=e[75];let A;e[76]!==g||e[77]!==V||e[78]!==T||e[79]!==B?(A=p.jsxs(g,{modal:T,children:[B,V]}),e[76]=g,e[77]=V,e[78]=T,e[79]=B,e[80]=A):A=e[80];let H;e[81]!==o||e[82]!==d||e[83]!==l?(H=o.column.getCanResize()&&p.jsx(TV,{header:o,table:l,label:d}),e[81]=o,e[82]=d,e[83]=l,e[84]=H):H=e[84];let P;return e[85]!==A||e[86]!==H?(P=p.jsxs(p.Fragment,{children:[A,H]}),e[85]=A,e[86]=H,e[87]=P):P=e[87],P}const TV=x.memo(kV,(t,e)=>{const n=t.header.column,o=e.header.column;return!(n.getIsResizing()!==o.getIsResizing()||n.getSize()!==o.getSize()||t.label!==e.label)});function kV(t){const e=ge.c(23),{header:n,table:o,label:s}=t;let i;e[0]!==o?(i=o._getDefaultColumnDef(),e[0]=o,e[1]=i):i=e[1];const l=i;let u;e[2]!==n.column?(u=()=>{n.column.resetSize()},e[2]=n.column,e[3]=u):u=e[3];const d=u,f=`Resize ${s} column`;let g;e[4]!==n.column?(g=n.column.getSize(),e[4]=n.column,e[5]=g):g=e[5];const m=l.minSize,y=l.maxSize;let v;e[6]!==n.column?(v=n.column.getIsResizing()?"bg-primary":"opacity-0 hover:opacity-100",e[6]=n.column,e[7]=v):v=e[7];let w;e[8]!==v?(w=Ne("absolute -end-px top-0 z-50 h-full w-0.5 cursor-ew-resize touch-none select-none bg-border transition-opacity after:absolute after:inset-y-0 after:start-1/2 after:h-full after:w-[18px] after:-translate-x-1/2 after:content-[''] hover:bg-primary focus:bg-primary focus:outline-none",v),e[8]=v,e[9]=w):w=e[9];let C;e[10]!==n?(C=n.getResizeHandler(),e[10]=n,e[11]=C):C=e[11];let S;e[12]!==n?(S=n.getResizeHandler(),e[12]=n,e[13]=S):S=e[13];let N;return e[14]!==l.maxSize||e[15]!==l.minSize||e[16]!==d||e[17]!==S||e[18]!==f||e[19]!==g||e[20]!==w||e[21]!==C?(N=p.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":f,"aria-valuenow":g,"aria-valuemin":m,"aria-valuemax":y,tabIndex:0,className:w,onDoubleClick:d,onMouseDown:C,onTouchStart:S}),e[14]=l.maxSize,e[15]=l.minSize,e[16]=d,e[17]=S,e[18]=f,e[19]=g,e[20]=w,e[21]=C,e[22]=N):N=e[22],N}const bR=typeof window<"u"?x.useLayoutEffect:x.useEffect;function gu(t){const e=ge.c(2),n=x.useRef(t);let o;return e[0]!==t?(o=()=>{n.current=t},e[0]=t,e[1]=o):o=e[1],bR(o),n}function jV(t){const e=ge.c(11),{tableMeta:n,columns:o,contextMenu:s}=t,i=n?.onContextMenuOpenChange,l=n?.selectionState,u=n?.dataGridRef,d=n?.onDataUpdate,f=n?.onRowsDelete,g=n?.onCellsCopy,m=n?.onCellsCut;if(!s.open)return null;let y;return e[0]!==o||e[1]!==s||e[2]!==u||e[3]!==g||e[4]!==m||e[5]!==i||e[6]!==d||e[7]!==f||e[8]!==l||e[9]!==n?(y=p.jsx(AV,{tableMeta:n,columns:o,dataGridRef:u,contextMenu:s,onContextMenuOpenChange:i,selectionState:l,onDataUpdate:d,onRowsDelete:f,onCellsCopy:g,onCellsCut:m}),e[0]=o,e[1]=s,e[2]=u,e[3]=g,e[4]=m,e[5]=i,e[6]=d,e[7]=f,e[8]=l,e[9]=n,e[10]=y):y=e[10],y}const AV=x.memo(OV,(t,e)=>{if(t.contextMenu.open!==e.contextMenu.open)return!1;if(!e.contextMenu.open)return!0;if(t.contextMenu.x!==e.contextMenu.x||t.contextMenu.y!==e.contextMenu.y)return!1;const n=t.selectionState?.selectedCells?.size??0,o=e.selectionState?.selectedCells?.size??0;return n===o});function OV(t){const e=ge.c(48),{tableMeta:n,columns:o,dataGridRef:s,contextMenu:i,onContextMenuOpenChange:l,selectionState:u,onDataUpdate:d,onRowsDelete:f,onCellsCopy:g,onCellsCut:m}=t;let y;e[0]!==o||e[1]!==s||e[2]!==g||e[3]!==m||e[4]!==d||e[5]!==f||e[6]!==u?(y={dataGridRef:s,selectionState:u,onDataUpdate:d,onRowsDelete:f,onCellsCopy:g,onCellsCut:m,columns:o},e[0]=o,e[1]=s,e[2]=g,e[3]=m,e[4]=d,e[5]=f,e[6]=u,e[7]=y):y=e[7];const v=gu(y),w=`${i.x}px`,C=`${i.y}px`;let S;e[8]!==w||e[9]!==C?(S={position:"fixed",left:w,top:C,width:"1px",height:"1px",padding:0,margin:0,border:"none",background:"transparent",pointerEvents:"none",opacity:0},e[8]=w,e[9]=C,e[10]=S):S=e[10];const N=S;let M;e[11]!==v?(M=K=>{K.preventDefault(),v.current.dataGridRef?.current?.focus()},e[11]=v,e[12]=M):M=e[12];const E=M;let R;e[13]!==v?(R=()=>{v.current.onCellsCopy?.()},e[13]=v,e[14]=R):R=e[14];const D=R;let T;e[15]!==v?(T=()=>{v.current.onCellsCut?.()},e[15]=v,e[16]=T):T=e[16];const k=T;let O;e[17]!==v?(O=()=>{const{selectionState:K,columns:J,onDataUpdate:ne}=v.current;if(!K?.selectedCells||K.selectedCells.size===0)return;const X=[];for(const ee of K.selectedCells){const{rowIndex:se,columnId:le}=Ho(ee),ie=J.find(ke=>ke.id?ke.id===le:"accessorKey"in ke?ke.accessorKey===le:!1)?.meta?.cell?.variant;let be="";ie==="multi-select"||ie==="file"?be=[]:ie==="number"||ie==="date"?be=null:ie==="checkbox"&&(be=!1),X.push({rowIndex:se,columnId:le,value:be})}ne?.(X),Jt.success(`${X.length} cell${X.length!==1?"s":""} cleared`)},e[17]=v,e[18]=O):O=e[18];const L=O;let W;e[19]!==v?(W=async()=>{const{selectionState:K,onRowsDelete:J}=v.current;if(!K?.selectedCells||K.selectedCells.size===0)return;const ne=new Set;for(const se of K.selectedCells){const{rowIndex:le}=Ho(se);ne.add(le)}const X=Array.from(ne).sort(zV),ee=X.length;await J?.(X),Jt.success(`${ee} row${ee!==1?"s":""} deleted`)},e[19]=v,e[20]=W):W=e[20];const B=W;let Y;e[21]!==N?(Y=p.jsx(Ry,{style:N}),e[21]=N,e[22]=Y):Y=e[22];let q;e[23]===Symbol.for("react.memo_cache_sentinel")?(q=p.jsx(fy,{}),e[23]=q):q=e[23];let z;e[24]!==D?(z=p.jsxs(Vo,{onSelect:D,children:[q,"Copy"]}),e[24]=D,e[25]=z):z=e[25];const V=n?.readOnly;let A;e[26]===Symbol.for("react.memo_cache_sentinel")?(A=p.jsx($I,{}),e[26]=A):A=e[26];let H;e[27]!==k||e[28]!==V?(H=p.jsxs(Vo,{onSelect:k,disabled:V,children:[A,"Cut"]}),e[27]=k,e[28]=V,e[29]=H):H=e[29];const P=n?.readOnly;let F;e[30]===Symbol.for("react.memo_cache_sentinel")?(F=p.jsx(W8,{}),e[30]=F):F=e[30];let Q;e[31]!==L||e[32]!==P?(Q=p.jsxs(Vo,{onSelect:L,disabled:P,children:[F,"Clear"]}),e[31]=L,e[32]=P,e[33]=Q):Q=e[33];let $;e[34]!==B||e[35]!==f?($=f&&p.jsxs(p.Fragment,{children:[p.jsx(wf,{}),p.jsxs(Vo,{variant:"destructive",onSelect:B,children:[p.jsx(my,{}),"Delete rows"]})]}),e[34]=B,e[35]=f,e[36]=$):$=e[36];let I;e[37]!==E||e[38]!==z||e[39]!==H||e[40]!==Q||e[41]!==$?(I=p.jsxs(Dy,{"data-grid-popover":"",align:"start",className:"w-48",onCloseAutoFocus:E,children:[z,H,Q,$]}),e[37]=E,e[38]=z,e[39]=H,e[40]=Q,e[41]=$,e[42]=I):I=e[42];let U;return e[43]!==i.open||e[44]!==l||e[45]!==Y||e[46]!==I?(U=p.jsxs(My,{open:i.open,onOpenChange:l,children:[Y,I]}),e[43]=i.open,e[44]=l,e[45]=Y,e[46]=I,e[47]=U):U=e[47],U}function zV(t,e){return t-e}function IV(t){const e=ge.c(4),{tableMeta:n,pasteDialog:o}=t,s=n?.onPasteDialogOpenChange,i=n?.onCellsPaste;if(!o.open)return null;let l;return e[0]!==i||e[1]!==s||e[2]!==o?(l=p.jsx(PV,{pasteDialog:o,onPasteDialogOpenChange:s,onCellsPaste:i}),e[0]=i,e[1]=s,e[2]=o,e[3]=l):l=e[3],l}const PV=x.memo($V,(t,e)=>t.pasteDialog.open!==e.pasteDialog.open?!1:e.pasteDialog.open?t.pasteDialog.rowsNeeded===e.pasteDialog.rowsNeeded:!0);function $V(t){const e=ge.c(39),{pasteDialog:n,onPasteDialogOpenChange:o,onCellsPaste:s}=t;let i;e[0]!==s||e[1]!==o?(i={onPasteDialogOpenChange:o,onCellsPaste:s},e[0]=s,e[1]=o,e[2]=i):i=e[2];const l=gu(i),u=x.useRef(null);let d;e[3]!==l?(d=z=>{l.current.onPasteDialogOpenChange?.(z)},e[3]=l,e[4]=d):d=e[4];const f=d;let g;e[5]!==l?(g=()=>{l.current.onPasteDialogOpenChange?.(!1)},e[5]=l,e[6]=g):g=e[6];const m=g;let y;e[7]!==l?(y=()=>{l.current.onCellsPaste?.(u.current?.checked??!1)},e[7]=l,e[8]=y):y=e[8];const v=y;let w;e[9]===Symbol.for("react.memo_cache_sentinel")?(w=p.jsx(_y,{children:"Do you want to add more rows?"}),e[9]=w):w=e[9];let C;e[10]!==n.rowsNeeded?(C=p.jsx("strong",{children:n.rowsNeeded}),e[10]=n.rowsNeeded,e[11]=C):C=e[11];const S=n.rowsNeeded!==1?"s":"";let N;e[12]!==C||e[13]!==S?(N=p.jsxs(Ey,{children:[w,p.jsxs(Ny,{children:["We need ",C," additional row",S," to paste everything from your clipboard."]})]}),e[12]=C,e[13]=S,e[14]=N):N=e[14];let M;e[15]===Symbol.for("react.memo_cache_sentinel")?(M=p.jsx(h2,{ref:u,name:"expand-option",value:"expand",defaultChecked:!0}),e[15]=M):M=e[15];let E;e[16]===Symbol.for("react.memo_cache_sentinel")?(E=p.jsx("span",{className:"font-medium text-sm leading-none",children:"Create new rows"}),e[16]=E):E=e[16];const R=n.rowsNeeded!==1?"s":"";let D;e[17]!==n.rowsNeeded||e[18]!==R?(D=p.jsxs("label",{className:"flex cursor-pointer items-start gap-3",children:[M,p.jsxs("div",{className:"flex flex-col gap-1",children:[E,p.jsxs("span",{className:"text-muted-foreground text-sm",children:["Add ",n.rowsNeeded," new row",R," to the table and paste all data"]})]})]}),e[17]=n.rowsNeeded,e[18]=R,e[19]=D):D=e[19];let T;e[20]===Symbol.for("react.memo_cache_sentinel")?(T=p.jsx(h2,{name:"expand-option",value:"no-expand"}),e[20]=T):T=e[20];let k;e[21]===Symbol.for("react.memo_cache_sentinel")?(k=p.jsxs("label",{className:"flex cursor-pointer items-start gap-3",children:[T,p.jsxs("div",{className:"flex flex-col gap-1",children:[p.jsx("span",{className:"font-medium text-sm leading-none",children:"Keep current rows"}),p.jsx("span",{className:"text-muted-foreground text-sm",children:"Paste only what fits in the existing rows"})]})]}),e[21]=k):k=e[21];let O;e[22]!==D?(O=p.jsxs("div",{className:"flex flex-col gap-3 py-1",children:[D,k]}),e[22]=D,e[23]=O):O=e[23];let L;e[24]!==m?(L=p.jsx(St,{variant:"outline",onClick:m,children:"Cancel"}),e[24]=m,e[25]=L):L=e[25];let W;e[26]!==v?(W=p.jsx(St,{onClick:v,children:"Continue"}),e[26]=v,e[27]=W):W=e[27];let B;e[28]!==L||e[29]!==W?(B=p.jsxs(_N,{children:[L,W]}),e[28]=L,e[29]=W,e[30]=B):B=e[30];let Y;e[31]!==O||e[32]!==B||e[33]!==N?(Y=p.jsxs(Cy,{"data-grid-popover":"",children:[N,O,B]}),e[31]=O,e[32]=B,e[33]=N,e[34]=Y):Y=e[34];let q;return e[35]!==f||e[36]!==n.open||e[37]!==Y?(q=p.jsx(Sy,{open:n.open,onOpenChange:f,children:Y}),e[35]=f,e[36]=n.open,e[37]=Y,e[38]=q):q=e[38],q}function h2(t){const e=ge.c(8);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let s;e[3]!==n?(s=Ne("relative size-4 shrink-0 appearance-none rounded-full border border-input bg-background shadow-xs outline-none transition-[color,box-shadow]","text-primary focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50","disabled:cursor-not-allowed disabled:opacity-50","checked:before:absolute checked:before:start-1/2 checked:before:top-1/2 checked:before:size-2 checked:before:-translate-x-1/2 checked:before:-translate-y-1/2 checked:before:rounded-full checked:before:bg-primary checked:before:content-['']","dark:bg-input/30",n),e[3]=n,e[4]=s):s=e[4];let i;return e[5]!==o||e[6]!==s?(i=p.jsx("input",{type:"radio",className:s,...o}),e[5]=o,e[6]=s,e[7]=i):i=e[7],i}function m2(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function LV(...t){return e=>{let n=!1;const o=t.map(s=>{const i=m2(s,e);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let s=0;s<o.length;s++){const i=o[s];typeof i=="function"?i():m2(t[s],null)}}}}function wR(...t){return x.useCallback(LV(...t),t)}function bs(t){const e=ge.c(85);let n,o,s,i,l,u,d,f,g,m,y,v,w,C,S;e[0]!==t?({tableMeta:S,rowIndex:C,columnId:o,isEditing:i,isFocused:l,isSelected:d,isSearchMatch:u,isActiveSearchMatch:s,readOnly:y,rowHeight:w,className:n,onClick:f,onKeyDown:g,ref:v,...m}=t,e[0]=t,e[1]=n,e[2]=o,e[3]=s,e[4]=i,e[5]=l,e[6]=u,e[7]=d,e[8]=f,e[9]=g,e[10]=m,e[11]=y,e[12]=v,e[13]=w,e[14]=C,e[15]=S):(n=e[1],o=e[2],s=e[3],i=e[4],l=e[5],u=e[6],d=e[7],f=e[8],g=e[9],m=e[10],y=e[11],v=e[12],w=e[13],C=e[14],S=e[15]);const N=S?.cellMapRef;let M;e[16]!==N||e[17]!==o||e[18]!==C?(M=ie=>{if(!N)return;const be=on(C,o);ie?N.current.set(be,ie):N.current.delete(be)},e[16]=N,e[17]=o,e[18]=C,e[19]=M):M=e[19];const R=wR(v,M);let D;e[20]!==o||e[21]!==i||e[22]!==l||e[23]!==f||e[24]!==y||e[25]!==C||e[26]!==S?(D=ie=>{i||(ie.preventDefault(),f?.(ie),l&&!y?S?.onCellEditingStart?.(C,o):S?.onCellClick?.(C,o,ie))},e[20]=o,e[21]=i,e[22]=l,e[23]=f,e[24]=y,e[25]=C,e[26]=S,e[27]=D):D=e[27];const T=D;let k;e[28]!==o||e[29]!==i||e[30]!==C||e[31]!==S?(k=ie=>{i||S?.onCellContextMenu?.(C,o,ie)},e[28]=o,e[29]=i,e[30]=C,e[31]=S,e[32]=k):k=e[32];const O=k;let L;e[33]!==o||e[34]!==i||e[35]!==C||e[36]!==S?(L=ie=>{i||(ie.preventDefault(),S?.onCellDoubleClick?.(C,o))},e[33]=o,e[34]=i,e[35]=C,e[36]=S,e[37]=L):L=e[37];const W=L;let B;e[38]!==o||e[39]!==i||e[40]!==l||e[41]!==g||e[42]!==y||e[43]!==C||e[44]!==S?(B=ie=>{if(g?.(ie),!ie.defaultPrevented&&!(ie.key==="ArrowUp"||ie.key==="ArrowDown"||ie.key==="ArrowLeft"||ie.key==="ArrowRight"||ie.key==="Home"||ie.key==="End"||ie.key==="PageUp"||ie.key==="PageDown"||ie.key==="Tab")&&l&&!i&&!y){if(ie.key==="F2"||ie.key==="Enter"){ie.preventDefault(),ie.stopPropagation(),S?.onCellEditingStart?.(C,o);return}if(ie.key===" "){ie.preventDefault(),ie.stopPropagation(),S?.onCellEditingStart?.(C,o);return}ie.key.length===1&&!ie.ctrlKey&&!ie.metaKey&&(ie.preventDefault(),ie.stopPropagation(),S?.onCellEditingStart?.(C,o))}},e[38]=o,e[39]=i,e[40]=l,e[41]=g,e[42]=y,e[43]=C,e[44]=S,e[45]=B):B=e[45];const Y=B;let q;e[46]!==o||e[47]!==i||e[48]!==C||e[49]!==S?(q=ie=>{i||S?.onCellMouseDown?.(C,o,ie)},e[46]=o,e[47]=i,e[48]=C,e[49]=S,e[50]=q):q=e[50];const z=q;let V;e[51]!==o||e[52]!==i||e[53]!==C||e[54]!==S?(V=()=>{i||S?.onCellMouseEnter?.(C,o)},e[51]=o,e[52]=i,e[53]=C,e[54]=S,e[55]=V):V=e[55];const A=V;let H;e[56]!==i||e[57]!==S?(H=()=>{i||S?.onCellMouseUp?.()},e[56]=i,e[57]=S,e[58]=H):H=e[58];const P=H,F=i?"":void 0,Q=l?"":void 0,$=d?"":void 0,I=l&&!i?0:-1,U=u&&!s,K=d&&!i,J=!i,ne=!i&&w==="short",X=!i&&w==="medium",ee=!i&&w==="tall",se=!i&&w==="extra-tall";let le;e[59]!==n||e[60]!==s||e[61]!==l||e[62]!==U||e[63]!==K||e[64]!==J||e[65]!==ne||e[66]!==X||e[67]!==ee||e[68]!==se?(le=Ne("size-full px-2 py-1.5 text-start text-sm outline-none has-data-[slot=checkbox]:pt-2.5",{"ring-1 ring-ring ring-inset":l,"bg-yellow-100 dark:bg-yellow-900/30":U,"bg-orange-200 dark:bg-orange-900/50":s,"bg-primary/10":K,"cursor-default":J,"**:data-[slot=grid-cell-content]:line-clamp-1":ne,"**:data-[slot=grid-cell-content]:line-clamp-2":X,"**:data-[slot=grid-cell-content]:line-clamp-3":ee,"**:data-[slot=grid-cell-content]:line-clamp-4":se},n),e[59]=n,e[60]=s,e[61]=l,e[62]=U,e[63]=K,e[64]=J,e[65]=ne,e[66]=X,e[67]=ee,e[68]=se,e[69]=le):le=e[69];let pe;return e[70]!==R||e[71]!==T||e[72]!==O||e[73]!==W||e[74]!==Y||e[75]!==z||e[76]!==A||e[77]!==P||e[78]!==m||e[79]!==Q||e[80]!==$||e[81]!==I||e[82]!==le||e[83]!==F?(pe=p.jsx("div",{role:"button","data-slot":"grid-cell-wrapper","data-editing":F,"data-focused":Q,"data-selected":$,tabIndex:I,...m,ref:R,className:le,onClick:T,onContextMenu:O,onDoubleClick:W,onMouseDown:z,onMouseEnter:A,onMouseUp:P,onKeyDown:Y}),e[70]=R,e[71]=T,e[72]=O,e[73]=W,e[74]=Y,e[75]=z,e[76]=A,e[77]=P,e[78]=m,e[79]=Q,e[80]=$,e[81]=I,e[82]=le,e[83]=F,e[84]=pe):pe=e[84],pe}function HV(t,e,n="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:t,timeZoneName:n}).format(e).split(/\s/g).slice(2).join(" ")}const BV={},_c={};function za(t,e){try{const o=(BV[t]||=new Intl.DateTimeFormat("en-US",{timeZone:t,timeZoneName:"longOffset"}).format)(e).split("GMT")[1];return o in _c?_c[o]:g2(o,o.split(":"))}catch{if(t in _c)return _c[t];const n=t?.match(FV);return n?g2(t,n.slice(1)):NaN}}const FV=/([+-]\d\d):?(\d\d)?/;function g2(t,e){const n=+(e[0]||0),o=+(e[1]||0),s=+(e[2]||0)/60;return _c[t]=n*60+o>0?n*60+o+s:n*60-o-s}class Sr extends Date{constructor(...e){super(),e.length>1&&typeof e[e.length-1]=="string"&&(this.timeZone=e.pop()),this.internal=new Date,isNaN(za(this.timeZone,this))?this.setTime(NaN):e.length?typeof e[0]=="number"&&(e.length===1||e.length===2&&typeof e[1]!="number")?this.setTime(e[0]):typeof e[0]=="string"?this.setTime(+new Date(e[0])):e[0]instanceof Date?this.setTime(+e[0]):(this.setTime(+new Date(...e)),SR(this),v0(this)):this.setTime(Date.now())}static tz(e,...n){return n.length?new Sr(...n,e):new Sr(Date.now(),e)}withTimeZone(e){return new Sr(+this,e)}getTimezoneOffset(){const e=-za(this.timeZone,this);return e>0?Math.floor(e):Math.ceil(e)}setTime(e){return Date.prototype.setTime.apply(this,arguments),v0(this),+this}[Symbol.for("constructDateFrom")](e){return new Sr(+new Date(e),this.timeZone)}}const p2=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(t=>{if(!p2.test(t))return;const e=t.replace(p2,"$1UTC");Sr.prototype[e]&&(t.startsWith("get")?Sr.prototype[t]=function(){return this.internal[e]()}:(Sr.prototype[t]=function(){return Date.prototype[e].apply(this.internal,arguments),VV(this),+this},Sr.prototype[e]=function(){return Date.prototype[e].apply(this,arguments),v0(this),+this}))});function v0(t){t.internal.setTime(+t),t.internal.setUTCSeconds(t.internal.getUTCSeconds()-Math.round(-za(t.timeZone,t)*60))}function VV(t){Date.prototype.setFullYear.call(t,t.internal.getUTCFullYear(),t.internal.getUTCMonth(),t.internal.getUTCDate()),Date.prototype.setHours.call(t,t.internal.getUTCHours(),t.internal.getUTCMinutes(),t.internal.getUTCSeconds(),t.internal.getUTCMilliseconds()),SR(t)}function SR(t){const e=za(t.timeZone,t),n=e>0?Math.floor(e):Math.ceil(e),o=new Date(+t);o.setUTCHours(o.getUTCHours()-1);const s=-new Date(+t).getTimezoneOffset(),i=-new Date(+o).getTimezoneOffset(),l=s-i,u=Date.prototype.getHours.apply(t)!==t.internal.getUTCHours();l&&u&&t.internal.setUTCMinutes(t.internal.getUTCMinutes()+l);const d=s-n;d&&Date.prototype.setUTCMinutes.call(t,Date.prototype.getUTCMinutes.call(t)+d);const f=new Date(+t);f.setUTCSeconds(0);const g=s>0?f.getSeconds():(f.getSeconds()-60)%60,m=Math.round(-(za(t.timeZone,t)*60))%60;(m||g)&&(t.internal.setUTCSeconds(t.internal.getUTCSeconds()+m),Date.prototype.setUTCSeconds.call(t,Date.prototype.getUTCSeconds.call(t)+m+g));const y=za(t.timeZone,t),v=y>0?Math.floor(y):Math.ceil(y),C=-new Date(+t).getTimezoneOffset()-v,S=v!==n,N=C-d;if(S&&N){Date.prototype.setUTCMinutes.call(t,Date.prototype.getUTCMinutes.call(t)+N);const M=za(t.timeZone,t),E=M>0?Math.floor(M):Math.ceil(M),R=v-E;R&&(t.internal.setUTCMinutes(t.internal.getUTCMinutes()+R),Date.prototype.setUTCMinutes.call(t,Date.prototype.getUTCMinutes.call(t)+R))}}class Wn extends Sr{static tz(e,...n){return n.length?new Wn(...n,e):new Wn(Date.now(),e)}toISOString(){const[e,n,o]=this.tzComponents(),s=`${e}${n}:${o}`;return this.internal.toISOString().slice(0,-1)+s}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[e,n,o,s]=this.internal.toUTCString().split(" ");return`${e?.slice(0,-1)} ${o} ${n} ${s}`}toTimeString(){const e=this.internal.toUTCString().split(" ")[4],[n,o,s]=this.tzComponents();return`${e} GMT${n}${o}${s} (${HV(this.timeZone,this)})`}toLocaleString(e,n){return Date.prototype.toLocaleString.call(this,e,{...n,timeZone:n?.timeZone||this.timeZone})}toLocaleDateString(e,n){return Date.prototype.toLocaleDateString.call(this,e,{...n,timeZone:n?.timeZone||this.timeZone})}toLocaleTimeString(e,n){return Date.prototype.toLocaleTimeString.call(this,e,{...n,timeZone:n?.timeZone||this.timeZone})}tzComponents(){const e=this.getTimezoneOffset(),n=e>0?"-":"+",o=String(Math.floor(Math.abs(e)/60)).padStart(2,"0"),s=String(Math.abs(e)%60).padStart(2,"0");return[n,o,s]}withTimeZone(e){return new Wn(+this,e)}[Symbol.for("constructDateFrom")](e){return new Wn(+new Date(e),this.timeZone)}}const CR=6048e5,UV=864e5,y2=Symbol.for("constructDateFrom");function _n(t,e){return typeof t=="function"?t(e):t&&typeof t=="object"&&y2 in t?t[y2](e):t instanceof Date?new t.constructor(e):new Date(e)}function qt(t,e){return _n(e||t,t)}function ER(t,e,n){const o=qt(t,n?.in);return isNaN(e)?_n(t,NaN):(e&&o.setDate(o.getDate()+e),o)}function _R(t,e,n){const o=qt(t,n?.in);if(isNaN(e))return _n(t,NaN);if(!e)return o;const s=o.getDate(),i=_n(t,o.getTime());i.setMonth(o.getMonth()+e+1,0);const l=i.getDate();return s>=l?i:(o.setFullYear(i.getFullYear(),i.getMonth(),s),o)}let YV={};function pu(){return YV}function il(t,e){const n=pu(),o=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,s=qt(t,e?.in),i=s.getDay(),l=(i<o?7:0)+i-o;return s.setDate(s.getDate()-l),s.setHours(0,0,0,0),s}function Wc(t,e){return il(t,{...e,weekStartsOn:1})}function NR(t,e){const n=qt(t,e?.in),o=n.getFullYear(),s=_n(n,0);s.setFullYear(o+1,0,4),s.setHours(0,0,0,0);const i=Wc(s),l=_n(n,0);l.setFullYear(o,0,4),l.setHours(0,0,0,0);const u=Wc(l);return n.getTime()>=i.getTime()?o+1:n.getTime()>=u.getTime()?o:o-1}function v2(t){const e=qt(t),n=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return n.setUTCFullYear(e.getFullYear()),+t-+n}function Sl(t,...e){const n=_n.bind(null,e.find(o=>typeof o=="object"));return e.map(n)}function Kc(t,e){const n=qt(t,e?.in);return n.setHours(0,0,0,0),n}function Ky(t,e,n){const[o,s]=Sl(n?.in,t,e),i=Kc(o),l=Kc(s),u=+i-v2(i),d=+l-v2(l);return Math.round((u-d)/UV)}function GV(t,e){const n=NR(t,e),o=_n(t,0);return o.setFullYear(n,0,4),o.setHours(0,0,0,0),Wc(o)}function qV(t,e,n){return ER(t,e*7,n)}function WV(t,e,n){return _R(t,e*12,n)}function KV(t,e){let n,o=e?.in;return t.forEach(s=>{!o&&typeof s=="object"&&(o=_n.bind(null,s));const i=qt(s,o);(!n||n<i||isNaN(+i))&&(n=i)}),_n(o,n||NaN)}function XV(t,e){let n,o=e?.in;return t.forEach(s=>{!o&&typeof s=="object"&&(o=_n.bind(null,s));const i=qt(s,o);(!n||n>i||isNaN(+i))&&(n=i)}),_n(o,n||NaN)}function QV(t,e,n){const[o,s]=Sl(n?.in,t,e);return+Kc(o)==+Kc(s)}function MR(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function ZV(t){return!(!MR(t)&&typeof t!="number"||isNaN(+qt(t)))}function RR(t,e,n){const[o,s]=Sl(n?.in,t,e),i=o.getFullYear()-s.getFullYear(),l=o.getMonth()-s.getMonth();return i*12+l}function JV(t,e){const n=qt(t,e?.in),o=n.getMonth();return n.setFullYear(n.getFullYear(),o+1,0),n.setHours(23,59,59,999),n}function DR(t,e){const[n,o]=Sl(t,e.start,e.end);return{start:n,end:o}}function eU(t,e){const{start:n,end:o}=DR(e?.in,t);let s=+n>+o;const i=s?+n:+o,l=s?o:n;l.setHours(0,0,0,0),l.setDate(1);let u=1;const d=[];for(;+l<=i;)d.push(_n(n,l)),l.setMonth(l.getMonth()+u);return s?d.reverse():d}function tU(t,e){const n=qt(t,e?.in);return n.setDate(1),n.setHours(0,0,0,0),n}function nU(t,e){const n=qt(t,e?.in),o=n.getFullYear();return n.setFullYear(o+1,0,0),n.setHours(23,59,59,999),n}function TR(t,e){const n=qt(t,e?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function oU(t,e){const{start:n,end:o}=DR(e?.in,t);let s=+n>+o;const i=s?+n:+o,l=s?o:n;l.setHours(0,0,0,0),l.setMonth(0,1);let u=1;const d=[];for(;+l<=i;)d.push(_n(n,l)),l.setFullYear(l.getFullYear()+u);return s?d.reverse():d}function kR(t,e){const n=pu(),o=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,s=qt(t,e?.in),i=s.getDay(),l=(i<o?-7:0)+6-(i-o);return s.setDate(s.getDate()+l),s.setHours(23,59,59,999),s}function rU(t,e){return kR(t,{...e,weekStartsOn:1})}const sU={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},aU=(t,e,n)=>{let o;const s=sU[t];return typeof s=="string"?o=s:e===1?o=s.one:o=s.other.replace("{{count}}",e.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+o:o+" ago":o};function vp(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}const iU={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},lU={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},cU={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},uU={date:vp({formats:iU,defaultWidth:"full"}),time:vp({formats:lU,defaultWidth:"full"}),dateTime:vp({formats:cU,defaultWidth:"full"})},dU={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},fU=(t,e,n,o)=>dU[t];function yc(t){return(e,n)=>{const o=n?.context?String(n.context):"standalone";let s;if(o==="formatting"&&t.formattingValues){const l=t.defaultFormattingWidth||t.defaultWidth,u=n?.width?String(n.width):l;s=t.formattingValues[u]||t.formattingValues[l]}else{const l=t.defaultWidth,u=n?.width?String(n.width):t.defaultWidth;s=t.values[u]||t.values[l]}const i=t.argumentCallback?t.argumentCallback(e):e;return s[i]}}const hU={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},mU={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},gU={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},pU={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},yU={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},vU={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},xU=(t,e)=>{const n=Number(t),o=n%100;if(o>20||o<10)switch(o%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},bU={ordinalNumber:xU,era:yc({values:hU,defaultWidth:"wide"}),quarter:yc({values:mU,defaultWidth:"wide",argumentCallback:t=>t-1}),month:yc({values:gU,defaultWidth:"wide"}),day:yc({values:pU,defaultWidth:"wide"}),dayPeriod:yc({values:yU,defaultWidth:"wide",formattingValues:vU,defaultFormattingWidth:"wide"})};function vc(t){return(e,n={})=>{const o=n.width,s=o&&t.matchPatterns[o]||t.matchPatterns[t.defaultMatchWidth],i=e.match(s);if(!i)return null;const l=i[0],u=o&&t.parsePatterns[o]||t.parsePatterns[t.defaultParseWidth],d=Array.isArray(u)?SU(u,m=>m.test(l)):wU(u,m=>m.test(l));let f;f=t.valueCallback?t.valueCallback(d):d,f=n.valueCallback?n.valueCallback(f):f;const g=e.slice(l.length);return{value:f,rest:g}}}function wU(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function SU(t,e){for(let n=0;n<t.length;n++)if(e(t[n]))return n}function CU(t){return(e,n={})=>{const o=e.match(t.matchPattern);if(!o)return null;const s=o[0],i=e.match(t.parsePattern);if(!i)return null;let l=t.valueCallback?t.valueCallback(i[0]):i[0];l=n.valueCallback?n.valueCallback(l):l;const u=e.slice(s.length);return{value:l,rest:u}}}const EU=/^(\d+)(th|st|nd|rd)?/i,_U=/\d+/i,NU={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},MU={any:[/^b/i,/^(a|c)/i]},RU={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},DU={any:[/1/i,/2/i,/3/i,/4/i]},TU={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},kU={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},jU={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},AU={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},OU={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},zU={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},IU={ordinalNumber:CU({matchPattern:EU,parsePattern:_U,valueCallback:t=>parseInt(t,10)}),era:vc({matchPatterns:NU,defaultMatchWidth:"wide",parsePatterns:MU,defaultParseWidth:"any"}),quarter:vc({matchPatterns:RU,defaultMatchWidth:"wide",parsePatterns:DU,defaultParseWidth:"any",valueCallback:t=>t+1}),month:vc({matchPatterns:TU,defaultMatchWidth:"wide",parsePatterns:kU,defaultParseWidth:"any"}),day:vc({matchPatterns:jU,defaultMatchWidth:"wide",parsePatterns:AU,defaultParseWidth:"any"}),dayPeriod:vc({matchPatterns:OU,defaultMatchWidth:"any",parsePatterns:zU,defaultParseWidth:"any"})},Li={code:"en-US",formatDistance:aU,formatLong:uU,formatRelative:fU,localize:bU,match:IU,options:{weekStartsOn:0,firstWeekContainsDate:1}};function PU(t,e){const n=qt(t,e?.in);return Ky(n,TR(n))+1}function Xy(t,e){const n=qt(t,e?.in),o=+Wc(n)-+GV(n);return Math.round(o/CR)+1}function jR(t,e){const n=qt(t,e?.in),o=n.getFullYear(),s=pu(),i=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??s.firstWeekContainsDate??s.locale?.options?.firstWeekContainsDate??1,l=_n(e?.in||t,0);l.setFullYear(o+1,0,i),l.setHours(0,0,0,0);const u=il(l,e),d=_n(e?.in||t,0);d.setFullYear(o,0,i),d.setHours(0,0,0,0);const f=il(d,e);return+n>=+u?o+1:+n>=+f?o:o-1}function $U(t,e){const n=pu(),o=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,s=jR(t,e),i=_n(e?.in||t,0);return i.setFullYear(s,0,o),i.setHours(0,0,0,0),il(i,e)}function Qy(t,e){const n=qt(t,e?.in),o=+il(n,e)-+$U(n,e);return Math.round(o/CR)+1}function Ft(t,e){const n=t<0?"-":"",o=Math.abs(t).toString().padStart(e,"0");return n+o}const Ws={y(t,e){const n=t.getFullYear(),o=n>0?n:1-n;return Ft(e==="yy"?o%100:o,e.length)},M(t,e){const n=t.getMonth();return e==="M"?String(n+1):Ft(n+1,2)},d(t,e){return Ft(t.getDate(),e.length)},a(t,e){const n=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return n==="am"?"a.m.":"p.m."}},h(t,e){return Ft(t.getHours()%12||12,e.length)},H(t,e){return Ft(t.getHours(),e.length)},m(t,e){return Ft(t.getMinutes(),e.length)},s(t,e){return Ft(t.getSeconds(),e.length)},S(t,e){const n=e.length,o=t.getMilliseconds(),s=Math.trunc(o*Math.pow(10,n-3));return Ft(s,e.length)}},zi={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},x2={G:function(t,e,n){const o=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(o,{width:"abbreviated"});case"GGGGG":return n.era(o,{width:"narrow"});default:return n.era(o,{width:"wide"})}},y:function(t,e,n){if(e==="yo"){const o=t.getFullYear(),s=o>0?o:1-o;return n.ordinalNumber(s,{unit:"year"})}return Ws.y(t,e)},Y:function(t,e,n,o){const s=jR(t,o),i=s>0?s:1-s;if(e==="YY"){const l=i%100;return Ft(l,2)}return e==="Yo"?n.ordinalNumber(i,{unit:"year"}):Ft(i,e.length)},R:function(t,e){const n=NR(t);return Ft(n,e.length)},u:function(t,e){const n=t.getFullYear();return Ft(n,e.length)},Q:function(t,e,n){const o=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(o);case"QQ":return Ft(o,2);case"Qo":return n.ordinalNumber(o,{unit:"quarter"});case"QQQ":return n.quarter(o,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(o,{width:"narrow",context:"formatting"});default:return n.quarter(o,{width:"wide",context:"formatting"})}},q:function(t,e,n){const o=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(o);case"qq":return Ft(o,2);case"qo":return n.ordinalNumber(o,{unit:"quarter"});case"qqq":return n.quarter(o,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(o,{width:"narrow",context:"standalone"});default:return n.quarter(o,{width:"wide",context:"standalone"})}},M:function(t,e,n){const o=t.getMonth();switch(e){case"M":case"MM":return Ws.M(t,e);case"Mo":return n.ordinalNumber(o+1,{unit:"month"});case"MMM":return n.month(o,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(o,{width:"narrow",context:"formatting"});default:return n.month(o,{width:"wide",context:"formatting"})}},L:function(t,e,n){const o=t.getMonth();switch(e){case"L":return String(o+1);case"LL":return Ft(o+1,2);case"Lo":return n.ordinalNumber(o+1,{unit:"month"});case"LLL":return n.month(o,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(o,{width:"narrow",context:"standalone"});default:return n.month(o,{width:"wide",context:"standalone"})}},w:function(t,e,n,o){const s=Qy(t,o);return e==="wo"?n.ordinalNumber(s,{unit:"week"}):Ft(s,e.length)},I:function(t,e,n){const o=Xy(t);return e==="Io"?n.ordinalNumber(o,{unit:"week"}):Ft(o,e.length)},d:function(t,e,n){return e==="do"?n.ordinalNumber(t.getDate(),{unit:"date"}):Ws.d(t,e)},D:function(t,e,n){const o=PU(t);return e==="Do"?n.ordinalNumber(o,{unit:"dayOfYear"}):Ft(o,e.length)},E:function(t,e,n){const o=t.getDay();switch(e){case"E":case"EE":case"EEE":return n.day(o,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(o,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(o,{width:"short",context:"formatting"});default:return n.day(o,{width:"wide",context:"formatting"})}},e:function(t,e,n,o){const s=t.getDay(),i=(s-o.weekStartsOn+8)%7||7;switch(e){case"e":return String(i);case"ee":return Ft(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(s,{width:"short",context:"formatting"});default:return n.day(s,{width:"wide",context:"formatting"})}},c:function(t,e,n,o){const s=t.getDay(),i=(s-o.weekStartsOn+8)%7||7;switch(e){case"c":return String(i);case"cc":return Ft(i,e.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(s,{width:"narrow",context:"standalone"});case"cccccc":return n.day(s,{width:"short",context:"standalone"});default:return n.day(s,{width:"wide",context:"standalone"})}},i:function(t,e,n){const o=t.getDay(),s=o===0?7:o;switch(e){case"i":return String(s);case"ii":return Ft(s,e.length);case"io":return n.ordinalNumber(s,{unit:"day"});case"iii":return n.day(o,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(o,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(o,{width:"short",context:"formatting"});default:return n.day(o,{width:"wide",context:"formatting"})}},a:function(t,e,n){const s=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(s,{width:"narrow",context:"formatting"});default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},b:function(t,e,n){const o=t.getHours();let s;switch(o===12?s=zi.noon:o===0?s=zi.midnight:s=o/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(s,{width:"narrow",context:"formatting"});default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(t,e,n){const o=t.getHours();let s;switch(o>=17?s=zi.evening:o>=12?s=zi.afternoon:o>=4?s=zi.morning:s=zi.night,e){case"B":case"BB":case"BBB":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(s,{width:"narrow",context:"formatting"});default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(t,e,n){if(e==="ho"){let o=t.getHours()%12;return o===0&&(o=12),n.ordinalNumber(o,{unit:"hour"})}return Ws.h(t,e)},H:function(t,e,n){return e==="Ho"?n.ordinalNumber(t.getHours(),{unit:"hour"}):Ws.H(t,e)},K:function(t,e,n){const o=t.getHours()%12;return e==="Ko"?n.ordinalNumber(o,{unit:"hour"}):Ft(o,e.length)},k:function(t,e,n){let o=t.getHours();return o===0&&(o=24),e==="ko"?n.ordinalNumber(o,{unit:"hour"}):Ft(o,e.length)},m:function(t,e,n){return e==="mo"?n.ordinalNumber(t.getMinutes(),{unit:"minute"}):Ws.m(t,e)},s:function(t,e,n){return e==="so"?n.ordinalNumber(t.getSeconds(),{unit:"second"}):Ws.s(t,e)},S:function(t,e){return Ws.S(t,e)},X:function(t,e,n){const o=t.getTimezoneOffset();if(o===0)return"Z";switch(e){case"X":return w2(o);case"XXXX":case"XX":return Aa(o);default:return Aa(o,":")}},x:function(t,e,n){const o=t.getTimezoneOffset();switch(e){case"x":return w2(o);case"xxxx":case"xx":return Aa(o);default:return Aa(o,":")}},O:function(t,e,n){const o=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+b2(o,":");default:return"GMT"+Aa(o,":")}},z:function(t,e,n){const o=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+b2(o,":");default:return"GMT"+Aa(o,":")}},t:function(t,e,n){const o=Math.trunc(+t/1e3);return Ft(o,e.length)},T:function(t,e,n){return Ft(+t,e.length)}};function b2(t,e=""){const n=t>0?"-":"+",o=Math.abs(t),s=Math.trunc(o/60),i=o%60;return i===0?n+String(s):n+String(s)+e+Ft(i,2)}function w2(t,e){return t%60===0?(t>0?"-":"+")+Ft(Math.abs(t)/60,2):Aa(t,e)}function Aa(t,e=""){const n=t>0?"-":"+",o=Math.abs(t),s=Ft(Math.trunc(o/60),2),i=Ft(o%60,2);return n+s+e+i}const S2=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});default:return e.date({width:"full"})}},AR=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});default:return e.time({width:"full"})}},LU=(t,e)=>{const n=t.match(/(P+)(p+)?/)||[],o=n[1],s=n[2];if(!s)return S2(t,e);let i;switch(o){case"P":i=e.dateTime({width:"short"});break;case"PP":i=e.dateTime({width:"medium"});break;case"PPP":i=e.dateTime({width:"long"});break;default:i=e.dateTime({width:"full"});break}return i.replace("{{date}}",S2(o,e)).replace("{{time}}",AR(s,e))},HU={p:AR,P:LU},BU=/^D+$/,FU=/^Y+$/,VU=["D","DD","YY","YYYY"];function UU(t){return BU.test(t)}function YU(t){return FU.test(t)}function GU(t,e,n){const o=qU(t,e,n);if(console.warn(o),VU.includes(t))throw new RangeError(o)}function qU(t,e,n){const o=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${o} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const WU=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,KU=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,XU=/^'([^]*?)'?$/,QU=/''/g,ZU=/[a-zA-Z]/;function Nc(t,e,n){const o=pu(),s=n?.locale??o.locale??Li,i=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,l=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??o.weekStartsOn??o.locale?.options?.weekStartsOn??0,u=qt(t,n?.in);if(!ZV(u))throw new RangeError("Invalid time value");let d=e.match(KU).map(g=>{const m=g[0];if(m==="p"||m==="P"){const y=HU[m];return y(g,s.formatLong)}return g}).join("").match(WU).map(g=>{if(g==="''")return{isToken:!1,value:"'"};const m=g[0];if(m==="'")return{isToken:!1,value:JU(g)};if(x2[m])return{isToken:!0,value:g};if(m.match(ZU))throw new RangeError("Format string contains an unescaped latin alphabet character `"+m+"`");return{isToken:!1,value:g}});s.localize.preprocessor&&(d=s.localize.preprocessor(u,d));const f={firstWeekContainsDate:i,weekStartsOn:l,locale:s};return d.map(g=>{if(!g.isToken)return g.value;const m=g.value;(!n?.useAdditionalWeekYearTokens&&YU(m)||!n?.useAdditionalDayOfYearTokens&&UU(m))&&GU(m,e,String(t));const y=x2[m[0]];return y(u,m,s.localize,f)}).join("")}function JU(t){const e=t.match(XU);return e?e[1].replace(QU,"'"):t}function eY(t,e){const n=qt(t,e?.in),o=n.getFullYear(),s=n.getMonth(),i=_n(n,0);return i.setFullYear(o,s+1,0),i.setHours(0,0,0,0),i.getDate()}function tY(t,e){return qt(t,e?.in).getMonth()}function nY(t,e){return qt(t,e?.in).getFullYear()}function oY(t,e){return+qt(t)>+qt(e)}function rY(t,e){return+qt(t)<+qt(e)}function sY(t,e,n){const[o,s]=Sl(n?.in,t,e);return o.getFullYear()===s.getFullYear()&&o.getMonth()===s.getMonth()}function aY(t,e,n){const[o,s]=Sl(n?.in,t,e);return o.getFullYear()===s.getFullYear()}function iY(t,e,n){const o=qt(t,n?.in),s=o.getFullYear(),i=o.getDate(),l=_n(t,0);l.setFullYear(s,e,15),l.setHours(0,0,0,0);const u=eY(l);return o.setMonth(e,Math.min(i,u)),o}function lY(t,e,n){const o=qt(t,n?.in);return isNaN(+o)?_n(t,NaN):(o.setFullYear(e),o)}const C2=5,cY=4;function uY(t,e){const n=e.startOfMonth(t),o=n.getDay()>0?n.getDay():7,s=e.addDays(t,-o+1),i=e.addDays(s,C2*7-1);return e.getMonth(t)===e.getMonth(i)?C2:cY}function OR(t,e){const n=e.startOfMonth(t),o=n.getDay();return o===1?n:o===0?e.addDays(n,-6):e.addDays(n,-1*(o-1))}function dY(t,e){const n=OR(t,e),o=uY(t,e);return e.addDays(n,o*7-1)}const zR={...Li,labels:{labelDayButton:(t,e,n,o)=>{let s;o&&typeof o.format=="function"?s=o.format.bind(o):s=(l,u)=>Nc(l,u,{locale:Li,...n});let i=s(t,"PPPP");return e.today&&(i=`Today, ${i}`),e.selected&&(i=`${i}, selected`),i},labelMonthDropdown:"Choose the Month",labelNext:"Go to the Next Month",labelPrevious:"Go to the Previous Month",labelWeekNumber:t=>`Week ${t}`,labelYearDropdown:"Choose the Year",labelGrid:(t,e,n)=>{let o;return n&&typeof n.format=="function"?o=n.format.bind(n):o=(s,i)=>Nc(s,i,{locale:Li,...e}),o(t,"LLLL yyyy")},labelGridcell:(t,e,n,o)=>{let s;o&&typeof o.format=="function"?s=o.format.bind(o):s=(l,u)=>Nc(l,u,{locale:Li,...n});let i=s(t,"PPPP");return e?.today&&(i=`Today, ${i}`),i},labelNav:"Navigation bar",labelWeekNumberHeader:"Week Number",labelWeekday:(t,e,n)=>{let o;return n&&typeof n.format=="function"?o=n.format.bind(n):o=(s,i)=>Nc(s,i,{locale:Li,...e}),o(t,"cccc")}}};class _o{constructor(e,n){this.Date=Date,this.today=()=>this.overrides?.today?this.overrides.today():this.options.timeZone?Wn.tz(this.options.timeZone):new this.Date,this.newDate=(o,s,i)=>this.overrides?.newDate?this.overrides.newDate(o,s,i):this.options.timeZone?new Wn(o,s,i,this.options.timeZone):new Date(o,s,i),this.addDays=(o,s)=>this.overrides?.addDays?this.overrides.addDays(o,s):ER(o,s),this.addMonths=(o,s)=>this.overrides?.addMonths?this.overrides.addMonths(o,s):_R(o,s),this.addWeeks=(o,s)=>this.overrides?.addWeeks?this.overrides.addWeeks(o,s):qV(o,s),this.addYears=(o,s)=>this.overrides?.addYears?this.overrides.addYears(o,s):WV(o,s),this.differenceInCalendarDays=(o,s)=>this.overrides?.differenceInCalendarDays?this.overrides.differenceInCalendarDays(o,s):Ky(o,s),this.differenceInCalendarMonths=(o,s)=>this.overrides?.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(o,s):RR(o,s),this.eachMonthOfInterval=o=>this.overrides?.eachMonthOfInterval?this.overrides.eachMonthOfInterval(o):eU(o),this.eachYearOfInterval=o=>{const s=this.overrides?.eachYearOfInterval?this.overrides.eachYearOfInterval(o):oU(o),i=new Set(s.map(u=>this.getYear(u)));if(i.size===s.length)return s;const l=[];return i.forEach(u=>{l.push(new Date(u,0,1))}),l},this.endOfBroadcastWeek=o=>this.overrides?.endOfBroadcastWeek?this.overrides.endOfBroadcastWeek(o):dY(o,this),this.endOfISOWeek=o=>this.overrides?.endOfISOWeek?this.overrides.endOfISOWeek(o):rU(o),this.endOfMonth=o=>this.overrides?.endOfMonth?this.overrides.endOfMonth(o):JV(o),this.endOfWeek=(o,s)=>this.overrides?.endOfWeek?this.overrides.endOfWeek(o,s):kR(o,this.options),this.endOfYear=o=>this.overrides?.endOfYear?this.overrides.endOfYear(o):nU(o),this.format=(o,s,i)=>{const l=this.overrides?.format?this.overrides.format(o,s,this.options):Nc(o,s,this.options);return this.options.numerals&&this.options.numerals!=="latn"?this.replaceDigits(l):l},this.getISOWeek=o=>this.overrides?.getISOWeek?this.overrides.getISOWeek(o):Xy(o),this.getMonth=(o,s)=>this.overrides?.getMonth?this.overrides.getMonth(o,this.options):tY(o,this.options),this.getYear=(o,s)=>this.overrides?.getYear?this.overrides.getYear(o,this.options):nY(o,this.options),this.getWeek=(o,s)=>this.overrides?.getWeek?this.overrides.getWeek(o,this.options):Qy(o,this.options),this.isAfter=(o,s)=>this.overrides?.isAfter?this.overrides.isAfter(o,s):oY(o,s),this.isBefore=(o,s)=>this.overrides?.isBefore?this.overrides.isBefore(o,s):rY(o,s),this.isDate=o=>this.overrides?.isDate?this.overrides.isDate(o):MR(o),this.isSameDay=(o,s)=>this.overrides?.isSameDay?this.overrides.isSameDay(o,s):QV(o,s),this.isSameMonth=(o,s)=>this.overrides?.isSameMonth?this.overrides.isSameMonth(o,s):sY(o,s),this.isSameYear=(o,s)=>this.overrides?.isSameYear?this.overrides.isSameYear(o,s):aY(o,s),this.max=o=>this.overrides?.max?this.overrides.max(o):KV(o),this.min=o=>this.overrides?.min?this.overrides.min(o):XV(o),this.setMonth=(o,s)=>this.overrides?.setMonth?this.overrides.setMonth(o,s):iY(o,s),this.setYear=(o,s)=>this.overrides?.setYear?this.overrides.setYear(o,s):lY(o,s),this.startOfBroadcastWeek=(o,s)=>this.overrides?.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(o,this):OR(o,this),this.startOfDay=o=>this.overrides?.startOfDay?this.overrides.startOfDay(o):Kc(o),this.startOfISOWeek=o=>this.overrides?.startOfISOWeek?this.overrides.startOfISOWeek(o):Wc(o),this.startOfMonth=o=>this.overrides?.startOfMonth?this.overrides.startOfMonth(o):tU(o),this.startOfWeek=(o,s)=>this.overrides?.startOfWeek?this.overrides.startOfWeek(o,this.options):il(o,this.options),this.startOfYear=o=>this.overrides?.startOfYear?this.overrides.startOfYear(o):TR(o),this.options={locale:zR,...e},this.overrides=n}getDigitMap(){const{numerals:e="latn"}=this.options,n=new Intl.NumberFormat("en-US",{numberingSystem:e}),o={};for(let s=0;s<10;s++)o[s.toString()]=n.format(s);return o}replaceDigits(e){const n=this.getDigitMap();return e.replace(/\d/g,o=>n[o]||o)}formatNumber(e){return this.replaceDigits(e.toString())}getMonthYearOrder(){const e=this.options.locale?.code;return e&&_o.yearFirstLocales.has(e)?"year-first":"month-first"}formatMonthYear(e){const{locale:n,timeZone:o,numerals:s}=this.options,i=n?.code;if(i&&_o.yearFirstLocales.has(i))try{return new Intl.DateTimeFormat(i,{month:"long",year:"numeric",timeZone:o,numberingSystem:s}).format(e)}catch{}const l=this.getMonthYearOrder()==="year-first"?"y LLLL":"LLLL y";return this.format(e,l)}}_o.yearFirstLocales=new Set(["eu","hu","ja","ja-Hira","ja-JP","ko","ko-KR","lt","lt-LT","lv","lv-LV","mn","mn-MN","zh","zh-CN","zh-HK","zh-TW"]);const Ar=new _o;class IR{constructor(e,n,o=Ar){this.date=e,this.displayMonth=n,this.outside=!!(n&&!o.isSameMonth(e,n)),this.dateLib=o,this.isoDate=o.format(e,"yyyy-MM-dd"),this.displayMonthId=o.format(n,"yyyy-MM"),this.dateMonthId=o.format(e,"yyyy-MM")}isEqualTo(e){return this.dateLib.isSameDay(e.date,this.date)&&this.dateLib.isSameMonth(e.displayMonth,this.displayMonth)}}class fY{constructor(e,n){this.date=e,this.weeks=n}}class hY{constructor(e,n){this.days=n,this.weekNumber=e}}function mY(t){return de.createElement("button",{...t})}function gY(t){return de.createElement("span",{...t})}function pY(t){const{size:e=24,orientation:n="left",className:o}=t;return de.createElement("svg",{className:o,width:e,height:e,viewBox:"0 0 24 24"},n==="up"&&de.createElement("polygon",{points:"6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28"}),n==="down"&&de.createElement("polygon",{points:"6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72"}),n==="left"&&de.createElement("polygon",{points:"16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20"}),n==="right"&&de.createElement("polygon",{points:"8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20"}))}function yY(t){const{day:e,modifiers:n,...o}=t;return de.createElement("td",{...o})}function vY(t){const{day:e,modifiers:n,...o}=t,s=de.useRef(null);return de.useEffect(()=>{n.focused&&s.current?.focus()},[n.focused]),de.createElement("button",{ref:s,...o})}var Ge;(function(t){t.Root="root",t.Chevron="chevron",t.Day="day",t.DayButton="day_button",t.CaptionLabel="caption_label",t.Dropdowns="dropdowns",t.Dropdown="dropdown",t.DropdownRoot="dropdown_root",t.Footer="footer",t.MonthGrid="month_grid",t.MonthCaption="month_caption",t.MonthsDropdown="months_dropdown",t.Month="month",t.Months="months",t.Nav="nav",t.NextMonthButton="button_next",t.PreviousMonthButton="button_previous",t.Week="week",t.Weeks="weeks",t.Weekday="weekday",t.Weekdays="weekdays",t.WeekNumber="week_number",t.WeekNumberHeader="week_number_header",t.YearsDropdown="years_dropdown"})(Ge||(Ge={}));var hn;(function(t){t.disabled="disabled",t.hidden="hidden",t.outside="outside",t.focused="focused",t.today="today"})(hn||(hn={}));var tr;(function(t){t.range_end="range_end",t.range_middle="range_middle",t.range_start="range_start",t.selected="selected"})(tr||(tr={}));var bo;(function(t){t.weeks_before_enter="weeks_before_enter",t.weeks_before_exit="weeks_before_exit",t.weeks_after_enter="weeks_after_enter",t.weeks_after_exit="weeks_after_exit",t.caption_after_enter="caption_after_enter",t.caption_after_exit="caption_after_exit",t.caption_before_enter="caption_before_enter",t.caption_before_exit="caption_before_exit"})(bo||(bo={}));function xY(t){const{options:e,className:n,components:o,classNames:s,...i}=t,l=[s[Ge.Dropdown],n].join(" "),u=e?.find(({value:d})=>d===i.value);return de.createElement("span",{"data-disabled":i.disabled,className:s[Ge.DropdownRoot]},de.createElement(o.Select,{className:l,...i},e?.map(({value:d,label:f,disabled:g})=>de.createElement(o.Option,{key:d,value:d,disabled:g},f))),de.createElement("span",{className:s[Ge.CaptionLabel],"aria-hidden":!0},u?.label,de.createElement(o.Chevron,{orientation:"down",size:18,className:s[Ge.Chevron]})))}function bY(t){return de.createElement("div",{...t})}function wY(t){return de.createElement("div",{...t})}function SY(t){const{calendarMonth:e,displayIndex:n,...o}=t;return de.createElement("div",{...o},t.children)}function CY(t){const{calendarMonth:e,displayIndex:n,...o}=t;return de.createElement("div",{...o})}function EY(t){return de.createElement("table",{...t})}function _Y(t){return de.createElement("div",{...t})}const PR=x.createContext(void 0);function yu(){const t=x.useContext(PR);if(t===void 0)throw new Error("useDayPicker() must be used within a custom component.");return t}function NY(t){const{components:e}=yu();return de.createElement(e.Dropdown,{...t})}function MY(t){const{onPreviousClick:e,onNextClick:n,previousMonth:o,nextMonth:s,...i}=t,{components:l,classNames:u,labels:{labelPrevious:d,labelNext:f}}=yu(),g=x.useCallback(y=>{s&&n?.(y)},[s,n]),m=x.useCallback(y=>{o&&e?.(y)},[o,e]);return de.createElement("nav",{...i},de.createElement(l.PreviousMonthButton,{type:"button",className:u[Ge.PreviousMonthButton],tabIndex:o?void 0:-1,"aria-disabled":o?void 0:!0,"aria-label":d(o),onClick:m},de.createElement(l.Chevron,{disabled:o?void 0:!0,className:u[Ge.Chevron],orientation:"left"})),de.createElement(l.NextMonthButton,{type:"button",className:u[Ge.NextMonthButton],tabIndex:s?void 0:-1,"aria-disabled":s?void 0:!0,"aria-label":f(s),onClick:g},de.createElement(l.Chevron,{disabled:s?void 0:!0,orientation:"right",className:u[Ge.Chevron]})))}function RY(t){const{components:e}=yu();return de.createElement(e.Button,{...t})}function DY(t){return de.createElement("option",{...t})}function TY(t){const{components:e}=yu();return de.createElement(e.Button,{...t})}function kY(t){const{rootRef:e,...n}=t;return de.createElement("div",{...n,ref:e})}function jY(t){return de.createElement("select",{...t})}function AY(t){const{week:e,...n}=t;return de.createElement("tr",{...n})}function OY(t){return de.createElement("th",{...t})}function zY(t){return de.createElement("thead",{"aria-hidden":!0},de.createElement("tr",{...t}))}function IY(t){const{week:e,...n}=t;return de.createElement("th",{...n})}function PY(t){return de.createElement("th",{...t})}function $Y(t){return de.createElement("tbody",{...t})}function LY(t){const{components:e}=yu();return de.createElement(e.Dropdown,{...t})}const HY=Object.freeze(Object.defineProperty({__proto__:null,Button:mY,CaptionLabel:gY,Chevron:pY,Day:yY,DayButton:vY,Dropdown:xY,DropdownNav:bY,Footer:wY,Month:SY,MonthCaption:CY,MonthGrid:EY,Months:_Y,MonthsDropdown:NY,Nav:MY,NextMonthButton:RY,Option:DY,PreviousMonthButton:TY,Root:kY,Select:jY,Week:AY,WeekNumber:IY,WeekNumberHeader:PY,Weekday:OY,Weekdays:zY,Weeks:$Y,YearsDropdown:LY},Symbol.toStringTag,{value:"Module"}));function as(t,e,n=!1,o=Ar){let{from:s,to:i}=t;const{differenceInCalendarDays:l,isSameDay:u}=o;return s&&i?(l(i,s)<0&&([s,i]=[i,s]),l(e,s)>=(n?1:0)&&l(i,e)>=(n?1:0)):!n&&i?u(i,e):!n&&s?u(s,e):!1}function Zy(t){return!!(t&&typeof t=="object"&&"before"in t&&"after"in t)}function Eh(t){return!!(t&&typeof t=="object"&&"from"in t)}function Jy(t){return!!(t&&typeof t=="object"&&"after"in t)}function ev(t){return!!(t&&typeof t=="object"&&"before"in t)}function $R(t){return!!(t&&typeof t=="object"&&"dayOfWeek"in t)}function LR(t,e){return Array.isArray(t)&&t.every(e.isDate)}function is(t,e,n=Ar){const o=Array.isArray(e)?e:[e],{isSameDay:s,differenceInCalendarDays:i,isAfter:l}=n;return o.some(u=>{if(typeof u=="boolean")return u;if(n.isDate(u))return s(t,u);if(LR(u,n))return u.some(d=>s(t,d));if(Eh(u))return as(u,t,!1,n);if($R(u))return Array.isArray(u.dayOfWeek)?u.dayOfWeek.includes(t.getDay()):u.dayOfWeek===t.getDay();if(Zy(u)){const d=i(u.before,t),f=i(u.after,t),g=d>0,m=f<0;return l(u.before,u.after)?m&&g:g||m}return Jy(u)?i(t,u.after)>0:ev(u)?i(u.before,t)>0:typeof u=="function"?u(t):!1})}function BY(t,e,n,o,s){const{disabled:i,hidden:l,modifiers:u,showOutsideDays:d,broadcastCalendar:f,today:g=s.today()}=e,{isSameDay:m,isSameMonth:y,startOfMonth:v,isBefore:w,endOfMonth:C,isAfter:S}=s,N=n&&v(n),M=o&&C(o),E={[hn.focused]:[],[hn.outside]:[],[hn.disabled]:[],[hn.hidden]:[],[hn.today]:[]},R={};for(const D of t){const{date:T,displayMonth:k}=D,O=!!(k&&!y(T,k)),L=!!(N&&w(T,N)),W=!!(M&&S(T,M)),B=!!(i&&is(T,i,s)),Y=!!(l&&is(T,l,s))||L||W||!f&&!d&&O||f&&d===!1&&O,q=m(T,g);O&&E.outside.push(D),B&&E.disabled.push(D),Y&&E.hidden.push(D),q&&E.today.push(D),u&&Object.keys(u).forEach(z=>{const V=u?.[z];V&&is(T,V,s)&&(R[z]?R[z].push(D):R[z]=[D])})}return D=>{const T={[hn.focused]:!1,[hn.disabled]:!1,[hn.hidden]:!1,[hn.outside]:!1,[hn.today]:!1},k={};for(const O in E){const L=E[O];T[O]=L.some(W=>W===D)}for(const O in R)k[O]=R[O].some(L=>L===D);return{...T,...k}}}function FY(t,e,n={}){return Object.entries(t).filter(([,s])=>s===!0).reduce((s,[i])=>(n[i]?s.push(n[i]):e[hn[i]]?s.push(e[hn[i]]):e[tr[i]]&&s.push(e[tr[i]]),s),[e[Ge.Day]])}function VY(t){return{...HY,...t}}function UY(t){const e={"data-mode":t.mode??void 0,"data-required":"required"in t?t.required:void 0,"data-multiple-months":t.numberOfMonths&&t.numberOfMonths>1||void 0,"data-week-numbers":t.showWeekNumber||void 0,"data-broadcast-calendar":t.broadcastCalendar||void 0,"data-nav-layout":t.navLayout||void 0};return Object.entries(t).forEach(([n,o])=>{n.startsWith("data-")&&(e[n]=o)}),e}function tv(){const t={};for(const e in Ge)t[Ge[e]]=`rdp-${Ge[e]}`;for(const e in hn)t[hn[e]]=`rdp-${hn[e]}`;for(const e in tr)t[tr[e]]=`rdp-${tr[e]}`;for(const e in bo)t[bo[e]]=`rdp-${bo[e]}`;return t}function HR(t,e,n){return(n??new _o(e)).formatMonthYear(t)}const YY=HR;function GY(t,e,n){return(n??new _o(e)).format(t,"d")}function qY(t,e=Ar){return e.format(t,"LLLL")}function WY(t,e,n){return(n??new _o(e)).format(t,"cccccc")}function KY(t,e=Ar){return t<10?e.formatNumber(`0${t.toLocaleString()}`):e.formatNumber(`${t.toLocaleString()}`)}function XY(){return""}function BR(t,e=Ar){return e.format(t,"yyyy")}const QY=BR,ZY=Object.freeze(Object.defineProperty({__proto__:null,formatCaption:HR,formatDay:GY,formatMonthCaption:YY,formatMonthDropdown:qY,formatWeekNumber:KY,formatWeekNumberHeader:XY,formatWeekdayName:WY,formatYearCaption:QY,formatYearDropdown:BR},Symbol.toStringTag,{value:"Module"}));function JY(t){return t?.formatMonthCaption&&!t.formatCaption&&(t.formatCaption=t.formatMonthCaption),t?.formatYearCaption&&!t.formatYearDropdown&&(t.formatYearDropdown=t.formatYearCaption),{...ZY,...t}}function nv(t,e,n,o){let s=(o??new _o(n)).format(t,"PPPP");return e.today&&(s=`Today, ${s}`),e.selected&&(s=`${s}, selected`),s}const eG=nv;function ov(t,e,n){return(n??new _o(e)).formatMonthYear(t)}const tG=ov;function FR(t,e,n,o){let s=(o??new _o(n)).format(t,"PPPP");return e?.today&&(s=`Today, ${s}`),s}function VR(t){return"Choose the Month"}function UR(){return""}const nG="Go to the Next Month";function YR(t,e){return nG}function GR(t){return"Go to the Previous Month"}function qR(t,e,n){return(n??new _o(e)).format(t,"cccc")}function WR(t,e){return`Week ${t}`}function KR(t){return"Week Number"}function XR(t){return"Choose the Year"}const oG=Object.freeze(Object.defineProperty({__proto__:null,labelCaption:tG,labelDay:eG,labelDayButton:nv,labelGrid:ov,labelGridcell:FR,labelMonthDropdown:VR,labelNav:UR,labelNext:YR,labelPrevious:GR,labelWeekNumber:WR,labelWeekNumberHeader:KR,labelWeekday:qR,labelYearDropdown:XR},Symbol.toStringTag,{value:"Module"})),Ko=(t,e,n)=>e||(n?typeof n=="function"?n:(...o)=>n:t);function rG(t,e){const n=e.locale?.labels??{};return{...oG,...t??{},labelDayButton:Ko(nv,t?.labelDayButton,n.labelDayButton),labelMonthDropdown:Ko(VR,t?.labelMonthDropdown,n.labelMonthDropdown),labelNext:Ko(YR,t?.labelNext,n.labelNext),labelPrevious:Ko(GR,t?.labelPrevious,n.labelPrevious),labelWeekNumber:Ko(WR,t?.labelWeekNumber,n.labelWeekNumber),labelYearDropdown:Ko(XR,t?.labelYearDropdown,n.labelYearDropdown),labelGrid:Ko(ov,t?.labelGrid,n.labelGrid),labelGridcell:Ko(FR,t?.labelGridcell,n.labelGridcell),labelNav:Ko(UR,t?.labelNav,n.labelNav),labelWeekNumberHeader:Ko(KR,t?.labelWeekNumberHeader,n.labelWeekNumberHeader),labelWeekday:Ko(qR,t?.labelWeekday,n.labelWeekday)}}function sG(t,e,n,o,s){const{startOfMonth:i,startOfYear:l,endOfYear:u,eachMonthOfInterval:d,getMonth:f}=s;return d({start:l(t),end:u(t)}).map(y=>{const v=o.formatMonthDropdown(y,s),w=f(y),C=e&&y<i(e)||n&&y>i(n)||!1;return{value:w,label:v,disabled:C}})}function aG(t,e={},n={}){let o={...e?.[Ge.Day]};return Object.entries(t).filter(([,s])=>s===!0).forEach(([s])=>{o={...o,...n?.[s]}}),o}function iG(t,e,n,o){const s=o??t.today(),i=n?t.startOfBroadcastWeek(s,t):e?t.startOfISOWeek(s):t.startOfWeek(s),l=[];for(let u=0;u<7;u++){const d=t.addDays(i,u);l.push(d)}return l}function lG(t,e,n,o,s=!1){if(!t||!e)return;const{startOfYear:i,endOfYear:l,eachYearOfInterval:u,getYear:d}=o,f=i(t),g=l(e),m=u({start:f,end:g});return s&&m.reverse(),m.map(y=>{const v=n.formatYearDropdown(y,o);return{value:d(y),label:v,disabled:!1}})}function cG(t,e={}){const{weekStartsOn:n,locale:o}=e,s=n??o?.options?.weekStartsOn??0,i=u=>{const d=typeof u=="number"||typeof u=="string"?new Date(u):u;return new Wn(d.getFullYear(),d.getMonth(),d.getDate(),12,0,0,t)},l=u=>{const d=i(u);return new Date(d.getFullYear(),d.getMonth(),d.getDate(),0,0,0,0)};return{today:()=>i(Wn.tz(t)),newDate:(u,d,f)=>new Wn(u,d,f,12,0,0,t),startOfDay:u=>i(u),startOfWeek:(u,d)=>{const f=i(u),g=d?.weekStartsOn??s,m=(f.getDay()-g+7)%7;return f.setDate(f.getDate()-m),f},startOfISOWeek:u=>{const d=i(u),f=(d.getDay()-1+7)%7;return d.setDate(d.getDate()-f),d},startOfMonth:u=>{const d=i(u);return d.setDate(1),d},startOfYear:u=>{const d=i(u);return d.setMonth(0,1),d},endOfWeek:(u,d)=>{const f=i(u),y=(((d?.weekStartsOn??s)+6)%7-f.getDay()+7)%7;return f.setDate(f.getDate()+y),f},endOfISOWeek:u=>{const d=i(u),f=(7-d.getDay())%7;return d.setDate(d.getDate()+f),d},endOfMonth:u=>{const d=i(u);return d.setMonth(d.getMonth()+1,0),d},endOfYear:u=>{const d=i(u);return d.setMonth(11,31),d},eachMonthOfInterval:u=>{const d=i(u.start),f=i(u.end),g=[],m=new Wn(d.getFullYear(),d.getMonth(),1,12,0,0,t),y=f.getFullYear()*12+f.getMonth();for(;m.getFullYear()*12+m.getMonth()<=y;)g.push(new Wn(m,t)),m.setMonth(m.getMonth()+1,1);return g},addDays:(u,d)=>{const f=i(u);return f.setDate(f.getDate()+d),f},addWeeks:(u,d)=>{const f=i(u);return f.setDate(f.getDate()+d*7),f},addMonths:(u,d)=>{const f=i(u);return f.setMonth(f.getMonth()+d),f},addYears:(u,d)=>{const f=i(u);return f.setFullYear(f.getFullYear()+d),f},eachYearOfInterval:u=>{const d=i(u.start),f=i(u.end),g=[],m=new Wn(d.getFullYear(),0,1,12,0,0,t);for(;m.getFullYear()<=f.getFullYear();)g.push(new Wn(m,t)),m.setFullYear(m.getFullYear()+1,0,1);return g},getWeek:(u,d)=>{const f=l(u);return Qy(f,{weekStartsOn:d?.weekStartsOn??s,firstWeekContainsDate:d?.firstWeekContainsDate??o?.options?.firstWeekContainsDate??1})},getISOWeek:u=>{const d=l(u);return Xy(d)},differenceInCalendarDays:(u,d)=>{const f=l(u),g=l(d);return Ky(f,g)},differenceInCalendarMonths:(u,d)=>{const f=l(u),g=l(d);return RR(f,g)}}}const vu=t=>t instanceof HTMLElement?t:null,xp=t=>[...t.querySelectorAll("[data-animated-month]")??[]],uG=t=>vu(t.querySelector("[data-animated-month]")),bp=t=>vu(t.querySelector("[data-animated-caption]")),wp=t=>vu(t.querySelector("[data-animated-weeks]")),dG=t=>vu(t.querySelector("[data-animated-nav]")),fG=t=>vu(t.querySelector("[data-animated-weekdays]"));function hG(t,e,{classNames:n,months:o,focused:s,dateLib:i}){const l=x.useRef(null),u=x.useRef(o),d=x.useRef(!1);x.useLayoutEffect(()=>{const f=u.current;if(u.current=o,!e||!t.current||!(t.current instanceof HTMLElement)||o.length===0||f.length===0||o.length!==f.length)return;const g=i.isSameMonth(o[0].date,f[0].date),m=i.isAfter(o[0].date,f[0].date),y=m?n[bo.caption_after_enter]:n[bo.caption_before_enter],v=m?n[bo.weeks_after_enter]:n[bo.weeks_before_enter],w=l.current,C=t.current.cloneNode(!0);if(C instanceof HTMLElement?(xp(C).forEach(E=>{if(!(E instanceof HTMLElement))return;const R=uG(E);R&&E.contains(R)&&E.removeChild(R);const D=bp(E);D&&D.classList.remove(y);const T=wp(E);T&&T.classList.remove(v)}),l.current=C):l.current=null,d.current||g||s)return;const S=w instanceof HTMLElement?xp(w):[],N=xp(t.current);if(N?.every(M=>M instanceof HTMLElement)&&S&&S.every(M=>M instanceof HTMLElement)){d.current=!0,t.current.style.isolation="isolate";const M=dG(t.current);M&&(M.style.zIndex="1"),N.forEach((E,R)=>{const D=S[R];if(!D)return;E.style.position="relative",E.style.overflow="hidden";const T=bp(E);T&&T.classList.add(y);const k=wp(E);k&&k.classList.add(v);const O=()=>{d.current=!1,t.current&&(t.current.style.isolation=""),M&&(M.style.zIndex=""),T&&T.classList.remove(y),k&&k.classList.remove(v),E.style.position="",E.style.overflow="",E.contains(D)&&E.removeChild(D)};D.style.pointerEvents="none",D.style.position="absolute",D.style.overflow="hidden",D.setAttribute("aria-hidden","true");const L=fG(D);L&&(L.style.opacity="0");const W=bp(D);W&&(W.classList.add(m?n[bo.caption_before_exit]:n[bo.caption_after_exit]),W.addEventListener("animationend",O));const B=wp(D);B&&B.classList.add(m?n[bo.weeks_before_exit]:n[bo.weeks_after_exit]),E.insertBefore(D,E.firstChild)})}})}function mG(t,e,n,o){const s=t[0],i=t[t.length-1],{ISOWeek:l,fixedWeeks:u,broadcastCalendar:d}=n??{},{addDays:f,differenceInCalendarDays:g,differenceInCalendarMonths:m,endOfBroadcastWeek:y,endOfISOWeek:v,endOfMonth:w,endOfWeek:C,isAfter:S,startOfBroadcastWeek:N,startOfISOWeek:M,startOfWeek:E}=o,R=d?N(s,o):l?M(s):E(s),D=d?y(i):l?v(w(i)):C(w(i)),T=e&&(d?y(e):l?v(e):C(e)),k=T&&S(D,T)?T:D,O=g(k,R),L=m(i,s)+1,W=[];for(let q=0;q<=O;q++){const z=f(R,q);W.push(z)}const Y=(d?35:42)*L;if(u&&W.length<Y){const q=Y-W.length;for(let z=0;z<q;z++){const V=f(W[W.length-1],1);W.push(V)}}return W}function gG(t){const e=[];return t.reduce((n,o)=>{const s=o.weeks.reduce((i,l)=>i.concat(l.days.slice()),e.slice());return n.concat(s.slice())},e.slice())}function pG(t,e,n,o){const{numberOfMonths:s=1}=n,i=[];for(let l=0;l<s;l++){const u=o.addMonths(t,l);if(e&&u>e)break;i.push(u)}return i}function E2(t,e,n,o){const{month:s,defaultMonth:i,today:l=o.today(),numberOfMonths:u=1}=t;let d=s||i||l;const{differenceInCalendarMonths:f,addMonths:g,startOfMonth:m}=o;if(n&&f(n,d)<u-1){const y=-1*(u-1);d=g(n,y)}return e&&f(d,e)<0&&(d=e),m(d)}function yG(t,e,n,o){const{addDays:s,endOfBroadcastWeek:i,endOfISOWeek:l,endOfMonth:u,endOfWeek:d,getISOWeek:f,getWeek:g,startOfBroadcastWeek:m,startOfISOWeek:y,startOfWeek:v}=o,w=t.reduce((C,S)=>{const N=n.broadcastCalendar?m(S,o):n.ISOWeek?y(S):v(S),M=n.broadcastCalendar?i(S):n.ISOWeek?l(u(S)):d(u(S)),E=e.filter(k=>k>=N&&k<=M),R=n.broadcastCalendar?35:42;if(n.fixedWeeks&&E.length<R){const k=e.filter(O=>{const L=R-E.length;return O>M&&O<=s(M,L)});E.push(...k)}const D=E.reduce((k,O)=>{const L=n.ISOWeek?f(O):g(O),W=k.find(Y=>Y.weekNumber===L),B=new IR(O,S,o);return W?W.days.push(B):k.push(new hY(L,[B])),k},[]),T=new fY(S,D);return C.push(T),C},[]);return n.reverseMonths?w.reverse():w}function vG(t,e){let{startMonth:n,endMonth:o}=t;const{startOfYear:s,startOfDay:i,startOfMonth:l,endOfMonth:u,addYears:d,endOfYear:f,newDate:g,today:m}=e,{fromYear:y,toYear:v,fromMonth:w,toMonth:C}=t;!n&&w&&(n=w),!n&&y&&(n=e.newDate(y,0,1)),!o&&C&&(o=C),!o&&v&&(o=g(v,11,31));const S=t.captionLayout==="dropdown"||t.captionLayout==="dropdown-years";return n?n=l(n):y?n=g(y,0,1):!n&&S&&(n=s(d(t.today??m(),-100))),o?o=u(o):v?o=g(v,11,31):!o&&S&&(o=f(t.today??m())),[n&&i(n),o&&i(o)]}function xG(t,e,n,o){if(n.disableNavigation)return;const{pagedNavigation:s,numberOfMonths:i=1}=n,{startOfMonth:l,addMonths:u,differenceInCalendarMonths:d}=o,f=s?i:1,g=l(t);if(!e)return u(g,f);if(!(d(e,t)<i))return u(g,f)}function bG(t,e,n,o){if(n.disableNavigation)return;const{pagedNavigation:s,numberOfMonths:i}=n,{startOfMonth:l,addMonths:u,differenceInCalendarMonths:d}=o,f=s?i??1:1,g=l(t);if(!e)return u(g,-f);if(!(d(g,e)<=0))return u(g,-f)}function wG(t){const e=[];return t.reduce((n,o)=>n.concat(o.weeks.slice()),e.slice())}function _h(t,e){const[n,o]=x.useState(t);return[e===void 0?n:e,o]}function SG(t,e){const[n,o]=vG(t,e),{startOfMonth:s,endOfMonth:i}=e,l=E2(t,n,o,e),[u,d]=_h(l,t.month?l:void 0);x.useEffect(()=>{const R=E2(t,n,o,e);d(R)},[t.timeZone]);const{months:f,weeks:g,days:m,previousMonth:y,nextMonth:v}=x.useMemo(()=>{const R=pG(u,o,{numberOfMonths:t.numberOfMonths},e),D=mG(R,t.endMonth?i(t.endMonth):void 0,{ISOWeek:t.ISOWeek,fixedWeeks:t.fixedWeeks,broadcastCalendar:t.broadcastCalendar},e),T=yG(R,D,{broadcastCalendar:t.broadcastCalendar,fixedWeeks:t.fixedWeeks,ISOWeek:t.ISOWeek,reverseMonths:t.reverseMonths},e),k=wG(T),O=gG(T),L=bG(u,n,t,e),W=xG(u,o,t,e);return{months:T,weeks:k,days:O,previousMonth:L,nextMonth:W}},[e,u.getTime(),o?.getTime(),n?.getTime(),t.disableNavigation,t.broadcastCalendar,t.endMonth?.getTime(),t.fixedWeeks,t.ISOWeek,t.numberOfMonths,t.pagedNavigation,t.reverseMonths]),{disableNavigation:w,onMonthChange:C}=t,S=R=>g.some(D=>D.days.some(T=>T.isEqualTo(R))),N=R=>{if(w)return;let D=s(R);n&&D<s(n)&&(D=s(n)),o&&D>s(o)&&(D=s(o)),d(D),C?.(D)};return{months:f,weeks:g,days:m,navStart:n,navEnd:o,previousMonth:y,nextMonth:v,goToMonth:N,goToDay:R=>{S(R)||N(R.date)}}}var pr;(function(t){t[t.Today=0]="Today",t[t.Selected=1]="Selected",t[t.LastFocused=2]="LastFocused",t[t.FocusedModifier=3]="FocusedModifier"})(pr||(pr={}));function _2(t){return!t[hn.disabled]&&!t[hn.hidden]&&!t[hn.outside]}function CG(t,e,n,o){let s,i=-1;for(const l of t){const u=e(l);_2(u)&&(u[hn.focused]&&i<pr.FocusedModifier?(s=l,i=pr.FocusedModifier):o?.isEqualTo(l)&&i<pr.LastFocused?(s=l,i=pr.LastFocused):n(l.date)&&i<pr.Selected?(s=l,i=pr.Selected):u[hn.today]&&i<pr.Today&&(s=l,i=pr.Today))}return s||(s=t.find(l=>_2(e(l)))),s}function EG(t,e,n,o,s,i,l){const{ISOWeek:u,broadcastCalendar:d}=i,{addDays:f,addMonths:g,addWeeks:m,addYears:y,endOfBroadcastWeek:v,endOfISOWeek:w,endOfWeek:C,max:S,min:N,startOfBroadcastWeek:M,startOfISOWeek:E,startOfWeek:R}=l;let T={day:f,week:m,month:g,year:y,startOfWeek:k=>d?M(k,l):u?E(k):R(k),endOfWeek:k=>d?v(k):u?w(k):C(k)}[t](n,e==="after"?1:-1);return e==="before"&&o?T=S([o,T]):e==="after"&&s&&(T=N([s,T])),T}function QR(t,e,n,o,s,i,l,u=0){if(u>365)return;const d=EG(t,e,n.date,o,s,i,l),f=!!(i.disabled&&is(d,i.disabled,l)),g=!!(i.hidden&&is(d,i.hidden,l)),m=d,y=new IR(d,m,l);return!f&&!g?y:QR(t,e,y,o,s,i,l,u+1)}function _G(t,e,n,o,s){const{autoFocus:i}=t,[l,u]=x.useState(),d=CG(e.days,n,o||(()=>!1),l),[f,g]=x.useState(i?d:void 0);return{isFocusTarget:C=>!!d?.isEqualTo(C),setFocused:g,focused:f,blur:()=>{u(f),g(void 0)},moveFocus:(C,S)=>{if(!f)return;const N=QR(C,S,f,e.navStart,e.navEnd,t,s);N&&(t.disableNavigation&&!e.days.some(E=>E.isEqualTo(N))||(e.goToDay(N),g(N)))}}}function NG(t,e){const{selected:n,required:o,onSelect:s}=t,[i,l]=_h(n,s?n:void 0),u=s?n:i,{isSameDay:d}=e,f=v=>u?.some(w=>d(w,v))??!1,{min:g,max:m}=t;return{selected:u,select:(v,w,C)=>{let S=[...u??[]];if(f(v)){if(u?.length===g||o&&u?.length===1)return;S=u?.filter(N=>!d(N,v))}else u?.length===m?S=[v]:S=[...S,v];return s||l(S),s?.(S,v,w,C),S},isSelected:f}}function MG(t,e,n=0,o=0,s=!1,i=Ar){const{from:l,to:u}=e||{},{isSameDay:d,isAfter:f,isBefore:g}=i;let m;if(!l&&!u)m={from:t,to:n>0?void 0:t};else if(l&&!u)d(l,t)?n===0?m={from:l,to:t}:s?m={from:l,to:void 0}:m=void 0:g(t,l)?m={from:t,to:l}:m={from:l,to:t};else if(l&&u)if(d(l,t)&&d(u,t))s?m={from:l,to:u}:m=void 0;else if(d(l,t))m={from:l,to:n>0?void 0:t};else if(d(u,t))m={from:t,to:n>0?void 0:t};else if(g(t,l))m={from:t,to:u};else if(f(t,l))m={from:l,to:t};else if(f(t,u))m={from:l,to:t};else throw new Error("Invalid range");if(m?.from&&m?.to){const y=i.differenceInCalendarDays(m.to,m.from);o>0&&y>o?m={from:t,to:void 0}:n>1&&y<n&&(m={from:t,to:void 0})}return m}function RG(t,e,n=Ar){const o=Array.isArray(e)?e:[e];let s=t.from;const i=n.differenceInCalendarDays(t.to,t.from),l=Math.min(i,6);for(let u=0;u<=l;u++){if(o.includes(s.getDay()))return!0;s=n.addDays(s,1)}return!1}function N2(t,e,n=Ar){return as(t,e.from,!1,n)||as(t,e.to,!1,n)||as(e,t.from,!1,n)||as(e,t.to,!1,n)}function DG(t,e,n=Ar){const o=Array.isArray(e)?e:[e];if(o.filter(u=>typeof u!="function").some(u=>typeof u=="boolean"?u:n.isDate(u)?as(t,u,!1,n):LR(u,n)?u.some(d=>as(t,d,!1,n)):Eh(u)?u.from&&u.to?N2(t,{from:u.from,to:u.to},n):!1:$R(u)?RG(t,u.dayOfWeek,n):Zy(u)?n.isAfter(u.before,u.after)?N2(t,{from:n.addDays(u.after,1),to:n.addDays(u.before,-1)},n):is(t.from,u,n)||is(t.to,u,n):Jy(u)||ev(u)?is(t.from,u,n)||is(t.to,u,n):!1))return!0;const l=o.filter(u=>typeof u=="function");if(l.length){let u=t.from;const d=n.differenceInCalendarDays(t.to,t.from);for(let f=0;f<=d;f++){if(l.some(g=>g(u)))return!0;u=n.addDays(u,1)}}return!1}function TG(t,e){const{disabled:n,excludeDisabled:o,selected:s,required:i,onSelect:l}=t,[u,d]=_h(s,l?s:void 0),f=l?s:u;return{selected:f,select:(y,v,w)=>{const{min:C,max:S}=t,N=y?MG(y,f,C,S,i,e):void 0;return o&&n&&N?.from&&N.to&&DG({from:N.from,to:N.to},n,e)&&(N.from=y,N.to=void 0),l||d(N),l?.(N,y,v,w),N},isSelected:y=>f&&as(f,y,!1,e)}}function kG(t,e){const{selected:n,required:o,onSelect:s}=t,[i,l]=_h(n,s?n:void 0),u=s?n:i,{isSameDay:d}=e;return{selected:u,select:(m,y,v)=>{let w=m;return!o&&u&&u&&d(m,u)&&(w=void 0),s||l(w),s?.(w,m,y,v),w},isSelected:m=>u?d(u,m):!1}}function jG(t,e){const n=kG(t,e),o=NG(t,e),s=TG(t,e);switch(t.mode){case"single":return n;case"multiple":return o;case"range":return s;default:return}}function Bo(t,e){return t instanceof Wn&&t.timeZone===e?t:new Wn(t,e)}function Ii(t,e,n){return Bo(t,e)}function M2(t,e,n){return typeof t=="boolean"||typeof t=="function"?t:t instanceof Date?Ii(t,e):Array.isArray(t)?t.map(o=>o instanceof Date?Ii(o,e):o):Eh(t)?{...t,from:t.from?Bo(t.from,e):t.from,to:t.to?Bo(t.to,e):t.to}:Zy(t)?{before:Ii(t.before,e),after:Ii(t.after,e)}:Jy(t)?{after:Ii(t.after,e)}:ev(t)?{before:Ii(t.before,e)}:t}function Sp(t,e,n){return t&&(Array.isArray(t)?t.map(o=>M2(o,e)):M2(t,e))}function AG(t){let e=t;const n=e.timeZone;if(n&&(e={...t,timeZone:n},e.today&&(e.today=Bo(e.today,n)),e.month&&(e.month=Bo(e.month,n)),e.defaultMonth&&(e.defaultMonth=Bo(e.defaultMonth,n)),e.startMonth&&(e.startMonth=Bo(e.startMonth,n)),e.endMonth&&(e.endMonth=Bo(e.endMonth,n)),e.mode==="single"&&e.selected?e.selected=Bo(e.selected,n):e.mode==="multiple"&&e.selected?e.selected=e.selected?.map(Fe=>Bo(Fe,n)):e.mode==="range"&&e.selected&&(e.selected={from:e.selected.from?Bo(e.selected.from,n):e.selected.from,to:e.selected.to?Bo(e.selected.to,n):e.selected.to}),e.disabled!==void 0&&(e.disabled=Sp(e.disabled,n)),e.hidden!==void 0&&(e.hidden=Sp(e.hidden,n)),e.modifiers)){const Fe={};Object.keys(e.modifiers).forEach(nt=>{Fe[nt]=Sp(e.modifiers?.[nt],n)}),e.modifiers=Fe}const{components:o,formatters:s,labels:i,dateLib:l,locale:u,classNames:d}=x.useMemo(()=>{const Fe={...zR,...e.locale},nt=e.broadcastCalendar?1:e.weekStartsOn,Ye=e.noonSafe&&e.timeZone?cG(e.timeZone,{weekStartsOn:nt,locale:Fe}):void 0,at=e.dateLib&&Ye?{...Ye,...e.dateLib}:e.dateLib??Ye,Lt=new _o({locale:Fe,weekStartsOn:nt,firstWeekContainsDate:e.firstWeekContainsDate,useAdditionalWeekYearTokens:e.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:e.useAdditionalDayOfYearTokens,timeZone:e.timeZone,numerals:e.numerals},at);return{dateLib:Lt,components:VY(e.components),formatters:JY(e.formatters),labels:rG(e.labels,Lt.options),locale:Fe,classNames:{...tv(),...e.classNames}}},[e.locale,e.broadcastCalendar,e.weekStartsOn,e.firstWeekContainsDate,e.useAdditionalWeekYearTokens,e.useAdditionalDayOfYearTokens,e.timeZone,e.numerals,e.dateLib,e.noonSafe,e.components,e.formatters,e.labels,e.classNames]);e.today||(e={...e,today:l.today()});const{captionLayout:f,mode:g,navLayout:m,numberOfMonths:y=1,onDayBlur:v,onDayClick:w,onDayFocus:C,onDayKeyDown:S,onDayMouseEnter:N,onDayMouseLeave:M,onNextClick:E,onPrevClick:R,showWeekNumber:D,styles:T}=e,{formatCaption:k,formatDay:O,formatMonthDropdown:L,formatWeekNumber:W,formatWeekNumberHeader:B,formatWeekdayName:Y,formatYearDropdown:q}=s,z=SG(e,l),{days:V,months:A,navStart:H,navEnd:P,previousMonth:F,nextMonth:Q,goToMonth:$}=z,I=BY(V,e,H,P,l),{isSelected:U,select:K,selected:J}=jG(e,l)??{},{blur:ne,focused:X,isFocusTarget:ee,moveFocus:se,setFocused:le}=_G(e,z,I,U??(()=>!1),l),{labelDayButton:pe,labelGridcell:ie,labelGrid:be,labelMonthDropdown:ke,labelNav:Be,labelPrevious:Ie,labelNext:lt,labelWeekday:cn,labelWeekNumber:ht,labelWeekNumberHeader:bn,labelYearDropdown:un}=i,Vt=x.useMemo(()=>iG(l,e.ISOWeek,e.broadcastCalendar,e.today),[l,e.ISOWeek,e.broadcastCalendar,e.today]),mn=g!==void 0||w!==void 0,It=x.useCallback(()=>{F&&($(F),R?.(F))},[F,$,R]),Mn=x.useCallback(()=>{Q&&($(Q),E?.(Q))},[$,Q,E]),yn=x.useCallback((Fe,nt)=>Ye=>{Ye.preventDefault(),Ye.stopPropagation(),le(Fe),!nt.disabled&&(K?.(Fe.date,nt,Ye),w?.(Fe.date,nt,Ye))},[K,w,le]),In=x.useCallback((Fe,nt)=>Ye=>{le(Fe),C?.(Fe.date,nt,Ye)},[C,le]),On=x.useCallback((Fe,nt)=>Ye=>{ne(),v?.(Fe.date,nt,Ye)},[ne,v]),_e=x.useCallback((Fe,nt)=>Ye=>{const at={ArrowLeft:[Ye.shiftKey?"month":"day",e.dir==="rtl"?"after":"before"],ArrowRight:[Ye.shiftKey?"month":"day",e.dir==="rtl"?"before":"after"],ArrowDown:[Ye.shiftKey?"year":"week","after"],ArrowUp:[Ye.shiftKey?"year":"week","before"],PageUp:[Ye.shiftKey?"year":"month","before"],PageDown:[Ye.shiftKey?"year":"month","after"],Home:["startOfWeek","before"],End:["endOfWeek","after"]};if(at[Ye.key]){Ye.preventDefault(),Ye.stopPropagation();const[Lt,De]=at[Ye.key];se(Lt,De)}S?.(Fe.date,nt,Ye)},[se,S,e.dir]),Ue=x.useCallback((Fe,nt)=>Ye=>{N?.(Fe.date,nt,Ye)},[N]),_t=x.useCallback((Fe,nt)=>Ye=>{M?.(Fe.date,nt,Ye)},[M]),Qe=x.useCallback(Fe=>nt=>{const Ye=Number(nt.target.value),at=l.setMonth(l.startOfMonth(Fe),Ye);$(at)},[l,$]),st=x.useCallback(Fe=>nt=>{const Ye=Number(nt.target.value),at=l.setYear(l.startOfMonth(Fe),Ye);$(at)},[l,$]),{className:gt,style:Wt}=x.useMemo(()=>({className:[d[Ge.Root],e.className].filter(Boolean).join(" "),style:{...T?.[Ge.Root],...e.style}}),[d,e.className,e.style,T]),Kt=UY(e),Zn=x.useRef(null);hG(Zn,!!e.animate,{classNames:d,months:A,focused:X,dateLib:l});const Nt={dayPickerProps:e,selected:J,select:K,isSelected:U,months:A,nextMonth:Q,previousMonth:F,goToMonth:$,getModifiers:I,components:o,classNames:d,styles:T,labels:i,formatters:s};return de.createElement(PR.Provider,{value:Nt},de.createElement(o.Root,{rootRef:e.animate?Zn:void 0,className:gt,style:Wt,dir:e.dir,id:e.id,lang:e.lang,nonce:e.nonce,title:e.title,role:e.role,"aria-label":e["aria-label"],"aria-labelledby":e["aria-labelledby"],...Kt},de.createElement(o.Months,{className:d[Ge.Months],style:T?.[Ge.Months]},!e.hideNavigation&&!m&&de.createElement(o.Nav,{"data-animated-nav":e.animate?"true":void 0,className:d[Ge.Nav],style:T?.[Ge.Nav],"aria-label":Be(),onPreviousClick:It,onNextClick:Mn,previousMonth:F,nextMonth:Q}),A.map((Fe,nt)=>de.createElement(o.Month,{"data-animated-month":e.animate?"true":void 0,className:d[Ge.Month],style:T?.[Ge.Month],key:nt,displayIndex:nt,calendarMonth:Fe},m==="around"&&!e.hideNavigation&&nt===0&&de.createElement(o.PreviousMonthButton,{type:"button",className:d[Ge.PreviousMonthButton],tabIndex:F?void 0:-1,"aria-disabled":F?void 0:!0,"aria-label":Ie(F),onClick:It,"data-animated-button":e.animate?"true":void 0},de.createElement(o.Chevron,{disabled:F?void 0:!0,className:d[Ge.Chevron],orientation:e.dir==="rtl"?"right":"left"})),de.createElement(o.MonthCaption,{"data-animated-caption":e.animate?"true":void 0,className:d[Ge.MonthCaption],style:T?.[Ge.MonthCaption],calendarMonth:Fe,displayIndex:nt},f?.startsWith("dropdown")?de.createElement(o.DropdownNav,{className:d[Ge.Dropdowns],style:T?.[Ge.Dropdowns]},(()=>{const Ye=f==="dropdown"||f==="dropdown-months"?de.createElement(o.MonthsDropdown,{key:"month",className:d[Ge.MonthsDropdown],"aria-label":ke(),classNames:d,components:o,disabled:!!e.disableNavigation,onChange:Qe(Fe.date),options:sG(Fe.date,H,P,s,l),style:T?.[Ge.Dropdown],value:l.getMonth(Fe.date)}):de.createElement("span",{key:"month"},L(Fe.date,l)),at=f==="dropdown"||f==="dropdown-years"?de.createElement(o.YearsDropdown,{key:"year",className:d[Ge.YearsDropdown],"aria-label":un(l.options),classNames:d,components:o,disabled:!!e.disableNavigation,onChange:st(Fe.date),options:lG(H,P,s,l,!!e.reverseYears),style:T?.[Ge.Dropdown],value:l.getYear(Fe.date)}):de.createElement("span",{key:"year"},q(Fe.date,l));return l.getMonthYearOrder()==="year-first"?[at,Ye]:[Ye,at]})(),de.createElement("span",{role:"status","aria-live":"polite",style:{border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"}},k(Fe.date,l.options,l))):de.createElement(o.CaptionLabel,{className:d[Ge.CaptionLabel],role:"status","aria-live":"polite"},k(Fe.date,l.options,l))),m==="around"&&!e.hideNavigation&&nt===y-1&&de.createElement(o.NextMonthButton,{type:"button",className:d[Ge.NextMonthButton],tabIndex:Q?void 0:-1,"aria-disabled":Q?void 0:!0,"aria-label":lt(Q),onClick:Mn,"data-animated-button":e.animate?"true":void 0},de.createElement(o.Chevron,{disabled:Q?void 0:!0,className:d[Ge.Chevron],orientation:e.dir==="rtl"?"left":"right"})),nt===y-1&&m==="after"&&!e.hideNavigation&&de.createElement(o.Nav,{"data-animated-nav":e.animate?"true":void 0,className:d[Ge.Nav],style:T?.[Ge.Nav],"aria-label":Be(),onPreviousClick:It,onNextClick:Mn,previousMonth:F,nextMonth:Q}),de.createElement(o.MonthGrid,{role:"grid","aria-multiselectable":g==="multiple"||g==="range","aria-label":be(Fe.date,l.options,l)||void 0,className:d[Ge.MonthGrid],style:T?.[Ge.MonthGrid]},!e.hideWeekdays&&de.createElement(o.Weekdays,{"data-animated-weekdays":e.animate?"true":void 0,className:d[Ge.Weekdays],style:T?.[Ge.Weekdays]},D&&de.createElement(o.WeekNumberHeader,{"aria-label":bn(l.options),className:d[Ge.WeekNumberHeader],style:T?.[Ge.WeekNumberHeader],scope:"col"},B()),Vt.map(Ye=>de.createElement(o.Weekday,{"aria-label":cn(Ye,l.options,l),className:d[Ge.Weekday],key:String(Ye),style:T?.[Ge.Weekday],scope:"col"},Y(Ye,l.options,l)))),de.createElement(o.Weeks,{"data-animated-weeks":e.animate?"true":void 0,className:d[Ge.Weeks],style:T?.[Ge.Weeks]},Fe.weeks.map(Ye=>de.createElement(o.Week,{className:d[Ge.Week],key:Ye.weekNumber,style:T?.[Ge.Week],week:Ye},D&&de.createElement(o.WeekNumber,{week:Ye,style:T?.[Ge.WeekNumber],"aria-label":ht(Ye.weekNumber,{locale:u}),className:d[Ge.WeekNumber],scope:"row",role:"rowheader"},W(Ye.weekNumber,l)),Ye.days.map(at=>{const{date:Lt}=at,De=I(at);if(De[hn.focused]=!De.hidden&&!!X?.isEqualTo(at),De[tr.selected]=U?.(Lt)||De.selected,Eh(J)){const{from:Pn,to:Tt}=J;De[tr.range_start]=!!(Pn&&Tt&&l.isSameDay(Lt,Pn)),De[tr.range_end]=!!(Pn&&Tt&&l.isSameDay(Lt,Tt)),De[tr.range_middle]=as(J,Lt,!0,l)}const At=aG(De,T,e.modifiersStyles),Xt=FY(De,d,e.modifiersClassNames),dn=!mn&&!De.hidden?ie(Lt,De,l.options,l):void 0;return de.createElement(o.Day,{key:`${at.isoDate}_${at.displayMonthId}`,day:at,modifiers:De,className:Xt.join(" "),style:At,role:"gridcell","aria-selected":De.selected||void 0,"aria-label":dn,"data-day":at.isoDate,"data-month":at.outside?at.dateMonthId:void 0,"data-selected":De.selected||void 0,"data-disabled":De.disabled||void 0,"data-hidden":De.hidden||void 0,"data-outside":at.outside||void 0,"data-focused":De.focused||void 0,"data-today":De.today||void 0},!De.hidden&&mn?de.createElement(o.DayButton,{className:d[Ge.DayButton],style:T?.[Ge.DayButton],type:"button",day:at,modifiers:De,disabled:!De.focused&&De.disabled||void 0,"aria-disabled":De.focused&&De.disabled||void 0,tabIndex:ee(at)?0:-1,"aria-label":pe(Lt,De,l.options,l),onClick:yn(at,De),onBlur:On(at,De),onFocus:In(at,De),onKeyDown:_e(at,De),onMouseEnter:Ue(at,De),onMouseLeave:_t(at,De)},O(Lt,l.options,l)):!De.hidden&&O(at.date,l.options,l))})))))))),e.footer&&de.createElement(o.Footer,{className:d[Ge.Footer],style:T?.[Ge.Footer],role:"status","aria-live":"polite"},e.footer)))}function OG({className:t,classNames:e,showOutsideDays:n=!0,captionLayout:o="label",buttonVariant:s="ghost",locale:i,formatters:l,components:u,...d}){const f=tv();return p.jsx(AG,{showOutsideDays:n,className:Ne("p-3 [--cell-radius:var(--radius-md)] [--cell-size:--spacing(8)] bg-background group/calendar [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,t),captionLayout:o,locale:i,formatters:{formatMonthDropdown:g=>g.toLocaleString(i?.code,{month:"short"}),...l},classNames:{root:Ne("w-fit",f.root),months:Ne("flex gap-4 flex-col md:flex-row relative",f.months),month:Ne("flex flex-col w-full gap-4",f.month),nav:Ne("flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between",f.nav),button_previous:Ne(Jp({variant:s}),"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",f.button_previous),button_next:Ne(Jp({variant:s}),"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",f.button_next),month_caption:Ne("flex items-center justify-center h-(--cell-size) w-full px-(--cell-size)",f.month_caption),dropdowns:Ne("w-full flex items-center text-sm font-medium justify-center h-(--cell-size) gap-1.5",f.dropdowns),dropdown_root:Ne("relative rounded-(--cell-radius)",f.dropdown_root),dropdown:Ne("absolute bg-popover inset-0 opacity-0",f.dropdown),caption_label:Ne("select-none font-medium",o==="label"?"text-sm":"rounded-(--cell-radius) flex items-center gap-1 text-sm [&>svg]:text-muted-foreground [&>svg]:size-3.5",f.caption_label),table:"w-full border-collapse",weekdays:Ne("flex",f.weekdays),weekday:Ne("text-muted-foreground rounded-(--cell-radius) flex-1 font-normal text-[0.8rem] select-none",f.weekday),week:Ne("flex w-full mt-2",f.week),week_number_header:Ne("select-none w-(--cell-size)",f.week_number_header),week_number:Ne("text-[0.8rem] select-none text-muted-foreground",f.week_number),day:Ne("relative w-full rounded-(--cell-radius) h-full p-0 text-center [&:last-child[data-selected=true]_button]:rounded-r-(--cell-radius) group/day aspect-square select-none",d.showWeekNumber?"[&:nth-child(2)[data-selected=true]_button]:rounded-l-(--cell-radius)":"[&:first-child[data-selected=true]_button]:rounded-l-(--cell-radius)",f.day),range_start:Ne("rounded-l-(--cell-radius) bg-muted relative after:bg-muted after:absolute after:inset-y-0 after:w-4 after:right-0 -z-0 isolate",f.range_start),range_middle:Ne("rounded-none",f.range_middle),range_end:Ne("rounded-r-(--cell-radius) bg-muted relative after:bg-muted after:absolute after:inset-y-0 after:w-4 after:left-0 -z-0 isolate",f.range_end),today:Ne("bg-muted text-foreground rounded-(--cell-radius) data-[selected=true]:rounded-none",f.today),outside:Ne("text-muted-foreground aria-selected:text-muted-foreground",f.outside),disabled:Ne("text-muted-foreground opacity-50",f.disabled),hidden:Ne("invisible",f.hidden),...e},components:{Root:({className:g,rootRef:m,...y})=>p.jsx("div",{"data-slot":"calendar",ref:m,className:Ne(g),...y}),Chevron:({className:g,orientation:m,...y})=>m==="left"?p.jsx(dy,{className:Ne("size-4",g),...y}):m==="right"?p.jsx(vN,{className:Ne("size-4",g),...y}):p.jsx(ms,{className:Ne("size-4",g),...y}),DayButton:({...g})=>p.jsx(zG,{locale:i,...g}),WeekNumber:({children:g,...m})=>p.jsx("td",{...m,children:p.jsx("div",{className:"flex size-(--cell-size) items-center justify-center text-center",children:g})}),...u},...d})}function zG(t){const e=ge.c(21);let n,o,s,i,l;e[0]!==t?({className:n,day:o,modifiers:i,locale:s,...l}=t,e[0]=t,e[1]=n,e[2]=o,e[3]=s,e[4]=i,e[5]=l):(n=e[1],o=e[2],s=e[3],i=e[4],l=e[5]);const u=tv(),d=x.useRef(null);let f,g;e[6]!==i.focused?(f=()=>{i.focused&&d.current?.focus()},g=[i.focused],e[6]=i.focused,e[7]=f,e[8]=g):(f=e[7],g=e[8]),x.useEffect(f,g);const m=St,y="ghost",v="icon";let w;e[9]!==o.date||e[10]!==s?.code?(w=o.date.toLocaleDateString(s?.code),e[9]=o.date,e[10]=s?.code,e[11]=w):w=e[11];const C=i.selected&&!i.range_start&&!i.range_end&&!i.range_middle,S=i.range_start,N=i.range_end,M=i.range_middle,E=Ne("data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-muted data-[range-middle=true]:text-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 dark:hover:text-foreground relative isolate z-10 flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 border-0 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] data-[range-end=true]:rounded-(--cell-radius) data-[range-end=true]:rounded-r-(--cell-radius) data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-(--cell-radius) data-[range-start=true]:rounded-l-(--cell-radius) [&>span]:text-xs [&>span]:opacity-70",u.day,n);let R;return e[12]!==m||e[13]!==i.range_end||e[14]!==i.range_middle||e[15]!==i.range_start||e[16]!==l||e[17]!==E||e[18]!==w||e[19]!==C?(R=p.jsx(m,{ref:d,variant:y,size:v,"data-day":w,"data-selected-single":C,"data-range-start":S,"data-range-end":N,"data-range-middle":M,className:E,...l}),e[12]=m,e[13]=i.range_end,e[14]=i.range_middle,e[15]=i.range_start,e[16]=l,e[17]=E,e[18]=w,e[19]=C,e[20]=R):R=e[20],R}var R2=1,IG=.9,PG=.8,$G=.17,Cp=.1,Ep=.999,LG=.9999,HG=.99,BG=/[\\\/_+.#"@\[\(\{&]/,FG=/[\\\/_+.#"@\[\(\{&]/g,VG=/[\s-]/,ZR=/[\s-]/g;function x0(t,e,n,o,s,i,l){if(i===e.length)return s===t.length?R2:HG;var u=`${s},${i}`;if(l[u]!==void 0)return l[u];for(var d=o.charAt(i),f=n.indexOf(d,s),g=0,m,y,v,w;f>=0;)m=x0(t,e,n,o,f+1,i+1,l),m>g&&(f===s?m*=R2:BG.test(t.charAt(f-1))?(m*=PG,v=t.slice(s,f-1).match(FG),v&&s>0&&(m*=Math.pow(Ep,v.length))):VG.test(t.charAt(f-1))?(m*=IG,w=t.slice(s,f-1).match(ZR),w&&s>0&&(m*=Math.pow(Ep,w.length))):(m*=$G,s>0&&(m*=Math.pow(Ep,f-s))),t.charAt(f)!==e.charAt(i)&&(m*=LG)),(m<Cp&&n.charAt(f-1)===o.charAt(i+1)||o.charAt(i+1)===o.charAt(i)&&n.charAt(f-1)!==o.charAt(i))&&(y=x0(t,e,n,o,f+1,i+2,l),y*Cp>m&&(m=y*Cp)),m>g&&(g=m),f=n.indexOf(d,f+1);return l[u]=g,g}function D2(t){return t.toLowerCase().replace(ZR," ")}function UG(t,e,n){return t=n&&n.length>0?`${t+" "+n.join(" ")}`:t,x0(t,e,D2(t),D2(e),0,0,{})}var xc='[cmdk-group=""]',_p='[cmdk-group-items=""]',YG='[cmdk-group-heading=""]',JR='[cmdk-item=""]',T2=`${JR}:not([aria-disabled="true"])`,b0="cmdk-item-select",Hi="data-value",GG=(t,e,n)=>UG(t,e,n),e3=x.createContext(void 0),xu=()=>x.useContext(e3),t3=x.createContext(void 0),rv=()=>x.useContext(t3),n3=x.createContext(void 0),o3=x.forwardRef((t,e)=>{let n=Bi(()=>{var I,U;return{search:"",value:(U=(I=t.value)!=null?I:t.defaultValue)!=null?U:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),o=Bi(()=>new Set),s=Bi(()=>new Map),i=Bi(()=>new Map),l=Bi(()=>new Set),u=r3(t),{label:d,children:f,value:g,onValueChange:m,filter:y,shouldFilter:v,loop:w,disablePointerSelection:C=!1,vimBindings:S=!0,...N}=t,M=Vn(),E=Vn(),R=Vn(),D=x.useRef(null),T=oq();Ga(()=>{if(g!==void 0){let I=g.trim();n.current.value=I,k.emit()}},[g]),Ga(()=>{T(6,q)},[]);let k=x.useMemo(()=>({subscribe:I=>(l.current.add(I),()=>l.current.delete(I)),snapshot:()=>n.current,setState:(I,U,K)=>{var J,ne,X,ee;if(!Object.is(n.current[I],U)){if(n.current[I]=U,I==="search")Y(),W(),T(1,B);else if(I==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let se=document.getElementById(R);se?se.focus():(J=document.getElementById(M))==null||J.focus()}if(T(7,()=>{var se;n.current.selectedItemId=(se=z())==null?void 0:se.id,k.emit()}),K||T(5,q),((ne=u.current)==null?void 0:ne.value)!==void 0){let se=U??"";(ee=(X=u.current).onValueChange)==null||ee.call(X,se);return}}k.emit()}},emit:()=>{l.current.forEach(I=>I())}}),[]),O=x.useMemo(()=>({value:(I,U,K)=>{var J;U!==((J=i.current.get(I))==null?void 0:J.value)&&(i.current.set(I,{value:U,keywords:K}),n.current.filtered.items.set(I,L(U,K)),T(2,()=>{W(),k.emit()}))},item:(I,U)=>(o.current.add(I),U&&(s.current.has(U)?s.current.get(U).add(I):s.current.set(U,new Set([I]))),T(3,()=>{Y(),W(),n.current.value||B(),k.emit()}),()=>{i.current.delete(I),o.current.delete(I),n.current.filtered.items.delete(I);let K=z();T(4,()=>{Y(),K?.getAttribute("id")===I&&B(),k.emit()})}),group:I=>(s.current.has(I)||s.current.set(I,new Set),()=>{i.current.delete(I),s.current.delete(I)}),filter:()=>u.current.shouldFilter,label:d||t["aria-label"],getDisablePointerSelection:()=>u.current.disablePointerSelection,listId:M,inputId:R,labelId:E,listInnerRef:D}),[]);function L(I,U){var K,J;let ne=(J=(K=u.current)==null?void 0:K.filter)!=null?J:GG;return I?ne(I,n.current.search,U):0}function W(){if(!n.current.search||u.current.shouldFilter===!1)return;let I=n.current.filtered.items,U=[];n.current.filtered.groups.forEach(J=>{let ne=s.current.get(J),X=0;ne.forEach(ee=>{let se=I.get(ee);X=Math.max(se,X)}),U.push([J,X])});let K=D.current;V().sort((J,ne)=>{var X,ee;let se=J.getAttribute("id"),le=ne.getAttribute("id");return((X=I.get(le))!=null?X:0)-((ee=I.get(se))!=null?ee:0)}).forEach(J=>{let ne=J.closest(_p);ne?ne.appendChild(J.parentElement===ne?J:J.closest(`${_p} > *`)):K.appendChild(J.parentElement===K?J:J.closest(`${_p} > *`))}),U.sort((J,ne)=>ne[1]-J[1]).forEach(J=>{var ne;let X=(ne=D.current)==null?void 0:ne.querySelector(`${xc}[${Hi}="${encodeURIComponent(J[0])}"]`);X?.parentElement.appendChild(X)})}function B(){let I=V().find(K=>K.getAttribute("aria-disabled")!=="true"),U=I?.getAttribute(Hi);k.setState("value",U||void 0)}function Y(){var I,U,K,J;if(!n.current.search||u.current.shouldFilter===!1){n.current.filtered.count=o.current.size;return}n.current.filtered.groups=new Set;let ne=0;for(let X of o.current){let ee=(U=(I=i.current.get(X))==null?void 0:I.value)!=null?U:"",se=(J=(K=i.current.get(X))==null?void 0:K.keywords)!=null?J:[],le=L(ee,se);n.current.filtered.items.set(X,le),le>0&&ne++}for(let[X,ee]of s.current)for(let se of ee)if(n.current.filtered.items.get(se)>0){n.current.filtered.groups.add(X);break}n.current.filtered.count=ne}function q(){var I,U,K;let J=z();J&&(((I=J.parentElement)==null?void 0:I.firstChild)===J&&((K=(U=J.closest(xc))==null?void 0:U.querySelector(YG))==null||K.scrollIntoView({block:"nearest"})),J.scrollIntoView({block:"nearest"}))}function z(){var I;return(I=D.current)==null?void 0:I.querySelector(`${JR}[aria-selected="true"]`)}function V(){var I;return Array.from(((I=D.current)==null?void 0:I.querySelectorAll(T2))||[])}function A(I){let U=V()[I];U&&k.setState("value",U.getAttribute(Hi))}function H(I){var U;let K=z(),J=V(),ne=J.findIndex(ee=>ee===K),X=J[ne+I];(U=u.current)!=null&&U.loop&&(X=ne+I<0?J[J.length-1]:ne+I===J.length?J[0]:J[ne+I]),X&&k.setState("value",X.getAttribute(Hi))}function P(I){let U=z(),K=U?.closest(xc),J;for(;K&&!J;)K=I>0?tq(K,xc):nq(K,xc),J=K?.querySelector(T2);J?k.setState("value",J.getAttribute(Hi)):H(I)}let F=()=>A(V().length-1),Q=I=>{I.preventDefault(),I.metaKey?F():I.altKey?P(1):H(1)},$=I=>{I.preventDefault(),I.metaKey?A(0):I.altKey?P(-1):H(-1)};return x.createElement(tt.div,{ref:e,tabIndex:-1,...N,"cmdk-root":"",onKeyDown:I=>{var U;(U=N.onKeyDown)==null||U.call(N,I);let K=I.nativeEvent.isComposing||I.keyCode===229;if(!(I.defaultPrevented||K))switch(I.key){case"n":case"j":{S&&I.ctrlKey&&Q(I);break}case"ArrowDown":{Q(I);break}case"p":case"k":{S&&I.ctrlKey&&$(I);break}case"ArrowUp":{$(I);break}case"Home":{I.preventDefault(),A(0);break}case"End":{I.preventDefault(),F();break}case"Enter":{I.preventDefault();let J=z();if(J){let ne=new Event(b0);J.dispatchEvent(ne)}}}}},x.createElement("label",{"cmdk-label":"",htmlFor:O.inputId,id:O.labelId,style:sq},d),Nh(t,I=>x.createElement(t3.Provider,{value:k},x.createElement(e3.Provider,{value:O},I))))}),qG=x.forwardRef((t,e)=>{var n,o;let s=Vn(),i=x.useRef(null),l=x.useContext(n3),u=xu(),d=r3(t),f=(o=(n=d.current)==null?void 0:n.forceMount)!=null?o:l?.forceMount;Ga(()=>{if(!f)return u.item(s,l?.id)},[f]);let g=s3(s,i,[t.value,t.children,i],t.keywords),m=rv(),y=sa(T=>T.value&&T.value===g.current),v=sa(T=>f||u.filter()===!1?!0:T.search?T.filtered.items.get(s)>0:!0);x.useEffect(()=>{let T=i.current;if(!(!T||t.disabled))return T.addEventListener(b0,w),()=>T.removeEventListener(b0,w)},[v,t.onSelect,t.disabled]);function w(){var T,k;C(),(k=(T=d.current).onSelect)==null||k.call(T,g.current)}function C(){m.setState("value",g.current,!0)}if(!v)return null;let{disabled:S,value:N,onSelect:M,forceMount:E,keywords:R,...D}=t;return x.createElement(tt.div,{ref:ds(i,e),...D,id:s,"cmdk-item":"",role:"option","aria-disabled":!!S,"aria-selected":!!y,"data-disabled":!!S,"data-selected":!!y,onPointerMove:S||u.getDisablePointerSelection()?void 0:C,onClick:S?void 0:w},t.children)}),WG=x.forwardRef((t,e)=>{let{heading:n,children:o,forceMount:s,...i}=t,l=Vn(),u=x.useRef(null),d=x.useRef(null),f=Vn(),g=xu(),m=sa(v=>s||g.filter()===!1?!0:v.search?v.filtered.groups.has(l):!0);Ga(()=>g.group(l),[]),s3(l,u,[t.value,t.heading,d]);let y=x.useMemo(()=>({id:l,forceMount:s}),[s]);return x.createElement(tt.div,{ref:ds(u,e),...i,"cmdk-group":"",role:"presentation",hidden:m?void 0:!0},n&&x.createElement("div",{ref:d,"cmdk-group-heading":"","aria-hidden":!0,id:f},n),Nh(t,v=>x.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?f:void 0},x.createElement(n3.Provider,{value:y},v))))}),KG=x.forwardRef((t,e)=>{let{alwaysRender:n,...o}=t,s=x.useRef(null),i=sa(l=>!l.search);return!n&&!i?null:x.createElement(tt.div,{ref:ds(s,e),...o,"cmdk-separator":"",role:"separator"})}),XG=x.forwardRef((t,e)=>{let{onValueChange:n,...o}=t,s=t.value!=null,i=rv(),l=sa(f=>f.search),u=sa(f=>f.selectedItemId),d=xu();return x.useEffect(()=>{t.value!=null&&i.setState("search",t.value)},[t.value]),x.createElement(tt.input,{ref:e,...o,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":d.listId,"aria-labelledby":d.labelId,"aria-activedescendant":u,id:d.inputId,type:"text",value:s?t.value:l,onChange:f=>{s||i.setState("search",f.target.value),n?.(f.target.value)}})}),QG=x.forwardRef((t,e)=>{let{children:n,label:o="Suggestions",...s}=t,i=x.useRef(null),l=x.useRef(null),u=sa(f=>f.selectedItemId),d=xu();return x.useEffect(()=>{if(l.current&&i.current){let f=l.current,g=i.current,m,y=new ResizeObserver(()=>{m=requestAnimationFrame(()=>{let v=f.offsetHeight;g.style.setProperty("--cmdk-list-height",v.toFixed(1)+"px")})});return y.observe(f),()=>{cancelAnimationFrame(m),y.unobserve(f)}}},[]),x.createElement(tt.div,{ref:ds(i,e),...s,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":u,"aria-label":o,id:d.listId},Nh(t,f=>x.createElement("div",{ref:ds(l,d.listInnerRef),"cmdk-list-sizer":""},f)))}),ZG=x.forwardRef((t,e)=>{let{open:n,onOpenChange:o,overlayClassName:s,contentClassName:i,container:l,...u}=t;return x.createElement(L0,{open:n,onOpenChange:o},x.createElement(H0,{container:l},x.createElement(B0,{"cmdk-overlay":"",className:s}),x.createElement(F0,{"aria-label":t.label,"cmdk-dialog":"",className:i},x.createElement(o3,{ref:e,...u}))))}),JG=x.forwardRef((t,e)=>sa(n=>n.filtered.count===0)?x.createElement(tt.div,{ref:e,...t,"cmdk-empty":"",role:"presentation"}):null),eq=x.forwardRef((t,e)=>{let{progress:n,children:o,label:s="Loading...",...i}=t;return x.createElement(tt.div,{ref:e,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},Nh(t,l=>x.createElement("div",{"aria-hidden":!0},l)))}),Xa=Object.assign(o3,{List:QG,Item:qG,Input:XG,Group:WG,Separator:KG,Dialog:ZG,Empty:JG,Loading:eq});function tq(t,e){let n=t.nextElementSibling;for(;n;){if(n.matches(e))return n;n=n.nextElementSibling}}function nq(t,e){let n=t.previousElementSibling;for(;n;){if(n.matches(e))return n;n=n.previousElementSibling}}function r3(t){let e=x.useRef(t);return Ga(()=>{e.current=t}),e}var Ga=typeof window>"u"?x.useEffect:x.useLayoutEffect;function Bi(t){let e=x.useRef();return e.current===void 0&&(e.current=t()),e}function sa(t){let e=rv(),n=()=>t(e.snapshot());return x.useSyncExternalStore(e.subscribe,n,n)}function s3(t,e,n,o=[]){let s=x.useRef(),i=xu();return Ga(()=>{var l;let u=(()=>{var f;for(let g of n){if(typeof g=="string")return g.trim();if(typeof g=="object"&&"current"in g)return g.current?(f=g.current.textContent)==null?void 0:f.trim():s.current}})(),d=o.map(f=>f.trim());i.value(t,u,d),(l=e.current)==null||l.setAttribute(Hi,u),s.current=u}),s}var oq=()=>{let[t,e]=x.useState(),n=Bi(()=>new Map);return Ga(()=>{n.current.forEach(o=>o()),n.current=new Map},[t]),(o,s)=>{n.current.set(o,s),e({})}};function rq(t){let e=t.type;return typeof e=="function"?e(t.props):"render"in e?e.render(t.props):t}function Nh({asChild:t,children:e},n){return t&&x.isValidElement(e)?x.cloneElement(rq(e),{ref:e.ref},n(e.props.children)):n(e)}var sq={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function a3(t){const e=ge.c(8);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let s;e[3]!==n?(s=Ne("border-input dark:bg-input/30 focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 rounded-md border bg-transparent px-2.5 py-2 text-base shadow-xs transition-[color,box-shadow] focus-visible:ring-[3px] aria-invalid:ring-[3px] md:text-sm placeholder:text-muted-foreground flex field-sizing-content min-h-16 w-full outline-none disabled:cursor-not-allowed disabled:opacity-50",n),e[3]=n,e[4]=s):s=e[4];let i;return e[5]!==o||e[6]!==s?(i=p.jsx("textarea",{"data-slot":"textarea",className:s,...o}),e[5]=o,e[6]=s,e[7]=i):i=e[7],i}function aq(t){const e=ge.c(8);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let s;e[3]!==n?(s=Ne("border-input dark:bg-input/30 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[[data-slot][aria-invalid=true]]:border-destructive dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 h-9 rounded-md border shadow-xs transition-[color,box-shadow] has-[[data-slot=input-group-control]:focus-visible]:ring-[3px] has-[[data-slot][aria-invalid=true]]:ring-[3px] has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5 [[data-slot=combobox-content]_&]:focus-within:border-inherit [[data-slot=combobox-content]_&]:focus-within:ring-0 group/input-group relative flex w-full min-w-0 items-center outline-none has-[>textarea]:h-auto",n),e[3]=n,e[4]=s):s=e[4];let i;return e[5]!==o||e[6]!==s?(i=p.jsx("div",{"data-slot":"input-group",role:"group",className:s,...o}),e[5]=o,e[6]=s,e[7]=i):i=e[7],i}const iq=zf("text-muted-foreground h-auto gap-2 py-1.5 text-sm font-medium group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4 flex cursor-text items-center justify-center select-none",{variants:{align:{"inline-start":"pl-2 has-[>button]:ml-[-0.25rem] has-[>kbd]:ml-[-0.15rem] order-first","inline-end":"pr-2 has-[>button]:mr-[-0.25rem] has-[>kbd]:mr-[-0.15rem] order-last","block-start":"px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2 order-first w-full justify-start","block-end":"px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2 order-last w-full justify-start"}},defaultVariants:{align:"inline-start"}});function lq(t){const e=ge.c(11);let n,o,s;e[0]!==t?({className:n,align:s,...o}=t,e[0]=t,e[1]=n,e[2]=o,e[3]=s):(n=e[1],o=e[2],s=e[3]);const i=s===void 0?"inline-start":s;let l;e[4]!==i||e[5]!==n?(l=Ne(iq({align:i}),n),e[4]=i,e[5]=n,e[6]=l):l=e[6];let u;return e[7]!==i||e[8]!==o||e[9]!==l?(u=p.jsx("div",{role:"group","data-slot":"input-group-addon","data-align":i,className:l,onClick:cq,...o}),e[7]=i,e[8]=o,e[9]=l,e[10]=u):u=e[10],u}function cq(t){t.target.closest("button")||t.currentTarget.parentElement?.querySelector("input")?.focus()}function uq(t){const e=ge.c(8);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let s;e[3]!==n?(s=Ne("bg-popover text-popover-foreground rounded-xl! p-1 flex size-full flex-col overflow-hidden",n),e[3]=n,e[4]=s):s=e[4];let i;return e[5]!==o||e[6]!==s?(i=p.jsx(Xa,{"data-slot":"command",className:s,...o}),e[5]=o,e[6]=s,e[7]=i):i=e[7],i}function dq(t){const e=ge.c(11);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let s;e[3]!==n?(s=Ne("w-full text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",n),e[3]=n,e[4]=s):s=e[4];let i;e[5]!==o||e[6]!==s?(i=p.jsx(Xa.Input,{"data-slot":"command-input",className:s,...o}),e[5]=o,e[6]=s,e[7]=i):i=e[7];let l;e[8]===Symbol.for("react.memo_cache_sentinel")?(l=p.jsx(lq,{children:p.jsx(iu,{className:"size-4 shrink-0 opacity-50"})}),e[8]=l):l=e[8];let u;return e[9]!==i?(u=p.jsx("div",{"data-slot":"command-input-wrapper",className:"p-1 pb-0",children:p.jsxs(aq,{className:"bg-input/30 border-input/30 h-8! rounded-lg! shadow-none! *:data-[slot=input-group-addon]:pl-2!",children:[i,l]})}),e[9]=i,e[10]=u):u=e[10],u}function fq(t){const e=ge.c(8);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let s;e[3]!==n?(s=Ne("no-scrollbar max-h-72 scroll-py-1 outline-none overflow-x-hidden overflow-y-auto",n),e[3]=n,e[4]=s):s=e[4];let i;return e[5]!==o||e[6]!==s?(i=p.jsx(Xa.List,{"data-slot":"command-list",className:s,...o}),e[5]=o,e[6]=s,e[7]=i):i=e[7],i}function hq(t){const e=ge.c(8);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let s;e[3]!==n?(s=Ne("py-6 text-center text-sm",n),e[3]=n,e[4]=s):s=e[4];let i;return e[5]!==o||e[6]!==s?(i=p.jsx(Xa.Empty,{"data-slot":"command-empty",className:s,...o}),e[5]=o,e[6]=s,e[7]=i):i=e[7],i}function k2(t){const e=ge.c(8);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let s;e[3]!==n?(s=Ne("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",n),e[3]=n,e[4]=s):s=e[4];let i;return e[5]!==o||e[6]!==s?(i=p.jsx(Xa.Group,{"data-slot":"command-group",className:s,...o}),e[5]=o,e[6]=s,e[7]=i):i=e[7],i}function mq(t){const e=ge.c(8);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let s;e[3]!==n?(s=Ne("bg-border -mx-1 h-px w-auto",n),e[3]=n,e[4]=s):s=e[4];let i;return e[5]!==o||e[6]!==s?(i=p.jsx(Xa.Separator,{"data-slot":"command-separator",className:s,...o}),e[5]=o,e[6]=s,e[7]=i):i=e[7],i}function j2(t){const e=ge.c(11);let n,o,s;e[0]!==t?({className:o,children:n,...s}=t,e[0]=t,e[1]=n,e[2]=o,e[3]=s):(n=e[1],o=e[2],s=e[3]);let i;e[4]!==o?(i=Ne("data-selected:bg-muted data-selected:text-foreground data-selected:**:[svg]:text-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none [&_svg:not([class*='size-'])]:size-4 [[data-slot=dialog-content]_&]:rounded-lg! group/command-item data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",o),e[4]=o,e[5]=i):i=e[5];let l;e[6]===Symbol.for("react.memo_cache_sentinel")?(l=p.jsx(da,{className:"ml-auto opacity-0 group-has-[[data-slot=command-shortcut]]/command-item:hidden group-data-[checked=true]/command-item:opacity-100"}),e[6]=l):l=e[6];let u;return e[7]!==n||e[8]!==s||e[9]!==i?(u=p.jsxs(Xa.Item,{"data-slot":"command-item",className:i,...s,children:[n,l]}),e[7]=n,e[8]=s,e[9]=i,e[10]=u):u=e[10],u}const A2=new Map,gq=16,pq=4,yq=40;function vq({label:t,cacheKey:e,iconSize:n,maxWidth:o,className:s}){const i=A2.get(e);if(i!==void 0)return i;const l=document.createElement("div");if(l.className=`inline-flex items-center rounded-md border px-1.5 text-xs font-semibold h-5 gap-1 shrink-0 absolute invisible pointer-events-none ${s??""}`,l.style.whiteSpace="nowrap",n){const d=document.createElement("span");d.className="shrink-0",d.style.width=`${n}px`,d.style.height=`${n}px`,l.appendChild(d)}if(o){const d=document.createElement("span");d.className="truncate",d.style.maxWidth=`${o}px`,d.textContent=t,l.appendChild(d)}else l.textContent=t;document.body.appendChild(l);const u=l.offsetWidth;return document.body.removeChild(l),A2.set(e,u),u}function i3(t){const e=ge.c(25),{items:n,getLabel:o,containerRef:s,lineCount:i,cacheKeyPrefix:l,containerPadding:u,badgeGap:d,overflowBadgeWidth:f,iconSize:g,maxWidth:m,className:y}=t,v=l===void 0?"":l,w=u===void 0?gq:u,C=d===void 0?pq:d,S=f===void 0?yq:f,[N,M]=x.useState(0);let E,R;e[0]!==w||e[1]!==s?(E=()=>{if(!s.current)return;const k=function(){if(s.current){const W=s.current.clientWidth-w;M(W)}};k();const O=new ResizeObserver(k);return O.observe(s.current),()=>{O.disconnect()}},R=[s,w],e[0]=w,e[1]=s,e[2]=E,e[3]=R):(E=e[2],R=e[3]),x.useEffect(E,R);let D;e:{if(!N||n.length===0){let Y;e[4]!==N||e[5]!==n?(Y={visibleItems:n,hiddenCount:0,containerWidth:N},e[4]=N,e[5]=n,e[6]=Y):Y=e[6],D=Y;break e}let k=0,O=1,L;if(e[7]!==C||e[8]!==v||e[9]!==y||e[10]!==N||e[11]!==O||e[12]!==k||e[13]!==o||e[14]!==g||e[15]!==n||e[16]!==i||e[17]!==m||e[18]!==S){L=[];for(const Y of n){const q=o(Y),z=v?`${v}:${q}`:q,A=vq({label:q,cacheKey:z,iconSize:g,maxWidth:m,className:y})+C;if(k+A<=N)k=k+A,L.push(Y);else if(O<i)O++,k=A,L.push(Y);else{k+S>N&&L.length>0&&L.pop();break}}e[7]=C,e[8]=v,e[9]=y,e[10]=N,e[11]=O,e[12]=k,e[13]=o,e[14]=g,e[15]=n,e[16]=i,e[17]=m,e[18]=S,e[19]=L,e[20]=k}else L=e[19],k=e[20];const W=Math.max(0,n.length-L.length);let B;e[21]!==N||e[22]!==W||e[23]!==L?(B={visibleItems:L,hiddenCount:W,containerWidth:N},e[21]=N,e[22]=W,e[23]=L,e[24]=B):B=e[24],D=B}return D}function xq(t){const e=ge.c(3),n=x.useRef(t);let o;e[0]!==t?(o=()=>{n.current=t},e[0]=t,e[1]=o):o=e[1],x.useEffect(o);let s;return e[2]===Symbol.for("react.memo_cache_sentinel")?(s=(...i)=>{const l=i;return n.current?.(...l)},e[2]=s):s=e[2],s}function l3(t,e){const n=ge.c(5),o=xq(t),s=x.useRef(0);let i,l;n[0]===Symbol.for("react.memo_cache_sentinel")?(i=()=>()=>window.clearTimeout(s.current),l=[],n[0]=i,n[1]=l):(i=n[0],l=n[1]),x.useEffect(i,l);let u;return n[2]!==e||n[3]!==o?(u=(...f)=>{const g=f;window.clearTimeout(s.current),s.current=window.setTimeout(()=>o(...g),e)},n[2]=e,n[3]=o,n[4]=u):u=n[4],u}function c3(t){return t==null?"":typeof t=="object"?JSON.stringify(t):String(t)}function O2({cell:t,tableMeta:e,rowIndex:n,columnId:o,rowHeight:s,isEditing:i,isFocused:l,isSelected:u,isSearchMatch:d,isActiveSearchMatch:f,readOnly:g}){const m=c3(t.getValue()),[y,v]=x.useState(m),w=x.useRef(null),C=x.useRef(null),S=x.useRef(m);m!==S.current&&(S.current=m,v(m),w.current&&!i&&(w.current.textContent=m));const N=x.useCallback(()=>{const D=w.current?.textContent??"";!g&&D!==m&&e?.onDataUpdate?.({rowIndex:n,columnId:o,value:D}),e?.onCellEditingStop?.()},[e,n,o,m,g]),M=x.useCallback(D=>{const T=D.currentTarget.textContent??"";v(T)},[]),E=x.useCallback(D=>{if(i)if(D.key==="Enter"){D.preventDefault();const T=w.current?.textContent??"";T!==m&&e?.onDataUpdate?.({rowIndex:n,columnId:o,value:T}),e?.onCellEditingStop?.({moveToNextRow:!0})}else if(D.key==="Tab"){D.preventDefault();const T=w.current?.textContent??"";T!==m&&e?.onDataUpdate?.({rowIndex:n,columnId:o,value:T}),e?.onCellEditingStop?.({direction:D.shiftKey?"left":"right"})}else D.key==="Escape"&&(D.preventDefault(),v(m),w.current?.blur());else l&&D.key.length===1&&!D.ctrlKey&&!D.metaKey&&(v(D.key),queueMicrotask(()=>{if(w.current&&w.current.contentEditable==="true"){w.current.textContent=D.key;const T=document.createRange(),k=window.getSelection();T.selectNodeContents(w.current),T.collapse(!1),k?.removeAllRanges(),k?.addRange(T)}}))},[i,l,m,e,n,o]);x.useEffect(()=>{if(i&&w.current&&(w.current.focus(),!w.current.textContent&&y&&(w.current.textContent=y),w.current.textContent)){const D=document.createRange(),T=window.getSelection();D.selectNodeContents(w.current),D.collapse(!1),T?.removeAllRanges(),T?.addRange(D)}},[i,y]);const R=i?"":y??"";return p.jsx(bs,{ref:C,cell:t,tableMeta:e,rowIndex:n,columnId:o,rowHeight:s,isEditing:i,isFocused:l,isSelected:u,isSearchMatch:d,isActiveSearchMatch:f,readOnly:g,onKeyDown:E,children:p.jsx("div",{role:"textbox","data-slot":"grid-cell-content",contentEditable:i,tabIndex:-1,ref:w,onBlur:N,onInput:M,suppressContentEditableWarning:!0,className:Ne("size-full overflow-hidden outline-none",{"whitespace-nowrap **:inline **:whitespace-nowrap [&_br]:hidden":i}),children:R})})}function bq({cell:t,tableMeta:e,rowIndex:n,columnId:o,rowHeight:s,isFocused:i,isEditing:l,isSelected:u,isSearchMatch:d,isActiveSearchMatch:f,readOnly:g}){const m=c3(t.getValue()),[y,v]=x.useState(m),w=x.useRef(null),C=x.useRef(null),S=x.useRef(null),N=-(C.current?.clientHeight??0),M=x.useRef(m);m!==M.current&&(M.current=m,v(m));const E=l3(Y=>{g||e?.onDataUpdate?.({rowIndex:n,columnId:o,value:Y})},300),R=x.useCallback(()=>{!g&&y!==m&&e?.onDataUpdate?.({rowIndex:n,columnId:o,value:y}),e?.onCellEditingStop?.()},[e,y,m,n,o,g]),D=x.useCallback(()=>{v(m??""),g||e?.onDataUpdate?.({rowIndex:n,columnId:o,value:m}),e?.onCellEditingStop?.()},[e,m,n,o,g]),T=x.useCallback(Y=>{Y&&!g?e?.onCellEditingStart?.(n,o):(!g&&y!==m&&e?.onDataUpdate?.({rowIndex:n,columnId:o,value:y}),e?.onCellEditingStop?.())},[e,y,m,n,o,g]),k=x.useCallback(Y=>{if(Y.preventDefault(),w.current){w.current.focus();const q=w.current.value.length;if(w.current.setSelectionRange(q,q),S.current){const z=S.current;S.current=null,requestAnimationFrame(()=>{w.current&&document.activeElement===w.current&&(document.execCommand("insertText",!1,z),w.current.scrollTop=w.current.scrollHeight)})}else w.current.scrollTop=w.current.scrollHeight}},[]),O=x.useCallback(Y=>{i&&!l&&!g&&Y.key.length===1&&!Y.ctrlKey&&!Y.metaKey&&(S.current=Y.key)},[i,l,g]),L=x.useCallback(()=>{!g&&y!==m&&e?.onDataUpdate?.({rowIndex:n,columnId:o,value:y}),e?.onCellEditingStop?.()},[e,y,m,n,o,g]),W=x.useCallback(Y=>{const q=Y.target.value;v(q),E(q)},[E]),B=x.useCallback(Y=>{if(Y.key==="Escape")Y.preventDefault(),D();else if(Y.key==="Enter"&&(Y.ctrlKey||Y.metaKey))Y.preventDefault(),R();else if(Y.key==="Tab"){Y.preventDefault(),y!==m&&e?.onDataUpdate?.({rowIndex:n,columnId:o,value:y}),e?.onCellEditingStop?.({direction:Y.shiftKey?"left":"right"});return}Y.stopPropagation()},[R,D,y,m,e,n,o]);return p.jsxs(xl,{open:l,onOpenChange:T,children:[p.jsx(Sh,{asChild:!0,children:p.jsx(bs,{ref:C,cell:t,tableMeta:e,rowIndex:n,columnId:o,rowHeight:s,isEditing:l,isFocused:i,isSelected:u,isSearchMatch:d,isActiveSearchMatch:f,readOnly:g,onKeyDown:O,children:p.jsx("span",{"data-slot":"grid-cell-content",children:y})})}),p.jsx(bl,{"data-grid-cell-editor":"",align:"start",side:"bottom",sideOffset:N,className:"w-[400px] rounded-none p-0",onOpenAutoFocus:k,children:p.jsx(a3,{placeholder:"Enter text...",className:"max-h-[300px] min-h-[150px] resize-none overflow-y-auto rounded-none border-0 shadow-none focus-visible:ring-1 focus-visible:ring-ring",ref:w,value:y,onBlur:L,onChange:W,onKeyDown:B})})]})}function wq({cell:t,tableMeta:e,rowIndex:n,columnId:o,rowHeight:s,isFocused:i,isEditing:l,isSelected:u,isSearchMatch:d,isActiveSearchMatch:f,readOnly:g}){const m=t.getValue(),[y,v]=x.useState(String(m??"")),w=x.useRef(null),C=x.useRef(null),S=t.column.columnDef.meta?.cell,N=S?.variant==="number"?S:null,M=N?.min,E=N?.max,R=N?.step,D=x.useRef(l),T=x.useRef(m);m!==T.current&&(T.current=m,v(String(m??"")));const k=x.useCallback(()=>{const W=y===""?null:Number(y);!g&&W!==m&&e?.onDataUpdate?.({rowIndex:n,columnId:o,value:W}),e?.onCellEditingStop?.()},[e,n,o,m,y,g]),O=x.useCallback(W=>{v(W.target.value)},[]),L=x.useCallback(W=>{if(l)if(W.key==="Enter"){W.preventDefault();const B=y===""?null:Number(y);B!==m&&e?.onDataUpdate?.({rowIndex:n,columnId:o,value:B}),e?.onCellEditingStop?.({moveToNextRow:!0})}else if(W.key==="Tab"){W.preventDefault();const B=y===""?null:Number(y);B!==m&&e?.onDataUpdate?.({rowIndex:n,columnId:o,value:B}),e?.onCellEditingStop?.({direction:W.shiftKey?"left":"right"})}else W.key==="Escape"&&(W.preventDefault(),v(String(m??"")),w.current?.blur());else i&&(W.key==="Backspace"?v(""):W.key.length===1&&!W.ctrlKey&&!W.metaKey&&v(W.key))},[l,i,m,e,n,o,y]);return x.useEffect(()=>{const W=D.current;D.current=l,l&&!W&&w.current&&w.current.focus()},[l]),p.jsx(bs,{ref:C,cell:t,tableMeta:e,rowIndex:n,columnId:o,rowHeight:s,isEditing:l,isFocused:i,isSelected:u,isSearchMatch:d,isActiveSearchMatch:f,readOnly:g,onKeyDown:L,children:l?p.jsx("input",{type:"number",ref:w,value:y,min:M,max:E,step:R,className:"w-full border-none bg-transparent p-0 outline-none [appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none",onBlur:k,onChange:O}):p.jsx("span",{"data-slot":"grid-cell-content",children:y})})}function Sq({cell:t,tableMeta:e,rowIndex:n,columnId:o,rowHeight:s,isEditing:i,isFocused:l,isSelected:u,isSearchMatch:d,isActiveSearchMatch:f,readOnly:g}){const m=t.getValue(),[y,v]=x.useState(m??""),w=x.useRef(null),C=x.useRef(null),S=x.useRef(m);m!==S.current&&(S.current=m,v(m??""),w.current&&!i&&(w.current.textContent=m??""));const N=x.useCallback(()=>{const O=w.current?.textContent?.trim()??"";!g&&O!==m&&e?.onDataUpdate?.({rowIndex:n,columnId:o,value:O||null}),e?.onCellEditingStop?.()},[e,n,o,m,g]),M=x.useCallback(O=>{const L=O.currentTarget.textContent??"";v(L)},[]),E=x.useCallback(O=>{if(i)if(O.key==="Enter"){O.preventDefault();const L=w.current?.textContent?.trim()??"";!g&&L!==m&&e?.onDataUpdate?.({rowIndex:n,columnId:o,value:L||null}),e?.onCellEditingStop?.({moveToNextRow:!0})}else if(O.key==="Tab"){O.preventDefault();const L=w.current?.textContent?.trim()??"";!g&&L!==m&&e?.onDataUpdate?.({rowIndex:n,columnId:o,value:L||null}),e?.onCellEditingStop?.({direction:O.shiftKey?"left":"right"})}else O.key==="Escape"&&(O.preventDefault(),v(m??""),w.current?.blur());else l&&!g&&O.key.length===1&&!O.ctrlKey&&!O.metaKey&&(v(O.key),queueMicrotask(()=>{if(w.current&&w.current.contentEditable==="true"){w.current.textContent=O.key;const L=document.createRange(),W=window.getSelection();L.selectNodeContents(w.current),L.collapse(!1),W?.removeAllRanges(),W?.addRange(L)}}))},[i,l,m,e,n,o,g]),R=x.useCallback(O=>{if(i){O.preventDefault();return}if(!d2(y)){O.preventDefault(),Jt.error("Invalid URL",{description:"URL contains a dangerous protocol (javascript:, data:, vbscript:, or file:)"});return}O.stopPropagation()},[i,y]);x.useEffect(()=>{if(i&&w.current&&(w.current.focus(),!w.current.textContent&&y&&(w.current.textContent=y),w.current.textContent)){const O=document.createRange(),L=window.getSelection();O.selectNodeContents(w.current),O.collapse(!1),L?.removeAllRanges(),L?.addRange(O)}},[i,y]);const D=i?"":y??"",T=D?d2(D):"",k=D&&!T;return p.jsx(bs,{ref:C,cell:t,tableMeta:e,rowIndex:n,columnId:o,rowHeight:s,isEditing:i,isFocused:l,isSelected:u,isSearchMatch:d,isActiveSearchMatch:f,readOnly:g,onKeyDown:E,children:!i&&D?p.jsx("div",{"data-slot":"grid-cell-content",className:"size-full overflow-hidden",children:p.jsx("a",{"data-focused":l&&!k?"":void 0,"data-invalid":k?"":void 0,href:T,target:"_blank",rel:"noopener noreferrer",className:"truncate text-primary underline decoration-primary/30 underline-offset-2 hover:decoration-primary/60 data-invalid:cursor-not-allowed data-focused:text-foreground data-invalid:text-destructive data-focused:decoration-foreground/50 data-invalid:decoration-destructive/50 data-focused:hover:decoration-foreground/70 data-invalid:hover:decoration-destructive/70",onClick:R,children:D})}):p.jsx("div",{role:"textbox","data-slot":"grid-cell-content",contentEditable:i,tabIndex:-1,ref:w,onBlur:N,onInput:M,suppressContentEditableWarning:!0,className:Ne("size-full overflow-hidden outline-none",{"whitespace-nowrap **:inline **:whitespace-nowrap [&_br]:hidden":i}),children:D})})}function Cq({cell:t,tableMeta:e,rowIndex:n,columnId:o,rowHeight:s,isFocused:i,isSelected:l,isSearchMatch:u,isActiveSearchMatch:d,readOnly:f}){const g=t.getValue(),[m,y]=x.useState(!!g),v=x.useRef(null),w=x.useRef(g);g!==w.current&&(w.current=g,y(!!g));const C=x.useCallback(D=>{f||(y(D),e?.onDataUpdate?.({rowIndex:n,columnId:o,value:D}))},[e,n,o,f]),S=x.useCallback(D=>{i&&!f&&(D.key===" "||D.key==="Enter")?(D.preventDefault(),D.stopPropagation(),C(!m)):i&&D.key==="Tab"&&(D.preventDefault(),e?.onCellEditingStop?.({direction:D.shiftKey?"left":"right"}))},[i,m,C,e,f]),N=x.useCallback(D=>{i&&!f&&(D.preventDefault(),D.stopPropagation(),C(!m))},[i,m,C,f]),M=x.useCallback(D=>{D.stopPropagation()},[]),E=x.useCallback(D=>{D.stopPropagation()},[]),R=x.useCallback(D=>{D.stopPropagation()},[]);return p.jsx(bs,{ref:v,cell:t,tableMeta:e,rowIndex:n,columnId:o,rowHeight:s,isEditing:!1,isFocused:i,isSelected:l,isSearchMatch:u,isActiveSearchMatch:d,readOnly:f,className:"flex size-full justify-center",onClick:N,onKeyDown:S,children:p.jsx(Wy,{checked:m,onCheckedChange:C,disabled:f,className:"border-primary",onClick:M,onMouseDown:E,onDoubleClick:R})})}function Eq({cell:t,tableMeta:e,rowIndex:n,columnId:o,rowHeight:s,isFocused:i,isEditing:l,isSelected:u,isSearchMatch:d,isActiveSearchMatch:f,readOnly:g}){const m=t.getValue(),[y,v]=x.useState(m),w=x.useRef(null),C=t.column.columnDef.meta?.cell,S=C?.variant==="select"?C.options:[],N=x.useRef(m);m!==N.current&&(N.current=m,v(m));const M=x.useCallback(T=>{g||(v(T),e?.onDataUpdate?.({rowIndex:n,columnId:o,value:T}),e?.onCellEditingStop?.())},[e,n,o,g]),E=x.useCallback(T=>{T&&!g?e?.onCellEditingStart?.(n,o):e?.onCellEditingStop?.()},[e,n,o,g]),R=x.useCallback(T=>{l&&T.key==="Escape"?(T.preventDefault(),v(m),e?.onCellEditingStop?.()):i&&T.key==="Tab"&&(T.preventDefault(),e?.onCellEditingStop?.({direction:T.shiftKey?"left":"right"}))},[l,i,m,e]),D=S.find(T=>T.value===y)?.label??y;return p.jsx(bs,{ref:w,cell:t,tableMeta:e,rowIndex:n,columnId:o,rowHeight:s,isEditing:l,isFocused:i,isSelected:u,isSearchMatch:d,isActiveSearchMatch:f,readOnly:g,onKeyDown:R,children:l?p.jsxs(Yc,{value:y,onValueChange:M,open:l,onOpenChange:E,children:[p.jsx(Gc,{size:"sm",className:"size-full items-start border-none p-0 shadow-none focus-visible:ring-0 dark:bg-transparent [&_svg]:hidden",children:D?p.jsx(cs,{variant:"secondary",className:"whitespace-pre-wrap px-1.5 py-px",children:p.jsx(al,{})}):p.jsx(al,{})}),p.jsx(qc,{"data-grid-cell-editor":"",align:"start",alignOffset:-8,sideOffset:-8,className:"min-w-[calc(var(--radix-select-trigger-width)+16px)]",children:S.map(T=>p.jsx(vr,{value:T.value,children:T.label},T.value))})]}):D?p.jsx(cs,{"data-slot":"grid-cell-content",variant:"secondary",className:"whitespace-pre-wrap px-1.5 py-px",children:D}):null})}function _q({cell:t,tableMeta:e,rowIndex:n,columnId:o,rowHeight:s,isFocused:i,isEditing:l,isSelected:u,isSearchMatch:d,isActiveSearchMatch:f,readOnly:g}){const m=x.useMemo(()=>t.getValue()??[],[t]),y=on(n,o),v=x.useRef(y),[w,C]=x.useState(m),[S,N]=x.useState(""),M=x.useRef(null),E=x.useRef(null),R=t.column.columnDef.meta?.cell,D=R?.variant==="multi-select"?R.options:[],T=-(M.current?.clientHeight??0),k=x.useRef(m);m!==k.current&&(k.current=m,C(m)),v.current!==y&&(v.current=y,N(""));const O=x.useCallback(F=>{if(g)return;const Q=w.includes(F)?w.filter($=>$!==F):[...w,F];C(Q),e?.onDataUpdate?.({rowIndex:n,columnId:o,value:Q}),N(""),queueMicrotask(()=>E.current?.focus())},[w,e,n,o,g]),L=x.useCallback((F,Q)=>{if(g)return;Q?.stopPropagation(),Q?.preventDefault();const $=w.filter(I=>I!==F);C($),e?.onDataUpdate?.({rowIndex:n,columnId:o,value:$}),setTimeout(()=>E.current?.focus(),0)},[w,e,n,o,g]),W=x.useCallback(()=>{g||(C([]),e?.onDataUpdate?.({rowIndex:n,columnId:o,value:[]}),queueMicrotask(()=>E.current?.focus()))},[e,n,o,g]),B=x.useCallback(F=>{F&&!g?e?.onCellEditingStart?.(n,o):(N(""),e?.onCellEditingStop?.())},[e,n,o,g]),Y=x.useCallback(F=>{F.preventDefault(),E.current?.focus()},[]),q=x.useCallback(F=>{l&&F.key==="Escape"?(F.preventDefault(),C(m),N(""),e?.onCellEditingStop?.()):i&&F.key==="Tab"&&(F.preventDefault(),N(""),e?.onCellEditingStop?.({direction:F.shiftKey?"left":"right"}))},[l,i,m,e]),z=x.useCallback(F=>{if(F.key==="Backspace"&&S===""&&w.length>0){F.preventDefault();const Q=w[w.length-1];Q&&L(Q)}F.key==="Escape"&&F.stopPropagation()},[S,w,L]),V=w.map(F=>D.find(Q=>Q.value===F)?.label??F).filter(Boolean),A=pR(s),{visibleItems:H,hiddenCount:P}=i3({items:V,getLabel:F=>F,containerRef:M,lineCount:A});return p.jsxs(bs,{ref:M,cell:t,tableMeta:e,rowIndex:n,columnId:o,rowHeight:s,isEditing:l,isFocused:i,isSelected:u,isSearchMatch:d,isActiveSearchMatch:f,readOnly:g,onKeyDown:q,children:[l?p.jsxs(xl,{open:l,onOpenChange:B,children:[p.jsx(Sh,{asChild:!0,children:p.jsx("div",{className:"absolute inset-0"})}),p.jsx(bl,{"data-grid-cell-editor":"",align:"start",sideOffset:T,className:"w-[300px] rounded-none p-0",onOpenAutoFocus:Y,children:p.jsxs(uq,{className:"**:data-[slot=command-input-wrapper]:h-auto **:data-[slot=command-input-wrapper]:border-none **:data-[slot=command-input-wrapper]:p-0 [&_[data-slot=command-input-wrapper]_svg]:hidden",children:[p.jsxs("div",{className:"flex min-h-9 flex-wrap items-center gap-1 border-b px-3 py-1.5",children:[w.map(F=>{const $=D.find(I=>I.value===F)?.label??F;return p.jsxs(cs,{variant:"secondary",className:"gap-1 px-1.5 py-px",children:[$,p.jsx("button",{type:"button",onClick:I=>L(F,I),onPointerDown:I=>{I.preventDefault(),I.stopPropagation()},children:p.jsx(vs,{className:"size-3"})})]},F)}),p.jsx(dq,{ref:E,value:S,onValueChange:N,onKeyDown:z,placeholder:"Search...",className:"h-auto flex-1 p-0"})]}),p.jsxs(fq,{className:"max-h-full",children:[p.jsx(hq,{children:"No options found."}),p.jsx(k2,{className:"max-h-[300px] scroll-py-1 overflow-y-auto overflow-x-hidden",children:D.map(F=>{const Q=w.includes(F.value);return p.jsxs(j2,{value:F.label,onSelect:()=>O(F.value),children:[p.jsx("div",{className:Ne("flex size-4 items-center justify-center rounded-sm border border-primary",Q?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:p.jsx(da,{className:"size-3"})}),p.jsx("span",{children:F.label})]},F.value)})}),w.length>0&&p.jsxs(p.Fragment,{children:[p.jsx(mq,{}),p.jsx(k2,{children:p.jsx(j2,{onSelect:W,className:"justify-center text-muted-foreground",children:"Clear all"})})]})]})]})})]}):null,V.length>0?p.jsxs("div",{className:"flex flex-wrap items-center gap-1 overflow-hidden",children:[H.map((F,Q)=>p.jsx(cs,{variant:"secondary",className:"px-1.5 py-px",children:F},w[Q])),P>0&&p.jsxs(cs,{variant:"outline",className:"px-1.5 py-px text-muted-foreground",children:["+",P]})]}):null]})}function Nq({cell:t,tableMeta:e,rowIndex:n,columnId:o,rowHeight:s,isFocused:i,isEditing:l,isSelected:u,isSearchMatch:d,isActiveSearchMatch:f,readOnly:g}){const m=t.getValue(),[y,v]=x.useState(m??""),w=x.useRef(null),C=x.useRef(m);m!==C.current&&(C.current=m,v(m??""));const S=y?xR(y)??void 0:void 0,N=x.useCallback(R=>{if(!R||g)return;const D=MV(R);v(D),e?.onDataUpdate?.({rowIndex:n,columnId:o,value:D}),e?.onCellEditingStop?.()},[e,n,o,g]),M=x.useCallback(R=>{R&&!g?e?.onCellEditingStart?.(n,o):e?.onCellEditingStop?.()},[e,n,o,g]),E=x.useCallback(R=>{l&&R.key==="Escape"?(R.preventDefault(),v(m),e?.onCellEditingStop?.()):i&&R.key==="Tab"&&(R.preventDefault(),e?.onCellEditingStop?.({direction:R.shiftKey?"left":"right"}))},[l,i,m,e]);return p.jsx(bs,{ref:w,cell:t,tableMeta:e,rowIndex:n,columnId:o,rowHeight:s,isEditing:l,isFocused:i,isSelected:u,isSearchMatch:d,isActiveSearchMatch:f,readOnly:g,onKeyDown:E,children:p.jsxs(xl,{open:l,onOpenChange:M,children:[p.jsx(Sh,{asChild:!0,children:p.jsx("span",{"data-slot":"grid-cell-content",children:RV(y)})}),l&&p.jsx(bl,{"data-grid-cell-editor":"",align:"start",alignOffset:-8,className:"w-auto p-0",children:p.jsx(OG,{autoFocus:!0,captionLayout:"dropdown",mode:"single",defaultMonth:S??new Date,selected:S,onSelect:N})})]})})}function Mq({cell:t,tableMeta:e,rowIndex:n,columnId:o,rowHeight:s,isFocused:i,isEditing:l,isSelected:u,isSearchMatch:d,isActiveSearchMatch:f,readOnly:g}){const m=x.useMemo(()=>t.getValue()??[],[t]),y=on(n,o),v=x.useRef(y),w=x.useId(),C=x.useId(),[S,N]=x.useState(m),[M,E]=x.useState(new Set),[R,D]=x.useState(new Set),[T,k]=x.useState(!1),[O,L]=x.useState(!1),[W,B]=x.useState(null),Y=M.size>0,q=R.size>0,z=Y||q,V=x.useRef(null),A=x.useRef(null),H=x.useRef(null),P=t.column.columnDef.meta?.cell,F=-(V.current?.clientHeight??0),Q=P?.variant==="file"?P:null,$=Q?.maxFileSize??10*1024*1024,I=Q?.maxFiles??10,U=Q?.accept,K=Q?.multiple??!1,J=x.useMemo(()=>U?U.split(",").map(_e=>_e.trim()):null,[U]),ne=x.useRef(m);if(m!==ne.current){ne.current=m;for(const _e of S)_e.url&&URL.revokeObjectURL(_e.url);N(m),B(null)}v.current!==y&&(v.current=y,B(null));const X=x.useCallback(_e=>{if($&&_e.size>$)return`File size exceeds ${yp($)}`;if(J){const Ue=`.${_e.name.split(".").pop()}`;if(!J.some(Qe=>{if(Qe.endsWith("/*")){const st=Qe.slice(0,-2);return _e.type.startsWith(`${st}/`)}return Qe.startsWith(".")?Ue.toLowerCase()===Qe.toLowerCase():_e.type===Qe}))return"File type not accepted"}return null},[$,J]),ee=x.useCallback(async(_e,Ue=!1)=>{if(g||z)return;if(B(null),I&&S.length+_e.length>I){const st=`Maximum ${I} files allowed`;B(st),Jt(st),setTimeout(()=>{B(null)},2e3);return}const _t=[],Qe=[];for(const st of _e){const gt=X(st);if(gt){_t.push({name:st.name,reason:gt});continue}Qe.push(st)}if(_t.length>0){const st=_t[0];if(st){B(st.reason);const gt=st.name.length>20?`${st.name.slice(0,20)}...`:st.name;_t.length===1?Jt(st.reason,{description:`"${gt}" has been rejected`}):Jt(st.reason,{description:`"${gt}" and ${_t.length-1} more rejected`}),setTimeout(()=>{B(null)},2e3)}}if(Qe.length>0)if(Ue){const st=Qe.map(Wt=>({id:crypto.randomUUID(),name:Wt.name,size:Wt.size,type:Wt.type,url:URL.createObjectURL(Wt)})),gt=[...S,...st];N(gt),e?.onDataUpdate?.({rowIndex:n,columnId:o,value:gt})}else{const st=Qe.map(Nt=>({id:crypto.randomUUID(),name:Nt.name,size:Nt.size,type:Nt.type,url:void 0})),gt=[...S,...st];N(gt);const Wt=new Set(st.map(Nt=>Nt.id));E(Wt);let Kt=[];if(e?.onFilesUpload)try{Kt=await e.onFilesUpload({files:Qe,rowIndex:n,columnId:o})}catch(Nt){Jt.error(Nt instanceof Error?Nt.message:`Failed to upload ${Qe.length} file${Qe.length!==1?"s":""}`),N(Fe=>Fe.filter(nt=>!Wt.has(nt.id))),E(new Set);return}else Kt=Qe.map((Nt,Fe)=>({id:st[Fe]?.id??crypto.randomUUID(),name:Nt.name,size:Nt.size,type:Nt.type,url:URL.createObjectURL(Nt)}));const Zn=gt.map(Nt=>Wt.has(Nt.id)?Kt.find(Fe=>Fe.name===Nt.name)??Nt:Nt).filter(Nt=>Nt.url!==void 0);N(Zn),E(new Set),e?.onDataUpdate?.({rowIndex:n,columnId:o,value:Zn})}},[S,I,X,e,n,o,g,z]),se=x.useCallback(async _e=>{if(g||z)return;B(null);const Ue=S.find(Qe=>Qe.id===_e);if(!Ue)return;if(D(Qe=>new Set(Qe).add(_e)),e?.onFilesDelete)try{await e.onFilesDelete({fileIds:[_e],rowIndex:n,columnId:o})}catch(Qe){Jt.error(Qe instanceof Error?Qe.message:`Failed to delete ${Ue.name}`),D(st=>{const gt=new Set(st);return gt.delete(_e),gt});return}Ue.url?.startsWith("blob:")&&URL.revokeObjectURL(Ue.url);const _t=S.filter(Qe=>Qe.id!==_e);N(_t),D(Qe=>{const st=new Set(Qe);return st.delete(_e),st}),e?.onDataUpdate?.({rowIndex:n,columnId:o,value:_t})},[S,e,n,o,g,z]),le=x.useCallback(async()=>{if(g||z)return;B(null);const _e=S.map(Ue=>Ue.id);if(D(new Set(_e)),e?.onFilesDelete&&S.length>0)try{await e.onFilesDelete({fileIds:_e,rowIndex:n,columnId:o})}catch(Ue){Jt.error(Ue instanceof Error?Ue.message:"Failed to delete files"),D(new Set);return}for(const Ue of S)Ue.url?.startsWith("blob:")&&URL.revokeObjectURL(Ue.url);N([]),D(new Set),e?.onDataUpdate?.({rowIndex:n,columnId:o,value:[]})},[S,e,n,o,g,z]),pe=x.useCallback(_e=>{_e.preventDefault(),_e.stopPropagation(),_e.dataTransfer.types.includes("Files")&&k(!0)},[]),ie=x.useCallback(_e=>{_e.preventDefault(),_e.stopPropagation();const Ue=_e.currentTarget.getBoundingClientRect(),_t=_e.clientX,Qe=_e.clientY;(_t<=Ue.left||_t>=Ue.right||Qe<=Ue.top||Qe>=Ue.bottom)&&k(!1)},[]),be=x.useCallback(_e=>{_e.preventDefault(),_e.stopPropagation()},[]),ke=x.useCallback(_e=>{_e.preventDefault(),_e.stopPropagation(),k(!1);const Ue=Array.from(_e.dataTransfer.files);Ue.length>0&&ee(Ue,!1)},[ee]),Be=x.useCallback(_e=>{_e.preventDefault(),_e.stopPropagation(),L(!0)},[]),Ie=x.useCallback(_e=>{_e.preventDefault(),_e.stopPropagation();const Ue=_e.currentTarget.getBoundingClientRect(),_t=_e.clientX,Qe=_e.clientY;(_t<=Ue.left||_t>=Ue.right||Qe<=Ue.top||Qe>=Ue.bottom)&&L(!1)},[]),lt=x.useCallback(_e=>{_e.preventDefault(),_e.stopPropagation()},[]),cn=x.useCallback(_e=>{_e.preventDefault(),_e.stopPropagation(),L(!1);const Ue=Array.from(_e.dataTransfer.files);ee(Ue,!1)},[ee]),ht=x.useCallback(()=>{A.current?.click()},[]),bn=x.useCallback(_e=>{(_e.key==="Enter"||_e.key===" ")&&(_e.preventDefault(),ht())},[ht]),un=x.useCallback(_e=>{const Ue=Array.from(_e.target.files??[]);ee(Ue,!1),_e.target.value=""},[ee]),Vt=x.useCallback(_e=>{_e&&!g?(B(null),e?.onCellEditingStart?.(n,o)):(B(null),e?.onCellEditingStop?.())},[e,n,o,g]),mn=x.useCallback(_e=>{_e.stopPropagation()},[]),It=x.useCallback(_e=>{_e.preventDefault(),queueMicrotask(()=>{H.current?.focus()})},[]),Mn=x.useCallback(_e=>{l?_e.key==="Escape"?(_e.preventDefault(),N(m),B(null),e?.onCellEditingStop?.()):_e.key===" "?(_e.preventDefault(),ht()):_e.key==="Tab"&&(_e.preventDefault(),e?.onCellEditingStop?.({direction:_e.shiftKey?"left":"right"})):i&&_e.key==="Enter"?(_e.preventDefault(),e?.onCellEditingStart?.(n,o)):i&&_e.key==="Tab"&&(_e.preventDefault(),e?.onCellEditingStop?.({direction:_e.shiftKey?"left":"right"}))},[l,i,m,e,ht,n,o]);x.useEffect(()=>()=>{for(const _e of S)_e.url&&URL.revokeObjectURL(_e.url)},[S]);const yn=pR(s),{visibleItems:In,hiddenCount:On}=i3({items:S,getLabel:_e=>_e.name,containerRef:V,lineCount:yn,cacheKeyPrefix:"file",iconSize:12,maxWidth:100});return p.jsxs(bs,{ref:V,cell:t,tableMeta:e,rowIndex:n,columnId:o,rowHeight:s,isEditing:l,isFocused:i,isSelected:u,isSearchMatch:d,isActiveSearchMatch:f,readOnly:g,className:Ne({"ring-1 ring-primary/80 ring-inset":T}),onDragEnter:pe,onDragLeave:ie,onDragOver:be,onDrop:ke,onKeyDown:Mn,children:[l?p.jsxs(xl,{open:l,onOpenChange:Vt,children:[p.jsx(Sh,{asChild:!0,children:p.jsx("div",{className:"absolute inset-0"})}),p.jsx(bl,{"data-grid-cell-editor":"",align:"start",sideOffset:F,className:"w-[400px] rounded-none p-0",onEscapeKeyDown:mn,onOpenAutoFocus:It,children:p.jsxs("div",{className:"flex flex-col gap-2 p-3",children:[p.jsx("span",{id:w,className:"sr-only",children:"File upload"}),p.jsxs("div",{role:"region","aria-labelledby":w,"aria-describedby":C,"aria-invalid":!!W,"aria-disabled":z,"data-dragging":O?"":void 0,"data-invalid":W?"":void 0,"data-disabled":z?"":void 0,tabIndex:O||z?-1:0,className:"flex cursor-pointer flex-col items-center justify-center gap-2 rounded-md border-2 border-dashed p-6 outline-none transition-colors hover:bg-accent/30 focus-visible:border-ring/50 data-disabled:pointer-events-none data-dragging:border-primary/30 data-invalid:border-destructive data-dragging:bg-accent/30 data-disabled:opacity-50 data-invalid:ring-destructive/20",ref:H,onClick:ht,onDragEnter:Be,onDragLeave:Ie,onDragOver:lt,onDrop:cn,onKeyDown:bn,children:[p.jsx(Xw,{className:"size-8 text-muted-foreground"}),p.jsxs("div",{className:"text-center text-sm",children:[p.jsx("p",{className:"font-medium",children:O?"Drop files here":"Drag files here"}),p.jsx("p",{className:"text-muted-foreground text-xs",children:"or click to browse"})]}),p.jsx("p",{id:C,className:"text-muted-foreground text-xs",children:$?`Max size: ${yp($)}${I?` • Max ${I} files`:""}`:I?`Max ${I} files`:"Select files to upload"})]}),p.jsx("input",{type:"file","aria-labelledby":w,"aria-describedby":C,multiple:K,accept:U,className:"sr-only",ref:A,onChange:un}),S.length>0&&p.jsxs("div",{className:"flex flex-col gap-2",children:[p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsxs("p",{className:"font-medium text-muted-foreground text-xs",children:[S.length," ",S.length===1?"file":"files"]}),p.jsx(St,{type:"button",variant:"ghost",size:"sm",className:"h-6 text-muted-foreground text-xs",onClick:le,disabled:z,children:"Clear all"})]}),p.jsx("div",{className:"max-h-[200px] space-y-1 overflow-y-auto",children:S.map(_e=>{const Ue=f2(_e.type),_t=M.has(_e.id),Qe=R.has(_e.id),st=_t||Qe;return p.jsxs("div",{"data-pending":st?"":void 0,className:"flex items-center gap-2 rounded-md border bg-muted/50 px-2 py-1.5 data-pending:opacity-60",children:[Ue&&p.jsx(Ue,{className:"size-4 shrink-0 text-muted-foreground"}),p.jsxs("div",{className:"flex-1 overflow-hidden",children:[p.jsx("p",{className:"truncate text-sm",children:_e.name}),p.jsx("p",{className:"text-muted-foreground text-xs",children:_t?"Uploading...":Qe?"Deleting...":yp(_e.size)})]}),p.jsx(St,{type:"button",variant:"ghost",size:"icon",className:"size-5 rounded-sm",onClick:()=>se(_e.id),disabled:z,children:p.jsx(vs,{className:"size-3"})})]},_e.id)})})]})]})})]}):null,T?p.jsxs("div",{className:"flex items-center justify-center gap-2 text-primary text-sm",children:[p.jsx(Xw,{className:"size-4"}),p.jsx("span",{children:"Drop files here"})]}):S.length>0?p.jsxs("div",{className:"flex flex-wrap items-center gap-1 overflow-hidden",children:[In.map(_e=>{if(M.has(_e.id))return p.jsx(f7,{className:"h-5 shrink-0 px-1.5",style:{width:`${Math.min(_e.name.length*8+30,100)}px`}},_e.id);const _t=f2(_e.type);return p.jsxs(cs,{variant:"secondary",className:"gap-1 px-1.5 py-px",children:[_t&&p.jsx(_t,{className:"size-3 shrink-0"}),p.jsx("span",{className:"max-w-[100px] truncate",children:_e.name})]},_e.id)}),On>0&&p.jsxs(cs,{variant:"outline",className:"px-1.5 py-px text-muted-foreground",children:["+",On]})]}):null]})}const Rq=x.memo(Dq,(t,e)=>{if(t.isFocused!==e.isFocused||t.isEditing!==e.isEditing||t.isSelected!==e.isSelected||t.isSearchMatch!==e.isSearchMatch||t.isActiveSearchMatch!==e.isActiveSearchMatch||t.readOnly!==e.readOnly||t.rowIndex!==e.rowIndex||t.columnId!==e.columnId||t.rowHeight!==e.rowHeight)return!1;const n=t.cell.row.original[t.columnId],o=e.cell.row.original[e.columnId];return!(n!==o||t.cell.row.id!==e.cell.row.id)});function Dq(t){const e=ge.c(13),{cell:n,tableMeta:o,rowIndex:s,columnId:i,isFocused:l,isEditing:u,isSelected:d,isSearchMatch:f,isActiveSearchMatch:g,readOnly:m,rowHeight:y}=t,w=n.column.columnDef.meta?.cell?.variant??"text";let C;e:switch(w){case"short-text":{C=O2;break e}case"long-text":{C=bq;break e}case"number":{C=wq;break e}case"url":{C=Sq;break e}case"checkbox":{C=Cq;break e}case"select":{C=Eq;break e}case"multi-select":{C=_q;break e}case"date":{C=Nq;break e}case"file":{C=Mq;break e}default:C=O2}let S;return e[0]!==C||e[1]!==n||e[2]!==i||e[3]!==g||e[4]!==u||e[5]!==l||e[6]!==f||e[7]!==d||e[8]!==m||e[9]!==y||e[10]!==s||e[11]!==o?(S=p.jsx(C,{cell:n,tableMeta:o,rowIndex:s,columnId:i,rowHeight:y,isEditing:u,isFocused:l,isSelected:d,isSearchMatch:f,isActiveSearchMatch:g,readOnly:m}),e[0]=C,e[1]=n,e[2]=i,e[3]=g,e[4]=u,e[5]=l,e[6]=f,e[7]=d,e[8]=m,e[9]=y,e[10]=s,e[11]=o,e[12]=S):S=e[12],S}const Tq=x.memo(kq,(t,e)=>{const n=t.virtualItem.index,o=e.virtualItem.index;if(t.row.id!==e.row.id||t.row.original!==e.row.original||t.virtualItem.start!==e.virtualItem.start)return!1;const s=t.focusedCell?.rowIndex===n,i=e.focusedCell?.rowIndex===o;if(s!==i||i&&s&&t.focusedCell?.columnId!==e.focusedCell?.columnId)return!1;const l=t.editingCell?.rowIndex===n,u=e.editingCell?.rowIndex===o;return!(l!==u||u&&l&&t.editingCell?.columnId!==e.editingCell?.columnId||t.cellSelectionKeys!==e.cellSelectionKeys||t.columnVisibility!==e.columnVisibility||t.rowHeight!==e.rowHeight||t.columnPinning!==e.columnPinning||t.readOnly!==e.readOnly||t.searchMatchColumns!==e.searchMatchColumns||t.activeSearchMatch?.columnId!==e.activeSearchMatch?.columnId||t.dir!==e.dir||t.adjustLayout!==e.adjustLayout||t.stretchColumns!==e.stretchColumns)});function kq(t){const e=ge.c(63);let n,o,s,i,l,u,d,f,g,m,y,v,w,C,S,N,M,E,R,D,T;e[0]!==t?({row:C,tableMeta:D,virtualItem:T,measureElement:m,rowMapRef:N,rowHeight:S,columnVisibility:u,columnPinning:l,focusedCell:g,editingCell:f,cellSelectionKeys:s,searchMatchColumns:M,activeSearchMatch:n,dir:d,readOnly:v,stretchColumns:E,adjustLayout:o,className:i,style:R,ref:w,...y}=t,e[0]=t,e[1]=n,e[2]=o,e[3]=s,e[4]=i,e[5]=l,e[6]=u,e[7]=d,e[8]=f,e[9]=g,e[10]=m,e[11]=y,e[12]=v,e[13]=w,e[14]=C,e[15]=S,e[16]=N,e[17]=M,e[18]=E,e[19]=R,e[20]=D,e[21]=T):(n=e[1],o=e[2],s=e[3],i=e[4],l=e[5],u=e[6],d=e[7],f=e[8],g=e[9],m=e[10],y=e[11],v=e[12],w=e[13],C=e[14],S=e[15],N=e[16],M=e[17],E=e[18],R=e[19],D=e[20],T=e[21]);const k=T.index;let O;e[22]!==m||e[23]!==N||e[24]!==k?(O=Y=>{typeof k>"u"||(Y?(m(Y),N.current?.set(k,Y)):N.current?.delete(k))},e[22]=m,e[23]=N,e[24]=k,e[25]=O):O=e[25];const W=wR(w,O);let B;if(e[26]!==n?.columnId||e[27]!==o||e[28]!==s||e[29]!==i||e[30]!==l||e[31]!==u||e[32]!==d||e[33]!==f?.columnId||e[34]!==f?.rowIndex||e[35]!==g?.columnId||e[36]!==g?.rowIndex||e[37]!==y||e[38]!==v||e[39]!==C||e[40]!==S||e[41]!==W||e[42]!==M||e[43]!==E||e[44]!==R||e[45]!==D||e[46]!==T.start||e[47]!==k){const Y=C.getIsSelected();let q;e[49]!==C?(q=C.getVisibleCells(),e[49]=C,e[50]=q):q=e[50];const z=q,V=C.id,A=!o&&"will-change-transform";let H;e[51]!==i||e[52]!==A?(H=Ne("absolute flex w-full border-b",A,i),e[51]=i,e[52]=A,e[53]=H):H=e[53];let P;e[54]!==S?(P=y0(S),e[54]=S,e[55]=P):P=e[55];const F=`${P}px`;let Q;e[56]!==o||e[57]!==T.start?(Q=o?{top:`${T.start}px`}:{transform:`translateY(${T.start}px)`},e[56]=o,e[57]=T.start,e[58]=Q):Q=e[58];let $;e[59]!==R||e[60]!==F||e[61]!==Q?($={height:F,...Q,...R},e[59]=R,e[60]=F,e[61]=Q,e[62]=$):$=e[62],B=p.jsx("div",{role:"row","aria-rowindex":k+2,"aria-selected":Y,"data-index":k,"data-slot":"grid-row",tabIndex:-1,...y,ref:W,className:H,style:$,children:z.map((I,U)=>{const K=I.column.id,J=g?.rowIndex===k&&g?.columnId===K,ne=f?.rowIndex===k&&f?.columnId===K,X=s?.has(on(k,K))??!1,ee=M?.has(K)??!1,se=n?.columnId===K,le=z[U+1],pe=U===z.length-1,{showEndBorder:ie,showStartBorder:be}=yR({column:I.column,nextColumn:le?.column,isLastColumn:pe});return p.jsx("div",{role:"gridcell","aria-colindex":U+1,"data-highlighted":J?"":void 0,"data-slot":"grid-cell",tabIndex:-1,className:Ne({grow:E&&K!=="select","border-e":ie&&K!=="select","border-s":be&&K!=="select"}),style:{...vR({column:I.column,dir:d}),width:`calc(var(--col-${K}-size) * 1px)`},children:typeof I.column.columnDef.header=="function"?p.jsx("div",{className:Ne("size-full px-3 py-1.5",{"bg-primary/10":Y}),children:gR(I.column.columnDef.cell,I.getContext())}):p.jsx(Rq,{cell:I,tableMeta:D,rowIndex:k,columnId:K,rowHeight:S,isFocused:J,isEditing:ne,isSelected:X,isSearchMatch:ee,isActiveSearchMatch:se,readOnly:v})},I.id)})},V),e[26]=n?.columnId,e[27]=o,e[28]=s,e[29]=i,e[30]=l,e[31]=u,e[32]=d,e[33]=f?.columnId,e[34]=f?.rowIndex,e[35]=g?.columnId,e[36]=g?.rowIndex,e[37]=y,e[38]=v,e[39]=C,e[40]=S,e[41]=W,e[42]=M,e[43]=E,e[44]=R,e[45]=D,e[46]=T.start,e[47]=k,e[48]=B}else B=e[48];return B}const jq=x.memo(Aq,(t,e)=>{if(t.searchOpen!==e.searchOpen)return!1;if(!e.searchOpen)return!0;if(t.searchQuery!==e.searchQuery||t.matchIndex!==e.matchIndex||t.searchMatches.length!==e.searchMatches.length)return!1;for(let n=0;n<t.searchMatches.length;n++){const o=t.searchMatches[n],s=e.searchMatches[n];if(!o||!s||o.rowIndex!==s.rowIndex||o.columnId!==s.columnId)return!1}return!0});function Aq(t){const e=ge.c(57),{searchMatches:n,matchIndex:o,searchOpen:s,onSearchOpenChange:i,searchQuery:l,onSearchQueryChange:u,onSearch:d,onNavigateToNextMatch:f,onNavigateToPrevMatch:g}=t;let m;e[0]!==f||e[1]!==g||e[2]!==d||e[3]!==i||e[4]!==u?(m={onSearchOpenChange:i,onSearchQueryChange:u,onSearch:d,onNavigateToNextMatch:f,onNavigateToPrevMatch:g},e[0]=f,e[1]=g,e[2]=d,e[3]=i,e[4]=u,e[5]=m):m=e[5];const y=gu(m),v=x.useRef(null);let w,C;e[6]!==s?(w=()=>{s&&requestAnimationFrame(()=>{v.current?.focus()})},C=[s],e[6]=s,e[7]=w,e[8]=C):(w=e[7],C=e[8]),x.useEffect(w,C);let S,N;e[9]!==y||e[10]!==s?(S=()=>{if(!s)return;const ie=function(ke){ke.key==="Escape"&&(ke.preventDefault(),y.current.onSearchOpenChange(!1))};return document.addEventListener("keydown",ie),()=>document.removeEventListener("keydown",ie)},N=[s,y],e[9]=y,e[10]=s,e[11]=S,e[12]=N):(S=e[11],N=e[12]),x.useEffect(S,N);let M;e[13]!==y?(M=ie=>{ie.stopPropagation(),ie.key==="Enter"&&(ie.preventDefault(),ie.shiftKey?y.current.onNavigateToPrevMatch():y.current.onNavigateToNextMatch())},e[13]=y,e[14]=M):M=e[14];const E=M;let R;e[15]!==y?(R=ie=>{y.current.onSearch(ie)},e[15]=y,e[16]=R):R=e[16];const D=l3(R,150);let T;e[17]!==D||e[18]!==y?(T=ie=>{const be=ie.target.value;y.current.onSearchQueryChange(be),D(be)},e[17]=D,e[18]=y,e[19]=T):T=e[19];const k=T,O=Oq;let L;e[20]===Symbol.for("react.memo_cache_sentinel")?(L=ie=>O(ie),e[20]=L):L=e[20];const W=L;let B;e[21]===Symbol.for("react.memo_cache_sentinel")?(B=ie=>O(ie),e[21]=B):B=e[21];const Y=B;let q;e[22]!==y?(q=()=>{y.current.onSearchOpenChange(!1)},e[22]=y,e[23]=q):q=e[23];const z=q;let V;e[24]!==y?(V=()=>{y.current.onNavigateToPrevMatch()},e[24]=y,e[25]=V):V=e[25];const A=V;let H;e[26]!==y?(H=()=>{y.current.onNavigateToNextMatch()},e[26]=y,e[27]=H):H=e[27];const P=H;if(!s)return null;let F;e[28]!==k||e[29]!==E||e[30]!==l?(F=p.jsx(ar,{autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,placeholder:"Find in table...",className:"h-8 w-64",ref:v,value:l,onChange:k,onKeyDown:E}),e[28]=k,e[29]=E,e[30]=l,e[31]=F):F=e[31];const Q=n.length===0;let $;e[32]===Symbol.for("react.memo_cache_sentinel")?($=p.jsx(sh,{}),e[32]=$):$=e[32];let I;e[33]!==A||e[34]!==Q?(I=p.jsx(St,{"aria-label":"Previous match",variant:"ghost",size:"icon",className:"size-7",onClick:A,onPointerDown:W,disabled:Q,children:$}),e[33]=A,e[34]=Q,e[35]=I):I=e[35];const U=n.length===0;let K;e[36]===Symbol.for("react.memo_cache_sentinel")?(K=p.jsx(ms,{}),e[36]=K):K=e[36];let J;e[37]!==P||e[38]!==U?(J=p.jsx(St,{"aria-label":"Next match",variant:"ghost",size:"icon",className:"size-7",onClick:P,onPointerDown:Y,disabled:U,children:K}),e[37]=P,e[38]=U,e[39]=J):J=e[39];let ne;e[40]===Symbol.for("react.memo_cache_sentinel")?(ne=p.jsx(vs,{}),e[40]=ne):ne=e[40];let X;e[41]!==z?(X=p.jsx(St,{"aria-label":"Close search",variant:"ghost",size:"icon",className:"size-7",onClick:z,children:ne}),e[41]=z,e[42]=X):X=e[42];let ee;e[43]!==I||e[44]!==J||e[45]!==X?(ee=p.jsxs("div",{className:"flex items-center gap-1",children:[I,J,X]}),e[43]=I,e[44]=J,e[45]=X,e[46]=ee):ee=e[46];let se;e[47]!==F||e[48]!==ee?(se=p.jsxs("div",{className:"flex items-center gap-2",children:[F,ee]}),e[47]=F,e[48]=ee,e[49]=se):se=e[49];let le;e[50]!==o||e[51]!==n.length||e[52]!==l?(le=p.jsx("div",{className:"flex items-center gap-1 whitespace-nowrap text-muted-foreground text-xs",children:n.length>0?p.jsxs("span",{children:[o+1," of ",n.length]}):l?p.jsx("span",{children:"No results"}):p.jsx("span",{children:"Type to search"})}),e[50]=o,e[51]=n.length,e[52]=l,e[53]=le):le=e[53];let pe;return e[54]!==se||e[55]!==le?(pe=p.jsxs("div",{role:"search","data-slot":"grid-search",className:"fade-in-0 slide-in-from-top-2 absolute end-4 top-4 z-50 flex animate-in flex-col gap-2 rounded-lg border bg-background p-2 shadow-lg",children:[se,le]}),e[54]=se,e[55]=le,e[56]=pe):pe=e[56],pe}function Oq(t){const e=t.target;e instanceof HTMLElement&&(e.hasPointerCapture(t.pointerId)&&e.releasePointerCapture(t.pointerId),t.button===0&&t.ctrlKey===!1&&t.pointerType==="mouse"&&!(t.target instanceof HTMLInputElement)&&t.preventDefault())}const zq=new Set;function Iq({dataGridRef:t,headerRef:e,rowMapRef:n,footerRef:o,dir:s="ltr",table:i,tableMeta:l,virtualTotalSize:u,virtualItems:d,measureElement:f,columns:g,columnSizeVars:m,searchState:y,searchMatchesByRow:v,activeSearchMatch:w,cellSelectionMap:C,focusedCell:S,editingCell:N,rowHeight:M,contextMenu:E,pasteDialog:R,onRowAdd:D,height:T=600,width:k,stretchColumns:O=!1,adjustLayout:L=!1,className:W,...B}){const Y=i.getRowModel().rows,q=l?.readOnly??!1,z=i.getState().columnVisibility,V=i.getState().columnPinning,A=gu(D),H=x.useCallback(Q=>{A.current?.(Q)},[A]),P=x.useCallback(Q=>{Q.preventDefault()},[]),F=x.useCallback(Q=>{A.current&&(Q.key==="Enter"||Q.key===" ")&&(Q.preventDefault(),A.current())},[A]);return p.jsxs("div",{"data-slot":"grid-wrapper",dir:s,...B,className:Ne("relative flex min-w-0 min-h-0 flex-col",W),style:{width:k??"100%",maxWidth:k??"100%",height:"100%"},children:[y&&p.jsx(jq,{...y}),p.jsx(jV,{tableMeta:l,columns:g,contextMenu:E}),p.jsx(IV,{tableMeta:l,pasteDialog:R}),p.jsx("div",{role:"grid","aria-label":"Data grid","aria-rowcount":Y.length+(D?1:0),"aria-colcount":g.length,"data-slot":"grid",tabIndex:0,ref:t,className:"relative select-none overflow-x-auto overflow-y-auto rounded-md border focus:outline-none scrollbar-hide",style:{...m,maxHeight:`${T}px`,width:k??"100%",maxWidth:k??"100%",minWidth:0},onContextMenu:P,children:p.jsxs("div",{className:"grid",style:{width:i.getTotalSize(),minWidth:i.getTotalSize()},children:[p.jsx("div",{role:"rowgroup","data-slot":"grid-header",ref:e,className:"sticky top-0 z-10 grid border-b bg-background",children:i.getHeaderGroups().map((Q,$)=>p.jsx("div",{role:"row","aria-rowindex":$+1,"data-slot":"grid-header-row",tabIndex:-1,className:"flex w-full",children:Q.headers.map((I,U)=>{const J=i.getState().sorting.find(pe=>pe.id===I.column.id),ne=I.column.getCanSort(),X=Q.headers[U+1],ee=U===Q.headers.length-1,{showEndBorder:se,showStartBorder:le}=yR({column:I.column,nextColumn:X?.column,isLastColumn:ee});return p.jsx("div",{role:"columnheader","aria-colindex":U+1,"aria-sort":J?.desc===!1?"ascending":J?.desc===!0?"descending":ne?"none":void 0,"data-slot":"grid-header-cell",tabIndex:-1,className:Ne("relative",{grow:O&&I.column.id!=="select","border-e":se&&I.column.id!=="select","border-s":le&&I.column.id!=="select"}),style:{...vR({column:I.column,dir:s}),width:`calc(var(--header-${I.id}-size) * 1px)`},children:I.isPlaceholder?null:typeof I.column.columnDef.header=="function"?p.jsx("div",{className:"size-full px-3 py-1.5",children:gR(I.column.columnDef.header,I.getContext())}):p.jsx(DV,{header:I,table:i})},I.id)})},Q.id))}),p.jsx("div",{role:"rowgroup","data-slot":"grid-body",className:"relative grid",style:{height:`${u}px`,contain:L?"layout paint":"strict"},children:d.map(Q=>{const $=Y[Q.index];if(!$)return null;const I=C?.get(Q.index)??zq,U=v?.get(Q.index)??null,K=w?.rowIndex===Q.index;return p.jsx(Tq,{row:$,tableMeta:l,rowMapRef:n,virtualItem:Q,measureElement:f,rowHeight:M,columnVisibility:z,columnPinning:V,focusedCell:S,editingCell:N,cellSelectionKeys:I,searchMatchColumns:U,activeSearchMatch:K?w:null,dir:s,adjustLayout:L,stretchColumns:O,readOnly:q},$.id)})}),!q&&H&&p.jsx("div",{role:"rowgroup","data-slot":"grid-footer",ref:o,className:"sticky bottom-0 z-10 grid border-t bg-background",children:p.jsx("div",{role:"row","aria-rowindex":Y.length+2,"data-slot":"grid-add-row",tabIndex:-1,className:"flex w-full",children:p.jsx("div",{role:"gridcell",tabIndex:0,className:"relative flex h-9 grow items-center bg-muted/30 transition-colors hover:bg-muted/50 focus:bg-muted/50 focus:outline-none",style:{width:i.getTotalSize(),minWidth:i.getTotalSize()},onClick:H,onKeyDown:F,children:p.jsxs("div",{className:"sticky start-0 flex items-center gap-2 px-3 text-muted-foreground",children:[p.jsx(ra,{className:"size-3.5"}),p.jsx("span",{className:"text-sm",children:"Add row"})]})})})})]})})]})}function Qs(t,e){return typeof t=="function"?t(e):t}function No(t,e){return n=>{e.setState(o=>({...o,[t]:Qs(n,o[t])}))}}function Mh(t){return t instanceof Function}function Pq(t){return Array.isArray(t)&&t.every(e=>typeof e=="number")}function $q(t,e){const n=[],o=s=>{s.forEach(i=>{n.push(i);const l=e(i);l!=null&&l.length&&o(l)})};return o(t),n}function Je(t,e,n){let o=[],s;return i=>{let l;n.key&&n.debug&&(l=Date.now());const u=t(i);if(!(u.length!==o.length||u.some((g,m)=>o[m]!==g)))return s;o=u;let f;if(n.key&&n.debug&&(f=Date.now()),s=e(...u),n==null||n.onChange==null||n.onChange(s),n.key&&n.debug&&n!=null&&n.debug()){const g=Math.round((Date.now()-l)*100)/100,m=Math.round((Date.now()-f)*100)/100,y=m/16,v=(w,C)=>{for(w=String(w);w.length<C;)w=" "+w;return w};console.info(`%c⏱ ${v(m,5)} /${v(g,5)} ms`,`
62
- font-size: .6rem;
63
- font-weight: bold;
64
- color: hsl(${Math.max(0,Math.min(120-120*y,120))}deg 100% 31%);`,n?.key)}return s}}function et(t,e,n,o){return{debug:()=>{var s;return(s=t?.debugAll)!=null?s:t[e]},key:!1,onChange:o}}function Lq(t,e,n,o){const s=()=>{var l;return(l=i.getValue())!=null?l:t.options.renderFallbackValue},i={id:`${e.id}_${n.id}`,row:e,column:n,getValue:()=>e.getValue(o),renderValue:s,getContext:Je(()=>[t,n,e,i],(l,u,d,f)=>({table:l,column:u,row:d,cell:f,getValue:f.getValue,renderValue:f.renderValue}),et(t.options,"debugCells"))};return t._features.forEach(l=>{l.createCell==null||l.createCell(i,n,e,t)},{}),i}function Hq(t,e,n,o){var s,i;const u={...t._getDefaultColumnDef(),...e},d=u.accessorKey;let f=(s=(i=u.id)!=null?i:d?typeof String.prototype.replaceAll=="function"?d.replaceAll(".","_"):d.replace(/\./g,"_"):void 0)!=null?s:typeof u.header=="string"?u.header:void 0,g;if(u.accessorFn?g=u.accessorFn:d&&(d.includes(".")?g=y=>{let v=y;for(const C of d.split(".")){var w;v=(w=v)==null?void 0:w[C]}return v}:g=y=>y[u.accessorKey]),!f)throw new Error;let m={id:`${String(f)}`,accessorFn:g,parent:o,depth:n,columnDef:u,columns:[],getFlatColumns:Je(()=>[!0],()=>{var y;return[m,...(y=m.columns)==null?void 0:y.flatMap(v=>v.getFlatColumns())]},et(t.options,"debugColumns")),getLeafColumns:Je(()=>[t._getOrderColumnsFn()],y=>{var v;if((v=m.columns)!=null&&v.length){let w=m.columns.flatMap(C=>C.getLeafColumns());return y(w)}return[m]},et(t.options,"debugColumns"))};for(const y of t._features)y.createColumn==null||y.createColumn(m,t);return m}const qn="debugHeaders";function z2(t,e,n){var o;let i={id:(o=n.id)!=null?o:e.id,column:e,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const l=[],u=d=>{d.subHeaders&&d.subHeaders.length&&d.subHeaders.map(u),l.push(d)};return u(i),l},getContext:()=>({table:t,header:i,column:e})};return t._features.forEach(l=>{l.createHeader==null||l.createHeader(i,t)}),i}const Bq={createTable:t=>{t.getHeaderGroups=Je(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.left,t.getState().columnPinning.right],(e,n,o,s)=>{var i,l;const u=(i=o?.map(m=>n.find(y=>y.id===m)).filter(Boolean))!=null?i:[],d=(l=s?.map(m=>n.find(y=>y.id===m)).filter(Boolean))!=null?l:[],f=n.filter(m=>!(o!=null&&o.includes(m.id))&&!(s!=null&&s.includes(m.id)));return Kd(e,[...u,...f,...d],t)},et(t.options,qn)),t.getCenterHeaderGroups=Je(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.left,t.getState().columnPinning.right],(e,n,o,s)=>(n=n.filter(i=>!(o!=null&&o.includes(i.id))&&!(s!=null&&s.includes(i.id))),Kd(e,n,t,"center")),et(t.options,qn)),t.getLeftHeaderGroups=Je(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.left],(e,n,o)=>{var s;const i=(s=o?.map(l=>n.find(u=>u.id===l)).filter(Boolean))!=null?s:[];return Kd(e,i,t,"left")},et(t.options,qn)),t.getRightHeaderGroups=Je(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.right],(e,n,o)=>{var s;const i=(s=o?.map(l=>n.find(u=>u.id===l)).filter(Boolean))!=null?s:[];return Kd(e,i,t,"right")},et(t.options,qn)),t.getFooterGroups=Je(()=>[t.getHeaderGroups()],e=>[...e].reverse(),et(t.options,qn)),t.getLeftFooterGroups=Je(()=>[t.getLeftHeaderGroups()],e=>[...e].reverse(),et(t.options,qn)),t.getCenterFooterGroups=Je(()=>[t.getCenterHeaderGroups()],e=>[...e].reverse(),et(t.options,qn)),t.getRightFooterGroups=Je(()=>[t.getRightHeaderGroups()],e=>[...e].reverse(),et(t.options,qn)),t.getFlatHeaders=Je(()=>[t.getHeaderGroups()],e=>e.map(n=>n.headers).flat(),et(t.options,qn)),t.getLeftFlatHeaders=Je(()=>[t.getLeftHeaderGroups()],e=>e.map(n=>n.headers).flat(),et(t.options,qn)),t.getCenterFlatHeaders=Je(()=>[t.getCenterHeaderGroups()],e=>e.map(n=>n.headers).flat(),et(t.options,qn)),t.getRightFlatHeaders=Je(()=>[t.getRightHeaderGroups()],e=>e.map(n=>n.headers).flat(),et(t.options,qn)),t.getCenterLeafHeaders=Je(()=>[t.getCenterFlatHeaders()],e=>e.filter(n=>{var o;return!((o=n.subHeaders)!=null&&o.length)}),et(t.options,qn)),t.getLeftLeafHeaders=Je(()=>[t.getLeftFlatHeaders()],e=>e.filter(n=>{var o;return!((o=n.subHeaders)!=null&&o.length)}),et(t.options,qn)),t.getRightLeafHeaders=Je(()=>[t.getRightFlatHeaders()],e=>e.filter(n=>{var o;return!((o=n.subHeaders)!=null&&o.length)}),et(t.options,qn)),t.getLeafHeaders=Je(()=>[t.getLeftHeaderGroups(),t.getCenterHeaderGroups(),t.getRightHeaderGroups()],(e,n,o)=>{var s,i,l,u,d,f;return[...(s=(i=e[0])==null?void 0:i.headers)!=null?s:[],...(l=(u=n[0])==null?void 0:u.headers)!=null?l:[],...(d=(f=o[0])==null?void 0:f.headers)!=null?d:[]].map(g=>g.getLeafHeaders()).flat()},et(t.options,qn))}};function Kd(t,e,n,o){var s,i;let l=0;const u=function(y,v){v===void 0&&(v=1),l=Math.max(l,v),y.filter(w=>w.getIsVisible()).forEach(w=>{var C;(C=w.columns)!=null&&C.length&&u(w.columns,v+1)},0)};u(t);let d=[];const f=(y,v)=>{const w={depth:v,id:[o,`${v}`].filter(Boolean).join("_"),headers:[]},C=[];y.forEach(S=>{const N=[...C].reverse()[0],M=S.column.depth===w.depth;let E,R=!1;if(M&&S.column.parent?E=S.column.parent:(E=S.column,R=!0),N&&N?.column===E)N.subHeaders.push(S);else{const D=z2(n,E,{id:[o,v,E.id,S?.id].filter(Boolean).join("_"),isPlaceholder:R,placeholderId:R?`${C.filter(T=>T.column===E).length}`:void 0,depth:v,index:C.length});D.subHeaders.push(S),C.push(D)}w.headers.push(S),S.headerGroup=w}),d.push(w),v>0&&f(C,v-1)},g=e.map((y,v)=>z2(n,y,{depth:l,index:v}));f(g,l-1),d.reverse();const m=y=>y.filter(w=>w.column.getIsVisible()).map(w=>{let C=0,S=0,N=[0];w.subHeaders&&w.subHeaders.length?(N=[],m(w.subHeaders).forEach(E=>{let{colSpan:R,rowSpan:D}=E;C+=R,N.push(D)})):C=1;const M=Math.min(...N);return S=S+M,w.colSpan=C,w.rowSpan=S,{colSpan:C,rowSpan:S}});return m((s=(i=d[0])==null?void 0:i.headers)!=null?s:[]),d}const sv=(t,e,n,o,s,i,l)=>{let u={id:e,index:o,original:n,depth:s,parentId:l,_valuesCache:{},_uniqueValuesCache:{},getValue:d=>{if(u._valuesCache.hasOwnProperty(d))return u._valuesCache[d];const f=t.getColumn(d);if(f!=null&&f.accessorFn)return u._valuesCache[d]=f.accessorFn(u.original,o),u._valuesCache[d]},getUniqueValues:d=>{if(u._uniqueValuesCache.hasOwnProperty(d))return u._uniqueValuesCache[d];const f=t.getColumn(d);if(f!=null&&f.accessorFn)return f.columnDef.getUniqueValues?(u._uniqueValuesCache[d]=f.columnDef.getUniqueValues(u.original,o),u._uniqueValuesCache[d]):(u._uniqueValuesCache[d]=[u.getValue(d)],u._uniqueValuesCache[d])},renderValue:d=>{var f;return(f=u.getValue(d))!=null?f:t.options.renderFallbackValue},subRows:[],getLeafRows:()=>$q(u.subRows,d=>d.subRows),getParentRow:()=>u.parentId?t.getRow(u.parentId,!0):void 0,getParentRows:()=>{let d=[],f=u;for(;;){const g=f.getParentRow();if(!g)break;d.push(g),f=g}return d.reverse()},getAllCells:Je(()=>[t.getAllLeafColumns()],d=>d.map(f=>Lq(t,u,f,f.id)),et(t.options,"debugRows")),_getAllCellsByColumnId:Je(()=>[u.getAllCells()],d=>d.reduce((f,g)=>(f[g.column.id]=g,f),{}),et(t.options,"debugRows"))};for(let d=0;d<t._features.length;d++){const f=t._features[d];f==null||f.createRow==null||f.createRow(u,t)}return u},Fq={createColumn:(t,e)=>{t._getFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,t.id),t.getFacetedRowModel=()=>t._getFacetedRowModel?t._getFacetedRowModel():e.getPreFilteredRowModel(),t._getFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,t.id),t.getFacetedUniqueValues=()=>t._getFacetedUniqueValues?t._getFacetedUniqueValues():new Map,t._getFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,t.id),t.getFacetedMinMaxValues=()=>{if(t._getFacetedMinMaxValues)return t._getFacetedMinMaxValues()}}},u3=(t,e,n)=>{var o,s;const i=n==null||(o=n.toString())==null?void 0:o.toLowerCase();return!!(!((s=t.getValue(e))==null||(s=s.toString())==null||(s=s.toLowerCase())==null)&&s.includes(i))};u3.autoRemove=t=>nr(t);const d3=(t,e,n)=>{var o;return!!(!((o=t.getValue(e))==null||(o=o.toString())==null)&&o.includes(n))};d3.autoRemove=t=>nr(t);const f3=(t,e,n)=>{var o;return((o=t.getValue(e))==null||(o=o.toString())==null?void 0:o.toLowerCase())===n?.toLowerCase()};f3.autoRemove=t=>nr(t);const h3=(t,e,n)=>{var o;return(o=t.getValue(e))==null?void 0:o.includes(n)};h3.autoRemove=t=>nr(t);const m3=(t,e,n)=>!n.some(o=>{var s;return!((s=t.getValue(e))!=null&&s.includes(o))});m3.autoRemove=t=>nr(t)||!(t!=null&&t.length);const g3=(t,e,n)=>n.some(o=>{var s;return(s=t.getValue(e))==null?void 0:s.includes(o)});g3.autoRemove=t=>nr(t)||!(t!=null&&t.length);const p3=(t,e,n)=>t.getValue(e)===n;p3.autoRemove=t=>nr(t);const y3=(t,e,n)=>t.getValue(e)==n;y3.autoRemove=t=>nr(t);const av=(t,e,n)=>{let[o,s]=n;const i=t.getValue(e);return i>=o&&i<=s};av.resolveFilterValue=t=>{let[e,n]=t,o=typeof e!="number"?parseFloat(e):e,s=typeof n!="number"?parseFloat(n):n,i=e===null||Number.isNaN(o)?-1/0:o,l=n===null||Number.isNaN(s)?1/0:s;if(i>l){const u=i;i=l,l=u}return[i,l]};av.autoRemove=t=>nr(t)||nr(t[0])&&nr(t[1]);const os={includesString:u3,includesStringSensitive:d3,equalsString:f3,arrIncludes:h3,arrIncludesAll:m3,arrIncludesSome:g3,equals:p3,weakEquals:y3,inNumberRange:av};function nr(t){return t==null||t===""}const Vq={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:t=>({columnFilters:[],...t}),getDefaultOptions:t=>({onColumnFiltersChange:No("columnFilters",t),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(t,e)=>{t.getAutoFilterFn=()=>{const n=e.getCoreRowModel().flatRows[0],o=n?.getValue(t.id);return typeof o=="string"?os.includesString:typeof o=="number"?os.inNumberRange:typeof o=="boolean"||o!==null&&typeof o=="object"?os.equals:Array.isArray(o)?os.arrIncludes:os.weakEquals},t.getFilterFn=()=>{var n,o;return Mh(t.columnDef.filterFn)?t.columnDef.filterFn:t.columnDef.filterFn==="auto"?t.getAutoFilterFn():(n=(o=e.options.filterFns)==null?void 0:o[t.columnDef.filterFn])!=null?n:os[t.columnDef.filterFn]},t.getCanFilter=()=>{var n,o,s;return((n=t.columnDef.enableColumnFilter)!=null?n:!0)&&((o=e.options.enableColumnFilters)!=null?o:!0)&&((s=e.options.enableFilters)!=null?s:!0)&&!!t.accessorFn},t.getIsFiltered=()=>t.getFilterIndex()>-1,t.getFilterValue=()=>{var n;return(n=e.getState().columnFilters)==null||(n=n.find(o=>o.id===t.id))==null?void 0:n.value},t.getFilterIndex=()=>{var n,o;return(n=(o=e.getState().columnFilters)==null?void 0:o.findIndex(s=>s.id===t.id))!=null?n:-1},t.setFilterValue=n=>{e.setColumnFilters(o=>{const s=t.getFilterFn(),i=o?.find(g=>g.id===t.id),l=Qs(n,i?i.value:void 0);if(I2(s,l,t)){var u;return(u=o?.filter(g=>g.id!==t.id))!=null?u:[]}const d={id:t.id,value:l};if(i){var f;return(f=o?.map(g=>g.id===t.id?d:g))!=null?f:[]}return o!=null&&o.length?[...o,d]:[d]})}},createRow:(t,e)=>{t.columnFilters={},t.columnFiltersMeta={}},createTable:t=>{t.setColumnFilters=e=>{const n=t.getAllLeafColumns(),o=s=>{var i;return(i=Qs(e,s))==null?void 0:i.filter(l=>{const u=n.find(d=>d.id===l.id);if(u){const d=u.getFilterFn();if(I2(d,l.value,u))return!1}return!0})};t.options.onColumnFiltersChange==null||t.options.onColumnFiltersChange(o)},t.resetColumnFilters=e=>{var n,o;t.setColumnFilters(e?[]:(n=(o=t.initialState)==null?void 0:o.columnFilters)!=null?n:[])},t.getPreFilteredRowModel=()=>t.getCoreRowModel(),t.getFilteredRowModel=()=>(!t._getFilteredRowModel&&t.options.getFilteredRowModel&&(t._getFilteredRowModel=t.options.getFilteredRowModel(t)),t.options.manualFiltering||!t._getFilteredRowModel?t.getPreFilteredRowModel():t._getFilteredRowModel())}};function I2(t,e,n){return(t&&t.autoRemove?t.autoRemove(e,n):!1)||typeof e>"u"||typeof e=="string"&&!e}const Uq=(t,e,n)=>n.reduce((o,s)=>{const i=s.getValue(t);return o+(typeof i=="number"?i:0)},0),Yq=(t,e,n)=>{let o;return n.forEach(s=>{const i=s.getValue(t);i!=null&&(o>i||o===void 0&&i>=i)&&(o=i)}),o},Gq=(t,e,n)=>{let o;return n.forEach(s=>{const i=s.getValue(t);i!=null&&(o<i||o===void 0&&i>=i)&&(o=i)}),o},qq=(t,e,n)=>{let o,s;return n.forEach(i=>{const l=i.getValue(t);l!=null&&(o===void 0?l>=l&&(o=s=l):(o>l&&(o=l),s<l&&(s=l)))}),[o,s]},Wq=(t,e)=>{let n=0,o=0;if(e.forEach(s=>{let i=s.getValue(t);i!=null&&(i=+i)>=i&&(++n,o+=i)}),n)return o/n},Kq=(t,e)=>{if(!e.length)return;const n=e.map(i=>i.getValue(t));if(!Pq(n))return;if(n.length===1)return n[0];const o=Math.floor(n.length/2),s=n.sort((i,l)=>i-l);return n.length%2!==0?s[o]:(s[o-1]+s[o])/2},Xq=(t,e)=>Array.from(new Set(e.map(n=>n.getValue(t))).values()),Qq=(t,e)=>new Set(e.map(n=>n.getValue(t))).size,Zq=(t,e)=>e.length,Np={sum:Uq,min:Yq,max:Gq,extent:qq,mean:Wq,median:Kq,unique:Xq,uniqueCount:Qq,count:Zq},Jq={getDefaultColumnDef:()=>({aggregatedCell:t=>{var e,n;return(e=(n=t.getValue())==null||n.toString==null?void 0:n.toString())!=null?e:null},aggregationFn:"auto"}),getInitialState:t=>({grouping:[],...t}),getDefaultOptions:t=>({onGroupingChange:No("grouping",t),groupedColumnMode:"reorder"}),createColumn:(t,e)=>{t.toggleGrouping=()=>{e.setGrouping(n=>n!=null&&n.includes(t.id)?n.filter(o=>o!==t.id):[...n??[],t.id])},t.getCanGroup=()=>{var n,o;return((n=t.columnDef.enableGrouping)!=null?n:!0)&&((o=e.options.enableGrouping)!=null?o:!0)&&(!!t.accessorFn||!!t.columnDef.getGroupingValue)},t.getIsGrouped=()=>{var n;return(n=e.getState().grouping)==null?void 0:n.includes(t.id)},t.getGroupedIndex=()=>{var n;return(n=e.getState().grouping)==null?void 0:n.indexOf(t.id)},t.getToggleGroupingHandler=()=>{const n=t.getCanGroup();return()=>{n&&t.toggleGrouping()}},t.getAutoAggregationFn=()=>{const n=e.getCoreRowModel().flatRows[0],o=n?.getValue(t.id);if(typeof o=="number")return Np.sum;if(Object.prototype.toString.call(o)==="[object Date]")return Np.extent},t.getAggregationFn=()=>{var n,o;if(!t)throw new Error;return Mh(t.columnDef.aggregationFn)?t.columnDef.aggregationFn:t.columnDef.aggregationFn==="auto"?t.getAutoAggregationFn():(n=(o=e.options.aggregationFns)==null?void 0:o[t.columnDef.aggregationFn])!=null?n:Np[t.columnDef.aggregationFn]}},createTable:t=>{t.setGrouping=e=>t.options.onGroupingChange==null?void 0:t.options.onGroupingChange(e),t.resetGrouping=e=>{var n,o;t.setGrouping(e?[]:(n=(o=t.initialState)==null?void 0:o.grouping)!=null?n:[])},t.getPreGroupedRowModel=()=>t.getFilteredRowModel(),t.getGroupedRowModel=()=>(!t._getGroupedRowModel&&t.options.getGroupedRowModel&&(t._getGroupedRowModel=t.options.getGroupedRowModel(t)),t.options.manualGrouping||!t._getGroupedRowModel?t.getPreGroupedRowModel():t._getGroupedRowModel())},createRow:(t,e)=>{t.getIsGrouped=()=>!!t.groupingColumnId,t.getGroupingValue=n=>{if(t._groupingValuesCache.hasOwnProperty(n))return t._groupingValuesCache[n];const o=e.getColumn(n);return o!=null&&o.columnDef.getGroupingValue?(t._groupingValuesCache[n]=o.columnDef.getGroupingValue(t.original),t._groupingValuesCache[n]):t.getValue(n)},t._groupingValuesCache={}},createCell:(t,e,n,o)=>{t.getIsGrouped=()=>e.getIsGrouped()&&e.id===n.groupingColumnId,t.getIsPlaceholder=()=>!t.getIsGrouped()&&e.getIsGrouped(),t.getIsAggregated=()=>{var s;return!t.getIsGrouped()&&!t.getIsPlaceholder()&&!!((s=n.subRows)!=null&&s.length)}}};function eW(t,e,n){if(!(e!=null&&e.length)||!n)return t;const o=t.filter(i=>!e.includes(i.id));return n==="remove"?o:[...e.map(i=>t.find(l=>l.id===i)).filter(Boolean),...o]}const tW={getInitialState:t=>({columnOrder:[],...t}),getDefaultOptions:t=>({onColumnOrderChange:No("columnOrder",t)}),createColumn:(t,e)=>{t.getIndex=Je(n=>[Dc(e,n)],n=>n.findIndex(o=>o.id===t.id),et(e.options,"debugColumns")),t.getIsFirstColumn=n=>{var o;return((o=Dc(e,n)[0])==null?void 0:o.id)===t.id},t.getIsLastColumn=n=>{var o;const s=Dc(e,n);return((o=s[s.length-1])==null?void 0:o.id)===t.id}},createTable:t=>{t.setColumnOrder=e=>t.options.onColumnOrderChange==null?void 0:t.options.onColumnOrderChange(e),t.resetColumnOrder=e=>{var n;t.setColumnOrder(e?[]:(n=t.initialState.columnOrder)!=null?n:[])},t._getOrderColumnsFn=Je(()=>[t.getState().columnOrder,t.getState().grouping,t.options.groupedColumnMode],(e,n,o)=>s=>{let i=[];if(!(e!=null&&e.length))i=s;else{const l=[...e],u=[...s];for(;u.length&&l.length;){const d=l.shift(),f=u.findIndex(g=>g.id===d);f>-1&&i.push(u.splice(f,1)[0])}i=[...i,...u]}return eW(i,n,o)},et(t.options,"debugTable"))}},Mp=()=>({left:[],right:[]}),nW={getInitialState:t=>({columnPinning:Mp(),...t}),getDefaultOptions:t=>({onColumnPinningChange:No("columnPinning",t)}),createColumn:(t,e)=>{t.pin=n=>{const o=t.getLeafColumns().map(s=>s.id).filter(Boolean);e.setColumnPinning(s=>{var i,l;if(n==="right"){var u,d;return{left:((u=s?.left)!=null?u:[]).filter(m=>!(o!=null&&o.includes(m))),right:[...((d=s?.right)!=null?d:[]).filter(m=>!(o!=null&&o.includes(m))),...o]}}if(n==="left"){var f,g;return{left:[...((f=s?.left)!=null?f:[]).filter(m=>!(o!=null&&o.includes(m))),...o],right:((g=s?.right)!=null?g:[]).filter(m=>!(o!=null&&o.includes(m)))}}return{left:((i=s?.left)!=null?i:[]).filter(m=>!(o!=null&&o.includes(m))),right:((l=s?.right)!=null?l:[]).filter(m=>!(o!=null&&o.includes(m)))}})},t.getCanPin=()=>t.getLeafColumns().some(o=>{var s,i,l;return((s=o.columnDef.enablePinning)!=null?s:!0)&&((i=(l=e.options.enableColumnPinning)!=null?l:e.options.enablePinning)!=null?i:!0)}),t.getIsPinned=()=>{const n=t.getLeafColumns().map(u=>u.id),{left:o,right:s}=e.getState().columnPinning,i=n.some(u=>o?.includes(u)),l=n.some(u=>s?.includes(u));return i?"left":l?"right":!1},t.getPinnedIndex=()=>{var n,o;const s=t.getIsPinned();return s?(n=(o=e.getState().columnPinning)==null||(o=o[s])==null?void 0:o.indexOf(t.id))!=null?n:-1:0}},createRow:(t,e)=>{t.getCenterVisibleCells=Je(()=>[t._getAllVisibleCells(),e.getState().columnPinning.left,e.getState().columnPinning.right],(n,o,s)=>{const i=[...o??[],...s??[]];return n.filter(l=>!i.includes(l.column.id))},et(e.options,"debugRows")),t.getLeftVisibleCells=Je(()=>[t._getAllVisibleCells(),e.getState().columnPinning.left],(n,o)=>(o??[]).map(i=>n.find(l=>l.column.id===i)).filter(Boolean).map(i=>({...i,position:"left"})),et(e.options,"debugRows")),t.getRightVisibleCells=Je(()=>[t._getAllVisibleCells(),e.getState().columnPinning.right],(n,o)=>(o??[]).map(i=>n.find(l=>l.column.id===i)).filter(Boolean).map(i=>({...i,position:"right"})),et(e.options,"debugRows"))},createTable:t=>{t.setColumnPinning=e=>t.options.onColumnPinningChange==null?void 0:t.options.onColumnPinningChange(e),t.resetColumnPinning=e=>{var n,o;return t.setColumnPinning(e?Mp():(n=(o=t.initialState)==null?void 0:o.columnPinning)!=null?n:Mp())},t.getIsSomeColumnsPinned=e=>{var n;const o=t.getState().columnPinning;if(!e){var s,i;return!!((s=o.left)!=null&&s.length||(i=o.right)!=null&&i.length)}return!!((n=o[e])!=null&&n.length)},t.getLeftLeafColumns=Je(()=>[t.getAllLeafColumns(),t.getState().columnPinning.left],(e,n)=>(n??[]).map(o=>e.find(s=>s.id===o)).filter(Boolean),et(t.options,"debugColumns")),t.getRightLeafColumns=Je(()=>[t.getAllLeafColumns(),t.getState().columnPinning.right],(e,n)=>(n??[]).map(o=>e.find(s=>s.id===o)).filter(Boolean),et(t.options,"debugColumns")),t.getCenterLeafColumns=Je(()=>[t.getAllLeafColumns(),t.getState().columnPinning.left,t.getState().columnPinning.right],(e,n,o)=>{const s=[...n??[],...o??[]];return e.filter(i=>!s.includes(i.id))},et(t.options,"debugColumns"))}};function oW(t){return t||(typeof document<"u"?document:null)}const Xd={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},Rp=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),rW={getDefaultColumnDef:()=>Xd,getInitialState:t=>({columnSizing:{},columnSizingInfo:Rp(),...t}),getDefaultOptions:t=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:No("columnSizing",t),onColumnSizingInfoChange:No("columnSizingInfo",t)}),createColumn:(t,e)=>{t.getSize=()=>{var n,o,s;const i=e.getState().columnSizing[t.id];return Math.min(Math.max((n=t.columnDef.minSize)!=null?n:Xd.minSize,(o=i??t.columnDef.size)!=null?o:Xd.size),(s=t.columnDef.maxSize)!=null?s:Xd.maxSize)},t.getStart=Je(n=>[n,Dc(e,n),e.getState().columnSizing],(n,o)=>o.slice(0,t.getIndex(n)).reduce((s,i)=>s+i.getSize(),0),et(e.options,"debugColumns")),t.getAfter=Je(n=>[n,Dc(e,n),e.getState().columnSizing],(n,o)=>o.slice(t.getIndex(n)+1).reduce((s,i)=>s+i.getSize(),0),et(e.options,"debugColumns")),t.resetSize=()=>{e.setColumnSizing(n=>{let{[t.id]:o,...s}=n;return s})},t.getCanResize=()=>{var n,o;return((n=t.columnDef.enableResizing)!=null?n:!0)&&((o=e.options.enableColumnResizing)!=null?o:!0)},t.getIsResizing=()=>e.getState().columnSizingInfo.isResizingColumn===t.id},createHeader:(t,e)=>{t.getSize=()=>{let n=0;const o=s=>{if(s.subHeaders.length)s.subHeaders.forEach(o);else{var i;n+=(i=s.column.getSize())!=null?i:0}};return o(t),n},t.getStart=()=>{if(t.index>0){const n=t.headerGroup.headers[t.index-1];return n.getStart()+n.getSize()}return 0},t.getResizeHandler=n=>{const o=e.getColumn(t.column.id),s=o?.getCanResize();return i=>{if(!o||!s||(i.persist==null||i.persist(),Dp(i)&&i.touches&&i.touches.length>1))return;const l=t.getSize(),u=t?t.getLeafHeaders().map(N=>[N.column.id,N.column.getSize()]):[[o.id,o.getSize()]],d=Dp(i)?Math.round(i.touches[0].clientX):i.clientX,f={},g=(N,M)=>{typeof M=="number"&&(e.setColumnSizingInfo(E=>{var R,D;const T=e.options.columnResizeDirection==="rtl"?-1:1,k=(M-((R=E?.startOffset)!=null?R:0))*T,O=Math.max(k/((D=E?.startSize)!=null?D:0),-.999999);return E.columnSizingStart.forEach(L=>{let[W,B]=L;f[W]=Math.round(Math.max(B+B*O,0)*100)/100}),{...E,deltaOffset:k,deltaPercentage:O}}),(e.options.columnResizeMode==="onChange"||N==="end")&&e.setColumnSizing(E=>({...E,...f})))},m=N=>g("move",N),y=N=>{g("end",N),e.setColumnSizingInfo(M=>({...M,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},v=oW(n),w={moveHandler:N=>m(N.clientX),upHandler:N=>{v?.removeEventListener("mousemove",w.moveHandler),v?.removeEventListener("mouseup",w.upHandler),y(N.clientX)}},C={moveHandler:N=>(N.cancelable&&(N.preventDefault(),N.stopPropagation()),m(N.touches[0].clientX),!1),upHandler:N=>{var M;v?.removeEventListener("touchmove",C.moveHandler),v?.removeEventListener("touchend",C.upHandler),N.cancelable&&(N.preventDefault(),N.stopPropagation()),y((M=N.touches[0])==null?void 0:M.clientX)}},S=sW()?{passive:!1}:!1;Dp(i)?(v?.addEventListener("touchmove",C.moveHandler,S),v?.addEventListener("touchend",C.upHandler,S)):(v?.addEventListener("mousemove",w.moveHandler,S),v?.addEventListener("mouseup",w.upHandler,S)),e.setColumnSizingInfo(N=>({...N,startOffset:d,startSize:l,deltaOffset:0,deltaPercentage:0,columnSizingStart:u,isResizingColumn:o.id}))}}},createTable:t=>{t.setColumnSizing=e=>t.options.onColumnSizingChange==null?void 0:t.options.onColumnSizingChange(e),t.setColumnSizingInfo=e=>t.options.onColumnSizingInfoChange==null?void 0:t.options.onColumnSizingInfoChange(e),t.resetColumnSizing=e=>{var n;t.setColumnSizing(e?{}:(n=t.initialState.columnSizing)!=null?n:{})},t.resetHeaderSizeInfo=e=>{var n;t.setColumnSizingInfo(e?Rp():(n=t.initialState.columnSizingInfo)!=null?n:Rp())},t.getTotalSize=()=>{var e,n;return(e=(n=t.getHeaderGroups()[0])==null?void 0:n.headers.reduce((o,s)=>o+s.getSize(),0))!=null?e:0},t.getLeftTotalSize=()=>{var e,n;return(e=(n=t.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((o,s)=>o+s.getSize(),0))!=null?e:0},t.getCenterTotalSize=()=>{var e,n;return(e=(n=t.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((o,s)=>o+s.getSize(),0))!=null?e:0},t.getRightTotalSize=()=>{var e,n;return(e=(n=t.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((o,s)=>o+s.getSize(),0))!=null?e:0}}};let Qd=null;function sW(){if(typeof Qd=="boolean")return Qd;let t=!1;try{const e={get passive(){return t=!0,!1}},n=()=>{};window.addEventListener("test",n,e),window.removeEventListener("test",n)}catch{t=!1}return Qd=t,Qd}function Dp(t){return t.type==="touchstart"}const aW={getInitialState:t=>({columnVisibility:{},...t}),getDefaultOptions:t=>({onColumnVisibilityChange:No("columnVisibility",t)}),createColumn:(t,e)=>{t.toggleVisibility=n=>{t.getCanHide()&&e.setColumnVisibility(o=>({...o,[t.id]:n??!t.getIsVisible()}))},t.getIsVisible=()=>{var n,o;const s=t.columns;return(n=s.length?s.some(i=>i.getIsVisible()):(o=e.getState().columnVisibility)==null?void 0:o[t.id])!=null?n:!0},t.getCanHide=()=>{var n,o;return((n=t.columnDef.enableHiding)!=null?n:!0)&&((o=e.options.enableHiding)!=null?o:!0)},t.getToggleVisibilityHandler=()=>n=>{t.toggleVisibility==null||t.toggleVisibility(n.target.checked)}},createRow:(t,e)=>{t._getAllVisibleCells=Je(()=>[t.getAllCells(),e.getState().columnVisibility],n=>n.filter(o=>o.column.getIsVisible()),et(e.options,"debugRows")),t.getVisibleCells=Je(()=>[t.getLeftVisibleCells(),t.getCenterVisibleCells(),t.getRightVisibleCells()],(n,o,s)=>[...n,...o,...s],et(e.options,"debugRows"))},createTable:t=>{const e=(n,o)=>Je(()=>[o(),o().filter(s=>s.getIsVisible()).map(s=>s.id).join("_")],s=>s.filter(i=>i.getIsVisible==null?void 0:i.getIsVisible()),et(t.options,"debugColumns"));t.getVisibleFlatColumns=e("getVisibleFlatColumns",()=>t.getAllFlatColumns()),t.getVisibleLeafColumns=e("getVisibleLeafColumns",()=>t.getAllLeafColumns()),t.getLeftVisibleLeafColumns=e("getLeftVisibleLeafColumns",()=>t.getLeftLeafColumns()),t.getRightVisibleLeafColumns=e("getRightVisibleLeafColumns",()=>t.getRightLeafColumns()),t.getCenterVisibleLeafColumns=e("getCenterVisibleLeafColumns",()=>t.getCenterLeafColumns()),t.setColumnVisibility=n=>t.options.onColumnVisibilityChange==null?void 0:t.options.onColumnVisibilityChange(n),t.resetColumnVisibility=n=>{var o;t.setColumnVisibility(n?{}:(o=t.initialState.columnVisibility)!=null?o:{})},t.toggleAllColumnsVisible=n=>{var o;n=(o=n)!=null?o:!t.getIsAllColumnsVisible(),t.setColumnVisibility(t.getAllLeafColumns().reduce((s,i)=>({...s,[i.id]:n||!(i.getCanHide!=null&&i.getCanHide())}),{}))},t.getIsAllColumnsVisible=()=>!t.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),t.getIsSomeColumnsVisible=()=>t.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),t.getToggleAllColumnsVisibilityHandler=()=>n=>{var o;t.toggleAllColumnsVisible((o=n.target)==null?void 0:o.checked)}}};function Dc(t,e){return e?e==="center"?t.getCenterVisibleLeafColumns():e==="left"?t.getLeftVisibleLeafColumns():t.getRightVisibleLeafColumns():t.getVisibleLeafColumns()}const iW={createTable:t=>{t._getGlobalFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,"__global__"),t.getGlobalFacetedRowModel=()=>t.options.manualFiltering||!t._getGlobalFacetedRowModel?t.getPreFilteredRowModel():t._getGlobalFacetedRowModel(),t._getGlobalFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,"__global__"),t.getGlobalFacetedUniqueValues=()=>t._getGlobalFacetedUniqueValues?t._getGlobalFacetedUniqueValues():new Map,t._getGlobalFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,"__global__"),t.getGlobalFacetedMinMaxValues=()=>{if(t._getGlobalFacetedMinMaxValues)return t._getGlobalFacetedMinMaxValues()}}},lW={getInitialState:t=>({globalFilter:void 0,...t}),getDefaultOptions:t=>({onGlobalFilterChange:No("globalFilter",t),globalFilterFn:"auto",getColumnCanGlobalFilter:e=>{var n;const o=(n=t.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[e.id])==null?void 0:n.getValue();return typeof o=="string"||typeof o=="number"}}),createColumn:(t,e)=>{t.getCanGlobalFilter=()=>{var n,o,s,i;return((n=t.columnDef.enableGlobalFilter)!=null?n:!0)&&((o=e.options.enableGlobalFilter)!=null?o:!0)&&((s=e.options.enableFilters)!=null?s:!0)&&((i=e.options.getColumnCanGlobalFilter==null?void 0:e.options.getColumnCanGlobalFilter(t))!=null?i:!0)&&!!t.accessorFn}},createTable:t=>{t.getGlobalAutoFilterFn=()=>os.includesString,t.getGlobalFilterFn=()=>{var e,n;const{globalFilterFn:o}=t.options;return Mh(o)?o:o==="auto"?t.getGlobalAutoFilterFn():(e=(n=t.options.filterFns)==null?void 0:n[o])!=null?e:os[o]},t.setGlobalFilter=e=>{t.options.onGlobalFilterChange==null||t.options.onGlobalFilterChange(e)},t.resetGlobalFilter=e=>{t.setGlobalFilter(e?void 0:t.initialState.globalFilter)}}},cW={getInitialState:t=>({expanded:{},...t}),getDefaultOptions:t=>({onExpandedChange:No("expanded",t),paginateExpandedRows:!0}),createTable:t=>{let e=!1,n=!1;t._autoResetExpanded=()=>{var o,s;if(!e){t._queue(()=>{e=!0});return}if((o=(s=t.options.autoResetAll)!=null?s:t.options.autoResetExpanded)!=null?o:!t.options.manualExpanding){if(n)return;n=!0,t._queue(()=>{t.resetExpanded(),n=!1})}},t.setExpanded=o=>t.options.onExpandedChange==null?void 0:t.options.onExpandedChange(o),t.toggleAllRowsExpanded=o=>{o??!t.getIsAllRowsExpanded()?t.setExpanded(!0):t.setExpanded({})},t.resetExpanded=o=>{var s,i;t.setExpanded(o?{}:(s=(i=t.initialState)==null?void 0:i.expanded)!=null?s:{})},t.getCanSomeRowsExpand=()=>t.getPrePaginationRowModel().flatRows.some(o=>o.getCanExpand()),t.getToggleAllRowsExpandedHandler=()=>o=>{o.persist==null||o.persist(),t.toggleAllRowsExpanded()},t.getIsSomeRowsExpanded=()=>{const o=t.getState().expanded;return o===!0||Object.values(o).some(Boolean)},t.getIsAllRowsExpanded=()=>{const o=t.getState().expanded;return typeof o=="boolean"?o===!0:!(!Object.keys(o).length||t.getRowModel().flatRows.some(s=>!s.getIsExpanded()))},t.getExpandedDepth=()=>{let o=0;return(t.getState().expanded===!0?Object.keys(t.getRowModel().rowsById):Object.keys(t.getState().expanded)).forEach(i=>{const l=i.split(".");o=Math.max(o,l.length)}),o},t.getPreExpandedRowModel=()=>t.getSortedRowModel(),t.getExpandedRowModel=()=>(!t._getExpandedRowModel&&t.options.getExpandedRowModel&&(t._getExpandedRowModel=t.options.getExpandedRowModel(t)),t.options.manualExpanding||!t._getExpandedRowModel?t.getPreExpandedRowModel():t._getExpandedRowModel())},createRow:(t,e)=>{t.toggleExpanded=n=>{e.setExpanded(o=>{var s;const i=o===!0?!0:!!(o!=null&&o[t.id]);let l={};if(o===!0?Object.keys(e.getRowModel().rowsById).forEach(u=>{l[u]=!0}):l=o,n=(s=n)!=null?s:!i,!i&&n)return{...l,[t.id]:!0};if(i&&!n){const{[t.id]:u,...d}=l;return d}return o})},t.getIsExpanded=()=>{var n;const o=e.getState().expanded;return!!((n=e.options.getIsRowExpanded==null?void 0:e.options.getIsRowExpanded(t))!=null?n:o===!0||o?.[t.id])},t.getCanExpand=()=>{var n,o,s;return(n=e.options.getRowCanExpand==null?void 0:e.options.getRowCanExpand(t))!=null?n:((o=e.options.enableExpanding)!=null?o:!0)&&!!((s=t.subRows)!=null&&s.length)},t.getIsAllParentsExpanded=()=>{let n=!0,o=t;for(;n&&o.parentId;)o=e.getRow(o.parentId,!0),n=o.getIsExpanded();return n},t.getToggleExpandedHandler=()=>{const n=t.getCanExpand();return()=>{n&&t.toggleExpanded()}}}},w0=0,S0=10,Tp=()=>({pageIndex:w0,pageSize:S0}),uW={getInitialState:t=>({...t,pagination:{...Tp(),...t?.pagination}}),getDefaultOptions:t=>({onPaginationChange:No("pagination",t)}),createTable:t=>{let e=!1,n=!1;t._autoResetPageIndex=()=>{var o,s;if(!e){t._queue(()=>{e=!0});return}if((o=(s=t.options.autoResetAll)!=null?s:t.options.autoResetPageIndex)!=null?o:!t.options.manualPagination){if(n)return;n=!0,t._queue(()=>{t.resetPageIndex(),n=!1})}},t.setPagination=o=>{const s=i=>Qs(o,i);return t.options.onPaginationChange==null?void 0:t.options.onPaginationChange(s)},t.resetPagination=o=>{var s;t.setPagination(o?Tp():(s=t.initialState.pagination)!=null?s:Tp())},t.setPageIndex=o=>{t.setPagination(s=>{let i=Qs(o,s.pageIndex);const l=typeof t.options.pageCount>"u"||t.options.pageCount===-1?Number.MAX_SAFE_INTEGER:t.options.pageCount-1;return i=Math.max(0,Math.min(i,l)),{...s,pageIndex:i}})},t.resetPageIndex=o=>{var s,i;t.setPageIndex(o?w0:(s=(i=t.initialState)==null||(i=i.pagination)==null?void 0:i.pageIndex)!=null?s:w0)},t.resetPageSize=o=>{var s,i;t.setPageSize(o?S0:(s=(i=t.initialState)==null||(i=i.pagination)==null?void 0:i.pageSize)!=null?s:S0)},t.setPageSize=o=>{t.setPagination(s=>{const i=Math.max(1,Qs(o,s.pageSize)),l=s.pageSize*s.pageIndex,u=Math.floor(l/i);return{...s,pageIndex:u,pageSize:i}})},t.setPageCount=o=>t.setPagination(s=>{var i;let l=Qs(o,(i=t.options.pageCount)!=null?i:-1);return typeof l=="number"&&(l=Math.max(-1,l)),{...s,pageCount:l}}),t.getPageOptions=Je(()=>[t.getPageCount()],o=>{let s=[];return o&&o>0&&(s=[...new Array(o)].fill(null).map((i,l)=>l)),s},et(t.options,"debugTable")),t.getCanPreviousPage=()=>t.getState().pagination.pageIndex>0,t.getCanNextPage=()=>{const{pageIndex:o}=t.getState().pagination,s=t.getPageCount();return s===-1?!0:s===0?!1:o<s-1},t.previousPage=()=>t.setPageIndex(o=>o-1),t.nextPage=()=>t.setPageIndex(o=>o+1),t.firstPage=()=>t.setPageIndex(0),t.lastPage=()=>t.setPageIndex(t.getPageCount()-1),t.getPrePaginationRowModel=()=>t.getExpandedRowModel(),t.getPaginationRowModel=()=>(!t._getPaginationRowModel&&t.options.getPaginationRowModel&&(t._getPaginationRowModel=t.options.getPaginationRowModel(t)),t.options.manualPagination||!t._getPaginationRowModel?t.getPrePaginationRowModel():t._getPaginationRowModel()),t.getPageCount=()=>{var o;return(o=t.options.pageCount)!=null?o:Math.ceil(t.getRowCount()/t.getState().pagination.pageSize)},t.getRowCount=()=>{var o;return(o=t.options.rowCount)!=null?o:t.getPrePaginationRowModel().rows.length}}},kp=()=>({top:[],bottom:[]}),dW={getInitialState:t=>({rowPinning:kp(),...t}),getDefaultOptions:t=>({onRowPinningChange:No("rowPinning",t)}),createRow:(t,e)=>{t.pin=(n,o,s)=>{const i=o?t.getLeafRows().map(d=>{let{id:f}=d;return f}):[],l=s?t.getParentRows().map(d=>{let{id:f}=d;return f}):[],u=new Set([...l,t.id,...i]);e.setRowPinning(d=>{var f,g;if(n==="bottom"){var m,y;return{top:((m=d?.top)!=null?m:[]).filter(C=>!(u!=null&&u.has(C))),bottom:[...((y=d?.bottom)!=null?y:[]).filter(C=>!(u!=null&&u.has(C))),...Array.from(u)]}}if(n==="top"){var v,w;return{top:[...((v=d?.top)!=null?v:[]).filter(C=>!(u!=null&&u.has(C))),...Array.from(u)],bottom:((w=d?.bottom)!=null?w:[]).filter(C=>!(u!=null&&u.has(C)))}}return{top:((f=d?.top)!=null?f:[]).filter(C=>!(u!=null&&u.has(C))),bottom:((g=d?.bottom)!=null?g:[]).filter(C=>!(u!=null&&u.has(C)))}})},t.getCanPin=()=>{var n;const{enableRowPinning:o,enablePinning:s}=e.options;return typeof o=="function"?o(t):(n=o??s)!=null?n:!0},t.getIsPinned=()=>{const n=[t.id],{top:o,bottom:s}=e.getState().rowPinning,i=n.some(u=>o?.includes(u)),l=n.some(u=>s?.includes(u));return i?"top":l?"bottom":!1},t.getPinnedIndex=()=>{var n,o;const s=t.getIsPinned();if(!s)return-1;const i=(n=s==="top"?e.getTopRows():e.getBottomRows())==null?void 0:n.map(l=>{let{id:u}=l;return u});return(o=i?.indexOf(t.id))!=null?o:-1}},createTable:t=>{t.setRowPinning=e=>t.options.onRowPinningChange==null?void 0:t.options.onRowPinningChange(e),t.resetRowPinning=e=>{var n,o;return t.setRowPinning(e?kp():(n=(o=t.initialState)==null?void 0:o.rowPinning)!=null?n:kp())},t.getIsSomeRowsPinned=e=>{var n;const o=t.getState().rowPinning;if(!e){var s,i;return!!((s=o.top)!=null&&s.length||(i=o.bottom)!=null&&i.length)}return!!((n=o[e])!=null&&n.length)},t._getPinnedRows=(e,n,o)=>{var s;return((s=t.options.keepPinnedRows)==null||s?(n??[]).map(l=>{const u=t.getRow(l,!0);return u.getIsAllParentsExpanded()?u:null}):(n??[]).map(l=>e.find(u=>u.id===l))).filter(Boolean).map(l=>({...l,position:o}))},t.getTopRows=Je(()=>[t.getRowModel().rows,t.getState().rowPinning.top],(e,n)=>t._getPinnedRows(e,n,"top"),et(t.options,"debugRows")),t.getBottomRows=Je(()=>[t.getRowModel().rows,t.getState().rowPinning.bottom],(e,n)=>t._getPinnedRows(e,n,"bottom"),et(t.options,"debugRows")),t.getCenterRows=Je(()=>[t.getRowModel().rows,t.getState().rowPinning.top,t.getState().rowPinning.bottom],(e,n,o)=>{const s=new Set([...n??[],...o??[]]);return e.filter(i=>!s.has(i.id))},et(t.options,"debugRows"))}},fW={getInitialState:t=>({rowSelection:{},...t}),getDefaultOptions:t=>({onRowSelectionChange:No("rowSelection",t),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:t=>{t.setRowSelection=e=>t.options.onRowSelectionChange==null?void 0:t.options.onRowSelectionChange(e),t.resetRowSelection=e=>{var n;return t.setRowSelection(e?{}:(n=t.initialState.rowSelection)!=null?n:{})},t.toggleAllRowsSelected=e=>{t.setRowSelection(n=>{e=typeof e<"u"?e:!t.getIsAllRowsSelected();const o={...n},s=t.getPreGroupedRowModel().flatRows;return e?s.forEach(i=>{i.getCanSelect()&&(o[i.id]=!0)}):s.forEach(i=>{delete o[i.id]}),o})},t.toggleAllPageRowsSelected=e=>t.setRowSelection(n=>{const o=typeof e<"u"?e:!t.getIsAllPageRowsSelected(),s={...n};return t.getRowModel().rows.forEach(i=>{C0(s,i.id,o,!0,t)}),s}),t.getPreSelectedRowModel=()=>t.getCoreRowModel(),t.getSelectedRowModel=Je(()=>[t.getState().rowSelection,t.getCoreRowModel()],(e,n)=>Object.keys(e).length?jp(t,n):{rows:[],flatRows:[],rowsById:{}},et(t.options,"debugTable")),t.getFilteredSelectedRowModel=Je(()=>[t.getState().rowSelection,t.getFilteredRowModel()],(e,n)=>Object.keys(e).length?jp(t,n):{rows:[],flatRows:[],rowsById:{}},et(t.options,"debugTable")),t.getGroupedSelectedRowModel=Je(()=>[t.getState().rowSelection,t.getSortedRowModel()],(e,n)=>Object.keys(e).length?jp(t,n):{rows:[],flatRows:[],rowsById:{}},et(t.options,"debugTable")),t.getIsAllRowsSelected=()=>{const e=t.getFilteredRowModel().flatRows,{rowSelection:n}=t.getState();let o=!!(e.length&&Object.keys(n).length);return o&&e.some(s=>s.getCanSelect()&&!n[s.id])&&(o=!1),o},t.getIsAllPageRowsSelected=()=>{const e=t.getPaginationRowModel().flatRows.filter(s=>s.getCanSelect()),{rowSelection:n}=t.getState();let o=!!e.length;return o&&e.some(s=>!n[s.id])&&(o=!1),o},t.getIsSomeRowsSelected=()=>{var e;const n=Object.keys((e=t.getState().rowSelection)!=null?e:{}).length;return n>0&&n<t.getFilteredRowModel().flatRows.length},t.getIsSomePageRowsSelected=()=>{const e=t.getPaginationRowModel().flatRows;return t.getIsAllPageRowsSelected()?!1:e.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},t.getToggleAllRowsSelectedHandler=()=>e=>{t.toggleAllRowsSelected(e.target.checked)},t.getToggleAllPageRowsSelectedHandler=()=>e=>{t.toggleAllPageRowsSelected(e.target.checked)}},createRow:(t,e)=>{t.toggleSelected=(n,o)=>{const s=t.getIsSelected();e.setRowSelection(i=>{var l;if(n=typeof n<"u"?n:!s,t.getCanSelect()&&s===n)return i;const u={...i};return C0(u,t.id,n,(l=o?.selectChildren)!=null?l:!0,e),u})},t.getIsSelected=()=>{const{rowSelection:n}=e.getState();return iv(t,n)},t.getIsSomeSelected=()=>{const{rowSelection:n}=e.getState();return E0(t,n)==="some"},t.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=e.getState();return E0(t,n)==="all"},t.getCanSelect=()=>{var n;return typeof e.options.enableRowSelection=="function"?e.options.enableRowSelection(t):(n=e.options.enableRowSelection)!=null?n:!0},t.getCanSelectSubRows=()=>{var n;return typeof e.options.enableSubRowSelection=="function"?e.options.enableSubRowSelection(t):(n=e.options.enableSubRowSelection)!=null?n:!0},t.getCanMultiSelect=()=>{var n;return typeof e.options.enableMultiRowSelection=="function"?e.options.enableMultiRowSelection(t):(n=e.options.enableMultiRowSelection)!=null?n:!0},t.getToggleSelectedHandler=()=>{const n=t.getCanSelect();return o=>{var s;n&&t.toggleSelected((s=o.target)==null?void 0:s.checked)}}}},C0=(t,e,n,o,s)=>{var i;const l=s.getRow(e,!0);n?(l.getCanMultiSelect()||Object.keys(t).forEach(u=>delete t[u]),l.getCanSelect()&&(t[e]=!0)):delete t[e],o&&(i=l.subRows)!=null&&i.length&&l.getCanSelectSubRows()&&l.subRows.forEach(u=>C0(t,u.id,n,o,s))};function jp(t,e){const n=t.getState().rowSelection,o=[],s={},i=function(l,u){return l.map(d=>{var f;const g=iv(d,n);if(g&&(o.push(d),s[d.id]=d),(f=d.subRows)!=null&&f.length&&(d={...d,subRows:i(d.subRows)}),g)return d}).filter(Boolean)};return{rows:i(e.rows),flatRows:o,rowsById:s}}function iv(t,e){var n;return(n=e[t.id])!=null?n:!1}function E0(t,e,n){var o;if(!((o=t.subRows)!=null&&o.length))return!1;let s=!0,i=!1;return t.subRows.forEach(l=>{if(!(i&&!s)&&(l.getCanSelect()&&(iv(l,e)?i=!0:s=!1),l.subRows&&l.subRows.length)){const u=E0(l,e);u==="all"?i=!0:(u==="some"&&(i=!0),s=!1)}}),s?"all":i?"some":!1}const _0=/([0-9]+)/gm,hW=(t,e,n)=>v3(aa(t.getValue(n)).toLowerCase(),aa(e.getValue(n)).toLowerCase()),mW=(t,e,n)=>v3(aa(t.getValue(n)),aa(e.getValue(n))),gW=(t,e,n)=>lv(aa(t.getValue(n)).toLowerCase(),aa(e.getValue(n)).toLowerCase()),pW=(t,e,n)=>lv(aa(t.getValue(n)),aa(e.getValue(n))),yW=(t,e,n)=>{const o=t.getValue(n),s=e.getValue(n);return o>s?1:o<s?-1:0},vW=(t,e,n)=>lv(t.getValue(n),e.getValue(n));function lv(t,e){return t===e?0:t>e?1:-1}function aa(t){return typeof t=="number"?isNaN(t)||t===1/0||t===-1/0?"":String(t):typeof t=="string"?t:""}function v3(t,e){const n=t.split(_0).filter(Boolean),o=e.split(_0).filter(Boolean);for(;n.length&&o.length;){const s=n.shift(),i=o.shift(),l=parseInt(s,10),u=parseInt(i,10),d=[l,u].sort();if(isNaN(d[0])){if(s>i)return 1;if(i>s)return-1;continue}if(isNaN(d[1]))return isNaN(l)?-1:1;if(l>u)return 1;if(u>l)return-1}return n.length-o.length}const bc={alphanumeric:hW,alphanumericCaseSensitive:mW,text:gW,textCaseSensitive:pW,datetime:yW,basic:vW},xW={getInitialState:t=>({sorting:[],...t}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:t=>({onSortingChange:No("sorting",t),isMultiSortEvent:e=>e.shiftKey}),createColumn:(t,e)=>{t.getAutoSortingFn=()=>{const n=e.getFilteredRowModel().flatRows.slice(10);let o=!1;for(const s of n){const i=s?.getValue(t.id);if(Object.prototype.toString.call(i)==="[object Date]")return bc.datetime;if(typeof i=="string"&&(o=!0,i.split(_0).length>1))return bc.alphanumeric}return o?bc.text:bc.basic},t.getAutoSortDir=()=>{const n=e.getFilteredRowModel().flatRows[0];return typeof n?.getValue(t.id)=="string"?"asc":"desc"},t.getSortingFn=()=>{var n,o;if(!t)throw new Error;return Mh(t.columnDef.sortingFn)?t.columnDef.sortingFn:t.columnDef.sortingFn==="auto"?t.getAutoSortingFn():(n=(o=e.options.sortingFns)==null?void 0:o[t.columnDef.sortingFn])!=null?n:bc[t.columnDef.sortingFn]},t.toggleSorting=(n,o)=>{const s=t.getNextSortingOrder(),i=typeof n<"u"&&n!==null;e.setSorting(l=>{const u=l?.find(v=>v.id===t.id),d=l?.findIndex(v=>v.id===t.id);let f=[],g,m=i?n:s==="desc";if(l!=null&&l.length&&t.getCanMultiSort()&&o?u?g="toggle":g="add":l!=null&&l.length&&d!==l.length-1?g="replace":u?g="toggle":g="replace",g==="toggle"&&(i||s||(g="remove")),g==="add"){var y;f=[...l,{id:t.id,desc:m}],f.splice(0,f.length-((y=e.options.maxMultiSortColCount)!=null?y:Number.MAX_SAFE_INTEGER))}else g==="toggle"?f=l.map(v=>v.id===t.id?{...v,desc:m}:v):g==="remove"?f=l.filter(v=>v.id!==t.id):f=[{id:t.id,desc:m}];return f})},t.getFirstSortDir=()=>{var n,o;return((n=(o=t.columnDef.sortDescFirst)!=null?o:e.options.sortDescFirst)!=null?n:t.getAutoSortDir()==="desc")?"desc":"asc"},t.getNextSortingOrder=n=>{var o,s;const i=t.getFirstSortDir(),l=t.getIsSorted();return l?l!==i&&((o=e.options.enableSortingRemoval)==null||o)&&(!(n&&(s=e.options.enableMultiRemove)!=null)||s)?!1:l==="desc"?"asc":"desc":i},t.getCanSort=()=>{var n,o;return((n=t.columnDef.enableSorting)!=null?n:!0)&&((o=e.options.enableSorting)!=null?o:!0)&&!!t.accessorFn},t.getCanMultiSort=()=>{var n,o;return(n=(o=t.columnDef.enableMultiSort)!=null?o:e.options.enableMultiSort)!=null?n:!!t.accessorFn},t.getIsSorted=()=>{var n;const o=(n=e.getState().sorting)==null?void 0:n.find(s=>s.id===t.id);return o?o.desc?"desc":"asc":!1},t.getSortIndex=()=>{var n,o;return(n=(o=e.getState().sorting)==null?void 0:o.findIndex(s=>s.id===t.id))!=null?n:-1},t.clearSorting=()=>{e.setSorting(n=>n!=null&&n.length?n.filter(o=>o.id!==t.id):[])},t.getToggleSortingHandler=()=>{const n=t.getCanSort();return o=>{n&&(o.persist==null||o.persist(),t.toggleSorting==null||t.toggleSorting(void 0,t.getCanMultiSort()?e.options.isMultiSortEvent==null?void 0:e.options.isMultiSortEvent(o):!1))}}},createTable:t=>{t.setSorting=e=>t.options.onSortingChange==null?void 0:t.options.onSortingChange(e),t.resetSorting=e=>{var n,o;t.setSorting(e?[]:(n=(o=t.initialState)==null?void 0:o.sorting)!=null?n:[])},t.getPreSortedRowModel=()=>t.getGroupedRowModel(),t.getSortedRowModel=()=>(!t._getSortedRowModel&&t.options.getSortedRowModel&&(t._getSortedRowModel=t.options.getSortedRowModel(t)),t.options.manualSorting||!t._getSortedRowModel?t.getPreSortedRowModel():t._getSortedRowModel())}},bW=[Bq,aW,tW,nW,Fq,Vq,iW,lW,xW,Jq,cW,uW,dW,fW,rW];function wW(t){var e,n;const o=[...bW,...(e=t._features)!=null?e:[]];let s={_features:o};const i=s._features.reduce((y,v)=>Object.assign(y,v.getDefaultOptions==null?void 0:v.getDefaultOptions(s)),{}),l=y=>s.options.mergeOptions?s.options.mergeOptions(i,y):{...i,...y};let d={...{},...(n=t.initialState)!=null?n:{}};s._features.forEach(y=>{var v;d=(v=y.getInitialState==null?void 0:y.getInitialState(d))!=null?v:d});const f=[];let g=!1;const m={_features:o,options:{...i,...t},initialState:d,_queue:y=>{f.push(y),g||(g=!0,Promise.resolve().then(()=>{for(;f.length;)f.shift()();g=!1}).catch(v=>setTimeout(()=>{throw v})))},reset:()=>{s.setState(s.initialState)},setOptions:y=>{const v=Qs(y,s.options);s.options=l(v)},getState:()=>s.options.state,setState:y=>{s.options.onStateChange==null||s.options.onStateChange(y)},_getRowId:(y,v,w)=>{var C;return(C=s.options.getRowId==null?void 0:s.options.getRowId(y,v,w))!=null?C:`${w?[w.id,v].join("."):v}`},getCoreRowModel:()=>(s._getCoreRowModel||(s._getCoreRowModel=s.options.getCoreRowModel(s)),s._getCoreRowModel()),getRowModel:()=>s.getPaginationRowModel(),getRow:(y,v)=>{let w=(v?s.getPrePaginationRowModel():s.getRowModel()).rowsById[y];if(!w&&(w=s.getCoreRowModel().rowsById[y],!w))throw new Error;return w},_getDefaultColumnDef:Je(()=>[s.options.defaultColumn],y=>{var v;return y=(v=y)!=null?v:{},{header:w=>{const C=w.header.column.columnDef;return C.accessorKey?C.accessorKey:C.accessorFn?C.id:null},cell:w=>{var C,S;return(C=(S=w.renderValue())==null||S.toString==null?void 0:S.toString())!=null?C:null},...s._features.reduce((w,C)=>Object.assign(w,C.getDefaultColumnDef==null?void 0:C.getDefaultColumnDef()),{}),...y}},et(t,"debugColumns")),_getColumnDefs:()=>s.options.columns,getAllColumns:Je(()=>[s._getColumnDefs()],y=>{const v=function(w,C,S){return S===void 0&&(S=0),w.map(N=>{const M=Hq(s,N,S,C),E=N;return M.columns=E.columns?v(E.columns,M,S+1):[],M})};return v(y)},et(t,"debugColumns")),getAllFlatColumns:Je(()=>[s.getAllColumns()],y=>y.flatMap(v=>v.getFlatColumns()),et(t,"debugColumns")),_getAllFlatColumnsById:Je(()=>[s.getAllFlatColumns()],y=>y.reduce((v,w)=>(v[w.id]=w,v),{}),et(t,"debugColumns")),getAllLeafColumns:Je(()=>[s.getAllColumns(),s._getOrderColumnsFn()],(y,v)=>{let w=y.flatMap(C=>C.getLeafColumns());return v(w)},et(t,"debugColumns")),getColumn:y=>s._getAllFlatColumnsById()[y]};Object.assign(s,m);for(let y=0;y<s._features.length;y++){const v=s._features[y];v==null||v.createTable==null||v.createTable(s)}return s}function SW(){return t=>Je(()=>[t.options.data],e=>{const n={rows:[],flatRows:[],rowsById:{}},o=function(s,i,l){i===void 0&&(i=0);const u=[];for(let f=0;f<s.length;f++){const g=sv(t,t._getRowId(s[f],f,l),s[f],f,i,void 0,l?.id);if(n.flatRows.push(g),n.rowsById[g.id]=g,u.push(g),t.options.getSubRows){var d;g.originalSubRows=t.options.getSubRows(s[f],f),(d=g.originalSubRows)!=null&&d.length&&(g.subRows=o(g.originalSubRows,i+1,g))}}return u};return n.rows=o(e),n},et(t.options,"debugTable","getRowModel",()=>t._autoResetPageIndex()))}function CW(t,e,n){return n.options.filterFromLeafRows?EW(t,e,n):_W(t,e,n)}function EW(t,e,n){var o;const s=[],i={},l=(o=n.options.maxLeafRowFilterDepth)!=null?o:100,u=function(d,f){f===void 0&&(f=0);const g=[];for(let y=0;y<d.length;y++){var m;let v=d[y];const w=sv(n,v.id,v.original,v.index,v.depth,void 0,v.parentId);if(w.columnFilters=v.columnFilters,(m=v.subRows)!=null&&m.length&&f<l){if(w.subRows=u(v.subRows,f+1),v=w,e(v)&&!w.subRows.length){g.push(v),i[v.id]=v,s.push(v);continue}if(e(v)||w.subRows.length){g.push(v),i[v.id]=v,s.push(v);continue}}else v=w,e(v)&&(g.push(v),i[v.id]=v,s.push(v))}return g};return{rows:u(t),flatRows:s,rowsById:i}}function _W(t,e,n){var o;const s=[],i={},l=(o=n.options.maxLeafRowFilterDepth)!=null?o:100,u=function(d,f){f===void 0&&(f=0);const g=[];for(let y=0;y<d.length;y++){let v=d[y];if(e(v)){var m;if((m=v.subRows)!=null&&m.length&&f<l){const C=sv(n,v.id,v.original,v.index,v.depth,void 0,v.parentId);C.subRows=u(v.subRows,f+1),v=C}g.push(v),s.push(v),i[v.id]=v}}return g};return{rows:u(t),flatRows:s,rowsById:i}}function NW(){return t=>Je(()=>[t.getPreFilteredRowModel(),t.getState().columnFilters,t.getState().globalFilter],(e,n,o)=>{if(!e.rows.length||!(n!=null&&n.length)&&!o){for(let y=0;y<e.flatRows.length;y++)e.flatRows[y].columnFilters={},e.flatRows[y].columnFiltersMeta={};return e}const s=[],i=[];(n??[]).forEach(y=>{var v;const w=t.getColumn(y.id);if(!w)return;const C=w.getFilterFn();C&&s.push({id:y.id,filterFn:C,resolvedValue:(v=C.resolveFilterValue==null?void 0:C.resolveFilterValue(y.value))!=null?v:y.value})});const l=(n??[]).map(y=>y.id),u=t.getGlobalFilterFn(),d=t.getAllLeafColumns().filter(y=>y.getCanGlobalFilter());o&&u&&d.length&&(l.push("__global__"),d.forEach(y=>{var v;i.push({id:y.id,filterFn:u,resolvedValue:(v=u.resolveFilterValue==null?void 0:u.resolveFilterValue(o))!=null?v:o})}));let f,g;for(let y=0;y<e.flatRows.length;y++){const v=e.flatRows[y];if(v.columnFilters={},s.length)for(let w=0;w<s.length;w++){f=s[w];const C=f.id;v.columnFilters[C]=f.filterFn(v,C,f.resolvedValue,S=>{v.columnFiltersMeta[C]=S})}if(i.length){for(let w=0;w<i.length;w++){g=i[w];const C=g.id;if(g.filterFn(v,C,g.resolvedValue,S=>{v.columnFiltersMeta[C]=S})){v.columnFilters.__global__=!0;break}}v.columnFilters.__global__!==!0&&(v.columnFilters.__global__=!1)}}const m=y=>{for(let v=0;v<l.length;v++)if(y.columnFilters[l[v]]===!1)return!1;return!0};return CW(e.rows,m,t)},et(t.options,"debugTable","getFilteredRowModel",()=>t._autoResetPageIndex()))}function MW(){return t=>Je(()=>[t.getState().sorting,t.getPreSortedRowModel()],(e,n)=>{if(!n.rows.length||!(e!=null&&e.length))return n;const o=t.getState().sorting,s=[],i=o.filter(d=>{var f;return(f=t.getColumn(d.id))==null?void 0:f.getCanSort()}),l={};i.forEach(d=>{const f=t.getColumn(d.id);f&&(l[d.id]={sortUndefined:f.columnDef.sortUndefined,invertSorting:f.columnDef.invertSorting,sortingFn:f.getSortingFn()})});const u=d=>{const f=d.map(g=>({...g}));return f.sort((g,m)=>{for(let v=0;v<i.length;v+=1){var y;const w=i[v],C=l[w.id],S=C.sortUndefined,N=(y=w?.desc)!=null?y:!1;let M=0;if(S){const E=g.getValue(w.id),R=m.getValue(w.id),D=E===void 0,T=R===void 0;if(D||T){if(S==="first")return D?-1:1;if(S==="last")return D?1:-1;M=D&&T?0:D?S:-S}}if(M===0&&(M=C.sortingFn(g,m,w.id)),M!==0)return N&&(M*=-1),C.invertSorting&&(M*=-1),M}return g.index-m.index}),f.forEach(g=>{var m;s.push(g),(m=g.subRows)!=null&&m.length&&(g.subRows=u(g.subRows))}),f};return{rows:u(n.rows),flatRows:s,rowsById:n.rowsById}},et(t.options,"debugTable","getSortedRowModel",()=>t._autoResetPageIndex()))}function RW(t){const e={state:{},onStateChange:()=>{},renderFallbackValue:null,...t},[n]=x.useState(()=>({current:wW(e)})),[o,s]=x.useState(()=>n.current.initialState);return n.current.setOptions(i=>({...i,...t,state:{...o,...t.state},onStateChange:l=>{s(l),t.onStateChange==null||t.onStateChange(l)}})),n.current}function Pi(t,e,n){let o=n.initialDeps??[],s,i=!0;function l(){var u,d,f;let g;n.key&&((u=n.debug)!=null&&u.call(n))&&(g=Date.now());const m=t();if(!(m.length!==o.length||m.some((w,C)=>o[C]!==w)))return s;o=m;let v;if(n.key&&((d=n.debug)!=null&&d.call(n))&&(v=Date.now()),s=e(...m),n.key&&((f=n.debug)!=null&&f.call(n))){const w=Math.round((Date.now()-g)*100)/100,C=Math.round((Date.now()-v)*100)/100,S=C/16,N=(M,E)=>{for(M=String(M);M.length<E;)M=" "+M;return M};console.info(`%c⏱ ${N(C,5)} /${N(w,5)} ms`,`
65
- font-size: .6rem;
66
- font-weight: bold;
67
- color: hsl(${Math.max(0,Math.min(120-120*S,120))}deg 100% 31%);`,n?.key)}return n?.onChange&&!(i&&n.skipInitialOnChange)&&n.onChange(s),i=!1,s}return l.updateDeps=u=>{o=u},l}function P2(t,e){if(t===void 0)throw new Error("Unexpected undefined");return t}const DW=(t,e)=>Math.abs(t-e)<1.01,TW=(t,e,n)=>{let o;return function(...s){t.clearTimeout(o),o=t.setTimeout(()=>e.apply(this,s),n)}},$2=t=>{const{offsetWidth:e,offsetHeight:n}=t;return{width:e,height:n}},kW=t=>t,jW=t=>{const e=Math.max(t.startIndex-t.overscan,0),n=Math.min(t.endIndex+t.overscan,t.count-1),o=[];for(let s=e;s<=n;s++)o.push(s);return o},AW=(t,e)=>{const n=t.scrollElement;if(!n)return;const o=t.targetWindow;if(!o)return;const s=l=>{const{width:u,height:d}=l;e({width:Math.round(u),height:Math.round(d)})};if(s($2(n)),!o.ResizeObserver)return()=>{};const i=new o.ResizeObserver(l=>{const u=()=>{const d=l[0];if(d?.borderBoxSize){const f=d.borderBoxSize[0];if(f){s({width:f.inlineSize,height:f.blockSize});return}}s($2(n))};t.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(u):u()});return i.observe(n,{box:"border-box"}),()=>{i.unobserve(n)}},L2={passive:!0},H2=typeof window>"u"?!0:"onscrollend"in window,OW=(t,e)=>{const n=t.scrollElement;if(!n)return;const o=t.targetWindow;if(!o)return;let s=0;const i=t.options.useScrollendEvent&&H2?()=>{}:TW(o,()=>{e(s,!1)},t.options.isScrollingResetDelay),l=g=>()=>{const{horizontal:m,isRtl:y}=t.options;s=m?n.scrollLeft*(y&&-1||1):n.scrollTop,i(),e(s,g)},u=l(!0),d=l(!1);n.addEventListener("scroll",u,L2);const f=t.options.useScrollendEvent&&H2;return f&&n.addEventListener("scrollend",d,L2),()=>{n.removeEventListener("scroll",u),f&&n.removeEventListener("scrollend",d)}},zW=(t,e,n)=>{if(e?.borderBoxSize){const o=e.borderBoxSize[0];if(o)return Math.round(o[n.options.horizontal?"inlineSize":"blockSize"])}return t[n.options.horizontal?"offsetWidth":"offsetHeight"]},IW=(t,{adjustments:e=0,behavior:n},o)=>{var s,i;const l=t+e;(i=(s=o.scrollElement)==null?void 0:s.scrollTo)==null||i.call(s,{[o.options.horizontal?"left":"top"]:l,behavior:n})};class PW{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.currentScrollToIndex=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let n=null;const o=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(s=>{s.forEach(i=>{const l=()=>{this._measureElement(i.target,i)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(l):l()})}));return{disconnect:()=>{var s;(s=o())==null||s.disconnect(),n=null},observe:s=>{var i;return(i=o())==null?void 0:i.observe(s,{box:"border-box"})},unobserve:s=>{var i;return(i=o())==null?void 0:i.unobserve(s)}}})(),this.range=null,this.setOptions=n=>{Object.entries(n).forEach(([o,s])=>{typeof s>"u"&&delete n[o]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:kW,rangeExtractor:jW,onChange:()=>{},measureElement:zW,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...n}},this.notify=n=>{var o,s;(s=(o=this.options).onChange)==null||s.call(o,this,n)},this.maybeNotify=Pi(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const o=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==o){if(this.cleanup(),!o){this.maybeNotify();return}this.scrollElement=o,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this.elementsCache.forEach(s=>{this.observer.observe(s)}),this.unsubs.push(this.options.observeElementRect(this,s=>{this.scrollRect=s,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(s,i)=>{this.scrollAdjustments=0,this.scrollDirection=i?this.getScrollOffset()<s?"forward":"backward":null,this.scrollOffset=s,this.isScrolling=i,this.maybeNotify()})),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(n,o)=>{const s=new Map,i=new Map;for(let l=o-1;l>=0;l--){const u=n[l];if(s.has(u.lane))continue;const d=i.get(u.lane);if(d==null||u.end>d.end?i.set(u.lane,u):u.end<d.end&&s.set(u.lane,!0),s.size===this.options.lanes)break}return i.size===this.options.lanes?Array.from(i.values()).sort((l,u)=>l.end===u.end?l.index-u.index:l.end-u.end)[0]:void 0},this.getMeasurementOptions=Pi(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes],(n,o,s,i,l,u)=>(this.prevLanes!==void 0&&this.prevLanes!==u&&(this.lanesChangedFlag=!0),this.prevLanes=u,this.pendingMeasuredCacheIndexes=[],{count:n,paddingStart:o,scrollMargin:s,getItemKey:i,enabled:l,lanes:u}),{key:!1}),this.getMeasurements=Pi(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:n,paddingStart:o,scrollMargin:s,getItemKey:i,enabled:l,lanes:u},d)=>{if(!l)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>n)for(const y of this.laneAssignments.keys())y>=n&&this.laneAssignments.delete(y);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(y=>{this.itemSizeCache.set(y.key,y.size)}));const f=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===n&&(this.lanesSettling=!1);const g=this.measurementsCache.slice(0,f),m=new Array(u).fill(void 0);for(let y=0;y<f;y++){const v=g[y];v&&(m[v.lane]=y)}for(let y=f;y<n;y++){const v=i(y),w=this.laneAssignments.get(y);let C,S;if(w!==void 0&&this.options.lanes>1){C=w;const R=m[C],D=R!==void 0?g[R]:void 0;S=D?D.end+this.options.gap:o+s}else{const R=this.options.lanes===1?g[y-1]:this.getFurthestMeasurement(g,y);S=R?R.end+this.options.gap:o+s,C=R?R.lane:y%this.options.lanes,this.options.lanes>1&&this.laneAssignments.set(y,C)}const N=d.get(v),M=typeof N=="number"?N:this.options.estimateSize(y),E=S+M;g[y]={index:y,start:S,size:M,end:E,key:v,lane:C},m[C]=y}return this.measurementsCache=g,g},{key:!1,debug:()=>this.options.debug}),this.calculateRange=Pi(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,o,s,i)=>this.range=n.length>0&&o>0?$W({measurements:n,outerSize:o,scrollOffset:s,lanes:i}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=Pi(()=>{let n=null,o=null;const s=this.calculateRange();return s&&(n=s.startIndex,o=s.endIndex),this.maybeNotify.updateDeps([this.isScrolling,n,o]),[this.options.rangeExtractor,this.options.overscan,this.options.count,n,o]},(n,o,s,i,l)=>i===null||l===null?[]:n({startIndex:i,endIndex:l,overscan:o,count:s}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=n=>{const o=this.options.indexAttribute,s=n.getAttribute(o);return s?parseInt(s,10):(console.warn(`Missing attribute name '${o}={index}' on measured element.`),-1)},this._measureElement=(n,o)=>{const s=this.indexFromElement(n),i=this.measurementsCache[s];if(!i)return;const l=i.key,u=this.elementsCache.get(l);u!==n&&(u&&this.observer.unobserve(u),this.observer.observe(n),this.elementsCache.set(l,n)),n.isConnected&&this.resizeItem(s,this.options.measureElement(n,o,this))},this.resizeItem=(n,o)=>{const s=this.measurementsCache[n];if(!s)return;const i=this.itemSizeCache.get(s.key)??s.size,l=o-i;l!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(s,l,this):s.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=l,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(s.index),this.itemSizeCache=new Map(this.itemSizeCache.set(s.key,o)),this.notify(!1))},this.measureElement=n=>{if(!n){this.elementsCache.forEach((o,s)=>{o.isConnected||(this.observer.unobserve(o),this.elementsCache.delete(s))});return}this._measureElement(n,void 0)},this.getVirtualItems=Pi(()=>[this.getVirtualIndexes(),this.getMeasurements()],(n,o)=>{const s=[];for(let i=0,l=n.length;i<l;i++){const u=n[i],d=o[u];s.push(d)}return s},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const o=this.getMeasurements();if(o.length!==0)return P2(o[x3(0,o.length-1,s=>P2(o[s]).start,n)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const n=this.scrollElement.document.documentElement;return this.options.horizontal?n.scrollWidth-this.scrollElement.innerWidth:n.scrollHeight-this.scrollElement.innerHeight}},this.getOffsetForAlignment=(n,o,s=0)=>{if(!this.scrollElement)return 0;const i=this.getSize(),l=this.getScrollOffset();o==="auto"&&(o=n>=l+i?"end":"start"),o==="center"?n+=(s-i)/2:o==="end"&&(n-=i);const u=this.getMaxScrollOffset();return Math.max(Math.min(u,n),0)},this.getOffsetForIndex=(n,o="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const s=this.measurementsCache[n];if(!s)return;const i=this.getSize(),l=this.getScrollOffset();if(o==="auto")if(s.end>=l+i-this.options.scrollPaddingEnd)o="end";else if(s.start<=l+this.options.scrollPaddingStart)o="start";else return[l,o];if(o==="end"&&n===this.options.count-1)return[this.getMaxScrollOffset(),o];const u=o==="end"?s.end+this.options.scrollPaddingEnd:s.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(u,o,s.size),o]},this.isDynamicMode=()=>this.elementsCache.size>0,this.scrollToOffset=(n,{align:o="start",behavior:s}={})=>{s==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(n,o),{adjustments:void 0,behavior:s})},this.scrollToIndex=(n,{align:o="auto",behavior:s}={})=>{s==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),n=Math.max(0,Math.min(n,this.options.count-1)),this.currentScrollToIndex=n;let i=0;const l=10,u=f=>{if(!this.targetWindow)return;const g=this.getOffsetForIndex(n,f);if(!g){console.warn("Failed to get offset for index:",n);return}const[m,y]=g;this._scrollToOffset(m,{adjustments:void 0,behavior:s}),this.targetWindow.requestAnimationFrame(()=>{const v=()=>{if(this.currentScrollToIndex!==n)return;const w=this.getScrollOffset(),C=this.getOffsetForIndex(n,y);if(!C){console.warn("Failed to get offset for index:",n);return}DW(C[0],w)||d(y)};this.isDynamicMode()?this.targetWindow.requestAnimationFrame(v):v()})},d=f=>{this.targetWindow&&this.currentScrollToIndex===n&&(i++,i<l?this.targetWindow.requestAnimationFrame(()=>u(f)):console.warn(`Failed to scroll to index ${n} after ${l} attempts.`))};u(o)},this.scrollBy=(n,{behavior:o}={})=>{o==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+n,{adjustments:void 0,behavior:o})},this.getTotalSize=()=>{var n;const o=this.getMeasurements();let s;if(o.length===0)s=this.options.paddingStart;else if(this.options.lanes===1)s=((n=o[o.length-1])==null?void 0:n.end)??0;else{const i=Array(this.options.lanes).fill(null);let l=o.length-1;for(;l>=0&&i.some(u=>u===null);){const u=o[l];i[u.lane]===null&&(i[u.lane]=u.end),l--}s=Math.max(...i.filter(u=>u!==null))}return Math.max(s-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(n,{adjustments:o,behavior:s})=>{this.options.scrollToFn(n,{behavior:s,adjustments:o},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(e)}}const x3=(t,e,n,o)=>{for(;t<=e;){const s=(t+e)/2|0,i=n(s);if(i<o)t=s+1;else if(i>o)e=s-1;else return s}return t>0?t-1:0};function $W({measurements:t,outerSize:e,scrollOffset:n,lanes:o}){const s=t.length-1,i=d=>t[d].start;if(t.length<=o)return{startIndex:0,endIndex:s};let l=x3(0,s,i,n),u=l;if(o===1)for(;u<s&&t[u].end<n+e;)u++;else if(o>1){const d=Array(o).fill(0);for(;u<s&&d.some(g=>g<n+e);){const g=t[u];d[g.lane]=g.end,u++}const f=Array(o).fill(n+e);for(;l>=0&&f.some(g=>g>=n);){const g=t[l];f[g.lane]=g.start,l--}l=Math.max(0,l-l%o),u=Math.min(s,u+(o-1-u%o))}return{startIndex:l,endIndex:u}}const B2=typeof document<"u"?x.useLayoutEffect:x.useEffect;function LW({useFlushSync:t=!0,...e}){const n=x.useReducer(()=>({}),{})[1],o={...e,onChange:(i,l)=>{var u;t&&l?qa.flushSync(n):n(),(u=e.onChange)==null||u.call(e,i,l)}},[s]=x.useState(()=>new PW(o));return s.setOptions(o),B2(()=>s._didMount(),[]),B2(()=>s._willUpdate()),s}function HW(t){return LW({observeElementRect:AW,observeElementOffset:OW,scrollToFn:IW,...t})}function Ap(t){const e=ge.c(2),n=x.useRef(null);if(n.current===null){let o;e[0]!==t?(o=t(),e[0]=t,e[1]=o):o=e[1],n.current=o}return n}const BW="short",FW=6,Lo=1,F2=5,VW=16,UW=60,YW=800,V2="f",U2=["select","actions"],GW=/^[\w.-]+\.[a-z]{2,}(\/\S*)?$/i,qW=/^\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}:\d{2}.*)?$/,WW=new Set(["true","1","yes","checked"]),KW=new Set(["true","false","1","0","yes","no","checked","unchecked"]);function xo(t,e){const n=ge.c(3);let o;n[0]!==e||n[1]!==t?(o=()=>e(t.getState()),n[0]=e,n[1]=t,n[2]=o):o=n[2];const s=o;return x.useSyncExternalStore(t.subscribe,s,s)}function XW({data:t,columns:e,rowHeight:n=BW,overscan:o=FW,dir:s,initialState:i,...l}){const u=Pf(s),d=x.useRef(null),f=x.useRef(null),g=x.useRef(null),m=x.useRef(null),y=x.useRef(new Map),v=x.useRef(new Map),w=x.useRef(null),C=x.useRef(!1),S=gu({...l,data:t,columns:e,initialState:i}),N=Ap(()=>new Set),M=Ap(()=>({sorting:i?.sorting??[],columnFilters:i?.columnFilters??[],rowHeight:n,rowSelection:i?.rowSelection??{},selectionState:{selectedCells:new Set,selectionRange:null,isSelecting:!1},focusedCell:null,editingCell:null,cutCells:new Set,contextMenu:{open:!1,x:0,y:0},searchQuery:"",searchMatches:[],matchIndex:-1,searchOpen:!1,lastClickedRowIndex:null,pasteDialog:{open:!1,rowsNeeded:0,clipboardText:""}})),E=x.useMemo(()=>{let Z=!1,oe=!1;return{subscribe:ce=>(N.current.add(ce),()=>N.current.delete(ce)),getState:()=>M.current,setState:(ce,ve)=>{Object.is(M.current[ce],ve)||(M.current[ce]=ve,Z?oe=!0:oe||(oe=!0,queueMicrotask(()=>{oe=!1,E.notify()})))},notify:()=>{for(const ce of N.current)ce()},batch:ce=>{if(Z){ce();return}Z=!0;const ve=oe;oe=!1;try{ce()}finally{Z=!1,(oe||ve)&&(oe=!1,E.notify())}}}},[N,M]),R=xo(E,Z=>Z.focusedCell),D=xo(E,Z=>Z.editingCell),T=xo(E,Z=>Z.selectionState),k=xo(E,Z=>Z.searchQuery),O=xo(E,Z=>Z.searchMatches),L=xo(E,Z=>Z.matchIndex),W=xo(E,Z=>Z.searchOpen),B=xo(E,Z=>Z.sorting),Y=xo(E,Z=>Z.columnFilters),q=xo(E,Z=>Z.rowSelection),z=xo(E,Z=>Z.rowHeight),V=xo(E,Z=>Z.contextMenu),A=xo(E,Z=>Z.pasteDialog),H=y0(z),P=Ap(()=>new Map),F=x.useMemo(()=>{const Z=T.selectedCells;if(Z.size===0)return P.current.clear(),null;const oe=new Map;for(const ve of Z){const{rowIndex:we}=Ho(ve);let Me=oe.get(we);Me||(Me=new Set,oe.set(we,Me)),Me.add(ve)}const ce=new Map;for(const[ve,we]of oe){const Me=P.current.get(ve);Me&&Me.size===we.size&&[...we].every(Pe=>Me.has(Pe))?ce.set(ve,Me):ce.set(ve,we)}return P.current=ce,ce},[T.selectedCells,P]),Q=x.useRef(null),$=x.useCallback(Z=>{const oe=f.current?.getRowModel().rows;if(oe){if(Q.current?.rows!==oe){const ce=new Map;for(const[ve,we]of oe.entries())ce.set(we.id,ve+1);Q.current={rows:oe,map:ce}}return Q.current.map.get(Z)}},[]),I=x.useMemo(()=>e.map(Z=>{if(Z.id)return Z.id;if("accessorKey"in Z)return Z.accessorKey}).filter(Z=>!!Z),[e]),U=x.useMemo(()=>I.filter(Z=>!U2.includes(Z)),[I]),K=x.useCallback(Z=>{if(S.current.readOnly)return;const oe=Array.isArray(Z)?Z:[Z];if(oe.length===0)return;const ce=f.current,ve=S.current.data,we=ce?.getRowModel().rows,Me=new Map;for(const Se of oe)if(!we||!ce){const Re=Me.get(Se.rowIndex)??[];Re.push({columnId:Se.columnId,value:Se.value}),Me.set(Se.rowIndex,Re)}else{const Re=we[Se.rowIndex];if(!Re)continue;const Te=Re.original,Ae=ve.indexOf(Te),xe=Ae!==-1?Ae:Se.rowIndex,je=Me.get(xe)??[];je.push({columnId:Se.columnId,value:Se.value}),Me.set(xe,je)}const Pe=we?.length??ve.length,Oe=new Array(Pe);for(let Se=0;Se<Pe;Se++){const Re=Me.get(Se),Te=ve[Se],Ae=we?.[Se];if(Re){const je={...Te??Ae?.original??{}};for(const{columnId:ot,value:Et}of Re)je[ot]=Et;Oe[Se]=je}else Oe[Se]=Te??Ae?.original??{}}S.current.onDataChange?.(Oe)},[S]),J=x.useCallback((Z,oe)=>E.getState().selectionState.selectedCells.has(on(Z,oe)),[E]),ne=x.useCallback(()=>{E.batch(()=>{E.setState("selectionState",{selectedCells:new Set,selectionRange:null,isSelecting:!1}),E.setState("rowSelection",{})})},[E]),X=x.useCallback(()=>{const Z=new Set,ve=(f.current?.getRowModel().rows??[]).length??S.current.data.length;for(let Pe=0;Pe<ve;Pe++)for(const Oe of I)Z.add(on(Pe,Oe));const we=I[0],Me=I[I.length-1];E.setState("selectionState",{selectedCells:Z,selectionRange:I.length>0&&ve>0&&we&&Me?{start:{rowIndex:0,columnId:we},end:{rowIndex:ve-1,columnId:Me}}:null,isSelecting:!1})},[I,S,E]),ee=x.useCallback(Z=>{const ve=(f.current?.getRowModel().rows??[]).length??S.current.data.length;if(ve===0)return;const we=new Set;for(let Me=0;Me<ve;Me++)we.add(on(Me,Z));E.setState("selectionState",{selectedCells:we,selectionRange:{start:{rowIndex:0,columnId:Z},end:{rowIndex:ve-1,columnId:Z}},isSelecting:!1})},[S,E]),se=x.useCallback((Z,oe,ce=!1)=>{const ve=I.indexOf(Z.columnId),we=I.indexOf(oe.columnId),Me=Math.min(Z.rowIndex,oe.rowIndex),Pe=Math.max(Z.rowIndex,oe.rowIndex),Oe=Math.min(ve,we),Se=Math.max(ve,we),Re=new Set;for(let Te=Me;Te<=Pe;Te++)for(let Ae=Oe;Ae<=Se;Ae++){const xe=I[Ae];xe&&Re.add(on(Te,xe))}E.setState("selectionState",{selectedCells:Re,selectionRange:{start:Z,end:oe},isSelecting:ce})},[I,E]),le=x.useCallback(async()=>{const Z=E.getState();let oe;if(Z.selectionState.selectedCells.size)oe=Array.from(Z.selectionState.selectedCells);else{if(!Z.focusedCell)return;oe=[on(Z.focusedCell.rowIndex,Z.focusedCell.columnId)]}const ve=f.current?.getRowModel().rows;if(!ve)return;const we=[];for(const xe of oe){const{columnId:je}=Ho(xe);je&&!we.includes(je)&&we.push(je)}const Me=new Map;for(const xe of oe){const{rowIndex:je,columnId:ot}=Ho(xe),Et=ve[je];if(Et){const Mt=Et.getVisibleCells().find(ct=>ct.column.id===ot);if(Mt){const ct=Mt.getValue(),Pt=Mt.column.columnDef?.meta?.cell?.variant;let rt="";Pt==="file"||Pt==="multi-select"?rt=ct?JSON.stringify(ct):"":ct instanceof Date?rt=ct.toISOString():rt=String(ct??""),Me.set(xe,rt)}}}const Pe=new Set,Oe=new Set;for(const xe of oe){const{rowIndex:je,columnId:ot}=Ho(xe);Pe.add(je);const Et=we.indexOf(ot);Et>=0&&Oe.add(Et)}const Se=Array.from(Pe).sort((xe,je)=>xe-je),Te=Array.from(Oe).sort((xe,je)=>xe-je).map(xe=>we[xe]),Ae=Se.map(xe=>Te.map(je=>{const ot=`${xe}:${je}`;return Me.get(ot)??""}).join(" ")).join(`
68
- `);try{await navigator.clipboard.writeText(Ae),E.getState().cutCells.size>0&&E.setState("cutCells",new Set),Jt.success(`${oe.length} cell${oe.length!==1?"s":""} copied`)}catch(xe){Jt.error(xe instanceof Error?xe.message:"Failed to copy to clipboard")}},[E]),pe=x.useCallback(async()=>{if(S.current.readOnly)return;const Z=E.getState();let oe;if(Z.selectionState.selectedCells.size)oe=Array.from(Z.selectionState.selectedCells);else{if(!Z.focusedCell)return;oe=[on(Z.focusedCell.rowIndex,Z.focusedCell.columnId)]}const ve=f.current?.getRowModel().rows;if(!ve)return;const we=[];for(const xe of oe){const{columnId:je}=Ho(xe);je&&!we.includes(je)&&we.push(je)}const Me=new Map;for(const xe of oe){const{rowIndex:je,columnId:ot}=Ho(xe),Et=ve[je];if(Et){const Mt=Et.getVisibleCells().find(ct=>ct.column.id===ot);if(Mt){const ct=Mt.getValue(),Pt=Mt.column.columnDef?.meta?.cell?.variant;let rt="";Pt==="file"||Pt==="multi-select"?rt=ct?JSON.stringify(ct):"":ct instanceof Date?rt=ct.toISOString():rt=String(ct??""),Me.set(xe,rt)}}}const Pe=new Set,Oe=new Set;for(const xe of oe){const{rowIndex:je,columnId:ot}=Ho(xe);Pe.add(je);const Et=we.indexOf(ot);Et>=0&&Oe.add(Et)}const Se=Array.from(Pe).sort((xe,je)=>xe-je),Te=Array.from(Oe).sort((xe,je)=>xe-je).map(xe=>we[xe]),Ae=Se.map(xe=>Te.map(je=>{const ot=`${xe}:${je}`;return Me.get(ot)??""}).join(" ")).join(`
69
- `);try{await navigator.clipboard.writeText(Ae),E.setState("cutCells",new Set(oe)),Jt.success(`${oe.length} cell${oe.length!==1?"s":""} cut`)}catch(xe){Jt.error(xe instanceof Error?xe.message:"Failed to cut to clipboard")}},[E,S]),ie=x.useCallback(Z=>{Z&&document.activeElement!==Z&&requestAnimationFrame(()=>{Z.focus()})},[]),be=x.useCallback(async(Z=!1)=>{if(S.current.readOnly)return;const oe=E.getState();if(!oe.focusedCell)return;const ce=f.current,ve=ce?.getRowModel().rows;if(ve)try{let we=oe.pasteDialog.clipboardText;if(!we&&(we=await navigator.clipboard.readText(),!we))return;const Pe=we.split(`
70
- `).filter($t=>$t.length>0).map($t=>$t.split(" ")),Oe=oe.focusedCell.rowIndex,Se=U.indexOf(oe.focusedCell.columnId);if(Se===-1)return;const Re=ve.length??S.current.data.length,Te=Oe+Pe.length-Re;if(Te>0&&!Z&&S.current.onRowAdd&&!oe.pasteDialog.clipboardText){E.setState("pasteDialog",{open:!0,rowsNeeded:Te,clipboardText:we});return}if(Z&&Te>0){const $t=Re+Te;if(S.current.onRowsAdd)await S.current.onRowsAdd(Te);else if(S.current.onRowAdd)for(let en=0;en<Te;en++)await S.current.onRowAdd();let Yn=0;const kn=50;let $n=f.current?.getRowModel().rows.length??0;for(;$n<$t&&Yn<kn;)await new Promise(en=>setTimeout(en,100)),$n=f.current?.getRowModel().rows.length??0,Yn++}const Ae=[],xe=ce?.getAllColumns()??[];let je=0,ot=Oe,Et=Se;const Pt=f.current?.getRowModel().rows?.length??0;let rt=0;const mt=new Map(xe.map($t=>[$t.id,$t]));for(let $t=0;$t<Pe.length;$t++){const Yn=Pe[$t];if(!Yn)continue;const kn=Oe+$t;if(kn>=Pt)break;for(let $n=0;$n<Yn.length;$n++){const en=Se+$n;if(en>=U.length)break;const Ir=U[en];if(!Ir)continue;const Ze=Yn[$n]??"",cr=mt.get(Ir)?.columnDef?.meta?.cell,ha=cr?.variant;let Ot=Ze,Jn=!1;switch(ha){case"number":{if(!Ze)Ot=null;else{const Qt=Number.parseFloat(Ze);Number.isNaN(Qt)?Jn=!0:Ot=Qt}break}case"checkbox":{if(!Ze)Ot=!1;else{const Qt=Ze.toLowerCase();KW.has(Qt)?Ot=WW.has(Qt):Jn=!0}break}case"date":{if(!Ze)Ot=null;else{const Qt=new Date(Ze);Number.isNaN(Qt.getTime())?Jn=!0:Ot=Qt}break}case"select":{const Qt=cr?.options??[];if(!Ze)Ot="";else{const Rt=l2(Ze,Qt);Rt?Ot=Rt:Jn=!0}break}case"multi-select":{const Qt=cr?.options??[];let Rt=[];try{const Pr=JSON.parse(Ze);Array.isArray(Pr)&&(Rt=Pr.filter(bu=>typeof bu=="string"))}catch{Rt=Ze?Ze.split(",").map(Pr=>Pr.trim()):[]}const ws=Rt.map(Pr=>l2(Pr,Qt)).filter(Boolean);Rt.length>0&&ws.length===0?Jn=!0:Ot=ws;break}case"file":{if(!Ze)Ot=[];else try{const Qt=JSON.parse(Ze);if(!Array.isArray(Qt))Jn=!0;else{const Rt=Qt.filter(i2);Qt.length>0&&Rt.length===0?Jn=!0:Ot=Rt}}catch{Jn=!0}break}case"url":{if(!Ze)Ot="";else{const Qt=Ze[0];if(Qt==="["||Qt==="{")Jn=!0;else try{new URL(Ze),Ot=Ze}catch{GW.test(Ze)?Ot=Ze:Jn=!0}}break}default:{if(!Ze){Ot="";break}if(qW.test(Ze)){const Rt=new Date(Ze);if(!Number.isNaN(Rt.getTime())){Ot=Rt.toLocaleDateString();break}}const Qt=Ze[0];if(Qt==="["||Qt==="{"||Qt==="t"||Qt==="f")try{const Rt=JSON.parse(Ze);Array.isArray(Rt)?Rt.length>0&&Rt.every(i2)?Ot=Rt.map(ws=>ws.name).join(", "):Rt.every(ws=>typeof ws=="string")&&(Ot=Rt.join(", ")):typeof Rt=="boolean"&&(Ot=Rt?"Checked":"Unchecked")}catch{const Rt=Ze.toLowerCase();(Rt==="true"||Rt==="false")&&(Ot=Rt==="true"?"Checked":"Unchecked")}}}if(Jn){rt++,ot=Math.max(ot,kn),Et=Math.max(Et,en);continue}Ae.push({rowIndex:kn,columnId:Ir,value:Ot}),je++,ot=Math.max(ot,kn),Et=Math.max(Et,en)}}if(Ae.length>0){S.current.onPaste&&await S.current.onPaste(Ae);const $t=[...Ae];if(oe.cutCells.size>0){for(const kn of oe.cutCells){const{rowIndex:$n,columnId:en}=Ho(kn),Ze=xe.find(cr=>cr.id===en)?.columnDef?.meta?.cell?.variant;let uo="";Ze==="multi-select"||Ze==="file"?uo=[]:Ze==="number"||Ze==="date"?uo=null:Ze==="checkbox"&&(uo=!1),$t.push({rowIndex:$n,columnId:en,value:uo})}E.setState("cutCells",new Set)}K($t),rt>0?Jt.success(`${je} cell${je!==1?"s":""} pasted, ${rt} skipped`):Jt.success(`${je} cell${je!==1?"s":""} pasted`);const Yn=U[Et];Yn&&se({rowIndex:Oe,columnId:oe.focusedCell.columnId},{rowIndex:ot,columnId:Yn}),ie(d.current)}else rt>0&&Jt.error(`${rt} cell${rt!==1?"s":""} skipped pasting for invalid data`);oe.pasteDialog.open&&E.setState("pasteDialog",{open:!1,rowsNeeded:0,clipboardText:""})}catch(we){Jt.error(we instanceof Error?we.message:"Failed to paste. Please try again.")}},[E,U,S,K,se,ie]),ke=x.useCallback((Z=!1)=>{if(Z){C.current=!1;return}setTimeout(()=>{C.current=!1},300)},[]),Be=x.useCallback((Z,oe)=>{C.current=!0,requestAnimationFrame(()=>{const ce=on(Z,oe),ve=v.current.get(ce);if(!ve){const we=d.current;we&&we.focus(),ke();return}ve.focus(),ke()})},[ke]),Ie=x.useCallback((Z,oe)=>{E.batch(()=>{E.setState("focusedCell",{rowIndex:Z,columnId:oe}),E.setState("editingCell",null)}),!E.getState().searchOpen&&Be(Z,oe)},[E,Be]),lt=x.useCallback(async Z=>{if(S.current.readOnly||!S.current.onRowsDelete||Z.length===0)return;const ce=f.current?.getRowModel().rows;if(!ce||ce.length===0)return;const we=E.getState().focusedCell?.columnId??U[0],Me=Math.min(...Z),Pe=[];for(const Oe of Z){const Se=ce[Oe];Se&&Pe.push(Se.original)}await S.current.onRowsDelete(Pe,Z),E.batch(()=>{E.setState("selectionState",{selectedCells:new Set,selectionRange:null,isSelecting:!1}),E.setState("rowSelection",{}),E.setState("editingCell",null)}),requestAnimationFrame(()=>{const Re=(f.current?.getRowModel().rows??[]).length??S.current.data.length;if(Re>0&&we){const Te=Math.min(Me,Re-1);Ie(Te,we)}})},[S,E,U,Ie]),cn=x.useCallback(Z=>{const oe=E.getState();if(!oe.focusedCell)return;const{rowIndex:ce,columnId:ve}=oe.focusedCell,we=U.indexOf(ve),Me=g.current,Se=(f.current?.getRowModel().rows??[]).length??S.current.data.length;let Re=ce,Te=ve;const Ae=u==="rtl";switch(Z){case"up":Re=Math.max(0,ce-1);break;case"down":Re=Math.min(Se-1,ce+1);break;case"left":if(Ae){if(we<U.length-1){const xe=U[we+1];xe&&(Te=xe)}}else if(we>0){const xe=U[we-1];xe&&(Te=xe)}break;case"right":if(Ae){if(we>0){const xe=U[we-1];xe&&(Te=xe)}}else if(we<U.length-1){const xe=U[we+1];xe&&(Te=xe)}break;case"home":U.length>0&&(Te=U[0]??ve);break;case"end":U.length>0&&(Te=U[U.length-1]??ve);break;case"ctrl+home":Re=0,U.length>0&&(Te=U[0]??ve);break;case"ctrl+end":Re=Math.max(0,Se-1),U.length>0&&(Te=U[U.length-1]??ve);break;case"ctrl+up":Re=0;break;case"ctrl+down":Re=Math.max(0,Se-1);break;case"pageup":if(Me){const je=Me.getVirtualItems().length??10;Re=Math.max(0,ce-je)}else Re=Math.max(0,ce-10);break;case"pagedown":if(Me){const je=Me.getVirtualItems().length??10;Re=Math.min(Se-1,ce+je)}else Re=Math.min(Se-1,ce+10);break;case"pageleft":if(we>0){const xe=Math.max(0,we-F2),je=U[xe];je&&(Te=je)}break;case"pageright":if(we<U.length-1){const xe=Math.min(U.length-1,we+F2),je=U[xe];je&&(Te=je)}break}if(Re!==ce||Te!==ve){Ie(Re,Te);const xe=d.current;if(!xe)return;const je=y.current.get(Re),ot=on(Re,Te),Et=v.current.get(ot);if(!je){if(Me){const Mt=Z==="up"||Z==="pageup"||Z==="ctrl+up"||Z==="ctrl+home"?"start":Z==="down"||Z==="pagedown"||Z==="ctrl+down"||Z==="ctrl+end"?"end":"center";Me.scrollToIndex(Re,{align:Mt}),Te!==ve&&requestAnimationFrame(()=>{const ct=on(Re,Te),Pt=v.current.get(ct);if(Pt){const rt=c2(Z);Oi({container:xe,targetCell:Pt,tableRef:f,viewportOffset:Lo,direction:rt,isRtl:u==="rtl"})}})}else{const Mt=y0(z),ct=Re*Mt;xe.scrollTop=ct}return}Re!==ce&&je&&requestAnimationFrame(()=>{const Mt=xe.getBoundingClientRect(),ct=m.current?.getBoundingClientRect().height??0,Pt=w.current?.getBoundingClientRect().height??0,rt=Mt.top+ct+Lo,mt=Mt.bottom-Pt-Lo,$t=je.getBoundingClientRect();$t.top>=rt&&$t.bottom<=mt||(Z==="up"||Z==="down"||Z==="pageup"||Z==="pagedown"||Z==="ctrl+up"||Z==="ctrl+down"||Z==="ctrl+home"||Z==="ctrl+end")&&(Z==="down"||Z==="pagedown"||Z==="ctrl+down"||Z==="ctrl+end"?xe.scrollTop+=$t.bottom-mt:xe.scrollTop-=rt-$t.top)}),Te!==ve&&Et&&requestAnimationFrame(()=>{const Mt=c2(Z);Oi({container:xe,targetCell:Et,tableRef:f,viewportOffset:Lo,direction:Mt,isRtl:u==="rtl"})})}},[u,E,U,Ie,S,z]),ht=x.useCallback((Z,oe)=>{S.current.readOnly||E.batch(()=>{E.setState("focusedCell",{rowIndex:Z,columnId:oe}),E.setState("editingCell",{rowIndex:Z,columnId:oe})})},[E,S]),bn=x.useCallback(Z=>{const ce=E.getState().editingCell;if(E.setState("editingCell",null),Z?.moveToNextRow&&ce){const{rowIndex:ve,columnId:we}=ce,Oe=(f.current?.getRowModel().rows??[]).length??S.current.data.length,Se=ve+1;Se<Oe&&requestAnimationFrame(()=>{Ie(Se,we)})}else if(Z?.direction&&ce){const{rowIndex:ve,columnId:we}=ce;Ie(ve,we),requestAnimationFrame(()=>{cn(Z.direction??"right")})}else if(ce){const{rowIndex:ve,columnId:we}=ce;Be(ve,we)}},[E,S,Ie,cn,Be]),un=x.useCallback(Z=>{if(Z){E.setState("searchOpen",!0);return}const oe=E.getState(),ce=oe.matchIndex>=0&&oe.searchMatches[oe.matchIndex];E.batch(()=>{E.setState("searchOpen",!1),E.setState("searchQuery",""),E.setState("searchMatches",[]),E.setState("matchIndex",-1),ce&&E.setState("focusedCell",{rowIndex:ce.rowIndex,columnId:ce.columnId})}),d.current&&document.activeElement!==d.current&&d.current.focus()},[E]),Vt=x.useCallback(Z=>{if(!Z.trim()){E.batch(()=>{E.setState("searchMatches",[]),E.setState("matchIndex",-1)});return}const oe=[],ve=f.current?.getRowModel().rows??[],we=Z.toLowerCase();for(let Me=0;Me<ve.length;Me++){const Pe=ve[Me];if(Pe)for(const Oe of I){const Se=Pe.getVisibleCells().find(Ae=>Ae.column.id===Oe);if(!Se)continue;const Re=Se.getValue();String(Re??"").toLowerCase().includes(we)&&oe.push({rowIndex:Me,columnId:Oe})}}if(E.batch(()=>{E.setState("searchMatches",oe),E.setState("matchIndex",oe.length>0?0:-1)}),oe.length>0&&oe[0]){const Me=oe[0];g.current?.scrollToIndex(Me.rowIndex,{align:"center"})}},[I,E]),mn=x.useCallback(Z=>E.setState("searchQuery",Z),[E]),It=x.useCallback(()=>{const Z=E.getState();if(Z.searchMatches.length===0)return;const oe=Z.matchIndex-1<0?Z.searchMatches.length-1:Z.matchIndex-1,ce=Z.searchMatches[oe];ce&&(g.current?.scrollToIndex(ce.rowIndex,{align:"center"}),requestAnimationFrame(()=>{E.setState("matchIndex",oe),requestAnimationFrame(()=>{Ie(ce.rowIndex,ce.columnId)})}))},[E,Ie]),Mn=x.useCallback(()=>{const Z=E.getState();if(Z.searchMatches.length===0)return;const oe=(Z.matchIndex+1)%Z.searchMatches.length,ce=Z.searchMatches[oe];ce&&(g.current?.scrollToIndex(ce.rowIndex,{align:"center"}),requestAnimationFrame(()=>{E.setState("matchIndex",oe),requestAnimationFrame(()=>{Ie(ce.rowIndex,ce.columnId)})}))},[E,Ie]),yn=x.useCallback((Z,oe)=>E.getState().searchMatches.some(ve=>ve.rowIndex===Z&&ve.columnId===oe),[E]),In=x.useCallback((Z,oe)=>{const ce=E.getState();if(ce.matchIndex<0)return!1;const ve=ce.searchMatches[ce.matchIndex];return ve?.rowIndex===Z&&ve?.columnId===oe},[E]),On=x.useMemo(()=>{if(O.length===0)return null;const Z=new Map;for(const oe of O){let ce=Z.get(oe.rowIndex);ce||(ce=new Set,Z.set(oe.rowIndex,ce)),ce.add(oe.columnId)}return Z},[O]),_e=x.useMemo(()=>L<0||O.length===0?null:O[L]??null,[O,L]),Ue=x.useCallback(()=>{E.getState().editingCell&&document.activeElement instanceof HTMLElement&&document.activeElement.blur(),E.batch(()=>{E.setState("focusedCell",null),E.setState("editingCell",null)})},[E]),_t=x.useCallback((Z,oe,ce)=>{if(ce?.button===2)return;const ve=E.getState(),we=ve.focusedCell;function Me(){requestAnimationFrame(()=>{const Se=d.current,Re=on(Z,oe),Te=v.current.get(Re);Se&&Te&&Oi({container:Se,targetCell:Te,tableRef:f,viewportOffset:Lo,isRtl:u==="rtl"})})}if(ce){if(ce.ctrlKey||ce.metaKey){ce.preventDefault();const Se=on(Z,oe),Re=new Set(ve.selectionState.selectedCells);Re.has(Se)?Re.delete(Se):Re.add(Se),E.setState("selectionState",{selectedCells:Re,selectionRange:null,isSelecting:!1}),Ie(Z,oe),Me();return}if(ce.shiftKey&&ve.focusedCell){ce.preventDefault(),se(ve.focusedCell,{rowIndex:Z,columnId:oe}),Me();return}}const Pe=ve.selectionState.selectedCells.size>0,Oe=Object.keys(ve.rowSelection).length>0;if(Pe&&!ve.selectionState.isSelecting){const Se=on(Z,oe);if(!ve.selectionState.selectedCells.has(Se))ne();else{Ie(Z,oe),Me();return}}else Oe&&oe!=="select"&&ne();we?.rowIndex===Z&&we?.columnId===oe?ht(Z,oe):(Ie(Z,oe),Me())},[E,Ie,ht,se,ne,u]),Qe=x.useCallback((Z,oe,ce)=>{ce?.defaultPrevented||ht(Z,oe)},[ht]),st=x.useCallback((Z,oe,ce)=>{if(ce.button!==2&&(ce.preventDefault(),!ce.ctrlKey&&!ce.metaKey&&!ce.shiftKey)){const ve=on(Z,oe);E.batch(()=>{E.setState("selectionState",{selectedCells:S.current.enableSingleCellSelection?new Set([ve]):new Set,selectionRange:{start:{rowIndex:Z,columnId:oe},end:{rowIndex:Z,columnId:oe}},isSelecting:!0}),E.setState("rowSelection",{})})}},[E,S]),gt=x.useCallback((Z,oe)=>{const ce=E.getState();if(ce.selectionState.isSelecting&&ce.selectionState.selectionRange){const ve=ce.selectionState.selectionRange.start,we={rowIndex:Z,columnId:oe};(ce.focusedCell?.rowIndex!==ve.rowIndex||ce.focusedCell?.columnId!==ve.columnId)&&Ie(ve.rowIndex,ve.columnId),se(ve,we,!0)}},[E,se,Ie]),Wt=x.useCallback(()=>{const Z=E.getState();E.setState("selectionState",{...Z.selectionState,isSelecting:!1})},[E]),Kt=x.useCallback((Z,oe,ce)=>{ce.preventDefault(),ce.stopPropagation();const ve=E.getState(),we=on(Z,oe);ve.selectionState.selectedCells.has(we)||E.batch(()=>{E.setState("selectionState",{selectedCells:new Set([we]),selectionRange:{start:{rowIndex:Z,columnId:oe},end:{rowIndex:Z,columnId:oe}},isSelecting:!1}),E.setState("focusedCell",{rowIndex:Z,columnId:oe})}),E.setState("contextMenu",{open:!0,x:ce.clientX,y:ce.clientY})},[E]),Zn=x.useCallback(Z=>{if(!Z){const oe=E.getState().contextMenu;E.setState("contextMenu",{open:!1,x:oe.x,y:oe.y})}},[E]),Nt=x.useCallback(Z=>{const oe=E.getState(),ce=typeof Z=="function"?Z(oe.sorting):Z;E.setState("sorting",ce),S.current.onSortingChange?.(ce)},[E,S]),Fe=x.useCallback(Z=>{const oe=E.getState(),ce=typeof Z=="function"?Z(oe.columnFilters):Z;E.setState("columnFilters",ce),S.current.onColumnFiltersChange?.(ce)},[E,S]),nt=x.useCallback(Z=>{const oe=E.getState(),ce=typeof Z=="function"?Z(oe.rowSelection):Z,ve=Object.keys(ce).filter(Pe=>ce[Pe]),we=new Set,Me=f.current?.getRowModel().rows??[];for(const Pe of ve){const Oe=Me.findIndex(Se=>Se.id===Pe);if(Oe!==-1)for(const Se of I)we.add(on(Oe,Se))}E.batch(()=>{E.setState("rowSelection",ce),E.setState("selectionState",{selectedCells:we,selectionRange:null,isSelecting:!1}),E.setState("focusedCell",null),E.setState("editingCell",null)})},[E,I]),Ye=x.useCallback((Z,oe,ce)=>{const ve=E.getState(),we=f.current?.getRowModel().rows??[],Me=we[Z];if(Me){if(ce&&ve.lastClickedRowIndex!==null){const Pe=Math.min(ve.lastClickedRowIndex,Z),Oe=Math.max(ve.lastClickedRowIndex,Z),Se={...ve.rowSelection};for(let Re=Pe;Re<=Oe;Re++){const Te=we[Re];Te&&(Se[Te.id]=oe)}nt(Se)}else nt({...ve.rowSelection,[Me.id]:oe});E.setState("lastClickedRowIndex",Z)}},[E,nt]),at=x.useCallback(Z=>{const oe=E.getState(),ce=typeof Z=="function"?Z(oe.rowHeight):Z;E.setState("rowHeight",ce),S.current.onRowHeightChange?.(ce)},[E,S]),Lt=x.useCallback(Z=>{if(!S.current.enableColumnSelection){ne();return}ee(Z)},[S,ee,ne]),De=x.useCallback(Z=>{Z||E.setState("pasteDialog",{open:!1,rowsNeeded:0,clipboardText:""})},[E]),At=x.useMemo(()=>({minSize:UW,maxSize:YW}),[]),Xt=x.useMemo(()=>({...S.current.meta,dataGridRef:d,cellMapRef:v,get focusedCell(){return E.getState().focusedCell},get editingCell(){return E.getState().editingCell},get selectionState(){return E.getState().selectionState},get searchOpen(){return E.getState().searchOpen},get contextMenu(){return E.getState().contextMenu},get pasteDialog(){return E.getState().pasteDialog},get rowHeight(){return E.getState().rowHeight},get readOnly(){return S.current.readOnly},getIsCellSelected:J,getIsSearchMatch:yn,getIsActiveSearchMatch:In,getVisualRowIndex:$,onRowHeightChange:at,onRowSelect:Ye,onDataUpdate:K,onRowsDelete:S.current.onRowsDelete?lt:void 0,onColumnClick:Lt,onCellClick:_t,onCellDoubleClick:Qe,onCellMouseDown:st,onCellMouseEnter:gt,onCellMouseUp:Wt,onCellContextMenu:Kt,onCellEditingStart:ht,onCellEditingStop:bn,onCellsCopy:le,onCellsCut:pe,onCellsPaste:be,onSelectionClear:ne,onFilesUpload:S.current.onFilesUpload?S.current.onFilesUpload:void 0,onFilesDelete:S.current.onFilesDelete?S.current.onFilesDelete:void 0,onContextMenuOpenChange:Zn,onPasteDialogOpenChange:De}),[S,E,J,yn,In,$,at,Ye,K,lt,Lt,_t,Qe,st,gt,Wt,Kt,ht,bn,le,pe,be,ne,Zn,De]),dn=x.useMemo(()=>SW(),[]),Pn=x.useMemo(()=>NW(),[]),Tt=x.useMemo(()=>MW(),[]),Rn=x.useMemo(()=>({...S.current.state,sorting:B,columnFilters:Y,rowSelection:q}),[S,B,Y,q]),Yo=x.useMemo(()=>({...S.current,data:t,columns:e,defaultColumn:At,initialState:S.current.initialState,state:Rn,onRowSelectionChange:nt,onSortingChange:Nt,onColumnFiltersChange:Fe,columnResizeMode:"onChange",columnResizeDirection:u,getCoreRowModel:dn,getFilteredRowModel:Pn,getSortedRowModel:Tt,meta:Xt}),[S,t,e,At,Rn,u,nt,Nt,Fe,dn,Pn,Tt,Xt]),vt=RW(Yo);f.current||(f.current=vt);const Dn=x.useMemo(()=>{const Z=vt.getFlatHeaders(),oe={};for(const ce of Z)oe[`--header-${ce.id}-size`]=ce.getSize(),oe[`--col-${ce.column.id}-size`]=ce.column.getSize();return oe},[vt.getState().columnSizingInfo,vt.getState().columnSizing]),Do=x.useSyncExternalStore(x.useCallback(()=>()=>{},[]),x.useCallback(()=>typeof window>"u"||typeof navigator>"u"?!1:navigator.userAgent.indexOf("Firefox")!==-1,[]),x.useCallback(()=>!1,[])),Un=x.useMemo(()=>{const Z=vt.getState().columnPinning;return Do&&((Z.left?.length??0)>0||(Z.right?.length??0)>0)},[Do,vt.getState().columnPinning]),lo=HW({count:vt.getRowModel().rows.length,getScrollElement:()=>d.current,estimateSize:()=>H,overscan:o,measureElement:Do?void 0:Z=>Z?.getBoundingClientRect().height});g.current||(g.current=lo);const Or=x.useCallback(async Z=>{const oe=Z?.rowIndex??0,ce=Z?.columnId;C.current=!0;const ve=S.current.columns.map(Pe=>{if(Pe.id)return Pe.id;if("accessorKey"in Pe)return Pe.accessorKey}).filter(Pe=>!!Pe).filter(Pe=>!U2.includes(Pe)),we=ce??ve[0];if(!we){ke(!0);return}async function Me(Pe){if(!we)return;const Oe=S.current.data.length;if(oe>=Oe&&Pe>0){await new Promise(ot=>setTimeout(ot,50)),await Me(Pe-1);return}const Se=Math.min(oe,Math.max(0,Oe-1)),Re=Se>Oe/2;lo.scrollToIndex(Se,{align:Re?"end":"start"}),await new Promise(ot=>requestAnimationFrame(ot));const Te=d.current,Ae=y.current.get(Se);if(Te&&Ae){const ot=Te.getBoundingClientRect(),Et=m.current?.getBoundingClientRect().height??0,Mt=w.current?.getBoundingClientRect().height??0,ct=ot.top+Et+Lo,Pt=ot.bottom-Mt-Lo,rt=Ae.getBoundingClientRect();rt.top>=ct&&rt.bottom<=Pt||(rt.top<ct?Te.scrollTop-=ct-rt.top:rt.bottom>Pt&&(Te.scrollTop+=rt.bottom-Pt))}E.batch(()=>{E.setState("focusedCell",{rowIndex:Se,columnId:we}),E.setState("editingCell",null)});const xe=on(Se,we),je=v.current.get(xe);je?(je.focus(),ke()):Pe>0?(await new Promise(ot=>requestAnimationFrame(ot)),await Me(Pe-1)):(d.current?.focus(),ke())}await Me(VW)},[lo,S,E,ke]),co=x.useCallback(async Z=>{if(S.current.readOnly||!S.current.onRowAdd)return;const oe=S.current.data.length;let ce;try{ce=await S.current.onRowAdd(Z)}catch{return}if(ce===null||Z?.defaultPrevented)return;ne();const ve=ce.rowIndex??oe,we=ce.columnId;Or({rowIndex:ve,columnId:we})},[S,Or,ne]),fn=x.useCallback(Z=>{const oe=E.getState(),{key:ce,ctrlKey:ve,metaKey:we,shiftKey:Me,altKey:Pe}=Z,Oe=ve||we;if(S.current.enableSearch&&Oe&&!Me&&ce===V2){Z.preventDefault(),un(!0);return}if(S.current.enableSearch&&oe.searchOpen&&!oe.editingCell){if(ce==="Enter"){Z.preventDefault(),Me?It():Mn();return}if(ce==="Escape"){Z.preventDefault(),un(!1);return}return}if(oe.editingCell)return;if(Oe&&(ce==="Backspace"||ce==="Delete")&&!S.current.readOnly&&S.current.onRowsDelete){const Re=new Set;if(Object.keys(oe.rowSelection).length>0){const xe=f.current?.getRowModel().rows??[];for(const je of xe)oe.rowSelection[je.id]&&Re.add(je.index)}else if(oe.selectionState.selectedCells.size>0)for(const Ae of oe.selectionState.selectedCells){const{rowIndex:xe}=Ho(Ae);Re.add(xe)}else oe.focusedCell&&Re.add(oe.focusedCell.rowIndex);Re.size>0&&(Z.preventDefault(),lt(Array.from(Re)));return}if(!oe.focusedCell)return;let Se=null;if(Oe&&!Me&&ce==="a"){Z.preventDefault(),X();return}if(Oe&&!Me&&ce==="c"){Z.preventDefault(),le();return}if(Oe&&!Me&&ce==="x"&&!S.current.readOnly){Z.preventDefault(),pe();return}if(S.current.enablePaste&&Oe&&!Me&&ce==="v"&&!S.current.readOnly){Z.preventDefault(),be();return}if((ce==="Delete"||ce==="Backspace")&&!Oe&&!S.current.readOnly){const Re=oe.selectionState.selectedCells.size>0?Array.from(oe.selectionState.selectedCells):oe.focusedCell?[on(oe.focusedCell.rowIndex,oe.focusedCell.columnId)]:[];if(Re.length>0){Z.preventDefault();const Te=[],xe=f.current?.getAllColumns()??[];for(const je of Re){const{rowIndex:ot,columnId:Et}=Ho(je),ct=xe.find(rt=>rt.id===Et)?.columnDef?.meta?.cell?.variant;let Pt="";ct==="multi-select"||ct==="file"?Pt=[]:ct==="number"||ct==="date"?Pt=null:ct==="checkbox"&&(Pt=!1),Te.push({rowIndex:ot,columnId:Et,value:Pt})}K(Te),oe.selectionState.selectedCells.size>0&&ne(),oe.cutCells.size>0&&E.setState("cutCells",new Set)}return}if(ce==="Enter"&&Me&&!S.current.readOnly&&S.current.onRowAdd){Z.preventDefault();const Re=S.current.data.length,Te=oe.focusedCell.columnId;Promise.resolve(S.current.onRowAdd()).then(async Ae=>{if(Ae===null)return;ne();const xe=Ae.rowIndex??Re,je=Ae.columnId??Te;Or({rowIndex:xe,columnId:je})}).catch(()=>{});return}switch(ce){case"ArrowUp":if(Pe&&!Oe&&!Me)Se="pageup";else if(Oe&&Me){const Re=oe.selectionState.selectionRange?.end||oe.focusedCell,Te=U.indexOf(Re.columnId),Ae=oe.selectionState.selectionRange?.start||oe.focusedCell;se(Ae,{rowIndex:0,columnId:U[Te]??Re.columnId});const xe=g.current;xe&&xe.scrollToIndex(0,{align:"start"}),ie(d.current),Z.preventDefault();return}else Oe&&!Me?Se="ctrl+up":Se="up";break;case"ArrowDown":if(Pe&&!Oe&&!Me)Se="pagedown";else if(Oe&&Me){const Re=f.current?.getRowModel().rows.length||S.current.data.length,Te=oe.selectionState.selectionRange?.end||oe.focusedCell,Ae=U.indexOf(Te.columnId),xe=oe.selectionState.selectionRange?.start||oe.focusedCell;se(xe,{rowIndex:Math.max(0,Re-1),columnId:U[Ae]??Te.columnId});const je=g.current;je&&je.scrollToIndex(Math.max(0,Re-1),{align:"end"}),ie(d.current),Z.preventDefault();return}else Oe&&!Me?Se="ctrl+down":Se="down";break;case"ArrowLeft":if(Oe&&Me){const Re=oe.selectionState.selectionRange?.end||oe.focusedCell,Te=oe.selectionState.selectionRange?.start||oe.focusedCell,Ae=u==="rtl"?U[U.length-1]:U[0];if(Ae){se(Te,{rowIndex:Re.rowIndex,columnId:Ae});const xe=d.current,je=on(Re.rowIndex,Ae),ot=v.current.get(je);xe&&ot&&Oi({container:xe,targetCell:ot,tableRef:f,viewportOffset:Lo,direction:"home",isRtl:u==="rtl"}),ie(xe)}Z.preventDefault();return}else Oe&&!Me?Se="home":Se="left";break;case"ArrowRight":if(Oe&&Me){const Re=oe.selectionState.selectionRange?.end||oe.focusedCell,Te=oe.selectionState.selectionRange?.start||oe.focusedCell,Ae=u==="rtl"?U[0]:U[U.length-1];if(Ae){se(Te,{rowIndex:Re.rowIndex,columnId:Ae});const xe=d.current,je=on(Re.rowIndex,Ae),ot=v.current.get(je);xe&&ot&&Oi({container:xe,targetCell:ot,tableRef:f,viewportOffset:Lo,direction:"end",isRtl:u==="rtl"}),ie(xe)}Z.preventDefault();return}else Oe&&!Me?Se="end":Se="right";break;case"Home":Se=Oe?"ctrl+home":"home";break;case"End":Se=Oe?"ctrl+end":"end";break;case"PageUp":Se=Pe?"pageleft":"pageup";break;case"PageDown":Se=Pe?"pageright":"pagedown";break;case"Escape":Z.preventDefault(),oe.selectionState.selectedCells.size>0||Object.keys(oe.rowSelection).length>0?ne():Ue();return;case"Tab":Z.preventDefault(),u==="rtl"?Se=Z.shiftKey?"right":"left":Se=Z.shiftKey?"left":"right";break}if(Se)if(Z.preventDefault(),Me&&ce!=="Tab"&&oe.focusedCell){const Re=oe.selectionState.selectionRange?.end||oe.focusedCell,Te=U.indexOf(Re.columnId);let Ae=Re.rowIndex,xe=Re.columnId;const je=u==="rtl",ot=f.current?.getRowModel().rows.length||S.current.data.length;switch(Se){case"up":Ae=Math.max(0,Re.rowIndex-1);break;case"down":Ae=Math.min(ot-1,Re.rowIndex+1);break;case"left":if(je){if(Te<U.length-1){const mt=U[Te+1];mt&&(xe=mt)}}else if(Te>0){const mt=U[Te-1];mt&&(xe=mt)}break;case"right":if(je){if(Te>0){const mt=U[Te-1];mt&&(xe=mt)}}else if(Te<U.length-1){const mt=U[Te+1];mt&&(xe=mt)}break;case"home":U.length>0&&(xe=U[0]??xe);break;case"end":U.length>0&&(xe=U[U.length-1]??xe);break}const Et=oe.selectionState.selectionRange?.start||oe.focusedCell;se(Et,{rowIndex:Ae,columnId:xe});const Mt=d.current,ct=y.current.get(Ae),Pt=on(Ae,xe),rt=v.current.get(Pt);if(Ae!==Re.rowIndex&&(Se==="up"||Se==="down"))if(Mt&&ct){const mt=Mt.getBoundingClientRect(),$t=m.current?.getBoundingClientRect().height??0,Yn=w.current?.getBoundingClientRect().height??0,kn=mt.top+$t+Lo,$n=mt.bottom-Yn-Lo,en=ct.getBoundingClientRect();if(!(en.top>=kn&&en.bottom<=$n)){const Ze=Se==="down"?en.bottom-$n:kn-en.top;Se==="down"?Mt.scrollTop+=Ze:Mt.scrollTop-=Ze,ie(Mt)}}else{const mt=g.current;if(mt){const $t=Se==="up"?"start":"end";mt.scrollToIndex(Ae,{align:$t}),ie(Mt)}}xe!==Re.columnId&&(Se==="left"||Se==="right"||Se==="home"||Se==="end")&&Mt&&rt&&Oi({container:Mt,targetCell:rt,tableRef:f,viewportOffset:Lo,direction:Se,isRtl:je})}else oe.selectionState.selectedCells.size>0&&ne(),cn(Se)},[u,E,S,Ue,cn,X,le,pe,be,K,ne,U,se,un,Mn,It,lt,ie,Or]),Tn=x.useMemo(()=>{if(S.current.enableSearch)return{searchMatches:O,matchIndex:L,searchOpen:W,onSearchOpenChange:un,searchQuery:k,onSearchQueryChange:mn,onSearch:Vt,onNavigateToNextMatch:Mn,onNavigateToPrevMatch:It}},[S,O,L,W,un,k,mn,Vt,Mn,It]);x.useEffect(()=>{const Z=d.current;if(Z)return Z.addEventListener("keydown",fn),()=>{Z.removeEventListener("keydown",fn)}},[fn]),x.useEffect(()=>{function Z(oe){const ce=d.current;if(!ce)return;const ve=oe.target;if(!(ve instanceof HTMLElement))return;const{key:we,ctrlKey:Me,metaKey:Pe,shiftKey:Oe}=oe,Se=Me||Pe;if(S.current.enableSearch&&Se&&!Oe&&we===V2){const Te=ve.tagName==="INPUT"||ve.tagName==="TEXTAREA",Ae=ce.contains(ve),xe=ve.closest('[role="search"]')!==null;if(Ae||xe||!Te){oe.preventDefault(),oe.stopPropagation();const je=!E.getState().searchOpen;un(je),je&&!Ae&&!xe&&requestAnimationFrame(()=>{ce.focus()});return}}if(ce.contains(ve)&&we==="Escape"){const Te=E.getState();(Te.selectionState.selectedCells.size>0||Object.keys(Te.rowSelection).length>0)&&(oe.preventDefault(),oe.stopPropagation(),ne())}}return window.addEventListener("keydown",Z,!0),()=>{window.removeEventListener("keydown",Z,!0)}},[S,un,E,ne]),x.useEffect(()=>{const Z=E.getState(),oe=S.current.autoFocus;if(oe&&t.length>0&&e.length>0&&!Z.focusedCell&&U.length>0){const ce=requestAnimationFrame(()=>{if(typeof oe=="object"){const{rowIndex:we,columnId:Me}=oe;Me&&Ie(we??0,Me);return}const ve=U[0];ve&&Ie(0,ve)});return()=>cancelAnimationFrame(ce)}},[E,S,t,e,U,Ie]),x.useEffect(()=>{const Z=d.current;if(!Z)return;function oe(ce){if(C.current)return;const ve=d.current;if(!ve)return;const we=E.getState();if(!we.focusedCell||we.editingCell)return;const Me=ce.relatedTarget,Pe=!Me||!ve.contains(Me),Oe=u2(Me);if(Pe&&!Oe){const{rowIndex:Se,columnId:Re}=we.focusedCell,Te=on(Se,Re),Ae=v.current.get(Te);requestAnimationFrame(()=>{C.current||(Ae&&document.body.contains(Ae)?Ae.focus():ve.focus())})}}return Z.addEventListener("focusout",oe),()=>{Z.removeEventListener("focusout",oe)}},[E]),x.useEffect(()=>{function Z(oe){if(oe.button!==2&&d.current&&!d.current.contains(oe.target)&&!document.elementsFromPoint(oe.clientX,oe.clientY).some(we=>u2(we))){Ue();const we=E.getState();(we.selectionState.selectedCells.size>0||Object.keys(we.rowSelection).length>0)&&ne()}}return document.addEventListener("mousedown",Z),()=>{document.removeEventListener("mousedown",Z)}},[E,Ue,ne]),x.useEffect(()=>{function Z(we){we.preventDefault()}function oe(we){we.preventDefault()}function ce(){document.removeEventListener("selectstart",Z),document.removeEventListener("contextmenu",oe),document.body.style.userSelect=""}const ve=E.subscribe(()=>{E.getState().selectionState.isSelecting?(document.addEventListener("selectstart",Z),document.addEventListener("contextmenu",oe),document.body.style.userSelect="none"):ce()});return()=>{ce(),ve()}},[E]),bR(()=>{const Z=requestAnimationFrame(()=>{lo.measure()});return()=>cancelAnimationFrame(Z)},[z,vt.getState().columnFilters,vt.getState().columnOrder,vt.getState().columnPinning,vt.getState().columnSizing,vt.getState().columnVisibility,vt.getState().expanded,vt.getState().globalFilter,vt.getState().grouping,vt.getState().rowSelection,vt.getState().sorting]);const To=lo.getTotalSize(),zr=lo.getVirtualItems(),fa=lo.measureElement;return x.useMemo(()=>({dataGridRef:d,headerRef:m,rowMapRef:y,footerRef:w,dir:u,table:vt,tableMeta:Xt,virtualTotalSize:To,virtualItems:zr,measureElement:fa,columns:e,columnSizeVars:Dn,searchState:Tn,searchMatchesByRow:On,activeSearchMatch:_e,cellSelectionMap:F,focusedCell:R,editingCell:D,rowHeight:z,contextMenu:V,pasteDialog:A,onRowAdd:S.current.onRowAdd?co:void 0,adjustLayout:Un}),[S,u,vt,Xt,To,zr,fa,e,Dn,Tn,On,_e,F,R,D,z,V,A,co,Un])}function QW(t){if(t.length===0)return[];const e=t[0];return!e||typeof e!="object"?[]:Object.keys(e)}function ZW(t,e){const n=e?.length?e.map(l=>l.name).filter(l=>t.includes(l)):t,o=t.filter(l=>!n.includes(l)),s=[...n,...o],i=new Map(e?.map(l=>[l.name,l.type])??[]);return s.map(l=>({id:l,accessorKey:l,header:l,meta:{label:l,columnType:mu(i.get(l))||void 0,cell:{variant:"short-text"}},size:180,minSize:80,maxSize:800}))}function JW(t){const e=ge.c(22),{data:n,columns:o,height:s,width:i,readOnly:l}=t,u=s===void 0?400:s,d=l===void 0?!0:l;let f;e[0]!==n||e[1]!==o?(f=o?.length?o.map(eK):QW(n),e[0]=n,e[1]=o,e[2]=f):f=e[2];const g=f;let m;e[3]!==g||e[4]!==o?(m=ZW(g,o),e[3]=g,e[4]=o,e[5]=m):m=e[5];const y=m;let v;e[6]!==y||e[7]!==n||e[8]!==d?(v={data:n,columns:y,readOnly:d,enableSearch:!0,enableColumnSelection:!1,enableSingleCellSelection:!0,enablePaste:!1},e[6]=y,e[7]=n,e[8]=d,e[9]=v):v=e[9];const w=XW(v);if(y.length===0){let S;e[10]!==u?(S={height:u},e[10]=u,e[11]=S):S=e[11];let N;e[12]===Symbol.for("react.memo_cache_sentinel")?(N=p.jsx("p",{children:"No columns to display"}),e[12]=N):N=e[12];const M=n.length===0?"No rows in this table":"Add columns to the table schema";let E;e[13]!==M?(E=p.jsx("p",{className:"text-xs mt-1",children:M}),e[13]=M,e[14]=E):E=e[14];let R;return e[15]!==S||e[16]!==E?(R=p.jsxs("div",{className:"flex flex-col items-center justify-center text-muted-foreground text-sm",style:S,children:[N,E]}),e[15]=S,e[16]=E,e[17]=R):R=e[17],R}let C;return e[18]!==w||e[19]!==u||e[20]!==i?(C=p.jsx(Iq,{...w,height:u,width:i}),e[18]=w,e[19]=u,e[20]=i,e[21]=C):C=e[21],C}function eK(t){return t.name}function cv(t){const e=ge.c(10);let n,o,s;e[0]!==t?({className:n,size:s,...o}=t,e[0]=t,e[1]=n,e[2]=o,e[3]=s):(n=e[1],o=e[2],s=e[3]);const i=s===void 0?"default":s;let l;e[4]!==n?(l=Ne("ring-foreground/10 bg-card text-card-foreground gap-6 overflow-hidden rounded-xl py-6 text-sm shadow-xs ring-1 has-[>img:first-child]:pt-0 data-[size=sm]:gap-4 data-[size=sm]:py-4 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl group/card flex flex-col",n),e[4]=n,e[5]=l):l=e[5];let u;return e[6]!==o||e[7]!==i||e[8]!==l?(u=p.jsx("div",{"data-slot":"card","data-size":i,className:l,...o}),e[6]=o,e[7]=i,e[8]=l,e[9]=u):u=e[9],u}function uv(t){const e=ge.c(8);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let s;e[3]!==n?(s=Ne("gap-1 rounded-t-xl px-6 group-data-[size=sm]/card:px-4 [.border-b]:pb-6 group-data-[size=sm]/card:[.border-b]:pb-4 group/card-header @container/card-header grid auto-rows-min items-start has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto]",n),e[3]=n,e[4]=s):s=e[4];let i;return e[5]!==o||e[6]!==s?(i=p.jsx("div",{"data-slot":"card-header",className:s,...o}),e[5]=o,e[6]=s,e[7]=i):i=e[7],i}function dv(t){const e=ge.c(8);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let s;e[3]!==n?(s=Ne("text-base leading-normal font-medium group-data-[size=sm]/card:text-sm",n),e[3]=n,e[4]=s):s=e[4];let i;return e[5]!==o||e[6]!==s?(i=p.jsx("div",{"data-slot":"card-title",className:s,...o}),e[5]=o,e[6]=s,e[7]=i):i=e[7],i}function fv(t){const e=ge.c(8);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let s;e[3]!==n?(s=Ne("px-6 group-data-[size=sm]/card:px-4",n),e[3]=n,e[4]=s):s=e[4];let i;return e[5]!==o||e[6]!==s?(i=p.jsx("div",{"data-slot":"card-content",className:s,...o}),e[5]=o,e[6]=s,e[7]=i):i=e[7],i}function tK(t){const e=ge.c(9),{table:n}=t;let o;e[0]!==n.columns.length?(o=p.jsx(uv,{className:"border-b shrink-0",children:p.jsxs(dv,{children:["Columns (",n.columns.length,")"]})}),e[0]=n.columns.length,e[1]=o):o=e[1];let s;e[2]!==n.columns?(s=n.columns.map(nK),e[2]=n.columns,e[3]=s):s=e[3];let i;e[4]!==s?(i=p.jsx(fv,{className:"flex-1 min-h-0 overflow-auto",children:p.jsx("div",{className:"divide-y divide-border",children:s})}),e[4]=s,e[5]=i):i=e[5];let l;return e[6]!==o||e[7]!==i?(l=p.jsxs(cv,{className:"bg-background w-full flex flex-col flex-1 min-h-0",children:[o,i]}),e[6]=o,e[7]=i,e[8]=l):l=e[8],l}function nK(t){return p.jsxs("div",{className:"flex items-center justify-between py-4 px-2 hover:bg-accent/50 transition-colors",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("span",{className:"font-medium text-card-foreground",children:t.name}),p.jsxs("div",{className:"flex items-center gap-1",children:[t.isPrimaryKey&&p.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-emerald-500",style:{boxShadow:"0 0 4px 1px rgba(16, 185, 129, 0.6)"},title:"Primary Key"}),t.foreignKey&&p.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-400",style:{boxShadow:"0 0 4px 1px rgba(251, 191, 36, 0.6)"},title:"Foreign Key"})]})]}),p.jsxs("div",{className:"text-sm text-muted-foreground",children:[mu(t.type),t.nullable&&p.jsx("span",{className:"ml-1 opacity-60",children:"(nullable)"})]})]},t.name)}function oK(t){const e=ge.c(18),{table:n}=t;let o,s,i,l,u,d;if(e[0]!==n.columns||e[1]!==n.name||e[2]!==n.schema){const m=n.columns.filter(rK);s=cv,u="bg-background w-full flex flex-col flex-1 min-h-0",d=p.jsx(uv,{className:"border-b shrink-0",children:p.jsxs(dv,{children:["Foreign Keys (",m.length,")"]})}),o=fv,i="flex-1 min-h-0 overflow-auto",l=m.length===0?p.jsx("p",{className:"text-sm text-muted-foreground",children:"No foreign key relationships"}):p.jsx("div",{className:"",children:m.map(y=>p.jsxs("div",{className:"group flex items-center py-4 px-2 gap-0 w-full cursor-pointer",children:[p.jsxs("div",{className:"flex gap-4 items-center border border-border rounded-l-md py-2 px-3 shrink-0 transition-colors group-hover:border-muted-foreground/40",children:[p.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-400 shrink-0 transition-all duration-200 shadow-[0_0_4px_1px_rgba(251,191,36,0.6),0_0_8px_3px_rgba(251,191,36,0.3)] group-hover:bg-amber-300 group-hover:shadow-[0_0_6px_2px_rgba(252,211,77,0.7),0_0_12px_4px_rgba(252,211,77,0.4)]",title:"Foreign Key"}),p.jsxs("div",{className:"text-xs text-muted-foreground truncate",children:[n.schema,".",n.name]}),p.jsx("div",{className:"text-sm font-medium text-card-foreground truncate",children:y.name})]}),p.jsx("div",{className:"flex-1 min-w-0 h-px bg-border shrink-0 self-center transition-colors group-hover:bg-muted-foreground/40","aria-hidden":!0}),p.jsxs("div",{className:"flex gap-4 items-center border border-border rounded-r-md py-2 px-3 shrink-0 transition-colors group-hover:border-muted-foreground/40",children:[p.jsx("div",{className:"text-sm font-medium text-card-foreground truncate",children:y.foreignKey.toColumn}),p.jsx("div",{className:"text-xs text-muted-foreground truncate",children:y.foreignKey.toTable})]})]},y.name))}),e[0]=n.columns,e[1]=n.name,e[2]=n.schema,e[3]=o,e[4]=s,e[5]=i,e[6]=l,e[7]=u,e[8]=d}else o=e[3],s=e[4],i=e[5],l=e[6],u=e[7],d=e[8];let f;e[9]!==o||e[10]!==i||e[11]!==l?(f=p.jsx(o,{className:i,children:l}),e[9]=o,e[10]=i,e[11]=l,e[12]=f):f=e[12];let g;return e[13]!==s||e[14]!==u||e[15]!==d||e[16]!==f?(g=p.jsxs(s,{className:u,children:[d,f]}),e[13]=s,e[14]=u,e[15]=d,e[16]=f,e[17]=g):g=e[17],g}function rK(t){return!!t.foreignKey}function sK(t){const e=ge.c(11),{policy:n,onOpenChange:o}=t,[s,i]=x.useState(!1),l=n!==null;let u;e[0]!==o?(u=m=>o(m),e[0]=o,e[1]=u):u=e[1];let d;e[2]!==s||e[3]!==n?(d=n&&p.jsxs(p.Fragment,{children:[p.jsxs(yy,{children:[p.jsx(vy,{children:n.name}),p.jsxs("div",{className:"flex flex-wrap items-center gap-2 pt-1",children:[p.jsx("span",{className:Ne("text-xs px-2 py-0.5 rounded-full",n.permissive==="PERMISSIVE"?"bg-emerald-500/10 text-emerald-600":"bg-amber-500/10 text-amber-600"),children:n.permissive}),p.jsx("span",{className:"text-xs px-2 py-0.5 rounded-full bg-primary/10 text-primary",children:n.command}),p.jsx("span",{className:"text-xs text-muted-foreground",children:n.roles.length===0||n.roles.includes("public")?"PUBLIC":n.roles.join(", ")})]})]}),p.jsxs("div",{className:"flex-1 min-h-0 overflow-auto px-4 pb-4 space-y-4",children:[n.using&&p.jsxs("div",{children:[p.jsx("div",{className:"text-xs font-medium text-muted-foreground mb-1",children:"USING"}),p.jsx("pre",{className:"text-xs bg-accent/50 p-2 rounded whitespace-pre-wrap break-words",children:p.jsx("code",{children:n.using})})]}),n.withCheck&&p.jsxs("div",{children:[p.jsx("div",{className:"text-xs font-medium text-muted-foreground mb-1",children:"WITH CHECK"}),p.jsx("pre",{className:"text-xs bg-accent/50 p-2 rounded whitespace-pre-wrap break-words",children:p.jsx("code",{children:n.withCheck})})]}),!n.using&&!n.withCheck&&p.jsx("p",{className:"text-sm text-muted-foreground",children:"No USING or WITH CHECK expression for this policy."}),p.jsx(St,{variant:"outline",size:"icon","aria-label":s?"Copied":"Copy SQL",onClick:()=>{const m=[];n.using&&m.push(`USING (${n.using})`),n.withCheck&&m.push(`WITH CHECK (${n.withCheck})`);const y=m.join(`
71
- `);y&&(navigator.clipboard.writeText(y),i(!0),setTimeout(()=>i(!1),2e3),Jt.success("RLS Copied"))},disabled:!n.using&&!n.withCheck,children:s?p.jsx(da,{className:"h-4 w-4"}):p.jsx(fy,{className:"h-4 w-4"})})]})]}),e[2]=s,e[3]=n,e[4]=d):d=e[4];let f;e[5]!==d?(f=p.jsx(py,{className:"flex flex-col overflow-hidden sm:max-w-lg",children:d}),e[5]=d,e[6]=f):f=e[6];let g;return e[7]!==l||e[8]!==u||e[9]!==f?(g=p.jsx(gy,{open:l,onOpenChange:u,children:f}),e[7]=l,e[8]=u,e[9]=f,e[10]=g):g=e[10],g}function aK(t){const e=ge.c(29),{rls:n,rlsLoading:o,rlsError:s}=t,i=n===void 0?null:n,l=o===void 0?!1:o,u=s===void 0?null:s,[d,f]=x.useState(null);if(l){let O;return e[0]===Symbol.for("react.memo_cache_sentinel")?(O=p.jsx("div",{className:"flex items-center justify-center h-full",children:p.jsx(wl,{})}),e[0]=O):O=e[0],O}if(u){let O;return e[1]!==u?(O=p.jsx("div",{className:"flex items-center justify-center h-full",children:p.jsx("p",{className:"text-destructive",children:u})}),e[1]=u,e[2]=O):O=e[2],O}const g=i?.policies.length??0;let m;e[3]!==g?(m=p.jsxs(dv,{children:["RLS Policies (",g,")"]}),e[3]=g,e[4]=m):m=e[4];const y=i?.enabled?"bg-emerald-500/20 text-emerald-400 border border-emerald-500/40 shadow-[0_0_12px_rgba(16,185,129,0.25)]":"bg-destructive/20 text-destructive border border-destructive/40 shadow-[0_0_12px_rgba(239,68,68,0.25)]";let v;e[5]!==y?(v=Ne("inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full text-xs font-medium",y),e[5]=y,e[6]=v):v=e[6];let w;e[7]!==i?.enabled?(w=i?.enabled?p.jsx(BI,{className:"w-3.5 h-3.5 shrink-0"}):p.jsx(VI,{className:"w-3.5 h-3.5 shrink-0"}),e[7]=i?.enabled,e[8]=w):w=e[8];const C=i?.enabled?"RLS Enabled":"RLS Disabled";let S;e[9]!==v||e[10]!==w||e[11]!==C?(S=p.jsxs("span",{className:v,children:[w,C]}),e[9]=v,e[10]=w,e[11]=C,e[12]=S):S=e[12];let N;e[13]!==S||e[14]!==m?(N=p.jsxs(uv,{className:"border-b shrink-0 flex gap-4",children:[m,S]}),e[13]=S,e[14]=m,e[15]=N):N=e[15];let M;e[16]!==i?.policies?(M=i?.policies.map(O=>p.jsxs("div",{role:"button",tabIndex:0,onClick:()=>f(O),onKeyDown:L=>L.key==="Enter"&&f(O),className:"flex items-center justify-between py-4 cursor-pointer px-2 hover:bg-accent/50 transition-colors",children:[p.jsxs("div",{className:"flex items-center justify-between gap-4",children:[p.jsx("div",{className:"text-xs text-muted-foreground",children:O.roles.length===0||O.roles.includes("public")?"PUBLIC":O.roles.join(", ")}),p.jsx("span",{className:"font-medium text-card-foreground",children:O.name})]}),p.jsxs("div",{className:"flex items-center gap-1",children:[p.jsx("span",{className:`text-xs px-2 py-0.5 rounded-full ${O.permissive==="PERMISSIVE"?"bg-emerald-500/10 text-emerald-600":"bg-amber-500/10 text-amber-600"}`,children:O.permissive}),p.jsx("span",{className:"text-xs px-2 py-0.5 rounded-full bg-primary/10 text-primary",children:O.command})]})]},O.name)),e[16]=i?.policies,e[17]=M):M=e[17];let E;e[18]!==M?(E=p.jsx(fv,{className:"flex-1 min-h-0 overflow-auto",children:p.jsx("div",{className:"divide-y divide-border",children:M})}),e[18]=M,e[19]=E):E=e[19];let R;e[20]!==N||e[21]!==E?(R=p.jsxs(cv,{className:"bg-background w-full flex flex-col flex-1 min-h-0",children:[N,E]}),e[20]=N,e[21]=E,e[22]=R):R=e[22];let D;e[23]===Symbol.for("react.memo_cache_sentinel")?(D=O=>!O&&f(null),e[23]=D):D=e[23];let T;e[24]!==d?(T=p.jsx(sK,{policy:d,onOpenChange:D}),e[24]=d,e[25]=T):T=e[25];let k;return e[26]!==R||e[27]!==T?(k=p.jsxs(p.Fragment,{children:[R,T]}),e[26]=R,e[27]=T,e[28]=k):k=e[28],k}const iK=[{id:"data",label:"Data"},{id:"columns",label:"Columns"},{id:"relationships",label:"Relationships"},{id:"rls",label:"RLS"}];function lK({table:t,data:e=[],dataLoading:n=!1,dataError:o=null,onRefresh:s,rls:i=null,rlsLoading:l=!1,rlsError:u=null}){const[d,f]=x.useState("data"),[g,m]=x.useState(!1),y=x.useRef(null),[v,w]=x.useState(400),[C,S]=x.useState(void 0),N=t.columns.map(R=>({name:R.name,type:R.type})),M=async()=>{if(s){m(!0);try{await s()}finally{m(!1)}}},E=()=>{const R=t.columns.map(Y=>Y.name),D=Y=>{if(Y==null)return"";const q=String(Y);return/[",\n\r]/.test(q)?`"${q.replace(/"/g,'""')}"`:q},T=R.map(D).join(","),k=e.map(Y=>R.map(q=>D(Y[q])).join(",")),O=[T,...k].join(`\r
72
- `),L=new Blob([O],{type:"text/csv;charset=utf-8"}),W=URL.createObjectURL(L),B=document.createElement("a");B.href=W,B.download=`${t.schema}_${t.name}.csv`,B.click(),URL.revokeObjectURL(W)};return x.useEffect(()=>{const R=y.current;if(!R)return;const D=new ResizeObserver(k=>{const O=k[0];if(O){const{width:L,height:W}=O.contentRect;W>0&&w(W),L>0&&S(L)}});D.observe(R);const T=R.getBoundingClientRect();return T.height>0&&w(T.height),T.width>0&&S(T.width),()=>D.disconnect()},[d]),p.jsxs("div",{className:"h-full w-full min-w-0 flex flex-col",children:[p.jsxs("div",{className:"border-b border-border shrink-0",children:[p.jsxs("div",{className:"flex items-center justify-between gap-4 px-4 py-3 border-b border-border min-h-[57px]",children:[p.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[p.jsx(ih,{className:"w-5 h-5 shrink-0 text-muted-foreground"}),p.jsxs("div",{className:"min-w-0",children:[p.jsxs("span",{className:"text-xs text-muted-foreground",children:[t.schema,"."]}),p.jsx("span",{className:"font-semibold text-card-foreground",children:t.name})]})]}),d==="data"&&p.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[p.jsxs(St,{variant:"outline",size:"sm",onClick:M,disabled:g||n||!s,children:[p.jsx(II,{className:Ne("size-4 shrink-0",(g||n)&&"animate-spin")}),"Refresh"]}),p.jsxs(St,{variant:"outline",size:"sm",onClick:E,disabled:e.length===0,children:[p.jsx(G8,{className:"size-4 shrink-0"}),"Export"]})]})]}),p.jsx("div",{className:"flex px-4",children:iK.map(R=>p.jsx("button",{onClick:()=>f(R.id),className:`px-4 py-2.5 text-sm font-medium border-b-2 transition-colors ${d===R.id?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-card-foreground"}`,children:R.label},R.id))})]}),p.jsxs("div",{className:"flex-1 min-h-0 min-w-0 flex flex-col overflow-hidden",children:[d==="data"&&p.jsx("div",{className:"p-4 flex flex-col flex-1 min-h-0 min-w-0 overflow-hidden",children:n?p.jsx("div",{className:"flex items-center justify-center flex-1 text-muted-foreground text-sm",children:p.jsx(wl,{})}):o?p.jsxs("div",{className:"flex flex-col items-center justify-center flex-1 text-destructive text-sm gap-2",children:[p.jsx("p",{className:"font-medium",children:"Failed to load table data"}),p.jsx("p",{className:"text-muted-foreground",children:o})]}):p.jsx("div",{ref:y,className:"flex-1 min-h-0 min-w-0 w-full max-w-full overflow-hidden",children:p.jsx(JW,{data:e,columns:N,height:v,width:C,readOnly:!0})})}),d==="columns"&&p.jsx(tK,{table:t}),d==="relationships"&&p.jsx(oK,{table:t}),d==="rls"&&p.jsx(aK,{table:t,rls:i,rlsLoading:l,rlsError:u})]})]})}function cK(t){const e=ge.c(17),{openTables:n,activeTable:o,onSelectTab:s,onCloseTab:i,onPinTab:l}=t;if(n.length===0)return null;let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u=p.jsx("button",{className:"p-2 hover:bg-accent transition-colors border-r border-border",children:p.jsx(dy,{className:"w-4 h-4 text-muted-foreground"})}),e[0]=u):u=e[0];let d;if(e[1]!==o||e[2]!==i||e[3]!==l||e[4]!==s||e[5]!==n){let y;e[7]!==o||e[8]!==i||e[9]!==l||e[10]!==s?(y=v=>{const{table:w,isPinned:C}=v,S=`${w.schema}.${w.name}`,N=o?`${o.schema}.${o.name}`:null,M=S===N;return p.jsxs("div",{className:`group flex items-center gap-2 px-4 py-2 border-r border-border cursor-pointer transition-colors min-w-[150px] max-w-[250px] ${M?"bg-background border-t-2 border-t-primary":"hover:bg-accent/50"}`,onClick:()=>s(w),onDoubleClick:()=>l(w),children:[p.jsx(ih,{className:"w-4 h-4 shrink-0 text-muted-foreground"}),p.jsxs("div",{className:"flex-1 min-w-0",children:[p.jsxs("span",{className:`text-xs text-muted-foreground ${C?"":"italic"}`,children:[w.schema,"."]}),p.jsx("span",{className:`text-sm truncate ${M?"font-medium":""} ${C?"":"italic"}`,children:w.name})]}),p.jsx("button",{onClick:E=>{E.stopPropagation(),i(w)},className:"p-0.5 rounded hover:bg-accent opacity-0 group-hover:opacity-100 transition-opacity",children:p.jsx(vs,{className:"w-3.5 h-3.5 text-muted-foreground"})})]},S)},e[7]=o,e[8]=i,e[9]=l,e[10]=s,e[11]=y):y=e[11],d=n.map(y),e[1]=o,e[2]=i,e[3]=l,e[4]=s,e[5]=n,e[6]=d}else d=e[6];let f;e[12]!==d?(f=p.jsx("div",{className:"flex-1 flex overflow-x-auto",children:d}),e[12]=d,e[13]=f):f=e[13];let g;e[14]===Symbol.for("react.memo_cache_sentinel")?(g=p.jsx("button",{className:"p-2 hover:bg-accent transition-colors border-l border-border",children:p.jsx(ra,{className:"w-4 h-4 text-muted-foreground"})}),e[14]=g):g=e[14];let m;return e[15]!==f?(m=p.jsxs("div",{className:"flex items-center border-b border-border bg-card shrink-0",children:[u,f,g]}),e[15]=f,e[16]=m):m=e[16],m}async function uK(t,e,n,o=1e3){const s=await fetch("/api/tables/data",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({connectionString:t,schema:e,table:n,limit:o})});if(!s.ok){let l=`HTTP error! status: ${s.status}`;try{l=(await s.json()).error||l}catch{const u=await s.text().catch(()=>"");u&&(l=u)}throw new Error(l)}const i=await s.json();if(!i.success)throw new Error(i.error||"Failed to fetch table data");return Array.isArray(i.data)?i.data:[]}async function dK(t,e,n){const o=await fetch("/api/tables/rls",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({connectionString:t,schema:e,table:n})});if(!o.ok){let i=`HTTP error! status: ${o.status}`;try{i=(await o.json()).error||i}catch{const l=await o.text().catch(()=>"");l&&(i=l)}throw new Error(i)}const s=await o.json();if(!s.success)throw new Error(s.error||"Failed to fetch RLS info");return s.data}function fK({connection:t,table:e,limit:n=1e3}){const[o,s]=x.useState([]),[i,l]=x.useState(!1),[u,d]=x.useState(null),f=x.useCallback(async()=>{if(!t?.connectionString||!e){s([]),d(null);return}l(!0),d(null);try{const g=await uK(t.connectionString,e.schema,e.name,n);s(g)}catch(g){const m=g instanceof Error?g.message:"Failed to load table data";d(m),s([])}finally{l(!1)}},[t?.connectionString,e?.schema,e?.name,n]);return x.useEffect(()=>{f()},[f]),{data:o,loading:i,error:u,refetch:f}}function hK({connection:t,table:e}){const[n,o]=x.useState(null),[s,i]=x.useState(!1),[l,u]=x.useState(null),d=x.useCallback(async()=>{if(!t?.connectionString||!e){o(null),u(null);return}i(!0),u(null);try{const f=await dK(t.connectionString,e.schema,e.name);o(f)}catch(f){const g=f instanceof Error?f.message:"Failed to load RLS info";u(g),o(null)}finally{i(!1)}},[t?.connectionString,e?.schema,e?.name]);return x.useEffect(()=>{d()},[d]),{rls:n,loading:s,error:l,refetch:d}}const mK="fb-table-view",Y2={pinnedTables:[],selectedSchema:"all"};function gK(){const t=ge.c(6),[e,n]=Ch(mK,Y2);let o;t[0]!==n?(o=u=>{n(d=>({...d,selectedSchema:u}))},t[0]=n,t[1]=o):o=t[1];const s=o,i=e??Y2;let l;return t[2]!==s||t[3]!==n||t[4]!==i?(l={viewState:i,setViewState:n,setSelectedSchema:s},t[2]=s,t[3]=n,t[4]=i,t[5]=l):l=t[5],l}function gr(t){return`${t.schema}.${t.name}`}function pK(t){const e=ge.c(20),{schemaData:n,viewState:o,setViewState:s}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=[],e[0]=i):i=e[0];const[l,u]=x.useState(i),[d,f]=x.useState(null),[g,m]=x.useState(!1);let y,v;e[1]!==g||e[2]!==n||e[3]!==o.pinnedTables?(y=()=>{if(!n||g||(m(!0),o.pinnedTables.length===0))return;const L=[];for(const W of o.pinnedTables){const B=n.tables.find(Y=>Y.schema===W.schema&&Y.name===W.name);B&&L.push({table:B,isPinned:!0})}L.length>0&&(u(L),f(L[0].table))},v=[n,o.pinnedTables,g],e[1]=g,e[2]=n,e[3]=o.pinnedTables,e[4]=y,e[5]=v):(y=e[4],v=e[5]),x.useEffect(y,v);let w,C;e[6]!==g||e[7]!==l||e[8]!==s?(w=()=>{if(!g)return;const L=l.filter(bK).map(xK);s(W=>({...W,pinnedTables:L}))},C=[l,g,s],e[6]=g,e[7]=l,e[8]=s,e[9]=w,e[10]=C):(w=e[9],C=e[10]),x.useEffect(w,C);let S;e[11]===Symbol.for("react.memo_cache_sentinel")?(S=L=>{const W=gr(L);u(B=>{if(B.findIndex(z=>gr(z.table)===W)!==-1)return f(L),B;const q=B.findIndex(vK);if(q!==-1){const z=[...B];return z[q]={table:L,isPinned:!1},f(L),z}return f(L),[...B,{table:L,isPinned:!1}]})},e[11]=S):S=e[11];const N=S;let M;e[12]===Symbol.for("react.memo_cache_sentinel")?(M=L=>{const W=gr(L);u(B=>{const Y=B.findIndex(z=>gr(z.table)===W);if(Y!==-1){const z=[...B];return z[Y]={...z[Y],isPinned:!0},f(L),z}const q=B.findIndex(yK);if(q!==-1){const z=[...B];return z[q]={table:L,isPinned:!0},f(L),z}return f(L),[...B,{table:L,isPinned:!0}]})},e[12]=M):M=e[12];const E=M;let R;e[13]===Symbol.for("react.memo_cache_sentinel")?(R=L=>{const W=gr(L);u(B=>B.map(Y=>gr(Y.table)===W?{...Y,isPinned:!0}:Y))},e[13]=R):R=e[13];const D=R;let T;e[14]!==d?(T=L=>{const W=gr(L);u(B=>{const Y=B.filter(z=>gr(z.table)!==W),q=d?gr(d):null;if(W===q){const z=B.findIndex(A=>gr(A.table)===W),V=Math.min(z,Y.length-1);f(Y[V]?.table??null)}return Y})},e[14]=d,e[15]=T):T=e[15];const k=T;let O;return e[16]!==d||e[17]!==k||e[18]!==l?(O={openTables:l,activeTable:d,setActiveTable:f,onSingleClick:N,onDoubleClick:E,onPinTab:D,onCloseTab:k},e[16]=d,e[17]=k,e[18]=l,e[19]=O):O=e[19],O}function yK(t){return!t.isPinned}function vK(t){return!t.isPinned}function xK(t){return{schema:t.table.schema,name:t.table.name}}function bK(t){return t.isPinned}function wK(){const t=ge.c(44),{selectedConnection:e}=kr();let n;t[0]!==e?(n={connection:e},t[0]=e,t[1]=n):n=t[1];const{schemaData:o,loading:s,error:i}=mR(n),{viewState:l,setViewState:u,setSelectedSchema:d}=gK();let f;t[2]!==o||t[3]!==u||t[4]!==l?(f={schemaData:o,viewState:l,setViewState:u},t[2]=o,t[3]=u,t[4]=l,t[5]=f):f=t[5];const{openTables:g,activeTable:m,setActiveTable:y,onSingleClick:v,onDoubleClick:w,onPinTab:C,onCloseTab:S}=pK(f);let N;t[6]!==m||t[7]!==e?(N={connection:e,table:m},t[6]=m,t[7]=e,t[8]=N):N=t[8];const{data:M,loading:E,error:R,refetch:D}=fK(N);let T;t[9]!==m||t[10]!==e?(T={connection:e,table:m},t[9]=m,t[10]=e,t[11]=T):T=t[11];const{rls:k,loading:O,error:L}=hK(T);if(!e?.connectionString){let V;return t[12]===Symbol.for("react.memo_cache_sentinel")?(V=p.jsx("div",{className:"h-full flex items-center justify-center",children:p.jsx("p",{className:"text-muted-foreground",children:"Connection selected but missing connection string"})}),t[12]=V):V=t[12],V}if(s){let V;return t[13]===Symbol.for("react.memo_cache_sentinel")?(V=p.jsx("div",{className:"h-full flex items-center justify-center",children:p.jsx(wl,{})}),t[13]=V):V=t[13],V}if(i){let V;return t[14]!==i?(V=p.jsx("div",{className:"h-full flex items-center justify-center p-6",children:p.jsx("div",{className:"bg-destructive/10 border border-destructive/20 text-destructive px-4 py-3 rounded-md",children:i})}),t[14]=i,t[15]=V):V=t[15],V}if(!o)return null;let W;t[16]!==m||t[17]!==w||t[18]!==v||t[19]!==o.tables||t[20]!==d||t[21]!==l.selectedSchema?(W=p.jsx("div",{className:"w-64 shrink-0",children:p.jsx(SV,{tables:o.tables,selectedTable:m,selectedSchema:l.selectedSchema,onSchemaChange:d,onSingleClick:v,onDoubleClick:w})}),t[16]=m,t[17]=w,t[18]=v,t[19]=o.tables,t[20]=d,t[21]=l.selectedSchema,t[22]=W):W=t[22];let B;t[23]!==m||t[24]!==S||t[25]!==C||t[26]!==g||t[27]!==y?(B=p.jsx(cK,{openTables:g,activeTable:m,onSelectTab:y,onCloseTab:S,onPinTab:C}),t[23]=m,t[24]=S,t[25]=C,t[26]=g,t[27]=y,t[28]=B):B=t[28];let Y;t[29]!==m||t[30]!==D||t[31]!==L||t[32]!==O||t[33]!==M||t[34]!==R||t[35]!==E||t[36]!==k?(Y=p.jsx("div",{className:"flex-1 min-h-0 min-w-0 overflow-hidden",children:m?p.jsx(lK,{table:m,data:M,dataLoading:E,dataError:R,onRefresh:D,rls:k,rlsLoading:O,rlsError:L}):p.jsxs("div",{className:"h-full flex flex-col items-center justify-center text-muted-foreground",children:[p.jsx(ih,{className:"w-16 h-16 mb-4 opacity-30"}),p.jsx("p",{className:"text-lg font-medium",children:"Select a table"}),p.jsx("p",{className:"text-sm",children:"Choose a table from the list to view its details"})]})}),t[29]=m,t[30]=D,t[31]=L,t[32]=O,t[33]=M,t[34]=R,t[35]=E,t[36]=k,t[37]=Y):Y=t[37];let q;t[38]!==B||t[39]!==Y?(q=p.jsxs("div",{className:"flex-1 min-w-0 flex flex-col bg-background",children:[B,Y]}),t[38]=B,t[39]=Y,t[40]=q):q=t[40];let z;return t[41]!==W||t[42]!==q?(z=p.jsxs("div",{className:"h-full flex",children:[W,q]}),t[41]=W,t[42]=q,t[43]=z):z=t[43],z}function SK(t){const e=t.isUnique?"UNIQUE ":"",n=`${t.schema}.${t.table}`,o=t.columns.length>0?t.columns.join(", "):"";return`CREATE ${e}INDEX ${t.indexName} ON ${n} USING btree (${o})`}function CK(t){const e=ge.c(29),{index:n,open:o,onOpenChange:s}=t,[i,l]=x.useState(!1);let u;e[0]!==n?(u=n?SK(n):"",e[0]=n,e[1]=u):u=e[1];const d=u;let f;e[2]!==d?(f=async()=>{if(d)try{await navigator.clipboard.writeText(d),l(!0),setTimeout(()=>l(!1),2e3),Jt.success("Index Copied")}catch{Jt.error("Failed to copy")}},e[2]=d,e[3]=f):f=e[3];const g=f,m=n?n.indexName:"Index definition";let y;e[4]!==m?(y=p.jsx(vy,{children:m}),e[4]=m,e[5]=y):y=e[5];let v;e[6]===Symbol.for("react.memo_cache_sentinel")?(v=p.jsx("p",{className:"text-sm text-muted-foreground",children:"SQL for index definition"}),e[6]=v):v=e[6];let w;e[7]!==y?(w=p.jsxs(yy,{children:[y,v]}),e[7]=y,e[8]=w):w=e[8];let C;e[9]!==n?(C=n&&p.jsx("pre",{className:"text-xs bg-accent/50 p-2 rounded whitespace-pre-wrap break-words",children:p.jsxs("code",{children:[p.jsx("span",{className:"text-primary",children:"CREATE "}),n.isUnique&&p.jsx("span",{className:"text-primary",children:"UNIQUE "}),p.jsx("span",{className:"text-primary",children:"INDEX "}),p.jsxs("span",{className:"text-foreground",children:[n.indexName," "]}),p.jsx("span",{className:"text-primary",children:"ON "}),p.jsx("span",{className:"text-foreground",children:`${n.schema}.${n.table} `}),p.jsx("span",{className:"text-primary",children:"USING btree "}),p.jsxs("span",{className:"text-foreground",children:["(",n.columns.join(", "),")"]})]})}),e[9]=n,e[10]=C):C=e[10];let S;e[11]!==i?(S=i?p.jsx(da,{className:"h-4 w-4"}):p.jsx(fy,{className:"h-4 w-4"}),e[11]=i,e[12]=S):S=e[12];let N;e[13]!==g||e[14]!==S?(N=p.jsx(St,{variant:"outline",size:"icon",onClick:g,children:S}),e[13]=g,e[14]=S,e[15]=N):N=e[15];let M;e[16]!==C||e[17]!==N?(M=p.jsxs("div",{className:"flex-1 min-h-0 overflow-auto px-4 pb-4 space-y-4",children:[C,N]}),e[16]=C,e[17]=N,e[18]=M):M=e[18];let E;e[19]!==s?(E=p.jsx(u7,{className:"border-t border-border flex-row justify-end",children:p.jsx(St,{variant:"outline",onClick:()=>s(!1),children:"Close"})}),e[19]=s,e[20]=E):E=e[20];let R;e[21]!==M||e[22]!==E||e[23]!==w?(R=p.jsxs(py,{side:"right",className:"flex flex-col w-full sm:max-w-xl border-l border-border",showCloseButton:!0,children:[w,M,E]}),e[21]=M,e[22]=E,e[23]=w,e[24]=R):R=e[24];let D;return e[25]!==s||e[26]!==o||e[27]!==R?(D=p.jsx(gy,{open:o,onOpenChange:s,children:R}),e[25]=s,e[26]=o,e[27]=R,e[28]=D):D=e[28],D}function EK(t){if(t===0)return"0 B";const e=1024,n=["B","KB","MB","GB","TB"],o=Math.floor(Math.log(t)/Math.log(e));return parseFloat((t/Math.pow(e,o)).toFixed(1))+" "+n[o]}function _K(t){return t.toLocaleString()}function NK(t){const e=ge.c(35),{index:n,onSelect:o}=t;let s;e[0]!==o?(s=N=>{(N.key==="Enter"||N.key===" ")&&(N.preventDefault(),o?.())},e[0]=o,e[1]=s):s=e[1];let i;e[2]!==n.table?(i=p.jsx("td",{className:"p-4 font-medium",children:n.table}),e[2]=n.table,e[3]=i):i=e[3];let l;e[4]!==n.columns?(l=n.columns.length>0?n.columns.join(", "):"—",e[4]=n.columns,e[5]=l):l=e[5];let u;e[6]!==l?(u=p.jsx("td",{className:"p-4",children:p.jsx("span",{className:"text-muted-foreground line-clamp-1",children:l})}),e[6]=l,e[7]=u):u=e[7];let d;e[8]!==n.indexName?(d=p.jsx("span",{className:"font-mono text-sm",children:n.indexName}),e[8]=n.indexName,e[9]=d):d=e[9];let f;e[10]!==n.isPrimary?(f=n.isPrimary&&p.jsx("span",{className:"text-xs bg-primary/10 text-primary px-1.5 py-0.5 rounded",children:"PK"}),e[10]=n.isPrimary,e[11]=f):f=e[11];let g;e[12]!==n.isPrimary||e[13]!==n.isUnique?(g=n.isUnique&&!n.isPrimary&&p.jsx("span",{className:"text-xs bg-amber-500/10 text-amber-600 px-1.5 py-0.5 rounded",children:"Unique"}),e[12]=n.isPrimary,e[13]=n.isUnique,e[14]=g):g=e[14];let m;e[15]!==d||e[16]!==f||e[17]!==g?(m=p.jsx("td",{className:"p-4",children:p.jsxs("div",{className:"flex items-center gap-2",children:[d,f,g]})}),e[15]=d,e[16]=f,e[17]=g,e[18]=m):m=e[18];let y;e[19]!==n.sizeBytes?(y=EK(n.sizeBytes),e[19]=n.sizeBytes,e[20]=y):y=e[20];let v;e[21]!==y?(v=p.jsx("td",{className:"p-4 text-right font-mono text-muted-foreground text-nowrap",children:y}),e[21]=y,e[22]=v):v=e[22];let w;e[23]!==n.indexScans?(w=_K(n.indexScans),e[23]=n.indexScans,e[24]=w):w=e[24];let C;e[25]!==w?(C=p.jsx("td",{className:"p-4 text-right font-mono text-muted-foreground",children:w}),e[25]=w,e[26]=C):C=e[26];let S;return e[27]!==o||e[28]!==s||e[29]!==v||e[30]!==C||e[31]!==i||e[32]!==u||e[33]!==m?(S=p.jsxs("tr",{className:"border-b hover:bg-muted/30 transition-colors cursor-pointer",onClick:o,role:"button",tabIndex:0,onKeyDown:s,children:[i,u,m,v,C]}),e[27]=o,e[28]=s,e[29]=v,e[30]=C,e[31]=i,e[32]=u,e[33]=m,e[34]=S):S=e[34],S}function MK(){const t=ge.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=p.jsxs("div",{className:"flex flex-col gap-2 shrink-0",children:[p.jsx("h1",{className:"text-2xl font-bold",children:"Indexes"}),p.jsx("p",{className:"text-muted-foreground",children:"View and manage indexes for your database"})]}),t[0]=e):e=t[0],e}const b3=x.createContext(null);function w3(){const t=x.useContext(b3);if(!t)throw new Error("MultiSelect components must be used within MultiSelect");return t}function RK(t){const e=ge.c(16),{value:n,onValueChange:o,options:s,children:i}=t;let l;e[0]!==o||e[1]!==s||e[2]!==n?(l=v=>{const w=n.length===0;if(w||n.includes(v))if(w)o(s.filter(S=>S!==v));else{const S=n.filter(N=>N!==v);o(S.length===0?s:S)}else{const S=[...n,v];o(S.length===s.length?[]:S)}},e[0]=o,e[1]=s,e[2]=n,e[3]=l):l=e[3];const u=l;let d;e[4]!==n?(d=v=>n.length===0||n.includes(v),e[4]=n,e[5]=d):d=e[5];const f=d;let g;e[6]!==f||e[7]!==u||e[8]!==s||e[9]!==n?(g={value:n,options:s,onToggle:u,isChecked:f},e[6]=f,e[7]=u,e[8]=s,e[9]=n,e[10]=g):g=e[10];let m;e[11]!==i?(m=p.jsx(xl,{modal:!0,children:i}),e[11]=i,e[12]=m):m=e[12];let y;return e[13]!==g||e[14]!==m?(y=p.jsx(b3.Provider,{value:g,children:m}),e[13]=g,e[14]=m,e[15]=y):y=e[15],y}function DK(t){const e=ge.c(20);let n,o,s,i,l;e[0]!==t?({className:o,size:i,placeholder:l,children:n,...s}=t,e[0]=t,e[1]=n,e[2]=o,e[3]=s,e[4]=i,e[5]=l):(n=e[1],o=e[2],s=e[3],i=e[4],l=e[5]);const u=i===void 0?"default":i,d=l===void 0?"Select...":l,{value:f,options:g}=w3(),m=f.length===0||f.length===g.length;let y;e[6]!==m||e[7]!==n||e[8]!==d||e[9]!==f[0]||e[10]!==f.length?(y=n??p.jsx("span",{className:"truncate text-muted-foreground",children:f.length===0||m?d:f.length===1?f[0]:`${f.length} selected`}),e[6]=m,e[7]=n,e[8]=d,e[9]=f[0],e[10]=f.length,e[11]=y):y=e[11];const v=y;let w;e[12]!==o?(w=Ne("border-input data-[placeholder]:text-muted-foreground dark:bg-input/30 dark:hover:bg-input/50 focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 gap-1.5 rounded-md border bg-transparent py-2 pr-2 pl-2.5 text-sm shadow-xs transition-[color,box-shadow] focus-visible:ring-[3px] aria-invalid:ring-[3px] data-[size=default]:h-9 data-[size=sm]:h-8 [&_svg:not([class*='size-'])]:size-4 flex w-fit min-w-0 items-center justify-between whitespace-nowrap outline-none disabled:cursor-not-allowed disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",o),e[12]=o,e[13]=w):w=e[13];let C;e[14]===Symbol.for("react.memo_cache_sentinel")?(C=p.jsx(ms,{className:"text-muted-foreground size-4 pointer-events-none shrink-0 ml-2"}),e[14]=C):C=e[14];let S;return e[15]!==s||e[16]!==u||e[17]!==w||e[18]!==v?(S=p.jsxs(hR,{"data-slot":"multi-select-trigger","data-size":u,className:w,...s,children:[v,C]}),e[15]=s,e[16]=u,e[17]=w,e[18]=v,e[19]=S):S=e[19],S}function TK(t){const e=ge.c(14);let n,o,s,i,l;e[0]!==t?({className:o,align:i,sideOffset:l,children:n,...s}=t,e[0]=t,e[1]=n,e[2]=o,e[3]=s,e[4]=i,e[5]=l):(n=e[1],o=e[2],s=e[3],i=e[4],l=e[5]);const u=i===void 0?"start":i,d=l===void 0?4:l;let f;e[6]!==o?(f=Ne("ring-foreground/10 min-w-[var(--radix-popover-trigger-width)] max-h-[var(--radix-select-content-available-height)] overflow-y-auto rounded-md shadow-md ring-1 p-1 text-sm data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-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 duration-100 z-50 bg-popover text-popover-foreground outline-hidden flex flex-col gap-0.5",o),e[6]=o,e[7]=f):f=e[7];let g;return e[8]!==u||e[9]!==n||e[10]!==s||e[11]!==d||e[12]!==f?(g=p.jsx(bl,{align:u,sideOffset:d,className:f,...s,children:n}),e[8]=u,e[9]=n,e[10]=s,e[11]=d,e[12]=f,e[13]=g):g=e[13],g}function kK(t){const e=ge.c(26);let n,o,s,i;e[0]!==t?({className:o,value:s,children:n,...i}=t,e[0]=t,e[1]=n,e[2]=o,e[3]=s,e[4]=i):(n=e[1],o=e[2],s=e[3],i=e[4]);const{onToggle:l,isChecked:u}=w3();let d;e[5]!==u||e[6]!==s?(d=u(s),e[5]=u,e[6]=s,e[7]=d):d=e[7];const f=d;let g;e[8]!==o?(g=Ne("focus:bg-accent focus:text-accent-foreground gap-2 rounded-sm py-1 pl-2 pr-2 text-sm relative flex w-full cursor-pointer items-center outline-none select-none hover:bg-accent [&_svg]:pointer-events-none [&_svg]:shrink-0 min-h-[1.75rem]",o),e[8]=o,e[9]=g):g=e[9];let m,y;e[10]!==s||e[11]!==l?(m=()=>l(s),y=S=>{(S.key==="Enter"||S.key===" ")&&(S.preventDefault(),l(s))},e[10]=s,e[11]=l,e[12]=m,e[13]=y):(m=e[12],y=e[13]);let v;e[14]!==f?(v=p.jsx(Wy,{className:"rounded-none pointer-events-none shrink-0",checked:f,tabIndex:-1,"aria-hidden":!0}),e[14]=f,e[15]=v):v=e[15];let w;e[16]!==n?(w=p.jsx("span",{className:"flex-1 truncate",children:n}),e[16]=n,e[17]=w):w=e[17];let C;return e[18]!==f||e[19]!==i||e[20]!==g||e[21]!==m||e[22]!==y||e[23]!==v||e[24]!==w?(C=p.jsxs("div",{role:"option","aria-selected":f,"data-slot":"multi-select-item",className:g,onClick:m,onKeyDown:y,tabIndex:0,...i,children:[v,w]}),e[18]=f,e[19]=i,e[20]=g,e[21]=m,e[22]=y,e[23]=v,e[24]=w,e[25]=C):C=e[25],C}const jK="fb-index-view",AK=[{value:"size-desc",label:"Largest size"},{value:"scans-desc",label:"Most scans"},{value:"scans-asc",label:"Least scans"},{value:"name-asc",label:"Index name (A–Z)"},{value:"table-asc",label:"Table (A–Z)"}];function OK(t){const e=ge.c(23),{schemas:n,selectedSchemas:o,onSelectedSchemasChange:s,searchQuery:i,onSearchQueryChange:l,sortBy:u,onSortByChange:d}=t;let f;e[0]!==s||e[1]!==n||e[2]!==o?(f=n.length>0&&p.jsxs(RK,{value:o,onValueChange:s,options:n,children:[p.jsx(DK,{className:"w-[180px] font-normal",placeholder:"All schemas",children:p.jsx("span",{className:"truncate text-muted-foreground",children:o.length===0||o.length===n.length?"All schemas":o.length===1?o[0]:`${o.length} schemas`})}),p.jsx(TK,{className:"w-[180px] max-h-[280px]",children:n.map(IK)})]}),e[0]=s,e[1]=n,e[2]=o,e[3]=f):f=e[3];let g;e[4]===Symbol.for("react.memo_cache_sentinel")?(g=p.jsx(iu,{className:"absolute left-3 top-1/2 -translate-y-1/2 size-4 text-muted-foreground"}),e[4]=g):g=e[4];let m;e[5]!==l?(m=E=>l(E.target.value),e[5]=l,e[6]=m):m=e[6];let y;e[7]!==i||e[8]!==m?(y=p.jsxs("div",{className:"relative min-w-[240px]",children:[g,p.jsx(ar,{placeholder:"Search for an index",value:i,onChange:m,className:"pl-9"})]}),e[7]=i,e[8]=m,e[9]=y):y=e[9];let v;e[10]!==f||e[11]!==y?(v=p.jsxs("div",{className:"flex items-center gap-3",children:[f,y]}),e[10]=f,e[11]=y,e[12]=v):v=e[12];let w;e[13]!==d?(w=E=>d(E),e[13]=d,e[14]=w):w=e[14];let C;e[15]===Symbol.for("react.memo_cache_sentinel")?(C=p.jsx(Gc,{className:"w-[180px]",children:p.jsx(al,{placeholder:"Sort by"})}),e[15]=C):C=e[15];let S;e[16]===Symbol.for("react.memo_cache_sentinel")?(S=p.jsx(qc,{children:AK.map(zK)}),e[16]=S):S=e[16];let N;e[17]!==u||e[18]!==w?(N=p.jsx("div",{className:"flex items-center gap-2",children:p.jsxs(Yc,{value:u,onValueChange:w,children:[C,S]})}),e[17]=u,e[18]=w,e[19]=N):N=e[19];let M;return e[20]!==v||e[21]!==N?(M=p.jsx("div",{className:"shrink-0 py-6 border-b bg-background",children:p.jsxs("div",{className:"flex items-center justify-between gap-4 flex-wrap",children:[v,N]})}),e[20]=v,e[21]=N,e[22]=M):M=e[22],M}function zK(t){return p.jsx(vr,{value:t.value,children:t.label},t.value)}function IK(t){return p.jsx(kK,{value:t,children:t},t)}function PK(t){const e=ge.c(5),{indexes:n,totalIndexCount:o,onSelectIndex:s}=t,i=n.length===0,l=o===0;let u;return e[0]!==l||e[1]!==n||e[2]!==i||e[3]!==s?(u=p.jsx("div",{className:"min-h-0 max-h-[calc(100vh-12rem)] overflow-y-auto border border-border rounded-md",children:i?p.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[300px] text-muted-foreground py-12",children:[p.jsx(wN,{className:"size-12 mb-4 opacity-30"}),p.jsx("p",{className:"text-lg font-medium",children:l?"No indexes found":"No matching indexes"}),p.jsx("p",{className:"text-sm",children:l?"This database has no user-created indexes.":"Try adjusting your filters or search query."})]}):p.jsxs("table",{className:"w-full text-sm",children:[p.jsx("thead",{className:"bg-background sticky top-0 z-10",children:p.jsxs("tr",{children:[p.jsx("th",{className:"text-left p-4 font-medium uppercase text-xs text-muted-foreground",children:"Table"}),p.jsx("th",{className:"text-left p-4 font-medium uppercase text-xs text-muted-foreground",children:"Columns"}),p.jsx("th",{className:"text-left p-4 font-medium uppercase text-xs text-muted-foreground",children:"Name"}),p.jsx("th",{className:"text-right p-4 font-medium uppercase text-xs text-muted-foreground",children:"Size"}),p.jsx("th",{className:"text-right p-4 font-medium uppercase text-xs text-muted-foreground",children:"Scans"})]})}),p.jsx("tbody",{children:n.map(d=>p.jsx(NK,{index:d,onSelect:()=>s(d)},`${d.schema}.${d.indexName}`))})]})}),e[0]=l,e[1]=n,e[2]=i,e[3]=s,e[4]=u):u=e[4],u}async function $K(t){const e=await fetch("/api/indexes/list",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({connectionString:t})});if(!e.ok){let o=`HTTP error! status: ${e.status}`;try{const s=await e.json();o=s.error||o,console.error("API error response:",s)}catch{const s=await e.text().catch(()=>"");console.error("Failed to parse error response. Raw response:",s)}throw new Error(o)}const n=await e.json();if(!n.success||!n.data)throw new Error(n.error||"Failed to fetch indexes data");return n.data}function LK(){const{selectedConnection:t}=kr(),[e,n]=x.useState(null),[o,s]=x.useState(!1),[i,l]=x.useState(null),u=x.useCallback(async()=>{if(!t?.connectionString){n(null),l(null);return}s(!0),l(null);try{const d=await $K(t.connectionString);n(d)}catch(d){const f=d instanceof Error?d.message:"Failed to load indexes";l(f),n(null)}finally{s(!1)}},[t?.connectionString]);return x.useEffect(()=>{t?.connectionString&&u()},[t?.connectionString,u]),{data:e,loading:o,error:i,loadIndexes:u}}const cf={selectedSchemas:[],sortBy:"scans-desc"},HK=["size-desc","scans-desc","scans-asc","name-asc","table-asc"];function Op(t){if(!t||typeof t!="object")return cf;const e=t;let n=cf.selectedSchemas;return Array.isArray(e.selectedSchemas)&&e.selectedSchemas.every(o=>typeof o=="string")?n=e.selectedSchemas:typeof e.schemaFilter=="string"&&e.schemaFilter!=="all"&&(n=[e.schemaFilter]),{selectedSchemas:n,sortBy:HK.includes(e.sortBy)?e.sortBy:cf.sortBy}}function BK(){const t=ge.c(10),[e,n]=Ch(jK,cf);let o;t[0]!==e?(o=Op(e),t[0]=e,t[1]=o):o=t[1];const s=o;let i;t[2]!==n?(i=g=>{n(m=>{const y=Op(m),v=typeof g=="function"?g(y.selectedSchemas):g;return{...y,selectedSchemas:v}})},t[2]=n,t[3]=i):i=t[3];const l=i;let u;t[4]!==n?(u=g=>{n(m=>({...Op(m),sortBy:g}))},t[4]=n,t[5]=u):u=t[5];const d=u;let f;return t[6]!==l||t[7]!==d||t[8]!==s?(f={viewState:s,setSelectedSchemas:l,setSortBy:d},t[6]=l,t[7]=d,t[8]=s,t[9]=f):f=t[9],f}function FK(t,e){if(!t?.length)return[];let n=t;const{selectedSchemas:o,searchQuery:s,sortBy:i}=e;if(o.length>0){const u=new Set(o);n=n.filter(d=>u.has(d.schema))}if(s.trim()){const u=s.toLowerCase();n=n.filter(d=>d.indexName.toLowerCase().includes(u)||d.table.toLowerCase().includes(u)||d.columns.some(f=>f.toLowerCase().includes(u)))}const l=[...n];switch(i){case"size-desc":l.sort((u,d)=>d.sizeBytes-u.sizeBytes);break;case"scans-desc":l.sort((u,d)=>d.indexScans-u.indexScans);break;case"scans-asc":l.sort((u,d)=>u.indexScans-d.indexScans);break;case"name-asc":l.sort((u,d)=>u.indexName.localeCompare(d.indexName));break;case"table-asc":l.sort((u,d)=>u.table.localeCompare(d.table)||u.indexName.localeCompare(d.indexName));break}return l}function VK(){const t=ge.c(31),{data:e,loading:n,error:o}=LK(),{viewState:s,setSelectedSchemas:i,setSortBy:l}=BK(),{selectedSchemas:u,sortBy:d}=s,[f,g]=x.useState(""),[m,y]=x.useState(null),[v,w]=x.useState(!1);e?.indexes;const C=e?.indexes;let S;t[0]!==f||t[1]!==u||t[2]!==d||t[3]!==C?(S=FK(C,{selectedSchemas:u,searchQuery:f,sortBy:d}),t[0]=f,t[1]=u,t[2]=d,t[3]=C,t[4]=S):S=t[4];const N=S;if(n&&!e){let B;return t[5]===Symbol.for("react.memo_cache_sentinel")?(B=p.jsx("div",{className:"h-full flex items-center justify-center",children:p.jsx(wl,{})}),t[5]=B):B=t[5],B}if(o){let B;return t[6]!==o?(B=p.jsx("div",{className:"h-full flex items-center justify-center p-6",children:p.jsx("div",{className:"bg-destructive/10 border border-destructive/20 text-destructive px-4 py-3 rounded-md max-w-lg",children:o})}),t[6]=o,t[7]=B):B=t[7],B}let M;t[8]===Symbol.for("react.memo_cache_sentinel")?(M=p.jsx(MK,{}),t[8]=M):M=t[8];let E;t[9]!==e?.schemas?(E=e?.schemas??[],t[9]=e?.schemas,t[10]=E):E=t[10];let R;t[11]!==f||t[12]!==u||t[13]!==i||t[14]!==l||t[15]!==d||t[16]!==E?(R=p.jsx(OK,{schemas:E,selectedSchemas:u,onSelectedSchemasChange:i,searchQuery:f,onSearchQueryChange:g,sortBy:d,onSortByChange:l}),t[11]=f,t[12]=u,t[13]=i,t[14]=l,t[15]=d,t[16]=E,t[17]=R):R=t[17];const D=e?.indexes?.length??0;let T;t[18]===Symbol.for("react.memo_cache_sentinel")?(T=B=>{y(B),w(!0)},t[18]=T):T=t[18];let k;t[19]!==N||t[20]!==D?(k=p.jsx(PK,{indexes:N,totalIndexCount:D,onSelectIndex:T}),t[19]=N,t[20]=D,t[21]=k):k=t[21];let O;t[22]!==R||t[23]!==k?(O=p.jsxs("div",{className:"w-full max-w-7xl mx-auto flex flex-col min-h-0 flex-1",children:[M,R,k]}),t[22]=R,t[23]=k,t[24]=O):O=t[24];let L;t[25]!==v||t[26]!==m?(L=p.jsx(CK,{index:m,open:v,onOpenChange:w}),t[25]=v,t[26]=m,t[27]=L):L=t[27];let W;return t[28]!==O||t[29]!==L?(W=p.jsxs("div",{className:"p-6 h-full flex flex-col overflow-hidden pb-6",children:[O,L]}),t[28]=O,t[29]=L,t[30]=W):W=t[30],W}function UK(t){const e=ge.c(64),{queries:n,selectedQuery:o,unsavedQuery:s,onSelectQuery:i,onPinQuery:l,onDeleteQuery:u,onNewQuery:d,editingQueryId:f,onStartRename:g,onRename:m,onCancelRename:y}=t,[v,w]=x.useState(""),[C,S]=x.useState(""),N=x.useRef(null);let M,E;e[0]!==f||e[1]!==n||e[2]!==s?(M=()=>{if(f){const X=s?.id===f?s.name:n.find(ee=>ee.id===f)?.name??"";S(X),N.current?.focus(),N.current?.select()}},E=[f,n,s],e[0]=f,e[1]=n,e[2]=s,e[3]=M,e[4]=E):(M=e[3],E=e[4]),x.useEffect(M,E);let R;e:{if(!v.trim()){R=n;break e}let X;if(e[5]!==n||e[6]!==v){const ee=v.toLowerCase();X=n.filter(se=>se.name.toLowerCase().includes(ee)||se.sql.toLowerCase().includes(ee)),e[5]=n,e[6]=v,e[7]=X}else X=e[7];R=X}const D=R;let T;e:{if(!s){T=D;break e}if(!v.trim()){let le;e[8]!==D||e[9]!==s?(le=[s,...D],e[8]=D,e[9]=s,e[10]=le):le=e[10],T=le;break e}let X;if(e[11]!==v||e[12]!==s.name||e[13]!==s.sql){const le=v.toLowerCase();X=s.name.toLowerCase().includes(le)||s.sql.toLowerCase().includes(le),e[11]=v,e[12]=s.name,e[13]=s.sql,e[14]=X}else X=e[14];const ee=X;let se;e[15]!==D||e[16]!==ee||e[17]!==s?(se=ee?[s,...D]:D,e[15]=D,e[16]=ee,e[17]=s,e[18]=se):se=e[18],T=se}const k=T,[O,L]=x.useState(null);let W,B;e[19]!==O?(W=()=>{if(!O)return;const X=()=>L(null);return window.addEventListener("click",X),window.addEventListener("scroll",X,!0),()=>{window.removeEventListener("click",X),window.removeEventListener("scroll",X,!0)}},B=[O],e[19]=O,e[20]=W,e[21]=B):(W=e[20],B=e[21]),x.useEffect(W,B);let Y;e[22]===Symbol.for("react.memo_cache_sentinel")?(Y=p.jsx("h2",{className:"text-sm font-semibold text-card-foreground",children:"Queries"}),e[22]=Y):Y=e[22];let q;e[23]===Symbol.for("react.memo_cache_sentinel")?(q=p.jsx(ra,{className:"w-4 h-4"}),e[23]=q):q=e[23];let z;e[24]!==d?(z=p.jsxs("div",{className:"flex items-center justify-between gap-2",children:[Y,p.jsx(St,{variant:"ghost",size:"icon",className:"h-8 w-8 shrink-0",onClick:d,title:"New query",children:q})]}),e[24]=d,e[25]=z):z=e[25];let V;e[26]===Symbol.for("react.memo_cache_sentinel")?(V=p.jsx(iu,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),e[26]=V):V=e[26];let A;e[27]===Symbol.for("react.memo_cache_sentinel")?(A=X=>w(X.target.value),e[27]=A):A=e[27];let H;e[28]!==v?(H=p.jsxs("div",{className:"relative",children:[V,p.jsx(ar,{placeholder:"Search queries...",value:v,onChange:A,className:"pl-8 h-8 text-sm"})]}),e[28]=v,e[29]=H):H=e[29];let P;e[30]!==H||e[31]!==z?(P=p.jsxs("div",{className:"p-3 border-b border-border shrink-0 space-y-2",children:[z,H]}),e[30]=H,e[31]=z,e[32]=P):P=e[32];let F;e[33]!==k||e[34]!==f||e[35]!==y||e[36]!==l||e[37]!==m||e[38]!==i||e[39]!==C||e[40]!==o?.id?(F=k.map(X=>{const ee=o?.id===X.id;return f===X.id?p.jsxs("div",{className:"flex items-center gap-2 rounded-md bg-accent/50 px-2 py-1.5",children:[p.jsx(e0,{className:"w-4 h-4 shrink-0 text-muted-foreground"}),p.jsx(ar,{ref:N,value:C,onChange:le=>S(le.target.value),onKeyDown:le=>{if(le.key==="Enter"){const pe=C.trim();pe&&m(X.id,pe),y()}le.key==="Escape"&&y()},onBlur:()=>{const le=C.trim();le&&m(X.id,le),y()},onClick:GK,className:"h-7 flex-1 min-w-0 text-sm"})]},X.id):p.jsx("div",{className:Ne("group flex items-center gap-1 rounded-md text-sm transition-colors",ee?"bg-accent text-accent-foreground":"hover:bg-accent/50 text-card-foreground"),onContextMenu:le=>{le.preventDefault(),le.stopPropagation(),L({x:le.clientX,y:le.clientY,query:X})},children:p.jsxs("button",{type:"button",onClick:()=>i(X),onDoubleClick:()=>l(X),className:"flex flex-1 min-w-0 items-center gap-2 px-2 py-1.5 text-left",children:[p.jsx(e0,{className:"w-4 h-4 shrink-0"}),p.jsx("span",{className:"truncate flex-1",children:X.name})]})},X.id)}),e[33]=k,e[34]=f,e[35]=y,e[36]=l,e[37]=m,e[38]=i,e[39]=C,e[40]=o?.id,e[41]=F):F=e[41];let Q;e[42]!==F?(Q=p.jsx("div",{className:"space-y-0.5",children:F}),e[42]=F,e[43]=Q):Q=e[43];let $;e[44]!==k.length||e[45]!==n||e[46]!==s?($=k.length===0&&p.jsx("div",{className:"px-2 py-4 text-sm text-muted-foreground text-center",children:n.length===0&&!s?"No saved queries":"No queries found"}),e[44]=k.length,e[45]=n,e[46]=s,e[47]=$):$=e[47];let I;e[48]!==Q||e[49]!==$?(I=p.jsxs("div",{className:"flex-1 overflow-y-auto p-2",children:[Q,$]}),e[48]=Q,e[49]=$,e[50]=I):I=e[50];let U;e[51]!==O||e[52]!==u||e[53]!==g||e[54]!==s?(U=O&&qa.createPortal(p.jsxs("div",{className:"fixed z-50 min-w-32 rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-md",style:{left:O.x,top:O.y},onClick:YK,children:[p.jsxs("button",{type:"button",className:"flex w-full cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none hover:bg-accent hover:text-accent-foreground",onClick:()=>{g(O.query.id),L(null)},children:[p.jsx(SN,{className:"h-4 w-4 shrink-0"}),"Change name"]}),(!s||O.query.id!==s.id)&&u&&p.jsxs("button",{type:"button",className:"flex w-full cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none hover:bg-destructive/10 hover:text-destructive",onClick:()=>{u(O.query.id),L(null)},children:[p.jsx(my,{className:"h-4 w-4 shrink-0"}),"Remove"]})]}),document.body),e[51]=O,e[52]=u,e[53]=g,e[54]=s,e[55]=U):U=e[55];const K=k.length===1?"query":"queries";let J;e[56]!==k.length||e[57]!==K?(J=p.jsx("div",{className:"p-3 border-t border-border shrink-0",children:p.jsxs("p",{className:"text-xs text-muted-foreground",children:[k.length," ",K]})}),e[56]=k.length,e[57]=K,e[58]=J):J=e[58];let ne;return e[59]!==P||e[60]!==I||e[61]!==U||e[62]!==J?(ne=p.jsxs("div",{className:"h-full flex flex-col bg-card border-r border-border",children:[P,I,U,J]}),e[59]=P,e[60]=I,e[61]=U,e[62]=J,e[63]=ne):ne=e[63],ne}function YK(t){return t.stopPropagation()}function GK(t){return t.stopPropagation()}function qK(t){const e=ge.c(19),{openTabs:n,activeTabId:o,onSelectTab:s,onCloseTab:i,onPinTab:l,onNewTab:u}=t;if(n.length===0&&!u)return null;let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=p.jsx("button",{type:"button",className:"p-2 hover:bg-accent transition-colors border-r border-border","aria-label":"Collapse",children:p.jsx(dy,{className:"w-4 h-4 text-muted-foreground"})}),e[0]=d):d=e[0];let f;if(e[1]!==o||e[2]!==i||e[3]!==l||e[4]!==s||e[5]!==n){let v;e[7]!==o||e[8]!==i||e[9]!==l||e[10]!==s?(v=w=>{const C=w.id===o;return p.jsxs("div",{role:"tab",tabIndex:0,className:`group flex items-center gap-2 px-4 py-2 border-r border-border cursor-pointer transition-colors min-w-[120px] max-w-[220px] ${C?"bg-background border-t-2 border-t-primary":"hover:bg-accent/50"}`,onClick:()=>s(w.id),onDoubleClick:()=>l(w.id),children:[p.jsx(e0,{className:"w-4 h-4 shrink-0 text-muted-foreground"}),p.jsx("span",{className:`flex-1 min-w-0 truncate text-sm ${C?"font-medium":""} ${w.isPinned?"":"italic"}`,children:w.name}),p.jsx("button",{type:"button",onClick:S=>{S.stopPropagation(),i(w.id)},className:"p-0.5 rounded hover:bg-accent opacity-0 group-hover:opacity-100 transition-opacity","aria-label":"Close tab",children:p.jsx(vs,{className:"w-3.5 h-3.5 text-muted-foreground"})})]},w.id)},e[7]=o,e[8]=i,e[9]=l,e[10]=s,e[11]=v):v=e[11],f=n.map(v),e[1]=o,e[2]=i,e[3]=l,e[4]=s,e[5]=n,e[6]=f}else f=e[6];let g;e[12]!==f?(g=p.jsx("div",{className:"flex-1 flex overflow-x-auto",children:f}),e[12]=f,e[13]=g):g=e[13];let m;e[14]!==u?(m=u&&p.jsx("button",{type:"button",onClick:u,className:"p-2 hover:bg-accent transition-colors border-l border-border","aria-label":"New query",children:p.jsx(ra,{className:"w-4 h-4 text-muted-foreground"})}),e[14]=u,e[15]=m):m=e[15];let y;return e[16]!==g||e[17]!==m?(y=p.jsxs("div",{className:"flex items-center border-b border-border bg-card shrink-0",children:[d,g,m]}),e[16]=g,e[17]=m,e[18]=y):y=e[18],y}function WK(t){const e=ge.c(28),{activeTab:n,sql:o,onSqlChange:s,onKeyDown:i,onRun:l,isRunning:u,runDisabled:d,className:f}=t;let g;e[0]!==f?(g=Ne("flex-[6] min-h-0 flex flex-col",f),e[0]=f,e[1]=g):g=e[1];let m;e[2]!==n?(m=n&&p.jsxs("span",{className:"ml-2 font-normal",children:["— ",n.name]}),e[2]=n,e[3]=m):m=e[3];let y;e[4]!==m?(y=p.jsxs("div",{className:"shrink-0 px-3 py-2 border-b border-border bg-card text-sm font-medium text-muted-foreground",children:["SQL Editor",m]}),e[4]=m,e[5]=y):y=e[5];let v;e[6]!==s?(v=T=>s(T.target.value),e[6]=s,e[7]=v):v=e[7];let w;e[8]===Symbol.for("react.memo_cache_sentinel")?(w=Ne("flex-1 min-h-0 w-full resize-none font-mono text-sm rounded-none border-0","bg-transparent focus-visible:ring-0"),e[8]=w):w=e[8];let C;e[9]!==i||e[10]!==o||e[11]!==v?(C=p.jsx(a3,{value:o,onChange:v,onKeyDown:i,placeholder:"SELECT * FROM ...",className:w}),e[9]=i,e[10]=o,e[11]=v,e[12]=C):C=e[12];let S;e[13]===Symbol.for("react.memo_cache_sentinel")?(S=p.jsx("span",{className:"text-xs text-muted-foreground",children:"⌘ Enter"}),e[13]=S):S=e[13];let N;e[14]!==u?(N=u?p.jsx(hy,{className:"size-4 animate-spin"}):p.jsx(kI,{className:"size-4"}),e[14]=u,e[15]=N):N=e[15];const M=u?"Running...":"Run";let E;e[16]!==l||e[17]!==d||e[18]!==N||e[19]!==M?(E=p.jsxs("div",{className:"shrink-0 px-3 py-2 border-t border-border bg-card flex items-center justify-end gap-2",children:[S,p.jsxs(St,{onClick:l,disabled:d,size:"sm",children:[N,M]})]}),e[16]=l,e[17]=d,e[18]=N,e[19]=M,e[20]=E):E=e[20];let R;e[21]!==E||e[22]!==y||e[23]!==C?(R=p.jsxs("div",{className:"flex-1 min-h-0 flex flex-col rounded-md border border-border bg-card overflow-hidden",children:[y,C,E]}),e[21]=E,e[22]=y,e[23]=C,e[24]=R):R=e[24];let D;return e[25]!==g||e[26]!==R?(D=p.jsx("div",{className:g,children:R}),e[25]=g,e[26]=R,e[27]=D):D=e[27],D}function KK(t){const e=ge.c(20),{isRunning:n,error:o,result:s,className:i}=t;let l;e[0]!==s?(l=s?.rows?.length?Object.keys(s.rows[0]):[],e[0]=s,e[1]=l):l=e[1];const u=l;let d;e[2]!==i?(d=Ne("flex-[4] min-h-0 flex flex-col",i),e[2]=i,e[3]=d):d=e[3];let f;e[4]===Symbol.for("react.memo_cache_sentinel")?(f=Ne("flex-1 min-h-0 flex flex-col overflow-hidden rounded-md border border-border","bg-card"),e[4]=f):f=e[4];let g;e[5]!==s?(g=s&&p.jsxs("span",{className:"ml-2 font-normal text-xs",children:["(",s.rowCount," ",s.rowCount===1?"row":"rows",")"]}),e[5]=s,e[6]=g):g=e[6];let m;e[7]!==g?(m=p.jsxs("div",{className:"shrink-0 px-3 py-2 border-b border-border bg-card text-sm font-medium text-muted-foreground",children:["Results",g]}),e[7]=g,e[8]=m):m=e[8];let y;e[9]!==u||e[10]!==o||e[11]!==n||e[12]!==s?(y=p.jsx("div",{className:"flex-1 min-h-0 overflow-auto",children:n?p.jsxs("div",{className:"flex items-center justify-center h-full gap-2 text-muted-foreground text-sm",children:[p.jsx(hy,{className:"size-4 animate-spin"}),"Running..."]}):o?p.jsx("pre",{className:"p-3 text-sm font-mono text-destructive whitespace-pre-wrap break-words",children:o}):s?s.rows.length===0?p.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground text-sm",children:"Query executed successfully. No rows returned."}):p.jsxs("table",{className:"w-full text-sm",children:[p.jsx("thead",{className:"sticky top-0 bg-card",children:p.jsx("tr",{className:"border-b border-border",children:u.map(XK)})}),p.jsx("tbody",{children:s.rows.map((C,S)=>p.jsx("tr",{className:"border-b border-border last:border-b-0",children:u.map(N=>p.jsx("td",{className:"px-3 py-1.5 font-mono whitespace-nowrap",children:C[N]===null?p.jsx("span",{className:"text-muted-foreground italic",children:"null"}):String(C[N])},N))},S))})]}):p.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground text-sm",children:"Results will appear here"})}),e[9]=u,e[10]=o,e[11]=n,e[12]=s,e[13]=y):y=e[13];let v;e[14]!==m||e[15]!==y?(v=p.jsxs("div",{className:f,children:[m,y]}),e[14]=m,e[15]=y,e[16]=v):v=e[16];let w;return e[17]!==d||e[18]!==v?(w=p.jsx("div",{className:d,children:v}),e[17]=d,e[18]=v,e[19]=w):w=e[19],w}function XK(t){return p.jsx("th",{className:"text-left px-3 py-2 font-medium text-muted-foreground whitespace-nowrap",children:t},t)}const Rh="";async function QK(){const e=await(await fetch(`${Rh}/api/queries`)).json();if(!e.success)throw new Error(e.error||"Failed to load queries");return e.data??[]}async function ZK(t,e,n){const s=await(await fetch(`${Rh}/api/queries`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:t,name:e,sql:n})})).json();if(!s.success)throw new Error(s.error||"Failed to save query");return s.data}async function JK(t){const n=await(await fetch(`${Rh}/api/queries/${t}`,{method:"DELETE"})).json();if(!n.success)throw new Error(n.error||"Failed to delete query")}async function eX(t,e){const o=await(await fetch(`${Rh}/api/queries`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:t,name:e})})).json();if(!o.success)throw new Error(o.error||"Failed to update query name");return o.data}function tX(){const[t,e]=x.useState([]),[n,o]=x.useState(!0),s=x.useCallback(async()=>{o(!0);try{const i=await QK();e(i)}catch{e([])}finally{o(!1)}},[]);return x.useEffect(()=>{s()},[s]),{queries:t,loadQueries:s,queriesLoading:n}}const nX={pinnedQueryIds:[],activeQueryId:null};function oX(t){return Ch(t,nX)}function G2(t){const e=t.trim().split(/\n/)[0]?.trim()??"";if(!e)return"Untitled query";const n=e.replace(/^--\s*/,"").trim();return n.length>50?n.slice(0,47)+"...":n||"Untitled query"}function rs(t){return[...t.filter(e=>e.isPinned),...t.filter(e=>!e.isPinned)]}const Fo="new",S3="Unnamed Query",rX="fb-query-view";function sX({queries:t,queriesLoading:e,viewState:n,setViewState:o,loadQueries:s,clearResult:i}){const[l,u]=x.useState([]),[d,f]=x.useState(null),[g,m]=x.useState(""),[y,v]=x.useState(null),w=x.useRef(!1);x.useEffect(()=>{if(e||w.current)return;w.current=!0;const q=n.pinnedQueryIds??[],z=[];for(const P of q){const F=t.find(Q=>Q.id===P);F&&z.push({id:F.id,name:F.name,sql:F.sql,isPinned:!0})}u(z);const V=n.activeQueryId??null,A=V&&z.some(P=>P.id===V)?V:z[0]?.id??null;f(A);const H=z.find(P=>P.id===A);m(H?.sql??"")},[t,e,n.pinnedQueryIds,n.activeQueryId]),x.useEffect(()=>{if(!w.current)return;const q=l.filter(V=>V.isPinned&&V.id!==Fo).map(V=>V.id),z=d===Fo?null:d;o(V=>({...V,pinnedQueryIds:q,activeQueryId:z}))},[l,d,o]);const C=x.useCallback(q=>{if(m(q),d){const z=typeof q=="function"?q(g):q;u(V=>V.map(A=>A.id===d?{...A,sql:z}:A))}},[d,g]),S=x.useCallback(q=>{u(z=>{const V=z.findIndex(P=>P.id===q.id);if(V!==-1)return f(q.id),m(z[V].sql),z;const A=z.findIndex(P=>!P.isPinned),H={id:q.id,name:q.name,sql:q.sql,isPinned:!1};if(f(q.id),m(q.sql),A!==-1){const P=z.map((F,Q)=>Q===A?H:F);return rs(P)}return rs([...z,H])}),i()},[i]),N=x.useCallback(q=>{u(z=>{const V=z.findIndex(P=>P.id===q.id);if(V!==-1){const P=z.map(F=>F.id===q.id?{...F,isPinned:!0}:F);return f(q.id),m(z[V].sql),rs(P)}const A=z.findIndex(P=>!P.isPinned),H={id:q.id,name:q.name,sql:q.sql,isPinned:!0};if(f(q.id),m(q.sql),A!==-1){const P=z.map((F,Q)=>Q===A?H:F);return rs(P)}return rs([H,...z])}),i()},[i]),M=x.useCallback(q=>{u(z=>rs(z.map(V=>V.id===q?{...V,isPinned:!0}:V)))},[]),E=x.useCallback(()=>{const q=l.find(V=>V.id===Fo);if(q){f(Fo),m(q.sql),i();return}const z={id:Fo,name:S3,sql:"",isPinned:!1};u(V=>rs([...V,z])),f(Fo),m(""),i()},[l,i]),R=x.useCallback(q=>{const z=l.find(V=>V.id===q);u(V=>V.map(A=>A.id===d?{...A,sql:g}:A)),f(q),m(z?.sql??"")},[d,g,l]),D=x.useCallback(q=>{u(z=>{const V=z.filter(A=>A.id!==q);if(d===q){const A=z.findIndex(P=>P.id===q),H=V[A]??V[A-1];f(H?.id??null),m(H?.sql??"")}return V})},[d]),T=x.useCallback(async q=>{try{await JK(q),await s(),u(z=>{const V=z.filter(A=>A.id!==q);if(d===q){const A=z.findIndex(P=>P.id===q),H=V[A]??V[A-1];f(H?.id??null),m(H?.sql??"")}return V})}catch{}},[d,s]),k=x.useCallback(q=>{v(q)},[]),O=x.useCallback(async(q,z)=>{const V=z.trim();if(V){if(q===Fo){u(A=>A.map(H=>H.id===q?{...H,name:V}:H)),v(null);return}try{await eX(q,V),await s(),u(A=>A.map(H=>H.id===q?{...H,name:V}:H))}finally{v(null)}}},[s]),L=x.useCallback(()=>{v(null)},[]),W=l.find(q=>q.id===d),B=l.find(q=>q.id===Fo)??null,Y=d===Fo&&B?{id:B.id,name:B.name,sql:B.sql}:d?t.find(q=>q.id===d)??null:null;return{openTabs:l,setOpenTabs:u,activeTabId:d,setActiveTabId:f,sql:g,setSqlAndUpdateTab:C,editingQueryId:y,activeTab:W,unsavedQuery:B,selectedQueryForSidebar:Y,handleSelectQuery:S,handlePinQuery:N,handlePinTab:M,handleNewQuery:E,handleSelectTab:R,handleCloseTab:D,handleDeleteQuery:T,handleStartRename:k,handleRename:O,handleCancelRename:L}}async function aX(t){const{connectionString:e,sql:n,activeTabId:o,openTabs:s}=t,i=n.trim();if(!i)return{success:!1,error:"No SQL to run."};const u=await(await fetch("/api/sql",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({connectionString:e,sql:i})})).json();if(u.success){const f=u.data,g=s.find(y=>y.id===o)?.name??G2(i),m=await ZK(o===Fo?null:o,g===S3?G2(i):g,i);return{success:!0,result:f,saved:m}}const d=[u.error];return u.code&&d.push(`Code: ${u.code}`),u.detail&&d.push(`Detail: ${u.detail}`),{success:!1,error:d.join(`
73
- `)}}function iX(t,e){return t.some(s=>s.id===Fo)?rs(t.map(s=>s.id===Fo?{id:e.id,name:e.name,sql:e.sql,isPinned:s.isPinned}:s)):t.some(s=>s.id===e.id)?t.map(s=>s.id===e.id?{...s,id:e.id,name:e.name,sql:e.sql}:s):rs([...t,{id:e.id,name:e.name,sql:e.sql,isPinned:!1}])}function lX(){const{selectedConnection:t}=kr(),[e,n]=x.useState(!1),[o,s]=x.useState(null),[i,l]=x.useState(null),u=x.useCallback(()=>{s(null),l(null)},[]);return{run:x.useCallback(async(f,g)=>{if(!t?.connectionString){l("No database connection selected."),s(null);return}n(!0),l(null),s(null);try{const m=await aX({connectionString:t.connectionString,sql:f,activeTabId:g.activeTabId,openTabs:g.openTabs});m.success?(s(m.result),l(null),await g.loadQueries(),g.setOpenTabs(y=>iX(y,m.saved)),g.setActiveTabId(m.saved.id)):(l(m.error),s(null))}catch(m){l(m instanceof Error?m.message:"Request failed"),s(null)}finally{n(!1)}},[t]),isRunning:e,result:o,error:i,clearResult:u}}const cX=()=>{const t=ge.c(52),{selectedConnection:e}=kr(),{queries:n,loadQueries:o,queriesLoading:s}=tX(),[i,l]=oX(rX),{run:u,isRunning:d,result:f,error:g,clearResult:m}=lX();let y;t[0]!==m||t[1]!==o||t[2]!==n||t[3]!==s||t[4]!==l||t[5]!==i?(y={queries:n,queriesLoading:s,viewState:i,setViewState:l,loadQueries:o,clearResult:m},t[0]=m,t[1]=o,t[2]=n,t[3]=s,t[4]=l,t[5]=i,t[6]=y):y=t[6];const v=sX(y);let w;t[7]!==o||t[8]!==u||t[9]!==v.activeTabId||t[10]!==v.openTabs||t[11]!==v.setActiveTabId||t[12]!==v.setOpenTabs||t[13]!==v.sql?(w=()=>{u(v.sql,{activeTabId:v.activeTabId,openTabs:v.openTabs,setOpenTabs:v.setOpenTabs,setActiveTabId:v.setActiveTabId,loadQueries:o})},t[7]=o,t[8]=u,t[9]=v.activeTabId,t[10]=v.openTabs,t[11]=v.setActiveTabId,t[12]=v.setOpenTabs,t[13]=v.sql,t[14]=w):w=t[14];const C=w;let S;t[15]!==C?(S=k=>{(k.metaKey||k.ctrlKey)&&k.key==="Enter"&&(k.preventDefault(),C())},t[15]=C,t[16]=S):S=t[16];const N=S;let M;t[17]!==n||t[18]!==v.editingQueryId||t[19]!==v.handleCancelRename||t[20]!==v.handleDeleteQuery||t[21]!==v.handleNewQuery||t[22]!==v.handlePinQuery||t[23]!==v.handleRename||t[24]!==v.handleSelectQuery||t[25]!==v.handleStartRename||t[26]!==v.selectedQueryForSidebar||t[27]!==v.unsavedQuery?(M=p.jsx("div",{className:"w-64 shrink-0",children:p.jsx(UK,{queries:n,selectedQuery:v.selectedQueryForSidebar,unsavedQuery:v.unsavedQuery,onSelectQuery:v.handleSelectQuery,onPinQuery:v.handlePinQuery,onDeleteQuery:v.handleDeleteQuery,onNewQuery:v.handleNewQuery,editingQueryId:v.editingQueryId,onStartRename:v.handleStartRename,onRename:v.handleRename,onCancelRename:v.handleCancelRename})}),t[17]=n,t[18]=v.editingQueryId,t[19]=v.handleCancelRename,t[20]=v.handleDeleteQuery,t[21]=v.handleNewQuery,t[22]=v.handlePinQuery,t[23]=v.handleRename,t[24]=v.handleSelectQuery,t[25]=v.handleStartRename,t[26]=v.selectedQueryForSidebar,t[27]=v.unsavedQuery,t[28]=M):M=t[28];let E;t[29]!==v.activeTabId||t[30]!==v.handleCloseTab||t[31]!==v.handleNewQuery||t[32]!==v.handlePinTab||t[33]!==v.handleSelectTab||t[34]!==v.openTabs?(E=p.jsx(qK,{openTabs:v.openTabs,activeTabId:v.activeTabId,onSelectTab:v.handleSelectTab,onCloseTab:v.handleCloseTab,onPinTab:v.handlePinTab,onNewTab:v.handleNewQuery}),t[29]=v.activeTabId,t[30]=v.handleCloseTab,t[31]=v.handleNewQuery,t[32]=v.handlePinTab,t[33]=v.handleSelectTab,t[34]=v.openTabs,t[35]=E):E=t[35];let R;t[36]!==g||t[37]!==C||t[38]!==d||t[39]!==N||t[40]!==n||t[41]!==s||t[42]!==f||t[43]!==e?.connectionString||t[44]!==v?(R=p.jsx("div",{className:"flex-1 min-h-0 flex flex-col gap-4 p-4 overflow-hidden",children:s&&n.length===0?p.jsx(wl,{}):p.jsxs(p.Fragment,{children:[p.jsx(WK,{activeTab:v.activeTab?{name:v.activeTab.name}:null,sql:v.sql,onSqlChange:k=>v.setSqlAndUpdateTab(k),onKeyDown:N,onRun:C,isRunning:d,runDisabled:!v.sql.trim()||d||!e?.connectionString}),p.jsx(KK,{isRunning:d,error:g,result:f})]})}),t[36]=g,t[37]=C,t[38]=d,t[39]=N,t[40]=n,t[41]=s,t[42]=f,t[43]=e?.connectionString,t[44]=v,t[45]=R):R=t[45];let D;t[46]!==E||t[47]!==R?(D=p.jsxs("div",{className:"flex-1 min-w-0 flex flex-col min-h-0 bg-background",children:[E,R]}),t[46]=E,t[47]=R,t[48]=D):D=t[48];let T;return t[49]!==M||t[50]!==D?(T=p.jsxs("div",{className:"h-full flex",children:[M,D]}),t[49]=M,t[50]=D,t[51]=T):T=t[51],T};function uX(){const t=ge.c(5);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=p.jsx($i,{path:"/",element:p.jsx(jT,{to:"/schema",replace:!0})}),t[0]=e):e=t[0];let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=p.jsx($i,{path:"/schema",element:p.jsx(wV,{})}),t[1]=n):n=t[1];let o;t[2]===Symbol.for("react.memo_cache_sentinel")?(o=p.jsx($i,{path:"/tables",element:p.jsx(wK,{})}),t[2]=o):o=t[2];let s;t[3]===Symbol.for("react.memo_cache_sentinel")?(s=p.jsx($i,{path:"/indexes",element:p.jsx(VK,{})}),t[3]=s):s=t[3];let i;return t[4]===Symbol.for("react.memo_cache_sentinel")?(i=p.jsx(G7,{children:p.jsxs(OT,{children:[e,n,o,s,p.jsx($i,{path:"/queries",element:p.jsx(cX,{})})]})}),t[4]=i):i=t[4],i}I4.createRoot(document.getElementById("root")).render(p.jsx(x.StrictMode,{children:p.jsx(rk,{children:p.jsx(uX,{})})}));