better-auth-studio 1.0.46-beta.5 → 1.0.46-beta.7

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,693 +0,0 @@
1
- function aE(e,t){for(var n=0;n<t.length;n++){const s=t[n];if(typeof s!="string"&&!Array.isArray(s)){for(const r in s)if(r!=="default"&&!(r in e)){const i=Object.getOwnPropertyDescriptor(s,r);i&&Object.defineProperty(e,r,i.get?i:{enumerable:!0,get:()=>s[r]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))s(r);new MutationObserver(r=>{for(const i of r)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&s(o)}).observe(document,{childList:!0,subtree:!0});function n(r){const i={};return r.integrity&&(i.integrity=r.integrity),r.referrerPolicy&&(i.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?i.credentials="include":r.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function s(r){if(r.ep)return;r.ep=!0;const i=n(r);fetch(r.href,i)}})();function Eh(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Tw={exports:{}},kh={};/**
2
- * @license React
3
- * react-jsx-runtime.production.js
4
- *
5
- * Copyright (c) Meta Platforms, Inc. and affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */var rE=Symbol.for("react.transitional.element"),iE=Symbol.for("react.fragment");function Dw(e,t,n){var s=null;if(n!==void 0&&(s=""+n),t.key!==void 0&&(s=""+t.key),"key"in t){n={};for(var r in t)r!=="key"&&(n[r]=t[r])}else n=t;return t=n.ref,{$$typeof:rE,type:e,key:s,ref:t!==void 0?t:null,props:n}}kh.Fragment=iE;kh.jsx=Dw;kh.jsxs=Dw;Tw.exports=kh;var a=Tw.exports,_w={exports:{}},Ve={};/**
10
- * @license React
11
- * react.production.js
12
- *
13
- * Copyright (c) Meta Platforms, Inc. and affiliates.
14
- *
15
- * This source code is licensed under the MIT license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- */var zg=Symbol.for("react.transitional.element"),oE=Symbol.for("react.portal"),lE=Symbol.for("react.fragment"),cE=Symbol.for("react.strict_mode"),dE=Symbol.for("react.profiler"),uE=Symbol.for("react.consumer"),hE=Symbol.for("react.context"),fE=Symbol.for("react.forward_ref"),mE=Symbol.for("react.suspense"),xE=Symbol.for("react.memo"),Aw=Symbol.for("react.lazy"),O0=Symbol.iterator;function gE(e){return e===null||typeof e!="object"?null:(e=O0&&e[O0]||e["@@iterator"],typeof e=="function"?e:null)}var Ow={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},zw=Object.assign,Rw={};function Ho(e,t,n){this.props=e,this.context=t,this.refs=Rw,this.updater=n||Ow}Ho.prototype.isReactComponent={};Ho.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=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,e,t,"setState")};Ho.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Uw(){}Uw.prototype=Ho.prototype;function Rg(e,t,n){this.props=e,this.context=t,this.refs=Rw,this.updater=n||Ow}var Ug=Rg.prototype=new Uw;Ug.constructor=Rg;zw(Ug,Ho.prototype);Ug.isPureReactComponent=!0;var z0=Array.isArray,jt={H:null,A:null,T:null,S:null,V:null},$w=Object.prototype.hasOwnProperty;function $g(e,t,n,s,r,i){return n=i.ref,{$$typeof:zg,type:e,key:t,ref:n!==void 0?n:null,props:i}}function pE(e,t){return $g(e.type,t,void 0,void 0,void 0,e.props)}function Pg(e){return typeof e=="object"&&e!==null&&e.$$typeof===zg}function vE(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var R0=/\/+/g;function Rf(e,t){return typeof e=="object"&&e!==null&&e.key!=null?vE(""+e.key):t.toString(36)}function U0(){}function bE(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(U0,U0):(e.status="pending",e.then(function(t){e.status==="pending"&&(e.status="fulfilled",e.value=t)},function(t){e.status==="pending"&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}function zi(e,t,n,s,r){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(i){case"bigint":case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case zg:case oE:o=!0;break;case Aw:return o=e._init,zi(o(e._payload),t,n,s,r)}}if(o)return r=r(e),o=s===""?"."+Rf(e,0):s,z0(r)?(n="",o!=null&&(n=o.replace(R0,"$&/")+"/"),zi(r,t,n,"",function(u){return u})):r!=null&&(Pg(r)&&(r=pE(r,n+(r.key==null||e&&e.key===r.key?"":(""+r.key).replace(R0,"$&/")+"/")+o)),t.push(r)),1;o=0;var l=s===""?".":s+":";if(z0(e))for(var c=0;c<e.length;c++)s=e[c],i=l+Rf(s,c),o+=zi(s,t,n,i,r);else if(c=gE(e),typeof c=="function")for(e=c.call(e),c=0;!(s=e.next()).done;)s=s.value,i=l+Rf(s,c++),o+=zi(s,t,n,i,r);else if(i==="object"){if(typeof e.then=="function")return zi(bE(e),t,n,s,r);throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.")}return o}function xd(e,t,n){if(e==null)return e;var s=[],r=0;return zi(e,s,"","",function(i){return t.call(n,i,r++)}),s}function yE(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var $0=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)};function wE(){}Ve.Children={map:xd,forEach:function(e,t,n){xd(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return xd(e,function(){t++}),t},toArray:function(e){return xd(e,function(t){return t})||[]},only:function(e){if(!Pg(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Ve.Component=Ho;Ve.Fragment=lE;Ve.Profiler=dE;Ve.PureComponent=Rg;Ve.StrictMode=cE;Ve.Suspense=mE;Ve.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=jt;Ve.__COMPILER_RUNTIME={__proto__:null,c:function(e){return jt.H.useMemoCache(e)}};Ve.cache=function(e){return function(){return e.apply(null,arguments)}};Ve.cloneElement=function(e,t,n){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var s=zw({},e.props),r=e.key,i=void 0;if(t!=null)for(o in t.ref!==void 0&&(i=void 0),t.key!==void 0&&(r=""+t.key),t)!$w.call(t,o)||o==="key"||o==="__self"||o==="__source"||o==="ref"&&t.ref===void 0||(s[o]=t[o]);var o=arguments.length-2;if(o===1)s.children=n;else if(1<o){for(var l=Array(o),c=0;c<o;c++)l[c]=arguments[c+2];s.children=l}return $g(e.type,r,void 0,void 0,i,s)};Ve.createContext=function(e){return e={$$typeof:hE,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:uE,_context:e},e};Ve.createElement=function(e,t,n){var s,r={},i=null;if(t!=null)for(s in t.key!==void 0&&(i=""+t.key),t)$w.call(t,s)&&s!=="key"&&s!=="__self"&&s!=="__source"&&(r[s]=t[s]);var o=arguments.length-2;if(o===1)r.children=n;else if(1<o){for(var l=Array(o),c=0;c<o;c++)l[c]=arguments[c+2];r.children=l}if(e&&e.defaultProps)for(s in o=e.defaultProps,o)r[s]===void 0&&(r[s]=o[s]);return $g(e,i,void 0,void 0,null,r)};Ve.createRef=function(){return{current:null}};Ve.forwardRef=function(e){return{$$typeof:fE,render:e}};Ve.isValidElement=Pg;Ve.lazy=function(e){return{$$typeof:Aw,_payload:{_status:-1,_result:e},_init:yE}};Ve.memo=function(e,t){return{$$typeof:xE,type:e,compare:t===void 0?null:t}};Ve.startTransition=function(e){var t=jt.T,n={};jt.T=n;try{var s=e(),r=jt.S;r!==null&&r(n,s),typeof s=="object"&&s!==null&&typeof s.then=="function"&&s.then(wE,$0)}catch(i){$0(i)}finally{jt.T=t}};Ve.unstable_useCacheRefresh=function(){return jt.H.useCacheRefresh()};Ve.use=function(e){return jt.H.use(e)};Ve.useActionState=function(e,t,n){return jt.H.useActionState(e,t,n)};Ve.useCallback=function(e,t){return jt.H.useCallback(e,t)};Ve.useContext=function(e){return jt.H.useContext(e)};Ve.useDebugValue=function(){};Ve.useDeferredValue=function(e,t){return jt.H.useDeferredValue(e,t)};Ve.useEffect=function(e,t,n){var s=jt.H;if(typeof n=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return s.useEffect(e,t)};Ve.useId=function(){return jt.H.useId()};Ve.useImperativeHandle=function(e,t,n){return jt.H.useImperativeHandle(e,t,n)};Ve.useInsertionEffect=function(e,t){return jt.H.useInsertionEffect(e,t)};Ve.useLayoutEffect=function(e,t){return jt.H.useLayoutEffect(e,t)};Ve.useMemo=function(e,t){return jt.H.useMemo(e,t)};Ve.useOptimistic=function(e,t){return jt.H.useOptimistic(e,t)};Ve.useReducer=function(e,t,n){return jt.H.useReducer(e,t,n)};Ve.useRef=function(e){return jt.H.useRef(e)};Ve.useState=function(e){return jt.H.useState(e)};Ve.useSyncExternalStore=function(e,t,n){return jt.H.useSyncExternalStore(e,t,n)};Ve.useTransition=function(){return jt.H.useTransition()};Ve.version="19.1.0";_w.exports=Ve;var m=_w.exports;const K=Eh(m),Mh=aE({__proto__:null,default:K},[m]);var Pw={exports:{}},Th={},Lw={exports:{}},Hw={};/**
18
- * @license React
19
- * scheduler.production.js
20
- *
21
- * Copyright (c) Meta Platforms, Inc. and affiliates.
22
- *
23
- * This source code is licensed under the MIT license found in the
24
- * LICENSE file in the root directory of this source tree.
25
- */(function(e){function t(M,_){var E=M.length;M.push(_);e:for(;0<E;){var D=E-1>>>1,A=M[D];if(0<r(A,_))M[D]=_,M[E]=A,E=D;else break e}}function n(M){return M.length===0?null:M[0]}function s(M){if(M.length===0)return null;var _=M[0],E=M.pop();if(E!==_){M[0]=E;e:for(var D=0,A=M.length,q=A>>>1;D<q;){var R=2*(D+1)-1,L=M[R],X=R+1,G=M[X];if(0>r(L,E))X<A&&0>r(G,L)?(M[D]=G,M[X]=E,D=X):(M[D]=L,M[R]=E,D=R);else if(X<A&&0>r(G,E))M[D]=G,M[X]=E,D=X;else break e}}return _}function r(M,_){var E=M.sortIndex-_.sortIndex;return E!==0?E:M.id-_.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}var c=[],u=[],h=1,d=null,f=3,x=!1,b=!1,v=!1,j=!1,g=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,p=typeof setImmediate<"u"?setImmediate:null;function w(M){for(var _=n(u);_!==null;){if(_.callback===null)s(u);else if(_.startTime<=M)s(u),_.sortIndex=_.expirationTime,t(c,_);else break;_=n(u)}}function N(M){if(v=!1,w(M),!b)if(n(c)!==null)b=!0,S||(S=!0,z());else{var _=n(u);_!==null&&$(N,_.startTime-M)}}var S=!1,C=-1,T=5,U=-1;function B(){return j?!0:!(e.unstable_now()-U<T)}function P(){if(j=!1,S){var M=e.unstable_now();U=M;var _=!0;try{e:{b=!1,v&&(v=!1,y(C),C=-1),x=!0;var E=f;try{t:{for(w(M),d=n(c);d!==null&&!(d.expirationTime>M&&B());){var D=d.callback;if(typeof D=="function"){d.callback=null,f=d.priorityLevel;var A=D(d.expirationTime<=M);if(M=e.unstable_now(),typeof A=="function"){d.callback=A,w(M),_=!0;break t}d===n(c)&&s(c),w(M)}else s(c);d=n(c)}if(d!==null)_=!0;else{var q=n(u);q!==null&&$(N,q.startTime-M),_=!1}}break e}finally{d=null,f=E,x=!1}_=void 0}}finally{_?z():S=!1}}}var z;if(typeof p=="function")z=function(){p(P)};else if(typeof MessageChannel<"u"){var Y=new MessageChannel,k=Y.port2;Y.port1.onmessage=P,z=function(){k.postMessage(null)}}else z=function(){g(P,0)};function $(M,_){C=g(function(){M(e.unstable_now())},_)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(M){M.callback=null},e.unstable_forceFrameRate=function(M){0>M||125<M?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):T=0<M?Math.floor(1e3/M):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(M){switch(f){case 1:case 2:case 3:var _=3;break;default:_=f}var E=f;f=_;try{return M()}finally{f=E}},e.unstable_requestPaint=function(){j=!0},e.unstable_runWithPriority=function(M,_){switch(M){case 1:case 2:case 3:case 4:case 5:break;default:M=3}var E=f;f=M;try{return _()}finally{f=E}},e.unstable_scheduleCallback=function(M,_,E){var D=e.unstable_now();switch(typeof E=="object"&&E!==null?(E=E.delay,E=typeof E=="number"&&0<E?D+E:D):E=D,M){case 1:var A=-1;break;case 2:A=250;break;case 5:A=1073741823;break;case 4:A=1e4;break;default:A=5e3}return A=E+A,M={id:h++,callback:_,priorityLevel:M,startTime:E,expirationTime:A,sortIndex:-1},E>D?(M.sortIndex=E,t(u,M),n(c)===null&&M===n(u)&&(v?(y(C),C=-1):v=!0,$(N,E-D))):(M.sortIndex=A,t(c,M),b||x||(b=!0,S||(S=!0,z()))),M},e.unstable_shouldYield=B,e.unstable_wrapCallback=function(M){var _=f;return function(){var E=f;f=_;try{return M.apply(this,arguments)}finally{f=E}}}})(Hw);Lw.exports=Hw;var jE=Lw.exports,Bw={exports:{}},fn={};/**
26
- * @license React
27
- * react-dom.production.js
28
- *
29
- * Copyright (c) Meta Platforms, Inc. and affiliates.
30
- *
31
- * This source code is licensed under the MIT license found in the
32
- * LICENSE file in the root directory of this source tree.
33
- */var NE=m;function Vw(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function za(){}var hn={d:{f:za,r:function(){throw Error(Vw(522))},D:za,C:za,L:za,m:za,X:za,S:za,M:za},p:0,findDOMNode:null},SE=Symbol.for("react.portal");function CE(e,t,n){var s=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:SE,key:s==null?null:""+s,children:e,containerInfo:t,implementation:n}}var Rl=NE.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function Dh(e,t){if(e==="font")return"";if(typeof t=="string")return t==="use-credentials"?t:""}fn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=hn;fn.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(Vw(299));return CE(e,t,null,n)};fn.flushSync=function(e){var t=Rl.T,n=hn.p;try{if(Rl.T=null,hn.p=2,e)return e()}finally{Rl.T=t,hn.p=n,hn.d.f()}};fn.preconnect=function(e,t){typeof e=="string"&&(t?(t=t.crossOrigin,t=typeof t=="string"?t==="use-credentials"?t:"":void 0):t=null,hn.d.C(e,t))};fn.prefetchDNS=function(e){typeof e=="string"&&hn.d.D(e)};fn.preinit=function(e,t){if(typeof e=="string"&&t&&typeof t.as=="string"){var n=t.as,s=Dh(n,t.crossOrigin),r=typeof t.integrity=="string"?t.integrity:void 0,i=typeof t.fetchPriority=="string"?t.fetchPriority:void 0;n==="style"?hn.d.S(e,typeof t.precedence=="string"?t.precedence:void 0,{crossOrigin:s,integrity:r,fetchPriority:i}):n==="script"&&hn.d.X(e,{crossOrigin:s,integrity:r,fetchPriority:i,nonce:typeof t.nonce=="string"?t.nonce:void 0})}};fn.preinitModule=function(e,t){if(typeof e=="string")if(typeof t=="object"&&t!==null){if(t.as==null||t.as==="script"){var n=Dh(t.as,t.crossOrigin);hn.d.M(e,{crossOrigin:n,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0})}}else t==null&&hn.d.M(e)};fn.preload=function(e,t){if(typeof e=="string"&&typeof t=="object"&&t!==null&&typeof t.as=="string"){var n=t.as,s=Dh(n,t.crossOrigin);hn.d.L(e,n,{crossOrigin:s,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0,type:typeof t.type=="string"?t.type:void 0,fetchPriority:typeof t.fetchPriority=="string"?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy=="string"?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet=="string"?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes=="string"?t.imageSizes:void 0,media:typeof t.media=="string"?t.media:void 0})}};fn.preloadModule=function(e,t){if(typeof e=="string")if(t){var n=Dh(t.as,t.crossOrigin);hn.d.m(e,{as:typeof t.as=="string"&&t.as!=="script"?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity=="string"?t.integrity:void 0})}else hn.d.m(e)};fn.requestFormReset=function(e){hn.d.r(e)};fn.unstable_batchedUpdates=function(e,t){return e(t)};fn.useFormState=function(e,t,n){return Rl.H.useFormState(e,t,n)};fn.useFormStatus=function(){return Rl.H.useHostTransitionStatus()};fn.version="19.1.0";function Yw(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Yw)}catch(e){console.error(e)}}Yw(),Bw.exports=fn;var _h=Bw.exports;const Fw=Eh(_h);/**
34
- * @license React
35
- * react-dom-client.production.js
36
- *
37
- * Copyright (c) Meta Platforms, Inc. and affiliates.
38
- *
39
- * This source code is licensed under the MIT license found in the
40
- * LICENSE file in the root directory of this source tree.
41
- */var Wt=jE,Iw=m,EE=_h;function oe(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function Ww(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Dc(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function qw(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function P0(e){if(Dc(e)!==e)throw Error(oe(188))}function kE(e){var t=e.alternate;if(!t){if(t=Dc(e),t===null)throw Error(oe(188));return t!==e?null:e}for(var n=e,s=t;;){var r=n.return;if(r===null)break;var i=r.alternate;if(i===null){if(s=r.return,s!==null){n=s;continue}break}if(r.child===i.child){for(i=r.child;i;){if(i===n)return P0(r),e;if(i===s)return P0(r),t;i=i.sibling}throw Error(oe(188))}if(n.return!==s.return)n=r,s=i;else{for(var o=!1,l=r.child;l;){if(l===n){o=!0,n=r,s=i;break}if(l===s){o=!0,s=r,n=i;break}l=l.sibling}if(!o){for(l=i.child;l;){if(l===n){o=!0,n=i,s=r;break}if(l===s){o=!0,s=i,n=r;break}l=l.sibling}if(!o)throw Error(oe(189))}}if(n.alternate!==s)throw Error(oe(190))}if(n.tag!==3)throw Error(oe(188));return n.stateNode.current===n?e:t}function Xw(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=Xw(e),t!==null)return t;e=e.sibling}return null}var pt=Object.assign,ME=Symbol.for("react.element"),gd=Symbol.for("react.transitional.element"),Ml=Symbol.for("react.portal"),Hi=Symbol.for("react.fragment"),Gw=Symbol.for("react.strict_mode"),tx=Symbol.for("react.profiler"),TE=Symbol.for("react.provider"),Zw=Symbol.for("react.consumer"),la=Symbol.for("react.context"),Lg=Symbol.for("react.forward_ref"),nx=Symbol.for("react.suspense"),sx=Symbol.for("react.suspense_list"),Hg=Symbol.for("react.memo"),Ia=Symbol.for("react.lazy"),ax=Symbol.for("react.activity"),DE=Symbol.for("react.memo_cache_sentinel"),L0=Symbol.iterator;function ol(e){return e===null||typeof e!="object"?null:(e=L0&&e[L0]||e["@@iterator"],typeof e=="function"?e:null)}var _E=Symbol.for("react.client.reference");function rx(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===_E?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Hi:return"Fragment";case tx:return"Profiler";case Gw:return"StrictMode";case nx:return"Suspense";case sx:return"SuspenseList";case ax:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case Ml:return"Portal";case la:return(e.displayName||"Context")+".Provider";case Zw:return(e._context.displayName||"Context")+".Consumer";case Lg:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Hg:return t=e.displayName||null,t!==null?t:rx(e.type)||"Memo";case Ia:t=e._payload,e=e._init;try{return rx(e(t))}catch{}}return null}var Tl=Array.isArray,Oe=Iw.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,et=EE.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Yr={pending:!1,data:null,method:null,action:null},ix=[],Bi=-1;function Gs(e){return{current:e}}function Qt(e){0>Bi||(e.current=ix[Bi],ix[Bi]=null,Bi--)}function Nt(e,t){Bi++,ix[Bi]=e.current,e.current=t}var Vs=Gs(null),Jl=Gs(null),rr=Gs(null),Nu=Gs(null);function Su(e,t){switch(Nt(rr,t),Nt(Jl,e),Nt(Vs,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Fv(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Fv(t),e=fN(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Qt(Vs),Nt(Vs,e)}function go(){Qt(Vs),Qt(Jl),Qt(rr)}function ox(e){e.memoizedState!==null&&Nt(Nu,e);var t=Vs.current,n=fN(t,e.type);t!==n&&(Nt(Jl,e),Nt(Vs,n))}function Cu(e){Jl.current===e&&(Qt(Vs),Qt(Jl)),Nu.current===e&&(Qt(Nu),cc._currentValue=Yr)}var lx=Object.prototype.hasOwnProperty,Bg=Wt.unstable_scheduleCallback,Uf=Wt.unstable_cancelCallback,AE=Wt.unstable_shouldYield,OE=Wt.unstable_requestPaint,Ys=Wt.unstable_now,zE=Wt.unstable_getCurrentPriorityLevel,Qw=Wt.unstable_ImmediatePriority,Kw=Wt.unstable_UserBlockingPriority,Eu=Wt.unstable_NormalPriority,RE=Wt.unstable_LowPriority,Jw=Wt.unstable_IdlePriority,UE=Wt.log,$E=Wt.unstable_setDisableYieldValue,_c=null,Hn=null;function Ja(e){if(typeof UE=="function"&&$E(e),Hn&&typeof Hn.setStrictMode=="function")try{Hn.setStrictMode(_c,e)}catch{}}var Bn=Math.clz32?Math.clz32:HE,PE=Math.log,LE=Math.LN2;function HE(e){return e>>>=0,e===0?32:31-(PE(e)/LE|0)|0}var pd=256,vd=4194304;function zr(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194048;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Ah(e,t,n){var s=e.pendingLanes;if(s===0)return 0;var r=0,i=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var l=s&134217727;return l!==0?(s=l&~i,s!==0?r=zr(s):(o&=l,o!==0?r=zr(o):n||(n=l&~e,n!==0&&(r=zr(n))))):(l=s&~i,l!==0?r=zr(l):o!==0?r=zr(o):n||(n=s&~e,n!==0&&(r=zr(n)))),r===0?0:t!==0&&t!==r&&!(t&i)&&(i=r&-r,n=t&-t,i>=n||i===32&&(n&4194048)!==0)?t:r}function Ac(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function BE(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+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 t+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 e1(){var e=pd;return pd<<=1,!(pd&4194048)&&(pd=256),e}function t1(){var e=vd;return vd<<=1,!(vd&62914560)&&(vd=4194304),e}function $f(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Oc(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function VE(e,t,n,s,r,i){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var l=e.entanglements,c=e.expirationTimes,u=e.hiddenUpdates;for(n=o&~n;0<n;){var h=31-Bn(n),d=1<<h;l[h]=0,c[h]=-1;var f=u[h];if(f!==null)for(u[h]=null,h=0;h<f.length;h++){var x=f[h];x!==null&&(x.lane&=-536870913)}n&=~d}s!==0&&n1(e,s,0),i!==0&&r===0&&e.tag!==0&&(e.suspendedLanes|=i&~(o&~t))}function n1(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var s=31-Bn(t);e.entangledLanes|=t,e.entanglements[s]=e.entanglements[s]|1073741824|n&4194090}function s1(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var s=31-Bn(n),r=1<<s;r&t|e[s]&t&&(e[s]|=t),n&=~r}}function Vg(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Yg(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function a1(){var e=et.p;return e!==0?e:(e=window.event,e===void 0?32:NN(e.type))}function YE(e,t){var n=et.p;try{return et.p=e,t()}finally{et.p=n}}var Sr=Math.random().toString(36).slice(2),on="__reactFiber$"+Sr,Nn="__reactProps$"+Sr,Bo="__reactContainer$"+Sr,cx="__reactEvents$"+Sr,FE="__reactListeners$"+Sr,IE="__reactHandles$"+Sr,H0="__reactResources$"+Sr,zc="__reactMarker$"+Sr;function Fg(e){delete e[on],delete e[Nn],delete e[cx],delete e[FE],delete e[IE]}function Vi(e){var t=e[on];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Bo]||n[on]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=qv(e);e!==null;){if(n=e[on])return n;e=qv(e)}return t}e=n,n=e.parentNode}return null}function Vo(e){if(e=e[on]||e[Bo]){var t=e.tag;if(t===5||t===6||t===13||t===26||t===27||t===3)return e}return null}function Dl(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(oe(33))}function eo(e){var t=e[H0];return t||(t=e[H0]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Gt(e){e[zc]=!0}var r1=new Set,i1={};function xi(e,t){po(e,t),po(e+"Capture",t)}function po(e,t){for(i1[e]=t,e=0;e<t.length;e++)r1.add(t[e])}var WE=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]*$"),B0={},V0={};function qE(e){return lx.call(V0,e)?!0:lx.call(B0,e)?!1:WE.test(e)?V0[e]=!0:(B0[e]=!0,!1)}function Kd(e,t,n){if(qE(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var s=t.toLowerCase().slice(0,5);if(s!=="data-"&&s!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+n)}}function bd(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+n)}}function ta(e,t,n,s){if(s===null)e.removeAttribute(n);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,""+s)}}var Pf,Y0;function Ri(e){if(Pf===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Pf=t&&t[1]||"",Y0=-1<n.stack.indexOf(`
42
- at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
43
- `+Pf+e+Y0}var Lf=!1;function Hf(e,t){if(!e||Lf)return"";Lf=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var s={DetermineComponentFrameRoot:function(){try{if(t){var d=function(){throw Error()};if(Object.defineProperty(d.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(d,[])}catch(x){var f=x}Reflect.construct(e,[],d)}else{try{d.call()}catch(x){f=x}e.call(d.prototype)}}else{try{throw Error()}catch(x){f=x}(d=e())&&typeof d.catch=="function"&&d.catch(function(){})}}catch(x){if(x&&f&&typeof x.stack=="string")return[x.stack,f.stack]}return[null,null]}};s.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var r=Object.getOwnPropertyDescriptor(s.DetermineComponentFrameRoot,"name");r&&r.configurable&&Object.defineProperty(s.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var i=s.DetermineComponentFrameRoot(),o=i[0],l=i[1];if(o&&l){var c=o.split(`
44
- `),u=l.split(`
45
- `);for(r=s=0;s<c.length&&!c[s].includes("DetermineComponentFrameRoot");)s++;for(;r<u.length&&!u[r].includes("DetermineComponentFrameRoot");)r++;if(s===c.length||r===u.length)for(s=c.length-1,r=u.length-1;1<=s&&0<=r&&c[s]!==u[r];)r--;for(;1<=s&&0<=r;s--,r--)if(c[s]!==u[r]){if(s!==1||r!==1)do if(s--,r--,0>r||c[s]!==u[r]){var h=`
46
- `+c[s].replace(" at new "," at ");return e.displayName&&h.includes("<anonymous>")&&(h=h.replace("<anonymous>",e.displayName)),h}while(1<=s&&0<=r);break}}}finally{Lf=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?Ri(n):""}function XE(e){switch(e.tag){case 26:case 27:case 5:return Ri(e.type);case 16:return Ri("Lazy");case 13:return Ri("Suspense");case 19:return Ri("SuspenseList");case 0:case 15:return Hf(e.type,!1);case 11:return Hf(e.type.render,!1);case 1:return Hf(e.type,!0);case 31:return Ri("Activity");default:return""}}function F0(e){try{var t="";do t+=XE(e),e=e.return;while(e);return t}catch(n){return`
47
- Error generating stack: `+n.message+`
48
- `+n.stack}}function es(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function o1(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function GE(e){var t=o1(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),s=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var r=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return r.call(this)},set:function(o){s=""+o,i.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return s},setValue:function(o){s=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ku(e){e._valueTracker||(e._valueTracker=GE(e))}function l1(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),s="";return e&&(s=o1(e)?e.checked?"true":"false":e.value),e=s,e!==n?(t.setValue(e),!0):!1}function Mu(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var ZE=/[\n"\\]/g;function ss(e){return e.replace(ZE,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function dx(e,t,n,s,r,i,o,l){e.name="",o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"?e.type=o:e.removeAttribute("type"),t!=null?o==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+es(t)):e.value!==""+es(t)&&(e.value=""+es(t)):o!=="submit"&&o!=="reset"||e.removeAttribute("value"),t!=null?ux(e,o,es(t)):n!=null?ux(e,o,es(n)):s!=null&&e.removeAttribute("value"),r==null&&i!=null&&(e.defaultChecked=!!i),r!=null&&(e.checked=r&&typeof r!="function"&&typeof r!="symbol"),l!=null&&typeof l!="function"&&typeof l!="symbol"&&typeof l!="boolean"?e.name=""+es(l):e.removeAttribute("name")}function c1(e,t,n,s,r,i,o,l){if(i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"&&(e.type=i),t!=null||n!=null){if(!(i!=="submit"&&i!=="reset"||t!=null))return;n=n!=null?""+es(n):"",t=t!=null?""+es(t):n,l||t===e.value||(e.value=t),e.defaultValue=t}s=s??r,s=typeof s!="function"&&typeof s!="symbol"&&!!s,e.checked=l?e.checked:!!s,e.defaultChecked=!!s,o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"&&(e.name=o)}function ux(e,t,n){t==="number"&&Mu(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function to(e,t,n,s){if(e=e.options,t){t={};for(var r=0;r<n.length;r++)t["$"+n[r]]=!0;for(n=0;n<e.length;n++)r=t.hasOwnProperty("$"+e[n].value),e[n].selected!==r&&(e[n].selected=r),r&&s&&(e[n].defaultSelected=!0)}else{for(n=""+es(n),t=null,r=0;r<e.length;r++){if(e[r].value===n){e[r].selected=!0,s&&(e[r].defaultSelected=!0);return}t!==null||e[r].disabled||(t=e[r])}t!==null&&(t.selected=!0)}}function d1(e,t,n){if(t!=null&&(t=""+es(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+es(n):""}function u1(e,t,n,s){if(t==null){if(s!=null){if(n!=null)throw Error(oe(92));if(Tl(s)){if(1<s.length)throw Error(oe(93));s=s[0]}n=s}n==null&&(n=""),t=n}n=es(t),e.defaultValue=n,s=e.textContent,s===n&&s!==""&&s!==null&&(e.value=s)}function vo(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var QE=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 I0(e,t,n){var s=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?s?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":s?e.setProperty(t,n):typeof n!="number"||n===0||QE.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function h1(e,t,n){if(t!=null&&typeof t!="object")throw Error(oe(62));if(e=e.style,n!=null){for(var s in n)!n.hasOwnProperty(s)||t!=null&&t.hasOwnProperty(s)||(s.indexOf("--")===0?e.setProperty(s,""):s==="float"?e.cssFloat="":e[s]="");for(var r in t)s=t[r],t.hasOwnProperty(r)&&n[r]!==s&&I0(e,r,s)}else for(var i in t)t.hasOwnProperty(i)&&I0(e,i,t[i])}function Ig(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var KE=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"]]),JE=/^[\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 Jd(e){return JE.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}var hx=null;function Wg(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Yi=null,no=null;function W0(e){var t=Vo(e);if(t&&(e=t.stateNode)){var n=e[Nn]||null;e:switch(e=t.stateNode,t.type){case"input":if(dx(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+ss(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var s=n[t];if(s!==e&&s.form===e.form){var r=s[Nn]||null;if(!r)throw Error(oe(90));dx(s,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name)}}for(t=0;t<n.length;t++)s=n[t],s.form===e.form&&l1(s)}break e;case"textarea":d1(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&to(e,!!n.multiple,t,!1)}}}var Bf=!1;function f1(e,t,n){if(Bf)return e(t,n);Bf=!0;try{var s=e(t);return s}finally{if(Bf=!1,(Yi!==null||no!==null)&&(Vh(),Yi&&(t=Yi,e=no,no=Yi=null,W0(t),e)))for(t=0;t<e.length;t++)W0(e[t])}}function ec(e,t){var n=e.stateNode;if(n===null)return null;var s=n[Nn]||null;if(s===null)return null;n=s[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(s=!s.disabled)||(e=e.type,s=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!s;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(oe(231,t,typeof n));return n}var ya=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),fx=!1;if(ya)try{var ll={};Object.defineProperty(ll,"passive",{get:function(){fx=!0}}),window.addEventListener("test",ll,ll),window.removeEventListener("test",ll,ll)}catch{fx=!1}var er=null,qg=null,eu=null;function m1(){if(eu)return eu;var e,t=qg,n=t.length,s,r="value"in er?er.value:er.textContent,i=r.length;for(e=0;e<n&&t[e]===r[e];e++);var o=n-e;for(s=1;s<=o&&t[n-s]===r[i-s];s++);return eu=r.slice(e,1<s?1-s:void 0)}function tu(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function yd(){return!0}function q0(){return!1}function Sn(e){function t(n,s,r,i,o){this._reactName=n,this._targetInst=r,this.type=s,this.nativeEvent=i,this.target=o,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(n=e[l],this[l]=n?n(i):i[l]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?yd:q0,this.isPropagationStopped=q0,this}return pt(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=yd)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=yd)},persist:function(){},isPersistent:yd}),t}var gi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Oh=Sn(gi),Rc=pt({},gi,{view:0,detail:0}),ek=Sn(Rc),Vf,Yf,cl,zh=pt({},Rc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Xg,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==cl&&(cl&&e.type==="mousemove"?(Vf=e.screenX-cl.screenX,Yf=e.screenY-cl.screenY):Yf=Vf=0,cl=e),Vf)},movementY:function(e){return"movementY"in e?e.movementY:Yf}}),X0=Sn(zh),tk=pt({},zh,{dataTransfer:0}),nk=Sn(tk),sk=pt({},Rc,{relatedTarget:0}),Ff=Sn(sk),ak=pt({},gi,{animationName:0,elapsedTime:0,pseudoElement:0}),rk=Sn(ak),ik=pt({},gi,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),ok=Sn(ik),lk=pt({},gi,{data:0}),G0=Sn(lk),ck={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},dk={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"},uk={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function hk(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=uk[e])?!!t[e]:!1}function Xg(){return hk}var fk=pt({},Rc,{key:function(e){if(e.key){var t=ck[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=tu(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?dk[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Xg,charCode:function(e){return e.type==="keypress"?tu(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?tu(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),mk=Sn(fk),xk=pt({},zh,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Z0=Sn(xk),gk=pt({},Rc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Xg}),pk=Sn(gk),vk=pt({},gi,{propertyName:0,elapsedTime:0,pseudoElement:0}),bk=Sn(vk),yk=pt({},zh,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),wk=Sn(yk),jk=pt({},gi,{newState:0,oldState:0}),Nk=Sn(jk),Sk=[9,13,27,32],Gg=ya&&"CompositionEvent"in window,Ul=null;ya&&"documentMode"in document&&(Ul=document.documentMode);var Ck=ya&&"TextEvent"in window&&!Ul,x1=ya&&(!Gg||Ul&&8<Ul&&11>=Ul),Q0=" ",K0=!1;function g1(e,t){switch(e){case"keyup":return Sk.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function p1(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Fi=!1;function Ek(e,t){switch(e){case"compositionend":return p1(t);case"keypress":return t.which!==32?null:(K0=!0,Q0);case"textInput":return e=t.data,e===Q0&&K0?null:e;default:return null}}function kk(e,t){if(Fi)return e==="compositionend"||!Gg&&g1(e,t)?(e=m1(),eu=qg=er=null,Fi=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return x1&&t.locale!=="ko"?null:t.data;default:return null}}var Mk={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 J0(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Mk[e.type]:t==="textarea"}function v1(e,t,n,s){Yi?no?no.push(s):no=[s]:Yi=s,t=Wu(t,"onChange"),0<t.length&&(n=new Oh("onChange","change",null,n,s),e.push({event:n,listeners:t}))}var $l=null,tc=null;function Tk(e){dN(e,0)}function Rh(e){var t=Dl(e);if(l1(t))return e}function ev(e,t){if(e==="change")return t}var b1=!1;if(ya){var If;if(ya){var Wf="oninput"in document;if(!Wf){var tv=document.createElement("div");tv.setAttribute("oninput","return;"),Wf=typeof tv.oninput=="function"}If=Wf}else If=!1;b1=If&&(!document.documentMode||9<document.documentMode)}function nv(){$l&&($l.detachEvent("onpropertychange",y1),tc=$l=null)}function y1(e){if(e.propertyName==="value"&&Rh(tc)){var t=[];v1(t,tc,e,Wg(e)),f1(Tk,t)}}function Dk(e,t,n){e==="focusin"?(nv(),$l=t,tc=n,$l.attachEvent("onpropertychange",y1)):e==="focusout"&&nv()}function _k(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Rh(tc)}function Ak(e,t){if(e==="click")return Rh(t)}function Ok(e,t){if(e==="input"||e==="change")return Rh(t)}function zk(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var In=typeof Object.is=="function"?Object.is:zk;function nc(e,t){if(In(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),s=Object.keys(t);if(n.length!==s.length)return!1;for(s=0;s<n.length;s++){var r=n[s];if(!lx.call(t,r)||!In(e[r],t[r]))return!1}return!0}function sv(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function av(e,t){var n=sv(e);e=0;for(var s;n;){if(n.nodeType===3){if(s=e+n.textContent.length,e<=t&&s>=t)return{node:n,offset:t-e};e=s}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=sv(n)}}function w1(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?w1(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function j1(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Mu(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Mu(e.document)}return t}function Zg(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var Rk=ya&&"documentMode"in document&&11>=document.documentMode,Ii=null,mx=null,Pl=null,xx=!1;function rv(e,t,n){var s=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;xx||Ii==null||Ii!==Mu(s)||(s=Ii,"selectionStart"in s&&Zg(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),Pl&&nc(Pl,s)||(Pl=s,s=Wu(mx,"onSelect"),0<s.length&&(t=new Oh("onSelect","select",null,t,n),e.push({event:t,listeners:s}),t.target=Ii)))}function Ar(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Wi={animationend:Ar("Animation","AnimationEnd"),animationiteration:Ar("Animation","AnimationIteration"),animationstart:Ar("Animation","AnimationStart"),transitionrun:Ar("Transition","TransitionRun"),transitionstart:Ar("Transition","TransitionStart"),transitioncancel:Ar("Transition","TransitionCancel"),transitionend:Ar("Transition","TransitionEnd")},qf={},N1={};ya&&(N1=document.createElement("div").style,"AnimationEvent"in window||(delete Wi.animationend.animation,delete Wi.animationiteration.animation,delete Wi.animationstart.animation),"TransitionEvent"in window||delete Wi.transitionend.transition);function pi(e){if(qf[e])return qf[e];if(!Wi[e])return e;var t=Wi[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in N1)return qf[e]=t[n];return e}var S1=pi("animationend"),C1=pi("animationiteration"),E1=pi("animationstart"),Uk=pi("transitionrun"),$k=pi("transitionstart"),Pk=pi("transitioncancel"),k1=pi("transitionend"),M1=new Map,gx="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(" ");gx.push("scrollEnd");function Ss(e,t){M1.set(e,t),xi(t,[e])}var iv=new WeakMap;function as(e,t){if(typeof e=="object"&&e!==null){var n=iv.get(e);return n!==void 0?n:(t={value:e,source:t,stack:F0(t)},iv.set(e,t),t)}return{value:e,source:t,stack:F0(t)}}var Gn=[],qi=0,Qg=0;function Uh(){for(var e=qi,t=Qg=qi=0;t<e;){var n=Gn[t];Gn[t++]=null;var s=Gn[t];Gn[t++]=null;var r=Gn[t];Gn[t++]=null;var i=Gn[t];if(Gn[t++]=null,s!==null&&r!==null){var o=s.pending;o===null?r.next=r:(r.next=o.next,o.next=r),s.pending=r}i!==0&&T1(n,r,i)}}function $h(e,t,n,s){Gn[qi++]=e,Gn[qi++]=t,Gn[qi++]=n,Gn[qi++]=s,Qg|=s,e.lanes|=s,e=e.alternate,e!==null&&(e.lanes|=s)}function Kg(e,t,n,s){return $h(e,t,n,s),Tu(e)}function Yo(e,t){return $h(e,null,null,t),Tu(e)}function T1(e,t,n){e.lanes|=n;var s=e.alternate;s!==null&&(s.lanes|=n);for(var r=!1,i=e.return;i!==null;)i.childLanes|=n,s=i.alternate,s!==null&&(s.childLanes|=n),i.tag===22&&(e=i.stateNode,e===null||e._visibility&1||(r=!0)),e=i,i=i.return;return e.tag===3?(i=e.stateNode,r&&t!==null&&(r=31-Bn(n),e=i.hiddenUpdates,s=e[r],s===null?e[r]=[t]:s.push(t),t.lane=n|536870912),i):null}function Tu(e){if(50<Xl)throw Xl=0,$x=null,Error(oe(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Xi={};function Lk(e,t,n,s){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function $n(e,t,n,s){return new Lk(e,t,n,s)}function Jg(e){return e=e.prototype,!(!e||!e.isReactComponent)}function pa(e,t){var n=e.alternate;return n===null?(n=$n(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function D1(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function nu(e,t,n,s,r,i){var o=0;if(s=e,typeof e=="function")Jg(e)&&(o=1);else if(typeof e=="string")o=B3(e,n,Vs.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case ax:return e=$n(31,n,t,r),e.elementType=ax,e.lanes=i,e;case Hi:return Fr(n.children,r,i,t);case Gw:o=8,r|=24;break;case tx:return e=$n(12,n,t,r|2),e.elementType=tx,e.lanes=i,e;case nx:return e=$n(13,n,t,r),e.elementType=nx,e.lanes=i,e;case sx:return e=$n(19,n,t,r),e.elementType=sx,e.lanes=i,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case TE:case la:o=10;break e;case Zw:o=9;break e;case Lg:o=11;break e;case Hg:o=14;break e;case Ia:o=16,s=null;break e}o=29,n=Error(oe(130,e===null?"null":typeof e,"")),s=null}return t=$n(o,n,t,r),t.elementType=e,t.type=s,t.lanes=i,t}function Fr(e,t,n,s){return e=$n(7,e,s,t),e.lanes=n,e}function Xf(e,t,n){return e=$n(6,e,null,t),e.lanes=n,e}function Gf(e,t,n){return t=$n(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Gi=[],Zi=0,Du=null,_u=0,ts=[],ns=0,Ir=null,ca=1,da="";function Rr(e,t){Gi[Zi++]=_u,Gi[Zi++]=Du,Du=e,_u=t}function _1(e,t,n){ts[ns++]=ca,ts[ns++]=da,ts[ns++]=Ir,Ir=e;var s=ca;e=da;var r=32-Bn(s)-1;s&=~(1<<r),n+=1;var i=32-Bn(t)+r;if(30<i){var o=r-r%5;i=(s&(1<<o)-1).toString(32),s>>=o,r-=o,ca=1<<32-Bn(t)+r|n<<r|s,da=i+e}else ca=1<<i|n<<r|s,da=e}function ep(e){e.return!==null&&(Rr(e,1),_1(e,1,0))}function tp(e){for(;e===Du;)Du=Gi[--Zi],Gi[Zi]=null,_u=Gi[--Zi],Gi[Zi]=null;for(;e===Ir;)Ir=ts[--ns],ts[ns]=null,da=ts[--ns],ts[ns]=null,ca=ts[--ns],ts[ns]=null}var un=null,Dt=null,Je=!1,Wr=null,$s=!1,px=Error(oe(519));function ei(e){var t=Error(oe(418,""));throw sc(as(t,e)),px}function ov(e){var t=e.stateNode,n=e.type,s=e.memoizedProps;switch(t[on]=e,t[Nn]=s,n){case"dialog":Fe("cancel",t),Fe("close",t);break;case"iframe":case"object":case"embed":Fe("load",t);break;case"video":case"audio":for(n=0;n<ic.length;n++)Fe(ic[n],t);break;case"source":Fe("error",t);break;case"img":case"image":case"link":Fe("error",t),Fe("load",t);break;case"details":Fe("toggle",t);break;case"input":Fe("invalid",t),c1(t,s.value,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name,!0),ku(t);break;case"select":Fe("invalid",t);break;case"textarea":Fe("invalid",t),u1(t,s.value,s.defaultValue,s.children),ku(t)}n=s.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||s.suppressHydrationWarning===!0||hN(t.textContent,n)?(s.popover!=null&&(Fe("beforetoggle",t),Fe("toggle",t)),s.onScroll!=null&&Fe("scroll",t),s.onScrollEnd!=null&&Fe("scrollend",t),s.onClick!=null&&(t.onclick=Ih),t=!0):t=!1,t||ei(e)}function lv(e){for(un=e.return;un;)switch(un.tag){case 5:case 13:$s=!1;return;case 27:case 3:$s=!0;return;default:un=un.return}}function dl(e){if(e!==un)return!1;if(!Je)return lv(e),Je=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||Yx(e.type,e.memoizedProps)),n=!n),n&&Dt&&ei(e),lv(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(oe(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8)if(n=e.data,n==="/$"){if(t===0){Dt=bs(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++;e=e.nextSibling}Dt=null}}else t===27?(t=Dt,Cr(e.type)?(e=Wx,Wx=null,Dt=e):Dt=t):Dt=un?bs(e.stateNode.nextSibling):null;return!0}function Uc(){Dt=un=null,Je=!1}function cv(){var e=Wr;return e!==null&&(bn===null?bn=e:bn.push.apply(bn,e),Wr=null),e}function sc(e){Wr===null?Wr=[e]:Wr.push(e)}var vx=Gs(null),vi=null,ua=null;function Xa(e,t,n){Nt(vx,t._currentValue),t._currentValue=n}function va(e){e._currentValue=vx.current,Qt(vx)}function bx(e,t,n){for(;e!==null;){var s=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,s!==null&&(s.childLanes|=t)):s!==null&&(s.childLanes&t)!==t&&(s.childLanes|=t),e===n)break;e=e.return}}function yx(e,t,n,s){var r=e.child;for(r!==null&&(r.return=e);r!==null;){var i=r.dependencies;if(i!==null){var o=r.child;i=i.firstContext;e:for(;i!==null;){var l=i;i=r;for(var c=0;c<t.length;c++)if(l.context===t[c]){i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),bx(i.return,n,e),s||(o=null);break e}i=l.next}}else if(r.tag===18){if(o=r.return,o===null)throw Error(oe(341));o.lanes|=n,i=o.alternate,i!==null&&(i.lanes|=n),bx(o,n,e),o=null}else o=r.child;if(o!==null)o.return=r;else for(o=r;o!==null;){if(o===e){o=null;break}if(r=o.sibling,r!==null){r.return=o.return,o=r;break}o=o.return}r=o}}function $c(e,t,n,s){e=null;for(var r=t,i=!1;r!==null;){if(!i){if(r.flags&524288)i=!0;else if(r.flags&262144)break}if(r.tag===10){var o=r.alternate;if(o===null)throw Error(oe(387));if(o=o.memoizedProps,o!==null){var l=r.type;In(r.pendingProps.value,o.value)||(e!==null?e.push(l):e=[l])}}else if(r===Nu.current){if(o=r.alternate,o===null)throw Error(oe(387));o.memoizedState.memoizedState!==r.memoizedState.memoizedState&&(e!==null?e.push(cc):e=[cc])}r=r.return}e!==null&&yx(t,e,n,s),t.flags|=262144}function Au(e){for(e=e.firstContext;e!==null;){if(!In(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ti(e){vi=e,ua=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function ln(e){return A1(vi,e)}function wd(e,t){return vi===null&&ti(e),A1(e,t)}function A1(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},ua===null){if(e===null)throw Error(oe(308));ua=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ua=ua.next=t;return n}var Hk=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,s){e.push(s)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},Bk=Wt.unstable_scheduleCallback,Vk=Wt.unstable_NormalPriority,Yt={$$typeof:la,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function np(){return{controller:new Hk,data:new Map,refCount:0}}function Pc(e){e.refCount--,e.refCount===0&&Bk(Vk,function(){e.controller.abort()})}var Ll=null,wx=0,bo=0,so=null;function Yk(e,t){if(Ll===null){var n=Ll=[];wx=0,bo=Cp(),so={status:"pending",value:void 0,then:function(s){n.push(s)}}}return wx++,t.then(dv,dv),t}function dv(){if(--wx===0&&Ll!==null){so!==null&&(so.status="fulfilled");var e=Ll;Ll=null,bo=0,so=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Fk(e,t){var n=[],s={status:"pending",value:null,reason:null,then:function(r){n.push(r)}};return e.then(function(){s.status="fulfilled",s.value=t;for(var r=0;r<n.length;r++)(0,n[r])(t)},function(r){for(s.status="rejected",s.reason=r,r=0;r<n.length;r++)(0,n[r])(void 0)}),s}var uv=Oe.S;Oe.S=function(e,t){typeof t=="object"&&t!==null&&typeof t.then=="function"&&Yk(e,t),uv!==null&&uv(e,t)};var qr=Gs(null);function sp(){var e=qr.current;return e!==null?e:ht.pooledCache}function su(e,t){t===null?Nt(qr,qr.current):Nt(qr,t.pool)}function O1(){var e=sp();return e===null?null:{parent:Yt._currentValue,pool:e}}var Lc=Error(oe(460)),z1=Error(oe(474)),Ph=Error(oe(542)),jx={then:function(){}};function hv(e){return e=e.status,e==="fulfilled"||e==="rejected"}function jd(){}function R1(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(jd,jd),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,mv(e),e;default:if(typeof t.status=="string")t.then(jd,jd);else{if(e=ht,e!==null&&100<e.shellSuspendCounter)throw Error(oe(482));e=t,e.status="pending",e.then(function(s){if(t.status==="pending"){var r=t;r.status="fulfilled",r.value=s}},function(s){if(t.status==="pending"){var r=t;r.status="rejected",r.reason=s}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,mv(e),e}throw Hl=t,Lc}}var Hl=null;function fv(){if(Hl===null)throw Error(oe(459));var e=Hl;return Hl=null,e}function mv(e){if(e===Lc||e===Ph)throw Error(oe(483))}var Wa=!1;function ap(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Nx(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function ir(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function or(e,t,n){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,rt&2){var r=s.pending;return r===null?t.next=t:(t.next=r.next,r.next=t),s.pending=t,t=Tu(e),T1(e,null,n),t}return $h(e,s,t,n),Tu(e)}function Bl(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var s=t.lanes;s&=e.pendingLanes,n|=s,t.lanes=n,s1(e,n)}}function Zf(e,t){var n=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,n===s)){var r=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};i===null?r=i=o:i=i.next=o,n=n.next}while(n!==null);i===null?r=i=t:i=i.next=t}else r=i=t;n={baseState:s.baseState,firstBaseUpdate:r,lastBaseUpdate:i,shared:s.shared,callbacks:s.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Sx=!1;function Vl(){if(Sx){var e=so;if(e!==null)throw e}}function Yl(e,t,n,s){Sx=!1;var r=e.updateQueue;Wa=!1;var i=r.firstBaseUpdate,o=r.lastBaseUpdate,l=r.shared.pending;if(l!==null){r.shared.pending=null;var c=l,u=c.next;c.next=null,o===null?i=u:o.next=u,o=c;var h=e.alternate;h!==null&&(h=h.updateQueue,l=h.lastBaseUpdate,l!==o&&(l===null?h.firstBaseUpdate=u:l.next=u,h.lastBaseUpdate=c))}if(i!==null){var d=r.baseState;o=0,h=u=c=null,l=i;do{var f=l.lane&-536870913,x=f!==l.lane;if(x?(Ze&f)===f:(s&f)===f){f!==0&&f===bo&&(Sx=!0),h!==null&&(h=h.next={lane:0,tag:l.tag,payload:l.payload,callback:null,next:null});e:{var b=e,v=l;f=t;var j=n;switch(v.tag){case 1:if(b=v.payload,typeof b=="function"){d=b.call(j,d,f);break e}d=b;break e;case 3:b.flags=b.flags&-65537|128;case 0:if(b=v.payload,f=typeof b=="function"?b.call(j,d,f):b,f==null)break e;d=pt({},d,f);break e;case 2:Wa=!0}}f=l.callback,f!==null&&(e.flags|=64,x&&(e.flags|=8192),x=r.callbacks,x===null?r.callbacks=[f]:x.push(f))}else x={lane:f,tag:l.tag,payload:l.payload,callback:l.callback,next:null},h===null?(u=h=x,c=d):h=h.next=x,o|=f;if(l=l.next,l===null){if(l=r.shared.pending,l===null)break;x=l,l=x.next,x.next=null,r.lastBaseUpdate=x,r.shared.pending=null}}while(!0);h===null&&(c=d),r.baseState=c,r.firstBaseUpdate=u,r.lastBaseUpdate=h,i===null&&(r.shared.lanes=0),vr|=o,e.lanes=o,e.memoizedState=d}}function U1(e,t){if(typeof e!="function")throw Error(oe(191,e));e.call(t)}function $1(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)U1(n[e],t)}var yo=Gs(null),Ou=Gs(0);function xv(e,t){e=Na,Nt(Ou,e),Nt(yo,t),Na=e|t.baseLanes}function Cx(){Nt(Ou,Na),Nt(yo,yo.current)}function rp(){Na=Ou.current,Qt(yo),Qt(Ou)}var gr=0,Ye=null,ot=null,Ut=null,zu=!1,ao=!1,ni=!1,Ru=0,ac=0,ro=null,Ik=0;function Ot(){throw Error(oe(321))}function ip(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!In(e[n],t[n]))return!1;return!0}function op(e,t,n,s,r,i){return gr=i,Ye=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Oe.H=e===null||e.memoizedState===null?mj:xj,ni=!1,i=n(s,r),ni=!1,ao&&(i=L1(t,n,s,r)),P1(e),i}function P1(e){Oe.H=Uu;var t=ot!==null&&ot.next!==null;if(gr=0,Ut=ot=Ye=null,zu=!1,ac=0,ro=null,t)throw Error(oe(300));e===null||Zt||(e=e.dependencies,e!==null&&Au(e)&&(Zt=!0))}function L1(e,t,n,s){Ye=e;var r=0;do{if(ao&&(ro=null),ac=0,ao=!1,25<=r)throw Error(oe(301));if(r+=1,Ut=ot=null,e.updateQueue!=null){var i=e.updateQueue;i.lastEffect=null,i.events=null,i.stores=null,i.memoCache!=null&&(i.memoCache.index=0)}Oe.H=Kk,i=t(n,s)}while(ao);return i}function Wk(){var e=Oe.H,t=e.useState()[0];return t=typeof t.then=="function"?Hc(t):t,e=e.useState()[0],(ot!==null?ot.memoizedState:null)!==e&&(Ye.flags|=1024),t}function lp(){var e=Ru!==0;return Ru=0,e}function cp(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function dp(e){if(zu){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}zu=!1}gr=0,Ut=ot=Ye=null,ao=!1,ac=Ru=0,ro=null}function pn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ut===null?Ye.memoizedState=Ut=e:Ut=Ut.next=e,Ut}function $t(){if(ot===null){var e=Ye.alternate;e=e!==null?e.memoizedState:null}else e=ot.next;var t=Ut===null?Ye.memoizedState:Ut.next;if(t!==null)Ut=t,ot=e;else{if(e===null)throw Ye.alternate===null?Error(oe(467)):Error(oe(310));ot=e,e={memoizedState:ot.memoizedState,baseState:ot.baseState,baseQueue:ot.baseQueue,queue:ot.queue,next:null},Ut===null?Ye.memoizedState=Ut=e:Ut=Ut.next=e}return Ut}function up(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Hc(e){var t=ac;return ac+=1,ro===null&&(ro=[]),e=R1(ro,e,t),t=Ye,(Ut===null?t.memoizedState:Ut.next)===null&&(t=t.alternate,Oe.H=t===null||t.memoizedState===null?mj:xj),e}function Lh(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Hc(e);if(e.$$typeof===la)return ln(e)}throw Error(oe(438,String(e)))}function hp(e){var t=null,n=Ye.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var s=Ye.alternate;s!==null&&(s=s.updateQueue,s!==null&&(s=s.memoCache,s!=null&&(t={data:s.data.map(function(r){return r.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=up(),Ye.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),s=0;s<e;s++)n[s]=DE;return t.index++,n}function wa(e,t){return typeof t=="function"?t(e):t}function au(e){var t=$t();return fp(t,ot,e)}function fp(e,t,n){var s=e.queue;if(s===null)throw Error(oe(311));s.lastRenderedReducer=n;var r=e.baseQueue,i=s.pending;if(i!==null){if(r!==null){var o=r.next;r.next=i.next,i.next=o}t.baseQueue=r=i,s.pending=null}if(i=e.baseState,r===null)e.memoizedState=i;else{t=r.next;var l=o=null,c=null,u=t,h=!1;do{var d=u.lane&-536870913;if(d!==u.lane?(Ze&d)===d:(gr&d)===d){var f=u.revertLane;if(f===0)c!==null&&(c=c.next={lane:0,revertLane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),d===bo&&(h=!0);else if((gr&f)===f){u=u.next,f===bo&&(h=!0);continue}else d={lane:0,revertLane:u.revertLane,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},c===null?(l=c=d,o=i):c=c.next=d,Ye.lanes|=f,vr|=f;d=u.action,ni&&n(i,d),i=u.hasEagerState?u.eagerState:n(i,d)}else f={lane:d,revertLane:u.revertLane,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},c===null?(l=c=f,o=i):c=c.next=f,Ye.lanes|=d,vr|=d;u=u.next}while(u!==null&&u!==t);if(c===null?o=i:c.next=l,!In(i,e.memoizedState)&&(Zt=!0,h&&(n=so,n!==null)))throw n;e.memoizedState=i,e.baseState=o,e.baseQueue=c,s.lastRenderedState=i}return r===null&&(s.lanes=0),[e.memoizedState,s.dispatch]}function Qf(e){var t=$t(),n=t.queue;if(n===null)throw Error(oe(311));n.lastRenderedReducer=e;var s=n.dispatch,r=n.pending,i=t.memoizedState;if(r!==null){n.pending=null;var o=r=r.next;do i=e(i,o.action),o=o.next;while(o!==r);In(i,t.memoizedState)||(Zt=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,s]}function H1(e,t,n){var s=Ye,r=$t(),i=Je;if(i){if(n===void 0)throw Error(oe(407));n=n()}else n=t();var o=!In((ot||r).memoizedState,n);o&&(r.memoizedState=n,Zt=!0),r=r.queue;var l=Y1.bind(null,s,r,e);if(Bc(2048,8,l,[e]),r.getSnapshot!==t||o||Ut!==null&&Ut.memoizedState.tag&1){if(s.flags|=2048,wo(9,Hh(),V1.bind(null,s,r,n,t),null),ht===null)throw Error(oe(349));i||gr&124||B1(s,t,n)}return n}function B1(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Ye.updateQueue,t===null?(t=up(),Ye.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function V1(e,t,n,s){t.value=n,t.getSnapshot=s,F1(t)&&I1(e)}function Y1(e,t,n){return n(function(){F1(t)&&I1(e)})}function F1(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!In(e,n)}catch{return!0}}function I1(e){var t=Yo(e,2);t!==null&&Yn(t,e,2)}function Ex(e){var t=pn();if(typeof e=="function"){var n=e;if(e=n(),ni){Ja(!0);try{n()}finally{Ja(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:wa,lastRenderedState:e},t}function W1(e,t,n,s){return e.baseState=n,fp(e,ot,typeof s=="function"?s:wa)}function qk(e,t,n,s,r){if(Bh(e))throw Error(oe(485));if(e=t.action,e!==null){var i={payload:r,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(o){i.listeners.push(o)}};Oe.T!==null?n(!0):i.isTransition=!1,s(i),n=t.pending,n===null?(i.next=t.pending=i,q1(t,i)):(i.next=n.next,t.pending=n.next=i)}}function q1(e,t){var n=t.action,s=t.payload,r=e.state;if(t.isTransition){var i=Oe.T,o={};Oe.T=o;try{var l=n(r,s),c=Oe.S;c!==null&&c(o,l),gv(e,t,l)}catch(u){kx(e,t,u)}finally{Oe.T=i}}else try{i=n(r,s),gv(e,t,i)}catch(u){kx(e,t,u)}}function gv(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(s){pv(e,t,s)},function(s){return kx(e,t,s)}):pv(e,t,n)}function pv(e,t,n){t.status="fulfilled",t.value=n,X1(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,q1(e,n)))}function kx(e,t,n){var s=e.pending;if(e.pending=null,s!==null){s=s.next;do t.status="rejected",t.reason=n,X1(t),t=t.next;while(t!==s)}e.action=null}function X1(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function G1(e,t){return t}function vv(e,t){if(Je){var n=ht.formState;if(n!==null){e:{var s=Ye;if(Je){if(Dt){t:{for(var r=Dt,i=$s;r.nodeType!==8;){if(!i){r=null;break t}if(r=bs(r.nextSibling),r===null){r=null;break t}}i=r.data,r=i==="F!"||i==="F"?r:null}if(r){Dt=bs(r.nextSibling),s=r.data==="F!";break e}}ei(s)}s=!1}s&&(t=n[0])}}return n=pn(),n.memoizedState=n.baseState=t,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:G1,lastRenderedState:t},n.queue=s,n=uj.bind(null,Ye,s),s.dispatch=n,s=Ex(!1),i=pp.bind(null,Ye,!1,s.queue),s=pn(),r={state:t,dispatch:null,action:e,pending:null},s.queue=r,n=qk.bind(null,Ye,r,i,n),r.dispatch=n,s.memoizedState=e,[t,n,!1]}function bv(e){var t=$t();return Z1(t,ot,e)}function Z1(e,t,n){if(t=fp(e,t,G1)[0],e=au(wa)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var s=Hc(t)}catch(o){throw o===Lc?Ph:o}else s=t;t=$t();var r=t.queue,i=r.dispatch;return n!==t.memoizedState&&(Ye.flags|=2048,wo(9,Hh(),Xk.bind(null,r,n),null)),[s,i,e]}function Xk(e,t){e.action=t}function yv(e){var t=$t(),n=ot;if(n!==null)return Z1(t,n,e);$t(),t=t.memoizedState,n=$t();var s=n.queue.dispatch;return n.memoizedState=e,[t,s,!1]}function wo(e,t,n,s){return e={tag:e,create:n,deps:s,inst:t,next:null},t=Ye.updateQueue,t===null&&(t=up(),Ye.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(s=n.next,n.next=e,e.next=s,t.lastEffect=e),e}function Hh(){return{destroy:void 0,resource:void 0}}function Q1(){return $t().memoizedState}function ru(e,t,n,s){var r=pn();s=s===void 0?null:s,Ye.flags|=e,r.memoizedState=wo(1|t,Hh(),n,s)}function Bc(e,t,n,s){var r=$t();s=s===void 0?null:s;var i=r.memoizedState.inst;ot!==null&&s!==null&&ip(s,ot.memoizedState.deps)?r.memoizedState=wo(t,i,n,s):(Ye.flags|=e,r.memoizedState=wo(1|t,i,n,s))}function wv(e,t){ru(8390656,8,e,t)}function K1(e,t){Bc(2048,8,e,t)}function J1(e,t){return Bc(4,2,e,t)}function ej(e,t){return Bc(4,4,e,t)}function tj(e,t){if(typeof t=="function"){e=e();var n=t(e);return function(){typeof n=="function"?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function nj(e,t,n){n=n!=null?n.concat([e]):null,Bc(4,4,tj.bind(null,t,e),n)}function mp(){}function sj(e,t){var n=$t();t=t===void 0?null:t;var s=n.memoizedState;return t!==null&&ip(t,s[1])?s[0]:(n.memoizedState=[e,t],e)}function aj(e,t){var n=$t();t=t===void 0?null:t;var s=n.memoizedState;if(t!==null&&ip(t,s[1]))return s[0];if(s=e(),ni){Ja(!0);try{e()}finally{Ja(!1)}}return n.memoizedState=[s,t],s}function xp(e,t,n){return n===void 0||gr&1073741824?e.memoizedState=t:(e.memoizedState=n,e=Xj(),Ye.lanes|=e,vr|=e,n)}function rj(e,t,n,s){return In(n,t)?n:yo.current!==null?(e=xp(e,n,s),In(e,t)||(Zt=!0),e):gr&42?(e=Xj(),Ye.lanes|=e,vr|=e,t):(Zt=!0,e.memoizedState=n)}function ij(e,t,n,s,r){var i=et.p;et.p=i!==0&&8>i?i:8;var o=Oe.T,l={};Oe.T=l,pp(e,!1,t,n);try{var c=r(),u=Oe.S;if(u!==null&&u(l,c),c!==null&&typeof c=="object"&&typeof c.then=="function"){var h=Fk(c,s);Fl(e,t,h,Vn(e))}else Fl(e,t,s,Vn(e))}catch(d){Fl(e,t,{then:function(){},status:"rejected",reason:d},Vn())}finally{et.p=i,Oe.T=o}}function Gk(){}function Mx(e,t,n,s){if(e.tag!==5)throw Error(oe(476));var r=oj(e).queue;ij(e,r,t,Yr,n===null?Gk:function(){return lj(e),n(s)})}function oj(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Yr,baseState:Yr,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:wa,lastRenderedState:Yr},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:wa,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function lj(e){var t=oj(e).next.queue;Fl(e,t,{},Vn())}function gp(){return ln(cc)}function cj(){return $t().memoizedState}function dj(){return $t().memoizedState}function Zk(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Vn();e=ir(n);var s=or(t,e,n);s!==null&&(Yn(s,t,n),Bl(s,t,n)),t={cache:np()},e.payload=t;return}t=t.return}}function Qk(e,t,n){var s=Vn();n={lane:s,revertLane:0,action:n,hasEagerState:!1,eagerState:null,next:null},Bh(e)?hj(t,n):(n=Kg(e,t,n,s),n!==null&&(Yn(n,e,s),fj(n,t,s)))}function uj(e,t,n){var s=Vn();Fl(e,t,n,s)}function Fl(e,t,n,s){var r={lane:s,revertLane:0,action:n,hasEagerState:!1,eagerState:null,next:null};if(Bh(e))hj(t,r);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var o=t.lastRenderedState,l=i(o,n);if(r.hasEagerState=!0,r.eagerState=l,In(l,o))return $h(e,t,r,0),ht===null&&Uh(),!1}catch{}finally{}if(n=Kg(e,t,r,s),n!==null)return Yn(n,e,s),fj(n,t,s),!0}return!1}function pp(e,t,n,s){if(s={lane:2,revertLane:Cp(),action:s,hasEagerState:!1,eagerState:null,next:null},Bh(e)){if(t)throw Error(oe(479))}else t=Kg(e,n,s,2),t!==null&&Yn(t,e,2)}function Bh(e){var t=e.alternate;return e===Ye||t!==null&&t===Ye}function hj(e,t){ao=zu=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function fj(e,t,n){if(n&4194048){var s=t.lanes;s&=e.pendingLanes,n|=s,t.lanes=n,s1(e,n)}}var Uu={readContext:ln,use:Lh,useCallback:Ot,useContext:Ot,useEffect:Ot,useImperativeHandle:Ot,useLayoutEffect:Ot,useInsertionEffect:Ot,useMemo:Ot,useReducer:Ot,useRef:Ot,useState:Ot,useDebugValue:Ot,useDeferredValue:Ot,useTransition:Ot,useSyncExternalStore:Ot,useId:Ot,useHostTransitionStatus:Ot,useFormState:Ot,useActionState:Ot,useOptimistic:Ot,useMemoCache:Ot,useCacheRefresh:Ot},mj={readContext:ln,use:Lh,useCallback:function(e,t){return pn().memoizedState=[e,t===void 0?null:t],e},useContext:ln,useEffect:wv,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,ru(4194308,4,tj.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ru(4194308,4,e,t)},useInsertionEffect:function(e,t){ru(4,2,e,t)},useMemo:function(e,t){var n=pn();t=t===void 0?null:t;var s=e();if(ni){Ja(!0);try{e()}finally{Ja(!1)}}return n.memoizedState=[s,t],s},useReducer:function(e,t,n){var s=pn();if(n!==void 0){var r=n(t);if(ni){Ja(!0);try{n(t)}finally{Ja(!1)}}}else r=t;return s.memoizedState=s.baseState=r,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:r},s.queue=e,e=e.dispatch=Qk.bind(null,Ye,e),[s.memoizedState,e]},useRef:function(e){var t=pn();return e={current:e},t.memoizedState=e},useState:function(e){e=Ex(e);var t=e.queue,n=uj.bind(null,Ye,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:mp,useDeferredValue:function(e,t){var n=pn();return xp(n,e,t)},useTransition:function(){var e=Ex(!1);return e=ij.bind(null,Ye,e.queue,!0,!1),pn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var s=Ye,r=pn();if(Je){if(n===void 0)throw Error(oe(407));n=n()}else{if(n=t(),ht===null)throw Error(oe(349));Ze&124||B1(s,t,n)}r.memoizedState=n;var i={value:n,getSnapshot:t};return r.queue=i,wv(Y1.bind(null,s,i,e),[e]),s.flags|=2048,wo(9,Hh(),V1.bind(null,s,i,n,t),null),n},useId:function(){var e=pn(),t=ht.identifierPrefix;if(Je){var n=da,s=ca;n=(s&~(1<<32-Bn(s)-1)).toString(32)+n,t="«"+t+"R"+n,n=Ru++,0<n&&(t+="H"+n.toString(32)),t+="»"}else n=Ik++,t="«"+t+"r"+n.toString(32)+"»";return e.memoizedState=t},useHostTransitionStatus:gp,useFormState:vv,useActionState:vv,useOptimistic:function(e){var t=pn();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=pp.bind(null,Ye,!0,n),n.dispatch=t,[e,t]},useMemoCache:hp,useCacheRefresh:function(){return pn().memoizedState=Zk.bind(null,Ye)}},xj={readContext:ln,use:Lh,useCallback:sj,useContext:ln,useEffect:K1,useImperativeHandle:nj,useInsertionEffect:J1,useLayoutEffect:ej,useMemo:aj,useReducer:au,useRef:Q1,useState:function(){return au(wa)},useDebugValue:mp,useDeferredValue:function(e,t){var n=$t();return rj(n,ot.memoizedState,e,t)},useTransition:function(){var e=au(wa)[0],t=$t().memoizedState;return[typeof e=="boolean"?e:Hc(e),t]},useSyncExternalStore:H1,useId:cj,useHostTransitionStatus:gp,useFormState:bv,useActionState:bv,useOptimistic:function(e,t){var n=$t();return W1(n,ot,e,t)},useMemoCache:hp,useCacheRefresh:dj},Kk={readContext:ln,use:Lh,useCallback:sj,useContext:ln,useEffect:K1,useImperativeHandle:nj,useInsertionEffect:J1,useLayoutEffect:ej,useMemo:aj,useReducer:Qf,useRef:Q1,useState:function(){return Qf(wa)},useDebugValue:mp,useDeferredValue:function(e,t){var n=$t();return ot===null?xp(n,e,t):rj(n,ot.memoizedState,e,t)},useTransition:function(){var e=Qf(wa)[0],t=$t().memoizedState;return[typeof e=="boolean"?e:Hc(e),t]},useSyncExternalStore:H1,useId:cj,useHostTransitionStatus:gp,useFormState:yv,useActionState:yv,useOptimistic:function(e,t){var n=$t();return ot!==null?W1(n,ot,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:hp,useCacheRefresh:dj},io=null,rc=0;function Nd(e){var t=rc;return rc+=1,io===null&&(io=[]),R1(io,e,t)}function ul(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Sd(e,t){throw t.$$typeof===ME?Error(oe(525)):(e=Object.prototype.toString.call(t),Error(oe(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function jv(e){var t=e._init;return t(e._payload)}function gj(e){function t(g,y){if(e){var p=g.deletions;p===null?(g.deletions=[y],g.flags|=16):p.push(y)}}function n(g,y){if(!e)return null;for(;y!==null;)t(g,y),y=y.sibling;return null}function s(g){for(var y=new Map;g!==null;)g.key!==null?y.set(g.key,g):y.set(g.index,g),g=g.sibling;return y}function r(g,y){return g=pa(g,y),g.index=0,g.sibling=null,g}function i(g,y,p){return g.index=p,e?(p=g.alternate,p!==null?(p=p.index,p<y?(g.flags|=67108866,y):p):(g.flags|=67108866,y)):(g.flags|=1048576,y)}function o(g){return e&&g.alternate===null&&(g.flags|=67108866),g}function l(g,y,p,w){return y===null||y.tag!==6?(y=Xf(p,g.mode,w),y.return=g,y):(y=r(y,p),y.return=g,y)}function c(g,y,p,w){var N=p.type;return N===Hi?h(g,y,p.props.children,w,p.key):y!==null&&(y.elementType===N||typeof N=="object"&&N!==null&&N.$$typeof===Ia&&jv(N)===y.type)?(y=r(y,p.props),ul(y,p),y.return=g,y):(y=nu(p.type,p.key,p.props,null,g.mode,w),ul(y,p),y.return=g,y)}function u(g,y,p,w){return y===null||y.tag!==4||y.stateNode.containerInfo!==p.containerInfo||y.stateNode.implementation!==p.implementation?(y=Gf(p,g.mode,w),y.return=g,y):(y=r(y,p.children||[]),y.return=g,y)}function h(g,y,p,w,N){return y===null||y.tag!==7?(y=Fr(p,g.mode,w,N),y.return=g,y):(y=r(y,p),y.return=g,y)}function d(g,y,p){if(typeof y=="string"&&y!==""||typeof y=="number"||typeof y=="bigint")return y=Xf(""+y,g.mode,p),y.return=g,y;if(typeof y=="object"&&y!==null){switch(y.$$typeof){case gd:return p=nu(y.type,y.key,y.props,null,g.mode,p),ul(p,y),p.return=g,p;case Ml:return y=Gf(y,g.mode,p),y.return=g,y;case Ia:var w=y._init;return y=w(y._payload),d(g,y,p)}if(Tl(y)||ol(y))return y=Fr(y,g.mode,p,null),y.return=g,y;if(typeof y.then=="function")return d(g,Nd(y),p);if(y.$$typeof===la)return d(g,wd(g,y),p);Sd(g,y)}return null}function f(g,y,p,w){var N=y!==null?y.key:null;if(typeof p=="string"&&p!==""||typeof p=="number"||typeof p=="bigint")return N!==null?null:l(g,y,""+p,w);if(typeof p=="object"&&p!==null){switch(p.$$typeof){case gd:return p.key===N?c(g,y,p,w):null;case Ml:return p.key===N?u(g,y,p,w):null;case Ia:return N=p._init,p=N(p._payload),f(g,y,p,w)}if(Tl(p)||ol(p))return N!==null?null:h(g,y,p,w,null);if(typeof p.then=="function")return f(g,y,Nd(p),w);if(p.$$typeof===la)return f(g,y,wd(g,p),w);Sd(g,p)}return null}function x(g,y,p,w,N){if(typeof w=="string"&&w!==""||typeof w=="number"||typeof w=="bigint")return g=g.get(p)||null,l(y,g,""+w,N);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case gd:return g=g.get(w.key===null?p:w.key)||null,c(y,g,w,N);case Ml:return g=g.get(w.key===null?p:w.key)||null,u(y,g,w,N);case Ia:var S=w._init;return w=S(w._payload),x(g,y,p,w,N)}if(Tl(w)||ol(w))return g=g.get(p)||null,h(y,g,w,N,null);if(typeof w.then=="function")return x(g,y,p,Nd(w),N);if(w.$$typeof===la)return x(g,y,p,wd(y,w),N);Sd(y,w)}return null}function b(g,y,p,w){for(var N=null,S=null,C=y,T=y=0,U=null;C!==null&&T<p.length;T++){C.index>T?(U=C,C=null):U=C.sibling;var B=f(g,C,p[T],w);if(B===null){C===null&&(C=U);break}e&&C&&B.alternate===null&&t(g,C),y=i(B,y,T),S===null?N=B:S.sibling=B,S=B,C=U}if(T===p.length)return n(g,C),Je&&Rr(g,T),N;if(C===null){for(;T<p.length;T++)C=d(g,p[T],w),C!==null&&(y=i(C,y,T),S===null?N=C:S.sibling=C,S=C);return Je&&Rr(g,T),N}for(C=s(C);T<p.length;T++)U=x(C,g,T,p[T],w),U!==null&&(e&&U.alternate!==null&&C.delete(U.key===null?T:U.key),y=i(U,y,T),S===null?N=U:S.sibling=U,S=U);return e&&C.forEach(function(P){return t(g,P)}),Je&&Rr(g,T),N}function v(g,y,p,w){if(p==null)throw Error(oe(151));for(var N=null,S=null,C=y,T=y=0,U=null,B=p.next();C!==null&&!B.done;T++,B=p.next()){C.index>T?(U=C,C=null):U=C.sibling;var P=f(g,C,B.value,w);if(P===null){C===null&&(C=U);break}e&&C&&P.alternate===null&&t(g,C),y=i(P,y,T),S===null?N=P:S.sibling=P,S=P,C=U}if(B.done)return n(g,C),Je&&Rr(g,T),N;if(C===null){for(;!B.done;T++,B=p.next())B=d(g,B.value,w),B!==null&&(y=i(B,y,T),S===null?N=B:S.sibling=B,S=B);return Je&&Rr(g,T),N}for(C=s(C);!B.done;T++,B=p.next())B=x(C,g,T,B.value,w),B!==null&&(e&&B.alternate!==null&&C.delete(B.key===null?T:B.key),y=i(B,y,T),S===null?N=B:S.sibling=B,S=B);return e&&C.forEach(function(z){return t(g,z)}),Je&&Rr(g,T),N}function j(g,y,p,w){if(typeof p=="object"&&p!==null&&p.type===Hi&&p.key===null&&(p=p.props.children),typeof p=="object"&&p!==null){switch(p.$$typeof){case gd:e:{for(var N=p.key;y!==null;){if(y.key===N){if(N=p.type,N===Hi){if(y.tag===7){n(g,y.sibling),w=r(y,p.props.children),w.return=g,g=w;break e}}else if(y.elementType===N||typeof N=="object"&&N!==null&&N.$$typeof===Ia&&jv(N)===y.type){n(g,y.sibling),w=r(y,p.props),ul(w,p),w.return=g,g=w;break e}n(g,y);break}else t(g,y);y=y.sibling}p.type===Hi?(w=Fr(p.props.children,g.mode,w,p.key),w.return=g,g=w):(w=nu(p.type,p.key,p.props,null,g.mode,w),ul(w,p),w.return=g,g=w)}return o(g);case Ml:e:{for(N=p.key;y!==null;){if(y.key===N)if(y.tag===4&&y.stateNode.containerInfo===p.containerInfo&&y.stateNode.implementation===p.implementation){n(g,y.sibling),w=r(y,p.children||[]),w.return=g,g=w;break e}else{n(g,y);break}else t(g,y);y=y.sibling}w=Gf(p,g.mode,w),w.return=g,g=w}return o(g);case Ia:return N=p._init,p=N(p._payload),j(g,y,p,w)}if(Tl(p))return b(g,y,p,w);if(ol(p)){if(N=ol(p),typeof N!="function")throw Error(oe(150));return p=N.call(p),v(g,y,p,w)}if(typeof p.then=="function")return j(g,y,Nd(p),w);if(p.$$typeof===la)return j(g,y,wd(g,p),w);Sd(g,p)}return typeof p=="string"&&p!==""||typeof p=="number"||typeof p=="bigint"?(p=""+p,y!==null&&y.tag===6?(n(g,y.sibling),w=r(y,p),w.return=g,g=w):(n(g,y),w=Xf(p,g.mode,w),w.return=g,g=w),o(g)):n(g,y)}return function(g,y,p,w){try{rc=0;var N=j(g,y,p,w);return io=null,N}catch(C){if(C===Lc||C===Ph)throw C;var S=$n(29,C,null,g.mode);return S.lanes=w,S.return=g,S}finally{}}}var jo=gj(!0),pj=gj(!1),is=Gs(null),Fs=null;function Ga(e){var t=e.alternate;Nt(It,It.current&1),Nt(is,e),Fs===null&&(t===null||yo.current!==null||t.memoizedState!==null)&&(Fs=e)}function vj(e){if(e.tag===22){if(Nt(It,It.current),Nt(is,e),Fs===null){var t=e.alternate;t!==null&&t.memoizedState!==null&&(Fs=e)}}else Za()}function Za(){Nt(It,It.current),Nt(is,is.current)}function ha(e){Qt(is),Fs===e&&(Fs=null),Qt(It)}var It=Gs(0);function $u(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||Ix(n)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}function Kf(e,t,n,s){t=e.memoizedState,n=n(s,t),n=n==null?t:pt({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Tx={enqueueSetState:function(e,t,n){e=e._reactInternals;var s=Vn(),r=ir(s);r.payload=t,n!=null&&(r.callback=n),t=or(e,r,s),t!==null&&(Yn(t,e,s),Bl(t,e,s))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var s=Vn(),r=ir(s);r.tag=1,r.payload=t,n!=null&&(r.callback=n),t=or(e,r,s),t!==null&&(Yn(t,e,s),Bl(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Vn(),s=ir(n);s.tag=2,t!=null&&(s.callback=t),t=or(e,s,n),t!==null&&(Yn(t,e,n),Bl(t,e,n))}};function Nv(e,t,n,s,r,i,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,i,o):t.prototype&&t.prototype.isPureReactComponent?!nc(n,s)||!nc(r,i):!0}function Sv(e,t,n,s){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,s),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,s),t.state!==e&&Tx.enqueueReplaceState(t,t.state,null)}function si(e,t){var n=t;if("ref"in t){n={};for(var s in t)s!=="ref"&&(n[s]=t[s])}if(e=e.defaultProps){n===t&&(n=pt({},n));for(var r in e)n[r]===void 0&&(n[r]=e[r])}return n}var Pu=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)};function bj(e){Pu(e)}function yj(e){console.error(e)}function wj(e){Pu(e)}function Lu(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(s){setTimeout(function(){throw s})}}function Cv(e,t,n){try{var s=e.onCaughtError;s(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(r){setTimeout(function(){throw r})}}function Dx(e,t,n){return n=ir(n),n.tag=3,n.payload={element:null},n.callback=function(){Lu(e,t)},n}function jj(e){return e=ir(e),e.tag=3,e}function Nj(e,t,n,s){var r=n.type.getDerivedStateFromError;if(typeof r=="function"){var i=s.value;e.payload=function(){return r(i)},e.callback=function(){Cv(t,n,s)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch=="function"&&(e.callback=function(){Cv(t,n,s),typeof r!="function"&&(lr===null?lr=new Set([this]):lr.add(this));var l=s.stack;this.componentDidCatch(s.value,{componentStack:l!==null?l:""})})}function Jk(e,t,n,s,r){if(n.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){if(t=n.alternate,t!==null&&$c(t,n,r,!0),n=is.current,n!==null){switch(n.tag){case 13:return Fs===null?Px():n.alternate===null&&At===0&&(At=3),n.flags&=-257,n.flags|=65536,n.lanes=r,s===jx?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([s]):t.add(s),cm(e,s,r)),!1;case 22:return n.flags|=65536,s===jx?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([s])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([s]):n.add(s)),cm(e,s,r)),!1}throw Error(oe(435,n.tag))}return cm(e,s,r),Px(),!1}if(Je)return t=is.current,t!==null?(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=r,s!==px&&(e=Error(oe(422),{cause:s}),sc(as(e,n)))):(s!==px&&(t=Error(oe(423),{cause:s}),sc(as(t,n))),e=e.current.alternate,e.flags|=65536,r&=-r,e.lanes|=r,s=as(s,n),r=Dx(e.stateNode,s,r),Zf(e,r),At!==4&&(At=2)),!1;var i=Error(oe(520),{cause:s});if(i=as(i,n),ql===null?ql=[i]:ql.push(i),At!==4&&(At=2),t===null)return!0;s=as(s,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=r&-r,n.lanes|=e,e=Dx(n.stateNode,s,e),Zf(n,e),!1;case 1:if(t=n.type,i=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||i!==null&&typeof i.componentDidCatch=="function"&&(lr===null||!lr.has(i))))return n.flags|=65536,r&=-r,n.lanes|=r,r=jj(r),Nj(r,e,n,s),Zf(n,r),!1}n=n.return}while(n!==null);return!1}var Sj=Error(oe(461)),Zt=!1;function en(e,t,n,s){t.child=e===null?pj(t,null,n,s):jo(t,e.child,n,s)}function Ev(e,t,n,s,r){n=n.render;var i=t.ref;if("ref"in s){var o={};for(var l in s)l!=="ref"&&(o[l]=s[l])}else o=s;return ti(t),s=op(e,t,n,o,i,r),l=lp(),e!==null&&!Zt?(cp(e,t,r),ja(e,t,r)):(Je&&l&&ep(t),t.flags|=1,en(e,t,s,r),t.child)}function kv(e,t,n,s,r){if(e===null){var i=n.type;return typeof i=="function"&&!Jg(i)&&i.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=i,Cj(e,t,i,s,r)):(e=nu(n.type,null,s,t,t.mode,r),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!vp(e,r)){var o=i.memoizedProps;if(n=n.compare,n=n!==null?n:nc,n(o,s)&&e.ref===t.ref)return ja(e,t,r)}return t.flags|=1,e=pa(i,s),e.ref=t.ref,e.return=t,t.child=e}function Cj(e,t,n,s,r){if(e!==null){var i=e.memoizedProps;if(nc(i,s)&&e.ref===t.ref)if(Zt=!1,t.pendingProps=s=i,vp(e,r))e.flags&131072&&(Zt=!0);else return t.lanes=e.lanes,ja(e,t,r)}return _x(e,t,n,s,r)}function Ej(e,t,n){var s=t.pendingProps,r=s.children,i=e!==null?e.memoizedState:null;if(s.mode==="hidden"){if(t.flags&128){if(s=i!==null?i.baseLanes|n:n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;t.childLanes=i&~s}else t.childLanes=0,t.child=null;return Mv(e,t,s,n)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&su(t,i!==null?i.cachePool:null),i!==null?xv(t,i):Cx(),vj(t);else return t.lanes=t.childLanes=536870912,Mv(e,t,i!==null?i.baseLanes|n:n,n)}else i!==null?(su(t,i.cachePool),xv(t,i),Za(),t.memoizedState=null):(e!==null&&su(t,null),Cx(),Za());return en(e,t,r,n),t.child}function Mv(e,t,n,s){var r=sp();return r=r===null?null:{parent:Yt._currentValue,pool:r},t.memoizedState={baseLanes:n,cachePool:r},e!==null&&su(t,null),Cx(),vj(t),e!==null&&$c(e,t,s,!0),null}function iu(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(oe(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function _x(e,t,n,s,r){return ti(t),n=op(e,t,n,s,void 0,r),s=lp(),e!==null&&!Zt?(cp(e,t,r),ja(e,t,r)):(Je&&s&&ep(t),t.flags|=1,en(e,t,n,r),t.child)}function Tv(e,t,n,s,r,i){return ti(t),t.updateQueue=null,n=L1(t,s,n,r),P1(e),s=lp(),e!==null&&!Zt?(cp(e,t,i),ja(e,t,i)):(Je&&s&&ep(t),t.flags|=1,en(e,t,n,i),t.child)}function Dv(e,t,n,s,r){if(ti(t),t.stateNode===null){var i=Xi,o=n.contextType;typeof o=="object"&&o!==null&&(i=ln(o)),i=new n(s,i),t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,i.updater=Tx,t.stateNode=i,i._reactInternals=t,i=t.stateNode,i.props=s,i.state=t.memoizedState,i.refs={},ap(t),o=n.contextType,i.context=typeof o=="object"&&o!==null?ln(o):Xi,i.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o=="function"&&(Kf(t,n,o,s),i.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(o=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),o!==i.state&&Tx.enqueueReplaceState(i,i.state,null),Yl(t,s,i,r),Vl(),i.state=t.memoizedState),typeof i.componentDidMount=="function"&&(t.flags|=4194308),s=!0}else if(e===null){i=t.stateNode;var l=t.memoizedProps,c=si(n,l);i.props=c;var u=i.context,h=n.contextType;o=Xi,typeof h=="object"&&h!==null&&(o=ln(h));var d=n.getDerivedStateFromProps;h=typeof d=="function"||typeof i.getSnapshotBeforeUpdate=="function",l=t.pendingProps!==l,h||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(l||u!==o)&&Sv(t,i,s,o),Wa=!1;var f=t.memoizedState;i.state=f,Yl(t,s,i,r),Vl(),u=t.memoizedState,l||f!==u||Wa?(typeof d=="function"&&(Kf(t,n,d,s),u=t.memoizedState),(c=Wa||Nv(t,n,c,s,f,u,o))?(h||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount()),typeof i.componentDidMount=="function"&&(t.flags|=4194308)):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=s,t.memoizedState=u),i.props=s,i.state=u,i.context=o,s=c):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),s=!1)}else{i=t.stateNode,Nx(e,t),o=t.memoizedProps,h=si(n,o),i.props=h,d=t.pendingProps,f=i.context,u=n.contextType,c=Xi,typeof u=="object"&&u!==null&&(c=ln(u)),l=n.getDerivedStateFromProps,(u=typeof l=="function"||typeof i.getSnapshotBeforeUpdate=="function")||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(o!==d||f!==c)&&Sv(t,i,s,c),Wa=!1,f=t.memoizedState,i.state=f,Yl(t,s,i,r),Vl();var x=t.memoizedState;o!==d||f!==x||Wa||e!==null&&e.dependencies!==null&&Au(e.dependencies)?(typeof l=="function"&&(Kf(t,n,l,s),x=t.memoizedState),(h=Wa||Nv(t,n,h,s,f,x,c)||e!==null&&e.dependencies!==null&&Au(e.dependencies))?(u||typeof i.UNSAFE_componentWillUpdate!="function"&&typeof i.componentWillUpdate!="function"||(typeof i.componentWillUpdate=="function"&&i.componentWillUpdate(s,x,c),typeof i.UNSAFE_componentWillUpdate=="function"&&i.UNSAFE_componentWillUpdate(s,x,c)),typeof i.componentDidUpdate=="function"&&(t.flags|=4),typeof i.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof i.componentDidUpdate!="function"||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=s,t.memoizedState=x),i.props=s,i.state=x,i.context=c,s=h):(typeof i.componentDidUpdate!="function"||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),s=!1)}return i=s,iu(e,t),s=(t.flags&128)!==0,i||s?(i=t.stateNode,n=s&&typeof n.getDerivedStateFromError!="function"?null:i.render(),t.flags|=1,e!==null&&s?(t.child=jo(t,e.child,null,r),t.child=jo(t,null,n,r)):en(e,t,n,r),t.memoizedState=i.state,e=t.child):e=ja(e,t,r),e}function _v(e,t,n,s){return Uc(),t.flags|=256,en(e,t,n,s),t.child}var Jf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function em(e){return{baseLanes:e,cachePool:O1()}}function tm(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=rs),e}function kj(e,t,n){var s=t.pendingProps,r=!1,i=(t.flags&128)!==0,o;if((o=i)||(o=e!==null&&e.memoizedState===null?!1:(It.current&2)!==0),o&&(r=!0,t.flags&=-129),o=(t.flags&32)!==0,t.flags&=-33,e===null){if(Je){if(r?Ga(t):Za(),Je){var l=Dt,c;if(c=l){e:{for(c=l,l=$s;c.nodeType!==8;){if(!l){l=null;break e}if(c=bs(c.nextSibling),c===null){l=null;break e}}l=c}l!==null?(t.memoizedState={dehydrated:l,treeContext:Ir!==null?{id:ca,overflow:da}:null,retryLane:536870912,hydrationErrors:null},c=$n(18,null,null,0),c.stateNode=l,c.return=t,t.child=c,un=t,Dt=null,c=!0):c=!1}c||ei(t)}if(l=t.memoizedState,l!==null&&(l=l.dehydrated,l!==null))return Ix(l)?t.lanes=32:t.lanes=536870912,null;ha(t)}return l=s.children,s=s.fallback,r?(Za(),r=t.mode,l=Hu({mode:"hidden",children:l},r),s=Fr(s,r,n,null),l.return=t,s.return=t,l.sibling=s,t.child=l,r=t.child,r.memoizedState=em(n),r.childLanes=tm(e,o,n),t.memoizedState=Jf,s):(Ga(t),Ax(t,l))}if(c=e.memoizedState,c!==null&&(l=c.dehydrated,l!==null)){if(i)t.flags&256?(Ga(t),t.flags&=-257,t=nm(e,t,n)):t.memoizedState!==null?(Za(),t.child=e.child,t.flags|=128,t=null):(Za(),r=s.fallback,l=t.mode,s=Hu({mode:"visible",children:s.children},l),r=Fr(r,l,n,null),r.flags|=2,s.return=t,r.return=t,s.sibling=r,t.child=s,jo(t,e.child,null,n),s=t.child,s.memoizedState=em(n),s.childLanes=tm(e,o,n),t.memoizedState=Jf,t=r);else if(Ga(t),Ix(l)){if(o=l.nextSibling&&l.nextSibling.dataset,o)var u=o.dgst;o=u,s=Error(oe(419)),s.stack="",s.digest=o,sc({value:s,source:null,stack:null}),t=nm(e,t,n)}else if(Zt||$c(e,t,n,!1),o=(n&e.childLanes)!==0,Zt||o){if(o=ht,o!==null&&(s=n&-n,s=s&42?1:Vg(s),s=s&(o.suspendedLanes|n)?0:s,s!==0&&s!==c.retryLane))throw c.retryLane=s,Yo(e,s),Yn(o,e,s),Sj;l.data==="$?"||Px(),t=nm(e,t,n)}else l.data==="$?"?(t.flags|=192,t.child=e.child,t=null):(e=c.treeContext,Dt=bs(l.nextSibling),un=t,Je=!0,Wr=null,$s=!1,e!==null&&(ts[ns++]=ca,ts[ns++]=da,ts[ns++]=Ir,ca=e.id,da=e.overflow,Ir=t),t=Ax(t,s.children),t.flags|=4096);return t}return r?(Za(),r=s.fallback,l=t.mode,c=e.child,u=c.sibling,s=pa(c,{mode:"hidden",children:s.children}),s.subtreeFlags=c.subtreeFlags&65011712,u!==null?r=pa(u,r):(r=Fr(r,l,n,null),r.flags|=2),r.return=t,s.return=t,s.sibling=r,t.child=s,s=r,r=t.child,l=e.child.memoizedState,l===null?l=em(n):(c=l.cachePool,c!==null?(u=Yt._currentValue,c=c.parent!==u?{parent:u,pool:u}:c):c=O1(),l={baseLanes:l.baseLanes|n,cachePool:c}),r.memoizedState=l,r.childLanes=tm(e,o,n),t.memoizedState=Jf,s):(Ga(t),n=e.child,e=n.sibling,n=pa(n,{mode:"visible",children:s.children}),n.return=t,n.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=n,t.memoizedState=null,n)}function Ax(e,t){return t=Hu({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Hu(e,t){return e=$n(22,e,null,t),e.lanes=0,e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},e}function nm(e,t,n){return jo(t,e.child,null,n),e=Ax(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Av(e,t,n){e.lanes|=t;var s=e.alternate;s!==null&&(s.lanes|=t),bx(e.return,t,n)}function sm(e,t,n,s,r){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:s,tail:n,tailMode:r}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=s,i.tail=n,i.tailMode=r)}function Mj(e,t,n){var s=t.pendingProps,r=s.revealOrder,i=s.tail;if(en(e,t,s.children,n),s=It.current,s&2)s=s&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Av(e,n,t);else if(e.tag===19)Av(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}s&=1}switch(Nt(It,s),r){case"forwards":for(n=t.child,r=null;n!==null;)e=n.alternate,e!==null&&$u(e)===null&&(r=n),n=n.sibling;n=r,n===null?(r=t.child,t.child=null):(r=n.sibling,n.sibling=null),sm(t,!1,r,n,i);break;case"backwards":for(n=null,r=t.child,t.child=null;r!==null;){if(e=r.alternate,e!==null&&$u(e)===null){t.child=r;break}e=r.sibling,r.sibling=n,n=r,r=e}sm(t,!0,n,null,i);break;case"together":sm(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function ja(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),vr|=t.lanes,!(n&t.childLanes))if(e!==null){if($c(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(oe(153));if(t.child!==null){for(e=t.child,n=pa(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=pa(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function vp(e,t){return e.lanes&t?!0:(e=e.dependencies,!!(e!==null&&Au(e)))}function e3(e,t,n){switch(t.tag){case 3:Su(t,t.stateNode.containerInfo),Xa(t,Yt,e.memoizedState.cache),Uc();break;case 27:case 5:ox(t);break;case 4:Su(t,t.stateNode.containerInfo);break;case 10:Xa(t,t.type,t.memoizedProps.value);break;case 13:var s=t.memoizedState;if(s!==null)return s.dehydrated!==null?(Ga(t),t.flags|=128,null):n&t.child.childLanes?kj(e,t,n):(Ga(t),e=ja(e,t,n),e!==null?e.sibling:null);Ga(t);break;case 19:var r=(e.flags&128)!==0;if(s=(n&t.childLanes)!==0,s||($c(e,t,n,!1),s=(n&t.childLanes)!==0),r){if(s)return Mj(e,t,n);t.flags|=128}if(r=t.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),Nt(It,It.current),s)break;return null;case 22:case 23:return t.lanes=0,Ej(e,t,n);case 24:Xa(t,Yt,e.memoizedState.cache)}return ja(e,t,n)}function Tj(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)Zt=!0;else{if(!vp(e,n)&&!(t.flags&128))return Zt=!1,e3(e,t,n);Zt=!!(e.flags&131072)}else Zt=!1,Je&&t.flags&1048576&&_1(t,_u,t.index);switch(t.lanes=0,t.tag){case 16:e:{e=t.pendingProps;var s=t.elementType,r=s._init;if(s=r(s._payload),t.type=s,typeof s=="function")Jg(s)?(e=si(s,e),t.tag=1,t=Dv(null,t,s,e,n)):(t.tag=0,t=_x(null,t,s,e,n));else{if(s!=null){if(r=s.$$typeof,r===Lg){t.tag=11,t=Ev(null,t,s,e,n);break e}else if(r===Hg){t.tag=14,t=kv(null,t,s,e,n);break e}}throw t=rx(s)||s,Error(oe(306,t,""))}}return t;case 0:return _x(e,t,t.type,t.pendingProps,n);case 1:return s=t.type,r=si(s,t.pendingProps),Dv(e,t,s,r,n);case 3:e:{if(Su(t,t.stateNode.containerInfo),e===null)throw Error(oe(387));s=t.pendingProps;var i=t.memoizedState;r=i.element,Nx(e,t),Yl(t,s,null,n);var o=t.memoizedState;if(s=o.cache,Xa(t,Yt,s),s!==i.cache&&yx(t,[Yt],n,!0),Vl(),s=o.element,i.isDehydrated)if(i={element:s,isDehydrated:!1,cache:o.cache},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){t=_v(e,t,s,n);break e}else if(s!==r){r=as(Error(oe(424)),t),sc(r),t=_v(e,t,s,n);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(Dt=bs(e.firstChild),un=t,Je=!0,Wr=null,$s=!0,n=pj(t,null,s,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Uc(),s===r){t=ja(e,t,n);break e}en(e,t,s,n)}t=t.child}return t;case 26:return iu(e,t),e===null?(n=Gv(t.type,null,t.pendingProps,null))?t.memoizedState=n:Je||(n=t.type,e=t.pendingProps,s=qu(rr.current).createElement(n),s[on]=t,s[Nn]=e,nn(s,n,e),Gt(s),t.stateNode=s):t.memoizedState=Gv(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ox(t),e===null&&Je&&(s=t.stateNode=xN(t.type,t.pendingProps,rr.current),un=t,$s=!0,r=Dt,Cr(t.type)?(Wx=r,Dt=bs(s.firstChild)):Dt=r),en(e,t,t.pendingProps.children,n),iu(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Je&&((r=s=Dt)&&(s=M3(s,t.type,t.pendingProps,$s),s!==null?(t.stateNode=s,un=t,Dt=bs(s.firstChild),$s=!1,r=!0):r=!1),r||ei(t)),ox(t),r=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,s=i.children,Yx(r,i)?s=null:o!==null&&Yx(r,o)&&(t.flags|=32),t.memoizedState!==null&&(r=op(e,t,Wk,null,null,n),cc._currentValue=r),iu(e,t),en(e,t,s,n),t.child;case 6:return e===null&&Je&&((e=n=Dt)&&(n=T3(n,t.pendingProps,$s),n!==null?(t.stateNode=n,un=t,Dt=null,e=!0):e=!1),e||ei(t)),null;case 13:return kj(e,t,n);case 4:return Su(t,t.stateNode.containerInfo),s=t.pendingProps,e===null?t.child=jo(t,null,s,n):en(e,t,s,n),t.child;case 11:return Ev(e,t,t.type,t.pendingProps,n);case 7:return en(e,t,t.pendingProps,n),t.child;case 8:return en(e,t,t.pendingProps.children,n),t.child;case 12:return en(e,t,t.pendingProps.children,n),t.child;case 10:return s=t.pendingProps,Xa(t,t.type,s.value),en(e,t,s.children,n),t.child;case 9:return r=t.type._context,s=t.pendingProps.children,ti(t),r=ln(r),s=s(r),t.flags|=1,en(e,t,s,n),t.child;case 14:return kv(e,t,t.type,t.pendingProps,n);case 15:return Cj(e,t,t.type,t.pendingProps,n);case 19:return Mj(e,t,n);case 31:return s=t.pendingProps,n=t.mode,s={mode:s.mode,children:s.children},e===null?(n=Hu(s,n),n.ref=t.ref,t.child=n,n.return=t,t=n):(n=pa(e.child,s),n.ref=t.ref,t.child=n,n.return=t,t=n),t;case 22:return Ej(e,t,n);case 24:return ti(t),s=ln(Yt),e===null?(r=sp(),r===null&&(r=ht,i=np(),r.pooledCache=i,i.refCount++,i!==null&&(r.pooledCacheLanes|=n),r=i),t.memoizedState={parent:s,cache:r},ap(t),Xa(t,Yt,r)):(e.lanes&n&&(Nx(e,t),Yl(t,null,null,n),Vl()),r=e.memoizedState,i=t.memoizedState,r.parent!==s?(r={parent:s,cache:s},t.memoizedState=r,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=r),Xa(t,Yt,s)):(s=i.cache,Xa(t,Yt,s),s!==r.cache&&yx(t,[Yt],n,!0))),en(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(oe(156,t.tag))}function na(e){e.flags|=4}function Ov(e,t){if(t.type!=="stylesheet"||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!vN(t)){if(t=is.current,t!==null&&((Ze&4194048)===Ze?Fs!==null:(Ze&62914560)!==Ze&&!(Ze&536870912)||t!==Fs))throw Hl=jx,z1;e.flags|=8192}}function Cd(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?t1():536870912,e.lanes|=t,No|=t)}function hl(e,t){if(!Je)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var s=null;n!==null;)n.alternate!==null&&(s=n),n=n.sibling;s===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:s.sibling=null}}function Et(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,s=0;if(t)for(var r=e.child;r!==null;)n|=r.lanes|r.childLanes,s|=r.subtreeFlags&65011712,s|=r.flags&65011712,r.return=e,r=r.sibling;else for(r=e.child;r!==null;)n|=r.lanes|r.childLanes,s|=r.subtreeFlags,s|=r.flags,r.return=e,r=r.sibling;return e.subtreeFlags|=s,e.childLanes=n,t}function t3(e,t,n){var s=t.pendingProps;switch(tp(t),t.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Et(t),null;case 1:return Et(t),null;case 3:return n=t.stateNode,s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),va(Yt),go(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(dl(t)?na(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,cv())),Et(t),null;case 26:return n=t.memoizedState,e===null?(na(t),n!==null?(Et(t),Ov(t,n)):(Et(t),t.flags&=-16777217)):n?n!==e.memoizedState?(na(t),Et(t),Ov(t,n)):(Et(t),t.flags&=-16777217):(e.memoizedProps!==s&&na(t),Et(t),t.flags&=-16777217),null;case 27:Cu(t),n=rr.current;var r=t.type;if(e!==null&&t.stateNode!=null)e.memoizedProps!==s&&na(t);else{if(!s){if(t.stateNode===null)throw Error(oe(166));return Et(t),null}e=Vs.current,dl(t)?ov(t):(e=xN(r,s,n),t.stateNode=e,na(t))}return Et(t),null;case 5:if(Cu(t),n=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&na(t);else{if(!s){if(t.stateNode===null)throw Error(oe(166));return Et(t),null}if(e=Vs.current,dl(t))ov(t);else{switch(r=qu(rr.current),e){case 1:e=r.createElementNS("http://www.w3.org/2000/svg",n);break;case 2:e=r.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;default:switch(n){case"svg":e=r.createElementNS("http://www.w3.org/2000/svg",n);break;case"math":e=r.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;case"script":e=r.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild);break;case"select":e=typeof s.is=="string"?r.createElement("select",{is:s.is}):r.createElement("select"),s.multiple?e.multiple=!0:s.size&&(e.size=s.size);break;default:e=typeof s.is=="string"?r.createElement(n,{is:s.is}):r.createElement(n)}}e[on]=t,e[Nn]=s;e:for(r=t.child;r!==null;){if(r.tag===5||r.tag===6)e.appendChild(r.stateNode);else if(r.tag!==4&&r.tag!==27&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break e;for(;r.sibling===null;){if(r.return===null||r.return===t)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}t.stateNode=e;e:switch(nn(e,n,s),n){case"button":case"input":case"select":case"textarea":e=!!s.autoFocus;break e;case"img":e=!0;break e;default:e=!1}e&&na(t)}}return Et(t),t.flags&=-16777217,null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==s&&na(t);else{if(typeof s!="string"&&t.stateNode===null)throw Error(oe(166));if(e=rr.current,dl(t)){if(e=t.stateNode,n=t.memoizedProps,s=null,r=un,r!==null)switch(r.tag){case 27:case 5:s=r.memoizedProps}e[on]=t,e=!!(e.nodeValue===n||s!==null&&s.suppressHydrationWarning===!0||hN(e.nodeValue,n)),e||ei(t)}else e=qu(e).createTextNode(s),e[on]=t,t.stateNode=e}return Et(t),null;case 13:if(s=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(r=dl(t),s!==null&&s.dehydrated!==null){if(e===null){if(!r)throw Error(oe(318));if(r=t.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(oe(317));r[on]=t}else Uc(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Et(t),r=!1}else r=cv(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),r=!0;if(!r)return t.flags&256?(ha(t),t):(ha(t),null)}if(ha(t),t.flags&128)return t.lanes=n,t;if(n=s!==null,e=e!==null&&e.memoizedState!==null,n){s=t.child,r=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(r=s.alternate.memoizedState.cachePool.pool);var i=null;s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(i=s.memoizedState.cachePool.pool),i!==r&&(s.flags|=2048)}return n!==e&&n&&(t.child.flags|=8192),Cd(t,t.updateQueue),Et(t),null;case 4:return go(),e===null&&Ep(t.stateNode.containerInfo),Et(t),null;case 10:return va(t.type),Et(t),null;case 19:if(Qt(It),r=t.memoizedState,r===null)return Et(t),null;if(s=(t.flags&128)!==0,i=r.rendering,i===null)if(s)hl(r,!1);else{if(At!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(i=$u(e),i!==null){for(t.flags|=128,hl(r,!1),e=i.updateQueue,t.updateQueue=e,Cd(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)D1(n,e),n=n.sibling;return Nt(It,It.current&1|2),t.child}e=e.sibling}r.tail!==null&&Ys()>Vu&&(t.flags|=128,s=!0,hl(r,!1),t.lanes=4194304)}else{if(!s)if(e=$u(i),e!==null){if(t.flags|=128,s=!0,e=e.updateQueue,t.updateQueue=e,Cd(t,e),hl(r,!0),r.tail===null&&r.tailMode==="hidden"&&!i.alternate&&!Je)return Et(t),null}else 2*Ys()-r.renderingStartTime>Vu&&n!==536870912&&(t.flags|=128,s=!0,hl(r,!1),t.lanes=4194304);r.isBackwards?(i.sibling=t.child,t.child=i):(e=r.last,e!==null?e.sibling=i:t.child=i,r.last=i)}return r.tail!==null?(t=r.tail,r.rendering=t,r.tail=t.sibling,r.renderingStartTime=Ys(),t.sibling=null,e=It.current,Nt(It,s?e&1|2:e&1),t):(Et(t),null);case 22:case 23:return ha(t),rp(),s=t.memoizedState!==null,e!==null?e.memoizedState!==null!==s&&(t.flags|=8192):s&&(t.flags|=8192),s?n&536870912&&!(t.flags&128)&&(Et(t),t.subtreeFlags&6&&(t.flags|=8192)):Et(t),n=t.updateQueue,n!==null&&Cd(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),s=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),s!==n&&(t.flags|=2048),e!==null&&Qt(qr),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),va(Yt),Et(t),null;case 25:return null;case 30:return null}throw Error(oe(156,t.tag))}function n3(e,t){switch(tp(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return va(Yt),go(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Cu(t),null;case 13:if(ha(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(oe(340));Uc()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Qt(It),null;case 4:return go(),null;case 10:return va(t.type),null;case 22:case 23:return ha(t),rp(),e!==null&&Qt(qr),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return va(Yt),null;case 25:return null;default:return null}}function Dj(e,t){switch(tp(t),t.tag){case 3:va(Yt),go();break;case 26:case 27:case 5:Cu(t);break;case 4:go();break;case 13:ha(t);break;case 19:Qt(It);break;case 10:va(t.type);break;case 22:case 23:ha(t),rp(),e!==null&&Qt(qr);break;case 24:va(Yt)}}function Vc(e,t){try{var n=t.updateQueue,s=n!==null?n.lastEffect:null;if(s!==null){var r=s.next;n=r;do{if((n.tag&e)===e){s=void 0;var i=n.create,o=n.inst;s=i(),o.destroy=s}n=n.next}while(n!==r)}}catch(l){ut(t,t.return,l)}}function pr(e,t,n){try{var s=t.updateQueue,r=s!==null?s.lastEffect:null;if(r!==null){var i=r.next;s=i;do{if((s.tag&e)===e){var o=s.inst,l=o.destroy;if(l!==void 0){o.destroy=void 0,r=t;var c=n,u=l;try{u()}catch(h){ut(r,c,h)}}}s=s.next}while(s!==i)}}catch(h){ut(t,t.return,h)}}function _j(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{$1(t,n)}catch(s){ut(e,e.return,s)}}}function Aj(e,t,n){n.props=si(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(s){ut(e,t,s)}}function Il(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var s=e.stateNode;break;case 30:s=e.stateNode;break;default:s=e.stateNode}typeof n=="function"?e.refCleanup=n(s):n.current=s}}catch(r){ut(e,t,r)}}function Ls(e,t){var n=e.ref,s=e.refCleanup;if(n!==null)if(typeof s=="function")try{s()}catch(r){ut(e,t,r)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(r){ut(e,t,r)}else n.current=null}function Oj(e){var t=e.type,n=e.memoizedProps,s=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&s.focus();break e;case"img":n.src?s.src=n.src:n.srcSet&&(s.srcset=n.srcSet)}}catch(r){ut(e,e.return,r)}}function am(e,t,n){try{var s=e.stateNode;N3(s,e.type,n,t),s[Nn]=t}catch(r){ut(e,e.return,r)}}function zj(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Cr(e.type)||e.tag===4}function rm(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||zj(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Cr(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Ox(e,t,n){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Ih));else if(s!==4&&(s===27&&Cr(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Ox(e,t,n),e=e.sibling;e!==null;)Ox(e,t,n),e=e.sibling}function Bu(e,t,n){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(s!==4&&(s===27&&Cr(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Bu(e,t,n),e=e.sibling;e!==null;)Bu(e,t,n),e=e.sibling}function Rj(e){var t=e.stateNode,n=e.memoizedProps;try{for(var s=e.type,r=t.attributes;r.length;)t.removeAttributeNode(r[0]);nn(t,s,n),t[on]=e,t[Nn]=n}catch(i){ut(e,e.return,i)}}var oa=!1,zt=!1,im=!1,zv=typeof WeakSet=="function"?WeakSet:Set,qt=null;function s3(e,t){if(e=e.containerInfo,Bx=Qu,e=j1(e),Zg(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var s=n.getSelection&&n.getSelection();if(s&&s.rangeCount!==0){n=s.anchorNode;var r=s.anchorOffset,i=s.focusNode;s=s.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var o=0,l=-1,c=-1,u=0,h=0,d=e,f=null;t:for(;;){for(var x;d!==n||r!==0&&d.nodeType!==3||(l=o+r),d!==i||s!==0&&d.nodeType!==3||(c=o+s),d.nodeType===3&&(o+=d.nodeValue.length),(x=d.firstChild)!==null;)f=d,d=x;for(;;){if(d===e)break t;if(f===n&&++u===r&&(l=o),f===i&&++h===s&&(c=o),(x=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=x}n=l===-1||c===-1?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(Vx={focusedElem:e,selectionRange:n},Qu=!1,qt=t;qt!==null;)if(t=qt,e=t.child,(t.subtreeFlags&1024)!==0&&e!==null)e.return=t,qt=e;else for(;qt!==null;){switch(t=qt,i=t.alternate,e=t.flags,t.tag){case 0:break;case 11:case 15:break;case 1:if(e&1024&&i!==null){e=void 0,n=t,r=i.memoizedProps,i=i.memoizedState,s=n.stateNode;try{var b=si(n.type,r,n.elementType===n.type);e=s.getSnapshotBeforeUpdate(b,i),s.__reactInternalSnapshotBeforeUpdate=e}catch(v){ut(n,n.return,v)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)Fx(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Fx(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(oe(163))}if(e=t.sibling,e!==null){e.return=t.return,qt=e;break}qt=t.return}}function Uj(e,t,n){var s=n.flags;switch(n.tag){case 0:case 11:case 15:Ra(e,n),s&4&&Vc(5,n);break;case 1:if(Ra(e,n),s&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(o){ut(n,n.return,o)}else{var r=si(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(r,t,e.__reactInternalSnapshotBeforeUpdate)}catch(o){ut(n,n.return,o)}}s&64&&_j(n),s&512&&Il(n,n.return);break;case 3:if(Ra(e,n),s&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{$1(e,t)}catch(o){ut(n,n.return,o)}}break;case 27:t===null&&s&4&&Rj(n);case 26:case 5:Ra(e,n),t===null&&s&4&&Oj(n),s&512&&Il(n,n.return);break;case 12:Ra(e,n);break;case 13:Ra(e,n),s&4&&Lj(e,n),s&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=h3.bind(null,n),D3(e,n))));break;case 22:if(s=n.memoizedState!==null||oa,!s){t=t!==null&&t.memoizedState!==null||zt,r=oa;var i=zt;oa=s,(zt=t)&&!i?Va(e,n,(n.subtreeFlags&8772)!==0):Ra(e,n),oa=r,zt=i}break;case 30:break;default:Ra(e,n)}}function $j(e){var t=e.alternate;t!==null&&(e.alternate=null,$j(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Fg(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var wt=null,vn=!1;function sa(e,t,n){for(n=n.child;n!==null;)Pj(e,t,n),n=n.sibling}function Pj(e,t,n){if(Hn&&typeof Hn.onCommitFiberUnmount=="function")try{Hn.onCommitFiberUnmount(_c,n)}catch{}switch(n.tag){case 26:zt||Ls(n,t),sa(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:zt||Ls(n,t);var s=wt,r=vn;Cr(n.type)&&(wt=n.stateNode,vn=!1),sa(e,t,n),Gl(n.stateNode),wt=s,vn=r;break;case 5:zt||Ls(n,t);case 6:if(s=wt,r=vn,wt=null,sa(e,t,n),wt=s,vn=r,wt!==null)if(vn)try{(wt.nodeType===9?wt.body:wt.nodeName==="HTML"?wt.ownerDocument.body:wt).removeChild(n.stateNode)}catch(i){ut(n,t,i)}else try{wt.removeChild(n.stateNode)}catch(i){ut(n,t,i)}break;case 18:wt!==null&&(vn?(e=wt,Wv(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),hc(e)):Wv(wt,n.stateNode));break;case 4:s=wt,r=vn,wt=n.stateNode.containerInfo,vn=!0,sa(e,t,n),wt=s,vn=r;break;case 0:case 11:case 14:case 15:zt||pr(2,n,t),zt||pr(4,n,t),sa(e,t,n);break;case 1:zt||(Ls(n,t),s=n.stateNode,typeof s.componentWillUnmount=="function"&&Aj(n,t,s)),sa(e,t,n);break;case 21:sa(e,t,n);break;case 22:zt=(s=zt)||n.memoizedState!==null,sa(e,t,n),zt=s;break;default:sa(e,t,n)}}function Lj(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{hc(e)}catch(n){ut(t,t.return,n)}}function a3(e){switch(e.tag){case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new zv),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new zv),t;default:throw Error(oe(435,e.tag))}}function om(e,t){var n=a3(e);t.forEach(function(s){var r=f3.bind(null,e,s);n.has(s)||(n.add(s),s.then(r,r))})}function En(e,t){var n=t.deletions;if(n!==null)for(var s=0;s<n.length;s++){var r=n[s],i=e,o=t,l=o;e:for(;l!==null;){switch(l.tag){case 27:if(Cr(l.type)){wt=l.stateNode,vn=!1;break e}break;case 5:wt=l.stateNode,vn=!1;break e;case 3:case 4:wt=l.stateNode.containerInfo,vn=!0;break e}l=l.return}if(wt===null)throw Error(oe(160));Pj(i,o,r),wt=null,vn=!1,i=r.alternate,i!==null&&(i.return=null),r.return=null}if(t.subtreeFlags&13878)for(t=t.child;t!==null;)Hj(t,e),t=t.sibling}var cs=null;function Hj(e,t){var n=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:En(t,e),kn(e),s&4&&(pr(3,e,e.return),Vc(3,e),pr(5,e,e.return));break;case 1:En(t,e),kn(e),s&512&&(zt||n===null||Ls(n,n.return)),s&64&&oa&&(e=e.updateQueue,e!==null&&(s=e.callbacks,s!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?s:n.concat(s))));break;case 26:var r=cs;if(En(t,e),kn(e),s&512&&(zt||n===null||Ls(n,n.return)),s&4){var i=n!==null?n.memoizedState:null;if(s=e.memoizedState,n===null)if(s===null)if(e.stateNode===null){e:{s=e.type,n=e.memoizedProps,r=r.ownerDocument||r;t:switch(s){case"title":i=r.getElementsByTagName("title")[0],(!i||i[zc]||i[on]||i.namespaceURI==="http://www.w3.org/2000/svg"||i.hasAttribute("itemprop"))&&(i=r.createElement(s),r.head.insertBefore(i,r.querySelector("head > title"))),nn(i,s,n),i[on]=e,Gt(i),s=i;break e;case"link":var o=Qv("link","href",r).get(s+(n.href||""));if(o){for(var l=0;l<o.length;l++)if(i=o[l],i.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&i.getAttribute("rel")===(n.rel==null?null:n.rel)&&i.getAttribute("title")===(n.title==null?null:n.title)&&i.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){o.splice(l,1);break t}}i=r.createElement(s),nn(i,s,n),r.head.appendChild(i);break;case"meta":if(o=Qv("meta","content",r).get(s+(n.content||""))){for(l=0;l<o.length;l++)if(i=o[l],i.getAttribute("content")===(n.content==null?null:""+n.content)&&i.getAttribute("name")===(n.name==null?null:n.name)&&i.getAttribute("property")===(n.property==null?null:n.property)&&i.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&i.getAttribute("charset")===(n.charSet==null?null:n.charSet)){o.splice(l,1);break t}}i=r.createElement(s),nn(i,s,n),r.head.appendChild(i);break;default:throw Error(oe(468,s))}i[on]=e,Gt(i),s=i}e.stateNode=s}else Kv(r,e.type,e.stateNode);else e.stateNode=Zv(r,s,e.memoizedProps);else i!==s?(i===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):i.count--,s===null?Kv(r,e.type,e.stateNode):Zv(r,s,e.memoizedProps)):s===null&&e.stateNode!==null&&am(e,e.memoizedProps,n.memoizedProps)}break;case 27:En(t,e),kn(e),s&512&&(zt||n===null||Ls(n,n.return)),n!==null&&s&4&&am(e,e.memoizedProps,n.memoizedProps);break;case 5:if(En(t,e),kn(e),s&512&&(zt||n===null||Ls(n,n.return)),e.flags&32){r=e.stateNode;try{vo(r,"")}catch(x){ut(e,e.return,x)}}s&4&&e.stateNode!=null&&(r=e.memoizedProps,am(e,r,n!==null?n.memoizedProps:r)),s&1024&&(im=!0);break;case 6:if(En(t,e),kn(e),s&4){if(e.stateNode===null)throw Error(oe(162));s=e.memoizedProps,n=e.stateNode;try{n.nodeValue=s}catch(x){ut(e,e.return,x)}}break;case 3:if(cu=null,r=cs,cs=Xu(t.containerInfo),En(t,e),cs=r,kn(e),s&4&&n!==null&&n.memoizedState.isDehydrated)try{hc(t.containerInfo)}catch(x){ut(e,e.return,x)}im&&(im=!1,Bj(e));break;case 4:s=cs,cs=Xu(e.stateNode.containerInfo),En(t,e),kn(e),cs=s;break;case 12:En(t,e),kn(e);break;case 13:En(t,e),kn(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Np=Ys()),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,om(e,s)));break;case 22:r=e.memoizedState!==null;var c=n!==null&&n.memoizedState!==null,u=oa,h=zt;if(oa=u||r,zt=h||c,En(t,e),zt=h,oa=u,kn(e),s&8192)e:for(t=e.stateNode,t._visibility=r?t._visibility&-2:t._visibility|1,r&&(n===null||c||oa||zt||Ur(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){c=n=t;try{if(i=c.stateNode,r)o=i.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none";else{l=c.stateNode;var d=c.memoizedProps.style,f=d!=null&&d.hasOwnProperty("display")?d.display:null;l.style.display=f==null||typeof f=="boolean"?"":(""+f).trim()}}catch(x){ut(c,c.return,x)}}}else if(t.tag===6){if(n===null){c=t;try{c.stateNode.nodeValue=r?"":c.memoizedProps}catch(x){ut(c,c.return,x)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}s&4&&(s=e.updateQueue,s!==null&&(n=s.retryQueue,n!==null&&(s.retryQueue=null,om(e,n))));break;case 19:En(t,e),kn(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,om(e,s)));break;case 30:break;case 21:break;default:En(t,e),kn(e)}}function kn(e){var t=e.flags;if(t&2){try{for(var n,s=e.return;s!==null;){if(zj(s)){n=s;break}s=s.return}if(n==null)throw Error(oe(160));switch(n.tag){case 27:var r=n.stateNode,i=rm(e);Bu(e,i,r);break;case 5:var o=n.stateNode;n.flags&32&&(vo(o,""),n.flags&=-33);var l=rm(e);Bu(e,l,o);break;case 3:case 4:var c=n.stateNode.containerInfo,u=rm(e);Ox(e,u,c);break;default:throw Error(oe(161))}}catch(h){ut(e,e.return,h)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Bj(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Bj(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Ra(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Uj(e,t.alternate,t),t=t.sibling}function Ur(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:pr(4,t,t.return),Ur(t);break;case 1:Ls(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&Aj(t,t.return,n),Ur(t);break;case 27:Gl(t.stateNode);case 26:case 5:Ls(t,t.return),Ur(t);break;case 22:t.memoizedState===null&&Ur(t);break;case 30:Ur(t);break;default:Ur(t)}e=e.sibling}}function Va(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var s=t.alternate,r=e,i=t,o=i.flags;switch(i.tag){case 0:case 11:case 15:Va(r,i,n),Vc(4,i);break;case 1:if(Va(r,i,n),s=i,r=s.stateNode,typeof r.componentDidMount=="function")try{r.componentDidMount()}catch(u){ut(s,s.return,u)}if(s=i,r=s.updateQueue,r!==null){var l=s.stateNode;try{var c=r.shared.hiddenCallbacks;if(c!==null)for(r.shared.hiddenCallbacks=null,r=0;r<c.length;r++)U1(c[r],l)}catch(u){ut(s,s.return,u)}}n&&o&64&&_j(i),Il(i,i.return);break;case 27:Rj(i);case 26:case 5:Va(r,i,n),n&&s===null&&o&4&&Oj(i),Il(i,i.return);break;case 12:Va(r,i,n);break;case 13:Va(r,i,n),n&&o&4&&Lj(r,i);break;case 22:i.memoizedState===null&&Va(r,i,n),Il(i,i.return);break;case 30:break;default:Va(r,i,n)}t=t.sibling}}function bp(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&Pc(n))}function yp(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Pc(e))}function Ds(e,t,n,s){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Vj(e,t,n,s),t=t.sibling}function Vj(e,t,n,s){var r=t.flags;switch(t.tag){case 0:case 11:case 15:Ds(e,t,n,s),r&2048&&Vc(9,t);break;case 1:Ds(e,t,n,s);break;case 3:Ds(e,t,n,s),r&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Pc(e)));break;case 12:if(r&2048){Ds(e,t,n,s),e=t.stateNode;try{var i=t.memoizedProps,o=i.id,l=i.onPostCommit;typeof l=="function"&&l(o,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(c){ut(t,t.return,c)}}else Ds(e,t,n,s);break;case 13:Ds(e,t,n,s);break;case 23:break;case 22:i=t.stateNode,o=t.alternate,t.memoizedState!==null?i._visibility&2?Ds(e,t,n,s):Wl(e,t):i._visibility&2?Ds(e,t,n,s):(i._visibility|=2,Ui(e,t,n,s,(t.subtreeFlags&10256)!==0)),r&2048&&bp(o,t);break;case 24:Ds(e,t,n,s),r&2048&&yp(t.alternate,t);break;default:Ds(e,t,n,s)}}function Ui(e,t,n,s,r){for(r=r&&(t.subtreeFlags&10256)!==0,t=t.child;t!==null;){var i=e,o=t,l=n,c=s,u=o.flags;switch(o.tag){case 0:case 11:case 15:Ui(i,o,l,c,r),Vc(8,o);break;case 23:break;case 22:var h=o.stateNode;o.memoizedState!==null?h._visibility&2?Ui(i,o,l,c,r):Wl(i,o):(h._visibility|=2,Ui(i,o,l,c,r)),r&&u&2048&&bp(o.alternate,o);break;case 24:Ui(i,o,l,c,r),r&&u&2048&&yp(o.alternate,o);break;default:Ui(i,o,l,c,r)}t=t.sibling}}function Wl(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,s=t,r=s.flags;switch(s.tag){case 22:Wl(n,s),r&2048&&bp(s.alternate,s);break;case 24:Wl(n,s),r&2048&&yp(s.alternate,s);break;default:Wl(n,s)}t=t.sibling}}var _l=8192;function Ei(e){if(e.subtreeFlags&_l)for(e=e.child;e!==null;)Yj(e),e=e.sibling}function Yj(e){switch(e.tag){case 26:Ei(e),e.flags&_l&&e.memoizedState!==null&&Y3(cs,e.memoizedState,e.memoizedProps);break;case 5:Ei(e);break;case 3:case 4:var t=cs;cs=Xu(e.stateNode.containerInfo),Ei(e),cs=t;break;case 22:e.memoizedState===null&&(t=e.alternate,t!==null&&t.memoizedState!==null?(t=_l,_l=16777216,Ei(e),_l=t):Ei(e));break;default:Ei(e)}}function Fj(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function fl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var s=t[n];qt=s,Wj(s,e)}Fj(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Ij(e),e=e.sibling}function Ij(e){switch(e.tag){case 0:case 11:case 15:fl(e),e.flags&2048&&pr(9,e,e.return);break;case 3:fl(e);break;case 12:fl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,ou(e)):fl(e);break;default:fl(e)}}function ou(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var s=t[n];qt=s,Wj(s,e)}Fj(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:pr(8,t,t.return),ou(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,ou(t));break;default:ou(t)}e=e.sibling}}function Wj(e,t){for(;qt!==null;){var n=qt;switch(n.tag){case 0:case 11:case 15:pr(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var s=n.memoizedState.cachePool.pool;s!=null&&s.refCount++}break;case 24:Pc(n.memoizedState.cache)}if(s=n.child,s!==null)s.return=n,qt=s;else e:for(n=e;qt!==null;){s=qt;var r=s.sibling,i=s.return;if($j(s),s===n){qt=null;break e}if(r!==null){r.return=i,qt=r;break e}qt=i}}}var r3={getCacheForType:function(e){var t=ln(Yt),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n}},i3=typeof WeakMap=="function"?WeakMap:Map,rt=0,ht=null,Ie=null,Ze=0,at=0,An=null,tr=!1,Fo=!1,wp=!1,Na=0,At=0,vr=0,Xr=0,jp=0,rs=0,No=0,ql=null,bn=null,zx=!1,Np=0,Vu=1/0,Yu=null,lr=null,tn=0,cr=null,So=null,oo=0,Rx=0,Ux=null,qj=null,Xl=0,$x=null;function Vn(){if(rt&2&&Ze!==0)return Ze&-Ze;if(Oe.T!==null){var e=bo;return e!==0?e:Cp()}return a1()}function Xj(){rs===0&&(rs=!(Ze&536870912)||Je?e1():536870912);var e=is.current;return e!==null&&(e.flags|=32),rs}function Yn(e,t,n){(e===ht&&(at===2||at===9)||e.cancelPendingCommit!==null)&&(Co(e,0),nr(e,Ze,rs,!1)),Oc(e,n),(!(rt&2)||e!==ht)&&(e===ht&&(!(rt&2)&&(Xr|=n),At===4&&nr(e,Ze,rs,!1)),Zs(e))}function Gj(e,t,n){if(rt&6)throw Error(oe(327));var s=!n&&(t&124)===0&&(t&e.expiredLanes)===0||Ac(e,t),r=s?c3(e,t):lm(e,t,!0),i=s;do{if(r===0){Fo&&!s&&nr(e,t,0,!1);break}else{if(n=e.current.alternate,i&&!o3(n)){r=lm(e,t,!1),i=!1;continue}if(r===2){if(i=t,e.errorRecoveryDisabledLanes&i)var o=0;else o=e.pendingLanes&-536870913,o=o!==0?o:o&536870912?536870912:0;if(o!==0){t=o;e:{var l=e;r=ql;var c=l.current.memoizedState.isDehydrated;if(c&&(Co(l,o).flags|=256),o=lm(l,o,!1),o!==2){if(wp&&!c){l.errorRecoveryDisabledLanes|=i,Xr|=i,r=4;break e}i=bn,bn=r,i!==null&&(bn===null?bn=i:bn.push.apply(bn,i))}r=o}if(i=!1,r!==2)continue}}if(r===1){Co(e,0),nr(e,t,0,!0);break}e:{switch(s=e,i=r,i){case 0:case 1:throw Error(oe(345));case 4:if((t&4194048)!==t)break;case 6:nr(s,t,rs,!tr);break e;case 2:bn=null;break;case 3:case 5:break;default:throw Error(oe(329))}if((t&62914560)===t&&(r=Np+300-Ys(),10<r)){if(nr(s,t,rs,!tr),Ah(s,0,!0)!==0)break e;s.timeoutHandle=mN(Rv.bind(null,s,n,bn,Yu,zx,t,rs,Xr,No,tr,i,2,-0,0),r);break e}Rv(s,n,bn,Yu,zx,t,rs,Xr,No,tr,i,0,-0,0)}}break}while(!0);Zs(e)}function Rv(e,t,n,s,r,i,o,l,c,u,h,d,f,x){if(e.timeoutHandle=-1,d=t.subtreeFlags,(d&8192||(d&16785408)===16785408)&&(lc={stylesheets:null,count:0,unsuspend:V3},Yj(t),d=F3(),d!==null)){e.cancelPendingCommit=d($v.bind(null,e,t,i,n,s,r,o,l,c,h,1,f,x)),nr(e,i,o,!u);return}$v(e,t,i,n,s,r,o,l,c)}function o3(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var s=0;s<n.length;s++){var r=n[s],i=r.getSnapshot;r=r.value;try{if(!In(i(),r))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function nr(e,t,n,s){t&=~jp,t&=~Xr,e.suspendedLanes|=t,e.pingedLanes&=~t,s&&(e.warmLanes|=t),s=e.expirationTimes;for(var r=t;0<r;){var i=31-Bn(r),o=1<<i;s[i]=-1,r&=~o}n!==0&&n1(e,n,t)}function Vh(){return rt&6?!0:(Yc(0),!1)}function Sp(){if(Ie!==null){if(at===0)var e=Ie.return;else e=Ie,ua=vi=null,dp(e),io=null,rc=0,e=Ie;for(;e!==null;)Dj(e.alternate,e),e=e.return;Ie=null}}function Co(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,C3(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Sp(),ht=e,Ie=n=pa(e.current,null),Ze=t,at=0,An=null,tr=!1,Fo=Ac(e,t),wp=!1,No=rs=jp=Xr=vr=At=0,bn=ql=null,zx=!1,t&8&&(t|=t&32);var s=e.entangledLanes;if(s!==0)for(e=e.entanglements,s&=t;0<s;){var r=31-Bn(s),i=1<<r;t|=e[r],s&=~i}return Na=t,Uh(),n}function Zj(e,t){Ye=null,Oe.H=Uu,t===Lc||t===Ph?(t=fv(),at=3):t===z1?(t=fv(),at=4):at=t===Sj?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,An=t,Ie===null&&(At=1,Lu(e,as(t,e.current)))}function Qj(){var e=Oe.H;return Oe.H=Uu,e===null?Uu:e}function Kj(){var e=Oe.A;return Oe.A=r3,e}function Px(){At=4,tr||(Ze&4194048)!==Ze&&is.current!==null||(Fo=!0),!(vr&134217727)&&!(Xr&134217727)||ht===null||nr(ht,Ze,rs,!1)}function lm(e,t,n){var s=rt;rt|=2;var r=Qj(),i=Kj();(ht!==e||Ze!==t)&&(Yu=null,Co(e,t)),t=!1;var o=At;e:do try{if(at!==0&&Ie!==null){var l=Ie,c=An;switch(at){case 8:Sp(),o=6;break e;case 3:case 2:case 9:case 6:is.current===null&&(t=!0);var u=at;if(at=0,An=null,Qi(e,l,c,u),n&&Fo){o=0;break e}break;default:u=at,at=0,An=null,Qi(e,l,c,u)}}l3(),o=At;break}catch(h){Zj(e,h)}while(!0);return t&&e.shellSuspendCounter++,ua=vi=null,rt=s,Oe.H=r,Oe.A=i,Ie===null&&(ht=null,Ze=0,Uh()),o}function l3(){for(;Ie!==null;)Jj(Ie)}function c3(e,t){var n=rt;rt|=2;var s=Qj(),r=Kj();ht!==e||Ze!==t?(Yu=null,Vu=Ys()+500,Co(e,t)):Fo=Ac(e,t);e:do try{if(at!==0&&Ie!==null){t=Ie;var i=An;t:switch(at){case 1:at=0,An=null,Qi(e,t,i,1);break;case 2:case 9:if(hv(i)){at=0,An=null,Uv(t);break}t=function(){at!==2&&at!==9||ht!==e||(at=7),Zs(e)},i.then(t,t);break e;case 3:at=7;break e;case 4:at=5;break e;case 7:hv(i)?(at=0,An=null,Uv(t)):(at=0,An=null,Qi(e,t,i,7));break;case 5:var o=null;switch(Ie.tag){case 26:o=Ie.memoizedState;case 5:case 27:var l=Ie;if(!o||vN(o)){at=0,An=null;var c=l.sibling;if(c!==null)Ie=c;else{var u=l.return;u!==null?(Ie=u,Yh(u)):Ie=null}break t}}at=0,An=null,Qi(e,t,i,5);break;case 6:at=0,An=null,Qi(e,t,i,6);break;case 8:Sp(),At=6;break e;default:throw Error(oe(462))}}d3();break}catch(h){Zj(e,h)}while(!0);return ua=vi=null,Oe.H=s,Oe.A=r,rt=n,Ie!==null?0:(ht=null,Ze=0,Uh(),At)}function d3(){for(;Ie!==null&&!AE();)Jj(Ie)}function Jj(e){var t=Tj(e.alternate,e,Na);e.memoizedProps=e.pendingProps,t===null?Yh(e):Ie=t}function Uv(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Tv(n,t,t.pendingProps,t.type,void 0,Ze);break;case 11:t=Tv(n,t,t.pendingProps,t.type.render,t.ref,Ze);break;case 5:dp(t);default:Dj(n,t),t=Ie=D1(t,Na),t=Tj(n,t,Na)}e.memoizedProps=e.pendingProps,t===null?Yh(e):Ie=t}function Qi(e,t,n,s){ua=vi=null,dp(t),io=null,rc=0;var r=t.return;try{if(Jk(e,r,t,n,Ze)){At=1,Lu(e,as(n,e.current)),Ie=null;return}}catch(i){if(r!==null)throw Ie=r,i;At=1,Lu(e,as(n,e.current)),Ie=null;return}t.flags&32768?(Je||s===1?e=!0:Fo||Ze&536870912?e=!1:(tr=e=!0,(s===2||s===9||s===3||s===6)&&(s=is.current,s!==null&&s.tag===13&&(s.flags|=16384))),eN(t,e)):Yh(t)}function Yh(e){var t=e;do{if(t.flags&32768){eN(t,tr);return}e=t.return;var n=t3(t.alternate,t,Na);if(n!==null){Ie=n;return}if(t=t.sibling,t!==null){Ie=t;return}Ie=t=e}while(t!==null);At===0&&(At=5)}function eN(e,t){do{var n=n3(e.alternate,e);if(n!==null){n.flags&=32767,Ie=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Ie=e;return}Ie=e=n}while(e!==null);At=6,Ie=null}function $v(e,t,n,s,r,i,o,l,c){e.cancelPendingCommit=null;do Fh();while(tn!==0);if(rt&6)throw Error(oe(327));if(t!==null){if(t===e.current)throw Error(oe(177));if(i=t.lanes|t.childLanes,i|=Qg,VE(e,n,i,o,l,c),e===ht&&(Ie=ht=null,Ze=0),So=t,cr=e,oo=n,Rx=i,Ux=r,qj=s,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,m3(Eu,function(){return rN(),null})):(e.callbackNode=null,e.callbackPriority=0),s=(t.flags&13878)!==0,t.subtreeFlags&13878||s){s=Oe.T,Oe.T=null,r=et.p,et.p=2,o=rt,rt|=4;try{s3(e,t,n)}finally{rt=o,et.p=r,Oe.T=s}}tn=1,tN(),nN(),sN()}}function tN(){if(tn===1){tn=0;var e=cr,t=So,n=(t.flags&13878)!==0;if(t.subtreeFlags&13878||n){n=Oe.T,Oe.T=null;var s=et.p;et.p=2;var r=rt;rt|=4;try{Hj(t,e);var i=Vx,o=j1(e.containerInfo),l=i.focusedElem,c=i.selectionRange;if(o!==l&&l&&l.ownerDocument&&w1(l.ownerDocument.documentElement,l)){if(c!==null&&Zg(l)){var u=c.start,h=c.end;if(h===void 0&&(h=u),"selectionStart"in l)l.selectionStart=u,l.selectionEnd=Math.min(h,l.value.length);else{var d=l.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var x=f.getSelection(),b=l.textContent.length,v=Math.min(c.start,b),j=c.end===void 0?v:Math.min(c.end,b);!x.extend&&v>j&&(o=j,j=v,v=o);var g=av(l,v),y=av(l,j);if(g&&y&&(x.rangeCount!==1||x.anchorNode!==g.node||x.anchorOffset!==g.offset||x.focusNode!==y.node||x.focusOffset!==y.offset)){var p=d.createRange();p.setStart(g.node,g.offset),x.removeAllRanges(),v>j?(x.addRange(p),x.extend(y.node,y.offset)):(p.setEnd(y.node,y.offset),x.addRange(p))}}}}for(d=[],x=l;x=x.parentNode;)x.nodeType===1&&d.push({element:x,left:x.scrollLeft,top:x.scrollTop});for(typeof l.focus=="function"&&l.focus(),l=0;l<d.length;l++){var w=d[l];w.element.scrollLeft=w.left,w.element.scrollTop=w.top}}Qu=!!Bx,Vx=Bx=null}finally{rt=r,et.p=s,Oe.T=n}}e.current=t,tn=2}}function nN(){if(tn===2){tn=0;var e=cr,t=So,n=(t.flags&8772)!==0;if(t.subtreeFlags&8772||n){n=Oe.T,Oe.T=null;var s=et.p;et.p=2;var r=rt;rt|=4;try{Uj(e,t.alternate,t)}finally{rt=r,et.p=s,Oe.T=n}}tn=3}}function sN(){if(tn===4||tn===3){tn=0,OE();var e=cr,t=So,n=oo,s=qj;t.subtreeFlags&10256||t.flags&10256?tn=5:(tn=0,So=cr=null,aN(e,e.pendingLanes));var r=e.pendingLanes;if(r===0&&(lr=null),Yg(n),t=t.stateNode,Hn&&typeof Hn.onCommitFiberRoot=="function")try{Hn.onCommitFiberRoot(_c,t,void 0,(t.current.flags&128)===128)}catch{}if(s!==null){t=Oe.T,r=et.p,et.p=2,Oe.T=null;try{for(var i=e.onRecoverableError,o=0;o<s.length;o++){var l=s[o];i(l.value,{componentStack:l.stack})}}finally{Oe.T=t,et.p=r}}oo&3&&Fh(),Zs(e),r=e.pendingLanes,n&4194090&&r&42?e===$x?Xl++:(Xl=0,$x=e):Xl=0,Yc(0)}}function aN(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Pc(t)))}function Fh(e){return tN(),nN(),sN(),rN()}function rN(){if(tn!==5)return!1;var e=cr,t=Rx;Rx=0;var n=Yg(oo),s=Oe.T,r=et.p;try{et.p=32>n?32:n,Oe.T=null,n=Ux,Ux=null;var i=cr,o=oo;if(tn=0,So=cr=null,oo=0,rt&6)throw Error(oe(331));var l=rt;if(rt|=4,Ij(i.current),Vj(i,i.current,o,n),rt=l,Yc(0,!1),Hn&&typeof Hn.onPostCommitFiberRoot=="function")try{Hn.onPostCommitFiberRoot(_c,i)}catch{}return!0}finally{et.p=r,Oe.T=s,aN(e,t)}}function Pv(e,t,n){t=as(n,t),t=Dx(e.stateNode,t,2),e=or(e,t,2),e!==null&&(Oc(e,2),Zs(e))}function ut(e,t,n){if(e.tag===3)Pv(e,e,n);else for(;t!==null;){if(t.tag===3){Pv(t,e,n);break}else if(t.tag===1){var s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(lr===null||!lr.has(s))){e=as(n,e),n=jj(2),s=or(t,n,2),s!==null&&(Nj(n,s,t,e),Oc(s,2),Zs(s));break}}t=t.return}}function cm(e,t,n){var s=e.pingCache;if(s===null){s=e.pingCache=new i3;var r=new Set;s.set(t,r)}else r=s.get(t),r===void 0&&(r=new Set,s.set(t,r));r.has(n)||(wp=!0,r.add(n),e=u3.bind(null,e,t,n),t.then(e,e))}function u3(e,t,n){var s=e.pingCache;s!==null&&s.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,ht===e&&(Ze&n)===n&&(At===4||At===3&&(Ze&62914560)===Ze&&300>Ys()-Np?!(rt&2)&&Co(e,0):jp|=n,No===Ze&&(No=0)),Zs(e)}function iN(e,t){t===0&&(t=t1()),e=Yo(e,t),e!==null&&(Oc(e,t),Zs(e))}function h3(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),iN(e,n)}function f3(e,t){var n=0;switch(e.tag){case 13:var s=e.stateNode,r=e.memoizedState;r!==null&&(n=r.retryLane);break;case 19:s=e.stateNode;break;case 22:s=e.stateNode._retryCache;break;default:throw Error(oe(314))}s!==null&&s.delete(t),iN(e,n)}function m3(e,t){return Bg(e,t)}var Fu=null,$i=null,Lx=!1,Iu=!1,dm=!1,Gr=0;function Zs(e){e!==$i&&e.next===null&&($i===null?Fu=$i=e:$i=$i.next=e),Iu=!0,Lx||(Lx=!0,g3())}function Yc(e,t){if(!dm&&Iu){dm=!0;do for(var n=!1,s=Fu;s!==null;){if(e!==0){var r=s.pendingLanes;if(r===0)var i=0;else{var o=s.suspendedLanes,l=s.pingedLanes;i=(1<<31-Bn(42|e)+1)-1,i&=r&~(o&~l),i=i&201326741?i&201326741|1:i?i|2:0}i!==0&&(n=!0,Lv(s,i))}else i=Ze,i=Ah(s,s===ht?i:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),!(i&3)||Ac(s,i)||(n=!0,Lv(s,i));s=s.next}while(n);dm=!1}}function x3(){oN()}function oN(){Iu=Lx=!1;var e=0;Gr!==0&&(S3()&&(e=Gr),Gr=0);for(var t=Ys(),n=null,s=Fu;s!==null;){var r=s.next,i=lN(s,t);i===0?(s.next=null,n===null?Fu=r:n.next=r,r===null&&($i=n)):(n=s,(e!==0||i&3)&&(Iu=!0)),s=r}Yc(e)}function lN(e,t){for(var n=e.suspendedLanes,s=e.pingedLanes,r=e.expirationTimes,i=e.pendingLanes&-62914561;0<i;){var o=31-Bn(i),l=1<<o,c=r[o];c===-1?(!(l&n)||l&s)&&(r[o]=BE(l,t)):c<=t&&(e.expiredLanes|=l),i&=~l}if(t=ht,n=Ze,n=Ah(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s=e.callbackNode,n===0||e===t&&(at===2||at===9)||e.cancelPendingCommit!==null)return s!==null&&s!==null&&Uf(s),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Ac(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(s!==null&&Uf(s),Yg(n)){case 2:case 8:n=Kw;break;case 32:n=Eu;break;case 268435456:n=Jw;break;default:n=Eu}return s=cN.bind(null,e),n=Bg(n,s),e.callbackPriority=t,e.callbackNode=n,t}return s!==null&&s!==null&&Uf(s),e.callbackPriority=2,e.callbackNode=null,2}function cN(e,t){if(tn!==0&&tn!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Fh()&&e.callbackNode!==n)return null;var s=Ze;return s=Ah(e,e===ht?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s===0?null:(Gj(e,s,t),lN(e,Ys()),e.callbackNode!=null&&e.callbackNode===n?cN.bind(null,e):null)}function Lv(e,t){if(Fh())return null;Gj(e,t,!0)}function g3(){E3(function(){rt&6?Bg(Qw,x3):oN()})}function Cp(){return Gr===0&&(Gr=e1()),Gr}function Hv(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Jd(""+e)}function Bv(e,t){var n=t.ownerDocument.createElement("input");return n.name=t.name,n.value=t.value,e.id&&n.setAttribute("form",e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function p3(e,t,n,s,r){if(t==="submit"&&n&&n.stateNode===r){var i=Hv((r[Nn]||null).action),o=s.submitter;o&&(t=(t=o[Nn]||null)?Hv(t.formAction):o.getAttribute("formAction"),t!==null&&(i=t,o=null));var l=new Oh("action","action",null,s,r);e.push({event:l,listeners:[{instance:null,listener:function(){if(s.defaultPrevented){if(Gr!==0){var c=o?Bv(r,o):new FormData(r);Mx(n,{pending:!0,data:c,method:r.method,action:i},null,c)}}else typeof i=="function"&&(l.preventDefault(),c=o?Bv(r,o):new FormData(r),Mx(n,{pending:!0,data:c,method:r.method,action:i},i,c))},currentTarget:r}]})}}for(var um=0;um<gx.length;um++){var hm=gx[um],v3=hm.toLowerCase(),b3=hm[0].toUpperCase()+hm.slice(1);Ss(v3,"on"+b3)}Ss(S1,"onAnimationEnd");Ss(C1,"onAnimationIteration");Ss(E1,"onAnimationStart");Ss("dblclick","onDoubleClick");Ss("focusin","onFocus");Ss("focusout","onBlur");Ss(Uk,"onTransitionRun");Ss($k,"onTransitionStart");Ss(Pk,"onTransitionCancel");Ss(k1,"onTransitionEnd");po("onMouseEnter",["mouseout","mouseover"]);po("onMouseLeave",["mouseout","mouseover"]);po("onPointerEnter",["pointerout","pointerover"]);po("onPointerLeave",["pointerout","pointerover"]);xi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));xi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));xi("onBeforeInput",["compositionend","keypress","textInput","paste"]);xi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));xi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));xi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ic="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(" "),y3=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(ic));function dN(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var s=e[n],r=s.event;s=s.listeners;e:{var i=void 0;if(t)for(var o=s.length-1;0<=o;o--){var l=s[o],c=l.instance,u=l.currentTarget;if(l=l.listener,c!==i&&r.isPropagationStopped())break e;i=l,r.currentTarget=u;try{i(r)}catch(h){Pu(h)}r.currentTarget=null,i=c}else for(o=0;o<s.length;o++){if(l=s[o],c=l.instance,u=l.currentTarget,l=l.listener,c!==i&&r.isPropagationStopped())break e;i=l,r.currentTarget=u;try{i(r)}catch(h){Pu(h)}r.currentTarget=null,i=c}}}}function Fe(e,t){var n=t[cx];n===void 0&&(n=t[cx]=new Set);var s=e+"__bubble";n.has(s)||(uN(t,e,2,!1),n.add(s))}function fm(e,t,n){var s=0;t&&(s|=4),uN(n,e,s,t)}var Ed="_reactListening"+Math.random().toString(36).slice(2);function Ep(e){if(!e[Ed]){e[Ed]=!0,r1.forEach(function(n){n!=="selectionchange"&&(y3.has(n)||fm(n,!1,e),fm(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ed]||(t[Ed]=!0,fm("selectionchange",!1,t))}}function uN(e,t,n,s){switch(NN(t)){case 2:var r=q3;break;case 8:r=X3;break;default:r=Dp}n=r.bind(null,t,n,e),r=void 0,!fx||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(r=!0),s?r!==void 0?e.addEventListener(t,n,{capture:!0,passive:r}):e.addEventListener(t,n,!0):r!==void 0?e.addEventListener(t,n,{passive:r}):e.addEventListener(t,n,!1)}function mm(e,t,n,s,r){var i=s;if(!(t&1)&&!(t&2)&&s!==null)e:for(;;){if(s===null)return;var o=s.tag;if(o===3||o===4){var l=s.stateNode.containerInfo;if(l===r)break;if(o===4)for(o=s.return;o!==null;){var c=o.tag;if((c===3||c===4)&&o.stateNode.containerInfo===r)return;o=o.return}for(;l!==null;){if(o=Vi(l),o===null)return;if(c=o.tag,c===5||c===6||c===26||c===27){s=i=o;continue e}l=l.parentNode}}s=s.return}f1(function(){var u=i,h=Wg(n),d=[];e:{var f=M1.get(e);if(f!==void 0){var x=Oh,b=e;switch(e){case"keypress":if(tu(n)===0)break e;case"keydown":case"keyup":x=mk;break;case"focusin":b="focus",x=Ff;break;case"focusout":b="blur",x=Ff;break;case"beforeblur":case"afterblur":x=Ff;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":x=X0;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":x=nk;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":x=pk;break;case S1:case C1:case E1:x=rk;break;case k1:x=bk;break;case"scroll":case"scrollend":x=ek;break;case"wheel":x=wk;break;case"copy":case"cut":case"paste":x=ok;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":x=Z0;break;case"toggle":case"beforetoggle":x=Nk}var v=(t&4)!==0,j=!v&&(e==="scroll"||e==="scrollend"),g=v?f!==null?f+"Capture":null:f;v=[];for(var y=u,p;y!==null;){var w=y;if(p=w.stateNode,w=w.tag,w!==5&&w!==26&&w!==27||p===null||g===null||(w=ec(y,g),w!=null&&v.push(oc(y,w,p))),j)break;y=y.return}0<v.length&&(f=new x(f,b,null,n,h),d.push({event:f,listeners:v}))}}if(!(t&7)){e:{if(f=e==="mouseover"||e==="pointerover",x=e==="mouseout"||e==="pointerout",f&&n!==hx&&(b=n.relatedTarget||n.fromElement)&&(Vi(b)||b[Bo]))break e;if((x||f)&&(f=h.window===h?h:(f=h.ownerDocument)?f.defaultView||f.parentWindow:window,x?(b=n.relatedTarget||n.toElement,x=u,b=b?Vi(b):null,b!==null&&(j=Dc(b),v=b.tag,b!==j||v!==5&&v!==27&&v!==6)&&(b=null)):(x=null,b=u),x!==b)){if(v=X0,w="onMouseLeave",g="onMouseEnter",y="mouse",(e==="pointerout"||e==="pointerover")&&(v=Z0,w="onPointerLeave",g="onPointerEnter",y="pointer"),j=x==null?f:Dl(x),p=b==null?f:Dl(b),f=new v(w,y+"leave",x,n,h),f.target=j,f.relatedTarget=p,w=null,Vi(h)===u&&(v=new v(g,y+"enter",b,n,h),v.target=p,v.relatedTarget=j,w=v),j=w,x&&b)t:{for(v=x,g=b,y=0,p=v;p;p=ki(p))y++;for(p=0,w=g;w;w=ki(w))p++;for(;0<y-p;)v=ki(v),y--;for(;0<p-y;)g=ki(g),p--;for(;y--;){if(v===g||g!==null&&v===g.alternate)break t;v=ki(v),g=ki(g)}v=null}else v=null;x!==null&&Vv(d,f,x,v,!1),b!==null&&j!==null&&Vv(d,j,b,v,!0)}}e:{if(f=u?Dl(u):window,x=f.nodeName&&f.nodeName.toLowerCase(),x==="select"||x==="input"&&f.type==="file")var N=ev;else if(J0(f))if(b1)N=Ok;else{N=_k;var S=Dk}else x=f.nodeName,!x||x.toLowerCase()!=="input"||f.type!=="checkbox"&&f.type!=="radio"?u&&Ig(u.elementType)&&(N=ev):N=Ak;if(N&&(N=N(e,u))){v1(d,N,n,h);break e}S&&S(e,f,u),e==="focusout"&&u&&f.type==="number"&&u.memoizedProps.value!=null&&ux(f,"number",f.value)}switch(S=u?Dl(u):window,e){case"focusin":(J0(S)||S.contentEditable==="true")&&(Ii=S,mx=u,Pl=null);break;case"focusout":Pl=mx=Ii=null;break;case"mousedown":xx=!0;break;case"contextmenu":case"mouseup":case"dragend":xx=!1,rv(d,n,h);break;case"selectionchange":if(Rk)break;case"keydown":case"keyup":rv(d,n,h)}var C;if(Gg)e:{switch(e){case"compositionstart":var T="onCompositionStart";break e;case"compositionend":T="onCompositionEnd";break e;case"compositionupdate":T="onCompositionUpdate";break e}T=void 0}else Fi?g1(e,n)&&(T="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(T="onCompositionStart");T&&(x1&&n.locale!=="ko"&&(Fi||T!=="onCompositionStart"?T==="onCompositionEnd"&&Fi&&(C=m1()):(er=h,qg="value"in er?er.value:er.textContent,Fi=!0)),S=Wu(u,T),0<S.length&&(T=new G0(T,e,null,n,h),d.push({event:T,listeners:S}),C?T.data=C:(C=p1(n),C!==null&&(T.data=C)))),(C=Ck?Ek(e,n):kk(e,n))&&(T=Wu(u,"onBeforeInput"),0<T.length&&(S=new G0("onBeforeInput","beforeinput",null,n,h),d.push({event:S,listeners:T}),S.data=C)),p3(d,e,u,n,h)}dN(d,t)})}function oc(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Wu(e,t){for(var n=t+"Capture",s=[];e!==null;){var r=e,i=r.stateNode;if(r=r.tag,r!==5&&r!==26&&r!==27||i===null||(r=ec(e,n),r!=null&&s.unshift(oc(e,r,i)),r=ec(e,t),r!=null&&s.push(oc(e,r,i))),e.tag===3)return s;e=e.return}return[]}function ki(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Vv(e,t,n,s,r){for(var i=t._reactName,o=[];n!==null&&n!==s;){var l=n,c=l.alternate,u=l.stateNode;if(l=l.tag,c!==null&&c===s)break;l!==5&&l!==26&&l!==27||u===null||(c=u,r?(u=ec(n,i),u!=null&&o.unshift(oc(n,u,c))):r||(u=ec(n,i),u!=null&&o.push(oc(n,u,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var w3=/\r\n?/g,j3=/\u0000|\uFFFD/g;function Yv(e){return(typeof e=="string"?e:""+e).replace(w3,`
49
- `).replace(j3,"")}function hN(e,t){return t=Yv(t),Yv(e)===t}function Ih(){}function it(e,t,n,s,r,i){switch(n){case"children":typeof s=="string"?t==="body"||t==="textarea"&&s===""||vo(e,s):(typeof s=="number"||typeof s=="bigint")&&t!=="body"&&vo(e,""+s);break;case"className":bd(e,"class",s);break;case"tabIndex":bd(e,"tabindex",s);break;case"dir":case"role":case"viewBox":case"width":case"height":bd(e,n,s);break;case"style":h1(e,s,i);break;case"data":if(t!=="object"){bd(e,"data",s);break}case"src":case"href":if(s===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(s==null||typeof s=="function"||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(n);break}s=Jd(""+s),e.setAttribute(n,s);break;case"action":case"formAction":if(typeof s=="function"){e.setAttribute(n,"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 i=="function"&&(n==="formAction"?(t!=="input"&&it(e,t,"name",r.name,r,null),it(e,t,"formEncType",r.formEncType,r,null),it(e,t,"formMethod",r.formMethod,r,null),it(e,t,"formTarget",r.formTarget,r,null)):(it(e,t,"encType",r.encType,r,null),it(e,t,"method",r.method,r,null),it(e,t,"target",r.target,r,null)));if(s==null||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(n);break}s=Jd(""+s),e.setAttribute(n,s);break;case"onClick":s!=null&&(e.onclick=Ih);break;case"onScroll":s!=null&&Fe("scroll",e);break;case"onScrollEnd":s!=null&&Fe("scrollend",e);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(oe(61));if(n=s.__html,n!=null){if(r.children!=null)throw Error(oe(60));e.innerHTML=n}}break;case"multiple":e.multiple=s&&typeof s!="function"&&typeof s!="symbol";break;case"muted":e.muted=s&&typeof s!="function"&&typeof s!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(s==null||typeof s=="function"||typeof s=="boolean"||typeof s=="symbol"){e.removeAttribute("xlink:href");break}n=Jd(""+s),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(n,""+s):e.removeAttribute(n);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":s&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":s===!0?e.setAttribute(n,""):s!==!1&&s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(n,s):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":s!=null&&typeof s!="function"&&typeof s!="symbol"&&!isNaN(s)&&1<=s?e.setAttribute(n,s):e.removeAttribute(n);break;case"rowSpan":case"start":s==null||typeof s=="function"||typeof s=="symbol"||isNaN(s)?e.removeAttribute(n):e.setAttribute(n,s);break;case"popover":Fe("beforetoggle",e),Fe("toggle",e),Kd(e,"popover",s);break;case"xlinkActuate":ta(e,"http://www.w3.org/1999/xlink","xlink:actuate",s);break;case"xlinkArcrole":ta(e,"http://www.w3.org/1999/xlink","xlink:arcrole",s);break;case"xlinkRole":ta(e,"http://www.w3.org/1999/xlink","xlink:role",s);break;case"xlinkShow":ta(e,"http://www.w3.org/1999/xlink","xlink:show",s);break;case"xlinkTitle":ta(e,"http://www.w3.org/1999/xlink","xlink:title",s);break;case"xlinkType":ta(e,"http://www.w3.org/1999/xlink","xlink:type",s);break;case"xmlBase":ta(e,"http://www.w3.org/XML/1998/namespace","xml:base",s);break;case"xmlLang":ta(e,"http://www.w3.org/XML/1998/namespace","xml:lang",s);break;case"xmlSpace":ta(e,"http://www.w3.org/XML/1998/namespace","xml:space",s);break;case"is":Kd(e,"is",s);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=KE.get(n)||n,Kd(e,n,s))}}function Hx(e,t,n,s,r,i){switch(n){case"style":h1(e,s,i);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(oe(61));if(n=s.__html,n!=null){if(r.children!=null)throw Error(oe(60));e.innerHTML=n}}break;case"children":typeof s=="string"?vo(e,s):(typeof s=="number"||typeof s=="bigint")&&vo(e,""+s);break;case"onScroll":s!=null&&Fe("scroll",e);break;case"onScrollEnd":s!=null&&Fe("scrollend",e);break;case"onClick":s!=null&&(e.onclick=Ih);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!i1.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(r=n.endsWith("Capture"),t=n.slice(2,r?n.length-7:void 0),i=e[Nn]||null,i=i!=null?i[n]:null,typeof i=="function"&&e.removeEventListener(t,i,r),typeof s=="function")){typeof i!="function"&&i!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,s,r);break e}n in e?e[n]=s:s===!0?e.setAttribute(n,""):Kd(e,n,s)}}}function nn(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Fe("error",e),Fe("load",e);var s=!1,r=!1,i;for(i in n)if(n.hasOwnProperty(i)){var o=n[i];if(o!=null)switch(i){case"src":s=!0;break;case"srcSet":r=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(oe(137,t));default:it(e,t,i,o,n,null)}}r&&it(e,t,"srcSet",n.srcSet,n,null),s&&it(e,t,"src",n.src,n,null);return;case"input":Fe("invalid",e);var l=i=o=r=null,c=null,u=null;for(s in n)if(n.hasOwnProperty(s)){var h=n[s];if(h!=null)switch(s){case"name":r=h;break;case"type":o=h;break;case"checked":c=h;break;case"defaultChecked":u=h;break;case"value":i=h;break;case"defaultValue":l=h;break;case"children":case"dangerouslySetInnerHTML":if(h!=null)throw Error(oe(137,t));break;default:it(e,t,s,h,n,null)}}c1(e,i,l,c,u,o,r,!1),ku(e);return;case"select":Fe("invalid",e),s=o=i=null;for(r in n)if(n.hasOwnProperty(r)&&(l=n[r],l!=null))switch(r){case"value":i=l;break;case"defaultValue":o=l;break;case"multiple":s=l;default:it(e,t,r,l,n,null)}t=i,n=o,e.multiple=!!s,t!=null?to(e,!!s,t,!1):n!=null&&to(e,!!s,n,!0);return;case"textarea":Fe("invalid",e),i=r=s=null;for(o in n)if(n.hasOwnProperty(o)&&(l=n[o],l!=null))switch(o){case"value":s=l;break;case"defaultValue":r=l;break;case"children":i=l;break;case"dangerouslySetInnerHTML":if(l!=null)throw Error(oe(91));break;default:it(e,t,o,l,n,null)}u1(e,s,r,i),ku(e);return;case"option":for(c in n)if(n.hasOwnProperty(c)&&(s=n[c],s!=null))switch(c){case"selected":e.selected=s&&typeof s!="function"&&typeof s!="symbol";break;default:it(e,t,c,s,n,null)}return;case"dialog":Fe("beforetoggle",e),Fe("toggle",e),Fe("cancel",e),Fe("close",e);break;case"iframe":case"object":Fe("load",e);break;case"video":case"audio":for(s=0;s<ic.length;s++)Fe(ic[s],e);break;case"image":Fe("error",e),Fe("load",e);break;case"details":Fe("toggle",e);break;case"embed":case"source":case"link":Fe("error",e),Fe("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(u in n)if(n.hasOwnProperty(u)&&(s=n[u],s!=null))switch(u){case"children":case"dangerouslySetInnerHTML":throw Error(oe(137,t));default:it(e,t,u,s,n,null)}return;default:if(Ig(t)){for(h in n)n.hasOwnProperty(h)&&(s=n[h],s!==void 0&&Hx(e,t,h,s,n,void 0));return}}for(l in n)n.hasOwnProperty(l)&&(s=n[l],s!=null&&it(e,t,l,s,n,null))}function N3(e,t,n,s){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var r=null,i=null,o=null,l=null,c=null,u=null,h=null;for(x in n){var d=n[x];if(n.hasOwnProperty(x)&&d!=null)switch(x){case"checked":break;case"value":break;case"defaultValue":c=d;default:s.hasOwnProperty(x)||it(e,t,x,null,s,d)}}for(var f in s){var x=s[f];if(d=n[f],s.hasOwnProperty(f)&&(x!=null||d!=null))switch(f){case"type":i=x;break;case"name":r=x;break;case"checked":u=x;break;case"defaultChecked":h=x;break;case"value":o=x;break;case"defaultValue":l=x;break;case"children":case"dangerouslySetInnerHTML":if(x!=null)throw Error(oe(137,t));break;default:x!==d&&it(e,t,f,x,s,d)}}dx(e,o,l,c,u,h,i,r);return;case"select":x=o=l=f=null;for(i in n)if(c=n[i],n.hasOwnProperty(i)&&c!=null)switch(i){case"value":break;case"multiple":x=c;default:s.hasOwnProperty(i)||it(e,t,i,null,s,c)}for(r in s)if(i=s[r],c=n[r],s.hasOwnProperty(r)&&(i!=null||c!=null))switch(r){case"value":f=i;break;case"defaultValue":l=i;break;case"multiple":o=i;default:i!==c&&it(e,t,r,i,s,c)}t=l,n=o,s=x,f!=null?to(e,!!n,f,!1):!!s!=!!n&&(t!=null?to(e,!!n,t,!0):to(e,!!n,n?[]:"",!1));return;case"textarea":x=f=null;for(l in n)if(r=n[l],n.hasOwnProperty(l)&&r!=null&&!s.hasOwnProperty(l))switch(l){case"value":break;case"children":break;default:it(e,t,l,null,s,r)}for(o in s)if(r=s[o],i=n[o],s.hasOwnProperty(o)&&(r!=null||i!=null))switch(o){case"value":f=r;break;case"defaultValue":x=r;break;case"children":break;case"dangerouslySetInnerHTML":if(r!=null)throw Error(oe(91));break;default:r!==i&&it(e,t,o,r,s,i)}d1(e,f,x);return;case"option":for(var b in n)if(f=n[b],n.hasOwnProperty(b)&&f!=null&&!s.hasOwnProperty(b))switch(b){case"selected":e.selected=!1;break;default:it(e,t,b,null,s,f)}for(c in s)if(f=s[c],x=n[c],s.hasOwnProperty(c)&&f!==x&&(f!=null||x!=null))switch(c){case"selected":e.selected=f&&typeof f!="function"&&typeof f!="symbol";break;default:it(e,t,c,f,s,x)}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 v in n)f=n[v],n.hasOwnProperty(v)&&f!=null&&!s.hasOwnProperty(v)&&it(e,t,v,null,s,f);for(u in s)if(f=s[u],x=n[u],s.hasOwnProperty(u)&&f!==x&&(f!=null||x!=null))switch(u){case"children":case"dangerouslySetInnerHTML":if(f!=null)throw Error(oe(137,t));break;default:it(e,t,u,f,s,x)}return;default:if(Ig(t)){for(var j in n)f=n[j],n.hasOwnProperty(j)&&f!==void 0&&!s.hasOwnProperty(j)&&Hx(e,t,j,void 0,s,f);for(h in s)f=s[h],x=n[h],!s.hasOwnProperty(h)||f===x||f===void 0&&x===void 0||Hx(e,t,h,f,s,x);return}}for(var g in n)f=n[g],n.hasOwnProperty(g)&&f!=null&&!s.hasOwnProperty(g)&&it(e,t,g,null,s,f);for(d in s)f=s[d],x=n[d],!s.hasOwnProperty(d)||f===x||f==null&&x==null||it(e,t,d,f,s,x)}var Bx=null,Vx=null;function qu(e){return e.nodeType===9?e:e.ownerDocument}function Fv(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function fN(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function Yx(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var xm=null;function S3(){var e=window.event;return e&&e.type==="popstate"?e===xm?!1:(xm=e,!0):(xm=null,!1)}var mN=typeof setTimeout=="function"?setTimeout:void 0,C3=typeof clearTimeout=="function"?clearTimeout:void 0,Iv=typeof Promise=="function"?Promise:void 0,E3=typeof queueMicrotask=="function"?queueMicrotask:typeof Iv<"u"?function(e){return Iv.resolve(null).then(e).catch(k3)}:mN;function k3(e){setTimeout(function(){throw e})}function Cr(e){return e==="head"}function Wv(e,t){var n=t,s=0,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(0<s&&8>s){n=s;var o=e.ownerDocument;if(n&1&&Gl(o.documentElement),n&2&&Gl(o.body),n&4)for(n=o.head,Gl(n),o=n.firstChild;o;){var l=o.nextSibling,c=o.nodeName;o[zc]||c==="SCRIPT"||c==="STYLE"||c==="LINK"&&o.rel.toLowerCase()==="stylesheet"||n.removeChild(o),o=l}}if(r===0){e.removeChild(i),hc(t);return}r--}else n==="$"||n==="$?"||n==="$!"?r++:s=n.charCodeAt(0)-48;else s=0;n=i}while(n);hc(t)}function Fx(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":Fx(n),Fg(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function M3(e,t,n,s){for(;e.nodeType===1;){var r=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!s&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(s){if(!e[zc])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(i=e.getAttribute("rel"),i==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(i!==r.rel||e.getAttribute("href")!==(r.href==null||r.href===""?null:r.href)||e.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin)||e.getAttribute("title")!==(r.title==null?null:r.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(i=e.getAttribute("src"),(i!==(r.src==null?null:r.src)||e.getAttribute("type")!==(r.type==null?null:r.type)||e.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin))&&i&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var i=r.name==null?null:""+r.name;if(r.type==="hidden"&&e.getAttribute("name")===i)return e}else return e;if(e=bs(e.nextSibling),e===null)break}return null}function T3(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=bs(e.nextSibling),e===null))return null;return e}function Ix(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState==="complete"}function D3(e,t){var n=e.ownerDocument;if(e.data!=="$?"||n.readyState==="complete")t();else{var s=function(){t(),n.removeEventListener("DOMContentLoaded",s)};n.addEventListener("DOMContentLoaded",s),e._reactRetry=s}}function bs(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="F!"||t==="F")break;if(t==="/$")return null}}return e}var Wx=null;function qv(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}function xN(e,t,n){switch(t=qu(n),e){case"html":if(e=t.documentElement,!e)throw Error(oe(452));return e;case"head":if(e=t.head,!e)throw Error(oe(453));return e;case"body":if(e=t.body,!e)throw Error(oe(454));return e;default:throw Error(oe(451))}}function Gl(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Fg(e)}var os=new Map,Xv=new Set;function Xu(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var ka=et.d;et.d={f:_3,r:A3,D:O3,C:z3,L:R3,m:U3,X:P3,S:$3,M:L3};function _3(){var e=ka.f(),t=Vh();return e||t}function A3(e){var t=Vo(e);t!==null&&t.tag===5&&t.type==="form"?lj(t):ka.r(e)}var Io=typeof document>"u"?null:document;function gN(e,t,n){var s=Io;if(s&&typeof t=="string"&&t){var r=ss(t);r='link[rel="'+e+'"][href="'+r+'"]',typeof n=="string"&&(r+='[crossorigin="'+n+'"]'),Xv.has(r)||(Xv.add(r),e={rel:e,crossOrigin:n,href:t},s.querySelector(r)===null&&(t=s.createElement("link"),nn(t,"link",e),Gt(t),s.head.appendChild(t)))}}function O3(e){ka.D(e),gN("dns-prefetch",e,null)}function z3(e,t){ka.C(e,t),gN("preconnect",e,t)}function R3(e,t,n){ka.L(e,t,n);var s=Io;if(s&&e&&t){var r='link[rel="preload"][as="'+ss(t)+'"]';t==="image"&&n&&n.imageSrcSet?(r+='[imagesrcset="'+ss(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(r+='[imagesizes="'+ss(n.imageSizes)+'"]')):r+='[href="'+ss(e)+'"]';var i=r;switch(t){case"style":i=Eo(e);break;case"script":i=Wo(e)}os.has(i)||(e=pt({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),os.set(i,e),s.querySelector(r)!==null||t==="style"&&s.querySelector(Fc(i))||t==="script"&&s.querySelector(Ic(i))||(t=s.createElement("link"),nn(t,"link",e),Gt(t),s.head.appendChild(t)))}}function U3(e,t){ka.m(e,t);var n=Io;if(n&&e){var s=t&&typeof t.as=="string"?t.as:"script",r='link[rel="modulepreload"][as="'+ss(s)+'"][href="'+ss(e)+'"]',i=r;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":i=Wo(e)}if(!os.has(i)&&(e=pt({rel:"modulepreload",href:e},t),os.set(i,e),n.querySelector(r)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Ic(i)))return}s=n.createElement("link"),nn(s,"link",e),Gt(s),n.head.appendChild(s)}}}function $3(e,t,n){ka.S(e,t,n);var s=Io;if(s&&e){var r=eo(s).hoistableStyles,i=Eo(e);t=t||"default";var o=r.get(i);if(!o){var l={loading:0,preload:null};if(o=s.querySelector(Fc(i)))l.loading=5;else{e=pt({rel:"stylesheet",href:e,"data-precedence":t},n),(n=os.get(i))&&kp(e,n);var c=o=s.createElement("link");Gt(c),nn(c,"link",e),c._p=new Promise(function(u,h){c.onload=u,c.onerror=h}),c.addEventListener("load",function(){l.loading|=1}),c.addEventListener("error",function(){l.loading|=2}),l.loading|=4,lu(o,t,s)}o={type:"stylesheet",instance:o,count:1,state:l},r.set(i,o)}}}function P3(e,t){ka.X(e,t);var n=Io;if(n&&e){var s=eo(n).hoistableScripts,r=Wo(e),i=s.get(r);i||(i=n.querySelector(Ic(r)),i||(e=pt({src:e,async:!0},t),(t=os.get(r))&&Mp(e,t),i=n.createElement("script"),Gt(i),nn(i,"link",e),n.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},s.set(r,i))}}function L3(e,t){ka.M(e,t);var n=Io;if(n&&e){var s=eo(n).hoistableScripts,r=Wo(e),i=s.get(r);i||(i=n.querySelector(Ic(r)),i||(e=pt({src:e,async:!0,type:"module"},t),(t=os.get(r))&&Mp(e,t),i=n.createElement("script"),Gt(i),nn(i,"link",e),n.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},s.set(r,i))}}function Gv(e,t,n,s){var r=(r=rr.current)?Xu(r):null;if(!r)throw Error(oe(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=Eo(n.href),n=eo(r).hoistableStyles,s=n.get(t),s||(s={type:"style",instance:null,count:0,state:null},n.set(t,s)),s):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=Eo(n.href);var i=eo(r).hoistableStyles,o=i.get(e);if(o||(r=r.ownerDocument||r,o={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},i.set(e,o),(i=r.querySelector(Fc(e)))&&!i._p&&(o.instance=i,o.state.loading=5),os.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},os.set(e,n),i||H3(r,e,n,o.state))),t&&s===null)throw Error(oe(528,""));return o}if(t&&s!==null)throw Error(oe(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Wo(n),n=eo(r).hoistableScripts,s=n.get(t),s||(s={type:"script",instance:null,count:0,state:null},n.set(t,s)),s):{type:"void",instance:null,count:0,state:null};default:throw Error(oe(444,e))}}function Eo(e){return'href="'+ss(e)+'"'}function Fc(e){return'link[rel="stylesheet"]['+e+"]"}function pN(e){return pt({},e,{"data-precedence":e.precedence,precedence:null})}function H3(e,t,n,s){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?s.loading=1:(t=e.createElement("link"),s.preload=t,t.addEventListener("load",function(){return s.loading|=1}),t.addEventListener("error",function(){return s.loading|=2}),nn(t,"link",n),Gt(t),e.head.appendChild(t))}function Wo(e){return'[src="'+ss(e)+'"]'}function Ic(e){return"script[async]"+e}function Zv(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var s=e.querySelector('style[data-href~="'+ss(n.href)+'"]');if(s)return t.instance=s,Gt(s),s;var r=pt({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return s=(e.ownerDocument||e).createElement("style"),Gt(s),nn(s,"style",r),lu(s,n.precedence,e),t.instance=s;case"stylesheet":r=Eo(n.href);var i=e.querySelector(Fc(r));if(i)return t.state.loading|=4,t.instance=i,Gt(i),i;s=pN(n),(r=os.get(r))&&kp(s,r),i=(e.ownerDocument||e).createElement("link"),Gt(i);var o=i;return o._p=new Promise(function(l,c){o.onload=l,o.onerror=c}),nn(i,"link",s),t.state.loading|=4,lu(i,n.precedence,e),t.instance=i;case"script":return i=Wo(n.src),(r=e.querySelector(Ic(i)))?(t.instance=r,Gt(r),r):(s=n,(r=os.get(i))&&(s=pt({},n),Mp(s,r)),e=e.ownerDocument||e,r=e.createElement("script"),Gt(r),nn(r,"link",s),e.head.appendChild(r),t.instance=r);case"void":return null;default:throw Error(oe(443,t.type))}else t.type==="stylesheet"&&!(t.state.loading&4)&&(s=t.instance,t.state.loading|=4,lu(s,n.precedence,e));return t.instance}function lu(e,t,n){for(var s=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),r=s.length?s[s.length-1]:null,i=r,o=0;o<s.length;o++){var l=s[o];if(l.dataset.precedence===t)i=l;else if(i!==r)break}i?i.parentNode.insertBefore(e,i.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function kp(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Mp(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var cu=null;function Qv(e,t,n){if(cu===null){var s=new Map,r=cu=new Map;r.set(n,s)}else r=cu,s=r.get(n),s||(s=new Map,r.set(n,s));if(s.has(e))return s;for(s.set(e,null),n=n.getElementsByTagName(e),r=0;r<n.length;r++){var i=n[r];if(!(i[zc]||i[on]||e==="link"&&i.getAttribute("rel")==="stylesheet")&&i.namespaceURI!=="http://www.w3.org/2000/svg"){var o=i.getAttribute(t)||"";o=e+o;var l=s.get(o);l?l.push(i):s.set(o,[i])}}return s}function Kv(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function B3(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function vN(e){return!(e.type==="stylesheet"&&!(e.state.loading&3))}var lc=null;function V3(){}function Y3(e,t,n){if(lc===null)throw Error(oe(475));var s=lc;if(t.type==="stylesheet"&&(typeof n.media!="string"||matchMedia(n.media).matches!==!1)&&!(t.state.loading&4)){if(t.instance===null){var r=Eo(n.href),i=e.querySelector(Fc(r));if(i){e=i._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(s.count++,s=Gu.bind(s),e.then(s,s)),t.state.loading|=4,t.instance=i,Gt(i);return}i=e.ownerDocument||e,n=pN(n),(r=os.get(r))&&kp(n,r),i=i.createElement("link"),Gt(i);var o=i;o._p=new Promise(function(l,c){o.onload=l,o.onerror=c}),nn(i,"link",n),t.instance=i}s.stylesheets===null&&(s.stylesheets=new Map),s.stylesheets.set(t,e),(e=t.state.preload)&&!(t.state.loading&3)&&(s.count++,t=Gu.bind(s),e.addEventListener("load",t),e.addEventListener("error",t))}}function F3(){if(lc===null)throw Error(oe(475));var e=lc;return e.stylesheets&&e.count===0&&qx(e,e.stylesheets),0<e.count?function(t){var n=setTimeout(function(){if(e.stylesheets&&qx(e,e.stylesheets),e.unsuspend){var s=e.unsuspend;e.unsuspend=null,s()}},6e4);return e.unsuspend=t,function(){e.unsuspend=null,clearTimeout(n)}}:null}function Gu(){if(this.count--,this.count===0){if(this.stylesheets)qx(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Zu=null;function qx(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Zu=new Map,t.forEach(I3,e),Zu=null,Gu.call(e))}function I3(e,t){if(!(t.state.loading&4)){var n=Zu.get(e);if(n)var s=n.get(null);else{n=new Map,Zu.set(e,n);for(var r=e.querySelectorAll("link[data-precedence],style[data-precedence]"),i=0;i<r.length;i++){var o=r[i];(o.nodeName==="LINK"||o.getAttribute("media")!=="not all")&&(n.set(o.dataset.precedence,o),s=o)}s&&n.set(null,s)}r=t.instance,o=r.getAttribute("data-precedence"),i=n.get(o)||s,i===s&&n.set(null,r),n.set(o,r),this.count++,s=Gu.bind(this),r.addEventListener("load",s),r.addEventListener("error",s),i?i.parentNode.insertBefore(r,i.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(r,e.firstChild)),t.state.loading|=4}}var cc={$$typeof:la,Provider:null,Consumer:null,_currentValue:Yr,_currentValue2:Yr,_threadCount:0};function W3(e,t,n,s,r,i,o,l){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=$f(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=$f(0),this.hiddenUpdates=$f(null),this.identifierPrefix=s,this.onUncaughtError=r,this.onCaughtError=i,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=l,this.incompleteTransitions=new Map}function bN(e,t,n,s,r,i,o,l,c,u,h,d){return e=new W3(e,t,n,o,l,c,u,d),t=1,i===!0&&(t|=24),i=$n(3,null,null,t),e.current=i,i.stateNode=e,t=np(),t.refCount++,e.pooledCache=t,t.refCount++,i.memoizedState={element:s,isDehydrated:n,cache:t},ap(i),e}function yN(e){return e?(e=Xi,e):Xi}function wN(e,t,n,s,r,i){r=yN(r),s.context===null?s.context=r:s.pendingContext=r,s=ir(t),s.payload={element:n},i=i===void 0?null:i,i!==null&&(s.callback=i),n=or(e,s,t),n!==null&&(Yn(n,e,t),Bl(n,e,t))}function Jv(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Tp(e,t){Jv(e,t),(e=e.alternate)&&Jv(e,t)}function jN(e){if(e.tag===13){var t=Yo(e,67108864);t!==null&&Yn(t,e,67108864),Tp(e,67108864)}}var Qu=!0;function q3(e,t,n,s){var r=Oe.T;Oe.T=null;var i=et.p;try{et.p=2,Dp(e,t,n,s)}finally{et.p=i,Oe.T=r}}function X3(e,t,n,s){var r=Oe.T;Oe.T=null;var i=et.p;try{et.p=8,Dp(e,t,n,s)}finally{et.p=i,Oe.T=r}}function Dp(e,t,n,s){if(Qu){var r=Xx(s);if(r===null)mm(e,t,s,Ku,n),eb(e,s);else if(Z3(r,e,t,n,s))s.stopPropagation();else if(eb(e,s),t&4&&-1<G3.indexOf(e)){for(;r!==null;){var i=Vo(r);if(i!==null)switch(i.tag){case 3:if(i=i.stateNode,i.current.memoizedState.isDehydrated){var o=zr(i.pendingLanes);if(o!==0){var l=i;for(l.pendingLanes|=2,l.entangledLanes|=2;o;){var c=1<<31-Bn(o);l.entanglements[1]|=c,o&=~c}Zs(i),!(rt&6)&&(Vu=Ys()+500,Yc(0))}}break;case 13:l=Yo(i,2),l!==null&&Yn(l,i,2),Vh(),Tp(i,2)}if(i=Xx(s),i===null&&mm(e,t,s,Ku,n),i===r)break;r=i}r!==null&&s.stopPropagation()}else mm(e,t,s,null,n)}}function Xx(e){return e=Wg(e),_p(e)}var Ku=null;function _p(e){if(Ku=null,e=Vi(e),e!==null){var t=Dc(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=qw(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Ku=e,null}function NN(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(zE()){case Qw:return 2;case Kw:return 8;case Eu:case RE:return 32;case Jw:return 268435456;default:return 32}default:return 32}}var Gx=!1,dr=null,ur=null,hr=null,dc=new Map,uc=new Map,Qa=[],G3="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 eb(e,t){switch(e){case"focusin":case"focusout":dr=null;break;case"dragenter":case"dragleave":ur=null;break;case"mouseover":case"mouseout":hr=null;break;case"pointerover":case"pointerout":dc.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":uc.delete(t.pointerId)}}function ml(e,t,n,s,r,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:s,nativeEvent:i,targetContainers:[r]},t!==null&&(t=Vo(t),t!==null&&jN(t)),e):(e.eventSystemFlags|=s,t=e.targetContainers,r!==null&&t.indexOf(r)===-1&&t.push(r),e)}function Z3(e,t,n,s,r){switch(t){case"focusin":return dr=ml(dr,e,t,n,s,r),!0;case"dragenter":return ur=ml(ur,e,t,n,s,r),!0;case"mouseover":return hr=ml(hr,e,t,n,s,r),!0;case"pointerover":var i=r.pointerId;return dc.set(i,ml(dc.get(i)||null,e,t,n,s,r)),!0;case"gotpointercapture":return i=r.pointerId,uc.set(i,ml(uc.get(i)||null,e,t,n,s,r)),!0}return!1}function SN(e){var t=Vi(e.target);if(t!==null){var n=Dc(t);if(n!==null){if(t=n.tag,t===13){if(t=qw(n),t!==null){e.blockedOn=t,YE(e.priority,function(){if(n.tag===13){var s=Vn();s=Vg(s);var r=Yo(n,s);r!==null&&Yn(r,n,s),Tp(n,s)}});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function du(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Xx(e.nativeEvent);if(n===null){n=e.nativeEvent;var s=new n.constructor(n.type,n);hx=s,n.target.dispatchEvent(s),hx=null}else return t=Vo(n),t!==null&&jN(t),e.blockedOn=n,!1;t.shift()}return!0}function tb(e,t,n){du(e)&&n.delete(t)}function Q3(){Gx=!1,dr!==null&&du(dr)&&(dr=null),ur!==null&&du(ur)&&(ur=null),hr!==null&&du(hr)&&(hr=null),dc.forEach(tb),uc.forEach(tb)}function kd(e,t){e.blockedOn===t&&(e.blockedOn=null,Gx||(Gx=!0,Wt.unstable_scheduleCallback(Wt.unstable_NormalPriority,Q3)))}var Md=null;function nb(e){Md!==e&&(Md=e,Wt.unstable_scheduleCallback(Wt.unstable_NormalPriority,function(){Md===e&&(Md=null);for(var t=0;t<e.length;t+=3){var n=e[t],s=e[t+1],r=e[t+2];if(typeof s!="function"){if(_p(s||n)===null)continue;break}var i=Vo(n);i!==null&&(e.splice(t,3),t-=3,Mx(i,{pending:!0,data:r,method:n.method,action:s},s,r))}}))}function hc(e){function t(c){return kd(c,e)}dr!==null&&kd(dr,e),ur!==null&&kd(ur,e),hr!==null&&kd(hr,e),dc.forEach(t),uc.forEach(t);for(var n=0;n<Qa.length;n++){var s=Qa[n];s.blockedOn===e&&(s.blockedOn=null)}for(;0<Qa.length&&(n=Qa[0],n.blockedOn===null);)SN(n),n.blockedOn===null&&Qa.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(s=0;s<n.length;s+=3){var r=n[s],i=n[s+1],o=r[Nn]||null;if(typeof i=="function")o||nb(n);else if(o){var l=null;if(i&&i.hasAttribute("formAction")){if(r=i,o=i[Nn]||null)l=o.formAction;else if(_p(r)!==null)continue}else l=o.action;typeof l=="function"?n[s+1]=l:(n.splice(s,3),s-=3),nb(n)}}}function Ap(e){this._internalRoot=e}Wh.prototype.render=Ap.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(oe(409));var n=t.current,s=Vn();wN(n,s,e,t,null,null)};Wh.prototype.unmount=Ap.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;wN(e.current,2,null,e,null,null),Vh(),t[Bo]=null}};function Wh(e){this._internalRoot=e}Wh.prototype.unstable_scheduleHydration=function(e){if(e){var t=a1();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Qa.length&&t!==0&&t<Qa[n].priority;n++);Qa.splice(n,0,e),n===0&&SN(e)}};var sb=Iw.version;if(sb!=="19.1.0")throw Error(oe(527,sb,"19.1.0"));et.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(oe(188)):(e=Object.keys(e).join(","),Error(oe(268,e)));return e=kE(t),e=e!==null?Xw(e):null,e=e===null?null:e.stateNode,e};var K3={bundleType:0,version:"19.1.0",rendererPackageName:"react-dom",currentDispatcherRef:Oe,reconcilerVersion:"19.1.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Td=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Td.isDisabled&&Td.supportsFiber)try{_c=Td.inject(K3),Hn=Td}catch{}}Th.createRoot=function(e,t){if(!Ww(e))throw Error(oe(299));var n=!1,s="",r=bj,i=yj,o=wj,l=null;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onUncaughtError!==void 0&&(r=t.onUncaughtError),t.onCaughtError!==void 0&&(i=t.onCaughtError),t.onRecoverableError!==void 0&&(o=t.onRecoverableError),t.unstable_transitionCallbacks!==void 0&&(l=t.unstable_transitionCallbacks)),t=bN(e,1,!1,null,null,n,s,r,i,o,l,null),e[Bo]=t.current,Ep(e),new Ap(t)};Th.hydrateRoot=function(e,t,n){if(!Ww(e))throw Error(oe(299));var s=!1,r="",i=bj,o=yj,l=wj,c=null,u=null;return n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(r=n.identifierPrefix),n.onUncaughtError!==void 0&&(i=n.onUncaughtError),n.onCaughtError!==void 0&&(o=n.onCaughtError),n.onRecoverableError!==void 0&&(l=n.onRecoverableError),n.unstable_transitionCallbacks!==void 0&&(c=n.unstable_transitionCallbacks),n.formState!==void 0&&(u=n.formState)),t=bN(e,1,!0,t,n??null,s,r,i,o,l,c,u),t.context=yN(null),n=t.current,s=Vn(),s=Vg(s),r=ir(s),r.callback=null,or(n,r,s),n=s,t.current.lanes=n,Oc(t,n),Zs(t),e[Bo]=t.current,Ep(e),new Wh(t)};Th.version="19.1.0";function CN(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(CN)}catch(e){console.error(e)}}CN(),Pw.exports=Th;var J3=Pw.exports;const eM=Eh(J3);/**
50
- * @remix-run/router v1.23.1
51
- *
52
- * Copyright (c) Remix Software Inc.
53
- *
54
- * This source code is licensed under the MIT license found in the
55
- * LICENSE.md file in the root directory of this source tree.
56
- *
57
- * @license MIT
58
- */function fc(){return fc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},fc.apply(this,arguments)}var sr;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(sr||(sr={}));const ab="popstate";function tM(e){e===void 0&&(e={});function t(s,r){let{pathname:i,search:o,hash:l}=s.location;return Zx("",{pathname:i,search:o,hash:l},r.state&&r.state.usr||null,r.state&&r.state.key||"default")}function n(s,r){return typeof r=="string"?r:Ju(r)}return sM(t,n,null,e)}function Pt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Op(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function nM(){return Math.random().toString(36).substr(2,8)}function rb(e,t){return{usr:e.state,key:e.key,idx:t}}function Zx(e,t,n,s){return n===void 0&&(n=null),fc({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?qo(t):t,{state:n,key:t&&t.key||s||nM()})}function Ju(e){let{pathname:t="/",search:n="",hash:s=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),s&&s!=="#"&&(t+=s.charAt(0)==="#"?s:"#"+s),t}function qo(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let s=e.indexOf("?");s>=0&&(t.search=e.substr(s),e=e.substr(0,s)),e&&(t.pathname=e)}return t}function sM(e,t,n,s){s===void 0&&(s={});let{window:r=document.defaultView,v5Compat:i=!1}=s,o=r.history,l=sr.Pop,c=null,u=h();u==null&&(u=0,o.replaceState(fc({},o.state,{idx:u}),""));function h(){return(o.state||{idx:null}).idx}function d(){l=sr.Pop;let j=h(),g=j==null?null:j-u;u=j,c&&c({action:l,location:v.location,delta:g})}function f(j,g){l=sr.Push;let y=Zx(v.location,j,g);u=h()+1;let p=rb(y,u),w=v.createHref(y);try{o.pushState(p,"",w)}catch(N){if(N instanceof DOMException&&N.name==="DataCloneError")throw N;r.location.assign(w)}i&&c&&c({action:l,location:v.location,delta:1})}function x(j,g){l=sr.Replace;let y=Zx(v.location,j,g);u=h();let p=rb(y,u),w=v.createHref(y);o.replaceState(p,"",w),i&&c&&c({action:l,location:v.location,delta:0})}function b(j){let g=r.location.origin!=="null"?r.location.origin:r.location.href,y=typeof j=="string"?j:Ju(j);return y=y.replace(/ $/,"%20"),Pt(g,"No window.location.(origin|href) available to create URL for href: "+y),new URL(y,g)}let v={get action(){return l},get location(){return e(r,o)},listen(j){if(c)throw new Error("A history only accepts one active listener");return r.addEventListener(ab,d),c=j,()=>{r.removeEventListener(ab,d),c=null}},createHref(j){return t(r,j)},createURL:b,encodeLocation(j){let g=b(j);return{pathname:g.pathname,search:g.search,hash:g.hash}},push:f,replace:x,go(j){return o.go(j)}};return v}var ib;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(ib||(ib={}));function aM(e,t,n){return n===void 0&&(n="/"),rM(e,t,n)}function rM(e,t,n,s){let r=typeof t=="string"?qo(t):t,i=zp(r.pathname||"/",n);if(i==null)return null;let o=EN(e);iM(o);let l=null;for(let c=0;l==null&&c<o.length;++c){let u=vM(i);l=xM(o[c],u)}return l}function EN(e,t,n,s){t===void 0&&(t=[]),n===void 0&&(n=[]),s===void 0&&(s="");let r=(i,o,l)=>{let c={relativePath:l===void 0?i.path||"":l,caseSensitive:i.caseSensitive===!0,childrenIndex:o,route:i};c.relativePath.startsWith("/")&&(Pt(c.relativePath.startsWith(s),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+s+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(s.length));let u=fr([s,c.relativePath]),h=n.concat(c);i.children&&i.children.length>0&&(Pt(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),EN(i.children,t,h,u)),!(i.path==null&&!i.index)&&t.push({path:u,score:fM(u,i.index),routesMeta:h})};return e.forEach((i,o)=>{var l;if(i.path===""||!((l=i.path)!=null&&l.includes("?")))r(i,o);else for(let c of kN(i.path))r(i,o,c)}),t}function kN(e){let t=e.split("/");if(t.length===0)return[];let[n,...s]=t,r=n.endsWith("?"),i=n.replace(/\?$/,"");if(s.length===0)return r?[i,""]:[i];let o=kN(s.join("/")),l=[];return l.push(...o.map(c=>c===""?i:[i,c].join("/"))),r&&l.push(...o),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function iM(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:mM(t.routesMeta.map(s=>s.childrenIndex),n.routesMeta.map(s=>s.childrenIndex)))}const oM=/^:[\w-]+$/,lM=3,cM=2,dM=1,uM=10,hM=-2,ob=e=>e==="*";function fM(e,t){let n=e.split("/"),s=n.length;return n.some(ob)&&(s+=hM),t&&(s+=cM),n.filter(r=>!ob(r)).reduce((r,i)=>r+(oM.test(i)?lM:i===""?dM:uM),s)}function mM(e,t){return e.length===t.length&&e.slice(0,-1).every((s,r)=>s===t[r])?e[e.length-1]-t[t.length-1]:0}function xM(e,t,n){let{routesMeta:s}=e,r={},i="/",o=[];for(let l=0;l<s.length;++l){let c=s[l],u=l===s.length-1,h=i==="/"?t:t.slice(i.length)||"/",d=gM({path:c.relativePath,caseSensitive:c.caseSensitive,end:u},h),f=c.route;if(!d)return null;Object.assign(r,d.params),o.push({params:r,pathname:fr([i,d.pathname]),pathnameBase:NM(fr([i,d.pathnameBase])),route:f}),d.pathnameBase!=="/"&&(i=fr([i,d.pathnameBase]))}return o}function gM(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,s]=pM(e.path,e.caseSensitive,e.end),r=t.match(n);if(!r)return null;let i=r[0],o=i.replace(/(.)\/+$/,"$1"),l=r.slice(1);return{params:s.reduce((u,h,d)=>{let{paramName:f,isOptional:x}=h;if(f==="*"){let v=l[d]||"";o=i.slice(0,i.length-v.length).replace(/(.)\/+$/,"$1")}const b=l[d];return x&&!b?u[f]=void 0:u[f]=(b||"").replace(/%2F/g,"/"),u},{}),pathname:i,pathnameBase:o,pattern:e}}function pM(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Op(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let s=[],r="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,l,c)=>(s.push({paramName:l,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(s.push({paramName:"*"}),r+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?r+="\\/*$":e!==""&&e!=="/"&&(r+="(?:(?=\\/|$))"),[new RegExp(r,t?void 0:"i"),s]}function vM(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Op(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function zp(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,s=e.charAt(n);return s&&s!=="/"?null:e.slice(n)||"/"}const bM=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,yM=e=>bM.test(e);function wM(e,t){t===void 0&&(t="/");let{pathname:n,search:s="",hash:r=""}=typeof e=="string"?qo(e):e,i;if(n)if(yM(n))i=n;else{if(n.includes("//")){let o=n;n=n.replace(/\/\/+/g,"/"),Op(!1,"Pathnames cannot have embedded double slashes - normalizing "+(o+" -> "+n))}n.startsWith("/")?i=lb(n.substring(1),"/"):i=lb(n,t)}else i=t;return{pathname:i,search:SM(s),hash:CM(r)}}function lb(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(r=>{r===".."?n.length>1&&n.pop():r!=="."&&n.push(r)}),n.length>1?n.join("/"):"/"}function gm(e,t,n,s){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(s)+"]. 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 jM(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function MN(e,t){let n=jM(e);return t?n.map((s,r)=>r===n.length-1?s.pathname:s.pathnameBase):n.map(s=>s.pathnameBase)}function TN(e,t,n,s){s===void 0&&(s=!1);let r;typeof e=="string"?r=qo(e):(r=fc({},e),Pt(!r.pathname||!r.pathname.includes("?"),gm("?","pathname","search",r)),Pt(!r.pathname||!r.pathname.includes("#"),gm("#","pathname","hash",r)),Pt(!r.search||!r.search.includes("#"),gm("#","search","hash",r)));let i=e===""||r.pathname==="",o=i?"/":r.pathname,l;if(o==null)l=n;else{let d=t.length-1;if(!s&&o.startsWith("..")){let f=o.split("/");for(;f[0]==="..";)f.shift(),d-=1;r.pathname=f.join("/")}l=d>=0?t[d]:"/"}let c=wM(r,l),u=o&&o!=="/"&&o.endsWith("/"),h=(i||o===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(u||h)&&(c.pathname+="/"),c}const fr=e=>e.join("/").replace(/\/\/+/g,"/"),NM=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),SM=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,CM=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function EM(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const DN=["post","put","patch","delete"];new Set(DN);const kM=["get",...DN];new Set(kM);/**
59
- * React Router v6.30.2
60
- *
61
- * Copyright (c) Remix Software Inc.
62
- *
63
- * This source code is licensed under the MIT license found in the
64
- * LICENSE.md file in the root directory of this source tree.
65
- *
66
- * @license MIT
67
- */function mc(){return mc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},mc.apply(this,arguments)}const Rp=m.createContext(null),MM=m.createContext(null),bi=m.createContext(null),qh=m.createContext(null),Er=m.createContext({outlet:null,matches:[],isDataRoute:!1}),_N=m.createContext(null);function TM(e,t){let{relative:n}=t===void 0?{}:t;Wc()||Pt(!1);let{basename:s,navigator:r}=m.useContext(bi),{hash:i,pathname:o,search:l}=ON(e,{relative:n}),c=o;return s!=="/"&&(c=o==="/"?s:fr([s,o])),r.createHref({pathname:c,search:l,hash:i})}function Wc(){return m.useContext(qh)!=null}function Xo(){return Wc()||Pt(!1),m.useContext(qh).location}function AN(e){m.useContext(bi).static||m.useLayoutEffect(e)}function Cs(){let{isDataRoute:e}=m.useContext(Er);return e?VM():DM()}function DM(){Wc()||Pt(!1);let e=m.useContext(Rp),{basename:t,future:n,navigator:s}=m.useContext(bi),{matches:r}=m.useContext(Er),{pathname:i}=Xo(),o=JSON.stringify(MN(r,n.v7_relativeSplatPath)),l=m.useRef(!1);return AN(()=>{l.current=!0}),m.useCallback(function(u,h){if(h===void 0&&(h={}),!l.current)return;if(typeof u=="number"){s.go(u);return}let d=TN(u,JSON.parse(o),i,h.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:fr([t,d.pathname])),(h.replace?s.replace:s.push)(d,h.state,h)},[t,s,o,i,e])}function Up(){let{matches:e}=m.useContext(Er),t=e[e.length-1];return t?t.params:{}}function ON(e,t){let{relative:n}=t===void 0?{}:t,{future:s}=m.useContext(bi),{matches:r}=m.useContext(Er),{pathname:i}=Xo(),o=JSON.stringify(MN(r,s.v7_relativeSplatPath));return m.useMemo(()=>TN(e,JSON.parse(o),i,n==="path"),[e,o,i,n])}function _M(e,t){return AM(e,t)}function AM(e,t,n,s){Wc()||Pt(!1);let{navigator:r}=m.useContext(bi),{matches:i}=m.useContext(Er),o=i[i.length-1],l=o?o.params:{};o&&o.pathname;let c=o?o.pathnameBase:"/";o&&o.route;let u=Xo(),h;if(t){var d;let j=typeof t=="string"?qo(t):t;c==="/"||(d=j.pathname)!=null&&d.startsWith(c)||Pt(!1),h=j}else h=u;let f=h.pathname||"/",x=f;if(c!=="/"){let j=c.replace(/^\//,"").split("/");x="/"+f.replace(/^\//,"").split("/").slice(j.length).join("/")}let b=aM(e,{pathname:x}),v=$M(b&&b.map(j=>Object.assign({},j,{params:Object.assign({},l,j.params),pathname:fr([c,r.encodeLocation?r.encodeLocation(j.pathname).pathname:j.pathname]),pathnameBase:j.pathnameBase==="/"?c:fr([c,r.encodeLocation?r.encodeLocation(j.pathnameBase).pathname:j.pathnameBase])})),i,n,s);return t&&v?m.createElement(qh.Provider,{value:{location:mc({pathname:"/",search:"",hash:"",state:null,key:"default"},h),navigationType:sr.Pop}},v):v}function OM(){let e=BM(),t=EM(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return m.createElement(m.Fragment,null,m.createElement("h2",null,"Unexpected Application Error!"),m.createElement("h3",{style:{fontStyle:"italic"}},t),n?m.createElement("pre",{style:r},n):null,null)}const zM=m.createElement(OM,null);class RM extends m.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,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?m.createElement(Er.Provider,{value:this.props.routeContext},m.createElement(_N.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function UM(e){let{routeContext:t,match:n,children:s}=e,r=m.useContext(Rp);return r&&r.static&&r.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=n.route.id),m.createElement(Er.Provider,{value:t},s)}function $M(e,t,n,s){var r;if(t===void 0&&(t=[]),n===void 0&&(n=null),s===void 0&&(s=null),e==null){var i;if(!n)return null;if(n.errors)e=n.matches;else if((i=s)!=null&&i.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,l=(r=n)==null?void 0:r.errors;if(l!=null){let h=o.findIndex(d=>d.route.id&&(l==null?void 0:l[d.route.id])!==void 0);h>=0||Pt(!1),o=o.slice(0,Math.min(o.length,h+1))}let c=!1,u=-1;if(n&&s&&s.v7_partialHydration)for(let h=0;h<o.length;h++){let d=o[h];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(u=h),d.route.id){let{loaderData:f,errors:x}=n,b=d.route.loader&&f[d.route.id]===void 0&&(!x||x[d.route.id]===void 0);if(d.route.lazy||b){c=!0,u>=0?o=o.slice(0,u+1):o=[o[0]];break}}}return o.reduceRight((h,d,f)=>{let x,b=!1,v=null,j=null;n&&(x=l&&d.route.id?l[d.route.id]:void 0,v=d.route.errorElement||zM,c&&(u<0&&f===0?(YM("route-fallback"),b=!0,j=null):u===f&&(b=!0,j=d.route.hydrateFallbackElement||null)));let g=t.concat(o.slice(0,f+1)),y=()=>{let p;return x?p=v:b?p=j:d.route.Component?p=m.createElement(d.route.Component,null):d.route.element?p=d.route.element:p=h,m.createElement(UM,{match:d,routeContext:{outlet:h,matches:g,isDataRoute:n!=null},children:p})};return n&&(d.route.ErrorBoundary||d.route.errorElement||f===0)?m.createElement(RM,{location:n.location,revalidation:n.revalidation,component:v,error:x,children:y(),routeContext:{outlet:null,matches:g,isDataRoute:!0}}):y()},null)}var zN=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(zN||{}),RN=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(RN||{});function PM(e){let t=m.useContext(Rp);return t||Pt(!1),t}function LM(e){let t=m.useContext(MM);return t||Pt(!1),t}function HM(e){let t=m.useContext(Er);return t||Pt(!1),t}function UN(e){let t=HM(),n=t.matches[t.matches.length-1];return n.route.id||Pt(!1),n.route.id}function BM(){var e;let t=m.useContext(_N),n=LM(),s=UN();return t!==void 0?t:(e=n.errors)==null?void 0:e[s]}function VM(){let{router:e}=PM(zN.UseNavigateStable),t=UN(RN.UseNavigateStable),n=m.useRef(!1);return AN(()=>{n.current=!0}),m.useCallback(function(r,i){i===void 0&&(i={}),n.current&&(typeof r=="number"?e.navigate(r):e.navigate(r,mc({fromRouteId:t},i)))},[e,t])}const cb={};function YM(e,t,n){cb[e]||(cb[e]=!0)}function FM(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function gn(e){Pt(!1)}function IM(e){let{basename:t="/",children:n=null,location:s,navigationType:r=sr.Pop,navigator:i,static:o=!1,future:l}=e;Wc()&&Pt(!1);let c=t.replace(/^\/*/,"/"),u=m.useMemo(()=>({basename:c,navigator:i,static:o,future:mc({v7_relativeSplatPath:!1},l)}),[c,l,i,o]);typeof s=="string"&&(s=qo(s));let{pathname:h="/",search:d="",hash:f="",state:x=null,key:b="default"}=s,v=m.useMemo(()=>{let j=zp(h,c);return j==null?null:{location:{pathname:j,search:d,hash:f,state:x,key:b},navigationType:r}},[c,h,d,f,x,b,r]);return v==null?null:m.createElement(bi.Provider,{value:u},m.createElement(qh.Provider,{children:n,value:v}))}function WM(e){let{children:t,location:n}=e;return _M(Qx(t),n)}new Promise(()=>{});function Qx(e,t){t===void 0&&(t=[]);let n=[];return m.Children.forEach(e,(s,r)=>{if(!m.isValidElement(s))return;let i=[...t,r];if(s.type===m.Fragment){n.push.apply(n,Qx(s.props.children,i));return}s.type!==gn&&Pt(!1),!s.props.index||!s.props.children||Pt(!1);let o={id:s.props.id||i.join("-"),caseSensitive:s.props.caseSensitive,element:s.props.element,Component:s.props.Component,index:s.props.index,path:s.props.path,loader:s.props.loader,action:s.props.action,errorElement:s.props.errorElement,ErrorBoundary:s.props.ErrorBoundary,hasErrorBoundary:s.props.ErrorBoundary!=null||s.props.errorElement!=null,shouldRevalidate:s.props.shouldRevalidate,handle:s.props.handle,lazy:s.props.lazy};s.props.children&&(o.children=Qx(s.props.children,i)),n.push(o)}),n}/**
68
- * React Router DOM v6.30.2
69
- *
70
- * Copyright (c) Remix Software Inc.
71
- *
72
- * This source code is licensed under the MIT license found in the
73
- * LICENSE.md file in the root directory of this source tree.
74
- *
75
- * @license MIT
76
- */function Kx(){return Kx=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},Kx.apply(this,arguments)}function qM(e,t){if(e==null)return{};var n={},s=Object.keys(e),r,i;for(i=0;i<s.length;i++)r=s[i],!(t.indexOf(r)>=0)&&(n[r]=e[r]);return n}function XM(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function GM(e,t){return e.button===0&&(!t||t==="_self")&&!XM(e)}function Jx(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let s=e[n];return t.concat(Array.isArray(s)?s.map(r=>[n,r]):[[n,s]])},[]))}function ZM(e,t){let n=Jx(e);return t&&t.forEach((s,r)=>{n.has(r)||t.getAll(r).forEach(i=>{n.append(r,i)})}),n}const QM=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],KM="6";try{window.__reactRouterVersion=KM}catch{}const JM="startTransition",db=Mh[JM];function e5(e){let{basename:t,children:n,future:s,window:r}=e,i=m.useRef();i.current==null&&(i.current=tM({window:r,v5Compat:!0}));let o=i.current,[l,c]=m.useState({action:o.action,location:o.location}),{v7_startTransition:u}=s||{},h=m.useCallback(d=>{u&&db?db(()=>c(d)):c(d)},[c,u]);return m.useLayoutEffect(()=>o.listen(h),[o,h]),m.useEffect(()=>FM(s),[s]),m.createElement(IM,{basename:t,children:n,location:l.location,navigationType:l.action,navigator:o,future:s})}const t5=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",n5=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,$p=m.forwardRef(function(t,n){let{onClick:s,relative:r,reloadDocument:i,replace:o,state:l,target:c,to:u,preventScrollReset:h,viewTransition:d}=t,f=qM(t,QM),{basename:x}=m.useContext(bi),b,v=!1;if(typeof u=="string"&&n5.test(u)&&(b=u,t5))try{let p=new URL(window.location.href),w=u.startsWith("//")?new URL(p.protocol+u):new URL(u),N=zp(w.pathname,x);w.origin===p.origin&&N!=null?u=N+w.search+w.hash:v=!0}catch{}let j=TM(u,{relative:r}),g=s5(u,{replace:o,state:l,target:c,preventScrollReset:h,relative:r,viewTransition:d});function y(p){s&&s(p),p.defaultPrevented||g(p)}return m.createElement("a",Kx({},f,{href:b||j,onClick:v||i?s:y,ref:n,target:c}))});var ub;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(ub||(ub={}));var hb;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(hb||(hb={}));function s5(e,t){let{target:n,replace:s,state:r,preventScrollReset:i,relative:o,viewTransition:l}=t===void 0?{}:t,c=Cs(),u=Xo(),h=ON(e,{relative:o});return m.useCallback(d=>{if(GM(d,n)){d.preventDefault();let f=s!==void 0?s:Ju(u)===Ju(h);c(e,{replace:f,state:r,preventScrollReset:i,relative:o,viewTransition:l})}},[u,c,h,s,r,n,e,i,o,l])}function a5(e){let t=m.useRef(Jx(e)),n=m.useRef(!1),s=Xo(),r=m.useMemo(()=>ZM(s.search,n.current?null:t.current),[s.search]),i=Cs(),o=m.useCallback((l,c)=>{const u=Jx(typeof l=="function"?l(r):l);n.current=!0,i("?"+u,c)},[i,r]);return[r,o]}function r5(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const i5=e=>{switch(e){case"success":return c5;case"info":return u5;case"warning":return d5;case"error":return h5;default:return null}},o5=Array(12).fill(0),l5=({visible:e,className:t})=>K.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},K.createElement("div",{className:"sonner-spinner"},o5.map((n,s)=>K.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${s}`})))),c5=K.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},K.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"})),d5=K.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},K.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"})),u5=K.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},K.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"})),h5=K.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},K.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"})),f5=K.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"},K.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),K.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),m5=()=>{const[e,t]=K.useState(document.hidden);return K.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let eg=1;class x5{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;const{message:s,...r}=t,i=typeof(t==null?void 0:t.id)=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:eg++,o=this.toasts.find(c=>c.id===i),l=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(i)&&this.dismissedToasts.delete(i),o?this.toasts=this.toasts.map(c=>c.id===i?(this.publish({...c,...t,id:i,title:s}),{...c,...t,id:i,dismissible:l,title:s}):c):this.addToast({title:s,...r,dismissible:l,id:i}),i},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:t,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(s=>s({id:n.id,dismiss:!0}))}),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let s;n.loading!==void 0&&(s=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const r=Promise.resolve(t instanceof Function?t():t);let i=s!==void 0,o;const l=r.then(async u=>{if(o=["resolve",u],K.isValidElement(u))i=!1,this.create({id:s,type:"default",message:u});else if(p5(u)&&!u.ok){i=!1;const d=typeof n.error=="function"?await n.error(`HTTP error! status: ${u.status}`):n.error,f=typeof n.description=="function"?await n.description(`HTTP error! status: ${u.status}`):n.description,b=typeof d=="object"&&!K.isValidElement(d)?d:{message:d};this.create({id:s,type:"error",description:f,...b})}else if(u instanceof Error){i=!1;const d=typeof n.error=="function"?await n.error(u):n.error,f=typeof n.description=="function"?await n.description(u):n.description,b=typeof d=="object"&&!K.isValidElement(d)?d:{message:d};this.create({id:s,type:"error",description:f,...b})}else if(n.success!==void 0){i=!1;const d=typeof n.success=="function"?await n.success(u):n.success,f=typeof n.description=="function"?await n.description(u):n.description,b=typeof d=="object"&&!K.isValidElement(d)?d:{message:d};this.create({id:s,type:"success",description:f,...b})}}).catch(async u=>{if(o=["reject",u],n.error!==void 0){i=!1;const h=typeof n.error=="function"?await n.error(u):n.error,d=typeof n.description=="function"?await n.description(u):n.description,x=typeof h=="object"&&!K.isValidElement(h)?h:{message:h};this.create({id:s,type:"error",description:d,...x})}}).finally(()=>{i&&(this.dismiss(s),s=void 0),n.finally==null||n.finally.call(n)}),c=()=>new Promise((u,h)=>l.then(()=>o[0]==="reject"?h(o[1]):u(o[1])).catch(h));return typeof s!="string"&&typeof s!="number"?{unwrap:c}:Object.assign(s,{unwrap:c})},this.custom=(t,n)=>{const s=(n==null?void 0:n.id)||eg++;return this.create({jsx:t(s),id:s,...n}),s},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const yn=new x5,g5=(e,t)=>{const n=(t==null?void 0:t.id)||eg++;return yn.addToast({title:e,...t,id:n}),n},p5=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",v5=g5,b5=()=>yn.toasts,y5=()=>yn.getActiveToasts(),V=Object.assign(v5,{success:yn.success,info:yn.info,warning:yn.warning,error:yn.error,custom:yn.custom,message:yn.message,promise:yn.promise,dismiss:yn.dismiss,loading:yn.loading},{getHistory:b5,getToasts:y5});r5("[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 Dd(e){return e.label!==void 0}const w5=3,j5="24px",N5="16px",fb=4e3,S5=356,C5=14,E5=45,k5=200;function _s(...e){return e.filter(Boolean).join(" ")}function M5(e){const[t,n]=e.split("-"),s=[];return t&&s.push(t),n&&s.push(n),s}const T5=e=>{var t,n,s,r,i,o,l,c,u;const{invert:h,toast:d,unstyled:f,interacting:x,setHeights:b,visibleToasts:v,heights:j,index:g,toasts:y,expanded:p,removeToast:w,defaultRichColors:N,closeButton:S,style:C,cancelButtonStyle:T,actionButtonStyle:U,className:B="",descriptionClassName:P="",duration:z,position:Y,gap:k,expandByDefault:$,classNames:M,icons:_,closeButtonAriaLabel:E="Close toast"}=e,[D,A]=K.useState(null),[q,R]=K.useState(null),[L,X]=K.useState(!1),[G,te]=K.useState(!1),[re,ee]=K.useState(!1),[se,ge]=K.useState(!1),[ae,ue]=K.useState(!1),[he,we]=K.useState(0),[Ne,Ce]=K.useState(0),Ae=K.useRef(d.duration||z||fb),tt=K.useRef(null),$e=K.useRef(null),Rt=g===0,Tt=g+1<=v,Be=d.type,We=d.dismissible!==!1,vt=d.className||"",bt=d.descriptionClassName||"",ft=K.useMemo(()=>j.findIndex(F=>F.toastId===d.id)||0,[j,d.id]),Q=K.useMemo(()=>{var F;return(F=d.closeButton)!=null?F:S},[d.closeButton,S]),H=K.useMemo(()=>d.duration||z||fb,[d.duration,z]),O=K.useRef(0),Z=K.useRef(0),ie=K.useRef(0),le=K.useRef(null),[Ee,Re]=Y.split("-"),Ue=K.useMemo(()=>j.reduce((F,fe,ze)=>ze>=ft?F:F+fe.height,0),[j,ft]),yt=m5(),Ct=d.invert||h,J=Be==="loading";Z.current=K.useMemo(()=>ft*k+Ue,[ft,Ue]),K.useEffect(()=>{Ae.current=H},[H]),K.useEffect(()=>{X(!0)},[]),K.useEffect(()=>{const F=$e.current;if(F){const fe=F.getBoundingClientRect().height;return Ce(fe),b(ze=>[{toastId:d.id,height:fe,position:d.position},...ze]),()=>b(ze=>ze.filter(qe=>qe.toastId!==d.id))}},[b,d.id]),K.useLayoutEffect(()=>{if(!L)return;const F=$e.current,fe=F.style.height;F.style.height="auto";const ze=F.getBoundingClientRect().height;F.style.height=fe,Ce(ze),b(qe=>qe.find(Xe=>Xe.toastId===d.id)?qe.map(Xe=>Xe.toastId===d.id?{...Xe,height:ze}:Xe):[{toastId:d.id,height:ze,position:d.position},...qe])},[L,d.title,d.description,b,d.id,d.jsx,d.action,d.cancel]);const ne=K.useCallback(()=>{te(!0),we(Z.current),b(F=>F.filter(fe=>fe.toastId!==d.id)),setTimeout(()=>{w(d)},k5)},[d,w,b,Z]);K.useEffect(()=>{if(d.promise&&Be==="loading"||d.duration===1/0||d.type==="loading")return;let F;return p||x||yt?(()=>{if(ie.current<O.current){const qe=new Date().getTime()-O.current;Ae.current=Ae.current-qe}ie.current=new Date().getTime()})():(()=>{Ae.current!==1/0&&(O.current=new Date().getTime(),F=setTimeout(()=>{d.onAutoClose==null||d.onAutoClose.call(d,d),ne()},Ae.current))})(),()=>clearTimeout(F)},[p,x,d,Be,yt,ne]),K.useEffect(()=>{d.delete&&(ne(),d.onDismiss==null||d.onDismiss.call(d,d))},[ne,d.delete]);function xe(){var F;if(_!=null&&_.loading){var fe;return K.createElement("div",{className:_s(M==null?void 0:M.loader,d==null||(fe=d.classNames)==null?void 0:fe.loader,"sonner-loader"),"data-visible":Be==="loading"},_.loading)}return K.createElement(l5,{className:_s(M==null?void 0:M.loader,d==null||(F=d.classNames)==null?void 0:F.loader),visible:Be==="loading"})}const ce=d.icon||(_==null?void 0:_[Be])||i5(Be);var pe,I;return K.createElement("li",{tabIndex:0,ref:$e,className:_s(B,vt,M==null?void 0:M.toast,d==null||(t=d.classNames)==null?void 0:t.toast,M==null?void 0:M.default,M==null?void 0:M[Be],d==null||(n=d.classNames)==null?void 0:n[Be]),"data-sonner-toast":"","data-rich-colors":(pe=d.richColors)!=null?pe:N,"data-styled":!(d.jsx||d.unstyled||f),"data-mounted":L,"data-promise":!!d.promise,"data-swiped":ae,"data-removed":G,"data-visible":Tt,"data-y-position":Ee,"data-x-position":Re,"data-index":g,"data-front":Rt,"data-swiping":re,"data-dismissible":We,"data-type":Be,"data-invert":Ct,"data-swipe-out":se,"data-swipe-direction":q,"data-expanded":!!(p||$&&L),"data-testid":d.testId,style:{"--index":g,"--toasts-before":g,"--z-index":y.length-g,"--offset":`${G?he:Z.current}px`,"--initial-height":$?"auto":`${Ne}px`,...C,...d.style},onDragEnd:()=>{ee(!1),A(null),le.current=null},onPointerDown:F=>{F.button!==2&&(J||!We||(tt.current=new Date,we(Z.current),F.target.setPointerCapture(F.pointerId),F.target.tagName!=="BUTTON"&&(ee(!0),le.current={x:F.clientX,y:F.clientY})))},onPointerUp:()=>{var F,fe,ze;if(se||!We)return;le.current=null;const qe=Number(((F=$e.current)==null?void 0:F.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Ke=Number(((fe=$e.current)==null?void 0:fe.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Xe=new Date().getTime()-((ze=tt.current)==null?void 0:ze.getTime()),Kt=D==="x"?qe:Ke,Ms=Math.abs(Kt)/Xe;if(Math.abs(Kt)>=E5||Ms>.11){we(Z.current),d.onDismiss==null||d.onDismiss.call(d,d),R(D==="x"?qe>0?"right":"left":Ke>0?"down":"up"),ne(),ge(!0);return}else{var dn,Jt;(dn=$e.current)==null||dn.style.setProperty("--swipe-amount-x","0px"),(Jt=$e.current)==null||Jt.style.setProperty("--swipe-amount-y","0px")}ue(!1),ee(!1),A(null)},onPointerMove:F=>{var fe,ze,qe;if(!le.current||!We||((fe=window.getSelection())==null?void 0:fe.toString().length)>0)return;const Xe=F.clientY-le.current.y,Kt=F.clientX-le.current.x;var Ms;const dn=(Ms=e.swipeDirections)!=null?Ms:M5(Y);!D&&(Math.abs(Kt)>1||Math.abs(Xe)>1)&&A(Math.abs(Kt)>Math.abs(Xe)?"x":"y");let Jt={x:0,y:0};const wi=Cn=>1/(1.5+Math.abs(Cn)/20);if(D==="y"){if(dn.includes("top")||dn.includes("bottom"))if(dn.includes("top")&&Xe<0||dn.includes("bottom")&&Xe>0)Jt.y=Xe;else{const Cn=Xe*wi(Xe);Jt.y=Math.abs(Cn)<Math.abs(Xe)?Cn:Xe}}else if(D==="x"&&(dn.includes("left")||dn.includes("right")))if(dn.includes("left")&&Kt<0||dn.includes("right")&&Kt>0)Jt.x=Kt;else{const Cn=Kt*wi(Kt);Jt.x=Math.abs(Cn)<Math.abs(Kt)?Cn:Kt}(Math.abs(Jt.x)>0||Math.abs(Jt.y)>0)&&ue(!0),(ze=$e.current)==null||ze.style.setProperty("--swipe-amount-x",`${Jt.x}px`),(qe=$e.current)==null||qe.style.setProperty("--swipe-amount-y",`${Jt.y}px`)}},Q&&!d.jsx&&Be!=="loading"?K.createElement("button",{"aria-label":E,"data-disabled":J,"data-close-button":!0,onClick:J||!We?()=>{}:()=>{ne(),d.onDismiss==null||d.onDismiss.call(d,d)},className:_s(M==null?void 0:M.closeButton,d==null||(s=d.classNames)==null?void 0:s.closeButton)},(I=_==null?void 0:_.close)!=null?I:f5):null,(Be||d.icon||d.promise)&&d.icon!==null&&((_==null?void 0:_[Be])!==null||d.icon)?K.createElement("div",{"data-icon":"",className:_s(M==null?void 0:M.icon,d==null||(r=d.classNames)==null?void 0:r.icon)},d.promise||d.type==="loading"&&!d.icon?d.icon||xe():null,d.type!=="loading"?ce:null):null,K.createElement("div",{"data-content":"",className:_s(M==null?void 0:M.content,d==null||(i=d.classNames)==null?void 0:i.content)},K.createElement("div",{"data-title":"",className:_s(M==null?void 0:M.title,d==null||(o=d.classNames)==null?void 0:o.title)},d.jsx?d.jsx:typeof d.title=="function"?d.title():d.title),d.description?K.createElement("div",{"data-description":"",className:_s(P,bt,M==null?void 0:M.description,d==null||(l=d.classNames)==null?void 0:l.description)},typeof d.description=="function"?d.description():d.description):null),K.isValidElement(d.cancel)?d.cancel:d.cancel&&Dd(d.cancel)?K.createElement("button",{"data-button":!0,"data-cancel":!0,style:d.cancelButtonStyle||T,onClick:F=>{Dd(d.cancel)&&We&&(d.cancel.onClick==null||d.cancel.onClick.call(d.cancel,F),ne())},className:_s(M==null?void 0:M.cancelButton,d==null||(c=d.classNames)==null?void 0:c.cancelButton)},d.cancel.label):null,K.isValidElement(d.action)?d.action:d.action&&Dd(d.action)?K.createElement("button",{"data-button":!0,"data-action":!0,style:d.actionButtonStyle||U,onClick:F=>{Dd(d.action)&&(d.action.onClick==null||d.action.onClick.call(d.action,F),!F.defaultPrevented&&ne())},className:_s(M==null?void 0:M.actionButton,d==null||(u=d.classNames)==null?void 0:u.actionButton)},d.action.label):null)};function mb(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function D5(e,t){const n={};return[e,t].forEach((s,r)=>{const i=r===1,o=i?"--mobile-offset":"--offset",l=i?N5:j5;function c(u){["top","right","bottom","left"].forEach(h=>{n[`${o}-${h}`]=typeof u=="number"?`${u}px`:u})}typeof s=="number"||typeof s=="string"?c(s):typeof s=="object"?["top","right","bottom","left"].forEach(u=>{s[u]===void 0?n[`${o}-${u}`]=l:n[`${o}-${u}`]=typeof s[u]=="number"?`${s[u]}px`:s[u]}):c(l)}),n}const _5=K.forwardRef(function(t,n){const{id:s,invert:r,position:i="bottom-right",hotkey:o=["altKey","KeyT"],expand:l,closeButton:c,className:u,offset:h,mobileOffset:d,theme:f="light",richColors:x,duration:b,style:v,visibleToasts:j=w5,toastOptions:g,dir:y=mb(),gap:p=C5,icons:w,containerAriaLabel:N="Notifications"}=t,[S,C]=K.useState([]),T=K.useMemo(()=>s?S.filter(L=>L.toasterId===s):S.filter(L=>!L.toasterId),[S,s]),U=K.useMemo(()=>Array.from(new Set([i].concat(T.filter(L=>L.position).map(L=>L.position)))),[T,i]),[B,P]=K.useState([]),[z,Y]=K.useState(!1),[k,$]=K.useState(!1),[M,_]=K.useState(f!=="system"?f:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),E=K.useRef(null),D=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),A=K.useRef(null),q=K.useRef(!1),R=K.useCallback(L=>{C(X=>{var G;return(G=X.find(te=>te.id===L.id))!=null&&G.delete||yn.dismiss(L.id),X.filter(({id:te})=>te!==L.id)})},[]);return K.useEffect(()=>yn.subscribe(L=>{if(L.dismiss){requestAnimationFrame(()=>{C(X=>X.map(G=>G.id===L.id?{...G,delete:!0}:G))});return}setTimeout(()=>{Fw.flushSync(()=>{C(X=>{const G=X.findIndex(te=>te.id===L.id);return G!==-1?[...X.slice(0,G),{...X[G],...L},...X.slice(G+1)]:[L,...X]})})})}),[S]),K.useEffect(()=>{if(f!=="system"){_(f);return}if(f==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?_("dark"):_("light")),typeof window>"u")return;const L=window.matchMedia("(prefers-color-scheme: dark)");try{L.addEventListener("change",({matches:X})=>{_(X?"dark":"light")})}catch{L.addListener(({matches:G})=>{try{_(G?"dark":"light")}catch(te){console.error(te)}})}},[f]),K.useEffect(()=>{S.length<=1&&Y(!1)},[S]),K.useEffect(()=>{const L=X=>{var G;if(o.every(ee=>X[ee]||X.code===ee)){var re;Y(!0),(re=E.current)==null||re.focus()}X.code==="Escape"&&(document.activeElement===E.current||(G=E.current)!=null&&G.contains(document.activeElement))&&Y(!1)};return document.addEventListener("keydown",L),()=>document.removeEventListener("keydown",L)},[o]),K.useEffect(()=>{if(E.current)return()=>{A.current&&(A.current.focus({preventScroll:!0}),A.current=null,q.current=!1)}},[E.current]),K.createElement("section",{ref:n,"aria-label":`${N} ${D}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},U.map((L,X)=>{var G;const[te,re]=L.split("-");return T.length?K.createElement("ol",{key:L,dir:y==="auto"?mb():y,tabIndex:-1,ref:E,className:u,"data-sonner-toaster":!0,"data-sonner-theme":M,"data-y-position":te,"data-x-position":re,style:{"--front-toast-height":`${((G=B[0])==null?void 0:G.height)||0}px`,"--width":`${S5}px`,"--gap":`${p}px`,...v,...D5(h,d)},onBlur:ee=>{q.current&&!ee.currentTarget.contains(ee.relatedTarget)&&(q.current=!1,A.current&&(A.current.focus({preventScroll:!0}),A.current=null))},onFocus:ee=>{ee.target instanceof HTMLElement&&ee.target.dataset.dismissible==="false"||q.current||(q.current=!0,A.current=ee.relatedTarget)},onMouseEnter:()=>Y(!0),onMouseMove:()=>Y(!0),onMouseLeave:()=>{k||Y(!1)},onDragEnd:()=>Y(!1),onPointerDown:ee=>{ee.target instanceof HTMLElement&&ee.target.dataset.dismissible==="false"||$(!0)},onPointerUp:()=>$(!1)},T.filter(ee=>!ee.position&&X===0||ee.position===L).map((ee,se)=>{var ge,ae;return K.createElement(T5,{key:ee.id,icons:w,index:se,toast:ee,defaultRichColors:x,duration:(ge=g==null?void 0:g.duration)!=null?ge:b,className:g==null?void 0:g.className,descriptionClassName:g==null?void 0:g.descriptionClassName,invert:r,visibleToasts:j,closeButton:(ae=g==null?void 0:g.closeButton)!=null?ae:c,interacting:k,position:L,style:g==null?void 0:g.style,unstyled:g==null?void 0:g.unstyled,classNames:g==null?void 0:g.classNames,cancelButtonStyle:g==null?void 0:g.cancelButtonStyle,actionButtonStyle:g==null?void 0:g.actionButtonStyle,closeButtonAriaLabel:g==null?void 0:g.closeButtonAriaLabel,removeToast:R,toasts:T.filter(ue=>ue.position==ee.position),heights:B.filter(ue=>ue.position==ee.position),setHeights:P,expandByDefault:l,gap:p,expanded:z,swipeDirections:t.swipeDirections})})):null}))});function Ht(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,s;n<e.length;n++)(s=Ht(e[n]))!==""&&(t+=(t&&" ")+s);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var A5={value:()=>{}};function Xh(){for(var e=0,t=arguments.length,n={},s;e<t;++e){if(!(s=arguments[e]+"")||s in n||/[\s.]/.test(s))throw new Error("illegal type: "+s);n[s]=[]}return new uu(n)}function uu(e){this._=e}function O5(e,t){return e.trim().split(/^|\s+/).map(function(n){var s="",r=n.indexOf(".");if(r>=0&&(s=n.slice(r+1),n=n.slice(0,r)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:s}})}uu.prototype=Xh.prototype={constructor:uu,on:function(e,t){var n=this._,s=O5(e+"",n),r,i=-1,o=s.length;if(arguments.length<2){for(;++i<o;)if((r=(e=s[i]).type)&&(r=z5(n[r],e.name)))return r;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++i<o;)if(r=(e=s[i]).type)n[r]=xb(n[r],e.name,t);else if(t==null)for(r in n)n[r]=xb(n[r],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new uu(e)},call:function(e,t){if((r=arguments.length-2)>0)for(var n=new Array(r),s=0,r,i;s<r;++s)n[s]=arguments[s+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(i=this._[e],s=0,r=i.length;s<r;++s)i[s].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var s=this._[e],r=0,i=s.length;r<i;++r)s[r].value.apply(t,n)}};function z5(e,t){for(var n=0,s=e.length,r;n<s;++n)if((r=e[n]).name===t)return r.value}function xb(e,t,n){for(var s=0,r=e.length;s<r;++s)if(e[s].name===t){e[s]=A5,e=e.slice(0,s).concat(e.slice(s+1));break}return n!=null&&e.push({name:t,value:n}),e}var tg="http://www.w3.org/1999/xhtml";const gb={svg:"http://www.w3.org/2000/svg",xhtml:tg,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Gh(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),gb.hasOwnProperty(t)?{space:gb[t],local:e}:e}function R5(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===tg&&t.documentElement.namespaceURI===tg?t.createElement(e):t.createElementNS(n,e)}}function U5(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function $N(e){var t=Gh(e);return(t.local?U5:R5)(t)}function $5(){}function Pp(e){return e==null?$5:function(){return this.querySelector(e)}}function P5(e){typeof e!="function"&&(e=Pp(e));for(var t=this._groups,n=t.length,s=new Array(n),r=0;r<n;++r)for(var i=t[r],o=i.length,l=s[r]=new Array(o),c,u,h=0;h<o;++h)(c=i[h])&&(u=e.call(c,c.__data__,h,i))&&("__data__"in c&&(u.__data__=c.__data__),l[h]=u);return new Wn(s,this._parents)}function L5(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function H5(){return[]}function PN(e){return e==null?H5:function(){return this.querySelectorAll(e)}}function B5(e){return function(){return L5(e.apply(this,arguments))}}function V5(e){typeof e=="function"?e=B5(e):e=PN(e);for(var t=this._groups,n=t.length,s=[],r=[],i=0;i<n;++i)for(var o=t[i],l=o.length,c,u=0;u<l;++u)(c=o[u])&&(s.push(e.call(c,c.__data__,u,o)),r.push(c));return new Wn(s,r)}function LN(e){return function(){return this.matches(e)}}function HN(e){return function(t){return t.matches(e)}}var Y5=Array.prototype.find;function F5(e){return function(){return Y5.call(this.children,e)}}function I5(){return this.firstElementChild}function W5(e){return this.select(e==null?I5:F5(typeof e=="function"?e:HN(e)))}var q5=Array.prototype.filter;function X5(){return Array.from(this.children)}function G5(e){return function(){return q5.call(this.children,e)}}function Z5(e){return this.selectAll(e==null?X5:G5(typeof e=="function"?e:HN(e)))}function Q5(e){typeof e!="function"&&(e=LN(e));for(var t=this._groups,n=t.length,s=new Array(n),r=0;r<n;++r)for(var i=t[r],o=i.length,l=s[r]=[],c,u=0;u<o;++u)(c=i[u])&&e.call(c,c.__data__,u,i)&&l.push(c);return new Wn(s,this._parents)}function BN(e){return new Array(e.length)}function K5(){return new Wn(this._enter||this._groups.map(BN),this._parents)}function eh(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}eh.prototype={constructor:eh,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function J5(e){return function(){return e}}function eT(e,t,n,s,r,i){for(var o=0,l,c=t.length,u=i.length;o<u;++o)(l=t[o])?(l.__data__=i[o],s[o]=l):n[o]=new eh(e,i[o]);for(;o<c;++o)(l=t[o])&&(r[o]=l)}function tT(e,t,n,s,r,i,o){var l,c,u=new Map,h=t.length,d=i.length,f=new Array(h),x;for(l=0;l<h;++l)(c=t[l])&&(f[l]=x=o.call(c,c.__data__,l,t)+"",u.has(x)?r[l]=c:u.set(x,c));for(l=0;l<d;++l)x=o.call(e,i[l],l,i)+"",(c=u.get(x))?(s[l]=c,c.__data__=i[l],u.delete(x)):n[l]=new eh(e,i[l]);for(l=0;l<h;++l)(c=t[l])&&u.get(f[l])===c&&(r[l]=c)}function nT(e){return e.__data__}function sT(e,t){if(!arguments.length)return Array.from(this,nT);var n=t?tT:eT,s=this._parents,r=this._groups;typeof e!="function"&&(e=J5(e));for(var i=r.length,o=new Array(i),l=new Array(i),c=new Array(i),u=0;u<i;++u){var h=s[u],d=r[u],f=d.length,x=aT(e.call(h,h&&h.__data__,u,s)),b=x.length,v=l[u]=new Array(b),j=o[u]=new Array(b),g=c[u]=new Array(f);n(h,d,v,j,g,x,t);for(var y=0,p=0,w,N;y<b;++y)if(w=v[y]){for(y>=p&&(p=y+1);!(N=j[p])&&++p<b;);w._next=N||null}}return o=new Wn(o,s),o._enter=l,o._exit=c,o}function aT(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function rT(){return new Wn(this._exit||this._groups.map(BN),this._parents)}function iT(e,t,n){var s=this.enter(),r=this,i=this.exit();return typeof e=="function"?(s=e(s),s&&(s=s.selection())):s=s.append(e+""),t!=null&&(r=t(r),r&&(r=r.selection())),n==null?i.remove():n(i),s&&r?s.merge(r).order():r}function oT(e){for(var t=e.selection?e.selection():e,n=this._groups,s=t._groups,r=n.length,i=s.length,o=Math.min(r,i),l=new Array(r),c=0;c<o;++c)for(var u=n[c],h=s[c],d=u.length,f=l[c]=new Array(d),x,b=0;b<d;++b)(x=u[b]||h[b])&&(f[b]=x);for(;c<r;++c)l[c]=n[c];return new Wn(l,this._parents)}function lT(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var s=e[t],r=s.length-1,i=s[r],o;--r>=0;)(o=s[r])&&(i&&o.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(o,i),i=o);return this}function cT(e){e||(e=dT);function t(d,f){return d&&f?e(d.__data__,f.__data__):!d-!f}for(var n=this._groups,s=n.length,r=new Array(s),i=0;i<s;++i){for(var o=n[i],l=o.length,c=r[i]=new Array(l),u,h=0;h<l;++h)(u=o[h])&&(c[h]=u);c.sort(t)}return new Wn(r,this._parents).order()}function dT(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function uT(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function hT(){return Array.from(this)}function fT(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var s=e[t],r=0,i=s.length;r<i;++r){var o=s[r];if(o)return o}return null}function mT(){let e=0;for(const t of this)++e;return e}function xT(){return!this.node()}function gT(e){for(var t=this._groups,n=0,s=t.length;n<s;++n)for(var r=t[n],i=0,o=r.length,l;i<o;++i)(l=r[i])&&e.call(l,l.__data__,i,r);return this}function pT(e){return function(){this.removeAttribute(e)}}function vT(e){return function(){this.removeAttributeNS(e.space,e.local)}}function bT(e,t){return function(){this.setAttribute(e,t)}}function yT(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function wT(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function jT(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function NT(e,t){var n=Gh(e);if(arguments.length<2){var s=this.node();return n.local?s.getAttributeNS(n.space,n.local):s.getAttribute(n)}return this.each((t==null?n.local?vT:pT:typeof t=="function"?n.local?jT:wT:n.local?yT:bT)(n,t))}function VN(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function ST(e){return function(){this.style.removeProperty(e)}}function CT(e,t,n){return function(){this.style.setProperty(e,t,n)}}function ET(e,t,n){return function(){var s=t.apply(this,arguments);s==null?this.style.removeProperty(e):this.style.setProperty(e,s,n)}}function kT(e,t,n){return arguments.length>1?this.each((t==null?ST:typeof t=="function"?ET:CT)(e,t,n??"")):ko(this.node(),e)}function ko(e,t){return e.style.getPropertyValue(t)||VN(e).getComputedStyle(e,null).getPropertyValue(t)}function MT(e){return function(){delete this[e]}}function TT(e,t){return function(){this[e]=t}}function DT(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function _T(e,t){return arguments.length>1?this.each((t==null?MT:typeof t=="function"?DT:TT)(e,t)):this.node()[e]}function YN(e){return e.trim().split(/^|\s+/)}function Lp(e){return e.classList||new FN(e)}function FN(e){this._node=e,this._names=YN(e.getAttribute("class")||"")}FN.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function IN(e,t){for(var n=Lp(e),s=-1,r=t.length;++s<r;)n.add(t[s])}function WN(e,t){for(var n=Lp(e),s=-1,r=t.length;++s<r;)n.remove(t[s])}function AT(e){return function(){IN(this,e)}}function OT(e){return function(){WN(this,e)}}function zT(e,t){return function(){(t.apply(this,arguments)?IN:WN)(this,e)}}function RT(e,t){var n=YN(e+"");if(arguments.length<2){for(var s=Lp(this.node()),r=-1,i=n.length;++r<i;)if(!s.contains(n[r]))return!1;return!0}return this.each((typeof t=="function"?zT:t?AT:OT)(n,t))}function UT(){this.textContent=""}function $T(e){return function(){this.textContent=e}}function PT(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function LT(e){return arguments.length?this.each(e==null?UT:(typeof e=="function"?PT:$T)(e)):this.node().textContent}function HT(){this.innerHTML=""}function BT(e){return function(){this.innerHTML=e}}function VT(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function YT(e){return arguments.length?this.each(e==null?HT:(typeof e=="function"?VT:BT)(e)):this.node().innerHTML}function FT(){this.nextSibling&&this.parentNode.appendChild(this)}function IT(){return this.each(FT)}function WT(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function qT(){return this.each(WT)}function XT(e){var t=typeof e=="function"?e:$N(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function GT(){return null}function ZT(e,t){var n=typeof e=="function"?e:$N(e),s=t==null?GT:typeof t=="function"?t:Pp(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),s.apply(this,arguments)||null)})}function QT(){var e=this.parentNode;e&&e.removeChild(this)}function KT(){return this.each(QT)}function JT(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function eD(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function tD(e){return this.select(e?eD:JT)}function nD(e){return arguments.length?this.property("__data__",e):this.node().__data__}function sD(e){return function(t){e.call(this,t,this.__data__)}}function aD(e){return e.trim().split(/^|\s+/).map(function(t){var n="",s=t.indexOf(".");return s>=0&&(n=t.slice(s+1),t=t.slice(0,s)),{type:t,name:n}})}function rD(e){return function(){var t=this.__on;if(t){for(var n=0,s=-1,r=t.length,i;n<r;++n)i=t[n],(!e.type||i.type===e.type)&&i.name===e.name?this.removeEventListener(i.type,i.listener,i.options):t[++s]=i;++s?t.length=s:delete this.__on}}}function iD(e,t,n){return function(){var s=this.__on,r,i=sD(t);if(s){for(var o=0,l=s.length;o<l;++o)if((r=s[o]).type===e.type&&r.name===e.name){this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=i,r.options=n),r.value=t;return}}this.addEventListener(e.type,i,n),r={type:e.type,name:e.name,value:t,listener:i,options:n},s?s.push(r):this.__on=[r]}}function oD(e,t,n){var s=aD(e+""),r,i=s.length,o;if(arguments.length<2){var l=this.node().__on;if(l){for(var c=0,u=l.length,h;c<u;++c)for(r=0,h=l[c];r<i;++r)if((o=s[r]).type===h.type&&o.name===h.name)return h.value}return}for(l=t?iD:rD,r=0;r<i;++r)this.each(l(s[r],t,n));return this}function qN(e,t,n){var s=VN(e),r=s.CustomEvent;typeof r=="function"?r=new r(t,n):(r=s.document.createEvent("Event"),n?(r.initEvent(t,n.bubbles,n.cancelable),r.detail=n.detail):r.initEvent(t,!1,!1)),e.dispatchEvent(r)}function lD(e,t){return function(){return qN(this,e,t)}}function cD(e,t){return function(){return qN(this,e,t.apply(this,arguments))}}function dD(e,t){return this.each((typeof t=="function"?cD:lD)(e,t))}function*uD(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var s=e[t],r=0,i=s.length,o;r<i;++r)(o=s[r])&&(yield o)}var XN=[null];function Wn(e,t){this._groups=e,this._parents=t}function qc(){return new Wn([[document.documentElement]],XN)}function hD(){return this}Wn.prototype=qc.prototype={constructor:Wn,select:P5,selectAll:V5,selectChild:W5,selectChildren:Z5,filter:Q5,data:sT,enter:K5,exit:rT,join:iT,merge:oT,selection:hD,order:lT,sort:cT,call:uT,nodes:hT,node:fT,size:mT,empty:xT,each:gT,attr:NT,style:kT,property:_T,classed:RT,text:LT,html:YT,raise:IT,lower:qT,append:XT,insert:ZT,remove:KT,clone:tD,datum:nD,on:oD,dispatch:dD,[Symbol.iterator]:uD};function Pn(e){return typeof e=="string"?new Wn([[document.querySelector(e)]],[document.documentElement]):new Wn([[e]],XN)}function fD(e){let t;for(;t=e.sourceEvent;)e=t;return e}function ds(e,t){if(e=fD(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var s=n.createSVGPoint();return s.x=e.clientX,s.y=e.clientY,s=s.matrixTransform(t.getScreenCTM().inverse()),[s.x,s.y]}if(t.getBoundingClientRect){var r=t.getBoundingClientRect();return[e.clientX-r.left-t.clientLeft,e.clientY-r.top-t.clientTop]}}return[e.pageX,e.pageY]}const mD={passive:!1},xc={capture:!0,passive:!1};function pm(e){e.stopImmediatePropagation()}function lo(e){e.preventDefault(),e.stopImmediatePropagation()}function GN(e){var t=e.document.documentElement,n=Pn(e).on("dragstart.drag",lo,xc);"onselectstart"in t?n.on("selectstart.drag",lo,xc):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function ZN(e,t){var n=e.document.documentElement,s=Pn(e).on("dragstart.drag",null);t&&(s.on("click.drag",lo,xc),setTimeout(function(){s.on("click.drag",null)},0)),"onselectstart"in n?s.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const _d=e=>()=>e;function ng(e,{sourceEvent:t,subject:n,target:s,identifier:r,active:i,x:o,y:l,dx:c,dy:u,dispatch:h}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:s,enumerable:!0,configurable:!0},identifier:{value:r,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:o,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:h}})}ng.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function xD(e){return!e.ctrlKey&&!e.button}function gD(){return this.parentNode}function pD(e,t){return t??{x:e.x,y:e.y}}function vD(){return navigator.maxTouchPoints||"ontouchstart"in this}function QN(){var e=xD,t=gD,n=pD,s=vD,r={},i=Xh("start","drag","end"),o=0,l,c,u,h,d=0;function f(w){w.on("mousedown.drag",x).filter(s).on("touchstart.drag",j).on("touchmove.drag",g,mD).on("touchend.drag touchcancel.drag",y).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function x(w,N){if(!(h||!e.call(this,w,N))){var S=p(this,t.call(this,w,N),w,N,"mouse");S&&(Pn(w.view).on("mousemove.drag",b,xc).on("mouseup.drag",v,xc),GN(w.view),pm(w),u=!1,l=w.clientX,c=w.clientY,S("start",w))}}function b(w){if(lo(w),!u){var N=w.clientX-l,S=w.clientY-c;u=N*N+S*S>d}r.mouse("drag",w)}function v(w){Pn(w.view).on("mousemove.drag mouseup.drag",null),ZN(w.view,u),lo(w),r.mouse("end",w)}function j(w,N){if(e.call(this,w,N)){var S=w.changedTouches,C=t.call(this,w,N),T=S.length,U,B;for(U=0;U<T;++U)(B=p(this,C,w,N,S[U].identifier,S[U]))&&(pm(w),B("start",w,S[U]))}}function g(w){var N=w.changedTouches,S=N.length,C,T;for(C=0;C<S;++C)(T=r[N[C].identifier])&&(lo(w),T("drag",w,N[C]))}function y(w){var N=w.changedTouches,S=N.length,C,T;for(h&&clearTimeout(h),h=setTimeout(function(){h=null},500),C=0;C<S;++C)(T=r[N[C].identifier])&&(pm(w),T("end",w,N[C]))}function p(w,N,S,C,T,U){var B=i.copy(),P=ds(U||S,N),z,Y,k;if((k=n.call(w,new ng("beforestart",{sourceEvent:S,target:f,identifier:T,active:o,x:P[0],y:P[1],dx:0,dy:0,dispatch:B}),C))!=null)return z=k.x-P[0]||0,Y=k.y-P[1]||0,function $(M,_,E){var D=P,A;switch(M){case"start":r[T]=$,A=o++;break;case"end":delete r[T],--o;case"drag":P=ds(E||_,N),A=o;break}B.call(M,w,new ng(M,{sourceEvent:_,subject:k,target:f,identifier:T,active:A,x:P[0]+z,y:P[1]+Y,dx:P[0]-D[0],dy:P[1]-D[1],dispatch:B}),C)}}return f.filter=function(w){return arguments.length?(e=typeof w=="function"?w:_d(!!w),f):e},f.container=function(w){return arguments.length?(t=typeof w=="function"?w:_d(w),f):t},f.subject=function(w){return arguments.length?(n=typeof w=="function"?w:_d(w),f):n},f.touchable=function(w){return arguments.length?(s=typeof w=="function"?w:_d(!!w),f):s},f.on=function(){var w=i.on.apply(i,arguments);return w===i?f:w},f.clickDistance=function(w){return arguments.length?(d=(w=+w)*w,f):Math.sqrt(d)},f}function Hp(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function KN(e,t){var n=Object.create(e.prototype);for(var s in t)n[s]=t[s];return n}function Xc(){}var gc=.7,th=1/gc,co="\\s*([+-]?\\d+)\\s*",pc="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Is="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",bD=/^#([0-9a-f]{3,8})$/,yD=new RegExp(`^rgb\\(${co},${co},${co}\\)$`),wD=new RegExp(`^rgb\\(${Is},${Is},${Is}\\)$`),jD=new RegExp(`^rgba\\(${co},${co},${co},${pc}\\)$`),ND=new RegExp(`^rgba\\(${Is},${Is},${Is},${pc}\\)$`),SD=new RegExp(`^hsl\\(${pc},${Is},${Is}\\)$`),CD=new RegExp(`^hsla\\(${pc},${Is},${Is},${pc}\\)$`),pb={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};Hp(Xc,ai,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:vb,formatHex:vb,formatHex8:ED,formatHsl:kD,formatRgb:bb,toString:bb});function vb(){return this.rgb().formatHex()}function ED(){return this.rgb().formatHex8()}function kD(){return JN(this).formatHsl()}function bb(){return this.rgb().formatRgb()}function ai(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=bD.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?yb(t):n===3?new jn(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Ad(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Ad(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=yD.exec(e))?new jn(t[1],t[2],t[3],1):(t=wD.exec(e))?new jn(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=jD.exec(e))?Ad(t[1],t[2],t[3],t[4]):(t=ND.exec(e))?Ad(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=SD.exec(e))?Nb(t[1],t[2]/100,t[3]/100,1):(t=CD.exec(e))?Nb(t[1],t[2]/100,t[3]/100,t[4]):pb.hasOwnProperty(e)?yb(pb[e]):e==="transparent"?new jn(NaN,NaN,NaN,0):null}function yb(e){return new jn(e>>16&255,e>>8&255,e&255,1)}function Ad(e,t,n,s){return s<=0&&(e=t=n=NaN),new jn(e,t,n,s)}function MD(e){return e instanceof Xc||(e=ai(e)),e?(e=e.rgb(),new jn(e.r,e.g,e.b,e.opacity)):new jn}function sg(e,t,n,s){return arguments.length===1?MD(e):new jn(e,t,n,s??1)}function jn(e,t,n,s){this.r=+e,this.g=+t,this.b=+n,this.opacity=+s}Hp(jn,sg,KN(Xc,{brighter(e){return e=e==null?th:Math.pow(th,e),new jn(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?gc:Math.pow(gc,e),new jn(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new jn(Zr(this.r),Zr(this.g),Zr(this.b),nh(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:wb,formatHex:wb,formatHex8:TD,formatRgb:jb,toString:jb}));function wb(){return`#${Br(this.r)}${Br(this.g)}${Br(this.b)}`}function TD(){return`#${Br(this.r)}${Br(this.g)}${Br(this.b)}${Br((isNaN(this.opacity)?1:this.opacity)*255)}`}function jb(){const e=nh(this.opacity);return`${e===1?"rgb(":"rgba("}${Zr(this.r)}, ${Zr(this.g)}, ${Zr(this.b)}${e===1?")":`, ${e})`}`}function nh(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Zr(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Br(e){return e=Zr(e),(e<16?"0":"")+e.toString(16)}function Nb(e,t,n,s){return s<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new ms(e,t,n,s)}function JN(e){if(e instanceof ms)return new ms(e.h,e.s,e.l,e.opacity);if(e instanceof Xc||(e=ai(e)),!e)return new ms;if(e instanceof ms)return e;e=e.rgb();var t=e.r/255,n=e.g/255,s=e.b/255,r=Math.min(t,n,s),i=Math.max(t,n,s),o=NaN,l=i-r,c=(i+r)/2;return l?(t===i?o=(n-s)/l+(n<s)*6:n===i?o=(s-t)/l+2:o=(t-n)/l+4,l/=c<.5?i+r:2-i-r,o*=60):l=c>0&&c<1?0:o,new ms(o,l,c,e.opacity)}function DD(e,t,n,s){return arguments.length===1?JN(e):new ms(e,t,n,s??1)}function ms(e,t,n,s){this.h=+e,this.s=+t,this.l=+n,this.opacity=+s}Hp(ms,DD,KN(Xc,{brighter(e){return e=e==null?th:Math.pow(th,e),new ms(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?gc:Math.pow(gc,e),new ms(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,s=n+(n<.5?n:1-n)*t,r=2*n-s;return new jn(vm(e>=240?e-240:e+120,r,s),vm(e,r,s),vm(e<120?e+240:e-120,r,s),this.opacity)},clamp(){return new ms(Sb(this.h),Od(this.s),Od(this.l),nh(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 e=nh(this.opacity);return`${e===1?"hsl(":"hsla("}${Sb(this.h)}, ${Od(this.s)*100}%, ${Od(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Sb(e){return e=(e||0)%360,e<0?e+360:e}function Od(e){return Math.max(0,Math.min(1,e||0))}function vm(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const Bp=e=>()=>e;function _D(e,t){return function(n){return e+n*t}}function AD(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(s){return Math.pow(e+s*t,n)}}function OD(e){return(e=+e)==1?e2:function(t,n){return n-t?AD(t,n,e):Bp(isNaN(t)?n:t)}}function e2(e,t){var n=t-e;return n?_D(e,n):Bp(isNaN(e)?t:e)}const sh=function e(t){var n=OD(t);function s(r,i){var o=n((r=sg(r)).r,(i=sg(i)).r),l=n(r.g,i.g),c=n(r.b,i.b),u=e2(r.opacity,i.opacity);return function(h){return r.r=o(h),r.g=l(h),r.b=c(h),r.opacity=u(h),r+""}}return s.gamma=e,s}(1);function zD(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,s=t.slice(),r;return function(i){for(r=0;r<n;++r)s[r]=e[r]*(1-i)+t[r]*i;return s}}function RD(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function UD(e,t){var n=t?t.length:0,s=e?Math.min(n,e.length):0,r=new Array(s),i=new Array(n),o;for(o=0;o<s;++o)r[o]=Zl(e[o],t[o]);for(;o<n;++o)i[o]=t[o];return function(l){for(o=0;o<s;++o)i[o]=r[o](l);return i}}function $D(e,t){var n=new Date;return e=+e,t=+t,function(s){return n.setTime(e*(1-s)+t*s),n}}function Us(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function PD(e,t){var n={},s={},r;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(r in t)r in e?n[r]=Zl(e[r],t[r]):s[r]=t[r];return function(i){for(r in n)s[r]=n[r](i);return s}}var ag=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,bm=new RegExp(ag.source,"g");function LD(e){return function(){return e}}function HD(e){return function(t){return e(t)+""}}function t2(e,t){var n=ag.lastIndex=bm.lastIndex=0,s,r,i,o=-1,l=[],c=[];for(e=e+"",t=t+"";(s=ag.exec(e))&&(r=bm.exec(t));)(i=r.index)>n&&(i=t.slice(n,i),l[o]?l[o]+=i:l[++o]=i),(s=s[0])===(r=r[0])?l[o]?l[o]+=r:l[++o]=r:(l[++o]=null,c.push({i:o,x:Us(s,r)})),n=bm.lastIndex;return n<t.length&&(i=t.slice(n),l[o]?l[o]+=i:l[++o]=i),l.length<2?c[0]?HD(c[0].x):LD(t):(t=c.length,function(u){for(var h=0,d;h<t;++h)l[(d=c[h]).i]=d.x(u);return l.join("")})}function Zl(e,t){var n=typeof t,s;return t==null||n==="boolean"?Bp(t):(n==="number"?Us:n==="string"?(s=ai(t))?(t=s,sh):t2:t instanceof ai?sh:t instanceof Date?$D:RD(t)?zD:Array.isArray(t)?UD:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?PD:Us)(e,t)}var Cb=180/Math.PI,rg={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function n2(e,t,n,s,r,i){var o,l,c;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(c=e*n+t*s)&&(n-=e*c,s-=t*c),(l=Math.sqrt(n*n+s*s))&&(n/=l,s/=l,c/=l),e*s<t*n&&(e=-e,t=-t,c=-c,o=-o),{translateX:r,translateY:i,rotate:Math.atan2(t,e)*Cb,skewX:Math.atan(c)*Cb,scaleX:o,scaleY:l}}var zd;function BD(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?rg:n2(t.a,t.b,t.c,t.d,t.e,t.f)}function VD(e){return e==null||(zd||(zd=document.createElementNS("http://www.w3.org/2000/svg","g")),zd.setAttribute("transform",e),!(e=zd.transform.baseVal.consolidate()))?rg:(e=e.matrix,n2(e.a,e.b,e.c,e.d,e.e,e.f))}function s2(e,t,n,s){function r(u){return u.length?u.pop()+" ":""}function i(u,h,d,f,x,b){if(u!==d||h!==f){var v=x.push("translate(",null,t,null,n);b.push({i:v-4,x:Us(u,d)},{i:v-2,x:Us(h,f)})}else(d||f)&&x.push("translate("+d+t+f+n)}function o(u,h,d,f){u!==h?(u-h>180?h+=360:h-u>180&&(u+=360),f.push({i:d.push(r(d)+"rotate(",null,s)-2,x:Us(u,h)})):h&&d.push(r(d)+"rotate("+h+s)}function l(u,h,d,f){u!==h?f.push({i:d.push(r(d)+"skewX(",null,s)-2,x:Us(u,h)}):h&&d.push(r(d)+"skewX("+h+s)}function c(u,h,d,f,x,b){if(u!==d||h!==f){var v=x.push(r(x)+"scale(",null,",",null,")");b.push({i:v-4,x:Us(u,d)},{i:v-2,x:Us(h,f)})}else(d!==1||f!==1)&&x.push(r(x)+"scale("+d+","+f+")")}return function(u,h){var d=[],f=[];return u=e(u),h=e(h),i(u.translateX,u.translateY,h.translateX,h.translateY,d,f),o(u.rotate,h.rotate,d,f),l(u.skewX,h.skewX,d,f),c(u.scaleX,u.scaleY,h.scaleX,h.scaleY,d,f),u=h=null,function(x){for(var b=-1,v=f.length,j;++b<v;)d[(j=f[b]).i]=j.x(x);return d.join("")}}}var YD=s2(BD,"px, ","px)","deg)"),FD=s2(VD,", ",")",")"),ID=1e-12;function Eb(e){return((e=Math.exp(e))+1/e)/2}function WD(e){return((e=Math.exp(e))-1/e)/2}function qD(e){return((e=Math.exp(2*e))-1)/(e+1)}const hu=function e(t,n,s){function r(i,o){var l=i[0],c=i[1],u=i[2],h=o[0],d=o[1],f=o[2],x=h-l,b=d-c,v=x*x+b*b,j,g;if(v<ID)g=Math.log(f/u)/t,j=function(C){return[l+C*x,c+C*b,u*Math.exp(t*C*g)]};else{var y=Math.sqrt(v),p=(f*f-u*u+s*v)/(2*u*n*y),w=(f*f-u*u-s*v)/(2*f*n*y),N=Math.log(Math.sqrt(p*p+1)-p),S=Math.log(Math.sqrt(w*w+1)-w);g=(S-N)/t,j=function(C){var T=C*g,U=Eb(N),B=u/(n*y)*(U*qD(t*T+N)-WD(N));return[l+B*x,c+B*b,u*U/Eb(t*T+N)]}}return j.duration=g*1e3*t/Math.SQRT2,j}return r.rho=function(i){var o=Math.max(.001,+i),l=o*o,c=l*l;return e(o,l,c)},r}(Math.SQRT2,2,4);var Mo=0,Al=0,xl=0,a2=1e3,ah,Ol,rh=0,ri=0,Zh=0,vc=typeof performance=="object"&&performance.now?performance:Date,r2=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Vp(){return ri||(r2(XD),ri=vc.now()+Zh)}function XD(){ri=0}function ih(){this._call=this._time=this._next=null}ih.prototype=i2.prototype={constructor:ih,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Vp():+n)+(t==null?0:+t),!this._next&&Ol!==this&&(Ol?Ol._next=this:ah=this,Ol=this),this._call=e,this._time=n,ig()},stop:function(){this._call&&(this._call=null,this._time=1/0,ig())}};function i2(e,t,n){var s=new ih;return s.restart(e,t,n),s}function GD(){Vp(),++Mo;for(var e=ah,t;e;)(t=ri-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Mo}function kb(){ri=(rh=vc.now())+Zh,Mo=Al=0;try{GD()}finally{Mo=0,QD(),ri=0}}function ZD(){var e=vc.now(),t=e-rh;t>a2&&(Zh-=t,rh=e)}function QD(){for(var e,t=ah,n,s=1/0;t;)t._call?(s>t._time&&(s=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:ah=n);Ol=e,ig(s)}function ig(e){if(!Mo){Al&&(Al=clearTimeout(Al));var t=e-ri;t>24?(e<1/0&&(Al=setTimeout(kb,e-vc.now()-Zh)),xl&&(xl=clearInterval(xl))):(xl||(rh=vc.now(),xl=setInterval(ZD,a2)),Mo=1,r2(kb))}}function Mb(e,t,n){var s=new ih;return t=t==null?0:+t,s.restart(r=>{s.stop(),e(r+t)},t,n),s}var KD=Xh("start","end","cancel","interrupt"),JD=[],o2=0,Tb=1,og=2,fu=3,Db=4,lg=5,mu=6;function Qh(e,t,n,s,r,i){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;e_(e,n,{name:t,index:s,group:r,on:KD,tween:JD,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:o2})}function Yp(e,t){var n=Es(e,t);if(n.state>o2)throw new Error("too late; already scheduled");return n}function Qs(e,t){var n=Es(e,t);if(n.state>fu)throw new Error("too late; already running");return n}function Es(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function e_(e,t,n){var s=e.__transition,r;s[t]=n,n.timer=i2(i,0,n.time);function i(u){n.state=Tb,n.timer.restart(o,n.delay,n.time),n.delay<=u&&o(u-n.delay)}function o(u){var h,d,f,x;if(n.state!==Tb)return c();for(h in s)if(x=s[h],x.name===n.name){if(x.state===fu)return Mb(o);x.state===Db?(x.state=mu,x.timer.stop(),x.on.call("interrupt",e,e.__data__,x.index,x.group),delete s[h]):+h<t&&(x.state=mu,x.timer.stop(),x.on.call("cancel",e,e.__data__,x.index,x.group),delete s[h])}if(Mb(function(){n.state===fu&&(n.state=Db,n.timer.restart(l,n.delay,n.time),l(u))}),n.state=og,n.on.call("start",e,e.__data__,n.index,n.group),n.state===og){for(n.state=fu,r=new Array(f=n.tween.length),h=0,d=-1;h<f;++h)(x=n.tween[h].value.call(e,e.__data__,n.index,n.group))&&(r[++d]=x);r.length=d+1}}function l(u){for(var h=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(c),n.state=lg,1),d=-1,f=r.length;++d<f;)r[d].call(e,h);n.state===lg&&(n.on.call("end",e,e.__data__,n.index,n.group),c())}function c(){n.state=mu,n.timer.stop(),delete s[t];for(var u in s)return;delete e.__transition}}function xu(e,t){var n=e.__transition,s,r,i=!0,o;if(n){t=t==null?null:t+"";for(o in n){if((s=n[o]).name!==t){i=!1;continue}r=s.state>og&&s.state<lg,s.state=mu,s.timer.stop(),s.on.call(r?"interrupt":"cancel",e,e.__data__,s.index,s.group),delete n[o]}i&&delete e.__transition}}function t_(e){return this.each(function(){xu(this,e)})}function n_(e,t){var n,s;return function(){var r=Qs(this,e),i=r.tween;if(i!==n){s=n=i;for(var o=0,l=s.length;o<l;++o)if(s[o].name===t){s=s.slice(),s.splice(o,1);break}}r.tween=s}}function s_(e,t,n){var s,r;if(typeof n!="function")throw new Error;return function(){var i=Qs(this,e),o=i.tween;if(o!==s){r=(s=o).slice();for(var l={name:t,value:n},c=0,u=r.length;c<u;++c)if(r[c].name===t){r[c]=l;break}c===u&&r.push(l)}i.tween=r}}function a_(e,t){var n=this._id;if(e+="",arguments.length<2){for(var s=Es(this.node(),n).tween,r=0,i=s.length,o;r<i;++r)if((o=s[r]).name===e)return o.value;return null}return this.each((t==null?n_:s_)(n,e,t))}function Fp(e,t,n){var s=e._id;return e.each(function(){var r=Qs(this,s);(r.value||(r.value={}))[t]=n.apply(this,arguments)}),function(r){return Es(r,s).value[t]}}function l2(e,t){var n;return(typeof t=="number"?Us:t instanceof ai?sh:(n=ai(t))?(t=n,sh):t2)(e,t)}function r_(e){return function(){this.removeAttribute(e)}}function i_(e){return function(){this.removeAttributeNS(e.space,e.local)}}function o_(e,t,n){var s,r=n+"",i;return function(){var o=this.getAttribute(e);return o===r?null:o===s?i:i=t(s=o,n)}}function l_(e,t,n){var s,r=n+"",i;return function(){var o=this.getAttributeNS(e.space,e.local);return o===r?null:o===s?i:i=t(s=o,n)}}function c_(e,t,n){var s,r,i;return function(){var o,l=n(this),c;return l==null?void this.removeAttribute(e):(o=this.getAttribute(e),c=l+"",o===c?null:o===s&&c===r?i:(r=c,i=t(s=o,l)))}}function d_(e,t,n){var s,r,i;return function(){var o,l=n(this),c;return l==null?void this.removeAttributeNS(e.space,e.local):(o=this.getAttributeNS(e.space,e.local),c=l+"",o===c?null:o===s&&c===r?i:(r=c,i=t(s=o,l)))}}function u_(e,t){var n=Gh(e),s=n==="transform"?FD:l2;return this.attrTween(e,typeof t=="function"?(n.local?d_:c_)(n,s,Fp(this,"attr."+e,t)):t==null?(n.local?i_:r_)(n):(n.local?l_:o_)(n,s,t))}function h_(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function f_(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function m_(e,t){var n,s;function r(){var i=t.apply(this,arguments);return i!==s&&(n=(s=i)&&f_(e,i)),n}return r._value=t,r}function x_(e,t){var n,s;function r(){var i=t.apply(this,arguments);return i!==s&&(n=(s=i)&&h_(e,i)),n}return r._value=t,r}function g_(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var s=Gh(e);return this.tween(n,(s.local?m_:x_)(s,t))}function p_(e,t){return function(){Yp(this,e).delay=+t.apply(this,arguments)}}function v_(e,t){return t=+t,function(){Yp(this,e).delay=t}}function b_(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?p_:v_)(t,e)):Es(this.node(),t).delay}function y_(e,t){return function(){Qs(this,e).duration=+t.apply(this,arguments)}}function w_(e,t){return t=+t,function(){Qs(this,e).duration=t}}function j_(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?y_:w_)(t,e)):Es(this.node(),t).duration}function N_(e,t){if(typeof t!="function")throw new Error;return function(){Qs(this,e).ease=t}}function S_(e){var t=this._id;return arguments.length?this.each(N_(t,e)):Es(this.node(),t).ease}function C_(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Qs(this,e).ease=n}}function E_(e){if(typeof e!="function")throw new Error;return this.each(C_(this._id,e))}function k_(e){typeof e!="function"&&(e=LN(e));for(var t=this._groups,n=t.length,s=new Array(n),r=0;r<n;++r)for(var i=t[r],o=i.length,l=s[r]=[],c,u=0;u<o;++u)(c=i[u])&&e.call(c,c.__data__,u,i)&&l.push(c);return new Sa(s,this._parents,this._name,this._id)}function M_(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,s=t.length,r=n.length,i=Math.min(s,r),o=new Array(s),l=0;l<i;++l)for(var c=t[l],u=n[l],h=c.length,d=o[l]=new Array(h),f,x=0;x<h;++x)(f=c[x]||u[x])&&(d[x]=f);for(;l<s;++l)o[l]=t[l];return new Sa(o,this._parents,this._name,this._id)}function T_(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function D_(e,t,n){var s,r,i=T_(t)?Yp:Qs;return function(){var o=i(this,e),l=o.on;l!==s&&(r=(s=l).copy()).on(t,n),o.on=r}}function __(e,t){var n=this._id;return arguments.length<2?Es(this.node(),n).on.on(e):this.each(D_(n,e,t))}function A_(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function O_(){return this.on("end.remove",A_(this._id))}function z_(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Pp(e));for(var s=this._groups,r=s.length,i=new Array(r),o=0;o<r;++o)for(var l=s[o],c=l.length,u=i[o]=new Array(c),h,d,f=0;f<c;++f)(h=l[f])&&(d=e.call(h,h.__data__,f,l))&&("__data__"in h&&(d.__data__=h.__data__),u[f]=d,Qh(u[f],t,n,f,u,Es(h,n)));return new Sa(i,this._parents,t,n)}function R_(e){var t=this._name,n=this._id;typeof e!="function"&&(e=PN(e));for(var s=this._groups,r=s.length,i=[],o=[],l=0;l<r;++l)for(var c=s[l],u=c.length,h,d=0;d<u;++d)if(h=c[d]){for(var f=e.call(h,h.__data__,d,c),x,b=Es(h,n),v=0,j=f.length;v<j;++v)(x=f[v])&&Qh(x,t,n,v,f,b);i.push(f),o.push(h)}return new Sa(i,o,t,n)}var U_=qc.prototype.constructor;function $_(){return new U_(this._groups,this._parents)}function P_(e,t){var n,s,r;return function(){var i=ko(this,e),o=(this.style.removeProperty(e),ko(this,e));return i===o?null:i===n&&o===s?r:r=t(n=i,s=o)}}function c2(e){return function(){this.style.removeProperty(e)}}function L_(e,t,n){var s,r=n+"",i;return function(){var o=ko(this,e);return o===r?null:o===s?i:i=t(s=o,n)}}function H_(e,t,n){var s,r,i;return function(){var o=ko(this,e),l=n(this),c=l+"";return l==null&&(c=l=(this.style.removeProperty(e),ko(this,e))),o===c?null:o===s&&c===r?i:(r=c,i=t(s=o,l))}}function B_(e,t){var n,s,r,i="style."+t,o="end."+i,l;return function(){var c=Qs(this,e),u=c.on,h=c.value[i]==null?l||(l=c2(t)):void 0;(u!==n||r!==h)&&(s=(n=u).copy()).on(o,r=h),c.on=s}}function V_(e,t,n){var s=(e+="")=="transform"?YD:l2;return t==null?this.styleTween(e,P_(e,s)).on("end.style."+e,c2(e)):typeof t=="function"?this.styleTween(e,H_(e,s,Fp(this,"style."+e,t))).each(B_(this._id,e)):this.styleTween(e,L_(e,s,t),n).on("end.style."+e,null)}function Y_(e,t,n){return function(s){this.style.setProperty(e,t.call(this,s),n)}}function F_(e,t,n){var s,r;function i(){var o=t.apply(this,arguments);return o!==r&&(s=(r=o)&&Y_(e,o,n)),s}return i._value=t,i}function I_(e,t,n){var s="style."+(e+="");if(arguments.length<2)return(s=this.tween(s))&&s._value;if(t==null)return this.tween(s,null);if(typeof t!="function")throw new Error;return this.tween(s,F_(e,t,n??""))}function W_(e){return function(){this.textContent=e}}function q_(e){return function(){var t=e(this);this.textContent=t??""}}function X_(e){return this.tween("text",typeof e=="function"?q_(Fp(this,"text",e)):W_(e==null?"":e+""))}function G_(e){return function(t){this.textContent=e.call(this,t)}}function Z_(e){var t,n;function s(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&G_(r)),t}return s._value=e,s}function Q_(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,Z_(e))}function K_(){for(var e=this._name,t=this._id,n=d2(),s=this._groups,r=s.length,i=0;i<r;++i)for(var o=s[i],l=o.length,c,u=0;u<l;++u)if(c=o[u]){var h=Es(c,t);Qh(c,e,n,u,o,{time:h.time+h.delay+h.duration,delay:0,duration:h.duration,ease:h.ease})}return new Sa(s,this._parents,e,n)}function J_(){var e,t,n=this,s=n._id,r=n.size();return new Promise(function(i,o){var l={value:o},c={value:function(){--r===0&&i()}};n.each(function(){var u=Qs(this,s),h=u.on;h!==e&&(t=(e=h).copy(),t._.cancel.push(l),t._.interrupt.push(l),t._.end.push(c)),u.on=t}),r===0&&i()})}var eA=0;function Sa(e,t,n,s){this._groups=e,this._parents=t,this._name=n,this._id=s}function d2(){return++eA}var aa=qc.prototype;Sa.prototype={constructor:Sa,select:z_,selectAll:R_,selectChild:aa.selectChild,selectChildren:aa.selectChildren,filter:k_,merge:M_,selection:$_,transition:K_,call:aa.call,nodes:aa.nodes,node:aa.node,size:aa.size,empty:aa.empty,each:aa.each,on:__,attr:u_,attrTween:g_,style:V_,styleTween:I_,text:X_,textTween:Q_,remove:O_,tween:a_,delay:b_,duration:j_,ease:S_,easeVarying:E_,end:J_,[Symbol.iterator]:aa[Symbol.iterator]};function tA(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var nA={time:null,delay:0,duration:250,ease:tA};function sA(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function aA(e){var t,n;e instanceof Sa?(t=e._id,e=e._name):(t=d2(),(n=nA).time=Vp(),e=e==null?null:e+"");for(var s=this._groups,r=s.length,i=0;i<r;++i)for(var o=s[i],l=o.length,c,u=0;u<l;++u)(c=o[u])&&Qh(c,e,t,u,o,n||sA(c,t));return new Sa(s,this._parents,e,t)}qc.prototype.interrupt=t_;qc.prototype.transition=aA;const Rd=e=>()=>e;function rA(e,{sourceEvent:t,target:n,transform:s,dispatch:r}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:s,enumerable:!0,configurable:!0},_:{value:r}})}function fa(e,t,n){this.k=e,this.x=t,this.y=n}fa.prototype={constructor:fa,scale:function(e){return e===1?this:new fa(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new fa(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Kh=new fa(1,0,0);u2.prototype=fa.prototype;function u2(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Kh;return e.__zoom}function ym(e){e.stopImmediatePropagation()}function gl(e){e.preventDefault(),e.stopImmediatePropagation()}function iA(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function oA(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function _b(){return this.__zoom||Kh}function lA(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function cA(){return navigator.maxTouchPoints||"ontouchstart"in this}function dA(e,t,n){var s=e.invertX(t[0][0])-n[0][0],r=e.invertX(t[1][0])-n[1][0],i=e.invertY(t[0][1])-n[0][1],o=e.invertY(t[1][1])-n[1][1];return e.translate(r>s?(s+r)/2:Math.min(0,s)||Math.max(0,r),o>i?(i+o)/2:Math.min(0,i)||Math.max(0,o))}function h2(){var e=iA,t=oA,n=dA,s=lA,r=cA,i=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],l=250,c=hu,u=Xh("start","zoom","end"),h,d,f,x=500,b=150,v=0,j=10;function g(k){k.property("__zoom",_b).on("wheel.zoom",T,{passive:!1}).on("mousedown.zoom",U).on("dblclick.zoom",B).filter(r).on("touchstart.zoom",P).on("touchmove.zoom",z).on("touchend.zoom touchcancel.zoom",Y).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}g.transform=function(k,$,M,_){var E=k.selection?k.selection():k;E.property("__zoom",_b),k!==E?N(k,$,M,_):E.interrupt().each(function(){S(this,arguments).event(_).start().zoom(null,typeof $=="function"?$.apply(this,arguments):$).end()})},g.scaleBy=function(k,$,M,_){g.scaleTo(k,function(){var E=this.__zoom.k,D=typeof $=="function"?$.apply(this,arguments):$;return E*D},M,_)},g.scaleTo=function(k,$,M,_){g.transform(k,function(){var E=t.apply(this,arguments),D=this.__zoom,A=M==null?w(E):typeof M=="function"?M.apply(this,arguments):M,q=D.invert(A),R=typeof $=="function"?$.apply(this,arguments):$;return n(p(y(D,R),A,q),E,o)},M,_)},g.translateBy=function(k,$,M,_){g.transform(k,function(){return n(this.__zoom.translate(typeof $=="function"?$.apply(this,arguments):$,typeof M=="function"?M.apply(this,arguments):M),t.apply(this,arguments),o)},null,_)},g.translateTo=function(k,$,M,_,E){g.transform(k,function(){var D=t.apply(this,arguments),A=this.__zoom,q=_==null?w(D):typeof _=="function"?_.apply(this,arguments):_;return n(Kh.translate(q[0],q[1]).scale(A.k).translate(typeof $=="function"?-$.apply(this,arguments):-$,typeof M=="function"?-M.apply(this,arguments):-M),D,o)},_,E)};function y(k,$){return $=Math.max(i[0],Math.min(i[1],$)),$===k.k?k:new fa($,k.x,k.y)}function p(k,$,M){var _=$[0]-M[0]*k.k,E=$[1]-M[1]*k.k;return _===k.x&&E===k.y?k:new fa(k.k,_,E)}function w(k){return[(+k[0][0]+ +k[1][0])/2,(+k[0][1]+ +k[1][1])/2]}function N(k,$,M,_){k.on("start.zoom",function(){S(this,arguments).event(_).start()}).on("interrupt.zoom end.zoom",function(){S(this,arguments).event(_).end()}).tween("zoom",function(){var E=this,D=arguments,A=S(E,D).event(_),q=t.apply(E,D),R=M==null?w(q):typeof M=="function"?M.apply(E,D):M,L=Math.max(q[1][0]-q[0][0],q[1][1]-q[0][1]),X=E.__zoom,G=typeof $=="function"?$.apply(E,D):$,te=c(X.invert(R).concat(L/X.k),G.invert(R).concat(L/G.k));return function(re){if(re===1)re=G;else{var ee=te(re),se=L/ee[2];re=new fa(se,R[0]-ee[0]*se,R[1]-ee[1]*se)}A.zoom(null,re)}})}function S(k,$,M){return!M&&k.__zooming||new C(k,$)}function C(k,$){this.that=k,this.args=$,this.active=0,this.sourceEvent=null,this.extent=t.apply(k,$),this.taps=0}C.prototype={event:function(k){return k&&(this.sourceEvent=k),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(k,$){return this.mouse&&k!=="mouse"&&(this.mouse[1]=$.invert(this.mouse[0])),this.touch0&&k!=="touch"&&(this.touch0[1]=$.invert(this.touch0[0])),this.touch1&&k!=="touch"&&(this.touch1[1]=$.invert(this.touch1[0])),this.that.__zoom=$,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(k){var $=Pn(this.that).datum();u.call(k,this.that,new rA(k,{sourceEvent:this.sourceEvent,target:g,transform:this.that.__zoom,dispatch:u}),$)}};function T(k,...$){if(!e.apply(this,arguments))return;var M=S(this,$).event(k),_=this.__zoom,E=Math.max(i[0],Math.min(i[1],_.k*Math.pow(2,s.apply(this,arguments)))),D=ds(k);if(M.wheel)(M.mouse[0][0]!==D[0]||M.mouse[0][1]!==D[1])&&(M.mouse[1]=_.invert(M.mouse[0]=D)),clearTimeout(M.wheel);else{if(_.k===E)return;M.mouse=[D,_.invert(D)],xu(this),M.start()}gl(k),M.wheel=setTimeout(A,b),M.zoom("mouse",n(p(y(_,E),M.mouse[0],M.mouse[1]),M.extent,o));function A(){M.wheel=null,M.end()}}function U(k,...$){if(f||!e.apply(this,arguments))return;var M=k.currentTarget,_=S(this,$,!0).event(k),E=Pn(k.view).on("mousemove.zoom",R,!0).on("mouseup.zoom",L,!0),D=ds(k,M),A=k.clientX,q=k.clientY;GN(k.view),ym(k),_.mouse=[D,this.__zoom.invert(D)],xu(this),_.start();function R(X){if(gl(X),!_.moved){var G=X.clientX-A,te=X.clientY-q;_.moved=G*G+te*te>v}_.event(X).zoom("mouse",n(p(_.that.__zoom,_.mouse[0]=ds(X,M),_.mouse[1]),_.extent,o))}function L(X){E.on("mousemove.zoom mouseup.zoom",null),ZN(X.view,_.moved),gl(X),_.event(X).end()}}function B(k,...$){if(e.apply(this,arguments)){var M=this.__zoom,_=ds(k.changedTouches?k.changedTouches[0]:k,this),E=M.invert(_),D=M.k*(k.shiftKey?.5:2),A=n(p(y(M,D),_,E),t.apply(this,$),o);gl(k),l>0?Pn(this).transition().duration(l).call(N,A,_,k):Pn(this).call(g.transform,A,_,k)}}function P(k,...$){if(e.apply(this,arguments)){var M=k.touches,_=M.length,E=S(this,$,k.changedTouches.length===_).event(k),D,A,q,R;for(ym(k),A=0;A<_;++A)q=M[A],R=ds(q,this),R=[R,this.__zoom.invert(R),q.identifier],E.touch0?!E.touch1&&E.touch0[2]!==R[2]&&(E.touch1=R,E.taps=0):(E.touch0=R,D=!0,E.taps=1+!!h);h&&(h=clearTimeout(h)),D&&(E.taps<2&&(d=R[0],h=setTimeout(function(){h=null},x)),xu(this),E.start())}}function z(k,...$){if(this.__zooming){var M=S(this,$).event(k),_=k.changedTouches,E=_.length,D,A,q,R;for(gl(k),D=0;D<E;++D)A=_[D],q=ds(A,this),M.touch0&&M.touch0[2]===A.identifier?M.touch0[0]=q:M.touch1&&M.touch1[2]===A.identifier&&(M.touch1[0]=q);if(A=M.that.__zoom,M.touch1){var L=M.touch0[0],X=M.touch0[1],G=M.touch1[0],te=M.touch1[1],re=(re=G[0]-L[0])*re+(re=G[1]-L[1])*re,ee=(ee=te[0]-X[0])*ee+(ee=te[1]-X[1])*ee;A=y(A,Math.sqrt(re/ee)),q=[(L[0]+G[0])/2,(L[1]+G[1])/2],R=[(X[0]+te[0])/2,(X[1]+te[1])/2]}else if(M.touch0)q=M.touch0[0],R=M.touch0[1];else return;M.zoom("touch",n(p(A,q,R),M.extent,o))}}function Y(k,...$){if(this.__zooming){var M=S(this,$).event(k),_=k.changedTouches,E=_.length,D,A;for(ym(k),f&&clearTimeout(f),f=setTimeout(function(){f=null},x),D=0;D<E;++D)A=_[D],M.touch0&&M.touch0[2]===A.identifier?delete M.touch0:M.touch1&&M.touch1[2]===A.identifier&&delete M.touch1;if(M.touch1&&!M.touch0&&(M.touch0=M.touch1,delete M.touch1),M.touch0)M.touch0[1]=this.__zoom.invert(M.touch0[0]);else if(M.end(),M.taps===2&&(A=ds(A,this),Math.hypot(d[0]-A[0],d[1]-A[1])<j)){var q=Pn(this).on("dblclick.zoom");q&&q.apply(this,arguments)}}}return g.wheelDelta=function(k){return arguments.length?(s=typeof k=="function"?k:Rd(+k),g):s},g.filter=function(k){return arguments.length?(e=typeof k=="function"?k:Rd(!!k),g):e},g.touchable=function(k){return arguments.length?(r=typeof k=="function"?k:Rd(!!k),g):r},g.extent=function(k){return arguments.length?(t=typeof k=="function"?k:Rd([[+k[0][0],+k[0][1]],[+k[1][0],+k[1][1]]]),g):t},g.scaleExtent=function(k){return arguments.length?(i[0]=+k[0],i[1]=+k[1],g):[i[0],i[1]]},g.translateExtent=function(k){return arguments.length?(o[0][0]=+k[0][0],o[1][0]=+k[1][0],o[0][1]=+k[0][1],o[1][1]=+k[1][1],g):[[o[0][0],o[0][1]],[o[1][0],o[1][1]]]},g.constrain=function(k){return arguments.length?(n=k,g):n},g.duration=function(k){return arguments.length?(l=+k,g):l},g.interpolate=function(k){return arguments.length?(c=k,g):c},g.on=function(){var k=u.on.apply(u,arguments);return k===u?g:k},g.clickDistance=function(k){return arguments.length?(v=(k=+k)*k,g):Math.sqrt(v)},g.tapDistance=function(k){return arguments.length?(j=+k,g):j},g}const qs={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:e=>`Node type "${e}" 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:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:s})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:s}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/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."},bc=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],f2=["Enter"," ","Escape"],m2={"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:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, 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 To;(function(e){e.Strict="strict",e.Loose="loose"})(To||(To={}));var Qr;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Qr||(Qr={}));var yc;(function(e){e.Partial="partial",e.Full="full"})(yc||(yc={}));const x2={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Ka;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Ka||(Ka={}));var oh;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(oh||(oh={}));var Te;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Te||(Te={}));const Ab={[Te.Left]:Te.Right,[Te.Right]:Te.Left,[Te.Top]:Te.Bottom,[Te.Bottom]:Te.Top};function g2(e){return e===null?null:e?"valid":"invalid"}const p2=e=>"id"in e&&"source"in e&&"target"in e,uA=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Ip=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),Gc=(e,t=[0,0])=>{const{width:n,height:s}=Ma(e),r=e.origin??t,i=n*r[0],o=s*r[1];return{x:e.position.x-i,y:e.position.y-o}},hA=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((s,r)=>{const i=typeof r=="string";let o=!t.nodeLookup&&!i?r:void 0;t.nodeLookup&&(o=i?t.nodeLookup.get(r):Ip(r)?r:t.nodeLookup.get(r.id));const l=o?lh(o,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Jh(s,l)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return ef(n)},Zc=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},s=!1;return e.forEach(r=>{(t.filter===void 0||t.filter(r))&&(n=Jh(n,lh(r)),s=!0)}),s?ef(n):{x:0,y:0,width:0,height:0}},Wp=(e,t,[n,s,r]=[0,0,1],i=!1,o=!1)=>{const l={...Kc(t,[n,s,r]),width:t.width/r,height:t.height/r},c=[];for(const u of e.values()){const{measured:h,selectable:d=!0,hidden:f=!1}=u;if(o&&!d||f)continue;const x=h.width??u.width??u.initialWidth??null,b=h.height??u.height??u.initialHeight??null,v=wc(l,_o(u)),j=(x??0)*(b??0),g=i&&v>0;(!u.internals.handleBounds||g||v>=j||u.dragging)&&c.push(u)}return c},fA=(e,t)=>{const n=new Set;return e.forEach(s=>{n.add(s.id)}),t.filter(s=>n.has(s.source)||n.has(s.target))};function mA(e,t){const n=new Map,s=t!=null&&t.nodes?new Set(t.nodes.map(r=>r.id)):null;return e.forEach(r=>{r.measured.width&&r.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!r.hidden)&&(!s||s.has(r.id))&&n.set(r.id,r)}),n}async function xA({nodes:e,width:t,height:n,panZoom:s,minZoom:r,maxZoom:i},o){if(e.size===0)return Promise.resolve(!0);const l=mA(e,o),c=Zc(l),u=qp(c,t,n,(o==null?void 0:o.minZoom)??r,(o==null?void 0:o.maxZoom)??i,(o==null?void 0:o.padding)??.1);return await s.setViewport(u,{duration:o==null?void 0:o.duration,ease:o==null?void 0:o.ease,interpolate:o==null?void 0:o.interpolate}),Promise.resolve(!0)}function v2({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:s=[0,0],nodeExtent:r,onError:i}){const o=n.get(e),l=o.parentId?n.get(o.parentId):void 0,{x:c,y:u}=l?l.internals.positionAbsolute:{x:0,y:0},h=o.origin??s;let d=o.extent||r;if(o.extent==="parent"&&!o.expandParent)if(!l)i==null||i("005",qs.error005());else{const x=l.measured.width,b=l.measured.height;x&&b&&(d=[[c,u],[c+x,u+b]])}else l&&Ao(o.extent)&&(d=[[o.extent[0][0]+c,o.extent[0][1]+u],[o.extent[1][0]+c,o.extent[1][1]+u]]);const f=Ao(d)?ii(t,d,o.measured):t;return(o.measured.width===void 0||o.measured.height===void 0)&&(i==null||i("015",qs.error015())),{position:{x:f.x-c+(o.measured.width??0)*h[0],y:f.y-u+(o.measured.height??0)*h[1]},positionAbsolute:f}}async function gA({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:s,onBeforeDelete:r}){const i=new Set(e.map(f=>f.id)),o=[];for(const f of n){if(f.deletable===!1)continue;const x=i.has(f.id),b=!x&&f.parentId&&o.find(v=>v.id===f.parentId);(x||b)&&o.push(f)}const l=new Set(t.map(f=>f.id)),c=s.filter(f=>f.deletable!==!1),h=fA(o,c);for(const f of c)l.has(f.id)&&!h.find(b=>b.id===f.id)&&h.push(f);if(!r)return{edges:h,nodes:o};const d=await r({nodes:o,edges:h});return typeof d=="boolean"?d?{edges:h,nodes:o}:{edges:[],nodes:[]}:d}const Do=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),ii=(e={x:0,y:0},t,n)=>({x:Do(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:Do(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function b2(e,t,n){const{width:s,height:r}=Ma(n),{x:i,y:o}=n.internals.positionAbsolute;return ii(e,[[i,o],[i+s,o+r]],t)}const Ob=(e,t,n)=>e<t?Do(Math.abs(e-t),1,t)/t:e>n?-Do(Math.abs(e-n),1,t)/t:0,y2=(e,t,n=15,s=40)=>{const r=Ob(e.x,s,t.width-s)*n,i=Ob(e.y,s,t.height-s)*n;return[r,i]},Jh=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),cg=({x:e,y:t,width:n,height:s})=>({x:e,y:t,x2:e+n,y2:t+s}),ef=({x:e,y:t,x2:n,y2:s})=>({x:e,y:t,width:n-e,height:s-t}),_o=(e,t=[0,0])=>{var r,i;const{x:n,y:s}=Ip(e)?e.internals.positionAbsolute:Gc(e,t);return{x:n,y:s,width:((r=e.measured)==null?void 0:r.width)??e.width??e.initialWidth??0,height:((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0}},lh=(e,t=[0,0])=>{var r,i;const{x:n,y:s}=Ip(e)?e.internals.positionAbsolute:Gc(e,t);return{x:n,y:s,x2:n+(((r=e.measured)==null?void 0:r.width)??e.width??e.initialWidth??0),y2:s+(((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0)}},w2=(e,t)=>ef(Jh(cg(e),cg(t))),wc=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),s=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*s)},zb=e=>xs(e.width)&&xs(e.height)&&xs(e.x)&&xs(e.y),xs=e=>!isNaN(e)&&isFinite(e),pA=(e,t)=>{},Qc=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Kc=({x:e,y:t},[n,s,r],i=!1,o=[1,1])=>{const l={x:(e-n)/r,y:(t-s)/r};return i?Qc(l,o):l},ch=({x:e,y:t},[n,s,r])=>({x:e*r+n,y:t*r+s});function Mi(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`[React Flow] The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function vA(e,t,n){if(typeof e=="string"||typeof e=="number"){const s=Mi(e,n),r=Mi(e,t);return{top:s,right:r,bottom:s,left:r,x:r*2,y:s*2}}if(typeof e=="object"){const s=Mi(e.top??e.y??0,n),r=Mi(e.bottom??e.y??0,n),i=Mi(e.left??e.x??0,t),o=Mi(e.right??e.x??0,t);return{top:s,right:o,bottom:r,left:i,x:i+o,y:s+r}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function bA(e,t,n,s,r,i){const{x:o,y:l}=ch(e,[t,n,s]),{x:c,y:u}=ch({x:e.x+e.width,y:e.y+e.height},[t,n,s]),h=r-c,d=i-u;return{left:Math.floor(o),top:Math.floor(l),right:Math.floor(h),bottom:Math.floor(d)}}const qp=(e,t,n,s,r,i)=>{const o=vA(i,t,n),l=(t-o.x)/e.width,c=(n-o.y)/e.height,u=Math.min(l,c),h=Do(u,s,r),d=e.x+e.width/2,f=e.y+e.height/2,x=t/2-d*h,b=n/2-f*h,v=bA(e,x,b,h,t,n),j={left:Math.min(v.left-o.left,0),top:Math.min(v.top-o.top,0),right:Math.min(v.right-o.right,0),bottom:Math.min(v.bottom-o.bottom,0)};return{x:x-j.left+j.right,y:b-j.top+j.bottom,zoom:h}},jc=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function Ao(e){return e!=null&&e!=="parent"}function Ma(e){var t,n;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight??0}}function j2(e){var t,n;return(((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth)!==void 0&&(((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight)!==void 0}function N2(e,t={width:0,height:0},n,s,r){const i={...e},o=s.get(n);if(o){const l=o.origin||r;i.x+=o.internals.positionAbsolute.x-(t.width??0)*l[0],i.y+=o.internals.positionAbsolute.y-(t.height??0)*l[1]}return i}function Rb(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function yA(){let e,t;return{promise:new Promise((s,r)=>{e=s,t=r}),resolve:e,reject:t}}function wA(e){return{...m2,...e||{}}}function Ql(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:s,containerBounds:r}){const{x:i,y:o}=gs(e),l=Kc({x:i-((r==null?void 0:r.left)??0),y:o-((r==null?void 0:r.top)??0)},s),{x:c,y:u}=n?Qc(l,t):l;return{xSnapped:c,ySnapped:u,...l}}const Xp=e=>({width:e.offsetWidth,height:e.offsetHeight}),S2=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},jA=["INPUT","SELECT","TEXTAREA"];function C2(e){var s,r;const t=((r=(s=e.composedPath)==null?void 0:s.call(e))==null?void 0:r[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:jA.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const E2=e=>"clientX"in e,gs=(e,t)=>{var i,o;const n=E2(e),s=n?e.clientX:(i=e.touches)==null?void 0:i[0].clientX,r=n?e.clientY:(o=e.touches)==null?void 0:o[0].clientY;return{x:s-((t==null?void 0:t.left)??0),y:r-((t==null?void 0:t.top)??0)}},Ub=(e,t,n,s,r)=>{const i=t.querySelectorAll(`.${e}`);return!i||!i.length?null:Array.from(i).map(o=>{const l=o.getBoundingClientRect();return{id:o.getAttribute("data-handleid"),type:e,nodeId:r,position:o.getAttribute("data-handlepos"),x:(l.left-n.left)/s,y:(l.top-n.top)/s,...Xp(o)}})};function k2({sourceX:e,sourceY:t,targetX:n,targetY:s,sourceControlX:r,sourceControlY:i,targetControlX:o,targetControlY:l}){const c=e*.125+r*.375+o*.375+n*.125,u=t*.125+i*.375+l*.375+s*.125,h=Math.abs(c-e),d=Math.abs(u-t);return[c,u,h,d]}function Ud(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function $b({pos:e,x1:t,y1:n,x2:s,y2:r,c:i}){switch(e){case Te.Left:return[t-Ud(t-s,i),n];case Te.Right:return[t+Ud(s-t,i),n];case Te.Top:return[t,n-Ud(n-r,i)];case Te.Bottom:return[t,n+Ud(r-n,i)]}}function M2({sourceX:e,sourceY:t,sourcePosition:n=Te.Bottom,targetX:s,targetY:r,targetPosition:i=Te.Top,curvature:o=.25}){const[l,c]=$b({pos:n,x1:e,y1:t,x2:s,y2:r,c:o}),[u,h]=$b({pos:i,x1:s,y1:r,x2:e,y2:t,c:o}),[d,f,x,b]=k2({sourceX:e,sourceY:t,targetX:s,targetY:r,sourceControlX:l,sourceControlY:c,targetControlX:u,targetControlY:h});return[`M${e},${t} C${l},${c} ${u},${h} ${s},${r}`,d,f,x,b]}function T2({sourceX:e,sourceY:t,targetX:n,targetY:s}){const r=Math.abs(n-e)/2,i=n<e?n+r:n-r,o=Math.abs(s-t)/2,l=s<t?s+o:s-o;return[i,l,r,o]}function NA({sourceNode:e,targetNode:t,selected:n=!1,zIndex:s,elevateOnSelect:r=!1}){if(s!==void 0)return s;const i=r&&n?1e3:0,o=Math.max(e.parentId||r&&e.selected?e.internals.z:0,t.parentId||r&&t.selected?t.internals.z:0);return i+o}function SA({sourceNode:e,targetNode:t,width:n,height:s,transform:r}){const i=Jh(lh(e),lh(t));i.x===i.x2&&(i.x2+=1),i.y===i.y2&&(i.y2+=1);const o={x:-r[0]/r[2],y:-r[1]/r[2],width:n/r[2],height:s/r[2]};return wc(o,ef(i))>0}const CA=({source:e,sourceHandle:t,target:n,targetHandle:s})=>`xy-edge__${e}${t||""}-${n}${s||""}`,EA=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),D2=(e,t)=>{if(!e.source||!e.target)return t;let n;return p2(e)?n={...e}:n={...e,id:CA(e)},EA(n,t)?t:(n.sourceHandle===null&&delete n.sourceHandle,n.targetHandle===null&&delete n.targetHandle,t.concat(n))};function _2({sourceX:e,sourceY:t,targetX:n,targetY:s}){const[r,i,o,l]=T2({sourceX:e,sourceY:t,targetX:n,targetY:s});return[`M ${e},${t}L ${n},${s}`,r,i,o,l]}const Pb={[Te.Left]:{x:-1,y:0},[Te.Right]:{x:1,y:0},[Te.Top]:{x:0,y:-1},[Te.Bottom]:{x:0,y:1}},kA=({source:e,sourcePosition:t=Te.Bottom,target:n})=>t===Te.Left||t===Te.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},Lb=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function MA({source:e,sourcePosition:t=Te.Bottom,target:n,targetPosition:s=Te.Top,center:r,offset:i,stepPosition:o}){const l=Pb[t],c=Pb[s],u={x:e.x+l.x*i,y:e.y+l.y*i},h={x:n.x+c.x*i,y:n.y+c.y*i},d=kA({source:u,sourcePosition:t,target:h}),f=d.x!==0?"x":"y",x=d[f];let b=[],v,j;const g={x:0,y:0},y={x:0,y:0},[,,p,w]=T2({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(l[f]*c[f]===-1){f==="x"?(v=r.x??u.x+(h.x-u.x)*o,j=r.y??(u.y+h.y)/2):(v=r.x??(u.x+h.x)/2,j=r.y??u.y+(h.y-u.y)*o);const S=[{x:v,y:u.y},{x:v,y:h.y}],C=[{x:u.x,y:j},{x:h.x,y:j}];l[f]===x?b=f==="x"?S:C:b=f==="x"?C:S}else{const S=[{x:u.x,y:h.y}],C=[{x:h.x,y:u.y}];if(f==="x"?b=l.x===x?C:S:b=l.y===x?S:C,t===s){const z=Math.abs(e[f]-n[f]);if(z<=i){const Y=Math.min(i-1,i-z);l[f]===x?g[f]=(u[f]>e[f]?-1:1)*Y:y[f]=(h[f]>n[f]?-1:1)*Y}}if(t!==s){const z=f==="x"?"y":"x",Y=l[f]===c[z],k=u[z]>h[z],$=u[z]<h[z];(l[f]===1&&(!Y&&k||Y&&$)||l[f]!==1&&(!Y&&$||Y&&k))&&(b=f==="x"?S:C)}const T={x:u.x+g.x,y:u.y+g.y},U={x:h.x+y.x,y:h.y+y.y},B=Math.max(Math.abs(T.x-b[0].x),Math.abs(U.x-b[0].x)),P=Math.max(Math.abs(T.y-b[0].y),Math.abs(U.y-b[0].y));B>=P?(v=(T.x+U.x)/2,j=b[0].y):(v=b[0].x,j=(T.y+U.y)/2)}return[[e,{x:u.x+g.x,y:u.y+g.y},...b,{x:h.x+y.x,y:h.y+y.y},n],v,j,p,w]}function TA(e,t,n,s){const r=Math.min(Lb(e,t)/2,Lb(t,n)/2,s),{x:i,y:o}=t;if(e.x===i&&i===n.x||e.y===o&&o===n.y)return`L${i} ${o}`;if(e.y===o){const u=e.x<n.x?-1:1,h=e.y<n.y?1:-1;return`L ${i+r*u},${o}Q ${i},${o} ${i},${o+r*h}`}const l=e.x<n.x?1:-1,c=e.y<n.y?-1:1;return`L ${i},${o+r*c}Q ${i},${o} ${i+r*l},${o}`}function dg({sourceX:e,sourceY:t,sourcePosition:n=Te.Bottom,targetX:s,targetY:r,targetPosition:i=Te.Top,borderRadius:o=5,centerX:l,centerY:c,offset:u=20,stepPosition:h=.5}){const[d,f,x,b,v]=MA({source:{x:e,y:t},sourcePosition:n,target:{x:s,y:r},targetPosition:i,center:{x:l,y:c},offset:u,stepPosition:h});return[d.reduce((g,y,p)=>{let w="";return p>0&&p<d.length-1?w=TA(d[p-1],y,d[p+1],o):w=`${p===0?"M":"L"}${y.x} ${y.y}`,g+=w,g},""),f,x,b,v]}function Hb(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function DA(e){var d;const{sourceNode:t,targetNode:n}=e;if(!Hb(t)||!Hb(n))return null;const s=t.internals.handleBounds||Bb(t.handles),r=n.internals.handleBounds||Bb(n.handles),i=Vb((s==null?void 0:s.source)??[],e.sourceHandle),o=Vb(e.connectionMode===To.Strict?(r==null?void 0:r.target)??[]:((r==null?void 0:r.target)??[]).concat((r==null?void 0:r.source)??[]),e.targetHandle);if(!i||!o)return(d=e.onError)==null||d.call(e,"008",qs.error008(i?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const l=(i==null?void 0:i.position)||Te.Bottom,c=(o==null?void 0:o.position)||Te.Top,u=Nc(t,i,l),h=Nc(n,o,c);return{sourceX:u.x,sourceY:u.y,targetX:h.x,targetY:h.y,sourcePosition:l,targetPosition:c}}function Bb(e){if(!e)return null;const t=[],n=[];for(const s of e)s.width=s.width??1,s.height=s.height??1,s.type==="source"?t.push(s):s.type==="target"&&n.push(s);return{source:t,target:n}}function Nc(e,t,n=Te.Left,s=!1){const r=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,i=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:o,height:l}=t??Ma(e);if(s)return{x:r+o/2,y:i+l/2};switch((t==null?void 0:t.position)??n){case Te.Top:return{x:r+o/2,y:i};case Te.Right:return{x:r+o,y:i+l/2};case Te.Bottom:return{x:r+o/2,y:i+l};case Te.Left:return{x:r,y:i+l/2}}}function Vb(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function ug(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(s=>`${s}=${e[s]}`).join("&")}`:""}function _A(e,{id:t,defaultColor:n,defaultMarkerStart:s,defaultMarkerEnd:r}){const i=new Set;return e.reduce((o,l)=>([l.markerStart||s,l.markerEnd||r].forEach(c=>{if(c&&typeof c=="object"){const u=ug(c,t);i.has(u)||(o.push({id:u,color:c.color||n,...c}),i.add(u))}}),o),[]).sort((o,l)=>o.id.localeCompare(l.id))}const A2=1e3,AA=10,Gp={nodeOrigin:[0,0],nodeExtent:bc,elevateNodesOnSelect:!0,defaults:{}},OA={...Gp,checkEquality:!0};function Zp(e,t){const n={...e};for(const s in t)t[s]!==void 0&&(n[s]=t[s]);return n}function zA(e,t,n){const s=Zp(Gp,n);for(const r of e.values())if(r.parentId)Qp(r,e,t,s);else{const i=Gc(r,s.nodeOrigin),o=Ao(r.extent)?r.extent:s.nodeExtent,l=ii(i,o,Ma(r));r.internals.positionAbsolute=l}}function RA(e,t){if(!e.handles)return e.measured?t==null?void 0:t.internals.handleBounds:void 0;const n=[],s=[];for(const r of e.handles){const i={id:r.id,width:r.width??1,height:r.height??1,nodeId:e.id,x:r.x,y:r.y,position:r.position,type:r.type};r.type==="source"?n.push(i):r.type==="target"&&s.push(i)}return{source:n,target:s}}function hg(e,t,n,s){var u,h;const r=Zp(OA,s);let i={i:-1},o=e.length>0;const l=new Map(t),c=r!=null&&r.elevateNodesOnSelect?A2:0;t.clear(),n.clear();for(const d of e){let f=l.get(d.id);if(r.checkEquality&&d===(f==null?void 0:f.internals.userNode))t.set(d.id,f);else{const x=Gc(d,r.nodeOrigin),b=Ao(d.extent)?d.extent:r.nodeExtent,v=ii(x,b,Ma(d));f={...r.defaults,...d,measured:{width:(u=d.measured)==null?void 0:u.width,height:(h=d.measured)==null?void 0:h.height},internals:{positionAbsolute:v,handleBounds:RA(d,f),z:O2(d,c),userNode:d}},t.set(d.id,f)}(f.measured===void 0||f.measured.width===void 0||f.measured.height===void 0)&&!f.hidden&&(o=!1),d.parentId&&Qp(f,t,n,s,i)}return o}function UA(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function Qp(e,t,n,s,r){const{elevateNodesOnSelect:i,nodeOrigin:o,nodeExtent:l}=Zp(Gp,s),c=e.parentId,u=t.get(c);if(!u){console.warn(`Parent node ${c} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}UA(e,n),r&&!u.parentId&&u.internals.rootParentIndex===void 0&&(u.internals.rootParentIndex=++r.i,u.internals.z=u.internals.z+r.i*AA),r&&u.internals.rootParentIndex!==void 0&&(r.i=u.internals.rootParentIndex);const h=i?A2:0,{x:d,y:f,z:x}=$A(e,u,o,l,h),{positionAbsolute:b}=e.internals,v=d!==b.x||f!==b.y;(v||x!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:v?{x:d,y:f}:b,z:x}})}function O2(e,t){return(xs(e.zIndex)?e.zIndex:0)+(e.selected?t:0)}function $A(e,t,n,s,r){const{x:i,y:o}=t.internals.positionAbsolute,l=Ma(e),c=Gc(e,n),u=Ao(e.extent)?ii(c,e.extent,l):c;let h=ii({x:i+u.x,y:o+u.y},s,l);e.extent==="parent"&&(h=b2(h,l,t));const d=O2(e,r),f=t.internals.z??0;return{x:h.x,y:h.y,z:f>=d?f+1:d}}function Kp(e,t,n,s=[0,0]){var o;const r=[],i=new Map;for(const l of e){const c=t.get(l.parentId);if(!c)continue;const u=((o=i.get(l.parentId))==null?void 0:o.expandedRect)??_o(c),h=w2(u,l.rect);i.set(l.parentId,{expandedRect:h,parent:c})}return i.size>0&&i.forEach(({expandedRect:l,parent:c},u)=>{var p;const h=c.internals.positionAbsolute,d=Ma(c),f=c.origin??s,x=l.x<h.x?Math.round(Math.abs(h.x-l.x)):0,b=l.y<h.y?Math.round(Math.abs(h.y-l.y)):0,v=Math.max(d.width,Math.round(l.width)),j=Math.max(d.height,Math.round(l.height)),g=(v-d.width)*f[0],y=(j-d.height)*f[1];(x>0||b>0||g||y)&&(r.push({id:u,type:"position",position:{x:c.position.x-x+g,y:c.position.y-b+y}}),(p=n.get(u))==null||p.forEach(w=>{e.some(N=>N.id===w.id)||r.push({id:w.id,type:"position",position:{x:w.position.x+x,y:w.position.y+b}})})),(d.width<l.width||d.height<l.height||x||b)&&r.push({id:u,type:"dimensions",setAttributes:!0,dimensions:{width:v+(x?f[0]*x-g:0),height:j+(b?f[1]*b-y:0)}})}),r}function PA(e,t,n,s,r,i){const o=s==null?void 0:s.querySelector(".xyflow__viewport");let l=!1;if(!o)return{changes:[],updatedInternals:l};const c=[],u=window.getComputedStyle(o),{m22:h}=new window.DOMMatrixReadOnly(u.transform),d=[];for(const f of e.values()){const x=t.get(f.id);if(!x)continue;if(x.hidden){t.set(x.id,{...x,internals:{...x.internals,handleBounds:void 0}}),l=!0;continue}const b=Xp(f.nodeElement),v=x.measured.width!==b.width||x.measured.height!==b.height;if(!!(b.width&&b.height&&(v||!x.internals.handleBounds||f.force))){const g=f.nodeElement.getBoundingClientRect(),y=Ao(x.extent)?x.extent:i;let{positionAbsolute:p}=x.internals;x.parentId&&x.extent==="parent"?p=b2(p,b,t.get(x.parentId)):y&&(p=ii(p,y,b));const w={...x,measured:b,internals:{...x.internals,positionAbsolute:p,handleBounds:{source:Ub("source",f.nodeElement,g,h,x.id),target:Ub("target",f.nodeElement,g,h,x.id)}}};t.set(x.id,w),x.parentId&&Qp(w,t,n,{nodeOrigin:r}),l=!0,v&&(c.push({id:x.id,type:"dimensions",dimensions:b}),x.expandParent&&x.parentId&&d.push({id:x.id,parentId:x.parentId,rect:_o(w,r)}))}}if(d.length>0){const f=Kp(d,t,n,r);c.push(...f)}return{changes:c,updatedInternals:l}}async function LA({delta:e,panZoom:t,transform:n,translateExtent:s,width:r,height:i}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const o=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[r,i]],s),l=!!o&&(o.x!==n[0]||o.y!==n[1]||o.k!==n[2]);return Promise.resolve(l)}function Yb(e,t,n,s,r,i){let o=r;const l=s.get(o)||new Map;s.set(o,l.set(n,t)),o=`${r}-${e}`;const c=s.get(o)||new Map;if(s.set(o,c.set(n,t)),i){o=`${r}-${e}-${i}`;const u=s.get(o)||new Map;s.set(o,u.set(n,t))}}function z2(e,t,n){e.clear(),t.clear();for(const s of n){const{source:r,target:i,sourceHandle:o=null,targetHandle:l=null}=s,c={edgeId:s.id,source:r,target:i,sourceHandle:o,targetHandle:l},u=`${r}-${o}--${i}-${l}`,h=`${i}-${l}--${r}-${o}`;Yb("source",c,h,e,r,o),Yb("target",c,u,e,i,l),t.set(s.id,s)}}function R2(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:R2(n,t):!1}function Fb(e,t,n){var r;let s=e;do{if((r=s==null?void 0:s.matches)!=null&&r.call(s,t))return!0;if(s===n)return!1;s=s==null?void 0:s.parentElement}while(s);return!1}function HA(e,t,n,s){const r=new Map;for(const[i,o]of e)if((o.selected||o.id===s)&&(!o.parentId||!R2(o,e))&&(o.draggable||t&&typeof o.draggable>"u")){const l=e.get(i);l&&r.set(i,{id:i,position:l.position||{x:0,y:0},distance:{x:n.x-l.internals.positionAbsolute.x,y:n.y-l.internals.positionAbsolute.y},extent:l.extent,parentId:l.parentId,origin:l.origin,expandParent:l.expandParent,internals:{positionAbsolute:l.internals.positionAbsolute||{x:0,y:0}},measured:{width:l.measured.width??0,height:l.measured.height??0}})}return r}function wm({nodeId:e,dragItems:t,nodeLookup:n,dragging:s=!0}){var o,l,c;const r=[];for(const[u,h]of t){const d=(o=n.get(u))==null?void 0:o.internals.userNode;d&&r.push({...d,position:h.position,dragging:s})}if(!e)return[r[0],r];const i=(l=n.get(e))==null?void 0:l.internals.userNode;return[i?{...i,position:((c=t.get(e))==null?void 0:c.position)||i.position,dragging:s}:r[0],r]}function BA({dragItems:e,snapGrid:t,x:n,y:s}){const r=e.values().next().value;if(!r)return null;const i={x:n-r.distance.x,y:s-r.distance.y},o=Qc(i,t);return{x:o.x-i.x,y:o.y-i.y}}function VA({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:s,onDragStop:r}){let i={x:null,y:null},o=0,l=new Map,c=!1,u={x:0,y:0},h=null,d=!1,f=null,x=!1,b=!1,v=null;function j({noDragClassName:y,handleSelector:p,domNode:w,isSelectable:N,nodeId:S,nodeClickDistance:C=0}){f=Pn(w);function T({x:z,y:Y}){const{nodeLookup:k,nodeExtent:$,snapGrid:M,snapToGrid:_,nodeOrigin:E,onNodeDrag:D,onSelectionDrag:A,onError:q,updateNodePositions:R}=t();i={x:z,y:Y};let L=!1;const X=l.size>1,G=X&&$?cg(Zc(l)):null,te=X&&_?BA({dragItems:l,snapGrid:M,x:z,y:Y}):null;for(const[re,ee]of l){if(!k.has(re))continue;let se={x:z-ee.distance.x,y:Y-ee.distance.y};_&&(se=te?{x:Math.round(se.x+te.x),y:Math.round(se.y+te.y)}:Qc(se,M));let ge=null;if(X&&$&&!ee.extent&&G){const{positionAbsolute:he}=ee.internals,we=he.x-G.x+$[0][0],Ne=he.x+ee.measured.width-G.x2+$[1][0],Ce=he.y-G.y+$[0][1],Ae=he.y+ee.measured.height-G.y2+$[1][1];ge=[[we,Ce],[Ne,Ae]]}const{position:ae,positionAbsolute:ue}=v2({nodeId:re,nextPosition:se,nodeLookup:k,nodeExtent:ge||$,nodeOrigin:E,onError:q});L=L||ee.position.x!==ae.x||ee.position.y!==ae.y,ee.position=ae,ee.internals.positionAbsolute=ue}if(b=b||L,!!L&&(R(l,!0),v&&(s||D||!S&&A))){const[re,ee]=wm({nodeId:S,dragItems:l,nodeLookup:k});s==null||s(v,l,re,ee),D==null||D(v,re,ee),S||A==null||A(v,ee)}}async function U(){if(!h)return;const{transform:z,panBy:Y,autoPanSpeed:k,autoPanOnNodeDrag:$}=t();if(!$){c=!1,cancelAnimationFrame(o);return}const[M,_]=y2(u,h,k);(M!==0||_!==0)&&(i.x=(i.x??0)-M/z[2],i.y=(i.y??0)-_/z[2],await Y({x:M,y:_})&&T(i)),o=requestAnimationFrame(U)}function B(z){var X;const{nodeLookup:Y,multiSelectionActive:k,nodesDraggable:$,transform:M,snapGrid:_,snapToGrid:E,selectNodesOnDrag:D,onNodeDragStart:A,onSelectionDragStart:q,unselectNodesAndEdges:R}=t();d=!0,(!D||!N)&&!k&&S&&((X=Y.get(S))!=null&&X.selected||R()),N&&D&&S&&(e==null||e(S));const L=Ql(z.sourceEvent,{transform:M,snapGrid:_,snapToGrid:E,containerBounds:h});if(i=L,l=HA(Y,$,L,S),l.size>0&&(n||A||!S&&q)){const[G,te]=wm({nodeId:S,dragItems:l,nodeLookup:Y});n==null||n(z.sourceEvent,l,G,te),A==null||A(z.sourceEvent,G,te),S||q==null||q(z.sourceEvent,te)}}const P=QN().clickDistance(C).on("start",z=>{const{domNode:Y,nodeDragThreshold:k,transform:$,snapGrid:M,snapToGrid:_}=t();h=(Y==null?void 0:Y.getBoundingClientRect())||null,x=!1,b=!1,v=z.sourceEvent,k===0&&B(z),i=Ql(z.sourceEvent,{transform:$,snapGrid:M,snapToGrid:_,containerBounds:h}),u=gs(z.sourceEvent,h)}).on("drag",z=>{const{autoPanOnNodeDrag:Y,transform:k,snapGrid:$,snapToGrid:M,nodeDragThreshold:_,nodeLookup:E}=t(),D=Ql(z.sourceEvent,{transform:k,snapGrid:$,snapToGrid:M,containerBounds:h});if(v=z.sourceEvent,(z.sourceEvent.type==="touchmove"&&z.sourceEvent.touches.length>1||S&&!E.has(S))&&(x=!0),!x){if(!c&&Y&&d&&(c=!0,U()),!d){const A=gs(z.sourceEvent,h),q=A.x-u.x,R=A.y-u.y;Math.sqrt(q*q+R*R)>_&&B(z)}(i.x!==D.xSnapped||i.y!==D.ySnapped)&&l&&d&&(u=gs(z.sourceEvent,h),T(D))}}).on("end",z=>{if(!(!d||x)&&(c=!1,d=!1,cancelAnimationFrame(o),l.size>0)){const{nodeLookup:Y,updateNodePositions:k,onNodeDragStop:$,onSelectionDragStop:M}=t();if(b&&(k(l,!1),b=!1),r||$||!S&&M){const[_,E]=wm({nodeId:S,dragItems:l,nodeLookup:Y,dragging:!1});r==null||r(z.sourceEvent,l,_,E),$==null||$(z.sourceEvent,_,E),S||M==null||M(z.sourceEvent,E)}}}).filter(z=>{const Y=z.target;return!z.button&&(!y||!Fb(Y,`.${y}`,w))&&(!p||Fb(Y,p,w))});f.call(P)}function g(){f==null||f.on(".drag",null)}return{update:j,destroy:g}}function YA(e,t,n){const s=[],r={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const i of t.values())wc(r,_o(i))>0&&s.push(i);return s}const FA=250;function IA(e,t,n,s){var l,c;let r=[],i=1/0;const o=YA(e,n,t+FA);for(const u of o){const h=[...((l=u.internals.handleBounds)==null?void 0:l.source)??[],...((c=u.internals.handleBounds)==null?void 0:c.target)??[]];for(const d of h){if(s.nodeId===d.nodeId&&s.type===d.type&&s.id===d.id)continue;const{x:f,y:x}=Nc(u,d,d.position,!0),b=Math.sqrt(Math.pow(f-e.x,2)+Math.pow(x-e.y,2));b>t||(b<i?(r=[{...d,x:f,y:x}],i=b):b===i&&r.push({...d,x:f,y:x}))}}if(!r.length)return null;if(r.length>1){const u=s.type==="source"?"target":"source";return r.find(h=>h.type===u)??r[0]}return r[0]}function U2(e,t,n,s,r,i=!1){var u,h,d;const o=s.get(e);if(!o)return null;const l=r==="strict"?(u=o.internals.handleBounds)==null?void 0:u[t]:[...((h=o.internals.handleBounds)==null?void 0:h.source)??[],...((d=o.internals.handleBounds)==null?void 0:d.target)??[]],c=(n?l==null?void 0:l.find(f=>f.id===n):l==null?void 0:l[0])??null;return c&&i?{...c,...Nc(o,c,c.position,!0)}:c}function $2(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function WA(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const P2=()=>!0;function qA(e,{connectionMode:t,connectionRadius:n,handleId:s,nodeId:r,edgeUpdaterType:i,isTarget:o,domNode:l,nodeLookup:c,lib:u,autoPanOnConnect:h,flowId:d,panBy:f,cancelConnection:x,onConnectStart:b,onConnect:v,onConnectEnd:j,isValidConnection:g=P2,onReconnectEnd:y,updateConnection:p,getTransform:w,getFromHandle:N,autoPanSpeed:S,dragThreshold:C=1,handleDomNode:T}){const U=S2(e.target);let B=0,P;const{x:z,y:Y}=gs(e),k=$2(i,T),$=l==null?void 0:l.getBoundingClientRect();let M=!1;if(!$||!k)return;const _=U2(r,k,s,c,t);if(!_)return;let E=gs(e,$),D=!1,A=null,q=!1,R=null;function L(){if(!h||!$)return;const[ae,ue]=y2(E,$,S);f({x:ae,y:ue}),B=requestAnimationFrame(L)}const X={..._,nodeId:r,type:k,position:_.position},G=c.get(r);let re={inProgress:!0,isValid:null,from:Nc(G,X,Te.Left,!0),fromHandle:X,fromPosition:X.position,fromNode:G,to:E,toHandle:null,toPosition:Ab[X.position],toNode:null,pointer:E};function ee(){M=!0,p(re),b==null||b(e,{nodeId:r,handleId:s,handleType:k})}C===0&&ee();function se(ae){if(!M){const{x:Ne,y:Ce}=gs(ae),Ae=Ne-z,tt=Ce-Y;if(!(Ae*Ae+tt*tt>C*C))return;ee()}if(!N()||!X){ge(ae);return}const ue=w();E=gs(ae,$),P=IA(Kc(E,ue,!1,[1,1]),n,c,X),D||(L(),D=!0);const he=L2(ae,{handle:P,connectionMode:t,fromNodeId:r,fromHandleId:s,fromType:o?"target":"source",isValidConnection:g,doc:U,lib:u,flowId:d,nodeLookup:c});R=he.handleDomNode,A=he.connection,q=WA(!!P,he.isValid);const we={...re,isValid:q,to:he.toHandle&&q?ch({x:he.toHandle.x,y:he.toHandle.y},ue):E,toHandle:he.toHandle,toPosition:q&&he.toHandle?he.toHandle.position:Ab[X.position],toNode:he.toHandle?c.get(he.toHandle.nodeId):null,pointer:E};p(we),re=we}function ge(ae){if(!("touches"in ae&&ae.touches.length>0)){if(M){(P||R)&&A&&q&&(v==null||v(A));const{inProgress:ue,...he}=re,we={...he,toPosition:re.toHandle?re.toPosition:null};j==null||j(ae,we),i&&(y==null||y(ae,we))}x(),cancelAnimationFrame(B),D=!1,q=!1,A=null,R=null,U.removeEventListener("mousemove",se),U.removeEventListener("mouseup",ge),U.removeEventListener("touchmove",se),U.removeEventListener("touchend",ge)}}U.addEventListener("mousemove",se),U.addEventListener("mouseup",ge),U.addEventListener("touchmove",se),U.addEventListener("touchend",ge)}function L2(e,{handle:t,connectionMode:n,fromNodeId:s,fromHandleId:r,fromType:i,doc:o,lib:l,flowId:c,isValidConnection:u=P2,nodeLookup:h}){const d=i==="target",f=t?o.querySelector(`.${l}-flow__handle[data-id="${c}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x,y:b}=gs(e),v=o.elementFromPoint(x,b),j=v!=null&&v.classList.contains(`${l}-flow__handle`)?v:f,g={handleDomNode:j,isValid:!1,connection:null,toHandle:null};if(j){const y=$2(void 0,j),p=j.getAttribute("data-nodeid"),w=j.getAttribute("data-handleid"),N=j.classList.contains("connectable"),S=j.classList.contains("connectableend");if(!p||!y)return g;const C={source:d?p:s,sourceHandle:d?w:r,target:d?s:p,targetHandle:d?r:w};g.connection=C;const U=N&&S&&(n===To.Strict?d&&y==="source"||!d&&y==="target":p!==s||w!==r);g.isValid=U&&u(C),g.toHandle=U2(p,y,w,h,n,!0)}return g}const fg={onPointerDown:qA,isValid:L2};function XA({domNode:e,panZoom:t,getTransform:n,getViewScale:s}){const r=Pn(e);function i({translateExtent:l,width:c,height:u,zoomStep:h=1,pannable:d=!0,zoomable:f=!0,inversePan:x=!1}){const b=p=>{if(p.sourceEvent.type!=="wheel"||!t)return;const w=n(),N=p.sourceEvent.ctrlKey&&jc()?10:1,S=-p.sourceEvent.deltaY*(p.sourceEvent.deltaMode===1?.05:p.sourceEvent.deltaMode?1:.002)*h,C=w[2]*Math.pow(2,S*N);t.scaleTo(C)};let v=[0,0];const j=p=>{(p.sourceEvent.type==="mousedown"||p.sourceEvent.type==="touchstart")&&(v=[p.sourceEvent.clientX??p.sourceEvent.touches[0].clientX,p.sourceEvent.clientY??p.sourceEvent.touches[0].clientY])},g=p=>{const w=n();if(p.sourceEvent.type!=="mousemove"&&p.sourceEvent.type!=="touchmove"||!t)return;const N=[p.sourceEvent.clientX??p.sourceEvent.touches[0].clientX,p.sourceEvent.clientY??p.sourceEvent.touches[0].clientY],S=[N[0]-v[0],N[1]-v[1]];v=N;const C=s()*Math.max(w[2],Math.log(w[2]))*(x?-1:1),T={x:w[0]-S[0]*C,y:w[1]-S[1]*C},U=[[0,0],[c,u]];t.setViewportConstrained({x:T.x,y:T.y,zoom:w[2]},U,l)},y=h2().on("start",j).on("zoom",d?g:null).on("zoom.wheel",f?b:null);r.call(y,{})}function o(){r.on("zoom",null)}return{update:i,destroy:o,pointer:ds}}const tf=e=>({x:e.x,y:e.y,zoom:e.k}),jm=({x:e,y:t,zoom:n})=>Kh.translate(e,t).scale(n),Ki=(e,t)=>e.target.closest(`.${t}`),H2=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),GA=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,Nm=(e,t=0,n=GA,s=()=>{})=>{const r=typeof t=="number"&&t>0;return r||s(),r?e.transition().duration(t).ease(n).on("end",s):e},B2=e=>{const t=e.ctrlKey&&jc()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function ZA({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:s,panOnScrollMode:r,panOnScrollSpeed:i,zoomOnPinch:o,onPanZoomStart:l,onPanZoom:c,onPanZoomEnd:u}){return h=>{if(Ki(h,t))return h.ctrlKey&&h.preventDefault(),!1;h.preventDefault(),h.stopImmediatePropagation();const d=n.property("__zoom").k||1;if(h.ctrlKey&&o){const j=ds(h),g=B2(h),y=d*Math.pow(2,g);s.scaleTo(n,y,j,h);return}const f=h.deltaMode===1?20:1;let x=r===Qr.Vertical?0:h.deltaX*f,b=r===Qr.Horizontal?0:h.deltaY*f;!jc()&&h.shiftKey&&r!==Qr.Vertical&&(x=h.deltaY*f,b=0),s.translateBy(n,-(x/d)*i,-(b/d)*i,{internal:!0});const v=tf(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(c==null||c(h,v),e.panScrollTimeout=setTimeout(()=>{u==null||u(h,v),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,l==null||l(h,v))}}function QA({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(s,r){const i=s.type==="wheel",o=!t&&i&&!s.ctrlKey,l=Ki(s,e);if(s.ctrlKey&&i&&l&&s.preventDefault(),o||l)return null;s.preventDefault(),n.call(this,s,r)}}function KA({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return s=>{var i,o,l;if((i=s.sourceEvent)!=null&&i.internal)return;const r=tf(s.transform);e.mouseButton=((o=s.sourceEvent)==null?void 0:o.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=r,((l=s.sourceEvent)==null?void 0:l.type)==="mousedown"&&t(!0),n&&(n==null||n(s.sourceEvent,r))}}function JA({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:s,onPanZoom:r}){return i=>{var o,l;e.usedRightMouseButton=!!(n&&H2(t,e.mouseButton??0)),(o=i.sourceEvent)!=null&&o.sync||s([i.transform.x,i.transform.y,i.transform.k]),r&&!((l=i.sourceEvent)!=null&&l.internal)&&(r==null||r(i.sourceEvent,tf(i.transform)))}}function e6({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:s,onPanZoomEnd:r,onPaneContextMenu:i}){return o=>{var l;if(!((l=o.sourceEvent)!=null&&l.internal)&&(e.isZoomingOrPanning=!1,i&&H2(t,e.mouseButton??0)&&!e.usedRightMouseButton&&o.sourceEvent&&i(o.sourceEvent),e.usedRightMouseButton=!1,s(!1),r)){const c=tf(o.transform);e.prevViewport=c,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{r==null||r(o.sourceEvent,c)},n?150:0)}}}function t6({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:s,panOnScroll:r,zoomOnDoubleClick:i,userSelectionActive:o,noWheelClassName:l,noPanClassName:c,lib:u,connectionInProgress:h}){return d=>{var j;const f=e||t,x=n&&d.ctrlKey,b=d.type==="wheel";if(d.button===1&&d.type==="mousedown"&&(Ki(d,`${u}-flow__node`)||Ki(d,`${u}-flow__edge`)))return!0;if(!s&&!f&&!r&&!i&&!n||o||h&&!b||Ki(d,l)&&b||Ki(d,c)&&(!b||r&&b&&!e)||!n&&d.ctrlKey&&b)return!1;if(!n&&d.type==="touchstart"&&((j=d.touches)==null?void 0:j.length)>1)return d.preventDefault(),!1;if(!f&&!r&&!x&&b||!s&&(d.type==="mousedown"||d.type==="touchstart")||Array.isArray(s)&&!s.includes(d.button)&&d.type==="mousedown")return!1;const v=Array.isArray(s)&&s.includes(d.button)||!d.button||d.button<=1;return(!d.ctrlKey||b)&&v}}function n6({domNode:e,minZoom:t,maxZoom:n,translateExtent:s,viewport:r,onPanZoom:i,onPanZoomStart:o,onPanZoomEnd:l,onDraggingChange:c}){const u={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},h=e.getBoundingClientRect(),d=h2().scaleExtent([t,n]).translateExtent(s),f=Pn(e).call(d);y({x:r.x,y:r.y,zoom:Do(r.zoom,t,n)},[[0,0],[h.width,h.height]],s);const x=f.on("wheel.zoom"),b=f.on("dblclick.zoom");d.wheelDelta(B2);function v(P,z){return f?new Promise(Y=>{d==null||d.interpolate((z==null?void 0:z.interpolate)==="linear"?Zl:hu).transform(Nm(f,z==null?void 0:z.duration,z==null?void 0:z.ease,()=>Y(!0)),P)}):Promise.resolve(!1)}function j({noWheelClassName:P,noPanClassName:z,onPaneContextMenu:Y,userSelectionActive:k,panOnScroll:$,panOnDrag:M,panOnScrollMode:_,panOnScrollSpeed:E,preventScrolling:D,zoomOnPinch:A,zoomOnScroll:q,zoomOnDoubleClick:R,zoomActivationKeyPressed:L,lib:X,onTransformChange:G,connectionInProgress:te,paneClickDistance:re,selectionOnDrag:ee}){k&&!u.isZoomingOrPanning&&g();const se=$&&!L&&!k;d.clickDistance(ee?1/0:!xs(re)||re<0?0:re);const ge=se?ZA({zoomPanValues:u,noWheelClassName:P,d3Selection:f,d3Zoom:d,panOnScrollMode:_,panOnScrollSpeed:E,zoomOnPinch:A,onPanZoomStart:o,onPanZoom:i,onPanZoomEnd:l}):QA({noWheelClassName:P,preventScrolling:D,d3ZoomHandler:x});if(f.on("wheel.zoom",ge,{passive:!1}),!k){const ue=KA({zoomPanValues:u,onDraggingChange:c,onPanZoomStart:o});d.on("start",ue);const he=JA({zoomPanValues:u,panOnDrag:M,onPaneContextMenu:!!Y,onPanZoom:i,onTransformChange:G});d.on("zoom",he);const we=e6({zoomPanValues:u,panOnDrag:M,panOnScroll:$,onPaneContextMenu:Y,onPanZoomEnd:l,onDraggingChange:c});d.on("end",we)}const ae=t6({zoomActivationKeyPressed:L,panOnDrag:M,zoomOnScroll:q,panOnScroll:$,zoomOnDoubleClick:R,zoomOnPinch:A,userSelectionActive:k,noPanClassName:z,noWheelClassName:P,lib:X,connectionInProgress:te});d.filter(ae),R?f.on("dblclick.zoom",b):f.on("dblclick.zoom",null)}function g(){d.on("zoom",null)}async function y(P,z,Y){const k=jm(P),$=d==null?void 0:d.constrain()(k,z,Y);return $&&await v($),new Promise(M=>M($))}async function p(P,z){const Y=jm(P);return await v(Y,z),new Promise(k=>k(Y))}function w(P){if(f){const z=jm(P),Y=f.property("__zoom");(Y.k!==P.zoom||Y.x!==P.x||Y.y!==P.y)&&(d==null||d.transform(f,z,null,{sync:!0}))}}function N(){const P=f?u2(f.node()):{x:0,y:0,k:1};return{x:P.x,y:P.y,zoom:P.k}}function S(P,z){return f?new Promise(Y=>{d==null||d.interpolate((z==null?void 0:z.interpolate)==="linear"?Zl:hu).scaleTo(Nm(f,z==null?void 0:z.duration,z==null?void 0:z.ease,()=>Y(!0)),P)}):Promise.resolve(!1)}function C(P,z){return f?new Promise(Y=>{d==null||d.interpolate((z==null?void 0:z.interpolate)==="linear"?Zl:hu).scaleBy(Nm(f,z==null?void 0:z.duration,z==null?void 0:z.ease,()=>Y(!0)),P)}):Promise.resolve(!1)}function T(P){d==null||d.scaleExtent(P)}function U(P){d==null||d.translateExtent(P)}function B(P){const z=!xs(P)||P<0?0:P;d==null||d.clickDistance(z)}return{update:j,destroy:g,setViewport:p,setViewportConstrained:y,getViewport:N,scaleTo:S,scaleBy:C,setScaleExtent:T,setTranslateExtent:U,syncViewport:w,setClickDistance:B}}var Oo;(function(e){e.Line="line",e.Handle="handle"})(Oo||(Oo={}));function s6({width:e,prevWidth:t,height:n,prevHeight:s,affectsX:r,affectsY:i}){const o=e-t,l=n-s,c=[o>0?1:o<0?-1:0,l>0?1:l<0?-1:0];return o&&r&&(c[0]=c[0]*-1),l&&i&&(c[1]=c[1]*-1),c}function Ib(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),s=e.includes("left"),r=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:s,affectsY:r}}function Ua(e,t){return Math.max(0,t-e)}function $a(e,t){return Math.max(0,e-t)}function $d(e,t,n){return Math.max(0,t-e,e-n)}function Wb(e,t){return e?!t:t}function a6(e,t,n,s,r,i,o,l){let{affectsX:c,affectsY:u}=t;const{isHorizontal:h,isVertical:d}=t,f=h&&d,{xSnapped:x,ySnapped:b}=n,{minWidth:v,maxWidth:j,minHeight:g,maxHeight:y}=s,{x:p,y:w,width:N,height:S,aspectRatio:C}=e;let T=Math.floor(h?x-e.pointerX:0),U=Math.floor(d?b-e.pointerY:0);const B=N+(c?-T:T),P=S+(u?-U:U),z=-i[0]*N,Y=-i[1]*S;let k=$d(B,v,j),$=$d(P,g,y);if(o){let E=0,D=0;c&&T<0?E=Ua(p+T+z,o[0][0]):!c&&T>0&&(E=$a(p+B+z,o[1][0])),u&&U<0?D=Ua(w+U+Y,o[0][1]):!u&&U>0&&(D=$a(w+P+Y,o[1][1])),k=Math.max(k,E),$=Math.max($,D)}if(l){let E=0,D=0;c&&T>0?E=$a(p+T,l[0][0]):!c&&T<0&&(E=Ua(p+B,l[1][0])),u&&U>0?D=$a(w+U,l[0][1]):!u&&U<0&&(D=Ua(w+P,l[1][1])),k=Math.max(k,E),$=Math.max($,D)}if(r){if(h){const E=$d(B/C,g,y)*C;if(k=Math.max(k,E),o){let D=0;!c&&!u||c&&!u&&f?D=$a(w+Y+B/C,o[1][1])*C:D=Ua(w+Y+(c?T:-T)/C,o[0][1])*C,k=Math.max(k,D)}if(l){let D=0;!c&&!u||c&&!u&&f?D=Ua(w+B/C,l[1][1])*C:D=$a(w+(c?T:-T)/C,l[0][1])*C,k=Math.max(k,D)}}if(d){const E=$d(P*C,v,j)/C;if($=Math.max($,E),o){let D=0;!c&&!u||u&&!c&&f?D=$a(p+P*C+z,o[1][0])/C:D=Ua(p+(u?U:-U)*C+z,o[0][0])/C,$=Math.max($,D)}if(l){let D=0;!c&&!u||u&&!c&&f?D=Ua(p+P*C,l[1][0])/C:D=$a(p+(u?U:-U)*C,l[0][0])/C,$=Math.max($,D)}}}U=U+(U<0?$:-$),T=T+(T<0?k:-k),r&&(f?B>P*C?U=(Wb(c,u)?-T:T)/C:T=(Wb(c,u)?-U:U)*C:h?(U=T/C,u=c):(T=U*C,c=u));const M=c?p+T:p,_=u?w+U:w;return{width:N+(c?-T:T),height:S+(u?-U:U),x:i[0]*T*(c?-1:1)+M,y:i[1]*U*(u?-1:1)+_}}const V2={width:0,height:0,x:0,y:0},r6={...V2,pointerX:0,pointerY:0,aspectRatio:1};function i6(e){return[[0,0],[e.measured.width,e.measured.height]]}function o6(e,t,n){const s=t.position.x+e.position.x,r=t.position.y+e.position.y,i=e.measured.width??0,o=e.measured.height??0,l=n[0]*i,c=n[1]*o;return[[s-l,r-c],[s+i-l,r+o-c]]}function l6({domNode:e,nodeId:t,getStoreItems:n,onChange:s,onEnd:r}){const i=Pn(e);let o={controlDirection:Ib("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function l({controlPosition:u,boundaries:h,keepAspectRatio:d,resizeDirection:f,onResizeStart:x,onResize:b,onResizeEnd:v,shouldResize:j}){let g={...V2},y={...r6};o={boundaries:h,resizeDirection:f,keepAspectRatio:d,controlDirection:Ib(u)};let p,w=null,N=[],S,C,T,U=!1;const B=QN().on("start",P=>{const{nodeLookup:z,transform:Y,snapGrid:k,snapToGrid:$,nodeOrigin:M,paneDomNode:_}=n();if(p=z.get(t),!p)return;w=(_==null?void 0:_.getBoundingClientRect())??null;const{xSnapped:E,ySnapped:D}=Ql(P.sourceEvent,{transform:Y,snapGrid:k,snapToGrid:$,containerBounds:w});g={width:p.measured.width??0,height:p.measured.height??0,x:p.position.x??0,y:p.position.y??0},y={...g,pointerX:E,pointerY:D,aspectRatio:g.width/g.height},S=void 0,p.parentId&&(p.extent==="parent"||p.expandParent)&&(S=z.get(p.parentId),C=S&&p.extent==="parent"?i6(S):void 0),N=[],T=void 0;for(const[A,q]of z)if(q.parentId===t&&(N.push({id:A,position:{...q.position},extent:q.extent}),q.extent==="parent"||q.expandParent)){const R=o6(q,p,q.origin??M);T?T=[[Math.min(R[0][0],T[0][0]),Math.min(R[0][1],T[0][1])],[Math.max(R[1][0],T[1][0]),Math.max(R[1][1],T[1][1])]]:T=R}x==null||x(P,{...g})}).on("drag",P=>{const{transform:z,snapGrid:Y,snapToGrid:k,nodeOrigin:$}=n(),M=Ql(P.sourceEvent,{transform:z,snapGrid:Y,snapToGrid:k,containerBounds:w}),_=[];if(!p)return;const{x:E,y:D,width:A,height:q}=g,R={},L=p.origin??$,{width:X,height:G,x:te,y:re}=a6(y,o.controlDirection,M,o.boundaries,o.keepAspectRatio,L,C,T),ee=X!==A,se=G!==q,ge=te!==E&&ee,ae=re!==D&&se;if(!ge&&!ae&&!ee&&!se)return;if((ge||ae||L[0]===1||L[1]===1)&&(R.x=ge?te:g.x,R.y=ae?re:g.y,g.x=R.x,g.y=R.y,N.length>0)){const Ne=te-E,Ce=re-D;for(const Ae of N)Ae.position={x:Ae.position.x-Ne+L[0]*(X-A),y:Ae.position.y-Ce+L[1]*(G-q)},_.push(Ae)}if((ee||se)&&(R.width=ee&&(!o.resizeDirection||o.resizeDirection==="horizontal")?X:g.width,R.height=se&&(!o.resizeDirection||o.resizeDirection==="vertical")?G:g.height,g.width=R.width,g.height=R.height),S&&p.expandParent){const Ne=L[0]*(R.width??0);R.x&&R.x<Ne&&(g.x=Ne,y.x=y.x-(R.x-Ne));const Ce=L[1]*(R.height??0);R.y&&R.y<Ce&&(g.y=Ce,y.y=y.y-(R.y-Ce))}const ue=s6({width:g.width,prevWidth:A,height:g.height,prevHeight:q,affectsX:o.controlDirection.affectsX,affectsY:o.controlDirection.affectsY}),he={...g,direction:ue};(j==null?void 0:j(P,he))!==!1&&(U=!0,b==null||b(P,he),s(R,_))}).on("end",P=>{U&&(v==null||v(P,{...g}),r==null||r({...g}),U=!1)});i.call(B)}function c(){i.on(".drag",null)}return{update:l,destroy:c}}var Y2={exports:{}},F2={},I2={exports:{}},W2={};/**
77
- * @license React
78
- * use-sync-external-store-shim.production.js
79
- *
80
- * Copyright (c) Meta Platforms, Inc. and affiliates.
81
- *
82
- * This source code is licensed under the MIT license found in the
83
- * LICENSE file in the root directory of this source tree.
84
- */var zo=m;function c6(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var d6=typeof Object.is=="function"?Object.is:c6,u6=zo.useState,h6=zo.useEffect,f6=zo.useLayoutEffect,m6=zo.useDebugValue;function x6(e,t){var n=t(),s=u6({inst:{value:n,getSnapshot:t}}),r=s[0].inst,i=s[1];return f6(function(){r.value=n,r.getSnapshot=t,Sm(r)&&i({inst:r})},[e,n,t]),h6(function(){return Sm(r)&&i({inst:r}),e(function(){Sm(r)&&i({inst:r})})},[e]),m6(n),n}function Sm(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!d6(e,n)}catch{return!0}}function g6(e,t){return t()}var p6=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?g6:x6;W2.useSyncExternalStore=zo.useSyncExternalStore!==void 0?zo.useSyncExternalStore:p6;I2.exports=W2;var v6=I2.exports;/**
85
- * @license React
86
- * use-sync-external-store-shim/with-selector.production.js
87
- *
88
- * Copyright (c) Meta Platforms, Inc. and affiliates.
89
- *
90
- * This source code is licensed under the MIT license found in the
91
- * LICENSE file in the root directory of this source tree.
92
- */var nf=m,b6=v6;function y6(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var w6=typeof Object.is=="function"?Object.is:y6,j6=b6.useSyncExternalStore,N6=nf.useRef,S6=nf.useEffect,C6=nf.useMemo,E6=nf.useDebugValue;F2.useSyncExternalStoreWithSelector=function(e,t,n,s,r){var i=N6(null);if(i.current===null){var o={hasValue:!1,value:null};i.current=o}else o=i.current;i=C6(function(){function c(x){if(!u){if(u=!0,h=x,x=s(x),r!==void 0&&o.hasValue){var b=o.value;if(r(b,x))return d=b}return d=x}if(b=d,w6(h,x))return b;var v=s(x);return r!==void 0&&r(b,v)?(h=x,b):(h=x,d=v)}var u=!1,h,d,f=n===void 0?null:n;return[function(){return c(t())},f===null?void 0:function(){return c(f())}]},[t,n,s,r]);var l=j6(e,i[0],i[1]);return S6(function(){o.hasValue=!0,o.value=l},[l]),E6(l),l};Y2.exports=F2;var k6=Y2.exports;const M6=Eh(k6),T6={},qb=e=>{let t;const n=new Set,s=(h,d)=>{const f=typeof h=="function"?h(t):h;if(!Object.is(f,t)){const x=t;t=d??(typeof f!="object"||f===null)?f:Object.assign({},t,f),n.forEach(b=>b(t,x))}},r=()=>t,c={setState:s,getState:r,getInitialState:()=>u,subscribe:h=>(n.add(h),()=>n.delete(h)),destroy:()=>{(T6?"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()}},u=t=e(s,r,c);return c},D6=e=>e?qb(e):qb,{useDebugValue:_6}=K,{useSyncExternalStoreWithSelector:A6}=M6,O6=e=>e;function q2(e,t=O6,n){const s=A6(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return _6(s),s}const Xb=(e,t)=>{const n=D6(e),s=(r,i=t)=>q2(n,r,i);return Object.assign(s,n),s},z6=(e,t)=>e?Xb(e,t):Xb;function Mt(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[s,r]of e)if(!Object.is(r,t.get(s)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const s of e)if(!t.has(s))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const s of n)if(!Object.prototype.hasOwnProperty.call(t,s)||!Object.is(e[s],t[s]))return!1;return!0}const sf=m.createContext(null),R6=sf.Provider,X2=qs.error001();function Qe(e,t){const n=m.useContext(sf);if(n===null)throw new Error(X2);return q2(n,e,t)}function St(){const e=m.useContext(sf);if(e===null)throw new Error(X2);return m.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const Gb={display:"none"},U6={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},G2="react-flow__node-desc",Z2="react-flow__edge-desc",$6="react-flow__aria-live",P6=e=>e.ariaLiveMessage,L6=e=>e.ariaLabelConfig;function H6({rfId:e}){const t=Qe(P6);return a.jsx("div",{id:`${$6}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:U6,children:t})}function B6({rfId:e,disableKeyboardA11y:t}){const n=Qe(L6);return a.jsxs(a.Fragment,{children:[a.jsx("div",{id:`${G2}-${e}`,style:Gb,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),a.jsx("div",{id:`${Z2}-${e}`,style:Gb,children:n["edge.a11yDescription.default"]}),!t&&a.jsx(H6,{rfId:e})]})}const af=m.forwardRef(({position:e="top-left",children:t,className:n,style:s,...r},i)=>{const o=`${e}`.split("-");return a.jsx("div",{className:Ht(["react-flow__panel",n,...o]),style:s,ref:i,...r,children:t})});af.displayName="Panel";function V6({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:a.jsx(af,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:a.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const Y6=e=>{const t=[],n=[];for(const[,s]of e.nodeLookup)s.selected&&t.push(s.internals.userNode);for(const[,s]of e.edgeLookup)s.selected&&n.push(s);return{selectedNodes:t,selectedEdges:n}},Pd=e=>e.id;function F6(e,t){return Mt(e.selectedNodes.map(Pd),t.selectedNodes.map(Pd))&&Mt(e.selectedEdges.map(Pd),t.selectedEdges.map(Pd))}function I6({onSelectionChange:e}){const t=St(),{selectedNodes:n,selectedEdges:s}=Qe(Y6,F6);return m.useEffect(()=>{const r={nodes:n,edges:s};e==null||e(r),t.getState().onSelectionChangeHandlers.forEach(i=>i(r))},[n,s,e]),null}const W6=e=>!!e.onSelectionChangeHandlers;function q6({onSelectionChange:e}){const t=Qe(W6);return e||t?a.jsx(I6,{onSelectionChange:e}):null}const Q2=[0,0],X6={x:0,y:0,zoom:1},G6=["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"],Zb=[...G6,"rfId"],Z6=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),Qb={translateExtent:bc,nodeOrigin:Q2,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function Q6(e){const{setNodes:t,setEdges:n,setMinZoom:s,setMaxZoom:r,setTranslateExtent:i,setNodeExtent:o,reset:l,setDefaultNodesAndEdges:c}=Qe(Z6,Mt),u=St();m.useEffect(()=>(c(e.defaultNodes,e.defaultEdges),()=>{h.current=Qb,l()}),[]);const h=m.useRef(Qb);return m.useEffect(()=>{for(const d of Zb){const f=e[d],x=h.current[d];f!==x&&(typeof e[d]>"u"||(d==="nodes"?t(f):d==="edges"?n(f):d==="minZoom"?s(f):d==="maxZoom"?r(f):d==="translateExtent"?i(f):d==="nodeExtent"?o(f):d==="ariaLabelConfig"?u.setState({ariaLabelConfig:wA(f)}):d==="fitView"?u.setState({fitViewQueued:f}):d==="fitViewOptions"?u.setState({fitViewOptions:f}):u.setState({[d]:f})))}h.current=e},Zb.map(d=>e[d])),null}function Kb(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function K6(e){var s;const[t,n]=m.useState(e==="system"?null:e);return m.useEffect(()=>{if(e!=="system"){n(e);return}const r=Kb(),i=()=>n(r!=null&&r.matches?"dark":"light");return i(),r==null||r.addEventListener("change",i),()=>{r==null||r.removeEventListener("change",i)}},[e]),t!==null?t:(s=Kb())!=null&&s.matches?"dark":"light"}const Jb=typeof document<"u"?document:null;function Sc(e=null,t={target:Jb,actInsideInputWithModifier:!0}){const[n,s]=m.useState(!1),r=m.useRef(!1),i=m.useRef(new Set([])),[o,l]=m.useMemo(()=>{if(e!==null){const u=(Array.isArray(e)?e:[e]).filter(d=>typeof d=="string").map(d=>d.replace("+",`
93
- `).replace(`
94
-
95
- `,`
96
- +`).split(`
97
- `)),h=u.reduce((d,f)=>d.concat(...f),[]);return[u,h]}return[[],[]]},[e]);return m.useEffect(()=>{const c=(t==null?void 0:t.target)??Jb,u=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const h=x=>{var j,g;if(r.current=x.ctrlKey||x.metaKey||x.shiftKey||x.altKey,(!r.current||r.current&&!u)&&C2(x))return!1;const v=ty(x.code,l);if(i.current.add(x[v]),ey(o,i.current,!1)){const y=((g=(j=x.composedPath)==null?void 0:j.call(x))==null?void 0:g[0])||x.target,p=(y==null?void 0:y.nodeName)==="BUTTON"||(y==null?void 0:y.nodeName)==="A";t.preventDefault!==!1&&(r.current||!p)&&x.preventDefault(),s(!0)}},d=x=>{const b=ty(x.code,l);ey(o,i.current,!0)?(s(!1),i.current.clear()):i.current.delete(x[b]),x.key==="Meta"&&i.current.clear(),r.current=!1},f=()=>{i.current.clear(),s(!1)};return c==null||c.addEventListener("keydown",h),c==null||c.addEventListener("keyup",d),window.addEventListener("blur",f),window.addEventListener("contextmenu",f),()=>{c==null||c.removeEventListener("keydown",h),c==null||c.removeEventListener("keyup",d),window.removeEventListener("blur",f),window.removeEventListener("contextmenu",f)}}},[e,s]),n}function ey(e,t,n){return e.filter(s=>n||s.length===t.size).some(s=>s.every(r=>t.has(r)))}function ty(e,t){return t.includes(e)?"code":"key"}const J6=()=>{const e=St();return m.useMemo(()=>({zoomIn:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomOut:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomTo:(t,n)=>{const{panZoom:s}=e.getState();return s?s.scaleTo(t,{duration:n==null?void 0:n.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[s,r,i],panZoom:o}=e.getState();return o?(await o.setViewport({x:t.x??s,y:t.y??r,zoom:t.zoom??i},n),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[t,n,s]=e.getState().transform;return{x:t,y:n,zoom:s}},setCenter:async(t,n,s)=>e.getState().setCenter(t,n,s),fitBounds:async(t,n)=>{const{width:s,height:r,minZoom:i,maxZoom:o,panZoom:l}=e.getState(),c=qp(t,s,r,i,o,(n==null?void 0:n.padding)??.1);return l?(await l.setViewport(c,{duration:n==null?void 0:n.duration,ease:n==null?void 0:n.ease,interpolate:n==null?void 0:n.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,n={})=>{const{transform:s,snapGrid:r,snapToGrid:i,domNode:o}=e.getState();if(!o)return t;const{x:l,y:c}=o.getBoundingClientRect(),u={x:t.x-l,y:t.y-c},h=n.snapGrid??r,d=n.snapToGrid??i;return Kc(u,s,d,h)},flowToScreenPosition:t=>{const{transform:n,domNode:s}=e.getState();if(!s)return t;const{x:r,y:i}=s.getBoundingClientRect(),o=ch(t,n);return{x:o.x+r,y:o.y+i}}}),[])};function K2(e,t){const n=[],s=new Map,r=[];for(const i of e)if(i.type==="add"){r.push(i);continue}else if(i.type==="remove"||i.type==="replace")s.set(i.id,[i]);else{const o=s.get(i.id);o?o.push(i):s.set(i.id,[i])}for(const i of t){const o=s.get(i.id);if(!o){n.push(i);continue}if(o[0].type==="remove")continue;if(o[0].type==="replace"){n.push({...o[0].item});continue}const l={...i};for(const c of o)eO(c,l);n.push(l)}return r.length&&r.forEach(i=>{i.index!==void 0?n.splice(i.index,0,{...i.item}):n.push({...i.item})}),n}function eO(e,t){switch(e.type){case"select":{t.selected=e.selected;break}case"position":{typeof e.position<"u"&&(t.position=e.position),typeof e.dragging<"u"&&(t.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(t.measured??(t.measured={}),t.measured.width=e.dimensions.width,t.measured.height=e.dimensions.height,e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(t.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function J2(e,t){return K2(e,t)}function eS(e,t){return K2(e,t)}function $r(e,t){return{id:e,type:"select",selected:t}}function Ji(e,t=new Set,n=!1){const s=[];for(const[r,i]of e){const o=t.has(r);!(i.selected===void 0&&!o)&&i.selected!==o&&(n&&(i.selected=o),s.push($r(i.id,o)))}return s}function ny({items:e=[],lookup:t}){var r;const n=[],s=new Map(e.map(i=>[i.id,i]));for(const[i,o]of e.entries()){const l=t.get(o.id),c=((r=l==null?void 0:l.internals)==null?void 0:r.userNode)??l;c!==void 0&&c!==o&&n.push({id:o.id,item:o,type:"replace"}),c===void 0&&n.push({item:o,type:"add",index:i})}for(const[i]of t)s.get(i)===void 0&&n.push({id:i,type:"remove"});return n}function sy(e){return{id:e.id,type:"remove"}}const ay=e=>uA(e),tO=e=>p2(e);function tS(e){return m.forwardRef(e)}const nO=typeof window<"u"?m.useLayoutEffect:m.useEffect;function ry(e){const[t,n]=m.useState(BigInt(0)),[s]=m.useState(()=>sO(()=>n(r=>r+BigInt(1))));return nO(()=>{const r=s.get();r.length&&(e(r),s.reset())},[t]),s}function sO(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const nS=m.createContext(null);function aO({children:e}){const t=St(),n=m.useCallback(l=>{const{nodes:c=[],setNodes:u,hasDefaultNodes:h,onNodesChange:d,nodeLookup:f,fitViewQueued:x}=t.getState();let b=c;for(const j of l)b=typeof j=="function"?j(b):j;const v=ny({items:b,lookup:f});h&&u(b),v.length>0?d==null||d(v):x&&window.requestAnimationFrame(()=>{const{fitViewQueued:j,nodes:g,setNodes:y}=t.getState();j&&y(g)})},[]),s=ry(n),r=m.useCallback(l=>{const{edges:c=[],setEdges:u,hasDefaultEdges:h,onEdgesChange:d,edgeLookup:f}=t.getState();let x=c;for(const b of l)x=typeof b=="function"?b(x):b;h?u(x):d&&d(ny({items:x,lookup:f}))},[]),i=ry(r),o=m.useMemo(()=>({nodeQueue:s,edgeQueue:i}),[]);return a.jsx(nS.Provider,{value:o,children:e})}function rO(){const e=m.useContext(nS);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const iO=e=>!!e.panZoom;function Jp(){const e=J6(),t=St(),n=rO(),s=Qe(iO),r=m.useMemo(()=>{const i=d=>t.getState().nodeLookup.get(d),o=d=>{n.nodeQueue.push(d)},l=d=>{n.edgeQueue.push(d)},c=d=>{var g,y;const{nodeLookup:f,nodeOrigin:x}=t.getState(),b=ay(d)?d:f.get(d.id),v=b.parentId?N2(b.position,b.measured,b.parentId,f,x):b.position,j={...b,position:v,width:((g=b.measured)==null?void 0:g.width)??b.width,height:((y=b.measured)==null?void 0:y.height)??b.height};return _o(j)},u=(d,f,x={replace:!1})=>{o(b=>b.map(v=>{if(v.id===d){const j=typeof f=="function"?f(v):f;return x.replace&&ay(j)?j:{...v,...j}}return v}))},h=(d,f,x={replace:!1})=>{l(b=>b.map(v=>{if(v.id===d){const j=typeof f=="function"?f(v):f;return x.replace&&tO(j)?j:{...v,...j}}return v}))};return{getNodes:()=>t.getState().nodes.map(d=>({...d})),getNode:d=>{var f;return(f=i(d))==null?void 0:f.internals.userNode},getInternalNode:i,getEdges:()=>{const{edges:d=[]}=t.getState();return d.map(f=>({...f}))},getEdge:d=>t.getState().edgeLookup.get(d),setNodes:o,setEdges:l,addNodes:d=>{const f=Array.isArray(d)?d:[d];n.nodeQueue.push(x=>[...x,...f])},addEdges:d=>{const f=Array.isArray(d)?d:[d];n.edgeQueue.push(x=>[...x,...f])},toObject:()=>{const{nodes:d=[],edges:f=[],transform:x}=t.getState(),[b,v,j]=x;return{nodes:d.map(g=>({...g})),edges:f.map(g=>({...g})),viewport:{x:b,y:v,zoom:j}}},deleteElements:async({nodes:d=[],edges:f=[]})=>{const{nodes:x,edges:b,onNodesDelete:v,onEdgesDelete:j,triggerNodeChanges:g,triggerEdgeChanges:y,onDelete:p,onBeforeDelete:w}=t.getState(),{nodes:N,edges:S}=await gA({nodesToRemove:d,edgesToRemove:f,nodes:x,edges:b,onBeforeDelete:w}),C=S.length>0,T=N.length>0;if(C){const U=S.map(sy);j==null||j(S),y(U)}if(T){const U=N.map(sy);v==null||v(N),g(U)}return(T||C)&&(p==null||p({nodes:N,edges:S})),{deletedNodes:N,deletedEdges:S}},getIntersectingNodes:(d,f=!0,x)=>{const b=zb(d),v=b?d:c(d),j=x!==void 0;return v?(x||t.getState().nodes).filter(g=>{const y=t.getState().nodeLookup.get(g.id);if(y&&!b&&(g.id===d.id||!y.internals.positionAbsolute))return!1;const p=_o(j?g:y),w=wc(p,v);return f&&w>0||w>=p.width*p.height||w>=v.width*v.height}):[]},isNodeIntersecting:(d,f,x=!0)=>{const v=zb(d)?d:c(d);if(!v)return!1;const j=wc(v,f);return x&&j>0||j>=f.width*f.height||j>=v.width*v.height},updateNode:u,updateNodeData:(d,f,x={replace:!1})=>{u(d,b=>{const v=typeof f=="function"?f(b):f;return x.replace?{...b,data:v}:{...b,data:{...b.data,...v}}},x)},updateEdge:h,updateEdgeData:(d,f,x={replace:!1})=>{h(d,b=>{const v=typeof f=="function"?f(b):f;return x.replace?{...b,data:v}:{...b,data:{...b.data,...v}}},x)},getNodesBounds:d=>{const{nodeLookup:f,nodeOrigin:x}=t.getState();return hA(d,{nodeLookup:f,nodeOrigin:x})},getHandleConnections:({type:d,id:f,nodeId:x})=>{var b;return Array.from(((b=t.getState().connectionLookup.get(`${x}-${d}${f?`-${f}`:""}`))==null?void 0:b.values())??[])},getNodeConnections:({type:d,handleId:f,nodeId:x})=>{var b;return Array.from(((b=t.getState().connectionLookup.get(`${x}${d?f?`-${d}-${f}`:`-${d}`:""}`))==null?void 0:b.values())??[])},fitView:async d=>{const f=t.getState().fitViewResolver??yA();return t.setState({fitViewQueued:!0,fitViewOptions:d,fitViewResolver:f}),n.nodeQueue.push(x=>[...x]),f.promise}}},[]);return m.useMemo(()=>({...r,...e,viewportInitialized:s}),[s])}const iy=e=>e.selected,oO=typeof window<"u"?window:void 0;function lO({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=St(),{deleteElements:s}=Jp(),r=Sc(e,{actInsideInputWithModifier:!1}),i=Sc(t,{target:oO});m.useEffect(()=>{if(r){const{edges:o,nodes:l}=n.getState();s({nodes:l.filter(iy),edges:o.filter(iy)}),n.setState({nodesSelectionActive:!1})}},[r]),m.useEffect(()=>{n.setState({multiSelectionActive:i})},[i])}function cO(e){const t=St();m.useEffect(()=>{const n=()=>{var r,i,o,l;if(!e.current||!(((i=(r=e.current).checkVisibility)==null?void 0:i.call(r))??!0))return!1;const s=Xp(e.current);(s.height===0||s.width===0)&&((l=(o=t.getState()).onError)==null||l.call(o,"004",qs.error004())),t.setState({width:s.width||500,height:s.height||500})};if(e.current){n(),window.addEventListener("resize",n);const s=new ResizeObserver(()=>n());return s.observe(e.current),()=>{window.removeEventListener("resize",n),s&&e.current&&s.unobserve(e.current)}}},[])}const rf={position:"absolute",width:"100%",height:"100%",top:0,left:0},dO=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function uO({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:s=!1,panOnScrollSpeed:r=.5,panOnScrollMode:i=Qr.Free,zoomOnDoubleClick:o=!0,panOnDrag:l=!0,defaultViewport:c,translateExtent:u,minZoom:h,maxZoom:d,zoomActivationKeyCode:f,preventScrolling:x=!0,children:b,noWheelClassName:v,noPanClassName:j,onViewportChange:g,isControlledViewport:y,paneClickDistance:p,selectionOnDrag:w}){const N=St(),S=m.useRef(null),{userSelectionActive:C,lib:T,connectionInProgress:U}=Qe(dO,Mt),B=Sc(f),P=m.useRef();cO(S);const z=m.useCallback(Y=>{g==null||g({x:Y[0],y:Y[1],zoom:Y[2]}),y||N.setState({transform:Y})},[g,y]);return m.useEffect(()=>{if(S.current){P.current=n6({domNode:S.current,minZoom:h,maxZoom:d,translateExtent:u,viewport:c,onDraggingChange:M=>N.setState({paneDragging:M}),onPanZoomStart:(M,_)=>{const{onViewportChangeStart:E,onMoveStart:D}=N.getState();D==null||D(M,_),E==null||E(_)},onPanZoom:(M,_)=>{const{onViewportChange:E,onMove:D}=N.getState();D==null||D(M,_),E==null||E(_)},onPanZoomEnd:(M,_)=>{const{onViewportChangeEnd:E,onMoveEnd:D}=N.getState();D==null||D(M,_),E==null||E(_)}});const{x:Y,y:k,zoom:$}=P.current.getViewport();return N.setState({panZoom:P.current,transform:[Y,k,$],domNode:S.current.closest(".react-flow")}),()=>{var M;(M=P.current)==null||M.destroy()}}},[]),m.useEffect(()=>{var Y;(Y=P.current)==null||Y.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:s,panOnScrollSpeed:r,panOnScrollMode:i,zoomOnDoubleClick:o,panOnDrag:l,zoomActivationKeyPressed:B,preventScrolling:x,noPanClassName:j,userSelectionActive:C,noWheelClassName:v,lib:T,onTransformChange:z,connectionInProgress:U,selectionOnDrag:w,paneClickDistance:p})},[e,t,n,s,r,i,o,l,B,x,j,C,v,T,z,U,w,p]),a.jsx("div",{className:"react-flow__renderer",ref:S,style:rf,children:b})}const hO=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function fO(){const{userSelectionActive:e,userSelectionRect:t}=Qe(hO,Mt);return e&&t?a.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const Cm=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},mO=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function xO({isSelecting:e,selectionKeyPressed:t,selectionMode:n=yc.Full,panOnDrag:s,paneClickDistance:r,selectionOnDrag:i,onSelectionStart:o,onSelectionEnd:l,onPaneClick:c,onPaneContextMenu:u,onPaneScroll:h,onPaneMouseEnter:d,onPaneMouseMove:f,onPaneMouseLeave:x,children:b}){const v=St(),{userSelectionActive:j,elementsSelectable:g,dragging:y,connectionInProgress:p}=Qe(mO,Mt),w=g&&(e||j),N=m.useRef(null),S=m.useRef(),C=m.useRef(new Set),T=m.useRef(new Set),U=m.useRef(!1),B=E=>{if(U.current||p){U.current=!1;return}c==null||c(E),v.getState().resetSelectedElements(),v.setState({nodesSelectionActive:!1})},P=E=>{if(Array.isArray(s)&&(s!=null&&s.includes(2))){E.preventDefault();return}u==null||u(E)},z=h?E=>h(E):void 0,Y=E=>{U.current&&(E.stopPropagation(),U.current=!1)},k=E=>{var G,te;const{domNode:D}=v.getState();if(S.current=D==null?void 0:D.getBoundingClientRect(),!S.current)return;const A=E.target===N.current;if(!A&&!!E.target.closest(".nokey")||!e||!(i&&A||t)||E.button!==0||!E.isPrimary)return;(te=(G=E.target)==null?void 0:G.setPointerCapture)==null||te.call(G,E.pointerId),U.current=!1;const{x:L,y:X}=gs(E.nativeEvent,S.current);v.setState({userSelectionRect:{width:0,height:0,startX:L,startY:X,x:L,y:X}}),A||(E.stopPropagation(),E.preventDefault())},$=E=>{const{userSelectionRect:D,transform:A,nodeLookup:q,edgeLookup:R,connectionLookup:L,triggerNodeChanges:X,triggerEdgeChanges:G,defaultEdgeOptions:te,resetSelectedElements:re}=v.getState();if(!S.current||!D)return;const{x:ee,y:se}=gs(E.nativeEvent,S.current),{startX:ge,startY:ae}=D;if(!U.current){const Ce=t?0:r;if(Math.hypot(ee-ge,se-ae)<=Ce)return;re(),o==null||o(E)}U.current=!0;const ue={startX:ge,startY:ae,x:ee<ge?ee:ge,y:se<ae?se:ae,width:Math.abs(ee-ge),height:Math.abs(se-ae)},he=C.current,we=T.current;C.current=new Set(Wp(q,ue,A,n===yc.Partial,!0).map(Ce=>Ce.id)),T.current=new Set;const Ne=(te==null?void 0:te.selectable)??!0;for(const Ce of C.current){const Ae=L.get(Ce);if(Ae)for(const{edgeId:tt}of Ae.values()){const $e=R.get(tt);$e&&($e.selectable??Ne)&&T.current.add(tt)}}if(!Rb(he,C.current)){const Ce=Ji(q,C.current,!0);X(Ce)}if(!Rb(we,T.current)){const Ce=Ji(R,T.current);G(Ce)}v.setState({userSelectionRect:ue,userSelectionActive:!0,nodesSelectionActive:!1})},M=E=>{var D,A;E.button===0&&((A=(D=E.target)==null?void 0:D.releasePointerCapture)==null||A.call(D,E.pointerId),!j&&E.target===N.current&&v.getState().userSelectionRect&&(B==null||B(E)),v.setState({userSelectionActive:!1,userSelectionRect:null}),U.current&&(l==null||l(E),v.setState({nodesSelectionActive:C.current.size>0})))},_=s===!0||Array.isArray(s)&&s.includes(0);return a.jsxs("div",{className:Ht(["react-flow__pane",{draggable:_,dragging:y,selection:e}]),onClick:w?void 0:Cm(B,N),onContextMenu:Cm(P,N),onWheel:Cm(z,N),onPointerEnter:w?void 0:d,onPointerMove:w?$:f,onPointerUp:w?M:void 0,onPointerDownCapture:w?k:void 0,onClickCapture:w?Y:void 0,onPointerLeave:x,ref:N,style:rf,children:[b,a.jsx(fO,{})]})}function mg({id:e,store:t,unselect:n=!1,nodeRef:s}){const{addSelectedNodes:r,unselectNodesAndEdges:i,multiSelectionActive:o,nodeLookup:l,onError:c}=t.getState(),u=l.get(e);if(!u){c==null||c("012",qs.error012(e));return}t.setState({nodesSelectionActive:!1}),u.selected?(n||u.selected&&o)&&(i({nodes:[u],edges:[]}),requestAnimationFrame(()=>{var h;return(h=s==null?void 0:s.current)==null?void 0:h.blur()})):r([e])}function sS({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:s,nodeId:r,isSelectable:i,nodeClickDistance:o}){const l=St(),[c,u]=m.useState(!1),h=m.useRef();return m.useEffect(()=>{h.current=VA({getStoreItems:()=>l.getState(),onNodeMouseDown:d=>{mg({id:d,store:l,nodeRef:e})},onDragStart:()=>{u(!0)},onDragStop:()=>{u(!1)}})},[]),m.useEffect(()=>{var d,f;if(t)(d=h.current)==null||d.destroy();else if(e.current)return(f=h.current)==null||f.update({noDragClassName:n,handleSelector:s,domNode:e.current,isSelectable:i,nodeId:r,nodeClickDistance:o}),()=>{var x;(x=h.current)==null||x.destroy()}},[n,s,t,i,e,r]),c}const gO=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function aS(){const e=St();return m.useCallback(n=>{const{nodeExtent:s,snapToGrid:r,snapGrid:i,nodesDraggable:o,onError:l,updateNodePositions:c,nodeLookup:u,nodeOrigin:h}=e.getState(),d=new Map,f=gO(o),x=r?i[0]:5,b=r?i[1]:5,v=n.direction.x*x*n.factor,j=n.direction.y*b*n.factor;for(const[,g]of u){if(!f(g))continue;let y={x:g.internals.positionAbsolute.x+v,y:g.internals.positionAbsolute.y+j};r&&(y=Qc(y,i));const{position:p,positionAbsolute:w}=v2({nodeId:g.id,nextPosition:y,nodeLookup:u,nodeExtent:s,nodeOrigin:h,onError:l});g.position=p,g.internals.positionAbsolute=w,d.set(g.id,g)}c(d)},[])}const e0=m.createContext(null),pO=e0.Provider;e0.Consumer;const rS=()=>m.useContext(e0),vO=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),bO=(e,t,n)=>s=>{const{connectionClickStartHandle:r,connectionMode:i,connection:o}=s,{fromHandle:l,toHandle:c,isValid:u}=o,h=(c==null?void 0:c.nodeId)===e&&(c==null?void 0:c.id)===t&&(c==null?void 0:c.type)===n;return{connectingFrom:(l==null?void 0:l.nodeId)===e&&(l==null?void 0:l.id)===t&&(l==null?void 0:l.type)===n,connectingTo:h,clickConnecting:(r==null?void 0:r.nodeId)===e&&(r==null?void 0:r.id)===t&&(r==null?void 0:r.type)===n,isPossibleEndHandle:i===To.Strict?(l==null?void 0:l.type)!==n:e!==(l==null?void 0:l.nodeId)||t!==(l==null?void 0:l.id),connectionInProcess:!!l,clickConnectionInProcess:!!r,valid:h&&u}};function yO({type:e="source",position:t=Te.Top,isValidConnection:n,isConnectable:s=!0,isConnectableStart:r=!0,isConnectableEnd:i=!0,id:o,onConnect:l,children:c,className:u,onMouseDown:h,onTouchStart:d,...f},x){var $,M;const b=o||null,v=e==="target",j=St(),g=rS(),{connectOnClick:y,noPanClassName:p,rfId:w}=Qe(vO,Mt),{connectingFrom:N,connectingTo:S,clickConnecting:C,isPossibleEndHandle:T,connectionInProcess:U,clickConnectionInProcess:B,valid:P}=Qe(bO(g,b,e),Mt);g||(M=($=j.getState()).onError)==null||M.call($,"010",qs.error010());const z=_=>{const{defaultEdgeOptions:E,onConnect:D,hasDefaultEdges:A}=j.getState(),q={...E,..._};if(A){const{edges:R,setEdges:L}=j.getState();L(D2(q,R))}D==null||D(q),l==null||l(q)},Y=_=>{if(!g)return;const E=E2(_.nativeEvent);if(r&&(E&&_.button===0||!E)){const D=j.getState();fg.onPointerDown(_.nativeEvent,{handleDomNode:_.currentTarget,autoPanOnConnect:D.autoPanOnConnect,connectionMode:D.connectionMode,connectionRadius:D.connectionRadius,domNode:D.domNode,nodeLookup:D.nodeLookup,lib:D.lib,isTarget:v,handleId:b,nodeId:g,flowId:D.rfId,panBy:D.panBy,cancelConnection:D.cancelConnection,onConnectStart:D.onConnectStart,onConnectEnd:D.onConnectEnd,updateConnection:D.updateConnection,onConnect:z,isValidConnection:n||D.isValidConnection,getTransform:()=>j.getState().transform,getFromHandle:()=>j.getState().connection.fromHandle,autoPanSpeed:D.autoPanSpeed,dragThreshold:D.connectionDragThreshold})}E?h==null||h(_):d==null||d(_)},k=_=>{const{onClickConnectStart:E,onClickConnectEnd:D,connectionClickStartHandle:A,connectionMode:q,isValidConnection:R,lib:L,rfId:X,nodeLookup:G,connection:te}=j.getState();if(!g||!A&&!r)return;if(!A){E==null||E(_.nativeEvent,{nodeId:g,handleId:b,handleType:e}),j.setState({connectionClickStartHandle:{nodeId:g,type:e,id:b}});return}const re=S2(_.target),ee=n||R,{connection:se,isValid:ge}=fg.isValid(_.nativeEvent,{handle:{nodeId:g,id:b,type:e},connectionMode:q,fromNodeId:A.nodeId,fromHandleId:A.id||null,fromType:A.type,isValidConnection:ee,flowId:X,doc:re,lib:L,nodeLookup:G});ge&&se&&z(se);const ae=structuredClone(te);delete ae.inProgress,ae.toPosition=ae.toHandle?ae.toHandle.position:null,D==null||D(_,ae),j.setState({connectionClickStartHandle:null})};return a.jsx("div",{"data-handleid":b,"data-nodeid":g,"data-handlepos":t,"data-id":`${w}-${g}-${b}-${e}`,className:Ht(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",p,u,{source:!v,target:v,connectable:s,connectablestart:r,connectableend:i,clickconnecting:C,connectingfrom:N,connectingto:S,valid:P,connectionindicator:s&&(!U||T)&&(U||B?i:r)}]),onMouseDown:Y,onTouchStart:Y,onClick:y?k:void 0,ref:x,...f,children:c})}const Kr=m.memo(tS(yO));function wO({data:e,isConnectable:t,sourcePosition:n=Te.Bottom}){return a.jsxs(a.Fragment,{children:[e==null?void 0:e.label,a.jsx(Kr,{type:"source",position:n,isConnectable:t})]})}function jO({data:e,isConnectable:t,targetPosition:n=Te.Top,sourcePosition:s=Te.Bottom}){return a.jsxs(a.Fragment,{children:[a.jsx(Kr,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,a.jsx(Kr,{type:"source",position:s,isConnectable:t})]})}function NO(){return null}function SO({data:e,isConnectable:t,targetPosition:n=Te.Top}){return a.jsxs(a.Fragment,{children:[a.jsx(Kr,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const dh={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},oy={input:wO,default:jO,output:SO,group:NO};function CO(e){var t,n,s,r;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((t=e.style)==null?void 0:t.width),height:e.height??e.initialHeight??((n=e.style)==null?void 0:n.height)}:{width:e.width??((s=e.style)==null?void 0:s.width),height:e.height??((r=e.style)==null?void 0:r.height)}}const EO=e=>{const{width:t,height:n,x:s,y:r}=Zc(e.nodeLookup,{filter:i=>!!i.selected});return{width:xs(t)?t:null,height:xs(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${s}px,${r}px)`}};function kO({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const s=St(),{width:r,height:i,transformString:o,userSelectionActive:l}=Qe(EO,Mt),c=aS(),u=m.useRef(null);if(m.useEffect(()=>{var f;n||(f=u.current)==null||f.focus({preventScroll:!0})},[n]),sS({nodeRef:u}),l||!r||!i)return null;const h=e?f=>{const x=s.getState().nodes.filter(b=>b.selected);e(f,x)}:void 0,d=f=>{Object.prototype.hasOwnProperty.call(dh,f.key)&&(f.preventDefault(),c({direction:dh[f.key],factor:f.shiftKey?4:1}))};return a.jsx("div",{className:Ht(["react-flow__nodesselection","react-flow__container",t]),style:{transform:o},children:a.jsx("div",{ref:u,className:"react-flow__nodesselection-rect",onContextMenu:h,tabIndex:n?void 0:-1,onKeyDown:n?void 0:d,style:{width:r,height:i}})})}const ly=typeof window<"u"?window:void 0,MO=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function iS({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:s,onPaneMouseLeave:r,onPaneContextMenu:i,onPaneScroll:o,paneClickDistance:l,deleteKeyCode:c,selectionKeyCode:u,selectionOnDrag:h,selectionMode:d,onSelectionStart:f,onSelectionEnd:x,multiSelectionKeyCode:b,panActivationKeyCode:v,zoomActivationKeyCode:j,elementsSelectable:g,zoomOnScroll:y,zoomOnPinch:p,panOnScroll:w,panOnScrollSpeed:N,panOnScrollMode:S,zoomOnDoubleClick:C,panOnDrag:T,defaultViewport:U,translateExtent:B,minZoom:P,maxZoom:z,preventScrolling:Y,onSelectionContextMenu:k,noWheelClassName:$,noPanClassName:M,disableKeyboardA11y:_,onViewportChange:E,isControlledViewport:D}){const{nodesSelectionActive:A,userSelectionActive:q}=Qe(MO),R=Sc(u,{target:ly}),L=Sc(v,{target:ly}),X=L||T,G=L||w,te=h&&X!==!0,re=R||q||te;return lO({deleteKeyCode:c,multiSelectionKeyCode:b}),a.jsx(uO,{onPaneContextMenu:i,elementsSelectable:g,zoomOnScroll:y,zoomOnPinch:p,panOnScroll:G,panOnScrollSpeed:N,panOnScrollMode:S,zoomOnDoubleClick:C,panOnDrag:!R&&X,defaultViewport:U,translateExtent:B,minZoom:P,maxZoom:z,zoomActivationKeyCode:j,preventScrolling:Y,noWheelClassName:$,noPanClassName:M,onViewportChange:E,isControlledViewport:D,paneClickDistance:l,selectionOnDrag:te,children:a.jsxs(xO,{onSelectionStart:f,onSelectionEnd:x,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:s,onPaneMouseLeave:r,onPaneContextMenu:i,onPaneScroll:o,panOnDrag:X,isSelecting:!!re,selectionMode:d,selectionKeyPressed:R,paneClickDistance:l,selectionOnDrag:te,children:[e,A&&a.jsx(kO,{onSelectionContextMenu:k,noPanClassName:M,disableKeyboardA11y:_})]})})}iS.displayName="FlowRenderer";const TO=m.memo(iS),DO=e=>t=>e?Wp(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(n=>n.id):Array.from(t.nodeLookup.keys());function _O(e){return Qe(m.useCallback(DO(e),[e]),Mt)}const AO=e=>e.updateNodeInternals;function OO(){const e=Qe(AO),[t]=m.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const s=new Map;n.forEach(r=>{const i=r.target.getAttribute("data-id");s.set(i,{id:i,nodeElement:r.target,force:!0})}),e(s)}));return m.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function zO({node:e,nodeType:t,hasDimensions:n,resizeObserver:s}){const r=St(),i=m.useRef(null),o=m.useRef(null),l=m.useRef(e.sourcePosition),c=m.useRef(e.targetPosition),u=m.useRef(t),h=n&&!!e.internals.handleBounds;return m.useEffect(()=>{i.current&&!e.hidden&&(!h||o.current!==i.current)&&(o.current&&(s==null||s.unobserve(o.current)),s==null||s.observe(i.current),o.current=i.current)},[h,e.hidden]),m.useEffect(()=>()=>{o.current&&(s==null||s.unobserve(o.current),o.current=null)},[]),m.useEffect(()=>{if(i.current){const d=u.current!==t,f=l.current!==e.sourcePosition,x=c.current!==e.targetPosition;(d||f||x)&&(u.current=t,l.current=e.sourcePosition,c.current=e.targetPosition,r.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:i.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),i}function RO({id:e,onClick:t,onMouseEnter:n,onMouseMove:s,onMouseLeave:r,onContextMenu:i,onDoubleClick:o,nodesDraggable:l,elementsSelectable:c,nodesConnectable:u,nodesFocusable:h,resizeObserver:d,noDragClassName:f,noPanClassName:x,disableKeyboardA11y:b,rfId:v,nodeTypes:j,nodeClickDistance:g,onError:y}){const{node:p,internals:w,isParent:N}=Qe(ee=>{const se=ee.nodeLookup.get(e),ge=ee.parentLookup.has(e);return{node:se,internals:se.internals,isParent:ge}},Mt);let S=p.type||"default",C=(j==null?void 0:j[S])||oy[S];C===void 0&&(y==null||y("003",qs.error003(S)),S="default",C=(j==null?void 0:j.default)||oy.default);const T=!!(p.draggable||l&&typeof p.draggable>"u"),U=!!(p.selectable||c&&typeof p.selectable>"u"),B=!!(p.connectable||u&&typeof p.connectable>"u"),P=!!(p.focusable||h&&typeof p.focusable>"u"),z=St(),Y=j2(p),k=zO({node:p,nodeType:S,hasDimensions:Y,resizeObserver:d}),$=sS({nodeRef:k,disabled:p.hidden||!T,noDragClassName:f,handleSelector:p.dragHandle,nodeId:e,isSelectable:U,nodeClickDistance:g}),M=aS();if(p.hidden)return null;const _=Ma(p),E=CO(p),D=U||T||t||n||s||r,A=n?ee=>n(ee,{...w.userNode}):void 0,q=s?ee=>s(ee,{...w.userNode}):void 0,R=r?ee=>r(ee,{...w.userNode}):void 0,L=i?ee=>i(ee,{...w.userNode}):void 0,X=o?ee=>o(ee,{...w.userNode}):void 0,G=ee=>{const{selectNodesOnDrag:se,nodeDragThreshold:ge}=z.getState();U&&(!se||!T||ge>0)&&mg({id:e,store:z,nodeRef:k}),t&&t(ee,{...w.userNode})},te=ee=>{if(!(C2(ee.nativeEvent)||b)){if(f2.includes(ee.key)&&U){const se=ee.key==="Escape";mg({id:e,store:z,unselect:se,nodeRef:k})}else if(T&&p.selected&&Object.prototype.hasOwnProperty.call(dh,ee.key)){ee.preventDefault();const{ariaLabelConfig:se}=z.getState();z.setState({ariaLiveMessage:se["node.a11yDescription.ariaLiveMessage"]({direction:ee.key.replace("Arrow","").toLowerCase(),x:~~w.positionAbsolute.x,y:~~w.positionAbsolute.y})}),M({direction:dh[ee.key],factor:ee.shiftKey?4:1})}}},re=()=>{var we;if(b||!((we=k.current)!=null&&we.matches(":focus-visible")))return;const{transform:ee,width:se,height:ge,autoPanOnNodeFocus:ae,setCenter:ue}=z.getState();if(!ae)return;Wp(new Map([[e,p]]),{x:0,y:0,width:se,height:ge},ee,!0).length>0||ue(p.position.x+_.width/2,p.position.y+_.height/2,{zoom:ee[2]})};return a.jsx("div",{className:Ht(["react-flow__node",`react-flow__node-${S}`,{[x]:T},p.className,{selected:p.selected,selectable:U,parent:N,draggable:T,dragging:$}]),ref:k,style:{zIndex:w.z,transform:`translate(${w.positionAbsolute.x}px,${w.positionAbsolute.y}px)`,pointerEvents:D?"all":"none",visibility:Y?"visible":"hidden",...p.style,...E},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:A,onMouseMove:q,onMouseLeave:R,onContextMenu:L,onClick:G,onDoubleClick:X,onKeyDown:P?te:void 0,tabIndex:P?0:void 0,onFocus:P?re:void 0,role:p.ariaRole??(P?"group":void 0),"aria-roledescription":"node","aria-describedby":b?void 0:`${G2}-${v}`,"aria-label":p.ariaLabel,...p.domAttributes,children:a.jsx(pO,{value:e,children:a.jsx(C,{id:e,data:p.data,type:S,positionAbsoluteX:w.positionAbsolute.x,positionAbsoluteY:w.positionAbsolute.y,selected:p.selected??!1,selectable:U,draggable:T,deletable:p.deletable??!0,isConnectable:B,sourcePosition:p.sourcePosition,targetPosition:p.targetPosition,dragging:$,dragHandle:p.dragHandle,zIndex:w.z,parentId:p.parentId,..._})})})}var UO=m.memo(RO);const $O=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function oS(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:s,elementsSelectable:r,onError:i}=Qe($O,Mt),o=_O(e.onlyRenderVisibleElements),l=OO();return a.jsx("div",{className:"react-flow__nodes",style:rf,children:o.map(c=>a.jsx(UO,{id:c,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:l,nodesDraggable:t,nodesConnectable:n,nodesFocusable:s,elementsSelectable:r,nodeClickDistance:e.nodeClickDistance,onError:i},c))})}oS.displayName="NodeRenderer";const PO=m.memo(oS);function LO(e){return Qe(m.useCallback(n=>{if(!e)return n.edges.map(r=>r.id);const s=[];if(n.width&&n.height)for(const r of n.edges){const i=n.nodeLookup.get(r.source),o=n.nodeLookup.get(r.target);i&&o&&SA({sourceNode:i,targetNode:o,width:n.width,height:n.height,transform:n.transform})&&s.push(r.id)}return s},[e]),Mt)}const HO=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return a.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},BO=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return a.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},cy={[oh.Arrow]:HO,[oh.ArrowClosed]:BO};function VO(e){const t=St();return m.useMemo(()=>{var r,i;return Object.prototype.hasOwnProperty.call(cy,e)?cy[e]:((i=(r=t.getState()).onError)==null||i.call(r,"009",qs.error009(e)),null)},[e])}const YO=({id:e,type:t,color:n,width:s=12.5,height:r=12.5,markerUnits:i="strokeWidth",strokeWidth:o,orient:l="auto-start-reverse"})=>{const c=VO(t);return c?a.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${s}`,markerHeight:`${r}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:l,refX:"0",refY:"0",children:a.jsx(c,{color:n,strokeWidth:o})}):null},lS=({defaultColor:e,rfId:t})=>{const n=Qe(i=>i.edges),s=Qe(i=>i.defaultEdgeOptions),r=m.useMemo(()=>_A(n,{id:t,defaultColor:e,defaultMarkerStart:s==null?void 0:s.markerStart,defaultMarkerEnd:s==null?void 0:s.markerEnd}),[n,s,t,e]);return r.length?a.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:a.jsx("defs",{children:r.map(i=>a.jsx(YO,{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};lS.displayName="MarkerDefinitions";var FO=m.memo(lS);function cS({x:e,y:t,label:n,labelStyle:s,labelShowBg:r=!0,labelBgStyle:i,labelBgPadding:o=[2,4],labelBgBorderRadius:l=2,children:c,className:u,...h}){const[d,f]=m.useState({x:1,y:0,width:0,height:0}),x=Ht(["react-flow__edge-textwrapper",u]),b=m.useRef(null);return m.useEffect(()=>{if(b.current){const v=b.current.getBBox();f({x:v.x,y:v.y,width:v.width,height:v.height})}},[n]),n?a.jsxs("g",{transform:`translate(${e-d.width/2} ${t-d.height/2})`,className:x,visibility:d.width?"visible":"hidden",...h,children:[r&&a.jsx("rect",{width:d.width+2*o[0],x:-o[0],y:-o[1],height:d.height+2*o[1],className:"react-flow__edge-textbg",style:i,rx:l,ry:l}),a.jsx("text",{className:"react-flow__edge-text",y:d.height/2,dy:"0.3em",ref:b,style:s,children:n}),c]}):null}cS.displayName="EdgeText";const IO=m.memo(cS);function of({path:e,labelX:t,labelY:n,label:s,labelStyle:r,labelShowBg:i,labelBgStyle:o,labelBgPadding:l,labelBgBorderRadius:c,interactionWidth:u=20,...h}){return a.jsxs(a.Fragment,{children:[a.jsx("path",{...h,d:e,fill:"none",className:Ht(["react-flow__edge-path",h.className])}),u?a.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:u,className:"react-flow__edge-interaction"}):null,s&&xs(t)&&xs(n)?a.jsx(IO,{x:t,y:n,label:s,labelStyle:r,labelShowBg:i,labelBgStyle:o,labelBgPadding:l,labelBgBorderRadius:c}):null]})}function dy({pos:e,x1:t,y1:n,x2:s,y2:r}){return e===Te.Left||e===Te.Right?[.5*(t+s),n]:[t,.5*(n+r)]}function dS({sourceX:e,sourceY:t,sourcePosition:n=Te.Bottom,targetX:s,targetY:r,targetPosition:i=Te.Top}){const[o,l]=dy({pos:n,x1:e,y1:t,x2:s,y2:r}),[c,u]=dy({pos:i,x1:s,y1:r,x2:e,y2:t}),[h,d,f,x]=k2({sourceX:e,sourceY:t,targetX:s,targetY:r,sourceControlX:o,sourceControlY:l,targetControlX:c,targetControlY:u});return[`M${e},${t} C${o},${l} ${c},${u} ${s},${r}`,h,d,f,x]}function uS(e){return m.memo(({id:t,sourceX:n,sourceY:s,targetX:r,targetY:i,sourcePosition:o,targetPosition:l,label:c,labelStyle:u,labelShowBg:h,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:x,style:b,markerEnd:v,markerStart:j,interactionWidth:g})=>{const[y,p,w]=dS({sourceX:n,sourceY:s,sourcePosition:o,targetX:r,targetY:i,targetPosition:l}),N=e.isInternal?void 0:t;return a.jsx(of,{id:N,path:y,labelX:p,labelY:w,label:c,labelStyle:u,labelShowBg:h,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:x,style:b,markerEnd:v,markerStart:j,interactionWidth:g})})}const WO=uS({isInternal:!1}),hS=uS({isInternal:!0});WO.displayName="SimpleBezierEdge";hS.displayName="SimpleBezierEdgeInternal";function fS(e){return m.memo(({id:t,sourceX:n,sourceY:s,targetX:r,targetY:i,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:h,labelBgBorderRadius:d,style:f,sourcePosition:x=Te.Bottom,targetPosition:b=Te.Top,markerEnd:v,markerStart:j,pathOptions:g,interactionWidth:y})=>{const[p,w,N]=dg({sourceX:n,sourceY:s,sourcePosition:x,targetX:r,targetY:i,targetPosition:b,borderRadius:g==null?void 0:g.borderRadius,offset:g==null?void 0:g.offset,stepPosition:g==null?void 0:g.stepPosition}),S=e.isInternal?void 0:t;return a.jsx(of,{id:S,path:p,labelX:w,labelY:N,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:h,labelBgBorderRadius:d,style:f,markerEnd:v,markerStart:j,interactionWidth:y})})}const mS=fS({isInternal:!1}),xS=fS({isInternal:!0});mS.displayName="SmoothStepEdge";xS.displayName="SmoothStepEdgeInternal";function gS(e){return m.memo(({id:t,...n})=>{var r;const s=e.isInternal?void 0:t;return a.jsx(mS,{...n,id:s,pathOptions:m.useMemo(()=>{var i;return{borderRadius:0,offset:(i=n.pathOptions)==null?void 0:i.offset}},[(r=n.pathOptions)==null?void 0:r.offset])})})}const qO=gS({isInternal:!1}),pS=gS({isInternal:!0});qO.displayName="StepEdge";pS.displayName="StepEdgeInternal";function vS(e){return m.memo(({id:t,sourceX:n,sourceY:s,targetX:r,targetY:i,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:h,labelBgBorderRadius:d,style:f,markerEnd:x,markerStart:b,interactionWidth:v})=>{const[j,g,y]=_2({sourceX:n,sourceY:s,targetX:r,targetY:i}),p=e.isInternal?void 0:t;return a.jsx(of,{id:p,path:j,labelX:g,labelY:y,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:h,labelBgBorderRadius:d,style:f,markerEnd:x,markerStart:b,interactionWidth:v})})}const XO=vS({isInternal:!1}),bS=vS({isInternal:!0});XO.displayName="StraightEdge";bS.displayName="StraightEdgeInternal";function yS(e){return m.memo(({id:t,sourceX:n,sourceY:s,targetX:r,targetY:i,sourcePosition:o=Te.Bottom,targetPosition:l=Te.Top,label:c,labelStyle:u,labelShowBg:h,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:x,style:b,markerEnd:v,markerStart:j,pathOptions:g,interactionWidth:y})=>{const[p,w,N]=M2({sourceX:n,sourceY:s,sourcePosition:o,targetX:r,targetY:i,targetPosition:l,curvature:g==null?void 0:g.curvature}),S=e.isInternal?void 0:t;return a.jsx(of,{id:S,path:p,labelX:w,labelY:N,label:c,labelStyle:u,labelShowBg:h,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:x,style:b,markerEnd:v,markerStart:j,interactionWidth:y})})}const GO=yS({isInternal:!1}),wS=yS({isInternal:!0});GO.displayName="BezierEdge";wS.displayName="BezierEdgeInternal";const uy={default:wS,straight:bS,step:pS,smoothstep:xS,simplebezier:hS},hy={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},ZO=(e,t,n)=>n===Te.Left?e-t:n===Te.Right?e+t:e,QO=(e,t,n)=>n===Te.Top?e-t:n===Te.Bottom?e+t:e,fy="react-flow__edgeupdater";function my({position:e,centerX:t,centerY:n,radius:s=10,onMouseDown:r,onMouseEnter:i,onMouseOut:o,type:l}){return a.jsx("circle",{onMouseDown:r,onMouseEnter:i,onMouseOut:o,className:Ht([fy,`${fy}-${l}`]),cx:ZO(t,s,e),cy:QO(n,s,e),r:s,stroke:"transparent",fill:"transparent"})}function KO({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:s,sourceY:r,targetX:i,targetY:o,sourcePosition:l,targetPosition:c,onReconnect:u,onReconnectStart:h,onReconnectEnd:d,setReconnecting:f,setUpdateHover:x}){const b=St(),v=(w,N)=>{if(w.button!==0)return;const{autoPanOnConnect:S,domNode:C,isValidConnection:T,connectionMode:U,connectionRadius:B,lib:P,onConnectStart:z,onConnectEnd:Y,cancelConnection:k,nodeLookup:$,rfId:M,panBy:_,updateConnection:E}=b.getState(),D=N.type==="target",A=(L,X)=>{f(!1),d==null||d(L,n,N.type,X)},q=L=>u==null?void 0:u(n,L),R=(L,X)=>{f(!0),h==null||h(w,n,N.type),z==null||z(L,X)};fg.onPointerDown(w.nativeEvent,{autoPanOnConnect:S,connectionMode:U,connectionRadius:B,domNode:C,handleId:N.id,nodeId:N.nodeId,nodeLookup:$,isTarget:D,edgeUpdaterType:N.type,lib:P,flowId:M,cancelConnection:k,panBy:_,isValidConnection:T,onConnect:q,onConnectStart:R,onConnectEnd:Y,onReconnectEnd:A,updateConnection:E,getTransform:()=>b.getState().transform,getFromHandle:()=>b.getState().connection.fromHandle,dragThreshold:b.getState().connectionDragThreshold,handleDomNode:w.currentTarget})},j=w=>v(w,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),g=w=>v(w,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),y=()=>x(!0),p=()=>x(!1);return a.jsxs(a.Fragment,{children:[(e===!0||e==="source")&&a.jsx(my,{position:l,centerX:s,centerY:r,radius:t,onMouseDown:j,onMouseEnter:y,onMouseOut:p,type:"source"}),(e===!0||e==="target")&&a.jsx(my,{position:c,centerX:i,centerY:o,radius:t,onMouseDown:g,onMouseEnter:y,onMouseOut:p,type:"target"})]})}function JO({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:s,onClick:r,onDoubleClick:i,onContextMenu:o,onMouseEnter:l,onMouseMove:c,onMouseLeave:u,reconnectRadius:h,onReconnect:d,onReconnectStart:f,onReconnectEnd:x,rfId:b,edgeTypes:v,noPanClassName:j,onError:g,disableKeyboardA11y:y}){let p=Qe(ue=>ue.edgeLookup.get(e));const w=Qe(ue=>ue.defaultEdgeOptions);p=w?{...w,...p}:p;let N=p.type||"default",S=(v==null?void 0:v[N])||uy[N];S===void 0&&(g==null||g("011",qs.error011(N)),N="default",S=(v==null?void 0:v.default)||uy.default);const C=!!(p.focusable||t&&typeof p.focusable>"u"),T=typeof d<"u"&&(p.reconnectable||n&&typeof p.reconnectable>"u"),U=!!(p.selectable||s&&typeof p.selectable>"u"),B=m.useRef(null),[P,z]=m.useState(!1),[Y,k]=m.useState(!1),$=St(),{zIndex:M,sourceX:_,sourceY:E,targetX:D,targetY:A,sourcePosition:q,targetPosition:R}=Qe(m.useCallback(ue=>{const he=ue.nodeLookup.get(p.source),we=ue.nodeLookup.get(p.target);if(!he||!we)return{zIndex:p.zIndex,...hy};const Ne=DA({id:e,sourceNode:he,targetNode:we,sourceHandle:p.sourceHandle||null,targetHandle:p.targetHandle||null,connectionMode:ue.connectionMode,onError:g});return{zIndex:NA({selected:p.selected,zIndex:p.zIndex,sourceNode:he,targetNode:we,elevateOnSelect:ue.elevateEdgesOnSelect}),...Ne||hy}},[p.source,p.target,p.sourceHandle,p.targetHandle,p.selected,p.zIndex]),Mt),L=m.useMemo(()=>p.markerStart?`url('#${ug(p.markerStart,b)}')`:void 0,[p.markerStart,b]),X=m.useMemo(()=>p.markerEnd?`url('#${ug(p.markerEnd,b)}')`:void 0,[p.markerEnd,b]);if(p.hidden||_===null||E===null||D===null||A===null)return null;const G=ue=>{var Ce;const{addSelectedEdges:he,unselectNodesAndEdges:we,multiSelectionActive:Ne}=$.getState();U&&($.setState({nodesSelectionActive:!1}),p.selected&&Ne?(we({nodes:[],edges:[p]}),(Ce=B.current)==null||Ce.blur()):he([e])),r&&r(ue,p)},te=i?ue=>{i(ue,{...p})}:void 0,re=o?ue=>{o(ue,{...p})}:void 0,ee=l?ue=>{l(ue,{...p})}:void 0,se=c?ue=>{c(ue,{...p})}:void 0,ge=u?ue=>{u(ue,{...p})}:void 0,ae=ue=>{var he;if(!y&&f2.includes(ue.key)&&U){const{unselectNodesAndEdges:we,addSelectedEdges:Ne}=$.getState();ue.key==="Escape"?((he=B.current)==null||he.blur(),we({edges:[p]})):Ne([e])}};return a.jsx("svg",{style:{zIndex:M},children:a.jsxs("g",{className:Ht(["react-flow__edge",`react-flow__edge-${N}`,p.className,j,{selected:p.selected,animated:p.animated,inactive:!U&&!r,updating:P,selectable:U}]),onClick:G,onDoubleClick:te,onContextMenu:re,onMouseEnter:ee,onMouseMove:se,onMouseLeave:ge,onKeyDown:C?ae:void 0,tabIndex:C?0:void 0,role:p.ariaRole??(C?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":p.ariaLabel===null?void 0:p.ariaLabel||`Edge from ${p.source} to ${p.target}`,"aria-describedby":C?`${Z2}-${b}`:void 0,ref:B,...p.domAttributes,children:[!Y&&a.jsx(S,{id:e,source:p.source,target:p.target,type:p.type,selected:p.selected,animated:p.animated,selectable:U,deletable:p.deletable??!0,label:p.label,labelStyle:p.labelStyle,labelShowBg:p.labelShowBg,labelBgStyle:p.labelBgStyle,labelBgPadding:p.labelBgPadding,labelBgBorderRadius:p.labelBgBorderRadius,sourceX:_,sourceY:E,targetX:D,targetY:A,sourcePosition:q,targetPosition:R,data:p.data,style:p.style,sourceHandleId:p.sourceHandle,targetHandleId:p.targetHandle,markerStart:L,markerEnd:X,pathOptions:"pathOptions"in p?p.pathOptions:void 0,interactionWidth:p.interactionWidth}),T&&a.jsx(KO,{edge:p,isReconnectable:T,reconnectRadius:h,onReconnect:d,onReconnectStart:f,onReconnectEnd:x,sourceX:_,sourceY:E,targetX:D,targetY:A,sourcePosition:q,targetPosition:R,setUpdateHover:z,setReconnecting:k})]})})}var ez=m.memo(JO);const tz=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function jS({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:s,noPanClassName:r,onReconnect:i,onEdgeContextMenu:o,onEdgeMouseEnter:l,onEdgeMouseMove:c,onEdgeMouseLeave:u,onEdgeClick:h,reconnectRadius:d,onEdgeDoubleClick:f,onReconnectStart:x,onReconnectEnd:b,disableKeyboardA11y:v}){const{edgesFocusable:j,edgesReconnectable:g,elementsSelectable:y,onError:p}=Qe(tz,Mt),w=LO(t);return a.jsxs("div",{className:"react-flow__edges",children:[a.jsx(FO,{defaultColor:e,rfId:n}),w.map(N=>a.jsx(ez,{id:N,edgesFocusable:j,edgesReconnectable:g,elementsSelectable:y,noPanClassName:r,onReconnect:i,onContextMenu:o,onMouseEnter:l,onMouseMove:c,onMouseLeave:u,onClick:h,reconnectRadius:d,onDoubleClick:f,onReconnectStart:x,onReconnectEnd:b,rfId:n,onError:p,edgeTypes:s,disableKeyboardA11y:v},N))]})}jS.displayName="EdgeRenderer";const nz=m.memo(jS),sz=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function az({children:e}){const t=Qe(sz);return a.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function rz(e){const t=Jp(),n=m.useRef(!1);m.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const iz=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function oz(e){const t=Qe(iz),n=St();return m.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function lz(e){return e.connection.inProgress?{...e.connection,to:Kc(e.connection.to,e.transform)}:{...e.connection}}function cz(e){return lz}function dz(e){const t=cz();return Qe(t,Mt)}const uz=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function hz({containerStyle:e,style:t,type:n,component:s}){const{nodesConnectable:r,width:i,height:o,isValid:l,inProgress:c}=Qe(uz,Mt);return!(i&&r&&c)?null:a.jsx("svg",{style:e,width:i,height:o,className:"react-flow__connectionline react-flow__container",children:a.jsx("g",{className:Ht(["react-flow__connection",g2(l)]),children:a.jsx(NS,{style:t,type:n,CustomComponent:s,isValid:l})})})}const NS=({style:e,type:t=Ka.Bezier,CustomComponent:n,isValid:s})=>{const{inProgress:r,from:i,fromNode:o,fromHandle:l,fromPosition:c,to:u,toNode:h,toHandle:d,toPosition:f,pointer:x}=dz();if(!r)return;if(n)return a.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:o,fromHandle:l,fromX:i.x,fromY:i.y,toX:u.x,toY:u.y,fromPosition:c,toPosition:f,connectionStatus:g2(s),toNode:h,toHandle:d,pointer:x});let b="";const v={sourceX:i.x,sourceY:i.y,sourcePosition:c,targetX:u.x,targetY:u.y,targetPosition:f};switch(t){case Ka.Bezier:[b]=M2(v);break;case Ka.SimpleBezier:[b]=dS(v);break;case Ka.Step:[b]=dg({...v,borderRadius:0});break;case Ka.SmoothStep:[b]=dg(v);break;default:[b]=_2(v)}return a.jsx("path",{d:b,fill:"none",className:"react-flow__connection-path",style:e})};NS.displayName="ConnectionLine";const fz={};function xy(e=fz){m.useRef(e),St(),m.useEffect(()=>{},[e])}function mz(){St(),m.useRef(!1),m.useEffect(()=>{},[])}function SS({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:s,onEdgeClick:r,onNodeDoubleClick:i,onEdgeDoubleClick:o,onNodeMouseEnter:l,onNodeMouseMove:c,onNodeMouseLeave:u,onNodeContextMenu:h,onSelectionContextMenu:d,onSelectionStart:f,onSelectionEnd:x,connectionLineType:b,connectionLineStyle:v,connectionLineComponent:j,connectionLineContainerStyle:g,selectionKeyCode:y,selectionOnDrag:p,selectionMode:w,multiSelectionKeyCode:N,panActivationKeyCode:S,zoomActivationKeyCode:C,deleteKeyCode:T,onlyRenderVisibleElements:U,elementsSelectable:B,defaultViewport:P,translateExtent:z,minZoom:Y,maxZoom:k,preventScrolling:$,defaultMarkerColor:M,zoomOnScroll:_,zoomOnPinch:E,panOnScroll:D,panOnScrollSpeed:A,panOnScrollMode:q,zoomOnDoubleClick:R,panOnDrag:L,onPaneClick:X,onPaneMouseEnter:G,onPaneMouseMove:te,onPaneMouseLeave:re,onPaneScroll:ee,onPaneContextMenu:se,paneClickDistance:ge,nodeClickDistance:ae,onEdgeContextMenu:ue,onEdgeMouseEnter:he,onEdgeMouseMove:we,onEdgeMouseLeave:Ne,reconnectRadius:Ce,onReconnect:Ae,onReconnectStart:tt,onReconnectEnd:$e,noDragClassName:Rt,noWheelClassName:Tt,noPanClassName:Be,disableKeyboardA11y:We,nodeExtent:vt,rfId:bt,viewport:ft,onViewportChange:Q}){return xy(e),xy(t),mz(),rz(n),oz(ft),a.jsx(TO,{onPaneClick:X,onPaneMouseEnter:G,onPaneMouseMove:te,onPaneMouseLeave:re,onPaneContextMenu:se,onPaneScroll:ee,paneClickDistance:ge,deleteKeyCode:T,selectionKeyCode:y,selectionOnDrag:p,selectionMode:w,onSelectionStart:f,onSelectionEnd:x,multiSelectionKeyCode:N,panActivationKeyCode:S,zoomActivationKeyCode:C,elementsSelectable:B,zoomOnScroll:_,zoomOnPinch:E,zoomOnDoubleClick:R,panOnScroll:D,panOnScrollSpeed:A,panOnScrollMode:q,panOnDrag:L,defaultViewport:P,translateExtent:z,minZoom:Y,maxZoom:k,onSelectionContextMenu:d,preventScrolling:$,noDragClassName:Rt,noWheelClassName:Tt,noPanClassName:Be,disableKeyboardA11y:We,onViewportChange:Q,isControlledViewport:!!ft,children:a.jsxs(az,{children:[a.jsx(nz,{edgeTypes:t,onEdgeClick:r,onEdgeDoubleClick:o,onReconnect:Ae,onReconnectStart:tt,onReconnectEnd:$e,onlyRenderVisibleElements:U,onEdgeContextMenu:ue,onEdgeMouseEnter:he,onEdgeMouseMove:we,onEdgeMouseLeave:Ne,reconnectRadius:Ce,defaultMarkerColor:M,noPanClassName:Be,disableKeyboardA11y:We,rfId:bt}),a.jsx(hz,{style:v,type:b,component:j,containerStyle:g}),a.jsx("div",{className:"react-flow__edgelabel-renderer"}),a.jsx(PO,{nodeTypes:e,onNodeClick:s,onNodeDoubleClick:i,onNodeMouseEnter:l,onNodeMouseMove:c,onNodeMouseLeave:u,onNodeContextMenu:h,nodeClickDistance:ae,onlyRenderVisibleElements:U,noPanClassName:Be,noDragClassName:Rt,disableKeyboardA11y:We,nodeExtent:vt,rfId:bt}),a.jsx("div",{className:"react-flow__viewport-portal"})]})})}SS.displayName="GraphView";const xz=m.memo(SS),gy=({nodes:e,edges:t,defaultNodes:n,defaultEdges:s,width:r,height:i,fitView:o,fitViewOptions:l,minZoom:c=.5,maxZoom:u=2,nodeOrigin:h,nodeExtent:d}={})=>{const f=new Map,x=new Map,b=new Map,v=new Map,j=s??t??[],g=n??e??[],y=h??[0,0],p=d??bc;z2(b,v,j);const w=hg(g,f,x,{nodeOrigin:y,nodeExtent:p,elevateNodesOnSelect:!1});let N=[0,0,1];if(o&&r&&i){const S=Zc(f,{filter:B=>!!((B.width||B.initialWidth)&&(B.height||B.initialHeight))}),{x:C,y:T,zoom:U}=qp(S,r,i,c,u,(l==null?void 0:l.padding)??.1);N=[C,T,U]}return{rfId:"1",width:r??0,height:i??0,transform:N,nodes:g,nodesInitialized:w,nodeLookup:f,parentLookup:x,edges:j,edgeLookup:v,connectionLookup:b,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:s!==void 0,panZoom:null,minZoom:c,maxZoom:u,translateExtent:bc,nodeExtent:p,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:To.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:y,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!1,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:o??!1,fitViewOptions:l,fitViewResolver:null,connection:{...x2},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:pA,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:m2}},gz=({nodes:e,edges:t,defaultNodes:n,defaultEdges:s,width:r,height:i,fitView:o,fitViewOptions:l,minZoom:c,maxZoom:u,nodeOrigin:h,nodeExtent:d})=>z6((f,x)=>{async function b(){const{nodeLookup:v,panZoom:j,fitViewOptions:g,fitViewResolver:y,width:p,height:w,minZoom:N,maxZoom:S}=x();j&&(await xA({nodes:v,width:p,height:w,panZoom:j,minZoom:N,maxZoom:S},g),y==null||y.resolve(!0),f({fitViewResolver:null}))}return{...gy({nodes:e,edges:t,width:r,height:i,fitView:o,fitViewOptions:l,minZoom:c,maxZoom:u,nodeOrigin:h,nodeExtent:d,defaultNodes:n,defaultEdges:s}),setNodes:v=>{const{nodeLookup:j,parentLookup:g,nodeOrigin:y,elevateNodesOnSelect:p,fitViewQueued:w}=x(),N=hg(v,j,g,{nodeOrigin:y,nodeExtent:d,elevateNodesOnSelect:p,checkEquality:!0});w&&N?(b(),f({nodes:v,nodesInitialized:N,fitViewQueued:!1,fitViewOptions:void 0})):f({nodes:v,nodesInitialized:N})},setEdges:v=>{const{connectionLookup:j,edgeLookup:g}=x();z2(j,g,v),f({edges:v})},setDefaultNodesAndEdges:(v,j)=>{if(v){const{setNodes:g}=x();g(v),f({hasDefaultNodes:!0})}if(j){const{setEdges:g}=x();g(j),f({hasDefaultEdges:!0})}},updateNodeInternals:v=>{const{triggerNodeChanges:j,nodeLookup:g,parentLookup:y,domNode:p,nodeOrigin:w,nodeExtent:N,debug:S,fitViewQueued:C}=x(),{changes:T,updatedInternals:U}=PA(v,g,y,p,w,N);U&&(zA(g,y,{nodeOrigin:w,nodeExtent:N}),C?(b(),f({fitViewQueued:!1,fitViewOptions:void 0})):f({}),(T==null?void 0:T.length)>0&&(S&&console.log("React Flow: trigger node changes",T),j==null||j(T)))},updateNodePositions:(v,j=!1)=>{const g=[],y=[],{nodeLookup:p,triggerNodeChanges:w}=x();for(const[N,S]of v){const C=p.get(N),T=!!(C!=null&&C.expandParent&&(C!=null&&C.parentId)&&(S!=null&&S.position)),U={id:N,type:"position",position:T?{x:Math.max(0,S.position.x),y:Math.max(0,S.position.y)}:S.position,dragging:j};T&&C.parentId&&g.push({id:N,parentId:C.parentId,rect:{...S.internals.positionAbsolute,width:S.measured.width??0,height:S.measured.height??0}}),y.push(U)}if(g.length>0){const{parentLookup:N,nodeOrigin:S}=x(),C=Kp(g,p,N,S);y.push(...C)}w(y)},triggerNodeChanges:v=>{const{onNodesChange:j,setNodes:g,nodes:y,hasDefaultNodes:p,debug:w}=x();if(v!=null&&v.length){if(p){const N=J2(v,y);g(N)}w&&console.log("React Flow: trigger node changes",v),j==null||j(v)}},triggerEdgeChanges:v=>{const{onEdgesChange:j,setEdges:g,edges:y,hasDefaultEdges:p,debug:w}=x();if(v!=null&&v.length){if(p){const N=eS(v,y);g(N)}w&&console.log("React Flow: trigger edge changes",v),j==null||j(v)}},addSelectedNodes:v=>{const{multiSelectionActive:j,edgeLookup:g,nodeLookup:y,triggerNodeChanges:p,triggerEdgeChanges:w}=x();if(j){const N=v.map(S=>$r(S,!0));p(N);return}p(Ji(y,new Set([...v]),!0)),w(Ji(g))},addSelectedEdges:v=>{const{multiSelectionActive:j,edgeLookup:g,nodeLookup:y,triggerNodeChanges:p,triggerEdgeChanges:w}=x();if(j){const N=v.map(S=>$r(S,!0));w(N);return}w(Ji(g,new Set([...v]))),p(Ji(y,new Set,!0))},unselectNodesAndEdges:({nodes:v,edges:j}={})=>{const{edges:g,nodes:y,nodeLookup:p,triggerNodeChanges:w,triggerEdgeChanges:N}=x(),S=v||y,C=j||g,T=S.map(B=>{const P=p.get(B.id);return P&&(P.selected=!1),$r(B.id,!1)}),U=C.map(B=>$r(B.id,!1));w(T),N(U)},setMinZoom:v=>{const{panZoom:j,maxZoom:g}=x();j==null||j.setScaleExtent([v,g]),f({minZoom:v})},setMaxZoom:v=>{const{panZoom:j,minZoom:g}=x();j==null||j.setScaleExtent([g,v]),f({maxZoom:v})},setTranslateExtent:v=>{var j;(j=x().panZoom)==null||j.setTranslateExtent(v),f({translateExtent:v})},resetSelectedElements:()=>{const{edges:v,nodes:j,triggerNodeChanges:g,triggerEdgeChanges:y,elementsSelectable:p}=x();if(!p)return;const w=j.reduce((S,C)=>C.selected?[...S,$r(C.id,!1)]:S,[]),N=v.reduce((S,C)=>C.selected?[...S,$r(C.id,!1)]:S,[]);g(w),y(N)},setNodeExtent:v=>{const{nodes:j,nodeLookup:g,parentLookup:y,nodeOrigin:p,elevateNodesOnSelect:w,nodeExtent:N}=x();v[0][0]===N[0][0]&&v[0][1]===N[0][1]&&v[1][0]===N[1][0]&&v[1][1]===N[1][1]||(hg(j,g,y,{nodeOrigin:p,nodeExtent:v,elevateNodesOnSelect:w,checkEquality:!1}),f({nodeExtent:v}))},panBy:v=>{const{transform:j,width:g,height:y,panZoom:p,translateExtent:w}=x();return LA({delta:v,panZoom:p,transform:j,translateExtent:w,width:g,height:y})},setCenter:async(v,j,g)=>{const{width:y,height:p,maxZoom:w,panZoom:N}=x();if(!N)return Promise.resolve(!1);const S=typeof(g==null?void 0:g.zoom)<"u"?g.zoom:w;return await N.setViewport({x:y/2-v*S,y:p/2-j*S,zoom:S},{duration:g==null?void 0:g.duration,ease:g==null?void 0:g.ease,interpolate:g==null?void 0:g.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{f({connection:{...x2}})},updateConnection:v=>{f({connection:v})},reset:()=>f({...gy()})}},Object.is);function pz({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:s,initialWidth:r,initialHeight:i,initialMinZoom:o,initialMaxZoom:l,initialFitViewOptions:c,fitView:u,nodeOrigin:h,nodeExtent:d,children:f}){const[x]=m.useState(()=>gz({nodes:e,edges:t,defaultNodes:n,defaultEdges:s,width:r,height:i,fitView:u,minZoom:o,maxZoom:l,fitViewOptions:c,nodeOrigin:h,nodeExtent:d}));return a.jsx(R6,{value:x,children:a.jsx(aO,{children:f})})}function vz({children:e,nodes:t,edges:n,defaultNodes:s,defaultEdges:r,width:i,height:o,fitView:l,fitViewOptions:c,minZoom:u,maxZoom:h,nodeOrigin:d,nodeExtent:f}){return m.useContext(sf)?a.jsx(a.Fragment,{children:e}):a.jsx(pz,{initialNodes:t,initialEdges:n,defaultNodes:s,defaultEdges:r,initialWidth:i,initialHeight:o,fitView:l,initialFitViewOptions:c,initialMinZoom:u,initialMaxZoom:h,nodeOrigin:d,nodeExtent:f,children:e})}const bz={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function yz({nodes:e,edges:t,defaultNodes:n,defaultEdges:s,className:r,nodeTypes:i,edgeTypes:o,onNodeClick:l,onEdgeClick:c,onInit:u,onMove:h,onMoveStart:d,onMoveEnd:f,onConnect:x,onConnectStart:b,onConnectEnd:v,onClickConnectStart:j,onClickConnectEnd:g,onNodeMouseEnter:y,onNodeMouseMove:p,onNodeMouseLeave:w,onNodeContextMenu:N,onNodeDoubleClick:S,onNodeDragStart:C,onNodeDrag:T,onNodeDragStop:U,onNodesDelete:B,onEdgesDelete:P,onDelete:z,onSelectionChange:Y,onSelectionDragStart:k,onSelectionDrag:$,onSelectionDragStop:M,onSelectionContextMenu:_,onSelectionStart:E,onSelectionEnd:D,onBeforeDelete:A,connectionMode:q,connectionLineType:R=Ka.Bezier,connectionLineStyle:L,connectionLineComponent:X,connectionLineContainerStyle:G,deleteKeyCode:te="Backspace",selectionKeyCode:re="Shift",selectionOnDrag:ee=!1,selectionMode:se=yc.Full,panActivationKeyCode:ge="Space",multiSelectionKeyCode:ae=jc()?"Meta":"Control",zoomActivationKeyCode:ue=jc()?"Meta":"Control",snapToGrid:he,snapGrid:we,onlyRenderVisibleElements:Ne=!1,selectNodesOnDrag:Ce,nodesDraggable:Ae,autoPanOnNodeFocus:tt,nodesConnectable:$e,nodesFocusable:Rt,nodeOrigin:Tt=Q2,edgesFocusable:Be,edgesReconnectable:We,elementsSelectable:vt=!0,defaultViewport:bt=X6,minZoom:ft=.5,maxZoom:Q=2,translateExtent:H=bc,preventScrolling:O=!0,nodeExtent:Z,defaultMarkerColor:ie="#b1b1b7",zoomOnScroll:le=!0,zoomOnPinch:Ee=!0,panOnScroll:Re=!1,panOnScrollSpeed:Ue=.5,panOnScrollMode:yt=Qr.Free,zoomOnDoubleClick:Ct=!0,panOnDrag:J=!0,onPaneClick:ne,onPaneMouseEnter:xe,onPaneMouseMove:ce,onPaneMouseLeave:pe,onPaneScroll:I,onPaneContextMenu:F,paneClickDistance:fe=1,nodeClickDistance:ze=0,children:qe,onReconnect:Ke,onReconnectStart:Xe,onReconnectEnd:Kt,onEdgeContextMenu:Ms,onEdgeDoubleClick:dn,onEdgeMouseEnter:Jt,onEdgeMouseMove:wi,onEdgeMouseLeave:Cn,reconnectRadius:id=10,onNodesChange:el,onEdgesChange:tl,noDragClassName:kf="nodrag",noWheelClassName:Mf="nowheel",noPanClassName:Tr="nopan",fitView:nl,fitViewOptions:od,connectOnClick:ji,attributionPosition:Ni,proOptions:Si,defaultEdgeOptions:sl,elevateNodesOnSelect:ld,elevateEdgesOnSelect:Ta,disableKeyboardA11y:Ts=!1,autoPanOnConnect:Da,autoPanOnNodeDrag:Ci,autoPanSpeed:cd,connectionRadius:Tf,isValidConnection:_a,onError:Aa,style:al,id:dd,nodeDragThreshold:Df,connectionDragThreshold:A0,viewport:ud,onViewportChange:mt,width:hd,height:fd,colorMode:_f="light",debug:rl,onScroll:Dr,ariaLabelConfig:Af,...Of},md){const me=dd||"1",ve=K6(_f),be=m.useCallback(de=>{de.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Dr==null||Dr(de)},[Dr]);return a.jsx("div",{"data-testid":"rf__wrapper",...Of,onScroll:be,style:{...al,...bz},ref:md,className:Ht(["react-flow",r,ve]),id:dd,role:"application",children:a.jsxs(vz,{nodes:e,edges:t,width:hd,height:fd,fitView:nl,fitViewOptions:od,minZoom:ft,maxZoom:Q,nodeOrigin:Tt,nodeExtent:Z,children:[a.jsx(xz,{onInit:u,onNodeClick:l,onEdgeClick:c,onNodeMouseEnter:y,onNodeMouseMove:p,onNodeMouseLeave:w,onNodeContextMenu:N,onNodeDoubleClick:S,nodeTypes:i,edgeTypes:o,connectionLineType:R,connectionLineStyle:L,connectionLineComponent:X,connectionLineContainerStyle:G,selectionKeyCode:re,selectionOnDrag:ee,selectionMode:se,deleteKeyCode:te,multiSelectionKeyCode:ae,panActivationKeyCode:ge,zoomActivationKeyCode:ue,onlyRenderVisibleElements:Ne,defaultViewport:bt,translateExtent:H,minZoom:ft,maxZoom:Q,preventScrolling:O,zoomOnScroll:le,zoomOnPinch:Ee,zoomOnDoubleClick:Ct,panOnScroll:Re,panOnScrollSpeed:Ue,panOnScrollMode:yt,panOnDrag:J,onPaneClick:ne,onPaneMouseEnter:xe,onPaneMouseMove:ce,onPaneMouseLeave:pe,onPaneScroll:I,onPaneContextMenu:F,paneClickDistance:fe,nodeClickDistance:ze,onSelectionContextMenu:_,onSelectionStart:E,onSelectionEnd:D,onReconnect:Ke,onReconnectStart:Xe,onReconnectEnd:Kt,onEdgeContextMenu:Ms,onEdgeDoubleClick:dn,onEdgeMouseEnter:Jt,onEdgeMouseMove:wi,onEdgeMouseLeave:Cn,reconnectRadius:id,defaultMarkerColor:ie,noDragClassName:kf,noWheelClassName:Mf,noPanClassName:Tr,rfId:me,disableKeyboardA11y:Ts,nodeExtent:Z,viewport:ud,onViewportChange:mt}),a.jsx(Q6,{nodes:e,edges:t,defaultNodes:n,defaultEdges:s,onConnect:x,onConnectStart:b,onConnectEnd:v,onClickConnectStart:j,onClickConnectEnd:g,nodesDraggable:Ae,autoPanOnNodeFocus:tt,nodesConnectable:$e,nodesFocusable:Rt,edgesFocusable:Be,edgesReconnectable:We,elementsSelectable:vt,elevateNodesOnSelect:ld,elevateEdgesOnSelect:Ta,minZoom:ft,maxZoom:Q,nodeExtent:Z,onNodesChange:el,onEdgesChange:tl,snapToGrid:he,snapGrid:we,connectionMode:q,translateExtent:H,connectOnClick:ji,defaultEdgeOptions:sl,fitView:nl,fitViewOptions:od,onNodesDelete:B,onEdgesDelete:P,onDelete:z,onNodeDragStart:C,onNodeDrag:T,onNodeDragStop:U,onSelectionDrag:$,onSelectionDragStart:k,onSelectionDragStop:M,onMove:h,onMoveStart:d,onMoveEnd:f,noPanClassName:Tr,nodeOrigin:Tt,rfId:me,autoPanOnConnect:Da,autoPanOnNodeDrag:Ci,autoPanSpeed:cd,onError:Aa,connectionRadius:Tf,isValidConnection:_a,selectNodesOnDrag:Ce,nodeDragThreshold:Df,connectionDragThreshold:A0,onBeforeDelete:A,debug:rl,ariaLabelConfig:Af}),a.jsx(q6,{onSelectionChange:Y}),qe,a.jsx(V6,{proOptions:Si,position:Ni}),a.jsx(B6,{rfId:me,disableKeyboardA11y:Ts})]})})}var wz=tS(yz);function jz(e){const[t,n]=m.useState(e),s=m.useCallback(r=>n(i=>J2(r,i)),[]);return[t,n,s]}function Nz(e){const[t,n]=m.useState(e),s=m.useCallback(r=>n(i=>eS(r,i)),[]);return[t,n,s]}function Sz({dimensions:e,lineWidth:t,variant:n,className:s}){return a.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:Ht(["react-flow__background-pattern",n,s])})}function Cz({radius:e,className:t}){return a.jsx("circle",{cx:e,cy:e,r:e,className:Ht(["react-flow__background-pattern","dots",t])})}var ba;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(ba||(ba={}));const Ez={[ba.Dots]:1,[ba.Lines]:1,[ba.Cross]:6},kz=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function CS({id:e,variant:t=ba.Dots,gap:n=20,size:s,lineWidth:r=1,offset:i=0,color:o,bgColor:l,style:c,className:u,patternClassName:h}){const d=m.useRef(null),{transform:f,patternId:x}=Qe(kz,Mt),b=s||Ez[t],v=t===ba.Dots,j=t===ba.Cross,g=Array.isArray(n)?n:[n,n],y=[g[0]*f[2]||1,g[1]*f[2]||1],p=b*f[2],w=Array.isArray(i)?i:[i,i],N=j?[p,p]:y,S=[w[0]*f[2]||1+N[0]/2,w[1]*f[2]||1+N[1]/2],C=`${x}${e||""}`;return a.jsxs("svg",{className:Ht(["react-flow__background",u]),style:{...c,...rf,"--xy-background-color-props":l,"--xy-background-pattern-color-props":o},ref:d,"data-testid":"rf__background",children:[a.jsx("pattern",{id:C,x:f[0]%y[0],y:f[1]%y[1],width:y[0],height:y[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${S[0]},-${S[1]})`,children:v?a.jsx(Cz,{radius:p/2,className:h}):a.jsx(Sz,{dimensions:N,lineWidth:r,variant:t,className:h})}),a.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${C})`})]})}CS.displayName="Background";const Mz=m.memo(CS);function Tz(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:a.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function Dz(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:a.jsx("path",{d:"M0 0h32v4.2H0z"})})}function _z(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:a.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 Az(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:a.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 Oz(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:a.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 Ld({children:e,className:t,...n}){return a.jsx("button",{type:"button",className:Ht(["react-flow__controls-button",t]),...n,children:e})}const zz=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function ES({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:s=!0,fitViewOptions:r,onZoomIn:i,onZoomOut:o,onFitView:l,onInteractiveChange:c,className:u,children:h,position:d="bottom-left",orientation:f="vertical","aria-label":x}){const b=St(),{isInteractive:v,minZoomReached:j,maxZoomReached:g,ariaLabelConfig:y}=Qe(zz,Mt),{zoomIn:p,zoomOut:w,fitView:N}=Jp(),S=()=>{p(),i==null||i()},C=()=>{w(),o==null||o()},T=()=>{N(r),l==null||l()},U=()=>{b.setState({nodesDraggable:!v,nodesConnectable:!v,elementsSelectable:!v}),c==null||c(!v)},B=f==="horizontal"?"horizontal":"vertical";return a.jsxs(af,{className:Ht(["react-flow__controls",B,u]),position:d,style:e,"data-testid":"rf__controls","aria-label":x??y["controls.ariaLabel"],children:[t&&a.jsxs(a.Fragment,{children:[a.jsx(Ld,{onClick:S,className:"react-flow__controls-zoomin",title:y["controls.zoomIn.ariaLabel"],"aria-label":y["controls.zoomIn.ariaLabel"],disabled:g,children:a.jsx(Tz,{})}),a.jsx(Ld,{onClick:C,className:"react-flow__controls-zoomout",title:y["controls.zoomOut.ariaLabel"],"aria-label":y["controls.zoomOut.ariaLabel"],disabled:j,children:a.jsx(Dz,{})})]}),n&&a.jsx(Ld,{className:"react-flow__controls-fitview",onClick:T,title:y["controls.fitView.ariaLabel"],"aria-label":y["controls.fitView.ariaLabel"],children:a.jsx(_z,{})}),s&&a.jsx(Ld,{className:"react-flow__controls-interactive",onClick:U,title:y["controls.interactive.ariaLabel"],"aria-label":y["controls.interactive.ariaLabel"],children:v?a.jsx(Oz,{}):a.jsx(Az,{})}),h]})}ES.displayName="Controls";const Rz=m.memo(ES);function Uz({id:e,x:t,y:n,width:s,height:r,style:i,color:o,strokeColor:l,strokeWidth:c,className:u,borderRadius:h,shapeRendering:d,selected:f,onClick:x}){const{background:b,backgroundColor:v}=i||{},j=o||b||v;return a.jsx("rect",{className:Ht(["react-flow__minimap-node",{selected:f},u]),x:t,y:n,rx:h,ry:h,width:s,height:r,style:{fill:j,stroke:l,strokeWidth:c},shapeRendering:d,onClick:x?g=>x(g,e):void 0})}const $z=m.memo(Uz),Pz=e=>e.nodes.map(t=>t.id),Em=e=>e instanceof Function?e:()=>e;function Lz({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:s=5,nodeStrokeWidth:r,nodeComponent:i=$z,onClick:o}){const l=Qe(Pz,Mt),c=Em(t),u=Em(e),h=Em(n),d=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return a.jsx(a.Fragment,{children:l.map(f=>a.jsx(Bz,{id:f,nodeColorFunc:c,nodeStrokeColorFunc:u,nodeClassNameFunc:h,nodeBorderRadius:s,nodeStrokeWidth:r,NodeComponent:i,onClick:o,shapeRendering:d},f))})}function Hz({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:s,nodeBorderRadius:r,nodeStrokeWidth:i,shapeRendering:o,NodeComponent:l,onClick:c}){const{node:u,x:h,y:d,width:f,height:x}=Qe(b=>{const{internals:v}=b.nodeLookup.get(e),j=v.userNode,{x:g,y}=v.positionAbsolute,{width:p,height:w}=Ma(j);return{node:j,x:g,y,width:p,height:w}},Mt);return!u||u.hidden||!j2(u)?null:a.jsx(l,{x:h,y:d,width:f,height:x,style:u.style,selected:!!u.selected,className:s(u),color:t(u),borderRadius:r,strokeColor:n(u),strokeWidth:i,shapeRendering:o,onClick:c,id:u.id})}const Bz=m.memo(Hz);var Vz=m.memo(Lz);const Yz=200,Fz=150,Iz=e=>!e.hidden,Wz=e=>{const t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?w2(Zc(e.nodeLookup,{filter:Iz}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},qz="react-flow__minimap-desc";function kS({style:e,className:t,nodeStrokeColor:n,nodeColor:s,nodeClassName:r="",nodeBorderRadius:i=5,nodeStrokeWidth:o,nodeComponent:l,bgColor:c,maskColor:u,maskStrokeColor:h,maskStrokeWidth:d,position:f="bottom-right",onClick:x,onNodeClick:b,pannable:v=!1,zoomable:j=!1,ariaLabel:g,inversePan:y,zoomStep:p=1,offsetScale:w=5}){const N=St(),S=m.useRef(null),{boundingRect:C,viewBB:T,rfId:U,panZoom:B,translateExtent:P,flowWidth:z,flowHeight:Y,ariaLabelConfig:k}=Qe(Wz,Mt),$=(e==null?void 0:e.width)??Yz,M=(e==null?void 0:e.height)??Fz,_=C.width/$,E=C.height/M,D=Math.max(_,E),A=D*$,q=D*M,R=w*D,L=C.x-(A-C.width)/2-R,X=C.y-(q-C.height)/2-R,G=A+R*2,te=q+R*2,re=`${qz}-${U}`,ee=m.useRef(0),se=m.useRef();ee.current=D,m.useEffect(()=>{if(S.current&&B)return se.current=XA({domNode:S.current,panZoom:B,getTransform:()=>N.getState().transform,getViewScale:()=>ee.current}),()=>{var he;(he=se.current)==null||he.destroy()}},[B]),m.useEffect(()=>{var he;(he=se.current)==null||he.update({translateExtent:P,width:z,height:Y,inversePan:y,pannable:v,zoomStep:p,zoomable:j})},[v,j,y,p,P,z,Y]);const ge=x?he=>{var Ce;const[we,Ne]=((Ce=se.current)==null?void 0:Ce.pointer(he))||[0,0];x(he,{x:we,y:Ne})}:void 0,ae=b?m.useCallback((he,we)=>{const Ne=N.getState().nodeLookup.get(we).internals.userNode;b(he,Ne)},[]):void 0,ue=g??k["minimap.ariaLabel"];return a.jsx(af,{position:f,style:{...e,"--xy-minimap-background-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-stroke-color-props":typeof h=="string"?h:void 0,"--xy-minimap-mask-stroke-width-props":typeof d=="number"?d*D:void 0,"--xy-minimap-node-background-color-props":typeof s=="string"?s:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof o=="number"?o:void 0},className:Ht(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:a.jsxs("svg",{width:$,height:M,viewBox:`${L} ${X} ${G} ${te}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":re,ref:S,onClick:ge,children:[ue&&a.jsx("title",{id:re,children:ue}),a.jsx(Vz,{onClick:ae,nodeColor:s,nodeStrokeColor:n,nodeBorderRadius:i,nodeClassName:r,nodeStrokeWidth:o,nodeComponent:l}),a.jsx("path",{className:"react-flow__minimap-mask",d:`M${L-R},${X-R}h${G+R*2}v${te+R*2}h${-G-R*2}z
98
- M${T.x},${T.y}h${T.width}v${T.height}h${-T.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}kS.displayName="MiniMap";const Xz=m.memo(kS),Gz=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,Zz={[Oo.Line]:"right",[Oo.Handle]:"bottom-right"};function Qz({nodeId:e,position:t,variant:n=Oo.Handle,className:s,style:r=void 0,children:i,color:o,minWidth:l=10,minHeight:c=10,maxWidth:u=Number.MAX_VALUE,maxHeight:h=Number.MAX_VALUE,keepAspectRatio:d=!1,resizeDirection:f,autoScale:x=!0,shouldResize:b,onResizeStart:v,onResize:j,onResizeEnd:g}){const y=rS(),p=typeof e=="string"?e:y,w=St(),N=m.useRef(null),S=n===Oo.Handle,C=Qe(m.useCallback(Gz(S&&x),[S,x]),Mt),T=m.useRef(null),U=t??Zz[n];m.useEffect(()=>{if(!(!N.current||!p))return T.current||(T.current=l6({domNode:N.current,nodeId:p,getStoreItems:()=>{const{nodeLookup:P,transform:z,snapGrid:Y,snapToGrid:k,nodeOrigin:$,domNode:M}=w.getState();return{nodeLookup:P,transform:z,snapGrid:Y,snapToGrid:k,nodeOrigin:$,paneDomNode:M}},onChange:(P,z)=>{const{triggerNodeChanges:Y,nodeLookup:k,parentLookup:$,nodeOrigin:M}=w.getState(),_=[],E={x:P.x,y:P.y},D=k.get(p);if(D&&D.expandParent&&D.parentId){const A=D.origin??M,q=P.width??D.measured.width??0,R=P.height??D.measured.height??0,L={id:D.id,parentId:D.parentId,rect:{width:q,height:R,...N2({x:P.x??D.position.x,y:P.y??D.position.y},{width:q,height:R},D.parentId,k,A)}},X=Kp([L],k,$,M);_.push(...X),E.x=P.x?Math.max(A[0]*q,P.x):void 0,E.y=P.y?Math.max(A[1]*R,P.y):void 0}if(E.x!==void 0&&E.y!==void 0){const A={id:p,type:"position",position:{...E}};_.push(A)}if(P.width!==void 0&&P.height!==void 0){const q={id:p,type:"dimensions",resizing:!0,setAttributes:f?f==="horizontal"?"width":"height":!0,dimensions:{width:P.width,height:P.height}};_.push(q)}for(const A of z){const q={...A,type:"position"};_.push(q)}Y(_)},onEnd:({width:P,height:z})=>{const Y={id:p,type:"dimensions",resizing:!1,dimensions:{width:P,height:z}};w.getState().triggerNodeChanges([Y])}})),T.current.update({controlPosition:U,boundaries:{minWidth:l,minHeight:c,maxWidth:u,maxHeight:h},keepAspectRatio:d,resizeDirection:f,onResizeStart:v,onResize:j,onResizeEnd:g,shouldResize:b}),()=>{var P;(P=T.current)==null||P.destroy()}},[U,l,c,u,h,d,v,j,g,b]);const B=U.split("-");return a.jsx("div",{className:Ht(["react-flow__resize-control","nodrag",...B,n,s]),ref:N,style:{...r,scale:C,...o&&{[S?"backgroundColor":"borderColor"]:o}},children:i})}m.memo(Qz);/**
99
- * @license lucide-react v0.294.0 - ISC
100
- *
101
- * This source code is licensed under the ISC license.
102
- * See the LICENSE file in the root directory of this source tree.
103
- */var Kz={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"};/**
104
- * @license lucide-react v0.294.0 - ISC
105
- *
106
- * This source code is licensed under the ISC license.
107
- * See the LICENSE file in the root directory of this source tree.
108
- */const Jz=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim(),Me=(e,t)=>{const n=m.forwardRef(({color:s="currentColor",size:r=24,strokeWidth:i=2,absoluteStrokeWidth:o,className:l="",children:c,...u},h)=>m.createElement("svg",{ref:h,...Kz,width:r,height:r,stroke:s,strokeWidth:o?Number(i)*24/Number(r):i,className:["lucide",`lucide-${Jz(e)}`,l].join(" "),...u},[...t.map(([d,f])=>m.createElement(d,f)),...Array.isArray(c)?c:[c]]));return n.displayName=`${e}`,n};/**
109
- * @license lucide-react v0.294.0 - ISC
110
- *
111
- * This source code is licensed under the ISC license.
112
- * See the LICENSE file in the root directory of this source tree.
113
- */const As=Me("AlertTriangle",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z",key:"c3ski4"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
114
- * @license lucide-react v0.294.0 - ISC
115
- *
116
- * This source code is licensed under the ISC license.
117
- * See the LICENSE file in the root directory of this source tree.
118
- */const eR=Me("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
119
- * @license lucide-react v0.294.0 - ISC
120
- *
121
- * This source code is licensed under the ISC license.
122
- * See the LICENSE file in the root directory of this source tree.
123
- */const tR=Me("ArrowUpRight",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]);/**
124
- * @license lucide-react v0.294.0 - ISC
125
- *
126
- * This source code is licensed under the ISC license.
127
- * See the LICENSE file in the root directory of this source tree.
128
- */const Hd=Me("Ban",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.9 4.9 14.2 14.2",key:"1m5liu"}]]);/**
129
- * @license lucide-react v0.294.0 - ISC
130
- *
131
- * This source code is licensed under the ISC license.
132
- * See the LICENSE file in the root directory of this source tree.
133
- */const py=Me("BarChart3",[["path",{d:"M3 3v18h18",key:"1s2lah"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);/**
134
- * @license lucide-react v0.294.0 - ISC
135
- *
136
- * This source code is licensed under the ISC license.
137
- * See the LICENSE file in the root directory of this source tree.
138
- */const nR=Me("Bell",[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}]]);/**
139
- * @license lucide-react v0.294.0 - ISC
140
- *
141
- * This source code is licensed under the ISC license.
142
- * See the LICENSE file in the root directory of this source tree.
143
- */const Rs=Me("Building2",[["path",{d:"M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z",key:"1b4qmf"}],["path",{d:"M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2",key:"i71pzd"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2",key:"10jefs"}],["path",{d:"M10 6h4",key:"1itunk"}],["path",{d:"M10 10h4",key:"tcdvrf"}],["path",{d:"M10 14h4",key:"kelpxr"}],["path",{d:"M10 18h4",key:"1ulq68"}]]);/**
144
- * @license lucide-react v0.294.0 - ISC
145
- *
146
- * This source code is licensed under the ISC license.
147
- * See the LICENSE file in the root directory of this source tree.
148
- */const uh=Me("Calendar",[["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",ry:"2",key:"eu3xkr"}],["line",{x1:"16",x2:"16",y1:"2",y2:"6",key:"m3sa8f"}],["line",{x1:"8",x2:"8",y1:"2",y2:"6",key:"18kwsl"}],["line",{x1:"3",x2:"21",y1:"10",y2:"10",key:"xt86sb"}]]);/**
149
- * @license lucide-react v0.294.0 - ISC
150
- *
151
- * This source code is licensed under the ISC license.
152
- * See the LICENSE file in the root directory of this source tree.
153
- */const Bt=Me("CheckCircle",[["path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14",key:"g774vq"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
154
- * @license lucide-react v0.294.0 - ISC
155
- *
156
- * This source code is licensed under the ISC license.
157
- * See the LICENSE file in the root directory of this source tree.
158
- */const xg=Me("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
159
- * @license lucide-react v0.294.0 - ISC
160
- *
161
- * This source code is licensed under the ISC license.
162
- * See the LICENSE file in the root directory of this source tree.
163
- */const lf=Me("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
164
- * @license lucide-react v0.294.0 - ISC
165
- *
166
- * This source code is licensed under the ISC license.
167
- * See the LICENSE file in the root directory of this source tree.
168
- */const MS=Me("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
169
- * @license lucide-react v0.294.0 - ISC
170
- *
171
- * This source code is licensed under the ISC license.
172
- * See the LICENSE file in the root directory of this source tree.
173
- */const t0=Me("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
174
- * @license lucide-react v0.294.0 - ISC
175
- *
176
- * This source code is licensed under the ISC license.
177
- * See the LICENSE file in the root directory of this source tree.
178
- */const sR=Me("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
179
- * @license lucide-react v0.294.0 - ISC
180
- *
181
- * This source code is licensed under the ISC license.
182
- * See the LICENSE file in the root directory of this source tree.
183
- */const gg=Me("Clock1",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 14.5 8",key:"12zbmj"}]]);/**
184
- * @license lucide-react v0.294.0 - ISC
185
- *
186
- * This source code is licensed under the ISC license.
187
- * See the LICENSE file in the root directory of this source tree.
188
- */const Bd=Me("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
189
- * @license lucide-react v0.294.0 - ISC
190
- *
191
- * This source code is licensed under the ISC license.
192
- * See the LICENSE file in the root directory of this source tree.
193
- */const vy=Me("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);/**
194
- * @license lucide-react v0.294.0 - ISC
195
- *
196
- * This source code is licensed under the ISC license.
197
- * See the LICENSE file in the root directory of this source tree.
198
- */const by=Me("Copy",[["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"}]]);/**
199
- * @license lucide-react v0.294.0 - ISC
200
- *
201
- * This source code is licensed under the ISC license.
202
- * See the LICENSE file in the root directory of this source tree.
203
- */const _t=Me("Database",[["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"}]]);/**
204
- * @license lucide-react v0.294.0 - ISC
205
- *
206
- * This source code is licensed under the ISC license.
207
- * See the LICENSE file in the root directory of this source tree.
208
- */const TS=Me("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
209
- * @license lucide-react v0.294.0 - ISC
210
- *
211
- * This source code is licensed under the ISC license.
212
- * See the LICENSE file in the root directory of this source tree.
213
- */const DS=Me("EyeOff",[["path",{d:"M9.88 9.88a3 3 0 1 0 4.24 4.24",key:"1jxqfv"}],["path",{d:"M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68",key:"9wicm4"}],["path",{d:"M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61",key:"1jreej"}],["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}]]);/**
214
- * @license lucide-react v0.294.0 - ISC
215
- *
216
- * This source code is licensed under the ISC license.
217
- * See the LICENSE file in the root directory of this source tree.
218
- */const Go=Me("Eye",[["path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z",key:"rwhkz3"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
219
- * @license lucide-react v0.294.0 - ISC
220
- *
221
- * This source code is licensed under the ISC license.
222
- * See the LICENSE file in the root directory of this source tree.
223
- */const n0=Me("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/**
224
- * @license lucide-react v0.294.0 - ISC
225
- *
226
- * This source code is licensed under the ISC license.
227
- * See the LICENSE file in the root directory of this source tree.
228
- */const aR=Me("Fingerprint",[["path",{d:"M2 12C2 6.5 6.5 2 12 2a10 10 0 0 1 8 4",key:"1jc9o5"}],["path",{d:"M5 19.5C5.5 18 6 15 6 12c0-.7.12-1.37.34-2",key:"1mxgy1"}],["path",{d:"M17.29 21.02c.12-.6.43-2.3.5-3.02",key:"ptglia"}],["path",{d:"M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4",key:"1nerag"}],["path",{d:"M8.65 22c.21-.66.45-1.32.57-2",key:"13wd9y"}],["path",{d:"M14 13.12c0 2.38 0 6.38-1 8.88",key:"o46ks0"}],["path",{d:"M2 16h.01",key:"1gqxmh"}],["path",{d:"M21.8 16c.2-2 .131-5.354 0-6",key:"drycrb"}],["path",{d:"M9 6.8a6 6 0 0 1 9 5.2c0 .47 0 1.17-.02 2",key:"1fgabc"}]]);/**
229
- * @license lucide-react v0.294.0 - ISC
230
- *
231
- * This source code is licensed under the ISC license.
232
- * See the LICENSE file in the root directory of this source tree.
233
- */const rR=Me("Github",[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]);/**
234
- * @license lucide-react v0.294.0 - ISC
235
- *
236
- * This source code is licensed under the ISC license.
237
- * See the LICENSE file in the root directory of this source tree.
238
- */const an=Me("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/**
239
- * @license lucide-react v0.294.0 - ISC
240
- *
241
- * This source code is licensed under the ISC license.
242
- * See the LICENSE file in the root directory of this source tree.
243
- */const iR=Me("Hash",[["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"}]]);/**
244
- * @license lucide-react v0.294.0 - ISC
245
- *
246
- * This source code is licensed under the ISC license.
247
- * See the LICENSE file in the root directory of this source tree.
248
- */const Vd=Me("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
249
- * @license lucide-react v0.294.0 - ISC
250
- *
251
- * This source code is licensed under the ISC license.
252
- * See the LICENSE file in the root directory of this source tree.
253
- */const uo=Me("Key",[["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["path",{d:"m15.5 7.5 3 3L22 7l-3-3",key:"1rn1fs"}]]);/**
254
- * @license lucide-react v0.294.0 - ISC
255
- *
256
- * This source code is licensed under the ISC license.
257
- * See the LICENSE file in the root directory of this source tree.
258
- */const oR=Me("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);/**
259
- * @license lucide-react v0.294.0 - ISC
260
- *
261
- * This source code is licensed under the ISC license.
262
- * See the LICENSE file in the root directory of this source tree.
263
- */const km=Me("Link2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);/**
264
- * @license lucide-react v0.294.0 - ISC
265
- *
266
- * This source code is licensed under the ISC license.
267
- * See the LICENSE file in the root directory of this source tree.
268
- */const ys=Me("Loader",[["line",{x1:"12",x2:"12",y1:"2",y2:"6",key:"gza1u7"}],["line",{x1:"12",x2:"12",y1:"18",y2:"22",key:"1qhbu9"}],["line",{x1:"4.93",x2:"7.76",y1:"4.93",y2:"7.76",key:"xae44r"}],["line",{x1:"16.24",x2:"19.07",y1:"16.24",y2:"19.07",key:"bxnmvf"}],["line",{x1:"2",x2:"6",y1:"12",y2:"12",key:"89khin"}],["line",{x1:"18",x2:"22",y1:"12",y2:"12",key:"pb8tfm"}],["line",{x1:"4.93",x2:"7.76",y1:"19.07",y2:"16.24",key:"1uxjnu"}],["line",{x1:"16.24",x2:"19.07",y1:"7.76",y2:"4.93",key:"6duxfx"}]]);/**
269
- * @license lucide-react v0.294.0 - ISC
270
- *
271
- * This source code is licensed under the ISC license.
272
- * See the LICENSE file in the root directory of this source tree.
273
- */const gu=Me("Lock",[["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"}]]);/**
274
- * @license lucide-react v0.294.0 - ISC
275
- *
276
- * This source code is licensed under the ISC license.
277
- * See the LICENSE file in the root directory of this source tree.
278
- */const hh=Me("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]);/**
279
- * @license lucide-react v0.294.0 - ISC
280
- *
281
- * This source code is licensed under the ISC license.
282
- * See the LICENSE file in the root directory of this source tree.
283
- */const lR=Me("MoreHorizontal",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);/**
284
- * @license lucide-react v0.294.0 - ISC
285
- *
286
- * This source code is licensed under the ISC license.
287
- * See the LICENSE file in the root directory of this source tree.
288
- */const _S=Me("MoreVertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]]);/**
289
- * @license lucide-react v0.294.0 - ISC
290
- *
291
- * This source code is licensed under the ISC license.
292
- * See the LICENSE file in the root directory of this source tree.
293
- */const oi=Me("PenSquare",[["path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1qinfi"}],["path",{d:"M18.5 2.5a2.12 2.12 0 0 1 3 3L12 15l-4 1 1-4Z",key:"w2jsv5"}]]);/**
294
- * @license lucide-react v0.294.0 - ISC
295
- *
296
- * This source code is licensed under the ISC license.
297
- * See the LICENSE file in the root directory of this source tree.
298
- */const mr=Me("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
299
- * @license lucide-react v0.294.0 - ISC
300
- *
301
- * This source code is licensed under the ISC license.
302
- * See the LICENSE file in the root directory of this source tree.
303
- */const yy=Me("Puzzle",[["path",{d:"M19.439 7.85c-.049.322.059.648.289.878l1.568 1.568c.47.47.706 1.087.706 1.704s-.235 1.233-.706 1.704l-1.611 1.611a.98.98 0 0 1-.837.276c-.47-.07-.802-.48-.968-.925a2.501 2.501 0 1 0-3.214 3.214c.446.166.855.497.925.968a.979.979 0 0 1-.276.837l-1.61 1.61a2.404 2.404 0 0 1-1.705.707 2.402 2.402 0 0 1-1.704-.706l-1.568-1.568a1.026 1.026 0 0 0-.877-.29c-.493.074-.84.504-1.02.968a2.5 2.5 0 1 1-3.237-3.237c.464-.18.894-.527.967-1.02a1.026 1.026 0 0 0-.289-.877l-1.568-1.568A2.402 2.402 0 0 1 1.998 12c0-.617.236-1.234.706-1.704L4.23 8.77c.24-.24.581-.353.917-.303.515.077.877.528 1.073 1.01a2.5 2.5 0 1 0 3.259-3.259c-.482-.196-.933-.558-1.01-1.073-.05-.336.062-.676.303-.917l1.525-1.525A2.402 2.402 0 0 1 12 1.998c.617 0 1.234.236 1.704.706l1.568 1.568c.23.23.556.338.877.29.493-.074.84-.504 1.02-.968a2.5 2.5 0 1 1 3.237 3.237c-.464.18-.894.527-.967 1.02Z",key:"i0oyt7"}]]);/**
304
- * @license lucide-react v0.294.0 - ISC
305
- *
306
- * This source code is licensed under the ISC license.
307
- * See the LICENSE file in the root directory of this source tree.
308
- */const pg=Me("RefreshCw",[["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"}]]);/**
309
- * @license lucide-react v0.294.0 - ISC
310
- *
311
- * This source code is licensed under the ISC license.
312
- * See the LICENSE file in the root directory of this source tree.
313
- */const li=Me("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
314
- * @license lucide-react v0.294.0 - ISC
315
- *
316
- * This source code is licensed under the ISC license.
317
- * See the LICENSE file in the root directory of this source tree.
318
- */const cR=Me("Send",[["path",{d:"m22 2-7 20-4-9-9-4Z",key:"1q3vgg"}],["path",{d:"M22 2 11 13",key:"nzbqef"}]]);/**
319
- * @license lucide-react v0.294.0 - ISC
320
- *
321
- * This source code is licensed under the ISC license.
322
- * See the LICENSE file in the root directory of this source tree.
323
- */const ho=Me("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
324
- * @license lucide-react v0.294.0 - ISC
325
- *
326
- * This source code is licensed under the ISC license.
327
- * See the LICENSE file in the root directory of this source tree.
328
- */const wn=Me("Shield",[["path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10",key:"1irkt0"}]]);/**
329
- * @license lucide-react v0.294.0 - ISC
330
- *
331
- * This source code is licensed under the ISC license.
332
- * See the LICENSE file in the root directory of this source tree.
333
- */const dR=Me("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/**
334
- * @license lucide-react v0.294.0 - ISC
335
- *
336
- * This source code is licensed under the ISC license.
337
- * See the LICENSE file in the root directory of this source tree.
338
- */const wy=Me("TestTube",[["path",{d:"M14.5 2v17.5c0 1.4-1.1 2.5-2.5 2.5h0c-1.4 0-2.5-1.1-2.5-2.5V2",key:"187lwq"}],["path",{d:"M8.5 2h7",key:"csnxdl"}],["path",{d:"M14.5 16h-5",key:"1ox875"}]]);/**
339
- * @license lucide-react v0.294.0 - ISC
340
- *
341
- * This source code is licensed under the ISC license.
342
- * See the LICENSE file in the root directory of this source tree.
343
- */const cf=Me("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
344
- * @license lucide-react v0.294.0 - ISC
345
- *
346
- * This source code is licensed under the ISC license.
347
- * See the LICENSE file in the root directory of this source tree.
348
- */const uR=Me("Trash",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}]]);/**
349
- * @license lucide-react v0.294.0 - ISC
350
- *
351
- * This source code is licensed under the ISC license.
352
- * See the LICENSE file in the root directory of this source tree.
353
- */const vg=Me("UserPlus",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]]);/**
354
- * @license lucide-react v0.294.0 - ISC
355
- *
356
- * This source code is licensed under the ISC license.
357
- * See the LICENSE file in the root directory of this source tree.
358
- */const jy=Me("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/**
359
- * @license lucide-react v0.294.0 - ISC
360
- *
361
- * This source code is licensed under the ISC license.
362
- * See the LICENSE file in the root directory of this source tree.
363
- */const ci=Me("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/**
364
- * @license lucide-react v0.294.0 - ISC
365
- *
366
- * This source code is licensed under the ISC license.
367
- * See the LICENSE file in the root directory of this source tree.
368
- */const AS=Me("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/**
369
- * @license lucide-react v0.294.0 - ISC
370
- *
371
- * This source code is licensed under the ISC license.
372
- * See the LICENSE file in the root directory of this source tree.
373
- */const Hr=Me("XCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
374
- * @license lucide-react v0.294.0 - ISC
375
- *
376
- * This source code is licensed under the ISC license.
377
- * See the LICENSE file in the root directory of this source tree.
378
- */const Xt=Me("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
379
- * @license lucide-react v0.294.0 - ISC
380
- *
381
- * This source code is licensed under the ISC license.
382
- * See the LICENSE file in the root directory of this source tree.
383
- */const Mm=Me("Zap",[["polygon",{points:"13 2 3 14 12 14 11 22 21 10 12 10 13 2",key:"45s27k"}]]);function OS(e){var t,n,s="";if(typeof e=="string"||typeof e=="number")s+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(n=OS(e[t]))&&(s&&(s+=" "),s+=n)}else for(n in e)e[n]&&(s&&(s+=" "),s+=n);return s}function fh(){for(var e,t,n=0,s="",r=arguments.length;n<r;n++)(e=arguments[n])&&(t=OS(e))&&(s&&(s+=" "),s+=t);return s}const s0="-",hR=e=>{const t=mR(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:s}=e;return{getClassGroupId:o=>{const l=o.split(s0);return l[0]===""&&l.length!==1&&l.shift(),zS(l,t)||fR(o)},getConflictingClassGroupIds:(o,l)=>{const c=n[o]||[];return l&&s[o]?[...c,...s[o]]:c}}},zS=(e,t)=>{var o;if(e.length===0)return t.classGroupId;const n=e[0],s=t.nextPart.get(n),r=s?zS(e.slice(1),s):void 0;if(r)return r;if(t.validators.length===0)return;const i=e.join(s0);return(o=t.validators.find(({validator:l})=>l(i)))==null?void 0:o.classGroupId},Ny=/^\[(.+)\]$/,fR=e=>{if(Ny.test(e)){const t=Ny.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},mR=e=>{const{theme:t,prefix:n}=e,s={nextPart:new Map,validators:[]};return gR(Object.entries(e.classGroups),n).forEach(([i,o])=>{bg(o,s,i,t)}),s},bg=(e,t,n,s)=>{e.forEach(r=>{if(typeof r=="string"){const i=r===""?t:Sy(t,r);i.classGroupId=n;return}if(typeof r=="function"){if(xR(r)){bg(r(s),t,n,s);return}t.validators.push({validator:r,classGroupId:n});return}Object.entries(r).forEach(([i,o])=>{bg(o,Sy(t,i),n,s)})})},Sy=(e,t)=>{let n=e;return t.split(s0).forEach(s=>{n.nextPart.has(s)||n.nextPart.set(s,{nextPart:new Map,validators:[]}),n=n.nextPart.get(s)}),n},xR=e=>e.isThemeGetter,gR=(e,t)=>t?e.map(([n,s])=>{const r=s.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([o,l])=>[t+o,l])):i);return[n,r]}):e,pR=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,s=new Map;const r=(i,o)=>{n.set(i,o),t++,t>e&&(t=0,s=n,n=new Map)};return{get(i){let o=n.get(i);if(o!==void 0)return o;if((o=s.get(i))!==void 0)return r(i,o),o},set(i,o){n.has(i)?n.set(i,o):r(i,o)}}},RS="!",vR=e=>{const{separator:t,experimentalParseClassName:n}=e,s=t.length===1,r=t[0],i=t.length,o=l=>{const c=[];let u=0,h=0,d;for(let j=0;j<l.length;j++){let g=l[j];if(u===0){if(g===r&&(s||l.slice(j,j+i)===t)){c.push(l.slice(h,j)),h=j+i;continue}if(g==="/"){d=j;continue}}g==="["?u++:g==="]"&&u--}const f=c.length===0?l:l.substring(h),x=f.startsWith(RS),b=x?f.substring(1):f,v=d&&d>h?d-h:void 0;return{modifiers:c,hasImportantModifier:x,baseClassName:b,maybePostfixModifierPosition:v}};return n?l=>n({className:l,parseClassName:o}):o},bR=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(s=>{s[0]==="["?(t.push(...n.sort(),s),n=[]):n.push(s)}),t.push(...n.sort()),t},yR=e=>({cache:pR(e.cacheSize),parseClassName:vR(e),...hR(e)}),wR=/\s+/,jR=(e,t)=>{const{parseClassName:n,getClassGroupId:s,getConflictingClassGroupIds:r}=t,i=[],o=e.trim().split(wR);let l="";for(let c=o.length-1;c>=0;c-=1){const u=o[c],{modifiers:h,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:x}=n(u);let b=!!x,v=s(b?f.substring(0,x):f);if(!v){if(!b){l=u+(l.length>0?" "+l:l);continue}if(v=s(f),!v){l=u+(l.length>0?" "+l:l);continue}b=!1}const j=bR(h).join(":"),g=d?j+RS:j,y=g+v;if(i.includes(y))continue;i.push(y);const p=r(v,b);for(let w=0;w<p.length;++w){const N=p[w];i.push(g+N)}l=u+(l.length>0?" "+l:l)}return l};function NR(){let e=0,t,n,s="";for(;e<arguments.length;)(t=arguments[e++])&&(n=US(t))&&(s&&(s+=" "),s+=n);return s}const US=e=>{if(typeof e=="string")return e;let t,n="";for(let s=0;s<e.length;s++)e[s]&&(t=US(e[s]))&&(n&&(n+=" "),n+=t);return n};function SR(e,...t){let n,s,r,i=o;function o(c){const u=t.reduce((h,d)=>d(h),e());return n=yR(u),s=n.cache.get,r=n.cache.set,i=l,l(c)}function l(c){const u=s(c);if(u)return u;const h=jR(c,n);return r(c,h),h}return function(){return i(NR.apply(null,arguments))}}const xt=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},$S=/^\[(?:([a-z-]+):)?(.+)\]$/i,CR=/^\d+\/\d+$/,ER=new Set(["px","full","screen"]),kR=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,MR=/\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$/,TR=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,DR=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,_R=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ra=e=>fo(e)||ER.has(e)||CR.test(e),Pa=e=>Zo(e,"length",LR),fo=e=>!!e&&!Number.isNaN(Number(e)),Tm=e=>Zo(e,"number",fo),pl=e=>!!e&&Number.isInteger(Number(e)),AR=e=>e.endsWith("%")&&fo(e.slice(0,-1)),He=e=>$S.test(e),La=e=>kR.test(e),OR=new Set(["length","size","percentage"]),zR=e=>Zo(e,OR,PS),RR=e=>Zo(e,"position",PS),UR=new Set(["image","url"]),$R=e=>Zo(e,UR,BR),PR=e=>Zo(e,"",HR),vl=()=>!0,Zo=(e,t,n)=>{const s=$S.exec(e);return s?s[1]?typeof t=="string"?s[1]===t:t.has(s[1]):n(s[2]):!1},LR=e=>MR.test(e)&&!TR.test(e),PS=()=>!1,HR=e=>DR.test(e),BR=e=>_R.test(e),VR=()=>{const e=xt("colors"),t=xt("spacing"),n=xt("blur"),s=xt("brightness"),r=xt("borderColor"),i=xt("borderRadius"),o=xt("borderSpacing"),l=xt("borderWidth"),c=xt("contrast"),u=xt("grayscale"),h=xt("hueRotate"),d=xt("invert"),f=xt("gap"),x=xt("gradientColorStops"),b=xt("gradientColorStopPositions"),v=xt("inset"),j=xt("margin"),g=xt("opacity"),y=xt("padding"),p=xt("saturate"),w=xt("scale"),N=xt("sepia"),S=xt("skew"),C=xt("space"),T=xt("translate"),U=()=>["auto","contain","none"],B=()=>["auto","hidden","clip","visible","scroll"],P=()=>["auto",He,t],z=()=>[He,t],Y=()=>["",ra,Pa],k=()=>["auto",fo,He],$=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],M=()=>["solid","dashed","dotted","double","none"],_=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],E=()=>["start","end","center","between","around","evenly","stretch"],D=()=>["","0",He],A=()=>["auto","avoid","all","avoid-page","page","left","right","column"],q=()=>[fo,He];return{cacheSize:500,separator:":",theme:{colors:[vl],spacing:[ra,Pa],blur:["none","",La,He],brightness:q(),borderColor:[e],borderRadius:["none","","full",La,He],borderSpacing:z(),borderWidth:Y(),contrast:q(),grayscale:D(),hueRotate:q(),invert:D(),gap:z(),gradientColorStops:[e],gradientColorStopPositions:[AR,Pa],inset:P(),margin:P(),opacity:q(),padding:z(),saturate:q(),scale:q(),sepia:D(),skew:q(),space:z(),translate:z()},classGroups:{aspect:[{aspect:["auto","square","video",He]}],container:["container"],columns:[{columns:[La]}],"break-after":[{"break-after":A()}],"break-before":[{"break-before":A()}],"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"],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:[...$(),He]}],overflow:[{overflow:B()}],"overflow-x":[{"overflow-x":B()}],"overflow-y":[{"overflow-y":B()}],overscroll:[{overscroll:U()}],"overscroll-x":[{"overscroll-x":U()}],"overscroll-y":[{"overscroll-y":U()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[v]}],"inset-x":[{"inset-x":[v]}],"inset-y":[{"inset-y":[v]}],start:[{start:[v]}],end:[{end:[v]}],top:[{top:[v]}],right:[{right:[v]}],bottom:[{bottom:[v]}],left:[{left:[v]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",pl,He]}],basis:[{basis:P()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",He]}],grow:[{grow:D()}],shrink:[{shrink:D()}],order:[{order:["first","last","none",pl,He]}],"grid-cols":[{"grid-cols":[vl]}],"col-start-end":[{col:["auto",{span:["full",pl,He]},He]}],"col-start":[{"col-start":k()}],"col-end":[{"col-end":k()}],"grid-rows":[{"grid-rows":[vl]}],"row-start-end":[{row:["auto",{span:[pl,He]},He]}],"row-start":[{"row-start":k()}],"row-end":[{"row-end":k()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",He]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",He]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...E()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...E(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...E(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[y]}],px:[{px:[y]}],py:[{py:[y]}],ps:[{ps:[y]}],pe:[{pe:[y]}],pt:[{pt:[y]}],pr:[{pr:[y]}],pb:[{pb:[y]}],pl:[{pl:[y]}],m:[{m:[j]}],mx:[{mx:[j]}],my:[{my:[j]}],ms:[{ms:[j]}],me:[{me:[j]}],mt:[{mt:[j]}],mr:[{mr:[j]}],mb:[{mb:[j]}],ml:[{ml:[j]}],"space-x":[{"space-x":[C]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[C]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",He,t]}],"min-w":[{"min-w":[He,t,"min","max","fit"]}],"max-w":[{"max-w":[He,t,"none","full","min","max","fit","prose",{screen:[La]},La]}],h:[{h:[He,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[He,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[He,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[He,t,"auto","min","max","fit"]}],"font-size":[{text:["base",La,Pa]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Tm]}],"font-family":[{font:[vl]}],"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:["tighter","tight","normal","wide","wider","widest",He]}],"line-clamp":[{"line-clamp":["none",fo,Tm]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ra,He]}],"list-image":[{"list-image":["none",He]}],"list-style-type":[{list:["none","disc","decimal",He]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[g]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[g]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...M(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",ra,Pa]}],"underline-offset":[{"underline-offset":["auto",ra,He]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:z()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",He]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",He]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[g]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...$(),RR]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",zR]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},$R]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[b]}],"gradient-via-pos":[{via:[b]}],"gradient-to-pos":[{to:[b]}],"gradient-from":[{from:[x]}],"gradient-via":[{via:[x]}],"gradient-to":[{to:[x]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[l]}],"border-w-x":[{"border-x":[l]}],"border-w-y":[{"border-y":[l]}],"border-w-s":[{"border-s":[l]}],"border-w-e":[{"border-e":[l]}],"border-w-t":[{"border-t":[l]}],"border-w-r":[{"border-r":[l]}],"border-w-b":[{"border-b":[l]}],"border-w-l":[{"border-l":[l]}],"border-opacity":[{"border-opacity":[g]}],"border-style":[{border:[...M(),"hidden"]}],"divide-x":[{"divide-x":[l]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[l]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[g]}],"divide-style":[{divide:M()}],"border-color":[{border:[r]}],"border-color-x":[{"border-x":[r]}],"border-color-y":[{"border-y":[r]}],"border-color-s":[{"border-s":[r]}],"border-color-e":[{"border-e":[r]}],"border-color-t":[{"border-t":[r]}],"border-color-r":[{"border-r":[r]}],"border-color-b":[{"border-b":[r]}],"border-color-l":[{"border-l":[r]}],"divide-color":[{divide:[r]}],"outline-style":[{outline:["",...M()]}],"outline-offset":[{"outline-offset":[ra,He]}],"outline-w":[{outline:[ra,Pa]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:Y()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[g]}],"ring-offset-w":[{"ring-offset":[ra,Pa]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",La,PR]}],"shadow-color":[{shadow:[vl]}],opacity:[{opacity:[g]}],"mix-blend":[{"mix-blend":[..._(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":_()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[s]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",La,He]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[h]}],invert:[{invert:[d]}],saturate:[{saturate:[p]}],sepia:[{sepia:[N]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[s]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[h]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[g]}],"backdrop-saturate":[{"backdrop-saturate":[p]}],"backdrop-sepia":[{"backdrop-sepia":[N]}],"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:["none","all","","colors","opacity","shadow","transform",He]}],duration:[{duration:q()}],ease:[{ease:["linear","in","out","in-out",He]}],delay:[{delay:q()}],animate:[{animate:["none","spin","ping","pulse","bounce",He]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[w]}],"scale-x":[{"scale-x":[w]}],"scale-y":[{"scale-y":[w]}],rotate:[{rotate:[pl,He]}],"translate-x":[{"translate-x":[T]}],"translate-y":[{"translate-y":[T]}],"skew-x":[{"skew-x":[S]}],"skew-y":[{"skew-y":[S]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",He]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],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]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":z()}],"scroll-mx":[{"scroll-mx":z()}],"scroll-my":[{"scroll-my":z()}],"scroll-ms":[{"scroll-ms":z()}],"scroll-me":[{"scroll-me":z()}],"scroll-mt":[{"scroll-mt":z()}],"scroll-mr":[{"scroll-mr":z()}],"scroll-mb":[{"scroll-mb":z()}],"scroll-ml":[{"scroll-ml":z()}],"scroll-p":[{"scroll-p":z()}],"scroll-px":[{"scroll-px":z()}],"scroll-py":[{"scroll-py":z()}],"scroll-ps":[{"scroll-ps":z()}],"scroll-pe":[{"scroll-pe":z()}],"scroll-pt":[{"scroll-pt":z()}],"scroll-pr":[{"scroll-pr":z()}],"scroll-pb":[{"scroll-pb":z()}],"scroll-pl":[{"scroll-pl":z()}],"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]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[ra,Pa,Tm]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"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-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-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"],"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"]}}},YR=SR(VR);function _e(...e){return YR(fh(e))}function Ft(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e==null||e(r),n===!1||!r.defaultPrevented)return t==null?void 0:t(r)}}function Cy(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function br(...e){return t=>{let n=!1;const s=e.map(r=>{const i=Cy(r,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let r=0;r<s.length;r++){const i=s[r];typeof i=="function"?i():Cy(e[r],null)}}}}function Xn(...e){return m.useCallback(br(...e),e)}function FR(e,t){const n=m.createContext(t),s=i=>{const{children:o,...l}=i,c=m.useMemo(()=>l,Object.values(l));return a.jsx(n.Provider,{value:c,children:o})};s.displayName=e+"Provider";function r(i){const o=m.useContext(n);if(o)return o;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[s,r]}function df(e,t=[]){let n=[];function s(i,o){const l=m.createContext(o),c=n.length;n=[...n,o];const u=d=>{var g;const{scope:f,children:x,...b}=d,v=((g=f==null?void 0:f[e])==null?void 0:g[c])||l,j=m.useMemo(()=>b,Object.values(b));return a.jsx(v.Provider,{value:j,children:x})};u.displayName=i+"Provider";function h(d,f){var v;const x=((v=f==null?void 0:f[e])==null?void 0:v[c])||l,b=m.useContext(x);if(b)return b;if(o!==void 0)return o;throw new Error(`\`${d}\` must be used within \`${i}\``)}return[u,h]}const r=()=>{const i=n.map(o=>m.createContext(o));return function(l){const c=(l==null?void 0:l[e])||i;return m.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return r.scopeName=e,[s,IR(r,...t)]}function IR(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const s=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(i){const o=s.reduce((l,{useScope:c,scopeName:u})=>{const d=c(i)[`__scope${u}`];return{...l,...d}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}function a0(e){const t=WR(e),n=m.forwardRef((s,r)=>{const{children:i,...o}=s,l=m.Children.toArray(i),c=l.find(XR);if(c){const u=c.props.children,h=l.map(d=>d===c?m.Children.count(u)>1?m.Children.only(null):m.isValidElement(u)?u.props.children:null:d);return a.jsx(t,{...o,ref:r,children:m.isValidElement(u)?m.cloneElement(u,void 0,h):null})}return a.jsx(t,{...o,ref:r,children:i})});return n.displayName=`${e}.Slot`,n}function WR(e){const t=m.forwardRef((n,s)=>{const{children:r,...i}=n;if(m.isValidElement(r)){const o=ZR(r),l=GR(i,r.props);return r.type!==m.Fragment&&(l.ref=s?br(s,o):o),m.cloneElement(r,l)}return m.Children.count(r)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var LS=Symbol("radix.slottable");function qR(e){const t=({children:n})=>a.jsx(a.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=LS,t}function XR(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===LS}function GR(e,t){const n={...t};for(const s in t){const r=e[s],i=t[s];/^on[A-Z]/.test(s)?r&&i?n[s]=(...l)=>{const c=i(...l);return r(...l),c}:r&&(n[s]=r):s==="style"?n[s]={...r,...i}:s==="className"&&(n[s]=[r,i].filter(Boolean).join(" "))}return{...e,...n}}function ZR(e){var s,r;let t=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var QR=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],cn=QR.reduce((e,t)=>{const n=a0(`Primitive.${t}`),s=m.forwardRef((r,i)=>{const{asChild:o,...l}=r,c=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(c,{...l,ref:i})});return s.displayName=`Primitive.${t}`,{...e,[t]:s}},{});function KR(e,t){e&&_h.flushSync(()=>e.dispatchEvent(t))}function Ro(e){const t=m.useRef(e);return m.useEffect(()=>{t.current=e}),m.useMemo(()=>(...n)=>{var s;return(s=t.current)==null?void 0:s.call(t,...n)},[])}function JR(e,t=globalThis==null?void 0:globalThis.document){const n=Ro(e);m.useEffect(()=>{const s=r=>{r.key==="Escape"&&n(r)};return t.addEventListener("keydown",s,{capture:!0}),()=>t.removeEventListener("keydown",s,{capture:!0})},[n,t])}var e8="DismissableLayer",yg="dismissableLayer.update",t8="dismissableLayer.pointerDownOutside",n8="dismissableLayer.focusOutside",Ey,HS=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),uf=m.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:s,onPointerDownOutside:r,onFocusOutside:i,onInteractOutside:o,onDismiss:l,...c}=e,u=m.useContext(HS),[h,d]=m.useState(null),f=(h==null?void 0:h.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,x]=m.useState({}),b=Xn(t,C=>d(C)),v=Array.from(u.layers),[j]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),g=v.indexOf(j),y=h?v.indexOf(h):-1,p=u.layersWithOutsidePointerEventsDisabled.size>0,w=y>=g,N=r8(C=>{const T=C.target,U=[...u.branches].some(B=>B.contains(T));!w||U||(r==null||r(C),o==null||o(C),C.defaultPrevented||l==null||l())},f),S=i8(C=>{const T=C.target;[...u.branches].some(B=>B.contains(T))||(i==null||i(C),o==null||o(C),C.defaultPrevented||l==null||l())},f);return JR(C=>{y===u.layers.size-1&&(s==null||s(C),!C.defaultPrevented&&l&&(C.preventDefault(),l()))},f),m.useEffect(()=>{if(h)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Ey=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(h)),u.layers.add(h),ky(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=Ey)}},[h,f,n,u]),m.useEffect(()=>()=>{h&&(u.layers.delete(h),u.layersWithOutsidePointerEventsDisabled.delete(h),ky())},[h,u]),m.useEffect(()=>{const C=()=>x({});return document.addEventListener(yg,C),()=>document.removeEventListener(yg,C)},[]),a.jsx(cn.div,{...c,ref:b,style:{pointerEvents:p?w?"auto":"none":void 0,...e.style},onFocusCapture:Ft(e.onFocusCapture,S.onFocusCapture),onBlurCapture:Ft(e.onBlurCapture,S.onBlurCapture),onPointerDownCapture:Ft(e.onPointerDownCapture,N.onPointerDownCapture)})});uf.displayName=e8;var s8="DismissableLayerBranch",a8=m.forwardRef((e,t)=>{const n=m.useContext(HS),s=m.useRef(null),r=Xn(t,s);return m.useEffect(()=>{const i=s.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),a.jsx(cn.div,{...e,ref:r})});a8.displayName=s8;function r8(e,t=globalThis==null?void 0:globalThis.document){const n=Ro(e),s=m.useRef(!1),r=m.useRef(()=>{});return m.useEffect(()=>{const i=l=>{if(l.target&&!s.current){let c=function(){BS(t8,n,u,{discrete:!0})};const u={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",r.current),r.current=c,t.addEventListener("click",r.current,{once:!0})):c()}else t.removeEventListener("click",r.current);s.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",i),t.removeEventListener("click",r.current)}},[t,n]),{onPointerDownCapture:()=>s.current=!0}}function i8(e,t=globalThis==null?void 0:globalThis.document){const n=Ro(e),s=m.useRef(!1);return m.useEffect(()=>{const r=i=>{i.target&&!s.current&&BS(n8,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,n]),{onFocusCapture:()=>s.current=!0,onBlurCapture:()=>s.current=!1}}function ky(){const e=new CustomEvent(yg);document.dispatchEvent(e)}function BS(e,t,n,{discrete:s}){const r=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),s?KR(r,i):r.dispatchEvent(i)}var yr=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},o8=Mh[" useId ".trim().toString()]||(()=>{}),l8=0;function ws(e){const[t,n]=m.useState(o8());return yr(()=>{n(s=>s??String(l8++))},[e]),e||(t?`radix-${t}`:"")}const c8=["top","right","bottom","left"],wr=Math.min,Rn=Math.max,mh=Math.round,Yd=Math.floor,Ws=e=>({x:e,y:e}),d8={left:"right",right:"left",bottom:"top",top:"bottom"},u8={start:"end",end:"start"};function wg(e,t,n){return Rn(e,wr(t,n))}function Ca(e,t){return typeof e=="function"?e(t):e}function Ea(e){return e.split("-")[0]}function Qo(e){return e.split("-")[1]}function r0(e){return e==="x"?"y":"x"}function i0(e){return e==="y"?"height":"width"}const h8=new Set(["top","bottom"]);function Hs(e){return h8.has(Ea(e))?"y":"x"}function o0(e){return r0(Hs(e))}function f8(e,t,n){n===void 0&&(n=!1);const s=Qo(e),r=o0(e),i=i0(r);let o=r==="x"?s===(n?"end":"start")?"right":"left":s==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(o=xh(o)),[o,xh(o)]}function m8(e){const t=xh(e);return[jg(e),t,jg(t)]}function jg(e){return e.replace(/start|end/g,t=>u8[t])}const My=["left","right"],Ty=["right","left"],x8=["top","bottom"],g8=["bottom","top"];function p8(e,t,n){switch(e){case"top":case"bottom":return n?t?Ty:My:t?My:Ty;case"left":case"right":return t?x8:g8;default:return[]}}function v8(e,t,n,s){const r=Qo(e);let i=p8(Ea(e),n==="start",s);return r&&(i=i.map(o=>o+"-"+r),t&&(i=i.concat(i.map(jg)))),i}function xh(e){return e.replace(/left|right|bottom|top/g,t=>d8[t])}function b8(e){return{top:0,right:0,bottom:0,left:0,...e}}function VS(e){return typeof e!="number"?b8(e):{top:e,right:e,bottom:e,left:e}}function gh(e){const{x:t,y:n,width:s,height:r}=e;return{width:s,height:r,top:n,left:t,right:t+s,bottom:n+r,x:t,y:n}}function Dy(e,t,n){let{reference:s,floating:r}=e;const i=Hs(t),o=o0(t),l=i0(o),c=Ea(t),u=i==="y",h=s.x+s.width/2-r.width/2,d=s.y+s.height/2-r.height/2,f=s[l]/2-r[l]/2;let x;switch(c){case"top":x={x:h,y:s.y-r.height};break;case"bottom":x={x:h,y:s.y+s.height};break;case"right":x={x:s.x+s.width,y:d};break;case"left":x={x:s.x-r.width,y:d};break;default:x={x:s.x,y:s.y}}switch(Qo(t)){case"start":x[o]-=f*(n&&u?-1:1);break;case"end":x[o]+=f*(n&&u?-1:1);break}return x}const y8=async(e,t,n)=>{const{placement:s="bottom",strategy:r="absolute",middleware:i=[],platform:o}=n,l=i.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(t));let u=await o.getElementRects({reference:e,floating:t,strategy:r}),{x:h,y:d}=Dy(u,s,c),f=s,x={},b=0;for(let v=0;v<l.length;v++){const{name:j,fn:g}=l[v],{x:y,y:p,data:w,reset:N}=await g({x:h,y:d,initialPlacement:s,placement:f,strategy:r,middlewareData:x,rects:u,platform:o,elements:{reference:e,floating:t}});h=y??h,d=p??d,x={...x,[j]:{...x[j],...w}},N&&b<=50&&(b++,typeof N=="object"&&(N.placement&&(f=N.placement),N.rects&&(u=N.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:r}):N.rects),{x:h,y:d}=Dy(u,f,c)),v=-1)}return{x:h,y:d,placement:f,strategy:r,middlewareData:x}};async function Cc(e,t){var n;t===void 0&&(t={});const{x:s,y:r,platform:i,rects:o,elements:l,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:h="viewport",elementContext:d="floating",altBoundary:f=!1,padding:x=0}=Ca(t,e),b=VS(x),j=l[f?d==="floating"?"reference":"floating":d],g=gh(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(j)))==null||n?j:j.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:u,rootBoundary:h,strategy:c})),y=d==="floating"?{x:s,y:r,width:o.floating.width,height:o.floating.height}:o.reference,p=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),w=await(i.isElement==null?void 0:i.isElement(p))?await(i.getScale==null?void 0:i.getScale(p))||{x:1,y:1}:{x:1,y:1},N=gh(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:y,offsetParent:p,strategy:c}):y);return{top:(g.top-N.top+b.top)/w.y,bottom:(N.bottom-g.bottom+b.bottom)/w.y,left:(g.left-N.left+b.left)/w.x,right:(N.right-g.right+b.right)/w.x}}const w8=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:s,placement:r,rects:i,platform:o,elements:l,middlewareData:c}=t,{element:u,padding:h=0}=Ca(e,t)||{};if(u==null)return{};const d=VS(h),f={x:n,y:s},x=o0(r),b=i0(x),v=await o.getDimensions(u),j=x==="y",g=j?"top":"left",y=j?"bottom":"right",p=j?"clientHeight":"clientWidth",w=i.reference[b]+i.reference[x]-f[x]-i.floating[b],N=f[x]-i.reference[x],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let C=S?S[p]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=l.floating[p]||i.floating[b]);const T=w/2-N/2,U=C/2-v[b]/2-1,B=wr(d[g],U),P=wr(d[y],U),z=B,Y=C-v[b]-P,k=C/2-v[b]/2+T,$=wg(z,k,Y),M=!c.arrow&&Qo(r)!=null&&k!==$&&i.reference[b]/2-(k<z?B:P)-v[b]/2<0,_=M?k<z?k-z:k-Y:0;return{[x]:f[x]+_,data:{[x]:$,centerOffset:k-$-_,...M&&{alignmentOffset:_}},reset:M}}}),j8=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,s;const{placement:r,middlewareData:i,rects:o,initialPlacement:l,platform:c,elements:u}=t,{mainAxis:h=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:x="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:v=!0,...j}=Ca(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const g=Ea(r),y=Hs(l),p=Ea(l)===l,w=await(c.isRTL==null?void 0:c.isRTL(u.floating)),N=f||(p||!v?[xh(l)]:m8(l)),S=b!=="none";!f&&S&&N.push(...v8(l,v,b,w));const C=[l,...N],T=await Cc(t,j),U=[];let B=((s=i.flip)==null?void 0:s.overflows)||[];if(h&&U.push(T[g]),d){const k=f8(r,o,w);U.push(T[k[0]],T[k[1]])}if(B=[...B,{placement:r,overflows:U}],!U.every(k=>k<=0)){var P,z;const k=(((P=i.flip)==null?void 0:P.index)||0)+1,$=C[k];if($&&(!(d==="alignment"?y!==Hs($):!1)||B.every(E=>Hs(E.placement)===y?E.overflows[0]>0:!0)))return{data:{index:k,overflows:B},reset:{placement:$}};let M=(z=B.filter(_=>_.overflows[0]<=0).sort((_,E)=>_.overflows[1]-E.overflows[1])[0])==null?void 0:z.placement;if(!M)switch(x){case"bestFit":{var Y;const _=(Y=B.filter(E=>{if(S){const D=Hs(E.placement);return D===y||D==="y"}return!0}).map(E=>[E.placement,E.overflows.filter(D=>D>0).reduce((D,A)=>D+A,0)]).sort((E,D)=>E[1]-D[1])[0])==null?void 0:Y[0];_&&(M=_);break}case"initialPlacement":M=l;break}if(r!==M)return{reset:{placement:M}}}return{}}}};function _y(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Ay(e){return c8.some(t=>e[t]>=0)}const N8=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:s="referenceHidden",...r}=Ca(e,t);switch(s){case"referenceHidden":{const i=await Cc(t,{...r,elementContext:"reference"}),o=_y(i,n.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:Ay(o)}}}case"escaped":{const i=await Cc(t,{...r,altBoundary:!0}),o=_y(i,n.floating);return{data:{escapedOffsets:o,escaped:Ay(o)}}}default:return{}}}}},YS=new Set(["left","top"]);async function S8(e,t){const{placement:n,platform:s,elements:r}=e,i=await(s.isRTL==null?void 0:s.isRTL(r.floating)),o=Ea(n),l=Qo(n),c=Hs(n)==="y",u=YS.has(o)?-1:1,h=i&&c?-1:1,d=Ca(t,e);let{mainAxis:f,crossAxis:x,alignmentAxis:b}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return l&&typeof b=="number"&&(x=l==="end"?b*-1:b),c?{x:x*h,y:f*u}:{x:f*u,y:x*h}}const C8=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,s;const{x:r,y:i,placement:o,middlewareData:l}=t,c=await S8(t,e);return o===((n=l.offset)==null?void 0:n.placement)&&(s=l.arrow)!=null&&s.alignmentOffset?{}:{x:r+c.x,y:i+c.y,data:{...c,placement:o}}}}},E8=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:s,placement:r}=t,{mainAxis:i=!0,crossAxis:o=!1,limiter:l={fn:j=>{let{x:g,y}=j;return{x:g,y}}},...c}=Ca(e,t),u={x:n,y:s},h=await Cc(t,c),d=Hs(Ea(r)),f=r0(d);let x=u[f],b=u[d];if(i){const j=f==="y"?"top":"left",g=f==="y"?"bottom":"right",y=x+h[j],p=x-h[g];x=wg(y,x,p)}if(o){const j=d==="y"?"top":"left",g=d==="y"?"bottom":"right",y=b+h[j],p=b-h[g];b=wg(y,b,p)}const v=l.fn({...t,[f]:x,[d]:b});return{...v,data:{x:v.x-n,y:v.y-s,enabled:{[f]:i,[d]:o}}}}}},k8=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:s,placement:r,rects:i,middlewareData:o}=t,{offset:l=0,mainAxis:c=!0,crossAxis:u=!0}=Ca(e,t),h={x:n,y:s},d=Hs(r),f=r0(d);let x=h[f],b=h[d];const v=Ca(l,t),j=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(c){const p=f==="y"?"height":"width",w=i.reference[f]-i.floating[p]+j.mainAxis,N=i.reference[f]+i.reference[p]-j.mainAxis;x<w?x=w:x>N&&(x=N)}if(u){var g,y;const p=f==="y"?"width":"height",w=YS.has(Ea(r)),N=i.reference[d]-i.floating[p]+(w&&((g=o.offset)==null?void 0:g[d])||0)+(w?0:j.crossAxis),S=i.reference[d]+i.reference[p]+(w?0:((y=o.offset)==null?void 0:y[d])||0)-(w?j.crossAxis:0);b<N?b=N:b>S&&(b=S)}return{[f]:x,[d]:b}}}},M8=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,s;const{placement:r,rects:i,platform:o,elements:l}=t,{apply:c=()=>{},...u}=Ca(e,t),h=await Cc(t,u),d=Ea(r),f=Qo(r),x=Hs(r)==="y",{width:b,height:v}=i.floating;let j,g;d==="top"||d==="bottom"?(j=d,g=f===(await(o.isRTL==null?void 0:o.isRTL(l.floating))?"start":"end")?"left":"right"):(g=d,j=f==="end"?"top":"bottom");const y=v-h.top-h.bottom,p=b-h.left-h.right,w=wr(v-h[j],y),N=wr(b-h[g],p),S=!t.middlewareData.shift;let C=w,T=N;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(T=p),(s=t.middlewareData.shift)!=null&&s.enabled.y&&(C=y),S&&!f){const B=Rn(h.left,0),P=Rn(h.right,0),z=Rn(h.top,0),Y=Rn(h.bottom,0);x?T=b-2*(B!==0||P!==0?B+P:Rn(h.left,h.right)):C=v-2*(z!==0||Y!==0?z+Y:Rn(h.top,h.bottom))}await c({...t,availableWidth:T,availableHeight:C});const U=await o.getDimensions(l.floating);return b!==U.width||v!==U.height?{reset:{rects:!0}}:{}}}};function hf(){return typeof window<"u"}function Ko(e){return FS(e)?(e.nodeName||"").toLowerCase():"#document"}function Fn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ks(e){var t;return(t=(FS(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function FS(e){return hf()?e instanceof Node||e instanceof Fn(e).Node:!1}function js(e){return hf()?e instanceof Element||e instanceof Fn(e).Element:!1}function Xs(e){return hf()?e instanceof HTMLElement||e instanceof Fn(e).HTMLElement:!1}function Oy(e){return!hf()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Fn(e).ShadowRoot}const T8=new Set(["inline","contents"]);function Jc(e){const{overflow:t,overflowX:n,overflowY:s,display:r}=Ns(e);return/auto|scroll|overlay|hidden|clip/.test(t+s+n)&&!T8.has(r)}const D8=new Set(["table","td","th"]);function _8(e){return D8.has(Ko(e))}const A8=[":popover-open",":modal"];function ff(e){return A8.some(t=>{try{return e.matches(t)}catch{return!1}})}const O8=["transform","translate","scale","rotate","perspective"],z8=["transform","translate","scale","rotate","perspective","filter"],R8=["paint","layout","strict","content"];function l0(e){const t=c0(),n=js(e)?Ns(e):e;return O8.some(s=>n[s]?n[s]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||z8.some(s=>(n.willChange||"").includes(s))||R8.some(s=>(n.contain||"").includes(s))}function U8(e){let t=jr(e);for(;Xs(t)&&!Uo(t);){if(l0(t))return t;if(ff(t))return null;t=jr(t)}return null}function c0(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const $8=new Set(["html","body","#document"]);function Uo(e){return $8.has(Ko(e))}function Ns(e){return Fn(e).getComputedStyle(e)}function mf(e){return js(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function jr(e){if(Ko(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Oy(e)&&e.host||Ks(e);return Oy(t)?t.host:t}function IS(e){const t=jr(e);return Uo(t)?e.ownerDocument?e.ownerDocument.body:e.body:Xs(t)&&Jc(t)?t:IS(t)}function Ec(e,t,n){var s;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=IS(e),i=r===((s=e.ownerDocument)==null?void 0:s.body),o=Fn(r);if(i){const l=Ng(o);return t.concat(o,o.visualViewport||[],Jc(r)?r:[],l&&n?Ec(l):[])}return t.concat(r,Ec(r,[],n))}function Ng(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function WS(e){const t=Ns(e);let n=parseFloat(t.width)||0,s=parseFloat(t.height)||0;const r=Xs(e),i=r?e.offsetWidth:n,o=r?e.offsetHeight:s,l=mh(n)!==i||mh(s)!==o;return l&&(n=i,s=o),{width:n,height:s,$:l}}function d0(e){return js(e)?e:e.contextElement}function mo(e){const t=d0(e);if(!Xs(t))return Ws(1);const n=t.getBoundingClientRect(),{width:s,height:r,$:i}=WS(t);let o=(i?mh(n.width):n.width)/s,l=(i?mh(n.height):n.height)/r;return(!o||!Number.isFinite(o))&&(o=1),(!l||!Number.isFinite(l))&&(l=1),{x:o,y:l}}const P8=Ws(0);function qS(e){const t=Fn(e);return!c0()||!t.visualViewport?P8:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function L8(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Fn(e)?!1:t}function di(e,t,n,s){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),i=d0(e);let o=Ws(1);t&&(s?js(s)&&(o=mo(s)):o=mo(e));const l=L8(i,n,s)?qS(i):Ws(0);let c=(r.left+l.x)/o.x,u=(r.top+l.y)/o.y,h=r.width/o.x,d=r.height/o.y;if(i){const f=Fn(i),x=s&&js(s)?Fn(s):s;let b=f,v=Ng(b);for(;v&&s&&x!==b;){const j=mo(v),g=v.getBoundingClientRect(),y=Ns(v),p=g.left+(v.clientLeft+parseFloat(y.paddingLeft))*j.x,w=g.top+(v.clientTop+parseFloat(y.paddingTop))*j.y;c*=j.x,u*=j.y,h*=j.x,d*=j.y,c+=p,u+=w,b=Fn(v),v=Ng(b)}}return gh({width:h,height:d,x:c,y:u})}function xf(e,t){const n=mf(e).scrollLeft;return t?t.left+n:di(Ks(e)).left+n}function XS(e,t){const n=e.getBoundingClientRect(),s=n.left+t.scrollLeft-xf(e,n),r=n.top+t.scrollTop;return{x:s,y:r}}function H8(e){let{elements:t,rect:n,offsetParent:s,strategy:r}=e;const i=r==="fixed",o=Ks(s),l=t?ff(t.floating):!1;if(s===o||l&&i)return n;let c={scrollLeft:0,scrollTop:0},u=Ws(1);const h=Ws(0),d=Xs(s);if((d||!d&&!i)&&((Ko(s)!=="body"||Jc(o))&&(c=mf(s)),Xs(s))){const x=di(s);u=mo(s),h.x=x.x+s.clientLeft,h.y=x.y+s.clientTop}const f=o&&!d&&!i?XS(o,c):Ws(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-c.scrollLeft*u.x+h.x+f.x,y:n.y*u.y-c.scrollTop*u.y+h.y+f.y}}function B8(e){return Array.from(e.getClientRects())}function V8(e){const t=Ks(e),n=mf(e),s=e.ownerDocument.body,r=Rn(t.scrollWidth,t.clientWidth,s.scrollWidth,s.clientWidth),i=Rn(t.scrollHeight,t.clientHeight,s.scrollHeight,s.clientHeight);let o=-n.scrollLeft+xf(e);const l=-n.scrollTop;return Ns(s).direction==="rtl"&&(o+=Rn(t.clientWidth,s.clientWidth)-r),{width:r,height:i,x:o,y:l}}const zy=25;function Y8(e,t){const n=Fn(e),s=Ks(e),r=n.visualViewport;let i=s.clientWidth,o=s.clientHeight,l=0,c=0;if(r){i=r.width,o=r.height;const h=c0();(!h||h&&t==="fixed")&&(l=r.offsetLeft,c=r.offsetTop)}const u=xf(s);if(u<=0){const h=s.ownerDocument,d=h.body,f=getComputedStyle(d),x=h.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,b=Math.abs(s.clientWidth-d.clientWidth-x);b<=zy&&(i-=b)}else u<=zy&&(i+=u);return{width:i,height:o,x:l,y:c}}const F8=new Set(["absolute","fixed"]);function I8(e,t){const n=di(e,!0,t==="fixed"),s=n.top+e.clientTop,r=n.left+e.clientLeft,i=Xs(e)?mo(e):Ws(1),o=e.clientWidth*i.x,l=e.clientHeight*i.y,c=r*i.x,u=s*i.y;return{width:o,height:l,x:c,y:u}}function Ry(e,t,n){let s;if(t==="viewport")s=Y8(e,n);else if(t==="document")s=V8(Ks(e));else if(js(t))s=I8(t,n);else{const r=qS(e);s={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return gh(s)}function GS(e,t){const n=jr(e);return n===t||!js(n)||Uo(n)?!1:Ns(n).position==="fixed"||GS(n,t)}function W8(e,t){const n=t.get(e);if(n)return n;let s=Ec(e,[],!1).filter(l=>js(l)&&Ko(l)!=="body"),r=null;const i=Ns(e).position==="fixed";let o=i?jr(e):e;for(;js(o)&&!Uo(o);){const l=Ns(o),c=l0(o);!c&&l.position==="fixed"&&(r=null),(i?!c&&!r:!c&&l.position==="static"&&!!r&&F8.has(r.position)||Jc(o)&&!c&&GS(e,o))?s=s.filter(h=>h!==o):r=l,o=jr(o)}return t.set(e,s),s}function q8(e){let{element:t,boundary:n,rootBoundary:s,strategy:r}=e;const o=[...n==="clippingAncestors"?ff(t)?[]:W8(t,this._c):[].concat(n),s],l=o[0],c=o.reduce((u,h)=>{const d=Ry(t,h,r);return u.top=Rn(d.top,u.top),u.right=wr(d.right,u.right),u.bottom=wr(d.bottom,u.bottom),u.left=Rn(d.left,u.left),u},Ry(t,l,r));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function X8(e){const{width:t,height:n}=WS(e);return{width:t,height:n}}function G8(e,t,n){const s=Xs(t),r=Ks(t),i=n==="fixed",o=di(e,!0,i,t);let l={scrollLeft:0,scrollTop:0};const c=Ws(0);function u(){c.x=xf(r)}if(s||!s&&!i)if((Ko(t)!=="body"||Jc(r))&&(l=mf(t)),s){const x=di(t,!0,i,t);c.x=x.x+t.clientLeft,c.y=x.y+t.clientTop}else r&&u();i&&!s&&r&&u();const h=r&&!s&&!i?XS(r,l):Ws(0),d=o.left+l.scrollLeft-c.x-h.x,f=o.top+l.scrollTop-c.y-h.y;return{x:d,y:f,width:o.width,height:o.height}}function Dm(e){return Ns(e).position==="static"}function Uy(e,t){if(!Xs(e)||Ns(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Ks(e)===n&&(n=n.ownerDocument.body),n}function ZS(e,t){const n=Fn(e);if(ff(e))return n;if(!Xs(e)){let r=jr(e);for(;r&&!Uo(r);){if(js(r)&&!Dm(r))return r;r=jr(r)}return n}let s=Uy(e,t);for(;s&&_8(s)&&Dm(s);)s=Uy(s,t);return s&&Uo(s)&&Dm(s)&&!l0(s)?n:s||U8(e)||n}const Z8=async function(e){const t=this.getOffsetParent||ZS,n=this.getDimensions,s=await n(e.floating);return{reference:G8(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function Q8(e){return Ns(e).direction==="rtl"}const K8={convertOffsetParentRelativeRectToViewportRelativeRect:H8,getDocumentElement:Ks,getClippingRect:q8,getOffsetParent:ZS,getElementRects:Z8,getClientRects:B8,getDimensions:X8,getScale:mo,isElement:js,isRTL:Q8};function QS(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function J8(e,t){let n=null,s;const r=Ks(e);function i(){var l;clearTimeout(s),(l=n)==null||l.disconnect(),n=null}function o(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),i();const u=e.getBoundingClientRect(),{left:h,top:d,width:f,height:x}=u;if(l||t(),!f||!x)return;const b=Yd(d),v=Yd(r.clientWidth-(h+f)),j=Yd(r.clientHeight-(d+x)),g=Yd(h),p={rootMargin:-b+"px "+-v+"px "+-j+"px "+-g+"px",threshold:Rn(0,wr(1,c))||1};let w=!0;function N(S){const C=S[0].intersectionRatio;if(C!==c){if(!w)return o();C?o(!1,C):s=setTimeout(()=>{o(!1,1e-7)},1e3)}C===1&&!QS(u,e.getBoundingClientRect())&&o(),w=!1}try{n=new IntersectionObserver(N,{...p,root:r.ownerDocument})}catch{n=new IntersectionObserver(N,p)}n.observe(e)}return o(!0),i}function e9(e,t,n,s){s===void 0&&(s={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=s,u=d0(e),h=r||i?[...u?Ec(u):[],...Ec(t)]:[];h.forEach(g=>{r&&g.addEventListener("scroll",n,{passive:!0}),i&&g.addEventListener("resize",n)});const d=u&&l?J8(u,n):null;let f=-1,x=null;o&&(x=new ResizeObserver(g=>{let[y]=g;y&&y.target===u&&x&&(x.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var p;(p=x)==null||p.observe(t)})),n()}),u&&!c&&x.observe(u),x.observe(t));let b,v=c?di(e):null;c&&j();function j(){const g=di(e);v&&!QS(v,g)&&n(),v=g,b=requestAnimationFrame(j)}return n(),()=>{var g;h.forEach(y=>{r&&y.removeEventListener("scroll",n),i&&y.removeEventListener("resize",n)}),d==null||d(),(g=x)==null||g.disconnect(),x=null,c&&cancelAnimationFrame(b)}}const t9=C8,n9=E8,s9=j8,a9=M8,r9=N8,$y=w8,i9=k8,o9=(e,t,n)=>{const s=new Map,r={platform:K8,...n},i={...r.platform,_c:s};return y8(e,t,{...r,platform:i})};var l9=typeof document<"u",c9=function(){},pu=l9?m.useLayoutEffect:c9;function ph(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,s,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(s=n;s--!==0;)if(!ph(e[s],t[s]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(s=n;s--!==0;)if(!{}.hasOwnProperty.call(t,r[s]))return!1;for(s=n;s--!==0;){const i=r[s];if(!(i==="_owner"&&e.$$typeof)&&!ph(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function KS(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Py(e,t){const n=KS(e);return Math.round(t*n)/n}function _m(e){const t=m.useRef(e);return pu(()=>{t.current=e}),t}function d9(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:s=[],platform:r,elements:{reference:i,floating:o}={},transform:l=!0,whileElementsMounted:c,open:u}=e,[h,d]=m.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,x]=m.useState(s);ph(f,s)||x(s);const[b,v]=m.useState(null),[j,g]=m.useState(null),y=m.useCallback(E=>{E!==S.current&&(S.current=E,v(E))},[]),p=m.useCallback(E=>{E!==C.current&&(C.current=E,g(E))},[]),w=i||b,N=o||j,S=m.useRef(null),C=m.useRef(null),T=m.useRef(h),U=c!=null,B=_m(c),P=_m(r),z=_m(u),Y=m.useCallback(()=>{if(!S.current||!C.current)return;const E={placement:t,strategy:n,middleware:f};P.current&&(E.platform=P.current),o9(S.current,C.current,E).then(D=>{const A={...D,isPositioned:z.current!==!1};k.current&&!ph(T.current,A)&&(T.current=A,_h.flushSync(()=>{d(A)}))})},[f,t,n,P,z]);pu(()=>{u===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(E=>({...E,isPositioned:!1})))},[u]);const k=m.useRef(!1);pu(()=>(k.current=!0,()=>{k.current=!1}),[]),pu(()=>{if(w&&(S.current=w),N&&(C.current=N),w&&N){if(B.current)return B.current(w,N,Y);Y()}},[w,N,Y,B,U]);const $=m.useMemo(()=>({reference:S,floating:C,setReference:y,setFloating:p}),[y,p]),M=m.useMemo(()=>({reference:w,floating:N}),[w,N]),_=m.useMemo(()=>{const E={position:n,left:0,top:0};if(!M.floating)return E;const D=Py(M.floating,h.x),A=Py(M.floating,h.y);return l?{...E,transform:"translate("+D+"px, "+A+"px)",...KS(M.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:D,top:A}},[n,l,M.floating,h.x,h.y]);return m.useMemo(()=>({...h,update:Y,refs:$,elements:M,floatingStyles:_}),[h,Y,$,M,_])}const u9=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:s,padding:r}=typeof e=="function"?e(n):e;return s&&t(s)?s.current!=null?$y({element:s.current,padding:r}).fn(n):{}:s?$y({element:s,padding:r}).fn(n):{}}}},h9=(e,t)=>({...t9(e),options:[e,t]}),f9=(e,t)=>({...n9(e),options:[e,t]}),m9=(e,t)=>({...i9(e),options:[e,t]}),x9=(e,t)=>({...s9(e),options:[e,t]}),g9=(e,t)=>({...a9(e),options:[e,t]}),p9=(e,t)=>({...r9(e),options:[e,t]}),v9=(e,t)=>({...u9(e),options:[e,t]});var b9="Arrow",JS=m.forwardRef((e,t)=>{const{children:n,width:s=10,height:r=5,...i}=e;return a.jsx(cn.svg,{...i,ref:t,width:s,height:r,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:a.jsx("polygon",{points:"0,0 30,0 15,10"})})});JS.displayName=b9;var y9=JS;function w9(e){const[t,n]=m.useState(void 0);return yr(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const s=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;const i=r[0];let o,l;if("borderBoxSize"in i){const c=i.borderBoxSize,u=Array.isArray(c)?c[0]:c;o=u.inlineSize,l=u.blockSize}else o=e.offsetWidth,l=e.offsetHeight;n({width:o,height:l})});return s.observe(e,{box:"border-box"}),()=>s.unobserve(e)}else n(void 0)},[e]),t}var u0="Popper",[e4,gf]=df(u0),[j9,t4]=e4(u0),n4=e=>{const{__scopePopper:t,children:n}=e,[s,r]=m.useState(null);return a.jsx(j9,{scope:t,anchor:s,onAnchorChange:r,children:n})};n4.displayName=u0;var s4="PopperAnchor",a4=m.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:s,...r}=e,i=t4(s4,n),o=m.useRef(null),l=Xn(t,o),c=m.useRef(null);return m.useEffect(()=>{const u=c.current;c.current=(s==null?void 0:s.current)||o.current,u!==c.current&&i.onAnchorChange(c.current)}),s?null:a.jsx(cn.div,{...r,ref:l})});a4.displayName=s4;var h0="PopperContent",[N9,S9]=e4(h0),r4=m.forwardRef((e,t)=>{var re,ee,se,ge,ae,ue;const{__scopePopper:n,side:s="bottom",sideOffset:r=0,align:i="center",alignOffset:o=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:h=0,sticky:d="partial",hideWhenDetached:f=!1,updatePositionStrategy:x="optimized",onPlaced:b,...v}=e,j=t4(h0,n),[g,y]=m.useState(null),p=Xn(t,he=>y(he)),[w,N]=m.useState(null),S=w9(w),C=(S==null?void 0:S.width)??0,T=(S==null?void 0:S.height)??0,U=s+(i!=="center"?"-"+i:""),B=typeof h=="number"?h:{top:0,right:0,bottom:0,left:0,...h},P=Array.isArray(u)?u:[u],z=P.length>0,Y={padding:B,boundary:P.filter(E9),altBoundary:z},{refs:k,floatingStyles:$,placement:M,isPositioned:_,middlewareData:E}=d9({strategy:"fixed",placement:U,whileElementsMounted:(...he)=>e9(...he,{animationFrame:x==="always"}),elements:{reference:j.anchor},middleware:[h9({mainAxis:r+T,alignmentAxis:o}),c&&f9({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?m9():void 0,...Y}),c&&x9({...Y}),g9({...Y,apply:({elements:he,rects:we,availableWidth:Ne,availableHeight:Ce})=>{const{width:Ae,height:tt}=we.reference,$e=he.floating.style;$e.setProperty("--radix-popper-available-width",`${Ne}px`),$e.setProperty("--radix-popper-available-height",`${Ce}px`),$e.setProperty("--radix-popper-anchor-width",`${Ae}px`),$e.setProperty("--radix-popper-anchor-height",`${tt}px`)}}),w&&v9({element:w,padding:l}),k9({arrowWidth:C,arrowHeight:T}),f&&p9({strategy:"referenceHidden",...Y})]}),[D,A]=l4(M),q=Ro(b);yr(()=>{_&&(q==null||q())},[_,q]);const R=(re=E.arrow)==null?void 0:re.x,L=(ee=E.arrow)==null?void 0:ee.y,X=((se=E.arrow)==null?void 0:se.centerOffset)!==0,[G,te]=m.useState();return yr(()=>{g&&te(window.getComputedStyle(g).zIndex)},[g]),a.jsx("div",{ref:k.setFloating,"data-radix-popper-content-wrapper":"",style:{...$,transform:_?$.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:G,"--radix-popper-transform-origin":[(ge=E.transformOrigin)==null?void 0:ge.x,(ae=E.transformOrigin)==null?void 0:ae.y].join(" "),...((ue=E.hide)==null?void 0:ue.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:a.jsx(N9,{scope:n,placedSide:D,onArrowChange:N,arrowX:R,arrowY:L,shouldHideArrow:X,children:a.jsx(cn.div,{"data-side":D,"data-align":A,...v,ref:p,style:{...v.style,animation:_?void 0:"none"}})})})});r4.displayName=h0;var i4="PopperArrow",C9={top:"bottom",right:"left",bottom:"top",left:"right"},o4=m.forwardRef(function(t,n){const{__scopePopper:s,...r}=t,i=S9(i4,s),o=C9[i.placedSide];return a.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[o]: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:a.jsx(y9,{...r,ref:n,style:{...r.style,display:"block"}})})});o4.displayName=i4;function E9(e){return e!==null}var k9=e=>({name:"transformOrigin",options:e,fn(t){var j,g,y;const{placement:n,rects:s,middlewareData:r}=t,o=((j=r.arrow)==null?void 0:j.centerOffset)!==0,l=o?0:e.arrowWidth,c=o?0:e.arrowHeight,[u,h]=l4(n),d={start:"0%",center:"50%",end:"100%"}[h],f=(((g=r.arrow)==null?void 0:g.x)??0)+l/2,x=(((y=r.arrow)==null?void 0:y.y)??0)+c/2;let b="",v="";return u==="bottom"?(b=o?d:`${f}px`,v=`${-c}px`):u==="top"?(b=o?d:`${f}px`,v=`${s.floating.height+c}px`):u==="right"?(b=`${-c}px`,v=o?d:`${x}px`):u==="left"&&(b=`${s.floating.width+c}px`,v=o?d:`${x}px`),{data:{x:b,y:v}}}});function l4(e){const[t,n="center"]=e.split("-");return[t,n]}var c4=n4,f0=a4,d4=r4,u4=o4,M9="Portal",m0=m.forwardRef((e,t)=>{var l;const{container:n,...s}=e,[r,i]=m.useState(!1);yr(()=>i(!0),[]);const o=n||r&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return o?Fw.createPortal(a.jsx(cn.div,{...s,ref:t}),o):null});m0.displayName=M9;function T9(e,t){return m.useReducer((n,s)=>t[n][s]??n,e)}var yi=e=>{const{present:t,children:n}=e,s=D9(t),r=typeof n=="function"?n({present:s.isPresent}):m.Children.only(n),i=Xn(s.ref,_9(r));return typeof n=="function"||s.isPresent?m.cloneElement(r,{ref:i}):null};yi.displayName="Presence";function D9(e){const[t,n]=m.useState(),s=m.useRef(null),r=m.useRef(e),i=m.useRef("none"),o=e?"mounted":"unmounted",[l,c]=T9(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{const u=Fd(s.current);i.current=l==="mounted"?u:"none"},[l]),yr(()=>{const u=s.current,h=r.current;if(h!==e){const f=i.current,x=Fd(u);e?c("MOUNT"):x==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(h&&f!==x?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,c]),yr(()=>{if(t){let u;const h=t.ownerDocument.defaultView??window,d=x=>{const v=Fd(s.current).includes(CSS.escape(x.animationName));if(x.target===t&&v&&(c("ANIMATION_END"),!r.current)){const j=t.style.animationFillMode;t.style.animationFillMode="forwards",u=h.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=j)})}},f=x=>{x.target===t&&(i.current=Fd(s.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{h.clearTimeout(u),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:m.useCallback(u=>{s.current=u?getComputedStyle(u):null,n(u)},[])}}function Fd(e){return(e==null?void 0:e.animationName)||"none"}function _9(e){var s,r;let t=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var A9=Mh[" useInsertionEffect ".trim().toString()]||yr;function x0({prop:e,defaultProp:t,onChange:n=()=>{},caller:s}){const[r,i,o]=O9({defaultProp:t,onChange:n}),l=e!==void 0,c=l?e:r;{const h=m.useRef(e!==void 0);m.useEffect(()=>{const d=h.current;d!==l&&console.warn(`${s} is changing from ${d?"controlled":"uncontrolled"} to ${l?"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.`),h.current=l},[l,s])}const u=m.useCallback(h=>{var d;if(l){const f=z9(h)?h(e):h;f!==e&&((d=o.current)==null||d.call(o,f))}else i(h)},[l,e,i,o]);return[c,u]}function O9({defaultProp:e,onChange:t}){const[n,s]=m.useState(e),r=m.useRef(n),i=m.useRef(t);return A9(()=>{i.current=t},[t]),m.useEffect(()=>{var o;r.current!==n&&((o=i.current)==null||o.call(i,n),r.current=n)},[n,r]),[n,s,i]}function z9(e){return typeof e=="function"}var R9=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"}),U9="VisuallyHidden",h4=m.forwardRef((e,t)=>a.jsx(cn.span,{...e,ref:t,style:{...R9,...e.style}}));h4.displayName=U9;var $9=h4,[pf]=df("Tooltip",[gf]),vf=gf(),f4="TooltipProvider",P9=700,Sg="tooltip.open",[L9,g0]=pf(f4),m4=e=>{const{__scopeTooltip:t,delayDuration:n=P9,skipDelayDuration:s=300,disableHoverableContent:r=!1,children:i}=e,o=m.useRef(!0),l=m.useRef(!1),c=m.useRef(0);return m.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),a.jsx(L9,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:m.useCallback(()=>{window.clearTimeout(c.current),o.current=!1},[]),onClose:m.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,s)},[s]),isPointerInTransitRef:l,onPointerInTransitChange:m.useCallback(u=>{l.current=u},[]),disableHoverableContent:r,children:i})};m4.displayName=f4;var kc="Tooltip",[H9,bf]=pf(kc),x4=e=>{const{__scopeTooltip:t,children:n,open:s,defaultOpen:r,onOpenChange:i,disableHoverableContent:o,delayDuration:l}=e,c=g0(kc,e.__scopeTooltip),u=vf(t),[h,d]=m.useState(null),f=ws(),x=m.useRef(0),b=o??c.disableHoverableContent,v=l??c.delayDuration,j=m.useRef(!1),[g,y]=x0({prop:s,defaultProp:r??!1,onChange:C=>{C?(c.onOpen(),document.dispatchEvent(new CustomEvent(Sg))):c.onClose(),i==null||i(C)},caller:kc}),p=m.useMemo(()=>g?j.current?"delayed-open":"instant-open":"closed",[g]),w=m.useCallback(()=>{window.clearTimeout(x.current),x.current=0,j.current=!1,y(!0)},[y]),N=m.useCallback(()=>{window.clearTimeout(x.current),x.current=0,y(!1)},[y]),S=m.useCallback(()=>{window.clearTimeout(x.current),x.current=window.setTimeout(()=>{j.current=!0,y(!0),x.current=0},v)},[v,y]);return m.useEffect(()=>()=>{x.current&&(window.clearTimeout(x.current),x.current=0)},[]),a.jsx(c4,{...u,children:a.jsx(H9,{scope:t,contentId:f,open:g,stateAttribute:p,trigger:h,onTriggerChange:d,onTriggerEnter:m.useCallback(()=>{c.isOpenDelayedRef.current?S():w()},[c.isOpenDelayedRef,S,w]),onTriggerLeave:m.useCallback(()=>{b?N():(window.clearTimeout(x.current),x.current=0)},[N,b]),onOpen:w,onClose:N,disableHoverableContent:b,children:n})})};x4.displayName=kc;var Cg="TooltipTrigger",g4=m.forwardRef((e,t)=>{const{__scopeTooltip:n,...s}=e,r=bf(Cg,n),i=g0(Cg,n),o=vf(n),l=m.useRef(null),c=Xn(t,l,r.onTriggerChange),u=m.useRef(!1),h=m.useRef(!1),d=m.useCallback(()=>u.current=!1,[]);return m.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),a.jsx(f0,{asChild:!0,...o,children:a.jsx(cn.button,{"aria-describedby":r.open?r.contentId:void 0,"data-state":r.stateAttribute,...s,ref:c,onPointerMove:Ft(e.onPointerMove,f=>{f.pointerType!=="touch"&&!h.current&&!i.isPointerInTransitRef.current&&(r.onTriggerEnter(),h.current=!0)}),onPointerLeave:Ft(e.onPointerLeave,()=>{r.onTriggerLeave(),h.current=!1}),onPointerDown:Ft(e.onPointerDown,()=>{r.open&&r.onClose(),u.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:Ft(e.onFocus,()=>{u.current||r.onOpen()}),onBlur:Ft(e.onBlur,r.onClose),onClick:Ft(e.onClick,r.onClose)})})});g4.displayName=Cg;var B9="TooltipPortal",[hV,V9]=pf(B9,{forceMount:void 0}),$o="TooltipContent",p4=m.forwardRef((e,t)=>{const n=V9($o,e.__scopeTooltip),{forceMount:s=n.forceMount,side:r="top",...i}=e,o=bf($o,e.__scopeTooltip);return a.jsx(yi,{present:s||o.open,children:o.disableHoverableContent?a.jsx(v4,{side:r,...i,ref:t}):a.jsx(Y9,{side:r,...i,ref:t})})}),Y9=m.forwardRef((e,t)=>{const n=bf($o,e.__scopeTooltip),s=g0($o,e.__scopeTooltip),r=m.useRef(null),i=Xn(t,r),[o,l]=m.useState(null),{trigger:c,onClose:u}=n,h=r.current,{onPointerInTransitChange:d}=s,f=m.useCallback(()=>{l(null),d(!1)},[d]),x=m.useCallback((b,v)=>{const j=b.currentTarget,g={x:b.clientX,y:b.clientY},y=X9(g,j.getBoundingClientRect()),p=G9(g,y),w=Z9(v.getBoundingClientRect()),N=K9([...p,...w]);l(N),d(!0)},[d]);return m.useEffect(()=>()=>f(),[f]),m.useEffect(()=>{if(c&&h){const b=j=>x(j,h),v=j=>x(j,c);return c.addEventListener("pointerleave",b),h.addEventListener("pointerleave",v),()=>{c.removeEventListener("pointerleave",b),h.removeEventListener("pointerleave",v)}}},[c,h,x,f]),m.useEffect(()=>{if(o){const b=v=>{const j=v.target,g={x:v.clientX,y:v.clientY},y=(c==null?void 0:c.contains(j))||(h==null?void 0:h.contains(j)),p=!Q9(g,o);y?f():p&&(f(),u())};return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[c,h,o,u,f]),a.jsx(v4,{...e,ref:i})}),[F9,I9]=pf(kc,{isInside:!1}),W9=qR("TooltipContent"),v4=m.forwardRef((e,t)=>{const{__scopeTooltip:n,children:s,"aria-label":r,onEscapeKeyDown:i,onPointerDownOutside:o,...l}=e,c=bf($o,n),u=vf(n),{onClose:h}=c;return m.useEffect(()=>(document.addEventListener(Sg,h),()=>document.removeEventListener(Sg,h)),[h]),m.useEffect(()=>{if(c.trigger){const d=f=>{const x=f.target;x!=null&&x.contains(c.trigger)&&h()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[c.trigger,h]),a.jsx(uf,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:d=>d.preventDefault(),onDismiss:h,children:a.jsxs(d4,{"data-state":c.stateAttribute,...u,...l,ref:t,style:{...l.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:[a.jsx(W9,{children:s}),a.jsx(F9,{scope:n,isInside:!0,children:a.jsx($9,{id:c.contentId,role:"tooltip",children:r||s})})]})})});p4.displayName=$o;var b4="TooltipArrow",q9=m.forwardRef((e,t)=>{const{__scopeTooltip:n,...s}=e,r=vf(n);return I9(b4,n).isInside?null:a.jsx(u4,{...r,...s,ref:t})});q9.displayName=b4;function X9(e,t){const n=Math.abs(t.top-e.y),s=Math.abs(t.bottom-e.y),r=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,s,r,i)){case i:return"left";case r:return"right";case n:return"top";case s:return"bottom";default:throw new Error("unreachable")}}function G9(e,t,n=5){const s=[];switch(t){case"top":s.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":s.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":s.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":s.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return s}function Z9(e){const{top:t,right:n,bottom:s,left:r}=e;return[{x:r,y:t},{x:n,y:t},{x:n,y:s},{x:r,y:s}]}function Q9(e,t){const{x:n,y:s}=e;let r=!1;for(let i=0,o=t.length-1;i<t.length;o=i++){const l=t[i],c=t[o],u=l.x,h=l.y,d=c.x,f=c.y;h>s!=f>s&&n<(d-u)*(s-h)/(f-h)+u&&(r=!r)}return r}function K9(e){const t=e.slice();return t.sort((n,s)=>n.x<s.x?-1:n.x>s.x?1:n.y<s.y?-1:n.y>s.y?1:0),J9(t)}function J9(e){if(e.length<=1)return e.slice();const t=[];for(let s=0;s<e.length;s++){const r=e[s];for(;t.length>=2;){const i=t[t.length-1],o=t[t.length-2];if((i.x-o.x)*(r.y-o.y)>=(i.y-o.y)*(r.x-o.x))t.pop();else break}t.push(r)}t.pop();const n=[];for(let s=e.length-1;s>=0;s--){const r=e[s];for(;n.length>=2;){const i=n[n.length-1],o=n[n.length-2];if((i.x-o.x)*(r.y-o.y)>=(i.y-o.y)*(r.x-o.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var e7=m4,t7=x4,n7=g4,y4=p4;const Am=e7,Om=t7,zm=n7,vu=m.forwardRef(({className:e,sideOffset:t=4,...n},s)=>a.jsx(y4,{ref:s,sideOffset:t,className:_e("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=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",e),...n}));vu.displayName=y4.displayName;const s7=320,a7=32,r7=e=>({core:"text-slate-300",organization:"text-blue-300",teams:"text-green-300",twoFactor:"text-purple-300",apiKey:"text-orange-300",passkey:"text-pink-300"})[e]||"text-gray-300",Eg=({data:e,targetPosition:t,sourcePosition:n})=>{const s=e,[r,i]=m.useState(!1),[o,l]=m.useState(!1),c="!h-2 !w-2 !min-w-0 !min-h-0 !cursor-grab !border-0 opacity-0 hover:opacity-100 transition-opacity",u=r7(s.plugin||"core");return s.isForeign?a.jsx("div",{className:"relative",children:a.jsxs("div",{className:"text-xs px-3 py-2 border border-gray-600 bg-gray-800 text-gray-200 flex gap-2 items-center rounded-md shadow-lg",id:`${s.name}-foreign-key`,children:[a.jsx(_t,{size:12,className:"text-gray-400"}),a.jsx("span",{className:"font-medium",children:s.displayName||s.name}),t&&a.jsx(Kr,{type:"target",id:s.name,position:t,className:_e(c)})]})}):a.jsx("div",{className:"relative",children:a.jsxs("div",{className:_e("border border-gray-700 overflow-hidden shadow-xl bg-gray-900 rounded-lg","hover:border-gray-600 transition-colors duration-200"),style:{width:s7},id:`${s.name}-schema-node`,children:[a.jsxs("div",{className:_e("px-4 py-3 bg-black border-b border-gray-700 flex items-center justify-between","cursor-pointer select-none"),onClick:()=>i(!r),children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(_t,{size:16,className:"text-white"}),a.jsx("span",{className:"text-white font-semibold text-sm",children:s.displayName||s.name})]}),a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx("button",{onClick:h=>{h.stopPropagation(),l(!o)},className:"p-1 hover:bg-gray-800 rounded transition-colors",children:o?a.jsx(DS,{size:12,className:"text-gray-400"}):a.jsx(Go,{size:12,className:"text-gray-400"})}),r?a.jsx(t0,{size:14,className:"text-gray-400"}):a.jsx(lf,{size:14,className:"text-gray-400"})]})]}),!r&&a.jsx("div",{className:"max-h-96 bg-black overflow-y-auto",children:s.columns.map(h=>a.jsxs("div",{className:_e("relative flex items-center overflow-x-hidden px-4 py-2 text-xs","bg-black/30 hover:bg-black/40 transition-colors duration-150","border-b border-white/20 last:border-b-0"),style:{minHeight:a7},children:[a.jsxs("div",{className:"flex items-center gap-1 mr-3 min-w-[40px]",children:[h.isPrimary&&a.jsx(Am,{delayDuration:100,children:a.jsxs(Om,{children:[a.jsx(zm,{asChild:!0,children:a.jsx(uo,{size:10,className:"text-yellow-400 flex-shrink-0"})}),a.jsx(vu,{className:"bg-black border-gray-600 text-white text-xs",children:"Primary Key"})]})}),h.isUnique&&!h.isPrimary&&a.jsx(Am,{delayDuration:100,children:a.jsxs(Om,{children:[a.jsx(zm,{asChild:!0,children:a.jsx(aR,{size:10,className:"text-green-400 flex-shrink-0"})}),a.jsx(vu,{className:"bg-black border-gray-600 text-white text-xs",children:"Unique"})]})}),h.isIdentity&&a.jsx(Am,{delayDuration:100,children:a.jsxs(Om,{children:[a.jsx(zm,{asChild:!0,children:a.jsx(iR,{size:10,className:"text-blue-400 flex-shrink-0"})}),a.jsx(vu,{className:"bg-black border-gray-600 text-white text-xs",children:"Identity"})]})})]}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[!h.isNullable&&a.jsx("span",{className:"text-red-400 text-xs",children:"*"}),a.jsx("span",{className:"text-white font-medium truncate",children:h.name}),a.jsx("span",{className:"text-gray-400 font-mono text-xs",children:h.format})]}),o&&h.description&&a.jsx("div",{className:"text-gray-500 text-xs mt-1 truncate",children:h.description})]}),a.jsx("div",{className:"ml-2",children:a.jsx("span",{className:_e("px-2 py-1 rounded text-xs font-medium",u),children:h.plugin})}),a.jsx(Kr,{type:"target",id:h.id,position:t||"left",className:_e(c,"!left-[-8px] !top-1/2 !transform !-translate-y-1/2"),style:{background:"#1f2937",border:"2px solid #374151",left:"-8px",top:"50%",transform:"translateY(-50%)",boxShadow:"0 0 0 2px rgba(0, 0, 0, 0.3)"}}),a.jsx(Kr,{type:"source",id:h.id,position:n||"right",className:_e(c,"!right-[-8px] !top-1/2 !transform !-translate-y-1/2"),style:{background:"#1f2937",border:"2px solid #374151",right:"-8px",top:"50%",transform:"translateY(-50%)",boxShadow:"0 0 0 2px rgba(0, 0, 0, 0.3)"}})]},h.id))}),s.relationships&&s.relationships.length>0&&a.jsx("div",{className:"px-4 py-2 bg-gray-800 border-t border-gray-700",children:a.jsxs("span",{className:"text-xs text-gray-400",children:[s.relationships.length," relationship",s.relationships.length!==1?"s":""]})})]})})},i7={id:"demo-user-table",name:"user",displayName:"User",isForeign:!1,plugin:"core",columns:[{id:"user-id",isPrimary:!0,isNullable:!1,isUnique:!0,isIdentity:!1,name:"id",format:"string",plugin:"core",description:"Unique user identifier"},{id:"user-name",isPrimary:!1,isNullable:!1,isUnique:!1,isIdentity:!1,name:"name",format:"string",plugin:"core",description:"User display name"},{id:"user-email",isPrimary:!1,isNullable:!1,isUnique:!0,isIdentity:!1,name:"email",format:"string",plugin:"core",description:"User email address"},{id:"user-emailVerified",isPrimary:!1,isNullable:!1,isUnique:!1,isIdentity:!1,name:"emailVerified",format:"boolean",plugin:"core",description:"Email verification status"},{id:"user-image",isPrimary:!1,isNullable:!0,isUnique:!1,isIdentity:!1,name:"image",format:"string",plugin:"core",description:"User profile image URL"},{id:"user-createdAt",isPrimary:!1,isNullable:!1,isUnique:!1,isIdentity:!1,name:"createdAt",format:"date",plugin:"core",description:"Account creation timestamp"}],relationships:[{type:"one-to-many",target:"session",field:"userId"},{type:"one-to-many",target:"account",field:"userId"}]},o7={id:"demo-organization-table",name:"organization",displayName:"Organization",isForeign:!1,plugin:"organization",columns:[{id:"org-id",isPrimary:!0,isNullable:!1,isUnique:!0,isIdentity:!1,name:"id",format:"string",plugin:"organization",description:"Unique organization identifier"},{id:"org-name",isPrimary:!1,isNullable:!1,isUnique:!1,isIdentity:!1,name:"name",format:"string",plugin:"organization",description:"Organization name"},{id:"org-slug",isPrimary:!1,isNullable:!1,isUnique:!0,isIdentity:!1,name:"slug",format:"string",plugin:"organization",description:"Organization URL slug"}],relationships:[{type:"one-to-many",target:"member",field:"organizationId"}]};function l7(){return a.jsx("div",{className:"min-h-screen bg-black p-8",children:a.jsxs("div",{className:"max-w-6xl mx-auto",children:[a.jsxs("div",{className:"mb-8",children:[a.jsx("h1",{className:"text-3xl font-light text-white mb-4",children:"Database Schema Node Demo"}),a.jsx("p",{className:"text-gray-400",children:"Enhanced database schema nodes with dark mode theming, collapsible views, and detailed tooltips."})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-8",children:[a.jsxs("div",{children:[a.jsx("h2",{className:"text-xl text-white mb-4",children:"Core User Table"}),a.jsx(Eg,{data:i7,targetPosition:"left",sourcePosition:"right"})]}),a.jsxs("div",{children:[a.jsx("h2",{className:"text-xl text-white mb-4",children:"Organization Plugin Table"}),a.jsx(Eg,{data:o7,targetPosition:"left",sourcePosition:"right"})]})]}),a.jsxs("div",{className:"mt-12 p-6 bg-gray-900 rounded-lg border border-gray-700",children:[a.jsx("h3",{className:"text-lg text-white mb-4",children:"Features"}),a.jsxs("ul",{className:"space-y-2 text-gray-300",children:[a.jsxs("li",{children:["• ",a.jsx("strong",{children:"Dark Mode Optimized:"})," Designed specifically for dark themes"]}),a.jsxs("li",{children:["• ",a.jsx("strong",{children:"Collapsible Views:"})," Click the header to collapse/expand table contents"]}),a.jsxs("li",{children:["• ",a.jsx("strong",{children:"Detail Toggle:"})," Show/hide column descriptions with the eye icon"]}),a.jsxs("li",{children:["• ",a.jsx("strong",{children:"Plugin Badges:"})," Color-coded plugin indicators"]}),a.jsxs("li",{children:["• ",a.jsx("strong",{children:"Interactive Icons:"})," Hover tooltips for primary keys, unique constraints, etc."]}),a.jsxs("li",{children:["• ",a.jsx("strong",{children:"Relationship Counter:"})," Shows number of relationships in footer"]}),a.jsxs("li",{children:["• ",a.jsx("strong",{children:"Connection Handles:"})," Invisible handles for React Flow connections"]})]})]})]})})}const w4=m.createContext(void 0);function c7({children:e}){const[t,n]=m.useState({users:0,organizations:0,sessions:0,teams:0}),[s,r]=m.useState(!0),i=m.useCallback(async()=>{try{const c=await(await fetch("/api/counts")).json();n(c)}catch{}finally{r(!1)}},[]),o=m.useCallback(async()=>{r(!0),await i()},[i]);return m.useEffect(()=>{i()},[i]),a.jsx(w4.Provider,{value:{counts:t,loading:s,refetchCounts:o},children:e})}function yf(){const e=m.useContext(w4);if(e===void 0)throw new Error("useCounts must be used within a CountsProvider");return e}function j4(e,t){const n=m.useRef(null),s=m.useRef(null),r=m.useRef(0),i=m.useRef(!1),o=m.useRef(e),l=m.useRef(t==null?void 0:t.onStatusChange),c=(t==null?void 0:t.maxReconnectAttempts)??5;m.useEffect(()=>{o.current=e},[e]),m.useEffect(()=>{l.current=t==null?void 0:t.onStatusChange},[t==null?void 0:t.onStatusChange]),m.useEffect(()=>{let u=!1;const h=()=>{var d;try{(d=l.current)==null||d.call(l,"connecting");const x=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}`;n.current=new WebSocket(x),n.current.onopen=()=>{var b;r.current=0,i.current=!0,(b=l.current)==null||b.call(l,"open"),s.current&&(clearTimeout(s.current),s.current=null)},n.current.onmessage=b=>{try{const v=JSON.parse(b.data);o.current&&o.current(v)}catch{}},n.current.onclose=b=>{var v,j,g,y;if(!u){if(!i.current&&(b.code===1006||b.code===1001)){(v=l.current)==null||v.call(l,"unavailable");return}if((j=l.current)==null||j.call(l,"closed"),r.current<c){r.current++;const p=Math.min(1e3*2**r.current,1e4);(g=l.current)==null||g.call(l,"reconnecting"),s.current=setTimeout(()=>{h()},p)}else(y=l.current)==null||y.call(l,"unavailable")}},n.current.onerror=b=>{var v;(v=l.current)==null||v.call(l,"error")}}catch{}};return h(),()=>{u=!0,n.current&&n.current.close(),s.current&&clearTimeout(s.current)}},[c])}var Ly=1,d7=.9,u7=.8,h7=.17,Rm=.1,Um=.999,f7=.9999,m7=.99,x7=/[\\\/_+.#"@\[\(\{&]/,g7=/[\\\/_+.#"@\[\(\{&]/g,p7=/[\s-]/,N4=/[\s-]/g;function kg(e,t,n,s,r,i,o){if(i===t.length)return r===e.length?Ly:m7;var l=`${r},${i}`;if(o[l]!==void 0)return o[l];for(var c=s.charAt(i),u=n.indexOf(c,r),h=0,d,f,x,b;u>=0;)d=kg(e,t,n,s,u+1,i+1,o),d>h&&(u===r?d*=Ly:x7.test(e.charAt(u-1))?(d*=u7,x=e.slice(r,u-1).match(g7),x&&r>0&&(d*=Math.pow(Um,x.length))):p7.test(e.charAt(u-1))?(d*=d7,b=e.slice(r,u-1).match(N4),b&&r>0&&(d*=Math.pow(Um,b.length))):(d*=h7,r>0&&(d*=Math.pow(Um,u-r))),e.charAt(u)!==t.charAt(i)&&(d*=f7)),(d<Rm&&n.charAt(u-1)===s.charAt(i+1)||s.charAt(i+1)===s.charAt(i)&&n.charAt(u-1)!==s.charAt(i))&&(f=kg(e,t,n,s,u+1,i+2,o),f*Rm>d&&(d=f*Rm)),d>h&&(h=d),u=n.indexOf(c,u+1);return o[l]=h,h}function Hy(e){return e.toLowerCase().replace(N4," ")}function v7(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,kg(e,t,Hy(e),Hy(t),0,0,{})}var $m="focusScope.autoFocusOnMount",Pm="focusScope.autoFocusOnUnmount",By={bubbles:!1,cancelable:!0},b7="FocusScope",p0=m.forwardRef((e,t)=>{const{loop:n=!1,trapped:s=!1,onMountAutoFocus:r,onUnmountAutoFocus:i,...o}=e,[l,c]=m.useState(null),u=Ro(r),h=Ro(i),d=m.useRef(null),f=Xn(t,v=>c(v)),x=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(s){let v=function(p){if(x.paused||!l)return;const w=p.target;l.contains(w)?d.current=w:Ya(d.current,{select:!0})},j=function(p){if(x.paused||!l)return;const w=p.relatedTarget;w!==null&&(l.contains(w)||Ya(d.current,{select:!0}))},g=function(p){if(document.activeElement===document.body)for(const N of p)N.removedNodes.length>0&&Ya(l)};document.addEventListener("focusin",v),document.addEventListener("focusout",j);const y=new MutationObserver(g);return l&&y.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",j),y.disconnect()}}},[s,l,x.paused]),m.useEffect(()=>{if(l){Yy.add(x);const v=document.activeElement;if(!l.contains(v)){const g=new CustomEvent($m,By);l.addEventListener($m,u),l.dispatchEvent(g),g.defaultPrevented||(y7(C7(S4(l)),{select:!0}),document.activeElement===v&&Ya(l))}return()=>{l.removeEventListener($m,u),setTimeout(()=>{const g=new CustomEvent(Pm,By);l.addEventListener(Pm,h),l.dispatchEvent(g),g.defaultPrevented||Ya(v??document.body,{select:!0}),l.removeEventListener(Pm,h),Yy.remove(x)},0)}}},[l,u,h,x]);const b=m.useCallback(v=>{if(!n&&!s||x.paused)return;const j=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,g=document.activeElement;if(j&&g){const y=v.currentTarget,[p,w]=w7(y);p&&w?!v.shiftKey&&g===w?(v.preventDefault(),n&&Ya(p,{select:!0})):v.shiftKey&&g===p&&(v.preventDefault(),n&&Ya(w,{select:!0})):g===y&&v.preventDefault()}},[n,s,x.paused]);return a.jsx(cn.div,{tabIndex:-1,...o,ref:f,onKeyDown:b})});p0.displayName=b7;function y7(e,{select:t=!1}={}){const n=document.activeElement;for(const s of e)if(Ya(s,{select:t}),document.activeElement!==n)return}function w7(e){const t=S4(e),n=Vy(t,e),s=Vy(t.reverse(),e);return[n,s]}function S4(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:s=>{const r=s.tagName==="INPUT"&&s.type==="hidden";return s.disabled||s.hidden||r?NodeFilter.FILTER_SKIP:s.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Vy(e,t){for(const n of e)if(!j7(n,{upTo:t}))return n}function j7(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function N7(e){return e instanceof HTMLInputElement&&"select"in e}function Ya(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&N7(e)&&t&&e.select()}}var Yy=S7();function S7(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Fy(e,t),e.unshift(t)},remove(t){var n;e=Fy(e,t),(n=e[0])==null||n.resume()}}}function Fy(e,t){const n=[...e],s=n.indexOf(t);return s!==-1&&n.splice(s,1),n}function C7(e){return e.filter(t=>t.tagName!=="A")}var Lm=0;function C4(){m.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Iy()),document.body.insertAdjacentElement("beforeend",e[1]??Iy()),Lm++,()=>{Lm===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Lm--}},[])}function Iy(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Ps=function(){return Ps=Object.assign||function(t){for(var n,s=1,r=arguments.length;s<r;s++){n=arguments[s];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Ps.apply(this,arguments)};function E4(e,t){var n={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0&&(n[s]=e[s]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(e);r<s.length;r++)t.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(e,s[r])&&(n[s[r]]=e[s[r]]);return n}function E7(e,t,n){if(n||arguments.length===2)for(var s=0,r=t.length,i;s<r;s++)(i||!(s in t))&&(i||(i=Array.prototype.slice.call(t,0,s)),i[s]=t[s]);return e.concat(i||Array.prototype.slice.call(t))}var bu="right-scroll-bar-position",yu="width-before-scroll-bar",k7="with-scroll-bars-hidden",M7="--removed-body-scroll-bar-size";function Hm(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function T7(e,t){var n=m.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(s){var r=n.value;r!==s&&(n.value=s,n.callback(s,r))}}}})[0];return n.callback=t,n.facade}var D7=typeof window<"u"?m.useLayoutEffect:m.useEffect,Wy=new WeakMap;function _7(e,t){var n=T7(null,function(s){return e.forEach(function(r){return Hm(r,s)})});return D7(function(){var s=Wy.get(n);if(s){var r=new Set(s),i=new Set(e),o=n.current;r.forEach(function(l){i.has(l)||Hm(l,null)}),i.forEach(function(l){r.has(l)||Hm(l,o)})}Wy.set(n,e)},[e]),n}function A7(e){return e}function O7(e,t){t===void 0&&(t=A7);var n=[],s=!1,r={read:function(){if(s)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(i){var o=t(i,s);return n.push(o),function(){n=n.filter(function(l){return l!==o})}},assignSyncMedium:function(i){for(s=!0;n.length;){var o=n;n=[],o.forEach(i)}n={push:function(l){return i(l)},filter:function(){return n}}},assignMedium:function(i){s=!0;var o=[];if(n.length){var l=n;n=[],l.forEach(i),o=n}var c=function(){var h=o;o=[],h.forEach(i)},u=function(){return Promise.resolve().then(c)};u(),n={push:function(h){o.push(h),u()},filter:function(h){return o=o.filter(h),n}}}};return r}function z7(e){e===void 0&&(e={});var t=O7(null);return t.options=Ps({async:!0,ssr:!1},e),t}var k4=function(e){var t=e.sideCar,n=E4(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var s=t.read();if(!s)throw new Error("Sidecar medium not found");return m.createElement(s,Ps({},n))};k4.isSideCarExport=!0;function R7(e,t){return e.useMedium(t),k4}var M4=z7(),Bm=function(){},wf=m.forwardRef(function(e,t){var n=m.useRef(null),s=m.useState({onScrollCapture:Bm,onWheelCapture:Bm,onTouchMoveCapture:Bm}),r=s[0],i=s[1],o=e.forwardProps,l=e.children,c=e.className,u=e.removeScrollBar,h=e.enabled,d=e.shards,f=e.sideCar,x=e.noRelative,b=e.noIsolation,v=e.inert,j=e.allowPinchZoom,g=e.as,y=g===void 0?"div":g,p=e.gapMode,w=E4(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),N=f,S=_7([n,t]),C=Ps(Ps({},w),r);return m.createElement(m.Fragment,null,h&&m.createElement(N,{sideCar:M4,removeScrollBar:u,shards:d,noRelative:x,noIsolation:b,inert:v,setCallbacks:i,allowPinchZoom:!!j,lockRef:n,gapMode:p}),o?m.cloneElement(m.Children.only(l),Ps(Ps({},C),{ref:S})):m.createElement(y,Ps({},C,{className:c,ref:S}),l))});wf.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};wf.classNames={fullWidth:yu,zeroRight:bu};var U7=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function $7(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=U7();return t&&e.setAttribute("nonce",t),e}function P7(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function L7(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var H7=function(){var e=0,t=null;return{add:function(n){e==0&&(t=$7())&&(P7(t,n),L7(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},B7=function(){var e=H7();return function(t,n){m.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},T4=function(){var e=B7(),t=function(n){var s=n.styles,r=n.dynamic;return e(s,r),null};return t},V7={left:0,top:0,right:0,gap:0},Vm=function(e){return parseInt(e||"",10)||0},Y7=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],s=t[e==="padding"?"paddingTop":"marginTop"],r=t[e==="padding"?"paddingRight":"marginRight"];return[Vm(n),Vm(s),Vm(r)]},F7=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return V7;var t=Y7(e),n=document.documentElement.clientWidth,s=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,s-n+t[2]-t[0])}},I7=T4(),xo="data-scroll-locked",W7=function(e,t,n,s){var r=e.left,i=e.top,o=e.right,l=e.gap;return n===void 0&&(n="margin"),`
384
- .`.concat(k7,` {
385
- overflow: hidden `).concat(s,`;
386
- padding-right: `).concat(l,"px ").concat(s,`;
387
- }
388
- body[`).concat(xo,`] {
389
- overflow: hidden `).concat(s,`;
390
- overscroll-behavior: contain;
391
- `).concat([t&&"position: relative ".concat(s,";"),n==="margin"&&`
392
- padding-left: `.concat(r,`px;
393
- padding-top: `).concat(i,`px;
394
- padding-right: `).concat(o,`px;
395
- margin-left:0;
396
- margin-top:0;
397
- margin-right: `).concat(l,"px ").concat(s,`;
398
- `),n==="padding"&&"padding-right: ".concat(l,"px ").concat(s,";")].filter(Boolean).join(""),`
399
- }
400
-
401
- .`).concat(bu,` {
402
- right: `).concat(l,"px ").concat(s,`;
403
- }
404
-
405
- .`).concat(yu,` {
406
- margin-right: `).concat(l,"px ").concat(s,`;
407
- }
408
-
409
- .`).concat(bu," .").concat(bu,` {
410
- right: 0 `).concat(s,`;
411
- }
412
-
413
- .`).concat(yu," .").concat(yu,` {
414
- margin-right: 0 `).concat(s,`;
415
- }
416
-
417
- body[`).concat(xo,`] {
418
- `).concat(M7,": ").concat(l,`px;
419
- }
420
- `)},qy=function(){var e=parseInt(document.body.getAttribute(xo)||"0",10);return isFinite(e)?e:0},q7=function(){m.useEffect(function(){return document.body.setAttribute(xo,(qy()+1).toString()),function(){var e=qy()-1;e<=0?document.body.removeAttribute(xo):document.body.setAttribute(xo,e.toString())}},[])},X7=function(e){var t=e.noRelative,n=e.noImportant,s=e.gapMode,r=s===void 0?"margin":s;q7();var i=m.useMemo(function(){return F7(r)},[r]);return m.createElement(I7,{styles:W7(i,!t,r,n?"":"!important")})},Mg=!1;if(typeof window<"u")try{var Id=Object.defineProperty({},"passive",{get:function(){return Mg=!0,!0}});window.addEventListener("test",Id,Id),window.removeEventListener("test",Id,Id)}catch{Mg=!1}var Ti=Mg?{passive:!1}:!1,G7=function(e){return e.tagName==="TEXTAREA"},D4=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!G7(e)&&n[t]==="visible")},Z7=function(e){return D4(e,"overflowY")},Q7=function(e){return D4(e,"overflowX")},Xy=function(e,t){var n=t.ownerDocument,s=t;do{typeof ShadowRoot<"u"&&s instanceof ShadowRoot&&(s=s.host);var r=_4(e,s);if(r){var i=A4(e,s),o=i[1],l=i[2];if(o>l)return!0}s=s.parentNode}while(s&&s!==n.body);return!1},K7=function(e){var t=e.scrollTop,n=e.scrollHeight,s=e.clientHeight;return[t,n,s]},J7=function(e){var t=e.scrollLeft,n=e.scrollWidth,s=e.clientWidth;return[t,n,s]},_4=function(e,t){return e==="v"?Z7(t):Q7(t)},A4=function(e,t){return e==="v"?K7(t):J7(t)},eU=function(e,t){return e==="h"&&t==="rtl"?-1:1},tU=function(e,t,n,s,r){var i=eU(e,window.getComputedStyle(t).direction),o=i*s,l=n.target,c=t.contains(l),u=!1,h=o>0,d=0,f=0;do{if(!l)break;var x=A4(e,l),b=x[0],v=x[1],j=x[2],g=v-j-i*b;(b||g)&&_4(e,l)&&(d+=g,f+=b);var y=l.parentNode;l=y&&y.nodeType===Node.DOCUMENT_FRAGMENT_NODE?y.host:y}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(h&&Math.abs(d)<1||!h&&Math.abs(f)<1)&&(u=!0),u},Wd=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Gy=function(e){return[e.deltaX,e.deltaY]},Zy=function(e){return e&&"current"in e?e.current:e},nU=function(e,t){return e[0]===t[0]&&e[1]===t[1]},sU=function(e){return`
421
- .block-interactivity-`.concat(e,` {pointer-events: none;}
422
- .allow-interactivity-`).concat(e,` {pointer-events: all;}
423
- `)},aU=0,Di=[];function rU(e){var t=m.useRef([]),n=m.useRef([0,0]),s=m.useRef(),r=m.useState(aU++)[0],i=m.useState(T4)[0],o=m.useRef(e);m.useEffect(function(){o.current=e},[e]),m.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(r));var v=E7([e.lockRef.current],(e.shards||[]).map(Zy),!0).filter(Boolean);return v.forEach(function(j){return j.classList.add("allow-interactivity-".concat(r))}),function(){document.body.classList.remove("block-interactivity-".concat(r)),v.forEach(function(j){return j.classList.remove("allow-interactivity-".concat(r))})}}},[e.inert,e.lockRef.current,e.shards]);var l=m.useCallback(function(v,j){if("touches"in v&&v.touches.length===2||v.type==="wheel"&&v.ctrlKey)return!o.current.allowPinchZoom;var g=Wd(v),y=n.current,p="deltaX"in v?v.deltaX:y[0]-g[0],w="deltaY"in v?v.deltaY:y[1]-g[1],N,S=v.target,C=Math.abs(p)>Math.abs(w)?"h":"v";if("touches"in v&&C==="h"&&S.type==="range")return!1;var T=Xy(C,S);if(!T)return!0;if(T?N=C:(N=C==="v"?"h":"v",T=Xy(C,S)),!T)return!1;if(!s.current&&"changedTouches"in v&&(p||w)&&(s.current=N),!N)return!0;var U=s.current||N;return tU(U,j,v,U==="h"?p:w)},[]),c=m.useCallback(function(v){var j=v;if(!(!Di.length||Di[Di.length-1]!==i)){var g="deltaY"in j?Gy(j):Wd(j),y=t.current.filter(function(N){return N.name===j.type&&(N.target===j.target||j.target===N.shadowParent)&&nU(N.delta,g)})[0];if(y&&y.should){j.cancelable&&j.preventDefault();return}if(!y){var p=(o.current.shards||[]).map(Zy).filter(Boolean).filter(function(N){return N.contains(j.target)}),w=p.length>0?l(j,p[0]):!o.current.noIsolation;w&&j.cancelable&&j.preventDefault()}}},[]),u=m.useCallback(function(v,j,g,y){var p={name:v,delta:j,target:g,should:y,shadowParent:iU(g)};t.current.push(p),setTimeout(function(){t.current=t.current.filter(function(w){return w!==p})},1)},[]),h=m.useCallback(function(v){n.current=Wd(v),s.current=void 0},[]),d=m.useCallback(function(v){u(v.type,Gy(v),v.target,l(v,e.lockRef.current))},[]),f=m.useCallback(function(v){u(v.type,Wd(v),v.target,l(v,e.lockRef.current))},[]);m.useEffect(function(){return Di.push(i),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",c,Ti),document.addEventListener("touchmove",c,Ti),document.addEventListener("touchstart",h,Ti),function(){Di=Di.filter(function(v){return v!==i}),document.removeEventListener("wheel",c,Ti),document.removeEventListener("touchmove",c,Ti),document.removeEventListener("touchstart",h,Ti)}},[]);var x=e.removeScrollBar,b=e.inert;return m.createElement(m.Fragment,null,b?m.createElement(i,{styles:sU(r)}):null,x?m.createElement(X7,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function iU(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const oU=R7(M4,rU);var v0=m.forwardRef(function(e,t){return m.createElement(wf,Ps({},e,{ref:t,sideCar:oU}))});v0.classNames=wf.classNames;var lU=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},_i=new WeakMap,qd=new WeakMap,Xd={},Ym=0,O4=function(e){return e&&(e.host||O4(e.parentNode))},cU=function(e,t){return t.map(function(n){if(e.contains(n))return n;var s=O4(n);return s&&e.contains(s)?s:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},dU=function(e,t,n,s){var r=cU(t,Array.isArray(e)?e:[e]);Xd[n]||(Xd[n]=new WeakMap);var i=Xd[n],o=[],l=new Set,c=new Set(r),u=function(d){!d||l.has(d)||(l.add(d),u(d.parentNode))};r.forEach(u);var h=function(d){!d||c.has(d)||Array.prototype.forEach.call(d.children,function(f){if(l.has(f))h(f);else try{var x=f.getAttribute(s),b=x!==null&&x!=="false",v=(_i.get(f)||0)+1,j=(i.get(f)||0)+1;_i.set(f,v),i.set(f,j),o.push(f),v===1&&b&&qd.set(f,!0),j===1&&f.setAttribute(n,"true"),b||f.setAttribute(s,"true")}catch(g){console.error("aria-hidden: cannot operate on ",f,g)}})};return h(t),l.clear(),Ym++,function(){o.forEach(function(d){var f=_i.get(d)-1,x=i.get(d)-1;_i.set(d,f),i.set(d,x),f||(qd.has(d)||d.removeAttribute(s),qd.delete(d)),x||d.removeAttribute(n)}),Ym--,Ym||(_i=new WeakMap,_i=new WeakMap,qd=new WeakMap,Xd={})}},z4=function(e,t,n){n===void 0&&(n="data-aria-hidden");var s=Array.from(Array.isArray(e)?e:[e]),r=lU(e);return r?(s.push.apply(s,Array.from(r.querySelectorAll("[aria-live], script"))),dU(s,r,n,"aria-hidden")):function(){return null}},jf="Dialog",[R4]=df(jf),[uU,ks]=R4(jf),U4=e=>{const{__scopeDialog:t,children:n,open:s,defaultOpen:r,onOpenChange:i,modal:o=!0}=e,l=m.useRef(null),c=m.useRef(null),[u,h]=x0({prop:s,defaultProp:r??!1,onChange:i,caller:jf});return a.jsx(uU,{scope:t,triggerRef:l,contentRef:c,contentId:ws(),titleId:ws(),descriptionId:ws(),open:u,onOpenChange:h,onOpenToggle:m.useCallback(()=>h(d=>!d),[h]),modal:o,children:n})};U4.displayName=jf;var $4="DialogTrigger",hU=m.forwardRef((e,t)=>{const{__scopeDialog:n,...s}=e,r=ks($4,n),i=Xn(t,r.triggerRef);return a.jsx(cn.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":w0(r.open),...s,ref:i,onClick:Ft(e.onClick,r.onOpenToggle)})});hU.displayName=$4;var b0="DialogPortal",[fU,P4]=R4(b0,{forceMount:void 0}),L4=e=>{const{__scopeDialog:t,forceMount:n,children:s,container:r}=e,i=ks(b0,t);return a.jsx(fU,{scope:t,forceMount:n,children:m.Children.map(s,o=>a.jsx(yi,{present:n||i.open,children:a.jsx(m0,{asChild:!0,container:r,children:o})}))})};L4.displayName=b0;var vh="DialogOverlay",H4=m.forwardRef((e,t)=>{const n=P4(vh,e.__scopeDialog),{forceMount:s=n.forceMount,...r}=e,i=ks(vh,e.__scopeDialog);return i.modal?a.jsx(yi,{present:s||i.open,children:a.jsx(xU,{...r,ref:t})}):null});H4.displayName=vh;var mU=a0("DialogOverlay.RemoveScroll"),xU=m.forwardRef((e,t)=>{const{__scopeDialog:n,...s}=e,r=ks(vh,n);return a.jsx(v0,{as:mU,allowPinchZoom:!0,shards:[r.contentRef],children:a.jsx(cn.div,{"data-state":w0(r.open),...s,ref:t,style:{pointerEvents:"auto",...s.style}})})}),ui="DialogContent",B4=m.forwardRef((e,t)=>{const n=P4(ui,e.__scopeDialog),{forceMount:s=n.forceMount,...r}=e,i=ks(ui,e.__scopeDialog);return a.jsx(yi,{present:s||i.open,children:i.modal?a.jsx(gU,{...r,ref:t}):a.jsx(pU,{...r,ref:t})})});B4.displayName=ui;var gU=m.forwardRef((e,t)=>{const n=ks(ui,e.__scopeDialog),s=m.useRef(null),r=Xn(t,n.contentRef,s);return m.useEffect(()=>{const i=s.current;if(i)return z4(i)},[]),a.jsx(V4,{...e,ref:r,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ft(e.onCloseAutoFocus,i=>{var o;i.preventDefault(),(o=n.triggerRef.current)==null||o.focus()}),onPointerDownOutside:Ft(e.onPointerDownOutside,i=>{const o=i.detail.originalEvent,l=o.button===0&&o.ctrlKey===!0;(o.button===2||l)&&i.preventDefault()}),onFocusOutside:Ft(e.onFocusOutside,i=>i.preventDefault())})}),pU=m.forwardRef((e,t)=>{const n=ks(ui,e.__scopeDialog),s=m.useRef(!1),r=m.useRef(!1);return a.jsx(V4,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var o,l;(o=e.onCloseAutoFocus)==null||o.call(e,i),i.defaultPrevented||(s.current||(l=n.triggerRef.current)==null||l.focus(),i.preventDefault()),s.current=!1,r.current=!1},onInteractOutside:i=>{var c,u;(c=e.onInteractOutside)==null||c.call(e,i),i.defaultPrevented||(s.current=!0,i.detail.originalEvent.type==="pointerdown"&&(r.current=!0));const o=i.target;((u=n.triggerRef.current)==null?void 0:u.contains(o))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&r.current&&i.preventDefault()}})}),V4=m.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:s,onOpenAutoFocus:r,onCloseAutoFocus:i,...o}=e,l=ks(ui,n),c=m.useRef(null),u=Xn(t,c);return C4(),a.jsxs(a.Fragment,{children:[a.jsx(p0,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:r,onUnmountAutoFocus:i,children:a.jsx(uf,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":w0(l.open),...o,ref:u,onDismiss:()=>l.onOpenChange(!1)})}),a.jsxs(a.Fragment,{children:[a.jsx(wU,{titleId:l.titleId}),a.jsx(NU,{contentRef:c,descriptionId:l.descriptionId})]})]})}),y0="DialogTitle",vU=m.forwardRef((e,t)=>{const{__scopeDialog:n,...s}=e,r=ks(y0,n);return a.jsx(cn.h2,{id:r.titleId,...s,ref:t})});vU.displayName=y0;var Y4="DialogDescription",bU=m.forwardRef((e,t)=>{const{__scopeDialog:n,...s}=e,r=ks(Y4,n);return a.jsx(cn.p,{id:r.descriptionId,...s,ref:t})});bU.displayName=Y4;var F4="DialogClose",yU=m.forwardRef((e,t)=>{const{__scopeDialog:n,...s}=e,r=ks(F4,n);return a.jsx(cn.button,{type:"button",...s,ref:t,onClick:Ft(e.onClick,()=>r.onOpenChange(!1))})});yU.displayName=F4;function w0(e){return e?"open":"closed"}var I4="DialogTitleWarning",[fV,W4]=FR(I4,{contentName:ui,titleName:y0,docsSlug:"dialog"}),wU=({titleId:e})=>{const t=W4(I4),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
424
-
425
- If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
426
-
427
- For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return m.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},jU="DialogDescriptionWarning",NU=({contentRef:e,descriptionId:t})=>{const s=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${W4(jU).contentName}}.`;return m.useEffect(()=>{var i;const r=(i=e.current)==null?void 0:i.getAttribute("aria-describedby");t&&r&&(document.getElementById(t)||console.warn(s))},[s,e,t]),null},SU=U4,CU=L4,EU=H4,kU=B4,MU=Symbol.for("react.lazy"),bh=Mh[" use ".trim().toString()];function TU(e){return typeof e=="object"&&e!==null&&"then"in e}function q4(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===MU&&"_payload"in e&&TU(e._payload)}function X4(e){const t=_U(e),n=m.forwardRef((s,r)=>{let{children:i,...o}=s;q4(i)&&typeof bh=="function"&&(i=bh(i._payload));const l=m.Children.toArray(i),c=l.find(OU);if(c){const u=c.props.children,h=l.map(d=>d===c?m.Children.count(u)>1?m.Children.only(null):m.isValidElement(u)?u.props.children:null:d);return a.jsx(t,{...o,ref:r,children:m.isValidElement(u)?m.cloneElement(u,void 0,h):null})}return a.jsx(t,{...o,ref:r,children:i})});return n.displayName=`${e}.Slot`,n}var DU=X4("Slot");function _U(e){const t=m.forwardRef((n,s)=>{let{children:r,...i}=n;if(q4(r)&&typeof bh=="function"&&(r=bh(r._payload)),m.isValidElement(r)){const o=RU(r),l=zU(i,r.props);return r.type!==m.Fragment&&(l.ref=s?br(s,o):o),m.cloneElement(r,l)}return m.Children.count(r)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var AU=Symbol("radix.slottable");function OU(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===AU}function zU(e,t){const n={...t};for(const s in t){const r=e[s],i=t[s];/^on[A-Z]/.test(s)?r&&i?n[s]=(...l)=>{const c=i(...l);return r(...l),c}:r&&(n[s]=r):s==="style"?n[s]={...r,...i}:s==="className"&&(n[s]=[r,i].filter(Boolean).join(" "))}return{...e,...n}}function RU(e){var s,r;let t=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var UU=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],kr=UU.reduce((e,t)=>{const n=X4(`Primitive.${t}`),s=m.forwardRef((r,i)=>{const{asChild:o,...l}=r,c=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(c,{...l,ref:i})});return s.displayName=`Primitive.${t}`,{...e,[t]:s}},{}),bl='[cmdk-group=""]',Fm='[cmdk-group-items=""]',$U='[cmdk-group-heading=""]',G4='[cmdk-item=""]',Qy=`${G4}:not([aria-disabled="true"])`,Tg="cmdk-item-select",Pi="data-value",PU=(e,t,n)=>v7(e,t,n),Z4=m.createContext(void 0),ed=()=>m.useContext(Z4),Q4=m.createContext(void 0),j0=()=>m.useContext(Q4),K4=m.createContext(void 0),J4=m.forwardRef((e,t)=>{let n=Li(()=>{var R,L;return{search:"",value:(L=(R=e.value)!=null?R:e.defaultValue)!=null?L:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),s=Li(()=>new Set),r=Li(()=>new Map),i=Li(()=>new Map),o=Li(()=>new Set),l=eC(e),{label:c,children:u,value:h,onValueChange:d,filter:f,shouldFilter:x,loop:b,disablePointerSelection:v=!1,vimBindings:j=!0,...g}=e,y=ws(),p=ws(),w=ws(),N=m.useRef(null),S=GU();hi(()=>{if(h!==void 0){let R=h.trim();n.current.value=R,C.emit()}},[h]),hi(()=>{S(6,Y)},[]);let C=m.useMemo(()=>({subscribe:R=>(o.current.add(R),()=>o.current.delete(R)),snapshot:()=>n.current,setState:(R,L,X)=>{var G,te,re,ee;if(!Object.is(n.current[R],L)){if(n.current[R]=L,R==="search")z(),B(),S(1,P);else if(R==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let se=document.getElementById(w);se?se.focus():(G=document.getElementById(y))==null||G.focus()}if(S(7,()=>{var se;n.current.selectedItemId=(se=k())==null?void 0:se.id,C.emit()}),X||S(5,Y),((te=l.current)==null?void 0:te.value)!==void 0){let se=L??"";(ee=(re=l.current).onValueChange)==null||ee.call(re,se);return}}C.emit()}},emit:()=>{o.current.forEach(R=>R())}}),[]),T=m.useMemo(()=>({value:(R,L,X)=>{var G;L!==((G=i.current.get(R))==null?void 0:G.value)&&(i.current.set(R,{value:L,keywords:X}),n.current.filtered.items.set(R,U(L,X)),S(2,()=>{B(),C.emit()}))},item:(R,L)=>(s.current.add(R),L&&(r.current.has(L)?r.current.get(L).add(R):r.current.set(L,new Set([R]))),S(3,()=>{z(),B(),n.current.value||P(),C.emit()}),()=>{i.current.delete(R),s.current.delete(R),n.current.filtered.items.delete(R);let X=k();S(4,()=>{z(),(X==null?void 0:X.getAttribute("id"))===R&&P(),C.emit()})}),group:R=>(r.current.has(R)||r.current.set(R,new Set),()=>{i.current.delete(R),r.current.delete(R)}),filter:()=>l.current.shouldFilter,label:c||e["aria-label"],getDisablePointerSelection:()=>l.current.disablePointerSelection,listId:y,inputId:w,labelId:p,listInnerRef:N}),[]);function U(R,L){var X,G;let te=(G=(X=l.current)==null?void 0:X.filter)!=null?G:PU;return R?te(R,n.current.search,L):0}function B(){if(!n.current.search||l.current.shouldFilter===!1)return;let R=n.current.filtered.items,L=[];n.current.filtered.groups.forEach(G=>{let te=r.current.get(G),re=0;te.forEach(ee=>{let se=R.get(ee);re=Math.max(se,re)}),L.push([G,re])});let X=N.current;$().sort((G,te)=>{var re,ee;let se=G.getAttribute("id"),ge=te.getAttribute("id");return((re=R.get(ge))!=null?re:0)-((ee=R.get(se))!=null?ee:0)}).forEach(G=>{let te=G.closest(Fm);te?te.appendChild(G.parentElement===te?G:G.closest(`${Fm} > *`)):X.appendChild(G.parentElement===X?G:G.closest(`${Fm} > *`))}),L.sort((G,te)=>te[1]-G[1]).forEach(G=>{var te;let re=(te=N.current)==null?void 0:te.querySelector(`${bl}[${Pi}="${encodeURIComponent(G[0])}"]`);re==null||re.parentElement.appendChild(re)})}function P(){let R=$().find(X=>X.getAttribute("aria-disabled")!=="true"),L=R==null?void 0:R.getAttribute(Pi);C.setState("value",L||void 0)}function z(){var R,L,X,G;if(!n.current.search||l.current.shouldFilter===!1){n.current.filtered.count=s.current.size;return}n.current.filtered.groups=new Set;let te=0;for(let re of s.current){let ee=(L=(R=i.current.get(re))==null?void 0:R.value)!=null?L:"",se=(G=(X=i.current.get(re))==null?void 0:X.keywords)!=null?G:[],ge=U(ee,se);n.current.filtered.items.set(re,ge),ge>0&&te++}for(let[re,ee]of r.current)for(let se of ee)if(n.current.filtered.items.get(se)>0){n.current.filtered.groups.add(re);break}n.current.filtered.count=te}function Y(){var R,L,X;let G=k();G&&(((R=G.parentElement)==null?void 0:R.firstChild)===G&&((X=(L=G.closest(bl))==null?void 0:L.querySelector($U))==null||X.scrollIntoView({block:"nearest"})),G.scrollIntoView({block:"nearest"}))}function k(){var R;return(R=N.current)==null?void 0:R.querySelector(`${G4}[aria-selected="true"]`)}function $(){var R;return Array.from(((R=N.current)==null?void 0:R.querySelectorAll(Qy))||[])}function M(R){let L=$()[R];L&&C.setState("value",L.getAttribute(Pi))}function _(R){var L;let X=k(),G=$(),te=G.findIndex(ee=>ee===X),re=G[te+R];(L=l.current)!=null&&L.loop&&(re=te+R<0?G[G.length-1]:te+R===G.length?G[0]:G[te+R]),re&&C.setState("value",re.getAttribute(Pi))}function E(R){let L=k(),X=L==null?void 0:L.closest(bl),G;for(;X&&!G;)X=R>0?qU(X,bl):XU(X,bl),G=X==null?void 0:X.querySelector(Qy);G?C.setState("value",G.getAttribute(Pi)):_(R)}let D=()=>M($().length-1),A=R=>{R.preventDefault(),R.metaKey?D():R.altKey?E(1):_(1)},q=R=>{R.preventDefault(),R.metaKey?M(0):R.altKey?E(-1):_(-1)};return m.createElement(kr.div,{ref:t,tabIndex:-1,...g,"cmdk-root":"",onKeyDown:R=>{var L;(L=g.onKeyDown)==null||L.call(g,R);let X=R.nativeEvent.isComposing||R.keyCode===229;if(!(R.defaultPrevented||X))switch(R.key){case"n":case"j":{j&&R.ctrlKey&&A(R);break}case"ArrowDown":{A(R);break}case"p":case"k":{j&&R.ctrlKey&&q(R);break}case"ArrowUp":{q(R);break}case"Home":{R.preventDefault(),M(0);break}case"End":{R.preventDefault(),D();break}case"Enter":{R.preventDefault();let G=k();if(G){let te=new Event(Tg);G.dispatchEvent(te)}}}}},m.createElement("label",{"cmdk-label":"",htmlFor:T.inputId,id:T.labelId,style:QU},c),Nf(e,R=>m.createElement(Q4.Provider,{value:C},m.createElement(Z4.Provider,{value:T},R))))}),LU=m.forwardRef((e,t)=>{var n,s;let r=ws(),i=m.useRef(null),o=m.useContext(K4),l=ed(),c=eC(e),u=(s=(n=c.current)==null?void 0:n.forceMount)!=null?s:o==null?void 0:o.forceMount;hi(()=>{if(!u)return l.item(r,o==null?void 0:o.id)},[u]);let h=tC(r,i,[e.value,e.children,i],e.keywords),d=j0(),f=Nr(S=>S.value&&S.value===h.current),x=Nr(S=>u||l.filter()===!1?!0:S.search?S.filtered.items.get(r)>0:!0);m.useEffect(()=>{let S=i.current;if(!(!S||e.disabled))return S.addEventListener(Tg,b),()=>S.removeEventListener(Tg,b)},[x,e.onSelect,e.disabled]);function b(){var S,C;v(),(C=(S=c.current).onSelect)==null||C.call(S,h.current)}function v(){d.setState("value",h.current,!0)}if(!x)return null;let{disabled:j,value:g,onSelect:y,forceMount:p,keywords:w,...N}=e;return m.createElement(kr.div,{ref:br(i,t),...N,id:r,"cmdk-item":"",role:"option","aria-disabled":!!j,"aria-selected":!!f,"data-disabled":!!j,"data-selected":!!f,onPointerMove:j||l.getDisablePointerSelection()?void 0:v,onClick:j?void 0:b},e.children)}),HU=m.forwardRef((e,t)=>{let{heading:n,children:s,forceMount:r,...i}=e,o=ws(),l=m.useRef(null),c=m.useRef(null),u=ws(),h=ed(),d=Nr(x=>r||h.filter()===!1?!0:x.search?x.filtered.groups.has(o):!0);hi(()=>h.group(o),[]),tC(o,l,[e.value,e.heading,c]);let f=m.useMemo(()=>({id:o,forceMount:r}),[r]);return m.createElement(kr.div,{ref:br(l,t),...i,"cmdk-group":"",role:"presentation",hidden:d?void 0:!0},n&&m.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:u},n),Nf(e,x=>m.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?u:void 0},m.createElement(K4.Provider,{value:f},x))))}),BU=m.forwardRef((e,t)=>{let{alwaysRender:n,...s}=e,r=m.useRef(null),i=Nr(o=>!o.search);return!n&&!i?null:m.createElement(kr.div,{ref:br(r,t),...s,"cmdk-separator":"",role:"separator"})}),VU=m.forwardRef((e,t)=>{let{onValueChange:n,...s}=e,r=e.value!=null,i=j0(),o=Nr(u=>u.search),l=Nr(u=>u.selectedItemId),c=ed();return m.useEffect(()=>{e.value!=null&&i.setState("search",e.value)},[e.value]),m.createElement(kr.input,{ref:t,...s,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":l,id:c.inputId,type:"text",value:r?e.value:o,onChange:u=>{r||i.setState("search",u.target.value),n==null||n(u.target.value)}})}),YU=m.forwardRef((e,t)=>{let{children:n,label:s="Suggestions",...r}=e,i=m.useRef(null),o=m.useRef(null),l=Nr(u=>u.selectedItemId),c=ed();return m.useEffect(()=>{if(o.current&&i.current){let u=o.current,h=i.current,d,f=new ResizeObserver(()=>{d=requestAnimationFrame(()=>{let x=u.offsetHeight;h.style.setProperty("--cmdk-list-height",x.toFixed(1)+"px")})});return f.observe(u),()=>{cancelAnimationFrame(d),f.unobserve(u)}}},[]),m.createElement(kr.div,{ref:br(i,t),...r,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":l,"aria-label":s,id:c.listId},Nf(e,u=>m.createElement("div",{ref:br(o,c.listInnerRef),"cmdk-list-sizer":""},u)))}),FU=m.forwardRef((e,t)=>{let{open:n,onOpenChange:s,overlayClassName:r,contentClassName:i,container:o,...l}=e;return m.createElement(SU,{open:n,onOpenChange:s},m.createElement(CU,{container:o},m.createElement(EU,{"cmdk-overlay":"",className:r}),m.createElement(kU,{"aria-label":e.label,"cmdk-dialog":"",className:i},m.createElement(J4,{ref:t,...l}))))}),IU=m.forwardRef((e,t)=>Nr(n=>n.filtered.count===0)?m.createElement(kr.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),WU=m.forwardRef((e,t)=>{let{progress:n,children:s,label:r="Loading...",...i}=e;return m.createElement(kr.div,{ref:t,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":r},Nf(e,o=>m.createElement("div",{"aria-hidden":!0},o)))}),yl=Object.assign(J4,{List:YU,Item:LU,Input:VU,Group:HU,Separator:BU,Dialog:FU,Empty:IU,Loading:WU});function qU(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function XU(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function eC(e){let t=m.useRef(e);return hi(()=>{t.current=e}),t}var hi=typeof window>"u"?m.useEffect:m.useLayoutEffect;function Li(e){let t=m.useRef();return t.current===void 0&&(t.current=e()),t}function Nr(e){let t=j0(),n=()=>e(t.snapshot());return m.useSyncExternalStore(t.subscribe,n,n)}function tC(e,t,n,s=[]){let r=m.useRef(),i=ed();return hi(()=>{var o;let l=(()=>{var u;for(let h of n){if(typeof h=="string")return h.trim();if(typeof h=="object"&&"current"in h)return h.current?(u=h.current.textContent)==null?void 0:u.trim():r.current}})(),c=s.map(u=>u.trim());i.value(e,l,c),(o=t.current)==null||o.setAttribute(Pi,l),r.current=l}),r}var GU=()=>{let[e,t]=m.useState(),n=Li(()=>new Map);return hi(()=>{n.current.forEach(s=>s()),n.current=new Map},[e]),(s,r)=>{n.current.set(s,r),t({})}};function ZU(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function Nf({asChild:e,children:t},n){return e&&m.isValidElement(t)?m.cloneElement(ZU(t),{ref:t.ref},n(t.props.children)):n(t)}var QU={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function KU({isOpen:e,onClose:t}){const n=Cs(),[s,r]=m.useState(""),[i,o]=m.useState(null);m.useEffect(()=>{(async()=>{try{const x=await(await fetch("/api/plugins")).json();o(x)}catch{}})()},[]);const l=d=>i!=null&&i.plugins?i.plugins.some(f=>f.id===d):!1,h=[{id:"users",title:"Users",description:"Manage users and their accounts",icon:ci,action:()=>n("/users"),category:"Navigation",keywords:["user","account","profile"]},{id:"organizations",title:"Organizations",description:"Manage organizations and teams",icon:Rs,action:()=>n("/organizations"),category:"Navigation",keywords:["org","company","team"],requiresPlugin:"organization",disabled:!l("organization"),disabledMessage:"Enable organization plugin in settings"},{id:"sessions",title:"Sessions",description:"View active user sessions",icon:py,action:()=>n("/sessions"),category:"Navigation",keywords:["session","login","active"]},{id:"tools",title:"Tools",description:"View tools and utilities",icon:AS,action:()=>n("/tools"),category:"Navigation",keywords:["utilities","tools"]},{id:"database",title:"Database",description:"View database and schema",icon:_t,disabled:!0,action:()=>n("/database"),category:"Navigation",keywords:["database","schema"]},{id:"settings",title:"Settings",description:"Configure Better Auth Studio",icon:ho,action:()=>n("/settings"),category:"Navigation",keywords:["config","setup","preferences"]},{id:"dashboard",title:"Dashboard",description:"View overview and statistics",icon:py,action:()=>n("/"),category:"Navigation",keywords:["overview","stats","home"]},{id:"create-user",title:"Create User",description:"Add a new user to the system",icon:vg,action:()=>n("/users"),category:"Actions",keywords:["add","new","register"]},{id:"create-organization",title:"Create Organization",description:"Create a new organization",icon:mr,action:()=>n("/organizations"),category:"Actions",keywords:["add","new","org"],requiresPlugin:"organization",disabled:!l("organization"),disabledMessage:"Enable organization plugin in settings"},{id:"invite-user",title:"Invite User",description:"Send invitation to join organization",icon:hh,action:()=>n("/organizations"),category:"Actions",keywords:["invite","email","send"],requiresPlugin:"organization",disabled:!l("organization"),disabledMessage:"Enable organization plugin in settings"}].filter(d=>{var x;const f=s.toLowerCase();return d.title.toLowerCase().includes(f)||d.description.toLowerCase().includes(f)||((x=d.keywords)==null?void 0:x.some(b=>b.toLowerCase().includes(f)))}).reduce((d,f)=>(d[f.category]||(d[f.category]=[]),d[f.category].push(f),d),{});return m.useEffect(()=>{const d=f=>{(f.metaKey||f.ctrlKey)&&f.key==="k"&&f.preventDefault()};return document.addEventListener("keydown",d),()=>document.removeEventListener("keydown",d)},[]),m.useEffect(()=>{const d=f=>{f.key==="Escape"&&t()};if(e)return document.body.style.overflow="hidden",document.addEventListener("keydown",d),()=>{document.body.style.overflow="unset",document.removeEventListener("keydown",d)}},[e,t]),e?a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-start justify-center pt-[20vh] z-50 overflow-hidden",onClick:t,children:a.jsx("div",{className:"bg-black/90 overflow-hidden border border-white/10 rounded-none w-full max-w-2xl mx-4",onClick:d=>d.stopPropagation(),children:a.jsxs(yl,{className:"p-2",children:[a.jsxs("div",{className:"flex items-center border-b border-dashed border-white/10 px-3 pb-3",children:[a.jsx(li,{className:"w-4 h-4 text-gray-400 mr-3"}),a.jsx(yl.Input,{value:s,onValueChange:r,placeholder:"Search for actions, pages, or commands...",className:"flex-1 placeholder:text-xs bg-transparent text-white placeholder-gray-400 outline-none",autoFocus:!0}),a.jsx("kbd",{className:"hidden sm:inline-flex items-center px-2 py-1 text-xs text-gray-400 border border-dashed border-white/20 rounded-sm",children:"ESC"})]}),a.jsx(yl.List,{className:"max-h-96 overflow-y-auto p-2",children:Object.keys(h).length===0?a.jsxs("div",{className:"text-center py-8 text-gray-400",children:[a.jsx(li,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),a.jsx("p",{children:"No results found"}),a.jsx("p",{className:"text-sm",children:"Try a different search term"})]}):Object.entries(h).map(([d,f])=>a.jsx(yl.Group,{heading:d,className:"text-xs text-gray-400 font-medium mb-4 px-2",children:f.map(x=>{const b=x.icon,v=x.disabled;return a.jsxs(yl.Item,{value:x.id,disabled:v,onSelect:()=>{v||(x.action(),t())},className:`flex items-center space-x-3 px-0 py-2 rounded-none transition-colors relative ${v?"opacity-40 cursor-not-allowed blur-[0.5px]":"hover:bg-white/5 cursor-pointer"}`,children:[a.jsx(b,{className:"w-4 h-4 text-white"}),a.jsxs("div",{className:"flex-1",children:[a.jsxs("div",{className:"text-white text-[13px] font-light flex items-center gap-2",children:[x.title,v&&a.jsx(gu,{className:"w-3 h-3 text-yellow-500"})]}),a.jsx("div",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:v?x.disabledMessage:x.description})]}),!v&&a.jsx(eR,{className:"w-4 h-4 text-gray-400"})]},x.id)})},d))}),a.jsx("div",{className:"border-t border-dashed border-white/10 px-3 py-2 text-xs text-gray-400",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("span",{children:["Press"," ",a.jsx("kbd",{className:"px-1 py-0.5 border border-dashed border-white/20 rounded-sm",children:"↑↓"})," ","to navigate"]}),a.jsxs("span",{children:["Press"," ",a.jsx("kbd",{className:"px-1 py-0.5 border border-dashed border-white/20 rounded-sm",children:"Enter"})," ","to select"]})]})})]})})}):null}const JU={connecting:{label:"Connecting",textClass:"text-amber-200 border-amber-400/40",dotClass:"bg-amber-300",animate:"animate-pulse"},watching:{label:"Watching",textClass:"text-emerald-200 border-emerald-400/40",dotClass:"bg-emerald-300"},refreshing:{label:"Refreshing",textClass:"text-amber-200 border-amber-400/40",dotClass:"bg-amber-300",animate:"animate-pulse"},up_to_date:{label:"Up-to-date",textClass:"text-emerald-200 border-emerald-400/40",dotClass:"bg-emerald-300"},error:{label:"Reload Failed",textClass:"text-red-200 border-red-500/50",dotClass:"bg-red-400",animate:"animate-pulse"},unavailable:{label:"Watch Off",textClass:"text-gray-300 border-gray-500/40",dotClass:"bg-gray-400"},reconnecting:{label:"Reconnecting",textClass:"text-amber-200 border-amber-400/40",dotClass:"bg-amber-300",animate:"animate-pulse"}};function e$(e){switch(e){case"refreshing":return"refreshing";case"error":return"error";case"up_to_date":case"watching":return"up_to_date";default:return"watching"}}function t$({children:e}){const t=Xo(),{counts:n,loading:s}=yf(),r=Cs(),[i,o]=m.useState(!1),[l,c]=m.useState("v1.0.0"),[u,h]=m.useState({status:"connecting"}),d=m.useRef(!1),f=m.useRef(null),x=m.useRef(!1),b=()=>{f.current&&(clearTimeout(f.current),f.current=null)},v=()=>{b(),f.current=setTimeout(()=>{d.current=!1,h(w=>({...w,status:"up_to_date",updatedAt:Date.now()}))},4e3)};m.useEffect(()=>{const w=N=>{(N.metaKey||N.ctrlKey)&&N.key==="k"&&(N.preventDefault(),o(!0))};return document.addEventListener("keydown",w),()=>document.removeEventListener("keydown",w)},[]),m.useEffect(()=>((async()=>{var N;try{const C=await(await fetch("/api/config")).json();(N=C.studio)!=null&&N.version&&c(`v${C.studio.version}`)}catch{}})(),()=>{b()}),[]);const j=()=>{d.current=!1,x.current=!1,b(),h(w=>({...w,status:"refreshing",updatedAt:Date.now()})),window.location.reload()};j4(w=>{if(w.type==="studio_status"){const N=e$(w.status);N==="up_to_date"&&(d.current=!1,b()),h(S=>({status:N,fileName:w.fileName||S.fileName,updatedAt:w.updatedAt||Date.now()}));return}if(w.type==="config_change_detected"){d.current=!0,v(),h(N=>({...N,status:"refreshing",fileName:w.fileName||N.fileName,updatedAt:Date.now()})),x.current||(x.current=!0,setTimeout(()=>{j()},200));return}if(w.type==="config_changed"){d.current=!1,b(),h(N=>({...N,status:"up_to_date",fileName:w.fileName||N.fileName,updatedAt:w.changedAt||Date.now()}));return}w.type==="connected"&&(d.current=!1,b(),h(N=>({...N,status:"up_to_date",updatedAt:Date.now()})))},{onStatusChange:w=>{h(N=>{if(N.status==="refreshing"&&w!=="unavailable"&&w!=="open")return N;switch(w){case"connecting":return{...N,status:"connecting"};case"open":return b(),d.current?N:{...N,status:"watching",updatedAt:Date.now()};case"reconnecting":case"closed":return{...N,status:"reconnecting"};case"error":return{...N,status:"error"};case"unavailable":return d.current=!1,b(),{...N,status:"unavailable"};default:return N}})}});const g=JU[u.status],y=w=>w>=1e3?`${(w/1e3).toFixed(1).replace(/\.0$/,"")}k`:w.toString(),p=[{name:"Dashboard",href:"/",icon:oR},{name:"Users",href:"/users",icon:ci,badge:s?"...":y(n.users)},{name:"Organizations",href:"/organizations",icon:Rs,badge:s?"...":y(n.organizations)},{name:"Database",href:"/database",icon:_t},{name:"Tools",href:"/tools",icon:AS},{name:"Settings",href:"/settings",icon:ho}];return a.jsxs("div",{className:"min-h-screen bg-black",children:[a.jsx("div",{className:"bg-black/70 border-b border-white/15",children:a.jsxs("div",{className:"flex items-center justify-between px-6 py-4",children:[a.jsx("div",{className:"flex items-center space-x-4",children:a.jsxs("div",{className:"flex items-end justify-end space-x-2",children:[a.jsx("div",{className:"w-7 h-7 border border-dashed border-white/20 rounded-lg flex items-center justify-center",children:a.jsx("span",{className:"text-black font-bold text-md",children:"⚡"})}),a.jsx("div",{className:"mb-0 cursor-pointer",onClick:()=>r("/"),children:a.jsxs("h1",{className:"text-md inline-flex mb-0 items-start font-light font-mono uppercase text-white gap-2",children:["Better-Auth Studio",a.jsxs("sup",{className:"text-xs text-gray-400 ml-1 mt-0 flex items-center space-x-2",children:[a.jsxs("span",{className:"inline-flex items-center",children:[a.jsx("span",{className:"mr-1",children:"["}),a.jsx("span",{className:"text-white/80 lowercase font-mono text-xs",children:l}),a.jsx("span",{className:"ml-1",children:"]"})]}),a.jsxs("span",{className:`inline-flex items-center rounded border px-1.5 py-0.5 font-normal uppercase tracking-wide text-[9px] ${g.textClass} ${g.animate??""}`,children:[a.jsx("span",{className:`mr-1 h-1.5 w-1.5 rounded-full ${g.dotClass}`}),g.label]}),a.jsx("button",{type:"button",onClick:j,"aria-label":"Hard refresh studio",className:"ml-1 inline-flex items-center rounded border border-dashed border-white/20 p-0.5 text-white/70 transition hover:text-white hover:border-white/50",children:a.jsx(pg,{className:"h-3.5 w-3.5"})})]})]})})]})}),a.jsxs("div",{className:"flex items-center space-x-4",children:[a.jsxs("div",{className:"relative",children:[a.jsx(li,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-4 h-4"}),a.jsx("input",{type:"text",placeholder:"Search...",onClick:()=>o(!0),className:"pl-10 pr-4 py-2 bg-black border rounded-none border-gray-600 text-white border-dashed border-white/20 focus:ring-2 focus:ring-white focus:border-transparent transition-colors placeholder-gray-400 cursor-pointer",readOnly:!0}),a.jsx("kbd",{className:"absolute right-3 top-1/2 transform -translate-y-1/2 text-xs text-gray-400 border border-dashed border-white/10 rounded-sm px-1.5 py-0.5",children:"⌘ K"})]}),a.jsxs("a",{href:"https://better-auth.com/docs",target:"_blank",rel:"noopener",className:"group flex items-center",children:[a.jsx("span",{className:"text-white/70 text-xs mr-2 transition-colors duration-150 group-hover:text-white group-hover:bg-gray-500/20 rounded px-0.5",children:"["}),a.jsx("span",{className:"text-white/80 font-mono text-sm uppercase",children:"Docs"}),a.jsx("span",{className:"text-white/70 text-xs ml-2 transition-colors duration-150 group-hover:text-white group-hover:bg-gray-500/20 rounded px-0.5",children:"]"})]}),a.jsxs("a",{href:"https://better-auth.com/support",target:"_blank",rel:"noopener",className:"group flex items-center",children:[a.jsx("span",{className:"text-white/70 text-xs mr-2 transition-colors duration-150 group-hover:text-white group-hover:bg-gray-500/20 rounded px-0.5",children:"["}),a.jsx("span",{className:"text-white/80 font-mono text-sm uppercase",children:"Support"}),a.jsx("span",{className:"text-white/70 text-xs ml-2 transition-colors duration-150 group-hover:text-white group-hover:bg-gray-500/20 rounded px-0.5",children:"]"})]})]})]})}),a.jsx("div",{className:"bg-black/50 border-b border-white/10",children:a.jsx("div",{className:"px-6",children:a.jsx("nav",{className:"flex space-x-8",children:p.map(w=>{const N=t.pathname===w.href;return a.jsxs($p,{to:w.href,className:`flex items-center space-x-2 px-3 py-4 text-sm font-medium border-b-2 transition-all duration-200 ${N?"border-white text-white":"border-transparent text-gray-400 hover:text-white hover:border-gray-300"}`,children:[a.jsx(w.icon,{className:"w-4 h-4"}),a.jsxs("span",{className:"inline-flex items-start",children:[w.name,w.badge&&a.jsxs("sup",{className:"text-xs text-gray-500 ml-1",children:[a.jsx("span",{className:"mr-0.5",children:"["}),a.jsx("span",{className:"text-white/80 font-mono text-xs",children:w.badge}),a.jsx("span",{className:"ml-0.5",children:"]"})]})]})]},w.name)})})})}),a.jsx("div",{className:"flex-1 p-0",children:e}),a.jsx(KU,{isOpen:i,onClose:()=>o(!1)})]})}function yh(e){"@babel/helpers - typeof";return yh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yh(e)}function fi(e){if(e===null||e===!0||e===!1)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function mn(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function Js(e){mn(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||yh(e)==="object"&&t==="[object Date]"?new Date(e.getTime()):typeof e=="number"||t==="[object Number]"?new Date(e):((typeof e=="string"||t==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function n$(e,t){mn(2,arguments);var n=Js(e).getTime(),s=fi(t);return new Date(n+s)}var s$={};function Sf(){return s$}function a$(e){var t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),e.getTime()-t.getTime()}function r$(e){return mn(1,arguments),e instanceof Date||yh(e)==="object"&&Object.prototype.toString.call(e)==="[object Date]"}function i$(e){if(mn(1,arguments),!r$(e)&&typeof e!="number")return!1;var t=Js(e);return!isNaN(Number(t))}function o$(e,t){mn(2,arguments);var n=fi(t);return n$(e,-n)}var l$=864e5;function c$(e){mn(1,arguments);var t=Js(e),n=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var s=t.getTime(),r=n-s;return Math.floor(r/l$)+1}function wh(e){mn(1,arguments);var t=1,n=Js(e),s=n.getUTCDay(),r=(s<t?7:0)+s-t;return n.setUTCDate(n.getUTCDate()-r),n.setUTCHours(0,0,0,0),n}function nC(e){mn(1,arguments);var t=Js(e),n=t.getUTCFullYear(),s=new Date(0);s.setUTCFullYear(n+1,0,4),s.setUTCHours(0,0,0,0);var r=wh(s),i=new Date(0);i.setUTCFullYear(n,0,4),i.setUTCHours(0,0,0,0);var o=wh(i);return t.getTime()>=r.getTime()?n+1:t.getTime()>=o.getTime()?n:n-1}function d$(e){mn(1,arguments);var t=nC(e),n=new Date(0);n.setUTCFullYear(t,0,4),n.setUTCHours(0,0,0,0);var s=wh(n);return s}var u$=6048e5;function h$(e){mn(1,arguments);var t=Js(e),n=wh(t).getTime()-d$(t).getTime();return Math.round(n/u$)+1}function jh(e,t){var n,s,r,i,o,l,c,u;mn(1,arguments);var h=Sf(),d=fi((n=(s=(r=(i=t==null?void 0:t.weekStartsOn)!==null&&i!==void 0?i:t==null||(o=t.locale)===null||o===void 0||(l=o.options)===null||l===void 0?void 0:l.weekStartsOn)!==null&&r!==void 0?r:h.weekStartsOn)!==null&&s!==void 0?s:(c=h.locale)===null||c===void 0||(u=c.options)===null||u===void 0?void 0:u.weekStartsOn)!==null&&n!==void 0?n:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var f=Js(e),x=f.getUTCDay(),b=(x<d?7:0)+x-d;return f.setUTCDate(f.getUTCDate()-b),f.setUTCHours(0,0,0,0),f}function sC(e,t){var n,s,r,i,o,l,c,u;mn(1,arguments);var h=Js(e),d=h.getUTCFullYear(),f=Sf(),x=fi((n=(s=(r=(i=t==null?void 0:t.firstWeekContainsDate)!==null&&i!==void 0?i:t==null||(o=t.locale)===null||o===void 0||(l=o.options)===null||l===void 0?void 0:l.firstWeekContainsDate)!==null&&r!==void 0?r:f.firstWeekContainsDate)!==null&&s!==void 0?s:(c=f.locale)===null||c===void 0||(u=c.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&n!==void 0?n:1);if(!(x>=1&&x<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var b=new Date(0);b.setUTCFullYear(d+1,0,x),b.setUTCHours(0,0,0,0);var v=jh(b,t),j=new Date(0);j.setUTCFullYear(d,0,x),j.setUTCHours(0,0,0,0);var g=jh(j,t);return h.getTime()>=v.getTime()?d+1:h.getTime()>=g.getTime()?d:d-1}function f$(e,t){var n,s,r,i,o,l,c,u;mn(1,arguments);var h=Sf(),d=fi((n=(s=(r=(i=t==null?void 0:t.firstWeekContainsDate)!==null&&i!==void 0?i:t==null||(o=t.locale)===null||o===void 0||(l=o.options)===null||l===void 0?void 0:l.firstWeekContainsDate)!==null&&r!==void 0?r:h.firstWeekContainsDate)!==null&&s!==void 0?s:(c=h.locale)===null||c===void 0||(u=c.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&n!==void 0?n:1),f=sC(e,t),x=new Date(0);x.setUTCFullYear(f,0,d),x.setUTCHours(0,0,0,0);var b=jh(x,t);return b}var m$=6048e5;function x$(e,t){mn(1,arguments);var n=Js(e),s=jh(n,t).getTime()-f$(n,t).getTime();return Math.round(s/m$)+1}function nt(e,t){for(var n=e<0?"-":"",s=Math.abs(e).toString();s.length<t;)s="0"+s;return n+s}var Ha={y:function(t,n){var s=t.getUTCFullYear(),r=s>0?s:1-s;return nt(n==="yy"?r%100:r,n.length)},M:function(t,n){var s=t.getUTCMonth();return n==="M"?String(s+1):nt(s+1,2)},d:function(t,n){return nt(t.getUTCDate(),n.length)},a:function(t,n){var s=t.getUTCHours()/12>=1?"pm":"am";switch(n){case"a":case"aa":return s.toUpperCase();case"aaa":return s;case"aaaaa":return s[0];case"aaaa":default:return s==="am"?"a.m.":"p.m."}},h:function(t,n){return nt(t.getUTCHours()%12||12,n.length)},H:function(t,n){return nt(t.getUTCHours(),n.length)},m:function(t,n){return nt(t.getUTCMinutes(),n.length)},s:function(t,n){return nt(t.getUTCSeconds(),n.length)},S:function(t,n){var s=n.length,r=t.getUTCMilliseconds(),i=Math.floor(r*Math.pow(10,s-3));return nt(i,n.length)}},Ai={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},g$={G:function(t,n,s){var r=t.getUTCFullYear()>0?1:0;switch(n){case"G":case"GG":case"GGG":return s.era(r,{width:"abbreviated"});case"GGGGG":return s.era(r,{width:"narrow"});case"GGGG":default:return s.era(r,{width:"wide"})}},y:function(t,n,s){if(n==="yo"){var r=t.getUTCFullYear(),i=r>0?r:1-r;return s.ordinalNumber(i,{unit:"year"})}return Ha.y(t,n)},Y:function(t,n,s,r){var i=sC(t,r),o=i>0?i:1-i;if(n==="YY"){var l=o%100;return nt(l,2)}return n==="Yo"?s.ordinalNumber(o,{unit:"year"}):nt(o,n.length)},R:function(t,n){var s=nC(t);return nt(s,n.length)},u:function(t,n){var s=t.getUTCFullYear();return nt(s,n.length)},Q:function(t,n,s){var r=Math.ceil((t.getUTCMonth()+1)/3);switch(n){case"Q":return String(r);case"QQ":return nt(r,2);case"Qo":return s.ordinalNumber(r,{unit:"quarter"});case"QQQ":return s.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return s.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return s.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,n,s){var r=Math.ceil((t.getUTCMonth()+1)/3);switch(n){case"q":return String(r);case"qq":return nt(r,2);case"qo":return s.ordinalNumber(r,{unit:"quarter"});case"qqq":return s.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return s.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return s.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,n,s){var r=t.getUTCMonth();switch(n){case"M":case"MM":return Ha.M(t,n);case"Mo":return s.ordinalNumber(r+1,{unit:"month"});case"MMM":return s.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return s.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return s.month(r,{width:"wide",context:"formatting"})}},L:function(t,n,s){var r=t.getUTCMonth();switch(n){case"L":return String(r+1);case"LL":return nt(r+1,2);case"Lo":return s.ordinalNumber(r+1,{unit:"month"});case"LLL":return s.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return s.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return s.month(r,{width:"wide",context:"standalone"})}},w:function(t,n,s,r){var i=x$(t,r);return n==="wo"?s.ordinalNumber(i,{unit:"week"}):nt(i,n.length)},I:function(t,n,s){var r=h$(t);return n==="Io"?s.ordinalNumber(r,{unit:"week"}):nt(r,n.length)},d:function(t,n,s){return n==="do"?s.ordinalNumber(t.getUTCDate(),{unit:"date"}):Ha.d(t,n)},D:function(t,n,s){var r=c$(t);return n==="Do"?s.ordinalNumber(r,{unit:"dayOfYear"}):nt(r,n.length)},E:function(t,n,s){var r=t.getUTCDay();switch(n){case"E":case"EE":case"EEE":return s.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return s.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return s.day(r,{width:"short",context:"formatting"});case"EEEE":default:return s.day(r,{width:"wide",context:"formatting"})}},e:function(t,n,s,r){var i=t.getUTCDay(),o=(i-r.weekStartsOn+8)%7||7;switch(n){case"e":return String(o);case"ee":return nt(o,2);case"eo":return s.ordinalNumber(o,{unit:"day"});case"eee":return s.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return s.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return s.day(i,{width:"short",context:"formatting"});case"eeee":default:return s.day(i,{width:"wide",context:"formatting"})}},c:function(t,n,s,r){var i=t.getUTCDay(),o=(i-r.weekStartsOn+8)%7||7;switch(n){case"c":return String(o);case"cc":return nt(o,n.length);case"co":return s.ordinalNumber(o,{unit:"day"});case"ccc":return s.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return s.day(i,{width:"narrow",context:"standalone"});case"cccccc":return s.day(i,{width:"short",context:"standalone"});case"cccc":default:return s.day(i,{width:"wide",context:"standalone"})}},i:function(t,n,s){var r=t.getUTCDay(),i=r===0?7:r;switch(n){case"i":return String(i);case"ii":return nt(i,n.length);case"io":return s.ordinalNumber(i,{unit:"day"});case"iii":return s.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return s.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return s.day(r,{width:"short",context:"formatting"});case"iiii":default:return s.day(r,{width:"wide",context:"formatting"})}},a:function(t,n,s){var r=t.getUTCHours(),i=r/12>=1?"pm":"am";switch(n){case"a":case"aa":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return s.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return s.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(t,n,s){var r=t.getUTCHours(),i;switch(r===12?i=Ai.noon:r===0?i=Ai.midnight:i=r/12>=1?"pm":"am",n){case"b":case"bb":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return s.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return s.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(t,n,s){var r=t.getUTCHours(),i;switch(r>=17?i=Ai.evening:r>=12?i=Ai.afternoon:r>=4?i=Ai.morning:i=Ai.night,n){case"B":case"BB":case"BBB":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return s.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return s.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(t,n,s){if(n==="ho"){var r=t.getUTCHours()%12;return r===0&&(r=12),s.ordinalNumber(r,{unit:"hour"})}return Ha.h(t,n)},H:function(t,n,s){return n==="Ho"?s.ordinalNumber(t.getUTCHours(),{unit:"hour"}):Ha.H(t,n)},K:function(t,n,s){var r=t.getUTCHours()%12;return n==="Ko"?s.ordinalNumber(r,{unit:"hour"}):nt(r,n.length)},k:function(t,n,s){var r=t.getUTCHours();return r===0&&(r=24),n==="ko"?s.ordinalNumber(r,{unit:"hour"}):nt(r,n.length)},m:function(t,n,s){return n==="mo"?s.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):Ha.m(t,n)},s:function(t,n,s){return n==="so"?s.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):Ha.s(t,n)},S:function(t,n){return Ha.S(t,n)},X:function(t,n,s,r){var i=r._originalDate||t,o=i.getTimezoneOffset();if(o===0)return"Z";switch(n){case"X":return Jy(o);case"XXXX":case"XX":return Pr(o);case"XXXXX":case"XXX":default:return Pr(o,":")}},x:function(t,n,s,r){var i=r._originalDate||t,o=i.getTimezoneOffset();switch(n){case"x":return Jy(o);case"xxxx":case"xx":return Pr(o);case"xxxxx":case"xxx":default:return Pr(o,":")}},O:function(t,n,s,r){var i=r._originalDate||t,o=i.getTimezoneOffset();switch(n){case"O":case"OO":case"OOO":return"GMT"+Ky(o,":");case"OOOO":default:return"GMT"+Pr(o,":")}},z:function(t,n,s,r){var i=r._originalDate||t,o=i.getTimezoneOffset();switch(n){case"z":case"zz":case"zzz":return"GMT"+Ky(o,":");case"zzzz":default:return"GMT"+Pr(o,":")}},t:function(t,n,s,r){var i=r._originalDate||t,o=Math.floor(i.getTime()/1e3);return nt(o,n.length)},T:function(t,n,s,r){var i=r._originalDate||t,o=i.getTime();return nt(o,n.length)}};function Ky(e,t){var n=e>0?"-":"+",s=Math.abs(e),r=Math.floor(s/60),i=s%60;if(i===0)return n+String(r);var o=t;return n+String(r)+o+nt(i,2)}function Jy(e,t){if(e%60===0){var n=e>0?"-":"+";return n+nt(Math.abs(e)/60,2)}return Pr(e,t)}function Pr(e,t){var n=t||"",s=e>0?"-":"+",r=Math.abs(e),i=nt(Math.floor(r/60),2),o=nt(r%60,2);return s+i+n+o}var ew=function(t,n){switch(t){case"P":return n.date({width:"short"});case"PP":return n.date({width:"medium"});case"PPP":return n.date({width:"long"});case"PPPP":default:return n.date({width:"full"})}},aC=function(t,n){switch(t){case"p":return n.time({width:"short"});case"pp":return n.time({width:"medium"});case"ppp":return n.time({width:"long"});case"pppp":default:return n.time({width:"full"})}},p$=function(t,n){var s=t.match(/(P+)(p+)?/)||[],r=s[1],i=s[2];if(!i)return ew(t,n);var o;switch(r){case"P":o=n.dateTime({width:"short"});break;case"PP":o=n.dateTime({width:"medium"});break;case"PPP":o=n.dateTime({width:"long"});break;case"PPPP":default:o=n.dateTime({width:"full"});break}return o.replace("{{date}}",ew(r,n)).replace("{{time}}",aC(i,n))},v$={p:aC,P:p$},b$=["D","DD"],y$=["YY","YYYY"];function w$(e){return b$.indexOf(e)!==-1}function j$(e){return y$.indexOf(e)!==-1}function tw(e,t,n){if(e==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var N$={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"}},S$=function(t,n,s){var r,i=N$[t];return typeof i=="string"?r=i:n===1?r=i.one:r=i.other.replace("{{count}}",n.toString()),s!=null&&s.addSuffix?s.comparison&&s.comparison>0?"in "+r:r+" ago":r};function Im(e){return function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.width?String(t.width):e.defaultWidth,s=e.formats[n]||e.formats[e.defaultWidth];return s}}var C$={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},E$={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},k$={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},M$={date:Im({formats:C$,defaultWidth:"full"}),time:Im({formats:E$,defaultWidth:"full"}),dateTime:Im({formats:k$,defaultWidth:"full"})},T$={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},D$=function(t,n,s,r){return T$[t]};function wl(e){return function(t,n){var s=n!=null&&n.context?String(n.context):"standalone",r;if(s==="formatting"&&e.formattingValues){var i=e.defaultFormattingWidth||e.defaultWidth,o=n!=null&&n.width?String(n.width):i;r=e.formattingValues[o]||e.formattingValues[i]}else{var l=e.defaultWidth,c=n!=null&&n.width?String(n.width):e.defaultWidth;r=e.values[c]||e.values[l]}var u=e.argumentCallback?e.argumentCallback(t):t;return r[u]}}var _$={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},A$={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},O$={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"]},z$={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"]},R$={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"}},U$={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"}},$$=function(t,n){var s=Number(t),r=s%100;if(r>20||r<10)switch(r%10){case 1:return s+"st";case 2:return s+"nd";case 3:return s+"rd"}return s+"th"},P$={ordinalNumber:$$,era:wl({values:_$,defaultWidth:"wide"}),quarter:wl({values:A$,defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:wl({values:O$,defaultWidth:"wide"}),day:wl({values:z$,defaultWidth:"wide"}),dayPeriod:wl({values:R$,defaultWidth:"wide",formattingValues:U$,defaultFormattingWidth:"wide"})};function jl(e){return function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=n.width,r=s&&e.matchPatterns[s]||e.matchPatterns[e.defaultMatchWidth],i=t.match(r);if(!i)return null;var o=i[0],l=s&&e.parsePatterns[s]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(l)?H$(l,function(d){return d.test(o)}):L$(l,function(d){return d.test(o)}),u;u=e.valueCallback?e.valueCallback(c):c,u=n.valueCallback?n.valueCallback(u):u;var h=t.slice(o.length);return{value:u,rest:h}}}function L$(e,t){for(var n in e)if(e.hasOwnProperty(n)&&t(e[n]))return n}function H$(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return n}function B$(e){return function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=t.match(e.matchPattern);if(!s)return null;var r=s[0],i=t.match(e.parsePattern);if(!i)return null;var o=e.valueCallback?e.valueCallback(i[0]):i[0];o=n.valueCallback?n.valueCallback(o):o;var l=t.slice(r.length);return{value:o,rest:l}}}var V$=/^(\d+)(th|st|nd|rd)?/i,Y$=/\d+/i,F$={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},I$={any:[/^b/i,/^(a|c)/i]},W$={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},q$={any:[/1/i,/2/i,/3/i,/4/i]},X$={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},G$={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]},Z$={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},Q$={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]},K$={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},J$={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}},eP={ordinalNumber:B$({matchPattern:V$,parsePattern:Y$,valueCallback:function(t){return parseInt(t,10)}}),era:jl({matchPatterns:F$,defaultMatchWidth:"wide",parsePatterns:I$,defaultParseWidth:"any"}),quarter:jl({matchPatterns:W$,defaultMatchWidth:"wide",parsePatterns:q$,defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:jl({matchPatterns:X$,defaultMatchWidth:"wide",parsePatterns:G$,defaultParseWidth:"any"}),day:jl({matchPatterns:Z$,defaultMatchWidth:"wide",parsePatterns:Q$,defaultParseWidth:"any"}),dayPeriod:jl({matchPatterns:K$,defaultMatchWidth:"any",parsePatterns:J$,defaultParseWidth:"any"})},tP={code:"en-US",formatDistance:S$,formatLong:M$,formatRelative:D$,localize:P$,match:eP,options:{weekStartsOn:0,firstWeekContainsDate:1}},nP=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,sP=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,aP=/^'([^]*?)'?$/,rP=/''/g,iP=/[a-zA-Z]/;function Zn(e,t,n){var s,r,i,o,l,c,u,h,d,f,x,b,v,j;mn(2,arguments);var g=String(t),y=Sf(),p=(s=(r=void 0)!==null&&r!==void 0?r:y.locale)!==null&&s!==void 0?s:tP,w=fi((i=(o=(l=(c=void 0)!==null&&c!==void 0?c:void 0)!==null&&l!==void 0?l:y.firstWeekContainsDate)!==null&&o!==void 0?o:(u=y.locale)===null||u===void 0||(h=u.options)===null||h===void 0?void 0:h.firstWeekContainsDate)!==null&&i!==void 0?i:1);if(!(w>=1&&w<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var N=fi((d=(f=(x=(b=void 0)!==null&&b!==void 0?b:void 0)!==null&&x!==void 0?x:y.weekStartsOn)!==null&&f!==void 0?f:(v=y.locale)===null||v===void 0||(j=v.options)===null||j===void 0?void 0:j.weekStartsOn)!==null&&d!==void 0?d:0);if(!(N>=0&&N<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!p.localize)throw new RangeError("locale must contain localize property");if(!p.formatLong)throw new RangeError("locale must contain formatLong property");var S=Js(e);if(!i$(S))throw new RangeError("Invalid time value");var C=a$(S),T=o$(S,C),U={firstWeekContainsDate:w,weekStartsOn:N,locale:p,_originalDate:S},B=g.match(sP).map(function(P){var z=P[0];if(z==="p"||z==="P"){var Y=v$[z];return Y(P,p.formatLong)}return P}).join("").match(nP).map(function(P){if(P==="''")return"'";var z=P[0];if(z==="'")return oP(P);var Y=g$[z];if(Y)return j$(P)&&tw(P,t,String(e)),w$(P)&&tw(P,t,String(e)),Y(T,P,p.localize,U);if(z.match(iP))throw new RangeError("Format string contains an unescaped latin alphabet character `"+z+"`");return P}).join("");return B}function oP(e){var t=e.match(aP);return t?t[1].replace(rP,"'"):e}const nw=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,sw=fh,rC=(e,t)=>n=>{var s;if((t==null?void 0:t.variants)==null)return sw(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:r,defaultVariants:i}=t,o=Object.keys(r).map(u=>{const h=n==null?void 0:n[u],d=i==null?void 0:i[u];if(h===null)return null;const f=nw(h)||nw(d);return r[u][f]}),l=n&&Object.entries(n).reduce((u,h)=>{let[d,f]=h;return f===void 0||(u[d]=f),u},{}),c=t==null||(s=t.compoundVariants)===null||s===void 0?void 0:s.reduce((u,h)=>{let{class:d,className:f,...x}=h;return Object.entries(x).every(b=>{let[v,j]=b;return Array.isArray(j)?j.includes({...i,...l}[v]):{...i,...l}[v]===j})?[...u,d,f]:u},[]);return sw(e,o,c,n==null?void 0:n.class,n==null?void 0:n.className)},Dg=rC("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),W=m.forwardRef(({className:e,variant:t,size:n,asChild:s=!1,...r},i)=>{const o=s?DU:"button";return a.jsx(o,{className:_e(Dg({variant:t,size:n,className:e})),ref:i,...r})});W.displayName="Button";function lP(e,t,n="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:e,timeZoneName:n}).format(t).split(/\s/g).slice(2).join(" ")}const Wm={},zl={};function Vr(e,t){try{const s=(Wm[e]||(Wm[e]=new Intl.DateTimeFormat("en-US",{timeZone:e,timeZoneName:"longOffset"}).format))(t).split("GMT")[1];return s in zl?zl[s]:aw(s,s.split(":"))}catch{if(e in zl)return zl[e];const n=e==null?void 0:e.match(cP);return n?aw(e,n.slice(1)):NaN}}const cP=/([+-]\d\d):?(\d\d)?/;function aw(e,t){const n=+(t[0]||0),s=+(t[1]||0),r=+(t[2]||0)/60;return zl[e]=n*60+s>0?n*60+s+r:n*60-s-r}class Bs extends Date{constructor(...t){super(),t.length>1&&typeof t[t.length-1]=="string"&&(this.timeZone=t.pop()),this.internal=new Date,isNaN(Vr(this.timeZone,this))?this.setTime(NaN):t.length?typeof t[0]=="number"&&(t.length===1||t.length===2&&typeof t[1]!="number")?this.setTime(t[0]):typeof t[0]=="string"?this.setTime(+new Date(t[0])):t[0]instanceof Date?this.setTime(+t[0]):(this.setTime(+new Date(...t)),iC(this),_g(this)):this.setTime(Date.now())}static tz(t,...n){return n.length?new Bs(...n,t):new Bs(Date.now(),t)}withTimeZone(t){return new Bs(+this,t)}getTimezoneOffset(){const t=-Vr(this.timeZone,this);return t>0?Math.floor(t):Math.ceil(t)}setTime(t){return Date.prototype.setTime.apply(this,arguments),_g(this),+this}[Symbol.for("constructDateFrom")](t){return new Bs(+new Date(t),this.timeZone)}}const rw=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!rw.test(e))return;const t=e.replace(rw,"$1UTC");Bs.prototype[t]&&(e.startsWith("get")?Bs.prototype[e]=function(){return this.internal[t]()}:(Bs.prototype[e]=function(){return Date.prototype[t].apply(this.internal,arguments),dP(this),+this},Bs.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),_g(this),+this}))});function _g(e){e.internal.setTime(+e),e.internal.setUTCSeconds(e.internal.getUTCSeconds()-Math.round(-Vr(e.timeZone,e)*60))}function dP(e){Date.prototype.setFullYear.call(e,e.internal.getUTCFullYear(),e.internal.getUTCMonth(),e.internal.getUTCDate()),Date.prototype.setHours.call(e,e.internal.getUTCHours(),e.internal.getUTCMinutes(),e.internal.getUTCSeconds(),e.internal.getUTCMilliseconds()),iC(e)}function iC(e){const t=Vr(e.timeZone,e),n=t>0?Math.floor(t):Math.ceil(t),s=new Date(+e);s.setUTCHours(s.getUTCHours()-1);const r=-new Date(+e).getTimezoneOffset(),i=-new Date(+s).getTimezoneOffset(),o=r-i,l=Date.prototype.getHours.apply(e)!==e.internal.getUTCHours();o&&l&&e.internal.setUTCMinutes(e.internal.getUTCMinutes()+o);const c=r-n;c&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+c);const u=new Date(+e);u.setUTCSeconds(0);const h=r>0?u.getSeconds():(u.getSeconds()-60)%60,d=Math.round(-(Vr(e.timeZone,e)*60))%60;(d||h)&&(e.internal.setUTCSeconds(e.internal.getUTCSeconds()+d),Date.prototype.setUTCSeconds.call(e,Date.prototype.getUTCSeconds.call(e)+d+h));const f=Vr(e.timeZone,e),x=f>0?Math.floor(f):Math.ceil(f),v=-new Date(+e).getTimezoneOffset()-x,j=x!==n,g=v-c;if(j&&g){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+g);const y=Vr(e.timeZone,e),p=y>0?Math.floor(y):Math.ceil(y),w=x-p;w&&(e.internal.setUTCMinutes(e.internal.getUTCMinutes()+w),Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+w))}}class rn extends Bs{static tz(t,...n){return n.length?new rn(...n,t):new rn(Date.now(),t)}toISOString(){const[t,n,s]=this.tzComponents(),r=`${t}${n}:${s}`;return this.internal.toISOString().slice(0,-1)+r}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[t,n,s,r]=this.internal.toUTCString().split(" ");return`${t==null?void 0:t.slice(0,-1)} ${s} ${n} ${r}`}toTimeString(){const t=this.internal.toUTCString().split(" ")[4],[n,s,r]=this.tzComponents();return`${t} GMT${n}${s}${r} (${lP(this.timeZone,this)})`}toLocaleString(t,n){return Date.prototype.toLocaleString.call(this,t,{...n,timeZone:(n==null?void 0:n.timeZone)||this.timeZone})}toLocaleDateString(t,n){return Date.prototype.toLocaleDateString.call(this,t,{...n,timeZone:(n==null?void 0:n.timeZone)||this.timeZone})}toLocaleTimeString(t,n){return Date.prototype.toLocaleTimeString.call(this,t,{...n,timeZone:(n==null?void 0:n.timeZone)||this.timeZone})}tzComponents(){const t=this.getTimezoneOffset(),n=t>0?"-":"+",s=String(Math.floor(Math.abs(t)/60)).padStart(2,"0"),r=String(Math.abs(t)%60).padStart(2,"0");return[n,s,r]}withTimeZone(t){return new rn(+this,t)}[Symbol.for("constructDateFrom")](t){return new rn(+new Date(t),this.timeZone)}}const oC=6048e5,uP=864e5,iw=Symbol.for("constructDateFrom");function Lt(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&iw in e?e[iw](t):e instanceof Date?new e.constructor(t):new Date(t)}function lt(e,t){return Lt(t||e,e)}function lC(e,t,n){const s=lt(e,n==null?void 0:n.in);return isNaN(t)?Lt(e,NaN):(t&&s.setDate(s.getDate()+t),s)}function cC(e,t,n){const s=lt(e,n==null?void 0:n.in);if(isNaN(t))return Lt(e,NaN);if(!t)return s;const r=s.getDate(),i=Lt(e,s.getTime());i.setMonth(s.getMonth()+t+1,0);const o=i.getDate();return r>=o?i:(s.setFullYear(i.getFullYear(),i.getMonth(),r),s)}let hP={};function td(){return hP}function Po(e,t){var l,c,u,h;const n=td(),s=(t==null?void 0:t.weekStartsOn)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.weekStartsOn)??n.weekStartsOn??((h=(u=n.locale)==null?void 0:u.options)==null?void 0:h.weekStartsOn)??0,r=lt(e,t==null?void 0:t.in),i=r.getDay(),o=(i<s?7:0)+i-s;return r.setDate(r.getDate()-o),r.setHours(0,0,0,0),r}function Mc(e,t){return Po(e,{...t,weekStartsOn:1})}function dC(e,t){const n=lt(e,t==null?void 0:t.in),s=n.getFullYear(),r=Lt(n,0);r.setFullYear(s+1,0,4),r.setHours(0,0,0,0);const i=Mc(r),o=Lt(n,0);o.setFullYear(s,0,4),o.setHours(0,0,0,0);const l=Mc(o);return n.getTime()>=i.getTime()?s+1:n.getTime()>=l.getTime()?s:s-1}function ow(e){const t=lt(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function Jo(e,...t){const n=Lt.bind(null,t.find(s=>typeof s=="object"));return t.map(n)}function Tc(e,t){const n=lt(e,t==null?void 0:t.in);return n.setHours(0,0,0,0),n}function uC(e,t,n){const[s,r]=Jo(n==null?void 0:n.in,e,t),i=Tc(s),o=Tc(r),l=+i-ow(i),c=+o-ow(o);return Math.round((l-c)/uP)}function fP(e,t){const n=dC(e,t),s=Lt(e,0);return s.setFullYear(n,0,4),s.setHours(0,0,0,0),Mc(s)}function mP(e,t,n){return lC(e,t*7,n)}function xP(e,t,n){return cC(e,t*12,n)}function gP(e,t){let n,s=t==null?void 0:t.in;return e.forEach(r=>{!s&&typeof r=="object"&&(s=Lt.bind(null,r));const i=lt(r,s);(!n||n<i||isNaN(+i))&&(n=i)}),Lt(s,n||NaN)}function pP(e,t){let n,s=t==null?void 0:t.in;return e.forEach(r=>{!s&&typeof r=="object"&&(s=Lt.bind(null,r));const i=lt(r,s);(!n||n>i||isNaN(+i))&&(n=i)}),Lt(s,n||NaN)}function vP(e,t,n){const[s,r]=Jo(n==null?void 0:n.in,e,t);return+Tc(s)==+Tc(r)}function hC(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function bP(e){return!(!hC(e)&&typeof e!="number"||isNaN(+lt(e)))}function yP(e,t,n){const[s,r]=Jo(n==null?void 0:n.in,e,t),i=s.getFullYear()-r.getFullYear(),o=s.getMonth()-r.getMonth();return i*12+o}function wP(e,t){const n=lt(e,t==null?void 0:t.in),s=n.getMonth();return n.setFullYear(n.getFullYear(),s+1,0),n.setHours(23,59,59,999),n}function fC(e,t){const[n,s]=Jo(e,t.start,t.end);return{start:n,end:s}}function jP(e,t){const{start:n,end:s}=fC(t==null?void 0:t.in,e);let r=+n>+s;const i=r?+n:+s,o=r?s:n;o.setHours(0,0,0,0),o.setDate(1);let l=1;const c=[];for(;+o<=i;)c.push(Lt(n,o)),o.setMonth(o.getMonth()+l);return r?c.reverse():c}function NP(e,t){const n=lt(e,t==null?void 0:t.in);return n.setDate(1),n.setHours(0,0,0,0),n}function SP(e,t){const n=lt(e,t==null?void 0:t.in),s=n.getFullYear();return n.setFullYear(s+1,0,0),n.setHours(23,59,59,999),n}function mC(e,t){const n=lt(e,t==null?void 0:t.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function CP(e,t){const{start:n,end:s}=fC(t==null?void 0:t.in,e);let r=+n>+s;const i=r?+n:+s,o=r?s:n;o.setHours(0,0,0,0),o.setMonth(0,1);let l=1;const c=[];for(;+o<=i;)c.push(Lt(n,o)),o.setFullYear(o.getFullYear()+l);return r?c.reverse():c}function xC(e,t){var l,c,u,h;const n=td(),s=(t==null?void 0:t.weekStartsOn)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.weekStartsOn)??n.weekStartsOn??((h=(u=n.locale)==null?void 0:u.options)==null?void 0:h.weekStartsOn)??0,r=lt(e,t==null?void 0:t.in),i=r.getDay(),o=(i<s?-7:0)+6-(i-s);return r.setDate(r.getDate()+o),r.setHours(23,59,59,999),r}function EP(e,t){return xC(e,{...t,weekStartsOn:1})}const kP={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"}},MP=(e,t,n)=>{let s;const r=kP[e];return typeof r=="string"?s=r:t===1?s=r.one:s=r.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+s:s+" ago":s};function qm(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const TP={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},DP={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},_P={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},AP={date:qm({formats:TP,defaultWidth:"full"}),time:qm({formats:DP,defaultWidth:"full"}),dateTime:qm({formats:_P,defaultWidth:"full"})},OP={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},zP=(e,t,n,s)=>OP[e];function Nl(e){return(t,n)=>{const s=n!=null&&n.context?String(n.context):"standalone";let r;if(s==="formatting"&&e.formattingValues){const o=e.defaultFormattingWidth||e.defaultWidth,l=n!=null&&n.width?String(n.width):o;r=e.formattingValues[l]||e.formattingValues[o]}else{const o=e.defaultWidth,l=n!=null&&n.width?String(n.width):e.defaultWidth;r=e.values[l]||e.values[o]}const i=e.argumentCallback?e.argumentCallback(t):t;return r[i]}}const RP={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},UP={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},$P={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"]},PP={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"]},LP={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"}},HP={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"}},BP=(e,t)=>{const n=Number(e),s=n%100;if(s>20||s<10)switch(s%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},VP={ordinalNumber:BP,era:Nl({values:RP,defaultWidth:"wide"}),quarter:Nl({values:UP,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Nl({values:$P,defaultWidth:"wide"}),day:Nl({values:PP,defaultWidth:"wide"}),dayPeriod:Nl({values:LP,defaultWidth:"wide",formattingValues:HP,defaultFormattingWidth:"wide"})};function Sl(e){return(t,n={})=>{const s=n.width,r=s&&e.matchPatterns[s]||e.matchPatterns[e.defaultMatchWidth],i=t.match(r);if(!i)return null;const o=i[0],l=s&&e.parsePatterns[s]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(l)?FP(l,d=>d.test(o)):YP(l,d=>d.test(o));let u;u=e.valueCallback?e.valueCallback(c):c,u=n.valueCallback?n.valueCallback(u):u;const h=t.slice(o.length);return{value:u,rest:h}}}function YP(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function FP(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function IP(e){return(t,n={})=>{const s=t.match(e.matchPattern);if(!s)return null;const r=s[0],i=t.match(e.parsePattern);if(!i)return null;let o=e.valueCallback?e.valueCallback(i[0]):i[0];o=n.valueCallback?n.valueCallback(o):o;const l=t.slice(r.length);return{value:o,rest:l}}}const WP=/^(\d+)(th|st|nd|rd)?/i,qP=/\d+/i,XP={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},GP={any:[/^b/i,/^(a|c)/i]},ZP={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},QP={any:[/1/i,/2/i,/3/i,/4/i]},KP={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},JP={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]},eL={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},tL={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]},nL={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},sL={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}},aL={ordinalNumber:IP({matchPattern:WP,parsePattern:qP,valueCallback:e=>parseInt(e,10)}),era:Sl({matchPatterns:XP,defaultMatchWidth:"wide",parsePatterns:GP,defaultParseWidth:"any"}),quarter:Sl({matchPatterns:ZP,defaultMatchWidth:"wide",parsePatterns:QP,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Sl({matchPatterns:KP,defaultMatchWidth:"wide",parsePatterns:JP,defaultParseWidth:"any"}),day:Sl({matchPatterns:eL,defaultMatchWidth:"wide",parsePatterns:tL,defaultParseWidth:"any"}),dayPeriod:Sl({matchPatterns:nL,defaultMatchWidth:"any",parsePatterns:sL,defaultParseWidth:"any"})},N0={code:"en-US",formatDistance:MP,formatLong:AP,formatRelative:zP,localize:VP,match:aL,options:{weekStartsOn:0,firstWeekContainsDate:1}};function rL(e,t){const n=lt(e,t==null?void 0:t.in);return uC(n,mC(n))+1}function gC(e,t){const n=lt(e,t==null?void 0:t.in),s=+Mc(n)-+fP(n);return Math.round(s/oC)+1}function pC(e,t){var h,d,f,x;const n=lt(e,t==null?void 0:t.in),s=n.getFullYear(),r=td(),i=(t==null?void 0:t.firstWeekContainsDate)??((d=(h=t==null?void 0:t.locale)==null?void 0:h.options)==null?void 0:d.firstWeekContainsDate)??r.firstWeekContainsDate??((x=(f=r.locale)==null?void 0:f.options)==null?void 0:x.firstWeekContainsDate)??1,o=Lt((t==null?void 0:t.in)||e,0);o.setFullYear(s+1,0,i),o.setHours(0,0,0,0);const l=Po(o,t),c=Lt((t==null?void 0:t.in)||e,0);c.setFullYear(s,0,i),c.setHours(0,0,0,0);const u=Po(c,t);return+n>=+l?s+1:+n>=+u?s:s-1}function iL(e,t){var l,c,u,h;const n=td(),s=(t==null?void 0:t.firstWeekContainsDate)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.firstWeekContainsDate)??n.firstWeekContainsDate??((h=(u=n.locale)==null?void 0:u.options)==null?void 0:h.firstWeekContainsDate)??1,r=pC(e,t),i=Lt((t==null?void 0:t.in)||e,0);return i.setFullYear(r,0,s),i.setHours(0,0,0,0),Po(i,t)}function vC(e,t){const n=lt(e,t==null?void 0:t.in),s=+Po(n,t)-+iL(n,t);return Math.round(s/oC)+1}function st(e,t){const n=e<0?"-":"",s=Math.abs(e).toString().padStart(t,"0");return n+s}const Ba={y(e,t){const n=e.getFullYear(),s=n>0?n:1-n;return st(t==="yy"?s%100:s,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):st(n+1,2)},d(e,t){return st(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return st(e.getHours()%12||12,t.length)},H(e,t){return st(e.getHours(),t.length)},m(e,t){return st(e.getMinutes(),t.length)},s(e,t){return st(e.getSeconds(),t.length)},S(e,t){const n=t.length,s=e.getMilliseconds(),r=Math.trunc(s*Math.pow(10,n-3));return st(r,t.length)}},Oi={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},lw={G:function(e,t,n){const s=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(s,{width:"abbreviated"});case"GGGGG":return n.era(s,{width:"narrow"});case"GGGG":default:return n.era(s,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const s=e.getFullYear(),r=s>0?s:1-s;return n.ordinalNumber(r,{unit:"year"})}return Ba.y(e,t)},Y:function(e,t,n,s){const r=pC(e,s),i=r>0?r:1-r;if(t==="YY"){const o=i%100;return st(o,2)}return t==="Yo"?n.ordinalNumber(i,{unit:"year"}):st(i,t.length)},R:function(e,t){const n=dC(e);return st(n,t.length)},u:function(e,t){const n=e.getFullYear();return st(n,t.length)},Q:function(e,t,n){const s=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(s);case"QQ":return st(s,2);case"Qo":return n.ordinalNumber(s,{unit:"quarter"});case"QQQ":return n.quarter(s,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(s,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(s,{width:"wide",context:"formatting"})}},q:function(e,t,n){const s=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(s);case"qq":return st(s,2);case"qo":return n.ordinalNumber(s,{unit:"quarter"});case"qqq":return n.quarter(s,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(s,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(s,{width:"wide",context:"standalone"})}},M:function(e,t,n){const s=e.getMonth();switch(t){case"M":case"MM":return Ba.M(e,t);case"Mo":return n.ordinalNumber(s+1,{unit:"month"});case"MMM":return n.month(s,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(s,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(s,{width:"wide",context:"formatting"})}},L:function(e,t,n){const s=e.getMonth();switch(t){case"L":return String(s+1);case"LL":return st(s+1,2);case"Lo":return n.ordinalNumber(s+1,{unit:"month"});case"LLL":return n.month(s,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(s,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(s,{width:"wide",context:"standalone"})}},w:function(e,t,n,s){const r=vC(e,s);return t==="wo"?n.ordinalNumber(r,{unit:"week"}):st(r,t.length)},I:function(e,t,n){const s=gC(e);return t==="Io"?n.ordinalNumber(s,{unit:"week"}):st(s,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):Ba.d(e,t)},D:function(e,t,n){const s=rL(e);return t==="Do"?n.ordinalNumber(s,{unit:"dayOfYear"}):st(s,t.length)},E:function(e,t,n){const s=e.getDay();switch(t){case"E":case"EE":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"});case"EEEE":default:return n.day(s,{width:"wide",context:"formatting"})}},e:function(e,t,n,s){const r=e.getDay(),i=(r-s.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return st(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(r,{width:"short",context:"formatting"});case"eeee":default:return n.day(r,{width:"wide",context:"formatting"})}},c:function(e,t,n,s){const r=e.getDay(),i=(r-s.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return st(i,t.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(r,{width:"narrow",context:"standalone"});case"cccccc":return n.day(r,{width:"short",context:"standalone"});case"cccc":default:return n.day(r,{width:"wide",context:"standalone"})}},i:function(e,t,n){const s=e.getDay(),r=s===0?7:s;switch(t){case"i":return String(r);case"ii":return st(r,t.length);case"io":return n.ordinalNumber(r,{unit:"day"});case"iii":return n.day(s,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(s,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(s,{width:"short",context:"formatting"});case"iiii":default:return n.day(s,{width:"wide",context:"formatting"})}},a:function(e,t,n){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,n){const s=e.getHours();let r;switch(s===12?r=Oi.noon:s===0?r=Oi.midnight:r=s/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(e,t,n){const s=e.getHours();let r;switch(s>=17?r=Oi.evening:s>=12?r=Oi.afternoon:s>=4?r=Oi.morning:r=Oi.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let s=e.getHours()%12;return s===0&&(s=12),n.ordinalNumber(s,{unit:"hour"})}return Ba.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Ba.H(e,t)},K:function(e,t,n){const s=e.getHours()%12;return t==="Ko"?n.ordinalNumber(s,{unit:"hour"}):st(s,t.length)},k:function(e,t,n){let s=e.getHours();return s===0&&(s=24),t==="ko"?n.ordinalNumber(s,{unit:"hour"}):st(s,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Ba.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Ba.s(e,t)},S:function(e,t){return Ba.S(e,t)},X:function(e,t,n){const s=e.getTimezoneOffset();if(s===0)return"Z";switch(t){case"X":return dw(s);case"XXXX":case"XX":return Lr(s);case"XXXXX":case"XXX":default:return Lr(s,":")}},x:function(e,t,n){const s=e.getTimezoneOffset();switch(t){case"x":return dw(s);case"xxxx":case"xx":return Lr(s);case"xxxxx":case"xxx":default:return Lr(s,":")}},O:function(e,t,n){const s=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+cw(s,":");case"OOOO":default:return"GMT"+Lr(s,":")}},z:function(e,t,n){const s=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+cw(s,":");case"zzzz":default:return"GMT"+Lr(s,":")}},t:function(e,t,n){const s=Math.trunc(+e/1e3);return st(s,t.length)},T:function(e,t,n){return st(+e,t.length)}};function cw(e,t=""){const n=e>0?"-":"+",s=Math.abs(e),r=Math.trunc(s/60),i=s%60;return i===0?n+String(r):n+String(r)+t+st(i,2)}function dw(e,t){return e%60===0?(e>0?"-":"+")+st(Math.abs(e)/60,2):Lr(e,t)}function Lr(e,t=""){const n=e>0?"-":"+",s=Math.abs(e),r=st(Math.trunc(s/60),2),i=st(s%60,2);return n+r+t+i}const uw=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},bC=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},oL=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],s=n[1],r=n[2];if(!r)return uw(e,t);let i;switch(s){case"P":i=t.dateTime({width:"short"});break;case"PP":i=t.dateTime({width:"medium"});break;case"PPP":i=t.dateTime({width:"long"});break;case"PPPP":default:i=t.dateTime({width:"full"});break}return i.replace("{{date}}",uw(s,t)).replace("{{time}}",bC(r,t))},lL={p:bC,P:oL},cL=/^D+$/,dL=/^Y+$/,uL=["D","DD","YY","YYYY"];function hL(e){return cL.test(e)}function fL(e){return dL.test(e)}function mL(e,t,n){const s=xL(e,t,n);if(console.warn(s),uL.includes(e))throw new RangeError(s)}function xL(e,t,n){const s=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${s} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const gL=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,pL=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,vL=/^'([^]*?)'?$/,bL=/''/g,yL=/[a-zA-Z]/;function wL(e,t,n){var h,d,f,x,b,v,j,g;const s=td(),r=(n==null?void 0:n.locale)??s.locale??N0,i=(n==null?void 0:n.firstWeekContainsDate)??((d=(h=n==null?void 0:n.locale)==null?void 0:h.options)==null?void 0:d.firstWeekContainsDate)??s.firstWeekContainsDate??((x=(f=s.locale)==null?void 0:f.options)==null?void 0:x.firstWeekContainsDate)??1,o=(n==null?void 0:n.weekStartsOn)??((v=(b=n==null?void 0:n.locale)==null?void 0:b.options)==null?void 0:v.weekStartsOn)??s.weekStartsOn??((g=(j=s.locale)==null?void 0:j.options)==null?void 0:g.weekStartsOn)??0,l=lt(e,n==null?void 0:n.in);if(!bP(l))throw new RangeError("Invalid time value");let c=t.match(pL).map(y=>{const p=y[0];if(p==="p"||p==="P"){const w=lL[p];return w(y,r.formatLong)}return y}).join("").match(gL).map(y=>{if(y==="''")return{isToken:!1,value:"'"};const p=y[0];if(p==="'")return{isToken:!1,value:jL(y)};if(lw[p])return{isToken:!0,value:y};if(p.match(yL))throw new RangeError("Format string contains an unescaped latin alphabet character `"+p+"`");return{isToken:!1,value:y}});r.localize.preprocessor&&(c=r.localize.preprocessor(l,c));const u={firstWeekContainsDate:i,weekStartsOn:o,locale:r};return c.map(y=>{if(!y.isToken)return y.value;const p=y.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&fL(p)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&hL(p))&&mL(p,t,String(e));const w=lw[p[0]];return w(l,p,r.localize,u)}).join("")}function jL(e){const t=e.match(vL);return t?t[1].replace(bL,"'"):e}function NL(e,t){const n=lt(e,t==null?void 0:t.in),s=n.getFullYear(),r=n.getMonth(),i=Lt(n,0);return i.setFullYear(s,r+1,0),i.setHours(0,0,0,0),i.getDate()}function SL(e,t){return lt(e,t==null?void 0:t.in).getMonth()}function CL(e,t){return lt(e,t==null?void 0:t.in).getFullYear()}function EL(e,t){return+lt(e)>+lt(t)}function kL(e,t){return+lt(e)<+lt(t)}function ML(e,t,n){const[s,r]=Jo(n==null?void 0:n.in,e,t);return s.getFullYear()===r.getFullYear()&&s.getMonth()===r.getMonth()}function TL(e,t,n){const[s,r]=Jo(n==null?void 0:n.in,e,t);return s.getFullYear()===r.getFullYear()}function DL(e,t,n){const s=lt(e,n==null?void 0:n.in),r=s.getFullYear(),i=s.getDate(),o=Lt(e,0);o.setFullYear(r,t,15),o.setHours(0,0,0,0);const l=NL(o);return s.setMonth(t,Math.min(i,l)),s}function _L(e,t,n){const s=lt(e,n==null?void 0:n.in);return isNaN(+s)?Lt(e,NaN):(s.setFullYear(t),s)}const hw=5,AL=4;function OL(e,t){const n=t.startOfMonth(e),s=n.getDay()>0?n.getDay():7,r=t.addDays(e,-s+1),i=t.addDays(r,hw*7-1);return t.getMonth(e)===t.getMonth(i)?hw:AL}function yC(e,t){const n=t.startOfMonth(e),s=n.getDay();return s===1?n:s===0?t.addDays(n,-1*6):t.addDays(n,-1*(s-1))}function zL(e,t){const n=yC(e,t),s=OL(e,t);return t.addDays(n,s*7-1)}class qn{constructor(t,n){this.Date=Date,this.today=()=>{var s;return(s=this.overrides)!=null&&s.today?this.overrides.today():this.options.timeZone?rn.tz(this.options.timeZone):new this.Date},this.newDate=(s,r,i)=>{var o;return(o=this.overrides)!=null&&o.newDate?this.overrides.newDate(s,r,i):this.options.timeZone?new rn(s,r,i,this.options.timeZone):new Date(s,r,i)},this.addDays=(s,r)=>{var i;return(i=this.overrides)!=null&&i.addDays?this.overrides.addDays(s,r):lC(s,r)},this.addMonths=(s,r)=>{var i;return(i=this.overrides)!=null&&i.addMonths?this.overrides.addMonths(s,r):cC(s,r)},this.addWeeks=(s,r)=>{var i;return(i=this.overrides)!=null&&i.addWeeks?this.overrides.addWeeks(s,r):mP(s,r)},this.addYears=(s,r)=>{var i;return(i=this.overrides)!=null&&i.addYears?this.overrides.addYears(s,r):xP(s,r)},this.differenceInCalendarDays=(s,r)=>{var i;return(i=this.overrides)!=null&&i.differenceInCalendarDays?this.overrides.differenceInCalendarDays(s,r):uC(s,r)},this.differenceInCalendarMonths=(s,r)=>{var i;return(i=this.overrides)!=null&&i.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(s,r):yP(s,r)},this.eachMonthOfInterval=s=>{var r;return(r=this.overrides)!=null&&r.eachMonthOfInterval?this.overrides.eachMonthOfInterval(s):jP(s)},this.eachYearOfInterval=s=>{var l;const r=(l=this.overrides)!=null&&l.eachYearOfInterval?this.overrides.eachYearOfInterval(s):CP(s),i=new Set(r.map(c=>this.getYear(c)));if(i.size===r.length)return r;const o=[];return i.forEach(c=>{o.push(new Date(c,0,1))}),o},this.endOfBroadcastWeek=s=>{var r;return(r=this.overrides)!=null&&r.endOfBroadcastWeek?this.overrides.endOfBroadcastWeek(s):zL(s,this)},this.endOfISOWeek=s=>{var r;return(r=this.overrides)!=null&&r.endOfISOWeek?this.overrides.endOfISOWeek(s):EP(s)},this.endOfMonth=s=>{var r;return(r=this.overrides)!=null&&r.endOfMonth?this.overrides.endOfMonth(s):wP(s)},this.endOfWeek=(s,r)=>{var i;return(i=this.overrides)!=null&&i.endOfWeek?this.overrides.endOfWeek(s,r):xC(s,this.options)},this.endOfYear=s=>{var r;return(r=this.overrides)!=null&&r.endOfYear?this.overrides.endOfYear(s):SP(s)},this.format=(s,r,i)=>{var l;const o=(l=this.overrides)!=null&&l.format?this.overrides.format(s,r,this.options):wL(s,r,this.options);return this.options.numerals&&this.options.numerals!=="latn"?this.replaceDigits(o):o},this.getISOWeek=s=>{var r;return(r=this.overrides)!=null&&r.getISOWeek?this.overrides.getISOWeek(s):gC(s)},this.getMonth=(s,r)=>{var i;return(i=this.overrides)!=null&&i.getMonth?this.overrides.getMonth(s,this.options):SL(s,this.options)},this.getYear=(s,r)=>{var i;return(i=this.overrides)!=null&&i.getYear?this.overrides.getYear(s,this.options):CL(s,this.options)},this.getWeek=(s,r)=>{var i;return(i=this.overrides)!=null&&i.getWeek?this.overrides.getWeek(s,this.options):vC(s,this.options)},this.isAfter=(s,r)=>{var i;return(i=this.overrides)!=null&&i.isAfter?this.overrides.isAfter(s,r):EL(s,r)},this.isBefore=(s,r)=>{var i;return(i=this.overrides)!=null&&i.isBefore?this.overrides.isBefore(s,r):kL(s,r)},this.isDate=s=>{var r;return(r=this.overrides)!=null&&r.isDate?this.overrides.isDate(s):hC(s)},this.isSameDay=(s,r)=>{var i;return(i=this.overrides)!=null&&i.isSameDay?this.overrides.isSameDay(s,r):vP(s,r)},this.isSameMonth=(s,r)=>{var i;return(i=this.overrides)!=null&&i.isSameMonth?this.overrides.isSameMonth(s,r):ML(s,r)},this.isSameYear=(s,r)=>{var i;return(i=this.overrides)!=null&&i.isSameYear?this.overrides.isSameYear(s,r):TL(s,r)},this.max=s=>{var r;return(r=this.overrides)!=null&&r.max?this.overrides.max(s):gP(s)},this.min=s=>{var r;return(r=this.overrides)!=null&&r.min?this.overrides.min(s):pP(s)},this.setMonth=(s,r)=>{var i;return(i=this.overrides)!=null&&i.setMonth?this.overrides.setMonth(s,r):DL(s,r)},this.setYear=(s,r)=>{var i;return(i=this.overrides)!=null&&i.setYear?this.overrides.setYear(s,r):_L(s,r)},this.startOfBroadcastWeek=(s,r)=>{var i;return(i=this.overrides)!=null&&i.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(s,this):yC(s,this)},this.startOfDay=s=>{var r;return(r=this.overrides)!=null&&r.startOfDay?this.overrides.startOfDay(s):Tc(s)},this.startOfISOWeek=s=>{var r;return(r=this.overrides)!=null&&r.startOfISOWeek?this.overrides.startOfISOWeek(s):Mc(s)},this.startOfMonth=s=>{var r;return(r=this.overrides)!=null&&r.startOfMonth?this.overrides.startOfMonth(s):NP(s)},this.startOfWeek=(s,r)=>{var i;return(i=this.overrides)!=null&&i.startOfWeek?this.overrides.startOfWeek(s,this.options):Po(s,this.options)},this.startOfYear=s=>{var r;return(r=this.overrides)!=null&&r.startOfYear?this.overrides.startOfYear(s):mC(s)},this.options={locale:N0,...t},this.overrides=n}getDigitMap(){const{numerals:t="latn"}=this.options,n=new Intl.NumberFormat("en-US",{numberingSystem:t}),s={};for(let r=0;r<10;r++)s[r.toString()]=n.format(r);return s}replaceDigits(t){const n=this.getDigitMap();return t.replace(/\d/g,s=>n[s]||s)}formatNumber(t){return this.replaceDigits(t.toString())}getMonthYearOrder(){var n;const t=(n=this.options.locale)==null?void 0:n.code;return t&&qn.yearFirstLocales.has(t)?"year-first":"month-first"}formatMonthYear(t){const{locale:n,timeZone:s,numerals:r}=this.options,i=n==null?void 0:n.code;if(i&&qn.yearFirstLocales.has(i))try{return new Intl.DateTimeFormat(i,{month:"long",year:"numeric",timeZone:s,numberingSystem:r}).format(t)}catch{}const o=this.getMonthYearOrder()==="year-first"?"y LLLL":"LLLL y";return this.format(t,o)}}qn.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 ea=new qn;class wC{constructor(t,n,s=ea){this.date=t,this.displayMonth=n,this.outside=!!(n&&!s.isSameMonth(t,n)),this.dateLib=s}isEqualTo(t){return this.dateLib.isSameDay(t.date,this.date)&&this.dateLib.isSameMonth(t.displayMonth,this.displayMonth)}}class RL{constructor(t,n){this.date=t,this.weeks=n}}class UL{constructor(t,n){this.days=n,this.weekNumber=t}}function $L(e){return K.createElement("button",{...e})}function PL(e){return K.createElement("span",{...e})}function LL(e){const{size:t=24,orientation:n="left",className:s}=e;return K.createElement("svg",{className:s,width:t,height:t,viewBox:"0 0 24 24"},n==="up"&&K.createElement("polygon",{points:"6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28"}),n==="down"&&K.createElement("polygon",{points:"6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72"}),n==="left"&&K.createElement("polygon",{points:"16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20"}),n==="right"&&K.createElement("polygon",{points:"8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20"}))}function HL(e){const{day:t,modifiers:n,...s}=e;return K.createElement("td",{...s})}function BL(e){const{day:t,modifiers:n,...s}=e,r=K.useRef(null);return K.useEffect(()=>{var i;n.focused&&((i=r.current)==null||i.focus())},[n.focused]),K.createElement("button",{ref:r,...s})}var ke;(function(e){e.Root="root",e.Chevron="chevron",e.Day="day",e.DayButton="day_button",e.CaptionLabel="caption_label",e.Dropdowns="dropdowns",e.Dropdown="dropdown",e.DropdownRoot="dropdown_root",e.Footer="footer",e.MonthGrid="month_grid",e.MonthCaption="month_caption",e.MonthsDropdown="months_dropdown",e.Month="month",e.Months="months",e.Nav="nav",e.NextMonthButton="button_next",e.PreviousMonthButton="button_previous",e.Week="week",e.Weeks="weeks",e.Weekday="weekday",e.Weekdays="weekdays",e.WeekNumber="week_number",e.WeekNumberHeader="week_number_header",e.YearsDropdown="years_dropdown"})(ke||(ke={}));var kt;(function(e){e.disabled="disabled",e.hidden="hidden",e.outside="outside",e.focused="focused",e.today="today"})(kt||(kt={}));var ps;(function(e){e.range_end="range_end",e.range_middle="range_middle",e.range_start="range_start",e.selected="selected"})(ps||(ps={}));var On;(function(e){e.weeks_before_enter="weeks_before_enter",e.weeks_before_exit="weeks_before_exit",e.weeks_after_enter="weeks_after_enter",e.weeks_after_exit="weeks_after_exit",e.caption_after_enter="caption_after_enter",e.caption_after_exit="caption_after_exit",e.caption_before_enter="caption_before_enter",e.caption_before_exit="caption_before_exit"})(On||(On={}));function VL(e){const{options:t,className:n,components:s,classNames:r,...i}=e,o=[r[ke.Dropdown],n].join(" "),l=t==null?void 0:t.find(({value:c})=>c===i.value);return K.createElement("span",{"data-disabled":i.disabled,className:r[ke.DropdownRoot]},K.createElement(s.Select,{className:o,...i},t==null?void 0:t.map(({value:c,label:u,disabled:h})=>K.createElement(s.Option,{key:c,value:c,disabled:h},u))),K.createElement("span",{className:r[ke.CaptionLabel],"aria-hidden":!0},l==null?void 0:l.label,K.createElement(s.Chevron,{orientation:"down",size:18,className:r[ke.Chevron]})))}function YL(e){return K.createElement("div",{...e})}function FL(e){return K.createElement("div",{...e})}function IL(e){const{calendarMonth:t,displayIndex:n,...s}=e;return K.createElement("div",{...s},e.children)}function WL(e){const{calendarMonth:t,displayIndex:n,...s}=e;return K.createElement("div",{...s})}function qL(e){return K.createElement("table",{...e})}function XL(e){return K.createElement("div",{...e})}const jC=m.createContext(void 0);function nd(){const e=m.useContext(jC);if(e===void 0)throw new Error("useDayPicker() must be used within a custom component.");return e}function GL(e){const{components:t}=nd();return K.createElement(t.Dropdown,{...e})}function ZL(e){const{onPreviousClick:t,onNextClick:n,previousMonth:s,nextMonth:r,...i}=e,{components:o,classNames:l,labels:{labelPrevious:c,labelNext:u}}=nd(),h=m.useCallback(f=>{r&&(n==null||n(f))},[r,n]),d=m.useCallback(f=>{s&&(t==null||t(f))},[s,t]);return K.createElement("nav",{...i},K.createElement(o.PreviousMonthButton,{type:"button",className:l[ke.PreviousMonthButton],tabIndex:s?void 0:-1,"aria-disabled":s?void 0:!0,"aria-label":c(s),onClick:d},K.createElement(o.Chevron,{disabled:s?void 0:!0,className:l[ke.Chevron],orientation:"left"})),K.createElement(o.NextMonthButton,{type:"button",className:l[ke.NextMonthButton],tabIndex:r?void 0:-1,"aria-disabled":r?void 0:!0,"aria-label":u(r),onClick:h},K.createElement(o.Chevron,{disabled:r?void 0:!0,orientation:"right",className:l[ke.Chevron]})))}function QL(e){const{components:t}=nd();return K.createElement(t.Button,{...e})}function KL(e){return K.createElement("option",{...e})}function JL(e){const{components:t}=nd();return K.createElement(t.Button,{...e})}function eH(e){const{rootRef:t,...n}=e;return K.createElement("div",{...n,ref:t})}function tH(e){return K.createElement("select",{...e})}function nH(e){const{week:t,...n}=e;return K.createElement("tr",{...n})}function sH(e){return K.createElement("th",{...e})}function aH(e){return K.createElement("thead",{"aria-hidden":!0},K.createElement("tr",{...e}))}function rH(e){const{week:t,...n}=e;return K.createElement("th",{...n})}function iH(e){return K.createElement("th",{...e})}function oH(e){return K.createElement("tbody",{...e})}function lH(e){const{components:t}=nd();return K.createElement(t.Dropdown,{...e})}const cH=Object.freeze(Object.defineProperty({__proto__:null,Button:$L,CaptionLabel:PL,Chevron:LL,Day:HL,DayButton:BL,Dropdown:VL,DropdownNav:YL,Footer:FL,Month:IL,MonthCaption:WL,MonthGrid:qL,Months:XL,MonthsDropdown:GL,Nav:ZL,NextMonthButton:QL,Option:KL,PreviousMonthButton:JL,Root:eH,Select:tH,Week:nH,WeekNumber:rH,WeekNumberHeader:iH,Weekday:sH,Weekdays:aH,Weeks:oH,YearsDropdown:lH},Symbol.toStringTag,{value:"Module"}));function ma(e,t,n=!1,s=ea){let{from:r,to:i}=e;const{differenceInCalendarDays:o,isSameDay:l}=s;return r&&i?(o(i,r)<0&&([r,i]=[i,r]),o(t,r)>=(n?1:0)&&o(i,t)>=(n?1:0)):!n&&i?l(i,t):!n&&r?l(r,t):!1}function NC(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function S0(e){return!!(e&&typeof e=="object"&&"from"in e)}function SC(e){return!!(e&&typeof e=="object"&&"after"in e)}function CC(e){return!!(e&&typeof e=="object"&&"before"in e)}function EC(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function kC(e,t){return Array.isArray(e)&&e.every(t.isDate)}function xa(e,t,n=ea){const s=Array.isArray(t)?t:[t],{isSameDay:r,differenceInCalendarDays:i,isAfter:o}=n;return s.some(l=>{if(typeof l=="boolean")return l;if(n.isDate(l))return r(e,l);if(kC(l,n))return l.includes(e);if(S0(l))return ma(l,e,!1,n);if(EC(l))return Array.isArray(l.dayOfWeek)?l.dayOfWeek.includes(e.getDay()):l.dayOfWeek===e.getDay();if(NC(l)){const c=i(l.before,e),u=i(l.after,e),h=c>0,d=u<0;return o(l.before,l.after)?d&&h:h||d}return SC(l)?i(e,l.after)>0:CC(l)?i(l.before,e)>0:typeof l=="function"?l(e):!1})}function dH(e,t,n,s,r){const{disabled:i,hidden:o,modifiers:l,showOutsideDays:c,broadcastCalendar:u,today:h}=t,{isSameDay:d,isSameMonth:f,startOfMonth:x,isBefore:b,endOfMonth:v,isAfter:j}=r,g=n&&x(n),y=s&&v(s),p={[kt.focused]:[],[kt.outside]:[],[kt.disabled]:[],[kt.hidden]:[],[kt.today]:[]},w={};for(const N of e){const{date:S,displayMonth:C}=N,T=!!(C&&!f(S,C)),U=!!(g&&b(S,g)),B=!!(y&&j(S,y)),P=!!(i&&xa(S,i,r)),z=!!(o&&xa(S,o,r))||U||B||!u&&!c&&T||u&&c===!1&&T,Y=d(S,h??r.today());T&&p.outside.push(N),P&&p.disabled.push(N),z&&p.hidden.push(N),Y&&p.today.push(N),l&&Object.keys(l).forEach(k=>{const $=l==null?void 0:l[k];$&&xa(S,$,r)&&(w[k]?w[k].push(N):w[k]=[N])})}return N=>{const S={[kt.focused]:!1,[kt.disabled]:!1,[kt.hidden]:!1,[kt.outside]:!1,[kt.today]:!1},C={};for(const T in p){const U=p[T];S[T]=U.some(B=>B===N)}for(const T in w)C[T]=w[T].some(U=>U===N);return{...S,...C}}}function uH(e,t,n={}){return Object.entries(e).filter(([,r])=>r===!0).reduce((r,[i])=>(n[i]?r.push(n[i]):t[kt[i]]?r.push(t[kt[i]]):t[ps[i]]&&r.push(t[ps[i]]),r),[t[ke.Day]])}function hH(e){return{...cH,...e}}function fH(e){const t={"data-mode":e.mode??void 0,"data-required":"required"in e?e.required:void 0,"data-multiple-months":e.numberOfMonths&&e.numberOfMonths>1||void 0,"data-week-numbers":e.showWeekNumber||void 0,"data-broadcast-calendar":e.broadcastCalendar||void 0,"data-nav-layout":e.navLayout||void 0};return Object.entries(e).forEach(([n,s])=>{n.startsWith("data-")&&(t[n]=s)}),t}function C0(){const e={};for(const t in ke)e[ke[t]]=`rdp-${ke[t]}`;for(const t in kt)e[kt[t]]=`rdp-${kt[t]}`;for(const t in ps)e[ps[t]]=`rdp-${ps[t]}`;for(const t in On)e[On[t]]=`rdp-${On[t]}`;return e}function MC(e,t,n){return(n??new qn(t)).formatMonthYear(e)}const mH=MC;function xH(e,t,n){return(n??new qn(t)).format(e,"d")}function gH(e,t=ea){return t.format(e,"LLLL")}function pH(e,t,n){return(n??new qn(t)).format(e,"cccccc")}function vH(e,t=ea){return e<10?t.formatNumber(`0${e.toLocaleString()}`):t.formatNumber(`${e.toLocaleString()}`)}function bH(){return""}function TC(e,t=ea){return t.format(e,"yyyy")}const yH=TC,wH=Object.freeze(Object.defineProperty({__proto__:null,formatCaption:MC,formatDay:xH,formatMonthCaption:mH,formatMonthDropdown:gH,formatWeekNumber:vH,formatWeekNumberHeader:bH,formatWeekdayName:pH,formatYearCaption:yH,formatYearDropdown:TC},Symbol.toStringTag,{value:"Module"}));function jH(e){return e!=null&&e.formatMonthCaption&&!e.formatCaption&&(e.formatCaption=e.formatMonthCaption),e!=null&&e.formatYearCaption&&!e.formatYearDropdown&&(e.formatYearDropdown=e.formatYearCaption),{...wH,...e}}function NH(e,t,n,s,r){const{startOfMonth:i,startOfYear:o,endOfYear:l,eachMonthOfInterval:c,getMonth:u}=r;return c({start:o(e),end:l(e)}).map(f=>{const x=s.formatMonthDropdown(f,r),b=u(f),v=t&&f<i(t)||n&&f>i(n)||!1;return{value:b,label:x,disabled:v}})}function SH(e,t={},n={}){let s={...t==null?void 0:t[ke.Day]};return Object.entries(e).filter(([,r])=>r===!0).forEach(([r])=>{s={...s,...n==null?void 0:n[r]}}),s}function CH(e,t,n){const s=e.today(),r=t?e.startOfISOWeek(s):e.startOfWeek(s),i=[];for(let o=0;o<7;o++){const l=e.addDays(r,o);i.push(l)}return i}function EH(e,t,n,s,r=!1){if(!e||!t)return;const{startOfYear:i,endOfYear:o,eachYearOfInterval:l,getYear:c}=s,u=i(e),h=o(t),d=l({start:u,end:h});return r&&d.reverse(),d.map(f=>{const x=n.formatYearDropdown(f,s);return{value:c(f),label:x,disabled:!1}})}function DC(e,t,n,s){let r=(s??new qn(n)).format(e,"PPPP");return t.today&&(r=`Today, ${r}`),t.selected&&(r=`${r}, selected`),r}const kH=DC;function _C(e,t,n){return(n??new qn(t)).formatMonthYear(e)}const MH=_C;function TH(e,t,n,s){let r=(s??new qn(n)).format(e,"PPPP");return t!=null&&t.today&&(r=`Today, ${r}`),r}function DH(e){return"Choose the Month"}function _H(){return""}function AH(e){return"Go to the Next Month"}function OH(e){return"Go to the Previous Month"}function zH(e,t,n){return(n??new qn(t)).format(e,"cccc")}function RH(e,t){return`Week ${e}`}function UH(e){return"Week Number"}function $H(e){return"Choose the Year"}const PH=Object.freeze(Object.defineProperty({__proto__:null,labelCaption:MH,labelDay:kH,labelDayButton:DC,labelGrid:_C,labelGridcell:TH,labelMonthDropdown:DH,labelNav:_H,labelNext:AH,labelPrevious:OH,labelWeekNumber:RH,labelWeekNumberHeader:UH,labelWeekday:zH,labelYearDropdown:$H},Symbol.toStringTag,{value:"Module"})),sd=e=>e instanceof HTMLElement?e:null,Xm=e=>[...e.querySelectorAll("[data-animated-month]")??[]],LH=e=>sd(e.querySelector("[data-animated-month]")),Gm=e=>sd(e.querySelector("[data-animated-caption]")),Zm=e=>sd(e.querySelector("[data-animated-weeks]")),HH=e=>sd(e.querySelector("[data-animated-nav]")),BH=e=>sd(e.querySelector("[data-animated-weekdays]"));function VH(e,t,{classNames:n,months:s,focused:r,dateLib:i}){const o=m.useRef(null),l=m.useRef(s),c=m.useRef(!1);m.useLayoutEffect(()=>{const u=l.current;if(l.current=s,!t||!e.current||!(e.current instanceof HTMLElement)||s.length===0||u.length===0||s.length!==u.length)return;const h=i.isSameMonth(s[0].date,u[0].date),d=i.isAfter(s[0].date,u[0].date),f=d?n[On.caption_after_enter]:n[On.caption_before_enter],x=d?n[On.weeks_after_enter]:n[On.weeks_before_enter],b=o.current,v=e.current.cloneNode(!0);if(v instanceof HTMLElement?(Xm(v).forEach(p=>{if(!(p instanceof HTMLElement))return;const w=LH(p);w&&p.contains(w)&&p.removeChild(w);const N=Gm(p);N&&N.classList.remove(f);const S=Zm(p);S&&S.classList.remove(x)}),o.current=v):o.current=null,c.current||h||r)return;const j=b instanceof HTMLElement?Xm(b):[],g=Xm(e.current);if(g!=null&&g.every(y=>y instanceof HTMLElement)&&j&&j.every(y=>y instanceof HTMLElement)){c.current=!0,e.current.style.isolation="isolate";const y=HH(e.current);y&&(y.style.zIndex="1"),g.forEach((p,w)=>{const N=j[w];if(!N)return;p.style.position="relative",p.style.overflow="hidden";const S=Gm(p);S&&S.classList.add(f);const C=Zm(p);C&&C.classList.add(x);const T=()=>{c.current=!1,e.current&&(e.current.style.isolation=""),y&&(y.style.zIndex=""),S&&S.classList.remove(f),C&&C.classList.remove(x),p.style.position="",p.style.overflow="",p.contains(N)&&p.removeChild(N)};N.style.pointerEvents="none",N.style.position="absolute",N.style.overflow="hidden",N.setAttribute("aria-hidden","true");const U=BH(N);U&&(U.style.opacity="0");const B=Gm(N);B&&(B.classList.add(d?n[On.caption_before_exit]:n[On.caption_after_exit]),B.addEventListener("animationend",T));const P=Zm(N);P&&P.classList.add(d?n[On.weeks_before_exit]:n[On.weeks_after_exit]),p.insertBefore(N,p.firstChild)})}})}function YH(e,t,n,s){const r=e[0],i=e[e.length-1],{ISOWeek:o,fixedWeeks:l,broadcastCalendar:c}=n??{},{addDays:u,differenceInCalendarDays:h,differenceInCalendarMonths:d,endOfBroadcastWeek:f,endOfISOWeek:x,endOfMonth:b,endOfWeek:v,isAfter:j,startOfBroadcastWeek:g,startOfISOWeek:y,startOfWeek:p}=s,w=c?g(r,s):o?y(r):p(r),N=c?f(i):o?x(b(i)):v(b(i)),S=h(N,w),C=d(i,r)+1,T=[];for(let P=0;P<=S;P++){const z=u(w,P);if(t&&j(z,t))break;T.push(z)}const B=(c?35:42)*C;if(l&&T.length<B){const P=B-T.length;for(let z=0;z<P;z++){const Y=u(T[T.length-1],1);T.push(Y)}}return T}function FH(e){const t=[];return e.reduce((n,s)=>{const r=s.weeks.reduce((i,o)=>i.concat(o.days.slice()),t.slice());return n.concat(r.slice())},t.slice())}function IH(e,t,n,s){const{numberOfMonths:r=1}=n,i=[];for(let o=0;o<r;o++){const l=s.addMonths(e,o);if(t&&l>t)break;i.push(l)}return i}function fw(e,t,n,s){const{month:r,defaultMonth:i,today:o=s.today(),numberOfMonths:l=1}=e;let c=r||i||o;const{differenceInCalendarMonths:u,addMonths:h,startOfMonth:d}=s;if(n&&u(n,c)<l-1){const f=-1*(l-1);c=h(n,f)}return t&&u(c,t)<0&&(c=t),d(c)}function WH(e,t,n,s){const{addDays:r,endOfBroadcastWeek:i,endOfISOWeek:o,endOfMonth:l,endOfWeek:c,getISOWeek:u,getWeek:h,startOfBroadcastWeek:d,startOfISOWeek:f,startOfWeek:x}=s,b=e.reduce((v,j)=>{const g=n.broadcastCalendar?d(j,s):n.ISOWeek?f(j):x(j),y=n.broadcastCalendar?i(j):n.ISOWeek?o(l(j)):c(l(j)),p=t.filter(C=>C>=g&&C<=y),w=n.broadcastCalendar?35:42;if(n.fixedWeeks&&p.length<w){const C=t.filter(T=>{const U=w-p.length;return T>y&&T<=r(y,U)});p.push(...C)}const N=p.reduce((C,T)=>{const U=n.ISOWeek?u(T):h(T),B=C.find(z=>z.weekNumber===U),P=new wC(T,j,s);return B?B.days.push(P):C.push(new UL(U,[P])),C},[]),S=new RL(j,N);return v.push(S),v},[]);return n.reverseMonths?b.reverse():b}function qH(e,t){let{startMonth:n,endMonth:s}=e;const{startOfYear:r,startOfDay:i,startOfMonth:o,endOfMonth:l,addYears:c,endOfYear:u,newDate:h,today:d}=t,{fromYear:f,toYear:x,fromMonth:b,toMonth:v}=e;!n&&b&&(n=b),!n&&f&&(n=t.newDate(f,0,1)),!s&&v&&(s=v),!s&&x&&(s=h(x,11,31));const j=e.captionLayout==="dropdown"||e.captionLayout==="dropdown-years";return n?n=o(n):f?n=h(f,0,1):!n&&j&&(n=r(c(e.today??d(),-100))),s?s=l(s):x?s=h(x,11,31):!s&&j&&(s=u(e.today??d())),[n&&i(n),s&&i(s)]}function XH(e,t,n,s){if(n.disableNavigation)return;const{pagedNavigation:r,numberOfMonths:i=1}=n,{startOfMonth:o,addMonths:l,differenceInCalendarMonths:c}=s,u=r?i:1,h=o(e);if(!t)return l(h,u);if(!(c(t,e)<i))return l(h,u)}function GH(e,t,n,s){if(n.disableNavigation)return;const{pagedNavigation:r,numberOfMonths:i}=n,{startOfMonth:o,addMonths:l,differenceInCalendarMonths:c}=s,u=r?i??1:1,h=o(e);if(!t)return l(h,-u);if(!(c(h,t)<=0))return l(h,-u)}function ZH(e){const t=[];return e.reduce((n,s)=>n.concat(s.weeks.slice()),t.slice())}function Cf(e,t){const[n,s]=m.useState(e);return[t===void 0?n:t,s]}function QH(e,t){const[n,s]=qH(e,t),{startOfMonth:r,endOfMonth:i}=t,o=fw(e,n,s,t),[l,c]=Cf(o,e.month?o:void 0);m.useEffect(()=>{const S=fw(e,n,s,t);c(S)},[e.timeZone]);const u=IH(l,s,e,t),h=YH(u,e.endMonth?i(e.endMonth):void 0,e,t),d=WH(u,h,e,t),f=ZH(d),x=FH(d),b=GH(l,n,e,t),v=XH(l,s,e,t),{disableNavigation:j,onMonthChange:g}=e,y=S=>f.some(C=>C.days.some(T=>T.isEqualTo(S))),p=S=>{if(j)return;let C=r(S);n&&C<r(n)&&(C=r(n)),s&&C>r(s)&&(C=r(s)),c(C),g==null||g(C)};return{months:d,weeks:f,days:x,navStart:n,navEnd:s,previousMonth:b,nextMonth:v,goToMonth:p,goToDay:S=>{y(S)||p(S.date)}}}var zs;(function(e){e[e.Today=0]="Today",e[e.Selected=1]="Selected",e[e.LastFocused=2]="LastFocused",e[e.FocusedModifier=3]="FocusedModifier"})(zs||(zs={}));function mw(e){return!e[kt.disabled]&&!e[kt.hidden]&&!e[kt.outside]}function KH(e,t,n,s){let r,i=-1;for(const o of e){const l=t(o);mw(l)&&(l[kt.focused]&&i<zs.FocusedModifier?(r=o,i=zs.FocusedModifier):s!=null&&s.isEqualTo(o)&&i<zs.LastFocused?(r=o,i=zs.LastFocused):n(o.date)&&i<zs.Selected?(r=o,i=zs.Selected):l[kt.today]&&i<zs.Today&&(r=o,i=zs.Today))}return r||(r=e.find(o=>mw(t(o)))),r}function JH(e,t,n,s,r,i,o){const{ISOWeek:l,broadcastCalendar:c}=i,{addDays:u,addMonths:h,addWeeks:d,addYears:f,endOfBroadcastWeek:x,endOfISOWeek:b,endOfWeek:v,max:j,min:g,startOfBroadcastWeek:y,startOfISOWeek:p,startOfWeek:w}=o;let S={day:u,week:d,month:h,year:f,startOfWeek:C=>c?y(C,o):l?p(C):w(C),endOfWeek:C=>c?x(C):l?b(C):v(C)}[e](n,t==="after"?1:-1);return t==="before"&&s?S=j([s,S]):t==="after"&&r&&(S=g([r,S])),S}function AC(e,t,n,s,r,i,o,l=0){if(l>365)return;const c=JH(e,t,n.date,s,r,i,o),u=!!(i.disabled&&xa(c,i.disabled,o)),h=!!(i.hidden&&xa(c,i.hidden,o)),d=c,f=new wC(c,d,o);return!u&&!h?f:AC(e,t,f,s,r,i,o,l+1)}function eB(e,t,n,s,r){const{autoFocus:i}=e,[o,l]=m.useState(),c=KH(t.days,n,s||(()=>!1),o),[u,h]=m.useState(i?c:void 0);return{isFocusTarget:v=>!!(c!=null&&c.isEqualTo(v)),setFocused:h,focused:u,blur:()=>{l(u),h(void 0)},moveFocus:(v,j)=>{if(!u)return;const g=AC(v,j,u,t.navStart,t.navEnd,e,r);g&&(e.disableNavigation&&!t.days.some(p=>p.isEqualTo(g))||(t.goToDay(g),h(g)))}}}function tB(e,t){const{selected:n,required:s,onSelect:r}=e,[i,o]=Cf(n,r?n:void 0),l=r?n:i,{isSameDay:c}=t,u=x=>(l==null?void 0:l.some(b=>c(b,x)))??!1,{min:h,max:d}=e;return{selected:l,select:(x,b,v)=>{let j=[...l??[]];if(u(x)){if((l==null?void 0:l.length)===h||s&&(l==null?void 0:l.length)===1)return;j=l==null?void 0:l.filter(g=>!c(g,x))}else(l==null?void 0:l.length)===d?j=[x]:j=[...j,x];return r||o(j),r==null||r(j,x,b,v),j},isSelected:u}}function nB(e,t,n=0,s=0,r=!1,i=ea){const{from:o,to:l}=t||{},{isSameDay:c,isAfter:u,isBefore:h}=i;let d;if(!o&&!l)d={from:e,to:n>0?void 0:e};else if(o&&!l)c(o,e)?n===0?d={from:o,to:e}:r?d={from:o,to:void 0}:d=void 0:h(e,o)?d={from:e,to:o}:d={from:o,to:e};else if(o&&l)if(c(o,e)&&c(l,e))r?d={from:o,to:l}:d=void 0;else if(c(o,e))d={from:o,to:n>0?void 0:e};else if(c(l,e))d={from:e,to:n>0?void 0:e};else if(h(e,o))d={from:e,to:l};else if(u(e,o))d={from:o,to:e};else if(u(e,l))d={from:o,to:e};else throw new Error("Invalid range");if(d!=null&&d.from&&(d!=null&&d.to)){const f=i.differenceInCalendarDays(d.to,d.from);s>0&&f>s?d={from:e,to:void 0}:n>1&&f<n&&(d={from:e,to:void 0})}return d}function sB(e,t,n=ea){const s=Array.isArray(t)?t:[t];let r=e.from;const i=n.differenceInCalendarDays(e.to,e.from),o=Math.min(i,6);for(let l=0;l<=o;l++){if(s.includes(r.getDay()))return!0;r=n.addDays(r,1)}return!1}function xw(e,t,n=ea){return ma(e,t.from,!1,n)||ma(e,t.to,!1,n)||ma(t,e.from,!1,n)||ma(t,e.to,!1,n)}function aB(e,t,n=ea){const s=Array.isArray(t)?t:[t];if(s.filter(l=>typeof l!="function").some(l=>typeof l=="boolean"?l:n.isDate(l)?ma(e,l,!1,n):kC(l,n)?l.some(c=>ma(e,c,!1,n)):S0(l)?l.from&&l.to?xw(e,{from:l.from,to:l.to},n):!1:EC(l)?sB(e,l.dayOfWeek,n):NC(l)?n.isAfter(l.before,l.after)?xw(e,{from:n.addDays(l.after,1),to:n.addDays(l.before,-1)},n):xa(e.from,l,n)||xa(e.to,l,n):SC(l)||CC(l)?xa(e.from,l,n)||xa(e.to,l,n):!1))return!0;const o=s.filter(l=>typeof l=="function");if(o.length){let l=e.from;const c=n.differenceInCalendarDays(e.to,e.from);for(let u=0;u<=c;u++){if(o.some(h=>h(l)))return!0;l=n.addDays(l,1)}}return!1}function rB(e,t){const{disabled:n,excludeDisabled:s,selected:r,required:i,onSelect:o}=e,[l,c]=Cf(r,o?r:void 0),u=o?r:l;return{selected:u,select:(f,x,b)=>{const{min:v,max:j}=e,g=f?nB(f,u,v,j,i,t):void 0;return s&&n&&(g!=null&&g.from)&&g.to&&aB({from:g.from,to:g.to},n,t)&&(g.from=f,g.to=void 0),o||c(g),o==null||o(g,f,x,b),g},isSelected:f=>u&&ma(u,f,!1,t)}}function iB(e,t){const{selected:n,required:s,onSelect:r}=e,[i,o]=Cf(n,r?n:void 0),l=r?n:i,{isSameDay:c}=t;return{selected:l,select:(d,f,x)=>{let b=d;return!s&&l&&l&&c(d,l)&&(b=void 0),r||o(b),r==null||r(b,d,f,x),b},isSelected:d=>l?c(l,d):!1}}function oB(e,t){const n=iB(e,t),s=tB(e,t),r=rB(e,t);switch(e.mode){case"single":return n;case"multiple":return s;case"range":return r;default:return}}function lB(e){var J;let t=e;t.timeZone&&(t={...e},t.today&&(t.today=new rn(t.today,t.timeZone)),t.month&&(t.month=new rn(t.month,t.timeZone)),t.defaultMonth&&(t.defaultMonth=new rn(t.defaultMonth,t.timeZone)),t.startMonth&&(t.startMonth=new rn(t.startMonth,t.timeZone)),t.endMonth&&(t.endMonth=new rn(t.endMonth,t.timeZone)),t.mode==="single"&&t.selected?t.selected=new rn(t.selected,t.timeZone):t.mode==="multiple"&&t.selected?t.selected=(J=t.selected)==null?void 0:J.map(ne=>new rn(ne,t.timeZone)):t.mode==="range"&&t.selected&&(t.selected={from:t.selected.from?new rn(t.selected.from,t.timeZone):void 0,to:t.selected.to?new rn(t.selected.to,t.timeZone):void 0}));const{components:n,formatters:s,labels:r,dateLib:i,locale:o,classNames:l}=m.useMemo(()=>{const ne={...N0,...t.locale};return{dateLib:new qn({locale:ne,weekStartsOn:t.broadcastCalendar?1:t.weekStartsOn,firstWeekContainsDate:t.firstWeekContainsDate,useAdditionalWeekYearTokens:t.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:t.useAdditionalDayOfYearTokens,timeZone:t.timeZone,numerals:t.numerals},t.dateLib),components:hH(t.components),formatters:jH(t.formatters),labels:{...PH,...t.labels},locale:ne,classNames:{...C0(),...t.classNames}}},[t.locale,t.broadcastCalendar,t.weekStartsOn,t.firstWeekContainsDate,t.useAdditionalWeekYearTokens,t.useAdditionalDayOfYearTokens,t.timeZone,t.numerals,t.dateLib,t.components,t.formatters,t.labels,t.classNames]),{captionLayout:c,mode:u,navLayout:h,numberOfMonths:d=1,onDayBlur:f,onDayClick:x,onDayFocus:b,onDayKeyDown:v,onDayMouseEnter:j,onDayMouseLeave:g,onNextClick:y,onPrevClick:p,showWeekNumber:w,styles:N}=t,{formatCaption:S,formatDay:C,formatMonthDropdown:T,formatWeekNumber:U,formatWeekNumberHeader:B,formatWeekdayName:P,formatYearDropdown:z}=s,Y=QH(t,i),{days:k,months:$,navStart:M,navEnd:_,previousMonth:E,nextMonth:D,goToMonth:A}=Y,q=dH(k,t,M,_,i),{isSelected:R,select:L,selected:X}=oB(t,i)??{},{blur:G,focused:te,isFocusTarget:re,moveFocus:ee,setFocused:se}=eB(t,Y,q,R??(()=>!1),i),{labelDayButton:ge,labelGridcell:ae,labelGrid:ue,labelMonthDropdown:he,labelNav:we,labelPrevious:Ne,labelNext:Ce,labelWeekday:Ae,labelWeekNumber:tt,labelWeekNumberHeader:$e,labelYearDropdown:Rt}=r,Tt=m.useMemo(()=>CH(i,t.ISOWeek),[i,t.ISOWeek]),Be=u!==void 0||x!==void 0,We=m.useCallback(()=>{E&&(A(E),p==null||p(E))},[E,A,p]),vt=m.useCallback(()=>{D&&(A(D),y==null||y(D))},[A,D,y]),bt=m.useCallback((ne,xe)=>ce=>{ce.preventDefault(),ce.stopPropagation(),se(ne),L==null||L(ne.date,xe,ce),x==null||x(ne.date,xe,ce)},[L,x,se]),ft=m.useCallback((ne,xe)=>ce=>{se(ne),b==null||b(ne.date,xe,ce)},[b,se]),Q=m.useCallback((ne,xe)=>ce=>{G(),f==null||f(ne.date,xe,ce)},[G,f]),H=m.useCallback((ne,xe)=>ce=>{const pe={ArrowLeft:[ce.shiftKey?"month":"day",t.dir==="rtl"?"after":"before"],ArrowRight:[ce.shiftKey?"month":"day",t.dir==="rtl"?"before":"after"],ArrowDown:[ce.shiftKey?"year":"week","after"],ArrowUp:[ce.shiftKey?"year":"week","before"],PageUp:[ce.shiftKey?"year":"month","before"],PageDown:[ce.shiftKey?"year":"month","after"],Home:["startOfWeek","before"],End:["endOfWeek","after"]};if(pe[ce.key]){ce.preventDefault(),ce.stopPropagation();const[I,F]=pe[ce.key];ee(I,F)}v==null||v(ne.date,xe,ce)},[ee,v,t.dir]),O=m.useCallback((ne,xe)=>ce=>{j==null||j(ne.date,xe,ce)},[j]),Z=m.useCallback((ne,xe)=>ce=>{g==null||g(ne.date,xe,ce)},[g]),ie=m.useCallback(ne=>xe=>{const ce=Number(xe.target.value),pe=i.setMonth(i.startOfMonth(ne),ce);A(pe)},[i,A]),le=m.useCallback(ne=>xe=>{const ce=Number(xe.target.value),pe=i.setYear(i.startOfMonth(ne),ce);A(pe)},[i,A]),{className:Ee,style:Re}=m.useMemo(()=>({className:[l[ke.Root],t.className].filter(Boolean).join(" "),style:{...N==null?void 0:N[ke.Root],...t.style}}),[l,t.className,t.style,N]),Ue=fH(t),yt=m.useRef(null);VH(yt,!!t.animate,{classNames:l,months:$,focused:te,dateLib:i});const Ct={dayPickerProps:t,selected:X,select:L,isSelected:R,months:$,nextMonth:D,previousMonth:E,goToMonth:A,getModifiers:q,components:n,classNames:l,styles:N,labels:r,formatters:s};return K.createElement(jC.Provider,{value:Ct},K.createElement(n.Root,{rootRef:t.animate?yt:void 0,className:Ee,style:Re,dir:t.dir,id:t.id,lang:t.lang,nonce:t.nonce,title:t.title,role:t.role,"aria-label":t["aria-label"],"aria-labelledby":t["aria-labelledby"],...Ue},K.createElement(n.Months,{className:l[ke.Months],style:N==null?void 0:N[ke.Months]},!t.hideNavigation&&!h&&K.createElement(n.Nav,{"data-animated-nav":t.animate?"true":void 0,className:l[ke.Nav],style:N==null?void 0:N[ke.Nav],"aria-label":we(),onPreviousClick:We,onNextClick:vt,previousMonth:E,nextMonth:D}),$.map((ne,xe)=>K.createElement(n.Month,{"data-animated-month":t.animate?"true":void 0,className:l[ke.Month],style:N==null?void 0:N[ke.Month],key:xe,displayIndex:xe,calendarMonth:ne},h==="around"&&!t.hideNavigation&&xe===0&&K.createElement(n.PreviousMonthButton,{type:"button",className:l[ke.PreviousMonthButton],tabIndex:E?void 0:-1,"aria-disabled":E?void 0:!0,"aria-label":Ne(E),onClick:We,"data-animated-button":t.animate?"true":void 0},K.createElement(n.Chevron,{disabled:E?void 0:!0,className:l[ke.Chevron],orientation:t.dir==="rtl"?"right":"left"})),K.createElement(n.MonthCaption,{"data-animated-caption":t.animate?"true":void 0,className:l[ke.MonthCaption],style:N==null?void 0:N[ke.MonthCaption],calendarMonth:ne,displayIndex:xe},c!=null&&c.startsWith("dropdown")?K.createElement(n.DropdownNav,{className:l[ke.Dropdowns],style:N==null?void 0:N[ke.Dropdowns]},(()=>{const ce=c==="dropdown"||c==="dropdown-months"?K.createElement(n.MonthsDropdown,{key:"month",className:l[ke.MonthsDropdown],"aria-label":he(),classNames:l,components:n,disabled:!!t.disableNavigation,onChange:ie(ne.date),options:NH(ne.date,M,_,s,i),style:N==null?void 0:N[ke.Dropdown],value:i.getMonth(ne.date)}):K.createElement("span",{key:"month"},T(ne.date,i)),pe=c==="dropdown"||c==="dropdown-years"?K.createElement(n.YearsDropdown,{key:"year",className:l[ke.YearsDropdown],"aria-label":Rt(i.options),classNames:l,components:n,disabled:!!t.disableNavigation,onChange:le(ne.date),options:EH(M,_,s,i,!!t.reverseYears),style:N==null?void 0:N[ke.Dropdown],value:i.getYear(ne.date)}):K.createElement("span",{key:"year"},z(ne.date,i));return i.getMonthYearOrder()==="year-first"?[pe,ce]:[ce,pe]})(),K.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"}},S(ne.date,i.options,i))):K.createElement(n.CaptionLabel,{className:l[ke.CaptionLabel],role:"status","aria-live":"polite"},S(ne.date,i.options,i))),h==="around"&&!t.hideNavigation&&xe===d-1&&K.createElement(n.NextMonthButton,{type:"button",className:l[ke.NextMonthButton],tabIndex:D?void 0:-1,"aria-disabled":D?void 0:!0,"aria-label":Ce(D),onClick:vt,"data-animated-button":t.animate?"true":void 0},K.createElement(n.Chevron,{disabled:D?void 0:!0,className:l[ke.Chevron],orientation:t.dir==="rtl"?"left":"right"})),xe===d-1&&h==="after"&&!t.hideNavigation&&K.createElement(n.Nav,{"data-animated-nav":t.animate?"true":void 0,className:l[ke.Nav],style:N==null?void 0:N[ke.Nav],"aria-label":we(),onPreviousClick:We,onNextClick:vt,previousMonth:E,nextMonth:D}),K.createElement(n.MonthGrid,{role:"grid","aria-multiselectable":u==="multiple"||u==="range","aria-label":ue(ne.date,i.options,i)||void 0,className:l[ke.MonthGrid],style:N==null?void 0:N[ke.MonthGrid]},!t.hideWeekdays&&K.createElement(n.Weekdays,{"data-animated-weekdays":t.animate?"true":void 0,className:l[ke.Weekdays],style:N==null?void 0:N[ke.Weekdays]},w&&K.createElement(n.WeekNumberHeader,{"aria-label":$e(i.options),className:l[ke.WeekNumberHeader],style:N==null?void 0:N[ke.WeekNumberHeader],scope:"col"},B()),Tt.map(ce=>K.createElement(n.Weekday,{"aria-label":Ae(ce,i.options,i),className:l[ke.Weekday],key:String(ce),style:N==null?void 0:N[ke.Weekday],scope:"col"},P(ce,i.options,i)))),K.createElement(n.Weeks,{"data-animated-weeks":t.animate?"true":void 0,className:l[ke.Weeks],style:N==null?void 0:N[ke.Weeks]},ne.weeks.map(ce=>K.createElement(n.Week,{className:l[ke.Week],key:ce.weekNumber,style:N==null?void 0:N[ke.Week],week:ce},w&&K.createElement(n.WeekNumber,{week:ce,style:N==null?void 0:N[ke.WeekNumber],"aria-label":tt(ce.weekNumber,{locale:o}),className:l[ke.WeekNumber],scope:"row",role:"rowheader"},U(ce.weekNumber,i)),ce.days.map(pe=>{const{date:I}=pe,F=q(pe);if(F[kt.focused]=!F.hidden&&!!(te!=null&&te.isEqualTo(pe)),F[ps.selected]=(R==null?void 0:R(I))||F.selected,S0(X)){const{from:Ke,to:Xe}=X;F[ps.range_start]=!!(Ke&&Xe&&i.isSameDay(I,Ke)),F[ps.range_end]=!!(Ke&&Xe&&i.isSameDay(I,Xe)),F[ps.range_middle]=ma(X,I,!0,i)}const fe=SH(F,N,t.modifiersStyles),ze=uH(F,l,t.modifiersClassNames),qe=!Be&&!F.hidden?ae(I,F,i.options,i):void 0;return K.createElement(n.Day,{key:`${i.format(I,"yyyy-MM-dd")}_${i.format(pe.displayMonth,"yyyy-MM")}`,day:pe,modifiers:F,className:ze.join(" "),style:fe,role:"gridcell","aria-selected":F.selected||void 0,"aria-label":qe,"data-day":i.format(I,"yyyy-MM-dd"),"data-month":pe.outside?i.format(I,"yyyy-MM"):void 0,"data-selected":F.selected||void 0,"data-disabled":F.disabled||void 0,"data-hidden":F.hidden||void 0,"data-outside":pe.outside||void 0,"data-focused":F.focused||void 0,"data-today":F.today||void 0},!F.hidden&&Be?K.createElement(n.DayButton,{className:l[ke.DayButton],style:N==null?void 0:N[ke.DayButton],type:"button",day:pe,modifiers:F,disabled:F.disabled||void 0,tabIndex:re(pe)?0:-1,"aria-label":ge(I,F,i.options,i),onClick:bt(pe,F),onBlur:Q(pe,F),onFocus:ft(pe,F),onKeyDown:H(pe,F),onMouseEnter:O(pe,F),onMouseLeave:Z(pe,F)},C(I,i.options,i)):!F.hidden&&C(pe.date,i.options,i))})))))))),t.footer&&K.createElement(n.Footer,{className:l[ke.Footer],style:N==null?void 0:N[ke.Footer],role:"status","aria-live":"polite"},t.footer)))}function Qn({className:e,classNames:t,showOutsideDays:n=!0,captionLayout:s="label",buttonVariant:r="ghost",formatters:i,components:o,...l}){const c=C0();return a.jsx(lB,{showOutsideDays:n,className:_e("bg-background group/calendar p-3 [--cell-size:2rem] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,e),captionLayout:s,formatters:{formatMonthDropdown:u=>u.toLocaleString("default",{month:"short"}),...i},classNames:{root:_e("w-fit",c.root),months:_e("relative flex flex-col gap-4 md:flex-row",c.months),month:_e("flex w-full flex-col gap-4",c.month),nav:_e("absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1",c.nav),button_previous:_e(Dg({variant:r}),"h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50",c.button_previous),button_next:_e(Dg({variant:r}),"h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50",c.button_next),month_caption:_e("flex h-[--cell-size] w-full items-center justify-center px-[--cell-size]",c.month_caption),dropdowns:_e("flex h-[--cell-size] w-full items-center justify-center gap-1.5 text-sm font-medium",c.dropdowns),dropdown_root:_e("has-focus:border-ring border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] relative rounded-md border",c.dropdown_root),dropdown:_e("bg-popover absolute inset-0 opacity-0",c.dropdown),caption_label:_e("select-none font-medium",s==="label"?"text-sm":"[&>svg]:text-muted-foreground flex h-8 items-center gap-1 rounded-md pl-2 pr-1 text-sm [&>svg]:size-3.5",c.caption_label),table:"w-full border-collapse",weekdays:_e("flex",c.weekdays),weekday:_e("text-muted-foreground flex-1 select-none rounded-md text-[0.8rem] font-normal",c.weekday),week:_e("mt-2 flex w-full",c.week),week_number_header:_e("w-[--cell-size] select-none",c.week_number_header),week_number:_e("text-muted-foreground select-none text-[0.8rem]",c.week_number),day:_e("group/day relative aspect-square h-full w-full select-none p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md",c.day),range_start:_e("bg-accent rounded-l-md",c.range_start),range_middle:_e("rounded-none",c.range_middle),range_end:_e("bg-accent rounded-r-md",c.range_end),today:_e("bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",c.today),outside:_e("text-muted-foreground aria-selected:text-muted-foreground",c.outside),disabled:_e("text-muted-foreground opacity-50",c.disabled),hidden:_e("invisible",c.hidden),...t},components:{Root:({className:u,rootRef:h,...d})=>a.jsx("div",{"data-slot":"calendar",ref:h,className:_e(u),...d}),Chevron:({className:u,orientation:h,...d})=>h==="left"?a.jsx(MS,{className:_e("size-4",u),...d}):h==="right"?a.jsx(t0,{className:_e("size-4",u),...d}):a.jsx(lf,{className:_e("size-4",u),...d}),DayButton:cB,WeekNumber:({children:u,...h})=>a.jsx("td",{...h,children:a.jsx("div",{className:"flex size-[--cell-size] items-center justify-center text-center",children:u})}),...o},...l})}function cB({className:e,day:t,modifiers:n,...s}){const r=C0(),i=m.useRef(null);return m.useEffect(()=>{var o;n.focused&&((o=i.current)==null||o.focus())},[n.focused]),a.jsx(W,{ref:i,variant:"ghost",size:"icon","data-day":t.date.toLocaleDateString(),"data-selected-single":n.selected&&!n.range_start&&!n.range_end&&!n.range_middle,"data-range-start":n.range_start,"data-range-end":n.range_end,"data-range-middle":n.range_middle,className:_e("data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 flex aspect-square h-auto w-full min-w-[--cell-size] flex-col gap-1 font-normal leading-none data-[range-end=true]:rounded-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] [&>span]:text-xs [&>span]:opacity-70",r.day,e),...s})}var Ef="Popover",[OC]=df(Ef,[gf]),ad=gf(),[dB,Mr]=OC(Ef),zC=e=>{const{__scopePopover:t,children:n,open:s,defaultOpen:r,onOpenChange:i,modal:o=!1}=e,l=ad(t),c=m.useRef(null),[u,h]=m.useState(!1),[d,f]=x0({prop:s,defaultProp:r??!1,onChange:i,caller:Ef});return a.jsx(c4,{...l,children:a.jsx(dB,{scope:t,contentId:ws(),triggerRef:c,open:d,onOpenChange:f,onOpenToggle:m.useCallback(()=>f(x=>!x),[f]),hasCustomAnchor:u,onCustomAnchorAdd:m.useCallback(()=>h(!0),[]),onCustomAnchorRemove:m.useCallback(()=>h(!1),[]),modal:o,children:n})})};zC.displayName=Ef;var RC="PopoverAnchor",uB=m.forwardRef((e,t)=>{const{__scopePopover:n,...s}=e,r=Mr(RC,n),i=ad(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:l}=r;return m.useEffect(()=>(o(),()=>l()),[o,l]),a.jsx(f0,{...i,...s,ref:t})});uB.displayName=RC;var UC="PopoverTrigger",$C=m.forwardRef((e,t)=>{const{__scopePopover:n,...s}=e,r=Mr(UC,n),i=ad(n),o=Xn(t,r.triggerRef),l=a.jsx(cn.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":VC(r.open),...s,ref:o,onClick:Ft(e.onClick,r.onOpenToggle)});return r.hasCustomAnchor?l:a.jsx(f0,{asChild:!0,...i,children:l})});$C.displayName=UC;var E0="PopoverPortal",[hB,fB]=OC(E0,{forceMount:void 0}),PC=e=>{const{__scopePopover:t,forceMount:n,children:s,container:r}=e,i=Mr(E0,t);return a.jsx(hB,{scope:t,forceMount:n,children:a.jsx(yi,{present:n||i.open,children:a.jsx(m0,{asChild:!0,container:r,children:s})})})};PC.displayName=E0;var Lo="PopoverContent",LC=m.forwardRef((e,t)=>{const n=fB(Lo,e.__scopePopover),{forceMount:s=n.forceMount,...r}=e,i=Mr(Lo,e.__scopePopover);return a.jsx(yi,{present:s||i.open,children:i.modal?a.jsx(xB,{...r,ref:t}):a.jsx(gB,{...r,ref:t})})});LC.displayName=Lo;var mB=a0("PopoverContent.RemoveScroll"),xB=m.forwardRef((e,t)=>{const n=Mr(Lo,e.__scopePopover),s=m.useRef(null),r=Xn(t,s),i=m.useRef(!1);return m.useEffect(()=>{const o=s.current;if(o)return z4(o)},[]),a.jsx(v0,{as:mB,allowPinchZoom:!0,children:a.jsx(HC,{...e,ref:r,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ft(e.onCloseAutoFocus,o=>{var l;o.preventDefault(),i.current||(l=n.triggerRef.current)==null||l.focus()}),onPointerDownOutside:Ft(e.onPointerDownOutside,o=>{const l=o.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,u=l.button===2||c;i.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:Ft(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1})})})}),gB=m.forwardRef((e,t)=>{const n=Mr(Lo,e.__scopePopover),s=m.useRef(!1),r=m.useRef(!1);return a.jsx(HC,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var o,l;(o=e.onCloseAutoFocus)==null||o.call(e,i),i.defaultPrevented||(s.current||(l=n.triggerRef.current)==null||l.focus(),i.preventDefault()),s.current=!1,r.current=!1},onInteractOutside:i=>{var c,u;(c=e.onInteractOutside)==null||c.call(e,i),i.defaultPrevented||(s.current=!0,i.detail.originalEvent.type==="pointerdown"&&(r.current=!0));const o=i.target;((u=n.triggerRef.current)==null?void 0:u.contains(o))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&r.current&&i.preventDefault()}})}),HC=m.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:s,onOpenAutoFocus:r,onCloseAutoFocus:i,disableOutsidePointerEvents:o,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:u,onInteractOutside:h,...d}=e,f=Mr(Lo,n),x=ad(n);return C4(),a.jsx(p0,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:r,onUnmountAutoFocus:i,children:a.jsx(uf,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:h,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:u,onDismiss:()=>f.onOpenChange(!1),children:a.jsx(d4,{"data-state":VC(f.open),role:"dialog",id:f.contentId,...x,...d,ref:t,style:{...d.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)"}})})})}),BC="PopoverClose",pB=m.forwardRef((e,t)=>{const{__scopePopover:n,...s}=e,r=Mr(BC,n);return a.jsx(cn.button,{type:"button",...s,ref:t,onClick:Ft(e.onClick,()=>r.onOpenChange(!1))})});pB.displayName=BC;var vB="PopoverArrow",bB=m.forwardRef((e,t)=>{const{__scopePopover:n,...s}=e,r=ad(n);return a.jsx(u4,{...r,...s,ref:t})});bB.displayName=vB;function VC(e){return e?"open":"closed"}var yB=zC,wB=$C,jB=PC,YC=LC;const Kn=yB,Jn=wB,zn=m.forwardRef(({className:e,align:t="start",sideOffset:n=4,...s},r)=>a.jsx(jB,{children:a.jsx(YC,{ref:r,align:t,sideOffset:n,className:_e("z-50 w-auto p-0 rounded-lg border border-white/20 bg-black text-white shadow-lg outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...s})}));zn.displayName=YC.displayName;const gw=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M20 3H2v14h8v2H8v2h8v-2h-2v-2h8V3h-2zm-6 12H4V5h16v10h-6z",fill:"currentColor"})}),Gd=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M7 8H5v2h2v2h2v2h2v2h2v-2h2v-2h2v-2h2V8h-2v2h-2v2h-2v2h-2v-2H9v-2H7V8z",fill:"currentColor"})}),NB=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M8 5v2h2V5H8zm4 4V7h-2v2h2zm2 2V9h-2v2h2zm0 2h2v-2h-2v2zm-2 2v-2h2v2h-2zm0 0h-2v2h2v-2zm-4 4v-2h2v2H8z",fill:"currentColor"})}),ls=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M15 2h2v2h4v18H3V4h4V2h2v2h6V2zM9 6H5v2h14V6H9zm-4 4v10h14V10H5zm2 2h8v2H7v-2zm4 6v-2H7v2h4z",fill:"currentColor"})}),SB=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M2 2h14v4h6v16H2V2zm18 6h-4v2h2v2h-2v2h2v2h-2v2h2v2h2V8zm-6-4H4v16h2v-2h6v2h2V4zM6 6h2v2H6V6zm6 0h-2v2h2V6zm-6 4h2v2H6v-2zm6 0h-2v2h2v-2zm-6 4h2v2H6v-2zm6 0h-2v2h2v-2z",fill:"currentColor"})}),CB=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M20 11v2H8v2H6v-2H4v-2h2V9h2v2h12zM10 7H8v2h2V7zm0 0h2V5h-2v2zm0 10H8v-2h2v2zm0 0h2v2h-2v-2z",fill:"currentColor"})}),qa=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M4 11v2h12v2h2v-2h2v-2h-2V9h-2v2H4zm10-4h2v2h-2V7zm0 0h-2V5h2v2zm0 10h2v-2h-2v2zm0 0h-2v2h2v-2z",fill:"currentColor"})}),FC=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M3 3h18v18H3V3zm16 2H5v14h14V5zM7 12h2v5H7v-5zm10-5h-2v10h2V7zm-6 3h2v2h-2v-2zm2 4h-2v3h2v-3z",fill:"currentColor"})}),ia=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M22 4H2v16h20V4zM4 18V6h16v12H4zM8 8H6v2h2v2h2v2h4v-2h2v-2h2V8h-2v2h-2v2h-4v-2H8V8z",fill:"currentColor"})}),IC=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M6 2h8v2H6V2zM4 6V4h2v2H4zm0 8H2V6h2v8zm2 2H4v-2h2v2zm8 0v2H6v-2h8zm2-2h-2v2h2v2h2v2h2v2h2v-2h-2v-2h-2v-2h-2v-2zm0-8h2v8h-2V6zm0 0V4h-2v2h2z",fill:"currentColor"})}),Cl=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M15 2H9v2H7v6h2V4h6V2zm0 8H9v2h6v-2zm0-6h2v6h-2V4zM4 16h2v-2h12v2H6v4h12v-4h2v6H4v-6z",fill:"currentColor"})}),dt=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M11 0H5v2H3v6h2v2h6V8H5V2h6V0zm0 2h2v6h-2V2zM0 14h2v4h12v2H0v-6zm2 0h12v-2H2v2zm14 0h-2v6h2v-6zM15 0h4v2h-4V0zm4 8h-4v2h4V8zm0-6h2v6h-2V2zm5 12h-2v4h-4v2h6v-6zm-6-2h4v2h-4v-2z",fill:"currentColor"})}),Vt=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M5 5h2v2H5V5zm4 4H7V7h2v2zm2 2H9V9h2v2zm2 0h-2v2H9v2H7v2H5v2h2v-2h2v-2h2v-2h2v2h2v2h2v2h2v-2h-2v-2h-2v-2h-2v-2zm2-2v2h-2V9h2zm2-2v2h-2V7h2zm0 0V5h2v2h-2z",fill:"currentColor"})}),WC=({className:e="",size:t=24})=>a.jsx(gg,{size:t,className:_e(e,"w-4 h-4")}),ga=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M2 4h20v4H2V4zm18 2v2H4V6h16zm0 6H2v4h18v-4zm-2 2v2H4v-2h14zM2 16h20v4H2v-4zm18 2v2H4v-2h16z",fill:"currentColor"})}),EB=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 2c1.1 0 2 .9 2 2s-.9 2-2 2-2-.9-2-2 .9-2 2-2zm0 4c2.21 0 4 1.79 4 4s-1.79 4-4 4-4-1.79-4-4 1.79-4 4-4zm0 6c1.38 0 2.5-1.12 2.5-2.5S13.38 11.5 12 11.5 9.5 12.62 9.5 14 10.62 16.5 12 16.5z",fill:"currentColor"})}),Qm=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M15 2H9v2H7v6h2V4h6V2zm0 8H9v2h6v-2zm0-6h2v6h-2V4zM4 16h2v-2h8v2H6v4h8v-4h2v6H4v-6zm10-4h-2v2h2v-2z",fill:"currentColor"})}),Kl=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M15 2H9v2H7v6h2V4h6V2zm0 8H9v2h6v-2zm0-6h2v6h-2V4zM4 16h2v-2h8v2H6v4h8v-4h2v6H4v-6zm12-6h-2v2h2v2h2v-2h-2v-2z",fill:"currentColor"})}),Km=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8 0-1.57.46-3.03 1.24-4.26L16.26 18.76C15.03 19.54 13.57 20 12 20zm6.76-3.74L7.74 5.24C8.97 4.46 10.43 4 12 4c4.41 0 8 3.59 8 8 0 1.57-.46 3.03-1.24 4.26z",fill:"currentColor"})}),ar=e=>a.jsx(ys,{...e,className:"w-4 h-4 animate-spin"}),kB=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M6 2h12v2H6V2zm0 2v16h12V4H6zm8 2H10v2h4V6zm-4 4h4v8h-4v-8z",fill:"currentColor"})}),MB=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M8 4h2v4h4V4h2v4h4v2h-4v4h4v2h-4v4h-2v-4H8v4H6v-4H2v-2h4V8H2V6h4V4zm2 6v4h4v-4h-4z",fill:"currentColor"})}),Un=({className:e="",size:t=24})=>a.jsx(SB,{className:e,size:t}),pw=({className:e="",size:t=24})=>a.jsx(FC,{className:e,size:t}),wu=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M4 2h12v2H4v12H2V2h2zm4 4h12v16H8V6zm2 2v12h8V8h-8z",fill:"currentColor"})}),qC=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M12 2h2v2h-2V2zm-2 4H8v2H6v2h2v2h2v-2h2V8h-2V6zm6 0h-2v2h2V6zm2 0h2v2h-2V6zm-6 8h-2v-2h2v2zm-4 0H6v-2h2v2zm-4 0H2v-2h2v2zm8 4h-2v-2h2v2zm4 0h2v-2h-2v2zm-6 2h2v2h-2v-2zm4 0h2v2h-2v-2z",fill:"currentColor"})}),TB=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M12 2h2v2h-2V2zm-2 4h6v2h-2v6h-2V8H8V6zm-4 8h12v2H4v-2zm0 4h12v2H4v-2z",fill:"currentColor"})}),ju=({className:e="",size:t=24})=>a.jsx(uR,{className:_e(e,"w-4 h-4"),size:t}),vw=({className:e="",size:t=24})=>a.jsx(cR,{className:_e(e,"w-4 h-4"),size:t}),k0=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm-1-5l6-6-1.41-1.41L11 12.17l-2.59-2.58L7 10.59l4 4z",fill:"currentColor"})}),bw=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M12 1h2v8h8v4h-2v-2h-8V5h-2V1zM8 7V5h2v2H8zM6 9V7h2v2H6zm-2 2V9h2v2H4zm10 8v2h-2v2h-2v-8H2v-4h2v2h8v6h2zm2-2v2h-2v-2h2zm2-2v2h-2v-2h2zm0 0h2v-2h-2v2z",fill:"currentColor"})}),xr=(e,t,n)=>{const s=document.createElement(e),[r,i]=Array.isArray(t)?[void 0,t]:[t,n];return r&&Object.assign(s,r),i==null||i.forEach(o=>s.appendChild(o)),s},DB=(e,t)=>{var n;return t==="left"?e.offsetLeft:(((n=e.offsetParent instanceof HTMLElement?e.offsetParent:null)==null?void 0:n.offsetWidth)??0)-e.offsetWidth-e.offsetLeft},_B=e=>e.offsetWidth>0&&e.offsetHeight>0,AB=(e,t)=>{!customElements.get(e)&&customElements.define(e,t)};function OB(e,t,{reverse:n=!1}={}){const s=e.length;for(let r=n?s-1:0;n?r>=0:r<s;n?r--:r++)t(e[r],r)}function zB(e,t,n,s){const r=t.formatToParts(e);n&&r.unshift({type:"prefix",value:n}),s&&r.push({type:"suffix",value:s});const i=[],o=[],l=[],c=[],u={},h=v=>`${v}:${u[v]=(u[v]??-1)+1}`;let d="",f=!1,x=!1;for(const v of r){d+=v.value;const j=v.type==="minusSign"||v.type==="plusSign"?"sign":v.type;j==="integer"?(f=!0,o.push(...v.value.split("").map(g=>({type:j,value:parseInt(g)})))):j==="group"?o.push({type:j,value:v.value}):j==="decimal"?(x=!0,l.push({type:j,value:v.value,key:h(j)})):j==="fraction"?l.push(...v.value.split("").map(g=>({type:j,value:parseInt(g),key:h(j),pos:-1-u[j]}))):(f||x?c:i).push({type:j,value:v.value,key:h(j)})}const b=[];for(let v=o.length-1;v>=0;v--){const j=o[v];b.unshift(j.type==="integer"?{...j,key:h(j.type),pos:u[j.type]}:{...j,key:h(j.type)})}return{pre:i,integer:b,fraction:l,post:c,valueAsString:d,value:typeof e=="string"?parseFloat(e):e}}const RB=String.raw,UB=(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0})(),$B=typeof CSS<"u"&&CSS.supports&&CSS.supports("line-height","mod(1,1)"),yw=typeof matchMedia<"u"?matchMedia("(prefers-reduced-motion: reduce)"):null,Nh="--_number-flow-d-opacity",M0="--_number-flow-d-width",Sh="--_number-flow-dx",T0="--_number-flow-d",PB=(()=>{try{return CSS.registerProperty({name:Nh,syntax:"<number>",inherits:!1,initialValue:"0"}),CSS.registerProperty({name:Sh,syntax:"<length>",inherits:!0,initialValue:"0px"}),CSS.registerProperty({name:M0,syntax:"<number>",inherits:!1,initialValue:"0"}),CSS.registerProperty({name:T0,syntax:"<number>",inherits:!0,initialValue:"0"}),!0}catch{return!1}})(),LB="var(--number-flow-char-height, 1em)",Fa="var(--number-flow-mask-height, 0.25em)",ww=`calc(${Fa} / 2)`,Ag="var(--number-flow-mask-width, 0.5em)",Or=`calc(${Ag} / var(--scale-x))`,Zd="#000 0, transparent 71%",jw=RB`:host{display:inline-block;direction:ltr;white-space:nowrap;isolation:isolate;line-height:${LB} !important}.number,.number__inner{display:inline-block;transform-origin:left top}:host([data-will-change]) :is(.number,.number__inner,.section,.digit,.digit__num,.symbol){will-change:transform}.number{--scale-x:calc(1 + var(${M0}) / var(--width));transform:translateX(var(${Sh})) scaleX(var(--scale-x));margin:0 calc(-1 * ${Ag});position:relative;-webkit-mask-image:linear-gradient(to right,transparent 0,#000 ${Or},#000 calc(100% - ${Or}),transparent ),linear-gradient(to bottom,transparent 0,#000 ${Fa},#000 calc(100% - ${Fa}),transparent 100% ),radial-gradient(at bottom right,${Zd}),radial-gradient(at bottom left,${Zd}),radial-gradient(at top left,${Zd}),radial-gradient(at top right,${Zd});-webkit-mask-size:100% calc(100% - ${Fa} * 2),calc(100% - ${Or} * 2) 100%,${Or} ${Fa},${Or} ${Fa},${Or} ${Fa},${Or} ${Fa};-webkit-mask-position:center,center,top left,top right,bottom right,bottom left;-webkit-mask-repeat:no-repeat}.number__inner{padding:${ww} ${Ag};transform:scaleX(calc(1 / var(--scale-x))) translateX(calc(-1 * var(${Sh})))}:host > :not(.number){z-index:5}.section,.symbol{display:inline-block;position:relative;isolation:isolate}.section::after{content:'\200b';display:inline-block}.section--justify-left{transform-origin:center left}.section--justify-right{transform-origin:center right}.section > [inert],.symbol > [inert]{margin:0 !important;position:absolute !important;z-index:-1}.digit{display:inline-block;position:relative;--c:var(--current) + var(${T0})}.digit__num,.number .section::after{padding:${ww} 0}.digit__num{display:inline-block;--offset-raw:mod(var(--length) + var(--n) - mod(var(--c),var(--length)),var(--length));--offset:calc( var(--offset-raw) - var(--length) * round(down,var(--offset-raw) / (var(--length) / 2),1) );--y:clamp(-100%,var(--offset) * 100%,100%);transform:translateY(var(--y))}.digit__num[inert]{position:absolute;top:0;left:50%;transform:translateX(-50%) translateY(var(--y))}.digit:not(.is-spinning) .digit__num[inert]{display:none}.symbol__value{display:inline-block;mix-blend-mode:plus-lighter;white-space:pre}.section--justify-left .symbol > [inert]{left:0}.section--justify-right .symbol > [inert]{right:0}.animate-presence{opacity:calc(1 + var(${Nh}))}`,HB=HTMLElement,BB=$B&&UB&&PB;let Qd;class XC extends HB{constructor(){super(),this.created=!1,this.batched=!1;const{animated:t,...n}=this.constructor.defaultProps;this._animated=this.computedAnimated=t,Object.assign(this,n)}get animated(){return this._animated}set animated(t){var n;this.animated!==t&&(this._animated=t,(n=this.shadowRoot)==null||n.getAnimations().forEach(s=>s.finish()))}set data(t){var n;if(t==null)return;const{pre:s,integer:r,fraction:i,post:o,value:l}=t;if(this.created){const c=this._data;this._data=t,this.computedTrend=typeof this.trend=="function"?this.trend(c.value,l):this.trend,this.computedAnimated=BB&&this._animated&&(!this.respectMotionPreference||!(yw!=null&&yw.matches))&&_B(this),(n=this.plugins)==null||n.forEach(u=>{var h;return(h=u.onUpdate)==null?void 0:h.call(u,t,c,this)}),this.batched||this.willUpdate(),this._pre.update(s),this._num.update({integer:r,fraction:i}),this._post.update(o),this.batched||this.didUpdate()}else{this._data=t,this.attachShadow({mode:"open"});try{this._internals??(this._internals=this.attachInternals()),this._internals.role="img"}catch{}if(typeof CSSStyleSheet<"u"&&this.shadowRoot.adoptedStyleSheets)Qd||(Qd=new CSSStyleSheet,Qd.replaceSync(jw)),this.shadowRoot.adoptedStyleSheets=[Qd];else{const c=document.createElement("style");c.textContent=jw,this.shadowRoot.appendChild(c)}this._pre=new Sw(this,s,{justify:"right",part:"left"}),this.shadowRoot.appendChild(this._pre.el),this._num=new VB(this,r,i),this.shadowRoot.appendChild(this._num.el),this._post=new Sw(this,o,{justify:"left",part:"right"}),this.shadowRoot.appendChild(this._post.el),this.created=!0}try{this._internals.ariaLabel=t.valueAsString}catch{}}willUpdate(){this._pre.willUpdate(),this._num.willUpdate(),this._post.willUpdate()}didUpdate(){if(!this.computedAnimated)return;this._abortAnimationsFinish?this._abortAnimationsFinish.abort():this.dispatchEvent(new Event("animationsstart")),this._pre.didUpdate(),this._num.didUpdate(),this._post.didUpdate();const t=new AbortController;Promise.all(this.shadowRoot.getAnimations().map(n=>n.finished)).then(()=>{t.signal.aborted||(this.dispatchEvent(new Event("animationsfinish")),this._abortAnimationsFinish=void 0)}),this._abortAnimationsFinish=t}}XC.defaultProps={transformTiming:{duration:900,easing:"linear(0,.005,.019,.039,.066,.096,.129,.165,.202,.24,.278,.316,.354,.39,.426,.461,.494,.526,.557,.586,.614,.64,.665,.689,.711,.731,.751,.769,.786,.802,.817,.831,.844,.856,.867,.877,.887,.896,.904,.912,.919,.925,.931,.937,.942,.947,.951,.955,.959,.962,.965,.968,.971,.973,.976,.978,.98,.981,.983,.984,.986,.987,.988,.989,.99,.991,.992,.992,.993,.994,.994,.995,.995,.996,.996,.9963,.9967,.9969,.9972,.9975,.9977,.9979,.9981,.9982,.9984,.9985,.9987,.9988,.9989,1)"},spinTiming:void 0,opacityTiming:{duration:450,easing:"ease-out"},animated:!0,trend:(e,t)=>Math.sign(t-e),respectMotionPreference:!0,plugins:void 0,digits:void 0};class VB{constructor(t,n,s,{className:r,...i}={}){this.flow=t,this._integer=new Nw(t,n,{justify:"right",part:"integer"}),this._fraction=new Nw(t,s,{justify:"left",part:"fraction"}),this._inner=xr("span",{className:"number__inner"},[this._integer.el,this._fraction.el]),this.el=xr("span",{...i,part:"number",className:`number ${r??""}`},[this._inner])}willUpdate(){this._prevWidth=this.el.offsetWidth,this._prevLeft=this.el.getBoundingClientRect().left,this._integer.willUpdate(),this._fraction.willUpdate()}update({integer:t,fraction:n}){this._integer.update(t),this._fraction.update(n)}didUpdate(){const t=this.el.getBoundingClientRect();this._integer.didUpdate(),this._fraction.didUpdate();const n=this._prevLeft-t.left,s=this.el.offsetWidth,r=this._prevWidth-s;this.el.style.setProperty("--width",String(s)),this.el.animate({[Sh]:[`${n}px`,"0px"],[M0]:[r,0]},{...this.flow.transformTiming,composite:"accumulate"})}}class GC{constructor(t,n,{justify:s,className:r,...i},o){this.flow=t,this.children=new Map,this.onCharRemove=c=>()=>{this.children.delete(c)},this.justify=s;const l=n.map(c=>this.addChar(c).el);this.el=xr("span",{...i,className:`section section--justify-${s} ${r??""}`},o?o(l):l)}addChar(t,{startDigitsAtZero:n=!1,...s}={}){const r=t.type==="integer"||t.type==="fraction"?new QC(this,t.type,n?0:t.value,t.pos,{...s,onRemove:this.onCharRemove(t.key)}):new YB(this,t.type,t.value,{...s,onRemove:this.onCharRemove(t.key)});return this.children.set(t.key,r),r}unpop(t){t.el.removeAttribute("inert"),t.el.style.top="",t.el.style[this.justify]=""}pop(t){t.forEach(n=>{n.el.style.top=`${n.el.offsetTop}px`,n.el.style[this.justify]=`${DB(n.el,this.justify)}px`}),t.forEach(n=>{n.el.setAttribute("inert",""),n.present=!1})}addNewAndUpdateExisting(t){const n=new Map,s=new Map,r=this.justify==="left",i=r?"prepend":"append";if(OB(t,o=>{let l;this.children.has(o.key)?(l=this.children.get(o.key),s.set(o,l),this.unpop(l),l.present=!0):(l=this.addChar(o,{startDigitsAtZero:!0,animateIn:!0}),n.set(o,l)),this.el[i](l.el)},{reverse:r}),this.flow.computedAnimated){const o=this.el.getBoundingClientRect();n.forEach(l=>{l.willUpdate(o)})}n.forEach((o,l)=>{o.update(l.value)}),s.forEach((o,l)=>{o.update(l.value)})}willUpdate(){const t=this.el.getBoundingClientRect();this._prevOffset=t[this.justify],this.children.forEach(n=>n.willUpdate(t))}didUpdate(){const t=this.el.getBoundingClientRect();this.children.forEach(r=>r.didUpdate(t));const n=t[this.justify],s=this._prevOffset-n;s&&this.children.size&&this.el.animate({transform:[`translateX(${s}px)`,"none"]},{...this.flow.transformTiming,composite:"accumulate"})}}class Nw extends GC{update(t){const n=new Map;this.children.forEach((s,r)=>{t.find(i=>i.key===r)||n.set(r,s),this.unpop(s)}),this.addNewAndUpdateExisting(t),n.forEach(s=>{s instanceof QC&&s.update(0)}),this.pop(n)}}class Sw extends GC{update(t){const n=new Map;this.children.forEach((s,r)=>{t.find(i=>i.key===r)||n.set(r,s)}),this.pop(n),this.addNewAndUpdateExisting(t)}}class Og{constructor(t,n,{onRemove:s,animateIn:r=!1}={}){this.flow=t,this.el=n,this._present=!0,this._remove=()=>{var i;this.el.remove(),(i=this._onRemove)==null||i.call(this)},this.el.classList.add("animate-presence"),this.flow.computedAnimated&&r&&this.el.animate({[Nh]:[-.9999,0]},{...this.flow.opacityTiming,composite:"accumulate"}),this._onRemove=s}get present(){return this._present}set present(t){if(this._present!==t){if(this._present=t,t?this.el.removeAttribute("inert"):this.el.setAttribute("inert",""),!this.flow.computedAnimated){t||this._remove();return}this.el.style.setProperty("--_number-flow-d-opacity",t?"0":"-.999"),this.el.animate({[Nh]:t?[-.9999,0]:[.999,0]},{...this.flow.opacityTiming,composite:"accumulate"}),t?this.flow.removeEventListener("animationsfinish",this._remove):this.flow.addEventListener("animationsfinish",this._remove,{once:!0})}}}class ZC extends Og{constructor(t,n,s,r){super(t.flow,s,r),this.section=t,this.value=n,this.el=s}}class QC extends ZC{constructor(t,n,s,r,i){var o,l;const c=(((l=(o=t.flow.digits)==null?void 0:o[r])==null?void 0:l.max)??9)+1,u=Array.from({length:c}).map((d,f)=>{const x=xr("span",{className:"digit__num"},[document.createTextNode(String(f))]);return f!==s&&x.setAttribute("inert",""),x.style.setProperty("--n",String(f)),x}),h=xr("span",{part:`digit ${n}-digit`,className:"digit"},u);h.style.setProperty("--current",String(s)),h.style.setProperty("--length",String(c)),super(t,s,h,i),this.pos=r,this._onAnimationsFinish=()=>{this.el.classList.remove("is-spinning")},this._numbers=u,this.length=c}willUpdate(t){const n=this.el.getBoundingClientRect();this._prevValue=this.value;const s=n[this.section.justify]-t[this.section.justify],r=n.width/2;this._prevCenter=this.section.justify==="left"?s+r:s-r}update(t){this.el.style.setProperty("--current",String(t)),this._numbers.forEach((n,s)=>s===t?n.removeAttribute("inert"):n.setAttribute("inert","")),this.value=t}didUpdate(t){const n=this.el.getBoundingClientRect(),s=n[this.section.justify]-t[this.section.justify],r=n.width/2,i=this.section.justify==="left"?s+r:s-r,o=this._prevCenter-i;o&&this.el.animate({transform:[`translateX(${o}px)`,"none"]},{...this.flow.transformTiming,composite:"accumulate"});const l=this.getDelta();l&&(this.el.classList.add("is-spinning"),this.el.animate({[T0]:[-l,0]},{...this.flow.spinTiming??this.flow.transformTiming,composite:"accumulate"}),this.flow.addEventListener("animationsfinish",this._onAnimationsFinish,{once:!0}))}getDelta(){var t;if(this.flow.plugins)for(const r of this.flow.plugins){const i=(t=r.getDelta)==null?void 0:t.call(r,this.value,this._prevValue,this);if(i!=null)return i}const n=this.value-this._prevValue,s=this.flow.computedTrend||Math.sign(n);return s<0&&this.value>this._prevValue?this.value-this.length-this._prevValue:s>0&&this.value<this._prevValue?this.length-this._prevValue+this.value:n}}class YB extends ZC{constructor(t,n,s,r){const i=xr("span",{className:"symbol__value",textContent:s});super(t,s,xr("span",{part:`symbol ${n}`,className:"symbol"},[i]),r),this.type=n,this._children=new Map,this._onChildRemove=o=>()=>{this._children.delete(o)},this._children.set(s,new Og(this.flow,i,{onRemove:this._onChildRemove(s)}))}willUpdate(t){if(this.type==="decimal")return;const n=this.el.getBoundingClientRect();this._prevOffset=n[this.section.justify]-t[this.section.justify]}update(t){if(this.value!==t){const n=this._children.get(this.value);n&&(n.present=!1);const s=this._children.get(t);if(s)s.present=!0;else{const r=xr("span",{className:"symbol__value",textContent:t});this.el.appendChild(r),this._children.set(t,new Og(this.flow,r,{animateIn:!0,onRemove:this._onChildRemove(t)}))}}this.value=t}didUpdate(t){if(this.type==="decimal")return;const n=this.el.getBoundingClientRect()[this.section.justify]-t[this.section.justify],s=this._prevOffset-n;s&&this.el.animate({transform:[`translateX(${s}px)`,"none"]},{...this.flow.transformTiming,composite:"accumulate"})}}var Mw;const FB=parseInt((Mw=m.version.match(/^(\d+)\./))==null?void 0:Mw[1]),D0=FB>=19,IB=["data","digits"];class _0 extends XC{attributeChangedCallback(t,n,s){this[t]=JSON.parse(s)}}_0.observedAttributes=D0?[]:IB;AB("number-flow-react",_0);const Jm={},Cw=D0?e=>e:JSON.stringify;function Ew(e){const{transformTiming:t,spinTiming:n,opacityTiming:s,animated:r,respectMotionPreference:i,trend:o,plugins:l,...c}=e;return[{transformTiming:t,spinTiming:n,opacityTiming:s,animated:r,respectMotionPreference:i,trend:o,plugins:l},c]}class WB extends m.Component{updateProperties(t){if(!this.el)return;this.el.batched=!this.props.isolate;const[n]=Ew(this.props);Object.entries(n).forEach(([s,r])=>{this.el[s]=r??_0.defaultProps[s]}),t!=null&&t.onAnimationsStart&&this.el.removeEventListener("animationsstart",t.onAnimationsStart),this.props.onAnimationsStart&&this.el.addEventListener("animationsstart",this.props.onAnimationsStart),t!=null&&t.onAnimationsFinish&&this.el.removeEventListener("animationsfinish",t.onAnimationsFinish),this.props.onAnimationsFinish&&this.el.addEventListener("animationsfinish",this.props.onAnimationsFinish)}componentDidMount(){this.updateProperties(),D0&&this.el&&(this.el.digits=this.props.digits,this.el.data=this.props.data)}getSnapshotBeforeUpdate(t){var n;if(this.updateProperties(t),t.data!==this.props.data){if(this.props.group)return this.props.group.willUpdate(),()=>{var s;return(s=this.props.group)==null?void 0:s.didUpdate()};if(!this.props.isolate)return(n=this.el)==null||n.willUpdate(),()=>{var s;return(s=this.el)==null?void 0:s.didUpdate()}}return null}componentDidUpdate(t,n,s){s==null||s()}handleRef(t){this.props.innerRef&&(this.props.innerRef.current=t),this.el=t}render(){const[t,{innerRef:n,className:s,data:r,willChange:i,isolate:o,group:l,digits:c,onAnimationsStart:u,onAnimationsFinish:h,...d}]=Ew(this.props);return m.createElement("number-flow-react",{ref:this.handleRef,"data-will-change":i?"":void 0,class:s,...d,dangerouslySetInnerHTML:{__html:""},suppressHydrationWarning:!0,digits:Cw(c),data:Cw(r)})}constructor(t){super(t),this.handleRef=this.handleRef.bind(this)}}const qB=m.forwardRef(function({value:t,locales:n,format:s,prefix:r,suffix:i,...o},l){m.useImperativeHandle(l,()=>c.current,[]);const c=m.useRef(),u=m.useContext(XB);u==null||u.useRegister(c);const h=m.useMemo(()=>n?JSON.stringify(n):"",[n]),d=m.useMemo(()=>s?JSON.stringify(s):"",[s]),f=m.useMemo(()=>{var b;const x=Jm[b=`${h}:${d}`]??(Jm[b]=new Intl.NumberFormat(n,s));return zB(t,x,r,i)},[t,h,d,r,i]);return m.createElement(WB,{...o,group:u,data:f,innerRef:c})}),XB=m.createContext(void 0),GB={notation:"compact",maximumFractionDigits:1};function vs({value:e,loading:t=!1,className:n,prefix:s,suffix:r,format:i,trend:o,fallback:l="…"}){const c=m.useMemo(()=>{if(e==null)return 0;const d=Number(e);return Number.isFinite(d)?d:0},[e]);if(t)return a.jsxs("span",{className:fh("inline-flex items-baseline",n),children:[s,l,r]});const u=qB,h=typeof o=="boolean"?o?1:0:o;return a.jsxs("span",{className:fh("inline-flex",n),children:[s,a.jsx(u,{value:c,format:i??GB,trend:h,className:"inline-flex"}),r]})}function Ln({id:e,label:t="ID",className:n="",variant:s="inline"}){const[r,i]=m.useState(!1),o=async()=>{try{await navigator.clipboard.writeText(e),i(!0),V.success("Copied to clipboard"),setTimeout(()=>i(!1),2e3)}catch{V.error("Failed to copy to clipboard")}};return s==="detail"?a.jsxs("div",{className:`flex justify-between items-center ${n}`,children:[a.jsxs("span",{className:"text-gray-400",children:[t,":"]}),a.jsxs("button",{onClick:o,className:"flex items-center gap-2 text-white text-sm hover:text-white/80 transition-colors group",title:"Click to copy",children:[a.jsx("span",{className:"font-mono",children:e}),r?a.jsx(xg,{className:"w-3 h-3 text-green-500"}):a.jsx(by,{className:"w-3 h-3 text-gray-400 group-hover:text-white transition-colors"})]})]}):s==="subscript"?a.jsxs("sup",{onClick:o,className:`text-xs text-gray-500 ml-2 cursor-pointer hover:text-white transition-colors inline-flex items-center gap-1 ${n}`,title:"Click to copy User ID",children:[a.jsx("span",{className:"mr-1",children:"["}),a.jsxs("span",{className:"text-white/80 font-mono text-xs",children:[e.slice(0,8),"..."]}),a.jsx("span",{className:"ml-1",children:"]"})]}):a.jsxs("button",{onClick:o,className:`flex items-center gap-1.5 text-sm text-gray-400 hover:text-white transition-colors group ${n}`,title:"Click to copy",children:[a.jsxs("span",{children:[t,":"]}),a.jsx("span",{className:"font-mono",children:e}),r?a.jsx(xg,{className:"w-3 h-3 text-green-500"}):a.jsx(by,{className:"w-3 h-3 opacity-0 group-hover:opacity-100 transition-opacity"})]})}function mi({title:e="Seeding Terminal",lines:t,isRunning:n=!1,className:s="",defaultCollapsed:r=!1}){const[i,o]=m.useState(r),l=m.useRef(null);m.useEffect(()=>{const d=l.current;!d||i||d.scrollTo({top:d.scrollHeight,behavior:"smooth"})},[i]);const c=d=>{switch(d.type){case"success":return a.jsx(Bt,{className:"w-3 h-3 text-green-400"});case"error":return a.jsx(Hr,{className:"w-3 h-3 text-red-400"});case"progress":return d.status==="running"?a.jsx(ys,{className:"w-3 h-3 text-blue-400 animate-spin"}):d.status==="completed"?a.jsx(Bt,{className:"w-3 h-3 text-green-400"}):d.status==="failed"?a.jsx(Hr,{className:"w-3 h-3 text-red-400"}):a.jsx("div",{className:"w-3 h-3 border border-gray-500 rounded-full"});default:return a.jsx("div",{className:"w-3 h-3 border border-gray-500 rounded-full"})}},u=d=>{switch(d.type){case"success":return"text-green-400";case"error":return"text-red-400";case"progress":return d.status==="running"?"text-blue-400":d.status==="completed"?"text-green-400":d.status==="failed"?"text-red-400":"text-gray-400";default:return"text-gray-300"}},h=d=>d.toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"})+"."+d.getMilliseconds().toString().padStart(3,"0");return a.jsxs("div",{className:`bg-black/90 border border-dashed border-white/20 rounded-none font-mono text-xs ${s}`,children:[a.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-dashed border-white/10",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(dR,{className:"w-3 h-3 text-green-400"}),a.jsx("span",{className:"text-green-400 font-medium text-xs",children:e})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[n&&a.jsxs("div",{className:"flex items-center space-x-1",children:[a.jsx("div",{className:"w-1.5 h-1.5 bg-green-400 rounded-full animate-pulse"}),a.jsx("span",{className:"text-green-400 text-xs",children:"RUNNING"})]}),a.jsxs("div",{className:"text-gray-400 text-xs",children:[t.length," / ",t.length]}),a.jsx("button",{onClick:()=>o(!i),className:"text-gray-400 hover:text-white transition-colors",children:i?a.jsx(lf,{className:"w-3 h-3"}):a.jsx(sR,{className:"w-3 h-3"})})]})]}),!i&&a.jsxs("div",{ref:l,className:"p-3 space-y-0.5 h-56 overflow-y-auto",children:[t.length===0?a.jsxs("div",{className:"text-gray-500 italic text-xs",children:[a.jsx("span",{className:"text-green-400",children:"$"})," Waiting for operations..."]}):t.map(d=>a.jsxs("div",{className:`flex items-start space-x-3 py-1 ${u(d)} text-xs`,children:[a.jsx("span",{className:"text-gray-500 text-xs w-20 flex-shrink-0",children:h(d.timestamp)}),a.jsx("span",{className:"text-green-400 flex-shrink-0",children:"$"}),a.jsx("div",{className:"flex-shrink-0 mt-0.5",children:c(d)}),a.jsx("span",{className:"flex-1 min-w-0 break-words",children:d.message})]},d.id)),n&&a.jsxs("div",{className:"flex items-start space-x-3 py-1 text-green-400 text-xs",children:[a.jsx("span",{className:"text-gray-500 text-xs w-20 flex-shrink-0",children:h(new Date)}),a.jsx("span",{className:"text-green-400 flex-shrink-0",children:"$"}),a.jsx("div",{className:"w-3 h-3 flex-shrink-0 mt-0.5"}),a.jsx("span",{className:"flex-1 flex items-center",children:a.jsx("span",{className:"animate-pulse",children:"█"})})]})]}),!i&&a.jsx("div",{className:"px-3 py-1.5 border-t border-dashed border-white/10 bg-black/50",children:a.jsxs("div",{className:"flex items-center justify-between text-xs text-gray-400",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs("span",{children:["Status: ",n?"Active":"Idle"]}),a.jsxs("span",{children:["Lines: ",t.length]})]}),a.jsxs("div",{className:"flex items-center space-x-1",children:[a.jsx("div",{className:"w-1.5 h-1.5 bg-green-400 rounded-full"}),a.jsx("span",{children:"Better Auth Studio"})]})]})})]})}const KC=document.createElement("style");KC.textContent=`
428
- @keyframes fadeIn {
429
- from {
430
- opacity: 0;
431
- transform: translateX(-10px);
432
- }
433
- to {
434
- opacity: 1;
435
- transform: translateX(0);
436
- }
437
- }
438
-
439
- .animate-fadeIn {
440
- animation: fadeIn 0.3s ease-out forwards;
441
- }
442
- `;document.head.appendChild(KC);const Le=m.forwardRef(({className:e,type:t,...n},s)=>a.jsx("input",{type:t,className:`flex h-10 w-full border border-dashed border-white/20 bg-black/30 px-3 py-2 text-sm text-white placeholder:text-gray-400 focus:outline-none focus:ring-1 focus:ring-white focus:border-white/40 disabled:cursor-not-allowed disabled:opacity-50 rounded-none ${e}`,ref:s,...n}));Le.displayName="Input";const Pe=m.forwardRef(({className:e,...t},n)=>a.jsx("label",{className:`text-sm font-light text-white ${e}`,ref:n,...t}));Pe.displayName="Label";function JC({currentPage:e,totalPages:t,onPageChange:n,totalItems:s,startIndex:r,endIndex:i}){const o=()=>{const u=[],h=[];for(let d=Math.max(2,e-2);d<=Math.min(t-1,e+2);d++)u.push(d);return e-2>2?h.push(1,"..."):h.push(1),h.push(...u),e+2<t-1?h.push("...",t):t>1&&h.push(t),h};if(t<=1)return null;const l=o();return a.jsxs("div",{className:"flex items-center justify-between mt-6",children:[a.jsxs("div",{className:"text-sm text-gray-400",children:["Showing ",r+1," to ",Math.min(i,s)," of ",s," items"]}),a.jsxs("div",{className:"flex items-center space-x-1",children:[a.jsxs(W,{variant:"outline",size:"sm",onClick:()=>n(e-1),disabled:e===1,className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:[a.jsx(MS,{className:"w-4 h-4"}),"Previous"]}),l.map((c,u)=>{if(c==="...")return a.jsx(W,{variant:"outline",size:"sm",disabled:!0,className:"border border-dashed border-white/20 text-white rounded-none",children:a.jsx(lR,{className:"w-4 h-4"})},`dots-${u}`);const h=c,d=e===h;return a.jsx(W,{variant:d?"default":"outline",size:"sm",onClick:()=>n(h),className:d?"bg-white text-black rounded-none":"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:h},h)}),a.jsxs(W,{variant:"outline",size:"sm",onClick:()=>n(e+1),disabled:e===t,className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:["Next",a.jsx(t0,{className:"w-4 h-4"})]})]})]})}const rd=m.createContext({isOpen:!1,setIsOpen:()=>{}}),us=m.forwardRef(({className:e,value:t,onValueChange:n,children:s,...r},i)=>{const[o,l]=m.useState(!1);return a.jsx(rd.Provider,{value:{value:t,onValueChange:n,isOpen:o,setIsOpen:l},children:a.jsx("div",{ref:i,className:`relative ${e}`,...r,children:s})})});us.displayName="Select";const hs=m.forwardRef(({className:e,children:t,...n},s)=>{const{isOpen:r,setIsOpen:i}=m.useContext(rd);return a.jsxs("button",{ref:s,type:"button",className:`flex h-10 w-full items-center justify-between border bg-black/30 px-3 py-2 text-sm text-white focus:outline-none focus:ring-1 focus:ring-white focus:border-white/40 disabled:cursor-not-allowed disabled:opacity-50 rounded-none ${e}`,onClick:()=>i(!r),...n,children:[t,a.jsx(lf,{className:`h-4 w-4 text-gray-400 transition-transform ${r?"rotate-180":""}`})]})});hs.displayName="SelectTrigger";const Jr=m.forwardRef(({className:e,placeholder:t,...n},s)=>{const{value:r}=m.useContext(rd);return a.jsx("span",{ref:s,className:`text-sm text-white ${e}`,...n,children:r||t})});Jr.displayName="SelectValue";const fs=m.forwardRef(({className:e,children:t,...n},s)=>{const{isOpen:r}=m.useContext(rd);return r?a.jsx("div",{ref:s,className:`absolute top-full left-0 right-0 z-50 mt-1 border border-dashed border-white/20 bg-black rounded-none shadow-lg ${e}`,...n,children:t}):null});fs.displayName="SelectContent";const ct=m.forwardRef(({className:e,children:t,value:n,...s},r)=>{const{onValueChange:i,setIsOpen:o}=m.useContext(rd);return a.jsx("div",{ref:r,className:`px-3 py-2 text-sm text-white hover:bg-white/10 cursor-pointer ${e}`,onClick:()=>{i==null||i(n),o(!1)},...s,children:t})});ct.displayName="SelectItem";function eE(){const e=Cs(),{counts:t,refetchCounts:n}=yf(),[s,r]=m.useState([]),[i,o]=m.useState(!0),[l,c]=m.useState(null),[u,h]=m.useState(""),[d,f]=m.useState("all"),[x,b]=m.useState([]),[v,j]=m.useState(1),[g]=m.useState(20),[y,p]=m.useState(!1),[w,N]=m.useState(!1),[S,C]=m.useState(!1),[T,U]=m.useState(!1),[B,P]=m.useState(!1),[z,Y]=m.useState(!1),[k,$]=m.useState(null),[M,_]=m.useState([]),[E,D]=m.useState(!1),[A,q]=m.useState({name:"",slug:""}),[R,L]=m.useState({name:"",slug:""});m.useEffect(()=>{se()},[]);const X=O=>O.toLowerCase().replace(/\s+/g,"-").replace(/[^a-z0-9-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,""),G=O=>{const Z=X(O);q({name:O,slug:Z})},te=O=>{q(Z=>({...Z,slug:X(O)}))},re=O=>{const Z=X(O);L({name:O,slug:Z})},ee=O=>{L(Z=>({...Z,slug:X(O)}))},se=async()=>{try{const Z=await(await fetch("/api/plugins")).json(),ie=(Z==null?void 0:Z.plugins).find(le=>le.id==="organization");c({enabled:!!ie,availablePlugins:(Z==null?void 0:Z.plugins).map(le=>le.id),configPath:Z.configPath,organizationPlugin:(Z==null?void 0:Z.plugins).find(le=>le.id==="organization")}),ie?await ge():o(!1)}catch(O){console.error("Failed to check plugin status:",O),c({enabled:!1,error:"Failed to check plugin status"}),o(!1)}},ge=async()=>{try{const Z=await(await fetch("/api/organizations?limit=10000")).json();console.log({lenght:Z.organizations.length}),r(Z.organizations||[])}catch(O){console.error("Failed to fetch organizations:",O),V.error("Failed to fetch organizations")}finally{o(!1)}},ae=async O=>{_([]),D(!0),_([{id:"start",type:"info",message:`Starting organization seeding process for ${O} organizations...`,timestamp:new Date}]);try{const ie=await(await fetch("/api/seed/organizations",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:O})})).json();if(ie.success){const le=ie.results.map((Re,Ue)=>Re.success?{id:`org-${Ue}`,type:"progress",message:`Creating organization: ${Re.organization.name} (${Re.organization.slug})`,timestamp:new Date,status:"completed"}:{id:`org-${Ue}`,type:"error",message:`Failed to create organization ${Ue+1}: ${Re.error}`,timestamp:new Date});_(Re=>[...Re,...le]);const Ee=ie.results.filter(Re=>Re.success).length;_(Re=>[...Re,{id:"complete",type:"success",message:`✅ Seeding completed! Created ${Ee}/${O} organizations successfully`,timestamp:new Date}]),await ge(),await n()}else _(le=>[...le,{id:"error",type:"error",message:`❌ Seeding failed: ${ie.error||"Unknown error"}`,timestamp:new Date}])}catch(Z){_(ie=>[...ie,{id:"error",type:"error",message:`❌ Network error: ${Z}`,timestamp:new Date}])}finally{D(!1)}},ue=O=>{$(O),P(!0)},he=O=>{$(O),L({name:O.name,slug:O.slug}),C(!0)},we=O=>{$(O),U(!0)},Ne=async()=>{if(!A.name){V.error("Please fill in the organization name");return}const O=V.loading("Creating organization...");try{const ie=await(await fetch("/api/organizations",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:A.name,slug:A.slug})})).json();ie.success?(await ge(),p(!1),q({name:"",slug:""}),V.success("Organization created successfully!",{id:O})):V.error(`Error creating organization: ${ie.error||"Unknown error"}`,{id:O})}catch(Z){console.error("Error creating organization:",Z),V.error("Error creating organization",{id:O})}},Ce=async()=>{if(!k){V.error("No organization selected");return}if(!R.name){V.error("Please fill in the organization name");return}const O=V.loading("Updating organization...");try{const ie=await(await fetch(`/api/organizations/${k.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:R.name,slug:R.slug})})).json();ie.success?(await ge(),C(!1),$(null),L({name:"",slug:""}),V.success("Organization updated successfully!",{id:O})):V.error(`Error updating organization: ${ie.error||"Unknown error"}`,{id:O})}catch(Z){console.error("Error updating organization:",Z),V.error("Error updating organization",{id:O})}},Ae=async()=>{if(!k){V.error("No organization selected");return}const O=V.loading("Deleting organization...");try{const ie=await(await fetch(`/api/organizations/${k.id}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})).json();ie.success?(await ge(),await n(),U(!1),$(null),V.success("Organization deleted successfully!",{id:O})):V.error(`Error deleting organization: ${ie.error||"Unknown error"}`,{id:O})}catch(Z){console.error("Error deleting organization:",Z),V.error("Error deleting organization",{id:O})}},tt=()=>{if(s.length===0){V.error("No organizations to export");return}const O=["ID","Name","Slug","Created At","Updated At"],Z=s.map(Ue=>[Ue.id,Ue.name||"",Ue.slug||"",new Date(Ue.createdAt).toLocaleString(),new Date(Ue.updatedAt).toLocaleString()]),ie=[O.join(","),...Z.map(Ue=>Ue.map(yt=>`"${yt}"`).join(","))].join(`
443
- `),le=new Blob([ie],{type:"text/csv;charset=utf-8;"}),Ee=document.createElement("a"),Re=URL.createObjectURL(le);Ee.setAttribute("href",Re),Ee.setAttribute("download",`organizations-export-${new Date().toISOString().split("T")[0]}.csv`),Ee.style.visibility="hidden",document.body.appendChild(Ee),Ee.click(),document.body.removeChild(Ee),V.success(`Exported ${s.length} organizations to CSV`)},$e=O=>{x.some(Z=>Z.type===O)||b([...x,{type:O}])},Rt=O=>{b(x.filter(Z=>Z.type!==O))},Tt=()=>{b([])},Be=(O,Z)=>{b(ie=>ie.map(le=>le.type===O?{...le,dateRange:Z}:le))},We=s.filter(O=>{const Z=O.name.toLowerCase().includes(u.toLowerCase())||O.slug.toLowerCase().includes(u.toLowerCase());if(x.length===0)return Z;const ie=x.every(le=>{var Ee,Re,Ue,yt;switch(le.type){case"createdAt":{if(!((Ee=le.dateRange)!=null&&Ee.from)&&!((Re=le.dateRange)!=null&&Re.to))return!0;const Ct=new Date(O.createdAt);return!((Ue=le.dateRange)!=null&&Ue.from&&le.dateRange.from>Ct||(yt=le.dateRange)!=null&&yt.to&&le.dateRange.to<Ct)}default:return!0}});return Z&&ie}),vt=Math.ceil(We.length/g),bt=(v-1)*g,ft=bt+g,Q=We.slice(bt,ft),H=O=>{j(O)};return i?a.jsx("div",{className:"flex min-h-screen items-center justify-center h-full",children:a.jsxs("div",{className:"flex flex-col items-center space-y-3",children:[a.jsx(ys,{className:"w-6 h-6 text-white animate-spin"}),a.jsx("div",{className:"text-white text-sm",children:"Loading organizations..."})]})}):l&&!l.enabled?a.jsxs("div",{className:"space-y-6 p-6",children:[a.jsx("div",{className:"flex items-center justify-between",children:a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl text-white font-light",children:"Organizations"}),a.jsx("p",{className:"text-gray-400 font-light text-sm mt-1 uppercase font-mono",children:"Manage your application organizations"})]})}),a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-8",children:a.jsxs("div",{className:"flex items-start space-x-4",children:[a.jsx("div",{className:"flex-shrink-0",children:a.jsx(Rs,{className:"w-12 h-12 text-white"})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h3",{className:"text-xl text-white font-light mb-2",children:"Organization Plugin Required"}),a.jsx("p",{className:"text-gray-300 mb-6",children:"To use Organizations in Better Auth Studio, you need to enable the organization plugin in your Better Auth configuration."}),a.jsxs("div",{className:"bg-black/50 border border-dashed border-white/20 rounded-none p-4 mb-6",children:[a.jsx("h4",{className:"text-white font-light mb-3",children:"Follow these steps:"}),a.jsx("ol",{className:"text-gray-300 space-y-2 text-sm list-decimal list-inside",children:a.jsxs("li",{children:["Import the plugin in your auth configuration file",l.configPath&&a.jsxs("span",{className:"text-gray-400",children:[" (",l.configPath,")"]}),":"]})}),a.jsx("div",{className:"mt-4 bg-black/70 border border-dashed border-white/10 rounded-none p-3 overflow-x-auto",children:a.jsxs("pre",{className:"text-sm text-gray-300",children:[a.jsx("span",{className:"text-blue-400",children:"import"})," ","{ betterAuth }"," ",a.jsx("span",{className:"text-blue-400",children:"from"})," ",a.jsx("span",{className:"text-green-400",children:'"better-auth"'})," ",a.jsx("br",{}),a.jsx("span",{className:"text-blue-400",children:"import"})," ","{ organization }"," ",a.jsx("span",{className:"text-blue-400",children:"from"})," ",a.jsx("span",{className:"text-green-400",children:'"better-auth/plugins/organization"'})," ",a.jsx("br",{}),a.jsx("span",{className:"text-blue-400",children:"export const"})," ",a.jsx("span",{className:"text-yellow-300",children:"auth"})," ="," ",a.jsx("span",{className:"text-yellow-300",children:"betterAuth"}),"(","{"," ",a.jsx("br",{}),a.jsx("span",{className:"text-gray-500 pl-10",children:"// ... your existing configuration"})," ",a.jsx("br",{}),a.jsx("span",{className:"text-red-300 pl-10",children:"plugins"}),": [ ",a.jsx("br",{}),a.jsxs("span",{className:"text-yellow-300 pl-12",children:["organization(",")"]}),a.jsx("br",{}),a.jsx("span",{className:"pl-10",children:"]"})," ",a.jsx("br",{}),"}",") ",a.jsx("br",{})]})}),a.jsx("div",{className:"mt-4",children:a.jsx("p",{className:"text-gray-400 text-sm",children:"2. Do migrations to create the organizations table"})}),a.jsx("div",{className:"mt-2",children:a.jsx("p",{className:"text-gray-400 text-sm",children:"3. Restart your application to apply the changes"})})]}),l.availablePlugins&&l.availablePlugins.length>0&&a.jsx("div",{className:"mb-4",children:a.jsxs("p",{className:"text-gray-400 text-sm",children:["Currently enabled plugins: ",l.availablePlugins.join(", ")]})}),a.jsx(W,{onClick:()=>window.location.reload(),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Check Again"}),a.jsxs("div",{className:"mt-4 text-xs text-gray-500",children:["Need help? Check the"," ",a.jsx("a",{href:"https://better-auth.com/docs/plugins/organization",target:"_blank",rel:"noopener noreferrer",className:"text-white hover:underline",children:"Better Auth Organization Plugin Documentation"})]})]})]})})]}):a.jsxs("div",{className:"space-y-6 p-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsxs("h1",{className:"text-2xl relative text-white font-light inline-flex items-start",children:["Organizations",a.jsx("sup",{className:"text-xs text-gray-500 ml-1 mt-0 inline-flex items-baseline",children:a.jsx(vs,{value:t.organizations??0,className:"text-white font-mono text-sm",prefix:a.jsx("span",{className:"mr-1 text-gray-500",children:"["}),suffix:a.jsx("span",{className:"ml-1 text-gray-500",children:"]"}),format:{notation:"standard",maximumFractionDigits:0}})})]}),a.jsx("p",{className:"text-gray-400 font-light text-sm mt-1 uppercase font-mono",children:"Manage your organizations and teams"})]}),a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs(W,{className:"border border-dashed border-white/20 text-white hover:bg-white/10 bg-transparent rounded-none",onClick:tt,children:[a.jsx(TS,{className:"w-4 h-4 mr-2"}),"Export CSV"]}),a.jsxs(W,{className:"border border-dashed border-white/20 text-white hover:bg-white/10 bg-transparent rounded-none",onClick:()=>Y(!0),children:[a.jsx(_t,{className:"w-4 h-4 mr-2"}),"Seed"]}),a.jsxs(W,{className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",onClick:()=>p(!0),children:[a.jsx(mr,{className:"w-4 h-4 mr-2"}),"Add Organization"]})]})]}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex items-center space-x-4",children:[a.jsxs("div",{className:"flex-1 relative",children:[a.jsx(li,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-4 h-4"}),a.jsx(Le,{placeholder:"Search organizations...",value:u,onChange:O=>h(O.target.value),className:"pl-10 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsx("div",{className:"flex items-center space-x-2",children:a.jsxs(us,{value:"",onValueChange:$e,children:[a.jsx(hs,{className:"w-[180px]",children:a.jsxs("div",{className:"flex mr-3 items-center space-x-2",children:[a.jsx(mr,{className:"w-4 h-4"}),a.jsx("span",{children:"Add Filter"})]})}),a.jsx(fs,{children:!x.some(O=>O.type==="createdAt")&&a.jsx(ct,{value:"createdAt",children:"Created Date"})})]})}),x.length>0&&a.jsx("div",{className:"flex items-center space-x-2",children:a.jsx(W,{onClick:Tt,children:"Clear all"})})]}),x.length>0&&a.jsx("div",{className:"space-y-3",children:a.jsx("div",{className:"flex flex-wrap gap-3",children:x.map(O=>{var Z,ie,le,Ee;return a.jsxs("div",{className:"inline-flex items-center gap-2 px-3 py-2 bg-white/10 border border-white/20 rounded-sm",children:[a.jsx(n0,{className:"w-3 h-3 text-white"}),O.type==="createdAt"&&a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-sm text-white",children:"Created:"}),a.jsxs(Kn,{children:[a.jsx(Jn,{asChild:!0,children:a.jsxs(W,{variant:"outline",className:"h-8 px-3 text-xs font-mono uppercase text-gray-400 hover:text-white bg-transparent border-white/10 hover:bg-white/5",children:[a.jsx(uh,{className:"mr-1 h-3 w-3"}),(Z=O.dateRange)!=null&&Z.from?Zn(O.dateRange.from,"MMM dd yyyy"):"From"]})}),a.jsx(zn,{className:"w-auto p-0 bg-black border-white/10",children:a.jsx(Qn,{mode:"single",selected:(ie=O.dateRange)==null?void 0:ie.from,onSelect:Re=>{var Ue;return Be("createdAt",{from:Re,to:(Ue=O.dateRange)==null?void 0:Ue.to})},initialFocus:!0,className:"rounded-none"})})]}),a.jsxs(Kn,{children:[a.jsx(Jn,{asChild:!0,children:a.jsxs(W,{variant:"outline",className:"h-8 px-3 text-xs font-mono uppercase text-gray-400 hover:text-white bg-transparent border-white/10 hover:bg-white/5",children:[a.jsx(uh,{className:"mr-1 h-3 w-3"}),(le=O.dateRange)!=null&&le.to?Zn(O.dateRange.to,"MMM dd yyyy"):"To"]})}),a.jsx(zn,{className:"w-auto p-0 bg-black border-white/10",children:a.jsx(Qn,{mode:"single",selected:(Ee=O.dateRange)==null?void 0:Ee.to,onSelect:Re=>{var Ue;return Be("createdAt",{from:(Ue=O.dateRange)==null?void 0:Ue.from,to:Re})},initialFocus:!0,disabled:Re=>{var Ue;return(Ue=O.dateRange)!=null&&Ue.from?Re<O.dateRange.from:!1},className:"rounded-none"})})]})]}),a.jsx("button",{onClick:()=>Rt(O.type),className:"ml-1 hover:bg-white/20 rounded-full p-0.5",children:a.jsx(Xt,{className:"w-3 h-3 text-white"})})]},O.type)})})})]}),a.jsxs("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none",children:[a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-dashed border-white/10",children:[a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Organization"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Slug"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Created"}),a.jsx("th",{className:"text-right py-4 px-4 text-white font-light",children:"Actions"})]})}),a.jsx("tbody",{children:We.length===0?a.jsx("tr",{children:a.jsx("td",{colSpan:4,className:"py-12 px-4 text-center",children:a.jsxs("div",{className:"flex flex-col items-center space-y-4",children:[a.jsx("div",{className:"w-16 h-16 rounded-none border border-dashed border-white/20 bg-white/10 flex items-center justify-center",children:a.jsx(Rs,{className:"w-8 h-8 text-white/50"})}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-white font-medium text-lg",children:"No organizations found"}),a.jsx("p",{className:"text-gray-400 text-sm mt-1",children:u||d!=="all"?"Try adjusting your search or filter criteria":"Get started by creating your first organization"})]}),!u&&d==="all"&&a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs(W,{onClick:()=>p(!0),className:"bg-white text-black hover:bg-gray-200 rounded-none",children:[a.jsx(mr,{className:"w-4 h-4 mr-2"}),"Create Organization"]}),a.jsxs(W,{onClick:()=>Y(!0),className:"border border-dashed border-white/20 text-white hover:bg-white/10 bg-transparent rounded-none",children:[a.jsx(_t,{className:"w-4 h-4 mr-2"}),"Seed Data"]})]})]})})}):Q.map(O=>a.jsxs("tr",{className:"border-b border-dashed border-white/5 hover:bg-white/5 cursor-pointer",onClick:()=>e(`/organizations/${O.id}`),children:[a.jsx("td",{className:"py-4 px-4",children:a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-10 h-10 rounded-none border border-dashed border-white/20 bg-white/10 flex items-center justify-center",children:a.jsx(Rs,{className:"w-5 h-5 text-white"})}),a.jsxs("div",{children:[a.jsx("div",{className:"text-white font-light",children:O.name}),a.jsx(Ln,{id:O.id})]})]})}),a.jsx("td",{className:"py-4 px-4 text-white",children:O.slug}),a.jsx("td",{className:"py-4 px-4 text-sm text-gray-400",children:a.jsxs("div",{className:"flex flex-col",children:[new Date(O.createdAt).toLocaleDateString(),a.jsx("p",{className:"text-xs",children:new Date(O.createdAt).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})})]})}),a.jsx("td",{className:"py-4 px-4 text-right",children:a.jsxs("div",{className:"flex items-center justify-end space-x-2",children:[a.jsx(W,{variant:"ghost",size:"sm",className:"text-gray-400 hover:text-white rounded-none",onClick:Z=>{Z.stopPropagation(),ue(O)},children:a.jsx(Go,{className:"w-4 h-4"})}),a.jsx(W,{variant:"ghost",size:"sm",className:"text-gray-400 hover:text-white rounded-none",onClick:Z=>{Z.stopPropagation(),he(O)},children:a.jsx(oi,{className:"w-4 h-4"})}),a.jsx(W,{variant:"ghost",size:"sm",className:"text-red-400 hover:text-red-300 rounded-none",onClick:Z=>{Z.stopPropagation(),we(O)},children:a.jsx(cf,{className:"w-4 h-4"})})]})})]},O.id))})]})}),a.jsx(JC,{currentPage:v,totalPages:vt,onPageChange:H,totalItems:We.length,startIndex:bt,endIndex:ft})]}),z&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"overflow-x-hidden bg-black/90 border border-white/10 p-6 w-full pt-4 max-w-2xl rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsxs("h3",{className:"text-sm text-white flex items-center justify-center font-light uppercase",children:[a.jsx("span",{className:"text-white/50 mr-2",children:"["}),a.jsx(Rs,{className:"inline mr-2 w-3.5 h-3.5 text-white"}),a.jsx("span",{className:"font-mono text-white/70 uppercase",children:"Seed Organizations"}),a.jsx("span",{className:"text-white/50 ml-2",children:"]"})]}),a.jsx(W,{variant:"ghost",size:"sm",onClick:()=>Y(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Xt,{className:"w-4 h-4"})})]}),a.jsx("hr",{className:"border-white/10 -mx-10 border-dashed -mt-4 mb-4"}),a.jsxs("div",{className:"space-y-6",children:[a.jsx("div",{className:"space-y-4",children:a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs("div",{className:"flex-1",children:[a.jsx(Pe,{htmlFor:"organization-count",className:"text-sm text-gray-400 font-light",children:"Number of organizations"}),a.jsx(Le,{id:"organization-count",type:"number",min:"1",max:"100",defaultValue:"5",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsx(W,{onClick:()=>{var Z;const O=parseInt(((Z=document.getElementById("organization-count"))==null?void 0:Z.value)||"5",10);ae(O)},disabled:E,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none mt-6 disabled:opacity-50",children:E?a.jsxs(a.Fragment,{children:[a.jsx(ys,{className:"w-3 h-3 mr-2 animate-spin"}),"Seeding..."]}):a.jsxs(a.Fragment,{children:[a.jsx(_t,{className:"w-3 h-3 mr-2"}),"Seed Organizations"]})})]})}),M.length>0&&a.jsx("div",{className:"mt-6",children:a.jsx(mi,{title:"Organization Seeding Terminal",lines:M,isRunning:E,className:"w-full",defaultCollapsed:!0})})]}),a.jsx("hr",{className:"border-white/10 -mx-10 border-dashed mt-10"}),a.jsx("div",{className:"flex justify-end mt-6 pt-6",children:a.jsx(W,{variant:"outline",onClick:()=>Y(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Close"})})]})}),y&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Create Organization"}),a.jsx(W,{variant:"ghost",size:"sm",onClick:()=>p(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Xt,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx(Pe,{htmlFor:"create-name",className:"text-sm text-gray-400 font-light",children:"Name"}),a.jsx(Le,{id:"create-name",value:A.name,onChange:O=>G(O.target.value),placeholder:"e.g. Acme Corp",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsxs("div",{children:[a.jsx(Pe,{htmlFor:"create-slug",className:"text-sm text-gray-400 font-light",children:"Slug"}),a.jsx(Le,{id:"create-slug",value:A.slug,onChange:O=>te(O.target.value),placeholder:"e.g. acme-corp",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"}),a.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Auto-generated from name. You can edit it manually."})]})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(W,{variant:"outline",onClick:()=>{p(!1),q({name:"",slug:""})},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(W,{onClick:Ne,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Create"})]})]})}),S&&k&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",onClick:O=>{O.target===O.currentTarget&&(C(!1),$(null),L({name:"",slug:""}))},children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",onClick:O=>O.stopPropagation(),children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Edit Organization"}),a.jsx(W,{variant:"ghost",size:"sm",onClick:()=>{C(!1),$(null),L({name:"",slug:""})},className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Xt,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-16 h-16 rounded-none border border-dashed border-white/20 bg-white/10 flex items-center justify-center",children:a.jsx(Rs,{className:"w-8 h-8 text-white"})}),a.jsxs("div",{children:[a.jsx("div",{className:"text-white font-light",children:k.name}),a.jsx("div",{className:"text-sm text-gray-400",children:k.slug})]})]}),a.jsxs("div",{children:[a.jsx(Pe,{htmlFor:"edit-name",className:"text-sm text-gray-400 font-light",children:"Name"}),a.jsx(Le,{id:"edit-name",value:R.name,onChange:O=>re(O.target.value),placeholder:"e.g. Acme Corp",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsxs("div",{children:[a.jsx(Pe,{htmlFor:"edit-slug",className:"text-sm text-gray-400 font-light",children:"Slug"}),a.jsx(Le,{id:"edit-slug",value:R.slug,onChange:O=>ee(O.target.value),placeholder:"e.g. acme-corp",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"}),a.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Auto-generated from name. You can edit it manually."})]})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(W,{variant:"outline",onClick:()=>{C(!1),L({name:"",slug:""})},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(W,{onClick:Ce,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Update"})]})]})}),T&&k&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Delete Organization"}),a.jsx(W,{variant:"ghost",size:"sm",onClick:()=>U(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Xt,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-16 h-16 rounded-none border border-dashed border-white/20 bg-white/10 flex items-center justify-center",children:a.jsx(Rs,{className:"w-8 h-8 text-white"})}),a.jsxs("div",{children:[a.jsx("div",{className:"text-white font-light",children:k.name}),a.jsx("div",{className:"text-sm text-gray-400",children:k.slug})]})]}),a.jsx("p",{className:"text-gray-400",children:"Are you sure you want to delete this organization? This action cannot be undone."})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(W,{variant:"outline",onClick:()=>U(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(W,{onClick:Ae,className:"bg-red-600 hover:bg-red-700 text-white border border-red-600 rounded-none",children:"Delete"})]})]})}),B&&k&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Organization Details"}),a.jsx(W,{variant:"ghost",size:"sm",onClick:()=>P(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Xt,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-16 h-16 rounded-none border border-dashed border-white/20 bg-white/10 flex items-center justify-center",children:a.jsx(Rs,{className:"w-8 h-8 text-white"})}),a.jsxs("div",{children:[a.jsx("div",{className:"text-white font-light",children:k.name}),a.jsx("div",{className:"text-sm text-gray-400",children:k.slug})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ln,{id:k.id,variant:"detail"}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-gray-400",children:"Created:"}),a.jsx("span",{className:"text-white text-sm",children:new Date(k.createdAt).toLocaleString()})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-gray-400",children:"Updated:"}),a.jsx("span",{className:"text-white text-sm",children:new Date(k.updatedAt).toLocaleString()})]})]})]}),a.jsx("div",{className:"flex justify-end mt-6",children:a.jsx(W,{onClick:()=>P(!1),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Close"})})]})})]})}function tE(){const e=Cs(),{counts:t,refetchCounts:n}=yf(),[s,r]=m.useState([]),[i,o]=m.useState(!0),[l,c]=m.useState(""),[u,h]=m.useState([]),[d,f]=m.useState(1),[x]=m.useState(20),[b,v]=m.useState(!1),[j,g]=m.useState(!1),[y,p]=m.useState(!1),[w,N]=m.useState(!1),[S,C]=m.useState(!1),[T,U]=m.useState(!1),[B,P]=m.useState(!1),[z,Y]=m.useState(!1),[k,$]=m.useState(null),[M,_]=m.useState(null),[E,D]=m.useState(""),[A,q]=m.useState(),[R,L]=m.useState(!1),[X,G]=m.useState(""),[te,re]=m.useState(""),[ee,se]=m.useState(""),[ge,ae]=m.useState([]),[ue,he]=m.useState(!1),we=m.useCallback(async()=>{try{const ne=await(await fetch("/api/users?limit=10000")).json();r(ne.users||[])}catch{}finally{o(!1)}},[]),Ne=m.useCallback(async()=>{try{const ne=await(await fetch("/api/admin/status")).json();L(ne.enabled)}catch{L(!1)}},[]);m.useEffect(()=>{we(),Ne();const J=()=>{M&&_(null)};return document.addEventListener("click",J),()=>document.removeEventListener("click",J)},[M,Ne,we]);const Ce=async(J,ne)=>{ae([]),he(!0),ae([{id:"start",type:"info",message:`Starting user seeding process for ${J} users...`,timestamp:new Date}]);try{const ce=await(await fetch("/api/seed/users",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:J,role:ne||void 0})})).json();if(ce.success){const pe=ce.results.map((F,fe)=>F.success?{id:`user-${fe}`,type:"progress",message:`Creating user: ${F.user.name} (${F.user.email})`,timestamp:new Date,status:"completed"}:{id:`user-${fe}`,type:"error",message:`Failed to create user ${fe+1}: ${F.error}`,timestamp:new Date});ae(F=>[...F,...pe]);const I=ce.results.filter(F=>F.success).length;ae(F=>[...F,{id:"complete",type:"success",message:`✅ Seeding completed! Created ${I}/${J} users successfully`,timestamp:new Date}]),await we(),await n()}else ae(pe=>[...pe,{id:"error",type:"error",message:`❌ Seeding failed: ${ce.error||"Unknown error"}`,timestamp:new Date}])}catch(xe){ae(ce=>[...ce,{id:"error",type:"error",message:`❌ Network error: ${xe}`,timestamp:new Date}])}finally{he(!1)}},Ae=J=>{$(J),N(!0)},tt=J=>{$(J),G(J.role||""),g(!0)},$e=J=>{$(J),p(!0)},Rt=async()=>{var pe,I,F;const J=(pe=document.getElementById("create-name"))==null?void 0:pe.value,ne=(I=document.getElementById("create-email"))==null?void 0:I.value,xe=(F=document.getElementById("create-password"))==null?void 0:F.value;if(!J||!ne||!xe){V.error("Please fill in all fields");return}const ce=V.loading("Creating user...");try{const ze=await(await fetch("/api/users",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:J,email:ne,password:xe,role:ee||null})})).json();ze.success?(await we(),v(!1),se(""),document.getElementById("create-name").value="",document.getElementById("create-email").value="",document.getElementById("create-password").value="",V.success("User created successfully!",{id:ce})):V.error(`Error creating user: ${ze.error||"Unknown error"}`,{id:ce})}catch{V.error("Error creating user",{id:ce})}},Tt=async()=>{var ce,pe;if(!k){V.error("No user selected");return}const J=(ce=document.getElementById("edit-name"))==null?void 0:ce.value,ne=(pe=document.getElementById("edit-email"))==null?void 0:pe.value;if(!J||!ne){V.error("Please fill in all fields");return}const xe=V.loading("Updating user...");try{const F=await(await fetch(`/api/users/${k.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:J,email:ne,role:X||null})})).json();F.success?(await we(),g(!1),$(null),G(""),V.success("User updated successfully!",{id:xe})):V.error(`Error updating user: ${F.error||"Unknown error"}`,{id:xe})}catch{V.error("Error updating user",{id:xe})}},Be=async()=>{if(!k){V.error("No user selected");return}const J=V.loading("Deleting user...");try{const xe=await(await fetch(`/api/users/${k.id}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})).json();xe.success?(await we(),await n(),p(!1),$(null),V.success("User deleted successfully!",{id:J})):V.error(`Error deleting user: ${xe.error||"Unknown error"}`,{id:J})}catch{V.error("Error deleting user",{id:J})}},We=async()=>{if(!k)return;if(!R){V.error("Admin plugin is not enabled");return}const J=V.loading("Banning user...");try{const ne=await fetch("/api/admin/ban-user",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:k.id,banReason:E||"No reason provided",banExpiresIn:A})}),xe=await ne.json();ne.ok?(V.success("User banned successfully!",{id:J}),U(!1),D(""),q(void 0),$(null),_(null),we()):V.error(`Error banning user: ${xe.error||xe.message||"Unknown error"}`,{id:J})}catch{V.error("Error banning user",{id:J})}},vt=async()=>{if(!k)return;if(!R){V.error("Admin plugin is not enabled");return}const J=V.loading("Unbanning user...");try{const ne=await fetch("/api/admin/unban-user",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:k.id})}),xe=await ne.json();ne.ok?(V.success("User unbanned successfully!",{id:J}),P(!1),$(null),_(null),we()):V.error(`Error unbanning user: ${xe.error||xe.message||"Unknown error"}`,{id:J})}catch{V.error("Error unbanning user",{id:J})}},bt=async()=>{var xe;if(!k){V.error("No user selected");return}const J=(xe=document.getElementById("update-password"))==null?void 0:xe.value;if(!J){V.error("Please enter a new password");return}const ne=V.loading("Updating password...");try{const ce=await fetch(`/api/users/${k.id}/password`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({password:J})}),pe=await ce.json();ce.ok&&pe.success?(V.success("Password updated successfully!",{id:ne}),Y(!1),$(null),document.getElementById("update-password").value=""):V.error(`Error updating password: ${pe.error||"Unknown error"}`,{id:ne})}catch{V.error("Error updating password",{id:ne})}},ft=()=>{if(s.length===0){V.error("No users to export");return}const J=["ID","Name","Email","Email Verified","Created At","Updated At"],ne=s.map(F=>[F.id,F.name||"",F.email||"",!!F.emailVerified,new Date(F.createdAt).toLocaleString(),new Date(F.updatedAt).toLocaleString()]),xe=[J.join(","),...ne.map(F=>F.map(fe=>`"${fe}"`).join(","))].join(`
444
- `),ce=new Blob([xe],{type:"text/csv;charset=utf-8;"}),pe=document.createElement("a"),I=URL.createObjectURL(ce);pe.setAttribute("href",I),pe.setAttribute("download",`users-export-${new Date().toISOString().split("T")[0]}.csv`),pe.style.visibility="hidden",document.body.appendChild(pe),pe.click(),document.body.removeChild(pe),V.success(`Exported ${s.length} users to CSV`)},Q=J=>{u.some(xe=>xe.type===J)||(h(xe=>[...xe,{type:J}]),f(1))},H=J=>{h(ne=>ne.filter(xe=>xe.type!==J)),f(1)},O=(J,ne)=>{h(xe=>xe.map(ce=>ce.type===J?{...ce,value:ne}:ce))},Z=(J,ne)=>{h(xe=>xe.map(ce=>ce.type===J?{...ce,dateRange:ne}:ce))},ie=s.filter(J=>{const ne=J.name.toLowerCase().includes(l.toLowerCase())||J.email.toLowerCase().includes(l.toLowerCase());if(u.length===0)return ne;const xe=u.every(ce=>{var pe,I,F,fe,ze;switch(ce.type){case"emailVerified":return ce.value===void 0?!0:J.emailVerified===(ce.value==="true");case"banned":return ce.value===void 0?!0:J.banned===(ce.value==="true");case"active":return J.banned!==!0;case"createdAt":{if(!((pe=ce.dateRange)!=null&&pe.from)&&!((I=ce.dateRange)!=null&&I.to))return!0;const qe=new Date(J.createdAt);return!((F=ce.dateRange)!=null&&F.from&&ce.dateRange.from>qe||(fe=ce.dateRange)!=null&&fe.to&&ce.dateRange.to<qe)}case"role":return ce.value?(ze=J.role)==null?void 0:ze.toLowerCase().includes(ce.value.toLowerCase()):!0;default:return!0}});return ne&&xe}),le=s.filter(J=>J.banned).length,Ee=Math.ceil(ie.length/x),Re=(d-1)*x,Ue=Re+x,yt=ie.slice(Re,Ue),Ct=J=>{f(J)};return i?a.jsx("div",{className:"flex min-h-screen items-center justify-center h-full",children:a.jsxs("div",{className:"flex flex-col items-center space-y-3",children:[a.jsx(ys,{className:"w-6 h-6 text-white animate-spin"}),a.jsx("div",{className:"text-white text-sm",children:"Loading users..."})]})}):a.jsxs("div",{className:"space-y-6 p-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsxs("h1",{className:"text-2xl relative text-white font-light inline-flex items-start",children:["Users",a.jsx("sup",{className:"text-xs text-gray-500 ml-1 mt-0 inline-flex items-baseline",children:a.jsx(vs,{value:t.users??0,className:"text-white font-mono text-sm",prefix:a.jsx("span",{className:"mr-1 text-gray-500",children:"["}),suffix:a.jsx("span",{className:"ml-1 text-gray-500",children:"]"}),format:{notation:"standard",maximumFractionDigits:0}})})]}),a.jsx("p",{className:"text-gray-400 font-light text-sm mt-1 uppercase font-mono",children:"Manage your application users"}),a.jsx("div",{className:"flex items-center space-x-4 mt-2",children:le>0&&a.jsxs("span",{className:"text-sm text-red-400 flex items-center space-x-1",children:[a.jsx(Hd,{className:"w-3 h-3"}),a.jsxs("span",{children:[le," Banned"]})]})})]}),a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs(W,{className:"border border-dashed border-white/20 text-white hover:bg-white/10 bg-transparent rounded-none",onClick:ft,children:[a.jsx(TS,{className:"w-4 h-4 mr-2"}),"Export CSV"]}),a.jsxs(W,{className:"border border-dashed border-white/20 text-white hover:bg-white/10 bg-transparent rounded-none",onClick:()=>C(!0),children:[a.jsx(_t,{className:"w-4 h-4 mr-2"}),"Seed"]}),a.jsxs(W,{className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",onClick:()=>v(!0),children:[a.jsx(vg,{className:"w-4 h-4 mr-2"}),"Add User"]})]})]}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex items-center space-x-4",children:[a.jsxs("div",{className:"flex-1 relative",children:[a.jsx(li,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-4 h-4"}),a.jsx(Le,{placeholder:"Search users...",value:l,onChange:J=>c(J.target.value),className:"pl-10 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsx("div",{className:"flex items-center space-x-2",children:a.jsxs(us,{value:"",onValueChange:Q,children:[a.jsx(hs,{className:"w-[180px]",children:a.jsxs("div",{className:"flex mr-3 items-center space-x-2",children:[a.jsx(mr,{className:"w-4 h-4"}),a.jsx("span",{children:"Add Filter"})]})}),a.jsxs(fs,{children:[!u.some(J=>J.type==="emailVerified")&&a.jsx(ct,{value:"emailVerified",children:"Email Verified"}),!u.some(J=>J.type==="banned")&&a.jsx(ct,{value:"banned",children:"Banned Status"}),!u.some(J=>J.type==="createdAt")&&a.jsx(ct,{value:"createdAt",children:"Created Date"}),!u.some(J=>J.type==="role")&&a.jsx(ct,{value:"role",children:"Role"})]})]})}),u.length>0&&a.jsx("div",{className:"flex items-center space-x-2",children:a.jsx(W,{onClick:()=>h([]),className:"",children:"Clear all"})})]}),u.length>0&&a.jsx("div",{className:"space-y-3",children:a.jsx("div",{className:"flex flex-wrap gap-3",children:u.map(J=>{var ne,xe,ce,pe;return a.jsxs("div",{className:"inline-flex items-center gap-2 px-3 py-2 bg-white/10 border border-white/20 rounded-sm",children:[a.jsx(n0,{className:"w-3 h-3 text-white"}),J.type==="emailVerified"&&a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-sm text-white",children:"Email Verified:"}),a.jsxs(us,{value:J.value||"",onValueChange:I=>O("emailVerified",I),children:[a.jsx(hs,{className:"h-7 w-24 text-xs",children:a.jsx("span",{children:J.value==="true"?"True":J.value==="false"?"False":"Select"})}),a.jsxs(fs,{children:[a.jsx(ct,{value:"true",children:"True"}),a.jsx(ct,{value:"false",children:"False"})]})]})]}),J.type==="banned"&&a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-sm text-white",children:"Banned:"}),a.jsxs(us,{value:J.value||"",onValueChange:I=>O("banned",I),children:[a.jsx(hs,{className:"h-7 w-24 text-xs",children:a.jsx("span",{children:J.value==="true"?"Yes":J.value==="false"?"No":"Select"})}),a.jsxs(fs,{children:[a.jsx(ct,{value:"true",children:"Yes"}),a.jsx(ct,{value:"false",children:"No"})]})]})]}),J.type==="createdAt"&&a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-sm text-white",children:"Created:"}),a.jsxs(Kn,{children:[a.jsx(Jn,{asChild:!0,children:a.jsxs(W,{variant:"outline",className:"h-8 px-3 text-xs font-mono uppercase text-gray-400 hover:text-white bg-transparent border-white/10 hover:bg-white/5",children:[a.jsx(uh,{className:"mr-1 h-3 w-3"}),(ne=J.dateRange)!=null&&ne.from?Zn(J.dateRange.from,"MMM dd yyyy"):"From"]})}),a.jsx(zn,{className:"w-auto p-0 bg-black border-white/10",children:a.jsx(Qn,{mode:"single",selected:(xe=J.dateRange)==null?void 0:xe.from,onSelect:I=>{var F;return Z("createdAt",{from:I,to:(F=J.dateRange)==null?void 0:F.to})},initialFocus:!0,className:"rounded-none"})})]}),a.jsxs(Kn,{children:[a.jsx(Jn,{asChild:!0,children:a.jsxs(W,{variant:"outline",className:"h-8 px-3 text-xs font-mono uppercase text-gray-400 hover:text-white bg-transparent border-white/10 hover:bg-white/5",children:[a.jsx(uh,{className:"mr-1 h-3 w-3"}),(ce=J.dateRange)!=null&&ce.to?Zn(J.dateRange.to,"MMM dd yyyy"):"To"]})}),a.jsx(zn,{className:"w-auto p-0 bg-black border-white/10",children:a.jsx(Qn,{mode:"single",selected:(pe=J.dateRange)==null?void 0:pe.to,onSelect:I=>{var F;return Z("createdAt",{from:(F=J.dateRange)==null?void 0:F.from,to:I})},initialFocus:!0,disabled:I=>{var F;return(F=J.dateRange)!=null&&F.from?I<J.dateRange.from:!1},className:"rounded-none"})})]})]}),J.type==="role"&&a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-sm text-white",children:"Role:"}),a.jsx(Le,{type:"text",value:J.value||"",onChange:I=>O("role",I.target.value),className:"h-7 w-32 text-xs bg-black border-white/20 text-white",placeholder:"Enter role..."})]}),a.jsx("button",{onClick:()=>H(J.type),className:"ml-1 hover:bg-white/20 rounded-full p-0.5",children:a.jsx(Xt,{className:"w-3 h-3 text-white"})})]},J.type)})})})]}),a.jsxs("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none",children:[a.jsx("div",{className:"overflow-x-auto overflow-y-hidden",children:a.jsxs("table",{className:"w-full",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-dashed border-white/10",children:[a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"User"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Email Status"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Role"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Created"}),a.jsx("th",{className:"text-right py-4 px-4 text-white font-light",children:"Actions"})]})}),a.jsx("tbody",{children:yt.length===0?a.jsx("tr",{children:a.jsx("td",{colSpan:5,className:"py-12 px-4 text-center",children:a.jsxs("div",{className:"flex flex-col items-center space-y-4",children:[a.jsx("div",{className:"w-16 h-16 rounded-none border border-dashed border-white/20 bg-white/10 flex items-center justify-center",children:a.jsx(ci,{className:"w-8 h-8 text-white/50"})}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-white font-medium text-lg",children:"No users found"}),a.jsx("p",{className:"text-gray-400 text-sm mt-1",children:l||u.length>0?"Try adjusting your search or filter criteria":"Get started by creating your first user or seeding some data"})]}),!l&&u.length===0&&a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs(W,{onClick:()=>v(!0),className:"bg-white text-black hover:bg-gray-200 rounded-none",children:[a.jsx(vg,{className:"w-4 h-4 mr-2"}),"Create User"]}),a.jsxs(W,{onClick:()=>C(!0),className:"border border-dashed border-white/20 text-white hover:bg-white/10 bg-transparent rounded-none",children:[a.jsx(_t,{className:"w-4 h-4 mr-2"}),"Seed Data"]})]})]})})}):yt.map(J=>a.jsxs("tr",{className:`border-b border-dashed hover:bg-white/5 cursor-pointer ${J.banned?"border-red-500/30 bg-red-500/5":"border-white/5"}`,onClick:()=>e(`/users/${J.id}`),children:[a.jsx("td",{className:"py-4 px-4",children:a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs("div",{className:"relative",children:[a.jsx("img",{src:J.image||`https://api.dicebear.com/7.x/avataaars/svg?seed=${J.id}`,alt:J.name,className:`w-10 h-10 rounded-none border border-dashed ${J.banned?"border-red-400/50 opacity-60":"border-white/20"}`}),J.banned&&a.jsx("div",{className:"absolute -top-1 -right-1 bg-red-500 rounded-full p-0.5",children:a.jsx(Hd,{className:"w-3 h-3 text-white"})})]}),a.jsxs("div",{className:"flex-1",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"text-white font-light",children:J.name}),J.banned&&a.jsx("span",{className:"px-2 py-0.5 text-[10px] font-semibold bg-red-500/20 border border-red-500/50 text-red-400 rounded-sm uppercase tracking-wide",children:"Banned"})]}),a.jsx("div",{className:"text-sm text-gray-400 mt-0.5",children:J.email})]})]})}),a.jsx("td",{className:"py-4 px-4",children:a.jsxs("div",{className:"flex items-center space-x-2",children:[J.emailVerified?a.jsx(xg,{className:"w-4 h-4 text-green-400"}):a.jsx(hh,{className:"w-4 h-4 text-yellow-400"}),a.jsx("span",{className:"text-sm text-gray-400",children:J.emailVerified?"Verified":"Not Verified"})]})}),a.jsx("td",{className:"py-4 px-4",children:J.role?a.jsx("span",{className:"px-2 py-1 text-xs font-mono uppercase bg-white/5 border border-dashed border-white/15 text-white/80 rounded-sm tracking-wide",children:J.role}):a.jsx("span",{className:"text-sm text-gray-500",children:"—"})}),a.jsx("td",{className:"py-4 px-4 text-sm text-gray-400",children:a.jsxs("div",{className:"flex flex-col",children:[new Date(J.createdAt).toLocaleDateString(),a.jsx("p",{className:"text-xs",children:new Date(J.createdAt).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})})]})}),a.jsx("td",{className:"py-4 px-4 text-right",children:a.jsxs("div",{className:"relative flex items-center justify-end",children:[a.jsx(W,{variant:"ghost",size:"sm",className:"text-gray-400 hover:text-white rounded-none",onClick:ne=>{ne.stopPropagation(),_(M===J.id?null:J.id)},children:a.jsx(_S,{className:"w-4 h-4"})}),M===J.id&&a.jsxs("div",{className:"absolute z-[999] right-0 top-full mt-1 w-48 bg-black border border-white/20 rounded-none shadow-lg",onClick:ne=>ne.stopPropagation(),children:[a.jsxs("button",{className:"w-full px-4 py-2 text-left text-sm text-white hover:bg-white/10 flex items-center space-x-2",onClick:ne=>{ne.stopPropagation(),_(null),Ae(J)},children:[a.jsx(Go,{className:"w-4 h-4"}),a.jsx("span",{children:"View"})]}),a.jsxs("button",{className:"w-full px-4 py-2 text-left text-sm text-white hover:bg-white/10 flex items-center space-x-2",onClick:ne=>{ne.stopPropagation(),_(null),tt(J)},children:[a.jsx(oi,{className:"w-4 h-4"}),a.jsx("span",{children:"Edit User"})]}),a.jsxs("button",{className:"w-full px-4 py-2 text-left text-sm text-white hover:bg-white/10 flex items-center space-x-2",onClick:ne=>{ne.stopPropagation(),_(null),$(J),Y(!0)},children:[a.jsx(wn,{className:"w-4 h-4"}),a.jsx("span",{children:"Update Password"})]}),R&&(J.banned?a.jsxs("button",{className:"w-full px-4 py-2 text-left text-sm text-green-400 hover:bg-white/10 flex items-center space-x-2",onClick:ne=>{ne.stopPropagation(),$(J),P(!0),_(null)},children:[a.jsx(Hd,{className:"w-4 h-4"}),a.jsx("span",{children:"Unban User"})]}):a.jsxs("button",{className:"w-full px-4 py-2 text-left text-sm text-yellow-400 hover:bg-white/10 flex items-center space-x-2",onClick:ne=>{ne.stopPropagation(),$(J),U(!0),_(null)},children:[a.jsx(Hd,{className:"w-4 h-4"}),a.jsx("span",{children:"Ban User"})]})),a.jsx("div",{className:"border-t border-white/10 my-1"}),a.jsxs("button",{className:"w-full px-4 py-2 text-left text-sm text-red-400 hover:bg-white/10 flex items-center space-x-2",onClick:ne=>{ne.stopPropagation(),_(null),$e(J)},children:[a.jsx(cf,{className:"w-4 h-4"}),a.jsx("span",{children:"Delete User"})]})]})]})})]},J.id))})]})}),a.jsx(JC,{currentPage:d,totalPages:Ee,onPageChange:Ct,totalItems:ie.length,startIndex:Re,endIndex:Ue})]}),S&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"overflow-x-hidden bg-black/90 border border-white/10 p-6 w-full pt-4 max-w-2xl rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsxs("h3",{className:"text-sm text-white flex items-center justify-center font-light uppercase",children:[a.jsx("span",{className:"text-white/50 mr-2",children:"["}),a.jsx(ci,{className:"inline mr-2 w-3 h-3 text-white"}),a.jsx("span",{className:"font-mono text-white/70 uppercase",children:"Seed User"}),a.jsx("span",{className:"text-white/50 ml-2",children:"]"})]}),a.jsx(W,{variant:"ghost",size:"sm",onClick:()=>{C(!1),re("")},className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Xt,{className:"w-4 h-4"})})]}),a.jsx("hr",{className:"border-white/10 -mx-10 border-dashed -mt-4 mb-4"}),a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"space-y-4",children:[a.jsx("div",{className:"flex items-center space-x-2"}),a.jsxs("div",{className:"space-y-4",children:[a.jsx("div",{className:"flex items-center space-x-3",children:a.jsxs("div",{className:"flex-1",children:[a.jsx(Pe,{htmlFor:"user-count",className:"text-sm text-gray-400 font-light",children:"Number of users"}),a.jsx(Le,{id:"user-count",type:"number",min:"1",max:"100",defaultValue:"5",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]})}),a.jsxs("div",{className:"flex-1",children:[a.jsx(Pe,{htmlFor:"seed-role",className:"text-sm text-gray-400 font-light",children:"Role (optional)"}),a.jsxs(us,{className:"bg-black text-white",value:te,onValueChange:re,children:[a.jsx(hs,{id:"seed-role",className:"mt-1 border border-dashed border-white/20 bg-black text-white rounded-none",children:a.jsx(Jr,{placeholder:"Select role (optional)"})}),a.jsxs(fs,{children:[a.jsx(ct,{value:"",children:"None"}),a.jsx(ct,{value:"admin",children:"Admin"}),a.jsx(ct,{value:"user",children:"User"}),a.jsx(ct,{value:"mix",children:"Mix (Random)"})]})]})]}),a.jsx(W,{onClick:()=>{var ne;const J=parseInt(((ne=document.getElementById("user-count"))==null?void 0:ne.value)||"5",10);Ce(J,te||void 0)},disabled:ue,className:"bg-transparent hover:bg-white/90 bg-white text-black border border-white/20 rounded-none mt-6 disabled:opacity-50",children:ue?a.jsxs(a.Fragment,{children:[a.jsx(ys,{className:"w-3 h-3 mr-2 animate-spin"}),"Seeding..."]}):a.jsxs(a.Fragment,{children:[a.jsx(_t,{className:"w-3 h-3 mr-2"}),"Seed Users"]})})]})]}),ge.length>0&&a.jsx("div",{className:"mt-6",children:a.jsx(mi,{title:"User Seeding Terminal",lines:ge,isRunning:ue,className:"w-full",defaultCollapsed:!0})})]}),a.jsx("hr",{className:"border-white/10 -mx-10 border-dashed mt-10"}),a.jsx("div",{className:"flex justify-end mt-6 pt-6",children:a.jsx(W,{variant:"outline",onClick:()=>{C(!1),re("")},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Close"})})]})}),b&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-white/10 p-6 w-full max-w-md rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Create User"}),a.jsx(W,{variant:"ghost",size:"sm",onClick:()=>{v(!1),se("")},className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Xt,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx(Pe,{htmlFor:"create-name",className:"text-sm text-gray-400 font-light",children:"Name"}),a.jsx(Le,{id:"create-name",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsxs("div",{children:[a.jsx(Pe,{htmlFor:"create-email",className:"text-sm text-gray-400 font-light",children:"Email"}),a.jsx(Le,{id:"create-email",type:"email",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsxs("div",{children:[a.jsx(Pe,{htmlFor:"create-password",className:"text-sm text-gray-400 font-light",children:"Password"}),a.jsx(Le,{id:"create-password",type:"password",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsxs("div",{children:[a.jsx(Pe,{htmlFor:"create-role",className:"text-sm text-gray-400 font-light",children:"Role"}),a.jsxs(us,{className:"bg-black text-white",value:ee,onValueChange:se,children:[a.jsx(hs,{id:"create-role",className:"mt-1 border border-dashed border-white/20 bg-black text-white rounded-none",children:a.jsx(Jr,{placeholder:"Select role"})}),a.jsxs(fs,{children:[a.jsx(ct,{value:"",children:"None"}),a.jsx(ct,{value:"admin",children:"Admin"}),a.jsx(ct,{value:"user",children:"User"})]})]})]})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(W,{variant:"outline",onClick:()=>{v(!1),se("")},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(W,{onClick:Rt,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Create"})]})]})}),j&&k&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Edit User"}),a.jsx(W,{variant:"ghost",size:"sm",onClick:()=>{g(!1),G("")},className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Xt,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("img",{src:k.image||`https://api.dicebear.com/7.x/avataaars/svg?seed=${k.id}`,alt:k.name,className:"w-16 h-16 rounded-none border border-dashed border-white/20"}),a.jsxs("div",{children:[a.jsx("div",{className:"text-white font-light",children:k.name}),a.jsx("div",{className:"text-sm text-gray-400",children:k.email})]})]}),a.jsxs("div",{children:[a.jsx(Pe,{htmlFor:"edit-name",className:"text-sm text-gray-400 font-light",children:"Name"}),a.jsx(Le,{id:"edit-name",defaultValue:k.name,className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsxs("div",{children:[a.jsx(Pe,{htmlFor:"edit-email",className:"text-sm text-gray-400 font-light",children:"Email"}),a.jsx(Le,{id:"edit-email",type:"email",defaultValue:k.email,className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsxs("div",{children:[a.jsx(Pe,{htmlFor:"edit-role",className:"text-sm text-gray-400 font-light",children:"Role"}),a.jsxs(us,{value:X,onValueChange:G,children:[a.jsx(hs,{id:"edit-role",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none",children:a.jsx(Jr,{placeholder:"Select role"})}),a.jsxs(fs,{children:[a.jsx(ct,{value:"",children:"None"}),a.jsx(ct,{value:"admin",children:"Admin"}),a.jsx(ct,{value:"user",children:"User"})]})]})]})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(W,{variant:"outline",onClick:()=>{g(!1),G("")},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(W,{onClick:Tt,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Update"})]})]})}),y&&k&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Delete User"}),a.jsx(W,{variant:"ghost",size:"sm",onClick:()=>p(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Xt,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("img",{src:k.image||`https://api.dicebear.com/7.x/avataaars/svg?seed=${k.id}`,alt:k.name,className:"w-16 h-16 rounded-none border border-dashed border-white/20"}),a.jsxs("div",{children:[a.jsx("div",{className:"text-white font-light",children:k.name}),a.jsx("div",{className:"text-sm text-gray-400",children:k.email})]})]}),a.jsx("p",{className:"text-gray-400",children:"Are you sure you want to delete this user? This action cannot be undone."})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(W,{variant:"outline",onClick:()=>p(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(W,{onClick:Be,className:"bg-red-600 hover:bg-red-700 text-white border border-red-600 rounded-none",children:"Delete"})]})]})}),w&&k&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"User Details"}),a.jsx(W,{variant:"ghost",size:"sm",onClick:()=>N(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Xt,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("img",{src:k.image||`https://api.dicebear.com/7.x/avataaars/svg?seed=${k.id}`,alt:k.name,className:"w-16 h-16 rounded-none border border-dashed border-white/20"}),a.jsxs("div",{children:[a.jsx("div",{className:"text-white font-light",children:k.name}),a.jsx("div",{className:"text-sm text-gray-400",children:k.email})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ln,{id:k.id,variant:"detail"}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-gray-400",children:"Email Verified:"}),a.jsx("span",{className:"text-white text-sm",children:k.emailVerified?"Yes":"No"})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-gray-400",children:"Created:"}),a.jsx("span",{className:"text-white text-sm",children:new Date(k.createdAt).toLocaleString()})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-gray-400",children:"Updated:"}),a.jsx("span",{className:"text-white text-sm",children:new Date(k.updatedAt).toLocaleString()})]})]})]}),a.jsx("div",{className:"flex justify-end mt-6",children:a.jsx(W,{onClick:()=>N(!1),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Close"})})]})}),T&&k&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black border border-red-400/20 rounded-none p-6 w-full max-w-md",children:[a.jsx("h2",{className:"text-xl font-bold text-white mb-4",children:"Ban User"}),a.jsxs("p",{className:"text-gray-400 mb-4",children:["Ban ",a.jsx("strong",{children:k.name})," from accessing the system."]}),a.jsxs("div",{className:"space-y-4 mb-6",children:[a.jsxs("div",{children:[a.jsx(Pe,{htmlFor:"banReason",className:"text-white",children:"Ban Reason"}),a.jsx(Le,{id:"banReason",value:E,onChange:J=>D(J.target.value),placeholder:"Enter reason for ban (optional)",className:"bg-black border border-dashed border-white/20 text-white rounded-none"})]}),a.jsxs("div",{children:[a.jsx(Pe,{htmlFor:"banExpires",className:"text-white",children:"Ban Duration (seconds)"}),a.jsx(Le,{id:"banExpires",type:"number",value:A||"",onChange:J=>q(J.target.value?Number(J.target.value):void 0),placeholder:"Leave empty for permanent ban",className:"bg-black border border-dashed border-white/20 text-white rounded-none"}),a.jsx("p",{className:"text-xs text-gray-400 mt-1",children:"Examples: 3600 (1 hour), 86400 (1 day), 604800 (1 week)"})]})]}),a.jsxs("div",{className:"flex justify-end space-x-2",children:[a.jsx(W,{variant:"outline",onClick:()=>{U(!1),D(""),q(void 0),$(null)},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(W,{onClick:We,className:"bg-red-600 text-white hover:bg-red-700 rounded-none",children:"Ban User"})]})]})}),B&&k&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black border border-dashed border-green-400/50 rounded-none p-6 w-full max-w-md",children:[a.jsx("h2",{className:"text-xl font-bold text-white mb-4",children:"Unban User"}),a.jsxs("p",{className:"text-gray-400 mb-6",children:["Are you sure you want to unban ",a.jsx("strong",{children:k.name}),"? This will restore their access to the system."]}),a.jsxs("div",{className:"flex justify-end space-x-2",children:[a.jsx(W,{variant:"outline",onClick:()=>{P(!1),$(null)},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(W,{onClick:vt,className:"bg-green-600 text-white hover:bg-green-700 rounded-none",children:"Unban User"})]})]})}),z&&k&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Update Password"}),a.jsx(W,{variant:"ghost",size:"sm",onClick:()=>{Y(!1),$(null),document.getElementById("update-password").value=""},className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Xt,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("img",{src:k.image||`https://api.dicebear.com/7.x/avataaars/svg?seed=${k.id}`,alt:k.name,className:"w-16 h-16 rounded-none border border-dashed border-white/20"}),a.jsxs("div",{children:[a.jsx("div",{className:"text-white font-light",children:k.name}),a.jsx("div",{className:"text-sm text-gray-400",children:k.email})]})]}),a.jsxs("div",{children:[a.jsx(Pe,{htmlFor:"update-password",className:"text-sm text-gray-400 font-light",children:"New Password"}),a.jsx(Le,{id:"update-password",type:"password",placeholder:"Enter new password",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(W,{variant:"outline",onClick:()=>{Y(!1),$(null),document.getElementById("update-password").value=""},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(W,{onClick:bt,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Update Password"})]})]})})]})}const El=[{id:"signups",label:"Signups",analyticsKey:"newUsers",barClass:"bg-white/25 border border-white/10",dotClass:"bg-white/25"},{id:"logins",label:"Logins",analyticsKey:"activeUsers",barClass:"bg-white/20 border border-white/10",dotClass:"bg-white/20"},{id:"organizations",label:"Organizations",analyticsKey:"organizations",barClass:"bg-white/15 border border-white/10",dotClass:"bg-white/15"},{id:"teams",label:"Teams",analyticsKey:"teams",barClass:"bg-white/10 border border-white/10",dotClass:"bg-white/10"},{id:"sessions",label:"Sessions",analyticsKey:"sessions",barClass:"bg-white/5 border border-white/10",dotClass:"bg-white/5"}];function ZB(){const[e]=m.useState("overview"),[t,n]=m.useState(!1),[s,r]=m.useState(0),[i,o]=m.useState(0),[l,c]=m.useState("1D"),[u,h]=m.useState("1D"),[d,f]=m.useState(null),[x,b]=m.useState(!1),[v,j]=m.useState("Daily"),[g,y]=m.useState("Daily"),[p,w]=m.useState("Daily"),[N,S]=m.useState("Daily"),[C,T]=m.useState(!1),[U,B]=m.useState(!1),[P,z]=m.useState(!1),[Y,k]=m.useState(!1),[$,M]=m.useState(null),[_,E]=m.useState(null),[D,A]=m.useState(null),[q,R]=m.useState(null),[L,X]=m.useState(null),[G,te]=m.useState(void 0),[re,ee]=m.useState(void 0),[se,ge]=m.useState(void 0),[ae,ue]=m.useState(void 0),[he,we]=m.useState(void 0),[Ne,Ce]=m.useState(void 0),[Ae,tt]=m.useState(void 0),[$e,Rt]=m.useState(void 0),[Tt,Be]=m.useState([]),[We,vt]=m.useState([]),[bt,ft]=m.useState(0),[Q,H]=m.useState([]),[O,Z]=m.useState([]),[ie,le]=m.useState(0),[Ee,Re]=m.useState(0),[Ue,yt]=m.useState(0),[Ct,J]=m.useState(0),[ne,xe]=m.useState(0),[ce,pe]=m.useState(!1),[I,F]=m.useState(!1),[fe,ze]=m.useState({signups:[],logins:[],organizations:[],teams:[],sessions:[]}),[qe,Ke]=m.useState([]),[Xe,Kt]=m.useState(!1),[Ms,dn]=m.useState(0),[Jt,wi]=m.useState(0),[Cn,id]=m.useState(0),[el,tl]=m.useState(0),[kf,Mf]=m.useState(0),[Tr,nl]=m.useState([]),[od,ji]=m.useState(0),[Ni,Si]=m.useState(0),[sl,ld]=m.useState(0),{counts:Ta,loading:Ts}=yf(),Da=Cs(),Ci=["Daily","Weekly","Monthly","Yearly","Custom"],cd={Daily:"1D",Weekly:"1W",Monthly:"1M",Yearly:"1Y",Custom:"Custom"},Tf=m.useMemo(()=>new Intl.NumberFormat("en-US",{notation:"compact",maximumFractionDigits:1}),[]),_a=me=>me==null?"...":Tf.format(Number(me)),Aa=me=>me==null?"...":Number(me).toLocaleString(),al=m.useMemo(()=>El.reduce((me,ve)=>(me[ve.id]=(fe[ve.id]||[]).reduce((be,de)=>be+de,0),me),{}),[fe]),dd=m.useMemo(()=>Object.values(al).reduce((me,ve)=>me+ve,0),[al]),Df=(me,ve)=>{const be=me.currentTarget.getBoundingClientRect();R(ve),X({x:be.left+be.width/2,y:be.top})},ud=(()=>{const me=[];return $!=null&&$.isOutdated?me.push({id:"version-check",title:`Update Better-Auth to v${$.latest}`,severity:"high",date:new Date().toISOString().split("T")[0],description:"Your current version is outdated. Update to the latest version to get the latest security fixes, features, and improvements. Run: `pnpm install better-auth@latest`",affectedComponents:["All Components"],status:"pending",cve:""}):$&&me.push({id:"version-check",title:"Better-Auth is Up to date",severity:"low",date:new Date().toISOString().split("T")[0],description:"You are running the latest version of better-auth. Great job keeping your dependencies up to date!",affectedComponents:["All Components"],status:"applied",cve:""}),me.push(),me.push({id:"3",title:"Rate Limiting Configuration",severity:"medium",date:new Date().toISOString().split("T")[0],description:"Configure rate limiting for authentication endpoints to prevent brute force attacks. Better-auth provides built-in rate limiting middleware.",affectedComponents:["Auth Endpoints"],status:"pending"}),me})(),mt=m.useCallback(async(me,ve,be,de)=>{try{const je=new URLSearchParams({type:me,period:ve});return be&&je.append("from",be.toISOString()),de&&je.append("to",de.toISOString()),await(await fetch(`/api/analytics?${je.toString()}`)).json()}catch{return null}},[]);m.useEffect(()=>{(async()=>{try{const be=await(await fetch("/api/users/all")).json();be!=null&&be.success&&be.users&&nl(be.users)}catch{nl([])}})()},[]),m.useEffect(()=>{(async()=>{try{const be=await(await fetch("/api/stats")).json();be&&r(be.activeUsers||0)}catch{r(0)}})()},[]),m.useEffect(()=>{(async()=>{const ve=await mt("users",l,G,re);ve&&(Be(ve.data||[]),vt(ve.labels||[]),ft(ve.percentageChange||0))})()},[l,G,re,mt]),m.useEffect(()=>{if(Tr.length===0){ji(0),Si(0);return}const me=new Date;let ve,be=me,de,je;if(g==="Custom"){if(!se||!ae){ji(0),Si(0);return}ve=new Date(se),be=new Date(ae),be.setHours(23,59,59,999);const sn=be.getTime()-ve.getTime();je=new Date(ve.getTime()-1),de=new Date(je.getTime()-sn)}else switch(g){case"Daily":ve=new Date(me),ve.setHours(0,0,0,0),je=new Date(ve.getTime()-1),de=new Date(je.getTime()-24*60*60*1e3);break;case"Weekly":ve=new Date(me),ve.setDate(me.getDate()-me.getDay()),ve.setHours(0,0,0,0),je=new Date(ve.getTime()-1),de=new Date(je.getTime()-7*24*60*60*1e3);break;case"Monthly":ve=new Date(me.getFullYear(),me.getMonth(),1),ve.setHours(0,0,0,0),je=new Date(ve.getTime()-1),de=new Date(me.getFullYear(),me.getMonth()-1,1),de.setHours(0,0,0,0);break;case"Yearly":ve=new Date(me.getFullYear(),0,1),ve.setHours(0,0,0,0),je=new Date(ve.getTime()-1),de=new Date(me.getFullYear()-1,0,1),de.setHours(0,0,0,0);break;default:ji(0),Si(0);return}const De=Tr.filter(sn=>{if(!sn.createdAt)return!1;const Oa=new Date(sn.createdAt);return Oa>=ve&&Oa<=be}),Se=Tr.filter(sn=>{if(!sn.createdAt)return!1;const Oa=new Date(sn.createdAt);return Oa>=de&&Oa<=je}),ye=De.length,Ge=Se.length;let xn=0;Ge>0?xn=(ye-Ge)/Ge*100:ye>0&&(xn=100),ji(ye),Si(xn)},[Tr,g,se,ae]),m.useEffect(()=>{(async()=>{if(!(u==="Custom"&&(!se||!ae))){Kt(!0);try{const[ve,be,de,je,De]=await Promise.all([mt("newUsers",u,se,ae),mt("activeUsers",u,se,ae),mt("organizations",u,se,ae),mt("teams",u,se,ae),mt("sessions",u,se,ae)]);ve&&(H(ve.data||[]),Z(ve.labels||[])),ze({signups:(ve==null?void 0:ve.data)||[],logins:(be==null?void 0:be.data)||[],organizations:(de==null?void 0:de.data)||[],teams:(je==null?void 0:je.data)||[],sessions:(De==null?void 0:De.data)||[]}),Ke((ve==null?void 0:ve.labels)||(be==null?void 0:be.labels)||(de==null?void 0:de.labels)||(je==null?void 0:je.labels)||(De==null?void 0:De.labels)||[])}finally{Kt(!1)}}})()},[u,se,ae,mt]),m.useEffect(()=>{(async()=>{const ve=await mt("activeUsers","1D");ve&&le(ve.percentageChange||0)})()},[mt]),m.useEffect(()=>{},[Ta.organizations,Ta.teams,Ts]),m.useEffect(()=>{(async()=>{const ve=cd[p]||"1D",be=ve==="Custom";if(!(be&&(!he||!Ne))){pe(!0);try{const de=await mt("organizations",ve,be?he:void 0,be?Ne:void 0);de&&(J(de.total||0),Re(de.percentageChange||0))}catch{J(0),Re(0)}finally{pe(!1)}}})()},[p,he,Ne,mt]),m.useEffect(()=>{(async()=>{const ve=cd[N]||"1D",be=ve==="Custom";if(!(be&&(!Ae||!$e))){F(!0);try{const de=await mt("teams",ve,be?Ae:void 0,be?$e:void 0);de&&(xe(de.total||0),yt(de.percentageChange||0))}catch{xe(0),yt(0)}finally{F(!1)}}})()},[N,Ae,$e,mt]),m.useEffect(()=>{(async()=>{const ve=await mt("users","1D");ve&&dn(ve.percentageChange||0);const be=await mt("organizations","1D");be&&wi(be.percentageChange||0);const de=await mt("activeUsers","1D");de&&id(de.percentageChange||0);const[je,De,Se,ye,Ge]=await Promise.all([mt("newUsers","1D"),mt("activeUsers","1D"),mt("organizations","1D"),mt("teams","1D"),mt("sessions","1D")]);je?(o(je.total||0),ld(je.percentageChange||0)):(o(0),ld(0));const sn=[(je==null?void 0:je.total)||0,(De==null?void 0:De.total)||0,(Se==null?void 0:Se.total)||0,(ye==null?void 0:ye.total)||0,(Ge==null?void 0:Ge.total)||0].reduce((_r,zf)=>_r+zf,0);Mf(sn);const il=[(je==null?void 0:je.previousTotal)||0,(De==null?void 0:De.previousTotal)||0,(Se==null?void 0:Se.previousTotal)||0,(ye==null?void 0:ye.previousTotal)||0,(Ge==null?void 0:Ge.previousTotal)||0].reduce((_r,zf)=>_r+zf,0);if(il>0){const _r=(sn-il)/il*100;tl(_r)}else sn>0?tl(100):tl(0)})()},[mt]),m.useEffect(()=>{(async()=>{try{const be=await(await fetch("/api/version-check")).json();be&&M({current:be.current||"1.0.0",latest:be.latest||"1.0.0",isOutdated:be.isOutdated||!1})}catch{try{const je=(await(await fetch("/api/package-info")).json()).betterAuthVersion||"1.0.0",De="1.5.0";M({current:je,latest:De,isOutdated:je!==De})}catch{M({current:"1.0.0",latest:"1.5.0",isOutdated:!0})}}})()},[]);const hd=me=>{switch(me){case"critical":return"bg-white/10 text-white border-white/20";case"high":return"bg-white/10 text-white border-white/20";case"medium":return"bg-white/10 text-gray-300 border-white/20";case"low":return"bg-white/10 text-gray-400 border-white/20";default:return"bg-white/10 text-gray-400 border-white/20"}},fd=me=>{switch(me){case"applied":return"bg-white/10 text-white border-white/20";case"scheduled":return"bg-white/10 text-gray-300 border-white/20";case"pending":return"bg-white/10 text-gray-400 border-white/20";default:return"bg-white/10 text-gray-400 border-white/20"}},_f=me=>{f(me),b(!0)},rl=()=>{b(!1),setTimeout(()=>f(null),300)},Dr=(me,ve="users")=>{const be=ve==="users"?We:O,je={"1D":24,"1W":7,"1M":30,"3M":3,"6M":6,"1Y":12,ALL:7}[me]||7;if(be&&be.length>0&&be.length===je)return me==="1D"?be.filter((Se,ye)=>ye%4===0).map(Se=>{const ye=parseInt(Se.replace("h",""),10);return ye===0?"12am":ye<12?`${ye}am`:ye===12?"12pm":`${ye-12}pm`}):me==="1W"?be.map(Se=>Se.length>3?Se.substring(0,3):Se):me==="1M"?be.map(Se=>{const ye=Se.split(" ");return ye.length>=2?ye[1]:Se}):me==="1Y"||me==="3M"||me==="6M"?be.map(Se=>Se.length>3?Se.substring(0,3):Se):be.map(Se=>Se.length>3?Se.substring(0,3):Se);const De=new Date;switch(me){case"1D":return["12am","4am","8am","12pm","4pm","8pm"];case"1W":return Array.from({length:7},(Se,ye)=>new Date(De.getTime()-(6-ye)*24*60*60*1e3).toLocaleDateString("en-US",{weekday:"short"}));case"1M":return Array.from({length:30},(Se,ye)=>new Date(De.getTime()-(29-ye)*24*60*60*1e3).getDate().toString());case"3M":return Array.from({length:3},(Se,ye)=>new Date(De.getFullYear(),De.getMonth()-(2-ye),1).toLocaleDateString("en-US",{month:"short"}));case"6M":return Array.from({length:6},(Se,ye)=>new Date(De.getFullYear(),De.getMonth()-(5-ye),1).toLocaleDateString("en-US",{month:"short"}));case"1Y":return Array.from({length:12},(Se,ye)=>new Date(De.getFullYear(),De.getMonth()-(11-ye),1).toLocaleDateString("en-US",{month:"short"}));case"ALL":return Array.from({length:7},(Se,ye)=>new Date(De.getFullYear(),De.getMonth()-(6-ye),1).toLocaleDateString("en-US",{month:"short"}));default:return["Mon","Tue","Wed","Thu","Fri","Sat","Sun"]}},Af=(me,ve="users")=>{const be=ve==="users"?We:O,je={"1D":24,"1W":7,"1M":30,"3M":3,"6M":6,"1Y":12,ALL:7}[me]||7;if(be&&be.length>0&&be.length===je)return me==="1D"?be.map(Se=>{const ye=parseInt(Se.replace("h",""),10);return ye===0?"12am":ye<12?`${ye}am`:ye===12?"12pm":`${ye-12}pm`}):me==="1Y"||me==="3M"||me==="6M"?be.map(Se=>{const ye=["January","February","March","April","May","June","July","August","September","October","November","December"],xn=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"].indexOf(Se);return xn!==-1?ye[xn]:Se}):be;const De=new Date;switch(me){case"1D":return Array.from({length:24},(Se,ye)=>{const Ge=new Date;return Ge.setHours(ye,0,0,0),Ge.toLocaleTimeString("en-US",{hour:"numeric",hour12:!0})});case"1W":return Array.from({length:7},(Se,ye)=>new Date(De.getTime()-(6-ye)*24*60*60*1e3).toLocaleDateString("en-US",{weekday:"long"}));case"1M":return Array.from({length:30},(Se,ye)=>{const Ge=new Date(De.getTime()-(29-ye)*24*60*60*1e3),xn=Ge.toLocaleDateString("en-US",{month:"short"}),sn=Ge.getDate();return`${xn} ${sn}`});case"3M":return Array.from({length:3},(Se,ye)=>new Date(De.getFullYear(),De.getMonth()-(2-ye),1).toLocaleDateString("en-US",{month:"long"}));case"6M":return Array.from({length:6},(Se,ye)=>new Date(De.getFullYear(),De.getMonth()-(5-ye),1).toLocaleDateString("en-US",{month:"long"}));case"1Y":return Array.from({length:12},(Se,ye)=>new Date(De.getFullYear(),De.getMonth()-(11-ye),1).toLocaleDateString("en-US",{month:"long"}));case"ALL":return Array.from({length:7},(Se,ye)=>new Date(De.getFullYear(),De.getMonth()-(6-ye),1).toLocaleDateString("en-US",{month:"long"}));default:return["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"]}},Of=(me,ve="users")=>{const be=ve==="users"?Tt:Q,je={"1D":24,"1W":7,"1M":30,"3M":3,"6M":6,"1Y":12,ALL:7}[me]||7;if(!be||be.length===0)return Array(je).fill(0);const De=[...be];for(;De.length<je;)De.push(0);const Se=De.slice(0,je),ye=Math.max(...Se,1);return Se.map(Ge=>Ge/ye*100)},md=()=>{const me=qe.length>0?qe:Dr(u,"users"),ve=me.map((de,je)=>El.reduce((De,Se)=>{var ye;return De+(((ye=fe[Se.id])==null?void 0:ye[je])??0)},0)),be=Math.max(...ve,1);return a.jsxs("div",{className:"space-y-6 min-h-screen h-full mt-5 flex-1 overflow-y-hidden overflow-x-hidden px-0",children:[a.jsx("div",{className:"px-6 overflow-hidden",children:a.jsxs("div",{className:"flex items-center justify-between gap-8 py-4 px-6 bg-white/5 border border-white/10 rounded-none overflow-x-auto relative",children:[a.jsx("div",{className:"absolute top-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsxs("div",{className:"flex items-center gap-3 min-w-fit",children:[a.jsx("div",{className:"w-10 h-10 rounded-none bg-white/5 border border-dashed border-white/10 flex items-center justify-center flex-shrink-0",children:a.jsx(dt,{className:"w-5 h-5 text-white"})}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-gray-400 text-sm uppercase tracking-wide",children:"Users"}),a.jsx("span",{className:"text-white text-lg font-medium",children:Ts?"...":_a(Ta.users)}),a.jsxs("div",{className:`flex items-center gap-1 ${Ms>=0?"text-green-500":"text-red-500"}`,children:[a.jsx("svg",{className:`w-3 h-3 ${Ms<0?"rotate-180":""}`,viewBox:"0 0 12 12",fill:"currentColor",children:a.jsx("path",{d:"M6 0 L12 12 L0 12 Z"})}),a.jsxs("span",{className:"text-sm font-medium",children:[Math.abs(Ms).toFixed(1),"%"]})]})]})]}),a.jsx("div",{className:"h-8 w-[1px] bg-white/10"}),a.jsxs("div",{className:"flex items-center gap-3 min-w-fit",children:[a.jsx("div",{className:"w-10 h-10 rounded-none bg-white/5 border border-dashed border-white/10 flex items-center justify-center flex-shrink-0",children:a.jsx(Un,{className:"w-5 h-5 text-white"})}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-gray-400 text-sm uppercase tracking-wide",children:"Organizations"}),a.jsx("span",{className:"text-white text-lg font-medium",children:Ts?"...":_a(Ta.organizations)}),a.jsxs("div",{className:`flex items-center gap-1 ${Jt>=0?"text-green-500":"text-red-500"}`,children:[a.jsx("svg",{className:`w-3 h-3 ${Jt<0?"rotate-180":""}`,viewBox:"0 0 12 12",fill:"currentColor",children:a.jsx("path",{d:"M6 0 L12 12 L0 12 Z"})}),a.jsxs("span",{className:"text-sm font-medium",children:[Math.abs(Jt).toFixed(1),"%"]})]})]})]}),a.jsx("div",{className:"h-8 w-[1px] bg-white/10"}),a.jsxs("div",{className:"flex items-center gap-3 min-w-fit",children:[a.jsx("div",{className:"w-10 h-10 rounded-none bg-white/5 border border-dashed border-white/10 flex items-center justify-center flex-shrink-0",children:a.jsx(bw,{className:"w-5 h-5 text-white"})}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-gray-400 text-sm uppercase tracking-wide",children:"Sessions"}),a.jsx("span",{className:"text-white text-lg font-medium",children:Ts?"...":_a(Ta.sessions)}),a.jsxs("div",{className:`flex items-center gap-1 ${Cn>=0?"text-green-500":"text-red-500"}`,children:[a.jsx("svg",{className:`w-3 h-3 ${Cn<0?"rotate-180":""}`,viewBox:"0 0 12 12",fill:"currentColor",children:a.jsx("path",{d:"M6 0 L12 12 L0 12 Z"})}),a.jsxs("span",{className:"text-sm font-medium",children:[Math.abs(Cn).toFixed(1),"%"]})]})]})]}),a.jsx("div",{className:"h-8 w-[1px] bg-white/10"}),a.jsxs("div",{className:"flex items-center gap-3 min-w-fit",children:[a.jsx("div",{className:"w-10 h-10 rounded-none bg-white/5 border border-dashed border-white/10 flex items-center justify-center flex-shrink-0",children:a.jsx(pw,{className:"w-5 h-5 text-white"})}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-gray-400 text-sm uppercase tracking-wide",children:"Activity Hits"}),a.jsx("span",{className:"text-white text-lg font-medium",children:Ts?"...":_a(kf??0)}),a.jsxs("div",{className:`flex items-center gap-1 ${el>=0?"text-green-500":"text-red-500"}`,children:[a.jsx("svg",{className:`w-3 h-3 ${el<0?"rotate-180":""}`,viewBox:"0 0 12 12",fill:"currentColor",children:a.jsx("path",{d:"M6 0 L12 12 L0 12 Z"})}),a.jsxs("span",{className:"text-sm font-medium",children:[Math.abs(el).toFixed(1),"%"]})]})]})]}),a.jsx("div",{className:"h-8 w-[1px] bg-white/10"}),a.jsxs("div",{className:"flex items-center gap-3 min-w-fit",children:[a.jsx("div",{className:"w-10 h-10 rounded-none bg-white/5 border border-dashed border-white/10 flex items-center justify-center flex-shrink-0",children:a.jsx(dt,{className:"w-5 h-5 text-white"})}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-gray-400 text-sm uppercase tracking-wide",children:"New Users"}),a.jsx("span",{className:"text-white text-lg font-medium",children:Ts?"...":_a(i??0)}),a.jsxs("div",{className:`flex items-center gap-1 ${sl>=0?"text-green-500":"text-red-500"}`,children:[a.jsx("svg",{className:`w-3 h-3 ${sl<0?"rotate-180":""}`,viewBox:"0 0 12 12",fill:"currentColor",children:a.jsx("path",{d:"M6 0 L12 12 L0 12 Z"})}),a.jsxs("span",{className:"text-sm font-medium",children:[Math.abs(sl).toFixed(1),"%"]})]})]})]})]})}),a.jsxs("div",{className:"px-6 pb-10 space-y-6",children:[a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"bg-white/5 border border-white/10 p-6 relative",children:[a.jsx("div",{className:"absolute top-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-sm text-white uppercase font-light",children:"TOTAL USER"}),a.jsx("div",{className:"flex items-center space-x-1 overflow-x-auto",children:["1D","1W","6M","1Y"].map(de=>a.jsx("button",{onClick:()=>c(de),className:`px-2 py-1 text-xs font-light transition-colors whitespace-nowrap ${l===de?"bg-white/20 text-white border border-white/30":"text-gray-500 hover:text-white"}`,children:de},de))})]}),a.jsxs("div",{className:"flex justify-between items-end mb-6",children:[a.jsx("p",{className:"text-4xl text-white font-light",children:Ts?"...":_a(Ta.users)}),a.jsxs("div",{className:"flex items-center gap-1 px-2 py-1",children:[a.jsx("svg",{className:`w-3 h-3 ${bt>=0?"text-green-500":"text-red-500 rotate-180"}`,viewBox:"0 0 12 12",fill:"currentColor",children:a.jsx("path",{d:"M6 0 L12 12 L0 12 Z"})}),a.jsxs("span",{className:`text-xs font-medium ${bt>=0?"text-green-500":"text-red-500"}`,children:[Math.abs(bt).toFixed(1),"%"]})]})]}),a.jsxs("div",{className:"space-y-2 relative",children:[a.jsxs("div",{className:"h-32 relative",children:[a.jsx("svg",{className:"w-full h-full absolute inset-0",viewBox:"0 0 100 100",preserveAspectRatio:"none",children:a.jsx("defs",{children:a.jsxs("linearGradient",{id:"usersBarGradient",x1:"0%",y1:"0%",x2:"0%",y2:"100%",children:[a.jsx("stop",{offset:"0%",style:{stopColor:"rgba(255, 255, 255, 0.3)",stopOpacity:1}}),a.jsx("stop",{offset:"100%",style:{stopColor:"rgba(255, 255, 255, 0.05)",stopOpacity:1}})]})})}),a.jsx("div",{className:"h-32 flex items-end justify-between space-x-1 relative z-10",children:Of(l,"users").map((de,je)=>{const De=_===je;return a.jsx("div",{className:"flex-1 transition-all duration-200 ease-out relative cursor-pointer group",style:{height:`${de}%`,background:"url(#usersBarGradient)"},onMouseEnter:Se=>{const ye=Se.currentTarget.getBoundingClientRect(),Ge=ye.left+ye.width/2,xn=ye.top,sn=150,Oa=60,il=Math.max(sn/2,Math.min(window.innerWidth-sn/2,Ge)),_r=Math.max(Oa+10,Math.min(window.innerHeight-10,xn));E(je),A({x:il,y:_r})},onMouseLeave:()=>{E(null),A(null)},children:a.jsx("div",{className:"w-full h-full",style:{background:"linear-gradient(to bottom, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.05))",opacity:De?1:.8}})},je)})}),_!==null&&D&&a.jsx("div",{className:"fixed z-50 pointer-events-none transition-all duration-200 ease-out animate-in fade-in",style:{left:`${D.x}px`,top:`${D.y}px`,transform:"translate(-50%, -100%)",maxWidth:"calc(100vw - 20px)"},children:a.jsxs("div",{className:"bg-black border border-white/20 rounded-sm px-3 py-2 shadow-lg whitespace-nowrap",children:[a.jsx("div",{className:"text-xs text-gray-400 mb-1 font-mono uppercase",children:Af(l,"users")[_]}),a.jsxs("div",{className:"text-sm text-white font-sans font-medium",children:[Tt[_]!==void 0?Tt[_].toLocaleString():"0"," ",a.jsx("span",{className:"font-mono text-xs text-gray-400",children:"users"})]})]})})]}),a.jsx("div",{className:`flex justify-between ${l==="1M"?"text-[10px]":"text-xs"} text-gray-500 font-mono`,children:Dr(l,"users").map((de,je)=>a.jsx("span",{className:"flex-1 text-center truncate",children:de},je))})]})]}),a.jsxs("div",{className:"bg-white/5 border border-white/10 p-6 relative",children:[a.jsx("div",{className:"absolute top-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"text-sm text-white uppercase font-light",children:"Activity Hits"}),a.jsx("p",{className:"text-4xl text-white font-light mt-1",children:Xe?"...":Aa(dd)}),a.jsx("p",{className:"text-xs text-gray-400",children:"Tracked events in selected period"})]}),a.jsx("div",{className:"flex items-center space-x-1 overflow-x-auto",children:["1D","1W","1M","3M","6M","1Y","ALL"].map(de=>a.jsx("button",{onClick:()=>h(de),className:`px-2 py-1 text-xs font-light transition-colors whitespace-nowrap ${u===de?"bg-white/20 text-white border border-white/30":"text-gray-500 hover:text-white"}`,children:de},de))})]}),a.jsxs("div",{className:"space-y-2 relative",children:[a.jsx("div",{className:"h-40 flex items-end gap-1",children:me.map((de,je)=>{const De=ve[je]||0;return a.jsx("div",{className:"flex-1 flex flex-col justify-end gap-[1px] h-full cursor-pointer",onMouseEnter:Se=>Df(Se,je),onMouseLeave:()=>{R(null),X(null)},children:El.map(Se=>{var xn;const ye=((xn=fe[Se.id])==null?void 0:xn[je])??0,Ge=De===0||be===0?0:Math.max(ye/be*100,ye>0?4:0);return a.jsx("div",{className:`w-full ${Se.barClass}`,style:{height:`${Ge}%`}},`${Se.id}-${je}`)})},`${de}-${je}`)})}),Xe&&a.jsx("div",{className:"absolute inset-0 bg-black/40 backdrop-blur-sm flex items-center justify-center text-xs uppercase text-gray-400 pointer-events-none",children:"Loading activity..."}),q!==null&&L&&a.jsx("div",{className:"fixed z-50 pointer-events-none transition-all duration-200 ease-out animate-in fade-in",style:{left:`${L.x}px`,top:`${L.y}px`,transform:"translate(-50%, -100%)",maxWidth:"calc(100vw - 20px)"},children:a.jsxs("div",{className:"bg-black border border-white/20 rounded-sm px-3 py-2 shadow-lg min-w-[180px]",children:[a.jsx("div",{className:"text-xs text-gray-400 mb-2 font-mono uppercase",children:me[q]||`Bucket ${q+1}`}),a.jsx("div",{className:"space-y-1",children:El.map(de=>{var je;return a.jsxs("div",{className:"flex items-center justify-between text-sm",children:[a.jsxs("div",{className:"flex items-center gap-2 text-gray-300",children:[a.jsx("span",{className:`w-2 h-2 rounded-sm ${de.dotClass}`}),de.label]}),a.jsx("span",{className:"text-white font-medium",children:((je=fe[de.id])==null?void 0:je[q])??0})]},de.id)})})]})}),a.jsx("div",{className:`flex justify-between ${u==="1M"?"text-[10px]":"text-xs"} text-gray-500 font-mono`,children:me.map((de,je)=>a.jsx("span",{className:"flex-1 text-center truncate",children:de},je))}),a.jsx("div",{className:"grid grid-cols-2 lg:grid-cols-5 gap-3 mt-4 pt-4 border-t border-white/10",children:El.map(de=>a.jsxs("div",{className:"flex items-center justify-between text-xs text-gray-400",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:`w-2 h-2 rounded-sm ${de.dotClass}`}),de.label]}),a.jsx("span",{className:"text-white font-medium",children:Xe?"...":Aa(al[de.id]||0)})]},de.id))})]})]})]}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[a.jsxs("div",{className:"space-y-4 overflow-x-hidden",children:[a.jsxs("div",{className:"bg-white/5 border border-white/10 p-6 pb-2 relative",children:[a.jsx("div",{className:"absolute top-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsxs("div",{className:"flex items-center justify-between mb-2 relative -mt-2 pb-1",children:[a.jsxs("div",{className:"relative",children:[a.jsxs("button",{onClick:()=>T(!C),className:"text-xs h-full font-mono uppercase text-gray-400 flex items-center space-x-1 hover:text-white transition-colors",children:[a.jsx(Gd,{className:"w-3 h-3"}),a.jsx("span",{children:v})]}),C&&a.jsx("div",{className:"absolute top-6 left-0 w-[150px] z-10 bg-black border border-white/10 rounded-none shadow-lg",children:Ci.map(de=>a.jsx("button",{onClick:()=>{j(de),T(!1)},className:"block border-b border-dashed border-white/5 w-full text-left px-4 py-2 text-xs text-white hover:bg-white/10 transition-colors whitespace-nowrap",children:de},de))})]}),v==="Custom"&&a.jsxs("div",{className:"h-0 flex items-center gap-2",children:[a.jsxs(Kn,{children:[a.jsx(Jn,{asChild:!0,children:a.jsxs(W,{variant:"outline",className:"h-6 px-2 text-xs font-mono uppercase text-gray-400 hover:text-white bg-transparent border-white/10 hover:bg-white/5",children:[a.jsx(ls,{className:"mr-1 h-3 w-3"}),G?Zn(G,"MMM dd yyyy"):"From"]})}),a.jsx(zn,{className:"w-auto p-0 bg-black border-white/10",children:a.jsx(Qn,{mode:"single",selected:G,onSelect:te,initialFocus:!0,className:"rounded-none"})})]}),a.jsxs(Kn,{children:[a.jsx(Jn,{asChild:!0,children:a.jsxs(W,{variant:"outline",className:"h-6 px-2 text-xs font-mono uppercase text-gray-400 hover:text-white bg-transparent border-white/10 hover:bg-white/5",children:[a.jsx(ls,{className:"mr-1 h-3 w-3"}),re?Zn(re,"MMM dd yyyy"):"To"]})}),a.jsx(zn,{className:"w-auto p-0 bg-black border-white/10",children:a.jsx(Qn,{mode:"single",selected:re,onSelect:ee,initialFocus:!0,disabled:de=>G?de<G:!1,className:"rounded-none"})})]})]})]}),a.jsx("hr",{className:"mb-2 -mx-10 border-white/10"}),a.jsx("h4",{className:"text-md text-white/80 uppercase font-mono font-light mb-1",children:"Active Users"}),a.jsx("p",{className:"text-xs text-gray-400 mb-3",children:"Users with active session in the time frame"}),a.jsxs("div",{className:"flex pt-4 justify-between items-end",children:[a.jsx("p",{className:"text-3xl text-white font-light",children:Aa(s)}),a.jsx("div",{className:"mt-2 mb-1 flex items-center gap-2",children:a.jsxs("div",{className:"flex items-center -mr-5 gap-1 px-2 py-1 border-white/5 rounded-none",children:[a.jsx("svg",{className:`w-3 h-3 ${ie>=0?"text-green-500":"text-red-500 rotate-180"}`,viewBox:"0 0 12 12",fill:"currentColor",children:a.jsx("path",{d:"M6 0 L12 12 L0 12 Z"})}),a.jsxs("span",{className:`text-xs font-medium ${ie>=0?"text-green-500":"text-red-500"}`,children:[Math.abs(ie).toFixed(1),"%"]})]})})]})]}),a.jsxs("div",{className:"bg-white/5 border border-white/10 p-6 pb-2 relative",children:[a.jsx("div",{className:"absolute top-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsxs("div",{className:"flex items-center justify-between mb-2 relative -mt-2 pb-1",children:[a.jsxs("div",{className:"relative",children:[a.jsxs("button",{onClick:()=>B(!U),className:"text-xs h-full font-mono uppercase text-gray-400 flex items-center space-x-1 hover:text-white transition-colors",children:[a.jsx(Gd,{className:"w-3 h-3"}),a.jsx("span",{children:g})]}),U&&a.jsx("div",{className:"absolute top-6 left-0 w-[150px] z-10 bg-black border border-white/10 rounded-none shadow-lg",children:Ci.map(de=>a.jsx("button",{onClick:()=>{y(de),B(!1)},className:"block border-b border-dashed border-white/5 w-full text-left px-4 py-2 text-xs text-white hover:bg-white/10 transition-colors whitespace-nowrap",children:de},de))})]}),g==="Custom"&&a.jsxs("div",{className:"h-0 flex items-center gap-2",children:[a.jsxs(Kn,{children:[a.jsx(Jn,{asChild:!0,children:a.jsxs(W,{variant:"outline",className:"h-6 px-2 text-xs font-mono uppercase text-gray-400 hover:text-white bg-transparent border-white/10 hover:bg-white/5",children:[a.jsx(ls,{className:"mr-1 h-3 w-3"}),se?Zn(se,"MMM dd yyyy"):"From"]})}),a.jsx(zn,{className:"w-auto p-0 bg-black border-white/10",children:a.jsx(Qn,{mode:"single",selected:se,onSelect:ge,initialFocus:!0,className:"rounded-none"})})]}),a.jsxs(Kn,{children:[a.jsx(Jn,{asChild:!0,children:a.jsxs(W,{variant:"outline",className:"h-6 px-2 text-xs font-mono uppercase text-gray-400 hover:text-white bg-transparent border-white/10 hover:bg-white/5",children:[a.jsx(ls,{className:"mr-1 h-3 w-3"}),ae?Zn(ae,"MMM dd yyyy"):"To"]})}),a.jsx(zn,{className:"w-auto p-0 bg-black border-white/10",children:a.jsx(Qn,{mode:"single",selected:ae,onSelect:ue,initialFocus:!0,disabled:de=>se?de<se:!1,className:"rounded-none"})})]})]})]}),a.jsx("hr",{className:"mb-2 -mx-10 border-white/10"}),a.jsx("h4",{className:"text-md text-white/80 uppercase font-mono font-light mb-1",children:"New Users"}),a.jsx("p",{className:"text-xs text-gray-400 mb-3",children:"Newly registered Users in the time frame"}),a.jsxs("div",{className:"flex pt-4 justify-between items-end",children:[a.jsx("p",{className:"text-3xl text-white font-light",children:Aa(od)}),a.jsx("div",{className:"mt-2 mb-1 flex items-center gap-2",children:a.jsxs("div",{className:"flex items-center -mr-5 gap-1 px-2 py-1 rounded-none",children:[a.jsx("svg",{className:`w-3 h-3 ${Ni>=0?"text-green-500":"text-red-500 rotate-180"}`,viewBox:"0 0 12 12",fill:"currentColor",style:Ni<0?{transform:"rotate(180deg)"}:{},children:a.jsx("path",{d:"M6 0 L12 12 L0 12 Z"})}),a.jsxs("span",{className:`text-xs font-medium ${Ni>=0?"text-green-500":"text-red-500"}`,children:[Math.abs(Ni).toFixed(1),"%"]})]})})]})]})]}),a.jsxs("div",{className:"space-y-4 overflow-x-hidden",children:[a.jsxs("div",{className:"bg-white/5 border border-white/10 p-6 pb-2 relative",children:[a.jsx("div",{className:"absolute top-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsxs("div",{className:"flex items-center justify-between mb-2 relative -mt-2 pb-1",children:[a.jsxs("div",{className:"relative",children:[a.jsxs("button",{onClick:()=>z(!P),className:"text-xs h-full font-mono uppercase text-gray-400 flex items-center space-x-1 hover:text-white transition-colors",children:[a.jsx(Gd,{className:"w-3 h-3"}),a.jsx("span",{children:p})]}),P&&a.jsx("div",{className:"absolute top-6 left-0 w-[150px] z-10 bg-black border border-white/10 rounded-none shadow-lg",children:Ci.map(de=>a.jsx("button",{onClick:()=>{w(de),z(!1)},className:"block border-b border-dashed border-white/5 w-full text-left px-4 py-2 text-xs text-white hover:bg-white/10 transition-colors whitespace-nowrap",children:de},de))})]}),p==="Custom"&&a.jsxs("div",{className:"h-0 flex items-center gap-2",children:[a.jsxs(Kn,{children:[a.jsx(Jn,{asChild:!0,children:a.jsxs(W,{variant:"outline",className:"h-6 px-2 text-xs font-mono uppercase text-gray-400 hover:text-white bg-transparent border-white/10 hover:bg-white/5",children:[a.jsx(ls,{className:"mr-1 h-3 w-3"}),he?Zn(he,"MMM dd yyyy"):"From"]})}),a.jsx(zn,{className:"w-auto p-0 bg-black border-white/10",children:a.jsx(Qn,{mode:"single",selected:he,onSelect:we,initialFocus:!0,className:"rounded-none"})})]}),a.jsxs(Kn,{children:[a.jsx(Jn,{asChild:!0,children:a.jsxs(W,{variant:"outline",className:"h-6 px-2 text-xs font-mono uppercase text-gray-400 hover:text-white bg-transparent border-white/10 hover:bg-white/5",children:[a.jsx(ls,{className:"mr-1 h-3 w-3"}),Ne?Zn(Ne,"MMM dd yyyy"):"To"]})}),a.jsx(zn,{className:"w-auto p-0 bg-black border-white/10",children:a.jsx(Qn,{mode:"single",selected:Ne,onSelect:Ce,initialFocus:!0,disabled:de=>he?de<he:!1,className:"rounded-none"})})]})]})]}),a.jsx("hr",{className:"mb-2 -mx-10 border-white/10"}),a.jsx("h4",{className:"text-md text-white/80 uppercase font-mono font-light mb-1",children:"Organizations"}),a.jsx("p",{className:"text-xs text-gray-400 mb-3",children:"Total organizations in the time frame"}),a.jsxs("div",{className:"flex pt-4 justify-between items-end",children:[a.jsx("p",{className:"text-3xl text-white font-light",children:ce?"...":Aa(Ct)}),a.jsx("div",{className:"mt-2 mb-1 flex items-center gap-2",children:a.jsxs("div",{className:"flex items-center -mr-5 gap-1 px-2 py-1 rounded-none",children:[a.jsx("svg",{className:`w-3 h-3 ${Ee>=0?"text-green-500":"text-red-500 rotate-180"}`,viewBox:"0 0 12 12",fill:"currentColor",children:a.jsx("path",{d:"M6 0 L12 12 L0 12 Z"})}),a.jsxs("span",{className:`text-xs font-medium ${Ee>=0?"text-green-500":"text-red-500"}`,children:[Math.abs(Ee).toFixed(1),"%"]})]})})]})]}),a.jsxs("div",{className:"bg-white/5 border border-white/10 p-6 pb-2 relative",children:[a.jsx("div",{className:"absolute top-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsxs("div",{className:"flex items-center justify-between mb-2 relative -mt-2 pb-1",children:[a.jsxs("div",{className:"relative",children:[a.jsxs("button",{onClick:()=>k(!Y),className:"text-xs h-full font-mono uppercase text-gray-400 flex items-center space-x-1 hover:text-white transition-colors",children:[a.jsx(Gd,{className:"w-3 h-3"}),a.jsx("span",{children:N})]}),Y&&a.jsx("div",{className:"absolute top-6 left-0 w-[150px] z-10 bg-black border border-white/10 rounded-none shadow-lg",children:Ci.map(de=>a.jsx("button",{onClick:()=>{S(de),k(!1)},className:"block border-b border-dashed border-white/5 w-full text-left px-4 py-2 text-xs text-white hover:bg-white/10 transition-colors whitespace-nowrap",children:de},de))})]}),N==="Custom"&&a.jsxs("div",{className:"h-0 flex items-center gap-2",children:[a.jsxs(Kn,{children:[a.jsx(Jn,{asChild:!0,children:a.jsxs(W,{variant:"outline",className:"h-6 px-2 text-xs font-mono uppercase text-gray-400 hover:text-white bg-transparent border-white/10 hover:bg-white/5",children:[a.jsx(ls,{className:"mr-1 h-3 w-3"}),Ae?Zn(Ae,"MMM dd yyyy"):"From"]})}),a.jsx(zn,{className:"w-auto p-0 bg-black border-white/10",children:a.jsx(Qn,{mode:"single",selected:Ae,onSelect:tt,initialFocus:!0,className:"rounded-none"})})]}),a.jsxs(Kn,{children:[a.jsx(Jn,{asChild:!0,children:a.jsxs(W,{variant:"outline",className:"h-6 px-2 text-xs font-mono uppercase text-gray-400 hover:text-white bg-transparent border-white/10 hover:bg-white/5",children:[a.jsx(ls,{className:"mr-1 h-3 w-3"}),$e?Zn($e,"MMM dd yyyy"):"To"]})}),a.jsx(zn,{className:"w-auto p-0 bg-black border-white/10",children:a.jsx(Qn,{mode:"single",selected:$e,onSelect:Rt,initialFocus:!0,disabled:de=>Ae?de<Ae:!1,className:"rounded-none"})})]})]})]}),a.jsx("hr",{className:"mb-2 -mx-10 border-white/10"}),a.jsx("h4",{className:"text-md text-white/80 uppercase font-mono font-light mb-1",children:"Teams"}),a.jsx("p",{className:"text-xs text-gray-400 mb-3",children:"Total teams in the time frame"}),a.jsxs("div",{className:"flex pt-4 justify-between items-end",children:[a.jsx("p",{className:"text-3xl text-white font-light",children:I?"...":Aa(ne)}),a.jsx("div",{className:"mt-2 mb-1 flex items-center gap-2",children:a.jsxs("div",{className:"flex items-center -mr-5 gap-1 px-2 py-1 rounded-none",children:[a.jsx("svg",{className:`w-3 h-3 ${Ue>=0?"text-green-500":"text-red-500 rotate-180"}`,viewBox:"0 0 12 12",fill:"currentColor",children:a.jsx("path",{d:"M6 0 L12 12 L0 12 Z"})}),a.jsxs("span",{className:`text-xs font-medium ${Ue>=0?"text-green-500":"text-red-500"}`,children:[Math.abs(Ue).toFixed(1),"%"]})]})})]})]})]}),a.jsxs("div",{className:"bg-white/5 border border-white/10 p-6 pt-4 overflow-hidden relative rounded-none flex flex-col",children:[a.jsx("div",{className:"absolute top-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(wn,{className:"w-4 h-4 text-white/60"}),a.jsx("h4",{className:"text-xs text-gray-400 uppercase font-mono font-light",children:"Security Insights"})]})}),a.jsx("hr",{className:"-mx-10 -mt-1 border-white/10"}),a.jsxs("div",{className:"space-y-3 overflow-y-auto custom-scrollbar max-h-[400px]",children:[ud.length===0&&a.jsx("div",{className:"text-sm flex items-center justify-center text-gray-400",children:a.jsxs("div",{className:"flex mt-5 items-center justify-center",children:[a.jsx(wn,{className:"w-4 h-4 text-gray-400 mr-2"}),a.jsx("p",{className:"text-center",children:"No security insights found"})]})}),ud.map((de,je)=>a.jsx("div",{onClick:()=>_f(de),className:"group py-2 border-b border-white/5 cursor-pointer transition-all duration-200 hover:border-white/20",style:{animation:`slideIn 0.3s ease-out ${je*.1}s both`},children:a.jsxs("div",{className:"flex items-start justify-between gap-3",children:[a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("div",{className:"flex items-center gap-2 mb-1.5",children:a.jsx("span",{className:"text-sm text-white/90 font-light truncate group-hover:text-white transition-colors",children:de.title})}),a.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[a.jsx("span",{className:`text-[9px] px-1.5 py-0.5 border rounded-sm uppercase font-mono ${hd(de.severity)}`,children:de.severity}),a.jsx("span",{className:`text-[9px] px-1.5 py-0.5 border rounded-sm capitalize font-mono ${fd(de.status)}`,children:de.status})]})]}),a.jsx(tR,{className:"w-3.5 h-3.5 text-gray-500 group-hover:text-white transition-all flex-shrink-0 mt-0.5"})]})},de.id))]})]})]})]})]})};return a.jsxs("div",{className:"h-screen bg-black text-white overflow-hidden flex flex-col",style:{overflowX:"hidden"},children:[a.jsx("div",{className:"flex-1 overflow-hidden",children:e==="overview"?md():e==="users"?a.jsx(tE,{}):e==="organizations"?a.jsx(eE,{}):md()}),t&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-3xl rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(bw,{className:"w-6 h-6 text-white"}),a.jsx("h3",{className:"text-lg text-white font-light",children:"Quick Actions"})]}),a.jsx(W,{variant:"ghost",size:"sm",onClick:()=>n(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Vt,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("button",{onClick:()=>{n(!1),Da("/users")},className:"flex items-center space-x-4 p-4 bg-black/30 border border-dashed border-white/20 rounded-none hover:bg-black/50 transition-colors text-left group",children:[a.jsx("div",{className:"p-2 bg-white/10 rounded-none group-hover:bg-white/20 transition-colors",children:a.jsx(dt,{className:"w-6 h-6 text-white"})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h4",{className:"text-white font-light mb-1",children:"View All Users"}),a.jsx("p",{className:"text-sm text-gray-400",children:"Manage user accounts"})]}),a.jsx(qa,{className:"w-4 h-4 text-gray-400 group-hover:text-white transition-colors"})]}),a.jsxs("button",{onClick:()=>{n(!1),Da("/organizations")},className:"flex items-center space-x-4 p-4 bg-black/30 border border-dashed border-white/20 rounded-none hover:bg-black/50 transition-colors text-left group",children:[a.jsx("div",{className:"p-2 bg-white/10 rounded-none group-hover:bg-white/20 transition-colors",children:a.jsx(Un,{className:"w-6 h-6 text-white"})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h4",{className:"text-white font-light mb-1",children:"View Organizations"}),a.jsx("p",{className:"text-sm text-gray-400",children:"Manage organizations"})]}),a.jsx(qa,{className:"w-4 h-4 text-gray-400 group-hover:text-white transition-colors"})]}),a.jsxs("button",{onClick:()=>{n(!1),Da("/sessions")},className:"flex items-center space-x-4 p-4 bg-black/30 border border-dashed border-white/20 rounded-none hover:bg-black/50 transition-colors text-left group",children:[a.jsx("div",{className:"p-2 bg-white/10 rounded-none group-hover:bg-white/20 transition-colors",children:a.jsx(pw,{className:"w-6 h-6 text-white"})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h4",{className:"text-white font-light mb-1",children:"View Sessions"}),a.jsx("p",{className:"text-sm text-gray-400",children:"Monitor active sessions"})]}),a.jsx(qa,{className:"w-4 h-4 text-gray-400 group-hover:text-white transition-colors"})]}),a.jsxs("button",{onClick:()=>{n(!1),Da("/database")},className:"flex items-center space-x-4 p-4 bg-black/30 border border-dashed border-white/20 rounded-none hover:bg-black/50 transition-colors text-left group",children:[a.jsx("div",{className:"p-2 bg-white/10 rounded-none group-hover:bg-white/20 transition-colors",children:a.jsx(ga,{className:"w-6 h-6 text-white"})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h4",{className:"text-white font-light mb-1",children:"Database Schema"}),a.jsx("p",{className:"text-sm text-gray-400",children:"View schema visualizer"})]}),a.jsx(qa,{className:"w-4 h-4 text-gray-400 group-hover:text-white transition-colors"})]}),a.jsxs("button",{onClick:()=>{n(!1),Da("/settings")},className:"flex items-center space-x-4 p-4 bg-black/30 border border-dashed border-white/20 rounded-none hover:bg-black/50 transition-colors text-left group",children:[a.jsx("div",{className:"p-2 bg-white/10 rounded-none group-hover:bg-white/20 transition-colors",children:a.jsx(qC,{className:"w-6 h-6 text-white"})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h4",{className:"text-white font-light mb-1",children:"Settings"}),a.jsx("p",{className:"text-sm text-gray-400",children:"Configure system"})]}),a.jsx(qa,{className:"w-4 h-4 text-gray-400 group-hover:text-white transition-colors"})]}),a.jsxs("button",{onClick:()=>{n(!1),Da("/users")},className:"flex items-center space-x-4 p-4 bg-black/30 border border-dashed border-white/20 rounded-none hover:bg-black/50 transition-colors text-left group",children:[a.jsx("div",{className:"p-2 bg-white/10 rounded-none group-hover:bg-white/20 transition-colors",children:a.jsx(IC,{className:"w-6 h-6 text-white"})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h4",{className:"text-white font-light mb-1",children:"Search Users"}),a.jsx("p",{className:"text-sm text-gray-400",children:"Find specific users"})]}),a.jsx(qa,{className:"w-4 h-4 text-gray-400 group-hover:text-white transition-colors"})]})]}),a.jsx("div",{className:"mt-6 pt-6 border-t border-dashed border-white/10",children:a.jsxs("div",{className:"flex items-center justify-between text-sm text-gray-400",children:[a.jsx("span",{children:"Tip: Press Ctrl+K or Cmd+K for command palette"}),a.jsx(W,{variant:"ghost",size:"sm",onClick:()=>n(!1),className:"text-gray-400 hover:text-white rounded-none",children:"Close"})]})})]})}),x&&d&&a.jsx("div",{className:"fixed inset-0 bg-black/80 backdrop-blur-sm z-50 flex items-center justify-center p-4",style:{animation:"fadeIn 0.3s ease-out"},onClick:rl,children:a.jsxs("div",{className:"bg-black border border-white/20 rounded-none max-w-2xl w-full max-h-[80vh] overflow-y-auto",style:{animation:"slideUp 0.3s ease-out"},onClick:me=>me.stopPropagation(),children:[a.jsx("div",{className:"sticky top-0 bg-black border-b border-white/10 p-6 z-10",children:a.jsxs("div",{className:"flex items-start justify-between gap-4",children:[a.jsxs("div",{className:"flex-1",children:[a.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[a.jsx(wn,{className:"w-6 h-6 text-white"}),a.jsx("h3",{className:"text-xl text-white font-light",children:d.title})]}),a.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[a.jsxs("span",{className:`text-xs px-2 py-1 border rounded-none uppercase font-medium ${hd(d.severity)}`,children:[d.severity," Severity"]}),a.jsx("span",{className:`text-xs px-2 py-1 border rounded-none capitalize ${fd(d.status)}`,children:d.status}),d.cve&&a.jsx("span",{className:"text-xs text-gray-400 font-mono bg-white/5 px-2 py-1 border border-white/10 rounded-none",children:d.cve})]})]}),a.jsx("button",{onClick:rl,className:"p-2 hover:bg-white/10 transition-colors rounded-none",children:a.jsx(Vt,{className:"w-5 h-5 text-gray-400 hover:text-white"})})]})}),a.jsxs("div",{className:"p-6 space-y-6",children:[a.jsxs("div",{children:[a.jsx("h4",{className:"text-sm text-gray-400 uppercase tracking-wide mb-2",children:"Release Date"}),a.jsx("p",{className:"text-white",children:new Date(d.date).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})})]}),a.jsxs("div",{children:[a.jsx("h4",{className:"text-sm text-gray-400 uppercase tracking-wide mb-2",children:"Description"}),d.description.includes("npm install")?a.jsxs("div",{children:[a.jsx("p",{className:"text-white leading-relaxed mb-3",children:d.description.split("Run:")[0]}),a.jsx("div",{className:"relative group",children:a.jsx("div",{className:"bg-black border border-white/20 rounded-none p-3 font-mono text-sm",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("code",{children:[a.jsx("span",{className:"text-green-400",children:"$"})," ",a.jsx("span",{className:"text-cyan-400",children:"npm"})," ",a.jsx("span",{className:"text-yellow-400",children:"install"})," ",a.jsx("span",{className:"text-white",children:"better-auth@latest"})]}),a.jsx("button",{onClick:()=>{navigator.clipboard.writeText("npm install better-auth@latest"),V.success("Command copied to clipboard")},className:"opacity-0 group-hover:opacity-100 transition-opacity p-1 hover:bg-white/10 rounded",title:"Copy command",children:a.jsx(wu,{className:"w-4 h-4 text-gray-400 hover:text-white"})})]})})})]}):a.jsx("p",{className:"text-white leading-relaxed",children:d.description})]}),a.jsxs("div",{children:[a.jsx("h4",{className:"text-sm text-gray-400 uppercase tracking-wide mb-3",children:"Affected Components"}),a.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:d.affectedComponents.map((me,ve)=>a.jsxs("div",{className:"flex items-center gap-2 p-3 bg-white/5 border border-white/10 rounded-none",style:{animation:`slideIn 0.3s ease-out ${ve*.1}s both`},children:[a.jsx("div",{className:"w-2 h-2 bg-white rounded-none flex-shrink-0"}),a.jsx("span",{className:"text-sm text-white",children:me})]},ve))})]}),a.jsx("div",{className:"p-4 bg-white/5 border border-white/10 rounded-none",children:a.jsxs("div",{className:"flex items-start gap-3",children:[d.status==="applied"&&a.jsxs(a.Fragment,{children:[a.jsx(k0,{className:"w-5 h-5 text-white flex-shrink-0 mt-0.5"}),a.jsxs("div",{children:[a.jsx("h5",{className:"text-sm text-white font-medium mb-1",children:"Patch Applied"}),a.jsx("p",{className:"text-xs text-gray-400",children:"This security patch has been successfully applied to your system."})]})]}),d.status==="scheduled"&&a.jsxs(a.Fragment,{children:[a.jsx(WC,{className:"w-5 h-5 text-white flex-shrink-0 mt-0.5"}),a.jsxs("div",{children:[a.jsx("h5",{className:"text-sm text-white font-medium mb-1",children:"Scheduled"}),a.jsx("p",{className:"text-xs text-gray-400",children:"This patch is scheduled for deployment in the next maintenance window."})]})]}),d.status==="pending"&&a.jsxs(a.Fragment,{children:[a.jsx(TB,{className:"w-5 h-5 text-white flex-shrink-0 mt-0.5"}),a.jsxs("div",{children:[a.jsx("h5",{className:"text-sm text-white font-medium mb-1",children:"Action Required"}),a.jsx("p",{className:"text-xs text-gray-400",children:"This patch is pending review and requires manual approval before deployment."})]})]})]})}),a.jsx("div",{className:"flex items-center justify-end gap-3 pt-4 border-t border-white/10",children:a.jsx(W,{variant:"ghost",onClick:rl,className:"text-gray-400 hover:text-white rounded-none",children:"Close"})})]})]})}),a.jsx("style",{children:`
445
- @keyframes fadeIn {
446
- from {
447
- opacity: 0;
448
- }
449
- to {
450
- opacity: 1;
451
- }
452
- }
453
-
454
- @keyframes slideUp {
455
- from {
456
- opacity: 0;
457
- transform: translateY(20px);
458
- }
459
- to {
460
- opacity: 1;
461
- transform: translateY(0);
462
- }
463
- }
464
-
465
- @keyframes slideIn {
466
- from {
467
- opacity: 0;
468
- transform: translateX(-10px);
469
- }
470
- to {
471
- opacity: 1;
472
- transform: translateX(0);
473
- }
474
- }
475
-
476
- .custom-scrollbar::-webkit-scrollbar {
477
- width: 6px;
478
- }
479
-
480
- .custom-scrollbar::-webkit-scrollbar-track {
481
- background: rgba(255, 255, 255, 0.05);
482
- }
483
-
484
- .custom-scrollbar::-webkit-scrollbar-thumb {
485
- background: rgba(255, 255, 255, 0.2);
486
- border-radius: 3px;
487
- }
488
-
489
- .custom-scrollbar::-webkit-scrollbar-thumb:hover {
490
- background: rgba(255, 255, 255, 0.3);
491
- }
492
- `})]})}const Mn=m.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:_e("rounded-lg border border-gray-700 bg-gray-900 text-white shadow-sm",e),...t}));Mn.displayName="Card";const Tn=m.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:_e("flex flex-col space-y-1.5 p-6",e),...t}));Tn.displayName="CardHeader";const Dn=m.forwardRef(({className:e,...t},n)=>a.jsx("h3",{ref:n,className:_e("text-2xl font-semibold leading-none tracking-tight text-white",e),...t}));Dn.displayName="CardTitle";const Os=m.forwardRef(({className:e,...t},n)=>a.jsx("p",{ref:n,className:_e("text-sm text-gray-300",e),...t}));Os.displayName="CardDescription";const _n=m.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:_e("p-6 pt-0",e),...t}));_n.displayName="CardContent";const QB=m.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:_e("flex items-center p-6 pt-0",e),...t}));QB.displayName="CardFooter";const KB={databaseSchemaNode:Eg};function JB(){const[e,t]=m.useState(null),[n,s]=m.useState(!0),[r,i]=m.useState(null),[o,l]=m.useState([]),[c,u]=m.useState([]),[h,d,f]=jz([]),[x,b,v]=Nz([]),j=m.useCallback(async()=>{try{const N=await(await fetch("/api/plugins")).json();N.plugins&&Array.isArray(N.plugins)&&l(N.plugins.filter(S=>S.enabled))}catch{}},[]),g=m.useCallback(async()=>{try{s(!0);const N=await(await fetch("/api/database/schema")).json();N.success?t(N.schema):i(N.error||"Failed to fetch schema")}catch{i("Failed to fetch database schema")}finally{s(!1)}},[]);m.useEffect(()=>{j(),g()},[j,g]),m.useEffect(()=>{if(!e||o.length===0){u([]);return}const w=o.map(N=>{const S=e.tables.filter(B=>(B.origin||"core")===N.id),C=S.length,T=S.reduce((B,P)=>B+P.fields.length,0),U=S.reduce((B,P)=>B+P.relationships.length,0);return{pluginId:N.id,pluginName:N.name||N.id,tableCount:C,fieldCount:T,relationshipCount:U}});u(w.filter(N=>N.tableCount>0))},[e,o]),m.useEffect(()=>{if(!e)return;const w=[],N=[];e.tables.forEach((S,C)=>{const T=S.origin||"core",U=S.fields.map(B=>({id:`${S.name}-${B.name}`,isPrimary:B.primaryKey||!1,isNullable:!B.required,isUnique:B.unique||!1,isIdentity:!1,name:B.name,format:B.type,plugin:T,description:B.description}));w.push({id:S.name,type:"databaseSchemaNode",position:{x:C%3*380,y:Math.floor(C/3)*320},data:{name:S.name,displayName:S.displayName,isForeign:!1,plugin:T,columns:U,relationships:S.relationships}})}),e.tables.forEach(S=>{S.relationships.forEach(C=>{const T=S.name,U=C.target,B=w.find(z=>z.id===T),P=w.find(z=>z.id===U);if(B&&P){const z=C.type==="one-to-one"?"1:1":C.type==="many-to-one"?"N:1":"1:N";N.push({id:`${T}-${U}-${C.field}`,source:T,target:U,type:"smoothstep",animated:!1,style:{stroke:"#6b7280",strokeWidth:2,strokeDasharray:"0"},label:z,labelStyle:{fontSize:"11px",fill:"#9ca3af",fontWeight:"500"},labelBgStyle:{fill:"rgba(0, 0, 0, 0.9)",fillOpacity:1,borderRadius:4},markerEnd:{type:"arrowclosed",color:"#6b7280",width:12,height:12}})}})}),d(w),b(N)},[e,d,b]);const y=m.useCallback(w=>b(N=>D2(w,N)),[b]);if(n)return a.jsxs("div",{className:"p-6",children:[a.jsxs("div",{className:"animate-pulse",children:[a.jsx("div",{className:"h-8 bg-gray-700 rounded w-1/3 mb-6"}),a.jsx("div",{className:"h-96 bg-gray-700 rounded"})]}),a.jsx("div",{className:"text-center text-gray-500 dark:text-gray-400 mt-4",children:"Loading schema..."})]});if(r)return a.jsx("div",{className:"p-6",children:a.jsxs("div",{className:"bg-red-900/20 border border-red-500/20 rounded-none p-6",children:[a.jsx("h2",{className:"text-xl font-semibold text-red-400 mb-2",children:"Error Loading Schema"}),a.jsx("p",{className:"text-gray-300",children:r})]})});const p=a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"space-y-8",children:[a.jsx("div",{className:"flex items-center justify-between p-5 pt-7",children:a.jsxs("div",{children:[a.jsx("h1",{className:"text-3xl font-normal text-white tracking-tight",children:"Schema Visualizer"}),a.jsx("p",{className:"text-gray-300 mt-2 uppercase font-mono font-light text-xs",children:"Visualize your Better Auth database schema with interactive tables and relationships."})]})}),a.jsxs("div",{className:"flex flex-col items-center space-y-8 mb-4",children:[a.jsx("hr",{className:"w-full border-white/15 h-px"}),a.jsx("hr",{className:"w-full border-white/15 h-px"})]})]}),a.jsxs("div",{className:"flex-1 grid grid-cols-4 gap-6 mt-6",children:[a.jsxs("div",{className:"col-span-1 space-y-4",children:[a.jsxs(Mn,{className:"rounded-none bg-black h-fit shadow-sm border border-white/15",children:[a.jsx(Tn,{className:"border-b border-white/15 pb-2 -pt-1 mb-2",children:a.jsxs(Dn,{className:"font-light text-xl text-white flex items-center space-x-2",children:[a.jsx(ho,{className:"w-4 h-4"}),a.jsx("span",{className:"uppercase font-mono text-xs tracking-tight",children:"Detected Tables"})]})}),a.jsx(_n,{className:"space-y-3",children:e&&e.tables.length>0?a.jsx("div",{className:"space-y-3 max-h-80 overflow-y-auto pr-1 custom-scroll",children:e.tables.map(w=>a.jsxs("div",{className:"border border-white/10 p-3 rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between text-sm text-white",children:[a.jsx("span",{children:w.displayName}),a.jsx("span",{className:"text-xs uppercase font-mono text-gray-400",children:w.origin==="core"?"Core":"Extended"})]}),a.jsxs("div",{className:"text-xs text-gray-400 mt-1",children:[w.fields.length," fields · ",w.relationships.length," relationships"]})]},w.name))}):a.jsx("div",{className:"text-sm text-white/70",children:"No tables detected in Better Auth context"})})]}),e&&a.jsxs(Mn,{className:"rounded-none bg-black shadow-sm border border-white/15",children:[a.jsx(Tn,{className:"border-b border-white/15 pb-2 -pt-1 mb-2",children:a.jsxs(Dn,{className:"font-light text-xl text-white flex items-center space-x-2",children:[a.jsx(FC,{className:"w-4 h-4"}),a.jsx("span",{className:"uppercase font-mono text-xs tracking-tight",children:"Schema Summary"})]})}),a.jsxs(_n,{className:"space-y-2 text-sm",children:[a.jsxs("div",{className:"flex justify-between text-white/80",children:[a.jsx("span",{children:"Tables"}),a.jsx("span",{className:"text-white",children:e.tables.length})]}),a.jsxs("div",{className:"flex justify-between text-white/80",children:[a.jsx("span",{children:"Total Fields"}),a.jsx("span",{className:"text-white",children:e.tables.reduce((w,N)=>w+N.fields.length,0)})]}),a.jsxs("div",{className:"flex justify-between text-white/80",children:[a.jsx("span",{children:"Relationships"}),a.jsx("span",{className:"text-white",children:e.tables.reduce((w,N)=>w+N.relationships.length,0)})]})]})]}),c.length>0&&a.jsxs(Mn,{className:"rounded-none bg-black shadow-sm border border-white/15",children:[a.jsx(Tn,{children:a.jsx(Dn,{className:"text-white text-sm",children:"Enabled Plugins"})}),a.jsx(_n,{className:"space-y-3 text-sm",children:c.map(w=>a.jsxs("div",{className:"p-3 border border-white/15 bg-black/40 rounded-none",children:[a.jsx("div",{className:"flex items-center justify-between mb-2",children:a.jsx("span",{className:"text-white font-medium capitalize",children:w.pluginName})}),a.jsxs("div",{className:"space-y-1 text-xs text-gray-400",children:[a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{children:"Tables:"}),a.jsx("span",{className:"text-white/80",children:w.tableCount})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{children:"Fields:"}),a.jsx("span",{className:"text-white/80",children:w.fieldCount})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{children:"Relationships:"}),a.jsx("span",{className:"text-white/80",children:w.relationshipCount})]})]})]},w.pluginId))})]})]}),a.jsx("div",{className:"col-span-3",children:a.jsx("div",{className:"h-full bg-black border border-white/20 rounded-lg overflow-hidden shadow-xl",children:a.jsxs(wz,{nodes:h,edges:x,onNodesChange:f,onEdgesChange:v,onConnect:y,nodeTypes:KB,fitView:!0,fitViewOptions:{padding:.1,includeHiddenNodes:!1},className:"bg-black",connectionLineType:"smoothstep",defaultEdgeOptions:{style:{stroke:"#6b7280",strokeWidth:2},animated:!1,type:"smoothstep"},nodesDraggable:!0,nodesConnectable:!1,elementsSelectable:!0,children:[a.jsx(Rz,{className:"bg-gray-900 border-white/20 [&>button]:bg-gray-800 [&>button]:border-gray-600 [&>button]:text-white [&>button:hover]:bg-gray-700"}),a.jsx(Xz,{className:"bg-gray-900 border-white/20",nodeColor:w=>{var N;return(N=w.data)!=null&&N.isForeign?"#374151":"#1f2937"},maskColor:"rgba(0, 0, 0, 0.9)"}),a.jsx(Mz,{variant:ba.Dots,gap:20,size:1,color:"#374151"})]})})})]})]});return a.jsx("div",{className:"h-screen flex flex-col bg-black",children:p})}const eV=rC("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-white text-black hover:bg-white",secondary:"border-transparent bg-gray-800 text-white hover:bg-gray-800 border border-gray-600",destructive:"border-transparent bg-red-500 text-white hover:bg-red-600",outline:"text-gray-300 border-gray-600",success:"border-transparent bg-green-900 text-green-300",warning:"border-transparent bg-yellow-900 text-yellow-300",error:"border-transparent bg-red-900 text-red-300",info:"border-transparent bg-gray-800 text-white border border-gray-600"}},defaultVariants:{variant:"default"}});function gt({className:e,variant:t,...n}){return a.jsx("div",{className:_e(eV({variant:t}),e),...n})}function tV(){const{orgId:e}=Up(),t=Cs(),[n,s]=m.useState(null),[r,i]=m.useState([]),[o,l]=m.useState([]),[c,u]=m.useState([]),[h,d]=m.useState(!0),[f,x]=m.useState("details"),[b,v]=m.useState(!1),[j,g]=m.useState(!1),[y,p]=m.useState(!1),[w,N]=m.useState(!1),[S,C]=m.useState(!1),[T,U]=m.useState(!1),[B,P]=m.useState(!1),[z,Y]=m.useState(!1),[k,$]=m.useState(!1),[M,_]=m.useState(null),[E,D]=m.useState({name:"",slug:""}),[A,q]=m.useState(""),[R,L]=m.useState(""),[X,G]=m.useState([]),[te,re]=m.useState({name:""}),[ee,se]=m.useState(!1),[ge,ae]=m.useState([]),[ue,he]=m.useState(!1),[we,Ne]=m.useState([]),[Ce,Ae]=m.useState(!1);m.useEffect(()=>{e&&($e(),Tt(),Rt(),We(),vt(),Be())},[e]),m.useEffect(()=>{b&&e&&Be()},[]),m.useEffect(()=>{f==="members"&&e&&vt()},[f,e]),m.useEffect(()=>{f==="invitations"&&e&&We()},[f,e]);const tt=I=>{re({name:I})},$e=async()=>{try{const F=await(await fetch(`/api/organizations/${e}`)).json();F.success&&F.organization||F.organization?s(F.organization):V.error("Organization not found")}catch(I){console.error("Failed to fetch organization:",I),V.error("Failed to load organization")}finally{d(!1)}},Rt=async()=>{try{const F=await(await fetch("/api/plugins/teams/status")).json();v(F.enabled)}catch(I){console.error("Failed to check teams status:",I),v(!1)}},Tt=async()=>{try{const F=await(await fetch("/api/plugins/organization/status")).json();g(F.enabled)}catch(I){console.error("Failed to check organization status:",I),g(!1)}},Be=async()=>{try{const F=await(await fetch(`/api/organizations/${e}/teams`)).json();F.success&&i(F.teams||[])}catch(I){console.error("Failed to fetch teams:",I),V.error("Failed to load teams")}},We=async()=>{try{const F=await(await fetch(`/api/organizations/${e}/invitations`)).json();F.success&&l(F.invitations||[])}catch(I){console.error("Failed to fetch invitations:",I),V.error("Failed to load invitations")}},vt=async()=>{try{const F=await(await fetch(`/api/organizations/${e}/members`)).json();F.success&&u(F.members||[])}catch(I){console.error("Failed to fetch members:",I),V.error("Failed to load members")}},bt=async I=>{ae([]),he(!0),ae([{id:"start",type:"info",message:`Starting member seeding process for ${I} members...`,timestamp:new Date}]);try{const fe=await(await fetch(`/api/organizations/${e}/seed-members`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:I})})).json();if(fe.success){const ze=fe.results.map((Ke,Xe)=>Ke.success?{id:`member-${Xe}`,type:"progress",message:`Adding member: ${Ke.member.user.name} (${Ke.member.user.email})`,timestamp:new Date,status:"completed"}:{id:`member-${Xe}`,type:"error",message:`Failed to add member ${Xe+1}: ${Ke.error}`,timestamp:new Date});ae(Ke=>[...Ke,...ze]);const qe=fe.results.filter(Ke=>Ke.success).length;ae(Ke=>[...Ke,{id:"complete",type:"success",message:`✅ Seeding completed! Added ${qe}/${I} members successfully`,timestamp:new Date}]),await vt(),V.success(`Successfully added ${qe} members!`)}else ae(ze=>[...ze,{id:"error",type:"error",message:`❌ Seeding failed: ${fe.error||"Unknown error"}`,timestamp:new Date}]),V.error(fe.error||"Failed to seed members")}catch(F){ae(fe=>[...fe,{id:"error",type:"error",message:`❌ Network error: ${F}`,timestamp:new Date}]),V.error("Failed to seed members")}finally{he(!1)}},ft=async I=>{Ne([]),Ae(!0),Ne([{id:"start",type:"info",message:`Starting team seeding process for ${I} teams...`,timestamp:new Date}]);try{const fe=await(await fetch(`/api/organizations/${e}/seed-teams`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:I})})).json();if(fe.success){const ze=fe.results.map((Ke,Xe)=>Ke.success?{id:`team-${Xe}`,type:"progress",message:`Creating team: ${Ke.team.name}`,timestamp:new Date,status:"completed"}:{id:`team-${Xe}`,type:"error",message:`Failed to create team ${Xe+1}: ${Ke.error}`,timestamp:new Date});Ne(Ke=>[...Ke,...ze]);const qe=fe.results.filter(Ke=>Ke.success).length;Ne(Ke=>[...Ke,{id:"complete",type:"success",message:`✅ Seeding completed! Created ${qe}/${I} teams successfully`,timestamp:new Date}]),await Be(),V.success(`Successfully created ${qe} teams!`)}else Ne(ze=>[...ze,{id:"error",type:"error",message:`❌ Seeding failed: ${fe.error||"Unknown error"}`,timestamp:new Date}]),V.error(fe.error||"Failed to seed teams")}catch(F){Ne(fe=>[...fe,{id:"error",type:"error",message:`❌ Network error: ${F}`,timestamp:new Date}]),V.error("Failed to seed teams")}finally{Ae(!1)}},Q=async()=>{try{const F=await(await fetch("/api/users/all")).json();F.success&&G(F.users||[])}catch(I){console.error("Failed to fetch users:",I)}},H=I=>I.toLowerCase().replace(/\s+/g,"-").replace(/[^a-z0-9-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,""),O=()=>{n&&(D({name:n.name,slug:n.slug}),$(!0))},Z=I=>{const F=H(I);D({name:I,slug:F})},ie=I=>{D(F=>({...F,slug:H(I)}))},le=async()=>{if(!n){V.error("No organization selected");return}if(!E.name){V.error("Please fill in the organization name");return}const I=V.loading("Updating organization...");try{const fe=await(await fetch(`/api/organizations/${n.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:E.name,slug:E.slug})})).json();fe.success?(await $e(),$(!1),D({name:"",slug:""}),V.success("Organization updated successfully!",{id:I})):V.error(`Error updating organization: ${fe.error||"Unknown error"}`,{id:I})}catch(F){console.error("Error updating organization:",F),V.error("Error updating organization",{id:I})}},Ee=()=>{Q(),p(!0)},Re=async()=>{if(!A){V.error("Please enter an email address");return}if(!R){V.error("Please select an inviter");return}se(!0);const I=V.loading("Sending invitation...");try{const fe=await(await fetch(`/api/organizations/${e}/invitations`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:A,role:"member",inviterId:R})})).json();fe.success?(await We(),p(!1),q(""),L(""),V.success("Invitation sent successfully!",{id:I})):V.error(`Error sending invitation: ${fe.error||"Unknown error"}`,{id:I})}catch(F){console.error("Error sending invitation:",F),V.error("Error sending invitation",{id:I})}finally{se(!1)}},Ue=async I=>{const F=V.loading("Cancelling invitation...");try{const ze=await(await fetch(`/api/invitations/${I}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})).json();ze.success?(await We(),V.success("Invitation cancelled successfully!",{id:F})):V.error(`Error cancelling invitation: ${ze.error||"Unknown error"}`,{id:F})}catch(fe){console.error("Error cancelling invitation:",fe),V.error("Error cancelling invitation",{id:F})}},yt=async(I,F)=>{const fe=V.loading("Resending invitation...");try{const qe=await(await fetch(`/api/invitations/${I}/resend`,{method:"POST",headers:{"Content-Type":"application/json"}})).json();qe.success?(await We(),V.success(`Invitation resent to ${F}!`,{id:fe})):V.error(`Error resending invitation: ${qe.error||"Unknown error"}`,{id:fe})}catch(ze){console.error("Error resending invitation:",ze),V.error("Error resending invitation",{id:fe})}},Ct=async(I,F)=>{const fe=V.loading(`Removing ${F}...`);try{const qe=await(await fetch(`/api/members/${I}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})).json();qe.success?(await vt(),V.success(`${F} removed from organization!`,{id:fe})):V.error(`Error removing member: ${qe.error||"Unknown error"}`,{id:fe})}catch(ze){console.error("Error removing member:",ze),V.error("Error removing member",{id:fe})}},J=async()=>{if(!te.name){V.error("Please enter a team name");return}const I=V.loading("Creating team...");try{const fe=await(await fetch(`/api/organizations/${e}/teams`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:te.name,organizationId:e})})).json();fe.success?(await Be(),U(!1),re({name:""}),V.success("Team created successfully!",{id:I})):V.error(`Error creating team: ${fe.error||"Unknown error"}`,{id:I})}catch(F){console.error("Error creating team:",F),V.error("Error creating team",{id:I})}},ne=async()=>{if(!M||!te.name){V.error("Please enter a team name");return}const I=V.loading("Updating team...");try{const fe=await(await fetch(`/api/teams/${M.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:te.name})})).json();fe.success?(await Be(),P(!1),_(null),re({name:""}),V.success("Team updated successfully!",{id:I})):V.error(`Error updating team: ${fe.error||"Unknown error"}`,{id:I})}catch(F){console.error("Error updating team:",F),V.error("Error updating team",{id:I})}},xe=async()=>{if(!M){V.error("No team selected");return}const I=V.loading("Deleting team...");try{const fe=await(await fetch(`/api/teams/${M.id}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})).json();fe.success?(await Be(),Y(!1),_(null),V.success("Team deleted successfully!",{id:I})):V.error(`Error deleting team: ${fe.error||"Unknown error"}`,{id:I})}catch(F){console.error("Error deleting team:",F),V.error("Error deleting team",{id:I})}},ce=I=>{_(I),re({name:I.name}),P(!0)},pe=I=>{_(I),Y(!0)};return h?a.jsx("div",{className:"flex items-center justify-center h-32",children:a.jsxs("div",{className:"flex flex-col items-center space-y-3",children:[a.jsx(ar,{className:"w-6 h-6 text-white animate-spin"}),a.jsx("div",{className:"text-white text-sm",children:"Loading organization details..."})]})}):n?a.jsxs("div",{className:"space-y-6 p-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("div",{className:"flex items-center space-x-4",children:a.jsx("span",{className:"mb-4 ml-0 flex justify-start items-start text-left border-none text-white",children:a.jsxs("span",{className:"font-light",children:[a.jsxs("span",{onClick:()=>t("/organizations"),className:"uppercase cursor-pointer text-white/80 font-mono text-sm",children:["orgs /"," "]}),a.jsx("span",{className:"text-white font-mono text-sm",children:e})]})})}),a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs(W,{onClick:()=>N(!0),className:"border border-dashed border-white/20 text-white bg-transparent hover:bg-white/10 rounded-none",children:[a.jsx(dt,{className:"w-4 h-4 mr-2"}),"Seed Members"]}),a.jsxs(W,{onClick:Ee,className:"border border-dashed border-white/20 text-white bg-transparent hover:bg-white/10 rounded-none",children:[a.jsx(ia,{className:"w-4 h-4 mr-2"}),"Invite User"]}),a.jsxs(W,{onClick:O,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:[a.jsx(oi,{className:"w-4 h-4 mr-2"}),"Edit Organization"]})]})]}),a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-12 h-12 bg-white/10 border border-dashed border-white/20 rounded-none flex items-center justify-center",children:a.jsx(Un,{className:"w-6 h-6 text-white"})}),a.jsx("div",{children:a.jsxs("h1",{className:"text-2xl text-white font-light inline-flex items-center",children:[n.name,a.jsxs("sup",{className:"text-xs text-gray-500 ml-2",children:[a.jsx("span",{className:"mr-1",children:"["}),a.jsx("span",{className:"text-white/80 font-mono text-xs",children:n.slug}),a.jsx("span",{className:"ml-1",children:"]"})]})]})})]}),a.jsx("div",{className:"border-b border-white/10",children:a.jsxs("nav",{className:"flex space-x-8",children:[a.jsxs("button",{onClick:()=>x("details"),className:`flex items-center space-x-2 px-3 py-4 text-sm font-medium border-b-2 transition-all duration-200 ${f==="details"?"border-white text-white":"border-transparent text-gray-400 hover:text-white hover:border-gray-300"}`,children:[a.jsx(Un,{className:"w-4 h-4"}),a.jsxs("span",{className:"inline-flex items-start",children:["Details",a.jsx("sup",{className:"text-xs text-gray-500 ml-1 inline-flex items-baseline",children:a.jsx(vs,{value:0,className:"text-white/80 font-mono text-xs",prefix:a.jsx("span",{className:"mr-0.5 text-gray-500",children:"["}),suffix:a.jsx("span",{className:"ml-0.5 text-gray-500",children:"]"}),format:{notation:"standard",maximumFractionDigits:0}})})]})]}),a.jsxs("button",{onClick:()=>x("members"),className:`flex items-center space-x-2 px-3 py-4 text-sm font-medium border-b-2 transition-all duration-200 ${f==="members"?"border-white text-white":"border-transparent text-gray-400 hover:text-white hover:border-gray-300"}`,children:[a.jsx(dt,{className:"w-4 h-4"}),a.jsxs("span",{className:"inline-flex items-start",children:["Members",a.jsx("sup",{className:"text-xs text-gray-500 ml-1 inline-flex items-baseline",children:a.jsx(vs,{value:c.length,className:"text-white/80 font-mono text-xs",prefix:a.jsx("span",{className:"mr-0.5 text-gray-500",children:"["}),suffix:a.jsx("span",{className:"ml-0.5 text-gray-500",children:"]"}),format:{notation:"standard",maximumFractionDigits:0}})})]})]}),a.jsxs("button",{onClick:()=>x("invitations"),className:`flex items-center space-x-2 px-3 py-4 text-sm font-medium border-b-2 transition-all duration-200 ${f==="invitations"?"border-white text-white":"border-transparent text-gray-400 hover:text-white hover:border-gray-300"}`,children:[a.jsx(ia,{className:"w-4 h-4"}),a.jsxs("span",{className:"inline-flex items-start",children:["Invitations",a.jsx("sup",{className:"text-xs text-gray-500 ml-1 inline-flex items-baseline",children:a.jsx(vs,{value:o.length,className:"text-white/80 font-mono text-xs",prefix:a.jsx("span",{className:"mr-0.5 text-gray-500",children:"["}),suffix:a.jsx("span",{className:"ml-0.5 text-gray-500",children:"]"}),format:{notation:"standard",maximumFractionDigits:0}})})]})]}),a.jsxs("button",{onClick:()=>x("teams"),className:`flex items-center space-x-2 px-3 py-4 text-sm font-medium border-b-2 transition-all duration-200 ${f==="teams"?"border-white text-white":"border-transparent text-gray-400 hover:text-white hover:border-gray-300"}`,children:[a.jsx(dt,{className:"w-4 h-4"}),a.jsxs("span",{className:"inline-flex items-start",children:["Teams",a.jsx("sup",{className:"text-xs text-gray-500 ml-1 inline-flex items-baseline",children:a.jsx(vs,{value:r.length,className:"text-white/80 font-mono text-xs",prefix:a.jsx("span",{className:"mr-0.5 text-gray-500",children:"["}),suffix:a.jsx("span",{className:"ml-0.5 text-gray-500",children:"]"}),format:{notation:"standard",maximumFractionDigits:0}})})]})]})]})}),f==="details"&&a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-6",children:[a.jsx("h3",{className:"text-lg text-white font-light mb-4",children:"Organization Information"}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs("div",{children:[a.jsx("label",{className:"text-sm text-gray-400 font-mono uppercase",children:"Name"}),a.jsx("p",{className:"text-white font-sans mt-1",children:n.name})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm text-gray-400 font-mono uppercase",children:"Slug"}),a.jsx("p",{className:"text-white font-mono mt-1",children:n.slug})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm text-gray-400 font-mono uppercase",children:"Created"}),a.jsx("p",{className:"text-white font-sans mt-1",children:new Date(n.createdAt).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})})]})]})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-6",children:[a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-6",children:a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(dt,{className:"w-8 h-8 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-2xl text-white font-sans font-light",children:c.length}),a.jsx("p",{className:"text-sm text-gray-400 font-mono uppercase",children:"Members"})]})]})}),a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-6",children:a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(dt,{className:"w-8 h-8 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-2xl text-white font-sans font-light",children:r.length}),a.jsx("p",{className:"text-sm text-gray-400 font-mono uppercase",children:"Teams"})]})]})}),a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-6",children:a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(ia,{className:"w-8 h-8 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-2xl text-white font-sans font-light",children:o.length}),a.jsx("p",{className:"text-sm text-gray-400 font-mono uppercase",children:"Invitations"})]})]})}),a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-6",children:a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(ls,{className:"w-8 h-8 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-2xl text-white font-sans font-light",children:Math.ceil((new Date().getTime()-new Date(n.createdAt).getTime())/(1e3*60*60*24))}),a.jsx("p",{className:"text-sm text-gray-400 font-mono uppercase",children:"Days Active"})]})]})})]})]}),f==="teams"&&a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsxs("h3",{className:"text-lg relative text-white font-light inline-flex items-start",children:["Teams",a.jsxs("sup",{className:"text-xs text-gray-500 ml-1 mt-0",children:[a.jsx("span",{className:"mr-1",children:"["}),a.jsx("span",{className:"text-white font-mono text-xs",children:r.length}),a.jsx("span",{className:"ml-1",children:"]"})]})]}),a.jsx("p",{className:"text-gray-400 mt-1 uppercase font-mono text-xs font-light",children:"Manage teams within this organization"})]}),a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs(W,{onClick:()=>C(!0),className:"border border-dashed border-white/20 text-white hover:bg-white/10 bg-transparent rounded-none",children:[a.jsx(ga,{className:"w-4 h-4 mr-2"}),"Seed Teams"]}),a.jsxs(W,{onClick:()=>U(!0),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:[a.jsx(Kl,{className:"w-4 h-4 mr-2"}),"Create Team"]})]})]}),b?r.length>0?a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none",children:a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-dashed border-white/10",children:[a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Team"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Members"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Created"}),a.jsx("th",{className:"text-right py-4 px-4 text-white font-light",children:"Actions"})]})}),a.jsx("tbody",{children:r.map(I=>a.jsxs("tr",{className:"border-b border-dashed border-white/5 hover:bg-white/5 cursor-pointer",onClick:()=>t(`/organizations/${e}/teams/${I.id}`),children:[a.jsx("td",{className:"py-4 px-4",children:a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-10 h-10 bg-white/10 border border-dashed border-white/20 rounded-none flex items-center justify-center",children:a.jsx(dt,{className:"w-5 h-5 text-white"})}),a.jsxs("div",{children:[a.jsx("div",{className:"text-white font-light",children:I.name}),a.jsx(Ln,{id:I.id,label:"Team ID"})]})]})}),a.jsx("td",{className:"py-4 px-4 text-white",children:I.memberCount||0}),a.jsx("td",{className:"py-4 px-4 text-sm text-gray-400",children:new Date(I.createdAt).toLocaleDateString()}),a.jsx("td",{className:"py-4 px-4 text-right",children:a.jsxs("div",{className:"flex items-center justify-end space-x-2",children:[a.jsxs(W,{variant:"outline",size:"sm",className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",onClick:F=>{F.stopPropagation(),ce(I)},children:[a.jsx(oi,{className:"w-4 h-4 mr-1"}),"Edit"]}),a.jsxs(W,{variant:"outline",size:"sm",className:"border border-dashed border-red-400/50 text-red-400 hover:bg-red-400/10 rounded-none",onClick:F=>{F.stopPropagation(),pe(I)},children:[a.jsx(ju,{className:"w-4 h-4 mr-1"}),"Delete"]})]})})]},I.id))})]})})}):a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-12",children:a.jsxs("div",{className:"text-center",children:[a.jsx(dt,{className:"w-16 h-16 text-gray-400 mx-auto mb-4"}),a.jsx("h3",{className:"text-xl text-white font-light mb-2",children:"No Teams Yet"}),a.jsx("p",{className:"text-gray-400 mb-6",children:"Create your first team to start organizing members within this organization."}),a.jsxs(W,{onClick:()=>U(!0),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:[a.jsx(Kl,{className:"w-4 h-4 mr-2"}),"Create First Team"]})]})}):a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-8",children:a.jsxs("div",{className:"flex items-start space-x-4",children:[a.jsx("div",{className:"flex-shrink-0",children:a.jsx(dt,{className:"w-12 h-12 text-white"})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h3",{className:"text-xl text-white font-light mb-2",children:"Teams Feature Required"}),a.jsx("p",{className:"text-gray-300 mb-6",children:"To use Teams in Better Auth Studio, you need to enable the teams feature in your organization plugin configuration."}),a.jsxs("div",{className:"bg-black/50 border border-dashed border-white/20 rounded-none p-4 mb-6",children:[a.jsx("h4",{className:"text-white font-light mb-3",children:"Follow these steps:"}),a.jsx("ol",{className:"text-gray-300 space-y-2 text-sm list-decimal list-inside",children:a.jsx("li",{children:"Update your auth configuration file to enable teams:"})}),a.jsx("div",{className:"mt-4 bg-black/70 border border-dashed border-white/10 rounded-none p-3 overflow-x-auto",children:a.jsxs("pre",{className:"text-sm text-gray-300",children:[a.jsx("span",{className:"text-blue-400",children:"import"})," ","{ betterAuth }"," ",a.jsx("span",{className:"text-blue-400",children:"from"})," ",a.jsx("span",{className:"text-green-400",children:'"better-auth"'})," ",a.jsx("br",{}),a.jsx("span",{className:"text-blue-400",children:"import"})," ","{ organization }"," ",a.jsx("span",{className:"text-blue-400",children:"from"})," ",a.jsx("span",{className:"text-green-400",children:'"better-auth/plugins/organization"'})," ",a.jsx("br",{}),a.jsx("span",{className:"text-blue-400",children:"export const"})," ",a.jsx("span",{className:"text-yellow-300",children:"auth"})," ="," ",a.jsx("span",{className:"text-yellow-300",children:"betterAuth"}),"(","{"," ",a.jsx("br",{}),a.jsx("span",{className:"text-gray-500 pl-10",children:"// ... your existing configuration"})," ",a.jsx("br",{}),a.jsx("span",{className:"text-red-300 pl-10",children:"plugins"}),": [ ",a.jsx("br",{}),a.jsx("span",{className:"text-yellow-300 pl-12",children:"organization"}),"(","{"," ",a.jsx("br",{}),a.jsx("span",{className:"text-red-300 pl-16",children:"teams"}),": ","{"," ",a.jsx("br",{}),a.jsx("span",{className:"text-yellow-300 pl-20",children:"enabled"}),":"," ",a.jsx("span",{className:"text-blue-400",children:"true"})," ",a.jsx("br",{}),a.jsx("span",{className:"pl-16",children:"}"})," ",a.jsx("br",{}),a.jsx("span",{className:"pl-12",children:"})"})," ",a.jsx("br",{}),a.jsx("span",{className:"pl-10",children:"]"})," ",a.jsx("br",{}),"}",") ",a.jsx("br",{})]})}),a.jsx("div",{className:"mt-4",children:a.jsx("p",{className:"text-gray-400 text-sm",children:"2. Run migrations to create the teams table"})}),a.jsx("div",{className:"mt-2",children:a.jsx("p",{className:"text-gray-400 text-sm",children:"3. Restart your application to apply the changes"})})]}),a.jsx(W,{onClick:()=>window.location.reload(),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Check Again"}),a.jsxs("div",{className:"mt-4 text-xs text-gray-500",children:["Need help? Check the"," ",a.jsx("a",{href:"https://better-auth.com/docs/plugins/organization",target:"_blank",rel:"noopener noreferrer",className:"text-white hover:underline",children:"Better Auth Organization Plugin Documentation"})]})]})]})})]}),f==="members"&&a.jsxs("div",{className:"space-y-6",children:[a.jsx("div",{className:"flex items-center justify-between",children:a.jsxs("div",{children:[a.jsxs("h3",{className:"text-lg relative text-white font-light inline-flex items-start",children:["Members",a.jsxs("sup",{className:"text-xs text-gray-500 ml-1 mt-0",children:[a.jsx("span",{className:"mr-1",children:"["}),a.jsx("span",{className:"text-white font-mono text-xs",children:c.length}),a.jsx("span",{className:"ml-1",children:"]"})]})]}),a.jsx("p",{className:"text-gray-400 font-light font-mono text-xs uppercase mt-1",children:"Manage organization members and their roles"})]})}),c.length>0?a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none",children:a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-dashed border-white/10",children:[a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"User"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Email"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Role"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Joined"}),a.jsx("th",{className:"text-right py-4 px-4 text-white font-light",children:"Actions"})]})}),a.jsx("tbody",{children:c.map(I=>a.jsxs("tr",{className:"border-b border-dashed border-white/5 hover:bg-white/5",children:[a.jsx("td",{className:"py-4 px-4",children:a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("img",{src:I.user.image||`https://api.dicebear.com/7.x/avataaars/svg?seed=${I.user.id}`,alt:I.user.name,className:"w-10 h-10 rounded-none border border-dashed border-white/20"}),a.jsxs("div",{children:[a.jsx("div",{className:"text-white font-light",children:I.user.name}),a.jsx(Ln,{id:I.user.id})]})]})}),a.jsx("td",{className:"py-4 px-4 text-white",children:I.user.email}),a.jsx("td",{className:"py-4 px-4",children:a.jsx(gt,{variant:"secondary",className:"text-xs bg-blue-900/10 border border-dashed rounded-none border-blue-500/30 text-blue-400/70 capitalize",children:I.role})}),a.jsx("td",{className:"py-4 px-4 text-sm text-gray-400",children:new Date(I.joinedAt).toLocaleDateString()}),a.jsx("td",{className:"py-4 px-4 text-right",children:a.jsx("div",{className:"flex items-center justify-end space-x-2",children:a.jsxs(W,{variant:"outline",size:"sm",className:"border border-dashed border-red-400/50 text-red-400 hover:bg-red-400/10 rounded-none",onClick:()=>Ct(I.id,I.user.name),children:[a.jsx(ju,{className:"w-4 h-4 mr-1"}),"Remove"]})})})]},I.id))})]})})}):a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-12",children:a.jsxs("div",{className:"text-center",children:[a.jsx(dt,{className:"w-16 h-16 text-gray-400 mx-auto mb-4"}),a.jsx("h3",{className:"text-xl text-white font-light mb-2",children:"No Members Yet"}),a.jsx("p",{className:"text-gray-400 mb-6",children:"Invite users or seed members from existing users to get started."}),a.jsxs("div",{className:"flex items-center justify-center space-x-3",children:[a.jsxs(W,{onClick:()=>N(!0),className:"border border-dashed border-white/20 text-white hover:bg-white/10 bg-transparent rounded-none",children:[a.jsx(dt,{className:"w-4 h-4 mr-2"}),"Seed Members"]}),a.jsxs(W,{onClick:Ee,className:"bg-white text-white hover:bg-white/90 bg-transparent border border-white/20 rounded-none",children:[a.jsx(ia,{className:"w-4 h-4 mr-2"}),"Invite User"]})]})]})})]}),f==="invitations"&&a.jsxs("div",{className:"space-y-6",children:[a.jsx("div",{className:"flex items-center justify-between",children:a.jsxs("div",{children:[a.jsxs("h3",{className:"text-lg relative text-white font-light inline-flex items-start",children:["Invitations",a.jsxs("sup",{className:"text-xs text-gray-500 ml-1 mt-0",children:[a.jsx("span",{className:"mr-1",children:"["}),a.jsx("span",{className:"text-white font-mono text-xs",children:o.length}),a.jsx("span",{className:"ml-1",children:"]"})]})]}),a.jsx("p",{className:"text-gray-400 font-light font-mono text-xs uppercase mt-1",children:"Manage pending invitations to this organization"})]})}),o.length>0?a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none",children:a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-dashed border-white/10",children:[a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Email"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Role"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Status"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Expires"}),a.jsx("th",{className:"text-right py-4 px-4 text-white font-light",children:"Actions"})]})}),a.jsx("tbody",{children:o.map(I=>a.jsxs("tr",{className:"border-b border-dashed border-white/5 hover:bg-white/5",children:[a.jsx("td",{className:"py-4 px-4",children:a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-10 h-10 bg-white/10 border border-dashed border-white/20 rounded-none flex items-center justify-center",children:a.jsx(ia,{className:"w-5 h-5 text-white"})}),a.jsxs("div",{children:[a.jsx("div",{className:"text-white font-light",children:I.email}),a.jsxs("div",{className:"text-sm text-gray-400",children:["Expires on"," ",new Date(I.expiresAt).toLocaleDateString("en-US",{month:"short",year:"numeric",day:"numeric"})]})]})]})}),a.jsx("td",{className:"py-4 px-4 text-white capitalize",children:I.role}),a.jsx("td",{className:"py-4 px-4",children:a.jsxs(gt,{variant:"secondary",className:`text-xs font-normal rounded-none border-dashed flex items-center gap-1 w-fit ${I.status==="pending"?"bg-yellow-900/10 border border-yellow-500/30 text-yellow-400/70":I.status==="accepted"?"bg-green-900/10 border border-green-500/30 text-green-400/70":"bg-red-900/10 border border-red-500/30 text-red-400/70"}`,children:[I.status==="pending"&&a.jsx(WC,{className:"w-3 h-3"}),I.status==="accepted"&&a.jsx(k0,{className:"w-3 h-3"}),I.status==="expired"&&a.jsx(Vt,{className:"w-3 h-3"}),I.status]})}),a.jsxs("td",{className:"py-4 px-4 text-sm text-gray-400",children:[new Date(I.expiresAt).toLocaleDateString(),a.jsx("br",{}),a.jsx("span",{className:"text-xs text-gray-400",children:new Date(I.expiresAt).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]}),a.jsx("td",{className:"py-4 px-4 text-right",children:a.jsxs("div",{className:"flex items-center justify-end space-x-2",children:[a.jsxs(W,{variant:"outline",size:"sm",className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",onClick:()=>yt(I.id,I.email),children:[a.jsx(vw,{className:"w-4 h-4 mr-1"}),"Resend"]}),a.jsxs(W,{variant:"outline",size:"sm",className:"border border-dashed border-red-400/50 text-red-400 hover:bg-red-400/10 rounded-none",onClick:()=>Ue(I.id),children:[a.jsx(ju,{className:"w-4 h-4 mr-1"}),"Cancel"]})]})})]},I.id))})]})})}):a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-12",children:a.jsxs("div",{className:"text-center",children:[a.jsx(ia,{className:"w-16 h-16 text-gray-400 mx-auto mb-4"}),a.jsx("h3",{className:"text-xl text-white font-light mb-2",children:"No Invitations"}),a.jsx("p",{className:"text-gray-400 mb-6",children:"Start inviting users to join this organization."}),a.jsxs(W,{onClick:Ee,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:[a.jsx(ia,{className:"w-4 h-4 mr-2"}),"Send First Invitation"]})]})})]}),y&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Invite User"}),a.jsx(W,{variant:"ghost",size:"sm",onClick:()=>{p(!1),q(""),L("")},className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Vt,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx(Pe,{htmlFor:"invite-email",className:"text-sm text-gray-400 font-light",children:"Email Address"}),a.jsx(Le,{id:"invite-email",type:"email",value:A,onChange:I=>q(I.target.value),placeholder:"user@example.com",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsxs("div",{children:[a.jsx(Pe,{htmlFor:"inviter-select",className:"text-sm text-gray-400 font-light",children:"Inviter"}),a.jsxs(us,{value:R,onValueChange:L,children:[a.jsx(hs,{children:a.jsx(Jr,{placeholder:"Select an inviter..."})}),a.jsx(fs,{children:X.map(I=>a.jsx(ct,{value:I.id,children:a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx("img",{src:I.image||`https://api.dicebear.com/7.x/avataaars/svg?seed=${I.id}`,alt:I.name,className:"w-6 h-6 rounded-none border border-dashed border-white/20"}),a.jsxs("span",{children:[I.name," (",I.email,")"]})]})},I.id))})]})]})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(W,{variant:"outline",onClick:()=>{p(!1),q(""),L("")},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsxs(W,{onClick:Re,disabled:ee,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none disabled:opacity-50",children:[ee?a.jsx(ar,{className:"w-3 h-3 mr-2 animate-spin"}):a.jsx(vw,{className:"w-4 h-4 mr-2"}),ee?"Sending...":"Send Invitation"]})]})]})}),T&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Create Team"}),a.jsx(W,{variant:"ghost",size:"sm",onClick:()=>{U(!1),re({name:""})},className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Vt,{className:"w-4 h-4"})})]}),a.jsx("div",{className:"space-y-4",children:a.jsxs("div",{children:[a.jsx(Pe,{htmlFor:"team-name",className:"text-sm text-gray-400 font-light",children:"Team Name"}),a.jsx(Le,{id:"team-name",value:te.name,onChange:I=>tt(I.target.value),placeholder:"e.g. Development Team",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]})}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(W,{variant:"outline",onClick:()=>{U(!1),re({name:""})},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(W,{onClick:J,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Create Team"})]})]})}),B&&M&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Edit Team"}),a.jsx(W,{variant:"ghost",size:"sm",onClick:()=>{P(!1),re({name:""})},className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Vt,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-16 h-16 bg-white/10 border border-dashed border-white/20 rounded-none flex items-center justify-center",children:a.jsx(dt,{className:"w-8 h-8 text-white"})}),a.jsxs("div",{children:[a.jsx("div",{className:"text-white font-light",children:M.name}),a.jsx(Ln,{id:M.id,label:"Team ID",variant:"detail"})]})]}),a.jsxs("div",{children:[a.jsx(Pe,{htmlFor:"edit-team-name",className:"text-sm text-gray-400 font-light",children:"Team Name"}),a.jsx(Le,{id:"edit-team-name",value:te.name,onChange:I=>tt(I.target.value),placeholder:"e.g. Development Team",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(W,{variant:"outline",onClick:()=>{P(!1),re({name:""})},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(W,{onClick:ne,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Update Team"})]})]})}),z&&M&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Delete Team"}),a.jsx(W,{variant:"ghost",size:"sm",onClick:()=>Y(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Vt,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-16 h-16 bg-white/10 border border-dashed border-white/20 rounded-none flex items-center justify-center",children:a.jsx(dt,{className:"w-8 h-8 text-white"})}),a.jsxs("div",{children:[a.jsx("div",{className:"text-white font-light",children:M.name}),a.jsx(Ln,{id:M.id,label:"Team ID",variant:"detail"})]})]}),a.jsx("p",{className:"text-gray-400",children:"Are you sure you want to delete this team? This action cannot be undone."})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(W,{variant:"outline",onClick:()=>Y(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(W,{onClick:xe,className:"bg-red-600 hover:bg-red-700 text-white border border-red-600 rounded-none",children:"Delete Team"})]})]})}),w&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-2xl rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Seed Members"}),a.jsx(W,{variant:"ghost",size:"sm",onClick:()=>N(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Vt,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(dt,{className:"w-5 h-5 text-white"}),a.jsx("h4",{className:"text-white font-light",children:"Add Members from Existing Users"})]}),a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs("div",{className:"flex-1",children:[a.jsx(Pe,{htmlFor:"member-count",className:"text-sm text-gray-400 font-light",children:"Number of members to add"}),a.jsx(Le,{id:"member-count",type:"number",min:"1",max:"50",defaultValue:"5",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsx(W,{onClick:()=>{var F;const I=parseInt(((F=document.getElementById("member-count"))==null?void 0:F.value)||"5");bt(I)},disabled:ue,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none mt-6 disabled:opacity-50",children:ue?a.jsxs(a.Fragment,{children:[a.jsx(ar,{className:"w-3 h-3 mr-2 animate-spin"}),"Seeding..."]}):a.jsxs(a.Fragment,{children:[a.jsx(dt,{className:"w-3 h-3 mr-2"}),"Seed Members"]})})]})]}),ge.length>0&&a.jsx("div",{className:"mt-6",children:a.jsx(mi,{title:"Member Seeding Terminal",lines:ge,isRunning:ue,className:"w-full",defaultCollapsed:!0})})]}),a.jsx("div",{className:"flex justify-end mt-6 pt-6 border-t border-dashed border-white/10",children:a.jsx(W,{variant:"outline",onClick:()=>N(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Close"})})]})}),S&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-2xl rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Seed Teams"}),a.jsx(W,{variant:"ghost",size:"sm",onClick:()=>C(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Vt,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(Un,{className:"w-5 h-5 text-white"}),a.jsx("h4",{className:"text-white font-light",children:"Create Teams"})]}),a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs("div",{className:"flex-1",children:[a.jsx(Pe,{htmlFor:"team-count",className:"text-sm text-gray-400 font-light",children:"Number of teams to create"}),a.jsx(Le,{id:"team-count",type:"number",min:"1",max:"20",defaultValue:"3",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsx(W,{onClick:()=>{var F;const I=parseInt(((F=document.getElementById("team-count"))==null?void 0:F.value)||"3");ft(I)},disabled:Ce,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none mt-6 disabled:opacity-50",children:Ce?a.jsxs(a.Fragment,{children:[a.jsx(ar,{className:"w-3 h-3 mr-2 animate-spin"}),"Seeding..."]}):a.jsxs(a.Fragment,{children:[a.jsx(Un,{className:"w-3 h-3 mr-2"}),"Seed Teams"]})})]})]}),we.length>0&&a.jsx("div",{className:"mt-6",children:a.jsx(mi,{title:"Team Seeding Terminal",lines:we,isRunning:Ce,className:"w-full",defaultCollapsed:!0})})]}),a.jsx("div",{className:"flex justify-end mt-6 pt-6 border-t border-dashed border-white/10",children:a.jsx(W,{variant:"outline",onClick:()=>C(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Close"})})]})}),k&&n&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",onClick:I=>{I.target===I.currentTarget&&($(!1),D({name:"",slug:""}))},children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",onClick:I=>I.stopPropagation(),children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Edit Organization"}),a.jsx(W,{variant:"ghost",size:"sm",onClick:()=>{$(!1),D({name:"",slug:""})},className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Vt,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-16 h-16 rounded-none border border-dashed border-white/20 bg-white/10 flex items-center justify-center",children:a.jsx(Un,{className:"w-8 h-8 text-white"})}),a.jsxs("div",{children:[a.jsx("div",{className:"text-white font-light",children:n.name}),a.jsx("div",{className:"text-sm text-gray-400",children:n.slug})]})]}),a.jsxs("div",{children:[a.jsx(Pe,{htmlFor:"edit-name",className:"text-sm text-gray-400 font-light",children:"Name"}),a.jsx(Le,{id:"edit-name",value:E.name,onChange:I=>Z(I.target.value),placeholder:"e.g. Acme Corp",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsxs("div",{children:[a.jsx(Pe,{htmlFor:"edit-slug",className:"text-sm text-gray-400 font-light",children:"Slug"}),a.jsx(Le,{id:"edit-slug",value:E.slug,onChange:I=>ie(I.target.value),placeholder:"e.g. acme-corp",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"}),a.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Auto-generated from name. You can edit it manually."})]})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(W,{variant:"outline",onClick:()=>{$(!1),D({name:"",slug:""})},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(W,{onClick:le,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Update"})]})]})})]}):a.jsxs("div",{className:"space-y-6 p-6",children:[a.jsx("div",{className:"flex items-center space-x-4",children:a.jsx($p,{to:"/organizations",children:a.jsxs(W,{variant:"ghost",className:"text-gray-400 hover:text-white rounded-none",children:[a.jsx(CB,{className:"w-4 h-4 mr-2"}),"Back to Organizations"]})})}),a.jsx("br",{}),a.jsxs("div",{className:"text-center py-12",children:[a.jsx(Un,{className:"w-16 h-16 text-gray-400 mx-auto mb-4"}),a.jsx("h2",{className:"text-xl text-white font-light mb-2",children:"Organization Not Found"}),a.jsx("p",{className:"text-gray-400",children:"The organization you're looking for doesn't exist."})]})]})}function nV(){const[e,t]=m.useState([]),[n,s]=m.useState(!0),[r,i]=m.useState(""),[o,l]=m.useState("all"),[c,u]=m.useState(!1),[h,d]=m.useState(!1),[f,x]=m.useState(!1),[b,v]=m.useState(!1),[j,g]=m.useState(!1),[y,p]=m.useState(null),[w,N]=m.useState([]),[S,C]=m.useState(!1),T=m.useCallback(async()=>{try{const D=await(await fetch("/api/sessions")).json();t(D.sessions||[])}catch{}finally{s(!1)}},[]);m.useEffect(()=>{T()},[T]);const U=async E=>{N([]),C(!0),N([{id:"start",type:"info",message:`Starting session seeding process for ${E} sessions...`,timestamp:new Date}]);try{const A=await(await fetch("/api/seed/sessions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:E})})).json();if(A.success){const q=A.results.map((L,X)=>L.success?{id:`session-${X}`,type:"progress",message:`Creating session: ${L.session.id}`,timestamp:new Date,status:"completed"}:{id:`session-${X}`,type:"error",message:`Failed to create session ${X+1}: ${L.error}`,timestamp:new Date});N(L=>[...L,...q]);const R=A.results.filter(L=>L.success).length;N(L=>[...L,{id:"complete",type:"success",message:`✅ Seeding completed! Created ${R}/${E} sessions successfully`,timestamp:new Date}]),await T()}else N(q=>[...q,{id:"error",type:"error",message:`❌ Seeding failed: ${A.error||"Unknown error"}`,timestamp:new Date}])}catch(D){N(A=>[...A,{id:"error",type:"error",message:`❌ Network error: ${D}`,timestamp:new Date}])}finally{C(!1)}},B=async E=>{N([]),C(!0),N([{id:"start",type:"info",message:`Starting account seeding process for ${E} accounts...`,timestamp:new Date}]);try{const A=await(await fetch("/api/seed/accounts",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:E})})).json();if(A.success){const q=A.results.map((L,X)=>L.success?{id:`account-${X}`,type:"progress",message:`Creating account: ${L.account.provider}`,timestamp:new Date,status:"completed"}:{id:`account-${X}`,type:"error",message:`Failed to create account ${X+1}: ${L.error}`,timestamp:new Date});N(L=>[...L,...q]);const R=A.results.filter(L=>L.success).length;N(L=>[...L,{id:"complete",type:"success",message:`✅ Seeding completed! Created ${R}/${E} accounts successfully`,timestamp:new Date}]),await T()}else N(q=>[...q,{id:"error",type:"error",message:`❌ Seeding failed: ${A.error||"Unknown error"}`,timestamp:new Date}])}catch(D){N(A=>[...A,{id:"error",type:"error",message:`❌ Network error: ${D}`,timestamp:new Date}])}finally{C(!1)}},P=E=>{p(E),v(!0)},z=E=>{p(E),d(!0)},Y=E=>{p(E),x(!0)},k=async E=>{u(!1)},$=async E=>{d(!1)},M=async()=>{x(!1)},_=e.filter(E=>{const D=E.id.toLowerCase().includes(r.toLowerCase())||E.userId.toLowerCase().includes(r.toLowerCase()),A=o==="all"||o==="active"&&new Date(E.expiresAt)>new Date||o==="expired"&&new Date(E.expiresAt)<=new Date;return D&&A});return n?a.jsx("div",{className:"flex items-center justify-center h-32",children:a.jsxs("div",{className:"flex flex-col items-center space-y-3",children:[a.jsx(ys,{className:"w-6 h-6 text-white animate-spin"}),a.jsx("div",{className:"text-white text-sm",children:"Loading sessions..."})]})}):a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsxs("h1",{className:"text-2xl relative text-white font-light inline-flex items-start",children:["Sessions",a.jsxs("sup",{className:"text-xs text-gray-500 ml-1 mt-0",children:[a.jsx("span",{className:"mr-1",children:"["}),a.jsx("span",{className:"text-white font-mono text-sm",children:e.length}),a.jsx("span",{className:"ml-1",children:"]"})]})]}),a.jsx("p",{className:"text-gray-400 mt-1 uppercase font-mono text-sm font-light",children:"Manage user sessions and accounts"})]}),a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs(W,{className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",onClick:()=>g(!0),children:[a.jsx(_t,{className:"w-4 h-4 mr-2"}),"Seed"]}),a.jsxs(W,{className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",onClick:()=>u(!0),children:[a.jsx(mr,{className:"w-4 h-4 mr-2"}),"Add Session"]})]})]}),a.jsxs("div",{className:"flex items-center space-x-4",children:[a.jsxs("div",{className:"flex-1 relative",children:[a.jsx(li,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-4 h-4"}),a.jsx(Le,{placeholder:"Search sessions...",value:r,onChange:E=>i(E.target.value),className:"pl-10 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(n0,{className:"w-4 h-4 text-gray-400"}),a.jsxs(us,{value:o,onValueChange:l,children:[a.jsx(hs,{children:a.jsx(Jr,{})}),a.jsxs(fs,{children:[a.jsx(ct,{value:"all",children:"All"}),a.jsx(ct,{value:"active",children:"Active"}),a.jsx(ct,{value:"expired",children:"Expired"})]})]})]})]}),a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none",children:a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-dashed border-white/10",children:[a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Session"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"User ID"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Status"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Expires"}),a.jsx("th",{className:"text-right py-4 px-4 text-white font-light",children:"Actions"})]})}),a.jsx("tbody",{children:_.map(E=>a.jsxs("tr",{className:"border-b border-dashed border-white/5 hover:bg-white/5",children:[a.jsx("td",{className:"py-4 px-4",children:a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-10 h-10 rounded-none border border-dashed border-white/20 bg-white/10 flex items-center justify-center",children:a.jsx(_t,{className:"w-5 h-5 text-white"})}),a.jsxs("div",{children:[a.jsxs("div",{className:"text-white font-light",children:["Session ",E.id.slice(0,8),"..."]}),a.jsx(Ln,{id:E.id})]})]})}),a.jsx("td",{className:"py-4 px-4 text-white",children:E.userId}),a.jsx("td",{className:"py-4 px-4",children:a.jsxs("div",{className:"flex items-center space-x-2",children:[new Date(E.expiresAt)>new Date?a.jsx("div",{className:"w-2 h-2 bg-green-400 rounded-full"}):a.jsx("div",{className:"w-2 h-2 bg-red-400 rounded-full"}),a.jsx("span",{className:"text-sm text-gray-400",children:new Date(E.expiresAt)>new Date?"Active":"Expired"})]})}),a.jsx("td",{className:"py-4 px-4 text-sm text-gray-400",children:new Date(E.expiresAt).toLocaleDateString()}),a.jsx("td",{className:"py-4 px-4 text-right",children:a.jsxs("div",{className:"flex items-center justify-end space-x-2",children:[a.jsx(W,{variant:"ghost",size:"sm",className:"text-gray-400 hover:text-white rounded-none",onClick:()=>P(E),children:a.jsx(Go,{className:"w-4 h-4"})}),a.jsx(W,{variant:"ghost",size:"sm",className:"text-gray-400 hover:text-white rounded-none",onClick:()=>z(E),children:a.jsx(oi,{className:"w-4 h-4"})}),a.jsx(W,{variant:"ghost",size:"sm",className:"text-red-400 hover:text-red-300 rounded-none",onClick:()=>Y(E),children:a.jsx(cf,{className:"w-4 h-4"})})]})})]},E.id))})]})})}),j&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-2xl rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Seed Data"}),a.jsx(W,{variant:"ghost",size:"sm",onClick:()=>g(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Xt,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(_t,{className:"w-5 h-5 text-white"}),a.jsx("h4",{className:"text-white font-light",children:"Seed Sessions"})]}),a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs("div",{className:"flex-1",children:[a.jsx(Pe,{htmlFor:"session-count",className:"text-sm text-gray-400 font-light",children:"Number of sessions"}),a.jsx(Le,{id:"session-count",type:"number",min:"1",max:"100",defaultValue:"5",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsx(W,{onClick:()=>{var D;const E=parseInt(((D=document.getElementById("session-count"))==null?void 0:D.value)||"5",10);U(E)},disabled:S,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none mt-6 disabled:opacity-50",children:S?a.jsxs(a.Fragment,{children:[a.jsx(ys,{className:"w-3 h-3 mr-2 animate-spin"}),"Seeding..."]}):a.jsxs(a.Fragment,{children:[a.jsx(_t,{className:"w-3 h-3 mr-2"}),"Seed Sessions"]})})]})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(jy,{className:"w-5 h-5 text-white"}),a.jsx("h4",{className:"text-white font-light",children:"Seed Accounts"})]}),a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs("div",{className:"flex-1",children:[a.jsx(Pe,{htmlFor:"account-count",className:"text-sm text-gray-400 font-light",children:"Number of accounts"}),a.jsx(Le,{id:"account-count",type:"number",min:"1",max:"100",defaultValue:"5",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsx(W,{onClick:()=>{var D;const E=parseInt(((D=document.getElementById("account-count"))==null?void 0:D.value)||"5",10);B(E)},disabled:S,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none mt-6 disabled:opacity-50",children:S?a.jsxs(a.Fragment,{children:[a.jsx(ys,{className:"w-3 h-3 mr-2 animate-spin"}),"Seeding..."]}):a.jsxs(a.Fragment,{children:[a.jsx(jy,{className:"w-3 h-3 mr-2"}),"Seed Accounts"]})})]})]}),w.length>0&&a.jsx("div",{className:"mt-6",children:a.jsx(mi,{title:"Session Seeding Terminal",lines:w,isRunning:S,className:"w-full",defaultCollapsed:!0})})]}),a.jsx("div",{className:"flex justify-end mt-6 pt-6 border-t border-dashed border-white/10",children:a.jsx(W,{variant:"outline",onClick:()=>g(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Close"})})]})}),c&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Create Session"}),a.jsx(W,{variant:"ghost",size:"sm",onClick:()=>u(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Xt,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx(Pe,{htmlFor:"create-user-id",className:"text-sm text-gray-400 font-light",children:"User ID"}),a.jsx(Le,{id:"create-user-id",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsxs("div",{children:[a.jsx(Pe,{htmlFor:"create-expires",className:"text-sm text-gray-400 font-light",children:"Expires At"}),a.jsx(Le,{id:"create-expires",type:"datetime-local",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(W,{variant:"outline",onClick:()=>u(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(W,{onClick:()=>k(),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Create"})]})]})}),h&&y&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Edit Session"}),a.jsx(W,{variant:"ghost",size:"sm",onClick:()=>d(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Xt,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-16 h-16 rounded-none border border-dashed border-white/20 bg-white/10 flex items-center justify-center",children:a.jsx(_t,{className:"w-8 h-8 text-white"})}),a.jsxs("div",{children:[a.jsxs("div",{className:"text-white font-light",children:["Session ",y.id.slice(0,8),"..."]}),a.jsx("div",{className:"text-sm text-gray-400",children:y.userId})]})]}),a.jsxs("div",{children:[a.jsx(Pe,{htmlFor:"edit-user-id",className:"text-sm text-gray-400 font-light",children:"User ID"}),a.jsx(Le,{id:"edit-user-id",defaultValue:y.userId,className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsxs("div",{children:[a.jsx(Pe,{htmlFor:"edit-expires",className:"text-sm text-gray-400 font-light",children:"Expires At"}),a.jsx(Le,{id:"edit-expires",type:"datetime-local",defaultValue:new Date(y.expiresAt).toISOString().slice(0,16),className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(W,{variant:"outline",onClick:()=>d(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(W,{onClick:()=>$(),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Update"})]})]})}),f&&y&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Delete Session"}),a.jsx(W,{variant:"ghost",size:"sm",onClick:()=>x(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Xt,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-16 h-16 rounded-none border border-dashed border-white/20 bg-white/10 flex items-center justify-center",children:a.jsx(_t,{className:"w-8 h-8 text-white"})}),a.jsxs("div",{children:[a.jsxs("div",{className:"text-white font-light",children:["Session ",y.id.slice(0,8),"..."]}),a.jsx("div",{className:"text-sm text-gray-400",children:y.userId})]})]}),a.jsx("p",{className:"text-gray-400",children:"Are you sure you want to delete this session? This action cannot be undone."})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(W,{variant:"outline",onClick:()=>x(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(W,{onClick:M,className:"bg-red-600 hover:bg-red-700 text-white border border-red-600 rounded-none",children:"Delete"})]})]})}),b&&y&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Session Details"}),a.jsx(W,{variant:"ghost",size:"sm",onClick:()=>v(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Xt,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-16 h-16 rounded-none border border-dashed border-white/20 bg-white/10 flex items-center justify-center",children:a.jsx(_t,{className:"w-8 h-8 text-white"})}),a.jsxs("div",{children:[a.jsxs("div",{className:"text-white font-light",children:["Session ",y.id.slice(0,8),"..."]}),a.jsx("div",{className:"text-sm text-gray-400",children:y.userId})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ln,{id:y.id,variant:"detail"}),a.jsx(Ln,{id:y.userId,label:"User ID",variant:"detail"}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-gray-400",children:"Status:"}),a.jsx("span",{className:"text-white text-sm",children:new Date(y.expiresAt)>new Date?"Active":"Expired"})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-gray-400",children:"Expires:"}),a.jsx("span",{className:"text-white text-sm",children:new Date(y.expiresAt).toLocaleString()})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-gray-400",children:"Created:"}),a.jsx("span",{className:"text-white text-sm",children:new Date(y.createdAt).toLocaleString()})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-gray-400",children:"Updated:"}),a.jsx("span",{className:"text-white text-sm",children:new Date(y.updatedAt).toLocaleString()})]})]})]}),a.jsx("div",{className:"flex justify-end mt-6",children:a.jsx(W,{onClick:()=>v(!1),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Close"})})]})})]})}function sV(){var y,p,w,N,S,C,T,U,B,P,z,Y,k,$,M,_,E,D,A,q,R,L,X,G,te,re,ee,se,ge;const[e,t]=m.useState(null),[n,s]=m.useState(null),[r,i]=m.useState(null),[o,l]=m.useState(null),[c,u]=m.useState(!0),[h,d]=m.useState(null);j4(ae=>{ae.type==="config_changed"?setTimeout(()=>{f(),x(),b(),v()},500):ae.type});const f=m.useCallback(async()=>{var ae;try{const he=await(await fetch("/api/config")).json();(ae=he.studio)!=null&&ae.version&&d(`v${he.studio.version}`),t(he)}catch{}finally{u(!1)}},[]),x=m.useCallback(async()=>{try{const ue=await(await fetch("/api/health")).json();s(ue.system||{studioVersion:h||"v1.0.0",nodeVersion:process.version,platform:navigator.platform,uptime:"2h 15m"})}catch{s({studioVersion:h||"v1.0.0",nodeVersion:"v18.0.0",platform:"macOS",uptime:"2h 15m"})}},[h]),b=m.useCallback(async()=>{try{const ue=await(await fetch("/api/plugins")).json();i(ue)}catch{i({plugins:[],configPath:null,totalPlugins:0,error:"Failed to fetch plugins"})}},[]),v=m.useCallback(async()=>{try{const ue=await(await fetch("/api/db")).json();l(ue)}catch{l({success:!1,name:"unknown",version:"unknown",dialect:"unknown",adapter:"unknown",displayName:"Unknown",autoDetected:!1,message:"Failed to fetch database info"})}},[]),j=ae=>{switch(ae==null?void 0:ae.toLowerCase()){case"postgresql":case"postgres":return a.jsxs(gt,{variant:"secondary",className:"text-xs group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:[a.jsx(Bt,{className:"w-3 h-3"}),"Connected"]});case"mysql":return a.jsxs(gt,{variant:"secondary",className:"text-xs group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:[a.jsx(Bt,{className:"w-3 h-3"}),"Connected"]});case"sqlite":return a.jsxs(gt,{variant:"secondary",className:"text-xs group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:[a.jsx(Vd,{className:"w-3 h-3"}),"Local"]});default:return a.jsxs(gt,{variant:"secondary",className:"text-xs group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:[a.jsx(As,{className:"w-3 h-3"}),"Unknown"]})}};m.useEffect(()=>{f(),x(),b(),v()},[f,v,b,x]);const g=ae=>{switch(ae.toLowerCase()){case"google":return a.jsx(an,{className:"w-5 h-5 text-white"});case"github":return a.jsx(wn,{className:"w-5 h-5 text-white"});case"discord":return a.jsx(an,{className:"w-5 h-5 text-white"});case"twitter":return a.jsx(an,{className:"w-5 h-5 text-white"});default:return a.jsx(an,{className:"w-5 h-5 text-white"})}};return c?a.jsx("div",{className:"flex items-center justify-center h-64",children:a.jsx(ys,{className:"w-6 h-6 text-white animate-spin"})}):a.jsxs("div",{className:"space-y-8",children:[a.jsx("div",{className:"flex items-center justify-between p-5 pt-7",children:a.jsxs("div",{children:[a.jsx("h1",{className:"text-3xl font-normal text-white tracking-tight",children:"Settings"}),a.jsx("p",{className:"text-gray-300 mt-2 uppercase font-mono font-light text-xs",children:"Configure your Better Auth application"})]})}),a.jsx("hr",{className:"w-full border-white/15 h-px"}),a.jsx("hr",{className:"w-full border-white/15 h-px"}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8 p-5",children:[a.jsxs(Mn,{className:"border-white/15 bg-black/70 px-0 sm:px-0 md:px-0 lg:px-0 xl:px-0 rounded-none",children:[a.jsxs(Tn,{className:"space-y-0",children:[a.jsxs(Dn,{className:"text-white font-light uppercase text-lg flex items-center space-x-2",children:[a.jsx(ho,{className:"w-4 h-4 text-white"}),a.jsx("span",{children:"Application"})]}),a.jsxs(Os,{className:"uppercase font-mono font-light flex items-center gap-2 text-gray-400 text-xs",children:[a.jsxs("svg",{className:"w-3 h-3 inline-flex text-gray-400",fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[" ",a.jsx("path",{d:"M8 5v2h2V5H8zm4 4V7h-2v2h2zm2 2V9h-2v2h2zm0 2h2v-2h-2v2zm-2 2v-2h2v2h-2zm0 0h-2v2h2v-2zm-4 4v-2h2v2H8z",fill:"currentColor"})," "]}),"Basic application configuration"]})]}),a.jsx("hr",{className:"w-full border-white/15 h-px -mt-3 mb-1"}),a.jsxs(_n,{className:"space-y-0 px-0 pb-0 border-b-none",children:[a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(an,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"App Name"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Application display name"})]})]}),a.jsx("div",{className:"text-right",children:a.jsx("p",{className:"text-sm font-medium text-white",children:(e==null?void 0:e.appName)||"Better Auth"})})]}),a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(uo,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Base URL"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Application base URL"})]})]}),a.jsx("div",{className:"text-right",children:a.jsx("p",{className:"text-sm font-mono font-medium text-white",children:(e==null?void 0:e.baseURL)||"http://localhost:3000"})})]}),a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(gu,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Base Path"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Auth API base path"})]})]}),a.jsx("div",{className:"text-right",children:a.jsx("p",{className:"text-sm font-mono font-medium text-white",children:(e==null?void 0:e.basePath)||"/api/auth"})})]}),a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(wn,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Secret"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Encryption secret"})]})]}),a.jsx("div",{className:"text-right",children:a.jsx("p",{className:"text-sm font-medium text-white",children:(e==null?void 0:e.secret)==="Configured"?"Configured":"Not set"})})]})]})]}),a.jsxs(Mn,{className:"border-white/15 bg-black/70 px-0 sm:px-0 md:px-0 lg:px-0 xl:px-0 rounded-none",children:[a.jsxs(Tn,{className:"space-y-0",children:[a.jsxs(Dn,{className:"text-white font-light uppercase text-lg flex items-center space-x-2",children:[a.jsx(_t,{className:"w-4 h-4 text-white"}),a.jsx("span",{children:"Database"})]}),a.jsxs(Os,{className:"uppercase font-mono font-light flex items-center gap-2 text-gray-400 text-xs",children:[a.jsxs("svg",{className:"w-3 h-3 inline-flex text-gray-400",fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[" ",a.jsx("path",{d:"M8 5v2h2V5H8zm4 4V7h-2v2h2zm2 2V9h-2v2h2zm0 2h2v-2h-2v2zm-2 2v-2h2v2h-2zm0 0h-2v2h2v-2zm-4 4v-2h2v2H8z",fill:"currentColor"})," "]}),"Database connection and configuration"]})]}),a.jsx("hr",{className:"w-full border-white/15 h-px -mt-3 mb-1"}),a.jsxs(_n,{className:"space-y-0 px-0 pb-0 border-b-none",children:[a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(_t,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:(o==null?void 0:o.displayName)||((y=e==null?void 0:e.database)==null?void 0:y.type)&&((p=e==null?void 0:e.database)==null?void 0:p.type.charAt(0).toUpperCase())+((w=e==null?void 0:e.database)==null?void 0:w.type.slice(1))||"Unknown"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Database Type"})]})]}),((o==null?void 0:o.name)||((N=e==null?void 0:e.database)==null?void 0:N.type))&&j((o==null?void 0:o.name)||((S=e==null?void 0:e.database)==null?void 0:S.type)||"")]}),((o==null?void 0:o.dialect)||((C=e==null?void 0:e.database)==null?void 0:C.dialect))&&(o==null?void 0:o.dialect)!=="unknown"&&a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(_t,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Dialect"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Database dialect"})]})]}),a.jsx("div",{className:"text-right",children:a.jsx("p",{className:"text-sm font-medium text-white",children:((T=e==null?void 0:e.database)==null?void 0:T.dialect)||(o==null?void 0:o.dialect)})})]}),((U=e==null?void 0:e.database)==null?void 0:U.url)&&a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(uo,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Connection URL"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Database connection string"})]})]}),a.jsxs(gt,{variant:"secondary",className:"text-xs group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:[a.jsx(Bt,{className:"w-3 h-3"}),"Configured"]})]}),((B=e==null?void 0:e.database)==null?void 0:B.casing)&&a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(ho,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Casing"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Table name casing"})]})]}),a.jsx("div",{className:"text-right",children:a.jsx("p",{className:"text-sm font-medium text-white capitalize",children:e.database.casing})})]}),(e==null?void 0:e.database)&&a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(pg,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Debug Logs"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Database debug logging"})]})]}),a.jsx(gt,{variant:"secondary",className:"text-xs group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:e.database.debugLogs?a.jsxs(a.Fragment,{children:[a.jsx(As,{className:"w-3 h-3"}),"Enabled"]}):a.jsxs(a.Fragment,{children:[a.jsx(Bt,{className:"w-3 h-3"}),"Disabled"]})})]}),!(o!=null&&o.success)&&!(e!=null&&e.database)&&a.jsxs("div",{className:"flex items-center justify-between p-3 px-5",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(As,{className:"w-5 h-5 text-yellow-400"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"No Database Detected"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:(o==null?void 0:o.message)||"No supported database packages found"})]})]}),a.jsx(gt,{variant:"secondary",className:"text-xs bg-yellow-900/50 border border-yellow-500/30 text-yellow-400 rounded-sm",children:"Unknown"})]})]})]}),a.jsxs(Mn,{className:"border-white/15 bg-black/70 px-0 sm:px-0 md:px-0 lg:px-0 xl:px-0 rounded-none",children:[a.jsxs(Tn,{className:"space-y-0",children:[a.jsxs(Dn,{className:"text-white font-light uppercase text-lg flex items-center space-x-2",children:[a.jsx(wn,{className:"w-4 h-4 text-white"}),a.jsx("span",{children:"Providers"})]}),a.jsxs(Os,{className:"uppercase font-mono font-light flex items-center gap-2 text-gray-400 text-xs",children:[a.jsxs("svg",{className:"w-3 h-3 inline-flex text-gray-400",fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[" ",a.jsx("path",{d:"M8 5v2h2V5H8zm4 4V7h-2v2h2zm2 2V9h-2v2h2zm0 2h2v-2h-2v2zm-2 2v-2h2v2h-2zm0 0h-2v2h2v-2zm-4 4v-2h2v2H8z",fill:"currentColor"})," "]}),"Configured authentication providers"]})]}),a.jsx("hr",{className:"w-full border-white/15 h-px -mt-3 mb-1"}),a.jsx(_n,{className:"p-0",children:e!=null&&e.socialProviders&&e.socialProviders.length>0?e.socialProviders.map((ae,ue)=>a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15 last:border-b-0",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[g(ae.type),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white capitalize",children:ae.type}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:ae.clientId?"Configured":"Not configured"})]})]}),a.jsx(gt,{variant:"secondary",className:"text-xs group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:ae.clientId?a.jsxs(a.Fragment,{children:[a.jsx(Bt,{className:"w-3 h-3"}),"Active"]}):a.jsxs(a.Fragment,{children:[a.jsx(As,{className:"w-3 h-3"}),"Setup Required"]})})]},ue)):a.jsxs("div",{className:"text-center py-8",children:[a.jsx(wn,{className:"w-8 h-8 text-white mx-auto mb-2"}),a.jsx("p",{className:"text-sm text-gray-400",children:"No providers configured"})]})})]}),a.jsxs(Mn,{className:"border-white/15 bg-black/70 px-0 sm:px-0 md:px-0 lg:px-0 xl:px-0 rounded-none",children:[a.jsxs(Tn,{className:"space-y-0",children:[a.jsxs(Dn,{className:"text-white font-light uppercase text-lg flex items-center space-x-2",children:[a.jsx(hh,{className:"w-4 h-4 text-white"}),a.jsx("span",{children:"Email & Password"})]}),a.jsxs(Os,{className:"uppercase font-mono font-light flex items-center gap-2 text-gray-400 text-xs",children:[a.jsxs("svg",{className:"w-3 h-3 inline-flex text-gray-400",fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[" ",a.jsx("path",{d:"M8 5v2h2V5H8zm4 4V7h-2v2h2zm2 2V9h-2v2h2zm0 2h2v-2h-2v2zm-2 2v-2h2v2h-2zm0 0h-2v2h2v-2zm-4 4v-2h2v2H8z",fill:"currentColor"})," "]}),"Email authentication settings"]})]}),a.jsx("hr",{className:"w-full border-white/15 h-px -mt-3 mb-1"}),a.jsxs(_n,{className:"p-0",children:[a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(hh,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Email Authentication"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Allow users to sign up with email"})]})]}),a.jsx(gt,{variant:"secondary",className:"text-xs group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:(P=e==null?void 0:e.emailAndPassword)!=null&&P.enabled?a.jsxs(a.Fragment,{children:[a.jsx(Bt,{className:"w-3 h-3"}),"Enabled"]}):a.jsxs(a.Fragment,{children:[a.jsx(Hr,{className:"w-3 h-3"}),"Disabled"]})})]}),((z=e==null?void 0:e.emailAndPassword)==null?void 0:z.enabled)&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(ci,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Sign Up"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Allow new user registration"})]})]}),a.jsx(gt,{variant:"secondary",className:"text-xs group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:(Y=e==null?void 0:e.emailAndPassword)!=null&&Y.disableSignUp?a.jsxs(a.Fragment,{children:[a.jsx(Hr,{className:"w-3 h-3"}),"Disabled"]}):a.jsxs(a.Fragment,{children:[a.jsx(Bt,{className:"w-3 h-3"}),"Enabled"]})})]}),a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(wn,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Email Verification"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Require email verification"})]})]}),a.jsx(gt,{variant:"secondary",className:"text-xs group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:(k=e==null?void 0:e.emailAndPassword)!=null&&k.requireEmailVerification?a.jsxs(a.Fragment,{children:[a.jsx(Bt,{className:"w-3 h-3"}),"Required"]}):a.jsxs(a.Fragment,{children:[a.jsx(As,{className:"w-3 h-3"}),"Optional"]})})]}),a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(gu,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Password Length"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Min/Max password length"})]})]}),a.jsx("div",{className:"text-right",children:a.jsxs("p",{className:"text-sm font-medium text-white",children:[(($=e==null?void 0:e.emailAndPassword)==null?void 0:$.minPasswordLength)||8," -"," ",((M=e==null?void 0:e.emailAndPassword)==null?void 0:M.maxPasswordLength)||128]})})]}),a.jsxs("div",{className:"flex items-center justify-between p-4 px-5 border-b border-white/15 last:border-b-0",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(Mm,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Auto Sign In"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Auto sign in after registration"})]})]}),a.jsx(gt,{variant:"secondary",className:"text-xs group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:(_=e==null?void 0:e.emailAndPassword)!=null&&_.autoSignIn?a.jsxs(a.Fragment,{children:[a.jsx(Bt,{className:"w-3 h-3"}),"Enabled"]}):a.jsxs(a.Fragment,{children:[a.jsx(As,{className:"w-3 h-3"}),"Disabled"]})})]})]})]})]}),a.jsxs(Mn,{className:"border-white/15 bg-black/70 px-0 sm:px-0 md:px-0 lg:px-0 xl:px-0 rounded-none",children:[a.jsxs(Tn,{className:"space-y-0",children:[a.jsxs(Dn,{className:"text-white font-light uppercase text-lg flex items-center space-x-2",children:[a.jsx(Bd,{className:"w-4 h-4 text-white"}),a.jsx("span",{children:"Session"})]}),a.jsxs(Os,{className:"uppercase font-mono font-light flex items-center gap-2 text-gray-400 text-xs",children:[a.jsxs("svg",{className:"w-3 h-3 inline-flex text-gray-400",fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[" ",a.jsx("path",{d:"M8 5v2h2V5H8zm4 4V7h-2v2h2zm2 2V9h-2v2h2zm0 2h2v-2h-2v2zm-2 2v-2h2v2h-2zm0 0h-2v2h2v-2zm-4 4v-2h2v2H8z",fill:"currentColor"})," "]}),"Session management settings"]})]}),a.jsx("hr",{className:"w-full border-white/15 h-px -mt-3 mb-1"}),a.jsxs(_n,{className:"p-0",children:[a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(Bd,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Session Duration"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"How long sessions last"})]})]}),a.jsxs("div",{className:"text-right",children:[a.jsx("p",{className:"text-sm font-medium text-white",children:(E=e==null?void 0:e.session)!=null&&E.expiresIn?`${Math.floor(e.session.expiresIn/(60*60*24))} days`:"7 days"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Default"})]})]}),a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(pg,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Update Age"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Session refresh interval"})]})]}),a.jsx("div",{className:"text-right",children:a.jsx("p",{className:"text-sm font-medium text-white",children:(D=e==null?void 0:e.session)!=null&&D.updateAge?`${Math.floor(e.session.updateAge/(60*60))} hours`:"24 hours"})})]}),a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(Mm,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Session Refresh"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Auto refresh sessions"})]})]}),a.jsx(gt,{variant:"secondary",className:"text-xs group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:(A=e==null?void 0:e.session)!=null&&A.disableSessionRefresh?a.jsxs(a.Fragment,{children:[a.jsx(Hr,{className:"w-3 h-3"}),"Disabled"]}):a.jsxs(a.Fragment,{children:[a.jsx(Bt,{className:"w-3 h-3"}),"Enabled"]})})]}),a.jsxs("div",{className:"flex items-center justify-between p-4 px-5 border-b border-white/15 last:border-b-0",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(_t,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Store in Database"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Store sessions in database"})]})]}),a.jsx(gt,{variant:"secondary",className:"text-xs group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:(q=e==null?void 0:e.session)!=null&&q.storeSessionInDatabase?a.jsxs(a.Fragment,{children:[a.jsx(Bt,{className:"w-3 h-3"}),"Enabled"]}):a.jsxs(a.Fragment,{children:[a.jsx(Vd,{className:"w-3 h-3"}),"Secondary Storage"]})})]})]})]}),a.jsxs(Mn,{className:"border-white/15 bg-black/70 px-0 sm:px-0 md:px-0 lg:px-0 xl:px-0 rounded-none",children:[a.jsxs(Tn,{className:"space-y-0",children:[a.jsxs(Dn,{className:"text-white font-light uppercase text-lg flex items-center space-x-2",children:[a.jsx(wn,{className:"w-4 h-4 text-white"}),a.jsx("span",{children:"Rate Limiting"})]}),a.jsxs(Os,{className:"uppercase font-mono font-light flex items-center gap-2 text-gray-400 text-xs",children:[a.jsxs("svg",{className:"w-3 h-3 inline-flex text-gray-400",fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[" ",a.jsx("path",{d:"M8 5v2h2V5H8zm4 4V7h-2v2h2zm2 2V9h-2v2h2zm0 2h2v-2h-2v2zm-2 2v-2h2v2h-2zm0 0h-2v2h2v-2zm-4 4v-2h2v2H8z",fill:"currentColor"})," "]}),"API rate limiting configuration"]})]}),a.jsx("hr",{className:"w-full border-white/15 h-px -mt-3 mb-1"}),a.jsxs(_n,{className:"p-0",children:[a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(wn,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Rate Limiting"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Enable rate limiting"})]})]}),a.jsx(gt,{variant:"secondary",className:"text-xs group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:(R=e==null?void 0:e.rateLimit)!=null&&R.enabled?a.jsxs(a.Fragment,{children:[a.jsx(Bt,{className:"w-3 h-3"}),"Enabled"]}):a.jsxs(a.Fragment,{children:[a.jsx(As,{className:"w-3 h-3"}),"Disabled"]})})]}),a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(Bd,{className:"w-5 h-5 text-red-400"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Rate Limit Window"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Time window for rate limiting"})]})]}),a.jsxs("div",{className:"text-right",children:[a.jsx("p",{className:"text-sm font-medium text-white",children:(L=e==null?void 0:e.rateLimit)!=null&&L.window?`${e.rateLimit.window} seconds`:"10 seconds"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Window"})]})]}),a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(wn,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Max Requests"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Maximum requests per window"})]})]}),a.jsxs("div",{className:"text-right",children:[a.jsx("p",{className:"text-sm font-medium text-white",children:((X=e==null?void 0:e.rateLimit)==null?void 0:X.max)||100}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Requests"})]})]}),a.jsxs("div",{className:"flex items-center justify-between p-4 px-5 border-b border-white/15 last:border-b-0",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(_t,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Storage"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Rate limit storage type"})]})]}),a.jsx("div",{className:"text-right",children:a.jsx("p",{className:"text-sm font-medium text-white capitalize",children:((G=e==null?void 0:e.rateLimit)==null?void 0:G.storage)||"memory"})})]})]})]}),a.jsxs(Mn,{className:"border-white/15 bg-black/70 px-0 sm:px-0 md:px-0 lg:px-0 xl:px-0 rounded-none",children:[a.jsxs(Tn,{className:"space-y-0",children:[a.jsxs(Dn,{className:"text-white font-light uppercase text-lg flex items-center space-x-2",children:[a.jsx(ho,{className:"w-4 h-4 text-white"}),a.jsx("span",{children:"Advanced"})]}),a.jsxs(Os,{className:"uppercase font-mono font-light flex items-center gap-2 text-gray-400 text-xs",children:[a.jsxs("svg",{className:"w-3 h-3 inline-flex text-gray-400",fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[" ",a.jsx("path",{d:"M8 5v2h2V5H8zm4 4V7h-2v2h2zm2 2V9h-2v2h2zm0 2h2v-2h-2v2zm-2 2v-2h2v2h-2zm0 0h-2v2h2v-2zm-4 4v-2h2v2H8z",fill:"currentColor"})," "]}),"Advanced configuration options"]})]}),a.jsx("hr",{className:"w-full border-white/15 h-px -mt-3 mb-1"}),a.jsxs(_n,{className:"p-0",children:[a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(gu,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Secure Cookies"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Use secure cookies"})]})]}),a.jsx(gt,{variant:"secondary",className:"text-xs group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:(te=e==null?void 0:e.advanced)!=null&&te.useSecureCookies?a.jsxs(a.Fragment,{children:[a.jsx(Bt,{className:"w-3 h-3"}),"Enabled"]}):a.jsxs(a.Fragment,{children:[a.jsx(As,{className:"w-3 h-3"}),"Disabled"]})})]}),a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(wn,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"CSRF Check"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"CSRF protection"})]})]}),a.jsx(gt,{variant:"secondary",className:"text-xs group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:(re=e==null?void 0:e.advanced)!=null&&re.disableCSRFCheck?a.jsxs(a.Fragment,{children:[a.jsx(Hr,{className:"w-3 h-3"}),"Disabled"]}):a.jsxs(a.Fragment,{children:[a.jsx(Bt,{className:"w-3 h-3"}),"Enabled"]})})]}),a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(Go,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"IP Tracking"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Track IP addresses"})]})]}),a.jsx(gt,{variant:"secondary",className:"text-xs group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:(se=(ee=e==null?void 0:e.advanced)==null?void 0:ee.ipAddress)!=null&&se.disableIpTracking?a.jsxs(a.Fragment,{children:[a.jsx(Hr,{className:"w-3 h-3"}),"Disabled"]}):a.jsxs(a.Fragment,{children:[a.jsx(Bt,{className:"w-3 h-3"}),"Enabled"]})})]}),a.jsxs("div",{className:"flex items-center justify-between p-4 px-5 border-b border-white/15 last:border-b-0",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(nR,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Telemetry"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Usage analytics"})]})]}),a.jsx(gt,{variant:"secondary",className:"text-xs group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:(ge=e==null?void 0:e.telemetry)!=null&&ge.enabled?a.jsxs(a.Fragment,{children:[a.jsx(As,{className:"w-3 h-3"}),"Enabled"]}):a.jsxs(a.Fragment,{children:[a.jsx(Bt,{className:"w-3 h-3"}),"Disabled"]})})]})]})]}),a.jsxs(Mn,{className:"border-white/15 bg-black/70 px-0 sm:px-0 md:px-0 lg:px-0 xl:px-0 rounded-none",children:[a.jsxs(Tn,{className:"space-y-0",children:[a.jsxs(Dn,{className:"text-white font-light uppercase text-lg flex items-center space-x-2",children:[a.jsx(Vd,{className:"w-4 h-4 text-white"}),a.jsx("span",{children:"System Info"})]}),a.jsxs(Os,{className:"uppercase font-mono font-light flex items-center gap-2 text-gray-400 text-xs",children:[a.jsxs("svg",{className:"w-3 h-3 inline-flex text-gray-400",fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[" ",a.jsx("path",{d:"M8 5v2h2V5H8zm4 4V7h-2v2h2zm2 2V9h-2v2h2zm0 2h2v-2h-2v2zm-2 2v-2h2v2h-2zm0 0h-2v2h2v-2zm-4 4v-2h2v2H8z",fill:"currentColor"})," "]}),"Better Auth Studio system information"]})]}),a.jsx("hr",{className:"w-full border-white/15 h-px -mt-3 mb-1"}),a.jsxs(_n,{className:"p-0",children:[a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(Mm,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Studio Version"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Better Auth Studio"})]})]}),a.jsxs("div",{className:"text-right",children:[a.jsx("p",{className:"text-sm font-medium text-white",children:h||"v1.0.0"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Latest"})]})]}),a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(Vd,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Node.js Version"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Runtime environment"})]})]}),a.jsxs("div",{className:"text-right",children:[a.jsx("p",{className:"text-sm font-medium text-white",children:(n==null?void 0:n.nodeVersion)||"v18.0.0"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Current"})]})]}),a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(an,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Platform"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Operating system"})]})]}),a.jsxs("div",{className:"text-right",children:[a.jsx("p",{className:"text-sm font-medium text-white",children:(n==null?void 0:n.platform)||"macOS"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"System"})]})]}),a.jsxs("div",{className:"flex items-center justify-between p-4 px-5 border-b border-white/15 last:border-b-0",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(Bd,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Uptime"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Service uptime"})]})]}),a.jsxs("div",{className:"text-right",children:[a.jsx("p",{className:"text-sm font-medium text-white",children:(n==null?void 0:n.uptime)||"2h 15m"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Running"})]})]})]})]}),a.jsxs(Mn,{className:"border-white/15 bg-black/70 px-0 sm:px-0 md:px-0 lg:px-0 xl:px-0 rounded-none lg:col-span-2",children:[a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsxs(Tn,{className:"space-y-0",children:[a.jsxs(Dn,{className:"text-white font-light uppercase text-lg flex items-center space-x-2",children:[a.jsx(yy,{className:"w-4 h-4 text-white"}),a.jsx("span",{children:"Plugins"})]}),a.jsxs(Os,{className:"uppercase font-mono font-light flex items-center gap-2 text-gray-400 text-xs",children:[a.jsxs("svg",{className:"w-3 h-3 inline-flex text-gray-400",fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[" ",a.jsx("path",{d:"M8 5v2h2V5H8zm4 4V7h-2v2h2zm2 2V9h-2v2h2zm0 2h2v-2h-2v2zm-2 2v-2h2v2h-2zm0 0h-2v2h2v-2zm-4 4v-2h2v2H8z",fill:"currentColor"})," "]}),"Better Auth plugins enabled in your configuration"]})]}),a.jsxs("div",{className:"pr-6",children:[a.jsx("p",{className:"text-sm font-medium text-white",children:(r==null?void 0:r.totalPlugins)||0}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Active"})]})]}),a.jsx("hr",{className:"w-full border-white/15 h-px -mt-3 mb-1"}),a.jsx(_n,{className:"space-y-0 px-0 pb-0 border-b-none",children:r!=null&&r.plugins&&r.plugins.length>0?a.jsxs(a.Fragment,{children:[r.plugins.map((ae,ue)=>a.jsxs("div",{className:`flex items-center justify-between p-3 px-5 ${ue<r.plugins.length-1?"border-b border-white/15":""}`,children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(yy,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:ae.name.slice(0,1).toUpperCase()+ae.name.slice(1).replace("-"," ")}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:ae.description})]})]}),a.jsx("div",{className:"text-right flex items-center space-x-2",children:a.jsxs(gt,{variant:"secondary",className:"text-xs bg-green-900/50 border border-dashed rounded-none border-green-500/30 text-green-400 flex items-center gap-1",children:[a.jsx(Bt,{className:"w-3 h-3"}),"Enabled"]})})]},ae.id)),r.configPath&&a.jsx("div",{className:"p-4 px-5 bg-black/30 border-t border-white/10",children:a.jsxs("p",{className:"text-xs text-gray-400",children:["Config file:"," ",a.jsx("span",{className:"text-white font-mono",children:r.configPath})]})})]}):a.jsxs("div",{className:"flex items-center justify-between p-4 px-5",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(As,{className:"w-5 h-5 text-yellow-400"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium text-white",children:"No Plugins Enabled"}),a.jsx("p",{className:"text-xs text-gray-400",children:(r==null?void 0:r.error)||"No plugins are currently configured in your Better Auth setup"})]})]}),a.jsx(gt,{variant:"secondary",className:"text-xs bg-yellow-900/50 border border-yellow-500/30 text-yellow-400 rounded-sm",children:"None"})]})})]})]})]})}function kw(){var M,_;const{orgId:e,teamId:t}=Up(),n=Cs(),[s,r]=m.useState(null),[i,o]=m.useState([]),[l,c]=m.useState(!0),[u,h]=m.useState("details"),[d,f]=m.useState(!1),[x,b]=m.useState(!1),[v,j]=m.useState(""),[g,y]=m.useState([]),[p,w]=m.useState([]),[N,S]=m.useState({name:""}),C=m.useCallback(async()=>{if(t)try{const D=await(await fetch(`/api/teams/${t}`)).json();D.success&&D.team?(r(D.team),S({name:D.team.name})):D.team?(r(D.team),S({name:D.team.name})):V.error("Team not found")}catch{V.error("Failed to load team")}finally{c(!1)}},[t]),T=m.useCallback(async()=>{if(t)try{const D=await(await fetch(`/api/teams/${t}/members`)).json();D.success&&o(D.members||[])}catch{V.error("Failed to load team members")}},[t]),U=async()=>{try{const D=await(await fetch("/api/users?limit=10000")).json(),A=i.map(R=>R.userId),q=(D.users||[]).filter(R=>!A.includes(R.id));y(q)}catch{V.error("Failed to load users")}};m.useEffect(()=>{t&&(C(),T())},[t,C,T]);const B=async()=>{if(!N.name){V.error("Please enter a team name");return}const E=V.loading("Updating team...");try{const A=await(await fetch(`/api/teams/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:N.name})})).json();A.success?(await C(),b(!1),V.success("Team updated successfully!",{id:E})):V.error(`Error updating team: ${A.error||"Unknown error"}`,{id:E})}catch{V.error("Error updating team",{id:E})}},P=async()=>{if(p.length===0){V.error("Please select at least one user");return}const E=V.loading(`Adding ${p.length} members...`);try{const A=await(await fetch(`/api/teams/${t}/members`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userIds:p})})).json();A.success?(await T(),f(!1),w([]),j(""),V.success(`Successfully added ${p.length} members!`,{id:E})):V.error(`Error adding members: ${A.error||"Unknown error"}`,{id:E})}catch{V.error("Error adding members",{id:E})}},z=async(E,D)=>{const A=V.loading(`Removing ${D}...`);try{const R=await(await fetch(`/api/team-members/${E}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})).json();R.success?(await T(),V.success(`${D} removed from team!`,{id:A})):V.error(`Error removing member: ${R.error||"Unknown error"}`,{id:A})}catch{V.error("Error removing team member",{id:A})}},Y=()=>{U(),f(!0)},k=E=>{w(D=>D.includes(E)?D.filter(A=>A!==E):[...D,E])},$=g.filter(E=>E.name.toLowerCase().includes(v.toLowerCase())||E.email.toLowerCase().includes(v.toLowerCase()));return l?a.jsx("div",{className:"flex items-center justify-center h-32",children:a.jsxs("div",{className:"flex flex-col items-center space-y-3",children:[a.jsx(ar,{className:"w-6 h-6 text-white animate-spin"}),a.jsx("div",{className:"text-white text-sm",children:"Loading team details..."})]})}):s?a.jsxs("div",{className:"space-y-6 p-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("div",{className:"flex items-center space-x-4",children:a.jsx("span",{className:"mb-4 ml-0 flex justify-start items-start text-left border-none text-white",children:a.jsxs("span",{className:"font-light",children:[a.jsxs("span",{onClick:()=>n(`/organizations/${s.organizationId}`),className:"uppercase cursor-pointer text-white/80 font-mono text-sm",children:["teams /"," "]}),a.jsx("span",{className:"text-white font-mono text-sm",children:t})]})})}),a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs(W,{onClick:Y,className:"border border-dashed border-white/20 text-white hover:bg-white/10 bg-transparent rounded-none",children:[a.jsx(Kl,{className:"w-4 h-4 mr-2"}),"Add Members"]}),a.jsxs(W,{onClick:()=>b(!0),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:[a.jsx(oi,{className:"w-4 h-4 mr-2"}),"Edit Team"]})]})]}),a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-12 h-12 bg-white/10 border border-dashed border-white/20 rounded-none flex items-center justify-center",children:a.jsx(dt,{className:"w-6 h-6 text-white"})}),a.jsxs("div",{children:[a.jsxs("h1",{className:"text-2xl text-white font-light inline-flex items-center",children:[s.name,t&&a.jsx(Ln,{id:t,variant:"subscript"})]}),a.jsx("div",{className:"flex items-center space-x-2 mt-1",children:s.organization&&a.jsxs($p,{to:`/organizations/${s.organizationId}`,className:"text-gray-400 hover:text-white text-sm font-sans",children:[a.jsx(Un,{className:"w-4 h-4 inline mr-1"}),s.organization.name]})})]})]}),a.jsx("div",{className:"border-b border-white/10",children:a.jsxs("nav",{className:"flex space-x-8",children:[a.jsxs("button",{onClick:()=>h("details"),className:`flex items-center space-x-2 px-3 py-4 text-sm font-medium border-b-2 transition-all duration-200 ${u==="details"?"border-white text-white":"border-transparent text-gray-400 hover:text-white hover:border-gray-300"}`,children:[a.jsx(dt,{className:"w-4 h-4"}),a.jsx("span",{children:"Details"})]}),a.jsxs("button",{onClick:()=>h("members"),className:`flex items-center space-x-2 px-3 py-4 text-sm font-medium border-b-2 transition-all duration-200 ${u==="members"?"border-white text-white":"border-transparent text-gray-400 hover:text-white hover:border-gray-300"}`,children:[a.jsx(dt,{className:"w-4 h-4"}),a.jsxs("span",{className:"inline-flex items-start",children:["Members",a.jsx("sup",{className:"text-xs text-gray-500 ml-1 inline-flex items-baseline",children:a.jsx(vs,{value:i.length,className:"text-white/80 font-mono text-xs",prefix:a.jsx("span",{className:"mr-0.5 text-gray-500",children:"["}),suffix:a.jsx("span",{className:"ml-0.5 text-gray-500",children:"]"}),format:{notation:"standard",maximumFractionDigits:0}})})]})]})]})}),u==="details"&&a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-6",children:[a.jsx("h3",{className:"text-lg text-white font-light mb-4",children:"Team Information"}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs("div",{children:[a.jsx("label",{className:"text-sm text-gray-400 font-mono uppercase",children:"Name"}),a.jsx("p",{className:"text-white font-sans mt-1",children:s.name})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm text-gray-400 font-mono uppercase",children:"Organization"}),a.jsx("p",{className:"text-white font-sans mt-1",children:((M=s.organization)==null?void 0:M.name)||"Unknown"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm text-gray-400 font-mono uppercase",children:"Created"}),a.jsx("p",{className:"text-white font-sans mt-1",children:new Date(s.createdAt).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm text-gray-400 font-mono uppercase",children:"Last Updated"}),a.jsx("p",{className:"text-white font-sans mt-1",children:new Date(s.updatedAt).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})})]})]})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-6",children:a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(dt,{className:"w-8 h-8 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-2xl text-white font-sans font-light",children:i.length}),a.jsx("p",{className:"text-sm text-gray-400 font-mono uppercase",children:"Members"})]})]})}),a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-6",children:a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(ls,{className:"w-8 h-8 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-2xl text-white font-sans font-light",children:Math.ceil((Date.now()-new Date(s.createdAt).getTime())/(1e3*60*60*24))}),a.jsx("p",{className:"text-sm text-gray-400 font-mono uppercase",children:"Days Active"})]})]})}),a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-6",children:a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(Un,{className:"w-8 h-8 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-2xl text-white font-sans font-light",children:"1"}),a.jsx("p",{className:"text-sm text-gray-400 font-mono uppercase",children:"Organization"})]})]})})]})]}),u==="members"&&a.jsxs("div",{className:"space-y-6",children:[a.jsx("div",{className:"flex items-center justify-between",children:a.jsxs("div",{children:[a.jsxs("h3",{className:"text-lg relative text-white font-light inline-flex items-start",children:["Team Members",a.jsx(vs,{value:i.length,className:"text-white/80 font-mono text-xs",prefix:a.jsx("span",{className:"mr-0.5 text-gray-500",children:"["}),suffix:a.jsx("span",{className:"ml-0.5 text-gray-500",children:"]"}),format:{notation:"standard",maximumFractionDigits:0}})]}),a.jsx("p",{className:"text-gray-400 font-light font-mono text-xs uppercase mt-1",children:"Manage members of this team"})]})}),i.length>0?a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none",children:a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-dashed border-white/10",children:[a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"User"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Email"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Role"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Joined"}),a.jsx("th",{className:"text-right py-4 px-4 text-white font-light",children:"Actions"})]})}),a.jsx("tbody",{children:i.map(E=>a.jsxs("tr",{className:"border-b border-dashed border-white/5 hover:bg-white/5",children:[a.jsx("td",{className:"py-4 px-4",children:a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("img",{src:E.user.image||`https://api.dicebear.com/7.x/avataaars/svg?seed=${E.user.id}`,alt:E.user.name,className:"w-10 h-10 rounded-none border border-dashed border-white/20"}),a.jsxs("div",{children:[a.jsx("div",{className:"text-white font-light",children:E.user.name}),a.jsx(Ln,{id:E.user.id})]})]})}),a.jsx("td",{className:"py-4 px-4 text-white",children:E.user.email}),a.jsx("td",{className:"py-4 px-4",children:a.jsx(gt,{variant:"secondary",className:"text-xs bg-blue-900/10 border border-dashed border-blue-500/30 text-blue-400/70 rounded-none capitalize",children:E.role})}),a.jsx("td",{className:"py-4 px-4 text-sm text-gray-400",children:new Date(E.joinedAt).toLocaleDateString()}),a.jsx("td",{className:"py-4 px-4 text-right",children:a.jsx("div",{className:"flex items-center justify-end space-x-2",children:a.jsxs(W,{variant:"outline",size:"sm",className:"border border-dashed border-red-400/50 text-red-400 hover:bg-red-400/10 rounded-none",onClick:()=>z(E.id,E.user.name),children:[a.jsx(ju,{className:"w-4 h-4 mr-1"}),"Remove"]})})})]},E.id))})]})})}):a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-12",children:a.jsxs("div",{className:"text-center",children:[a.jsx(dt,{className:"w-16 h-16 text-gray-400 mx-auto mb-4"}),a.jsx("h3",{className:"text-xl text-white font-light mb-2",children:"No Members Yet"}),a.jsx("p",{className:"text-gray-400 mb-6",children:"Add members to this team to get started."}),a.jsxs(W,{onClick:Y,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:[a.jsx(Kl,{className:"w-4 h-4 mr-2"}),"Add First Members"]})]})})]}),d&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-2xl rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Add Team Members"}),a.jsx(W,{variant:"ghost",size:"sm",onClick:()=>{f(!1),w([]),j("")},className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Vt,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"relative",children:[a.jsx(IC,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-4 h-4"}),a.jsx(Le,{placeholder:"Search users by name or email...",value:v,onChange:E=>j(E.target.value),className:"pl-10 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),p.length>0&&a.jsx("div",{className:"bg-blue-900/20 border border-blue-500/30 rounded-none p-3",children:a.jsxs("p",{className:"text-blue-400 text-sm",children:[p.length," user",p.length!==1?"s":""," selected"]})}),a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none max-h-96 overflow-y-auto",children:$.length>0?a.jsx("div",{className:"divide-y divide-white/5",children:$.map(E=>a.jsxs("div",{className:`flex items-center space-x-3 p-4 cursor-pointer hover:bg-white/5 ${p.includes(E.id)?"bg-blue-900/20":""}`,onClick:()=>k(E.id),children:[a.jsx("input",{type:"checkbox",checked:p.includes(E.id),onChange:()=>k(E.id),className:"rounded border-gray-300"}),a.jsx("img",{src:E.image||`https://api.dicebear.com/7.x/avataaars/svg?seed=${E.id}`,alt:E.name,className:"w-10 h-10 rounded-none border border-dashed border-white/20"}),a.jsxs("div",{className:"flex-1",children:[a.jsx("div",{className:"text-white font-light",children:E.name}),a.jsx("div",{className:"text-sm text-gray-400",children:E.email})]})]},E.id))}):a.jsx("div",{className:"p-8 text-center",children:a.jsx("p",{className:"text-gray-400",children:"No users found matching your search."})})})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(W,{variant:"outline",onClick:()=>{f(!1),w([]),j("")},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsxs(W,{onClick:P,disabled:p.length===0,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none disabled:opacity-50",children:[a.jsx(Kl,{className:"w-4 h-4 mr-2"}),"Add ",p.length," Member",p.length!==1?"s":""]})]})]})}),x&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Edit Team"}),a.jsx(W,{variant:"ghost",size:"sm",onClick:()=>b(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Vt,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-16 h-16 bg-white/10 border border-dashed border-white/20 rounded-none flex items-center justify-center",children:a.jsx(dt,{className:"w-8 h-8 text-white"})}),a.jsxs("div",{children:[a.jsx("div",{className:"text-white font-light",children:s.name}),a.jsx("div",{className:"text-sm text-gray-400",children:(_=s.organization)==null?void 0:_.name})]})]}),a.jsxs("div",{children:[a.jsx(Pe,{htmlFor:"edit-team-name",className:"text-sm text-gray-400 font-light",children:"Team Name"}),a.jsx(Le,{id:"edit-team-name",value:N.name,onChange:E=>S({name:E.target.value}),placeholder:"e.g. Development Team",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(W,{variant:"outline",onClick:()=>b(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(W,{onClick:B,disabled:N.name===s.name,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Update Team"})]})]})})]}):a.jsxs("div",{className:"space-y-6 p-6",children:[a.jsx("div",{className:"flex items-center space-x-4",children:a.jsx("span",{className:"mb-4 ml-0 flex justify-start items-start text-left border-none text-white",children:a.jsxs("span",{className:"font-light",children:[a.jsxs("span",{onClick:()=>n(`/organizations/${e}`),className:"uppercase cursor-pointer text-white/80 font-mono text-sm",children:["teams /"," "]}),a.jsx("span",{className:"text-white font-mono text-sm",children:t})]})})}),a.jsxs("div",{className:"text-center py-12",children:[a.jsx(dt,{className:"w-16 h-16 text-gray-400 mx-auto mb-4"}),a.jsx("h2",{className:"text-xl text-white font-light mb-2",children:"Team Not Found"}),a.jsx("p",{className:"text-gray-400",children:"The team you're looking for doesn't exist."})]})]})}function aV(){const e=Cs(),[t,n]=m.useState([]),[s,r]=m.useState(!0),[i,o]=m.useState(null),[l,c]=m.useState(""),[u,h]=m.useState("all"),[d,f]=m.useState(1),[x]=m.useState(20);m.useEffect(()=>{b()},[]);const b=async()=>{try{const S=await(await fetch("/api/plugins")).json(),C=(S==null?void 0:S.plugins).find(T=>T.id==="teams");o({enabled:!!C,availablePlugins:(S==null?void 0:S.plugins).map(T=>T.id),configPath:S.configPath,teamsPlugin:(S==null?void 0:S.plugins).find(T=>T.id==="teams")}),C?await v():r(!1)}catch(N){console.error("Failed to check teams plugin status:",N),o({enabled:!1,error:"Failed to check plugin status"}),r(!1)}},v=async()=>{try{const S=await(await fetch("/api/teams")).json();S.success&&n(S.teams||[])}catch(N){console.error("Failed to fetch teams:",N),V.error("Failed to load teams")}finally{r(!1)}},j=t.filter(N=>{var C;const S=N.name.toLowerCase().includes(l.toLowerCase())||((C=N.organization)==null?void 0:C.name.toLowerCase().includes(l.toLowerCase()));if(u==="all")return S;if(u==="recent"){const T=new Date;return T.setDate(T.getDate()-7),S&&new Date(N.createdAt)>T}return S}),g=d*x,y=g-x,p=j.slice(y,g),w=Math.ceil(j.length/x);return s?a.jsx("div",{className:"flex items-center justify-center min-h-screen",children:a.jsx(ys,{className:"w-8 h-8 animate-spin text-white"})}):i!=null&&i.enabled?a.jsxs("div",{className:"p-6 space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsxs("h1",{className:"text-2xl relative text-white font-light inline-flex items-start",children:["Teams",a.jsx("sup",{className:"text-xs text-gray-500 ml-1 mt-0 inline-flex items-baseline",children:a.jsx(vs,{value:j.length,className:"text-white font-mono text-sm",prefix:a.jsx("span",{className:"mr-1 text-gray-500",children:"["}),suffix:a.jsx("span",{className:"ml-1 text-gray-500",children:"]"}),format:{notation:"standard",maximumFractionDigits:0}})})]}),a.jsxs("p",{className:"text-gray-400 mt-1 uppercase font-mono text-sm font-light flex items-baseline gap-1",children:[a.jsx(vs,{value:j.length,className:"text-white font-mono text-sm",format:{notation:"standard",maximumFractionDigits:0}}),a.jsxs("span",{children:["team",j.length!==1?"s":""," found"]})]})]}),a.jsx("div",{className:"flex items-center space-x-3",children:a.jsxs(W,{onClick:()=>e("/teams/new"),className:"bg-white text-black hover:bg-gray-200 border-dashed",children:[a.jsx(mr,{className:"w-4 h-4 mr-2"}),"Create Team"]})})]}),a.jsxs("div",{className:"flex items-center space-x-4",children:[a.jsxs("div",{className:"relative flex-1 max-w-md",children:[a.jsx(li,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-4 h-4"}),a.jsx(Le,{type:"text",placeholder:"Search teams...",value:l,onChange:N=>c(N.target.value),className:"pl-10 bg-black border-dashed border-white/20 text-white placeholder-gray-400 focus:ring-2 focus:ring-white focus:border-transparent"})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(W,{variant:u==="all"?"default":"outline",size:"sm",onClick:()=>h("all"),className:u==="all"?"bg-white text-black":"border-dashed border-white/20 text-white hover:bg-white/10",children:"All"}),a.jsx(W,{variant:u==="recent"?"default":"outline",size:"sm",onClick:()=>h("recent"),className:u==="recent"?"bg-white text-black":"border-dashed border-white/20 text-white hover:bg-white/10",children:"Recent"})]})]}),p.length===0?a.jsxs("div",{className:"text-center py-12",children:[a.jsx(ci,{className:"w-12 h-12 text-gray-400 mx-auto mb-4"}),a.jsx("h3",{className:"text-lg font-light text-white mb-2",children:"No teams found"}),a.jsx("p",{className:"text-gray-400 mb-6",children:l?"Try adjusting your search terms":"Get started by creating your first team"}),!l&&a.jsxs(W,{onClick:()=>e("/teams/new"),className:"bg-white text-black hover:bg-gray-200 border-dashed",children:[a.jsx(mr,{className:"w-4 h-4 mr-2"}),"Create Team"]})]}):a.jsx("div",{className:"grid gap-4",children:p.map(N=>{var S;return a.jsx("div",{className:"bg-black/30 border border-white/15 rounded-none p-4 hover:bg-black/40 transition-colors cursor-pointer",onClick:()=>e(`/teams/${N.id}`),children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center space-x-4",children:[a.jsx("div",{className:"w-10 h-10 bg-white/10 rounded-none flex items-center justify-center",children:a.jsx(ci,{className:"w-5 h-5 text-white"})}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-white font-medium",children:N.name}),a.jsxs("p",{className:"text-gray-400 text-sm",children:[(S=N.organization)==null?void 0:S.name," • ",N.memberCount||0," members"]})]})]}),a.jsx("div",{className:"flex items-center space-x-2",children:a.jsx(gt,{variant:"secondary",className:"text-xs bg-green-900/50 border border-dashed rounded-none border-green-500/30 text-green-400",children:"Active"})})]})},N.id)})}),w>1&&a.jsxs("div",{className:"flex items-center justify-center space-x-2",children:[a.jsx(W,{variant:"outline",size:"sm",onClick:()=>f(Math.max(1,d-1)),disabled:d===1,className:"border-dashed border-white/20 text-white hover:bg-white/10 disabled:opacity-50",children:"Previous"}),a.jsxs("span",{className:"text-gray-400 text-sm",children:["Page ",d," of ",w]}),a.jsx(W,{variant:"outline",size:"sm",onClick:()=>f(Math.min(w,d+1)),disabled:d===w,className:"border-dashed border-white/20 text-white hover:bg-white/10 disabled:opacity-50",children:"Next"})]})]}):a.jsxs("div",{className:"space-y-6 p-6",children:[a.jsx("div",{className:"flex items-center justify-between",children:a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl text-white font-light",children:"Teams"}),a.jsx("p",{className:"text-gray-400 mt-1",children:"Manage your application organizations"})]})}),a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-8",children:a.jsxs("div",{className:"flex items-start space-x-4",children:[a.jsx("div",{className:"flex-shrink-0",children:a.jsx(Rs,{className:"w-12 h-12 text-white"})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h3",{className:"text-xl text-white font-light mb-2",children:"Organization Plugin Required"}),a.jsx("p",{className:"text-gray-300 mb-6",children:"To use Organizations in Better Auth Studio, you need to enable the organization plugin in your Better Auth configuration."}),a.jsxs("div",{className:"bg-black/50 border border-dashed border-white/20 rounded-none p-4 mb-6",children:[a.jsx("h4",{className:"text-white font-light mb-3",children:"Follow these steps:"}),a.jsx("ol",{className:"text-gray-300 space-y-2 text-sm list-decimal list-inside",children:a.jsxs("li",{children:["Import the plugin in your auth configuration file",(i==null?void 0:i.configPath)&&a.jsxs("span",{className:"text-gray-400",children:[" (",i.configPath,")"]}),":"]})}),a.jsx("div",{className:"mt-4 bg-black/70 border border-dashed border-white/10 rounded-none p-3 overflow-x-auto",children:a.jsxs("pre",{className:"text-sm text-gray-300",children:[a.jsx("span",{className:"text-blue-400",children:"import"})," ","{ betterAuth }"," ",a.jsx("span",{className:"text-blue-400",children:"from"})," ",a.jsx("span",{className:"text-green-400",children:'"better-auth"'})," ",a.jsx("br",{}),a.jsx("span",{className:"text-blue-400",children:"import"})," ","{ organization }"," ",a.jsx("span",{className:"text-blue-400",children:"from"})," ",a.jsx("span",{className:"text-green-400",children:'"better-auth/plugins/organization"'})," ",a.jsx("br",{}),a.jsx("span",{className:"text-blue-400",children:"export const"})," ",a.jsx("span",{className:"text-yellow-300",children:"auth"})," ="," ",a.jsx("span",{className:"text-yellow-300",children:"betterAuth"}),"(","{"," ",a.jsx("br",{}),a.jsx("span",{className:"text-gray-500 pl-10",children:"// ... your existing configuration"})," ",a.jsx("br",{}),a.jsx("span",{className:"text-red-300 pl-10",children:"plugins"}),": [ ",a.jsx("br",{}),a.jsxs("span",{className:"text-yellow-300 pl-12",children:["organization(",")"]}),a.jsx("br",{}),a.jsx("span",{className:"pl-10",children:"]"})," ",a.jsx("br",{}),"}",") ",a.jsx("br",{})]})}),a.jsx("div",{className:"mt-4",children:a.jsx("p",{className:"text-gray-400 text-sm",children:"2. Do migrations to create the organizations table"})}),a.jsx("div",{className:"mt-2",children:a.jsx("p",{className:"text-gray-400 text-sm",children:"3. Restart your application to apply the changes"})})]}),(i==null?void 0:i.availablePlugins)&&i.availablePlugins.length>0&&a.jsx("div",{className:"mb-4",children:a.jsxs("p",{className:"text-gray-400 text-sm",children:["Currently enabled plugins: ",i.availablePlugins.join(", ")]})}),a.jsx(W,{onClick:()=>window.location.reload(),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Check Again"}),a.jsxs("div",{className:"mt-4 text-xs text-gray-500",children:["Need help? Check the"," ",a.jsx("a",{href:"https://better-auth.com/docs/plugins/organization",target:"_blank",rel:"noopener noreferrer",className:"text-white hover:underline",children:"Better Auth Organization Plugin Documentation"})]})]})]})})]})}function Ch(e){return e?"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_":"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"}function nE(e,t,n){let s="",r=0,i=0;for(const o of e)for(r=r<<8|o,i+=8;i>=6;)i-=6,s+=t[r>>i&63];if(i>0&&(s+=t[r<<6-i&63]),n){const o=(4-s.length%4)%4;s+="=".repeat(o)}return s}function sE(e,t){const n=new Map;for(let o=0;o<t.length;o++)n.set(t[o],o);const s=[];let r=0,i=0;for(const o of e){if(o==="=")break;const l=n.get(o);if(l===void 0)throw new Error(`Invalid Base64 character: ${o}`);r=r<<6|l,i+=6,i>=8&&(i-=8,s.push(r>>i&255))}return Uint8Array.from(s)}const rV={encode(e,t={}){const n=Ch(!1),s=typeof e=="string"?new TextEncoder().encode(e):new Uint8Array(e);return nE(s,n,t.padding??!0)},decode(e){typeof e!="string"&&(e=new TextDecoder().decode(e));const t=e.includes("-")||e.includes("_"),n=Ch(t);return sE(e,n)}},iV={encode(e,t={}){const n=Ch(!0),s=typeof e=="string"?new TextEncoder().encode(e):new Uint8Array(e);return nE(s,n,t.padding??!0)},decode(e){const t=e.includes("-")||e.includes("_"),n=Ch(t);return sE(e,n)}};function oV(){const e=typeof globalThis<"u"&&globalThis.crypto;if(e&&typeof e.subtle=="object"&&e.subtle!=null)return e.subtle;throw new Error("crypto.subtle must be defined")}function lV(e,t){return{digest:async n=>{const s=new TextEncoder,r=typeof n=="string"?s.encode(n):n,i=await oV().digest(e,r);return t==="hex"?Array.from(new Uint8Array(i)).map(c=>c.toString(16).padStart(2,"0")).join(""):t==="base64"||t==="base64url"||t==="base64urlnopad"?t.includes("url")?iV.encode(i,{padding:t!=="base64urlnopad"}):rV.encode(i):i}}}const ex=`// Example custom migration script
493
- import { migrateUser } from '@better-auth/migration';
494
-
495
- async function run() {
496
- const legacyUsers = await fetchLegacyUsers();
497
-
498
- for (const user of legacyUsers) {
499
- await migrateUser({
500
- email: user.email,
501
- passwordHash: user.passwordHash,
502
- metadata: user.metadata,
503
- });
504
- }
505
-
506
- return {
507
- migrated: legacyUsers.length,
508
- timestamp: new Date().toISOString(),
509
- };
510
- }
511
-
512
- run().then(console.log).catch(console.error);`,kl=[{id:"clerk",name:"Clerk",description:"Clerk Migration guide",docs:"https://better-auth.com/docs/migrations/clerk",logo:a.jsx("svg",{width:"1em",height:"1em",role:"img",stroke:"currentColor",fill:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",id:"Clerk--Streamline-Simple-Icons",children:a.jsx("path",{d:"m21.47 20.829 -2.881 -2.881a0.572 0.572 0 0 0 -0.7 -0.084 6.854 6.854 0 0 1 -7.081 0 0.576 0.576 0 0 0 -0.7 0.084l-2.881 2.881a0.576 0.576 0 0 0 -0.103 0.69 0.57 0.57 0 0 0 0.166 0.186 12 12 0 0 0 14.113 0 0.58 0.58 0 0 0 0.239 -0.423 0.576 0.576 0 0 0 -0.172 -0.453Zm0.002 -17.668 -2.88 2.88a0.569 0.569 0 0 1 -0.701 0.084A6.857 6.857 0 0 0 8.724 8.08a6.862 6.862 0 0 0 -1.222 3.692 6.86 6.86 0 0 0 0.978 3.764 0.573 0.573 0 0 1 -0.083 0.699l-2.881 2.88a0.567 0.567 0 0 1 -0.864 -0.063A11.993 11.993 0 0 1 6.771 2.7a11.99 11.99 0 0 1 14.637 -0.405 0.566 0.566 0 0 1 0.232 0.418 0.57 0.57 0 0 1 -0.168 0.448Zm-7.118 12.261a3.427 3.427 0 1 0 0 -6.854 3.427 3.427 0 0 0 0 6.854Z",fill:"#000000","stroke-width":"1"})}),highlights:["Downloads Clerk CSV export and REST API data.","Migrates passwords, totp secrets, and external accounts.","Respects Better Auth plugins (admin, username, phone-number, two-factor)."],script:`import 'dotenv/config';
513
- import { generateRandomString, symmetricEncrypt } from "better-auth/crypto";
514
- import { clerkClient } from '@clerk/clerk-sdk-node';
515
- import { auth } from "@/lib/auth";
516
- import * as fs from "node:fs/promises";
517
-
518
- function getCSVData(csv: string) {
519
- const lines = csv.split('\\n').filter(line => line.trim());
520
- const headers = lines[0]?.split(',').map(header => header.trim()) || [];
521
- const jsonData = lines.slice(1).map(line => {
522
- const values = line.split(',').map(value => value.trim());
523
- return headers.reduce((obj, header, index) => {
524
- obj[header] = values[index] || '';
525
- return obj;
526
- }, {} as Record<string, string>);
527
- });
528
- return jsonData as Array<{
529
- id: string;
530
- first_name: string;
531
- last_name: string;
532
- username: string;
533
- primary_email_address: string;
534
- primary_phone_number: string;
535
- verified_email_addresses: string;
536
- unverified_email_addresses: string;
537
- verified_phone_numbers: string;
538
- unverified_phone_numbers: string;
539
- totp_secret: string;
540
- password_digest: string;
541
- password_hasher: string;
542
- }>;
543
- }
544
-
545
- async function getClerkUsers(totalUsers: number) {
546
- const clerkUsers: any[] = [];
547
- for (let i = 0; i < totalUsers; i += 500) {
548
- const response = await fetch(\`https://api.clerk.com/v1/users?offset=\${i}&limit=500\`, {
549
- headers: { Authorization: \`Bearer \${process.env.CLERK_SECRET_KEY}\` },
550
- });
551
- if (!response.ok) throw new Error(\`Failed to fetch users: \${response.statusText}\`);
552
- clerkUsers.push(...((await response.json()) as any));
553
- }
554
- return clerkUsers;
555
- }
556
-
557
- export async function generateBackupCodes(secret: string) {
558
- const backupCodes = Array.from({ length: 10 })
559
- .map(() => generateRandomString(10, "a-z", "0-9", "A-Z"))
560
- .map(code => \`\${code.slice(0,5)}-\${code.slice(5)}\`);
561
- return symmetricEncrypt({ data: JSON.stringify(backupCodes), key: secret });
562
- }
563
-
564
- function safeDateConversion(timestamp?: number): Date {
565
- if (!timestamp) return new Date();
566
- const date = new Date(timestamp);
567
- if (isNaN(date.getTime())) return new Date();
568
- const year = date.getFullYear();
569
- if (year < 2000 || year > 2100) return new Date();
570
- return date;
571
- }
572
-
573
- async function migrateFromClerk() {
574
- const exportedUserCSV = await fs.readFile("exported_users.csv", "utf-8");
575
- const jsonData = getCSVData(exportedUserCSV);
576
- const clerkUsers = await getClerkUsers(jsonData.length);
577
-
578
- const ctx = await auth.$context;
579
- const isAdminEnabled = ctx.options?.plugins?.find(plugin => plugin.id === "admin");
580
- const isTwoFactorEnabled = ctx.options?.plugins?.find(plugin => plugin.id === "two-factor");
581
- const isUsernameEnabled = ctx.options?.plugins?.find(plugin => plugin.id === "username");
582
- const isPhoneNumberEnabled = ctx.options?.plugins?.find(plugin => plugin.id === "phone-number");
583
-
584
- for (const user of jsonData) {
585
- const {
586
- id,
587
- first_name,
588
- last_name,
589
- username,
590
- primary_email_address,
591
- primary_phone_number,
592
- verified_email_addresses,
593
- verified_phone_numbers,
594
- totp_secret,
595
- password_digest,
596
- } = user;
597
-
598
- const clerkUser = clerkUsers.find((item) => item?.id === id);
599
-
600
- const createdUser = await ctx.adapter.create({
601
- model: "user",
602
- data: {
603
- id,
604
- email: primary_email_address,
605
- emailVerified: verified_email_addresses.length > 0,
606
- name: \`\${first_name} \${last_name}\`,
607
- image: clerkUser?.image_url,
608
- createdAt: safeDateConversion(clerkUser?.created_at),
609
- updatedAt: safeDateConversion(clerkUser?.updated_at),
610
- ...(isTwoFactorEnabled ? { twoFactorEnabled: clerkUser?.two_factor_enabled } : {}),
611
- ...(isAdminEnabled ? {
612
- banned: clerkUser?.banned,
613
- banExpiresAt: clerkUser?.lockout_expires_in_seconds,
614
- role: "user",
615
- } : {}),
616
- ...(isUsernameEnabled ? { username } : {}),
617
- ...(isPhoneNumberEnabled ? {
618
- phoneNumber: primary_phone_number,
619
- phoneNumberVerified: verified_phone_numbers.length > 0,
620
- } : {}),
621
- },
622
- forceAllowId: true,
623
- }).catch(async () => {
624
- return await ctx.adapter.findOne({
625
- model: 'user',
626
- where: [{ field: 'id', value: id }],
627
- });
628
- });
629
-
630
- const externalAccounts = clerkUser?.external_accounts ?? [];
631
- for (const externalAccount of externalAccounts) {
632
- const {
633
- id: externalId,
634
- provider,
635
- provider_user_id,
636
- approved_scopes,
637
- created_at,
638
- updated_at,
639
- } = externalAccount;
640
-
641
- if (provider === 'credential') {
642
- await ctx.adapter.create({
643
- model: 'account',
644
- data: {
645
- id: externalId,
646
- providerId: provider,
647
- accountId: provider_user_id,
648
- scope: approved_scopes,
649
- userId: createdUser?.id,
650
- createdAt: safeDateConversion(created_at),
651
- updatedAt: safeDateConversion(updated_at),
652
- password: password_digest,
653
- },
654
- });
655
- } else {
656
- await ctx.adapter.create({
657
- model: 'account',
658
- data: {
659
- id: externalId,
660
- providerId: provider.replace('oauth_', ''),
661
- accountId: provider_user_id,
662
- scope: approved_scopes,
663
- userId: createdUser?.id,
664
- createdAt: safeDateConversion(created_at),
665
- updatedAt: safeDateConversion(updated_at),
666
- },
667
- forceAllowId: true,
668
- });
669
- }
670
- }
671
-
672
- if (isTwoFactorEnabled && totp_secret) {
673
- await ctx.adapter.create({
674
- model: 'twoFactor',
675
- data: {
676
- userId: createdUser?.id,
677
- secret: totp_secret,
678
- backupCodes: await generateBackupCodes(totp_secret),
679
- },
680
- });
681
- }
682
- }
683
- }
684
-
685
- migrateFromClerk()
686
- .then(() => {
687
- console.log('Migration completed');
688
- process.exit(0);
689
- })
690
- .catch((error) => {
691
- console.error('Migration failed:', error);
692
- process.exit(1);
693
- });`},{id:"supabase",name:"Supabase",description:"Supabase Migration guide",docs:"https://better-auth.com/docs/migrations/supabase",logo:"",highlights:["Exports Supabase auth.users and auth.identities.","Preserves password hashes and metadata fields.","Supports incremental re-runs with idempotent operations."],disabled:!0},{id:"auth0",name:"Auth0",description:"Auth0 Migration guide",docs:"https://better-auth.com/docs/migrations/auth0",logo:"",highlights:["Uses Auth0 Management API bulk exports.","Keeps password hashes compatible with Better Auth adapters.","Migrates applications and roles to Better Auth format."],disabled:!0},{id:"nextauth",name:"NextAuth.js",description:"NextAuth.js Migration guide",docs:"https://better-auth.com/docs/migrations/nextauth",logo:"",highlights:["Reads users/accounts from your existing NextAuth database.","Moves refresh tokens and OAuth profiles into Better Auth.","Supports Prisma, MySQL, and Postgres NextAuth adapters."],disabled:!0},{id:"custom",name:"Custom Script",description:"Custom Migration guide",docs:"https://better-auth.com/docs/migrations/custom",highlights:["Use Better Auth SDK helpers to insert users safely.","Supports dry-run mode to validate before committing.","Perfect for bespoke data sources or ETL pipelines."],custom:!0}];function cV(){const[e,t]=a5(),[n,s]=m.useState(null),[r,i]=m.useState([]),[o,l]=m.useState(!1),[c,u]=m.useState(!1),[h,d]=m.useState([]),[f,x]=m.useState(""),[b,v]=m.useState(!1),[j,g]=m.useState(""),[y,p]=m.useState(ex),[w,N]=m.useState(!1),[S,C]=m.useState(""),[T,U]=m.useState(""),[B,P]=m.useState("SHA-256"),[z,Y]=m.useState("hex"),[k,$]=m.useState(null),[M,_]=m.useState(!1),[E,D]=m.useState(!1),A=(H,O,Z,ie)=>{i(le=>[...le,{id:ie??`log-${Date.now()}-${Math.random()}`,type:H,message:O,timestamp:new Date,status:Z}])},q=m.useRef(new Set),R=m.useRef(new Set),L=m.useRef(new Map),X=m.useRef(null),G=()=>kl.find(H=>!H.disabled)??kl[0],te=kl.find(H=>H.id===j)??G();m.useEffect(()=>{g(b?H=>{var O;return H||((O=G())==null?void 0:O.id)||""}:"")},[b,G]);const re=H=>{g(H),H!=="custom"&&p(ex)},ee=()=>{C(""),U(""),$(null),P("SHA-256"),Y("hex"),N(!0)},se=async()=>{if(!S.trim()){V.error("Enter a password to hash");return}try{_(!0);const H=T?`${T}:${S}`:S,Z=await lV(B,z).digest(H);$(Z),V.success("Password hashed successfully")}catch(H){V.error("Failed to hash password"),console.error(H)}finally{_(!1)}},ge=async H=>{try{await navigator.clipboard.writeText(H),V.success("Copied to clipboard")}catch{V.error("Failed to copy to clipboard")}},ae=H=>{switch(H.toLowerCase()){case"github":return a.jsx(rR,{className:"w-5 h-5 text-white"});case"google":return a.jsx(an,{className:"w-5 h-5 text-white"});case"discord":return a.jsx(an,{className:"w-5 h-5 text-white"});case"twitter":case"x":return a.jsx(an,{className:"w-5 h-5 text-white"});case"facebook":return a.jsx(an,{className:"w-5 h-5 text-white"});case"apple":return a.jsx(an,{className:"w-5 h-5 text-white"});default:return a.jsx(an,{className:"w-5 h-5 text-white"})}},ue=()=>{X.current&&!X.current.closed&&X.current.close(),X.current=null},he=(H,O,Z,ie,le)=>{let Ee=L.current.get(H);Ee||(Ee=new Map,L.current.set(H,Ee));const Re=Ee.get(Z);if(Re){i(yt=>yt.map(Ct=>Ct.id===Re?{...Ct,type:O,message:ie,status:le,timestamp:new Date}:Ct));return}const Ue=`session-${H}-${Z}-${Date.now()}`;Ee.set(Z,Ue),A(O,ie,le,Ue)},we=(H,O,Z=0)=>{q.current.has(H)||q.current.add(H),fetch(`/api/tools/oauth/status?testSessionId=${encodeURIComponent(H)}`).then(le=>le.json()).then(le=>{if(le.hasResult){q.current.delete(H),Ne(le.result);return}if(Z+1>=15){q.current.delete(H),he(H,"error","timeout","⌛ Timed out waiting for account creation. Check Better Auth logs.","failed"),ue(),s(null),V.error("OAuth test timed out waiting for account creation");return}setTimeout(()=>we(H,O,Z+1),2e3)}).catch(le=>{Z+1<15?setTimeout(()=>we(H,O,Z+1),2e3):(q.current.delete(H),he(H,"error","poll-error",`⚠️ Failed to check OAuth status: ${le}`,"failed"),ue(),s(null),V.error("Failed to check OAuth status"))})},Ne=H=>{l(!0);const O=H.testSessionId;if(H.success){if(R.current.has(O)&&H.userInfo)return;if(he(O,"success","waiting","✅ Verified with Better Auth.","completed"),H.userInfo){R.current.add(O);const Z=[H.userInfo.name?`👤 ${H.userInfo.name}`:null,H.userInfo.email?`✉️ ${H.userInfo.email}`:null].filter(Boolean).join(" | "),ie=Z?`✅ ${H.provider} OAuth succeeded — ${Z}`:`✅ ${H.provider} OAuth succeeded!`;he(O,"success","completed",ie,"completed"),V.success(`OAuth test for ${H.provider} passed!`),ue(),s(null),L.current.delete(O)}else he(O,"progress","await-finalize","⌛ OAuth flow finished. Waiting for Better Auth to finalize account...","running"),q.current.has(O)||(q.current.add(O),we(O,H.provider))}else{if(R.current.has(O))return;he(O,"error","waiting","❌ Verification failed with Better Auth.","failed");const Z=H.error?` — ${H.error}`:"";he(O,"error","failed",`❌ ${H.provider} OAuth failed${Z}`,"failed"),V.error(`OAuth test for ${H.provider} failed`),ue(),s(null),L.current.delete(O)}H.success||(R.current.add(O),L.current.delete(O)),sessionStorage.removeItem("oauth_test_session"),sessionStorage.removeItem(`oauth_test_result_${O}`)};m.useEffect(()=>{const H=e.get("oauth_test_result");if(H)try{const O=JSON.parse(decodeURIComponent(H));l(!0),Ne(O),t({})}catch{}},[e,t,Ne]),m.useEffect(()=>{(async()=>{try{const Z=await(await fetch("/api/tools/oauth/providers")).json();Z.success&&Z.providers&&d(Z.providers.filter(ie=>ie.enabled))}catch{}})()},[]);const Ce=async()=>{if(h.length===0){V.error("No OAuth providers configured"),A("error","❌ No OAuth providers found in configuration","failed"),A("info","💡 Please configure at least one OAuth provider in your Better Auth config","failed");return}u(!0)},Ae=async H=>{u(!1),x(""),s("test-oauth"),l(!0),i([]),A("info",`🔍 Testing ${H} OAuth...`,"running");const O=new Date().toISOString();try{A("progress","📡 Contacting Better Auth...","running");const ie=await(await fetch("/api/tools/oauth/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:H})})).json();if(ie.success&&ie.startUrl){L.current.delete(ie.testSessionId),he(ie.testSessionId,"progress","popup-open",`🌐 Opening ${ie.provider} OAuth popup...`,"running");const le={testSessionId:ie.testSessionId,provider:ie.provider,providerId:H,startTime:O};R.current.delete(ie.testSessionId),sessionStorage.setItem("oauth_test_session",JSON.stringify(le));const Ee=600,Re=700,Ue=(window.screen.width-Ee)/2,yt=(window.screen.height-Re)/2,Ct=window.open(ie.startUrl,"oauth-test",`width=${Ee},height=${Re},left=${Ue},top=${yt},scrollbars=yes,resizable=yes`);if(!Ct){A("error","❌ Failed to open OAuth window. Please allow popups for this site.","failed"),A("error","💡 Check your browser popup blocker settings","failed"),V.error("Failed to open OAuth window. Please allow popups."),s(null);return}X.current=Ct;let J=!1;const ne=pe=>{if(pe.origin===window.location.origin){if(pe.data&&pe.data.type==="oauth_test_state"){if(pe.data.status==="redirect")q.current.has(le.testSessionId)||we(le.testSessionId,le.provider);else if(pe.data.status==="error"){J=!0;const I=sessionStorage.getItem("oauth_test_session");let F=ie.provider;if(I)try{F=JSON.parse(I).provider||F}catch{}Ne({success:!1,provider:F,testSessionId:pe.data.testSessionId,error:pe.data.error||"Failed to start OAuth test"}),window.removeEventListener("message",ne),clearInterval(xe),clearTimeout(ce),ue()}return}if(pe.data&&pe.data.type==="oauth_test_result"){window.removeEventListener("message",ne),clearInterval(xe),clearTimeout(ce),J=!0;const I=pe.data.result;Ne(I),q.current.has(I.testSessionId)||we(I.testSessionId,I.provider),ue()}}};window.addEventListener("message",ne);const xe=setInterval(()=>{Ct.closed&&(clearInterval(xe),clearTimeout(ce),window.removeEventListener("message",ne),!sessionStorage.getItem(`oauth_test_result_${le.testSessionId}`)&&!J&&(J=!0,we(le.testSessionId,le.provider)))},500),ce=setTimeout(()=>{Ct.closed||(clearInterval(xe),window.removeEventListener("message",ne),ue(),J||(J=!0),A("error","❌ OAuth test timed out after 5 minutes","failed"),A("error","💡 Possible reasons:","failed"),A("error"," • Authentication took too long","failed"),A("error"," • Provider is not responding","failed"),A("error"," • Network connectivity issues","failed"),V.error("OAuth test timed out"),s(null))},5*60*1e3)}else A("error",`❌ Failed to initiate OAuth test: ${ie.error||"Unknown error"}`,"failed"),ie.details&&A("error",`💡 Details: ${JSON.stringify(ie.details)}`,"failed"),ie.cause&&A("error",`💡 Cause: ${ie.cause}`,"failed"),V.error(ie.error||"Failed to start OAuth test"),s(null)}catch(Z){A("error",`❌ Network error: ${Z}`,"failed"),V.error("Failed to start OAuth test"),s(null)}},tt=()=>{v(!0)},$e=async(H,O)=>{const Z=kl.find(le=>le.id===H);if(!Z){V.error("Unknown migration provider");return}if(Z.disabled){V.info(`${Z.name} migration is coming soon`);return}v(!1),s("run-migration"),l(!0),i([]);const ie=le=>new Promise(Ee=>setTimeout(Ee,le));try{if(A("info",`🚀 Preparing ${Z.name} migration...`,"running"),Z.highlights)for(const Re of Z.highlights)await ie(350),A("progress",Re,"running");A("progress","📡 Sending migration payload to server...","running");const Ee=await(await fetch("/api/tools/migrations/run",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:Z.id,script:Z.custom?O:Z.script})})).json();if(Ee.success)A("progress","🚀 Migration job acknowledged. Follow server logs for live progress.","running"),A("success",`✅ ${Z.name} migration request accepted.`,"completed"),Ee.message&&A("info",Ee.message,"completed"),V.success(`${Z.name} migration flow completed`);else throw new Error(Ee.error||"Migration request failed")}catch(le){A("error",`❌ Migration failed: ${le}`,"failed"),V.error("Migration failed")}finally{s(null)}},Rt=async()=>{s("validate-config"),l(!0),i([]),A("info","Validating Better Auth configuration...","running");try{await new Promise(H=>setTimeout(H,500)),A("progress","Checking database connection...","running"),await new Promise(H=>setTimeout(H,500)),A("progress","Validating plugins configuration...","running"),await new Promise(H=>setTimeout(H,500)),A("success","✅ Configuration is valid!","completed"),V.success("Configuration validated successfully")}catch(H){A("error",`❌ Configuration validation failed: ${H}`,"failed"),V.error("Configuration validation failed")}finally{s(null)}},Tt=async()=>{s("test-db"),l(!0),i([]),A("info","Testing database connection...","running");try{const O=await(await fetch("/api/database/test")).json();await new Promise(Z=>setTimeout(Z,1e3)),A("progress","Checking on database con!","running"),O.success?(A("success","✅ Database connection successful!","completed"),O.result&&Array.isArray(O.result)&&O.result.length>0&&(A("info","📄 Sample user record (first row):","completed"),A("info",JSON.stringify(O.result[0],null,2),"completed")),V.success("Database connection test successful")):(A("error",`❌ Database connection failed: ${O.error||"Unknown error"}`,"failed"),V.error("Database connection test failed"))}catch(H){A("error",`❌ Network error: ${H}`,"failed"),V.error("Failed to test database connection")}finally{s(null)}},Be=async()=>{s("generate-api-key"),l(!0),i([]),A("info","Generating new API key...","running");try{const O=await(await fetch("/api/tools/generate-api-key",{method:"POST",headers:{"Content-Type":"application/json"}})).json();O.success&&O.apiKey?(A("success","✅ API key generated successfully!","completed"),A("info",`API Key: ${O.apiKey}`,"completed"),V.success("API key generated successfully")):(A("error",`❌ Failed to generate API key: ${O.error||"Unknown error"}`,"failed"),V.error("Failed to generate API key"))}catch(H){A("error",`❌ Network error: ${H}`,"failed"),V.error("Failed to generate API key")}finally{s(null)}},We=async()=>{s("health-check"),l(!0),i([]),A("info","Running Better Auth health check...","running");try{A("progress","Testing Better Auth endpoints...","running");const H=await fetch("/api/tools/health-check",{method:"POST"}),O=await H.json();if(!H.ok)throw new Error(O.error||O.message||"Health check failed");O.success?(A("success","✅ Better Auth health check passed","completed"),V.success("Health check passed")):(A("error","❌ Better Auth health check failed","failed"),O.failedEndpoints&&O.failedEndpoints.length>0&&O.failedEndpoints.forEach(Z=>{const ie=Z.status?` (Status: ${Z.status})`:"",le=Z.error?` - ${Z.error}`:"";A("error",` • Endpoint ${Z.endpoint}${ie}${le}`,"failed")}),V.error("Health check failed"))}catch(H){A("error",`❌ Health check failed: ${H instanceof Error?H.message:H}`,"failed"),V.error("Health check failed")}finally{s(null)}},vt=new Set(["test-oauth","test-db","hash-password","health-check"]),bt=[{id:"test-oauth",name:"Test OAuth",description:"Test OAuth provider connections",icon:an,action:Ce,category:"oauth"},{id:"hash-password",name:"Hash Password",description:"Generate SHA hashes",icon:uo,action:ee,category:"utilities"},{id:"run-migration",name:"Run Migration",description:"Run database migrations",icon:ga,action:tt,category:"database"},{id:"test-db",name:"Test Database",description:"Test database connection",icon:ga,action:Tt,category:"database"},{id:"validate-config",name:"Validate Config",description:"Validate Better Auth configuration",icon:k0,action:Rt,category:"utilities"},{id:"generate-api-key",name:"Generate API Key",description:"Generate a new API key",icon:uo,action:Be,category:"utilities"},{id:"health-check",name:"Health Check",description:"Run system health check",icon:wy,action:We,category:"testing"}],Q=[{id:"oauth",name:"OAuth",icon:an},{id:"database",name:"Database",icon:ga},{id:"testing",name:"Testing",icon:wy},{id:"utilities",name:"Utilities",icon:qC}].map(H=>({...H,tools:bt.filter(O=>O.category===H.id)}));return a.jsxs("div",{className:"space-y-8 bg-black w-full min-h-screen",children:[a.jsxs("div",{className:"w-full flex flex-col",children:[a.jsx("div",{className:"flex items-center justify-between p-5 pt-7",children:a.jsxs("div",{className:"pb-8",children:[a.jsx("h1",{className:"text-3xl font-normal text-white tracking-tight",children:"Tools"}),a.jsx("p",{className:"text-gray-300 mt-2 uppercase font-mono font-light text-xs",children:"Utility tools for managing and testing your Better Auth setup"})]})}),a.jsxs("div",{className:"flex flex-col items-center space-y-8",children:[a.jsx("hr",{className:"w-full border-white/15 h-px"}),a.jsx("hr",{className:"w-full border-white/15 h-px"})]}),o&&r.length>0&&a.jsxs("div",{className:"mb-6 p-6 gap-8",children:[a.jsxs("div",{className:"flex items-center justify-between mb-2",children:[a.jsx("h3",{className:"text-sm uppercase font-mono text-gray-400 tracking-wider",children:"Tool Output"}),a.jsx(W,{variant:"ghost",size:"sm",onClick:()=>l(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Vt,{className:"w-4 h-4"})})]}),a.jsx(mi,{title:"Tool Execution Logs",lines:r,isRunning:n!==null,className:"w-full",defaultCollapsed:!1})]}),a.jsx("div",{className:"space-y-8 p-6 gap-8",children:Q.map(H=>a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(H.icon,{className:"w-5 h-5 text-white"}),a.jsx("h2",{className:"text-lg font-light text-white uppercase tracking-wider",children:H.name})]}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:H.tools.map(O=>{const Z=O.icon,ie=n===O.id,le=vt.has(O.id),Ee=!le||n!==null&&n!==O.id||ie;return a.jsxs("button",{onClick:()=>O.action(),disabled:Ee,className:`relative flex items-center space-x-4 p-4 bg-black/30 border border-dashed border-white/20 rounded-none transition-colors text-left group ${le?"hover:bg-black/50 disabled:opacity-50 disabled:cursor-not-allowed":"opacity-60 cursor-not-allowed"}`,children:[a.jsx("div",{className:"p-2 bg-white/10 rounded-none group-hover:bg-white/20 transition-colors",children:ie?a.jsx(ar,{className:"w-6 h-6 text-white animate-spin"}):a.jsx(Z,{className:"w-6 h-6 text-white"})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h4",{className:"text-white font-light mb-1",children:O.name}),a.jsxs("p",{className:"text-xs uppercase font-mono flex items-center text-gray-400",children:[a.jsx(NB,{className:"w-4 h-4 mr-2"}),O.description]})]}),!le&&a.jsx("span",{className:"absolute top-2 right-3 text-[10px] font-mono uppercase tracking-[0.2em] text-white/60",children:"Coming Soon"}),a.jsx(qa,{className:"w-4 h-4 text-gray-400 group-hover:text-white transition-colors"})]},O.id)})})]},H.id))})]}),w&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-2xl rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(uo,{className:"w-5 h-5 text-white"}),a.jsx("h3",{className:"text-xl text-white font-light uppercase tracking-wider",children:"Password Hasher"})]}),a.jsx(W,{variant:"ghost",size:"sm",onClick:()=>N(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Vt,{className:"w-5 h-5"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx(Pe,{className:"text-xs uppercase font-mono text-gray-400",children:"Algorithm"}),a.jsxs("select",{value:B,onChange:H=>P(H.target.value),className:"mt-2 w-full bg-black border border-dashed border-white/20 text-white px-3 py-2 text-sm focus:outline-none",children:[a.jsx("option",{value:"SHA-256",children:"SHA-256"}),a.jsx("option",{value:"SHA-384",children:"SHA-384"}),a.jsx("option",{value:"SHA-512",children:"SHA-512"})]})]}),a.jsxs("div",{children:[a.jsx(Pe,{className:"text-xs uppercase font-mono text-gray-400",children:"Encoding"}),a.jsxs("select",{value:z,onChange:H=>Y(H.target.value),className:"mt-2 w-full bg-black border border-dashed border-white/20 text-white px-3 py-2 text-sm focus:outline-none",children:[a.jsx("option",{value:"hex",children:"Hex"}),a.jsx("option",{value:"base64",children:"Base64"}),a.jsx("option",{value:"base64url",children:"Base64 URL"})]})]})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx(Pe,{className:"text-xs uppercase font-mono text-gray-400",children:"Salt (optional)"}),a.jsx(Le,{value:T,onChange:H=>U(H.target.value),placeholder:"e.g. project-specific-salt",className:"mt-2 bg-black border border-dashed border-white/20 text-white rounded-none"}),a.jsxs("p",{className:"text-[11px] text-gray-500 mt-1 font-mono",children:["Salt is prepended (",a.jsx("span",{className:"text-white/80",children:"salt:password"}),")"]})]}),a.jsxs("div",{children:[a.jsx(Pe,{className:"text-xs uppercase font-mono text-gray-400",children:"Password"}),a.jsxs("div",{className:"relative mt-2",children:[a.jsx(Le,{type:E?"text":"password",value:S,onChange:H=>C(H.target.value),placeholder:"Enter password",className:"bg-black border border-dashed border-white/20 text-white rounded-none pr-10"}),a.jsx("button",{type:"button",onClick:()=>D(H=>!H),className:"absolute inset-y-0 right-0 px-3 flex items-center text-gray-400 hover:text-white","aria-label":E?"Hide password":"Show password",children:E?a.jsx(DS,{className:"w-4 h-4"}):a.jsx(Go,{className:"w-4 h-4"})})]})]})]}),k&&a.jsxs("div",{children:[a.jsx(Pe,{className:"text-xs uppercase font-mono text-gray-400",children:"Hash Result"}),a.jsxs("div",{className:"mt-2 flex items-center space-x-2",children:[a.jsx(Le,{value:k,readOnly:!0,className:"flex-1 bg-black border border-dashed border-white/20 text-white rounded-none"}),a.jsx(W,{variant:"outline",size:"icon",onClick:()=>k&&ge(k),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:a.jsx(wu,{className:"w-4 h-4"})})]})]})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-8 border-t border-dashed border-white/10 pt-6",children:[a.jsx(W,{variant:"outline",onClick:()=>N(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Close"}),a.jsx(W,{onClick:se,disabled:M,className:"rounded-none",children:M?a.jsxs(a.Fragment,{children:[a.jsx(ar,{className:"w-4 h-4 mr-2 animate-spin"}),"Hashing..."]}):"Hash Password"})]})]})}),c&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-8 w-full max-w-2xl rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(an,{className:"w-6 h-6 text-white"}),a.jsx("h3",{className:"text-xl text-white font-light",children:"Select OAuth Provider"})]}),a.jsx(W,{variant:"ghost",size:"sm",onClick:()=>{u(!1),x("")},className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Vt,{className:"w-5 h-5"})})]}),a.jsx("div",{className:"space-y-4",children:h.length===0?a.jsxs("div",{className:"text-center py-12",children:[a.jsx(an,{className:"w-16 h-16 text-gray-400 mx-auto mb-4"}),a.jsx("p",{className:"text-gray-400 mb-2 text-lg",children:"No OAuth providers configured"}),a.jsx("p",{className:"text-sm text-gray-500",children:"Please configure OAuth providers in your Better Auth configuration"})]}):a.jsxs("div",{children:[a.jsxs("label",{className:"block text-sm font-medium text-gray-400 mb-4 uppercase font-mono",children:["Available Providers (",h.length,")"]}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3 max-h-96 overflow-y-auto",children:h.map(H=>a.jsxs("button",{onClick:()=>{x(H.id),setTimeout(()=>{Ae(H.id)},100)},className:`w-full flex items-center space-x-4 p-4 border rounded-none transition-all text-left group ${f===H.id?"border-white/50 bg-white/10":"border-dashed border-white/20 hover:bg-white/5 hover:border-white/30"}`,children:[a.jsx("div",{className:"flex-shrink-0",children:ae(H.id)}),a.jsx("div",{className:"flex-1 min-w-0",children:a.jsx("p",{className:"text-white uppercase font-mono font-light text-base",children:H.name||H.id})}),a.jsx(qa,{className:`w-5 h-5 transition-colors flex-shrink-0 ${f===H.id?"text-white":"text-gray-400 group-hover:text-white"}`})]},H.id))}),a.jsx("p",{className:"text-xs text-gray-500 mt-4 font-mono uppercase",children:"Click on a provider to start the OAuth test"})]})}),a.jsx("div",{className:"flex justify-end space-x-3 mt-8 pt-6 border-t border-dashed border-white/10",children:a.jsx(W,{variant:"outline",onClick:()=>{u(!1),x("")},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"})})]})}),b&&a.jsx("div",{className:"fixed inset-0 bg-black/60 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/95 border border-dashed border-white/20 p-8 w-full max-w-5xl rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(ga,{className:"w-6 h-6 text-white"}),a.jsx("h3",{className:"text-xl text-white font-light uppercase tracking-wider",children:"Select Migration"})]}),a.jsx(W,{variant:"ghost",size:"sm",onClick:()=>v(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Vt,{className:"w-5 h-5"})})]}),a.jsxs("div",{className:"grid md:grid-cols-3 gap-4",children:[a.jsx("div",{className:"space-y-3",children:kl.map(H=>{const O=(te==null?void 0:te.id)===H.id;return a.jsxs("button",{onClick:()=>re(H.id),disabled:H.disabled,className:`w-full flex items-center space-x-3 p-4 border transition-colors rounded-none text-left ${H.disabled?"border-dashed border-white/10 bg-black/30 cursor-not-allowed opacity-60":O?"border-white/60 bg-white/10":"border-dashed border-white/20 hover:bg-white/5 hover:border-white/40"}`,children:[a.jsx("div",{className:"flex-shrink-0 w-10 h-10 bg-white/10 flex items-center justify-center",children:H.logo?H.logo:a.jsx(vy,{className:"w-6 h-6 text-white"})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("p",{className:"text-white uppercase font-mono text-sm",children:H.name}),a.jsx("p",{className:"text-xs uppercase text-gray-400 font-mono mt-1 truncate",children:H.description})]}),H.disabled&&a.jsx("span",{className:"text-[10px] font-mono text-gray-400 uppercase",children:"Coming Soon"})]},H.id)})}),a.jsxs("div",{className:"md:col-span-2 space-y-4",children:[a.jsxs("div",{className:"flex items-start space-x-3",children:[a.jsx("div",{className:"w-12 h-12 bg-white/10 flex items-center justify-center",children:te.logo?te.logo:a.jsx(vy,{className:"w-8 h-8 text-white"})}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("h4",{className:"text-white -mb-2 text-lg font-light uppercase tracking-wider",children:te.name}),a.jsx("p",{className:"text-sm mt-0 text-gray-400 uppercase font-mono leading-relaxed",children:te.description}),a.jsx("div",{className:"flex items-center space-x-2",children:te.docs&&a.jsx(W,{variant:"ghost",size:"sm",asChild:!0,className:"rounded-none border border-dashed",children:a.jsx("a",{href:te.docs,target:"_blank",rel:"noreferrer",children:"View Docs"})})})]})]}),te.highlights&&a.jsx("ul",{className:"space-y-2 text-xs text-gray-300 font-mono bg-black/40 border border-white/10 p-4",children:te.highlights.map(H=>a.jsxs("li",{className:"flex items-start space-x-2",children:[a.jsx("span",{className:"text-white/60 mt-0.5",children:"•"}),a.jsx("span",{children:H})]},H))}),te.disabled?a.jsxs("div",{className:"space-y-4 text-gray-400 font-mono text-xs",children:[a.jsx("p",{children:"This migration provider is coming soon."}),a.jsxs("p",{children:["Subscribe to updates at"," ",a.jsx("a",{href:"https://better-auth.com",target:"_blank",rel:"noreferrer",className:"text-white underline",children:"better-auth.com"}),"."]})]}):te.custom?a.jsxs("div",{className:"space-y-3",children:[a.jsx("label",{className:"text-xs uppercase font-mono text-gray-400",children:"Custom Migration Script"}),a.jsx("textarea",{value:y,onChange:H=>p(H.target.value),className:"w-full h-64 bg-black/70 border border-white/10 text-xs text-gray-200 font-mono p-3 rounded-none focus:outline-none focus:ring-0"}),a.jsxs("div",{className:"flex items-center justify-end space-x-2",children:[a.jsx(W,{variant:"outline",size:"sm",className:"rounded-none",onClick:()=>p(ex),children:"Reset"}),a.jsxs(W,{variant:"ghost",size:"sm",className:"rounded-none text-gray-400 hover:text-white",onClick:()=>ge(y),children:[a.jsx(wu,{className:"w-4 h-4"}),"Copy Script"]}),a.jsx(W,{className:"rounded-none",onClick:()=>$e("custom",y),children:"Run Custom Script"})]})]}):a.jsxs("div",{className:"space-y-3",children:[te.script&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex items-center justify-between text-xs uppercase font-mono text-gray-400",children:[a.jsx("span",{children:"Migration Script Preview"}),a.jsxs(W,{variant:"ghost",size:"sm",className:"rounded-none text-gray-400 hover:text-white",onClick:()=>ge(te.script),children:[a.jsx(wu,{className:"w-4 h-4"}),"Copy Script"]})]}),a.jsx("pre",{className:"bg-black/70 border border-white/10 text-[11px] text-green-200 font-mono p-4 overflow-auto leading-relaxed h-64",children:a.jsx("code",{children:te.script})})]}),a.jsx("div",{className:"flex items-center justify-end space-x-2",children:a.jsxs(W,{className:"rounded-none",onClick:()=>$e(te.id),children:["Run ",te.name," Migration"]})})]})]})]})]})})]})}function dV(){const{userId:e}=Up(),t=Cs(),[n,s]=m.useState(null),[r,i]=m.useState([]),[o,l]=m.useState([]),[c,u]=m.useState([]),[h,d]=m.useState([]),[f,x]=m.useState(!0),[b,v]=m.useState("details"),[j,g]=m.useState(!1),[y,p]=m.useState(!1),[w,N]=m.useState(!1),[S,C]=m.useState(!1),[T,U]=m.useState(!1),[B,P]=m.useState(!1),[z,Y]=m.useState(!1),[k,$]=m.useState(""),[M,_]=m.useState(),[E,D]=m.useState(!1),[A,q]=m.useState(""),[R,L]=m.useState([]),[X,G]=m.useState(!1),[te,re]=m.useState({}),ee=m.useRef({}),se=m.useCallback(async()=>{try{const H=await(await fetch("/api/admin/status")).json();D(H.enabled)}catch{D(!1)}},[]),ge=m.useCallback(async Q=>{try{const H=await fetch("/api/geo/resolve",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ipAddress:Q})});if(H.ok){const O=await H.json();if(O.success&&O.location)return O.location}return null}catch{return null}},[]),ae=m.useCallback(async Q=>{const H=Q.filter(ie=>!ee.current[ie.id]);if(H.length===0)return;const O=await Promise.all(H.map(async ie=>{const le=await ge(ie.ipAddress);return le?{sessionId:ie.id,location:le}:null})),Z={};O.forEach(ie=>{ie&&(Z[ie.sessionId]=ie.location)}),Object.keys(Z).length>0&&(ee.current={...ee.current,...Z},re(ee.current))},[ge]),ue=Q=>{if(!Q)return"🌍";const H=Q.toUpperCase().split("").map(O=>127397+O.charCodeAt(0));return String.fromCodePoint(...H)},he=Q=>Q?Q.replace(/[_-]/g," ").replace(/\b\w/g,H=>H.toUpperCase()):"Unknown Provider",we=Q=>{if(!Q)return"Unknown";const H=new Date(Q);return Number.isNaN(H.getTime())?"Unknown":H.toLocaleString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})},Ne=m.useCallback(async()=>{try{const Q=await fetch(`/api/users/${e}`);if(Q.ok){const H=await Q.json();s(H.user)}else V.error("Failed to fetch user details"),t("/users")}catch{V.error("Failed to fetch user details"),t("/users")}finally{x(!1)}},[e,t]),Ce=m.useCallback(async()=>{try{const[Q,H,O]=await Promise.all([fetch(`/api/users/${e}/organizations`),fetch(`/api/users/${e}/teams`),fetch(`/api/users/${e}/sessions`)]);if(Q.ok){const Z=await Q.json();i(Z.memberships||[])}if(H.ok){const Z=await H.json();l(Z.memberships||[])}if(O.ok){const ie=(await O.json()).sessions||[];u(ie),ae(ie)}}catch{}},[e,ae]),Ae=m.useCallback(async()=>{try{const Q=await fetch(`/api/users/${e}/accounts`);if(Q.ok){const H=await Q.json();d(H.accounts||[])}}catch{}},[e]),tt=async()=>{var Z,ie;if(!n)return;const Q=(Z=document.getElementById("edit-name"))==null?void 0:Z.value,H=(ie=document.getElementById("edit-email"))==null?void 0:ie.value;if(!Q||!H){V.error("Please fill in all fields");return}const O=V.loading("Updating user...");try{const Ee=await(await fetch(`/api/users/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:Q,email:H,role:A||null})})).json();Ee.success?(s({...n,name:Q,email:H,role:A||void 0}),g(!1),q(""),V.success("User updated successfully!",{id:O})):V.error(`Error updating user: ${Ee.error||"Unknown error"}`,{id:O})}catch{V.error("Error updating user",{id:O})}},$e=async()=>{if(!n)return;const Q=V.loading("Deleting user...");try{const O=await(await fetch(`/api/users/${e}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})).json();O.success?(V.success("User deleted successfully!",{id:Q}),t("/users")):V.error(`Error deleting user: ${O.error||"Unknown error"}`,{id:Q})}catch{V.error("Error deleting user",{id:Q})}},Rt=async()=>{if(!n)return;if(!E){V.error("Admin plugin is not enabled. Please enable the admin plugin in your Better Auth configuration to use ban functionality.");return}const Q=V.loading("Banning user...");try{const H=await fetch("/api/admin/ban-user",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:e,banReason:k||"No reason provided",banExpiresIn:M})}),O=await H.json();H.ok?(V.success("User banned successfully!",{id:Q}),p(!1),$(""),_(void 0),Ne()):H.status===403?V.error("You do not have permission to ban users. Admin role required.",{id:Q}):O.adminPluginEnabled&&O.instructions?V.error(`${O.error}`,{id:Q,duration:6e3,description:`Use: ${O.instructions.example}`}):V.error(`Error banning user: ${O.error||O.message||"Unknown error"}`,{id:Q})}catch{V.error("Error banning user",{id:Q})}},Tt=async()=>{if(!n)return;if(!E){V.error("Admin plugin is not enabled. Please enable the admin plugin in your Better Auth configuration to use unban functionality.");return}const Q=V.loading("Unbanning user...");try{const H=await fetch("/api/admin/unban-user",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:e})}),O=await H.json();H.ok?(V.success("User unbanned successfully!",{id:Q}),N(!1),Ne()):H.status===403?V.error("You do not have permission to unban users. Admin role required.",{id:Q}):O.adminPluginEnabled&&O.instructions?V.error(`${O.error}`,{id:Q,duration:6e3,description:`Use: ${O.instructions.example}`}):V.error(`Error unbanning user: ${O.error||O.message||"Unknown error"}`,{id:Q})}catch{V.error("Error unbanning user",{id:Q})}},Be=async Q=>{const H=V.loading("Removing user from organization...");try{const Z=await(await fetch(`/api/organizations/members/${Q}`,{method:"DELETE"})).json();Z.success?(i(ie=>ie.filter(le=>le.id!==Q)),Ce(),V.success("User removed from organization!",{id:H})):V.error(`Error removing user: ${Z.error||"Unknown error"}`,{id:H})}catch{V.error("Error removing user from organization",{id:H})}},We=async Q=>{const H=V.loading("Removing user from team...");try{const Z=await(await fetch(`/api/teams/members/${Q}`,{method:"DELETE"})).json();Z.success?(l(ie=>ie.filter(le=>le.id!==Q)),Ce(),V.success("User removed from team!",{id:H})):V.error(`Error removing user: ${Z.error||"Unknown error"}`,{id:H})}catch{V.error("Error removing user from team",{id:H})}},vt=async Q=>{const H=V.loading("Deleting session...");try{const Z=await(await fetch(`/api/sessions/${Q}`,{method:"DELETE"})).json();Z.success?(u(ie=>ie.filter(le=>le.id!==Q)),V.success("Session deleted successfully!",{id:H})):V.error(`Error deleting session: ${Z.error||"Unknown error"}`,{id:H})}catch{V.error("Error deleting session",{id:H})}},bt=async Q=>{if(!e)return;const H=V.loading("Unlinking account...");try{const O=await fetch(`/api/users/${e}/accounts/${Q}`,{method:"DELETE"});if(O.ok)d(Z=>Z.filter(ie=>ie.id!==Q)),V.success("Account unlinked successfully",{id:H});else{const Z=await O.json();V.error(Z.error||"Failed to unlink account",{id:H})}}catch{V.error("Failed to unlink account",{id:H})}};m.useEffect(()=>{e&&(Ne(),Ce(),Ae(),se())},[e,se,Ne,Ce,Ae]);const ft=async(Q=3)=>{if(e){L([]),G(!0),L([{id:"start",type:"info",message:`Starting session seeding process for ${Q} sessions...`,timestamp:new Date}]);try{const O=await(await fetch(`/api/users/${e}/seed-sessions`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:Q})})).json();if(O.success){const Z=O.results.map((le,Ee)=>le.success?{id:`session-${Ee}`,type:"progress",message:`Creating session ${Ee+1}: ${le.session.token.substring(0,20)}... from ${le.session.ipAddress}`,timestamp:new Date,status:"completed"}:{id:`session-${Ee}`,type:"error",message:`Failed to create session ${Ee+1}: ${le.error}`,timestamp:new Date});L(le=>[...le,...Z]);const ie=O.results.filter(le=>le.success).length;L(le=>[...le,{id:"complete",type:"success",message:`✅ Session seeding completed! Created ${ie}/${Q} sessions successfully`,timestamp:new Date}]),Ce()}else L(Z=>[...Z,{id:"error",type:"error",message:`❌ Session seeding failed: ${O.error||"Unknown error"}`,timestamp:new Date}])}catch(H){L(O=>[...O,{id:"error",type:"error",message:`❌ Network error: ${H}`,timestamp:new Date}])}finally{G(!1)}}};return f?a.jsx("div",{className:"min-h-screen bg-black flex items-center justify-center",children:a.jsx("div",{className:"text-white text-lg",children:"Loading user details..."})}):n?a.jsxs("div",{className:"space-y-6 p-6 bg-black w-full",children:[a.jsxs("div",{className:"w-full flex flex-col",children:[a.jsx("span",{className:"mb-4 ml-0 flex justify-start items-start text-left border-none text-white",children:a.jsxs("span",{className:"font-light",children:[a.jsxs("span",{onClick:()=>t("/users"),className:"uppercase cursor-pointer text-white/80 font-mono text-sm",children:["users /"," "]}),a.jsx("span",{className:"text-white font-mono text-sm",children:n.id})]})}),a.jsx("div",{className:"mb-8 mt-4",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center space-x-4",children:[a.jsx("div",{className:"w-16 h-16 bg-gray-800 border border-dashed border-white/20 flex items-center justify-center",children:n.image?a.jsx("img",{src:n.image,alt:n.name,className:"w-16 h-16 object-cover"}):a.jsx(Cl,{className:"w-8 h-8 text-white"})}),a.jsxs("div",{children:[a.jsxs("h1",{className:"text-3xl font-light text-white inline-flex items-center",children:[n.name,a.jsx(Ln,{id:n.id,variant:"subscript"}),n.role&&a.jsx("sup",{className:"ml-2 px-2 pt-2 pb-2 -mt-1 py-0.5 text-[10px] font-mono uppercase border border-dashed border-white/15 bg-white/5 text-white/80 rounded-none",children:n.role}),n.banned&&a.jsx("sup",{className:"ml-2 px-2 pt-2 pb-2 -mt-1 py-0.5 text-[10px] font-mono uppercase border border-dashed border-red-500/30 bg-red-500/10 text-red-400/80 rounded-none",children:"Banned"})]}),a.jsx("p",{className:"text-gray-400 font-mono text-sm",children:n.email})]})]}),a.jsx("div",{className:"flex items-center space-x-2",children:a.jsxs("div",{className:"relative",children:[a.jsx(W,{variant:"ghost",size:"sm",className:"text-gray-400 hover:text-white rounded-none",onClick:Q=>{Q.stopPropagation(),Y(!z)},children:a.jsx(_S,{className:"w-4 h-4"})}),z&&a.jsxs("div",{className:"absolute z-[999] right-0 top-full mt-1 w-48 bg-black border border-white/20 rounded-none shadow-lg",onClick:Q=>Q.stopPropagation(),children:[a.jsxs("button",{className:"w-full px-4 py-2 text-left text-sm text-white hover:bg-white/10 flex items-center space-x-2",onClick:Q=>{Q.stopPropagation(),Y(!1),g(!0),q(n.role||"")},children:[a.jsx(oi,{className:"w-4 h-4"}),a.jsx("span",{children:"Edit User"})]}),a.jsxs("button",{className:"w-full px-4 py-2 text-left text-sm text-white hover:bg-white/10 flex items-center space-x-2",onClick:Q=>{Q.stopPropagation(),Y(!1),U(!0)},children:[a.jsx(wn,{className:"w-4 h-4"}),a.jsx("span",{children:"Update Password"})]}),E&&(n.banned?a.jsxs("button",{className:"w-full px-4 py-2 text-left text-sm text-green-400 hover:bg-white/10 flex items-center space-x-2",onClick:Q=>{Q.stopPropagation(),Y(!1),N(!0)},children:[a.jsx(Km,{className:"w-4 h-4"}),a.jsx("span",{children:"Unban User"})]}):a.jsxs("button",{className:"w-full px-4 py-2 text-left text-sm text-yellow-400 hover:bg-white/10 flex items-center space-x-2",onClick:Q=>{Q.stopPropagation(),Y(!1),p(!0)},children:[a.jsx(Km,{className:"w-4 h-4"}),a.jsx("span",{children:"Ban User"})]})),a.jsx("div",{className:"border-t border-white/10 my-1"}),a.jsxs("button",{className:"w-full px-4 py-2 text-left text-sm text-red-400 hover:bg-white/10 flex items-center space-x-2",onClick:Q=>{Q.stopPropagation(),Y(!1),P(!0)},children:[a.jsx(cf,{className:"w-4 h-4"}),a.jsx("span",{children:"Delete User"})]})]})]})})]})}),a.jsxs("div",{className:"border border-dashed border-white/20 rounded-none",children:[a.jsx("div",{className:"border-b border-dashed border-white/10",children:a.jsx("nav",{className:"flex space-x-8 px-6",children:[{id:"details",name:"Details",icon:Cl},{id:"organizations",name:"Organizations",icon:Un,count:r.length},{id:"teams",name:"Teams",icon:dt,count:o.length},{id:"accounts",name:"Accounts",icon:km,count:h.length},{id:"sessions",name:"Sessions",icon:gg,count:c.length}].map(Q=>a.jsxs("button",{onClick:()=>v(Q.id),className:`flex items-center space-x-2 py-4 px-2 border-b-2 font-medium text-sm ${b===Q.id?"border-white text-white":"border-transparent text-gray-400 hover:text-white hover:border-white/50"}`,children:[a.jsx(Q.icon,{className:"w-4 h-4 text-white/90"}),a.jsxs("span",{className:"inline-flex items-start",children:[a.jsx("span",{className:"",children:Q.name}),Q.count!==void 0&&a.jsx("sup",{className:"text-xs text-gray-500 ml-1 inline-flex items-baseline",children:a.jsx(vs,{value:Q.count,className:"text-white/80 font-mono text-xs",prefix:a.jsx("span",{className:"mr-0.5 text-gray-500",children:"["}),suffix:a.jsx("span",{className:"ml-0.5 text-gray-500",children:"]"}),format:{notation:"standard",maximumFractionDigits:0}})})]})]},Q.id))})}),a.jsxs("div",{className:"p-6",children:[b==="details"&&a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"overflow-x-hidden bg-white/[3%] border border-white/10 p-6 rounded-none",children:[a.jsx("h3",{className:"text-sm uppercase font-mono text-gray-400 mb-4 tracking-wider",children:"BASIC INFORMATION"}),a.jsx("hr",{className:"border-white/10 -mx-10 border-dashed my-4"}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-start space-x-3",children:[a.jsx(Cl,{className:"w-4 h-4 text-gray-400 mt-1"}),a.jsxs("div",{className:"flex-1",children:[a.jsx("div",{className:"text-xs uppercase font-mono text-gray-500 mb-1",children:"Name"}),a.jsx("div",{className:"text-white font-sans text-sm",children:n.name})]})]}),a.jsxs("div",{className:"flex items-start space-x-3",children:[a.jsx(ia,{className:"w-4 h-4 text-gray-400 mt-1"}),a.jsxs("div",{className:"flex-1",children:[a.jsx("div",{className:"text-xs uppercase font-mono text-gray-500 mb-1",children:"Email"}),a.jsx("div",{className:"text-white font-mono text-sm",children:n.email})]})]}),n.username&&a.jsxs("div",{className:"flex items-start space-x-3",children:[a.jsx(MB,{className:"w-4 h-4 text-gray-400 mt-1"}),a.jsxs("div",{className:"flex-1",children:[a.jsx("div",{className:"text-xs uppercase font-mono text-gray-500 mb-1",children:"Username"}),a.jsx("div",{className:"text-white font-mono text-sm",children:n.username})]})]}),n.phoneNumber&&a.jsxs("div",{className:"flex items-start space-x-3",children:[a.jsx(kB,{className:"w-4 h-4 text-gray-400 mt-1"}),a.jsxs("div",{className:"flex-1",children:[a.jsx("div",{className:"text-xs uppercase font-mono text-gray-500 mb-1",children:"Phone"}),a.jsx("div",{className:"text-white font-mono text-sm",children:"+251 91 234 5678"})]})]}),a.jsxs("div",{className:"flex items-start space-x-3",children:[a.jsx(ls,{className:"w-4 h-4 text-gray-400 mt-1"}),a.jsxs("div",{className:"flex-1",children:[a.jsx("div",{className:"text-xs uppercase font-mono text-gray-500 mb-1",children:"Member Since"}),a.jsx("div",{className:"text-white font-mono text-sm",children:new Date(n.createdAt).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit"})})]})]})]})]}),a.jsxs("div",{className:"overflow-x-hidden bg-white/[3%] border border-white/10 p-6 rounded-none",children:[a.jsx("h3",{className:"text-sm uppercase font-mono text-gray-400 mb-4 tracking-wider",children:"SECURITY"}),a.jsx("hr",{className:"border-white/10 -mx-10 border-dashed my-4"}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between p-3 bg-black/30 border border-white/5 rounded-none",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(ia,{className:"w-4 h-4 text-gray-400"}),a.jsx("div",{children:a.jsx("div",{className:"text-xs uppercase font-mono text-gray-500",children:"Email Verification"})})]}),a.jsx("div",{className:`px-2 rounded-none py-1 text-xs font-mono ${n.emailVerified?"bg-green-500/20 text-green-400":"bg-red-500/20 text-red-400"}`,children:n.emailVerified?"Verified":"Unverified"})]}),a.jsxs("div",{className:"flex items-center justify-between p-3 bg-black/30 border border-white/5 rounded-none",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(ga,{className:"w-4 h-4 text-gray-400"}),a.jsx("div",{children:a.jsx("div",{className:"text-xs uppercase font-mono text-gray-500",children:"Two-Factor Authentication"})})]}),a.jsx("div",{className:`px-2 rounded-none py-1 text-xs font-mono ${n.twoFactorEnabled?"bg-green-500/20 text-green-400":"bg-red-500/20 text-red-400"}`,children:n.twoFactorEnabled?"Enabled":"Disabled"})]})]})]})]}),b==="organizations"&&a.jsx("div",{className:"space-y-4",children:r.length===0?a.jsxs("div",{className:"text-center py-12",children:[a.jsx(Un,{className:"w-12 h-12 text-gray-400 mx-auto mb-4"}),a.jsx("h3",{className:"text-lg font-medium text-white mb-2",children:"No Organizations"}),a.jsx("p",{className:"text-gray-400",children:"This user is not a member of any organizations."})]}):a.jsx("div",{className:"grid gap-4",children:r.map(Q=>a.jsxs("div",{className:"border border-dashed border-white/10 rounded-none p-4 hover:bg-white/5 transition-colors",children:[a.jsxs("div",{className:"flex items-start justify-between mb-3",children:[a.jsxs("div",{className:"flex items-center space-x-4 flex-1",children:[a.jsx("div",{className:"w-12 h-12 bg-black/80 border border-dashed border-white/20 flex items-center justify-center rounded-none",children:Q.organization.image?a.jsx("img",{src:Q.organization.image,alt:Q.organization.name,className:"w-12 h-12 object-cover"}):a.jsx(Un,{className:"w-6 h-6 text-white"})}),a.jsxs("div",{className:"flex-1",children:[a.jsxs("h3",{className:"text-white font-light inline-flex items-start",children:[Q.organization.name,a.jsxs("sup",{className:"text-xs text-gray-500 ml-2 mt-0.5",children:[a.jsx("span",{className:"mr-1",children:"["}),a.jsx("span",{className:"text-white/80 font-mono text-xs",children:Q.organization.slug}),a.jsx("span",{className:"ml-1",children:"]"})]})]}),a.jsxs("p",{className:"text-gray-400 text-sm font-sans mt-1",children:["in ",Q.organization.slug]})]})]}),a.jsx("div",{className:"flex flex-col items-end space-y-2",children:a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsxs("span",{className:"text-gray-500 font-mono text-xs uppercase",children:["Joined:"," "]}),a.jsxs("span",{className:"text-white font-mono text-xs",children:[new Date(Q.joinedAt).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),","," ",new Date(Q.joinedAt).toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0})]})]})})]}),a.jsx("div",{className:"flex items-center justify-end",children:a.jsxs(W,{variant:"outline",size:"sm",onClick:()=>Be(Q.id),className:"border border-dashed border-red-400/20 text-red-400 hover:bg-red-400/10 rounded-none",children:[a.jsx(Qm,{className:"w-4 h-4 mr-1"}),"Remove"]})})]},Q.id))})}),b==="teams"&&a.jsx("div",{className:"space-y-4",children:o.length===0?a.jsxs("div",{className:"text-center py-12",children:[a.jsx(dt,{className:"w-12 h-12 text-gray-400 mx-auto mb-4"}),a.jsx("h3",{className:"text-lg font-medium text-white mb-2",children:"No Teams"}),a.jsx("p",{className:"text-gray-400",children:"This user is not a member of any teams."})]}):a.jsx("div",{className:"grid gap-4",children:o.map(Q=>a.jsxs("div",{className:"border border-dashed border-white/10 rounded-none p-4 hover:bg-white/5 transition-colors",children:[a.jsxs("div",{className:"flex items-start justify-between mb-3",children:[a.jsxs("div",{className:"flex items-center space-x-4 flex-1",children:[a.jsx("div",{className:"w-12 h-12 bg-black/80 border border-dashed border-white/20 flex items-center justify-center rounded-none",children:a.jsx(dt,{className:"w-6 h-6 text-white"})}),a.jsxs("div",{className:"flex-1",children:[a.jsxs("h3",{className:"text-white font-light inline-flex items-start",children:[Q.team.name,a.jsxs("sup",{className:"text-xs text-gray-500 ml-2 mt-0.5",children:[a.jsx("span",{className:"mr-1",children:"["}),a.jsx("span",{className:"text-white/80 font-mono text-xs",children:Q.team.organizationSlug||Q.team.organizationName}),a.jsx("span",{className:"ml-1",children:"]"})]})]}),a.jsxs("p",{className:"text-gray-400 text-sm font-sans mt-1",children:["in"," ",Q.team.organizationSlug||Q.team.organizationName]})]})]}),a.jsx("div",{className:"flex flex-col items-end space-y-2",children:a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsxs("span",{className:"text-gray-500 font-mono text-xs uppercase",children:["Joined:"," "]}),a.jsxs("span",{className:"text-white font-mono text-xs",children:[new Date(Q.joinedAt).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),","," ",new Date(Q.joinedAt).toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0})]})]})})]}),a.jsx("div",{className:"flex items-center justify-end",children:a.jsxs(W,{variant:"outline",size:"sm",onClick:()=>We(Q.id),className:"border border-dashed border-red-400/20 text-red-400 hover:bg-red-400/10 rounded-none",children:[a.jsx(Qm,{className:"w-4 h-4 mr-1"}),"Remove"]})})]},Q.id))})}),b==="accounts"&&a.jsx("div",{className:"space-y-4",children:h.length===0?a.jsxs("div",{className:"text-center py-12",children:[a.jsx(km,{className:"w-12 h-12 text-gray-400 mx-auto mb-4"}),a.jsx("h3",{className:"text-lg font-medium text-white mb-2",children:"No Linked Accounts"}),a.jsx("p",{className:"text-gray-400",children:"This user has not connected any accounts yet."})]}):a.jsx("div",{className:"grid gap-4",children:h.map(Q=>a.jsxs("div",{className:"border border-dashed border-white/10 rounded-none p-4 hover:bg-white/5 transition-colors",children:[a.jsxs("div",{className:"flex items-start justify-between mb-3",children:[a.jsxs("div",{className:"flex items-center space-x-4 flex-1",children:[a.jsx("div",{className:"w-12 h-12 bg-black/80 border border-dashed border-white/20 flex items-center justify-center rounded-none",children:a.jsx(km,{className:"w-6 h-6 text-white"})}),a.jsxs("div",{className:"flex-1",children:[a.jsxs("h3",{className:"text-white font-light inline-flex items-start",children:[he(Q.providerId),a.jsxs("sup",{className:"text-xs text-gray-500 ml-2 mt-0.5",children:[a.jsx("span",{className:"mr-1",children:"["}),a.jsx("span",{className:"text-white/80 font-mono text-xs",children:Q.providerId}),a.jsx("span",{className:"ml-1",children:"]"})]})]}),a.jsx("p",{className:"text-gray-400 text-sm font-sans mt-1",children:Q.email||`Account ID: ${Q.id}`})]})]}),a.jsx("div",{className:"flex flex-col items-end space-y-2 text-right",children:a.jsxs("div",{className:"flex items-center space-x-2 text-xs font-mono text-gray-400",children:[a.jsx("span",{children:"Linked:"}),a.jsx("span",{className:"text-white",children:we(Q.createdAt||Q.updatedAt)})]})})]}),a.jsx("div",{className:"flex items-center justify-end",children:a.jsxs(W,{variant:"outline",size:"sm",onClick:()=>bt(Q.id),className:"border border-dashed border-red-400/20 text-red-400 hover:bg-red-400/10 rounded-none",children:[a.jsx(Qm,{className:"w-4 h-4 mr-1"}),"Unlink"]})})]},Q.id))})}),b==="sessions"&&a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"text-lg font-medium text-white",children:"Sessions"}),a.jsx("p",{className:"text-gray-400 text-sm",children:"Manage user authentication sessions"})]}),a.jsxs(W,{variant:"outline",onClick:()=>{L([]),G(!1),C(!0)},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:[a.jsx(ga,{className:"w-4 h-4 mr-2"}),"Seed Sessions"]})]}),c.length===0?a.jsxs("div",{className:"text-center py-12",children:[a.jsx(gg,{className:"w-12 h-12 text-gray-400 mx-auto mb-4"}),a.jsx("h3",{className:"text-lg font-medium text-white mb-2",children:"No Sessions"}),a.jsx("p",{className:"text-gray-400",children:"This user has no active sessions."})]}):a.jsx("div",{className:"grid gap-4",children:c.map(Q=>{var H,O,Z,ie;return a.jsxs("div",{className:"border border-dashed border-white/10 rounded-none p-4 hover:bg-white/5 transition-colors",children:[a.jsxs("div",{className:"flex items-start justify-between mb-3",children:[a.jsxs("div",{className:"flex items-center space-x-4 flex-1",children:[a.jsx("div",{className:"w-12 h-12 bg-black/80 border border-dashed border-white/20 flex items-center justify-center rounded-none",children:a.jsx(gw,{className:"w-6 h-6 text-white"})}),a.jsxs("div",{className:"flex-1",children:[a.jsxs("h3",{className:"text-white font-light inline-flex items-start",children:["Session ",Q.id.substring(0,8),"...",a.jsxs("sup",{className:"text-xs text-gray-500 ml-2 mt-0.5",children:[a.jsx("span",{className:"mr-1",children:"["}),a.jsx("span",{className:"text-white/80 font-mono text-xs",children:Q.ipAddress}),a.jsx("span",{className:"ml-1",children:"]"})]})]}),a.jsxs("div",{className:"flex items-center space-x-2 mt-2",children:[a.jsx(EB,{className:"w-3.5 h-3.5 text-gray-400"}),a.jsxs("span",{className:"text-gray-400 uppercase font-mono text-xs",children:[((H=te[Q.id])==null?void 0:H.city)||"...",","," ",((O=te[Q.id])==null?void 0:O.country)||"..."]}),((Z=te[Q.id])==null?void 0:Z.countryCode)&&a.jsx("span",{className:"text-xs ml-1",children:ue((ie=te[Q.id])==null?void 0:ie.countryCode)})]})]})]}),a.jsx("div",{className:"flex flex-col items-end space-y-2",children:a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsxs("span",{className:"text-gray-500 font-mono text-xs uppercase",children:["Expires:"," "]}),a.jsxs("span",{className:"text-white font-mono text-xs",children:[new Date(Q.expiresAt).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),","," ",new Date(Q.expiresAt).toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0})]})]})})]}),a.jsx("div",{className:"flex items-center justify-end",children:a.jsxs(W,{variant:"outline",size:"sm",onClick:()=>vt(Q.id),className:"border border-dashed border-red-400/20 text-red-400 hover:bg-red-400/10 rounded-none",children:[a.jsx(Km,{className:"w-4 h-4 mr-1"}),"Revoke"]})})]},Q.id)})})]})]})]})]}),j&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 rounded-none p-6 w-full max-w-md",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Edit User"}),a.jsx(W,{variant:"ghost",size:"sm",onClick:()=>{g(!1),q("")},className:"text-gray-400 hover:text-white rounded-none",children:"×"})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-16 h-16 bg-black/80 border border-dashed border-white/20 flex items-center justify-center",children:n!=null&&n.image?a.jsx("img",{src:n.image,alt:n.name,className:"w-16 h-16 object-cover"}):a.jsx(Cl,{className:"w-8 h-8 text-white"})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h4",{className:"text-white font-medium",children:n==null?void 0:n.name}),a.jsx("p",{className:"text-gray-400 text-sm",children:n==null?void 0:n.email})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-400 mb-2",children:"Name"}),a.jsx("input",{id:"edit-name",type:"text",defaultValue:(n==null?void 0:n.name)||"",className:"w-full px-3 py-2 bg-gray-800 border border-dashed border-white/20 rounded-none text-white placeholder-gray-400 focus:outline-none focus:border-white/50"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-400 mb-2",children:"Email"}),a.jsx("input",{id:"edit-email",type:"email",defaultValue:(n==null?void 0:n.email)||"",className:"w-full px-3 py-2 bg-gray-800 border border-dashed border-white/20 rounded-none text-white placeholder-gray-400 focus:outline-none focus:border-white/50"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-400 mb-2",children:"Role"}),a.jsxs(us,{className:"bg-black text-white",value:A,onValueChange:q,children:[a.jsx(hs,{className:"w-full border border-dashed border-white/20 bg-black text-white rounded-none",children:a.jsx(Jr,{placeholder:"Select role"})}),a.jsxs(fs,{children:[a.jsx(ct,{value:"",children:"None"}),a.jsx(ct,{value:"admin",children:"Admin"}),a.jsx(ct,{value:"user",children:"User"})]})]})]})]}),a.jsxs("div",{className:"flex justify-end space-x-2 mt-6",children:[a.jsx(W,{variant:"outline",onClick:()=>{g(!1),q("")},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(W,{onClick:tt,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Update"})]})]})}),y&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black border border-red-400/20 rounded-none p-6 w-full max-w-md",children:[a.jsx("h2",{className:"text-xl font-bold text-white mb-4",children:"Ban User"}),a.jsxs("p",{className:"text-gray-400 mb-4",children:["Ban ",a.jsx("strong",{children:n.name})," from accessing the system."]}),a.jsxs("div",{className:"space-y-4 mb-6",children:[a.jsxs("div",{children:[a.jsx(Pe,{htmlFor:"banReason",className:"text-white",children:"Ban Reason"}),a.jsx(Le,{id:"banReason",value:k,onChange:Q=>$(Q.target.value),placeholder:"Enter reason for ban (optional)",className:"bg-black border border-dashed border-white/20 text-white rounded-none"})]}),a.jsxs("div",{children:[a.jsx(Pe,{htmlFor:"banExpires",className:"text-white",children:"Ban Duration (seconds)"}),a.jsx(Le,{id:"banExpires",type:"number",value:M||"",onChange:Q=>_(Q.target.value?Number(Q.target.value):void 0),placeholder:"Leave empty for permanent ban",className:"bg-black border border-dashed border-white/20 text-white rounded-none"}),a.jsx("p",{className:"text-xs text-gray-400 mt-1",children:"Examples: 3600 (1 hour), 86400 (1 day), 604800 (1 week)"})]})]}),a.jsxs("div",{className:"flex justify-end space-x-2",children:[a.jsx(W,{variant:"outline",onClick:()=>{p(!1),$(""),_(void 0)},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(W,{onClick:Rt,className:"bg-red-600 text-white hover:bg-red-700 rounded-none",children:"Ban User"})]})]})}),w&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black border border-green-400/20 rounded-none p-6 w-full max-w-md",children:[a.jsx("h2",{className:"text-xl font-bold text-white mb-4",children:"Unban User"}),a.jsxs("p",{className:"text-gray-400 mb-6",children:["Are you sure you want to unban ",a.jsx("strong",{children:n.name}),"? This will restore their access to the system."]}),a.jsxs("div",{className:"flex justify-end space-x-2",children:[a.jsx(W,{variant:"outline",onClick:()=>N(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(W,{onClick:Tt,className:"bg-green-400 text-white hover:bg-green-700 rounded-none",children:"Unban User"})]})]})}),B&&n&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Delete User"}),a.jsx(W,{variant:"ghost",size:"sm",onClick:()=>P(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Vt,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-16 h-16 bg-black/80 border border-dashed border-white/20 flex items-center justify-center",children:n.image?a.jsx("img",{src:n.image,alt:n.name,className:"w-16 h-16 object-cover"}):a.jsx(Cl,{className:"w-8 h-8 text-white"})}),a.jsxs("div",{children:[a.jsx("div",{className:"text-white font-light",children:n.name}),a.jsx("div",{className:"text-sm text-gray-400",children:n.email})]})]}),a.jsx("p",{className:"text-gray-400",children:"Are you sure you want to delete this user? This action cannot be undone."})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(W,{variant:"outline",onClick:()=>P(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(W,{onClick:$e,className:"bg-red-500 hover:bg-red-600 text-white border border-red-500 rounded-none",children:"Delete"})]})]})}),T&&n&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Update Password"}),a.jsx(W,{variant:"ghost",size:"sm",onClick:()=>U(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Vt,{className:"w-4 h-4"})})]}),a.jsx("div",{className:"space-y-4",children:a.jsxs("div",{children:[a.jsx(Pe,{htmlFor:"new-password",className:"text-sm text-gray-400 font-light",children:"New Password"}),a.jsx(Le,{id:"new-password",type:"password",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]})}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(W,{variant:"outline",onClick:()=>U(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(W,{onClick:async()=>{var O;const Q=(O=document.getElementById("new-password"))==null?void 0:O.value;if(!Q){V.error("Please enter a password");return}const H=V.loading("Updating password...");try{const ie=await(await fetch(`/api/users/${e}/password`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({password:Q})})).json();ie.success?(U(!1),document.getElementById("new-password").value="",V.success("Password updated successfully!",{id:H})):V.error(`Error updating password: ${ie.error||"Unknown error"}`,{id:H})}catch{V.error("Error updating password",{id:H})}},className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Update"})]})]})}),S&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"overflow-x-hidden bg-black/90 border border-white/10 p-6 w-full pt-4 max-w-2xl rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsxs("h3",{className:"text-sm text-white flex items-center justify-center font-light uppercase",children:[a.jsx("span",{className:"text-white/50 mr-2",children:"["}),a.jsx(gw,{className:"inline mr-2 w-3 h-3 text-white"}),a.jsx("span",{className:"font-mono text-white/70 uppercase",children:"Seed Sessions"}),a.jsx("span",{className:"text-white/50 ml-2",children:"]"})]}),a.jsx(W,{variant:"ghost",size:"sm",onClick:()=>C(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Vt,{className:"w-4 h-4"})})]}),a.jsx("hr",{className:"border-white/10 -mx-10 border-dashed -mt-4 mb-4"}),a.jsxs("div",{className:"space-y-6",children:[a.jsx("div",{className:"space-y-4",children:a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs("div",{className:"flex-1",children:[a.jsx(Pe,{htmlFor:"session-count",className:"text-sm text-gray-400 font-light",children:"Number of sessions"}),a.jsx(Le,{id:"session-count",type:"number",min:"1",max:"50",defaultValue:"3",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsx(W,{onClick:()=>{var H;const Q=parseInt(((H=document.getElementById("session-count"))==null?void 0:H.value)||"3",10);ft(Q)},disabled:X,className:"bg-transparent hover:bg-white/90 bg-white text-black border border-white/20 rounded-none mt-6 disabled:opacity-50",children:X?a.jsxs(a.Fragment,{children:[a.jsx(ar,{className:"w-3 h-3 mr-2 animate-spin"}),"Seeding..."]}):a.jsxs(a.Fragment,{children:[a.jsx(ga,{className:"w-3 h-3 mr-2"}),"Seed Sessions"]})})]})}),R.length>0&&a.jsx("div",{className:"mt-6",children:a.jsx(mi,{title:"Session Seeding Terminal",lines:R,isRunning:X,className:"w-full",defaultCollapsed:!0})})]}),a.jsx("hr",{className:"border-white/10 -mx-10 border-dashed mt-10"}),a.jsx("div",{className:"flex justify-end mt-6 pt-6",children:a.jsx(W,{variant:"outline",onClick:()=>C(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Close"})})]})})]}):a.jsx("div",{className:"min-h-screen bg-black flex items-center justify-center",children:a.jsx("div",{className:"text-white text-lg",children:"User not found"})})}function uV(){return a.jsx(c7,{children:a.jsxs(e5,{children:[a.jsx(t$,{children:a.jsxs(WM,{children:[a.jsx(gn,{path:"/",element:a.jsx(ZB,{})}),a.jsx(gn,{path:"/users",element:a.jsx(tE,{})}),a.jsx(gn,{path:"/users/:userId",element:a.jsx(dV,{})}),a.jsx(gn,{path:"/organizations",element:a.jsx(eE,{})}),a.jsx(gn,{path:"/organizations/:orgId",element:a.jsx(tV,{})}),a.jsx(gn,{path:"/teams",element:a.jsx(aV,{})}),a.jsx(gn,{path:"/teams/:teamId",element:a.jsx(kw,{})}),a.jsx(gn,{path:"/organizations/:orgId/teams/:teamId",element:a.jsx(kw,{})}),a.jsx(gn,{path:"/sessions",element:a.jsx(nV,{})}),a.jsx(gn,{path:"/database",element:a.jsx(JB,{})}),a.jsx(gn,{path:"/database/demo",element:a.jsx(l7,{})}),a.jsx(gn,{path:"/tools",element:a.jsx(cV,{})}),a.jsx(gn,{path:"/settings",element:a.jsx(sV,{})})]})}),a.jsx(_5,{className:"rounded-none border-dashed border-white/20",theme:"dark",position:"top-right",richColors:!0,toastOptions:{style:{border:"dashed 1px #ffffff20",borderRadius:"0"},className:"font-mono uppercase"},closeButton:!0})]})})}eM.createRoot(document.getElementById("root")).render(a.jsx(K.StrictMode,{children:a.jsx(uV,{})}));